Skip to content
Snippets Groups Projects
Commit 0dacb360 authored by BRONES Romain's avatar BRONES Romain
Browse files

Integrate latest fixes

parents 3923503c e70142b6
No related branches found
No related tags found
No related merge requests found
......@@ -53,17 +53,27 @@ def init_watcher():
Run init on Fofb-Watcher, waiting for its completion then init on the FofbCommand.
"""
wprx=tango.DeviceProxy(tangopath["fofb-watcher"])
wprx.set_timeout_millis(30000)
try:
wprx=tango.DeviceProxy(tangopath["fofb-watcher"])
wprx.set_timeout_millis(30000)
except tango.DevFailed as e:
logger.error("Could not get DeviceProxy on {}".format(tangopath["fofb-watcher"]))
logger.debug(str(e))
return
logger.info("Perform init() on Fofb-Watcher. This takes nearly a minute.")
try:
wprx.init()
except tango.DevFailed as e:
logger.error("Could not perform init() on Fofb-Watcher.")
logger.debug(str(e))
logger.info("Perform init() on Fofb-Command.")
tango.DeviceProxy(tangopath["fofb-command"]).init()
try:
tango.DeviceProxy(tangopath["fofb-command"]).init()
except tango.DevFailed as e:
logger.error("Could not perform init() on '{}', got DevFailed.".format(tangopath['fofb-command']))
logger.debug(str(e))
def confds_opcua():
"""
......
......@@ -32,7 +32,10 @@ if __name__ == '__main__':
parser.add_argument("--log", default="info",
help="Log level (error, warning, info, debug)")
parser.add_argument("--conf-file", type=str,
parser.add_argument("--force", action="store_true",
help="Force operation even if FOFB is running.")
parser.add_argument("--fileconfig", type=str,
help="Path to config file to apply.")
parser.add_argument("--DS-init-opcua", action="store_true",
......@@ -49,9 +52,10 @@ if __name__ == '__main__':
parser.add_argument("--stop-ccn", action="store_true",
help="Stop command for the ComBPM applications blocks.")
parser.add_argument("--configure", choices=["combpm", "ccn", "comcorr", "corr", "all", "every"], nargs="+",
parser.add_argument("--configure", choices=["combpm", "ccn", "comcorr", "corr", "all", "every"],
nargs='?', const='all',
help="Configuration commands for the Fofb applications blocs."+
" 'all' is for all com, not configuring corrector. 'every' configure everything.")
" 'all' is for all com, not configuring corrector. 'every' configure everything. Default is 'all'")
parser.add_argument("--start", action="store_true",
help="Start command for the CCN and ComBPM applications blocks.")
......@@ -68,10 +72,19 @@ if __name__ == '__main__':
logger.debug(args)
if "conf_file" in args:
FofbTool.Configuration.loadconfig(args.conf_file)
if not args.fileconfig is None:
FofbTool.Configuration.loadconfig(args.fileconfig)
FofbTool.Configuration.logdebugconf()
## Check running
if not FofbTool.Utils.check_fofbnotrunning():
logger.warning("FOFB is running")
if not args.force:
logger.warning("Stoping here")
exit(1)
else:
logger.warning("Action forced")
## Device Server related commands
if args.DS_init_opcua:
FofbTool.Utils.init_opcua()
......@@ -87,16 +100,14 @@ if __name__ == '__main__':
if args.stop or args.stop_ccn:
FofbTool.Utils.stop_all_ccn()
if not args.configure is None:
for conf in args.configure:
if conf in ("combpm", "all", "every"):
FofbTool.Utils.conf_all_combpm()
if conf in ("comcorr", "all", "every"):
FofbTool.Utils.conf_all_comcorr()
if conf in ("ccn", "all", "every"):
FofbTool.Utils.conf_all_ccn()
if conf in ("corr", "every"):
FofbTool.Configuration.centralnode_configure_corr()
if args.configure in ("combpm", "all", "every"):
FofbTool.Utils.conf_all_combpm()
if args.configure in ("comcorr", "all", "every"):
FofbTool.Utils.conf_all_comcorr()
if args.configure in ("ccn", "all", "every"):
FofbTool.Utils.conf_all_ccn()
if args.configure in ("corr", "every"):
FofbTool.Configuration.centralnode_configure_corr()
if args.start or args.start_combpm:
FofbTool.Utils.start_all_combpm()
......
......@@ -9,7 +9,7 @@ cp FofbTool/*.py $ipath/ -rvf
cp FofbTool/*.cfg $ipath/ -rvf
# Copy bin CLI
cp bin/FofbTool ~/bin/ -vf
cp bin/FofbTool /home/production/scripts/DG/python/bin/ -vf
# Put exec rights
chmod +x ~/bin/FofbTool
chmod +x /home/production/scripts/DG/python/bin/FofbTool
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment