void PfPvWindow::rideSelected() { // we need to refresh for compare mode if (isCompare()) { if (isVisible() && compareStale) compareChanged(); return; } if (!amVisible()) { compareStale = true; return; } RideItem *ride = myRideItem; if (!ride || !ride->ride() || !ride->ride()->isDataPresent(RideFile::watts) || !ride->ride()->isDataPresent(RideFile::cad)) { setIsBlank(true); current = NULL; return; } else { setIsBlank(false); } if (!stale && ride == current) return; pfPvPlot->setData(ride); current = ride; stale = false; // update the QLabel widget with the CP value set in PfPvPlot::setData() qaCPValue->setText(QString("%1").arg(pfPvPlot->getCP())); }
void LTMWindow::refreshPlot() { if (amVisible() == true) { if (isCompare()) { // COMPARE PLOTS stackWidget->setCurrentIndex(3); refreshCompare(); } else if (ltmTool->showData->isChecked()) { // DATA TABLE stackWidget->setCurrentIndex(1); refreshDataTable(); } else { if (ltmTool->showStack->isChecked()) { // STACK PLOTS refreshStackPlots(); stackWidget->setCurrentIndex(2); stackDirty = false; } else { // NORMAL PLOTS plotted = DateRange(settings.start.date(), settings.end.date()); ltmPlot->setData(&settings); stackWidget->setCurrentIndex(0); dirty = false; spanSlider->setMinimum(ltmPlot->axisScaleDiv(QwtPlot::xBottom).lowerBound()); spanSlider->setMaximum(ltmPlot->axisScaleDiv(QwtPlot::xBottom).upperBound()); spanSlider->setLowerValue(spanSlider->minimum()); spanSlider->setUpperValue(spanSlider->maximum()); } } } }
void LTMWindow::refreshCompare() { // not if in compare mode if (!isCompare()) return; // setup stacks but only if needed //if (!stackDirty) return; // lets come back to that! setUpdatesEnabled(false); // delete old and create new... // QScrollArea *plotArea; // QWidget *plotsWidget; // QVBoxLayout *plotsLayout; // QList<LTMSettings> plotSettings; foreach (LTMPlot *p, compareplots) { compareplotsLayout->removeWidget(p); delete p; }
void LTMWindow::compareChanged() { if (!amVisible()) { compareDirty = true; return; } if (isCompare()) { // refresh plot handles the compare case refreshPlot(); } else { // forced refresh back to normal stackDirty = dirty = true; filterChanged(); // forces reread etc } repaint(); }
void LTMWindow::refreshPlot() { if (amVisible() == true) { if (isCompare()) { // COMPARE PLOTS stackWidget->setCurrentIndex(3); refreshCompare(); } else if (ltmTool->showData->isChecked()) { // DATA TABLE stackWidget->setCurrentIndex(1); refreshDataTable(); } else { if (ltmTool->showStack->isChecked()) { // STACK PLOTS refreshStackPlots(); stackWidget->setCurrentIndex(2); stackDirty = false; } else { // NORMAL PLOTS plotted = DateRange(settings.start.date(), settings.end.date()); ltmPlot->setData(&settings); stackWidget->setCurrentIndex(0); dirty = false; } } } }