frappy_psi/ls370res: various bug fixes
- avoid some error messages on disabled channels - update value of channel switcher properly - fix bug in set_param method Change-Id: I16f5cf2d7abce0c0fae17266f0c8e949e8416b7a Reviewed-on: https://forge.frm2.tum.de/review/c/secop/frappy/+/36263 Reviewed-by: Markus Zolliker <markus.zolliker@psi.ch> Tested-by: Jenkins Automated Tests <pedersen+jenkins@frm2.tum.de>
This commit is contained in:
@@ -68,8 +68,8 @@ class LakeShoreIO(HasIO):
|
|||||||
args.insert(0, cmd)
|
args.insert(0, cmd)
|
||||||
else:
|
else:
|
||||||
args[0] = cmd + args[0]
|
args[0] = cmd + args[0]
|
||||||
head = ','.join(args)
|
tail = ','.join(args)
|
||||||
tail = cmd.replace(' ', '?')
|
head = cmd.replace(' ', '?')
|
||||||
reply = self.io.communicate(f'{head};{tail}')
|
reply = self.io.communicate(f'{head};{tail}')
|
||||||
return parse_result(reply)
|
return parse_result(reply)
|
||||||
|
|
||||||
@@ -166,6 +166,7 @@ class Switcher(LakeShoreIO, ChannelSwitcher):
|
|||||||
|
|
||||||
def set_active_channel(self, chan):
|
def set_active_channel(self, chan):
|
||||||
self.set_param('SCAN ', chan.channel, 0)
|
self.set_param('SCAN ', chan.channel, 0)
|
||||||
|
self.value = chan.channel
|
||||||
chan._last_range_change = time.monotonic()
|
chan._last_range_change = time.monotonic()
|
||||||
self.set_delays(chan)
|
self.set_delays(chan)
|
||||||
|
|
||||||
@@ -278,7 +279,12 @@ class ResChannel(LakeShoreIO, Channel):
|
|||||||
vexc = 0 if excoff or iscur else exc
|
vexc = 0 if excoff or iscur else exc
|
||||||
if (rng, iexc, vexc) != (self.range, self.iexc, self.vexc):
|
if (rng, iexc, vexc) != (self.range, self.iexc, self.vexc):
|
||||||
self._last_range_change = time.monotonic()
|
self._last_range_change = time.monotonic()
|
||||||
self.range, self.iexc, self.vexc = rng, iexc, vexc
|
try:
|
||||||
|
self.range, self.iexc, self.vexc = rng, iexc, vexc
|
||||||
|
except Exception:
|
||||||
|
# avoid raising errors on disabled channel
|
||||||
|
if self.enabled:
|
||||||
|
raise
|
||||||
|
|
||||||
@CommonWriteHandler(rdgrng_params)
|
@CommonWriteHandler(rdgrng_params)
|
||||||
def write_rdgrng(self, change):
|
def write_rdgrng(self, change):
|
||||||
|
|||||||
Reference in New Issue
Block a user