Merge branch 'wip' of gitlab.psi.ch-samenv:samenv/frappy into wip

This commit is contained in:
2023-08-10 14:35:03 +02:00
27 changed files with 195 additions and 132 deletions

View File

@@ -1,18 +1,16 @@
Node('cfg/sea/camea-be-filter.cfg', Node('cfg/sea/camea-be-filter.cfg',
'Camea Be-Filter', 'Camea Be-Filter',
interface='5000',
name='camea-be-filter',
) )
Mod('sea_addons', Mod('sea_addons',
'secop_psi.sea.SeaClient', 'frappy_psi.sea.SeaClient',
'addons sea connection for camea-be-filter.addon', 'addons sea connection for camea-be-filter.addon',
config='camea-be-filter.addon', config='camea-be-filter.addon',
service='addons', service='addons',
) )
Mod('t_be_filter', Mod('t_be_filter',
'secop_psi.sea.SeaReadable', 'frappy_psi.sea.SeaReadable',
io='sea_addons', io='sea_addons',
sea_object='t_be_filter', sea_object='t_be_filter',
) )

View File

@@ -1,39 +1,37 @@
Node('cfg/main/ccrpe.cfg', Node('cfg/main/ccrpe.cfg',
'4 K closed cycle cryostat (PE cell)', '4 K closed cycle cryostat (PE cell)',
interface='5000',
name='ccrpe',
) )
Mod('sea_main', Mod('sea_main',
'secop_psi.sea.SeaClient', 'frappy_psi.sea.SeaClient',
'main sea connection for ccrpe.config', 'main sea connection for ccrpe.config',
config='ccrpe.config', config='ccrpe.config',
service='main', service='main',
) )
Mod('tt', Mod('tt',
'secop_psi.sea.SeaDrivable', '', 'frappy_psi.sea.SeaDrivable', '',
io='sea_main', io='sea_main',
sea_object='tt', sea_object='tt',
rel_paths=['.', 'tm'], rel_paths=['.', 'tm'],
) )
Mod('ts', Mod('ts',
'secop_psi.sea.SeaReadable', '', 'frappy_psi.sea.SeaReadable', '',
io='sea_main', io='sea_main',
sea_object='tt', sea_object='tt',
rel_paths=['ts'], rel_paths=['ts'],
) )
Mod('te', Mod('te',
'secop_psi.sea.SeaReadable', '', 'frappy_psi.sea.SeaReadable', '',
io='sea_main', io='sea_main',
sea_object='tt', sea_object='tt',
rel_paths=['te'], rel_paths=['te'],
) )
Mod('warmup', Mod('warmup',
'secop_psi.sea.SeaDrivable', '', 'frappy_psi.sea.SeaDrivable', '',
io='sea_main', io='sea_main',
sea_object='warmup', sea_object='warmup',
) )

View File

@@ -1,39 +1,37 @@
Node('cfg/main/ccrpe_lowT.cfg', Node('cfg/main/ccrpe_lowT.cfg',
'4 K closed cycle cryostat (PE cell)', '4 K closed cycle cryostat (PE cell)',
interface='5000',
name='ccrpe_lowT',
) )
Mod('sea_main', Mod('sea_main',
'secop_psi.sea.SeaClient', 'frappy_psi.sea.SeaClient',
'main sea connection for ccrpe_lowT.config', 'main sea connection for ccrpe_lowT.config',
config='ccrpe_lowT.config', config='ccrpe_lowT.config',
service='main', service='main',
) )
Mod('tt', Mod('tt',
'secop_psi.sea.SeaDrivable', '', 'frappy_psi.sea.SeaDrivable', '',
io='sea_main', io='sea_main',
sea_object='tt', sea_object='tt',
rel_paths=['.', 'tm'], rel_paths=['.', 'tm'],
) )
Mod('ts', Mod('ts',
'secop_psi.sea.SeaReadable', '', 'frappy_psi.sea.SeaReadable', '',
io='sea_main', io='sea_main',
sea_object='tt', sea_object='tt',
rel_paths=['ts'], rel_paths=['ts'],
) )
Mod('te', Mod('te',
'secop_psi.sea.SeaReadable', '', 'frappy_psi.sea.SeaReadable', '',
io='sea_main', io='sea_main',
sea_object='tt', sea_object='tt',
rel_paths=['te'], rel_paths=['te'],
) )
Mod('warmup', Mod('warmup',
'secop_psi.sea.SeaDrivable', '', 'frappy_psi.sea.SeaDrivable', '',
io='sea_main', io='sea_main',
sea_object='warmup', sea_object='warmup',
) )

View File

