diff --git a/SDP/SDP/SDP.py b/SDP/SDP/SDP.py index b98336472165d390a050a63c95d8dfb91a67be5a..00568ca427fce12cb751d80276321483f11d84a2 100644 --- a/SDP/SDP/SDP.py +++ b/SDP/SDP/SDP.py @@ -61,6 +61,7 @@ class SDP(Device): The user triggers their transitions by the commands reflecting the target state (Initialise(), On(), Fault()). """ + device = "SDP" client = 0 name_space_index = 0 obj = 0 @@ -87,29 +88,42 @@ class SDP(Device): # ---------- # 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',), - max_dim_x = 32, - access=AttrWriteType.READ_WRITE, + max_dim_x = 16, ) fpga_temp_R = attribute( dtype = ('DevDouble',), - max_dim_x = 4, + max_dim_x = 16, ) + fpga_version_R = attribute( + dtype = ('DevString',), + max_dim_x = 16, + ) # --------------- # General methods # --------------- - - def get_sdp_node(self, node): + def get_node(self, node): 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: - 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 raise @@ -122,7 +136,11 @@ class SDP(Device): self.name_space_index = 2 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...")