From a7429b2de266218231d2b3cff25a568050cf1799 Mon Sep 17 00:00:00 2001 From: x01dc Date: Sun, 6 Sep 2026 12:21:01 +0200 Subject: [PATCH] fix(omny): save reference images at every manual confirm gate, not just the RT confirm handshake _otransfer_save_reference_images() was only called from _otransfer_confirm()'s "All OK?" checkpoint. Now also called at otransfer_get_sample()'s "no sample in gripper" and "ready to start the unmount process" gates, and otransfer_put_sample()'s "ready to start the mount process" gate -- all three already run after the camera pair is live, so no extra setup needed. Checked flomni.py for the equivalent gap per request: there isn't one -- ftransfer_get_sample()/ftransfer_put_sample() have no manual confirm dialog before starting mount/unmount at all (just an automated check + raise), so there's no existing flomni gate missing an image-save call. Documented in AI_docs/OPEN_ISSUES.md, including a forward-looking note in case flomni ever gains an interactive gripper-empty confirm of its own. Co-Authored-By: Claude Sonnet 5 Claude-Session: https://claude.ai/code/session_018Mupip8x7Hean6E3FFvpbj --- .../plugins/omny/AI_docs/OPEN_ISSUES.md | 32 +++++++++++++++++++ .../omny/omny_sample_transfer_mixin.py | 3 ++ 2 files changed, 35 insertions(+) diff --git a/csaxs_bec/bec_ipython_client/plugins/omny/AI_docs/OPEN_ISSUES.md b/csaxs_bec/bec_ipython_client/plugins/omny/AI_docs/OPEN_ISSUES.md index 4d161436..802c382d 100644 --- a/csaxs_bec/bec_ipython_client/plugins/omny/AI_docs/OPEN_ISSUES.md +++ b/csaxs_bec/bec_ipython_client/plugins/omny/AI_docs/OPEN_ISSUES.md @@ -814,6 +814,38 @@ work above). **Mirko's intent: port the same real-EPICS status+account channel t point** -- a separate, dedicated task (its own `.template` record + `FlomniSampleStorage` changes + retiring/reconciling `_MeasuredSampleLog`), not bundled into this branch. +## Reference images now saved at every manual confirm gate in otransfer_get_sample/put_sample -- flomni has no equivalent gate to save at + +`_otransfer_save_reference_images()` used to be called only from inside `_otransfer_confirm()`'s +"All OK?" checkpoint (the RT-controller confirm handshake during the actual mount/unmount motion). +It's now also called at every earlier manual `otransfer_confirm_dialog()` gate in +`omny_sample_transfer_mixin.py`: +- `otransfer_get_sample()`'s "Please confirm that currently there is no sample in the gripper..." + gate (`file_suffix="get_gripper_empty_check"`) +- `otransfer_get_sample()`'s "Ready to start the unmount process now?" gate + (`file_suffix="get_unmount_start"`) +- `otransfer_put_sample()`'s "Ready to start the mount process now?" gate + (`file_suffix="put_mount_start"`) + +All three already run after `_omnycam_parking()`/`_omnycam_samplestage()` has made the camera pair +live, so no extra setup was needed -- just one more call to the existing, generic +`_otransfer_save_reference_images(file_suffix=...)` helper at each site. + +**Checked flOMNI for the equivalent gap, per Mirko's request: there isn't one to fix.** +`flomni.py`'s `ftransfer_get_sample()`/`ftransfer_put_sample()` have no manual confirm dialog at +all before starting the mount/unmount motion -- unlike OMNY, they just do an automated +`is_sample_in_gripper()`/`is_sample_slot_used()` check and raise `FlomniError` directly, no +`ftransfer_confirm_dialog()` gate to save an image at. FlOMNI's `save_reference_image()` is (like +OMNY's `_otransfer_save_reference_images()` used to be) only ever called from its own "All OK? +Continue?" handshake (`flomni.py` around line 1107-1112) -- so flOMNI and OMNY are consistent +with each other again after this change, just via different means (OMNY has extra manual gates +FlOMNI never had, not a missing image-save call on an existing FlOMNI gate). + +If FlOMNI ever gains an interactive "confirm gripper is empty" gate of its own (closing this +long-standing behavioral difference from OMNY), it should get a `save_reference_image()` call at +the same point, for consistency with this change -- noted here so it isn't forgotten if/when that +gate gets added, not because anything is broken today. + ## Environment note (not code, but will bite again if forgotten) Both `csaxs_bec` and `bec_widgets` were pip-installed editable pointing at pre-repo- diff --git a/csaxs_bec/bec_ipython_client/plugins/omny/omny_sample_transfer_mixin.py b/csaxs_bec/bec_ipython_client/plugins/omny/omny_sample_transfer_mixin.py index d90cb64e..e0703aed 100644 --- a/csaxs_bec/bec_ipython_client/plugins/omny/omny_sample_transfer_mixin.py +++ b/csaxs_bec/bec_ipython_client/plugins/omny/omny_sample_transfer_mixin.py @@ -808,6 +808,7 @@ class OMNYSampleTransferMixin: if not self.otransfer_confirm_dialog("Ready to start the mount process now?", "y"): raise OMNYTransferError("Transfer process has been manually aborted.") + self._otransfer_save_reference_images(file_suffix="put_mount_start") dev.otransy.controller.socket_put_confirmed("XQ#GRPUT") print("The mount process started.") @@ -932,6 +933,7 @@ class OMNYSampleTransferMixin: "y", ): raise OMNYTransferError("Transfer process has been manually aborted.") + self._otransfer_save_reference_images(file_suffix="get_gripper_empty_check") # clean abort before starting dev.otransx.controller.socket_put_confirmed("XQ#STOP,1") time.sleep(0.1) @@ -962,6 +964,7 @@ class OMNYSampleTransferMixin: if not self.otransfer_confirm_dialog("Ready to start the unmount process now?", "y"): raise OMNYTransferError("Transfer process has been manually aborted.") + self._otransfer_save_reference_images(file_suffix="get_unmount_start") dev.otransy.controller.socket_put_confirmed("XQ#GRGET")