* Add DIMM Temperature to LHM. * Remove RAMSPDToolkit as submodule and use nuget package instead. Upgrade System.Management assembly (required for nuget package). Implement retry mechanism for RAM detection due to possible issue at system boot. * Change to static field. * Driver now back in LHM. Ring0 replaced with OLS implementation. * Update package version. * Undo most of changes. Implement IDriver interface. * Change package to new one. * Review changes. Explicitly set UseWMI (current default is also false). * PR comments: Now having one DimmMemory instance per RAM stick. Separated memory sensors into two new classes. * PR feedback --------- Co-authored-by: PhyxionNL <7643972+PhyxionNL@users.noreply.github.com>
44 lines
1.4 KiB
C#
44 lines
1.4 KiB
C#
// This Source Code Form is subject to the terms of the Mozilla Public License, v. 2.0.
|
|
// If a copy of the MPL was not distributed with this file, You can obtain one at http://mozilla.org/MPL/2.0/.
|
|
// Copyright (C) LibreHardwareMonitor and Contributors.
|
|
// Partial Copyright (C) Michael Möller <mmoeller@openhardwaremonitor.org> and Contributors.
|
|
// All Rights Reserved.
|
|
|
|
namespace LibreHardwareMonitor.Hardware.Memory;
|
|
|
|
internal sealed class VirtualMemory : Hardware
|
|
{
|
|
public VirtualMemory(ISettings settings)
|
|
: base("Virtual Memory", new Identifier("ram"), settings)
|
|
{
|
|
VirtualMemoryUsed = new Sensor("Memory Used", 2, SensorType.Data, this, settings);
|
|
ActivateSensor(VirtualMemoryUsed);
|
|
|
|
VirtualMemoryAvailable = new Sensor("Memory Available", 3, SensorType.Data, this, settings);
|
|
ActivateSensor(VirtualMemoryAvailable);
|
|
|
|
VirtualMemoryLoad = new Sensor("Memory", 1, SensorType.Load, this, settings);
|
|
ActivateSensor(VirtualMemoryLoad);
|
|
}
|
|
|
|
public override HardwareType HardwareType => HardwareType.Memory;
|
|
|
|
internal Sensor VirtualMemoryAvailable { get; }
|
|
|
|
internal Sensor VirtualMemoryLoad { get; }
|
|
|
|
internal Sensor VirtualMemoryUsed { get; }
|
|
|
|
public override void Update()
|
|
{
|
|
if (Software.OperatingSystem.IsUnix)
|
|
{
|
|
MemoryLinux.Update(this);
|
|
}
|
|
else
|
|
{
|
|
MemoryWindows.Update(this);
|
|
}
|
|
}
|
|
}
|