followup fix: node map must be updated before registering callbacks

This commit is contained in:
2026-03-19 11:41:00 +01:00
parent 51bd8c2c4c
commit 0343a76079
2 changed files with 5 additions and 3 deletions
+3 -2
View File
@@ -60,10 +60,11 @@ class Client(HandlerBase):
def change_callback(dictionary=self.dictionary, kind_uri=(kind, uri)):
dictionary.pop(kind_uri, None)
node = server.interactor_classes[kind](uri, change_callback)
node = server.interactor_classes[kind](uri, self.node_map, change_callback)
self.dictionary[kind, uri] = node
node.update_node_map(self.node_map)
else:
node.update_node_map(self.node_map)
self.nodes[uri] = node
self.server = server
self.instrument_name = instrument_name
+2 -1
View File
@@ -49,7 +49,7 @@ class SecopInteractor(SecopClient):
hide_par = ["baseclass", "class", "pollinterval"]
skip_par = ["status2"]
def __init__(self, uri, change_callback=None):
def __init__(self, uri, node_map, change_callback=None):
super().__init__(uri)
self.module_updates = set()
self.param_updates = set()
@@ -57,6 +57,7 @@ class SecopInteractor(SecopClient):
self.change_callback = change_callback
try:
self.connect()
self.update_node_map(node_map)
self.register_callback(None, updateItem=self.updateItem, descriptiveDataChange=self.descChanged)
except Exception as e:
print(repr(e))