fix time riding bug for SRM by making use of rec_int_ms in RawFile rather than

tracking last_secs
This commit is contained in:
Sean C. Rhea
2007-04-18 21:19:56 +00:00
parent b967d276d1
commit e1371fab8c
3 changed files with 4 additions and 6 deletions

View File

@@ -106,7 +106,7 @@ RawFile *RawFile::readFile(QFile &file, QStringList &errors)
return NULL;
}
result->startTime = data.startTime;
result->rec_int = (unsigned) round(data.recint); // TODO
result->rec_int_ms = (unsigned) round(data.recint * 1000.0);
QListIterator<SrmDataPoint*> i(data.dataPoints);
while (i.hasNext()) {
@@ -131,7 +131,7 @@ RawFile *RawFile::readFile(QFile &file, QStringList &errors)
RawFileReadState state(result->points, result->powerHist, errors);
pt_read_raw(f, 0 /* not compat */, &state, config_cb,
time_cb, data_cb, error_cb);
result->rec_int = state.rec_int;
result->rec_int_ms = (unsigned) round(state.rec_int * 1.26 * 1000.0);
}
return result;
}

View File

@@ -50,7 +50,7 @@ class RawFile
public:
QDateTime startTime;
int rec_int;
int rec_int_ms;
QList<RawFilePoint*> points;
QMap<double,double> powerHist;
static RawFile *readFile(QFile &file, QStringList &errors);

View File

@@ -133,7 +133,6 @@ RideItem::htmlSummary()
double total_hr = 0.0;
double secs_cad = 0.0;
double total_cad = 0.0;
double last_secs = 0.0;
QString intervals = "";
unsigned last_interval = UINT_MAX;
@@ -167,7 +166,7 @@ RideItem::htmlSummary()
mile_start = point->miles;
}
double secs_delta = point->secs - last_secs;
double secs_delta = raw->rec_int_ms / 1000.0;
if ((point->mph > 0.0) || (point->cad > 0.0))
secs_moving_or_pedaling += secs_delta;
if (point->mph > 0.0)
@@ -195,7 +194,6 @@ RideItem::htmlSummary()
int_mph_cnt += 1;
}
last_secs = point->secs;
mile_end = point->miles;
time_end = point->secs;
}