From 78281805928abc8847bf8392f1fcaca88ea60dca Mon Sep 17 00:00:00 2001 From: jussi Date: Fri, 15 Feb 2019 00:55:07 +0200 Subject: [PATCH] Add values to UI --- amd.cpp | 54 ++++++++++++++++++++++++++++++++++++++++++++++++++ gputypes.h | 8 ++++++++ mainwindow.cpp | 21 +++++++++++++++++++- 3 files changed, 82 insertions(+), 1 deletion(-) diff --git a/amd.cpp b/amd.cpp index e6cb4f5..ab6d62f 100644 --- a/amd.cpp +++ b/amd.cpp @@ -92,6 +92,7 @@ void amd::queryGPUFeatures() // Read the pp_od_clk_voltage file and parse output QRegularExpression numexp("\\d+\\d"); int type = 0; + int column = 0; int breakcount = 0; for (int i=0; i memvolts, corevolts, memclocks, corecloks; + int maxVoltageLimit; + int minVoltageLimit; + int maxCoreClkLimit; + int minCoreClkLimit; + int maxMemClkLimit; + int minMemClkLimit; #endif }; QVector GPUList; diff --git a/mainwindow.cpp b/mainwindow.cpp index 047ca6f..3b914c4 100644 --- a/mainwindow.cpp +++ b/mainwindow.cpp @@ -50,6 +50,7 @@ MainWindow::MainWindow(QWidget *parent) : */ // Enable sliders according to GPU properties + /* if (types->GPUList[currentGPUIndex].overClockAvailable) { ui->frequencySlider->setRange(types->GPUList[currentGPUIndex].minCoreClkOffset, types->GPUList[currentGPUIndex].maxCoreClkOffset); ui->frequencySpinBox->setRange(types->GPUList[currentGPUIndex].minCoreClkOffset, types->GPUList[currentGPUIndex].maxCoreClkOffset); @@ -99,7 +100,25 @@ MainWindow::MainWindow(QWidget *parent) : if (types->GPUList[currentGPUIndex].fanControlMode !=1) { ui->fanSlider->setDisabled(true); ui->fanSpinBox->setDisabled(true); - } + }*/ + + // Testing code + ui->voltageSlider->setRange(types->GPUList[currentGPUIndex].minVoltageLimit, types->GPUList[currentGPUIndex].maxVoltageOffset); + ui->voltageSpinBox->setRange(types->GPUList[currentGPUIndex].minVoltageLimit, types->GPUList[currentGPUIndex].maxVoltageOffset); + + ui->powerLimSlider->setRange(types->GPUList[currentGPUIndex].minPowerLim, types->GPUList[currentGPUIndex].maxPowerLim); + ui->powerLimSpinBox->setRange(types->GPUList[currentGPUIndex].minPowerLim, types->GPUList[currentGPUIndex].maxPowerLim); + + ui->frequencySpinBox->setRange(types->GPUList[currentGPUIndex].minCoreClkLimit, types->GPUList[currentGPUIndex].maxCoreClkLimit); + ui->frequencySlider->setRange(types->GPUList[currentGPUIndex].minCoreClkLimit, types->GPUList[currentGPUIndex].maxCoreClkLimit); + + ui->memClkSlider->setRange(types->GPUList[currentGPUIndex].minMemClkLimit, types->GPUList[currentGPUIndex].maxMemClkLimit); + ui->memClkSpinBox->setRange(types->GPUList[currentGPUIndex].minMemClkLimit, types->GPUList[currentGPUIndex].maxMemClkLimit); + + ui->memClkSlider->setValue(types->GPUList[currentGPUIndex].memclocks[types->GPUList[currentGPUIndex].memclocks.size()]); + ui->frequencySlider->setValue(types->GPUList[currentGPUIndex].corecloks[types->GPUList[currentGPUIndex].corecloks.size()]); + ui->powerLimSlider->setValue(types->GPUList[currentGPUIndex].powerLim); + ui->voltageSlider->setValue(types->GPUList[currentGPUIndex].corevolts[types->GPUList[currentGPUIndex].corevolts.size()]); if (!types->GPUList[currentGPUIndex].manualFanCtrlAvailable) { // If manual fan control is not available for the GPU, disable the option