GPU Mode Backlight

This commit is contained in:
Serge
2023-08-14 16:48:16 +02:00
parent 4c989c9d75
commit 4f6de3c6a3
6 changed files with 52 additions and 18 deletions

View File

@@ -364,7 +364,7 @@ public static class AppConfig
public static bool IsGPUFixNeeded() public static bool IsGPUFixNeeded()
{ {
return ContainsModel("GA402X") || ContainsModel("GV302") || ContainsModel("FX506"); return ContainsModel("GA402X") || ContainsModel("GV302") || ContainsModel("FX506") || ContainsModel("GU603V");
} }
public static bool IsGPUFix() public static bool IsGPUFix()

View File

@@ -1,5 +1,8 @@
using GHelper.Helpers; using GHelper.Gpu;
using GHelper.Helpers;
using HidLibrary; using HidLibrary;
using NAudio.Gui;
using System.Drawing;
using System.Text; using System.Text;
namespace GHelper namespace GHelper
@@ -37,6 +40,7 @@ namespace GHelper
public static class AsusUSB public static class AsusUSB
{ {
public const int HEATMAP = 20; public const int HEATMAP = 20;
public const int GPUMODE = 21;
public const int ASUS_ID = 0x0b05; public const int ASUS_ID = 0x0b05;
@@ -161,7 +165,8 @@ namespace GHelper
{ 2, Properties.Strings.AuraColorCycle }, { 2, Properties.Strings.AuraColorCycle },
{ 3, Properties.Strings.AuraRainbow }, { 3, Properties.Strings.AuraRainbow },
{ 10, Properties.Strings.AuraStrobe }, { 10, Properties.Strings.AuraStrobe },
{ HEATMAP, "Heatmap"} { HEATMAP, "Heatmap"},
{ GPUMODE, "GPU Mode" }
}; };
static Dictionary<int, string> _modesStrix = new Dictionary<int, string> static Dictionary<int, string> _modesStrix = new Dictionary<int, string>
@@ -194,6 +199,7 @@ namespace GHelper
_modes.Remove(2); _modes.Remove(2);
_modes.Remove(3); _modes.Remove(3);
_modes.Remove(HEATMAP); _modes.Remove(HEATMAP);
_modes.Remove(GPUMODE);
} }
if (AppConfig.IsAdvantageEdition()) if (AppConfig.IsAdvantageEdition())
@@ -531,6 +537,25 @@ namespace GHelper
} }
public static void ApplyGPUColor()
{
if (AppConfig.Get("aura_mode") != GPUMODE) return;
switch (GPUModeControl.GpuMode)
{
case AsusACPI.GPUModeUltimate:
ApplyColor(Color.Red, true);
break;
case AsusACPI.GPUModeEco:
ApplyColor(Color.Green, true);
break;
default:
ApplyColor(Color.Yellow, true);
break;
}
}
public static void ApplyAura() public static void ApplyAura()
{ {
@@ -539,17 +564,22 @@ namespace GHelper
SetColor(AppConfig.Get("aura_color")); SetColor(AppConfig.Get("aura_color"));
SetColor2(AppConfig.Get("aura_color2")); SetColor2(AppConfig.Get("aura_color2"));
timer.Enabled = false;
if (Mode == HEATMAP) if (Mode == HEATMAP)
{ {
SetHeatmap(true); SetHeatmap(true);
timer.Enabled = true; timer.Enabled = true;
return; return;
} }
else
if (Mode == GPUMODE)
{ {
timer.Enabled = false; ApplyGPUColor();
return;
} }
Task.Run(async () => Task.Run(async () =>
{ {

View File

@@ -331,16 +331,10 @@ namespace GHelper
{ {
try try
{ {
Task.Run(() => int hibernate = PowerNative.GetHibernateAfter();
{ if (hibernate < 0 || hibernate > numericHibernateAfter.Maximum) hibernate = 0;
int hibernate = PowerNative.GetHibernateAfter(); numericHibernateAfter.Value = hibernate;
if (hibernate < 0 || hibernate > numericHibernateAfter.Maximum) hibernate = 0; numericHibernateAfter.ValueChanged += NumericHibernateAfter_ValueChanged;
BeginInvoke(delegate
{
numericHibernateAfter.Value = hibernate;
numericHibernateAfter.ValueChanged += NumericHibernateAfter_ValueChanged;
});
});
} }
catch (Exception ex) catch (Exception ex)

View File

@@ -10,6 +10,8 @@ namespace GHelper.Gpu
SettingsForm settings; SettingsForm settings;
ScreenControl screenControl = new ScreenControl(); ScreenControl screenControl = new ScreenControl();
public static int GpuMode;
public GPUModeControl(SettingsForm settingsForm) public GPUModeControl(SettingsForm settingsForm)
{ {
settings = settingsForm; settings = settingsForm;
@@ -23,8 +25,6 @@ namespace GHelper.Gpu
Logger.WriteLine("Eco flag : " + eco); Logger.WriteLine("Eco flag : " + eco);
Logger.WriteLine("Mux flag : " + mux); Logger.WriteLine("Mux flag : " + mux);
int GpuMode;
if (mux == 0) if (mux == 0)
{ {
GpuMode = AsusACPI.GPUModeUltimate; GpuMode = AsusACPI.GPUModeUltimate;

View File

@@ -314,6 +314,8 @@ namespace GHelper.Mode
{ {
Logger.WriteLine(ex.ToString()); Logger.WriteLine(ex.ToString());
} }
settings.GPUInit();
}); });
} }

View File

@@ -582,6 +582,14 @@ namespace GHelper
}); });
} }
public void GPUInit()
{
Invoke(delegate
{
if (fans != null && fans.Text != "") fans.InitGPU();
});
}
public void FansToggle(int index = 0) public void FansToggle(int index = 0)
{ {
if (fans == null || fans.Text == "") if (fans == null || fans.Text == "")