Fix entangle integration bugs

found during ccr-box adaption
* missing param description DigitalOutput
* missing Writable baseclass in DigitalOutput
* rework ccr config file

Change-Id: Ie40f875caacd374b02e6f6175b5fb003619c5f4e
Reviewed-on: https://forge.frm2.tum.de/review/c/secop/frappy/+/30743
Tested-by: Jenkins Automated Tests <pedersen+jenkins@frm2.tum.de>
Reviewed-by: Alexander Zaft <a.zaft@fz-juelich.de>
This commit is contained in:
Alexander Zaft
2023-03-22 10:13:51 +01:00
parent 013d20e8af
commit 78ab28c6d3
2 changed files with 69 additions and 80 deletions

View File

@ -1,9 +1,10 @@
Node('MLZ_ccr12', desc = '''CCR box of MLZ Sample environment group
'CCR box of MLZ Sample environment group\n'
'\n' Contains a Lakeshore 336 and an PLC controlling the compressor
'Contains a Lakeshore 336 and an PLC controlling the compressor\n' and some valves.'''
'and some valves.', Node('MLZ_ccr',
'localhost:10767', desc,
'tcp://10767',
) )
Mod('automatik', Mod('automatik',
@ -12,14 +13,14 @@ Mod('automatik',
'\n' '\n'
'selects between off, regulate on p1 or regulate on p2 sensor', 'selects between off, regulate on p1 or regulate on p2 sensor',
tangodevice = 'tango://localhost:10000/box/plc/_automatik', tangodevice = 'tango://localhost:10000/box/plc/_automatik',
mapping={'Off':0,'p1':1,'p2':2}, mapping="{'Off':0,'p1':1,'p2':2}",
) )
Mod('compressor', Mod('compressor',
'frappy_mlz.entangle.NamedDigitalOutput', 'frappy_mlz.entangle.NamedDigitalOutput',
'control the compressor (on/off)', 'control the compressor (on/off)',
tangodevice = 'tango://localhost:10000/box/plc/_cooler_onoff', tangodevice = 'tango://localhost:10000/box/plc/_cooler_onoff',
mapping={'Off':0,'On':1}, mapping="{'Off':0,'On':1}",
) )
Mod('gas', Mod('gas',
@ -30,7 +31,7 @@ Mod('gas',
'note: activation de-activates the vacuum inlet\n' 'note: activation de-activates the vacuum inlet\n'
'note: if the pressure regulation is active, it enslave this device', 'note: if the pressure regulation is active, it enslave this device',
tangodevice = 'tango://localhost:10000/box/plc/_gas_onoff', tangodevice = 'tango://localhost:10000/box/plc/_gas_onoff',
mapping={'Off':0,'On':1}, mapping="{'Off':0,'On':1}",
) )
Mod('vacuum', Mod('vacuum',
@ -39,8 +40,8 @@ Mod('vacuum',
'\n' '\n'
'note: activation de-activates the gas inlet\n' 'note: activation de-activates the gas inlet\n'
'note: if the pressure regulation is active, it enslave this device', 'note: if the pressure regulation is active, it enslave this device',
tangodevice = 'tango://localhost:10000/box/plc/_vacuum_Onoff', tangodevice = 'tango://localhost:10000/box/plc/_vacuum_onoff',
mapping={'Off':0,'On':1}, mapping="{'Off':0,'On':1}",
) )
Mod('p1', Mod('p1',
@ -72,88 +73,76 @@ Mod('curve_p2',
'CMR364':24, 'CMR365':25}", 'CMR364':24, 'CMR365':25}",
) )
# sensors Mod('T_tube_regulation',
'frappy_mlz.entangle.TemperatureController',
'regulation of tube temperature',
tangodevice = 'tango://localhost:10000/box/tube/control1',
value = Param(unit = 'K'),
heateroutput = 0,
ramp = 6,
speed = 0.1,
setpoint = 0,
pid = (40, 10, 1),
p = 40,
i = 10,
d = 1,
abslimits = (0, 500),
)
Mod('T_stick_regulation',
'frappy_mlz.entangle.TemperatureController',
'regualtion of stick temperature',
tangodevice = 'tango://localhost:10000/box/stick/control2',
value = Param(unit = 'K'),
heateroutput = 0,
ramp = 6,
speed = 0.1,
setpoint = 0,
pid = (40, 10, 1),
p = 40,
i = 10,
d = 1,
abslimits = (0, 500),
)
Mod('T_sample', Mod('T_sample',
'frappy_mlz.entangle.Sensor', 'frappy_mlz.entangle.Sensor',
'sample temperature', 'sample temperature',
tangodevice = 'tango://localhost:10000/box/sample/sensora', tangodevice = 'tango://localhost:10000/box/sample/sensora',
value = Param(unit='K'), value = Param(unit = 'K'),
) )
Mod('T_stick', Mod('T_stick',
'frappy_mlz.entangle.Sensor', 'frappy_mlz.entangle.Sensor',
'temperature at bottom of sample stick', 'temperature at bottom of sample stick',
tangodevice = 'tango://localhost:10000/box/stick/sensorb', tangodevice = 'tango://localhost:10000/box/stick/sensorb',
value = Param(unit='K'), value = Param(unit = 'K'),
) )
Mod('T_coldhead', Mod('T_coldhead',
'frappy_mlz.entangle.Sensor', 'frappy_mlz.entangle.Sensor',
'temperature at coldhead', 'temperature at coldhead',
tangodevice = 'tango://localhost:10000/box/stick/sensorc', tangodevice = 'tango://localhost:10000/box/coldhead/sensorc',
value = Param(unit='K'), value = Param(unit = 'K'),
) )
Mod('T_tube', Mod('T_tube',
'frappy_mlz.entangle.Sensor', 'frappy_mlz.entangle.Sensor',
'temperature at thermal coupling tube <-> stick', 'temperature at thermal coupling tube <-> stick',
tangodevice = 'tango://localhost:10000/box/tube/sensord', tangodevice = 'tango://localhost:10000/box/tube/sensord',
value = Param(unit='K'), value = Param(unit = 'K'),
) )
# regulations # THIS IS A HACK: due to entangle (in controller)
Mod('T_stick_regulation',
'frappy_mlz.entangle.TemperatureController',
'regulation of stick temperature',
tangodevice = 'tango://localhost:10000/box/stick/control2',
heateroutput = 0,
ramp = 6,
speed = 0.1,
setpoint = 0,
pid = (40,10,1),
p = 40,
i = 10,
d = 1,
abslimits = (0,500),
value = Param(unit='K'),
)
# OMG! a NamedDigitalOutput, but with float'ints' 0..3
Mod('T_stick_regulation_heaterrange',
'frappy_mlz.entangle.AnalogOutput',
'heaterrange for stick regulation',
tangodevice = 'tango://localhost:10000/box/stick/range2',
precision = 1,
abslimits = (0,3),
)
Mod('module T_tube_regulation',
'frappy_mlz.entangle.TemperatureController',
'regulation of tube temperature',
tangodevice = 'tango://localhost:10000/box/tube/control1',
heateroutput = 0,
ramp = 6,
speed = 0.1,
setpoint = 0,
pid = (40,10,1),
p = 40,
i = 10,
d = 1,
abslimits = (0,500),
value = Param(unit='K'),
)
# OMG! a NamedDigitalOutput, but with float'ints' 0..3
#[module T_tube_regulation_heaterrange]
#class=frappy_mlz.entangle.AnalogOutput
#tangodevice=tango://localhost:10000/box/tube/range1
#precision.default=1
#abslimits=(0,3)
Mod('T_tube_regulation_heaterrange', Mod('T_tube_regulation_heaterrange',
'frappy_mlz.entangle.NamedDigitalOutput', 'frappy_mlz.entangle.NamedDigitalOutput',
'heaterrange for tube regulation', 'heaterrange for tube regulation',
tangodevice = 'tango://localhost:10000/box/tube/range1', tangodevice = 'tango://localhost:10000/box/tube/range1',
mapping={'Off':0,'Low':1,'Medium':2,'High':3}, mapping="{'Off':0,'Low':1,'Medium':2, 'High':3}",
)
Mod('T_stick_regulation_heaterrange',
'frappy_mlz.entangle.NamedDigitalOutput',
'heaterrange for stick regulation',
tangodevice = 'tango://localhost:10000/box/stick/range2',
mapping="{'Off':0,'Low':1,'Medium':2, 'High':3}",
) )

View File

@ -32,17 +32,17 @@ MLZ TANGO interface for the respective device classes.
import re import re
import threading import threading
from time import sleep from time import sleep, time as currenttime
from time import time as currenttime
import PyTango import PyTango
from frappy.datatypes import ArrayOf, EnumType, FloatRange, \
IntRange, LimitsType, StringType, TupleOf from frappy.datatypes import ArrayOf, EnumType, FloatRange, IntRange, \
from frappy.errors import CommunicationFailedError, \ LimitsType, StringType, TupleOf
ConfigError, HardwareError, ProgrammingError from frappy.errors import CommunicationFailedError, ConfigError, \
HardwareError, ProgrammingError
from frappy.lib import lazy_property from frappy.lib import lazy_property
from frappy.modules import Command, StatusType, \ from frappy.modules import Command, Drivable, Module, Parameter, Readable, \
Drivable, Module, Parameter, Readable StatusType, Writable
##### #####
@ -860,20 +860,20 @@ class PartialDigitalInput(NamedDigitalInput):
return value # mapping is done by datatype upon export() return value # mapping is done by datatype upon export()
class DigitalOutput(PyTangoDevice): class DigitalOutput(PyTangoDevice, Writable):
"""A device that can set and read a digital value corresponding to a """A device that can set and read a digital value corresponding to a
bitfield. bitfield.
""" """
# overrides # overrides
value = Parameter(datatype=IntRange()) value = Parameter('current value', datatype=IntRange())
target = Parameter(datatype=IntRange()) target = Parameter('target value', datatype=IntRange())
def read_value(self): def read_value(self):
return self._dev.value # mapping is done by datatype upon export() return self._dev.value # mapping is done by datatype upon export()
def read_status(self): def read_status(self):
status = self.read_status() status = super().read_status()
self.setFastPoll(self.isBusy(status)) self.setFastPoll(self.isBusy(status))
return status return status