aboutsummaryrefslogtreecommitdiff
path: root/panel.py
diff options
context:
space:
mode:
authorEugeniy E. Mikhailov <evgmik@gmail.com>2021-04-06 16:09:18 -0400
committerEugeniy E. Mikhailov <evgmik@gmail.com>2021-04-06 16:09:18 -0400
commitbfe0860fa9c3b33929d5cb05e1d14d19afc5f968 (patch)
tree48b60db08c565f4351c21ce86d50c81561aa95e9 /panel.py
parent8eaeccf4491dce1338cf3f6edee564e7f3943b83 (diff)
downloadpyExpControl-bfe0860fa9c3b33929d5cb05e1d14d19afc5f968.tar.gz
pyExpControl-bfe0860fa9c3b33929d5cb05e1d14d19afc5f968.zip
some plotting speed up
Diffstat (limited to 'panel.py')
-rw-r--r--panel.py21
1 files changed, 15 insertions, 6 deletions
diff --git a/panel.py b/panel.py
index d1f7232..f96c751 100644
--- a/panel.py
+++ b/panel.py
@@ -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'])) )