From 832f13d8e4f735a9df9b32768e2015e9be9212e4 Mon Sep 17 00:00:00 2001 From: Serge <5920850+seerge@users.noreply.github.com> Date: Sun, 7 May 2023 11:17:45 +0200 Subject: [PATCH] UI tweaks --- app/Fans.cs | 5 +++++ app/Gpu/NvidiaGpuControl.cs | 6 +++++- app/Program.cs | 2 +- app/Properties/Strings.Designer.cs | 9 +++++++++ app/Properties/Strings.resx | 3 +++ app/Settings.cs | 2 ++ 6 files changed, 25 insertions(+), 2 deletions(-) diff --git a/app/Fans.cs b/app/Fans.cs index e28e3120..4217fdf2 100644 --- a/app/Fans.cs +++ b/app/Fans.cs @@ -30,6 +30,8 @@ namespace GHelper buttonReset.Text = Properties.Strings.FactoryDefaults; checkApplyFans.Text = Properties.Strings.ApplyFanCurve; + labelGPU.Text = Properties.Strings.GPUSettings; + InitTheme(); MinRPM = 18; @@ -162,6 +164,9 @@ namespace GHelper trackGPUBoost.Value = Math.Max(Math.Min(gpu_boost, ASUSWmi.MaxGPUBoost), ASUSWmi.MinGPUBoost); trackGPUTemp.Value = Math.Max(Math.Min(gpu_temp, ASUSWmi.MaxGPUTemp), ASUSWmi.MinGPUTemp); + panelGPUBoost.Visible = (Program.wmi.DeviceGet(ASUSWmi.PPT_GPUC0) >= 0); + panelGPUTemp.Visible = (Program.wmi.DeviceGet(ASUSWmi.PPT_GPUC2) >= 0); + VisualiseGPUSettings(); } diff --git a/app/Gpu/NvidiaGpuControl.cs b/app/Gpu/NvidiaGpuControl.cs index 31bd507c..0a351be7 100644 --- a/app/Gpu/NvidiaGpuControl.cs +++ b/app/Gpu/NvidiaGpuControl.cs @@ -54,10 +54,13 @@ public class NvidiaGpuControl : IGpuControl IPerformanceStates20Info states = GPUApi.GetPerformanceStates20(internalGpu.Handle); - Logger.WriteLine("IPerformanceStates20Info type : " + states.GetType()); + //Logger.WriteLine("IPerformanceStates20Info type : " + states.GetType()); core = states.Clocks[PerformanceStateId.P0_3DPerformance][0].FrequencyDeltaInkHz.DeltaValue / 1000; memory = states.Clocks[PerformanceStateId.P0_3DPerformance][1].FrequencyDeltaInkHz.DeltaValue / 1000; + + Logger.WriteLine($"GET GPU Clock offsets : {core}, {memory}"); + } public int SetClocksFromConfig() @@ -89,6 +92,7 @@ public class NvidiaGpuControl : IGpuControl try { GPUApi.SetPerformanceStates20(internalGpu.Handle, overclock); + Logger.WriteLine($"SET GPU Clock offsets : {core}, {memory}"); } catch (Exception ex) { diff --git a/app/Program.cs b/app/Program.cs index e65a9637..38a7aedc 100644 --- a/app/Program.cs +++ b/app/Program.cs @@ -64,7 +64,7 @@ namespace GHelper } Logger.WriteLine("------------"); - Logger.WriteLine("App launched: " + config.GetModel() + " :" + Assembly.GetExecutingAssembly().GetName().Version.ToString()); + Logger.WriteLine("App launched: " + config.GetModel() + " :" + Assembly.GetExecutingAssembly().GetName().Version.ToString() + (IsUserAdministrator()?"A":"N")); Application.EnableVisualStyles(); diff --git a/app/Properties/Strings.Designer.cs b/app/Properties/Strings.Designer.cs index f8ab3328..52169529 100644 --- a/app/Properties/Strings.Designer.cs +++ b/app/Properties/Strings.Designer.cs @@ -519,6 +519,15 @@ namespace GHelper.Properties { } } + /// + /// Looks up a localized string similar to GPU Settings. + /// + internal static string GPUSettings { + get { + return ResourceManager.GetString("GPUSettings", resourceCulture); + } + } + /// /// Looks up a localized string similar to Key Bindings. /// diff --git a/app/Properties/Strings.resx b/app/Properties/Strings.resx index 64b2d1e9..865b2219 100644 --- a/app/Properties/Strings.resx +++ b/app/Properties/Strings.resx @@ -270,6 +270,9 @@ dGPU exclusive + + GPU Settings + Key Bindings diff --git a/app/Settings.cs b/app/Settings.cs index 7ee44e10..228685fb 100644 --- a/app/Settings.cs +++ b/app/Settings.cs @@ -1136,12 +1136,14 @@ namespace GHelper timer.Stop(); timer.Dispose(); SetPower(); + SetGPUPower(); }; timer.Start(); } else { SetPower(); + SetGPUPower(); } }