void CriticalPowerWindow::newRideAdded(RideItem *here) { // any plots we already have are now stale stale = true; // mine just got Zapped, a new rideitem would not be my current item if (here == currentRide) currentRide = NULL; if (rangemode) { // force replot... stale = true; dateRangeChanged(myDateRange); } else { Season season = seasons->seasons.at(cComboSeason->currentIndex()); // Refresh global curve if a ride is added during those dates if ((here->dateTime.date() >= season.getStart() || season.getStart() == QDate()) && (here->dateTime.date() <= season.getEnd() || season.getEnd() == QDate())) cpintPlot->changeSeason(season.getStart(), season.getEnd()); // if visible make the changes visible // rideSelected is easiest way if (amVisible()) rideSelected(); } }
void CriticalPowerWindow::seasonSelected(int iSeason) { if (iSeason >= seasons->seasons.count() || iSeason < 0) return; Season season = seasons->seasons.at(iSeason); _dateRange = season.id(); cpintPlot->changeSeason(season.getStart(), season.getEnd()); cpintPlot->calculate(currentRide); }
void CriticalPowerWindow::seasonSelected(int iSeason) { Season season = seasons.at(iSeason); cpintPlot->setStartDate(season.getStart()); cpintPlot->setEndDate(season.getEnd()); cpintPlot->needToScanRides = true; cpintPlot->calculate(currentRide); }