2#include "lasp_config.h"
86 using rte = std::runtime_error;
98 const std::string &additional_info)
Used for internal throwing of exceptions.
StreamStatus::StreamError e
StreamException(const StreamStatus::StreamError e, const std::string &additional_info)
StreamException(const StreamStatus::StreamError e)
Information regarding a stream.
bool runningOK() const
Returns true if everything is OK with a certain stream and the stream is running.
bool error() const
Check if stream has error.
static const std::map< StreamError, std::string > errorMessages
Map between error types and messages.
std::string errorMsg() const
Configuration of a DAQ device.
int framesPerBlockIndex
The index in the array of frames per block that can be used for the device.
Data coming from / going to DAQ. Non-interleaved format, which means data in buffer is ordered by cha...
Base cass for all DAQ (Data Acquisition) interfaces. A DAQ can be a custom device,...
const DataTypeDescriptor & dtypeDescr() const
More elaborate description of the datatypes.
us neninchannels(bool include_monitorchannels=true) const
Returns the number of enabled input channels.
boolvec eninchannels(const bool include_monitor=true) const
Create a vector of boolean values of the enabled input channels.
static std::unique_ptr< Daq > createDaq(const DeviceInfo &devinfo, const DaqConfiguration &config)
Create a Daq based on given device info and configuration.
bool duplexMode() const
Whether the device runs in duplex mode (both input and output), or false if only input / only output.
virtual void start(InDaqCallback inCallback, OutDaqCallback outCallback)=0
Start the Daq.
double samplerate() const
Returns current sample rate.
DataTypeDescriptor::DataType dataType() const
Returns datatype (enum) corresponding to the datatype of the samples.
virtual void stop()=0
Stop the Daq device. Throws an exception if the device is not running at the time this method is call...
boolvec enoutchannels() const
Create an array of booleans for each enabled output channel.
virtual StreamStatus getStreamStatus() const =0
Get stream status corresponding to current DAQ.
us framesPerBlock() const
The number of frames that is send in a block of DaqData.
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 ...
us nenoutchannels() const
Returns the number of enabled output channels.
Descriptor for data types containing more detailed information.
DataType
Basic data types coming from a DAQ that we can deal with. The naming will be self-explainging.
Structure containing device info parameters.
usvec availableFramesPerBlock
Available latency-setting (number of frames passed in each callback).
std::vector< double > dvec
std::function< void(DaqData &)> OutDaqCallback
std::function< void(const DaqData &)> InDaqCallback
std::vector< bool > boolvec
size_t us
We often use boolean values.