diff --git a/Project-Aurora/Project-Aurora/LibreHardwareMonitorLib.dll b/Project-Aurora/Project-Aurora/LibreHardwareMonitorLib.dll
index 21df27a6d..617259a12 100644
Binary files a/Project-Aurora/Project-Aurora/LibreHardwareMonitorLib.dll and b/Project-Aurora/Project-Aurora/LibreHardwareMonitorLib.dll differ
diff --git a/Project-Aurora/Project-Aurora/Profiles/LocalPCInformation.cs b/Project-Aurora/Project-Aurora/Profiles/LocalPCInformation.cs
index 156f4c8dd..18115148e 100644
--- a/Project-Aurora/Project-Aurora/Profiles/LocalPCInformation.cs
+++ b/Project-Aurora/Project-Aurora/Profiles/LocalPCInformation.cs
@@ -173,12 +173,12 @@ public class CPUInfo : Node
///
/// Represents the CPU usage from 0 to 100
///
- public float Usage => HardwareMonitor.CPU.CPUTotalLoad;
+ public float Usage => HardwareMonitor.CPU.CPULoad;
///
/// Represents the temperature of the cpu die in celsius
///
- public float Temperature => HardwareMonitor.CPU.CPUDieTemp;
+ public float Temperature => HardwareMonitor.CPU.CPUTemp;
///
/// Represents the CPU power draw in watts
@@ -206,18 +206,10 @@ public class RAMInfo : Node
public class GPUInfo : Node
{
- public float Usage => HardwareMonitor.GPU.GPUCoreLoad;
+ public float Usage => HardwareMonitor.GPU.GPULoad;
public float Temperature => HardwareMonitor.GPU.GPUCoreTemp;
public float PowerUsage => HardwareMonitor.GPU.GPUPower;
public float FanRPM => HardwareMonitor.GPU.GPUFan;
- public float CoreClock => HardwareMonitor.GPU.GPUCoreClock;
- public float MemoryClock => HardwareMonitor.GPU.GPUMemoryClock;
- public float ShaderClock => HardwareMonitor.GPU.GPUShaderClock;
- public float MemoryControllerUsage => HardwareMonitor.GPU.GPUMemoryCLoad;
- public float VideoEngineUsage => HardwareMonitor.GPU.GPUVideoEngineLoad;
- public float MemoryUsed => HardwareMonitor.GPU.GPUMemoryUsed;
- public float MemoryFree => MemoryTotal - MemoryUsed;
- public float MemoryTotal => HardwareMonitor.GPU.GPUMemoryTotal;
}
public class NETInfo : Node
diff --git a/Project-Aurora/Project-Aurora/Settings/Control_Settings.xaml b/Project-Aurora/Project-Aurora/Settings/Control_Settings.xaml
index 06b8e9831..cd2a9df8d 100755
--- a/Project-Aurora/Project-Aurora/Settings/Control_Settings.xaml
+++ b/Project-Aurora/Project-Aurora/Settings/Control_Settings.xaml
@@ -428,6 +428,13 @@
Width="150"
Height="30"
/>
+
diff --git a/Project-Aurora/Project-Aurora/Settings/Control_Settings.xaml.cs b/Project-Aurora/Project-Aurora/Settings/Control_Settings.xaml.cs
index c4670ed08..d7bfa25e0 100755
--- a/Project-Aurora/Project-Aurora/Settings/Control_Settings.xaml.cs
+++ b/Project-Aurora/Project-Aurora/Settings/Control_Settings.xaml.cs
@@ -941,5 +941,13 @@ private void startDelayAmount_ValueChanged(object sender, RoutedPropertyChangedE
}
}
}
+
+ private void btnDumpSensors_Click(object sender, RoutedEventArgs e)
+ {
+ if (HardwareMonitor.TryDump())
+ Xceed.Wpf.Toolkit.MessageBox.Show("Successfully wrote sensor info to logs folder");
+ else
+ Xceed.Wpf.Toolkit.MessageBox.Show("Eror dumping file. Consult log for details.");
+ }
}
}
diff --git a/Project-Aurora/Project-Aurora/Utils/HardwareMonitor.cs b/Project-Aurora/Project-Aurora/Utils/HardwareMonitor.cs
index d2cd826b4..537321b20 100644
--- a/Project-Aurora/Project-Aurora/Utils/HardwareMonitor.cs
+++ b/Project-Aurora/Project-Aurora/Utils/HardwareMonitor.cs
@@ -1,5 +1,6 @@
using System;
using System.Collections.Generic;
+using System.IO;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
@@ -48,6 +49,32 @@ static HardwareMonitor()
}
}
+ public static bool TryDump()
+ {
+ var lines = new List();
+ foreach (var hw in _hardware)
+ {
+ lines.Add("-----");
+ lines.Add(hw.Name);
+ lines.Add("Sensors:");
+ foreach (var sensor in hw.Sensors.OrderBy(s => s.SensorType))
+ {
+ lines.Add($"Name: {sensor.Name}, Id: {sensor.Identifier}, Type: {sensor.SensorType}");
+ }
+ lines.Add("-----");
+ }
+ try
+ {
+ File.WriteAllLines(Path.Combine(Global.LogsDirectory, "sensors.txt"), lines);
+ return true;
+ }
+ catch (IOException e)
+ {
+ Global.logger.Error("Failed to write sensors dump: " + e);
+ return false;
+ }
+ }
+
private static ISensor FindSensor(this IHardware hardware, string identifier)
{
var result = Array.Find(hardware.Sensors, s => s.Identifier.ToString().Contains(identifier));
@@ -59,6 +86,17 @@ private static ISensor FindSensor(this IHardware hardware, string identifier)
return result;
}
+ private static ISensor FindSensor(this IHardware hardware, SensorType type)
+ {
+ var result = Array.Find(hardware.Sensors, s => s.SensorType == type);
+ if (result is null)
+ {
+ Global.logger.Error(
+ $"[HardwareMonitor] Failed to find sensor of type \"{type}\" in {hardware.Name} of type {hardware.HardwareType}.");
+ }
+ return result;
+ }
+
public abstract class HardwareUpdater
{
protected IHardware hw;
@@ -105,35 +143,14 @@ public void SetUpdateTimer(int interval)
public sealed class GPUUpdater : HardwareUpdater
{
#region Sensors
- private readonly ISensor _GPUCoreTemp;
- public float GPUCoreTemp => GetValue(_GPUCoreTemp);
+ private readonly ISensor _GPUTemp;
+ public float GPUCoreTemp => GetValue(_GPUTemp);
private readonly ISensor _GPUFan;
public float GPUFan => GetValue(_GPUFan);
- private readonly ISensor _GPUCoreClock;
- public float GPUCoreClock => GetValue(_GPUCoreClock);
-
- private readonly ISensor _GPUMemoryClock;
- public float GPUMemoryClock => GetValue(_GPUMemoryClock);
-
- private readonly ISensor _GPUShaderClock;
- public float GPUShaderClock => GetValue(_GPUShaderClock);
-
- private readonly ISensor _GPUCoreLoad;
- public float GPUCoreLoad => GetValue(_GPUCoreLoad);
-
- private readonly ISensor _GPUMemoryCLoad;
- public float GPUMemoryCLoad => GetValue(_GPUMemoryCLoad);
-
- private readonly ISensor _GPUVideoEngineLoad;
- public float GPUVideoEngineLoad => GetValue(_GPUVideoEngineLoad);
-
- private readonly ISensor _GPUMemoryTotal;
- public float GPUMemoryTotal => GetValue(_GPUMemoryTotal);
-
- private readonly ISensor _GPUMemoryUsed;
- public float GPUMemoryUsed => GetValue(_GPUMemoryUsed);
+ private readonly ISensor _GPULoad;
+ public float GPULoad => GetValue(_GPULoad);
private readonly ISensor _GPUPower;
public float GPUPower => GetValue(_GPUPower);
@@ -148,31 +165,21 @@ public GPUUpdater(IEnumerable hardware)
Global.logger.Error("[HardwareMonitor] Could not find hardware of type GPU");
return;
}
- _GPUCoreLoad = hw.FindSensor("load/0");
- _GPUMemoryCLoad = hw.FindSensor("load/1");
- _GPUVideoEngineLoad = hw.FindSensor("load/2");
-
- _GPUCoreClock = hw.FindSensor("clock/0");
- _GPUMemoryClock = hw.FindSensor("clock/1");
- _GPUShaderClock = hw.FindSensor("clock/2");
-
- _GPUCoreTemp = hw.FindSensor("temperature/0");
- _GPUFan = hw.FindSensor("fan/0");
- _GPUPower = hw.FindSensor("power/0");
-
- _GPUMemoryTotal = hw.FindSensor("smalldata/3");
- _GPUMemoryUsed = hw.FindSensor("smalldata/2");
+ _GPULoad = hw.FindSensor(SensorType.Load);
+ _GPUTemp = hw.FindSensor(SensorType.Temperature);
+ _GPUFan = hw.FindSensor(SensorType.Fan);
+ _GPUPower = hw.FindSensor(SensorType.Power);
}
}
public sealed class CPUUpdater : HardwareUpdater
{
#region Sensors
- private readonly ISensor _CPUDieTemp;
- public float CPUDieTemp => GetValue(_CPUDieTemp);
+ private readonly ISensor _CPUTemp;
+ public float CPUTemp => GetValue(_CPUTemp);
- private readonly ISensor _CPUTotalLoad;
- public float CPUTotalLoad => GetValue(_CPUTotalLoad);
+ private readonly ISensor _CPULoad;
+ public float CPULoad => GetValue(_CPULoad);
private readonly ISensor _CPUPower;
public float CPUPower => GetValue(_CPUPower);
@@ -186,9 +193,9 @@ public CPUUpdater(IEnumerable hardware)
Global.logger.Error("[HardwareMonitor] Could not find hardware of type CPU");
return;
}
- _CPUDieTemp = hw.FindSensor("temperature/0");
- _CPUTotalLoad = hw.FindSensor("load/0");
- _CPUPower = hw.FindSensor("power/0");
+ _CPUTemp = hw.FindSensor(SensorType.Temperature);
+ _CPULoad = hw.FindSensor(SensorType.Load);
+ _CPUPower = hw.FindSensor(SensorType.Power);
}
}
@@ -236,7 +243,7 @@ public NETUpdater(IEnumerable hws)
Global.logger.Error("[HardwareMonitor] Could not find hardware of type Network");
return;
}
- _BandwidthUsed = hw.FindSensor("load");
+ _BandwidthUsed = hw.FindSensor(SensorType.Load);
_UploadSpeed = hw.FindSensor("throughput/7");
_DownloadSpeed = hw.FindSensor("throughput/8");
}