diff options
Diffstat (limited to 'panel.py')
-rw-r--r-- | panel.py | 21 |
1 files changed, 15 insertions, 6 deletions
@@ -177,6 +177,9 @@ class Experiment: self.cntrlPannel=ttk.LabelFrame(root, text='controls') self.cntrlPannel.pack() + self.bAutoZoom=Button(self.cntrlPannel,text="AutoZoom",command=self.autoZoom,font=('Arial','24')) + self.bAutoZoom.pack(side='left') + self.bRestart=Button(self.cntrlPannel,text="RESTART",command=self.restart,font=('Arial','24')) self.bRestart.pack(side='left') @@ -248,16 +251,22 @@ class Experiment: runTime = (stop-start).seconds + float((stop-start).microseconds)/1000000 # print("onTic DAQ took %s seconds." % (runTime) ) - def updatePlot(self,swp=None): - start = datetime.now() + def autoZoom(self): self.ax.cla() self.line, = self.ax.plot(self.data['tic'], self.data['ch1'], '.') + self.canvas.draw() + + def updatePlot(self,swp=None): + start = datetime.now() + # self.ax.cla() + # self.line, = self.ax.plot(self.data['tic'], self.data['ch1'], '.') # t = Thread(target=self.canvas.draw) - # self.line.set_data([1, 2, 3], [1, 2, 3]) - # self.ax.draw_artist(self.line) + # self.line.set_data([.1, .2, .3], [.1, .2, .3]) + self.line.set_data(self.data['tic'], self.data['ch1']) + self.ax.draw_artist(self.line) # self.canvas.update() - self.canvas.draw() - # self.fig.canvas.flush_events() + # self.canvas.draw() + self.fig.canvas.flush_events() stop = datetime.now() runTime = (stop-start).seconds + float((stop-start).microseconds)/1000000 print("Replot took %s seconds to plot %s points." % (runTime, len(self.data['ch1'])) ) |