From 05f523f3be2cbc0bed971694699dd997858b17cf Mon Sep 17 00:00:00 2001 From: Mark Liversedge Date: Wed, 13 Feb 2013 22:01:43 +0000 Subject: [PATCH] Fix VAM on CP chart out by factor of 10 Fixes #489. --- src/RideFileCache.cpp | 3 ++- src/RideFileCache.h | 3 ++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/src/RideFileCache.cpp b/src/RideFileCache.cpp index 21f9c5ddf..fb573eab4 100644 --- a/src/RideFileCache.cpp +++ b/src/RideFileCache.cpp @@ -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; diff --git a/src/RideFileCache.h b/src/RideFileCache.h index 87429b93d..637f841c0 100644 --- a/src/RideFileCache.h +++ b/src/RideFileCache.h @@ -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