Skip to content
Snippets Groups Projects
Commit 42560a4a authored by Stefano Di Frischia's avatar Stefano Di Frischia
Browse files

L2SS-827: bug fixes

parent d1002a43
No related branches found
No related tags found
1 merge request!389Resolve L2SS-827 "Implement antenna state"
......@@ -6,12 +6,15 @@
""" AntennaField Device Server for LOFAR2.0
"""
from tango import DeviceProxy, DevSource, AttrWriteType, DevVarFloatArray, DevVarLongArray
from tango.server import device_property, attribute, command
from enum import IntEnum
import numpy
from math import pi
import numpy
# PyTango imports
from tango import DeviceProxy, DevSource, AttrWriteType, DevVarFloatArray, DevVarLongArray
from tango.server import device_property, attribute, command
# Additional import
from tangostationcontrol.common.entrypoint import entry
from tangostationcontrol.devices.lofar_device import lofar_device
from tangostationcontrol.common.lofar_logging import device_logging_to_python, log_exceptions
......
......@@ -7,12 +7,12 @@
# Distributed under the terms of the APACHE license.
# See LICENSE.txt for more info.
import numpy
from tangostationcontrol.integration_test.device_proxy import TestDeviceProxy
from tangostationcontrol.devices.antennafield import AntennaQuality, AntennaUse
from .base import AbstractTestBases
import numpy
class TestAntennaFieldDevice(AbstractTestBases.TestDeviceBase):
def setUp(self):
......@@ -20,7 +20,6 @@ class TestAntennaFieldDevice(AbstractTestBases.TestDeviceBase):
self.proxy.put_property({"RECV_devices": ["STAT/RECV/1"],
"HBAT_Power_to_RECV_mapping": [1, 1, 1, 0] + [-1] * 92})
self.recv_proxy = self.setup_recv_proxy()
return self.proxy
def setup_recv_proxy(self):
# setup RECV
......@@ -37,7 +36,7 @@ class TestAntennaFieldDevice(AbstractTestBases.TestDeviceBase):
def test_HBAT_ANT_mask_RW_configured_after_Antenna_Usage_Mask(self):
""" Verify if HBAT_ANT_mask_RW values are correctly configured from Antenna_Usage_Mask values """
recv_proxy = self.setup_recv_proxy()
antennafield_proxy = self.setUp()
antennafield_proxy = self.proxy
numpy.testing.assert_equal(numpy.array([True] * 96), recv_proxy.ANT_mask_RW)
antenna_qualities = numpy.array([AntennaQuality.OK] * 96)
......@@ -57,7 +56,7 @@ class TestAntennaFieldDevice(AbstractTestBases.TestDeviceBase):
def test_HBAT_ANT_mask_RW_configured_after_Antenna_Usage_Mask_only_one_functioning_antenna(self):
""" Verify if HBAT_ANT_mask_RW values are correctly configured from Antenna_Usage_Mask values (only second antenna is OK)"""
recv_proxy = self.setup_recv_proxy()
antennafield_proxy = self.setUp()
antennafield_proxy = self.proxy
antenna_qualities = numpy.array([AntennaQuality.BROKEN] + [AntennaQuality.OK] + [AntennaQuality.BROKEN] * 94)
antenna_use = numpy.array([AntennaUse.AUTO] * 96)
antenna_properties = {'Antenna_Quality': antenna_qualities, 'Antenna_Use': antenna_use}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment