LASP 1.0
Library for Acoustic Signal Processing
|
Data translation DT9837A Daq device. More...
#include <lasp_uldaq_impl.h>
Public Member Functions | |
DT9837A (const UlDaqDeviceInfo &devinfo, const DaqConfiguration &config) | |
Create a DT9837A instance. | |
virtual | ~DT9837A () |
bool | isRunning () const |
Returns true when the stream is running. | |
void | stop () override final |
Stop the data-acquisition. | |
virtual void | start (InDaqCallback inCallback, OutDaqCallback outCallback) override final |
Start the Daq. | |
virtual StreamStatus | getStreamStatus () const override |
Obtain copy of stream status (thread-safe function) | |
Public Member Functions inherited from Daq | |
virtual | ~Daq ()=0 |
us | neninchannels (bool include_monitorchannels=true) const |
Returns the number of enabled input channels. | |
us | nenoutchannels () const |
Returns the number of enabled output channels. | |
boolvec | eninchannels (const bool include_monitor=true) const |
Create a vector of boolean values of the enabled input channels. | |
boolvec | enoutchannels () const |
Create an array of booleans for each enabled output channel. | |
double | samplerate () const |
Returns current sample rate. | |
dvec | inputRangeForEnabledChannels (const bool include_monitor=true) const |
Returns the input range for each channel. Maximum allowed absolute value of the signal that can pass unclipped. | |
DataTypeDescriptor::DataType | dataType () const |
Returns datatype (enum) corresponding to the datatype of the samples. | |
const DataTypeDescriptor & | dtypeDescr () const |
More elaborate description of the datatypes. | |
us | framesPerBlock () const |
The number of frames that is send in a block of DaqData. | |
bool | duplexMode () const |
Whether the device runs in duplex mode (both input and output), or false if only input / only output. | |
Public Member Functions inherited from DaqConfiguration | |
std::string | toTOML () const |
Export the class to TOML markup language. | |
std::vector< DaqChannel > | enabledInChannels (const bool include_monitor=true) const |
Return list of enabled input channels. | |
DaqConfiguration (const DeviceInfo &deviceinfo) | |
Create a default configuration, with all channels disabled on both input and output, and default channel names. | |
DaqConfiguration () | |
bool | match (const DeviceInfo &devinfo) const |
Check to see whether the DAQ configuration matches with the device. This means, some basic checks are done on channels, sampling rate, etc, and that the name corresponds with the device name. | |
int | getHighestEnabledInChannel () const |
Get the enabled highest channel number from the list of enabled input channels. | |
int | getHighestEnabledOutChannel () const |
Get the highest channel number from the list of enabled output channels. | |
int | getLowestEnabledInChannel () const |
Get the lowest channel number from the list of enabled input channels. | |
int | getLowestEnabledOutChannel () const |
Get the lowest channel number from the list of enabled output channels. | |
void | setAllInputEnabled (bool val) |
Set all input channels to enabled / disabled state. | |
void | setAllOutputEnabled (bool val) |
Set all output channels to enabled / disabled state. | |
Public Member Functions inherited from DeviceInfo | |
virtual | ~DeviceInfo () |
Virtual desctructor. Can be derived class. | |
DeviceInfo & | operator= (const DeviceInfo &)=delete |
virtual std::unique_ptr< DeviceInfo > | clone () const |
Clone a device info. | |
double | prefSampleRate () const |
operator string () const | |
String representation of DeviceInfo. | |
Friends | |
class | InBufHandler |
class | OutBufHandler |
Additional Inherited Members | |
Public Types inherited from Daq | |
using | rte = std::runtime_error |
Static Public Member Functions inherited from Daq | |
static std::unique_ptr< Daq > | createDaq (const DeviceInfo &devinfo, const DaqConfiguration &config) |
Create a Daq based on given device info and configuration. | |
Static Public Member Functions inherited from DaqConfiguration | |
static DaqConfiguration | fromTOML (const std::string &toml) |
Load in a DAQConfiguration from TOML. | |
Static Public Member Functions inherited from DeviceInfo | |
static DeviceInfoList | getDeviceInfo () |
Create a list of DeviceInfo's that are at call time avalable. | |
Public Attributes inherited from DaqConfiguration | |
DaqApi | api |
string | device_name |
The internal device name this DAQ configuration applies to. | |
std::vector< DaqChannel > | inchannel_config |
Channel configuration for input channels. | |
std::vector< DaqChannel > | outchannel_config |
Channel configuration for output channels. | |
int | sampleRateIndex = 0 |
Index in list of sample rates that are available for the device. | |
int | dataTypeIndex = 0 |
Required datatype for output, should be present in the list. | |
int | framesPerBlockIndex = 0 |
The index in the array of frames per block that can be used for the device. | |
bool | monitorOutput = false |
If set to true and if the device has this capability, the output channels are added as input channels as well. | |
Public Attributes inherited from DeviceInfo | |
DaqApi | api |
Backend API corresponding to device. | |
string | device_name = "" |
The name of the device. | |
std::vector< DataTypeDescriptor::DataType > | availableDataTypes |
The available data types the device can output. | |
int | prefDataTypeIndex = 0 |
The device's prefferd data type. | |
dvec | availableSampleRates |
Available sample rates the device can run on. | |
int | prefSampleRateIndex = -1 |
Preferred setting for the sample rate. | |
usvec | availableFramesPerBlock |
Available latency-setting (number of frames passed in each callback). | |
us | prefFramesPerBlockIndex = 0 |
Preffered number of frames per callback. | |
dvec | availableInputRanges |
Available ranges for the input, i.e. +/- 1V and/or +/- 10 V etc. | |
int | prefInputRangeIndex = 0 |
Its preffered range. | |
unsigned | ninchannels = 0 |
The number of input channels available for the device. | |
unsigned | noutchannels = 0 |
The number of output channels available for the device. | |
bool | hasInputIEPE = false |
Whether the device is capable to provide IEPE constant current power supply. | |
bool | hasInputACCouplingSwitch = false |
Whether the device is capable of enabling a hardware AC-coupling. | |
bool | hasInputTrigger = false |
Whether the device is able to trigger on input. | |
bool | hasInternalOutputMonitor = false |
Whether the device has an internal monitor of the output signal. If true, the device is able to monitor output signals internally and able to present output signals as virtual input signals. This only works together Daq's that are able to run in full duplex mode. | |
bool | duplexModeForced = false |
This flag is used to be able to indicate that the device cannot run input and output streams independently, without opening the device in duplex mode. This is for example true for the UlDaq: only one handle to the device can be given at the same time. | |
DaqChannel::Qty | physicalOutputQty = DaqChannel::Qty::Number |
The physical quantity of the output signal. For 'normal' audio devices, this is typically a 'number' between +/- full scale. For some devices however, the output quantity corresponds to a physical signal, such a Volts. | |
Protected Member Functions inherited from Daq | |
Daq (const DeviceInfo &devinfo, const DaqConfiguration &config) | |
Daq (const Daq &)=delete | |
Data translation DT9837A Daq device.
Definition at line 29 of file lasp_uldaq_impl.h.
DT9837A::DT9837A | ( | const UlDaqDeviceInfo & | devinfo, |
const DaqConfiguration & | config | ||
) |
Create a DT9837A instance.
devinfo | DeviceInfo to connect to |
config | DaqConfiguration settings |
|
virtual |
|
inlineoverridevirtual |
Obtain copy of stream status (thread-safe function)
Implements Daq.
Definition at line 104 of file lasp_uldaq_impl.h.
bool DT9837A::isRunning | ( | ) | const |
Returns true when the stream is running.
|
finaloverridevirtual |
Start the Daq.
inCallback | Function that is called with input data as argument, and which expects output data as a return value. If no input data is required, this callback should be unset. |
outCallback | Function that is called when output data is required. If the stream does not require output data, this callback should be unset. |
Implements Daq.
|
finaloverridevirtual |
Stop the data-acquisition.
Implements Daq.
|
friend |
Definition at line 93 of file lasp_uldaq_impl.h.
|
friend |
Definition at line 94 of file lasp_uldaq_impl.h.