mirror of
https://github.com/GoldenCheetah/GoldenCheetah.git
synced 2026-02-13 16:18:42 +00:00
Model Estimate Progress
.. might remove it, but good to help debug issues !
This commit is contained in:
@@ -547,6 +547,9 @@ MetricAggregator::refreshCPModelMetrics(bool bg)
|
||||
QDate firstOfMonth = QDate(year, month, 01);
|
||||
QDate lastOfMonth = firstOfMonth.addMonths(1).addDays(-1);
|
||||
|
||||
// let others know where we got to...
|
||||
emit modelProgress(year, month);
|
||||
|
||||
// months is a rolling 3 months sets of bests
|
||||
QVector<float> wpk; // for getting the wpk values
|
||||
months << RideFileCache::meanMaxPowerFor(context, wpk, firstOfMonth, lastOfMonth);
|
||||
@@ -655,4 +658,5 @@ MetricAggregator::refreshCPModelMetrics(bool bg)
|
||||
#if (!defined Q_OS_MAC) || (defined QT_NOBUG39038) || (QT_VERSION < 0x050300) // QTBUG 39038 !!!
|
||||
if (!bg) delete bar;
|
||||
#endif
|
||||
emit modelProgress(0, 0); // all done
|
||||
}
|
||||
|
||||
@@ -62,6 +62,7 @@ class MetricAggregator : public QObject
|
||||
|
||||
signals:
|
||||
void dataChanged(); // when metricDB table changed
|
||||
void modelProgress(int, int); // let others know when we're refreshing the model estimates
|
||||
|
||||
public slots:
|
||||
void update();
|
||||
|
||||
@@ -106,6 +106,7 @@ RideSummaryWindow::RideSummaryWindow(Context *context, bool ridesummary) :
|
||||
}
|
||||
connect(context, SIGNAL(configChanged()), this, SLOT(configChanged()));
|
||||
connect(this, SIGNAL(doRefresh()), this, SLOT(refresh()));
|
||||
connect(context->athlete->metricDB, SIGNAL(modelProgress(int,int)), this, SLOT(modelProgress(int,int)));
|
||||
|
||||
setChartLayout(vlayout);
|
||||
configChanged(); // set colors
|
||||
@@ -158,6 +159,24 @@ RideSummaryWindow::setFilter(QStringList list)
|
||||
}
|
||||
#endif
|
||||
|
||||
void
|
||||
RideSummaryWindow::modelProgress(int year, int month)
|
||||
{
|
||||
// ignore if not visible!
|
||||
if (!amVisible()) return;
|
||||
|
||||
QString string;
|
||||
|
||||
if (!year && !month) {
|
||||
string = "<h3>Model</h3>";
|
||||
} else {
|
||||
string = QString("<h3>Modeling<br>%1 %2 </h3>").arg(QDate::shortMonthName(month)).arg(year);
|
||||
}
|
||||
rideSummary->page()->mainFrame()->evaluateJavaScript(
|
||||
QString("var div = document.getElementById(\"modhead\"); div.innerHTML = '%1'; ").arg(string));;
|
||||
|
||||
}
|
||||
|
||||
void
|
||||
RideSummaryWindow::compareChanged()
|
||||
{
|
||||
@@ -572,10 +591,10 @@ RideSummaryWindow::htmlSummary()
|
||||
// MODEL
|
||||
// lets get a table going
|
||||
summary += "<td align=\"center\" valign=\"top\" width=\"%1%%\"><table>"
|
||||
"<tr><td align=\"center\" colspan=2><h3>%2</h3></td></tr>";
|
||||
"<tr><td align=\"center\" colspan=2><div id=\"modhead\">%2</div></td></tr>";
|
||||
|
||||
summary = summary.arg(90 / columnNames.count()+1);
|
||||
summary = summary.arg(tr("Model"));
|
||||
summary = summary.arg(tr("<h3>Model</h3>"));
|
||||
|
||||
// W;
|
||||
summary += QString("<tr><td>%1:</td><td align=\"right\">%2 kJ</td></tr>")
|
||||
|
||||
@@ -113,6 +113,9 @@ class RideSummaryWindow : public GcChartWindow
|
||||
// config changed
|
||||
void configChanged();
|
||||
|
||||
// model estimate progress updates
|
||||
void modelProgress(int year, int month);
|
||||
|
||||
signals:
|
||||
|
||||
void doRefresh();
|
||||
|
||||
Reference in New Issue
Block a user