From d6f88b599aa8f729ad28e08ea230c993df0a0cf7 Mon Sep 17 00:00:00 2001 From: Holler Mirko Date: Mon, 6 May 2024 14:39:40 +0200 Subject: [PATCH] improve show all --- csaxs_bec/devices/galil/galil_ophyd.py | 33 ++++++++++++++++++++++++++ 1 file changed, 33 insertions(+) diff --git a/csaxs_bec/devices/galil/galil_ophyd.py b/csaxs_bec/devices/galil/galil_ophyd.py index dea8ce6..8ed556c 100644 --- a/csaxs_bec/devices/galil/galil_ophyd.py +++ b/csaxs_bec/devices/galil/galil_ophyd.py @@ -118,6 +118,9 @@ class GalilController(Controller): rt_not_blocked_by_galil = bool(self.socket_put_and_receive(f"MG@OUT[9]")) air_off = bool(self.socket_put_and_receive(f"MG@OUT[13]")) return rt_not_blocked_by_galil and air_off + + def get_digital_input(self,channel): + return bool(float(self.socket_put_and_receive(f"MG @IN[{channel}]").strip())) def axis_is_referenced(self, axis_Id_numeric) -> bool: return bool(float(self.socket_put_and_receive(f"MG axisref[{axis_Id_numeric}]").strip())) @@ -243,12 +246,42 @@ class GalilController(Controller): print(t) self.show_running_threads() + self.show_status_other() + + def show_status_other(self): + #Todo: move to lgalil specific section + if(self.get_digital_input(5)): + print("Emergency stop is not pushed.") + else: + print("Emergency stop is pushed.") + if(self.get_digital_input(6)): + print("Driver axis 2 error.") + if(self.get_digital_input(13)): + print("No air pressure at inner rotation.") + else: + print("There is air pressure at the inner rotation.") + if(self.get_digital_input(14)): + print("No air pressure at outer rotation axial.") + else: + print("There is air pressure at the outer rotation axial.") + if(self.get_digital_input(15)): + print("No air pressure at outer rotation radial.") + else: + print("There is air pressure at the outer rotation radial.") + swver = float(self.socket_put_and_receive("MGswver")) + print(f"Lgalil LAMNI firmware version {swver:2.0f}.") def galil_show_all(self) -> None: for controller in self._controller_instances.values(): if isinstance(controller, GalilController): controller.describe() + def lamni_lights_off(self): + self.socket_put_confirmed("SB1") + + def lamni_lights_on(self): + self.socket_put_confirmed("CB1") + @staticmethod def axis_Id_to_numeric(axis_Id: str) -> int: return ord(axis_Id.lower()) - 97