fix: auto-start UART monitoring on port open success

_on_open_success(): directly call _on_start() instead of just
enabling the button. User no longer needs to click Start —
monitoring begins automatically when the port is available.

Start/Stop buttons remain for manual control.
This commit is contained in:
Jeremy Shen
2026-06-10 15:21:12 +08:00
parent 8130578f70
commit 2695180c8f
4 changed files with 22 additions and 8 deletions
+3 -3
View File
@@ -928,11 +928,11 @@ class UartMonitorWindow(ctk.CTkToplevel):
threading.Thread(target=_bg_open, daemon=True).start()
def _on_open_success(self) -> None:
"""Serial port opened — enable Start button."""
"""Serial port opened — auto-start monitoring."""
self._is_opening = False
self._start_btn.configure(state="normal")
self._update_status(ACCENT_PENDING, "Ready")
self._log(f"[{self._port}] Port ready. Click Start to begin monitoring.\n")
self._log(f"[{self._port}] Port ready, auto-starting monitor...\n")
self._on_start()
def _show_unavailable(self, reason: str) -> None:
"""Show UART unavailable state."""