UI tweaks

This commit is contained in:
Serge
2023-05-07 11:17:45 +02:00
parent 479572e39d
commit 832f13d8e4
6 changed files with 25 additions and 2 deletions

View File

@@ -30,6 +30,8 @@ namespace GHelper
buttonReset.Text = Properties.Strings.FactoryDefaults; buttonReset.Text = Properties.Strings.FactoryDefaults;
checkApplyFans.Text = Properties.Strings.ApplyFanCurve; checkApplyFans.Text = Properties.Strings.ApplyFanCurve;
labelGPU.Text = Properties.Strings.GPUSettings;
InitTheme(); InitTheme();
MinRPM = 18; MinRPM = 18;
@@ -162,6 +164,9 @@ namespace GHelper
trackGPUBoost.Value = Math.Max(Math.Min(gpu_boost, ASUSWmi.MaxGPUBoost), ASUSWmi.MinGPUBoost); trackGPUBoost.Value = Math.Max(Math.Min(gpu_boost, ASUSWmi.MaxGPUBoost), ASUSWmi.MinGPUBoost);
trackGPUTemp.Value = Math.Max(Math.Min(gpu_temp, ASUSWmi.MaxGPUTemp), ASUSWmi.MinGPUTemp); 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(); VisualiseGPUSettings();
} }

View File

@@ -54,10 +54,13 @@ public class NvidiaGpuControl : IGpuControl
IPerformanceStates20Info states = GPUApi.GetPerformanceStates20(internalGpu.Handle); 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; core = states.Clocks[PerformanceStateId.P0_3DPerformance][0].FrequencyDeltaInkHz.DeltaValue / 1000;
memory = states.Clocks[PerformanceStateId.P0_3DPerformance][1].FrequencyDeltaInkHz.DeltaValue / 1000; memory = states.Clocks[PerformanceStateId.P0_3DPerformance][1].FrequencyDeltaInkHz.DeltaValue / 1000;
Logger.WriteLine($"GET GPU Clock offsets : {core}, {memory}");
} }
public int SetClocksFromConfig() public int SetClocksFromConfig()
@@ -89,6 +92,7 @@ public class NvidiaGpuControl : IGpuControl
try try
{ {
GPUApi.SetPerformanceStates20(internalGpu.Handle, overclock); GPUApi.SetPerformanceStates20(internalGpu.Handle, overclock);
Logger.WriteLine($"SET GPU Clock offsets : {core}, {memory}");
} }
catch (Exception ex) catch (Exception ex)
{ {

View File

@@ -64,7 +64,7 @@ namespace GHelper
} }
Logger.WriteLine("------------"); 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(); Application.EnableVisualStyles();

View File

@@ -519,6 +519,15 @@ namespace GHelper.Properties {
} }
} }
/// <summary>
/// Looks up a localized string similar to GPU Settings.
/// </summary>
internal static string GPUSettings {
get {
return ResourceManager.GetString("GPUSettings", resourceCulture);
}
}
/// <summary> /// <summary>
/// Looks up a localized string similar to Key Bindings. /// Looks up a localized string similar to Key Bindings.
/// </summary> /// </summary>

View File

@@ -270,6 +270,9 @@
<data name="GPUModeUltimate" xml:space="preserve"> <data name="GPUModeUltimate" xml:space="preserve">
<value>dGPU exclusive</value> <value>dGPU exclusive</value>
</data> </data>
<data name="GPUSettings" xml:space="preserve">
<value>GPU Settings</value>
</data>
<data name="KeyBindings" xml:space="preserve"> <data name="KeyBindings" xml:space="preserve">
<value>Key Bindings</value> <value>Key Bindings</value>
</data> </data>

View File

@@ -1136,12 +1136,14 @@ namespace GHelper
timer.Stop(); timer.Stop();
timer.Dispose(); timer.Dispose();
SetPower(); SetPower();
SetGPUPower();
}; };
timer.Start(); timer.Start();
} }
else else
{ {
SetPower(); SetPower();
SetGPUPower();
} }
} }