DAQ start/end time working.

This commit is contained in:
Chris Esposito 2017-12-28 15:51:44 +11:00
parent 025df96ea6
commit dddef76972
1 changed files with 22 additions and 4 deletions

View File

@ -1367,16 +1367,34 @@ void isoDriver::loadFileBuffer(QFile *fileToLoad){
float tempArray[COLUMN_BREAK + 1]; //751 elements per row with the old files; this just avoids a possible crash; float tempArray[COLUMN_BREAK + 1]; //751 elements per row with the old files; this just avoids a possible crash;
int temp_len; int temp_len;
qulonglong sampleCount = 0;
qulonglong minCount = (daqLoad_startTime / minTime);
qulonglong maxCount = (daqLoad_endTime / minTime);
qDebug() << "minCount" << minCount;
qDebug() << "maxCount" << maxCount;
int min_i;
int tempCount;
qDebug() << "Loading data into isoBuffer_file"; qDebug() << "Loading data into isoBuffer_file";
while (!fileToLoad->atEnd()) { while (!fileToLoad->atEnd()) {
currentLine = fileToLoad->readLine(); currentLine = fileToLoad->readLine();
tempList.append(currentLine.split(',')); tempList.append(currentLine.split(','));
tempList.removeLast(); //Last element is a "\n", not a number. tempList.removeLast(); //Last element is a "\n", not a number.
temp_len = tempList.count(); temp_len = 0;
for (int i=0; i<temp_len; i++){ tempCount = tempList.count();
tempArray[i] = tempList.at(i).toFloat(); min_i = 2000000000; //Arbitrary big number.
for (int i=0; i<tempCount; i++){
if((sampleCount > minCount) && (sampleCount < maxCount)){
if(i < min_i){
min_i = i;
}
tempArray[i] = tempList.at(i).toFloat();
temp_len++;
}
sampleCount++;
} }
internalBufferFile->writeBuffer_float(tempArray, temp_len); internalBufferFile->writeBuffer_float(&tempArray[min_i], temp_len);
tempList.clear(); tempList.clear();
} }