migrated secop_psi drivers to new syntax

- includes all changes up to 'fix inheritance order' from git_mlz
  6a32ecf342

Change-Id: Ie3ceee3dbd0a9284b47b1d5b5dbe262eebe8f283
This commit is contained in:
2021-02-24 16:15:23 +01:00
parent bc5edec06f
commit 41baf5805f
79 changed files with 2610 additions and 3952 deletions

View File

@@ -20,31 +20,23 @@
# *****************************************************************************
"""Temp"""
from secop.modules import Readable, Drivable, Parameter, Override
from secop.datatypes import FloatRange, IntRange, StringType
from secop.modules import Drivable, Parameter, Readable
from secop.stringio import HasIodev
Status = Drivable.Status
class TempLoop(HasIodev, Drivable):
'''temperature channel on Lakeshore 336'''
parameters = {
'value':
Override(datatype=FloatRange(unit='K'), default=0, poll=True),
'status':
Override(poll=False),
'target':
Override(datatype=FloatRange(1.0, 402.0, unit='K'), default=1.3, poll=True),
'tolerance':
Parameter('the tolerance', FloatRange(-400,400), default=1, readonly=False),
'pollinterval':
Override(visibility=3),
'channel':
Parameter('the Lakeshore channel', datatype=StringType(), export=False),
'loop':
Parameter('the Lakeshore loop number', datatype=IntRange(1,3), export=False),
}
class TempLoop(HasIodev, Drivable):
"""temperature channel on Lakeshore 336"""
value = Parameter(datatype=FloatRange(unit='K'), default=0, poll=True)
status = Parameter(poll=False)
target = Parameter(datatype=FloatRange(1.0, 402.0, unit='K'), default=1.3, poll=True)
tolerance = Parameter('the tolerance', FloatRange(-400, 400), default=1, readonly=False)
pollinterval = Parameter(visibility=3)
channel = Parameter('the Lakeshore channel', datatype=StringType(), export=False)
loop = Parameter('the Lakeshore loop number', datatype=IntRange(1, 3), export=False)
def earlyInit(self):
super(TempLoop, self).earlyInit()
@@ -67,24 +59,18 @@ class TempLoop(HasIodev, Drivable):
float('x')
return result
def do_stop(self):
def stop(self):
self.target = self.value
self.status = [Status.IDLE, 'stopped']
class TempChannel(HasIodev, Readable):
'''temperature channel on Lakeshore 336'''
"""temperature channel on Lakeshore 336"""
parameters = {
'value':
Override(datatype=FloatRange(unit='K'), default=0, poll=True),
'status':
Override(poll=False, constant=[Status.IDLE, 'idle']),
'pollinterval':
Override(visibility=3),
'channel':
Parameter('the Lakeshore channel', datatype=StringType(), export=False),
}
value = Parameter(datatype=FloatRange(unit='K'), default=0, poll=True)
status = Parameter(poll=False, constant=[Status.IDLE, 'idle'])
pollinterval = Parameter(visibility=3)
channel = Parameter('the Lakeshore channel', datatype=StringType(), export=False)
def read_value(self):
result = self.sendRecv('KRDG?%s' % self.channel)