fix: re-read config.yaml before each workflow run

_reload_config(): re-reads config.yaml and updates all UI selectors
(FSBL, BIT, ELF, BIN, FW BIN) and IP/xilinx_path fields with latest
values from file.

Called at the top of both _execute_step() and _run_all_steps(),
so changing config.yaml externally is picked up before every run.
This commit is contained in:
Jeremy Shen
2026-06-10 17:04:32 +08:00
parent 7067ce273f
commit 0568315b83
2 changed files with 35 additions and 4 deletions
+1 -1
View File
@@ -1,6 +1,6 @@
bootloader_bin_path: /home/ly0kos/work/Verify/FW/tftp_app/bootloader/bootloader_z100_800M.bin
bootloader_bit_path: /home/ly0kos/work/Verify/FW/tftp_app/bootloader/pl_arm_wrapper_hw_platform_0/pl_arm_wrapper.bit
bootloader_elf_path: /home/ly0kos/work/Verify/FW/tftp_app/bootloader/app.elf
bootloader_elf_path: /home/ly0kos/work/Verify/FW/tftp_app/tftp_app/tftp.elf
erase_all: false
firmware_bin_path: /home/ly0kos/work/Verify/FW/V1.3.1.3.3_06_01_pmu_cpld_check/V1.3.1.3.3_06_01_pmu_cpld_check.bin
flash_model: s25fl256s1
+34 -3
View File
@@ -158,21 +158,46 @@ class MainWindow(ctk.CTk):
if self._config_path:
try:
self._config = Config.from_file(self._config_path)
# If loaded from default_config.yaml, set save path to config.yaml
if self._config_path.name == "default_config.yaml":
user_config_path = self._get_user_config_path()
self._config._config_path = user_config_path
except Exception:
self._config = Config.from_default()
# Set save path to config.yaml for new configs
user_config_path = self._get_user_config_path()
self._config._config_path = user_config_path
else:
self._config = Config.from_default()
# Set save path to config.yaml for new configs
user_config_path = self._get_user_config_path()
self._config._config_path = user_config_path
def _reload_config(self) -> None:
"""Re-read config.yaml and update UI selectors with latest paths."""
user_path = self._get_user_config_path()
if not user_path.exists():
return
try:
fresh = Config.from_file(user_path)
self._config = fresh
# Update UI selectors
for attr, selector in [
("bootloader_bit_path", self._bit_selector),
("bootloader_elf_path", self._elf_selector),
("bootloader_bin_path", self._bootloader_bin_selector),
("fsbl_elf_path", self._fsbl_selector),
("firmware_bin_path", self._firmware_bin_selector),
]:
val = getattr(fresh, attr, "")
if val:
selector.set_path(str(fresh.resolve_path(val)))
# Update IP
if self._ip_string_var:
self._ip_string_var.set(fresh.zynq_ip)
# Update xilinx path
if hasattr(fresh, 'xilinx_path') and self._xilinx_path_var:
self._xilinx_path_var.set(fresh.xilinx_path)
except Exception:
pass # Keep existing config on error
def _sync_config_from_ui(self) -> None:
"""Read current UI values and update the Config object.
@@ -989,6 +1014,9 @@ class MainWindow(ctk.CTk):
if index >= len(self._steps):
return
# Always re-read config.yaml before running
self._reload_config()
self._is_running = True
self._run_btn.configure(state="disabled", text="Running...")
self._progress.reset()
@@ -1022,6 +1050,9 @@ class MainWindow(ctk.CTk):
if self._is_running:
return
# Always re-read config.yaml before running
self._reload_config()
self._is_running = True
self._run_btn.configure(state="disabled", text="Running...")
self._progress.reset()