update 修改复位,清除报警,识别等信息

This commit is contained in:
Gogs
2024-12-09 14:03:53 +08:00
parent f9b338f901
commit e43859b522
3 changed files with 139 additions and 27 deletions

44
main.py
View File

@ -23,7 +23,7 @@ from Model.FeedModel import LineModel, PositionModel
from Util.util_ini import writeFeedLine_to_ini
import Constant
from CU.Command import FeedCommand
from CU.Feeding import FeedLine, FeedingConfig, Feeding, FeedStatus, FeedMidStatus
from CU.Feeding import FeedLine, FeedingConfig, Feeding, FeedStatus, FeedMidStatus, ResetStatus
from Util.util_log import QTextEditLogger
from Util.util_time import CRisOrFall
from Vision.camera_coordinate_dete import Detection
@ -39,6 +39,9 @@ from CU.Command import Status
from Util.util_log import log
from Vision.detect_person import DetectionPerson
from ui_MainWin import Ui_MainWindow
from view.ResetView import StopDialog
#from view.ResetView import StopDialog
@ -542,13 +545,13 @@ class MainWindow(QMainWindow, Ui_MainWindow):
def init_Run(self):
self.robotClient = None
self.configReader = configparser.ConfigParser()
self.detection = None # Detection() #TODO 关闭图像
self.detection =Detection() #TODO 关闭图像
self.command_position_quene = Queue()
self.status_address = DataAddress()
self.feedLine_dict = {}
self.command_quene = Queue()
self.main_threading = None
self.detection_person = None #DetectionPerson()
self.detection_person = None # DetectionPerson()
self.cton_take_no_photo = CRisOrFall()
self.configReader.read(Constant.set_ini)
@ -1133,6 +1136,9 @@ class MainWindow(QMainWindow, Ui_MainWindow):
self.send_start_tool_command()
def send_reset_button_click(self):
# TODO 清楚痕迹
# TODO 开启自动
line_head = self.comboBox_lineIndex.currentData()
#safe_position = self.feedLine_dict[line_head].safe_position
# self.send_position_command(safe_position.X, safe_position.Y, safe_position.Z, safe_position.U, safe_position.V, safe_position.W,move_type=MoveType.WORLD)
@ -1149,16 +1155,18 @@ class MainWindow(QMainWindow, Ui_MainWindow):
else:
log.log_message(logging.ERROR, Constant.str_feed_reset_no_line_error)
return
self.feeding.reset_status = ResetStatus.RStart
dialog_reset = StopDialog()
dialog_reset.stop_thread_signal.connect(self.stop_reset_thread)
else:
log.log_message(logging.ERROR, Constant.str_feed_reset_no_line_error)
return
thread = threading.Thread(target=self.feeding.return_original_position())
thread.start()
# dialog_reset = StopDialog()
# dialog_reset.stop_thread_signal.connect(self.stop_reset_thread)
# thread = threading.Thread(target=self.feeding.return_original_position())
# thread.start()
def stop_reset_thread(self):
self.feeding.run_reverse = False
self.feeding.reset_status = ResetStatus.ROk
self.send_clear_auto_command()
self.send_emergency_alarm_command()
@ -1256,6 +1264,7 @@ class MainWindow(QMainWindow, Ui_MainWindow):
try:
self.feeding.run()
self.feeding.run_reseet()
except:
print(Error_Code.SYS_NONEPoint)
@ -1277,7 +1286,7 @@ class MainWindow(QMainWindow, Ui_MainWindow):
# return
log.log_message(logging.ERROR, '人员进入安全区')
time.sleep(3)
time.sleep(1)
pass
def updateUI(self):
@ -1305,12 +1314,15 @@ 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_InfoMB()
# self.updateUI_Position()
# self.updateUI_label_detection()
# self.updateUI_label_status()
# self.updateUI_frame_sign(self.feeding.feedStatus)
# self.updateUI_IOPanel()
# self.updateUI_InfoMB()
def updateUI_InfoMB(self):
if self.cton_take_no_photo.Q(self.feeding.take_no_photo,True):
self.show_infomessage_box("未识别到料袋报警,请重新放料后,点击继续")
@ -1533,7 +1545,7 @@ class MainWindow(QMainWindow, Ui_MainWindow):
def send_clear_alarm_command(self, pause: bool):
self.send_start_tool_command()
pause_command = CMDRequest()
pause_command.cmdData.append("clearAlarmContinue")
pause_command.cmdData.append("StopButton")
pause_command.cmdData.append("1")
request_command = pause_command.toString()
print(request_command)