fix: avoid serial port conflict between workflow and UART window

Flow execution's _start_uart_monitor() now checks if a UART window
is already monitoring before starting its own UartMonitor instance.
This prevents two UartMonitor threads from fighting over the same
serial port.

Changes:
- UartMonitorWindow: add is_monitoring property
- MainWindow._uart_window: store reference to open UART window
- _start_uart_monitor(): skip if UART window already monitoring
- _on_close(): destroy UART window on main window close
This commit is contained in:
Jeremy Shen
2026-06-10 15:23:28 +08:00
parent 2695180c8f
commit a47e3b78ae
2 changed files with 16 additions and 1 deletions
+5
View File
@@ -1024,6 +1024,11 @@ class UartMonitorWindow(ctk.CTkToplevel):
# ── Window Close ───────────────────────────────────────────
@property
def is_monitoring(self) -> bool:
"""True if the UART monitor thread is currently running."""
return self._monitor is not None and self._monitor.is_running()
def _on_close(self) -> None:
"""Cleanup UartMonitor and destroy window."""
if self._monitor: