diff --git a/app/engine/Flywheel.js b/app/engine/Flywheel.js index 0e46530e65..81650b251e 100644 --- a/app/engine/Flywheel.js +++ b/app/engine/Flywheel.js @@ -223,10 +223,20 @@ export function createFlywheel (rowerSettings) { } function dragFactor () { - // Ths function returns the current dragfactor of the flywheel + // This function returns the current dragfactor of the flywheel return drag.weighedAverage() } + function dragFactorIsReliable () { + // This returns whether the dragfactor is considered reliable, based on measurements instead of a default value + // We can't use reliable() as a filter on the dragFactor() function as Rower.js always needs some dragfactor for most calculations + if (rowerSettings.autoAdjustDragFactor) { + return drag.reliable() + } else { + return true + } + } + function isDwelling () { // Check if the flywheel is spinning down beyond a recovery phase indicating that the rower has stopped rowing // We conclude this based on @@ -354,6 +364,7 @@ export function createFlywheel (rowerSettings) { angularAcceleration, torque, dragFactor, + dragFactorIsReliable, isDwelling, isAboveMinimumSpeed, isUnpowered,