mirror of
https://github.com/GoldenCheetah/GoldenCheetah.git
synced 2026-02-13 16:18:42 +00:00
TrainingPeaks PWX support L/R balance
.. on import and export, using the "pwrright" element. .. this is not part of the public PWX schema but has been used by ipbike when writing PWX, and may or may not be supported by TrainingPeaks.com
This commit is contained in:
committed by
Mark Liversedge
parent
7f551ff079
commit
70c03e8b5d
@@ -220,6 +220,15 @@ PwxFileReader::PwxFromDomDoc(QDomDocument doc, QStringList&) const
|
|||||||
// the TP upload web-service happy with zero values
|
// the TP upload web-service happy with zero values
|
||||||
if (add.watts == 1) add.watts = 0.0;
|
if (add.watts == 1) add.watts = 0.0;
|
||||||
} else add.watts = 0.0;
|
} else add.watts = 0.0;
|
||||||
|
// lrbalance
|
||||||
|
QDomElement lrbalance = node.firstChildElement("pwrright");
|
||||||
|
if (!lrbalance.isNull()) {
|
||||||
|
if (add.watts == 0) {
|
||||||
|
add.lrbalance = 50.0;
|
||||||
|
} else {
|
||||||
|
add.lrbalance =(add.watts-lrbalance.text().toDouble())/add.watts*100.0;
|
||||||
|
}
|
||||||
|
} else add.lrbalance = 0.0;
|
||||||
// torq
|
// torq
|
||||||
QDomElement torq = node.firstChildElement("torq");
|
QDomElement torq = node.firstChildElement("torq");
|
||||||
if (!torq.isNull()) add.nm = torq.text().toDouble();
|
if (!torq.isNull()) add.nm = torq.text().toDouble();
|
||||||
@@ -831,6 +840,14 @@ PwxFileReader::writeRideFile(Context *context, const RideFile *ride, QFile &file
|
|||||||
pwr.appendChild(text);
|
pwr.appendChild(text);
|
||||||
sample.appendChild(pwr);
|
sample.appendChild(pwr);
|
||||||
}
|
}
|
||||||
|
// lrbalance
|
||||||
|
if (ride->areDataPresent()->lrbalance) {
|
||||||
|
int rwatts = point->watts ? (point->watts - (point->watts * (point->lrbalance/100))) : 0;
|
||||||
|
QDomElement lrbalance = doc.createElement("pwrright");
|
||||||
|
text = doc.createTextNode(QString("%1").arg(rwatts));
|
||||||
|
lrbalance.appendChild(text);
|
||||||
|
sample.appendChild(lrbalance);
|
||||||
|
}
|
||||||
// torq
|
// torq
|
||||||
if (ride->areDataPresent()->nm) {
|
if (ride->areDataPresent()->nm) {
|
||||||
QDomElement torq = doc.createElement("torq");
|
QDomElement torq = doc.createElement("torq");
|
||||||
|
|||||||
39949
test/rides/IpBike_902.pwx
Normal file
39949
test/rides/IpBike_902.pwx
Normal file
File diff suppressed because it is too large
Load Diff
Reference in New Issue
Block a user