Skip to content

Commit

Permalink
Merge pull request #748 from lnls-sirius/improve-bpms
Browse files Browse the repository at this point in the history
Improve device BPM
  • Loading branch information
fernandohds564 authored Oct 22, 2021
2 parents 0ab19f3 + 09b3e3a commit 34ecd32
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 1 deletion.
10 changes: 10 additions & 0 deletions siriuspy/siriuspy/devices/bpm.py
Original file line number Diff line number Diff line change
Expand Up @@ -680,6 +680,16 @@ def acq_nrshots(self, val):
"""."""
self['ACQShots-SP'] = val

def wait_acq_finish(self, timeout=10):
"""Wait Acquisition to finish."""
vals = {
_csbpm.AcqStates.Idle, _csbpm.AcqStates.Error,
_csbpm.AcqStates.Aborted, _csbpm.AcqStates.Too_Many_Samples,
_csbpm.AcqStates.Too_Few_Samples, _csbpm.AcqStates.No_Memory,
_csbpm.AcqStates.Acq_Overflow}
return self._wait(
'ACQStatus-Sts', vals, timeout=timeout, comp=lambda x, y: x in y)

def cmd_acq_start(self):
"""Command Start Acquisition."""
self.acq_ctrl = _csbpm.AcqEvents.Start
Expand Down
3 changes: 2 additions & 1 deletion siriuspy/siriuspy/devices/device.py
Original file line number Diff line number Diff line change
Expand Up @@ -155,7 +155,8 @@ def _create_pvs(self, devname):

def _wait(self, propty, value, timeout=_DEF_TIMEOUT, comp='eq'):
"""."""
comp = getattr(_opr, comp)
if isinstance(comp, str):
comp = getattr(_opr, comp)
ntrials = int(timeout/_TINY_INTERVAL)
_time.sleep(4*_TINY_INTERVAL)
for _ in range(ntrials):
Expand Down

0 comments on commit 34ecd32

Please sign in to comment.