Added a RAM hardware and sensor, fixed Issue 115.

This commit is contained in:
Michael Möller
2012-07-23 21:54:35 +00:00
parent 5e87af437d
commit 4bebb21f12
14 changed files with 421 additions and 217 deletions

View File

@@ -56,6 +56,9 @@ namespace OpenHardwareMonitor.GUI {
case HardwareType.TBalancer:
image = Utilities.EmbeddedResources.GetImage("bigng.png");
break;
case HardwareType.RAM:
image = Utilities.EmbeddedResources.GetImage("chip.png");
break;
default:
image = new Bitmap(1, 1);
break;

View File

@@ -94,6 +94,7 @@ namespace OpenHardwareMonitor.GUI {
this.timer = new System.Windows.Forms.Timer(this.components);
this.splitContainer = new OpenHardwareMonitor.GUI.SplitContainerAdv();
this.treeView = new Aga.Controls.Tree.TreeViewAdv();
this.ramMenuItem = new System.Windows.Forms.MenuItem();
this.splitContainer.Panel1.SuspendLayout();
this.splitContainer.SuspendLayout();
this.SuspendLayout();
@@ -227,6 +228,7 @@ namespace OpenHardwareMonitor.GUI {
this.menuItem5.MenuItems.AddRange(new System.Windows.Forms.MenuItem[] {
this.mainboardMenuItem,
this.cpuMenuItem,
this.ramMenuItem,
this.gpuMenuItem,
this.fanControllerMenuItem,
this.hddMenuItem});
@@ -244,17 +246,17 @@ namespace OpenHardwareMonitor.GUI {
//
// gpuMenuItem
//
this.gpuMenuItem.Index = 2;
this.gpuMenuItem.Index = 3;
this.gpuMenuItem.Text = "GPU";
//
// fanControllerMenuItem
//
this.fanControllerMenuItem.Index = 3;
this.fanControllerMenuItem.Index = 4;
this.fanControllerMenuItem.Text = "Fan Controllers";
//
// hddMenuItem
//
this.hddMenuItem.Index = 4;
this.hddMenuItem.Index = 5;
this.hddMenuItem.Text = "Hard Disk Drives";
//
// menuItem6
@@ -525,6 +527,11 @@ namespace OpenHardwareMonitor.GUI {
this.treeView.MouseMove += new System.Windows.Forms.MouseEventHandler(this.treeView_MouseMove);
this.treeView.MouseUp += new System.Windows.Forms.MouseEventHandler(this.treeView_MouseUp);
//
// ramMenuItem
//
this.ramMenuItem.Index = 2;
this.ramMenuItem.Text = "RAM";
//
// MainForm
//
this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
@@ -607,6 +614,7 @@ namespace OpenHardwareMonitor.GUI {
private System.Windows.Forms.MenuItem cpuMenuItem;
private System.Windows.Forms.MenuItem gpuMenuItem;
private System.Windows.Forms.MenuItem fanControllerMenuItem;
private System.Windows.Forms.MenuItem ramMenuItem;
}
}

View File

@@ -54,6 +54,7 @@ namespace OpenHardwareMonitor.GUI {
private UserOption readMainboardSensors;
private UserOption readCpuSensors;
private UserOption readRamSensors;
private UserOption readGpuSensors;
private UserOption readFanControllersSensors;
private UserOption readHddSensors;
@@ -226,6 +227,12 @@ namespace OpenHardwareMonitor.GUI {
computer.CPUEnabled = readCpuSensors.Value;
};
readRamSensors = new UserOption("ramMenuItem", true,
ramMenuItem, settings);
readRamSensors.Changed += delegate(object sender, EventArgs e) {
computer.RAMEnabled = readRamSensors.Value;
};
readGpuSensors = new UserOption("gpuMenuItem", true,
gpuMenuItem, settings);
readGpuSensors.Changed += delegate(object sender, EventArgs e) {

View File

@@ -22,13 +22,16 @@ namespace OpenHardwareMonitor.Hardware {
private readonly List<IGroup> groups = new List<IGroup>();
private readonly ISettings settings;
private SMBIOS smbios;
private bool open;
private bool mainboardEnabled;
private bool cpuEnabled;
private bool ramEnabled;
private bool gpuEnabled;
private bool fanControllerEnabled;
private bool hddEnabled;
private bool hddEnabled;
public Computer() {
this.settings = new Settings();
@@ -76,15 +79,20 @@ namespace OpenHardwareMonitor.Hardware {
if (open)
return;
this.smbios = new SMBIOS();
Ring0.Open();
Opcode.Open();
if (mainboardEnabled)
Add(new Mainboard.MainboardGroup(settings));
Add(new Mainboard.MainboardGroup(smbios, settings));
if (cpuEnabled)
Add(new CPU.CPUGroup(settings));
if (ramEnabled)
Add(new RAM.RAMGroup(smbios, settings));
if (gpuEnabled) {
Add(new ATI.ATIGroup(settings));
Add(new Nvidia.NvidiaGroup(settings));
@@ -108,7 +116,7 @@ namespace OpenHardwareMonitor.Hardware {
set {
if (open && value != mainboardEnabled) {
if (value)
Add(new Mainboard.MainboardGroup(settings));
Add(new Mainboard.MainboardGroup(smbios, settings));
else
RemoveType<Mainboard.MainboardGroup>();
}
@@ -131,6 +139,21 @@ namespace OpenHardwareMonitor.Hardware {
}
}
public bool RAMEnabled {
get { return ramEnabled; }
[SecurityPermission(SecurityAction.LinkDemand, UnmanagedCode = true)]
set {
if (open && value != ramEnabled) {
if (value)
Add(new RAM.RAMGroup(smbios, settings));
else
RemoveType<RAM.RAMGroup>();
}
ramEnabled = value;
}
}
public bool GPUEnabled {
get { return gpuEnabled; }
@@ -336,6 +359,8 @@ namespace OpenHardwareMonitor.Hardware {
Opcode.Close();
Ring0.Close();
this.smbios = null;
open = false;
}

View File

@@ -16,8 +16,14 @@ namespace OpenHardwareMonitor.Hardware {
IHardware[] Hardware { get; }
bool MainboardEnabled { get; }
bool CPUEnabled { get; }
bool RAMEnabled { get; }
bool GPUEnabled { get; }
bool FanControllerEnabled { get; }
bool HDDEnabled { get; }
string GetReport();
event HardwareEventHandler HardwareAdded;

View File

@@ -16,11 +16,12 @@ namespace OpenHardwareMonitor.Hardware {
Mainboard,
SuperIO,
CPU,
RAM,
GpuNvidia,
GpuAti,
TBalancer,
Heatmaster,
HDD,
HDD
}
public interface IHardware : IElement {

View File

@@ -0,0 +1,200 @@
/*
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) 2012 Michael Möller <mmoeller@openhardwaremonitor.org>
*/
namespace OpenHardwareMonitor.Hardware.Mainboard {
internal class Identification {
public static Manufacturer GetManufacturer(string name) {
switch (name) {
case "Alienware":
return Manufacturer.Alienware;
case "Apple Inc.":
return Manufacturer.Apple;
case "ASRock":
return Manufacturer.ASRock;
case "ASUSTeK Computer INC.":
case "ASUSTeK COMPUTER INC.":
return Manufacturer.ASUS;
case "Dell Inc.":
return Manufacturer.Dell;
case "DFI":
case "DFI Inc.":
return Manufacturer.DFI;
case "ECS":
return Manufacturer.ECS;
case "EPoX COMPUTER CO., LTD":
return Manufacturer.EPoX;
case "EVGA":
return Manufacturer.EVGA;
case "First International Computer, Inc.":
return Manufacturer.FIC;
case "FUJITSU":
case "FUJITSU SIEMENS":
return Manufacturer.Fujitsu;
case "Gigabyte Technology Co., Ltd.":
return Manufacturer.Gigabyte;
case "Hewlett-Packard":
return Manufacturer.HP;
case "IBM":
return Manufacturer.IBM;
case "Intel":
case "Intel Corp.":
case "Intel Corporation":
case "INTEL Corporation":
return Manufacturer.Intel;
case "Lenovo":
case "LENOVO":
return Manufacturer.Lenovo;
case "Micro-Star International":
case "MICRO-STAR INTERNATIONAL CO., LTD":
case "MICRO-STAR INTERNATIONAL CO.,LTD":
case "MSI":
return Manufacturer.MSI;
case "Shuttle":
return Manufacturer.Shuttle;
case "Supermicro":
return Manufacturer.Supermicro;
case "TOSHIBA":
return Manufacturer.Toshiba;
case "XFX":
return Manufacturer.XFX;
case "To be filled by O.E.M.":
return Manufacturer.Unknown;
default:
return Manufacturer.Unknown;
}
}
public static Model GetModel(string name) {
switch (name) {
case "880GMH/USB3":
return Model._880GMH_USB3;
case "ASRock AOD790GX/128M":
return Model.AOD790GX_128M;
case "P55 Deluxe":
return Model.P55_Deluxe;
case "Crosshair III Formula":
return Model.Crosshair_III_Formula;
case "M2N-SLI DELUXE":
return Model.M2N_SLI_DELUXE;
case "M4A79XTD EVO":
return Model.M4A79XTD_EVO;
case "P5W DH Deluxe":
return Model.P5W_DH_Deluxe;
case "P6T":
return Model.P6T;
case "P6X58D-E":
return Model.P6X58D_E;
case "P8P67":
return Model.P8P67;
case "P8P67 EVO":
return Model.P8P67_EVO;
case "P8P67 PRO":
return Model.P8P67_PRO;
case "P8P67-M PRO":
return Model.P8P67_M_PRO;
case "P8Z77-V":
return Model.P8Z77_V;
case "P9X79":
return Model.P9X79;
case "Rampage Extreme":
return Model.Rampage_Extreme;
case "Rampage II GENE":
return Model.Rampage_II_GENE;
case "LP BI P45-T2RS Elite":
return Model.LP_BI_P45_T2RS_Elite;
case "LP DK P55-T3eH9":
return Model.LP_DK_P55_T3eH9;
case "A890GXM-A":
return Model.A890GXM_A;
case "X58 SLI Classified":
return Model.X58_SLI_Classified;
case "965P-S3":
return Model._965P_S3;
case "EP45-DS3R":
return Model.EP45_DS3R;
case "EP45-UD3R":
return Model.EP45_UD3R;
case "EX58-EXTREME":
return Model.EX58_EXTREME;
case "EX58-UD3R":
return Model.EX58_UD3R;
case "G41M-Combo":
return Model.G41M_Combo;
case "G41MT-S2":
return Model.G41MT_S2;
case "G41MT-S2P":
return Model.G41MT_S2P;
case "GA-MA770T-UD3":
return Model.GA_MA770T_UD3;
case "GA-MA770T-UD3P":
return Model.GA_MA770T_UD3P;
case "GA-MA785GM-US2H":
return Model.GA_MA785GM_US2H;
case "GA-MA785GMT-UD2H":
return Model.GA_MA785GMT_UD2H;
case "GA-MA78LM-S2H":
return Model.GA_MA78LM_S2H;
case "GA-MA790X-UD3P":
return Model.GA_MA790X_UD3P;
case "H55-USB3":
return Model.H55_USB3;
case "H55N-USB3":
return Model.H55N_USB3;
case "H61M-DS2 REV 1.2":
return Model.H61M_DS2_REV_1_2;
case "H61M-USB3-B3 REV 2.0":
return Model.H61M_USB3_B3_REV_2_0;
case "H67A-UD3H-B3":
return Model.H67A_UD3H_B3;
case "H67A-USB3-B3":
return Model.H67A_USB3_B3;
case "P35-DS3":
return Model.P35_DS3;
case "P35-DS3L":
return Model.P35_DS3L;
case "P55-UD4":
return Model.P55_UD4;
case "P55A-UD3":
return Model.P55A_UD3;
case "P55M-UD4":
return Model.P55M_UD4;
case "P67A-UD3-B3":
return Model.P67A_UD3_B3;
case "P67A-UD3R-B3":
return Model.P67A_UD3R_B3;
case "P67A-UD4-B3":
return Model.P67A_UD4_B3;
case "P8Z68-V PRO":
return Model.P8Z68_V_PRO;
case "X38-DS5":
return Model.X38_DS5;
case "X58A-UD3R":
return Model.X58A_UD3R;
case "Z68A-D3H-B3":
return Model.Z68A_D3H_B3;
case "Z68AP-D3":
return Model.Z68AP_D3;
case "Z68X-UD3H-B3":
return Model.Z68X_UD3H_B3;
case "Z68X-UD7-B3":
return Model.Z68X_UD7_B3;
case "FH67":
return Model.FH67;
case "Base Board Product Name":
case "To be filled by O.E.M.":
return Model.Unknown;
default:
return Model.Unknown;
}
}
}
}

View File

@@ -4,7 +4,7 @@
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) 2009-2011 Michael Möller <mmoeller@openhardwaremonitor.org>
Copyright (C) 2009-2012 Michael Möller <mmoeller@openhardwaremonitor.org>
*/
@@ -22,19 +22,25 @@ namespace OpenHardwareMonitor.Hardware.Mainboard {
private readonly LMSensors lmSensors;
private readonly Hardware[] superIOHardware;
public Mainboard(ISettings settings) {
public Mainboard(SMBIOS smbios, ISettings settings) {
this.settings = settings;
this.smbios = new SMBIOS();
this.smbios = smbios;
Manufacturer manufacturer = smbios.Board == null ? Manufacturer.Unknown :
Identification.GetManufacturer(smbios.Board.ManufacturerName);
Model model = smbios.Board == null ? Model.Unknown :
Identification.GetModel(smbios.Board.ProductName);
if (smbios.Board != null) {
if (!string.IsNullOrEmpty(smbios.Board.ProductName)) {
if (smbios.Board.Manufacturer == Manufacturer.Unknown)
if (manufacturer == Manufacturer.Unknown)
this.name = smbios.Board.ProductName;
else
this.name = smbios.Board.Manufacturer + " " +
this.name = manufacturer + " " +
smbios.Board.ProductName;
} else {
this.name = smbios.Board.Manufacturer.ToString();
this.name = manufacturer.ToString();
}
} else {
this.name = Manufacturer.Unknown.ToString();
@@ -55,10 +61,8 @@ namespace OpenHardwareMonitor.Hardware.Mainboard {
superIOHardware = new Hardware[superIO.Length];
for (int i = 0; i < superIO.Length; i++)
superIOHardware[i] = new SuperIOHardware(this, superIO[i],
smbios.Board != null ? smbios.Board.Manufacturer :
Manufacturer.Unknown, smbios.Board != null ? smbios.Board.Model :
Model.Unknown, settings);
superIOHardware[i] = new SuperIOHardware(this, superIO[i],
manufacturer, model, settings);
}
public string Name {

View File

@@ -13,9 +13,9 @@ namespace OpenHardwareMonitor.Hardware.Mainboard {
private readonly Mainboard[] mainboards;
public MainboardGroup(ISettings settings) {
public MainboardGroup(SMBIOS smbios, ISettings settings) {
mainboards = new Mainboard[1];
mainboards[0] = new Mainboard(settings);
mainboards[0] = new Mainboard(smbios, settings);
}
public void Close() {

View File

@@ -0,0 +1,47 @@
/*
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) 2012 Michael Möller <mmoeller@openhardwaremonitor.org>
*/
using Microsoft.VisualBasic.Devices;
namespace OpenHardwareMonitor.Hardware.RAM {
internal class GenericRAM : Hardware {
private Sensor loadSensor;
private Sensor availableMemory;
private ComputerInfo computerInfo;
public GenericRAM(string name, ISettings settings)
: base(name, new Identifier("ram"), settings)
{
computerInfo = new ComputerInfo();
loadSensor = new Sensor("Memory", 0, SensorType.Load, this, settings);
ActivateSensor(loadSensor);
availableMemory = new Sensor("Available Memory", 0, SensorType.Data, this, settings);
ActivateSensor(availableMemory);
}
public override HardwareType HardwareType {
get {
return HardwareType.RAM;
}
}
public override void Update() {
loadSensor.Value = 100.0f -
(100.0f * computerInfo.AvailablePhysicalMemory) /
computerInfo.TotalPhysicalMemory;
availableMemory.Value = (float)computerInfo.AvailablePhysicalMemory /
(1024 * 1024 * 1024);
}
}
}

42
Hardware/RAM/RAMGroup.cs Normal file
View File

@@ -0,0 +1,42 @@
/*
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) 2012 Michael Möller <mmoeller@openhardwaremonitor.org>
*/
namespace OpenHardwareMonitor.Hardware.RAM {
internal class RAMGroup : IGroup {
private IHardware[] hardware;
public RAMGroup(SMBIOS smbios, ISettings settings) {
string name;
if (smbios.MemoryDevices.Length > 0) {
name = smbios.MemoryDevices[0].ManufacturerName + " " +
smbios.MemoryDevices[0].PartNumber;
} else {
name = "Generic Memory";
}
hardware = new IHardware[] { new GenericRAM(name, settings) };
}
public string GetReport() {
return null;
}
public IHardware[] Hardware {
get {
return hardware;
}
}
public void Close() {
}
}
}

View File

@@ -14,7 +14,7 @@ using System.IO;
using System.Management;
using System.Text;
namespace OpenHardwareMonitor.Hardware.Mainboard {
namespace OpenHardwareMonitor.Hardware {
internal class SMBIOS {
@@ -25,6 +25,7 @@ namespace OpenHardwareMonitor.Hardware.Mainboard {
private readonly BIOSInformation biosInformation;
private readonly SystemInformation systemInformation;
private readonly BaseBoardInformation baseBoardInformation;
private readonly MemoryDevice[] memoryDevices;
private static string ReadSysFS(string path) {
try {
@@ -60,9 +61,11 @@ namespace OpenHardwareMonitor.Hardware.Mainboard {
string biosVendor = ReadSysFS("/sys/class/dmi/id/bios_vendor");
string biosVersion = ReadSysFS("/sys/class/dmi/id/bios_version");
this.biosInformation = new BIOSInformation(biosVendor, biosVersion);
this.memoryDevices = new MemoryDevice[0];
} else {
List<Structure> structureList = new List<Structure>();
List<MemoryDevice> memoryDeviceList = new List<MemoryDevice>();
raw = null;
byte majorVersion = 0;
@@ -126,12 +129,17 @@ namespace OpenHardwareMonitor.Hardware.Mainboard {
case 0x02: this.baseBoardInformation = new BaseBoardInformation(
type, handle, data, stringsList.ToArray());
structureList.Add(this.baseBoardInformation); break;
case 0x11: MemoryDevice m = new MemoryDevice(
type, handle, data, stringsList.ToArray());
memoryDeviceList.Add(m);
structureList.Add(m); break;
default: structureList.Add(new Structure(
type, handle, data, stringsList.ToArray())); break;
}
}
}
memoryDevices = memoryDeviceList.ToArray();
table = structureList.ToArray();
}
}
@@ -170,6 +178,14 @@ namespace OpenHardwareMonitor.Hardware.Mainboard {
r.AppendLine();
}
for (int i = 0; i < MemoryDevices.Length; i++) {
r.Append("Memory Device [" + i + "] Manufacturer: ");
r.AppendLine(MemoryDevices[i].ManufacturerName);
r.Append("Memory Device [" + i + "] Part Number: ");
r.AppendLine(MemoryDevices[i].PartNumber);
r.AppendLine();
}
if (raw != null) {
string base64 = Convert.ToBase64String(raw);
r.AppendLine("SMBIOS Table");
@@ -203,6 +219,10 @@ namespace OpenHardwareMonitor.Hardware.Mainboard {
get { return baseBoardInformation; }
}
public MemoryDevice[] MemoryDevices {
get { return memoryDevices; }
}
public class Structure {
private readonly byte type;
private readonly ushort handle;
@@ -304,202 +324,13 @@ namespace OpenHardwareMonitor.Hardware.Mainboard {
private readonly string productName;
private readonly string version;
private readonly string serialNumber;
private readonly Manufacturer manufacturer;
private readonly Model model;
private static Manufacturer GetManufacturer(string name) {
switch (name) {
case "Alienware":
return Manufacturer.Alienware;
case "Apple Inc.":
return Manufacturer.Apple;
case "ASRock":
return Manufacturer.ASRock;
case "ASUSTeK Computer INC.":
case "ASUSTeK COMPUTER INC.":
return Manufacturer.ASUS;
case "Dell Inc.":
return Manufacturer.Dell;
case "DFI":
case "DFI Inc.":
return Manufacturer.DFI;
case "ECS":
return Manufacturer.ECS;
case "EPoX COMPUTER CO., LTD":
return Manufacturer.EPoX;
case "EVGA":
return Manufacturer.EVGA;
case "First International Computer, Inc.":
return Manufacturer.FIC;
case "FUJITSU":
case "FUJITSU SIEMENS":
return Manufacturer.Fujitsu;
case "Gigabyte Technology Co., Ltd.":
return Manufacturer.Gigabyte;
case "Hewlett-Packard":
return Manufacturer.HP;
case "IBM":
return Manufacturer.IBM;
case "Intel":
case "Intel Corp.":
case "Intel Corporation":
case "INTEL Corporation":
return Manufacturer.Intel;
case "Lenovo":
case "LENOVO":
return Manufacturer.Lenovo;
case "Micro-Star International":
case "MICRO-STAR INTERNATIONAL CO., LTD":
case "MICRO-STAR INTERNATIONAL CO.,LTD":
case "MSI":
return Manufacturer.MSI;
case "Shuttle":
return Manufacturer.Shuttle;
case "Supermicro":
return Manufacturer.Supermicro;
case "TOSHIBA":
return Manufacturer.Toshiba;
case "XFX":
return Manufacturer.XFX;
case "To be filled by O.E.M.":
return Manufacturer.Unknown;
default:
return Manufacturer.Unknown;
}
}
private static Model GetModel(string name) {
switch (name) {
case "880GMH/USB3":
return Model._880GMH_USB3;
case "ASRock AOD790GX/128M":
return Model.AOD790GX_128M;
case "P55 Deluxe":
return Model.P55_Deluxe;
case "Crosshair III Formula":
return Model.Crosshair_III_Formula;
case "M2N-SLI DELUXE":
return Model.M2N_SLI_DELUXE;
case "M4A79XTD EVO":
return Model.M4A79XTD_EVO;
case "P5W DH Deluxe":
return Model.P5W_DH_Deluxe;
case "P6T":
return Model.P6T;
case "P6X58D-E":
return Model.P6X58D_E;
case "P8P67":
return Model.P8P67;
case "P8P67 EVO":
return Model.P8P67_EVO;
case "P8P67 PRO":
return Model.P8P67_PRO;
case "P8P67-M PRO":
return Model.P8P67_M_PRO;
case "P8Z77-V":
return Model.P8Z77_V;
case "P9X79":
return Model.P9X79;
case "Rampage Extreme":
return Model.Rampage_Extreme;
case "Rampage II GENE":
return Model.Rampage_II_GENE;
case "LP BI P45-T2RS Elite":
return Model.LP_BI_P45_T2RS_Elite;
case "LP DK P55-T3eH9":
return Model.LP_DK_P55_T3eH9;
case "A890GXM-A":
return Model.A890GXM_A;
case "X58 SLI Classified":
return Model.X58_SLI_Classified;
case "965P-S3":
return Model._965P_S3;
case "EP45-DS3R":
return Model.EP45_DS3R;
case "EP45-UD3R":
return Model.EP45_UD3R;
case "EX58-EXTREME":
return Model.EX58_EXTREME;
case "EX58-UD3R":
return Model.EX58_UD3R;
case "G41M-Combo":
return Model.G41M_Combo;
case "G41MT-S2":
return Model.G41MT_S2;
case "G41MT-S2P":
return Model.G41MT_S2P;
case "GA-MA770T-UD3":
return Model.GA_MA770T_UD3;
case "GA-MA770T-UD3P":
return Model.GA_MA770T_UD3P;
case "GA-MA785GM-US2H":
return Model.GA_MA785GM_US2H;
case "GA-MA785GMT-UD2H":
return Model.GA_MA785GMT_UD2H;
case "GA-MA78LM-S2H":
return Model.GA_MA78LM_S2H;
case "GA-MA790X-UD3P":
return Model.GA_MA790X_UD3P;
case "H55-USB3":
return Model.H55_USB3;
case "H55N-USB3":
return Model.H55N_USB3;
case "H61M-DS2 REV 1.2":
return Model.H61M_DS2_REV_1_2;
case "H61M-USB3-B3 REV 2.0":
return Model.H61M_USB3_B3_REV_2_0;
case "H67A-UD3H-B3":
return Model.H67A_UD3H_B3;
case "H67A-USB3-B3":
return Model.H67A_USB3_B3;
case "P35-DS3":
return Model.P35_DS3;
case "P35-DS3L":
return Model.P35_DS3L;
case "P55-UD4":
return Model.P55_UD4;
case "P55A-UD3":
return Model.P55A_UD3;
case "P55M-UD4":
return Model.P55M_UD4;
case "P67A-UD3-B3":
return Model.P67A_UD3_B3;
case "P67A-UD3R-B3":
return Model.P67A_UD3R_B3;
case "P67A-UD4-B3":
return Model.P67A_UD4_B3;
case "P8Z68-V PRO":
return Model.P8Z68_V_PRO;
case "X38-DS5":
return Model.X38_DS5;
case "X58A-UD3R":
return Model.X58A_UD3R;
case "Z68A-D3H-B3":
return Model.Z68A_D3H_B3;
case "Z68AP-D3":
return Model.Z68AP_D3;
case "Z68X-UD3H-B3":
return Model.Z68X_UD3H_B3;
case "Z68X-UD7-B3":
return Model.Z68X_UD7_B3;
case "FH67":
return Model.FH67;
case "Base Board Product Name":
case "To be filled by O.E.M.":
return Model.Unknown;
default:
return Model.Unknown;
}
}
public BaseBoardInformation(string manufacturerName, string productName,
string version, string serialNumber)
: base(0x02, 0, null, null)
{
this.manufacturerName = manufacturerName;
this.manufacturer = GetManufacturer(manufacturerName);
this.productName = productName;
this.model = GetModel(productName);
this.version = version;
this.serialNumber = serialNumber;
}
@@ -509,9 +340,7 @@ namespace OpenHardwareMonitor.Hardware.Mainboard {
: base(type, handle, data, strings) {
this.manufacturerName = GetString(0x04).Trim();
this.manufacturer = GetManufacturer(this.manufacturerName);
this.productName = GetString(0x05).Trim();
this.model = GetModel(this.productName);
this.version = GetString(0x06).Trim();
this.serialNumber = GetString(0x07).Trim();
}
@@ -524,9 +353,35 @@ namespace OpenHardwareMonitor.Hardware.Mainboard {
public string SerialNumber { get { return serialNumber; } }
public Manufacturer Manufacturer { get { return manufacturer; } }
}
public Model Model { get { return model; } }
public class MemoryDevice : Structure {
private readonly string manufacturerName;
private readonly string serialNumber;
private readonly string partNumber;
public MemoryDevice(string manufacturerName, string serialNumber,
string partNumber)
: base(0x11, 0, null, null) {
this.manufacturerName = manufacturerName;
this.serialNumber = serialNumber;
this.partNumber = partNumber;
}
public MemoryDevice(byte type, ushort handle, byte[] data,
string[] strings)
: base(type, handle, data, strings) {
this.manufacturerName = GetString(0x17).Trim();
this.serialNumber = GetString(0x18).Trim();
this.partNumber = GetString(0x1A).Trim();
}
public string ManufacturerName { get { return manufacturerName; } }
public string SerialNumber { get { return serialNumber; } }
public string PartNumber { get { return partNumber; } }
}
}

View File

@@ -52,6 +52,7 @@
<CodeAnalysisRuleSet>AllRules.ruleset</CodeAnalysisRuleSet>
</PropertyGroup>
<ItemGroup>
<Reference Include="Microsoft.VisualBasic" />
<Reference Include="System" />
<Reference Include="System.Management" />
</ItemGroup>
@@ -91,8 +92,11 @@
<Compile Include="Hardware\CPU\IntelCPU.cs" />
<Compile Include="Hardware\LPC\NCT677X.cs" />
<Compile Include="Hardware\Mainboard\GigabyteTAMG.cs" />
<Compile Include="Hardware\Mainboard\Identification.cs" />
<Compile Include="Hardware\Opcode.cs" />
<Compile Include="Hardware\OperatingSystem.cs" />
<Compile Include="Hardware\RAM\GenericRAM.cs" />
<Compile Include="Hardware\RAM\RAMGroup.cs" />
<Compile Include="Hardware\Ring0.cs" />
<Compile Include="Hardware\KernelDriver.cs" />
<Compile Include="Hardware\Hardware.cs" />
@@ -120,7 +124,7 @@
<Compile Include="Hardware\Mainboard\MainboardGroup.cs" />
<Compile Include="Hardware\Mainboard\Manufacturer.cs" />
<Compile Include="Hardware\Mainboard\Model.cs" />
<Compile Include="Hardware\Mainboard\SMBIOS.cs" />
<Compile Include="Hardware\SMBIOS.cs" />
<Compile Include="Hardware\Mainboard\SuperIOHardware.cs" />
<Compile Include="Hardware\Nvidia\NVAPI.cs" />
<Compile Include="Hardware\Nvidia\NvidiaGPU.cs" />

View File

@@ -315,6 +315,8 @@ namespace OpenHardwareMonitor.Utilities
return "chip.png";
case HardwareType.TBalancer:
return "bigng.png";
case HardwareType.RAM:
return "chip.png";
default:
return "cpu.png";
}