Compare commits
14 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
9794229f3f | ||
|
|
9f56959c67 | ||
|
|
09e6676b7c | ||
|
|
6adb2e2fcf | ||
|
|
08cc4409a9 | ||
|
|
1ac0f2be08 | ||
|
|
05e66d3b95 | ||
|
|
0f8f1e9ce5 | ||
|
|
d37b46c588 | ||
|
|
020a7d074f | ||
|
|
7eb7cc9f78 | ||
|
|
38d60e88ea | ||
|
|
0cc16765b6 | ||
|
|
96f705806b |
25
.github/workflows/build.yml
vendored
Normal file
@@ -0,0 +1,25 @@
|
|||||||
|
name: Build
|
||||||
|
|
||||||
|
on:
|
||||||
|
push:
|
||||||
|
branches: [ main ]
|
||||||
|
pull_request:
|
||||||
|
branches: [ main ]
|
||||||
|
workflow_dispatch:
|
||||||
|
|
||||||
|
permissions:
|
||||||
|
contents: read
|
||||||
|
|
||||||
|
jobs:
|
||||||
|
build:
|
||||||
|
runs-on: windows-2022
|
||||||
|
steps:
|
||||||
|
- uses: actions/checkout@v3
|
||||||
|
- name: Setup dotnet
|
||||||
|
uses: actions/setup-dotnet@v3
|
||||||
|
with:
|
||||||
|
dotnet-version: |
|
||||||
|
7.0.x
|
||||||
|
- name: Build
|
||||||
|
run: |
|
||||||
|
dotnet build app/GHelper.sln
|
||||||
28
.github/workflows/codeql.yml
vendored
Normal file
@@ -0,0 +1,28 @@
|
|||||||
|
name: CodeQL
|
||||||
|
|
||||||
|
on:
|
||||||
|
push:
|
||||||
|
branches: [ main ]
|
||||||
|
pull_request:
|
||||||
|
branches: [ main ]
|
||||||
|
schedule:
|
||||||
|
- cron: '34 18 * * 3'
|
||||||
|
|
||||||
|
permissions:
|
||||||
|
actions: read
|
||||||
|
contents: read
|
||||||
|
security-events: write
|
||||||
|
|
||||||
|
jobs:
|
||||||
|
codeql:
|
||||||
|
runs-on: windows-2022
|
||||||
|
steps:
|
||||||
|
- uses: actions/checkout@v3
|
||||||
|
- name: Initialize CodeQL
|
||||||
|
uses: github/codeql-action/init@v2
|
||||||
|
with:
|
||||||
|
languages: c#
|
||||||
|
- name: Autobuild
|
||||||
|
uses: github/codeql-action/autobuild@v2
|
||||||
|
- name: Analyze
|
||||||
|
uses: github/codeql-action/analyze@v2
|
||||||
28
.github/workflows/release.yml
vendored
Normal file
@@ -0,0 +1,28 @@
|
|||||||
|
name: Release
|
||||||
|
|
||||||
|
on:
|
||||||
|
release:
|
||||||
|
types: [ published ]
|
||||||
|
|
||||||
|
permissions:
|
||||||
|
contents: write
|
||||||
|
|
||||||
|
jobs:
|
||||||
|
release:
|
||||||
|
runs-on: windows-2022
|
||||||
|
steps:
|
||||||
|
- uses: actions/checkout@v3
|
||||||
|
- name: Setup dotnet
|
||||||
|
uses: actions/setup-dotnet@v3
|
||||||
|
with:
|
||||||
|
dotnet-version: |
|
||||||
|
7.0.x
|
||||||
|
- name: Publish
|
||||||
|
run: |
|
||||||
|
dotnet publish app/GHelper.sln --configuration Release --runtime win-x64 -p:PublishSingleFile=true --no-self-contained
|
||||||
|
powershell Compress-Archive app/bin/x64/Release/net7.0-windows8.0/win-x64/publish/GHelper.exe GHelper.zip
|
||||||
|
- name: Upload
|
||||||
|
env:
|
||||||
|
GH_TOKEN: ${{ github.token }}
|
||||||
|
run: |
|
||||||
|
gh release upload ${{ github.ref_name }} app/bin/x64/Release/net7.0-windows8.0/win-x64/publish/GHelper.exe GHelper.zip
|
||||||
@@ -31,9 +31,9 @@ namespace GHelper.AnimeMatrix
|
|||||||
}
|
}
|
||||||
catch
|
catch
|
||||||
{
|
{
|
||||||
mat.Dispose();
|
|
||||||
mat = null;
|
mat = null;
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public void SetMatrix()
|
public void SetMatrix()
|
||||||
|
|||||||
@@ -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,30 @@
|
|||||||
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 enum AsusMode
|
||||||
|
{
|
||||||
|
Balanced = 0,
|
||||||
|
Turbo = 1,
|
||||||
|
Silent = 2
|
||||||
|
}
|
||||||
|
|
||||||
|
public enum AsusGPU
|
||||||
|
{
|
||||||
|
Eco = 0,
|
||||||
|
Standard = 1,
|
||||||
|
Ultimate = 2
|
||||||
|
}
|
||||||
|
|
||||||
|
public class AsusACPI
|
||||||
{
|
{
|
||||||
|
|
||||||
const string FILE_NAME = @"\\.\\ATKACPI";
|
const string FILE_NAME = @"\\.\\ATKACPI";
|
||||||
@@ -150,7 +170,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 +183,7 @@ public class ASUSWmi
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
public ASUSWmi()
|
public AsusACPI()
|
||||||
{
|
{
|
||||||
handle = CreateFile(
|
handle = CreateFile(
|
||||||
FILE_NAME,
|
FILE_NAME,
|
||||||
@@ -179,7 +199,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 +302,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 +315,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 +329,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 +343,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 +354,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 +364,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 +378,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 +386,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 +395,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,9 +49,11 @@ namespace GHelper
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public static class Aura
|
public static class AsusUSB
|
||||||
{
|
{
|
||||||
|
|
||||||
|
public const byte HID_ID = 0x5a;
|
||||||
|
|
||||||
static byte[] MESSAGE_SET = { 0x5d, 0xb5, 0, 0, 0 };
|
static byte[] MESSAGE_SET = { 0x5d, 0xb5, 0, 0, 0 };
|
||||||
static byte[] MESSAGE_APPLY = { 0x5d, 0xb4 };
|
static byte[] MESSAGE_APPLY = { 0x5d, 0xb4 };
|
||||||
|
|
||||||
@@ -172,6 +174,51 @@ namespace GHelper
|
|||||||
yield return device;
|
yield return device;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private static HidDevice? GetInputDevice()
|
||||||
|
{
|
||||||
|
HidDevice[] HidDeviceList = HidDevices.Enumerate(0x0b05, deviceIds).ToArray();
|
||||||
|
|
||||||
|
foreach (HidDevice device in HidDeviceList)
|
||||||
|
if (device.ReadFeatureData(out byte[] data, HID_ID))
|
||||||
|
return device;
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
|
||||||
|
public static void TouchpadToggle()
|
||||||
|
{
|
||||||
|
HidDevice? input = GetInputDevice();
|
||||||
|
if (input != null) input.WriteFeatureData(new byte[] { HID_ID,0xf4,0x6b});
|
||||||
|
}
|
||||||
|
|
||||||
|
public static void RunListener(Action<int> KeyHandler)
|
||||||
|
{
|
||||||
|
HidDevice? input = GetInputDevice();
|
||||||
|
if (input == null) return;
|
||||||
|
|
||||||
|
Logger.WriteLine("Input Events " + input.DevicePath);
|
||||||
|
|
||||||
|
Task.Run(() =>
|
||||||
|
{
|
||||||
|
try
|
||||||
|
{
|
||||||
|
while (true)
|
||||||
|
{
|
||||||
|
var data = input.Read().Data;
|
||||||
|
if (data.Length > 1 && data[0] == HID_ID && data[1] > 0)
|
||||||
|
{
|
||||||
|
Logger.WriteLine("Key:" + data[1]);
|
||||||
|
KeyHandler(data[1]);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
catch (Exception ex)
|
||||||
|
{
|
||||||
|
Logger.WriteLine(ex.ToString());
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
public static byte[] AuraMessage(int mode, Color color, Color color2, int speed)
|
public static byte[] AuraMessage(int mode, Color color, Color color2, int speed)
|
||||||
{
|
{
|
||||||
|
|
||||||
@@ -208,7 +255,7 @@ namespace GHelper
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (Program.config.ContainsModel("TUF"))
|
if (Program.config.ContainsModel("TUF"))
|
||||||
Program.wmi.TUFKeyboardBrightness(brightness);
|
Program.acpi.TUFKeyboardBrightness(brightness);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@@ -230,7 +277,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 +285,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);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@@ -276,10 +347,11 @@ namespace GHelper
|
|||||||
byte[] msg = AuraMessage(Mode, Color1, Color2, _speed);
|
byte[] msg = AuraMessage(Mode, Color1, Color2, _speed);
|
||||||
|
|
||||||
var devices = GetHidDevices(deviceIds);
|
var devices = GetHidDevices(deviceIds);
|
||||||
|
|
||||||
if (devices.Count() == 0)
|
if (devices.Count() == 0)
|
||||||
{
|
{
|
||||||
Logger.WriteLine("USB-KB : not found");
|
Logger.WriteLine("USB-KB : not found");
|
||||||
GetHidDevices(deviceIds, 0);
|
devices = GetHidDevices(deviceIds, 1);
|
||||||
}
|
}
|
||||||
|
|
||||||
foreach (HidDevice device in devices)
|
foreach (HidDevice device in devices)
|
||||||
@@ -293,7 +365,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);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
18
app/Extra.cs
@@ -21,6 +21,10 @@ namespace GHelper
|
|||||||
|
|
||||||
private void SetKeyCombo(ComboBox combo, TextBox txbox, string name)
|
private void SetKeyCombo(ComboBox combo, TextBox txbox, string name)
|
||||||
{
|
{
|
||||||
|
|
||||||
|
if (name == "m3")
|
||||||
|
customActions[""] = Properties.Strings.MuteMic;
|
||||||
|
|
||||||
if (name == "m4")
|
if (name == "m4")
|
||||||
customActions[""] = Properties.Strings.OpenGHelper;
|
customActions[""] = Properties.Strings.OpenGHelper;
|
||||||
|
|
||||||
@@ -92,10 +96,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 +191,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 +206,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 +223,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 +292,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);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
297
app/Fans.Designer.cs
generated
@@ -37,17 +37,22 @@ 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();
|
||||||
labelFansResult = new Label();
|
|
||||||
labelTip = new Label();
|
labelTip = new Label();
|
||||||
labelBoost = new Label();
|
|
||||||
comboBoost = new RComboBox();
|
|
||||||
picturePerf = new PictureBox();
|
|
||||||
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();
|
||||||
|
labelBoost = new Label();
|
||||||
|
comboBoost = new RComboBox();
|
||||||
|
picturePerf = new PictureBox();
|
||||||
labelFans = new Label();
|
labelFans = new Label();
|
||||||
|
panelApplyFans = new Panel();
|
||||||
|
labelFansResult = new Label();
|
||||||
checkApplyFans = new RCheckBox();
|
checkApplyFans = new RCheckBox();
|
||||||
buttonReset = new RButton();
|
buttonReset = new RButton();
|
||||||
panelSliders = new Panel();
|
panelSliders = new Panel();
|
||||||
@@ -87,11 +92,14 @@ namespace GHelper
|
|||||||
pictureGPU = new PictureBox();
|
pictureGPU = new PictureBox();
|
||||||
labelGPU = new Label();
|
labelGPU = new Label();
|
||||||
panelFans.SuspendLayout();
|
panelFans.SuspendLayout();
|
||||||
((System.ComponentModel.ISupportInitialize)picturePerf).BeginInit();
|
|
||||||
tableFanCharts.SuspendLayout();
|
tableFanCharts.SuspendLayout();
|
||||||
((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();
|
||||||
|
((System.ComponentModel.ISupportInitialize)picturePerf).BeginInit();
|
||||||
|
panelApplyFans.SuspendLayout();
|
||||||
panelSliders.SuspendLayout();
|
panelSliders.SuspendLayout();
|
||||||
panelPower.SuspendLayout();
|
panelPower.SuspendLayout();
|
||||||
panelApplyPower.SuspendLayout();
|
panelApplyPower.SuspendLayout();
|
||||||
@@ -116,53 +124,134 @@ namespace GHelper
|
|||||||
//
|
//
|
||||||
// panelFans
|
// panelFans
|
||||||
//
|
//
|
||||||
panelFans.Controls.Add(labelFansResult);
|
panelFans.AutoSize = true;
|
||||||
|
panelFans.AutoSizeMode = AutoSizeMode.GrowAndShrink;
|
||||||
panelFans.Controls.Add(labelTip);
|
panelFans.Controls.Add(labelTip);
|
||||||
panelFans.Controls.Add(labelBoost);
|
|
||||||
panelFans.Controls.Add(comboBoost);
|
|
||||||
panelFans.Controls.Add(picturePerf);
|
|
||||||
panelFans.Controls.Add(tableFanCharts);
|
panelFans.Controls.Add(tableFanCharts);
|
||||||
panelFans.Controls.Add(labelFans);
|
panelFans.Controls.Add(panelTitleFans);
|
||||||
panelFans.Controls.Add(checkApplyFans);
|
panelFans.Controls.Add(panelApplyFans);
|
||||||
panelFans.Controls.Add(buttonReset);
|
|
||||||
panelFans.Dock = DockStyle.Left;
|
panelFans.Dock = DockStyle.Left;
|
||||||
panelFans.Location = new Point(533, 0);
|
panelFans.Location = new Point(533, 0);
|
||||||
panelFans.Margin = new Padding(0);
|
panelFans.Margin = new Padding(0);
|
||||||
|
panelFans.MaximumSize = new Size(815, 0);
|
||||||
|
panelFans.MinimumSize = new Size(815, 0);
|
||||||
panelFans.Name = "panelFans";
|
panelFans.Name = "panelFans";
|
||||||
panelFans.Padding = new Padding(10);
|
panelFans.Padding = new Padding(0, 0, 10, 0);
|
||||||
panelFans.Size = new Size(824, 1189);
|
panelFans.Size = new Size(815, 1189);
|
||||||
panelFans.TabIndex = 12;
|
panelFans.TabIndex = 12;
|
||||||
//
|
//
|
||||||
// labelFansResult
|
|
||||||
//
|
|
||||||
labelFansResult.Anchor = AnchorStyles.Top | AnchorStyles.Right;
|
|
||||||
labelFansResult.ForeColor = Color.Red;
|
|
||||||
labelFansResult.Location = new Point(30, 1073);
|
|
||||||
labelFansResult.Name = "labelFansResult";
|
|
||||||
labelFansResult.Size = new Size(760, 32);
|
|
||||||
labelFansResult.TabIndex = 41;
|
|
||||||
labelFansResult.TextAlign = ContentAlignment.TopRight;
|
|
||||||
labelFansResult.Visible = false;
|
|
||||||
//
|
|
||||||
// labelTip
|
// labelTip
|
||||||
//
|
//
|
||||||
labelTip.AutoSize = true;
|
labelTip.AutoSize = true;
|
||||||
labelTip.BackColor = SystemColors.ControlLightLight;
|
labelTip.BackColor = SystemColors.ControlLightLight;
|
||||||
labelTip.Location = new Point(155, 9);
|
labelTip.Location = new Point(684, 91);
|
||||||
labelTip.Name = "labelTip";
|
labelTip.Name = "labelTip";
|
||||||
labelTip.Padding = new Padding(5);
|
labelTip.Padding = new Padding(5);
|
||||||
labelTip.Size = new Size(107, 42);
|
labelTip.Size = new Size(107, 42);
|
||||||
labelTip.TabIndex = 40;
|
labelTip.TabIndex = 40;
|
||||||
labelTip.Text = "500,300";
|
labelTip.Text = "500,300";
|
||||||
//
|
//
|
||||||
|
// tableFanCharts
|
||||||
|
//
|
||||||
|
tableFanCharts.AutoSize = true;
|
||||||
|
tableFanCharts.AutoSizeMode = AutoSizeMode.GrowAndShrink;
|
||||||
|
tableFanCharts.ColumnCount = 1;
|
||||||
|
tableFanCharts.ColumnStyles.Add(new ColumnStyle(SizeType.Percent, 100F));
|
||||||
|
tableFanCharts.Controls.Add(chartGPU, 0, 1);
|
||||||
|
tableFanCharts.Controls.Add(chartCPU, 0, 0);
|
||||||
|
|
||||||
|
tableFanCharts.Controls.Add(chartXGM, 0, 2);
|
||||||
|
tableFanCharts.Controls.Add(chartMid, 0, 2);
|
||||||
|
|
||||||
|
tableFanCharts.Dock = DockStyle.Fill;
|
||||||
|
tableFanCharts.Location = new Point(0, 66);
|
||||||
|
tableFanCharts.Margin = new Padding(4);
|
||||||
|
tableFanCharts.Name = "tableFanCharts";
|
||||||
|
tableFanCharts.Padding = new Padding(10, 0, 10, 10);
|
||||||
|
tableFanCharts.RowCount = 2;
|
||||||
|
tableFanCharts.RowStyles.Add(new RowStyle(SizeType.Percent, 25F));
|
||||||
|
tableFanCharts.RowStyles.Add(new RowStyle(SizeType.Percent, 25F));
|
||||||
|
tableFanCharts.RowStyles.Add(new RowStyle(SizeType.Percent, 25F));
|
||||||
|
tableFanCharts.RowStyles.Add(new RowStyle(SizeType.Percent, 25F));
|
||||||
|
tableFanCharts.Size = new Size(805, 1007);
|
||||||
|
tableFanCharts.TabIndex = 36;
|
||||||
|
//
|
||||||
|
// chartGPU
|
||||||
|
//
|
||||||
|
chartArea1.Name = "ChartArea1";
|
||||||
|
chartGPU.ChartAreas.Add(chartArea1);
|
||||||
|
chartGPU.Dock = DockStyle.Fill;
|
||||||
|
chartGPU.Location = new Point(12, 342);
|
||||||
|
chartGPU.Margin = new Padding(2, 10, 2, 10);
|
||||||
|
chartGPU.Name = "chartGPU";
|
||||||
|
chartGPU.Size = new Size(781, 312);
|
||||||
|
chartGPU.TabIndex = 17;
|
||||||
|
chartGPU.Text = "chartGPU";
|
||||||
|
title1.Name = "Title1";
|
||||||
|
chartGPU.Titles.Add(title1);
|
||||||
|
//
|
||||||
|
// chartCPU
|
||||||
|
//
|
||||||
|
chartArea2.Name = "ChartArea1";
|
||||||
|
chartCPU.ChartAreas.Add(chartArea2);
|
||||||
|
chartCPU.Dock = DockStyle.Fill;
|
||||||
|
chartCPU.Location = new Point(12, 10);
|
||||||
|
chartCPU.Margin = new Padding(2, 10, 2, 10);
|
||||||
|
chartCPU.Name = "chartCPU";
|
||||||
|
chartCPU.Size = new Size(781, 312);
|
||||||
|
chartCPU.TabIndex = 14;
|
||||||
|
chartCPU.Text = "chartCPU";
|
||||||
|
title2.Name = "Title1";
|
||||||
|
chartCPU.Titles.Add(title2);
|
||||||
|
//
|
||||||
|
// chartMid
|
||||||
|
//
|
||||||
|
chartArea3.Name = "ChartArea3";
|
||||||
|
chartMid.ChartAreas.Add(chartArea3);
|
||||||
|
chartMid.Dock = DockStyle.Fill;
|
||||||
|
chartMid.Location = new Point(12, 674);
|
||||||
|
chartMid.Margin = new Padding(2, 10, 2, 10);
|
||||||
|
chartMid.Name = "chartMid";
|
||||||
|
chartMid.Size = new Size(781, 313);
|
||||||
|
chartMid.TabIndex = 14;
|
||||||
|
chartMid.Text = "chartMid";
|
||||||
|
title3.Name = "Title3";
|
||||||
|
chartMid.Titles.Add(title3);
|
||||||
|
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.Controls.Add(labelBoost);
|
||||||
|
panelTitleFans.Controls.Add(comboBoost);
|
||||||
|
panelTitleFans.Controls.Add(picturePerf);
|
||||||
|
panelTitleFans.Controls.Add(labelFans);
|
||||||
|
panelTitleFans.Dock = DockStyle.Top;
|
||||||
|
panelTitleFans.Location = new Point(0, 0);
|
||||||
|
panelTitleFans.Name = "panelTitleFans";
|
||||||
|
panelTitleFans.Size = new Size(805, 66);
|
||||||
|
panelTitleFans.TabIndex = 42;
|
||||||
|
//
|
||||||
// labelBoost
|
// labelBoost
|
||||||
//
|
//
|
||||||
labelBoost.Anchor = AnchorStyles.Top | AnchorStyles.Right;
|
labelBoost.Anchor = AnchorStyles.Top | AnchorStyles.Right;
|
||||||
labelBoost.AutoSize = true;
|
labelBoost.Location = new Point(335, 20);
|
||||||
labelBoost.Location = new Point(375, 17);
|
|
||||||
labelBoost.Name = "labelBoost";
|
labelBoost.Name = "labelBoost";
|
||||||
labelBoost.Size = new Size(125, 32);
|
labelBoost.Size = new Size(143, 32);
|
||||||
labelBoost.TabIndex = 39;
|
labelBoost.TabIndex = 43;
|
||||||
labelBoost.Text = "CPU Boost";
|
labelBoost.Text = "CPU Boost";
|
||||||
labelBoost.TextAlign = ContentAlignment.MiddleRight;
|
labelBoost.TextAlign = ContentAlignment.MiddleRight;
|
||||||
//
|
//
|
||||||
@@ -174,106 +263,66 @@ namespace GHelper
|
|||||||
comboBoost.DropDownStyle = ComboBoxStyle.DropDownList;
|
comboBoost.DropDownStyle = ComboBoxStyle.DropDownList;
|
||||||
comboBoost.FormattingEnabled = true;
|
comboBoost.FormattingEnabled = true;
|
||||||
comboBoost.Items.AddRange(new object[] { "Disabled", "Enabled", "Aggressive", "Efficient Enabled", "Efficient Aggressive" });
|
comboBoost.Items.AddRange(new object[] { "Disabled", "Enabled", "Aggressive", "Efficient Enabled", "Efficient Aggressive" });
|
||||||
comboBoost.Location = new Point(526, 15);
|
comboBoost.Location = new Point(503, 16);
|
||||||
comboBoost.Name = "comboBoost";
|
comboBoost.Name = "comboBoost";
|
||||||
comboBoost.Size = new Size(266, 40);
|
comboBoost.Size = new Size(287, 40);
|
||||||
comboBoost.TabIndex = 38;
|
comboBoost.TabIndex = 42;
|
||||||
//
|
//
|
||||||
// picturePerf
|
// picturePerf
|
||||||
//
|
//
|
||||||
picturePerf.BackgroundImage = Properties.Resources.icons8_fan_head_96;
|
picturePerf.BackgroundImage = Properties.Resources.icons8_fan_head_96;
|
||||||
picturePerf.BackgroundImageLayout = ImageLayout.Zoom;
|
picturePerf.BackgroundImageLayout = ImageLayout.Zoom;
|
||||||
picturePerf.InitialImage = null;
|
picturePerf.InitialImage = null;
|
||||||
picturePerf.Location = new Point(30, 18);
|
picturePerf.Location = new Point(20, 18);
|
||||||
picturePerf.Margin = new Padding(4, 2, 4, 2);
|
picturePerf.Margin = new Padding(4, 2, 4, 2);
|
||||||
picturePerf.Name = "picturePerf";
|
picturePerf.Name = "picturePerf";
|
||||||
picturePerf.Size = new Size(36, 38);
|
picturePerf.Size = new Size(36, 38);
|
||||||
picturePerf.TabIndex = 37;
|
picturePerf.TabIndex = 41;
|
||||||
picturePerf.TabStop = false;
|
picturePerf.TabStop = false;
|
||||||
//
|
//
|
||||||
// tableFanCharts
|
|
||||||
//
|
|
||||||
tableFanCharts.Anchor = AnchorStyles.Top | AnchorStyles.Bottom | AnchorStyles.Left | AnchorStyles.Right;
|
|
||||||
tableFanCharts.ColumnCount = 1;
|
|
||||||
tableFanCharts.ColumnStyles.Add(new ColumnStyle(SizeType.Percent, 100F));
|
|
||||||
tableFanCharts.Controls.Add(chartGPU, 0, 1);
|
|
||||||
tableFanCharts.Controls.Add(chartCPU, 0, 0);
|
|
||||||
tableFanCharts.Controls.Add(chartMid, 0, 2);
|
|
||||||
tableFanCharts.Location = new Point(28, 64);
|
|
||||||
tableFanCharts.Margin = new Padding(4);
|
|
||||||
tableFanCharts.Name = "tableFanCharts";
|
|
||||||
tableFanCharts.RowCount = 2;
|
|
||||||
tableFanCharts.RowStyles.Add(new RowStyle(SizeType.Percent, 33F));
|
|
||||||
tableFanCharts.RowStyles.Add(new RowStyle(SizeType.Percent, 33F));
|
|
||||||
tableFanCharts.RowStyles.Add(new RowStyle(SizeType.Percent, 33F));
|
|
||||||
tableFanCharts.Size = new Size(764, 1022);
|
|
||||||
tableFanCharts.TabIndex = 36;
|
|
||||||
//
|
|
||||||
// chartGPU
|
|
||||||
//
|
|
||||||
chartArea1.Name = "ChartArea1";
|
|
||||||
chartGPU.ChartAreas.Add(chartArea1);
|
|
||||||
chartGPU.Dock = DockStyle.Fill;
|
|
||||||
chartGPU.Location = new Point(2, 350);
|
|
||||||
chartGPU.Margin = new Padding(2, 10, 2, 10);
|
|
||||||
chartGPU.Name = "chartGPU";
|
|
||||||
chartGPU.Size = new Size(760, 320);
|
|
||||||
chartGPU.TabIndex = 17;
|
|
||||||
chartGPU.Text = "chartGPU";
|
|
||||||
title1.Name = "Title1";
|
|
||||||
chartGPU.Titles.Add(title1);
|
|
||||||
//
|
|
||||||
// chartCPU
|
|
||||||
//
|
|
||||||
chartArea2.Name = "ChartArea1";
|
|
||||||
chartCPU.ChartAreas.Add(chartArea2);
|
|
||||||
chartCPU.Dock = DockStyle.Fill;
|
|
||||||
chartCPU.Location = new Point(2, 10);
|
|
||||||
chartCPU.Margin = new Padding(2, 10, 2, 10);
|
|
||||||
chartCPU.Name = "chartCPU";
|
|
||||||
chartCPU.Size = new Size(760, 320);
|
|
||||||
chartCPU.TabIndex = 14;
|
|
||||||
chartCPU.Text = "chartCPU";
|
|
||||||
title2.Name = "Title1";
|
|
||||||
chartCPU.Titles.Add(title2);
|
|
||||||
//
|
|
||||||
// chartMid
|
|
||||||
//
|
|
||||||
chartArea3.Name = "ChartArea3";
|
|
||||||
chartMid.ChartAreas.Add(chartArea3);
|
|
||||||
chartMid.Dock = DockStyle.Fill;
|
|
||||||
chartMid.Location = new Point(2, 690);
|
|
||||||
chartMid.Margin = new Padding(2, 10, 2, 10);
|
|
||||||
chartMid.Name = "chartMid";
|
|
||||||
chartMid.Size = new Size(760, 322);
|
|
||||||
chartMid.TabIndex = 14;
|
|
||||||
chartMid.Text = "chartMid";
|
|
||||||
title3.Name = "Title3";
|
|
||||||
chartMid.Titles.Add(title3);
|
|
||||||
chartMid.Visible = false;
|
|
||||||
//
|
|
||||||
// labelFans
|
// labelFans
|
||||||
//
|
//
|
||||||
labelFans.AutoSize = true;
|
|
||||||
labelFans.Font = new Font("Segoe UI", 9F, FontStyle.Bold, GraphicsUnit.Point);
|
labelFans.Font = new Font("Segoe UI", 9F, FontStyle.Bold, GraphicsUnit.Point);
|
||||||
labelFans.Location = new Point(66, 20);
|
labelFans.Location = new Point(64, 20);
|
||||||
labelFans.Margin = new Padding(4, 0, 4, 0);
|
labelFans.Margin = new Padding(4, 0, 4, 0);
|
||||||
labelFans.Name = "labelFans";
|
labelFans.Name = "labelFans";
|
||||||
labelFans.Size = new Size(138, 32);
|
labelFans.Size = new Size(293, 32);
|
||||||
labelFans.TabIndex = 28;
|
labelFans.TabIndex = 40;
|
||||||
labelFans.Text = "Fan Curves";
|
labelFans.Text = "Fan Curves";
|
||||||
//
|
//
|
||||||
|
// panelApplyFans
|
||||||
|
//
|
||||||
|
panelApplyFans.Controls.Add(labelFansResult);
|
||||||
|
panelApplyFans.Controls.Add(checkApplyFans);
|
||||||
|
panelApplyFans.Controls.Add(buttonReset);
|
||||||
|
panelApplyFans.Dock = DockStyle.Bottom;
|
||||||
|
panelApplyFans.Location = new Point(0, 1073);
|
||||||
|
panelApplyFans.Name = "panelApplyFans";
|
||||||
|
panelApplyFans.Size = new Size(805, 116);
|
||||||
|
panelApplyFans.TabIndex = 43;
|
||||||
|
//
|
||||||
|
// labelFansResult
|
||||||
|
//
|
||||||
|
labelFansResult.Anchor = AnchorStyles.Top | AnchorStyles.Left | AnchorStyles.Right;
|
||||||
|
labelFansResult.ForeColor = Color.Red;
|
||||||
|
labelFansResult.Location = new Point(25, 3);
|
||||||
|
labelFansResult.Name = "labelFansResult";
|
||||||
|
labelFansResult.Size = new Size(760, 32);
|
||||||
|
labelFansResult.TabIndex = 42;
|
||||||
|
labelFansResult.TextAlign = ContentAlignment.TopRight;
|
||||||
|
labelFansResult.Visible = false;
|
||||||
|
//
|
||||||
// checkApplyFans
|
// checkApplyFans
|
||||||
//
|
//
|
||||||
checkApplyFans.Anchor = AnchorStyles.Bottom | AnchorStyles.Right;
|
checkApplyFans.Anchor = AnchorStyles.Bottom | AnchorStyles.Right;
|
||||||
checkApplyFans.AutoSize = true;
|
checkApplyFans.AutoSize = true;
|
||||||
checkApplyFans.BackColor = SystemColors.ControlLight;
|
checkApplyFans.BackColor = SystemColors.ControlLight;
|
||||||
checkApplyFans.Location = new Point(449, 1118);
|
checkApplyFans.Location = new Point(454, 46);
|
||||||
checkApplyFans.Margin = new Padding(4, 2, 4, 2);
|
checkApplyFans.Margin = new Padding(4, 2, 4, 2);
|
||||||
checkApplyFans.Name = "checkApplyFans";
|
checkApplyFans.Name = "checkApplyFans";
|
||||||
checkApplyFans.Padding = new Padding(15, 5, 15, 5);
|
checkApplyFans.Padding = new Padding(15, 5, 15, 5);
|
||||||
checkApplyFans.Size = new Size(339, 46);
|
checkApplyFans.Size = new Size(339, 46);
|
||||||
checkApplyFans.TabIndex = 17;
|
checkApplyFans.TabIndex = 19;
|
||||||
checkApplyFans.Text = Properties.Strings.ApplyFanCurve;
|
checkApplyFans.Text = Properties.Strings.ApplyFanCurve;
|
||||||
checkApplyFans.UseVisualStyleBackColor = false;
|
checkApplyFans.UseVisualStyleBackColor = false;
|
||||||
//
|
//
|
||||||
@@ -285,12 +334,12 @@ namespace GHelper
|
|||||||
buttonReset.BorderColor = Color.Transparent;
|
buttonReset.BorderColor = Color.Transparent;
|
||||||
buttonReset.BorderRadius = 2;
|
buttonReset.BorderRadius = 2;
|
||||||
buttonReset.FlatStyle = FlatStyle.Flat;
|
buttonReset.FlatStyle = FlatStyle.Flat;
|
||||||
buttonReset.Location = new Point(30, 1112);
|
buttonReset.Location = new Point(12, 38);
|
||||||
buttonReset.Margin = new Padding(4, 2, 4, 2);
|
buttonReset.Margin = new Padding(4, 2, 4, 2);
|
||||||
buttonReset.Name = "buttonReset";
|
buttonReset.Name = "buttonReset";
|
||||||
buttonReset.Secondary = true;
|
buttonReset.Secondary = true;
|
||||||
buttonReset.Size = new Size(232, 54);
|
buttonReset.Size = new Size(232, 54);
|
||||||
buttonReset.TabIndex = 15;
|
buttonReset.TabIndex = 18;
|
||||||
buttonReset.Text = Properties.Strings.FactoryDefaults;
|
buttonReset.Text = Properties.Strings.FactoryDefaults;
|
||||||
buttonReset.UseVisualStyleBackColor = false;
|
buttonReset.UseVisualStyleBackColor = false;
|
||||||
//
|
//
|
||||||
@@ -325,10 +374,10 @@ namespace GHelper
|
|||||||
//
|
//
|
||||||
panelApplyPower.Controls.Add(checkApplyPower);
|
panelApplyPower.Controls.Add(checkApplyPower);
|
||||||
panelApplyPower.Dock = DockStyle.Bottom;
|
panelApplyPower.Dock = DockStyle.Bottom;
|
||||||
panelApplyPower.Location = new Point(0, 445);
|
panelApplyPower.Location = new Point(0, 447);
|
||||||
panelApplyPower.Name = "panelApplyPower";
|
panelApplyPower.Name = "panelApplyPower";
|
||||||
panelApplyPower.Padding = new Padding(10);
|
panelApplyPower.Padding = new Padding(10);
|
||||||
panelApplyPower.Size = new Size(523, 92);
|
panelApplyPower.Size = new Size(523, 90);
|
||||||
panelApplyPower.TabIndex = 44;
|
panelApplyPower.TabIndex = 44;
|
||||||
//
|
//
|
||||||
// checkApplyPower
|
// checkApplyPower
|
||||||
@@ -336,7 +385,7 @@ namespace GHelper
|
|||||||
checkApplyPower.Anchor = AnchorStyles.Bottom | AnchorStyles.Left;
|
checkApplyPower.Anchor = AnchorStyles.Bottom | AnchorStyles.Left;
|
||||||
checkApplyPower.AutoSize = true;
|
checkApplyPower.AutoSize = true;
|
||||||
checkApplyPower.BackColor = SystemColors.ControlLight;
|
checkApplyPower.BackColor = SystemColors.ControlLight;
|
||||||
checkApplyPower.Location = new Point(18, 22);
|
checkApplyPower.Location = new Point(18, 20);
|
||||||
checkApplyPower.Margin = new Padding(10);
|
checkApplyPower.Margin = new Padding(10);
|
||||||
checkApplyPower.Name = "checkApplyPower";
|
checkApplyPower.Name = "checkApplyPower";
|
||||||
checkApplyPower.Padding = new Padding(15, 5, 15, 5);
|
checkApplyPower.Padding = new Padding(15, 5, 15, 5);
|
||||||
@@ -724,7 +773,7 @@ namespace GHelper
|
|||||||
//
|
//
|
||||||
labelGPU.AutoSize = true;
|
labelGPU.AutoSize = true;
|
||||||
labelGPU.Font = new Font("Segoe UI", 9F, FontStyle.Bold, GraphicsUnit.Point);
|
labelGPU.Font = new Font("Segoe UI", 9F, FontStyle.Bold, GraphicsUnit.Point);
|
||||||
labelGPU.Location = new Point(62, 21);
|
labelGPU.Location = new Point(62, 20);
|
||||||
labelGPU.Margin = new Padding(4, 0, 4, 0);
|
labelGPU.Margin = new Padding(4, 0, 4, 0);
|
||||||
labelGPU.Name = "labelGPU";
|
labelGPU.Name = "labelGPU";
|
||||||
labelGPU.Size = new Size(162, 32);
|
labelGPU.Size = new Size(162, 32);
|
||||||
@@ -737,7 +786,7 @@ namespace GHelper
|
|||||||
AutoScaleMode = AutoScaleMode.Dpi;
|
AutoScaleMode = AutoScaleMode.Dpi;
|
||||||
AutoSize = true;
|
AutoSize = true;
|
||||||
AutoSizeMode = AutoSizeMode.GrowAndShrink;
|
AutoSizeMode = AutoSizeMode.GrowAndShrink;
|
||||||
ClientSize = new Size(1361, 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);
|
||||||
@@ -752,11 +801,15 @@ namespace GHelper
|
|||||||
Text = "Fans and Power";
|
Text = "Fans and Power";
|
||||||
panelFans.ResumeLayout(false);
|
panelFans.ResumeLayout(false);
|
||||||
panelFans.PerformLayout();
|
panelFans.PerformLayout();
|
||||||
((System.ComponentModel.ISupportInitialize)picturePerf).EndInit();
|
|
||||||
tableFanCharts.ResumeLayout(false);
|
tableFanCharts.ResumeLayout(false);
|
||||||
((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);
|
||||||
|
((System.ComponentModel.ISupportInitialize)picturePerf).EndInit();
|
||||||
|
panelApplyFans.ResumeLayout(false);
|
||||||
|
panelApplyFans.PerformLayout();
|
||||||
panelSliders.ResumeLayout(false);
|
panelSliders.ResumeLayout(false);
|
||||||
panelSliders.PerformLayout();
|
panelSliders.PerformLayout();
|
||||||
panelPower.ResumeLayout(false);
|
panelPower.ResumeLayout(false);
|
||||||
@@ -790,23 +843,18 @@ namespace GHelper
|
|||||||
panelTitleGPU.PerformLayout();
|
panelTitleGPU.PerformLayout();
|
||||||
((System.ComponentModel.ISupportInitialize)pictureGPU).EndInit();
|
((System.ComponentModel.ISupportInitialize)pictureGPU).EndInit();
|
||||||
ResumeLayout(false);
|
ResumeLayout(false);
|
||||||
|
PerformLayout();
|
||||||
}
|
}
|
||||||
|
|
||||||
#endregion
|
#endregion
|
||||||
private Panel panelFans;
|
private Panel panelFans;
|
||||||
private RCheckBox checkApplyFans;
|
|
||||||
private RButton buttonReset;
|
|
||||||
private Panel panelSliders;
|
private Panel panelSliders;
|
||||||
private TableLayoutPanel tableFanCharts;
|
private TableLayoutPanel tableFanCharts;
|
||||||
private System.Windows.Forms.DataVisualization.Charting.Chart chartGPU;
|
private Chart chartGPU;
|
||||||
private System.Windows.Forms.DataVisualization.Charting.Chart chartCPU;
|
private Chart chartCPU;
|
||||||
private System.Windows.Forms.DataVisualization.Charting.Chart chartMid;
|
private Chart chartMid;
|
||||||
private Label labelFans;
|
private Chart chartXGM;
|
||||||
private PictureBox picturePerf;
|
|
||||||
private RComboBox comboBoost;
|
|
||||||
private Label labelBoost;
|
|
||||||
private Label labelTip;
|
private Label labelTip;
|
||||||
private Label labelFansResult;
|
|
||||||
private Panel panelPower;
|
private Panel panelPower;
|
||||||
private Label labelInfo;
|
private Label labelInfo;
|
||||||
private Panel panelCPU;
|
private Panel panelCPU;
|
||||||
@@ -842,5 +890,14 @@ namespace GHelper
|
|||||||
private Label labelGPUTemp;
|
private Label labelGPUTemp;
|
||||||
private Label labelGPUTempTitle;
|
private Label labelGPUTempTitle;
|
||||||
private TrackBar trackGPUTemp;
|
private TrackBar trackGPUTemp;
|
||||||
|
private Panel panelTitleFans;
|
||||||
|
private Panel panelApplyFans;
|
||||||
|
private Label labelFansResult;
|
||||||
|
private RCheckBox checkApplyFans;
|
||||||
|
private RButton buttonReset;
|
||||||
|
private Label labelBoost;
|
||||||
|
private RComboBox comboBoost;
|
||||||
|
private PictureBox picturePerf;
|
||||||
|
private Label labelFans;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
173
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,9 +157,9 @@ 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;
|
||||||
|
|
||||||
@@ -169,7 +175,8 @@ namespace GHelper
|
|||||||
try
|
try
|
||||||
{
|
{
|
||||||
labelGPU.Text = nvControl.FullName;
|
labelGPU.Text = nvControl.FullName;
|
||||||
} catch
|
}
|
||||||
|
catch
|
||||||
{
|
{
|
||||||
|
|
||||||
}
|
}
|
||||||
@@ -179,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();
|
||||||
|
|
||||||
@@ -232,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;
|
||||||
@@ -263,10 +279,10 @@ namespace GHelper
|
|||||||
chart.ChartAreas[0].AxisX.LineColor = chartGrid;
|
chart.ChartAreas[0].AxisX.LineColor = chartGrid;
|
||||||
chart.ChartAreas[0].AxisY.LineColor = chartGrid;
|
chart.ChartAreas[0].AxisY.LineColor = chartGrid;
|
||||||
|
|
||||||
for (int i = 0; i <= fansMax-10; i += 10)
|
for (int i = 0; i <= fansMax - 10; i += 10)
|
||||||
chart.ChartAreas[0].AxisY.CustomLabels.Add(i - 2, i + 2, ChartPercToRPM(i));
|
chart.ChartAreas[0].AxisY.CustomLabels.Add(i - 2, i + 2, ChartPercToRPM(i));
|
||||||
|
|
||||||
chart.ChartAreas[0].AxisY.CustomLabels.Add(fansMax-2, fansMax+2, Properties.Strings.RPM);
|
chart.ChartAreas[0].AxisY.CustomLabels.Add(fansMax - 2, fansMax + 2, Properties.Strings.RPM);
|
||||||
|
|
||||||
chart.ChartAreas[0].AxisY.Interval = 10;
|
chart.ChartAreas[0].AxisY.Interval = 10;
|
||||||
|
|
||||||
@@ -329,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();
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -348,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();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -375,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;
|
||||||
@@ -402,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;
|
||||||
@@ -434,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");
|
||||||
|
|
||||||
@@ -463,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;
|
||||||
@@ -475,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);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -500,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;
|
||||||
@@ -520,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;
|
||||||
@@ -531,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);
|
||||||
@@ -553,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();
|
||||||
|
|
||||||
|
|||||||
@@ -1,4 +1,64 @@
|
|||||||
<root>
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
|
<root>
|
||||||
|
<!--
|
||||||
|
Microsoft ResX Schema
|
||||||
|
|
||||||
|
Version 2.0
|
||||||
|
|
||||||
|
The primary goals of this format is to allow a simple XML format
|
||||||
|
that is mostly human readable. The generation and parsing of the
|
||||||
|
various data types are done through the TypeConverter classes
|
||||||
|
associated with the data types.
|
||||||
|
|
||||||
|
Example:
|
||||||
|
|
||||||
|
... ado.net/XML headers & schema ...
|
||||||
|
<resheader name="resmimetype">text/microsoft-resx</resheader>
|
||||||
|
<resheader name="version">2.0</resheader>
|
||||||
|
<resheader name="reader">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader>
|
||||||
|
<resheader name="writer">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader>
|
||||||
|
<data name="Name1"><value>this is my long string</value><comment>this is a comment</comment></data>
|
||||||
|
<data name="Color1" type="System.Drawing.Color, System.Drawing"">Blue</data>
|
||||||
|
<data name="Bitmap1" mimetype="application/x-microsoft.net.object.binary.base64">
|
||||||
|
<value>[base64 mime encoded serialized .NET Framework object]</value>
|
||||||
|
</data>
|
||||||
|
<data name="Icon1" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
|
||||||
|
<value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value>
|
||||||
|
<comment>This is a comment</comment>
|
||||||
|
</data>
|
||||||
|
|
||||||
|
There are any number of "resheader" rows that contain simple
|
||||||
|
name/value pairs.
|
||||||
|
|
||||||
|
Each data row contains a name, and value. The row also contains a
|
||||||
|
type or mimetype. Type corresponds to a .NET class that support
|
||||||
|
text/value conversion through the TypeConverter architecture.
|
||||||
|
Classes that don't support this are serialized and stored with the
|
||||||
|
mimetype set.
|
||||||
|
|
||||||
|
The mimetype is used for serialized objects, and tells the
|
||||||
|
ResXResourceReader how to depersist the object. This is currently not
|
||||||
|
extensible. For a given mimetype the value must be set accordingly:
|
||||||
|
|
||||||
|
Note - application/x-microsoft.net.object.binary.base64 is the format
|
||||||
|
that the ResXResourceWriter will generate, however the reader can
|
||||||
|
read any of the formats listed below.
|
||||||
|
|
||||||
|
mimetype: application/x-microsoft.net.object.binary.base64
|
||||||
|
value : The object must be serialized with
|
||||||
|
: System.Runtime.Serialization.Formatters.Binary.BinaryFormatter
|
||||||
|
: and then encoded with base64 encoding.
|
||||||
|
|
||||||
|
mimetype: application/x-microsoft.net.object.soap.base64
|
||||||
|
value : The object must be serialized with
|
||||||
|
: System.Runtime.Serialization.Formatters.Soap.SoapFormatter
|
||||||
|
: and then encoded with base64 encoding.
|
||||||
|
|
||||||
|
mimetype: application/x-microsoft.net.object.bytearray.base64
|
||||||
|
value : The object must be serialized into a byte array
|
||||||
|
: using a System.ComponentModel.TypeConverter
|
||||||
|
: and then encoded with base64 encoding.
|
||||||
|
-->
|
||||||
<xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
|
<xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
|
||||||
<xsd:import namespace="http://www.w3.org/XML/1998/namespace" />
|
<xsd:import namespace="http://www.w3.org/XML/1998/namespace" />
|
||||||
<xsd:element name="root" msdata:IsDataSet="true">
|
<xsd:element name="root" msdata:IsDataSet="true">
|
||||||
|
|||||||
@@ -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
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -4,7 +4,7 @@ using System.Runtime.InteropServices;
|
|||||||
namespace OSD
|
namespace OSD
|
||||||
{
|
{
|
||||||
|
|
||||||
class OSDNativeForm : NativeWindow, IDisposable
|
public class OSDNativeForm : NativeWindow, IDisposable
|
||||||
{
|
{
|
||||||
|
|
||||||
private bool _disposed = false;
|
private bool _disposed = false;
|
||||||
|
|||||||
@@ -1,5 +1,6 @@
|
|||||||
using System.Text.RegularExpressions;
|
using System.Text.RegularExpressions;
|
||||||
using System.Text;
|
using System.Text;
|
||||||
|
using System.Diagnostics;
|
||||||
|
|
||||||
namespace GHelper
|
namespace GHelper
|
||||||
{
|
{
|
||||||
@@ -33,6 +34,11 @@ namespace GHelper
|
|||||||
File.WriteAllText(path, fileContents, Encoding.Unicode);
|
File.WriteAllText(path, fileContents, Encoding.Unicode);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public static bool IsRunning()
|
||||||
|
{
|
||||||
|
return (Process.GetProcessesByName("AsusOptimization").Count() > 0);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
@@ -1,4 +1,5 @@
|
|||||||
using Microsoft.Win32;
|
using Microsoft.Win32;
|
||||||
|
using NAudio.CoreAudioApi;
|
||||||
using System.Diagnostics;
|
using System.Diagnostics;
|
||||||
using System.Globalization;
|
using System.Globalization;
|
||||||
using System.Management;
|
using System.Management;
|
||||||
@@ -18,11 +19,10 @@ 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();
|
||||||
public static ToastForm toast = new ToastForm();
|
|
||||||
|
|
||||||
public static IntPtr unRegPowerNotify;
|
public static IntPtr unRegPowerNotify;
|
||||||
|
|
||||||
@@ -30,6 +30,8 @@ namespace GHelper
|
|||||||
private static long lastTheme;
|
private static long lastTheme;
|
||||||
private static long lastAdmin;
|
private static long lastAdmin;
|
||||||
|
|
||||||
|
private static bool isOptimizationRunning = OptimizationService.IsRunning();
|
||||||
|
|
||||||
private static PowerLineStatus isPlugged = PowerLineStatus.Unknown;
|
private static PowerLineStatus isPlugged = PowerLineStatus.Unknown;
|
||||||
|
|
||||||
// The main entry point for the application
|
// The main entry point for the application
|
||||||
@@ -48,7 +50,7 @@ namespace GHelper
|
|||||||
|
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
wmi = new ASUSWmi();
|
acpi = new AsusACPI();
|
||||||
}
|
}
|
||||||
catch
|
catch
|
||||||
{
|
{
|
||||||
@@ -73,7 +75,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();
|
||||||
@@ -103,7 +105,7 @@ namespace GHelper
|
|||||||
SettingsToggle(action);
|
SettingsToggle(action);
|
||||||
}
|
}
|
||||||
|
|
||||||
//Task.Run(wmi.RunListener);
|
if (!isOptimizationRunning) AsusUSB.RunListener(HandleEvent);
|
||||||
|
|
||||||
Application.Run();
|
Application.Run();
|
||||||
|
|
||||||
@@ -220,6 +222,8 @@ namespace GHelper
|
|||||||
action = "ghelper";
|
action = "ghelper";
|
||||||
if (name == "fnf4")
|
if (name == "fnf4")
|
||||||
action = "aura";
|
action = "aura";
|
||||||
|
if (name == "m3" && !isOptimizationRunning)
|
||||||
|
action = "micmute";
|
||||||
}
|
}
|
||||||
|
|
||||||
switch (action)
|
switch (action)
|
||||||
@@ -254,6 +258,16 @@ namespace GHelper
|
|||||||
case "custom":
|
case "custom":
|
||||||
CustomKey(name);
|
CustomKey(name);
|
||||||
break;
|
break;
|
||||||
|
case "micmute":
|
||||||
|
using (var enumerator = new MMDeviceEnumerator())
|
||||||
|
{
|
||||||
|
var commDevice = enumerator.GetDefaultAudioEndpoint(DataFlow.Capture, Role.Communications);
|
||||||
|
bool muteStatus = !commDevice.AudioEndpointVolume.Mute;
|
||||||
|
commDevice.AudioEndpointVolume.Mute = muteStatus;
|
||||||
|
settingsForm.BeginInvoke(settingsForm.RunToast, muteStatus ? "Muted" : "Unmuted", muteStatus ? ToastIcon.MicrophoneMute : ToastIcon.Microphone);
|
||||||
|
}
|
||||||
|
break;
|
||||||
|
|
||||||
default:
|
default:
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
@@ -268,25 +282,16 @@ 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)) AsusUSB.TouchpadToggle();
|
||||||
wmi.DeviceSet(ASUSWmi.UniversalControl, ASUSWmi.Touchpad_Toggle, "Touchpad");
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
static void WatcherEventArrived(object sender, EventArrivedEventArgs e)
|
static void HandleEvent(int EventID)
|
||||||
{
|
{
|
||||||
var collection = (ManagementEventWatcher)sender;
|
|
||||||
|
|
||||||
if (e.NewEvent is null) return;
|
|
||||||
|
|
||||||
int EventID = int.Parse(e.NewEvent["EventID"].ToString());
|
|
||||||
|
|
||||||
Logger.WriteLine("WMI event " + EventID);
|
|
||||||
|
|
||||||
switch (EventID)
|
switch (EventID)
|
||||||
{
|
{
|
||||||
case 124: // M3
|
case 124: // M3
|
||||||
@@ -304,10 +309,52 @@ namespace GHelper
|
|||||||
case 189: // Tablet mode
|
case 189: // Tablet mode
|
||||||
TabletMode();
|
TabletMode();
|
||||||
return;
|
return;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (isOptimizationRunning) return;
|
||||||
|
|
||||||
|
// Asus Optimization service Events
|
||||||
|
|
||||||
|
int brightness = config.getConfig("keyboard_brightness");
|
||||||
|
|
||||||
|
switch (EventID)
|
||||||
|
{
|
||||||
|
case 197: // FN+F2
|
||||||
|
brightness = Math.Max(0, brightness - 1);
|
||||||
|
config.setConfig("keyboard_brightness", brightness);
|
||||||
|
AsusUSB.ApplyBrightness(brightness);
|
||||||
|
settingsForm.BeginInvoke(settingsForm.RunToast, "Backlight", ToastIcon.BacklightDown);
|
||||||
|
break;
|
||||||
|
case 196: // FN+F3
|
||||||
|
brightness = Math.Min(3, brightness + 1);
|
||||||
|
config.setConfig("keyboard_brightness", brightness);
|
||||||
|
AsusUSB.ApplyBrightness(brightness);
|
||||||
|
settingsForm.BeginInvoke(settingsForm.RunToast, "Backlight", ToastIcon.BacklightUp);
|
||||||
|
break;
|
||||||
|
case 16: // FN+F7
|
||||||
|
ScreenBrightness.Adjust(-10);
|
||||||
|
settingsForm.BeginInvoke(settingsForm.RunToast, "Brightness", ToastIcon.BrightnessDown);
|
||||||
|
break;
|
||||||
|
case 32: // FN+F8
|
||||||
|
ScreenBrightness.Adjust(+10);
|
||||||
|
settingsForm.BeginInvoke(settingsForm.RunToast, "Brightness", ToastIcon.BrightnessUp);
|
||||||
|
break;
|
||||||
|
case 107: // FN+F10
|
||||||
|
AsusUSB.TouchpadToggle();
|
||||||
|
settingsForm.BeginInvoke(settingsForm.RunToast, "Touchpad", ToastIcon.Touchpad);
|
||||||
|
break;
|
||||||
|
case 108: // FN+F11
|
||||||
|
Application.SetSuspendState(PowerState.Suspend, true, true);
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
static void WatcherEventArrived(object sender, EventArrivedEventArgs e)
|
||||||
|
{
|
||||||
|
if (e.NewEvent is null) return;
|
||||||
|
int EventID = int.Parse(e.NewEvent["EventID"].ToString());
|
||||||
|
Logger.WriteLine("WMI event " + EventID);
|
||||||
|
HandleEvent(EventID);
|
||||||
}
|
}
|
||||||
|
|
||||||
static void SettingsToggle(string action = "")
|
static void SettingsToggle(string action = "")
|
||||||
|
|||||||
72
app/Properties/Resources.Designer.cs
generated
@@ -61,25 +61,55 @@ namespace GHelper.Properties {
|
|||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Looks up a localized resource of type System.Drawing.Icon similar to (Icon).
|
/// Looks up a localized resource of type System.Drawing.Bitmap.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
internal static System.Drawing.Icon eco {
|
internal static System.Drawing.Bitmap backlight_down {
|
||||||
get {
|
get {
|
||||||
object obj = ResourceManager.GetObject("eco", resourceCulture);
|
object obj = ResourceManager.GetObject("backlight_down", resourceCulture);
|
||||||
return ((System.Drawing.Icon)(obj));
|
return ((System.Drawing.Bitmap)(obj));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Looks up a localized resource of type System.Drawing.Bitmap.
|
/// Looks up a localized resource of type System.Drawing.Bitmap.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
internal static System.Drawing.Bitmap everything_is_fine_itsfine {
|
internal static System.Drawing.Bitmap backlight_up {
|
||||||
get {
|
get {
|
||||||
object obj = ResourceManager.GetObject("everything-is-fine-itsfine", resourceCulture);
|
object obj = ResourceManager.GetObject("backlight_up", resourceCulture);
|
||||||
return ((System.Drawing.Bitmap)(obj));
|
return ((System.Drawing.Bitmap)(obj));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Looks up a localized resource of type System.Drawing.Bitmap.
|
||||||
|
/// </summary>
|
||||||
|
internal static System.Drawing.Bitmap brightness_down {
|
||||||
|
get {
|
||||||
|
object obj = ResourceManager.GetObject("brightness_down", resourceCulture);
|
||||||
|
return ((System.Drawing.Bitmap)(obj));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Looks up a localized resource of type System.Drawing.Bitmap.
|
||||||
|
/// </summary>
|
||||||
|
internal static System.Drawing.Bitmap brightness_up {
|
||||||
|
get {
|
||||||
|
object obj = ResourceManager.GetObject("brightness_up", resourceCulture);
|
||||||
|
return ((System.Drawing.Bitmap)(obj));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Looks up a localized resource of type System.Drawing.Icon similar to (Icon).
|
||||||
|
/// </summary>
|
||||||
|
internal static System.Drawing.Icon eco {
|
||||||
|
get {
|
||||||
|
object obj = ResourceManager.GetObject("eco", resourceCulture);
|
||||||
|
return ((System.Drawing.Icon)(obj));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Looks up a localized resource of type System.Drawing.Bitmap.
|
/// Looks up a localized resource of type System.Drawing.Bitmap.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
@@ -230,6 +260,26 @@ namespace GHelper.Properties {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Looks up a localized resource of type System.Drawing.Bitmap.
|
||||||
|
/// </summary>
|
||||||
|
internal static System.Drawing.Bitmap icons8_microphone_96 {
|
||||||
|
get {
|
||||||
|
object obj = ResourceManager.GetObject("icons8_microphone_96", resourceCulture);
|
||||||
|
return ((System.Drawing.Bitmap)(obj));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Looks up a localized resource of type System.Drawing.Bitmap.
|
||||||
|
/// </summary>
|
||||||
|
internal static System.Drawing.Bitmap icons8_mute_unmute_96 {
|
||||||
|
get {
|
||||||
|
object obj = ResourceManager.GetObject("icons8_mute_unmute_96", resourceCulture);
|
||||||
|
return ((System.Drawing.Bitmap)(obj));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Looks up a localized resource of type System.Drawing.Bitmap.
|
/// Looks up a localized resource of type System.Drawing.Bitmap.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
@@ -330,6 +380,16 @@ namespace GHelper.Properties {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Looks up a localized resource of type System.Drawing.Bitmap.
|
||||||
|
/// </summary>
|
||||||
|
internal static System.Drawing.Bitmap icons8_touchpad_96 {
|
||||||
|
get {
|
||||||
|
object obj = ResourceManager.GetObject("icons8_touchpad_96", resourceCulture);
|
||||||
|
return ((System.Drawing.Bitmap)(obj));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Looks up a localized resource of type System.Drawing.Bitmap.
|
/// Looks up a localized resource of type System.Drawing.Bitmap.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
|
|||||||
@@ -133,9 +133,6 @@
|
|||||||
<data name="icons8-fiat-500-48" type="System.Resources.ResXFileRef, System.Windows.Forms">
|
<data name="icons8-fiat-500-48" type="System.Resources.ResXFileRef, System.Windows.Forms">
|
||||||
<value>..\Resources\icons8-fiat-500-48.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
|
<value>..\Resources\icons8-fiat-500-48.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
|
||||||
</data>
|
</data>
|
||||||
<data name="icons8-project-management-48 (1)" type="System.Resources.ResXFileRef, System.Windows.Forms">
|
|
||||||
<value>..\Resources\icons8-project-management-48 (1).png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
|
|
||||||
</data>
|
|
||||||
<data name="icons8-bicycle-48 (1)" type="System.Resources.ResXFileRef, System.Windows.Forms">
|
<data name="icons8-bicycle-48 (1)" type="System.Resources.ResXFileRef, System.Windows.Forms">
|
||||||
<value>..\Resources\icons8-bicycle-48 (1).png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
|
<value>..\Resources\icons8-bicycle-48 (1).png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
|
||||||
</data>
|
</data>
|
||||||
@@ -205,13 +202,34 @@
|
|||||||
<data name="icons8-speed-48" type="System.Resources.ResXFileRef, System.Windows.Forms">
|
<data name="icons8-speed-48" type="System.Resources.ResXFileRef, System.Windows.Forms">
|
||||||
<value>..\Resources\icons8-speed-48.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
|
<value>..\Resources\icons8-speed-48.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
|
||||||
</data>
|
</data>
|
||||||
<data name="everything-is-fine-itsfine" type="System.Resources.ResXFileRef, System.Windows.Forms">
|
|
||||||
<value>..\Resources\itsfine.jpg;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
|
|
||||||
</data>
|
|
||||||
<data name="icons8-help-64" type="System.Resources.ResXFileRef, System.Windows.Forms">
|
<data name="icons8-help-64" type="System.Resources.ResXFileRef, System.Windows.Forms">
|
||||||
<value>..\Resources\icons8-help-64.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
|
<value>..\Resources\icons8-help-64.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
|
||||||
</data>
|
</data>
|
||||||
<data name="icons8_video_48" type="System.Resources.ResXFileRef, System.Windows.Forms">
|
<data name="icons8_video_48" type="System.Resources.ResXFileRef, System.Windows.Forms">
|
||||||
<value>..\Resources\icons8-video-48.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
|
<value>..\Resources\icons8-video-48.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
|
||||||
</data>
|
</data>
|
||||||
|
<data name="icons8-project-management-48 (1)" type="System.Resources.ResXFileRef, System.Windows.Forms">
|
||||||
|
<value>..\Resources\icons8-project-management-48 (1).png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
|
||||||
|
</data>
|
||||||
|
<data name="icons8_microphone_96" type="System.Resources.ResXFileRef, System.Windows.Forms">
|
||||||
|
<value>..\Resources\icons8-microphone-96.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
|
||||||
|
</data>
|
||||||
|
<data name="icons8_touchpad_96" type="System.Resources.ResXFileRef, System.Windows.Forms">
|
||||||
|
<value>..\Resources\icons8-touchpad-96.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
|
||||||
|
</data>
|
||||||
|
<data name="backlight_down" type="System.Resources.ResXFileRef, System.Windows.Forms">
|
||||||
|
<value>..\Resources\backlight-down.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
|
||||||
|
</data>
|
||||||
|
<data name="backlight_up" type="System.Resources.ResXFileRef, System.Windows.Forms">
|
||||||
|
<value>..\Resources\backlight-up.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
|
||||||
|
</data>
|
||||||
|
<data name="brightness_down" type="System.Resources.ResXFileRef, System.Windows.Forms">
|
||||||
|
<value>..\Resources\brightness-down.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
|
||||||
|
</data>
|
||||||
|
<data name="brightness_up" type="System.Resources.ResXFileRef, System.Windows.Forms">
|
||||||
|
<value>..\Resources\brightness-up.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
|
||||||
|
</data>
|
||||||
|
<data name="icons8_mute_unmute_96" type="System.Resources.ResXFileRef, System.Windows.Forms">
|
||||||
|
<value>..\Resources\icons8-mute-unmute-96.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
|
||||||
|
</data>
|
||||||
</root>
|
</root>
|
||||||
10
app/Properties/Strings.Designer.cs
generated
@@ -1,6 +1,7 @@
|
|||||||
//------------------------------------------------------------------------------
|
//------------------------------------------------------------------------------
|
||||||
// <auto-generated>
|
// <auto-generated>
|
||||||
// This code was generated by a tool.
|
// This code was generated by a tool.
|
||||||
|
// Runtime Version:4.0.30319.42000
|
||||||
//
|
//
|
||||||
// Changes to this file may cause incorrect behavior and will be lost if
|
// Changes to this file may cause incorrect behavior and will be lost if
|
||||||
// the code is regenerated.
|
// the code is regenerated.
|
||||||
@@ -779,6 +780,15 @@ namespace GHelper.Properties {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Looks up a localized string similar to Mute Mic.
|
||||||
|
/// </summary>
|
||||||
|
internal static string MuteMic {
|
||||||
|
get {
|
||||||
|
return ResourceManager.GetString("MuteMic", resourceCulture);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Looks up a localized string similar to Open G-Helper window.
|
/// Looks up a localized string similar to Open G-Helper window.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
|
|||||||
@@ -154,7 +154,7 @@
|
|||||||
<value>Aplicar límites de energía</value>
|
<value>Aplicar límites de energía</value>
|
||||||
</data>
|
</data>
|
||||||
<data name="ApplyWindowsPowerPlan" xml:space="preserve">
|
<data name="ApplyWindowsPowerPlan" xml:space="preserve">
|
||||||
<value>Auto Adjust Windows Power Mode</value>
|
<value>Auto-ajustar plan de energía Windows</value>
|
||||||
</data>
|
</data>
|
||||||
<data name="AuraBreathe" xml:space="preserve">
|
<data name="AuraBreathe" xml:space="preserve">
|
||||||
<value>Respiración</value>
|
<value>Respiración</value>
|
||||||
@@ -189,6 +189,9 @@
|
|||||||
<data name="Awake" xml:space="preserve">
|
<data name="Awake" xml:space="preserve">
|
||||||
<value>Encendida</value>
|
<value>Encendida</value>
|
||||||
</data>
|
</data>
|
||||||
|
<data name="BacklightTimeout" xml:space="preserve">
|
||||||
|
<value>Apagar retroiluminación con batería (s.)</value>
|
||||||
|
</data>
|
||||||
<data name="Balanced" xml:space="preserve">
|
<data name="Balanced" xml:space="preserve">
|
||||||
<value>Equilibrado</value>
|
<value>Equilibrado</value>
|
||||||
</data>
|
</data>
|
||||||
@@ -255,11 +258,23 @@
|
|||||||
<data name="FansAndPower" xml:space="preserve">
|
<data name="FansAndPower" xml:space="preserve">
|
||||||
<value>Ventiladores y energía</value>
|
<value>Ventiladores y energía</value>
|
||||||
</data>
|
</data>
|
||||||
|
<data name="FanSpeed" xml:space="preserve">
|
||||||
|
<value> Fan: </value>
|
||||||
|
</data>
|
||||||
<data name="FansPower" xml:space="preserve">
|
<data name="FansPower" xml:space="preserve">
|
||||||
<value>Ventiladores + Energía</value>
|
<value>Ventiladores + Energía</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>Cargando</value>
|
<value>Cargando</value>
|
||||||
|
</data>
|
||||||
|
<data name="GPUCoreClockOffset" xml:space="preserve">
|
||||||
|
<value>Core Clock Offset</value>
|
||||||
|
</data>
|
||||||
|
<data name="GPUMemoryClockOffset" xml:space="preserve">
|
||||||
|
<value>Memory Clock Offset</value>
|
||||||
</data>
|
</data>
|
||||||
<data name="GPUMode" xml:space="preserve">
|
<data name="GPUMode" xml:space="preserve">
|
||||||
<value>Modo de GPU</value>
|
<value>Modo de GPU</value>
|
||||||
@@ -275,6 +290,9 @@
|
|||||||
</data>
|
</data>
|
||||||
<data name="GPUSettings" xml:space="preserve">
|
<data name="GPUSettings" xml:space="preserve">
|
||||||
<value>Ajustes de GPU</value>
|
<value>Ajustes de GPU</value>
|
||||||
|
</data>
|
||||||
|
<data name="GPUTempTarget" xml:space="preserve">
|
||||||
|
<value>Temperatura objetivo</value>
|
||||||
</data>
|
</data>
|
||||||
<data name="KeyBindings" xml:space="preserve">
|
<data name="KeyBindings" xml:space="preserve">
|
||||||
<value>Atajos de teclado</value>
|
<value>Atajos de teclado</value>
|
||||||
@@ -302,6 +320,9 @@
|
|||||||
</data>
|
</data>
|
||||||
<data name="Logo" xml:space="preserve">
|
<data name="Logo" xml:space="preserve">
|
||||||
<value>Logo</value>
|
<value>Logo</value>
|
||||||
|
</data>
|
||||||
|
<data name="MatrixAudio" xml:space="preserve">
|
||||||
|
<value>Visualizador de audio</value>
|
||||||
</data>
|
</data>
|
||||||
<data name="MatrixBanner" xml:space="preserve">
|
<data name="MatrixBanner" xml:space="preserve">
|
||||||
<value>Banner binario</value>
|
<value>Banner binario</value>
|
||||||
@@ -375,6 +396,9 @@
|
|||||||
<data name="Quit" xml:space="preserve">
|
<data name="Quit" xml:space="preserve">
|
||||||
<value>Quitar</value>
|
<value>Quitar</value>
|
||||||
</data>
|
</data>
|
||||||
|
<data name="RestartGPU" xml:space="preserve">
|
||||||
|
<value>Algo está usando la dGPU e impide usar Modo Eco. ¿Reiniciar dGPU en administrador de dispositivos? * Proceda bajo su propio riesgo.</value>
|
||||||
|
</data>
|
||||||
<data name="RPM" xml:space="preserve">
|
<data name="RPM" xml:space="preserve">
|
||||||
<value>RPM</value>
|
<value>RPM</value>
|
||||||
</data>
|
</data>
|
||||||
|
|||||||
@@ -357,6 +357,9 @@
|
|||||||
<data name="Multizone" xml:space="preserve">
|
<data name="Multizone" xml:space="preserve">
|
||||||
<value>Multizone</value>
|
<value>Multizone</value>
|
||||||
</data>
|
</data>
|
||||||
|
<data name="MuteMic" xml:space="preserve">
|
||||||
|
<value>Mute Mic</value>
|
||||||
|
</data>
|
||||||
<data name="OpenGHelper" xml:space="preserve">
|
<data name="OpenGHelper" xml:space="preserve">
|
||||||
<value>Open G-Helper window</value>
|
<value>Open G-Helper window</value>
|
||||||
</data>
|
</data>
|
||||||
|
|||||||
@@ -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>
|
||||||
|
|||||||
BIN
app/Resources/Brightness.bmp
Normal file
|
After Width: | Height: | Size: 3.3 KiB |
BIN
app/Resources/backlight-down.png
Normal file
|
After Width: | Height: | Size: 1.1 KiB |
BIN
app/Resources/backlight-up.png
Normal file
|
After Width: | Height: | Size: 1.1 KiB |
BIN
app/Resources/brightness-down.png
Normal file
|
After Width: | Height: | Size: 1.4 KiB |
BIN
app/Resources/brightness-up.png
Normal file
|
After Width: | Height: | Size: 1.3 KiB |
BIN
app/Resources/icons8-microphone-96.png
Normal file
|
After Width: | Height: | Size: 784 B |
BIN
app/Resources/icons8-mute-unmute-96.png
Normal file
|
After Width: | Height: | Size: 979 B |
BIN
app/Resources/icons8-touchpad-96.png
Normal file
|
After Width: | Height: | Size: 377 B |
46
app/ScreenBrightness.cs
Normal file
@@ -0,0 +1,46 @@
|
|||||||
|
namespace GHelper
|
||||||
|
{
|
||||||
|
using System;
|
||||||
|
using System.Diagnostics;
|
||||||
|
using System.Management;
|
||||||
|
|
||||||
|
public static class ScreenBrightness
|
||||||
|
{
|
||||||
|
public static int Get()
|
||||||
|
{
|
||||||
|
using var mclass = new ManagementClass("WmiMonitorBrightness")
|
||||||
|
{
|
||||||
|
Scope = new ManagementScope(@"\\.\root\wmi")
|
||||||
|
};
|
||||||
|
using var instances = mclass.GetInstances();
|
||||||
|
foreach (ManagementObject instance in instances)
|
||||||
|
{
|
||||||
|
return (byte)instance.GetPropertyValue("CurrentBrightness");
|
||||||
|
}
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
public static void Set(int brightness)
|
||||||
|
{
|
||||||
|
using var mclass = new ManagementClass("WmiMonitorBrightnessMethods")
|
||||||
|
{
|
||||||
|
Scope = new ManagementScope(@"\\.\root\wmi")
|
||||||
|
};
|
||||||
|
using var instances = mclass.GetInstances();
|
||||||
|
var args = new object[] { 1, brightness };
|
||||||
|
foreach (ManagementObject instance in instances)
|
||||||
|
{
|
||||||
|
instance.InvokeMethod("WmiSetBrightness", args);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
public static void Adjust(int delta)
|
||||||
|
{
|
||||||
|
int brightness = Get();
|
||||||
|
Debug.WriteLine(brightness);
|
||||||
|
brightness = Math.Min(100, Math.Max(0, brightness + delta));
|
||||||
|
Set(brightness);
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
||||||
193
app/Settings.cs
@@ -1,16 +1,12 @@
|
|||||||
using CustomControls;
|
using CustomControls;
|
||||||
using GHelper.AnimeMatrix;
|
using GHelper.AnimeMatrix;
|
||||||
using GHelper.Gpu;
|
using GHelper.Gpu;
|
||||||
using NAudio.CoreAudioApi;
|
|
||||||
using NAudio.Wave;
|
|
||||||
using Starlight.AnimeMatrix;
|
|
||||||
using System.Diagnostics;
|
using System.Diagnostics;
|
||||||
using System.Drawing.Drawing2D;
|
|
||||||
using System.Drawing.Imaging;
|
|
||||||
using System.Net;
|
using System.Net;
|
||||||
using System.Reflection;
|
using System.Reflection;
|
||||||
using System.Text.Json;
|
using System.Text.Json;
|
||||||
using System.Timers;
|
using System.Timers;
|
||||||
|
using System.Windows.Forms;
|
||||||
using Tools;
|
using Tools;
|
||||||
|
|
||||||
namespace GHelper
|
namespace GHelper
|
||||||
@@ -22,6 +18,8 @@ namespace GHelper
|
|||||||
private ContextMenuStrip contextMenuStrip = new CustomContextMenu();
|
private ContextMenuStrip contextMenuStrip = new CustomContextMenu();
|
||||||
private ToolStripMenuItem menuSilent, menuBalanced, menuTurbo, menuEco, menuStandard, menuUltimate, menuOptimized;
|
private ToolStripMenuItem menuSilent, menuBalanced, menuTurbo, menuEco, menuStandard, menuUltimate, menuOptimized;
|
||||||
|
|
||||||
|
public ToastForm toast = new ToastForm();
|
||||||
|
|
||||||
public static System.Timers.Timer aTimer = default!;
|
public static System.Timers.Timer aTimer = default!;
|
||||||
public static Point trayPoint;
|
public static Point trayPoint;
|
||||||
|
|
||||||
@@ -30,7 +28,6 @@ namespace GHelper
|
|||||||
public string perfName = "Balanced";
|
public string perfName = "Balanced";
|
||||||
|
|
||||||
public AniMatrix matrix;
|
public AniMatrix matrix;
|
||||||
|
|
||||||
public Fans fans;
|
public Fans fans;
|
||||||
public Extra keyb;
|
public Extra keyb;
|
||||||
|
|
||||||
@@ -42,7 +39,6 @@ namespace GHelper
|
|||||||
public SettingsForm()
|
public SettingsForm()
|
||||||
{
|
{
|
||||||
|
|
||||||
|
|
||||||
InitializeComponent();
|
InitializeComponent();
|
||||||
InitTheme(true);
|
InitTheme(true);
|
||||||
|
|
||||||
@@ -157,6 +153,11 @@ namespace GHelper
|
|||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public void RunToast(string text, ToastIcon? icon = null)
|
||||||
|
{
|
||||||
|
toast.RunToast(text, icon);
|
||||||
|
}
|
||||||
|
|
||||||
public void SetContextMenu()
|
public void SetContextMenu()
|
||||||
{
|
{
|
||||||
|
|
||||||
@@ -265,14 +266,18 @@ 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");
|
||||||
|
|
||||||
|
if (Program.config.getConfigPerf("auto_apply") == 1)
|
||||||
|
AsusUSB.SetXGMFan(Program.config.getFanConfig(AsusFan.XGM));
|
||||||
}
|
}
|
||||||
|
|
||||||
InitXGM();
|
InitXGM();
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -637,21 +642,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()
|
||||||
@@ -659,7 +664,7 @@ namespace GHelper
|
|||||||
|
|
||||||
matrix = new AniMatrix();
|
matrix = new AniMatrix();
|
||||||
|
|
||||||
if (matrix is null)
|
if (!AniMatrix.IsValid)
|
||||||
{
|
{
|
||||||
panelMatrix.Visible = false;
|
panelMatrix.Visible = false;
|
||||||
return;
|
return;
|
||||||
@@ -679,16 +684,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 +758,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 +780,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 +853,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 +940,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 +974,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 +1004,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 +1032,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 +1061,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 +1120,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,13 +1143,14 @@ 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))
|
||||||
{
|
{
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
Program.toast.RunToast(perfName);
|
toast.RunToast(perfName);
|
||||||
}
|
}
|
||||||
catch
|
catch
|
||||||
{
|
{
|
||||||
@@ -1200,9 +1209,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 +1251,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 +1265,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 +1276,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 +1331,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 +1348,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 +1438,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 +1479,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 +1542,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 +1573,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 +1614,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);
|
||||||
|
|||||||
@@ -1,4 +1,6 @@
|
|||||||
using System.Drawing.Drawing2D;
|
using System.Diagnostics;
|
||||||
|
using System.Drawing;
|
||||||
|
using System.Drawing.Drawing2D;
|
||||||
using OSD;
|
using OSD;
|
||||||
|
|
||||||
|
|
||||||
@@ -41,12 +43,32 @@ namespace GHelper
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
class ToastForm : OSDNativeForm
|
public enum ToastIcon
|
||||||
|
{
|
||||||
|
BrightnessUp,
|
||||||
|
BrightnessDown,
|
||||||
|
BacklightUp,
|
||||||
|
BacklightDown,
|
||||||
|
Touchpad,
|
||||||
|
Microphone,
|
||||||
|
MicrophoneMute
|
||||||
|
}
|
||||||
|
|
||||||
|
public class ToastForm : OSDNativeForm
|
||||||
{
|
{
|
||||||
|
|
||||||
protected static string toastText = "Balanced";
|
protected static string toastText = "Balanced";
|
||||||
|
protected static ToastIcon? toastIcon = null;
|
||||||
|
|
||||||
protected static System.Windows.Forms.Timer timer = new System.Windows.Forms.Timer();
|
protected static System.Windows.Forms.Timer timer = new System.Windows.Forms.Timer();
|
||||||
|
|
||||||
|
public ToastForm()
|
||||||
|
{
|
||||||
|
timer.Tick += timer_Tick;
|
||||||
|
timer.Enabled = false;
|
||||||
|
timer.Interval = 2000;
|
||||||
|
}
|
||||||
|
|
||||||
protected override void PerformPaint(PaintEventArgs e)
|
protected override void PerformPaint(PaintEventArgs e)
|
||||||
{
|
{
|
||||||
Brush brush = new SolidBrush(Color.FromArgb(150,Color.Black));
|
Brush brush = new SolidBrush(Color.FromArgb(150,Color.Black));
|
||||||
@@ -56,17 +78,58 @@ namespace GHelper
|
|||||||
format.LineAlignment = StringAlignment.Center;
|
format.LineAlignment = StringAlignment.Center;
|
||||||
format.Alignment = StringAlignment.Center;
|
format.Alignment = StringAlignment.Center;
|
||||||
|
|
||||||
e.Graphics.DrawString(toastText,
|
Bitmap? icon = null;
|
||||||
new Font("Segoe UI", 16f, FontStyle.Bold),
|
|
||||||
new SolidBrush(Color.White),
|
switch (toastIcon)
|
||||||
new PointF(this.Bound.Width/2, this.Bound.Height / 2),
|
{
|
||||||
format);
|
case ToastIcon.BrightnessUp:
|
||||||
|
icon = Properties.Resources.brightness_up;
|
||||||
|
break;
|
||||||
|
case ToastIcon.BrightnessDown:
|
||||||
|
icon = Properties.Resources.brightness_down;
|
||||||
|
break;
|
||||||
|
case ToastIcon.BacklightUp:
|
||||||
|
icon = Properties.Resources.backlight_up;
|
||||||
|
break;
|
||||||
|
case ToastIcon.BacklightDown:
|
||||||
|
icon = Properties.Resources.backlight_down;
|
||||||
|
break;
|
||||||
|
case ToastIcon.Microphone:
|
||||||
|
icon = Properties.Resources.icons8_microphone_96;
|
||||||
|
break;
|
||||||
|
case ToastIcon.MicrophoneMute:
|
||||||
|
icon = Properties.Resources.icons8_mute_unmute_96;
|
||||||
|
break;
|
||||||
|
case ToastIcon.Touchpad:
|
||||||
|
icon = Properties.Resources.icons8_touchpad_96;
|
||||||
|
break;
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
int shiftX = 0;
|
||||||
|
|
||||||
|
if (icon is not null)
|
||||||
|
{
|
||||||
|
e.Graphics.DrawImage(icon, 18, 18, 64, 64);
|
||||||
|
shiftX = 40;
|
||||||
|
}
|
||||||
|
|
||||||
|
e.Graphics.DrawString(toastText,
|
||||||
|
new Font("Segoe UI", 36f, FontStyle.Bold, GraphicsUnit.Pixel),
|
||||||
|
new SolidBrush(Color.White),
|
||||||
|
new PointF(this.Bound.Width / 2 + shiftX, this.Bound.Height / 2),
|
||||||
|
format);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public void RunToast(string text)
|
public void RunToast(string text, ToastIcon? icon = null)
|
||||||
{
|
{
|
||||||
|
//Hide();
|
||||||
|
timer.Stop();
|
||||||
|
|
||||||
toastText = text;
|
toastText = text;
|
||||||
|
toastIcon = icon;
|
||||||
|
|
||||||
Screen screen1 = Screen.FromHandle(base.Handle);
|
Screen screen1 = Screen.FromHandle(base.Handle);
|
||||||
|
|
||||||
Width = 300;
|
Width = 300;
|
||||||
@@ -75,20 +138,15 @@ namespace GHelper
|
|||||||
Y = screen1.Bounds.Height - 300 - this.Height;
|
Y = screen1.Bounds.Height - 300 - this.Height;
|
||||||
|
|
||||||
Show();
|
Show();
|
||||||
|
|
||||||
timer.Stop();
|
|
||||||
timer.Tick -= timer_Tick;
|
|
||||||
|
|
||||||
timer.Tick += timer_Tick;
|
|
||||||
timer.Enabled = true;
|
|
||||||
timer.Interval = 2000;
|
|
||||||
timer.Start();
|
timer.Start();
|
||||||
}
|
}
|
||||||
|
|
||||||
private void timer_Tick(object? sender, EventArgs e)
|
private void timer_Tick(object? sender, EventArgs e)
|
||||||
{
|
{
|
||||||
timer.Stop();
|
Debug.WriteLine("Toast end");
|
||||||
|
|
||||||
Hide();
|
Hide();
|
||||||
|
timer.Stop();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -124,8 +124,11 @@ It's a lightweight Armoury Crate alternative for Asus laptops. A small utility t
|
|||||||
-----------------------------
|
-----------------------------
|
||||||
|
|
||||||
## :euro: [Support Project](https://www.paypal.com/donate/?hosted_button_id=4HMSHS4EBQWTA)
|
## :euro: [Support Project](https://www.paypal.com/donate/?hosted_button_id=4HMSHS4EBQWTA)
|
||||||
#### If you like the app you can make a [Donation via Paypal](https://www.paypal.com/donate/?hosted_button_id=4HMSHS4EBQWTA)
|
#### If you like the app you can make a Donation
|
||||||
[](https://www.paypal.com/donate/?hosted_button_id=4HMSHS4EBQWTA)
|
|
||||||
|
| [Paypal in EUR](https://www.paypal.com/donate/?hosted_button_id=4HMSHS4EBQWTA) | [Paypal in USD](https://www.paypal.com/donate/?hosted_button_id=SRM6QUX6ACXDY) |
|
||||||
|
| ------------------------------------------ | ----------------------------------------------- |
|
||||||
|
| [](https://www.paypal.com/donate/?hosted_button_id=4HMSHS4EBQWTA) | [](https://www.paypal.com/donate/?hosted_button_id=SRM6QUX6ACXDY) |
|
||||||
|
|
||||||
----------------
|
----------------
|
||||||
|
|
||||||
|
|||||||