Added a RAM hardware and sensor, fixed Issue 115.
3 This Source Code Form is subject to the terms of the Mozilla Public
4 License, v. 2.0. If a copy of the MPL was not distributed with this
5 file, You can obtain one at http://mozilla.org/MPL/2.0/.
7 Copyright (C) 2012 Michael Möller <mmoeller@openhardwaremonitor.org>
11 using Microsoft.VisualBasic.Devices;
13 namespace OpenHardwareMonitor.Hardware.RAM {
14 internal class GenericRAM : Hardware {
16 private Sensor loadSensor;
17 private Sensor availableMemory;
19 private ComputerInfo computerInfo;
21 public GenericRAM(string name, ISettings settings)
22 : base(name, new Identifier("ram"), settings)
24 computerInfo = new ComputerInfo();
25 loadSensor = new Sensor("Memory", 0, SensorType.Load, this, settings);
26 ActivateSensor(loadSensor);
28 availableMemory = new Sensor("Available Memory", 0, SensorType.Data, this, settings);
29 ActivateSensor(availableMemory);
32 public override HardwareType HardwareType {
34 return HardwareType.RAM;
38 public override void Update() {
39 loadSensor.Value = 100.0f -
40 (100.0f * computerInfo.AvailablePhysicalMemory) /
41 computerInfo.TotalPhysicalMemory;
43 availableMemory.Value = (float)computerInfo.AvailablePhysicalMemory /