From 8afb54277a1a0b240eac22524320a761d8dbab8d Mon Sep 17 00:00:00 2001 From: PONS Date: Wed, 29 Jul 2026 09:43:20 +0200 Subject: [PATCH 1/2] Update bba callback --- pyaml/tuning_tools/bba.py | 28 +++++++++++++++++++++++----- pyproject.toml | 2 +- 2 files changed, 24 insertions(+), 6 deletions(-) diff --git a/pyaml/tuning_tools/bba.py b/pyaml/tuning_tools/bba.py index 2e915ba1..5045328f 100644 --- a/pyaml/tuning_tools/bba.py +++ b/pyaml/tuning_tools/bba.py @@ -148,6 +148,7 @@ def measure( bipolar=False, skip_save=True, plane=plane, + live_ios=True, ) pySC.disable_pySC_rich() @@ -162,13 +163,30 @@ def measure( self.latest_measurement["HData"] = None self.latest_measurement["VData"] = None for code, measurement_object in generator: - if code == BBACode.HORIZONTAL: - self.send_callback(Action.MEASURE, {"step": hstep, "plane": "H", "bba_data": measurement_object.H_data}) + if code == BBACode.HORIZONTAL_IOS_READY: + self.send_callback( + Action.MEASURE, + { + "step": hstep, + "plane": "H", + "bpm_pos": measurement_object.last_bpm_pos, + "ios": measurement_object.last_ios, + "bba_data": measurement_object.H_data, + }, + ) hstep += 1 - if code == BBACode.VERTICAL: - self.send_callback(Action.MEASURE, {"step": vstep, "plane": "V", "bba_data": measurement_object.V_data}) + if code == BBACode.VERTICAL_IOS_READY: + self.send_callback( + Action.MEASURE, + { + "step": vstep, + "plane": "V", + "bpm_pos": measurement_object.last_bpm_pos, + "ios": measurement_object.last_ios, + "bba_data": measurement_object.V_data, + }, + ) vstep += 1 - if code == BBACode.HORIZONTAL_DONE: result = BBAAnalysis.analyze(measurement_object.H_data) self.latest_measurement["HData"] = result diff --git a/pyproject.toml b/pyproject.toml index 3c0b602c..72d6eb46 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -28,7 +28,7 @@ dependencies = [ "accelerator-toolbox>=0.6.1", "PyYAML>=6.0.2", "pydantic>=2.11.7", - "accelerator-commissioning==1.3.0", #pySC + "accelerator-commissioning==1.5.2", #pySC "h5py", "matplotlib" ] From d6ea9a6ab8fb8f9541981a9a27c5771c7fc2668e Mon Sep 17 00:00:00 2001 From: PONS Date: Thu, 30 Jul 2026 10:06:41 +0200 Subject: [PATCH 2/2] Updated pySC release number --- pyaml/tuning_tools/bba.py | 1 + pyproject.toml | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/pyaml/tuning_tools/bba.py b/pyaml/tuning_tools/bba.py index 5045328f..747833e3 100644 --- a/pyaml/tuning_tools/bba.py +++ b/pyaml/tuning_tools/bba.py @@ -138,6 +138,7 @@ def measure( } # logging.getLogger("pySC.apps.measurements").setLevel(logging.DEBUG) + # logging.getLogger("pySC.apps.bba").setLevel(logging.DEBUG) generator = measure_bba( interface=interface, diff --git a/pyproject.toml b/pyproject.toml index 72d6eb46..2057e3e0 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -28,7 +28,7 @@ dependencies = [ "accelerator-toolbox>=0.6.1", "PyYAML>=6.0.2", "pydantic>=2.11.7", - "accelerator-commissioning==1.5.2", #pySC + "accelerator-commissioning==1.5.3", #pySC "h5py", "matplotlib" ]