diff options
Diffstat (limited to 'qolab')
-rw-r--r-- | qolab/hardware/scope/_basic.py | 18 |
1 files changed, 13 insertions, 5 deletions
diff --git a/qolab/hardware/scope/_basic.py b/qolab/hardware/scope/_basic.py index bb655a0..86b051e 100644 --- a/qolab/hardware/scope/_basic.py +++ b/qolab/hardware/scope/_basic.py @@ -90,11 +90,20 @@ class Scope(BasicInstrument): # we expect NORM, AUTO, SINGLE, STOP raise NotImplementedError("setTriggerMode function is not implemented") + def getRun(self): + """Is acquisition running or stopped.""" + raise NotImplementedError("getRun function is not implemented") + + def setRun(self, val): + """Either enable run or stop the acquisition.""" + raise NotImplementedError("setRun function is not implemented") + def getAllTraces(self, availableNpnts=None, maxRequiredPoints=None, decimate=True): allTraces = TraceSetSameX("scope traces") allTraces.config["tags"]["DAQ"] = self.getConfig() - old_trg_mode = self.getTriggerMode() - self.setTriggerMode("STOP") + old_run_status = self.getRun() + if old_run_status: # avoid unnecessary status change + self.setRun(False) # stop if currently running # to get synchronous channels for chNum in range(1, self.numberOfChannels + 1): allTraces.addTrace( @@ -106,9 +115,8 @@ class Scope(BasicInstrument): ) ) # restore scope to the before acquisition mode - if old_trg_mode != "STOP": - # short speed up here with this check - self.setTriggerMode(old_trg_mode) + if old_run_status: # avoid unnecessary status change + self.setRun(old_run_status) # start running if it was old run state return allTraces def plot(self, **kwargs): |