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

Rename get_sdp_node to a more generic get_node

This function should be moved to the base class.
On error it prints out the LOFAR device type, i.e. "SDP"m which
is set in the first lines of the class.
parent 71842395
No related branches found
No related tags found
No related merge requests found
...@@ -61,6 +61,7 @@ class SDP(Device): ...@@ -61,6 +61,7 @@ class SDP(Device):
The user triggers their transitions by the commands reflecting the target state (Initialise(), On(), Fault()). The user triggers their transitions by the commands reflecting the target state (Initialise(), On(), Fault()).
""" """
device = "SDP"
client = 0 client = 0
name_space_index = 0 name_space_index = 0
obj = 0 obj = 0
...@@ -87,29 +88,42 @@ class SDP(Device): ...@@ -87,29 +88,42 @@ class SDP(Device):
# ---------- # ----------
# Attributes # Attributes
# ---------- # ----------
fpga_weights_R = attribute(
dtype = ('DevBoolean',),
max_dim_x = 16 * 192 * 488,
#access=AttrWriteType.READ_WRITE,
)
fpga_mask_R = attribute(
dtype = ('DevBoolean',),
max_dim_x = 16,
#access=AttrWriteType.READ_WRITE,
)
SDP_mask_RW = attribute( fpga_status_R = attribute(
dtype = ('DevBoolean',), dtype = ('DevBoolean',),
max_dim_x = 32, max_dim_x = 16,
access=AttrWriteType.READ_WRITE,
) )
fpga_temp_R = attribute( fpga_temp_R = attribute(
dtype = ('DevDouble',), dtype = ('DevDouble',),
max_dim_x = 4, max_dim_x = 16,
) )
fpga_version_R = attribute(
dtype = ('DevString',),
max_dim_x = 16,
)
# --------------- # ---------------
# General methods # General methods
# --------------- # ---------------
def get_node(self, node):
def get_sdp_node(self, node):
try: try:
return self.sdp_node.get_child(["{}:{}".format(self.name_space_index, node)]) return self.lofar_device_node.get_child(["{}:{}".format(self.name_space_index, node)])
except opcua.ua.uaerrors._auto.BadNoMatch: except opcua.ua.uaerrors._auto.BadNoMatch:
self.error_stream("Could not find SDP node %s", node) self.error_stream("Could not find LOFAR device %s node %s", self.device, node)
# Contract with hardware is broken --- cannot recover # Contract with hardware is broken --- cannot recover
raise raise
...@@ -122,7 +136,11 @@ class SDP(Device): ...@@ -122,7 +136,11 @@ class SDP(Device):
self.name_space_index = 2 self.name_space_index = 2
self.obj_node = self.client.get_objects_node() self.obj_node = self.client.get_objects_node()
self.sdp_node = self.obj_node.get_child(["{}:SDP".format(self.name_space_index)]) # TODO
# The server does not implement the correct namespace yet.
# Instead it is directly using the Objects node.
#self.lofar_device_node = self.obj_node.get_child(["{}:SDP".format(self.name_space_index)])
self.lofar_device_node = self.obj_node
self.debug_stream("Mapping OPC-UA MP/CP to attributes...") self.debug_stream("Mapping OPC-UA MP/CP to attributes...")
......
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