aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorEugeniy E. Mikhailov <evgmik@gmail.com>2021-06-15 23:17:30 -0400
committerEugeniy E. Mikhailov <evgmik@gmail.com>2021-06-15 23:17:30 -0400
commit3ccb238caa6f7ae690fba601a846d603cfc50d56 (patch)
tree884d6afbf70098d36b2fb75b4eb5ee976e81305c
parenta42a0ce2983520ce3700008f4bfc9502279569c7 (diff)
downloadpyExpControl-3.0-gui-controls.tar.gz
pyExpControl-3.0-gui-controls.zip
spin boxes control the hardware and plotsv3.0-gui-controls
-rw-r--r--eitControl.py31
1 files changed, 22 insertions, 9 deletions
diff --git a/eitControl.py b/eitControl.py
index 84884f6..73f83a4 100644
--- a/eitControl.py
+++ b/eitControl.py
@@ -70,18 +70,31 @@ class Experiment:
rf=rfGen.rfGenLMX2487(port='COM5', speed=115200, timeout=1)
self.hardware['rfGen'] = rf
- self.fCent = fCent = 6.83468e9
- self.fSpan = fSpan = 100e3
- self.rfGenFunc = RampGen(fCent-fSpan/2, fCent+fSpan/2, sweeper = self.sweeper)
+ fCent = 6.83468e9
+ fSpan = 100e3
+ self.rfGenFunc = RampGen(start=0, stop=0, sweeper = self.sweeper)
+ self.rfGenFunc.setCenter(fCent)
+ self.rfGenFunc.setSpan(fSpan)
self.funcGen = TriangleGen(0, 5, sweeper = self.sweeper)
+
+ def centralFreqValueChanged(self, sb):
+ self.rfGenFunc.setCenter(sb.value())
+ pass
+
+ def freqSpanValueChanged(self, sb):
+ self.rfGenFunc.setSpan(sb.value())
+ pass
+
def guiSetup(self, root):
- area = DockArea()
- d1 = Dock("Controls", size=(5,1))
+ self.dockArea = area = DockArea()
+ d1 = Dock("Global", size=(5,1))
d2 = Dock("Data", size=(100,100))
+ d3 = Dock("RF Gen", size=(1,2))
area.addDock(d1, 'top')
area.addDock(d2, 'bottom', d1)
+ area.addDock(d3, 'bottom', d2)
self.root.addWidget(area)
self.dataPlot = pg.PlotWidget(name='Plot1')
@@ -89,6 +102,7 @@ class Experiment:
self.dataPlot.showGrid(x=True, y=True)
self.dataPlot.addLegend()
+ # global buttons
w1 = pg.LayoutWidget()
bAutoZoom = QtGui.QPushButton('AutoZoom')
bAutoZoom.clicked.connect(self.autoZoom)
@@ -248,12 +262,11 @@ class Experiment:
self.data['adc3'].append( adc3 )
# X-axis (i.e. independent variable)
- # self.data['x'].append(tic)
- # self.data['x']=self.data[self.xChannelName]
- x=self.data[self.xChannelName][-1]
+ x=self.data[self.xChannelName]
+ x=np.array(x)
fCent = self.rfGenFunc.getCenter()
x=(x-fCent)
- self.data['x'].append(x)
+ self.data['x'] = x
self.dataPlot.setLabel('bottom', 'Frequency offset', units='Hz')
self.dataPlot.setLabel('left', 'Signal', units='V')