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:
+1
-1
@@ -1,6 +1,6 @@
|
|||||||
bootloader_bin_path: /home/ly0kos/work/Verify/FW/tftp_app/bootloader/bootloader_z100_800M.bin
|
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_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
|
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
|
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
|
flash_model: s25fl256s1
|
||||||
|
|||||||
+34
-3
@@ -158,21 +158,46 @@ class MainWindow(ctk.CTk):
|
|||||||
if self._config_path:
|
if self._config_path:
|
||||||
try:
|
try:
|
||||||
self._config = Config.from_file(self._config_path)
|
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":
|
if self._config_path.name == "default_config.yaml":
|
||||||
user_config_path = self._get_user_config_path()
|
user_config_path = self._get_user_config_path()
|
||||||
self._config._config_path = user_config_path
|
self._config._config_path = user_config_path
|
||||||
except Exception:
|
except Exception:
|
||||||
self._config = Config.from_default()
|
self._config = Config.from_default()
|
||||||
# Set save path to config.yaml for new configs
|
|
||||||
user_config_path = self._get_user_config_path()
|
user_config_path = self._get_user_config_path()
|
||||||
self._config._config_path = user_config_path
|
self._config._config_path = user_config_path
|
||||||
else:
|
else:
|
||||||
self._config = Config.from_default()
|
self._config = Config.from_default()
|
||||||
# Set save path to config.yaml for new configs
|
|
||||||
user_config_path = self._get_user_config_path()
|
user_config_path = self._get_user_config_path()
|
||||||
self._config._config_path = 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:
|
def _sync_config_from_ui(self) -> None:
|
||||||
"""Read current UI values and update the Config object.
|
"""Read current UI values and update the Config object.
|
||||||
|
|
||||||
@@ -989,6 +1014,9 @@ class MainWindow(ctk.CTk):
|
|||||||
if index >= len(self._steps):
|
if index >= len(self._steps):
|
||||||
return
|
return
|
||||||
|
|
||||||
|
# Always re-read config.yaml before running
|
||||||
|
self._reload_config()
|
||||||
|
|
||||||
self._is_running = True
|
self._is_running = True
|
||||||
self._run_btn.configure(state="disabled", text="Running...")
|
self._run_btn.configure(state="disabled", text="Running...")
|
||||||
self._progress.reset()
|
self._progress.reset()
|
||||||
@@ -1022,6 +1050,9 @@ class MainWindow(ctk.CTk):
|
|||||||
if self._is_running:
|
if self._is_running:
|
||||||
return
|
return
|
||||||
|
|
||||||
|
# Always re-read config.yaml before running
|
||||||
|
self._reload_config()
|
||||||
|
|
||||||
self._is_running = True
|
self._is_running = True
|
||||||
self._run_btn.configure(state="disabled", text="Running...")
|
self._run_btn.configure(state="disabled", text="Running...")
|
||||||
self._progress.reset()
|
self._progress.reset()
|
||||||
|
|||||||
Reference in New Issue
Block a user