fix: combine park and dry to one action for after-queue cleanup #223

Merged
perl_d merged 1 commits from fix/clean_up_after_experiments_are_done into main 2026-09-14 09:44:28 +02:00
4 changed files with 28 additions and 5 deletions
+19
View File
@@ -1200,6 +1200,25 @@ async def unmount(token: str = Depends(oauth2_scheme)):
return "OK"
@app.post("/sample/unmount_then_park_and_dry")
@needs_hw_lock
async def unmount_then_park_and_dry(token: str = Depends(oauth2_scheme)):
"""
Unmount the current sample from the goniometer, then tell the robot to park and dry
Args:
token: OAuth2 access token.
Returns:
"OK" on success.
"""
logger.debug("Unmount, then park and dry")
auth.check_jwt_rw(cfg, auth.parse_token(token))
daq.sample = None
daq.park_and_dry(park=True)
return "OK"
@app.post("/sample/manual")
@needs_hw_lock
async def manual(s: SampleShortInfo, token: str = Depends(oauth2_scheme)):
+1 -1
View File
@@ -1113,7 +1113,7 @@ class MainWindow(QMainWindow):
self.job_list_panel.auto_scan.connect(self.daq.automated_scan)
self.job_list_panel.unmount.connect(self.daq.unmount)
self.job_list_panel.park_and_dry.connect(self.daq.park_and_dry)
self.job_list_panel.unmount_then_park_and_dry.connect(self.daq.unmount_then_park_and_dry)
# Gate manual mounts/unmounts on the hutch PSS state so the user gets an
# immediate pop-up instead of the robot failing to move server-side.
+4 -3
View File
@@ -31,7 +31,7 @@ logger = setup_logger(LOGGER_NAME)
class SampleQueuePanel(QFrame):
auto_scan = Signal(SampleShortInfo)
unmount = Signal()
park_and_dry = Signal()
unmount_then_park_and_dry = Signal()
viewer_track_online = Signal()
samples_in_queue_changed = Signal(int)
automation_running_changed = Signal(bool)
@@ -284,11 +284,12 @@ class SampleQueuePanel(QFrame):
self.pause_automation()
logger.info("Automation queue empty; unmounting current sample.")
self.unmount.emit()
if self.park_and_dry_when_cleared.isChecked():
logger.info("Automation queue empty; parking and drying TELL.")
self.park_and_dry.emit()
self.unmount_then_park_and_dry.emit()
else:
self.unmount.emit()
def run(self):
self._recovery_timer.stop()
+4 -1
View File
@@ -1499,7 +1499,10 @@ class DAQWorker(QObject):
def anneal(self, time_s: float):
self.generic_post(f"beamline/anneal?time_s={time_s:.1f}")
# TODO combine dry and park and dry
@Slot()
def unmount_then_park_and_dry(self):
self.generic_post("sample/unmount_then_park_and_dry")
@Slot()
def park_and_dry(self):
self.generic_post("tell/park_and_dry")