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

Move Configu part of sync in Utils

parent d2aa6048
No related branches found
No related tags found
No related merge requests found
......@@ -550,28 +550,25 @@ def electron_stop_com(bpmlist):
# OPERATIONS FOR LBP and Electron SYNCHRONIZATION
###################################################################################################
def sync_all_bpm():
def sync_all_bpm(bpmlist, lbpevrx, tlocal, tcentral):
"""
Synchronize all BPM electronics, Electron and Brillance Plus.
This will use the timing system (central and local board).
PARAMETERS:
-----------
bpmlist: list
list of Libera Electron tango path
lbpevrx: list
list of LBP Evrx tanfo path
tlocal: list
list of Timing local board to set event
tcentral: str
Tango path of timing central
"""
EVN=240 # Event number
db = tango.Database()
bpmlist = [n.split(':')[2] for n in db.get_property("FOFB", "bpmlist")['bpmlist'] if ":LIBERA:" in n]
bpmidlist = [(int(n.split(':')[0]), n.split(':')[2]) for n in db.get_property("FOFB", "bpmlist")['bpmlist'] if 'LIBERA' in n]
tlocal = tango.Group('tlocal')
tlocal.add([n.split(':')[2] for n in db.get_property("FOFB", 'TimingBoardList')['TimingBoardList'] if "LOCAL" in n])
# Set a group of Libera Brillance Plus EVRX board, from FofbTool configuration
lbpevrx = tango.Group('lbpevrx')
lbpevrx.add(FofbTool.Configuration.config["tangopath"]["lbpevrx"].split())
tcentral = tango.DeviceProxy(FofbTool.Configuration.config["tangopath"]["timing-central"])
# ---------------------------------------------------------------------------------------------------------------
# Init BPMs, stop first and put for each the ID number
......
......@@ -451,3 +451,26 @@ def conf_centralnode_corr():
[getconf( "k2{}_x".format(l), "corr", t='i') for l in ["a","b","ic","d"]],
[getconf( "k2{}_y".format(l), "corr", t='i') for l in ["a","b","ic","d"]],
)
def sync_all_bpm():
"""
Synchronize all BPM electronics, Electron and Brillance Plus.
This will use the timing system (central and local board).
"""
db = tango.Database()
bpmlist = [n.split(':')[2] for n in db.get_property("FOFB", "bpmlist")['bpmlist'] if ":LIBERA:" in n]
bpmidlist = [(int(n.split(':')[0]), n.split(':')[2]) for n in db.get_property("FOFB", "bpmlist")['bpmlist'] if 'LIBERA' in n]
tlocal = tango.Group('tlocal')
tlocal.add([n.split(':')[2] for n in db.get_property("FOFB", 'TimingBoardList')['TimingBoardList'] if "LOCAL" in n])
# Set a group of Libera Brillance Plus EVRX board, from FofbTool configuration
lbpevrx = tango.Group('lbpevrx')
lbpevrx.add(FofbTool.Configuration.config["tangopath"]["lbpevrx"].split())
tcentral = tango.DeviceProxy(FofbTool.Configuration.config["tangopath"]["timing-central"])
FofbTool.Operation.sync_bpm(bpmlist, lbpevrx, tlocal, tcentral)
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