Skip to content

Commit

Permalink
Merge pull request #901 from BCDA-APS/900-failed-to-import-labjack
Browse files Browse the repository at this point in the history
BUG: Sphinx failed to import labjack
  • Loading branch information
prjemian authored Jan 3, 2024
2 parents d47c55a + 0c416a7 commit a5acafb
Showing 1 changed file with 16 additions and 13 deletions.
29 changes: 16 additions & 13 deletions apstools/devices/labjack.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
database changed significantly from R2 to R3 when the module was
rewritten to use the LJM library.
.. see:: https://github.com/epics-modules/LabJack/releases/tag/R3-0
.. seealso:: https://github.com/epics-modules/LabJack/releases/tag/R3-0
There are definitions for the entire LabJack device, as well as the
various inputs/outputs available on the LabJack T-series.
Expand All @@ -46,9 +46,9 @@ class MyBeamline(Device):
from ophyd import FormattedComponent as FCpt
from ophyd import Kind

from apstools.synApps import EpicsRecordDeviceCommonAll
from apstools.synApps import EpicsRecordInputFields
from apstools.synApps import EpicsRecordOutputFields
from ..synApps import EpicsRecordDeviceCommonAll
from ..synApps import EpicsRecordInputFields
from ..synApps import EpicsRecordOutputFields

__all__ = [
"AnalogOutput",
Expand All @@ -64,6 +64,9 @@ class MyBeamline(Device):
"LabJackT8",
]

KIND_CONFIG_OR_NORMAL = 3
"""Alternative for ``Kind.config | Kind.normal``."""


class Input(EpicsRecordInputFields, EpicsRecordDeviceCommonAll):
"""A generic input record.
Expand Down Expand Up @@ -390,7 +393,7 @@ class LabJackBase(Device):

# Common sub-devices (all labjacks have 2 analog outputs)
# NB: Analog inputs/digital I/Os are on a per-model basis
analog_outputs = DCpt(make_analog_outputs(2), kind=(Kind.config | Kind.normal))
analog_outputs = DCpt(make_analog_outputs(2), kind=KIND_CONFIG_OR_NORMAL)
waveform_generator = Cpt(WaveformGenerator, "", kind=Kind.omitted)


Expand All @@ -402,8 +405,8 @@ class LabJackT4(LabJackBase):
class WaveformDigitizer(WaveformDigitizer):
waveforms = DCpt(make_digitizer_waveforms(12), kind="normal")

analog_inputs = DCpt(make_analog_inputs(12), kind=(Kind.config | Kind.normal))
digital_ios = DCpt(make_digital_ios(16), kind=(Kind.config | Kind.normal))
analog_inputs = DCpt(make_analog_inputs(12), kind=KIND_CONFIG_OR_NORMAL)
digital_ios = DCpt(make_digital_ios(16), kind=KIND_CONFIG_OR_NORMAL)
waveform_digitizer = Cpt(WaveformDigitizer, "", kind=Kind.omitted)


Expand All @@ -415,8 +418,8 @@ class LabJackT7(LabJackBase):
class WaveformDigitizer(WaveformDigitizer):
waveforms = DCpt(make_digitizer_waveforms(14), kind="normal")

analog_inputs = DCpt(make_analog_inputs(14), kind=(Kind.config | Kind.normal))
digital_ios = DCpt(make_digital_ios(23), kind=(Kind.config | Kind.normal))
analog_inputs = DCpt(make_analog_inputs(14), kind=KIND_CONFIG_OR_NORMAL)
digital_ios = DCpt(make_digital_ios(23), kind=KIND_CONFIG_OR_NORMAL)
waveform_digitizer = Cpt(WaveformDigitizer, "")


Expand All @@ -428,8 +431,8 @@ class LabJackT7Pro(LabJackBase):
class WaveformDigitizer(WaveformDigitizer):
waveforms = DCpt(make_digitizer_waveforms(14), kind="normal")

analog_inputs = DCpt(make_analog_inputs(14), kind=(Kind.config | Kind.normal))
digital_ios = DCpt(make_digital_ios(23), kind=(Kind.config | Kind.normal))
analog_inputs = DCpt(make_analog_inputs(14), kind=KIND_CONFIG_OR_NORMAL)
digital_ios = DCpt(make_digital_ios(23), kind=KIND_CONFIG_OR_NORMAL)
waveform_digitizer = Cpt(WaveformDigitizer, "")


Expand All @@ -441,6 +444,6 @@ class LabJackT8(LabJackBase):
class WaveformDigitizer(WaveformDigitizer):
waveforms = DCpt(make_digitizer_waveforms(8), kind="normal")

analog_inputs = DCpt(make_analog_inputs(8), kind=(Kind.config | Kind.normal))
digital_ios = DCpt(make_digital_ios(20), kind=(Kind.config | Kind.normal))
analog_inputs = DCpt(make_analog_inputs(8), kind=KIND_CONFIG_OR_NORMAL)
digital_ios = DCpt(make_digital_ios(20), kind=KIND_CONFIG_OR_NORMAL)
waveform_digitizer = Cpt(WaveformDigitizer, "")

0 comments on commit a5acafb

Please sign in to comment.