add: 拆码垛急停,复位层数

This commit is contained in:
zhu-mengmeng 2025-06-30 11:53:01 +08:00
parent 92905294aa
commit 145a350fb8

View File

@ -564,8 +564,8 @@ class MainWindow(MainWindowUI):
border: 1px solid #4caf50; border: 1px solid #4caf50;
border-radius: 4px; border-radius: 4px;
padding: 2px 10px; padding: 2px 10px;
min-height: 24px; min-height: 29px;
max-height: 24px; max-height: 29px;
} }
QPushButton:hover { QPushButton:hover {
background-color: #4caf50; background-color: #4caf50;
@ -2257,12 +2257,15 @@ class MainWindow(MainWindowUI):
if error_code == 1: if error_code == 1:
QMessageBox.warning(self, "异常", f"异常: {detailed_desc}") QMessageBox.warning(self, "异常", f"异常: {detailed_desc}")
modbus.write_register_until_success(client, 2, 0) modbus.write_register_until_success(client, 2, 0)
modbus.write_register_until_success(client, 0, 0)
modbus.close_client(client) modbus.close_client(client)
# 移除在下料区域显示异常信息的代码 # 移除在下料区域显示异常信息的代码
elif error_code == 2: elif error_code == 2:
QMessageBox.warning(self, "异常", f"异常: {detailed_desc}") QMessageBox.warning(self, "异常", f"异常: {detailed_desc}")
modbus.write_register_until_success(client, 3, 0) modbus.write_register_until_success(client, 3, 0)
modbus.write_register_until_success(client, 0, 0)
modbus.close_client(client) modbus.close_client(client)
@Slot(int) @Slot(int)
def handle_unloading_level(self, level): def handle_unloading_level(self, level):
"""处理下料层数信息来自Modbus""" """处理下料层数信息来自Modbus"""
@ -2890,5 +2893,9 @@ class MainWindow(MainWindowUI):
else: else:
# 急停信号解除,恢复错误状态显示 # 急停信号解除,恢复错误状态显示
self._update_error_status() self._update_error_status()
# 恢复故障状态标签
self.label_status_label.setText("故障: 正常")
self.label_status_label.setStyleSheet("")
except Exception as e: except Exception as e:
logging.error(f"处理急停UI更新失败: {str(e)}") logging.error(f"处理急停UI更新失败: {str(e)}")