mirror of
https://github.com/GoldenCheetah/GoldenCheetah.git
synced 2026-02-13 16:18:42 +00:00
fix season selector in cp plot
This commit is contained in:
@@ -256,6 +256,17 @@ read_one(const QDir& dir, const QString &filename, QVector<double> &bests,
|
||||
return 0;
|
||||
}
|
||||
|
||||
void
|
||||
CpintPlot::changeSeason(const QDate &start, const QDate &end)
|
||||
{
|
||||
startDate = start;
|
||||
endDate = end;
|
||||
needToScanRides = true;
|
||||
delete CPCurve;
|
||||
CPCurve = NULL;
|
||||
clear_CP_Curves();
|
||||
}
|
||||
|
||||
void
|
||||
CpintPlot::setEnergyMode(bool value)
|
||||
{
|
||||
|
||||
@@ -47,8 +47,7 @@ class CpintPlot : public QwtPlot
|
||||
double cp, tau, t0; // CP model parameters
|
||||
void deriveCPParameters();
|
||||
bool deleteCpiFile(QString filename);
|
||||
void setStartDate(QDate date) { startDate = date; }
|
||||
void setEndDate(QDate date) { endDate = date; }
|
||||
void changeSeason(const QDate &start, const QDate &end);
|
||||
void setEnergyMode(bool value);
|
||||
bool energyMode() const { return energyMode_; }
|
||||
|
||||
|
||||
@@ -238,17 +238,14 @@ void CriticalPowerWindow::addSeasons()
|
||||
if (!seasons.empty()) {
|
||||
cComboSeason->setCurrentIndex(cComboSeason->count() - 1);
|
||||
Season season = seasons.last();
|
||||
cpintPlot->setStartDate(season.getStart());
|
||||
cpintPlot->setEndDate(season.getEnd());
|
||||
cpintPlot->changeSeason(season.getStart(), season.getEnd());
|
||||
}
|
||||
}
|
||||
|
||||
void CriticalPowerWindow::seasonSelected(int iSeason)
|
||||
{
|
||||
Season season = seasons.at(iSeason);
|
||||
cpintPlot->setStartDate(season.getStart());
|
||||
cpintPlot->setEndDate(season.getEnd());
|
||||
cpintPlot->needToScanRides = true;
|
||||
cpintPlot->changeSeason(season.getStart(), season.getEnd());
|
||||
cpintPlot->calculate(currentRide);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user