feat(LamNI): show and prompt for sample name in the XRayEye GUI
The shared XRayEye widget already supports a sample_name field, but LamNI's x_ray_eye_align.py never set it (unlike FlOMNI's align(), which does) -- so it was always blank. Add _sync_sample_name(): pushes lamni.sample_name into the GUI everywhere align()/find_rotation_center* run, and additionally prompts for it (Enter keeps the current value, same as tomo_parameters()) at the rotation-center steps, since those are often the first alignment action for a new sample.
This commit is contained in:
@@ -200,6 +200,21 @@ class XrayEyeAlign:
|
||||
print(f"Alignment GUI: {msg}")
|
||||
self.gui.user_message = msg
|
||||
|
||||
def _sync_sample_name(self, prompt: bool = False):
|
||||
"""Push lamni.sample_name into the XRayEye GUI's sample_name field.
|
||||
|
||||
If prompt=True, first ask for it via the same _get_val() pattern
|
||||
tomo_parameters() uses (Enter keeps the current value) -- used at
|
||||
the rotation-center steps, which are often the first alignment
|
||||
action for a new sample, before tomo_parameters() has necessarily
|
||||
run.
|
||||
"""
|
||||
if prompt:
|
||||
self.lamni.sample_name = self.lamni._get_val(
|
||||
"sample name", self.lamni.sample_name, str
|
||||
)
|
||||
self.gui.sample_name = self.lamni.sample_name
|
||||
|
||||
# ------------------------------------------------------------------
|
||||
# Main alignment procedure
|
||||
# ------------------------------------------------------------------
|
||||
@@ -262,6 +277,7 @@ class XrayEyeAlign:
|
||||
then load fit parameters into the global variable store.
|
||||
"""
|
||||
self.lamni.lamnigui_show_xeyealign()
|
||||
self._sync_sample_name()
|
||||
self.gui.set_dap_params_forwarding(True)
|
||||
self.send_message("Getting things ready. Please wait...")
|
||||
|
||||
@@ -848,6 +864,7 @@ class XrayEyeAlign:
|
||||
tuple: (new_lsamx_center, new_lsamy_center) in mm.
|
||||
"""
|
||||
self.lamni.lamnigui_show_xeyealign()
|
||||
self._sync_sample_name(prompt=True)
|
||||
self.gui.set_dap_params_forwarding(False)
|
||||
self._reset_init_values()
|
||||
self.alignment_images = []
|
||||
@@ -1136,6 +1153,7 @@ class XrayEyeAlign:
|
||||
)
|
||||
|
||||
self.lamni.lamnigui_show_xeyealign()
|
||||
self._sync_sample_name(prompt=True)
|
||||
self.gui.set_dap_params_forwarding(False)
|
||||
self._reset_init_values()
|
||||
self.alignment_images = []
|
||||
|
||||
Reference in New Issue
Block a user