Compare commits

...

5 Commits
v0.82 ... v0.84

Author SHA1 Message Date
Serge
1cd9c30c4a UI Tweaks 2023-06-12 14:41:47 +02:00
Serge
c575b17aba UI Tweaks 2023-06-11 23:32:13 +02:00
Serge
d2e0e6f51e Colors for custom modes 2023-06-11 17:09:17 +02:00
Serge
0dae1c9115 Custom mode renaming 2023-06-11 14:50:01 +02:00
Serge
16e085d9f1 Custom modes 2023-06-11 00:27:58 +02:00
39 changed files with 1451 additions and 810 deletions

View File

@@ -42,10 +42,10 @@ namespace GHelper.AnimeMatrix
if (!IsValid) return; if (!IsValid) return;
int brightness = AppConfig.getConfig("matrix_brightness"); int brightness = AppConfig.Get("matrix_brightness");
int running = AppConfig.getConfig("matrix_running"); int running = AppConfig.Get("matrix_running");
bool auto = AppConfig.getConfig("matrix_auto") == 1; bool auto = AppConfig.Is("matrix_auto");
if (brightness < 0) brightness = 0; if (brightness < 0) brightness = 0;
if (running < 0) running = 0; if (running < 0) running = 0;
@@ -75,7 +75,7 @@ namespace GHelper.AnimeMatrix
switch (running) switch (running)
{ {
case 2: case 2:
SetMatrixPicture(AppConfig.getConfigString("matrix_picture")); SetMatrixPicture(AppConfig.GetString("matrix_picture"));
break; break;
case 3: case 3:
SetMatrixClock(); SetMatrixClock();
@@ -110,7 +110,7 @@ namespace GHelper.AnimeMatrix
{ {
//if (!IsValid) return; //if (!IsValid) return;
switch (AppConfig.getConfig("matrix_running")) switch (AppConfig.Get("matrix_running"))
{ {
case 2: case 2:
mat.PresentNextFrame(); mat.PresentNextFrame();

View File

@@ -1,4 +1,5 @@
using System.Diagnostics; using GHelper;
using System.Diagnostics;
using System.Management; using System.Management;
using System.Text.Json; using System.Text.Json;
@@ -28,12 +29,12 @@ public static class AppConfig
} }
catch catch
{ {
initConfig(); Init();
} }
} }
else else
{ {
initConfig(); Init();
} }
} }
@@ -64,7 +65,7 @@ public static class AppConfig
} }
private static void initConfig() private static void Init()
{ {
config = new Dictionary<string, object>(); config = new Dictionary<string, object>();
config["performance_mode"] = 0; config["performance_mode"] = 0;
@@ -72,41 +73,27 @@ public static class AppConfig
File.WriteAllText(configFile, jsonString); File.WriteAllText(configFile, jsonString);
} }
public static int getConfig(string name, int empty = -1) public static int Get(string name, int empty = -1)
{ {
if (config.ContainsKey(name)) if (config.ContainsKey(name))
return int.Parse(config[name].ToString()); return int.Parse(config[name].ToString());
else return empty; else return empty;
} }
public static bool isConfig(string name) public static bool Is(string name)
{ {
return getConfig(name) == 1; return Get(name) == 1;
} }
public static string getConfigString(string name, string empty = null) public static string GetString(string name, string empty = null)
{ {
if (config.ContainsKey(name)) if (config.ContainsKey(name))
return config[name].ToString(); return config[name].ToString();
else return empty; else return empty;
} }
public static void setConfig(string name, int value) private static void Write()
{ {
config[name] = value;
string jsonString = JsonSerializer.Serialize(config, new JsonSerializerOptions { WriteIndented = true });
try
{
File.WriteAllText(configFile, jsonString);
} catch (Exception e)
{
Debug.Write(e.ToString());
}
}
public static void setConfig(string name, string value)
{
config[name] = value;
string jsonString = JsonSerializer.Serialize(config, new JsonSerializerOptions { WriteIndented = true }); string jsonString = JsonSerializer.Serialize(config, new JsonSerializerOptions { WriteIndented = true });
try try
{ {
@@ -118,9 +105,26 @@ public static class AppConfig
} }
} }
public static string getParamName(AsusFan device, string paramName = "fan_profile") public static void Set(string name, int value)
{ {
int mode = getConfig("performance_mode"); config[name] = value;
Write();
}
public static void Set(string name, string value)
{
config[name] = value;
Write();
}
public static void Remove(string name)
{
config.Remove(name);
Write();
}
public static string GgetParamName(AsusFan device, string paramName = "fan_profile")
{
int mode = Modes.GetCurrent();
string name; string name;
switch (device) switch (device)
@@ -143,9 +147,9 @@ public static class AppConfig
return paramName + "_" + name + "_" + mode; return paramName + "_" + name + "_" + mode;
} }
public static byte[] getFanConfig(AsusFan device) public static byte[] GetFanConfig(AsusFan device)
{ {
string curveString = getConfigString(getParamName(device)); string curveString = GetString(GgetParamName(device));
byte[] curve = { }; byte[] curve = { };
if (curveString is not null) if (curveString is not null)
@@ -154,10 +158,10 @@ public static class AppConfig
return curve; return curve;
} }
public static void setFanConfig(AsusFan device, byte[] curve) public static void SetFanConfig(AsusFan device, byte[] curve)
{ {
string bitCurve = BitConverter.ToString(curve); string bitCurve = BitConverter.ToString(curve);
setConfig(getParamName(device), bitCurve); Set(GgetParamName(device), bitCurve);
} }
@@ -169,9 +173,9 @@ public static class AppConfig
return array; return array;
} }
public static byte[] getDefaultCurve(AsusFan device) public static byte[] GetDefaultCurve(AsusFan device)
{ {
int mode = getConfig("performance_mode"); int mode = Modes.GetCurrentBase();
byte[] curve; byte[] curve;
switch (mode) switch (mode)
@@ -199,29 +203,29 @@ public static class AppConfig
return curve; return curve;
} }
public static string getConfigPerfString(string name) public static string GetModeString(string name)
{ {
int mode = getConfig("performance_mode"); return GetString(name + "_" + Modes.GetCurrent());
return getConfigString(name + "_" + mode);
} }
public static int getConfigPerf(string name) public static int GetMode(string name)
{ {
int mode = getConfig("performance_mode"); return Get(name + "_" + Modes.GetCurrent());
return getConfig(name + "_" + mode);
} }
public static bool isConfigPerf(string name) public static bool IsMode(string name)
{ {
int mode = getConfig("performance_mode"); return Get(name + "_" + Modes.GetCurrent()) == 1;
return getConfig(name + "_" + mode) == 1;
} }
public static void setConfigPerf(string name, int value) public static void SetMode(string name, int value)
{ {
int mode = getConfig("performance_mode"); Set(name + "_" + Modes.GetCurrent(), value);
setConfig(name + "_" + mode, value);
} }
public static void SetMode(string name, string value)
{
Set(name + "_" + Modes.GetCurrent(), value);
}
} }

View File

@@ -12,6 +12,8 @@ namespace CustomControls
public static Color colorEco = Color.FromArgb(255, 6, 180, 138); public static Color colorEco = Color.FromArgb(255, 6, 180, 138);
public static Color colorStandard = Color.FromArgb(255, 58, 174, 239); public static Color colorStandard = Color.FromArgb(255, 58, 174, 239);
public static Color colorTurbo = Color.FromArgb(255, 255, 32, 32); public static Color colorTurbo = Color.FromArgb(255, 255, 32, 32);
public static Color colorCustom = Color.FromArgb(255, 255, 128, 0);
public static Color buttonMain; public static Color buttonMain;
public static Color buttonSecond; public static Color buttonSecond;

10
app/Extra.Designer.cs generated
View File

@@ -119,8 +119,8 @@ namespace GHelper
groupBindings.Location = new Point(9, 11); groupBindings.Location = new Point(9, 11);
groupBindings.Margin = new Padding(4, 2, 4, 2); groupBindings.Margin = new Padding(4, 2, 4, 2);
groupBindings.Name = "groupBindings"; groupBindings.Name = "groupBindings";
groupBindings.Padding = new Padding(4, 2, 50, 2); groupBindings.Padding = new Padding(4, 2, 50, 10);
groupBindings.Size = new Size(966, 343); groupBindings.Size = new Size(966, 351);
groupBindings.TabIndex = 0; groupBindings.TabIndex = 0;
groupBindings.TabStop = false; groupBindings.TabStop = false;
groupBindings.Text = "Key Bindings"; groupBindings.Text = "Key Bindings";
@@ -380,7 +380,7 @@ namespace GHelper
groupLight.Controls.Add(panelXMG); groupLight.Controls.Add(panelXMG);
groupLight.Controls.Add(tableBacklight); groupLight.Controls.Add(tableBacklight);
groupLight.Dock = DockStyle.Top; groupLight.Dock = DockStyle.Top;
groupLight.Location = new Point(9, 354); groupLight.Location = new Point(9, 362);
groupLight.Margin = new Padding(4, 2, 4, 2); groupLight.Margin = new Padding(4, 2, 4, 2);
groupLight.Name = "groupLight"; groupLight.Name = "groupLight";
groupLight.Padding = new Padding(4, 2, 4, 11); groupLight.Padding = new Padding(4, 2, 4, 11);
@@ -804,7 +804,7 @@ namespace GHelper
groupOther.Controls.Add(checkGpuApps); groupOther.Controls.Add(checkGpuApps);
groupOther.Controls.Add(checkFnLock); groupOther.Controls.Add(checkFnLock);
groupOther.Dock = DockStyle.Top; groupOther.Dock = DockStyle.Top;
groupOther.Location = new Point(9, 880); groupOther.Location = new Point(9, 888);
groupOther.Margin = new Padding(4, 2, 4, 2); groupOther.Margin = new Padding(4, 2, 4, 2);
groupOther.Name = "groupOther"; groupOther.Name = "groupOther";
groupOther.Padding = new Padding(20, 2, 4, 10); groupOther.Padding = new Padding(20, 2, 4, 10);
@@ -903,7 +903,7 @@ namespace GHelper
panelServices.Controls.Add(labelServices); panelServices.Controls.Add(labelServices);
panelServices.Controls.Add(buttonServices); panelServices.Controls.Add(buttonServices);
panelServices.Dock = DockStyle.Top; panelServices.Dock = DockStyle.Top;
panelServices.Location = new Point(9, 1176); panelServices.Location = new Point(9, 1184);
panelServices.Name = "panelServices"; panelServices.Name = "panelServices";
panelServices.Size = new Size(966, 72); panelServices.Size = new Size(966, 72);
panelServices.TabIndex = 3; panelServices.TabIndex = 3;

View File

@@ -55,7 +55,7 @@ namespace GHelper
combo.DisplayMember = "Value"; combo.DisplayMember = "Value";
combo.ValueMember = "Key"; combo.ValueMember = "Key";
string action = AppConfig.getConfigString(name); string action = AppConfig.GetString(name);
combo.SelectedValue = (action is not null) ? action : ""; combo.SelectedValue = (action is not null) ? action : "";
if (combo.SelectedValue is null) combo.SelectedValue = ""; if (combo.SelectedValue is null) combo.SelectedValue = "";
@@ -63,17 +63,17 @@ namespace GHelper
combo.SelectedValueChanged += delegate combo.SelectedValueChanged += delegate
{ {
if (combo.SelectedValue is not null) if (combo.SelectedValue is not null)
AppConfig.setConfig(name, combo.SelectedValue.ToString()); AppConfig.Set(name, combo.SelectedValue.ToString());
if (name == "m1" || name == "m2") if (name == "m1" || name == "m2")
Program.inputDispatcher.RegisterKeys(); Program.inputDispatcher.RegisterKeys();
}; };
txbox.Text = AppConfig.getConfigString(name + "_custom"); txbox.Text = AppConfig.GetString(name + "_custom");
txbox.TextChanged += delegate txbox.TextChanged += delegate
{ {
AppConfig.setConfig(name + "_custom", txbox.Text); AppConfig.Set(name + "_custom", txbox.Text);
}; };
} }
@@ -130,28 +130,28 @@ namespace GHelper
comboKeyboardSpeed.SelectedValueChanged += ComboKeyboardSpeed_SelectedValueChanged; comboKeyboardSpeed.SelectedValueChanged += ComboKeyboardSpeed_SelectedValueChanged;
// Keyboard // Keyboard
checkAwake.Checked = !(AppConfig.getConfig("keyboard_awake") == 0); checkAwake.Checked = !(AppConfig.Get("keyboard_awake") == 0);
checkBoot.Checked = !(AppConfig.getConfig("keyboard_boot") == 0); checkBoot.Checked = !(AppConfig.Get("keyboard_boot") == 0);
checkSleep.Checked = !(AppConfig.getConfig("keyboard_sleep") == 0); checkSleep.Checked = !(AppConfig.Get("keyboard_sleep") == 0);
checkShutdown.Checked = !(AppConfig.getConfig("keyboard_shutdown") == 0); checkShutdown.Checked = !(AppConfig.Get("keyboard_shutdown") == 0);
// Lightbar // Lightbar
checkAwakeBar.Checked = !(AppConfig.getConfig("keyboard_awake_bar") == 0); checkAwakeBar.Checked = !(AppConfig.Get("keyboard_awake_bar") == 0);
checkBootBar.Checked = !(AppConfig.getConfig("keyboard_boot_bar") == 0); checkBootBar.Checked = !(AppConfig.Get("keyboard_boot_bar") == 0);
checkSleepBar.Checked = !(AppConfig.getConfig("keyboard_sleep_bar") == 0); checkSleepBar.Checked = !(AppConfig.Get("keyboard_sleep_bar") == 0);
checkShutdownBar.Checked = !(AppConfig.getConfig("keyboard_shutdown_bar") == 0); checkShutdownBar.Checked = !(AppConfig.Get("keyboard_shutdown_bar") == 0);
// Lid // Lid
checkAwakeLid.Checked = !(AppConfig.getConfig("keyboard_awake_lid") == 0); checkAwakeLid.Checked = !(AppConfig.Get("keyboard_awake_lid") == 0);
checkBootLid.Checked = !(AppConfig.getConfig("keyboard_boot_lid") == 0); checkBootLid.Checked = !(AppConfig.Get("keyboard_boot_lid") == 0);
checkSleepLid.Checked = !(AppConfig.getConfig("keyboard_sleep_lid") == 0); checkSleepLid.Checked = !(AppConfig.Get("keyboard_sleep_lid") == 0);
checkShutdownLid.Checked = !(AppConfig.getConfig("keyboard_shutdown_lid") == 0); checkShutdownLid.Checked = !(AppConfig.Get("keyboard_shutdown_lid") == 0);
// Logo // Logo
checkAwakeLogo.Checked = !(AppConfig.getConfig("keyboard_awake_logo") == 0); checkAwakeLogo.Checked = !(AppConfig.Get("keyboard_awake_logo") == 0);
checkBootLogo.Checked = !(AppConfig.getConfig("keyboard_boot_logo") == 0); checkBootLogo.Checked = !(AppConfig.Get("keyboard_boot_logo") == 0);
checkSleepLogo.Checked = !(AppConfig.getConfig("keyboard_sleep_logo") == 0); checkSleepLogo.Checked = !(AppConfig.Get("keyboard_sleep_logo") == 0);
checkShutdownLogo.Checked = !(AppConfig.getConfig("keyboard_shutdown_logo") == 0); checkShutdownLogo.Checked = !(AppConfig.Get("keyboard_shutdown_logo") == 0);
checkAwake.CheckedChanged += CheckPower_CheckedChanged; checkAwake.CheckedChanged += CheckPower_CheckedChanged;
checkBoot.CheckedChanged += CheckPower_CheckedChanged; checkBoot.CheckedChanged += CheckPower_CheckedChanged;
@@ -197,35 +197,35 @@ namespace GHelper
} }
} }
checkTopmost.Checked = (AppConfig.getConfig("topmost") == 1); checkTopmost.Checked = AppConfig.Is("topmost");
checkTopmost.CheckedChanged += CheckTopmost_CheckedChanged; ; checkTopmost.CheckedChanged += CheckTopmost_CheckedChanged; ;
checkNoOverdrive.Checked = (AppConfig.getConfig("no_overdrive") == 1); checkNoOverdrive.Checked = AppConfig.Is("no_overdrive");
checkNoOverdrive.CheckedChanged += CheckNoOverdrive_CheckedChanged; checkNoOverdrive.CheckedChanged += CheckNoOverdrive_CheckedChanged;
checkUSBC.Checked = (AppConfig.getConfig("optimized_usbc") == 1); checkUSBC.Checked = AppConfig.Is("optimized_usbc");
checkUSBC.CheckedChanged += CheckUSBC_CheckedChanged; checkUSBC.CheckedChanged += CheckUSBC_CheckedChanged;
checkAutoApplyWindowsPowerMode.Checked = (AppConfig.getConfig("auto_apply_power_plan") != 0); checkAutoApplyWindowsPowerMode.Checked = (AppConfig.Get("auto_apply_power_plan") != 0);
checkAutoApplyWindowsPowerMode.CheckedChanged += checkAutoApplyWindowsPowerMode_CheckedChanged; checkAutoApplyWindowsPowerMode.CheckedChanged += checkAutoApplyWindowsPowerMode_CheckedChanged;
trackBrightness.Value = InputDispatcher.GetBacklight(); trackBrightness.Value = InputDispatcher.GetBacklight();
trackBrightness.Scroll += TrackBrightness_Scroll; trackBrightness.Scroll += TrackBrightness_Scroll;
panelXMG.Visible = (Program.acpi.DeviceGet(AsusACPI.GPUXGConnected) == 1); panelXMG.Visible = (Program.acpi.DeviceGet(AsusACPI.GPUXGConnected) == 1);
checkXMG.Checked = !(AppConfig.getConfig("xmg_light") == 0); checkXMG.Checked = !(AppConfig.Get("xmg_light") == 0);
checkXMG.CheckedChanged += CheckXMG_CheckedChanged; checkXMG.CheckedChanged += CheckXMG_CheckedChanged;
numericBacklightTime.Value = AppConfig.getConfig("keyboard_timeout", 60); numericBacklightTime.Value = AppConfig.Get("keyboard_timeout", 60);
numericBacklightPluggedTime.Value = AppConfig.getConfig("keyboard_ac_timeout", 0); numericBacklightPluggedTime.Value = AppConfig.Get("keyboard_ac_timeout", 0);
numericBacklightTime.ValueChanged += NumericBacklightTime_ValueChanged; numericBacklightTime.ValueChanged += NumericBacklightTime_ValueChanged;
numericBacklightPluggedTime.ValueChanged += NumericBacklightTime_ValueChanged; numericBacklightPluggedTime.ValueChanged += NumericBacklightTime_ValueChanged;
checkGpuApps.Checked = AppConfig.isConfig("kill_gpu_apps"); checkGpuApps.Checked = AppConfig.Is("kill_gpu_apps");
checkGpuApps.CheckedChanged += CheckGpuApps_CheckedChanged; checkGpuApps.CheckedChanged += CheckGpuApps_CheckedChanged;
checkFnLock.Checked = AppConfig.isConfig("fn_lock"); checkFnLock.Checked = AppConfig.Is("fn_lock");
checkFnLock.CheckedChanged += CheckFnLock_CheckedChanged; ; checkFnLock.CheckedChanged += CheckFnLock_CheckedChanged; ;
pictureHelp.Click += PictureHelp_Click; pictureHelp.Click += PictureHelp_Click;
@@ -325,7 +325,7 @@ namespace GHelper
private void CheckFnLock_CheckedChanged(object? sender, EventArgs e) private void CheckFnLock_CheckedChanged(object? sender, EventArgs e)
{ {
int fnLock = checkFnLock.Checked ? 1 : 0; int fnLock = checkFnLock.Checked ? 1 : 0;
AppConfig.setConfig("fn_lock", fnLock); AppConfig.Set("fn_lock", fnLock);
Program.acpi.DeviceSet(AsusACPI.FnLock, (fnLock == 1) ? 0 : 1, "FnLock"); Program.acpi.DeviceSet(AsusACPI.FnLock, (fnLock == 1) ? 0 : 1, "FnLock");
Program.inputDispatcher.RegisterKeys(); Program.inputDispatcher.RegisterKeys();
@@ -333,31 +333,31 @@ namespace GHelper
private void CheckGpuApps_CheckedChanged(object? sender, EventArgs e) private void CheckGpuApps_CheckedChanged(object? sender, EventArgs e)
{ {
AppConfig.setConfig("kill_gpu_apps", (checkGpuApps.Checked ? 1 : 0)); AppConfig.Set("kill_gpu_apps", (checkGpuApps.Checked ? 1 : 0));
} }
private void NumericBacklightTime_ValueChanged(object? sender, EventArgs e) private void NumericBacklightTime_ValueChanged(object? sender, EventArgs e)
{ {
AppConfig.setConfig("keyboard_timeout", (int)numericBacklightTime.Value); AppConfig.Set("keyboard_timeout", (int)numericBacklightTime.Value);
AppConfig.setConfig("keyboard_ac_timeout", (int)numericBacklightPluggedTime.Value); AppConfig.Set("keyboard_ac_timeout", (int)numericBacklightPluggedTime.Value);
Program.inputDispatcher.InitBacklightTimer(); Program.inputDispatcher.InitBacklightTimer();
} }
private void CheckXMG_CheckedChanged(object? sender, EventArgs e) private void CheckXMG_CheckedChanged(object? sender, EventArgs e)
{ {
AppConfig.setConfig("xmg_light", (checkXMG.Checked ? 1 : 0)); AppConfig.Set("xmg_light", (checkXMG.Checked ? 1 : 0));
AsusUSB.ApplyXGMLight(checkXMG.Checked); AsusUSB.ApplyXGMLight(checkXMG.Checked);
} }
private void CheckUSBC_CheckedChanged(object? sender, EventArgs e) private void CheckUSBC_CheckedChanged(object? sender, EventArgs e)
{ {
AppConfig.setConfig("optimized_usbc", (checkUSBC.Checked ? 1 : 0)); AppConfig.Set("optimized_usbc", (checkUSBC.Checked ? 1 : 0));
} }
private void TrackBrightness_Scroll(object? sender, EventArgs e) private void TrackBrightness_Scroll(object? sender, EventArgs e)
{ {
AppConfig.setConfig("keyboard_brightness", trackBrightness.Value); AppConfig.Set("keyboard_brightness", trackBrightness.Value);
AppConfig.setConfig("keyboard_brightness_ac", trackBrightness.Value); AppConfig.Set("keyboard_brightness_ac", trackBrightness.Value);
AsusUSB.ApplyBrightness(trackBrightness.Value, "Slider"); AsusUSB.ApplyBrightness(trackBrightness.Value, "Slider");
} }
@@ -368,38 +368,38 @@ namespace GHelper
private void CheckNoOverdrive_CheckedChanged(object? sender, EventArgs e) private void CheckNoOverdrive_CheckedChanged(object? sender, EventArgs e)
{ {
AppConfig.setConfig("no_overdrive", (checkNoOverdrive.Checked ? 1 : 0)); AppConfig.Set("no_overdrive", (checkNoOverdrive.Checked ? 1 : 0));
Program.settingsForm.AutoScreen(true); Program.settingsForm.AutoScreen(true);
} }
private void CheckTopmost_CheckedChanged(object? sender, EventArgs e) private void CheckTopmost_CheckedChanged(object? sender, EventArgs e)
{ {
AppConfig.setConfig("topmost", (checkTopmost.Checked ? 1 : 0)); AppConfig.Set("topmost", (checkTopmost.Checked ? 1 : 0));
Program.settingsForm.TopMost = checkTopmost.Checked; Program.settingsForm.TopMost = checkTopmost.Checked;
} }
private void CheckPower_CheckedChanged(object? sender, EventArgs e) private void CheckPower_CheckedChanged(object? sender, EventArgs e)
{ {
AppConfig.setConfig("keyboard_awake", (checkAwake.Checked ? 1 : 0)); AppConfig.Set("keyboard_awake", (checkAwake.Checked ? 1 : 0));
AppConfig.setConfig("keyboard_boot", (checkBoot.Checked ? 1 : 0)); AppConfig.Set("keyboard_boot", (checkBoot.Checked ? 1 : 0));
AppConfig.setConfig("keyboard_sleep", (checkSleep.Checked ? 1 : 0)); AppConfig.Set("keyboard_sleep", (checkSleep.Checked ? 1 : 0));
AppConfig.setConfig("keyboard_shutdown", (checkShutdown.Checked ? 1 : 0)); AppConfig.Set("keyboard_shutdown", (checkShutdown.Checked ? 1 : 0));
AppConfig.setConfig("keyboard_awake_bar", (checkAwakeBar.Checked ? 1 : 0)); AppConfig.Set("keyboard_awake_bar", (checkAwakeBar.Checked ? 1 : 0));
AppConfig.setConfig("keyboard_boot_bar", (checkBootBar.Checked ? 1 : 0)); AppConfig.Set("keyboard_boot_bar", (checkBootBar.Checked ? 1 : 0));
AppConfig.setConfig("keyboard_sleep_bar", (checkSleepBar.Checked ? 1 : 0)); AppConfig.Set("keyboard_sleep_bar", (checkSleepBar.Checked ? 1 : 0));
AppConfig.setConfig("keyboard_shutdown_bar", (checkShutdownBar.Checked ? 1 : 0)); AppConfig.Set("keyboard_shutdown_bar", (checkShutdownBar.Checked ? 1 : 0));
AppConfig.setConfig("keyboard_awake_lid", (checkAwakeLid.Checked ? 1 : 0)); AppConfig.Set("keyboard_awake_lid", (checkAwakeLid.Checked ? 1 : 0));
AppConfig.setConfig("keyboard_boot_lid", (checkBootLid.Checked ? 1 : 0)); AppConfig.Set("keyboard_boot_lid", (checkBootLid.Checked ? 1 : 0));
AppConfig.setConfig("keyboard_sleep_lid", (checkSleepLid.Checked ? 1 : 0)); AppConfig.Set("keyboard_sleep_lid", (checkSleepLid.Checked ? 1 : 0));
AppConfig.setConfig("keyboard_shutdown_lid", (checkShutdownLid.Checked ? 1 : 0)); AppConfig.Set("keyboard_shutdown_lid", (checkShutdownLid.Checked ? 1 : 0));
AppConfig.setConfig("keyboard_awake_logo", (checkAwakeLogo.Checked ? 1 : 0)); AppConfig.Set("keyboard_awake_logo", (checkAwakeLogo.Checked ? 1 : 0));
AppConfig.setConfig("keyboard_boot_logo", (checkBootLogo.Checked ? 1 : 0)); AppConfig.Set("keyboard_boot_logo", (checkBootLogo.Checked ? 1 : 0));
AppConfig.setConfig("keyboard_sleep_logo", (checkSleepLogo.Checked ? 1 : 0)); AppConfig.Set("keyboard_sleep_logo", (checkSleepLogo.Checked ? 1 : 0));
AppConfig.setConfig("keyboard_shutdown_logo", (checkShutdownLogo.Checked ? 1 : 0)); AppConfig.Set("keyboard_shutdown_logo", (checkShutdownLogo.Checked ? 1 : 0));
List<AuraDev19b6> flags = new List<AuraDev19b6>(); List<AuraDev19b6> flags = new List<AuraDev19b6>();
@@ -429,7 +429,7 @@ namespace GHelper
private void ComboKeyboardSpeed_SelectedValueChanged(object? sender, EventArgs e) private void ComboKeyboardSpeed_SelectedValueChanged(object? sender, EventArgs e)
{ {
AppConfig.setConfig("aura_speed", (int)comboKeyboardSpeed.SelectedValue); AppConfig.Set("aura_speed", (int)comboKeyboardSpeed.SelectedValue);
Program.settingsForm.SetAura(); Program.settingsForm.SetAura();
} }
@@ -450,7 +450,7 @@ namespace GHelper
private void checkAutoApplyWindowsPowerMode_CheckedChanged(object? sender, EventArgs e) private void checkAutoApplyWindowsPowerMode_CheckedChanged(object? sender, EventArgs e)
{ {
AppConfig.setConfig("auto_apply_power_plan", checkAutoApplyWindowsPowerMode.Checked ? 1 : 0); AppConfig.Set("auto_apply_power_plan", checkAutoApplyWindowsPowerMode.Checked ? 1 : 0);
} }
} }
} }

