aboutsummaryrefslogtreecommitdiff
path: root/qolab/hardware
diff options
context:
space:
mode:
authorEugeniy E. Mikhailov <evgmik@gmail.com>2024-07-16 22:09:15 -0400
committerEugeniy E. Mikhailov <evgmik@gmail.com>2024-07-16 22:09:15 -0400
commit666904e78ef43d4f3e941d8bd30a31cfb2a9d25a (patch)
tree339a191dd30c6b874959d85985afca8b20dd5cac /qolab/hardware
parent2e6e889a01c19ba30010e68ad8e1ea34e7e877ab (diff)
downloadqolab-666904e78ef43d4f3e941d8bd30a31cfb2a9d25a.tar.gz
qolab-666904e78ef43d4f3e941d8bd30a31cfb2a9d25a.zip
refactoring RF generators
Diffstat (limited to 'qolab/hardware')
-rw-r--r--qolab/hardware/rf_generator/__init__.py34
-rw-r--r--qolab/hardware/rf_generator/_basic.py34
-rw-r--r--qolab/hardware/rf_generator/agilent_e8257d.py2
-rw-r--r--qolab/hardware/rf_generator/qol_lmx2487.py2
4 files changed, 40 insertions, 32 deletions
diff --git a/qolab/hardware/rf_generator/__init__.py b/qolab/hardware/rf_generator/__init__.py
index 7178408..3305765 100644
--- a/qolab/hardware/rf_generator/__init__.py
+++ b/qolab/hardware/rf_generator/__init__.py
@@ -1,32 +1,6 @@
-from qolab.hardware.scpi import SCPIinstr
-from qolab.hardware.basic import BasicInstrument
+"""RF generators classes."""
+from .agilent_e8257d import AgilentE8257D
+from .qol_lmx2487 import QOL_LMX2487
-class RFGenerator(BasicInstrument):
- """Minimal set of methods to be implemented by a RF Generator.
-
- Intended to be used as a parent for hardware aware classes.
- """
-
- def __init__(self, *args, **kwds):
- BasicInstrument.__init__(self, *args, **kwds)
- self.config["Device type"] = "RFGenerator"
- self.config["Device model"] = "Generic RF generator Without Hardware interface"
- self.config["FnamePrefix"] = "rfgen"
- self.deviceProperties.update({"FreqFixed"})
-
-
-class RFGeneratorSCPI(SCPIinstr, RFGenerator):
- """SCPI aware RF generator.
-
- Example
- -------
-
- >>> rm = pyvisa.ResourceManager()
- >>> RFGeneratorSCPI(rm.open_resource('TCPIP::192.168.0.2::INSTR'))
- """
-
- def __init__(self, resource, *args, **kwds):
- SCPIinstr.__init__(self, resource)
- RFGenerator.__init__(self, *args, **kwds)
- self.config["DeviceId"] = str.strip(self.idn)
+__all__ = ["AgilentE8257D", "QOL_LMX2487"]
diff --git a/qolab/hardware/rf_generator/_basic.py b/qolab/hardware/rf_generator/_basic.py
new file mode 100644
index 0000000..e16c270
--- /dev/null
+++ b/qolab/hardware/rf_generator/_basic.py
@@ -0,0 +1,34 @@
+"""Basic RF generator classes to implement hardware aware classes."""
+
+from qolab.hardware.scpi import SCPIinstr
+from qolab.hardware.basic import BasicInstrument
+
+
+class RFGenerator(BasicInstrument):
+ """Minimal set of methods to be implemented by a RF Generator.
+
+ Intended to be used as a parent for hardware aware classes.
+ """
+
+ def __init__(self, *args, **kwds):
+ BasicInstrument.__init__(self, *args, **kwds)
+ self.config["Device type"] = "RFGenerator"
+ self.config["Device model"] = "Generic RF generator Without Hardware interface"
+ self.config["FnamePrefix"] = "rfgen"
+ self.deviceProperties.update({"FreqFixed"})
+
+
+class RFGeneratorSCPI(SCPIinstr, RFGenerator):
+ """SCPI aware RF generator.
+
+ Example
+ -------
+
+ >>> rm = pyvisa.ResourceManager()
+ >>> RFGeneratorSCPI(rm.open_resource('TCPIP::192.168.0.2::INSTR'))
+ """
+
+ def __init__(self, resource, *args, **kwds):
+ SCPIinstr.__init__(self, resource)
+ RFGenerator.__init__(self, *args, **kwds)
+ self.config["DeviceId"] = str.strip(self.idn)
diff --git a/qolab/hardware/rf_generator/agilent_e8257d.py b/qolab/hardware/rf_generator/agilent_e8257d.py
index c9df94b..1c7ef16 100644
--- a/qolab/hardware/rf_generator/agilent_e8257d.py
+++ b/qolab/hardware/rf_generator/agilent_e8257d.py
@@ -1,5 +1,5 @@
from qolab.hardware.basic import BasicInstrument
-from qolab.hardware.rf_generator import RFGeneratorSCPI
+from ._basic import RFGeneratorSCPI
class AgilentE8257D(RFGeneratorSCPI):
diff --git a/qolab/hardware/rf_generator/qol_lmx2487.py b/qolab/hardware/rf_generator/qol_lmx2487.py
index dc1fa1a..0b9c132 100644
--- a/qolab/hardware/rf_generator/qol_lmx2487.py
+++ b/qolab/hardware/rf_generator/qol_lmx2487.py
@@ -1,5 +1,5 @@
from qolab.hardware.basic import BasicInstrument
-from qolab.hardware.rf_generator import RFGenerator
+from ._basic import RFGenerator
import serial
import re
import time