Fix VAM on CP chart out by factor of 10

Fixes #489.
This commit is contained in:
Mark Liversedge
2013-02-13 22:01:43 +00:00
parent fe9e3e00cf
commit 05f523f3be
2 changed files with 4 additions and 2 deletions

View File

@@ -666,7 +666,8 @@ MeanMaxComputer::run()
// NOTE: It is 360 not 3600 because Altitude is factored for decimal places
// since it is the base data series, but we are calculating VAM
double vam = (((data.points[i].value - lastAlt) * 360)/ride->recIntSecs());
// And we multiply by 10 at the end!
double vam = (((data.points[i].value - lastAlt) * 360)/ride->recIntSecs()) * 10;
if (vam < 0) vam = 0;
lastAlt = data.points[i].value;
data.points[i].value = vam;

View File

@@ -38,7 +38,7 @@ typedef double data_t;
// arrays when plotting CP curves and histograms. It is precoputed
// to save time and cached in a file .cpx
//
static const unsigned int RideFileCacheVersion = 7;
static const unsigned int RideFileCacheVersion = 8;
// revision history:
// version date description
// 1 29-Apr-11 Initial - header, mean-max & distribution data blocks
@@ -48,6 +48,7 @@ static const unsigned int RideFileCacheVersion = 7;
// 5 18-Aug-11 Added VAM mean maximals
// 6 27-Jun-12 Added W/kg mean maximals and distribution
// 7 03-Dec-12 Fixed W/kg calculations!
// 8 13-Feb-13 Fixed VAM calculations
// The cache file (.cpx) has a binary format:
// 1 x Header data - describing the version and contents of the cache