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

Update to match latest API changes

- Add fpga_scrap_R[W].
- Change fpga_mask_R to fpga_mask_RW
parent 352f283c
No related branches found
No related tags found
No related merge requests found
......@@ -94,10 +94,21 @@ class SDP(Device):
#access=AttrWriteType.READ_WRITE,
)
fpga_mask_R = attribute(
fpga_mask_RW = attribute(
dtype = ('DevBoolean',),
max_dim_x = 16,
#access=AttrWriteType.READ_WRITE,
access=AttrWriteType.READ_WRITE,
)
fpga_scrap_RW = attribute(
dtype = ('DevUInt64',),
max_dim_x = 2048,
access=AttrWriteType.READ_WRITE,
)
fpga_scrap_R = attribute(
dtype = ('DevUInt64',),
max_dim_x = 2048,
)
fpga_status_R = attribute(
......@@ -145,7 +156,9 @@ class SDP(Device):
self.debug_stream("Mapping OPC-UA MP/CP to attributes...")
self.attribute_mapping["fpga_weights_R"] = self.get_node("weights")
self.attribute_mapping["fpga_mask_R"] = self.get_node("fpga_mask_R")
self.attribute_mapping["fpga_mask_RW"] = self.get_node("fpga_mask_RW")
self.attribute_mapping["fpga_scrap_RW"] = self.get_node("fpga_scrap_RW")
self.attribute_mapping["fpga_scrap_R"] = self.get_node("fpga_scrap_R")
self.attribute_mapping["fpga_status_R"] = self.get_node("fpga_status_R")
self.attribute_mapping["fpga_temp_R"] = self.get_node("fpga_temp_R")
self.attribute_mapping["fpga_version_R"] = self.get_node("fpga_version_R")
......@@ -172,8 +185,12 @@ class SDP(Device):
# the mapping.
self._fpga_weights_R = numpy.full(16 * 12 * 488, 0.0)
self.attribute_mapping["fpga_weights_R"] = {}
self._fpga_mask_R = numpy.full(16, False)
self.attribute_mapping["fpga_mask_R"] = {}
self._fpga_mask_RW = numpy.full(16, False)
self.attribute_mapping["fpga_mask_RW"] = {}
self._fpga_scrap_RW = numpy.full(2048, False)
self.attribute_mapping["fpga_scrap_RW"] = {}
self._fpga_scrap_R = numpy.full(2048, False)
self.attribute_mapping["fpga_scrap_R"] = {}
self._fpga_status_R = numpy.full(16, False)
self.attribute_mapping["fpga_status_R"] = {}
self._fpga_temp_R = numpy.full(16, 0.0)
......@@ -255,6 +272,41 @@ class SDP(Device):
self._fpga_mask_R = numpy.array(self.attribute_mapping["fpga_mask_R"].get_value())
return self._fpga_mask_R
@only_when_on
@fault_on_error
def read_fpga_mask_RW(self):
"""Return the fpga_mask_RW attribute."""
return self._fpga_mask_RW
@only_when_on
@fault_on_error
def write_fpga_mask_RW(self, value):
"""Return the fpga_mask_RW attribute."""
self.attribute_mapping["fpga_mask_RW"].set_value(value.to_list())
_fpga_mask_RW = value
return
@only_when_on
@fault_on_error
def read_fpga_scrap_R(self):
"""Return the fpga_scrap_R attribute."""
self._fpga_scrap_R = numpy.array(self.attribute_mapping["fpga_scrap_R"].get_value())
return self._fpga_scrap_R
@only_when_on
@fault_on_error
def read_fpga_scrap_RW(self):
"""Return the fpga_scrap_RW attribute."""
return self._fpga_scrap_RW
@only_when_on
@fault_on_error
def write_fpga_scrap_RW(self, value):
"""Return the fpga_scrap_RW attribute."""
self.attribute_mapping["fpga_scrap_RW"].set_value(value.to_list())
_fpga_scrap_RW = value
return
@only_when_on
@fault_on_error
def read_fpga_status_R(self):
......
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