From 3e065af6a0c9e6bd4be6823e42eb01fdfced5d4f Mon Sep 17 00:00:00 2001 From: FrankCV2048 <1395405735@qq.com> Date: Fri, 3 Jan 2025 20:38:41 +0800 Subject: [PATCH] =?UTF-8?q?:lipstick:=20update=20=E5=BC=B9=E7=AA=97?= =?UTF-8?q?=E6=94=B9=E4=B8=BA=E4=B8=AD=E6=96=87?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- CU/Feeding.py | 4 ++-- main.py | 17 +++++++++++------ 2 files changed, 13 insertions(+), 8 deletions(-) diff --git a/CU/Feeding.py b/CU/Feeding.py index 6e732fb..484123b 100644 --- a/CU/Feeding.py +++ b/CU/Feeding.py @@ -493,13 +493,13 @@ class Feeding(QObject): self.next_position() elif self.feedStatus == FeedStatus.FDropBag: - self.log_signal.emit(logging.INFO, Constant.str_feed_drop) + if self.get_current_position().get_position().compare(real_position,is_action=True): # self.sendIOControl(self.robotClient.con_ios[0], 0) # self.sendIOControl(self.robotClient.con_ios[1], 0) # self.sendIOControl(self.robotClient.con_ios[2], 0) - + self.log_signal.emit(logging.INFO, Constant.str_feed_drop) if self.catch.catch_status == CatchStatus.CNone: self.catch.catch_status = CatchStatus.CDrop return diff --git a/main.py b/main.py index 9a967e2..10eec5a 100644 --- a/main.py +++ b/main.py @@ -903,9 +903,11 @@ class MainWindow(QMainWindow, Ui_MainWindow): remain_messageBox = QMessageBox() remain_messageBox.setIcon(QMessageBox.Icon.Warning) remain_messageBox.setText(f'还有{self.remain_Count}袋未投料,是否继续?') - remain_messageBox.setStandardButtons(QMessageBox.StandardButton.Ok | QMessageBox.StandardButton.Cancel) + # remain_messageBox.setStandardButtons(QMessageBox.StandardButton.Ok | QMessageBox.StandardButton.Cancel) + ok_button = remain_messageBox.addButton("确定", PySide6.QtWidgets.QMessageBox.ButtonRole.AcceptRole) + cancel_button = remain_messageBox.addButton("取消", PySide6.QtWidgets.QMessageBox.ButtonRole.RejectRole) result = remain_messageBox.exec() - if result == QMessageBox.StandardButton.Cancel: + if remain_messageBox.clickedButton() == cancel_button: self.remain_Count = 0 return self.configReader.read(Constant.feedLine_set_file, encoding='utf-8') @@ -937,11 +939,13 @@ class MainWindow(QMainWindow, Ui_MainWindow): msg_box_person.setIcon(QMessageBox.Icon.Information) msg_box_person.setText("是否确认生产区域安全继续生产?") msg_box_person.setWindowTitle("提示") - msg_box_person.setStandardButtons(QMessageBox.StandardButton.Ok | QMessageBox.StandardButton.Cancel) + + ok_button = msg_box_person.addButton("确定", PySide6.QtWidgets.QMessageBox.ButtonRole.AcceptRole) + cancel_button = msg_box_person.addButton("取消", PySide6.QtWidgets.QMessageBox.ButtonRole.RejectRole) result = msg_box_person.exec() - if result == QMessageBox.StandardButton.Cancel: + if msg_box_person.clickedButton() == cancel_button: return log.log_message(logging.INFO, '第一层确认生产') @@ -1469,9 +1473,10 @@ class MainWindow(QMainWindow, Ui_MainWindow): msg_box_person.setIcon(QMessageBox.Icon.Warning) msg_box_person.setText("未识别到料袋报警,请重新放料后,点击继续") msg_box_person.setWindowTitle("提示") - msg_box_person.setStandardButtons(QMessageBox.StandardButton.Ok) + ok_button = msg_box_person.addButton("确定", QMessageBox.AcceptRole) + cancel_button = msg_box_person.addButton("取消", QMessageBox.RejectRole) result = msg_box_person.exec() - if result == QMessageBox.StandardButton.Cancel: + if msg_box_person.clickedButton() == cancel_button: return # self.show_infomessage_box("")