mirror of
https://github.com/jkocon/g-helper.git
synced 2026-02-23 13:00:52 +01:00
XGM for devices without dGPU https://github.com/seerge/g-helper/issues/1235
This commit is contained in:
@@ -380,4 +380,10 @@ public static class AppConfig
|
||||
{
|
||||
return Is("gpu_mode_force_set") || ContainsModel("503");
|
||||
}
|
||||
|
||||
public static bool IsNoGPUModes()
|
||||
{
|
||||
return ContainsModel("GV301RA");
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -52,8 +52,6 @@ namespace GHelper.Gpu
|
||||
}
|
||||
|
||||
AppConfig.Set("gpu_mode", gpuMode);
|
||||
|
||||
InitXGM();
|
||||
settings.VisualiseGPUMode(gpuMode);
|
||||
|
||||
AsusUSB.ApplyGPUColor();
|
||||
@@ -278,13 +276,6 @@ namespace GHelper.Gpu
|
||||
}
|
||||
|
||||
|
||||
public void InitXGM()
|
||||
{
|
||||
bool connected = Program.acpi.IsXGConnected();
|
||||
int activated = Program.acpi.DeviceGet(AsusACPI.GPUXG);
|
||||
settings.VisualizeXGM(connected, activated == 1);
|
||||
}
|
||||
|
||||
public void ToggleXGM()
|
||||
{
|
||||
|
||||
|
||||
@@ -244,7 +244,8 @@ namespace GHelper
|
||||
if (this.Visible)
|
||||
{
|
||||
screenControl.InitScreen();
|
||||
gpuControl.InitXGM();
|
||||
VisualizeXGM();
|
||||
|
||||
Task.Run((Action)RefreshPeripheralsBattery);
|
||||
updateControl.CheckForUpdates();
|
||||
}
|
||||
@@ -966,15 +967,24 @@ namespace GHelper
|
||||
}
|
||||
|
||||
|
||||
public void VisualizeXGM(bool connected, bool activated)
|
||||
public void VisualizeXGM(int GPUMode = -1)
|
||||
{
|
||||
|
||||
bool connected = Program.acpi.IsXGConnected();
|
||||
buttonXGM.Enabled = buttonXGM.Visible = connected;
|
||||
|
||||
if (!connected) return;
|
||||
|
||||
buttonXGM.Activated = activated;
|
||||
if (GPUMode != -1)
|
||||
ButtonEnabled(buttonXGM, AppConfig.IsNoGPUModes() || GPUMode != AsusACPI.GPUModeEco);
|
||||
|
||||
if (activated)
|
||||
|
||||
int activated = Program.acpi.DeviceGet(AsusACPI.GPUXG);
|
||||
Logger.WriteLine("XGM Activated flag: " + activated);
|
||||
|
||||
buttonXGM.Activated = activated == 1;
|
||||
|
||||
if (activated == 1)
|
||||
{
|
||||
ButtonEnabled(buttonOptimized, false);
|
||||
ButtonEnabled(buttonEco, false);
|
||||
@@ -1074,7 +1084,8 @@ namespace GHelper
|
||||
break;
|
||||
}
|
||||
|
||||
ButtonEnabled(buttonXGM, AppConfig.ContainsModel("GV301RA") || GPUMode != AsusACPI.GPUModeEco);
|
||||
VisualizeXGM(GPUMode);
|
||||
|
||||
|
||||
if (isGpuSection)
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user