From 0343a76079fce742d10ffb7cad8c3bdae4e716e7 Mon Sep 17 00:00:00 2001 From: Markus Zolliker Date: Thu, 19 Mar 2026 11:41:00 +0100 Subject: [PATCH] followup fix: node map must be updated before registering callbacks --- base.py | 5 +++-- secop.py | 3 ++- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/base.py b/base.py index df5cb31..e5586e9 100644 --- a/base.py +++ b/base.py @@ -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 diff --git a/secop.py b/secop.py index 8ebc1c3..6b697d0 100644 --- a/secop.py +++ b/secop.py @@ -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))