mirror of
https://github.com/GoldenCheetah/GoldenCheetah.git
synced 2026-02-13 16:18:42 +00:00
Add Endurance Index to CP overlay
.. for power and w/kg
This commit is contained in:
@@ -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));
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -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);
|
||||
|
||||
@@ -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;
|
||||
|
||||
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user