diff --git a/src/aare/gui/main_window.py b/src/aare/gui/main_window.py index 6917a8c9..5a3187e8 100644 --- a/src/aare/gui/main_window.py +++ b/src/aare/gui/main_window.py @@ -597,6 +597,11 @@ class MainWindow(QMainWindow): self.quick_unmount_button = QPushButton("⏏ Unmount", dewar_tab) self.quick_unmount_button.clicked.connect(lambda: self._on_manual_unmount_requested()) + # main_window.py, next to quick_unmount_button (~L597) + self.mount_next_button = QPushButton("⏭ Mount next", dewar_tab) + self.mount_next_button.clicked.connect(self._mount_next_from_queue) + # add to automation_row loop + self._queue_action_buttons as kind "next" + automation_row = QHBoxLayout() for w in ( self.job_list_panel.play_button, @@ -2395,6 +2400,19 @@ class MainWindow(QMainWindow): return "The hutch safety alarm is active. Mounting is blocked until it clears." return None + def _mount_next_from_queue(self) -> None: + """Manual step-through: mount queue head; if head already on gonio, pop it and mount the following one. + Pops only after /status confirms mount, so a failed robot move never loses a sample.""" + queue = self.job_list_panel.table_model.samples + mounted = getattr(self._latest_daq_status, "sample", None) + if queue and mounted is not None and mounted.db_id == queue[0].db_id: + self.job_list_panel.table_model.remove_sample(mounted.db_id) + queue = self.job_list_panel.table_model.samples + if not queue: + self._on_manual_unmount_requested() # or no-op; your call + return + self._on_manual_mount_requested(queue[0]) + def _on_manual_mount_requested(self, sample, reference: bool = False) -> None: """Pre-check the hutch before sending a manual mount to the server.