diff --git a/PCC/PCC/PCC.py b/PCC/PCC/PCC.py index 4d6271bfc533ea3fe1a1cd5524923125f1f63ddd..196c371cc53b922b958a46721701dbc226e73141 100644 --- a/PCC/PCC/PCC.py +++ b/PCC/PCC/PCC.py @@ -87,6 +87,10 @@ class PCC(Device): # Attributes # ---------- + RCU_state_R = attribute( + dtype = (numpy.str), + ) + RCU_mask_RW = attribute( dtype=(numpy.bool_,), max_dim_x=32, @@ -205,6 +209,16 @@ class PCC(Device): max_dim_x = 96, max_dim_y = 32, access=AttrWriteType.READ_WRITE, ) + HBA_element_pwr_R = attribute( + dtype=((numpy.int64,),), + max_dim_x = 96, max_dim_y = 32, + ) + + HBA_element_pwr_RW = attribute( + dtype=((numpy.int64,),), + max_dim_x = 96, max_dim_y = 32, + access=AttrWriteType.READ_WRITE, + ) uC_ID_R = attribute( dtype=(numpy.int64,), @@ -240,6 +254,8 @@ class PCC(Device): self.debug_stream("Mapping OPC-UA MP/CP to attributes...") + self.attribute_mapping["RCU_state_R"] = self.get_pcc_node("RCU_state_R") + self.attribute_mapping["RCU_mask_RW"] = self.get_pcc_node("RCU_mask_RW") self.attribute_mapping["Ant_mask_RW"] = self.get_pcc_node("Ant_mask_RW") @@ -284,6 +300,10 @@ class PCC(Device): self.attribute_mapping["HBA_element_led_RW"] = self.get_pcc_node("HBA_element_led_RW") + self.attribute_mapping["HBA_element_pwr_R"] = self.get_pcc_node("HBA_element_pwr_R") + + self.attribute_mapping["HBA_element_pwr_RW"] = self.get_pcc_node("HBA_element_pwr_RW") + self.attribute_mapping["uC_ID_R"] = self.get_pcc_node("uC_ID _R") self.attribute_mapping["RCU_monitor_rate_RW"] = self.get_pcc_node("RCU_monitor_rate_RW") @@ -317,6 +337,9 @@ class PCC(Device): # Set default values in the RW/R attributes and add them to # the mapping. + self._RCU_state_R = "" + self.attribute_mapping["RCU_state_R"] = {} + self._RCU_mask_RW = numpy.full(32, False) self.attribute_mapping["RCU_mask_RW"] = {} @@ -383,6 +406,12 @@ class PCC(Device): self._HBA_element_led_RW = numpy.full((32, 96), 0) self.attribute_mapping["HBA_element_led_RW"] = {} + self._HBA_element_pwr_R = numpy.full((32, 96), 0) + self.attribute_mapping["HBA_element_pwr_R"] = {} + + self._HBA_element_pwr_RW = numpy.full((32, 96), 0) + self.attribute_mapping["HBA_element_pwr_RW"] = {} + self._uC_ID_R = numpy.full(32, 0) self.attribute_mapping["uC_ID_R"] = {} @@ -453,6 +482,12 @@ class PCC(Device): # ------------------ # Attributes methods # ------------------ + @only_when_on + @fault_on_error + def read_RCU_state_R(self): + """Return the RCU_state_R attribute.""" + self._RCU_state_R = numpy.array(self.attribute_mapping["RCU_state_R"].get_value() + return self._RCU_state_R @only_when_on @fault_on_error @@ -679,6 +714,27 @@ class PCC(Device): self.attribute_mapping["HBA_element_led_RW"].set_value(value.flatten().tolist()) self._HBA_element_led_RW = value + @only_when_on + @fault_on_error + def read_HBA_element_pwr_R(self): + """Return the HBA_element_pwr_R attribute.""" + value = numpy.array(self.attribute_mapping["HBA_element_pwr_R"].get_value()) + self._HBA_element_pwr_R = numpy.array(numpy.split(value, indices_or_sections = 32)) + return self._HBA_element_pwr_R + + @only_when_on + @fault_on_error + def read_HBA_element_pwr_RW(self): + """Return the HBA_element_pwr_RW attribute.""" + return self._HBA_element_pwr_RW + + @only_when_on + @fault_on_error + def write_HBA_element_pwr_RW(self, value): + """Set the HBA_element_pwr_RW attribute.""" + self.attribute_mapping["HBA_element_pwr_RW"].set_value(value.flatten().tolist()) + self._HBA_element_pwr_RW = value + @only_when_on @fault_on_error def read_uC_ID_R(self):