more demo test cases
- added them to cfg/dummy_cfg.py + treat enum correctly in SecopClient.setParameterFromString Change-Id: Ia5b2d8d3a21c3215cb93d90975086eb9995b1543
This commit is contained in:
parent
0230641b1d
commit
58549065fb
@ -96,3 +96,15 @@ Mod('cryo',
|
|||||||
pollinterval = Param(export=False),
|
pollinterval = Param(export=False),
|
||||||
value = Param(unit = 'K', test = 'customized value'),
|
value = Param(unit = 'K', test = 'customized value'),
|
||||||
)
|
)
|
||||||
|
|
||||||
|
Mod('heatswitch',
|
||||||
|
'frappy_demo.modules.Switch',
|
||||||
|
'Heatswitch for `mf` device',
|
||||||
|
switch_on_time = 5,
|
||||||
|
switch_off_time = 10,
|
||||||
|
)
|
||||||
|
|
||||||
|
Mod('bool',
|
||||||
|
'frappy_demo.modules.BoolWritable',
|
||||||
|
'boolean writable test',
|
||||||
|
)
|
||||||
|
@ -734,7 +734,7 @@ class SecopClient(ProxyClient):
|
|||||||
"""
|
"""
|
||||||
self.connect() # make sure we are connected
|
self.connect() # make sure we are connected
|
||||||
datatype = self.modules[module]['parameters'][parameter]['datatype']
|
datatype = self.modules[module]['parameters'][parameter]['datatype']
|
||||||
value = datatype.from_string(formatted)
|
value = datatype.export_value(datatype.from_string(formatted))
|
||||||
self.request(WRITEREQUEST, self.identifier[module, parameter], value)
|
self.request(WRITEREQUEST, self.identifier[module, parameter], value)
|
||||||
return self.cache[module, parameter]
|
return self.cache[module, parameter]
|
||||||
|
|
||||||
|
@ -161,7 +161,7 @@ class Cryostat(CryoBase):
|
|||||||
|
|
||||||
by setting the current setpoint as new target"""
|
by setting the current setpoint as new target"""
|
||||||
# XXX: discussion: take setpoint or current value ???
|
# XXX: discussion: take setpoint or current value ???
|
||||||
self.write_target(self.setpoint)
|
self.write_target(self.setpoint if self.mode == 'ramp' else self.value)
|
||||||
|
|
||||||
#
|
#
|
||||||
# calculation helpers
|
# calculation helpers
|
||||||
|
@ -28,7 +28,7 @@ import time
|
|||||||
from frappy.datatypes import ArrayOf, BoolType, EnumType, \
|
from frappy.datatypes import ArrayOf, BoolType, EnumType, \
|
||||||
FloatRange, IntRange, StringType, StructOf, TupleOf
|
FloatRange, IntRange, StringType, StructOf, TupleOf
|
||||||
from frappy.lib.enum import Enum
|
from frappy.lib.enum import Enum
|
||||||
from frappy.modules import Drivable, Readable, Attached
|
from frappy.modules import Drivable, Readable, Writable, Attached
|
||||||
from frappy.modules import Parameter as SECoP_Parameter
|
from frappy.modules import Parameter as SECoP_Parameter
|
||||||
from frappy.properties import Property
|
from frappy.properties import Property
|
||||||
|
|
||||||
@ -99,6 +99,14 @@ class Switch(Drivable):
|
|||||||
self.log.info(info)
|
self.log.info(info)
|
||||||
|
|
||||||
|
|
||||||
|
class BoolWritable(Writable):
|
||||||
|
value = Parameter('boolean', BoolType())
|
||||||
|
target = Parameter('boolean', BoolType())
|
||||||
|
|
||||||
|
def write_target(self, value):
|
||||||
|
self.value = value
|
||||||
|
|
||||||
|
|
||||||
class MagneticField(Drivable):
|
class MagneticField(Drivable):
|
||||||
"""a liquid magnet
|
"""a liquid magnet
|
||||||
"""
|
"""
|
||||||
|
Loading…
x
Reference in New Issue
Block a user