diff --git a/src/CPPlot.cpp b/src/CPPlot.cpp index f3102f2c2..c0a9de633 100644 --- a/src/CPPlot.cpp +++ b/src/CPPlot.cpp @@ -411,6 +411,11 @@ CPPlot::plotModel() cpw->pmaxRank->setText(tr("n/a")); } + // Endurance Index + if (pdModel->hasWPrime() && pdModel->WPrime() && pdModel->hasCP() && pdModel->CP()) { + cpw->eiValue->setText(QString("%1").arg(pdModel->WPrime() / pdModel->CP(), 0, 'f', 0)); + } + } else { //WPrime @@ -450,6 +455,12 @@ CPPlot::plotModel() cpw->pmaxValue->setText(tr("n/a")); cpw->pmaxRank->setText(tr("n/a")); } + + // Endurance Index + if (pdModel->hasWPrime() && pdModel->WPrime() && pdModel->hasCP() && pdModel->CP()) { + cpw->eiValue->setText(QString("%1").arg(pdModel->WPrime() / pdModel->CP(), 0, 'f', 0)); + } + } } } diff --git a/src/CriticalPowerWindow.cpp b/src/CriticalPowerWindow.cpp index f2c9656cf..73a678e57 100644 --- a/src/CriticalPowerWindow.cpp +++ b/src/CriticalPowerWindow.cpp @@ -353,6 +353,8 @@ CriticalPowerWindow::CriticalPowerWindow(const QDir &home, Context *context, boo 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); // autofill titleBlank->setAutoFillBackground(true); @@ -370,6 +372,8 @@ CriticalPowerWindow::CriticalPowerWindow(const QDir &home, Context *context, boo ftpTitle->setAutoFillBackground(true); ftpValue->setAutoFillBackground(true); ftpRank->setAutoFillBackground(true); + eiTitle->setAutoFillBackground(true); + eiValue->setAutoFillBackground(true); // align all centered titleBlank->setAlignment(Qt::AlignHCenter | Qt::AlignVCenter); @@ -387,6 +391,8 @@ CriticalPowerWindow::CriticalPowerWindow(const QDir &home, Context *context, boo 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); // add to grid gridLayout->addWidget(titleBlank, 0, 0); @@ -404,6 +410,8 @@ CriticalPowerWindow::CriticalPowerWindow(const QDir &home, Context *context, boo 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); addHelper(QString(tr("CP Model")), helper); @@ -512,6 +520,8 @@ CriticalPowerWindow::configChanged() ftpTitle->setFont(font); ftpValue->setFont(font); ftpRank->setFont(font); + eiTitle->setFont(font); + eiValue->setFont(font); helper->setPalette(palette); titleBlank->setPalette(palette); @@ -529,6 +539,8 @@ CriticalPowerWindow::configChanged() ftpTitle->setPalette(palette); ftpValue->setPalette(whitepalette); ftpRank->setPalette(whitepalette); + eiTitle->setPalette(palette); + eiValue->setPalette(whitepalette); QPen gridPen(GColor(CPLOTGRID)); grid->setPen(gridPen); diff --git a/src/CriticalPowerWindow.h b/src/CriticalPowerWindow.h index 1d190c27f..8a83ce3e0 100644 --- a/src/CriticalPowerWindow.h +++ b/src/CriticalPowerWindow.h @@ -287,6 +287,7 @@ class CriticalPowerWindow : public GcChartWindow QLabel *cpTitle, *cpValue, *cpRank; QLabel *ftpTitle, *ftpValue, *ftpRank; QLabel *pmaxTitle, *pmaxValue, *pmaxRank; + QLabel *eiTitle, *eiValue; void addSeries(); Seasons *seasons; diff --git a/src/GcOverlayWidget.cpp b/src/GcOverlayWidget.cpp index dd59ff136..7ba8a5477 100644 --- a/src/GcOverlayWidget.cpp +++ b/src/GcOverlayWidget.cpp @@ -38,7 +38,7 @@ GcOverlayWidget::GcOverlayWidget(Context *context, QWidget *parent) : QWidget(pa setAttribute(Qt::WA_TranslucentBackground); setMouseTracking(true); setFocusPolicy(Qt::ClickFocus); - setMinimumSize(200,200); + setMinimumSize(250,200); setFocus(); mode = none; initial = true;