From: kyz Date: Wed, 24 Jun 2026 07:03:34 +0000 (+0800) Subject: add test tools X-Git-Url: http://kyz.pub/gitweb/?a=commitdiff_plain;h=4f1fbfc5890772177f9d0d341cc714e42895609d;p=yn%2Fboxinlaohua_board.git add test tools --- diff --git a/Aging_app/tools/config.py b/Aging_app/tools/config.py index efc7617..290f7a2 100644 --- a/Aging_app/tools/config.py +++ b/Aging_app/tools/config.py @@ -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, "警告", "端口号必须是数字") diff --git a/Aging_app/tools/srv.py b/Aging_app/tools/srv.py index a6cf4cc..4fd1b12 100644 --- a/Aging_app/tools/srv.py +++ b/Aging_app/tools/srv.py @@ -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)