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:
@@ -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:
|
||||
|
||||
Reference in New Issue
Block a user