main module of LS370 is now drivable
- the main value is the channel - it is busy when pausing during scanning + allow softcal to ignore the sign
This commit is contained in:
@ -21,7 +21,6 @@
|
||||
"""LakeShore Model 370 resistance channel"""
|
||||
|
||||
import time
|
||||
import json
|
||||
|
||||
from secop.modules import Readable, Drivable, Parameter, Override, Property, Attached
|
||||
from secop.metaclass import Done
|
||||
@ -85,7 +84,11 @@ class Main(HasIodev, Drivable):
|
||||
self.sendRecv('INSET %d,0,0,0,0,0;INSET?%d' % (ch, ch))
|
||||
|
||||
def read_value(self):
|
||||
channel, auto = json.loads('[%s]' % self.sendRecv('SCAN?'))
|
||||
channel, auto = scan.send_command(self)
|
||||
# response = self.sendRecv('SCAN?').strip().split(',')
|
||||
# channel, auto = (int(s) for s in response)
|
||||
if channel not in self._channels:
|
||||
return channel
|
||||
if not self._channels[channel].enabled:
|
||||
# channel was disabled recently, but still selected
|
||||
nextchannel = 0
|
||||
@ -96,13 +99,12 @@ class Main(HasIodev, Drivable):
|
||||
break
|
||||
if nextchannel == 0:
|
||||
nextchannel = ch
|
||||
if not nextchannel:
|
||||
if nextchannel:
|
||||
self.write_target(nextchannel)
|
||||
return 0
|
||||
|
||||
now = time.time()
|
||||
if channel != self.target:
|
||||
print('changed' , channel, self.target)
|
||||
self._channel_changed = now
|
||||
self.target = channel
|
||||
self.autoscan = int(auto)
|
||||
@ -113,7 +115,8 @@ class Main(HasIodev, Drivable):
|
||||
return channel
|
||||
|
||||
def write_target(self, channel):
|
||||
self.sendRecv('SCAN %d,%d;SCAN?' % (channel, self.autoscan))
|
||||
scan.send_change(self, channel, self.autoscan)
|
||||
# self.sendRecv('SCAN %d,%d;SCAN?' % (channel, self.autoscan))
|
||||
if channel != self.value:
|
||||
self.value = 0
|
||||
self._channel_changed = time.time()
|
||||
|
Reference in New Issue
Block a user