DAQ: added park_and_dry functionality - needs testing
This commit is contained in:
@@ -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
|
||||
|
||||
|
||||
@@ -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):
|
||||
|
||||
@@ -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())
|
||||
|
||||
Reference in New Issue
Block a user