diff --git a/devices/PCC.py b/devices/PCC.py index 764be89ade56abf035498d9874cdf36b0df24d5e..e2d3383f398414ea87cf375e6e258125869b3278 100644 --- a/devices/PCC.py +++ b/devices/PCC.py @@ -20,7 +20,7 @@ from tango.server import device_property from clients.opcua_connection import OPCUAConnection from util.attribute_wrapper import * from util.hardware_device import * -from util.lofar_logging import device_logging_to_python +from util.lofar_logging import device_logging_to_python, log_exceptions __all__ = ["PCC", "main"] @@ -103,7 +103,7 @@ class PCC(hardware_device): RCU_monitor_rate_RW = attribute_wrapper(comms_annotation=["2:PCC", "2:RCU_monitor_rate_RW"], datatype=numpy.float64, access=AttrWriteType.READ_WRITE) - + @log_exceptions() def delete_device(self): """Hook to delete resources allocated in init_device. @@ -118,12 +118,14 @@ class PCC(hardware_device): # -------- # overloaded functions # -------- + @log_exceptions() def off(self): """ user code here. is called when the state is set to OFF """ # Stop keep-alive self.OPCua_client.disconnect() + @log_exceptions() def initialise(self): """ user code here. is called when the state is set to INIT """ diff --git a/devices/SDP.py b/devices/SDP.py index 30672a7ebf5047edc6560db3a621cb7d2033b973..7417e0f1537bfbd59f1d90ecf8819a4624d1b6fc 100644 --- a/devices/SDP.py +++ b/devices/SDP.py @@ -19,7 +19,7 @@ from tango.server import device_property from clients.opcua_connection import OPCUAConnection from util.attribute_wrapper import * from util.hardware_device import * -from util.lofar_logging import device_logging_to_python +from util.lofar_logging import device_logging_to_python, log_exceptions __all__ = ["SDP", "main"] @@ -79,6 +79,7 @@ class SDP(hardware_device): """Method always executed before any TANGO command is executed.""" pass + @log_exceptions() def delete_device(self): """Hook to delete resources allocated in init_device. @@ -94,15 +95,17 @@ class SDP(hardware_device): # -------- # overloaded functions # -------- + @log_exceptions() def off(self): """ user code here. is called when the state is set to OFF """ # Stop keep-alive self.opcua_connection.stop() + @log_exceptions() def initialise(self): """ user code here. is called when the sate is set to INIT """ - """Initialises the attributes and properties of the PCC.""" + """Initialises the attributes and properties of the SDP.""" # set up the OPC ua client self.OPCua_client = OPCUAConnection("opc.tcp://{}:{}/".format(self.OPC_Server_Name, self.OPC_Server_Port), "http://lofar.eu", self.OPC_Time_Out, self.Standby, self.Fault, self)