reduce communication traffic

- expermental change: no updates of unchanged values within 1 sec
- reduce fast_pollfactor in trinamic
- improve stop behaviour of dpm.DPM
This commit is contained in:
2021-09-21 16:40:54 +02:00
parent b30bd308a9
commit e98f81a7c9
3 changed files with 26 additions and 11 deletions

View File

@ -419,6 +419,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:
@ -431,7 +433,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)