GUI v0.2.9: fix chronic-lag root cause (log trim crash on PySide6 6.11) + 5 hardening fixes

- log trim used instance-level enum access (removed in PySide6 6.11), crashed
This commit is contained in:
2026-10-12 16:14:53 +08:00
parent 60908a7709
commit 8035f9b7d3
7 changed files with 597 additions and 16 deletions
+11 -2
View File
@@ -347,8 +347,17 @@ class FF485:
pass
if item is not None:
cmd, frame = item
self.ser.write(frame)
self.on_event(f'→ {cmd} [{frame.hex(" ").upper()}]')
sent = False
try:
self.ser.write(frame)
sent = True
except serial.SerialTimeoutException:
# 写超时(适配器停滞): 只丢这条命令, 链路保留。
# 勿并入下方 OSError——瞬时停滞曾被当成"设备拔出"
# 关端口断链, 迫使用户手动重连(适配器换向本就不稳)
self.on_event(f'✕ {cmd} 写超时未发出, 链路保留(可重发)')
if sent:
self.on_event(f'→ {cmd} [{frame.hex(" ").upper()}]')
# 按到达量读取, 不攒大块: 固定 read(256) 在持续帧流下要攒满
# 256 字节才返回(win32 字节间隔超时 150ms 因帧间隔更短永不
# 触发, 100ms 上报 ≈ 2.5s 一批), 表现为曲线/命令全按 3s 一卡