LASP 1.0
Library for Acoustic Signal Processing
Loading...
Searching...
No Matches
DaqConfiguration Class Reference

Configuration of a DAQ device. More...

#include <lasp_daqconfig.h>

Inheritance diagram for DaqConfiguration:
Collaboration diagram for DaqConfiguration:

Public Member Functions

std::string toTOML () const
 Export the class to TOML markup language.
 
std::vector< DaqChannelenabledInChannels (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.
 

Static Public Member Functions

static DaqConfiguration fromTOML (const std::string &toml)
 Load in a DAQConfiguration from TOML.
 

Public Attributes

DaqApi api
 
string device_name
 The internal device name this DAQ configuration applies to.
 
std::vector< DaqChannelinchannel_config
 Channel configuration for input channels.
 
std::vector< DaqChanneloutchannel_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.
 

Detailed Description

Configuration of a DAQ device.

Definition at line 225 of file lasp_daqconfig.h.

Constructor & Destructor Documentation

◆ DaqConfiguration() [1/2]

DaqConfiguration::DaqConfiguration ( const DeviceInfo deviceinfo)

Create a default configuration, with all channels disabled on both input and output, and default channel names.

Parameters
deviceinfoDeviceInfo structure

Definition at line 28 of file lasp_daqconfig.cpp.

◆ DaqConfiguration() [2/2]

DaqConfiguration::DaqConfiguration ( )
inline

Definition at line 300 of file lasp_daqconfig.h.

Member Function Documentation

◆ enabledInChannels()

vector< DaqChannel > DaqConfiguration::enabledInChannels ( const bool  include_monitor = true) const

Return list of enabled input channels.

Parameters
include_monitorIf set to true and a monitor channel is available, the first indices in the array will correspond to the monitor channel(s).
Returns
That.

Definition at line 89 of file lasp_daqconfig.cpp.

◆ fromTOML()

DaqConfiguration DaqConfiguration::fromTOML ( const std::string &  toml)
static

Load in a DAQConfiguration from TOML.

Parameters
tomlString containing TOML data
Returns
DaqConfiguration object

Definition at line 190 of file lasp_daqconfig.cpp.

◆ getHighestEnabledInChannel()

int DaqConfiguration::getHighestEnabledInChannel ( ) const

Get the enabled highest channel number from the list of enabled input channels.

Returns
Index to the highest input channel. -1 if no input channels are enabled.

Definition at line 60 of file lasp_daqconfig.cpp.

◆ getHighestEnabledOutChannel()

int DaqConfiguration::getHighestEnabledOutChannel ( ) const

Get the highest channel number from the list of enabled output channels.

Returns
Index to the highest input channel. -1 if no output channels are enabled.

Definition at line 68 of file lasp_daqconfig.cpp.

◆ getLowestEnabledInChannel()

int DaqConfiguration::getLowestEnabledInChannel ( ) const

Get the lowest channel number from the list of enabled input channels.

Returns
Index to the lowest input channel. -1 if no input channels are enabled.

Definition at line 75 of file lasp_daqconfig.cpp.

◆ getLowestEnabledOutChannel()

int DaqConfiguration::getLowestEnabledOutChannel ( ) const

Get the lowest channel number from the list of enabled output channels.

Returns
Index to the lowest output channel. -1 if no output channels are enabled.

Definition at line 82 of file lasp_daqconfig.cpp.

◆ match()

bool DaqConfiguration::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.

Parameters
devinfoThe DeviceInfo to check
Returns
true if it matches. Otherwise false.

Definition at line 56 of file lasp_daqconfig.cpp.

◆ setAllInputEnabled()

void DaqConfiguration::setAllInputEnabled ( bool  val)
inline

Set all input channels to enabled / disabled state.

Parameters
valtrue if enabled, false if disabled.

Definition at line 352 of file lasp_daqconfig.h.

◆ setAllOutputEnabled()

void DaqConfiguration::setAllOutputEnabled ( bool  val)
inline

Set all output channels to enabled / disabled state.

Parameters
valtrue if enabled, false if disabled.

Definition at line 363 of file lasp_daqconfig.h.

◆ toTOML()

string DaqConfiguration::toTOML ( ) const

Export the class to TOML markup language.

Returns
String with TOML exported data.

Definition at line 124 of file lasp_daqconfig.cpp.

Member Data Documentation

◆ api

DaqApi DaqConfiguration::api

Definition at line 243 of file lasp_daqconfig.h.

◆ dataTypeIndex

int DaqConfiguration::dataTypeIndex = 0

Required datatype for output, should be present in the list.

Definition at line 278 of file lasp_daqconfig.h.

◆ device_name

string DaqConfiguration::device_name

The internal device name this DAQ configuration applies to.

Definition at line 247 of file lasp_daqconfig.h.

◆ framesPerBlockIndex

int DaqConfiguration::framesPerBlockIndex = 0

The index in the array of frames per block that can be used for the device.

Definition at line 284 of file lasp_daqconfig.h.

◆ inchannel_config

std::vector<DaqChannel> DaqConfiguration::inchannel_config

Channel configuration for input channels.

Definition at line 252 of file lasp_daqconfig.h.

◆ monitorOutput

bool DaqConfiguration::monitorOutput = false

If set to true and if the device has this capability, the output channels are added as input channels as well.

Definition at line 290 of file lasp_daqconfig.h.

◆ outchannel_config

std::vector<DaqChannel> DaqConfiguration::outchannel_config

Channel configuration for output channels.

Definition at line 268 of file lasp_daqconfig.h.

◆ sampleRateIndex

int DaqConfiguration::sampleRateIndex = 0

Index in list of sample rates that are available for the device.

Definition at line 273 of file lasp_daqconfig.h.


The documentation for this class was generated from the following files: