From 38d71744d888b8537face33f92094615ee15b56c Mon Sep 17 00:00:00 2001 From: x12sa Date: Tue, 30 Jun 2026 11:34:38 +0200 Subject: [PATCH] tracked fsamy movements --- .../plugins/flomni/x_ray_eye_align.py | 26 ++++++++++++++++--- 1 file changed, 23 insertions(+), 3 deletions(-) diff --git a/csaxs_bec/bec_ipython_client/plugins/flomni/x_ray_eye_align.py b/csaxs_bec/bec_ipython_client/plugins/flomni/x_ray_eye_align.py index 7dd643d..6979c81 100644 --- a/csaxs_bec/bec_ipython_client/plugins/flomni/x_ray_eye_align.py +++ b/csaxs_bec/bec_ipython_client/plugins/flomni/x_ray_eye_align.py @@ -37,8 +37,19 @@ class XrayEyeAlign: self.device_manager = client.device_manager self.scans = client.scans self.alignment_values = {} - self.flomni.reset_correction() - self.flomni.reset_tomo_alignment_fit() + # Deliberately NOT calling self.flomni.reset_correction() / + # reset_tomo_alignment_fit() here: XrayEyeAlign is constructed every + # time Flomni() is instantiated (i.e. every new client session, not + # just every alignment run), so doing the reset here was silently + # wiping corr_pos_y/corr_angle_y/corr_pos_y_2/corr_angle_y_2 and the + # stored tomo_alignment_fit on every restart -- corr_pos_y/ + # corr_angle_y appeared to survive only because reset_correction() + # immediately reloads the default file into them; corr_pos_y_2/ + # corr_angle_y_2 have no such reload, so the wipe was directly + # visible there. These resets belong at the start of an actual + # alignment run instead (_align_impl(), below) - matching what + # start_x_ray_eye_alignment() already tells the user is happening: + # "Deleting any potential existing alignment for this sample." @property def gui(self): @@ -129,6 +140,15 @@ class XrayEyeAlign: # reset shift xy and fov params self._reset_init_values() + # Moved here from __init__: this is the actual start of a fresh + # alignment run (matching what start_x_ray_eye_alignment() already + # tells the user is happening - "Deleting any potential existing + # alignment for this sample"), not merely XrayEyeAlign being + # constructed. See the comment in __init__ for why this can't live + # there. + self.flomni.reset_correction() + self.flomni.reset_tomo_alignment_fit() + self.flomni.lights_off() if not self.test_wo_movements: @@ -245,7 +265,7 @@ class XrayEyeAlign: if _xrayeyalignmvy != 0: self.flomni.feedback_disable() if not self.test_wo_movements: - umvr(dev.fsamy, _xrayeyalignmvy / 1000) + self.flomni.umvr_fsamy_tracked(_xrayeyalignmvy / 1000) time.sleep(2) dev.omny_xray_gui.mvy.set(0) self.flomni.feedback_enable_with_reset()