node map must be rebuilt for reconnected clients

This commit is contained in:
2026-03-19 11:36:18 +01:00
parent 24bf3a1d9c
commit 51bd8c2c4c
2 changed files with 6 additions and 4 deletions

View File

@@ -60,10 +60,10 @@ class Client(HandlerBase):
def change_callback(dictionary=self.dictionary, kind_uri=(kind, uri)):
dictionary.pop(kind_uri, None)
node = server.interactor_classes[kind](uri, self.node_map, change_callback)
node = server.interactor_classes[kind](uri, change_callback)
self.dictionary[kind, uri] = node
node.update_node_map(self.node_map)
self.nodes[uri] = node
self.server = server
self.instrument_name = instrument_name

View File

@@ -49,7 +49,7 @@ class SecopInteractor(SecopClient):
hide_par = ["baseclass", "class", "pollinterval"]
skip_par = ["status2"]
def __init__(self, uri, node_map, change_callback=None):
def __init__(self, uri, change_callback=None):
super().__init__(uri)
self.module_updates = set()
self.param_updates = set()
@@ -57,11 +57,13 @@ class SecopInteractor(SecopClient):
self.change_callback = change_callback
try:
self.connect()
node_map.update({k: self for k in self.modules})
self.register_callback(None, updateItem=self.updateItem, descriptiveDataChange=self.descChanged)
except Exception as e:
print(repr(e))
def update_node_map(self, node_map):
node_map.update({k: self for k in self.modules})
def descChanged(self, module, desc):
if module is None and self.change_callback:
self.change_callback()