Fixed HRV to HR in SML files

To avoid HR gaps when < 60 bpm
Added test file with HRV and no HR
This commit is contained in:
Alejandro Martinez
2016-05-03 18:35:03 -03:00
parent 2aa233012f
commit f7dc38bcfd
2 changed files with 576073 additions and 2 deletions

View File

@@ -278,8 +278,8 @@ SmlParser::endElement(const QString&, const QString&, const QString& qName)
double rr = strRR.toDouble() / 1000.0; double rr = strRR.toDouble() / 1000.0;
if (ewmaRR < 0.0) ewmaRR = rr; if (ewmaRR < 0.0) ewmaRR = rr;
else ewmaRR += (rr - ewmaRR)/ewmaTC; else ewmaRR += (rr - ewmaRR)/ewmaTC;
if (secs + rr >= trunc(secs) + 1.0) { for (int i = 0; secs + rr >= trunc(secs) + i + 1; i++) {
rideFile->setPointValue(rideFile->timeIndex(secs), rideFile->hr, round(60.0/ ewmaRR)); rideFile->dataPoints()[rideFile->timeIndex(secs + i)]->hr = round(60.0/ ewmaRR);
} }
secs += rr; secs += rr;
} }

File diff suppressed because one or more lines are too long