DeviceInfo is now base class for derived variants for UlDaqDeviceInfo and RtAudioDeviceInfo. Dynamic casts are used in contstructors when stream is created. For UlDaq, device inventory list is not scanned anymore when starting device. This should speed up starting the device as well. Added a flag duplexModeForced to DeviceInfo. This one is true for DT9837A, as this device can only use input and output at the same time when running in duplex mode. Fixed the bug of printing an Uldaq error called noerror.
All checks were successful
continuous-integration/drone/push Build is passing
All checks were successful
continuous-integration/drone/push Build is passing
This commit is contained in:
parent
1bdf318f1b
commit
f3e4bc70ea
@ -12,8 +12,8 @@
|
|||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
|
||||||
std::vector<DeviceInfo> DeviceInfo::getDeviceInfo() {
|
DeviceInfoList DeviceInfo::getDeviceInfo() {
|
||||||
std::vector<DeviceInfo> devs;
|
DeviceInfoList devs;
|
||||||
#if LASP_HAS_ULDAQ ==1
|
#if LASP_HAS_ULDAQ ==1
|
||||||
fillUlDaqDeviceInfo(devs);
|
fillUlDaqDeviceInfo(devs);
|
||||||
#endif
|
#endif
|
||||||
|
@ -1,17 +1,34 @@
|
|||||||
#pragma once
|
#pragma once
|
||||||
#include "lasp_config.h"
|
#include "lasp_config.h"
|
||||||
#include "lasp_types.h"
|
|
||||||
#include "lasp_daqconfig.h"
|
#include "lasp_daqconfig.h"
|
||||||
|
#include "lasp_types.h"
|
||||||
|
#include <memory>
|
||||||
|
|
||||||
/** \addtogroup device
|
/** \addtogroup device
|
||||||
* @{
|
* @{
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
using DeviceInfoList = std::vector<std::unique_ptr<DeviceInfo>>;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @brief Structure containing device info parameters
|
* @brief Structure containing device info parameters
|
||||||
*/
|
*/
|
||||||
class DeviceInfo {
|
class DeviceInfo {
|
||||||
public:
|
public:
|
||||||
|
/**
|
||||||
|
* @brief Virtual desctructor. Can be derived class.
|
||||||
|
*/
|
||||||
|
virtual ~DeviceInfo() {}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @brief Clone a device info.
|
||||||
|
*
|
||||||
|
* @return Cloned device info
|
||||||
|
*/
|
||||||
|
virtual std::unique_ptr<DeviceInfo> clone() const {
|
||||||
|
return std::make_unique<DeviceInfo>(*this);
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @brief Backend API corresponding to device
|
* @brief Backend API corresponding to device
|
||||||
*/
|
*/
|
||||||
@ -21,12 +38,6 @@ public:
|
|||||||
*/
|
*/
|
||||||
string device_name = "";
|
string device_name = "";
|
||||||
|
|
||||||
/**
|
|
||||||
* @brief Specific for the device (Sub-API). Important for the RtAudio
|
|
||||||
* backend, as RtAudio is able to handle different API's.
|
|
||||||
*/
|
|
||||||
int api_specific_devindex = -1;
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @brief The available data types the device can output
|
* @brief The available data types the device can output
|
||||||
*/
|
*/
|
||||||
@ -104,6 +115,14 @@ public:
|
|||||||
*/
|
*/
|
||||||
bool hasInternalOutputMonitor = false;
|
bool hasInternalOutputMonitor = false;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @brief 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.
|
||||||
|
*/
|
||||||
|
bool duplexModeForced = false;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @brief The physical quantity of the output signal. For 'normal' audio
|
* @brief The physical quantity of the output signal. For 'normal' audio
|
||||||
* devices, this is typically a 'number' between +/- full scale. For some
|
* devices, this is typically a 'number' between +/- full scale. For some
|
||||||
@ -112,7 +131,6 @@ public:
|
|||||||
*/
|
*/
|
||||||
DaqChannel::Qty physicalOutputQty = DaqChannel::Qty::Number;
|
DaqChannel::Qty physicalOutputQty = DaqChannel::Qty::Number;
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @brief String representation of DeviceInfo
|
* @brief String representation of DeviceInfo
|
||||||
*
|
*
|
||||||
@ -121,11 +139,9 @@ public:
|
|||||||
operator string() const {
|
operator string() const {
|
||||||
using std::endl;
|
using std::endl;
|
||||||
std::stringstream str;
|
std::stringstream str;
|
||||||
str << api.apiname + " " << api_specific_devindex << endl
|
str << api.apiname + " " << endl
|
||||||
<< " number of input channels: " << ninchannels << endl
|
<< " number of input channels: " << ninchannels
|
||||||
/**
|
<< endl
|
||||||
* @brief
|
|
||||||
*/
|
|
||||||
<< " number of output channels: " << noutchannels << endl;
|
<< " number of output channels: " << noutchannels << endl;
|
||||||
return str.str();
|
return str.str();
|
||||||
}
|
}
|
||||||
@ -135,7 +151,7 @@ public:
|
|||||||
*
|
*
|
||||||
* @return The device info's for each found device.
|
* @return The device info's for each found device.
|
||||||
*/
|
*/
|
||||||
static std::vector<DeviceInfo> getDeviceInfo();
|
static DeviceInfoList getDeviceInfo();
|
||||||
};
|
};
|
||||||
|
|
||||||
/** @} */
|
/** @} */
|
||||||
|
@ -17,7 +17,19 @@ using rte = std::runtime_error;
|
|||||||
using std::vector;
|
using std::vector;
|
||||||
using lck = std::scoped_lock<std::mutex>;
|
using lck = std::scoped_lock<std::mutex>;
|
||||||
|
|
||||||
void fillRtAudioDeviceInfo(vector<DeviceInfo> &devinfolist) {
|
class RtAudioDeviceInfo : public DeviceInfo {
|
||||||
|
public:
|
||||||
|
/**
|
||||||
|
* @brief Specific for the device (Sub-API). Important for the RtAudio
|
||||||
|
* backend, as RtAudio is able to handle different API's.
|
||||||
|
*/
|
||||||
|
int _api_devindex;
|
||||||
|
virtual std::unique_ptr<DeviceInfo> clone() const override {
|
||||||
|
return std::make_unique<DeviceInfo>(*this);
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
void fillRtAudioDeviceInfo(DeviceInfoList &devinfolist) {
|
||||||
DEBUGTRACE_ENTER;
|
DEBUGTRACE_ENTER;
|
||||||
|
|
||||||
vector<RtAudio::Api> apis;
|
vector<RtAudio::Api> apis;
|
||||||
@ -34,7 +46,7 @@ void fillRtAudioDeviceInfo(vector<DeviceInfo> &devinfolist) {
|
|||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
// "Our device info struct"
|
// "Our device info struct"
|
||||||
DeviceInfo d;
|
RtAudioDeviceInfo d;
|
||||||
switch (api) {
|
switch (api) {
|
||||||
case RtAudio::LINUX_ALSA:
|
case RtAudio::LINUX_ALSA:
|
||||||
d.api = rtaudioAlsaApi;
|
d.api = rtaudioAlsaApi;
|
||||||
@ -58,7 +70,7 @@ void fillRtAudioDeviceInfo(vector<DeviceInfo> &devinfolist) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
d.device_name = devinfo.name;
|
d.device_name = devinfo.name;
|
||||||
d.api_specific_devindex = devno;
|
d._api_devindex = devno;
|
||||||
|
|
||||||
/// When 48k is available we overwrite the default sample rate with the 48
|
/// When 48k is available we overwrite the default sample rate with the 48
|
||||||
/// kHz value, which is our preffered rate,
|
/// kHz value, which is our preffered rate,
|
||||||
@ -118,7 +130,7 @@ void fillRtAudioDeviceInfo(vector<DeviceInfo> &devinfolist) {
|
|||||||
d.availableFramesPerBlock = {512, 1024, 2048, 4096, 8192};
|
d.availableFramesPerBlock = {512, 1024, 2048, 4096, 8192};
|
||||||
d.prefFramesPerBlockIndex = 2;
|
d.prefFramesPerBlockIndex = 2;
|
||||||
|
|
||||||
devinfolist.push_back(d);
|
devinfolist.push_back(std::make_unique<RtAudioDeviceInfo>(d));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -143,9 +155,9 @@ class RtAudioDaq : public Daq {
|
|||||||
std::atomic<StreamStatus> _streamStatus{};
|
std::atomic<StreamStatus> _streamStatus{};
|
||||||
|
|
||||||
public:
|
public:
|
||||||
RtAudioDaq(const DeviceInfo &devinfo, const DaqConfiguration &config)
|
RtAudioDaq(const DeviceInfo &devinfo_gen, const DaqConfiguration &config)
|
||||||
: Daq(devinfo, config),
|
: Daq(devinfo_gen, config), rtaudio(static_cast<RtAudio::Api>(
|
||||||
rtaudio(static_cast<RtAudio::Api>(devinfo.api.api_specific_subcode)),
|
devinfo_gen.api.api_specific_subcode)),
|
||||||
nFramesPerBlock(Daq::framesPerBlock()) {
|
nFramesPerBlock(Daq::framesPerBlock()) {
|
||||||
|
|
||||||
DEBUGTRACE_ENTER;
|
DEBUGTRACE_ENTER;
|
||||||
@ -156,6 +168,8 @@ public:
|
|||||||
throw rte("RtAudio backend cannot run in duplex mode.");
|
throw rte("RtAudio backend cannot run in duplex mode.");
|
||||||
}
|
}
|
||||||
assert(!monitorOutput);
|
assert(!monitorOutput);
|
||||||
|
const RtAudioDeviceInfo &devinfo =
|
||||||
|
static_cast<const RtAudioDeviceInfo &>(devinfo_gen);
|
||||||
|
|
||||||
std::unique_ptr<RtAudio::StreamParameters> inParams, outParams;
|
std::unique_ptr<RtAudio::StreamParameters> inParams, outParams;
|
||||||
|
|
||||||
@ -169,7 +183,7 @@ public:
|
|||||||
throw rte("Invalid input number of channels");
|
throw rte("Invalid input number of channels");
|
||||||
}
|
}
|
||||||
inParams->firstChannel = 0;
|
inParams->firstChannel = 0;
|
||||||
inParams->deviceId = devinfo.api_specific_devindex;
|
inParams->deviceId = devinfo._api_devindex;
|
||||||
|
|
||||||
} else {
|
} else {
|
||||||
|
|
||||||
@ -180,7 +194,7 @@ public:
|
|||||||
throw rte("Invalid output number of channels");
|
throw rte("Invalid output number of channels");
|
||||||
}
|
}
|
||||||
outParams->firstChannel = 0;
|
outParams->firstChannel = 0;
|
||||||
outParams->deviceId = devinfo.api_specific_devindex;
|
outParams->deviceId = devinfo._api_devindex;
|
||||||
}
|
}
|
||||||
|
|
||||||
RtAudio::StreamOptions streamoptions;
|
RtAudio::StreamOptions streamoptions;
|
||||||
|
@ -10,5 +10,5 @@ std::unique_ptr<Daq> createRtAudioDevice(const DeviceInfo& devinfo,
|
|||||||
*
|
*
|
||||||
* @param devinfolist List to append to
|
* @param devinfolist List to append to
|
||||||
*/
|
*/
|
||||||
void fillRtAudioDeviceInfo(std::vector<DeviceInfo> &devinfolist);
|
void fillRtAudioDeviceInfo(DeviceInfoList &devinfolist);
|
||||||
|
|
||||||
|
@ -261,22 +261,23 @@ void StreamMgr::startStream(const DaqConfiguration &config) {
|
|||||||
[](auto &i) { return i.enabled; });
|
[](auto &i) { return i.enabled; });
|
||||||
|
|
||||||
// Find the first device that matches with the configuration
|
// Find the first device that matches with the configuration
|
||||||
|
std::scoped_lock lck(_devices_mtx);
|
||||||
|
|
||||||
DeviceInfo devinfo;
|
DeviceInfo *devinfo = nullptr;
|
||||||
{
|
bool found = false;
|
||||||
std::scoped_lock lck(_devices_mtx);
|
|
||||||
|
|
||||||
auto devinfo2 = std::find_if(
|
for (auto &devinfoi : _devices) {
|
||||||
_devices.cbegin(), _devices.cend(),
|
if (config.match(*devinfoi)) {
|
||||||
[&config](const DeviceInfo &d) { return config.match(d); });
|
devinfo = devinfoi.get();
|
||||||
if (devinfo2 == std::cend(_devices)) {
|
break;
|
||||||
throw rte("Could not find a device with name " + config.device_name +
|
|
||||||
" in list of devices.");
|
|
||||||
}
|
}
|
||||||
devinfo = *devinfo2;
|
}
|
||||||
|
if (!devinfo) {
|
||||||
|
throw rte("Could not find a device with name " + config.device_name +
|
||||||
|
" in list of devices.");
|
||||||
}
|
}
|
||||||
|
|
||||||
isInput |= (config.monitorOutput && devinfo.hasInternalOutputMonitor);
|
isInput |= (config.monitorOutput && devinfo->hasInternalOutputMonitor);
|
||||||
DEBUGTRACE_PRINT(isInput);
|
DEBUGTRACE_PRINT(isInput);
|
||||||
|
|
||||||
bool isDuplex = isInput && isOutput;
|
bool isDuplex = isInput && isOutput;
|
||||||
@ -300,11 +301,23 @@ void StreamMgr::startStream(const DaqConfiguration &config) {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (_outputStream && isInput && _outputStream->duplexModeForced &&
|
||||||
|
config.match(*_outputStream)) {
|
||||||
|
throw rte("This device is already opened for output. If input is also "
|
||||||
|
"required, please enable duplex mode for this device");
|
||||||
|
}
|
||||||
|
|
||||||
|
if (_inputStream && isOutput && _inputStream->duplexModeForced &&
|
||||||
|
config.match(*_inputStream)) {
|
||||||
|
throw rte("This device is already opened for input. If output is also "
|
||||||
|
"required, please enable duplex mode for this device");
|
||||||
|
}
|
||||||
|
|
||||||
InDaqCallback inCallback;
|
InDaqCallback inCallback;
|
||||||
OutDaqCallback outCallback;
|
OutDaqCallback outCallback;
|
||||||
|
|
||||||
using namespace std::placeholders;
|
using namespace std::placeholders;
|
||||||
std::unique_ptr<Daq> daq = Daq::createDaq(devinfo, config);
|
std::unique_ptr<Daq> daq = Daq::createDaq(*devinfo, config);
|
||||||
|
|
||||||
assert(daq);
|
assert(daq);
|
||||||
|
|
||||||
@ -321,7 +334,7 @@ void StreamMgr::startStream(const DaqConfiguration &config) {
|
|||||||
/// Create input filters
|
/// Create input filters
|
||||||
_inputFilters.clear();
|
_inputFilters.clear();
|
||||||
/// No input filter for monitor channel.
|
/// No input filter for monitor channel.
|
||||||
if (config.monitorOutput && devinfo.hasInternalOutputMonitor) {
|
if (config.monitorOutput && devinfo->hasInternalOutputMonitor) {
|
||||||
_inputFilters.push_back(nullptr);
|
_inputFilters.push_back(nullptr);
|
||||||
}
|
}
|
||||||
for (auto &ch : daq->inchannel_config) {
|
for (auto &ch : daq->inchannel_config) {
|
||||||
|
@ -107,7 +107,7 @@ class StreamMgr {
|
|||||||
std::mutex _siggen_mtx;
|
std::mutex _siggen_mtx;
|
||||||
|
|
||||||
std::mutex _devices_mtx;
|
std::mutex _devices_mtx;
|
||||||
std::vector<DeviceInfo> _devices;
|
DeviceInfoList _devices;
|
||||||
|
|
||||||
StreamMgr();
|
StreamMgr();
|
||||||
|
|
||||||
@ -145,9 +145,13 @@ class StreamMgr {
|
|||||||
*
|
*
|
||||||
* @return A copy of the internal stored list of devices
|
* @return A copy of the internal stored list of devices
|
||||||
*/
|
*/
|
||||||
std::vector<DeviceInfo> getDeviceInfo() const {
|
DeviceInfoList getDeviceInfo() const {
|
||||||
std::scoped_lock lck(const_cast<std::mutex &>(_devices_mtx));
|
std::scoped_lock lck(const_cast<std::mutex &>(_devices_mtx));
|
||||||
return _devices;
|
DeviceInfoList d2;
|
||||||
|
for(const auto& dev: _devices) {
|
||||||
|
d2.push_back(dev->clone());
|
||||||
|
}
|
||||||
|
return d2;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -6,13 +6,12 @@
|
|||||||
#include "lasp_uldaq_impl.h"
|
#include "lasp_uldaq_impl.h"
|
||||||
#include <uldaq.h>
|
#include <uldaq.h>
|
||||||
|
|
||||||
void fillUlDaqDeviceInfo(std::vector<DeviceInfo> &devinfolist,
|
|
||||||
void *vDescriptors) {
|
|
||||||
|
void fillUlDaqDeviceInfo(DeviceInfoList &devinfolist) {
|
||||||
|
|
||||||
DEBUGTRACE_ENTER;
|
DEBUGTRACE_ENTER;
|
||||||
|
|
||||||
DaqDeviceDescriptor *descriptors_copy =
|
|
||||||
static_cast<DaqDeviceDescriptor *>(vDescriptors);
|
|
||||||
|
|
||||||
UlError err;
|
UlError err;
|
||||||
unsigned int numdevs = MAX_ULDAQ_DEV_COUNT_PER_API;
|
unsigned int numdevs = MAX_ULDAQ_DEV_COUNT_PER_API;
|
||||||
@ -32,16 +31,14 @@ void fillUlDaqDeviceInfo(std::vector<DeviceInfo> &devinfolist,
|
|||||||
|
|
||||||
descriptor = devdescriptors[i];
|
descriptor = devdescriptors[i];
|
||||||
|
|
||||||
// Copy structure over, if given as not nullptr
|
UlDaqDeviceInfo devinfo;
|
||||||
if (descriptors_copy) {
|
devinfo._uldaqDescriptor = descriptor;
|
||||||
descriptors_copy[i] = descriptor;
|
|
||||||
}
|
|
||||||
|
|
||||||
DeviceInfo devinfo;
|
|
||||||
devinfo.api = uldaqapi;
|
devinfo.api = uldaqapi;
|
||||||
string name, interface;
|
string name, interface;
|
||||||
if (string(descriptor.productName) != "DT9837A") {
|
string productname = descriptor.productName;
|
||||||
throw rte("Unknown UlDAQ type");
|
if (productname != "DT9837A") {
|
||||||
|
throw rte("Unknown UlDAQ type: " + productname);
|
||||||
}
|
}
|
||||||
|
|
||||||
switch (descriptor.devInterface) {
|
switch (descriptor.devInterface) {
|
||||||
@ -66,7 +63,6 @@ void fillUlDaqDeviceInfo(std::vector<DeviceInfo> &devinfolist,
|
|||||||
|
|
||||||
devinfo.physicalOutputQty = DaqChannel::Qty::Voltage;
|
devinfo.physicalOutputQty = DaqChannel::Qty::Voltage;
|
||||||
|
|
||||||
devinfo.api_specific_devindex = i;
|
|
||||||
devinfo.availableDataTypes.push_back(
|
devinfo.availableDataTypes.push_back(
|
||||||
DataTypeDescriptor::DataType::dtype_fl64);
|
DataTypeDescriptor::DataType::dtype_fl64);
|
||||||
devinfo.prefDataTypeIndex = 0;
|
devinfo.prefDataTypeIndex = 0;
|
||||||
@ -91,8 +87,10 @@ void fillUlDaqDeviceInfo(std::vector<DeviceInfo> &devinfolist,
|
|||||||
|
|
||||||
devinfo.hasInternalOutputMonitor = true;
|
devinfo.hasInternalOutputMonitor = true;
|
||||||
|
|
||||||
|
devinfo.duplexModeForced = true;
|
||||||
|
|
||||||
// Finally, this devinfo is pushed back in list
|
// Finally, this devinfo is pushed back in list
|
||||||
devinfolist.push_back(devinfo);
|
devinfolist.push_back(std::make_unique<UlDaqDeviceInfo>(devinfo));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -14,9 +14,5 @@ std::unique_ptr<Daq> createUlDaqDevice(const DeviceInfo &devinfo,
|
|||||||
* @brief Fill device info list with UlDaq specific devices, if any.
|
* @brief Fill device info list with UlDaq specific devices, if any.
|
||||||
*
|
*
|
||||||
* @param devinfolist Info list to append to
|
* @param devinfolist Info list to append to
|
||||||
* @param descriptors Pointer to array
|
|
||||||
* DaqDeviceDescriptors[MAX_ULDAQ_DEV_COUNT_PER_API]. If a pointer is given, a
|
|
||||||
* copy of the device descriptors is set to the memory of this pointer. We use
|
|
||||||
* a void* pointer here to not expose the implementation of UlDaq.
|
|
||||||
*/
|
*/
|
||||||
void fillUlDaqDeviceInfo(std::vector<DeviceInfo>&, void *descriptors = nullptr);
|
void fillUlDaqDeviceInfo(DeviceInfoList&);
|
||||||
|
@ -35,7 +35,10 @@ inline void showErr(string errstr) {
|
|||||||
std::cerr << errstr << std::endl;
|
std::cerr << errstr << std::endl;
|
||||||
std::cerr << "***********************************************\n\n";
|
std::cerr << "***********************************************\n\n";
|
||||||
}
|
}
|
||||||
inline void showErr(UlError err) { showErr(getErrMsg(err)); }
|
inline void showErr(UlError err) {
|
||||||
|
if (err != ERR_NO_ERROR)
|
||||||
|
showErr(getErrMsg(err));
|
||||||
|
}
|
||||||
|
|
||||||
DT9837A::~DT9837A() {
|
DT9837A::~DT9837A() {
|
||||||
UlError err;
|
UlError err;
|
||||||
@ -71,21 +74,14 @@ DT9837A::DT9837A(const DeviceInfo &devinfo, const DaqConfiguration &config)
|
|||||||
throw rte("Invalid sample rate");
|
throw rte("Invalid sample rate");
|
||||||
}
|
}
|
||||||
|
|
||||||
std::vector<DeviceInfo> devs;
|
const UlDaqDeviceInfo *_info =
|
||||||
DaqDeviceDescriptor devdescriptors[MAX_ULDAQ_DEV_COUNT_PER_API];
|
dynamic_cast<const UlDaqDeviceInfo *>(&devinfo);
|
||||||
fillUlDaqDeviceInfo(devs, static_cast<void *>(devdescriptors));
|
if (_info == nullptr) {
|
||||||
|
throw rte("BUG: Could not cast DeviceInfo to UlDaqDeviceInfo");
|
||||||
if (devs.size() == 0) {
|
|
||||||
throw rte("Unable to find any UlDaq devices");
|
|
||||||
}
|
|
||||||
|
|
||||||
if (devinfo.api_specific_devindex < 0 ||
|
|
||||||
devinfo.api_specific_devindex >= (int)MAX_ULDAQ_DEV_COUNT_PER_API) {
|
|
||||||
throw rte("Invalid device index");
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// get a handle to the DAQ device associated with the first descriptor
|
// get a handle to the DAQ device associated with the first descriptor
|
||||||
_handle = ulCreateDaqDevice(devdescriptors[devinfo.api_specific_devindex]);
|
_handle = ulCreateDaqDevice(_info->_uldaqDescriptor);
|
||||||
|
|
||||||
if (_handle == 0) {
|
if (_handle == 0) {
|
||||||
throw rte("Unable to create a handle to the specified DAQ "
|
throw rte("Unable to create a handle to the specified DAQ "
|
||||||
|
@ -14,6 +14,19 @@ using std::cerr;
|
|||||||
using std::endl;
|
using std::endl;
|
||||||
using rte = std::runtime_error;
|
using rte = std::runtime_error;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @brief UlDaq-specific device information. Adds a copy of the underlying
|
||||||
|
* DaqDeDaqDeviceDescriptor.
|
||||||
|
*/
|
||||||
|
class UlDaqDeviceInfo : public DeviceInfo {
|
||||||
|
|
||||||
|
public:
|
||||||
|
DaqDeviceDescriptor _uldaqDescriptor;
|
||||||
|
virtual std::unique_ptr<DeviceInfo> clone() const {
|
||||||
|
return std::make_unique<UlDaqDeviceInfo>(*this);
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
class DT9837A : public Daq {
|
class DT9837A : public Daq {
|
||||||
|
|
||||||
DaqDeviceHandle _handle = 0;
|
DaqDeviceHandle _handle = 0;
|
||||||
@ -123,7 +136,6 @@ public:
|
|||||||
*/
|
*/
|
||||||
bool operator()();
|
bool operator()();
|
||||||
~InBufHandler();
|
~InBufHandler();
|
||||||
|
|
||||||
};
|
};
|
||||||
class OutBufHandler : public BufHandler {
|
class OutBufHandler : public BufHandler {
|
||||||
OutDaqCallback cb;
|
OutDaqCallback cb;
|
||||||
|
Loading…
Reference in New Issue
Block a user