From 4c62c52fc34a7ccbf94d6fcf3d4cd17a9ce77818 Mon Sep 17 00:00:00 2001 From: Michel Dagenais Date: Wed, 14 Oct 2020 23:02:21 -0400 Subject: [PATCH] Fix a small issue in setPowerScaleFactor (#3634) If a value was set for the powerScaleCalibration factor, the weight was clipped between 0.8 and 1.2kg. That would be an easy ride uphill for sure. --- src/Train/Fortius.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/Train/Fortius.cpp b/src/Train/Fortius.cpp index e7fce3d33..ee7f83691 100644 --- a/src/Train/Fortius.cpp +++ b/src/Train/Fortius.cpp @@ -103,8 +103,8 @@ void Fortius::setBrakeCalibrationFactor(double brakeCalibrationFactor) // output power adjusted by this value so user can compare with hub or crank based readings void Fortius::setPowerScaleFactor(double powerScaleFactor) { - if (weight < 0.8) weight = 0.8; - if (weight > 1.2) weight = 1.2; + if (powerScaleFactor < 0.8) powerScaleFactor = 0.8; + if (powerScaleFactor > 1.2) powerScaleFactor = 1.2; pvars.lock(); this->powerScaleFactor = powerScaleFactor;