Skip to content

Commit

Permalink
fixed overclocking saving parameters
Browse files Browse the repository at this point in the history
  • Loading branch information
orkblutt committed Sep 12, 2017
1 parent ce8616c commit c77df83
Show file tree
Hide file tree
Showing 2 changed files with 24 additions and 16 deletions.
6 changes: 3 additions & 3 deletions mainwindow.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -179,9 +179,9 @@ void MainWindow::applyOC()
for(unsigned int i = 0; i < _nvapi->getGPUCount(); i++)
{
_nvapi->setPowerLimitPercent(i, _settings->value(QString("powerlimitoffset" + QString::number(i))).toInt());
_nvapi->setPowerLimitPercent(i, _settings->value(QString("gpuoffset" + QString::number(i))).toInt());
_nvapi->setPowerLimitPercent(i, _settings->value(QString("memoffset" + QString::number(i))).toInt());
_nvapi->setPowerLimitPercent(i, _settings->value(QString("fanspeed" + QString::number(i))).toInt());
_nvapi->setGPUOffset(i, _settings->value(QString("gpuoffset" + QString::number(i))).toInt());
_nvapi->setMemClockOffset(i, _settings->value(QString("memoffset" + QString::number(i))).toInt());
_nvapi->setFanSpeed(i, _settings->value(QString("fanspeed" + QString::number(i))).toInt());
}
}
_settings->endGroup();
Expand Down
34 changes: 21 additions & 13 deletions nvocdialog.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -73,10 +73,10 @@ void nvOCDialog::on_comboBoxDevice_activated(int index)

void nvOCDialog::updateSliders(unsigned int gpu)
{
int plimit = _nvapi->getPowerLimit(gpu);
int gpuoffset = _nvapi->getGPUOffset(gpu);
int memoffset = _nvapi->getMemOffset(gpu);
int fanspeed = _nvapi->getFanSpeed(gpu);
int plimit = _nvapi->getPowerLimit(gpu);
int gpuoffset = _nvapi->getGPUOffset(gpu);
int memoffset = _nvapi->getMemOffset(gpu);
int fanspeed = _nvapi->getFanSpeed(gpu);

ui->horizontalSliderPowerPercent->setValue(plimit);
ui->horizontalSliderGpuOffset->setValue(gpuoffset);
Expand All @@ -86,19 +86,29 @@ void nvOCDialog::updateSliders(unsigned int gpu)

void nvOCDialog::saveConfig()
{
_settings->beginGroup("nvoc");
int deviceIndex = ui->comboBoxDevice->currentIndex();

_settings->beginGroup("nvoc");
_settings->setValue("nvoc_applyall", ui->checkBoxAllDevices->isChecked());
_settings->setValue("nvoc_applyonstart", ui->checkBoxOCMinerStart->isChecked());

for(int i = 0; i < _cardList.size(); i++)
if(ui->checkBoxAllDevices->isChecked())
{
_settings->setValue(QString("powerlimitoffset" + QString::number(i)), _cardList.at(i).powerOffset);
_settings->setValue(QString("gpuoffset" + QString::number(i)), _cardList.at(i).gpuOffset);
_settings->setValue(QString("memoffset" + QString::number(i)), _cardList.at(i).memOffset);
_settings->setValue(QString("fanspeed" + QString::number(i)), _cardList.at(i).fanSpeed);
for(int i = 0; i < _cardList.size(); i++)
{
_settings->setValue(QString("powerlimitoffset" + QString::number(i)), _cardList.at(deviceIndex).powerOffset);
_settings->setValue(QString("gpuoffset" + QString::number(i)), _cardList.at(deviceIndex).gpuOffset);
_settings->setValue(QString("memoffset" + QString::number(i)), _cardList.at(deviceIndex).memOffset);
_settings->setValue(QString("fanspeed" + QString::number(i)), _cardList.at(deviceIndex).fanSpeed);
}
}
else
{
_settings->setValue(QString("powerlimitoffset" + QString::number(deviceIndex)), _cardList.at(deviceIndex).powerOffset);
_settings->setValue(QString("gpuoffset" + QString::number(deviceIndex)), _cardList.at(deviceIndex).gpuOffset);
_settings->setValue(QString("memoffset" + QString::number(deviceIndex)), _cardList.at(deviceIndex).memOffset);
_settings->setValue(QString("fanspeed" + QString::number(deviceIndex)), _cardList.at(deviceIndex).fanSpeed);
}

_settings->endGroup();
}

Expand All @@ -125,13 +135,11 @@ void nvOCDialog::on_buttonBox_clicked(QAbstractButton *button)
_nvapi->setMemClockOffset(gpu, ui->horizontalSliderMemOffset->value());
_nvapi->setFanSpeed(gpu, ui->horizontalSliderFanSpeed->value());
}

saveConfig();
}
}



void nvOCDialog::on_checkBoxAutoSpeedFan_clicked(bool checked)
{
if(checked)
Expand Down

0 comments on commit c77df83

Please sign in to comment.