# HG changeset patch # User moel.mich # Date 1344720779 0 # Node ID 64d3ddf8d73b8f1a4ccc33bdc0b90d4c3d075294 # Parent 6022d558ef7dcee3b50172297b614ae8e511ea68 Changed a few context menu items to display a radio option style. Added additional information from the SMBIOS to the report. diff -r 6022d558ef7d -r 64d3ddf8d73b GUI/MainForm.Designer.cs --- a/GUI/MainForm.Designer.cs Thu Jul 26 06:51:19 2012 +0000 +++ b/GUI/MainForm.Designer.cs Sat Aug 11 21:32:59 2012 +0000 @@ -54,6 +54,7 @@ this.menuItem5 = new System.Windows.Forms.MenuItem(); this.mainboardMenuItem = new System.Windows.Forms.MenuItem(); this.cpuMenuItem = new System.Windows.Forms.MenuItem(); + this.ramMenuItem = new System.Windows.Forms.MenuItem(); this.gpuMenuItem = new System.Windows.Forms.MenuItem(); this.fanControllerMenuItem = new System.Windows.Forms.MenuItem(); this.hddMenuItem = new System.Windows.Forms.MenuItem(); @@ -94,7 +95,6 @@ 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(); @@ -244,6 +244,11 @@ this.cpuMenuItem.Index = 1; this.cpuMenuItem.Text = "CPU"; // + // ramMenuItem + // + this.ramMenuItem.Index = 2; + this.ramMenuItem.Text = "RAM"; + // // gpuMenuItem // this.gpuMenuItem.Index = 3; @@ -389,12 +394,14 @@ // celsiusMenuItem // this.celsiusMenuItem.Index = 0; + this.celsiusMenuItem.RadioCheck = true; this.celsiusMenuItem.Text = "Celsius"; this.celsiusMenuItem.Click += new System.EventHandler(this.celsiusMenuItem_Click); // // fahrenheitMenuItem // this.fahrenheitMenuItem.Index = 1; + this.fahrenheitMenuItem.RadioCheck = true; this.fahrenheitMenuItem.Text = "Fahrenheit"; this.fahrenheitMenuItem.Click += new System.EventHandler(this.fahrenheitMenuItem_Click); // @@ -410,16 +417,19 @@ // plotWindowMenuItem // this.plotWindowMenuItem.Index = 0; + this.plotWindowMenuItem.RadioCheck = true; this.plotWindowMenuItem.Text = "Window"; // // plotBottomMenuItem // this.plotBottomMenuItem.Index = 1; + this.plotBottomMenuItem.RadioCheck = true; this.plotBottomMenuItem.Text = "Bottom"; // // plotRightMenuItem // this.plotRightMenuItem.Index = 2; + this.plotRightMenuItem.RadioCheck = true; this.plotRightMenuItem.Text = "Right"; // // MenuItem4 @@ -527,11 +537,6 @@ 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); diff -r 6022d558ef7d -r 64d3ddf8d73b GUI/MainForm.cs --- a/GUI/MainForm.cs Thu Jul 26 06:51:19 2012 +0000 +++ b/GUI/MainForm.cs Sat Aug 11 21:32:59 2012 +0000 @@ -647,6 +647,7 @@ if (i <= control.MaxSoftwareValue && i >= control.MinSoftwareValue) { MenuItem item = new MenuItem(i + " %"); + item.RadioCheck = true; manualItem.MenuItems.Add(item); item.Checked = control.ControlMode == ControlMode.Software && Math.Round(control.SoftwareValue) == i; diff -r 6022d558ef7d -r 64d3ddf8d73b Hardware/SMBIOS.cs --- a/Hardware/SMBIOS.cs Thu Jul 26 06:51:19 2012 +0000 +++ b/Hardware/SMBIOS.cs Sat Aug 11 21:32:59 2012 +0000 @@ -25,6 +25,7 @@ private readonly BIOSInformation biosInformation; private readonly SystemInformation systemInformation; private readonly BaseBoardInformation baseBoardInformation; + private readonly ProcessorInformation processorInformation; private readonly MemoryDevice[] memoryDevices; private static string ReadSysFS(string path) { @@ -84,7 +85,7 @@ minorVersion = (byte)mo["SmbiosMinorVersion"]; break; } - } catch { } + } catch { } if (majorVersion > 0 || minorVersion > 0) version = new Version(majorVersion, minorVersion); @@ -129,6 +130,9 @@ case 0x02: this.baseBoardInformation = new BaseBoardInformation( type, handle, data, stringsList.ToArray()); structureList.Add(this.baseBoardInformation); break; + case 0x04: this.processorInformation = new ProcessorInformation( + type, handle, data, stringsList.ToArray()); + structureList.Add(this.processorInformation); break; case 0x11: MemoryDevice m = new MemoryDevice( type, handle, data, stringsList.ToArray()); memoryDeviceList.Add(m); @@ -178,6 +182,23 @@ r.AppendLine(); } + if (Processor != null) { + r.Append("Processor Manufacturer: "); + r.AppendLine(Processor.ManufacturerName); + r.Append("Processor Version: "); + r.AppendLine(Processor.Version); + r.Append("Processor Core Count: "); + r.AppendLine(Processor.CoreCount.ToString()); + r.Append("Processor Core Enabled: "); + r.AppendLine(Processor.CoreEnabled.ToString()); + r.Append("Processor Thread Count: "); + r.AppendLine(Processor.ThreadCount.ToString()); + r.Append("Processor External Clock: "); + r.Append(Processor.ExternalClock); + r.AppendLine(" Mhz"); + r.AppendLine(); + } + for (int i = 0; i < MemoryDevices.Length; i++) { r.Append("Memory Device [" + i + "] Manufacturer: "); r.AppendLine(MemoryDevices[i].ManufacturerName); @@ -187,6 +208,9 @@ r.AppendLine(MemoryDevices[i].DeviceLocator); r.Append("Memory Device [" + i + "] Bank Locator: "); r.AppendLine(MemoryDevices[i].BankLocator); + r.Append("Memory Device [" + i + "] Speed: "); + r.Append(MemoryDevices[i].Speed); + r.AppendLine(" MHz"); r.AppendLine(); } @@ -223,6 +247,11 @@ get { return baseBoardInformation; } } + + public ProcessorInformation Processor { + get { return processorInformation; } + } + public MemoryDevice[] MemoryDevices { get { return memoryDevices; } } @@ -234,6 +263,20 @@ private readonly byte[] data; private readonly string[] strings; + protected int GetByte(int offset) { + if (offset < data.Length && offset >= 0) + return data[offset]; + else + return 0; + } + + protected int GetWord(int offset) { + if (offset + 1 < data.Length && offset >= 0) + return (data[offset + 1] << 8) | data[offset]; + else + return 0; + } + protected string GetString(int offset) { if (offset < data.Length && data[offset] > 0 && data[offset] <= strings.Length) @@ -359,13 +402,41 @@ } + public class ProcessorInformation : Structure { + + public ProcessorInformation(byte type, ushort handle, byte[] data, + string[] strings) + : base(type, handle, data, strings) + { + this.ManufacturerName = GetString(0x07).Trim(); + this.Version = GetString(0x10).Trim(); + this.CoreCount = GetByte(0x23); + this.CoreEnabled = GetByte(0x24); + this.ThreadCount = GetByte(0x25); + this.ExternalClock = GetWord(0x12); + } + + public string ManufacturerName { get; private set; } + + public string Version { get; private set; } + + public int CoreCount { get; private set; } + + public int CoreEnabled { get; private set; } + + public int ThreadCount { get; private set; } + + public int ExternalClock { get; private set; } + } + public class MemoryDevice : Structure { private readonly string deviceLocator; private readonly string bankLocator; private readonly string manufacturerName; private readonly string serialNumber; - private readonly string partNumber; + private readonly string partNumber; + private readonly int speed; public MemoryDevice(byte type, ushort handle, byte[] data, string[] strings) @@ -376,6 +447,7 @@ this.manufacturerName = GetString(0x17).Trim(); this.serialNumber = GetString(0x18).Trim(); this.partNumber = GetString(0x1A).Trim(); + this.speed = GetWord(0x15); } public string DeviceLocator { get { return deviceLocator; } } @@ -388,7 +460,7 @@ public string PartNumber { get { return partNumber; } } - + public int Speed { get { return speed; } } } } diff -r 6022d558ef7d -r 64d3ddf8d73b Properties/AssemblyVersion.cs --- a/Properties/AssemblyVersion.cs Thu Jul 26 06:51:19 2012 +0000 +++ b/Properties/AssemblyVersion.cs Sat Aug 11 21:32:59 2012 +0000 @@ -10,5 +10,5 @@ using System.Reflection; -[assembly: AssemblyVersion("0.5.1.0")] -[assembly: AssemblyInformationalVersion("0.5.1 Beta")] \ No newline at end of file +[assembly: AssemblyVersion("0.5.1.1")] +[assembly: AssemblyInformationalVersion("0.5.1.1 Alpha")] \ No newline at end of file