From 52f246c6e507e5d49972aed55ca502eafd3a728c Mon Sep 17 00:00:00 2001 From: "Eugeniy E. Mikhailov" Date: Wed, 17 Jul 2024 21:43:24 -0400 Subject: simplify DAQ loading --- qolab/hardware/daq/__init__.py | 16 +++------------- qolab/hardware/daq/_basic.py | 17 +++++++++++++++++ qolab/hardware/daq/labjack_ue9.py | 2 +- 3 files changed, 21 insertions(+), 14 deletions(-) create mode 100644 qolab/hardware/daq/_basic.py diff --git a/qolab/hardware/daq/__init__.py b/qolab/hardware/daq/__init__.py index 828dfb8..c8a26e2 100644 --- a/qolab/hardware/daq/__init__.py +++ b/qolab/hardware/daq/__init__.py @@ -1,15 +1,5 @@ -from qolab.hardware.basic import BasicInstrument +"""DAQ classes.""" +from .labjack_ue9 import LabJackUE9 -class DAQ(BasicInstrument): - # Minimal set of methods to be implemented by a RFGenerator - def __init__(self, *args, **kwds): - BasicInstrument.__init__(self, *args, **kwds) - self.config["Device type"] = "DAQ" - self.config["Device model"] = "Generic DAQ Without Hardware interface" - self.config["FnamePrefix"] = "daq" - self.deviceProperties.update({"AnalogInputsNum", "AnalogOutputsNum"}) - - # this is device dependent - self.AnalogInputsNum = 0 - self.AnalogOutputsNum = 0 +__all__ = ["LabJackUE9"] diff --git a/qolab/hardware/daq/_basic.py b/qolab/hardware/daq/_basic.py new file mode 100644 index 0000000..0eb0ca8 --- /dev/null +++ b/qolab/hardware/daq/_basic.py @@ -0,0 +1,17 @@ +"""Basic DAQ to be included into hardware aware classes.""" + +from qolab.hardware.basic import BasicInstrument + + +class DAQ(BasicInstrument): + # Minimal set of methods to be implemented by a RFGenerator + def __init__(self, *args, **kwds): + BasicInstrument.__init__(self, *args, **kwds) + self.config["Device type"] = "DAQ" + self.config["Device model"] = "Generic DAQ Without Hardware interface" + self.config["FnamePrefix"] = "daq" + self.deviceProperties.update({"AnalogInputsNum", "AnalogOutputsNum"}) + + # this is device dependent + self.AnalogInputsNum = 0 + self.AnalogOutputsNum = 0 diff --git a/qolab/hardware/daq/labjack_ue9.py b/qolab/hardware/daq/labjack_ue9.py index 1c0394d..960e2fb 100644 --- a/qolab/hardware/daq/labjack_ue9.py +++ b/qolab/hardware/daq/labjack_ue9.py @@ -1,4 +1,4 @@ -from qolab.hardware.daq import DAQ +from ._basic import DAQ import ue9 -- cgit v1.2.3