aboutsummaryrefslogtreecommitdiff
path: root/qolab/hardware
diff options
context:
space:
mode:
authorEugeniy E. Mikhailov <evgmik@gmail.com>2024-07-21 14:31:03 -0400
committerEugeniy E. Mikhailov <evgmik@gmail.com>2024-07-21 14:31:03 -0400
commite6605839880ee4c8cdc99682fe61345a0b938093 (patch)
tree9f038223c377f17abe153e832e4fdf55139ada80 /qolab/hardware
parent87c60b3ff817ddf3f4042b72878318a69fc80bd7 (diff)
downloadqolab-e6605839880ee4c8cdc99682fe61345a0b938093.tar.gz
qolab-e6605839880ee4c8cdc99682fe61345a0b938093.zip
change logic of getAllTraces to use getRun or setRun mode.
Diffstat (limited to 'qolab/hardware')
-rw-r--r--qolab/hardware/scope/_basic.py18
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):