From 866891398f9d23a60e415627742de7ab4c451cd4 Mon Sep 17 00:00:00 2001 From: x01dc Date: Mon, 27 Jul 2026 16:11:54 +0200 Subject: [PATCH] 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. --- .../plugins/LamNI/x_ray_eye_align.py | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/csaxs_bec/bec_ipython_client/plugins/LamNI/x_ray_eye_align.py b/csaxs_bec/bec_ipython_client/plugins/LamNI/x_ray_eye_align.py index 7d87b3b..c460077 100644 --- a/csaxs_bec/bec_ipython_client/plugins/LamNI/x_ray_eye_align.py +++ b/csaxs_bec/bec_ipython_client/plugins/LamNI/x_ray_eye_align.py @@ -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 = []