Added battery charge readings (next to discharge)

This commit is contained in:
Serge
2023-07-18 12:33:29 +02:00
parent fecf1cfece
commit 3ce473f78d
8 changed files with 103 additions and 54 deletions

View File

@@ -236,7 +236,7 @@ namespace GHelper.Display
//Fallback scenario //Fallback scenario
if (iRet != 0) if (iRet != 0)
{ {
Thread.Sleep(300); Thread.Sleep(1000);
iRet = ChangeDisplaySettingsEx(laptopScreen, ref dm, IntPtr.Zero, DisplaySettingsFlags.CDS_UPDATEREGISTRY, IntPtr.Zero); iRet = ChangeDisplaySettingsEx(laptopScreen, ref dm, IntPtr.Zero, DisplaySettingsFlags.CDS_UPDATEREGISTRY, IntPtr.Zero);
Logger.WriteLine("Screen = " + frequency.ToString() + "Hz : " + (iRet == 0 ? "OK" : iRet)); Logger.WriteLine("Screen = " + frequency.ToString() + "Hz : " + (iRet == 0 ? "OK" : iRet));
} }

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.98</AssemblyVersion> <AssemblyVersion>0.99</AssemblyVersion>
</PropertyGroup> </PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|AnyCPU'"> <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|AnyCPU'">

View File

@@ -5,13 +5,14 @@ using GHelper.Gpu.AMD;
using GHelper.Helpers; using GHelper.Helpers;
using System.Diagnostics; using System.Diagnostics;
using System.Management;
public static class HardwareControl public static class HardwareControl
{ {
public static IGpuControl? GpuControl; public static IGpuControl? GpuControl;
public static float? cpuTemp = -1; public static float? cpuTemp = -1;
public static float? batteryDischarge = -1; public static decimal? batteryRate = 0;
public static int? gpuTemp = null; public static int? gpuTemp = null;
public static string? cpuFan; public static string? cpuFan;
@@ -70,9 +71,39 @@ public static class HardwareControl
} }
public static decimal GetBatteryRate()
{
try
{
ManagementScope scope = new ManagementScope("root\\WMI");
ObjectQuery query = new ObjectQuery("SELECT * FROM BatteryStatus");
using ManagementObjectSearcher searcher = new ManagementObjectSearcher(scope, query);
foreach (ManagementObject obj in searcher.Get().Cast<ManagementObject>())
{
decimal chargeRate = Convert.ToDecimal(obj["ChargeRate"]);
decimal dischargeRate = Convert.ToDecimal(obj["DischargeRate"]);
if (chargeRate > 0)
return chargeRate;
else
return -dischargeRate;
}
return 0;
}
catch (Exception ex)
{
Logger.WriteLine("Discharge Reading: " + ex.Message);
return 0;
}
}
public static void ReadSensors() public static void ReadSensors()
{ {
batteryDischarge = -1; batteryRate = 0;
gpuTemp = -1; gpuTemp = -1;
gpuUse = -1; gpuUse = -1;
@@ -108,17 +139,8 @@ public static class HardwareControl
if (gpuTemp is null || gpuTemp < 0) if (gpuTemp is null || gpuTemp < 0)
gpuTemp = Program.acpi.DeviceGet(AsusACPI.Temp_GPU); gpuTemp = Program.acpi.DeviceGet(AsusACPI.Temp_GPU);
try batteryRate = GetBatteryRate() / 1000;
{
using (var cb = new PerformanceCounter("Power Meter", "Power", "Power Meter (0)", true))
{
batteryDischarge = cb.NextValue() / 1000;
}
}
catch
{
Debug.WriteLine("Failed reading Battery discharge");
}
} }
public static bool IsUsedGPU(int threshold = 10) public static bool IsUsedGPU(int threshold = 10)

View File

@@ -375,6 +375,15 @@ namespace GHelper.Properties {
} }
} }
/// <summary>
/// Looks up a localized string similar to Charging.
/// </summary>
internal static string Charging {
get {
return ResourceManager.GetString("Charging", resourceCulture);
}
}
/// <summary> /// <summary>
/// Looks up a localized string similar to Color. /// Looks up a localized string similar to Color.
/// </summary> /// </summary>

View File

