优化界面 完善逻辑

This commit is contained in:
2025-03-30 18:55:39 +08:00
parent a9a6db23fd
commit 676eb49679
10 changed files with 59 additions and 42 deletions

View File

@ -64,7 +64,7 @@ class LoggerHandler(QThread):
@db_lock
def logger(self, level, module, content, color="black", flag="both"):
global cursor
global cursor, stop_flag
if "move.monitor" in content:
return
@ -80,21 +80,16 @@ class LoggerHandler(QThread):
cursor.execute(f"INSERT INTO logs (level, module, content) VALUES (?, ?, ?)", (level, module, content))
if level.upper() == "ERROR":
stop_flag = False
raise Exception()
def running_detection(idx):
while True:
time.sleep(INTERVAL*2)
if not running[idx]:
raise Exception("")
# PREFIX = "resources/assets" # for pyinstaller
PREFIX = "assets" # for local testing
PREFIX = "resources/assets" # for pyinstaller
# PREFIX = "assets" # for local testing
log_path = f"{PREFIX}/logs"
lock = threading.Lock()
running = [0, 0, 0, 0, 0, 0, 0] # 制动数据/转矩数据/激光数据/精度数据/制动自动化/转矩自动化/耐久数据采集
stop_flag = False
functions = ["制动数据处理", "转矩数据处理", "激光数据处理", "精度数据处理", "制动自动化测试", "转矩自动化测试", "耐久数据采集"]
levels = ["DEBUG", "INFO", "WARNING", "ERROR"]
ip_addr, ssh_port, socket_port, xService_port, external_port, modbus_port, upgrade_port = "", 22, 5050, 6666, 8080, 502, 4567