Skip to content
Snippets Groups Projects
Commit 2801567b authored by Thomas Juerges's avatar Thomas Juerges
Browse files

Update with new MPs/CPs

- tr_busy_R
- tr_reload_RW
- tr_tod_R
- tr_uptime_R
parent b264cfa2
No related branches found
No related tags found
No related merge requests found
...@@ -131,20 +131,21 @@ class SDP(Device): ...@@ -131,20 +131,21 @@ class SDP(Device):
access=AttrWriteType.READ_WRITE, access=AttrWriteType.READ_WRITE,
) )
sdp_info_R = attribute( tr_busy_R = attribute(
dtype = (numpy.str,), dtype = (numpy.bool_),
) )
sdp_tod_R = attribute( tr_reload_RW = attribute(
dtype = (numpy.str,), dtype = (numpy.bool_),
access=AttrWriteType.READ_WRITE,
) )
translator_network_R = attribute( tr_tod_R = attribute(
dtype = (numpy.str,), dtype = (numpy.uint64),
) )
translator_timing_R = attribute( tr_uptime_R = attribute(
dtype = (numpy.str,), dtype = (numpy.uint64,),
) )
...@@ -184,10 +185,10 @@ class SDP(Device): ...@@ -184,10 +185,10 @@ class SDP(Device):
self.attribute_mapping["fpga_version_R"] = self.get_node("fpga_version_R") 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_R"] = self.get_node("fpga_weights_R")
self.attribute_mapping["fpga_weights_RW"] = self.get_node("fpga_weights_RW") 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["tr_busy_R"] = self.get_node("tr_busy_R")
self.attribute_mapping["sdp_tod_R"] = self.get_node("tod") self.attribute_mapping["tr_reload_RW"] = self.get_node("tr_reload_W")
self.attribute_mapping["translator_network_R"] = self.get_node("translator_network") self.attribute_mapping["tr_tod_R"] = self.get_node("tr_tod_R")
self.attribute_mapping["translator_timing_R"] = self.get_node("translator_timing") self.attribute_mapping["tr_uptime_R"] = self.get_node("tr_uptime_R")
self.info_stream("Mapping OPC-UA MP/CP to attributes done.") self.info_stream("Mapping OPC-UA MP/CP to attributes done.")
...@@ -225,14 +226,14 @@ class SDP(Device): ...@@ -225,14 +226,14 @@ class SDP(Device):
self.attribute_mapping["fpga_weights_R"] = {} self.attribute_mapping["fpga_weights_R"] = {}
self._fpga_weights_RW = numpy.full((16, 2 * 488 * 12), 0) self._fpga_weights_RW = numpy.full((16, 2 * 488 * 12), 0)
self.attribute_mapping["fpga_weights_RW"] = {} self.attribute_mapping["fpga_weights_RW"] = {}
self._sdp_info_R = "NOT_INITIALISED" self._tr_busy_R = False
self.attribute_mapping["sdp_info_R"] = {} self.attribute_mapping["tr_busy_R"] = {}
self._tod_R = "NOT_INITIALISED" self._tr_reload_RW = False
self.attribute_mapping["sdp_tod_R"] = {} self.attribute_mapping["tr_reload_RW"] = {}
self._translator_network_R = "NOT_INITIALISED" self._tr_tod_R = 0
self.attribute_mapping["translator_network_R"] = {} self.attribute_mapping["tr_tod_R"] = {}
self._translator_timing_R = "NOT_INITIALISED" self._tr_uptime_R = 0
self.attribute_mapping["translator_timing_R"] = {} self.attribute_mapping["tr_uptime_R"] = {}
# Init the dict that contains function to OPC-UA function mappings. # Init the dict that contains function to OPC-UA function mappings.
self.function_mapping = {} self.function_mapping = {}
...@@ -370,31 +371,38 @@ class SDP(Device): ...@@ -370,31 +371,38 @@ class SDP(Device):
@only_when_on @only_when_on
@fault_on_error @fault_on_error
def read_sdp_info_R(self): def read_tr_busy_R(self):
"""Return the sdp_info_R attribute.""" """Return the tr_busy_R attribute."""
self._sdp_info_R = self.attribute_mapping["sdp_info_R"].get_value() self._tr_busy_R = self.attribute_mapping["tr_busy_R"].get_value()
return self._sdp_info_R 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 @only_when_on
@fault_on_error @fault_on_error
def read_sdp_tod_R(self): def write_tr_reload_RW(self, value):
"""Return the sdp_tod_R attribute.""" """Return the tr_reload_RW attribute."""
self._sdp_tod_R = self.attribute_mapping["sdp_tod_R"].get_value() self.attribute_mapping["tr_reload_RW"].set_value(value)
return self._sdp_tod_R self._tr_reload_RW = value
@only_when_on @only_when_on
@fault_on_error @fault_on_error
def read_translator_network_R(self): def read_tr_tod_R(self):
"""Return the _translator_network_R attribute.""" """Return the _tr_tod_R attribute."""
self._translator_network_R = self.attribute_mapping["translator_network_R"].get_value() self._tr_tod_R = self.attribute_mapping["tr_tod_R"].get_value()
return self._translator_network_R return self._tr_tod_R
@only_when_on @only_when_on
@fault_on_error @fault_on_error
def read_translator_timing_R(self): def read_tr_uptime_R(self):
"""Return the _translator_timing_R attribute.""" """Return the _tr_uptime_R attribute."""
self._translator_timing_R = self.attribute_mapping["translator_timing_R"].get_value() self._tr_uptime_R = self.attribute_mapping["tr_uptime_R"].get_value()
return self._translator_timing_R return self._tr_uptime_R
# -------- # --------
......
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