@@ -222,6 +222,9 @@
<data name="BrightnessUp" xml:space="preserve"> <data name="BrightnessUp" xml:space="preserve">
<value>Brightness Up</value> <value>Brightness Up</value>
</data> </data>
<data name="Charging" xml:space="preserve">
<value>Charging</value>
</data>
<data name="Color" xml:space="preserve"> <data name="Color" xml:space="preserve">
<value>Color</value> <value>Color</value>
</data> </data>

View File

@@ -140,7 +140,7 @@ namespace GHelper
panelMatrix.Name = "panelMatrix"; panelMatrix.Name = "panelMatrix";
panelMatrix.Padding = new Padding(20, 20, 20, 10); panelMatrix.Padding = new Padding(20, 20, 20, 10);
panelMatrix.Size = new Size(810, 171); panelMatrix.Size = new Size(810, 171);
panelMatrix.TabIndex = 33; panelMatrix.TabIndex = 4;
// //
// tableLayoutMatrix // tableLayoutMatrix
// //
@@ -176,8 +176,7 @@ namespace GHelper
comboMatrix.Margin = new Padding(4, 10, 4, 8); comboMatrix.Margin = new Padding(4, 10, 4, 8);
comboMatrix.Name = "comboMatrix"; comboMatrix.Name = "comboMatrix";
comboMatrix.Size = new Size(248, 40); comboMatrix.Size = new Size(248, 40);
comboMatrix.TabIndex = 41; comboMatrix.TabIndex = 16;
comboMatrix.TabStop = false;
// //
// comboMatrixRunning // comboMatrixRunning
// //
@@ -192,8 +191,7 @@ namespace GHelper
comboMatrixRunning.Margin = new Padding(4, 10, 4, 8); comboMatrixRunning.Margin = new Padding(4, 10, 4, 8);
comboMatrixRunning.Name = "comboMatrixRunning"; comboMatrixRunning.Name = "comboMatrixRunning";
comboMatrixRunning.Size = new Size(248, 40); comboMatrixRunning.Size = new Size(248, 40);
comboMatrixRunning.TabIndex = 42; comboMatrixRunning.TabIndex = 17;
comboMatrixRunning.TabStop = false;
// //
// buttonMatrix // buttonMatrix
// //
@@ -209,7 +207,7 @@ namespace GHelper
buttonMatrix.Name = "buttonMatrix"; buttonMatrix.Name = "buttonMatrix";
buttonMatrix.Secondary = true; buttonMatrix.Secondary = true;
buttonMatrix.Size = new Size(250, 45); buttonMatrix.Size = new Size(250, 45);
buttonMatrix.TabIndex = 43; buttonMatrix.TabIndex = 18;
buttonMatrix.Text = Properties.Strings.PictureGif; buttonMatrix.Text = Properties.Strings.PictureGif;
buttonMatrix.UseVisualStyleBackColor = false; buttonMatrix.UseVisualStyleBackColor = false;
// //
@@ -253,7 +251,7 @@ namespace GHelper
checkMatrix.Margin = new Padding(8, 4, 8, 4); checkMatrix.Margin = new Padding(8, 4, 8, 4);
checkMatrix.Name = "checkMatrix"; checkMatrix.Name = "checkMatrix";
checkMatrix.Size = new Size(249, 36); checkMatrix.Size = new Size(249, 36);
checkMatrix.TabIndex = 44; checkMatrix.TabIndex = 19;
checkMatrix.Text = Properties.Strings.TurnOffOnBattery; checkMatrix.Text = Properties.Strings.TurnOffOnBattery;
checkMatrix.UseVisualStyleBackColor = true; checkMatrix.UseVisualStyleBackColor = true;
// //
@@ -269,10 +267,11 @@ namespace GHelper
panelBattery.Name = "panelBattery"; panelBattery.Name = "panelBattery";
panelBattery.Padding = new Padding(20); panelBattery.Padding = new Padding(20);
panelBattery.Size = new Size(810, 125); panelBattery.Size = new Size(810, 125);
panelBattery.TabIndex = 34; panelBattery.TabIndex = 5;
// //
// sliderBattery // sliderBattery
// //
sliderBattery.AccessibleName = "Battery Charge Limit";
sliderBattery.Dock = DockStyle.Top; sliderBattery.Dock = DockStyle.Top;
sliderBattery.Location = new Point(20, 65); sliderBattery.Location = new Point(20, 65);
sliderBattery.Max = 100; sliderBattery.Max = 100;
@@ -280,7 +279,8 @@ namespace GHelper
sliderBattery.Name = "sliderBattery"; sliderBattery.Name = "sliderBattery";
sliderBattery.Size = new Size(770, 40); sliderBattery.Size = new Size(770, 40);
sliderBattery.Step = 5; sliderBattery.Step = 5;
sliderBattery.TabIndex = 39; sliderBattery.TabIndex = 20;
sliderBattery.TabStop = false;
sliderBattery.Text = "sliderBattery"; sliderBattery.Text = "sliderBattery";
sliderBattery.Value = 80; sliderBattery.Value = 80;
// //
@@ -341,10 +341,11 @@ namespace GHelper
panelFooter.Name = "panelFooter"; panelFooter.Name = "panelFooter";
panelFooter.Padding = new Padding(20); panelFooter.Padding = new Padding(20);
panelFooter.Size = new Size(810, 92); panelFooter.Size = new Size(810, 92);
panelFooter.TabIndex = 35; panelFooter.TabIndex = 7;
// //
// buttonUpdates // buttonUpdates
// //
buttonUpdates.AccessibleName = "BIOS and Driver Updates";
buttonUpdates.Activated = false; buttonUpdates.Activated = false;
buttonUpdates.Anchor = AnchorStyles.Top | AnchorStyles.Right; buttonUpdates.Anchor = AnchorStyles.Top | AnchorStyles.Right;
buttonUpdates.BackColor = SystemColors.ControlLight; buttonUpdates.BackColor = SystemColors.ControlLight;
@@ -356,12 +357,13 @@ namespace GHelper
buttonUpdates.Name = "buttonUpdates"; buttonUpdates.Name = "buttonUpdates";
buttonUpdates.Secondary = true; buttonUpdates.Secondary = true;
buttonUpdates.Size = new Size(180, 44); buttonUpdates.Size = new Size(180, 44);
buttonUpdates.TabIndex = 19; buttonUpdates.TabIndex = 22;
buttonUpdates.Text = "Updates"; buttonUpdates.Text = "Updates";
buttonUpdates.UseVisualStyleBackColor = false; buttonUpdates.UseVisualStyleBackColor = false;
// //
// buttonQuit // buttonQuit
// //
buttonQuit.AccessibleName = "Quit Application";
buttonQuit.Activated = false; buttonQuit.Activated = false;
buttonQuit.Anchor = AnchorStyles.Top | AnchorStyles.Right; buttonQuit.Anchor = AnchorStyles.Top | AnchorStyles.Right;
buttonQuit.BackColor = SystemColors.ControlLight; buttonQuit.BackColor = SystemColors.ControlLight;
@@ -373,7 +375,7 @@ namespace GHelper
buttonQuit.Name = "buttonQuit"; buttonQuit.Name = "buttonQuit";
buttonQuit.Secondary = true; buttonQuit.Secondary = true;
buttonQuit.Size = new Size(180, 44); buttonQuit.Size = new Size(180, 44);
buttonQuit.TabIndex = 18; buttonQuit.TabIndex = 23;
buttonQuit.Text = Properties.Strings.Quit; buttonQuit.Text = Properties.Strings.Quit;
buttonQuit.UseVisualStyleBackColor = false; buttonQuit.UseVisualStyleBackColor = false;
// //
@@ -384,7 +386,7 @@ namespace GHelper
checkStartup.Margin = new Padding(8, 4, 8, 4); checkStartup.Margin = new Padding(8, 4, 8, 4);
checkStartup.Name = "checkStartup"; checkStartup.Name = "checkStartup";
checkStartup.Size = new Size(206, 36); checkStartup.Size = new Size(206, 36);
checkStartup.TabIndex = 17; checkStartup.TabIndex = 21;
checkStartup.Text = Properties.Strings.RunOnStartup; checkStartup.Text = Properties.Strings.RunOnStartup;
checkStartup.UseVisualStyleBackColor = true; checkStartup.UseVisualStyleBackColor = true;
// //
@@ -400,7 +402,7 @@ namespace GHelper
panelPerformance.Name = "panelPerformance"; panelPerformance.Name = "panelPerformance";
panelPerformance.Padding = new Padding(20); panelPerformance.Padding = new Padding(20);
panelPerformance.Size = new Size(810, 207); panelPerformance.Size = new Size(810, 207);
panelPerformance.TabIndex = 36; panelPerformance.TabIndex = 0;
// //
// tablePerf // tablePerf
// //
@@ -426,12 +428,12 @@ namespace GHelper
// //
// buttonSilent // buttonSilent
// //
buttonSilent.AccessibleName = "Silent Mode";
buttonSilent.Activated = false; buttonSilent.Activated = false;
buttonSilent.BackColor = SystemColors.ControlLightLight; buttonSilent.BackColor = SystemColors.ControlLightLight;
buttonSilent.BackgroundImageLayout = ImageLayout.None; buttonSilent.BackgroundImageLayout = ImageLayout.None;
buttonSilent.BorderColor = Color.Transparent; buttonSilent.BorderColor = Color.Transparent;
buttonSilent.BorderRadius = 5; buttonSilent.BorderRadius = 5;
buttonSilent.CausesValidation = false;
buttonSilent.Dock = DockStyle.Fill; buttonSilent.Dock = DockStyle.Fill;
buttonSilent.FlatAppearance.BorderSize = 0; buttonSilent.FlatAppearance.BorderSize = 0;
buttonSilent.FlatStyle = FlatStyle.Flat; buttonSilent.FlatStyle = FlatStyle.Flat;
@@ -443,13 +445,14 @@ namespace GHelper
buttonSilent.Name = "buttonSilent"; buttonSilent.Name = "buttonSilent";
buttonSilent.Secondary = false; buttonSilent.Secondary = false;
buttonSilent.Size = new Size(184, 120); buttonSilent.Size = new Size(184, 120);
buttonSilent.TabIndex = 0; buttonSilent.TabIndex = 1;
buttonSilent.Text = Properties.Strings.Silent; buttonSilent.Text = Properties.Strings.Silent;
buttonSilent.TextImageRelation = TextImageRelation.ImageAboveText; buttonSilent.TextImageRelation = TextImageRelation.ImageAboveText;
buttonSilent.UseVisualStyleBackColor = false; buttonSilent.UseVisualStyleBackColor = false;
// //
// buttonBalanced // buttonBalanced
// //
buttonBalanced.AccessibleName = "Balanced Mode";
buttonBalanced.Activated = false; buttonBalanced.Activated = false;
buttonBalanced.BackColor = SystemColors.ControlLightLight; buttonBalanced.BackColor = SystemColors.ControlLightLight;
buttonBalanced.BorderColor = Color.Transparent; buttonBalanced.BorderColor = Color.Transparent;
@@ -472,6 +475,7 @@ namespace GHelper
// //
// buttonTurbo // buttonTurbo
// //
buttonTurbo.AccessibleName = "Turbo Mode";
buttonTurbo.Activated = false; buttonTurbo.Activated = false;
buttonTurbo.BackColor = SystemColors.ControlLightLight; buttonTurbo.BackColor = SystemColors.ControlLightLight;
buttonTurbo.BorderColor = Color.Transparent; buttonTurbo.BorderColor = Color.Transparent;
@@ -494,6 +498,7 @@ namespace GHelper
// //
// buttonFans // buttonFans
// //
buttonFans.AccessibleName = "Fans and Power Settings";
buttonFans.Activated = false; buttonFans.Activated = false;
buttonFans.BackColor = SystemColors.ControlLight; buttonFans.BackColor = SystemColors.ControlLight;
buttonFans.BorderColor = Color.Transparent; buttonFans.BorderColor = Color.Transparent;
@@ -508,7 +513,7 @@ namespace GHelper
buttonFans.Name = "buttonFans"; buttonFans.Name = "buttonFans";
buttonFans.Secondary = true; buttonFans.Secondary = true;
buttonFans.Size = new Size(186, 120); buttonFans.Size = new Size(186, 120);
buttonFans.TabIndex = 35; buttonFans.TabIndex = 3;
buttonFans.Text = Properties.Strings.FansPower; buttonFans.Text = Properties.Strings.FansPower;
buttonFans.TextImageRelation = TextImageRelation.ImageAboveText; buttonFans.TextImageRelation = TextImageRelation.ImageAboveText;
buttonFans.UseVisualStyleBackColor = false; buttonFans.UseVisualStyleBackColor = false;
@@ -544,7 +549,7 @@ namespace GHelper
labelPerf.Margin = new Padding(8, 0, 8, 0); labelPerf.Margin = new Padding(8, 0, 8, 0);
labelPerf.Name = "labelPerf"; labelPerf.Name = "labelPerf";
labelPerf.Size = new Size(234, 32); labelPerf.Size = new Size(234, 32);
labelPerf.TabIndex = 34; labelPerf.TabIndex = 0;
labelPerf.Text = "Performance Mode"; labelPerf.Text = "Performance Mode";
// //
// labelCPUFan // labelCPUFan
@@ -572,7 +577,7 @@ namespace GHelper
panelGPU.Name = "panelGPU"; panelGPU.Name = "panelGPU";
panelGPU.Padding = new Padding(20, 20, 20, 0); panelGPU.Padding = new Padding(20, 20, 20, 0);
panelGPU.Size = new Size(810, 351); panelGPU.Size = new Size(810, 351);
panelGPU.TabIndex = 37; panelGPU.TabIndex = 1;
// //
// labelTipGPU // labelTipGPU
// //
@@ -635,6 +640,7 @@ namespace GHelper
// //
// buttonEco // buttonEco
// //
buttonEco.AccessibleName = "Eco GPU Mode";
buttonEco.Activated = false; buttonEco.Activated = false;
buttonEco.BackColor = SystemColors.ControlLightLight; buttonEco.BackColor = SystemColors.ControlLightLight;
buttonEco.BorderColor = Color.Transparent; buttonEco.BorderColor = Color.Transparent;
@@ -651,13 +657,14 @@ namespace GHelper
buttonEco.Name = "buttonEco"; buttonEco.Name = "buttonEco";
buttonEco.Secondary = false; buttonEco.Secondary = false;
buttonEco.Size = new Size(184, 120); buttonEco.Size = new Size(184, 120);
buttonEco.TabIndex = 0; buttonEco.TabIndex = 4;
buttonEco.Text = Properties.Strings.EcoMode; buttonEco.Text = Properties.Strings.EcoMode;
buttonEco.TextImageRelation = TextImageRelation.ImageAboveText; buttonEco.TextImageRelation = TextImageRelation.ImageAboveText;
buttonEco.UseVisualStyleBackColor = false; buttonEco.UseVisualStyleBackColor = false;
// //
// buttonStandard // buttonStandard
// //
buttonStandard.AccessibleName = "Standard GPU Mode";
buttonStandard.Activated = false; buttonStandard.Activated = false;
buttonStandard.BackColor = SystemColors.ControlLightLight; buttonStandard.BackColor = SystemColors.ControlLightLight;
buttonStandard.BorderColor = Color.Transparent; buttonStandard.BorderColor = Color.Transparent;
@@ -673,7 +680,7 @@ namespace GHelper
buttonStandard.Name = "buttonStandard"; buttonStandard.Name = "buttonStandard";
buttonStandard.Secondary = false; buttonStandard.Secondary = false;
buttonStandard.Size = new Size(184, 120); buttonStandard.Size = new Size(184, 120);
buttonStandard.TabIndex = 1; buttonStandard.TabIndex = 5;
buttonStandard.Text = Properties.Strings.StandardMode; buttonStandard.Text = Properties.Strings.StandardMode;
buttonStandard.TextImageRelation = TextImageRelation.ImageAboveText; buttonStandard.TextImageRelation = TextImageRelation.ImageAboveText;
buttonStandard.UseVisualStyleBackColor = false; buttonStandard.UseVisualStyleBackColor = false;
@@ -695,7 +702,7 @@ namespace GHelper
buttonXGM.Name = "buttonXGM"; buttonXGM.Name = "buttonXGM";
buttonXGM.Secondary = false; buttonXGM.Secondary = false;
buttonXGM.Size = new Size(184, 120); buttonXGM.Size = new Size(184, 120);
buttonXGM.TabIndex = 2; buttonXGM.TabIndex = 8;
buttonXGM.Text = "XG Mobile"; buttonXGM.Text = "XG Mobile";
buttonXGM.TextImageRelation = TextImageRelation.ImageAboveText; buttonXGM.TextImageRelation = TextImageRelation.ImageAboveText;
buttonXGM.UseVisualStyleBackColor = false; buttonXGM.UseVisualStyleBackColor = false;
@@ -718,13 +725,14 @@ namespace GHelper
buttonOptimized.Name = "buttonOptimized"; buttonOptimized.Name = "buttonOptimized";
buttonOptimized.Secondary = false; buttonOptimized.Secondary = false;
buttonOptimized.Size = new Size(184, 120); buttonOptimized.Size = new Size(184, 120);
buttonOptimized.TabIndex = 3; buttonOptimized.TabIndex = 7;
buttonOptimized.Text = Properties.Strings.Optimized; buttonOptimized.Text = Properties.Strings.Optimized;
buttonOptimized.TextImageRelation = TextImageRelation.ImageAboveText; buttonOptimized.TextImageRelation = TextImageRelation.ImageAboveText;
buttonOptimized.UseVisualStyleBackColor = false; buttonOptimized.UseVisualStyleBackColor = false;
// //
// buttonUltimate // buttonUltimate
// //
buttonUltimate.AccessibleName = "Ultimate GPU Mode";
buttonUltimate.Activated = false; buttonUltimate.Activated = false;
buttonUltimate.BackColor = SystemColors.ControlLightLight; buttonUltimate.BackColor = SystemColors.ControlLightLight;
buttonUltimate.BorderColor = Color.Transparent; buttonUltimate.BorderColor = Color.Transparent;
@@ -740,7 +748,7 @@ namespace GHelper
buttonUltimate.Name = "buttonUltimate"; buttonUltimate.Name = "buttonUltimate";
buttonUltimate.Secondary = false; buttonUltimate.Secondary = false;
buttonUltimate.Size = new Size(186, 120); buttonUltimate.Size = new Size(186, 120);
buttonUltimate.TabIndex = 2; buttonUltimate.TabIndex = 6;
buttonUltimate.Text = Properties.Strings.UltimateMode; buttonUltimate.Text = Properties.Strings.UltimateMode;
buttonUltimate.TextImageRelation = TextImageRelation.ImageAboveText; buttonUltimate.TextImageRelation = TextImageRelation.ImageAboveText;
buttonUltimate.UseVisualStyleBackColor = false; buttonUltimate.UseVisualStyleBackColor = false;
@@ -802,7 +810,7 @@ namespace GHelper
panelScreen.Name = "panelScreen"; panelScreen.Name = "panelScreen";
panelScreen.Padding = new Padding(20, 20, 20, 10); panelScreen.Padding = new Padding(20, 20, 20, 10);
panelScreen.Size = new Size(810, 185); panelScreen.Size = new Size(810, 185);
panelScreen.TabIndex = 38; panelScreen.TabIndex = 2;
// //
// labelTipScreen // labelTipScreen
// //
@@ -838,6 +846,7 @@ namespace GHelper
// //
// buttonScreenAuto // buttonScreenAuto
// //
buttonScreenAuto.AccessibleName = "Auto Screen Refresh Rate";
buttonScreenAuto.Activated = false; buttonScreenAuto.Activated = false;
buttonScreenAuto.BackColor = SystemColors.ControlLightLight; buttonScreenAuto.BackColor = SystemColors.ControlLightLight;
buttonScreenAuto.BorderColor = Color.Transparent; buttonScreenAuto.BorderColor = Color.Transparent;
@@ -851,12 +860,13 @@ namespace GHelper
buttonScreenAuto.Name = "buttonScreenAuto"; buttonScreenAuto.Name = "buttonScreenAuto";
buttonScreenAuto.Secondary = false; buttonScreenAuto.Secondary = false;
buttonScreenAuto.Size = new Size(184, 72); buttonScreenAuto.Size = new Size(184, 72);
buttonScreenAuto.TabIndex = 0; buttonScreenAuto.TabIndex = 9;
buttonScreenAuto.Text = Properties.Strings.AutoMode; buttonScreenAuto.Text = Properties.Strings.AutoMode;
buttonScreenAuto.UseVisualStyleBackColor = false; buttonScreenAuto.UseVisualStyleBackColor = false;
// //
// button60Hz // button60Hz
// //
button60Hz.AccessibleName = "60Hz Refresh Rate";
button60Hz.Activated = false; button60Hz.Activated = false;
button60Hz.BackColor = SystemColors.ControlLightLight; button60Hz.BackColor = SystemColors.ControlLightLight;
button60Hz.BorderColor = Color.Transparent; button60Hz.BorderColor = Color.Transparent;
@@ -871,12 +881,13 @@ namespace GHelper
button60Hz.Name = "button60Hz"; button60Hz.Name = "button60Hz";
button60Hz.Secondary = false; button60Hz.Secondary = false;
button60Hz.Size = new Size(184, 72); button60Hz.Size = new Size(184, 72);
button60Hz.TabIndex = 1; button60Hz.TabIndex = 10;
button60Hz.Text = "60Hz"; button60Hz.Text = "60Hz";
button60Hz.UseVisualStyleBackColor = false; button60Hz.UseVisualStyleBackColor = false;
// //
// button120Hz // button120Hz
// //
button120Hz.AccessibleName = "Maximum Refresh Rate";
button120Hz.Activated = false; button120Hz.Activated = false;
button120Hz.BackColor = SystemColors.ControlLightLight; button120Hz.BackColor = SystemColors.ControlLightLight;
button120Hz.BorderColor = Color.Transparent; button120Hz.BorderColor = Color.Transparent;
@@ -890,7 +901,7 @@ namespace GHelper
button120Hz.Name = "button120Hz"; button120Hz.Name = "button120Hz";
button120Hz.Secondary = false; button120Hz.Secondary = false;
button120Hz.Size = new Size(184, 72); button120Hz.Size = new Size(184, 72);
button120Hz.TabIndex = 2; button120Hz.TabIndex = 11;
button120Hz.Text = "120Hz + OD"; button120Hz.Text = "120Hz + OD";
button120Hz.UseVisualStyleBackColor = false; button120Hz.UseVisualStyleBackColor = false;
// //
@@ -910,7 +921,7 @@ namespace GHelper
buttonMiniled.Name = "buttonMiniled"; buttonMiniled.Name = "buttonMiniled";
buttonMiniled.Secondary = false; buttonMiniled.Secondary = false;
buttonMiniled.Size = new Size(186, 72); buttonMiniled.Size = new Size(186, 72);
buttonMiniled.TabIndex = 3; buttonMiniled.TabIndex = 12;
buttonMiniled.Text = Properties.Strings.Multizone; buttonMiniled.Text = Properties.Strings.Multizone;
buttonMiniled.UseVisualStyleBackColor = false; buttonMiniled.UseVisualStyleBackColor = false;
// //
@@ -970,7 +981,7 @@ namespace GHelper
panelKeyboard.Name = "panelKeyboard"; panelKeyboard.Name = "panelKeyboard";
panelKeyboard.Padding = new Padding(20); panelKeyboard.Padding = new Padding(20);
panelKeyboard.Size = new Size(810, 138); panelKeyboard.Size = new Size(810, 138);
panelKeyboard.TabIndex = 39; panelKeyboard.TabIndex = 3;
// //
// tableLayoutKeyboard // tableLayoutKeyboard
// //
@@ -994,6 +1005,7 @@ namespace GHelper
// //
// buttonKeyboard // buttonKeyboard
// //
buttonKeyboard.AccessibleName = "Extra Settings";
buttonKeyboard.Activated = false; buttonKeyboard.Activated = false;
buttonKeyboard.BackColor = SystemColors.ControlLight; buttonKeyboard.BackColor = SystemColors.ControlLight;
buttonKeyboard.BorderColor = Color.Transparent; buttonKeyboard.BorderColor = Color.Transparent;
@@ -1008,7 +1020,7 @@ namespace GHelper
buttonKeyboard.Name = "buttonKeyboard"; buttonKeyboard.Name = "buttonKeyboard";
buttonKeyboard.Secondary = true; buttonKeyboard.Secondary = true;
buttonKeyboard.Size = new Size(250, 45); buttonKeyboard.Size = new Size(250, 45);
buttonKeyboard.TabIndex = 37; buttonKeyboard.TabIndex = 15;
buttonKeyboard.Text = Properties.Strings.Extra; buttonKeyboard.Text = Properties.Strings.Extra;
buttonKeyboard.TextImageRelation = TextImageRelation.ImageBeforeText; buttonKeyboard.TextImageRelation = TextImageRelation.ImageBeforeText;
buttonKeyboard.UseVisualStyleBackColor = false; buttonKeyboard.UseVisualStyleBackColor = false;
@@ -1048,6 +1060,7 @@ namespace GHelper
// //
// buttonKeyboardColor // buttonKeyboardColor
// //
buttonKeyboardColor.AccessibleName = "Keyboard Color";
buttonKeyboardColor.Activated = false; buttonKeyboardColor.Activated = false;
buttonKeyboardColor.BackColor = SystemColors.ButtonHighlight; buttonKeyboardColor.BackColor = SystemColors.ButtonHighlight;
buttonKeyboardColor.BorderColor = Color.Transparent; buttonKeyboardColor.BorderColor = Color.Transparent;
@@ -1060,12 +1073,13 @@ namespace GHelper
buttonKeyboardColor.Name = "buttonKeyboardColor"; buttonKeyboardColor.Name = "buttonKeyboardColor";
buttonKeyboardColor.Secondary = false; buttonKeyboardColor.Secondary = false;
buttonKeyboardColor.Size = new Size(248, 45); buttonKeyboardColor.Size = new Size(248, 45);
buttonKeyboardColor.TabIndex = 39; buttonKeyboardColor.TabIndex = 14;
buttonKeyboardColor.Text = Properties.Strings.Color; buttonKeyboardColor.Text = Properties.Strings.Color;
buttonKeyboardColor.UseVisualStyleBackColor = false; buttonKeyboardColor.UseVisualStyleBackColor = false;
// //
// comboKeyboard // comboKeyboard
// //
comboKeyboard.AccessibleName = "Keyboard Backlight Mode";
comboKeyboard.BorderColor = Color.White; comboKeyboard.BorderColor = Color.White;
comboKeyboard.ButtonColor = Color.FromArgb(255, 255, 255); comboKeyboard.ButtonColor = Color.FromArgb(255, 255, 255);
comboKeyboard.Dock = DockStyle.Top; comboKeyboard.Dock = DockStyle.Top;
@@ -1078,8 +1092,7 @@ namespace GHelper
comboKeyboard.Margin = new Padding(4, 10, 4, 8); comboKeyboard.Margin = new Padding(4, 10, 4, 8);
comboKeyboard.Name = "comboKeyboard"; comboKeyboard.Name = "comboKeyboard";
comboKeyboard.Size = new Size(248, 40); comboKeyboard.Size = new Size(248, 40);
comboKeyboard.TabIndex = 35; comboKeyboard.TabIndex = 13;
comboKeyboard.TabStop = false;
// //
// panelKeyboardTitle // panelKeyboardTitle
// //
@@ -1145,7 +1158,7 @@ namespace GHelper
panelVersion.Location = new Point(10, 1187); panelVersion.Location = new Point(10, 1187);
panelVersion.Name = "panelVersion"; panelVersion.Name = "panelVersion";
panelVersion.Size = new Size(810, 57); panelVersion.Size = new Size(810, 57);
panelVersion.TabIndex = 41; panelVersion.TabIndex = 6;
// //
// SettingsForm // SettingsForm
// //
@@ -1153,7 +1166,7 @@ namespace GHelper
AutoScaleMode = AutoScaleMode.Dpi; AutoScaleMode = AutoScaleMode.Dpi;
AutoSize = true; AutoSize = true;
AutoSizeMode = AutoSizeMode.GrowAndShrink; AutoSizeMode = AutoSizeMode.GrowAndShrink;
ClientSize = new Size(830, 1213); ClientSize = new Size(830, 1373);
Controls.Add(panelFooter); Controls.Add(panelFooter);
Controls.Add(panelVersion); Controls.Add(panelVersion);
Controls.Add(panelBattery); Controls.Add(panelBattery);

