diff options
-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() |