diff --git a/tangostationcontrol/tangostationcontrol/devices/beam.py b/tangostationcontrol/tangostationcontrol/devices/beam.py index b6798a2512b051127b07df29d0d719b14c310666..3709bc5602dda655892b6d318e59c2eef77de716 100644 --- a/tangostationcontrol/tangostationcontrol/devices/beam.py +++ b/tangostationcontrol/tangostationcontrol/devices/beam.py @@ -189,7 +189,7 @@ class Beam(lofar_device): # Record where we now point to, now that we've updated the weights. # Only the entries within the mask have been updated - mask = self.recv_proxy.Ant_mask_RW.flatten() + mask = self.recv_proxy.ANT_mask_RW.flatten() for rcu in range(96): if mask[rcu]: self._hbat_pointing_direction_r[rcu] = pointing_direction[rcu] diff --git a/tangostationcontrol/tangostationcontrol/integration_test/default/devices/base.py b/tangostationcontrol/tangostationcontrol/integration_test/default/devices/base.py index 33759f21686b3af3d0fd68c2c46345eae455afe6..7a2609e811432a8c772a239186e16f2f442ba7a3 100644 --- a/tangostationcontrol/tangostationcontrol/integration_test/default/devices/base.py +++ b/tangostationcontrol/tangostationcontrol/integration_test/default/devices/base.py @@ -61,13 +61,20 @@ class AbstractTestBases: self.self.assertListEqual([], self.proxy.opcua_missing_attributes_R) def test_device_on(self): - """Test if we can transition to on""" + """Test if we can transition off -> standby -> on""" self.proxy.initialise() self.proxy.on() self.assertEqual(DevState.ON, self.proxy.state()) + def test_device_warm_boot(self): + """Test if we can transition off -> on using a warm boot""" + + self.proxy.warm_boot() + + self.assertEqual(DevState.ON, self.proxy.state()) + def test_device_read_all_attributes(self): """Test if we can read all of the exposed attributes in the ON state. diff --git a/tangostationcontrol/tangostationcontrol/integration_test/default/devices/test_device_beam.py b/tangostationcontrol/tangostationcontrol/integration_test/default/devices/test_device_beam.py index 2d2c5205c0be7f0c2f0f2b8d98fd963b8936909d..f529c5472364c0af9a2f3ea960eb9648419e792f 100644 --- a/tangostationcontrol/tangostationcontrol/integration_test/default/devices/test_device_beam.py +++ b/tangostationcontrol/tangostationcontrol/integration_test/default/devices/test_device_beam.py @@ -36,11 +36,8 @@ class TestDeviceBeam(AbstractTestBases.TestDeviceBase): # setup RECV recv_proxy = TestDeviceProxy("STAT/RECV/1") recv_proxy.off() - recv_proxy.initialise() - self.assertEqual(DevState.STANDBY, recv_proxy.state()) + recv_proxy.warm_boot() recv_proxy.set_defaults() - recv_proxy.on() - self.assertEqual(DevState.ON, recv_proxy.state()) return recv_proxy def test_HBAT_delays_dims(self): @@ -48,12 +45,7 @@ class TestDeviceBeam(AbstractTestBases.TestDeviceBase): self.setup_recv_proxy() # setup BEAM - self.proxy.init() - self.proxy.Initialise() - self.assertEqual(DevState.STANDBY, self.proxy.state()) - self.proxy.set_defaults() - self.proxy.on() - self.assertEqual(DevState.ON, self.proxy.state()) + self.proxy.warm_boot() # verify HBAT_delays method returns the correct dimensions HBAT_delays = self.proxy.HBAT_delays(self.pointing_direction) @@ -64,13 +56,8 @@ class TestDeviceBeam(AbstractTestBases.TestDeviceBase): recv_proxy = self.setup_recv_proxy() # setup BEAM - self.proxy.init() - self.proxy.Initialise() - self.assertEqual(DevState.STANDBY, self.proxy.state()) - self.proxy.set_defaults() + self.proxy.warm_boot() self.proxy.HBAT_tracking_enabled_RW = False - self.proxy.on() - self.assertEqual(DevState.ON, self.proxy.state()) # Verify attribute is present (all zeros if never used before) HBAT_delays_r1 = numpy.array(recv_proxy.read_attribute('HBAT_BF_delay_steps_RW').value) @@ -90,9 +77,8 @@ class TestDeviceBeam(AbstractTestBases.TestDeviceBase): # setup RECV as well recv_proxy = self.setup_recv_proxy() - self.proxy.initialise() + self.proxy.warm_boot() self.proxy.HBAT_tracking_enabled_RW = False - self.proxy.on() # Point to Zenith self.proxy.HBAT_set_pointing(numpy.array([["AZELGEO","0deg","90deg"]] * 96).flatten()) @@ -107,9 +93,8 @@ class TestDeviceBeam(AbstractTestBases.TestDeviceBase): # setup RECV as well recv_proxy = self.setup_recv_proxy() - self.proxy.initialise() + self.proxy.warm_boot() self.proxy.HBAT_tracking_enabled_RW = False - self.proxy.on() # point at north on the horizon self.proxy.HBAT_set_pointing(["AZELGEO","0deg","0deg"] * 96) @@ -135,9 +120,8 @@ class TestDeviceBeam(AbstractTestBases.TestDeviceBase): # setup RECV as well recv_proxy = self.setup_recv_proxy() - self.proxy.initialise() + self.proxy.warm_boot() self.proxy.HBAT_tracking_enabled_RW = False - self.proxy.on() # Point to LOFAR 1 ref pointing (0.929342, 0.952579, J2000) pointings = numpy.array([["J2000", "0.929342rad", "0.952579rad"]] * 96).flatten() @@ -167,8 +151,7 @@ class TestDeviceBeam(AbstractTestBases.TestDeviceBase): # setup RECV as well recv_proxy = self.setup_recv_proxy() - self.proxy.initialise() - self.proxy.on() + self.proxy.warm_boot() # check if we're really tracking self.assertTrue(self.proxy.HBAT_tracking_enabled_R) diff --git a/tangostationcontrol/tangostationcontrol/integration_test/default/devices/test_device_sdp.py b/tangostationcontrol/tangostationcontrol/integration_test/default/devices/test_device_sdp.py index 3a075e697c473c9800257b4796f21f7b79e5e430..570d8ce6cee1bc2f1ab833c9d93acdd11cc270f7 100644 --- a/tangostationcontrol/tangostationcontrol/integration_test/default/devices/test_device_sdp.py +++ b/tangostationcontrol/tangostationcontrol/integration_test/default/devices/test_device_sdp.py @@ -19,7 +19,6 @@ class TestDeviceSDP(AbstractTestBases.TestDeviceBase): def test_device_sdp_read_attribute(self): """Test if we can read an attribute obtained over OPC-UA""" - self.proxy.initialise() - self.proxy.on() + self.proxy.warm_boot() self.assertListEqual([True]*16, list(self.proxy.TR_fpga_communication_error_R)) diff --git a/tangostationcontrol/tangostationcontrol/integration_test/default/devices/test_device_sst.py b/tangostationcontrol/tangostationcontrol/integration_test/default/devices/test_device_sst.py index c6f75f565476087619cf3f72f86d9d33459497ac..2398206083533a5fcc40051b6a80e42923a38347 100644 --- a/tangostationcontrol/tangostationcontrol/integration_test/default/devices/test_device_sst.py +++ b/tangostationcontrol/tangostationcontrol/integration_test/default/devices/test_device_sst.py @@ -33,21 +33,14 @@ class TestDeviceSST(AbstractTestBases.TestDeviceBase): # setup SDP, on which this device depends sdp_proxy = TestDeviceProxy("STAT/SDP/1") sdp_proxy.off() - sdp_proxy.initialise() - self.assertEqual(DevState.STANDBY, sdp_proxy.state()) + sdp_proxy.warm_boot() sdp_proxy.set_defaults() - sdp_proxy.on() - self.assertEqual(DevState.ON, sdp_proxy.state()) return sdp_proxy def test_device_sst_send_udp(self): port_property = {"Statistics_Client_TCP_Port": "4998"} self.proxy.put_property(port_property) - self.proxy.initialise() - - self.assertEqual(DevState.STANDBY, self.proxy.state()) - - self.proxy.on() + self.proxy.warm_boot() self.assertEqual(DevState.ON, self.proxy.state()) @@ -62,13 +55,7 @@ class TestDeviceSST(AbstractTestBases.TestDeviceBase): def test_device_sst_connect_tcp_receive(self): port_property = {"Statistics_Client_TCP_Port": "5101"} self.proxy.put_property(port_property) - self.proxy.initialise() - - self.assertEqual(DevState.STANDBY, self.proxy.state()) - - self.proxy.on() - - self.assertEqual(DevState.ON, self.proxy.state()) + self.proxy.warm_boot() time.sleep(2) diff --git a/tangostationcontrol/tangostationcontrol/integration_test/default/devices/test_device_xst.py b/tangostationcontrol/tangostationcontrol/integration_test/default/devices/test_device_xst.py index a75a376e01504f3bcb9a095cedba610a1b79c051..dab2c7f2573f5c21ae375d8c2616085afc17fd7c 100644 --- a/tangostationcontrol/tangostationcontrol/integration_test/default/devices/test_device_xst.py +++ b/tangostationcontrol/tangostationcontrol/integration_test/default/devices/test_device_xst.py @@ -28,9 +28,6 @@ class TestDeviceSST(AbstractTestBases.TestDeviceBase): # setup SDP, on which this device depends sdp_proxy = TestDeviceProxy("STAT/SDP/1") sdp_proxy.off() - sdp_proxy.initialise() - self.assertEqual(DevState.STANDBY, sdp_proxy.state()) + sdp_proxy.warm_boot() sdp_proxy.set_defaults() - sdp_proxy.on() - self.assertEqual(DevState.ON, sdp_proxy.state()) return sdp_proxy