Skip to content

Commit

Permalink
CPPlot : Remove FTP+rank
Browse files Browse the repository at this point in the history
  • Loading branch information
grauser committed Mar 19, 2017
1 parent 207e99a commit 3ec09e3
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 24 deletions.
12 changes: 9 additions & 3 deletions src/Charts/CPPlot.cpp
Expand Up @@ -553,10 +553,16 @@ CPPlot::plotModel()
//CP
cpw->cpTitle->setText(tr("CP"));
cpw->cpValue->setText(QString(tr("%1 w")).arg(pdModel->CP(), 0, 'f', 0));
cpw->cpRank->setText(tr("n/a"));

// Reference 6.25W/kg -> untrained 2.5W/kg
int _ftpLevel = 15 * (pdModel->CP() / appsettings->cvalue(context->athlete->cyclist, GC_WEIGHT).toDouble() - 2.5) / (6.25-2.5) ;
if (_ftpLevel > 0 && _ftpLevel < 16) // check bounds
cpw->cpRank->setText(QString("%1").arg(_ftpLevel));
else
cpw->cpRank->setText(tr("n/a"));

//FTP and FTP ranking
cpw->titleRank->setText(tr("Rank"));
/*cpw->titleRank->setText(tr("Rank"));
cpw->ftpTitle->setText(tr("FTP"));
if (pdModel->hasFTP()) {
cpw->ftpValue->setText(QString(tr("%1 w")).arg(pdModel->FTP(), 0, 'f', 0));
Expand All @@ -572,7 +578,7 @@ CPPlot::plotModel()
cpw->ftpValue->setText(tr("n/a"));
cpw->ftpRank->setText(tr("n/a"));
}
}*/

// P-MAX and P-MAX ranking
cpw->pmaxTitle->setText(tr("Pmax"));
Expand Down
23 changes: 2 additions & 21 deletions src/Charts/CriticalPowerWindow.cpp
Expand Up @@ -396,9 +396,6 @@ CriticalPowerWindow::CriticalPowerWindow(Context *context, bool rangemode) :
pmaxTitle = new QLabel(tr("Pmax"), this);
pmaxValue = new QLabel(tr("0 w"), this);
pmaxRank = new QLabel(tr("n/a"), this);
ftpTitle = new QLabel(tr("FTP"), this);
ftpValue = new QLabel(tr("0 w"), this);
ftpRank = new QLabel(tr("n/a"), this);
eiTitle = new QLabel(tr("Endurance Index"), this);
eiValue = new QLabel(tr("n/a"), this);

Expand All @@ -415,9 +412,6 @@ CriticalPowerWindow::CriticalPowerWindow(Context *context, bool rangemode) :
pmaxTitle->setAutoFillBackground(true);
pmaxValue->setAutoFillBackground(true);
pmaxRank->setAutoFillBackground(true);
ftpTitle->setAutoFillBackground(true);
ftpValue->setAutoFillBackground(true);
ftpRank->setAutoFillBackground(true);
eiTitle->setAutoFillBackground(true);
eiValue->setAutoFillBackground(true);

Expand All @@ -434,9 +428,6 @@ CriticalPowerWindow::CriticalPowerWindow(Context *context, bool rangemode) :
pmaxTitle->setAlignment(Qt::AlignLeft | Qt::AlignVCenter);
pmaxValue->setAlignment(Qt::AlignHCenter | Qt::AlignVCenter);
pmaxRank->setAlignment(Qt::AlignHCenter | Qt::AlignVCenter);
ftpTitle->setAlignment(Qt::AlignLeft | Qt::AlignVCenter);
ftpValue->setAlignment(Qt::AlignHCenter | Qt::AlignVCenter);
ftpRank->setAlignment(Qt::AlignHCenter | Qt::AlignVCenter);
eiTitle->setAlignment(Qt::AlignLeft | Qt::AlignVCenter);
eiValue->setAlignment(Qt::AlignHCenter | Qt::AlignVCenter);

Expand All @@ -453,11 +444,8 @@ CriticalPowerWindow::CriticalPowerWindow(Context *context, bool rangemode) :
gridLayout->addWidget(pmaxTitle, 3, 0);
gridLayout->addWidget(pmaxValue, 3, 1);
gridLayout->addWidget(pmaxRank, 3, 2);
gridLayout->addWidget(ftpTitle, 4, 0);
gridLayout->addWidget(ftpValue, 4, 1);
gridLayout->addWidget(ftpRank, 4, 2);
gridLayout->addWidget(eiTitle, 5, 0);
gridLayout->addWidget(eiValue, 5, 1);
gridLayout->addWidget(eiTitle, 4, 0);
gridLayout->addWidget(eiValue, 4, 1);

#ifdef GC_HAVE_MUMODEL
addHelper(QString(tr("Motor Unit Model")), new MUWidget(this, context));
Expand Down Expand Up @@ -621,12 +609,8 @@ CriticalPowerWindow::configChanged(qint32)
pmaxTitle->setFont(font);
pmaxValue->setFont(font);
pmaxRank->setFont(font);
ftpTitle->setFont(font);
ftpValue->setFont(font);
ftpRank->setFont(font);
eiTitle->setFont(font);
eiValue->setFont(font);

helper->setPalette(palette);
titleBlank->setPalette(palette);
titleValue->setPalette(palette);
Expand All @@ -640,9 +624,6 @@ CriticalPowerWindow::configChanged(qint32)
pmaxTitle->setPalette(palette);
pmaxValue->setPalette(whitepalette);
pmaxRank->setPalette(whitepalette);
ftpTitle->setPalette(palette);
ftpValue->setPalette(whitepalette);
ftpRank->setPalette(whitepalette);
eiTitle->setPalette(palette);
eiValue->setPalette(whitepalette);

Expand Down

0 comments on commit 3ec09e3

Please sign in to comment.