tracked fsamy movements

This commit is contained in:
x12sa
2026-06-30 11:34:38 +02:00
parent 6597f2c528
commit 38d71744d8
@@ -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()