Track completed Single acquisitions and persist recent addresses
This commit is contained in:
24
python/set_devices/tektronix_capture_state.py
Normal file
24
python/set_devices/tektronix_capture_state.py
Normal file
@@ -0,0 +1,24 @@
|
||||
"""Read completed Single records once, without interfering with acquisition."""
|
||||
class CaptureState:
|
||||
def __init__(self):
|
||||
self.armed = False
|
||||
self.delivered = None
|
||||
|
||||
def arm(self):
|
||||
self.armed = True
|
||||
|
||||
def ready(self, status):
|
||||
running, single, count = status
|
||||
if not single:
|
||||
self.armed = False
|
||||
self.delivered = None
|
||||
return running
|
||||
if running or count == 0:
|
||||
self.armed = True
|
||||
return False
|
||||
return count > 0 and (self.armed or self.delivered != count)
|
||||
|
||||
def consumed(self, status):
|
||||
if status[1]:
|
||||
self.delivered = status[2]
|
||||
self.armed = False
|
||||
Reference in New Issue
Block a user