@@ -1,6 +1,5 @@
Node('cyrosim.psi.ch', Node('cyrosim.psi.ch',
'cryo simulation (similar ppms simulation)', 'cryo simulation (similar ppms simulation)',
interface='tcp://5000',
) )
Mod('tt', Mod('tt',

View File

@@ -12,7 +12,7 @@ Mod('th',
meaning = ('temperature', 10), meaning = ('temperature', 10),
io = 'sea_main', io = 'sea_main',
sea_object = 'th', sea_object = 'th',
extra_modules='t2', extra_modules=['t2'],
) )
Mod('ts', Mod('ts',
'frappy_psi.sea.SeaReadable', '', 'frappy_psi.sea.SeaReadable', '',

View File

@@ -1,24 +1,22 @@
Node('cfg/main/ill3.cfg', Node('cfg/main/ill3.cfg',
'orange cryofurnace with 70 mm sample space (low T)', 'orange cryofurnace with 70 mm sample space (low T)',
interface='5000',
name='ill3',
) )
Mod('sea_main', Mod('sea_main',
'secop_psi.sea.SeaClient', 'frappy_psi.sea.SeaClient',
'main sea connection for ill3.config', 'main sea connection for ill3.config',
config='ill3.config', config='ill3.config',
service='main', service='main',
) )
Mod('tt', Mod('tt',
'secop_psi.sea.SeaDrivable', '', 'frappy_psi.sea.SeaDrivable', '',
io='sea_main', io='sea_main',
sea_object='tt', sea_object='tt',
) )
Mod('cc', Mod('cc',
'secop_psi.sea.SeaReadable', '', 'frappy_psi.sea.SeaReadable', '',
io='sea_main', io='sea_main',
sea_object='cc', sea_object='cc',
extra_modules=['h'], extra_modules=['h'],
@@ -26,49 +24,49 @@ Mod('cc',
) )
Mod('lev', Mod('lev',
'secop_psi.sea.SeaReadable', '', 'frappy_psi.sea.SeaReadable', '',
io='sea_main', io='sea_main',
single_module='cc.h', single_module='cc.h',
) )
Mod('nv', Mod('nv',
'secop_psi.sea.SeaWritable', '', 'frappy_psi.sea.SeaWritable', '',
io='sea_main', io='sea_main',
sea_object='nv', sea_object='nv',
) )
Mod('ln2fill', Mod('ln2fill',
'secop_psi.sea.SeaWritable', '', 'frappy_psi.sea.SeaWritable', '',
io='sea_main', io='sea_main',
sea_object='ln2fill', sea_object='ln2fill',
) )
Mod('hefill', Mod('hefill',
'secop_psi.sea.SeaWritable', '', 'frappy_psi.sea.SeaWritable', '',
io='sea_main', io='sea_main',
sea_object='hefill', sea_object='hefill',
) )
Mod('hepump', Mod('hepump',
'secop_psi.sea.SeaWritable', '', 'frappy_psi.sea.SeaWritable', '',
io='sea_main', io='sea_main',
sea_object='hepump', sea_object='hepump',
) )
Mod('hemot', Mod('hemot',
'secop_psi.sea.SeaDrivable', '', 'frappy_psi.sea.SeaDrivable', '',
io='sea_main', io='sea_main',
sea_object='hemot', sea_object='hemot',
) )
Mod('nvflow', Mod('nvflow',
'secop_psi.sea.SeaReadable', '', 'frappy_psi.sea.SeaReadable', '',
io='sea_main', io='sea_main',
sea_object='nvflow', sea_object='nvflow',
) )
Mod('table', Mod('table',
'secop_psi.sea.SeaReadable', '', 'frappy_psi.sea.SeaReadable', '',
io='sea_main', io='sea_main',
sea_object='table', sea_object='table',
) )

View File

@@ -1,104 +1,102 @@
Node('cfg/main/ma7two.cfg', Node('cfg/main/ma7two.cfg',
'6.8 Tesla horizontal cryomagnet with two heater loops', '6.8 Tesla horizontal cryomagnet with two heater loops',
interface='5000',
name='ma7two',
) )
Mod('sea_main', Mod('sea_main',
'secop_psi.sea.SeaClient', 'frappy_psi.sea.SeaClient',
'main sea connection for ma7two.config', 'main sea connection for ma7two.config',
config='ma7two.config', config='ma7two.config',
service='main', service='main',
) )
Mod('tt', Mod('tt',
'secop_psi.sea.SeaDrivable', '', 'frappy_psi.sea.SeaDrivable', '',
io='sea_main', io='sea_main',
sea_object='tt', sea_object='tt',
) )
Mod('cc', Mod('cc',
'secop_psi.sea.SeaReadable', '', 'frappy_psi.sea.SeaReadable', '',
io='sea_main', io='sea_main',
sea_object='cc', sea_object='cc',
) )
Mod('nv', Mod('nv',
'secop_psi.sea.SeaWritable', '', 'frappy_psi.sea.SeaWritable', '',
io='sea_main', io='sea_main',
sea_object='nv', sea_object='nv',
) )
Mod('hefill', Mod('hefill',
'secop_psi.sea.SeaWritable', '', 'frappy_psi.sea.SeaWritable', '',
io='sea_main', io='sea_main',
sea_object='hefill', sea_object='hefill',
) )
Mod('hepump', Mod('hepump',
'secop_psi.sea.SeaWritable', '', 'frappy_psi.sea.SeaWritable', '',
io='sea_main', io='sea_main',
sea_object='hepump', sea_object='hepump',
) )
Mod('hemot', Mod('hemot',
'secop_psi.sea.SeaDrivable', '', 'frappy_psi.sea.SeaDrivable', '',
io='sea_main', io='sea_main',
sea_object='hemot', sea_object='hemot',
) )
Mod('nvflow', Mod('nvflow',
'secop_psi.sea.SeaReadable', '', 'frappy_psi.sea.SeaReadable', '',
io='sea_main', io='sea_main',
sea_object='nvflow', sea_object='nvflow',
) )
Mod('ln2fill', Mod('ln2fill',
'secop_psi.sea.SeaWritable', '', 'frappy_psi.sea.SeaWritable', '',
io='sea_main', io='sea_main',
sea_object='ln2fill', sea_object='ln2fill',
) )
Mod('mf', Mod('mf',
'secop_psi.sea.SeaReadable', '', 'frappy_psi.sea.SeaReadable', '',
io='sea_main', io='sea_main',
sea_object='mf', sea_object='mf',
) )
Mod('lev', Mod('lev',
'secop_psi.sea.SeaReadable', '', 'frappy_psi.sea.SeaReadable', '',
io='sea_main', io='sea_main',
sea_object='lev', sea_object='lev',
) )
Mod('tcoil1', Mod('tcoil1',
'secop_psi.sea.SeaReadable', '', 'frappy_psi.sea.SeaReadable', '',
io='sea_main', io='sea_main',
sea_object='tcoil', sea_object='tcoil',
rel_paths=['ta'], rel_paths=['ta'],
) )
Mod('tcoil2', Mod('tcoil2',
'secop_psi.sea.SeaReadable', '', 'frappy_psi.sea.SeaReadable', '',
io='sea_main', io='sea_main',
sea_object='tcoil', sea_object='tcoil',
rel_paths=['tb'], rel_paths=['tb'],
) )
Mod('table', Mod('table',
'secop_psi.sea.SeaReadable', '', 'frappy_psi.sea.SeaReadable', '',
io='sea_main', io='sea_main',
sea_object='table', sea_object='table',
) )
Mod('om_io', Mod('om_io',
'secop_psi.phytron.PhytronIO', 'frappy_psi.phytron.PhytronIO',
'dom motor IO', 'dom motor IO',
uri='ma7-ts.psi.ch:3007', uri='ma7-ts.psi.ch:3007',
) )
Mod('om', Mod('om',
'secop_psi.phytron.Motor', 'frappy_psi.phytron.Motor',
'stick rotation', 'stick rotation',
io='om_io', io='om_io',
encoder_mode='CHECK', encoder_mode='CHECK',

View File

@@ -1,6 +1,5 @@
Node('magsim.psi.ch', Node('magsim.psi.ch',
'cryo magnet simulation (similar to ppms simulation)', 'cryo magnet simulation (similar to ppms simulation)',
interface='tcp://5000',
) )
Mod('tt', Mod('tt',

View File

@@ -1,6 +1,5 @@
Node('mb11.psi.ch', Node('mb11.psi.ch',
'MB11 11 Tesla - 100 mm cryomagnet', 'MB11 11 Tesla - 100 mm cryomagnet',
interface='tcp://5000',
) )
Mod('itc1', Mod('itc1',

View File

@@ -1,6 +1,5 @@
Node('mb11.psi.ch', Node('mb11.psi.ch',
'MB11 11 Tesla - 100 mm cryomagnet', 'MB11 11 Tesla - 100 mm cryomagnet',
interface='tcp://5000',
) )
Mod('itc1', Mod('itc1',

View File

@@ -1,18 +1,16 @@
Node('cfg/main/rt.cfg', Node('cfg/main/rt.cfg',
'room temperature HRPT (pt1000)', 'room temperature HRPT (pt1000)',
interface='5000',
name='rt',
) )
Mod('sea_main', Mod('sea_main',
'secop_psi.sea.SeaClient', 'frappy_psi.sea.SeaClient',
'main sea connection for rt.config', 'main sea connection for rt.config',
config='rt.config', config='rt.config',
service='main', service='main',
) )
Mod('tt', Mod('tt',
'secop_psi.sea.SeaDrivable', '', 'frappy_psi.sea.SeaDrivable', '',
sea_object='tt', sea_object='tt',
io='sea_main', io='sea_main',
) )

View File

@@ -0,0 +1,12 @@
{"hcp": {"base": "/hcp", "params": [
{"path": "", "type": "float", "kids": 10},
{"path": "send", "type": "text", "readonly": false, "cmd": "hcp send", "visibility": 3},
{"path": "status", "type": "text", "visibility": 3},
{"path": "set", "type": "float", "readonly": false, "cmd": "hcp set"},
{"path": "on", "type": "bool", "readonly": false, "cmd": "hcp on"},
{"path": "setcurrent", "type": "float", "readonly": false, "cmd": "hcp setcurrent"},
{"path": "ramp", "type": "float", "readonly": false, "cmd": "hcp ramp"},
{"path": "rampmode", "type": "enum", "enum": {"no ramp": 0, "always ramp": 1, "ramp up only": 2}, "readonly": false, "cmd": "hcp rampmode"},
{"path": "workset", "type": "float"},
{"path": "current", "type": "float"},
{"path": "currentlimit", "type": "float", "readonly": false, "cmd": "hcp currentlimit"}]}}

View File

@@ -1,7 +1,9 @@
{"tt": {"base": "/tt", "params": [{"path": "", "type": "float", "readonly": false, "cmd": "run tt", "description": "tt", "kids": 18}, {"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": "send", "type": "text", "readonly": false, "cmd": "tt send", "visibility": 3},
{"path": "status", "type": "text", "visibility": 3}, {"path": "status", "type": "text", "visibility": 3},
{"path": "is_running", "type": "int", "readonly": false, "cmd": "tt is_running", "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": "target", "type": "float"},
{"path": "running", "type": "int"}, {"path": "running", "type": "int"},
{"path": "tolerance", "type": "float", "readonly": false, "cmd": "tt tolerance"}, {"path": "tolerance", "type": "float", "readonly": false, "cmd": "tt tolerance"},
@@ -59,10 +61,30 @@
{"path": "set/prop", "type": "float", "readonly": false, "cmd": "tt set/prop", "description": "bigger means more gain"}, {"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/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": "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": "display", "type": "text", "readonly": false, "cmd": "tt display"},
{"path": "dout", "type": "int", "readonly": false, "cmd": "tt dout"}, {"path": "remote", "type": "bool"}]},
{"path": "dinp", "type": "int"},
{"path": "remote", "type": "bool"}]}, "cc": {"base": "/cc", "params": [{"path": "", "type": "bool", "kids": 96}, "cc": {"base": "/cc", "params": [
{"path": "", "type": "bool", "kids": 96},
{"path": "send", "type": "text", "readonly": false, "cmd": "cc send", "visibility": 3}, {"path": "send", "type": "text", "readonly": false, "cmd": "cc send", "visibility": 3},
{"path": "status", "type": "text", "visibility": 3}, {"path": "status", "type": "text", "visibility": 3},
{"path": "autodevice", "type": "bool", "readonly": false, "cmd": "cc autodevice"}, {"path": "autodevice", "type": "bool", "readonly": false, "cmd": "cc autodevice"},
@@ -110,7 +132,7 @@
{"path": "hms", "type": "float"}, {"path": "hms", "type": "float"},
{"path": "hit", "type": "float", "readonly": false, "cmd": "cc hit"}, {"path": "hit", "type": "float", "readonly": false, "cmd": "cc hit"},
{"path": "hft", "type": "int", "readonly": false, "cmd": "cc hft"}, {"path": "hft", "type": "int", "readonly": false, "cmd": "cc hft"},
{"path": "hea", "type": "enum", "enum": {"0": 0, "1": 1, "6": 2}, "readonly": false, "cmd": "cc hea"}, {"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": "hch", "type": "int", "readonly": false, "cmd": "cc hch"},
{"path": "hwr0", "type": "float", "readonly": false, "cmd": "cc hwr0"}, {"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": "hem0", "type": "float", "readonly": false, "cmd": "cc hem0", "description": "sensor length in mm from top to empty pos."},
@@ -158,7 +180,10 @@
{"path": "tm", "type": "float", "visibility": 3}, {"path": "tm", "type": "float", "visibility": 3},
{"path": "tv", "type": "float", "visibility": 3}, {"path": "tv", "type": "float", "visibility": 3},
{"path": "tq", "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": "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": "send", "type": "text", "readonly": false, "cmd": "nv send", "visibility": 3},
{"path": "status", "type": "text", "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": "motstat", "type": "enum", "enum": {"idle": 0, "opening": 1, "closing": 2, "opened": 3, "closed": 4, "no_motor": 5}},
@@ -208,7 +233,10 @@
{"path": "autoflow/flowtarget", "type": "float"}, {"path": "autoflow/flowtarget", "type": "float"},
{"path": "calib", "type": "none", "kids": 2}, {"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/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, "fill": 1, "inactive": 2}, "readonly": false, "cmd": "hefill", "kids": 16}, {"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": "send", "type": "text", "readonly": false, "cmd": "hefill send", "visibility": 3},
{"path": "status", "type": "text", "visibility": 3}, {"path": "status", "type": "text", "visibility": 3},
{"path": "state", "type": "text"}, {"path": "state", "type": "text"},
@@ -224,15 +252,22 @@
{"path": "badreadingminutes", "type": "float", "readonly": false, "cmd": "hefill badreadingminutes"}, {"path": "badreadingminutes", "type": "float", "readonly": false, "cmd": "hefill badreadingminutes"},
{"path": "tubecoolingminutes", "type": "float", "readonly": false, "cmd": "hefill tubecoolingminutes"}, {"path": "tubecoolingminutes", "type": "float", "readonly": false, "cmd": "hefill tubecoolingminutes"},
{"path": "vessellimit", "type": "float", "readonly": false, "cmd": "hefill vessellimit"}, {"path": "vessellimit", "type": "float", "readonly": false, "cmd": "hefill vessellimit"},
{"path": "vext", "type": "float"}]}, "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": 9}, {"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": "send", "type": "text", "readonly": false, "cmd": "hepump send", "visibility": 3},
{"path": "status", "type": "text", "visibility": 3}, {"path": "status", "type": "text", "visibility": 3},
{"path": "running", "type": "bool", "readonly": false, "cmd": "hepump running", "visibility": 3}, {"path": "running", "type": "bool", "readonly": false, "cmd": "hepump running"},
{"path": "eco", "type": "bool", "readonly": false, "cmd": "hepump eco", "visibility": 3}, {"path": "eco", "type": "bool", "readonly": false, "cmd": "hepump eco"},
{"path": "auto", "type": "bool", "readonly": false, "cmd": "hepump auto", "visibility": 3}, {"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", "visibility": 3}, {"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", "visibility": 3}, {"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}]}, "hemot": {"base": "/hepump/hemot", "params": [{"path": "", "type": "float", "readonly": false, "cmd": "run hemot", "visibility": 3, "kids": 32}, {"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": "send", "type": "text", "readonly": false, "cmd": "hemot send", "visibility": 3},
{"path": "status", "type": "text", "visibility": 3}, {"path": "status", "type": "text", "visibility": 3},
{"path": "is_running", "type": "int", "readonly": false, "cmd": "hemot is_running", "visibility": 3}, {"path": "is_running", "type": "int", "readonly": false, "cmd": "hemot is_running", "visibility": 3},
@@ -258,13 +293,24 @@
{"path": "output0", "type": "bool", "readonly": false, "cmd": "hemot output0"}, {"path": "output0", "type": "bool", "readonly": false, "cmd": "hemot output0"},
{"path": "output1", "type": "bool", "readonly": false, "cmd": "hemot output1"}, {"path": "output1", "type": "bool", "readonly": false, "cmd": "hemot output1"},
{"path": "input3", "type": "bool"}, {"path": "input3", "type": "bool"},
{"path": "input0", "type": "float"},
{"path": "input0raw", "type": "float"},
{"path": "pullup", "type": "float", "readonly": false, "cmd": "hemot pullup"}, {"path": "pullup", "type": "float", "readonly": false, "cmd": "hemot pullup"},
{"path": "nopumpfeedback", "type": "bool", "readonly": false, "cmd": "hemot nopumpfeedback"}, {"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": "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": "customadr", "type": "text", "readonly": false, "cmd": "hemot customadr"},
{"path": "custompar", "type": "float", "readonly": false, "cmd": "hemot custompar"}]}, "ln2fill": {"base": "/ln2fill", "params": [{"path": "", "type": "enum", "enum": {"watching": 0, "fill": 1, "inactive": 2}, "readonly": false, "cmd": "ln2fill", "kids": 14}, {"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": "send", "type": "text", "readonly": false, "cmd": "ln2fill send", "visibility": 3},
{"path": "status", "type": "text", "visibility": 3}, {"path": "status", "type": "text", "visibility": 3},
{"path": "state", "type": "text"}, {"path": "state", "type": "text"},
@@ -278,7 +324,10 @@
{"path": "maxholdhours", "type": "float", "readonly": false, "cmd": "ln2fill maxholdhours"}, {"path": "maxholdhours", "type": "float", "readonly": false, "cmd": "ln2fill maxholdhours"},
{"path": "tolerance", "type": "float", "readonly": false, "cmd": "ln2fill tolerance"}, {"path": "tolerance", "type": "float", "readonly": false, "cmd": "ln2fill tolerance"},
{"path": "badreadingminutes", "type": "float", "readonly": false, "cmd": "ln2fill badreadingminutes"}, {"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", "kids": 26}, {"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": "persmode", "type": "int", "readonly": false, "cmd": "mf persmode"},
{"path": "perswitch", "type": "int"}, {"path": "perswitch", "type": "int"},
{"path": "nowait", "type": "int", "readonly": false, "cmd": "mf nowait"}, {"path": "nowait", "type": "int", "readonly": false, "cmd": "mf nowait"},
@@ -299,16 +348,22 @@
{"path": "trainMode", "type": "int"}, {"path": "trainMode", "type": "int"},
{"path": "external", "type": "int", "readonly": false, "cmd": "mf external"}, {"path": "external", "type": "int", "readonly": false, "cmd": "mf external"},
{"path": "startScript", "type": "text", "readonly": false, "cmd": "mf startScript", "visibility": 3}, {"path": "startScript", "type": "text", "readonly": false, "cmd": "mf startScript", "visibility": 3},
{"path": "is_running", "type": "int", "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": "verbose", "type": "int", "readonly": false, "cmd": "mf verbose", "visibility": 3},
{"path": "driver", "type": "text", "visibility": 3}, {"path": "driver", "type": "text", "visibility": 3},
{"path": "creationCmd", "type": "text", "visibility": 3}, {"path": "creationCmd", "type": "text", "visibility": 3},
{"path": "targetValue", "type": "float"}, {"path": "targetValue", "type": "float"},
{"path": "status", "type": "text", "readonly": false, "cmd": "mf status"}]}, "lev": {"base": "/lev", "params": [{"path": "", "type": "float", "kids": 4}, {"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": "send", "type": "text", "readonly": false, "cmd": "lev send", "visibility": 3},
{"path": "status", "type": "text", "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": "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": "n2", "type": "float"}]},
"tcoil": {"base": "/tcoil", "params": [
{"path": "", "type": "float", "kids": 11},
{"path": "send", "type": "text", "readonly": false, "cmd": "tcoil send", "visibility": 3}, {"path": "send", "type": "text", "readonly": false, "cmd": "tcoil send", "visibility": 3},
{"path": "status", "type": "text", "visibility": 3}, {"path": "status", "type": "text", "visibility": 3},
{"path": "excitation", "type": "float", "readonly": false, "cmd": "tcoil excitation", "visibility": 3}, {"path": "excitation", "type": "float", "readonly": false, "cmd": "tcoil excitation", "visibility": 3},
@@ -349,7 +404,10 @@
{"path": "tc/curve/cpoints", "type": "floatvarar", "readonly": false, "cmd": "tcoil tc/curve/cpoints"}, {"path": "tc/curve/cpoints", "type": "floatvarar", "readonly": false, "cmd": "tcoil tc/curve/cpoints"},
{"path": "ext", "type": "float", "visibility": 3}, {"path": "ext", "type": "float", "visibility": 3},
{"path": "com", "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": "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": "send", "type": "text", "readonly": false, "cmd": "table send", "visibility": 3},
{"path": "status", "type": "text", "visibility": 3}, {"path": "status", "type": "text", "visibility": 3},
{"path": "fix_tt_set_prop", "type": "bool", "readonly": false, "cmd": "table fix_tt_set_prop"}, {"path": "fix_tt_set_prop", "type": "bool", "readonly": false, "cmd": "table fix_tt_set_prop"},
@@ -366,6 +424,4 @@
{"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": "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": "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": "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 ..."}]}, "prep0": {"base": "/prep0", "params": [{"path": "", "type": "text", "readonly": false, "cmd": "prep0", "kids": 2}, {"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 ..."}]}}
{"path": "send", "type": "text", "readonly": false, "cmd": "prep0 send", "visibility": 3},
{"path": "status", "type": "text", "visibility": 3}]}}

View File

@@ -1,6 +1,5 @@
Node('triton.psi.ch', Node('triton.psi.ch',
'triton test', 'triton test',
interface='tcp://5000',
) )
Mod('triton', Mod('triton',

View File

@@ -1,6 +1,5 @@
Node('triton.psi.ch', Node('triton.psi.ch',
'triton test', 'triton test',
interface='tcp://5000',
) )
Mod('T_mix', Mod('T_mix',

View File

@@ -1,18 +1,16 @@
Node('cfg/stick/hvolt_long.cfg', Node('cfg/stick/hvolt_long.cfg',
'high voltage stick (extended can)', 'high voltage stick (extended can)',
interface='5000',
name='hvolt_long',
) )
Mod('sea_stick', Mod('sea_stick',
'secop_psi.sea.SeaClient', 'frappy_psi.sea.SeaClient',
'stick sea connection for hvolt_long.stick', 'stick sea connection for hvolt_long.stick',
config='hvolt_long.stick', config='hvolt_long.stick',
service='stick', service='stick',
) )
Mod('ts', Mod('ts',
'secop_psi.sea.SeaReadable', '', 'frappy_psi.sea.SeaReadable', '',
io='sea_stick', io='sea_stick',
sea_object='tt', sea_object='tt',
json_file='ma6.config.json', json_file='ma6.config.json',
@@ -20,7 +18,7 @@ Mod('ts',
) )
Mod('hcp', Mod('hcp',
'secop_psi.sea.SeaReadable', '', 'frappy_psi.sea.SeaReadable', '',
io='sea_stick', io='sea_stick',
sea_object='hcp', sea_object='hcp',
) )

View File

@@ -0,0 +1,24 @@
Node('cfg/stick/hvolt_short.cfg',
'high voltage stick',
)
Mod('sea_stick',
'frappy_psi.sea.SeaClient',
'stick sea connection for hvolt_short.stick',
config='hvolt_short.stick',
service='stick',
)
Mod('ts',
'frappy_psi.sea.SeaReadable', '',
io='sea_stick',
sea_object='tt',
json_file='ma10.config.json',
rel_paths=['ts'],
)
Mod('hcp',
'frappy_psi.sea.SeaReadable', '',
io='sea_stick',
sea_object='hcp',
)

View File

@@ -1,18 +1,16 @@
Node('cfg/stick/ill3stick.cfg', Node('cfg/stick/ill3stick.cfg',
'ILL3 standard sample stick', 'ILL3 standard sample stick',
interface='5000',
name='ill3stick',
) )
Mod('sea_stick', Mod('sea_stick',
'secop_psi.sea.SeaClient', 'frappy_psi.sea.SeaClient',
'SEA stick connection', 'SEA stick connection',
config='ill3.stick', config='ill3.stick',
service='stick', service='stick',
) )
Mod('ts', Mod('ts',
'secop_psi.sea.SeaReadable', '', 'frappy_psi.sea.SeaReadable', '',
io='sea_stick', io='sea_stick',
sea_object='tt', sea_object='tt',
json_file='ill3.config.json', json_file='ill3.config.json',

View File

@@ -1,4 +1,3 @@
Node('mb11.stick.sea.psi.ch', Node('mb11.stick.sea.psi.ch',
'MB11 standard sample stick (do not use)', 'MB11 standard sample stick (do not use)',
interface='tcp://5000',
) )

View File

@@ -1,18 +1,16 @@
Node('cfg/stick/ori1stick.cfg', Node('cfg/stick/ori1stick.cfg',
'ORI1 standard sample stick', 'ORI1 standard sample stick',
interface='5000',
name='ori1stick',
) )
Mod('sea_stick', Mod('sea_stick',
'secop_psi.sea.SeaClient', 'frappy_psi.sea.SeaClient',
'SEA stick connection', 'SEA stick connection',
config='ori1.stick', config='ori1.stick',
service='stick', service='stick',
) )
Mod('ts', Mod('ts',
'secop_psi.sea.SeaReadable', '', 'frappy_psi.sea.SeaReadable', '',
io='sea_stick', io='sea_stick',
sea_object='tt', sea_object='tt',
json_file='ill1.config.json', json_file='ill1.config.json',

View File

@@ -1,18 +1,16 @@
Node('cfg/stick/ovenstick.cfg', Node('cfg/stick/ovenstick.cfg',
'oven stick for sans', 'oven stick for sans',
interface='5000',
name='ovenstick',
) )
Mod('sea_stick', Mod('sea_stick',
'secop_psi.sea.SeaClient', 'frappy_psi.sea.SeaClient',
'SEA stick connection', 'SEA stick connection',
config='oven.stick', config='oven.stick',
service='stick', service='stick',
) )
Mod('ts', Mod('ts',
'secop_psi.sea.SeaReadable', '', 'frappy_psi.sea.SeaReadable', '',
io='sea_stick', io='sea_stick',
sea_object='tt', sea_object='tt',
json_file='ma7.config.json', json_file='ma7.config.json',

View File

@@ -1,18 +1,16 @@
Node('cfg/stick/oventwo.cfg', Node('cfg/stick/oventwo.cfg',
'oven stick for SANS', 'oven stick for SANS',
interface='5000',
name='oventwo',
) )
Mod('sea_stick', Mod('sea_stick',
'secop_psi.sea.SeaClient', 'frappy_psi.sea.SeaClient',
'stick sea connection for oventwo.stick', 'stick sea connection for oventwo.stick',
config='oventwo.stick', config='oventwo.stick',
service='stick', service='stick',
) )
Mod('ts', Mod('ts',
'secop_psi.sea.SeaDrivable', '', 'frappy_psi.sea.SeaDrivable', '',
io='sea_stick', io='sea_stick',
sea_object='ts', sea_object='ts',
) )

View File

@@ -1,25 +1,23 @@
# error creating warmup # error creating warmup
Node('cfg/stick/sch.cfg', Node('cfg/stick/sch.cfg',
'old sample changer for 100 mm orange cryo (4 samples, HRPT)', 'old sample changer for 100 mm orange cryo (4 samples, HRPT)',
interface='5000',
name='sch',
) )
Mod('sea_stick', Mod('sea_stick',
'secop_psi.sea.SeaClient', 'frappy_psi.sea.SeaClient',
'SEA connection to sch4', 'SEA connection to sch4',
config='sch.stick', config='sch.stick',
service='stick', service='stick',
) )
Mod('warmup', Mod('warmup',
'secop_psi.sea.SeaReadable', '', 'frappy_psi.sea.SeaReadable', '',
sea_object='warmup', sea_object='warmup',
io='sea_stick', io='sea_stick',
) )
Mod('ts', Mod('ts',
'secop_psi.sea.SeaReadable', '', 'frappy_psi.sea.SeaReadable', '',
sea_object='tt', sea_object='tt',
json_file='ori4.config.json', json_file='ori4.config.json',
rel_paths=['ts'], rel_paths=['ts'],

View File

@@ -1,18 +1,16 @@
Node('cfg/stick/varioxstick.cfg', Node('cfg/stick/varioxstick.cfg',
'Variox standard sample stick', 'Variox standard sample stick',
interface='5000',
name='varioxstick',
) )
Mod('sea_stick', Mod('sea_stick',
'secop_psi.sea.SeaClient', 'frappy_psi.sea.SeaClient',
'SEA stick connection', 'SEA stick connection',
config='variox.stick', config='variox.stick',
service='stick', service='stick',
) )
Mod('ts', Mod('ts',
'secop_psi.sea.SeaReadable', '', 'frappy_psi.sea.SeaReadable', '',
io='sea_stick', io='sea_stick',
sea_object='tt', sea_object='tt',
json_file='variox.config.json', json_file='variox.config.json',

View File

@@ -1,4 +1,3 @@
# -*- coding: utf-8 -*-
# ***************************************************************************** # *****************************************************************************
# #
# This program is free software; you can redistribute it and/or modify it under # This program is free software; you can redistribute it and/or modify it under
@@ -17,6 +16,8 @@
# #
# Module authors: # Module authors:
# Enrico Faulhaber <enrico.faulhaber@frm2.tum.de> # Enrico Faulhaber <enrico.faulhaber@frm2.tum.de>
# Markus Zolliker <markus.zolliker@psi.ch>
# Alexander Zaft <a.zaft@fz-juelich.de>
# #
# ***************************************************************************** # *****************************************************************************
"""Define helpers""" """Define helpers"""
@@ -32,6 +33,9 @@ from configparser import ConfigParser
from os import environ, path from os import environ, path
SECoP_DEFAULT_PORT = 10767
class GeneralConfig: class GeneralConfig:
"""generalConfig holds server configuration items """generalConfig holds server configuration items
@@ -297,6 +301,7 @@ def formatException(cut=0, exc_info=None, verbose=False):
HOSTNAMEPART = re.compile(r'^(?!-)[a-z0-9-]{1,63}(?<!-)$', re.IGNORECASE) HOSTNAMEPART = re.compile(r'^(?!-)[a-z0-9-]{1,63}(?<!-)$', re.IGNORECASE)
def validate_hostname(host): def validate_hostname(host):
"""checks if the rules for valid hostnames are adhered to""" """checks if the rules for valid hostnames are adhered to"""
if len(host) > 255: if len(host) > 255:
@@ -325,7 +330,7 @@ def validate_ipv6(addr):
return True return True
def parse_ipv6_host_and_port(addr, defaultport=10767): def parse_ipv6_host_and_port(addr, defaultport=SECoP_DEFAULT_PORT):
""" Parses IPv6 addresses with optional port. See parse_host_port for valid formats""" """ Parses IPv6 addresses with optional port. See parse_host_port for valid formats"""
if ']' in addr: if ']' in addr:
host, port = addr.rsplit(':', 1) host, port = addr.rsplit(':', 1)
@@ -333,9 +338,10 @@ def parse_ipv6_host_and_port(addr, defaultport=10767):
if '.' in addr: if '.' in addr:
host, port = addr.rsplit('.', 1) host, port = addr.rsplit('.', 1)
return host, int(port) return host, int(port)
return (host, defaultport) return addr, defaultport
def parse_host_port(host, defaultport=10767):
def parse_host_port(host, defaultport=SECoP_DEFAULT_PORT):
"""Parses hostnames and IP (4/6) addressses. """Parses hostnames and IP (4/6) addressses.
The accepted formats are: The accepted formats are:
@@ -346,16 +352,16 @@ def parse_host_port(host, defaultport=10767):
- IPv6 addresses in the forms '[IPv6]:port' or 'IPv6.port' - IPv6 addresses in the forms '[IPv6]:port' or 'IPv6.port'
""" """
colons = host.count(':') colons = host.count(':')
if colons == 0: # hostname/ipv4 wihtout port if colons == 0: # hostname/ipv4 without port
port = defaultport port = defaultport
elif colons == 1: # hostname or ipv4 with port elif colons == 1: # hostname or ipv4 with port
host, port = host.split(':') host, port = host.split(':')
port = int(port) port = int(port)
else: # ipv6 else: # ipv6
host, port = parse_ipv6_host_and_port(host, defaultport) host, port = parse_ipv6_host_and_port(host, defaultport)
if (validate_ipv4(host) or validate_hostname(host) or validate_ipv6(host)) \ if (validate_ipv4(host) or validate_hostname(host) or validate_ipv6(host)) \
and 0 < port < 65536: and 0 < port < 65536:
return (host, port) return host, port
raise ValueError(f'invalid host {host!r} or port {port}') raise ValueError(f'invalid host {host!r} or port {port}')

View File

@@ -35,7 +35,7 @@ import time
import re import re
from frappy.errors import CommunicationFailedError, ConfigError from frappy.errors import CommunicationFailedError, ConfigError
from frappy.lib import closeSocket, parse_host_port from frappy.lib import closeSocket, parse_host_port, SECoP_DEFAULT_PORT
try: try:
from serial import Serial from serial import Serial
@@ -176,11 +176,11 @@ class AsynTcp(AsynConn):
uri = uri[6:] uri = uri[6:]
try: try:
host, port = parse_host_port(uri, self.default_settings.get('port')) host, port = parse_host_port(uri, self.default_settings.get('port', SECoP_DEFAULT_PORT))
self.connection = socket.create_connection((host, port), timeout=self.timeout) self.connection = socket.create_connection((host, port), timeout=self.timeout)
except (ConnectionRefusedError, socket.gaierror, socket.timeout) as e: except (ConnectionRefusedError, socket.gaierror, socket.timeout) as e:
# indicate that retrying might make sense # indicate that retrying might make sense
raise CommunicationFailedError(str(e)) from None raise CommunicationFailedError(f'can not connect to {host}:{port}, {e}') from None
def shutdown(self): def shutdown(self):
if self.connection: if self.connection:

View File

@@ -1,4 +1,3 @@
# -*- coding: utf-8 -*-
# ***************************************************************************** # *****************************************************************************
# This program is free software; you can redistribute it and/or modify it under # 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 # the terms of the GNU General Public License as published by the Free Software
@@ -32,13 +31,12 @@ import time
from frappy.datatypes import BoolType, StringType from frappy.datatypes import BoolType, StringType
from frappy.errors import SECoPError from frappy.errors import SECoPError
from frappy.lib import formatException, formatExtendedStack, \ from frappy.lib import formatException, formatExtendedStack, \
formatExtendedTraceback formatExtendedTraceback, SECoP_DEFAULT_PORT
from frappy.properties import Property from frappy.properties import Property
from frappy.protocol.interface import decode_msg, encode_msg_frame, get_msg from frappy.protocol.interface import decode_msg, encode_msg_frame, get_msg
from frappy.protocol.messages import ERRORPREFIX, HELPREPLY, HELPREQUEST, \ from frappy.protocol.messages import ERRORPREFIX, HELPREPLY, HELPREQUEST, \
HelpMessage HelpMessage
DEF_PORT = 10767
MESSAGE_READ_SIZE = 1024 MESSAGE_READ_SIZE = 1024
HELP = HELPREQUEST.encode() HELP = HELPREQUEST.encode()
@@ -201,7 +199,7 @@ class TCPServer(DualStackTCPServer):
# for cfg-editor # for cfg-editor
configurables = { configurables = {
'uri': Property('hostname or ip address for binding', StringType(), 'uri': Property('hostname or ip address for binding', StringType(),
default=f'tcp://{DEF_PORT}', export=False), default=f'tcp://{SECoP_DEFAULT_PORT}', export=False),
'detailed_errors': Property('Flag to enable detailed Errorreporting.', BoolType(), 'detailed_errors': Property('Flag to enable detailed Errorreporting.', BoolType(),
default=False, export=False), default=False, export=False),
} }