250
app/Fans.Designer.cs generated
View File

@@ -47,14 +47,18 @@ namespace GHelper
chartXGM = new Chart(); chartXGM = new Chart();
chartMid = new Chart(); chartMid = new Chart();
panelTitleFans = new Panel(); panelTitleFans = new Panel();
labelBoost = new Label(); buttonRename = new RButton();
comboBoost = new RComboBox(); buttonRemove = new RButton();
buttonAdd = new RButton();
comboModes = new RComboBox();
picturePerf = new PictureBox(); picturePerf = new PictureBox();
labelFans = new Label(); labelFans = new Label();
panelApplyFans = new Panel(); panelApplyFans = new Panel();
labelFansResult = new Label(); labelFansResult = new Label();
checkApplyFans = new RCheckBox(); checkApplyFans = new RCheckBox();
buttonReset = new RButton(); buttonReset = new RButton();
labelBoost = new Label();
comboBoost = new RComboBox();
panelSliders = new Panel(); panelSliders = new Panel();
panelPower = new Panel(); panelPower = new Panel();
panelApplyPower = new Panel(); panelApplyPower = new Panel();
@@ -72,6 +76,7 @@ namespace GHelper
labelA0 = new Label(); labelA0 = new Label();
labelLeftA0 = new Label(); labelLeftA0 = new Label();
trackA0 = new TrackBar(); trackA0 = new TrackBar();
panelBoost = new Panel();
panelTitleCPU = new Panel(); panelTitleCPU = new Panel();
pictureBox1 = new PictureBox(); pictureBox1 = new PictureBox();
labelPowerLimits = new Label(); labelPowerLimits = new Label();
@@ -113,6 +118,7 @@ namespace GHelper
((System.ComponentModel.ISupportInitialize)trackC1).BeginInit(); ((System.ComponentModel.ISupportInitialize)trackC1).BeginInit();
panelA0.SuspendLayout(); panelA0.SuspendLayout();
((System.ComponentModel.ISupportInitialize)trackA0).BeginInit(); ((System.ComponentModel.ISupportInitialize)trackA0).BeginInit();
panelBoost.SuspendLayout();
panelTitleCPU.SuspendLayout(); panelTitleCPU.SuspendLayout();
((System.ComponentModel.ISupportInitialize)pictureBox1).BeginInit(); ((System.ComponentModel.ISupportInitialize)pictureBox1).BeginInit();
panelGPU.SuspendLayout(); panelGPU.SuspendLayout();
@@ -239,8 +245,10 @@ namespace GHelper
// //
// panelTitleFans // panelTitleFans
// //
panelTitleFans.Controls.Add(labelBoost); panelTitleFans.Controls.Add(buttonRename);
panelTitleFans.Controls.Add(comboBoost); panelTitleFans.Controls.Add(buttonRemove);
panelTitleFans.Controls.Add(buttonAdd);
panelTitleFans.Controls.Add(comboModes);
panelTitleFans.Controls.Add(picturePerf); panelTitleFans.Controls.Add(picturePerf);
panelTitleFans.Controls.Add(labelFans); panelTitleFans.Controls.Add(labelFans);
panelTitleFans.Dock = DockStyle.Top; panelTitleFans.Dock = DockStyle.Top;
@@ -249,35 +257,75 @@ namespace GHelper
panelTitleFans.Size = new Size(805, 66); panelTitleFans.Size = new Size(805, 66);
panelTitleFans.TabIndex = 42; panelTitleFans.TabIndex = 42;
// //
// labelBoost // buttonRename
// //
labelBoost.Anchor = AnchorStyles.Top | AnchorStyles.Right; buttonRename.Activated = false;
labelBoost.Location = new Point(356, 20); buttonRename.Anchor = AnchorStyles.Top | AnchorStyles.Right;
labelBoost.Name = "labelBoost"; buttonRename.BackColor = SystemColors.ControlLight;
labelBoost.Size = new Size(140, 32); buttonRename.BorderColor = Color.Transparent;
labelBoost.TabIndex = 43; buttonRename.BorderRadius = 2;
labelBoost.Text = "CPU Boost"; buttonRename.FlatStyle = FlatStyle.Flat;
labelBoost.TextAlign = ContentAlignment.MiddleRight; buttonRename.Image = Properties.Resources.icons8_edit_32;
buttonRename.Location = new Point(374, 12);
buttonRename.Margin = new Padding(4, 2, 4, 2);
buttonRename.Name = "buttonRename";
buttonRename.Secondary = true;
buttonRename.Size = new Size(52, 46);
buttonRename.TabIndex = 45;
buttonRename.UseVisualStyleBackColor = false;
// //
// comboBoost // buttonRemove
// //
comboBoost.Anchor = AnchorStyles.Top | AnchorStyles.Left | AnchorStyles.Right; buttonRemove.Activated = false;
comboBoost.BorderColor = Color.White; buttonRemove.Anchor = AnchorStyles.Top | AnchorStyles.Right;
comboBoost.ButtonColor = Color.FromArgb(255, 255, 255); buttonRemove.BackColor = SystemColors.ControlLight;
comboBoost.DropDownStyle = ComboBoxStyle.DropDownList; buttonRemove.BorderColor = Color.Transparent;
comboBoost.FormattingEnabled = true; buttonRemove.BorderRadius = 2;
comboBoost.Items.AddRange(new object[] { "Disabled", "Enabled", "Aggressive", "Efficient Enabled", "Efficient Aggressive" }); buttonRemove.FlatStyle = FlatStyle.Flat;
comboBoost.Location = new Point(506, 16); buttonRemove.Image = Properties.Resources.icons8_remove_64;
comboBoost.Name = "comboBoost"; buttonRemove.Location = new Point(319, 12);
comboBoost.Size = new Size(287, 40); buttonRemove.Margin = new Padding(4, 2, 4, 2);
comboBoost.TabIndex = 42; buttonRemove.Name = "buttonRemove";
buttonRemove.Secondary = true;
buttonRemove.Size = new Size(52, 46);
buttonRemove.TabIndex = 44;
buttonRemove.UseVisualStyleBackColor = false;
//
// buttonAdd
//
buttonAdd.Activated = false;
buttonAdd.Anchor = AnchorStyles.Top | AnchorStyles.Right;
buttonAdd.BackColor = SystemColors.ControlLight;
buttonAdd.BorderColor = Color.Transparent;
buttonAdd.BorderRadius = 2;
buttonAdd.FlatStyle = FlatStyle.Flat;
buttonAdd.Image = Properties.Resources.icons8_add_64;
buttonAdd.Location = new Point(742, 12);
buttonAdd.Margin = new Padding(4, 2, 4, 2);
buttonAdd.Name = "buttonAdd";
buttonAdd.Secondary = true;
buttonAdd.Size = new Size(52, 46);
buttonAdd.TabIndex = 43;
buttonAdd.UseVisualStyleBackColor = false;
//
// comboModes
//
comboModes.Anchor = AnchorStyles.Top | AnchorStyles.Right;
comboModes.BorderColor = Color.White;
comboModes.ButtonColor = Color.FromArgb(255, 255, 255);
comboModes.FlatStyle = FlatStyle.Flat;
comboModes.FormattingEnabled = true;
comboModes.Location = new Point(434, 16);
comboModes.Name = "comboModes";
comboModes.Size = new Size(302, 40);
comboModes.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(20, 18); picturePerf.Location = new Point(18, 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);
@@ -288,12 +336,12 @@ namespace GHelper
// //
labelFans.AutoSize = true; 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(62, 20); labelFans.Location = new Point(53, 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(90, 32);
labelFans.TabIndex = 40; labelFans.TabIndex = 40;
labelFans.Text = "Fan Curves"; labelFans.Text = "Profile";
// //
// panelApplyFans // panelApplyFans
// //
@@ -348,6 +396,28 @@ namespace GHelper
buttonReset.Text = Properties.Strings.FactoryDefaults; buttonReset.Text = Properties.Strings.FactoryDefaults;
buttonReset.UseVisualStyleBackColor = false; buttonReset.UseVisualStyleBackColor = false;
// //
// labelBoost
//
labelBoost.Location = new Point(10, 10);
labelBoost.Name = "labelBoost";
labelBoost.Size = new Size(201, 40);
labelBoost.TabIndex = 43;
labelBoost.Text = "CPU Boost";
labelBoost.TextAlign = ContentAlignment.MiddleLeft;
//
// comboBoost
//
comboBoost.Anchor = AnchorStyles.Top | AnchorStyles.Left | AnchorStyles.Right;
comboBoost.BorderColor = Color.White;
comboBoost.ButtonColor = Color.FromArgb(255, 255, 255);
comboBoost.DropDownStyle = ComboBoxStyle.DropDownList;
comboBoost.FormattingEnabled = true;
comboBoost.Items.AddRange(new object[] { "Disabled", "Enabled", "Aggressive", "Efficient Enabled", "Efficient Aggressive" });
comboBoost.Location = new Point(226, 10);
comboBoost.Name = "comboBoost";
comboBoost.Size = new Size(287, 40);
comboBoost.TabIndex = 42;
//
// panelSliders // panelSliders
// //
panelSliders.Controls.Add(panelPower); panelSliders.Controls.Add(panelPower);
@@ -369,18 +439,19 @@ namespace GHelper
panelPower.Controls.Add(panelB0); panelPower.Controls.Add(panelB0);
panelPower.Controls.Add(panelC1); panelPower.Controls.Add(panelC1);
panelPower.Controls.Add(panelA0); panelPower.Controls.Add(panelA0);
panelPower.Controls.Add(panelBoost);
panelPower.Controls.Add(panelTitleCPU); panelPower.Controls.Add(panelTitleCPU);
panelPower.Dock = DockStyle.Fill; panelPower.Dock = DockStyle.Fill;
panelPower.Location = new Point(10, 652); panelPower.Location = new Point(10, 584);
panelPower.Name = "panelPower"; panelPower.Name = "panelPower";
panelPower.Size = new Size(523, 658); panelPower.Size = new Size(523, 726);
panelPower.TabIndex = 43; panelPower.TabIndex = 43;
// //
// panelApplyPower // panelApplyPower
// //
panelApplyPower.Controls.Add(checkApplyPower); panelApplyPower.Controls.Add(checkApplyPower);
panelApplyPower.Dock = DockStyle.Bottom; panelApplyPower.Dock = DockStyle.Bottom;
panelApplyPower.Location = new Point(0, 568); panelApplyPower.Location = new Point(0, 636);
panelApplyPower.Name = "panelApplyPower"; panelApplyPower.Name = "panelApplyPower";
panelApplyPower.Padding = new Padding(10); panelApplyPower.Padding = new Padding(10);
panelApplyPower.Size = new Size(523, 90); panelApplyPower.Size = new Size(523, 90);
@@ -403,11 +474,11 @@ namespace GHelper
// labelInfo // labelInfo
// //
labelInfo.Dock = DockStyle.Top; labelInfo.Dock = DockStyle.Top;
labelInfo.Location = new Point(0, 482); labelInfo.Location = new Point(0, 506);
labelInfo.Margin = new Padding(4, 0, 4, 0); labelInfo.Margin = new Padding(4, 0, 4, 0);
labelInfo.Name = "labelInfo"; labelInfo.Name = "labelInfo";
labelInfo.Padding = new Padding(5); labelInfo.Padding = new Padding(5);
labelInfo.Size = new Size(523, 149); labelInfo.Size = new Size(523, 100);
labelInfo.TabIndex = 43; labelInfo.TabIndex = 43;
labelInfo.Text = "Experimental Feature"; labelInfo.Text = "Experimental Feature";
// //
@@ -419,20 +490,20 @@ namespace GHelper
panelB0.Controls.Add(labelLeftB0); panelB0.Controls.Add(labelLeftB0);
panelB0.Controls.Add(trackB0); panelB0.Controls.Add(trackB0);
panelB0.Dock = DockStyle.Top; panelB0.Dock = DockStyle.Top;
panelB0.Location = new Point(0, 346); panelB0.Location = new Point(0, 381);
panelB0.Margin = new Padding(4); panelB0.Margin = new Padding(4);
panelB0.MaximumSize = new Size(0, 125);
panelB0.Name = "panelB0"; panelB0.Name = "panelB0";
panelB0.Size = new Size(523, 136); panelB0.Size = new Size(523, 125);
panelB0.TabIndex = 41; panelB0.TabIndex = 41;
// //
// labelB0 // labelB0
// //
labelB0.Anchor = AnchorStyles.Top | AnchorStyles.Right;
labelB0.Font = new Font("Segoe UI", 9F, FontStyle.Bold, GraphicsUnit.Point); labelB0.Font = new Font("Segoe UI", 9F, FontStyle.Bold, GraphicsUnit.Point);
labelB0.Location = new Point(398, 8); labelB0.Location = new Point(398, 8);
labelB0.Margin = new Padding(4, 0, 4, 0); labelB0.Margin = new Padding(4, 0, 4, 0);
labelB0.Name = "labelB0"; labelB0.Name = "labelB0";
labelB0.Size = new Size(120, 32); labelB0.Size = new Size(115, 32);
labelB0.TabIndex = 13; labelB0.TabIndex = 13;
labelB0.Text = "CPU"; labelB0.Text = "CPU";
labelB0.TextAlign = ContentAlignment.TopRight; labelB0.TextAlign = ContentAlignment.TopRight;
@@ -449,13 +520,12 @@ namespace GHelper
// //
// trackB0 // trackB0
// //
trackB0.Anchor = AnchorStyles.Top | AnchorStyles.Left | AnchorStyles.Right;
trackB0.Location = new Point(6, 44); trackB0.Location = new Point(6, 44);
trackB0.Margin = new Padding(4, 2, 4, 2); trackB0.Margin = new Padding(4, 2, 4, 2);
trackB0.Maximum = 85; trackB0.Maximum = 85;
trackB0.Minimum = 5; trackB0.Minimum = 5;
trackB0.Name = "trackB0"; trackB0.Name = "trackB0";
trackB0.Size = new Size(513, 90); trackB0.Size = new Size(508, 90);
trackB0.TabIndex = 11; trackB0.TabIndex = 11;
trackB0.TickFrequency = 5; trackB0.TickFrequency = 5;
trackB0.TickStyle = TickStyle.TopLeft; trackB0.TickStyle = TickStyle.TopLeft;
@@ -469,22 +539,22 @@ namespace GHelper
panelC1.Controls.Add(labelLeftC1); panelC1.Controls.Add(labelLeftC1);
panelC1.Controls.Add(trackC1); panelC1.Controls.Add(trackC1);
panelC1.Dock = DockStyle.Top; panelC1.Dock = DockStyle.Top;
panelC1.Location = new Point(0, 206); panelC1.Location = new Point(0, 256);
panelC1.Margin = new Padding(4); panelC1.Margin = new Padding(4);
panelC1.MaximumSize = new Size(0, 125);
panelC1.Name = "panelC1"; panelC1.Name = "panelC1";
panelC1.Size = new Size(523, 140); panelC1.Size = new Size(523, 125);
panelC1.TabIndex = 45; panelC1.TabIndex = 45;
// //
// labelC1 // labelC1
// //
labelC1.Anchor = AnchorStyles.Top | AnchorStyles.Right;
labelC1.Font = new Font("Segoe UI", 9F, FontStyle.Bold, GraphicsUnit.Point); labelC1.Font = new Font("Segoe UI", 9F, FontStyle.Bold, GraphicsUnit.Point);
labelC1.Location = new Point(396, 8); labelC1.Location = new Point(396, 8);
labelC1.Margin = new Padding(4, 0, 4, 0); labelC1.Margin = new Padding(4, 0, 4, 0);
labelC1.Name = "labelC1"; labelC1.Name = "labelC1";
labelC1.Size = new Size(119, 32); labelC1.Size = new Size(114, 32);
labelC1.TabIndex = 13; labelC1.TabIndex = 13;
labelC1.Text = "APU"; labelC1.Text = "C1";
labelC1.TextAlign = ContentAlignment.TopRight; labelC1.TextAlign = ContentAlignment.TopRight;
// //
// labelLeftC1 // labelLeftC1
@@ -493,19 +563,18 @@ namespace GHelper
labelLeftC1.Location = new Point(10, 8); labelLeftC1.Location = new Point(10, 8);
labelLeftC1.Margin = new Padding(4, 0, 4, 0); labelLeftC1.Margin = new Padding(4, 0, 4, 0);
labelLeftC1.Name = "labelLeftC1"; labelLeftC1.Name = "labelLeftC1";
labelLeftC1.Size = new Size(58, 32); labelLeftC1.Size = new Size(42, 32);
labelLeftC1.TabIndex = 12; labelLeftC1.TabIndex = 12;
labelLeftC1.Text = "APU"; labelLeftC1.Text = "C1";
// //
// trackC1 // trackC1
// //
trackC1.Anchor = AnchorStyles.Top | AnchorStyles.Left | AnchorStyles.Right;
trackC1.Location = new Point(6, 48); trackC1.Location = new Point(6, 48);
trackC1.Margin = new Padding(4, 2, 4, 2); trackC1.Margin = new Padding(4, 2, 4, 2);
trackC1.Maximum = 85; trackC1.Maximum = 85;
trackC1.Minimum = 5; trackC1.Minimum = 5;
trackC1.Name = "trackC1"; trackC1.Name = "trackC1";
trackC1.Size = new Size(513, 90); trackC1.Size = new Size(508, 90);
trackC1.TabIndex = 11; trackC1.TabIndex = 11;
trackC1.TickFrequency = 5; trackC1.TickFrequency = 5;
trackC1.TickStyle = TickStyle.TopLeft; trackC1.TickStyle = TickStyle.TopLeft;
@@ -519,20 +588,20 @@ namespace GHelper
panelA0.Controls.Add(labelLeftA0); panelA0.Controls.Add(labelLeftA0);
panelA0.Controls.Add(trackA0); panelA0.Controls.Add(trackA0);
panelA0.Dock = DockStyle.Top; panelA0.Dock = DockStyle.Top;
panelA0.Location = new Point(0, 66); panelA0.Location = new Point(0, 131);
panelA0.Margin = new Padding(4); panelA0.Margin = new Padding(4);
panelA0.MaximumSize = new Size(0, 125);
panelA0.Name = "panelA0"; panelA0.Name = "panelA0";
panelA0.Size = new Size(523, 140); panelA0.Size = new Size(523, 125);
panelA0.TabIndex = 40; panelA0.TabIndex = 40;
// //
// labelA0 // labelA0
// //
labelA0.Anchor = AnchorStyles.Top | AnchorStyles.Right;
labelA0.Font = new Font("Segoe UI", 9F, FontStyle.Bold, GraphicsUnit.Point); labelA0.Font = new Font("Segoe UI", 9F, FontStyle.Bold, GraphicsUnit.Point);
labelA0.Location = new Point(396, 10); labelA0.Location = new Point(396, 10);
labelA0.Margin = new Padding(4, 0, 4, 0); labelA0.Margin = new Padding(4, 0, 4, 0);
labelA0.Name = "labelA0"; labelA0.Name = "labelA0";
labelA0.Size = new Size(122, 32); labelA0.Size = new Size(117, 32);
labelA0.TabIndex = 12; labelA0.TabIndex = 12;
labelA0.Text = "Platform"; labelA0.Text = "Platform";
labelA0.TextAlign = ContentAlignment.TopRight; labelA0.TextAlign = ContentAlignment.TopRight;
@@ -549,18 +618,27 @@ namespace GHelper
// //
// trackA0 // trackA0
// //
trackA0.Anchor = AnchorStyles.Top | AnchorStyles.Left | AnchorStyles.Right;
trackA0.Location = new Point(6, 48); trackA0.Location = new Point(6, 48);
trackA0.Margin = new Padding(4, 2, 4, 2); trackA0.Margin = new Padding(4, 2, 4, 2);
trackA0.Maximum = 180; trackA0.Maximum = 180;
trackA0.Minimum = 10; trackA0.Minimum = 10;
trackA0.Name = "trackA0"; trackA0.Name = "trackA0";
trackA0.Size = new Size(513, 90); trackA0.Size = new Size(508, 90);
trackA0.TabIndex = 10; trackA0.TabIndex = 10;
trackA0.TickFrequency = 5; trackA0.TickFrequency = 5;
trackA0.TickStyle = TickStyle.TopLeft; trackA0.TickStyle = TickStyle.TopLeft;
trackA0.Value = 125; trackA0.Value = 125;
// //
// panelBoost
//
panelBoost.Controls.Add(comboBoost);
panelBoost.Controls.Add(labelBoost);
panelBoost.Dock = DockStyle.Top;
panelBoost.Location = new Point(0, 66);
panelBoost.Name = "panelBoost";
panelBoost.Size = new Size(523, 65);
panelBoost.TabIndex = 13;
//
// panelTitleCPU // panelTitleCPU
// //
panelTitleCPU.AutoSize = true; panelTitleCPU.AutoSize = true;
@@ -578,7 +656,7 @@ namespace GHelper
pictureBox1.BackgroundImage = Properties.Resources.icons8_processor_96; pictureBox1.BackgroundImage = Properties.Resources.icons8_processor_96;
pictureBox1.BackgroundImageLayout = ImageLayout.Zoom; pictureBox1.BackgroundImageLayout = ImageLayout.Zoom;
pictureBox1.InitialImage = null; pictureBox1.InitialImage = null;
pictureBox1.Location = new Point(18, 18); pictureBox1.Location = new Point(16, 18);
pictureBox1.Margin = new Padding(4, 2, 4, 10); pictureBox1.Margin = new Padding(4, 2, 4, 10);
pictureBox1.Name = "pictureBox1"; pictureBox1.Name = "pictureBox1";
pictureBox1.Size = new Size(36, 38); pictureBox1.Size = new Size(36, 38);
@@ -589,12 +667,12 @@ namespace GHelper
// //
labelPowerLimits.AutoSize = true; labelPowerLimits.AutoSize = true;
labelPowerLimits.Font = new Font("Segoe UI", 9F, FontStyle.Bold, GraphicsUnit.Point); labelPowerLimits.Font = new Font("Segoe UI", 9F, FontStyle.Bold, GraphicsUnit.Point);
labelPowerLimits.Location = new Point(62, 20); labelPowerLimits.Location = new Point(53, 20);
labelPowerLimits.Margin = new Padding(4, 0, 4, 0); labelPowerLimits.Margin = new Padding(4, 0, 4, 0);
labelPowerLimits.Name = "labelPowerLimits"; labelPowerLimits.Name = "labelPowerLimits";
labelPowerLimits.Size = new Size(229, 32); labelPowerLimits.Size = new Size(160, 32);
labelPowerLimits.TabIndex = 39; labelPowerLimits.TabIndex = 39;
labelPowerLimits.Text = "Power Limits (PPT)"; labelPowerLimits.Text = "Power Limits";
// //
// panelGPU // panelGPU
// //
@@ -608,7 +686,7 @@ namespace GHelper
panelGPU.Location = new Point(10, 0); panelGPU.Location = new Point(10, 0);
panelGPU.Name = "panelGPU"; panelGPU.Name = "panelGPU";
panelGPU.Padding = new Padding(0, 0, 0, 18); panelGPU.Padding = new Padding(0, 0, 0, 18);
panelGPU.Size = new Size(523, 652); panelGPU.Size = new Size(523, 584);
panelGPU.TabIndex = 44; panelGPU.TabIndex = 44;
// //
// panelGPUTemp // panelGPUTemp
@@ -619,18 +697,18 @@ namespace GHelper
panelGPUTemp.Controls.Add(labelGPUTempTitle); panelGPUTemp.Controls.Add(labelGPUTempTitle);
panelGPUTemp.Controls.Add(trackGPUTemp); panelGPUTemp.Controls.Add(trackGPUTemp);
panelGPUTemp.Dock = DockStyle.Top; panelGPUTemp.Dock = DockStyle.Top;
panelGPUTemp.Location = new Point(0, 485); panelGPUTemp.Location = new Point(0, 441);
panelGPUTemp.MaximumSize = new Size(0, 125);
panelGPUTemp.Name = "panelGPUTemp"; panelGPUTemp.Name = "panelGPUTemp";
panelGPUTemp.Size = new Size(523, 149); panelGPUTemp.Size = new Size(523, 125);
panelGPUTemp.TabIndex = 47; panelGPUTemp.TabIndex = 47;
// //
// labelGPUTemp // labelGPUTemp
// //
labelGPUTemp.Anchor = AnchorStyles.Top | AnchorStyles.Right;
labelGPUTemp.Font = new Font("Segoe UI", 9F, FontStyle.Bold, GraphicsUnit.Point); labelGPUTemp.Font = new Font("Segoe UI", 9F, FontStyle.Bold, GraphicsUnit.Point);
labelGPUTemp.Location = new Point(378, 14); labelGPUTemp.Location = new Point(378, 14);
labelGPUTemp.Name = "labelGPUTemp"; labelGPUTemp.Name = "labelGPUTemp";
labelGPUTemp.Size = new Size(130, 32); labelGPUTemp.Size = new Size(125, 32);
labelGPUTemp.TabIndex = 44; labelGPUTemp.TabIndex = 44;
labelGPUTemp.Text = "87C"; labelGPUTemp.Text = "87C";
labelGPUTemp.TextAlign = ContentAlignment.TopRight; labelGPUTemp.TextAlign = ContentAlignment.TopRight;
@@ -646,13 +724,12 @@ namespace GHelper
// //
// trackGPUTemp // trackGPUTemp
// //
trackGPUTemp.Anchor = AnchorStyles.Top | AnchorStyles.Left | AnchorStyles.Right;
trackGPUTemp.Location = new Point(6, 57); trackGPUTemp.Location = new Point(6, 57);
trackGPUTemp.Margin = new Padding(4, 2, 4, 2); trackGPUTemp.Margin = new Padding(4, 2, 4, 2);
trackGPUTemp.Maximum = 87; trackGPUTemp.Maximum = 87;
trackGPUTemp.Minimum = 75; trackGPUTemp.Minimum = 75;
trackGPUTemp.Name = "trackGPUTemp"; trackGPUTemp.Name = "trackGPUTemp";
trackGPUTemp.Size = new Size(502, 90); trackGPUTemp.Size = new Size(497, 90);
trackGPUTemp.TabIndex = 42; trackGPUTemp.TabIndex = 42;
trackGPUTemp.TickFrequency = 5; trackGPUTemp.TickFrequency = 5;
trackGPUTemp.TickStyle = TickStyle.TopLeft; trackGPUTemp.TickStyle = TickStyle.TopLeft;
@@ -666,18 +743,18 @@ namespace GHelper
panelGPUBoost.Controls.Add(labelGPUBoostTitle); panelGPUBoost.Controls.Add(labelGPUBoostTitle);
panelGPUBoost.Controls.Add(trackGPUBoost); panelGPUBoost.Controls.Add(trackGPUBoost);
panelGPUBoost.Dock = DockStyle.Top; panelGPUBoost.Dock = DockStyle.Top;
panelGPUBoost.Location = new Point(0, 345); panelGPUBoost.Location = new Point(0, 316);
panelGPUBoost.MaximumSize = new Size(0, 125);
panelGPUBoost.Name = "panelGPUBoost"; panelGPUBoost.Name = "panelGPUBoost";
panelGPUBoost.Size = new Size(523, 140); panelGPUBoost.Size = new Size(523, 125);
panelGPUBoost.TabIndex = 46; panelGPUBoost.TabIndex = 46;
// //
// labelGPUBoost // labelGPUBoost
// //
labelGPUBoost.Anchor = AnchorStyles.Top | AnchorStyles.Right;
labelGPUBoost.Font = new Font("Segoe UI", 9F, FontStyle.Bold, GraphicsUnit.Point); labelGPUBoost.Font = new Font("Segoe UI", 9F, FontStyle.Bold, GraphicsUnit.Point);
labelGPUBoost.Location = new Point(374, 14); labelGPUBoost.Location = new Point(374, 14);
labelGPUBoost.Name = "labelGPUBoost"; labelGPUBoost.Name = "labelGPUBoost";
labelGPUBoost.Size = new Size(130, 32); labelGPUBoost.Size = new Size(125, 32);
labelGPUBoost.TabIndex = 44; labelGPUBoost.TabIndex = 44;
labelGPUBoost.Text = "25W"; labelGPUBoost.Text = "25W";
labelGPUBoost.TextAlign = ContentAlignment.TopRight; labelGPUBoost.TextAlign = ContentAlignment.TopRight;
@@ -693,13 +770,12 @@ namespace GHelper
// //
// trackGPUBoost // trackGPUBoost
// //
trackGPUBoost.Anchor = AnchorStyles.Top | AnchorStyles.Left | AnchorStyles.Right;
trackGPUBoost.Location = new Point(6, 48); trackGPUBoost.Location = new Point(6, 48);
trackGPUBoost.Margin = new Padding(4, 2, 4, 2); trackGPUBoost.Margin = new Padding(4, 2, 4, 2);
trackGPUBoost.Maximum = 25; trackGPUBoost.Maximum = 25;
trackGPUBoost.Minimum = 5; trackGPUBoost.Minimum = 5;
trackGPUBoost.Name = "trackGPUBoost"; trackGPUBoost.Name = "trackGPUBoost";
trackGPUBoost.Size = new Size(502, 90); trackGPUBoost.Size = new Size(497, 90);
trackGPUBoost.TabIndex = 42; trackGPUBoost.TabIndex = 42;
trackGPUBoost.TickFrequency = 5; trackGPUBoost.TickFrequency = 5;
trackGPUBoost.TickStyle = TickStyle.TopLeft; trackGPUBoost.TickStyle = TickStyle.TopLeft;
@@ -713,18 +789,18 @@ namespace GHelper
panelGPUMemory.Controls.Add(labelGPUMemoryTitle); panelGPUMemory.Controls.Add(labelGPUMemoryTitle);
panelGPUMemory.Controls.Add(trackGPUMemory); panelGPUMemory.Controls.Add(trackGPUMemory);
panelGPUMemory.Dock = DockStyle.Top; panelGPUMemory.Dock = DockStyle.Top;
panelGPUMemory.Location = new Point(0, 205); panelGPUMemory.Location = new Point(0, 191);
panelGPUMemory.MaximumSize = new Size(0, 125);
panelGPUMemory.Name = "panelGPUMemory"; panelGPUMemory.Name = "panelGPUMemory";
panelGPUMemory.Size = new Size(523, 140); panelGPUMemory.Size = new Size(523, 125);
panelGPUMemory.TabIndex = 45; panelGPUMemory.TabIndex = 45;
// //
// labelGPUMemory // labelGPUMemory
// //
labelGPUMemory.Anchor = AnchorStyles.Top | AnchorStyles.Right;
labelGPUMemory.Font = new Font("Segoe UI", 9F, FontStyle.Bold, GraphicsUnit.Point); labelGPUMemory.Font = new Font("Segoe UI", 9F, FontStyle.Bold, GraphicsUnit.Point);
labelGPUMemory.Location = new Point(378, 14); labelGPUMemory.Location = new Point(344, 14);
labelGPUMemory.Name = "labelGPUMemory"; labelGPUMemory.Name = "labelGPUMemory";
labelGPUMemory.Size = new Size(130, 32); labelGPUMemory.Size = new Size(159, 32);
labelGPUMemory.TabIndex = 44; labelGPUMemory.TabIndex = 44;
labelGPUMemory.Text = "2000 MHz"; labelGPUMemory.Text = "2000 MHz";
labelGPUMemory.TextAlign = ContentAlignment.TopRight; labelGPUMemory.TextAlign = ContentAlignment.TopRight;
@@ -740,13 +816,12 @@ namespace GHelper
// //
// trackGPUMemory // trackGPUMemory
// //
trackGPUMemory.Anchor = AnchorStyles.Top | AnchorStyles.Left | AnchorStyles.Right;
trackGPUMemory.LargeChange = 100; trackGPUMemory.LargeChange = 100;
trackGPUMemory.Location = new Point(6, 48); trackGPUMemory.Location = new Point(6, 48);
trackGPUMemory.Margin = new Padding(4, 2, 4, 2); trackGPUMemory.Margin = new Padding(4, 2, 4, 2);
trackGPUMemory.Maximum = 300; trackGPUMemory.Maximum = 300;
trackGPUMemory.Name = "trackGPUMemory"; trackGPUMemory.Name = "trackGPUMemory";
trackGPUMemory.Size = new Size(502, 90); trackGPUMemory.Size = new Size(497, 90);
trackGPUMemory.SmallChange = 10; trackGPUMemory.SmallChange = 10;
trackGPUMemory.TabIndex = 42; trackGPUMemory.TabIndex = 42;
trackGPUMemory.TickFrequency = 50; trackGPUMemory.TickFrequency = 50;
@@ -761,31 +836,30 @@ namespace GHelper
panelGPUCore.Controls.Add(labelGPUCoreTitle); panelGPUCore.Controls.Add(labelGPUCoreTitle);
panelGPUCore.Dock = DockStyle.Top; panelGPUCore.Dock = DockStyle.Top;
panelGPUCore.Location = new Point(0, 66); panelGPUCore.Location = new Point(0, 66);
panelGPUCore.MaximumSize = new Size(0, 125);
panelGPUCore.Name = "panelGPUCore"; panelGPUCore.Name = "panelGPUCore";
panelGPUCore.Size = new Size(523, 139); panelGPUCore.Size = new Size(523, 125);
panelGPUCore.TabIndex = 44; panelGPUCore.TabIndex = 44;
// //
// labelGPUCore // labelGPUCore
// //
labelGPUCore.Anchor = AnchorStyles.Top | AnchorStyles.Right;
labelGPUCore.Font = new Font("Segoe UI", 9F, FontStyle.Bold, GraphicsUnit.Point); labelGPUCore.Font = new Font("Segoe UI", 9F, FontStyle.Bold, GraphicsUnit.Point);
labelGPUCore.Location = new Point(378, 15); labelGPUCore.Location = new Point(326, 15);
labelGPUCore.Name = "labelGPUCore"; labelGPUCore.Name = "labelGPUCore";
labelGPUCore.Size = new Size(130, 32); labelGPUCore.Size = new Size(177, 32);
labelGPUCore.TabIndex = 29; labelGPUCore.TabIndex = 29;
labelGPUCore.Text = "1500 MHz"; labelGPUCore.Text = "1500 MHz";
labelGPUCore.TextAlign = ContentAlignment.TopRight; labelGPUCore.TextAlign = ContentAlignment.TopRight;
// //
// trackGPUCore // trackGPUCore
// //
trackGPUCore.Anchor = AnchorStyles.Top | AnchorStyles.Left | AnchorStyles.Right;
trackGPUCore.LargeChange = 100; trackGPUCore.LargeChange = 100;
trackGPUCore.Location = new Point(6, 47); trackGPUCore.Location = new Point(6, 47);
trackGPUCore.Margin = new Padding(4, 2, 4, 2); trackGPUCore.Margin = new Padding(4, 2, 4, 2);
trackGPUCore.Maximum = 300; trackGPUCore.Maximum = 300;
trackGPUCore.Name = "trackGPUCore"; trackGPUCore.Name = "trackGPUCore";
trackGPUCore.RightToLeft = RightToLeft.No; trackGPUCore.RightToLeft = RightToLeft.No;
trackGPUCore.Size = new Size(502, 90); trackGPUCore.Size = new Size(497, 90);
trackGPUCore.SmallChange = 10; trackGPUCore.SmallChange = 10;
trackGPUCore.TabIndex = 18; trackGPUCore.TabIndex = 18;
trackGPUCore.TickFrequency = 50; trackGPUCore.TickFrequency = 50;
@@ -818,7 +892,7 @@ namespace GHelper
pictureGPU.BackgroundImageLayout = ImageLayout.Zoom; pictureGPU.BackgroundImageLayout = ImageLayout.Zoom;
pictureGPU.ErrorImage = null; pictureGPU.ErrorImage = null;
pictureGPU.InitialImage = null; pictureGPU.InitialImage = null;
pictureGPU.Location = new Point(18, 18); pictureGPU.Location = new Point(16, 18);
pictureGPU.Margin = new Padding(4, 2, 4, 10); pictureGPU.Margin = new Padding(4, 2, 4, 10);
pictureGPU.Name = "pictureGPU"; pictureGPU.Name = "pictureGPU";
pictureGPU.Size = new Size(36, 38); pictureGPU.Size = new Size(36, 38);
@@ -829,7 +903,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, 20); labelGPU.Location = new Point(52, 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);
@@ -881,6 +955,7 @@ namespace GHelper
panelA0.ResumeLayout(false); panelA0.ResumeLayout(false);
panelA0.PerformLayout(); panelA0.PerformLayout();
((System.ComponentModel.ISupportInitialize)trackA0).EndInit(); ((System.ComponentModel.ISupportInitialize)trackA0).EndInit();
panelBoost.ResumeLayout(false);
panelTitleCPU.ResumeLayout(false); panelTitleCPU.ResumeLayout(false);
panelTitleCPU.PerformLayout(); panelTitleCPU.PerformLayout();
((System.ComponentModel.ISupportInitialize)pictureBox1).EndInit(); ((System.ComponentModel.ISupportInitialize)pictureBox1).EndInit();
@@ -962,5 +1037,10 @@ namespace GHelper
private Label labelC1; private Label labelC1;
private Label labelLeftC1; private Label labelLeftC1;
private TrackBar trackC1; private TrackBar trackC1;
private Panel panelBoost;
private RComboBox comboModes;
private RButton buttonAdd;
private RButton buttonRemove;
private RButton buttonRename;
} }
} }

