read intervals in iBike CSV files

This commit is contained in:
Sean Rhea
2009-12-30 22:08:10 -05:00
parent 4f4973ab18
commit 255f57b5f7

View File

@@ -74,6 +74,7 @@ RideFile *CsvFileReader::openRideFile(QFile &file, QStringList &errors) const
int lineno = 1;
QTextStream is(&file);
RideFile *rideFile = new RideFile();
int iBikeInterval = 0;
while (!is.atEnd()) {
// the readLine() method doesn't handle old Macintosh CR line endings
// this workaround will load the the entire file if it has CR endings
@@ -171,7 +172,11 @@ RideFile *CsvFileReader::openRideFile(QFile &file, QStringList &errors) const
alt = line.section(',', 6, 6).toDouble();
lat = line.section(',', 12, 12).toDouble();
lon = line.section(',', 13, 13).toDouble();
interval = NULL; //not provided?
int lap = line.section(',', 9, 9).toInt();
if (lap > 0) {
iBikeInterval += 1;
interval = iBikeInterval;
}
if (!metric) {
km *= KM_PER_MILE;
kph *= KM_PER_MILE;