Changed a few context menu items to display a radio option style. Added additional information from the SMBIOS to the report.
authormoel.mich
Sat, 11 Aug 2012 21:32:59 +0000
changeset 37864d3ddf8d73b
parent 377 6022d558ef7d
child 379 7af3aaeb42e9
Changed a few context menu items to display a radio option style. Added additional information from the SMBIOS to the report.
GUI/MainForm.Designer.cs
GUI/MainForm.cs
Hardware/SMBIOS.cs
Properties/AssemblyVersion.cs
     1.1 --- a/GUI/MainForm.Designer.cs	Thu Jul 26 06:51:19 2012 +0000
     1.2 +++ b/GUI/MainForm.Designer.cs	Sat Aug 11 21:32:59 2012 +0000
     1.3 @@ -54,6 +54,7 @@
     1.4        this.menuItem5 = new System.Windows.Forms.MenuItem();
     1.5        this.mainboardMenuItem = new System.Windows.Forms.MenuItem();
     1.6        this.cpuMenuItem = new System.Windows.Forms.MenuItem();
     1.7 +      this.ramMenuItem = new System.Windows.Forms.MenuItem();
     1.8        this.gpuMenuItem = new System.Windows.Forms.MenuItem();
     1.9        this.fanControllerMenuItem = new System.Windows.Forms.MenuItem();
    1.10        this.hddMenuItem = new System.Windows.Forms.MenuItem();
    1.11 @@ -94,7 +95,6 @@
    1.12        this.timer = new System.Windows.Forms.Timer(this.components);
    1.13        this.splitContainer = new OpenHardwareMonitor.GUI.SplitContainerAdv();
    1.14        this.treeView = new Aga.Controls.Tree.TreeViewAdv();
    1.15 -      this.ramMenuItem = new System.Windows.Forms.MenuItem();
    1.16        this.splitContainer.Panel1.SuspendLayout();
    1.17        this.splitContainer.SuspendLayout();
    1.18        this.SuspendLayout();
    1.19 @@ -244,6 +244,11 @@
    1.20        this.cpuMenuItem.Index = 1;
    1.21        this.cpuMenuItem.Text = "CPU";
    1.22        // 
    1.23 +      // ramMenuItem
    1.24 +      // 
    1.25 +      this.ramMenuItem.Index = 2;
    1.26 +      this.ramMenuItem.Text = "RAM";
    1.27 +      // 
    1.28        // gpuMenuItem
    1.29        // 
    1.30        this.gpuMenuItem.Index = 3;
    1.31 @@ -389,12 +394,14 @@
    1.32        // celsiusMenuItem
    1.33        // 
    1.34        this.celsiusMenuItem.Index = 0;
    1.35 +      this.celsiusMenuItem.RadioCheck = true;
    1.36        this.celsiusMenuItem.Text = "Celsius";
    1.37        this.celsiusMenuItem.Click += new System.EventHandler(this.celsiusMenuItem_Click);
    1.38        // 
    1.39        // fahrenheitMenuItem
    1.40        // 
    1.41        this.fahrenheitMenuItem.Index = 1;
    1.42 +      this.fahrenheitMenuItem.RadioCheck = true;
    1.43        this.fahrenheitMenuItem.Text = "Fahrenheit";
    1.44        this.fahrenheitMenuItem.Click += new System.EventHandler(this.fahrenheitMenuItem_Click);
    1.45        // 
    1.46 @@ -410,16 +417,19 @@
    1.47        // plotWindowMenuItem
    1.48        // 
    1.49        this.plotWindowMenuItem.Index = 0;
    1.50 +      this.plotWindowMenuItem.RadioCheck = true;
    1.51        this.plotWindowMenuItem.Text = "Window";
    1.52        // 
    1.53        // plotBottomMenuItem
    1.54        // 
    1.55        this.plotBottomMenuItem.Index = 1;
    1.56 +      this.plotBottomMenuItem.RadioCheck = true;
    1.57        this.plotBottomMenuItem.Text = "Bottom";
    1.58        // 
    1.59        // plotRightMenuItem
    1.60        // 
    1.61        this.plotRightMenuItem.Index = 2;
    1.62 +      this.plotRightMenuItem.RadioCheck = true;
    1.63        this.plotRightMenuItem.Text = "Right";
    1.64        // 
    1.65        // MenuItem4
    1.66 @@ -527,11 +537,6 @@
    1.67        this.treeView.MouseMove += new System.Windows.Forms.MouseEventHandler(this.treeView_MouseMove);
    1.68        this.treeView.MouseUp += new System.Windows.Forms.MouseEventHandler(this.treeView_MouseUp);
    1.69        // 
    1.70 -      // ramMenuItem
    1.71 -      // 
    1.72 -      this.ramMenuItem.Index = 2;
    1.73 -      this.ramMenuItem.Text = "RAM";
    1.74 -      // 
    1.75        // MainForm
    1.76        // 
    1.77        this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
     2.1 --- a/GUI/MainForm.cs	Thu Jul 26 06:51:19 2012 +0000
     2.2 +++ b/GUI/MainForm.cs	Sat Aug 11 21:32:59 2012 +0000
     2.3 @@ -647,6 +647,7 @@
     2.4                if (i <= control.MaxSoftwareValue &&
     2.5                    i >= control.MinSoftwareValue) {
     2.6                  MenuItem item = new MenuItem(i + " %");
     2.7 +                item.RadioCheck = true;
     2.8                  manualItem.MenuItems.Add(item);
     2.9                  item.Checked = control.ControlMode == ControlMode.Software &&
    2.10                    Math.Round(control.SoftwareValue) == i;
     3.1 --- a/Hardware/SMBIOS.cs	Thu Jul 26 06:51:19 2012 +0000
     3.2 +++ b/Hardware/SMBIOS.cs	Sat Aug 11 21:32:59 2012 +0000
     3.3 @@ -25,6 +25,7 @@
     3.4      private readonly BIOSInformation biosInformation;
     3.5      private readonly SystemInformation systemInformation;
     3.6      private readonly BaseBoardInformation baseBoardInformation;
     3.7 +    private readonly ProcessorInformation processorInformation;
     3.8      private readonly MemoryDevice[] memoryDevices;
     3.9  
    3.10      private static string ReadSysFS(string path) {
    3.11 @@ -84,7 +85,7 @@
    3.12              minorVersion = (byte)mo["SmbiosMinorVersion"];            
    3.13              break;
    3.14            }
    3.15 -        } catch { }
    3.16 +        } catch { }      
    3.17  
    3.18          if (majorVersion > 0 || minorVersion > 0)
    3.19            version = new Version(majorVersion, minorVersion);
    3.20 @@ -129,6 +130,9 @@
    3.21                case 0x02: this.baseBoardInformation = new BaseBoardInformation(
    3.22                    type, handle, data, stringsList.ToArray());
    3.23                  structureList.Add(this.baseBoardInformation); break;
    3.24 +              case 0x04: this.processorInformation = new ProcessorInformation(
    3.25 +                  type, handle, data, stringsList.ToArray());
    3.26 +                structureList.Add(this.processorInformation); break;
    3.27                case 0x11: MemoryDevice m = new MemoryDevice(
    3.28                    type, handle, data, stringsList.ToArray());
    3.29                  memoryDeviceList.Add(m);
    3.30 @@ -178,6 +182,23 @@
    3.31          r.AppendLine();
    3.32        }
    3.33  
    3.34 +      if (Processor != null) {
    3.35 +        r.Append("Processor Manufacturer: ");
    3.36 +        r.AppendLine(Processor.ManufacturerName);
    3.37 +        r.Append("Processor Version: ");
    3.38 +        r.AppendLine(Processor.Version);
    3.39 +        r.Append("Processor Core Count: ");
    3.40 +        r.AppendLine(Processor.CoreCount.ToString());
    3.41 +        r.Append("Processor Core Enabled: ");
    3.42 +        r.AppendLine(Processor.CoreEnabled.ToString());
    3.43 +        r.Append("Processor Thread Count: ");
    3.44 +        r.AppendLine(Processor.ThreadCount.ToString());
    3.45 +        r.Append("Processor External Clock: ");
    3.46 +        r.Append(Processor.ExternalClock);
    3.47 +        r.AppendLine(" Mhz");
    3.48 +        r.AppendLine();
    3.49 +      }
    3.50 +
    3.51        for (int i = 0; i < MemoryDevices.Length; i++) {        
    3.52          r.Append("Memory Device [" + i + "] Manufacturer: ");
    3.53          r.AppendLine(MemoryDevices[i].ManufacturerName);
    3.54 @@ -187,6 +208,9 @@
    3.55          r.AppendLine(MemoryDevices[i].DeviceLocator);
    3.56          r.Append("Memory Device [" + i + "] Bank Locator: ");
    3.57          r.AppendLine(MemoryDevices[i].BankLocator);
    3.58 +        r.Append("Memory Device [" + i + "] Speed: ");
    3.59 +        r.Append(MemoryDevices[i].Speed);
    3.60 +        r.AppendLine(" MHz");
    3.61          r.AppendLine();
    3.62        }
    3.63  
    3.64 @@ -223,6 +247,11 @@
    3.65        get { return baseBoardInformation; }
    3.66      }
    3.67  
    3.68 +
    3.69 +    public ProcessorInformation Processor {
    3.70 +      get { return processorInformation; }
    3.71 +    }
    3.72 +
    3.73      public MemoryDevice[] MemoryDevices {
    3.74        get { return memoryDevices; }
    3.75      }
    3.76 @@ -234,6 +263,20 @@
    3.77        private readonly byte[] data;
    3.78        private readonly string[] strings;
    3.79  
    3.80 +      protected int GetByte(int offset) {
    3.81 +        if (offset < data.Length && offset >= 0)
    3.82 +          return data[offset];
    3.83 +        else
    3.84 +          return 0;
    3.85 +      }
    3.86 +
    3.87 +      protected int GetWord(int offset) {
    3.88 +        if (offset + 1 < data.Length && offset >= 0)
    3.89 +          return (data[offset + 1] << 8) | data[offset];
    3.90 +        else
    3.91 +          return 0;
    3.92 +      }
    3.93 +
    3.94        protected string GetString(int offset) {
    3.95          if (offset < data.Length && data[offset] > 0 &&
    3.96           data[offset] <= strings.Length)
    3.97 @@ -359,13 +402,41 @@
    3.98  
    3.99      }
   3.100  
   3.101 +    public class ProcessorInformation : Structure {
   3.102 +
   3.103 +      public ProcessorInformation(byte type, ushort handle, byte[] data,
   3.104 +        string[] strings)
   3.105 +        : base(type, handle, data, strings) 
   3.106 +      {
   3.107 +        this.ManufacturerName = GetString(0x07).Trim();
   3.108 +        this.Version = GetString(0x10).Trim();
   3.109 +        this.CoreCount = GetByte(0x23);
   3.110 +        this.CoreEnabled = GetByte(0x24);
   3.111 +        this.ThreadCount = GetByte(0x25);
   3.112 +        this.ExternalClock = GetWord(0x12);
   3.113 +      }
   3.114 +
   3.115 +      public string ManufacturerName { get; private set; }
   3.116 +
   3.117 +      public string Version { get; private set; }
   3.118 +
   3.119 +      public int CoreCount { get; private set; }
   3.120 +
   3.121 +      public int CoreEnabled { get; private set; }
   3.122 +
   3.123 +      public int ThreadCount { get; private set; }
   3.124 +     
   3.125 +      public int ExternalClock { get; private set; }
   3.126 +    }
   3.127 +
   3.128      public class MemoryDevice : Structure {
   3.129  
   3.130        private readonly string deviceLocator;
   3.131        private readonly string bankLocator;
   3.132        private readonly string manufacturerName;
   3.133        private readonly string serialNumber;
   3.134 -      private readonly string partNumber;      
   3.135 +      private readonly string partNumber;
   3.136 +      private readonly int speed;
   3.137  
   3.138        public MemoryDevice(byte type, ushort handle, byte[] data,
   3.139          string[] strings)
   3.140 @@ -376,6 +447,7 @@
   3.141          this.manufacturerName = GetString(0x17).Trim();
   3.142          this.serialNumber = GetString(0x18).Trim();
   3.143          this.partNumber = GetString(0x1A).Trim();
   3.144 +        this.speed = GetWord(0x15);
   3.145        }
   3.146  
   3.147        public string DeviceLocator { get { return deviceLocator; } }
   3.148 @@ -388,7 +460,7 @@
   3.149  
   3.150        public string PartNumber { get { return partNumber; } }
   3.151  
   3.152 -       
   3.153 +      public int Speed { get { return speed; } }
   3.154  
   3.155      }
   3.156    }
     4.1 --- a/Properties/AssemblyVersion.cs	Thu Jul 26 06:51:19 2012 +0000
     4.2 +++ b/Properties/AssemblyVersion.cs	Sat Aug 11 21:32:59 2012 +0000
     4.3 @@ -10,5 +10,5 @@
     4.4  
     4.5  using System.Reflection;
     4.6  
     4.7 -[assembly: AssemblyVersion("0.5.1.0")]
     4.8 -[assembly: AssemblyInformationalVersion("0.5.1 Beta")]
     4.9 \ No newline at end of file
    4.10 +[assembly: AssemblyVersion("0.5.1.1")]
    4.11 +[assembly: AssemblyInformationalVersion("0.5.1.1 Alpha")]
    4.12 \ No newline at end of file