Changeset - c1bf9f78ee55
[Not reviewed]
default
0 1 0
Hasan Yavuz Ă–ZDERYA - 9 years ago 2017-02-22 10:22:37
hy@ozderya.net
print problematic line in case of reading error
1 file changed with 2 insertions and 0 deletions:
0 comments (0 inline, 0 general)
src/asciireader.cpp
Show inline comments
 
@@ -130,35 +130,37 @@ void AsciiReader::onDataReady()
 
                emit numOfChannelsChanged(numComingChannels);
 
            }
 
            numReadChannels = numComingChannels;
 
        }
 
        else if (numComingChannels >= _numOfChannels)
 
        {
 
            numReadChannels = _numOfChannels;
 
        }
 
        else // there is missing channel data
 
        {
 
            numReadChannels = separatedValues.length();
 
            qWarning() << "Incoming data is missing data for some channels!";
 
            qWarning() << "Read line: " << line;
 
        }
 

	
 
        // parse read line
 
        double* channelSamples = new double[_numOfChannels]();
 
        for (unsigned ci = 0; ci < numReadChannels; ci++)
 
        {
 
            bool ok;
 
            channelSamples[ci] = separatedValues[ci].toDouble(&ok);
 
            if (!ok)
 
            {
 
                qWarning() << "Data parsing error for channel: " << ci;
 
                qWarning() << "Read line: " << line;
 
                channelSamples[ci] = 0;
 
            }
 
        }
 

	
 
        // commit data
 
        addData(channelSamples, _numOfChannels);
 

	
 
        delete[] channelSamples;
 
    }
 
}
 

	
 
void AsciiReader::saveSettings(QSettings* settings)
0 comments (0 inline, 0 general)