From fcb6b5635ee5046f8c6b2e143f5fb68f62d78ed5 Mon Sep 17 00:00:00 2001 From: appel_c Date: Fri, 23 Jan 2026 08:45:34 +0100 Subject: [PATCH] w --- .../bec_ipython_client/plugins/tool_box/debug_tools.py | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/csaxs_bec/bec_ipython_client/plugins/tool_box/debug_tools.py b/csaxs_bec/bec_ipython_client/plugins/tool_box/debug_tools.py index 648fb73..585df7a 100644 --- a/csaxs_bec/bec_ipython_client/plugins/tool_box/debug_tools.py +++ b/csaxs_bec/bec_ipython_client/plugins/tool_box/debug_tools.py @@ -30,6 +30,8 @@ if TYPE_CHECKING: gui: BECGuiClient # type: ignore[no-redef] + dev: bec.device_manager + class Detector(BaseModel): """Model representing a detector configuration.""" @@ -108,14 +110,14 @@ class DebugTools: def _check_if_mcs_card_is_loaded(self): """Check if the MCS card device is loaded in the current BEC session.""" - if "mcs" not in bec.devices: + if "mcs" not in dev: raise RuntimeError("MCS device is not loaded in the current active BEC session.") def _check_if_ddg_is_loaded(self): """Check if the DDG1 device is loaded in the current BEC session.""" - if "ddg1" not in bec.devices: + if "ddg1" not in dev: raise RuntimeError("DDG1 device is not loaded in the current active BEC session.") - if "ddg2" not in bec.devices: + if "ddg2" not in dev: raise RuntimeError("DDG2 device is not loaded in the current active BEC session.") def mcs_test_acquire( @@ -183,7 +185,7 @@ class DebugTools: with open(config_path, "r", encoding="utf-8") as fh: cfg = json.load(fh) - for entry in cfg["detectors"]: + for entry in cfg["detector"]: det = Detector( name=to_identifier(entry["description"]), hostnames=entry["hostnames"], cfg=cfg )