diff --git a/src/gui/main_window.py b/src/gui/main_window.py index a7bc515..e71c663 100644 --- a/src/gui/main_window.py +++ b/src/gui/main_window.py @@ -1144,15 +1144,23 @@ class MainWindow(ctk.CTk): # Wait for board to boot — UART if available, else config delay boot_delay = self._config.boot_wait_delay - uart_alive = (self._uart_monitor is not None - and self._uart_monitor.is_running()) + # Check both main monitor and UART window monitor + uart_alive = False + _uart_src = None # source of latest_info + if self._uart_monitor and self._uart_monitor.is_running(): + uart_alive = True + _uart_src = self._uart_monitor + elif (self._uart_window and self._uart_window.winfo_exists() + and self._uart_window.is_monitoring): + uart_alive = True + _uart_src = self._uart_window discovered_ip: str = "" - if uart_alive: + if uart_alive and _uart_src: self._log_message(f" ⏳ Waiting for UART boot signal (max {boot_delay}s)...") elapsed = 0.0 while elapsed < boot_delay: - info = self._uart_monitor.latest_info - if info.ip_address or info.version: + info = _uart_src.latest_info if hasattr(_uart_src, 'latest_info') else _uart_src.get_latest_info() + if info and (info.ip_address or info.version): self._log_message( f" ✓ Boot detected after {elapsed:.1f}s" f" (IP={info.ip_address}, Ver={info.version})" diff --git a/src/gui/widgets.py b/src/gui/widgets.py index c29a824..420807b 100644 --- a/src/gui/widgets.py +++ b/src/gui/widgets.py @@ -1190,6 +1190,12 @@ class UartMonitorWindow(ctk.CTkToplevel): """True if the UART monitor thread is currently running.""" return self._monitor is not None and self._monitor.is_running() + def get_latest_info(self): + """Return latest parsed BootInfo from the UART monitor, or None.""" + if self._monitor: + return self._monitor.latest_info + return None + def _on_close(self) -> None: """Cleanup UartMonitor and destroy window.""" if self._monitor: