Merge branch 'uniax' into wip

Conflicts:
	cfg/uniax.cfg
	secop/core.py
	secop_psi/trinamic.py
This commit is contained in:
2021-09-21 16:52:15 +02:00
11 changed files with 480 additions and 35 deletions

View File

@ -425,6 +425,8 @@ class Module(HasAccessibles):
def announceUpdate(self, pname, value=None, err=None, timestamp=None):
"""announce a changed value or readerror"""
pobj = self.parameters[pname]
timestamp = timestamp or time.time()
changed = pobj.value != value or timestamp > (pobj.timestamp or 0) + 1
if value is not None:
pobj.value = value # store the value even in case of error
if err:
@ -437,7 +439,9 @@ class Module(HasAccessibles):
pobj.value = pobj.datatype(value)
except Exception as e:
err = secop_error(e)
pobj.timestamp = timestamp or time.time()
if not changed:
return # experimental: do not update unchanged values within 1 sec
pobj.timestamp = timestamp
pobj.readerror = err
if pobj.export:
self.DISPATCHER.announce_update(self.name, pname, pobj)