Commit Graph
96 Commits
Author SHA1 Message Date
perl_d 8a51eef4f0 feat: lazily init jfj client 2026-08-11 13:02:54 +02:00
duan_jandClaude Fable 5 e77dfb4716 refactor: shared busy-badge renderer for camera and axis video views
draw_busy_badge in busy_overlay renders the title+subtext pill once;
the sample camera and axis video overlays both delegate to it instead
of keeping diverging copies. The axis panel's dot+label status pill and
its per-theme QSS go away with it.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
2026-08-11 10:35:55 +02:00
duan_jandClaude Fable 5 e457236777 feat: merge Automation progress and Console log into one Information dock
The two tabified bottom docks left their switcher tabs stranded at the
window bottom; one Information dock with proper tabs mirrors the Sample
List dock's layout. LogDock becomes the LogPanel widget with mirror
views for the pop-out and a reveal_requested signal so the owner
controls visibility (Ctrl+Shift+L, notifications).

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
2026-08-11 10:35:55 +02:00
duan_jandClaude Fable 5 7b4764e7ca test: cover the camera overlays, theme migration, layout heal, and splash
Diff coverage vs main was 77%, under the 80% CI gate; the new camera
help/error/badge code and the theme+layout main_window paths were the
uncovered bulk. Locally: 82%.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
2026-08-11 10:35:55 +02:00
duan_jandClaude Fable 5 2adf8ff6d5 style: narrow the log pop-out view for the pyright gate
The Optional _popout_view is assert-narrowed once after opening; the
unguarded accesses were the last three diff-gate violations.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
2026-08-11 10:35:54 +02:00
duan_jandClaude Fable 5 69b6813025 test: cover the sample-status logic, wheel guard, pop-outs, and log mirror
New tests for what the port added: status tint priority and
context-dependent chip filters on the dewar/queue model, the
right-button wheel guard (motor protection), PopoutWindow edge maths,
manual-resize fallback, close-hides behavior and DockTitleBar, the
chip drag-drop relabeling, and the console-log pop-out mirror. The
widgets' __main__ self-checks are superseded by these and removed.
Brings PR diff coverage from 70% to 81% (gate: 80%).

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
2026-08-11 10:35:54 +02:00
duan_jandClaude Fable 5 0b80c75c63 test: track the sample-table column shift, sort imports
The frozen #+status column shifted data columns +1, so the User-column
model tests move from index 5 to 6; ruff import-sort fixes for
main_window and log_panel ride along.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
2026-08-11 10:35:46 +02:00
duan_jandClaude Fable 5 b7d6610261 style: move panel and model colors to the shared palette
Mechanical swap of hardcoded color literals for styles.py constants and
qcolor() across panels, models, and scan_logic. portrait_mode.py drops
its private palette block; beamline_controls and data_collection_settings
gain object names so the new $border QSS rules can target them. The
status-panel test asserts the palette hex instead of 'red'.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
2026-08-11 10:35:46 +02:00
duan_jandClaude Fable 5 3175e437a4 test: cover the beamline state bar
Availability sets (routes + menu shortcuts, Moving/unknown), signal
gating, palette and cursors per availability, red/blue active states,
adaptive label wrapping, left-click hint paths, hover-hint timer
lifecycle, and pending-target clearing. Lifts the PR diff coverage back
over the 80 percent gate (measured 88 percent locally).

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
2026-08-11 10:35:46 +02:00
duan_jandClaude Fable 5 f84bee66ee feat: start all collapsible panels collapsed by default
A fresh GUI shows only the banners; the Beamline state panel keeps its
own expanded default. A user's saved per-title states still override.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
2026-08-11 10:35:46 +02:00
duan_jandClaude Fable 5 ce0ed20d5a style: fix lint for the banner/adaptive changes
- ruff format and import ordering (main_window, data_collection_settings,
  beam_center_panel, beamline_state_panel)
