Tweak Virtual Power

If cadence is zero when calculating power then we
should set power to zero. Speed will not be zero
when freewheeling and therefore the calculation
will overstate power output.

Secondly, the NullController (for testing) did
not call the realtimeController post process
function. It does now so we can test the virtual
power calculation.
This commit is contained in:
Mark Liversedge
2011-10-26 22:18:37 +01:00
parent 8e9a93f50d
commit cd2e02fb69
2 changed files with 8 additions and 4 deletions

View File

@@ -102,9 +102,12 @@ RealtimeController::processRealtimeData(RealtimeData &rtData)
// for the data / analysis see: http://wattagetraining.com/forum/viewtopic.php?f=2&t=335
rtData.setWatts((0.21*pow(V,3))+(4.25*V));
}
break;
default : // unknown - do nothing
break;
}
// if calculating but no cadence then power must be set to zero
if (dc->postProcess && !rtData.getCadence()) rtData.setWatts(0);
}
// for future devices, we may need to setup algorithmic tables etc