diff --git a/csaxs_bec/devices/omny/galil/galil_ophyd.py b/csaxs_bec/devices/omny/galil/galil_ophyd.py index 9a7314f..588ad81 100644 --- a/csaxs_bec/devices/omny/galil/galil_ophyd.py +++ b/csaxs_bec/devices/omny/galil/galil_ophyd.py @@ -138,7 +138,7 @@ class GalilController(Controller): """ return bool(float(self.socket_put_and_receive("MG allaxref").strip())) - def drive_axis_to_limit(self, axis_Id_numeric: int, direction: str) -> None: + def drive_axis_to_limit(self, axis_Id_numeric: int, direction: str, verbose=0) -> None: """ Drive an axis to the limit in a specified direction. @@ -159,9 +159,12 @@ class GalilController(Controller): time.sleep(0.1) self.socket_put_confirmed("XQ#FES") time.sleep(0.1) + self.get_device_manager().connector.send_client_info("my_message", scope="drive axis to limit") while self.is_axis_moving(None, axis_Id_numeric): - print("waiting...") time.sleep(0.01) + if verbose: + self.get_device_manager().connector.send_client_info("my_message", scope="drive axis to limit") + time.sleep(1) axis_Id = self.axis_Id_numeric_to_alpha(axis_Id_numeric) # check if we actually hit the limit @@ -175,6 +178,12 @@ class GalilController(Controller): else: print("Limit reached.") + def get_device_manager(self): + for axis in self._axis: + if hasattr(axis, "device_manager") and axis.device_manager: + return axis.device_manager + raise BECConfigError("Could not access the device_manager") + def find_reference(self, axis_Id_numeric: int) -> None: """ Find the reference of an axis. diff --git a/csaxs_bec/devices/omny/galil/ogalil_ophyd.py b/csaxs_bec/devices/omny/galil/ogalil_ophyd.py index eea1174..ae7cff7 100644 --- a/csaxs_bec/devices/omny/galil/ogalil_ophyd.py +++ b/csaxs_bec/devices/omny/galil/ogalil_ophyd.py @@ -411,7 +411,7 @@ class OMNYGalilMotor(Device, PositionerBase): Args: direction (str): Direction in which the axis should be driven to the limit. Either 'forward' or 'reverse'. """ - self.controller.drive_axis_to_limit(self.axis_Id_numeric, direction) + self.controller.drive_axis_to_limit(self.axis_Id_numeric, direction, verbose=1) #now force position read to cache val = self.readback.read() self._run_subs(sub_type=self.SUB_READBACK, value=val, timestamp=time.time())