aboutsummaryrefslogtreecommitdiff
path: root/funcGenerator.py
diff options
context:
space:
mode:
authorEugeniy E. Mikhailov <evgmik@gmail.com>2021-06-12 18:39:22 -0400
committerEugeniy E. Mikhailov <evgmik@gmail.com>2021-06-12 18:40:35 -0400
commit6bb904e94369a14239b9ce51516497065272e12a (patch)
tree6deacc38b426658cb9ba853e48688202e27b2196 /funcGenerator.py
parent1bb335191653a344d81e7f2c06a0d9438f127be5 (diff)
downloadpyExpControl-6bb904e94369a14239b9ce51516497065272e12a.tar.gz
pyExpControl-6bb904e94369a14239b9ce51516497065272e12a.zip
added Sweeper test
Diffstat (limited to 'funcGenerator.py')
-rw-r--r--funcGenerator.py21
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()