introduce update callbacks

includes a use case:
- a software calibration, to be applied to any Readable.
- calibration could be changed on the fly

+ refactored a little bit update events mechanism

Change-Id: Ifa340770caa9eb2185fe7e912c51bd9ddb411ece
Reviewed-on: https://forge.frm2.tum.de/review/c/sine2020/secop/playground/+/23093
Tested-by: JenkinsCodeReview <bjoern_pedersen@frm2.tum.de>
Reviewed-by: Markus Zolliker <markus.zolliker@psi.ch>
This commit is contained in:
2020-05-15 09:30:52 +02:00
parent 7d987b3e42
commit 5c33cbf7a5
10 changed files with 315 additions and 78 deletions

View File

@ -73,17 +73,17 @@ class DispatcherStub:
def __init__(self, updates):
self.updates = updates
def announce_update(self, moduleobj, pname, pobj):
self.updates[pname] = pobj.value
def announce_update_error(self, moduleobj, pname, pobj, err):
self.updates[('error', pname)] = str(err)
def announce_update(self, module, pname, pobj):
if pobj.readerror:
self.updates['error', pname] = str(pobj.readerror)
else:
self.updates[pname] = pobj.value
class LoggerStub:
def debug(self, *args):
pass
info = exception = debug
info = warning = exception = debug
class ServerStub: