From d806b442cf84874460b530bf22492f523eb8db7f Mon Sep 17 00:00:00 2001 From: Fernando Date: Fri, 22 Oct 2021 15:09:31 -0300 Subject: [PATCH] DEVBPM.ENH: Add method to wait BPM finish data acquisition. --- siriuspy/siriuspy/devices/bpm.py | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/siriuspy/siriuspy/devices/bpm.py b/siriuspy/siriuspy/devices/bpm.py index 70260546b..ba77b9727 100644 --- a/siriuspy/siriuspy/devices/bpm.py +++ b/siriuspy/siriuspy/devices/bpm.py @@ -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