gui: surface "beamline busy" errors quietly, not as a modal
BeamlineBusyException / TellCommandWhileBusyException fire when a user triggers
an action while the beamline or robot is busy. These are blocking-but-benign
("you can't do that right now"), so route them to the log + status bar instead
of a modal pop-up (and without the defensive automation pause), regardless of
the exception's critical flag. Genuine failures (e.g. No Pin in Gripper) still
get the modal.
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This commit is contained in:
co-authored by
Claude Opus 4.8
parent
bba2f8a4c4
commit
a205d6422f
+1
-1
@@ -25,7 +25,7 @@
|
||||
- **Workflows**:
|
||||
- Added `maintenance2sa`/`maintenance2se` transitions, a safe detector-Z position check, explicit per-transition error messages, and switched to `ABR_POS`/`ABR_OMEGA` mount positions; removed the unused `ws` mode.
|
||||
- **Hutch safety & error pop-ups** (in progress):
|
||||
- Re-wired the GUI pop-up path: failed user operations (mount/unmount) now raise a modal dialog (e.g. *Mounting Failed: No Pin in Gripper*) and background/polling errors a non-modal banner — previously the `http_error` signal was emitted but never connected, so these were silently dropped.
|
||||
- Re-wired the GUI pop-up path: failed user operations (mount/unmount) now raise a modal dialog (e.g. *Mounting Failed: No Pin in Gripper*) and background/polling errors a non-modal banner — previously the `http_error` signal was emitted but never connected, so these were silently dropped. Blocking-but-benign errors (e.g. "Beamline is busy" from acting mid-operation) are surfaced quietly in the log/status bar instead of a modal.
|
||||
- Added a `PssState` device reading the hutch personnel-safety system (`…-EH1-PSYS:PROHIBITED-STATE` / `:ALARM-STATE`); mounts are blocked (critical `DoorSafetyError`, automation queue paused) when the hutch is not in the prohibited state or a safety alarm is active, and an active alarm also raises a non-modal warning banner via `/status`.
|
||||
- `/status` now publishes `pss_prohibited`/`pss_alarm`; the GUI blocks manual mount/unmount and the automation Run button immediately (with a pop-up) when the hutch door is open, instead of letting the robot fail to move server-side.
|
||||
- Centralised the per-action precondition checks (ring current, safety shutter, hutch door) into one combined "continue?" dialog used by all data-collection buttons (Evaluate grid, X-ray centering, Run screening/rotation/fluorescence, simple rotation), with a session-global "Don't ask me again for 1 hour" snooze.
|
||||
|
||||
@@ -52,6 +52,15 @@ logger = setup_logger("aareGUI")
|
||||
|
||||
SPREADHSEET_FREQUENCY = 25 # Every 5 seconds
|
||||
|
||||
# Operation errors that just mean "you can't do that right now" (e.g. the user
|
||||
# triggered an action while the beamline/robot was busy). These are blocking but
|
||||
# benign, so they are surfaced quietly (log + status bar) rather than as a modal
|
||||
# pop-up, regardless of the exception's critical flag.
|
||||
QUIET_OPERATION_ERROR_CODES = frozenset({
|
||||
AareErrorCode.BEAMLINE_BUSY_EXCEPTION.value,
|
||||
AareErrorCode.TELL_COMMAND_WHILE_BUSY_EXCEPTION.value,
|
||||
})
|
||||
|
||||
|
||||
@dataclass(frozen=True)
|
||||
class ErrorInfo:
|
||||
@@ -634,6 +643,11 @@ class DAQWorker(QObject):
|
||||
self.auth_error.emit()
|
||||
elif status in (404, 410, 417):
|
||||
self.sample_missing.emit(error_info.message)
|
||||
elif error_info.code in QUIET_OPERATION_ERROR_CODES:
|
||||
# Blocking-but-benign (e.g. "Beamline is busy"): inform quietly,
|
||||
# no modal pop-up and no automation pause.
|
||||
logger.info(f"Action unavailable: {error_info.message}")
|
||||
self.status_message.emit(error_info.message, True)
|
||||
else:
|
||||
logger.error(f"{error_info.message}")
|
||||
title = self._operation_error_title(error_info.exception_class)
|
||||
|
||||
Reference in New Issue
Block a user