An application that measures from an Osci in a loop.
| 28 | |
| 29 | |
| 30 | class LoopOsciMeasure(Backend): |
| 31 | """An application that measures from an Osci in a loop. |
| 32 | """ |
| 33 | |
| 34 | # Enumerate drivers required by the backend marking them with InstrumentSlot |
| 35 | osci = InstrumentSlot |
| 36 | |
| 37 | # Embedded apps (Notice we embed the backend, not the Frontend) |
| 38 | loop = Loop |
| 39 | |
| 40 | # This signal will be emitted when new data is available. |
| 41 | new_data = QtCore.Signal(object) |
| 42 | |
| 43 | def __init__(self, *args, **kwargs): |
| 44 | super().__init__(*args, **kwargs) |
| 45 | self.loop.body = self.measure |
| 46 | |
| 47 | def measure(self, counter, iterations, overrun): |
| 48 | data = self.osci.measure() |
| 49 | self.new_data.emit(data) |
| 50 | |
| 51 | |
| 52 | class LoopPlot(Frontend): |