Bugfix for non-consecutive channel counts in UlDAQ
continuous-integration/drone/push Build is passing Details

This commit is contained in:
Anne de Jong 2023-03-10 15:53:55 +01:00
parent 2b22af5d2c
commit 617eded04e
1 changed files with 4 additions and 1 deletions

View File

@ -206,13 +206,15 @@ InBufHandler::InBufHandler(DT9837A &daq, InDaqCallback cb)
// Set ranges for each input. Below asks only channels that are not a
// monitor channel (hence the false flag).
dvec ranges = daq.inputRangeForEnabledChannels(false);
us enabled_ch_count = 0;
for (us chin = 0; chin < 4; chin++) {
if (eninchannels_without_mon[chin] == true) {
DaqInChanDescriptor indesc;
indesc.type = DAQI_ANALOG_SE;
indesc.channel = chin;
double rangeval = ranges.at(chin);
double rangeval = ranges.at(enabled_ch_count);
Range rangenum;
if (fabs(rangeval - 1.0) < 1e-8) {
rangenum = BIP1VOLTS;
@ -225,6 +227,7 @@ InBufHandler::InBufHandler(DT9837A &daq, InDaqCallback cb)
}
indesc.range = rangenum;
indescs.push_back(indesc);
enabled_ch_count++;
}
}