It's fine

This commit is contained in:
seerge
2023-04-15 20:12:33 +02:00
parent 25f0af1103
commit 8154883d49
6 changed files with 14 additions and 17 deletions

View File

@@ -207,11 +207,13 @@ namespace GHelper
private void Fans_FormClosing(object? sender, FormClosingEventArgs e) private void Fans_FormClosing(object? sender, FormClosingEventArgs e)
{ {
/*
if (e.CloseReason == CloseReason.UserClosing) if (e.CloseReason == CloseReason.UserClosing)
{ {
e.Cancel = true; e.Cancel = true;
Hide(); Hide();
} }*/
} }

View File

@@ -15,7 +15,6 @@ public static class HardwareMonitor
public static string? gpuFan; public static string? gpuFan;
public static string? midFan; public static string? midFan;
//public static List<int> gpuUsage = new List<int>();
public static int? gpuUse; public static int? gpuUse;
public static int GetFanMax() public static int GetFanMax()
@@ -78,9 +77,10 @@ public static class HardwareMonitor
if (cpuTemp < 0) try if (cpuTemp < 0) try
{ {
var ct = new PerformanceCounter("Thermal Zone Information", "Temperature", @"\_TZ.THRM", true); using (var ct = new PerformanceCounter("Thermal Zone Information", "Temperature", @"\_TZ.THRM", true))
cpuTemp = ct.NextValue() - 273; {
ct.Dispose(); cpuTemp = ct.NextValue() - 273;
}
} }
catch catch
{ {
@@ -102,17 +102,12 @@ public static class HardwareMonitor
if (gpuTemp is null || gpuTemp < 0) if (gpuTemp is null || gpuTemp < 0)
gpuTemp = Program.wmi.DeviceGet(ASUSWmi.Temp_GPU); gpuTemp = Program.wmi.DeviceGet(ASUSWmi.Temp_GPU);
/*
gpuUsage.Add(GetGpuUse());
if (gpuUsage.Count > 3) gpuUsage.RemoveAt(0);
*/
try try
{ {
var cb = new PerformanceCounter("Power Meter", "Power", "Power Meter (0)", true); using (var cb = new PerformanceCounter("Power Meter", "Power", "Power Meter (0)", true))
batteryDischarge = cb.NextValue() / 1000; {
cb.Dispose(); batteryDischarge = cb.NextValue() / 1000;
}
} }
catch catch
{ {

View File

@@ -206,7 +206,7 @@
<value>..\Resources\icons8-speed-48.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value> <value>..\Resources\icons8-speed-48.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
</data> </data>
<data name="everything-is-fine-itsfine" type="System.Resources.ResXFileRef, System.Windows.Forms"> <data name="everything-is-fine-itsfine" type="System.Resources.ResXFileRef, System.Windows.Forms">
<value>..\Resources\everything-is-fine-itsfine.gif;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value> <value>..\Resources\itsfine.jpg;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
</data> </data>
<data name="icons8-help-64" type="System.Resources.ResXFileRef, System.Windows.Forms"> <data name="icons8-help-64" type="System.Resources.ResXFileRef, System.Windows.Forms">
<value>..\Resources\icons8-help-64.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value> <value>..\Resources\icons8-help-64.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>

Binary file not shown.

Before

Width:  |  Height:  |  Size: 220 KiB

BIN
app/Resources/itsfine.jpg Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 18 KiB

View File

@@ -560,7 +560,7 @@ namespace GHelper
if (fans.Visible) if (fans.Visible)
{ {
fans.Hide(); fans.Close();
} }
else else
{ {
@@ -917,7 +917,7 @@ namespace GHelper
if (cpuResult != 1 || gpuResult != 1) if (cpuResult != 1 || gpuResult != 1)
{ {
int mode = Program.config.getConfig("performance_mode"); int mode = Program.config.getConfig("performance_mode");
Logger.WriteLine("Driver rejected fan curve, resetting mode to " + mode); Logger.WriteLine("ASUS BIOS rejected fan curve, resetting mode to " + mode);
Program.wmi.DeviceSet(ASUSWmi.PerformanceMode, mode, "PerformanceMode"); Program.wmi.DeviceSet(ASUSWmi.PerformanceMode, mode, "PerformanceMode");
} }
else customFans = true; else customFans = true;