refactor: moved nidaq to subfolder
This commit is contained in:
0
debye_bec/devices/nidaq/__init__.py
Normal file
0
debye_bec/devices/nidaq/__init__.py
Normal file
@@ -1,4 +1,4 @@
|
||||
import enum
|
||||
|
||||
|
||||
from typing import Literal
|
||||
|
||||
@@ -7,55 +7,13 @@ from ophyd import Device, Kind, DeviceStatus, Component as Cpt
|
||||
from ophyd import EpicsSignal, EpicsSignalRO
|
||||
from ophyd_devices.sim.sim_signals import SetableSignal
|
||||
from bec_lib.logger import bec_logger
|
||||
from debye_bec.devices.nidaq.nidaq_enums import NIDAQCompression, ScanType, NidaqState, ScanRates, ReadoutRange, EncoderTypes
|
||||
|
||||
logger = bec_logger.logger
|
||||
|
||||
class NidaqError(Exception):
|
||||
""" Nidaq specific error"""
|
||||
|
||||
class NIDAQCompression(str, enum.Enum):
|
||||
""" Options for Compression"""
|
||||
OFF = 0
|
||||
ON = 1
|
||||
|
||||
class ScanType(int, enum.Enum):
|
||||
""" Triggering options of the backend"""
|
||||
TRIGGERED = 0
|
||||
CONTINUOUS = 1
|
||||
|
||||
class NidaqState(int, enum.Enum):
|
||||
""" Possible States of the NIDAQ backend"""
|
||||
DISABLED = 0
|
||||
STANDBY = 1
|
||||
STAGE = 2
|
||||
KICKOFF = 3
|
||||
ACQUIRE = 4
|
||||
UNSTAGE = 5
|
||||
|
||||
class ScanRates(int, enum.Enum):
|
||||
""" Sampling Rate options for the backend, in kHZ and MHz"""
|
||||
HUNDRED_KHZ = 0
|
||||
FIVE_HUNDRED_KHZ = 1
|
||||
ONE_MHZ = 2
|
||||
TWO_MHZ = 3
|
||||
FOUR_MHZ = 4
|
||||
FIVE_MHZ = 5
|
||||
TEN_MHZ = 6
|
||||
FOURTEEN_THREE_MHZ = 7
|
||||
|
||||
class ReadoutRange(int, enum.Enum):
|
||||
"""ReadoutRange in +-V"""
|
||||
ONE_V = 0
|
||||
TWO_V = 1
|
||||
FIVE_V = 2
|
||||
TEN_V = 3
|
||||
|
||||
class EncoderTypes(int, enum.Enum):
|
||||
""" Encoder Types"""
|
||||
X_1 = 0
|
||||
X_2 = 1
|
||||
X_4 = 2
|
||||
|
||||
class NIDAQCustomMixin(CustomDetectorMixin):
|
||||
""" NIDAQ Custom Mixin class to implement the device and beamline-specific actions
|
||||
to the psidetectorbase class via custom_prepare methods"""
|
||||
@@ -146,7 +104,7 @@ class NIDAQCustomMixin(CustomDetectorMixin):
|
||||
logger.info(f"Device {self.parent.name} was unstaged: {NidaqState(self.parent.state.get())}")
|
||||
|
||||
|
||||
class NIDAQ(PSIDetectorBase):
|
||||
class Nidaq(PSIDetectorBase):
|
||||
""" NIDAQ ophyd wrapper around the NIDAQ backend currently running at x01da-cons-05
|
||||
|
||||
Args:
|
||||
@@ -159,7 +117,7 @@ class NIDAQ(PSIDetectorBase):
|
||||
|
||||
USER_ACCESS = ['set_config']
|
||||
|
||||
encoder_angle = Cpt(SetableSignal,value=0, kind=Kind.normal)
|
||||
enc = Cpt(SetableSignal,value=0, kind=Kind.normal)
|
||||
signal_1 = Cpt(SetableSignal,value=0, kind=Kind.normal)
|
||||
signal_2 = Cpt(SetableSignal,value=0, kind=Kind.normal)
|
||||
signal_3 = Cpt(SetableSignal,value=0, kind=Kind.normal)
|
||||
45
debye_bec/devices/nidaq/nidaq_enums.py
Normal file
45
debye_bec/devices/nidaq/nidaq_enums.py
Normal file
@@ -0,0 +1,45 @@
|
||||
import enum
|
||||
|
||||
|
||||
class NIDAQCompression(str, enum.Enum):
|
||||
""" Options for Compression"""
|
||||
OFF = 0
|
||||
ON = 1
|
||||
|
||||
class ScanType(int, enum.Enum):
|
||||
""" Triggering options of the backend"""
|
||||
TRIGGERED = 0
|
||||
CONTINUOUS = 1
|
||||
|
||||
class NidaqState(int, enum.Enum):
|
||||
""" Possible States of the NIDAQ backend"""
|
||||
DISABLED = 0
|
||||
STANDBY = 1
|
||||
STAGE = 2
|
||||
KICKOFF = 3
|
||||
ACQUIRE = 4
|
||||
UNSTAGE = 5
|
||||
|
||||
class ScanRates(int, enum.Enum):
|
||||
""" Sampling Rate options for the backend, in kHZ and MHz"""
|
||||
HUNDRED_KHZ = 0
|
||||
FIVE_HUNDRED_KHZ = 1
|
||||
ONE_MHZ = 2
|
||||
TWO_MHZ = 3
|
||||
FOUR_MHZ = 4
|
||||
FIVE_MHZ = 5
|
||||
TEN_MHZ = 6
|
||||
FOURTEEN_THREE_MHZ = 7
|
||||
|
||||
class ReadoutRange(int, enum.Enum):
|
||||
"""ReadoutRange in +-V"""
|
||||
ONE_V = 0
|
||||
TWO_V = 1
|
||||
FIVE_V = 2
|
||||
TEN_V = 3
|
||||
|
||||
class EncoderTypes(int, enum.Enum):
|
||||
""" Encoder Types"""
|
||||
X_1 = 0
|
||||
X_2 = 1
|
||||
X_4 = 2
|
||||
Reference in New Issue
Block a user