IntervalItem::refresh()

Computes the metrics for an interval and creates a temporary
ridefile locally so you don't have to.

.. previous design should have pushed this into the
   class instead of performing it in RideItem

.. now there should be no reason to create a ridefile
   during interval discovery.
This commit is contained in:
Mark Liversedge
2015-05-04 18:17:33 +01:00
parent 90c053f09f
commit 8a3e35b880
6 changed files with 69 additions and 52 deletions

View File

@@ -369,9 +369,15 @@ struct ComparePointSecs {
int
RideFile::intervalBegin(const RideFileInterval &interval) const
{
return intervalBeginSecs(interval.start);
}
int
RideFile::intervalBeginSecs(const double secs) const
{
RideFilePoint p;
p.secs = interval.start;
p.secs = secs;
QVector<RideFilePoint*>::const_iterator i = std::lower_bound(
dataPoints_.begin(), dataPoints_.end(), &p, ComparePointSecs());
if (i == dataPoints_.end())