aboutsummaryrefslogtreecommitdiff
path: root/qolab/hardware/scope
diff options
context:
space:
mode:
authorEugeniy E. Mikhailov <evgmik@gmail.com>2024-07-21 14:19:05 -0400
committerEugeniy E. Mikhailov <evgmik@gmail.com>2024-07-21 14:19:05 -0400
commitf1400211af314aa33c5673dc95ee280f898dc889 (patch)
tree454eef6e2304926bc2c12c82e2d12ccbb9c7e203 /qolab/hardware/scope
parent7cd6d95d133c30020724f325a054db8303029a80 (diff)
downloadqolab-f1400211af314aa33c5673dc95ee280f898dc889.tar.gz
qolab-f1400211af314aa33c5673dc95ee280f898dc889.zip
avoid unnesesary Run/Stop state change
Diffstat (limited to 'qolab/hardware/scope')
-rw-r--r--qolab/hardware/scope/rigolds1054z.py16
1 files changed, 12 insertions, 4 deletions
diff --git a/qolab/hardware/scope/rigolds1054z.py b/qolab/hardware/scope/rigolds1054z.py
index bf5a6a5..d43752a 100644
--- a/qolab/hardware/scope/rigolds1054z.py
+++ b/qolab/hardware/scope/rigolds1054z.py
@@ -99,6 +99,13 @@ class RigolDS1054z(ScopeSCPI):
return True
return False
+ def setRun(self, val):
+ """Either enable run or stop."""
+
+ if val:
+ self.run()
+ self.stop()
+
@BasicInstrument.tsdb_append
def getTimeBaseMode(self):
"""Get he mode of the horizontal timebase.
@@ -414,8 +421,9 @@ class RigolDS1054z(ScopeSCPI):
def getTrace(
self, chNum, availableNpnts=None, maxRequiredPoints=None, decimate=True
):
- old_trg_status = self.getTriggerStatus()
- self.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
wfVoltage, rawChanCfg = self.getWaveform(
chNum,
@@ -428,8 +436,8 @@ class RigolDS1054z(ScopeSCPI):
tr.x = t
tr.y = wfVoltage
# restore scope to the before acquisition mode
- if old_trg_status != "STOP":
- self.run()
+ if old_run_status: # avoid unnecessary status change
+ self.setRun(old_run_status) # start running if it was old run state
return tr