aboutsummaryrefslogtreecommitdiff
path: root/panel.py
diff options
context:
space:
mode:
Diffstat (limited to 'panel.py')
-rw-r--r--panel.py20
1 files changed, 16 insertions, 4 deletions
diff --git a/panel.py b/panel.py
index a5003fa..ea0c358 100644
--- a/panel.py
+++ b/panel.py
@@ -6,12 +6,21 @@ import matplotlib.pyplot as plt
from matplotlib.figure import Figure
from matplotlib.backends.backend_tkagg import (FigureCanvasTkAgg, NavigationToolbar2Tk)
+import ue9qol
class Experiment:
def __init__(self, root):
- self.cnt = 1
+ self.tic = 0
+ self.data = {}
+ self.data['tic'] = []
+ self.data['ch1'] = []
self.guiSetup(root)
+ self.hardware = {}
+ self.hardwareSetup()
+
+ def hardwareSetup(self):
+ self.hardware['LabJack'] = ue9qol.UE9qol()
def guiSetup(self, root):
@@ -42,15 +51,18 @@ class Experiment:
self.canvas.get_tk_widget().pack()
def hello(self):
- self.cnt = self.cnt + 1
- self.ax.plot([i for i in range(20)],[i/self.cnt for i in range(20)])
+ tic = self.tic
+ self.data['tic'].append(tic)
+ self.data['ch1'].append( self.hardware['LabJack'].getInputCh(1) )
+ self.tic = self.tic + 1
+ self.ax.plot(self.data['tic'], self.data['ch1'])
self.canvas.draw()
if __name__ == '__main__':
root=Tk()
- Experiment(root)
+ experiment=Experiment(root)
root.mainloop()