- rename unused unpacked variable in test_title_label
- replace the mousePressEvent monkeypatch on the beamline state title
  with a proper eventFilter so basedpyright accepts the diff

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
2026-08-11 10:35:46 +02:00
duan_jandClaude Fable 5 a9137b3221 feat: collapsible half-height panel banners with a universal gap
TitleLabel gains an optional collapsible mode: whole-banner click target,
bare +/- glyph (no pill background), per-title collapsed state persisted
in QSettings, and an expand() helper. Banners are halved to 25px with
plain text + QSS font (H3 margins would clip vertically).

- convert Zoom, Light, Omega, Smargon, Sample camera, Monochromator,
  ABR meas. pos., Beam mark, Beam center, Beam size, Dataset path and
  Loop centering to collapsible banners
- new collapsible Exp. Config. section wrapping the scan tabs
- move Manual sample from a bottom dock into the left column between
  Dataset path and Exp. Config.; Ctrl+M now expands it instead of
  raising the dock
- Beamline state banner restyled to match (25px, plain font, bare
  glyph, whole banner clickable)
- universal 11px banner gap via tighten_column() shared by both panel
  columns and the left column stack; ABR banner spans all grid columns
  and file path / manual sample drop side margins so widths align
- abort button sits under the tabs instead of pinned to the bottom
- unit tests for the collapse behavior

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
2026-08-11 10:35:46 +02:00
perl_d e0db953b86 feat: add beamline dispatch for x06da
CI / lint (pull_request) Successful in 46s
CI / test (3.11) (pull_request) Successful in 47s
CI / test (3.13) (pull_request) Successful in 48s
CI / test (3.12) (pull_request) Successful in 50s
CI / test-with-beamline-plugins (pxi_bec) (pull_request) Successful in 1m0s
CI / test-with-beamline-plugins (pxii_bec) (pull_request) Successful in 58s
CI / test-with-coverage (pull_request) Failing after 1m17s
CI / coverage-analysis (pull_request) Skipped
CI / test-with-beamline-plugins (pxiii_bec) (pull_request) Successful in 1m19s
CI / lint (push) Canceled after 34s
CI / test (3.11) (push) Canceled after 33s
CI / test (3.12) (push) Canceled after 30s
CI / test (3.13) (push) Canceled after 28s
CI / test-with-beamline-plugins (pxi_bec) (push) Canceled after 25s
CI / test-with-beamline-plugins (pxii_bec) (push) Canceled after 23s
CI / test-with-beamline-plugins (pxiii_bec) (push) Canceled after 20s
CI / test-with-coverage (push) Canceled after 17s
CI / coverage-analysis (push) Canceled after 0s
Build and Publish / release (push) Successful in 24s
2026-08-04 10:29:46 +02:00
perl_d 0135129c89 fix: as many ruff errors as possible, some type
CI / lint (pull_request) Failing after 33s
CI / test (3.11) (pull_request) Skipped
CI / test (3.12) (pull_request) Skipped
CI / test (3.13) (pull_request) Skipped
CI / test-with-beamline-plugins (pxi_bec) (pull_request) Skipped
CI / test-with-beamline-plugins (pxii_bec) (pull_request) Skipped
CI / test-with-beamline-plugins (pxiii_bec) (pull_request) Skipped
CI / test-with-coverage (pull_request) Skipped
2026-08-03 09:27:40 +02:00
perl_d f63107a1e0 style: ruff check --fix --unsafe-fixes 2026-07-31 15:57:17 +02:00
perl_d 70c81abdd8 ci: add better linting
CI / lint (pull_request) Failing after 31s
CI / test (3.11) (pull_request) Skipped
CI / test (3.12) (pull_request) Skipped
CI / test (3.13) (pull_request) Skipped
CI / test-with-beamline-plugins (pxi_bec) (pull_request) Skipped
CI / test-with-beamline-plugins (pxii_bec) (pull_request) Skipped
CI / test-with-beamline-plugins (pxiii_bec) (pull_request) Skipped
CI / test-with-coverage (pull_request) Skipped
2026-07-31 15:48:53 +02:00
perl_d ba68b6b233 fix: pxi and pxiii tests shouldn't work yet
CI / lint (pull_request) Successful in 30s
CI / test (3.12) (pull_request) Successful in 45s
CI / test (3.13) (pull_request) Successful in 45s
CI / test (3.11) (pull_request) Successful in 53s
CI / test-with-beamline-plugins (pxi_bec) (pull_request) Successful in 51s
CI / test-with-beamline-plugins (pxii_bec) (pull_request) Successful in 51s
CI / test-with-beamline-plugins (pxiii_bec) (pull_request) Successful in 54s
CI / test-with-coverage (pull_request) Successful in 56s
CI / lint (push) Canceled after 15s
CI / test (3.11) (push) Canceled after 0s
CI / test (3.12) (push) Canceled after 0s
CI / test (3.13) (push) Canceled after 0s
CI / test-with-beamline-plugins (pxi_bec) (push) Canceled after 0s
CI / test-with-beamline-plugins (pxii_bec) (push) Canceled after 0s
CI / test-with-beamline-plugins (pxiii_bec) (push) Canceled after 0s
CI / test-with-coverage (push) Canceled after 0s
Build and Publish / release (push) Successful in 12s
2026-07-31 12:23:20 +02:00
perl_d e90fd52e47 test: add test for dispatch against each plugin
CI / test (3.12) (pull_request) Successful in 1m13s
CI / lint (pull_request) Successful in 1m17s
CI / test (3.11) (pull_request) Successful in 1m55s
CI / test (3.13) (pull_request) Successful in 2m6s
CI / test-with-beamline-plugins (pxi_bec) (pull_request) Failing after 53s
CI / test-with-beamline-plugins (pxii_bec) (pull_request) Successful in 51s
CI / test-with-beamline-plugins (pxiii_bec) (pull_request) Failing after 1m5s
CI / test-with-coverage (pull_request) Skipped
2026-07-31 12:09:07 +02:00
perl_d 7b79dd8ec5 style: remove pointless name-mangled attrs
CI / lint (push) Successful in 30s
CI / test (3.11) (push) Successful in 53s
CI / test (3.13) (push) Successful in 51s
CI / test (3.12) (push) Successful in 56s
the fact that removing them didn't break anything shows that they
were completely unneccessary - there is no inheritance tree
using the same names
2026-07-31 09:45:16 +02:00
perl_d fb0c8efebe style: replace dunder attributes with normal 'private' attrs 2026-07-30 18:26:15 +02:00
perl_d 6affbf9148 style: ruff check --fix --unsafe-fixes 2026-07-27 14:46:06 +02:00
perl_d 910076a238 style: ruff check --fix 2026-07-27 14:45:37 +02:00
perl_d 0451b8cebb style: ruff format 2026-07-27 14:45:12 +02:00
David Perl df3ddc5c84 Live changes from early July, PX-III
Build and Publish / test (pull_request_target) Successful in 2m59s
Build and Publish / build (pull_request_target) Successful in 19s
Build and Publish / Build and Deploy Docs (pull_request_target) Successful in 35s
2026-07-27 10:33:04 +02:00
appleb_m 60faea716f chore: removed redundant /camera/source and /beamline/imafge from server.py and test_server.py
Build and Publish / test (pull_request) Failing after 1m23s
Build and Publish / build (pull_request) Skipped
Build and Publish / Build and Deploy Docs (pull_request) Skipped
Build and Publish / test (pull_request_target) Failing after 1m25s
Build and Publish / build (pull_request_target) Skipped
Build and Publish / Build and Deploy Docs (pull_request_target) Skipped
Build and Publish / test (push) Failing after 1m26s
Build and Publish / build (push) Skipped
Build and Publish / Build and Deploy Docs (push) Skipped
2026-07-09 14:50:37 +02:00
perl_d 264e6671c7 chore: remove common tests from daq
Build and Publish / test (pull_request) Successful in 2m11s
Build and Publish / build (pull_request) Successful in 20s
Build and Publish / Build and Deploy Docs (pull_request) Successful in 35s
Build and Publish / test (push) Successful in 2m14s
Build and Publish / test (pull_request_target) Successful in 2m23s
Build and Publish / build (push) Successful in 19s
Build and Publish / build (pull_request_target) Successful in 20s
Build and Publish / Build and Deploy Docs (push) Successful in 34s
Build and Publish / Build and Deploy Docs (pull_request_target) Successful in 38s
2026-07-08 11:56:30 +02:00
perl_d 99326614ae style: ruff check fix 2026-07-06 15:39:02 +02:00
perl_d b0863e5ddb style: format with ruff
Build and Publish / test (pull_request) Failing after 1m23s
Build and Publish / build (pull_request) Skipped
Build and Publish / Build and Deploy Docs (pull_request) Skipped
2026-07-06 11:53:49 +02:00
perl_d 13bddd43c7 refactor: use aarecommon and remove common 2026-07-06 11:53:49 +02:00
appleb_m 4de76d9333 fixed workflows test to use mock_devs.dtz
Build and Publish / test (push) Successful in 2m18s
Build and Publish / build (push) Successful in 17s
Build and Publish / Build and Deploy Docs (push) Successful in 39s
2026-07-03 14:22:11 +02:00
appleb_m 7d20534c60 tell_backend: all exceptions where being caught and squashed/renamed. Hopefully fixed, may lead to strange error behaviours for other fails.
Build and Publish / test (push) Failing after 2m6s
Build and Publish / build (push) Skipped
Build and Publish / Build and Deploy Docs (push) Skipped
2026-07-02 17:37:29 +02:00
GotthardG 51535239d0 adding beam center to raster shots, correcting test logic
Build and Publish / test (push) Successful in 2m7s
Build and Publish / build (push) Successful in 17s
Build and Publish / Build and Deploy Docs (push) Successful in 40s
2026-06-30 15:16:22 +02:00
GotthardG 85d568fe52 adding beam center to raster shots, correcting test logic
Build and Publish / test (push) Failing after 2m3s
Build and Publish / build (push) Skipped
Build and Publish / Build and Deploy Docs (push) Skipped
2026-06-30 15:01:46 +02:00
GotthardG 05bd967733 adding test for rotation screening diffraction image ingestion logic to aaredb and service methods
Build and Publish / test (push) Successful in 2m11s
Build and Publish / build (push) Successful in 18s
Build and Publish / Build and Deploy Docs (push) Successful in 41s
2026-06-29 16:05:05 +02:00
appleb_m 64e054f9d8 Merge branch 'ml_zoom'
Build and Publish / test (push) Successful in 2m12s
Build and Publish / build (push) Failing after 17s
Build and Publish / Build and Deploy Docs (push) Skipped
# Conflicts:
#	src/aare/daq/operations/raster/service.py
2026-06-26 16:45:20 +02:00
appleb_mandClaude Opus 4.8 b8dd3756cc raster auto-center: allow extra grid padding at the bottom of the y scan
Make the first-grid y padding asymmetric: the bottom (far end of the n_y scan)
can be padded more than the top via daq.auto_raster.grid_padding_fraction_y_
bottom (defaults to grid_padding_fraction_y, so symmetric unless set higher).
The top padding still shifts smargon_top_left; the extra bottom padding only
grows n_y.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-06-26 11:08:02 +02:00
appleb_mandClaude Opus 4.8 5377e7d489 raster auto-center: unified first-grid padding in x and y (shifts top-left)
Replace the loop_face-only box padding with a single grid padding applied to
the first auto-center grid scan for any loop box (loop_all or loop_face). It
pads each side by a fraction of the grid size (daq.auto_raster.grid_padding_
fraction_x / _y, default 0.15), with a minimum of one cell per side, and
extends *before* cell 0 too so smargon_top_left shifts outward. Manual grid
(get_ml_bounding_box) is unchanged (grid_padding defaults off).

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-06-26 10:43:12 +02:00
appleb_mandClaude Opus 4.8 53e29bece3 raster auto-center: zoom-to-fit loop + loop_face padding + optional crystal union
Before the first auto-center raster, zoom so the loop fills at most 1/3 of the
frame, pad loop_face grids, and optionally extend the grid to cover crystals
outside the loop.

