some fixes in frappy_psi.lakeshore/lakeshore370
- for some python version sum( , start=...) if not allowed - proper use of SCAN command
This commit is contained in:
1 parent
d04b372199
commit
2e0b800d0c
2 files changed
+5
-5
No files matched your search
@@ -81,7 +81,7 @@ class HasLscIO(HasIO):
|
||||
response = self.communicate(msg).strip()
|
||||
if not converters:
|
||||
return response
|
||||
values = sum((v.split(',') for v in response.split(';')), start=[])
|
||||
values = sum((v.split(',') for v in response.split(';')), [])
|
||||
if len(values) < len(converters):
|
||||
raise CommunicationFailedError(
|
||||
f'expected {len(converters)} values,'
|
||||
|
||||
@@ -132,7 +132,7 @@ class Switcher(ls.HasLscIO, ChannelSwitcher):
|
||||
if channelno is None:
|
||||
self.status = 'ERROR', 'no enabled channel'
|
||||
return
|
||||
self.command(f'SCAN {channelno}', 0)
|
||||
self.command(f'SCAN', channelno, 0)
|
||||
|
||||
def doPoll(self):
|
||||
"""poll buttons
|
||||
@@ -193,7 +193,7 @@ class Switcher(ls.HasLscIO, ChannelSwitcher):
|
||||
self.measure_delay = chan.dwell
|
||||
|
||||
def set_active_channel(self, chan):
|
||||
self.command(f'SCAN {chan.channel}', 0)
|
||||
self.command('SCAN', chan.channel, 0)
|
||||
self.value = chan.channel
|
||||
self.set_delays(chan)
|
||||
|
||||
@@ -313,7 +313,7 @@ class SensorBase(Ls370, ls.SensorBase, Channel):
|
||||
self._last_range_change = time.monotonic()
|
||||
try:
|
||||
self.range, self.iexc, self.vexc = rng, iexc, vexc
|
||||
self.log.warn('%r', self.range)
|
||||
self.log.debug('%r', self.range)
|
||||
except Exception:
|
||||
# avoid raising errors on disabled channel
|
||||
self.log.exception('error')
|
||||
@@ -340,7 +340,7 @@ class SensorBase(Ls370, ls.SensorBase, Channel):
|
||||
if self.autorange:
|
||||
rng = max(rng, self.minrange)
|
||||
self.command(f'RDGRNG {self.channel}', iscur, exc, rng, 0, excoff)
|
||||
self.log.info('write_rdgrng %g', rng)
|
||||
self.log.debug('write_rdgrng %g', rng)
|
||||
self.read_range()
|
||||
|
||||
@CommonReadHandler(inset_params)
|
||||
|
||||
Reference in new issue
Block a user