state as of 20260904

This commit is contained in:
Diego Gassmann
2026-09-04 09:55:25 +02:00
parent 90454292f6
commit f8a97a24b0
5 changed files with 117 additions and 9 deletions
+90
View File
@@ -0,0 +1,90 @@
Node(
'dilprep.psi.ch',
'dilprep test',
interface='tcp://5000',
)
IO(
'io',
uri = 'linse-6837-ts:3001', # with ssh tunnel
)
Mod('dev',
'frappy_psi.lakeshore370.Device',
'monitoring lakeshore 370',
curve_handling = True,
io = 'io',
)
Mod('switcher',
'frappy_psi.lakeshore370.Switcher',
'scan switcher',
device = 'dev',
io = 'io',
)
Mod('samplehtr', #TODO:ecitatiom
'frappy_psi.lakeshore370.Sensor',
'sensor sample heater',
io = 'io',
channel = 1,
switcher = 'switcher',
calcurve = 'rx198',
enabled = True, ## disable when used as heater
vexc = '200mV',
)
Mod('sample', #TODO:ecitatiom
'frappy_psi.lakeshore370.Sensor',
'sensor sample',
io = 'io',
channel = 3,
switcher = 'switcher',
calcurve = 'cx198',
enabled = True, ## disable when used as heater
vexc = '200mV',
)
Mod('mix', #TODO:ecitatiom
'frappy_psi.lakeshore370.Sensor',
'sensor mix',
io = 'io',
channel = 4,
switcher = 'switcher',
calcurve = 'ruoxm0',
enabled = True, ## disable when used as heater
vexc = '200mV',
)
Mod('stillt', #TODO: channel, calcurve, excitatiom
'frappy_psi.lakeshore370.Sensor',
'sensor stillt',
io = 'io',
channel = 10,
switcher = 'switcher',
calcurve = 'ruoxm0',
enabled = True, ## disable when used as heater
vexc = '200mV',
)
Mod('onek', #TODO: channel, calcurve, excitatiom
'frappy_psi.lakeshore370.Sensor',
'sensor onek',
io = 'io',
channel = 11,
switcher = 'switcher',
calcurve = 'ruoxm0',
enabled = True, ## disable when used as heater
vexc = '200mV',
)
Mod('sorb', #TODO: channel, calcurve, excitatiom
'frappy_psi.lakeshore370.Sensor',
'sensor sorb',
io = 'io',
channel = 12,
switcher = 'switcher',
calcurve = 'c270',
enabled = True, ## disable when used as heater
vexc = '200mV',
)
+19 -1
View File
@@ -54,6 +54,16 @@ class Blueforssim(Communicator):
]
Hex_l = ['a', 'b', 'c', 'd']
DILHTR_COMMANDS = [
('pr', 'pr=60000000'),
('r', 'r=1'),
('i', 'i=30000'),
('v', 'v=4000'),
('k', 'k=1'),
('h', 'h=1'),
('p', '1'),
]
def earlyInit(self):
super().earlyInit()
@@ -67,6 +77,7 @@ class Blueforssim(Communicator):
for com, value in self.BRIDGE_COMMANDS:
for adr in self.Hex_l:
self._data[com % adr] = value
self._data.update(dict(self.DILHTR_COMMANDS))
@@ -92,7 +103,14 @@ class Blueforssim(Communicator):
command = (f'{comm_base}?{port}') #TODO: port mussnoch rein
self._data[command] = commands[-1]
else: #commands nicht von bridge
if command == 'status':
com_s = set(command)
if not 't' in com_s or 'o' in com_s: #comands von dilhtr
com_l = command.split('=')
if len(com_l) > 1:
self._data[com_l[0]] = str(com_l[1])
else:
reply = self._data[com_l[0]]
elif command == 'status': #ab jetzt commandds von flow oder pressure
self.log.info('X %r', self._data['status'])
reply = 'xxxxx' + ','.join(f'{key}={value}' for key, value in self._data['status'].items())
elif command == 'fmstatus':
+1 -1
View File
@@ -144,7 +144,7 @@ class ChannelSwitcher(Drivable):
self._last_measure = next_measure
if not self.autoscan or now + self._time_tol < self._start_measure + self.measure_delay: #schaut, ob kanal gewechselt werden muss
return self.status
print('next active')
#print('next active')
next_channel = self.next_channel(self.value) #setzt neuen kanal
if next_channel == self.value:
return 'IDLE', 'single channel'
-1
View File
@@ -659,7 +659,6 @@ class SensorBase(Base, Readable):
value_error = None
if self.enabled:
rdgst, raw, value = self.get_internal_data()
print('info diego!!')
print(self.channel)
# self.log.info('rdgst %r, raw %r', rdgst, raw)
rdgst &= 0xfd # suppress old reading
+7 -6
View File
@@ -142,7 +142,6 @@ class Switcher(ls.HasLscIO, ChannelSwitcher):
super().doPoll()
channelno, autoscan = self.query('SCAN?', int, int)
remote_mode = self.device.read_remote_mode()
print('dopoll1', channelno)
if autoscan and remote_mode == 'remote':
# pressed autoscan button: switch off hardware autoscan and toggle software autoscan
self.command('SCAN', self.value, 0)
@@ -197,12 +196,14 @@ class Switcher(ls.HasLscIO, ChannelSwitcher):
def set_active_channel(self, chan):
self.command('SCAN', chan.channel, 0)
for a in range(10):
if self.query('SCAN?', int, int)[0] == chan.channel:
break
self.log.info('wait for scaner')
counter = 0
with self.io._lock: #schliesst diese funktion fur andere kanale
for a in range(5):
if self.query('SCAN?', int, int)[0] == chan.channel:
break
self.log.info('wait for scaner')
counter = counter + 1
self.value = chan.channel
print(chan.channel, 'active channel')
if self.device.remote_mode == 'remote':
self.set_delays(chan)