Skip to content

Commit

Permalink
orbintlk.FIX: handle BPM false positive problem
Browse files Browse the repository at this point in the history
  • Loading branch information
murilobalves committed Apr 11, 2024
1 parent 6d018d6 commit db638d0
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 1 deletion.
1 change: 1 addition & 0 deletions siriuspy/siriuspy/orbintlk/csdev.py
Original file line number Diff line number Diff line change
Expand Up @@ -213,6 +213,7 @@ def __init__(self):
if NR_BPM != len(self.bpm_names):
raise ValueError('Inconsistent NR_BPM parameter!')
self.bpm_nicknames = _BPMSearch.get_nicknames(self.bpm_names)
self.bpm_idcs = {b: idx for idx, b in enumerate(self.bpm_names)}

# bpm position along the ring
self.bpm_pos = _BPMSearch.get_positions(self.bpm_names)
Expand Down
12 changes: 11 additions & 1 deletion siriuspy/siriuspy/orbintlk/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -1358,13 +1358,23 @@ def _callback_bpm_intlk(self, pvname, value, **kws):
if not value:
return
# launch thread to log interlock details
bpmname = _PVName(pvname).device_name
_CAThread(
target=self._log_bpm_intlk,
args=(_PVName(pvname).device_name, ),
args=(bpmname, ),
daemon=True).start()
# launch thread to send interlock to RF as a backup
if self._thread_cbbpm and self._thread_cbbpm.is_alive():
return

# NOTE: the next lines help to avoid killing beam in case one BPM that
# is not enabled raises a false positive interlock signal.
idx = self._const.bpm_idcs[bpmname]
enbl = self._enable_lists['pos'][idx] or self._enable_lists['ang'][idx]
if not enbl:
self._update_log(f'WARN:{bpmname} false positive')
return

self._thread_cbbpm = _CAThread(
target=self._do_callback_bpm_intlk, daemon=True)
self._thread_cbbpm.start()
Expand Down

0 comments on commit db638d0

Please sign in to comment.