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

Sync operation now return a boolean

parent 475a61d1
No related branches found
No related tags found
No related merge requests found
......@@ -567,7 +567,7 @@ def sync_bpm(bpmidlist, lbpevrx, timinglocal, timingcentral):
bpmidlist: list of tuple
list of tuple (ID, tangopath) to put on Libera Electron
lbpevrx: list
list of LBP Evrx tango path
list of LBP Evrx tango path. Can be an empty array.
timinglocal: list
list of Timing local itango path to set event
timingcentral: str
......@@ -590,9 +590,11 @@ def sync_bpm(bpmidlist, lbpevrx, timinglocal, timingcentral):
# ---------------------------------------------------------------------------------------------------------------
# Init BPMs, stop first and put for each the ID number
electron_stop_com(bpmlist)
if not electron_stop_com(bpmlist):
return False
electron_init_fa(bpmidlist)
if not electron_init_fa(bpmidlist):
return False
# ---------------------------------------------------------------------------------------------------------------
# Write event number
......@@ -602,19 +604,20 @@ def sync_bpm(bpmidlist, lbpevrx, timinglocal, timingcentral):
for _r in r:
if _r.has_failed():
logger.error("Failed to set Event Number on local timing board {}, bpm.trigEvent".format(_r.dev_name()))
return
return False
# ---------------------------------------------------------------------------------------------------------------
# Prepare bpm for trigger reception
electron_sync_next_trigger(bpmlist)
if not electron_sync_next_trigger(bpmlist):
return False
logger.info("Prepare Libera Brillance Plus to start on next trigger")
r=glbpevrx.write_attribute("synchronize", 0)
for _r in r:
if _r.has_failed():
logger.error("Failed to write synchronize on LBP EVRX {}".format(_r.dev_name()))
return
return False
# ---------------------------------------------------------------------------------------------------------------
# Wait 2 seconds and Fire the soft event
......@@ -630,7 +633,8 @@ def sync_bpm(bpmidlist, lbpevrx, timinglocal, timingcentral):
# ---------------------------------------------------------------------------------------------------------------
# Start electron on next trigger
electron_start_next_trigger(bpmlist)
if not electron_start_next_trigger(bpmlist):
return False
# ---------------------------------------------------------------------------------------------------------------
# Wait 2 seconds and Fire the soft event
......@@ -652,6 +656,6 @@ def sync_bpm(bpmidlist, lbpevrx, timinglocal, timingcentral):
for _r in r:
if _r.has_failed():
logger.error("Failed to set Event Number on local timing board {}, bpm.trigEvent".format(_r.dev_name()))
return
return False
return True
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