mirror of
https://github.com/jkocon/g-helper.git
synced 2026-02-23 13:00:52 +01:00
Heatmap
This commit is contained in:
@@ -24,6 +24,8 @@ public static class HardwareControl
|
||||
|
||||
public static int? gpuUse;
|
||||
|
||||
static long lastUpdate;
|
||||
|
||||
public static int GetFanMax()
|
||||
{
|
||||
int max = 58;
|
||||
@@ -170,15 +172,10 @@ public static class HardwareControl
|
||||
return health;
|
||||
}
|
||||
|
||||
public static void ReadSensors()
|
||||
{
|
||||
batteryRate = 0;
|
||||
gpuTemp = -1;
|
||||
gpuUse = -1;
|
||||
public static float? GetCPUTemp() {
|
||||
|
||||
cpuFan = FormatFan(Program.acpi.DeviceGet(AsusACPI.CPU_Fan));
|
||||
gpuFan = FormatFan(Program.acpi.DeviceGet(AsusACPI.GPU_Fan));
|
||||
midFan = FormatFan(Program.acpi.DeviceGet(AsusACPI.Mid_Fan));
|
||||
if (Math.Abs(DateTimeOffset.Now.ToUnixTimeMilliseconds() - lastUpdate) < 1000) return cpuTemp;
|
||||
lastUpdate = DateTimeOffset.Now.ToUnixTimeMilliseconds();
|
||||
|
||||
cpuTemp = Program.acpi.DeviceGet(AsusACPI.Temp_CPU);
|
||||
|
||||
@@ -194,6 +191,22 @@ public static class HardwareControl
|
||||
Debug.WriteLine("Failed reading CPU temp :" + ex.Message);
|
||||
}
|
||||
|
||||
return cpuTemp;
|
||||
}
|
||||
|
||||
|
||||
public static void ReadSensors()
|
||||
{
|
||||
batteryRate = 0;
|
||||
gpuTemp = -1;
|
||||
gpuUse = -1;
|
||||
|
||||
cpuFan = FormatFan(Program.acpi.DeviceGet(AsusACPI.CPU_Fan));
|
||||
gpuFan = FormatFan(Program.acpi.DeviceGet(AsusACPI.GPU_Fan));
|
||||
midFan = FormatFan(Program.acpi.DeviceGet(AsusACPI.Mid_Fan));
|
||||
|
||||
cpuTemp = GetCPUTemp();
|
||||
|
||||
try
|
||||
{
|
||||
gpuTemp = GpuControl?.GetCurrentTemperature();
|
||||
|
||||
Reference in New Issue
Block a user