fix frappy command and usage message

This commit is contained in:
2022-06-22 18:05:28 +02:00
parent ebe01a620a
commit fbfb060e3b
2 changed files with 9 additions and 14 deletions

View File

@ -80,18 +80,13 @@ def frappy_start(**services):
frappy_config = session.devices.get('frappy_config') frappy_config = session.devices.get('frappy_config')
for service in SERVICES: for service in SERVICES:
if services.get(service) == '': if services.get(service) == '':
seaconn = session.devices.get('seaconn') seaconn = session.devices.get('seaconn')
if seaconn and seaconn._attached_secnode: if seaconn and seaconn._attached_secnode:
seaconn.communicate('frappy_remove %s' % service) seaconn.communicate('frappy_remove %s' % service)
used_cfg = {} used_cfg = {}
# check for duplication of cfgs
for service in SERVICES:
cfginfo = services.get(service)
all_cfg = {} all_cfg = {}
new_cfg = [] new_cfg = []
remove_cfg = [] remove_cfg = []
add_setups = []
for service in SERVICES: for service in SERVICES:
secnode = session.devices.get('se_' + service) secnode = session.devices.get('se_' + service)
cfginfo = services.get(service) cfginfo = services.get(service)
@ -103,9 +98,9 @@ def frappy_start(**services):
else: else:
if cfginfo: if cfginfo:
new_cfg.append((service, secnode, cfginfo)) new_cfg.append((service, secnode, cfginfo))
all_cfg[service] = cfginfo
else: else:
remove_cfg.append(secnode) remove_cfg.append(secnode)
all_cfg[service] = cfginfo
if secnode: if secnode:
secnode('') secnode('')

View File

@ -49,11 +49,11 @@ printinfo("=====================================================================
printinfo("Welcome to the NICOS frappy secnode setup!") printinfo("Welcome to the NICOS frappy secnode setup!")
printinfo(" ") printinfo(" ")
printinfo("Usage:") printinfo("Usage:")
printinfo(" frappy_main('<main cfg>') # change main SE configuration (e.g. cryostat)") printinfo(" frappy('<main cfg>') # change main SE configuration (e.g. cryostat)")
printinfo(" frappy_stick('<stick cfg>') # change sample-stick configuration") printinfo(" frappy('<main cfg>', '<stick cfg>') # change main and stick cfg")
printinfo(" frappy_stick('') # remove stick") printinfo(" frappy(stick='') # remove stick")
printinfo(" frappy_main('') # remove main SE apparatus") printinfo(" frappy('') # remove main SE apparatus")
printinfo(" frappy_main() # show the current SE configuration") printinfo(" frappy() # show the current SE configuration")
printinfo("=======================================================================================") printinfo("=======================================================================================")
set_se_list() set_se_list()
''' '''