diff --git a/SDP/SDP/SDP.py b/SDP/SDP/SDP.py index 3c5c7e209108fc1cdda6618b4efc3c9e77be1cfc..ee98bab36fa7cef38131f8c607bc46cbfeb652ac 100644 --- a/SDP/SDP/SDP.py +++ b/SDP/SDP/SDP.py @@ -131,20 +131,21 @@ class SDP(Device): access=AttrWriteType.READ_WRITE, ) - sdp_info_R = attribute( - dtype = (numpy.str,), + tr_busy_R = attribute( + dtype = (numpy.bool_), ) - sdp_tod_R = attribute( - dtype = (numpy.str,), + tr_reload_RW = attribute( + dtype = (numpy.bool_), + access=AttrWriteType.READ_WRITE, ) - translator_network_R = attribute( - dtype = (numpy.str,), + tr_tod_R = attribute( + dtype = (numpy.uint64), ) - translator_timing_R = attribute( - dtype = (numpy.str,), + tr_uptime_R = attribute( + dtype = (numpy.uint64,), ) @@ -184,10 +185,10 @@ class SDP(Device): self.attribute_mapping["fpga_version_R"] = self.get_node("fpga_version_R") self.attribute_mapping["fpga_weights_R"] = self.get_node("fpga_weights_R") self.attribute_mapping["fpga_weights_RW"] = self.get_node("fpga_weights_RW") - self.attribute_mapping["sdp_info_R"] = self.get_node("sdp_info") - self.attribute_mapping["sdp_tod_R"] = self.get_node("tod") - self.attribute_mapping["translator_network_R"] = self.get_node("translator_network") - self.attribute_mapping["translator_timing_R"] = self.get_node("translator_timing") + self.attribute_mapping["tr_busy_R"] = self.get_node("tr_busy_R") + self.attribute_mapping["tr_reload_RW"] = self.get_node("tr_reload_W") + self.attribute_mapping["tr_tod_R"] = self.get_node("tr_tod_R") + self.attribute_mapping["tr_uptime_R"] = self.get_node("tr_uptime_R") self.info_stream("Mapping OPC-UA MP/CP to attributes done.") @@ -225,14 +226,14 @@ class SDP(Device): self.attribute_mapping["fpga_weights_R"] = {} self._fpga_weights_RW = numpy.full((16, 2 * 488 * 12), 0) self.attribute_mapping["fpga_weights_RW"] = {} - self._sdp_info_R = "NOT_INITIALISED" - self.attribute_mapping["sdp_info_R"] = {} - self._tod_R = "NOT_INITIALISED" - self.attribute_mapping["sdp_tod_R"] = {} - self._translator_network_R = "NOT_INITIALISED" - self.attribute_mapping["translator_network_R"] = {} - self._translator_timing_R = "NOT_INITIALISED" - self.attribute_mapping["translator_timing_R"] = {} + self._tr_busy_R = False + self.attribute_mapping["tr_busy_R"] = {} + self._tr_reload_RW = False + self.attribute_mapping["tr_reload_RW"] = {} + self._tr_tod_R = 0 + self.attribute_mapping["tr_tod_R"] = {} + self._tr_uptime_R = 0 + self.attribute_mapping["tr_uptime_R"] = {} # Init the dict that contains function to OPC-UA function mappings. self.function_mapping = {} @@ -370,31 +371,38 @@ class SDP(Device): @only_when_on @fault_on_error - def read_sdp_info_R(self): - """Return the sdp_info_R attribute.""" - self._sdp_info_R = self.attribute_mapping["sdp_info_R"].get_value() - return self._sdp_info_R + def read_tr_busy_R(self): + """Return the tr_busy_R attribute.""" + self._tr_busy_R = self.attribute_mapping["tr_busy_R"].get_value() + return self._tr_busy_R + + @only_when_on + @fault_on_error + def read_tr_reload_RW(self): + """Return the tr_reload_RW attribute.""" + self._tr_reload_RW = self.attribute_mapping["tr_reload_RW"].get_value() + return self._tr_reload_RW @only_when_on @fault_on_error - def read_sdp_tod_R(self): - """Return the sdp_tod_R attribute.""" - self._sdp_tod_R = self.attribute_mapping["sdp_tod_R"].get_value() - return self._sdp_tod_R + def write_tr_reload_RW(self, value): + """Return the tr_reload_RW attribute.""" + self.attribute_mapping["tr_reload_RW"].set_value(value) + self._tr_reload_RW = value @only_when_on @fault_on_error - def read_translator_network_R(self): - """Return the _translator_network_R attribute.""" - self._translator_network_R = self.attribute_mapping["translator_network_R"].get_value() - return self._translator_network_R + def read_tr_tod_R(self): + """Return the _tr_tod_R attribute.""" + self._tr_tod_R = self.attribute_mapping["tr_tod_R"].get_value() + return self._tr_tod_R @only_when_on @fault_on_error - def read_translator_timing_R(self): - """Return the _translator_timing_R attribute.""" - self._translator_timing_R = self.attribute_mapping["translator_timing_R"].get_value() - return self._translator_timing_R + def read_tr_uptime_R(self): + """Return the _tr_uptime_R attribute.""" + self._tr_uptime_R = self.attribute_mapping["tr_uptime_R"].get_value() + return self._tr_uptime_R # --------