From 8893a109ddaf46b0c58aff5f57f5ddcd525b22d4 Mon Sep 17 00:00:00 2001 From: Filip Leonarski Date: Fri, 24 Oct 2025 17:33:22 +0200 Subject: [PATCH] TELL: added check for drying if samples are loaded from dewer --- daq/src/mxlibs3/tell_client.py | 22 ++++++++++++++++++++-- 1 file changed, 20 insertions(+), 2 deletions(-) diff --git a/daq/src/mxlibs3/tell_client.py b/daq/src/mxlibs3/tell_client.py index bbd4bcda..fecb0c4a 100755 --- a/daq/src/mxlibs3/tell_client.py +++ b/daq/src/mxlibs3/tell_client.py @@ -294,7 +294,6 @@ class TellClient: wait: bool = False, # blocking operation timeout: float = 600.0, ): - print(address) SampleDewarAddress.model_validate(address) segment = address.puck.segment @@ -316,13 +315,32 @@ class TellClient: if self.is_busy(): raise TellCommandWhileBusyException("mount received while robot is busy") + logger.info(f"loading sample {sample} from segment {segment} - {puck}") + self._last_cmd_id = self.start_cmd( "mount", segment, puck, sample, force, read_dm, auto_unmount ) wait_timeout = timeout + self.estimate_mounting_time(segment) logger.info("waiting for mount to complete") - if wait: + if wait and segment in "ABCDEF": + event, value = self.pshell.wait_events({"state": None, "motion_task": "dry"}, timeout=wait_timeout) + if event is None or event == "state": + logger.info(f"event: {event} occurred with value: {value}, checking command completed okay") + self.check_command_ok( + timeout=wait_timeout, msg=f"Mount failed for {segment}{puck}-{sample}: " + ) + elif event == "motion_task" and value == "dry": + logger.info(f"event: {event} occurred with value: {value}") + logger.info(" Drying occurring, releasing interface to user") + else: + logger.info(f"Unexpected event: {event} occurred with value: {value}") + logger.info("Checking command completed okay anyway") + self.check_command_ok( + timeout=wait_timeout, msg=f"Mount failed for {segment}{puck}-{sample}: " + ) + elif wait and segment == "X": + logger.info("Loading an auxiliary puck") self.check_command_ok( timeout=wait_timeout, msg=f"Mount failed for {segment}{puck}-{sample}: " )