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)
{
/*
if (e.CloseReason == CloseReason.UserClosing)
{
e.Cancel = true;
Hide();
}
}*/
}

View File

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

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)
{
fans.Hide();
fans.Close();
}
else
{
@@ -917,7 +917,7 @@ namespace GHelper
if (cpuResult != 1 || gpuResult != 1)
{
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");
}
else customFans = true;