diff --git a/devices/HW_device_template.py b/devices/examples/HW_device_template.py similarity index 100% rename from devices/HW_device_template.py rename to devices/examples/HW_device_template.py diff --git a/devices/util/hardware_device.py b/devices/util/hardware_device.py index 9933c1cb8606fa14804a633e7860ee830938b5af..ce6a9797daef957261f091a20ce25dea4e7c626c 100644 --- a/devices/util/hardware_device.py +++ b/devices/util/hardware_device.py @@ -22,7 +22,7 @@ from util.lofar_logging import log_exceptions __all__ = ["hardware_device"] -from util.wrappers import only_in_states +from util.wrappers import only_in_states, fault_on_error class hardware_device(Device): @@ -76,6 +76,8 @@ class hardware_device(Device): @command() @only_in_states([DevState.FAULT, DevState.OFF]) @DebugIt() + @fault_on_error + @log_exceptions() def Initialise(self): """ Command to ask for initialisation of this device. Can only be called in FAULT or OFF state. @@ -102,6 +104,8 @@ class hardware_device(Device): @command() @only_in_states([DevState.STANDBY]) @DebugIt() + @fault_on_error + @log_exceptions() def On(self): """ Command to ask for initialisation of this device. Can only be called in FAULT or OFF state. @@ -113,6 +117,7 @@ class hardware_device(Device): @command() @DebugIt() + @log_exceptions() def Off(self): """ Command to ask for shutdown of this device. @@ -134,6 +139,7 @@ class hardware_device(Device): @command() @only_in_states([DevState.ON, DevState.INIT, DevState.STANDBY]) @DebugIt() + @log_exceptions() def Fault(self): """ FAULT state is used to indicate our connection with the OPC-UA server is down.