introduce "metric overrides"

This commit allows every ride file to specify a set of "metric overrides":
values to use in place of those for RideMetrics we would otherwise compute.

The most gratifying immediate result of this change is that we can associate a
"skiba_bike_score" metric override with each Manual CSV file, thereby
eliminating the need for a bogus "bs" parameter in RideFilePoint.

In the future, though, we can also save these overrides to a GcRideFile using
a syntax something like this:

  <override>
    <metric name="skiba_bike_score" value="100"/>
    <metric name="average_speed" secs="3600" km="30"/>
  </override>

(Note that average_speed needs to store time and distance in order to
aggregate properly.)

Then we can add a dialog that allows the user to override the computed value
of a metric for any given ride.  For example, if my HRM was on the fritz
during a ride, I could estimate my average HR and override that metric.
(We might want to show these overrided metrics in a different color, so that
it was clear they weren't the computed values.)

Finally, I think we could actually use this feature to eliminate the Manual
CSV format altogether, and just use GcRideFiles without any samples or
intervals, but with metric overrides for all the available metrics.
This commit is contained in:
Sean Rhea
2009-12-17 18:49:13 -05:00
parent 0dae2b88cc
commit e5affbbc64
7 changed files with 42 additions and 31 deletions

View File

@@ -123,10 +123,6 @@ void RideFile::writeAsCsv(QFile &file, bool bIsMetric) const
out << point->interval;
out << ",";
out << point->alt;
if (point->bs > 0.0) {
out << ",";
out << point->bs;
}
out << "\n";
}
@@ -200,10 +196,10 @@ QStringList RideFileFactory::listRideFiles(const QDir &dir) const
void RideFile::appendPoint(double secs, double cad, double hr, double km,
double kph, double nm, double watts, double alt,
double lon, double lat, int interval, double bs)
double lon, double lat, int interval)
{
dataPoints_.append(new RideFilePoint(secs, cad, hr, km, kph,
nm, watts, alt, lon, lat, interval,bs));
nm, watts, alt, lon, lat, interval));
dataPresent.secs |= (secs != 0);
dataPresent.cad |= (cad != 0);
dataPresent.hr |= (hr != 0);