From 7054bf9858c44a226dfb3cb71f4ee94658610bae Mon Sep 17 00:00:00 2001 From: x01dc Date: Mon, 13 Jul 2026 21:57:50 +0200 Subject: [PATCH] feat(bec_widgets): mirror the single-point acquisition-method warning in the GUI Adds a wrapped, styled warning label under "Random shift max" in the params panel, shown whenever "Single-point scan" is checked and hidden otherwise -- same reminder tomo_parameters() now prints on the CLI side: use tomo_acquire_at_angle(angle), not tomo_scan_projection(angle), when single-point mode is on. Toggled from the existing _on_single_point_changed() handler, so it updates on both a live edit and every params-panel refresh (the widget's checkbox state already drives this handler either way). Co-Authored-By: Claude Sonnet 5 --- .../bec_widgets/widgets/tomo_params/tomo_params.py | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/csaxs_bec/bec_widgets/widgets/tomo_params/tomo_params.py b/csaxs_bec/bec_widgets/widgets/tomo_params/tomo_params.py index 61be0cb..322cf2e 100644 --- a/csaxs_bec/bec_widgets/widgets/tomo_params/tomo_params.py +++ b/csaxs_bec/bec_widgets/widgets/tomo_params/tomo_params.py @@ -386,6 +386,16 @@ class TomoParamsWidget(BECWidget, QWidget): max_=10.0, decimals=3, ) + self._lbl_single_point_hook_warning = QLabel( + "With single-point mode on, acquire a single projection (including inside " + "a custom at_each_angle hook) with tomo_acquire_at_angle(angle), not " + "tomo_scan_projection(angle) -- the latter always runs a full Fermat scan " + "regardless of this setting." + ) + self._lbl_single_point_hook_warning.setWordWrap(True) + self._lbl_single_point_hook_warning.setStyleSheet("color: #B8860B;") + self._lbl_single_point_hook_warning.setVisible(False) + common_form.addRow("", self._lbl_single_point_hook_warning) self._pw["at_each_angle_hook"] = QComboBox() self._pw["at_each_angle_hook"].setEnabled(False) self._pw["at_each_angle_hook"].setToolTip( @@ -731,6 +741,9 @@ class TomoParamsWidget(BECWidget, QWidget): self._pw["stitch_y"].setEnabled(self._edit_mode and not checked) # random shift only applies to single-point acquisitions self._pw["single_point_random_shift_max"].setEnabled(self._edit_mode and checked) + # informational, not an editable field -- shown whenever single-point + # is on, in or out of edit mode, mirroring tomo_parameters()'s CLI note + self._lbl_single_point_hook_warning.setVisible(checked) def _on_poll(self) -> None: """Periodic refresh: params (guarded against edit mode) + sample name."""