Bugfix: Made Uldaq sample rate check depending on actually provided sample rates
This commit is contained in:
parent
f1348ede80
commit
fb9920d00a
@ -67,10 +67,7 @@ void fillUlDaqDeviceInfo(DeviceInfoList &devinfolist) {
|
|||||||
DataTypeDescriptor::DataType::dtype_fl64);
|
DataTypeDescriptor::DataType::dtype_fl64);
|
||||||
devinfo.prefDataTypeIndex = 0;
|
devinfo.prefDataTypeIndex = 0;
|
||||||
|
|
||||||
devinfo.availableSampleRates = {8000, 10000, 11025, 16000, 20000,
|
devinfo.availableSampleRates = ULDAQ_SAMPLERATES;
|
||||||
22050, 24000, 32000, 44056, 44100,
|
|
||||||
47250, 48000, 50000, 50400, 51000};
|
|
||||||
|
|
||||||
devinfo.prefSampleRateIndex = 11;
|
devinfo.prefSampleRateIndex = 11;
|
||||||
|
|
||||||
devinfo.availableFramesPerBlock = {512, 1024, 2048, 4096, 8192};
|
devinfo.availableFramesPerBlock = {512, 1024, 2048, 4096, 8192};
|
||||||
|
@ -70,7 +70,7 @@ DT9837A::DT9837A(const DeviceInfo &devinfo, const DaqConfiguration &config)
|
|||||||
throw rte("Unsensible number of samples per block chosen");
|
throw rte("Unsensible number of samples per block chosen");
|
||||||
}
|
}
|
||||||
|
|
||||||
if (samplerate() < 10000 || samplerate() > 51000) {
|
if (samplerate() < ULDAQ_SAMPLERATES.at(0) || samplerate() > ULDAQ_SAMPLERATES.at(ULDAQ_SAMPLERATES.size()-1)) {
|
||||||
throw rte("Invalid sample rate");
|
throw rte("Invalid sample rate");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -14,6 +14,14 @@ using std::cerr;
|
|||||||
using std::endl;
|
using std::endl;
|
||||||
using rte = std::runtime_error;
|
using rte = std::runtime_error;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @brief List of available sampling frequencies for DT9837A
|
||||||
|
*/
|
||||||
|
const std::vector<d> ULDAQ_SAMPLERATES = {8000, 10000, 11025, 16000, 20000,
|
||||||
|
22050, 24000, 32000, 44056, 44100,
|
||||||
|
47250, 48000, 50000, 50400, 51000};
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @brief UlDaq-specific device information. Adds a copy of the underlying
|
* @brief UlDaq-specific device information. Adds a copy of the underlying
|
||||||
* DaqDeDaqDeviceDescriptor.
|
* DaqDeDaqDeviceDescriptor.
|
||||||
|
Loading…
Reference in New Issue
Block a user