Added a RAM sensor for used memory.

This commit is contained in:
Michael Möller
2012-07-26 06:51:19 +00:00
parent 992fa702dc
commit e77e879780
2 changed files with 11 additions and 3 deletions

View File

@@ -14,6 +14,7 @@ namespace OpenHardwareMonitor.Hardware.RAM {
internal class GenericRAM : Hardware {
private Sensor loadSensor;
private Sensor usedMemory;
private Sensor availableMemory;
public GenericRAM(string name, ISettings settings)
@@ -22,7 +23,11 @@ namespace OpenHardwareMonitor.Hardware.RAM {
loadSensor = new Sensor("Memory", 0, SensorType.Load, this, settings);
ActivateSensor(loadSensor);
availableMemory = new Sensor("Available Memory", 0, SensorType.Data, this,
usedMemory = new Sensor("Used Memory", 0, SensorType.Data, this,
settings);
ActivateSensor(usedMemory);
availableMemory = new Sensor("Available Memory", 1, SensorType.Data, this,
settings);
ActivateSensor(availableMemory);
}
@@ -45,6 +50,9 @@ namespace OpenHardwareMonitor.Hardware.RAM {
(100.0f * status.AvailablePhysicalMemory) /
status.TotalPhysicalMemory;
usedMemory.Value = (float)(status.TotalPhysicalMemory
- status.AvailablePhysicalMemory) / (1024 * 1024 * 1024);
availableMemory.Value = (float)status.AvailablePhysicalMemory /
(1024 * 1024 * 1024);
}

View File

@@ -10,5 +10,5 @@
using System.Reflection;
[assembly: AssemblyVersion("0.5.0.0")]
[assembly: AssemblyInformationalVersion("0.5.0 Beta")]
[assembly: AssemblyVersion("0.5.1.0")]
[assembly: AssemblyInformationalVersion("0.5.1 Beta")]