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

Merge branch 'remove-disable-state' into 'master'

L2AIV-178: Remove DISABLE and ALARM states

See merge request !873
parents 2cdd40f0 ea619041
No related branches found
No related tags found
1 merge request!873L2AIV-178: Remove DISABLE and ALARM states
......@@ -115,7 +115,3 @@ class TestDeviceTemperatureManager(AbstractTestBases.TestDeviceBase):
# the TEMP_MANAGER_is_alarming_R should now be True,
# since it should have detected the temperature alarm.
self.assertTrue(self.proxy.is_alarming_R)
# make sure all the hardware devices are in the DISABLE state
for dev in devices:
self.assertEqual(DevState.DISABLE, dev.state())
......@@ -159,9 +159,7 @@ class LOFARDevice(Device):
INIT = Device is initialising.
STANDBY = Device is initialised, but pends external configuration and an explicit turning on,
ON = Device is fully configured, functional, controls the hardware, and is possibly actively running,
ALARM = Device is operating but one of its attributes is out of range,
FAULT = Device detected an unrecoverable error, and is thus malfunctional,
DISABLE = Device has shut down all its dependant hardware
OFF = Device is turned off, drops connection to the hardware,
The following state transitions are implemented:
......@@ -169,10 +167,6 @@ class LOFARDevice(Device):
OFF -> INIT: Triggered by device. Device will initialise (connect to hardware, other devices),
INIT -> STANDBY: Triggered by device. Device is initialised, and is ready for additional configuration by the user,
STANDBY -> ON: Triggered by user. Device reports to be functional,
STANDBY -> DISABLE: Triggered by user. Device has shut down its hardware. Triggered by the power_hardware_off() command,
ON -> DISABLE: Triggered by user. Device has shut down its hardware. Triggered by the power_hardware_off() command,
ALARM -> DISABLE: Triggered by user. Device has shut down its hardware. Triggered by the power_hardware_off() command,
ON -> ALARM: Triggered by tango. Device has attribute(s) with value(s) exceeding their alarm treshold,
* -> FAULT: Triggered by device. Device has degraded to malfunctional, for example because the connection to the hardware is lost,
* -> FAULT: Triggered by user. Emulate a forced malfunction for integration testing purposes,
* -> OFF: Triggered by user. Device is turned off. Triggered by the Off() command,
......@@ -677,7 +671,6 @@ class LOFARDevice(Device):
def power_hardware_on(self):
"""Power the hardware related to the device."""
# This is just the command version of _prepare_hardware().
self._power_hardware_on()
@command()
......@@ -686,19 +679,8 @@ class LOFARDevice(Device):
def power_hardware_off(self):
"""Disable the hardware related to the device."""
if self.get_state() == DevState.DISABLE:
# Already disabled.
logger.warning(
"Requested to go to DISABLE state, but am already in DISABLE state."
)
return
self._power_hardware_off()
# Set state to DISABLE
self.set_state(DevState.DISABLE)
self.set_status("Device is in the DISABLE state.")
@command()
@debugit()
@log_exceptions()
......
......@@ -8,7 +8,6 @@ import numpy
from tango import AttrWriteType
from tango import DevFailed
from tango import DevSource
from tango import DevState
from tango import DevVarBooleanArray
from tango.server import attribute
from tango.server import command
......@@ -172,15 +171,6 @@ class TestLofarDevice(device_base.DeviceTestCase):
# call from poll_attributes, but that's what we're testing so it's ok.
self.assertGreaterEqual(proxy.A_read_counter, 1)
def test_disable_state(self):
with DeviceTestContext(self.test_device, process=False, timeout=10) as proxy:
proxy.initialise()
self.assertEqual(DevState.STANDBY, proxy.state())
proxy.on()
self.assertEqual(DevState.ON, proxy.state())
proxy.power_hardware_off()
self.assertEqual(DevState.DISABLE, proxy.state())
def test_disable_state_transitions(self):
with DeviceTestContext(self.test_device, process=False, timeout=10) as proxy:
proxy.off()
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment