From 29d0f5a2466efabb1e891de16bca01a50b9f0184 Mon Sep 17 00:00:00 2001 From: Jan David Mol <mol@astron.nl> Date: Mon, 28 Feb 2022 13:26:45 +0100 Subject: [PATCH] L2SS-664: Make timeouts to run commands on hardware parameterised as properties --- .../tangostationcontrol/devices/apsct.py | 13 +++++++++-- .../tangostationcontrol/devices/recv.py | 22 ++++++++++++++++--- .../tangostationcontrol/devices/unb2.py | 13 +++++++++-- 3 files changed, 41 insertions(+), 7 deletions(-) diff --git a/tangostationcontrol/tangostationcontrol/devices/apsct.py b/tangostationcontrol/tangostationcontrol/devices/apsct.py index 6a3ef5ff8..d26c21dfe 100644 --- a/tangostationcontrol/tangostationcontrol/devices/apsct.py +++ b/tangostationcontrol/tangostationcontrol/devices/apsct.py @@ -42,6 +42,15 @@ class APSCT(opcua_device): default_value=1 ) + # ----- Timing values + + APSCT_On_Off_timeout = device_property( + doc='Maximum amount of time to wait after turning APSCT on or off', + dtype='DevFloat', + mandatory=False, + default_value=10.0 + ) + # ---------- # Attributes # ---------- @@ -113,9 +122,9 @@ class APSCT(opcua_device): # Cycle clock self.APSCT_off() - self.wait_attribute("APSCTTR_translator_busy_R", False, 10) + self.wait_attribute("APSCTTR_translator_busy_R", False, self.APSCT_On_Off_timeout) self.APSCT_200MHz_on() - self.wait_attribute("APSCTTR_translator_busy_R", False, 10) + self.wait_attribute("APSCTTR_translator_busy_R", False, self.APSCT_On_Off_timeout) if not self.proxy.APSCT_PLL_200MHz_locked_R: if self.proxy.APSCTTR_I2C_error_R: diff --git a/tangostationcontrol/tangostationcontrol/devices/recv.py b/tangostationcontrol/tangostationcontrol/devices/recv.py index 78dbece6b..2eb1de134 100644 --- a/tangostationcontrol/tangostationcontrol/devices/recv.py +++ b/tangostationcontrol/tangostationcontrol/devices/recv.py @@ -79,6 +79,22 @@ class RECV(opcua_device): 'RCU_mask_RW' ] + # ----- Timing values + + RCU_On_Off_timeout = device_property( + doc='Maximum amount of time to wait after turning RCU(s) on or off', + dtype='DevFloat', + mandatory=False, + default_value=10.0 + ) + + RCU_DTH_On_Off_timeout = device_property( + doc='Maximum amount of time to wait after turning dithering on or off', + dtype='DevFloat', + mandatory=False, + default_value=10.0 + ) + # ----- Calibration values HBAT_bf_delay_step_delays = device_property( @@ -374,13 +390,13 @@ class RECV(opcua_device): # Cycle RCUs self.RCU_off() - self.wait_attribute("RECVTR_translator_busy_R", False, 5) + self.wait_attribute("RECVTR_translator_busy_R", False, self.RCU_On_Off_timeout) self.RCU_on() - self.wait_attribute("RECVTR_translator_busy_R", False, 5) + self.wait_attribute("RECVTR_translator_busy_R", False, self.RCU_On_Off_timeout) # Turn off DTH by default self.RCU_DTH_off() - self.wait_attribute("RECVTR_translator_busy_R", False, 5) + self.wait_attribute("RECVTR_translator_busy_R", False, self.RCU_DTH_On_Off_timeout) # ---------- # Run server diff --git a/tangostationcontrol/tangostationcontrol/devices/unb2.py b/tangostationcontrol/tangostationcontrol/devices/unb2.py index 0b2d5c482..48b5c3147 100644 --- a/tangostationcontrol/tangostationcontrol/devices/unb2.py +++ b/tangostationcontrol/tangostationcontrol/devices/unb2.py @@ -44,6 +44,15 @@ class UNB2(opcua_device): default_value=1 ) + # ----- Timing values + + UNB2_On_Off_timeout = device_property( + doc='Maximum amount of time to wait after turning Uniboard(s) on or off', + dtype='DevFloat', + mandatory=False, + default_value=10.0 + ) + # ---------- # Attributes # ---------- @@ -217,9 +226,9 @@ class UNB2(opcua_device): # Cycle UNB2s self.UNB2_off() - self.wait_attribute("UNB2TR_translator_busy_R", False, 5) + self.wait_attribute("UNB2TR_translator_busy_R", False, self.UNB2_On_Off_timeout) self.UNB2_on() - self.wait_attribute("UNB2TR_translator_busy_R", False, 5) + self.wait_attribute("UNB2TR_translator_busy_R", False, self.UNB2_On_Off_timeout) # ---------- # Run server -- GitLab