aboutsummaryrefslogtreecommitdiff
path: root/qolab/hardware
diff options
context:
space:
mode:
authorEugeniy E. Mikhailov <evgmik@gmail.com>2024-07-24 10:16:21 -0400
committerEugeniy E. Mikhailov <evgmik@gmail.com>2024-07-24 10:16:21 -0400
commit81447d92c4d29aac9271c5f8ffce3aab68e765b5 (patch)
tree9c6d350f173a6c8ff1e1def910c2f937fcca30fb /qolab/hardware
parent01a24807c53086106ad675cedef84ab3bac0ad77 (diff)
downloadqolab-81447d92c4d29aac9271c5f8ffce3aab68e765b5.tar.gz
qolab-81447d92c4d29aac9271c5f8ffce3aab68e765b5.zip
bug fix: first change scale then offset
apparently on Rigol scope offset stored in units of volts per division (or something similar). So order of operations is important.
Diffstat (limited to 'qolab/hardware')
-rw-r--r--qolab/hardware/scope/_basic.py4
1 files changed, 2 insertions, 2 deletions
diff --git a/qolab/hardware/scope/_basic.py b/qolab/hardware/scope/_basic.py
index 7cabf3b..751026d 100644
--- a/qolab/hardware/scope/_basic.py
+++ b/qolab/hardware/scope/_basic.py
@@ -212,10 +212,10 @@ class Scope(BasicInstrument):
vPerDiv = signal_range / (self.vertDivOnScreen * (1 - margin * 1.2))
if vPerDiv < self.minVoltsPerDiv:
vPerDiv = self.minVoltsPerDiv
- logger.debug(f"Auto Scaler Requesting {offset=} for {chNum=}.")
- self.setChanVoltageOffset(chNum, offset)
logger.debug(f"Auto Scaler Requesting {vPerDiv=} for {chNum=}.")
self.setChanVoltsPerDiv(chNum, vPerDiv)
+ logger.debug(f"Auto Scaler Requesting {offset=} for {chNum=}.")
+ self.setChanVoltageOffset(chNum, offset)
relOffsetChange = abs(old_offset - offset) / old_vPerDiv
relVperDivChange = abs(old_vPerDiv - vPerDiv) / old_vPerDiv
if (relOffsetChange < 0.5) and (relVperDivChange < 0.05):