Added headwind to Aerolab calculation for iAero

Added a headwind data field, which is available when using
an iAero head unit, to dramatically improve the calculation
of Chung analysis for users of more recent iAero devices.

All other data files than the iAero have the headwind term set to
zero when they append a point.
This commit is contained in:
Andy Froncioni
2010-02-21 13:23:54 -05:00
committed by Sean Rhea
parent 9f81d92088
commit 79b6506004
16 changed files with 38 additions and 25 deletions

View File

@@ -132,10 +132,11 @@ TcxParser::endElement( const QString&, const QString&, const QString& qName)
// for smart recording, the delta_t will not be constant
// average all the calculations based on the previous
// point.
headwind = 0.0;
if(rideFile->dataPoints().empty()) {
// first point
rideFile->appendPoint(secs, cadence, hr, distance,
speed, torque, power, alt, lon, lat, lap);
speed, torque, power, alt, lon, lat, headwind, lap);
}
else {
// assumption that the change in ride is linear... :)
@@ -153,7 +154,7 @@ TcxParser::endElement( const QString&, const QString&, const QString& qName)
if(deltaSecs == 1) {
// no smart recording, just insert the data
rideFile->appendPoint(secs, cadence, hr, distance,
speed, torque, power, alt, lon, lat, lap);
speed, torque, power, alt, lon, lat, headwind, lap);
}
else {
for(int i = 1; i <= deltaSecs; i++) {
@@ -176,6 +177,7 @@ TcxParser::endElement( const QString&, const QString&, const QString& qName)
prevPoint->alt + (deltaAlt * weight),
lon, // lon
lat, // lat
headwind, // headwind
lap);
}
prevPoint = rideFile->dataPoints().back();