Skip to content

Commit

Permalink
Added dragFactorIsReliable to indicate dragfactor reliability
Browse files Browse the repository at this point in the history
  • Loading branch information
JaapvanEkris authored Sep 8, 2024
1 parent 2a61054 commit b4ffd67
Showing 1 changed file with 12 additions and 1 deletion.
13 changes: 12 additions & 1 deletion app/engine/Flywheel.js
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -354,6 +364,7 @@ export function createFlywheel (rowerSettings) {
angularAcceleration,
torque,
dragFactor,
dragFactorIsReliable,
isDwelling,
isAboveMinimumSpeed,
isUnpowered,
Expand Down

0 comments on commit b4ffd67

Please sign in to comment.