Skip to content

Commit

Permalink
orbintlk.FIX: monitor both RF EVEs
Browse files Browse the repository at this point in the history
  • Loading branch information
anacso17 committed Oct 29, 2024
1 parent 8e7ffa3 commit 5cb084a
Showing 1 changed file with 26 additions and 14 deletions.
40 changes: 26 additions & 14 deletions siriuspy/siriuspy/orbintlk/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -148,16 +148,27 @@ def __init__(self, tests=False):
pvo.connection_callbacks.append(self._conn_callback_timing)

# # RF EVE
trgsrc = _HLTimeSearch.get_ll_trigger_names('SI-Glob:TI-LLRF-PsMtm')
pvname = _LLTimeSearch.get_channel_output_port_pvname(trgsrc[0])
self._llrf_evtcnt_pvname = f'{pvname.propty}EvtCnt-Mon'
self._everf_dev = _Device(
pvname.device_name,
props2init=[self._llrf_evtcnt_pvname, ],
auto_monitor_mon=True)
pvo = self._everf_dev.pv_object(self._llrf_evtcnt_pvname)
pvo.wait_for_connection()
self._everf_evtcnt = pvo.get() or 0
trgsrcs = _HLTimeSearch.get_ll_trigger_names('SI-Glob:TI-LLRF-PsMtm')
pvnames = {
_LLTimeSearch.get_channel_output_port_pvname(src)
for src in trgsrcs
}
self._llrf_evtcnt_pvnames, self._everf_devs = dict(), dict()
for pvn in pvnames:
devn = pvn.device_name
propty = f'{pvn.propty}EvtCnt-Mon'

self._llrf_evtcnt_pvnames[devn] = propty

self._everf_devs[devn] = _Device(
devn, props2init=[propty, ], auto_monitor_mon=True
)

self._everf_evtcnts = dict()
for devn, propty in self._llrf_evtcnt_pvnames.items():
pvo = dev.pv_object(propty)
pvo.wait_for_connection()
self._everf_evtcnts[devn] = pvo.get() or 0

# # HL triggers
self._hltrig_devs = dict()
Expand Down Expand Up @@ -1414,10 +1425,11 @@ def _do_callback_bpm_intlk(self):
# wait minimum period for RF EVE event count to be updated
_time.sleep(.1)
# verify if RF EVE counted the event PsMtm
new_evtcnt = self._everf_dev[self._llrf_evtcnt_pvname]
if new_evtcnt == self._everf_evtcnt:
self._update_log('WARN:RF EVE did not count event PsMtm')
self._everf_evtcnt = new_evtcnt
for devn, propty in self._llrf_evtcnt_pvnames.items():
new_evtcnt = self._everf_devs[devn][propty]
if new_evtcnt == self._everf_evtcnts[devn]:
self._update_log('WARN:RF EVE did not count event PsMtm')
self._everf_evtcnts[devn] = new_evtcnt
# wait minimum period for BPM to update interlock PVs
_time.sleep(2)
# verify if EVG propagated the event Intlk
Expand Down

0 comments on commit 5cb084a

Please sign in to comment.