From 1a87afaaba0ba8eb99a6e27b1aa4e2f37ccf3355 Mon Sep 17 00:00:00 2001 From: Stelios Tsampas Date: Fri, 15 Sep 2017 14:12:14 +0300 Subject: [PATCH] Add frequency reports in status * Qutefan - Add GPU frequency in status groupbox * QNvAPI - Replace C-style casting - Replace GPU_GetAllClockFrequencies with GPU_GetAllClocks * GpuTab - Add overclocking widgets but hide them as they do nothing now --- platforms/qnvapi/qnvapi.cpp | 64 ++-- platforms/qnvapi/qnvapi.h | 42 ++- qutefan/gputab.cpp | 31 +- qutefan/gputab.h | 3 +- qutefan/gputab.ui | 686 ++++++++++++++++++++++++++---------- qutefan/main.cpp | 4 +- qutefan/qutefan.cpp | 8 +- qutefan/qutefantrayicon.cpp | 7 + qutefan/qutefantrayicon.h | 1 + 9 files changed, 605 insertions(+), 241 deletions(-) diff --git a/platforms/qnvapi/qnvapi.cpp b/platforms/qnvapi/qnvapi.cpp index a298d8c..44d4376 100644 --- a/platforms/qnvapi/qnvapi.cpp +++ b/platforms/qnvapi/qnvapi.cpp @@ -1,6 +1,6 @@ #include "qnvapi.h" -QMutex* nvapi_lock = new QMutex(QMutex::Recursive); +static QMutex* nvapi_lock = new QMutex(QMutex::Recursive); QNvAPI::QNvAPI() : QLibrary("nvapi"), @@ -17,7 +17,7 @@ QNvAPI::QNvAPI() nvapi_GPU_GetFullName(NULL), nvapi_GPU_GetEDID(NULL), nvapi_GPU_GetTachReading(NULL), - nvapi_GPU_GetAllClockFrequencies(NULL), + nvapi_GPU_GetAllClocks(NULL), nvapi_GPU_GetPstates20(NULL), nvapi_GPU_GetMemoryInfo(NULL), nvapi_GPU_GetPCIIdentifiers(NULL), @@ -27,36 +27,36 @@ QNvAPI::QNvAPI() { QMutexLocker locker(nvapi_lock); - nvapi_QueryInterface = (QNVAPI_QUERYINTERFACE)resolve("nvapi_QueryInterface"); + nvapi_QueryInterface = reinterpret_cast(resolve("nvapi_QueryInterface")); if(!nvapi_QueryInterface) { status = NVAPI_LIBRARY_NOT_FOUND; qDebug("QNvAPI failed to initialize NvAPI_QueryInterface()"); } else { - nvapi_Initialize = (QNVAPI_INITIALIZE) nvapi_QueryInterface(0x0150E828); - - nvapi_EnumNvidiaDisplayHandle = (QNVAPI_ENUMNVIDIADISPLAYHANDLE) nvapi_QueryInterface(0x9ABDD40D); - nvapi_EnumPhysicalGPUs = (QNVAPI_ENUMPHYSICALGPUS) nvapi_QueryInterface(0xE5AC921F); - - nvapi_GetInterfaceVersionString = (QNVAPI_GETINTERFACEVERSIONSTRING) nvapi_QueryInterface(0x01053FA5); - nvapi_GetDisplayDriverVersion = (QNVAPI_GETDISPLAYDRIVERVERSION) nvapi_QueryInterface(0xF951A4D1); - nvapi_GetPhysicalGPUsFromDisplay = (QNVAPI_GETPHYSICALGPUSFROMDISPLAY) nvapi_QueryInterface(0x34EF9506); - nvapi_GetAssociatedNvidiaDisplayHandle = (QNVAPI_GETASSOCIATEDNVIDIADISPLAYHANDLE) nvapi_QueryInterface(0x35C29134); - nvapi_GetAssociatedDisplayOutputId = (QNVAPI_GETASSOCIATEDDISPLAYOUTPUTID) nvapi_QueryInterface(0xD995937E); - - nvapi_GPU_GetThermalSettings = (QNVAPI_GPU_GETTHERMALSETTINGS) nvapi_QueryInterface(0xE3640A56); - nvapi_GPU_GetFullName = (QNVAPI_GPU_GETFULLNAME) nvapi_QueryInterface(0xCEEE8E9F); - nvapi_GPU_GetEDID = (QNVAPI_GPU_GETEDID) nvapi_QueryInterface(0x37D32E69); - nvapi_GPU_GetTachReading = (QNVAPI_GPU_GETTACHREADING) nvapi_QueryInterface(0x5F608315); - nvapi_GPU_GetAllClockFrequencies = (QNVAPI_GPU_GETALLCLOCKFREQUENCIES) nvapi_QueryInterface(0x1BD69F49); - nvapi_GPU_GetPstates20 = (QNVAPI_GPU_GETPSTATES20) nvapi_QueryInterface(0x60DED2ED); - nvapi_GPU_GetMemoryInfo = (QNVAPI_GPU_GETMEMORYINFO) nvapi_QueryInterface(0x774AA982); - nvapi_GPU_GetPCIIdentifiers = (QNVAPI_GPU_GETPCIIDENTIFIERS) nvapi_QueryInterface(0x2DDFB66E); - - nvapi_GPU_GetUsages = (QNVAPI_GPU_GETUSAGES) nvapi_QueryInterface(0x189A1FDF); - nvapi_GPU_GetCoolerSettings = (QNVAPI_GPU_GETCOOLERSETTINGS) nvapi_QueryInterface(0xDA141340); - - nvapi_GPU_SetCoolerLevels = (QNVAPI_GPU_SETCOOLERLEVELS) nvapi_QueryInterface(0x891FA0AE); + nvapi_Initialize = reinterpret_cast (nvapi_QueryInterface(0x0150E828)); + + nvapi_EnumNvidiaDisplayHandle = reinterpret_cast (nvapi_QueryInterface(0x9ABDD40D)); + nvapi_EnumPhysicalGPUs = reinterpret_cast (nvapi_QueryInterface(0xE5AC921F)); + + nvapi_GetInterfaceVersionString = reinterpret_cast (nvapi_QueryInterface(0x01053FA5)); + nvapi_GetDisplayDriverVersion = reinterpret_cast (nvapi_QueryInterface(0xF951A4D1)); + nvapi_GetPhysicalGPUsFromDisplay = reinterpret_cast (nvapi_QueryInterface(0x34EF9506)); + nvapi_GetAssociatedNvidiaDisplayHandle = reinterpret_cast (nvapi_QueryInterface(0x35C29134)); + nvapi_GetAssociatedDisplayOutputId = reinterpret_cast (nvapi_QueryInterface(0xD995937E)); + + nvapi_GPU_GetThermalSettings = reinterpret_cast (nvapi_QueryInterface(0xE3640A56)); + nvapi_GPU_GetFullName = reinterpret_cast (nvapi_QueryInterface(0xCEEE8E9F)); + nvapi_GPU_GetEDID = reinterpret_cast (nvapi_QueryInterface(0x37D32E69)); + nvapi_GPU_GetTachReading = reinterpret_cast (nvapi_QueryInterface(0x5F608315)); + nvapi_GPU_GetAllClocks = reinterpret_cast (nvapi_QueryInterface(0x1BD69F49)); + nvapi_GPU_GetPstates20 = reinterpret_cast (nvapi_QueryInterface(0x60DED2ED)); + nvapi_GPU_GetMemoryInfo = reinterpret_cast (nvapi_QueryInterface(0x774AA982)); + nvapi_GPU_GetPCIIdentifiers = reinterpret_cast (nvapi_QueryInterface(0x2DDFB66E)); + + nvapi_GPU_GetUsages = reinterpret_cast (nvapi_QueryInterface(0x189A1FDF)); + nvapi_GPU_GetCoolerSettings = reinterpret_cast (nvapi_QueryInterface(0xDA141340)); + + nvapi_GPU_SetCoolerLevels = reinterpret_cast (nvapi_QueryInterface(0x891FA0AE)); } } @@ -168,12 +168,12 @@ NvAPI_Status QNvAPI::GPU_GetTachReading(NvPhysicalGpuHandle hPhysicalGpu, NvU32* return status; } -NvAPI_Status QNvAPI::GPU_GetAllClockFrequencies(__in NvPhysicalGpuHandle hPhysicalGpu, __inout NV_GPU_CLOCK_FREQUENCIES* pClkFreqs) +NvAPI_Status QNvAPI::GPU_GetAllClocks(__in NvPhysicalGpuHandle hPhysicalGpu, __inout NV_GPU_CLOCKS* pClkFreqs) { - pClkFreqs->version = NV_GPU_CLOCK_FREQUENCIES_VER; - status = nvapi_GPU_GetAllClockFrequencies(hPhysicalGpu, pClkFreqs); + pClkFreqs->version = NV_GPU_CLOCKS_VER; + status = nvapi_GPU_GetAllClocks(hPhysicalGpu, pClkFreqs); if(status != NVAPI_OK) - qDebug("NvAPI_GPU_GetAllClockFrequencies() failed with status %d", status); + qDebug("NvAPI_GPU_GetAllClocks() failed with status %d", status); return status; } @@ -245,7 +245,7 @@ bool QNvAPI::isAvailable(void) nvapi_GPU_GetFullName && nvapi_GPU_GetEDID && nvapi_GPU_GetTachReading && - nvapi_GPU_GetAllClockFrequencies && + nvapi_GPU_GetAllClocks && nvapi_GPU_GetPstates20 && nvapi_GPU_GetMemoryInfo && nvapi_GPU_GetPCIIdentifiers && diff --git a/platforms/qnvapi/qnvapi.h b/platforms/qnvapi/qnvapi.h index 3c4eda4..957c014 100644 --- a/platforms/qnvapi/qnvapi.h +++ b/platforms/qnvapi/qnvapi.h @@ -15,24 +15,17 @@ * */ -#define NVAPI_MAX_COOLERS_PER_GPU 20 #define NVAPI_MAX_USAGES_PER_GPU 33 - -#define NV_GPU_USAGES_VER_1 MAKE_NVAPI_VERSION(NV_GPU_USAGES_V1,1) -#define NV_GPU_USAGES_VER NV_GPU_USAGES_VER_1 - -#define NV_GPU_COOLER_SETTINGS_VER_2 MAKE_NVAPI_VERSION(NV_GPU_COOLER_SETTINGS_V2,2) -#define NV_GPU_COOLER_SETTINGS_VER NV_GPU_COOLER_SETTINGS_VER_2 - -#define NV_GPU_COOLER_LEVELS_VER_1 MAKE_NVAPI_VERSION(NV_GPU_COOLER_LEVELS_V1,1) -#define NV_GPU_COOLER_LEVELS_VER NV_GPU_COOLER_LEVELS_VER_1 - typedef struct { NvU32 version; NvU32 usage[NVAPI_MAX_USAGES_PER_GPU]; } NV_GPU_USAGES_V1; +#define NV_GPU_USAGES_VER_1 MAKE_NVAPI_VERSION(NV_GPU_USAGES_V1,1) typedef NV_GPU_USAGES_V1 NV_GPU_USAGES; +#define NV_GPU_USAGES_VER NV_GPU_USAGES_VER_1 + +#define NVAPI_MAX_COOLERS_PER_GPU 20 typedef struct { NvU32 version; NvU32 count; @@ -51,7 +44,10 @@ typedef struct { NvS32 active; } cooler[NVAPI_MAX_COOLERS_PER_GPU]; } NV_GPU_COOLER_SETTINGS_V2; -typedef NV_GPU_COOLER_SETTINGS_V2 NV_GPU_COOLER_SETTINGS; +#define NV_GPU_COOLER_SETTINGS_VER_2 MAKE_NVAPI_VERSION(NV_GPU_COOLER_SETTINGS_V2,2) +typedef NV_GPU_COOLER_SETTINGS_V2 NV_GPU_COOLER_SETTINGS; +#define NV_GPU_COOLER_SETTINGS_VER NV_GPU_COOLER_SETTINGS_VER_2 + typedef struct { NvU32 version; @@ -60,14 +56,25 @@ typedef struct { NvS32 policy; } cooler[NVAPI_MAX_COOLERS_PER_GPU]; } NV_GPU_COOLER_LEVELS_V1; -typedef NV_GPU_COOLER_LEVELS_V1 NV_GPU_COOLER_LEVELS; +#define NV_GPU_COOLER_LEVELS_VER_1 MAKE_NVAPI_VERSION(NV_GPU_COOLER_LEVELS_V1,1) +typedef NV_GPU_COOLER_LEVELS_V1 NV_GPU_COOLER_LEVELS; +#define NV_GPU_COOLER_LEVELS_VER NV_GPU_COOLER_LEVELS_VER_1 + + +typedef struct { + NvU32 version; + NvU32 clock[NVAPI_MAX_GPU_CLOCKS * 9]; +} NV_GPU_CLOCKS_V2; +#define NV_GPU_CLOCKS_VER_2 MAKE_NVAPI_VERSION(NV_GPU_CLOCKS_V2,2) +typedef NV_GPU_CLOCKS_V2 NV_GPU_CLOCKS; +#define NV_GPU_CLOCKS_VER NV_GPU_CLOCKS_VER_2 class QNvAPI : public QLibrary { public: -#pragma warning(disable : 4351) +//#pragma warning(disable : 4351) NvAPI_Status status = NVAPI_OK; NvAPI_ShortString version = {}; @@ -85,6 +92,7 @@ class QNvAPI : public QLibrary NV_GPU_THERMAL_SETTINGS thermalSettings; NV_GPU_COOLER_SETTINGS coolerSettings; NV_GPU_COOLER_LEVELS coolerLevels; + NV_GPU_CLOCKS clocks; } NvGPU; NvGPU gpu[NVAPI_MAX_PHYSICAL_GPUS] = {}; @@ -106,7 +114,7 @@ class QNvAPI : public QLibrary NvAPI_Status GPU_GetFullName(NvPhysicalGpuHandle, NvAPI_ShortString); NvAPI_Status GPU_GetEDID(NvPhysicalGpuHandle, NvU32, NV_EDID*); NvAPI_Status GPU_GetTachReading(NvPhysicalGpuHandle, NvU32*); - NvAPI_Status GPU_GetAllClockFrequencies(NvPhysicalGpuHandle, NV_GPU_CLOCK_FREQUENCIES*); + NvAPI_Status GPU_GetAllClocks(NvPhysicalGpuHandle, NV_GPU_CLOCKS*); NvAPI_Status GPU_GetPstates20(NvPhysicalGpuHandle, NV_GPU_PERF_PSTATES20_INFO*); NvAPI_Status GPU_GetMemoryInfo(NvPhysicalGpuHandle, NV_DISPLAY_DRIVER_MEMORY_INFO*); NvAPI_Status GPU_GetPCIIdentifiers(NvPhysicalGpuHandle, NvU32*, NvU32*, NvU32*, NvU32*); @@ -135,7 +143,7 @@ class QNvAPI : public QLibrary typedef NvAPI_Status (__cdecl * QNVAPI_GPU_GETFULLNAME) (NvPhysicalGpuHandle, NvAPI_ShortString); typedef NvAPI_Status (__cdecl * QNVAPI_GPU_GETEDID) (NvPhysicalGpuHandle, NvU32, NV_EDID*); typedef NvAPI_Status (__cdecl * QNVAPI_GPU_GETTACHREADING) (NvPhysicalGpuHandle, NvU32*); - typedef NvAPI_Status (__cdecl * QNVAPI_GPU_GETALLCLOCKFREQUENCIES) (NvPhysicalGpuHandle, NV_GPU_CLOCK_FREQUENCIES*); + typedef NvAPI_Status (__cdecl * QNVAPI_GPU_GETALLCLOCKS) (NvPhysicalGpuHandle, NV_GPU_CLOCKS*); typedef NvAPI_Status (__cdecl * QNVAPI_GPU_GETPSTATES20) (NvPhysicalGpuHandle, NV_GPU_PERF_PSTATES20_INFO*); typedef NvAPI_Status (__cdecl * QNVAPI_GPU_GETMEMORYINFO) (NvPhysicalGpuHandle, NV_DISPLAY_DRIVER_MEMORY_INFO*); typedef NvAPI_Status (__cdecl * QNVAPI_GPU_GETPCIIDENTIFIERS) (NvPhysicalGpuHandle, NvU32*, NvU32*, NvU32*, NvU32*); @@ -161,7 +169,7 @@ class QNvAPI : public QLibrary QNVAPI_GPU_GETFULLNAME nvapi_GPU_GetFullName; QNVAPI_GPU_GETEDID nvapi_GPU_GetEDID; QNVAPI_GPU_GETTACHREADING nvapi_GPU_GetTachReading; - QNVAPI_GPU_GETALLCLOCKFREQUENCIES nvapi_GPU_GetAllClockFrequencies; + QNVAPI_GPU_GETALLCLOCKS nvapi_GPU_GetAllClocks; QNVAPI_GPU_GETPSTATES20 nvapi_GPU_GetPstates20; QNVAPI_GPU_GETMEMORYINFO nvapi_GPU_GetMemoryInfo; QNVAPI_GPU_GETPCIIDENTIFIERS nvapi_GPU_GetPCIIdentifiers; diff --git a/qutefan/gputab.cpp b/qutefan/gputab.cpp index 8266275..4096d3e 100644 --- a/qutefan/gputab.cpp +++ b/qutefan/gputab.cpp @@ -17,6 +17,11 @@ GpuTab::GpuTab(QWidget* parent) : GpuTab::GpuTab(QNvAPI* api, QNvAPI::NvGPU* gpu, QWidget* parent) : GpuTab(parent) { + // Hide unfinished UI elements + ui->groupBoxOverclock->hide(); + ui->radioButtonGraph->hide(); + ui->pushButtonGraph->hide(); + mode = AccessMode::nvapi; nvapi = api; @@ -60,8 +65,8 @@ void GpuTab::regulateFan() nvgpu->status = nvapi->GPU_GetThermalSettings(nvgpu->handle, 0, &nvgpu->thermalSettings); if(nvMaxTemp < nvgpu->thermalSettings.sensor[0].currentTemp) nvMaxTemp = nvgpu->thermalSettings.sensor[0].currentTemp; - ui->labelTempValue->setText(QString("%1°C").arg(nvgpu->thermalSettings.sensor[0].currentTemp)); - ui->labelTempMax->setText(QString("%1°C").arg(nvMaxTemp)); + ui->labelStatusTempCur->setText(QString("%1°C").arg(nvgpu->thermalSettings.sensor[0].currentTemp)); + ui->labelStatusTempMax->setText(QString("%1°C").arg(nvMaxTemp)); GpuTab::FanMode mode = getMode(); @@ -72,6 +77,8 @@ void GpuTab::regulateFan() NV_GPU_COOLER_LEVELS newCoolerLevels; newCoolerLevels.cooler[0].policy = 1; switch(mode) { + case GpuTab::FanMode::Off: + break; case GpuTab::FanMode::Quiet: newCoolerLevels.cooler[0].level = nvgpu->coolerSettings.cooler[0].defaultMin; break; @@ -90,8 +97,20 @@ void GpuTab::regulateFan() nvgpu->status = nvapi->GPU_GetCoolerSettings(nvgpu->handle, 0, &nvgpu->coolerSettings); - if(nvMaxLevel < nvgpu->coolerSettings.cooler[0].currentLevel) - nvMaxLevel = nvgpu->coolerSettings.cooler[0].currentLevel; - ui->labelLevelValue->setText(QString("%1%").arg(nvgpu->coolerSettings.cooler[0].currentLevel)); - ui->labelLevelMax->setText(QString("%1%").arg(nvMaxLevel)); + if(nvMaxFan < nvgpu->coolerSettings.cooler[0].currentLevel) + nvMaxFan = nvgpu->coolerSettings.cooler[0].currentLevel; + ui->labelStatusFanCur->setText(QString("%1%").arg(nvgpu->coolerSettings.cooler[0].currentLevel)); + ui->labelStatusFanMax->setText(QString("%1%").arg(nvMaxFan)); +} + +void GpuTab::displayStatus() +{ + nvgpu->status = nvapi->GPU_GetAllClocks(nvgpu->handle, &nvgpu->clocks); + +// for(int i=0; i < NVAPI_MAX_GPU_CLOCKS * 9; i++ ) +// qDebug("clock[%d] = %d", i , nvgpu->clocks.clock[i]); + + ui->labelStatusCoreCur->setText(QString("%1Mhz").arg(nvgpu->clocks.clock[30]/2000.0f, 0, 'f', 1)); + ui->labelStatusMemCur->setText(QString("%1Mhz").arg(nvgpu->clocks.clock[8]/2000.0f, 0, 'f', 1)); + ui->labelStatusShaderCur->setText(QString("%1Mhz").arg(nvgpu->clocks.clock[30]/1000.0f, 0, 'f', 1)); } diff --git a/qutefan/gputab.h b/qutefan/gputab.h index d435ee6..139445e 100644 --- a/qutefan/gputab.h +++ b/qutefan/gputab.h @@ -35,6 +35,7 @@ class GpuTab : public QWidget void setGPUDefaults(); void regulateFan(); + void displayStatus(); private: GpuTab::FanMode getMode(); @@ -47,7 +48,7 @@ class GpuTab : public QWidget QNvAPI::NvGPU* nvgpu; NV_GPU_COOLER_LEVELS nvDefaultCoolerLevels; NvS32 nvMaxTemp; - NvS32 nvMaxLevel; + NvS32 nvMaxFan; }; #endif // GPUTAB_H diff --git a/qutefan/gputab.ui b/qutefan/gputab.ui index 06fe0b9..51d522e 100644 --- a/qutefan/gputab.ui +++ b/qutefan/gputab.ui @@ -6,44 +6,411 @@ 0 0 - 398 - 187 + 569 + 396 Form + + + + + 0 + 0 + + + + Overclock + + + + + + + 0 + + + 0 + + + 0 + + + 0 + + + + + Cur + + + Qt::AlignCenter + + + + + + + Min + + + + + + + Max + + + Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter + + + + + + + + 0 + 0 + + + + Qt::Horizontal + + + QSlider::TicksBelow + + + 5 + + + + + + + + 0 + 0 + + + + + 56 + 0 + + + + + 75 + true + + + + Core: + + + Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter + + + + + + + + + + + 0 + + + 0 + + + 0 + + + 0 + + + + + + 0 + 0 + + + + + 56 + 0 + + + + + 75 + true + + + + Memory: + + + Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter + + + + + + + Min + + + + + + + + 0 + 0 + + + + Qt::Horizontal + + + QSlider::TicksBelow + + + 5 + + + + + + + Max + + + Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter + + + + + + + Cur + + + Qt::AlignCenter + + + + + + + + + + Apply + + + + + + + + + + Qt::Vertical + + + + 0 + 0 + + + + + + + + + 0 + 0 + + + + Fan Control + + + + + + + 75 + true + + + + Off + + + true + + + + + + + + 75 + true + + + + Quiet + + + + + + + + 75 + true + + + + Fixed + + + + + + + Level: + + + Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter + + + + + + + + + + + 75 + true + + + + Linear + + + + + + + Offset: + + + Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter + + + + + + + -10 + + + 10 + + + + + + + + 75 + true + + + + Graph + + + + + + + Edit + + + + + + + + + + Qt::Horizontal + + + + 0 + 0 + + + + - - - + + + + 0 + 0 + - Readings: + Status - - - + + + - 36 + 40 0 + + + 75 + true + + QFrame::StyledPanel - 0ºC + 0% + + + Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter - + - 72 + 78 0 @@ -55,8 +422,8 @@ - - + + 36 @@ -67,12 +434,31 @@ QFrame::StyledPanel - 0% + 0ºC + + + Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter + + + + + + + + 78 + 0 + + + + Fan level: + + + Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter - + 40 @@ -91,40 +477,129 @@ 0ºC + + Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter + - - + + - 40 + 36 0 - - - 75 - true - - QFrame::StyledPanel 0% + + Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter + - - + + - 72 + 78 0 - Fan level: + Core Speed: + + + Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter + + + + + + + + 78 + 0 + + + + Memory Speed: + + + Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter + + + + + + + + 78 + 0 + + + + Shader Speed: + + + Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter + + + + + + + + 36 + 0 + + + + QFrame::StyledPanel + + + 0Mhz + + + Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter + + + + + + + + 36 + 0 + + + + QFrame::StyledPanel + + + 0Mhz + + + Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter + + + + + + + + 36 + 0 + + + + QFrame::StyledPanel + + + 0Mhz Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter @@ -134,157 +609,6 @@ - - - - Qt::Vertical - - - - 20 - 40 - - - - - - - - Qt::Vertical - - - - 20 - 40 - - - - - - - - - - - 75 - true - - - - Linear - - - - - - - Offset: - - - Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter - - - - - - - - 75 - true - - - - Off - - - true - - - - - - - - 75 - true - - - - Quiet - - - - - - - -10 - - - 10 - - - - - - - Edit - - - - - - - Level: - - - Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter - - - - - - - - 75 - true - - - - Graph - - - - - - - - 75 - true - - - - Fixed - - - - - - - - - - - - Qt::Horizontal - - - - 40 - 20 - - - - diff --git a/qutefan/main.cpp b/qutefan/main.cpp index 1b77c45..53be9f9 100644 --- a/qutefan/main.cpp +++ b/qutefan/main.cpp @@ -1,12 +1,14 @@ #include "qutefan.h" #include +#include int main(int argc, char *argv[]) { QApplication a(argc, argv); + a.setOrganizationName("loathingkernel"); a.setApplicationName("Qutefan"); - a.setApplicationVersion("0.0.1"); + a.setApplicationVersion("0.1.0"); QFont f; f.setHintingPreference(QFont::PreferFullHinting); diff --git a/qutefan/qutefan.cpp b/qutefan/qutefan.cpp index eee934d..e2a307d 100644 --- a/qutefan/qutefan.cpp +++ b/qutefan/qutefan.cpp @@ -20,9 +20,9 @@ QuteFan::QuteFan(QWidget *parent) : #endif // Dynamically add tabs for as many GPUs as were found. - for(unsigned int i = 0; i < nvapi->gpuCount; i++) { + for(uint i = 0; i < nvapi->gpuCount; i++) { gpuTabs.append(new GpuTab(nvapi, &nvapi->gpu[i])); - ui->tabWidgetGpu->addTab(gpuTabs[i], QString("%1").arg(nvapi->gpu[i].name)); + ui->tabWidgetGpu->addTab(gpuTabs[static_cast(i)], QString("%1").arg(nvapi->gpu[i].name)); } // Resize window to the minimum possible and don't let it be resized. @@ -80,8 +80,10 @@ void QuteFan::onActionAboutQtTriggered() void QuteFan::regulateFan() { - foreach(GpuTab* tab, gpuTabs) + foreach(GpuTab* tab, gpuTabs) { tab->regulateFan(); + tab->displayStatus(); + } } void QuteFan::intervalChanged(int value) diff --git a/qutefan/qutefantrayicon.cpp b/qutefan/qutefantrayicon.cpp index 8a4460b..8265bc5 100644 --- a/qutefan/qutefantrayicon.cpp +++ b/qutefan/qutefantrayicon.cpp @@ -30,6 +30,11 @@ QuteFanTrayIcon::QuteFanTrayIcon(QMainWindow *parent) : QTimer::singleShot(0, this, SLOT(updateMenu())); } +QuteFanTrayIcon::~QuteFanTrayIcon() +{ + +} + void QuteFanTrayIcon::updateMenu() { actionShow->setVisible(!main->isVisible()); @@ -68,6 +73,8 @@ void QuteFanTrayIcon::activated(QSystemTrayIcon::ActivationReason reason) else showWindow(); break; + default: + break; } } diff --git a/qutefan/qutefantrayicon.h b/qutefan/qutefantrayicon.h index 0bbc207..bf37188 100644 --- a/qutefan/qutefantrayicon.h +++ b/qutefan/qutefantrayicon.h @@ -14,6 +14,7 @@ class QuteFanTrayIcon : public QSystemTrayIcon Q_OBJECT public: explicit QuteFanTrayIcon(QMainWindow *parent = 0); + ~QuteFanTrayIcon(); signals: