DAQ: added park_and_dry functionality - needs testing

This commit is contained in:
2026-03-13 09:43:06 +01:00
parent 9caabeed89
commit b44fd51610
3 changed files with 28 additions and 0 deletions
+15
View File
@@ -405,6 +405,21 @@ class AareDAQ:
self.__cfg.state_busy = False
raise
def park_and_dry(self):
self.__cfg.try_set_busy(timeout=360)
try:
self.__devs.tell.check_enable_motion()
self.__devs.tell.wait_not_busy()
self.__devs.tell.set_in_mount_position(True)
self.__devs.tell.unmount(wait=True, timeout=60.0)
self.__devs.tell.dry(wait_cold=-1, wait=True, timeout=360.0)
self.__cfg.current_sample = None
self.__cfg.state_busy = False
except Exception as e:
self.__cfg.state_busy = False
logger.error(f"Failed to park and dry: {e}")
raise e
def __mount_failure_handler(self, mount_error):
pass
+9
View File
@@ -316,6 +316,15 @@ async def sample(token: str = Depends(oauth2_scheme)) -> SampleShortInfo:
location=s.location
)
async def park_and_dry(token: str = Depends(oauth2_scheme)):
token_data = auth.parse_token(token)
auth.check_jwt_ro(cfg, auth.parse_token(token))
daq.park_and_dry()
return {
"ok": True,
"message": "TELL has been dryed and parked",
}
@app.post("/sample/mount")
async def mount(dbid: int, token: str = Depends(oauth2_scheme), reference: bool = False):
+4
View File
@@ -811,6 +811,10 @@ class DAQWorker(QObject):
def mount(self, s: SampleShortInfo, reference: bool = False):
self.generic_post(f"sample/mount?dbid={s.db_id}&reference={reference}")
@Slot()
def park_and_dry(self):
self.generic_post("sample/park_and_dry")
@Slot(SampleShortInfo)
def sample_manual(self, s: SampleShortInfo):
self.generic_post(f"sample/manual", s.model_dump_json())