- ml_bounding_box: add build_ml_raster_plan() (single prediction via
  predict_all_best) returning the grid request + raw loop_all/loop_face boxes +
  image size. Grid box is loop_face (else loop_all); loop_face is padded by
  daq.auto_raster.loop_face_padding_fraction (15% default); when
  daq.auto_raster.include_crystal is set, the grid is unioned with any crystal
  boxes lying beyond the loop. get_ml_bounding_box (manual button / endpoint)
  is unchanged.
- config: add zoom_for_pixel_to_mm(), the inverse of pixel_to_mm.
- raster service execute_auto_center: after the first detection (reused, no
  re-predict), pick loop_all if detected and not clipped at the frame edge else
  loop_face, compute the zoom that makes its larger side 1/3 of the frame, clamp
  to daq.hardware.zoom_min/max, set zoom and re-expose.
- x06da.yaml: zoom_min/max + daq.auto_raster block.
- tests for box selection, padding, crystal union and the clipped-loop_all rule.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-06-26 09:45:43 +02:00
duan_jandClaude Opus 4.8 f860e47914 DAQ/GUI: raster score as its own metric + score-based targeting
Build and Publish / test (pull_request) Successful in 2m7s
Build and Publish / build (pull_request) Successful in 17s
Build and Publish / Build and Deploy Docs (pull_request) Successful in 41s
Build and Publish / build (pull_request_target) Cancelled after 0s
Build and Publish / Build and Deploy Docs (pull_request_target) Cancelled after 0s
Build and Publish / test (pull_request_target) Cancelled after 16s
- 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>
2026-06-25 18:05:29 +02:00
appleb_mandClaude Opus 4.8 ec45bf3729 daq: send commanded dtz (not live readback) to JFJoch/DB + wait for arrival
Build and Publish / test (push) Failing after 2m10s
Build and Publish / build (push) Skipped
Build and Publish / Build and Deploy Docs (push) Skipped
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>
2026-06-25 16:39:06 +02:00
appleb_mandClaude Opus 4.8 5370c0f168 tell_client: restore "No Pin in Gripper" detection on empty-gripper mount
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>
2026-06-24 15:30:08 +02:00
appleb_mandClaude Opus 4.8 47e05dc28c GUI/DAQ: hutch-safety gating, error pop-ups, and automation pause-and-wait
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>
2026-06-24 15:30:08 +02:00
appleb_mandClaude Opus 4.8 476aa69d70 data collection settings: panel-level Database/User-values toggle
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>
2026-06-24 15:30:08 +02:00
appleb_m ef7d3cf157 Tell_client: fix state event handling, update tests 2026-06-24 15:30:07 +02:00
appleb_m 8be1b0a0b5 tell: added door and remote check. 2026-06-24 15:30:07 +02:00
appleb_m ea3629d7b5 reminder to add tests for tell status chcks and other functions 2026-06-24 15:30:07 +02:00
appleb_m 8869fb26b9 update test cases for workflows, server and daq_server 2026-06-24 15:30:06 +02:00
appleb_m c1edacc9c3 Added style sheet options - protrait style needs to be added to more places. 2026-06-24 15:30:05 +02:00
appleb_m f5f53a29ca operations refactor: standardised operations, added rotation operation, updated tests. 2026-06-24 15:30:04 +02:00
appleb_m 0ad42f7f71 updated workflows test 2026-06-24 15:30:03 +02:00