diff options
author | Eugeniy E. Mikhailov <evgmik@gmail.com> | 2024-07-24 23:28:04 -0400 |
---|---|---|
committer | Eugeniy E. Mikhailov <evgmik@gmail.com> | 2024-07-24 23:30:33 -0400 |
commit | a069c0fab77e2ac7bdf16e9069ef0149493f0df7 (patch) | |
tree | 8f818f3fee9d34967c60809482238226428ed067 | |
parent | 234f157d843347c9811261051edbc5bba96be5b3 (diff) | |
download | qolab-a069c0fab77e2ac7bdf16e9069ef0149493f0df7.tar.gz qolab-a069c0fab77e2ac7bdf16e9069ef0149493f0df7.zip |
added dummy method for switching to fast acquisition and back
-rw-r--r-- | qolab/hardware/scope/_basic.py | 30 |
1 files changed, 30 insertions, 0 deletions
diff --git a/qolab/hardware/scope/_basic.py b/qolab/hardware/scope/_basic.py index 751026d..261e947 100644 --- a/qolab/hardware/scope/_basic.py +++ b/qolab/hardware/scope/_basic.py @@ -157,6 +157,34 @@ class Scope(BasicInstrument): self.setRun(old_run_status) # start running if it was old run state return allTraces + def restorePriorToFastGrab(self, chNum, old_config): + """Restore relevant channel/scope settings prior to fast grab tune up.""" + logger.info("method restorePriorToFastGrab is not implemented") + + def switchToFastGrab(self, chNum): + """Switch scope to the fastest mode for trace delivery. + + Intended to be used in chanAutoScale methods where speed + transfer is more important than fidelity. It is good + idea to implement function ``restorePriorToFastGrab(chan, old_config)`` + to be used in conjunction with ``switchToFastGrab``. + + To be fast, it should aim to decrease data transfer time, + i.e. reduce number of transferred point. + It also need to be interface dependent. GPIB and USB are known + to be quite slow when compared to network connection. + + So try to be smart in hardware dependent classes. + + Return + ------ + old_config : dictionary + old config with settings necessary to restore initial state + """ + + logger.info("machinery for switchToFastGrab is not implemented") + return self.getConfig() + def chanAutoScale(self, chNum, margin=0.125, timeout=5): """Auto scale channel to fit signal on screen. @@ -174,6 +202,7 @@ class Scope(BasicInstrument): at top and bottom for 8 division scope. """ + old_config = self.switchToFastGrab(chNum) starttime = time.time() deadline = starttime + timeout timespan = self.getTimePerDiv() * self.horizDivOnScreen @@ -222,6 +251,7 @@ class Scope(BasicInstrument): # we converge, there is no point to improve break scaled_corectly = False + self.restorePriorToFastGrab(chNum, old_config) if time.time() > deadline: logger.warning( f"Scope did not make proper channel {chNum} scaling within {timeout=} sec." |