diff --git a/siriuspy/siriuspy/VERSION b/siriuspy/siriuspy/VERSION index 863f84e5c..ece2083a6 100644 --- a/siriuspy/siriuspy/VERSION +++ b/siriuspy/siriuspy/VERSION @@ -1 +1 @@ -2.87.0 +2.87.1 diff --git a/siriuspy/siriuspy/orbintlk/csdev.py b/siriuspy/siriuspy/orbintlk/csdev.py index 3d9f303fe..f5c998cf7 100644 --- a/siriuspy/siriuspy/orbintlk/csdev.py +++ b/siriuspy/siriuspy/orbintlk/csdev.py @@ -84,12 +84,12 @@ class Const(_csdev.Const): ('Src-Sel', 0), ('State-Sel', 1), ('Polarity-Sel', 0), - ('Log-Sel', 0))), + ('Log-Sel', 1))), ('SI-14C4:TI-DCCT-PsMtm', ( ('Src-Sel', 0), ('State-Sel', 1), ('Polarity-Sel', 0), - ('Log-Sel', 0))), + ('Log-Sel', 1))), ] FOUTSFIXED_RXENBL = { 'CA-RaTim:TI-Fout-2': 0b01000001, @@ -139,23 +139,25 @@ def EVG_CONFIGS(cls): if cls.__EVG_CONFIGS is not None: return cls.__EVG_CONFIGS + hltg_enbl = [ + 'SI-Fam:TI-BPM-OrbIntlk', + 'SI-Fam:TI-OrbIntlkRedundancy', + ] + lltg_enbl = [] + for hltg in hltg_enbl: + lltg_enbl.extend(_HLTimeSearch.get_ll_trigger_names(hltg)) + lltg_enbl = set(lltg_enbl) + fouts = set() evgchans = set() - evgrxenbl = list() - for ch in _LLTimeSearch.get_connections_twds_evg(): - if ch.dev != 'BPM': - continue - if ch.sec != 'SI': - continue - if ch.dev == 'BPM' and ch.sub.endswith(('SA', 'SB', 'SP')): - continue - fch = _LLTimeSearch.get_fout_channel(ch) + evgrxenbl = set() + for lltg in lltg_enbl: + fch = _LLTimeSearch.get_fout_channel(lltg) fouts.add(fch.device_name) evgch = _LLTimeSearch.get_evg_channel(fch) - if evgch in evgchans: - continue evgchans.add(evgch) - evgrxenbl.append(int(evgch.propty[3:])) + evgrxenbl.add(int(evgch.propty[3:])) + evgrxenbl = sorted(evgrxenbl) hlevts = _HLTimeSearch.get_hl_events() evtin0 = int(hlevts['Intlk'].strip('Evt')) @@ -213,6 +215,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) diff --git a/siriuspy/siriuspy/orbintlk/main.py b/siriuspy/siriuspy/orbintlk/main.py index cce2cd5de..60c7c0c2b 100644 --- a/siriuspy/siriuspy/orbintlk/main.py +++ b/siriuspy/siriuspy/orbintlk/main.py @@ -105,8 +105,10 @@ def __init__(self, tests=False): pvo.add_callback(self._callback_evg_rxlock) # # Fouts - foutnames = list(self._const.FOUTS_2_MON) + \ - list(self._const.FOUTSFIXED_RXENBL.keys()) + foutnames = list( + self._const.FOUTS_2_MON | + self._const.FOUTSFIXED_RXENBL.keys() + ) self._thread_cbfout = {fout: None for fout in foutnames} self._fout_devs = { devname: _Device( @@ -1358,13 +1360,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()