From e1b863776a591709f87bc01128df0d52117a0892 Mon Sep 17 00:00:00 2001 From: root <1309@qq.com> Date: Sat, 14 Sep 2024 08:09:33 +0800 Subject: [PATCH] =?UTF-8?q?update=20=E5=81=87=E4=BA=BA=E5=8F=82=E4=B8=8E?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app.py | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+) diff --git a/app.py b/app.py index 864d2f9..3edbe27 100644 --- a/app.py +++ b/app.py @@ -683,6 +683,11 @@ class MainWindow(QMainWindow, Ui_MainWindow): else: self.stackedWidget_num.setCurrentIndex(1) + if self.feeding.feedConfig.num==2: + self.feeding.pause=True + self.send_pause_command(True) + self.show_messagebox_of_person() + log.log_message(logging.ERROR, '人员进入安全区') self.label_date.setText(datetime.now().strftime("%Y-%m-%d")) self.label_time.setText(datetime.now().strftime("%H:%M:%S")) @@ -891,6 +896,25 @@ class MainWindow(QMainWindow, Ui_MainWindow): self.robotClient.add_sendQuene(request_command) + def show_messagebox_of_person(self): + # Create a QMessageBox + msg_box = QMessageBox(self) + msg_box.setWindowTitle("提示") + msg_box.setText("当前有人是否继续") + msg_box.setIcon(QMessageBox.Question) + msg_box.setStandardButtons(QMessageBox.Yes) + msg_box.setDefaultButton(QMessageBox.Yes) + + # Execute the dialog and capture the result + result = msg_box.exec() + + # Check the result and set the variable accordingly + + if result == QMessageBox.Yes: + self.feeding.pause = False + self.send_pause_command(False) + print(f"Variable value: {self.variable}") + if __name__ == "__main__": app = QApplication(sys.argv)