aboutsummaryrefslogtreecommitdiff
path: root/eitControl.py
diff options
context:
space:
mode:
authorEugeniy E. Mikhailov <evgmik@gmail.com>2021-06-15 23:02:30 -0400
committerEugeniy E. Mikhailov <evgmik@gmail.com>2021-06-15 23:02:30 -0400
commita42a0ce2983520ce3700008f4bfc9502279569c7 (patch)
treef760ed59c75101b7807dc1b46cf0c280e97b41da /eitControl.py
parente508d982779005d3d40cce156d9219744d47cc71 (diff)
downloadqolab-a42a0ce2983520ce3700008f4bfc9502279569c7.tar.gz
qolab-a42a0ce2983520ce3700008f4bfc9502279569c7.zip
added spin boxes for central and frequency span
Diffstat (limited to 'eitControl.py')
-rw-r--r--eitControl.py27
1 files changed, 24 insertions, 3 deletions
diff --git a/eitControl.py b/eitControl.py
index e2a1188..84884f6 100644
--- a/eitControl.py
+++ b/eitControl.py
@@ -110,6 +110,25 @@ class Experiment:
w1.addWidget(bExit, row=0, col=5)
d1.addWidget(w1)
+ # RF gen gui
+ fCent=self.rfGenFunc.getCenter()
+ fSpan=self.rfGenFunc.getSpan()
+ spins = [
+ ("Central Frequency",
+ pg.SpinBox(value=fCent, bounds=[6.83e9, 6.84e9], suffix='Hz', siPrefix=True, step=1e3, decimals=10),
+ self.centralFreqValueChanged),
+ ("Frequency Span",
+ pg.SpinBox(value=fSpan, bounds=[1, 10e6], dec=True, step=0.5, suffix='Hz', siPrefix=True, minStep=1),
+ self.freqSpanValueChanged)
+ ]
+ w3 = pg.LayoutWidget()
+ d3.addWidget(w3)
+ for text, spin, cb in spins:
+ l=QtGui.QLabel(text)
+ w3.addWidget(l)
+ w3.addWidget(spin)
+ spin.sigValueChanged.connect(cb)
+
def clearData(self):
self.data = {}
for ch in self.channelsNames2grab:
@@ -232,7 +251,8 @@ class Experiment:
# self.data['x'].append(tic)
# self.data['x']=self.data[self.xChannelName]
x=self.data[self.xChannelName][-1]
- x=(x-self.fCent)
+ fCent = self.rfGenFunc.getCenter()
+ x=(x-fCent)
self.data['x'].append(x)
self.dataPlot.setLabel('bottom', 'Frequency offset', units='Hz')
self.dataPlot.setLabel('left', 'Signal', units='V')
@@ -261,8 +281,9 @@ class Experiment:
self.channelGraph[name].setData(x,y)
# centralFreqFormatted = pg.siFormat(self.fCent, suffix='Hz', precision=4)
# showing trailing zeros is tricky
- centralFreqFormatted = f"{self.fCent/1e9:.6}"
- centralFreqFormatted = str.ljust(centralFreqFormatted, 8, '0') + " GHz"
+ fCent = self.rfGenFunc.getCenter()
+ centralFreqFormatted = f"{fCent/1e9:.9f}"
+ centralFreqFormatted = str.ljust(centralFreqFormatted, 11, '0') + " GHz"
self.dataPlot.setTitle(f"Signals around center frequency {centralFreqFormatted}")
stop = datetime.now()