Skip to content
Snippets Groups Projects
Commit 382aa4d7 authored by Jan David Mol's avatar Jan David Mol
Browse files

Log more exceptions, fixed comment typo

parent bdfc4e73
No related branches found
No related tags found
1 merge request!16Generic code cleanup
...@@ -20,7 +20,7 @@ from tango.server import device_property ...@@ -20,7 +20,7 @@ from tango.server import device_property
from clients.opcua_connection import OPCUAConnection from clients.opcua_connection import OPCUAConnection
from util.attribute_wrapper import * from util.attribute_wrapper import *
from util.hardware_device 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"] __all__ = ["PCC", "main"]
...@@ -103,7 +103,7 @@ class PCC(hardware_device): ...@@ -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) 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): def delete_device(self):
"""Hook to delete resources allocated in init_device. """Hook to delete resources allocated in init_device.
...@@ -118,12 +118,14 @@ class PCC(hardware_device): ...@@ -118,12 +118,14 @@ class PCC(hardware_device):
# -------- # --------
# overloaded functions # overloaded functions
# -------- # --------
@log_exceptions()
def off(self): def off(self):
""" user code here. is called when the state is set to OFF """ """ user code here. is called when the state is set to OFF """
# Stop keep-alive # Stop keep-alive
self.OPCua_client.disconnect() self.OPCua_client.disconnect()
@log_exceptions()
def initialise(self): def initialise(self):
""" user code here. is called when the state is set to INIT """ """ user code here. is called when the state is set to INIT """
......
...@@ -19,7 +19,7 @@ from tango.server import device_property ...@@ -19,7 +19,7 @@ from tango.server import device_property
from clients.opcua_connection import OPCUAConnection from clients.opcua_connection import OPCUAConnection
from util.attribute_wrapper import * from util.attribute_wrapper import *
from util.hardware_device 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"] __all__ = ["SDP", "main"]
...@@ -79,6 +79,7 @@ class SDP(hardware_device): ...@@ -79,6 +79,7 @@ class SDP(hardware_device):
"""Method always executed before any TANGO command is executed.""" """Method always executed before any TANGO command is executed."""
pass pass
@log_exceptions()
def delete_device(self): def delete_device(self):
"""Hook to delete resources allocated in init_device. """Hook to delete resources allocated in init_device.
...@@ -94,15 +95,17 @@ class SDP(hardware_device): ...@@ -94,15 +95,17 @@ class SDP(hardware_device):
# -------- # --------
# overloaded functions # overloaded functions
# -------- # --------
@log_exceptions()
def off(self): def off(self):
""" user code here. is called when the state is set to OFF """ """ user code here. is called when the state is set to OFF """
# Stop keep-alive # Stop keep-alive
self.opcua_connection.stop() self.opcua_connection.stop()
@log_exceptions()
def initialise(self): def initialise(self):
""" user code here. is called when the sate is set to INIT """ """ 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 # 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) 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)
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment