Compare commits
503 Commits
Author | SHA1 | Date | |
---|---|---|---|
b040abcdf6 | |||
0def8f52e7 | |||
c074d2cbba | |||
d2c9524497 | |||
1c55b7dbf1 | |||
b63dca3b4e | |||
5f1e37a99e | |||
8c606150f5 | |||
efc1694408 | |||
cba15e0237 | |||
41ed82e72e | |||
95ca85fd9c | |||
4f9372066a | |||
be779b118b | |||
feb0566e87 | |||
8b40e91578 | |||
eeb666c5dd | |||
fac29af0ad | |||
d55ee42612 | |||
75cfffb548 | |||
7d02b47c7a | |||
ecfc0b2ab8 | |||
04402e72b6 | |||
61b65220e1 | |||
67030985d6 | |||
ca2ca5d7cb | |||
ba3c64ddac | |||
06bcf94fa2 | |||
f6f433e6b2 | |||
2a165c5013 | |||
8e70b97ef7 | |||
e1cda7d263 | |||
959a09957e | |||
f68886a4ed | |||
eeea754181 | |||
ae7bf3ce96 | |||
affe3c161c | |||
5b6a9de96e | |||
34793f8bd0 | |||
7333ccd7a6 | |||
2d42eab5fa | |||
c88a71985a | |||
ae2a731161 | |||
ec664d9268 | |||
4ca7bf0a7d | |||
715fcf4d36 | |||
a429852c80 | |||
3eb5f90ce6 | |||
f1115c937b | |||
91d0f2c635 | |||
614a49f3e3 | |||
1e56f2f39e | |||
82e9b599ad | |||
c4781d3d70 | |||
c0b928f2f6 | |||
73bb0cff1e | |||
6454e5f96e | |||
3f53823c07 | |||
fe60a8ebd8 | |||
fb0a689786 | |||
2ee12a62f0 | |||
de970ece3a | |||
59810aa748 | |||
d2e7ce7242 | |||
72fbed289d | |||
60c6553ee7 | |||
cf10590245 | |||
44c59bd818 | |||
c355999e85 | |||
4f0daf3424 | |||
be7c9eec8c | |||
ef5f4cd2f3 | |||
1da16f12c4 | |||
2658dd8090 | |||
fa5d5654f8 | |||
bf8d5101b0 | |||
31b5928725 | |||
110855200a | |||
21f9921269 | |||
bce88ff343 | |||
5359f0351f | |||
ab2e001093 | |||
ff0e77a166 | |||
195a48f366 | |||
2110f8d83b | |||
4c6c7c7950 | |||
7d7972b73f | |||
fc40f5e0c9 | |||
a19b085c30 | |||
09772eb746 | |||
c249b1648d | |||
480913dabe | |||
c2a080360d | |||
923da8ca15 | |||
7a2e764262 | |||
d726fd9fa0 | |||
267acf644c | |||
0bc8accaaa | |||
0351ebd98d | |||
3a235f6380 | |||
500c5f8c5d | |||
6b8e6498fa | |||
4fc6ef52da | |||
fcb5052565 | |||
acc7580dc6 | |||
4f28e5555c | |||
ec2bc57ade | |||
7142cee0db | |||
a3d7520da9 | |||
9d5ed822e8 | |||
b6c2cf8d3a | |||
a26ae0da4e | |||
a7cbb35455 | |||
e866ae7034 | |||
f35dae5893 | |||
2fc9eccfd5 | |||
ca57f46ed2 | |||
1776d7b4b6 | |||
34f46ab0b0 | |||
98a73d7882 | |||
e7148a30cb | |||
da948468b4 | |||
75df438d69 | |||
10fe42babf | |||
8124ed3294 | |||
aa7910c28c | |||
ff6a98af92 | |||
0647b34bb8 | |||
271bb27699 | |||
2cbe3f19b4 | |||
228902a6ee | |||
bee591c861 | |||
8e7e70c50e | |||
e36ff9bc41 | |||
e02c9b1378 | |||
5a19103d0e | |||
e201e7dce9 | |||
532e4a7ab5 | |||
c9ccaa484a | |||
a5dfc82b95 | |||
e22da0db67 | |||
e89bc07759 | |||
e405783716 | |||
dc59906c8a | |||
161fb7b2ca | |||
04940b1a0b | |||
6f6f07b0f9 | |||
a44d232dea | |||
32b1d6412d | |||
87830a1473 | |||
fcca3801a4 | |||
00b57e3d2c | |||
720d010c47 | |||
9e52665b88 | |||
a529cb9ab1 | |||
33fb90af05 | |||
da122ad961 | |||
11d1ad546f | |||
37d28c9f35 | |||
dc0cc590ed | |||
0771cb6899 | |||
564620e9e3 | |||
e1b30bf37e | |||
439c9d34c1 | |||
ac90999bdd | |||
85dd905cfd | |||
04b9bed7c9 | |||
1171245704 | |||
ab1fdbae16 | |||
2d628e151c | |||
329c8d999a | |||
af920aafdf | |||
98162a59b9 | |||
64b4cba67c | |||
d99f2dfbc3 | |||
e673dfe92b | |||
d18e368ab9 | |||
a334cc4f0a | |||
42c5e97122 | |||
f069b31d5a | |||
47000f7a9f | |||
6f95c0d825 | |||
a9d479ba0a | |||
9329d2b0f4 | |||
4f69899fbe | |||
2dad4b4ee1 | |||
5174321b6a | |||
32edc4c049 | |||
d986134781 | |||
bd4330f9fd | |||
f260bd25b1 | |||
d0af831b1f | |||
df8bc1c203 | |||
c101af99d3 | |||
7baacb0f9e | |||
155efb06bf | |||
2f730ab444 | |||
41f3a2ecd4 | |||
10d2d16453 | |||
087a5ef476 | |||
67bbe9d9a5 | |||
0b501ba444 | |||
981513df10 | |||
95e5102137 | |||
d498fa9230 | |||
eff8ac8c62 | |||
39f0180f40 | |||
dd6ee398f2 | |||
c3796aa6eb | |||
4cf54dcce8 | |||
79277e86f1 | |||
361f9ac4fc | |||
11a3bed8b8 | |||
5db84b3fa1 | |||
dccd329435 | |||
0d265b9752 | |||
9cab6670b9 | |||
8c6f1a21ab | |||
a1271b7268 | |||
9bf187758b | |||
349c510555 | |||
31b1a916f5 | |||
9755040ac2 | |||
c0704b3d4f | |||
58ff438f46 | |||
98ab5a5785 | |||
58f7ef6de4 | |||
431a1c20ab | |||
2e698af78c | |||
5c2b4c6491 | |||
80b1932f39 | |||
644bfa85f7 | |||
bd06abc060 | |||
efad0e2079 | |||
c3bfc0a930 | |||
2eef2f1d7f | |||
d8621bdc2c | |||
23c9aa6038 | |||
0464d60f68 | |||
d4b80eabd6 | |||
952cbe76a5 | |||
746df2eb94 | |||
494960a2ac | |||
0382313fc7 | |||
66faf89d7f | |||
79da402ceb | |||
b0b85a2711 | |||
5fb1e649ab | |||
7a3cfe9836 | |||
e12f2bacb1 | |||
d6c641e67b | |||
ec15a35977 | |||
05415e79b1 | |||
908f2d4c23 | |||
cdd6d7f1a2 | |||
8831e7142f | |||
e5c99c36e7 | |||
bb0619f212 | |||
0e5f62d849 | |||
3aaa12eee1 | |||
dbf4ad373e | |||
595c32783c | |||
b48b965070 | |||
2cf073e7d8 | |||
ef1664e1a2 | |||
05cf4a791a | |||
c8f30582a5 | |||
0acb80380a | |||
b5205d7c7a | |||
819026659a | |||
09f6149822 | |||
0ce5a495f0 | |||
a66f2ac21b | |||
244d84aa56 | |||
f1ea85bfa7 | |||
4c577cf83d | |||
ca4297e3a6 | |||
31706093fb | |||
f4fac1f3dd | |||
c9500bcd96 | |||
65c5277a79 | |||
e0132ed201 | |||
e0090a5918 | |||
ee9f8536b2 | |||
a1141c87c9 | |||
b75d89ad16 | |||
af32fd308c | |||
355eaeb864 | |||
a2458005f1 | |||
1004512caf | |||
9f54d89efa | |||
72f9f242d7 | |||
4857ebf043 | |||
25ff6018c4 | |||
b3fbf3b107 | |||
8651a5fb83 | |||
231f5942f8 | |||
1d893974cb | |||
6b32c4bb81 | |||
9b801e9487 | |||
23b1f59320 | |||
3a2a90e712 | |||
ad7ff7f7f3 | |||
8799710b38 | |||
e1d5170a90 | |||
a39db9a35d | |||
5c874483a9 | |||
65480cd773 | |||
7d59345f43 | |||
bc553f889c | |||
cae225df41 | |||
3a52f9d31c | |||
4ebb15ca6c | |||
240c4f027b | |||
f7e24f13bb | |||
c3d8068e02 | |||
084e890645 | |||
edd3437682 | |||
c2728c8340 | |||
725820fafd | |||
9f653b4e6f | |||
ae7d3514a1 | |||
6b9d4a8140 | |||
af295b12b0 | |||
69dd011260 | |||
d62076128a | |||
38ae301cda | |||
2ee9ea65da | |||
0dfaa79f77 | |||
866fe73f2e | |||
f5c96214b0 | |||
4d28abe141 | |||
c75d7f17f7 | |||
a384664639 | |||
ee708f7b02 | |||
edc942cb24 | |||
dcd79506a9 | |||
f4e974f46c | |||
d889401697 | |||
85295a7d72 | |||
82957c287d | |||
05593d80f6 | |||
7a870aa56c | |||
09d48ea913 | |||
8850edbc2d | |||
59cc981566 | |||
3cc9a75174 | |||
52b77ba9e6 | |||
db3b190c26 | |||
c522c41654 | |||
929e41ffff | |||
8d99a8c536 | |||
a14c282993 | |||
d09634a55d | |||
b17030afa2 | |||
37c9efb27b | |||
4167ce7b00 | |||
2b7b2267d2 | |||
8071c21819 | |||
e16ef3ae87 | |||
51147d8e09 | |||
6909eb8541 | |||
5d6b208671 | |||
b3eebb6c6a | |||
7f166a5b8c | |||
c1eb764b09 | |||
a9d798fabc | |||
a928c95efd | |||
7df4584150 | |||
b7cebe2cd8 | |||
b8b2dafaf8 | |||
f66411dded | |||
ce4bbec766 | |||
355810a887 | |||
aa98604f88 | |||
b0051ca3f0 | |||
92edbb27ea | |||
20fc48ddf0 | |||
340c031f46 | |||
3ac8b4e255 | |||
6ffc73a1e1 | |||
4ef0b0c01d | |||
1fc805a5a2 | |||
05edf98dfe | |||
e09c365ea5 | |||
64cb297a06 | |||
eaefa1ce87 | |||
71aaf7187a | |||
0a28192c15 | |||
1b9cac04b1 | |||
2b1986ad8f | |||
270152d503 | |||
1922578dfa | |||
43880346d6 | |||
d0794a7803 | |||
dc76ac92de | |||
8579368259 | |||
cd90385e6c | |||
3acea5f7c7 | |||
c564ae392c | |||
1357ead435 | |||
6a0261c728 | |||
d717a481d7 | |||
4c94580cb9 | |||
8eee7ab3b0 | |||
478075c545 | |||
b7d16d2e16 | |||
d3379d5e95 | |||
d6ad5f058d | |||
a35134978a | |||
7891c281e1 | |||
6460e51920 | |||
b40b0e75b1 | |||
af983287e7 | |||
8d23503bbd | |||
bb097ac3ba | |||
16a9550080 | |||
9858973ba1 | |||
e6d6179925 | |||
60c62a340d | |||
3c0c60615a | |||
fda1939324 | |||
8767be2aac | |||
39a3e79eb3 | |||
c1d42f0f02 | |||
3fe44d32b1 | |||
f58ab263e7 | |||
e0fe7e46d1 | |||
b423235c5d | |||
aa82bc580d | |||
c2596a9629 | |||
bf1761bbc4 | |||
99588fc815 | |||
bbc4663266 | |||
c1307cdd03 | |||
b911bc1838 | |||
26a0f2e078 | |||
4f7083bc98 | |||
0909f92e12 | |||
f3450375ce | |||
eb2e8f5f74 | |||
2ef0da68e8 | |||
9b38db7706 | |||
8f7fb1e45b | |||
f13e29aad2 | |||
c5d228ffc4 | |||
071ba38b60 | |||
b29b1e1b36 | |||
c91d726f9d | |||
1d75d192e5 | |||
4bf3acab98 | |||
eebc9232cd | |||
c16f159599 | |||
796be752b7 | |||
b8e8d24b50 | |||
45dd14a72c | |||
ad7cfe4ea0 | |||
47d09e9b08 | |||
d76d79aebb | |||
a64eb7f33b | |||
3d0d779d81 | |||
3b7cc33f64 | |||
41489a4a24 | |||
3140d454ae | |||
7bd166a8a1 | |||
f3978385b4 | |||
bc6a99e11b | |||
6b610f1e25 | |||
9a60de9c1c | |||
026e657799 | |||
35f08bf4ad | |||
76ae75a926 | |||
27ac70b1da | |||
a343b07f1d | |||
09411f36f3 | |||
b0f0a48e51 | |||
e4261ecfe1 | |||
598dd07888 | |||
f2b330a3f0 | |||
a85201ad7d | |||
2cf6e167a8 | |||
ffc2c495fb | |||
7ea4e3955a | |||
cc1632e07d | |||
1e17d0c6b9 | |||
e568c665a8 | |||
d0f895ed44 | |||
69f5692951 | |||
980499ba41 | |||
6cde8177d5 | |||
23779c8f8c | |||
899a07aec8 | |||
6a32ecf342 | |||
1464a6bce5 | |||
bb6f692c6b | |||
1a8ddbc696 | |||
ed02131a37 | |||
a19425684c | |||
24cffad4df | |||
05fec236da | |||
b1a88440ef | |||
c9721649a3 | |||
d2c3370a40 |
22
calibtest.py
22
calibtest.py
@ -1,22 +0,0 @@
|
||||
import sys
|
||||
import os
|
||||
from glob import glob
|
||||
from frappy_psi.calcurve import CalCurve
|
||||
|
||||
os.chdir('/Users/zolliker/gitpsi/calcurves')
|
||||
|
||||
if len(sys.argv) > 1:
|
||||
calib = sys.argv[1]
|
||||
c = CalCurve(calib)
|
||||
else:
|
||||
for file in sorted(glob('*.*')):
|
||||
if file.endswith('.md') or file.endswith('.std'):
|
||||
continue
|
||||
try:
|
||||
c = CalCurve(file)
|
||||
xy = c.export()
|
||||
print('%9.4g %12.7g %9.4g %9.4g %s' % (tuple(c.extx) + tuple(c.exty) + (file,)))
|
||||
except Exception as e:
|
||||
print(file, e)
|
||||
calib = file
|
||||
|
@ -6,7 +6,7 @@ Node('QnwTC1test.psi.ch',
|
||||
Mod('io',
|
||||
'frappy_psi.qnw.QnwIO',
|
||||
'connection for Quantum northwest',
|
||||
uri='tcp://ldmcc01-ts:3004',
|
||||
uri='tcp://ldm-fi-ts:3001',
|
||||
)
|
||||
|
||||
Mod('T',
|
||||
|
@ -6,7 +6,7 @@ Node('TFA10.psi.ch',
|
||||
Mod('io',
|
||||
'frappy_psi.thermofisher.ThermFishIO',
|
||||
'connection for ThermoFisher A10',
|
||||
uri='tcp://ldmse-d910-ts:3001',
|
||||
uri='tcp://ldm-fi-ts:3002',
|
||||
)
|
||||
|
||||
Mod('T',
|
||||
|
@ -24,7 +24,6 @@ Mod('ts_low',
|
||||
minrange=13,
|
||||
range=22,
|
||||
tolerance = 0.1,
|
||||
vexc = 3,
|
||||
htrrng=4,
|
||||
)
|
||||
|
||||
@ -33,8 +32,7 @@ Mod('ts_high',
|
||||
'sample Cernox',
|
||||
channel = 1,
|
||||
switcher = 'lsc_channel',
|
||||
minrange=11,
|
||||
vexc = 5,
|
||||
minrange=9,
|
||||
range=22,
|
||||
tolerance = 0.1,
|
||||
htrrng=5,
|
||||
@ -47,8 +45,6 @@ Mod('ts',
|
||||
value=Param(unit='K'),
|
||||
low='ts_low',
|
||||
high='ts_high',
|
||||
#min_high=0.6035,
|
||||
#max_low=1.6965,
|
||||
min_high=0.6,
|
||||
max_low=1.7,
|
||||
tolerance=0.1,
|
||||
|
@ -1,19 +0,0 @@
|
||||
Node('attocube_test.psi.ch',
|
||||
'a single attocube axis',
|
||||
interface='tcp://5000',
|
||||
)
|
||||
|
||||
Mod('r',
|
||||
'frappy_psi.attocube.Axis',
|
||||
'ANRv220-F3-02882',
|
||||
axis = 1,
|
||||
value = Param(unit='deg'),
|
||||
tolerance = 0.1,
|
||||
target_min = 0,
|
||||
target_max = 360,
|
||||
steps_fwd = 45,
|
||||
steps_bwd = 85,
|
||||
step_mode = True,
|
||||
# gear = 1.2,
|
||||
)
|
||||
|
231
cfg/dilsc_cfg.py
231
cfg/dilsc_cfg.py
@ -1,231 +0,0 @@
|
||||
Node('cfg/dilsc1.cfg',
|
||||
'triton test',
|
||||
interface='5000',
|
||||
name='dilsc1',
|
||||
)
|
||||
|
||||
Mod('triton',
|
||||
'frappy_psi.mercury.IO',
|
||||
'connection to triton software',
|
||||
uri='tcp://192.168.2.33:33576',
|
||||
)
|
||||
|
||||
Mod('T_mix',
|
||||
'frappy_psi.triton.TemperatureSensor',
|
||||
'mix. chamber temperature',
|
||||
slot='T8',
|
||||
io='triton',
|
||||
)
|
||||
|
||||
Mod('T_pt2head',
|
||||
'frappy_psi.triton.TemperatureSensor',
|
||||
'PTR2 head temperature',
|
||||
slot='T1',
|
||||
io='triton',
|
||||
)
|
||||
|
||||
Mod('T_pt2plate',
|
||||
'frappy_psi.triton.TemperatureSensor',
|
||||
'PTR2 plate temperature',
|
||||
slot='T2',
|
||||
io='triton',
|
||||
)
|
||||
|
||||
Mod('T_still',
|
||||
'frappy_psi.triton.TemperatureSensor',
|
||||
'still temperature',
|
||||
slot='T3',
|
||||
io='triton',
|
||||
)
|
||||
|
||||
Mod('htr_still',
|
||||
'frappy_psi.triton.HeaterOutput',
|
||||
'still heater',
|
||||
slot='H2',
|
||||
io='triton',
|
||||
)
|
||||
|
||||
Mod('T_coldpl',
|
||||
'frappy_psi.triton.TemperatureSensor',
|
||||
'cold plate temperature',
|
||||
slot='T4',
|
||||
io='triton',
|
||||
)
|
||||
|
||||
Mod('T_mixcx',
|
||||
'frappy_psi.triton.TemperatureSensor',
|
||||
'mix. chamber cernox',
|
||||
slot='T5',
|
||||
io='triton',
|
||||
)
|
||||
|
||||
Mod('T_pt1head',
|
||||
'frappy_psi.triton.TemperatureSensor',
|
||||
'PTR1 head temperature',
|
||||
slot='T6',
|
||||
io='triton',
|
||||
)
|
||||
|
||||
Mod('T_pt1plate',
|
||||
'frappy_psi.triton.TemperatureSensor',
|
||||
'PTR1 plate temperature',
|
||||
slot='T7',
|
||||
io='triton',
|
||||
)
|
||||
|
||||
Mod('T_pucksensor',
|
||||
'frappy_psi.triton.TemperatureLoop',
|
||||
'puck sensor temperature',
|
||||
output_module='htr_pucksensor',
|
||||
slot='TA',
|
||||
io='triton',
|
||||
)
|
||||
|
||||
Mod('htr_pucksensor',
|
||||
'frappy_psi.triton.HeaterOutputWithRange',
|
||||
'mix. chamber heater',
|
||||
slot='H1,TA',
|
||||
io='triton',
|
||||
)
|
||||
|
||||
Mod('T_magnet',
|
||||
'frappy_psi.triton.TemperatureSensor',
|
||||
'magnet temperature',
|
||||
slot='T13',
|
||||
io='triton',
|
||||
)
|
||||
|
||||
Mod('action',
|
||||
'frappy_psi.triton.Action',
|
||||
'higher level scripts',
|
||||
io='triton',
|
||||
slot='DR',
|
||||
)
|
||||
|
||||
Mod('p_dump',
|
||||
'frappy_psi.mercury.PressureSensor',
|
||||
'dump pressure',
|
||||
slot='P1',
|
||||
io='triton',
|
||||
)
|
||||
|
||||
Mod('p_cond',
|
||||
'frappy_psi.mercury.PressureSensor',
|
||||
'condenser pressure',
|
||||
slot='P2',
|
||||
io='triton',
|
||||
)
|
||||
|
||||
Mod('p_still',
|
||||
'frappy_psi.mercury.PressureSensor',
|
||||
'still pressure',
|
||||
slot='P3',
|
||||
io='triton',
|
||||
)
|
||||
|
||||
Mod('p_fore',
|
||||
'frappy_psi.mercury.PressureSensor',
|
||||
'pressure on the pump side',
|
||||
slot='P5',
|
||||
io='triton',
|
||||
)
|
||||
|
||||
Mod('p_back',
|
||||
'frappy_psi.mercury.PressureSensor',
|
||||
'pressure on the back side of the pump',
|
||||
slot='P4',
|
||||
io='triton',
|
||||
)
|
||||
|
||||
Mod('p_ovc',
|
||||
'frappy_psi.mercury.PressureSensor',
|
||||
'outer vacuum pressure',
|
||||
slot='P6',
|
||||
io='triton',
|
||||
)
|
||||
|
||||
Mod('V1',
|
||||
'frappy_psi.triton.Valve',
|
||||
'valve V1',
|
||||
slot='V1',
|
||||
io='triton',
|
||||
)
|
||||
|
||||
Mod('V2',
|
||||
'frappy_psi.triton.Valve',
|
||||
'valve V2',
|
||||
slot='V2',
|
||||
io='triton',
|
||||
)
|
||||
|
||||
Mod('V4',
|
||||
'frappy_psi.triton.Valve',
|
||||
'valve V4',
|
||||
slot='V4',
|
||||
io='triton',
|
||||
)
|
||||
|
||||
Mod('V5',
|
||||
'frappy_psi.triton.Valve',
|
||||
'valve V5',
|
||||
slot='V5',
|
||||
io='triton',
|
||||
)
|
||||
|
||||
Mod('V9',
|
||||
'frappy_psi.triton.Valve',
|
||||
'valve V9',
|
||||
slot='V9',
|
||||
io='triton',
|
||||
)
|
||||
|
||||
Mod('ips',
|
||||
'frappy_psi.mercury.IO',
|
||||
'IPS for magnet',
|
||||
uri='192.168.127.254:3001',
|
||||
)
|
||||
|
||||
Mod('mf',
|
||||
'frappy_psi.dilsc.VectorField',
|
||||
'vector field',
|
||||
x='mfx',
|
||||
y='mfy',
|
||||
z='mfz',
|
||||
sphere_radius=0.6,
|
||||
cylinders=((0.23, 5.2), (0.45, 0.8)),
|
||||
)
|
||||
|
||||
Mod('mfx',
|
||||
'frappy_psi.ips_mercury.SimpleField',
|
||||
'magnetic field, x-axis',
|
||||
slot='GRPX',
|
||||
io='ips',
|
||||
tolerance=0.0001,
|
||||
wait_stable_field=0.0,
|
||||
nunits=2,
|
||||
target=Param(max=0.6),
|
||||
ramp=0.225,
|
||||
)
|
||||
|
||||
Mod('mfy',
|
||||
'frappy_psi.ips_mercury.SimpleField',
|
||||
'magnetic field, y axis',
|
||||
slot='GRPY',
|
||||
io='ips',
|
||||
tolerance=0.0001,
|
||||
wait_stable_field=0.0,
|
||||
nunits=2,
|
||||
target=Param(max=0.6),
|
||||
ramp=0.225,
|
||||
)
|
||||
|
||||
Mod('mfz',
|
||||
'frappy_psi.ips_mercury.Field',
|
||||
'magnetic field, z-axis',
|
||||
slot='GRPZ',
|
||||
io='ips',
|
||||
tolerance=0.0001,
|
||||
target=Param(max=5.2),
|
||||
mode='DRIVEN',
|
||||
ramp=0.52,
|
||||
)
|
@ -1,52 +0,0 @@
|
||||
Node('flowsas.psi.ch',
|
||||
'flowsas test motors',
|
||||
'tcp://5000',
|
||||
)
|
||||
|
||||
#Mod('mot_io',
|
||||
# 'frappy_psi.phytron.PhytronIO',
|
||||
# 'io for motor control',
|
||||
# uri = 'serial:///dev/ttyUSB0',
|
||||
# )
|
||||
|
||||
#Mod('hmot',
|
||||
# 'frappy_psi.phytron.Motor',
|
||||
# 'horizontal axis',
|
||||
# axis = 'X',
|
||||
# io = 'mot_io',
|
||||
# encoder_mode= 'NO',
|
||||
# )
|
||||
|
||||
#Mod('vmot',
|
||||
# 'frappy_psi.phytron.Motor',
|
||||
# 'vertical axis',
|
||||
# axis = 'Y',
|
||||
# io = 'mot_io',
|
||||
# encoder_mode= 'NO',
|
||||
# )
|
||||
|
||||
Mod('syr_io',
|
||||
'frappy_psi.cetoni_pump.LabCannBus',
|
||||
'Module for bus',
|
||||
deviceconfig = "/home/l_samenv/frappy/cetoniSDK/CETONI_SDK_Raspi_64bit_v20220627/config/dual_pumps",
|
||||
)
|
||||
|
||||
Mod('syr1',
|
||||
'frappy_psi.cetoni_pump.SyringePump',
|
||||
'First syringe pump',
|
||||
io='syr_io',
|
||||
pump_name = "Nemesys_S_1_Pump",
|
||||
valve_name = "Nemesys_S_1_Valve",
|
||||
inner_diameter_set = 10,
|
||||
piston_stroke_set = 60,
|
||||
)
|
||||
|
||||
Mod('syr2',
|
||||
'frappy_psi.cetoni_pump.SyringePump',
|
||||
'Second syringe pump',
|
||||
io='syr_io',
|
||||
pump_name = "Nemesys_S_2_Pump",
|
||||
valve_name = "Nemesys_S_2_Valve",
|
||||
inner_diameter_set = 1,
|
||||
piston_stroke_set = 60,
|
||||
)
|
@ -3,5 +3,3 @@
|
||||
logdir = ./log
|
||||
piddir = ./pid
|
||||
confdir = ./cfg
|
||||
comlog = True
|
||||
|
||||
|
@ -1,102 +0,0 @@
|
||||
Node('Gas10kA.psi.ch',
|
||||
'LOGO for 10kBar Gas pressure stick',
|
||||
interface='tcp://5001',
|
||||
)
|
||||
|
||||
Mod('io',
|
||||
'frappy_psi.logo.IO',
|
||||
'',
|
||||
ip_address = "192.168.1.1",
|
||||
tcap_client = 0x3000,
|
||||
tsap_server = 0x2000
|
||||
)
|
||||
|
||||
Mod('PT10000',
|
||||
'frappy_psi.logo.TempSensor',
|
||||
'sensor',
|
||||
io = 'io',
|
||||
vm_address ="VW0",
|
||||
)
|
||||
|
||||
Mod('T_pt10k',
|
||||
'frappy_psi.softcal.Sensor',
|
||||
'?',
|
||||
value=Param(unit='K'),
|
||||
rawsensor='PT10000',
|
||||
calib='pt10000e',
|
||||
)
|
||||
|
||||
Mod('PT1000_oben',
|
||||
'frappy_psi.logo.TempSensor',
|
||||
'sensor',
|
||||
io = 'io',
|
||||
vm_address ="VW2",
|
||||
)
|
||||
|
||||
Mod('T_top',
|
||||
'frappy_psi.softcal.Sensor',
|
||||
'?',
|
||||
value=Param(unit='K'),
|
||||
rawsensor='PT1000_oben',
|
||||
calib='pt1000e',
|
||||
)
|
||||
|
||||
Mod('PT1000_mitte',
|
||||
'frappy_psi.logo.TempSensor',
|
||||
'sensor',
|
||||
io = 'io',
|
||||
vm_address ="VW4",
|
||||
)
|
||||
|
||||
Mod('T_mid',
|
||||
'frappy_psi.softcal.Sensor',
|
||||
'?',
|
||||
value=Param(unit='K'),
|
||||
rawsensor='PT1000_mitte',
|
||||
calib='pt1000e',
|
||||
)
|
||||
|
||||
Mod('PT1000_unten',
|
||||
'frappy_psi.logo.TempSensor',
|
||||
'sensor',
|
||||
io = 'io',
|
||||
vm_address ="VW6",
|
||||
)
|
||||
|
||||
Mod('T_bot',
|
||||
'frappy_psi.softcal.Sensor',
|
||||
'?',
|
||||
value=Param(unit='K'),
|
||||
rawsensor='PT1000_unten',
|
||||
calib='pt1000e',
|
||||
)
|
||||
|
||||
Mod('Cernox',
|
||||
'frappy_psi.logo.TempSensor',
|
||||
'sensor',
|
||||
io = 'io',
|
||||
vm_address ="VW8",
|
||||
)
|
||||
|
||||
Mod('T_cx',
|
||||
'frappy_psi.softcal.Sensor',
|
||||
'?',
|
||||
value=Param(unit='K'),
|
||||
rawsensor='Cernox',
|
||||
calib='X174785',
|
||||
)
|
||||
|
||||
Mod('HeaterLevelHigh',
|
||||
'frappy_psi.logo.HeaterParam',
|
||||
'heater param',
|
||||
io = 'io',
|
||||
vm_address = "VW10",
|
||||
)
|
||||
|
||||
# currently unused:
|
||||
#Mod('HeaterLevelLow',
|
||||
# 'frappy_psi.logo.HeaterParam',
|
||||
# 'heater param',
|
||||
# io = 'io',
|
||||
# vm_address = "VW12",
|
||||
#)
|
16
cfg/lockin830_cfg.py
Normal file
16
cfg/lockin830_cfg.py
Normal file
@ -0,0 +1,16 @@
|
||||
Node('lockin830test.psi.ch',
|
||||
'lockin830 test',
|
||||
'tcp://5000',
|
||||
)
|
||||
|
||||
Mod('io',
|
||||
'frappy_psi.SR830.SR830_IO',
|
||||
'lockin communication',
|
||||
uri='tcp://linse-976d-ts:3002',
|
||||
)
|
||||
|
||||
Mod('XY',
|
||||
'frappy_psi.SR830.XY',
|
||||
'XY channels',
|
||||
io='io',
|
||||
)
|
@ -1,24 +0,0 @@
|
||||
Node('ft.config.sea.psi.ch',
|
||||
'FW ILL furnace with W5 thermnocouple (1800 K), old power rack',
|
||||
)
|
||||
|
||||
Mod('sea_main',
|
||||
'frappy_psi.sea.SeaClient',
|
||||
'main sea connection for fw.config',
|
||||
config='fw.config',
|
||||
service='main',
|
||||
)
|
||||
|
||||
Mod('ts',
|
||||
'frappy_psi.sea.SeaDrivable', '',
|
||||
io='sea_main',
|
||||
sea_object='tt',
|
||||
rel_paths=['.', 'ts'],
|
||||
)
|
||||
|
||||
Mod('t2',
|
||||
'frappy_psi.sea.SeaReadable', '',
|
||||
io='sea_main',
|
||||
sea_object='tt',
|
||||
rel_paths=['t2'],
|
||||
)
|
@ -83,5 +83,4 @@ Mod('om',
|
||||
target_min = -180,
|
||||
target_max = 360,
|
||||
encoder_mode='READ',
|
||||
backlash=-1,
|
||||
)
|
||||
|
@ -1,101 +0,0 @@
|
||||
Node('ma10.config.sea.psi.ch',
|
||||
'10 Tesla vertical cryomagnet',
|
||||
)
|
||||
|
||||
Mod('sea_main',
|
||||
'frappy_psi.sea.SeaClient',
|
||||
'main sea connection for ma10.config',
|
||||
config='ma10heat.config',
|
||||
service='main',
|
||||
)
|
||||
|
||||
Mod('ts',
|
||||
'frappy_psi.sea.SeaDrivable', '',
|
||||
io='sea_main',
|
||||
sea_object='tt',
|
||||
rel_paths=['ts', 'set']
|
||||
)
|
||||
|
||||
Mod('tm',
|
||||
'frappy_psi.sea.SeaReadable', '',
|
||||
io='sea_main',
|
||||
sea_object='tt',
|
||||
rel_paths=['tm', 'setvti']
|
||||
)
|
||||
|
||||
Mod('ts2',
|
||||
'frappy_psi.sea.SeaReadable', '',
|
||||
io='sea_main',
|
||||
sea_object='tt',
|
||||
rel_paths=['ts_2']
|
||||
)
|
||||
|
||||
Mod('cc',
|
||||
'frappy_psi.sea.SeaReadable', '',
|
||||
io='sea_main',
|
||||
sea_object='cc',
|
||||
)
|
||||
|
||||
Mod('nv',
|
||||
'frappy_psi.sea.SeaWritable', '',
|
||||
io='sea_main',
|
||||
sea_object='nv',
|
||||
)
|
||||
|
||||
Mod('hepump',
|
||||
'frappy_psi.sea.SeaWritable', '',
|
||||
io='sea_main',
|
||||
sea_object='hepump',
|
||||
)
|
||||
|
||||
Mod('hemot',
|
||||
'frappy_psi.sea.SeaDrivable', '',
|
||||
io='sea_main',
|
||||
sea_object='hemot',
|
||||
)
|
||||
|
||||
Mod('mf',
|
||||
'frappy_psi.sea.SeaDrivable', '',
|
||||
io='sea_main',
|
||||
sea_object='mf',
|
||||
)
|
||||
|
||||
Mod('lev',
|
||||
'frappy_psi.sea.SeaReadable', '',
|
||||
io='sea_main',
|
||||
sea_object='lev',
|
||||
)
|
||||
|
||||
Mod('ln2fill',
|
||||
'frappy_psi.sea.SeaWritable', '',
|
||||
io='sea_main',
|
||||
sea_object='ln2fill',
|
||||
)
|
||||
|
||||
Mod('hefill',
|
||||
'frappy_psi.sea.SeaWritable', '',
|
||||
io='sea_main',
|
||||
sea_object='hefill',
|
||||
)
|
||||
|
||||
Mod('table',
|
||||
'frappy_psi.sea.SeaReadable', '',
|
||||
io='sea_main',
|
||||
sea_object='table',
|
||||
)
|
||||
|
||||
Mod('om_io',
|
||||
'frappy_psi.phytron.PhytronIO',
|
||||
'dom motor IO',
|
||||
uri='ma10-ts.psi.ch:3004',
|
||||
)
|
||||
|
||||
Mod('om',
|
||||
'frappy_psi.phytron.Motor',
|
||||
'stick rotation, typically used for omega',
|
||||
io='om_io',
|
||||
sign=-1,
|
||||
target_min = -180,
|
||||
target_max = 360,
|
||||
encoder_mode='READ',
|
||||
)
|
@ -1,108 +0,0 @@
|
||||
Node('ma10.config.sea.psi.ch',
|
||||
'10 Tesla vertical cryomagnet',
|
||||
)
|
||||
|
||||
Mod('sea_main',
|
||||
'frappy_psi.sea.SeaClient',
|
||||
'main sea connection for ma10.config',
|
||||
config='ma10high_t.config',
|
||||
service='main',
|
||||
)
|
||||
|
||||
Mod('th',
|
||||
'frappy_psi.sea.SeaReadable',
|
||||
'sample heater temperature',
|
||||
io='sea_main',
|
||||
sea_object='tt',
|
||||
rel_paths=['ts', 'setsamp']
|
||||
)
|
||||
|
||||
Mod('tm',
|
||||
'frappy_psi.sea.SeaDrivable', '',
|
||||
io='sea_main',
|
||||
sea_object='tt',
|
||||
rel_paths=['tm', 'set']
|
||||
)
|
||||
|
||||
Mod('ts',
|
||||
'frappy_psi.parmod.Converging',
|
||||
'test for parmod',
|
||||
unit='K',
|
||||
read='th.value',
|
||||
write='th.setsamp',
|
||||
meaning=['temperature', 20],
|
||||
settling_time=20,
|
||||
tolerance=1,
|
||||
)
|
||||
|
||||
Mod('ts2',
|
||||
'frappy_psi.sea.SeaReadable', '',
|
||||
io='sea_main',
|
||||
sea_object='tt',
|
||||
rel_paths=['ts_2']
|
||||
)
|
||||
|
||||
Mod('cc',
|
||||
'frappy_psi.sea.SeaReadable', '',
|
||||
io='sea_main',
|
||||
sea_object='cc',
|
||||
)
|
||||
|
||||
Mod('nv',
|
||||
'frappy_psi.sea.SeaWritable', '',
|
||||
io='sea_main',
|
||||
sea_object='nv',
|
||||
)
|
||||
|
||||
Mod('hepump',
|
||||
'frappy_psi.sea.SeaWritable', '',
|
||||
io='sea_main',
|
||||
sea_object='hepump',
|
||||
)
|
||||
|
||||
Mod('hemot',
|
||||
'frappy_psi.sea.SeaDrivable', '',
|
||||
io='sea_main',
|
||||
sea_object='hemot',
|
||||
)
|
||||
|
||||
Mod('mf',
|
||||
'frappy_psi.sea.SeaDrivable', '',
|
||||
io='sea_main',
|
||||
sea_object='mf',
|
||||
)
|
||||
|
||||
Mod('lev',
|
||||
'frappy_psi.sea.SeaReadable', '',
|
||||
io='sea_main',
|
||||
sea_object='lev',
|
||||
)
|
||||
|
||||
Mod('ln2fill',
|
||||
'frappy_psi.sea.SeaWritable', '',
|
||||
io='sea_main',
|
||||
sea_object='ln2fill',
|
||||
)
|
||||
|
||||
Mod('hefill',
|
||||
'frappy_psi.sea.SeaWritable', '',
|
||||
io='sea_main',
|
||||
sea_object='hefill',
|
||||
)
|
||||
|
||||
Mod('om_io',
|
||||
'frappy_psi.phytron.PhytronIO',
|
||||
'dom motor IO',
|
||||
uri='ma10-ts.psi.ch:3004',
|
||||
)
|
||||
|
||||
Mod('om',
|
||||
'frappy_psi.phytron.Motor',
|
||||
'stick rotation, typically used for omega',
|
||||
io='om_io',
|
||||
sign=-1,
|
||||
target_min = -180,
|
||||
target_max = 360,
|
||||
encoder_mode='READ',
|
||||
)
|
||||
|
@ -13,7 +13,7 @@ Mod('tt',
|
||||
'frappy_psi.sea.SeaDrivable', '',
|
||||
io='sea_main',
|
||||
sea_object='tt',
|
||||
rel_paths=['tm', 'set', 'dblctrl'],
|
||||
rel_paths=['.', 'tm'],
|
||||
)
|
||||
|
||||
Mod('cc',
|
||||
|
@ -1,107 +0,0 @@
|
||||
Node('ma7.config.sea.psi.ch',
|
||||
'6.8 Tesla horizontal cryomagnet',
|
||||
)
|
||||
|
||||
Mod('sea_main',
|
||||
'frappy_psi.sea.SeaClient',
|
||||
'main sea connection for ma7.config',
|
||||
config='ma7_piezo.config',
|
||||
service='main',
|
||||
)
|
||||
|
||||
Mod('tt',
|
||||
'frappy_psi.sea.SeaDrivable', '',
|
||||
io='sea_main',
|
||||
sea_object='tt',
|
||||
rel_paths=['tm', 'set', 'dblctrl', 'voltage'],
|
||||
extra_modules=['manualpower'],
|
||||
)
|
||||
|
||||
Mod('cc',
|
||||
'frappy_psi.sea.SeaReadable', '',
|
||||
io='sea_main',
|
||||
sea_object='cc',
|
||||
)
|
||||
|
||||
Mod('nv',
|
||||
'frappy_psi.sea.SeaWritable', '',
|
||||
io='sea_main',
|
||||
sea_object='nv',
|
||||
)
|
||||
|
||||
Mod('hefill',
|
||||
'frappy_psi.sea.SeaWritable', '',
|
||||
io='sea_main',
|
||||
sea_object='hefill',
|
||||
)
|
||||
|
||||
Mod('hepump',
|
||||
'frappy_psi.sea.SeaWritable', '',
|
||||
io='sea_main',
|
||||
sea_object='hepump',
|
||||
)
|
||||
|
||||
Mod('hemot',
|
||||
'frappy_psi.sea.SeaDrivable', '',
|
||||
io='sea_main',
|
||||
sea_object='hemot',
|
||||
)
|
||||
|
||||
Mod('ln2fill',
|
||||
'frappy_psi.sea.SeaWritable', '',
|
||||
io='sea_main',
|
||||
sea_object='ln2fill',
|
||||
)
|
||||
|
||||
Mod('mf',
|
||||
'frappy_psi.sea.SeaDrivable', '',
|
||||
io='sea_main',
|
||||
sea_object='mf',
|
||||
value=Param(unit='T'),
|
||||
)
|
||||
|
||||
Mod('lev',
|
||||
'frappy_psi.sea.SeaReadable', '',
|
||||
io='sea_main',
|
||||
sea_object='lev',
|
||||
)
|
||||
|
||||
Mod('tcoil1',
|
||||
'frappy_psi.sea.SeaReadable', '',
|
||||
io='sea_main',
|
||||
sea_object='tcoil',
|
||||
rel_paths=['ta'],
|
||||
)
|
||||
|
||||
Mod('tcoil2',
|
||||
'frappy_psi.sea.SeaReadable', '',
|
||||
io='sea_main',
|
||||
sea_object='tcoil',
|
||||
rel_paths=['tb'],
|
||||
)
|
||||
|
||||
Mod('table',
|
||||
'frappy_psi.sea.SeaReadable', '',
|
||||
io='sea_main',
|
||||
sea_object='table',
|
||||
)
|
||||
|
||||
Mod('stick_io',
|
||||
'frappy_psi.phytron.PhytronIO',
|
||||
'dom motor IO',
|
||||
uri='ma7-ts.psi.ch:3007',
|
||||
)
|
||||
|
||||
Mod('stickrot',
|
||||
'frappy_psi.phytron.Motor',
|
||||
'stick rotation, typically not used as omega',
|
||||
io='stick_io',
|
||||
encoder_mode='CHECK',
|
||||
)
|
||||
|
||||
Mod('V',
|
||||
'frappy_psi.sea.SeaWritable',
|
||||
'voltage',
|
||||
io='sea_main',
|
||||
single_module='tt.manualpower',
|
||||
)
|
@ -36,8 +36,8 @@ Mod('ts',
|
||||
'frappy_psi.parmod.Converging',
|
||||
'test for parmod',
|
||||
unit='K',
|
||||
value_param='th.value',
|
||||
target_param='th.setsamp',
|
||||
read='th.value',
|
||||
write='th.setsamp',
|
||||
meaning=['temperature', 20],
|
||||
settling_time=20,
|
||||
tolerance=1,
|
||||
|
@ -1,128 +0,0 @@
|
||||
Node('ma7_thermalc.config.sea.psi.ch',
|
||||
'''6.8 Tesla horizontal cryomagnet for thrermalcond''',
|
||||
)
|
||||
Mod('sea_main',
|
||||
'frappy_psi.sea.SeaClient',
|
||||
'main sea connection for ma7_thermalc.config',
|
||||
config = 'ma7_thermalc.config',
|
||||
service = 'main',
|
||||
)
|
||||
#Mod('tt',
|
||||
# 'frappy_psi.sea.SeaDrivable', '',
|
||||
# io='sea_main',
|
||||
# sea_object='tt',
|
||||
# rel_paths=['.', 'tm'],
|
||||
#)
|
||||
|
||||
Mod('tt',
|
||||
'frappy_psi.sea.SeaDrivable', '',
|
||||
io='sea_main',
|
||||
sea_object='tt',
|
||||
rel_paths=['tm', 'set'],
|
||||
)
|
||||
|
||||
Mod('th',
|
||||
'frappy_psi.sea.SeaReadable',
|
||||
'sample heater temperature',
|
||||
io='sea_main',
|
||||
sea_object='tt',
|
||||
rel_paths=['ts', 'setsamp']
|
||||
)
|
||||
|
||||
Mod('ts',
|
||||
'frappy_psi.parmod.Converging',
|
||||
'test for parmod',
|
||||
unit='K',
|
||||
value_param='th.value',
|
||||
target_param='th.setsamp',
|
||||
meaning=['temperature', 20],
|
||||
settling_time=20,
|
||||
tolerance=1,
|
||||
)
|
||||
|
||||
Mod('samph',
|
||||
'frappy_psi.sea.SeaWritable', '',
|
||||
io='sea_main',
|
||||
sea_object='tt',
|
||||
rel_paths=['setsamp','power'],
|
||||
)
|
||||
|
||||
|
||||
Mod('cc',
|
||||
'frappy_psi.sea.SeaReadable', '',
|
||||
io = 'sea_main',
|
||||
sea_object = 'cc',
|
||||
)
|
||||
Mod('nv',
|
||||
'frappy_psi.sea.SeaWritable', '',
|
||||
io = 'sea_main',
|
||||
sea_object = 'nv',
|
||||
)
|
||||
Mod('hefill',
|
||||
'frappy_psi.sea.SeaWritable', '',
|
||||
io = 'sea_main',
|
||||
sea_object = 'hefill',
|
||||
)
|
||||
Mod('hepump',
|
||||
'frappy_psi.sea.SeaWritable', '',
|
||||
io = 'sea_main',
|
||||
sea_object = 'hepump',
|
||||
)
|
||||
Mod('hemot',
|
||||
'frappy_psi.sea.SeaDrivable', '',
|
||||
io = 'sea_main',
|
||||
sea_object = 'hemot',
|
||||
)
|
||||
Mod('nvflow',
|
||||
'frappy_psi.sea.SeaReadable', '',
|
||||
io = 'sea_main',
|
||||
sea_object = 'nvflow',
|
||||
)
|
||||
Mod('ln2fill',
|
||||
'frappy_psi.sea.SeaWritable', '',
|
||||
io = 'sea_main',
|
||||
sea_object = 'ln2fill',
|
||||
)
|
||||
Mod('mf',
|
||||
'frappy_psi.sea.SeaDrivable', '',
|
||||
io = 'sea_main',
|
||||
sea_object = 'mf',
|
||||
)
|
||||
Mod('lev',
|
||||
'frappy_psi.sea.SeaReadable', '',
|
||||
io = 'sea_main',
|
||||
sea_object = 'lev',
|
||||
)
|
||||
|
||||
Mod('tcoil1',
|
||||
'frappy_psi.sea.SeaReadable', '',
|
||||
io='sea_main',
|
||||
sea_object='tcoil',
|
||||
rel_paths=['ta'],
|
||||
)
|
||||
|
||||
Mod('tcoil2',
|
||||
'frappy_psi.sea.SeaReadable', '',
|
||||
io='sea_main',
|
||||
sea_object='tcoil',
|
||||
rel_paths=['tb'],
|
||||
)
|
||||
|
||||
Mod('table',
|
||||
'frappy_psi.sea.SeaReadable', '',
|
||||
io = 'sea_main',
|
||||
sea_object = 'table',
|
||||
)
|
||||
|
||||
Mod('stick_io',
|
||||
'frappy_psi.phytron.PhytronIO',
|
||||
'dom motor IO',
|
||||
uri='ma7-ts.psi.ch:3007',
|
||||
)
|
||||
|
||||
Mod('stickrot',
|
||||
'frappy_psi.phytron.Motor',
|
||||
'stick rotation, typically not used as omega',
|
||||
io='stick_io',
|
||||
encoder_mode='CHECK',
|
||||
)
|
@ -9,12 +9,19 @@ Mod('sea_main',
|
||||
service='main',
|
||||
)
|
||||
|
||||
Mod('tt',
|
||||
Mod('t',
|
||||
'frappy_psi.sea.SeaDrivable', '',
|
||||
io='sea_main',
|
||||
sea_object='tt',
|
||||
)
|
||||
|
||||
Mod('tm',
|
||||
'frappy_psi.sea.SeaDrivable', '',
|
||||
io='sea_main',
|
||||
sea_object='tt',
|
||||
rel_paths=['tm'],
|
||||
)
|
||||
|
||||
Mod('cc',
|
||||
'frappy_psi.sea.SeaReadable', '',
|
||||
io='sea_main',
|
||||
|
34
cfg/multimeter_cfg.py
Normal file
34
cfg/multimeter_cfg.py
Normal file
@ -0,0 +1,34 @@
|
||||
Node('multimetertest.psi.ch',
|
||||
'multimeter test',
|
||||
'tcp://5000',
|
||||
)
|
||||
|
||||
Mod('io',
|
||||
'frappy_psi.HP.HP_IO',
|
||||
'multimeter communication',
|
||||
uri='/dev/cu.usbserial-21410',
|
||||
)
|
||||
|
||||
Mod('Voltage',
|
||||
'frappy_psi.HP.Voltage',
|
||||
'voltage',
|
||||
io='io',
|
||||
)
|
||||
|
||||
Mod('Current',
|
||||
'frappy_psi.HP.Current',
|
||||
'current',
|
||||
io='io',
|
||||
)
|
||||
|
||||
Mod('Resistance',
|
||||
'frappy_psi.HP.Resistance',
|
||||
'resistivity',
|
||||
io='io',
|
||||
)
|
||||
|
||||
Mod('Frequency',
|
||||
'frappy_psi.HP.Frequency',
|
||||
'resistivity',
|
||||
io='io',
|
||||
)
|
@ -54,6 +54,8 @@
|
||||
{"path": "set/integ", "type": "float", "readonly": false, "cmd": "tt set/integ", "description": "bigger means faster"},
|
||||
{"path": "set/deriv", "type": "float", "readonly": false, "cmd": "tt set/deriv"},
|
||||
{"path": "display", "type": "text", "readonly": false, "cmd": "tt display"},
|
||||
{"path": "dout", "type": "int", "readonly": false, "cmd": "tt dout"},
|
||||
{"path": "dinp", "type": "int"},
|
||||
{"path": "remote", "type": "bool"}]}, "cc": {"base": "/cc", "params": [{"path": "", "type": "bool", "kids": 96},
|
||||
{"path": "send", "type": "text", "readonly": false, "cmd": "cc send", "visibility": 3},
|
||||
{"path": "status", "type": "text", "visibility": 3},
|
||||
|
@ -60,6 +60,8 @@
|
||||
{"path": "set/integ", "type": "float", "readonly": false, "cmd": "tt set/integ", "description": "bigger means faster"},
|
||||
{"path": "set/deriv", "type": "float", "readonly": false, "cmd": "tt set/deriv"},
|
||||
{"path": "display", "type": "text", "readonly": false, "cmd": "tt display"},
|
||||
{"path": "dout", "type": "int", "readonly": false, "cmd": "tt dout"},
|
||||
{"path": "dinp", "type": "int"},
|
||||
{"path": "remote", "type": "bool"}]}, "cc": {"base": "/cc", "params": [{"path": "", "type": "bool", "kids": 96},
|
||||
{"path": "send", "type": "text", "readonly": false, "cmd": "cc send", "visibility": 3},
|
||||
{"path": "status", "type": "text", "visibility": 3},
|
||||
|
@ -56,6 +56,8 @@
|
||||
{"path": "set/integ", "type": "float", "readonly": false, "cmd": "tt set/integ", "description": "bigger means faster"},
|
||||
{"path": "set/deriv", "type": "float", "readonly": false, "cmd": "tt set/deriv"},
|
||||
{"path": "display", "type": "text", "readonly": false, "cmd": "tt display"},
|
||||
{"path": "dout", "type": "int", "readonly": false, "cmd": "tt dout"},
|
||||
{"path": "dinp", "type": "int"},
|
||||
{"path": "remote", "type": "bool"}]},
|
||||
|
||||
"cc": {"base": "/cc", "params": [
|
||||
|
@ -50,6 +50,8 @@
|
||||
{"path": "set/integ", "type": "float", "readonly": false, "cmd": "tt set/integ", "description": "bigger means faster"},
|
||||
{"path": "set/deriv", "type": "float", "readonly": false, "cmd": "tt set/deriv"},
|
||||
{"path": "display", "type": "text", "readonly": false, "cmd": "tt display"},
|
||||
{"path": "dout", "type": "int", "readonly": false, "cmd": "tt dout"},
|
||||
{"path": "dinp", "type": "int"},
|
||||
{"path": "remote", "type": "bool"}]},
|
||||
|
||||
"cc": {"base": "/cc", "params": [
|
||||
|
@ -50,4 +50,6 @@
|
||||
{"path": "set/integ", "type": "float", "readonly": false, "cmd": "tt set/integ", "description": "bigger means faster"},
|
||||
{"path": "set/deriv", "type": "float", "readonly": false, "cmd": "tt set/deriv"},
|
||||
{"path": "display", "type": "text", "readonly": false, "cmd": "tt display"},
|
||||
{"path": "dout", "type": "int", "readonly": false, "cmd": "tt dout"},
|
||||
{"path": "dinp", "type": "int"},
|
||||
{"path": "remote", "type": "bool"}]}}
|
||||
|
@ -56,4 +56,6 @@
|
||||
{"path": "set/integ", "type": "float", "readonly": false, "cmd": "tt set/integ", "description": "bigger means faster"},
|
||||
{"path": "set/deriv", "type": "float", "readonly": false, "cmd": "tt set/deriv"},
|
||||
{"path": "display", "type": "text", "readonly": false, "cmd": "tt display"},
|
||||
{"path": "dout", "type": "int", "readonly": false, "cmd": "tt dout"},
|
||||
{"path": "dinp", "type": "int"},
|
||||
{"path": "remote", "type": "bool"}]}}
|
||||
|
@ -56,6 +56,8 @@
|
||||
{"path": "set/integ", "type": "float", "readonly": false, "cmd": "tt set/integ", "description": "bigger means faster"},
|
||||
{"path": "set/deriv", "type": "float", "readonly": false, "cmd": "tt set/deriv"},
|
||||
{"path": "display", "type": "text", "readonly": false, "cmd": "tt display"},
|
||||
{"path": "dout", "type": "int", "readonly": false, "cmd": "tt dout"},
|
||||
{"path": "dinp", "type": "int"},
|
||||
{"path": "remote", "type": "bool"}]},
|
||||
|
||||
"cc": {"base": "/cc", "params": [
|
||||
|
@ -68,6 +68,8 @@
|
||||
{"path": "set/integ", "type": "float", "readonly": false, "cmd": "tt set/integ", "description": "bigger means faster"},
|
||||
{"path": "set/deriv", "type": "float", "readonly": false, "cmd": "tt set/deriv"},
|
||||
{"path": "display", "type": "text", "readonly": false, "cmd": "tt display"},
|
||||
{"path": "dout", "type": "int", "readonly": false, "cmd": "tt dout"},
|
||||
{"path": "dinp", "type": "int"},
|
||||
{"path": "remote", "type": "bool"}]},
|
||||
|
||||
"table": {"base": "/table", "params": [
|
||||
|
@ -62,6 +62,8 @@
|
||||
{"path": "set/integ", "type": "float", "readonly": false, "cmd": "tt set/integ", "description": "bigger means faster"},
|
||||
{"path": "set/deriv", "type": "float", "readonly": false, "cmd": "tt set/deriv"},
|
||||
{"path": "display", "type": "text", "readonly": false, "cmd": "tt display"},
|
||||
{"path": "dout", "type": "int", "readonly": false, "cmd": "tt dout"},
|
||||
{"path": "dinp", "type": "int"},
|
||||
{"path": "remote", "type": "bool"}]},
|
||||
|
||||
"table": {"base": "/table", "params": [
|
||||
|
@ -62,6 +62,8 @@
|
||||
{"path": "set/integ", "type": "float", "readonly": false, "cmd": "tt set/integ", "description": "bigger means faster"},
|
||||
{"path": "set/deriv", "type": "float", "readonly": false, "cmd": "tt set/deriv"},
|
||||
{"path": "display", "type": "text", "readonly": false, "cmd": "tt display"},
|
||||
{"path": "dout", "type": "int", "readonly": false, "cmd": "tt dout"},
|
||||
{"path": "dinp", "type": "int"},
|
||||
{"path": "remote", "type": "bool"}]},
|
||||
|
||||
"cc": {"base": "/cc", "params": [
|
||||
|
@ -62,6 +62,8 @@
|
||||
{"path": "set/integ", "type": "float", "readonly": false, "cmd": "tt set/integ", "description": "bigger means faster"},
|
||||
{"path": "set/deriv", "type": "float", "readonly": false, "cmd": "tt set/deriv"},
|
||||
{"path": "display", "type": "text", "readonly": false, "cmd": "tt display"},
|
||||
{"path": "dout", "type": "int", "readonly": false, "cmd": "tt dout"},
|
||||
{"path": "dinp", "type": "int"},
|
||||
{"path": "remote", "type": "bool"}]},
|
||||
|
||||
"cc": {"base": "/cc", "params": [
|
||||
|
@ -62,6 +62,8 @@
|
||||
{"path": "set/integ", "type": "float", "readonly": false, "cmd": "tt set/integ", "description": "bigger means faster"},
|
||||
{"path": "set/deriv", "type": "float", "readonly": false, "cmd": "tt set/deriv"},
|
||||
{"path": "display", "type": "text", "readonly": false, "cmd": "tt display"},
|
||||
{"path": "dout", "type": "int", "readonly": false, "cmd": "tt dout"},
|
||||
{"path": "dinp", "type": "int"},
|
||||
{"path": "remote", "type": "bool"}]},
|
||||
|
||||
"cc": {"base": "/cc", "params": [
|
||||
|
@ -72,7 +72,8 @@
|
||||
{"path": "min_cpl", "type": "float", "readonly": false, "cmd": "pauto min_cpl"},
|
||||
{"path": "max_cpl", "type": "float", "readonly": false, "cmd": "pauto max_cpl"},
|
||||
{"path": "fact_cpl", "type": "float", "readonly": false, "cmd": "pauto fact_cpl"},
|
||||
{"path": "max_ramp", "type": "float", "readonly": false, "cmd": "pauto max_ramp"}]},
|
||||
{"path": "max_ramp", "type": "float", "readonly": false, "cmd": "pauto max_ramp"},
|
||||
{"path": "target", "type": "float"}]},
|
||||
|
||||
"tc": {"base": "/tc", "params": [
|
||||
{"path": "", "type": "float", "readonly": false, "cmd": "run tc", "description": "tc", "kids": 15},
|
||||
|
@ -63,6 +63,8 @@
|
||||
{"path": "set/deriv", "type": "float", "readonly": false, "cmd": "tt set/deriv"},
|
||||
{"path": "setsamp", "type": "float", "readonly": false, "cmd": "tt setsamp"},
|
||||
{"path": "display", "type": "text", "readonly": false, "cmd": "tt display"},
|
||||
{"path": "dout", "type": "int", "readonly": false, "cmd": "tt dout"},
|
||||
{"path": "dinp", "type": "int"},
|
||||
{"path": "remote", "type": "bool"}]},
|
||||
|
||||
"cc": {"base": "/cc", "params": [
|
||||
|
@ -1,395 +0,0 @@
|
||||
{"tt": {"base": "/tt", "params": [
|
||||
{"path": "", "type": "float", "readonly": false, "cmd": "run tt", "description": "tt", "kids": 18},
|
||||
{"path": "send", "type": "text", "readonly": false, "cmd": "tt send", "visibility": 3},
|
||||
{"path": "status", "type": "text", "visibility": 3},
|
||||
{"path": "is_running", "type": "int", "readonly": false, "cmd": "tt is_running", "visibility": 3},
|
||||
{"path": "mainloop", "type": "text", "readonly": false, "cmd": "tt mainloop", "visibility": 3},
|
||||
{"path": "target", "type": "float"},
|
||||
{"path": "running", "type": "int"},
|
||||
{"path": "tolerance", "type": "float", "readonly": false, "cmd": "tt tolerance"},
|
||||
{"path": "maxwait", "type": "float", "readonly": false, "cmd": "tt maxwait"},
|
||||
{"path": "settle", "type": "float", "readonly": false, "cmd": "tt settle"},
|
||||
{"path": "log", "type": "text", "readonly": false, "cmd": "tt log", "visibility": 3, "kids": 4},
|
||||
{"path": "log/mean", "type": "float", "visibility": 3},
|
||||
{"path": "log/m2", "type": "float", "visibility": 3},
|
||||
{"path": "log/stddev", "type": "float", "visibility": 3},
|
||||
{"path": "log/n", "type": "float", "visibility": 3},
|
||||
{"path": "dblctrl", "type": "bool", "readonly": false, "cmd": "tt dblctrl", "kids": 9},
|
||||
{"path": "dblctrl/tshift", "type": "float", "readonly": false, "cmd": "tt dblctrl/tshift"},
|
||||
{"path": "dblctrl/mode", "type": "enum", "enum": {"disabled": -1, "inactive": 0, "stable": 1, "up": 2, "down": 3}, "readonly": false, "cmd": "tt dblctrl/mode"},
|
||||
{"path": "dblctrl/shift_up", "type": "float"},
|
||||
{"path": "dblctrl/shift_lo", "type": "float"},
|
||||
{"path": "dblctrl/t_min", "type": "float"},
|
||||
{"path": "dblctrl/t_max", "type": "float"},
|
||||
{"path": "dblctrl/int2", "type": "float", "readonly": false, "cmd": "tt dblctrl/int2"},
|
||||
{"path": "dblctrl/prop_up", "type": "float", "readonly": false, "cmd": "tt dblctrl/prop_up"},
|
||||
{"path": "dblctrl/prop_lo", "type": "float", "readonly": false, "cmd": "tt dblctrl/prop_lo"},
|
||||
{"path": "tm", "type": "float", "kids": 4},
|
||||
{"path": "tm/curve", "type": "text", "readonly": false, "cmd": "tt tm/curve", "kids": 1},
|
||||
{"path": "tm/curve/points", "type": "floatvarar", "readonly": false, "cmd": "tt tm/curve/points", "visibility": 3},
|
||||
{"path": "tm/alarm", "type": "float", "readonly": false, "cmd": "tt tm/alarm"},
|
||||
{"path": "tm/stddev", "type": "float"},
|
||||
{"path": "tm/raw", "type": "float"},
|
||||
{"path": "ts", "type": "float", "kids": 4},
|
||||
{"path": "ts/curve", "type": "text", "readonly": false, "cmd": "tt ts/curve", "kids": 1},
|
||||
{"path": "ts/curve/points", "type": "floatvarar", "readonly": false, "cmd": "tt ts/curve/points", "visibility": 3},
|
||||
{"path": "ts/alarm", "type": "float", "readonly": false, "cmd": "tt ts/alarm"},
|
||||
{"path": "ts/stddev", "type": "float"},
|
||||
{"path": "ts/raw", "type": "float"},
|
||||
{"path": "ts_2", "type": "float", "kids": 4},
|
||||
{"path": "ts_2/curve", "type": "text", "readonly": false, "cmd": "tt ts_2/curve", "kids": 1},
|
||||
{"path": "ts_2/curve/points", "type": "floatvarar", "readonly": false, "cmd": "tt ts_2/curve/points", "visibility": 3},
|
||||
{"path": "ts_2/alarm", "type": "float", "readonly": false, "cmd": "tt ts_2/alarm"},
|
||||
{"path": "ts_2/stddev", "type": "float"},
|
||||
{"path": "ts_2/raw", "type": "float"},
|
||||
{"path": "set", "type": "float", "readonly": false, "cmd": "tt set", "kids": 18},
|
||||
{"path": "set/mode", "type": "enum", "enum": {"disabled": -1, "off": 0, "controlling": 1, "manual": 2}, "readonly": false, "cmd": "tt set/mode"},
|
||||
{"path": "set/reg", "type": "float"},
|
||||
{"path": "set/ramp", "type": "float", "readonly": false, "cmd": "tt set/ramp", "description": "maximum ramp in K/min (0: ramp off)"},
|
||||
{"path": "set/wramp", "type": "float", "readonly": false, "cmd": "tt set/wramp"},
|
||||
{"path": "set/smooth", "type": "float", "readonly": false, "cmd": "tt set/smooth", "description": "smooth time (minutes)"},
|
||||
{"path": "set/channel", "type": "text", "readonly": false, "cmd": "tt set/channel"},
|
||||
{"path": "set/limit", "type": "float", "readonly": false, "cmd": "tt set/limit"},
|
||||
{"path": "set/resist", "type": "float", "readonly": false, "cmd": "tt set/resist"},
|
||||
{"path": "set/maxheater", "type": "text", "readonly": false, "cmd": "tt set/maxheater", "description": "maximum heater limit, units should be given without space: W, mW, A, mA"},
|
||||
{"path": "set/linearpower", "type": "float", "readonly": false, "cmd": "tt set/linearpower", "description": "when not 0, it is the maximum effective power, and the power is linear to the heater output"},
|
||||
{"path": "set/maxpowerlim", "type": "float", "description": "the maximum power limit (before any booster or converter)"},
|
||||
{"path": "set/maxpower", "type": "float", "readonly": false, "cmd": "tt set/maxpower", "description": "maximum power [W]"},
|
||||
{"path": "set/maxcurrent", "type": "float", "description": "the maximum current before any booster or converter"},
|
||||
{"path": "set/manualpower", "type": "float", "readonly": false, "cmd": "tt set/manualpower"},
|
||||
{"path": "set/power", "type": "float"},
|
||||
{"path": "set/prop", "type": "float", "readonly": false, "cmd": "tt set/prop", "description": "bigger means more gain"},
|
||||
{"path": "set/integ", "type": "float", "readonly": false, "cmd": "tt set/integ", "description": "bigger means faster"},
|
||||
{"path": "set/deriv", "type": "float", "readonly": false, "cmd": "tt set/deriv"},
|
||||
{"path": "setvti", "type": "float", "readonly": false, "cmd": "tt setvti", "kids": 18},
|
||||
{"path": "setvti/mode", "type": "enum", "enum": {"disabled": -1, "off": 0, "controlling": 1, "manual": 2}, "readonly": false, "cmd": "tt setvti/mode"},
|
||||
{"path": "setvti/reg", "type": "float"},
|
||||
{"path": "setvti/ramp", "type": "float", "readonly": false, "cmd": "tt setvti/ramp", "description": "maximum ramp in K/min (0: ramp off)"},
|
||||
{"path": "setvti/wramp", "type": "float", "readonly": false, "cmd": "tt setvti/wramp"},
|
||||
{"path": "setvti/smooth", "type": "float", "readonly": false, "cmd": "tt setvti/smooth", "description": "smooth time (minutes)"},
|
||||
{"path": "setvti/channel", "type": "text", "readonly": false, "cmd": "tt setvti/channel"},
|
||||
{"path": "setvti/limit", "type": "float", "readonly": false, "cmd": "tt setvti/limit"},
|
||||
{"path": "setvti/resist", "type": "float", "readonly": false, "cmd": "tt setvti/resist"},
|
||||
{"path": "setvti/maxheater", "type": "text", "readonly": false, "cmd": "tt setvti/maxheater", "description": "maximum heater limit, units should be given without space: W, mW, A, mA"},
|
||||
{"path": "setvti/linearpower", "type": "float", "readonly": false, "cmd": "tt setvti/linearpower", "description": "when not 0, it is the maximum effective power, and the power is linear to the heater output"},
|
||||
{"path": "setvti/maxpowerlim", "type": "float", "description": "the maximum power limit (before any booster or converter)"},
|
||||
{"path": "setvti/maxpower", "type": "float", "readonly": false, "cmd": "tt setvti/maxpower", "description": "maximum power [W]"},
|
||||
{"path": "setvti/maxcurrent", "type": "float", "description": "the maximum current before any booster or converter"},
|
||||
{"path": "setvti/manualpower", "type": "float", "readonly": false, "cmd": "tt setvti/manualpower"},
|
||||
{"path": "setvti/power", "type": "float"},
|
||||
{"path": "setvti/prop", "type": "float", "readonly": false, "cmd": "tt setvti/prop", "description": "bigger means more gain"},
|
||||
{"path": "setvti/integ", "type": "float", "readonly": false, "cmd": "tt setvti/integ", "description": "bigger means faster"},
|
||||
{"path": "setvti/deriv", "type": "float", "readonly": false, "cmd": "tt setvti/deriv"},
|
||||
{"path": "display", "type": "text", "readonly": false, "cmd": "tt display"},
|
||||
{"path": "remote", "type": "bool"}]},
|
||||
|
||||
"cc": {"base": "/cc", "params": [
|
||||
{"path": "", "type": "bool", "kids": 96},
|
||||
{"path": "send", "type": "text", "readonly": false, "cmd": "cc send", "visibility": 3},
|
||||
{"path": "status", "type": "text", "visibility": 3},
|
||||
{"path": "autodevice", "type": "bool", "readonly": false, "cmd": "cc autodevice"},
|
||||
{"path": "fav", "type": "bool", "readonly": false, "cmd": "cc fav"},
|
||||
{"path": "f", "type": "float"},
|
||||
{"path": "fs", "type": "enum", "enum": {"ok": 0, "no_sens": 1}, "readonly": false, "cmd": "cc fs"},
|
||||
{"path": "mav", "type": "bool", "readonly": false, "cmd": "cc mav"},
|
||||
{"path": "fm", "type": "enum", "enum": {"idle": 0, "opening": 1, "closing": 2, "opened": 3, "closed": 4, "no_motor": 5}},
|
||||
{"path": "fa", "type": "enum", "enum": {"fixed": 0, "controlled": 1, "automatic": 2, "offline": 3}, "readonly": false, "cmd": "cc fa"},
|
||||
{"path": "mp", "type": "float", "readonly": false, "cmd": "cc mp"},
|
||||
{"path": "msp", "type": "float"},
|
||||
{"path": "mmp", "type": "float"},
|
||||
{"path": "mc", "type": "float", "readonly": false, "cmd": "cc mc"},
|
||||
{"path": "mfc", "type": "float", "readonly": false, "cmd": "cc mfc"},
|
||||
{"path": "moc", "type": "float", "readonly": false, "cmd": "cc moc"},
|
||||
{"path": "mtc", "type": "float", "readonly": false, "cmd": "cc mtc"},
|
||||
{"path": "mtl", "type": "float"},
|
||||
{"path": "mft", "type": "float", "readonly": false, "cmd": "cc mft"},
|
||||
{"path": "mt", "type": "float"},
|
||||
{"path": "mo", "type": "float"},
|
||||
{"path": "mcr", "type": "float"},
|
||||
{"path": "mot", "type": "float"},
|
||||
{"path": "mw", "type": "float", "readonly": false, "cmd": "cc mw", "description": "correction pulse after automatic open"},
|
||||
{"path": "hav", "type": "bool", "readonly": false, "cmd": "cc hav"},
|
||||
{"path": "h", "type": "float"},
|
||||
{"path": "hr", "type": "float"},
|
||||
{"path": "hc", "type": "float"},
|
||||
{"path": "hu", "type": "float"},
|
||||
{"path": "hh", "type": "float", "readonly": false, "cmd": "cc hh"},
|
||||
{"path": "hl", "type": "float", "readonly": false, "cmd": "cc hl"},
|
||||
{"path": "htf", "type": "float", "readonly": false, "cmd": "cc htf", "description": "meas. period in fast mode"},
|
||||
{"path": "hts", "type": "float", "readonly": false, "cmd": "cc hts", "description": "meas. period in slow mode"},
|
||||
{"path": "hd", "type": "float", "readonly": false, "cmd": "cc hd"},
|
||||
{"path": "hwr", "type": "float", "readonly": false, "cmd": "cc hwr"},
|
||||
{"path": "hem", "type": "float", "readonly": false, "cmd": "cc hem", "description": "sensor length in mm from top to empty pos."},
|
||||
{"path": "hfu", "type": "float", "readonly": false, "cmd": "cc hfu", "description": "sensor length in mm from top to full pos."},
|
||||
{"path": "hcd", "type": "enum", "enum": {"stop": 0, "fill": 1, "off": 2, "auto": 3, "manual": 7}, "readonly": false, "cmd": "cc hcd"},
|
||||
{"path": "hv", "type": "enum", "enum": {"fill_valve_off": 0, "filling": 1, "no_fill_valve": 2, "timeout": 3, "timeout1": 4}},
|
||||
{"path": "hsf", "type": "enum", "enum": {"sens_ok": 0, "sens_warm": 1, "no_sens": 2, "timeout": 3, "not_yet_read": 4, "disabled": 5}},
|
||||
{"path": "ha", "type": "bool", "readonly": false, "cmd": "cc ha"},
|
||||
{"path": "hm", "type": "bool"},
|
||||
{"path": "hf", "type": "enum", "enum": {"slow": 0, "fast": 1}, "readonly": false, "cmd": "cc hf"},
|
||||
{"path": "hbe", "type": "bool", "readonly": false, "cmd": "cc hbe"},
|
||||
{"path": "hmf", "type": "float"},
|
||||
{"path": "hms", "type": "float"},
|
||||
{"path": "hit", "type": "float", "readonly": false, "cmd": "cc hit"},
|
||||
{"path": "hft", "type": "int", "readonly": false, "cmd": "cc hft"},
|
||||
{"path": "hea", "type": "enum", "enum": {"0": 0, "1": 1, "6": 6}, "readonly": false, "cmd": "cc hea"},
|
||||
{"path": "hch", "type": "int", "readonly": false, "cmd": "cc hch", "visibility": 3},
|
||||
{"path": "hwr0", "type": "float", "readonly": false, "cmd": "cc hwr0", "visibility": 3},
|
||||
{"path": "hem0", "type": "float", "readonly": false, "cmd": "cc hem0", "description": "sensor length in mm from top to empty pos.", "visibility": 3},
|
||||
{"path": "hfu0", "type": "float", "readonly": false, "cmd": "cc hfu0", "description": "sensor length in mm from top to full pos.", "visibility": 3},
|
||||
{"path": "hd0", "type": "float", "readonly": false, "cmd": "cc hd0", "description": "external sensor drive current (mA)", "visibility": 3},
|
||||
{"path": "h0", "type": "float", "visibility": 3},
|
||||
{"path": "hs0", "type": "enum", "enum": {"sens_ok": 0, "sens_warm": 1, "no_sens": 2, "timeout": 3, "not_yet_read": 4, "disabled": 5}, "visibility": 3},
|
||||
{"path": "h1", "type": "float", "visibility": 3},
|
||||
{"path": "hs1", "type": "enum", "enum": {"sens_ok": 0, "sens_warm": 1, "no_sens": 2, "timeout": 3, "not_yet_read": 4, "disabled": 5}, "visibility": 3},
|
||||
{"path": "h2", "type": "float", "visibility": 3},
|
||||
{"path": "hs2", "type": "enum", "enum": {"sens_ok": 0, "sens_warm": 1, "no_sens": 2, "timeout": 3, "not_yet_read": 4, "disabled": 5}, "visibility": 3},
|
||||
{"path": "h3", "type": "float", "visibility": 3},
|
||||
{"path": "hs3", "type": "enum", "enum": {"sens_ok": 0, "sens_warm": 1, "no_sens": 2, "timeout": 3, "not_yet_read": 4, "disabled": 5}, "visibility": 3},
|
||||
{"path": "h4", "type": "float", "visibility": 3},
|
||||
{"path": "hs4", "type": "enum", "enum": {"sens_ok": 0, "sens_warm": 1, "no_sens": 2, "timeout": 3, "not_yet_read": 4, "disabled": 5}, "visibility": 3},
|
||||
{"path": "h5", "type": "float", "visibility": 3},
|
||||
{"path": "hs5", "type": "enum", "enum": {"sens_ok": 0, "sens_warm": 1, "no_sens": 2, "timeout": 3, "not_yet_read": 4, "disabled": 5}, "visibility": 3},
|
||||
{"path": "hfb", "type": "float"},
|
||||
{"path": "nav", "type": "bool", "readonly": false, "cmd": "cc nav"},
|
||||
{"path": "nu", "type": "float"},
|
||||
{"path": "nl", "type": "float"},
|
||||
{"path": "nth", "type": "float", "readonly": false, "cmd": "cc nth"},
|
||||
{"path": "ntc", "type": "float", "readonly": false, "cmd": "cc ntc"},
|
||||
{"path": "ntm", "type": "float", "readonly": false, "cmd": "cc ntm"},
|
||||
{"path": "ns", "type": "enum", "enum": {"sens_ok": 0, "no_sens": 1, "short_circuit": 2, "upside_down": 3, "sens_warm": 4, "empty": 5}},
|
||||
{"path": "na", "type": "bool", "readonly": false, "cmd": "cc na"},
|
||||
{"path": "nv", "type": "enum", "enum": {"fill_valve_off": 0, "filling": 1, "no_fill_valve": 2, "timeout": 3, "timeout1": 4, "boost": 5}},
|
||||
{"path": "nc", "type": "enum", "enum": {"stop": 0, "fill": 1, "off": 2, "auto": 3}, "readonly": false, "cmd": "cc nc"},
|
||||
{"path": "nfb", "type": "float"},
|
||||
{"path": "cda", "type": "float"},
|
||||
{"path": "cdb", "type": "float"},
|
||||
{"path": "cba", "type": "float"},
|
||||
{"path": "cbb", "type": "float"},
|
||||
{"path": "cvs", "type": "int"},
|
||||
{"path": "csp", "type": "int"},
|
||||
{"path": "cdv", "type": "text", "readonly": false, "cmd": "cc cdv"},
|
||||
{"path": "cic", "type": "text", "readonly": false, "cmd": "cc cic"},
|
||||
{"path": "cin", "type": "text"},
|
||||
{"path": "cds", "type": "enum", "enum": {"local": 0, "remote": 1, "loading": 2, "by_code": 3, "by_touch": 4}, "readonly": false, "cmd": "cc cds"},
|
||||
{"path": "timing", "type": "bool", "readonly": false, "cmd": "cc timing"},
|
||||
{"path": "tc", "type": "float", "visibility": 3},
|
||||
{"path": "tn", "type": "float", "visibility": 3},
|
||||
{"path": "th", "type": "float", "visibility": 3},
|
||||
{"path": "tf", "type": "float", "visibility": 3},
|
||||
{"path": "tm", "type": "float", "visibility": 3},
|
||||
{"path": "tv", "type": "float", "visibility": 3},
|
||||
{"path": "tq", "type": "float", "visibility": 3},
|
||||
{"path": "bdl", "type": "float", "readonly": false, "cmd": "cc bdl"}]},
|
||||
|
||||
"nv": {"base": "/nv", "params": [
|
||||
{"path": "", "type": "enum", "enum": {"fixed": 0, "controlled": 1, "automatic": 2, "close": 3, "open": 4}, "readonly": false, "cmd": "nv", "kids": 11},
|
||||
{"path": "send", "type": "text", "readonly": false, "cmd": "nv send", "visibility": 3},
|
||||
{"path": "status", "type": "text", "visibility": 3},
|
||||
{"path": "motstat", "type": "enum", "enum": {"idle": 0, "opening": 1, "closing": 2, "opened": 3, "closed": 4, "no_motor": 5}},
|
||||
{"path": "flow", "type": "float"},
|
||||
{"path": "set", "type": "float", "readonly": false, "cmd": "nv set"},
|
||||
{"path": "flowmax", "type": "float", "readonly": false, "cmd": "nv flowmax"},
|
||||
{"path": "flowp", "type": "float"},
|
||||
{"path": "span", "type": "float"},
|
||||
{"path": "ctrl", "type": "none", "kids": 13},
|
||||
{"path": "ctrl/regtext", "type": "text"},
|
||||
{"path": "ctrl/prop_o", "type": "float", "readonly": false, "cmd": "nv ctrl/prop_o", "description": "prop [sec/mbar] when opening. above 4 mbar a 10 times lower value is used"},
|
||||
{"path": "ctrl/prop_c", "type": "float", "readonly": false, "cmd": "nv ctrl/prop_c", "description": "prop [sec/mbar] when closing. above 4 mbar a 10 times lower value is used"},
|
||||
{"path": "ctrl/deriv_o", "type": "float", "readonly": false, "cmd": "nv ctrl/deriv_o", "description": "convergence target time [sec] when opening"},
|
||||
{"path": "ctrl/deriv_c", "type": "float", "readonly": false, "cmd": "nv ctrl/deriv_c", "description": "convergence target time [sec] when closing"},
|
||||
{"path": "ctrl/minpulse_o", "type": "float", "readonly": false, "cmd": "nv ctrl/minpulse_o", "description": "minimum close pulse [sec]"},
|
||||
{"path": "ctrl/minpulse_c", "type": "float", "readonly": false, "cmd": "nv ctrl/minpulse_c", "description": "standard close pulse [sec]"},
|
||||
{"path": "ctrl/hystpulse_o", "type": "float", "readonly": false, "cmd": "nv ctrl/hystpulse_o", "description": "motor pulse to overcome hysteresis when opening"},
|
||||
{"path": "ctrl/hystpulse_c", "type": "float", "readonly": false, "cmd": "nv ctrl/hystpulse_c", "description": "motor pulse to overcome hysteresis when closing"},
|
||||
{"path": "ctrl/tol", "type": "float", "readonly": false, "cmd": "nv ctrl/tol", "description": "valid below 3 mbar"},
|
||||
{"path": "ctrl/tolhigh", "type": "float", "readonly": false, "cmd": "nv ctrl/tolhigh", "description": "valid above 4 mbar"},
|
||||
{"path": "ctrl/openpulse", "type": "float", "readonly": false, "cmd": "nv ctrl/openpulse", "description": "time to open from completely closed to a significant opening"},
|
||||
{"path": "ctrl/adjust_minpulse", "type": "bool", "readonly": false, "cmd": "nv ctrl/adjust_minpulse", "description": "adjust minpulse automatically"},
|
||||
{"path": "autoflow", "type": "none", "kids": 24},
|
||||
{"path": "autoflow/suspended", "type": "bool", "readonly": false, "cmd": "nv autoflow/suspended"},
|
||||
{"path": "autoflow/prop", "type": "float", "readonly": false, "cmd": "nv autoflow/prop"},
|
||||
{"path": "autoflow/flowstd", "type": "float", "readonly": false, "cmd": "nv autoflow/flowstd"},
|
||||
{"path": "autoflow/flowlim", "type": "float", "readonly": false, "cmd": "nv autoflow/flowlim"},
|
||||
{"path": "autoflow/smooth", "type": "float", "readonly": false, "cmd": "nv autoflow/smooth"},
|
||||
{"path": "autoflow/difSize", "type": "float", "readonly": false, "cmd": "nv autoflow/difSize"},
|
||||
{"path": "autoflow/difRange", "type": "float", "readonly": false, "cmd": "nv autoflow/difRange"},
|
||||
{"path": "autoflow/flowSize", "type": "float", "readonly": false, "cmd": "nv autoflow/flowSize"},
|
||||
{"path": "autoflow/convTime", "type": "float", "readonly": false, "cmd": "nv autoflow/convTime"},
|
||||
{"path": "autoflow/Tmin", "type": "float", "readonly": false, "cmd": "nv autoflow/Tmin"},
|
||||
{"path": "autoflow/script", "type": "text", "readonly": false, "cmd": "nv autoflow/script"},
|
||||
{"path": "autoflow/getTemp", "type": "text", "readonly": false, "cmd": "nv autoflow/getTemp"},
|
||||
{"path": "autoflow/getTset", "type": "text", "readonly": false, "cmd": "nv autoflow/getTset"},
|
||||
{"path": "autoflow/getFlow", "type": "text", "readonly": false, "cmd": "nv autoflow/getFlow"},
|
||||
{"path": "autoflow/difBuf", "type": "text"},
|
||||
{"path": "autoflow/flowBuf", "type": "text"},
|
||||
{"path": "autoflow/flowset", "type": "float"},
|
||||
{"path": "autoflow/flowmin", "type": "float"},
|
||||
{"path": "autoflow/flowmax", "type": "float"},
|
||||
{"path": "autoflow/difmin", "type": "float"},
|
||||
{"path": "autoflow/difmax", "type": "float"},
|
||||
{"path": "autoflow/setmin", "type": "float"},
|
||||
{"path": "autoflow/setmax", "type": "float"},
|
||||
{"path": "autoflow/flowtarget", "type": "float"},
|
||||
{"path": "calib", "type": "none", "kids": 2},
|
||||
{"path": "calib/ln_per_min_per_mbar", "type": "float", "readonly": false, "cmd": "nv calib/ln_per_min_per_mbar"},
|
||||
{"path": "calib/mbar_offset", "type": "float", "readonly": false, "cmd": "nv calib/mbar_offset"}]},
|
||||
|
||||
"hepump": {"base": "/hepump", "params": [
|
||||
{"path": "", "type": "enum", "enum": {"xds35_auto": 0, "xds35_manual": 1, "sv65": 2, "other": 3, "no": -1}, "readonly": false, "cmd": "hepump", "description": "xds35: scroll pump, sv65: leybold", "kids": 10},
|
||||
{"path": "send", "type": "text", "readonly": false, "cmd": "hepump send", "visibility": 3},
|
||||
{"path": "status", "type": "text", "visibility": 3},
|
||||
{"path": "running", "type": "bool", "readonly": false, "cmd": "hepump running"},
|
||||
{"path": "eco", "type": "bool", "readonly": false, "cmd": "hepump eco"},
|
||||
{"path": "auto", "type": "bool", "readonly": false, "cmd": "hepump auto"},
|
||||
{"path": "valve", "type": "enum", "enum": {"closed": 0, "closing": 1, "opening": 2, "opened": 3, "undefined": 4}, "readonly": false, "cmd": "hepump valve"},
|
||||
{"path": "eco_t_lim", "type": "float", "readonly": false, "cmd": "hepump eco_t_lim", "description": "switch off eco mode when T_set < eco_t_lim and T < eco_t_lim * 2"},
|
||||
{"path": "calib", "type": "float", "readonly": false, "cmd": "hepump calib", "visibility": 3},
|
||||
{"path": "health", "type": "float"}]},
|
||||
|
||||
"hemot": {"base": "/hepump/hemot", "params": [
|
||||
{"path": "", "type": "float", "readonly": false, "cmd": "run hemot", "kids": 30},
|
||||
{"path": "send", "type": "text", "readonly": false, "cmd": "hemot send", "visibility": 3},
|
||||
{"path": "status", "type": "text", "visibility": 3},
|
||||
{"path": "is_running", "type": "int", "readonly": false, "cmd": "hemot is_running", "visibility": 3},
|
||||
{"path": "pos", "type": "float"},
|
||||
{"path": "encoder", "type": "float"},
|
||||
{"path": "zero", "type": "float", "readonly": false, "cmd": "hemot zero"},
|
||||
{"path": "lowerlimit", "type": "float", "readonly": false, "cmd": "hemot lowerlimit"},
|
||||
{"path": "upperlimit", "type": "float", "readonly": false, "cmd": "hemot upperlimit"},
|
||||
{"path": "disablelimits", "type": "bool", "readonly": false, "cmd": "hemot disablelimits"},
|
||||
{"path": "verbose", "type": "bool", "readonly": false, "cmd": "hemot verbose"},
|
||||
{"path": "target", "type": "float"},
|
||||
{"path": "runstate", "type": "enum", "enum": {"idle": 0, "running": 1, "finished": 2, "error": 3}},
|
||||
{"path": "precision", "type": "float", "readonly": false, "cmd": "hemot precision"},
|
||||
{"path": "maxencdif", "type": "float", "readonly": false, "cmd": "hemot maxencdif"},
|
||||
{"path": "id", "type": "float", "readonly": false, "cmd": "hemot id"},
|
||||
{"path": "pump_number", "type": "float", "readonly": false, "cmd": "hemot pump_number"},
|
||||
{"path": "init", "type": "float", "readonly": false, "cmd": "hemot init"},
|
||||
{"path": "maxspeed", "type": "float", "readonly": false, "cmd": "hemot maxspeed"},
|
||||
{"path": "acceleration", "type": "float", "readonly": false, "cmd": "hemot acceleration"},
|
||||
{"path": "maxcurrent", "type": "float", "readonly": false, "cmd": "hemot maxcurrent"},
|
||||
{"path": "standbycurrent", "type": "float", "readonly": false, "cmd": "hemot standbycurrent"},
|
||||
{"path": "freewheeling", "type": "bool", "readonly": false, "cmd": "hemot freewheeling"},
|
||||
{"path": "output0", "type": "bool", "readonly": false, "cmd": "hemot output0"},
|
||||
{"path": "output1", "type": "bool", "readonly": false, "cmd": "hemot output1"},
|
||||
{"path": "input3", "type": "bool"},
|
||||
{"path": "pullup", "type": "float", "readonly": false, "cmd": "hemot pullup"},
|
||||
{"path": "nopumpfeedback", "type": "bool", "readonly": false, "cmd": "hemot nopumpfeedback"},
|
||||
{"path": "eeprom", "type": "enum", "enum": {"ok": 0, "dirty": 1, "save": 2, "load": 3}, "readonly": false, "cmd": "hemot eeprom"},
|
||||
{"path": "customadr", "type": "text", "readonly": false, "cmd": "hemot customadr"},
|
||||
{"path": "custompar", "type": "float", "readonly": false, "cmd": "hemot custompar"}]},
|
||||
|
||||
"nvflow": {"base": "/nvflow", "params": [
|
||||
{"path": "", "type": "float", "kids": 7},
|
||||
{"path": "send", "type": "text", "readonly": false, "cmd": "nvflow send", "visibility": 3},
|
||||
{"path": "status", "type": "text", "visibility": 3},
|
||||
{"path": "stddev", "type": "float"},
|
||||
{"path": "nsamples", "type": "int", "readonly": false, "cmd": "nvflow nsamples"},
|
||||
{"path": "offset", "type": "float", "readonly": false, "cmd": "nvflow offset"},
|
||||
{"path": "scale", "type": "float", "readonly": false, "cmd": "nvflow scale"},
|
||||
{"path": "save", "type": "bool", "readonly": false, "cmd": "nvflow save", "description": "unchecked: current calib is not saved. set checked: save calib"}]},
|
||||
|
||||
"mf": {"base": "/mf", "params": [
|
||||
{"path": "", "type": "float", "readonly": false, "cmd": "run mf", "kids": 8},
|
||||
{"path": "send", "type": "text", "readonly": false, "cmd": "mf send", "visibility": 3},
|
||||
{"path": "status", "type": "text", "visibility": 3},
|
||||
{"path": "is_running", "type": "int", "readonly": false, "cmd": "mf is_running", "visibility": 3},
|
||||
{"path": "statustext", "type": "text"},
|
||||
{"path": "ramp", "type": "float", "readonly": false, "cmd": "mf ramp"},
|
||||
{"path": "persistent_mode", "type": "enum", "enum": {"forever_off": -1, "off": 0, "on": 1}, "readonly": false, "cmd": "mf persistent_mode", "description": "hidden mode -1: completely off"},
|
||||
{"path": "gen", "type": "none", "kids": 13},
|
||||
{"path": "gen/persistent_delay", "type": "float", "readonly": false, "cmd": "mf gen/persistent_delay", "description": "timeout for going automatically into persistent mode"},
|
||||
{"path": "gen/tolerance", "type": "float", "readonly": false, "cmd": "mf gen/tolerance"},
|
||||
{"path": "gen/wait_switch_on", "type": "float", "readonly": false, "cmd": "mf gen/wait_switch_on"},
|
||||
{"path": "gen/wait_switch_off", "type": "float", "readonly": false, "cmd": "mf gen/wait_switch_off"},
|
||||
{"path": "gen/wait_stable_leads", "type": "float", "readonly": false, "cmd": "mf gen/wait_stable_leads"},
|
||||
{"path": "gen/wait_stable_field", "type": "float", "readonly": false, "cmd": "mf gen/wait_stable_field"},
|
||||
{"path": "gen/expectend", "type": "text"},
|
||||
{"path": "gen/trained_pos", "type": "float", "readonly": false, "cmd": "mf gen/trained_pos"},
|
||||
{"path": "gen/trained_neg", "type": "float", "readonly": false, "cmd": "mf gen/trained_neg"},
|
||||
{"path": "gen/profile", "type": "text", "readonly": false, "cmd": "mf gen/profile", "description": "syntax: <field1>:<ramp1> <field2>:<ramp2> ... (<ramp2> is the ramp limit from <field1> to <field2>)"},
|
||||
{"path": "gen/profile_training", "type": "text", "readonly": false, "cmd": "mf gen/profile_training", "description": "syntax: <field1>:<ramp1> <field2>:<ramp2> ... (<ramp2> is the ramp limit from <field1> to <field2>)"},
|
||||
{"path": "gen/limit", "type": "float", "readonly": false, "cmd": "mf gen/limit"},
|
||||
{"path": "gen/bipolar", "type": "bool", "readonly": false, "cmd": "mf gen/bipolar"},
|
||||
{"path": "ips", "type": "float", "kids": 17},
|
||||
{"path": "ips/ramp_slow", "type": "float", "readonly": false, "cmd": "mf ips/ramp_slow", "description": "ramp rate for coils Tesla/min."},
|
||||
{"path": "ips/ramp_fast", "type": "float", "description": "ramp rate for leads Tesla/min."},
|
||||
{"path": "ips/set_field", "type": "float", "readonly": false, "cmd": "mf ips/set_field"},
|
||||
{"path": "ips/heater", "type": "bool", "readonly": false, "cmd": "mf ips/heater"},
|
||||
{"path": "ips/ramp_state", "type": "enum", "enum": {"hold": 0, "to_zero": 1, "to_set": 2, "clamp": 3}, "readonly": false, "cmd": "mf ips/ramp_state"},
|
||||
{"path": "ips/leads_set", "type": "float", "description": "calculated current in the leads, converted to Tesla"},
|
||||
{"path": "ips/show_internals", "type": "bool", "readonly": false, "cmd": "mf ips/show_internals"},
|
||||
{"path": "ips/leads_meas", "type": "float", "description": "measured current in the leads, converted to Tesla"},
|
||||
{"path": "ips/slave1", "type": "float"},
|
||||
{"path": "ips/slave2", "type": "float"},
|
||||
{"path": "ips/slave3", "type": "float"},
|
||||
{"path": "ips/volt", "type": "float"},
|
||||
{"path": "ips/symode", "type": "text"},
|
||||
{"path": "ips/engineering_password", "type": "text", "readonly": false, "cmd": "mf ips/engineering_password"},
|
||||
{"path": "ips/atob", "type": "float", "readonly": false, "cmd": "mf ips/atob", "description": "Amp/Tesla"},
|
||||
{"path": "ips/inductance", "type": "float", "readonly": false, "cmd": "mf ips/inductance", "description": "henries"},
|
||||
{"path": "ips/switch_heater_current", "type": "float", "readonly": false, "cmd": "mf ips/switch_heater_current", "description": "switch heater current [mA]"}]},
|
||||
|
||||
"lev": {"base": "/lev", "params": [
|
||||
{"path": "", "type": "float", "kids": 4},
|
||||
{"path": "send", "type": "text", "readonly": false, "cmd": "lev send", "visibility": 3},
|
||||
{"path": "status", "type": "text", "visibility": 3},
|
||||
{"path": "mode", "type": "enum", "enum": {"slow": 0, "fast": 1}, "readonly": false, "cmd": "lev mode"},
|
||||
{"path": "n2", "type": "float"}]},
|
||||
|
||||
"ln2fill": {"base": "/ln2fill", "params": [
|
||||
{"path": "", "type": "enum", "enum": {"watching": 0, "filling": 1, "inactive": 2, "manualfill": 3}, "readonly": false, "cmd": "ln2fill", "kids": 14},
|
||||
{"path": "send", "type": "text", "readonly": false, "cmd": "ln2fill send", "visibility": 3},
|
||||
{"path": "status", "type": "text", "visibility": 3},
|
||||
{"path": "state", "type": "text"},
|
||||
{"path": "readlevel", "type": "text", "readonly": false, "cmd": "ln2fill readlevel", "visibility": 3},
|
||||
{"path": "lowlevel", "type": "float", "readonly": false, "cmd": "ln2fill lowlevel"},
|
||||
{"path": "highlevel", "type": "float", "readonly": false, "cmd": "ln2fill highlevel"},
|
||||
{"path": "smooth", "type": "float"},
|
||||
{"path": "minfillminutes", "type": "float", "readonly": false, "cmd": "ln2fill minfillminutes"},
|
||||
{"path": "maxfillminutes", "type": "float", "readonly": false, "cmd": "ln2fill maxfillminutes"},
|
||||
{"path": "minholdhours", "type": "float", "readonly": false, "cmd": "ln2fill minholdhours"},
|
||||
{"path": "maxholdhours", "type": "float", "readonly": false, "cmd": "ln2fill maxholdhours"},
|
||||
{"path": "tolerance", "type": "float", "readonly": false, "cmd": "ln2fill tolerance"},
|
||||
{"path": "badreadingminutes", "type": "float", "readonly": false, "cmd": "ln2fill badreadingminutes"},
|
||||
{"path": "tubecoolingminutes", "type": "float", "readonly": false, "cmd": "ln2fill tubecoolingminutes"}]},
|
||||
|
||||
"hefill": {"base": "/hefill", "params": [
|
||||
{"path": "", "type": "enum", "enum": {"watching": 0, "filling": 1, "inactive": 2, "manualfill": 3}, "readonly": false, "cmd": "hefill", "kids": 16},
|
||||
{"path": "send", "type": "text", "readonly": false, "cmd": "hefill send", "visibility": 3},
|
||||
{"path": "status", "type": "text", "visibility": 3},
|
||||
{"path": "state", "type": "text"},
|
||||
{"path": "readlevel", "type": "text", "readonly": false, "cmd": "hefill readlevel", "visibility": 3},
|
||||
{"path": "lowlevel", "type": "float", "readonly": false, "cmd": "hefill lowlevel"},
|
||||
{"path": "highlevel", "type": "float", "readonly": false, "cmd": "hefill highlevel"},
|
||||
{"path": "smooth", "type": "float"},
|
||||
{"path": "minfillminutes", "type": "float", "readonly": false, "cmd": "hefill minfillminutes"},
|
||||
{"path": "maxfillminutes", "type": "float", "readonly": false, "cmd": "hefill maxfillminutes"},
|
||||
{"path": "minholdhours", "type": "float", "readonly": false, "cmd": "hefill minholdhours"},
|
||||
{"path": "maxholdhours", "type": "float", "readonly": false, "cmd": "hefill maxholdhours"},
|
||||
{"path": "tolerance", "type": "float", "readonly": false, "cmd": "hefill tolerance"},
|
||||
{"path": "badreadingminutes", "type": "float", "readonly": false, "cmd": "hefill badreadingminutes"},
|
||||
{"path": "tubecoolingminutes", "type": "float", "readonly": false, "cmd": "hefill tubecoolingminutes"},
|
||||
{"path": "vessellimit", "type": "float", "readonly": false, "cmd": "hefill vessellimit"},
|
||||
{"path": "vext", "type": "float"}]},
|
||||
|
||||
"table": {"base": "/table", "params": [
|
||||
{"path": "", "type": "none", "kids": 17},
|
||||
{"path": "send", "type": "text", "readonly": false, "cmd": "table send", "visibility": 3},
|
||||
{"path": "status", "type": "text", "visibility": 3},
|
||||
{"path": "fix_tt_set_prop", "type": "bool", "readonly": false, "cmd": "table fix_tt_set_prop"},
|
||||
{"path": "val_tt_set_prop", "type": "float"},
|
||||
{"path": "tbl_tt_set_prop", "type": "text", "readonly": false, "cmd": "table tbl_tt_set_prop", "description": "enter value pair separated with colon T1:par1 T2:par2 ..."},
|
||||
{"path": "fix_tt_set_integ", "type": "bool", "readonly": false, "cmd": "table fix_tt_set_integ"},
|
||||
{"path": "val_tt_set_integ", "type": "float"},
|
||||
{"path": "tbl_tt_set_integ", "type": "text", "readonly": false, "cmd": "table tbl_tt_set_integ", "description": "enter value pair separated with colon T1:par1 T2:par2 ..."},
|
||||
{"path": "fix_tt_dblctrl_int2", "type": "bool", "readonly": false, "cmd": "table fix_tt_dblctrl_int2"},
|
||||
{"path": "val_tt_dblctrl_int2", "type": "float"},
|
||||
{"path": "tbl_tt_dblctrl_int2", "type": "text", "readonly": false, "cmd": "table tbl_tt_dblctrl_int2", "description": "enter value pair separated with colon T1:par1 T2:par2 ..."},
|
||||
{"path": "fix_tt_dblctrl_prop_up", "type": "bool", "readonly": false, "cmd": "table fix_tt_dblctrl_prop_up"},
|
||||
{"path": "val_tt_dblctrl_prop_up", "type": "float"},
|
||||
{"path": "tbl_tt_dblctrl_prop_up", "type": "text", "readonly": false, "cmd": "table tbl_tt_dblctrl_prop_up", "description": "enter value pair separated with colon T1:par1 T2:par2 ..."},
|
||||
{"path": "fix_tt_dblctrl_prop_lo", "type": "bool", "readonly": false, "cmd": "table fix_tt_dblctrl_prop_lo"},
|
||||
{"path": "val_tt_dblctrl_prop_lo", "type": "float"},
|
||||
{"path": "tbl_tt_dblctrl_prop_lo", "type": "text", "readonly": false, "cmd": "table tbl_tt_dblctrl_prop_lo", "description": "enter value pair separated with colon T1:par1 T2:par2 ..."}]}}
|
@ -1,395 +0,0 @@
|
||||
{"tt": {"base": "/tt", "params": [
|
||||
{"path": "", "type": "float", "readonly": false, "cmd": "run tt", "description": "tt", "kids": 18},
|
||||
{"path": "send", "type": "text", "readonly": false, "cmd": "tt send", "visibility": 3},
|
||||
{"path": "status", "type": "text", "visibility": 3},
|
||||
{"path": "is_running", "type": "int", "readonly": false, "cmd": "tt is_running", "visibility": 3},
|
||||
{"path": "mainloop", "type": "text", "readonly": false, "cmd": "tt mainloop", "visibility": 3},
|
||||
{"path": "target", "type": "float"},
|
||||
{"path": "running", "type": "int"},
|
||||
{"path": "tolerance", "type": "float", "readonly": false, "cmd": "tt tolerance"},
|
||||
{"path": "maxwait", "type": "float", "readonly": false, "cmd": "tt maxwait"},
|
||||
{"path": "settle", "type": "float", "readonly": false, "cmd": "tt settle"},
|
||||
{"path": "log", "type": "text", "readonly": false, "cmd": "tt log", "visibility": 3, "kids": 4},
|
||||
{"path": "log/mean", "type": "float", "visibility": 3},
|
||||
{"path": "log/m2", "type": "float", "visibility": 3},
|
||||
{"path": "log/stddev", "type": "float", "visibility": 3},
|
||||
{"path": "log/n", "type": "float", "visibility": 3},
|
||||
{"path": "dblctrl", "type": "bool", "readonly": false, "cmd": "tt dblctrl", "kids": 9},
|
||||
{"path": "dblctrl/tshift", "type": "float", "readonly": false, "cmd": "tt dblctrl/tshift"},
|
||||
{"path": "dblctrl/mode", "type": "enum", "enum": {"disabled": -1, "inactive": 0, "stable": 1, "up": 2, "down": 3}, "readonly": false, "cmd": "tt dblctrl/mode"},
|
||||
{"path": "dblctrl/shift_up", "type": "float"},
|
||||
{"path": "dblctrl/shift_lo", "type": "float"},
|
||||
{"path": "dblctrl/t_min", "type": "float"},
|
||||
{"path": "dblctrl/t_max", "type": "float"},
|
||||
{"path": "dblctrl/int2", "type": "float", "readonly": false, "cmd": "tt dblctrl/int2"},
|
||||
{"path": "dblctrl/prop_up", "type": "float", "readonly": false, "cmd": "tt dblctrl/prop_up"},
|
||||
{"path": "dblctrl/prop_lo", "type": "float", "readonly": false, "cmd": "tt dblctrl/prop_lo"},
|
||||
{"path": "tm", "type": "float", "kids": 4},
|
||||
{"path": "tm/curve", "type": "text", "readonly": false, "cmd": "tt tm/curve", "kids": 1},
|
||||
{"path": "tm/curve/points", "type": "floatvarar", "readonly": false, "cmd": "tt tm/curve/points", "visibility": 3},
|
||||
{"path": "tm/alarm", "type": "float", "readonly": false, "cmd": "tt tm/alarm"},
|
||||
{"path": "tm/stddev", "type": "float"},
|
||||
{"path": "tm/raw", "type": "float"},
|
||||
{"path": "ts", "type": "float", "kids": 4},
|
||||
{"path": "ts/curve", "type": "text", "readonly": false, "cmd": "tt ts/curve", "kids": 1},
|
||||
{"path": "ts/curve/points", "type": "floatvarar", "readonly": false, "cmd": "tt ts/curve/points", "visibility": 3},
|
||||
{"path": "ts/alarm", "type": "float", "readonly": false, "cmd": "tt ts/alarm"},
|
||||
{"path": "ts/stddev", "type": "float"},
|
||||
{"path": "ts/raw", "type": "float"},
|
||||
{"path": "ts_2", "type": "float", "kids": 4},
|
||||
{"path": "ts_2/curve", "type": "text", "readonly": false, "cmd": "tt ts_2/curve", "kids": 1},
|
||||
{"path": "ts_2/curve/points", "type": "floatvarar", "readonly": false, "cmd": "tt ts_2/curve/points", "visibility": 3},
|
||||
{"path": "ts_2/alarm", "type": "float", "readonly": false, "cmd": "tt ts_2/alarm"},
|
||||
{"path": "ts_2/stddev", "type": "float"},
|
||||
{"path": "ts_2/raw", "type": "float"},
|
||||
{"path": "setsamp", "type": "float", "readonly": false, "cmd": "tt setsamp", "kids": 18},
|
||||
{"path": "setsamp/mode", "type": "enum", "enum": {"disabled": -1, "off": 0, "controlling": 1, "manual": 2}, "readonly": false, "cmd": "tt setsamp/mode"},
|
||||
{"path": "setsamp/reg", "type": "float"},
|
||||
{"path": "setsamp/ramp", "type": "float", "readonly": false, "cmd": "tt setsamp/ramp", "description": "maximum ramp in K/min (0: ramp off)"},
|
||||
{"path": "setsamp/wramp", "type": "float", "readonly": false, "cmd": "tt setsamp/wramp"},
|
||||
{"path": "setsamp/smooth", "type": "float", "readonly": false, "cmd": "tt setsamp/smooth", "description": "smooth time (minutes)"},
|
||||
{"path": "setsamp/channel", "type": "text", "readonly": false, "cmd": "tt setsamp/channel"},
|
||||
{"path": "setsamp/limit", "type": "float", "readonly": false, "cmd": "tt setsamp/limit"},
|
||||
{"path": "setsamp/resist", "type": "float", "readonly": false, "cmd": "tt setsamp/resist"},
|
||||
{"path": "setsamp/maxheater", "type": "text", "readonly": false, "cmd": "tt setsamp/maxheater", "description": "maximum heater limit, units should be given without space: W, mW, A, mA"},
|
||||
{"path": "setsamp/linearpower", "type": "float", "readonly": false, "cmd": "tt setsamp/linearpower", "description": "when not 0, it is the maximum effective power, and the power is linear to the heater output"},
|
||||
{"path": "setsamp/maxpowerlim", "type": "float", "description": "the maximum power limit (before any booster or converter)"},
|
||||
{"path": "setsamp/maxpower", "type": "float", "readonly": false, "cmd": "tt setsamp/maxpower", "description": "maximum power [W]"},
|
||||
{"path": "setsamp/maxcurrent", "type": "float", "description": "the maximum current before any booster or converter"},
|
||||
{"path": "setsamp/manualpower", "type": "float", "readonly": false, "cmd": "tt setsamp/manualpower"},
|
||||
{"path": "setsamp/power", "type": "float"},
|
||||
{"path": "setsamp/prop", "type": "float", "readonly": false, "cmd": "tt setsamp/prop", "description": "bigger means more gain"},
|
||||
{"path": "setsamp/integ", "type": "float", "readonly": false, "cmd": "tt setsamp/integ", "description": "bigger means faster"},
|
||||
{"path": "setsamp/deriv", "type": "float", "readonly": false, "cmd": "tt setsamp/deriv"},
|
||||
{"path": "set", "type": "float", "readonly": false, "cmd": "tt set", "kids": 18},
|
||||
{"path": "set/mode", "type": "enum", "enum": {"disabled": -1, "off": 0, "controlling": 1, "manual": 2}, "readonly": false, "cmd": "tt set/mode"},
|
||||
{"path": "set/reg", "type": "float"},
|
||||
{"path": "set/ramp", "type": "float", "readonly": false, "cmd": "tt set/ramp", "description": "maximum ramp in K/min (0: ramp off)"},
|
||||
{"path": "set/wramp", "type": "float", "readonly": false, "cmd": "tt set/wramp"},
|
||||
{"path": "set/smooth", "type": "float", "readonly": false, "cmd": "tt set/smooth", "description": "smooth time (minutes)"},
|
||||
{"path": "set/channel", "type": "text", "readonly": false, "cmd": "tt set/channel"},
|
||||
{"path": "set/limit", "type": "float", "readonly": false, "cmd": "tt set/limit"},
|
||||
{"path": "set/resist", "type": "float", "readonly": false, "cmd": "tt set/resist"},
|
||||
{"path": "set/maxheater", "type": "text", "readonly": false, "cmd": "tt set/maxheater", "description": "maximum heater limit, units should be given without space: W, mW, A, mA"},
|
||||
{"path": "set/linearpower", "type": "float", "readonly": false, "cmd": "tt set/linearpower", "description": "when not 0, it is the maximum effective power, and the power is linear to the heater output"},
|
||||
{"path": "set/maxpowerlim", "type": "float", "description": "the maximum power limit (before any booster or converter)"},
|
||||
{"path": "set/maxpower", "type": "float", "readonly": false, "cmd": "tt set/maxpower", "description": "maximum power [W]"},
|
||||
{"path": "set/maxcurrent", "type": "float", "description": "the maximum current before any booster or converter"},
|
||||
{"path": "set/manualpower", "type": "float", "readonly": false, "cmd": "tt set/manualpower"},
|
||||
{"path": "set/power", "type": "float"},
|
||||
{"path": "set/prop", "type": "float", "readonly": false, "cmd": "tt set/prop", "description": "bigger means more gain"},
|
||||
{"path": "set/integ", "type": "float", "readonly": false, "cmd": "tt set/integ", "description": "bigger means faster"},
|
||||
{"path": "set/deriv", "type": "float", "readonly": false, "cmd": "tt set/deriv"},
|
||||
{"path": "display", "type": "text", "readonly": false, "cmd": "tt display"},
|
||||
{"path": "remote", "type": "bool"}]},
|
||||
|
||||
"cc": {"base": "/cc", "params": [
|
||||
{"path": "", "type": "bool", "kids": 96},
|
||||
{"path": "send", "type": "text", "readonly": false, "cmd": "cc send", "visibility": 3},
|
||||
{"path": "status", "type": "text", "visibility": 3},
|
||||
{"path": "autodevice", "type": "bool", "readonly": false, "cmd": "cc autodevice"},
|
||||
{"path": "fav", "type": "bool", "readonly": false, "cmd": "cc fav"},
|
||||
{"path": "f", "type": "float"},
|
||||
{"path": "fs", "type": "enum", "enum": {"ok": 0, "no_sens": 1}, "readonly": false, "cmd": "cc fs"},
|
||||
{"path": "mav", "type": "bool", "readonly": false, "cmd": "cc mav"},
|
||||
{"path": "fm", "type": "enum", "enum": {"idle": 0, "opening": 1, "closing": 2, "opened": 3, "closed": 4, "no_motor": 5}},
|
||||
{"path": "fa", "type": "enum", "enum": {"fixed": 0, "controlled": 1, "automatic": 2, "offline": 3}, "readonly": false, "cmd": "cc fa"},
|
||||
{"path": "mp", "type": "float", "readonly": false, "cmd": "cc mp"},
|
||||
{"path": "msp", "type": "float"},
|
||||
{"path": "mmp", "type": "float"},
|
||||
{"path": "mc", "type": "float", "readonly": false, "cmd": "cc mc"},
|
||||
{"path": "mfc", "type": "float", "readonly": false, "cmd": "cc mfc"},
|
||||
{"path": "moc", "type": "float", "readonly": false, "cmd": "cc moc"},
|
||||
{"path": "mtc", "type": "float", "readonly": false, "cmd": "cc mtc"},
|
||||
{"path": "mtl", "type": "float"},
|
||||
{"path": "mft", "type": "float", "readonly": false, "cmd": "cc mft"},
|
||||
{"path": "mt", "type": "float"},
|
||||
{"path": "mo", "type": "float"},
|
||||
{"path": "mcr", "type": "float"},
|
||||
{"path": "mot", "type": "float"},
|
||||
{"path": "mw", "type": "float", "readonly": false, "cmd": "cc mw", "description": "correction pulse after automatic open"},
|
||||
{"path": "hav", "type": "bool", "readonly": false, "cmd": "cc hav"},
|
||||
{"path": "h", "type": "float"},
|
||||
{"path": "hr", "type": "float"},
|
||||
{"path": "hc", "type": "float"},
|
||||
{"path": "hu", "type": "float"},
|
||||
{"path": "hh", "type": "float", "readonly": false, "cmd": "cc hh"},
|
||||
{"path": "hl", "type": "float", "readonly": false, "cmd": "cc hl"},
|
||||
{"path": "htf", "type": "float", "readonly": false, "cmd": "cc htf", "description": "meas. period in fast mode"},
|
||||
{"path": "hts", "type": "float", "readonly": false, "cmd": "cc hts", "description": "meas. period in slow mode"},
|
||||
{"path": "hd", "type": "float", "readonly": false, "cmd": "cc hd"},
|
||||
{"path": "hwr", "type": "float", "readonly": false, "cmd": "cc hwr"},
|
||||
{"path": "hem", "type": "float", "readonly": false, "cmd": "cc hem", "description": "sensor length in mm from top to empty pos."},
|
||||
{"path": "hfu", "type": "float", "readonly": false, "cmd": "cc hfu", "description": "sensor length in mm from top to full pos."},
|
||||
{"path": "hcd", "type": "enum", "enum": {"stop": 0, "fill": 1, "off": 2, "auto": 3, "manual": 7}, "readonly": false, "cmd": "cc hcd"},
|
||||
{"path": "hv", "type": "enum", "enum": {"fill_valve_off": 0, "filling": 1, "no_fill_valve": 2, "timeout": 3, "timeout1": 4}},
|
||||
{"path": "hsf", "type": "enum", "enum": {"sens_ok": 0, "sens_warm": 1, "no_sens": 2, "timeout": 3, "not_yet_read": 4, "disabled": 5}},
|
||||
{"path": "ha", "type": "bool", "readonly": false, "cmd": "cc ha"},
|
||||
{"path": "hm", "type": "bool"},
|
||||
{"path": "hf", "type": "enum", "enum": {"slow": 0, "fast": 1}, "readonly": false, "cmd": "cc hf"},
|
||||
{"path": "hbe", "type": "bool", "readonly": false, "cmd": "cc hbe"},
|
||||
{"path": "hmf", "type": "float"},
|
||||
{"path": "hms", "type": "float"},
|
||||
{"path": "hit", "type": "float", "readonly": false, "cmd": "cc hit"},
|
||||
{"path": "hft", "type": "int", "readonly": false, "cmd": "cc hft"},
|
||||
{"path": "hea", "type": "enum", "enum": {"0": 0, "1": 1, "6": 6}, "readonly": false, "cmd": "cc hea"},
|
||||
{"path": "hch", "type": "int", "readonly": false, "cmd": "cc hch", "visibility": 3},
|
||||
{"path": "hwr0", "type": "float", "readonly": false, "cmd": "cc hwr0", "visibility": 3},
|
||||
{"path": "hem0", "type": "float", "readonly": false, "cmd": "cc hem0", "description": "sensor length in mm from top to empty pos.", "visibility": 3},
|
||||
{"path": "hfu0", "type": "float", "readonly": false, "cmd": "cc hfu0", "description": "sensor length in mm from top to full pos.", "visibility": 3},
|
||||
{"path": "hd0", "type": "float", "readonly": false, "cmd": "cc hd0", "description": "external sensor drive current (mA)", "visibility": 3},
|
||||
{"path": "h0", "type": "float", "visibility": 3},
|
||||
{"path": "hs0", "type": "enum", "enum": {"sens_ok": 0, "sens_warm": 1, "no_sens": 2, "timeout": 3, "not_yet_read": 4, "disabled": 5}, "visibility": 3},
|
||||
{"path": "h1", "type": "float", "visibility": 3},
|
||||
{"path": "hs1", "type": "enum", "enum": {"sens_ok": 0, "sens_warm": 1, "no_sens": 2, "timeout": 3, "not_yet_read": 4, "disabled": 5}, "visibility": 3},
|
||||
{"path": "h2", "type": "float", "visibility": 3},
|
||||
{"path": "hs2", "type": "enum", "enum": {"sens_ok": 0, "sens_warm": 1, "no_sens": 2, "timeout": 3, "not_yet_read": 4, "disabled": 5}, "visibility": 3},
|
||||
{"path": "h3", "type": "float", "visibility": 3},
|
||||
{"path": "hs3", "type": "enum", "enum": {"sens_ok": 0, "sens_warm": 1, "no_sens": 2, "timeout": 3, "not_yet_read": 4, "disabled": 5}, "visibility": 3},
|
||||
{"path": "h4", "type": "float", "visibility": 3},
|
||||
{"path": "hs4", "type": "enum", "enum": {"sens_ok": 0, "sens_warm": 1, "no_sens": 2, "timeout": 3, "not_yet_read": 4, "disabled": 5}, "visibility": 3},
|
||||
{"path": "h5", "type": "float", "visibility": 3},
|
||||
{"path": "hs5", "type": "enum", "enum": {"sens_ok": 0, "sens_warm": 1, "no_sens": 2, "timeout": 3, "not_yet_read": 4, "disabled": 5}, "visibility": 3},
|
||||
{"path": "hfb", "type": "float"},
|
||||
{"path": "nav", "type": "bool", "readonly": false, "cmd": "cc nav"},
|
||||
{"path": "nu", "type": "float"},
|
||||
{"path": "nl", "type": "float"},
|
||||
{"path": "nth", "type": "float", "readonly": false, "cmd": "cc nth"},
|
||||
{"path": "ntc", "type": "float", "readonly": false, "cmd": "cc ntc"},
|
||||
{"path": "ntm", "type": "float", "readonly": false, "cmd": "cc ntm"},
|
||||
{"path": "ns", "type": "enum", "enum": {"sens_ok": 0, "no_sens": 1, "short_circuit": 2, "upside_down": 3, "sens_warm": 4, "empty": 5}},
|
||||
{"path": "na", "type": "bool", "readonly": false, "cmd": "cc na"},
|
||||
{"path": "nv", "type": "enum", "enum": {"fill_valve_off": 0, "filling": 1, "no_fill_valve": 2, "timeout": 3, "timeout1": 4, "boost": 5}},
|
||||
{"path": "nc", "type": "enum", "enum": {"stop": 0, "fill": 1, "off": 2, "auto": 3}, "readonly": false, "cmd": "cc nc"},
|
||||
{"path": "nfb", "type": "float"},
|
||||
{"path": "cda", "type": "float"},
|
||||
{"path": "cdb", "type": "float"},
|
||||
{"path": "cba", "type": "float"},
|
||||
{"path": "cbb", "type": "float"},
|
||||
{"path": "cvs", "type": "int"},
|
||||
{"path": "csp", "type": "int"},
|
||||
{"path": "cdv", "type": "text", "readonly": false, "cmd": "cc cdv"},
|
||||
{"path": "cic", "type": "text", "readonly": false, "cmd": "cc cic"},
|
||||
{"path": "cin", "type": "text"},
|
||||
{"path": "cds", "type": "enum", "enum": {"local": 0, "remote": 1, "loading": 2, "by_code": 3, "by_touch": 4}, "readonly": false, "cmd": "cc cds"},
|
||||
{"path": "timing", "type": "bool", "readonly": false, "cmd": "cc timing"},
|
||||
{"path": "tc", "type": "float", "visibility": 3},
|
||||
{"path": "tn", "type": "float", "visibility": 3},
|
||||
{"path": "th", "type": "float", "visibility": 3},
|
||||
{"path": "tf", "type": "float", "visibility": 3},
|
||||
{"path": "tm", "type": "float", "visibility": 3},
|
||||
{"path": "tv", "type": "float", "visibility": 3},
|
||||
{"path": "tq", "type": "float", "visibility": 3},
|
||||
{"path": "bdl", "type": "float", "readonly": false, "cmd": "cc bdl"}]},
|
||||
|
||||
"nv": {"base": "/nv", "params": [
|
||||
{"path": "", "type": "enum", "enum": {"fixed": 0, "controlled": 1, "automatic": 2, "close": 3, "open": 4}, "readonly": false, "cmd": "nv", "kids": 11},
|
||||
{"path": "send", "type": "text", "readonly": false, "cmd": "nv send", "visibility": 3},
|
||||
{"path": "status", "type": "text", "visibility": 3},
|
||||
{"path": "motstat", "type": "enum", "enum": {"idle": 0, "opening": 1, "closing": 2, "opened": 3, "closed": 4, "no_motor": 5}},
|
||||
{"path": "flow", "type": "float"},
|
||||
{"path": "set", "type": "float", "readonly": false, "cmd": "nv set"},
|
||||
{"path": "flowmax", "type": "float", "readonly": false, "cmd": "nv flowmax"},
|
||||
{"path": "flowp", "type": "float"},
|
||||
{"path": "span", "type": "float"},
|
||||
{"path": "ctrl", "type": "none", "kids": 13},
|
||||
{"path": "ctrl/regtext", "type": "text"},
|
||||
{"path": "ctrl/prop_o", "type": "float", "readonly": false, "cmd": "nv ctrl/prop_o", "description": "prop [sec/mbar] when opening. above 4 mbar a 10 times lower value is used"},
|
||||
{"path": "ctrl/prop_c", "type": "float", "readonly": false, "cmd": "nv ctrl/prop_c", "description": "prop [sec/mbar] when closing. above 4 mbar a 10 times lower value is used"},
|
||||
{"path": "ctrl/deriv_o", "type": "float", "readonly": false, "cmd": "nv ctrl/deriv_o", "description": "convergence target time [sec] when opening"},
|
||||
{"path": "ctrl/deriv_c", "type": "float", "readonly": false, "cmd": "nv ctrl/deriv_c", "description": "convergence target time [sec] when closing"},
|
||||
{"path": "ctrl/minpulse_o", "type": "float", "readonly": false, "cmd": "nv ctrl/minpulse_o", "description": "minimum close pulse [sec]"},
|
||||
{"path": "ctrl/minpulse_c", "type": "float", "readonly": false, "cmd": "nv ctrl/minpulse_c", "description": "standard close pulse [sec]"},
|
||||
{"path": "ctrl/hystpulse_o", "type": "float", "readonly": false, "cmd": "nv ctrl/hystpulse_o", "description": "motor pulse to overcome hysteresis when opening"},
|
||||
{"path": "ctrl/hystpulse_c", "type": "float", "readonly": false, "cmd": "nv ctrl/hystpulse_c", "description": "motor pulse to overcome hysteresis when closing"},
|
||||
{"path": "ctrl/tol", "type": "float", "readonly": false, "cmd": "nv ctrl/tol", "description": "valid below 3 mbar"},
|
||||
{"path": "ctrl/tolhigh", "type": "float", "readonly": false, "cmd": "nv ctrl/tolhigh", "description": "valid above 4 mbar"},
|
||||
{"path": "ctrl/openpulse", "type": "float", "readonly": false, "cmd": "nv ctrl/openpulse", "description": "time to open from completely closed to a significant opening"},
|
||||
{"path": "ctrl/adjust_minpulse", "type": "bool", "readonly": false, "cmd": "nv ctrl/adjust_minpulse", "description": "adjust minpulse automatically"},
|
||||
{"path": "autoflow", "type": "none", "kids": 24},
|
||||
{"path": "autoflow/suspended", "type": "bool", "readonly": false, "cmd": "nv autoflow/suspended"},
|
||||
{"path": "autoflow/prop", "type": "float", "readonly": false, "cmd": "nv autoflow/prop"},
|
||||
{"path": "autoflow/flowstd", "type": "float", "readonly": false, "cmd": "nv autoflow/flowstd"},
|
||||
{"path": "autoflow/flowlim", "type": "float", "readonly": false, "cmd": "nv autoflow/flowlim"},
|
||||
{"path": "autoflow/smooth", "type": "float", "readonly": false, "cmd": "nv autoflow/smooth"},
|
||||
{"path": "autoflow/difSize", "type": "float", "readonly": false, "cmd": "nv autoflow/difSize"},
|
||||
{"path": "autoflow/difRange", "type": "float", "readonly": false, "cmd": "nv autoflow/difRange"},
|
||||
{"path": "autoflow/flowSize", "type": "float", "readonly": false, "cmd": "nv autoflow/flowSize"},
|
||||
{"path": "autoflow/convTime", "type": "float", "readonly": false, "cmd": "nv autoflow/convTime"},
|
||||
{"path": "autoflow/Tmin", "type": "float", "readonly": false, "cmd": "nv autoflow/Tmin"},
|
||||
{"path": "autoflow/script", "type": "text", "readonly": false, "cmd": "nv autoflow/script"},
|
||||
{"path": "autoflow/getTemp", "type": "text", "readonly": false, "cmd": "nv autoflow/getTemp"},
|
||||
{"path": "autoflow/getTset", "type": "text", "readonly": false, "cmd": "nv autoflow/getTset"},
|
||||
{"path": "autoflow/getFlow", "type": "text", "readonly": false, "cmd": "nv autoflow/getFlow"},
|
||||
{"path": "autoflow/difBuf", "type": "text"},
|
||||
{"path": "autoflow/flowBuf", "type": "text"},
|
||||
{"path": "autoflow/flowset", "type": "float"},
|
||||
{"path": "autoflow/flowmin", "type": "float"},
|
||||
{"path": "autoflow/flowmax", "type": "float"},
|
||||
{"path": "autoflow/difmin", "type": "float"},
|
||||
{"path": "autoflow/difmax", "type": "float"},
|
||||
{"path": "autoflow/setmin", "type": "float"},
|
||||
{"path": "autoflow/setmax", "type": "float"},
|
||||
{"path": "autoflow/flowtarget", "type": "float"},
|
||||
{"path": "calib", "type": "none", "kids": 2},
|
||||
{"path": "calib/ln_per_min_per_mbar", "type": "float", "readonly": false, "cmd": "nv calib/ln_per_min_per_mbar"},
|
||||
{"path": "calib/mbar_offset", "type": "float", "readonly": false, "cmd": "nv calib/mbar_offset"}]},
|
||||
|
||||
"hepump": {"base": "/hepump", "params": [
|
||||
{"path": "", "type": "enum", "enum": {"xds35_auto": 0, "xds35_manual": 1, "sv65": 2, "other": 3, "no": -1}, "readonly": false, "cmd": "hepump", "description": "xds35: scroll pump, sv65: leybold", "kids": 10},
|
||||
{"path": "send", "type": "text", "readonly": false, "cmd": "hepump send", "visibility": 3},
|
||||
{"path": "status", "type": "text", "visibility": 3},
|
||||
{"path": "running", "type": "bool", "readonly": false, "cmd": "hepump running"},
|
||||
{"path": "eco", "type": "bool", "readonly": false, "cmd": "hepump eco"},
|
||||
{"path": "auto", "type": "bool", "readonly": false, "cmd": "hepump auto"},
|
||||
{"path": "valve", "type": "enum", "enum": {"closed": 0, "closing": 1, "opening": 2, "opened": 3, "undefined": 4}, "readonly": false, "cmd": "hepump valve"},
|
||||
{"path": "eco_t_lim", "type": "float", "readonly": false, "cmd": "hepump eco_t_lim", "description": "switch off eco mode when T_set < eco_t_lim and T < eco_t_lim * 2"},
|
||||
{"path": "calib", "type": "float", "readonly": false, "cmd": "hepump calib", "visibility": 3},
|
||||
{"path": "health", "type": "float"}]},
|
||||
|
||||
"hemot": {"base": "/hepump/hemot", "params": [
|
||||
{"path": "", "type": "float", "readonly": false, "cmd": "run hemot", "kids": 30},
|
||||
{"path": "send", "type": "text", "readonly": false, "cmd": "hemot send", "visibility": 3},
|
||||
{"path": "status", "type": "text", "visibility": 3},
|
||||
{"path": "is_running", "type": "int", "readonly": false, "cmd": "hemot is_running", "visibility": 3},
|
||||
{"path": "pos", "type": "float"},
|
||||
{"path": "encoder", "type": "float"},
|
||||
{"path": "zero", "type": "float", "readonly": false, "cmd": "hemot zero"},
|
||||
{"path": "lowerlimit", "type": "float", "readonly": false, "cmd": "hemot lowerlimit"},
|
||||
{"path": "upperlimit", "type": "float", "readonly": false, "cmd": "hemot upperlimit"},
|
||||
{"path": "disablelimits", "type": "bool", "readonly": false, "cmd": "hemot disablelimits"},
|
||||
{"path": "verbose", "type": "bool", "readonly": false, "cmd": "hemot verbose"},
|
||||
{"path": "target", "type": "float"},
|
||||
{"path": "runstate", "type": "enum", "enum": {"idle": 0, "running": 1, "finished": 2, "error": 3}},
|
||||
{"path": "precision", "type": "float", "readonly": false, "cmd": "hemot precision"},
|
||||
{"path": "maxencdif", "type": "float", "readonly": false, "cmd": "hemot maxencdif"},
|
||||
{"path": "id", "type": "float", "readonly": false, "cmd": "hemot id"},
|
||||
{"path": "pump_number", "type": "float", "readonly": false, "cmd": "hemot pump_number"},
|
||||
{"path": "init", "type": "float", "readonly": false, "cmd": "hemot init"},
|
||||
{"path": "maxspeed", "type": "float", "readonly": false, "cmd": "hemot maxspeed"},
|
||||
{"path": "acceleration", "type": "float", "readonly": false, "cmd": "hemot acceleration"},
|
||||
{"path": "maxcurrent", "type": "float", "readonly": false, "cmd": "hemot maxcurrent"},
|
||||
{"path": "standbycurrent", "type": "float", "readonly": false, "cmd": "hemot standbycurrent"},
|
||||
{"path": "freewheeling", "type": "bool", "readonly": false, "cmd": "hemot freewheeling"},
|
||||
{"path": "output0", "type": "bool", "readonly": false, "cmd": "hemot output0"},
|
||||
{"path": "output1", "type": "bool", "readonly": false, "cmd": "hemot output1"},
|
||||
{"path": "input3", "type": "bool"},
|
||||
{"path": "pullup", "type": "float", "readonly": false, "cmd": "hemot pullup"},
|
||||
{"path": "nopumpfeedback", "type": "bool", "readonly": false, "cmd": "hemot nopumpfeedback"},
|
||||
{"path": "eeprom", "type": "enum", "enum": {"ok": 0, "dirty": 1, "save": 2, "load": 3}, "readonly": false, "cmd": "hemot eeprom"},
|
||||
{"path": "customadr", "type": "text", "readonly": false, "cmd": "hemot customadr"},
|
||||
{"path": "custompar", "type": "float", "readonly": false, "cmd": "hemot custompar"}]},
|
||||
|
||||
"nvflow": {"base": "/nvflow", "params": [
|
||||
{"path": "", "type": "float", "kids": 7},
|
||||
{"path": "send", "type": "text", "readonly": false, "cmd": "nvflow send", "visibility": 3},
|
||||
{"path": "status", "type": "text", "visibility": 3},
|
||||
{"path": "stddev", "type": "float"},
|
||||
{"path": "nsamples", "type": "int", "readonly": false, "cmd": "nvflow nsamples"},
|
||||
{"path": "offset", "type": "float", "readonly": false, "cmd": "nvflow offset"},
|
||||
{"path": "scale", "type": "float", "readonly": false, "cmd": "nvflow scale"},
|
||||
{"path": "save", "type": "bool", "readonly": false, "cmd": "nvflow save", "description": "unchecked: current calib is not saved. set checked: save calib"}]},
|
||||
|
||||
"mf": {"base": "/mf", "params": [
|
||||
{"path": "", "type": "float", "readonly": false, "cmd": "run mf", "kids": 8},
|
||||
{"path": "send", "type": "text", "readonly": false, "cmd": "mf send", "visibility": 3},
|
||||
{"path": "status", "type": "text", "visibility": 3},
|
||||
{"path": "is_running", "type": "int", "readonly": false, "cmd": "mf is_running", "visibility": 3},
|
||||
{"path": "statustext", "type": "text"},
|
||||
{"path": "ramp", "type": "float", "readonly": false, "cmd": "mf ramp"},
|
||||
{"path": "persistent_mode", "type": "enum", "enum": {"forever_off": -1, "off": 0, "on": 1}, "readonly": false, "cmd": "mf persistent_mode", "description": "hidden mode -1: completely off"},
|
||||
{"path": "gen", "type": "none", "kids": 13},
|
||||
{"path": "gen/persistent_delay", "type": "float", "readonly": false, "cmd": "mf gen/persistent_delay", "description": "timeout for going automatically into persistent mode"},
|
||||
{"path": "gen/tolerance", "type": "float", "readonly": false, "cmd": "mf gen/tolerance"},
|
||||
{"path": "gen/wait_switch_on", "type": "float", "readonly": false, "cmd": "mf gen/wait_switch_on"},
|
||||
{"path": "gen/wait_switch_off", "type": "float", "readonly": false, "cmd": "mf gen/wait_switch_off"},
|
||||
{"path": "gen/wait_stable_leads", "type": "float", "readonly": false, "cmd": "mf gen/wait_stable_leads"},
|
||||
{"path": "gen/wait_stable_field", "type": "float", "readonly": false, "cmd": "mf gen/wait_stable_field"},
|
||||
{"path": "gen/expectend", "type": "text"},
|
||||
{"path": "gen/trained_pos", "type": "float", "readonly": false, "cmd": "mf gen/trained_pos"},
|
||||
{"path": "gen/trained_neg", "type": "float", "readonly": false, "cmd": "mf gen/trained_neg"},
|
||||
{"path": "gen/profile", "type": "text", "readonly": false, "cmd": "mf gen/profile", "description": "syntax: <field1>:<ramp1> <field2>:<ramp2> ... (<ramp2> is the ramp limit from <field1> to <field2>)"},
|
||||
{"path": "gen/profile_training", "type": "text", "readonly": false, "cmd": "mf gen/profile_training", "description": "syntax: <field1>:<ramp1> <field2>:<ramp2> ... (<ramp2> is the ramp limit from <field1> to <field2>)"},
|
||||
{"path": "gen/limit", "type": "float", "readonly": false, "cmd": "mf gen/limit"},
|
||||
{"path": "gen/bipolar", "type": "bool", "readonly": false, "cmd": "mf gen/bipolar"},
|
||||
{"path": "ips", "type": "float", "kids": 17},
|
||||
{"path": "ips/ramp_slow", "type": "float", "readonly": false, "cmd": "mf ips/ramp_slow", "description": "ramp rate for coils Tesla/min."},
|
||||
{"path": "ips/ramp_fast", "type": "float", "description": "ramp rate for leads Tesla/min."},
|
||||
{"path": "ips/set_field", "type": "float", "readonly": false, "cmd": "mf ips/set_field"},
|
||||
{"path": "ips/heater", "type": "bool", "readonly": false, "cmd": "mf ips/heater"},
|
||||
{"path": "ips/ramp_state", "type": "enum", "enum": {"hold": 0, "to_zero": 1, "to_set": 2, "clamp": 3}, "readonly": false, "cmd": "mf ips/ramp_state"},
|
||||
{"path": "ips/leads_set", "type": "float", "description": "calculated current in the leads, converted to Tesla"},
|
||||
{"path": "ips/show_internals", "type": "bool", "readonly": false, "cmd": "mf ips/show_internals"},
|
||||
{"path": "ips/leads_meas", "type": "float", "description": "measured current in the leads, converted to Tesla"},
|
||||
{"path": "ips/slave1", "type": "float"},
|
||||
{"path": "ips/slave2", "type": "float"},
|
||||
{"path": "ips/slave3", "type": "float"},
|
||||
{"path": "ips/volt", "type": "float"},
|
||||
{"path": "ips/symode", "type": "text"},
|
||||
{"path": "ips/engineering_password", "type": "text", "readonly": false, "cmd": "mf ips/engineering_password"},
|
||||
{"path": "ips/atob", "type": "float", "readonly": false, "cmd": "mf ips/atob", "description": "Amp/Tesla"},
|
||||
{"path": "ips/inductance", "type": "float", "readonly": false, "cmd": "mf ips/inductance", "description": "henries"},
|
||||
{"path": "ips/switch_heater_current", "type": "float", "readonly": false, "cmd": "mf ips/switch_heater_current", "description": "switch heater current [mA]"}]},
|
||||
|
||||
"lev": {"base": "/lev", "params": [
|
||||
{"path": "", "type": "float", "kids": 4},
|
||||
{"path": "send", "type": "text", "readonly": false, "cmd": "lev send", "visibility": 3},
|
||||
{"path": "status", "type": "text", "visibility": 3},
|
||||
{"path": "mode", "type": "enum", "enum": {"slow": 0, "fast": 1}, "readonly": false, "cmd": "lev mode"},
|
||||
{"path": "n2", "type": "float"}]},
|
||||
|
||||
"ln2fill": {"base": "/ln2fill", "params": [
|
||||
{"path": "", "type": "enum", "enum": {"watching": 0, "filling": 1, "inactive": 2, "manualfill": 3}, "readonly": false, "cmd": "ln2fill", "kids": 14},
|
||||
{"path": "send", "type": "text", "readonly": false, "cmd": "ln2fill send", "visibility": 3},
|
||||
{"path": "status", "type": "text", "visibility": 3},
|
||||
{"path": "state", "type": "text"},
|
||||
{"path": "readlevel", "type": "text", "readonly": false, "cmd": "ln2fill readlevel", "visibility": 3},
|
||||
{"path": "lowlevel", "type": "float", "readonly": false, "cmd": "ln2fill lowlevel"},
|
||||
{"path": "highlevel", "type": "float", "readonly": false, "cmd": "ln2fill highlevel"},
|
||||
{"path": "smooth", "type": "float"},
|
||||
{"path": "minfillminutes", "type": "float", "readonly": false, "cmd": "ln2fill minfillminutes"},
|
||||
{"path": "maxfillminutes", "type": "float", "readonly": false, "cmd": "ln2fill maxfillminutes"},
|
||||
{"path": "minholdhours", "type": "float", "readonly": false, "cmd": "ln2fill minholdhours"},
|
||||
{"path": "maxholdhours", "type": "float", "readonly": false, "cmd": "ln2fill maxholdhours"},
|
||||
{"path": "tolerance", "type": "float", "readonly": false, "cmd": "ln2fill tolerance"},
|
||||
{"path": "badreadingminutes", "type": "float", "readonly": false, "cmd": "ln2fill badreadingminutes"},
|
||||
{"path": "tubecoolingminutes", "type": "float", "readonly": false, "cmd": "ln2fill tubecoolingminutes"}]},
|
||||
|
||||
"hefill": {"base": "/hefill", "params": [
|
||||
{"path": "", "type": "enum", "enum": {"watching": 0, "filling": 1, "inactive": 2, "manualfill": 3}, "readonly": false, "cmd": "hefill", "kids": 16},
|
||||
{"path": "send", "type": "text", "readonly": false, "cmd": "hefill send", "visibility": 3},
|
||||
{"path": "status", "type": "text", "visibility": 3},
|
||||
{"path": "state", "type": "text"},
|
||||
{"path": "readlevel", "type": "text", "readonly": false, "cmd": "hefill readlevel", "visibility": 3},
|
||||
{"path": "lowlevel", "type": "float", "readonly": false, "cmd": "hefill lowlevel"},
|
||||
{"path": "highlevel", "type": "float", "readonly": false, "cmd": "hefill highlevel"},
|
||||
{"path": "smooth", "type": "float"},
|
||||
{"path": "minfillminutes", "type": "float", "readonly": false, "cmd": "hefill minfillminutes"},
|
||||
{"path": "maxfillminutes", "type": "float", "readonly": false, "cmd": "hefill maxfillminutes"},
|
||||
{"path": "minholdhours", "type": "float", "readonly": false, "cmd": "hefill minholdhours"},
|
||||
{"path": "maxholdhours", "type": "float", "readonly": false, "cmd": "hefill maxholdhours"},
|
||||
{"path": "tolerance", "type": "float", "readonly": false, "cmd": "hefill tolerance"},
|
||||
{"path": "badreadingminutes", "type": "float", "readonly": false, "cmd": "hefill badreadingminutes"},
|
||||
{"path": "tubecoolingminutes", "type": "float", "readonly": false, "cmd": "hefill tubecoolingminutes"},
|
||||
{"path": "vessellimit", "type": "float", "readonly": false, "cmd": "hefill vessellimit"},
|
||||
{"path": "vext", "type": "float"}]},
|
||||
|
||||
"table": {"base": "/table", "params": [
|
||||
{"path": "", "type": "none", "kids": 17},
|
||||
{"path": "send", "type": "text", "readonly": false, "cmd": "table send", "visibility": 3},
|
||||
{"path": "status", "type": "text", "visibility": 3},
|
||||
{"path": "fix_tt_set_prop", "type": "bool", "readonly": false, "cmd": "table fix_tt_set_prop"},
|
||||
{"path": "val_tt_set_prop", "type": "float"},
|
||||
{"path": "tbl_tt_set_prop", "type": "text", "readonly": false, "cmd": "table tbl_tt_set_prop", "description": "enter value pair separated with colon T1:par1 T2:par2 ..."},
|
||||
{"path": "fix_tt_set_integ", "type": "bool", "readonly": false, "cmd": "table fix_tt_set_integ"},
|
||||
{"path": "val_tt_set_integ", "type": "float"},
|
||||
{"path": "tbl_tt_set_integ", "type": "text", "readonly": false, "cmd": "table tbl_tt_set_integ", "description": "enter value pair separated with colon T1:par1 T2:par2 ..."},
|
||||
{"path": "fix_tt_dblctrl_int2", "type": "bool", "readonly": false, "cmd": "table fix_tt_dblctrl_int2"},
|
||||
{"path": "val_tt_dblctrl_int2", "type": "float"},
|
||||
{"path": "tbl_tt_dblctrl_int2", "type": "text", "readonly": false, "cmd": "table tbl_tt_dblctrl_int2", "description": "enter value pair separated with colon T1:par1 T2:par2 ..."},
|
||||
{"path": "fix_tt_dblctrl_prop_up", "type": "bool", "readonly": false, "cmd": "table fix_tt_dblctrl_prop_up"},
|
||||
{"path": "val_tt_dblctrl_prop_up", "type": "float"},
|
||||
{"path": "tbl_tt_dblctrl_prop_up", "type": "text", "readonly": false, "cmd": "table tbl_tt_dblctrl_prop_up", "description": "enter value pair separated with colon T1:par1 T2:par2 ..."},
|
||||
{"path": "fix_tt_dblctrl_prop_lo", "type": "bool", "readonly": false, "cmd": "table fix_tt_dblctrl_prop_lo"},
|
||||
{"path": "val_tt_dblctrl_prop_lo", "type": "float"},
|
||||
{"path": "tbl_tt_dblctrl_prop_lo", "type": "text", "readonly": false, "cmd": "table tbl_tt_dblctrl_prop_lo", "description": "enter value pair separated with colon T1:par1 T2:par2 ..."}]}}
|
@ -1,426 +0,0 @@
|
||||
{"tt": {"base": "/tt", "params": [
|
||||
{"path": "", "type": "float", "readonly": false, "cmd": "run tt", "description": "tt", "kids": 18},
|
||||
{"path": "send", "type": "text", "readonly": false, "cmd": "tt send", "visibility": 3},
|
||||
{"path": "status", "type": "text", "visibility": 3},
|
||||
{"path": "is_running", "type": "int", "readonly": false, "cmd": "tt is_running", "visibility": 3},
|
||||
{"path": "mainloop", "type": "text", "readonly": false, "cmd": "tt mainloop", "visibility": 3},
|
||||
{"path": "target", "type": "float"},
|
||||
{"path": "running", "type": "int"},
|
||||
{"path": "tolerance", "type": "float", "readonly": false, "cmd": "tt tolerance"},
|
||||
{"path": "maxwait", "type": "float", "readonly": false, "cmd": "tt maxwait"},
|
||||
{"path": "settle", "type": "float", "readonly": false, "cmd": "tt settle"},
|
||||
{"path": "log", "type": "text", "readonly": false, "cmd": "tt log", "visibility": 3, "kids": 4},
|
||||
{"path": "log/mean", "type": "float", "visibility": 3},
|
||||
{"path": "log/m2", "type": "float", "visibility": 3},
|
||||
{"path": "log/stddev", "type": "float", "visibility": 3},
|
||||
{"path": "log/n", "type": "float", "visibility": 3},
|
||||
{"path": "dblctrl", "type": "bool", "readonly": false, "cmd": "tt dblctrl", "kids": 9},
|
||||
{"path": "dblctrl/tshift", "type": "float", "readonly": false, "cmd": "tt dblctrl/tshift"},
|
||||
{"path": "dblctrl/mode", "type": "enum", "enum": {"disabled": -1, "inactive": 0, "stable": 1, "up": 2, "down": 3}, "readonly": false, "cmd": "tt dblctrl/mode"},
|
||||
{"path": "dblctrl/shift_up", "type": "float"},
|
||||
{"path": "dblctrl/shift_lo", "type": "float"},
|
||||
{"path": "dblctrl/t_min", "type": "float"},
|
||||
{"path": "dblctrl/t_max", "type": "float"},
|
||||
{"path": "dblctrl/int2", "type": "float", "readonly": false, "cmd": "tt dblctrl/int2"},
|
||||
{"path": "dblctrl/prop_up", "type": "float", "readonly": false, "cmd": "tt dblctrl/prop_up"},
|
||||
{"path": "dblctrl/prop_lo", "type": "float", "readonly": false, "cmd": "tt dblctrl/prop_lo"},
|
||||
{"path": "tm", "type": "float", "kids": 4},
|
||||
{"path": "tm/curve", "type": "text", "readonly": false, "cmd": "tt tm/curve", "kids": 1},
|
||||
{"path": "tm/curve/points", "type": "floatvarar", "readonly": false, "cmd": "tt tm/curve/points", "visibility": 3},
|
||||
{"path": "tm/alarm", "type": "float", "readonly": false, "cmd": "tt tm/alarm"},
|
||||
{"path": "tm/stddev", "type": "float"},
|
||||
{"path": "tm/raw", "type": "float"},
|
||||
{"path": "ts", "type": "float", "kids": 4},
|
||||
{"path": "ts/curve", "type": "text", "readonly": false, "cmd": "tt ts/curve", "kids": 1},
|
||||
{"path": "ts/curve/points", "type": "floatvarar", "readonly": false, "cmd": "tt ts/curve/points", "visibility": 3},
|
||||
{"path": "ts/alarm", "type": "float", "readonly": false, "cmd": "tt ts/alarm"},
|
||||
{"path": "ts/stddev", "type": "float"},
|
||||
{"path": "ts/raw", "type": "float"},
|
||||
{"path": "ts_2", "type": "float", "visibility": 3, "kids": 4},
|
||||
{"path": "ts_2/curve", "type": "text", "readonly": false, "cmd": "tt ts_2/curve", "visibility": 3, "kids": 1},
|
||||
{"path": "ts_2/curve/points", "type": "floatvarar", "readonly": false, "cmd": "tt ts_2/curve/points", "visibility": 3},
|
||||
{"path": "ts_2/alarm", "type": "float", "readonly": false, "cmd": "tt ts_2/alarm", "visibility": 3},
|
||||
{"path": "ts_2/stddev", "type": "float", "visibility": 3},
|
||||
{"path": "ts_2/raw", "type": "float", "visibility": 3},
|
||||
{"path": "set", "type": "float", "readonly": false, "cmd": "tt set", "kids": 18},
|
||||
{"path": "set/mode", "type": "enum", "enum": {"disabled": -1, "off": 0, "controlling": 1, "manual": 2}, "readonly": false, "cmd": "tt set/mode"},
|
||||
{"path": "set/reg", "type": "float"},
|
||||
{"path": "set/ramp", "type": "float", "readonly": false, "cmd": "tt set/ramp", "description": "maximum ramp in K/min (0: ramp off)"},
|
||||
{"path": "set/wramp", "type": "float", "readonly": false, "cmd": "tt set/wramp"},
|
||||
{"path": "set/smooth", "type": "float", "readonly": false, "cmd": "tt set/smooth", "description": "smooth time (minutes)"},
|
||||
{"path": "set/channel", "type": "text", "readonly": false, "cmd": "tt set/channel"},
|
||||
{"path": "set/limit", "type": "float", "readonly": false, "cmd": "tt set/limit"},
|
||||
{"path": "set/resist", "type": "float", "readonly": false, "cmd": "tt set/resist"},
|
||||
{"path": "set/maxheater", "type": "text", "readonly": false, "cmd": "tt set/maxheater", "description": "maximum heater limit, units should be given without space: W, mW, A, mA"},
|
||||
{"path": "set/linearpower", "type": "float", "readonly": false, "cmd": "tt set/linearpower", "description": "when not 0, it is the maximum effective power, and the power is linear to the heater output"},
|
||||
{"path": "set/maxpowerlim", "type": "float", "description": "the maximum power limit (before any booster or converter)"},
|
||||
{"path": "set/maxpower", "type": "float", "readonly": false, "cmd": "tt set/maxpower", "description": "maximum power [W]"},
|
||||
{"path": "set/maxcurrent", "type": "float", "description": "the maximum current before any booster or converter"},
|
||||
{"path": "set/power", "type": "float"},
|
||||
{"path": "set/prop", "type": "float", "readonly": false, "cmd": "tt set/prop", "description": "bigger means more gain"},
|
||||
{"path": "set/integ", "type": "float", "readonly": false, "cmd": "tt set/integ", "description": "bigger means faster"},
|
||||
{"path": "set/deriv", "type": "float", "readonly": false, "cmd": "tt set/deriv"},
|
||||
{"path": "setsamp", "type": "float", "readonly": false, "cmd": "tt setsamp", "kids": 18},
|
||||
{"path": "setsamp/mode", "type": "enum", "enum": {"disabled": -1, "off": 0, "controlling": 1, "manual": 2}, "readonly": false, "cmd": "tt setsamp/mode"},
|
||||
{"path": "setsamp/reg", "type": "float"},
|
||||
{"path": "setsamp/ramp", "type": "float", "readonly": false, "cmd": "tt setsamp/ramp", "description": "maximum ramp in K/min (0: ramp off)"},
|
||||
{"path": "setsamp/wramp", "type": "float", "readonly": false, "cmd": "tt setsamp/wramp"},
|
||||
{"path": "setsamp/smooth", "type": "float", "readonly": false, "cmd": "tt setsamp/smooth", "description": "smooth time (minutes)"},
|
||||
{"path": "setsamp/channel", "type": "text", "readonly": false, "cmd": "tt setsamp/channel"},
|
||||
{"path": "setsamp/limit", "type": "float", "readonly": false, "cmd": "tt setsamp/limit"},
|
||||
{"path": "setsamp/resist", "type": "float", "readonly": false, "cmd": "tt setsamp/resist"},
|
||||
{"path": "setsamp/maxheater", "type": "text", "readonly": false, "cmd": "tt setsamp/maxheater", "description": "maximum heater limit, units should be given without space: W, mW, A, mA"},
|
||||
{"path": "setsamp/linearpower", "type": "float", "readonly": false, "cmd": "tt setsamp/linearpower", "description": "when not 0, it is the maximum effective power, and the power is linear to the heater output"},
|
||||
{"path": "setsamp/maxpowerlim", "type": "float", "description": "the maximum power limit (before any booster or converter)"},
|
||||
{"path": "setsamp/maxpower", "type": "float", "readonly": false, "cmd": "tt setsamp/maxpower", "description": "maximum power [W]"},
|
||||
{"path": "setsamp/maxcurrent", "type": "float", "description": "the maximum current before any booster or converter"},
|
||||
{"path": "setsamp/power", "type": "float"},
|
||||
{"path": "setsamp/prop", "type": "float", "readonly": false, "cmd": "tt setsamp/prop", "description": "bigger means more gain"},
|
||||
{"path": "setsamp/integ", "type": "float", "readonly": false, "cmd": "tt setsamp/integ", "description": "bigger means faster"},
|
||||
{"path": "setsamp/deriv", "type": "float", "readonly": false, "cmd": "tt setsamp/deriv"},
|
||||
{"path": "voltage/manualpower", "type": "float", "readonly": false, "cmd": "tt voltage/manualpower"},
|
||||
{"path": "display", "type": "text", "readonly": false, "cmd": "tt display"},
|
||||
{"path": "remote", "type": "bool"}]},
|
||||
|
||||
"cc": {"base": "/cc", "params": [
|
||||
{"path": "", "type": "bool", "kids": 96},
|
||||
{"path": "send", "type": "text", "readonly": false, "cmd": "cc send", "visibility": 3},
|
||||
{"path": "status", "type": "text", "visibility": 3},
|
||||
{"path": "autodevice", "type": "bool", "readonly": false, "cmd": "cc autodevice"},
|
||||
{"path": "fav", "type": "bool", "readonly": false, "cmd": "cc fav"},
|
||||
{"path": "f", "type": "float"},
|
||||
{"path": "fs", "type": "enum", "enum": {"ok": 0, "no_sens": 1}, "readonly": false, "cmd": "cc fs"},
|
||||
{"path": "mav", "type": "bool", "readonly": false, "cmd": "cc mav"},
|
||||
{"path": "fm", "type": "enum", "enum": {"idle": 0, "opening": 1, "closing": 2, "opened": 3, "closed": 4, "no_motor": 5}},
|
||||
{"path": "fa", "type": "enum", "enum": {"fixed": 0, "controlled": 1, "automatic": 2, "offline": 3}, "readonly": false, "cmd": "cc fa"},
|
||||
{"path": "mp", "type": "float", "readonly": false, "cmd": "cc mp"},
|
||||
{"path": "msp", "type": "float"},
|
||||
{"path": "mmp", "type": "float"},
|
||||
{"path": "mc", "type": "float", "readonly": false, "cmd": "cc mc"},
|
||||
{"path": "mfc", "type": "float", "readonly": false, "cmd": "cc mfc"},
|
||||
{"path": "moc", "type": "float", "readonly": false, "cmd": "cc moc"},
|
||||
{"path": "mtc", "type": "float", "readonly": false, "cmd": "cc mtc"},
|
||||
{"path": "mtl", "type": "float"},
|
||||
{"path": "mft", "type": "float", "readonly": false, "cmd": "cc mft"},
|
||||
{"path": "mt", "type": "float"},
|
||||
{"path": "mo", "type": "float"},
|
||||
{"path": "mcr", "type": "float"},
|
||||
{"path": "mot", "type": "float"},
|
||||
{"path": "mw", "type": "float", "readonly": false, "cmd": "cc mw", "description": "correction pulse after automatic open"},
|
||||
{"path": "hav", "type": "bool", "readonly": false, "cmd": "cc hav"},
|
||||
{"path": "h", "type": "float"},
|
||||
{"path": "hr", "type": "float"},
|
||||
{"path": "hc", "type": "float"},
|
||||
{"path": "hu", "type": "float"},
|
||||
{"path": "hh", "type": "float", "readonly": false, "cmd": "cc hh"},
|
||||
{"path": "hl", "type": "float", "readonly": false, "cmd": "cc hl"},
|
||||
{"path": "htf", "type": "float", "readonly": false, "cmd": "cc htf", "description": "meas. period in fast mode"},
|
||||
{"path": "hts", "type": "float", "readonly": false, "cmd": "cc hts", "description": "meas. period in slow mode"},
|
||||
{"path": "hd", "type": "float", "readonly": false, "cmd": "cc hd"},
|
||||
{"path": "hwr", "type": "float", "readonly": false, "cmd": "cc hwr"},
|
||||
{"path": "hem", "type": "float", "readonly": false, "cmd": "cc hem", "description": "sensor length in mm from top to empty pos."},
|
||||
{"path": "hfu", "type": "float", "readonly": false, "cmd": "cc hfu", "description": "sensor length in mm from top to full pos."},
|
||||
{"path": "hcd", "type": "enum", "enum": {"stop": 0, "fill": 1, "off": 2, "auto": 3, "manual": 7}, "readonly": false, "cmd": "cc hcd"},
|
||||
{"path": "hv", "type": "enum", "enum": {"fill_valve_off": 0, "filling": 1, "no_fill_valve": 2, "timeout": 3, "timeout1": 4}},
|
||||
{"path": "hsf", "type": "enum", "enum": {"sens_ok": 0, "sens_warm": 1, "no_sens": 2, "timeout": 3, "not_yet_read": 4, "disabled": 5}},
|
||||
{"path": "ha", "type": "bool", "readonly": false, "cmd": "cc ha"},
|
||||
{"path": "hm", "type": "bool"},
|
||||
{"path": "hf", "type": "enum", "enum": {"slow": 0, "fast": 1}, "readonly": false, "cmd": "cc hf"},
|
||||
{"path": "hbe", "type": "bool", "readonly": false, "cmd": "cc hbe"},
|
||||
{"path": "hmf", "type": "float"},
|
||||
{"path": "hms", "type": "float"},
|
||||
{"path": "hit", "type": "float", "readonly": false, "cmd": "cc hit"},
|
||||
{"path": "hft", "type": "int", "readonly": false, "cmd": "cc hft"},
|
||||
{"path": "hea", "type": "enum", "enum": {"0": 0, "1": 1, "6": 6}, "readonly": false, "cmd": "cc hea"},
|
||||
{"path": "hch", "type": "int", "readonly": false, "cmd": "cc hch"},
|
||||
{"path": "hwr0", "type": "float", "readonly": false, "cmd": "cc hwr0"},
|
||||
{"path": "hem0", "type": "float", "readonly": false, "cmd": "cc hem0", "description": "sensor length in mm from top to empty pos."},
|
||||
{"path": "hfu0", "type": "float", "readonly": false, "cmd": "cc hfu0", "description": "sensor length in mm from top to full pos."},
|
||||
{"path": "hd0", "type": "float", "readonly": false, "cmd": "cc hd0", "description": "external sensor drive current (mA)"},
|
||||
{"path": "h0", "type": "float"},
|
||||
{"path": "hs0", "type": "enum", "enum": {"sens_ok": 0, "sens_warm": 1, "no_sens": 2, "timeout": 3, "not_yet_read": 4, "disabled": 5}},
|
||||
{"path": "h1", "type": "float"},
|
||||
{"path": "hs1", "type": "enum", "enum": {"sens_ok": 0, "sens_warm": 1, "no_sens": 2, "timeout": 3, "not_yet_read": 4, "disabled": 5}},
|
||||
{"path": "h2", "type": "float"},
|
||||
{"path": "hs2", "type": "enum", "enum": {"sens_ok": 0, "sens_warm": 1, "no_sens": 2, "timeout": 3, "not_yet_read": 4, "disabled": 5}},
|
||||
{"path": "h3", "type": "float"},
|
||||
{"path": "hs3", "type": "enum", "enum": {"sens_ok": 0, "sens_warm": 1, "no_sens": 2, "timeout": 3, "not_yet_read": 4, "disabled": 5}},
|
||||
{"path": "h4", "type": "float"},
|
||||
{"path": "hs4", "type": "enum", "enum": {"sens_ok": 0, "sens_warm": 1, "no_sens": 2, "timeout": 3, "not_yet_read": 4, "disabled": 5}},
|
||||
{"path": "h5", "type": "float"},
|
||||
{"path": "hs5", "type": "enum", "enum": {"sens_ok": 0, "sens_warm": 1, "no_sens": 2, "timeout": 3, "not_yet_read": 4, "disabled": 5}},
|
||||
{"path": "hfb", "type": "float"},
|
||||
{"path": "nav", "type": "bool", "readonly": false, "cmd": "cc nav"},
|
||||
{"path": "nu", "type": "float"},
|
||||
{"path": "nl", "type": "float"},
|
||||
{"path": "nth", "type": "float", "readonly": false, "cmd": "cc nth"},
|
||||
{"path": "ntc", "type": "float", "readonly": false, "cmd": "cc ntc"},
|
||||
{"path": "ntm", "type": "float", "readonly": false, "cmd": "cc ntm"},
|
||||
{"path": "ns", "type": "enum", "enum": {"sens_ok": 0, "no_sens": 1, "short_circuit": 2, "upside_down": 3, "sens_warm": 4, "empty": 5}},
|
||||
{"path": "na", "type": "bool", "readonly": false, "cmd": "cc na"},
|
||||
{"path": "nv", "type": "enum", "enum": {"fill_valve_off": 0, "filling": 1, "no_fill_valve": 2, "timeout": 3, "timeout1": 4, "boost": 5}},
|
||||
{"path": "nc", "type": "enum", "enum": {"stop": 0, "fill": 1, "off": 2, "auto": 3}, "readonly": false, "cmd": "cc nc"},
|
||||
{"path": "nfb", "type": "float"},
|
||||
{"path": "cda", "type": "float"},
|
||||
{"path": "cdb", "type": "float"},
|
||||
{"path": "cba", "type": "float"},
|
||||
{"path": "cbb", "type": "float"},
|
||||
{"path": "cvs", "type": "int"},
|
||||
{"path": "csp", "type": "int"},
|
||||
{"path": "cdv", "type": "text", "readonly": false, "cmd": "cc cdv"},
|
||||
{"path": "cic", "type": "text", "readonly": false, "cmd": "cc cic"},
|
||||
{"path": "cin", "type": "text"},
|
||||
{"path": "cds", "type": "enum", "enum": {"local": 0, "remote": 1, "loading": 2, "by_code": 3, "by_touch": 4}, "readonly": false, "cmd": "cc cds"},
|
||||
{"path": "timing", "type": "bool", "readonly": false, "cmd": "cc timing"},
|
||||
{"path": "tc", "type": "float", "visibility": 3},
|
||||
{"path": "tn", "type": "float", "visibility": 3},
|
||||
{"path": "th", "type": "float", "visibility": 3},
|
||||
{"path": "tf", "type": "float", "visibility": 3},
|
||||
{"path": "tm", "type": "float", "visibility": 3},
|
||||
{"path": "tv", "type": "float", "visibility": 3},
|
||||
{"path": "tq", "type": "float", "visibility": 3},
|
||||
{"path": "bdl", "type": "float", "readonly": false, "cmd": "cc bdl"}]},
|
||||
|
||||
"nv": {"base": "/nv", "params": [
|
||||
{"path": "", "type": "enum", "enum": {"fixed": 0, "controlled": 1, "automatic": 2, "close": 3, "open": 4}, "readonly": false, "cmd": "nv", "kids": 11},
|
||||
{"path": "send", "type": "text", "readonly": false, "cmd": "nv send", "visibility": 3},
|
||||
{"path": "status", "type": "text", "visibility": 3},
|
||||
{"path": "motstat", "type": "enum", "enum": {"idle": 0, "opening": 1, "closing": 2, "opened": 3, "closed": 4, "no_motor": 5}},
|
||||
{"path": "flow", "type": "float"},
|
||||
{"path": "set", "type": "float", "readonly": false, "cmd": "nv set"},
|
||||
{"path": "flowmax", "type": "float", "readonly": false, "cmd": "nv flowmax"},
|
||||
{"path": "flowp", "type": "float"},
|
||||
{"path": "span", "type": "float"},
|
||||
{"path": "ctrl", "type": "none", "kids": 13},
|
||||
{"path": "ctrl/regtext", "type": "text"},
|
||||
{"path": "ctrl/prop_o", "type": "float", "readonly": false, "cmd": "nv ctrl/prop_o", "description": "prop [sec/mbar] when opening. above 4 mbar a 10 times lower value is used"},
|
||||
{"path": "ctrl/prop_c", "type": "float", "readonly": false, "cmd": "nv ctrl/prop_c", "description": "prop [sec/mbar] when closing. above 4 mbar a 10 times lower value is used"},
|
||||
{"path": "ctrl/deriv_o", "type": "float", "readonly": false, "cmd": "nv ctrl/deriv_o", "description": "convergence target time [sec] when opening"},
|
||||
{"path": "ctrl/deriv_c", "type": "float", "readonly": false, "cmd": "nv ctrl/deriv_c", "description": "convergence target time [sec] when closing"},
|
||||
{"path": "ctrl/minpulse_o", "type": "float", "readonly": false, "cmd": "nv ctrl/minpulse_o", "description": "minimum close pulse [sec]"},
|
||||
{"path": "ctrl/minpulse_c", "type": "float", "readonly": false, "cmd": "nv ctrl/minpulse_c", "description": "standard close pulse [sec]"},
|
||||
{"path": "ctrl/hystpulse_o", "type": "float", "readonly": false, "cmd": "nv ctrl/hystpulse_o", "description": "motor pulse to overcome hysteresis when opening"},
|
||||
{"path": "ctrl/hystpulse_c", "type": "float", "readonly": false, "cmd": "nv ctrl/hystpulse_c", "description": "motor pulse to overcome hysteresis when closing"},
|
||||
{"path": "ctrl/tol", "type": "float", "readonly": false, "cmd": "nv ctrl/tol", "description": "valid below 3 mbar"},
|
||||
{"path": "ctrl/tolhigh", "type": "float", "readonly": false, "cmd": "nv ctrl/tolhigh", "description": "valid above 4 mbar"},
|
||||
{"path": "ctrl/openpulse", "type": "float", "readonly": false, "cmd": "nv ctrl/openpulse", "description": "time to open from completely closed to a significant opening"},
|
||||
{"path": "ctrl/adjust_minpulse", "type": "bool", "readonly": false, "cmd": "nv ctrl/adjust_minpulse", "description": "adjust minpulse automatically"},
|
||||
{"path": "autoflow", "type": "none", "kids": 24},
|
||||
{"path": "autoflow/suspended", "type": "bool", "readonly": false, "cmd": "nv autoflow/suspended"},
|
||||
{"path": "autoflow/prop", "type": "float", "readonly": false, "cmd": "nv autoflow/prop"},
|
||||
{"path": "autoflow/flowstd", "type": "float", "readonly": false, "cmd": "nv autoflow/flowstd"},
|
||||
{"path": "autoflow/flowlim", "type": "float", "readonly": false, "cmd": "nv autoflow/flowlim"},
|
||||
{"path": "autoflow/smooth", "type": "float", "readonly": false, "cmd": "nv autoflow/smooth"},
|
||||
{"path": "autoflow/difSize", "type": "float", "readonly": false, "cmd": "nv autoflow/difSize"},
|
||||
{"path": "autoflow/difRange", "type": "float", "readonly": false, "cmd": "nv autoflow/difRange"},
|
||||
{"path": "autoflow/flowSize", "type": "float", "readonly": false, "cmd": "nv autoflow/flowSize"},
|
||||
{"path": "autoflow/convTime", "type": "float", "readonly": false, "cmd": "nv autoflow/convTime"},
|
||||
{"path": "autoflow/Tmin", "type": "float", "readonly": false, "cmd": "nv autoflow/Tmin"},
|
||||
{"path": "autoflow/script", "type": "text", "readonly": false, "cmd": "nv autoflow/script"},
|
||||
{"path": "autoflow/getTemp", "type": "text", "readonly": false, "cmd": "nv autoflow/getTemp"},
|
||||
{"path": "autoflow/getTset", "type": "text", "readonly": false, "cmd": "nv autoflow/getTset"},
|
||||
{"path": "autoflow/getFlow", "type": "text", "readonly": false, "cmd": "nv autoflow/getFlow"},
|
||||
{"path": "autoflow/difBuf", "type": "text"},
|
||||
{"path": "autoflow/flowBuf", "type": "text"},
|
||||
{"path": "autoflow/flowset", "type": "float"},
|
||||
{"path": "autoflow/flowmin", "type": "float"},
|
||||
{"path": "autoflow/flowmax", "type": "float"},
|
||||
{"path": "autoflow/difmin", "type": "float"},
|
||||
{"path": "autoflow/difmax", "type": "float"},
|
||||
{"path": "autoflow/setmin", "type": "float"},
|
||||
{"path": "autoflow/setmax", "type": "float"},
|
||||
{"path": "autoflow/flowtarget", "type": "float"},
|
||||
{"path": "calib", "type": "none", "kids": 2},
|
||||
{"path": "calib/ln_per_min_per_mbar", "type": "float", "readonly": false, "cmd": "nv calib/ln_per_min_per_mbar"},
|
||||
{"path": "calib/mbar_offset", "type": "float", "readonly": false, "cmd": "nv calib/mbar_offset"}]},
|
||||
|
||||
"hefill": {"base": "/hefill", "params": [
|
||||
{"path": "", "type": "enum", "enum": {"watching": 0, "filling": 1, "inactive": 2, "manualfill": 3}, "readonly": false, "cmd": "hefill", "kids": 16},
|
||||
{"path": "send", "type": "text", "readonly": false, "cmd": "hefill send", "visibility": 3},
|
||||
{"path": "status", "type": "text", "visibility": 3},
|
||||
{"path": "state", "type": "text"},
|
||||
{"path": "readlevel", "type": "text", "readonly": false, "cmd": "hefill readlevel", "visibility": 3},
|
||||
{"path": "lowlevel", "type": "float", "readonly": false, "cmd": "hefill lowlevel"},
|
||||
{"path": "highlevel", "type": "float", "readonly": false, "cmd": "hefill highlevel"},
|
||||
{"path": "smooth", "type": "float"},
|
||||
{"path": "minfillminutes", "type": "float", "readonly": false, "cmd": "hefill minfillminutes"},
|
||||
{"path": "maxfillminutes", "type": "float", "readonly": false, "cmd": "hefill maxfillminutes"},
|
||||
{"path": "minholdhours", "type": "float", "readonly": false, "cmd": "hefill minholdhours"},
|
||||
{"path": "maxholdhours", "type": "float", "readonly": false, "cmd": "hefill maxholdhours"},
|
||||
{"path": "tolerance", "type": "float", "readonly": false, "cmd": "hefill tolerance"},
|
||||
{"path": "badreadingminutes", "type": "float", "readonly": false, "cmd": "hefill badreadingminutes"},
|
||||
{"path": "tubecoolingminutes", "type": "float", "readonly": false, "cmd": "hefill tubecoolingminutes"},
|
||||
{"path": "vessellimit", "type": "float", "readonly": false, "cmd": "hefill vessellimit"},
|
||||
{"path": "vext", "type": "float"}]},
|
||||
|
||||
"hepump": {"base": "/hepump", "params": [
|
||||
{"path": "", "type": "enum", "enum": {"neodry": 8, "xds35_auto": 0, "xds35_manual": 1, "sv65": 2, "other": 3, "no": -1}, "readonly": false, "cmd": "hepump", "description": "xds35: scroll pump, sv65: leybold", "kids": 10},
|
||||
{"path": "send", "type": "text", "readonly": false, "cmd": "hepump send", "visibility": 3},
|
||||
{"path": "status", "type": "text", "visibility": 3},
|
||||
{"path": "running", "type": "bool", "readonly": false, "cmd": "hepump running"},
|
||||
{"path": "eco", "type": "bool", "readonly": false, "cmd": "hepump eco"},
|
||||
{"path": "auto", "type": "bool", "readonly": false, "cmd": "hepump auto"},
|
||||
{"path": "valve", "type": "enum", "enum": {"closed": 0, "closing": 1, "opening": 2, "opened": 3, "undefined": 4}, "readonly": false, "cmd": "hepump valve"},
|
||||
{"path": "eco_t_lim", "type": "float", "readonly": false, "cmd": "hepump eco_t_lim", "description": "switch off eco mode when T_set < eco_t_lim and T < eco_t_lim * 2"},
|
||||
{"path": "calib", "type": "float", "readonly": false, "cmd": "hepump calib", "visibility": 3},
|
||||
{"path": "health", "type": "float"}]},
|
||||
|
||||
"hemot": {"base": "/hepump/hemot", "params": [
|
||||
{"path": "", "type": "float", "readonly": false, "cmd": "run hemot", "kids": 30},
|
||||
{"path": "send", "type": "text", "readonly": false, "cmd": "hemot send", "visibility": 3},
|
||||
{"path": "status", "type": "text", "visibility": 3},
|
||||
{"path": "is_running", "type": "int", "readonly": false, "cmd": "hemot is_running", "visibility": 3},
|
||||
{"path": "pos", "type": "float"},
|
||||
{"path": "encoder", "type": "float"},
|
||||
{"path": "zero", "type": "float", "readonly": false, "cmd": "hemot zero"},
|
||||
{"path": "lowerlimit", "type": "float", "readonly": false, "cmd": "hemot lowerlimit"},
|
||||
{"path": "upperlimit", "type": "float", "readonly": false, "cmd": "hemot upperlimit"},
|
||||
{"path": "disablelimits", "type": "bool", "readonly": false, "cmd": "hemot disablelimits"},
|
||||
{"path": "verbose", "type": "bool", "readonly": false, "cmd": "hemot verbose"},
|
||||
{"path": "target", "type": "float"},
|
||||
{"path": "runstate", "type": "enum", "enum": {"idle": 0, "running": 1, "finished": 2, "error": 3}},
|
||||
{"path": "precision", "type": "float", "readonly": false, "cmd": "hemot precision"},
|
||||
{"path": "maxencdif", "type": "float", "readonly": false, "cmd": "hemot maxencdif"},
|
||||
{"path": "id", "type": "float", "readonly": false, "cmd": "hemot id"},
|
||||
{"path": "pump_number", "type": "float", "readonly": false, "cmd": "hemot pump_number"},
|
||||
{"path": "init", "type": "float", "readonly": false, "cmd": "hemot init"},
|
||||
{"path": "maxspeed", "type": "float", "readonly": false, "cmd": "hemot maxspeed"},
|
||||
{"path": "acceleration", "type": "float", "readonly": false, "cmd": "hemot acceleration"},
|
||||
{"path": "maxcurrent", "type": "float", "readonly": false, "cmd": "hemot maxcurrent"},
|
||||
{"path": "standbycurrent", "type": "float", "readonly": false, "cmd": "hemot standbycurrent"},
|
||||
{"path": "freewheeling", "type": "bool", "readonly": false, "cmd": "hemot freewheeling"},
|
||||
{"path": "output0", "type": "bool", "readonly": false, "cmd": "hemot output0"},
|
||||
{"path": "output1", "type": "bool", "readonly": false, "cmd": "hemot output1"},
|
||||
{"path": "input3", "type": "bool"},
|
||||
{"path": "pullup", "type": "float", "readonly": false, "cmd": "hemot pullup"},
|
||||
{"path": "nopumpfeedback", "type": "bool", "readonly": false, "cmd": "hemot nopumpfeedback"},
|
||||
{"path": "eeprom", "type": "enum", "enum": {"ok": 0, "dirty": 1, "save": 2, "load": 3}, "readonly": false, "cmd": "hemot eeprom"},
|
||||
{"path": "customadr", "type": "text", "readonly": false, "cmd": "hemot customadr"},
|
||||
{"path": "custompar", "type": "float", "readonly": false, "cmd": "hemot custompar"}]},
|
||||
|
||||
"nvflow": {"base": "/nvflow", "params": [
|
||||
{"path": "", "type": "float", "kids": 7},
|
||||
{"path": "send", "type": "text", "readonly": false, "cmd": "nvflow send", "visibility": 3},
|
||||
{"path": "status", "type": "text", "visibility": 3},
|
||||
{"path": "stddev", "type": "float"},
|
||||
{"path": "nsamples", "type": "int", "readonly": false, "cmd": "nvflow nsamples"},
|
||||
{"path": "offset", "type": "float", "readonly": false, "cmd": "nvflow offset"},
|
||||
{"path": "scale", "type": "float", "readonly": false, "cmd": "nvflow scale"},
|
||||
{"path": "save", "type": "bool", "readonly": false, "cmd": "nvflow save", "description": "unchecked: current calib is not saved. set checked: save calib"}]},
|
||||
|
||||
"ln2fill": {"base": "/ln2fill", "params": [
|
||||
{"path": "", "type": "enum", "enum": {"watching": 0, "filling": 1, "inactive": 2, "manualfill": 3}, "readonly": false, "cmd": "ln2fill", "kids": 14},
|
||||
{"path": "send", "type": "text", "readonly": false, "cmd": "ln2fill send", "visibility": 3},
|
||||
{"path": "status", "type": "text", "visibility": 3},
|
||||
{"path": "state", "type": "text"},
|
||||
{"path": "readlevel", "type": "text", "readonly": false, "cmd": "ln2fill readlevel", "visibility": 3},
|
||||
{"path": "lowlevel", "type": "float", "readonly": false, "cmd": "ln2fill lowlevel"},
|
||||
{"path": "highlevel", "type": "float", "readonly": false, "cmd": "ln2fill highlevel"},
|
||||
{"path": "smooth", "type": "float"},
|
||||
{"path": "minfillminutes", "type": "float", "readonly": false, "cmd": "ln2fill minfillminutes"},
|
||||
{"path": "maxfillminutes", "type": "float", "readonly": false, "cmd": "ln2fill maxfillminutes"},
|
||||
{"path": "minholdhours", "type": "float", "readonly": false, "cmd": "ln2fill minholdhours"},
|
||||
{"path": "maxholdhours", "type": "float", "readonly": false, "cmd": "ln2fill maxholdhours"},
|
||||
{"path": "tolerance", "type": "float", "readonly": false, "cmd": "ln2fill tolerance"},
|
||||
{"path": "badreadingminutes", "type": "float", "readonly": false, "cmd": "ln2fill badreadingminutes"},
|
||||
{"path": "tubecoolingminutes", "type": "float", "readonly": false, "cmd": "ln2fill tubecoolingminutes"}]},
|
||||
|
||||
"mf": {"base": "/mf", "params": [
|
||||
{"path": "", "type": "float", "readonly": false, "cmd": "run mf", "kids": 26},
|
||||
{"path": "persmode", "type": "int", "readonly": false, "cmd": "mf persmode"},
|
||||
{"path": "perswitch", "type": "int"},
|
||||
{"path": "nowait", "type": "int", "readonly": false, "cmd": "mf nowait"},
|
||||
{"path": "maxlimit", "type": "float", "visibility": 3},
|
||||
{"path": "limit", "type": "float", "readonly": false, "cmd": "mf limit"},
|
||||
{"path": "ramp", "type": "float", "readonly": false, "cmd": "mf ramp"},
|
||||
{"path": "perscurrent", "type": "float", "readonly": false, "cmd": "mf perscurrent"},
|
||||
{"path": "perslimit", "type": "float", "readonly": false, "cmd": "mf perslimit"},
|
||||
{"path": "perswait", "type": "int", "readonly": false, "cmd": "mf perswait"},
|
||||
{"path": "persdelay", "type": "int", "readonly": false, "cmd": "mf persdelay"},
|
||||
{"path": "current", "type": "float"},
|
||||
{"path": "measured", "type": "float"},
|
||||
{"path": "voltage", "type": "float"},
|
||||
{"path": "lastfield", "type": "float", "visibility": 3},
|
||||
{"path": "ampRamp", "type": "float", "visibility": 3},
|
||||
{"path": "inductance", "type": "float", "visibility": 3},
|
||||
{"path": "trainedTo", "type": "float", "readonly": false, "cmd": "mf trainedTo"},
|
||||
{"path": "trainMode", "type": "int"},
|
||||
{"path": "external", "type": "int", "readonly": false, "cmd": "mf external"},
|
||||
{"path": "startScript", "type": "text", "readonly": false, "cmd": "mf startScript", "visibility": 3},
|
||||
{"path": "is_running", "type": "int", "readonly": false, "cmd": "mf is_running", "visibility": 3},
|
||||
{"path": "verbose", "type": "int", "readonly": false, "cmd": "mf verbose", "visibility": 3},
|
||||
{"path": "driver", "type": "text", "visibility": 3},
|
||||
{"path": "creationCmd", "type": "text", "visibility": 3},
|
||||
{"path": "targetValue", "type": "float"},
|
||||
{"path": "status", "type": "text", "readonly": false, "cmd": "mf status", "visibility": 3}]},
|
||||
|
||||
"lev": {"base": "/lev", "params": [
|
||||
{"path": "", "type": "float", "kids": 4},
|
||||
{"path": "send", "type": "text", "readonly": false, "cmd": "lev send", "visibility": 3},
|
||||
{"path": "status", "type": "text", "visibility": 3},
|
||||
{"path": "mode", "type": "enum", "enum": {"slow": 0, "fast (switches to slow automatically after filling)": 1}, "readonly": false, "cmd": "lev mode"},
|
||||
{"path": "n2", "type": "float"}]},
|
||||
|
||||
"tcoil": {"base": "/tcoil", "params": [
|
||||
{"path": "", "type": "float", "kids": 11},
|
||||
{"path": "send", "type": "text", "readonly": false, "cmd": "tcoil send", "visibility": 3},
|
||||
{"path": "status", "type": "text", "visibility": 3},
|
||||
{"path": "excitation", "type": "float", "readonly": false, "cmd": "tcoil excitation", "visibility": 3},
|
||||
{"path": "ta", "type": "float", "kids": 3},
|
||||
{"path": "ta/enable", "type": "bool", "readonly": false, "cmd": "tcoil ta/enable"},
|
||||
{"path": "ta/r", "type": "float"},
|
||||
{"path": "ta/curve", "type": "text", "readonly": false, "cmd": "tcoil ta/curve", "kids": 3},
|
||||
{"path": "ta/curve/adjust", "type": "text", "readonly": false, "cmd": "tcoil ta/curve/adjust"},
|
||||
{"path": "ta/curve/points", "type": "floatvarar", "readonly": false, "cmd": "tcoil ta/curve/points"},
|
||||
{"path": "ta/curve/cpoints", "type": "floatvarar", "readonly": false, "cmd": "tcoil ta/curve/cpoints"},
|
||||
{"path": "tb", "type": "float", "kids": 3},
|
||||
{"path": "tb/enable", "type": "bool", "readonly": false, "cmd": "tcoil tb/enable"},
|
||||
{"path": "tb/r", "type": "float"},
|
||||
{"path": "tb/curve", "type": "text", "readonly": false, "cmd": "tcoil tb/curve", "kids": 3},
|
||||
{"path": "tb/curve/adjust", "type": "text", "readonly": false, "cmd": "tcoil tb/curve/adjust"},
|
||||
{"path": "tb/curve/points", "type": "floatvarar", "readonly": false, "cmd": "tcoil tb/curve/points"},
|
||||
{"path": "tb/curve/cpoints", "type": "floatvarar", "readonly": false, "cmd": "tcoil tb/curve/cpoints"},
|
||||
{"path": "td", "type": "float", "visibility": 3, "kids": 3},
|
||||
{"path": "td/enable", "type": "bool", "readonly": false, "cmd": "tcoil td/enable"},
|
||||
{"path": "td/r", "type": "float"},
|
||||
{"path": "td/curve", "type": "text", "readonly": false, "cmd": "tcoil td/curve", "kids": 3},
|
||||
{"path": "td/curve/adjust", "type": "text", "readonly": false, "cmd": "tcoil td/curve/adjust"},
|
||||
{"path": "td/curve/points", "type": "floatvarar", "readonly": false, "cmd": "tcoil td/curve/points"},
|
||||
{"path": "td/curve/cpoints", "type": "floatvarar", "readonly": false, "cmd": "tcoil td/curve/cpoints"},
|
||||
{"path": "ref", "type": "float", "visibility": 3, "kids": 3},
|
||||
{"path": "ref/enable", "type": "bool", "readonly": false, "cmd": "tcoil ref/enable"},
|
||||
{"path": "ref/r", "type": "float"},
|
||||
{"path": "ref/curve", "type": "text", "readonly": false, "cmd": "tcoil ref/curve", "kids": 3},
|
||||
{"path": "ref/curve/adjust", "type": "text", "readonly": false, "cmd": "tcoil ref/curve/adjust"},
|
||||
{"path": "ref/curve/points", "type": "floatvarar", "readonly": false, "cmd": "tcoil ref/curve/points"},
|
||||
{"path": "ref/curve/cpoints", "type": "floatvarar", "readonly": false, "cmd": "tcoil ref/curve/cpoints"},
|
||||
{"path": "tc", "type": "float", "visibility": 3, "kids": 3},
|
||||
{"path": "tc/enable", "type": "bool", "readonly": false, "cmd": "tcoil tc/enable"},
|
||||
{"path": "tc/r", "type": "float"},
|
||||
{"path": "tc/curve", "type": "text", "readonly": false, "cmd": "tcoil tc/curve", "kids": 3},
|
||||
{"path": "tc/curve/adjust", "type": "text", "readonly": false, "cmd": "tcoil tc/curve/adjust"},
|
||||
{"path": "tc/curve/points", "type": "floatvarar", "readonly": false, "cmd": "tcoil tc/curve/points"},
|
||||
{"path": "tc/curve/cpoints", "type": "floatvarar", "readonly": false, "cmd": "tcoil tc/curve/cpoints"},
|
||||
{"path": "ext", "type": "float", "visibility": 3},
|
||||
{"path": "com", "type": "float", "visibility": 3},
|
||||
{"path": "gnd", "type": "float", "visibility": 3}]},
|
||||
|
||||
"table": {"base": "/table", "params": [
|
||||
{"path": "", "type": "none", "kids": 17},
|
||||
{"path": "send", "type": "text", "readonly": false, "cmd": "table send", "visibility": 3},
|
||||
{"path": "status", "type": "text", "visibility": 3},
|
||||
{"path": "fix_tt_set_prop", "type": "bool", "readonly": false, "cmd": "table fix_tt_set_prop"},
|
||||
{"path": "val_tt_set_prop", "type": "float"},
|
||||
{"path": "tbl_tt_set_prop", "type": "text", "readonly": false, "cmd": "table tbl_tt_set_prop", "description": "enter value pair separated with colon T1:par1 T2:par2 ..."},
|
||||
{"path": "fix_tt_set_integ", "type": "bool", "readonly": false, "cmd": "table fix_tt_set_integ"},
|
||||
{"path": "val_tt_set_integ", "type": "float"},
|
||||
{"path": "tbl_tt_set_integ", "type": "text", "readonly": false, "cmd": "table tbl_tt_set_integ", "description": "enter value pair separated with colon T1:par1 T2:par2 ..."},
|
||||
{"path": "fix_tt_dblctrl_int2", "type": "bool", "readonly": false, "cmd": "table fix_tt_dblctrl_int2"},
|
||||
{"path": "val_tt_dblctrl_int2", "type": "float"},
|
||||
{"path": "tbl_tt_dblctrl_int2", "type": "text", "readonly": false, "cmd": "table tbl_tt_dblctrl_int2", "description": "enter value pair separated with colon T1:par1 T2:par2 ..."},
|
||||
{"path": "fix_tt_dblctrl_prop_up", "type": "bool", "readonly": false, "cmd": "table fix_tt_dblctrl_prop_up"},
|
||||
{"path": "val_tt_dblctrl_prop_up", "type": "float"},
|
||||
{"path": "tbl_tt_dblctrl_prop_up", "type": "text", "readonly": false, "cmd": "table tbl_tt_dblctrl_prop_up", "description": "enter value pair separated with colon T1:par1 T2:par2 ..."},
|
||||
{"path": "fix_tt_dblctrl_prop_lo", "type": "bool", "readonly": false, "cmd": "table fix_tt_dblctrl_prop_lo"},
|
||||
{"path": "val_tt_dblctrl_prop_lo", "type": "float"},
|
||||
{"path": "tbl_tt_dblctrl_prop_lo", "type": "text", "readonly": false, "cmd": "table tbl_tt_dblctrl_prop_lo", "description": "enter value pair separated with colon T1:par1 T2:par2 ..."}]}}
|
@ -1,421 +0,0 @@
|
||||
{"tt": {"base": "/tt", "params": [
|
||||
{"path": "", "type": "float", "readonly": false, "cmd": "run tt", "description": "tt", "kids": 17},
|
||||
{"path": "send", "type": "text", "readonly": false, "cmd": "tt send", "visibility": 3},
|
||||
{"path": "status", "type": "text", "visibility": 3},
|
||||
{"path": "is_running", "type": "int", "readonly": false, "cmd": "tt is_running", "visibility": 3},
|
||||
{"path": "mainloop", "type": "text", "readonly": false, "cmd": "tt mainloop", "visibility": 3},
|
||||
{"path": "target", "type": "float"},
|
||||
{"path": "running", "type": "int"},
|
||||
{"path": "tolerance", "type": "float", "readonly": false, "cmd": "tt tolerance"},
|
||||
{"path": "maxwait", "type": "float", "readonly": false, "cmd": "tt maxwait"},
|
||||
{"path": "settle", "type": "float", "readonly": false, "cmd": "tt settle"},
|
||||
{"path": "log", "type": "text", "readonly": false, "cmd": "tt log", "visibility": 3, "kids": 4},
|
||||
{"path": "log/mean", "type": "float", "visibility": 3},
|
||||
{"path": "log/m2", "type": "float", "visibility": 3},
|
||||
{"path": "log/stddev", "type": "float", "visibility": 3},
|
||||
{"path": "log/n", "type": "float", "visibility": 3},
|
||||
{"path": "dblctrl", "type": "bool", "readonly": false, "cmd": "tt dblctrl", "kids": 9},
|
||||
{"path": "dblctrl/tshift", "type": "float", "readonly": false, "cmd": "tt dblctrl/tshift"},
|
||||
{"path": "dblctrl/mode", "type": "enum", "enum": {"disabled": -1, "inactive": 0, "stable": 1, "up": 2, "down": 3}, "readonly": false, "cmd": "tt dblctrl/mode"},
|
||||
{"path": "dblctrl/shift_up", "type": "float"},
|
||||
{"path": "dblctrl/shift_lo", "type": "float"},
|
||||
{"path": "dblctrl/t_min", "type": "float"},
|
||||
{"path": "dblctrl/t_max", "type": "float"},
|
||||
{"path": "dblctrl/int2", "type": "float", "readonly": false, "cmd": "tt dblctrl/int2"},
|
||||
{"path": "dblctrl/prop_up", "type": "float", "readonly": false, "cmd": "tt dblctrl/prop_up"},
|
||||
{"path": "dblctrl/prop_lo", "type": "float", "readonly": false, "cmd": "tt dblctrl/prop_lo"},
|
||||
{"path": "tm", "type": "float", "kids": 4},
|
||||
{"path": "tm/curve", "type": "text", "readonly": false, "cmd": "tt tm/curve", "kids": 1},
|
||||
{"path": "tm/curve/points", "type": "floatvarar", "readonly": false, "cmd": "tt tm/curve/points", "visibility": 3},
|
||||
{"path": "tm/alarm", "type": "float", "readonly": false, "cmd": "tt tm/alarm"},
|
||||
{"path": "tm/stddev", "type": "float"},
|
||||
{"path": "tm/raw", "type": "float"},
|
||||
{"path": "ts", "type": "float", "kids": 4},
|
||||
{"path": "ts/curve", "type": "text", "readonly": false, "cmd": "tt ts/curve", "kids": 1},
|
||||
{"path": "ts/curve/points", "type": "floatvarar", "readonly": false, "cmd": "tt ts/curve/points", "visibility": 3},
|
||||
{"path": "ts/alarm", "type": "float", "readonly": false, "cmd": "tt ts/alarm"},
|
||||
{"path": "ts/stddev", "type": "float"},
|
||||
{"path": "ts/raw", "type": "float"},
|
||||
{"path": "set", "type": "float", "readonly": false, "cmd": "tt set", "kids": 18},
|
||||
{"path": "set/mode", "type": "enum", "enum": {"disabled": -1, "off": 0, "controlling": 1, "manual": 2}, "readonly": false, "cmd": "tt set/mode"},
|
||||
{"path": "set/reg", "type": "float"},
|
||||
{"path": "set/ramp", "type": "float", "readonly": false, "cmd": "tt set/ramp", "description": "maximum ramp in K/min (0: ramp off)"},
|
||||
{"path": "set/wramp", "type": "float", "readonly": false, "cmd": "tt set/wramp"},
|
||||
{"path": "set/smooth", "type": "float", "readonly": false, "cmd": "tt set/smooth", "description": "smooth time (minutes)"},
|
||||
{"path": "set/channel", "type": "text", "readonly": false, "cmd": "tt set/channel"},
|
||||
{"path": "set/limit", "type": "float", "readonly": false, "cmd": "tt set/limit"},
|
||||
{"path": "set/resist", "type": "float", "readonly": false, "cmd": "tt set/resist"},
|
||||
{"path": "set/maxheater", "type": "text", "readonly": false, "cmd": "tt set/maxheater", "description": "maximum heater limit, units should be given without space: W, mW, A, mA"},
|
||||
{"path": "set/linearpower", "type": "float", "readonly": false, "cmd": "tt set/linearpower", "description": "when not 0, it is the maximum effective power, and the power is linear to the heater output"},
|
||||
{"path": "set/maxpowerlim", "type": "float", "description": "the maximum power limit (before any booster or converter)"},
|
||||
{"path": "set/maxpower", "type": "float", "readonly": false, "cmd": "tt set/maxpower", "description": "maximum power [W]"},
|
||||
{"path": "set/maxcurrent", "type": "float", "description": "the maximum current before any booster or converter"},
|
||||
{"path": "set/manualpower", "type": "float", "readonly": false, "cmd": "tt set/manualpower"},
|
||||
{"path": "set/power", "type": "float"},
|
||||
{"path": "set/prop", "type": "float", "readonly": false, "cmd": "tt set/prop", "description": "bigger means more gain"},
|
||||
{"path": "set/integ", "type": "float", "readonly": false, "cmd": "tt set/integ", "description": "bigger means faster"},
|
||||
{"path": "set/deriv", "type": "float", "readonly": false, "cmd": "tt set/deriv"},
|
||||
{"path": "setsamp", "type": "float", "readonly": false, "cmd": "tt setsamp", "kids": 18},
|
||||
{"path": "setsamp/mode", "type": "enum", "enum": {"disabled": -1, "off": 0, "controlling": 1, "manual": 2}, "readonly": false, "cmd": "tt setsamp/mode"},
|
||||
{"path": "setsamp/reg", "type": "float"},
|
||||
{"path": "setsamp/ramp", "type": "float", "readonly": false, "cmd": "tt setsamp/ramp", "description": "maximum ramp in K/min (0: ramp off)"},
|
||||
{"path": "setsamp/wramp", "type": "float", "readonly": false, "cmd": "tt setsamp/wramp"},
|
||||
{"path": "setsamp/smooth", "type": "float", "readonly": false, "cmd": "tt setsamp/smooth", "description": "smooth time (minutes)"},
|
||||
{"path": "setsamp/channel", "type": "text", "readonly": false, "cmd": "tt setsamp/channel"},
|
||||
{"path": "setsamp/limit", "type": "float", "readonly": false, "cmd": "tt setsamp/limit"},
|
||||
{"path": "setsamp/resist", "type": "float", "readonly": false, "cmd": "tt setsamp/resist"},
|
||||
{"path": "setsamp/maxheater", "type": "text", "readonly": false, "cmd": "tt setsamp/maxheater", "description": "maximum heater limit, units should be given without space: W, mW, A, mA"},
|
||||
{"path": "setsamp/linearpower", "type": "float", "readonly": false, "cmd": "tt setsamp/linearpower", "description": "when not 0, it is the maximum effective power, and the power is linear to the heater output"},
|
||||
{"path": "setsamp/maxpowerlim", "type": "float", "description": "the maximum power limit (before any booster or converter)"},
|
||||
{"path": "setsamp/maxpower", "type": "float", "readonly": false, "cmd": "tt setsamp/maxpower", "description": "maximum power [W]"},
|
||||
{"path": "setsamp/maxcurrent", "type": "float", "description": "the maximum current before any booster or converter"},
|
||||
{"path": "setsamp/manualpower", "type": "float", "readonly": false, "cmd": "tt setsamp/manualpower"},
|
||||
{"path": "setsamp/power", "type": "float"},
|
||||
{"path": "setsamp/prop", "type": "float", "readonly": false, "cmd": "tt setsamp/prop", "description": "bigger means more gain"},
|
||||
{"path": "setsamp/integ", "type": "float", "readonly": false, "cmd": "tt setsamp/integ", "description": "bigger means faster"},
|
||||
{"path": "setsamp/deriv", "type": "float", "readonly": false, "cmd": "tt setsamp/deriv"},
|
||||
{"path": "display", "type": "text", "readonly": false, "cmd": "tt display"},
|
||||
{"path": "remote", "type": "bool"}]},
|
||||
|
||||
"cc": {"base": "/cc", "params": [
|
||||
{"path": "", "type": "bool", "kids": 96},
|
||||
{"path": "send", "type": "text", "readonly": false, "cmd": "cc send", "visibility": 3},
|
||||
{"path": "status", "type": "text", "visibility": 3},
|
||||
{"path": "autodevice", "type": "bool", "readonly": false, "cmd": "cc autodevice"},
|
||||
{"path": "fav", "type": "bool", "readonly": false, "cmd": "cc fav"},
|
||||
{"path": "f", "type": "float"},
|
||||
{"path": "fs", "type": "enum", "enum": {"ok": 0, "no_sens": 1}, "readonly": false, "cmd": "cc fs"},
|
||||
{"path": "mav", "type": "bool", "readonly": false, "cmd": "cc mav"},
|
||||
{"path": "fm", "type": "enum", "enum": {"idle": 0, "opening": 1, "closing": 2, "opened": 3, "closed": 4, "no_motor": 5}},
|
||||
{"path": "fa", "type": "enum", "enum": {"fixed": 0, "controlled": 1, "automatic": 2, "offline": 3}, "readonly": false, "cmd": "cc fa"},
|
||||
{"path": "mp", "type": "float", "readonly": false, "cmd": "cc mp"},
|
||||
{"path": "msp", "type": "float"},
|
||||
{"path": "mmp", "type": "float"},
|
||||
{"path": "mc", "type": "float", "readonly": false, "cmd": "cc mc"},
|
||||
{"path": "mfc", "type": "float", "readonly": false, "cmd": "cc mfc"},
|
||||
{"path": "moc", "type": "float", "readonly": false, "cmd": "cc moc"},
|
||||
{"path": "mtc", "type": "float", "readonly": false, "cmd": "cc mtc"},
|
||||
{"path": "mtl", "type": "float"},
|
||||
{"path": "mft", "type": "float", "readonly": false, "cmd": "cc mft"},
|
||||
{"path": "mt", "type": "float"},
|
||||
{"path": "mo", "type": "float"},
|
||||
{"path": "mcr", "type": "float"},
|
||||
{"path": "mot", "type": "float"},
|
||||
{"path": "mw", "type": "float", "readonly": false, "cmd": "cc mw", "description": "correction pulse after automatic open"},
|
||||
{"path": "hav", "type": "bool", "readonly": false, "cmd": "cc hav"},
|
||||
{"path": "h", "type": "float"},
|
||||
{"path": "hr", "type": "float"},
|
||||
{"path": "hc", "type": "float"},
|
||||
{"path": "hu", "type": "float"},
|
||||
{"path": "hh", "type": "float", "readonly": false, "cmd": "cc hh"},
|
||||
{"path": "hl", "type": "float", "readonly": false, "cmd": "cc hl"},
|
||||
{"path": "htf", "type": "float", "readonly": false, "cmd": "cc htf", "description": "meas. period in fast mode"},
|
||||
{"path": "hts", "type": "float", "readonly": false, "cmd": "cc hts", "description": "meas. period in slow mode"},
|
||||
{"path": "hd", "type": "float", "readonly": false, "cmd": "cc hd"},
|
||||
{"path": "hwr", "type": "float", "readonly": false, "cmd": "cc hwr"},
|
||||
{"path": "hem", "type": "float", "readonly": false, "cmd": "cc hem", "description": "sensor length in mm from top to empty pos."},
|
||||
{"path": "hfu", "type": "float", "readonly": false, "cmd": "cc hfu", "description": "sensor length in mm from top to full pos."},
|
||||
{"path": "hcd", "type": "enum", "enum": {"stop": 0, "fill": 1, "off": 2, "auto": 3, "manual": 7}, "readonly": false, "cmd": "cc hcd"},
|
||||
{"path": "hv", "type": "enum", "enum": {"fill_valve_off": 0, "filling": 1, "no_fill_valve": 2, "timeout": 3, "timeout1": 4}},
|
||||
{"path": "hsf", "type": "enum", "enum": {"sens_ok": 0, "sens_warm": 1, "no_sens": 2, "timeout": 3, "not_yet_read": 4, "disabled": 5}},
|
||||
{"path": "ha", "type": "bool", "readonly": false, "cmd": "cc ha"},
|
||||
{"path": "hm", "type": "bool"},
|
||||
{"path": "hf", "type": "enum", "enum": {"slow": 0, "fast": 1}, "readonly": false, "cmd": "cc hf"},
|
||||
{"path": "hbe", "type": "bool", "readonly": false, "cmd": "cc hbe"},
|
||||
{"path": "hmf", "type": "float"},
|
||||
{"path": "hms", "type": "float"},
|
||||
{"path": "hit", "type": "float", "readonly": false, "cmd": "cc hit"},
|
||||
{"path": "hft", "type": "int", "readonly": false, "cmd": "cc hft"},
|
||||
{"path": "hea", "type": "enum", "enum": {"0": 0, "1": 1, "6": 6}, "readonly": false, "cmd": "cc hea"},
|
||||
{"path": "hch", "type": "int", "readonly": false, "cmd": "cc hch"},
|
||||
{"path": "hwr0", "type": "float", "readonly": false, "cmd": "cc hwr0"},
|
||||
{"path": "hem0", "type": "float", "readonly": false, "cmd": "cc hem0", "description": "sensor length in mm from top to empty pos."},
|
||||
{"path": "hfu0", "type": "float", "readonly": false, "cmd": "cc hfu0", "description": "sensor length in mm from top to full pos."},
|
||||
{"path": "hd0", "type": "float", "readonly": false, "cmd": "cc hd0", "description": "external sensor drive current (mA)"},
|
||||
{"path": "h0", "type": "float"},
|
||||
{"path": "hs0", "type": "enum", "enum": {"sens_ok": 0, "sens_warm": 1, "no_sens": 2, "timeout": 3, "not_yet_read": 4, "disabled": 5}},
|
||||
{"path": "h1", "type": "float"},
|
||||
{"path": "hs1", "type": "enum", "enum": {"sens_ok": 0, "sens_warm": 1, "no_sens": 2, "timeout": 3, "not_yet_read": 4, "disabled": 5}},
|
||||
{"path": "h2", "type": "float"},
|
||||
{"path": "hs2", "type": "enum", "enum": {"sens_ok": 0, "sens_warm": 1, "no_sens": 2, "timeout": 3, "not_yet_read": 4, "disabled": 5}},
|
||||
{"path": "h3", "type": "float"},
|
||||
{"path": "hs3", "type": "enum", "enum": {"sens_ok": 0, "sens_warm": 1, "no_sens": 2, "timeout": 3, "not_yet_read": 4, "disabled": 5}},
|
||||
{"path": "h4", "type": "float"},
|
||||
{"path": "hs4", "type": "enum", "enum": {"sens_ok": 0, "sens_warm": 1, "no_sens": 2, "timeout": 3, "not_yet_read": 4, "disabled": 5}},
|
||||
{"path": "h5", "type": "float"},
|
||||
{"path": "hs5", "type": "enum", "enum": {"sens_ok": 0, "sens_warm": 1, "no_sens": 2, "timeout": 3, "not_yet_read": 4, "disabled": 5}},
|
||||
{"path": "hfb", "type": "float"},
|
||||
{"path": "nav", "type": "bool", "readonly": false, "cmd": "cc nav"},
|
||||
{"path": "nu", "type": "float"},
|
||||
{"path": "nl", "type": "float"},
|
||||
{"path": "nth", "type": "float", "readonly": false, "cmd": "cc nth"},
|
||||
{"path": "ntc", "type": "float", "readonly": false, "cmd": "cc ntc"},
|
||||
{"path": "ntm", "type": "float", "readonly": false, "cmd": "cc ntm"},
|
||||
{"path": "ns", "type": "enum", "enum": {"sens_ok": 0, "no_sens": 1, "short_circuit": 2, "upside_down": 3, "sens_warm": 4, "empty": 5}},
|
||||
{"path": "na", "type": "bool", "readonly": false, "cmd": "cc na"},
|
||||
{"path": "nv", "type": "enum", "enum": {"fill_valve_off": 0, "filling": 1, "no_fill_valve": 2, "timeout": 3, "timeout1": 4, "boost": 5}},
|
||||
{"path": "nc", "type": "enum", "enum": {"stop": 0, "fill": 1, "off": 2, "auto": 3}, "readonly": false, "cmd": "cc nc"},
|
||||
{"path": "nfb", "type": "float"},
|
||||
{"path": "cda", "type": "float"},
|
||||
{"path": "cdb", "type": "float"},
|
||||
{"path": "cba", "type": "float"},
|
||||
{"path": "cbb", "type": "float"},
|
||||
{"path": "cvs", "type": "int"},
|
||||
{"path": "csp", "type": "int"},
|
||||
{"path": "cdv", "type": "text", "readonly": false, "cmd": "cc cdv"},
|
||||
{"path": "cic", "type": "text", "readonly": false, "cmd": "cc cic"},
|
||||
{"path": "cin", "type": "text"},
|
||||
{"path": "cds", "type": "enum", "enum": {"local": 0, "remote": 1, "loading": 2, "by_code": 3, "by_touch": 4}, "readonly": false, "cmd": "cc cds"},
|
||||
{"path": "timing", "type": "bool", "readonly": false, "cmd": "cc timing"},
|
||||
{"path": "tc", "type": "float", "visibility": 3},
|
||||
{"path": "tn", "type": "float", "visibility": 3},
|
||||
{"path": "th", "type": "float", "visibility": 3},
|
||||
{"path": "tf", "type": "float", "visibility": 3},
|
||||
{"path": "tm", "type": "float", "visibility": 3},
|
||||
{"path": "tv", "type": "float", "visibility": 3},
|
||||
{"path": "tq", "type": "float", "visibility": 3},
|
||||
{"path": "bdl", "type": "float", "readonly": false, "cmd": "cc bdl"}]},
|
||||
|
||||
"nv": {"base": "/nv", "params": [
|
||||
{"path": "", "type": "enum", "enum": {"fixed": 0, "controlled": 1, "automatic": 2, "close": 3, "open": 4}, "readonly": false, "cmd": "nv", "kids": 11},
|
||||
{"path": "send", "type": "text", "readonly": false, "cmd": "nv send", "visibility": 3},
|
||||
{"path": "status", "type": "text", "visibility": 3},
|
||||
{"path": "motstat", "type": "enum", "enum": {"idle": 0, "opening": 1, "closing": 2, "opened": 3, "closed": 4, "no_motor": 5}},
|
||||
{"path": "flow", "type": "float"},
|
||||
{"path": "set", "type": "float", "readonly": false, "cmd": "nv set"},
|
||||
{"path": "flowmax", "type": "float", "readonly": false, "cmd": "nv flowmax"},
|
||||
{"path": "flowp", "type": "float"},
|
||||
{"path": "span", "type": "float"},
|
||||
{"path": "ctrl", "type": "none", "kids": 13},
|
||||
{"path": "ctrl/regtext", "type": "text"},
|
||||
{"path": "ctrl/prop_o", "type": "float", "readonly": false, "cmd": "nv ctrl/prop_o", "description": "prop [sec/mbar] when opening. above 4 mbar a 10 times lower value is used"},
|
||||
{"path": "ctrl/prop_c", "type": "float", "readonly": false, "cmd": "nv ctrl/prop_c", "description": "prop [sec/mbar] when closing. above 4 mbar a 10 times lower value is used"},
|
||||
{"path": "ctrl/deriv_o", "type": "float", "readonly": false, "cmd": "nv ctrl/deriv_o", "description": "convergence target time [sec] when opening"},
|
||||
{"path": "ctrl/deriv_c", "type": "float", "readonly": false, "cmd": "nv ctrl/deriv_c", "description": "convergence target time [sec] when closing"},
|
||||
{"path": "ctrl/minpulse_o", "type": "float", "readonly": false, "cmd": "nv ctrl/minpulse_o", "description": "minimum close pulse [sec]"},
|
||||
{"path": "ctrl/minpulse_c", "type": "float", "readonly": false, "cmd": "nv ctrl/minpulse_c", "description": "standard close pulse [sec]"},
|
||||
{"path": "ctrl/hystpulse_o", "type": "float", "readonly": false, "cmd": "nv ctrl/hystpulse_o", "description": "motor pulse to overcome hysteresis when opening"},
|
||||
{"path": "ctrl/hystpulse_c", "type": "float", "readonly": false, "cmd": "nv ctrl/hystpulse_c", "description": "motor pulse to overcome hysteresis when closing"},
|
||||
{"path": "ctrl/tol", "type": "float", "readonly": false, "cmd": "nv ctrl/tol", "description": "valid below 3 mbar"},
|
||||
{"path": "ctrl/tolhigh", "type": "float", "readonly": false, "cmd": "nv ctrl/tolhigh", "description": "valid above 4 mbar"},
|
||||
{"path": "ctrl/openpulse", "type": "float", "readonly": false, "cmd": "nv ctrl/openpulse", "description": "time to open from completely closed to a significant opening"},
|
||||
{"path": "ctrl/adjust_minpulse", "type": "bool", "readonly": false, "cmd": "nv ctrl/adjust_minpulse", "description": "adjust minpulse automatically"},
|
||||
{"path": "autoflow", "type": "none", "kids": 24},
|
||||
{"path": "autoflow/suspended", "type": "bool", "readonly": false, "cmd": "nv autoflow/suspended"},
|
||||
{"path": "autoflow/prop", "type": "float", "readonly": false, "cmd": "nv autoflow/prop"},
|
||||
{"path": "autoflow/flowstd", "type": "float", "readonly": false, "cmd": "nv autoflow/flowstd"},
|
||||
{"path": "autoflow/flowlim", "type": "float", "readonly": false, "cmd": "nv autoflow/flowlim"},
|
||||
{"path": "autoflow/smooth", "type": "float", "readonly": false, "cmd": "nv autoflow/smooth"},
|
||||
{"path": "autoflow/difSize", "type": "float", "readonly": false, "cmd": "nv autoflow/difSize"},
|
||||
{"path": "autoflow/difRange", "type": "float", "readonly": false, "cmd": "nv autoflow/difRange"},
|
||||
{"path": "autoflow/flowSize", "type": "float", "readonly": false, "cmd": "nv autoflow/flowSize"},
|
||||
{"path": "autoflow/convTime", "type": "float", "readonly": false, "cmd": "nv autoflow/convTime"},
|
||||
{"path": "autoflow/Tmin", "type": "float", "readonly": false, "cmd": "nv autoflow/Tmin"},
|
||||
{"path": "autoflow/script", "type": "text", "readonly": false, "cmd": "nv autoflow/script"},
|
||||
{"path": "autoflow/getTemp", "type": "text", "readonly": false, "cmd": "nv autoflow/getTemp"},
|
||||
{"path": "autoflow/getTset", "type": "text", "readonly": false, "cmd": "nv autoflow/getTset"},
|
||||
{"path": "autoflow/getFlow", "type": "text", "readonly": false, "cmd": "nv autoflow/getFlow"},
|
||||
{"path": "autoflow/difBuf", "type": "text"},
|
||||
{"path": "autoflow/flowBuf", "type": "text"},
|
||||
{"path": "autoflow/flowset", "type": "float"},
|
||||
{"path": "autoflow/flowmin", "type": "float"},
|
||||
{"path": "autoflow/flowmax", "type": "float"},
|
||||
{"path": "autoflow/difmin", "type": "float"},
|
||||
{"path": "autoflow/difmax", "type": "float"},
|
||||
{"path": "autoflow/setmin", "type": "float"},
|
||||
{"path": "autoflow/setmax", "type": "float"},
|
||||
{"path": "autoflow/flowtarget", "type": "float"},
|
||||
{"path": "calib", "type": "none", "kids": 2},
|
||||
{"path": "calib/ln_per_min_per_mbar", "type": "float", "readonly": false, "cmd": "nv calib/ln_per_min_per_mbar"},
|
||||
{"path": "calib/mbar_offset", "type": "float", "readonly": false, "cmd": "nv calib/mbar_offset"}]},
|
||||
|
||||
"hefill": {"base": "/hefill", "params": [
|
||||
{"path": "", "type": "enum", "enum": {"watching": 0, "filling": 1, "inactive": 2, "manualfill": 3}, "readonly": false, "cmd": "hefill", "kids": 16},
|
||||
{"path": "send", "type": "text", "readonly": false, "cmd": "hefill send", "visibility": 3},
|
||||
{"path": "status", "type": "text", "visibility": 3},
|
||||
{"path": "state", "type": "text"},
|
||||
{"path": "readlevel", "type": "text", "readonly": false, "cmd": "hefill readlevel", "visibility": 3},
|
||||
{"path": "lowlevel", "type": "float", "readonly": false, "cmd": "hefill lowlevel"},
|
||||
{"path": "highlevel", "type": "float", "readonly": false, "cmd": "hefill highlevel"},
|
||||
{"path": "smooth", "type": "float"},
|
||||
{"path": "minfillminutes", "type": "float", "readonly": false, "cmd": "hefill minfillminutes"},
|
||||
{"path": "maxfillminutes", "type": "float", "readonly": false, "cmd": "hefill maxfillminutes"},
|
||||
{"path": "minholdhours", "type": "float", "readonly": false, "cmd": "hefill minholdhours"},
|
||||
{"path": "maxholdhours", "type": "float", "readonly": false, "cmd": "hefill maxholdhours"},
|
||||
{"path": "tolerance", "type": "float", "readonly": false, "cmd": "hefill tolerance"},
|
||||
{"path": "badreadingminutes", "type": "float", "readonly": false, "cmd": "hefill badreadingminutes"},
|
||||
{"path": "tubecoolingminutes", "type": "float", "readonly": false, "cmd": "hefill tubecoolingminutes"},
|
||||
{"path": "vessellimit", "type": "float", "readonly": false, "cmd": "hefill vessellimit"},
|
||||
{"path": "vext", "type": "float"}]},
|
||||
|
||||
"hepump": {"base": "/hepump", "params": [
|
||||
{"path": "", "type": "enum", "enum": {"neodry": 8, "xds35_auto": 0, "xds35_manual": 1, "sv65": 2, "other": 3, "no": -1}, "readonly": false, "cmd": "hepump", "description": "xds35: scroll pump, sv65: leybold", "kids": 10},
|
||||
{"path": "send", "type": "text", "readonly": false, "cmd": "hepump send", "visibility": 3},
|
||||
{"path": "status", "type": "text", "visibility": 3},
|
||||
{"path": "running", "type": "bool", "readonly": false, "cmd": "hepump running"},
|
||||
{"path": "eco", "type": "bool", "readonly": false, "cmd": "hepump eco"},
|
||||
{"path": "auto", "type": "bool", "readonly": false, "cmd": "hepump auto"},
|
||||
{"path": "valve", "type": "enum", "enum": {"closed": 0, "closing": 1, "opening": 2, "opened": 3, "undefined": 4}, "readonly": false, "cmd": "hepump valve"},
|
||||
{"path": "eco_t_lim", "type": "float", "readonly": false, "cmd": "hepump eco_t_lim", "description": "switch off eco mode when T_set < eco_t_lim and T < eco_t_lim * 2"},
|
||||
{"path": "calib", "type": "float", "readonly": false, "cmd": "hepump calib", "visibility": 3},
|
||||
{"path": "health", "type": "float"}]},
|
||||
|
||||
"hemot": {"base": "/hepump/hemot", "params": [
|
||||
{"path": "", "type": "float", "readonly": false, "cmd": "run hemot", "kids": 30},
|
||||
{"path": "send", "type": "text", "readonly": false, "cmd": "hemot send", "visibility": 3},
|
||||
{"path": "status", "type": "text", "visibility": 3},
|
||||
{"path": "is_running", "type": "int", "readonly": false, "cmd": "hemot is_running", "visibility": 3},
|
||||
{"path": "pos", "type": "float"},
|
||||
{"path": "encoder", "type": "float"},
|
||||
{"path": "zero", "type": "float", "readonly": false, "cmd": "hemot zero"},
|
||||
{"path": "lowerlimit", "type": "float", "readonly": false, "cmd": "hemot lowerlimit"},
|
||||
{"path": "upperlimit", "type": "float", "readonly": false, "cmd": "hemot upperlimit"},
|
||||
{"path": "disablelimits", "type": "bool", "readonly": false, "cmd": "hemot disablelimits"},
|
||||
{"path": "verbose", "type": "bool", "readonly": false, "cmd": "hemot verbose"},
|
||||
{"path": "target", "type": "float"},
|
||||
{"path": "runstate", "type": "enum", "enum": {"idle": 0, "running": 1, "finished": 2, "error": 3}},
|
||||
{"path": "precision", "type": "float", "readonly": false, "cmd": "hemot precision"},
|
||||
{"path": "maxencdif", "type": "float", "readonly": false, "cmd": "hemot maxencdif"},
|
||||
{"path": "id", "type": "float", "readonly": false, "cmd": "hemot id"},
|
||||
{"path": "pump_number", "type": "float", "readonly": false, "cmd": "hemot pump_number"},
|
||||
{"path": "init", "type": "float", "readonly": false, "cmd": "hemot init"},
|
||||
{"path": "maxspeed", "type": "float", "readonly": false, "cmd": "hemot maxspeed"},
|
||||
{"path": "acceleration", "type": "float", "readonly": false, "cmd": "hemot acceleration"},
|
||||
{"path": "maxcurrent", "type": "float", "readonly": false, "cmd": "hemot maxcurrent"},
|
||||
{"path": "standbycurrent", "type": "float", "readonly": false, "cmd": "hemot standbycurrent"},
|
||||
{"path": "freewheeling", "type": "bool", "readonly": false, "cmd": "hemot freewheeling"},
|
||||
{"path": "output0", "type": "bool", "readonly": false, "cmd": "hemot output0"},
|
||||
{"path": "output1", "type": "bool", "readonly": false, "cmd": "hemot output1"},
|
||||
{"path": "input3", "type": "bool"},
|
||||
{"path": "pullup", "type": "float", "readonly": false, "cmd": "hemot pullup"},
|
||||
{"path": "nopumpfeedback", "type": "bool", "readonly": false, "cmd": "hemot nopumpfeedback"},
|
||||
{"path": "eeprom", "type": "enum", "enum": {"ok": 0, "dirty": 1, "save": 2, "load": 3}, "readonly": false, "cmd": "hemot eeprom"},
|
||||
{"path": "customadr", "type": "text", "readonly": false, "cmd": "hemot customadr"},
|
||||
{"path": "custompar", "type": "float", "readonly": false, "cmd": "hemot custompar"}]},
|
||||
|
||||
"nvflow": {"base": "/nvflow", "params": [
|
||||
{"path": "", "type": "float", "kids": 7},
|
||||
{"path": "send", "type": "text", "readonly": false, "cmd": "nvflow send", "visibility": 3},
|
||||
{"path": "status", "type": "text", "visibility": 3},
|
||||
{"path": "stddev", "type": "float"},
|
||||
{"path": "nsamples", "type": "int", "readonly": false, "cmd": "nvflow nsamples"},
|
||||
{"path": "offset", "type": "float", "readonly": false, "cmd": "nvflow offset"},
|
||||
{"path": "scale", "type": "float", "readonly": false, "cmd": "nvflow scale"},
|
||||
{"path": "save", "type": "bool", "readonly": false, "cmd": "nvflow save", "description": "unchecked: current calib is not saved. set checked: save calib"}]},
|
||||
|
||||
"ln2fill": {"base": "/ln2fill", "params": [
|
||||
{"path": "", "type": "enum", "enum": {"watching": 0, "filling": 1, "inactive": 2, "manualfill": 3}, "readonly": false, "cmd": "ln2fill", "kids": 14},
|
||||
{"path": "send", "type": "text", "readonly": false, "cmd": "ln2fill send", "visibility": 3},
|
||||
{"path": "status", "type": "text", "visibility": 3},
|
||||
{"path": "state", "type": "text"},
|
||||
{"path": "readlevel", "type": "text", "readonly": false, "cmd": "ln2fill readlevel", "visibility": 3},
|
||||
{"path": "lowlevel", "type": "float", "readonly": false, "cmd": "ln2fill lowlevel"},
|
||||
{"path": "highlevel", "type": "float", "readonly": false, "cmd": "ln2fill highlevel"},
|
||||
{"path": "smooth", "type": "float"},
|
||||
{"path": "minfillminutes", "type": "float", "readonly": false, "cmd": "ln2fill minfillminutes"},
|
||||
{"path": "maxfillminutes", "type": "float", "readonly": false, "cmd": "ln2fill maxfillminutes"},
|
||||
{"path": "minholdhours", "type": "float", "readonly": false, "cmd": "ln2fill minholdhours"},
|
||||
{"path": "maxholdhours", "type": "float", "readonly": false, "cmd": "ln2fill maxholdhours"},
|
||||
{"path": "tolerance", "type": "float", "readonly": false, "cmd": "ln2fill tolerance"},
|
||||
{"path": "badreadingminutes", "type": "float", "readonly": false, "cmd": "ln2fill badreadingminutes"},
|
||||
{"path": "tubecoolingminutes", "type": "float", "readonly": false, "cmd": "ln2fill tubecoolingminutes"}]},
|
||||
|
||||
"mf": {"base": "/mf", "params": [
|
||||
{"path": "", "type": "float", "readonly": false, "cmd": "run mf", "kids": 26},
|
||||
{"path": "persmode", "type": "int", "readonly": false, "cmd": "mf persmode"},
|
||||
{"path": "perswitch", "type": "int"},
|
||||
{"path": "nowait", "type": "int", "readonly": false, "cmd": "mf nowait"},
|
||||
{"path": "maxlimit", "type": "float", "visibility": 3},
|
||||
{"path": "limit", "type": "float", "readonly": false, "cmd": "mf limit"},
|
||||
{"path": "ramp", "type": "float", "readonly": false, "cmd": "mf ramp"},
|
||||
{"path": "perscurrent", "type": "float", "readonly": false, "cmd": "mf perscurrent"},
|
||||
{"path": "perslimit", "type": "float", "readonly": false, "cmd": "mf perslimit"},
|
||||
{"path": "perswait", "type": "int", "readonly": false, "cmd": "mf perswait"},
|
||||
{"path": "persdelay", "type": "int", "readonly": false, "cmd": "mf persdelay"},
|
||||
{"path": "current", "type": "float"},
|
||||
{"path": "measured", "type": "float"},
|
||||
{"path": "voltage", "type": "float"},
|
||||
{"path": "lastfield", "type": "float", "visibility": 3},
|
||||
{"path": "ampRamp", "type": "float", "visibility": 3},
|
||||
{"path": "inductance", "type": "float", "visibility": 3},
|
||||
{"path": "trainedTo", "type": "float", "readonly": false, "cmd": "mf trainedTo"},
|
||||
{"path": "trainMode", "type": "int"},
|
||||
{"path": "external", "type": "int", "readonly": false, "cmd": "mf external"},
|
||||
{"path": "startScript", "type": "text", "readonly": false, "cmd": "mf startScript", "visibility": 3},
|
||||
{"path": "is_running", "type": "int", "readonly": false, "cmd": "mf is_running", "visibility": 3},
|
||||
{"path": "verbose", "type": "int", "readonly": false, "cmd": "mf verbose", "visibility": 3},
|
||||
{"path": "driver", "type": "text", "visibility": 3},
|
||||
{"path": "creationCmd", "type": "text", "visibility": 3},
|
||||
{"path": "targetValue", "type": "float"},
|
||||
{"path": "status", "type": "text", "readonly": false, "cmd": "mf status", "visibility": 3}]},
|
||||
|
||||
"lev": {"base": "/lev", "params": [
|
||||
{"path": "", "type": "float", "kids": 4},
|
||||
{"path": "send", "type": "text", "readonly": false, "cmd": "lev send", "visibility": 3},
|
||||
{"path": "status", "type": "text", "visibility": 3},
|
||||
{"path": "mode", "type": "enum", "enum": {"slow": 0, "fast (switches to slow automatically after filling)": 1}, "readonly": false, "cmd": "lev mode"},
|
||||
{"path": "n2", "type": "float"}]},
|
||||
|
||||
"tcoil": {"base": "/tcoil", "params": [
|
||||
{"path": "", "type": "float", "kids": 11},
|
||||
{"path": "send", "type": "text", "readonly": false, "cmd": "tcoil send", "visibility": 3},
|
||||
{"path": "status", "type": "text", "visibility": 3},
|
||||
{"path": "excitation", "type": "float", "readonly": false, "cmd": "tcoil excitation", "visibility": 3},
|
||||
{"path": "ta", "type": "float", "visibility": 3, "kids": 3},
|
||||
{"path": "ta/enable", "type": "bool", "readonly": false, "cmd": "tcoil ta/enable"},
|
||||
{"path": "ta/r", "type": "float"},
|
||||
{"path": "ta/curve", "type": "text", "readonly": false, "cmd": "tcoil ta/curve", "kids": 3},
|
||||
{"path": "ta/curve/adjust", "type": "text", "readonly": false, "cmd": "tcoil ta/curve/adjust"},
|
||||
{"path": "ta/curve/points", "type": "floatvarar", "readonly": false, "cmd": "tcoil ta/curve/points"},
|
||||
{"path": "ta/curve/cpoints", "type": "floatvarar", "readonly": false, "cmd": "tcoil ta/curve/cpoints"},
|
||||
{"path": "tb", "type": "float", "visibility": 3, "kids": 3},
|
||||
{"path": "tb/enable", "type": "bool", "readonly": false, "cmd": "tcoil tb/enable"},
|
||||
{"path": "tb/r", "type": "float"},
|
||||
{"path": "tb/curve", "type": "text", "readonly": false, "cmd": "tcoil tb/curve", "kids": 3},
|
||||
{"path": "tb/curve/adjust", "type": "text", "readonly": false, "cmd": "tcoil tb/curve/adjust"},
|
||||
{"path": "tb/curve/points", "type": "floatvarar", "readonly": false, "cmd": "tcoil tb/curve/points"},
|
||||
{"path": "tb/curve/cpoints", "type": "floatvarar", "readonly": false, "cmd": "tcoil tb/curve/cpoints"},
|
||||
{"path": "td", "type": "float", "visibility": 3, "kids": 3},
|
||||
{"path": "td/enable", "type": "bool", "readonly": false, "cmd": "tcoil td/enable"},
|
||||
{"path": "td/r", "type": "float"},
|
||||
{"path": "td/curve", "type": "text", "readonly": false, "cmd": "tcoil td/curve", "kids": 3},
|
||||
{"path": "td/curve/adjust", "type": "text", "readonly": false, "cmd": "tcoil td/curve/adjust"},
|
||||
{"path": "td/curve/points", "type": "floatvarar", "readonly": false, "cmd": "tcoil td/curve/points"},
|
||||
{"path": "td/curve/cpoints", "type": "floatvarar", "readonly": false, "cmd": "tcoil td/curve/cpoints"},
|
||||
{"path": "ref", "type": "float", "visibility": 3, "kids": 3},
|
||||
{"path": "ref/enable", "type": "bool", "readonly": false, "cmd": "tcoil ref/enable"},
|
||||
{"path": "ref/r", "type": "float"},
|
||||
{"path": "ref/curve", "type": "text", "readonly": false, "cmd": "tcoil ref/curve", "kids": 3},
|
||||
{"path": "ref/curve/adjust", "type": "text", "readonly": false, "cmd": "tcoil ref/curve/adjust"},
|
||||
{"path": "ref/curve/points", "type": "floatvarar", "readonly": false, "cmd": "tcoil ref/curve/points"},
|
||||
{"path": "ref/curve/cpoints", "type": "floatvarar", "readonly": false, "cmd": "tcoil ref/curve/cpoints"},
|
||||
{"path": "tc", "type": "float", "visibility": 3, "kids": 3},
|
||||
{"path": "tc/enable", "type": "bool", "readonly": false, "cmd": "tcoil tc/enable"},
|
||||
{"path": "tc/r", "type": "float"},
|
||||
{"path": "tc/curve", "type": "text", "readonly": false, "cmd": "tcoil tc/curve", "kids": 3},
|
||||
{"path": "tc/curve/adjust", "type": "text", "readonly": false, "cmd": "tcoil tc/curve/adjust"},
|
||||
{"path": "tc/curve/points", "type": "floatvarar", "readonly": false, "cmd": "tcoil tc/curve/points"},
|
||||
{"path": "tc/curve/cpoints", "type": "floatvarar", "readonly": false, "cmd": "tcoil tc/curve/cpoints"},
|
||||
{"path": "ext", "type": "float", "visibility": 3},
|
||||
{"path": "com", "type": "float", "visibility": 3},
|
||||
{"path": "gnd", "type": "float", "visibility": 3}]},
|
||||
|
||||
"table": {"base": "/table", "params": [
|
||||
{"path": "", "type": "none", "kids": 17},
|
||||
{"path": "send", "type": "text", "readonly": false, "cmd": "table send", "visibility": 3},
|
||||
{"path": "status", "type": "text", "visibility": 3},
|
||||
{"path": "fix_tt_set_prop", "type": "bool", "readonly": false, "cmd": "table fix_tt_set_prop"},
|
||||
{"path": "val_tt_set_prop", "type": "float"},
|
||||
{"path": "tbl_tt_set_prop", "type": "text", "readonly": false, "cmd": "table tbl_tt_set_prop", "description": "enter value pair separated with colon T1:par1 T2:par2 ..."},
|
||||
{"path": "fix_tt_set_integ", "type": "bool", "readonly": false, "cmd": "table fix_tt_set_integ"},
|
||||
{"path": "val_tt_set_integ", "type": "float"},
|
||||
{"path": "tbl_tt_set_integ", "type": "text", "readonly": false, "cmd": "table tbl_tt_set_integ", "description": "enter value pair separated with colon T1:par1 T2:par2 ..."},
|
||||
{"path": "fix_tt_dblctrl_int2", "type": "bool", "readonly": false, "cmd": "table fix_tt_dblctrl_int2"},
|
||||
{"path": "val_tt_dblctrl_int2", "type": "float"},
|
||||
{"path": "tbl_tt_dblctrl_int2", "type": "text", "readonly": false, "cmd": "table tbl_tt_dblctrl_int2", "description": "enter value pair separated with colon T1:par1 T2:par2 ..."},
|
||||
{"path": "fix_tt_dblctrl_prop_up", "type": "bool", "readonly": false, "cmd": "table fix_tt_dblctrl_prop_up"},
|
||||
{"path": "val_tt_dblctrl_prop_up", "type": "float"},
|
||||
{"path": "tbl_tt_dblctrl_prop_up", "type": "text", "readonly": false, "cmd": "table tbl_tt_dblctrl_prop_up", "description": "enter value pair separated with colon T1:par1 T2:par2 ..."},
|
||||
{"path": "fix_tt_dblctrl_prop_lo", "type": "bool", "readonly": false, "cmd": "table fix_tt_dblctrl_prop_lo"},
|
||||
{"path": "val_tt_dblctrl_prop_lo", "type": "float"},
|
||||
{"path": "tbl_tt_dblctrl_prop_lo", "type": "text", "readonly": false, "cmd": "table tbl_tt_dblctrl_prop_lo", "description": "enter value pair separated with colon T1:par1 T2:par2 ..."}]}}
|
@ -62,6 +62,8 @@
|
||||
{"path": "set/integ", "type": "float", "readonly": false, "cmd": "tt set/integ", "description": "bigger means faster"},
|
||||
{"path": "set/deriv", "type": "float", "readonly": false, "cmd": "tt set/deriv"},
|
||||
{"path": "display", "type": "text", "readonly": false, "cmd": "tt display"},
|
||||
{"path": "dout", "type": "int", "readonly": false, "cmd": "tt dout"},
|
||||
{"path": "dinp", "type": "int"},
|
||||
{"path": "remote", "type": "bool"}]},
|
||||
|
||||
"cc": {"base": "/cc", "params": [
|
||||
|
@ -62,6 +62,8 @@
|
||||
{"path": "set/integ", "type": "float", "readonly": false, "cmd": "tt set/integ", "description": "bigger means faster"},
|
||||
{"path": "set/deriv", "type": "float", "readonly": false, "cmd": "tt set/deriv"},
|
||||
{"path": "display", "type": "text", "readonly": false, "cmd": "tt display"},
|
||||
{"path": "dout", "type": "int", "readonly": false, "cmd": "tt dout"},
|
||||
{"path": "dinp", "type": "int"},
|
||||
{"path": "remote", "type": "bool"}]},
|
||||
|
||||
"cc": {"base": "/cc", "params": [
|
||||
|
@ -1,10 +1,10 @@
|
||||
Node('ccrpe.config.sea.psi.ch',
|
||||
'''4 K closed cycle cryostat (PE cell)''',
|
||||
Node('ori7.config.sea.psi.ch',
|
||||
'''orange cryostat with 50 mm sample space for ULT''',
|
||||
)
|
||||
Mod('sea_main',
|
||||
'frappy_psi.sea.SeaClient',
|
||||
'main sea connection for ccrpe.config',
|
||||
config = 'ccrpe.config',
|
||||
'main sea connection for ori7.config',
|
||||
config = 'ori7.config',
|
||||
service = 'main',
|
||||
)
|
||||
Mod('tt',
|
||||
@ -22,6 +22,16 @@ Mod('nv',
|
||||
io = 'sea_main',
|
||||
sea_object = 'nv',
|
||||
)
|
||||
Mod('ln2fill',
|
||||
'frappy_psi.sea.SeaWritable', '',
|
||||
io = 'sea_main',
|
||||
sea_object = 'ln2fill',
|
||||
)
|
||||
Mod('hefill',
|
||||
'frappy_psi.sea.SeaWritable', '',
|
||||
io = 'sea_main',
|
||||
sea_object = 'hefill',
|
||||
)
|
||||
Mod('hepump',
|
||||
'frappy_psi.sea.SeaWritable', '',
|
||||
io = 'sea_main',
|
||||
@ -37,13 +47,8 @@ Mod('nvflow',
|
||||
io = 'sea_main',
|
||||
sea_object = 'nvflow',
|
||||
)
|
||||
Mod('warmup',
|
||||
'frappy_psi.sea.SeaDrivable', '',
|
||||
io = 'sea_main',
|
||||
sea_object = 'warmup',
|
||||
)
|
||||
Mod('p',
|
||||
Mod('table',
|
||||
'frappy_psi.sea.SeaReadable', '',
|
||||
io = 'sea_main',
|
||||
sea_object = 'p',
|
||||
sea_object = 'table',
|
||||
)
|
@ -21,6 +21,8 @@
|
||||
{"path": "tm/stddev", "type": "float"},
|
||||
{"path": "tm/raw", "type": "float"},
|
||||
{"path": "display", "type": "text", "readonly": false, "cmd": "tt display"},
|
||||
{"path": "dout", "type": "int", "readonly": false, "cmd": "tt dout"},
|
||||
{"path": "dinp", "type": "int"},
|
||||
{"path": "remote", "type": "bool"}]},
|
||||
|
||||
"cc": {"base": "/cc", "params": [
|
||||
|
@ -69,6 +69,8 @@
|
||||
{"path": "set/integ", "type": "float", "readonly": false, "cmd": "tt set/integ", "description": "bigger means faster"},
|
||||
{"path": "set/deriv", "type": "float", "readonly": false, "cmd": "tt set/deriv"},
|
||||
{"path": "display", "type": "text", "readonly": false, "cmd": "tt display"},
|
||||
{"path": "dout", "type": "int", "readonly": false, "cmd": "tt dout"},
|
||||
{"path": "dinp", "type": "int"},
|
||||
{"path": "remote", "type": "bool"}]}, "cc": {"base": "/cc", "params": [{"path": "", "type": "bool", "kids": 96},
|
||||
{"path": "send", "type": "text", "readonly": false, "cmd": "cc send", "visibility": 3},
|
||||
{"path": "status", "type": "text", "visibility": 3},
|
||||
|
@ -1,76 +0,0 @@
|
||||
{"res": {"base": "/res", "params": [
|
||||
{"path": "", "type": "int", "kids": 10},
|
||||
{"path": "send", "type": "text", "readonly": false, "cmd": "res send", "visibility": 3},
|
||||
{"path": "status", "type": "text", "visibility": 3},
|
||||
{"path": "autoscan", "type": "bool", "readonly": false, "cmd": "res autoscan", "kids": 4},
|
||||
{"path": "autoscan/synchronized", "type": "bool", "readonly": false, "cmd": "res autoscan/synchronized"},
|
||||
{"path": "autoscan/interval", "type": "text", "readonly": false, "cmd": "res autoscan/interval"},
|
||||
{"path": "autoscan/pause", "type": "text", "readonly": false, "cmd": "res autoscan/pause"},
|
||||
{"path": "autoscan/dwell", "type": "text", "readonly": false, "cmd": "res autoscan/dwell"},
|
||||
{"path": "s1", "type": "float", "kids": 14},
|
||||
{"path": "s1/active", "type": "enum", "enum": {"inactive": 0, "active": 1}, "readonly": false, "cmd": "res s1/active"},
|
||||
{"path": "s1/autorange", "type": "bool", "readonly": false, "cmd": "res s1/autorange", "description": "autorange (common for all channels)"},
|
||||
{"path": "s1/range", "type": "text", "readonly": false, "cmd": "res s1/range", "description": "resistance range in Ohm"},
|
||||
{"path": "s1/range_num", "type": "int"},
|
||||
{"path": "s1/excitation", "type": "text", "readonly": false, "cmd": "res s1/excitation", "description": "excitation with unit, i.e. 2uV or 3pA"},
|
||||
{"path": "s1/excitation_num", "type": "int"},
|
||||
{"path": "s1/excitation_mode", "type": "enum", "enum": {"voltage": 0, "current": 1, "off": 2}},
|
||||
{"path": "s1/pause", "type": "int", "readonly": false, "cmd": "res s1/pause", "description": "pause time [sec] after channel change"},
|
||||
{"path": "s1/filter", "type": "int", "readonly": false, "cmd": "res s1/filter", "description": "filter average time [sec]"},
|
||||
{"path": "s1/dwell", "type": "int", "readonly": false, "cmd": "res s1/dwell", "description": "dwell time [sec]. Total time per channel: pause + filter + dwell"},
|
||||
{"path": "s1/status", "type": "text"},
|
||||
{"path": "s1/curve", "type": "text", "readonly": false, "cmd": "res s1/curve", "kids": 1},
|
||||
{"path": "s1/curve/points", "type": "floatvarar", "readonly": false, "cmd": "res s1/curve/points", "visibility": 3},
|
||||
{"path": "s1/alarm", "type": "float", "readonly": false, "cmd": "res s1/alarm"},
|
||||
{"path": "s1/raw", "type": "float"},
|
||||
{"path": "s2", "type": "float", "kids": 14},
|
||||
{"path": "s2/active", "type": "enum", "enum": {"inactive": 0, "active": 1}, "readonly": false, "cmd": "res s2/active"},
|
||||
{"path": "s2/autorange", "type": "bool", "readonly": false, "cmd": "res s2/autorange", "description": "autorange (common for all channels)"},
|
||||
{"path": "s2/range", "type": "text", "readonly": false, "cmd": "res s2/range", "description": "resistance range in Ohm"},
|
||||
{"path": "s2/range_num", "type": "int"},
|
||||
{"path": "s2/excitation", "type": "text", "readonly": false, "cmd": "res s2/excitation", "description": "excitation with unit, i.e. 2uV or 3pA"},
|
||||
{"path": "s2/excitation_num", "type": "int"},
|
||||
{"path": "s2/excitation_mode", "type": "enum", "enum": {"voltage": 0, "current": 1, "off": 2}},
|
||||
{"path": "s2/pause", "type": "int", "readonly": false, "cmd": "res s2/pause", "description": "pause time [sec] after channel change"},
|
||||
{"path": "s2/filter", "type": "int", "readonly": false, "cmd": "res s2/filter", "description": "filter average time [sec]"},
|
||||
{"path": "s2/dwell", "type": "int", "readonly": false, "cmd": "res s2/dwell", "description": "dwell time [sec]. Total time per channel: pause + filter + dwell"},
|
||||
{"path": "s2/status", "type": "text"},
|
||||
{"path": "s2/curve", "type": "text", "readonly": false, "cmd": "res s2/curve", "kids": 1},
|
||||
{"path": "s2/curve/points", "type": "floatvarar", "readonly": false, "cmd": "res s2/curve/points", "visibility": 3},
|
||||
{"path": "s2/alarm", "type": "float", "readonly": false, "cmd": "res s2/alarm"},
|
||||
{"path": "s2/raw", "type": "float"},
|
||||
{"path": "s3", "type": "float", "kids": 14},
|
||||
{"path": "s3/active", "type": "enum", "enum": {"inactive": 0, "active": 1}, "readonly": false, "cmd": "res s3/active"},
|
||||
{"path": "s3/autorange", "type": "bool", "readonly": false, "cmd": "res s3/autorange", "description": "autorange (common for all channels)"},
|
||||
{"path": "s3/range", "type": "text", "readonly": false, "cmd": "res s3/range", "description": "resistance range in Ohm"},
|
||||
{"path": "s3/range_num", "type": "int"},
|
||||
{"path": "s3/excitation", "type": "text", "readonly": false, "cmd": "res s3/excitation", "description": "excitation with unit, i.e. 2uV or 3pA"},
|
||||
{"path": "s3/excitation_num", "type": "int"},
|
||||
{"path": "s3/excitation_mode", "type": "enum", "enum": {"voltage": 0, "current": 1, "off": 2}},
|
||||
{"path": "s3/pause", "type": "int", "readonly": false, "cmd": "res s3/pause", "description": "pause time [sec] after channel change"},
|
||||
{"path": "s3/filter", "type": "int", "readonly": false, "cmd": "res s3/filter", "description": "filter average time [sec]"},
|
||||
{"path": "s3/dwell", "type": "int", "readonly": false, "cmd": "res s3/dwell", "description": "dwell time [sec]. Total time per channel: pause + filter + dwell"},
|
||||
{"path": "s3/status", "type": "text"},
|
||||
{"path": "s3/curve", "type": "text", "readonly": false, "cmd": "res s3/curve", "kids": 1},
|
||||
{"path": "s3/curve/points", "type": "floatvarar", "readonly": false, "cmd": "res s3/curve/points", "visibility": 3},
|
||||
{"path": "s3/alarm", "type": "float", "readonly": false, "cmd": "res s3/alarm"},
|
||||
{"path": "s3/raw", "type": "float"},
|
||||
{"path": "s4", "type": "float", "kids": 14},
|
||||
{"path": "s4/active", "type": "enum", "enum": {"inactive": 0, "active": 1}, "readonly": false, "cmd": "res s4/active"},
|
||||
{"path": "s4/autorange", "type": "bool", "readonly": false, "cmd": "res s4/autorange", "description": "autorange (common for all channels)"},
|
||||
{"path": "s4/range", "type": "text", "readonly": false, "cmd": "res s4/range", "description": "resistance range in Ohm"},
|
||||
{"path": "s4/range_num", "type": "int"},
|
||||
{"path": "s4/excitation", "type": "text", "readonly": false, "cmd": "res s4/excitation", "description": "excitation with unit, i.e. 2uV or 3pA"},
|
||||
{"path": "s4/excitation_num", "type": "int"},
|
||||
{"path": "s4/excitation_mode", "type": "enum", "enum": {"voltage": 0, "current": 1, "off": 2}},
|
||||
{"path": "s4/pause", "type": "int", "readonly": false, "cmd": "res s4/pause", "description": "pause time [sec] after channel change"},
|
||||
{"path": "s4/filter", "type": "int", "readonly": false, "cmd": "res s4/filter", "description": "filter average time [sec]"},
|
||||
{"path": "s4/dwell", "type": "int", "readonly": false, "cmd": "res s4/dwell", "description": "dwell time [sec]. Total time per channel: pause + filter + dwell"},
|
||||
{"path": "s4/status", "type": "text"},
|
||||
{"path": "s4/curve", "type": "text", "readonly": false, "cmd": "res s4/curve", "kids": 1},
|
||||
{"path": "s4/curve/points", "type": "floatvarar", "readonly": false, "cmd": "res s4/curve/points", "visibility": 3},
|
||||
{"path": "s4/alarm", "type": "float", "readonly": false, "cmd": "res s4/alarm"},
|
||||
{"path": "s4/raw", "type": "float"},
|
||||
{"path": "analog2", "type": "float", "readonly": false, "cmd": "res analog2"},
|
||||
{"path": "remote", "type": "bool"},
|
||||
{"path": "display", "type": "text", "readonly": false, "cmd": "res display"}]}}
|
@ -62,6 +62,8 @@
|
||||
{"path": "set/integ", "type": "float", "readonly": false, "cmd": "tt set/integ", "description": "bigger means faster"},
|
||||
{"path": "set/deriv", "type": "float", "readonly": false, "cmd": "tt set/deriv"},
|
||||
{"path": "display", "type": "text", "readonly": false, "cmd": "tt display"},
|
||||
{"path": "dout", "type": "int", "readonly": false, "cmd": "tt dout"},
|
||||
{"path": "dinp", "type": "int"},
|
||||
{"path": "remote", "type": "bool"}]},
|
||||
|
||||
"cc": {"base": "/cc", "params": [
|
||||
|
67
cfg/sim921_cfg.py
Normal file
67
cfg/sim921_cfg.py
Normal file
@ -0,0 +1,67 @@
|
||||
Node('bridge.psi.ch',
|
||||
'ac resistance bridge',
|
||||
'tcp://5000',
|
||||
)
|
||||
|
||||
Mod('io',
|
||||
'frappy_psi.bridge.BridgeIO',
|
||||
'communication to sim900',
|
||||
uri='serial:///dev/cu.usbserial-14340',
|
||||
)
|
||||
|
||||
Mod('res1',
|
||||
'frappy_psi.bridge.Resistance',
|
||||
'module communication',
|
||||
io='io',
|
||||
port=1,
|
||||
)
|
||||
|
||||
Mod('res2',
|
||||
'frappy_psi.bridge.Resistance',
|
||||
'module communication',
|
||||
io='io',
|
||||
port=3,
|
||||
)
|
||||
|
||||
Mod('res3',
|
||||
'frappy_psi.bridge.Resistance',
|
||||
'module communication',
|
||||
io='io',
|
||||
port=5,
|
||||
)
|
||||
|
||||
Mod('phase1',
|
||||
'frappy_psi.bridge.Phase',
|
||||
'module communication',
|
||||
resistance='res1',
|
||||
)
|
||||
|
||||
Mod('phase2',
|
||||
'frappy_psi.bridge.Phase',
|
||||
'module communication',
|
||||
resistance='res2',
|
||||
)
|
||||
|
||||
Mod('phase3',
|
||||
'frappy_psi.bridge.Phase',
|
||||
'module communication',
|
||||
resistance='res3',
|
||||
)
|
||||
|
||||
Mod('dev1',
|
||||
'frappy_psi.bridge.Deviation',
|
||||
'module communication',
|
||||
resistance='res1',
|
||||
)
|
||||
|
||||
Mod('dev2',
|
||||
'frappy_psi.bridge.Deviation',
|
||||
'module communication',
|
||||
resistance='res1',
|
||||
)
|
||||
|
||||
Mod('dev3',
|
||||
'frappy_psi.bridge.Deviation',
|
||||
'module communication',
|
||||
resistance='res3',
|
||||
)
|
@ -1,49 +0,0 @@
|
||||
Node('simulation',
|
||||
'Auto-generated configuration by frappy.',
|
||||
'tcp://10767',
|
||||
)
|
||||
Mod('analoginput',
|
||||
'frappy_mlz.entangle.AnalogInput',
|
||||
'from test/sim/analoginput',
|
||||
tangodevice = 'tango://localhost:10000/test/sim/analoginput',
|
||||
)
|
||||
Mod('sensor',
|
||||
'frappy_mlz.entangle.Sensor',
|
||||
'from test/sim/sensor',
|
||||
tangodevice = 'tango://localhost:10000/test/sim/sensor',
|
||||
)
|
||||
Mod('analogoutput',
|
||||
'frappy_mlz.entangle.AnalogOutput',
|
||||
'from test/sim/analogoutput',
|
||||
tangodevice = 'tango://localhost:10000/test/sim/analogoutput',
|
||||
)
|
||||
Mod('actuator',
|
||||
'frappy_mlz.entangle.Actuator',
|
||||
'from test/sim/actuator',
|
||||
tangodevice = 'tango://localhost:10000/test/sim/actuator',
|
||||
)
|
||||
Mod('motor',
|
||||
'frappy_mlz.entangle.Motor',
|
||||
'from test/sim/motor',
|
||||
tangodevice = 'tango://localhost:10000/test/sim/motor',
|
||||
)
|
||||
Mod('powersupply',
|
||||
'frappy_mlz.entangle.PowerSupply',
|
||||
'from test/sim/powersupply',
|
||||
tangodevice = 'tango://localhost:10000/test/sim/powersupply',
|
||||
)
|
||||
Mod('digitalinput',
|
||||
'frappy_mlz.entangle.DigitalInput',
|
||||
'from test/sim/digitalinput',
|
||||
tangodevice = 'tango://localhost:10000/test/sim/digitalinput',
|
||||
)
|
||||
Mod('digitaloutput',
|
||||
'frappy_mlz.entangle.DigitalOutput',
|
||||
'from test/sim/digitaloutput',
|
||||
tangodevice = 'tango://localhost:10000/test/sim/digitaloutput',
|
||||
)
|
||||
Mod('stringio',
|
||||
'frappy_mlz.entangle.StringIO',
|
||||
'from test/sim/stringio',
|
||||
tangodevice = 'tango://localhost:10000/test/sim/stringio',
|
||||
)
|
@ -138,6 +138,13 @@ Mod('T_one_K',
|
||||
io='itc',
|
||||
)
|
||||
|
||||
Mod('htr_one_K',
|
||||
'frappy_psi.mercury.HeaterOutput',
|
||||
'1 K plate warmup heater',
|
||||
slot='DB3.H1',
|
||||
io='itc',
|
||||
)
|
||||
|
||||
Mod('T_mix_wup',
|
||||
'frappy_psi.mercury.TemperatureLoop',
|
||||
'mix. chamber warmup temperature',
|
||||
|
@ -10,14 +10,6 @@ Mod('sea_stick',
|
||||
)
|
||||
|
||||
Mod('ts',
|
||||
'frappy_psi.sea.SeaReadable', '',
|
||||
io='sea_stick',
|
||||
sea_object='tt',
|
||||
json_file='ma6.config.json',
|
||||
rel_paths=['ts_2'],
|
||||
)
|
||||
|
||||
Mod('ts_reg',
|
||||
'frappy_psi.sea.SeaReadable', '',
|
||||
io='sea_stick',
|
||||
sea_object='tt',
|
||||
@ -30,11 +22,3 @@ Mod('hcp',
|
||||
io='sea_stick',
|
||||
sea_object='hcp',
|
||||
)
|
||||
|
||||
Mod('v',
|
||||
'frappy_psi.parmod.Driv',
|
||||
'drivable voltage',
|
||||
read='hcp.value',
|
||||
write='hcp.set',
|
||||
unit='V',
|
||||
)
|
||||
|
@ -22,8 +22,8 @@ Mod('ts',
|
||||
'frappy_psi.parmod.Converging',
|
||||
'virtual stick T',
|
||||
unit='K',
|
||||
value_param='tsam.value',
|
||||
target_param='tsam.setsamp',
|
||||
read='tsam.value',
|
||||
write='tsam.setsamp',
|
||||
meaning=['temperature', 20],
|
||||
settling_time=20,
|
||||
tolerance=1,
|
||||
|
@ -1,11 +0,0 @@
|
||||
Node('ma6_sampleheat.psi.ch', '', interface='tcp://5000')
|
||||
|
||||
Mod('sea_stick',
|
||||
'frappy_psi.sea.SeaClient',
|
||||
'stick sea connection for ma6_sampleheat.stick',
|
||||
config='ma6_sampleheat.stick',
|
||||
service='stick',
|
||||
)
|
||||
|
||||
|
||||
# ts is configured on ma7_sampleheat_cfg.py
|
@ -1,18 +0,0 @@
|
||||
Node('ma7.stick.sea.psi.ch',
|
||||
'MA7 standard sample stick',
|
||||
)
|
||||
|
||||
Mod('sea_stick',
|
||||
'frappy_psi.sea.SeaClient',
|
||||
'SEA stick connection',
|
||||
config='ma7_piezo.stick',
|
||||
service='stick',
|
||||
)
|
||||
|
||||
Mod('ts',
|
||||
'frappy_psi.sea.SeaReadable', '',
|
||||
io='sea_stick',
|
||||
sea_object='tt',
|
||||
json_file='ma7_piezo.config.json',
|
||||
rel_paths=['ts'],
|
||||
)
|
@ -1,72 +0,0 @@
|
||||
Node('ma7.stick.sea.psi.ch',
|
||||
'MA7 standard sample stick',
|
||||
)
|
||||
|
||||
Mod('sea_stick',
|
||||
'frappy_psi.sea.SeaClient',
|
||||
'SEA stick connection',
|
||||
config='ma7.stick',
|
||||
service='stick',
|
||||
)
|
||||
|
||||
Mod('ts_sea',
|
||||
'frappy_psi.sea.SeaReadable',
|
||||
'sample stick temperature',
|
||||
io='sea_stick',
|
||||
json_file='ma7.config.json',
|
||||
sea_object='tt',
|
||||
rel_paths=['ts', 'setsamp'],
|
||||
# export=False,
|
||||
)
|
||||
|
||||
Mod('tm_sea',
|
||||
'frappy_psi.sea.SeaReadable',
|
||||
'sample stick temperature',
|
||||
io='sea_stick',
|
||||
json_file='ma7.config.json',
|
||||
sea_object='tt',
|
||||
rel_paths=['tm', 'set'],
|
||||
# export=False,
|
||||
)
|
||||
|
||||
Mod('ts_writ',
|
||||
'frappy_psi.parmod.ParWrit',
|
||||
'writable version of ts',
|
||||
unit='K',
|
||||
value_param='ts_sea.value',
|
||||
target_param='ts_sea.setsamp',
|
||||
)
|
||||
|
||||
Mod('tm_writ',
|
||||
'frappy_psi.parmod.ParWrit',
|
||||
'writable version of tm',
|
||||
unit='K',
|
||||
value_param='tm_sea.value',
|
||||
target_param='tm_sea.set',
|
||||
)
|
||||
|
||||
Mod('sam_htr',
|
||||
'frappy_psi.parmod.Par',
|
||||
'htr module version',
|
||||
unit='W',
|
||||
value_param='ts_sea.power',
|
||||
)
|
||||
|
||||
Mod('vti_htr',
|
||||
'frappy_psi.parmod.Par',
|
||||
'htr module version',
|
||||
unit='W',
|
||||
value_param='tm_sea.power',
|
||||
)
|
||||
|
||||
Mod('ts',
|
||||
'frappy_psi.parmod.CombinedSampleVti',
|
||||
'drivable stick T using setsamp',
|
||||
sample='ts_writ',
|
||||
sample_htr='sam_htr',
|
||||
vti='tm_writ',
|
||||
vti_htr='vti_htr',
|
||||
meaning=['temperature', 20],
|
||||
settling_time=20,
|
||||
tolerance=1,
|
||||
)
|
@ -9,7 +9,7 @@ Mod('sea_stick',
|
||||
service='stick',
|
||||
)
|
||||
|
||||
Mod('ts_sea',
|
||||
Mod('tsam',
|
||||
'frappy_psi.sea.SeaReadable',
|
||||
'sample stick temperature',
|
||||
io='sea_stick',
|
||||
@ -22,8 +22,8 @@ Mod('ts',
|
||||
'frappy_psi.parmod.Converging',
|
||||
'drivable stick T using setsamp',
|
||||
unit='K',
|
||||
value_param='ts_sea.value',
|
||||
target_param='ts_sea.setsamp',
|
||||
read='tsam.value',
|
||||
write='tsam.setsamp',
|
||||
meaning=['temperature', 20],
|
||||
settling_time=20,
|
||||
tolerance=1,
|
||||
|
@ -9,23 +9,10 @@ Mod('sea_stick',
|
||||
service='stick',
|
||||
)
|
||||
|
||||
Mod('tsam',
|
||||
'frappy_psi.sea.SeaReadable',
|
||||
'sample stick temperature',
|
||||
io='sea_stick',
|
||||
json_file='ma7.config.json',
|
||||
sea_object='tt',
|
||||
rel_paths=['ts', 'setsamp']
|
||||
)
|
||||
|
||||
Mod('ts',
|
||||
'frappy_psi.parmod.Converging',
|
||||
'drivable stick T using setsamp',
|
||||
unit='K',
|
||||
value_param='tsam.value',
|
||||
target_param='tsam.setsamp',
|
||||
meaning=['temperature', 20],
|
||||
settling_time=20,
|
||||
tolerance=1,
|
||||
'frappy_psi.sea.SeaReadable', '',
|
||||
io='sea_stick',
|
||||
sea_object='tt',
|
||||
json_file='ma7.config.json',
|
||||
rel_paths=['ts'],
|
||||
)
|
||||
|
||||
|
23
cfg/stick/pgas5.stick
Normal file
23
cfg/stick/pgas5.stick
Normal file
@ -0,0 +1,23 @@
|
||||
[NODE]
|
||||
description = PGAS5 gas pressure cell stick
|
||||
id = pgas5.stick.sea.psi.ch
|
||||
|
||||
[sea_stick]
|
||||
class = secop_psi.sea.SeaClient
|
||||
description = stick SEA connection to ill5.stick
|
||||
config = ill5.stick
|
||||
service = stick
|
||||
|
||||
[ts]
|
||||
class = secop_psi.sea.SeaReadable
|
||||
io = sea_stick
|
||||
sea_object = tt
|
||||
json_file = ill5.config.json
|
||||
rel_paths = ts
|
||||
|
||||
[T_bottom]
|
||||
class = secop_psi.sea.SeaReadable
|
||||
io = sea_stick
|
||||
sea_object = tt
|
||||
json_file = ill5.config.json
|
||||
rel_paths = tb
|
@ -1,28 +0,0 @@
|
||||
Node('pgas5.stick.sea.psi.ch',
|
||||
'PGAS5 gas pressure cell stick',
|
||||
)
|
||||
|
||||
Mod('sea_stick',
|
||||
'frappy_psi.sea.SeaClient',
|
||||
'stick SEA connection to ill5.stick',
|
||||
config = 'pgas5.stick',
|
||||
service = 'stick',
|
||||
)
|
||||
|
||||
Mod('ts',
|
||||
'frappy_psi.sea.SeaReadable',
|
||||
'sample temperature',
|
||||
io = 'sea_stick',
|
||||
sea_object = 'tt',
|
||||
json_file = 'ill5pgas5.config.json',
|
||||
rel_paths = ['ts'],
|
||||
)
|
||||
|
||||
Mod('T_bottom',
|
||||
'frappy_psi.sea.SeaReadable',
|
||||
'bottom T',
|
||||
io = 'sea_stick',
|
||||
sea_object = 'tt',
|
||||
json_file = 'ill5pgas5.config.json',
|
||||
rel_paths = ['ts_2'],
|
||||
)
|
@ -1,67 +0,0 @@
|
||||
Node('thermalcond.stick.sea.psi.ch',
|
||||
'''50 mm thermal conductivity stick, version with standard lsc370 driver''',
|
||||
)
|
||||
Mod('sea_stick',
|
||||
'frappy_psi.sea.SeaClient',
|
||||
'stick sea connection for thermalcond.stick',
|
||||
config = 'thermalcond.stick',
|
||||
service = 'stick',
|
||||
)
|
||||
|
||||
|
||||
|
||||
#Mod('tsam',
|
||||
# 'frappy_psi.sea.SeaReadable',
|
||||
# 'sample stick temperature',
|
||||
# io='sea_stick',
|
||||
# json_file='ma7.config.json',
|
||||
# sea_object='tt',
|
||||
# rel_paths=['ts', 'setsamp']
|
||||
#)
|
||||
|
||||
#Mod('ts',
|
||||
# 'frappy_psi.parmod.Converging',
|
||||
# 'drivable stick T using setsamp',
|
||||
# unit='K',
|
||||
# value_param='tsam.value',
|
||||
# target_param='tsam.setsamp',
|
||||
# meaning=['temperature', 20],
|
||||
# settling_time=20,
|
||||
# tolerance=1,
|
||||
#)
|
||||
|
||||
|
||||
|
||||
#Mod('res',
|
||||
# 'frappy_psi.sea.SeaReadable', '',
|
||||
# io = 'sea_stick',
|
||||
# sea_object = 'res',
|
||||
#)
|
||||
|
||||
Mod('R1',
|
||||
'frappy_psi.sea.SeaReadable', '',
|
||||
io='sea_stick',
|
||||
sea_object='res',
|
||||
rel_paths=['s1'],
|
||||
)
|
||||
|
||||
Mod('R2',
|
||||
'frappy_psi.sea.SeaReadable', '',
|
||||
io='sea_stick',
|
||||
sea_object='res',
|
||||
rel_paths=['s2'],
|
||||
)
|
||||
|
||||
Mod('R3',
|
||||
'frappy_psi.sea.SeaReadable', '',
|
||||
io='sea_stick',
|
||||
sea_object='res',
|
||||
rel_paths=['s3'],
|
||||
)
|
||||
|
||||
Mod('R4',
|
||||
'frappy_psi.sea.SeaReadable', '',
|
||||
io='sea_stick',
|
||||
sea_object='res',
|
||||
rel_paths=['s4'],
|
||||
)
|
56
debian/changelog
vendored
56
debian/changelog
vendored
@ -1,59 +1,3 @@
|
||||
frappy-core (0.19.0) jammy; urgency=medium
|
||||
|
||||
[ Markus Zolliker ]
|
||||
* simulation: extra_params might be a list
|
||||
* add FloatEnumParam
|
||||
* move StructParam to frappy/extparams.py
|
||||
* bugfix in automatic creation if attached io
|
||||
* fixes for proxy modules
|
||||
* simplify callbacks
|
||||
* fix docstring in frappy.error.OutOfRangeError
|
||||
|
||||
[ Alexander Zaft ]
|
||||
* core: introduce common handler class
|
||||
* core: cover errors in handler setup()
|
||||
|
||||
[ Markus Zolliker ]
|
||||
* fix command doc string handling and change default stop doc string
|
||||
* follow up fix for change 33168
|
||||
* follow up fix: handler export=True correctly
|
||||
|
||||
[ Alexander Zaft ]
|
||||
* core: add websocket interface
|
||||
|
||||
[ Georg Brandl ]
|
||||
* dispatcher: consistent handling of missing timestamps
|
||||
|
||||
[ Alexander Zaft ]
|
||||
* gui: catch invalid inputs
|
||||
* gui: sort qt imports
|
||||
|
||||
[ Markus Zolliker ]
|
||||
* frappy.client: cleanup properly after a reply timeout
|
||||
|
||||
[ Alexander Zaft ]
|
||||
* gui: more specialized input widgets
|
||||
* test: add uri attach test
|
||||
|
||||
[ Markus Zolliker ]
|
||||
* frappy.client: catch errors on callbacks
|
||||
* frappy.client: improve error handling more
|
||||
* frappy.client.interactive: improve logging and error handling
|
||||
* frappy.client.SecopClient: add the option to use no logging at all
|
||||
* SecopClient.__del__ must not call callbacks
|
||||
* frappy.client: avoid shutdown callback sent twice
|
||||
|
||||
[ Georg Brandl ]
|
||||
* add config for the Entangle simulation server
|
||||
|
||||
[ Jens Krüger ]
|
||||
* Fix abslimits reading from entangle device
|
||||
|
||||
[ Georg Brandl ]
|
||||
* fix LimitsType to be actually used and validated
|
||||
|
||||
-- Markus Zolliker <jenkins@frm2.tum.de> Thu, 16 May 2024 11:31:25 +0200
|
||||
|
||||
frappy-core (0.18.1) focal; urgency=medium
|
||||
|
||||
* mlz: Zapf fix unit handling and small errors
|
||||
|
@ -29,10 +29,10 @@ import time
|
||||
from collections import defaultdict
|
||||
from threading import Event, RLock, current_thread
|
||||
|
||||
import frappy.errors
|
||||
import frappy.params
|
||||
from frappy.errors import make_secop_error, SECoPError, WrongTypeError
|
||||
from frappy.datatypes import get_datatype
|
||||
from frappy.lib import mkthread
|
||||
from frappy.lib import mkthread, formatExtendedStack
|
||||
from frappy.lib.asynconn import AsynConn, ConnectionClosed
|
||||
from frappy.protocol.interface import decode_msg, encode_msg_frame
|
||||
from frappy.protocol.messages import COMMANDREQUEST, \
|
||||
@ -43,7 +43,7 @@ from frappy.protocol.messages import COMMANDREQUEST, \
|
||||
# replies to be handled for cache
|
||||
UPDATE_MESSAGES = {EVENTREPLY, READREPLY, WRITEREPLY, ERRORPREFIX + READREQUEST, ERRORPREFIX + EVENTREPLY}
|
||||
|
||||
VERSIONFMT = re.compile(r'^[^,]*?ISSE[^,]*,SECoP,')
|
||||
VERSIONFMT= re.compile(r'^[^,]*?ISSE[^,]*,SECoP,')
|
||||
|
||||
|
||||
class UnregisterCallback(Exception):
|
||||
@ -68,10 +68,6 @@ class Logger:
|
||||
error = exception = warning = critical = info
|
||||
|
||||
|
||||
class NullLogger(Logger):
|
||||
error = exception = warning = critical = info = Logger.noop
|
||||
|
||||
|
||||
class CallbackObject:
|
||||
"""abstract definition for a target object for callbacks
|
||||
|
||||
@ -87,12 +83,6 @@ class CallbackObject:
|
||||
def unhandledMessage(self, action, ident, data):
|
||||
"""called on an unhandled message"""
|
||||
|
||||
def handleError(self, exc):
|
||||
"""called on errors handling messages
|
||||
|
||||
:param exc: the exception raised (= sys.exception())
|
||||
"""
|
||||
|
||||
def nodeStateChange(self, online, state):
|
||||
"""called when the state of the connection changes
|
||||
|
||||
@ -115,13 +105,19 @@ class CacheItem(tuple):
|
||||
inheriting from tuple: compatible with old previous version of cache
|
||||
"""
|
||||
def __new__(cls, value, timestamp=None, readerror=None, datatype=None):
|
||||
obj = tuple.__new__(cls, (value, timestamp, readerror))
|
||||
if datatype:
|
||||
if readerror:
|
||||
assert isinstance(readerror, Exception)
|
||||
else:
|
||||
try:
|
||||
# override default method
|
||||
obj.format_value = datatype.format_value
|
||||
except AttributeError:
|
||||
pass
|
||||
value = datatype.import_value(value)
|
||||
except (KeyError, ValueError, AttributeError):
|
||||
readerror = ValueError(f'can not import {value!r} as {datatype!r}')
|
||||
value = None
|
||||
obj = tuple.__new__(cls, (value, timestamp, readerror))
|
||||
try:
|
||||
obj.format_value = datatype.format_value
|
||||
except AttributeError:
|
||||
obj.format_value = lambda value, unit=None: str(value)
|
||||
return obj
|
||||
|
||||
@property
|
||||
@ -148,11 +144,6 @@ class CacheItem(tuple):
|
||||
return repr(self[2])
|
||||
return self.format_value(self[0])
|
||||
|
||||
@staticmethod
|
||||
def format_value(value, unit=None):
|
||||
"""typically overridden with datatype.format_value"""
|
||||
return str(value)
|
||||
|
||||
def __repr__(self):
|
||||
args = (self.value,)
|
||||
if self.timestamp:
|
||||
@ -162,22 +153,11 @@ class CacheItem(tuple):
|
||||
return f'CacheItem{repr(args)}'
|
||||
|
||||
|
||||
class Cache(dict):
|
||||
class Undefined(Exception):
|
||||
def __repr__(self):
|
||||
return '<undefined>'
|
||||
|
||||
undefined = CacheItem(None, None, Undefined())
|
||||
|
||||
def __missing__(self, key):
|
||||
return self.undefined
|
||||
|
||||
|
||||
class ProxyClient:
|
||||
"""common functionality for proxy clients"""
|
||||
|
||||
CALLBACK_NAMES = {'updateEvent', 'updateItem', 'descriptiveDataChange',
|
||||
'nodeStateChange', 'unhandledMessage', 'handleError'}
|
||||
'nodeStateChange', 'unhandledMessage'}
|
||||
online = False # connected or reconnecting since a short time
|
||||
state = 'disconnected' # further possible values: 'connecting', 'reconnecting', 'connected'
|
||||
log = None
|
||||
@ -185,7 +165,7 @@ class ProxyClient:
|
||||
def __init__(self):
|
||||
self.callbacks = {cbname: defaultdict(list) for cbname in self.CALLBACK_NAMES}
|
||||
# caches (module, parameter) = value, timestamp, readerror (internal names!)
|
||||
self.cache = Cache() # dict returning Cache.undefined for missing keys
|
||||
self.cache = {}
|
||||
|
||||
def register_callback(self, key, *args, **kwds):
|
||||
"""register callback functions
|
||||
@ -264,18 +244,16 @@ class ProxyClient:
|
||||
except UnregisterCallback:
|
||||
cblist.remove(cbfunc)
|
||||
except Exception as e:
|
||||
if cbname != 'handleError':
|
||||
try:
|
||||
e.args = [f'error in callback {cbname}{args}: {e}']
|
||||
self.callback(None, 'handleError', e)
|
||||
except Exception:
|
||||
pass
|
||||
# the programmer should catch all errors in callbacks
|
||||
# if not, the log will be flooded with errors
|
||||
if self.log:
|
||||
self.log.exception('error %r calling %s%r', e, cbfunc.__name__, args)
|
||||
return bool(cblist)
|
||||
|
||||
def updateValue(self, module, param, value, timestamp, readerror):
|
||||
self.callback(None, 'updateEvent', module, param, value, timestamp, readerror)
|
||||
self.callback(module, 'updateEvent', module, param, value, timestamp, readerror)
|
||||
self.callback((module, param), 'updateEvent', module, param, value, timestamp, readerror)
|
||||
self.callback((module, param), 'updateEvent', module, param,value, timestamp, readerror)
|
||||
|
||||
|
||||
class SecopClient(ProxyClient):
|
||||
@ -290,17 +268,8 @@ class SecopClient(ProxyClient):
|
||||
descriptive_data = {}
|
||||
modules = {}
|
||||
_last_error = None
|
||||
_update_error_count = 0
|
||||
_max_error_count = 10
|
||||
|
||||
def __init__(self, uri, log=Logger):
|
||||
"""initialize SecopClient
|
||||
|
||||
:param uri: the uri to connect to
|
||||
:param log: a logger.
|
||||
when not given, the print command is used for messages with at least info level.
|
||||
when None, nothing is logged at all
|
||||
"""
|
||||
super().__init__()
|
||||
# maps expected replies to [request, Event, is_error, result] until a response came
|
||||
# there can only be one entry per thread calling 'request'
|
||||
@ -308,21 +277,15 @@ class SecopClient(ProxyClient):
|
||||
self.io = None
|
||||
self.txq = queue.Queue(30) # queue for tx requests
|
||||
self.pending = queue.Queue(30) # requests with colliding action + ident
|
||||
self.log = log or NullLogger
|
||||
self.log = log
|
||||
self.uri = uri
|
||||
self.nodename = uri
|
||||
self._lock = RLock()
|
||||
self._shutdown = Event()
|
||||
self.cleanup = []
|
||||
self.register_callback(None, self.handleError)
|
||||
|
||||
def __del__(self):
|
||||
# make sure threads are stopping. this is needed in case
|
||||
# a frappy client object is lost without calling .disconnect()
|
||||
try:
|
||||
# avoid callbacks when deleting. may cause deadlocks in NICOS
|
||||
self.callbacks.clear()
|
||||
self.disconnect(True)
|
||||
self.disconnect()
|
||||
except Exception:
|
||||
pass
|
||||
|
||||
@ -334,11 +297,6 @@ class SecopClient(ProxyClient):
|
||||
with self._lock:
|
||||
if self.io:
|
||||
return
|
||||
self._shutdown.clear()
|
||||
self.txq = queue.Queue(30)
|
||||
self.pending = queue.Queue(30)
|
||||
self.active_requests.clear()
|
||||
self.cleanup.clear()
|
||||
if self.online:
|
||||
self._set_state(True, 'reconnecting')
|
||||
else:
|
||||
@ -370,9 +328,9 @@ class SecopClient(ProxyClient):
|
||||
# pylint: disable=unsubscriptable-object
|
||||
self._init_descriptive_data(self.request(DESCRIPTIONREQUEST)[2])
|
||||
self.nodename = self.properties.get('equipment_id', self.uri)
|
||||
self._set_state(True, 'connected')
|
||||
if self.activate:
|
||||
self.request(ENABLEEVENTSREQUEST)
|
||||
self._set_state(True, 'connected')
|
||||
break
|
||||
except Exception:
|
||||
# print(formatExtendedTraceback())
|
||||
@ -408,15 +366,8 @@ class SecopClient(ProxyClient):
|
||||
|
||||
def __rxthread(self):
|
||||
noactivity = 0
|
||||
shutdown = False
|
||||
try:
|
||||
while self._running:
|
||||
while self.cleanup:
|
||||
entry = self.cleanup.pop()
|
||||
for key, prev in self.active_requests.items():
|
||||
if prev is entry:
|
||||
self.active_requests.pop(key)
|
||||
break
|
||||
# may raise ConnectionClosed
|
||||
reply = self.io.readline()
|
||||
if reply is None:
|
||||
@ -427,37 +378,35 @@ class SecopClient(ProxyClient):
|
||||
continue
|
||||
self.log.debug('RX: %r', reply)
|
||||
noactivity = 0
|
||||
try:
|
||||
action, ident, data = decode_msg(reply)
|
||||
if ident == '.':
|
||||
ident = None
|
||||
if action in UPDATE_MESSAGES:
|
||||
module_param = self.internal.get(ident, None)
|
||||
if module_param is None and ':' not in (ident or ''):
|
||||
# allow missing ':value'/':target'
|
||||
if action == WRITEREPLY:
|
||||
module_param = self.internal.get(f'{ident}:target', None)
|
||||
else:
|
||||
module_param = self.internal.get(f'{ident}:value', None)
|
||||
if module_param is not None:
|
||||
now = time.time()
|
||||
if action.startswith(ERRORPREFIX):
|
||||
timestamp = data[2].get('t', now)
|
||||
readerror = make_secop_error(*data[0:2])
|
||||
value = None
|
||||
else:
|
||||
timestamp = data[1].get('t', now)
|
||||
value = data[0]
|
||||
readerror = None
|
||||
module, param = module_param
|
||||
timestamp = min(now, timestamp) # no timestamps in the future!
|
||||
action, ident, data = decode_msg(reply)
|
||||
if ident == '.':
|
||||
ident = None
|
||||
if action in UPDATE_MESSAGES:
|
||||
module_param = self.internal.get(ident, None)
|
||||
if module_param is None and ':' not in (ident or ''):
|
||||
# allow missing ':value'/':target'
|
||||
if action == WRITEREPLY:
|
||||
module_param = self.internal.get(f'{ident}:target', None)
|
||||
else:
|
||||
module_param = self.internal.get(f'{ident}:value', None)
|
||||
if module_param is not None:
|
||||
now = time.time()
|
||||
if action.startswith(ERRORPREFIX):
|
||||
timestamp = data[2].get('t', now)
|
||||
readerror = frappy.errors.make_secop_error(*data[0:2])
|
||||
value = None
|
||||
else:
|
||||
timestamp = data[1].get('t', now)
|
||||
value = data[0]
|
||||
readerror = None
|
||||
module, param = module_param
|
||||
timestamp = min(now, timestamp) # no timestamps in the future!
|
||||
try:
|
||||
self.updateValue(module, param, value, timestamp, readerror)
|
||||
if action in (EVENTREPLY, ERRORPREFIX + EVENTREPLY):
|
||||
continue
|
||||
except Exception as e:
|
||||
e.args = (f'error handling SECoP message {reply!r}: {e}',)
|
||||
self.callback(None, 'handleError', e)
|
||||
continue
|
||||
except KeyError:
|
||||
pass # ignore updates of unknown parameters
|
||||
if action in (EVENTREPLY, ERRORPREFIX + EVENTREPLY):
|
||||
continue
|
||||
try:
|
||||
key = action, ident
|
||||
entry = self.active_requests.pop(key)
|
||||
@ -484,19 +433,17 @@ class SecopClient(ProxyClient):
|
||||
except ConnectionClosed:
|
||||
pass
|
||||
except Exception as e:
|
||||
shutdown = True
|
||||
self.callback(None, 'handleError', e)
|
||||
finally:
|
||||
self._rxthread = None
|
||||
self.disconnect(shutdown)
|
||||
if self._shutdown.is_set():
|
||||
return
|
||||
if self.activate:
|
||||
self.log.info('try to reconnect to %s', self.uri)
|
||||
self._connthread = mkthread(self._reconnect)
|
||||
else:
|
||||
self.log.warning('%s disconnected', self.uri)
|
||||
self._set_state(False, 'disconnected')
|
||||
self.log.error('rxthread ended with %r', e)
|
||||
self._rxthread = None
|
||||
self.disconnect(False)
|
||||
if self._shutdown.is_set():
|
||||
return
|
||||
if self.activate:
|
||||
self.log.info('try to reconnect to %s', self.uri)
|
||||
self._connthread = mkthread(self._reconnect)
|
||||
else:
|
||||
self.log.warning('%s disconnected', self.uri)
|
||||
self._set_state(False, 'disconnected')
|
||||
|
||||
def spawn_connect(self, connected_callback=None):
|
||||
"""try to connect in background
|
||||
@ -624,13 +571,6 @@ class SecopClient(ProxyClient):
|
||||
if not self.callback(None, 'unhandledMessage', action, ident, data):
|
||||
self.log.warning('unhandled message: %s %s %r', action, ident, data)
|
||||
|
||||
def handleError(self, exc):
|
||||
if self._update_error_count < self._max_error_count:
|
||||
self.log.exception('%s', exc)
|
||||
self._update_error_count += 1
|
||||
if self._update_error_count == self._max_error_count:
|
||||
self.log.error('disabled reporting of further update errors')
|
||||
|
||||
def _set_state(self, online, state=None):
|
||||
# remark: reconnecting is treated as online
|
||||
self.online = online
|
||||
@ -651,16 +591,12 @@ class SecopClient(ProxyClient):
|
||||
def get_reply(self, entry):
|
||||
"""wait for reply and return it"""
|
||||
if not entry[1].wait(10): # event
|
||||
self.cleanup.append(entry)
|
||||
raise TimeoutError('no response within 10s')
|
||||
if not entry[2]: # reply
|
||||
if self._shutdown.is_set():
|
||||
raise ConnectionError('connection shut down')
|
||||
# no cleanup needed as self.active_requests will be cleared on connect
|
||||
raise ConnectionError('connection closed before reply')
|
||||
action, _, data = entry[2] # pylint: disable=unpacking-non-sequence
|
||||
if action.startswith(ERRORPREFIX):
|
||||
raise make_secop_error(*data[0:2])
|
||||
raise frappy.errors.make_secop_error(*data[0:2])
|
||||
return entry[2] # reply
|
||||
|
||||
def request(self, action, ident=None, data=None):
|
||||
@ -675,14 +611,9 @@ class SecopClient(ProxyClient):
|
||||
"""forced read over connection"""
|
||||
try:
|
||||
self.request(READREQUEST, self.identifier[module, parameter])
|
||||
except SECoPError as e:
|
||||
result = self.cache[module, parameter]
|
||||
if e == result.readerror:
|
||||
# the update was already done in the rx thread
|
||||
return result
|
||||
# e was not originating from a secop error message e.g. a connection problem
|
||||
# -> we have to do the error update
|
||||
self.updateValue(module, parameter, None, time.time(), e)
|
||||
except frappy.errors.SECoPError:
|
||||
# error reply message is already stored as readerror in cache
|
||||
pass
|
||||
return self.cache.get((module, parameter), None)
|
||||
|
||||
def getParameter(self, module, parameter, trycache=False):
|
||||
@ -708,7 +639,7 @@ class SecopClient(ProxyClient):
|
||||
argument = datatype.export_value(argument)
|
||||
else:
|
||||
if argument is not None:
|
||||
raise WrongTypeError('command has no argument')
|
||||
raise frappy.errors.WrongTypeError('command has no argument')
|
||||
# pylint: disable=unsubscriptable-object
|
||||
data, qualifiers = self.request(COMMANDREQUEST, self.identifier[module, command], argument)[2]
|
||||
datatype = self.modules[module]['commands'][command]['datatype'].result
|
||||
@ -717,12 +648,8 @@ class SecopClient(ProxyClient):
|
||||
return data, qualifiers
|
||||
|
||||
def updateValue(self, module, param, value, timestamp, readerror):
|
||||
datatype = self.modules[module]['parameters'][param]['datatype']
|
||||
if readerror:
|
||||
assert isinstance(readerror, Exception)
|
||||
else:
|
||||
value = datatype.import_value(value)
|
||||
entry = CacheItem(value, timestamp, readerror, datatype)
|
||||
entry = CacheItem(value, timestamp, readerror,
|
||||
self.modules[module]['parameters'][param]['datatype'])
|
||||
self.cache[(module, param)] = entry
|
||||
self.callback(None, 'updateItem', module, param, entry)
|
||||
self.callback(module, 'updateItem', module, param, entry)
|
||||
|
@ -28,9 +28,8 @@ import signal
|
||||
import os
|
||||
import traceback
|
||||
import threading
|
||||
import logging
|
||||
from os.path import expanduser
|
||||
from frappy.client import SecopClient, UnregisterCallback
|
||||
from frappy.client import SecopClient
|
||||
from frappy.errors import SECoPError
|
||||
from frappy.datatypes import get_datatype, StatusType
|
||||
try:
|
||||
@ -56,45 +55,40 @@ watch(io, T=True) # watch io and all parameters of T
|
||||
{tail}"""
|
||||
|
||||
|
||||
LOG_LEVELS = {
|
||||
'debug': logging.DEBUG,
|
||||
'comlog': logging.DEBUG+1,
|
||||
'info': logging.INFO,
|
||||
'warning': logging.WARN,
|
||||
'error': logging.ERROR,
|
||||
'off': logging.ERROR+1}
|
||||
LOG_LEVELS = {'debug', 'comlog', 'info', 'warning', 'error', 'off'}
|
||||
CLR = '\r\x1b[K' # code to move to the left and clear current line
|
||||
|
||||
|
||||
class Handler(logging.StreamHandler):
|
||||
def emit(self, record):
|
||||
super().emit(record)
|
||||
if clientenv.sigwinch:
|
||||
class Logger:
|
||||
show_time = False
|
||||
sigwinch = False
|
||||
|
||||
def __init__(self, loglevel='info'):
|
||||
func = self.noop
|
||||
for lev in 'debug', 'info', 'warning', 'error', 'exception':
|
||||
if lev == loglevel:
|
||||
func = self.emit
|
||||
setattr(self, lev, func)
|
||||
self._minute = 0
|
||||
|
||||
def emit(self, fmt, *args, **kwds):
|
||||
if self.show_time:
|
||||
now = time.time()
|
||||
tm = time.localtime(now)
|
||||
if tm.tm_min != self._minute:
|
||||
self._minute = tm.tm_min
|
||||
print(CLR + time.strftime('--- %H:%M:%S ---', tm))
|
||||
sec = f'{now % 60.0:6.3f}'.replace(' ', '0')
|
||||
print(CLR + sec, str(fmt) % args)
|
||||
else:
|
||||
print(CLR + (str(fmt) % args))
|
||||
if self.sigwinch:
|
||||
# SIGWINCH: 'window size has changed' -> triggers a refresh of the input line
|
||||
os.kill(os.getpid(), signal.SIGWINCH)
|
||||
|
||||
|
||||
class Logger(logging.Logger):
|
||||
show_time = False
|
||||
_minute = None
|
||||
|
||||
def __init__(self, name, loglevel='info'):
|
||||
super().__init__(name, LOG_LEVELS.get(loglevel, logging.INFO))
|
||||
handler = Handler()
|
||||
handler.formatter = logging.Formatter('%(asctime)s%(message)s')
|
||||
handler.formatter.formatTime = self.format_time
|
||||
self.addHandler(handler)
|
||||
|
||||
def format_time(self, record, datefmt=None):
|
||||
if self.show_time:
|
||||
now = record.created
|
||||
tm = time.localtime(now)
|
||||
sec = f'{now % 60.0:6.3f}'.replace(' ', '0')
|
||||
if tm.tm_min == self._minute:
|
||||
return f'{CLR}{sec} '
|
||||
self._minute = tm.tm_min
|
||||
return f"{CLR}{time.strftime('--- %H:%M:%S ---', tm)}\n{sec} "
|
||||
return ''
|
||||
@staticmethod
|
||||
def noop(fmt, *args, **kwds):
|
||||
pass
|
||||
|
||||
|
||||
class PrettyFloat(float):
|
||||
@ -244,9 +238,6 @@ class Module:
|
||||
return self.value
|
||||
|
||||
def __repr__(self):
|
||||
return f'<module {self._name}>'
|
||||
|
||||
def showAll(self):
|
||||
wid = max((len(k) for k in self._parameters), default=0)
|
||||
return '%s\n%s%s' % (
|
||||
self._title,
|
||||
@ -280,7 +271,10 @@ class Param:
|
||||
return value
|
||||
|
||||
def formatted(self, obj):
|
||||
return obj._secnode.cache[obj._name, self.name].formatted()
|
||||
value, _, error = obj._secnode.cache[obj._name, self.name]
|
||||
if error:
|
||||
return repr(error)
|
||||
return self.format(value)
|
||||
|
||||
def __set__(self, obj, value):
|
||||
try:
|
||||
@ -292,6 +286,9 @@ class Param:
|
||||
clientenv.raise_with_short_traceback(e)
|
||||
obj._secnode.log.error(repr(e))
|
||||
|
||||
def format(self, value):
|
||||
return self.datatype.format_value(value)
|
||||
|
||||
|
||||
class Command:
|
||||
def __init__(self, name, modname, secnode):
|
||||
@ -340,28 +337,9 @@ def watch(*args, **kwds):
|
||||
mobj._set_watching(arg)
|
||||
print('---')
|
||||
try:
|
||||
nodes = set()
|
||||
for mobj in modules:
|
||||
nodes.add(mobj._secnode)
|
||||
mobj._start_watching()
|
||||
|
||||
close_event = threading.Event()
|
||||
|
||||
def close_node(online, state):
|
||||
if online and state != 'shutdown':
|
||||
return
|
||||
close_event.set()
|
||||
return UnregisterCallback
|
||||
|
||||
def handle_error(*_):
|
||||
close_event.set()
|
||||
return UnregisterCallback
|
||||
|
||||
for node in nodes:
|
||||
node.register_callback(None, nodeStateChange=close_node, handleError=handle_error)
|
||||
|
||||
close_event.wait()
|
||||
|
||||
time.sleep(3600)
|
||||
except KeyboardInterrupt as e:
|
||||
clientenv.raise_with_short_traceback(e)
|
||||
finally:
|
||||
@ -381,7 +359,7 @@ class Client(SecopClient):
|
||||
clientenv.init(sys.modules['__main__'].__dict__)
|
||||
# remove previous client:
|
||||
prev = self.secnodes.pop(uri, None)
|
||||
log = Logger(name, loglevel)
|
||||
log = Logger(loglevel)
|
||||
removed_modules = []
|
||||
if prev:
|
||||
log.info('remove previous client to %s', uri)
|
||||
@ -455,10 +433,8 @@ def run(filepath):
|
||||
class ClientEnvironment:
|
||||
namespace = None
|
||||
last_frames = 0
|
||||
sigwinch = False
|
||||
|
||||
def init(self, namespace=None):
|
||||
self.nodes = []
|
||||
self.namespace = namespace or {}
|
||||
self.namespace.update(run=run, watch=watch, Client=Client)
|
||||
|
||||
@ -468,7 +444,7 @@ class ClientEnvironment:
|
||||
raise exc
|
||||
|
||||
def short_traceback(self):
|
||||
"""cleanup traceback from irrelevant lines"""
|
||||
"""cleanup tracback from irrelevant lines"""
|
||||
lines = traceback.format_exception(*sys.exc_info())
|
||||
# line 0: Traceback header
|
||||
# skip line 1+2 (contains unspecific console line and exec code)
|
||||
@ -506,15 +482,11 @@ class Console(code.InteractiveConsole):
|
||||
readline.write_history_file(history)
|
||||
|
||||
def raw_input(self, prompt=""):
|
||||
clientenv.sigwinch = bool(readline) # activate refresh signal
|
||||
Logger.sigwinch = bool(readline) # activate refresh signal
|
||||
line = input(prompt)
|
||||
clientenv.sigwinch = False
|
||||
Logger.sigwinch = False
|
||||
if line.startswith('/'):
|
||||
line = f"run('{line[1:].strip()}')"
|
||||
module = clientenv.namespace.get(line.strip())
|
||||
if isinstance(module, Module):
|
||||
print(module.showAll())
|
||||
line = ''
|
||||
return line
|
||||
|
||||
def showtraceback(self):
|
||||
@ -527,8 +499,7 @@ def init(*nodes):
|
||||
for idx, node in enumerate(nodes):
|
||||
client_name = '_c%d' % idx
|
||||
try:
|
||||
node = clientenv.namespace[client_name] = Client(node, name=client_name)
|
||||
clientenv.nodes.append(node)
|
||||
clientenv.namespace[client_name] = Client(node, name=client_name)
|
||||
success = True
|
||||
except Exception as e:
|
||||
print(repr(e))
|
||||
|
@ -1244,20 +1244,16 @@ UInt64 = IntRange(0, (1 << 64) - 1)
|
||||
|
||||
# Goodie: Convenience Datatypes for Programming
|
||||
class LimitsType(TupleOf):
|
||||
def __init__(self, member):
|
||||
super().__init__(member, member)
|
||||
def __init__(self, members):
|
||||
super().__init__(members, members)
|
||||
|
||||
def validate(self, value, previous=None):
|
||||
def __call__(self, value):
|
||||
"""accepts an ordered tuple of numeric member types"""
|
||||
limits = TupleOf.validate(self, value, previous)
|
||||
limits = TupleOf.validate(self, value)
|
||||
if limits[1] < limits[0]:
|
||||
raise RangeError(f'maximum value {limits[1]} must be greater than '
|
||||
f'minimum value {limits[0]}')
|
||||
raise RangeError(f'Maximum Value {limits[1]} must be greater than minimum value {limits[0]}!')
|
||||
return limits
|
||||
|
||||
def copy(self):
|
||||
return LimitsType(TupleOf.copy(self).members[0])
|
||||
|
||||
|
||||
class StatusType(TupleOf):
|
||||
"""convenience type for status
|
||||
|
@ -218,7 +218,7 @@ class IsErrorError(SECoPError):
|
||||
|
||||
class DisabledError(SECoPError):
|
||||
"""The requested action can not be performed while the module is disabled"""
|
||||
name = 'Disabled'
|
||||
name = 'disabled'
|
||||
|
||||
|
||||
class ImpossibleError(SECoPError):
|
||||
@ -232,7 +232,7 @@ class ReadFailedError(SECoPError):
|
||||
|
||||
|
||||
class OutOfRangeError(SECoPError):
|
||||
"""The value read from the hardware is out of sensor or calibration range"""
|
||||
"""The requested parameter can not be read just now"""
|
||||
name = 'OutOfRange'
|
||||
|
||||
|
||||
|
@ -1,304 +0,0 @@
|
||||
# *****************************************************************************
|
||||
#
|
||||
# This program is free software; you can redistribute it and/or modify it under
|
||||
# the terms of the GNU General Public License as published by the Free Software
|
||||
# Foundation; either version 2 of the License, or (at your option) any later
|
||||
# version.
|
||||
#
|
||||
# This program is distributed in the hope that it will be useful, but WITHOUT
|
||||
# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
|
||||
# FOR A PARTICULAR PURPOSE. See the GNU General Public License for more
|
||||
# details.
|
||||
#
|
||||
# You should have received a copy of the GNU General Public License along with
|
||||
# this program; if not, write to the Free Software Foundation, Inc.,
|
||||
# 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
||||
#
|
||||
# Module authors:
|
||||
# Markus Zolliker <markus.zolliker@psi.ch>
|
||||
#
|
||||
# *****************************************************************************
|
||||
"""extended parameters
|
||||
|
||||
special parameter classes with some automatic functionality
|
||||
"""
|
||||
|
||||
import re
|
||||
from frappy.core import Parameter, Property
|
||||
from frappy.datatypes import BoolType, DataType, DataTypeType, EnumType, \
|
||||
FloatRange, StringType, StructOf, ValueType
|
||||
from frappy.errors import ProgrammingError
|
||||
|
||||
|
||||
class StructParam(Parameter):
|
||||
"""convenience class to create a struct Parameter together with individual params
|
||||
|
||||
Usage:
|
||||
|
||||
class Controller(Drivable):
|
||||
|
||||
...
|
||||
|
||||
ctrlpars = StructParam('ctrlpars struct', [
|
||||
('pid_p', 'p', Parameter('control parameter p', FloatRange())),
|
||||
('pid_i', 'i', Parameter('control parameter i', FloatRange())),
|
||||
('pid_d', 'd', Parameter('control parameter d', FloatRange())),
|
||||
], readonly=False)
|
||||
|
||||
...
|
||||
|
||||
then implement either read_ctrlpars and write_ctrlpars or
|
||||
read_pid_p, read_pid_i, read_pid_d, write_pid_p, write_pid_i and write_pid_d
|
||||
|
||||
the methods not implemented will be created automatically
|
||||
"""
|
||||
|
||||
# use properties, as simple attributes are not considered on copy()
|
||||
paramdict = Property('dict <parametername> of Parameter(...)', ValueType())
|
||||
hasStructRW = Property('has a read_<struct param> or write_<struct param> method',
|
||||
BoolType(), default=False)
|
||||
|
||||
insideRW = 0 # counter for avoiding multiple superfluous updates
|
||||
|
||||
def __init__(self, description=None, paramdict=None, prefix_or_map='', *, datatype=None, readonly=False, **kwds):
|
||||
"""create a struct parameter together with individual parameters
|
||||
|
||||
in addition to normal Parameter arguments:
|
||||
|
||||
:param paramdict: dict <member name> of Parameter(...)
|
||||
:param prefix_or_map: either a prefix for the parameter name to add to the member name
|
||||
or a dict <member name> or <parameter name>
|
||||
"""
|
||||
if isinstance(paramdict, DataType):
|
||||
raise ProgrammingError('second argument must be a dict of Param')
|
||||
if datatype is None and paramdict is not None: # omit the following on Parameter.copy()
|
||||
if isinstance(prefix_or_map, str):
|
||||
prefix_or_map = {m: prefix_or_map + m for m in paramdict}
|
||||
for membername, param in paramdict.items():
|
||||
param.name = prefix_or_map[membername]
|
||||
datatype = StructOf(**{m: p.datatype for m, p in paramdict.items()})
|
||||
kwds['influences'] = [p.name for p in paramdict.values()]
|
||||
self.updateEnable = {}
|
||||
if paramdict:
|
||||
kwds['paramdict'] = paramdict
|
||||
super().__init__(description, datatype, readonly=readonly, **kwds)
|
||||
|
||||
def __set_name__(self, owner, name):
|
||||
# names of access methods of structed param (e.g. ctrlpars)
|
||||
struct_read_name = f'read_{name}' # e.g. 'read_ctrlpars'
|
||||
struct_write_name = f'write_{name}' # e.h. 'write_ctrlpars'
|
||||
self.hasStructRW = hasattr(owner, struct_read_name) or hasattr(owner, struct_write_name)
|
||||
|
||||
for membername, param in self.paramdict.items():
|
||||
pname = param.name
|
||||
changes = {
|
||||
'readonly': self.readonly,
|
||||
'influences': set(param.influences) | {name},
|
||||
}
|
||||
param.ownProperties.update(changes)
|
||||
param.init(changes)
|
||||
setattr(owner, pname, param)
|
||||
param.__set_name__(owner, param.name)
|
||||
|
||||
if self.hasStructRW:
|
||||
rname = f'read_{pname}'
|
||||
|
||||
if not hasattr(owner, rname):
|
||||
def rfunc(self, membername=membername, struct_read_name=struct_read_name):
|
||||
return getattr(self, struct_read_name)()[membername]
|
||||
|
||||
rfunc.poll = False # read_<struct param> is polled only
|
||||
setattr(owner, rname, rfunc)
|
||||
|
||||
if not self.readonly:
|
||||
wname = f'write_{pname}'
|
||||
if not hasattr(owner, wname):
|
||||
def wfunc(self, value, membername=membername,
|
||||
name=name, rname=rname, struct_write_name=struct_write_name):
|
||||
valuedict = dict(getattr(self, name))
|
||||
valuedict[membername] = value
|
||||
getattr(self, struct_write_name)(valuedict)
|
||||
return getattr(self, rname)()
|
||||
|
||||
setattr(owner, wname, wfunc)
|
||||
|
||||
if not self.hasStructRW:
|
||||
if not hasattr(owner, struct_read_name):
|
||||
def struct_read_func(self, name=name, flist=tuple(
|
||||
(m, f'read_{p.name}') for m, p in self.paramdict.items())):
|
||||
pobj = self.parameters[name]
|
||||
# disable updates generated from the callbacks of individual params
|
||||
pobj.insideRW += 1 # guarded by self.accessLock
|
||||
try:
|
||||
return {m: getattr(self, f)() for m, f in flist}
|
||||
finally:
|
||||
pobj.insideRW -= 1
|
||||
|
||||
setattr(owner, struct_read_name, struct_read_func)
|
||||
|
||||
if not (self.readonly or hasattr(owner, struct_write_name)):
|
||||
|
||||
def struct_write_func(self, value, name=name, funclist=tuple(
|
||||
(m, f'write_{p.name}') for m, p in self.paramdict.items())):
|
||||
pobj = self.parameters[name]
|
||||
pobj.insideRW += 1 # guarded by self.accessLock
|
||||
try:
|
||||
return {m: getattr(self, f)(value[m]) for m, f in funclist}
|
||||
finally:
|
||||
pobj.insideRW -= 1
|
||||
|
||||
setattr(owner, struct_write_name, struct_write_func)
|
||||
|
||||
super().__set_name__(owner, name)
|
||||
|
||||
def finish(self, modobj=None):
|
||||
"""register callbacks for consistency"""
|
||||
super().finish(modobj)
|
||||
if modobj:
|
||||
|
||||
if self.hasStructRW:
|
||||
def cb(value, modobj=modobj, structparam=self):
|
||||
for membername, param in structparam.paramdict.items():
|
||||
setattr(modobj, param.name, value[membername])
|
||||
|
||||
modobj.addCallback(self.name, cb)
|
||||
else:
|
||||
for membername, param in self.paramdict.items():
|
||||
def cb(value, modobj=modobj, structparam=self, membername=membername):
|
||||
if not structparam.insideRW:
|
||||
prev = dict(getattr(modobj, structparam.name))
|
||||
prev[membername] = value
|
||||
setattr(modobj, structparam.name, prev)
|
||||
|
||||
modobj.addCallback(param.name, cb)
|
||||
|
||||
|
||||
class FloatEnumParam(Parameter):
|
||||
"""combine enum and float parameter
|
||||
|
||||
Example Usage:
|
||||
|
||||
vrange = FloatEnumParam('sensor range', ['500uV', '20mV', '1V'], 'V')
|
||||
|
||||
The following will be created automatically:
|
||||
|
||||
- the parameter vrange will get a datatype FloatRange(5e-4, 1, unit='V')
|
||||
- an additional parameter `vrange_idx` will be created with an enum type
|
||||
{'500uV': 0, '20mV': 1, '1V': 2}
|
||||
- the method `write_vrange` will be created automatically
|
||||
|
||||
However, the methods `write_vrange_idx` and `read_vrange_idx`, if needed,
|
||||
have to implemented by the programmer.
|
||||
|
||||
Writing to the float parameter involves 'rounding' to the closest allowed value.
|
||||
|
||||
Customization:
|
||||
|
||||
The individual labels might be customized by defining them as a tuple
|
||||
(<index>, <label>, <float value>) where either the index or the float value
|
||||
may be omitted.
|
||||
|
||||
When the index is omitted, the element will be the previous index + 1 or
|
||||
0 when it is the first element.
|
||||
|
||||
Omitted values will be determined from the label, assuming that they use
|
||||
one of the predefined unit prefixes together with the given unit.
|
||||
|
||||
The name of the index parameter is by default '<name>_idx' but might be
|
||||
changed with the idx_name argument.
|
||||
"""
|
||||
# use properties, as simple attributes are not considered on copy()
|
||||
idx_name = Property('name of attached index parameter', StringType(), default='')
|
||||
valuedict = Property('dict <index> of <value>', ValueType(dict))
|
||||
enumtype = Property('dict <label> of <index', DataTypeType())
|
||||
|
||||
# TODO: factor out unit handling, at the latest when needed elsewhere
|
||||
PREFIXES = {'q': -30, 'r': -27, 'y': -24, 'z': -21, 'a': -18, 'f': -15,
|
||||
'p': -12, 'n': -9, 'u': -6, 'µ': -6, 'm': -3,
|
||||
'': 0, 'k': 3, 'M': 6, 'G': 9, 'T': 12,
|
||||
'P': 15, 'E': 18, 'Z': 21, 'Y': 24, 'R': 25, 'Q': 30}
|
||||
|
||||
def __init__(self, description=None, labels=None, unit='',
|
||||
*, datatype=None, readonly=False, **kwds):
|
||||
if labels is None:
|
||||
# called on Parameter.copy()
|
||||
super().__init__(description, datatype, readonly=readonly, **kwds)
|
||||
return
|
||||
if isinstance(labels, DataType):
|
||||
raise ProgrammingError('second argument must be a list of labels, not a datatype')
|
||||
nextidx = 0
|
||||
try:
|
||||
edict = {}
|
||||
vdict = {}
|
||||
for elem in labels:
|
||||
if isinstance(elem, str):
|
||||
idx, label = [nextidx, elem]
|
||||
else:
|
||||
if isinstance(elem[0], str):
|
||||
elem = [nextidx] + list(elem)
|
||||
idx, label, *tail = elem
|
||||
if tail:
|
||||
vdict[idx], = tail
|
||||
edict[label] = idx
|
||||
nextidx = idx + 1
|
||||
except (ValueError, TypeError) as e:
|
||||
raise ProgrammingError('labels must be a list of labels or tuples '
|
||||
'([index], label, [value])') from e
|
||||
pat = re.compile(rf'([+-]?\d*\.?\d*) *({"|".join(self.PREFIXES)}){unit}$')
|
||||
try:
|
||||
# determine missing values from labels
|
||||
for label, idx in edict.items():
|
||||
if idx not in vdict:
|
||||
value, prefix = pat.match(label).groups()
|
||||
vdict[idx] = float(f'{value}e{self.PREFIXES[prefix]}')
|
||||
except (AttributeError, ValueError) as e:
|
||||
raise ProgrammingError(f"{label!r} has not the form '<float><prefix>{unit}'") from e
|
||||
try:
|
||||
enumtype = EnumType(**edict)
|
||||
except TypeError as e:
|
||||
raise ProgrammingError(str(e)) from e
|
||||
datatype = FloatRange(min(vdict.values()), max(vdict.values()), unit=unit)
|
||||
super().__init__(description, datatype, enumtype=enumtype, valuedict=vdict,
|
||||
readonly=readonly, **kwds)
|
||||
|
||||
def __set_name__(self, owner, name):
|
||||
super().__set_name__(owner, name)
|
||||
if not self.idx_name:
|
||||
self.idx_name = name + '_idx'
|
||||
iname = self.idx_name
|
||||
idx_param = Parameter(f'index of {name}', self.enumtype,
|
||||
readonly=self.readonly, influences={name})
|
||||
idx_param.init({})
|
||||
setattr(owner, iname, idx_param)
|
||||
idx_param.__set_name__(owner, iname)
|
||||
|
||||
self.setProperty('influences', {iname})
|
||||
|
||||
if not hasattr(owner, f'write_{name}'):
|
||||
|
||||
# customization (like rounding up or down) might be
|
||||
# achieved by adding write_<name>. if not, the default
|
||||
# is rounding to the closest value
|
||||
|
||||
def wfunc(mobj, value, vdict=self.valuedict, fname=name, wfunc_iname=f'write_{iname}'):
|
||||
getattr(mobj, wfunc_iname)(
|
||||
min(vdict, key=lambda i: abs(vdict[i] - value)))
|
||||
return getattr(mobj, fname)
|
||||
|
||||
setattr(owner, f'write_{name}', wfunc)
|
||||
|
||||
def __get__(self, instance, owner):
|
||||
"""getter for value"""
|
||||
if instance is None:
|
||||
return self
|
||||
return self.valuedict[instance.parameters[self.idx_name].value]
|
||||
|
||||
def trigger_setter(self, modobj, _):
|
||||
# trigger update of float parameter on change of enum parameter
|
||||
modobj.announceUpdate(self.name, getattr(modobj, self.name))
|
||||
|
||||
def finish(self, modobj=None):
|
||||
"""register callbacks for consistency"""
|
||||
super().finish(modobj)
|
||||
if modobj:
|
||||
modobj.addCallback(self.idx_name, self.trigger_setter, modobj)
|
@ -1,10 +1,6 @@
|
||||
import sys
|
||||
from frappy.gui.qt import QCheckBox, QComboBox, QLineEdit, pyqtSignal
|
||||
|
||||
from frappy.gui.qt import QCheckBox, QComboBox, QDoubleSpinBox, QLineEdit, \
|
||||
QSpinBox, pyqtSignal
|
||||
|
||||
from frappy.datatypes import BoolType, EnumType, FloatRange, IntRange, \
|
||||
StringType, TextType
|
||||
from frappy.datatypes import BoolType, EnumType
|
||||
|
||||
# ArrayOf, BLOBType, FloatRange, IntRange, StringType, StructOf, TextType, TupleOf
|
||||
|
||||
@ -13,24 +9,11 @@ def get_input_widget(datatype, parent=None):
|
||||
return {
|
||||
EnumType: EnumInput,
|
||||
BoolType: BoolInput,
|
||||
IntRange: IntInput,
|
||||
StringType: StringInput,
|
||||
TextType: StringInput,
|
||||
}.get(datatype.__class__, GenericInput)(datatype, parent)
|
||||
|
||||
|
||||
class InputBase:
|
||||
class GenericInput(QLineEdit):
|
||||
submitted = pyqtSignal()
|
||||
input_feedback = pyqtSignal(str)
|
||||
|
||||
def get_input(self):
|
||||
raise NotImplementedError
|
||||
|
||||
def submit(self):
|
||||
self.submitted.emit()
|
||||
|
||||
|
||||
class GenericInput(InputBase, QLineEdit):
|
||||
def __init__(self, datatype, parent=None):
|
||||
super().__init__(parent)
|
||||
self.datatype = datatype
|
||||
@ -40,28 +23,12 @@ class GenericInput(InputBase, QLineEdit):
|
||||
def get_input(self):
|
||||
return self.datatype.from_string(self.text())
|
||||
|
||||
|
||||
class StringInput(GenericInput):
|
||||
def __init__(self, datatype, parent=None):
|
||||
super().__init__(datatype, parent)
|
||||
def submit(self):
|
||||
self.submitted.emit()
|
||||
|
||||
|
||||
class IntInput(InputBase, QSpinBox):
|
||||
def __init__(self, datatype, parent=None):
|
||||
super().__init__(parent)
|
||||
self.datatype = datatype
|
||||
# we dont use setMaximum and setMinimum because it is quite restrictive
|
||||
# when typing, so set it as high as possible
|
||||
self.setMaximum(2147483647)
|
||||
self.setMinimum(-2147483648)
|
||||
|
||||
self.lineEdit().returnPressed.connect(self.submit)
|
||||
|
||||
def get_input(self):
|
||||
return self.datatype(self.value())
|
||||
|
||||
|
||||
class EnumInput(InputBase, QComboBox):
|
||||
class EnumInput(QComboBox):
|
||||
submitted = pyqtSignal()
|
||||
def __init__(self, datatype, parent=None):
|
||||
super().__init__(parent)
|
||||
self.setPlaceholderText('choose value')
|
||||
@ -78,11 +45,18 @@ class EnumInput(InputBase, QComboBox):
|
||||
def get_input(self):
|
||||
return self._map[self.currentIndex()].value
|
||||
|
||||
def submit(self):
|
||||
self.submitted.emit()
|
||||
|
||||
class BoolInput(InputBase, QCheckBox):
|
||||
|
||||
class BoolInput(QCheckBox):
|
||||
submitted = pyqtSignal()
|
||||
def __init__(self, datatype, parent=None):
|
||||
super().__init__(parent)
|
||||
self.datatype = datatype
|
||||
|
||||
def get_input(self):
|
||||
return self.isChecked()
|
||||
|
||||
def submit(self):
|
||||
self.submitted.emit()
|
||||
|
@ -24,9 +24,9 @@ from frappy.gui.qt import QColor, QDialog, QHBoxLayout, QIcon, QLabel, \
|
||||
QLineEdit, QMessageBox, QPropertyAnimation, QPushButton, Qt, QToolButton, \
|
||||
QWidget, pyqtProperty, pyqtSignal
|
||||
|
||||
from frappy.gui.inputwidgets import get_input_widget
|
||||
from frappy.gui.util import Colors, loadUi
|
||||
from frappy.gui.valuewidgets import get_widget
|
||||
from frappy.gui.inputwidgets import get_input_widget
|
||||
|
||||
|
||||
class CommandDialog(QDialog):
|
||||
@ -54,11 +54,7 @@ class CommandDialog(QDialog):
|
||||
self.resize(self.sizeHint())
|
||||
|
||||
def get_value(self):
|
||||
try:
|
||||
return self.widgets[0].get_value()
|
||||
except Exception as e:
|
||||
QMessageBox.warning(self.parent(), 'Operation failed', str(e))
|
||||
return None
|
||||
return True, self.widgets[0].get_value()
|
||||
|
||||
def exec(self):
|
||||
if super().exec():
|
||||
@ -99,9 +95,8 @@ class CommandButton(QPushButton):
|
||||
if self._argintype:
|
||||
dlg = CommandDialog(self._cmdname, self._argintype)
|
||||
args = dlg.exec()
|
||||
if args is not None:
|
||||
# no errors when converting value and 'Cancel' wasn't clicked
|
||||
self._cb(self._cmdname, args)
|
||||
if args: # not 'Cancel' clicked
|
||||
self._cb(self._cmdname, args[1])
|
||||
else:
|
||||
# no need for arguments
|
||||
self._cb(self._cmdname, None)
|
||||
@ -447,8 +442,8 @@ class ModuleWidget(QWidget):
|
||||
self.paramDetails.emit(self._name, param)
|
||||
|
||||
def _button_pressed(self, param):
|
||||
target = self._paramInputs[param].get_input()
|
||||
try:
|
||||
target = self._paramInputs[param].get_input()
|
||||
self._node.setParameter(self._name, param, target)
|
||||
except Exception as e:
|
||||
QMessageBox.warning(self.parent(), 'Operation failed', str(e))
|
||||
|
@ -42,10 +42,10 @@ try:
|
||||
QDialogButtonBox, QDoubleSpinBox, QFileDialog, QFrame, QGridLayout, \
|
||||
QGroupBox, QHBoxLayout, QInputDialog, QLabel, QLineEdit, QMainWindow, \
|
||||
QMenu, QMessageBox, QPlainTextEdit, QPushButton, QRadioButton, \
|
||||
QScrollArea, QSizePolicy, QSlider, QSpacerItem, QSpinBox, QStyle, \
|
||||
QScrollArea, QSizePolicy, QSpacerItem, QSpinBox, QStyle, \
|
||||
QStyleOptionTab, QStylePainter, QTabBar, QTabWidget, QTextEdit, \
|
||||
QToolButton, QTreeView, QTreeWidget, QTreeWidgetItem, QVBoxLayout, \
|
||||
QWidget
|
||||
QWidget,QSlider
|
||||
|
||||
import frappy.gui.resources_qt6
|
||||
|
||||
@ -62,9 +62,9 @@ except ImportError as e:
|
||||
QDialog, QDialogButtonBox, QDoubleSpinBox, QFileDialog, QFrame, \
|
||||
QGridLayout, QGroupBox, QHBoxLayout, QInputDialog, QLabel, QLineEdit, \
|
||||
QMainWindow, QMenu, QMessageBox, QPlainTextEdit, QPushButton, \
|
||||
QRadioButton, QScrollArea, QShortcut, QSizePolicy, QSlider, \
|
||||
QSpacerItem, QSpinBox, QStyle, QStyleOptionTab, QStylePainter, \
|
||||
QTabBar, QTabWidget, QTextEdit, QToolButton, QTreeView, QTreeWidget, \
|
||||
QTreeWidgetItem, QVBoxLayout, QWidget
|
||||
QRadioButton, QScrollArea, QShortcut, QSizePolicy, QSpacerItem, \
|
||||
QSpinBox, QStyle, QStyleOptionTab, QStylePainter, QTabBar, \
|
||||
QTabWidget, QTextEdit, QToolButton, QTreeView, QTreeWidget, \
|
||||
QTreeWidgetItem, QVBoxLayout, QWidget, QSlider
|
||||
|
||||
import frappy.gui.resources_qt5
|
||||
|
@ -61,6 +61,7 @@ class HasIO(Module):
|
||||
ioname = opts.get('io') or f'{name}_io'
|
||||
io = self.ioClass(ioname, srv.log.getChild(ioname), opts, srv) # pylint: disable=not-callable
|
||||
io.callingModule = []
|
||||
srv.modules[ioname] = io
|
||||
srv.secnode.add_module(io, ioname)
|
||||
self.ioDict[self.uri] = ioname
|
||||
self.io = ioname
|
||||
|
@ -141,7 +141,6 @@ class SequencerMixin:
|
||||
return self.Status.IDLE, ''
|
||||
|
||||
def stop(self):
|
||||
"""stop sequence"""
|
||||
if self.seq_is_alive():
|
||||
self._seq_stopflag = True
|
||||
|
||||
|
@ -83,14 +83,15 @@ class HasAccessibles(HasProperties):
|
||||
override_values.pop(key, None)
|
||||
elif key in accessibles:
|
||||
override_values[key] = value
|
||||
# remark: merged_properties contain already the properties of accessibles of cls
|
||||
for aname, aobj in list(accessibles.items()):
|
||||
if aname in override_values:
|
||||
aobj = aobj.copy()
|
||||
value = override_values[aname]
|
||||
if value is None:
|
||||
accessibles.pop(aname)
|
||||
continue
|
||||
aobj = aobj.create_from_value(merged_properties[aname], value)
|
||||
aobj.merge(merged_properties[aname])
|
||||
aobj.override(value)
|
||||
# replace the bare value by the created accessible
|
||||
setattr(cls, aname, aobj)
|
||||
else:
|
||||
@ -333,7 +334,8 @@ class Module(HasAccessibles):
|
||||
self.secNode = srv.secnode
|
||||
self.log = logger
|
||||
self.name = name
|
||||
self.paramCallbacks = {}
|
||||
self.valueCallbacks = {}
|
||||
self.errorCallbacks = {}
|
||||
self.earlyInitDone = False
|
||||
self.initModuleDone = False
|
||||
self.startModuleDone = False
|
||||
@ -467,7 +469,8 @@ class Module(HasAccessibles):
|
||||
apply default when no value is given (in cfg or as Parameter argument)
|
||||
or complain, when cfg is needed
|
||||
"""
|
||||
self.paramCallbacks[pname] = []
|
||||
self.valueCallbacks[pname] = []
|
||||
self.errorCallbacks[pname] = []
|
||||
if isinstance(pobj, Limit):
|
||||
basepname = pname.rpartition('_')[0]
|
||||
baseparam = self.parameters.get(basepname)
|
||||
@ -532,46 +535,68 @@ class Module(HasAccessibles):
|
||||
err.report_error = False
|
||||
return # no updates for repeated errors
|
||||
err = secop_error(err)
|
||||
value_err = value, err
|
||||
else:
|
||||
if not changed and timestamp < (pobj.timestamp or 0) + pobj.omit_unchanged_within:
|
||||
# no change within short time -> omit
|
||||
return
|
||||
value_err = (value,)
|
||||
elif not changed and timestamp < (pobj.timestamp or 0) + pobj.omit_unchanged_within:
|
||||
# no change within short time -> omit
|
||||
return
|
||||
pobj.timestamp = timestamp or time.time()
|
||||
pobj.readerror = err
|
||||
for cbfunc, cbargs in self.paramCallbacks[pname]:
|
||||
try:
|
||||
cbfunc(*cbargs, *value_err)
|
||||
except Exception:
|
||||
pass
|
||||
if err:
|
||||
callbacks = self.errorCallbacks
|
||||
pobj.readerror = arg = err
|
||||
else:
|
||||
callbacks = self.valueCallbacks
|
||||
arg = value
|
||||
pobj.readerror = None
|
||||
if pobj.export:
|
||||
self.updateCallback(self, pobj)
|
||||
|
||||
def addCallback(self, pname, callback_function, *args):
|
||||
self.paramCallbacks[pname].append((callback_function, args))
|
||||
cblist = callbacks[pname]
|
||||
for cb in cblist:
|
||||
try:
|
||||
cb(arg)
|
||||
except Exception:
|
||||
# print(formatExtendedTraceback())
|
||||
pass
|
||||
|
||||
def registerCallbacks(self, modobj, autoupdate=()):
|
||||
"""register callbacks to another module <modobj>
|
||||
|
||||
whenever a self.<param> changes or changes its error state:
|
||||
<modobj>.update_param(<value> [, <exc>]) is called,
|
||||
where <value> is the new value and <exc> is given only in case of error.
|
||||
if the method does not exist, and <param> is in autoupdate
|
||||
<modobj>.announceUpdate(<pname>, <value>, <exc>) is called
|
||||
with <exc> being None in case of no error.
|
||||
|
||||
Remark: when <modobj>.update_<param> does not accept the <exc> argument,
|
||||
nothing happens (the callback is catched by try / except).
|
||||
Any exceptions raised by the callback function are silently ignored.
|
||||
- whenever a self.<param> changes:
|
||||
<modobj>.update_<param> is called with the new value as argument.
|
||||
If this method raises an exception, <modobj>.<param> gets into an error state.
|
||||
If the method does not exist and <param> is in autoupdate,
|
||||
<modobj>.<param> is updated to self.<param>
|
||||
- whenever <self>.<param> gets into an error state:
|
||||
<modobj>.error_update_<param> is called with the exception as argument.
|
||||
If this method raises an error, <modobj>.<param> gets into an error state.
|
||||
If this method does not exist, and <param> is in autoupdate,
|
||||
<modobj>.<param> gets into the same error state as self.<param>
|
||||
"""
|
||||
autoupdate = set(autoupdate)
|
||||
for pname in self.parameters:
|
||||
cbfunc = getattr(modobj, 'update_' + pname, None)
|
||||
if cbfunc:
|
||||
self.addCallback(pname, cbfunc)
|
||||
errfunc = getattr(modobj, 'error_update_' + pname, None)
|
||||
if errfunc:
|
||||
def errcb(err, p=pname, efunc=errfunc):
|
||||
try:
|
||||
efunc(err)
|
||||
except Exception as e:
|
||||
modobj.announceUpdate(p, err=e)
|
||||
self.errorCallbacks[pname].append(errcb)
|
||||
else:
|
||||
def errcb(err, p=pname):
|
||||
modobj.announceUpdate(p, err=err)
|
||||
if pname in autoupdate:
|
||||
self.errorCallbacks[pname].append(errcb)
|
||||
|
||||
updfunc = getattr(modobj, 'update_' + pname, None)
|
||||
if updfunc:
|
||||
def cb(value, ufunc=updfunc, efunc=errcb):
|
||||
try:
|
||||
ufunc(value)
|
||||
except Exception as e:
|
||||
efunc(e)
|
||||
self.valueCallbacks[pname].append(cb)
|
||||
elif pname in autoupdate:
|
||||
self.addCallback(pname, modobj.announceUpdate, pname)
|
||||
def cb(value, p=pname):
|
||||
modobj.announceUpdate(p, value)
|
||||
self.valueCallbacks[pname].append(cb)
|
||||
|
||||
def isBusy(self, status=None):
|
||||
"""helper function for treating substates of BUSY correctly"""
|
||||
@ -589,10 +614,6 @@ class Module(HasAccessibles):
|
||||
# enablePoll == False: we still need the poll thread for writing values from writeDict
|
||||
if hasattr(self, 'io'):
|
||||
self.io.polledModules.append(self)
|
||||
if not self.io.triggerPoll:
|
||||
# when self.io.enablePoll is False, triggerPoll is not
|
||||
# created for self.io in the else clause below
|
||||
self.io.triggerPoll = threading.Event()
|
||||
else:
|
||||
self.triggerPoll = threading.Event()
|
||||
self.polledModules.append(self)
|
||||
@ -692,8 +713,8 @@ class Module(HasAccessibles):
|
||||
for mobj in polled_modules:
|
||||
pinfo = mobj.pollInfo = PollInfo(mobj.pollinterval, self.triggerPoll)
|
||||
# trigger a poll interval change when self.pollinterval changes.
|
||||
if 'pollinterval' in mobj.paramCallbacks:
|
||||
mobj.addCallback('pollinterval', pinfo.update_interval)
|
||||
if 'pollinterval' in mobj.valueCallbacks:
|
||||
mobj.valueCallbacks['pollinterval'].append(pinfo.update_interval)
|
||||
|
||||
for pname, pobj in mobj.parameters.items():
|
||||
rfunc = getattr(mobj, 'read_' + pname)
|
||||
|
@ -36,7 +36,6 @@ from .modulebase import Module
|
||||
|
||||
class Readable(Module):
|
||||
"""basic readable module"""
|
||||
# pylint: disable=invalid-name
|
||||
Status = Enum('Status',
|
||||
IDLE=StatusType.IDLE,
|
||||
WARN=StatusType.WARN,
|
||||
@ -93,7 +92,7 @@ class Drivable(Writable):
|
||||
|
||||
@Command(None, result=None)
|
||||
def stop(self):
|
||||
"""not implemented - this is a no-op"""
|
||||
"""cease driving, go to IDLE state"""
|
||||
|
||||
|
||||
class Communicator(HasComlog, Module):
|
||||
|
@ -57,17 +57,13 @@ class Accessible(HasProperties):
|
||||
def as_dict(self):
|
||||
return self.propertyValues
|
||||
|
||||
def create_from_value(self, properties, value):
|
||||
"""return a clone with given value and inherited properties"""
|
||||
raise NotImplementedError
|
||||
|
||||
def clone(self, properties, **kwds):
|
||||
"""return a clone of ourselfs with inherited properties"""
|
||||
def override(self, value):
|
||||
"""override with a bare value"""
|
||||
raise NotImplementedError
|
||||
|
||||
def copy(self):
|
||||
"""return a (deep) copy of ourselfs"""
|
||||
return self.clone(self.propertyValues)
|
||||
raise NotImplementedError
|
||||
|
||||
def updateProperties(self, merged_properties):
|
||||
"""update merged_properties with our own properties"""
|
||||
@ -98,16 +94,6 @@ class Accessible(HasProperties):
|
||||
props.append(f'{k}={v!r}')
|
||||
return f"{self.__class__.__name__}({', '.join(props)})"
|
||||
|
||||
def fixExport(self):
|
||||
if self.export is True:
|
||||
predefined_cls = PREDEFINED_ACCESSIBLES.get(self.name)
|
||||
if predefined_cls is None:
|
||||
self.export = '_' + self.name
|
||||
elif isinstance(self, predefined_cls):
|
||||
self.export = self.name
|
||||
else:
|
||||
raise ProgrammingError(f'can not use {self.name!r} as name of a {type(self).__name__}')
|
||||
|
||||
|
||||
class Parameter(Accessible):
|
||||
"""defines a parameter
|
||||
@ -235,17 +221,26 @@ class Parameter(Accessible):
|
||||
self.name = name
|
||||
if isinstance(self.datatype, EnumType):
|
||||
self.datatype.set_name(name)
|
||||
self.fixExport()
|
||||
|
||||
def clone(self, properties, **kwds):
|
||||
"""return a clone of ourselfs with inherited properties"""
|
||||
res = type(self)(**kwds)
|
||||
if self.export is True:
|
||||
predefined_cls = PREDEFINED_ACCESSIBLES.get(self.name, None)
|
||||
if predefined_cls is Parameter:
|
||||
self.export = self.name
|
||||
elif predefined_cls is None:
|
||||
self.export = '_' + self.name
|
||||
else:
|
||||
raise ProgrammingError(f'can not use {self.name!r} as name of a Parameter')
|
||||
if 'export' in self.ownProperties:
|
||||
# avoid export=True overrides export=<name>
|
||||
self.ownProperties['export'] = self.export
|
||||
|
||||
def copy(self):
|
||||
"""return a (deep) copy of ourselfs"""
|
||||
res = type(self)()
|
||||
res.name = self.name
|
||||
res.init(properties)
|
||||
res.init(res.ownProperties)
|
||||
res.init(self.propertyValues)
|
||||
if 'datatype' in self.propertyValues:
|
||||
res.datatype = res.datatype.copy()
|
||||
res.finish()
|
||||
return res
|
||||
|
||||
def updateProperties(self, merged_properties):
|
||||
@ -258,9 +253,9 @@ class Parameter(Accessible):
|
||||
merged_properties.pop(key)
|
||||
merged_properties.update(self.ownProperties)
|
||||
|
||||
def create_from_value(self, properties, value):
|
||||
"""return a clone with given value and inherited properties"""
|
||||
return self.clone(properties, value=self.datatype(value))
|
||||
def override(self, value):
|
||||
"""override default"""
|
||||
self.value = self.datatype(value)
|
||||
|
||||
def merge(self, merged_properties):
|
||||
"""merge with inherited properties
|
||||
@ -279,7 +274,7 @@ class Parameter(Accessible):
|
||||
|
||||
:param modobj: final call, called from Module.__init__
|
||||
"""
|
||||
self.fixExport()
|
||||
|
||||
if self.constant is not None:
|
||||
constant = self.datatype(self.constant)
|
||||
# The value of the `constant` property should be the
|
||||
@ -395,7 +390,7 @@ class Command(Accessible):
|
||||
else:
|
||||
# goodie: allow @Command instead of @Command()
|
||||
self.func = argument # this is the wrapped method!
|
||||
if argument.__doc__ is not None:
|
||||
if argument.__doc__:
|
||||
self.description = inspect.cleandoc(argument.__doc__)
|
||||
self.name = self.func.__name__ # this is probably not needed
|
||||
self._inherit = inherit # save for __set_name__
|
||||
@ -406,8 +401,18 @@ class Command(Accessible):
|
||||
if self.func is None:
|
||||
raise ProgrammingError(f'Command {owner.__name__}.{name} must be used as a method decorator')
|
||||
|
||||
self.fixExport()
|
||||
self.datatype = CommandType(self.argument, self.result)
|
||||
if self.export is True:
|
||||
predefined_cls = PREDEFINED_ACCESSIBLES.get(name, None)
|
||||
if predefined_cls is Command:
|
||||
self.export = name
|
||||
elif predefined_cls is None:
|
||||
self.export = '_' + name
|
||||
else:
|
||||
raise ProgrammingError(f'can not use {name!r} as name of a Command') from None
|
||||
if 'export' in self.ownProperties:
|
||||
# avoid export=True overrides export=<name>
|
||||
self.ownProperties['export'] = self.export
|
||||
if not self._inherit:
|
||||
for key, pobj in self.properties.items():
|
||||
if key not in self.propertyValues:
|
||||
@ -434,38 +439,38 @@ class Command(Accessible):
|
||||
f' members!: {params} != {members}')
|
||||
self.argument.optional = [p for p,v in sig.parameters.items()
|
||||
if v.default is not inspect.Parameter.empty]
|
||||
if 'description' not in self.ownProperties and func.__doc__ is not None:
|
||||
if 'description' not in self.propertyValues and func.__doc__:
|
||||
self.description = inspect.cleandoc(func.__doc__)
|
||||
self.ownProperties['description'] = self.description
|
||||
self.func = func
|
||||
return self
|
||||
|
||||
def clone(self, properties, **kwds):
|
||||
"""return a clone of ourselfs with inherited properties"""
|
||||
res = type(self)(**kwds)
|
||||
def copy(self):
|
||||
"""return a (deep) copy of ourselfs"""
|
||||
res = type(self)()
|
||||
res.name = self.name
|
||||
self.fixExport()
|
||||
res.func = self.func
|
||||
res.init(properties)
|
||||
res.init(res.ownProperties)
|
||||
res.init(self.propertyValues)
|
||||
if res.argument:
|
||||
res.argument = res.argument.copy()
|
||||
if res.result:
|
||||
res.result = res.result.copy()
|
||||
res.finish()
|
||||
self.finish()
|
||||
return res
|
||||
|
||||
def updateProperties(self, merged_properties):
|
||||
"""update merged_properties with our own properties"""
|
||||
merged_properties.update(self.ownProperties)
|
||||
|
||||
def create_from_value(self, properties, value):
|
||||
"""return a clone with given value and inherited properties
|
||||
def override(self, value):
|
||||
"""override method
|
||||
|
||||
this is needed when the @Command is missing on a method overriding a command"""
|
||||
if not callable(value):
|
||||
raise ProgrammingError(f'{self.name} = {value!r} is overriding a Command')
|
||||
return self.clone(properties)(value)
|
||||
self.func = value
|
||||
if value.__doc__:
|
||||
self.description = inspect.cleandoc(value.__doc__)
|
||||
|
||||
def merge(self, merged_properties):
|
||||
"""merge with inherited properties
|
||||
|
@ -84,7 +84,9 @@ class PersistentMixin(Module):
|
||||
flag = getattr(pobj, 'persistent', False)
|
||||
if flag:
|
||||
if flag == 'auto':
|
||||
self.addCallback(pname, self.saveParameters)
|
||||
def cb(value, m=self):
|
||||
m.saveParameters()
|
||||
self.valueCallbacks[pname].append(cb)
|
||||
self.initData[pname] = pobj.value
|
||||
if not pobj.given:
|
||||
if pname in loaded:
|
||||
@ -127,18 +129,16 @@ class PersistentMixin(Module):
|
||||
self.writeInitParams()
|
||||
return loaded
|
||||
|
||||
def saveParameters(self, _=None):
|
||||
def saveParameters(self):
|
||||
"""save persistent parameters
|
||||
|
||||
- to be called regularly explicitly by the module
|
||||
- the caller has to make sure that this is not called after
|
||||
a power down of the connected hardware before loadParameters
|
||||
|
||||
dummy argument to avoid closure for callback
|
||||
"""
|
||||
if self.writeDict:
|
||||
# do not save before all values are written to the hw, as potentially
|
||||
# factory default values were read in the meantime
|
||||
# factory default values were read in the mean time
|
||||
return
|
||||
self.__save_params()
|
||||
|
||||
|
@ -47,11 +47,9 @@ def make_update(modulename, pobj):
|
||||
if pobj.readerror:
|
||||
return (ERRORPREFIX + EVENTREPLY, f'{modulename}:{pobj.export}',
|
||||
# error-report !
|
||||
[pobj.readerror.name, str(pobj.readerror),
|
||||
{'t': pobj.timestamp} if pobj.timestamp else {}])
|
||||
[pobj.readerror.name, str(pobj.readerror), {'t': pobj.timestamp}])
|
||||
return (EVENTREPLY, f'{modulename}:{pobj.export}',
|
||||
[pobj.export_value(),
|
||||
{'t': pobj.timestamp} if pobj.timestamp else {}])
|
||||
[pobj.export_value(), {'t': pobj.timestamp}])
|
||||
|
||||
|
||||
class Dispatcher:
|
||||
|
@ -1,237 +0,0 @@
|
||||
# *****************************************************************************
|
||||
# This program is free software; you can redistribute it and/or modify it under
|
||||
# the terms of the GNU General Public License as published by the Free Software
|
||||
# Foundation; either version 2 of the License, or (at your option) any later
|
||||
# version.
|
||||
#
|
||||
# This program is distributed in the hope that it will be useful, but WITHOUT
|
||||
# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
|
||||
# FOR A PARTICULAR PURPOSE. See the GNU General Public License for more
|
||||
# details.
|
||||
#
|
||||
# You should have received a copy of the GNU General Public License along with
|
||||
# this program; if not, write to the Free Software Foundation, Inc.,
|
||||
# 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
||||
#
|
||||
# Module authors:
|
||||
# Enrico Faulhaber <enrico.faulhaber@frm2.tum.de>
|
||||
# Markus Zolliker <markus.zolliker@psi.ch>
|
||||
#
|
||||
# *****************************************************************************
|
||||
"""The common parts of the SECNodes outside interfaces"""
|
||||
|
||||
import sys
|
||||
import threading
|
||||
|
||||
from frappy.errors import SECoPError
|
||||
from frappy.lib import formatException, formatExtendedStack, \
|
||||
formatExtendedTraceback
|
||||
from frappy.protocol.messages import ERRORPREFIX, HELPREPLY, HELPREQUEST, \
|
||||
HelpMessage
|
||||
|
||||
|
||||
class DecodeError(Exception):
|
||||
def __init__(self, message, raw_msg):
|
||||
super().__init__(message)
|
||||
self._raw_msg = raw_msg
|
||||
|
||||
@property
|
||||
def raw_msg(self):
|
||||
return self._raw_msg
|
||||
|
||||
|
||||
class ConnectionClose(Exception):
|
||||
"""Indicates that receive quit due to an error."""
|
||||
|
||||
|
||||
class RequestHandler:
|
||||
"""Base class for the request handlers.
|
||||
|
||||
This is an extended copy of the BaseRequestHandler from socketserver.
|
||||
|
||||
To make a new interface, implement these methods:
|
||||
ingest, next_message, decode_message, receive, send_reply and format
|
||||
and extend (override) setup() and finish() if needed.
|
||||
|
||||
For an example, have a look at TCPRequestHandler.
|
||||
"""
|
||||
|
||||
# Methods from BaseRequestHandler
|
||||
def __init__(self, request, client_address, server):
|
||||
self.request = request
|
||||
self.client_address = client_address
|
||||
self.server = server
|
||||
self.log = None
|
||||
|
||||
try:
|
||||
self.setup()
|
||||
self.handle()
|
||||
except Exception:
|
||||
if self.log:
|
||||
self.log.error(formatException())
|
||||
else:
|
||||
server.log.error(formatException())
|
||||
finally:
|
||||
self.finish()
|
||||
|
||||
def setup(self):
|
||||
self.log = self.server.log
|
||||
self.log.info("new connection %s", self.format())
|
||||
# notify dispatcher of us
|
||||
self.server.dispatcher.add_connection(self)
|
||||
self.send_lock = threading.Lock()
|
||||
self.running = True
|
||||
# overwrite this with an appropriate buffer if needed
|
||||
self.data = None
|
||||
|
||||
def handle(self):
|
||||
"""handle a new connection"""
|
||||
# copy state info
|
||||
serverobj = self.server
|
||||
# copy relevant settings from Interface
|
||||
detailed_errors = serverobj.detailed_errors
|
||||
|
||||
# start serving
|
||||
while self.running:
|
||||
try:
|
||||
newdata = self.receive()
|
||||
if newdata is None:
|
||||
# no new data during read, continue
|
||||
continue
|
||||
self.ingest(newdata)
|
||||
except ConnectionClose:
|
||||
# either normal close or error in receive
|
||||
return
|
||||
# put data into (de-) framer,
|
||||
# de-frame data with next_message() and decode it
|
||||
# call dispatcher.handle_request(self, message)
|
||||
# dispatcher will queue the reply before returning
|
||||
while self.running:
|
||||
try:
|
||||
msg = self.next_message()
|
||||
if msg is None:
|
||||
break # no more messages to process
|
||||
except DecodeError as err:
|
||||
# we have to decode 'origin' here
|
||||
# use latin-1, as utf-8 or ascii may lead to encoding errors
|
||||
msg = err.raw_msg.decode('latin-1').split(' ', 3) + [
|
||||
None
|
||||
] # make sure len(msg) > 1
|
||||
result = (
|
||||
ERRORPREFIX + msg[0],
|
||||
msg[1],
|
||||
[
|
||||
'InternalError', str(err),
|
||||
{
|
||||
'exception': formatException(),
|
||||
'traceback': formatExtendedStack()
|
||||
}
|
||||
]
|
||||
)
|
||||
print('--------------------')
|
||||
print(formatException())
|
||||
print('--------------------')
|
||||
print(formatExtendedTraceback(sys.exc_info()))
|
||||
print('====================')
|
||||
else:
|
||||
try:
|
||||
if msg[0] == HELPREQUEST:
|
||||
self.handle_help()
|
||||
result = (HELPREPLY, None, None)
|
||||
else:
|
||||
result = serverobj.dispatcher.handle_request(self,
|
||||
msg)
|
||||
except SECoPError as err:
|
||||
result = (
|
||||
ERRORPREFIX + msg[0],
|
||||
msg[1],
|
||||
[
|
||||
err.name,
|
||||
str(err),
|
||||
{
|
||||
'exception': formatException(),
|
||||
'traceback': formatExtendedStack()
|
||||
}
|
||||
]
|
||||
)
|
||||
except Exception as err:
|
||||
# create Error Obj instead
|
||||
result = (
|
||||
ERRORPREFIX + msg[0],
|
||||
msg[1],
|
||||
[
|
||||
'InternalError',
|
||||
repr(err),
|
||||
{
|
||||
'exception': formatException(),
|
||||
'traceback': formatExtendedStack()
|
||||
}
|
||||
]
|
||||
)
|
||||
print('--------------------')
|
||||
print(formatException())
|
||||
print('--------------------')
|
||||
print(formatExtendedTraceback(sys.exc_info()))
|
||||
print('====================')
|
||||
|
||||
if not result:
|
||||
self.log.error('empty result upon msg %s', repr(msg))
|
||||
if result[0].startswith(ERRORPREFIX) and not detailed_errors:
|
||||
# strip extra information
|
||||
result[2][2].clear()
|
||||
self.send_reply(result)
|
||||
|
||||
def handle_help(self):
|
||||
for idx, line in enumerate(HelpMessage.splitlines()):
|
||||
# not sending HELPREPLY here, as there should be only one reply for
|
||||
# every request
|
||||
self.send_reply(('_', f'{idx + 1}', line))
|
||||
|
||||
def finish(self):
|
||||
"""called when handle() terminates, i.e. the socket closed"""
|
||||
self.log.info('closing connection %s', self.format())
|
||||
# notify dispatcher
|
||||
self.server.dispatcher.remove_connection(self)
|
||||
|
||||
# Methods for implementing in derived classes:
|
||||
def ingest(self, newdata):
|
||||
"""Put the new data into the buffer."""
|
||||
raise NotImplementedError
|
||||
|
||||
def next_message(self):
|
||||
"""Get the next decoded message from the buffer.
|
||||
|
||||
Has to return a triple of (MESSAGE, specifier, data) or None, in case
|
||||
there are no further messages in the receive queue.
|
||||
|
||||
If there is an Error during decoding, this method has to raise a
|
||||
DecodeError.
|
||||
"""
|
||||
raise NotImplementedError
|
||||
|
||||
def receive(self):
|
||||
"""Receive data from the link.
|
||||
|
||||
Should return the received data or None if there was nothing new. Has
|
||||
to raise a ConnectionClose on shutdown of the connection or on errors
|
||||
that are not recoverable.
|
||||
"""
|
||||
raise NotImplementedError
|
||||
|
||||
def send_reply(self, data):
|
||||
"""send reply
|
||||
|
||||
stops recv loop on error
|
||||
"""
|
||||
raise NotImplementedError
|
||||
|
||||
def format(self):
|
||||
"""
|
||||
Format available connection data into something recognizable for
|
||||
logging.
|
||||
|
||||
For example, the remote IP address or a connection identifier.
|
||||
"""
|
||||
raise NotImplementedError
|
||||
|
||||
# TODO: server baseclass?
|
@ -18,77 +18,122 @@
|
||||
# Markus Zolliker <markus.zolliker@psi.ch>
|
||||
#
|
||||
# *****************************************************************************
|
||||
"""TCP interface to the SECoP Server"""
|
||||
"""provides tcp interface to the SECoP Server"""
|
||||
|
||||
import errno
|
||||
import os
|
||||
import socket
|
||||
import socketserver
|
||||
import sys
|
||||
import threading
|
||||
import time
|
||||
|
||||
from frappy.datatypes import BoolType, StringType
|
||||
from frappy.lib import SECoP_DEFAULT_PORT
|
||||
from frappy.errors import SECoPError
|
||||
from frappy.lib import formatException, formatExtendedStack, \
|
||||
formatExtendedTraceback, SECoP_DEFAULT_PORT
|
||||
from frappy.properties import Property
|
||||
from frappy.protocol.interface import decode_msg, encode_msg_frame, get_msg
|
||||
from frappy.protocol.interface.handler import ConnectionClose, \
|
||||
RequestHandler, DecodeError
|
||||
from frappy.protocol.messages import HELPREQUEST
|
||||
|
||||
from frappy.protocol.messages import ERRORPREFIX, HELPREPLY, HELPREQUEST, \
|
||||
HelpMessage
|
||||
|
||||
MESSAGE_READ_SIZE = 1024
|
||||
HELP = HELPREQUEST.encode()
|
||||
|
||||
|
||||
def format_address(addr):
|
||||
if len(addr) == 2:
|
||||
return '%s:%d' % addr
|
||||
address, port = addr[0:2]
|
||||
if address.startswith('::ffff'):
|
||||
return '%s:%d' % (address[7:], port)
|
||||
return '[%s]:%d' % (address, port)
|
||||
class TCPRequestHandler(socketserver.BaseRequestHandler):
|
||||
|
||||
|
||||
class TCPRequestHandler(RequestHandler):
|
||||
def setup(self):
|
||||
super().setup()
|
||||
self.request.settimeout(1)
|
||||
self.data = b''
|
||||
self.log = self.server.log
|
||||
self.running = True
|
||||
self.send_lock = threading.Lock()
|
||||
|
||||
def finish(self):
|
||||
"""called when handle() terminates, i.e. the socket closed"""
|
||||
super().finish()
|
||||
# close socket
|
||||
try:
|
||||
self.request.shutdown(socket.SHUT_RDWR)
|
||||
except Exception:
|
||||
pass
|
||||
finally:
|
||||
self.request.close()
|
||||
def handle(self):
|
||||
"""handle a new tcp-connection"""
|
||||
# copy state info
|
||||
mysocket = self.request
|
||||
clientaddr = self.client_address
|
||||
serverobj = self.server
|
||||
|
||||
def ingest(self, newdata):
|
||||
self.data += newdata
|
||||
self.log.info("handling new connection from %s", format_address(clientaddr))
|
||||
data = b''
|
||||
|
||||
def next_message(self):
|
||||
try:
|
||||
message, self.data = get_msg(self.data)
|
||||
if message is None:
|
||||
return None
|
||||
if message.strip() == b'':
|
||||
return (HELPREQUEST, None, None)
|
||||
return decode_msg(message)
|
||||
except Exception as e:
|
||||
raise DecodeError('exception in receive', raw_msg=message) from e
|
||||
# notify dispatcher of us
|
||||
serverobj.dispatcher.add_connection(self)
|
||||
|
||||
def receive(self):
|
||||
try:
|
||||
data = self.request.recv(MESSAGE_READ_SIZE)
|
||||
# copy relevant settings from Interface
|
||||
detailed_errors = serverobj.detailed_errors
|
||||
|
||||
mysocket.settimeout(1)
|
||||
# start serving
|
||||
while self.running:
|
||||
try:
|
||||
newdata = mysocket.recv(MESSAGE_READ_SIZE)
|
||||
if not newdata:
|
||||
# no timeout error, but no new data -> connection closed
|
||||
return
|
||||
data = data + newdata
|
||||
except socket.timeout:
|
||||
continue
|
||||
except socket.error as e:
|
||||
self.log.exception(e)
|
||||
return
|
||||
if not data:
|
||||
raise ConnectionClose('socket was closed')
|
||||
return data
|
||||
except socket.timeout:
|
||||
return None
|
||||
except socket.error as e:
|
||||
self.log.exception(e)
|
||||
raise ConnectionClose() from e
|
||||
continue
|
||||
# put data into (de-) framer,
|
||||
# put frames into (de-) coder and if a message appear,
|
||||
# call dispatcher.handle_request(self, message)
|
||||
# dispatcher will queue the reply before returning
|
||||
while self.running:
|
||||
origin, data = get_msg(data)
|
||||
if origin is None:
|
||||
break # no more messages to process
|
||||
origin = origin.strip()
|
||||
if origin in (HELP, b''): # empty string -> send help message
|
||||
for idx, line in enumerate(HelpMessage.splitlines()):
|
||||
# not sending HELPREPLY here, as there should be only one reply for every request
|
||||
self.send_reply(('_', f'{idx + 1}', line))
|
||||
# ident matches request
|
||||
self.send_reply((HELPREPLY, None, None))
|
||||
continue
|
||||
try:
|
||||
msg = decode_msg(origin)
|
||||
except Exception as err:
|
||||
# we have to decode 'origin' here
|
||||
# use latin-1, as utf-8 or ascii may lead to encoding errors
|
||||
msg = origin.decode('latin-1').split(' ', 3) + [None] # make sure len(msg) > 1
|
||||
result = (ERRORPREFIX + msg[0], msg[1], ['InternalError', str(err),
|
||||
{'exception': formatException(),
|
||||
'traceback': formatExtendedStack()}])
|
||||
print('--------------------')
|
||||
print(formatException())
|
||||
print('--------------------')
|
||||
print(formatExtendedTraceback(sys.exc_info()))
|
||||
print('====================')
|
||||
else:
|
||||
try:
|
||||
result = serverobj.dispatcher.handle_request(self, msg)
|
||||
except SECoPError as err:
|
||||
result = (ERRORPREFIX + msg[0], msg[1], [err.name, str(err),
|
||||
{'exception': formatException(),
|
||||
'traceback': formatExtendedStack()}])
|
||||
except Exception as err:
|
||||
# create Error Obj instead
|
||||
result = (ERRORPREFIX + msg[0], msg[1], ['InternalError', repr(err),
|
||||
{'exception': formatException(),
|
||||
'traceback': formatExtendedStack()}])
|
||||
print('--------------------')
|
||||
print(formatException())
|
||||
print('--------------------')
|
||||
print(formatExtendedTraceback(sys.exc_info()))
|
||||
print('====================')
|
||||
|
||||
if not result:
|
||||
self.log.error('empty result upon msg %s', repr(msg))
|
||||
if result[0].startswith(ERRORPREFIX) and not detailed_errors:
|
||||
# strip extra information
|
||||
result[2][2].clear()
|
||||
self.send_reply(result)
|
||||
|
||||
def send_reply(self, data):
|
||||
"""send reply
|
||||
@ -111,9 +156,18 @@ class TCPRequestHandler(RequestHandler):
|
||||
self.log.error('ERROR in send_reply %r', e)
|
||||
self.running = False
|
||||
|
||||
def format(self):
|
||||
return f'from {format_address(self.client_address)}'
|
||||
|
||||
def finish(self):
|
||||
"""called when handle() terminates, i.e. the socket closed"""
|
||||
self.log.info('closing connection from %s', format_address(self.client_address))
|
||||
# notify dispatcher
|
||||
self.server.dispatcher.remove_connection(self)
|
||||
# close socket
|
||||
try:
|
||||
self.request.shutdown(socket.SHUT_RDWR)
|
||||
except Exception:
|
||||
pass
|
||||
finally:
|
||||
self.request.close()
|
||||
|
||||
class DualStackTCPServer(socketserver.ThreadingTCPServer):
|
||||
"""Subclassed to provide IPv6 capabilities as socketserver only uses IPv4"""
|
||||
@ -176,3 +230,12 @@ class TCPServer(DualStackTCPServer):
|
||||
if ntry:
|
||||
self.log.warning('tried again %d times after "Address already in use"', ntry)
|
||||
self.log.info("TCPServer initiated")
|
||||
|
||||
|
||||
def format_address(addr):
|
||||
if len(addr) == 2:
|
||||
return '%s:%d' % addr
|
||||
address, port = addr[0:2]
|
||||
if address.startswith('::ffff'):
|
||||
return '%s:%d' % (address[7:], port)
|
||||
return '[%s]:%d' % (address, port)
|
||||
|
@ -1,160 +0,0 @@
|
||||
# *****************************************************************************
|
||||
# This program is free software; you can redistribute it and/or modify it under
|
||||
# the terms of the GNU General Public License as published by the Free Software
|
||||
# Foundation; either version 2 of the License, or (at your option) any later
|
||||
# version.
|
||||
#
|
||||
# This program is distributed in the hope that it will be useful, but WITHOUT
|
||||
# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
|
||||
# FOR A PARTICULAR PURPOSE. See the GNU General Public License for more
|
||||
# details.
|
||||
#
|
||||
# You should have received a copy of the GNU General Public License along with
|
||||
# this program; if not, write to the Free Software Foundation, Inc.,
|
||||
# 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
||||
#
|
||||
# Module authors:
|
||||
# Alexander Zaft <a.zaft@fz-juelich.de>
|
||||
#
|
||||
# *****************************************************************************
|
||||
|
||||
import json
|
||||
from functools import partial
|
||||
|
||||
from websockets.exceptions import ConnectionClosedOK, ConnectionClosedError
|
||||
from websockets.sync.server import CloseCode, serve
|
||||
|
||||
from frappy.protocol.interface.handler import ConnectionClose, \
|
||||
RequestHandler, DecodeError
|
||||
from frappy.protocol.messages import HELPREQUEST
|
||||
|
||||
|
||||
def encode_msg_frame_str(action, specifier=None, data=None):
|
||||
""" encode a msg_triple into an msg_frame, ready to be sent
|
||||
|
||||
action (and optional specifier) are str strings,
|
||||
data may be an json-yfied python object"""
|
||||
msg = (action, specifier or '', '' if data is None else json.dumps(data))
|
||||
return ' '.join(msg).strip()
|
||||
|
||||
|
||||
class WSRequestHandler(RequestHandler):
|
||||
"""Handles a Websocket connection."""
|
||||
|
||||
def __init__(self, conn, server):
|
||||
self.conn = conn
|
||||
client_address = conn.remote_address
|
||||
request = conn.socket
|
||||
super().__init__(request, client_address, server)
|
||||
|
||||
def setup(self):
|
||||
super().setup()
|
||||
self.server.connections.add(self)
|
||||
|
||||
def finish(self):
|
||||
"""called when handle() terminates, i.e. the socket closed"""
|
||||
super().finish()
|
||||
self.server.connections.discard(self)
|
||||
# this will be called for a second time if the server is shutting down,
|
||||
# but in that case it will be a no-op
|
||||
self.conn.close()
|
||||
|
||||
def ingest(self, newdata):
|
||||
# recv on the websocket connection returns one message, we don't save
|
||||
# anything in data
|
||||
self.data = newdata
|
||||
|
||||
def next_message(self):
|
||||
"""split the string into a message triple."""
|
||||
if self.data is None:
|
||||
return None
|
||||
try:
|
||||
message = self.data.strip()
|
||||
if message == '':
|
||||
return HELPREQUEST, None, None
|
||||
res = message.split(' ', 2) + ['', '']
|
||||
action, specifier, data = res[0:3]
|
||||
self.data = None
|
||||
return (
|
||||
action,
|
||||
specifier or None,
|
||||
None if data == '' else json.loads(data)
|
||||
)
|
||||
except Exception as e:
|
||||
raise DecodeError('exception when reading in message',
|
||||
raw_msg=bytes(message, 'utf-8')) from e
|
||||
|
||||
def receive(self):
|
||||
"""receives one message from the websocket."""
|
||||
try:
|
||||
return self.conn.recv()
|
||||
except TimeoutError:
|
||||
return None
|
||||
except ConnectionClosedOK:
|
||||
raise ConnectionClose from None
|
||||
except ConnectionClosedError as e:
|
||||
self.log.error('No close frame received from %s', self.format())
|
||||
raise ConnectionClose from e
|
||||
except OSError as e:
|
||||
self.log.exception(e)
|
||||
raise ConnectionClose from e
|
||||
|
||||
def send_reply(self, data):
|
||||
"""send reply
|
||||
|
||||
stops recv loop on error (including timeout when output buffer full for
|
||||
more than 1 sec)
|
||||
"""
|
||||
if not data:
|
||||
self.log.error('should not reply empty data!')
|
||||
return
|
||||
outdata = encode_msg_frame_str(*data)
|
||||
with self.send_lock:
|
||||
if self.running:
|
||||
try:
|
||||
self.conn.send(outdata)
|
||||
except (BrokenPipeError, IOError) as e:
|
||||
self.log.debug('send_reply got an %r, connection closed?',
|
||||
e)
|
||||
self.running = False
|
||||
except Exception as e:
|
||||
self.log.error('ERROR in send_reply %r', e)
|
||||
self.running = False
|
||||
|
||||
def format(self):
|
||||
return f'{self.conn.id} from {self.client_address}'
|
||||
|
||||
class WSServer:
|
||||
"""Server for providing a websocket interface.
|
||||
|
||||
Implementation note:
|
||||
The websockets library doesn't provide an option to subclass its server, so
|
||||
we take the returned value as an attribute and provide the neccessary
|
||||
function calls.
|
||||
"""
|
||||
def __init__(self, name, logger, options, srv):
|
||||
self.connections = set() # keep track for shutting down
|
||||
self.dispatcher = srv.dispatcher
|
||||
self.name = name
|
||||
self.log = logger
|
||||
self.port = int(options.pop('uri').split('://', 1)[-1])
|
||||
self.detailed_errors = options.pop('detailed_errors', False)
|
||||
|
||||
handle = partial(WSRequestHandler, server=self)
|
||||
# websockets only gives the serve method without an option to subclass
|
||||
self.ws_server = serve(handle, '', self.port, logger=logger)
|
||||
self.log.info("Websocket server %s binding to port %d", name, self.port)
|
||||
|
||||
def serve_forever(self):
|
||||
self.ws_server.serve_forever()
|
||||
|
||||
def shutdown(self):
|
||||
for c in list(self.connections):
|
||||
c.conn.close(code=CloseCode.GOING_AWAY, reason='shutting down')
|
||||
self.ws_server.shutdown()
|
||||
|
||||
def __enter__(self):
|
||||
return self
|
||||
|
||||
def __exit__(self, *args):
|
||||
return self.shutdown()
|
@ -71,7 +71,7 @@ class ProxyModule(HasIO, Module):
|
||||
pname, pobj = params.popitem()
|
||||
props = remoteparams.get(pname, None)
|
||||
if props is None:
|
||||
if pobj.export and pname != 'status':
|
||||
if pobj.export:
|
||||
self.log.warning('remote parameter %s:%s does not exist', self.module, pname)
|
||||
continue
|
||||
dt = props['datatype']
|
||||
@ -108,19 +108,17 @@ class ProxyModule(HasIO, Module):
|
||||
# for now, the error message must be enough
|
||||
|
||||
def nodeStateChange(self, online, state):
|
||||
disconnected = Readable.Status.ERROR, 'disconnected'
|
||||
if online:
|
||||
if not self._consistency_check_done:
|
||||
self._check_descriptive_data()
|
||||
self._consistency_check_done = True
|
||||
if self.status == disconnected:
|
||||
self.status = Readable.Status.IDLE, 'connected'
|
||||
else:
|
||||
newstatus = Readable.Status.ERROR, 'disconnected'
|
||||
readerror = CommunicationFailedError('disconnected')
|
||||
if self.status != disconnected:
|
||||
if self.status != newstatus:
|
||||
for pname in set(self.parameters) - set(('module', 'status')):
|
||||
self.announceUpdate(pname, None, readerror)
|
||||
self.status = disconnected
|
||||
self.announceUpdate('status', newstatus)
|
||||
|
||||
def checkProperties(self):
|
||||
pass # skip
|
||||
@ -195,7 +193,7 @@ def proxy_class(remote_class, name=None):
|
||||
attrs[aname] = pobj
|
||||
|
||||
def rfunc(self, pname=aname):
|
||||
value, _, readerror = self._secnode.getParameter(self.module, pname, True)
|
||||
value, _, readerror = self._secnode.getParameter(self.name, pname, True)
|
||||
if readerror:
|
||||
raise readerror
|
||||
return value
|
||||
@ -205,7 +203,7 @@ def proxy_class(remote_class, name=None):
|
||||
if not pobj.readonly:
|
||||
|
||||
def wfunc(self, value, pname=aname):
|
||||
value, _, readerror = self._secnode.setParameter(self.module, pname, value)
|
||||
value, _, readerror = self._secnode.setParameter(self.name, pname, value)
|
||||
if readerror:
|
||||
raise readerror
|
||||
return value
|
||||
@ -216,7 +214,7 @@ def proxy_class(remote_class, name=None):
|
||||
cobj = aobj.copy()
|
||||
|
||||
def cfunc(self, arg=None, cname=aname):
|
||||
return self._secnode.execCommand(self.module, cname, arg)[0]
|
||||
return self._secnode.execCommand(self.name, cname, arg)[0]
|
||||
|
||||
attrs[aname] = cobj(cfunc)
|
||||
|
||||
|
@ -53,7 +53,6 @@ except ImportError:
|
||||
class Server:
|
||||
INTERFACES = {
|
||||
'tcp': 'protocol.interface.tcp.TCPServer',
|
||||
'ws': 'protocol.interface.ws.WSServer',
|
||||
}
|
||||
_restart = True
|
||||
|
||||
|
@ -239,7 +239,6 @@ class HasStates:
|
||||
|
||||
@Command
|
||||
def stop(self):
|
||||
"""stop state machine"""
|
||||
self.stop_machine()
|
||||
|
||||
def final_status(self, code=IDLE, text=''):
|
||||
|
164
frappy/structparam.py
Normal file
164
frappy/structparam.py
Normal file
@ -0,0 +1,164 @@
|
||||
# *****************************************************************************
|
||||
#
|
||||
# This program is free software; you can redistribute it and/or modify it under
|
||||
# the terms of the GNU General Public License as published by the Free Software
|
||||
# Foundation; either version 2 of the License, or (at your option) any later
|
||||
# version.
|
||||
#
|
||||
# This program is distributed in the hope that it will be useful, but WITHOUT
|
||||
# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
|
||||
# FOR A PARTICULAR PURPOSE. See the GNU General Public License for more
|
||||
# details.
|
||||
#
|
||||
# You should have received a copy of the GNU General Public License along with
|
||||
# this program; if not, write to the Free Software Foundation, Inc.,
|
||||
# 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
||||
#
|
||||
# Module authors:
|
||||
# Markus Zolliker <markus.zolliker@psi.ch>
|
||||
#
|
||||
# *****************************************************************************
|
||||
"""convenience class to create a struct Parameter together with indivdual params
|
||||
|
||||
Usage:
|
||||
|
||||
class Controller(Drivable):
|
||||
|
||||
...
|
||||
|
||||
ctrlpars = StructParam('ctrlpars struct', [
|
||||
('pid_p', 'p', Parameter('control parameter p', FloatRange())),
|
||||
('pid_i', 'i', Parameter('control parameter i', FloatRange())),
|
||||
('pid_d', 'd', Parameter('control parameter d', FloatRange())),
|
||||
], readonly=False)
|
||||
|
||||
...
|
||||
|
||||
then implement either read_ctrlpars and write_ctrlpars or
|
||||
read_pid_p, read_pid_i, read_pid_d, write_pid_p, write_pid_i and write_pid_d
|
||||
|
||||
the methods not implemented will be created automatically
|
||||
"""
|
||||
|
||||
from frappy.core import Parameter, Property
|
||||
from frappy.datatypes import BoolType, DataType, StructOf, ValueType
|
||||
from frappy.errors import ProgrammingError
|
||||
|
||||
|
||||
class StructParam(Parameter):
|
||||
"""create a struct parameter together with individual parameters
|
||||
|
||||
in addition to normal Parameter arguments:
|
||||
|
||||
:param paramdict: dict <member name> of Parameter(...)
|
||||
:param prefix_or_map: either a prefix for the parameter name to add to the member name
|
||||
or a dict <member name> or <paramerter name>
|
||||
"""
|
||||
# use properties, as simple attributes are not considered on copy()
|
||||
paramdict = Property('dict <parametername> of Parameter(...)', ValueType())
|
||||
hasStructRW = Property('has a read_<struct param> or write_<struct param> method',
|
||||
BoolType(), default=False)
|
||||
|
||||
insideRW = 0 # counter for avoiding multiple superfluous updates
|
||||
|
||||
def __init__(self, description=None, paramdict=None, prefix_or_map='', *, datatype=None, readonly=False, **kwds):
|
||||
if isinstance(paramdict, DataType):
|
||||
raise ProgrammingError('second argument must be a dict of Param')
|
||||
if datatype is None and paramdict is not None: # omit the following on Parameter.copy()
|
||||
if isinstance(prefix_or_map, str):
|
||||
prefix_or_map = {m: prefix_or_map + m for m in paramdict}
|
||||
for membername, param in paramdict.items():
|
||||
param.name = prefix_or_map[membername]
|
||||
datatype = StructOf(**{m: p.datatype for m, p in paramdict.items()})
|
||||
kwds['influences'] = [p.name for p in paramdict.values()]
|
||||
self.updateEnable = {}
|
||||
super().__init__(description, datatype, paramdict=paramdict, readonly=readonly, **kwds)
|
||||
|
||||
def __set_name__(self, owner, name):
|
||||
# names of access methods of structed param (e.g. ctrlpars)
|
||||
struct_read_name = f'read_{name}' # e.g. 'read_ctrlpars'
|
||||
struct_write_name = f'write_{name}' # e.h. 'write_ctrlpars'
|
||||
self.hasStructRW = hasattr(owner, struct_read_name) or hasattr(owner, struct_write_name)
|
||||
|
||||
for membername, param in self.paramdict.items():
|
||||
pname = param.name
|
||||
changes = {
|
||||
'readonly': self.readonly,
|
||||
'influences': set(param.influences) | {name},
|
||||
}
|
||||
param.ownProperties.update(changes)
|
||||
param.init(changes)
|
||||
setattr(owner, pname, param)
|
||||
param.__set_name__(owner, param.name)
|
||||
|
||||
if self.hasStructRW:
|
||||
rname = f'read_{pname}'
|
||||
|
||||
if not hasattr(owner, rname):
|
||||
def rfunc(self, membername=membername, struct_read_name=struct_read_name):
|
||||
return getattr(self, struct_read_name)()[membername]
|
||||
|
||||
rfunc.poll = False # read_<struct param> is polled only
|
||||
setattr(owner, rname, rfunc)
|
||||
|
||||
if not self.readonly:
|
||||
wname = f'write_{pname}'
|
||||
if not hasattr(owner, wname):
|
||||
def wfunc(self, value, membername=membername,
|
||||
name=name, rname=rname, struct_write_name=struct_write_name):
|
||||
valuedict = dict(getattr(self, name))
|
||||
valuedict[membername] = value
|
||||
getattr(self, struct_write_name)(valuedict)
|
||||
return getattr(self, rname)()
|
||||
|
||||
setattr(owner, wname, wfunc)
|
||||
|
||||
if not self.hasStructRW:
|
||||
if not hasattr(owner, struct_read_name):
|
||||
def struct_read_func(self, name=name, flist=tuple(
|
||||
(m, f'read_{p.name}') for m, p in self.paramdict.items())):
|
||||
pobj = self.parameters[name]
|
||||
# disable updates generated from the callbacks of individual params
|
||||
pobj.insideRW += 1 # guarded by self.accessLock
|
||||
try:
|
||||
return {m: getattr(self, f)() for m, f in flist}
|
||||
finally:
|
||||
pobj.insideRW -= 1
|
||||
|
||||
setattr(owner, struct_read_name, struct_read_func)
|
||||
|
||||
if not (self.readonly or hasattr(owner, struct_write_name)):
|
||||
|
||||
def struct_write_func(self, value, name=name, funclist=tuple(
|
||||
(m, f'write_{p.name}') for m, p in self.paramdict.items())):
|
||||
pobj = self.parameters[name]
|
||||
pobj.insideRW += 1 # guarded by self.accessLock
|
||||
try:
|
||||
return {m: getattr(self, f)(value[m]) for m, f in funclist}
|
||||
finally:
|
||||
pobj.insideRW -= 1
|
||||
|
||||
setattr(owner, struct_write_name, struct_write_func)
|
||||
|
||||
super().__set_name__(owner, name)
|
||||
|
||||
def finish(self, modobj=None):
|
||||
"""register callbacks for consistency"""
|
||||
super().finish(modobj)
|
||||
if modobj:
|
||||
|
||||
if self.hasStructRW:
|
||||
def cb(value, modobj=modobj, structparam=self):
|
||||
for membername, param in structparam.paramdict.items():
|
||||
setattr(modobj, param.name, value[membername])
|
||||
|
||||
modobj.valueCallbacks[self.name].append(cb)
|
||||
else:
|
||||
for membername, param in self.paramdict.items():
|
||||
def cb(value, modobj=modobj, structparam=self, membername=membername):
|
||||
if not structparam.insideRW:
|
||||
prev = dict(getattr(modobj, structparam.name))
|
||||
prev[membername] = value
|
||||
setattr(modobj, structparam.name, prev)
|
||||
|
||||
modobj.valueCallbacks[param.name].append(cb)
|
@ -120,7 +120,6 @@ class MagneticField(Drivable):
|
||||
)
|
||||
heatswitch = Attached(Switch, description='name of heat switch device')
|
||||
|
||||
# pylint: disable=invalid-name
|
||||
Status = Enum(Drivable.Status, PERSIST=PERSIST, PREPARE=301, RAMPING=302, FINISH=303)
|
||||
|
||||
status = Parameter(datatype=TupleOf(EnumType(Status), StringType()))
|
||||
@ -194,7 +193,6 @@ class MagneticField(Drivable):
|
||||
self.log.error(self, 'main thread exited unexpectedly!')
|
||||
|
||||
def stop(self):
|
||||
"""stop at current value"""
|
||||
self.write_target(self.read_value())
|
||||
|
||||
|
||||
|
@ -30,19 +30,18 @@ MLZ TANGO interface for the respective device classes.
|
||||
# pylint: disable=too-many-lines, consider-using-f-string
|
||||
|
||||
import re
|
||||
import sys
|
||||
import threading
|
||||
from time import sleep, time as currenttime
|
||||
|
||||
import PyTango
|
||||
|
||||
from frappy.datatypes import ArrayOf, EnumType, FloatRange, IntRange, \
|
||||
LimitsType, StatusType, StringType, TupleOf, ValueType
|
||||
LimitsType, StringType, TupleOf, ValueType
|
||||
from frappy.errors import CommunicationFailedError, ConfigError, \
|
||||
HardwareError, ProgrammingError, WrongTypeError, RangeError
|
||||
HardwareError, ProgrammingError, WrongTypeError
|
||||
from frappy.lib import lazy_property
|
||||
from frappy.modules import Command, Drivable, Module, Parameter, Property, \
|
||||
Readable, Writable
|
||||
from frappy.modules import Command, Drivable, Module, Parameter, Readable, \
|
||||
StatusType, Writable, Property
|
||||
|
||||
#####
|
||||
|
||||
@ -441,7 +440,6 @@ class AnalogOutput(PyTangoDevice, Drivable):
|
||||
)
|
||||
abslimits = Parameter('Absolute limits of device value',
|
||||
datatype=LimitsType(FloatRange(unit='$')),
|
||||
export=False,
|
||||
)
|
||||
precision = Parameter('Precision of the device value (allowed deviation '
|
||||
'of stable values from target)',
|
||||
@ -468,52 +466,30 @@ class AnalogOutput(PyTangoDevice, Drivable):
|
||||
# replacement of '$' by main unit must be done later
|
||||
self.__main_unit = mainunit
|
||||
|
||||
def _init_limits(self):
|
||||
def _init_abslimits(self):
|
||||
"""Get abslimits from tango if not configured. Otherwise, check if both
|
||||
ranges are compatible."""
|
||||
|
||||
def intersect_limits(first, second, first_kind, second_kind):
|
||||
lower = max(first[0], second[0])
|
||||
upper = min(first[1], second[1])
|
||||
if lower >= upper:
|
||||
raise WrongTypeError(f"{first_kind} limits '{first}' are not "
|
||||
f"compatible with {second_kind} limits "
|
||||
f"'{second}'!")
|
||||
return lower, upper
|
||||
|
||||
tangoabslim = (-sys.float_info.max, sys.float_info.max)
|
||||
try:
|
||||
read_tangoabslim = (float(self._getProperty('absmin')),
|
||||
float(self._getProperty('absmax')))
|
||||
# Entangle convention for "unrestricted"
|
||||
if read_tangoabslim != (0, 0):
|
||||
tangoabslim = read_tangoabslim
|
||||
tangoabslim = (
|
||||
float(self._getProperty('absmin')),
|
||||
float(self._getProperty('absmax'))
|
||||
)
|
||||
if self.parameters['abslimits'].readerror:
|
||||
# no abslimits configured in frappy. read from entangle
|
||||
self.parameters['abslimits'].readerror = None
|
||||
self.abslimits = tangoabslim
|
||||
except Exception as e:
|
||||
self.log.error('could not read Tango abslimits: %s' % e)
|
||||
self.log.error(e)
|
||||
# check if compatible
|
||||
try:
|
||||
dt = FloatRange(*tangoabslim)
|
||||
dt.validate(self.parameters['abslimits'].datatype.min)
|
||||
dt.validate(self.parameters['abslimits'].datatype.max)
|
||||
except WrongTypeError as e:
|
||||
raise WrongTypeError(f'Absolute limits configured in frappy \''
|
||||
f'{self.abslimits}\' extend beyond the limits '
|
||||
f'defined in entangle \'{tangoabslim}\'!') from e
|
||||
|
||||
if self.parameters['abslimits'].readerror:
|
||||
# no abslimits configured in frappy
|
||||
self.parameters['abslimits'].readerror = None
|
||||
self.abslimits = tangoabslim
|
||||
|
||||
# check both abslimits against each other
|
||||
self.abslimits = intersect_limits(self.abslimits, tangoabslim,
|
||||
'frappy absolute',
|
||||
'entangle absolute')
|
||||
|
||||
# set abslimits as hard target limits
|
||||
self.parameters['target'].datatype.set_properties(
|
||||
min=self.abslimits[0], max=self.abslimits[1])
|
||||
|
||||
# restrict current user limits by abslimits
|
||||
self.userlimits = intersect_limits(self.userlimits, self.abslimits,
|
||||
'user', 'absolute')
|
||||
|
||||
# restrict settable user limits by abslimits
|
||||
self.parameters['userlimits'].datatype.members[0].set_properties(
|
||||
min=self.abslimits[0], max=self.abslimits[1])
|
||||
self.parameters['userlimits'].datatype.members[1].set_properties(
|
||||
min=self.abslimits[0], max=self.abslimits[1])
|
||||
|
||||
def initModule(self):
|
||||
super().initModule()
|
||||
@ -533,8 +509,9 @@ class AnalogOutput(PyTangoDevice, Drivable):
|
||||
self.__main_unit = attrInfo.unit
|
||||
except Exception as e:
|
||||
self.log.error(e)
|
||||
super().applyMainUnit(self.__main_unit)
|
||||
self._init_limits()
|
||||
if self.__main_unit:
|
||||
super().applyMainUnit(self.__main_unit)
|
||||
self._init_abslimits()
|
||||
|
||||
def doPoll(self):
|
||||
super().doPoll()
|
||||
@ -620,20 +597,22 @@ class AnalogOutput(PyTangoDevice, Drivable):
|
||||
|
||||
del __getusermin, __setusermin, __getusermax, __setusermax
|
||||
|
||||
def write_userlimits(self, value):
|
||||
umin, umax = value
|
||||
def _checkLimits(self, limits):
|
||||
umin, umax = limits
|
||||
amin, amax = self.abslimits
|
||||
if umin > umax:
|
||||
raise ValueError(
|
||||
self, f'user minimum ({umin}) above the user maximum ({umax})')
|
||||
if umin < amin - abs(amin * 1e-12):
|
||||
umin = amin
|
||||
if umax > amax + abs(amax * 1e-12):
|
||||
umax = amax
|
||||
return umin, umax
|
||||
return (umin, umax)
|
||||
|
||||
def write_userlimits(self, value):
|
||||
return self._checkLimits(value)
|
||||
|
||||
def write_target(self, value=FloatRange()):
|
||||
umin, umax = self.userlimits
|
||||
if not umin <= value <= umax:
|
||||
raise RangeError(
|
||||
f'target value {value} must be between {umin} and {umax}')
|
||||
if self.status[0] == self.Status.BUSY:
|
||||
# changing target value during movement is not allowed by the
|
||||
# Tango base class state machine. If we are moving, stop first.
|
||||
@ -662,7 +641,6 @@ class AnalogOutput(PyTangoDevice, Drivable):
|
||||
sleep(0.3)
|
||||
|
||||
def stop(self):
|
||||
"""cease driving, go to IDLE state"""
|
||||
self._dev.Stop()
|
||||
|
||||
|
||||
|
@ -194,19 +194,19 @@ class Nmr(Readable):
|
||||
x = val['xval'][:len(val['yval'])]
|
||||
return (x, val['yval'])
|
||||
|
||||
@Command(IntRange(1), result=TupleOf(ArrayOf(string, maxlen=100),
|
||||
@Command(result=TupleOf(ArrayOf(string, maxlen=100),
|
||||
ArrayOf(floating, maxlen=100)))
|
||||
def get_amplitude(self, count):
|
||||
"""Last <count> amplitude datapoints."""
|
||||
rv = self.cell.cell.nmr_paramlog_get('amplitude', count)
|
||||
def get_amplitude(self):
|
||||
"""Last 20 amplitude datapoints."""
|
||||
rv = self.cell.cell.nmr_paramlog_get('amplitude', 20)
|
||||
x = [ str(timestamp) for timestamp in rv['xval']]
|
||||
return (x,rv['yval'])
|
||||
|
||||
@Command(IntRange(1), result=TupleOf(ArrayOf(string, maxlen=100),
|
||||
@Command(result=TupleOf(ArrayOf(string, maxlen=100),
|
||||
ArrayOf(floating, maxlen=100)))
|
||||
def get_phase(self, count):
|
||||
"""Last <count> phase datapoints."""
|
||||
val = self.cell.cell.nmr_paramlog_get('phase', count)
|
||||
def get_phase(self):
|
||||
"""Last 20 phase datapoints."""
|
||||
val = self.cell.cell.nmr_paramlog_get('phase', 20)
|
||||
return ([str(timestamp) for timestamp in val['xval']], val['yval'])
|
||||
|
||||
|
||||
|
229
frappy_psi/HP.py
Normal file
229
frappy_psi/HP.py
Normal file
@ -0,0 +1,229 @@
|
||||
#!/usr/bin/env python
|
||||
# -*- coding: utf-8 -*-
|
||||
# *****************************************************************************
|
||||
# This program is free software; you can redistribute it and/or modify it under
|
||||
# the terms of the GNU General Public License as published by the Free Software
|
||||
# Foundation; either version 2 of the License, or (at your option) any later
|
||||
# version.
|
||||
#
|
||||
# This program is distributed in the hope that it will be useful, but WITHOUT
|
||||
# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
|
||||
# FOR A PARTICULAR PURPOSE. See the GNU General Public License for more
|
||||
# details.
|
||||
#
|
||||
# You should have received a copy of the GNU General Public License along with
|
||||
# this program; if not, write to the Free Software Foundation, Inc.,
|
||||
# 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
||||
#
|
||||
# Module authors: Oksana Shliakhtun <oksana.shliakhtun@psi.ch>
|
||||
# *****************************************************************************
|
||||
"""Hewlett-Packard HP34401A Multimeter (not finished)"""
|
||||
|
||||
import re
|
||||
from frappy.core import HasIO, Readable, Parameter, FloatRange, EnumType, StatusType, IDLE, ERROR, WARN
|
||||
|
||||
|
||||
def string_to_value(value):
|
||||
"""
|
||||
Converting the value to float, removing the units, converting the prefix into the number.
|
||||
:param value: value
|
||||
:return: float value without units
|
||||
"""
|
||||
value_with_unit = re.compile(r'(\d+)([pnumkMG]?)')
|
||||
value, pfx = value_with_unit.match(value).groups()
|
||||
pfx_dict = {'p': 1e-12, 'n': 1e-9, 'u': 1e-6, 'm': 1e-3, 'k': 1e3, 'M': 1e6, 'G': 1e9}
|
||||
if pfx in pfx_dict:
|
||||
value = round(float(value) * pfx_dict[pfx], 12)
|
||||
return float(value)
|
||||
|
||||
|
||||
class HP_IO(HasIO):
|
||||
end_of_line = b'\n'
|
||||
identification = [('*IDN?', r'HEWLETT-PACKARD,34401A,0,.*')]
|
||||
|
||||
|
||||
class HP34401A(HP_IO):
|
||||
status = Parameter(datatype=StatusType(Readable, 'BUSY'))
|
||||
autorange = Parameter('autorange_on', EnumType('autorange', off=0, on=1), readonly=False, default=0)
|
||||
|
||||
def comm(self, cmd): # read until \n
|
||||
string = f'{cmd}\n'
|
||||
n_string = string.encode()
|
||||
response = self.communicate(n_string)
|
||||
|
||||
if response:
|
||||
return response
|
||||
|
||||
response = self.communicate(n_string)
|
||||
return response if response else None
|
||||
|
||||
def read_range(self, function):
|
||||
return self.comm(f'{function}:range?')
|
||||
|
||||
def write_range(self, function, range):
|
||||
return self.comm(f'{function}:range {range}')
|
||||
|
||||
def write_autorange(self, function):
|
||||
cmd = f'{function}:range:auto {"on" if self.autorange == 0 else "off"}'
|
||||
self.comm(cmd)
|
||||
return self.comm(f'{function}:range:auto?')
|
||||
|
||||
def read_resolution(self, function):
|
||||
return self.comm(f'{function}:resolution?')
|
||||
|
||||
def write_resolution(self, function, resolution):
|
||||
self.comm(f'{function}:resolution {resolution}')
|
||||
return self.comm(f'{function}:resolution?')
|
||||
|
||||
def read_status(self):
|
||||
stb = int(self.comm('*STB?'))
|
||||
esr = int(self.comm('*ESR?'))
|
||||
|
||||
if esr & (1 << 3):
|
||||
return ERROR, 'self-test/calibration/reading failed'
|
||||
if esr & (1 << 4):
|
||||
return ERROR, 'execution error'
|
||||
if esr & (1 << 5):
|
||||
return ERROR, 'syntax error'
|
||||
if esr & (1 << 2):
|
||||
return ERROR, 'query error'
|
||||
if stb & (1 << 3):
|
||||
return WARN, 'questionable data'
|
||||
if stb & (1 << 5):
|
||||
return WARN, 'standard event register is not empty'
|
||||
if stb & (1 << 6):
|
||||
return WARN, 'requested service'
|
||||
|
||||
if any(stb & (1 << i) for i in range(3) or stb & (1 << 7)):
|
||||
return IDLE, ''
|
||||
if esr & (1 << 6):
|
||||
return IDLE, ''
|
||||
if esr & (1 << 7):
|
||||
return IDLE, ''
|
||||
if stb & (1 << 4):
|
||||
return IDLE, 'message available'
|
||||
if esr & (1 << 0):
|
||||
return IDLE, 'operation complete'
|
||||
if esr & (1 << 1):
|
||||
return IDLE, 'not used'
|
||||
|
||||
|
||||
class Voltage(HP34401A, Readable):
|
||||
value = Parameter('voltage', datatype=FloatRange(0.1, 1000), unit='V')
|
||||
range = Parameter('voltage sensitivity value', FloatRange(), unit='V', default=1, readonly=False)
|
||||
resolution = Parameter('resolution')
|
||||
mode = Parameter('measurement mode: ac/dc', readonly=False)
|
||||
|
||||
ioClass = HP_IO
|
||||
|
||||
MODE_NAMES = {0: 'dc', 1: 'ac'}
|
||||
VOLT_RANGE = ['100mV', '1V', '10V', '100V', '1000V']
|
||||
v_range = Parameter('voltage range', EnumType('voltage index range',
|
||||
{name: idx for idx, name in enumerate(VOLT_RANGE)}), readonly=False)
|
||||
|
||||
acdc = None
|
||||
|
||||
def write_mode(self, mode):
|
||||
"""
|
||||
Set the mode - AC or DC
|
||||
:param mode: AC/DC
|
||||
:return:
|
||||
"""
|
||||
if mode == 1:
|
||||
self.comm(f'configure:voltage:AC {self.range}, {self.resolution}')
|
||||
else:
|
||||
self.comm(f'configure:voltage:DC {self.range}, {self.resolution}')
|
||||
self.acdc = self.MODE_NAMES[mode]
|
||||
return self.comm(f'function?')
|
||||
|
||||
def read_value(self):
|
||||
"""
|
||||
Makes a AC/DC voltage measurement.
|
||||
:return: AC/DC value
|
||||
"""
|
||||
return self.comm(f'measure:voltage:{self.acdc}?')
|
||||
|
||||
def write_autorange_acdc(self, function):
|
||||
full_function = f'{function}:{self.acdc}'
|
||||
return self.write_autorange(full_function)
|
||||
|
||||
def read_range_voltage(self):
|
||||
return self.read_range(f'voltage:{self.acdc}')
|
||||
|
||||
def write_range_voltage(self, range):
|
||||
return self.write_range(f'voltage:{self.acdc}', range)
|
||||
|
||||
def write_autorange_voltage(self):
|
||||
return self.write_autorange_acdc('voltage')
|
||||
|
||||
def read_resolution_voltage(self):
|
||||
return self.read_resolution(f'voltage:{self.acdc}')
|
||||
|
||||
def write_resolution_voltage(self, resolution):
|
||||
return self.write_resolution(f'voltage:{self.acdc}', resolution)
|
||||
|
||||
|
||||
class Current(HP34401A, Readable, Voltage):
|
||||
value = Parameter('current', FloatRange, unit='A')
|
||||
range = Parameter('current range', FloatRange)
|
||||
CURR_RANGE_AC = ['10mA', '100mA', '1A', '3A']
|
||||
CURR_RANGE_DC = ['1A', '3A']
|
||||
|
||||
def read_range_current(self):
|
||||
return self.read_range(f'current:{self.acdc}')
|
||||
|
||||
def write_autorange_current(self):
|
||||
return self.write_autorange_acdc('current')
|
||||
|
||||
def write_range_current(self, range):
|
||||
return self.write_range(f'current:{self.acdc}', range)
|
||||
|
||||
def read_resolution_current(self):
|
||||
return self.read_resolution(f'current:{self.acdc}')
|
||||
|
||||
def write_resolution_current(self, resolution):
|
||||
return self.write_resolution(f'current:{self.acdc}', resolution)
|
||||
|
||||
|
||||
class Resistance(HP34401A, Readable):
|
||||
value = Parameter('resistance')
|
||||
mode = Parameter('measurement mode: 2-/4-wire ohms', EnumType(two_wire=2, four_wire=4), readonly=False)
|
||||
resolution = Parameter('resistance measurement resolution')
|
||||
range = Parameter('resistance measurement range')
|
||||
RESIST_RANGE = ['100Om', '1kOm', '10kOm', '100kOm', '1MOm', '10MOm', '100MOm']
|
||||
FUNCTION_MAP = {2: 'resistance', 4: 'fresistance'}
|
||||
|
||||
def write_range_resistance(self, range):
|
||||
return self.write_range(f'{self.FUNCTION_MAP[self.mode]}', range)
|
||||
|
||||
def read_range_resistance(self):
|
||||
return self.read_range(f'{self.FUNCTION_MAP[self.mode]}')
|
||||
|
||||
def write_mode(self, mode):
|
||||
if mode == 2:
|
||||
self.comm(f'configure:resistance {self.range},{self.resolution}')
|
||||
elif mode == 4:
|
||||
self.comm(f'configure:fresistance {self.range}, {self.resolution}')
|
||||
return self.comm('configure?')
|
||||
|
||||
def write_autorange_resistance(self):
|
||||
return self.write_autorange(self.FUNCTION_MAP[self.mode])
|
||||
|
||||
def read_resolution_resistance(self):
|
||||
return self.read_resolution(f'{self.FUNCTION_MAP[self.mode]}')
|
||||
|
||||
def write_resolution_resistance(self, resolution):
|
||||
return self.write_resolution(f'{self.FUNCTION_MAP[self.mode]}', resolution)
|
||||
|
||||
|
||||
class Frequency(HP34401A, Readable):
|
||||
value = Parameter('frequency', FloatRange(3, 300e3), unit='Hz')
|
||||
|
||||
def write_autorange_frequency(self):
|
||||
return self.write_autorange('frequency')
|
||||
|
||||
def read_resolution_frequency(self):
|
||||
return self.read_resolution('frequency')
|
||||
|
||||
def write_resolution_frequency(self, resolution):
|
||||
return self.write_resolution('frequency', resolution)
|
@ -15,6 +15,7 @@
|
||||
#
|
||||
# Module authors: Oksana Shliakhtun <oksana.shliakhtun@psi.ch>
|
||||
# *****************************************************************************
|
||||
"""Stanford Research Systems SR830 DS Lock-in Amplifier"""
|
||||
|
||||
import re
|
||||
import time
|
||||
@ -25,6 +26,11 @@ from frappy.errors import IsBusyError
|
||||
|
||||
|
||||
def string_to_value(value):
|
||||
"""
|
||||
Converting the value to float, removing the units, converting the prefix into the number.
|
||||
:param value: value
|
||||
:return: float value without units
|
||||
"""
|
||||
value_with_unit = re.compile(r'(\d+)([pnumkMG]?)')
|
||||
value, pfx = value_with_unit.match(value).groups()
|
||||
pfx_dict = {'p': 1e-12, 'n': 1e-9, 'u': 1e-6, 'm': 1e-3, 'k': 1e3, 'M': 1e6, 'G': 1e9}
|
||||
@ -40,6 +46,13 @@ class SR830_IO(StringIO):
|
||||
|
||||
class StanfRes(HasIO, Readable):
|
||||
def set_par(self, cmd, *args):
|
||||
"""
|
||||
Set parameter.
|
||||
Query commands are the same as setting commands, but they have a question mark.
|
||||
:param cmd: command
|
||||
:param args: value(s)
|
||||
:return: reply
|
||||
"""
|
||||
head = ','.join([cmd] + [a if isinstance(a, str) else f'{a:g}' for a in args])
|
||||
tail = cmd.replace(' ', '? ')
|
||||
new_tail = re.sub(r'[0-9.]+', '', tail)
|
||||
@ -149,6 +162,10 @@ class XY(StanfRes):
|
||||
return IDLE, ''
|
||||
|
||||
def read_value(self):
|
||||
"""
|
||||
Read XY. The manual autorange implemented.
|
||||
:return:
|
||||
"""
|
||||
if self.read_status()[0] == BUSY:
|
||||
raise IsBusyError('changing gain')
|
||||
reply = self.get_par('SNAP? 1, 2')
|
||||
@ -166,11 +183,13 @@ class XY(StanfRes):
|
||||
return int(self.get_par('SENS?'))
|
||||
|
||||
def read_range(self):
|
||||
"""Sensitivity range value"""
|
||||
idx = self.read_irange()
|
||||
name = self.SEN_RANGE[idx]
|
||||
return string_to_value(name)
|
||||
|
||||
def write_irange(self, irange):
|
||||
"""Index of sensitivity from the range"""
|
||||
value = int(irange)
|
||||
self.set_par(f'SENS {value}')
|
||||
self._autogain_started = time.time()
|
||||
@ -178,6 +197,12 @@ class XY(StanfRes):
|
||||
return value
|
||||
|
||||
def write_range(self, target):
|
||||
"""
|
||||
Setting the sensitivity range.
|
||||
cl_idx/cl_value is the closest index/value from the range to the target
|
||||
:param target:
|
||||
:return: closest value of the sensitivity range
|
||||
"""
|
||||
target = float(target)
|
||||
cl_idx = None
|
||||
cl_value = float('inf')
|
||||
@ -194,6 +219,7 @@ class XY(StanfRes):
|
||||
return cl_value
|
||||
|
||||
def read_itc(self):
|
||||
"""Time constant index from the range"""
|
||||
return int(self.get_par(f'OFLT?'))
|
||||
|
||||
def write_itc(self, itc):
|
||||
@ -201,11 +227,18 @@ class XY(StanfRes):
|
||||
return self.set_par(f'OFLT {value}')
|
||||
|
||||
def read_tc(self):
|
||||
"""Read time constant value from the range"""
|
||||
idx = self.read_itc()
|
||||
name = self.TIME_CONST[idx]
|
||||
return string_to_value(name)
|
||||
|
||||
def write_tc(self, target):
|
||||
"""
|
||||
Setting the time constant from the range.
|
||||
cl_idx/cl_value is the closest index/value from the range to the target
|
||||
:param target: time constant
|
||||
:return: closest time constant value
|
||||
"""
|
||||
target = float(target)
|
||||
cl_idx = None
|
||||
cl_value = float('inf')
|
||||
|
@ -17,690 +17,248 @@
|
||||
# Markus Zolliker <markus.zolliker@psi.ch>
|
||||
# *****************************************************************************
|
||||
|
||||
import sys
|
||||
import time
|
||||
import threading
|
||||
from frappy.core import Drivable, Parameter, Command, Property, Module, HasIO, \
|
||||
ERROR, WARN, BUSY, IDLE, nopoll, Limit
|
||||
from frappy.core import Drivable, Parameter, Command, Property, ERROR, WARN, BUSY, IDLE, Done, nopoll
|
||||
from frappy.features import HasTargetLimits, HasSimpleOffset
|
||||
from frappy.datatypes import IntRange, FloatRange, StringType, BoolType
|
||||
from frappy.errors import BadValueError, HardwareError, ConfigError
|
||||
from frappy.errors import ConfigError, BadValueError
|
||||
sys.path.append('/home/l_samenv/Documents/anc350/Linux64/userlib/lib')
|
||||
from PyANC350v4 import Positioner
|
||||
|
||||
|
||||
class IO(Module):
|
||||
"""'communication' module for attocube controller
|
||||
DIRECTION_NAME = {1: 'forward', -1: 'backward'}
|
||||
|
||||
why an extra class:
|
||||
- HasIO assures that a single common communicator is used
|
||||
- access must be thread safe
|
||||
|
||||
class FreezeStatus:
|
||||
"""freeze status for some time
|
||||
|
||||
hardware quite often does not treat status correctly: on a target change it
|
||||
may take some time to return the 'busy' status correctly.
|
||||
|
||||
in classes with this mixin, within :meth:`write_target` call
|
||||
|
||||
self.freeze_status(0.5, BUSY, 'changed target')
|
||||
|
||||
a wrapper around read_status will take care that the status will be the given value,
|
||||
for at least the given delay. This does NOT cover the case when self.status is set
|
||||
directly from an other method.
|
||||
"""
|
||||
uri = Property('dummy uri, only one controller may exists',
|
||||
StringType())
|
||||
export = False
|
||||
_hw = None
|
||||
_lock = None
|
||||
used_axes = set()
|
||||
__freeze_status_until = 0
|
||||
|
||||
def initModule(self):
|
||||
if self._hw is None:
|
||||
IO._lock = threading.Lock()
|
||||
IO._hw = Positioner()
|
||||
super().initModule()
|
||||
def __init_subclass__(cls):
|
||||
def wrapped(self, inner=cls.read_status):
|
||||
if time.time() < self.__freeze_status_until:
|
||||
return Done
|
||||
return inner(self)
|
||||
|
||||
def shutdownModule(self):
|
||||
if IO._hw:
|
||||
IO._hw.disconnect()
|
||||
IO._hw = None
|
||||
cls.read_status = wrapped
|
||||
super().__init_subclass__()
|
||||
|
||||
def configureAQuadBIn(self, axisNo, enable, resolution):
|
||||
"""Enables and configures the A-Quad-B (quadrature) input for the target position.
|
||||
Parameters
|
||||
axisNo Axis number (0 ... 2)
|
||||
enable Enable (1) or disable (0) A-Quad-B input
|
||||
resolution A-Quad-B step width in m. Internal resolution is 1 nm.
|
||||
Returns
|
||||
None
|
||||
"""
|
||||
with self._lock:
|
||||
return self._hw.configureAQuadBIn(axisNo, enable, resolution)
|
||||
|
||||
def configureAQuadBOut(self, axisNo, enable, resolution, clock):
|
||||
"""Enables and configures the A-Quad-B output of the current position.
|
||||
|
||||
Parameters
|
||||
axisNo Axis number (0 ... 2)
|
||||
enable Enable (1) or disable (0) A-Quad-B output
|
||||
resolution A-Quad-B step width in m; internal resolution is 1 nm
|
||||
clock Clock of the A-Quad-B output [s]. Allowed range is 40ns ... 1.3ms; internal resulution is 20ns.
|
||||
Returns
|
||||
None
|
||||
"""
|
||||
with self._lock:
|
||||
return self._hw.configureAQuadBOut(axisNo, enable, resolution, clock)
|
||||
|
||||
def configureExtTrigger(self, axisNo, mode):
|
||||
"""Enables the input trigger for steps.
|
||||
|
||||
Parameters
|
||||
axisNo Axis number (0 ... 2)
|
||||
mode Disable (0), Quadratur (1), Trigger(2) for external triggering
|
||||
Returns
|
||||
None
|
||||
"""
|
||||
with self._lock:
|
||||
return self._hw.configureExtTrigger(axisNo, mode)
|
||||
|
||||
def configureNslTriggerAxis(self, axisNo):
|
||||
"""Selects Axis for NSL Trigger.
|
||||
|
||||
Parameters
|
||||
axisNo Axis number (0 ... 2)
|
||||
Returns
|
||||
None
|
||||
"""
|
||||
with self._lock:
|
||||
return self._hw.configureNslTriggerAxis(axisNo)
|
||||
|
||||
def configureRngTrigger(self, axisNo, lower, upper):
|
||||
"""Configure lower position for range Trigger.
|
||||
|
||||
Parameters
|
||||
axisNo Axis number (0 ... 2)
|
||||
lower Lower position for range trigger (nm)
|
||||
upper Upper position for range trigger (nm)
|
||||
Returns
|
||||
None
|
||||
"""
|
||||
with self._lock:
|
||||
return self._hw.configureRngTrigger(axisNo, lower, upper)
|
||||
|
||||
def configureRngTriggerEps(self, axisNo, epsilon):
|
||||
"""Configure hysteresis for range Trigger.
|
||||
|
||||
Parameters
|
||||
axisNo Axis number (0 ... 2)
|
||||
epsilon hysteresis in nm / mdeg
|
||||
Returns
|
||||
None
|
||||
"""
|
||||
with self._lock:
|
||||
return self._hw.configureRngTriggerEps(axisNo, epsilon)
|
||||
|
||||
def configureRngTriggerPol(self, axisNo, polarity):
|
||||
"""Configure lower position for range Trigger.
|
||||
|
||||
Parameters
|
||||
axisNo Axis number (0 ... 2)
|
||||
polarity Polarity of trigger signal when position is between lower and upper Low(0) and High(1)
|
||||
Returns
|
||||
None
|
||||
"""
|
||||
with self._lock:
|
||||
return self._hw.configureRngTriggerPol(axisNo, polarity)
|
||||
|
||||
def getActuatorName(self, axisNo):
|
||||
"""Get the name of the currently selected actuator
|
||||
|
||||
Parameters
|
||||
axisNo Axis number (0 ... 2)
|
||||
Returns
|
||||
name Name of the actuator
|
||||
"""
|
||||
with self._lock:
|
||||
return self._hw.getActuatorName(axisNo)
|
||||
|
||||
def getActuatorType(self, axisNo):
|
||||
"""Get the type of the currently selected actuator
|
||||
|
||||
Parameters
|
||||
axisNo Axis number (0 ... 2)
|
||||
Returns
|
||||
type_ Type of the actuator {0: linear, 1: goniometer, 2: rotator}
|
||||
"""
|
||||
with self._lock:
|
||||
return self._hw.getActuatorType(axisNo)
|
||||
|
||||
def getAmplitude(self, axisNo):
|
||||
"""Reads back the amplitude parameter of an axis.
|
||||
|
||||
Parameters
|
||||
axisNo Axis number (0 ... 2)
|
||||
Returns
|
||||
amplitude Amplitude V
|
||||
"""
|
||||
with self._lock:
|
||||
return self._hw.getAmplitude(axisNo)
|
||||
|
||||
def getAxisStatus(self, axisNo):
|
||||
"""Reads status information about an axis of the device.
|
||||
|
||||
Parameters
|
||||
axisNo Axis number (0 ... 2)
|
||||
Returns
|
||||
connected Output: If the axis is connected to a sensor.
|
||||
enabled Output: If the axis voltage output is enabled.
|
||||
moving Output: If the axis is moving.
|
||||
target Output: If the target is reached in automatic positioning
|
||||
eotFwd Output: If end of travel detected in forward direction.
|
||||
eotBwd Output: If end of travel detected in backward direction.
|
||||
error Output: If the axis' sensor is in error state.
|
||||
"""
|
||||
with self._lock:
|
||||
return self._hw.getAxisStatus(axisNo)
|
||||
|
||||
def getFrequency(self, axisNo):
|
||||
"""Reads back the frequency parameter of an axis.
|
||||
|
||||
Parameters
|
||||
axisNo Axis number (0 ... 2)
|
||||
Returns
|
||||
frequency Output: Frequency in Hz
|
||||
"""
|
||||
with self._lock:
|
||||
return self._hw.getFrequency(axisNo)
|
||||
|
||||
def getPosition(self, axisNo):
|
||||
"""Retrieves the current actuator position. For linear type actuators the position unit is m; for goniometers and rotators it is degree.
|
||||
|
||||
Parameters
|
||||
axisNo Axis number (0 ... 2)
|
||||
Returns
|
||||
position Output: Current position [m] or [°]
|
||||
"""
|
||||
with self._lock:
|
||||
return self._hw.getPosition(axisNo)
|
||||
|
||||
def measureCapacitance(self, axisNo):
|
||||
"""Performs a measurement of the capacitance of the piezo motor and returns the result. If no motor is connected, the result will be 0. The function doesn't return before the measurement is complete; this will take a few seconds of time.
|
||||
|
||||
Parameters
|
||||
axisNo Axis number (0 ... 2)
|
||||
Returns
|
||||
cap Output: Capacitance [F]
|
||||
"""
|
||||
with self._lock:
|
||||
return self._hw.measureCapacitance(axisNo)
|
||||
|
||||
def selectActuator(self, axisNo, actuator):
|
||||
"""Selects the actuator to be used for the axis from actuator presets.
|
||||
|
||||
Parameters
|
||||
axisNo Axis number (0 ... 2)
|
||||
actuator Actuator selection (0 ... 255)
|
||||
0: ANPg101res
|
||||
1: ANGt101res
|
||||
2: ANPx51res
|
||||
3: ANPx101res
|
||||
4: ANPx121res
|
||||
5: ANPx122res
|
||||
6: ANPz51res
|
||||
7: ANPz101res
|
||||
8: ANR50res
|
||||
9: ANR51res
|
||||
10: ANR101res
|
||||
11: Test
|
||||
Returns
|
||||
None
|
||||
"""
|
||||
with self._lock:
|
||||
return self._hw.selectActuator(axisNo, actuator)
|
||||
|
||||
def setAmplitude(self, axisNo, amplitude):
|
||||
"""Sets the amplitude parameter for an axis
|
||||
|
||||
Parameters
|
||||
axisNo Axis number (0 ... 2)
|
||||
amplitude Amplitude in V, internal resolution is 1 mV
|
||||
Returns
|
||||
None
|
||||
"""
|
||||
with self._lock:
|
||||
return self._hw.setAmplitude(axisNo, amplitude)
|
||||
|
||||
def setAxisOutput(self, axisNo, enable, autoDisable):
|
||||
"""Enables or disables the voltage output of an axis.
|
||||
|
||||
Parameters
|
||||
axisNo Axis number (0 ... 2)
|
||||
enable Enables (1) or disables (0) the voltage output.
|
||||
autoDisable If the voltage output is to be deactivated automatically when end of travel is detected.
|
||||
Returns
|
||||
None
|
||||
"""
|
||||
with self._lock:
|
||||
return self._hw.setAxisOutput(axisNo, enable, autoDisable)
|
||||
|
||||
def setDcVoltage(self, axisNo, voltage):
|
||||
"""Sets the DC level on the voltage output when no sawtooth based motion is active.
|
||||
|
||||
Parameters
|
||||
axisNo Axis number (0 ... 2)
|
||||
voltage DC output voltage [V], internal resolution is 1 mV
|
||||
Returns
|
||||
None
|
||||
"""
|
||||
with self._lock:
|
||||
return self._hw.setDcVoltage(axisNo, voltage)
|
||||
|
||||
def setFrequency(self, axisNo, frequency):
|
||||
"""Sets the frequency parameter for an axis
|
||||
|
||||
Parameters
|
||||
axisNo Axis number (0 ... 2)
|
||||
frequency Frequency in Hz, internal resolution is 1 Hz
|
||||
Returns
|
||||
None
|
||||
"""
|
||||
with self._lock:
|
||||
return self._hw.setFrequency(axisNo, frequency)
|
||||
|
||||
def setTargetPosition(self, axisNo, target):
|
||||
"""Sets the target position for automatic motion, see ANC_startAutoMove. For linear type actuators the position unit is m, for goniometers and rotators it is degree.
|
||||
|
||||
Parameters
|
||||
axisNo Axis number (0 ... 2)
|
||||
target Target position [m] or [°]. Internal resulution is 1 nm or 1 µ°.
|
||||
Returns
|
||||
None
|
||||
"""
|
||||
with self._lock:
|
||||
return self._hw.setTargetPosition(axisNo, target)
|
||||
|
||||
def setTargetRange(self, axisNo, targetRg):
|
||||
"""Defines the range around the target position where the target is considered to be reached.
|
||||
|
||||
Parameters
|
||||
axisNo Axis number (0 ... 2)
|
||||
targetRg Target range [m] or [°]. Internal resulution is 1 nm or 1 µ°.
|
||||
Returns
|
||||
None
|
||||
"""
|
||||
with self._lock:
|
||||
return self._hw.setTargetRange(axisNo, targetRg)
|
||||
|
||||
def startAutoMove(self, axisNo, enable, relative):
|
||||
"""Switches automatic moving (i.e. following the target position) on or off
|
||||
|
||||
Parameters
|
||||
axisNo Axis number (0 ... 2)
|
||||
enable Enables (1) or disables (0) automatic motion
|
||||
relative If the target position is to be interpreted absolute (0) or relative to the current position (1)
|
||||
Returns
|
||||
None
|
||||
"""
|
||||
with self._lock:
|
||||
return self._hw.startAutoMove(axisNo, enable, relative)
|
||||
|
||||
def startContinuousMove(self, axisNo, start, backward):
|
||||
"""Starts or stops continous motion in forward direction. Other kinds of motions are stopped.
|
||||
|
||||
Parameters
|
||||
axisNo Axis number (0 ... 2)
|
||||
start Starts (1) or stops (0) the motion
|
||||
backward If the move direction is forward (0) or backward (1)
|
||||
Returns
|
||||
None
|
||||
"""
|
||||
with self._lock:
|
||||
return self._hw.startContinuousMove(axisNo, start, backward)
|
||||
|
||||
def startSingleStep(self, axisNo, backward):
|
||||
"""Triggers a single step in desired direction.
|
||||
|
||||
Parameters
|
||||
axisNo Axis number (0 ... 2)
|
||||
backward If the step direction is forward (0) or backward (1)
|
||||
Returns
|
||||
None
|
||||
"""
|
||||
with self._lock:
|
||||
return self._hw.startSingleStep(axisNo, backward)
|
||||
def freeze_status(self, delay, code=BUSY, text='changed target'):
|
||||
"""freezze status to the given value for the given delay"""
|
||||
self.__freeze_status_until = time.time() + delay
|
||||
self.status = code, text
|
||||
|
||||
|
||||
class Stopped(RuntimeError):
|
||||
"""thread was stopped"""
|
||||
|
||||
|
||||
class Axis(HasIO, Drivable):
|
||||
class Axis(HasTargetLimits, FreezeStatus, Drivable):
|
||||
axis = Property('axis number', IntRange(0, 2), 0)
|
||||
value = Parameter('axis position', FloatRange(unit='deg'))
|
||||
frequency = Parameter('frequency', FloatRange(1, unit='Hz'), readonly=False)
|
||||
amplitude = Parameter('amplitude', FloatRange(0, unit='V'), readonly=False)
|
||||
gear = Parameter('gear factor', FloatRange(), readonly=False, value=1)
|
||||
tolerance = Parameter('positioning tolerance', FloatRange(0, unit='$'),
|
||||
readonly=False, default=0.01)
|
||||
sensor_connected = Parameter('a sensor is connected', BoolType())
|
||||
gear = Parameter('gear factor', FloatRange(), readonly=False, default=1, initwrite=True)
|
||||
tolerance = Parameter('positioning tolerance', FloatRange(0, unit='$'), readonly=False, default=0.01)
|
||||
output = Parameter('enable output', BoolType(), readonly=False)
|
||||
info = Parameter('axis info', StringType())
|
||||
statusbits = Parameter('status bits', StringType())
|
||||
step_mode = Parameter('step mode (soft closed loop)', BoolType(),
|
||||
default=False, readonly=False, group='step_mode')
|
||||
timeout = Parameter('timeout after no progress detected', FloatRange(0),
|
||||
default=1, readonly=False, group='step_mode')
|
||||
steps_fwd = Parameter('forward steps / main unit', FloatRange(0), unit='$/s',
|
||||
default=0, readonly=False, group='step_mode')
|
||||
steps_bwd = Parameter('backward steps / main unit', FloatRange(0, unit='$/s'),
|
||||
default=0, readonly=False, group='step_mode')
|
||||
delay = Parameter('delay between tries within loop', FloatRange(0, unit='s'),
|
||||
readonly=False, default=0.05, group='step_mode')
|
||||
maxstep = Parameter('max. step duration', FloatRange(0, unit='s'),
|
||||
default=0.25, readonly=False, group='step_mode')
|
||||
prop = Parameter('factor for control loop', FloatRange(0, 1),
|
||||
readonly=False, default=0.8, group='step_mode')
|
||||
uri = 'ANC'
|
||||
ioClass = IO
|
||||
target_min = Limit()
|
||||
target_max = Limit()
|
||||
|
||||
fast_interval = 0.25
|
||||
|
||||
_hw = None
|
||||
_hw = Positioner()
|
||||
_scale = 1 # scale for custom units
|
||||
_move_steps = 0 # number of steps to move (used by move command)
|
||||
SCALES = {'deg': 1, 'm': 1, 'mm': 1000, 'um': 1000000, 'µm': 1000000}
|
||||
_thread = None
|
||||
_moving_since = 0
|
||||
_status = IDLE, ''
|
||||
_calib_range = None
|
||||
_try_cnt = 0
|
||||
_at_target = False
|
||||
_direction = 1 # move direction
|
||||
_idle_status = IDLE, ''
|
||||
_error_state = '' # empty string: no error
|
||||
_history = None
|
||||
_check_sensor = False
|
||||
_try_count = 0
|
||||
|
||||
def initModule(self):
|
||||
super().initModule()
|
||||
self._stopped = threading.Event()
|
||||
if self.axis in IO.used_axes:
|
||||
raise ConfigError(f'a module with axisNo={self.axis} already exists')
|
||||
IO.used_axes.add(self.axis)
|
||||
|
||||
def initialReads(self):
|
||||
self.read_info()
|
||||
super().initialReads()
|
||||
|
||||
def shutdownModule(self):
|
||||
IO.used_axes.discard(self.axis)
|
||||
|
||||
def read_value(self):
|
||||
if self._thread:
|
||||
return self.value
|
||||
def __init__(self, name, logger, opts, srv):
|
||||
unit = opts.pop('unit', 'deg')
|
||||
opts['value.unit'] = unit
|
||||
try:
|
||||
return self._read_pos()
|
||||
except Stopped:
|
||||
return self.value
|
||||
self._scale = self.SCALES[unit] * opts.get('gear', 1)
|
||||
except KeyError as e:
|
||||
raise ConfigError('unsupported unit: %s' % unit)
|
||||
super().__init__(name, logger, opts, srv)
|
||||
|
||||
def write_gear(self, value):
|
||||
self._scale = self.SCALES[self.parameters['value'].datatype.unit] * self.gear
|
||||
return value
|
||||
|
||||
def startModule(self, start_events):
|
||||
super().startModule(start_events)
|
||||
start_events.queue(self.read_info)
|
||||
|
||||
def check_value(self, value):
|
||||
"""check if value allows moving in current direction"""
|
||||
if self._direction > 0:
|
||||
if value > self.target_limits[1]:
|
||||
raise BadValueError('above upper limit')
|
||||
elif value < self.target_limits[0]:
|
||||
raise BadValueError('below lower limit')
|
||||
|
||||
def read_value(self):
|
||||
pos = self._hw.getPosition(self.axis) * self._scale
|
||||
if self.isBusy():
|
||||
try:
|
||||
self.check_value(pos)
|
||||
except BadValueError as e:
|
||||
self._stop()
|
||||
self._idle_status = ERROR, str(e)
|
||||
return pos
|
||||
|
||||
def read_frequency(self):
|
||||
return self.io.getFrequency(self.axis)
|
||||
return self._hw.getFrequency(self.axis)
|
||||
|
||||
def write_frequency(self, value):
|
||||
self.io.setFrequency(self.axis, value)
|
||||
return self.io.getFrequency(self.axis)
|
||||
self._hw.setFrequency(self.axis, value)
|
||||
return self._hw.getFrequency(self.axis)
|
||||
|
||||
def read_amplitude(self):
|
||||
return self.io.getAmplitude(self.axis)
|
||||
return self._hw.getAmplitude(self.axis)
|
||||
|
||||
def write_amplitude(self, value):
|
||||
self.io.setAmplitude(self.axis, value)
|
||||
return self.io.getAmplitude(self.axis)
|
||||
self._hw.setAmplitude(self.axis, value)
|
||||
return self._hw.getAmplitude(self.axis)
|
||||
|
||||
def read_statusbits(self):
|
||||
self._get_status()
|
||||
return self.statusbits
|
||||
def write_tolerance(self, value):
|
||||
self._hw.setTargetRange(self.axis, value / self._scale)
|
||||
return value
|
||||
|
||||
def _get_status(self):
|
||||
"""get axis status
|
||||
|
||||
- update self.sensor_connected and self.statusbits
|
||||
- return <moving flag>, <error flag>, <reason>
|
||||
|
||||
<moving flag> is True whn moving
|
||||
<in_error> is True when in error
|
||||
<reason> is an error text, when in error, 'at target' or '' otherwise
|
||||
"""
|
||||
statusbits = self.io.getAxisStatus(self.axis)
|
||||
self.sensor_connected, self._output, moving, at_target, fwd_stuck, bwd_stuck, error = statusbits
|
||||
self.statusbits = ''.join(k for k, v in zip('OTFBE', (self._output,) + statusbits[3:]) if v)
|
||||
if error:
|
||||
return ERROR, 'other error'
|
||||
if bwd_stuck:
|
||||
return ERROR, 'end of travel backward'
|
||||
if fwd_stuck:
|
||||
return ERROR, 'end of travel forward'
|
||||
target_reached = at_target > self._at_target
|
||||
self._at_target = at_target
|
||||
if self._moving_since:
|
||||
if target_reached:
|
||||
return IDLE, 'at target'
|
||||
if time.time() < self._moving_since + 0.25:
|
||||
return BUSY, 'started'
|
||||
if at_target:
|
||||
return IDLE, 'at target'
|
||||
if moving and self._output:
|
||||
return BUSY, 'moving'
|
||||
return WARN, 'stopped by unknown reason'
|
||||
if self._moving_since is False:
|
||||
return IDLE, 'stopped'
|
||||
if not self.step_mode and at_target:
|
||||
return IDLE, 'at target'
|
||||
return IDLE, ''
|
||||
def write_output(self, value):
|
||||
self._hw.setAxisOutput(self.axis, enable=value, autoDisable=0)
|
||||
return value
|
||||
|
||||
def read_status(self):
|
||||
status = self._get_status()
|
||||
if self.step_mode:
|
||||
return self._status
|
||||
if self._moving_since:
|
||||
if status[0] != BUSY:
|
||||
self._moving_since = 0
|
||||
self.setFastPoll(False)
|
||||
return status
|
||||
|
||||
def _wait(self, delay):
|
||||
if self._stopped.wait(delay):
|
||||
raise Stopped()
|
||||
|
||||
def _read_pos(self):
|
||||
if not self.sensor_connected:
|
||||
return 0
|
||||
poslist = []
|
||||
for i in range(9):
|
||||
if i:
|
||||
self._wait(0.001)
|
||||
poslist.append(self.io.getPosition(self.axis) * self._scale)
|
||||
self._poslist = sorted(poslist)
|
||||
return self._poslist[len(poslist) // 2] # median
|
||||
|
||||
def _run_drive(self, target):
|
||||
self.value = self._read_pos()
|
||||
self.status = self._status = BUSY, 'drive by steps'
|
||||
deadline = time.time() + self.timeout
|
||||
max_steps = self.maxstep * self.frequency
|
||||
while True:
|
||||
for _ in range(2):
|
||||
dif = target - self.value
|
||||
steps_per_unit = self.steps_bwd if dif < 0 else self.steps_fwd
|
||||
tol = max(self.tolerance, 0.6 / steps_per_unit) # avoid a tolerance less than 60% of a step
|
||||
if abs(dif) > tol * 3:
|
||||
break
|
||||
# extra wait time when already close
|
||||
self._wait(2 * self.delay)
|
||||
self.read_value()
|
||||
status = None
|
||||
if abs(dif) < tol:
|
||||
status = IDLE, 'in tolerance'
|
||||
elif self._poslist[2] <= target <= self._poslist[-3]: # target within noise
|
||||
status = IDLE, 'within noise'
|
||||
elif dif > 0:
|
||||
steps = min(max_steps, min(dif, (dif + tol) * self.prop) * steps_per_unit)
|
||||
else:
|
||||
steps = max(-max_steps, max(dif, (dif - tol) * self.prop) * steps_per_unit)
|
||||
if status or steps == 0:
|
||||
self._status = status
|
||||
break
|
||||
if round(steps) == 0: # this should not happen
|
||||
self._status = WARN, 'steps=0'
|
||||
break
|
||||
self._move_steps(steps)
|
||||
if self._step_size > self.prop * 0.25 / steps_per_unit:
|
||||
# some progress happened
|
||||
deadline = time.time() + self.timeout
|
||||
elif time.time() > deadline:
|
||||
self._status = WARN, 'timeout - no progress'
|
||||
break
|
||||
self.read_status()
|
||||
|
||||
def _thread_wrapper(self, func, *args):
|
||||
try:
|
||||
func(*args)
|
||||
except Stopped as e:
|
||||
self._status = IDLE, str(e)
|
||||
except Exception as e:
|
||||
self._status = ERROR, f'{type(e).__name__} - {e}'
|
||||
finally:
|
||||
self.io.setAxisOutput(self.axis, enable=0, autoDisable=0)
|
||||
self.setFastPoll(False)
|
||||
self._stopped.clear()
|
||||
self._thread = None
|
||||
|
||||
def _stop_thread(self):
|
||||
if self._thread:
|
||||
self._stopped.set()
|
||||
self._thread.join()
|
||||
|
||||
def _start_thread(self, *args):
|
||||
self._stop_thread()
|
||||
thread = threading.Thread(target=self._thread_wrapper, args=args)
|
||||
self._thread = thread
|
||||
thread.start()
|
||||
|
||||
def write_target(self, target):
|
||||
if not self.sensor_connected:
|
||||
raise HardwareError('no sensor connected')
|
||||
self._stop_thread()
|
||||
self.io.setTargetRange(self.axis, self.tolerance / self._scale)
|
||||
if self.step_mode:
|
||||
self.status = BUSY, 'changed target'
|
||||
self._start_thread(self._run_drive, target)
|
||||
statusbits = self._hw.getAxisStatus(self.axis)
|
||||
sensor, self.output, moving, attarget, eot_fwd, eot_bwd, sensor_error = statusbits
|
||||
self.statusbits = ''.join((k for k, v in zip('SOMTFBE', statusbits) if v))
|
||||
if self._move_steps:
|
||||
if not (eot_fwd or eot_bwd):
|
||||
return BUSY, 'moving by steps'
|
||||
if not sensor:
|
||||
self._error_state = 'no sensor connected'
|
||||
elif sensor_error:
|
||||
self._error_state = 'sensor error'
|
||||
elif eot_fwd:
|
||||
self._error_state = 'end of travel forward'
|
||||
elif eot_bwd:
|
||||
self._error_state = 'end of travel backward'
|
||||
else:
|
||||
self._try_cnt = 0
|
||||
self.setFastPoll(True, self.fast_interval)
|
||||
self.io.setTargetPosition(self.axis, target / self._scale)
|
||||
self.io.setAxisOutput(self.axis, enable=1, autoDisable=0)
|
||||
self.io.startAutoMove(self.axis, enable=1, relative=0)
|
||||
self._moving_since = time.time()
|
||||
self.status = self._get_status()
|
||||
return target
|
||||
if self._error_state and not DIRECTION_NAME[self._direction] in self._error_state:
|
||||
self._error_state = ''
|
||||
status_text = 'moving' if self._try_count == 0 else 'moving (retry %d)' % self._try_count
|
||||
if moving and self._history is not None: # history None: moving by steps
|
||||
self._history.append(self.value)
|
||||
if len(self._history) < 5:
|
||||
return BUSY, status_text
|
||||
beg = self._history.pop(0)
|
||||
if abs(beg - self.target) < self.tolerance:
|
||||
# reset normal tolerance
|
||||
self._stop()
|
||||
self._idle_status = IDLE, 'in tolerance'
|
||||
return self._idle_status
|
||||
# self._hw.setTargetRange(self.axis, self.tolerance / self._scale)
|
||||
if (self.value - beg) * self._direction > 0:
|
||||
return BUSY, status_text
|
||||
self._try_count += 1
|
||||
if self._try_count < 10:
|
||||
self.log.warn('no progress retry %d', self._try_count)
|
||||
return BUSY, status_text
|
||||
self._idle_status = WARN, 'no progress'
|
||||
if self._error_state:
|
||||
self._try_count += 1
|
||||
if self._try_count < 10 and self._history is not None:
|
||||
self.log.warn('end of travel retry %d', self._try_count)
|
||||
self.write_target(self.target)
|
||||
return Done
|
||||
self._idle_status = WARN, self._error_state
|
||||
if self.status[0] != IDLE:
|
||||
self._stop()
|
||||
return self._idle_status
|
||||
|
||||
@Command()
|
||||
def stop(self):
|
||||
if self.step_mode:
|
||||
self._stop_thread()
|
||||
self._status = IDLE, 'stopped'
|
||||
elif self._moving_since:
|
||||
self._moving_since = False # indicate stop
|
||||
self.read_status()
|
||||
def write_target(self, value):
|
||||
if value == self.read_value():
|
||||
return value
|
||||
self.check_limits(value)
|
||||
self._try_count = 0
|
||||
self._direction = 1 if value > self.value else -1
|
||||
# if self._error_state and DIRECTION_NAME[-self._direction] not in self._error_state:
|
||||
# raise BadValueError('can not move (%s)' % self._error_state)
|
||||
self._move_steps = 0
|
||||
self.write_output(1)
|
||||
# try first with 50 % of tolerance
|
||||
self._hw.setTargetRange(self.axis, self.tolerance * 0.5 / self._scale)
|
||||
for itry in range(5):
|
||||
try:
|
||||
self._hw.setTargetPosition(self.axis, value / self._scale)
|
||||
self._hw.startAutoMove(self.axis, enable=1, relative=0)
|
||||
except Exception as e:
|
||||
if itry == 4:
|
||||
raise
|
||||
self.log.warn('%r', e)
|
||||
self._history = [self.value]
|
||||
self._idle_status = IDLE, ''
|
||||
self.freeze_status(1, BUSY, 'changed target')
|
||||
self.setFastPoll(True, 1)
|
||||
return value
|
||||
|
||||
@Command(IntRange())
|
||||
def move(self, steps):
|
||||
"""relative move by number of steps"""
|
||||
self._stop_thread()
|
||||
self.read_value()
|
||||
if steps > 0:
|
||||
if self.value > self.target_max:
|
||||
raise BadValueError('above upper limit')
|
||||
elif self.value < self.target_min:
|
||||
raise BadValueError('below lower limit')
|
||||
self.status = self._status = BUSY, 'moving relative'
|
||||
self._start_thread(self._run_move, steps)
|
||||
|
||||
def _run_move(self, steps):
|
||||
self.setFastPoll(True, self.fast_interval)
|
||||
self._move_steps(steps)
|
||||
self.status = self._status = IDLE, ''
|
||||
|
||||
def _move_steps(self, steps):
|
||||
steps = round(steps)
|
||||
if not steps:
|
||||
def doPoll(self):
|
||||
if self._move_steps == 0:
|
||||
super().doPoll()
|
||||
return
|
||||
previous = self._read_pos()
|
||||
self.io.setAxisOutput(self.axis, enable=1, autoDisable=0)
|
||||
# wait for output is really on
|
||||
for i in range(100):
|
||||
self._wait(0.001)
|
||||
self._get_status()
|
||||
if self._output:
|
||||
break
|
||||
else:
|
||||
raise ValueError('can not switch on output')
|
||||
for cnt in range(abs(steps)):
|
||||
self.io.setAxisOutput(self.axis, enable=1, autoDisable=0)
|
||||
if not self._thread:
|
||||
raise Stopped('stopped')
|
||||
self.io.startSingleStep(self.axis, steps < 0)
|
||||
self._wait(1 / self.frequency)
|
||||
self._get_status()
|
||||
if cnt and not self._output:
|
||||
steps = cnt
|
||||
break
|
||||
self._wait(self.delay)
|
||||
self.value = self._read_pos()
|
||||
self._step_size = (self.value - previous) / steps
|
||||
|
||||
@Command(IntRange(0))
|
||||
def calib_steps(self, delta):
|
||||
"""calibrate steps_fwd and steps_bwd using <delta> steps forwards and backwards"""
|
||||
if not self.sensor_connected:
|
||||
raise HardwareError('no sensor connected')
|
||||
self._stop_thread()
|
||||
self._status = BUSY, 'calibrate step size'
|
||||
self.read_status()
|
||||
self._start_thread(self._run_calib, delta)
|
||||
|
||||
def _run_calib(self, steps):
|
||||
self.value = self._read_pos()
|
||||
if self._calib_range is None or abs(self.target - self.value) > self._calib_range:
|
||||
self.target = self.value
|
||||
maxfwd = 0
|
||||
maxbwd = 0
|
||||
cntfwd = 0
|
||||
cntbwd = 0
|
||||
self._calib_range = 0
|
||||
for i in range(10):
|
||||
if self.value <= self.target:
|
||||
self._status = BUSY, 'move forwards'
|
||||
self.read_status()
|
||||
self._move_steps(steps)
|
||||
while True:
|
||||
self._move_steps(steps)
|
||||
if self._step_size and self._output:
|
||||
maxfwd = max(maxfwd, self._step_size)
|
||||
cntfwd += 1
|
||||
if self.value > self.target:
|
||||
break
|
||||
else:
|
||||
self._status = BUSY, 'move backwards'
|
||||
self.read_status()
|
||||
self._move_steps(-steps)
|
||||
while True:
|
||||
self._move_steps(-steps)
|
||||
if self._step_size:
|
||||
maxbwd = max(maxbwd, self._step_size)
|
||||
cntbwd += 1
|
||||
if self.value < self.target:
|
||||
break
|
||||
# keep track how far we had to go for calibration
|
||||
self._calib_range = max(self._calib_range, abs(self.value - self.target))
|
||||
if cntfwd >= 3 and cntbwd >= 3:
|
||||
self.steps_fwd = 1 / maxfwd
|
||||
self.steps_bwd = 1 / maxbwd
|
||||
self._status = IDLE, 'calib step size done'
|
||||
break
|
||||
else:
|
||||
self._status = WARN, 'calib step size failed'
|
||||
self.read_status()
|
||||
self._hw.startSingleStep(self.axis, self._direction < 0)
|
||||
self._move_steps -= self._direction
|
||||
if self._move_steps % int(self.frequency) == 0: # poll value and status every second
|
||||
super().doPoll()
|
||||
|
||||
@nopoll
|
||||
def read_info(self):
|
||||
"""read info from controller"""
|
||||
axistype = ['linear', 'gonio', 'rotator'][self.io.getActuatorType(self.axis)]
|
||||
name = self.io.getActuatorName(self.axis)
|
||||
cap = self.io.measureCapacitance(self.axis) * 1e9
|
||||
return f'{name} {axistype} {cap:.3g}nF'
|
||||
cap = self._hw.measureCapacitance(self.axis) * 1e9
|
||||
axistype = ['linear', 'gonio', 'rotator'][self._hw.getActuatorType(self.axis)]
|
||||
return '%s %s %.3gnF' % (self._hw.getActuatorName(self.axis), axistype, cap)
|
||||
|
||||
def _stop(self):
|
||||
self._move_steps = 0
|
||||
self._history = None
|
||||
for _ in range(5):
|
||||
try:
|
||||
self._hw.startAutoMove(self.axis, enable=0, relative=0)
|
||||
break
|
||||
except Exception as e:
|
||||
if itry == 4:
|
||||
raise
|
||||
self.log.warn('%r', e)
|
||||
self._hw.setTargetRange(self.axis, self.tolerance / self._scale)
|
||||
self.setFastPoll(False)
|
||||
|
||||
@Command()
|
||||
def stop(self):
|
||||
self._idle_status = IDLE, 'stopped' if self.isBusy() else ''
|
||||
self._stop()
|
||||
self.status = self._idle_status
|
||||
|
||||
@Command(IntRange())
|
||||
def move(self, value):
|
||||
"""relative move by number of steps"""
|
||||
self._direction = 1 if value > 0 else -1
|
||||
self.check_value(self.value)
|
||||
self._history = None
|
||||
if DIRECTION_NAME[self._direction] in self._error_state:
|
||||
raise BadValueError('can not move (%s)' % self._error_state)
|
||||
self._move_steps = value
|
||||
self._idle_status = IDLE, ''
|
||||
self.read_status()
|
||||
self.setFastPoll(True, 1/self.frequency)
|
||||
|
279
frappy_psi/bridge.py
Normal file
279
frappy_psi/bridge.py
Normal file
@ -0,0 +1,279 @@
|
||||
# *****************************************************************************
|
||||
# This program is free software; you can redistribute it and/or modify it under
|
||||
# the terms of the GNU General Public License as published by the Free Software
|
||||
# Foundation; either version 2 of the License, or (at your option) any later
|
||||
# version.
|
||||
#
|
||||
# This program is distributed in the hope that it will be useful, but WITHOUT
|
||||
# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
|
||||
# FOR A PARTICULAR PURPOSE. See the GNU General Public License for more
|
||||
# details.
|
||||
#
|
||||
# You should have received a copy of the GNU General Public License along with
|
||||
# this program; if not, write to the Free Software Foundation, Inc.,
|
||||
# 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
||||
#
|
||||
# Module authors: Oksana Shliakhtun <oksana.shliakhtun@psi.ch>
|
||||
# *****************************************************************************
|
||||
"""Stanford Research Systems SIM900 Mainframe"""
|
||||
|
||||
import re
|
||||
from frappy.core import StringIO, HasIO, Readable, \
|
||||
Parameter, FloatRange, IntRange, EnumType, \
|
||||
Property, Attached, IDLE, ERROR, WARN
|
||||
|
||||
|
||||
def string_to_value(value):
|
||||
"""
|
||||
Converting the value to float, removing the units, converting the prefix into the number.
|
||||
:param value: value
|
||||
:return: float value without units
|
||||
"""
|
||||
value_with_unit = re.compile(r'(\d+)([pnumkMG]?)')
|
||||
value, pfx = value_with_unit.match(value).groups()
|
||||
pfx_dict = {'p': 1e-12, 'n': 1e-9, 'u': 1e-6, 'm': 1e-3, 'k': 1e3, 'M': 1e6, 'G': 1e9}
|
||||
if pfx in pfx_dict:
|
||||
value = round(float(value) * pfx_dict[pfx], 12)
|
||||
return float(value)
|
||||
|
||||
|
||||
def find_idx(list_of_values, target):
|
||||
"""
|
||||
Search for the nearest value and index from the given range for the given target.
|
||||
:param list_of_values: range of values
|
||||
:param target: target
|
||||
:return: closest index and closest value
|
||||
"""
|
||||
target = float(target)
|
||||
cl_idx = None
|
||||
cl_value = float('inf')
|
||||
|
||||
for idx, value in enumerate(list_of_values):
|
||||
if value >= target:
|
||||
diff = value - target
|
||||
|
||||
if diff < cl_value:
|
||||
cl_value = value
|
||||
cl_idx = idx
|
||||
|
||||
return cl_idx, cl_value
|
||||
|
||||
|
||||
class BridgeIO(StringIO):
|
||||
"""_\n is placed at the beginning of each command to distinguish
|
||||
the previous response with a possible asynchronous response from the actual value returned by the method. """
|
||||
|
||||
end_of_line = '\n'
|
||||
identification = [('_\n*IDN?', r'Stanford_Research_Systems,.*')]
|
||||
|
||||
|
||||
class Base(HasIO):
|
||||
port = Property('modules port', IntRange(0, 15))
|
||||
|
||||
def communicate(self, command):
|
||||
"""
|
||||
Connection to the particular module x.
|
||||
:param command: command
|
||||
:return: return
|
||||
"""
|
||||
return self.io.communicate(f'_\nconn {self.port:x},"_\n"\n{command}')
|
||||
|
||||
def query(self, command):
|
||||
"""converting to float"""
|
||||
return float(self.communicate(command))
|
||||
|
||||
|
||||
class Resistance(Base, Readable):
|
||||
value = Parameter('resistance', datatype=FloatRange, unit='ohm')
|
||||
output_offset = Parameter('resistance deviation', datatype=FloatRange, unit='Ohm', readonly=False)
|
||||
phase_hold = Parameter('phase hold', EnumType('phase hold', off=0, on=1))
|
||||
|
||||
RES_RANGE = ['20mOhm', '200mOhm', '2Ohm', '20Ohm', '200Ohm', '2kOhm', '20kOhm', '200kOhm',
|
||||
'2MOhm', '20MOhm']
|
||||
irange = Parameter('resistance range index', EnumType('resistance range index',
|
||||
{name: idx for idx, name in enumerate(RES_RANGE)}),
|
||||
readonly=False)
|
||||
range = Parameter('resistance range value', FloatRange(2e-2, 2e7), unit='Om', readonly=False)
|
||||
|
||||
TIME_CONST = ['0.3s', '1s', '3s', '10s', '30s', '100s', '300s']
|
||||
itc = Parameter('time constant index',
|
||||
EnumType('time const. index range',
|
||||
{name: value for value, name in enumerate(TIME_CONST)}), readonly=False)
|
||||
tc = Parameter('time constant value', FloatRange(1e-1, 3e2), unit='s', readonly=False)
|
||||
|
||||
EXCT_RANGE = ['0', '3uV', '10uV', '30uV', '100uV', '300uV', '1mV', '3mV', '10mV', '30mV']
|
||||
iexct = Parameter('excitation index',
|
||||
EnumType('excitation index range', {name: idx for idx, name in enumerate(EXCT_RANGE, start=-1)}),
|
||||
readonly=False)
|
||||
exct = Parameter('excitation value', FloatRange(0, 3e-2), unit='s', default=300, readonly=False)
|
||||
|
||||
autorange = Parameter('autorange_on', EnumType('autorange', off=0, on=1),
|
||||
readonly=False, default=0)
|
||||
|
||||
RES_RANGE_values = [string_to_value(value) for value in RES_RANGE]
|
||||
TIME_CONST_values = [string_to_value(value) for value in TIME_CONST]
|
||||
EXCT_RANGE_values = [string_to_value(value) for value in EXCT_RANGE]
|
||||
|
||||
ioClass = BridgeIO
|
||||
|
||||
def doPoll(self):
|
||||
super().doPoll()
|
||||
max_res = abs(self.value)
|
||||
if self.autorange == 1:
|
||||
if max_res >= 0.9 * self.range and self.irange < 9:
|
||||
self.write_irange(self.irange + 1)
|
||||
elif max_res <= 0.3 * self.range and self.irange > 0:
|
||||
self.write_irange(self.irange - 1)
|
||||
|
||||
def read_status(self):
|
||||
"""
|
||||
Both the mainframe (SR900) and the module (SR921) have the same commands for the status,
|
||||
here implemented commands are made for module status, not the frame!
|
||||
|
||||
:return: status type and message
|
||||
"""
|
||||
esr = int(self.communicate('*esr?')) # standart event status byte
|
||||
ovsr = int(self.communicate('ovsr?')) # overload status
|
||||
cesr = int(self.communicate('cesr?')) # communication error status
|
||||
|
||||
if esr & (1 << 1):
|
||||
return ERROR, 'input error, cleared'
|
||||
if esr & (1 << 2):
|
||||
return ERROR, 'query error'
|
||||
if esr & (1 << 4):
|
||||
return ERROR, 'execution error'
|
||||
if esr & (1 << 5):
|
||||
return ERROR, 'command error'
|
||||
if cesr & (1 << 0):
|
||||
return ERROR, 'parity error'
|
||||
if cesr & (1 << 2):
|
||||
return ERROR, 'noise error'
|
||||
if cesr & (1 << 4):
|
||||
return ERROR, 'input overflow, cleared'
|
||||
if cesr & (1 << 3):
|
||||
return ERROR, 'hardware overflow'
|
||||
if ovsr & (1 << 0):
|
||||
return ERROR, 'output overload'
|
||||
if cesr & (1 << 7):
|
||||
return WARN, 'device clear'
|
||||
if ovsr & (1 << 2):
|
||||
return WARN, 'current saturation'
|
||||
if ovsr & (1 << 3):
|
||||
return WARN, 'under servo'
|
||||
if ovsr & (1 << 4):
|
||||
return WARN, 'over servo'
|
||||
return IDLE, ''
|
||||
|
||||
def read_value(self):
|
||||
return self.query('rval?')
|
||||
|
||||
def read_irange(self):
|
||||
"""index of the resistance value according to the range"""
|
||||
return self.query('rang?')
|
||||
|
||||
def write_irange(self, idx):
|
||||
value = int(idx)
|
||||
self.query(f'rang {value}; rang?')
|
||||
self.read_range()
|
||||
return value
|
||||
|
||||
def read_range(self):
|
||||
"""value of the resistance range"""
|
||||
idx = self.read_irange()
|
||||
name = self.RES_RANGE[idx]
|
||||
return string_to_value(name)
|
||||
|
||||
def write_range(self, target):
|
||||
cl_idx, cl_value = find_idx(self.RES_RANGE_values, target)
|
||||
self.query(f'rang {cl_idx}; rang?')
|
||||
return cl_value
|
||||
|
||||
def read_output_offset(self):
|
||||
"""Output offset, can be set by user. This is the value subtracted from the measured value"""
|
||||
return self.query('rset?')
|
||||
|
||||
def write_output_offset(self, output_offset):
|
||||
self.query(f'rset {output_offset};rset?')
|
||||
|
||||
def read_itc(self):
|
||||
"""index of the temperature constant value according to the range"""
|
||||
return self.query('tcon?')
|
||||
|
||||
def write_itc(self, itc):
|
||||
self.read_itc()
|
||||
value = int(itc)
|
||||
return self.query(f'tcon {value}; tcon?')
|
||||
|
||||
def read_tc(self):
|
||||
idx = self.read_itc()
|
||||
name = self.TIME_CONST[idx]
|
||||
return string_to_value(name)
|
||||
|
||||
def write_tc(self, target):
|
||||
cl_idx, cl_value = find_idx(self.TIME_CONST_values, target)
|
||||
self.query(f'tcon {cl_idx};tcon?')
|
||||
return cl_value
|
||||
|
||||
def read_autorange(self):
|
||||
return self.autorange
|
||||
|
||||
def write_autorange(self, value):
|
||||
self.query(f'agai {value:d};agai?')
|
||||
return value
|
||||
|
||||
def read_iexct(self):
|
||||
"""index of the excitation value according to the range"""
|
||||
return int(self.query('exci?'))
|
||||
|
||||
def write_iexct(self, iexct):
|
||||
value = int(iexct)
|
||||
return self.query(f'exci {value};exci?')
|
||||
|
||||
def write_exct(self, target):
|
||||
target = float(target)
|
||||
cl_idx = None
|
||||
cl_value = float('inf')
|
||||
min_diff = float('inf')
|
||||
|
||||
for idx, value in enumerate(self.EXCT_RANGE_values):
|
||||
diff = abs(value - target)
|
||||
|
||||
if diff < min_diff:
|
||||
min_diff = diff
|
||||
cl_value = value
|
||||
cl_idx = idx
|
||||
|
||||
self.write_iexct(cl_idx)
|
||||
return cl_value
|
||||
|
||||
def read_exct(self):
|
||||
idx = int(self.read_iexct())
|
||||
name = self.EXCT_RANGE[idx + 1]
|
||||
return string_to_value(name)
|
||||
|
||||
def read_phase_hold(self):
|
||||
"""
|
||||
Set the phase hold mode (if on - phase is assumed to be zero).
|
||||
:return: 0 - off, 1 - on
|
||||
"""
|
||||
return int(self.communicate('phld?'))
|
||||
|
||||
def write_phase_hold(self, phase_hold):
|
||||
self.communicate(f'phld {phase_hold}')
|
||||
return self.read_phase_hold()
|
||||
|
||||
|
||||
class Phase(Readable):
|
||||
resistance = Attached()
|
||||
value = Parameter('phase', FloatRange, default=0, unit='deg')
|
||||
|
||||
def read_value(self):
|
||||
return self.resistance.query('phas?')
|
||||
|
||||
|
||||
class Deviation(Readable):
|
||||
resistance = Attached()
|
||||
value = Parameter('resistance deviation', FloatRange(), unit='Ohm')
|
||||
|
||||
def read_value(self):
|
||||
return self.resistance.query('rdev?')
|
@ -1,576 +0,0 @@
|
||||
#!/usr/bin/env python
|
||||
# -*- coding: utf-8 -*-
|
||||
# *****************************************************************************
|
||||
# This program is free software; you can redistribute it and/or modify it under
|
||||
# the terms of the GNU General Public License as published by the Free Software
|
||||
# Foundation; either version 2 of the License, or (at your option) any later
|
||||
# version.
|
||||
#
|
||||
# This program is distributed in the hope that it will be useful, but WITHOUT
|
||||
# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
|
||||
# FOR A PARTICULAR PURPOSE. See the GNU General Public License for more
|
||||
# details.
|
||||
#
|
||||
# You should have received a copy of the GNU General Public License along with
|
||||
# this program; if not, write to the Free Software Foundation, Inc.,
|
||||
# 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
||||
#
|
||||
# Module authors:
|
||||
# Markus Zolliker <markus.zolliker@psi.ch>
|
||||
# *****************************************************************************
|
||||
"""Software calibration"""
|
||||
|
||||
import os
|
||||
import re
|
||||
from os.path import basename, dirname, exists, join
|
||||
|
||||
import numpy as np
|
||||
from scipy.interpolate import PchipInterpolator, CubicSpline, PPoly # pylint: disable=import-error
|
||||
|
||||
|
||||
from frappy.errors import ProgrammingError, RangeError
|
||||
from frappy.lib import clamp
|
||||
|
||||
to_scale = {
|
||||
'lin': lambda x: x,
|
||||
'log': lambda x: np.log10(x),
|
||||
}
|
||||
from_scale = {
|
||||
'lin': lambda x: x,
|
||||
'log': lambda x: 10 ** np.array(x),
|
||||
}
|
||||
TYPES = [ # lakeshore type, inp-type, loglog
|
||||
('DT', 'si', False), # Si diode
|
||||
('TG', 'gaalas', False), # GaAlAs diode
|
||||
('PT', 'pt250', False), # platinum, 250 Ohm range
|
||||
('PT', 'pt500', False), # platinum, 500 Ohm range
|
||||
('PT', 'pt2500', False), # platinum, 2500 Ohm range
|
||||
('RF', 'rhfe', False), # rhodium iron
|
||||
('CC', 'c', True), # carbon, LakeShore acronym unknown
|
||||
('CX', 'cernox', True), # Cernox
|
||||
('RX', 'ruox', True), # rutheniumm oxide
|
||||
('GE', 'ge', True), # germanium, LakeShore acronym unknown
|
||||
]
|
||||
|
||||
|
||||
OPTION_TYPE = {
|
||||
'loglog': 0, # boolean
|
||||
'extrange': 2, # tuple(min T, max T for extrapolation
|
||||
'calibrange': 2, # tuple(min T, max T)
|
||||
}
|
||||
|
||||
|
||||
class HasOptions:
|
||||
def insert_option(self, key, value):
|
||||
key = key.strip()
|
||||
argtype = OPTION_TYPE.get(key, 1)
|
||||
if argtype == 1: # one number or string
|
||||
try:
|
||||
value = float(value)
|
||||
except ValueError:
|
||||
value = value.strip()
|
||||
elif argtype == 0:
|
||||
if value.strip().lower() in ('false', '0'):
|
||||
value = False
|
||||
else:
|
||||
value = True
|
||||
else:
|
||||
value = [float(f) for f in value.split(',')]
|
||||
self.options[key] = value
|
||||
|
||||
|
||||
class StdParser(HasOptions):
|
||||
"""parser used for reading columns"""
|
||||
def __init__(self, **options):
|
||||
"""keys of options may be either 'x' or 'logx' and either 'y' or 'logy'
|
||||
|
||||
default is x=0, y=1
|
||||
"""
|
||||
if 'logx' in options:
|
||||
self.xscale = 'log'
|
||||
self.xcol = options.pop('logx')
|
||||
else:
|
||||
self.xscale = 'lin'
|
||||
self.xcol = options.pop('x', 0)
|
||||
if 'logy' in options:
|
||||
self.yscale = 'log'
|
||||
self.ycol = options.pop('logy')
|
||||
else:
|
||||
self.yscale = 'lin'
|
||||
self.ycol = options.pop('y', 1)
|
||||
self.xdata, self.ydata = [], []
|
||||
self.options = options
|
||||
self.invalid_lines = []
|
||||
|
||||
def parse(self, line):
|
||||
"""get numbers from a line and put them to self.xdata / self.ydata"""
|
||||
row = line.split()
|
||||
try:
|
||||
self.xdata.append(float(row[self.xcol]))
|
||||
self.ydata.append(float(row[self.ycol]))
|
||||
except (IndexError, ValueError):
|
||||
self.invalid_lines.append(line)
|
||||
return
|
||||
|
||||
def finish(self):
|
||||
pass
|
||||
|
||||
|
||||
class InpParser(StdParser):
|
||||
"""M. Zollikers *.inp calcurve format"""
|
||||
HEADERLINE = re.compile(r'#?(?:(\w+)\s*=\s*([^!# \t\n]*)|curv.*)')
|
||||
INP_TYPES = {ityp: (ltyp, loglog) for ltyp, ityp, loglog in TYPES}
|
||||
|
||||
def __init__(self, **options):
|
||||
options.update(x=0, y=1)
|
||||
super().__init__(**options)
|
||||
self.header = True
|
||||
|
||||
def parse(self, line):
|
||||
"""scan header"""
|
||||
if self.header:
|
||||
match = self.HEADERLINE.match(line)
|
||||
if match:
|
||||
key, value = match.groups()
|
||||
if key is None:
|
||||
self.header = False
|
||||
else:
|
||||
key = key.lower()
|
||||
value = value.strip()
|
||||
if key == 'type':
|
||||
type_, loglog = self.INP_TYPES.get(value.lower(), (None, None))
|
||||
if type_ is not None:
|
||||
self.options['type'] = type_
|
||||
if loglog is not None:
|
||||
self.options['loglog'] = loglog
|
||||
else:
|
||||
self.insert_option(key, value)
|
||||
return
|
||||
elif line.startswith('!'):
|
||||
return
|
||||
super().parse(line)
|
||||
|
||||
|
||||
class Parser340(StdParser):
|
||||
"""parser for LakeShore *.340 files"""
|
||||
HEADERLINE = re.compile(r'([^:]*):\s*([^(]*)')
|
||||
CALIBHIGH = dict(L=325, M=420, H=500, B=40)
|
||||
|
||||
def __init__(self, **options):
|
||||
options.update(x=1, y=2)
|
||||
super().__init__(**options)
|
||||
self.header = True
|
||||
|
||||
def parse(self, line):
|
||||
"""scan header"""
|
||||
if self.header:
|
||||
match = self.HEADERLINE.match(line)
|
||||
if match:
|
||||
key, value = match.groups()
|
||||
key = ''.join(key.split()).lower()
|
||||
value = value.strip()
|
||||
if key == 'dataformat':
|
||||
if value[0:1] == '4':
|
||||
self.xscale, self.yscale = 'log', 'lin' # logOhm
|
||||
self.options['loglog'] = True
|
||||
elif value[0:1] == '5':
|
||||
self.xscale, self.yscale = 'log', 'log' # logOhm, logK
|
||||
self.options['loglog'] = True
|
||||
elif value[0:1] in ('1', '2', '3'):
|
||||
self.options['loglog'] = False
|
||||
else:
|
||||
raise ValueError('invalid Data Format')
|
||||
self.options['scale'] = self.xscale + self.yscale
|
||||
self.insert_option(key, value)
|
||||
return
|
||||
if 'No.' in line:
|
||||
self.header = False
|
||||
return
|
||||
if len(line.split()) != 3:
|
||||
return
|
||||
super().parse(line)
|
||||
if self.header and self.xdata:
|
||||
# valid line detected
|
||||
self.header = False
|
||||
|
||||
def finish(self):
|
||||
model = self.options.get('sensormodel', '').split('-')
|
||||
if model[0]:
|
||||
self.options['type'] = model[0]
|
||||
if 'calibrange' not in self.options:
|
||||
if len(model) > 2:
|
||||
try: # e.g. model[-1] == 1.4M -> calibrange = 1.4, 420
|
||||
self.options['calibrange'] = float(model[-1][:-1]), self.CALIBHIGH[model[-1][-1]]
|
||||
return
|
||||
except (ValueError, KeyError):
|
||||
pass
|
||||
|
||||
|
||||
class CaldatParser(StdParser):
|
||||
"""parser for format from sea/tcl/startup/calib_ext.tcl"""
|
||||
|
||||
def __init__(self, options):
|
||||
options.update(x=1, y=2)
|
||||
super().__init__(options)
|
||||
|
||||
|
||||
PARSERS = {
|
||||
"340": Parser340,
|
||||
"inp": InpParser,
|
||||
"caldat": CaldatParser,
|
||||
"dat": StdParser, # lakeshore raw data *.dat format
|
||||
}
|
||||
|
||||
|
||||
def check(x, y, islog):
|
||||
# check interpolation error
|
||||
yi = y[:-2] + (x[1:-1] - x[:-2]) * (y[2:] - y[:-2]) / (x[2:] - x[:-2])
|
||||
if islog:
|
||||
return sum((yi - y[1:-1]) ** 2)
|
||||
return sum((np.log10(yi) - np.log10(y[1:-1])) ** 2)
|
||||
|
||||
|
||||
def get_curve(newscale, curves):
|
||||
"""get curve from curve cache (converts not existing ones)
|
||||
|
||||
:param newscale: the new scale to get
|
||||
:param curves: a dict <scale> of <array> storing available scales
|
||||
:return: the retrieved or converted curve
|
||||
"""
|
||||
if newscale in curves:
|
||||
return curves[newscale]
|
||||
for scale, array in curves.items():
|
||||
curves[newscale] = curve = to_scale[newscale](from_scale[scale](array))
|
||||
return curve
|
||||
|
||||
|
||||
class CalCurve(HasOptions):
|
||||
EXTRAPOLATION_AMOUNT = 0.1
|
||||
MAX_EXTRAPOLATION_FACTOR = 2
|
||||
|
||||
def __init__(self, calibspec=None, *, x=None, y=None, cubic_spline=True, **options):
|
||||
"""calibration curve
|
||||
|
||||
:param calibspec: a string with name or filename, options
|
||||
lookup path for files in env. variable FRAPPY_CALIB_PATH
|
||||
calibspec format:
|
||||
[<full path> | <name>][,<key>=<value> ...]
|
||||
for <key>/<value> as in parser arguments
|
||||
:param x, y: x and y arrays (given instead of calibspec)
|
||||
:param cubic_split: set to False for always using Pchip interpolation
|
||||
:param options: options for parsers
|
||||
"""
|
||||
self.options = options
|
||||
if calibspec is None:
|
||||
parser = StdParser()
|
||||
parser.xdata = x
|
||||
parser.ydata = y
|
||||
else:
|
||||
if x or y:
|
||||
raise ProgrammingError('can not give both calibspec and x,y ')
|
||||
sensopt = calibspec.split(',')
|
||||
calibname = sensopt.pop(0)
|
||||
_, dot, ext = basename(calibname).rpartition('.')
|
||||
kind = None
|
||||
pathlist = os.environ.get('FRAPPY_CALIB_PATH', '').split(':')
|
||||
pathlist.append(join(dirname(__file__), 'calcurves'))
|
||||
for path in pathlist:
|
||||
# first try without adding kind
|
||||
filename = join(path.strip(), calibname)
|
||||
if exists(filename):
|
||||
kind = ext if dot else None
|
||||
break
|
||||
# then try adding all kinds as extension
|
||||
for nam in calibname, calibname.upper(), calibname.lower():
|
||||
for kind in PARSERS:
|
||||
filename = join(path.strip(), '%s.%s' % (nam, kind))
|
||||
if exists(filename):
|
||||
break
|
||||
else:
|
||||
continue
|
||||
break
|
||||
else:
|
||||
continue
|
||||
break
|
||||
else:
|
||||
raise FileNotFoundError(calibname)
|
||||
sensopt = iter(sensopt)
|
||||
for opt in sensopt:
|
||||
key, _, value = opt.lower().partition('=')
|
||||
if OPTION_TYPE.get(key) == 2:
|
||||
self.options[key] = float(value), float(next(sensopt))
|
||||
else:
|
||||
self.insert_option(key, value)
|
||||
kind = self.options.pop('kind', kind)
|
||||
cls = PARSERS.get(kind, StdParser)
|
||||
try:
|
||||
parser = cls(**self.options)
|
||||
with open(filename, encoding='utf-8') as f:
|
||||
for line in f:
|
||||
parser.parse(line)
|
||||
parser.finish()
|
||||
except Exception as e:
|
||||
raise ValueError('error parsing calib curve %s %r' % (calibspec, e)) from e
|
||||
# take defaults from parser options
|
||||
self.options = dict(parser.options, **self.options)
|
||||
|
||||
x = np.asarray(parser.xdata)
|
||||
y = np.asarray(parser.ydata)
|
||||
if len(x) < 2:
|
||||
raise ValueError('calib file %s has less than 2 points' % calibspec)
|
||||
|
||||
if x[0] > x[-1]:
|
||||
x = np.flip(np.array(x))
|
||||
y = np.flip(np.array(y))
|
||||
else:
|
||||
x = np.array(x)
|
||||
y = np.array(y)
|
||||
not_incr_idx = np.argwhere(x[1:] <= x[:-1])
|
||||
if len(not_incr_idx):
|
||||
raise RangeError('x not monotonic at x=%.4g' % x[not_incr_idx[0]])
|
||||
|
||||
self.x = {parser.xscale: x}
|
||||
self.y = {parser.yscale: y}
|
||||
self.lin_forced = [parser.yscale == 'lin' and (y[0] <= 0 or y[-1] <= 0),
|
||||
parser.xscale == 'lin' and x[0] <= 0]
|
||||
if sum(self.lin_forced):
|
||||
self.loglog = False
|
||||
else:
|
||||
self.loglog = self.options.get('loglog', y[0] > y[-1]) # loglog defaults to True for NTC
|
||||
newscale = 'log' if self.loglog else 'lin'
|
||||
self.scale = newscale
|
||||
x = get_curve(newscale, self.x)
|
||||
y = get_curve(newscale, self.y)
|
||||
self.convert_x = to_scale[newscale]
|
||||
self.convert_y = from_scale[newscale]
|
||||
self.calibrange = self.options.get('calibrange')
|
||||
dirty = set()
|
||||
self.extra_points = False
|
||||
self.cutted = False
|
||||
if self.calibrange:
|
||||
self.calibrange = sorted(self.calibrange)
|
||||
# determine indices (ibeg, iend) of first and last well calibrated point
|
||||
ylin = get_curve('lin', self.y)
|
||||
beg, end = self.calibrange
|
||||
if y[0] > y[-1]:
|
||||
ylin = -ylin
|
||||
beg, end = -end, -beg
|
||||
|
||||
ibeg, iend = np.searchsorted(ylin, (beg, end))
|
||||
if ibeg > 0 and abs(ylin[ibeg-1] - beg) < 0.1 * (ylin[ibeg] - ylin[ibeg-1]):
|
||||
# add previous point, if close
|
||||
ibeg -= 1
|
||||
if iend < len(ylin) and abs(ylin[iend] - end) < 0.1 * (ylin[iend] - ylin[iend-1]):
|
||||
# add next point, if close
|
||||
iend += 1
|
||||
if self.options.get('cut', False):
|
||||
self.cutted = True
|
||||
x = x[ibeg:iend]
|
||||
y = y[ibeg:iend]
|
||||
self.x = {newscale: x}
|
||||
self.y = {newscale: y}
|
||||
ibeg = 0
|
||||
iend = len(x)
|
||||
dirty.add('xy')
|
||||
else:
|
||||
self.extra_points = ibeg, len(x) - iend
|
||||
else:
|
||||
ibeg = 0
|
||||
iend = len(x)
|
||||
ylin = get_curve('lin', self.y)
|
||||
self.calibrange = tuple(sorted([ylin[0], ylin[-1]]))
|
||||
|
||||
if cubic_spline:
|
||||
# fit well calibrated part with spline
|
||||
# determine slopes of calibrated part with CubicSpline
|
||||
spline = CubicSpline(x[ibeg:iend], y[ibeg:iend])
|
||||
roots = spline.derivative().roots(extrapolate=False)
|
||||
if len(roots):
|
||||
cubic_spline = False
|
||||
|
||||
self.cubic_spline = cubic_spline
|
||||
if cubic_spline:
|
||||
coeff = spline.c
|
||||
if self.extra_points:
|
||||
p = PchipInterpolator(x, y).c
|
||||
# use Pchip outside left and right of calibrange
|
||||
# remark: first derivative at end of calibrange is not continuous
|
||||
coeff = np.concatenate((p[:, :ibeg], coeff, p[:, iend-1:]), axis=1)
|
||||
else:
|
||||
spline = PchipInterpolator(x, y)
|
||||
coeff = spline.c
|
||||
# extrapolation extension
|
||||
# linear extrapolation is more robust than spline extrapolation
|
||||
x1, x2 = x[0], x[-1]
|
||||
# take slope at end of calibrated range for extrapolation
|
||||
slopes = spline([x[ibeg], x[iend-1]], 1)
|
||||
for i, j in enumerate([ibeg, iend-2]):
|
||||
# slope of last interval in calibrange
|
||||
si = (y[j+1] - y[j])/(x[j+1] - x[j])
|
||||
# make sure slope is not more than a factor 2 different
|
||||
# from the slope calculated at the outermost calibrated intervals
|
||||
slopes[i] = clamp(slopes[i], 2*si, 0.5 * si)
|
||||
dx = 0.1 if self.loglog else (x2 - x1) * 0.1
|
||||
xe = np.concatenate(([x1 - dx], x, [x2 + dx]))
|
||||
# x3 = np.append(x, x2 + dx)
|
||||
# y3 = np.append(y, y[-1] + slope * dx)
|
||||
y0 = y[0] - slopes[0] * dx
|
||||
coeff = np.concatenate(([[0], [0], [slopes[0]], [y0]], coeff, [[0], [0], [slopes[1]], [y[-1]]]), axis=1)
|
||||
self.spline = PPoly(coeff, xe)
|
||||
# ranges without extrapolation:
|
||||
self.xrange = get_curve('lin', self.x)[[0, -1]]
|
||||
self.yrange = sorted(get_curve('lin', self.y)[[0, -1]])
|
||||
self.calibrange = [max(self.calibrange[0], self.yrange[0]),
|
||||
min(self.calibrange[1], self.yrange[1])]
|
||||
self.set_extrapolation()
|
||||
|
||||
# check
|
||||
# ys = self.spline(xe)
|
||||
# ye = np.concatenate(([y0], y, [y[-1] + slope2 * dx]))
|
||||
# assert np.all(np.abs(ys - ye) < 1e-5 * (0.1 + np.abs(ys + ye)))
|
||||
|
||||
def set_extrapolation(self, extleft=None, extright=None):
|
||||
"""set default extrapolation range for export method
|
||||
|
||||
:param extleft: y value for the lower end of the extrapolation
|
||||
:param extright: y value for the upper end of the extrapolation
|
||||
|
||||
if arguments omitted or None are replaced by a default extrapolation scheme
|
||||
|
||||
on return self.extx and self.exty are set to the extrapolated ranges
|
||||
"""
|
||||
yc1, yc2 = self.calibrange
|
||||
y1, y2 = to_scale[self.scale]([yc1, yc2])
|
||||
d = (y2 - y1) * self.EXTRAPOLATION_AMOUNT
|
||||
yex1, yex2 = tuple(from_scale[self.scale]([y1 - d, y2 + d]))
|
||||
t1, t2 = tuple(from_scale[self.scale]([y1, y2]))
|
||||
|
||||
# raw units, excluding extrapolation points at end
|
||||
xrng = self.spline.x[1], self.spline.x[-2]
|
||||
# first and last point
|
||||
yp1, yp2 = sorted(from_scale[self.scale](self.spline(xrng)))
|
||||
xrng = from_scale[self.scale](xrng)
|
||||
|
||||
# limit by maximal factor
|
||||
f = self.MAX_EXTRAPOLATION_FACTOR
|
||||
# but ext range should be at least to the points in curve
|
||||
self.exty = [min(yp1, max(yex1, min(t1 / f, t1 * f))),
|
||||
max(yp2, min(yex2, max(t2 * f, t2 / f)))]
|
||||
if extleft is not None:
|
||||
self.exty[0] = min(extleft, yp1)
|
||||
if extright is not None:
|
||||
self.exty[1] = max(extright, yp2)
|
||||
self.extx = sorted(self.invert(*yd) for yd in zip(self.exty, xrng))
|
||||
# check that sensor range is not extended by more than a factor f
|
||||
extnew = [max(self.extx[0], min(xrng[0] / f, xrng[0] * f)),
|
||||
min(self.extx[1], max(xrng[1] / f, xrng[1] * f))]
|
||||
if extnew != self.extx:
|
||||
# need further reduction
|
||||
self.extx = extnew
|
||||
self.exty = sorted(self(extnew))
|
||||
|
||||
def convert(self, value):
|
||||
"""convert a single value
|
||||
|
||||
return a tuple (converted value, boolean: was it clamped?)
|
||||
"""
|
||||
x = clamp(value, *self.extx)
|
||||
return self(x), x == value
|
||||
|
||||
def __call__(self, value):
|
||||
"""convert value or numpy array without checking extrapolation range"""
|
||||
return self.convert_y(self.spline(self.convert_x(value)))
|
||||
|
||||
def invert(self, y, defaultx=None, xscale=True, yscale=True):
|
||||
"""invert y, return defaultx if no solution is found"""
|
||||
if yscale:
|
||||
y = to_scale[self.scale](y)
|
||||
r = self.spline.solve(y)
|
||||
try:
|
||||
if xscale:
|
||||
return from_scale[self.scale](r[0])
|
||||
return r[0]
|
||||
except IndexError:
|
||||
return defaultx
|
||||
|
||||
def export(self, logformat=False, nmax=199, yrange=None, extrapolate=True, xlimits=None):
|
||||
"""export curve for downloading to hardware
|
||||
|
||||
:param nmax: max number of points. if the number of given points is bigger,
|
||||
the points with the lowest interpolation error are omitted
|
||||
:param logformat: a list with two elements of None, True or False
|
||||
True: use log, False: use line, None: use log if self.loglog
|
||||
values None are replaced with the effectively used format
|
||||
False / True are replaced by [False, False] / [True, True]
|
||||
default is False
|
||||
:param yrange: to reduce or extrapolate to this interval (extrapolate is ignored when given)
|
||||
:param extrapolate: a flag indicating whether the curves should be extrapolated
|
||||
to the preset extrapolation range
|
||||
:param xlimits: max x range
|
||||
:return: numpy array with 2 dimensions returning the curve
|
||||
"""
|
||||
|
||||
if logformat in (True, False):
|
||||
logformat = [logformat, logformat]
|
||||
try:
|
||||
scales = []
|
||||
for idx, logfmt in enumerate(logformat):
|
||||
if logfmt and self.lin_forced[idx]:
|
||||
raise ValueError('%s must contain positive values only' % 'xy'[idx])
|
||||
logformat[idx] = linlog = self.loglog if logfmt is None else logfmt
|
||||
scales.append('log' if linlog else 'lin')
|
||||
xscale, yscale = scales
|
||||
except (TypeError, AssertionError):
|
||||
raise ValueError('logformat must be a 2 element list or a boolean')
|
||||
|
||||
x = self.spline.x[1:-1] # raw units, excluding extrapolated points
|
||||
x1, x2 = xmin, xmax = x[0], x[-1]
|
||||
y1, y2 = sorted(self.spline([x1, x2]))
|
||||
|
||||
if extrapolate and not yrange:
|
||||
yrange = self.exty
|
||||
if yrange is not None:
|
||||
xmin, xmax = sorted(self.invert(*yd, xscale=False) for yd in zip(yrange, [x1, x2]))
|
||||
if xlimits is not None:
|
||||
lim = to_scale[self.scale](xlimits)
|
||||
xmin = clamp(xmin, *lim)
|
||||
xmax = clamp(xmax, *lim)
|
||||
if xmin != x1 or xmax != x2:
|
||||
ibeg, iend = np.searchsorted(x, (xmin, xmax))
|
||||
if abs(x[ibeg] - xmin) < 0.1 * (x[ibeg + 1] - x[ibeg]):
|
||||
# remove first point, if close
|
||||
ibeg += 1
|
||||
if abs(x[iend - 1] - xmax) < 0.1 * (x[iend - 1] - x[iend - 2]):
|
||||
# remove last point, if close
|
||||
iend -= 1
|
||||
x = np.concatenate(([xmin], x[ibeg:iend], [xmax]))
|
||||
y = self.spline(x)
|
||||
|
||||
# convert to exported scale
|
||||
if xscale != self.scale:
|
||||
x = to_scale[xscale](from_scale[self.scale](x))
|
||||
if yscale != self.scale:
|
||||
y = to_scale[yscale](from_scale[self.scale](y))
|
||||
|
||||
# reduce number of points, if needed
|
||||
n = len(x)
|
||||
i, j = 1, n - 1 # index range for calculating interpolation deviation
|
||||
deviation = np.zeros(n)
|
||||
while True:
|
||||
# calculate interpolation error when a single point is omitted
|
||||
ym = y[i-1:j-1] + (x[i:j] - x[i-1:j-1]) * (y[i+1:j+1] - y[i-1:j-1]) / (x[i+1:j+1] - x[i-1:j-1])
|
||||
if yscale == 'log':
|
||||
deviation[i:j] = np.abs(ym - y[i:j])
|
||||
else:
|
||||
deviation[i:j] = np.abs(ym - y[i:j]) / (np.abs(ym + y[i:j]) + 1e-10)
|
||||
if n <= nmax:
|
||||
break
|
||||
idx = np.argmin(deviation[1:-1]) + 1 # find index of the smallest error
|
||||
y = np.delete(y, idx)
|
||||
x = np.delete(x, idx)
|
||||
deviation = np.delete(deviation, idx)
|
||||
n -= 1
|
||||
# index range to recalculate
|
||||
i, j = max(1, idx - 1), min(n - 1, idx + 1)
|
||||
self.deviation = deviation # for debugging purposes
|
||||
return np.stack([x, y], axis=1)
|
@ -1,116 +0,0 @@
|
||||
libpath = '/home/l_samenv/frappy/cetoniSDK/CETONI_SDK_Raspi_64bit_v20220627/python/src/'
|
||||
import sys
|
||||
if libpath not in sys.path:
|
||||
sys.path.append(libpath)
|
||||
|
||||
from frappy.core import Drivable, Readable, StringIO, HasIO, FloatRange, IntRange, StringType, BoolType, EnumType, \
|
||||
Parameter, Property, PersistentParam, Command, IDLE, BUSY, ERROR, Attached
|
||||
from qmixsdk import qmixbus
|
||||
from qmixsdk import qmixpump
|
||||
from qmixsdk import qmixvalve
|
||||
from qmixsdk.qmixbus import UnitPrefix, TimeUnit
|
||||
|
||||
class LabCannBus(Readable):
|
||||
deviceconfig = Property('config files', StringType(),default="/home/l_samenv/frappy/cetoniSDK/CETONI_SDK_Raspi_64bit_v20220627/config/dual_pumps")
|
||||
|
||||
def earlyInit(self):
|
||||
super().earlyInit()
|
||||
self.bus = qmixbus.Bus()
|
||||
self.bus.open(self.deviceconfig, "")
|
||||
|
||||
def initModule(self):
|
||||
super().initModule()
|
||||
self.bus.start()
|
||||
|
||||
def shutdownModule(self):
|
||||
"""Not so gracefully close the connection"""
|
||||
self.bus.stop()
|
||||
self.bus.close()
|
||||
|
||||
class SyringePump(Drivable):
|
||||
io = Attached()
|
||||
pump_name = Property('name of pump', StringType(),default="Nemesys_S_1_Pump")
|
||||
valve_name = Property('name of valve', StringType(),default="Nemesys_S_1_Valve")
|
||||
|
||||
inner_diameter_set = Property('inner diameter', FloatRange(), default=1)
|
||||
piston_stroke_set = Property('piston stroke', FloatRange(), default=60)
|
||||
|
||||
value = PersistentParam('volume', FloatRange(unit='mL'))
|
||||
status = PersistentParam()
|
||||
|
||||
max_flow_rate = Parameter('max flow rate', FloatRange(0,100000, unit='mL/min',), readonly=True)
|
||||
max_volume = Parameter('max volume', FloatRange(0,100000, unit='mL',), readonly=True)
|
||||
target_flow_rate = Parameter('target flow rate', FloatRange(unit='mL/min'), readonly=False)
|
||||
real_flow_rate = Parameter('actual flow rate', FloatRange(unit='mL/min'), readonly=True)
|
||||
target = Parameter('target volume', FloatRange(unit='mL'), readonly=False)
|
||||
|
||||
no_of_valve_pos = Property('number of valve positions', IntRange(0,10), default=1)
|
||||
valve_pos = Parameter('valve position', EnumType('valve', CLOSED=0, APP=1, RES=2, OPEN=3), readonly=False)
|
||||
|
||||
def initModule(self):
|
||||
super().initModule()
|
||||
|
||||
self.pump = qmixpump.Pump()
|
||||
self.pump.lookup_by_name(self.pump_name)
|
||||
|
||||
self.valve = qmixvalve.Valve()
|
||||
self.valve.lookup_by_name(self.valve_name)
|
||||
|
||||
|
||||
def initialReads(self):
|
||||
if self.pump.is_in_fault_state():
|
||||
self.pump.clear_fault()
|
||||
|
||||
if not self.pump.is_enabled():
|
||||
self.pump.enable(True)
|
||||
|
||||
self.pump.set_syringe_param(self.inner_diameter_set, self.piston_stroke_set)
|
||||
|
||||
self.pump.set_volume_unit(qmixpump.UnitPrefix.milli, qmixpump.VolumeUnit.litres)
|
||||
|
||||
self.pump.set_flow_unit(qmixpump.UnitPrefix.milli, qmixpump.VolumeUnit.litres, qmixpump.TimeUnit.per_minute)
|
||||
|
||||
self.max_flow_rate = self.pump.get_flow_rate_max()
|
||||
self.max_volume = self.pump.get_volume_max()
|
||||
self.no_of_valve_pos = self.valve.number_of_valve_positions()
|
||||
self.valve_pos = self.valve.actual_valve_position()
|
||||
|
||||
self.target_flow_rate = self.max_flow_rate * 0.5
|
||||
self.target = self.pump.get_fill_level()
|
||||
|
||||
def read_value(self):
|
||||
return self.pump.get_fill_level()
|
||||
|
||||
def write_target(self, target):
|
||||
self.pump.set_fill_level(target, self.target_flow_rate)
|
||||
self.status = BUSY, 'Target changed'
|
||||
return target
|
||||
|
||||
def write_target_flow_rate(self, rate):
|
||||
self.pump.target_flow_rate = rate
|
||||
return rate
|
||||
|
||||
def read_real_flow_rate(self):
|
||||
return self.pump.get_flow_is()
|
||||
|
||||
def read_valve_pos(self):
|
||||
return self.valve.actual_valve_position()
|
||||
|
||||
def write_valve_pos(self, target_pos):
|
||||
self.valve.switch_valve_to_position(target_pos)
|
||||
return target_pos
|
||||
|
||||
def read_status(self):
|
||||
fault_state = self.pump.is_in_fault_state()
|
||||
pumping = self.pump.is_pumping()
|
||||
if fault_state == True:
|
||||
return ERROR, 'Pump in fault state'
|
||||
elif pumping == True:
|
||||
return BUSY, 'Pumping'
|
||||
else:
|
||||
return IDLE, ''
|
||||
|
||||
@Command
|
||||
def stop(self):
|
||||
self.pump.stop_pumping()
|
||||
self.target = self.pump.get_fill_level()
|
@ -1,4 +1,3 @@
|
||||
# -*- coding: utf-8 -*-
|
||||
# *****************************************************************************
|
||||
# This program is free software; you can redistribute it and/or modify it under
|
||||
# the terms of the GNU General Public License as published by the Free Software
|
||||
@ -19,78 +18,79 @@
|
||||
# *****************************************************************************
|
||||
"""vector field"""
|
||||
|
||||
import math
|
||||
from frappy.core import Drivable, Done, BUSY, IDLE, ERROR, Parameter, TupleOf, ArrayOf, FloatRange
|
||||
from frappy.errors import RangeError
|
||||
from frappy.core import Drivable, Done, BUSY, IDLE, WARN, ERROR
|
||||
from frappy.errors import BadValueError
|
||||
from frappy_psi.vector import Vector
|
||||
from frappy.states import HasStates, Retry, status_code
|
||||
|
||||
|
||||
DECREASE = 1
|
||||
INCREASE = 2
|
||||
|
||||
|
||||
class VectorField(HasStates, Vector, Drivable):
|
||||
sphere_radius = Parameter('max. sphere', datatype=FloatRange(0, 0.7, unit='T'), readonly=True, default=0.6)
|
||||
cylinders = Parameter('allowed cylinders (list of radius and height)',
|
||||
datatype=ArrayOf(TupleOf(FloatRange(0, 0.6, unit='T'), FloatRange(0, 5.2, unit='T')), 1, 9),
|
||||
readonly=True, default=((0.23, 5.2), (0.45, 0.8)))
|
||||
class VectorField(Vector, Drivable):
|
||||
_state = None
|
||||
|
||||
def initModule(self):
|
||||
super().initModule()
|
||||
# override check_limits of the components with a check for restrictions on the vector
|
||||
for idx, component in enumerate(self.components):
|
||||
|
||||
def outer_check(target, vector=self, i=idx, inner_check=component.check_target):
|
||||
inner_check(target)
|
||||
value = [c.value - math.copysign(c.tolerance, c.value)
|
||||
for c in vector.components]
|
||||
value[i] = target
|
||||
vector._check_limits(value)
|
||||
|
||||
component.check_target = outer_check
|
||||
def doPoll(self):
|
||||
"""periodically called method"""
|
||||
try:
|
||||
if self._starting:
|
||||
# first decrease components
|
||||
driving = False
|
||||
for target, component in zip(self.target, self.components):
|
||||
if target * component.value < 0:
|
||||
# change sign: drive to zero first
|
||||
target = 0
|
||||
if abs(target) < abs(component.target):
|
||||
if target != component.target:
|
||||
component.write_target(target)
|
||||
if component.isDriving():
|
||||
driving = True
|
||||
if driving:
|
||||
return
|
||||
# now we can go to the final targets
|
||||
for target, component in zip(self.target, self.components):
|
||||
component.write_target(target)
|
||||
self._starting = False
|
||||
else:
|
||||
for component in self.components:
|
||||
if component.isDriving():
|
||||
return
|
||||
self.setFastPoll(False)
|
||||
finally:
|
||||
super().doPoll()
|
||||
|
||||
def merge_status(self):
|
||||
return self.status
|
||||
names = [c.name for c in self.components if c.status[0] >= ERROR]
|
||||
if names:
|
||||
return ERROR, 'error in %s' % ', '.join(names)
|
||||
names = [c.name for c in self.components if c.isDriving()]
|
||||
if self._state:
|
||||
# self.log.info('merge %r', [c.status for c in self.components])
|
||||
if names:
|
||||
direction = 'down ' if self._state == DECREASE else ''
|
||||
return BUSY, 'ramping %s%s' % (direction, ', '.join(names))
|
||||
if self.status[0] == BUSY:
|
||||
return self.status
|
||||
return BUSY, 'driving'
|
||||
if names:
|
||||
return WARN, 'moving %s directly' % ', '.join(names)
|
||||
names = [c.name for c in self.components if c.status[0] >= WARN]
|
||||
if names:
|
||||
return WARN, 'warnings in %s' % ', '.join(names)
|
||||
return IDLE, ''
|
||||
|
||||
def _check_limits(self, value):
|
||||
"""check if value is within one of the safe shapes"""
|
||||
if sum((v ** 2 for v in value)) <= self.sphere_radius ** 2:
|
||||
return
|
||||
for r, h in self.cylinders:
|
||||
if sum(v ** 2 for v in value[0:2]) <= r ** 2 and abs(value[2]) <= h:
|
||||
return
|
||||
raise RangeError('vector %s does not fit in any limiting shape' % repr(value))
|
||||
|
||||
def write_target(self, target):
|
||||
def write_target(self, value):
|
||||
"""initiate target change"""
|
||||
# check limits first
|
||||
for component_target, component in zip(target, self.components):
|
||||
# check against limits of individual components
|
||||
component.check_target(component_target, vector=None) # no outer check here!
|
||||
self._check_limits(target)
|
||||
for component_target, component in zip(target, self.components):
|
||||
if component_target * component.value < 0:
|
||||
# change sign: drive to zero first
|
||||
component_target = 0
|
||||
if abs(component_target) > abs(component.value):
|
||||
continue # do not drive yet
|
||||
component.write_target(component_target)
|
||||
self.start_machine(self.ramp_down, target=target)
|
||||
return target
|
||||
|
||||
@status_code(BUSY)
|
||||
def ramp_down(self, state):
|
||||
for target, component in zip(state.target, self.components):
|
||||
if component.isDriving():
|
||||
return Retry()
|
||||
for target, component in zip(state.target, self.components):
|
||||
component.write_target(target)
|
||||
return self.final_ramp
|
||||
|
||||
@status_code(BUSY)
|
||||
def final_ramp(self, state):
|
||||
for component in self.components:
|
||||
if component.isDriving():
|
||||
return Retry()
|
||||
return self.final_status()
|
||||
# first make sure target is valid
|
||||
for target, component in zip(self.target, self.components):
|
||||
# check against limits if individual components
|
||||
component.check_limits(target)
|
||||
if sum(v * v for v in value) > 1:
|
||||
raise BadValueError('norm of vector too high')
|
||||
self.log.info('decrease')
|
||||
self.setFastPoll(True)
|
||||
self.target = value
|
||||
self._state = DECREASE
|
||||
self.doPoll()
|
||||
self.log.info('done write_target %r', value)
|
||||
return Done
|
||||
|
@ -1,123 +0,0 @@
|
||||
# *****************************************************************************
|
||||
# This program is free software; you can redistribute it and/or modify it under
|
||||
# the terms of the GNU General Public License as published by the Free Software
|
||||
# Foundation; either version 2 of the License, or (at your option) any later
|
||||
# version.
|
||||
#
|
||||
# This program is distributed in the hope that it will be useful, but WITHOUT
|
||||
# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
|
||||
# FOR A PARTICULAR PURPOSE. See the GNU General Public License for more
|
||||
# details.
|
||||
#
|
||||
# You should have received a copy of the GNU General Public License along with
|
||||
# this program; if not, write to the Free Software Foundation, Inc.,
|
||||
# 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
||||
#
|
||||
# Module authors:
|
||||
# Markus Zolliker <markus.zolliker@psi.ch>
|
||||
# *****************************************************************************
|
||||
|
||||
import time
|
||||
import math
|
||||
from frappy.core import Parameter, FloatRange, IntRange, Property
|
||||
from frappy.errors import ProgrammingError
|
||||
|
||||
|
||||
class FrozenParam(Parameter):
|
||||
"""workaround for lazy hardware
|
||||
|
||||
Some hardware does not react nicely: when a parameter is changed,
|
||||
and read back immediately, still the old value is returned.
|
||||
This special parameter helps fixing this problem.
|
||||
|
||||
Mechanism:
|
||||
|
||||
- after a call to write_<param> for a short time (<n_polls> * <interval>)
|
||||
the hardware is polled until the readback changes before the 'changed'
|
||||
message is replied to the client
|
||||
- if there is no change yet within short time, the 'changed' message is
|
||||
set with the given value and further calls to read_<param> return also
|
||||
this given value until the readback value has changed or until
|
||||
<timeout> sec have passed.
|
||||
|
||||
For float parameters, the behaviour for small changes is improved
|
||||
when the write_<param> method tries to return the (may be rounded) value,
|
||||
as if it would be returned by the hardware. If this behaviour is not
|
||||
known, or the programmer is too lazy to implement it, write_<param>
|
||||
should return None or the given value.
|
||||
Also it will help to adjust the datatype properties
|
||||
'absolute_resolution' and 'relative_resolution' to reasonable values.
|
||||
"""
|
||||
timeout = Property('timeout for freezing readback value',
|
||||
FloatRange(0, unit='s'), default=30)
|
||||
n_polls = Property("""number polls within write method""",
|
||||
IntRange(0), default=1)
|
||||
interval = Property("""interval for polls within write method
|
||||
|
||||
the product n_polls * interval should not be more than a fraction of a second
|
||||
in order not to block the connection for too long
|
||||
""",
|
||||
FloatRange(0, unit='s'), default=0.05)
|
||||
new_value = None
|
||||
previous_value = None
|
||||
expire = 0
|
||||
is_float = True # assume float. will be fixed later
|
||||
|
||||
def isclose(self, v1, v2):
|
||||
if v1 == v2:
|
||||
return True
|
||||
if self.is_float:
|
||||
dt = self.datatype
|
||||
try:
|
||||
return math.isclose(v1, v2, abs_tol=dt.absolute_tolerance,
|
||||
rel_tol=dt.relative_tolerance)
|
||||
except AttributeError:
|
||||
# fix once for ever when datatype is not a float
|
||||
self.is_float = False
|
||||
return False
|
||||
|
||||
def __set_name__(self, owner, name):
|
||||
try:
|
||||
rfunc = getattr(owner, f'read_{name}')
|
||||
wfunc = getattr(owner, f'write_{name}')
|
||||
except AttributeError:
|
||||
raise ProgrammingError(f'FrozenParam: methods read_{name} and write_{name} must exist') from None
|
||||
|
||||
super().__set_name__(owner, name)
|
||||
|
||||
def read_wrapper(self, pname=name, rfunc=rfunc):
|
||||
pobj = self.parameters[pname]
|
||||
value = rfunc(self)
|
||||
if pobj.new_value is None:
|
||||
return value
|
||||
if not pobj.isclose(value, pobj.new_value):
|
||||
if value == pobj.previous_value:
|
||||
if time.time() < pobj.expire:
|
||||
return pobj.new_value
|
||||
self.log.warning('%s readback did not change within %g sec',
|
||||
pname, pobj.timeout)
|
||||
else:
|
||||
# value has changed, but is not matching new value
|
||||
self.log.warning('%s readback changed from %r to %r but %r was given',
|
||||
pname, pobj.previous_value, value, pobj.new_value)
|
||||
# readback value has changed or returned value is roughly equal to the new value
|
||||
pobj.new_value = None
|
||||
return value
|
||||
|
||||
def write_wrapper(self, value, wfunc=wfunc, rfunc=rfunc, read_wrapper=read_wrapper, pname=name):
|
||||
pobj = self.parameters[pname]
|
||||
pobj.previous_value = rfunc(self)
|
||||
pobj.new_value = wfunc(self, value)
|
||||
if pobj.new_value is None: # as wfunc is the unwrapped write_* method, the return value may be None
|
||||
pobj.new_value = value
|
||||
pobj.expire = time.time() + pobj.timeout
|
||||
for cnt in range(pobj.n_polls):
|
||||
if cnt: # we may be lucky, and the readback value has already changed
|
||||
time.sleep(pobj.interval)
|
||||
value = read_wrapper(self)
|
||||
if pobj.new_value is None:
|
||||
return value
|
||||
return pobj.new_value
|
||||
|
||||
setattr(owner, f'read_{name}', read_wrapper)
|
||||
setattr(owner, f'write_{name}', write_wrapper)
|
@ -15,6 +15,8 @@
|
||||
#
|
||||
# Module authors: Oksana Shliakhtun <oksana.shliakhtun@psi.ch>
|
||||
# *****************************************************************************
|
||||
"""Thermo Haake Phoenix P1 Bath Circulator"""
|
||||
|
||||
import re
|
||||
import time
|
||||
from frappy.core import StringIO, HasIO, Parameter, FloatRange, BoolType, \
|
||||
@ -22,7 +24,13 @@ from frappy.core import StringIO, HasIO, Parameter, FloatRange, BoolType, \
|
||||
from frappy_psi.convergence import HasConvergence
|
||||
from frappy.errors import CommunicationFailedError
|
||||
|
||||
|
||||
def convert(string):
|
||||
"""
|
||||
Converts reply to a number
|
||||
:param string: reply from the command
|
||||
:return: number
|
||||
"""
|
||||
number = re.sub(r'[^0-9.-]', '', string)
|
||||
return float(number)
|
||||
|
||||
@ -55,11 +63,21 @@ class TemperatureLoop(HasIO, HasConvergence, Drivable):
|
||||
]
|
||||
|
||||
def get_values_status(self):
|
||||
"""
|
||||
Supplementary command for the operating status method.
|
||||
Removes the extra symbol and converts each status value into integer.
|
||||
|
||||
:return: array of integers
|
||||
"""
|
||||
reply = self.communicate('B')
|
||||
string = reply.rstrip('$')
|
||||
return [int(val) for val in string]
|
||||
|
||||
def read_status(self): # control_active update
|
||||
"""
|
||||
Operating status.
|
||||
:return: statu type and message
|
||||
"""
|
||||
values_str = self.get_values_status()
|
||||
self.read_control_active()
|
||||
|
||||
@ -72,6 +90,10 @@ class TemperatureLoop(HasIO, HasConvergence, Drivable):
|
||||
return IDLE, ''
|
||||
|
||||
def read_value(self):
|
||||
"""
|
||||
F1 - internal temperature, F2 - external temperature
|
||||
:return: float temperature value
|
||||
"""
|
||||
if self.mode == 1:
|
||||
value = self.communicate('F1')
|
||||
else:
|
||||
@ -79,6 +101,11 @@ class TemperatureLoop(HasIO, HasConvergence, Drivable):
|
||||
return convert(value)
|
||||
|
||||
def write_control_active(self, value):
|
||||
"""
|
||||
Turning on/off the heating, pump and regulation
|
||||
:param value: 0 is OFF, 1 is ON
|
||||
:return:
|
||||
"""
|
||||
if value is True:
|
||||
self.communicate('GO') # heating and pump run
|
||||
self.communicate('W SR') # regulation
|
||||
@ -99,6 +126,11 @@ class TemperatureLoop(HasIO, HasConvergence, Drivable):
|
||||
return convert(string)
|
||||
|
||||
def write_target(self, target):
|
||||
"""
|
||||
Selecting Celsius, setting the target
|
||||
:param target: target
|
||||
:return: target
|
||||
"""
|
||||
self.write_control_active(True)
|
||||
self.read_status()
|
||||
self.communicate('W TE C')
|
||||
@ -106,6 +138,11 @@ class TemperatureLoop(HasIO, HasConvergence, Drivable):
|
||||
return target
|
||||
|
||||
def write_mode(self, mode):
|
||||
"""
|
||||
Switching to internal or external control
|
||||
:param mode: internal/external
|
||||
:return: selected mode
|
||||
"""
|
||||
if mode == 1:
|
||||
self.communicate('W IN')
|
||||
self.communicate('W EX')
|
||||
@ -113,7 +150,7 @@ class TemperatureLoop(HasIO, HasConvergence, Drivable):
|
||||
|
||||
@Command
|
||||
def clear_errors(self):
|
||||
""" Reset after error"""
|
||||
""" Reset after error. Otherwise the status will not be updated"""
|
||||
if self.read_status()[0] == ERROR:
|
||||
try:
|
||||
self.communicate('ER')
|
||||
|
@ -1,158 +0,0 @@
|
||||
# *****************************************************************************
|
||||
#
|
||||
# This program is free software; you can redistribute it and/or modify it under
|
||||
# the terms of the GNU General Public License as published by the Free Software
|
||||
# Foundation; either version 2 of the License, or (at your option) any later
|
||||
# version.
|
||||
#
|
||||
# This program is distributed in the hope that it will be useful, but WITHOUT
|
||||
# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
|
||||
# FOR A PARTICULAR PURPOSE. See the GNU General Public License for more
|
||||
# details.
|
||||
#
|
||||
# You should have received a copy of the GNU General Public License along with
|
||||
# this program; if not, write to the Free Software Foundation, Inc.,
|
||||
# 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
||||
#
|
||||
# Module authors:
|
||||
# Andrea Plank <andrea.plank@psi.ch>
|
||||
# Markus Zolliker <markus.zolliker@psi.ch>
|
||||
#
|
||||
# *****************************************************************************
|
||||
import sys
|
||||
import time
|
||||
from ast import literal_eval
|
||||
from threading import RLock
|
||||
import snap7
|
||||
from frappy.core import Readable, Parameter, FloatRange, HasIO, StringIO, Property, StringType,IDLE, BUSY, WARN, ERROR,Writable, Drivable, BoolType, IntRange, Communicator
|
||||
from frappy.errors import CommunicationFailedError
|
||||
|
||||
|
||||
class IO(Communicator):
|
||||
tcap_client = Property('tcap_client', IntRange())
|
||||
tsap_server = Property('tcap_server', IntRange())
|
||||
ip_address = Property('numeric ip address', StringType())
|
||||
_plc = None
|
||||
_last_try = 0
|
||||
|
||||
def initModule(self):
|
||||
self._lock = RLock()
|
||||
super().initModule()
|
||||
|
||||
def _init(self):
|
||||
if not self._plc:
|
||||
if time.time() < self._last_try + 10:
|
||||
raise CommunicationFailedError('logo PLC not reachable')
|
||||
self._plc = snap7.logo.Logo()
|
||||
prev_stderr = sys.stdout
|
||||
sys.stderr = open('/dev/null', 'w') # suppress output of snap7
|
||||
try:
|
||||
self._plc.connect(self.ip_address, self.tcap_client, self.tsap_server)
|
||||
if self._plc.get_connected():
|
||||
return
|
||||
except Exception:
|
||||
pass
|
||||
finally:
|
||||
sys.stderr = prev_stderr
|
||||
self._plc = None
|
||||
self._last_try = time.time()
|
||||
raise CommunicationFailedError('logo PLC not reachable')
|
||||
|
||||
def communicate(self, cmd):
|
||||
with self._lock:
|
||||
self._init()
|
||||
cmd = cmd.split(maxsplit=1)
|
||||
if len(cmd) == 2:
|
||||
self._plc.write(cmd[0], literal_eval(cmd[1]))
|
||||
try:
|
||||
return self._plc.read(cmd[0])
|
||||
except Exception as e:
|
||||
if self._plc:
|
||||
self.log.exception('error in plc read')
|
||||
self._plc = None
|
||||
raise
|
||||
|
||||
|
||||
class Snap7Mixin(HasIO):
|
||||
ioclass = IO
|
||||
|
||||
def get_vm_value(self, vm_address):
|
||||
return self.io.communicate(vm_address)
|
||||
|
||||
|
||||
def set_vm_value(self, vm_address, value):
|
||||
return self.io.communicate(f'{vm_address} {value}')
|
||||
|
||||
|
||||
class Pressure(Snap7Mixin, Readable):
|
||||
vm_address = Property('VM address', datatype= StringType())
|
||||
value = Parameter('pressure', datatype = FloatRange(unit = 'mbar'))
|
||||
|
||||
pollinterval = 0.5
|
||||
|
||||
def read_value(self):
|
||||
return self.get_vm_value(self.vm_address)
|
||||
|
||||
def read_status(self):
|
||||
return IDLE, ''
|
||||
|
||||
|
||||
class Valve(Snap7Mixin, Drivable):
|
||||
vm_address_input = Property('VM address input', datatype= StringType())
|
||||
vm_address_output = Property('VM address output', datatype= StringType())
|
||||
|
||||
target = Parameter('Valve target', datatype = BoolType())
|
||||
value = Parameter('Value state', datatype = BoolType())
|
||||
|
||||
|
||||
def read_value(self):
|
||||
return self.get_vm_value(self.vm_address_input)
|
||||
|
||||
def write_target(self, target):
|
||||
return self.set_vm_value(self.vm_address_output, target)
|
||||
|
||||
def read_status(self):
|
||||
return IDLE, ''
|
||||
|
||||
|
||||
class FluidMachines(Snap7Mixin, Drivable):
|
||||
vm_address_output = Property('VM address output', datatype= StringType())
|
||||
|
||||
target = Parameter('Valve target', datatype = BoolType())
|
||||
value = Parameter('Value state', datatype = BoolType())
|
||||
|
||||
def read_value(self):
|
||||
return self.get_vm_value(self.vm_address_output)
|
||||
|
||||
def write_target(self, target):
|
||||
return self.set_vm_value(self.vm_address_output, target)
|
||||
|
||||
def read_status(self):
|
||||
return IDLE, ''
|
||||
|
||||
|
||||
class TempSensor(Snap7Mixin, Readable):
|
||||
vm_address = Property('VM address', datatype= StringType())
|
||||
value = Parameter('resistance', datatype = FloatRange(unit = 'Ohm'))
|
||||
|
||||
def read_value(self):
|
||||
return self.get_vm_value(self.vm_address)
|
||||
|
||||
def read_status(self):
|
||||
return IDLE, ''
|
||||
|
||||
|
||||
class HeaterParam(Snap7Mixin, Writable):
|
||||
vm_address = Property('VM address output', datatype= StringType())
|
||||
|
||||
target = Parameter('Heater target', datatype = FloatRange(unit='%'))
|
||||
value = Parameter('Heater Param', datatype = FloatRange(unit='%'))
|
||||
|
||||
def read_value(self):
|
||||
return self.get_vm_value(self.vm_address) * 0.1
|
||||
|
||||
def write_target(self, target):
|
||||
return self.set_vm_value(self.vm_address, round(target * 10)) * 0.1
|
||||
|
||||
def read_status(self):
|
||||
return IDLE, ''
|
@ -231,17 +231,14 @@ class ResChannel(Channel):
|
||||
def _read_value(self):
|
||||
"""read value, without update"""
|
||||
now = time.monotonic()
|
||||
if now - 0.5 < max(self._last_range_change, self.switcher._start_switch) + self.pause:
|
||||
if now + 0.5 < max(self._last_range_change, self.switcher._start_switch) + self.pause:
|
||||
return None
|
||||
result = float(self.communicate('RDGR?%d' % self.channel))
|
||||
if result == 0:
|
||||
if self.autorange:
|
||||
rng = int(max(self.minrange, self.range)) # convert from enum to int
|
||||
self.write_range(min(self.MAX_RNG, rng + 1))
|
||||
return None
|
||||
if self.autorange:
|
||||
self.fix_autorange()
|
||||
if now - 0.5 > self._last_range_change + self.pause:
|
||||
if now + 0.5 > self._last_range_change + self.pause:
|
||||
rng = int(max(self.minrange, self.range)) # convert from enum to int
|
||||
if self.status[0] < self.Status.ERROR:
|
||||
if abs(result) > self.RES_SCALE[rng]:
|
||||
@ -254,10 +251,8 @@ class ResChannel(Channel):
|
||||
lim -= 0.05 # not more than 4 steps at once
|
||||
# effectively: <0.16 %: 4 steps, <1%: 3 steps, <5%: 2 steps, <20%: 1 step
|
||||
elif rng < self.MAX_RNG:
|
||||
self.log.debug('increase range due to error %d', rng)
|
||||
rng = min(self.MAX_RNG, rng + 1)
|
||||
if rng != self.range:
|
||||
self.log.debug('range change to %d', rng)
|
||||
self.write_range(rng)
|
||||
self._last_range_change = now
|
||||
return result
|
||||
@ -386,10 +381,6 @@ class TemperatureLoop(HasConvergence, TemperatureChannel, Drivable):
|
||||
htrrng = Parameter('', EnumType(HTRRNG), readonly=False)
|
||||
_control_active = False
|
||||
|
||||
def doPoll(self):
|
||||
super().doPoll()
|
||||
self.set_htrrng()
|
||||
|
||||
@Command
|
||||
def control_off(self):
|
||||
"""switch control off"""
|
||||
|
@ -120,7 +120,7 @@ class SimpleMagfield(HasStates, Drivable):
|
||||
return last
|
||||
|
||||
def write_target(self, target):
|
||||
self.start_machine(self.start_field_change, target=target, try_cnt=0)
|
||||
self.start_machine(self.start_field_change, target=target)
|
||||
return target
|
||||
|
||||
def init_progress(self, sm, value):
|
||||
|
@ -63,7 +63,6 @@ fast_slow = Mapped(ON=0, OFF=1) # maps OIs slow=ON/fast=OFF to sample_rate.slow
|
||||
|
||||
class IO(StringIO):
|
||||
identification = [('*IDN?', r'IDN:OXFORD INSTRUMENTS:*')]
|
||||
timeout = 5
|
||||
|
||||
|
||||
class MercuryChannel(HasIO):
|
||||
|
@ -198,10 +198,6 @@ class MotorValve(PersistentMixin, Drivable):
|
||||
|
||||
@Command
|
||||
def stop(self):
|
||||
"""stop at current position
|
||||
|
||||
state will probably be undefined
|
||||
"""
|
||||
self._state.stop()
|
||||
self.motor.stop()
|
||||
|
||||
|
@ -22,7 +22,7 @@
|
||||
"""modules to access parameters"""
|
||||
|
||||
from frappy.core import Drivable, EnumType, IDLE, Attached, StringType, Property, \
|
||||
Parameter, BoolType, FloatRange, Readable, ERROR, nopoll
|
||||
Parameter, FloatRange, Readable, ERROR
|
||||
from frappy.errors import ConfigError
|
||||
from frappy_psi.convergence import HasConvergence
|
||||
from frappy_psi.mixins import HasRamp
|
||||
@ -59,12 +59,8 @@ class Driv(Drivable):
|
||||
read = Attached(description='<module>.<parameter> for read')
|
||||
write = Attached(description='<module>.<parameter> for read')
|
||||
unit = Property('main unit', StringType())
|
||||
__error = None
|
||||
__status = None
|
||||
|
||||
def setProperty(self, key, value):
|
||||
# split properties read/write (including .<param>)
|
||||
# into read/write (modules) and read_param/write_param (parameters)
|
||||
if key in ('read', 'write'):
|
||||
value, param = value.split('.')
|
||||
setattr(self, f'{key}_param', param)
|
||||
@ -76,44 +72,22 @@ class Driv(Drivable):
|
||||
raise ConfigError('illegal recursive read/write module')
|
||||
super().checkProperties()
|
||||
|
||||
def registerUpdates(self):
|
||||
if self.read_param == 'value':
|
||||
try:
|
||||
self.read.addCallback('status', self.updateReadStatus)
|
||||
except KeyError:
|
||||
pass # may be not needed: value is present but not status
|
||||
self.read.addCallback(self.read_param, self.updateValue)
|
||||
self.write.addCallback(self.write_param, self.announceUpdate, 'target')
|
||||
#def registerUpdates(self):
|
||||
# self.read.valueCallbacks[self.read_param].append(self.update_value)
|
||||
# self.write.valueCallbacks[self.write_param].append(self.update_target)
|
||||
#
|
||||
#def startModule(self, start_events):
|
||||
# start_events.queue(self.registerUpdates)
|
||||
# super().startModule(start_events)
|
||||
|
||||
def updateReadStatus(self, status, err=None):
|
||||
self.__status = status
|
||||
self.read_status()
|
||||
|
||||
def updateValue(self, value, err=None):
|
||||
self.announceUpdate('value', value, err)
|
||||
if err != self.__error:
|
||||
self.__error = err
|
||||
self.read_status()
|
||||
|
||||
def startModule(self, start_events):
|
||||
start_events.queue(self.registerUpdates)
|
||||
super().startModule(start_events)
|
||||
|
||||
@nopoll
|
||||
def read_value(self):
|
||||
return getattr(self.read, f'read_{self.read_param}')()
|
||||
return getattr(self.read, f'{self.read_param}')
|
||||
|
||||
@nopoll
|
||||
def read_target(self):
|
||||
return getattr(self.write, f'read_{self.write_param}')()
|
||||
return getattr(self.write, f'{self.write_param}')
|
||||
|
||||
@nopoll
|
||||
def read_status(self):
|
||||
if self.__status:
|
||||
if self.__status[0] < ERROR and self.__error:
|
||||
return ERROR, repr(self.__error)
|
||||
return self.__status
|
||||
return (ERROR, repr(self.__error)) if self.__error else (IDLE, '')
|
||||
return IDLE, ''
|
||||
|
||||
def write_target(self, target):
|
||||
return getattr(self.write, f'write_{self.write_param}')(target)
|
||||
@ -127,6 +101,19 @@ class Converging(HasConvergence, Driv):
|
||||
self.parameters['tolerance'].setProperty('unit', self.unit)
|
||||
super().checkProperties()
|
||||
|
||||
#def update_value(self, value):
|
||||
# print('UV', value)
|
||||
# self.value = value
|
||||
|
||||
#def error_update_value(self, err):
|
||||
# raise err
|
||||
|
||||
#def update_target(self, value):
|
||||
# self.target = value
|
||||
|
||||
#def error_update_target(self, err):
|
||||
# raise err
|
||||
|
||||
def write_target(self, target):
|
||||
self.convergence_start()
|
||||
return super().write_target(target)
|
||||
@ -143,7 +130,7 @@ def set_enabled(modobj, value):
|
||||
|
||||
|
||||
def get_value(obj, default):
|
||||
"""get the value of given module. if not valid, return the default"""
|
||||
"""get the value of given module. if not valid, return the limit (min_high or max_low)"""
|
||||
if not getattr(obj, 'enabled', True):
|
||||
return default
|
||||
# consider also that a value 0 is invalid
|
||||
@ -161,61 +148,51 @@ class SwitchDriv(HasConvergence, Drivable):
|
||||
max_low = Parameter('maximum low target', FloatRange(unit='$'), readonly=False)
|
||||
# disable_other = Parameter('whether to disable unused channel', BoolType(), readonly=False)
|
||||
selected = Parameter('selected module', EnumType(low=LOW, high=HIGH), readonly=False, default=0)
|
||||
autoswitch = Parameter('switch sensor automatically', BoolType(), readonly=False, default=True)
|
||||
_switch_target = None # if not None, switch to selection when mid range is reached
|
||||
_switch_target = None # if not None, switch to selection mhen mid range is reached
|
||||
|
||||
# TODO: copy units from attached module
|
||||
# TODO: callbacks for updates
|
||||
|
||||
def doPoll(self):
|
||||
super().doPoll()
|
||||
if self._switch_target is not None:
|
||||
mid = (self.min_high + self.max_low) * 0.5
|
||||
if self._switch_target == HIGH:
|
||||
low = get_value(self.low, mid) # returns mid when low is invalid
|
||||
if low > mid:
|
||||
self.value = self.low.value
|
||||
self._switch_target = None
|
||||
self.write_target(self.target)
|
||||
return
|
||||
else:
|
||||
high = get_value(self.high, mid) # return mid when high is invalid
|
||||
if high < mid: # change to self.max_low
|
||||
self.value = self.high.value
|
||||
self._switch_target = None
|
||||
self.write_target(self.target)
|
||||
return
|
||||
if not self.isBusy() and self.autoswitch:
|
||||
if self.isBusy():
|
||||
if self._switch_target is not None:
|
||||
mid = (self.min_high + self.max_low) * 0.5
|
||||
if self._switch_target == HIGH:
|
||||
low = get_value(self.low, mid) # returns mid when low is invalid
|
||||
if low > mid:
|
||||
self.value = self.low.value
|
||||
self._switch_target = None
|
||||
self.write_target(self.target)
|
||||
return
|
||||
else:
|
||||
high = get_value(self.high, mid) # return mid then high is invalid
|
||||
if high < mid:
|
||||
self.value = self.high.value
|
||||
self._switch_target = None
|
||||
self.write_target(self.target)
|
||||
return
|
||||
else:
|
||||
low = get_value(self.low, self.max_low)
|
||||
high = get_value(self.high, self.min_high)
|
||||
low_valid = low < self.max_low
|
||||
high_valid = high > self.min_high
|
||||
if high_valid and high > self.max_low:
|
||||
if not low_valid and not self.low.control_active:
|
||||
if not low_valid:
|
||||
set_enabled(self.low, False)
|
||||
return
|
||||
if low_valid and low < self.min_high:
|
||||
if not high_valid and not self.high.control_active:
|
||||
if not high_valid:
|
||||
set_enabled(self.high, False)
|
||||
return
|
||||
# keep only one channel on
|
||||
#set_enabled(self.low, True)
|
||||
#set_enabled(self.high, True)
|
||||
|
||||
def get_selected(self):
|
||||
low = get_value(self.low, self.max_low)
|
||||
high = get_value(self.high, self.min_high)
|
||||
if low < self.min_high:
|
||||
return 0
|
||||
if high > self.max_low:
|
||||
return 1
|
||||
return self.selected
|
||||
set_enabled(self.low, True)
|
||||
set_enabled(self.high, True)
|
||||
|
||||
def read_value(self):
|
||||
return self.low.value if self.get_selected() == LOW else self.high.value
|
||||
return self.low.value if self.selected == LOW else self.high.value
|
||||
|
||||
def read_status(self):
|
||||
status = self.low.status if self.get_selected() == LOW else self.high.status
|
||||
status = self.low.status if self.selected == LOW else self.high.status
|
||||
if status[0] >= ERROR:
|
||||
return status
|
||||
return super().read_status() # convergence status
|
||||
@ -225,23 +202,22 @@ class SwitchDriv(HasConvergence, Drivable):
|
||||
selected = self.selected
|
||||
target1 = target
|
||||
self._switch_target = None
|
||||
if target > self.max_low * 0.75 + self.min_high * 0.25:
|
||||
if target > self.max_low:
|
||||
if self.value < self.min_high:
|
||||
target1 = min(target, self.max_low)
|
||||
target1 = self.max_low
|
||||
self._switch_target = HIGH
|
||||
selected = LOW
|
||||
else:
|
||||
this, other = other, this
|
||||
selected = HIGH
|
||||
elif target < self.min_high * 0.75 + self.max_low * 0.25:
|
||||
# reinstall this with higher threshold (e.g. 4 K)?
|
||||
#if self.value > self.max_low:
|
||||
# target1 = max(self.min_high, target)
|
||||
# self._switch_target = LOW
|
||||
# this, other = other, this
|
||||
# selected = HIGH
|
||||
#else:
|
||||
selected = LOW
|
||||
elif target < self.min_high:
|
||||
if self.value > self.max_low:
|
||||
target1 = self.min_high
|
||||
self._switch_target = LOW
|
||||
this, other = other, this
|
||||
selected = HIGH
|
||||
else:
|
||||
selected = LOW
|
||||
elif self.selected == HIGH:
|
||||
this, other = other, this
|
||||
if hasattr(other, 'control_off'):
|
||||
|
@ -483,10 +483,6 @@ class Temp(PpmsDrivable):
|
||||
self._expected_target_time = time.time() + abs(target - self.value) * 60.0 / max(0.1, ramp)
|
||||
|
||||
def stop(self):
|
||||
"""set setpoint to current value
|
||||
|
||||
but restrict to values between last target and current target
|
||||
"""
|
||||
if not self.isDriving():
|
||||
return
|
||||
if self.status[0] != StatusType.STABILIZING:
|
||||
@ -616,7 +612,6 @@ class Field(PpmsDrivable):
|
||||
# do not execute FIELD command, as this would trigger a ramp up of leads current
|
||||
|
||||
def stop(self):
|
||||
"""stop at current driven Field"""
|
||||
if not self.isDriving():
|
||||
return
|
||||
newtarget = clamp(self._last_target, self.value, self.target)
|
||||
@ -719,7 +714,6 @@ class Position(PpmsDrivable):
|
||||
return value # do not execute MOVE command, as this would trigger an unnecessary move
|
||||
|
||||
def stop(self):
|
||||
"""stop motor"""
|
||||
if not self.isDriving():
|
||||
return
|
||||
newtarget = clamp(self._last_target, self.value, self.target)
|
||||
|
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user