add test tools
authorkyz <kongyuzhong@google.com>
Wed, 24 Jun 2026 07:03:34 +0000 (15:03 +0800)
committerkyz <kongyuzhong@google.com>
Wed, 24 Jun 2026 07:03:34 +0000 (15:03 +0800)
Aging_app/tools/config.py
Aging_app/tools/srv.py

index efc76170002a5b1cf8a249c33b7834832d3519b8..290f7a2991d0cb37edc9a3837efadb7cd64204d6 100644 (file)
@@ -1,5 +1,6 @@
 import sys
 import serial
+import time
 import serial.tools.list_ports
 from PyQt5.QtWidgets import (QApplication, QMainWindow, QWidget, QVBoxLayout, QHBoxLayout,
                              QLabel, QLineEdit, QPushButton, QComboBox, QMessageBox, QGroupBox)
@@ -46,7 +47,7 @@ class SerialThread(QThread):
 class MainWindow(QMainWindow):
     def __init__(self):
         super().__init__()
-        self.setWindowTitle("设备参数读写工具")
+        self.setWindowTitle("设备参数读写工具_V1.0")
         # 设置窗口为固定大小,禁用调整大小功能
         self.setFixedSize(400, 500)
         self.setWindowFlags(self.windowFlags() & ~Qt.WindowMaximizeButtonHint)
@@ -343,10 +344,12 @@ class MainWindow(QMainWindow):
         if new_ssid != self.params['ssid']:
             if new_ssid:
                 self.serial_thread.send_data(f'W2{new_ssid}')
+                time.sleep(0.5)
 
         if new_password != self.params['password']:
             if new_password:
                 self.serial_thread.send_data(f'W3{new_password}')
+                time.sleep(0.5)
 
         # 检查IP地址是否修改
         new_ip = '.'.join([part.text().strip() for part in self.ip_parts])
@@ -362,12 +365,14 @@ class MainWindow(QMainWindow):
                 # 转换为W4格式: W4001002003004
                 ip_str = ''.join(f'{int(part.text()):03d}' for part in self.ip_parts)
                 self.serial_thread.send_data(f'W4{ip_str}')
+                time.sleep(0.5)
             else:
                 QMessageBox.warning(self, "警告", "IP地址格式不正确")
 
         if new_port != self.params['srv_port']:
             if new_port.isdigit():
                 self.serial_thread.send_data(f'W5{new_port}')
+                time.sleep(0.5)
             else:
                 QMessageBox.warning(self, "警告", "端口号必须是数字")
 
index a6cf4ccd443d1bc482b8026b3e6b6e754f9e520e..4fd1b12df85a8c45259bb94a6a3d1b7f2e9ba06a 100644 (file)
@@ -147,7 +147,7 @@ class TcpServerThread(QThread):
 class MainWindow(QMainWindow):
     def __init__(self):
         super().__init__()
-        self.setWindowTitle("老化车测试服务端")
+        self.setWindowTitle("测试服务端工具_V1.0")
         self.setFixedSize(900, 600)
         self.setWindowFlags(self.windowFlags() & ~Qt.WindowMaximizeButtonHint)