This commit is contained in:
jussi 2018-12-22 22:30:14 +02:00
parent 68072b25d4
commit df6dd60db4
4 changed files with 95 additions and 67 deletions

View File

@ -52,7 +52,6 @@ editProfile::editProfile(QWidget *parent) :
} }
ui->curvePlot->graph(0)->setData(qv_x, qv_y); ui->curvePlot->graph(0)->setData(qv_x, qv_y);
drawFillerLines(); drawFillerLines();
} }
editProfile::~editProfile() editProfile::~editProfile()
@ -273,12 +272,9 @@ void editProfile::drawCoordtext()
QString xString = QString::number(qv_x[index_x]); QString xString = QString::number(qv_x[index_x]);
QString yString = QString::number(qv_y[index_y]); QString yString = QString::number(qv_y[index_y]);
coordText->setText(xString + ", " + yString); coordText->setText(xString + ", " + yString);
}
if (!draggingPoint) { } else {
ui->curvePlot->clearItems(); ui->curvePlot->removeItem(coordText);
coordText->position->setCoords(100, 100);
coordText->setText("");
} }
} }
@ -309,7 +305,7 @@ bool editProfile::detectRelease(QMouseEvent *event)
resetMouseDragging(); resetMouseDragging();
draggedIndicesUnset(); draggedIndicesUnset();
draggingPointUnset(); draggingPointUnset();
//drawCoordtext(index_x, index_y); drawCoordtext();
return mousePressed; return mousePressed;
} }
@ -357,8 +353,8 @@ double editProfile::getPixelLength(QMouseEvent *event)
void editProfile::on_pushButton_clicked() void editProfile::on_pushButton_clicked()
{ {
ui->curvePlot->clearItems(); qDebug() << draggingPoint;
qDebug() << index_x << index_y; drawCoordtext();
} }
void editProfile::on_saveButton_clicked() void editProfile::on_saveButton_clicked()

View File

@ -73,7 +73,8 @@ void MainWindow::on_pushButton_clicked()
//loadProfileSettings(); //loadProfileSettings();
// checkForProfiles(); // checkForProfiles();
//getGPUDriver(); //getGPUDriver();
checkForRoot(); //checkForRoot();
qDebug() << minMemClkOfsInt << maxMemClkOfsInt;
} }
void MainWindow::checkForRoot() void MainWindow::checkForRoot()
@ -155,7 +156,6 @@ void MainWindow::fanSpeedUpdater()
fanSpeed = process.readLine().toInt(); fanSpeed = process.readLine().toInt();
ui->fanSlider->setValue(fanSpeed); ui->fanSlider->setValue(fanSpeed);
ui->fanSpinBox->setValue(fanSpeed); ui->fanSpinBox->setValue(fanSpeed);
} }
void MainWindow::tempUpdater() void MainWindow::tempUpdater()
{ {
@ -216,14 +216,13 @@ void MainWindow::queryGPUSettings()
maxVoltOfsInt = process.readLine().toInt()/1000; maxVoltOfsInt = process.readLine().toInt()/1000;
} }
} }
qDebug() << "maxvolt on" << maxVoltOfsInt;
QString coreFreqOfs; QString coreFreqOfs;
process.start(nvCoreClkOfsQ); process.start(nvCoreClkOfsQ);
process.waitForFinished(-1); process.waitForFinished(-1);
coreFreqOfs = process.readLine(); //coreFreqOfs = process.readLine();
coreFreqOfs.chop(1); //coreFreqOfs.chop(1);
coreFreqOfsInt = coreFreqOfs.toInt(); coreFreqOfsInt = process.readLine().toInt();
latestClkOfs = coreFreqOfsInt; latestClkOfs = coreFreqOfsInt;
process.start(nvCurMaxClkQ); process.start(nvCurMaxClkQ);
@ -246,26 +245,27 @@ void MainWindow::queryGPUSettings()
process.start(nvClockLimQ); process.start(nvClockLimQ);
process.waitForFinished(-1); process.waitForFinished(-1);
for (int i=0; i<2; i++) { for (int i=0; i<process.size(); i++) {
QString line = process.readLine(); QString line = process.readLine();
if (line.contains("-")) { if (line.toInt()/2 > maxCoreClkOfsInt) {
minCoreClkOfsInt = line.toInt(); maxCoreClkOfsInt = line.toInt()/2;
} else { }
maxCoreClkOfsInt = line.toInt(); if (line.toInt()/2 <= minCoreClkOfsInt) {
minCoreClkOfsInt = line.toInt()/2;
} }
} }
qDebug() << minCoreClkOfsInt << maxCoreClkOfsInt;
// This gets the transfer rate, the clock speed is rate/2 // This gets the transfer rate, the clock speed is rate/2
process.start(nvMemClkLimQ); process.start(nvMemClkLimQ);
process.waitForFinished(-1); process.waitForFinished(-1);
for (int i=0; i<2; i++) { for (int i=0; i<process.size(); i++) {
QString line = process.readLine(); QString line = process.readLine();
if (line.contains("-")) { if (line.toInt()/2 > maxMemClkOfsInt) {
minMemClkOfsInt = line.toInt()/2;
} else {
maxMemClkOfsInt = line.toInt()/2; maxMemClkOfsInt = line.toInt()/2;
} }
if (line.toInt()/2 <= minMemClkOfsInt) {
minMemClkOfsInt = line.toInt()/2;
}
} }
process.start(nvCurMaxMemClkQ); process.start(nvCurMaxMemClkQ);
@ -489,3 +489,8 @@ void MainWindow::on_applyButton_clicked()
{ {
applyGPUSettings(); applyGPUSettings();
} }
void MainWindow::on_fanModeComboBox_currentTextChanged(const QString &arg1)
{
}

