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

feat(cli, utils): Add start/stop all comlbp

parent cc0acaad
No related branches found
No related tags found
No related merge requests found
......@@ -243,6 +243,25 @@ def stop_all_combpm(force=False):
FofbTool.Operation.stop_combpm(n)
def stop_all_comlbp(force=False):
"""
Apply stop and reset command on all Cellnodes.
Check beforehand that the FOFB is not running. Display warning if.
"""
if not check_fofbnotrunning(force):
logger.warning("Not running stop combpm because FOFB seems to be running.")
for n,p in FofbTool.Configuration.config["tangopath.fofbnodes"].items():
if 'cellnode' in n:
try:
FofbTool.Operation.reset_comlbp(n)
FofbTool.Operation.stop_comlbp(n)
except (tango.DevFailed, TypeError):
logger.error("Could not stop cpmlbp on {}".format(n))
def stop_all_ccn(force=False):
"""
Apply stop and reset commands on all fofbnodes.
......@@ -269,6 +288,20 @@ def start_all_combpm():
if 'cellnode' in n:
FofbTool.Operation.start_combpm(n)
def start_all_comlbp():
"""
Apply start comlbp command on all Cellnodes.
"""
for n,p in FofbTool.Configuration.config["tangopath.fofbnodes"].items():
if 'cellnode' in n:
try:
FofbTool.Operation.start_comlbp(n)
except (tango.DevFailed, TypeError):
logger.error("Could not start LBP on {}".format(n))
def start_all_ccn():
"""
......
......@@ -51,6 +51,8 @@ if __name__ == '__main__':
help="Stop command for the ComBPM applications blocks.")
parser.add_argument("--stop-ccn", action="store_true",
help="Stop command for the ComBPM applications blocks.")
parser.add_argument("--stop-comlbp", action="store_true",
help="Stop command for the ComLBP applications blocks.")
parser.add_argument("--dump-configuration", type=argparse.FileType('w'),
help="Dump the current configuration in a file at the giver path.")
......@@ -64,6 +66,8 @@ if __name__ == '__main__':
help="Start command for the CCN and ComBPM applications blocks.")
parser.add_argument("--start-combpm", action="store_true",
help="Start command for the ComBPM applications blocks.")
parser.add_argument("--start-comlbp", action="store_true",
help="Start command for the ComLBP applications blocks.")
parser.add_argument("--start-ccn", action="store_true",
help="Start command for the ComBPM applications blocks.")
......@@ -102,6 +106,8 @@ if __name__ == '__main__':
if args.stop or args.stop_combpm:
FofbTool.Utils.stop_all_combpm(force=args.force)
if args.stop or args.stop_comlbp:
FofbTool.Utils.stop_all_comlbp(force=args.force)
if args.stop or args.stop_ccn:
FofbTool.Utils.stop_all_ccn(force=args.force)
......@@ -114,6 +120,8 @@ if __name__ == '__main__':
if args.configure in ("corr", "all"):
FofbTool.Configuration.centralnode_configure_corr()
if args.start or args.start_comlbp:
FofbTool.Utils.start_all_comlbp()
if args.start or args.start_combpm:
FofbTool.Utils.start_all_combpm()
if args.start or args.start_ccn:
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment