feat: switch to Beamline combined view while busy
CI / lint (push) Skipped
CI / test (3.11) (push) Skipped
CI / test (3.12) (push) Skipped
CI / test (3.13) (push) Skipped
CI / test-with-beamline-plugins (pxi_bec) (push) Skipped
CI / test-with-beamline-plugins (pxii_bec) (push) Skipped
CI / test-with-beamline-plugins (pxiii_bec) (push) Skipped
CI / test (3.11) (pull_request) Successful in 1m27s
CI / test (3.12) (pull_request) Successful in 1m27s
CI / lint (pull_request) Failing after 1m31s
CI / test (3.13) (pull_request) Successful in 1m27s
CI / test-with-beamline-plugins (pxi_bec) (pull_request) Successful in 2m1s
CI / test-with-coverage (pull_request) Successful in 2m12s
CI / coverage-analysis (pull_request) Failing after 3s
CI / test-with-beamline-plugins (pxii_bec) (pull_request) Successful in 2m48s
CI / test-with-beamline-plugins (pxiii_bec) (pull_request) Successful in 2m44s

Generalize the robot-mount auto-switch: any busy period now brings up
the combined view so the motion can be watched, and the sample camera
returns when busy clears. Edge-triggered, so manual tab choices
survive between transitions; _mounting renamed to _watching_motion.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
This commit is contained in:
duan_jandClaude Fable 5 committed 2026-08-13 15:42:00 +02:00
1 parent d659f05009
commit 58bde9379b
1 file changed
+10 -5
+10 -5
View File
@@ -199,7 +199,7 @@ class MainWindow(QMainWindow):
self._base_url = base_url
self._token = token
self._mounting = False
self._watching_motion = False
self._samcam_feed_banner_active = False
self._samcam_feed_banner_message = "Sample camera feed unavailable"
@@ -2707,11 +2707,16 @@ class MainWindow(QMainWindow):
if self._remote_close_deadline_ts is not None:
self._clear_remote_close_request()
if not self._mounting and s.state == BeamlineStateEnum.RobotSampleExchange:
self._mounting = True
# Busy (or the robot station) means something is physically moving:
# show the Beamline combined view so the motion can be watched, and
# return to the sample camera once it is done. Edge-triggered so a
# manual tab choice survives between transitions.
moving = bool(s.busy) or s.state == BeamlineStateEnum.RobotSampleExchange
if moving and not self._watching_motion:
self._watching_motion = True
self.video_tab.setCurrentWidget(self.beamline_combined_panel)
elif self._mounting and s.state != BeamlineStateEnum.RobotSampleExchange:
self._mounting = False
elif not moving and self._watching_motion:
self._watching_motion = False
self.video_tab.setCurrentWidget(self.sample_camera)
# ========== BATON DIALOG HANDLING ==========