View File

@ -59,8 +59,8 @@ public:
int minCoreClkOfsInt; int minCoreClkOfsInt;
int maxCoreClkOfsInt; int maxCoreClkOfsInt;
int curMaxClkInt; int curMaxClkInt;
int minMemClkOfsInt; int minMemClkOfsInt = 0;
int maxMemClkOfsInt; int maxMemClkOfsInt = 0;
int minVoltOfsInt = 0; int minVoltOfsInt = 0;
int maxVoltOfsInt = 0; int maxVoltOfsInt = 0;
int curMaxMemClkInt; int curMaxMemClkInt;
@ -124,6 +124,8 @@ private slots:
void enableFanControl(); void enableFanControl();
void resetChanges(); void resetChanges();
void resetTimer(); void resetTimer();
void on_fanModeComboBox_currentTextChanged(const QString &arg1);
private: private:
Ui::MainWindow *ui; Ui::MainWindow *ui;
bool noProfiles = true; bool noProfiles = true;
@ -131,5 +133,4 @@ private:
QTimer *resettimer = new QTimer(this); QTimer *resettimer = new QTimer(this);
}; };
#endif // MAINWINDOW_H #endif // MAINWINDOW_H

View File

@ -6,8 +6,8 @@
<rect> <rect>
<x>0</x> <x>0</x>
<y>0</y> <y>0</y>
<width>384</width> <width>440</width>
<height>590</height> <height>670</height>
</rect> </rect>
</property> </property>
<property name="windowTitle"> <property name="windowTitle">
@ -22,37 +22,23 @@
</property> </property>
</widget> </widget>
</item> </item>
<item row="1" column="0" colspan="2"> <item row="1" column="0">
<widget class="QLabel" name="label"> <widget class="QLabel" name="label">
<property name="text"> <property name="text">
<string>Fan Speed (%)</string> <string>Fan Speed (%)</string>
</property> </property>
</widget> </widget>
</item> </item>
<item row="2" column="0" colspan="3">
<widget class="QSlider" name="fanSlider">
<property name="orientation">
<enum>Qt::Horizontal</enum>
</property>
</widget>
</item>
<item row="2" column="3"> <item row="2" column="3">
<widget class="QSpinBox" name="fanSpinBox"/> <widget class="QSpinBox" name="fanSpinBox"/>
</item> </item>
<item row="3" column="0" colspan="2"> <item row="3" column="0">
<widget class="QLabel" name="voltgeLabel"> <widget class="QLabel" name="voltgeLabel">
<property name="text"> <property name="text">
<string>Voltage (mV)</string> <string>Voltage (mV)</string>
</property> </property>
</widget> </widget>
</item> </item>
<item row="4" column="0" colspan="3">
<widget class="QSlider" name="voltageSlider">
<property name="orientation">
<enum>Qt::Horizontal</enum>
</property>
</widget>
</item>
<item row="4" column="3"> <item row="4" column="3">
<widget class="QSpinBox" name="voltageSpinBox"/> <widget class="QSpinBox" name="voltageSpinBox"/>
</item> </item>
@ -63,13 +49,6 @@
</property> </property>
</widget> </widget>
</item> </item>
<item row="6" column="0" colspan="3">
<widget class="QSlider" name="memClkSlider">
<property name="orientation">
<enum>Qt::Horizontal</enum>
</property>
</widget>
</item>
<item row="6" column="3"> <item row="6" column="3">
<widget class="QSpinBox" name="memClkSpinBox"/> <widget class="QSpinBox" name="memClkSpinBox"/>
</item> </item>
@ -80,13 +59,6 @@
</property> </property>
</widget> </widget>
</item> </item>
<item row="8" column="0" colspan="3">
<widget class="QSlider" name="powerLimSlider">
<property name="orientation">
<enum>Qt::Horizontal</enum>
</property>
</widget>
</item>
<item row="8" column="3"> <item row="8" column="3">
<widget class="QSpinBox" name="powerLimSpinBox"/> <widget class="QSpinBox" name="powerLimSpinBox"/>
</item> </item>
@ -97,6 +69,35 @@
</property> </property>
</widget> </widget>
</item> </item>
<item row="10" column="3">
<widget class="QSpinBox" name="frequencySpinBox"/>
</item>
<item row="0" column="1">
<widget class="QLabel" name="fanModeLabel">
<property name="text">
<string>Fan mode:</string>
</property>
</widget>
</item>
<item row="0" column="2">
<widget class="QComboBox" name="fanModeComboBox">
<item>
<property name="text">
<string>Driver defined</string>
</property>
</item>
<item>
<property name="text">
<string>Static</string>
</property>
</item>
<item>
<property name="text">
<string>Custom</string>
</property>
</item>
</widget>
</item>
<item row="10" column="0" colspan="3"> <item row="10" column="0" colspan="3">
<widget class="QSlider" name="frequencySlider"> <widget class="QSlider" name="frequencySlider">
<property name="orientation"> <property name="orientation">
@ -104,26 +105,51 @@
</property> </property>
</widget> </widget>
</item> </item>
<item row="10" column="3"> <item row="11" column="0">
<widget class="QSpinBox" name="frequencySpinBox"/>
</item>
<item row="11" column="1">
<widget class="QPushButton" name="applyButton"> <widget class="QPushButton" name="applyButton">
<property name="text"> <property name="text">
<string>Apply changes</string> <string>Apply changes</string>
</property> </property>
</widget> </widget>
</item> </item>
<item row="11" column="2"> <item row="11" column="1">
<widget class="QPushButton" name="newProfile"> <widget class="QPushButton" name="newProfile">
<property name="text"> <property name="text">
<string>...</string> <string>...</string>
</property> </property>
</widget> </widget>
</item> </item>
<item row="11" column="3"> <item row="11" column="2">
<widget class="QComboBox" name="profileComboBox"/> <widget class="QComboBox" name="profileComboBox"/>
</item> </item>
<item row="4" column="0" colspan="3">
<widget class="QSlider" name="voltageSlider">
<property name="orientation">
<enum>Qt::Horizontal</enum>
</property>
</widget>
</item>
<item row="2" column="0" colspan="3">
<widget class="QSlider" name="fanSlider">
<property name="orientation">
<enum>Qt::Horizontal</enum>
</property>
</widget>
</item>
<item row="6" column="0" colspan="3">
<widget class="QSlider" name="memClkSlider">
<property name="orientation">
<enum>Qt::Horizontal</enum>
</property>
</widget>
</item>
<item row="8" column="0" colspan="3">
<widget class="QSlider" name="powerLimSlider">
<property name="orientation">
<enum>Qt::Horizontal</enum>
</property>
</widget>
</item>
</layout> </layout>
</widget> </widget>
<widget class="QMenuBar" name="menuBar"> <widget class="QMenuBar" name="menuBar">
@ -131,7 +157,7 @@
<rect> <rect>
<x>0</x> <x>0</x>
<y>0</y> <y>0</y>
<width>384</width> <width>440</width>
<height>28</height> <height>28</height>
</rect> </rect>
</property> </property>