[WIP] further fixes for linse-fi
This commit is contained in:
parent
5768f096a5
commit
8cea974f49
@ -3,30 +3,10 @@ Node('fi.psi.ch',
|
||||
'tcp://5000',
|
||||
)
|
||||
|
||||
Mod('htr_io',
|
||||
'frappy_psi.tdkpower.IO',
|
||||
'powersupply communicator',
|
||||
uri='serial:///dev/ttyUSB0?baudrate=9600',
|
||||
)
|
||||
|
||||
Mod('htr_power',
|
||||
'frappy_psi.tdkpower.Power',
|
||||
'heater power',
|
||||
io='htr_io',
|
||||
)
|
||||
|
||||
Mod('htr',
|
||||
'frappy_psi.furnace.TdkOutput',
|
||||
'heater output',
|
||||
io='htr_io',
|
||||
maxvolt=8,
|
||||
maxcurrent=200,
|
||||
)
|
||||
|
||||
Mod('T_main',
|
||||
'frappy_psi.ionopimax.CurrentInput',
|
||||
'sample temperature',
|
||||
addr='ai4',
|
||||
addr='ai1',
|
||||
valuerange=(0, 1372),
|
||||
value=Param(unit='degC'),
|
||||
)
|
||||
@ -34,7 +14,7 @@ Mod('T_main',
|
||||
Mod('T_extra',
|
||||
'frappy_psi.ionopimax.CurrentInput',
|
||||
'extra temperature',
|
||||
addr='ai3',
|
||||
addr='ai2',
|
||||
valuerange=(0, 1372),
|
||||
value=Param(unit='degC'),
|
||||
)
|
||||
@ -58,6 +38,33 @@ Mod('T',
|
||||
i=0.01,
|
||||
)
|
||||
|
||||
Mod('htr_io',
|
||||
'frappy_psi.tdkpower.IO',
|
||||
'powersupply communicator',
|
||||
uri='serial:///dev/ttyUSB0?baudrate=9600',
|
||||
)
|
||||
|
||||
Mod('htr_power',
|
||||
'frappy_psi.tdkpower.Power',
|
||||
'heater power',
|
||||
io='htr_io',
|
||||
)
|
||||
|
||||
Mod('htr',
|
||||
'frappy_psi.furnace.TdkOutput',
|
||||
'heater output',
|
||||
io='htr_io',
|
||||
maxvolt=8,
|
||||
maxcurrent=200,
|
||||
)
|
||||
|
||||
Mod('flowswitch',
|
||||
'frappy_psi.ionopimax.DigitalInput',
|
||||
'flow switch',
|
||||
addr='dt2',
|
||||
true_level='low',
|
||||
)
|
||||
|
||||
# Mod('interlocks',
|
||||
# 'frappy_psi.furnace.Interlocks',
|
||||
# 'interlock parameters',
|
||||
@ -69,24 +76,18 @@ Mod('T',
|
||||
# vacuum_limit=0.1,
|
||||
# )
|
||||
|
||||
# Mod('p',
|
||||
# 'frappy_psi.ionopimax.VoltageInput',
|
||||
# 'pressure',
|
||||
# addr='av?',
|
||||
# rawrange=(0, 1.5),
|
||||
# valuerange=(0, 150),
|
||||
# value=Param(unit='degC'),
|
||||
# )
|
||||
Mod('p',
|
||||
'frappy_psi.ionopimax.LogVoltageInput',
|
||||
'pressure reading',
|
||||
addr = 'av1',
|
||||
rawrange = (1.82, 8.6),
|
||||
valuerange = (5e-9, 1000),
|
||||
value = Param(unit='mbar'),
|
||||
)
|
||||
|
||||
|
||||
# Mod('p_io',
|
||||
# 'frappy_psi.pfeiffer.IO',
|
||||
# 'pressure io',
|
||||
# uri='serial:///dev/ttyUSBlower',
|
||||
# )
|
||||
#
|
||||
# Mod('p',
|
||||
# 'frappy_psi.pfeiffer.Pressure',
|
||||
# 'pressure reading',
|
||||
# io='p_io',
|
||||
# )
|
||||
Mod('vso',
|
||||
'frappy_psi.ionopimax.VoltagePower',
|
||||
'voltage power output',
|
||||
target = 24,
|
||||
export = False,
|
||||
)
|
||||
|
@ -21,7 +21,7 @@
|
||||
import os
|
||||
from glob import glob
|
||||
from frappy.core import Readable, Writable, Parameter, BoolType, StringType,\
|
||||
FloatRange, Property, TupleOf, ERROR, IDLE
|
||||
EnumType, FloatRange, Property, TupleOf, ERROR, IDLE
|
||||
from frappy.errors import ConfigError, OutOfRangeError
|
||||
from math import log
|
||||
|
||||
@ -41,7 +41,7 @@ class Base:
|
||||
for basepath in basepaths:
|
||||
for devclass in ([self.devclass] if isinstance(self.devclass, str) else self.devclass):
|
||||
devpath = f'{basepath}/{devclass}'
|
||||
if os.path.exists(devpath):
|
||||
if os.path.exists(f'{devpath}/{self.addr}'):
|
||||
self._devpath = devpath
|
||||
return
|
||||
else:
|
||||
@ -64,10 +64,17 @@ class Base:
|
||||
|
||||
class DigitalInput(Base, Readable):
|
||||
value = Parameter('input state', BoolType())
|
||||
devclass = 'digital_in'
|
||||
true_level = Property('level representig True', EnumType(low=0, high=1), default=1)
|
||||
devclass = 'digital_in', 'digital_io'
|
||||
|
||||
def initModule(self):
|
||||
super().initModule()
|
||||
self.log.info('devpath %r', self._devpath)
|
||||
if self.addr.startswith('dt'):
|
||||
self.write(f'{self.addr}_mode','inp')
|
||||
|
||||
def read_value(self):
|
||||
return self.read(self.addr, 1)
|
||||
return self.read(self.addr, 1) == self.true_level
|
||||
|
||||
|
||||
class DigitalOutput(DigitalInput, Writable):
|
||||
@ -75,7 +82,7 @@ class DigitalOutput(DigitalInput, Writable):
|
||||
devclass = 'digital_out', 'relay'
|
||||
|
||||
def write_target(self, value):
|
||||
self.write(self.addr, value, 1)
|
||||
self.write(self.addr, value == self.true_level, 1)
|
||||
|
||||
|
||||
class AnalogInput(Base, Readable):
|
||||
|
Loading…
x
Reference in New Issue
Block a user