View File

@@ -774,8 +774,10 @@ namespace GHelper
if (HardwareControl.cpuTemp > 0) if (HardwareControl.cpuTemp > 0)
cpuTemp = ": " + Math.Round((decimal)HardwareControl.cpuTemp).ToString() + "°C"; cpuTemp = ": " + Math.Round((decimal)HardwareControl.cpuTemp).ToString() + "°C";
if (HardwareControl.batteryDischarge > 0) if (HardwareControl.batteryRate < 0)
battery = Properties.Strings.Discharging + ": " + Math.Round((decimal)HardwareControl.batteryDischarge, 1).ToString() + "W"; battery = Properties.Strings.Discharging + ": " + Math.Round(-(decimal)HardwareControl.batteryRate, 1).ToString() + "W";
else if (HardwareControl.batteryRate > 0)
battery = Properties.Strings.Charging + ": " + Math.Round((decimal)HardwareControl.batteryRate, 1).ToString() + "W";
if (HardwareControl.gpuTemp > 0) if (HardwareControl.gpuTemp > 0)
{ {

View File

@@ -18,7 +18,7 @@
<resheader name="reader">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader> <resheader name="reader">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader>
<resheader name="writer">System.Resources.ResXResourceWriter, 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="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="Color1" type="System.Drawing.Color, System.Drawing">Blue</data>
<data name="Bitmap1" mimetype="application/x-microsoft.net.object.binary.base64"> <data name="Bitmap1" mimetype="application/x-microsoft.net.object.binary.base64">
<value>[base64 mime encoded serialized .NET Framework object]</value> <value>[base64 mime encoded serialized .NET Framework object]</value>
</data> </data>