From ebd11fd36f2a3683c4baa6d407963c70db22196e Mon Sep 17 00:00:00 2001 From: pandx Date: Tue, 24 Jun 2025 17:59:40 +0800 Subject: [PATCH] modify status bar info for getting temp info. --- mainwindow.py | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/mainwindow.py b/mainwindow.py index be1e61d..2c10679 100644 --- a/mainwindow.py +++ b/mainwindow.py @@ -500,6 +500,7 @@ class SocketClientApp(QMainWindow): self.temp2_label.setText(f"温度2:{value.temp2 / 1000} v") self.offset1_label.setText(f"偏置电压1:{value.offset1 / 100} v") self.offset2_label.setText(f"偏置电压2:{value.offset2 / 100} v") + self.status_bar.showMessage("状态: 温度数据获取完成", 5000) elif cmd == 0x0F: body_format = '< B B' body_size = struct.calcsize(body_format) @@ -689,8 +690,18 @@ class SocketClientApp(QMainWindow): print(f"Packet {i + 1} sent successfully") time.sleep(0.05) print("Upgrade packet ready to send (commented out actual send code)") + QMessageBox.information( + self, + "升级", + "升级包已成功上传" + ) except Exception as e: print(f"Upgrade failed: {str(e)}") + QMessageBox.critical( + self, + "升级", + "升级包上传失败" + ) def on_button_upgrade_test(self): """打开文件选择对话框"""