- promote crystal score to its own RasterGridMetric.RASTER_SCORE; first and
default metric in the GUI dropdown; restore PR to original "Profile Radius"
- send per-cell raster score to AareDB via RasterPayloadModel
- split raster_highest_score (compute_crystal_score_array) from
raster_centre_of_mass (restored to ndimage.center_of_mass); use score-based
targeting for where-to-collect in both simulation and real mode
- add tests covering compute_crystal_score_array and raster_highest_score
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
The detector_distance_mm sent to JFJoch and written to the DB came from the
live detector readback (diffraction.dtz_mm) captured before the detector
finished moving, so a scan requested at e.g. 100 mm could be recorded at the
old position (e.g. 800 mm).
- JFJoch + DB now read the validated request target (request.dtz) instead of
the live diffraction.dtz_mm; diffraction.dtz_mm stays live for the
local-contact readout.
- jfjoch: raise if request.dtz is unset (setup_datacollection must validate it
first) instead of silently falling back to the live readback.
- raster + rotation services: wait for the detector to reach request.dtz
(set_dtz wait=True) right before triggering the scan, since the sa2dc move is
non-blocking. (Raster setup-before-measure reorder landed earlier in daq.py.)
- tests: request.dtz now required in jfjoch/aaredb tests; xtal-snapshot exposure
assertion updated to 1 ms.
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
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>
Commit 071b4ab made mount() return SUCCESS as soon as it saw the intermediate
TELL "state"/Busy event, before the later "Gripper detection" event is read,
so an empty-gripper mount completed silently with no MountingFailed/pop-up.
check_command_ok blocks (wait_not_busy) until the mount sequence finishes, so
after it returns the robot's own record is authoritative: if get_mounted_sample()
is None the gripper was empty -> return NO_PIN_IN_GRIPPER, which the mounting
service maps to MountingFailed("No Pin in Gripper"). Covers manual and automation.
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Fix the GUI pop-up path and add personnel-safety-system (PSS) gating so
door-open / beam-down / shutter-closed conditions are surfaced and acted on.
- exception pop-ups: connect the previously-orphaned http_error signal;
failed user operations now raise a modal dialog, background/polling errors
a non-modal banner.
- PSS device (devices/pss_state.py) reading EH1-PSYS PROHIBITED-STATE /
ALARM-STATE; new critical DoorSafetyError + DOOR_SAFETY_ERROR code.
- mounting service blocks mount/unmount when the hutch is not prohibited or
an alarm is active; /status now publishes pss_prohibited / pss_alarm.
- GUI blocks manual mount/unmount and the automation Run button immediately
(pop-up) on door-open, and shows a warning banner while an alarm is active.
- centralise per-action precondition checks (ring current, safety shutter,
hutch door) into one combined "continue?" dialog with a session-global
"don't ask again for 1 hour" snooze, applied to all data-collection buttons.
- live automation pauses and auto-resumes on bad conditions (beam, shutter,
door, robot) with continue-now / stop overrides, gated by a default-on
"Pause on bad conditions" checkbox replacing the dead CHECK_ENABLED constant.
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Add DbOverrideLineEdit: a numeric field holding both a database value and
the user's value, driven by a per-tab Database/User-values toggle. The
user's value persists across samples, can be reverted to the database
value, and recovered again - replacing the clunky per-field checkboxes.
Fix the dtz<->resolution coupling so editing one updates the other in both
Database and User modes (previously it broke whenever a value was
overridden). Wire resolution, detector distance, transmission, exposure,
rotation total/image angle and the raster grid element size through the
new widget; other panels are untouched.
Add tests covering persist/revert/recover, the toggle's downstream emit,
the dtz/resolution coupling in both modes, and cross-sample persistence.
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>