diff --git a/tangostationcontrol/integration_test/default/devices/test_device_temperature_manager.py b/tangostationcontrol/integration_test/default/devices/test_device_temperature_manager.py index fa0ddeec17f9198fa28e2f30914fa58997afe9ab..0d695a028354afbd8d03de98235cef66ed82181d 100644 --- a/tangostationcontrol/integration_test/default/devices/test_device_temperature_manager.py +++ b/tangostationcontrol/integration_test/default/devices/test_device_temperature_manager.py @@ -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()) diff --git a/tangostationcontrol/tangostationcontrol/devices/base_device_classes/lofar_device.py b/tangostationcontrol/tangostationcontrol/devices/base_device_classes/lofar_device.py index bb851e9e1a961c1f1c0cce4bf644b4d34f0427fb..3ac5a47d52aefb9b6211707cdc8b5f0c7cf20138 100644 --- a/tangostationcontrol/tangostationcontrol/devices/base_device_classes/lofar_device.py +++ b/tangostationcontrol/tangostationcontrol/devices/base_device_classes/lofar_device.py @@ -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() diff --git a/tangostationcontrol/test/devices/base_device_classes/test_lofar_device.py b/tangostationcontrol/test/devices/base_device_classes/test_lofar_device.py index fd972fc7af5ab4196d90cc33d1235e95553fcb25..047c565c3c21bcb1af83f42db5569f4bfa19ba6a 100644 --- a/tangostationcontrol/test/devices/base_device_classes/test_lofar_device.py +++ b/tangostationcontrol/test/devices/base_device_classes/test_lofar_device.py @@ -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()