diff --git a/src/aare/gui/panels/beamline_state_panel.py b/src/aare/gui/panels/beamline_state_panel.py index 50536ad8..0719ded7 100644 --- a/src/aare/gui/panels/beamline_state_panel.py +++ b/src/aare/gui/panels/beamline_state_panel.py @@ -132,6 +132,7 @@ class BeamlineStatePanel(QFrame): self._current_state: BeamlineStateEnum | None = None self._hovered_state: BeamlineStateEnum | None = None self._pending_target_state: BeamlineStateEnum | None = None + self._busy = False # After 3 s of hovering an unavailable state, explain which states # it can be reached from. @@ -238,7 +239,9 @@ class BeamlineStatePanel(QFrame): def _available_targets(self) -> frozenset[BeamlineStateEnum]: current = self._current_state - if current is None or current == BeamlineStateEnum.Moving: + # Busy greys the whole strip like Moving does: a transition posted + # mid-operation would clobber it (same guard as the status-bar menu). + if self._busy or current is None or current == BeamlineStateEnum.Moving: return frozenset() # Reachable in one step: the route graph plus the status-bar # shortcut transitions. @@ -399,4 +402,7 @@ class BeamlineStatePanel(QFrame): self._apply_highlight() def update_daq_status(self, status: DAQStatusModel) -> None: + self._busy = bool(status.busy) + # set_current_state re-applies the highlight, so a busy flip + # restyles the strip on the same tick even if the state held. self.set_current_state(status.state)