From 2c6539ef510adbd9083c18bbbdf18c92d5e273a4 Mon Sep 17 00:00:00 2001 From: FrankCV2048 <1395405735@qq.com> Date: Sun, 15 Dec 2024 19:54:44 +0800 Subject: [PATCH] =?UTF-8?q?update=20=E6=9B=B4=E6=96=B0=E7=95=8C=E9=9D=A2?= =?UTF-8?q?=E6=9B=B4=E6=96=B0=E9=80=BB=E8=BE=91=EF=BC=8C=E5=AD=90=E7=BA=BF?= =?UTF-8?q?=E7=A8=8B=E8=A7=A6=E5=8F=91=E4=BB=A3=E7=90=86=E4=BA=A4=E4=BA=8E?= =?UTF-8?q?=E4=B8=BB=E7=BA=BF=E7=A8=8B=E6=9B=B4=E6=96=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Constant.py | 2 +- Seting.ini | 16 ++++++++-------- main.py | 23 +++++++++++++++-------- 3 files changed, 24 insertions(+), 17 deletions(-) diff --git a/Constant.py b/Constant.py index a4a2c19..d32e2d7 100644 --- a/Constant.py +++ b/Constant.py @@ -1,6 +1,6 @@ import os -Debug = False +Debug = True IO_EmergencyPoint = 3 bag_height = 10 # 一袋的高度 position_accuracy = 0.1 diff --git a/Seting.ini b/Seting.ini index 1253dcc..3c6817e 100644 --- a/Seting.ini +++ b/Seting.ini @@ -1,7 +1,7 @@ [Main] [Robot_Feed] -ipaddress = 192.168.20.4 +ipaddress = 127.0.0.1 port = 502 j1_min = -150 j1_max = +150 @@ -47,7 +47,7 @@ photo_v5 = 0.0 photo_w5 = 1.0 linecount = 2 remain_linename = 1 -remain_count = 12 +remain_count = 574 io_take_addr = 8 io_zip_addr = 11 io_shake_addr = 12 @@ -62,12 +62,12 @@ feed_speed = 10 reset_speed = 35 [Origin] -x = 1927.155273 -y = 570.19989 -z = 1299.689941 -u = 6.975893 -v = -9.897896 -w = -135.095978 +x = 7.0 +y = 50.0 +z = 1.0 +u = 12.0 +v = 0.0 +w = 1.0 [Camera_Feed] ipaddress = 127.0.0.1 diff --git a/main.py b/main.py index 31ee896..0323308 100644 --- a/main.py +++ b/main.py @@ -1,6 +1,7 @@ import configparser import json import logging +import os import queue import sys import threading @@ -47,6 +48,7 @@ from view.ResetView import StopDialog class MainWindow(QMainWindow, Ui_MainWindow): + updateUI_seting = Signal() def __init__(self): super(MainWindow, self).__init__() self.setupUi(self) @@ -642,6 +644,7 @@ class MainWindow(QMainWindow, Ui_MainWindow): self.last_time = time.time() self.remain_lineName = self.configReader.get('Robot_Feed', 'remain_lineName') self.remain_Count = int(self.configReader.get('Robot_Feed', 'remain_Count')) + self.updateUI_seting.connect(self.update_seting_frame) try: self.robotClient.CreatConnect() except: @@ -1365,13 +1368,14 @@ class MainWindow(QMainWindow, Ui_MainWindow): self.label_date.setText(datetime.now().strftime("%Y-%m-%d")) self.label_time.setText(datetime.now().strftime("%H:%M:%S")) - self.updateUI_Position() - self.updateUI_label_detection() - self.updateUI_label_status() - self.updateUI_frame_sign(self.feeding.feedStatus) - self.updateUI_IOPanel() - + self.updateUI_seting.emit() + def update_seting_frame(self): + self.updateUI_Position() + self.updateUI_label_detection() + self.updateUI_label_status() + self.updateUI_frame_sign(self.feeding.feedStatus) + self.updateUI_IOPanel() def updateRobotSeting(self): self.lineEdit_origin_x.setText(str(self.robotClient.origin_position.X)) @@ -1972,7 +1976,10 @@ if __name__ == "__main__": app = MyApplication(sys.argv) window = MainWindow() window.show() - sys.excepthook = handle_exception # 你的 PySide 应用程序代码 pass - sys.exit(app.exec()) + sys.excepthook = handle_exception + try : + sys.exit(app.exec()) + except Exception as e: + log.log_message(logging.ERROR, e)