Frame PvPf Plot

When working with smaller intervals it is difficult to see the
highlighted points when all the points are shown in black. This
patch adds a 'Frame Intervals' checkbox to enable the user to
turn off all the points when looking at specific intervals.

If no intervals are selected then this setting has no net effect.
All datapoints are shown.
This commit is contained in:
Mark Liversedge
2010-01-30 10:56:29 +00:00
committed by Sean Rhea
parent 67919e4d21
commit fbd5238e4e
4 changed files with 31 additions and 1 deletions

View File

@@ -169,6 +169,9 @@ PfPvPlot::PfPvPlot(MainWindow *mainWindow)
cl_ = settings->value(GC_CRANKLENGTH).toDouble() / 1000.0;
merge_intervals = false;
frame_intervals = true;
recalc();
}
@@ -415,6 +418,8 @@ PfPvPlot::showIntervals(RideItem *_rideItem)
int num_intervals=intervalCount();
if (mergeIntervals()) num_intervals = 1;
if (frameIntervals() || num_intervals==0) curve->setVisible(true);
if (frameIntervals()==false && num_intervals) curve->setVisible(false);
QVector<std::set<std::pair<double, double> > > dataSetInterval(num_intervals);
long tot_cad = 0;
@@ -620,3 +625,10 @@ PfPvPlot::setMergeIntervals(bool value)
merge_intervals = value;
showIntervals(rideItem);
}
void
PfPvPlot::setFrameIntervals(bool value)
{
frame_intervals = value;
showIntervals(rideItem);
}

View File

@@ -57,6 +57,8 @@ class PfPvPlot : public QwtPlot
bool mergeIntervals() const { return merge_intervals; }
void setMergeIntervals(bool value);
bool frameIntervals() const { return frame_intervals; }
void setFrameIntervals(bool value);
public slots:
signals:
@@ -83,7 +85,7 @@ signals:
int cad_;
double cl_;
bool shade_zones; // whether to shade zones, added 27Apr2009 djconnel
bool merge_intervals;
bool merge_intervals, frame_intervals;
};
#endif // _GC_QaPlot_h

View File

@@ -43,6 +43,9 @@ PfPvWindow::PfPvWindow(MainWindow *mainWindow) :
mergeIntervalPfPvCheckBox = new QCheckBox;
mergeIntervalPfPvCheckBox->setText(tr("Merge intervals"));
mergeIntervalPfPvCheckBox->setCheckState(Qt::Unchecked);
frameIntervalPfPvCheckBox = new QCheckBox;
frameIntervalPfPvCheckBox->setText(tr("Frame intervals"));
frameIntervalPfPvCheckBox->setCheckState(Qt::Checked);
qaLayout->addWidget(qaCPLabel);
qaLayout->addWidget(qaCPValue);
@@ -52,6 +55,7 @@ PfPvWindow::PfPvWindow(MainWindow *mainWindow) :
qaLayout->addWidget(qaClValue);
qaLayout->addWidget(shadeZonesPfPvCheckBox);
qaLayout->addWidget(mergeIntervalPfPvCheckBox);
qaLayout->addWidget(frameIntervalPfPvCheckBox);
vlayout->addWidget(pfPvPlot);
vlayout->addLayout(qaLayout);
@@ -73,6 +77,8 @@ PfPvWindow::PfPvWindow(MainWindow *mainWindow) :
this, SLOT(setShadeZonesPfPvFromCheckBox()));
connect(mergeIntervalPfPvCheckBox, SIGNAL(stateChanged(int)),
this, SLOT(setMergeIntervalsPfPvFromCheckBox()));
connect(frameIntervalPfPvCheckBox, SIGNAL(stateChanged(int)),
this, SLOT(setFrameIntervalsPfPvFromCheckBox()));
connect(mainWindow, SIGNAL(rideSelected()), this, SLOT(rideSelected()));
connect(mainWindow, SIGNAL(intervalSelected()), this, SLOT(intervalSelected()));
connect(mainWindow, SIGNAL(intervalsChanged()), this, SLOT(intervalSelected()));
@@ -123,6 +129,14 @@ PfPvWindow::setMergeIntervalsPfPvFromCheckBox()
}
}
void
PfPvWindow::setFrameIntervalsPfPvFromCheckBox()
{
if (pfPvPlot->frameIntervals() != frameIntervalPfPvCheckBox->isChecked()) {
pfPvPlot->setFrameIntervals(frameIntervalPfPvCheckBox->isChecked());
}
}
void
PfPvWindow::setQaCPFromLineEdit()
{

View File

@@ -48,6 +48,7 @@ class PfPvWindow : public QWidget
void setQaCLFromLineEdit();
void setShadeZonesPfPvFromCheckBox();
void setMergeIntervalsPfPvFromCheckBox();
void setFrameIntervalsPfPvFromCheckBox();
protected:
@@ -55,6 +56,7 @@ class PfPvWindow : public QWidget
PfPvPlot *pfPvPlot;
QCheckBox *shadeZonesPfPvCheckBox;
QCheckBox *mergeIntervalPfPvCheckBox;
QCheckBox *frameIntervalPfPvCheckBox;
QLineEdit *qaCPValue;
QLineEdit *qaCadValue;
QLineEdit *qaClValue;