diff --git a/tangostationcontrol/tangostationcontrol/devices/beam.py b/tangostationcontrol/tangostationcontrol/devices/beam.py index 18d62f0a5aa9ec863f38b1cb6bbef61d64f35fdb..dc45505f35d7892802e777c8a9e0f1b57dbb75e0 100644 --- a/tangostationcontrol/tangostationcontrol/devices/beam.py +++ b/tangostationcontrol/tangostationcontrol/devices/beam.py @@ -136,8 +136,8 @@ 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.RCU_mask_RW - for tile in range(32): + mask = self.recv_proxy.Ant_mask_RW.flatten() + for rcu in range(96): if mask[tile]: self._hbat_pointing_direction[tile] = pointing_direction[tile] self._hbat_pointing_timestamp[tile] = timestamp diff --git a/tangostationcontrol/tangostationcontrol/test/devices/test_beam_device.py b/tangostationcontrol/tangostationcontrol/test/devices/test_beam_device.py index bb89efc7a579cbb74182401c884713db4e32a116..06a6d858114b30a1dc1f1f6ba7314aadf1a2c5c3 100644 --- a/tangostationcontrol/tangostationcontrol/test/devices/test_beam_device.py +++ b/tangostationcontrol/tangostationcontrol/test/devices/test_beam_device.py @@ -10,7 +10,7 @@ from tango import DevState from tango.test_context import DeviceTestContext -from tangostationcontrol.devices import beam +from tangostationcontrol.devices import beam, lofar_device import numpy import mock @@ -23,21 +23,13 @@ class TestBeamDevice(base.TestCase): def setUp(self): super(TestBeamDevice, self).setUp() - # lofar_device init_device will launch a DeviceProxy not captured by - # the TestDeviceContext making it fail. - - # Patch init_device and force match spec - init_patcher = mock.patch.object( - beam.Beam, 'init_device', spec=beam.Beam.init_device) - self.m_init = init_patcher.start() - self.addCleanup(init_patcher.stop) - # Patch DeviceProxy to allow making the proxies during initialisation # that we otherwise avoid using - proxy_patcher = mock.patch.object( - beam, 'DeviceProxy') - self.m_init = proxy_patcher.start() - self.addCleanup(proxy_patcher.stop) + for device in [beam, lofar_device]: + proxy_patcher = mock.patch.object( + device, 'DeviceProxy') + proxy_patcher.start() + self.addCleanup(proxy_patcher.stop) def test_get_pointing_directions(self): """Verify can read pointings attribute and length matches without err"""