View File

@@ -2,6 +2,7 @@
using GHelper.Gpu; using GHelper.Gpu;
using System; using System;
using System.Diagnostics; using System.Diagnostics;
using System.Net.Sockets;
using System.Windows.Forms.DataVisualization.Charting; using System.Windows.Forms.DataVisualization.Charting;
namespace GHelper namespace GHelper
@@ -47,7 +48,7 @@ namespace GHelper
labelGPUBoostTitle.Text = Properties.Strings.GPUBoost; labelGPUBoostTitle.Text = Properties.Strings.GPUBoost;
labelGPUTempTitle.Text = Properties.Strings.GPUTempTarget; labelGPUTempTitle.Text = Properties.Strings.GPUTempTarget;
InitTheme(); InitTheme(true);
MinRPM = 18; MinRPM = 18;
MaxRPM = HardwareControl.GetFanMax(); MaxRPM = HardwareControl.GetFanMax();
@@ -127,6 +128,9 @@ namespace GHelper
labelInfo.Text = Properties.Strings.PPTExperimental; labelInfo.Text = Properties.Strings.PPTExperimental;
labelFansResult.Visible = false; labelFansResult.Visible = false;
FillModes();
InitMode();
InitFans(); InitFans();
InitPower(); InitPower();
InitBoost(); InitBoost();
@@ -134,11 +138,92 @@ namespace GHelper
comboBoost.SelectedValueChanged += ComboBoost_Changed; comboBoost.SelectedValueChanged += ComboBoost_Changed;
comboModes.SelectionChangeCommitted += ComboModes_SelectedValueChanged;
comboModes.TextChanged += ComboModes_TextChanged;
comboModes.KeyPress += ComboModes_KeyPress;
Shown += Fans_Shown; Shown += Fans_Shown;
buttonAdd.Click += ButtonAdd_Click;
buttonRemove.Click += ButtonRemove_Click;
buttonRename.Click += ButtonRename_Click;
} }
private void ComboModes_KeyPress(object? sender, KeyPressEventArgs e)
{
if (e.KeyChar == 13) RenameToggle();
}
private void ComboModes_TextChanged(object? sender, EventArgs e)
{
if (comboModes.DropDownStyle == ComboBoxStyle.DropDownList) return;
if (!Modes.IsCurrentCustom()) return;
AppConfig.SetMode("mode_name", comboModes.Text);
}
private void RenameToggle()
{
if (comboModes.DropDownStyle == ComboBoxStyle.DropDownList)
comboModes.DropDownStyle = ComboBoxStyle.Simple;
else
{
var mode = Modes.GetCurrent();
FillModes();
comboModes.SelectedValue = mode;
}
}
private void ButtonRename_Click(object? sender, EventArgs e)
{
RenameToggle();
}
private void ButtonRemove_Click(object? sender, EventArgs e)
{
int mode = Modes.GetCurrent();
if (!Modes.IsCurrentCustom()) return;
Modes.Remove(mode);
FillModes();
Program.settingsForm.SetPerformanceMode(AsusACPI.PerformanceBalanced);
}
private void FillModes()
{
comboModes.DropDownStyle = ComboBoxStyle.DropDownList;
comboModes.DataSource = new BindingSource(Modes.GetDictonary(), null);
comboModes.DisplayMember = "Value";
comboModes.ValueMember = "Key";
}
private void ButtonAdd_Click(object? sender, EventArgs e)
{
int mode = Modes.Add();
FillModes();
Program.settingsForm.SetPerformanceMode(mode);
}
public void InitMode()
{
int mode = Modes.GetCurrent();
comboModes.SelectedValue = mode;
buttonRename.Visible = buttonRemove.Visible = Modes.IsCurrentCustom();
}
private void ComboModes_SelectedValueChanged(object? sender, EventArgs e)
{
var selectedMode = comboModes.SelectedValue;
if (selectedMode == null) return;
if ((int)selectedMode == Modes.GetCurrent()) return;
Debug.WriteLine(selectedMode);
Program.settingsForm.SetPerformanceMode((int)selectedMode);
}
private void TrackGPU_MouseUp(object? sender, MouseEventArgs e) private void TrackGPU_MouseUp(object? sender, MouseEventArgs e)
{ {
@@ -171,10 +256,10 @@ namespace GHelper
{ {
gpuVisible = panelGPU.Visible = true; gpuVisible = panelGPU.Visible = true;
int gpu_boost = AppConfig.getConfigPerf("gpu_boost"); int gpu_boost = AppConfig.GetMode("gpu_boost");
int gpu_temp = AppConfig.getConfigPerf("gpu_temp"); int gpu_temp = AppConfig.GetMode("gpu_temp");
int core = AppConfig.getConfigPerf("gpu_core"); int core = AppConfig.GetMode("gpu_core");
int memory = AppConfig.getConfigPerf("gpu_memory"); int memory = AppConfig.GetMode("gpu_memory");
if (gpu_boost < 0) gpu_boost = AsusACPI.MaxGPUBoost; if (gpu_boost < 0) gpu_boost = AsusACPI.MaxGPUBoost;
if (gpu_temp < 0) gpu_temp = AsusACPI.MaxGPUTemp; if (gpu_temp < 0) gpu_temp = AsusACPI.MaxGPUTemp;
@@ -236,8 +321,8 @@ namespace GHelper
TrackBar track = (TrackBar)sender; TrackBar track = (TrackBar)sender;
track.Value = (int)Math.Round((float)track.Value / 5) * 5; track.Value = (int)Math.Round((float)track.Value / 5) * 5;
AppConfig.setConfigPerf("gpu_core", trackGPUCore.Value); AppConfig.SetMode("gpu_core", trackGPUCore.Value);
AppConfig.setConfigPerf("gpu_memory", trackGPUMemory.Value); AppConfig.SetMode("gpu_memory", trackGPUMemory.Value);
VisualiseGPUSettings(); VisualiseGPUSettings();
@@ -245,8 +330,8 @@ namespace GHelper
private void trackGPUPower_Scroll(object? sender, EventArgs e) private void trackGPUPower_Scroll(object? sender, EventArgs e)
{ {
AppConfig.setConfigPerf("gpu_boost", trackGPUBoost.Value); AppConfig.SetMode("gpu_boost", trackGPUBoost.Value);
AppConfig.setConfigPerf("gpu_temp", trackGPUTemp.Value); AppConfig.SetMode("gpu_temp", trackGPUTemp.Value);
VisualiseGPUSettings(); VisualiseGPUSettings();
} }
@@ -279,9 +364,6 @@ namespace GHelper
break; break;
} }
if (Program.settingsForm.perfName.Length > 0)
labelFans.Text = Properties.Strings.FanProfiles + ": " + Program.settingsForm.perfName;
chart.Titles[0].Text = title; chart.Titles[0].Text = title;
chart.ChartAreas[0].AxisX.Minimum = 10; chart.ChartAreas[0].AxisX.Minimum = 10;
@@ -349,11 +431,11 @@ namespace GHelper
private void ComboBoost_Changed(object? sender, EventArgs e) private void ComboBoost_Changed(object? sender, EventArgs e)
{ {
if (AppConfig.getConfigPerf("auto_boost") != comboBoost.SelectedIndex) if (AppConfig.GetMode("auto_boost") != comboBoost.SelectedIndex)
{ {
NativeMethods.SetCPUBoost(comboBoost.SelectedIndex); NativeMethods.SetCPUBoost(comboBoost.SelectedIndex);
AppConfig.setConfigPerf("auto_boost", comboBoost.SelectedIndex);
} }
AppConfig.SetMode("auto_boost", comboBoost.SelectedIndex);
} }
private void CheckApplyPower_Click(object? sender, EventArgs e) private void CheckApplyPower_Click(object? sender, EventArgs e)
@@ -361,7 +443,7 @@ namespace GHelper
if (sender is null) return; if (sender is null) return;
CheckBox chk = (CheckBox)sender; CheckBox chk = (CheckBox)sender;
AppConfig.setConfigPerf("auto_apply_power", chk.Checked ? 1 : 0); AppConfig.SetMode("auto_apply_power", chk.Checked ? 1 : 0);
Program.settingsForm.SetPerformanceMode(); Program.settingsForm.SetPerformanceMode();
} }
@@ -371,7 +453,7 @@ namespace GHelper
if (sender is null) return; if (sender is null) return;
CheckBox chk = (CheckBox)sender; CheckBox chk = (CheckBox)sender;
AppConfig.setConfigPerf("auto_apply", chk.Checked ? 1 : 0); AppConfig.SetMode("auto_apply", chk.Checked ? 1 : 0);
Program.settingsForm.SetPerformanceMode(); Program.settingsForm.SetPerformanceMode();
} }
@@ -424,7 +506,7 @@ namespace GHelper
int limit_cpu; int limit_cpu;
int limit_fast; int limit_fast;
bool apply = AppConfig.isConfigPerf("auto_apply_power"); bool apply = AppConfig.IsMode("auto_apply_power");
if (changed) if (changed)
{ {
@@ -434,9 +516,9 @@ namespace GHelper
} }
else else
{ {
limit_total = AppConfig.getConfigPerf("limit_total"); limit_total = AppConfig.GetMode("limit_total");
limit_cpu = AppConfig.getConfigPerf("limit_cpu"); limit_cpu = AppConfig.GetMode("limit_cpu");
limit_fast = AppConfig.getConfigPerf("limit_fast"); limit_fast = AppConfig.GetMode("limit_fast");
} }
if (limit_total < 0) limit_total = AsusACPI.DefaultTotal; if (limit_total < 0) limit_total = AsusACPI.DefaultTotal;
@@ -462,9 +544,9 @@ namespace GHelper
labelB0.Text = trackB0.Value.ToString() + "W"; labelB0.Text = trackB0.Value.ToString() + "W";
labelC1.Text = trackC1.Value.ToString() + "W"; labelC1.Text = trackC1.Value.ToString() + "W";
AppConfig.setConfigPerf("limit_total", limit_total); AppConfig.SetMode("limit_total", limit_total);
AppConfig.setConfigPerf("limit_cpu", limit_cpu); AppConfig.SetMode("limit_cpu", limit_cpu);
AppConfig.setConfigPerf("limit_fast", limit_fast); AppConfig.SetMode("limit_fast", limit_fast);
} }
@@ -484,7 +566,7 @@ namespace GHelper
// Middle / system fan check // Middle / system fan check
if (!AsusACPI.IsEmptyCurve(Program.acpi.GetFanCurve(AsusFan.Mid))) if (!AsusACPI.IsEmptyCurve(Program.acpi.GetFanCurve(AsusFan.Mid)))
{ {
AppConfig.setConfig("mid_fan", 1); AppConfig.Set("mid_fan", 1);
chartCount++; chartCount++;
chartMid.Visible = true; chartMid.Visible = true;
SetChart(chartMid, AsusFan.Mid); SetChart(chartMid, AsusFan.Mid);
@@ -492,13 +574,13 @@ namespace GHelper
} }
else else
{ {
AppConfig.setConfig("mid_fan", 0); AppConfig.Set("mid_fan", 0);
} }
// XG Mobile Fan check // XG Mobile Fan check
if (Program.acpi.IsXGConnected()) if (Program.acpi.IsXGConnected())
{ {
AppConfig.setConfig("xgm_fan", 1); AppConfig.Set("xgm_fan", 1);
chartCount++; chartCount++;
chartXGM.Visible = true; chartXGM.Visible = true;
SetChart(chartXGM, AsusFan.XGM); SetChart(chartXGM, AsusFan.XGM);
@@ -506,7 +588,7 @@ namespace GHelper
} }
else else
{ {
AppConfig.setConfig("xgm_fan", 0); AppConfig.Set("xgm_fan", 0);
} }
try try
@@ -526,9 +608,7 @@ namespace GHelper
LoadProfile(seriesCPU, AsusFan.CPU); LoadProfile(seriesCPU, AsusFan.CPU);
LoadProfile(seriesGPU, AsusFan.GPU); LoadProfile(seriesGPU, AsusFan.GPU);
int auto_apply = AppConfig.getConfigPerf("auto_apply"); checkApplyFans.Checked = AppConfig.IsMode("auto_apply");
checkApplyFans.Checked = (auto_apply == 1);
} }
@@ -542,15 +622,14 @@ namespace GHelper
series.Points.Clear(); series.Points.Clear();
int mode = AppConfig.getConfig("performance_mode"); byte[] curve = AppConfig.GetFanConfig(device);
byte[] curve = AppConfig.getFanConfig(device);
if (reset || AsusACPI.IsInvalidCurve(curve)) if (reset || AsusACPI.IsInvalidCurve(curve))
{ {
curve = Program.acpi.GetFanCurve(device, mode); curve = Program.acpi.GetFanCurve(device, Modes.GetCurrentBase());
if (AsusACPI.IsInvalidCurve(curve)) if (AsusACPI.IsInvalidCurve(curve))
curve = AppConfig.getDefaultCurve(device); curve = AppConfig.GetDefaultCurve(device);
curve = AsusACPI.FixFanCurve(curve); curve = AsusACPI.FixFanCurve(curve);
@@ -581,7 +660,7 @@ namespace GHelper
i++; i++;
} }
AppConfig.setFanConfig(device, curve); AppConfig.SetFanConfig(device, curve);
//Program.wmi.SetFanCurve(device, curve); //Program.wmi.SetFanCurve(device, curve);
} }
@@ -593,19 +672,19 @@ namespace GHelper
LoadProfile(seriesCPU, AsusFan.CPU, true); LoadProfile(seriesCPU, AsusFan.CPU, true);
LoadProfile(seriesGPU, AsusFan.GPU, true); LoadProfile(seriesGPU, AsusFan.GPU, true);
if (AppConfig.isConfig("mid_fan")) if (AppConfig.Is("mid_fan"))
LoadProfile(seriesMid, AsusFan.Mid, true); LoadProfile(seriesMid, AsusFan.Mid, true);
if (AppConfig.isConfig("xgm_fan")) if (AppConfig.Is("xgm_fan"))
LoadProfile(seriesXGM, AsusFan.XGM, true); LoadProfile(seriesXGM, AsusFan.XGM, true);
checkApplyFans.Checked = false; checkApplyFans.Checked = false;
checkApplyPower.Checked = false; checkApplyPower.Checked = false;
AppConfig.setConfigPerf("auto_apply", 0); AppConfig.SetMode("auto_apply", 0);
AppConfig.setConfigPerf("auto_apply_power", 0); AppConfig.SetMode("auto_apply_power", 0);
Program.acpi.DeviceSet(AsusACPI.PerformanceMode, AppConfig.getConfig("performance_mode"), "Mode"); Program.acpi.DeviceSet(AsusACPI.PerformanceMode, Modes.GetCurrentBase(), "Mode");
if (Program.acpi.IsXGConnected()) if (Program.acpi.IsXGConnected())
AsusUSB.ResetXGM(); AsusUSB.ResetXGM();
@@ -617,10 +696,10 @@ namespace GHelper
trackGPUBoost.Value = AsusACPI.MaxGPUBoost; trackGPUBoost.Value = AsusACPI.MaxGPUBoost;
trackGPUTemp.Value = AsusACPI.MaxGPUTemp; trackGPUTemp.Value = AsusACPI.MaxGPUTemp;
AppConfig.setConfigPerf("gpu_boost", trackGPUBoost.Value); AppConfig.SetMode("gpu_boost", trackGPUBoost.Value);
AppConfig.setConfigPerf("gpu_temp", trackGPUTemp.Value); AppConfig.SetMode("gpu_temp", trackGPUTemp.Value);
AppConfig.setConfigPerf("gpu_core", trackGPUCore.Value); AppConfig.SetMode("gpu_core", trackGPUCore.Value);
AppConfig.setConfigPerf("gpu_memory", trackGPUMemory.Value); AppConfig.SetMode("gpu_memory", trackGPUMemory.Value);
VisualiseGPUSettings(); VisualiseGPUSettings();
Program.settingsForm.SetGPUClocks(true); Program.settingsForm.SetGPUClocks(true);
@@ -639,10 +718,10 @@ namespace GHelper
SaveProfile(seriesCPU, AsusFan.CPU); SaveProfile(seriesCPU, AsusFan.CPU);
SaveProfile(seriesGPU, AsusFan.GPU); SaveProfile(seriesGPU, AsusFan.GPU);
if (AppConfig.isConfig("mid_fan")) if (AppConfig.Is("mid_fan"))
SaveProfile(seriesMid, AsusFan.Mid); SaveProfile(seriesMid, AsusFan.Mid);
if (AppConfig.isConfig("xgm_fan")) if (AppConfig.Is("xgm_fan"))
SaveProfile(seriesXGM, AsusFan.XGM); SaveProfile(seriesXGM, AsusFan.XGM);
Program.settingsForm.AutoFans(); Program.settingsForm.AutoFans();
@@ -734,7 +813,7 @@ namespace GHelper
for (int i = 0; i < series.Points.Count; i++) for (int i = 0; i < series.Points.Count; i++)
{ {
series.Points[i].XValue = Math.Max(20, Math.Min(100, series.Points[i].XValue + deltaX)); series.Points[i].XValue = Math.Max(20, Math.Min(100, series.Points[i].XValue + deltaX));
series.Points[i].YValues[0] = Math.Max(0, Math.Min(100, series.Points[i].YValues[0]+deltaY)); series.Points[i].YValues[0] = Math.Max(0, Math.Min(100, series.Points[i].YValues[0] + deltaY));
} }
} }

