From 145a350fb86b501321c261d508b47afa4ea9e9f2 Mon Sep 17 00:00:00 2001 From: zhu-mengmeng <15588200382@163.com> Date: Mon, 30 Jun 2025 11:53:01 +0800 Subject: [PATCH] =?UTF-8?q?add:=20=E6=8B=86=E7=A0=81=E5=9E=9B=E6=80=A5?= =?UTF-8?q?=E5=81=9C=EF=BC=8C=E5=A4=8D=E4=BD=8D=E5=B1=82=E6=95=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- widgets/main_window.py | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/widgets/main_window.py b/widgets/main_window.py index 48637c6..1834445 100644 --- a/widgets/main_window.py +++ b/widgets/main_window.py @@ -564,8 +564,8 @@ class MainWindow(MainWindowUI): border: 1px solid #4caf50; border-radius: 4px; padding: 2px 10px; - min-height: 24px; - max-height: 24px; + min-height: 29px; + max-height: 29px; } QPushButton:hover { background-color: #4caf50; @@ -2257,12 +2257,15 @@ class MainWindow(MainWindowUI): if error_code == 1: QMessageBox.warning(self, "异常", f"异常: {detailed_desc}") modbus.write_register_until_success(client, 2, 0) + modbus.write_register_until_success(client, 0, 0) modbus.close_client(client) # 移除在下料区域显示异常信息的代码 elif error_code == 2: QMessageBox.warning(self, "异常", f"异常: {detailed_desc}") modbus.write_register_until_success(client, 3, 0) + modbus.write_register_until_success(client, 0, 0) modbus.close_client(client) + @Slot(int) def handle_unloading_level(self, level): """处理下料层数信息(来自Modbus)""" @@ -2890,5 +2893,9 @@ class MainWindow(MainWindowUI): else: # 急停信号解除,恢复错误状态显示 self._update_error_status() + + # 恢复故障状态标签 + self.label_status_label.setText("故障: 正常") + self.label_status_label.setStyleSheet("") except Exception as e: logging.error(f"处理急停UI更新失败: {str(e)}") \ No newline at end of file