From ba57688b2d9cdd0423af3f5bb73c8ab533d6401f Mon Sep 17 00:00:00 2001 From: Mark Liversedge Date: Sun, 24 Jan 2016 14:08:39 +0000 Subject: [PATCH] Zwift Support Fixups .. ErgFile member variables needed to be updated after using the ZwoParser since they are used at runtime. --- src/ErgFile.cpp | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/src/ErgFile.cpp b/src/ErgFile.cpp index 30eb49e26..32088c457 100644 --- a/src/ErgFile.cpp +++ b/src/ErgFile.cpp @@ -125,12 +125,22 @@ void ErgFile::parseZwift() foreach(ErgFilePoint p, handler.points) { double watts = p.y * CP / 100.0; Points << ErgFilePoint(p.x, watts, watts); + if (watts > MaxWatts) MaxWatts = watts; + Duration = p.x; } // texts Texts = handler.texts; - if (Points.count()) valid = true; + if (Points.count()) { + valid = true; + Duration = Points.last().x; // last is the end point in msecs + leftPoint = 0; + rightPoint = 1; + + // calculate climbing etc + calculateMetrics(); + } } void ErgFile::parseTacx()