diff options
author | Eugeniy E. Mikhailov <evgmik@gmail.com> | 2021-06-15 18:34:21 -0400 |
---|---|---|
committer | Eugeniy E. Mikhailov <evgmik@gmail.com> | 2021-06-15 18:34:21 -0400 |
commit | 158e1e84390a9284b825369c74e2fc53a914ece9 (patch) | |
tree | 2858544321bf145c5737b2d197ca1c5d2ed1de22 /eitControl.py | |
parent | 7084ce4538dcd9977ba6df0c48b7022270cee538 (diff) | |
download | pyExpControl-158e1e84390a9284b825369c74e2fc53a914ece9.tar.gz pyExpControl-158e1e84390a9284b825369c74e2fc53a914ece9.zip |
better code partitionin for hardware and gui setup
Diffstat (limited to 'eitControl.py')
-rw-r--r-- | eitControl.py | 16 |
1 files changed, 9 insertions, 7 deletions
diff --git a/eitControl.py b/eitControl.py index d1a967b..e2a1188 100644 --- a/eitControl.py +++ b/eitControl.py @@ -46,17 +46,11 @@ class Experiment: self.xlabel='' self.channelGraph={} self.clearData() - self.guiSetup(root) - self.guiSweeper = Sweeper(self.root, Npoints=10, SweepTime=1, onTicCallbacks=[self.updatePlot]) self.hardware = {} - self.sweeper = Sweeper(self.root, Npoints=500, SweepTime=10, onTicCallbacks=[self.onTic]) - self.funcGen = TriangleGen(0, 5, sweeper = self.sweeper) - self.fCent = fCent = 6.83468e9 - self.fSpan = fSpan = 100e3 - self.rfGenFunc = RampGen(fCent-fSpan/2, fCent+fSpan/2, sweeper = self.sweeper) self.hardwareSetup(args) # now we ready to do gui + self.guiSweeper = Sweeper(self.root, Npoints=10, SweepTime=1, onTicCallbacks=[self.updatePlot]) self.guiSetup(root) self.guiSweeper.cmdStart() @@ -64,9 +58,11 @@ class Experiment: def hardwareSetup(self,args): if args.test: print("Test mode, run with fake hardware") + self.sweeper = Sweeper(self.root, Npoints=100, SweepTime=1, onTicCallbacks=[self.onTic]) self.hardware['LabJack'] = ue9qol.UE9qolDummy(sweeper=self.sweeper) self.hardware['rfGen'] = rfGen.rfGenLMX2487Dummy(port='/dev/ttyUSB0', speed=115200, timeout=1) else: + self.sweeper = Sweeper(self.root, Npoints=500, SweepTime=10, onTicCallbacks=[self.onTic]) self.hardware['LabJack'] = ue9qol.UE9qol() if platform.system() == 'Linux': rf=rfGen.rfGenLMX2487(port='/dev/ttyUSB0', speed=115200, timeout=1) @@ -74,6 +70,12 @@ 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) + + self.funcGen = TriangleGen(0, 5, sweeper = self.sweeper) + def guiSetup(self, root): area = DockArea() d1 = Dock("Controls", size=(5,1)) |