diff options
author | Eugeniy E. Mikhailov <evgmik@gmail.com> | 2021-06-12 18:39:22 -0400 |
---|---|---|
committer | Eugeniy E. Mikhailov <evgmik@gmail.com> | 2021-06-12 18:40:35 -0400 |
commit | 6bb904e94369a14239b9ce51516497065272e12a (patch) | |
tree | 6deacc38b426658cb9ba853e48688202e27b2196 | |
parent | 1bb335191653a344d81e7f2c06a0d9438f127be5 (diff) | |
download | pyExpControl-6bb904e94369a14239b9ce51516497065272e12a.tar.gz pyExpControl-6bb904e94369a14239b9ce51516497065272e12a.zip |
added Sweeper test
-rw-r--r-- | funcGenerator.py | 21 |
1 files changed, 21 insertions, 0 deletions
diff --git a/funcGenerator.py b/funcGenerator.py index d9abf06..b34dcce 100644 --- a/funcGenerator.py +++ b/funcGenerator.py @@ -157,3 +157,24 @@ class Sweeper: def getRelPos(self): return self.relPos +def testSweeper(sweeper): + print( sweeper.getPos() ) + if sweeper.getPos() == sweeper.Npoints: + print("Done") + sweeper.cmdStop() + sweeper.widget.destroy() + sweeper.widget.quit() + +if __name__ == '__main__': + from tkinter import Tk + root=Tk() + root.geometry("800x600") + root.withdraw(); # do not show window + + Np = 10 + SweepTime = Np + print(f'Test sweeper: you should see a sequence of {Np} numbers updating about every {SweepTime/Np} seconds') + sweeper = Sweeper(root, Npoints=Np, SweepTime=SweepTime, onTicCallbacks=[testSweeper]) + sweeper.cmdStart() + + root.mainloop() |