diff --git a/FofbTool/Operation.py b/FofbTool/Operation.py index 6e95e90aac98d91906f2c462cb613d412d20ff9c..90c811d3a91f2e5843cbf5b71b02d4f7844ad06d 100644 --- a/FofbTool/Operation.py +++ b/FofbTool/Operation.py @@ -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