Add temperature to AllPlot

Fixes #536.
This commit is contained in:
Damien Grauser
2011-12-07 21:55:35 +00:00
committed by Mark Liversedge
parent 9f25fdc6f8
commit 8d3d89d44d
24 changed files with 143 additions and 41 deletions

View File

@@ -111,6 +111,10 @@ AllPlotWindow::AllPlotWindow(MainWindow *mainWindow) :
showAlt->setCheckState(Qt::Checked);
cl->addWidget(showAlt);
showTemp = new QCheckBox(tr("Temperature"), this);
showTemp->setCheckState(Qt::Checked);
cl->addWidget(showTemp);
showPower = new QComboBox();
showPower->addItem(tr("Power + shade"));
showPower->addItem(tr("Power - shade"));
@@ -332,6 +336,7 @@ AllPlotWindow::AllPlotWindow(MainWindow *mainWindow) :
connect(showSpeed, SIGNAL(stateChanged(int)), this, SLOT(setShowSpeed(int)));
connect(showCad, SIGNAL(stateChanged(int)), this, SLOT(setShowCad(int)));
connect(showAlt, SIGNAL(stateChanged(int)), this, SLOT(setShowAlt(int)));
connect(showTemp, SIGNAL(stateChanged(int)), this, SLOT(setShowTemp(int)));
connect(showGrid, SIGNAL(stateChanged(int)), this, SLOT(setShowGrid(int)));
connect(showFull, SIGNAL(stateChanged(int)), this, SLOT(setShowFull(int)));
connect(showStack, SIGNAL(stateChanged(int)), this, SLOT(showStackChanged(int)));
@@ -690,6 +695,7 @@ AllPlotWindow::setAllPlotWidgets(RideItem *ride)
showSpeed->setEnabled(dataPresent->kph);
showCad->setEnabled(dataPresent->cad);
showAlt->setEnabled(dataPresent->alt);
showTemp->setEnabled(dataPresent->temp);
} else {
showPower->setEnabled(false);
@@ -697,6 +703,7 @@ AllPlotWindow::setAllPlotWidgets(RideItem *ride)
showSpeed->setEnabled(false);
showCad->setEnabled(false);
showAlt->setEnabled(false);
showTemp->setEnabled(false);
}
// turn on/off shading, if it's not available
@@ -1120,6 +1127,18 @@ AllPlotWindow::setShowAlt(int value)
plot->showAlt(value);
}
void
AllPlotWindow::setShowTemp(int value)
{
showTemp->setChecked(value);
//if (!current) return;
allPlot->showTemp(value);
foreach (AllPlot *plot, allPlots)
plot->showTemp(value);
}
void
AllPlotWindow::setShowFull(int value)
{
@@ -1422,6 +1441,7 @@ AllPlotWindow::setupStackPlots()
_allPlot->showSpeed(showSpeed->checkState());
_allPlot->showCad(showCad->checkState());
_allPlot->showAlt(showAlt->checkState());
_allPlot->showTemp(showTemp->checkState());
_allPlot->showGrid(showGrid->checkState());
_allPlot->setPaintBrush(paintBrush->checkState());
_allPlot->setSmoothing(smoothSlider->value());