From 37f430c81cd8e03680c129ca15b07c9c801ce21e Mon Sep 17 00:00:00 2001 From: Jan David Mol <mol@astron.nl> Date: Fri, 4 Dec 2020 10:58:58 +0100 Subject: [PATCH] Match latest PCC OPC-UA interface --- RCUSCC/RCUSCC/RCUSCC.py | 29 +++++++++++++++++++++++++---- 1 file changed, 25 insertions(+), 4 deletions(-) diff --git a/RCUSCC/RCUSCC/RCUSCC.py b/RCUSCC/RCUSCC/RCUSCC.py index 43e47d8a8..c90fdec64 100644 --- a/RCUSCC/RCUSCC/RCUSCC.py +++ b/RCUSCC/RCUSCC/RCUSCC.py @@ -203,6 +203,11 @@ class RCUSCC(Device): access=AttrWriteType.READ_WRITE, ) + ADC_JESD_R = attribute( + dtype=(('DevDouble',),), + max_dim_x=32, max_dim_y=3, + ) + CLK_PLL_locked_R = attribute( dtype='DevLong64', ) @@ -219,13 +224,13 @@ class RCUSCC(Device): # ) LED_R = attribute( - dtype=(('DevLong64',),), - max_dim_x=32, max_dim_y=3, + dtype=('DevLong64',), + max_dim_x=32, ) LED_RW = attribute( - dtype=(('DevLong64',),), - max_dim_x=32, max_dim_y=3, + dtype=('DevLong64',), + max_dim_x=32, access=AttrWriteType.READ_WRITE, ) @@ -285,6 +290,12 @@ class RCUSCC(Device): # Modify as soon as we have a real multi-dimensional array self.attribute_mapping["Band_RW"] = (self.get_pcc_node("RCUs_Band1_RW"), self.get_pcc_node("RCUs_Band2_RW"), self.get_pcc_node("RCUs_Band3_RW")) + # 2020-11-27, thomas + # TODO + # Modify as soon as we have a real multi-dimensional array + self.attribute_mapping["ADC_JESD_R"] = (self.get_pcc_node("RCUs_ADC1_JESD_R"), self.get_pcc_node("RCUs_ADC2_JESD_R"), self.get_pcc_node("RCUs_ADC3_JESD_R")) + + self.attribute_mapping["CLK_PLL_locked_R"] = self.get_pcc_node("CLK_PLL_locked_R") # self.attribute_mapping["Dither_Frequency_R"] = self.get_pcc_node("RCUs_Dither_Frequency_R") @@ -333,6 +344,9 @@ class RCUSCC(Device): self._Band_RW = ((0,),) self.attribute_mapping["Band_RW"] = {} + self._ADC_JESD_R = ((0,),) + self.attribute_mapping["ADC_JESD_R"] = {} + self._Dither_Frequency_R = ((0.0,),) self.attribute_mapping["Dither_Frequency_R"] = {} @@ -441,6 +455,13 @@ class RCUSCC(Device): self.attribute_mapping["Band_RW"][2].set_value(value[2]) self._Band_RW = value + @only_when_on + @fault_on_opcua_error + def read_ADC_JESD_R(self): + """Return the Band_R attribute.""" + self._ADC_JESD_R = numpy.array([self.attribute_mapping["ADC_JESD_R"][0].get_value(), self.attribute_mapping["ADC_JESD_R"][1].get_value(), self.attribute_mapping["ADC_JESD_R"][2].get_value()]) + return self._ADC_JESD_R + @only_when_on @fault_on_opcua_error def read_Dither_Frequency_R(self): -- GitLab