mirror of
https://github.com/jkocon/g-helper.git
synced 2026-02-23 13:00:52 +01:00
Some renamings
This commit is contained in:
@@ -75,12 +75,16 @@ public class AppConfig
|
|||||||
|
|
||||||
public int getConfig(string name, bool performance = false)
|
public int getConfig(string name, bool performance = false)
|
||||||
{
|
{
|
||||||
|
|
||||||
if (config.ContainsKey(name))
|
if (config.ContainsKey(name))
|
||||||
return int.Parse(config[name].ToString());
|
return int.Parse(config[name].ToString());
|
||||||
else return -1;
|
else return -1;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public bool isConfig(string name)
|
||||||
|
{
|
||||||
|
return getConfig(name) == 1;
|
||||||
|
}
|
||||||
|
|
||||||
public string getConfigString(string name)
|
public string getConfigString(string name)
|
||||||
{
|
{
|
||||||
if (config.ContainsKey(name))
|
if (config.ContainsKey(name))
|
||||||
@@ -115,22 +119,32 @@ public class AppConfig
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public string getParamName(int device, string paramName = "fan_profile")
|
public string getParamName(AsusFan device, string paramName = "fan_profile")
|
||||||
{
|
{
|
||||||
int mode = getConfig("performance_mode");
|
int mode = getConfig("performance_mode");
|
||||||
string name;
|
string name;
|
||||||
|
|
||||||
if (device == 1)
|
switch (device)
|
||||||
name = "gpu";
|
{
|
||||||
else if (device == 2)
|
case AsusFan.GPU:
|
||||||
name = "mid";
|
name = "gpu";
|
||||||
else
|
break;
|
||||||
name = "cpu";
|
case AsusFan.Mid:
|
||||||
|
name = "mid";
|
||||||
|
break;
|
||||||
|
case AsusFan.XGM:
|
||||||
|
name = "xgm";
|
||||||
|
break;
|
||||||
|
default:
|
||||||
|
name = "cpu";
|
||||||
|
break;
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
return paramName + "_" + name + "_" + mode;
|
return paramName + "_" + name + "_" + mode;
|
||||||
}
|
}
|
||||||
|
|
||||||
public byte[] getFanConfig(int device)
|
public byte[] getFanConfig(AsusFan device)
|
||||||
{
|
{
|
||||||
string curveString = getConfigString(getParamName(device));
|
string curveString = getConfigString(getParamName(device));
|
||||||
byte[] curve = { };
|
byte[] curve = { };
|
||||||
@@ -141,7 +155,7 @@ public class AppConfig
|
|||||||
return curve;
|
return curve;
|
||||||
}
|
}
|
||||||
|
|
||||||
public void setFanConfig(int device, byte[] curve)
|
public void setFanConfig(AsusFan device, byte[] curve)
|
||||||
{
|
{
|
||||||
string bitCurve = BitConverter.ToString(curve);
|
string bitCurve = BitConverter.ToString(curve);
|
||||||
setConfig(getParamName(device), bitCurve);
|
setConfig(getParamName(device), bitCurve);
|
||||||
@@ -156,7 +170,7 @@ public class AppConfig
|
|||||||
return array;
|
return array;
|
||||||
}
|
}
|
||||||
|
|
||||||
public byte[] getDefaultCurve(int device)
|
public byte[] getDefaultCurve(AsusFan device)
|
||||||
{
|
{
|
||||||
int mode = getConfig("performance_mode");
|
int mode = getConfig("performance_mode");
|
||||||
byte[] curve;
|
byte[] curve;
|
||||||
@@ -164,19 +178,19 @@ public class AppConfig
|
|||||||
switch (mode)
|
switch (mode)
|
||||||
{
|
{
|
||||||
case 1:
|
case 1:
|
||||||
if (device == 1)
|
if (device == AsusFan.GPU)
|
||||||
curve = StringToBytes("14-3F-44-48-4C-50-54-62-16-1F-26-2D-39-47-55-5F");
|
curve = StringToBytes("14-3F-44-48-4C-50-54-62-16-1F-26-2D-39-47-55-5F");
|
||||||
else
|
else
|
||||||
curve = StringToBytes("14-3F-44-48-4C-50-54-62-11-1A-22-29-34-43-51-5A");
|
curve = StringToBytes("14-3F-44-48-4C-50-54-62-11-1A-22-29-34-43-51-5A");
|
||||||
break;
|
break;
|
||||||
case 2:
|
case 2:
|
||||||
if (device == 1)
|
if (device == AsusFan.GPU)
|
||||||
curve = StringToBytes("3C-41-42-46-47-4B-4C-62-08-11-11-1D-1D-26-26-2D");
|
curve = StringToBytes("3C-41-42-46-47-4B-4C-62-08-11-11-1D-1D-26-26-2D");
|
||||||
else
|
else
|
||||||
curve = StringToBytes("3C-41-42-46-47-4B-4C-62-03-0C-0C-16-16-22-22-29");
|
curve = StringToBytes("3C-41-42-46-47-4B-4C-62-03-0C-0C-16-16-22-22-29");
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
if (device == 1)
|
if (device == AsusFan.GPU)
|
||||||
curve = StringToBytes("3A-3D-40-44-48-4D-51-62-0C-16-1D-1F-26-2D-34-4A");
|
curve = StringToBytes("3A-3D-40-44-48-4D-51-62-0C-16-1D-1F-26-2D-34-4A");
|
||||||
else
|
else
|
||||||
curve = StringToBytes("3A-3D-40-44-48-4D-51-62-08-11-16-1A-22-29-30-45");
|
curve = StringToBytes("3A-3D-40-44-48-4D-51-62-08-11-16-1A-22-29-30-45");
|
||||||
|
|||||||
@@ -1,10 +1,16 @@
|
|||||||
using System.Diagnostics;
|
using System.Diagnostics;
|
||||||
using System.Globalization;
|
|
||||||
using System.IO.Pipes;
|
|
||||||
using System.Management;
|
using System.Management;
|
||||||
using System.Runtime.InteropServices;
|
using System.Runtime.InteropServices;
|
||||||
|
|
||||||
public class ASUSWmi
|
public enum AsusFan
|
||||||
|
{
|
||||||
|
CPU = 0,
|
||||||
|
GPU = 1,
|
||||||
|
Mid = 2,
|
||||||
|
XGM = 3
|
||||||
|
}
|
||||||
|
|
||||||
|
public class AsusACPI
|
||||||
{
|
{
|
||||||
|
|
||||||
const string FILE_NAME = @"\\.\\ATKACPI";
|
const string FILE_NAME = @"\\.\\ATKACPI";
|
||||||
@@ -150,7 +156,7 @@ public class ASUSWmi
|
|||||||
data[0] = BitConverter.GetBytes(eventHandle.ToInt32())[0];
|
data[0] = BitConverter.GetBytes(eventHandle.ToInt32())[0];
|
||||||
data[1] = BitConverter.GetBytes(eventHandle.ToInt32())[1];
|
data[1] = BitConverter.GetBytes(eventHandle.ToInt32())[1];
|
||||||
|
|
||||||
result = Control (0x222400, data, outBuffer);
|
result = Control(0x222400, data, outBuffer);
|
||||||
Debug.WriteLine(result + ":" + BitConverter.ToString(data) + "|" + BitConverter.ToString(outBuffer));
|
Debug.WriteLine(result + ":" + BitConverter.ToString(data) + "|" + BitConverter.ToString(outBuffer));
|
||||||
|
|
||||||
while (true)
|
while (true)
|
||||||
@@ -163,7 +169,7 @@ public class ASUSWmi
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
public ASUSWmi()
|
public AsusACPI()
|
||||||
{
|
{
|
||||||
handle = CreateFile(
|
handle = CreateFile(
|
||||||
FILE_NAME,
|
FILE_NAME,
|
||||||
@@ -179,7 +185,7 @@ public class ASUSWmi
|
|||||||
{
|
{
|
||||||
throw new Exception("Can't connect to ACPI");
|
throw new Exception("Can't connect to ACPI");
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public bool Control(uint dwIoControlCode, byte[] lpInBuffer, byte[] lpOutBuffer)
|
public bool Control(uint dwIoControlCode, byte[] lpInBuffer, byte[] lpOutBuffer)
|
||||||
@@ -282,7 +288,7 @@ public class ASUSWmi
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
public int SetFanCurve(int device, byte[] curve)
|
public int SetFanCurve(AsusFan device, byte[] curve)
|
||||||
{
|
{
|
||||||
|
|
||||||
if (curve.Length != 16) return -1;
|
if (curve.Length != 16) return -1;
|
||||||
@@ -295,10 +301,10 @@ public class ASUSWmi
|
|||||||
|
|
||||||
switch (device)
|
switch (device)
|
||||||
{
|
{
|
||||||
case 1:
|
case AsusFan.GPU:
|
||||||
result = DeviceSet(DevsGPUFanCurve, curve, "FanGPU");
|
result = DeviceSet(DevsGPUFanCurve, curve, "FanGPU");
|
||||||
break;
|
break;
|
||||||
case 2:
|
case AsusFan.Mid:
|
||||||
result = DeviceSet(DevsMidFanCurve, curve, "FanMid");
|
result = DeviceSet(DevsMidFanCurve, curve, "FanMid");
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
@@ -309,7 +315,7 @@ public class ASUSWmi
|
|||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
|
|
||||||
public byte[] GetFanCurve(int device, int mode = 0)
|
public byte[] GetFanCurve(AsusFan device, int mode = 0)
|
||||||
{
|
{
|
||||||
uint fan_mode;
|
uint fan_mode;
|
||||||
|
|
||||||
@@ -323,9 +329,9 @@ public class ASUSWmi
|
|||||||
|
|
||||||
switch (device)
|
switch (device)
|
||||||
{
|
{
|
||||||
case 1:
|
case AsusFan.GPU:
|
||||||
return DeviceGetBuffer(DevsGPUFanCurve, fan_mode);
|
return DeviceGetBuffer(DevsGPUFanCurve, fan_mode);
|
||||||
case 2:
|
case AsusFan.Mid:
|
||||||
return DeviceGetBuffer(DevsMidFanCurve, fan_mode);
|
return DeviceGetBuffer(DevsMidFanCurve, fan_mode);
|
||||||
default:
|
default:
|
||||||
return DeviceGetBuffer(DevsCPUFanCurve, fan_mode);
|
return DeviceGetBuffer(DevsCPUFanCurve, fan_mode);
|
||||||
@@ -334,7 +340,8 @@ public class ASUSWmi
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
public static bool IsEmptyCurve(byte[] curve) {
|
public static bool IsEmptyCurve(byte[] curve)
|
||||||
|
{
|
||||||
return curve.Length != 16 || curve.All(singleByte => singleByte == 0);
|
return curve.Length != 16 || curve.All(singleByte => singleByte == 0);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -343,7 +350,7 @@ public class ASUSWmi
|
|||||||
if (curve.Length != 16) throw new Exception("Incorrect curve");
|
if (curve.Length != 16) throw new Exception("Incorrect curve");
|
||||||
|
|
||||||
var points = new Dictionary<byte, byte>();
|
var points = new Dictionary<byte, byte>();
|
||||||
for (int i = 0; i < 8; i++) points[curve[i]] = curve[i+8];
|
for (int i = 0; i < 8; i++) points[curve[i]] = curve[i + 8];
|
||||||
|
|
||||||
var pointsFixed = new Dictionary<byte, byte>();
|
var pointsFixed = new Dictionary<byte, byte>();
|
||||||
bool fix = false;
|
bool fix = false;
|
||||||
@@ -357,7 +364,7 @@ public class ASUSWmi
|
|||||||
pointsFixed.Add(20, 0);
|
pointsFixed.Add(20, 0);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (count != 3 || !fix)
|
if (count != 3 || !fix)
|
||||||
pointsFixed.Add(pair.Key, pair.Value);
|
pointsFixed.Add(pair.Key, pair.Value);
|
||||||
count++;
|
count++;
|
||||||
}
|
}
|
||||||
@@ -365,8 +372,8 @@ public class ASUSWmi
|
|||||||
count = 0;
|
count = 0;
|
||||||
foreach (var pair in pointsFixed.OrderBy(x => x.Key))
|
foreach (var pair in pointsFixed.OrderBy(x => x.Key))
|
||||||
{
|
{
|
||||||
curve[count] =pair.Key;
|
curve[count] = pair.Key;
|
||||||
curve[count+8] = pair.Value;
|
curve[count + 8] = pair.Value;
|
||||||
count++;
|
count++;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -374,6 +381,11 @@ public class ASUSWmi
|
|||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public bool IsXGConnected()
|
||||||
|
{
|
||||||
|
return DeviceGet(GPUXGConnected) == 1;
|
||||||
|
}
|
||||||
|
|
||||||
public void TUFKeyboardBrightness(int brightness)
|
public void TUFKeyboardBrightness(int brightness)
|
||||||
{
|
{
|
||||||
int param = 0x80 | (brightness & 0x7F);
|
int param = 0x80 | (brightness & 0x7F);
|
||||||
@@ -49,7 +49,7 @@ namespace GHelper
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public static class Aura
|
public static class AsusUSB
|
||||||
{
|
{
|
||||||
|
|
||||||
static byte[] MESSAGE_SET = { 0x5d, 0xb5, 0, 0, 0 };
|
static byte[] MESSAGE_SET = { 0x5d, 0xb5, 0, 0, 0 };
|
||||||
@@ -208,7 +208,7 @@ namespace GHelper
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (Program.config.ContainsModel("TUF"))
|
if (Program.config.ContainsModel("TUF"))
|
||||||
Program.wmi.TUFKeyboardBrightness(brightness);
|
Program.acpi.TUFKeyboardBrightness(brightness);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@@ -230,7 +230,7 @@ namespace GHelper
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (Program.config.ContainsModel("TUF"))
|
if (Program.config.ContainsModel("TUF"))
|
||||||
Program.wmi.TUFKeyboardPower(
|
Program.acpi.TUFKeyboardPower(
|
||||||
flags.Contains(AuraDev19b6.AwakeKeyb),
|
flags.Contains(AuraDev19b6.AwakeKeyb),
|
||||||
flags.Contains(AuraDev19b6.BootKeyb),
|
flags.Contains(AuraDev19b6.BootKeyb),
|
||||||
flags.Contains(AuraDev19b6.SleepKeyb),
|
flags.Contains(AuraDev19b6.SleepKeyb),
|
||||||
@@ -238,20 +238,44 @@ namespace GHelper
|
|||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public static void ApplyXGMLight(bool status)
|
public static int SetXGM(byte[] msg)
|
||||||
{
|
{
|
||||||
byte value = status ? (byte)0x50 : (byte)0;
|
|
||||||
var msg = new byte[] { 0x5e, 0xc5, value };
|
Debug.WriteLine("XGM Payload :" + BitConverter.ToString(msg));
|
||||||
|
|
||||||
foreach (HidDevice device in GetHidDevices(new int[] { 0x1970 }))
|
foreach (HidDevice device in GetHidDevices(new int[] { 0x1970 }))
|
||||||
{
|
{
|
||||||
device.OpenDevice();
|
device.OpenDevice();
|
||||||
var message = new byte[300];
|
Debug.WriteLine("XGM " + device.Attributes.ProductHexId + ":" + BitConverter.ToString(msg));
|
||||||
Array.Copy(msg, message, msg.Length);
|
device.WriteFeatureData(msg);
|
||||||
Debug.WriteLine(BitConverter.ToString(message));
|
|
||||||
device.WriteFeatureData(message);
|
|
||||||
device.CloseDevice();
|
device.CloseDevice();
|
||||||
|
return 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
public static void ApplyXGMLight(bool status)
|
||||||
|
{
|
||||||
|
SetXGM(new byte[] { 0x5e, 0xc5, status ? (byte)0x50 : (byte)0 });
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
public static int ResetXGM()
|
||||||
|
{
|
||||||
|
return SetXGM(new byte[] { 0x5e, 0xd1, 0x02 });
|
||||||
|
}
|
||||||
|
|
||||||
|
public static int SetXGMFan(byte[] curve)
|
||||||
|
{
|
||||||
|
|
||||||
|
if (AsusACPI.IsEmptyCurve(curve)) return -1;
|
||||||
|
|
||||||
|
byte[] msg = new byte[19];
|
||||||
|
Array.Copy(new byte[] { 0x5e, 0xd1, 0x01 }, msg, 3);
|
||||||
|
Array.Copy(curve, 0, msg, 3, curve.Length);
|
||||||
|
|
||||||
|
return SetXGM(msg);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@@ -293,7 +317,7 @@ namespace GHelper
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (Program.config.ContainsModel("TUF"))
|
if (Program.config.ContainsModel("TUF"))
|
||||||
Program.wmi.TUFKeyboardRGB(Mode, Color1, _speed);
|
Program.acpi.TUFKeyboardRGB(Mode, Color1, _speed);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
14
app/Extra.cs
14
app/Extra.cs
@@ -92,10 +92,10 @@ namespace GHelper
|
|||||||
Shown += Keyboard_Shown;
|
Shown += Keyboard_Shown;
|
||||||
|
|
||||||
comboKeyboardSpeed.DropDownStyle = ComboBoxStyle.DropDownList;
|
comboKeyboardSpeed.DropDownStyle = ComboBoxStyle.DropDownList;
|
||||||
comboKeyboardSpeed.DataSource = new BindingSource(Aura.GetSpeeds(), null);
|
comboKeyboardSpeed.DataSource = new BindingSource(AsusUSB.GetSpeeds(), null);
|
||||||
comboKeyboardSpeed.DisplayMember = "Value";
|
comboKeyboardSpeed.DisplayMember = "Value";
|
||||||
comboKeyboardSpeed.ValueMember = "Key";
|
comboKeyboardSpeed.ValueMember = "Key";
|
||||||
comboKeyboardSpeed.SelectedValue = Aura.Speed;
|
comboKeyboardSpeed.SelectedValue = AsusUSB.Speed;
|
||||||
comboKeyboardSpeed.SelectedValueChanged += ComboKeyboardSpeed_SelectedValueChanged;
|
comboKeyboardSpeed.SelectedValueChanged += ComboKeyboardSpeed_SelectedValueChanged;
|
||||||
|
|
||||||
// Keyboard
|
// Keyboard
|
||||||
@@ -187,7 +187,7 @@ namespace GHelper
|
|||||||
pictureHelp.Click += PictureHelp_Click;
|
pictureHelp.Click += PictureHelp_Click;
|
||||||
trackBrightness.Scroll += TrackBrightness_Scroll;
|
trackBrightness.Scroll += TrackBrightness_Scroll;
|
||||||
|
|
||||||
panelXMG.Visible = (Program.wmi.DeviceGet(ASUSWmi.GPUXGConnected) == 1);
|
panelXMG.Visible = (Program.acpi.DeviceGet(AsusACPI.GPUXGConnected) == 1);
|
||||||
checkXMG.Checked = !(Program.config.getConfig("xmg_light") == 0);
|
checkXMG.Checked = !(Program.config.getConfig("xmg_light") == 0);
|
||||||
checkXMG.CheckedChanged += CheckXMG_CheckedChanged;
|
checkXMG.CheckedChanged += CheckXMG_CheckedChanged;
|
||||||
|
|
||||||
@@ -202,13 +202,13 @@ namespace GHelper
|
|||||||
{
|
{
|
||||||
Program.RunAsAdmin("extra");
|
Program.RunAsAdmin("extra");
|
||||||
Program.config.setConfig("keyboard_light_tiomeout", (int)numericBacklightTime.Value);
|
Program.config.setConfig("keyboard_light_tiomeout", (int)numericBacklightTime.Value);
|
||||||
Aura.SetBacklightOffDelay((int)numericBacklightTime.Value);
|
AsusUSB.SetBacklightOffDelay((int)numericBacklightTime.Value);
|
||||||
}
|
}
|
||||||
|
|
||||||
private void CheckXMG_CheckedChanged(object? sender, EventArgs e)
|
private void CheckXMG_CheckedChanged(object? sender, EventArgs e)
|
||||||
{
|
{
|
||||||
Program.config.setConfig("xmg_light", (checkXMG.Checked ? 1 : 0));
|
Program.config.setConfig("xmg_light", (checkXMG.Checked ? 1 : 0));
|
||||||
Aura.ApplyXGMLight(checkXMG.Checked);
|
AsusUSB.ApplyXGMLight(checkXMG.Checked);
|
||||||
}
|
}
|
||||||
|
|
||||||
private void CheckUSBC_CheckedChanged(object? sender, EventArgs e)
|
private void CheckUSBC_CheckedChanged(object? sender, EventArgs e)
|
||||||
@@ -219,7 +219,7 @@ namespace GHelper
|
|||||||
private void TrackBrightness_Scroll(object? sender, EventArgs e)
|
private void TrackBrightness_Scroll(object? sender, EventArgs e)
|
||||||
{
|
{
|
||||||
Program.config.setConfig("keyboard_brightness", trackBrightness.Value);
|
Program.config.setConfig("keyboard_brightness", trackBrightness.Value);
|
||||||
Aura.ApplyBrightness(trackBrightness.Value);
|
AsusUSB.ApplyBrightness(trackBrightness.Value);
|
||||||
}
|
}
|
||||||
|
|
||||||
private void PictureHelp_Click(object? sender, EventArgs e)
|
private void PictureHelp_Click(object? sender, EventArgs e)
|
||||||
@@ -288,7 +288,7 @@ namespace GHelper
|
|||||||
if (checkSleepLogo.Checked) flags.Add(AuraDev19b6.SleepLogo);
|
if (checkSleepLogo.Checked) flags.Add(AuraDev19b6.SleepLogo);
|
||||||
if (checkShutdownLogo.Checked) flags.Add(AuraDev19b6.ShutdownLogo);
|
if (checkShutdownLogo.Checked) flags.Add(AuraDev19b6.ShutdownLogo);
|
||||||
|
|
||||||
Aura.ApplyAuraPower(flags);
|
AsusUSB.ApplyAuraPower(flags);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
33
app/Fans.Designer.cs
generated
33
app/Fans.Designer.cs
generated
@@ -37,12 +37,15 @@ namespace GHelper
|
|||||||
Title title2 = new Title();
|
Title title2 = new Title();
|
||||||
ChartArea chartArea3 = new ChartArea();
|
ChartArea chartArea3 = new ChartArea();
|
||||||
Title title3 = new Title();
|
Title title3 = new Title();
|
||||||
|
ChartArea chartArea4 = new ChartArea();
|
||||||
|
Title title4 = new Title();
|
||||||
panelFans = new Panel();
|
panelFans = new Panel();
|
||||||
labelTip = new Label();
|
labelTip = new Label();
|
||||||
tableFanCharts = new TableLayoutPanel();
|
tableFanCharts = new TableLayoutPanel();
|
||||||
chartGPU = new Chart();
|
chartGPU = new Chart();
|
||||||
chartCPU = new Chart();
|
chartCPU = new Chart();
|
||||||
chartMid = new Chart();
|
chartMid = new Chart();
|
||||||
|
chartXGM = new Chart();
|
||||||
panelTitleFans = new Panel();
|
panelTitleFans = new Panel();
|
||||||
labelBoost = new Label();
|
labelBoost = new Label();
|
||||||
comboBoost = new RComboBox();
|
comboBoost = new RComboBox();
|
||||||
@@ -93,6 +96,7 @@ namespace GHelper
|
|||||||
((System.ComponentModel.ISupportInitialize)chartGPU).BeginInit();
|
((System.ComponentModel.ISupportInitialize)chartGPU).BeginInit();
|
||||||
((System.ComponentModel.ISupportInitialize)chartCPU).BeginInit();
|
((System.ComponentModel.ISupportInitialize)chartCPU).BeginInit();
|
||||||
((System.ComponentModel.ISupportInitialize)chartMid).BeginInit();
|
((System.ComponentModel.ISupportInitialize)chartMid).BeginInit();
|
||||||
|
((System.ComponentModel.ISupportInitialize)chartXGM).BeginInit();
|
||||||
panelTitleFans.SuspendLayout();
|
panelTitleFans.SuspendLayout();
|
||||||
((System.ComponentModel.ISupportInitialize)picturePerf).BeginInit();
|
((System.ComponentModel.ISupportInitialize)picturePerf).BeginInit();
|
||||||
panelApplyFans.SuspendLayout();
|
panelApplyFans.SuspendLayout();
|
||||||
@@ -121,6 +125,7 @@ namespace GHelper
|
|||||||
// panelFans
|
// panelFans
|
||||||
//
|
//
|
||||||
panelFans.AutoSize = true;
|
panelFans.AutoSize = true;
|
||||||
|
panelFans.AutoSizeMode = AutoSizeMode.GrowAndShrink;
|
||||||
panelFans.Controls.Add(labelTip);
|
panelFans.Controls.Add(labelTip);
|
||||||
panelFans.Controls.Add(tableFanCharts);
|
panelFans.Controls.Add(tableFanCharts);
|
||||||
panelFans.Controls.Add(panelTitleFans);
|
panelFans.Controls.Add(panelTitleFans);
|
||||||
@@ -154,16 +159,20 @@ namespace GHelper
|
|||||||
tableFanCharts.ColumnStyles.Add(new ColumnStyle(SizeType.Percent, 100F));
|
tableFanCharts.ColumnStyles.Add(new ColumnStyle(SizeType.Percent, 100F));
|
||||||
tableFanCharts.Controls.Add(chartGPU, 0, 1);
|
tableFanCharts.Controls.Add(chartGPU, 0, 1);
|
||||||
tableFanCharts.Controls.Add(chartCPU, 0, 0);
|
tableFanCharts.Controls.Add(chartCPU, 0, 0);
|
||||||
|
|
||||||
|
tableFanCharts.Controls.Add(chartXGM, 0, 2);
|
||||||
tableFanCharts.Controls.Add(chartMid, 0, 2);
|
tableFanCharts.Controls.Add(chartMid, 0, 2);
|
||||||
|
|
||||||
tableFanCharts.Dock = DockStyle.Fill;
|
tableFanCharts.Dock = DockStyle.Fill;
|
||||||
tableFanCharts.Location = new Point(0, 66);
|
tableFanCharts.Location = new Point(0, 66);
|
||||||
tableFanCharts.Margin = new Padding(4);
|
tableFanCharts.Margin = new Padding(4);
|
||||||
tableFanCharts.Name = "tableFanCharts";
|
tableFanCharts.Name = "tableFanCharts";
|
||||||
tableFanCharts.Padding = new Padding(10, 0, 10, 10);
|
tableFanCharts.Padding = new Padding(10, 0, 10, 10);
|
||||||
tableFanCharts.RowCount = 2;
|
tableFanCharts.RowCount = 2;
|
||||||
tableFanCharts.RowStyles.Add(new RowStyle(SizeType.Percent, 33F));
|
tableFanCharts.RowStyles.Add(new RowStyle(SizeType.Percent, 25F));
|
||||||
tableFanCharts.RowStyles.Add(new RowStyle(SizeType.Percent, 33F));
|
tableFanCharts.RowStyles.Add(new RowStyle(SizeType.Percent, 25F));
|
||||||
tableFanCharts.RowStyles.Add(new RowStyle(SizeType.Percent, 33F));
|
tableFanCharts.RowStyles.Add(new RowStyle(SizeType.Percent, 25F));
|
||||||
|
tableFanCharts.RowStyles.Add(new RowStyle(SizeType.Percent, 25F));
|
||||||
tableFanCharts.Size = new Size(805, 1007);
|
tableFanCharts.Size = new Size(805, 1007);
|
||||||
tableFanCharts.TabIndex = 36;
|
tableFanCharts.TabIndex = 36;
|
||||||
//
|
//
|
||||||
@@ -210,6 +219,20 @@ namespace GHelper
|
|||||||
chartMid.Titles.Add(title3);
|
chartMid.Titles.Add(title3);
|
||||||
chartMid.Visible = false;
|
chartMid.Visible = false;
|
||||||
//
|
//
|
||||||
|
// chartXGM
|
||||||
|
//
|
||||||
|
chartArea4.Name = "ChartAreaXGM";
|
||||||
|
chartXGM.ChartAreas.Add(chartArea4);
|
||||||
|
chartXGM.Dock = DockStyle.Fill;
|
||||||
|
chartXGM.Location = new Point(12, 674);
|
||||||
|
chartXGM.Margin = new Padding(2, 10, 2, 10);
|
||||||
|
chartXGM.Name = "chartXGM";
|
||||||
|
chartXGM.Size = new Size(781, 313);
|
||||||
|
chartXGM.TabIndex = 14;
|
||||||
|
chartXGM.Text = "chartXGM";
|
||||||
|
title4.Name = "Title4";
|
||||||
|
chartXGM.Titles.Add(title4);
|
||||||
|
chartXGM.Visible = false; //
|
||||||
// panelTitleFans
|
// panelTitleFans
|
||||||
//
|
//
|
||||||
panelTitleFans.Controls.Add(labelBoost);
|
panelTitleFans.Controls.Add(labelBoost);
|
||||||
@@ -763,7 +786,7 @@ namespace GHelper
|
|||||||
AutoScaleMode = AutoScaleMode.Dpi;
|
AutoScaleMode = AutoScaleMode.Dpi;
|
||||||
AutoSize = true;
|
AutoSize = true;
|
||||||
AutoSizeMode = AutoSizeMode.GrowAndShrink;
|
AutoSizeMode = AutoSizeMode.GrowAndShrink;
|
||||||
ClientSize = new Size(1356, 1189);
|
ClientSize = new Size(1340, 1189);
|
||||||
Controls.Add(panelFans);
|
Controls.Add(panelFans);
|
||||||
Controls.Add(panelSliders);
|
Controls.Add(panelSliders);
|
||||||
Margin = new Padding(4, 2, 4, 2);
|
Margin = new Padding(4, 2, 4, 2);
|
||||||
@@ -782,6 +805,7 @@ namespace GHelper
|
|||||||
((System.ComponentModel.ISupportInitialize)chartGPU).EndInit();
|
((System.ComponentModel.ISupportInitialize)chartGPU).EndInit();
|
||||||
((System.ComponentModel.ISupportInitialize)chartCPU).EndInit();
|
((System.ComponentModel.ISupportInitialize)chartCPU).EndInit();
|
||||||
((System.ComponentModel.ISupportInitialize)chartMid).EndInit();
|
((System.ComponentModel.ISupportInitialize)chartMid).EndInit();
|
||||||
|
((System.ComponentModel.ISupportInitialize)chartXGM).EndInit();
|
||||||
panelTitleFans.ResumeLayout(false);
|
panelTitleFans.ResumeLayout(false);
|
||||||
((System.ComponentModel.ISupportInitialize)picturePerf).EndInit();
|
((System.ComponentModel.ISupportInitialize)picturePerf).EndInit();
|
||||||
panelApplyFans.ResumeLayout(false);
|
panelApplyFans.ResumeLayout(false);
|
||||||
@@ -829,6 +853,7 @@ namespace GHelper
|
|||||||
private Chart chartGPU;
|
private Chart chartGPU;
|
||||||
private Chart chartCPU;
|
private Chart chartCPU;
|
||||||
private Chart chartMid;
|
private Chart chartMid;
|
||||||
|
private Chart chartXGM;
|
||||||
private Label labelTip;
|
private Label labelTip;
|
||||||
private Panel panelPower;
|
private Panel panelPower;
|
||||||
private Label labelInfo;
|
private Label labelInfo;
|
||||||
|
|||||||
162
app/Fans.cs
162
app/Fans.cs
@@ -12,6 +12,7 @@ namespace GHelper
|
|||||||
Series seriesCPU;
|
Series seriesCPU;
|
||||||
Series seriesGPU;
|
Series seriesGPU;
|
||||||
Series seriesMid;
|
Series seriesMid;
|
||||||
|
Series seriesXGM;
|
||||||
|
|
||||||
static int MinRPM, MaxRPM;
|
static int MinRPM, MaxRPM;
|
||||||
|
|
||||||
@@ -53,10 +54,12 @@ namespace GHelper
|
|||||||
seriesCPU = chartCPU.Series.Add("CPU");
|
seriesCPU = chartCPU.Series.Add("CPU");
|
||||||
seriesGPU = chartGPU.Series.Add("GPU");
|
seriesGPU = chartGPU.Series.Add("GPU");
|
||||||
seriesMid = chartMid.Series.Add("Mid");
|
seriesMid = chartMid.Series.Add("Mid");
|
||||||
|
seriesXGM = chartXGM.Series.Add("XGM");
|
||||||
|
|
||||||
seriesCPU.Color = colorStandard;
|
seriesCPU.Color = colorStandard;
|
||||||
seriesGPU.Color = colorTurbo;
|
seriesGPU.Color = colorTurbo;
|
||||||
seriesMid.Color = colorEco;
|
seriesMid.Color = colorEco;
|
||||||
|
seriesXGM.Color = Color.Orange;
|
||||||
|
|
||||||
chartCPU.MouseMove += ChartCPU_MouseMove;
|
chartCPU.MouseMove += ChartCPU_MouseMove;
|
||||||
chartCPU.MouseUp += ChartCPU_MouseUp;
|
chartCPU.MouseUp += ChartCPU_MouseUp;
|
||||||
@@ -67,13 +70,16 @@ namespace GHelper
|
|||||||
chartMid.MouseMove += ChartCPU_MouseMove;
|
chartMid.MouseMove += ChartCPU_MouseMove;
|
||||||
chartMid.MouseUp += ChartCPU_MouseUp;
|
chartMid.MouseUp += ChartCPU_MouseUp;
|
||||||
|
|
||||||
|
chartXGM.MouseMove += ChartCPU_MouseMove;
|
||||||
|
chartXGM.MouseUp += ChartCPU_MouseUp;
|
||||||
|
|
||||||
buttonReset.Click += ButtonReset_Click;
|
buttonReset.Click += ButtonReset_Click;
|
||||||
|
|
||||||
trackTotal.Maximum = ASUSWmi.MaxTotal;
|
trackTotal.Maximum = AsusACPI.MaxTotal;
|
||||||
trackTotal.Minimum = ASUSWmi.MinTotal;
|
trackTotal.Minimum = AsusACPI.MinTotal;
|
||||||
|
|
||||||
trackCPU.Maximum = ASUSWmi.MaxCPU;
|
trackCPU.Maximum = AsusACPI.MaxCPU;
|
||||||
trackCPU.Minimum = ASUSWmi.MinCPU;
|
trackCPU.Minimum = AsusACPI.MinCPU;
|
||||||
|
|
||||||
trackCPU.Scroll += TrackPower_Scroll;
|
trackCPU.Scroll += TrackPower_Scroll;
|
||||||
trackTotal.Scroll += TrackPower_Scroll;
|
trackTotal.Scroll += TrackPower_Scroll;
|
||||||
@@ -90,11 +96,11 @@ namespace GHelper
|
|||||||
trackGPUMemory.Minimum = NvidiaGpuControl.MinMemoryOffset;
|
trackGPUMemory.Minimum = NvidiaGpuControl.MinMemoryOffset;
|
||||||
trackGPUMemory.Maximum = NvidiaGpuControl.MaxMemoryOffset;
|
trackGPUMemory.Maximum = NvidiaGpuControl.MaxMemoryOffset;
|
||||||
|
|
||||||
trackGPUBoost.Minimum = ASUSWmi.MinGPUBoost;
|
trackGPUBoost.Minimum = AsusACPI.MinGPUBoost;
|
||||||
trackGPUBoost.Maximum = ASUSWmi.MaxGPUBoost;
|
trackGPUBoost.Maximum = AsusACPI.MaxGPUBoost;
|
||||||
|
|
||||||
trackGPUTemp.Minimum = ASUSWmi.MinGPUTemp;
|
trackGPUTemp.Minimum = AsusACPI.MinGPUTemp;
|
||||||
trackGPUTemp.Maximum = ASUSWmi.MaxGPUTemp;
|
trackGPUTemp.Maximum = AsusACPI.MaxGPUTemp;
|
||||||
|
|
||||||
trackGPUCore.Scroll += trackGPU_Scroll;
|
trackGPUCore.Scroll += trackGPU_Scroll;
|
||||||
trackGPUMemory.Scroll += trackGPU_Scroll;
|
trackGPUMemory.Scroll += trackGPU_Scroll;
|
||||||
@@ -151,8 +157,8 @@ namespace GHelper
|
|||||||
int core = Program.config.getConfigPerf("gpu_core");
|
int core = Program.config.getConfigPerf("gpu_core");
|
||||||
int memory = Program.config.getConfigPerf("gpu_memory");
|
int memory = Program.config.getConfigPerf("gpu_memory");
|
||||||
|
|
||||||
if (gpu_boost < 0) gpu_boost = ASUSWmi.MaxGPUBoost;
|
if (gpu_boost < 0) gpu_boost = AsusACPI.MaxGPUBoost;
|
||||||
if (gpu_temp < 0) gpu_temp = ASUSWmi.MaxGPUTemp;
|
if (gpu_temp < 0) gpu_temp = AsusACPI.MaxGPUTemp;
|
||||||
|
|
||||||
if (core == -1) core = 0;
|
if (core == -1) core = 0;
|
||||||
if (memory == -1) memory = 0;
|
if (memory == -1) memory = 0;
|
||||||
@@ -180,11 +186,11 @@ namespace GHelper
|
|||||||
trackGPUCore.Value = Math.Max(Math.Min(core, NvidiaGpuControl.MaxCoreOffset), NvidiaGpuControl.MinCoreOffset);
|
trackGPUCore.Value = Math.Max(Math.Min(core, NvidiaGpuControl.MaxCoreOffset), NvidiaGpuControl.MinCoreOffset);
|
||||||
trackGPUMemory.Value = Math.Max(Math.Min(memory, NvidiaGpuControl.MaxMemoryOffset), NvidiaGpuControl.MinMemoryOffset);
|
trackGPUMemory.Value = Math.Max(Math.Min(memory, NvidiaGpuControl.MaxMemoryOffset), NvidiaGpuControl.MinMemoryOffset);
|
||||||
|
|
||||||
trackGPUBoost.Value = Math.Max(Math.Min(gpu_boost, ASUSWmi.MaxGPUBoost), ASUSWmi.MinGPUBoost);
|
trackGPUBoost.Value = Math.Max(Math.Min(gpu_boost, AsusACPI.MaxGPUBoost), AsusACPI.MinGPUBoost);
|
||||||
trackGPUTemp.Value = Math.Max(Math.Min(gpu_temp, ASUSWmi.MaxGPUTemp), ASUSWmi.MinGPUTemp);
|
trackGPUTemp.Value = Math.Max(Math.Min(gpu_temp, AsusACPI.MaxGPUTemp), AsusACPI.MinGPUTemp);
|
||||||
|
|
||||||
panelGPUBoost.Visible = (Program.wmi.DeviceGet(ASUSWmi.PPT_GPUC0) >= 0);
|
panelGPUBoost.Visible = (Program.acpi.DeviceGet(AsusACPI.PPT_GPUC0) >= 0);
|
||||||
panelGPUTemp.Visible = (Program.wmi.DeviceGet(ASUSWmi.PPT_GPUC2) >= 0);
|
panelGPUTemp.Visible = (Program.acpi.DeviceGet(AsusACPI.PPT_GPUC2) >= 0);
|
||||||
|
|
||||||
VisualiseGPUSettings();
|
VisualiseGPUSettings();
|
||||||
|
|
||||||
@@ -233,17 +239,26 @@ namespace GHelper
|
|||||||
return (200 * Math.Round((float)(MinRPM * 100 + (MaxRPM - MinRPM) * percentage) / 200)).ToString() + unit;
|
return (200 * Math.Round((float)(MinRPM * 100 + (MaxRPM - MinRPM) * percentage) / 200)).ToString() + unit;
|
||||||
}
|
}
|
||||||
|
|
||||||
void SetChart(Chart chart, int device)
|
void SetChart(Chart chart, AsusFan device)
|
||||||
{
|
{
|
||||||
|
|
||||||
string title;
|
string title = "";
|
||||||
|
|
||||||
if (device == 1)
|
switch (device)
|
||||||
title = Properties.Strings.FanProfileGPU;
|
{
|
||||||
else if (device == 2)
|
case AsusFan.CPU:
|
||||||
title = Properties.Strings.FanProfileMid;
|
title = Properties.Strings.FanProfileCPU;
|
||||||
else
|
break;
|
||||||
title = Properties.Strings.FanProfileCPU;
|
case AsusFan.GPU:
|
||||||
|
title = Properties.Strings.FanProfileGPU;
|
||||||
|
break;
|
||||||
|
case AsusFan.Mid:
|
||||||
|
title = Properties.Strings.FanProfileMid;
|
||||||
|
break;
|
||||||
|
case AsusFan.XGM:
|
||||||
|
title = "XG Mobile";
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
|
||||||
if (Program.settingsForm.perfName.Length > 0)
|
if (Program.settingsForm.perfName.Length > 0)
|
||||||
labelFans.Text = Properties.Strings.FanProfiles + ": " + Program.settingsForm.perfName;
|
labelFans.Text = Properties.Strings.FanProfiles + ": " + Program.settingsForm.perfName;
|
||||||
@@ -330,7 +345,7 @@ namespace GHelper
|
|||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
Program.wmi.DeviceSet(ASUSWmi.PerformanceMode, Program.config.getConfig("performance_mode"), "PerfMode");
|
Program.acpi.DeviceSet(AsusACPI.PerformanceMode, Program.config.getConfig("performance_mode"), "PerfMode");
|
||||||
Program.settingsForm.AutoFans();
|
Program.settingsForm.AutoFans();
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -349,7 +364,7 @@ namespace GHelper
|
|||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
Program.wmi.DeviceSet(ASUSWmi.PerformanceMode, Program.config.getConfig("performance_mode"), "PerfMode");
|
Program.acpi.DeviceSet(AsusACPI.PerformanceMode, Program.config.getConfig("performance_mode"), "PerfMode");
|
||||||
Program.settingsForm.AutoPower();
|
Program.settingsForm.AutoPower();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -376,8 +391,8 @@ namespace GHelper
|
|||||||
public void InitPower(bool changed = false)
|
public void InitPower(bool changed = false)
|
||||||
{
|
{
|
||||||
|
|
||||||
bool cpuBmode = (Program.wmi.DeviceGet(ASUSWmi.PPT_CPUB0) >= 0); // 2022 model +
|
bool cpuBmode = (Program.acpi.DeviceGet(AsusACPI.PPT_CPUB0) >= 0); // 2022 model +
|
||||||
bool cpuAmode = (Program.wmi.DeviceGet(ASUSWmi.PPT_TotalA0) >= 0); // 2021 model +
|
bool cpuAmode = (Program.acpi.DeviceGet(AsusACPI.PPT_TotalA0) >= 0); // 2021 model +
|
||||||
|
|
||||||
panelPower.Visible = cpuAmode;
|
panelPower.Visible = cpuAmode;
|
||||||
panelCPU.Visible = cpuBmode;
|
panelCPU.Visible = cpuBmode;
|
||||||
@@ -403,13 +418,13 @@ namespace GHelper
|
|||||||
limit_cpu = Program.config.getConfigPerf("limit_cpu");
|
limit_cpu = Program.config.getConfigPerf("limit_cpu");
|
||||||
}
|
}
|
||||||
|
|
||||||
if (limit_total < 0) limit_total = ASUSWmi.DefaultTotal;
|
if (limit_total < 0) limit_total = AsusACPI.DefaultTotal;
|
||||||
if (limit_total > ASUSWmi.MaxTotal) limit_total = ASUSWmi.MaxTotal;
|
if (limit_total > AsusACPI.MaxTotal) limit_total = AsusACPI.MaxTotal;
|
||||||
if (limit_total < ASUSWmi.MinTotal) limit_total = ASUSWmi.MinTotal;
|
if (limit_total < AsusACPI.MinTotal) limit_total = AsusACPI.MinTotal;
|
||||||
|
|
||||||
if (limit_cpu < 0) limit_cpu = ASUSWmi.DefaultCPU;
|
if (limit_cpu < 0) limit_cpu = AsusACPI.DefaultCPU;
|
||||||
if (limit_cpu > ASUSWmi.MaxCPU) limit_cpu = ASUSWmi.MaxCPU;
|
if (limit_cpu > AsusACPI.MaxCPU) limit_cpu = AsusACPI.MaxCPU;
|
||||||
if (limit_cpu < ASUSWmi.MinCPU) limit_cpu = ASUSWmi.MinCPU;
|
if (limit_cpu < AsusACPI.MinCPU) limit_cpu = AsusACPI.MinCPU;
|
||||||
if (limit_cpu > limit_total) limit_cpu = limit_total;
|
if (limit_cpu > limit_total) limit_cpu = limit_total;
|
||||||
|
|
||||||
trackTotal.Value = limit_total;
|
trackTotal.Value = limit_total;
|
||||||
@@ -435,27 +450,43 @@ namespace GHelper
|
|||||||
public void InitFans()
|
public void InitFans()
|
||||||
{
|
{
|
||||||
|
|
||||||
byte[] curve = Program.wmi.GetFanCurve(2);
|
int chartCount = 2;
|
||||||
|
|
||||||
if (curve.All(singleByte => singleByte == 0))
|
// Middle / system fan check
|
||||||
|
if (!AsusACPI.IsEmptyCurve(Program.acpi.GetFanCurve(AsusFan.Mid)))
|
||||||
{
|
{
|
||||||
Program.config.setConfig("mid_fan", 0);
|
Program.config.setConfig("mid_fan", 1);
|
||||||
|
chartCount++;
|
||||||
|
chartMid.Visible = true;
|
||||||
|
SetChart(chartMid, AsusFan.Mid);
|
||||||
|
LoadProfile(seriesMid, AsusFan.Mid);
|
||||||
|
MinimumSize = new Size(0, chartCount * 400 + 200);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
Program.config.setConfig("mid_fan", 1);
|
Program.config.setConfig("mid_fan", 0);
|
||||||
chartMid.Visible = true;
|
|
||||||
SetChart(chartMid, 2);
|
|
||||||
LoadProfile(seriesMid, 2);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// XG Mobile Fan check
|
||||||
|
if (Program.acpi.IsXGConnected())
|
||||||
|
{
|
||||||
|
Program.config.setConfig("xgm_fan", 1);
|
||||||
|
chartCount++;
|
||||||
|
chartXGM.Visible = true;
|
||||||
|
SetChart(chartXGM, AsusFan.XGM);
|
||||||
|
LoadProfile(seriesXGM, AsusFan.XGM);
|
||||||
|
MinimumSize = new Size(0, chartCount * 400 + 200);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
Program.config.setConfig("xgm_fan", 0);
|
||||||
|
}
|
||||||
|
|
||||||
SetChart(chartCPU, 0);
|
SetChart(chartCPU, AsusFan.CPU);
|
||||||
SetChart(chartGPU, 1);
|
SetChart(chartGPU, AsusFan.GPU);
|
||||||
|
|
||||||
LoadProfile(seriesCPU, 0);
|
LoadProfile(seriesCPU, AsusFan.CPU);
|
||||||
LoadProfile(seriesGPU, 1);
|
LoadProfile(seriesGPU, AsusFan.GPU);
|
||||||
|
|
||||||
int auto_apply = Program.config.getConfigPerf("auto_apply");
|
int auto_apply = Program.config.getConfigPerf("auto_apply");
|
||||||
|
|
||||||
@@ -464,7 +495,7 @@ namespace GHelper
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
void LoadProfile(Series series, int device, int def = 0)
|
void LoadProfile(Series series, AsusFan device, bool reset = false)
|
||||||
{
|
{
|
||||||
|
|
||||||
series.ChartType = SeriesChartType.Line;
|
series.ChartType = SeriesChartType.Line;
|
||||||
@@ -476,14 +507,14 @@ namespace GHelper
|
|||||||
int mode = Program.config.getConfig("performance_mode");
|
int mode = Program.config.getConfig("performance_mode");
|
||||||
byte[] curve = Program.config.getFanConfig(device);
|
byte[] curve = Program.config.getFanConfig(device);
|
||||||
|
|
||||||
if (def == 1 || ASUSWmi.IsEmptyCurve(curve))
|
if (reset || AsusACPI.IsEmptyCurve(curve))
|
||||||
{
|
{
|
||||||
curve = Program.wmi.GetFanCurve(device, mode);
|
curve = Program.acpi.GetFanCurve(device, mode);
|
||||||
|
|
||||||
if (ASUSWmi.IsEmptyCurve(curve))
|
if (AsusACPI.IsEmptyCurve(curve))
|
||||||
curve = Program.config.getDefaultCurve(device);
|
curve = Program.config.getDefaultCurve(device);
|
||||||
|
|
||||||
curve = ASUSWmi.FixFanCurve(curve);
|
curve = AsusACPI.FixFanCurve(curve);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -501,7 +532,7 @@ namespace GHelper
|
|||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void SaveProfile(Series series, int device)
|
void SaveProfile(Series series, AsusFan device)
|
||||||
{
|
{
|
||||||
byte[] curve = new byte[16];
|
byte[] curve = new byte[16];
|
||||||
int i = 0;
|
int i = 0;
|
||||||
@@ -521,10 +552,14 @@ namespace GHelper
|
|||||||
private void ButtonReset_Click(object? sender, EventArgs e)
|
private void ButtonReset_Click(object? sender, EventArgs e)
|
||||||
{
|
{
|
||||||
|
|
||||||
LoadProfile(seriesCPU, 0, 1);
|
LoadProfile(seriesCPU, AsusFan.CPU, true);
|
||||||
LoadProfile(seriesGPU, 1, 1);
|
LoadProfile(seriesGPU, AsusFan.GPU, true);
|
||||||
if (Program.config.getConfig("mid_fan") == 1)
|
|
||||||
LoadProfile(seriesMid, 2, 1);
|
if (Program.config.isConfig("mid_fan"))
|
||||||
|
LoadProfile(seriesMid, AsusFan.Mid, true);
|
||||||
|
|
||||||
|
if (Program.config.isConfig("xgm_fan"))
|
||||||
|
LoadProfile(seriesXGM, AsusFan.XGM, true);
|
||||||
|
|
||||||
checkApplyFans.Checked = false;
|
checkApplyFans.Checked = false;
|
||||||
checkApplyPower.Checked = false;
|
checkApplyPower.Checked = false;
|
||||||
@@ -532,12 +567,13 @@ namespace GHelper
|
|||||||
Program.config.setConfigPerf("auto_apply", 0);
|
Program.config.setConfigPerf("auto_apply", 0);
|
||||||
Program.config.setConfigPerf("auto_apply_power", 0);
|
Program.config.setConfigPerf("auto_apply_power", 0);
|
||||||
|
|
||||||
Program.wmi.DeviceSet(ASUSWmi.PerformanceMode, Program.config.getConfig("performance_mode"), "PerfMode");
|
Program.acpi.DeviceSet(AsusACPI.PerformanceMode, Program.config.getConfig("performance_mode"), "PerfMode");
|
||||||
|
if (Program.acpi.IsXGConnected()) AsusUSB.ResetXGM();
|
||||||
|
|
||||||
trackGPUCore.Value = 0;
|
trackGPUCore.Value = 0;
|
||||||
trackGPUMemory.Value = 0;
|
trackGPUMemory.Value = 0;
|
||||||
trackGPUBoost.Value = ASUSWmi.MaxGPUBoost;
|
trackGPUBoost.Value = AsusACPI.MaxGPUBoost;
|
||||||
trackGPUTemp.Value = ASUSWmi.MaxGPUTemp;
|
trackGPUTemp.Value = AsusACPI.MaxGPUTemp;
|
||||||
|
|
||||||
Program.config.setConfigPerf("gpu_boost", trackGPUBoost.Value);
|
Program.config.setConfigPerf("gpu_boost", trackGPUBoost.Value);
|
||||||
Program.config.setConfigPerf("gpu_temp", trackGPUTemp.Value);
|
Program.config.setConfigPerf("gpu_temp", trackGPUTemp.Value);
|
||||||
@@ -554,10 +590,14 @@ namespace GHelper
|
|||||||
curPoint = null;
|
curPoint = null;
|
||||||
labelTip.Visible = false;
|
labelTip.Visible = false;
|
||||||
|
|
||||||
SaveProfile(seriesCPU, 0);
|
SaveProfile(seriesCPU, AsusFan.CPU);
|
||||||
SaveProfile(seriesGPU, 1);
|
SaveProfile(seriesGPU, AsusFan.GPU);
|
||||||
if (Program.config.getConfig("mid_fan") == 1)
|
|
||||||
SaveProfile(seriesMid, 2);
|
if (Program.config.isConfig("mid_fan"))
|
||||||
|
SaveProfile(seriesMid, AsusFan.Mid);
|
||||||
|
|
||||||
|
if (Program.config.isConfig("xgm_fan"))
|
||||||
|
SaveProfile(seriesXGM, AsusFan.XGM);
|
||||||
|
|
||||||
Program.settingsForm.AutoFans();
|
Program.settingsForm.AutoFans();
|
||||||
|
|
||||||
|
|||||||
@@ -69,11 +69,11 @@ public static class HardwareControl
|
|||||||
gpuTemp = -1;
|
gpuTemp = -1;
|
||||||
gpuUse = -1;
|
gpuUse = -1;
|
||||||
|
|
||||||
cpuFan = FormatFan(Program.wmi.DeviceGet(ASUSWmi.CPU_Fan));
|
cpuFan = FormatFan(Program.acpi.DeviceGet(AsusACPI.CPU_Fan));
|
||||||
gpuFan = FormatFan(Program.wmi.DeviceGet(ASUSWmi.GPU_Fan));
|
gpuFan = FormatFan(Program.acpi.DeviceGet(AsusACPI.GPU_Fan));
|
||||||
midFan = FormatFan(Program.wmi.DeviceGet(ASUSWmi.Mid_Fan));
|
midFan = FormatFan(Program.acpi.DeviceGet(AsusACPI.Mid_Fan));
|
||||||
|
|
||||||
cpuTemp = Program.wmi.DeviceGet(ASUSWmi.Temp_CPU);
|
cpuTemp = Program.acpi.DeviceGet(AsusACPI.Temp_CPU);
|
||||||
|
|
||||||
if (cpuTemp < 0) try
|
if (cpuTemp < 0) try
|
||||||
{
|
{
|
||||||
@@ -99,7 +99,7 @@ public static class HardwareControl
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (gpuTemp is null || gpuTemp < 0)
|
if (gpuTemp is null || gpuTemp < 0)
|
||||||
gpuTemp = Program.wmi.DeviceGet(ASUSWmi.Temp_GPU);
|
gpuTemp = Program.acpi.DeviceGet(AsusACPI.Temp_GPU);
|
||||||
|
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -18,7 +18,7 @@ namespace GHelper
|
|||||||
Visible = true
|
Visible = true
|
||||||
};
|
};
|
||||||
|
|
||||||
public static ASUSWmi? wmi;
|
public static AsusACPI? acpi;
|
||||||
public static AppConfig config = new AppConfig();
|
public static AppConfig config = new AppConfig();
|
||||||
|
|
||||||
public static SettingsForm settingsForm = new SettingsForm();
|
public static SettingsForm settingsForm = new SettingsForm();
|
||||||
@@ -48,7 +48,7 @@ namespace GHelper
|
|||||||
|
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
wmi = new ASUSWmi();
|
acpi = new AsusACPI();
|
||||||
}
|
}
|
||||||
catch
|
catch
|
||||||
{
|
{
|
||||||
@@ -73,7 +73,7 @@ namespace GHelper
|
|||||||
|
|
||||||
trayIcon.MouseClick += TrayIcon_MouseClick;
|
trayIcon.MouseClick += TrayIcon_MouseClick;
|
||||||
|
|
||||||
wmi.SubscribeToEvents(WatcherEventArrived);
|
acpi.SubscribeToEvents(WatcherEventArrived);
|
||||||
|
|
||||||
settingsForm.InitAura();
|
settingsForm.InitAura();
|
||||||
settingsForm.InitMatrix();
|
settingsForm.InitMatrix();
|
||||||
@@ -268,12 +268,12 @@ namespace GHelper
|
|||||||
touchpadState = (key?.GetValue("Enabled")?.ToString() == "1");
|
touchpadState = (key?.GetValue("Enabled")?.ToString() == "1");
|
||||||
}
|
}
|
||||||
|
|
||||||
tabletState = wmi.DeviceGet(ASUSWmi.TabletState) > 0;
|
tabletState = acpi.DeviceGet(AsusACPI.TabletState) > 0;
|
||||||
|
|
||||||
Logger.WriteLine("Tablet: " + tabletState + " Touchpad: " + touchpadState);
|
Logger.WriteLine("Tablet: " + tabletState + " Touchpad: " + touchpadState);
|
||||||
|
|
||||||
if ((tabletState && touchpadState) || (!tabletState && !touchpadState))
|
if ((tabletState && touchpadState) || (!tabletState && !touchpadState))
|
||||||
wmi.DeviceSet(ASUSWmi.UniversalControl, ASUSWmi.Touchpad_Toggle, "Touchpad");
|
acpi.DeviceSet(AsusACPI.UniversalControl, AsusACPI.Touchpad_Toggle, "Touchpad");
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -154,7 +154,7 @@
|
|||||||
<value>套用功率限制</value>
|
<value>套用功率限制</value>
|
||||||
</data>
|
</data>
|
||||||
<data name="ApplyWindowsPowerPlan" xml:space="preserve">
|
<data name="ApplyWindowsPowerPlan" xml:space="preserve">
|
||||||
<value>Auto Adjust Windows Power Mode</value>
|
<value>自動調整Windows電源模式</value>
|
||||||
</data>
|
</data>
|
||||||
<data name="AuraBreathe" xml:space="preserve">
|
<data name="AuraBreathe" xml:space="preserve">
|
||||||
<value>呼吸</value>
|
<value>呼吸</value>
|
||||||
@@ -189,6 +189,9 @@
|
|||||||
<data name="Awake" xml:space="preserve">
|
<data name="Awake" xml:space="preserve">
|
||||||
<value>喚醒時</value>
|
<value>喚醒時</value>
|
||||||
</data>
|
</data>
|
||||||
|
<data name="BacklightTimeout" xml:space="preserve">
|
||||||
|
<value>電池模式下自動關閉背光的秒數</value>
|
||||||
|
</data>
|
||||||
<data name="Balanced" xml:space="preserve">
|
<data name="Balanced" xml:space="preserve">
|
||||||
<value>平衡模式</value>
|
<value>平衡模式</value>
|
||||||
</data>
|
</data>
|
||||||
@@ -255,12 +258,24 @@
|
|||||||
<data name="FansAndPower" xml:space="preserve">
|
<data name="FansAndPower" xml:space="preserve">
|
||||||
<value>風扇和電源</value>
|
<value>風扇和電源</value>
|
||||||
</data>
|
</data>
|
||||||
|
<data name="FanSpeed" xml:space="preserve">
|
||||||
|
<value> 風扇: </value>
|
||||||
|
</data>
|
||||||
<data name="FansPower" xml:space="preserve">
|
<data name="FansPower" xml:space="preserve">
|
||||||
<value>自定義設置</value>
|
<value>自定義設置</value>
|
||||||
</data>
|
</data>
|
||||||
|
<data name="GPUBoost" xml:space="preserve">
|
||||||
|
<value>Dynamic Boost</value>
|
||||||
|
</data>
|
||||||
<data name="GPUChanging" xml:space="preserve">
|
<data name="GPUChanging" xml:space="preserve">
|
||||||
<value>切換中...</value>
|
<value>切換中...</value>
|
||||||
</data>
|
</data>
|
||||||
|
<data name="GPUCoreClockOffset" xml:space="preserve">
|
||||||
|
<value>核心時脈偏移量(Offset)</value>
|
||||||
|
</data>
|
||||||
|
<data name="GPUMemoryClockOffset" xml:space="preserve">
|
||||||
|
<value>顯示卡記憶體偏移量(Offset)</value>
|
||||||
|
</data>
|
||||||
<data name="GPUMode" xml:space="preserve">
|
<data name="GPUMode" xml:space="preserve">
|
||||||
<value>GPU 模式</value>
|
<value>GPU 模式</value>
|
||||||
</data>
|
</data>
|
||||||
@@ -273,6 +288,12 @@
|
|||||||
<data name="GPUModeUltimate" xml:space="preserve">
|
<data name="GPUModeUltimate" xml:space="preserve">
|
||||||
<value>獨立顯卡</value>
|
<value>獨立顯卡</value>
|
||||||
</data>
|
</data>
|
||||||
|
<data name="GPUSettings" xml:space="preserve">
|
||||||
|
<value>顯卡設定</value>
|
||||||
|
</data>
|
||||||
|
<data name="GPUTempTarget" xml:space="preserve">
|
||||||
|
<value>GPU溫度上限</value>
|
||||||
|
</data>
|
||||||
<data name="KeyBindings" xml:space="preserve">
|
<data name="KeyBindings" xml:space="preserve">
|
||||||
<value>按鍵綁定</value>
|
<value>按鍵綁定</value>
|
||||||
</data>
|
</data>
|
||||||
@@ -291,6 +312,18 @@
|
|||||||
<data name="LaptopScreen" xml:space="preserve">
|
<data name="LaptopScreen" xml:space="preserve">
|
||||||
<value>螢幕顯示</value>
|
<value>螢幕顯示</value>
|
||||||
</data>
|
</data>
|
||||||
|
<data name="Lid" xml:space="preserve">
|
||||||
|
<value>螢幕背蓋</value>
|
||||||
|
</data>
|
||||||
|
<data name="Lightbar" xml:space="preserve">
|
||||||
|
<value>燈條</value>
|
||||||
|
</data>
|
||||||
|
<data name="Logo" xml:space="preserve">
|
||||||
|
<value>Logo</value>
|
||||||
|
</data>
|
||||||
|
<data name="MatrixAudio" xml:space="preserve">
|
||||||
|
<value>Audio Visualizer</value>
|
||||||
|
</data>
|
||||||
<data name="MatrixBanner" xml:space="preserve">
|
<data name="MatrixBanner" xml:space="preserve">
|
||||||
<value>横幅</value>
|
<value>横幅</value>
|
||||||
</data>
|
</data>
|
||||||
@@ -333,6 +366,9 @@
|
|||||||
<data name="OptimizedGPUTooltip" xml:space="preserve">
|
<data name="OptimizedGPUTooltip" xml:space="preserve">
|
||||||
<value>使用電池切換到節能模式,插入電源時切換到標準模式</value>
|
<value>使用電池切換到節能模式,插入電源時切換到標準模式</value>
|
||||||
</data>
|
</data>
|
||||||
|
<data name="OptimizedUSBC" xml:space="preserve">
|
||||||
|
<value>自動模式下,使用USB-C充電時持續關閉獨顯</value>
|
||||||
|
</data>
|
||||||
<data name="Other" xml:space="preserve">
|
<data name="Other" xml:space="preserve">
|
||||||
<value>其他</value>
|
<value>其他</value>
|
||||||
</data>
|
</data>
|
||||||
@@ -360,6 +396,9 @@
|
|||||||
<data name="Quit" xml:space="preserve">
|
<data name="Quit" xml:space="preserve">
|
||||||
<value>退出</value>
|
<value>退出</value>
|
||||||
</data>
|
</data>
|
||||||
|
<data name="RestartGPU" xml:space="preserve">
|
||||||
|
<value>有其他程式正在使用獨顯導致無法切換至節能模式. 是否在裝置管理員中重啟獨顯? * 請自行評估風險</value>
|
||||||
|
</data>
|
||||||
<data name="RPM" xml:space="preserve">
|
<data name="RPM" xml:space="preserve">
|
||||||
<value>每分鐘轉數</value>
|
<value>每分鐘轉數</value>
|
||||||
</data>
|
</data>
|
||||||
@@ -387,6 +426,12 @@
|
|||||||
<data name="ToggleAura" xml:space="preserve">
|
<data name="ToggleAura" xml:space="preserve">
|
||||||
<value>切換Aura</value>
|
<value>切換Aura</value>
|
||||||
</data>
|
</data>
|
||||||
|
<data name="ToggleMiniled" xml:space="preserve">
|
||||||
|
<value>切換Miniled(若有支援)</value>
|
||||||
|
</data>
|
||||||
|
<data name="ToggleScreen" xml:space="preserve">
|
||||||
|
<value>切換螢幕</value>
|
||||||
|
</data>
|
||||||
<data name="Turbo" xml:space="preserve">
|
<data name="Turbo" xml:space="preserve">
|
||||||
<value>極速模式</value>
|
<value>極速模式</value>
|
||||||
</data>
|
</data>
|
||||||
|
|||||||
170
app/Settings.cs
170
app/Settings.cs
@@ -265,13 +265,13 @@ namespace GHelper
|
|||||||
|
|
||||||
private void ButtonXGM_Click(object? sender, EventArgs e)
|
private void ButtonXGM_Click(object? sender, EventArgs e)
|
||||||
{
|
{
|
||||||
if (Program.wmi.DeviceGet(ASUSWmi.GPUXG) == 1)
|
if (Program.acpi.DeviceGet(AsusACPI.GPUXG) == 1)
|
||||||
{
|
{
|
||||||
Program.wmi.DeviceSet(ASUSWmi.GPUXG, 0, "GPU XGM");
|
Program.acpi.DeviceSet(AsusACPI.GPUXG, 0, "GPU XGM");
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
Program.wmi.DeviceSet(ASUSWmi.GPUXG, 1, "GPU XGM");
|
Program.acpi.DeviceSet(AsusACPI.GPUXG, 1, "GPU XGM");
|
||||||
}
|
}
|
||||||
InitXGM();
|
InitXGM();
|
||||||
}
|
}
|
||||||
@@ -637,21 +637,21 @@ namespace GHelper
|
|||||||
|
|
||||||
public void InitAura()
|
public void InitAura()
|
||||||
{
|
{
|
||||||
Aura.Mode = Program.config.getConfig("aura_mode");
|
AsusUSB.Mode = Program.config.getConfig("aura_mode");
|
||||||
Aura.Speed = Program.config.getConfig("aura_speed");
|
AsusUSB.Speed = Program.config.getConfig("aura_speed");
|
||||||
Aura.SetColor(Program.config.getConfig("aura_color"));
|
AsusUSB.SetColor(Program.config.getConfig("aura_color"));
|
||||||
Aura.SetColor2(Program.config.getConfig("aura_color2"));
|
AsusUSB.SetColor2(Program.config.getConfig("aura_color2"));
|
||||||
|
|
||||||
comboKeyboard.DropDownStyle = ComboBoxStyle.DropDownList;
|
comboKeyboard.DropDownStyle = ComboBoxStyle.DropDownList;
|
||||||
comboKeyboard.DataSource = new BindingSource(Aura.GetModes(), null);
|
comboKeyboard.DataSource = new BindingSource(AsusUSB.GetModes(), null);
|
||||||
comboKeyboard.DisplayMember = "Value";
|
comboKeyboard.DisplayMember = "Value";
|
||||||
comboKeyboard.ValueMember = "Key";
|
comboKeyboard.ValueMember = "Key";
|
||||||
comboKeyboard.SelectedValue = Aura.Mode;
|
comboKeyboard.SelectedValue = AsusUSB.Mode;
|
||||||
comboKeyboard.SelectedValueChanged += ComboKeyboard_SelectedValueChanged;
|
comboKeyboard.SelectedValueChanged += ComboKeyboard_SelectedValueChanged;
|
||||||
|
|
||||||
pictureColor.BackColor = Aura.Color1;
|
pictureColor.BackColor = AsusUSB.Color1;
|
||||||
pictureColor2.BackColor = Aura.Color2;
|
pictureColor2.BackColor = AsusUSB.Color2;
|
||||||
pictureColor2.Visible = Aura.HasSecondColor();
|
pictureColor2.Visible = AsusUSB.HasSecondColor();
|
||||||
}
|
}
|
||||||
|
|
||||||
public void InitMatrix()
|
public void InitMatrix()
|
||||||
@@ -679,16 +679,16 @@ namespace GHelper
|
|||||||
|
|
||||||
public void SetAura()
|
public void SetAura()
|
||||||
{
|
{
|
||||||
Aura.Mode = Program.config.getConfig("aura_mode");
|
AsusUSB.Mode = Program.config.getConfig("aura_mode");
|
||||||
Aura.Speed = Program.config.getConfig("aura_speed");
|
AsusUSB.Speed = Program.config.getConfig("aura_speed");
|
||||||
Aura.SetColor(Program.config.getConfig("aura_color"));
|
AsusUSB.SetColor(Program.config.getConfig("aura_color"));
|
||||||
Aura.SetColor2(Program.config.getConfig("aura_color2"));
|
AsusUSB.SetColor2(Program.config.getConfig("aura_color2"));
|
||||||
|
|
||||||
pictureColor.BackColor = Aura.Color1;
|
pictureColor.BackColor = AsusUSB.Color1;
|
||||||
pictureColor2.BackColor = Aura.Color2;
|
pictureColor2.BackColor = AsusUSB.Color2;
|
||||||
pictureColor2.Visible = Aura.HasSecondColor();
|
pictureColor2.Visible = AsusUSB.HasSecondColor();
|
||||||
|
|
||||||
Aura.ApplyAura();
|
AsusUSB.ApplyAura();
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -753,13 +753,13 @@ namespace GHelper
|
|||||||
if (overdrive >= 0)
|
if (overdrive >= 0)
|
||||||
{
|
{
|
||||||
if (Program.config.getConfig("no_overdrive") == 1) overdrive = 0;
|
if (Program.config.getConfig("no_overdrive") == 1) overdrive = 0;
|
||||||
Program.wmi.DeviceSet(ASUSWmi.ScreenOverdrive, overdrive, "ScreenOverdrive");
|
Program.acpi.DeviceSet(AsusACPI.ScreenOverdrive, overdrive, "ScreenOverdrive");
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
if (miniled >= 0)
|
if (miniled >= 0)
|
||||||
{
|
{
|
||||||
Program.wmi.DeviceSet(ASUSWmi.ScreenMiniled, miniled, "Miniled");
|
Program.acpi.DeviceSet(AsusACPI.ScreenMiniled, miniled, "Miniled");
|
||||||
Debug.WriteLine("Miniled " + miniled);
|
Debug.WriteLine("Miniled " + miniled);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -775,8 +775,8 @@ namespace GHelper
|
|||||||
bool screenAuto = (Program.config.getConfig("screen_auto") == 1);
|
bool screenAuto = (Program.config.getConfig("screen_auto") == 1);
|
||||||
bool overdriveSetting = (Program.config.getConfig("no_overdrive") != 1);
|
bool overdriveSetting = (Program.config.getConfig("no_overdrive") != 1);
|
||||||
|
|
||||||
int overdrive = Program.wmi.DeviceGet(ASUSWmi.ScreenOverdrive);
|
int overdrive = Program.acpi.DeviceGet(AsusACPI.ScreenOverdrive);
|
||||||
int miniled = Program.wmi.DeviceGet(ASUSWmi.ScreenMiniled);
|
int miniled = Program.acpi.DeviceGet(AsusACPI.ScreenMiniled);
|
||||||
|
|
||||||
bool screenEnabled = (frequency >= 0);
|
bool screenEnabled = (frequency >= 0);
|
||||||
|
|
||||||
@@ -848,17 +848,17 @@ namespace GHelper
|
|||||||
|
|
||||||
private void ButtonUltimate_Click(object? sender, EventArgs e)
|
private void ButtonUltimate_Click(object? sender, EventArgs e)
|
||||||
{
|
{
|
||||||
SetGPUMode(ASUSWmi.GPUModeUltimate);
|
SetGPUMode(AsusACPI.GPUModeUltimate);
|
||||||
}
|
}
|
||||||
|
|
||||||
private void ButtonStandard_Click(object? sender, EventArgs e)
|
private void ButtonStandard_Click(object? sender, EventArgs e)
|
||||||
{
|
{
|
||||||
SetGPUMode(ASUSWmi.GPUModeStandard);
|
SetGPUMode(AsusACPI.GPUModeStandard);
|
||||||
}
|
}
|
||||||
|
|
||||||
private void ButtonEco_Click(object? sender, EventArgs e)
|
private void ButtonEco_Click(object? sender, EventArgs e)
|
||||||
{
|
{
|
||||||
SetGPUMode(ASUSWmi.GPUModeEco);
|
SetGPUMode(AsusACPI.GPUModeEco);
|
||||||
}
|
}
|
||||||
|
|
||||||
public async void RefreshSensors(bool force = false)
|
public async void RefreshSensors(bool force = false)
|
||||||
@@ -935,22 +935,22 @@ namespace GHelper
|
|||||||
int limit_total = Program.config.getConfigPerf("limit_total");
|
int limit_total = Program.config.getConfigPerf("limit_total");
|
||||||
int limit_cpu = Program.config.getConfigPerf("limit_cpu");
|
int limit_cpu = Program.config.getConfigPerf("limit_cpu");
|
||||||
|
|
||||||
if (limit_total > ASUSWmi.MaxTotal) return;
|
if (limit_total > AsusACPI.MaxTotal) return;
|
||||||
if (limit_total < ASUSWmi.MinTotal) return;
|
if (limit_total < AsusACPI.MinTotal) return;
|
||||||
|
|
||||||
if (limit_cpu > ASUSWmi.MaxCPU) return;
|
if (limit_cpu > AsusACPI.MaxCPU) return;
|
||||||
if (limit_cpu < ASUSWmi.MinCPU) return;
|
if (limit_cpu < AsusACPI.MinCPU) return;
|
||||||
|
|
||||||
if (Program.wmi.DeviceGet(ASUSWmi.PPT_TotalA0) >= 0)
|
if (Program.acpi.DeviceGet(AsusACPI.PPT_TotalA0) >= 0)
|
||||||
{
|
{
|
||||||
Program.wmi.DeviceSet(ASUSWmi.PPT_TotalA0, limit_total, "PowerLimit A0");
|
Program.acpi.DeviceSet(AsusACPI.PPT_TotalA0, limit_total, "PowerLimit A0");
|
||||||
Program.wmi.DeviceSet(ASUSWmi.PPT_APUA3, limit_total, "PowerLimit A3");
|
Program.acpi.DeviceSet(AsusACPI.PPT_APUA3, limit_total, "PowerLimit A3");
|
||||||
customPower = limit_total;
|
customPower = limit_total;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (Program.wmi.DeviceGet(ASUSWmi.PPT_CPUB0) >= 0)
|
if (Program.acpi.DeviceGet(AsusACPI.PPT_CPUB0) >= 0)
|
||||||
{
|
{
|
||||||
Program.wmi.DeviceSet(ASUSWmi.PPT_CPUB0, limit_cpu, "PowerLimit B0");
|
Program.acpi.DeviceSet(AsusACPI.PPT_CPUB0, limit_cpu, "PowerLimit B0");
|
||||||
customPower = limit_cpu;
|
customPower = limit_cpu;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -969,7 +969,7 @@ namespace GHelper
|
|||||||
|
|
||||||
//if ((gpu_core > -5 && gpu_core < 5) && (gpu_memory > -5 && gpu_memory < 5)) launchAsAdmin = false;
|
//if ((gpu_core > -5 && gpu_core < 5) && (gpu_memory > -5 && gpu_memory < 5)) launchAsAdmin = false;
|
||||||
|
|
||||||
if (Program.wmi.DeviceGet(ASUSWmi.GPUEco) == 1) return;
|
if (Program.acpi.DeviceGet(AsusACPI.GPUEco) == 1) return;
|
||||||
if (HardwareControl.GpuControl is null) return;
|
if (HardwareControl.GpuControl is null) return;
|
||||||
if (!HardwareControl.GpuControl!.IsNvidia) return;
|
if (!HardwareControl.GpuControl!.IsNvidia) return;
|
||||||
|
|
||||||
@@ -999,17 +999,17 @@ namespace GHelper
|
|||||||
int gpu_temp = Program.config.getConfigPerf("gpu_temp");
|
int gpu_temp = Program.config.getConfigPerf("gpu_temp");
|
||||||
|
|
||||||
|
|
||||||
if (gpu_boost < ASUSWmi.MinGPUBoost || gpu_boost > ASUSWmi.MaxGPUBoost) return;
|
if (gpu_boost < AsusACPI.MinGPUBoost || gpu_boost > AsusACPI.MaxGPUBoost) return;
|
||||||
if (gpu_temp < ASUSWmi.MinGPUTemp || gpu_temp > ASUSWmi.MaxGPUTemp) return;
|
if (gpu_temp < AsusACPI.MinGPUTemp || gpu_temp > AsusACPI.MaxGPUTemp) return;
|
||||||
|
|
||||||
if (Program.wmi.DeviceGet(ASUSWmi.PPT_GPUC0) >= 0)
|
if (Program.acpi.DeviceGet(AsusACPI.PPT_GPUC0) >= 0)
|
||||||
{
|
{
|
||||||
Program.wmi.DeviceSet(ASUSWmi.PPT_GPUC0, gpu_boost, "PowerLimit C0");
|
Program.acpi.DeviceSet(AsusACPI.PPT_GPUC0, gpu_boost, "PowerLimit C0");
|
||||||
}
|
}
|
||||||
|
|
||||||
if (Program.wmi.DeviceGet(ASUSWmi.PPT_GPUC2) >= 0)
|
if (Program.acpi.DeviceGet(AsusACPI.PPT_GPUC2) >= 0)
|
||||||
{
|
{
|
||||||
Program.wmi.DeviceSet(ASUSWmi.PPT_GPUC2, gpu_temp, "PowerLimit C2");
|
Program.acpi.DeviceSet(AsusACPI.PPT_GPUC2, gpu_temp, "PowerLimit C2");
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
@@ -1027,18 +1027,21 @@ namespace GHelper
|
|||||||
|
|
||||||
if (Program.config.getConfigPerf("auto_apply") == 1 || force)
|
if (Program.config.getConfigPerf("auto_apply") == 1 || force)
|
||||||
{
|
{
|
||||||
int cpuResult = Program.wmi.SetFanCurve(0, Program.config.getFanConfig(0));
|
int cpuResult = Program.acpi.SetFanCurve(AsusFan.CPU, Program.config.getFanConfig(AsusFan.CPU));
|
||||||
int gpuResult = Program.wmi.SetFanCurve(1, Program.config.getFanConfig(1));
|
int gpuResult = Program.acpi.SetFanCurve(AsusFan.GPU, Program.config.getFanConfig(AsusFan.GPU));
|
||||||
|
|
||||||
if (Program.config.getConfig("mid_fan") == 1)
|
if (Program.config.isConfig("mid_fan"))
|
||||||
Program.wmi.SetFanCurve(2, Program.config.getFanConfig(2));
|
Program.acpi.SetFanCurve(AsusFan.Mid, Program.config.getFanConfig(AsusFan.Mid));
|
||||||
|
|
||||||
|
if (Program.config.isConfig("xgm_fan") && Program.acpi.IsXGConnected())
|
||||||
|
AsusUSB.SetXGMFan(Program.config.getFanConfig(AsusFan.XGM));
|
||||||
|
|
||||||
// something went wrong, resetting to default profile
|
// something went wrong, resetting to default profile
|
||||||
if (cpuResult != 1 || gpuResult != 1)
|
if (cpuResult != 1 || gpuResult != 1)
|
||||||
{
|
{
|
||||||
int mode = Program.config.getConfig("performance_mode");
|
int mode = Program.config.getConfig("performance_mode");
|
||||||
Logger.WriteLine("ASUS BIOS rejected fan curve, resetting mode to " + mode);
|
Logger.WriteLine("ASUS BIOS rejected fan curve, resetting mode to " + mode);
|
||||||
Program.wmi.DeviceSet(ASUSWmi.PerformanceMode, mode, "PerformanceMode");
|
Program.acpi.DeviceSet(AsusACPI.PerformanceMode, mode, "PerformanceMode");
|
||||||
LabelFansResult("ASUS BIOS rejected fan curve");
|
LabelFansResult("ASUS BIOS rejected fan curve");
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
@@ -1053,8 +1056,8 @@ namespace GHelper
|
|||||||
Task.Run(async () =>
|
Task.Run(async () =>
|
||||||
{
|
{
|
||||||
await Task.Delay(TimeSpan.FromSeconds(1));
|
await Task.Delay(TimeSpan.FromSeconds(1));
|
||||||
Program.wmi.DeviceSet(ASUSWmi.PPT_TotalA0, 80, "PowerLimit Fix A0");
|
Program.acpi.DeviceSet(AsusACPI.PPT_TotalA0, 80, "PowerLimit Fix A0");
|
||||||
Program.wmi.DeviceSet(ASUSWmi.PPT_APUA3, 80, "PowerLimit Fix A3");
|
Program.acpi.DeviceSet(AsusACPI.PPT_APUA3, 80, "PowerLimit Fix A3");
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -1112,17 +1115,17 @@ namespace GHelper
|
|||||||
|
|
||||||
switch (PerformanceMode)
|
switch (PerformanceMode)
|
||||||
{
|
{
|
||||||
case ASUSWmi.PerformanceSilent:
|
case AsusACPI.PerformanceSilent:
|
||||||
buttonSilent.Activated = true;
|
buttonSilent.Activated = true;
|
||||||
perfName = Properties.Strings.Silent;
|
perfName = Properties.Strings.Silent;
|
||||||
break;
|
break;
|
||||||
case ASUSWmi.PerformanceTurbo:
|
case AsusACPI.PerformanceTurbo:
|
||||||
buttonTurbo.Activated = true;
|
buttonTurbo.Activated = true;
|
||||||
perfName = Properties.Strings.Turbo;
|
perfName = Properties.Strings.Turbo;
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
buttonBalanced.Activated = true;
|
buttonBalanced.Activated = true;
|
||||||
PerformanceMode = ASUSWmi.PerformanceBalanced;
|
PerformanceMode = AsusACPI.PerformanceBalanced;
|
||||||
perfName = Properties.Strings.Balanced;
|
perfName = Properties.Strings.Balanced;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
@@ -1135,7 +1138,8 @@ namespace GHelper
|
|||||||
Program.config.setConfig("performance_" + (int)SystemInformation.PowerStatus.PowerLineStatus, PerformanceMode);
|
Program.config.setConfig("performance_" + (int)SystemInformation.PowerStatus.PowerLineStatus, PerformanceMode);
|
||||||
Program.config.setConfig("performance_mode", PerformanceMode);
|
Program.config.setConfig("performance_mode", PerformanceMode);
|
||||||
|
|
||||||
Program.wmi.DeviceSet(ASUSWmi.PerformanceMode, PerformanceMode, "PerformanceMode");
|
Program.acpi.DeviceSet(AsusACPI.PerformanceMode, PerformanceMode, "PerformanceMode");
|
||||||
|
if (Program.config.isConfig("xgm_fan") && Program.acpi.IsXGConnected()) AsusUSB.ResetXGM();
|
||||||
|
|
||||||
if (notify && (oldMode != PerformanceMode))
|
if (notify && (oldMode != PerformanceMode))
|
||||||
{
|
{
|
||||||
@@ -1200,9 +1204,9 @@ namespace GHelper
|
|||||||
if (Program.config.getConfig("keyboard_auto") != 1) return;
|
if (Program.config.getConfig("keyboard_auto") != 1) return;
|
||||||
|
|
||||||
if (SystemInformation.PowerStatus.PowerLineStatus == PowerLineStatus.Online)
|
if (SystemInformation.PowerStatus.PowerLineStatus == PowerLineStatus.Online)
|
||||||
Aura.ApplyBrightness(3);
|
AsusUSB.ApplyBrightness(3);
|
||||||
else
|
else
|
||||||
Aura.ApplyBrightness(0);
|
AsusUSB.ApplyBrightness(0);
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
@@ -1242,7 +1246,7 @@ namespace GHelper
|
|||||||
bool optimizedUSBC = Program.config.getConfig("optimized_usbc") != 1;
|
bool optimizedUSBC = Program.config.getConfig("optimized_usbc") != 1;
|
||||||
|
|
||||||
return SystemInformation.PowerStatus.PowerLineStatus == PowerLineStatus.Online &&
|
return SystemInformation.PowerStatus.PowerLineStatus == PowerLineStatus.Online &&
|
||||||
(optimizedUSBC || Program.wmi.DeviceGet(ASUSWmi.ChargerMode) != ASUSWmi.ChargerUSB);
|
(optimizedUSBC || Program.acpi.DeviceGet(AsusACPI.ChargerMode) != AsusACPI.ChargerUSB);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -1256,8 +1260,8 @@ namespace GHelper
|
|||||||
|
|
||||||
if (!GpuAuto && !ForceGPU) return false;
|
if (!GpuAuto && !ForceGPU) return false;
|
||||||
|
|
||||||
int eco = Program.wmi.DeviceGet(ASUSWmi.GPUEco);
|
int eco = Program.acpi.DeviceGet(AsusACPI.GPUEco);
|
||||||
int mux = Program.wmi.DeviceGet(ASUSWmi.GPUMux);
|
int mux = Program.acpi.DeviceGet(AsusACPI.GPUMux);
|
||||||
|
|
||||||
if (mux == 0) // GPU in Ultimate, ignore
|
if (mux == 0) // GPU in Ultimate, ignore
|
||||||
return false;
|
return false;
|
||||||
@@ -1267,13 +1271,13 @@ namespace GHelper
|
|||||||
if (ReEnableGPU()) return true;
|
if (ReEnableGPU()) return true;
|
||||||
|
|
||||||
if (eco == 1)
|
if (eco == 1)
|
||||||
if ((GpuAuto && IsPlugged()) || (ForceGPU && GpuMode == ASUSWmi.GPUModeStandard))
|
if ((GpuAuto && IsPlugged()) || (ForceGPU && GpuMode == AsusACPI.GPUModeStandard))
|
||||||
{
|
{
|
||||||
SetGPUEco(0);
|
SetGPUEco(0);
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
if (eco == 0)
|
if (eco == 0)
|
||||||
if ((GpuAuto && !IsPlugged()) || (ForceGPU && GpuMode == ASUSWmi.GPUModeEco))
|
if ((GpuAuto && !IsPlugged()) || (ForceGPU && GpuMode == AsusACPI.GPUModeEco))
|
||||||
{
|
{
|
||||||
|
|
||||||
if (HardwareControl.IsUsedGPU())
|
if (HardwareControl.IsUsedGPU())
|
||||||
@@ -1322,20 +1326,16 @@ namespace GHelper
|
|||||||
|
|
||||||
public void InitXGM()
|
public void InitXGM()
|
||||||
{
|
{
|
||||||
int connected = Program.wmi.DeviceGet(ASUSWmi.GPUXGConnected);
|
buttonXGM.Enabled = buttonXGM.Visible = Program.acpi.IsXGConnected();
|
||||||
int enabled = Program.wmi.DeviceGet(ASUSWmi.GPUXG);
|
buttonXGM.Activated = (Program.acpi.DeviceGet(AsusACPI.GPUXG) == 1);
|
||||||
|
|
||||||
buttonXGM.Enabled = buttonXGM.Visible = (connected == 1);
|
|
||||||
buttonXGM.Activated = (enabled == 1);
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
public int InitGPUMode()
|
public int InitGPUMode()
|
||||||
{
|
{
|
||||||
|
|
||||||
int eco = Program.wmi.DeviceGet(ASUSWmi.GPUEco);
|
int eco = Program.acpi.DeviceGet(AsusACPI.GPUEco);
|
||||||
int mux = Program.wmi.DeviceGet(ASUSWmi.GPUMux);
|
int mux = Program.acpi.DeviceGet(AsusACPI.GPUMux);
|
||||||
|
|
||||||
Logger.WriteLine("Eco flag : " + eco);
|
Logger.WriteLine("Eco flag : " + eco);
|
||||||
Logger.WriteLine("Mux flag : " + mux);
|
Logger.WriteLine("Mux flag : " + mux);
|
||||||
@@ -1343,13 +1343,13 @@ namespace GHelper
|
|||||||
int GpuMode;
|
int GpuMode;
|
||||||
|
|
||||||
if (mux == 0)
|
if (mux == 0)
|
||||||
GpuMode = ASUSWmi.GPUModeUltimate;
|
GpuMode = AsusACPI.GPUModeUltimate;
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
if (eco == 1)
|
if (eco == 1)
|
||||||
GpuMode = ASUSWmi.GPUModeEco;
|
GpuMode = AsusACPI.GPUModeEco;
|
||||||
else
|
else
|
||||||
GpuMode = ASUSWmi.GPUModeStandard;
|
GpuMode = AsusACPI.GPUModeStandard;
|
||||||
|
|
||||||
UltimateUI(mux == 1);
|
UltimateUI(mux == 1);
|
||||||
|
|
||||||
@@ -1433,7 +1433,7 @@ namespace GHelper
|
|||||||
}
|
}
|
||||||
|
|
||||||
//if (eco == 1) status = 0; else
|
//if (eco == 1) status = 0; else
|
||||||
status = Program.wmi.SetGPUEco(eco);
|
status = Program.acpi.SetGPUEco(eco);
|
||||||
|
|
||||||
if (status == 0 && eco == 1 && hardWay)
|
if (status == 0 && eco == 1 && hardWay)
|
||||||
{
|
{
|
||||||
@@ -1474,34 +1474,34 @@ namespace GHelper
|
|||||||
var restart = false;
|
var restart = false;
|
||||||
var changed = false;
|
var changed = false;
|
||||||
|
|
||||||
if (CurrentGPU == ASUSWmi.GPUModeUltimate)
|
if (CurrentGPU == AsusACPI.GPUModeUltimate)
|
||||||
{
|
{
|
||||||
DialogResult dialogResult = MessageBox.Show(Properties.Strings.AlertUltimateOff, Properties.Strings.AlertUltimateTitle, MessageBoxButtons.YesNo);
|
DialogResult dialogResult = MessageBox.Show(Properties.Strings.AlertUltimateOff, Properties.Strings.AlertUltimateTitle, MessageBoxButtons.YesNo);
|
||||||
if (dialogResult == DialogResult.Yes)
|
if (dialogResult == DialogResult.Yes)
|
||||||
{
|
{
|
||||||
Program.wmi.DeviceSet(ASUSWmi.GPUMux, 1, "GPUMux");
|
Program.acpi.DeviceSet(AsusACPI.GPUMux, 1, "GPUMux");
|
||||||
restart = true;
|
restart = true;
|
||||||
changed = true;
|
changed = true;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else if (GPUMode == ASUSWmi.GPUModeUltimate)
|
else if (GPUMode == AsusACPI.GPUModeUltimate)
|
||||||
{
|
{
|
||||||
DialogResult dialogResult = MessageBox.Show(Properties.Strings.AlertUltimateOn, Properties.Strings.AlertUltimateTitle, MessageBoxButtons.YesNo);
|
DialogResult dialogResult = MessageBox.Show(Properties.Strings.AlertUltimateOn, Properties.Strings.AlertUltimateTitle, MessageBoxButtons.YesNo);
|
||||||
if (dialogResult == DialogResult.Yes)
|
if (dialogResult == DialogResult.Yes)
|
||||||
{
|
{
|
||||||
Program.wmi.DeviceSet(ASUSWmi.GPUMux, 0, "GPUMux");
|
Program.acpi.DeviceSet(AsusACPI.GPUMux, 0, "GPUMux");
|
||||||
restart = true;
|
restart = true;
|
||||||
changed = true;
|
changed = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
else if (GPUMode == ASUSWmi.GPUModeEco)
|
else if (GPUMode == AsusACPI.GPUModeEco)
|
||||||
{
|
{
|
||||||
VisualiseGPUMode(GPUMode);
|
VisualiseGPUMode(GPUMode);
|
||||||
SetGPUEco(1, true);
|
SetGPUEco(1, true);
|
||||||
changed = true;
|
changed = true;
|
||||||
}
|
}
|
||||||
else if (GPUMode == ASUSWmi.GPUModeStandard)
|
else if (GPUMode == AsusACPI.GPUModeStandard)
|
||||||
{
|
{
|
||||||
VisualiseGPUMode(GPUMode);
|
VisualiseGPUMode(GPUMode);
|
||||||
SetGPUEco(0);
|
SetGPUEco(0);
|
||||||
@@ -1537,14 +1537,14 @@ namespace GHelper
|
|||||||
|
|
||||||
switch (GPUMode)
|
switch (GPUMode)
|
||||||
{
|
{
|
||||||
case ASUSWmi.GPUModeEco:
|
case AsusACPI.GPUModeEco:
|
||||||
buttonOptimized.BorderColor = colorEco;
|
buttonOptimized.BorderColor = colorEco;
|
||||||
buttonEco.Activated = !GPUAuto;
|
buttonEco.Activated = !GPUAuto;
|
||||||
buttonOptimized.Activated = GPUAuto;
|
buttonOptimized.Activated = GPUAuto;
|
||||||
labelGPU.Text = Properties.Strings.GPUMode + ": " + Properties.Strings.GPUModeEco;
|
labelGPU.Text = Properties.Strings.GPUMode + ": " + Properties.Strings.GPUModeEco;
|
||||||
Program.trayIcon.Icon = Properties.Resources.eco;
|
Program.trayIcon.Icon = Properties.Resources.eco;
|
||||||
break;
|
break;
|
||||||
case ASUSWmi.GPUModeUltimate:
|
case AsusACPI.GPUModeUltimate:
|
||||||
buttonUltimate.Activated = true;
|
buttonUltimate.Activated = true;
|
||||||
labelGPU.Text = Properties.Strings.GPUMode + ": " + Properties.Strings.GPUModeUltimate;
|
labelGPU.Text = Properties.Strings.GPUMode + ": " + Properties.Strings.GPUModeUltimate;
|
||||||
Program.trayIcon.Icon = Properties.Resources.ultimate;
|
Program.trayIcon.Icon = Properties.Resources.ultimate;
|
||||||
@@ -1568,17 +1568,17 @@ namespace GHelper
|
|||||||
|
|
||||||
private void ButtonSilent_Click(object? sender, EventArgs e)
|
private void ButtonSilent_Click(object? sender, EventArgs e)
|
||||||
{
|
{
|
||||||
SetPerformanceMode(ASUSWmi.PerformanceSilent);
|
SetPerformanceMode(AsusACPI.PerformanceSilent);
|
||||||
}
|
}
|
||||||
|
|
||||||
private void ButtonBalanced_Click(object? sender, EventArgs e)
|
private void ButtonBalanced_Click(object? sender, EventArgs e)
|
||||||
{
|
{
|
||||||
SetPerformanceMode(ASUSWmi.PerformanceBalanced);
|
SetPerformanceMode(AsusACPI.PerformanceBalanced);
|
||||||
}
|
}
|
||||||
|
|
||||||
private void ButtonTurbo_Click(object? sender, EventArgs e)
|
private void ButtonTurbo_Click(object? sender, EventArgs e)
|
||||||
{
|
{
|
||||||
SetPerformanceMode(ASUSWmi.PerformanceTurbo);
|
SetPerformanceMode(AsusACPI.PerformanceTurbo);
|
||||||
}
|
}
|
||||||
|
|
||||||
private void Settings_Load(object sender, EventArgs e)
|
private void Settings_Load(object sender, EventArgs e)
|
||||||
@@ -1609,7 +1609,7 @@ namespace GHelper
|
|||||||
labelBatteryTitle.Text = Properties.Strings.BatteryChargeLimit + ": " + limit.ToString() + "%";
|
labelBatteryTitle.Text = Properties.Strings.BatteryChargeLimit + ": " + limit.ToString() + "%";
|
||||||
sliderBattery.Value = limit;
|
sliderBattery.Value = limit;
|
||||||
|
|
||||||
Program.wmi.DeviceSet(ASUSWmi.BatteryLimit, limit, "BatteryLimit");
|
Program.acpi.DeviceSet(AsusACPI.BatteryLimit, limit, "BatteryLimit");
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
OptimizationService.SetChargeLimit(limit);
|
OptimizationService.SetChargeLimit(limit);
|
||||||
|
|||||||
Reference in New Issue
Block a user