aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorEugeniy E. Mikhailov <evgmik@gmail.com>2021-04-02 21:53:20 -0400
committerEugeniy E. Mikhailov <evgmik@gmail.com>2021-04-02 21:53:20 -0400
commitd8c9aa3d2ec67e32407f05cfe2600bf58581a9ae (patch)
tree628e0dbef00c29730f03956f24bff74f657e4b1f
parent181876aaaf6fa2ca087441ed8f8dfeb556f3b843 (diff)
downloadpyExpControl-d8c9aa3d2ec67e32407f05cfe2600bf58581a9ae.tar.gz
pyExpControl-d8c9aa3d2ec67e32407f05cfe2600bf58581a9ae.zip
added panel with daq
-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()