From 06dd01df02343a2e5d9fb97e32b083a84beb60b8 Mon Sep 17 00:00:00 2001 From: "Eugeniy E. Mikhailov" Date: Fri, 2 Apr 2021 22:30:28 -0400 Subject: added redraw timer --- panel.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/panel.py b/panel.py index 2889bf4..d57a645 100644 --- a/panel.py +++ b/panel.py @@ -34,7 +34,7 @@ class Experiment: self.hardware = {} self.hardwareSetup() self.sweeper = Sweeper(0, 100, 100, 10) - self.root.after(1, self.hello ) + self.root.after(1000, self.hello ) def hardwareSetup(self): self.hardware['LabJack'] = ue9qol.UE9qol() @@ -68,11 +68,11 @@ class Experiment: self.canvas.get_tk_widget().pack() def hello(self): - self.root.after(1, self.hello ) + self.root.after(1000, self.hello ) tic = self.tic self.sweeper.incr() tic = self.sweeper.getCnt() - self.hardware['LabJack'].setOutputCh(0, tic % 5) + self.hardware['LabJack'].setOutputCh(0, tic % 6) self.data['tic'].append(tic) self.data['ch1'].append( self.hardware['LabJack'].getInputCh(1) ) self.tic = self.tic + 1 @@ -82,7 +82,7 @@ class Experiment: self.canvas.draw() stop = datetime.now() runTime = (stop-start).seconds + float((stop-start).microseconds)/1000000 - print("Replot took %s seconds." % runTime) + print("Replot took %s seconds to plot %s points." % (runTime, tic) ) if __name__ == '__main__': -- cgit v1.2.3