Permalink
Browse files

CP Plot Tests honor filter settings

.. when finding performance tests the filter settings for the
   chart need to be honored.
  • Loading branch information...
liversedge committed Dec 2, 2018
1 parent 0b4d466 commit a64c6f06d6a06245ab1df65a0618b5883a16e9ae
Showing with 21 additions and 16 deletions.
  1. +1 −0 src/Charts/CPPlot.cpp
  2. +20 −16 src/Charts/CriticalPowerWindow.cpp
@@ -1067,6 +1067,7 @@ CPPlot::plotTests(RideItem *rideitem)
// honoring chart settings and filters, lets set the list of
// rides we will search for performance tests...
FilterSet fs;
fs.addFilter(parent->searchBox->isFiltered(), SearchFilterBox::matches(context, parent->searchBox->filter())); // chart settings
fs.addFilter(context->isfiltered, context->filters);
fs.addFilter(context->ishomefiltered, context->homeFilters);
Specification spec;
@@ -39,6 +39,7 @@
#include <qwt_plot_picker.h>
#include <qwt_plot_curve.h>
#include <qwt_series_data.h>
#include <qwt_scale_div.h>
#include <qwt_compat.h>
#include <QFile>
#include "Season.h"
@@ -121,7 +122,7 @@ CriticalPowerWindow::CriticalPowerWindow(Context *context, bool rangemode) :
mainLayout->addLayout(cpediting);
connect(CPEdit, SIGNAL(textChanged(QString)), this, SLOT(setSliderFromEdit()));
connect(CPSlider, SIGNAL(valueChanged(int)), this, SLOT(setEditFromSlider()));
//
// Chart settings
//
@@ -413,6 +414,9 @@ CriticalPowerWindow::CriticalPowerWindow(Context *context, bool rangemode) :
grid->enableX(false); // not needed
grid->enableY(true);
grid->setZ(-20);
QwtValueList ytick[QwtScaleDiv::NTickTypes];
for (double i=0.0; i<=2500; i+= 100) ytick[QwtScaleDiv::MajorTick]<<i;
cpPlot->setAxisScaleDiv(QwtPlot::yLeft,QwtScaleDiv(0.0,2500.0,ytick));
grid->attach(cpPlot);
// the model helper -- showing model parameters etc
@@ -506,8 +510,8 @@ CriticalPowerWindow::CriticalPowerWindow(Context *context, bool rangemode) :
// when working on a ride we can select intervals!
connect(cComboSeason, SIGNAL(currentIndexChanged(int)), this, SLOT(seasonSelected(int)));
connect(context, SIGNAL(intervalSelected()), this, SLOT(intervalSelected()));
connect(context, SIGNAL(intervalsChanged()), this, SLOT(intervalsChanged()));
connect(context, SIGNAL(intervalHover(IntervalItem*)), this, SLOT(intervalHover(IntervalItem*)));
connect(context, SIGNAL(intervalsChanged()), this, SLOT(intervalsChanged()));
connect(context, SIGNAL(intervalHover(IntervalItem*)), this, SLOT(intervalHover(IntervalItem*)));
// Compare
connect(context, SIGNAL(compareIntervalsStateChanged(bool)), SLOT(forceReplot()));
@@ -580,14 +584,14 @@ CriticalPowerWindow::CriticalPowerWindow(Context *context, bool rangemode) :
}
// veloclinic stuff
void
void
CriticalPowerWindow::setSliderFromEdit()
{
int value = CPEdit->text().toInt();
CPSlider->setValue(value);
}
void
void
CriticalPowerWindow::setEditFromSlider()
{
CPEdit->setText(QString("%1").arg(CPSlider->value()));
@@ -777,7 +781,7 @@ CriticalPowerWindow::modelChanged()
// No default values !
break;
case 4 : // Veloclinic Model uses 2 parameter classic but
case 4 : // Veloclinic Model uses 2 parameter classic but
// also lets you select a variation ..
vlabel->show();
velo1->show();
@@ -860,7 +864,7 @@ CriticalPowerWindow::modelChanged()
aeI2SpinBox->show();
laeLabel->show();
laeI1SpinBox->show();
laeI2SpinBox->show();
laeI2SpinBox->show();
modelDecayCheck->hide();
modelDecayLabel->hide();
@@ -882,9 +886,9 @@ CriticalPowerWindow::modelChanged()
modelParametersChanged();
}
// kind of tedious but return index into a radio button group
// kind of tedious but return index into a radio button group
// for the button that is actually checked.
int
int
CriticalPowerWindow::variant() const
{
if (velo1->isChecked()) return 0;
@@ -988,7 +992,7 @@ CriticalPowerWindow::forceReplot()
if (rangemode) {
// force replot...
dateRangeChanged(myDateRange);
dateRangeChanged(myDateRange);
} else {
@@ -1171,8 +1175,8 @@ CriticalPowerWindow::showIntervalCurve(IntervalItem *current, int index)
// make a ridefile
RideFile f(myRideItem->ride());
foreach(RideFilePoint *p, myRideItem->ride()->dataPoints()) {
foreach(RideFilePoint *p, myRideItem->ride()->dataPoints()) {
if ((p->secs+f.recIntSecs()) >= current->start && p->secs <= (current->stop+f.recIntSecs())) {
f.appendPoint(p->secs, p->cad, p->hr, p->km, p->kph, p->nm,
p->watts, p->alt, p->lon, p->lat, p->headwind,
@@ -1329,7 +1333,7 @@ bool
CriticalPowerWindow::event(QEvent *event)
{
// nasty nasty nasty hack to move widgets as soon as the widget geometry
// is set properly by the layout system, by default the width is 100 and
// is set properly by the layout system, by default the width is 100 and
// we wait for it to be set properly then put our helper widget on the RHS
if (event->type() == QEvent::Resize && geometry().width() != 100) {
@@ -1714,7 +1718,7 @@ CriticalPowerWindow::dateRangeChanged(DateRange dateRange)
} else dateRange = myDateRange;
// only change date range if its actually changed!
// only change date range if its actually changed!
if (series() == veloclinicplot || dateRange.from != cfrom || dateRange.to != cto || stale) {
cfrom = dateRange.from;
@@ -1844,7 +1848,7 @@ CriticalPowerWindow::showPercentChanged(int state)
else cpPlot->setRide(currentRide);
}
void
void
CriticalPowerWindow::rPercentChanged(int check)
{
showPercentCheck->setChecked(check);
@@ -1890,7 +1894,7 @@ CriticalPowerWindow::showCSLinearChanged(int state)
if (rangemode) dateRangeChanged(DateRange());
}
void
void
CriticalPowerWindow::rHeatChanged(int check)
{
showHeatCheck->setChecked(check);

0 comments on commit a64c6f0

Please sign in to comment.