2#include "lasp_config.h"
15using dvec = std::vector<double>;
69 return dtype == o.dtype;
74 .
name =
"32-bits floating point",
79 .
name =
"64-bits floating point",
84 .
name =
"8-bits integer",
89 .
name =
"16-bits integer",
94 .
name =
"32-bits integer",
99const std::map<DataTypeDescriptor::DataType, const DataTypeDescriptor>
132#if LASP_HAS_ULDAQ == 1
133const us LASP_ULDAQ_APICODE = 0;
134const DaqApi uldaqapi(
"UlDaq", 0);
136#if LASP_HAS_RTAUDIO == 1
138const us LASP_RTAUDIO_APICODE = 1;
139const DaqApi rtaudioAlsaApi(
"RtAudio Linux ALSA", 1, RtAudio::Api::LINUX_ALSA);
140const DaqApi rtaudioPulseaudioApi(
"RtAudio Linux Pulseaudio", LASP_RTAUDIO_APICODE,
141 RtAudio::Api::LINUX_PULSE);
142const DaqApi rtaudioWasapiApi(
"RtAudio Windows Wasapi", LASP_RTAUDIO_APICODE,
143 RtAudio::Api::WINDOWS_WASAPI);
144const DaqApi rtaudioDsApi(
"RtAudio Windows DirectSound", LASP_RTAUDIO_APICODE,
145 RtAudio::Api::WINDOWS_DS);
146const DaqApi rtaudioAsioApi(
"RtAudio Windows ASIO", LASP_RTAUDIO_APICODE,
147 RtAudio::Api::WINDOWS_ASIO);
149#if LASP_HAS_PORTAUDIO == 1
150const us LASP_PORTAUDIO_APICODE = 2;
151const DaqApi portaudioApi(
"PortAudio Linux ALSA", LASP_PORTAUDIO_APICODE, 0);
232 std::string
toTOML()
const;
262 std::vector<DaqChannel>
Class that specifies API related information. An API configuration is part of the DAQConfiguration an...
bool operator==(const DaqApi &other) const
unsigned api_specific_subcode
DaqApi(string apiname, unsigned apicode, unsigned api_specific_subcode=0)
static std::vector< DaqApi > getAvailableApis()
Stores channel configuration data for each channel. I.e. the physical quantity measured,...
Qty
Possible physical quantities that are recorded.
bool operator==(const DaqChannel &other) const
Compare two channels to eachother. They are equal when the name, sensitivity and quantity are the sam...
double sensitivity
The conversion between recorded physical unit and stored / outputed number, i.e. Number/Volt or Numbe...
double digitalHighPassCutOn
Whether to enable a digital high pass on the signal before passing the result in case of input,...
bool IEPEEnabled
For input-only: enable IEPE constant current power supply for this channel. Only for hardware that is...
int rangeIndex
Index in possible ranges for input / output.
bool ACCouplingMode
Whether to enable HW AC-coupling for this channel.
Qty qty
The physical quantity that is inputed / outputed.
bool enabled
Whether the channel is enabled.
Configuration of a DAQ device.
static DaqConfiguration fromTOML(const std::string &toml)
Load in a DAQConfiguration from TOML.
std::vector< DaqChannel > enabledInChannels(const bool include_monitor=true) const
Return list of enabled input channels.
int framesPerBlockIndex
The index in the array of frames per block that can be used for the device.
int dataTypeIndex
Required datatype for output, should be present in the list.
std::vector< DaqChannel > inchannel_config
Channel configuration for input channels.
bool monitorOutput
If set to true and if the device has this capability, the output channels are added as input channels...
int getHighestEnabledOutChannel() const
Get the highest channel number from the list of enabled output channels.
int getHighestEnabledInChannel() const
Get the enabled highest channel number from the list of enabled input channels.
string device_name
The internal device name this DAQ configuration applies to.
std::string toTOML() const
Export the class to TOML markup language.
int sampleRateIndex
Index in list of sample rates that are available for the device.
int getLowestEnabledInChannel() const
Get the lowest channel number from the list of enabled input channels.
std::vector< DaqChannel > outchannel_config
Channel configuration for output channels.
void setAllInputEnabled(bool val)
Set all input channels to enabled / disabled state.
bool match(const DeviceInfo &devinfo) const
Check to see whether the DAQ configuration matches with the device. This means, some basic checks are...
int getLowestEnabledOutChannel() const
Get the lowest channel number from the list of enabled output channels.
void setAllOutputEnabled(bool val)
Set all output channels to enabled / disabled state.
Descriptor for data types containing more detailed information.
bool operator==(const DataTypeDescriptor &o) noexcept
Compare two data type descriptors. Returns true if the DataType enumerator is the same.
unsigned sw
Sample width of a single sample, in bytes.
string name
Name of the datatype.
bool is_floating
Whether the datatype is a floating point Y/N.
DataType
Basic data types coming from a DAQ that we can deal with. The naming will be self-explainging.
DataType dtype
The number from the enumeration.
Structure containing device info parameters.
const DataTypeDescriptor dtype_desc_fl64
const DataTypeDescriptor dtype_desc_fl32
std::vector< double > dvec
const std::map< DataTypeDescriptor::DataType, const DataTypeDescriptor > dtype_map
const DataTypeDescriptor dtype_desc_int16
const DataTypeDescriptor dtype_desc_int32
const DataTypeDescriptor dtype_desc_int8
std::vector< bool > boolvec
size_t us
We often use boolean values.