secop_psi.entangle.AnalogInput: fix main value

when the unit of parameter 'value' is taken from tango, the
'$' units of other parameters are already replaced by the configured
value and are not updated. this change fixes this.

not yet tested on entangle, but a test with similar code works

Change-Id: I87ad112b0965b39bb204d6c3d1fc1de6d4e14f60
Reviewed-on: https://forge.frm2.tum.de/review/c/sine2020/secop/playground/+/29357
Tested-by: Jenkins Automated Tests <pedersen+jenkins@frm2.tum.de>
Reviewed-by: Enrico Faulhaber <enrico.faulhaber@frm2.tum.de>
Reviewed-by: Markus Zolliker <markus.zolliker@psi.ch>
This commit is contained in:
2022-09-22 10:25:50 +02:00
parent e09c365ea5
commit 05edf98dfe
3 changed files with 51 additions and 2 deletions

View File

@ -461,8 +461,7 @@ class Module(HasAccessibles):
if mainvalue:
mainunit = mainvalue.datatype.unit
if mainunit:
for pname, pobj in self.parameters.items():
pobj.datatype.set_main_unit(mainunit)
self.applyMainUnit(mainunit)
# 6) check complete configuration of * properties
if not errors:
@ -485,6 +484,11 @@ class Module(HasAccessibles):
def __getitem__(self, item):
return self.accessibles.__getitem__(item)
def applyMainUnit(self, mainunit):
"""replace $ in units of parameters by mainunit"""
for pobj in self.parameters.values():
pobj.datatype.set_main_unit(mainunit)
def announceUpdate(self, pname, value=None, err=None, timestamp=None):
"""announce a changed value or readerror"""