From fe8067e7c7b43b21fdf700f7630b1f916a2dac30 Mon Sep 17 00:00:00 2001 From: stedif <stefano.difrischia@inaf.it> Date: Fri, 3 Mar 2023 10:57:59 +0100 Subject: [PATCH] L2SS-1200: fix integration test --- .../tangostationcontrol/devices/antennafield.py | 16 +++++++++++++++- 1 file changed, 15 insertions(+), 1 deletion(-) diff --git a/tangostationcontrol/tangostationcontrol/devices/antennafield.py b/tangostationcontrol/tangostationcontrol/devices/antennafield.py index a01b9b637..d1c410321 100644 --- a/tangostationcontrol/tangostationcontrol/devices/antennafield.py +++ b/tangostationcontrol/tangostationcontrol/devices/antennafield.py @@ -623,7 +623,7 @@ class AntennaField(LOFARDevice): ) RCU_PCB_version_R = MappedAttribute( "RCU_PCB_version_R", - dtype=((bool,),), + dtype=((str,),), max_dim_x=2, max_dim_y=MAX_ANTENNA, ) @@ -1614,6 +1614,8 @@ class AntennaToRecvMapper(object): "RCU_DTH_freq_R": (MAX_ANTENNA,), "RCU_DTH_freq_RW": (MAX_ANTENNA,), "RCU_DTH_on_R": (MAX_ANTENNA,), + "RCU_PCB_ID_R": (MAX_ANTENNA,), + "RCU_PCB_version_R": (MAX_ANTENNA,), } self._reshape_attributes_out = { "ANT_mask_RW": (N_rcu, N_rcu_inp), @@ -1631,6 +1633,13 @@ class AntennaToRecvMapper(object): "RCU_PCB_version_R": (N_rcu,), } + # Attributes which need to be reshaped with a copy of their values, + # because RECV original dimension < AntennaField mapped dimension + self._fill_attributes_in = { + "RCU_PCB_ID_R": N_rcu_inp, + "RCU_PCB_version_R": N_rcu_inp, + } + def map_read(self, mapped_attribute: str, recv_results: List[any]) -> List[any]: """Perform a mapped read for the attribute using the recv_results @@ -1643,6 +1652,11 @@ class AntennaToRecvMapper(object): default_values = self._default_value_mapping_read[mapped_attribute] + if mapped_attribute in self._fill_attributes_in: + recv_results = [ + [x] * self._fill_attributes_in[mapped_attribute] for x in recv_results + ] + if mapped_attribute in self._reshape_attributes_in: recv_results = numpy.reshape( recv_results, -- GitLab