From c0cac5b2c590e1dfaea710d6807d7fcbde7270e3 Mon Sep 17 00:00:00 2001 From: Jeremy Shen Date: Fri, 12 Jun 2026 16:35:32 +0800 Subject: [PATCH] fix: ping_ip bool unpack, skip sub-step visibility, IP 192.168.100.11 after Step 3 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - ping_ip returns bool, not tuple — fixed 2 unpack errors - TftpSubStepFrame: _skipped set prevents set_phase from overwriting Skip - set_expanded(True) before skip marking so UI shows it immediately - After Step 3 success, fix IP to 192.168.100.11 --- src/gui/main_window.py | 14 ++++++++++++-- src/gui/widgets.py | 5 +++++ 2 files changed, 17 insertions(+), 2 deletions(-) diff --git a/src/gui/main_window.py b/src/gui/main_window.py index 52a3cc7..94c2584 100644 --- a/src/gui/main_window.py +++ b/src/gui/main_window.py @@ -1419,8 +1419,11 @@ class MainWindow(ctk.CTk): all_results.append(True) # 4b all_results.append(True) # 4c if hasattr(self, '_tftp_sub_step_frame'): + self._tftp_sub_step_frame.set_expanded(True) self._tftp_sub_step_frame.set_step_skipped("Download Verify") self._tftp_sub_step_frame.set_step_skipped("CRC Check") + self._log_message(" ◌ Download Verify: Skip") + self._log_message(" ◌ CRC Check: Skip") else: # 4b: Download Verify self._log_message("Step 4b: TFTP download verify...") @@ -1572,7 +1575,7 @@ class MainWindow(ctk.CTk): # Try ping configured IP first (fast, reliable) self._log_message(f" Pinging {self._config.zynq_ip}...") - ok, _ = ping_ip(self._config.zynq_ip, timeout=2) + ok = ping_ip(self._config.zynq_ip, timeout=2) if ok: discovered_ip = self._config.zynq_ip self._log_message(f" ✓ Zynq responds to ping at {discovered_ip}") @@ -1587,7 +1590,7 @@ class MainWindow(ctk.CTk): self._log_message(f" ⏳ Waiting {boot_delay}s for late boot...") time.sleep(boot_delay) # Retry ping + scan after extra delay - ok2, _ = ping_ip(self._config.zynq_ip, timeout=2) + ok2 = ping_ip(self._config.zynq_ip, timeout=2) if ok2: discovered_ip = self._config.zynq_ip self._log_message(f" ✓ Zynq responds to ping at {discovered_ip}") @@ -1805,6 +1808,13 @@ class MainWindow(ctk.CTk): elapsed = time.time() - t_step_start self._log_message(f" ⏱ Step {i+1} completed in {elapsed:.0f}s") + # Step 3: After bootloader load, fix IP to 192.168.100.11 + if i == 2 and success: + self._config.zynq_ip = "192.168.100.11" + if self._ip_string_var: + self._ip_string_var.set("192.168.100.11") + self._log_message(" IP set to 192.168.100.11") + # Step 2: mark sub-steps based on result if i == 1 and hasattr(self, '_sub_step_frame'): if success: diff --git a/src/gui/widgets.py b/src/gui/widgets.py index a664996..fd16867 100644 --- a/src/gui/widgets.py +++ b/src/gui/widgets.py @@ -871,6 +871,7 @@ class TftpSubStepFrame(ctk.CTkFrame): self._collapsed = True self._pulse_job: str | None = None + self._skipped: set[int] = set() self._substep_names = substep_names or ["Upload", "Download Verify", "CRC Check", "Reboot", "Boot Verify"] self._num_steps = len(self._substep_names) @@ -936,6 +937,8 @@ class TftpSubStepFrame(ctk.CTkFrame): pct_text = f"{pct}%" if pct >= 0 else "" for i, item in enumerate(self._sub_items): + if i in self._skipped: + continue # leave skipped items untouched if i < idx: item["dot"].configure(text="●", text_color=_C_DONE) item["label"].configure(text_color=_C_DONE) @@ -980,6 +983,7 @@ class TftpSubStepFrame(ctk.CTkFrame): idx = self._substep_names.index(phase) if phase in self._substep_names else -1 if idx < 0: return + self._skipped.add(idx) item = self._sub_items[idx] item["dot"].configure(text="◌", text_color=WARNING_COLOR) item["label"].configure(text_color=WARNING_COLOR) @@ -1010,6 +1014,7 @@ class TftpSubStepFrame(ctk.CTkFrame): def reset(self) -> None: self._stop_pulse() + self._skipped.clear() _C = ACCENT_PENDING for i, item in enumerate(self._sub_items): item["dot"].configure(text="○", text_color=_C)