diff --git a/Makefile b/Makefile index 2f27895..9ae19e7 100644 --- a/Makefile +++ b/Makefile @@ -3,13 +3,15 @@ all: clean doc +# Make spawns a new shell for each command. +# Save each PID in temporary file +# sleep in order for "test" to have started reliably demo: - # Make spawns a new shell for each command. - # Save each PID in temporary file @rm -f frappydemo.PID || true @{ bin/frappy-server -q demo & echo $$! >> frappydemo.PID; } @{ bin/frappy-server -q test & echo $$! >> frappydemo.PID; } @{ bin/frappy-server -q cryo & echo $$! >> frappydemo.PID; } + @sleep 0.2 @bin/frappy-gui localhost:10767 localhost:10768 localhost:10769 @cat frappydemo.PID | xargs kill || true @rm frappydemo.PID diff --git a/cfg/cryo.cfg b/cfg/cryo.cfg deleted file mode 100644 index 3e9ed36..0000000 --- a/cfg/cryo.cfg +++ /dev/null @@ -1,50 +0,0 @@ -[node cryo_7] -# set SEC-node properties -description = short description - . - This is a very long description providing all the glory details in all the glory details about the stuff we are describing - - -[interface tcp] -type=tcp -bindto=0.0.0.0 -bindport=10769 - -[module cryo] -# some (non-defaut) module properties -.group=very important/stuff -.description=A simulated cc cryostat with heat-load, specific heat for the sample - and a temperature dependend heat-link between sample and regulation. - -# class of module: -class=frappy_demo.cryo.Cryostat - -# some parameters -jitter=0.1 -T_start=10.0 -target=10.0 -looptime=1 -ramp=6 -maxpower=20.0 -heater=4.1 -p=40 -i=10 -d=2 -mode=pid -tolerance=0.1 -window=30 -timeout=900 - -# some (non-default) parameter properties -pollinterval.export=False - -# some parameter grouping -p.group=pid -i.group=pid -d.group=pid - -value.unit=K - -# test custom properties -value.test=customized value - diff --git a/cfg/cryo_cfg.py b/cfg/cryo_cfg.py index fefa01a..fec92d7 100644 --- a/cfg/cryo_cfg.py +++ b/cfg/cryo_cfg.py @@ -12,7 +12,6 @@ Node('cryo_7.frappy.demo', more="blub", ) -# obviously not final form Mod('cryo', 'frappy_demo.cryo.Cryostat', 'A simulated cc cryostat with heat-load, specific heat for the sample and a ' \ diff --git a/cfg/demo.cfg b/cfg/demo.cfg deleted file mode 100644 index 6533791..0000000 --- a/cfg/demo.cfg +++ /dev/null @@ -1,43 +0,0 @@ -[node Equipment_ID_for_demonstration] -description = virtual modules to play around with - -[interface tcp] -bindto=0.0.0.0 -bindport=10767 - -[module heatswitch] -class=frappy_demo.modules.Switch -switch_on_time=5 -switch_off_time=10 -.description="Heatswitch for `mf` device" - -[module mf] -class=frappy_demo.modules.MagneticField -heatswitch = heatswitch -.description="simulates some cryomagnet with persistent/non-persistent switching" - -[module ts] -class=frappy_demo.modules.SampleTemp -sensor = 'Q1329V7R3' -ramp = 4 -target = 10 -value = 10 -.description = "some temperature" - -[module tc1] -class=frappy_demo.modules.CoilTemp -sensor="X34598T7" -.description = "some temperature" - -[module tc2] -class=frappy_demo.modules.CoilTemp -sensor="X39284Q8' -.description = "some temperature" - -[module label] -class=frappy_demo.modules.Label -system=Cryomagnet MX15 -subdev_mf=mf -subdev_ts=ts -.description = "some label indicating the state of the magnet `mf`." - diff --git a/cfg/demo_cfg.py b/cfg/demo_cfg.py new file mode 100644 index 0000000..8764686 --- /dev/null +++ b/cfg/demo_cfg.py @@ -0,0 +1,45 @@ +Node('demo.frappy.demo', + 'Basic demo server for frappy', + 'tcp://10767', +) + +Mod('heatswitch', + 'frappy_demo.modules.Switch', + 'Heatswitch for `mf` device', + switch_on_time = 5, + switch_off_time = 10, +) + +Mod('mf', + 'frappy_demo.modules.MagneticField', + 'simulates some cryomagnet with persistent/non-persistent switching', + heatswitch = 'heatswitch', +) + +Mod('ts', + 'frappy_demo.modules.SampleTemp', + 'some temperature', + sensor = 'Q1329V7R3', + ramp = 4, + target = 10, + value = 10, +) + +Mod('tc1', + 'frappy_demo.modules.CoilTemp', + 'some temperature', + sensor = 'X34598T7', +) + +Mod('tc2', + 'frappy_demo.modules.CoilTemp', + 'some temperature', + sensor = 'X39284Q8', +) + +Mod('label', + 'frappy_demo.modules.Label', + 'some label indicating the state of the magnet `,f`.', + subdev_mf = 'mf', + subdev_ts = 'ts', +) diff --git a/cfg/test.cfg b/cfg/test.cfg deleted file mode 100644 index 23a0b29..0000000 --- a/cfg/test.cfg +++ /dev/null @@ -1,46 +0,0 @@ -[node test config] -description=description of the testing sec-node - . - Here should be the long description. - It can be very long. - . - a single . on a line gets stripped so you can make paragraphs. - . - These texts are supposed to be possibly very long. - -[interface tcp] -type=tcp -bindto=0.0.0.0 -bindport=10768 - - -[module LN2] -class=frappy_demo.test.LN2 -.description="random value between 0..100%%" -value.unit = "%%" - -[module heater] -class=frappy_demo.test.Heater -maxheaterpower=10 -.description="some heater" - -[module T1] -class=frappy_demo.test.Temp -sensor="X34598T7" -.description="some temperature" - -[module T2] -class=frappy_demo.modules.CoilTemp -sensor="X34598T8" -.description="some temperature" - -[module T3] -class=frappy_demo.modules.CoilTemp -sensor="X34598T9" -.description="some temperature" - - -[module Lower] -class=frappy_demo.test.Lower -.description="something else" - diff --git a/cfg/test_cfg.py b/cfg/test_cfg.py new file mode 100644 index 0000000..203e28f --- /dev/null +++ b/cfg/test_cfg.py @@ -0,0 +1,46 @@ +Node('test.config.frappy.demo', + '''short description of the testing sec-node + +This description for the Nodecan be as long as you need if you use a multiline string. + +Very long! +The needed fields are Equipment id (1st argument), description (this) + and the main interface of the node (3rd arg) +''', + 'tcp://10768', +) + +Mod('LN2', + 'frappy_demo.test.LN2', + 'random value between 0..100%', + value = Param(default = 0, unit = '%'), +) + +Mod('heater', + 'frappy_demo.test.Heater', + 'some heater', + maxheaterpower = 10, +) + +Mod('T1', + 'frappy_demo.test.Temp', + 'some temperature', + sensor = 'X34598T7', +) + +Mod('T2', + 'frappy_demo.test.Temp', + 'some temperature', + sensor = 'X34598T8', +) + +Mod('T3', + 'frappy_demo.test.Temp', + 'some temperature', + sensor = 'X34598T9', +) + +Mod('Lower', + 'frappy_demo.test.Lower', + 'something else', +) diff --git a/frappy_demo/modules.py b/frappy_demo/modules.py index 9d459c6..92d7449 100644 --- a/frappy_demo/modules.py +++ b/frappy_demo/modules.py @@ -110,7 +110,7 @@ class MagneticField(Drivable): """ value = Parameter('current field in T', - unit='T', datatype=FloatRange(-15, 15), default=0, + unit='T', datatype=FloatRange(-16, 16), default=0, ) target = Parameter('target field in T', unit='T', datatype=FloatRange(-15, 15), default=0,