add pstate editor ui

This commit is contained in:
jussi 2019-02-16 17:52:58 +02:00
parent b0c28bd055
commit b04f95e55e
2 changed files with 62 additions and 6 deletions

View File

@ -7,6 +7,8 @@ amdPstateEditor::amdPstateEditor(QWidget *parent) :
{
ui->setupUi(this);
generateUI();
amdptr = new amd;
types = amd;
}
amdPstateEditor::~amdPstateEditor()
@ -15,12 +17,62 @@ amdPstateEditor::~amdPstateEditor()
}
void amdPstateEditor::generateUI()
{
QHBoxLayout *coreClkPstateLayout = new QHBoxLayout;
for (int i=0; i<5; i++) {
QWidget *lower = new QWidget;
QWidget *upper = new QWidget;
QHBoxLayout *ulo = new QHBoxLayout;
QHBoxLayout *llo = new QHBoxLayout;
for (int i=0; i<types->GPUList[0].coreclocks.size(); i++) {
QGridLayout *glo = new QGridLayout;
QLabel *lb = new QLabel;
QLabel *lb1 = new QLabel;
QLabel *lb2 = new QLabel;
lb->setText("mV");
lb1->setText("MHz");
lb2->setText("Core pstate "+QString::number(i));
QSlider *sl = new QSlider;
sl->setOrientation(Qt::Vertical);
coreClkPstateLayout->addWidget(sl);
QSlider *sl1 = new QSlider;
QSpinBox *sp = new QSpinBox;
QSpinBox *sp1 = new QSpinBox;
glo->addWidget(lb2);
glo->addWidget(lb1, 1, 0);
glo->addWidget(lb, 1, 1);
glo->addWidget(sl, 2, 0);
glo->addWidget(sl1, 2, 1);
glo->addWidget(sp, 3, 0);
glo->addWidget(sp1, 3, 1);
QWidget *slowdg = new QWidget;
slowdg->setLayout(glo);
llo->addWidget(slowdg);
}
ui->coreClkPstateView->setLayout(coreClkPstateLayout);
ui->memClkPstateView->setLayout(coreClkPstateLayout);
for (int i=0; i<types->GPUList[0].memclocks.size(); i++) {
QGridLayout *glo = new QGridLayout;
QLabel *lb = new QLabel;
QLabel *lb1 = new QLabel;
QLabel *lb2 = new QLabel;
lb->setText("mV");
lb1->setText("MHz");
lb2->setText("Memory pstate "+QString::number(i));
QSlider *sl = new QSlider;
QSlider *sl1 = new QSlider;
QSpinBox *sp = new QSpinBox;
QSpinBox *sp1 = new QSpinBox;
glo->addWidget(lb2);
glo->addWidget(lb1, 1, 0);
glo->addWidget(lb, 1, 1);
glo->addWidget(sl, 2, 0);
glo->addWidget(sl1, 2, 1);
glo->addWidget(sp, 3, 0);
glo->addWidget(sp1, 3, 1);
QWidget *slowdg = new QWidget;
slowdg->setLayout(glo);
ulo->addWidget(slowdg);
}
lower->setLayout(ulo);
upper->setLayout(llo);
QVBoxLayout *mainlo = new QVBoxLayout;
mainlo->addWidget(upper);
mainlo->addWidget(lower);
ui->centralWidget->setLayout(mainlo);
}

View File

@ -5,6 +5,9 @@
#include <QWidget>
#include <QSlider>
#include <QHBoxLayout>
#include <QGridLayout>
#include <QSpinBox>
#include <QLabel>
#include "gputypes.h"
namespace Ui {
@ -21,6 +24,7 @@ public:
private:
Ui::amdPstateEditor *ui;
gputypes *types;
void generateUI();
};