@@ -22,6 +22,9 @@ using LibreHardwareMonitor.Hardware.Storage;
|
||||
|
||||
namespace LibreHardwareMonitor.Hardware
|
||||
{
|
||||
/// <summary>
|
||||
/// Stores all hardware groups and decides which devices should be enabled and updated.
|
||||
/// </summary>
|
||||
public class Computer : IComputer
|
||||
{
|
||||
public event HardwareEventHandler HardwareAdded;
|
||||
@@ -50,6 +53,11 @@ namespace LibreHardwareMonitor.Hardware
|
||||
_settings = settings ?? new Settings();
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Gets a list of all known <see cref="IHardware"/> after calling <see cref="Open"/>.
|
||||
/// <para>Can be updated by <see cref="IVisitor"/>.</para>
|
||||
/// </summary>
|
||||
/// <returns>List of all enabled devices.</returns>
|
||||
public IList<IHardware> Hardware
|
||||
{
|
||||
get
|
||||
@@ -66,6 +74,10 @@ namespace LibreHardwareMonitor.Hardware
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets a value indicating whether collecting information about <see cref="HardwareType.Cpu"/> devices should be enabled and updated.
|
||||
/// </summary>
|
||||
/// <returns><see langword="true"/> if a given category of devices is already enabled.</returns>
|
||||
public bool IsCpuEnabled
|
||||
{
|
||||
get { return _cpuEnabled; }
|
||||
@@ -83,6 +95,18 @@ namespace LibreHardwareMonitor.Hardware
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets a value indicating whether collecting information about:
|
||||
/// <list>
|
||||
/// <item><see cref="TBalancerGroup"/></item>
|
||||
/// <item><see cref="HeatmasterGroup"/></item>
|
||||
/// <item><see cref="AquaComputerGroup"/></item>
|
||||
/// <item><see cref="AeroCoolGroup"/></item>
|
||||
/// <item><see cref="NzxtGroup"/></item>
|
||||
/// </list>
|
||||
/// devices should be enabled and updated.
|
||||
/// </summary>
|
||||
/// <returns><see langword="true"/> if a given category of devices is already enabled.</returns>
|
||||
public bool IsControllerEnabled
|
||||
{
|
||||
get { return _controllerEnabled; }
|
||||
@@ -112,6 +136,10 @@ namespace LibreHardwareMonitor.Hardware
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets a value indicating whether collecting information about <see cref="HardwareType.GpuAmd"/> or <see cref="HardwareType.GpuNvidia"/> devices should be enabled and updated.
|
||||
/// </summary>
|
||||
/// <returns><see langword="true"/> if a given category of devices is already enabled.</returns>
|
||||
public bool IsGpuEnabled
|
||||
{
|
||||
get { return _gpuEnabled; }
|
||||
@@ -135,6 +163,10 @@ namespace LibreHardwareMonitor.Hardware
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets a value indicating whether collecting information about <see cref="HardwareType.Memory"/> devices should be enabled and updated.
|
||||
/// </summary>
|
||||
/// <returns><see langword="true"/> if a given category of devices is already enabled.</returns>
|
||||
public bool IsMemoryEnabled
|
||||
{
|
||||
get { return _memoryEnabled; }
|
||||
@@ -152,6 +184,10 @@ namespace LibreHardwareMonitor.Hardware
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets a value indicating whether collecting information about <see cref="HardwareType.Motherboard"/> devices should be enabled and updated.
|
||||
/// </summary>
|
||||
/// <returns><see langword="true"/> if a given category of devices is already enabled.</returns>
|
||||
public bool IsMotherboardEnabled
|
||||
{
|
||||
get { return _motherboardEnabled; }
|
||||
@@ -169,6 +205,10 @@ namespace LibreHardwareMonitor.Hardware
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets a value indicating whether collecting information about <see cref="HardwareType.Network"/> devices should be enabled and updated.
|
||||
/// </summary>
|
||||
/// <returns><see langword="true"/> if a given category of devices is already enabled.</returns>
|
||||
public bool IsNetworkEnabled
|
||||
{
|
||||
get { return _networkEnabled; }
|
||||
@@ -186,6 +226,10 @@ namespace LibreHardwareMonitor.Hardware
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets a value indicating whether collecting information about <see cref="HardwareType.Storage"/> devices should be enabled and updated.
|
||||
/// </summary>
|
||||
/// <returns><see langword="true"/> if a given category of devices is already enabled.</returns>
|
||||
public bool IsStorageEnabled
|
||||
{
|
||||
get { return _storageEnabled; }
|
||||
@@ -203,6 +247,10 @@ namespace LibreHardwareMonitor.Hardware
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Generates full LibreHardwareMonitor report for devices that have been enabled.
|
||||
/// </summary>
|
||||
/// <returns>A formatted text string with library, OS and hardware information.</returns>
|
||||
public string GetReport()
|
||||
{
|
||||
lock (_lock)
|
||||
@@ -279,6 +327,10 @@ namespace LibreHardwareMonitor.Hardware
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Triggers the <see cref="IVisitor.VisitComputer"/> method for the given observer.
|
||||
/// </summary>
|
||||
/// <param name="visitor">Observer who call to devices.</param>
|
||||
public void Accept(IVisitor visitor)
|
||||
{
|
||||
if (visitor == null)
|
||||
@@ -288,6 +340,10 @@ namespace LibreHardwareMonitor.Hardware
|
||||
visitor.VisitComputer(this);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Triggers the <see cref="IElement.Accept"/> method with the given visitor for each device in each group.
|
||||
/// </summary>
|
||||
/// <param name="visitor">Observer who call to devices.</param>
|
||||
public void Traverse(IVisitor visitor)
|
||||
{
|
||||
lock (_lock)
|
||||
@@ -384,6 +440,9 @@ namespace LibreHardwareMonitor.Hardware
|
||||
Remove(group);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// If hasn't been opened before, opens <see cref="SMBios"/>, <see cref="Ring0"/>, <see cref="OpCode"/> and triggers the private <see cref="AddGroups"/> method depending on which categories are enabled.
|
||||
/// </summary>
|
||||
public void Open()
|
||||
{
|
||||
if (_open)
|
||||
|
||||
@@ -10,6 +10,9 @@ namespace LibreHardwareMonitor.Hardware
|
||||
{
|
||||
public delegate void HardwareEventHandler(IHardware hardware);
|
||||
|
||||
/// <summary>
|
||||
/// Basic abstract with methods for the class which can store all hardware and decides which devices are to be checked and updated.
|
||||
/// </summary>
|
||||
public interface IComputer : IElement
|
||||
{
|
||||
bool IsCpuEnabled { get; }
|
||||
|
||||
@@ -6,12 +6,21 @@
|
||||
|
||||
namespace LibreHardwareMonitor.Hardware
|
||||
{
|
||||
/// <summary>
|
||||
/// Abstract parent with logic for the abstract class that stores data.
|
||||
/// </summary>
|
||||
public interface IElement
|
||||
{
|
||||
// accept visitor on this element
|
||||
/// <summary>
|
||||
/// Accepts the observer for this instance.
|
||||
/// </summary>
|
||||
/// <param name="visitor">Computer observer making the calls.</param>
|
||||
void Accept(IVisitor visitor);
|
||||
|
||||
// call accept(visitor) on all child elements (called only from visitors)
|
||||
/// <summary>
|
||||
/// Call the <see cref="Accept"/> method for all child instances <c>(called only from visitors).</c>
|
||||
/// </summary>
|
||||
/// <param name="visitor">Computer observer making the calls.</param>
|
||||
void Traverse(IVisitor visitor);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -8,12 +8,25 @@ using System.Collections.Generic;
|
||||
|
||||
namespace LibreHardwareMonitor.Hardware
|
||||
{
|
||||
/// <summary>
|
||||
/// A group of devices from one category in one list.
|
||||
/// </summary>
|
||||
internal interface IGroup
|
||||
{
|
||||
/// <summary>
|
||||
/// Gets a list that stores information about <see cref="IHardware"/> in a given group.
|
||||
/// </summary>
|
||||
IReadOnlyList<IHardware> Hardware { get; }
|
||||
|
||||
/// <summary>
|
||||
/// Report containing most of the known information about all <see cref="IHardware"/> in this <see cref="IGroup"/>.
|
||||
/// </summary>
|
||||
/// <returns>A formatted text string with hardware information.</returns>
|
||||
string GetReport();
|
||||
|
||||
/// <summary>
|
||||
/// Stop updating this group in the future.
|
||||
/// </summary>
|
||||
void Close();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -8,6 +8,9 @@ namespace LibreHardwareMonitor.Hardware
|
||||
{
|
||||
public delegate void SensorEventHandler(ISensor sensor);
|
||||
|
||||
/// <summary>
|
||||
/// Reflects what category the device is.
|
||||
/// </summary>
|
||||
public enum HardwareType
|
||||
{
|
||||
Motherboard,
|
||||
@@ -22,26 +25,61 @@ namespace LibreHardwareMonitor.Hardware
|
||||
EmbeddedController
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// An abstract object that stores information about a device. All sensors are available as an array of <see cref="Sensors"/>.
|
||||
/// </summary>
|
||||
public interface IHardware : IElement
|
||||
{
|
||||
/// <summary>
|
||||
/// <inheritdoc cref="LibreHardwareMonitor.Hardware.HardwareType"/>
|
||||
/// </summary>
|
||||
HardwareType HardwareType { get; }
|
||||
|
||||
/// <summary>
|
||||
/// Gets unique hardware identifier obtained from the computer.
|
||||
/// </summary>
|
||||
Identifier Identifier { get; }
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets device name.
|
||||
/// </summary>
|
||||
string Name { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Gets the device that is the parent of the current hardware. For example, the motherboard is the parent of SuperIO.
|
||||
/// </summary>
|
||||
IHardware Parent { get; }
|
||||
|
||||
/// <summary>
|
||||
/// Gets an array of all sensors such as temperature, clocks, load etc.
|
||||
/// </summary>
|
||||
ISensor[] Sensors { get; }
|
||||
|
||||
/// <summary>
|
||||
/// Gets child devices, e.g. SuperIO of the motherboard.
|
||||
/// </summary>
|
||||
IHardware[] SubHardware { get; }
|
||||
|
||||
/// <summary>
|
||||
/// Report containing most of the known information about the current device.
|
||||
/// </summary>
|
||||
/// <returns>A formatted text string with hardware information.</returns>
|
||||
string GetReport();
|
||||
|
||||
/// <summary>
|
||||
/// Refreshes the information stored in <see cref="Sensors"/> array.
|
||||
/// </summary>
|
||||
void Update();
|
||||
|
||||
/// <summary>
|
||||
/// An <see langword="event"/> that will be triggered when a new sensor appears.
|
||||
/// </summary>
|
||||
event SensorEventHandler SensorAdded;
|
||||
|
||||
/// <summary>
|
||||
/// An <see langword="event"/> that will be triggered when one of the sensors is removed.
|
||||
///
|
||||
/// </summary>
|
||||
event SensorEventHandler SensorRemoved;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -9,6 +9,9 @@ using System.Collections.Generic;
|
||||
|
||||
namespace LibreHardwareMonitor.Hardware
|
||||
{
|
||||
/// <summary>
|
||||
/// Category of what type the selected sensor is.
|
||||
/// </summary>
|
||||
public enum SensorType
|
||||
{
|
||||
Voltage, // V
|
||||
@@ -28,49 +31,94 @@ namespace LibreHardwareMonitor.Hardware
|
||||
Throughput // B/s
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Stores the readed value and the time in which it was recorded.
|
||||
/// </summary>
|
||||
public struct SensorValue
|
||||
{
|
||||
/// <param name="value"><see cref="Value"/> of the sensor.</param>
|
||||
/// <param name="time">The time code during which the <see cref="Value"/> was recorded.</param>
|
||||
public SensorValue(float value, DateTime time)
|
||||
{
|
||||
Value = value;
|
||||
Time = time;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Gets the value of the sensor
|
||||
/// </summary>
|
||||
public float Value { get; }
|
||||
|
||||
/// <summary>
|
||||
/// Gets the time code during which the <see cref="Value"/> was recorded.
|
||||
/// </summary>
|
||||
public DateTime Time { get; }
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Stores information about the readed values and the time in which they were collected.
|
||||
/// </summary>
|
||||
public interface ISensor : IElement
|
||||
{
|
||||
IControl Control { get; }
|
||||
|
||||
/// <summary>
|
||||
/// <inheritdoc cref="IHardware"/>
|
||||
/// </summary>
|
||||
IHardware Hardware { get; }
|
||||
|
||||
Identifier Identifier { get; }
|
||||
|
||||
/// <summary>
|
||||
/// Gets the unique identifier of this sensor for a given <see cref="IHardware"/>.
|
||||
/// </summary>
|
||||
int Index { get; }
|
||||
|
||||
bool IsDefaultHidden { get; }
|
||||
|
||||
/// <summary>
|
||||
/// Gets a maximum value recorded for the given sensor.
|
||||
/// </summary>
|
||||
float? Max { get; }
|
||||
|
||||
/// <summary>
|
||||
/// Gets a minimum value recorded for the given sensor.
|
||||
/// </summary>
|
||||
float? Min { get; }
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets a sensor name.
|
||||
/// <para>By default determined by the library.</para>
|
||||
/// </summary>
|
||||
string Name { get; set; }
|
||||
|
||||
IReadOnlyList<IParameter> Parameters { get; }
|
||||
|
||||
/// <summary>
|
||||
/// <inheritdoc cref="LibreHardwareMonitor.Hardware.SensorType"/>
|
||||
/// </summary>
|
||||
SensorType SensorType { get; }
|
||||
|
||||
/// <summary>
|
||||
/// Gets the last recorded value for the given sensor.
|
||||
/// </summary>
|
||||
float? Value { get; }
|
||||
|
||||
/// <summary>
|
||||
/// Gets a list of recorded values for the given sensor.
|
||||
/// </summary>
|
||||
IEnumerable<SensorValue> Values { get; }
|
||||
|
||||
TimeSpan ValuesTimeWindow { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Resets a value stored in <see cref="Min"/>.
|
||||
/// </summary>
|
||||
void ResetMin();
|
||||
|
||||
/// <summary>
|
||||
/// Resets a value stored in <see cref="Max"/>.
|
||||
/// </summary>
|
||||
void ResetMax();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -6,6 +6,9 @@
|
||||
|
||||
namespace LibreHardwareMonitor.Hardware
|
||||
{
|
||||
/// <summary>
|
||||
/// Base interface for creating observers who call to devices.
|
||||
/// </summary>
|
||||
public interface IVisitor
|
||||
{
|
||||
void VisitComputer(IComputer computer);
|
||||
|
||||
@@ -13,10 +13,9 @@ using System.Text;
|
||||
|
||||
namespace LibreHardwareMonitor.Hardware
|
||||
{
|
||||
/*
|
||||
* DSP0134 System Management BIOS (SMBIOS) Reference Specification v.3.3.0
|
||||
* Chapter 7.4.3
|
||||
*/
|
||||
/// <summary>
|
||||
/// Chassis security status based on <see href="https://www.dmtf.org/dsp/DSP0134">DMTF SMBIOS Reference Specification v.3.3.0, Chapter 7.4.3</see>.
|
||||
/// </summary>
|
||||
public enum ChassisSecurityStatus
|
||||
{
|
||||
Other = 1,
|
||||
@@ -26,10 +25,9 @@ namespace LibreHardwareMonitor.Hardware
|
||||
ExternalInterfaceEnabled
|
||||
}
|
||||
|
||||
/*
|
||||
* DSP0134 System Management BIOS (SMBIOS) Reference Specification v.3.3.0
|
||||
* Chapter 7.4.2
|
||||
*/
|
||||
/// <summary>
|
||||
/// Chassis state based on <see href="https://www.dmtf.org/dsp/DSP0134">DMTF SMBIOS Reference Specification v.3.3.0, Chapter 7.4.2</see>.
|
||||
/// </summary>
|
||||
public enum ChassisStates
|
||||
{
|
||||
Other = 1,
|
||||
@@ -40,10 +38,9 @@ namespace LibreHardwareMonitor.Hardware
|
||||
NonRecoverable
|
||||
}
|
||||
|
||||
/*
|
||||
* DSP0134 System Management BIOS (SMBIOS) Reference Specification v.3.3.0
|
||||
* Chapter 7.4.1
|
||||
*/
|
||||
/// <summary>
|
||||
/// Chassis type based on <see href="https://www.dmtf.org/dsp/DSP0134">DMTF SMBIOS Reference Specification v.3.3.0, Chapter 7.4.1</see>.
|
||||
/// </summary>
|
||||
public enum ChassisType
|
||||
{
|
||||
Other = 1,
|
||||
@@ -84,10 +81,9 @@ namespace LibreHardwareMonitor.Hardware
|
||||
StickPC
|
||||
}
|
||||
|
||||
/*
|
||||
* DSP0134 System Management BIOS (SMBIOS) Reference Specification v.3.3.0
|
||||
* Chapter 7.5.2
|
||||
*/
|
||||
/// <summary>
|
||||
/// Processor family based on <see href="https://www.dmtf.org/dsp/DSP0134">DMTF SMBIOS Reference Specification v.3.3.0, Chapter 7.5.2</see>.
|
||||
/// </summary>
|
||||
[SuppressMessage("ReSharper", "InconsistentNaming")]
|
||||
[SuppressMessage("ReSharper", "IdentifierTypo")]
|
||||
public enum ProcessorFamily
|
||||
@@ -305,10 +301,9 @@ namespace LibreHardwareMonitor.Hardware
|
||||
VideoProcessor
|
||||
}
|
||||
|
||||
/*
|
||||
* DSP0134 System Management BIOS (SMBIOS) Reference Specification v.3.3.0
|
||||
* Chapter 7.5.1
|
||||
*/
|
||||
/// <summary>
|
||||
/// Processor type based on <see href="https://www.dmtf.org/dsp/DSP0134">DMTF SMBIOS Reference Specification v.3.3.0, Chapter 7.5.1</see>.
|
||||
/// </summary>
|
||||
public enum ProcessorType
|
||||
{
|
||||
Other = 1,
|
||||
@@ -319,10 +314,9 @@ namespace LibreHardwareMonitor.Hardware
|
||||
VideoProcessor
|
||||
}
|
||||
|
||||
/*
|
||||
* DSP0134 System Management BIOS (SMBIOS) Reference Specification v.3.3.0
|
||||
* Chapter 7.5.5
|
||||
*/
|
||||
/// <summary>
|
||||
/// Processor socket based on <see href="https://www.dmtf.org/dsp/DSP0134">DMTF SMBIOS Reference Specification v.3.3.0, Chapter 7.5.5</see>.
|
||||
/// </summary>
|
||||
public enum ProcessorSocket
|
||||
{
|
||||
Other = 1,
|
||||
@@ -382,6 +376,9 @@ namespace LibreHardwareMonitor.Hardware
|
||||
Lga4189
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// System wake-up type based on <see href="https://www.dmtf.org/dsp/DSP0134">DMTF SMBIOS Reference Specification v.3.3.0, Chapter 7.2.2</see>.
|
||||
/// </summary>
|
||||
public enum SystemWakeUp
|
||||
{
|
||||
Reserved,
|
||||
@@ -395,18 +392,9 @@ namespace LibreHardwareMonitor.Hardware
|
||||
ACPowerRestored
|
||||
}
|
||||
|
||||
public enum CacheDesignation
|
||||
{
|
||||
Other,
|
||||
L1,
|
||||
L2,
|
||||
L3
|
||||
}
|
||||
|
||||
/*
|
||||
* DSP0134 System Management BIOS (SMBIOS) Reference Specification v.3.4.0
|
||||
* Chapter 7.8.5
|
||||
*/
|
||||
/// <summary>
|
||||
/// Cache associativity based on <see href="https://www.dmtf.org/dsp/DSP0134">DMTF SMBIOS Reference Specification v.3.3.0, Chapter 7.8.5</see>.
|
||||
/// </summary>
|
||||
public enum CacheAssociativity
|
||||
{
|
||||
Other = 1,
|
||||
@@ -425,6 +413,17 @@ namespace LibreHardwareMonitor.Hardware
|
||||
_20Way,
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Processor cache level.
|
||||
/// </summary>
|
||||
public enum CacheDesignation
|
||||
{
|
||||
Other,
|
||||
L1,
|
||||
L2,
|
||||
L3
|
||||
}
|
||||
|
||||
public class InformationBase
|
||||
{
|
||||
private readonly byte[] _data;
|
||||
@@ -470,6 +469,9 @@ namespace LibreHardwareMonitor.Hardware
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Motherboard BIOS information obtained from the SMBIOS table.
|
||||
/// </summary>
|
||||
public class BiosInformation : InformationBase
|
||||
{
|
||||
internal BiosInformation(string vendor, string version, string date = null, ulong? size = null) : base(0x00, 0, null, null)
|
||||
@@ -488,12 +490,24 @@ namespace LibreHardwareMonitor.Hardware
|
||||
Size = CalculateBiosRomSize();
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Gets the BIOS release date.
|
||||
/// </summary>
|
||||
public DateTime? Date { get; }
|
||||
|
||||
/// <summary>
|
||||
/// Gets the size of the physical device containing the BIOS.
|
||||
/// </summary>
|
||||
public ulong? Size { get; }
|
||||
|
||||
/// <summary>
|
||||
/// Gets the string number of the BIOS Vendor’s Name.
|
||||
/// </summary>
|
||||
public string Vendor { get; }
|
||||
|
||||
/// <summary>
|
||||
/// Gets the string number of the BIOS Version. This value is a free-form string that may contain Core and OEM version information.
|
||||
/// </summary>
|
||||
public string Version { get; }
|
||||
|
||||
private ulong? CalculateBiosRomSize()
|
||||
@@ -539,6 +553,9 @@ namespace LibreHardwareMonitor.Hardware
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// System information obtained from the SMBIOS table.
|
||||
/// </summary>
|
||||
public class SystemInformation : InformationBase
|
||||
{
|
||||
internal SystemInformation
|
||||
@@ -562,19 +579,41 @@ namespace LibreHardwareMonitor.Hardware
|
||||
WakeUp = (SystemWakeUp)GetByte(0x18);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Gets the family associated with system.
|
||||
/// <para>This text string identifies the family to which a particular computer belongs. A family refers to a set of computers that are similar but not identical from a hardware or software point of view. Typically, a family is composed of different computer models, which have different configurations and pricing points. Computers in the same family often have similar branding and cosmetic features.</para>
|
||||
/// </summary>
|
||||
public string Family { get; }
|
||||
|
||||
/// <summary>
|
||||
/// Gets the manufacturer name associated with system.
|
||||
/// </summary>
|
||||
public string ManufacturerName { get; }
|
||||
|
||||
/// <summary>
|
||||
/// Gets the product name associated with system.
|
||||
/// </summary>
|
||||
public string ProductName { get; }
|
||||
|
||||
/// <summary>
|
||||
/// Gets the serial number string associated with system.
|
||||
/// </summary>
|
||||
public string SerialNumber { get; }
|
||||
|
||||
/// <summary>
|
||||
/// Gets the version string associated with system.
|
||||
/// </summary>
|
||||
public string Version { get; }
|
||||
|
||||
/// <summary>
|
||||
/// Gets <inheritdoc cref="SystemWakeUp"/>
|
||||
/// </summary>
|
||||
public SystemWakeUp WakeUp { get; }
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Chassis information obtained from the SMBIOS table.
|
||||
/// </summary>
|
||||
public class ChassisInformation : InformationBase
|
||||
{
|
||||
internal ChassisInformation(byte type, ushort handle, byte[] data, string[] strings) : base(type, handle, data, strings)
|
||||
@@ -594,33 +633,76 @@ namespace LibreHardwareMonitor.Hardware
|
||||
SecurityStatus = (ChassisSecurityStatus)GetByte(0x0C);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Gets the asset tag associated with the enclosure or chassis.
|
||||
/// </summary>
|
||||
public string AssetTag { get; }
|
||||
|
||||
/// <summary>
|
||||
/// Gets <inheritdoc cref="ChassisStates"/>
|
||||
/// </summary>
|
||||
public ChassisStates BootUpState { get; }
|
||||
|
||||
/// <summary>
|
||||
/// Gets <inheritdoc cref="LibreHardwareMonitor.Hardware.ChassisType"/>
|
||||
/// </summary>
|
||||
public ChassisType ChassisType { get; }
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets the chassis lock.
|
||||
/// </summary>
|
||||
/// <returns>Chassis lock is present if <see langword="true"/>. Otherwise, either a lock is not present or it is unknown if the enclosure has a lock.</returns>
|
||||
public bool LockDetected { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Gets the string describing the chassis or enclosure manufacturer name.
|
||||
/// </summary>
|
||||
public string ManufacturerName { get; }
|
||||
|
||||
/// <summary>
|
||||
/// Gets the number of power cords associated with the enclosure or chassis.
|
||||
/// </summary>
|
||||
public int PowerCords { get; }
|
||||
|
||||
/// <summary>
|
||||
/// Gets the state of the enclosure’s power supply (or supplies) when last booted.
|
||||
/// </summary>
|
||||
public ChassisStates PowerSupplyState { get; }
|
||||
|
||||
/// <summary>
|
||||
/// Gets the height of the enclosure, in 'U's. A U is a standard unit of measure for the height of a rack or rack-mountable component and is equal to 1.75 inches or 4.445 cm. A value of <c>0</c> indicates that the enclosure height is unspecified.
|
||||
/// </summary>
|
||||
public int RackHeight { get; }
|
||||
|
||||
/// <summary>
|
||||
/// Gets the physical security status of the enclosure when last booted.
|
||||
/// </summary>
|
||||
public ChassisSecurityStatus SecurityStatus { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Gets the string describing the chassis or enclosure serial number.
|
||||
/// </summary>
|
||||
public string SerialNumber { get; }
|
||||
|
||||
/// <summary>
|
||||
/// Gets the string describing the chassis or enclosure SKU number.
|
||||
/// </summary>
|
||||
public string SKU { get; }
|
||||
|
||||
/// <summary>
|
||||
/// Gets the thermal state of the enclosure when last booted.
|
||||
/// </summary>
|
||||
public ChassisStates ThermalState { get; }
|
||||
|
||||
/// <summary>
|
||||
/// Gets the number of null-terminated string representing the chassis or enclosure version.
|
||||
/// </summary>
|
||||
public string Version { get; }
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Motherboard information obtained from the SMBIOS table.
|
||||
/// </summary>
|
||||
public class BaseBoardInformation : InformationBase
|
||||
{
|
||||
internal BaseBoardInformation(string manufacturerName, string productName, string version, string serialNumber) : base(0x02, 0, null, null)
|
||||
@@ -639,15 +721,30 @@ namespace LibreHardwareMonitor.Hardware
|
||||
SerialNumber = GetString(0x07).Trim();
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Gets the value that represents the manufacturer's name.
|
||||
/// </summary>
|
||||
public string ManufacturerName { get; }
|
||||
|
||||
/// <summary>
|
||||
/// Gets the value that represents the motherboard's name.
|
||||
/// </summary>
|
||||
public string ProductName { get; }
|
||||
|
||||
/// <summary>
|
||||
/// Gets the value that represents the motherboard's serial number.
|
||||
/// </summary>
|
||||
public string SerialNumber { get; }
|
||||
|
||||
/// <summary>
|
||||
/// Gets the value that represents the motherboard's revision number.
|
||||
/// </summary>
|
||||
public string Version { get; }
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Processor information obtained from the SMBIOS table.
|
||||
/// </summary>
|
||||
public class ProcessorInformation : InformationBase
|
||||
{
|
||||
internal ProcessorInformation(byte type, ushort handle, byte[] data, string[] strings) : base(type, handle, data, strings)
|
||||
@@ -670,33 +767,76 @@ namespace LibreHardwareMonitor.Hardware
|
||||
Family = (ProcessorFamily)(family == 254 ? GetWord(0x28) : family);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Gets the value that represents the number of cores per processor socket.
|
||||
/// </summary>
|
||||
public int CoreCount { get; }
|
||||
|
||||
/// <summary>
|
||||
/// Gets the value that represents the number of enabled cores per processor socket.
|
||||
/// </summary>
|
||||
public int CoreEnabled { get; }
|
||||
|
||||
/// <summary>
|
||||
/// Gets the external Clock Frequency, in MHz. If the value is unknown, the field is set to 0.
|
||||
/// </summary>
|
||||
public int ExternalClock { get; }
|
||||
|
||||
/// <summary>
|
||||
/// Gets the value that represents the maximum processor speed (in MHz) supported by the system for this processor socket.
|
||||
/// </summary>
|
||||
public int MaxSpeed { get; }
|
||||
|
||||
/// <summary>
|
||||
/// Gets the value that represents the current processor speed (in MHz).
|
||||
/// </summary>
|
||||
public int CurrentSpeed { get; }
|
||||
|
||||
/// <summary>
|
||||
/// Gets the value that represents the string number for the serial number of this processor.
|
||||
/// <para>This value is set by the manufacturer and normally not changeable.</para>
|
||||
/// </summary>
|
||||
public string Serial { get; }
|
||||
|
||||
/// <summary>
|
||||
/// Gets <inheritdoc cref="LibreHardwareMonitor.Hardware.ProcessorType"/>
|
||||
/// </summary>
|
||||
public ProcessorType ProcessorType { get; }
|
||||
|
||||
/// <summary>
|
||||
/// Gets <inheritdoc cref="LibreHardwareMonitor.Hardware.ProcessorSocket"/>
|
||||
/// </summary>
|
||||
public ProcessorSocket Socket { get; }
|
||||
|
||||
/// <summary>
|
||||
/// Gets <inheritdoc cref="LibreHardwareMonitor.Hardware.ProcessorFamily"/>
|
||||
/// </summary>
|
||||
public ProcessorFamily Family { get; }
|
||||
|
||||
/// <summary>
|
||||
/// Gets the string number for Reference Designation.
|
||||
/// </summary>
|
||||
public string SocketDesignation { get; }
|
||||
|
||||
/// <summary>
|
||||
/// Gets the string number of Processor Manufacturer.
|
||||
/// </summary>
|
||||
public string ManufacturerName { get; }
|
||||
|
||||
/// <summary>
|
||||
/// Gets the value that represents the number of threads per processor socket.
|
||||
/// </summary>
|
||||
public int ThreadCount { get; }
|
||||
|
||||
/// <summary>
|
||||
/// Gets the value that represents the string number describing the Processor.
|
||||
/// </summary>
|
||||
public string Version { get; }
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Processor cache information obtained from the SMBIOS table.
|
||||
/// </summary>
|
||||
public class ProcessorCache : InformationBase
|
||||
{
|
||||
internal ProcessorCache(byte type, ushort handle, byte[] data, string[] strings) : base(type, handle, data, strings)
|
||||
@@ -720,13 +860,25 @@ namespace LibreHardwareMonitor.Hardware
|
||||
return CacheDesignation.Other;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Gets <inheritdoc cref="CacheDesignation"/>
|
||||
/// </summary>
|
||||
public CacheDesignation Designation { get; }
|
||||
|
||||
/// <summary>
|
||||
/// Gets <inheritdoc cref="CacheAssociativity"/>
|
||||
/// </summary>
|
||||
public CacheAssociativity Associativity { get; }
|
||||
|
||||
/// <summary>
|
||||
/// Gets the value that represents the installed cache size.
|
||||
/// </summary>
|
||||
public int Size { get; }
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Memory information obtained from the SMBIOS table.
|
||||
/// </summary>
|
||||
public class MemoryDevice : InformationBase
|
||||
{
|
||||
internal MemoryDevice(byte type, ushort handle, byte[] data, string[] strings) : base(type, handle, data, strings)
|
||||
@@ -743,20 +895,45 @@ namespace LibreHardwareMonitor.Hardware
|
||||
Size += GetWord(0x1C);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Gets the string number of the string that identifies the physically labeled bank where the memory device is located.
|
||||
/// </summary>
|
||||
public string BankLocator { get; }
|
||||
|
||||
/// <summary>
|
||||
/// Gets the string number of the string that identifies the physically-labeled socket or board position where the memory device is located.
|
||||
/// </summary>
|
||||
public string DeviceLocator { get; }
|
||||
|
||||
/// <summary>
|
||||
/// Gets the string number for the manufacturer of this memory device.
|
||||
/// </summary>
|
||||
public string ManufacturerName { get; }
|
||||
|
||||
/// <summary>
|
||||
/// Gets the string number for the part number of this memory device.
|
||||
/// </summary>
|
||||
public string PartNumber { get; }
|
||||
|
||||
/// <summary>
|
||||
/// Gets the string number for the serial number of this memory device.
|
||||
/// </summary>
|
||||
public string SerialNumber { get; }
|
||||
|
||||
/// <summary>
|
||||
/// Gets the the value that identifies the maximum capable speed of the device, in megatransfers per second (MT/s).
|
||||
/// </summary>
|
||||
public int Speed { get; }
|
||||
|
||||
/// <summary>
|
||||
/// Gets the size of the memory device. If the value is 0, no memory device is installed in the socket.
|
||||
/// </summary>
|
||||
public int Size { get; }
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Reads and processes information encoded in an SMBIOS table.
|
||||
/// </summary>
|
||||
public class SMBios
|
||||
{
|
||||
private readonly byte[] _raw;
|
||||
@@ -887,18 +1064,39 @@ namespace LibreHardwareMonitor.Hardware
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Gets <inheritdoc cref="BiosInformation"/>
|
||||
/// </summary>
|
||||
public BiosInformation Bios { get; }
|
||||
|
||||
/// <summary>
|
||||
/// Gets <inheritdoc cref="BaseBoardInformation"/>
|
||||
/// </summary>
|
||||
public BaseBoardInformation Board { get; }
|
||||
|
||||
/// <summary>
|
||||
/// Gets <inheritdoc cref="ChassisInformation"/>
|
||||
/// </summary>
|
||||
public ChassisInformation Chassis { get; }
|
||||
|
||||
/// <summary>
|
||||
/// Gets <inheritdoc cref="MemoryDevice"/>
|
||||
/// </summary>
|
||||
public MemoryDevice[] MemoryDevices { get; }
|
||||
|
||||
/// <summary>
|
||||
/// Gets <inheritdoc cref="ProcessorCache"/>
|
||||
/// </summary>
|
||||
public ProcessorCache[] ProcessorCaches { get; }
|
||||
|
||||
/// <summary>
|
||||
/// Gets <inheritdoc cref="ProcessorInformation"/>
|
||||
/// </summary>
|
||||
public ProcessorInformation Processor { get; }
|
||||
|
||||
/// <summary>
|
||||
/// Gets <inheritdoc cref="SystemInformation"/>
|
||||
/// </summary>
|
||||
public SystemInformation System { get; }
|
||||
|
||||
private static string ReadSysFs(string path)
|
||||
@@ -919,6 +1117,10 @@ namespace LibreHardwareMonitor.Hardware
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Report containing most of the information that could be read from the SMBIOS table.
|
||||
/// </summary>
|
||||
/// <returns>A formatted text string with computer information and the entire SMBIOS table.</returns>
|
||||
public string GetReport()
|
||||
{
|
||||
StringBuilder r = new StringBuilder();
|
||||
|
||||
Reference in New Issue
Block a user