From 308b4edacd03976c921ca54495028bc6ed5f652e Mon Sep 17 00:00:00 2001 From: x01dc Date: Tue, 18 Aug 2026 15:19:17 +0200 Subject: [PATCH] fix(flomni): abort sample transfer when stage-out is declined ftransfer_gripper_move() silently returned on "No" to the stage-out confirmation, but its return was indistinguishable from success to its callers (ftransfer_get_sample/ftransfer_put_sample), which then proceeded to command the physical get/mount sequence on the controller -- moving the gripper without the stage ever having moved out or the gripper being positioned at the transfer coordinates. Now raises FlomniError instead, which propagates out of both callers and stops the transfer before any controller command is sent. Co-Authored-By: Claude Sonnet 5 --- .../bec_ipython_client/plugins/flomni/flomni.py | 17 +++++++++-------- 1 file changed, 9 insertions(+), 8 deletions(-) diff --git a/csaxs_bec/bec_ipython_client/plugins/flomni/flomni.py b/csaxs_bec/bec_ipython_client/plugins/flomni/flomni.py index 86c2499c..2465eb80 100644 --- a/csaxs_bec/bec_ipython_client/plugins/flomni/flomni.py +++ b/csaxs_bec/bec_ipython_client/plugins/flomni/flomni.py @@ -1090,17 +1090,18 @@ class FlomniSampleTransferMixin: if position == 0 and fsamx_pos > -160: print("Use GUI interface.") - if self.ftransfer_confirm_dialog("May the flomni stage be moved out for the sample change? Feedback will be disabled and alignment will be lost!", "y"): - - # if self.OMNYTools.yesno( - # "May the flomni stage be moved out for the sample change? Feedback will be disabled and alignment will be lost!", - # "y", - # ): + if self.ftransfer_confirm_dialog( + "May the flomni stage be moved out for the sample change? " + "Feedback will be disabled and alignment will be lost!", + "y", + ): print("OK. continue.") self.ftransfer_flomni_stage_out() else: - print("Stopping.") - return + raise FlomniError( + "Stage-out declined by user. Aborting sample transfer before any " + "gripper motion." + ) self.ensure_gripper_up() self.check_tray_in()