View File

@@ -16,7 +16,7 @@
<PlatformTarget>AnyCPU</PlatformTarget> <PlatformTarget>AnyCPU</PlatformTarget>
<ProduceReferenceAssembly>False</ProduceReferenceAssembly> <ProduceReferenceAssembly>False</ProduceReferenceAssembly>
<AllowUnsafeBlocks>True</AllowUnsafeBlocks> <AllowUnsafeBlocks>True</AllowUnsafeBlocks>
<AssemblyVersion>0.82</AssemblyVersion> <AssemblyVersion>0.84</AssemblyVersion>
</PropertyGroup> </PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|AnyCPU'"> <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|AnyCPU'">

View File

@@ -111,8 +111,8 @@ public class NvidiaGpuControl : IGpuControl
public int SetClocksFromConfig() public int SetClocksFromConfig()
{ {
int core = AppConfig.getConfig("gpu_core"); int core = AppConfig.Get("gpu_core",0);
int memory = AppConfig.getConfig("gpu_memory"); int memory = AppConfig.Get("gpu_memory",0);
int status = SetClocks(core, memory); int status = SetClocks(core, memory);
return status; return status;
} }

View File

@@ -19,7 +19,7 @@ public static class HardwareControl
public static int GetFanMax() public static int GetFanMax()
{ {
int max = 58; int max = 58;
int configMax = AppConfig.getConfig("fan_max"); int configMax = AppConfig.Get("fan_max");
if (configMax > 100) configMax = 0; // skipping inadvequate settings if (configMax > 100) configMax = 0; // skipping inadvequate settings
if (AppConfig.ContainsModel("401")) max = 72; if (AppConfig.ContainsModel("401")) max = 72;
@@ -29,7 +29,7 @@ public static class HardwareControl
public static void SetFanMax(int fan) public static void SetFanMax(int fan)
{ {
AppConfig.setConfig("fan_max", fan); AppConfig.Set("fan_max", fan);
} }
public static string FormatFan(int fan) public static string FormatFan(int fan)
{ {
@@ -43,7 +43,7 @@ public static class HardwareControl
int fanMax = GetFanMax(); int fanMax = GetFanMax();
if (fan > fanMax && fan < 110) SetFanMax(fan); if (fan > fanMax && fan < 110) SetFanMax(fan);
if (AppConfig.getConfig("fan_rpm") == 1) if (AppConfig.Is("fan_rpm"))
return GHelper.Properties.Strings.FanSpeed + (fan * 100).ToString() + "RPM"; return GHelper.Properties.Strings.FanSpeed + (fan * 100).ToString() + "RPM";
else else
return GHelper.Properties.Strings.FanSpeed + Math.Min(Math.Round((float)fan / fanMax * 100), 100).ToString() + "%"; // relatively to 6000 rpm return GHelper.Properties.Strings.FanSpeed + Math.Min(Math.Round((float)fan / fanMax * 100), 100).ToString() + "%"; // relatively to 6000 rpm
@@ -189,7 +189,7 @@ public static class HardwareControl
List<string> tokill = new() { "EADesktop", "RadeonSoftware", "epicgameslauncher", "ASUSSmartDisplayControl" }; List<string> tokill = new() { "EADesktop", "RadeonSoftware", "epicgameslauncher", "ASUSSmartDisplayControl" };
if (AppConfig.isConfig("kill_gpu_apps")) if (AppConfig.Is("kill_gpu_apps"))
{ {
tokill.Add("nvdisplay.container"); tokill.Add("nvdisplay.container");
tokill.Add("nvcontainer"); tokill.Add("nvcontainer");
@@ -198,7 +198,7 @@ public static class HardwareControl
foreach (string kill in tokill) ProcessHelper.KillByName(kill); foreach (string kill in tokill) ProcessHelper.KillByName(kill);
if (AppConfig.isConfig("kill_gpu_apps") && GpuControl is not null) if (AppConfig.Is("kill_gpu_apps") && GpuControl is not null)
{ {
GpuControl.KillGPUApps(); GpuControl.KillGPUApps();
} }

View File

@@ -86,9 +86,9 @@ namespace GHelper
int kb_timeout; int kb_timeout;
if (SystemInformation.PowerStatus.PowerLineStatus == PowerLineStatus.Online) if (SystemInformation.PowerStatus.PowerLineStatus == PowerLineStatus.Online)
kb_timeout = AppConfig.getConfig("keyboard_ac_timeout", 0); kb_timeout = AppConfig.Get("keyboard_ac_timeout", 0);
else else
kb_timeout = AppConfig.getConfig("keyboard_timeout", 60); kb_timeout = AppConfig.Get("keyboard_timeout", 60);
if (kb_timeout == 0) return; if (kb_timeout == 0) return;
@@ -123,8 +123,8 @@ namespace GHelper
public void InitBacklightTimer() public void InitBacklightTimer()
{ {
timer.Enabled = (AppConfig.getConfig("keyboard_timeout") > 0 && SystemInformation.PowerStatus.PowerLineStatus != PowerLineStatus.Online) || timer.Enabled = (AppConfig.Get("keyboard_timeout") > 0 && SystemInformation.PowerStatus.PowerLineStatus != PowerLineStatus.Online) ||
(AppConfig.getConfig("keyboard_ac_timeout") > 0 && SystemInformation.PowerStatus.PowerLineStatus == PowerLineStatus.Online); (AppConfig.Get("keyboard_ac_timeout") > 0 && SystemInformation.PowerStatus.PowerLineStatus == PowerLineStatus.Online);
} }
@@ -134,11 +134,11 @@ namespace GHelper
hook.UnregisterAll(); hook.UnregisterAll();
// CTRL + SHIFT + F5 to cycle profiles // CTRL + SHIFT + F5 to cycle profiles
if (AppConfig.getConfig("keybind_profile") != -1) keyProfile = (Keys)AppConfig.getConfig("keybind_profile"); if (AppConfig.Get("keybind_profile") != -1) keyProfile = (Keys)AppConfig.Get("keybind_profile");
if (AppConfig.getConfig("keybind_app") != -1) keyApp = (Keys)AppConfig.getConfig("keybind_app"); if (AppConfig.Get("keybind_app") != -1) keyApp = (Keys)AppConfig.Get("keybind_app");
string actionM1 = AppConfig.getConfigString("m1"); string actionM1 = AppConfig.GetString("m1");
string actionM2 = AppConfig.getConfigString("m2"); string actionM2 = AppConfig.GetString("m2");
if (keyProfile != Keys.None) hook.RegisterHotKey(ModifierKeys.Shift | ModifierKeys.Control, keyProfile); if (keyProfile != Keys.None) hook.RegisterHotKey(ModifierKeys.Shift | ModifierKeys.Control, keyProfile);
if (keyApp != Keys.None) hook.RegisterHotKey(ModifierKeys.Shift | ModifierKeys.Control, keyApp); if (keyApp != Keys.None) hook.RegisterHotKey(ModifierKeys.Shift | ModifierKeys.Control, keyApp);
@@ -149,14 +149,14 @@ namespace GHelper
// FN-Lock group // FN-Lock group
if (AppConfig.isConfig("fn_lock") && !AppConfig.ContainsModel("VivoBook")) if (AppConfig.Is("fn_lock") && !AppConfig.ContainsModel("VivoBook"))
for (Keys i = Keys.F1; i <= Keys.F11; i++) hook.RegisterHotKey(ModifierKeys.None, i); for (Keys i = Keys.F1; i <= Keys.F11; i++) hook.RegisterHotKey(ModifierKeys.None, i);
} }
static void CustomKey(string configKey = "m3") static void CustomKey(string configKey = "m3")
{ {
string command = AppConfig.getConfigString(configKey + "_custom"); string command = AppConfig.GetString(configKey + "_custom");
int intKey; int intKey;
try try
@@ -202,7 +202,7 @@ namespace GHelper
} }
} }
if (AppConfig.ContainsModel("GA401I")) if (AppConfig.ContainsModel("GA401I") && !AppConfig.ContainsModel("GA401IHR"))
{ {
switch (e.Key) switch (e.Key)
{ {
@@ -284,7 +284,7 @@ namespace GHelper
public static void KeyProcess(string name = "m3") public static void KeyProcess(string name = "m3")
{ {
string action = AppConfig.getConfigString(name); string action = AppConfig.GetString(name);
if (action is null || action.Length <= 1) if (action is null || action.Length <= 1)
{ {
@@ -312,6 +312,7 @@ namespace GHelper
KeyboardHook.KeyPress(Keys.Snapshot); KeyboardHook.KeyPress(Keys.Snapshot);
break; break;
case "screen": case "screen":
Logger.WriteLine("Screen off toggle");
NativeMethods.TurnOffScreen(Program.settingsForm.Handle); NativeMethods.TurnOffScreen(Program.settingsForm.Handle);
break; break;
case "miniled": case "miniled":
@@ -366,8 +367,8 @@ namespace GHelper
static void ToggleFnLock() static void ToggleFnLock()
{ {
int fnLock = AppConfig.isConfig("fn_lock") ? 0 : 1; int fnLock = AppConfig.Is("fn_lock") ? 0 : 1;
AppConfig.setConfig("fn_lock", fnLock); AppConfig.Set("fn_lock", fnLock);
if (AppConfig.ContainsModel("VivoBook")) if (AppConfig.ContainsModel("VivoBook"))
Program.acpi.DeviceSet(AsusACPI.FnLock, (fnLock == 1) ? 0 : 1, "FnLock"); Program.acpi.DeviceSet(AsusACPI.FnLock, (fnLock == 1) ? 0 : 1, "FnLock");
@@ -416,13 +417,16 @@ namespace GHelper
return; return;
case 197: // FN+F2 case 197: // FN+F2
SetBacklight(-1); SetBacklight(-1);
break; return;
case 196: // FN+F3 case 196: // FN+F3
SetBacklight(1); SetBacklight(1);
break; return;
case 199: // ON Z13 - FN+F11 - cycles backlight case 199: // ON Z13 - FN+F11 - cycles backlight
SetBacklight(4); SetBacklight(4);
break; return;
case 53: // FN+F6 on GA-502DU model
NativeMethods.TurnOffScreen(Program.settingsForm.Handle);
return;
} }
if (OptimizationService.IsRunning()) return; if (OptimizationService.IsRunning()) return;
@@ -458,8 +462,8 @@ namespace GHelper
public static int GetBacklight() public static int GetBacklight()
{ {
int backlight_power = AppConfig.getConfig("keyboard_brightness", 1); int backlight_power = AppConfig.Get("keyboard_brightness", 1);
int backlight_battery = AppConfig.getConfig("keyboard_brightness_ac", 1); int backlight_battery = AppConfig.Get("keyboard_brightness_ac", 1);
bool onBattery = SystemInformation.PowerStatus.PowerLineStatus != PowerLineStatus.Online; bool onBattery = SystemInformation.PowerStatus.PowerLineStatus != PowerLineStatus.Online;
int backlight; int backlight;
@@ -480,8 +484,8 @@ namespace GHelper
public static void SetBacklight(int delta) public static void SetBacklight(int delta)
{ {
int backlight_power = AppConfig.getConfig("keyboard_brightness", 1); int backlight_power = AppConfig.Get("keyboard_brightness", 1);
int backlight_battery = AppConfig.getConfig("keyboard_brightness_ac", 1); int backlight_battery = AppConfig.Get("keyboard_brightness_ac", 1);
bool onBattery = SystemInformation.PowerStatus.PowerLineStatus != PowerLineStatus.Online; bool onBattery = SystemInformation.PowerStatus.PowerLineStatus != PowerLineStatus.Online;
int backlight = onBattery ? backlight_battery : backlight_power; int backlight = onBattery ? backlight_battery : backlight_power;
@@ -492,9 +496,9 @@ namespace GHelper
backlight = Math.Max(Math.Min(3, backlight + delta), 0); backlight = Math.Max(Math.Min(3, backlight + delta), 0);
if (onBattery) if (onBattery)
AppConfig.setConfig("keyboard_brightness_ac", backlight); AppConfig.Set("keyboard_brightness_ac", backlight);
else else
AppConfig.setConfig("keyboard_brightness", backlight); AppConfig.Set("keyboard_brightness", backlight);
if (!OptimizationService.IsRunning()) if (!OptimizationService.IsRunning())
{ {

156
app/Modes.cs Normal file
View File

@@ -0,0 +1,156 @@
using Microsoft.VisualBasic.Devices;
namespace GHelper
{
internal class Modes
{
const int maxModes = 20;
public static Dictionary<int, string> GetDictonary()
{
Dictionary<int, string> modes = new Dictionary<int, string>
{
{2, Properties.Strings.Silent},
{0, Properties.Strings.Balanced},
{1, Properties.Strings.Turbo}
};
for (int i = 3; i < maxModes; i++)
{
if (Exists(i)) modes.Add(i, GetName(i));
}
return modes;
}
public static List<int> GetList()
{
List<int> modes = new() { 2, 0, 1 };
for (int i = 3; i < maxModes; i++)
{
if (Exists(i)) modes.Add(i);
}
return modes;
}
public static void Remove(int mode)
{
List<string> cleanup = new() {
"mode_base",
"mode_name",
"limit_total",
"limit_fast",
"limit_cpu",
"limit_total",
"fan_profile_cpu",
"fan_profile_gpu",
"fan_profile_mid",
"gpu_boost",
"gpu_temp",
"gpu_core",
"gpu_memory",
"auto_boost",
"auto_apply",
"auto_apply_power"
};
foreach (string clean in cleanup)
{
AppConfig.Remove(clean + "_" + mode);
}
}
public static int Add()
{
for (int i = 3; i < maxModes; i++)
{
if (!Exists(i))
{
int modeBase = GetCurrentBase();
string nameName = "Custom " + (i - 2);
AppConfig.Set("mode_base_" + i, modeBase);
AppConfig.Set("mode_name_" + i, nameName);
return i;
}
}
return -1;
}
public static int GetCurrent()
{
return AppConfig.Get("performance_mode");
}
public static bool IsCurrentCustom()
{
return GetCurrent() > 2;
}
public static void SetCurrent(int mode)
{
AppConfig.Set("performance_" + (int)SystemInformation.PowerStatus.PowerLineStatus, mode);
AppConfig.Set("performance_mode", mode);
}
public static int GetCurrentBase()
{
return GetBase(GetCurrent());
}
public static string GetCurrentName()
{
return GetName(GetCurrent());
}
public static bool Exists(int mode)
{
return GetBase(mode) >= 0;
}
public static int GetBase(int mode)
{
if (mode >= 0 && mode <= 2)
return mode;
else
return AppConfig.Get("mode_base_" + mode);
}
public static string GetName(int mode)
{
switch (mode)
{
case 0:
return Properties.Strings.Balanced;
case 1:
return Properties.Strings.Turbo;
case 2:
return Properties.Strings.Silent;
default:
return AppConfig.GetString("mode_name_" + mode);
}
}
public static int GetNext(bool back = false)
{
var modes = GetList();
int index = modes.IndexOf(GetCurrent());
if (back)
{
index--;
if (index < 0) index = modes.Count - 1;
return modes[index];
}
else
{
index++;
if (index > modes.Count - 1) index = 0;
return modes[index];
}
}
}
}

View File

@@ -636,7 +636,7 @@ public class NativeMethods
var devices = GetAllDevices().ToArray(); var devices = GetAllDevices().ToArray();
int count = 0, displayNum = -1; int count = 0, displayNum = -1;
string internalName = AppConfig.getConfigString("internal_display"); string internalName = AppConfig.GetString("internal_display");
foreach (var device in devices) foreach (var device in devices)
{ {
@@ -645,7 +645,7 @@ public class NativeMethods
device.monitorFriendlyDeviceName == internalName) device.monitorFriendlyDeviceName == internalName)
{ {
displayNum = count; displayNum = count;
AppConfig.setConfig("internal_display", device.monitorFriendlyDeviceName); AppConfig.Set("internal_display", device.monitorFriendlyDeviceName);
} }
count++; count++;
//Logger.WriteLine(device.monitorFriendlyDeviceName + ":" + device.outputTechnology.ToString()); //Logger.WriteLine(device.monitorFriendlyDeviceName + ":" + device.outputTechnology.ToString());

View File

@@ -57,8 +57,14 @@ namespace GHelper
startInfo.FileName = Application.ExecutablePath; startInfo.FileName = Application.ExecutablePath;
startInfo.Arguments = param; startInfo.Arguments = param;
startInfo.Verb = "runas"; startInfo.Verb = "runas";
Process.Start(startInfo); try
Application.Exit(); {
Process.Start(startInfo);
Application.Exit();
} catch (Exception ex)
{
Logger.WriteLine(ex.Message);
}
} }
} }

View File

@@ -2,8 +2,6 @@ using Microsoft.Win32;
using System.Diagnostics; using System.Diagnostics;
using System.Globalization; using System.Globalization;
using System.Reflection; using System.Reflection;
using System.Security.Principal;
using System.Windows.Forms;
using static NativeMethods; using static NativeMethods;
namespace GHelper namespace GHelper
@@ -38,15 +36,18 @@ namespace GHelper
string action = ""; string action = "";
if (args.Length > 0) action = args[0]; if (args.Length > 0) action = args[0];
string language = AppConfig.getConfigString("language"); string language = AppConfig.GetString("language");
if (language != null && language.Length > 0) if (language != null && language.Length > 0)
Thread.CurrentThread.CurrentUICulture = CultureInfo.GetCultureInfo(language); Thread.CurrentThread.CurrentUICulture = CultureInfo.GetCultureInfo(language);
else else
Thread.CurrentThread.CurrentUICulture = CultureInfo.CurrentUICulture; {
var culture = CultureInfo.CurrentUICulture;
if (culture.ToString() == "kr") culture = CultureInfo.GetCultureInfo("ko");
Thread.CurrentThread.CurrentUICulture = culture;
}
Debug.WriteLine(CultureInfo.CurrentUICulture); Debug.WriteLine(CultureInfo.CurrentUICulture);
//Thread.CurrentThread.CurrentUICulture = CultureInfo.CreateSpecificCulture("fr");
ProcessHelper.CheckAlreadyRunning(); ProcessHelper.CheckAlreadyRunning();
@@ -147,7 +148,7 @@ namespace GHelper
inputDispatcher.Init(); inputDispatcher.Init();
settingsForm.SetBatteryChargeLimit(AppConfig.getConfig("charge_limit")); settingsForm.SetBatteryChargeLimit(AppConfig.Get("charge_limit"));
settingsForm.AutoPerformance(powerChanged); settingsForm.AutoPerformance(powerChanged);
bool switched = settingsForm.AutoGPUMode(); bool switched = settingsForm.AutoGPUMode();
@@ -176,6 +177,10 @@ namespace GHelper
if (settingsForm.Visible) settingsForm.HideAll(); if (settingsForm.Visible) settingsForm.HideAll();
else else
{ {
settingsForm.Left = Screen.FromControl(settingsForm).WorkingArea.Width - 10 - settingsForm.Width;
settingsForm.Top = Screen.FromControl(settingsForm).WorkingArea.Height - 10 - settingsForm.Height;
settingsForm.Show(); settingsForm.Show();
settingsForm.Activate(); settingsForm.Activate();
settingsForm.VisualiseGPUMode(); settingsForm.VisualiseGPUMode();

View File

@@ -110,6 +110,16 @@ namespace GHelper.Properties {
} }
} }
/// <summary>
/// Looks up a localized resource of type System.Drawing.Bitmap.
/// </summary>
internal static System.Drawing.Bitmap icons8_add_64 {
get {
object obj = ResourceManager.GetObject("icons8_add_64", 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>
@@ -153,9 +163,19 @@ namespace GHelper.Properties {
/// <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 icons8_electrical_96 { internal static System.Drawing.Bitmap icons8_charging_battery_96 {
get { get {
object obj = ResourceManager.GetObject("icons8_electrical_96", resourceCulture); object obj = ResourceManager.GetObject("icons8_charging_battery_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_edit_32 {
get {
object obj = ResourceManager.GetObject("icons8_edit_32", resourceCulture);
return ((System.Drawing.Bitmap)(obj)); return ((System.Drawing.Bitmap)(obj));
} }
} }
@@ -360,6 +380,16 @@ namespace GHelper.Properties {
} }
} }
/// <summary>
/// Looks up a localized resource of type System.Drawing.Bitmap.
/// </summary>
internal static System.Drawing.Bitmap icons8_remove_64 {
get {
object obj = ResourceManager.GetObject("icons8_remove_64", 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>
@@ -370,6 +400,16 @@ namespace GHelper.Properties {
} }
} }
/// <summary>
/// Looks up a localized resource of type System.Drawing.Bitmap.
/// </summary>
internal static System.Drawing.Bitmap icons8_share_32 {
get {
object obj = ResourceManager.GetObject("icons8_share_32", 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>

View File

@@ -241,7 +241,19 @@
<data name="icons8_charged_battery_96" type="System.Resources.ResXFileRef, System.Windows.Forms"> <data name="icons8_charged_battery_96" type="System.Resources.ResXFileRef, System.Windows.Forms">
<value>..\Resources\icons8-charged-battery-96.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value> <value>..\Resources\icons8-charged-battery-96.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
</data> </data>
<data name="icons8_electrical_96" type="System.Resources.ResXFileRef, System.Windows.Forms"> <data name="icons8_charging_battery_96" type="System.Resources.ResXFileRef, System.Windows.Forms">
<value>..\Resources\icons8-electrical-96.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value> <value>..\Resources\icons8-charging-battery-96.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
</data>
<data name="icons8_add_64" type="System.Resources.ResXFileRef, System.Windows.Forms">
<value>..\Resources\icons8-add-64.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
</data>
<data name="icons8_edit_32" type="System.Resources.ResXFileRef, System.Windows.Forms">
<value>..\Resources\icons8-edit-32.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
</data>
<data name="icons8_remove_64" type="System.Resources.ResXFileRef, System.Windows.Forms">
<value>..\Resources\icons8-remove-64.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
</data>
<data name="icons8_share_32" type="System.Resources.ResXFileRef, System.Windows.Forms">
<value>..\Resources\icons8-share-32.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
</data> </data>
</root> </root>

View File

@@ -916,7 +916,7 @@ namespace GHelper.Properties {
} }
/// <summary> /// <summary>
/// Looks up a localized string similar to Performance Mode. /// Looks up a localized string similar to Mode.
/// </summary> /// </summary>
internal static string PerformanceMode { internal static string PerformanceMode {
get { get {
@@ -943,7 +943,7 @@ namespace GHelper.Properties {
} }
/// <summary> /// <summary>
/// Looks up a localized string similar to Power Limits (PPT). /// Looks up a localized string similar to Power Limits.
/// </summary> /// </summary>
internal static string PowerLimits { internal static string PowerLimits {
get { get {
@@ -952,7 +952,7 @@ namespace GHelper.Properties {
} }
/// <summary> /// <summary>
/// Looks up a localized string similar to Power Limits (PPT) is experimental feature. Use carefully and on your own risk!. /// Looks up a localized string similar to Power Limits is experimental feature. Use carefully and on your own risk!.
/// </summary> /// </summary>
internal static string PPTExperimental { internal static string PPTExperimental {
get { get {

View File

@@ -1,5 +1,64 @@
<?xml version="1.0" encoding="utf-8"?> <?xml version="1.0" encoding="utf-8"?>
<root> <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">
@@ -314,10 +373,10 @@
<value>Wiedergabe / Pause</value> <value>Wiedergabe / Pause</value>
</data> </data>
<data name="PowerLimits" xml:space="preserve"> <data name="PowerLimits" xml:space="preserve">
<value>Leistungsbegrenzung (PPT)</value> <value>Leistungsbegrenzung</value>
</data> </data>
<data name="PPTExperimental" xml:space="preserve"> <data name="PPTExperimental" xml:space="preserve">
<value>Leistungsbegrenzung (PPT) ist experimentell. Nutzung erfolgt auf eigene Gefahr!</value> <value>Leistungsbegrenzung ist experimentell. Nutzung erfolgt auf eigene Gefahr!</value>
</data> </data>
<data name="PrintScreen" xml:space="preserve"> <data name="PrintScreen" xml:space="preserve">
<value>Druck</value> <value>Druck</value>

View File

@@ -291,7 +291,7 @@
<data name="GPUChanging" xml:space="preserve"> <data name="GPUChanging" xml:space="preserve">
<value>Cargando</value> <value>Cargando</value>
</data> </data>
<data name="GPUCoreClockOffset" xml:space="preserve"> <data name="GPUCoreClockOffset" xml:space="preserve">
<value>Core Clock Offset</value> <value>Core Clock Offset</value>
</data> </data>
<data name="GPUMemoryClockOffset" xml:space="preserve"> <data name="GPUMemoryClockOffset" xml:space="preserve">
@@ -312,7 +312,7 @@
<data name="GPUSettings" xml:space="preserve"> <data name="GPUSettings" xml:space="preserve">
<value>Ajustes de GPU</value> <value>Ajustes de GPU</value>
</data> </data>
<data name="GPUTempTarget" xml:space="preserve"> <data name="GPUTempTarget" xml:space="preserve">
<value>Temperatura objetivo</value> <value>Temperatura objetivo</value>
</data> </data>
<data name="KeyBindings" xml:space="preserve"> <data name="KeyBindings" xml:space="preserve">
@@ -345,7 +345,7 @@
<data name="Logo" xml:space="preserve"> <data name="Logo" xml:space="preserve">
<value>Logo</value> <value>Logo</value>
</data> </data>
<data name="MatrixAudio" xml:space="preserve"> <data name="MatrixAudio" xml:space="preserve">
<value>Visualizador de audio</value> <value>Visualizador de audio</value>
</data> </data>
<data name="MatrixBanner" xml:space="preserve"> <data name="MatrixBanner" xml:space="preserve">
@@ -412,10 +412,10 @@
<value>Reproducir / Pausar</value> <value>Reproducir / Pausar</value>
</data> </data>
<data name="PowerLimits" xml:space="preserve"> <data name="PowerLimits" xml:space="preserve">
<value>Límites de energía (PPT)</value> <value>Límites de energía</value>
</data> </data>
<data name="PPTExperimental" xml:space="preserve"> <data name="PPTExperimental" xml:space="preserve">
<value>Los límites de energía (PPT) son una característica experimental. ¡Úselo con cuidado y bajo su propio riesgo!</value> <value>Los límites de energía son una característica experimental. ¡Úselo con cuidado y bajo su propio riesgo!</value>
</data> </data>
<data name="PrintScreen" xml:space="preserve"> <data name="PrintScreen" xml:space="preserve">
<value>Capturar pantalla</value> <value>Capturar pantalla</value>
@@ -424,7 +424,7 @@
<value>Quitar</value> <value>Quitar</value>
</data> </data>
<data name="RestartGPU" xml:space="preserve"> <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> <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>
<data name="RPM" xml:space="preserve"> <data name="RPM" xml:space="preserve">
<value>RPM</value> <value>RPM</value>

View File

@@ -388,10 +388,10 @@
<value>Lecture / Pause</value> <value>Lecture / Pause</value>
</data> </data>
<data name="PowerLimits" xml:space="preserve"> <data name="PowerLimits" xml:space="preserve">
<value>Limites de puissance (PPT)</value> <value>Limites de puissance</value>
</data> </data>
<data name="PPTExperimental" xml:space="preserve"> <data name="PPTExperimental" xml:space="preserve">
<value>Limites de puissance (PPT) est une fonctionnalité expérimentale. Faire attention, à utiliser à vos risques !</value> <value>Limites de puissance est une fonctionnalité expérimentale. Faire attention, à utiliser à vos risques !</value>
</data> </data>
<data name="PrintScreen" xml:space="preserve"> <data name="PrintScreen" xml:space="preserve">
<value>Capture d'écran</value> <value>Capture d'écran</value>

View File

@@ -1,5 +1,64 @@
<?xml version="1.0" encoding="utf-8"?> <?xml version="1.0" encoding="utf-8"?>
<root> <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">
@@ -287,10 +346,10 @@
<value>Play / Pause</value> <value>Play / Pause</value>
</data> </data>
<data name="PowerLimits" xml:space="preserve"> <data name="PowerLimits" xml:space="preserve">
<value>Power Limits (PPT)</value> <value>Power Limits</value>
</data> </data>
<data name="PPTExperimental" xml:space="preserve"> <data name="PPTExperimental" xml:space="preserve">
<value>Power Limits (PPT) is experimental feature. Use carefully and on your own risk!</value> <value>Power Limits is experimental feature. Use carefully and on your own risk!</value>
</data> </data>
<data name="PrintScreen" xml:space="preserve"> <data name="PrintScreen" xml:space="preserve">
<value>PrintScreen</value> <value>PrintScreen</value>

View File

@@ -412,10 +412,10 @@
<value>재생 / 정지</value> <value>재생 / 정지</value>
</data> </data>
<data name="PowerLimits" xml:space="preserve"> <data name="PowerLimits" xml:space="preserve">
<value>전력 제한 (PPT)</value> <value>전력 제한</value>
</data> </data>
<data name="PPTExperimental" xml:space="preserve"> <data name="PPTExperimental" xml:space="preserve">
<value>전력 제한 (PPT)은 실험적인 기능입니다. 주의하여 사용하세요!</value> <value>전력 제한 은 실험적인 기능입니다. 주의하여 사용하세요!</value>
</data> </data>
<data name="PrintScreen" xml:space="preserve"> <data name="PrintScreen" xml:space="preserve">
<value>PrintScreen</value> <value>PrintScreen</value>

View File

@@ -391,10 +391,10 @@
<value>Odtwórz / Pauza</value> <value>Odtwórz / Pauza</value>
</data> </data>
<data name="PowerLimits" xml:space="preserve"> <data name="PowerLimits" xml:space="preserve">
<value>Limit mocy (PPT)</value> <value>Limit mocy</value>
</data> </data>
<data name="PPTExperimental" xml:space="preserve"> <data name="PPTExperimental" xml:space="preserve">
<value>Ustawienie limitu mocy (PPT) jest funkcją eksperymentalną. Używaj ostrożnie, na własną odpowiedzialność!</value> <value>Ustawienie limitu mocy jest funkcją eksperymentalną. Używaj ostrożnie, na własną odpowiedzialność!</value>
</data> </data>
<data name="PrintScreen" xml:space="preserve"> <data name="PrintScreen" xml:space="preserve">
<value>Zrzut ekranu</value> <value>Zrzut ekranu</value>

View File

@@ -1,350 +1,456 @@
<?xml version="1.0" encoding="utf-8"?>
<root> <root>
<resheader name="resmimetype"> <!--
<value>text/microsoft-resx</value> Microsoft ResX Schema
</resheader>
<resheader name="version"> Version 2.0
<value>1.3</value>
</resheader> The primary goals of this format is to allow a simple XML format
<resheader name="reader"> that is mostly human readable. The generation and parsing of the
<value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value> various data types are done through the TypeConverter classes
</resheader> associated with the data types.
<resheader name="writer">
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value> Example:
</resheader>
<data name="ACPIError" xml:space="preserve"> ... ado.net/XML headers & schema ...
<value>Não foi possível conectar ao ASUS ACPI. O applicativo não pode funcionar sem isso. Tente instalar Asus System Controle Interface</value> <resheader name="resmimetype">text/microsoft-resx</resheader>
</data> <resheader name="version">2.0</resheader>
<data name="AlertDGPU" xml:space="preserve"> <resheader name="reader">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader>
<value>Parece que o GPU está em uso pesado.</value> <resheader name="writer">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader>
</data> <data name="Name1"><value>this is my long string</value><comment>this is a comment</comment></data>
<data name="AlertDGPUTitle" xml:space="preserve"> <data name="Color1" type="System.Drawing.Color, System.Drawing">Blue</data>
<value>Modo econômico</value> <data name="Bitmap1" mimetype="application/x-microsoft.net.object.binary.base64">
</data> <value>[base64 mime encoded serialized .NET Framework object]</value>
<data name="AlertUltimateOff" xml:space="preserve"> </data>
<value>Passar ao Modo Final implica na reinicialização do sistema</value> <data name="Icon1" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
</data> <value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value>
<data name="AlertUltimateOn" xml:space="preserve"> <comment>This is a comment</comment>
<value>Modo Ultimado necessita de reinicialização.</value> </data>
</data>
<data name="AlertUltimateTitle" xml:space="preserve"> There are any number of "resheader" rows that contain simple
<value>Reiniciar agora ?</value> name/value pairs.
</data>
<data name="AnimationSpeed" xml:space="preserve"> Each data row contains a name, and value. The row also contains a
<value>Velocidade da Animação</value> type or mimetype. Type corresponds to a .NET class that support
</data> text/value conversion through the TypeConverter architecture.
<data name="AnimeMatrix" xml:space="preserve"> Classes that don't support this are serialized and stored with the
<value>Anime Matrix</value> mimetype set.
</data>
<data name="AppAlreadyRunning" xml:space="preserve"> The mimetype is used for serialized objects, and tells the
<value>O applicativo já está em execução</value> ResXResourceReader how to depersist the object. This is currently not
</data> extensible. For a given mimetype the value must be set accordingly:
<data name="AppAlreadyRunningText" xml:space="preserve">
<value>G-Helper já está em execução. Verifique a barra de sistema</value> Note - application/x-microsoft.net.object.binary.base64 is the format
</data> that the ResXResourceWriter will generate, however the reader can
<data name="ApplyFanCurve" xml:space="preserve"> read any of the formats listed below.
<value>Aplicar a curva de ventilador personalizada</value>
</data> mimetype: application/x-microsoft.net.object.binary.base64
<data name="ApplyPowerLimits" xml:space="preserve"> value : The object must be serialized with
<value>Aplicar as limitações de energia</value> : System.Runtime.Serialization.Formatters.Binary.BinaryFormatter
</data> : and then encoded with base64 encoding.
<data name="ApplyWindowsPowerPlan" xml:space="preserve">
<value>Automaticamente ajustar os Modos de Energia Windows</value> mimetype: application/x-microsoft.net.object.soap.base64
</data> value : The object must be serialized with
<data name="AuraBreathe" xml:space="preserve"> : System.Runtime.Serialization.Formatters.Soap.SoapFormatter
<value>Repiração</value> : and then encoded with base64 encoding.
</data>
<data name="AuraColorCycle" xml:space="preserve"> mimetype: application/x-microsoft.net.object.bytearray.base64
<value>Ciclo de cores</value> value : The object must be serialized into a byte array
</data> : using a System.ComponentModel.TypeConverter
<data name="AuraFast" xml:space="preserve"> : and then encoded with base64 encoding.
<value>Rápido</value> -->
</data> <xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
<data name="AuraNormal" xml:space="preserve"> <xsd:import namespace="http://www.w3.org/XML/1998/namespace" />
<value>Normal</value> <xsd:element name="root" msdata:IsDataSet="true">
</data> <xsd:complexType>
<data name="AuraRainbow" xml:space="preserve"> <xsd:choice maxOccurs="unbounded">
<value>Arco-íris</value> <xsd:element name="metadata">
</data> <xsd:complexType>
<data name="AuraSlow" xml:space="preserve"> <xsd:sequence>
<value>Lento</value> <xsd:element name="value" type="xsd:string" minOccurs="0" />
</data> </xsd:sequence>
<data name="AuraStatic" xml:space="preserve"> <xsd:attribute name="name" use="required" type="xsd:string" />
<value>Estático</value> <xsd:attribute name="type" type="xsd:string" />
</data> <xsd:attribute name="mimetype" type="xsd:string" />
<data name="AuraStrobe" xml:space="preserve"> <xsd:attribute ref="xml:space" />
<value>Estroboscópio</value> </xsd:complexType>
</data> </xsd:element>
<data name="AutoMode" xml:space="preserve"> <xsd:element name="assembly">
<value>Automático</value> <xsd:complexType>
</data> <xsd:attribute name="alias" type="xsd:string" />
<data name="AutoRefreshTooltip" xml:space="preserve"> <xsd:attribute name="name" type="xsd:string" />
<value>Estabelece 60Hz para economizar energia</value> </xsd:complexType>
</data> </xsd:element>
<data name="Awake" xml:space="preserve"> <xsd:element name="data">
<value>Acordado</value> <xsd:complexType>
</data> <xsd:sequence>
<data name="BacklightTimeout" xml:space="preserve"> <xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
<value>Números de segundos para desligar a luz de fundo</value> <xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" />
</data> </xsd:sequence>
<data name="Balanced" xml:space="preserve"> <xsd:attribute name="name" type="xsd:string" use="required" msdata:Ordinal="1" />
<value>Equilibrado</value> <xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" />
</data> <xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" />
<data name="BatteryChargeLimit" xml:space="preserve"> <xsd:attribute ref="xml:space" />
<value>Limite de carga da bateria</value> </xsd:complexType>
</data> </xsd:element>
<data name="Boot" xml:space="preserve"> <xsd:element name="resheader">
<value>Durante o lançamento</value> <xsd:complexType>
</data> <xsd:sequence>
<data name="Brightness" xml:space="preserve"> <xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
<value>Luminosidade</value> </xsd:sequence>
</data> <xsd:attribute name="name" type="xsd:string" use="required" />
<data name="Color" xml:space="preserve"> </xsd:complexType>
<value>Cor</value> </xsd:element>
</data> </xsd:choice>
<data name="CPUBoost" xml:space="preserve"> </xsd:complexType>
<value>CPU Boost</value> </xsd:element>
</data> </xsd:schema>
<data name="Custom" xml:space="preserve"> <resheader name="resmimetype">
<value>Personalizado</value> <value>text/microsoft-resx</value>
</data> </resheader>
<data name="Default" xml:space="preserve"> <resheader name="version">
<value>Padrão</value> <value>2.0</value>
</data> </resheader>
<data name="DisableOverdrive" xml:space="preserve"> <resheader name="reader">
<value>Desativar o overdrive da tela</value> <value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</data> </resheader>
<data name="Discharging" xml:space="preserve"> <resheader name="writer">
<value>Descarregando</value> <value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</data> </resheader>
<data name="DownloadUpdate" xml:space="preserve"> <data name="ACPIError" xml:space="preserve">
<value>Baixar a atualização</value> <value>Não foi possível conectar ao ASUS ACPI. O applicativo não pode funcionar sem isso. Tente instalar Asus System Controle Interface</value>
</data> </data>
<data name="EcoGPUTooltip" xml:space="preserve"> <data name="AlertDGPU" xml:space="preserve">
<value>Desativar o dGPU para economisar a energía</value> <value>Parece que o GPU está em uso pesado.</value>
</data> </data>
<data name="EcoMode" xml:space="preserve"> <data name="AlertDGPUTitle" xml:space="preserve">
<value>Econômico</value> <value>Modo econômico</value>
</data> </data>
<data name="Extra" xml:space="preserve"> <data name="AlertUltimateOff" xml:space="preserve">
<value>Adicional</value> <value>Passar ao Modo Final implica na reinicialização do sistema</value>
</data> </data>
<data name="ExtraSettings" xml:space="preserve"> <data name="AlertUltimateOn" xml:space="preserve">
<value>Configurações adicionais</value> <value>Modo Ultimado necessita de reinicialização.</value>
</data> </data>
<data name="FactoryDefaults" xml:space="preserve"> <data name="AlertUltimateTitle" xml:space="preserve">
<value>Padrão de fábrica</value> <value>Reiniciar agora ?</value>
</data> </data>
<data name="FanCurves" xml:space="preserve"> <data name="AnimationSpeed" xml:space="preserve">
<value>Curvas de ventilador</value> <value>Velocidade da Animação</value>
</data> </data>
<data name="FanProfileCPU" xml:space="preserve"> <data name="AnimeMatrix" xml:space="preserve">
<value>Perfil de ventilador CPU</value> <value>Anime Matrix</value>
</data> </data>
<data name="FanProfileGPU" xml:space="preserve"> <data name="AppAlreadyRunning" xml:space="preserve">
<value>Perfil de ventilador GPU</value> <value>O applicativo já está em execução</value>
</data> </data>
<data name="FanProfileMid" xml:space="preserve"> <data name="AppAlreadyRunningText" xml:space="preserve">
<value>Perfil de ventilador central</value> <value>G-Helper já está em execução. Verifique a barra de sistema</value>
</data> </data>
<data name="FanProfiles" xml:space="preserve"> <data name="ApplyFanCurve" xml:space="preserve">
<value>Perfis de ventilador</value> <value>Aplicar a curva de ventilador personalizada</value>
</data> </data>
<data name="FansAndPower" xml:space="preserve"> <data name="ApplyPowerLimits" xml:space="preserve">
<value>Ventiladores e Energía</value> <value>Aplicar as limitações de energia</value>
</data> </data>
<data name="FanSpeed" xml:space="preserve"> <data name="ApplyWindowsPowerPlan" xml:space="preserve">
<value>Ventilador</value> <value>Automaticamente ajustar os Modos de Energia Windows</value>
</data> </data>
<data name="FansPower" xml:space="preserve"> <data name="AuraBreathe" xml:space="preserve">
<value>Ventiladores + Energía</value> <value>Repiração</value>
</data> </data>
<data name="GPUBoost" xml:space="preserve"> <data name="AuraColorCycle" xml:space="preserve">
<value>Boost dinâmico</value> <value>Ciclo de cores</value>
</data> </data>
<data name="GPUChanging" xml:space="preserve"> <data name="AuraFast" xml:space="preserve">
<value>Carregando</value> <value>Rápido</value>
</data> </data>
<data name="GPUMode" xml:space="preserve"> <data name="AuraNormal" xml:space="preserve">
<value>Modo de GPU</value> <value>Normal</value>
</data> </data>
<data name="GPUModeEco" xml:space="preserve"> <data name="AuraRainbow" xml:space="preserve">
<value>Só iGPU</value> <value>Arco-íris</value>
</data> </data>
<data name="GPUModeStandard" xml:space="preserve"> <data name="AuraSlow" xml:space="preserve">
<value>iGPU + dGPU</value> <value>Lento</value>
</data> </data>
<data name="GPUModeUltimate" xml:space="preserve"> <data name="AuraStatic" xml:space="preserve">
<value>Exclusivamente dGPU</value> <value>Estático</value>
</data> </data>
<data name="GPUSettings" xml:space="preserve"> <data name="AuraStrobe" xml:space="preserve">
<value>Parâmetros de GPU</value> <value>Estroboscópio</value>
</data> </data>
<data name="GPUTempTarget" xml:space="preserve"> <data name="AutoMode" xml:space="preserve">
<value>Alvo de temperatura</value> <value>Automático</value>
</data> </data>
<data name="Keyboard" xml:space="preserve"> <data name="AutoRefreshTooltip" xml:space="preserve">
<value>Teclado</value> <value>Estabelece 60Hz para economizar energia</value>
</data> </data>
<data name="KeyboardAuto" xml:space="preserve"> <data name="Awake" xml:space="preserve">
<value>Abaixar a luz de fundo na bateria e voltar quando carregando</value> <value>Acordado</value>
</data> </data>
<data name="KeyboardBacklight" xml:space="preserve"> <data name="BacklightTimeout" xml:space="preserve">
<value>Luz de fundo do teclado</value> <value>Números de segundos para desligar a luz de fundo</value>
</data> </data>
<data name="LaptopBacklight" xml:space="preserve"> <data name="Balanced" xml:space="preserve">
<value>Luz de fundo do computador</value> <value>Equilibrado</value>
</data> </data>
<data name="LaptopKeyboard" xml:space="preserve"> <data name="BatteryChargeLimit" xml:space="preserve">
<value>Teclado do computador</value> <value>Limite de carga da bateria</value>
</data> </data>
<data name="LaptopScreen" xml:space="preserve"> <data name="Boot" xml:space="preserve">
<value>Tela do computador</value> <value>Durante o lançamento</value>
</data> </data>
<data name="Lid" xml:space="preserve"> <data name="Brightness" xml:space="preserve">
<value>Tampa</value> <value>Luminosidade</value>
</data> </data>
<data name="Logo" xml:space="preserve"> <data name="Color" xml:space="preserve">
<value>Logo</value> <value>Cor</value>
</data> </data>
<data name="MatrixBanner" xml:space="preserve"> <data name="CPUBoost" xml:space="preserve">
<value>Bandeira Binária</value> <value>CPU Boost</value>
</data> </data>
<data name="MatrixBright" xml:space="preserve"> <data name="Custom" xml:space="preserve">
<value>Brilho</value> <value>Personalizado</value>
</data> </data>
<data name="MatrixClock" xml:space="preserve"> <data name="Default" xml:space="preserve">
<value>Relógio</value> <value>Padrão</value>
</data> </data>
<data name="MatrixDim" xml:space="preserve"> <data name="DisableOverdrive" xml:space="preserve">
<value>Escuro</value> <value>Desativar o overdrive da tela</value>
</data> </data>
<data name="MatrixLogo" xml:space="preserve"> <data name="Discharging" xml:space="preserve">
<value>Logo ROG</value> <value>Descarregando</value>
</data> </data>
<data name="MatrixMedium" xml:space="preserve"> <data name="DownloadUpdate" xml:space="preserve">
<value>Médio</value> <value>Baixar a atualização</value>
</data> </data>
<data name="MatrixOff" xml:space="preserve"> <data name="EcoGPUTooltip" xml:space="preserve">
<value>Desligado</value> <value>Desativar o dGPU para economisar a energía</value>
</data> </data>
<data name="MatrixPicture" xml:space="preserve"> <data name="EcoMode" xml:space="preserve">
<value>Imagem</value> <value>Econômico</value>
</data> </data>
<data name="MaxRefreshTooltip" xml:space="preserve"> <data name="Extra" xml:space="preserve">
<value>Taxa de atualização maxíma para abaixar a latência</value> <value>Adicional</value>
</data> </data>
<data name="MinRefreshTooltip" xml:space="preserve"> <data name="ExtraSettings" xml:space="preserve">
<value>Taxa de atualização à 60Hz para salvar energía</value> <value>Configurações adicionais</value>
</data> </data>
<data name="Multizone" xml:space="preserve"> <data name="FactoryDefaults" xml:space="preserve">
<value>Multizona</value> <value>Padrão de fábrica</value>
</data> </data>
<data name="OpenGHelper" xml:space="preserve"> <data name="FanCurves" xml:space="preserve">
<value>Abrir G-Helper</value> <value>Curvas de ventilador</value>
</data> </data>
<data name="Optimized" xml:space="preserve"> <data name="FanProfileCPU" xml:space="preserve">
<value>Otimizado</value> <value>Perfil de ventilador CPU</value>
</data> </data>
<data name="OptimizedGPUTooltip" xml:space="preserve"> <data name="FanProfileGPU" xml:space="preserve">
<value>Passar ao Ecônomico em bateria e voltar quando carregando</value> <value>Perfil de ventilador GPU</value>
</data> </data>
<data name="OptimizedUSBC" xml:space="preserve"> <data name="FanProfileMid" xml:space="preserve">
<value>Manter o GPU desligado com um carregador USB-C no Modo Otimizado</value> <value>Perfil de ventilador central</value>
</data> </data>
<data name="Other" xml:space="preserve"> <data name="FanProfiles" xml:space="preserve">
<value>Outro</value> <value>Perfis de ventilador</value>
</data> </data>
<data name="Overdrive" xml:space="preserve"> <data name="FansAndPower" xml:space="preserve">
<value>Overdrive</value> <value>Ventiladores e Energía</value>
</data> </data>
<data name="PerformanceMode" xml:space="preserve"> <data name="FanSpeed" xml:space="preserve">
<value>Modo Desempenho</value> <value>Ventilador</value>
</data> </data>
<data name="PictureGif" xml:space="preserve"> <data name="FansPower" xml:space="preserve">
<value>Imagem / Gif</value> <value>Ventiladores + Energía</value>
</data> </data>
<data name="PlayPause" xml:space="preserve"> <data name="GPUBoost" xml:space="preserve">
<value>Reproduzir / Pausar</value> <value>Boost dinâmico</value>
</data> </data>
<data name="PowerLimits" xml:space="preserve"> <data name="GPUChanging" xml:space="preserve">
<value>Limitações de Energia (PPT)</value> <value>Carregando</value>
</data> </data>
<data name="PPTExperimental" xml:space="preserve"> <data name="GPUMode" xml:space="preserve">
<value>Limitações de Energia (PPT) é uma funcionalidade experimental. Usar isso com cuidado </value> <value>Modo de GPU</value>
</data> </data>
<data name="PrintScreen" xml:space="preserve"> <data name="GPUModeEco" xml:space="preserve">
<value>Captura de tela</value> <value>Só iGPU</value>
</data> </data>
<data name="Quit" xml:space="preserve"> <data name="GPUModeStandard" xml:space="preserve">
<value>Sair</value> <value>iGPU + dGPU</value>
</data> </data>
<data name="GPUCoreClockOffset" xml:space="preserve"> <data name="GPUModeUltimate" xml:space="preserve">
<value>Aumento da frequência básica</value> <value>Exclusivamente dGPU</value>
</data> </data>
<data name="GPUMemoryClockOffset" xml:space="preserve"> <data name="GPUSettings" xml:space="preserve">
<value>Aumento da frequência da memória</value> <value>Parâmetros de GPU</value>
</data> </data>
<data name="KeyBindings" xml:space="preserve"> <data name="GPUTempTarget" xml:space="preserve">
<value>Combinações de teclas</value> <value>Alvo de temperatura</value>
</data> </data>
<data name="RPM" xml:space="preserve"> <data name="Keyboard" xml:space="preserve">
<value>RPM</value> <value>Teclado</value>
</data> </data>
<data name="RestartGPU" xml:space="preserve"> <data name="KeyboardAuto" xml:space="preserve">
<value>Algum processo está usando o dGPU e impedindo o modo Econômico. Reinicialize o dGPU no gerenciador de dispositivos. Por favor, proceda por sua conta e risco. </value> <value>Abaixar a luz de fundo na bateria e voltar quando carregando</value>
</data> </data>
<data name="RunOnStartup" xml:space="preserve"> <data name="KeyboardBacklight" xml:space="preserve">
<value>Executar ao iniciar</value> <value>Luz de fundo do teclado</value>
</data> </data>
<data name="Shutdown" xml:space="preserve"> <data name="LaptopBacklight" xml:space="preserve">
<value>Desligar</value> <value>Luz de fundo do computador</value>
</data> </data>
<data name="Silent" xml:space="preserve"> <data name="LaptopKeyboard" xml:space="preserve">
<value>Silencioso</value> <value>Teclado do computador</value>
</data> </data>
<data name="Sleep" xml:space="preserve"> <data name="LaptopScreen" xml:space="preserve">
<value>Hibernação</value> <value>Tela do computador</value>
</data> </data>
<data name="StandardGPUTooltip" xml:space="preserve"> <data name="Lid" xml:space="preserve">
<value>Liga o dGPU para uso padrão</value> <value>Tampa</value>
</data> </data>
<data name="StandardMode" xml:space="preserve"> <data name="Logo" xml:space="preserve">
<value>Padrão</value> <value>Logo</value>
</data> </data>
<data name="StartupError" xml:space="preserve"> <data name="MatrixBanner" xml:space="preserve">
<value>Erro ao iniciar</value> <value>Bandeira Binária</value>
</data> </data>
<data name="ToggleAura" xml:space="preserve"> <data name="MatrixBright" xml:space="preserve">
<value>Alternar Aura</value> <value>Brilho</value>
</data> </data>
<data name="ToggleMiniled" xml:space="preserve"> <data name="MatrixClock" xml:space="preserve">
<value>Alternar Miniled (se suportado) </value> <value>Relógio</value>
</data> </data>
<data name="ToggleScreen" xml:space="preserve"> <data name="MatrixDim" xml:space="preserve">
<value>Alternar Tela</value> <value>Escuro</value>
</data> </data>
<data name="Turbo" xml:space="preserve"> <data name="MatrixLogo" xml:space="preserve">
<value>Turbo</value> <value>Logo ROG</value>
</data> </data>
<data name="TurnedOff" xml:space="preserve"> <data name="MatrixMedium" xml:space="preserve">
<value>Desligado</value> <value>Médio</value>
</data> </data>
<data name="TurnOffOnBattery" xml:space="preserve"> <data name="MatrixOff" xml:space="preserve">
<value>Desligar em bateria</value> <value>Desligado</value>
</data> </data>
<data name="UltimateGPUTooltip" xml:space="preserve"> <data name="MatrixPicture" xml:space="preserve">
<value>Direciona a tela do computador ao dGPU</value> <value>Imagem</value>
</data> </data>
<data name="UltimateMode" xml:space="preserve"> <data name="MaxRefreshTooltip" xml:space="preserve">
<value>Ultimate</value> <value>Taxa de atualização maxíma para abaixar a latência</value>
</data> </data>
<data name="VersionLabel" xml:space="preserve"> <data name="MinRefreshTooltip" xml:space="preserve">
<value>Versão</value> <value>Taxa de atualização à 60Hz para salvar energía</value>
</data> </data>
<data name="VolumeMute" xml:space="preserve"> <data name="Multizone" xml:space="preserve">
<value>Mudo</value> <value>Multizona</value>
</data> </data>
<data name="WindowTop" xml:space="preserve"> <data name="OpenGHelper" xml:space="preserve">
<value>Manter o app em primeiro plano</value> <value>Abrir G-Helper</value>
</data> </data>
<data name="Optimized" xml:space="preserve">
<value>Otimizado</value>
</data>
<data name="OptimizedGPUTooltip" xml:space="preserve">
<value>Passar ao Ecônomico em bateria e voltar quando carregando</value>
</data>
<data name="OptimizedUSBC" xml:space="preserve">
<value>Manter o GPU desligado com um carregador USB-C no Modo Otimizado</value>
</data>
<data name="Other" xml:space="preserve">
<value>Outro</value>
</data>
<data name="Overdrive" xml:space="preserve">
<value>Overdrive</value>
</data>
<data name="PerformanceMode" xml:space="preserve">
<value>Modo Desempenho</value>
</data>
<data name="PictureGif" xml:space="preserve">
<value>Imagem / Gif</value>
</data>
<data name="PlayPause" xml:space="preserve">
<value>Reproduzir / Pausar</value>
</data>
<data name="PowerLimits" xml:space="preserve">
<value>Limitações de Energia</value>
</data>
<data name="PPTExperimental" xml:space="preserve">
<value>Limitações de Energia é uma funcionalidade experimental. Usar isso com cuidado </value>
</data>
<data name="PrintScreen" xml:space="preserve">
<value>Captura de tela</value>
</data>
<data name="Quit" xml:space="preserve">
<value>Sair</value>
</data>
<data name="GPUCoreClockOffset" xml:space="preserve">
<value>Aumento da frequência básica</value>
</data>
<data name="GPUMemoryClockOffset" xml:space="preserve">
<value>Aumento da frequência da memória</value>
</data>
<data name="KeyBindings" xml:space="preserve">
<value>Combinações de teclas</value>
</data>
<data name="RPM" xml:space="preserve">
<value>RPM</value>
</data>
<data name="RestartGPU" xml:space="preserve">
<value>Algum processo está usando o dGPU e impedindo o modo Econômico. Reinicialize o dGPU no gerenciador de dispositivos. Por favor, proceda por sua conta e risco. </value>
</data>
<data name="RunOnStartup" xml:space="preserve">
<value>Executar ao iniciar</value>
</data>
<data name="Shutdown" xml:space="preserve">
<value>Desligar</value>
</data>
<data name="Silent" xml:space="preserve">
<value>Silencioso</value>
</data>
<data name="Sleep" xml:space="preserve">
<value>Hibernação</value>
</data>
<data name="StandardGPUTooltip" xml:space="preserve">
<value>Liga o dGPU para uso padrão</value>
</data>
<data name="StandardMode" xml:space="preserve">
<value>Padrão</value>
</data>
<data name="StartupError" xml:space="preserve">
<value>Erro ao iniciar</value>
</data>
<data name="ToggleAura" xml:space="preserve">
<value>Alternar Aura</value>
</data>
<data name="ToggleMiniled" xml:space="preserve">
<value>Alternar Miniled (se suportado) </value>
</data>
<data name="ToggleScreen" xml:space="preserve">
<value>Alternar Tela</value>
</data>
<data name="Turbo" xml:space="preserve">
<value>Turbo</value>
</data>
<data name="TurnedOff" xml:space="preserve">
<value>Desligado</value>
</data>
<data name="TurnOffOnBattery" xml:space="preserve">
<value>Desligar em bateria</value>
</data>
<data name="UltimateGPUTooltip" xml:space="preserve">
<value>Direciona a tela do computador ao dGPU</value>
</data>
<data name="UltimateMode" xml:space="preserve">
<value>Ultimate</value>
</data>
<data name="VersionLabel" xml:space="preserve">
<value>Versão</value>
</data>
<data name="VolumeMute" xml:space="preserve">
<value>Mudo</value>
</data>
<data name="WindowTop" xml:space="preserve">
<value>Manter o app em primeiro plano</value>
</data>
</root> </root>

View File

@@ -403,7 +403,7 @@
<value>Overdrive</value> <value>Overdrive</value>
</data> </data>
<data name="PerformanceMode" xml:space="preserve"> <data name="PerformanceMode" xml:space="preserve">
<value>Performance Mode</value> <value>Mode</value>
</data> </data>
<data name="PictureGif" xml:space="preserve"> <data name="PictureGif" xml:space="preserve">
<value>Picture / Gif</value> <value>Picture / Gif</value>
@@ -412,10 +412,10 @@
<value>Play / Pause</value> <value>Play / Pause</value>
</data> </data>
<data name="PowerLimits" xml:space="preserve"> <data name="PowerLimits" xml:space="preserve">
<value>Power Limits (PPT)</value> <value>Power Limits</value>
</data> </data>
<data name="PPTExperimental" xml:space="preserve"> <data name="PPTExperimental" xml:space="preserve">
<value>Power Limits (PPT) is experimental feature. Use carefully and on your own risk!</value> <value>Power Limits is experimental feature. Use carefully and on your own risk!</value>
</data> </data>
<data name="PrintScreen" xml:space="preserve"> <data name="PrintScreen" xml:space="preserve">
<value>PrintScreen</value> <value>PrintScreen</value>

View File

@@ -364,10 +364,10 @@
<value>Oynat / Duraklat</value> <value>Oynat / Duraklat</value>
</data> </data>
<data name="PowerLimits" xml:space="preserve"> <data name="PowerLimits" xml:space="preserve">
<value>Güç Sınırları (PPT)</value> <value>Güç Sınırları</value>
</data> </data>
<data name="PPTExperimental" xml:space="preserve"> <data name="PPTExperimental" xml:space="preserve">
<value>Güç Sınırları (PPT) deneysel bir özelliktir. Riski göze alarak dikkatli kullanın!</value> <value>Güç Sınırları deneysel bir özelliktir. Riski göze alarak dikkatli kullanın!</value>
</data> </data>
<data name="PrintScreen" xml:space="preserve"> <data name="PrintScreen" xml:space="preserve">
<value>Ekran Görüntüsü Al</value> <value>Ekran Görüntüsü Al</value>

View File

@@ -156,6 +156,9 @@
<data name="ApplyWindowsPowerPlan" xml:space="preserve"> <data name="ApplyWindowsPowerPlan" xml:space="preserve">
<value>Автоматично застосовувати Windows Power Modes</value> <value>Автоматично застосовувати Windows Power Modes</value>
</data> </data>
<data name="AsusServicesRunning" xml:space="preserve">
<value>Кількість запущених сервісів Asus</value>
</data>
<data name="AuraBreathe" xml:space="preserve"> <data name="AuraBreathe" xml:space="preserve">
<value>Дихання</value> <value>Дихання</value>
</data> </data>
@@ -210,6 +213,12 @@
<data name="Brightness" xml:space="preserve"> <data name="Brightness" xml:space="preserve">
<value>Яскравість</value> <value>Яскравість</value>
</data> </data>
<data name="BrightnessDown" xml:space="preserve">
<value>Зменшити яскравість</value>
</data>
<data name="BrightnessUp" xml:space="preserve">
<value>Підвищити яскравість</value>
</data>
<data name="Color" xml:space="preserve"> <data name="Color" xml:space="preserve">
<value>Колір</value> <value>Колір</value>
</data> </data>
@@ -367,7 +376,7 @@
<value>Овердрайв</value> <value>Овердрайв</value>
</data> </data>
<data name="PerformanceMode" xml:space="preserve"> <data name="PerformanceMode" xml:space="preserve">
<value>Режим Роботи</value> <value>Режим</value>
</data> </data>
<data name="PictureGif" xml:space="preserve"> <data name="PictureGif" xml:space="preserve">
<value>Картинка / GIF</value> <value>Картинка / GIF</value>
@@ -376,10 +385,10 @@
<value>Відтворення / Пауза</value> <value>Відтворення / Пауза</value>
</data> </data>
<data name="PowerLimits" xml:space="preserve"> <data name="PowerLimits" xml:space="preserve">
<value>Ліміти Потужності (PPT)</value> <value>Ліміти Потужності</value>
</data> </data>
<data name="PPTExperimental" xml:space="preserve"> <data name="PPTExperimental" xml:space="preserve">
<value>Налаштування лімітів потужності (PPT) є експериментальною функцією. Використовуйте обережно та на свій страх і ризик!</value> <value>Налаштування лімітів потужності є експериментальною функцією. Використовуйте обережно та на свій страх і ризик!</value>
</data> </data>
<data name="PrintScreen" xml:space="preserve"> <data name="PrintScreen" xml:space="preserve">
<value>Print Screen</value> <value>Print Screen</value>
@@ -408,9 +417,21 @@
<data name="StandardMode" xml:space="preserve"> <data name="StandardMode" xml:space="preserve">
<value>Стандартний</value> <value>Стандартний</value>
</data> </data>
<data name="Start" xml:space="preserve">
<value>Запустити</value>
</data>
<data name="StartingServices" xml:space="preserve">
<value>Запускаються сервіси</value>
</data>
<data name="StartupError" xml:space="preserve"> <data name="StartupError" xml:space="preserve">
<value>Помилка запуску</value> <value>Помилка запуску</value>
</data> </data>
<data name="Stop" xml:space="preserve">
<value>Зупинити</value>
</data>
<data name="StoppingServices" xml:space="preserve">
<value>Зупиняються сервіси</value>
</data>
<data name="ToggleAura" xml:space="preserve"> <data name="ToggleAura" xml:space="preserve">
<value>Аура</value> <value>Аура</value>
</data> </data>

View File

@@ -388,10 +388,10 @@
<value>Phát / Dừng</value> <value>Phát / Dừng</value>
</data> </data>
<data name="PowerLimits" xml:space="preserve"> <data name="PowerLimits" xml:space="preserve">
<value>Giới hạn công suất (PPT)</value> <value>Giới hạn công suất</value>
</data> </data>
<data name="PPTExperimental" xml:space="preserve"> <data name="PPTExperimental" xml:space="preserve">
<value>Giới hạn công suất (PPT) là tính năng thử nghiệm. Sử dụng nó cẩn thận và tự chịu mọi rủi ro!</value> <value>Giới hạn công suất là tính năng thử nghiệm. Sử dụng nó cẩn thận và tự chịu mọi rủi ro!</value>
</data> </data>
<data name="PrintScreen" xml:space="preserve"> <data name="PrintScreen" xml:space="preserve">
<value>Chụp màn hình</value> <value>Chụp màn hình</value>

View File

@@ -367,10 +367,10 @@
<value>播放/暂停</value> <value>播放/暂停</value>
</data> </data>
<data name="PowerLimits" xml:space="preserve"> <data name="PowerLimits" xml:space="preserve">
<value>功率限制 (PPT)</value> <value>功率限制</value>
</data> </data>
<data name="PPTExperimental" xml:space="preserve"> <data name="PPTExperimental" xml:space="preserve">
<value>功率限制 (PPT) 是实验性功能。 谨慎使用,风险自负!</value> <value>功率限制 是实验性功能。 谨慎使用,风险自负!</value>
</data> </data>
<data name="PrintScreen" xml:space="preserve"> <data name="PrintScreen" xml:space="preserve">
<value>截图</value> <value>截图</value>

View File

@@ -403,7 +403,7 @@
<value>播放/暫停</value> <value>播放/暫停</value>
</data> </data>
<data name="PowerLimits" xml:space="preserve"> <data name="PowerLimits" xml:space="preserve">
<value>功率限制 (PPT)</value> <value>功率限制</value>
</data> </data>
<data name="PPTExperimental" xml:space="preserve"> <data name="PPTExperimental" xml:space="preserve">
<value>功率限制是實驗性功能。謹慎使用,風險自負!</value> <value>功率限制是實驗性功能。謹慎使用,風險自負!</value>

Binary file not shown.

After

Width:  |  Height:  |  Size: 607 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 504 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 319 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 597 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 281 B

View File

@@ -310,7 +310,7 @@ namespace GHelper
// //
pictureBattery.BackgroundImage = (Image)resources.GetObject("pictureBattery.BackgroundImage"); pictureBattery.BackgroundImage = (Image)resources.GetObject("pictureBattery.BackgroundImage");
pictureBattery.BackgroundImageLayout = ImageLayout.Zoom; pictureBattery.BackgroundImageLayout = ImageLayout.Zoom;
pictureBattery.Location = new Point(6, 0); pictureBattery.Location = new Point(4, 1);
pictureBattery.Margin = new Padding(4); pictureBattery.Margin = new Padding(4);
pictureBattery.Name = "pictureBattery"; pictureBattery.Name = "pictureBattery";
pictureBattery.Size = new Size(32, 32); pictureBattery.Size = new Size(32, 32);
@@ -320,7 +320,7 @@ namespace GHelper
// labelBatteryTitle // labelBatteryTitle
// //
labelBatteryTitle.Font = new Font("Segoe UI", 9F, FontStyle.Bold, GraphicsUnit.Point); labelBatteryTitle.Font = new Font("Segoe UI", 9F, FontStyle.Bold, GraphicsUnit.Point);
labelBatteryTitle.Location = new Point(34, 0); labelBatteryTitle.Location = new Point(42, 0);
labelBatteryTitle.Margin = new Padding(8, 0, 8, 0); labelBatteryTitle.Margin = new Padding(8, 0, 8, 0);
labelBatteryTitle.Name = "labelBatteryTitle"; labelBatteryTitle.Name = "labelBatteryTitle";
labelBatteryTitle.Size = new Size(393, 32); labelBatteryTitle.Size = new Size(393, 32);

View File

@@ -23,7 +23,7 @@ namespace GHelper
public string versionUrl = "http://github.com/seerge/g-helper/releases"; public string versionUrl = "http://github.com/seerge/g-helper/releases";
public string perfName = "Balanced"; public string modeName = "Balanced";
public AniMatrix matrix; public AniMatrix matrix;
public Fans fans; public Fans fans;
@@ -79,6 +79,7 @@ namespace GHelper
buttonSilent.BorderColor = colorEco; buttonSilent.BorderColor = colorEco;
buttonBalanced.BorderColor = colorStandard; buttonBalanced.BorderColor = colorStandard;
buttonTurbo.BorderColor = colorTurbo; buttonTurbo.BorderColor = colorTurbo;
buttonFans.BorderColor = colorCustom;
buttonEco.BorderColor = colorEco; buttonEco.BorderColor = colorEco;
buttonStandard.BorderColor = colorStandard; buttonStandard.BorderColor = colorStandard;
@@ -176,7 +177,7 @@ namespace GHelper
labelModel.Text = model + (ProcessHelper.IsUserAdministrator() ? "." : ""); labelModel.Text = model + (ProcessHelper.IsUserAdministrator() ? "." : "");
TopMost = AppConfig.isConfig("topmost"); TopMost = AppConfig.Is("topmost");
SetContextMenu(); SetContextMenu();
@@ -188,6 +189,16 @@ namespace GHelper
} }
private void SettingsForm_VisibleChanged(object? sender, EventArgs e)
{
aTimer.Enabled = this.Visible;
if (this.Visible)
{
InitScreen();
InitXGM();
}
}
private void ButtonUpdates_Click(object? sender, EventArgs e) private void ButtonUpdates_Click(object? sender, EventArgs e)
{ {
if (updates == null || updates.Text == "") if (updates == null || updates.Text == "")
@@ -247,7 +258,7 @@ namespace GHelper
public void SetContextMenu() public void SetContextMenu()
{ {
var mode = AppConfig.getConfig("performance_mode"); var mode = Modes.GetCurrent();
contextMenuStrip.Items.Clear(); contextMenuStrip.Items.Clear();
Padding padding = new Padding(15, 5, 5, 5); Padding padding = new Padding(15, 5, 5, 5);
@@ -354,12 +365,12 @@ namespace GHelper
else else
{ {
Program.acpi.DeviceSet(AsusACPI.GPUXG, 1, "GPU XGM"); Program.acpi.DeviceSet(AsusACPI.GPUXG, 1, "GPU XGM");
AsusUSB.ApplyXGMLight(AppConfig.isConfig("xmg_light")); AsusUSB.ApplyXGMLight(AppConfig.Is("xmg_light"));
await Task.Delay(TimeSpan.FromSeconds(15)); await Task.Delay(TimeSpan.FromSeconds(15));
if (AppConfig.isConfigPerf("auto_apply")) if (AppConfig.IsMode("auto_apply"))
AsusUSB.SetXGMFan(AppConfig.getFanConfig(AsusFan.XGM)); AsusUSB.SetXGMFan(AppConfig.GetFanConfig(AsusFan.XGM));
} }
BeginInvoke(delegate BeginInvoke(delegate
@@ -410,13 +421,13 @@ namespace GHelper
if (gitVersion.CompareTo(appVersion) > 0) if (gitVersion.CompareTo(appVersion) > 0)
{ {
SetVersionLabel(Properties.Strings.DownloadUpdate + ": " + tag, url); SetVersionLabel(Properties.Strings.DownloadUpdate + ": " + tag, url);
if (AppConfig.getConfigString("skip_version") != tag) if (AppConfig.GetString("skip_version") != tag)
{ {
DialogResult dialogResult = MessageBox.Show(Properties.Strings.DownloadUpdate + ": G-Helper " + tag + "?", "Update", MessageBoxButtons.YesNo); DialogResult dialogResult = MessageBox.Show(Properties.Strings.DownloadUpdate + ": G-Helper " + tag + "?", "Update", MessageBoxButtons.YesNo);
if (dialogResult == DialogResult.Yes) if (dialogResult == DialogResult.Yes)
AutoUpdate(url); AutoUpdate(url);
else else
AppConfig.setConfig("skip_version", tag); AppConfig.Set("skip_version", tag);
} }
} }
@@ -557,14 +568,14 @@ namespace GHelper
private void ButtonOptimized_Click(object? sender, EventArgs e) private void ButtonOptimized_Click(object? sender, EventArgs e)
{ {
AppConfig.setConfig("gpu_auto", (AppConfig.getConfig("gpu_auto") == 1) ? 0 : 1); AppConfig.Set("gpu_auto", (AppConfig.Get("gpu_auto") == 1) ? 0 : 1);
VisualiseGPUMode(); VisualiseGPUMode();
AutoGPUMode(); AutoGPUMode();
} }
private void ButtonScreenAuto_Click(object? sender, EventArgs e) private void ButtonScreenAuto_Click(object? sender, EventArgs e)
{ {
AppConfig.setConfig("screen_auto", 1); AppConfig.Set("screen_auto", 1);
InitScreen(); InitScreen();
AutoScreen(); AutoScreen();
} }
@@ -589,7 +600,7 @@ namespace GHelper
{ {
if (sender is null) return; if (sender is null) return;
CheckBox check = (CheckBox)sender; CheckBox check = (CheckBox)sender;
AppConfig.setConfig("matrix_auto", check.Checked ? 1 : 0); AppConfig.Set("matrix_auto", check.Checked ? 1 : 0);
matrix?.SetMatrix(); matrix?.SetMatrix();
} }
@@ -616,8 +627,8 @@ namespace GHelper
if (fileName is not null) if (fileName is not null)
{ {
AppConfig.setConfig("matrix_picture", fileName); AppConfig.Set("matrix_picture", fileName);
AppConfig.setConfig("matrix_running", 2); AppConfig.Set("matrix_running", 2);
matrix?.SetMatrixPicture(fileName); matrix?.SetMatrixPicture(fileName);
BeginInvoke(delegate BeginInvoke(delegate
@@ -631,21 +642,21 @@ namespace GHelper
private void ComboMatrixRunning_SelectedValueChanged(object? sender, EventArgs e) private void ComboMatrixRunning_SelectedValueChanged(object? sender, EventArgs e)
{ {
AppConfig.setConfig("matrix_running", comboMatrixRunning.SelectedIndex); AppConfig.Set("matrix_running", comboMatrixRunning.SelectedIndex);
matrix?.SetMatrix(); matrix?.SetMatrix();
} }
private void ComboMatrix_SelectedValueChanged(object? sender, EventArgs e) private void ComboMatrix_SelectedValueChanged(object? sender, EventArgs e)
{ {
AppConfig.setConfig("matrix_brightness", comboMatrix.SelectedIndex); AppConfig.Set("matrix_brightness", comboMatrix.SelectedIndex);
matrix?.SetMatrix(); matrix?.SetMatrix();
} }
private void LabelCPUFan_Click(object? sender, EventArgs e) private void LabelCPUFan_Click(object? sender, EventArgs e)
{ {
AppConfig.setConfig("fan_rpm", (AppConfig.getConfig("fan_rpm") == 1) ? 0 : 1); AppConfig.Set("fan_rpm", (AppConfig.Get("fan_rpm") == 1) ? 0 : 1);
RefreshSensors(true); RefreshSensors(true);
} }
@@ -658,7 +669,7 @@ namespace GHelper
if (colorDlg.ShowDialog() == DialogResult.OK) if (colorDlg.ShowDialog() == DialogResult.OK)
{ {
AppConfig.setConfig("aura_color2", colorDlg.Color.ToArgb()); AppConfig.Set("aura_color2", colorDlg.Color.ToArgb());
SetAura(); SetAura();
} }
} }
@@ -714,17 +725,17 @@ namespace GHelper
if (colorDlg.ShowDialog() == DialogResult.OK) if (colorDlg.ShowDialog() == DialogResult.OK)
{ {
AppConfig.setConfig("aura_color", colorDlg.Color.ToArgb()); AppConfig.Set("aura_color", colorDlg.Color.ToArgb());
SetAura(); SetAura();
} }
} }
public void InitAura() public void InitAura()
{ {
AsusUSB.Mode = AppConfig.getConfig("aura_mode"); AsusUSB.Mode = AppConfig.Get("aura_mode");
AsusUSB.Speed = AppConfig.getConfig("aura_speed"); AsusUSB.Speed = AppConfig.Get("aura_speed");
AsusUSB.SetColor(AppConfig.getConfig("aura_color")); AsusUSB.SetColor(AppConfig.Get("aura_color"));
AsusUSB.SetColor2(AppConfig.getConfig("aura_color2")); AsusUSB.SetColor2(AppConfig.Get("aura_color2"));
comboKeyboard.DropDownStyle = ComboBoxStyle.DropDownList; comboKeyboard.DropDownStyle = ComboBoxStyle.DropDownList;
comboKeyboard.DataSource = new BindingSource(AsusUSB.GetModes(), null); comboKeyboard.DataSource = new BindingSource(AsusUSB.GetModes(), null);
@@ -760,13 +771,13 @@ namespace GHelper
return; return;
} }
int brightness = AppConfig.getConfig("matrix_brightness"); int brightness = AppConfig.Get("matrix_brightness");
int running = AppConfig.getConfig("matrix_running"); int running = AppConfig.Get("matrix_running");
comboMatrix.SelectedIndex = (brightness != -1) ? Math.Min(brightness, comboMatrix.Items.Count - 1) : 0; comboMatrix.SelectedIndex = (brightness != -1) ? Math.Min(brightness, comboMatrix.Items.Count - 1) : 0;
comboMatrixRunning.SelectedIndex = (running != -1) ? Math.Min(running, comboMatrixRunning.Items.Count - 1) : 0; comboMatrixRunning.SelectedIndex = (running != -1) ? Math.Min(running, comboMatrixRunning.Items.Count - 1) : 0;
checkMatrix.Checked = (AppConfig.getConfig("matrix_auto") == 1); checkMatrix.Checked = (AppConfig.Get("matrix_auto") == 1);
checkMatrix.CheckedChanged += CheckMatrix_CheckedChanged; checkMatrix.CheckedChanged += CheckMatrix_CheckedChanged;
} }
@@ -774,10 +785,10 @@ namespace GHelper
public void SetAura() public void SetAura()
{ {
AsusUSB.Mode = AppConfig.getConfig("aura_mode"); AsusUSB.Mode = AppConfig.Get("aura_mode");
AsusUSB.Speed = AppConfig.getConfig("aura_speed"); AsusUSB.Speed = AppConfig.Get("aura_speed");
AsusUSB.SetColor(AppConfig.getConfig("aura_color")); AsusUSB.SetColor(AppConfig.Get("aura_color"));
AsusUSB.SetColor2(AppConfig.getConfig("aura_color2")); AsusUSB.SetColor2(AppConfig.Get("aura_color2"));
pictureColor.BackColor = AsusUSB.Color1; pictureColor.BackColor = AsusUSB.Color1;
pictureColor2.BackColor = AsusUSB.Color2; pictureColor2.BackColor = AsusUSB.Color2;
@@ -797,27 +808,27 @@ namespace GHelper
private void ComboKeyboard_SelectedValueChanged(object? sender, EventArgs e) private void ComboKeyboard_SelectedValueChanged(object? sender, EventArgs e)
{ {
AppConfig.setConfig("aura_mode", (int)comboKeyboard.SelectedValue); AppConfig.Set("aura_mode", (int)comboKeyboard.SelectedValue);
SetAura(); SetAura();
} }
private void Button120Hz_Click(object? sender, EventArgs e) private void Button120Hz_Click(object? sender, EventArgs e)
{ {
AppConfig.setConfig("screen_auto", 0); AppConfig.Set("screen_auto", 0);
SetScreen(1000, 1); SetScreen(1000, 1);
} }
private void Button60Hz_Click(object? sender, EventArgs e) private void Button60Hz_Click(object? sender, EventArgs e)
{ {
AppConfig.setConfig("screen_auto", 0); AppConfig.Set("screen_auto", 0);
SetScreen(60, 0); SetScreen(60, 0);
} }
public void ToogleMiniled() public void ToogleMiniled()
{ {
int miniled = (AppConfig.getConfig("miniled") == 1) ? 0 : 1; int miniled = (AppConfig.Get("miniled") == 1) ? 0 : 1;
AppConfig.setConfig("miniled", miniled); AppConfig.Set("miniled", miniled);
SetScreen(-1, -1, miniled); SetScreen(-1, -1, miniled);
} }
@@ -847,7 +858,7 @@ namespace GHelper
if (overdrive >= 0) if (overdrive >= 0)
{ {
if (AppConfig.getConfig("no_overdrive") == 1) overdrive = 0; if (AppConfig.Get("no_overdrive") == 1) overdrive = 0;
Program.acpi.DeviceSet(AsusACPI.ScreenOverdrive, overdrive, "ScreenOverdrive"); Program.acpi.DeviceSet(AsusACPI.ScreenOverdrive, overdrive, "ScreenOverdrive");
} }
@@ -867,14 +878,16 @@ namespace GHelper
int frequency = NativeMethods.GetRefreshRate(); int frequency = NativeMethods.GetRefreshRate();
int maxFrequency = NativeMethods.GetRefreshRate(true); int maxFrequency = NativeMethods.GetRefreshRate(true);
bool screenAuto = (AppConfig.getConfig("screen_auto") == 1); bool screenAuto = (AppConfig.Get("screen_auto") == 1);
bool overdriveSetting = (AppConfig.getConfig("no_overdrive") != 1); bool overdriveSetting = (AppConfig.Get("no_overdrive") != 1);
int overdrive = Program.acpi.DeviceGet(AsusACPI.ScreenOverdrive); int overdrive = Program.acpi.DeviceGet(AsusACPI.ScreenOverdrive);
int miniled = Program.acpi.DeviceGet(AsusACPI.ScreenMiniled); int miniled = Program.acpi.DeviceGet(AsusACPI.ScreenMiniled);
bool screenEnabled = (frequency >= 0); bool screenEnabled = (frequency >= 0);
Debug.WriteLine(frequency.ToString());
ButtonEnabled(button60Hz, screenEnabled); ButtonEnabled(button60Hz, screenEnabled);
ButtonEnabled(button120Hz, screenEnabled); ButtonEnabled(button120Hz, screenEnabled);
ButtonEnabled(buttonScreenAuto, screenEnabled); ButtonEnabled(buttonScreenAuto, screenEnabled);
@@ -914,15 +927,15 @@ namespace GHelper
if (miniled >= 0) if (miniled >= 0)
{ {
buttonMiniled.Activated = (miniled == 1); buttonMiniled.Activated = (miniled == 1);
AppConfig.setConfig("miniled", miniled); AppConfig.Set("miniled", miniled);
} }
else else
{ {
buttonMiniled.Visible = false; buttonMiniled.Visible = false;
} }
AppConfig.setConfig("frequency", frequency); AppConfig.Set("frequency", frequency);
AppConfig.setConfig("overdrive", overdrive); AppConfig.Set("overdrive", overdrive);
} }
private void ButtonQuit_Click(object? sender, EventArgs e) private void ButtonQuit_Click(object? sender, EventArgs e)
@@ -1011,38 +1024,17 @@ namespace GHelper
} }
private void SettingsForm_VisibleChanged(object? sender, EventArgs e)
{
if (this.Visible)
{
InitScreen();
InitXGM();
this.Left = Screen.FromControl(this).WorkingArea.Width - 10 - this.Width;
this.Top = Screen.FromControl(this).WorkingArea.Height - 10 - this.Height;
this.Activate();
aTimer.Enabled = true;
}
else
{
aTimer.Enabled = false;
}
}
private void SetPerformanceLabel() private void SetPerformanceLabel()
{ {
labelPerf.Text = Properties.Strings.PerformanceMode + (customFans ? "+" : "") + ((customPower > 0) ? " " + customPower + "W" : ""); labelPerf.Text = Properties.Strings.PerformanceMode + ": " + Modes.GetCurrentName() + (customFans ? "+" : "") + ((customPower > 0) ? " " + customPower + "W" : "");
} }
public void SetPower() public void SetPower()
{ {
int limit_total = AppConfig.getConfigPerf("limit_total"); int limit_total = AppConfig.GetMode("limit_total");
int limit_cpu = AppConfig.getConfigPerf("limit_cpu"); int limit_cpu = AppConfig.GetMode("limit_cpu");
int limit_fast = AppConfig.getConfigPerf("limit_fast"); int limit_fast = AppConfig.GetMode("limit_fast");
if (limit_total > AsusACPI.MaxTotal) return; if (limit_total > AsusACPI.MaxTotal) return;
if (limit_total < AsusACPI.MinTotal) return; if (limit_total < AsusACPI.MinTotal) return;
@@ -1081,8 +1073,8 @@ namespace GHelper
public void SetGPUClocks(bool launchAsAdmin = true) public void SetGPUClocks(bool launchAsAdmin = true)
{ {
int gpu_core = AppConfig.getConfigPerf("gpu_core"); int gpu_core = AppConfig.GetMode("gpu_core");
int gpu_memory = AppConfig.getConfigPerf("gpu_memory"); int gpu_memory = AppConfig.GetMode("gpu_memory");
if (gpu_core == -1 && gpu_memory == -1) return; if (gpu_core == -1 && gpu_memory == -1) return;
@@ -1114,8 +1106,8 @@ namespace GHelper
public void SetGPUPower() public void SetGPUPower()
{ {
int gpu_boost = AppConfig.getConfigPerf("gpu_boost"); int gpu_boost = AppConfig.GetMode("gpu_boost");
int gpu_temp = AppConfig.getConfigPerf("gpu_temp"); int gpu_temp = AppConfig.GetMode("gpu_temp");
if (gpu_boost < AsusACPI.MinGPUBoost || gpu_boost > AsusACPI.MaxGPUBoost) return; if (gpu_boost < AsusACPI.MinGPUBoost || gpu_boost > AsusACPI.MaxGPUBoost) return;
@@ -1144,28 +1136,28 @@ namespace GHelper
{ {
customFans = false; customFans = false;
if (AppConfig.isConfigPerf("auto_apply") || force) if (AppConfig.IsMode("auto_apply") || force)
{ {
bool xgmFan = false; bool xgmFan = false;
if (AppConfig.isConfig("xgm_fan") && Program.acpi.IsXGConnected()) if (AppConfig.Is("xgm_fan") && Program.acpi.IsXGConnected())
{ {
AsusUSB.SetXGMFan(AppConfig.getFanConfig(AsusFan.XGM)); AsusUSB.SetXGMFan(AppConfig.GetFanConfig(AsusFan.XGM));
xgmFan = true; xgmFan = true;
} }
int cpuResult = Program.acpi.SetFanCurve(AsusFan.CPU, AppConfig.getFanConfig(AsusFan.CPU)); int cpuResult = Program.acpi.SetFanCurve(AsusFan.CPU, AppConfig.GetFanConfig(AsusFan.CPU));
int gpuResult = Program.acpi.SetFanCurve(AsusFan.GPU, AppConfig.getFanConfig(AsusFan.GPU)); int gpuResult = Program.acpi.SetFanCurve(AsusFan.GPU, AppConfig.GetFanConfig(AsusFan.GPU));
if (AppConfig.isConfig("mid_fan")) if (AppConfig.Is("mid_fan"))
Program.acpi.SetFanCurve(AsusFan.Mid, AppConfig.getFanConfig(AsusFan.Mid)); Program.acpi.SetFanCurve(AsusFan.Mid, AppConfig.GetFanConfig(AsusFan.Mid));
// 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 = AppConfig.getConfig("performance_mode"); int mode = Modes.GetCurrentBase();
Logger.WriteLine("ASUS BIOS rejected fan curve, resetting mode to " + mode); Logger.WriteLine("ASUS BIOS rejected fan curve, resetting mode to " + mode);
Program.acpi.DeviceSet(AsusACPI.PerformanceMode, mode, "Reset Mode"); Program.acpi.DeviceSet(AsusACPI.PerformanceMode, mode, "Reset Mode");
LabelFansResult("ASUS BIOS rejected fan curve"); LabelFansResult("ASUS BIOS rejected fan curve");
@@ -1177,7 +1169,7 @@ namespace GHelper
} }
// force set PPTs for missbehaving bios on FX507/517 series // force set PPTs for missbehaving bios on FX507/517 series
if ((AppConfig.ContainsModel("FX507") || AppConfig.ContainsModel("FX517") || xgmFan) && !AppConfig.isConfigPerf("auto_apply_power")) if ((AppConfig.ContainsModel("FX507") || AppConfig.ContainsModel("FX517") || xgmFan) && !AppConfig.IsMode("auto_apply_power"))
{ {
Task.Run(async () => Task.Run(async () =>
{ {
@@ -1195,11 +1187,11 @@ namespace GHelper
private static bool isManualModeRequired() private static bool isManualModeRequired()
{ {
if (!AppConfig.isConfigPerf("auto_apply_power")) if (!AppConfig.IsMode("auto_apply_power"))
return false; return false;
return return
AppConfig.isConfig("manual_mode") || AppConfig.Is("manual_mode") ||
AppConfig.ContainsModel("GU604") || AppConfig.ContainsModel("GU604") ||
AppConfig.ContainsModel("FX517") || AppConfig.ContainsModel("FX517") ||
AppConfig.ContainsModel("G733"); AppConfig.ContainsModel("G733");
@@ -1210,8 +1202,8 @@ namespace GHelper
customPower = 0; customPower = 0;
bool applyPower = AppConfig.isConfigPerf("auto_apply_power"); bool applyPower = AppConfig.IsMode("auto_apply_power");
bool applyFans = AppConfig.isConfigPerf("auto_apply"); bool applyFans = AppConfig.IsMode("auto_apply");
//bool applyGPU = true; //bool applyGPU = true;
if (applyPower) if (applyPower)
@@ -1251,57 +1243,78 @@ namespace GHelper
} }
public void SetPerformanceMode(int PerformanceMode = -1, bool notify = false) public void SetPerformanceMode(int mode = -1, bool notify = false)
{ {
int oldMode = AppConfig.getConfig("performance_mode"); int oldMode = Modes.GetCurrent();
if (PerformanceMode < 0) PerformanceMode = oldMode; if (mode < 0) mode = oldMode;
buttonSilent.Activated = false; buttonSilent.Activated = false;
buttonBalanced.Activated = false; buttonBalanced.Activated = false;
buttonTurbo.Activated = false; buttonTurbo.Activated = false;
buttonFans.Activated = false;
menuSilent.Checked = false; menuSilent.Checked = false;
menuBalanced.Checked = false; menuBalanced.Checked = false;
menuTurbo.Checked = false; menuTurbo.Checked = false;
switch (PerformanceMode) switch (mode)
{ {
case AsusACPI.PerformanceSilent: case AsusACPI.PerformanceSilent:
buttonSilent.Activated = true; buttonSilent.Activated = true;
menuSilent.Checked = true; menuSilent.Checked = true;
perfName = Properties.Strings.Silent;
break; break;
case AsusACPI.PerformanceTurbo: case AsusACPI.PerformanceTurbo:
buttonTurbo.Activated = true; buttonTurbo.Activated = true;
menuTurbo.Checked = true; menuTurbo.Checked = true;
perfName = Properties.Strings.Turbo;
break; break;
default: case AsusACPI.PerformanceBalanced:
buttonBalanced.Activated = true; buttonBalanced.Activated = true;
menuBalanced.Checked = true; menuBalanced.Checked = true;
perfName = Properties.Strings.Balanced; break;
PerformanceMode = AsusACPI.PerformanceBalanced; default:
if (Modes.Exists(mode))
{
buttonFans.Activated = true;
switch (Modes.GetBase(mode))
{
case AsusACPI.PerformanceSilent:
buttonFans.BorderColor = colorEco;
break;
case AsusACPI.PerformanceTurbo:
buttonFans.BorderColor = colorTurbo;
break;
default:
buttonFans.BorderColor = colorStandard;
break;
}
}
else
{
buttonBalanced.Activated = true;
menuBalanced.Checked = true;
mode = AsusACPI.PerformanceBalanced;
}
break; break;
} }
var powerStatus = SystemInformation.PowerStatus.PowerLineStatus;
AppConfig.setConfig("performance_" + (int)powerStatus, PerformanceMode); Modes.SetCurrent(mode);
AppConfig.setConfig("performance_mode", PerformanceMode);
SetPerformanceLabel();
if (isManualModeRequired()) if (isManualModeRequired())
Program.acpi.DeviceSet(AsusACPI.PerformanceMode, AsusACPI.PerformanceManual, "Manual Mode"); Program.acpi.DeviceSet(AsusACPI.PerformanceMode, AsusACPI.PerformanceManual, "Manual Mode");
else else
Program.acpi.DeviceSet(AsusACPI.PerformanceMode, PerformanceMode, "Mode"); Program.acpi.DeviceSet(AsusACPI.PerformanceMode, Modes.GetBase(mode), "Mode");
if (AppConfig.isConfig("xgm_fan") && Program.acpi.IsXGConnected()) AsusUSB.ResetXGM(); if (AppConfig.Is("xgm_fan") && Program.acpi.IsXGConnected()) AsusUSB.ResetXGM();
if (notify) if (notify)
{ {
try try
{ {
toast.RunToast(perfName, powerStatus == PowerLineStatus.Online ? ToastIcon.Charger : ToastIcon.Battery); toast.RunToast(Modes.GetCurrentName(), SystemInformation.PowerStatus.PowerLineStatus == PowerLineStatus.Online ? ToastIcon.Charger : ToastIcon.Battery);
} }
catch catch
{ {
@@ -1314,17 +1327,17 @@ namespace GHelper
AutoFans(); AutoFans();
AutoPower(1000); AutoPower(1000);
if (AppConfig.getConfig("auto_apply_power_plan") != 0) if (AppConfig.Get("auto_apply_power_plan") != 0)
{ {
if (AppConfig.getConfigPerfString("scheme") is not null) if (AppConfig.GetModeString("scheme") is not null)
NativeMethods.SetPowerScheme(AppConfig.getConfigPerfString("scheme")); NativeMethods.SetPowerScheme(AppConfig.GetModeString("scheme"));
else else
NativeMethods.SetPowerScheme(PerformanceMode); NativeMethods.SetPowerScheme(Modes.GetBase(mode));
} }
if (AppConfig.getConfigPerf("auto_boost") != -1) if (AppConfig.GetMode("auto_boost") != -1)
{ {
NativeMethods.SetCPUBoost(AppConfig.getConfigPerf("auto_boost")); NativeMethods.SetCPUBoost(AppConfig.GetMode("auto_boost"));
} }
if (NativeMethods.PowerGetEffectiveOverlayScheme(out Guid activeScheme) == 0) if (NativeMethods.PowerGetEffectiveOverlayScheme(out Guid activeScheme) == 0)
@@ -1334,6 +1347,7 @@ namespace GHelper
if (fans != null && fans.Text != "") if (fans != null && fans.Text != "")
{ {
fans.InitMode();
fans.InitFans(); fans.InitFans();
fans.InitPower(); fans.InitPower();
fans.InitBoost(); fans.InitBoost();
@@ -1344,14 +1358,7 @@ namespace GHelper
public void CyclePerformanceMode() public void CyclePerformanceMode()
{ {
int mode = AppConfig.getConfig("performance_mode"); SetPerformanceMode(Modes.GetNext(Control.ModifierKeys == Keys.Shift), true);
if (Control.ModifierKeys == Keys.Shift)
mode = (mode == 0) ? 2 : mode - 1;
else
mode++;
SetPerformanceMode(mode, true);
} }
@@ -1360,7 +1367,7 @@ namespace GHelper
InputDispatcher.SetBacklightAuto(true); InputDispatcher.SetBacklightAuto(true);
if (Program.acpi.IsXGConnected()) if (Program.acpi.IsXGConnected())
AsusUSB.ApplyXGMLight(AppConfig.isConfig("xmg_light")); AsusUSB.ApplyXGMLight(AppConfig.Is("xmg_light"));
if (AppConfig.ContainsModel("X16") || AppConfig.ContainsModel("X13")) InputDispatcher.TabletMode(); if (AppConfig.ContainsModel("X16") || AppConfig.ContainsModel("X13")) InputDispatcher.TabletMode();
@@ -1370,17 +1377,17 @@ namespace GHelper
{ {
var Plugged = SystemInformation.PowerStatus.PowerLineStatus; var Plugged = SystemInformation.PowerStatus.PowerLineStatus;
int mode = AppConfig.getConfig("performance_" + (int)Plugged); int mode = AppConfig.Get("performance_" + (int)Plugged);
if (mode != -1) if (mode != -1)
SetPerformanceMode(mode, powerChanged); SetPerformanceMode(mode, powerChanged);
else else
SetPerformanceMode(AppConfig.getConfig("performance_mode")); SetPerformanceMode(Modes.GetCurrent());
} }
public void AutoScreen(bool force = false) public void AutoScreen(bool force = false)
{ {
if (force || AppConfig.getConfig("screen_auto") == 1) if (force || AppConfig.Is("screen_auto"))
{ {
if (SystemInformation.PowerStatus.PowerLineStatus == PowerLineStatus.Online) if (SystemInformation.PowerStatus.PowerLineStatus == PowerLineStatus.Online)
SetScreen(1000, 1); SetScreen(1000, 1);
@@ -1389,7 +1396,7 @@ namespace GHelper
} }
else else
{ {
SetScreen(overdrive: AppConfig.getConfig("overdrive")); SetScreen(overdrive: AppConfig.Get("overdrive"));
} }
@@ -1398,7 +1405,7 @@ namespace GHelper
public static bool IsPlugged() public static bool IsPlugged()
{ {
bool optimizedUSBC = AppConfig.getConfig("optimized_usbc") != 1; bool optimizedUSBC = AppConfig.Get("optimized_usbc") != 1;
return SystemInformation.PowerStatus.PowerLineStatus == PowerLineStatus.Online && return SystemInformation.PowerStatus.PowerLineStatus == PowerLineStatus.Online &&
(optimizedUSBC || Program.acpi.DeviceGet(AsusACPI.ChargerMode) < AsusACPI.ChargerUSB); (optimizedUSBC || Program.acpi.DeviceGet(AsusACPI.ChargerMode) < AsusACPI.ChargerUSB);
@@ -1408,10 +1415,10 @@ namespace GHelper
public bool AutoGPUMode() public bool AutoGPUMode()
{ {
bool GpuAuto = AppConfig.getConfig("gpu_auto") == 1; bool GpuAuto = AppConfig.Is("gpu_auto");
bool ForceGPU = AppConfig.ContainsModel("503"); bool ForceGPU = AppConfig.ContainsModel("503");
int GpuMode = AppConfig.getConfig("gpu_mode"); int GpuMode = AppConfig.Get("gpu_mode");
if (!GpuAuto && !ForceGPU) return false; if (!GpuAuto && !ForceGPU) return false;
@@ -1453,7 +1460,7 @@ namespace GHelper
public bool ReEnableGPU() public bool ReEnableGPU()
{ {
if (AppConfig.getConfig("gpu_reenable") != 1) return false; if (AppConfig.Get("gpu_reenable") != 1) return false;
if (Screen.AllScreens.Length <= 1) return false; if (Screen.AllScreens.Length <= 1) return false;
Logger.WriteLine("Re-enabling gpu for 503 model"); Logger.WriteLine("Re-enabling gpu for 503 model");
@@ -1481,8 +1488,10 @@ namespace GHelper
public void InitXGM() public void InitXGM()
{ {
bool connected = Program.acpi.IsXGConnected();
buttonXGM.Enabled = buttonXGM.Visible = connected;
buttonXGM.Enabled = buttonXGM.Visible = Program.acpi.IsXGConnected(); if (!connected) return;
int activated = Program.acpi.DeviceGet(AsusACPI.GPUXG); int activated = Program.acpi.DeviceGet(AsusACPI.GPUXG);
if (activated < 0) return; if (activated < 0) return;
@@ -1538,7 +1547,7 @@ namespace GHelper
} }
AppConfig.setConfig("gpu_mode", GpuMode); AppConfig.Set("gpu_mode", GpuMode);
ButtonEnabled(buttonOptimized, true); ButtonEnabled(buttonOptimized, true);
ButtonEnabled(buttonEco, true); ButtonEnabled(buttonEco, true);
@@ -1640,8 +1649,8 @@ namespace GHelper
public void SetGPUMode(int GPUMode) public void SetGPUMode(int GPUMode)
{ {
int CurrentGPU = AppConfig.getConfig("gpu_mode"); int CurrentGPU = AppConfig.Get("gpu_mode");
AppConfig.setConfig("gpu_auto", 0); AppConfig.Set("gpu_auto", 0);
if (CurrentGPU == GPUMode) if (CurrentGPU == GPUMode)
{ {
@@ -1688,7 +1697,7 @@ namespace GHelper
if (changed) if (changed)
{ {
AppConfig.setConfig("gpu_mode", GPUMode); AppConfig.Set("gpu_mode", GPUMode);
} }
if (restart) if (restart)
@@ -1704,9 +1713,9 @@ namespace GHelper
{ {
if (GPUMode == -1) if (GPUMode == -1)
GPUMode = AppConfig.getConfig("gpu_mode"); GPUMode = AppConfig.Get("gpu_mode");
bool GPUAuto = (AppConfig.getConfig("gpu_auto") == 1); bool GPUAuto = AppConfig.Is("gpu_auto");
buttonEco.Activated = false; buttonEco.Activated = false;
buttonStandard.Activated = false; buttonStandard.Activated = false;
@@ -1802,7 +1811,7 @@ namespace GHelper
Debug.WriteLine(ex); Debug.WriteLine(ex);
} }
AppConfig.setConfig("charge_limit", limit); AppConfig.Set("charge_limit", limit);
} }

View File

@@ -1,7 +1,6 @@
using System.Diagnostics; using OSD;
using System.Drawing; using System.Diagnostics;
using System.Drawing.Drawing2D; using System.Drawing.Drawing2D;
using OSD;
namespace GHelper namespace GHelper
@@ -57,7 +56,7 @@ namespace GHelper
Charger Charger
} }
public class ToastForm : OSDNativeForm public class ToastForm : OSDNativeForm
{ {
protected static string toastText = "Balanced"; protected static string toastText = "Balanced";
@@ -74,7 +73,7 @@ namespace GHelper
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));
Drawing.FillRoundedRectangle(e.Graphics, brush, this.Bound, 10); Drawing.FillRoundedRectangle(e.Graphics, brush, this.Bound, 10);
StringFormat format = new StringFormat(); StringFormat format = new StringFormat();
@@ -113,7 +112,7 @@ namespace GHelper
icon = Properties.Resources.icons8_charged_battery_96; icon = Properties.Resources.icons8_charged_battery_96;
break; break;
case ToastIcon.Charger: case ToastIcon.Charger:
icon = Properties.Resources.icons8_electrical_96; icon = Properties.Resources.icons8_charging_battery_96;
break; break;
} }
@@ -144,9 +143,9 @@ namespace GHelper
Screen screen1 = Screen.FromHandle(base.Handle); Screen screen1 = Screen.FromHandle(base.Handle);
Width = 300; Width = Math.Max(300, 100 + toastText.Length * 22);
Height = 100; Height = 100;
X = (screen1.Bounds.Width - this.Width)/2; X = (screen1.Bounds.Width - this.Width) / 2;
Y = screen1.Bounds.Height - 300 - this.Height; Y = screen1.Bounds.Height - 300 - this.Height;
Show(); Show();