change to secop.client.ProxyClient.register_callback

the code for calling register_callback is more readable and more
explicit now

Change-Id: I7a6a236d7f50b1ad391c1d49e3fb48f2580aa875
Reviewed-on: https://forge.frm2.tum.de/review/c/sine2020/secop/playground/+/22564
Tested-by: JenkinsCodeReview <bjoern_pedersen@frm2.tum.de>
Reviewed-by: Markus Zolliker <markus.zolliker@psi.ch>
This commit is contained in:
2020-03-02 10:59:56 +01:00
parent 199ff0419a
commit 4ed8cf5901
4 changed files with 18 additions and 16 deletions

View File

@ -55,7 +55,7 @@ class QSECNode(QObject):
self.modules = conn.modules
self.properties = self.conn.properties
self.protocolVersion = conn.secop_version
conn.register(None, self) # generic callback
conn.register_callback(None, self.updateEvent, self.nodeStateChange, self.unhandledMessage)
# provide methods from old baseclient for making other gui code work
@ -81,7 +81,10 @@ class QSECNode(QObject):
return self.conn.getParameter(module, parameter, True)
def execCommand(self, module, command, arg):
return self.conn.execCommand(module, command, arg)
try:
return self.conn.execCommand(module, command, arg)
except Exception as e:
return 'ERROR: %r' % e, {}
def queryCache(self, module):
return {k: Value(*self.conn.cache[(module, k)])