add a lot of current stuff
this is not (yet) in the frm2 repo Change-Id: Ia5b2996803c3dbb15b85ab1bc3a24717ac6297fb
This commit is contained in:
@ -27,6 +27,7 @@ from secop.metaclass import Done
|
||||
from secop.datatypes import FloatRange, IntRange, EnumType, BoolType
|
||||
from secop.stringio import HasIodev
|
||||
from secop.poller import Poller, REGULAR
|
||||
from secop.lib import formatStatusBits
|
||||
import secop.iohandler
|
||||
|
||||
Status = Drivable.Status
|
||||
@ -49,10 +50,7 @@ filterhdl = IOHandler('filter', 'FILTER?%(channel)d', '%d,%d,%d')
|
||||
scan = IOHandler('scan', 'SCAN?', '%d,%d')
|
||||
|
||||
|
||||
STATUS_TEXT = {0: ''}
|
||||
for bit, text in enumerate('CS_OVL VCM_OVL VMIX_OVL VDIF_OVL R_OVER R_UNDER T_OVER T_UNDER'.split()):
|
||||
for i in range(1 << bit, 2 << bit):
|
||||
STATUS_TEXT[i] = text
|
||||
STATUS_BIT_LABELS = 'CS_OVL VCM_OVL VMIX_OVL VDIF_OVL R_OVER R_UNDER T_OVER T_UNDER'.split()
|
||||
|
||||
|
||||
class StringIO(secop.stringio.StringIO):
|
||||
@ -183,7 +181,7 @@ class ResChannel(HasIodev, Readable):
|
||||
return Done
|
||||
result = int(self.sendRecv('RDGST?%d' % self.channel))
|
||||
result &= 0x37 # mask T_OVER and T_UNDER (change this when implementing temperatures instead of resistivities)
|
||||
statustext = STATUS_TEXT[result]
|
||||
statustext = ' '.join(formatStatusBits(result, STATUS_BIT_LABELS))
|
||||
if statustext:
|
||||
return [self.Status.ERROR, statustext]
|
||||
return [self.Status.IDLE, '']
|
||||
|
Reference in New Issue
Block a user