mirror of
https://github.com/GoldenCheetah/GoldenCheetah.git
synced 2026-02-15 00:49:55 +00:00
Reintroduce Heartrate Zone Summary on RideSummary Window
The refactoring of the summary window to use metricDB and the introduction of HR zone config in options removed (temporarily) the table on ride summary. This patch re-introduces it.
This commit is contained in:
@@ -169,6 +169,20 @@ RideSummaryWindow::htmlSummary() const
|
||||
NULL
|
||||
};
|
||||
|
||||
const char *timeInZonesHR[] = {
|
||||
"time_in_zone_H1",
|
||||
"time_in_zone_H2",
|
||||
"time_in_zone_H3",
|
||||
"time_in_zone_H4",
|
||||
"time_in_zone_H5",
|
||||
"time_in_zone_H6",
|
||||
"time_in_zone_H7",
|
||||
"time_in_zone_H8",
|
||||
"time_in_zone_H9",
|
||||
"time_in_zone_H10",
|
||||
NULL
|
||||
};
|
||||
|
||||
// Use pre-computed and saved metric values if the ride has not
|
||||
// been edited. Otherwise we need to re-compute every time.
|
||||
SummaryMetrics metrics;
|
||||
@@ -250,6 +264,17 @@ RideSummaryWindow::htmlSummary() const
|
||||
summary += mainWindow->zones()->summarize(rideItem->zoneRange(), time_in_zone);
|
||||
}
|
||||
|
||||
//
|
||||
// Time In Zones HR
|
||||
//
|
||||
if (rideItem->numHrZones() > 0) {
|
||||
QVector<double> time_in_zone(rideItem->numZones());
|
||||
for (int i = 0; i < rideItem->numZones(); ++i)
|
||||
time_in_zone[i] = metrics.getForSymbol(timeInZonesHR[i]);
|
||||
summary += tr("<h2>Heart Rate Zones</h2>");
|
||||
summary += mainWindow->hrZones()->summarize(rideItem->hrZoneRange(), time_in_zone);
|
||||
}
|
||||
|
||||
//
|
||||
// Interval Summary (recalculated on every refresh since they are not cached at present)
|
||||
//
|
||||
|
||||
Reference in New Issue
Block a user