followup fix: node map must be updated before registering callbacks
This commit is contained in:
@@ -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
|
||||
|
||||
@@ -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))
|
||||
|
||||
Reference in New Issue
Block a user