8 #include <QRegularExpression> 27 if (myFile.open(QIODevice::ReadOnly | QIODevice::Text)) {
28 QTextStream ecgInfo(&myFile);
29 QVector<QVector<QPointF> > ecgVals;
31 if (!ecgInfo.atEnd()) {
32 QString strVals = ecgInfo.readLine();
33 while (!ecgInfo.atEnd()) {
34 strVals = ecgInfo.readLine();
35 QStringList strPieces = strVals.split(QRegularExpression(
"\\s+"));
37 if (strPieces.length()==5) {
42 double elapsed = strPieces[0].toDouble();
46 tmp << QPointF(elapsed, strPieces[1].toDouble())
47 << QPointF(elapsed, strPieces[2].toDouble())
48 << QPointF(elapsed, strPieces[3].toDouble())
49 << QPointF(elapsed, strPieces[4].toDouble());
55 else if (strPieces.length()==4){
57 tmp << QPointF(iterations/1000, strPieces[0].toDouble())
58 << QPointF(iterations/1000, strPieces[1].toDouble())
59 << QPointF(iterations/1000, strPieces[2].toDouble())
60 << QPointF(iterations/1000, strPieces[3].toDouble());
84 void LoadBigFile::decimate()
void sendFileData(QVector< QVector< QPointF > >)
signal used to send the loaded txt file as a QVector<QVector <QPointF> > that can be used for plottin...
LoadBigFile(QString fileName, QObject *parent=NULL)
virtual void run()
Load the file with chosen filename and emit the signal sendFileData() when the file is read...