fix(gui): fire mount auto-centering on the first idle status tick #244

Merged
duan_j merged 2 commits from fix/gui-auto-center-after-mount-idle-tick into main 2026-09-29 17:04:16 +02:00
2 Commits
Author SHA1 Message Date
duan_j 2c388ff7ad fix(gui): remove not longer needed return to main window at close and cleanup
CI / lint (pull_request) Successful in 1m27s
CI / test (3.12) (pull_request) Successful in 1m52s
CI / test (3.13) (pull_request) Successful in 1m35s
CI / test (3.14) (pull_request) Successful in 1m39s
CI / test-with-beamline-plugins (pxi_bec) (pull_request) Successful in 1m41s
CI / test-with-coverage (pull_request) Successful in 1m47s
CI / coverage-analysis (pull_request) Successful in 2s
CI / test-with-beamline-plugins (pxii_bec) (pull_request) Successful in 1m14s
CI / test-with-beamline-plugins (pxiii_bec) (pull_request) Successful in 1m20s
Docs build and publish / docker (push) Successful in 2s
Build and Publish / release (push) Failing after 14s
CI / test-with-beamline-plugins (pxii_bec) (push) Failing after 50s
CI / test-with-beamline-plugins (pxiii_bec) (push) Failing after 50s
CI / test-with-beamline-plugins (pxi_bec) (push) Failing after 1m0s
CI / lint (push) Failing after 1m27s
CI / test (3.12) (push) Successful in 1m35s
CI / test (3.13) (push) Successful in 1m36s
CI / test (3.14) (push) Successful in 1m37s
CI / test-with-coverage (push) Successful in 1m39s
CI / coverage-analysis (push) Skipped
2026-09-29 16:51:07 +02:00
duan_jandClaude Fable 5.1 3409d01efd fix(gui): fire mount auto-centering on the first idle status tick
The "apply after mounting" checkbox clicked Auto Centering as soon as the
status poll showed a new sample id. /sample/mount still holds the hw lock
at that point, /alc/center_loop takes the same lock non-blocking, and the
resulting BeamlineBusyException is a quiet error the GUI swallows. So the
automatic click never did anything; only a later manual click worked.

Arm on the sample-id change and click on the first status tick with
busy=False, which is exactly what the user did by hand. Skip arming while
queue automation runs: it mounts and centers on its own and frees the lock
between /scan/auto calls, so a GUI centering in that gap would steal the
lock from the next scan. Pause during a scan's mount phase can still arm
that one sample, but Pause ends in an unmount, so the window is a ms-wide
lock gap sampled at 2 Hz; accepted, noted in the code.

Supersedes the three-commit approach on
fix/auto-center-after-mount-wait-idle (PR 243).

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
2026-09-29 16:51:07 +02:00