From 30b931bedb9a2857a026fddfef6a2605ceb49818 Mon Sep 17 00:00:00 2001 From: Thomas Weichmann Date: Thu, 24 Dec 2009 00:11:50 -0500 Subject: [PATCH] Fixed unit conversion in CSV importer --- src/CsvRideFile.cpp | 3 +++ src/Units.h | 1 + 2 files changed, 4 insertions(+) diff --git a/src/CsvRideFile.cpp b/src/CsvRideFile.cpp index 0d116ce26..67a0040a6 100644 --- a/src/CsvRideFile.cpp +++ b/src/CsvRideFile.cpp @@ -153,6 +153,7 @@ RideFile *CsvFileReader::openRideFile(QFile &file, QStringList &errors) const if (!metric) { km *= KM_PER_MILE; kph *= KM_PER_MILE; + alt *= METERS_PER_FOOT; } } else if (iBike) { @@ -174,6 +175,7 @@ RideFile *CsvFileReader::openRideFile(QFile &file, QStringList &errors) const if (!metric) { km *= KM_PER_MILE; kph *= KM_PER_MILE; + alt *= METERS_PER_FOOT; } } else { @@ -204,6 +206,7 @@ RideFile *CsvFileReader::openRideFile(QFile &file, QStringList &errors) const if (!metric) { km *= KM_PER_MILE; kph *= KM_PER_MILE; + alt *= METERS_PER_FOOT; } } diff --git a/src/Units.h b/src/Units.h index 0ddee9b81..b06d4edae 100644 --- a/src/Units.h +++ b/src/Units.h @@ -22,6 +22,7 @@ #define KM_PER_MILE 1.609344 #define MILES_PER_KM 0.62137119 #define FEET_PER_METER 3.2808399 +#define METERS_PER_FOOT 0.3047999 #endif // _GC_Units_h