mirror of
https://github.com/subsurface/subsurface.git
synced 2025-02-01 00:43:24 +00:00
Make parsing of Seabear header more robust
This should work even if some header line is missing from some DC. Signed-off-by: Miika Turkia <miika.turkia@gmail.com>
This commit is contained in:
parent
6e1c00078d
commit
221f67206b
1 changed files with 7 additions and 0 deletions
|
@ -1529,6 +1529,7 @@ int parse_seabear_header(const char *filename, char **params, int pnr)
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
f.seek(0);
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Parse header - currently only interested in sample
|
* Parse header - currently only interested in sample
|
||||||
|
@ -1543,6 +1544,7 @@ int parse_seabear_header(const char *filename, char **params, int pnr)
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
f.seek(0);
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Grab the sample interval
|
* Grab the sample interval
|
||||||
|
@ -1555,6 +1557,7 @@ int parse_seabear_header(const char *filename, char **params, int pnr)
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
f.seek(0);
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Dive mode, can be: OC, APNEA, BOTTOM TIMER, CCR, CCR SENSORBOARD
|
* Dive mode, can be: OC, APNEA, BOTTOM TIMER, CCR, CCR SENSORBOARD
|
||||||
|
@ -1568,6 +1571,10 @@ int parse_seabear_header(const char *filename, char **params, int pnr)
|
||||||
params[pnr++] = strdup(parseLine.replace(needle, QString::fromLatin1("")).prepend("\"").append("\"").toUtf8().data());
|
params[pnr++] = strdup(parseLine.replace(needle, QString::fromLatin1("")).prepend("\"").append("\"").toUtf8().data());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
f.seek(0);
|
||||||
|
|
||||||
|
while ((parseLine = f.readLine().trimmed()).length() > 0 && !f.atEnd()) {
|
||||||
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Parse CSV fields
|
* Parse CSV fields
|
||||||
|
|
Loading…
Add table
Reference in a new issue