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:
2025-05-06 14:44:50 +02:00
parent f3fa2ac53a
commit 5436e34179

View File

@@ -68,8 +68,8 @@ class LakeShoreIO(HasIO):
args.insert(0, cmd)
else:
args[0] = cmd + args[0]
head = ','.join(args)
tail = cmd.replace(' ', '?')
tail = ','.join(args)
head = cmd.replace(' ', '?')
reply = self.io.communicate(f'{head};{tail}')
return parse_result(reply)
@@ -166,6 +166,7 @@ class Switcher(LakeShoreIO, ChannelSwitcher):
def set_active_channel(self, chan):
self.set_param('SCAN ', chan.channel, 0)
self.value = chan.channel
chan._last_range_change = time.monotonic()
self.set_delays(chan)
@@ -278,7 +279,12 @@ class ResChannel(LakeShoreIO, Channel):
vexc = 0 if excoff or iscur else exc
if (rng, iexc, vexc) != (self.range, self.iexc, self.vexc):
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)
def write_rdgrng(self, change):