aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--eitControl.py15
-rw-r--r--rfGen.py6
2 files changed, 13 insertions, 8 deletions
diff --git a/eitControl.py b/eitControl.py
index e9cda92..d4ae123 100644
--- a/eitControl.py
+++ b/eitControl.py
@@ -18,7 +18,7 @@ import csv
import ue9qol
from funcGenerator import Sweeper, SinGen, TriangleGen, RampGen, PulseGen
-from rfGen import rfGenLMX2487
+import rfGen
class Experiment:
@@ -55,15 +55,14 @@ class Experiment:
if args.test:
print("Test mode, run with fake hardware")
self.hardware['LabJack'] = ue9qol.UE9qolDummy()
+ self.hardware['rfGen'] = rfGen.rfGenLMX2487Dummy(port='/dev/ttyUSB0', speed=115200, timeout=1)
else:
self.hardware['LabJack'] = ue9qol.UE9qol()
-
- if platform.system() == 'Linux':
- rf=rfGenLMX2487(port='/dev/ttyUSB0', speed=115200, timeout=1)
- else:
- rf=rfGenLMX2487(port='COM5', speed=115200, timeout=1)
- self.hardware['rfGen'] = rf
-
+ if platform.system() == 'Linux':
+ rf=rfGen.rfGenLMX2487(port='/dev/ttyUSB0', speed=115200, timeout=1)
+ else:
+ rf=rfGen.rfGenLMX2487(port='COM5', speed=115200, timeout=1)
+ self.hardware['rfGen'] = rf
def guiSetup(self, root):
self.cntrlPannel=ttk.LabelFrame(root, text='controls')
diff --git a/rfGen.py b/rfGen.py
index 19ae017..5100362 100644
--- a/rfGen.py
+++ b/rfGen.py
@@ -40,3 +40,9 @@ class rfGenLMX2487:
cmd_str=f'setFreq({freq:.2f})'
self.sendSerialCmd(cmd_str)
+class rfGenLMX2487Dummy:
+ def __init__(self, port='/dev/ttyUSB0', speed=115200, timeout=1):
+ return
+
+ def setFreq(self,freq):
+ return