aboutsummaryrefslogtreecommitdiff
path: root/rfGen.py
diff options
context:
space:
mode:
authorEugeniy E. Mikhailov <evgmik@gmail.com>2022-03-09 09:05:30 -0500
committerEugeniy E. Mikhailov <evgmik@gmail.com>2022-03-09 09:05:30 -0500
commitd5f5d2abbe51212c4e6ffdb98f03dab49aabe615 (patch)
tree433ebf194aa1cbccd847be44534b72c45ce63cb0 /rfGen.py
parent537967dc5a2101ae54c4b161cf8ef1abeaa499e6 (diff)
downloadqolab-d5f5d2abbe51212c4e6ffdb98f03dab49aabe615.tar.gz
qolab-d5f5d2abbe51212c4e6ffdb98f03dab49aabe615.zip
removed old files which are not part of qolab package
Diffstat (limited to 'rfGen.py')
-rw-r--r--rfGen.py50
1 files changed, 0 insertions, 50 deletions
diff --git a/rfGen.py b/rfGen.py
deleted file mode 100644
index 3084664..0000000
--- a/rfGen.py
+++ /dev/null
@@ -1,50 +0,0 @@
-import serial
-import io
-
-import time # For sleep, clock, time and perf_counter
-from datetime import datetime, timedelta
-
-class rfGenLMX2487:
- def __init__(self, port='/dev/ttyUSB0', speed=115200, timeout=1, setToDefaults=True):
- self.port = port
- self.speed = speed
- self.timeout = timeout
- self.connection = serial.Serial( self.port, self.speed, timeout=self.timeout)
- self.log = []
- self.logCapacity = 10
- if setToDefaults:
- self.sendSerialCmd("set_lmx2487_board_to_default_state()")
-
- def add2log(self, text):
- self.log.append(text)
- while len(self.log) > self.logCapacity:
- self.log.pop(0)
-
- def log2str(self, interval=None):
- strOut = ""
- for e in self.log:
- strOut += e
- return strOut
-
- def sendSerialCmd(self, cmd):
- self.connection.write(bytes(cmd+'\r','ascii'))
- if "3.4" == serial.__version__:
- # older version style
- resp = self.connection.read_until(terminator=b'> ')
- else:
- # new style after 20180616
- resp = self.connection.read_until(expected=b'> ')
- resp = resp.decode('utf-8')
- self.add2log(resp)
- return resp
-
- def setFreq(self,freq):
- 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