Bugfix for non contiguous channels are enabled on UlDAQ
This commit is contained in:
parent
bf854b4055
commit
441685ad32
@ -180,16 +180,22 @@ public:
|
|||||||
|
|
||||||
std::vector<DaqInChanDescriptor> indescs;
|
std::vector<DaqInChanDescriptor> indescs;
|
||||||
boolvec eninchannels_without_mon = daq.eninchannels(false);
|
boolvec eninchannels_without_mon = daq.eninchannels(false);
|
||||||
|
DEBUGTRACE_PRINT(eninchannels_without_mon.size());
|
||||||
|
|
||||||
// Initialize input, if any
|
// Initialize input, if any
|
||||||
dvec ranges = daq.inputRangeForEnabledChannels(false);
|
dvec ranges = daq.inputRangeForEnabledChannels(false);
|
||||||
|
|
||||||
|
// Update range index only when an enabled channel is found.
|
||||||
|
us range_idx = 0;
|
||||||
|
|
||||||
for (us chin = 0; chin < 4; chin++) {
|
for (us chin = 0; chin < 4; chin++) {
|
||||||
if (eninchannels_without_mon[chin] == true) {
|
if (eninchannels_without_mon[chin] == true) {
|
||||||
DaqInChanDescriptor indesc;
|
DaqInChanDescriptor indesc;
|
||||||
indesc.type = DAQI_ANALOG_SE;
|
indesc.type = DAQI_ANALOG_SE;
|
||||||
indesc.channel = chin;
|
indesc.channel = chin;
|
||||||
|
|
||||||
double rangeval = ranges.at(chin);
|
double rangeval = ranges.at(range_idx);
|
||||||
|
range_idx++;
|
||||||
Range rangenum;
|
Range rangenum;
|
||||||
if (fabs(rangeval - 1.0) < 1e-8) {
|
if (fabs(rangeval - 1.0) < 1e-8) {
|
||||||
rangenum = BIP1VOLTS;
|
rangenum = BIP1VOLTS;
|
||||||
|
Loading…
Reference in New Issue
Block a user