Initial commit.
authormoel.mich
Tue, 26 Jan 2010 22:37:48 +0000
changeset 1361e324a0ed4
parent 0 77e062628ef5
child 2 105939e4eb7e
Initial commit.
External/Aga.Controls.dll
External/WinRing0.dll
External/WinRing0.sys
External/WinRing0.vxd
External/WinRing0x64.dll
External/WinRing0x64.sys
GUI/AboutBox.Designer.cs
GUI/AboutBox.cs
GUI/AboutBox.resources
GUI/AboutBox.resx
GUI/HardwareNode.cs
GUI/LicenseBox.resources
GUI/MainForm.Designer.cs
GUI/MainForm.cs
GUI/MainForm.resources
GUI/MainForm.resx
GUI/PlotPanel.Designer.cs
GUI/PlotPanel.cs
GUI/PlotPanel.resources
GUI/PlotPanel.resx
GUI/SensorNode.cs
GUI/TypeNode.cs
Hardware/ATI/ADL.cs
Hardware/ATI/ATIGPU.cs
Hardware/ATI/ATIGroup.cs
Hardware/CPU/AMD10CPU.cs
Hardware/CPU/CPUGroup.cs
Hardware/CPU/IntelCPU.cs
Hardware/HDD/HDD.cs
Hardware/HDD/HDDGroup.cs
Hardware/HDD/SMART.cs
Hardware/IGroup.cs
Hardware/IHardware.cs
Hardware/ISensor.cs
Hardware/LPC/Chip.cs
Hardware/LPC/IT87.cs
Hardware/LPC/LPCGroup.cs
Hardware/LPC/W83627DHG.cs
Hardware/Nvidia/NVAPI.cs
Hardware/Nvidia/NvidiaGPU.cs
Hardware/Nvidia/NvidiaGroup.cs
Hardware/ReportWriter.cs
Hardware/SMBIOS/SMBIOSGroup.cs
Hardware/Sensor.cs
Hardware/TBalancer/TBalancer.cs
Hardware/TBalancer/TBalancerGroup.cs
Hardware/WinRing0.cs
Licenses/Aga.Controls.License.txt
Licenses/OpenHardwareMonitor.License.txt
Licenses/WinRing0.License.txt
OpenHardwareMonitor.csproj
OpenHardwareMonitor.sln
Program.cs
Properties/AssemblyInfo.cs
Resources/ati.png
Resources/bigng.png
Resources/chip.png
Resources/clock.png
Resources/computer.png
Resources/cpu.png
Resources/fan.png
Resources/hdd.png
Resources/icon.ico
Resources/icon.xcf
Resources/nvidia.png
Resources/temperature.png
Resources/voltage.png
Utilities/Configuration.cs
Utilities/CrashReport.cs
Utilities/EmbeddedResources.cs
Utilities/PInvokeDelegateFactory.cs
     1.1 Binary file External/Aga.Controls.dll has changed
     2.1 Binary file External/WinRing0.dll has changed
     3.1 Binary file External/WinRing0.sys has changed
     4.1 Binary file External/WinRing0.vxd has changed
     5.1 Binary file External/WinRing0x64.dll has changed
     6.1 Binary file External/WinRing0x64.sys has changed
     7.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     7.2 +++ b/GUI/AboutBox.Designer.cs	Tue Jan 26 22:37:48 2010 +0000
     7.3 @@ -0,0 +1,214 @@
     7.4 +/*
     7.5 +  
     7.6 +  Version: MPL 1.1/GPL 2.0/LGPL 2.1
     7.7 +
     7.8 +  The contents of this file are subject to the Mozilla Public License Version
     7.9 +  1.1 (the "License"); you may not use this file except in compliance with
    7.10 +  the License. You may obtain a copy of the License at
    7.11 + 
    7.12 +  http://www.mozilla.org/MPL/
    7.13 +
    7.14 +  Software distributed under the License is distributed on an "AS IS" basis,
    7.15 +  WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
    7.16 +  for the specific language governing rights and limitations under the License.
    7.17 +
    7.18 +  The Original Code is the Open Hardware Monitor code.
    7.19 +
    7.20 +  The Initial Developer of the Original Code is 
    7.21 +  Michael Möller <m.moeller@gmx.ch>.
    7.22 +  Portions created by the Initial Developer are Copyright (C) 2009-2010
    7.23 +  the Initial Developer. All Rights Reserved.
    7.24 +
    7.25 +  Contributor(s):
    7.26 +
    7.27 +  Alternatively, the contents of this file may be used under the terms of
    7.28 +  either the GNU General Public License Version 2 or later (the "GPL"), or
    7.29 +  the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
    7.30 +  in which case the provisions of the GPL or the LGPL are applicable instead
    7.31 +  of those above. If you wish to allow use of your version of this file only
    7.32 +  under the terms of either the GPL or the LGPL, and not to allow others to
    7.33 +  use your version of this file under the terms of the MPL, indicate your
    7.34 +  decision by deleting the provisions above and replace them with the notice
    7.35 +  and other provisions required by the GPL or the LGPL. If you do not delete
    7.36 +  the provisions above, a recipient may use your version of this file under
    7.37 +  the terms of any one of the MPL, the GPL or the LGPL.
    7.38 + 
    7.39 +*/
    7.40 +
    7.41 +namespace OpenHardwareMonitor.GUI {
    7.42 +  partial class AboutBox {
    7.43 +    /// <summary>
    7.44 +    /// Required designer variable.
    7.45 +    /// </summary>
    7.46 +    private System.ComponentModel.IContainer components = null;
    7.47 +
    7.48 +    /// <summary>
    7.49 +    /// Clean up any resources being used.
    7.50 +    /// </summary>
    7.51 +    /// <param name="disposing">true if managed resources should be disposed; otherwise, false.</param>
    7.52 +    protected override void Dispose(bool disposing) {
    7.53 +      if (disposing && (components != null)) {
    7.54 +        components.Dispose();
    7.55 +      }
    7.56 +      base.Dispose(disposing);
    7.57 +    }
    7.58 +
    7.59 +    #region Windows Form Designer generated code
    7.60 +
    7.61 +    /// <summary>
    7.62 +    /// Required method for Designer support - do not modify
    7.63 +    /// the contents of this method with the code editor.
    7.64 +    /// </summary>
    7.65 +    private void InitializeComponent() {
    7.66 +      System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(AboutBox));
    7.67 +      this.okButton = new System.Windows.Forms.Button();
    7.68 +      this.pictureBox1 = new System.Windows.Forms.PictureBox();
    7.69 +      this.label1 = new System.Windows.Forms.Label();
    7.70 +      this.label2 = new System.Windows.Forms.Label();
    7.71 +      this.label3 = new System.Windows.Forms.Label();
    7.72 +      this.label4 = new System.Windows.Forms.Label();
    7.73 +      this.linkLabel = new System.Windows.Forms.LinkLabel();
    7.74 +      this.label5 = new System.Windows.Forms.Label();
    7.75 +      this.flowLayoutPanel1 = new System.Windows.Forms.FlowLayoutPanel();
    7.76 +      ((System.ComponentModel.ISupportInitialize)(this.pictureBox1)).BeginInit();
    7.77 +      this.flowLayoutPanel1.SuspendLayout();
    7.78 +      this.SuspendLayout();
    7.79 +      // 
    7.80 +      // okButton
    7.81 +      // 
    7.82 +      this.okButton.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Right)));
    7.83 +      this.okButton.DialogResult = System.Windows.Forms.DialogResult.Cancel;
    7.84 +      this.okButton.Location = new System.Drawing.Point(305, 142);
    7.85 +      this.okButton.Name = "okButton";
    7.86 +      this.okButton.Size = new System.Drawing.Size(87, 27);
    7.87 +      this.okButton.TabIndex = 0;
    7.88 +      this.okButton.Text = "OK";
    7.89 +      this.okButton.UseVisualStyleBackColor = true;
    7.90 +      // 
    7.91 +      // pictureBox1
    7.92 +      // 
    7.93 +      this.pictureBox1.Image = ((System.Drawing.Image)(resources.GetObject("pictureBox1.Image")));
    7.94 +      this.pictureBox1.Location = new System.Drawing.Point(12, 13);
    7.95 +      this.pictureBox1.Name = "pictureBox1";
    7.96 +      this.pictureBox1.Size = new System.Drawing.Size(56, 56);
    7.97 +      this.pictureBox1.SizeMode = System.Windows.Forms.PictureBoxSizeMode.Zoom;
    7.98 +      this.pictureBox1.TabIndex = 1;
    7.99 +      this.pictureBox1.TabStop = false;
   7.100 +      // 
   7.101 +      // label1
   7.102 +      // 
   7.103 +      this.label1.AutoSize = true;
   7.104 +      this.label1.Font = new System.Drawing.Font("Segoe UI", 11F, System.Drawing.FontStyle.Bold);
   7.105 +      this.label1.Location = new System.Drawing.Point(85, 13);
   7.106 +      this.label1.Margin = new System.Windows.Forms.Padding(12, 0, 12, 0);
   7.107 +      this.label1.Name = "label1";
   7.108 +      this.label1.Size = new System.Drawing.Size(179, 20);
   7.109 +      this.label1.TabIndex = 2;
   7.110 +      this.label1.Text = "Open Hardware Monitor";
   7.111 +      // 
   7.112 +      // label2
   7.113 +      // 
   7.114 +      this.label2.AutoSize = true;
   7.115 +      this.label2.Location = new System.Drawing.Point(86, 54);
   7.116 +      this.label2.Margin = new System.Windows.Forms.Padding(12, 0, 12, 0);
   7.117 +      this.label2.Name = "label2";
   7.118 +      this.label2.Size = new System.Drawing.Size(315, 15);
   7.119 +      this.label2.TabIndex = 3;
   7.120 +      this.label2.Text = "Copyright © 2009-2010 Michael Möller. All rights reserved.";
   7.121 +      // 
   7.122 +      // label3
   7.123 +      // 
   7.124 +      this.label3.AutoSize = true;
   7.125 +      this.label3.Location = new System.Drawing.Point(86, 36);
   7.126 +      this.label3.Margin = new System.Windows.Forms.Padding(12, 0, 12, 0);
   7.127 +      this.label3.Name = "label3";
   7.128 +      this.label3.Size = new System.Drawing.Size(90, 15);
   7.129 +      this.label3.TabIndex = 4;
   7.130 +      this.label3.Text = "Version 0.1 Beta";
   7.131 +      // 
   7.132 +      // label4
   7.133 +      // 
   7.134 +      this.label4.AutoSize = true;
   7.135 +      this.label4.Location = new System.Drawing.Point(9, 95);
   7.136 +      this.label4.Margin = new System.Windows.Forms.Padding(12, 0, 12, 0);
   7.137 +      this.label4.Name = "label4";
   7.138 +      this.label4.Size = new System.Drawing.Size(412, 15);
   7.139 +      this.label4.TabIndex = 5;
   7.140 +      this.label4.Text = "The source code is available under the terms of the Mozilla Public License 1.1";
   7.141 +      // 
   7.142 +      // linkLabel
   7.143 +      // 
   7.144 +      this.linkLabel.AutoSize = true;
   7.145 +      this.linkLabel.Location = new System.Drawing.Point(145, 0);
   7.146 +      this.linkLabel.Margin = new System.Windows.Forms.Padding(0, 0, 12, 0);
   7.147 +      this.linkLabel.Name = "linkLabel";
   7.148 +      this.linkLabel.Size = new System.Drawing.Size(176, 15);
   7.149 +      this.linkLabel.TabIndex = 6;
   7.150 +      this.linkLabel.TabStop = true;
   7.151 +      this.linkLabel.Text = "Open Hardware Monitor Project";
   7.152 +      this.linkLabel.LinkClicked += new System.Windows.Forms.LinkLabelLinkClickedEventHandler(this.linkLabel1_LinkClicked);
   7.153 +      // 
   7.154 +      // label5
   7.155 +      // 
   7.156 +      this.label5.AutoSize = true;
   7.157 +      this.label5.Location = new System.Drawing.Point(0, 0);
   7.158 +      this.label5.Margin = new System.Windows.Forms.Padding(0, 0, 3, 0);
   7.159 +      this.label5.Name = "label5";
   7.160 +      this.label5.Size = new System.Drawing.Size(142, 15);
   7.161 +      this.label5.TabIndex = 7;
   7.162 +      this.label5.Text = "from the project website: ";
   7.163 +      // 
   7.164 +      // flowLayoutPanel1
   7.165 +      // 
   7.166 +      this.flowLayoutPanel1.AutoSize = true;
   7.167 +      this.flowLayoutPanel1.AutoSizeMode = System.Windows.Forms.AutoSizeMode.GrowAndShrink;
   7.168 +      this.flowLayoutPanel1.Controls.Add(this.label5);
   7.169 +      this.flowLayoutPanel1.Controls.Add(this.linkLabel);
   7.170 +      this.flowLayoutPanel1.Location = new System.Drawing.Point(12, 115);
   7.171 +      this.flowLayoutPanel1.Margin = new System.Windows.Forms.Padding(12, 0, 12, 0);
   7.172 +      this.flowLayoutPanel1.Name = "flowLayoutPanel1";
   7.173 +      this.flowLayoutPanel1.Size = new System.Drawing.Size(333, 15);
   7.174 +      this.flowLayoutPanel1.TabIndex = 8;
   7.175 +      // 
   7.176 +      // AboutBox
   7.177 +      // 
   7.178 +      this.AcceptButton = this.okButton;
   7.179 +      this.AutoScaleDimensions = new System.Drawing.SizeF(7F, 15F);
   7.180 +      this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
   7.181 +      this.AutoSize = true;
   7.182 +      this.ClientSize = new System.Drawing.Size(404, 182);
   7.183 +      this.Controls.Add(this.flowLayoutPanel1);
   7.184 +      this.Controls.Add(this.label4);
   7.185 +      this.Controls.Add(this.label3);
   7.186 +      this.Controls.Add(this.label2);
   7.187 +      this.Controls.Add(this.label1);
   7.188 +      this.Controls.Add(this.pictureBox1);
   7.189 +      this.Controls.Add(this.okButton);
   7.190 +      this.Font = new System.Drawing.Font("Segoe UI", 9F);
   7.191 +      this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.FixedDialog;
   7.192 +      this.MaximizeBox = false;
   7.193 +      this.MinimizeBox = false;
   7.194 +      this.Name = "AboutBox";
   7.195 +      this.StartPosition = System.Windows.Forms.FormStartPosition.CenterParent;
   7.196 +      this.Text = "About";
   7.197 +      ((System.ComponentModel.ISupportInitialize)(this.pictureBox1)).EndInit();
   7.198 +      this.flowLayoutPanel1.ResumeLayout(false);
   7.199 +      this.flowLayoutPanel1.PerformLayout();
   7.200 +      this.ResumeLayout(false);
   7.201 +      this.PerformLayout();
   7.202 +
   7.203 +    }
   7.204 +
   7.205 +    #endregion
   7.206 +
   7.207 +    private System.Windows.Forms.Button okButton;
   7.208 +    private System.Windows.Forms.PictureBox pictureBox1;
   7.209 +    private System.Windows.Forms.Label label1;
   7.210 +    private System.Windows.Forms.Label label2;
   7.211 +    private System.Windows.Forms.Label label3;
   7.212 +    private System.Windows.Forms.Label label4;
   7.213 +    private System.Windows.Forms.LinkLabel linkLabel;
   7.214 +    private System.Windows.Forms.Label label5;
   7.215 +    private System.Windows.Forms.FlowLayoutPanel flowLayoutPanel1;
   7.216 +  }
   7.217 +}
   7.218 \ No newline at end of file
     8.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     8.2 +++ b/GUI/AboutBox.cs	Tue Jan 26 22:37:48 2010 +0000
     8.3 @@ -0,0 +1,63 @@
     8.4 +/*
     8.5 +  
     8.6 +  Version: MPL 1.1/GPL 2.0/LGPL 2.1
     8.7 +
     8.8 +  The contents of this file are subject to the Mozilla Public License Version
     8.9 +  1.1 (the "License"); you may not use this file except in compliance with
    8.10 +  the License. You may obtain a copy of the License at
    8.11 + 
    8.12 +  http://www.mozilla.org/MPL/
    8.13 +
    8.14 +  Software distributed under the License is distributed on an "AS IS" basis,
    8.15 +  WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
    8.16 +  for the specific language governing rights and limitations under the License.
    8.17 +
    8.18 +  The Original Code is the Open Hardware Monitor code.
    8.19 +
    8.20 +  The Initial Developer of the Original Code is 
    8.21 +  Michael Möller <m.moeller@gmx.ch>.
    8.22 +  Portions created by the Initial Developer are Copyright (C) 2009-2010
    8.23 +  the Initial Developer. All Rights Reserved.
    8.24 +
    8.25 +  Contributor(s):
    8.26 +
    8.27 +  Alternatively, the contents of this file may be used under the terms of
    8.28 +  either the GNU General Public License Version 2 or later (the "GPL"), or
    8.29 +  the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
    8.30 +  in which case the provisions of the GPL or the LGPL are applicable instead
    8.31 +  of those above. If you wish to allow use of your version of this file only
    8.32 +  under the terms of either the GPL or the LGPL, and not to allow others to
    8.33 +  use your version of this file under the terms of the MPL, indicate your
    8.34 +  decision by deleting the provisions above and replace them with the notice
    8.35 +  and other provisions required by the GPL or the LGPL. If you do not delete
    8.36 +  the provisions above, a recipient may use your version of this file under
    8.37 +  the terms of any one of the MPL, the GPL or the LGPL.
    8.38 + 
    8.39 +*/
    8.40 +
    8.41 +using System;
    8.42 +using System.Collections.Generic;
    8.43 +using System.ComponentModel;
    8.44 +using System.Diagnostics;
    8.45 +using System.Drawing;
    8.46 +using System.Windows.Forms;
    8.47 +
    8.48 +namespace OpenHardwareMonitor.GUI {
    8.49 +  public partial class AboutBox : Form {
    8.50 +    public AboutBox() {
    8.51 +      InitializeComponent();
    8.52 +      this.Font = SystemFonts.MessageBoxFont;
    8.53 +
    8.54 +      linkLabel.Links.Remove(linkLabel.Links[0]);
    8.55 +      linkLabel.Links.Add(0, linkLabel.Text.Length,
    8.56 +        "http://openhardwaremonitor.org");
    8.57 +
    8.58 +    }
    8.59 +
    8.60 +    private void linkLabel1_LinkClicked(object sender, 
    8.61 +      LinkLabelLinkClickedEventArgs e) {
    8.62 +      Process.Start(new ProcessStartInfo(e.Link.LinkData.ToString()));
    8.63 +    }
    8.64 +
    8.65 +  }
    8.66 +}
     9.1 Binary file GUI/AboutBox.resources has changed
    10.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
    10.2 +++ b/GUI/AboutBox.resx	Tue Jan 26 22:37:48 2010 +0000
    10.3 @@ -0,0 +1,185 @@
    10.4 +<?xml version="1.0" encoding="utf-8"?>
    10.5 +<root>
    10.6 +  <!-- 
    10.7 +    Microsoft ResX Schema 
    10.8 +    
    10.9 +    Version 2.0
   10.10 +    
   10.11 +    The primary goals of this format is to allow a simple XML format 
   10.12 +    that is mostly human readable. The generation and parsing of the 
   10.13 +    various data types are done through the TypeConverter classes 
   10.14 +    associated with the data types.
   10.15 +    
   10.16 +    Example:
   10.17 +    
   10.18 +    ... ado.net/XML headers & schema ...
   10.19 +    <resheader name="resmimetype">text/microsoft-resx</resheader>
   10.20 +    <resheader name="version">2.0</resheader>
   10.21 +    <resheader name="reader">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader>
   10.22 +    <resheader name="writer">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader>
   10.23 +    <data name="Name1"><value>this is my long string</value><comment>this is a comment</comment></data>
   10.24 +    <data name="Color1" type="System.Drawing.Color, System.Drawing">Blue</data>
   10.25 +    <data name="Bitmap1" mimetype="application/x-microsoft.net.object.binary.base64">
   10.26 +        <value>[base64 mime encoded serialized .NET Framework object]</value>
   10.27 +    </data>
   10.28 +    <data name="Icon1" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
   10.29 +        <value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value>
   10.30 +        <comment>This is a comment</comment>
   10.31 +    </data>
   10.32 +                
   10.33 +    There are any number of "resheader" rows that contain simple 
   10.34 +    name/value pairs.
   10.35 +    
   10.36 +    Each data row contains a name, and value. The row also contains a 
   10.37 +    type or mimetype. Type corresponds to a .NET class that support 
   10.38 +    text/value conversion through the TypeConverter architecture. 
   10.39 +    Classes that don't support this are serialized and stored with the 
   10.40 +    mimetype set.
   10.41 +    
   10.42 +    The mimetype is used for serialized objects, and tells the 
   10.43 +    ResXResourceReader how to depersist the object. This is currently not 
   10.44 +    extensible. For a given mimetype the value must be set accordingly:
   10.45 +    
   10.46 +    Note - application/x-microsoft.net.object.binary.base64 is the format 
   10.47 +    that the ResXResourceWriter will generate, however the reader can 
   10.48 +    read any of the formats listed below.
   10.49 +    
   10.50 +    mimetype: application/x-microsoft.net.object.binary.base64
   10.51 +    value   : The object must be serialized with 
   10.52 +            : System.Runtime.Serialization.Formatters.Binary.BinaryFormatter
   10.53 +            : and then encoded with base64 encoding.
   10.54 +    
   10.55 +    mimetype: application/x-microsoft.net.object.soap.base64
   10.56 +    value   : The object must be serialized with 
   10.57 +            : System.Runtime.Serialization.Formatters.Soap.SoapFormatter
   10.58 +            : and then encoded with base64 encoding.
   10.59 +
   10.60 +    mimetype: application/x-microsoft.net.object.bytearray.base64
   10.61 +    value   : The object must be serialized into a byte array 
   10.62 +            : using a System.ComponentModel.TypeConverter
   10.63 +            : and then encoded with base64 encoding.
   10.64 +    -->
   10.65 +  <xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
   10.66 +    <xsd:import namespace="http://www.w3.org/XML/1998/namespace" />
   10.67 +    <xsd:element name="root" msdata:IsDataSet="true">
   10.68 +      <xsd:complexType>
   10.69 +        <xsd:choice maxOccurs="unbounded">
   10.70 +          <xsd:element name="metadata">
   10.71 +            <xsd:complexType>
   10.72 +              <xsd:sequence>
   10.73 +                <xsd:element name="value" type="xsd:string" minOccurs="0" />
   10.74 +              </xsd:sequence>
   10.75 +              <xsd:attribute name="name" use="required" type="xsd:string" />
   10.76 +              <xsd:attribute name="type" type="xsd:string" />
   10.77 +              <xsd:attribute name="mimetype" type="xsd:string" />
   10.78 +              <xsd:attribute ref="xml:space" />
   10.79 +            </xsd:complexType>
   10.80 +          </xsd:element>
   10.81 +          <xsd:element name="assembly">
   10.82 +            <xsd:complexType>
   10.83 +              <xsd:attribute name="alias" type="xsd:string" />
   10.84 +              <xsd:attribute name="name" type="xsd:string" />
   10.85 +            </xsd:complexType>
   10.86 +          </xsd:element>
   10.87 +          <xsd:element name="data">
   10.88 +            <xsd:complexType>
   10.89 +              <xsd:sequence>
   10.90 +                <xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
   10.91 +                <xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" />
   10.92 +              </xsd:sequence>
   10.93 +              <xsd:attribute name="name" type="xsd:string" use="required" msdata:Ordinal="1" />
   10.94 +              <xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" />
   10.95 +              <xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" />
   10.96 +              <xsd:attribute ref="xml:space" />
   10.97 +            </xsd:complexType>
   10.98 +          </xsd:element>
   10.99 +          <xsd:element name="resheader">
  10.100 +            <xsd:complexType>
  10.101 +              <xsd:sequence>
  10.102 +                <xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
  10.103 +              </xsd:sequence>
  10.104 +              <xsd:attribute name="name" type="xsd:string" use="required" />
  10.105 +            </xsd:complexType>
  10.106 +          </xsd:element>
  10.107 +        </xsd:choice>
  10.108 +      </xsd:complexType>
  10.109 +    </xsd:element>
  10.110 +  </xsd:schema>
  10.111 +  <resheader name="resmimetype">
  10.112 +    <value>text/microsoft-resx</value>
  10.113 +  </resheader>
  10.114 +  <resheader name="version">
  10.115 +    <value>2.0</value>
  10.116 +  </resheader>
  10.117 +  <resheader name="reader">
  10.118 +    <value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
  10.119 +  </resheader>
  10.120 +  <resheader name="writer">
  10.121 +    <value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
  10.122 +  </resheader>
  10.123 +  <assembly alias="System.Drawing" name="System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" />
  10.124 +  <data name="pictureBox1.Image" type="System.Drawing.Bitmap, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
  10.125 +    <value>
  10.126 +        iVBORw0KGgoAAAANSUhEUgAAADAAAAAwCAYAAABXAvmHAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8
  10.127 +        YQUAAAAJcEhZcwAADrwAAA68AZW8ckkAAA2KSURBVGhD7VnpU9RXFp2ZL6kkxiSVVBIVWRvoZhUVUUBA
  10.128 +        FBdQgbCq4BKVycQyxl1UFsV9QRQQxIgR9wX33YiJOlHjxESjpmKSqtF8yX9x55z7fr+mUSfprvliTcWq
  10.129 +        V02VSt9z77nn3nfeX/7y558/M/BnBv7/MtDYuFW2bKnH2SKb6jbJxo0bZe3atbJq9WpZuXKl1CxfLlXV
  10.130 +        VbJ0aYWUly+WBQsWyLx582TOnDky65NPZMaMGfLhhx/K9LLpMnXaVJkyZYpMmjhRSkpKpLi4WAryC+T9
  10.131 +        9/MkJydHxowZI1lZWTJy5EgZOmyoDBkyRFJTUyV5cLIMGjRIBgwYIH379pW4uDhBpv9qnd9POgMvKMjH
  10.132 +        KdDPvLw8fOH7kpubK9nZ2TJ27Fj94tGjR+PLM2XUqCycURrEiOHDJSMjQ4YOtYNJk5SUFBmcMliSk5Ml
  10.133 +        MTFRAxs4cKAG169/P4lDgH369JHY2FiJiYmR6OhoPS5XpISFucQRGq5/h6i743TDeQnnb/8VRX19vRQV
  10.134 +        FSFb46QIGePPhYWFCsgAyXkGSGamATFixAgZDhDDMoZJenq6pFkZTUFWBw8miCQFoQASEiS+f3/p168f
  10.135 +        shwnsRaI6OgYiYqKFicAHKp9T0IBgIBeeeWVvq+++mrUyy+/3NMC8XwMBMDgx48fL+PGjdOyFwJEPgCw
  10.136 +        GqxETrYNwqqEBYBVUADDCMCjCqkpkuIBgFVIGJgg/ePj3QDsKhBAY/W74gyPRgUiJdThlMjISEHwRa+9
  10.137 +        9tpogrAqQUo9+4cUYvATJkzQz2KA0CoUFEp+fr7kogoE4EmlzMxMGTkKFLIroABQgbQ05bTSCACSkpI6
  10.138 +        KYQK9HdXoJNGUVGxEhkRI+HOaK1AWLhTXE6XdOvWbVr37t2LXn/99b4WnZ4PoG5THYIvlZLSUgXhrgJo
  10.139 +        lJePCgAAe2EMeiFrdJZo8Mr/EZIxDPxH4OmgzvOCT7T4nwD+x7uzb5o0tk+scj06OlYrEO6MQvAuCUUf
  10.140 +        hIeHE0AZAIwDgH6/C6C2tlZKJpbIRCqHXQX2AgHkMfixkgnlYLYNVexMI8toVGY5Gefpho3vHy/9+xnO
  10.141 +        M2CbMnbz6mcsmxg9AM47IyJl6zIACXOCSmHeA9iwYYOUlk40AErsKkD+AIC0KSwqlP3798vevXtlz549
  10.142 +        0tbWJp999pl8+umn0tzcLOyhTZtqVXpXrlgp1dXVsnTJEpXb2XNmy8yZM6Ws7O/ywQcf4HtKlaYEFRUd
  10.143 +        JdGeKhRhKuAICxeHw+E9gPXr18vESZNUu/kFpBGbmvwvRi/wz6+//irff/+9fPvtt/L111/LjRv/lKtf
  10.144 +        filXOq7IhQsX5MyZM3L8+HE50n5EDuzbpyBbd7TKtm3bpKG+Qerq6oTfs2rVKlm2bBlmylJQKE6ikPWo
  10.145 +        qChVoQiPCgQHB3sPgJmbPHmyTAIIVsEAKNbBc/DgQfntt9/k4cOHAHBPAdy+fVu++uoruXr1qnR0dCiA
  10.146 +        06dPK4DDR47IPlSrrW2X7Nixw12hWqtCK1askOqqKlmCCmWhl5xOozgEQQARrgjw3yUBAQHeA1izZs0z
  10.147 +        AIqKirVpSZ3Hjx/Lox8fyYMHD+S7776Tb775Rm7cvCnXrl2TK1c65OLFi6YCJ45LOyqw/wABoAKtVgUa
  10.148 +        SLFNsm7dOjfFKioqVX7DwsM06IhIc1wul4Ly9+/tPYDVq1d2BQCOsoE5efeBDo+fPJaffvpJq3D37l0F
  10.149 +        cAsArl+/DgBX5NKlS3Lm7Bk5ceIEALTLgQMHZPfu3R4AGjoBYDVhj1RUVqgYsFkZMAOPiOgE4Ofn5z0A
  10.150 +        lrULhQCAk5g7Cxv3yZMn8vPPP8vDHwDg3l25c4cAbimAL74AgIuX5OyZs24A+wGg7SkAdVqB9ditVimA
  10.151 +        yspKyG4qpm4o5NMAcHkA6NWrly8AatwAqEZUCa4RWZi2BoCpwAOPCtxkBZRCV+TiJUOhrhXwpJBdAQKw
  10.152 +        K1CpuxLVhprfBQAGWc8ePbwHsBzbJlWIDVwKGR033ihQ5qhMBfBv9sCjH+W+3QP/Qg/cuKE90AEVcvcA
  10.153 +        mlh7QJu4DU3cKs1QofqG51CookIntCMkxACwq4BKhOO89+573gNgSRm8mQMlOom5A3FZo+7/8ssvoM8P
  10.154 +        cu/e81Toslw4f96tQkcsFdq1y1OFtgiHJdVOVQirOSnE7dQRYipg94FWAuedd97xHkAVZI36rzOADQwJ
  10.155 +        5RZqA3j06JHcv3/frUC3bpkGvnz5MrhvqMPA2bx7VP+NfPI0NTXpPWMjAKxZu0ZqamqE31eBCnAvCrEq
  10.156 +        4AmAP7/11luCFcK7VaIC2WDmSyYw+2hgDC9uoNx3SCFbfe7cuYMhZs+Aa3IOmWfg+w+CMlbTkjr8Pzt3
  10.157 +        7pTtLdtl69ZGqdu8WTbgkrQack26MvscZFypDYBOJSKVnC6nvPnmm94D4C8b77EDFRYW6BDj7kMKkToM
  10.158 +        ngOM3L9+/RrU5wsdYCdOnrSk86AGzhVj+/bt0rS1SVo4hcn/p6Yws89Bxt2IACilVCKnzgAzB9544w3v
  10.159 +        ASxZsljGg/fkPtfoAjRwdk62Dpq2XW1mfbiN9eEmg78uX2KF6LjcIWfPnpVjx47J4cOH3I1rD6/GxkYN
  10.160 +        nldV8l+HmKVATNji8kUGQLAB4ITyRBCEnnAG7z2A8vJyXR3sm5jZQA0AUoHBc3Vg5k3wl1V5Tp061cn9
  10.161 +        vXs6sw/ec8Ej9+s21+kdm9Pe8L9SlixeLIsWLdIbGXeeUFbAamR+hgMM1mjvASxauEgHF49eYMB/bqHD
  10.162 +        sOtz42Tw17D3kDaXOxA8dP/cuXO6+3BX4rRmpbj7cHmzs2+21E1dljjSh8EvWLhA7wIhwUE6zMIIAIEz
  10.163 +        eILwCQB/mbnQd3UPuPu3tLTo0sad5/PPP5eL4P05UIfZ59rA4HfvbpOd2HtayP0mOBwInLTZWLvRZB/y
  10.164 +        WVOzQtWH3Of3zZs/XwEEBRGAw/QBAg/DKs39yCcA8/HL8qH75v7Lq2O27kHcVSiD3DhJmXPnz+nEPYnG
  10.165 +        Zfbb24/KkUOHsX2a9VmVx2pg0ocbKNcHXaGXL4P60JYpV0tm7ty5pgJBITqNFQCDxyePTwD4C0mb3JxO
  10.166 +        G4WuAwGQDuchl2ew6zDr1Hw2LrN/6JChz24rePuCYysPL0qd3Lezv1D9JJ5Y3MZYAQJgHzBwfoaG+giA
  10.167 +        2WDT2mc0PCAOsSFpQ7QRT582w+o4Aj969ChU57Byf+/ezsxr8NuaAbhBNkP3bXOMysMLDLlvZ/8TmGEE
  10.168 +        QE8o0AbAPkDgDJ494VMFZs+erU2b7WFgcYjxks6b1DGlS7teVhi4Xi8xH3bh0kLa2JlntbYgeFs2SR17
  10.169 +        cFF57CvmrFmzLADogcAgnQWhrAIC56fDVwC0B+m82e4bXQcOsdSUVA3GzjhvWnv27HXfiVtbdyjnuTI0
  10.170 +        NDRq5vnv10PzV8OWtNcG6v7ChQuV9wzeBsAeCAwKVAAOR6hSyT4+VWDmxx/LaOz+tEx4ByB9OANSU9Nk
  10.171 +        w/oNyn1eUOzLPIcVs76tZZtOXHJ+M/Reg8e91w6+ugqXewRP2Zw3b76QOgyen9OnT9dBxjlgAFjBY7kL
  10.172 +        cYT4RqEZM2aq18Nje54ZGcOVQmzkW7duaRVaQRc7eMorFUqDpykMvWfTrlu3BqbwKs2+uhMWgLkQClKV
  10.173 +        3GfwY2HVUDYVAAImAALRA2XyqQIfffQPUIYuG71OZB/0ycAMoHPMS0cqbMKKJRVCuWX26EZPnzYdJsBk
  10.174 +        vfwUYn5QxSi9pJ75fylqJdI+Yab1gDL8jIMbocGjgbtmPwSAQlSZfAJAazwjY6Q01zgkfSiCzxihbjON
  10.175 +        Wpq0SYlJurvTnFI3GQ4CzVc6CXQUXBFmhzd7jJmkHEimKQ23mWXuPcx4cIhFG9BFqWNnHp9B+PvAwEDf
  10.176 +        AJSVlYEqw+VEUw+pXxaKDA7H6XSa6XEmJhmHOX6Abc4ae/Bpt822ywks0rrjcj0gIIcjDMGGIeuhAIOD
  10.177 +        z+BghzmgTWAQgg8IUkvFpwqQk2kI+vjWntLe0Evqqx3w99O1ialENGo9vf4EmLQD4gd0MWptMKSJp++v
  10.178 +        fg/ATCoIlNK8ACnNx8kLlBL8XJJrzoRcf5mQw9NbAvwDAMJHANOmTcMLSboca+wph7f4KYgtVQ5JSuZj
  10.179 +        BQAMJgDjNHv6nwkJxrD1dJyNadv5eEHPMwKWodNF6zwCtHKBTmxeJ+gSBrqEin+AQ/z8Q8Svd7D07h2g
  10.180 +        IHyqwNSpU5HxIXKquSeq0EsrcbKpp2xdHgyL3NjkrMCzAFAJ9EYnAJq4sM3jDAB1ntEzUwqDZVJ+kB6t
  10.181 +        gkcFNPOowHhkf1y2H6rgB1PLRwBTYLpSNZKSU8H1ND2DEvFzIriPo4GjB9jMXSuAFxcCeMo2j8NV0Vae
  10.182 +        mBja5zHoB1TBaWzDULjP7Af2QBD4T+77+wdKb57egb4DoGvMOzElsYgrtfUqw/WC3hCl0f0GBkqxGoMG
  10.183 +        JSp9+CDHYGOUKhG6kNFpoBT6+/uLHwyqHvB43n77bfueq/T4o+PTjcx6CexuvUkV4XMaTpnn4WPD/3ro
  10.184 +        MvhyvH6hsQB041sU36T4rMOXkRfgePdGZr2avYSM9yAIvknxWecFON69UloA+A7L91i+y/J99kU5f/xO
  10.185 +        /NS7pf06/iJ9ukP8D3GWhQo97UjxAAAAAElFTkSuQmCC
  10.186 +</value>
  10.187 +  </data>
  10.188 +</root>
  10.189 \ No newline at end of file
    11.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
    11.2 +++ b/GUI/HardwareNode.cs	Tue Jan 26 22:37:48 2010 +0000
    11.3 @@ -0,0 +1,119 @@
    11.4 +/*
    11.5 +  
    11.6 +  Version: MPL 1.1/GPL 2.0/LGPL 2.1
    11.7 +
    11.8 +  The contents of this file are subject to the Mozilla Public License Version
    11.9 +  1.1 (the "License"); you may not use this file except in compliance with
   11.10 +  the License. You may obtain a copy of the License at
   11.11 + 
   11.12 +  http://www.mozilla.org/MPL/
   11.13 +
   11.14 +  Software distributed under the License is distributed on an "AS IS" basis,
   11.15 +  WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
   11.16 +  for the specific language governing rights and limitations under the License.
   11.17 +
   11.18 +  The Original Code is the Open Hardware Monitor code.
   11.19 +
   11.20 +  The Initial Developer of the Original Code is 
   11.21 +  Michael Möller <m.moeller@gmx.ch>.
   11.22 +  Portions created by the Initial Developer are Copyright (C) 2009-2010
   11.23 +  the Initial Developer. All Rights Reserved.
   11.24 +
   11.25 +  Contributor(s):
   11.26 +
   11.27 +  Alternatively, the contents of this file may be used under the terms of
   11.28 +  either the GNU General Public License Version 2 or later (the "GPL"), or
   11.29 +  the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
   11.30 +  in which case the provisions of the GPL or the LGPL are applicable instead
   11.31 +  of those above. If you wish to allow use of your version of this file only
   11.32 +  under the terms of either the GPL or the LGPL, and not to allow others to
   11.33 +  use your version of this file under the terms of the MPL, indicate your
   11.34 +  decision by deleting the provisions above and replace them with the notice
   11.35 +  and other provisions required by the GPL or the LGPL. If you do not delete
   11.36 +  the provisions above, a recipient may use your version of this file under
   11.37 +  the terms of any one of the MPL, the GPL or the LGPL.
   11.38 + 
   11.39 +*/
   11.40 +
   11.41 +using System;
   11.42 +using System.Collections.Generic;
   11.43 +using System.Drawing;
   11.44 +using Aga.Controls.Tree;
   11.45 +using OpenHardwareMonitor.Hardware;
   11.46 +
   11.47 +namespace OpenHardwareMonitor.GUI {
   11.48 +  public class HardwareNode : Node {
   11.49 +
   11.50 +    private IHardware hardware;
   11.51 +
   11.52 +    private List<TypeNode> typeNodes = new List<TypeNode>();
   11.53 +
   11.54 +    public HardwareNode(IHardware hardware) : base(hardware.Name) {
   11.55 +      
   11.56 +      this.hardware = hardware;
   11.57 +      this.Image = hardware.Icon;
   11.58 +
   11.59 +      typeNodes.Add(new TypeNode(SensorType.Voltage));
   11.60 +      typeNodes.Add(new TypeNode(SensorType.Clock));
   11.61 +      typeNodes.Add(new TypeNode(SensorType.Temperature));
   11.62 +      typeNodes.Add(new TypeNode(SensorType.Fan));
   11.63 +      
   11.64 +      foreach (ISensor sensor in hardware.Sensors)
   11.65 +        SensorAdded(sensor);
   11.66 +
   11.67 +      hardware.SensorAdded +=new SensorEventHandler(SensorAdded);
   11.68 +      hardware.SensorRemoved += new SensorEventHandler(SensorRemoved);
   11.69 +    }
   11.70 +
   11.71 +    public IHardware Hardware {
   11.72 +      get { return hardware; }
   11.73 +    }
   11.74 +
   11.75 +    public void SetVisible(SensorType sensorType, bool visible) {
   11.76 +      foreach (TypeNode node in typeNodes)
   11.77 +        if (node.SensorType == sensorType) {
   11.78 +          node.IsVisible = visible;
   11.79 +          UpdateNode(node);
   11.80 +        }
   11.81 +    }
   11.82 +
   11.83 +    private void UpdateNode(TypeNode node) {      
   11.84 +      if (node.IsVisible && node.Nodes.Count > 0) {
   11.85 +        if (!Nodes.Contains(node)) {
   11.86 +          int i = 0;
   11.87 +          while (i < Nodes.Count &&
   11.88 +            ((TypeNode)Nodes[i]).SensorType < node.SensorType)
   11.89 +            i++;
   11.90 +          Nodes.Insert(i, node);  
   11.91 +        }
   11.92 +      } else {
   11.93 +        if (Nodes.Contains(node))
   11.94 +          Nodes.Remove(node);
   11.95 +      }
   11.96 +    }
   11.97 +
   11.98 +    private void SensorRemoved(ISensor sensor) {
   11.99 +      foreach (TypeNode node in typeNodes)
  11.100 +        if (node.SensorType == sensor.SensorType) {
  11.101 +          node.Nodes.Remove(new SensorNode(sensor));
  11.102 +          UpdateNode(node);
  11.103 +        }
  11.104 +    }
  11.105 +
  11.106 +    private void InsertSorted(Node node, ISensor sensor) {
  11.107 +      int i = 0;
  11.108 +      while (i < node.Nodes.Count &&
  11.109 +        ((SensorNode)node.Nodes[i]).Sensor.Index < sensor.Index)
  11.110 +        i++;
  11.111 +      node.Nodes.Insert(i, new SensorNode(sensor));        
  11.112 +    }
  11.113 +
  11.114 +    private void SensorAdded(ISensor sensor) {
  11.115 +      foreach (TypeNode node in typeNodes)
  11.116 +        if (node.SensorType == sensor.SensorType) {
  11.117 +          InsertSorted(node, sensor);
  11.118 +          UpdateNode(node);
  11.119 +        }
  11.120 +    }
  11.121 +  }
  11.122 +}
    12.1 Binary file GUI/LicenseBox.resources has changed
    13.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
    13.2 +++ b/GUI/MainForm.Designer.cs	Tue Jan 26 22:37:48 2010 +0000
    13.3 @@ -0,0 +1,523 @@
    13.4 +/*
    13.5 +  
    13.6 +  Version: MPL 1.1/GPL 2.0/LGPL 2.1
    13.7 +
    13.8 +  The contents of this file are subject to the Mozilla Public License Version
    13.9 +  1.1 (the "License"); you may not use this file except in compliance with
   13.10 +  the License. You may obtain a copy of the License at
   13.11 + 
   13.12 +  http://www.mozilla.org/MPL/
   13.13 +
   13.14 +  Software distributed under the License is distributed on an "AS IS" basis,
   13.15 +  WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
   13.16 +  for the specific language governing rights and limitations under the License.
   13.17 +
   13.18 +  The Original Code is the Open Hardware Monitor code.
   13.19 +
   13.20 +  The Initial Developer of the Original Code is 
   13.21 +  Michael Möller <m.moeller@gmx.ch>.
   13.22 +  Portions created by the Initial Developer are Copyright (C) 2009-2010
   13.23 +  the Initial Developer. All Rights Reserved.
   13.24 +
   13.25 +  Contributor(s):
   13.26 +
   13.27 +  Alternatively, the contents of this file may be used under the terms of
   13.28 +  either the GNU General Public License Version 2 or later (the "GPL"), or
   13.29 +  the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
   13.30 +  in which case the provisions of the GPL or the LGPL are applicable instead
   13.31 +  of those above. If you wish to allow use of your version of this file only
   13.32 +  under the terms of either the GPL or the LGPL, and not to allow others to
   13.33 +  use your version of this file under the terms of the MPL, indicate your
   13.34 +  decision by deleting the provisions above and replace them with the notice
   13.35 +  and other provisions required by the GPL or the LGPL. If you do not delete
   13.36 +  the provisions above, a recipient may use your version of this file under
   13.37 +  the terms of any one of the MPL, the GPL or the LGPL.
   13.38 + 
   13.39 +*/
   13.40 +
   13.41 +namespace OpenHardwareMonitor.GUI {
   13.42 +  partial class MainForm {
   13.43 +    /// <summary>
   13.44 +    /// Required designer variable.
   13.45 +    /// </summary>
   13.46 +    private System.ComponentModel.IContainer components = null;
   13.47 +
   13.48 +    /// <summary>
   13.49 +    /// Clean up any resources being used.
   13.50 +    /// </summary>
   13.51 +    /// <param name="disposing">true if managed resources should be disposed; otherwise, false.</param>
   13.52 +    protected override void Dispose(bool disposing) {
   13.53 +      if (disposing && (components != null)) {
   13.54 +        components.Dispose();
   13.55 +      }
   13.56 +      base.Dispose(disposing);
   13.57 +    }
   13.58 +
   13.59 +    #region Windows Form Designer generated code
   13.60 +
   13.61 +    /// <summary>
   13.62 +    /// Required method for Designer support - do not modify
   13.63 +    /// the contents of this method with the code editor.
   13.64 +    /// </summary>
   13.65 +    private void InitializeComponent() {
   13.66 +      this.components = new System.ComponentModel.Container();
   13.67 +      System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(MainForm));
   13.68 +      this.treeView = new Aga.Controls.Tree.TreeViewAdv();
   13.69 +      this.sensor = new Aga.Controls.Tree.TreeColumn();
   13.70 +      this.value = new Aga.Controls.Tree.TreeColumn();
   13.71 +      this.min = new Aga.Controls.Tree.TreeColumn();
   13.72 +      this.max = new Aga.Controls.Tree.TreeColumn();
   13.73 +      this.limit = new Aga.Controls.Tree.TreeColumn();
   13.74 +      this.nodeImage = new Aga.Controls.Tree.NodeControls.NodeIcon();
   13.75 +      this.nodeCheckBox = new Aga.Controls.Tree.NodeControls.NodeCheckBox();
   13.76 +      this.nodeTextBoxText = new Aga.Controls.Tree.NodeControls.NodeTextBox();
   13.77 +      this.nodeTextBoxValue = new Aga.Controls.Tree.NodeControls.NodeTextBox();
   13.78 +      this.nodeTextBoxMin = new Aga.Controls.Tree.NodeControls.NodeTextBox();
   13.79 +      this.nodeTextBoxMax = new Aga.Controls.Tree.NodeControls.NodeTextBox();
   13.80 +      this.nodeTextBoxLimit = new Aga.Controls.Tree.NodeControls.NodeTextBox();
   13.81 +      this.columnsContextMenuStrip = new System.Windows.Forms.ContextMenuStrip(this.components);
   13.82 +      this.valueToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
   13.83 +      this.minMenuItem = new System.Windows.Forms.ToolStripMenuItem();
   13.84 +      this.maxMenuItem = new System.Windows.Forms.ToolStripMenuItem();
   13.85 +      this.limitMenuItem = new System.Windows.Forms.ToolStripMenuItem();
   13.86 +      this.menuStrip = new System.Windows.Forms.MenuStrip();
   13.87 +      this.fileToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
   13.88 +      this.saveReportToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
   13.89 +      this.exitToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
   13.90 +      this.viewToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
   13.91 +      this.sensorsToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
   13.92 +      this.voltMenuItem = new System.Windows.Forms.ToolStripMenuItem();
   13.93 +      this.clocksMenuItem = new System.Windows.Forms.ToolStripMenuItem();
   13.94 +      this.tempMenuItem = new System.Windows.Forms.ToolStripMenuItem();
   13.95 +      this.fansMenuItem = new System.Windows.Forms.ToolStripMenuItem();
   13.96 +      this.toolStripMenuItem1 = new System.Windows.Forms.ToolStripSeparator();
   13.97 +      this.plotMenuItem = new System.Windows.Forms.ToolStripMenuItem();
   13.98 +      this.optionsToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
   13.99 +      this.hddMenuItem = new System.Windows.Forms.ToolStripMenuItem();
  13.100 +      this.helpToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
  13.101 +      this.aboutToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
  13.102 +      this.timer = new System.Windows.Forms.Timer(this.components);
  13.103 +      this.splitContainer = new System.Windows.Forms.SplitContainer();
  13.104 +      this.plotPanel = new OpenHardwareMonitor.GUI.PlotPanel();
  13.105 +      this.columnsContextMenuStrip.SuspendLayout();
  13.106 +      this.menuStrip.SuspendLayout();
  13.107 +      this.splitContainer.Panel1.SuspendLayout();
  13.108 +      this.splitContainer.Panel2.SuspendLayout();
  13.109 +      this.splitContainer.SuspendLayout();
  13.110 +      this.SuspendLayout();
  13.111 +      // 
  13.112 +      // treeView
  13.113 +      // 
  13.114 +      this.treeView.BackColor = System.Drawing.SystemColors.Window;
  13.115 +      this.treeView.Columns.Add(this.sensor);
  13.116 +      this.treeView.Columns.Add(this.value);
  13.117 +      this.treeView.Columns.Add(this.min);
  13.118 +      this.treeView.Columns.Add(this.max);
  13.119 +      this.treeView.Columns.Add(this.limit);
  13.120 +      this.treeView.DefaultToolTipProvider = null;
  13.121 +      this.treeView.Dock = System.Windows.Forms.DockStyle.Fill;
  13.122 +      this.treeView.DragDropMarkColor = System.Drawing.Color.Black;
  13.123 +      this.treeView.Font = new System.Drawing.Font("Segoe UI", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
  13.124 +      this.treeView.FullRowSelect = true;
  13.125 +      this.treeView.GridLineStyle = Aga.Controls.Tree.GridLineStyle.Horizontal;
  13.126 +      this.treeView.LineColor = System.Drawing.SystemColors.ControlDark;
  13.127 +      this.treeView.Location = new System.Drawing.Point(0, 0);
  13.128 +      this.treeView.Model = null;
  13.129 +      this.treeView.Name = "treeView";
  13.130 +      this.treeView.NodeControls.Add(this.nodeImage);
  13.131 +      this.treeView.NodeControls.Add(this.nodeCheckBox);
  13.132 +      this.treeView.NodeControls.Add(this.nodeTextBoxText);
  13.133 +      this.treeView.NodeControls.Add(this.nodeTextBoxValue);
  13.134 +      this.treeView.NodeControls.Add(this.nodeTextBoxMin);
  13.135 +      this.treeView.NodeControls.Add(this.nodeTextBoxMax);
  13.136 +      this.treeView.NodeControls.Add(this.nodeTextBoxLimit);
  13.137 +      this.treeView.RowHeight = 18;
  13.138 +      this.treeView.SelectedNode = null;
  13.139 +      this.treeView.Size = new System.Drawing.Size(478, 567);
  13.140 +      this.treeView.TabIndex = 0;
  13.141 +      this.treeView.Text = "treeView";
  13.142 +      this.treeView.UseColumns = true;
  13.143 +      this.treeView.Click += new System.EventHandler(this.treeView_Click);
  13.144 +      // 
  13.145 +      // sensor
  13.146 +      // 
  13.147 +      this.sensor.Header = "Sensor";
  13.148 +      this.sensor.SortOrder = System.Windows.Forms.SortOrder.None;
  13.149 +      this.sensor.TooltipText = null;
  13.150 +      this.sensor.Width = 250;
  13.151 +      // 
  13.152 +      // value
  13.153 +      // 
  13.154 +      this.value.Header = "Value";
  13.155 +      this.value.SortOrder = System.Windows.Forms.SortOrder.None;
  13.156 +      this.value.TooltipText = null;
  13.157 +      this.value.Width = 100;
  13.158 +      // 
  13.159 +      // min
  13.160 +      // 
  13.161 +      this.min.Header = "Min";
  13.162 +      this.min.SortOrder = System.Windows.Forms.SortOrder.None;
  13.163 +      this.min.TooltipText = null;
  13.164 +      this.min.Width = 100;
  13.165 +      // 
  13.166 +      // max
  13.167 +      // 
  13.168 +      this.max.Header = "Max";
  13.169 +      this.max.SortOrder = System.Windows.Forms.SortOrder.None;
  13.170 +      this.max.TooltipText = null;
  13.171 +      this.max.Width = 100;
  13.172 +      // 
  13.173 +      // limit
  13.174 +      // 
  13.175 +      this.limit.Header = "Limit";
  13.176 +      this.limit.SortOrder = System.Windows.Forms.SortOrder.None;
  13.177 +      this.limit.TooltipText = null;
  13.178 +      this.limit.Width = 100;
  13.179 +      // 
  13.180 +      // nodeImage
  13.181 +      // 
  13.182 +      this.nodeImage.DataPropertyName = "Image";
  13.183 +      this.nodeImage.LeftMargin = 1;
  13.184 +      this.nodeImage.ParentColumn = this.sensor;
  13.185 +      this.nodeImage.ScaleMode = Aga.Controls.Tree.ImageScaleMode.Fit;
  13.186 +      // 
  13.187 +      // nodeCheckBox
  13.188 +      // 
  13.189 +      this.nodeCheckBox.DataPropertyName = "Plot";
  13.190 +      this.nodeCheckBox.EditEnabled = true;
  13.191 +      this.nodeCheckBox.LeftMargin = 3;
  13.192 +      this.nodeCheckBox.ParentColumn = this.sensor;
  13.193 +      // 
  13.194 +      // nodeTextBoxText
  13.195 +      // 
  13.196 +      this.nodeTextBoxText.DataPropertyName = "Text";
  13.197 +      this.nodeTextBoxText.EditEnabled = true;
  13.198 +      this.nodeTextBoxText.IncrementalSearchEnabled = true;
  13.199 +      this.nodeTextBoxText.LeftMargin = 3;
  13.200 +      this.nodeTextBoxText.ParentColumn = this.sensor;
  13.201 +      // 
  13.202 +      // nodeTextBoxValue
  13.203 +      // 
  13.204 +      this.nodeTextBoxValue.DataPropertyName = "Value";
  13.205 +      this.nodeTextBoxValue.IncrementalSearchEnabled = true;
  13.206 +      this.nodeTextBoxValue.LeftMargin = 3;
  13.207 +      this.nodeTextBoxValue.ParentColumn = this.value;
  13.208 +      // 
  13.209 +      // nodeTextBoxMin
  13.210 +      // 
  13.211 +      this.nodeTextBoxMin.DataPropertyName = "Min";
  13.212 +      this.nodeTextBoxMin.IncrementalSearchEnabled = true;
  13.213 +      this.nodeTextBoxMin.LeftMargin = 3;
  13.214 +      this.nodeTextBoxMin.ParentColumn = this.min;
  13.215 +      // 
  13.216 +      // nodeTextBoxMax
  13.217 +      // 
  13.218 +      this.nodeTextBoxMax.DataPropertyName = "Max";
  13.219 +      this.nodeTextBoxMax.IncrementalSearchEnabled = true;
  13.220 +      this.nodeTextBoxMax.LeftMargin = 3;
  13.221 +      this.nodeTextBoxMax.ParentColumn = this.max;
  13.222 +      // 
  13.223 +      // nodeTextBoxLimit
  13.224 +      // 
  13.225 +      this.nodeTextBoxLimit.DataPropertyName = "Limit";
  13.226 +      this.nodeTextBoxLimit.EditEnabled = true;
  13.227 +      this.nodeTextBoxLimit.IncrementalSearchEnabled = true;
  13.228 +      this.nodeTextBoxLimit.LeftMargin = 3;
  13.229 +      this.nodeTextBoxLimit.ParentColumn = this.limit;
  13.230 +      // 
  13.231 +      // columnsContextMenuStrip
  13.232 +      // 
  13.233 +      this.columnsContextMenuStrip.Items.AddRange(new System.Windows.Forms.ToolStripItem[] {
  13.234 +            this.valueToolStripMenuItem,
  13.235 +            this.minMenuItem,
  13.236 +            this.maxMenuItem,
  13.237 +            this.limitMenuItem});
  13.238 +      this.columnsContextMenuStrip.Name = "columnsContextMenuStrip";
  13.239 +      this.columnsContextMenuStrip.Size = new System.Drawing.Size(104, 92);
  13.240 +      // 
  13.241 +      // valueToolStripMenuItem
  13.242 +      // 
  13.243 +      this.valueToolStripMenuItem.Checked = true;
  13.244 +      this.valueToolStripMenuItem.CheckOnClick = true;
  13.245 +      this.valueToolStripMenuItem.CheckState = System.Windows.Forms.CheckState.Checked;
  13.246 +      this.valueToolStripMenuItem.Name = "valueToolStripMenuItem";
  13.247 +      this.valueToolStripMenuItem.Size = new System.Drawing.Size(103, 22);
  13.248 +      this.valueToolStripMenuItem.Text = "Value";
  13.249 +      this.valueToolStripMenuItem.CheckedChanged += new System.EventHandler(this.valueToolStripMenuItem_CheckedChanged);
  13.250 +      // 
  13.251 +      // minMenuItem
  13.252 +      // 
  13.253 +      this.minMenuItem.Checked = true;
  13.254 +      this.minMenuItem.CheckOnClick = true;
  13.255 +      this.minMenuItem.CheckState = System.Windows.Forms.CheckState.Checked;
  13.256 +      this.minMenuItem.Name = "minMenuItem";
  13.257 +      this.minMenuItem.Size = new System.Drawing.Size(103, 22);
  13.258 +      this.minMenuItem.Text = "Min";
  13.259 +      this.minMenuItem.CheckedChanged += new System.EventHandler(this.minToolStripMenuItem_CheckedChanged);
  13.260 +      // 
  13.261 +      // maxMenuItem
  13.262 +      // 
  13.263 +      this.maxMenuItem.Checked = true;
  13.264 +      this.maxMenuItem.CheckOnClick = true;
  13.265 +      this.maxMenuItem.CheckState = System.Windows.Forms.CheckState.Checked;
  13.266 +      this.maxMenuItem.Name = "maxMenuItem";
  13.267 +      this.maxMenuItem.Size = new System.Drawing.Size(103, 22);
  13.268 +      this.maxMenuItem.Text = "Max";
  13.269 +      this.maxMenuItem.CheckedChanged += new System.EventHandler(this.maxToolStripMenuItem_CheckedChanged);
  13.270 +      // 
  13.271 +      // limitMenuItem
  13.272 +      // 
  13.273 +      this.limitMenuItem.Checked = true;
  13.274 +      this.limitMenuItem.CheckOnClick = true;
  13.275 +      this.limitMenuItem.CheckState = System.Windows.Forms.CheckState.Checked;
  13.276 +      this.limitMenuItem.Name = "limitMenuItem";
  13.277 +      this.limitMenuItem.Size = new System.Drawing.Size(103, 22);
  13.278 +      this.limitMenuItem.Text = "Limit";
  13.279 +      this.limitMenuItem.CheckedChanged += new System.EventHandler(this.limitToolStripMenuItem_CheckedChanged);
  13.280 +      // 
  13.281 +      // menuStrip
  13.282 +      // 
  13.283 +      this.menuStrip.Items.AddRange(new System.Windows.Forms.ToolStripItem[] {
  13.284 +            this.fileToolStripMenuItem,
  13.285 +            this.viewToolStripMenuItem,
  13.286 +            this.optionsToolStripMenuItem,
  13.287 +            this.helpToolStripMenuItem});
  13.288 +      this.menuStrip.Location = new System.Drawing.Point(0, 0);
  13.289 +      this.menuStrip.Name = "menuStrip";
  13.290 +      this.menuStrip.Padding = new System.Windows.Forms.Padding(7, 2, 0, 2);
  13.291 +      this.menuStrip.Size = new System.Drawing.Size(478, 24);
  13.292 +      this.menuStrip.TabIndex = 1;
  13.293 +      this.menuStrip.Text = "menuStrip1";
  13.294 +      // 
  13.295 +      // fileToolStripMenuItem
  13.296 +      // 
  13.297 +      this.fileToolStripMenuItem.DropDownItems.AddRange(new System.Windows.Forms.ToolStripItem[] {
  13.298 +            this.saveReportToolStripMenuItem,
  13.299 +            this.exitToolStripMenuItem});
  13.300 +      this.fileToolStripMenuItem.Name = "fileToolStripMenuItem";
  13.301 +      this.fileToolStripMenuItem.Size = new System.Drawing.Size(37, 20);
  13.302 +      this.fileToolStripMenuItem.Text = "File";
  13.303 +      // 
  13.304 +      // saveReportToolStripMenuItem
  13.305 +      // 
  13.306 +      this.saveReportToolStripMenuItem.Name = "saveReportToolStripMenuItem";
  13.307 +      this.saveReportToolStripMenuItem.Size = new System.Drawing.Size(136, 22);
  13.308 +      this.saveReportToolStripMenuItem.Text = "Save Report";
  13.309 +      this.saveReportToolStripMenuItem.Click += new System.EventHandler(this.saveReportToolStripMenuItem_Click);
  13.310 +      // 
  13.311 +      // exitToolStripMenuItem
  13.312 +      // 
  13.313 +      this.exitToolStripMenuItem.Name = "exitToolStripMenuItem";
  13.314 +      this.exitToolStripMenuItem.Size = new System.Drawing.Size(136, 22);
  13.315 +      this.exitToolStripMenuItem.Text = "Exit";
  13.316 +      this.exitToolStripMenuItem.Click += new System.EventHandler(this.exitToolStripMenuItem_Click);
  13.317 +      // 
  13.318 +      // viewToolStripMenuItem
  13.319 +      // 
  13.320 +      this.viewToolStripMenuItem.DropDownItems.AddRange(new System.Windows.Forms.ToolStripItem[] {
  13.321 +            this.sensorsToolStripMenuItem,
  13.322 +            this.toolStripMenuItem1,
  13.323 +            this.plotMenuItem});
  13.324 +      this.viewToolStripMenuItem.Name = "viewToolStripMenuItem";
  13.325 +      this.viewToolStripMenuItem.Size = new System.Drawing.Size(44, 20);
  13.326 +      this.viewToolStripMenuItem.Text = "View";
  13.327 +      // 
  13.328 +      // sensorsToolStripMenuItem
  13.329 +      // 
  13.330 +      this.sensorsToolStripMenuItem.DropDownItems.AddRange(new System.Windows.Forms.ToolStripItem[] {
  13.331 +            this.voltMenuItem,
  13.332 +            this.clocksMenuItem,
  13.333 +            this.tempMenuItem,
  13.334 +            this.fansMenuItem});
  13.335 +      this.sensorsToolStripMenuItem.Name = "sensorsToolStripMenuItem";
  13.336 +      this.sensorsToolStripMenuItem.Size = new System.Drawing.Size(114, 22);
  13.337 +      this.sensorsToolStripMenuItem.Text = "Sensors";
  13.338 +      // 
  13.339 +      // voltMenuItem
  13.340 +      // 
  13.341 +      this.voltMenuItem.Checked = true;
  13.342 +      this.voltMenuItem.CheckOnClick = true;
  13.343 +      this.voltMenuItem.CheckState = System.Windows.Forms.CheckState.Checked;
  13.344 +      this.voltMenuItem.Name = "voltMenuItem";
  13.345 +      this.voltMenuItem.Size = new System.Drawing.Size(147, 22);
  13.346 +      this.voltMenuItem.Text = "Voltages";
  13.347 +      this.voltMenuItem.CheckedChanged += new System.EventHandler(this.UpdateSensorTypeChecked);
  13.348 +      // 
  13.349 +      // clocksMenuItem
  13.350 +      // 
  13.351 +      this.clocksMenuItem.Checked = true;
  13.352 +      this.clocksMenuItem.CheckOnClick = true;
  13.353 +      this.clocksMenuItem.CheckState = System.Windows.Forms.CheckState.Checked;
  13.354 +      this.clocksMenuItem.Name = "clocksMenuItem";
  13.355 +      this.clocksMenuItem.Size = new System.Drawing.Size(147, 22);
  13.356 +      this.clocksMenuItem.Text = "Clocks";
  13.357 +      this.clocksMenuItem.CheckedChanged += new System.EventHandler(this.UpdateSensorTypeChecked);
  13.358 +      // 
  13.359 +      // tempMenuItem
  13.360 +      // 
  13.361 +      this.tempMenuItem.Checked = true;
  13.362 +      this.tempMenuItem.CheckOnClick = true;
  13.363 +      this.tempMenuItem.CheckState = System.Windows.Forms.CheckState.Checked;
  13.364 +      this.tempMenuItem.Name = "tempMenuItem";
  13.365 +      this.tempMenuItem.Size = new System.Drawing.Size(147, 22);
  13.366 +      this.tempMenuItem.Text = "Temperatures";
  13.367 +      this.tempMenuItem.CheckedChanged += new System.EventHandler(this.UpdateSensorTypeChecked);
  13.368 +      // 
  13.369 +      // fansMenuItem
  13.370 +      // 
  13.371 +      this.fansMenuItem.Checked = true;
  13.372 +      this.fansMenuItem.CheckOnClick = true;
  13.373 +      this.fansMenuItem.CheckState = System.Windows.Forms.CheckState.Checked;
  13.374 +      this.fansMenuItem.Name = "fansMenuItem";
  13.375 +      this.fansMenuItem.Size = new System.Drawing.Size(147, 22);
  13.376 +      this.fansMenuItem.Text = "Fans";
  13.377 +      this.fansMenuItem.CheckedChanged += new System.EventHandler(this.UpdateSensorTypeChecked);
  13.378 +      // 
  13.379 +      // toolStripMenuItem1
  13.380 +      // 
  13.381 +      this.toolStripMenuItem1.Name = "toolStripMenuItem1";
  13.382 +      this.toolStripMenuItem1.Size = new System.Drawing.Size(111, 6);
  13.383 +      // 
  13.384 +      // plotMenuItem
  13.385 +      // 
  13.386 +      this.plotMenuItem.Checked = true;
  13.387 +      this.plotMenuItem.CheckOnClick = true;
  13.388 +      this.plotMenuItem.CheckState = System.Windows.Forms.CheckState.Checked;
  13.389 +      this.plotMenuItem.Name = "plotMenuItem";
  13.390 +      this.plotMenuItem.Size = new System.Drawing.Size(114, 22);
  13.391 +      this.plotMenuItem.Text = "Plot";
  13.392 +      this.plotMenuItem.CheckedChanged += new System.EventHandler(this.plotToolStripMenuItem_CheckedChanged);
  13.393 +      // 
  13.394 +      // optionsToolStripMenuItem
  13.395 +      // 
  13.396 +      this.optionsToolStripMenuItem.DropDownItems.AddRange(new System.Windows.Forms.ToolStripItem[] {
  13.397 +            this.hddMenuItem});
  13.398 +      this.optionsToolStripMenuItem.Name = "optionsToolStripMenuItem";
  13.399 +      this.optionsToolStripMenuItem.Size = new System.Drawing.Size(61, 20);
  13.400 +      this.optionsToolStripMenuItem.Text = "Options";
  13.401 +      // 
  13.402 +      // hddMenuItem
  13.403 +      // 
  13.404 +      this.hddMenuItem.CheckOnClick = true;
  13.405 +      this.hddMenuItem.Name = "hddMenuItem";
  13.406 +      this.hddMenuItem.Size = new System.Drawing.Size(141, 22);
  13.407 +      this.hddMenuItem.Text = "HDD sensors";
  13.408 +      this.hddMenuItem.CheckedChanged += new System.EventHandler(this.hddsensorsToolStripMenuItem_CheckedChanged);
  13.409 +      // 
  13.410 +      // helpToolStripMenuItem
  13.411 +      // 
  13.412 +      this.helpToolStripMenuItem.DropDownItems.AddRange(new System.Windows.Forms.ToolStripItem[] {
  13.413 +            this.aboutToolStripMenuItem});
  13.414 +      this.helpToolStripMenuItem.Name = "helpToolStripMenuItem";
  13.415 +      this.helpToolStripMenuItem.Size = new System.Drawing.Size(44, 20);
  13.416 +      this.helpToolStripMenuItem.Text = "Help";
  13.417 +      // 
  13.418 +      // aboutToolStripMenuItem
  13.419 +      // 
  13.420 +      this.aboutToolStripMenuItem.Name = "aboutToolStripMenuItem";
  13.421 +      this.aboutToolStripMenuItem.Size = new System.Drawing.Size(107, 22);
  13.422 +      this.aboutToolStripMenuItem.Text = "About";
  13.423 +      this.aboutToolStripMenuItem.Click += new System.EventHandler(this.aboutToolStripMenuItem_Click);
  13.424 +      // 
  13.425 +      // timer
  13.426 +      // 
  13.427 +      this.timer.Interval = 1000;
  13.428 +      this.timer.Tick += new System.EventHandler(this.timer_Tick);
  13.429 +      // 
  13.430 +      // splitContainer
  13.431 +      // 
  13.432 +      this.splitContainer.Dock = System.Windows.Forms.DockStyle.Fill;
  13.433 +      this.splitContainer.Location = new System.Drawing.Point(0, 24);
  13.434 +      this.splitContainer.Name = "splitContainer";
  13.435 +      this.splitContainer.Orientation = System.Windows.Forms.Orientation.Horizontal;
  13.436 +      // 
  13.437 +      // splitContainer.Panel1
  13.438 +      // 
  13.439 +      this.splitContainer.Panel1.Controls.Add(this.treeView);
  13.440 +      // 
  13.441 +      // splitContainer.Panel2
  13.442 +      // 
  13.443 +      this.splitContainer.Panel2.Controls.Add(this.plotPanel);
  13.444 +      this.splitContainer.Panel2.Cursor = System.Windows.Forms.Cursors.Default;
  13.445 +      this.splitContainer.Size = new System.Drawing.Size(478, 768);
  13.446 +      this.splitContainer.SplitterDistance = 567;
  13.447 +      this.splitContainer.SplitterWidth = 3;
  13.448 +      this.splitContainer.TabIndex = 3;
  13.449 +      // 
  13.450 +      // plotPanel
  13.451 +      // 
  13.452 +      this.plotPanel.BorderStyle = System.Windows.Forms.BorderStyle.Fixed3D;
  13.453 +      this.plotPanel.Dock = System.Windows.Forms.DockStyle.Fill;
  13.454 +      this.plotPanel.Font = new System.Drawing.Font("Segoe UI", 9F);
  13.455 +      this.plotPanel.Location = new System.Drawing.Point(0, 0);
  13.456 +      this.plotPanel.Name = "plotPanel";
  13.457 +      this.plotPanel.Size = new System.Drawing.Size(478, 198);
  13.458 +      this.plotPanel.TabIndex = 0;
  13.459 +      // 
  13.460 +      // MainForm
  13.461 +      // 
  13.462 +      this.AutoScaleDimensions = new System.Drawing.SizeF(7F, 15F);
  13.463 +      this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
  13.464 +      this.ClientSize = new System.Drawing.Size(478, 792);
  13.465 +      this.Controls.Add(this.splitContainer);
  13.466 +      this.Controls.Add(this.menuStrip);
  13.467 +      this.Font = new System.Drawing.Font("Segoe UI", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
  13.468 +      this.Icon = ((System.Drawing.Icon)(resources.GetObject("$this.Icon")));
  13.469 +      this.MainMenuStrip = this.menuStrip;
  13.470 +      this.Name = "MainForm";
  13.471 +      this.StartPosition = System.Windows.Forms.FormStartPosition.Manual;
  13.472 +      this.Text = "Open Hardware Monitor";
  13.473 +      this.FormClosed += new System.Windows.Forms.FormClosedEventHandler(this.MainForm_FormClosed);
  13.474 +      this.columnsContextMenuStrip.ResumeLayout(false);
  13.475 +      this.menuStrip.ResumeLayout(false);
  13.476 +      this.menuStrip.PerformLayout();
  13.477 +      this.splitContainer.Panel1.ResumeLayout(false);
  13.478 +      this.splitContainer.Panel2.ResumeLayout(false);
  13.479 +      this.splitContainer.ResumeLayout(false);
  13.480 +      this.ResumeLayout(false);
  13.481 +      this.PerformLayout();
  13.482 +
  13.483 +    }
  13.484 +
  13.485 +    #endregion
  13.486 +
  13.487 +    private Aga.Controls.Tree.TreeViewAdv treeView;
  13.488 +    private System.Windows.Forms.MenuStrip menuStrip;
  13.489 +    private System.Windows.Forms.ToolStripMenuItem fileToolStripMenuItem;
  13.490 +    private System.Windows.Forms.ToolStripMenuItem exitToolStripMenuItem;
  13.491 +    private Aga.Controls.Tree.TreeColumn sensor;
  13.492 +    private Aga.Controls.Tree.TreeColumn value;
  13.493 +    private Aga.Controls.Tree.TreeColumn min;
  13.494 +    private Aga.Controls.Tree.TreeColumn max;
  13.495 +    private Aga.Controls.Tree.NodeControls.NodeIcon nodeImage;
  13.496 +    private Aga.Controls.Tree.NodeControls.NodeTextBox nodeTextBoxText;
  13.497 +    private Aga.Controls.Tree.NodeControls.NodeTextBox nodeTextBoxValue;
  13.498 +    private Aga.Controls.Tree.NodeControls.NodeTextBox nodeTextBoxMin;
  13.499 +    private Aga.Controls.Tree.NodeControls.NodeTextBox nodeTextBoxMax;
  13.500 +    private System.Windows.Forms.Timer timer;
  13.501 +    private System.Windows.Forms.SplitContainer splitContainer;
  13.502 +    private PlotPanel plotPanel;
  13.503 +    private System.Windows.Forms.ToolStripMenuItem viewToolStripMenuItem;
  13.504 +    private System.Windows.Forms.ToolStripMenuItem plotMenuItem;
  13.505 +    private Aga.Controls.Tree.NodeControls.NodeCheckBox nodeCheckBox;
  13.506 +    private System.Windows.Forms.ToolStripMenuItem helpToolStripMenuItem;
  13.507 +    private System.Windows.Forms.ToolStripMenuItem aboutToolStripMenuItem;
  13.508 +    private Aga.Controls.Tree.TreeColumn limit;
  13.509 +    private Aga.Controls.Tree.NodeControls.NodeTextBox nodeTextBoxLimit;
  13.510 +    private System.Windows.Forms.ContextMenuStrip columnsContextMenuStrip;
  13.511 +    private System.Windows.Forms.ToolStripMenuItem minMenuItem;
  13.512 +    private System.Windows.Forms.ToolStripMenuItem maxMenuItem;
  13.513 +    private System.Windows.Forms.ToolStripMenuItem limitMenuItem;
  13.514 +    private System.Windows.Forms.ToolStripMenuItem valueToolStripMenuItem;
  13.515 +    private System.Windows.Forms.ToolStripMenuItem saveReportToolStripMenuItem;
  13.516 +    private System.Windows.Forms.ToolStripSeparator toolStripMenuItem1;
  13.517 +    private System.Windows.Forms.ToolStripMenuItem optionsToolStripMenuItem;
  13.518 +    private System.Windows.Forms.ToolStripMenuItem sensorsToolStripMenuItem;
  13.519 +    private System.Windows.Forms.ToolStripMenuItem clocksMenuItem;
  13.520 +    private System.Windows.Forms.ToolStripMenuItem tempMenuItem;
  13.521 +    private System.Windows.Forms.ToolStripMenuItem fansMenuItem;
  13.522 +    private System.Windows.Forms.ToolStripMenuItem voltMenuItem;
  13.523 +    private System.Windows.Forms.ToolStripMenuItem hddMenuItem;
  13.524 +  }
  13.525 +}
  13.526 +
    14.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
    14.2 +++ b/GUI/MainForm.cs	Tue Jan 26 22:37:48 2010 +0000
    14.3 @@ -0,0 +1,325 @@
    14.4 +/*
    14.5 +  
    14.6 +  Version: MPL 1.1/GPL 2.0/LGPL 2.1
    14.7 +
    14.8 +  The contents of this file are subject to the Mozilla Public License Version
    14.9 +  1.1 (the "License"); you may not use this file except in compliance with
   14.10 +  the License. You may obtain a copy of the License at
   14.11 + 
   14.12 +  http://www.mozilla.org/MPL/
   14.13 +
   14.14 +  Software distributed under the License is distributed on an "AS IS" basis,
   14.15 +  WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
   14.16 +  for the specific language governing rights and limitations under the License.
   14.17 +
   14.18 +  The Original Code is the Open Hardware Monitor code.
   14.19 +
   14.20 +  The Initial Developer of the Original Code is 
   14.21 +  Michael Möller <m.moeller@gmx.ch>.
   14.22 +  Portions created by the Initial Developer are Copyright (C) 2009-2010
   14.23 +  the Initial Developer. All Rights Reserved.
   14.24 +
   14.25 +  Contributor(s):
   14.26 +
   14.27 +  Alternatively, the contents of this file may be used under the terms of
   14.28 +  either the GNU General Public License Version 2 or later (the "GPL"), or
   14.29 +  the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
   14.30 +  in which case the provisions of the GPL or the LGPL are applicable instead
   14.31 +  of those above. If you wish to allow use of your version of this file only
   14.32 +  under the terms of either the GPL or the LGPL, and not to allow others to
   14.33 +  use your version of this file under the terms of the MPL, indicate your
   14.34 +  decision by deleting the provisions above and replace them with the notice
   14.35 +  and other provisions required by the GPL or the LGPL. If you do not delete
   14.36 +  the provisions above, a recipient may use your version of this file under
   14.37 +  the terms of any one of the MPL, the GPL or the LGPL.
   14.38 + 
   14.39 +*/
   14.40 +
   14.41 +using System;
   14.42 +using System.Collections.Generic;
   14.43 +using System.ComponentModel;
   14.44 +using System.Configuration;
   14.45 +using System.Drawing;
   14.46 +using System.Text;
   14.47 +using System.Windows.Forms;
   14.48 +using Aga.Controls.Tree;
   14.49 +using Aga.Controls.Tree.NodeControls;
   14.50 +using OpenHardwareMonitor.Hardware;
   14.51 +
   14.52 +namespace OpenHardwareMonitor.GUI {
   14.53 +  public partial class MainForm : Form {
   14.54 +
   14.55 +    private Node root;
   14.56 +    private List<IGroup> groupList = new List<IGroup>();
   14.57 +    private TreeModel treeModel;
   14.58 +    private IDictionary<ISensor, Color> sensorPlotColors = 
   14.59 +      new Dictionary<ISensor, Color>();
   14.60 +    private Color[] plotColorPalette;
   14.61 +
   14.62 +    public MainForm() {
   14.63 +      
   14.64 +      InitializeComponent();
   14.65 +      this.Font = SystemFonts.MessageBoxFont;
   14.66 +      treeView.Font = SystemFonts.MessageBoxFont;
   14.67 +      plotPanel.Font = SystemFonts.MessageBoxFont;      
   14.68 +      
   14.69 +      nodeCheckBox.IsVisibleValueNeeded += 
   14.70 +        new EventHandler<NodeControlValueEventArgs>(
   14.71 +          nodeCheckBox_IsVisibleValueNeeded);
   14.72 +      nodeCheckBox.CheckStateChanged += 
   14.73 +        new EventHandler<TreePathEventArgs>(UpdatePlotSelection);
   14.74 +      nodeTextBoxText.DrawText += 
   14.75 +        new EventHandler<DrawEventArgs>(nodeTextBoxText_DrawText);
   14.76 +      nodeTextBoxValue.DrawText +=
   14.77 +        new EventHandler<DrawEventArgs>(nodeTextBoxText_DrawText);
   14.78 +      nodeTextBoxMin.DrawText +=
   14.79 +        new EventHandler<DrawEventArgs>(nodeTextBoxText_DrawText);
   14.80 +      nodeTextBoxMax.DrawText +=
   14.81 +        new EventHandler<DrawEventArgs>(nodeTextBoxText_DrawText);
   14.82 +      nodeTextBoxLimit.DrawText += 
   14.83 +        new EventHandler<DrawEventArgs>(nodeTextBoxLimit_DrawText);
   14.84 +
   14.85 +      if (Utilities.Config.Contains("mainForm.Location.X")) {
   14.86 +        int x = Utilities.Config.Get("mainForm.Location.X", Location.X);
   14.87 +        x = x < 0 ? 0 : x;
   14.88 +        int y = Utilities.Config.Get("mainForm.Location.Y", Location.Y);
   14.89 +        y = y < 0 ? 0 : y;
   14.90 +        this.Location = new Point(x, y);
   14.91 +      } else {
   14.92 +        StartPosition = FormStartPosition.CenterScreen;
   14.93 +      }
   14.94 +
   14.95 +      Width = Utilities.Config.Get("mainForm.Width", Width);
   14.96 +      Height = Utilities.Config.Get("mainForm.Height", Height);
   14.97 +         
   14.98 +      treeModel = new TreeModel();
   14.99 +      root = new Node(System.Environment.MachineName);
  14.100 +      root.Image = Utilities.EmbeddedResources.GetImage("computer.png");
  14.101 +      
  14.102 +      treeModel.Nodes.Add(root);
  14.103 +      treeView.Model = treeModel;
  14.104 +
  14.105 +      AddGroup(new Hardware.SMBIOS.SMBIOSGroup());
  14.106 +      AddGroup(new Hardware.LPC.LPCGroup());
  14.107 +      AddGroup(new Hardware.CPU.CPUGroup());
  14.108 +      AddGroup(new Hardware.ATI.ATIGroup());
  14.109 +      AddGroup(new Hardware.Nvidia.NvidiaGroup());
  14.110 +      AddGroup(new Hardware.TBalancer.TBalancerGroup());
  14.111 +      
  14.112 +      plotColorPalette = new Color[14];
  14.113 +      plotColorPalette[0] = Color.Blue;
  14.114 +      plotColorPalette[1] = Color.OrangeRed;
  14.115 +      plotColorPalette[2] = Color.Green;
  14.116 +      plotColorPalette[3] = Color.LightSeaGreen;
  14.117 +      plotColorPalette[4] = Color.Goldenrod;
  14.118 +      plotColorPalette[5] = Color.DarkViolet;
  14.119 +      plotColorPalette[6] = Color.YellowGreen;
  14.120 +      plotColorPalette[7] = Color.SaddleBrown;
  14.121 +      plotColorPalette[8] = Color.Gray;
  14.122 +      plotColorPalette[9] = Color.RoyalBlue;
  14.123 +      plotColorPalette[10] = Color.DeepPink;
  14.124 +      plotColorPalette[11] = Color.MediumSeaGreen;
  14.125 +      plotColorPalette[12] = Color.Olive;
  14.126 +      plotColorPalette[13] = Color.Firebrick;
  14.127 +
  14.128 +      plotMenuItem.Checked = Utilities.Config.Get(plotMenuItem.Name, false);
  14.129 +      minMenuItem.Checked = Utilities.Config.Get(minMenuItem.Name, false);
  14.130 +      maxMenuItem.Checked = Utilities.Config.Get(maxMenuItem.Name, true);
  14.131 +      limitMenuItem.Checked = Utilities.Config.Get(limitMenuItem.Name, false);
  14.132 +      hddMenuItem.Checked = Utilities.Config.Get(hddMenuItem.Name, false);
  14.133 +
  14.134 +      voltMenuItem.Checked = Utilities.Config.Get(voltMenuItem.Name, true);
  14.135 +      clocksMenuItem.Checked = Utilities.Config.Get(clocksMenuItem.Name, true);
  14.136 +      tempMenuItem.Checked = Utilities.Config.Get(tempMenuItem.Name, true);
  14.137 +      fansMenuItem.Checked = Utilities.Config.Get(fansMenuItem.Name, true);
  14.138 +
  14.139 +      timer.Enabled = true;
  14.140 +    }
  14.141 +
  14.142 +    private void AddGroup(IGroup group) {
  14.143 +      groupList.Add(group);
  14.144 +      foreach (IHardware hardware in group.Hardware)
  14.145 +        root.Nodes.Add(new HardwareNode(hardware));
  14.146 +    }
  14.147 +
  14.148 +    private void RemoveGroup(IGroup group) {
  14.149 +      List<Node> nodesToRemove = new List<Node>();
  14.150 +      foreach (IHardware hardware in group.Hardware)
  14.151 +        foreach (Node node in root.Nodes) {
  14.152 +          HardwareNode hardwareNode = node as HardwareNode;
  14.153 +          if (hardwareNode != null && hardwareNode.Hardware == hardware)
  14.154 +            nodesToRemove.Add(node);
  14.155 +        }
  14.156 +      foreach (Node node in nodesToRemove)
  14.157 +        root.Nodes.Remove(node);
  14.158 +      groupList.Remove(group);
  14.159 +    }
  14.160 +
  14.161 +    private void nodeTextBoxLimit_DrawText(object sender, DrawEventArgs e) {
  14.162 +      SensorNode sensorNode = e.Node.Tag as SensorNode;
  14.163 +      if (sensorNode != null) 
  14.164 +        e.Text = sensorNode.ValueToString(sensorNode.Sensor.Limit);
  14.165 +    }
  14.166 +
  14.167 +    private void nodeTextBoxText_DrawText(object sender, DrawEventArgs e) {
  14.168 +      if (!plotMenuItem.Checked)
  14.169 +        return;      
  14.170 +
  14.171 +      SensorNode sensorNode = e.Node.Tag as SensorNode;
  14.172 +      if (sensorNode != null) {
  14.173 +        Color color;
  14.174 +        if (sensorPlotColors.TryGetValue(sensorNode.Sensor, out color)) 
  14.175 +          e.TextColor = color;        
  14.176 +      }
  14.177 +    }
  14.178 +
  14.179 +    private void UpdatePlotSelection(object sender, 
  14.180 +      TreePathEventArgs e) 
  14.181 +    {
  14.182 +      List<ISensor> selected = new List<ISensor>();
  14.183 +      IDictionary<ISensor, Color> colors = new Dictionary<ISensor, Color>();
  14.184 +      int colorIndex = 0;
  14.185 +      foreach (TreeNodeAdv node in treeView.AllNodes) {
  14.186 +        SensorNode sensorNode = node.Tag as SensorNode;
  14.187 +        if (sensorNode != null && 
  14.188 +          sensorNode.Sensor.SensorType == SensorType.Temperature) {
  14.189 +          if (sensorNode.Plot) {
  14.190 +            colors.Add(sensorNode.Sensor,
  14.191 +              plotColorPalette[colorIndex % plotColorPalette.Length]);
  14.192 +            selected.Add(sensorNode.Sensor);
  14.193 +          }
  14.194 +          colorIndex++;
  14.195 +        }
  14.196 +      }
  14.197 +      sensorPlotColors = colors;
  14.198 +      plotPanel.SetSensors(selected, colors);
  14.199 +    }
  14.200 +
  14.201 +    private void nodeCheckBox_IsVisibleValueNeeded(object sender, 
  14.202 +      NodeControlValueEventArgs e) {
  14.203 +      SensorNode node = e.Node.Tag as SensorNode;
  14.204 +      e.Value = (node != null) && 
  14.205 +        (node.Sensor.SensorType == SensorType.Temperature) && 
  14.206 +        plotMenuItem.Checked;
  14.207 +    }
  14.208 +
  14.209 +    private void exitToolStripMenuItem_Click(object sender, EventArgs e) {
  14.210 +      Close();
  14.211 +    }
  14.212 +
  14.213 +    private void timer_Tick(object sender, EventArgs e) {
  14.214 +      
  14.215 +      #if !DEBUG
  14.216 +      try {
  14.217 +      #endif
  14.218 +        foreach (IGroup group in groupList)
  14.219 +          foreach (IHardware hardware in group.Hardware)
  14.220 +            hardware.Update();
  14.221 +      #if !DEBUG
  14.222 +      } catch (Exception exception) {
  14.223 +        Utilities.CrashReport.Save(exception);
  14.224 +        Close();
  14.225 +      }
  14.226 +      #endif
  14.227 +            
  14.228 +      treeView.Invalidate();
  14.229 +      plotPanel.Invalidate();
  14.230 +    }
  14.231 +
  14.232 +    private void MainForm_FormClosed(object sender, FormClosedEventArgs e) {
  14.233 +      Utilities.Config.Set(plotMenuItem.Name, plotMenuItem.Checked);
  14.234 +      Utilities.Config.Set(minMenuItem.Name, minMenuItem.Checked);
  14.235 +      Utilities.Config.Set(maxMenuItem.Name, maxMenuItem.Checked);
  14.236 +      Utilities.Config.Set(limitMenuItem.Name, limitMenuItem.Checked);
  14.237 +      Utilities.Config.Set(hddMenuItem.Name, hddMenuItem.Checked);
  14.238 +
  14.239 +      Utilities.Config.Set(voltMenuItem.Name, voltMenuItem.Checked);
  14.240 +      Utilities.Config.Set(clocksMenuItem.Name, clocksMenuItem.Checked);
  14.241 +      Utilities.Config.Set(tempMenuItem.Name, tempMenuItem.Checked);
  14.242 +      Utilities.Config.Set(fansMenuItem.Name, fansMenuItem.Checked);
  14.243 +
  14.244 +      Utilities.Config.Set("mainForm.Location.X", Location.X);
  14.245 +      Utilities.Config.Set("mainForm.Location.Y", Location.Y);
  14.246 +      Utilities.Config.Set("mainForm.Width", Width);
  14.247 +      Utilities.Config.Set("mainForm.Height", Height);
  14.248 +
  14.249 +      foreach (IGroup group in groupList)
  14.250 +        group.Close();
  14.251 +    }
  14.252 +
  14.253 +    private void aboutToolStripMenuItem_Click(object sender, EventArgs e) {
  14.254 +      new AboutBox().ShowDialog();
  14.255 +    }
  14.256 +
  14.257 +    private void plotToolStripMenuItem_CheckedChanged(object sender, 
  14.258 +      EventArgs e) 
  14.259 +    {
  14.260 +      splitContainer.Panel2Collapsed = !plotMenuItem.Checked;
  14.261 +      treeView.Invalidate();
  14.262 +    }
  14.263 +
  14.264 +    private void valueToolStripMenuItem_CheckedChanged(object sender, 
  14.265 +      EventArgs e) 
  14.266 +    {
  14.267 +      treeView.Columns[1].IsVisible = valueToolStripMenuItem.Checked;
  14.268 +    }
  14.269 +
  14.270 +    private void minToolStripMenuItem_CheckedChanged(object sender, EventArgs e) 
  14.271 +    {
  14.272 +      treeView.Columns[2].IsVisible = minMenuItem.Checked;
  14.273 +    }
  14.274 +
  14.275 +    private void maxToolStripMenuItem_CheckedChanged(object sender, EventArgs e) 
  14.276 +    {
  14.277 +      treeView.Columns[3].IsVisible = maxMenuItem.Checked;
  14.278 +    }
  14.279 +
  14.280 +    private void limitToolStripMenuItem_CheckedChanged(object sender, 
  14.281 +      EventArgs e) {
  14.282 +      treeView.Columns[4].IsVisible = limitMenuItem.Checked;
  14.283 +    }
  14.284 +
  14.285 +    private void treeView_Click(object sender, EventArgs e) {
  14.286 +      
  14.287 +      MouseEventArgs m = e as MouseEventArgs;
  14.288 +      if (m == null || m.Button != MouseButtons.Right)
  14.289 +        return;
  14.290 +
  14.291 +      NodeControlInfo info = treeView.GetNodeControlInfoAt(new Point(m.X, m.Y));
  14.292 +      if (info.Control == null)
  14.293 +        columnsContextMenuStrip.Show(treeView, m.X, m.Y);
  14.294 +    }
  14.295 +
  14.296 +    private void saveReportToolStripMenuItem_Click(object sender, EventArgs e) {
  14.297 +      ReportWriter.Save(groupList, new Version(Application.ProductVersion));
  14.298 +    }
  14.299 +
  14.300 +    private void hddsensorsToolStripMenuItem_CheckedChanged(object sender, 
  14.301 +      EventArgs e) 
  14.302 +    {
  14.303 +      if (hddMenuItem.Checked) {
  14.304 +        AddGroup(new Hardware.HDD.HDDGroup());
  14.305 +        UpdateSensorTypeChecked(null, null);
  14.306 +      } else {
  14.307 +        List<IGroup> groupsToRemove = new List<IGroup>();
  14.308 +        foreach (IGroup group in groupList) 
  14.309 +          if (group is Hardware.HDD.HDDGroup)
  14.310 +            groupsToRemove.Add(group);
  14.311 +        foreach (IGroup group in groupsToRemove) {
  14.312 +          group.Close();
  14.313 +          RemoveGroup(group);
  14.314 +        }
  14.315 +        UpdatePlotSelection(null, null);        
  14.316 +      }
  14.317 +    }
  14.318 +
  14.319 +    private void UpdateSensorTypeChecked(object sender, EventArgs e) {
  14.320 +      foreach (HardwareNode node in root.Nodes) {
  14.321 +        node.SetVisible(SensorType.Voltage, voltMenuItem.Checked);
  14.322 +        node.SetVisible(SensorType.Clock, clocksMenuItem.Checked);
  14.323 +        node.SetVisible(SensorType.Temperature, tempMenuItem.Checked);
  14.324 +        node.SetVisible(SensorType.Fan, fansMenuItem.Checked);
  14.325 +      }
  14.326 +    }  
  14.327 +  }
  14.328 +}
    15.1 Binary file GUI/MainForm.resources has changed
    16.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
    16.2 +++ b/GUI/MainForm.resx	Tue Jan 26 22:37:48 2010 +0000
    16.3 @@ -0,0 +1,393 @@
    16.4 +<?xml version="1.0" encoding="utf-8"?>
    16.5 +<root>
    16.6 +  <!-- 
    16.7 +    Microsoft ResX Schema 
    16.8 +    
    16.9 +    Version 2.0
   16.10 +    
   16.11 +    The primary goals of this format is to allow a simple XML format 
   16.12 +    that is mostly human readable. The generation and parsing of the 
   16.13 +    various data types are done through the TypeConverter classes 
   16.14 +    associated with the data types.
   16.15 +    
   16.16 +    Example:
   16.17 +    
   16.18 +    ... ado.net/XML headers & schema ...
   16.19 +    <resheader name="resmimetype">text/microsoft-resx</resheader>
   16.20 +    <resheader name="version">2.0</resheader>
   16.21 +    <resheader name="reader">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader>
   16.22 +    <resheader name="writer">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader>
   16.23 +    <data name="Name1"><value>this is my long string</value><comment>this is a comment</comment></data>
   16.24 +    <data name="Color1" type="System.Drawing.Color, System.Drawing">Blue</data>
   16.25 +    <data name="Bitmap1" mimetype="application/x-microsoft.net.object.binary.base64">
   16.26 +        <value>[base64 mime encoded serialized .NET Framework object]</value>
   16.27 +    </data>
   16.28 +    <data name="Icon1" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
   16.29 +        <value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value>
   16.30 +        <comment>This is a comment</comment>
   16.31 +    </data>
   16.32 +                
   16.33 +    There are any number of "resheader" rows that contain simple 
   16.34 +    name/value pairs.
   16.35 +    
   16.36 +    Each data row contains a name, and value. The row also contains a 
   16.37 +    type or mimetype. Type corresponds to a .NET class that support 
   16.38 +    text/value conversion through the TypeConverter architecture. 
   16.39 +    Classes that don't support this are serialized and stored with the 
   16.40 +    mimetype set.
   16.41 +    
   16.42 +    The mimetype is used for serialized objects, and tells the 
   16.43 +    ResXResourceReader how to depersist the object. This is currently not 
   16.44 +    extensible. For a given mimetype the value must be set accordingly:
   16.45 +    
   16.46 +    Note - application/x-microsoft.net.object.binary.base64 is the format 
   16.47 +    that the ResXResourceWriter will generate, however the reader can 
   16.48 +    read any of the formats listed below.
   16.49 +    
   16.50 +    mimetype: application/x-microsoft.net.object.binary.base64
   16.51 +    value   : The object must be serialized with 
   16.52 +            : System.Runtime.Serialization.Formatters.Binary.BinaryFormatter
   16.53 +            : and then encoded with base64 encoding.
   16.54 +    
   16.55 +    mimetype: application/x-microsoft.net.object.soap.base64
   16.56 +    value   : The object must be serialized with 
   16.57 +            : System.Runtime.Serialization.Formatters.Soap.SoapFormatter
   16.58 +            : and then encoded with base64 encoding.
   16.59 +
   16.60 +    mimetype: application/x-microsoft.net.object.bytearray.base64
   16.61 +    value   : The object must be serialized into a byte array 
   16.62 +            : using a System.ComponentModel.TypeConverter
   16.63 +            : and then encoded with base64 encoding.
   16.64 +    -->
   16.65 +  <xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
   16.66 +    <xsd:import namespace="http://www.w3.org/XML/1998/namespace" />
   16.67 +    <xsd:element name="root" msdata:IsDataSet="true">
   16.68 +      <xsd:complexType>
   16.69 +        <xsd:choice maxOccurs="unbounded">
   16.70 +          <xsd:element name="metadata">
   16.71 +            <xsd:complexType>
   16.72 +              <xsd:sequence>
   16.73 +                <xsd:element name="value" type="xsd:string" minOccurs="0" />
   16.74 +              </xsd:sequence>
   16.75 +              <xsd:attribute name="name" use="required" type="xsd:string" />
   16.76 +              <xsd:attribute name="type" type="xsd:string" />
   16.77 +              <xsd:attribute name="mimetype" type="xsd:string" />
   16.78 +              <xsd:attribute ref="xml:space" />
   16.79 +            </xsd:complexType>
   16.80 +          </xsd:element>
   16.81 +          <xsd:element name="assembly">
   16.82 +            <xsd:complexType>
   16.83 +              <xsd:attribute name="alias" type="xsd:string" />
   16.84 +              <xsd:attribute name="name" type="xsd:string" />
   16.85 +            </xsd:complexType>
   16.86 +          </xsd:element>
   16.87 +          <xsd:element name="data">
   16.88 +            <xsd:complexType>
   16.89 +              <xsd:sequence>
   16.90 +                <xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
   16.91 +                <xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" />
   16.92 +              </xsd:sequence>
   16.93 +              <xsd:attribute name="name" type="xsd:string" use="required" msdata:Ordinal="1" />
   16.94 +              <xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" />
   16.95 +              <xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" />
   16.96 +              <xsd:attribute ref="xml:space" />
   16.97 +            </xsd:complexType>
   16.98 +          </xsd:element>
   16.99 +          <xsd:element name="resheader">
  16.100 +            <xsd:complexType>
  16.101 +              <xsd:sequence>
  16.102 +                <xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
  16.103 +              </xsd:sequence>
  16.104 +              <xsd:attribute name="name" type="xsd:string" use="required" />
  16.105 +            </xsd:complexType>
  16.106 +          </xsd:element>
  16.107 +        </xsd:choice>
  16.108 +      </xsd:complexType>
  16.109 +    </xsd:element>
  16.110 +  </xsd:schema>
  16.111 +  <resheader name="resmimetype">
  16.112 +    <value>text/microsoft-resx</value>
  16.113 +  </resheader>
  16.114 +  <resheader name="version">
  16.115 +    <value>2.0</value>
  16.116 +  </resheader>
  16.117 +  <resheader name="reader">
  16.118 +    <value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
  16.119 +  </resheader>
  16.120 +  <resheader name="writer">
  16.121 +    <value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
  16.122 +  </resheader>
  16.123 +  <metadata name="columnsContextMenuStrip.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
  16.124 +    <value>204, 15</value>
  16.125 +  </metadata>
  16.126 +  <metadata name="menuStrip.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
  16.127 +    <value>17, 17</value>
  16.128 +  </metadata>
  16.129 +  <metadata name="timer.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
  16.130 +    <value>124, 15</value>
  16.131 +  </metadata>
  16.132 +  <metadata name="$this.TrayHeight" type="System.Int32, mscorlib, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
  16.133 +    <value>55</value>
  16.134 +  </metadata>
  16.135 +  <assembly alias="System.Drawing" name="System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" />
  16.136 +  <data name="$this.Icon" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
  16.137 +    <value>
  16.138 +        AAABAAMAEBAAAAEACABoBQAANgAAACAgAAABACAAqBAAAJ4FAAAwMAAAAQAgAKglAABGFgAAKAAAABAA
  16.139 +        AAAgAAAAAQAIAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABMTFAAYGBkAFxkZABkZGQAXGhoAGhoaABkb
  16.140 +        GwAbGxsAGxwcABwcHAAbHR0AHR0dAB0dHgAeHh4AIB4eAB0gIAAgICAAIiEhACMhIQAiIiIAJSMjAB4k
  16.141 +        JAAjJCQAIiQlACYmJgAqJiYAJCcnACcnJwApJycAKCgoACcpKQAqKioAKysqACQrLQArKysAKSssAB4s
  16.142 +        LgAfLC4AKS0sACwtLQAvLS0AIC4xADAtMAAxLi4ALy8vACswMAAxMTEAMDIzADQyMgAyMzMAMzMzADQ0
  16.143 +        MgA0NDQANTU1ADU2NgA2NjYAOzc1ADg4OABAODcAOTk5ADo5OQA5OjoAKjs9ADo8PAA8PDwAPT09ACE/
  16.144 +        QwAoQEMAPz8/ADtAPgBDPz8AQ0BAAEBBQQBBQUEAIkJJACVCSAAnQ0gAKENKAENDQgBEREQAJkVMAEVF
  16.145 +        RQBFSEkASEhIACVJUgBDSUoATExLAExMTABNTUoATU1NAE5OTgBET1IAT09PAFJPTwBQUFAAUVFRAFJR
  16.146 +        UgBSUlIAUVNTAFJTUwBTU1MAVFRUAFVVVQBMV1kAV1dXAFlXWQBRWFkAV1hYAFlZWQBdW1oAW1tbAFxc
  16.147 +        XABeXl4AX19fAGFfXwBgX2AAYWJhAGJiYgBkZGUAZWRlAGVlZQBmZmYAaGhoAGlpaABpaWkAbGxrAGxs
  16.148 +        bAAqb30AbW1tACtvfgBubm4Ab29vAHBwcABwcXEAd3d3AHd4eAB5eXkAenp6AHx8fAB+fn4AgICAAICB
  16.149 +        gQCBgYEAg4SDAIaFhgCGh4YAh4eHAIeIiACLiYkAioqKAIuLiwCOjo4Aj4+PAJGRkQCSkpMAk5SUAJSU
  16.150 +        lACVlZUAlpaWAJiYmACampoAnJycAJ6engCfn58AoKCgAKGhoQCioqIAC6fJAKGjpACkpKQApaWlAKWm
  16.151 +        pACmpqYAqaepAKqoqgCpq6kAqquqAK2trQCsra8Ar62vAK6urACxsbEAsrKyALOzswC0tbQAtbW1ALa2
  16.152 +        tgC3t7cAuri6ALy8vAC9vb0Avr++AL+/vwDBwcEAwsLCAMTExADFxcUAyMXIAMjIyADKysoAy8rLAMzM
  16.153 +        zADQ0NAA0tLSANra2gDd3d0A4uHiAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
  16.154 +        AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
  16.155 +        AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
  16.156 +        AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABjW1VIQDk0LCIbFw8KBgQAZ6d/RTk1
  16.157 +        MzAuK0xQS0pCAmqBOjg9MioiGxIVJCUpIQFrUkaNmZCLhoR6cm1HDhQDblNZpLaspp+Zk4yIbxAYBXBT
  16.158 +        XKm5tKuinJWOiW8LGwd1V2KxwbqupJ2YkYxxCx0IeF1lu8e/s6igm5aPdAwiCXthaL7Lw7Wqo5+YkncN
  16.159 +        Hw19ZmjDzMa9ta2hmZR5ECAQgmhpxc3IwLivopqWehMfEYNsb8nOysS8sqWel34cJhaEbGSuwrewpZ6W
  16.160 +        jIdsGUMahWhfWmZeWFNOQTw3KC1NHoRfYVZTUUlBPzs1MSg+VCOKgHx2c29oYFlTT0Q7Ni8nAAAAAAAA
  16.161 +        AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAACgA
  16.162 +        AAAgAAAAQAAAAAEAIAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAwMDAQcH
  16.163 +        BwMGBgYEBgYGBAYGBgQGBgYEBgYGBAYGBgQGBgYEBgYGBAYGBgQGBgYEBgYGBAYGBgQGBgYEBgYGBAYG
  16.164 +        BgQGBgYEBgYGBAYGBgQGBgYEBgYGBAYGBgQGBgYEBgYGBAcHBwMFBQUCAAAAAAAAAAAAAAAAAAAAAAAA
  16.165 +        AAAKCgoJDAwMIA0NDSoNDQ0qDQ0NKg0NDSoNDQ0qDQ0NKg0NDSoNDQ0qDQ0NKg0NDSoNDQ0qDQ0NKg0N
  16.166 +        DSoNDQ0qDQ0NKg0NDSoNDQ0qDQ0NKg0NDSoNDQ0qDQ0NKg0NDSoNDQ0qDAwMJQoKChEFBQUCAAAAAAAA
  16.167 +        AAAAAAAAAAAAAAgICBQKCgpHDAwMWwwMDFwMDAxcDAwMXAwMDFwMDQxcDQ0NXA0NDVwNDQ1cDQ0NXA0N
  16.168 +        DVwNDQ1cDQ0OXA4ODlwODg5cDg4OXA4ODlwODg5cDg4OXA4ODlwODg5cDg4OXA4ODlsNDQ1SDAwMJQcH
  16.169 +        BwMAAAAAAAAAAAAAAABhYWGPWVhYxVFQT9JKSUnYSEdH2EJCQtg9Pj7YOTk52Tg3NtkzMjPZLi4v2Ssr
  16.170 +        K9kmJibZIyMj2SAgH9kbGxvZFxcY2RMTE9kPDg7ZDQwM2Q0MDNgNDAzYDQwM2A0NDdgNDQ3YDg0Nuw4O
  16.171 +        DlsNDQ0qBgYGBAAAAAAAAAAAAAAAAGJhYb88QkP/NlJZ/zZSWf83T1T/PTw8/zw8PP86Ojr/OTk5/zg4
  16.172 +        OP82Njb/NDQ0/zQ0NP8yMjL/MTEw/y8uMP8sNTj/KjY4/yc0Nf8mMjT/JDAy/yIuMP8fLC7/Hyst/x8i
  16.173 +        Iv8NDQ3YDg4OXA0NDSoGBgYEAAAAAAAAAAAAAAAAY2NivzhUWv8al7L/G5Or/zNdZf8+PT3/PT09/zs7
  16.174 +        O/86Ojn/Nzc4/zU2Nf80NDT/MzMz/zExMP8vLy//Li4u/ys0Nv8pNTb/JzI0/yYwM/8kLzH/Iy4w/yEs
  16.175 +        Lv8fKy3/HyEi/w0NDdgODg5cDQ0NKgYGBgQAAAAAAAAAAAAAAABmZGS/Oldd/xqSrP8yZG7/QT8//z4/
  16.176 +        Pv88PDz/OTk5/zY3Nv80NDX/MzIz/zIyMv8wMDD/Ly8v/y4uLv8tLCz/Kikp/yNIUP8iR1D/IUZP/yBG
  16.177 +        Tv8gRk7/H0VN/x87Qf8gHx//DQ0N2A4ODlwNDQ0qBgYGBAAAAAAAAAAAAAAAAGlnaL8+Vlv/N2Fq/0ZD
  16.178 +        Q/9BQED/PT09/zg3N/8yMjH/Li4u/ywsLP8rKyv/KSkp/yoqKv8oKCj/Jycn/yUlJf8lJCT/JCMj/yMh
  16.179 +        If8jIiL/JCIi/yQjI/8kIyP/IiEh/yEgIP8NDQ3YDg4OXA0NDSoGBgYEAAAAAAAAAAAAAAAAampqv0lI
  16.180 +        SP9IR0f/RkZG/0FBQf9GR0b/f3+A/4CAgP94eHj/cXFx/2tra/9kZGT/XV1e/1dXV/9PT0//SEhI/0ND
  16.181 +        Qv9AQED/QEBA/zs7O/8mJib/IyMj/yQkJP8jIyP/IyMh/w0NDdgODg5cDQ0NKgYGBgQAAAAAAAAAAAAA
  16.182 +        AABubm6/S0tL/0pKS/9ISEj/QUFB/4uLi/+srKz/oaKh/5+fnv+dm53/mJiY/5SUlP+QkI//i4uL/4WG
  16.183 +        hf+AgID/e3t6/3V0df9xcXH/a2tr/zs7O/8hISL/JCQk/yQkJP8kJCP/DQ0N2A4ODlwNDQ0qBgYGBAAA
  16.184 +        AAAAAAAAAAAAAHBwcL9NTU3/TE1N/0lKSv9AQD//lpaY/6urq/+op6f/pKSk/6ChoP+dnJz/mJiY/5OT
  16.185 +        k/+Ojo7/iImI/4ODgv99fX3/d3d3/3Fxcf9xcXH/Pz8//yEhIf8kJCT/JSUl/yUkJP8NDQ3ZDg4OXA0N
  16.186 +        DSoGBgYEAAAAAAAAAAAAAAAAcnJzv09OT/9OT0//TExM/0FBQf+bm5r/srKy/66urv+rq6v/p6en/6Ki
  16.187 +        ov+dnZ3/mZmZ/5OTk/+Njo7/iIiH/4GBgf98e3z/dHV0/3Fxcf8/Pz//ISEh/yQkJf8lJSX/JSYm/w0N
  16.188 +        DdkODg5cDQ0NKgYGBgQAAAAAAAAAAAAAAAB0dXW/UVFR/1BQUP9NTU3/QkJC/56env+4uLj/tLO0/7Gx
  16.189 +        sf+tra3/qKio/6Ojo/+dnZ3/mJeX/5GSkf+MjIv/hYWF/35/f/94eHj/c3Nz/z8/P/8iIiL/JSUl/yYm
  16.190 +        Jv8mJib/DQ0N2Q4ODlwNDQ0qBgYGBAAAAAAAAAAAAAAAAHZ2dr9UVFT/U1NT/09PT/9FRUX/pKSk/7+/
  16.191 +        v/+7u7v/tra2/7Gxsf+pqan/o6Oj/52dnf+Xl5f/kJGR/46Njf+JiYn/goKC/3x8fP93d3f/QEBA/yIi
  16.192 +        Iv8mJib/Jycn/ycnJ/8NDQ3ZDg4OXA0NDSoGBgYEAAAAAAAAAAAAAAAAeHh4v1dXVv9VVVX/UFBQ/0ZG
  16.193 +        Rv+pqKn/xsbG/8HBwf+8vLz/tra2/6usrP+lpaX/n5+f/5mYmP+VlJX/kZKS/4yNjP+FhYX/f35//3p6
  16.194 +        ev9BQUH/IiIj/yYmJv8oJyj/KCcn/w0NDdkODg5cDQ0NKgYGBgQAAAAAAAAAAAAAAAB6enq/WFlZ/1dX
  16.195 +        V/9SUlP/SEhI/62trf/MzMz/xsbG/8HBwf+7u7v/sLCw/6mpqf+jo6P/nJ2d/5aWlv+Tk5P/j4+O/4iI
  16.196 +        iP+AgYD/fHx9/0JCQv8jIyP/Jycn/ygoKP8oKCj/Dg4O2Q4ODlwNDQ0qBgYGBAAAAAAAAAAAAAAAAH18
  16.197 +        fb9bW1v/WVlZ/1RVVf9ISUn/sbGx/9LS0v/Ly8v/xcXF/7+/vv+zs7P/qqqq/6SlpP+gn5//mpqa/5qY
  16.198 +        mv+RkZH/i4uK/4KDg/9+fn7/QkND/yMkJP8nJyf/KSkp/ykpKf8QEBDZDg4OXA0NDSoGBgYEAAAAAAAA
  16.199 +        AAAAAAAAfn5+v11dXf9bW1v/VlZW/0tJSf+zsrL/1tbW/8/Pz//Jycn/wsLC/7W1tf+ura3/p6en/6Ki
  16.200 +        ov+cnJz/mZiZ/5OTk/+MjIz/hYWF/39/f/9GRUb/JCQk/ygoKP8pKSn/KSkp/xISEtkODg5cDQ0NKgYG
  16.201 +        BgQAAAAAAAAAAAAAAACBgYG/Xl5e/1xcXP9XWFf/SkpK/7S0tP/a29r/0tLS/83MzP/FxcX/v7+//7i4
  16.202 +        uP+xsbH/q6uq/6Ojo/+cnJz/lJWU/42Njf+GhYb/gICA/0lJSP8jIyP/KCgo/ykpKf8pKSn/FBQU2Q4O
  16.203 +        DlwNDQ0qBgYGBAAAAAAAAAAAAAAAAIODg79fX1//Xl5e/1lYWf9LS0v/tLS0/93d3f/U1NT/zs7O/8fG
  16.204 +        x//AwMD/ubm5/7Kysv+rq6v/pKSk/5ycnP+VlZb/jo6O/4eHh/+BgYH/TU1N/yMkJP8oKSj/Kikp/ykp
  16.205 +        Kf8YGBjZDg4OXA0NDSoGBgYEAAAAAAAAAAAAAAAAhYWFv2BgX/9eXl7/WlpZ/01NTf+2trb/3t7e/9XV
  16.206 +        1f/Oz8//x8fH/8HBwf+5ubr/srKz/6ysq/+kpKT/nZ2d/5WVlv+Ojo7/h4eH/4GBgf9QUFD/JCQk/ykp
  16.207 +        Kf8pKSn/KCgo/xoZGdkODg5cDQ0NKgYGBgQAAAAAAAAAAAAAAACIhoa/YGBg/15eXv9aWlr/T09P/7e3
  16.208 +        t//d3d3/1NTU/87Ozv/Hx8f/wMDA/7m5uf+ysrL/q6ur/6OjpP+cnJz/lZWV/46Ojf+Ghob/gYGB/1NT
  16.209 +        U/8mJib/Kioq/yorKv8oKCn/Gxwc2A4ODlwNDQ0qBgYGBAAAAAAAAAAAAAAAAIqKir9fX1//Xl5e/1pb
  16.210 +        Wv9RUVH/rKys/+Li4v/S0tL/zM3M/8XFxv+/v7//uLm4/7Kysf+rq6v/pKSk/52dnf+VlZX/jY6O/4eG
  16.211 +        h/+BgYH/U1JS/ykpKf8sLCz/Ki8x/ycuL/8eHh7YDQ0NXA0NDSoGBgYEAAAAAAAAAAAAAAAAjIuMv15e
  16.212 +        Xv9dXV3/Wlpa/1VVVf9cXFz/qqqq/7Gxsf+urq7/qqqq/6Sko/+dnZ3/lZWV/46Ojv+Hh4f/gH9//3d5
  16.213 +        d/9wcHD/aWlp/1xcXP8zMzP/LCws/y0tLf8rMDH/Jy0u/yAgINgNDQ1cDQ0NKgYGBgQAAAAAAAAAAAAA
  16.214 +        AACOjo6/XFxc/1xcXP9aWlr/VldX/1BRUP9MTEv/R0dH/0RERP9AQUD/Pj4+/zw8PP86Ozr/ODg4/zg4
  16.215 +        OP81NTX/MzMz/zExMf8wMDD/Li4v/y4uLv8uLS//Kj1A/yg5Pv8lODv/IyIi2A0NDVwNDQ0qBgYGBAAA
  16.216 +        AAAAAAAAAAAAAJGRkb9aW1v/W1ta/1hZWP9WVlb/VFRU/1BQUP9OTk7/TExM/0pJSv9HR0f/RUVF/0JC
  16.217 +        Qv9AQED/Pj4+/zw8PP86Ojr/Nzg3/zU1Nf8yMjL/MTEx/y8uLv8pOz//KDtA/yU6QP8lJCTYDQ0NWw0N
  16.218 +        DSoHBwcEAAAAAAAAAAAAAAAAk5OTv1hYWP9ZWVn/WFdY/1VVVf9SUlL/UFBQ/05OTv9NTE3/SkpK/0hI
  16.219 +        SP9GRkb/Q0JD/0BBQP8/Pz//PT09/zs7Ov84ODj/NjU1/zMzM/8xMTH/Ly4t/yFbZ/8qLzH/Jy4v/ygo
  16.220 +        KNIMDAxHDAwMIAcHBwMAAAAAAAAAAAAAAACSk5K/VVRV/1RVVf9UVFT/UlFR/09PT/9NTU7/TEtM/0pK
  16.221 +        Sv9ISUj/R0dH/0RFRP9BQUH/Pz8//z4+Pv87Ozz/OTo5/zc3N/80NDT/MTEx/y8wMP8uLi7/LSws/ykv
  16.222 +        MP8lLS7/LS0txQoKChQKCgoJAwMDAQAAAAAAAAAAAAAAAJeWl4+SkpK/kJCQv42Li7+Hh4e/hISEv4CA
  16.223 +        gL98fHy/d3d3v3R0dL9wcHC/bGpsv2ZmZr9jY2O/X19fv1tbW79VVVW/UlJSv05OTr9KSkq/REREv0FB
  16.224 +        Qb89PT2/OTk5vzMzM78xMTGPAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
  16.225 +        AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
  16.226 +        AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
  16.227 +        AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
  16.228 +        AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
  16.229 +        AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
  16.230 +        AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA////////
  16.231 +        ////////4AAAB+AAAAfgAAAH4AAAB+AAAAfgAAAH4AAAB+AAAAfgAAAH4AAAB+AAAAfgAAAH4AAAB+AA
  16.232 +        AAfgAAAH4AAAB+AAAAfgAAAH4AAAB+AAAAfgAAAH4AAAB+AAAAfgAAAH4AAAB+AAAAf/////////////
  16.233 +        //8oAAAAMAAAAGAAAAABACAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
  16.234 +        AAAAAAAAAAAAAAAAAAAAAAABAAAAAQAAAAEAAAABAAAAAQAAAAEAAAABAAAAAQAAAAEAAAABAAAAAQAA
  16.235 +        AAEAAAABAAAAAQAAAAEAAAABAAAAAQAAAAEAAAABAAAAAQAAAAEAAAABAAAAAQAAAAEAAAABAAAAAQAA
  16.236 +        AAEAAAABAAAAAQAAAAEAAAABAAAAAQAAAAEAAAABAAAAAQAAAAEAAAABAAAAAAAAAAAAAAAAAAAAAAAA
  16.237 +        AAAAAAAAAAAAAAAAAAAAAAAAAAAAAggICAcJCQkMCAgIDgcHBw4HBwcOBwcHDgcHBw4HBwcOBwcHDgcH
  16.238 +        Bw4HBwcOBwcHDgcHBw4HBwcOBwcHDgcHBw4HBwcOBwcHDgcHBw4HBwcOBwcHDgcHBw4HBwcOBwcHDgcH
  16.239 +        Bw4HBwcOBwcHDgcHBw4HBwcOBwcHDgcHBw4HBwcOBwcHDgcHBw4HBwcOBwcHDggICA4JCQkMCAgIBwAA
  16.240 +        AAIAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAACAgIBwsLCxkNDQ0sDQ0NMg0NDTMNDQ0zDQ0NMw0N
  16.241 +        DTMNDQ0zDQ0NMw0NDTMNDQ0zDQ0NMw0NDTMNDQ0zDQ0NMw0NDTMNDQ0zDQ0NMw0NDTMNDQ0zDQ0NMw0N
  16.242 +        DTMNDQ0zDQ0NMw0NDTMNDQ0zDQ0NMw0NDTMNDQ0zDQ0NMw0NDTMNDQ0zDQ0NMw0NDTMNDQ0zDQ0NMw0N
  16.243 +        DTINDQ0sCwsLGggICAcAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABCQkJDA0NDSwNDQ1MDg4OVw4O
  16.244 +        DlkODg5ZDg4OWQ4ODlkODg5ZDg4OWQ4ODlkODg5ZDg4OWQ4ODlkODg5ZDg4OWQ4ODlkODg5ZDg4OWQ4O
  16.245 +        DlkODg5ZDg4OWQ4ODlkODg5ZDg4OWQ4ODlkODg5ZDg4OWQ4ODlkODg5ZDg4OWQ4ODlkODg5ZDg4OWQ4O
  16.246 +        DlkODg5ZDg4OWQ4ODlcNDQ1MDQ0NLAkJCQwAAAABAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABBQUFDgoK
  16.247 +        CjILCwtXCwsLZAsLC2YLCwtmCwsLZgsLC2YMDAxmDAwMZgwMDGYMDAxmDAwMZgwMDGYMDAxmDAwMZgwM
  16.248 +        DGYNDQ1mDQ0NZg0NDWYNDQ1mDQ0NZg0NDWYNDQ1mDQ0NZg4ODmYODg5mDg4OZg4ODmYODg5mDg4OZg4O
  16.249 +        DmYODg5mDg4OZg4ODmYODg5mDg4OZg4ODmQODg5XDQ0NMggICA4AAAABAAAAAAAAAAAAAAAAAAAAAAAA
  16.250 +        AABiYmL/XFxc/1paWv9VVVf/U1NS/1FRUf9OTk7/S0pL/0dHR/9DQ0P/QUFB/z8+P/88PDz/Ojk5/zU1
  16.251 +        Nf8yMjL/MDAw/y0tLv8qKir/JiYm/yQjJP8hISH/Hh4e/xsbHP8ZGRn/FBQU/xEREf8PDw//Dg4O/w4O
  16.252 +        Dv8ODg7/Dg4O/w4ODv8ODg7/Dg4O/w4ODv8ODg7/Dw8P/w4ODmYODg5ZDQ0NMwcHBw4AAAABAAAAAAAA
  16.253 +        AAAAAAAAAAAAAAAAAABiYmH/Pjw8/z88O/9AOzr/QDs6/z86Of89Ojr/PTo6/zs7O/86Ozr/Ozo7/zo6
  16.254 +        Ov85OTn/ODg4/zc3N/82NjX/NTU0/zMzM/8yMjL/MTEx/zEyMf8wMDD/MDAw/y8uLv8uLS3/LCor/yoo
  16.255 +        KP8pJyf/KCYl/yYkJP8lIyP/JCIh/yIhIP8gHh7/IB4d/yAdHf8fHh7/Dg4O/w4ODmYODg5ZDQ0NMwcH
  16.256 +        Bw4AAAABAAAAAAAAAAAAAAAAAAAAAAAAAABjY2P/QT49/xqYs/8blrD/Gpaw/xqXsv8igpb/Pj09/z09
  16.257 +        Pf88PDz/Ozs7/zo6Ov85OTn/ODg4/zc3N/82Njb/NDQ0/zMzM/8zMjL/MjEx/zAxMP8vLy//Ly8v/y4u
  16.258 +        Lf8iVmH/IVRf/yFUX/8fU13/IFNd/x9TXP8fUVz/HlBb/x5RW/8dUFr/HE9Z/xxQW/8fHh7/Dg4O/w4O
  16.259 +        DmYODg5ZDQ0NMwcHBw4AAAABAAAAAAAAAAAAAAAAAAAAAAAAAABkZGT/Qj08/xqVr/8ckqv/G5St/yR/
  16.260 +        kv9APDv/Pz4+/z49Pv89PDz/Ozs7/zo6Ov85OTn/ODg4/zY3N/81NTX/NDQ0/zMzM/8yMjL/MTEx/zAw
  16.261 +        L/8vLy//Li4u/y0tLP8sKir/LSko/yomJv8pJSX/JyQj/ygiIv8mIiH/JSAg/yQfHv8jHhz/Ih0c/x8d
  16.262 +        Hf8fHh//Dg4O/w4ODmYODg5ZDQ0NMwcHBw4AAAABAAAAAAAAAAAAAAAAAAAAAAAAAABlZWX/RkFA/xqW
  16.263 +        sP8blK3/JICT/0I+Pf9APz//Pz4//z4+Pv88PDz/Ojo6/zk5Of83Nzf/NjU2/zQ0NP8zMzP/MjIy/zEx
  16.264 +        Mf8wMDD/Ly8w/y8vL/8uLi7/LS0t/ywsLP8rKyr/IFVf/x9TXf8fVF3/IFNd/x9TXP8fUVz/H1Fc/x5R
  16.265 +        W/8eUFv/HVBb/x8eH/8fHyD/Dg4O/w4ODmYODg5ZDQ0NMwcHBw4AAAABAAAAAAAAAAAAAAAAAAAAAAAA
  16.266 +        AABmZmb/RkJC/xmXsf8lgZP/RkFB/0JBQf9BQUD/Pz8//z09Pf86Ozr/ODg4/zU2Nf8zMzP/MjIy/zEx
  16.267 +        Mf8wMDD/Ly8v/y8vL/8uLi7/Li4u/y0tLf8rKyv/Kior/ykpKf8oJyf/JyYm/yYkJP8mIyT/JSMj/yUi
  16.268 +        I/8lIyP/JCIi/yQiIv8jISL/IiEg/yEfIP8fHx//Dg4O/w4ODmYODg5ZDQ0NMwcHBw4AAAABAAAAAAAA
  16.269 +        AAAAAAAAAAAAAAAAAABoaGj/SEVF/ySDmP9HQ0L/R0VF/0NDQ/9BQUD/Pz8+/zs6O/82Njb/MTEx/y4u
  16.270 +        Lv8sLC3/LS0t/ywsLP8rKyv/KSop/ykpKf8oKCj/KCgo/ycnJ/8nJib/JSUl/yUkJf8kJCT/IyQj/yMi
  16.271 +        I/8iIiL/IiMi/yMjI/8kIyT/JCQk/yMjJP8jIyP/IyMj/yIiIf8gICD/Dg4O/w4ODmYODg5ZDQ0NMwcH
  16.272 +        Bw4AAAABAAAAAAAAAAAAAAAAAAAAAAAAAABpamr/SEdH/0lHR/9JR0f/R0dG/0RERf9BQUH/PDw8/z4/
  16.273 +        P/99e33/dXV1/3BwcP9ra2v/ZWRl/2BfX/9aWlr/VVVW/1FRUf9MTEz/R0dH/0FBQf8+PDz/Nzg3/zMz
  16.274 +        M/8wMDD/MDAw/y8vMP8wMDD/MTAx/ycnJ/8hISL/IyMj/yQkJP8kJCT/IyMk/yMiIv8hISH/Dg4O/w4O
  16.275 +        DmYODg5ZDQ0NMwcHBw4AAAABAAAAAAAAAAAAAAAAAAAAAAAAAABta2v/SkpK/0pKSv9JSUn/SEhI/0ZF
  16.276 +        Rf9AQED/QkJC/8nJyf+rq6v/n5+e/56env+cnJz/mpqa/5eXl/+UlJT/kpKR/4+Pj/+MjIz/iIqK/4aH
  16.277 +        hv+Dg4P/gICA/3x8fP94eHj/dHRz/3Fxcf9ycnL/ZWVl/05PTv8nJyf/IiIi/yMkI/8kJCT/IyMj/yMj
  16.278 +        I/8jISP/Dg4O/w4ODmYODg5ZDQ0NMwcHBw4AAAABAAAAAAAAAAAAAAAAAAAAAAAAAABubm3/S0tM/0tM
  16.279 +        S/9LS0v/SUlJ/0ZGRv9APz//jIuM/7Ozs/+jo6P/oqKi/6CgoP+enp7/nJyc/5mamf+Xlpf/lJSU/5CR
  16.280 +        kf+Ojo7/i4uL/4eHh/+Dg4P/gH+A/3x8fP94eHj/dXR0/3BwcP9vb2//cHBw/2VlZf8wMDD/IiIi/yMj
  16.281 +        I/8kJCT/JCQk/yQjJP8jJCP/Dg4O/w4ODmYODg5ZDQ0NMwcHBw4AAAABAAAAAAAAAAAAAAAAAAAAAAAA
  16.282 +        AABwcG//TU1N/01NTf9MTEz/SkpK/0dHR/8/Pj//jo6O/6urq/+pqan/p6em/6WkpP+ioqL/oKCg/52e
  16.283 +        nv+bm5v/mJiY/5WUlP+RkZH/jo6O/4qKi/+Hh4f/g4OD/39/f/98fHz/d3d3/3Nzc/9vb2//b29v/3Jy
  16.284 +        cv8vLy//ICEg/yMjI/8lJCT/JCQk/yQkJP8kJCT/Dg4O/w4ODmYODg5ZDQ0NMwcHBw4AAAABAAAAAAAA
  16.285 +        AAAAAAAAAAAAAAAAAABxcXH/Tk5O/05OT/9NTU3/TExM/0hISP9AQED/kJCQ/7Cwr/+tra3/rKyr/6mp
  16.286 +        qf+np6f/pKSl/6Giof+fn5//nJyc/5iYmP+VlZX/kZGS/46Ojv+Kior/hoaG/4KCgv9+fn7/enp7/3Z2
  16.287 +        dv9xcnH/b29v/3Jycv8vLi7/ISAh/yMjI/8kJCX/JSUl/yQkJf8lJST/Dg4O/w4ODmYODg5ZDQ0NMwcH
  16.288 +        Bw4AAAABAAAAAAAAAAAAAAAAAAAAAAAAAABzc3P/T09P/09PT/9PT0//TU1M/0lJSf9BQEH/kpKS/7W0
  16.289 +        tP+xsbH/r6+w/66urv+rq6v/qamp/6alpf+ioqL/n5+f/5ycnP+YmZj/lJWV/5GRkf+NjY3/iYmJ/4WF
  16.290 +        hf+BgYH/fX19/3l5ef90dHT/cHBw/3Jycv8uLi7/ISEg/yQkJP8lJSX/JiUm/yYlJf8lJSX/Dg4O/w4O
  16.291 +        DmYODg5ZDQ0NMwcHBw4AAAABAAAAAAAAAAAAAAAAAAAAAAAAAAB0dHT/UVFR/1FQUf9PT0//Tk5O/0tK
  16.292 +        Sv9CQkL/lZWV/7i4uP+2tbX/s7Oz/7Gxsf+vr6//ra2t/6mqqv+mpqb/oqKj/5+fn/+cnJz/mJiY/5SU
  16.293 +        lP+QkI//jIyM/4iIiP+Dg4P/f39//3t7e/93d3b/cnJy/3Jycv8uLy//ISEh/yQkJP8mJiX/JiYm/yYm
  16.294 +        Jf8mJSX/Dg4O/w4ODmYODg5ZDQ0NMwcHBw4AAAABAAAAAAAAAAAAAAAAAAAAAAAAAAB1dXX/U1NU/1NT
  16.295 +        U/9QUVH/T05O/0xMTP9CQkL/l5eX/76+vv+6urr/t7i3/7W1tf+ysrL/sLCw/66trf+rqqz/pqem/6Ki
  16.296 +        ov+fn5//m5ub/5eWl/+SkpL/jo+O/4uKiv+Ghob/gYKB/31+fv95eXn/dHR0/3Nzc/8vLy//IyEj/yQk
  16.297 +        JP8mJib/JyYn/yYmJv8mJib/Dg4O/w4ODmYODg5ZDQ0NMwcHBw4AAAABAAAAAAAAAAAAAAAAAAAAAAAA
  16.298 +        AAB2d3b/VVVV/1VVVf9TUlL/UFBQ/01NTf9ERET/mpqa/8LCwv++v7//vLy8/7m5uv+2trf/s7Oz/62t
  16.299 +        rf+mpqb/oqOj/56en/+bm5r/lpeX/5OTkv+Ojo7/jY6N/42Njf+JiYj/hIOD/39/f/97e3v/dnd2/3V1
  16.300 +        dP8vLy//ISEh/yQlJf8mJib/Jycn/ycmJv8mJyb/Dg4O/w4ODmYODg5ZDQ0NMwcHBw4AAAABAAAAAAAA
  16.301 +        AAAAAAAAAAAAAAAAAAB4d3j/VlZW/1ZWVv9UVFT/UVFR/05OTv9FRET/nJyc/8bGxv/CwsP/wMDA/72+
  16.302 +        vf+6u7r/t7e3/7CwsP+pqan/pqam/6Khov+dnZ3/mZmZ/5WVlf+UlJT/k5OT/4+Pj/+Li4v/hoaG/4GB
  16.303 +        gf99fX3/eHh4/3Z3dv8vLy//ISIj/yUlJf8nJyb/KCco/ygnJ/8nJyf/Dg4O/w4ODmYODg5ZDQ0NMwcH
  16.304 +        Bw4AAAABAAAAAAAAAAAAAAAAAAAAAAAAAAB5eXn/WFhY/1dXV/9WVlb/UlNT/09PT/9GRkb/n5+f/8rL
  16.305 +        yv/Gxsb/w8TE/8HBwf+9vb7/urq6/7Ozs/+srKz/qKio/6SlpP+goKD/m5ub/5eXl/+Tk5P/kpKS/5CR
  16.306 +        kP+NjY3/iIiI/4ODg/9+f3//enp7/3h4eP8wMC//IiIi/yYmJf8nJyf/KCgo/ycnJ/8oJyf/Dg4O/w4O
  16.307 +        DmYODg5ZDQ0NMwcHBw4AAAABAAAAAAAAAAAAAAAAAAAAAAAAAAB6e3v/WVla/1lZWf9XV1f/VFRV/09Q
  16.308 +        T/9GRkb/oqGi/8/Pz//Ky8r/x8jH/8TExP/BwcH/vr2+/7a2tv+vr6//qqur/6enp/+ioqL/np6e/5mZ
  16.309 +        mf+VlZX/lJSU/5OSkv+Ojo7/ioqK/4WFhf+AgID/fHx8/3h5ev8wMDD/IyIj/yYmJv8oJyj/KCgq/ygo
  16.310 +        KP8nKCj/Dw8P/w4ODmYODg5ZDQ0NMwcHBw4AAAABAAAAAAAAAAAAAAAAAAAAAAAAAAB8fHz/W1ta/1pa
  16.311 +        Wv9YWFj/VVZW/1BQUP9HR0f/pKSk/9LS0v/Ozs7/y8vL/8fHx//DxMT/wMDA/7m5uf+ysrH/ra2t/6mo
  16.312 +        qP+lpaX/oKCg/5ubm/+Xlpf/mZma/5SUlP+QkI//i4uL/4aGhv+BgYH/fX19/3t7e/8wMDD/IyMj/yYm
  16.313 +        Jv8oKCf/KSko/ykoKP8oKCj/EBAQ/w4ODmYODg5ZDQ0NMwcHBw4AAAABAAAAAAAAAAAAAAAAAAAAAAAA
  16.314 +        AAB+fn3/XFxc/1xbXP9aWVn/V1dW/1FRUf9ISEj/paWl/9bW1v/R0dH/zs7O/8vKyv/Gxsb/w8LC/7i4
  16.315 +        t/+srKz/p6mn/6Ojov+enp7/oqKi/6Wlpf+fn5//m5qb/5WWlv+RkZD/jY2M/4iIh/+CgoL/fn5+/3x8
  16.316 +        fP8xMjL/IyMj/yYnJ/8oKCj/KSkp/ygoKf8oKSj/ERER/w4ODmYODg5ZDQ0NMwcHBw4AAAABAAAAAAAA
  16.317 +        AAAAAAAAAAAAAAAAAAB/f3//XV1d/11dXf9aWlv/WFhX/1JSUv9JSUn/pKSk/9ra2v/U1NT/0NDQ/83N
  16.318 +        zf/Iycn/xMTE/729vf+1tbb/sbGx/6ysrP+oqKj/oqKk/52dnv+YmJj/mJiY/5eXl/+SkpL/jo6N/4iJ
  16.319 +        iP+Dg4P/f39//319ff80NDT/IyMj/ycnJ/8oKCj/KSkp/ykpKf8oKCj/ExMT/w4ODmYODg5ZDQ0NMwcH
  16.320 +        Bw4AAAABAAAAAAAAAAAAAAAAAAAAAAAAAACAgID/Xl5e/15eXv9cXFz/WVlZ/1NTU/9JSUn/pKSk/93d
  16.321 +        3f/X19b/0tLS/8/Pz//Ly8v/xsbG/8LCwv+9vr7/uLi5/7S0tP+wsLD/rKys/6enpv+hoaH/nZ2d/5iY
  16.322 +        mP+Sk5P/jo6O/4mJif+EhIT/f4CA/35+fv82Njb/JCMk/ycnJ/8oKCj/KSkp/ykpKf8pKSn/FhYW/w0N
  16.323 +        DWYODg5ZDQ0NMwcHBw4AAAABAAAAAAAAAAAAAAAAAAAAAAAAAACCgoL/X19e/15eXv9dXF3/WVpZ/1RU
  16.324 +        VP9KSUr/paWl/+Hh4P/Z2tr/1dXU/9DQ0P/NzM3/x8fH/8PDw/+/vr7/urq6/7W1tf+wsLD/rK2t/6en
  16.325 +        p/+ioqL/np2d/5mZmP+UlJP/j4+P/4qKiv+FhYX/gICA/319ff85OTn/IyMk/ycnJ/8oKCn/KSkp/ykp
  16.326 +        Kf8pKSf/GBcY/w0NDWYODg5ZDQ0NMwcHBw4AAAABAAAAAAAAAAAAAAAAAAAAAAAAAACDhIT/YGBg/19f
  16.327 +        X/9eXV3/Wlpa/1VVVf9LSkv/paWl/+Hi4v/b29v/1tbV/9HR0f/Nzc3/yMjI/8PDxP+/v7//uru6/7W1
  16.328 +        tf+xsbH/ra2t/6ioqP+io6P/np6e/5mZmf+UlJT/j4+P/4uKiv+FhYX/gICA/35+ff88PDz/JCQk/ycn
  16.329 +        J/8pKSn/Kiop/ykpKf8oJyj/GRka/w0NDWYODg5ZDQ0NMwcHBw4AAAABAAAAAAAAAAAAAAAAAAAAAAAA
  16.330 +        AACEhIT/YGBg/19fX/9eXl7/Wlpb/1ZWVv9LS0v/paWl/+Li4v/c3Nz/1tfW/9HS0f/Nzs7/ycjJ/8TE
  16.331 +        xP+/wMD/u7q7/7a1tv+xsbH/ra2t/6iop/+jo6L/np6e/5mZmf+UlJT/j4+Q/4uKiv+GhYX/gICA/35+
  16.332 +        fv8/QED/JSUl/ygoJ/8pKSn/Kiop/ykpKf8oKCj/Gxsb/w0NDWYODg5ZDQ0NMwcHBw4AAAABAAAAAAAA
  16.333 +        AAAAAAAAAAAAAAAAAACFh4f/YGBg/19fX/9eXl7/Wlpb/1ZWV/9MTEz/pqam/+Hi4f/b29v/1tbW/9HR
  16.334 +        0f/Nzc3/yMjJ/8TExP+/v7//u7u7/7W2tf+xsbH/ra2t/6ioqP+jo6P/np6e/5mZmf+UlJT/j4+P/4qK
  16.335 +        iv+FhYX/gICA/31+ff9CQkL/JiYm/ygoKP8pKSn/Kioq/ykpKf8oKCj/HBwc/w0NDWYODg5ZDQ0NMwcH
  16.336 +        Bw4AAAABAAAAAAAAAAAAAAAAAAAAAAAAAACIiIj/YGBg/19fX/9eXl7/W1tb/1hXV/9OTk3/p6en/+Hh
  16.337 +        4f/a2dr/1dXV/9DQ0P/Nzc3/yMjH/8PDw/++v7//urq6/7W1tf+wsbD/rK2t/6eop/+ioqL/np6e/5mZ
  16.338 +        mf+TlJT/j4+P/4qKiv+FhIX/gICA/359ff9GRkb/Jicm/yopKv8qKyr/Kisq/ykpKf8oKCj/HR4e/w0N
  16.339 +        DWYODg5ZDQ0NMwcHBw4AAAABAAAAAAAAAAAAAAAAAAAAAAAAAACJiYn/YGBg/19fX/9eXl7/W1tb/1hY
  16.340 +        WP9QUFD/qamp/+jo6P/W1tb/0tPT/8/Pz//Ly8v/xsbG/8LCwv++vr7/ubm5/7S0tP+wsLD/rKyr/6en
  16.341 +        pv+hoqL/nZ2d/5iYmP+Tk5P/jo+O/4mJif+EhIT/f3+A/3t7e/9KSkv/KCgo/ysrK/8sLCz/Kyoq/yop
  16.342 +        Kv8pJyf/Hx8f/w0NDWYODg5ZDQ0NMwcHBw4AAAABAAAAAAAAAAAAAAAAAAAAAAAAAACLi4v/X19e/15e
  16.343 +        X/9dXV3/W1tb/1lYWP9UVFT/V1dY///////j4+P/09PT/8/Pz//Kysr/xcfH/8HBwv+/vr//ubm5/7W1
  16.344 +        tf+wsLD/rK2s/6amqP+ioqL/np2e/5mZmf+Uk5T/kJCQ/4uLi/+Ghob/gYGB/3x8fP8xMC//Kyos/yws
  16.345 +        LP8tLCz/Kyoq/xeBlv8oJif/IiIi/w0NDWYODg5ZDQ0NMwcHBw4AAAABAAAAAAAAAAAAAAAAAAAAAAAA
  16.346 +        AACMjIz/Xl1d/15eXv9dXFz/W1tb/1hZWf9WVlX/Tk5O/1ZXVv+np6f/paWl/6SkpP+ioqL/oKCg/5yc
  16.347 +        nP+YmJj/k5OT/46Pj/+JiYn/hYSF/4CAgP97e3z/dnZ2/3Fycf9tbW3/Z2Zm/2JiYv9dXV3/Wlpa/zMz
  16.348 +        M/8sLSz/Li4t/y0tLf8tLS3/LCop/yknJv8nJiT/JCQk/w0NDWYODg5ZDQ0NMwcHBw4AAAABAAAAAAAA
  16.349 +        AAAAAAAAAAAAAAAAAACOjo7/XF5c/15eXv9bW1z/Wlpa/1hYWP9WVlf/UlNT/05PT/9LS0r/R0dH/0RE
  16.350 +        RP9CQkL/QEBA/z4/P/88PD3/Ozs7/zs7PP86Ojr/OTk5/zg4OP82Njb/NTQ1/zQzNP8zMzP/MTEx/zAw
  16.351 +        MP8vLy//Ly8v/y4uLv8vLy//Li8u/y4tLf8tLSz/Kyoo/xeBlv8oJif/JiYm/w0NDWYODg5ZDQ0NMwcH
  16.352 +        Bw4AAAABAAAAAAAAAAAAAAAAAAAAAAAAAACQj5D/XVtb/11dXP9bW1v/WVlZ/1hYWP9WVlb/U1RT/1JS
  16.353 +        Uf9PT0//Tk5N/0tMS/9KSkr/SEhI/0dGR/9FREX/QkJD/0FBQv9AQED/Pz8//z4+Pv89PT3/Ozs7/zk5
  16.354 +        Ov84ODj/NjY3/zU1Nf8zMzP/MjIy/zExMf8vMC//Ly8v/y8tLf8XgJX/LCgn/yknJv8pJiX/Jycn/w0N
  16.355 +        DWYODg5ZDQ0NMwcHBw4AAAABAAAAAAAAAAAAAAAAAAAAAAAAAACSkpL/Wlpa/1tbW/9aWlr/WVlY/1dX
  16.356 +        V/9WVVb/VFRU/1JSUf9QT1D/Tk5O/01NTf9MTEz/SkpK/0hJSP9HR0f/RkZG/0RERP9CQkL/QEBA/z8/
  16.357 +        P/8+Pj7/PT09/zs7O/85OTn/ODg4/zc3Nv80NDT/MzMz/zIyMv8wMDD/Ly8v/y8sLP8uKiv/LSgn/xiO
  16.358 +        qv8oJyb/KSgp/w0NDWQODg5XDQ0NMggICA4AAAABAAAAAAAAAAAAAAAAAAAAAAAAAACTk5P/WVhY/1pa
  16.359 +        Wv9ZWVn/WFhY/1dXVv9VVVT/U1NT/1FRUf9QT1D/T09P/01OTv9MTEz/S0pL/0lJSf9ISEj/RkZG/0RE
  16.360 +        RP9DQkL/QUFB/0A/P/8+Pz7/PT0+/zs8PP86Ojr/OTk5/zc4N/81NTT/MzMz/zEyMv8wMDD/Ly8v/y4t
  16.361 +        Lf8XgJX/LSco/ysmJv8oJCX/Kysr/w0NDVcNDQ1MDQ0NLAkJCQwAAAABAAAAAAAAAAAAAAAAAAAAAAAA
  16.362 +        AACTk5P/V1dX/1lYWP9YWFf/V1dX/1ZWVv9VVVX/UlJS/1BRUf9PT0//Tk5O/01NTf9MTEz/S0pK/0lJ
  16.363 +        Sf9HR0f/RkZG/0RFRP9CQkL/QUFA/z8/P/8/Pz7/PT09/zs8PP86Ojr/ODg4/zc3Nv80NDX/MzMz/zEy
  16.364 +        Mv8wMC//Ly8v/y4tLf8tLCz/Kyko/xiOqv8nJSX/LS0t/wwMDDINDQ0sCwsLGggICAcAAAAAAAAAAAAA
  16.365 +        AAAAAAAAAAAAAAAAAACSkpL/VFVV/1VVVf9UVVX/U1NT/1JSUv9RUVH/T09P/05OTv9NTU3/TExM/0pL
  16.366 +        S/9LSUn/SUlJ/0hISP9GRkf/RUVF/0NDQ/9BQUH/QD8//z4+Pv89Pj3/PDw8/zo6Ov85OTn/ODg4/zY2
  16.367 +        Nv8zNDP/MjIx/zAwMP8vLy//Li4u/y0tLf8tLS3/Kykp/ykmJv8nJST/Ly8v/wcHBw4JCQkMCAgIBwAA
  16.368 +        AAIAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAACWlZX/k5KS/5KSkv+PkI//jY2N/4mJif+Hh4b/hYWF/4KC
  16.369 +        g/9/gH//fXx8/3p5ef92dnb/dHR0/3Jycv9wcG//a2tr/2hoaP9lZmX/Y2Rj/2FhYf9eXl//XFxc/1hY
  16.370 +        WP9VVFX/U1JS/1BQUP9NTU3/S0tL/0hISP9DREP/QUFB/z8/P/88PTz/OTk5/zY2Nv8yMjL/MTEx/wAA
  16.371 +        AAEAAAABAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
  16.372 +        AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
  16.373 +        AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
  16.374 +        AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
  16.375 +        AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
  16.376 +        AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
  16.377 +        AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
  16.378 +        AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
  16.379 +        AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
  16.380 +        AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
  16.381 +        AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
  16.382 +        AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
  16.383 +        AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
  16.384 +        AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
  16.385 +        AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
  16.386 +        AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
  16.387 +        AAAAAAAAAAAAAAAAAAAAAAAA////////AAD///////8AAP///////wAA////////AAD///////8AAPgA
  16.388 +        AAAAHwAA+AAAAAAfAAD4AAAAAB8AAPgAAAAAHwAA+AAAAAAfAAD4AAAAAB8AAPgAAAAAHwAA+AAAAAAf
  16.389 +        AAD4AAAAAB8AAPgAAAAAHwAA+AAAAAAfAAD4AAAAAB8AAPgAAAAAHwAA+AAAAAAfAAD4AAAAAB8AAPgA
  16.390 +        AAAAHwAA+AAAAAAfAAD4AAAAAB8AAPgAAAAAHwAA+AAAAAAfAAD4AAAAAB8AAPgAAAAAHwAA+AAAAAAf
  16.391 +        AAD4AAAAAB8AAPgAAAAAHwAA+AAAAAAfAAD4AAAAAB8AAPgAAAAAHwAA+AAAAAAfAAD4AAAAAB8AAPgA
  16.392 +        AAAAHwAA+AAAAAAfAAD4AAAAAB8AAPgAAAAAHwAA+AAAAAAfAAD4AAAAAB8AAPgAAAAAHwAA+AAAAAAf
  16.393 +        AAD///////8AAP///////wAA////////AAD///////8AAP///////wAA
  16.394 +</value>
  16.395 +  </data>
  16.396 +</root>
  16.397 \ No newline at end of file
    17.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
    17.2 +++ b/GUI/PlotPanel.Designer.cs	Tue Jan 26 22:37:48 2010 +0000
    17.3 @@ -0,0 +1,79 @@
    17.4 +/*
    17.5 +  
    17.6 +  Version: MPL 1.1/GPL 2.0/LGPL 2.1
    17.7 +
    17.8 +  The contents of this file are subject to the Mozilla Public License Version
    17.9 +  1.1 (the "License"); you may not use this file except in compliance with
   17.10 +  the License. You may obtain a copy of the License at
   17.11 + 
   17.12 +  http://www.mozilla.org/MPL/
   17.13 +
   17.14 +  Software distributed under the License is distributed on an "AS IS" basis,
   17.15 +  WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
   17.16 +  for the specific language governing rights and limitations under the License.
   17.17 +
   17.18 +  The Original Code is the Open Hardware Monitor code.
   17.19 +
   17.20 +  The Initial Developer of the Original Code is 
   17.21 +  Michael Möller <m.moeller@gmx.ch>.
   17.22 +  Portions created by the Initial Developer are Copyright (C) 2009-2010
   17.23 +  the Initial Developer. All Rights Reserved.
   17.24 +
   17.25 +  Contributor(s):
   17.26 +
   17.27 +  Alternatively, the contents of this file may be used under the terms of
   17.28 +  either the GNU General Public License Version 2 or later (the "GPL"), or
   17.29 +  the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
   17.30 +  in which case the provisions of the GPL or the LGPL are applicable instead
   17.31 +  of those above. If you wish to allow use of your version of this file only
   17.32 +  under the terms of either the GPL or the LGPL, and not to allow others to
   17.33 +  use your version of this file under the terms of the MPL, indicate your
   17.34 +  decision by deleting the provisions above and replace them with the notice
   17.35 +  and other provisions required by the GPL or the LGPL. If you do not delete
   17.36 +  the provisions above, a recipient may use your version of this file under
   17.37 +  the terms of any one of the MPL, the GPL or the LGPL.
   17.38 + 
   17.39 +*/
   17.40 +
   17.41 +namespace OpenHardwareMonitor.GUI {
   17.42 +  partial class PlotPanel {
   17.43 +    /// <summary> 
   17.44 +    /// Required designer variable.
   17.45 +    /// </summary>
   17.46 +    private System.ComponentModel.IContainer components = null;
   17.47 +
   17.48 +    /// <summary> 
   17.49 +    /// Clean up any resources being used.
   17.50 +    /// </summary>
   17.51 +    /// <param name="disposing">true if managed resources should be disposed; otherwise, false.</param>
   17.52 +    protected override void Dispose(bool disposing) {
   17.53 +      if (disposing && (components != null)) {
   17.54 +        components.Dispose();
   17.55 +      }
   17.56 +      base.Dispose(disposing);
   17.57 +    }
   17.58 +
   17.59 +    #region Component Designer generated code
   17.60 +
   17.61 +    /// <summary> 
   17.62 +    /// Required method for Designer support - do not modify 
   17.63 +    /// the contents of this method with the code editor.
   17.64 +    /// </summary>
   17.65 +    private void InitializeComponent() {
   17.66 +      this.SuspendLayout();
   17.67 +      // 
   17.68 +      // PlotPanel
   17.69 +      // 
   17.70 +      this.AutoScaleDimensions = new System.Drawing.SizeF(7F, 15F);
   17.71 +      this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
   17.72 +      this.BorderStyle = System.Windows.Forms.BorderStyle.Fixed3D;
   17.73 +      this.Font = new System.Drawing.Font("Segoe UI", 9F);
   17.74 +      this.Name = "PlotPanel";
   17.75 +      this.Size = new System.Drawing.Size(170, 168);
   17.76 +      this.ResumeLayout(false);
   17.77 +
   17.78 +    }
   17.79 +
   17.80 +    #endregion
   17.81 +  }
   17.82 +}
    18.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
    18.2 +++ b/GUI/PlotPanel.cs	Tue Jan 26 22:37:48 2010 +0000
    18.3 @@ -0,0 +1,258 @@
    18.4 +/*
    18.5 +  
    18.6 +  Version: MPL 1.1/GPL 2.0/LGPL 2.1
    18.7 +
    18.8 +  The contents of this file are subject to the Mozilla Public License Version
    18.9 +  1.1 (the "License"); you may not use this file except in compliance with
   18.10 +  the License. You may obtain a copy of the License at
   18.11 + 
   18.12 +  http://www.mozilla.org/MPL/
   18.13 +
   18.14 +  Software distributed under the License is distributed on an "AS IS" basis,
   18.15 +  WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
   18.16 +  for the specific language governing rights and limitations under the License.
   18.17 +
   18.18 +  The Original Code is the Open Hardware Monitor code.
   18.19 +
   18.20 +  The Initial Developer of the Original Code is 
   18.21 +  Michael Möller <m.moeller@gmx.ch>.
   18.22 +  Portions created by the Initial Developer are Copyright (C) 2009-2010
   18.23 +  the Initial Developer. All Rights Reserved.
   18.24 +
   18.25 +  Contributor(s):
   18.26 +
   18.27 +  Alternatively, the contents of this file may be used under the terms of
   18.28 +  either the GNU General Public License Version 2 or later (the "GPL"), or
   18.29 +  the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
   18.30 +  in which case the provisions of the GPL or the LGPL are applicable instead
   18.31 +  of those above. If you wish to allow use of your version of this file only
   18.32 +  under the terms of either the GPL or the LGPL, and not to allow others to
   18.33 +  use your version of this file under the terms of the MPL, indicate your
   18.34 +  decision by deleting the provisions above and replace them with the notice
   18.35 +  and other provisions required by the GPL or the LGPL. If you do not delete
   18.36 +  the provisions above, a recipient may use your version of this file under
   18.37 +  the terms of any one of the MPL, the GPL or the LGPL.
   18.38 + 
   18.39 +*/
   18.40 +
   18.41 +using System;
   18.42 +using System.Collections.Generic;
   18.43 +using System.ComponentModel;
   18.44 +using System.Drawing;
   18.45 +using System.Drawing.Drawing2D;
   18.46 +using System.Windows.Forms;
   18.47 +using OpenHardwareMonitor.Hardware;
   18.48 +
   18.49 +namespace OpenHardwareMonitor.GUI {
   18.50 +  public partial class PlotPanel : UserControl {
   18.51 +
   18.52 +    private DateTime now;
   18.53 +    private List<ISensor> clocks = new List<ISensor>();
   18.54 +    private List<ISensor> temperatures = new List<ISensor>();
   18.55 +    private List<ISensor> fans = new List<ISensor>();
   18.56 +    private IDictionary<ISensor, Color> colors;
   18.57 +
   18.58 +    private StringFormat centerlower;
   18.59 +    private StringFormat centerleft;
   18.60 +    private StringFormat lowerleft;
   18.61 +    private Brush lightBrush;
   18.62 +    private Pen lightPen;
   18.63 +
   18.64 +    public PlotPanel() {
   18.65 +      this.SetStyle(ControlStyles.DoubleBuffer |
   18.66 +        ControlStyles.UserPaint |
   18.67 +        ControlStyles.AllPaintingInWmPaint | 
   18.68 +        ControlStyles.ResizeRedraw, true);
   18.69 +      this.UpdateStyles();
   18.70 +
   18.71 +      InitializeComponent();
   18.72 +
   18.73 +      centerlower = new StringFormat();
   18.74 +      centerlower.Alignment = StringAlignment.Center;
   18.75 +      centerlower.LineAlignment = StringAlignment.Near;
   18.76 +
   18.77 +      centerleft = new StringFormat();
   18.78 +      centerleft.Alignment = StringAlignment.Far;
   18.79 +      centerleft.LineAlignment = StringAlignment.Center;
   18.80 +
   18.81 +      lowerleft = new StringFormat();
   18.82 +      lowerleft.Alignment = StringAlignment.Far;
   18.83 +      lowerleft.LineAlignment = StringAlignment.Near;
   18.84 +
   18.85 +      lightBrush = new SolidBrush(Color.FromArgb(245, 245, 245));
   18.86 +      lightPen = new Pen(Color.FromArgb(200, 200, 200));
   18.87 +    }
   18.88 +
   18.89 +    private List<float> GetTemperatureGrid() {
   18.90 +
   18.91 +      float? minTempNullable = null;
   18.92 +      float? maxTempNullable = null;
   18.93 +      foreach (ISensor sensor in temperatures) {
   18.94 +        IEnumerable<ISensorEntry> graph = sensor.Plot;
   18.95 +        foreach (ISensorEntry entry in graph) {
   18.96 +          if (!minTempNullable.HasValue || minTempNullable > entry.Value)
   18.97 +            minTempNullable = entry.Value;
   18.98 +          if (!maxTempNullable.HasValue || maxTempNullable < entry.Value)
   18.99 +            maxTempNullable = entry.Value;
  18.100 +        }
  18.101 +      }
  18.102 +      if (!minTempNullable.HasValue) {
  18.103 +        minTempNullable = 20;
  18.104 +        maxTempNullable = 30;
  18.105 +      }
  18.106 +
  18.107 +      float maxTemp = (float)Math.Ceiling(maxTempNullable.Value / 10) * 10;
  18.108 +      float minTemp = (float)Math.Floor(minTempNullable.Value / 10) * 10;
  18.109 +      if (maxTemp == minTemp) 
  18.110 +        maxTemp += 10;   
  18.111 +     
  18.112 +      int countTempMax = 4;
  18.113 +      float deltaTemp = maxTemp - minTemp;
  18.114 +      int countTemp = (int)Math.Round(deltaTemp / 2);
  18.115 +      if (countTemp > countTempMax)
  18.116 +        countTemp = (int)Math.Round(deltaTemp / 5);
  18.117 +      if (countTemp > countTempMax)
  18.118 +        countTemp = (int)Math.Round(deltaTemp / 10);
  18.119 +      if (countTemp > countTempMax)
  18.120 +        countTemp = (int)Math.Round(deltaTemp / 20);
  18.121 +
  18.122 +      List<float> grid = new List<float>(countTemp + 1);
  18.123 +      for (int i = 0; i <= countTemp; i++) {
  18.124 +        grid.Add(minTemp + i * deltaTemp / countTemp);
  18.125 +      }
  18.126 +      return grid;
  18.127 +    }
  18.128 +
  18.129 +    private List<float> GetTimeGrid() {
  18.130 +
  18.131 +      float maxTime = 5;      
  18.132 +      if (temperatures.Count > 0) {
  18.133 +        IEnumerator<ISensorEntry> enumerator = 
  18.134 +          temperatures[0].Plot.GetEnumerator();
  18.135 +        if (enumerator.MoveNext()) {
  18.136 +          maxTime = (float)(now - enumerator.Current.Time).TotalMinutes;
  18.137 +        }
  18.138 +      }
  18.139 +
  18.140 +      int countTime = 10;
  18.141 +      float deltaTime = 5;
  18.142 +      while (deltaTime + 1 < maxTime && deltaTime < 10)
  18.143 +        deltaTime += 1;
  18.144 +      while (deltaTime + 2 < maxTime && deltaTime < 30)
  18.145 +        deltaTime += 2;
  18.146 +      while (deltaTime + 5 < maxTime && deltaTime < 100)
  18.147 +        deltaTime += 5;
  18.148 +
  18.149 +      List<float> grid = new List<float>(countTime + 1);
  18.150 +      for (int i = 0; i <= countTime; i++) {
  18.151 +        grid.Add(i * deltaTime / countTime);
  18.152 +      }
  18.153 +      return grid;
  18.154 +    }
  18.155 +
  18.156 +    protected override void OnPaint(PaintEventArgs e) {
  18.157 +
  18.158 +      now = DateTime.Now - new TimeSpan(0, 0, 4);
  18.159 +
  18.160 +      List<float> timeGrid = GetTimeGrid();
  18.161 +      List<float> tempGrid = GetTemperatureGrid();
  18.162 +
  18.163 +      Graphics g = e.Graphics;
  18.164 +
  18.165 +      RectangleF r =
  18.166 +        new RectangleF(0, 0, Bounds.Width, Bounds.Height);
  18.167 +
  18.168 +      float ml = 40;
  18.169 +      float mr = 15;
  18.170 +      float x0 = r.X + ml;
  18.171 +      float w = r.Width - ml - mr;
  18.172 +
  18.173 +      float mt = 15;
  18.174 +      float mb = 28;
  18.175 +      float y0 = r.Y + mt;
  18.176 +      float h = r.Height - mt - mb;
  18.177 +
  18.178 +      float leftScaleSpace = 5;
  18.179 +      float bottomScaleSpace = 5;
  18.180 +      
  18.181 +      g.Clear(Color.White);
  18.182 +
  18.183 +      if (w > 0 && h > 0) {
  18.184 +        g.FillRectangle(lightBrush, x0, y0, w, h);
  18.185 +
  18.186 +        g.SmoothingMode = SmoothingMode.HighQuality;
  18.187 +        for (int i = 0; i < timeGrid.Count; i++) {
  18.188 +          float x = x0 + i * w / (timeGrid.Count - 1);
  18.189 +          g.DrawLine(lightPen, x, y0, x, y0 + h);
  18.190 +        }
  18.191 +
  18.192 +        for (int i = 0; i < tempGrid.Count; i++) {
  18.193 +          float y = y0 + i * h / (tempGrid.Count - 1);
  18.194 +          g.DrawLine(lightPen, x0, y, x0 + w, y);
  18.195 +        }
  18.196 +
  18.197 +        float deltaTemp = tempGrid[tempGrid.Count - 1] - tempGrid[0];
  18.198 +        float deltaTime = timeGrid[timeGrid.Count - 1];
  18.199 +        foreach (ISensor sensor in temperatures) {
  18.200 +          using (Pen pen = new Pen(colors[sensor])) {
  18.201 +            IEnumerable<ISensorEntry> graph = sensor.Plot;
  18.202 +            PointF last = new PointF();
  18.203 +            bool first = true;
  18.204 +            foreach (ISensorEntry entry in graph) {
  18.205 +              PointF point = new PointF(
  18.206 +                  x0 + w - w * (float)(now - entry.Time).TotalMinutes / deltaTime,
  18.207 +                  y0 + h - h * (entry.Value - tempGrid[0]) / deltaTemp);
  18.208 +              if (!first)
  18.209 +                g.DrawLine(pen, last, point);
  18.210 +              last = point;
  18.211 +              first = false;
  18.212 +            }
  18.213 +          }
  18.214 +        }
  18.215 +
  18.216 +        g.SmoothingMode = SmoothingMode.None;
  18.217 +        g.FillRectangle(Brushes.White, 0, 0, x0, r.Height);
  18.218 +        g.FillRectangle(Brushes.White, x0 + w + 1, 0, r.Width - x0 - w, 
  18.219 +          r.Height);
  18.220 +
  18.221 +        for (int i = 1; i < timeGrid.Count; i++) {
  18.222 +          float x = x0 + (timeGrid.Count - 1 - i) * w / (timeGrid.Count - 1);  
  18.223 +          g.DrawString(timeGrid[i].ToString(), Font, Brushes.Black, x, 
  18.224 +            y0 + h + bottomScaleSpace, centerlower);
  18.225 +        }
  18.226 +
  18.227 +        for (int i = 0; i < tempGrid.Count - 1; i++) {
  18.228 +          float y = y0 + (tempGrid.Count - 1 - i) * h / (tempGrid.Count - 1);
  18.229 +          g.DrawString(tempGrid[i].ToString(), Font, Brushes.Black, 
  18.230 +            x0 - leftScaleSpace, y, centerleft);
  18.231 +        }
  18.232 +
  18.233 +        g.SmoothingMode = SmoothingMode.HighQuality;
  18.234 +        g.DrawString("[°C]", Font, Brushes.Black, x0 - leftScaleSpace, y0,
  18.235 +          lowerleft);        
  18.236 +        g.DrawString("[min]", Font, Brushes.Black, x0 + w,
  18.237 +          y0 + h + bottomScaleSpace, lowerleft);        
  18.238 +      }
  18.239 +    }
  18.240 +
  18.241 +    public void SetSensors(List<ISensor> sensors, 
  18.242 +      IDictionary<ISensor, Color> colors) 
  18.243 +    {
  18.244 +      this.colors = colors;
  18.245 +      List<ISensor> clocks = new List<ISensor>();
  18.246 +      List<ISensor> temperatures = new List<ISensor>();
  18.247 +      List<ISensor> fans = new List<ISensor>();
  18.248 +      foreach (ISensor sensor in sensors)
  18.249 +        switch (sensor.SensorType) {
  18.250 +          case SensorType.Clock: clocks.Add(sensor); break;
  18.251 +          case SensorType.Temperature: temperatures.Add(sensor); break;
  18.252 +          case SensorType.Fan: fans.Add(sensor); break;
  18.253 +        }
  18.254 +      this.clocks = clocks;
  18.255 +      this.temperatures = temperatures;
  18.256 +      this.fans = fans;
  18.257 +      Invalidate();
  18.258 +    }
  18.259 +
  18.260 +  }
  18.261 +}
    19.1 Binary file GUI/PlotPanel.resources has changed
    20.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
    20.2 +++ b/GUI/PlotPanel.resx	Tue Jan 26 22:37:48 2010 +0000
    20.3 @@ -0,0 +1,120 @@
    20.4 +<?xml version="1.0" encoding="utf-8"?>
    20.5 +<root>
    20.6 +  <!-- 
    20.7 +    Microsoft ResX Schema 
    20.8 +    
    20.9 +    Version 2.0
   20.10 +    
   20.11 +    The primary goals of this format is to allow a simple XML format 
   20.12 +    that is mostly human readable. The generation and parsing of the 
   20.13 +    various data types are done through the TypeConverter classes 
   20.14 +    associated with the data types.
   20.15 +    
   20.16 +    Example:
   20.17 +    
   20.18 +    ... ado.net/XML headers & schema ...
   20.19 +    <resheader name="resmimetype">text/microsoft-resx</resheader>
   20.20 +    <resheader name="version">2.0</resheader>
   20.21 +    <resheader name="reader">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader>
   20.22 +    <resheader name="writer">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader>
   20.23 +    <data name="Name1"><value>this is my long string</value><comment>this is a comment</comment></data>
   20.24 +    <data name="Color1" type="System.Drawing.Color, System.Drawing">Blue</data>
   20.25 +    <data name="Bitmap1" mimetype="application/x-microsoft.net.object.binary.base64">
   20.26 +        <value>[base64 mime encoded serialized .NET Framework object]</value>
   20.27 +    </data>
   20.28 +    <data name="Icon1" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
   20.29 +        <value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value>
   20.30 +        <comment>This is a comment</comment>
   20.31 +    </data>
   20.32 +                
   20.33 +    There are any number of "resheader" rows that contain simple 
   20.34 +    name/value pairs.
   20.35 +    
   20.36 +    Each data row contains a name, and value. The row also contains a 
   20.37 +    type or mimetype. Type corresponds to a .NET class that support 
   20.38 +    text/value conversion through the TypeConverter architecture. 
   20.39 +    Classes that don't support this are serialized and stored with the 
   20.40 +    mimetype set.
   20.41 +    
   20.42 +    The mimetype is used for serialized objects, and tells the 
   20.43 +    ResXResourceReader how to depersist the object. This is currently not 
   20.44 +    extensible. For a given mimetype the value must be set accordingly:
   20.45 +    
   20.46 +    Note - application/x-microsoft.net.object.binary.base64 is the format 
   20.47 +    that the ResXResourceWriter will generate, however the reader can 
   20.48 +    read any of the formats listed below.
   20.49 +    
   20.50 +    mimetype: application/x-microsoft.net.object.binary.base64
   20.51 +    value   : The object must be serialized with 
   20.52 +            : System.Runtime.Serialization.Formatters.Binary.BinaryFormatter
   20.53 +            : and then encoded with base64 encoding.
   20.54 +    
   20.55 +    mimetype: application/x-microsoft.net.object.soap.base64
   20.56 +    value   : The object must be serialized with 
   20.57 +            : System.Runtime.Serialization.Formatters.Soap.SoapFormatter
   20.58 +            : and then encoded with base64 encoding.
   20.59 +
   20.60 +    mimetype: application/x-microsoft.net.object.bytearray.base64
   20.61 +    value   : The object must be serialized into a byte array 
   20.62 +            : using a System.ComponentModel.TypeConverter
   20.63 +            : and then encoded with base64 encoding.
   20.64 +    -->
   20.65 +  <xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
   20.66 +    <xsd:import namespace="http://www.w3.org/XML/1998/namespace" />
   20.67 +    <xsd:element name="root" msdata:IsDataSet="true">
   20.68 +      <xsd:complexType>
   20.69 +        <xsd:choice maxOccurs="unbounded">
   20.70 +          <xsd:element name="metadata">
   20.71 +            <xsd:complexType>
   20.72 +              <xsd:sequence>
   20.73 +                <xsd:element name="value" type="xsd:string" minOccurs="0" />
   20.74 +              </xsd:sequence>
   20.75 +              <xsd:attribute name="name" use="required" type="xsd:string" />
   20.76 +              <xsd:attribute name="type" type="xsd:string" />
   20.77 +              <xsd:attribute name="mimetype" type="xsd:string" />
   20.78 +              <xsd:attribute ref="xml:space" />
   20.79 +            </xsd:complexType>
   20.80 +          </xsd:element>
   20.81 +          <xsd:element name="assembly">
   20.82 +            <xsd:complexType>
   20.83 +              <xsd:attribute name="alias" type="xsd:string" />
   20.84 +              <xsd:attribute name="name" type="xsd:string" />
   20.85 +            </xsd:complexType>
   20.86 +          </xsd:element>
   20.87 +          <xsd:element name="data">
   20.88 +            <xsd:complexType>
   20.89 +              <xsd:sequence>
   20.90 +                <xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
   20.91 +                <xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" />
   20.92 +              </xsd:sequence>
   20.93 +              <xsd:attribute name="name" type="xsd:string" use="required" msdata:Ordinal="1" />
   20.94 +              <xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" />
   20.95 +              <xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" />
   20.96 +              <xsd:attribute ref="xml:space" />
   20.97 +            </xsd:complexType>
   20.98 +          </xsd:element>
   20.99 +          <xsd:element name="resheader">
  20.100 +            <xsd:complexType>
  20.101 +              <xsd:sequence>
  20.102 +                <xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
  20.103 +              </xsd:sequence>
  20.104 +              <xsd:attribute name="name" type="xsd:string" use="required" />
  20.105 +            </xsd:complexType>
  20.106 +          </xsd:element>
  20.107 +        </xsd:choice>
  20.108 +      </xsd:complexType>
  20.109 +    </xsd:element>
  20.110 +  </xsd:schema>
  20.111 +  <resheader name="resmimetype">
  20.112 +    <value>text/microsoft-resx</value>
  20.113 +  </resheader>
  20.114 +  <resheader name="version">
  20.115 +    <value>2.0</value>
  20.116 +  </resheader>
  20.117 +  <resheader name="reader">
  20.118 +    <value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
  20.119 +  </resheader>
  20.120 +  <resheader name="writer">
  20.121 +    <value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
  20.122 +  </resheader>
  20.123 +</root>
  20.124 \ No newline at end of file
    21.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
    21.2 +++ b/GUI/SensorNode.cs	Tue Jan 26 22:37:48 2010 +0000
    21.3 @@ -0,0 +1,121 @@
    21.4 +/*
    21.5 +  
    21.6 +  Version: MPL 1.1/GPL 2.0/LGPL 2.1
    21.7 +
    21.8 +  The contents of this file are subject to the Mozilla Public License Version
    21.9 +  1.1 (the "License"); you may not use this file except in compliance with
   21.10 +  the License. You may obtain a copy of the License at
   21.11 + 
   21.12 +  http://www.mozilla.org/MPL/
   21.13 +
   21.14 +  Software distributed under the License is distributed on an "AS IS" basis,
   21.15 +  WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
   21.16 +  for the specific language governing rights and limitations under the License.
   21.17 +
   21.18 +  The Original Code is the Open Hardware Monitor code.
   21.19 +
   21.20 +  The Initial Developer of the Original Code is 
   21.21 +  Michael Möller <m.moeller@gmx.ch>.
   21.22 +  Portions created by the Initial Developer are Copyright (C) 2009-2010
   21.23 +  the Initial Developer. All Rights Reserved.
   21.24 +
   21.25 +  Contributor(s):
   21.26 +
   21.27 +  Alternatively, the contents of this file may be used under the terms of
   21.28 +  either the GNU General Public License Version 2 or later (the "GPL"), or
   21.29 +  the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
   21.30 +  in which case the provisions of the GPL or the LGPL are applicable instead
   21.31 +  of those above. If you wish to allow use of your version of this file only
   21.32 +  under the terms of either the GPL or the LGPL, and not to allow others to
   21.33 +  use your version of this file under the terms of the MPL, indicate your
   21.34 +  decision by deleting the provisions above and replace them with the notice
   21.35 +  and other provisions required by the GPL or the LGPL. If you do not delete
   21.36 +  the provisions above, a recipient may use your version of this file under
   21.37 +  the terms of any one of the MPL, the GPL or the LGPL.
   21.38 + 
   21.39 +*/
   21.40 +
   21.41 +using System;
   21.42 +using System.Collections.Generic;
   21.43 +using Aga.Controls.Tree;
   21.44 +using OpenHardwareMonitor.Hardware;
   21.45 +
   21.46 +namespace OpenHardwareMonitor.GUI {
   21.47 +  public class SensorNode : Node {
   21.48 +    
   21.49 +    private ISensor sensor;
   21.50 +    private string format;
   21.51 +    private bool plot = false;
   21.52 +
   21.53 +    public string ValueToString(float? value) {
   21.54 +      if (value.HasValue)
   21.55 +        return string.Format(format, value);
   21.56 +      else
   21.57 +        return "-";
   21.58 +    }
   21.59 +
   21.60 +    public SensorNode(ISensor sensor) {
   21.61 +      this.sensor = sensor;
   21.62 +      switch (sensor.SensorType) {
   21.63 +        case SensorType.Voltage: format = "{0:F2} V"; break;
   21.64 +        case SensorType.Clock: format = "{0:F0} MHz"; break;
   21.65 +        case SensorType.Temperature: format = "{0:F1} °C"; break;
   21.66 +        case SensorType.Fan: format = "{0:F0} RPM"; break;
   21.67 +      }      
   21.68 +    }
   21.69 +
   21.70 +    public override string Text {
   21.71 +      get { return sensor.Name; }
   21.72 +      set { sensor.Name = value; }
   21.73 +    }    
   21.74 +
   21.75 +    public bool Plot {
   21.76 +      get { return plot; }
   21.77 +      set { plot = value; }
   21.78 +    }
   21.79 +
   21.80 +    public ISensor Sensor {
   21.81 +      get { return sensor; }
   21.82 +    }
   21.83 +
   21.84 +    public string Value {
   21.85 +      get { return ValueToString(sensor.Value); }
   21.86 +    }
   21.87 +
   21.88 +    public string Min {
   21.89 +      get { return ValueToString(sensor.Min); }
   21.90 +    }
   21.91 +
   21.92 +    public string Max {
   21.93 +      get { return ValueToString(sensor.Max); }
   21.94 +    }
   21.95 +
   21.96 +    public String Limit {
   21.97 +      get {
   21.98 +        return sensor.Limit.ToString();
   21.99 +      }
  21.100 +      set {
  21.101 +        if (value != "")
  21.102 +          sensor.Limit = float.Parse(value);
  21.103 +        else
  21.104 +          sensor.Limit = null;
  21.105 +      }
  21.106 +    }
  21.107 +
  21.108 +    public override bool Equals(System.Object obj) {
  21.109 +      if (obj == null) 
  21.110 +        return false;
  21.111 +
  21.112 +      SensorNode s = obj as SensorNode;
  21.113 +      if (s == null) 
  21.114 +        return false;
  21.115 +
  21.116 +      return (sensor == s.sensor);
  21.117 +    }
  21.118 +
  21.119 +    public override int GetHashCode() {
  21.120 +      return sensor.GetHashCode();
  21.121 +    }
  21.122 +
  21.123 +  }
  21.124 +}
    22.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
    22.2 +++ b/GUI/TypeNode.cs	Tue Jan 26 22:37:48 2010 +0000
    22.3 @@ -0,0 +1,82 @@
    22.4 +/*
    22.5 +  
    22.6 +  Version: MPL 1.1/GPL 2.0/LGPL 2.1
    22.7 +
    22.8 +  The contents of this file are subject to the Mozilla Public License Version
    22.9 +  1.1 (the "License"); you may not use this file except in compliance with
   22.10 +  the License. You may obtain a copy of the License at
   22.11 + 
   22.12 +  http://www.mozilla.org/MPL/
   22.13 +
   22.14 +  Software distributed under the License is distributed on an "AS IS" basis,
   22.15 +  WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
   22.16 +  for the specific language governing rights and limitations under the License.
   22.17 +
   22.18 +  The Original Code is the Open Hardware Monitor code.
   22.19 +
   22.20 +  The Initial Developer of the Original Code is 
   22.21 +  Michael Möller <m.moeller@gmx.ch>.
   22.22 +  Portions created by the Initial Developer are Copyright (C) 2009-2010
   22.23 +  the Initial Developer. All Rights Reserved.
   22.24 +
   22.25 +  Contributor(s):
   22.26 +
   22.27 +  Alternatively, the contents of this file may be used under the terms of
   22.28 +  either the GNU General Public License Version 2 or later (the "GPL"), or
   22.29 +  the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
   22.30 +  in which case the provisions of the GPL or the LGPL are applicable instead
   22.31 +  of those above. If you wish to allow use of your version of this file only
   22.32 +  under the terms of either the GPL or the LGPL, and not to allow others to
   22.33 +  use your version of this file under the terms of the MPL, indicate your
   22.34 +  decision by deleting the provisions above and replace them with the notice
   22.35 +  and other provisions required by the GPL or the LGPL. If you do not delete
   22.36 +  the provisions above, a recipient may use your version of this file under
   22.37 +  the terms of any one of the MPL, the GPL or the LGPL.
   22.38 + 
   22.39 +*/
   22.40 +
   22.41 +using System;
   22.42 +using System.Collections.Generic;
   22.43 +using Aga.Controls.Tree;
   22.44 +using OpenHardwareMonitor.Hardware;
   22.45 +
   22.46 +namespace OpenHardwareMonitor.GUI {
   22.47 +  public class TypeNode : Node {
   22.48 +
   22.49 +    private SensorType sensorType;
   22.50 +    private bool visible = true;
   22.51 +
   22.52 +    public TypeNode(SensorType sensorType) : base() {
   22.53 +      this.sensorType = sensorType;
   22.54 +
   22.55 +      switch (sensorType) {
   22.56 +        case SensorType.Voltage: 
   22.57 +          this.Image = Utilities.EmbeddedResources.GetImage("voltage.png");
   22.58 +          this.Text = "Voltages";
   22.59 +          break;
   22.60 +        case SensorType.Clock:
   22.61 +          this.Image = Utilities.EmbeddedResources.GetImage("clock.png");
   22.62 +          this.Text = "Clocks";
   22.63 +          break;
   22.64 +        case SensorType.Temperature:
   22.65 +          this.Image = Utilities.EmbeddedResources.GetImage("temperature.png");
   22.66 +          this.Text = "Temperatures";
   22.67 +          break;
   22.68 +        case SensorType.Fan:
   22.69 +          this.Image = Utilities.EmbeddedResources.GetImage("fan.png");
   22.70 +          this.Text = "Fans";
   22.71 +          break;
   22.72 +      }
   22.73 +    }
   22.74 +
   22.75 +    public SensorType SensorType {
   22.76 +      get { return sensorType; }
   22.77 +    }
   22.78 +
   22.79 +    public bool IsVisible {      
   22.80 +      get { return visible; }
   22.81 +      set { visible = value; }
   22.82 +    }
   22.83 +
   22.84 +  }
   22.85 +}
    23.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
    23.2 +++ b/Hardware/ATI/ADL.cs	Tue Jan 26 22:37:48 2010 +0000
    23.3 @@ -0,0 +1,251 @@
    23.4 +/*
    23.5 +  
    23.6 +  Version: MPL 1.1/GPL 2.0/LGPL 2.1
    23.7 +
    23.8 +  The contents of this file are subject to the Mozilla Public License Version
    23.9 +  1.1 (the "License"); you may not use this file except in compliance with
   23.10 +  the License. You may obtain a copy of the License at
   23.11 + 
   23.12 +  http://www.mozilla.org/MPL/
   23.13 +
   23.14 +  Software distributed under the License is distributed on an "AS IS" basis,
   23.15 +  WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
   23.16 +  for the specific language governing rights and limitations under the License.
   23.17 +
   23.18 +  The Original Code is the Open Hardware Monitor code.
   23.19 +
   23.20 +  The Initial Developer of the Original Code is 
   23.21 +  Michael Möller <m.moeller@gmx.ch>.
   23.22 +  Portions created by the Initial Developer are Copyright (C) 2009-2010
   23.23 +  the Initial Developer. All Rights Reserved.
   23.24 +
   23.25 +  Contributor(s):
   23.26 +
   23.27 +  Alternatively, the contents of this file may be used under the terms of
   23.28 +  either the GNU General Public License Version 2 or later (the "GPL"), or
   23.29 +  the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
   23.30 +  in which case the provisions of the GPL or the LGPL are applicable instead
   23.31 +  of those above. If you wish to allow use of your version of this file only
   23.32 +  under the terms of either the GPL or the LGPL, and not to allow others to
   23.33 +  use your version of this file under the terms of the MPL, indicate your
   23.34 +  decision by deleting the provisions above and replace them with the notice
   23.35 +  and other provisions required by the GPL or the LGPL. If you do not delete
   23.36 +  the provisions above, a recipient may use your version of this file under
   23.37 +  the terms of any one of the MPL, the GPL or the LGPL.
   23.38 + 
   23.39 +*/
   23.40 +
   23.41 +using System;
   23.42 +using System.Collections.Generic;
   23.43 +using System.Runtime.InteropServices;
   23.44 +
   23.45 +namespace OpenHardwareMonitor.Hardware.ATI {
   23.46 +  
   23.47 +  [StructLayout(LayoutKind.Sequential)]
   23.48 +  public struct ADLAdapterInfo {
   23.49 +    public int Size;
   23.50 +    public int AdapterIndex;
   23.51 +    [MarshalAs(UnmanagedType.ByValTStr, SizeConst = ADL.ADL_MAX_PATH)]
   23.52 +    public string UDID;
   23.53 +    public int BusNumber;
   23.54 +    public int DriverNumber;
   23.55 +    public int FunctionNumber;
   23.56 +    public int VendorID;
   23.57 +    [MarshalAs(UnmanagedType.ByValTStr, SizeConst = ADL.ADL_MAX_PATH)]
   23.58 +    public string AdapterName;
   23.59 +    [MarshalAs(UnmanagedType.ByValTStr, SizeConst = ADL.ADL_MAX_PATH)]
   23.60 +    public string DisplayName;
   23.61 +    public int Present;
   23.62 +    public int Exist;
   23.63 +    [MarshalAs(UnmanagedType.ByValTStr, SizeConst = ADL.ADL_MAX_PATH)]
   23.64 +    public string DriverPath;
   23.65 +    [MarshalAs(UnmanagedType.ByValTStr, SizeConst = ADL.ADL_MAX_PATH)]
   23.66 +    public string DriverPathExt;
   23.67 +    [MarshalAs(UnmanagedType.ByValTStr, SizeConst = ADL.ADL_MAX_PATH)]
   23.68 +    public string PNPString;
   23.69 +    public int OSDisplayIndex;
   23.70 +  }
   23.71 +
   23.72 +  [StructLayout(LayoutKind.Sequential)]
   23.73 +  public struct ADLPMActivity {
   23.74 +    public int Size;
   23.75 +    public int EngineClock;
   23.76 +    public int MemoryClock;
   23.77 +    public int Vddc;
   23.78 +    public int ActivityPercent;
   23.79 +    public int CurrentPerformanceLevel;
   23.80 +    public int CurrentBusSpeed;
   23.81 +    public int CurrentBusLanes;
   23.82 +    public int MaximumBusLanes;
   23.83 +    public int Reserved;
   23.84 +  }
   23.85 +
   23.86 +  [StructLayout(LayoutKind.Sequential)]
   23.87 +  public struct ADLTemperature {
   23.88 +    public int Size;
   23.89 +    public int Temperature;
   23.90 +  }
   23.91 +
   23.92 +  [StructLayout(LayoutKind.Sequential)]
   23.93 +  public struct ADLFanSpeedValue {
   23.94 +    public int Size;
   23.95 +    public int SpeedType;
   23.96 +    public int FanSpeed;
   23.97 +    public int Flags;
   23.98 +  }
   23.99 +
  23.100 +  [StructLayout(LayoutKind.Sequential)]
  23.101 +  public struct ADLFanSpeedInfo {
  23.102 +    public int Size;
  23.103 +    public int Flags;
  23.104 +    public int MinPercent;
  23.105 +    public int MaxPercent;
  23.106 +    public int MinRPM;
  23.107 +    public int MaxRPM;
  23.108 +  }
  23.109 +
  23.110 +  public class ADL {
  23.111 +    public const int ADL_MAX_PATH = 256;
  23.112 +    public const int ADL_MAX_ADAPTERS = 40;
  23.113 +    public const int ADL_MAX_DISPLAYS = 40;
  23.114 +    public const int ADL_MAX_DEVICENAME = 32;
  23.115 +    public const int ADL_SUCCESS = 0;
  23.116 +    public const int ADL_FAIL = -1;
  23.117 +    public const int ADL_DRIVER_OK = 0;
  23.118 +    public const int ADL_MAX_GLSYNC_PORTS = 8;
  23.119 +    public const int ADL_MAX_GLSYNC_PORT_LEDS = 8;
  23.120 +    public const int ADL_MAX_NUM_DISPLAYMODES = 1024;
  23.121 +
  23.122 +    public const int ADL_DL_FANCTRL_SPEED_TYPE_PERCENT = 1;
  23.123 +    public const int ADL_DL_FANCTRL_SPEED_TYPE_RPM = 2;
  23.124 +
  23.125 +    public const int ADL_DL_FANCTRL_SUPPORTS_PERCENT_READ = 1;
  23.126 +    public const int ADL_DL_FANCTRL_SUPPORTS_PERCENT_WRITE = 2;
  23.127 +    public const int ADL_DL_FANCTRL_SUPPORTS_RPM_READ = 4;
  23.128 +    public const int ADL_DL_FANCTRL_SUPPORTS_RPM_WRITE = 8;
  23.129 +
  23.130 +    private delegate int ADL_Main_Control_CreateDelegate(
  23.131 +      ADL_Main_Memory_AllocDelegate callback, int enumConnectedAdapters);
  23.132 +    private delegate int ADL_Adapter_AdapterInfo_GetDelegate(IntPtr info,
  23.133 +      int size);
  23.134 +
  23.135 +    public delegate int ADL_Main_Control_DestroyDelegate();
  23.136 +    public delegate int ADL_Adapter_NumberOfAdapters_GetDelegate(
  23.137 +      ref int numAdapters);    
  23.138 +    public delegate int ADL_Adapter_ID_GetDelegate(int adapterIndex,
  23.139 +      out int adapterID);
  23.140 +    public delegate int ADL_Adapter_Active_GetDelegate(int adapterIndex,
  23.141 +      out int status);
  23.142 +    public delegate int ADL_Overdrive5_CurrentActivity_GetDelegate(
  23.143 +      int iAdapterIndex, ref ADLPMActivity activity);
  23.144 +    public delegate int ADL_Overdrive5_Temperature_GetDelegate(int adapterIndex,
  23.145 +        int thermalControllerIndex, ref ADLTemperature temperature);
  23.146 +    public delegate int ADL_Overdrive5_FanSpeed_GetDelegate(int adapterIndex,
  23.147 +        int thermalControllerIndex, ref	ADLFanSpeedValue fanSpeedValue);
  23.148 +    public delegate int ADL_Overdrive5_FanSpeedInfo_GetDelegate(
  23.149 +      int adapterIndex, int thermalControllerIndex,
  23.150 +      ref ADLFanSpeedInfo fanSpeedInfo);
  23.151 +
  23.152 +    private static ADL_Main_Control_CreateDelegate
  23.153 +      _ADL_Main_Control_Create;
  23.154 +    private static ADL_Adapter_AdapterInfo_GetDelegate
  23.155 +      _ADL_Adapter_AdapterInfo_Get;
  23.156 +
  23.157 +    public static ADL_Main_Control_DestroyDelegate
  23.158 +      ADL_Main_Control_Destroy;
  23.159 +    public static ADL_Adapter_NumberOfAdapters_GetDelegate
  23.160 +      ADL_Adapter_NumberOfAdapters_Get;
  23.161 +    public static ADL_Adapter_ID_GetDelegate
  23.162 +      ADL_Adapter_ID_Get;
  23.163 +    public static ADL_Adapter_Active_GetDelegate
  23.164 +      ADL_Adapter_Active_Get;
  23.165 +    public static ADL_Overdrive5_CurrentActivity_GetDelegate
  23.166 +      ADL_Overdrive5_CurrentActivity_Get;
  23.167 +    public static ADL_Overdrive5_Temperature_GetDelegate
  23.168 +      ADL_Overdrive5_Temperature_Get;
  23.169 +    public static ADL_Overdrive5_FanSpeed_GetDelegate
  23.170 +      ADL_Overdrive5_FanSpeed_Get;
  23.171 +    public static ADL_Overdrive5_FanSpeedInfo_GetDelegate
  23.172 +      ADL_Overdrive5_FanSpeedInfo_Get;
  23.173 +
  23.174 +    private static string GetDllName() {
  23.175 +      int p = (int)System.Environment.OSVersion.Platform;
  23.176 +      if ((p == 4) || (p == 128)) {
  23.177 +        if (IntPtr.Size == 4) {
  23.178 +          return "atiadlxy.so";
  23.179 +        } else {
  23.180 +          return "atiadlxx.so";
  23.181 +        }
  23.182 +      } else {
  23.183 +        if (IntPtr.Size == 4) {
  23.184 +          return "atiadlxy.dll";
  23.185 +        } else {
  23.186 +          return "atiadlxx.dll";
  23.187 +        }
  23.188 +      }
  23.189 +    }
  23.190 +
  23.191 +    private static void GetDelegate<T>(string entryPoint, out T newDelegate)
  23.192 +      where T : class 
  23.193 +    {
  23.194 +      DllImportAttribute attribute = new DllImportAttribute(GetDllName());
  23.195 +      attribute.CallingConvention = CallingConvention.StdCall;
  23.196 +      attribute.PreserveSig = true;
  23.197 +      attribute.EntryPoint = entryPoint;
  23.198 +      PInvokeDelegateFactory.CreateDelegate(attribute, out newDelegate);
  23.199 +    }
  23.200 +
  23.201 +    static ADL() {
  23.202 +       GetDelegate("ADL_Main_Control_Create", 
  23.203 +         out _ADL_Main_Control_Create);
  23.204 +       GetDelegate("ADL_Adapter_AdapterInfo_Get", 
  23.205 +         out _ADL_Adapter_AdapterInfo_Get);
  23.206 +       GetDelegate("ADL_Main_Control_Destroy", 
  23.207 +         out ADL_Main_Control_Destroy);
  23.208 +       GetDelegate("ADL_Adapter_NumberOfAdapters_Get", 
  23.209 +         out ADL_Adapter_NumberOfAdapters_Get);
  23.210 +       GetDelegate("ADL_Adapter_ID_Get", 
  23.211 +         out ADL_Adapter_ID_Get);
  23.212 +       GetDelegate("ADL_Adapter_Active_Get", 
  23.213 +         out ADL_Adapter_Active_Get);
  23.214 +       GetDelegate("ADL_Overdrive5_CurrentActivity_Get", 
  23.215 +         out ADL_Overdrive5_CurrentActivity_Get);
  23.216 +       GetDelegate("ADL_Overdrive5_Temperature_Get", 
  23.217 +         out ADL_Overdrive5_Temperature_Get);
  23.218 +       GetDelegate("ADL_Overdrive5_FanSpeed_Get", 
  23.219 +         out ADL_Overdrive5_FanSpeed_Get);
  23.220 +       GetDelegate("ADL_Overdrive5_FanSpeedInfo_Get",
  23.221 +          out ADL_Overdrive5_FanSpeedInfo_Get);
  23.222 +    }
  23.223 +
  23.224 +    private ADL() { }
  23.225 +
  23.226 +    public static int ADL_Main_Control_Create(int enumConnectedAdapters) {
  23.227 +      return _ADL_Main_Control_Create(Main_Memory_Alloc, enumConnectedAdapters);
  23.228 +    }
  23.229 +
  23.230 +    public static int ADL_Adapter_AdapterInfo_Get(ADLAdapterInfo[] info) {
  23.231 +      int elementSize = Marshal.SizeOf(typeof(ADLAdapterInfo));
  23.232 +      int size = info.Length * elementSize;
  23.233 +      IntPtr ptr = Marshal.AllocHGlobal(size);
  23.234 +      int result = _ADL_Adapter_AdapterInfo_Get(ptr, size);
  23.235 +      for (int i = 0; i < info.Length; i++)
  23.236 +        info[i] = (ADLAdapterInfo)
  23.237 +          Marshal.PtrToStructure((IntPtr)((long)ptr + i * elementSize),
  23.238 +          typeof(ADLAdapterInfo));
  23.239 +      Marshal.FreeHGlobal(ptr);
  23.240 +      return result;
  23.241 +    }
  23.242 +
  23.243 +    private delegate IntPtr ADL_Main_Memory_AllocDelegate(int size);
  23.244 +
  23.245 +    private static IntPtr Main_Memory_Alloc(int size) {
  23.246 +      return Marshal.AllocHGlobal(size);;
  23.247 +    }
  23.248 +
  23.249 +    private static void Main_Memory_Free(IntPtr buffer) {
  23.250 +      if (IntPtr.Zero != buffer)
  23.251 +        Marshal.FreeHGlobal(buffer);
  23.252 +    }
  23.253 +  }
  23.254 +}
    24.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
    24.2 +++ b/Hardware/ATI/ATIGPU.cs	Tue Jan 26 22:37:48 2010 +0000
    24.3 @@ -0,0 +1,117 @@
    24.4 +/*
    24.5 +  
    24.6 +  Version: MPL 1.1/GPL 2.0/LGPL 2.1
    24.7 +
    24.8 +  The contents of this file are subject to the Mozilla Public License Version
    24.9 +  1.1 (the "License"); you may not use this file except in compliance with
   24.10 +  the License. You may obtain a copy of the License at
   24.11 + 
   24.12 +  http://www.mozilla.org/MPL/
   24.13 +
   24.14 +  Software distributed under the License is distributed on an "AS IS" basis,
   24.15 +  WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
   24.16 +  for the specific language governing rights and limitations under the License.
   24.17 +
   24.18 +  The Original Code is the Open Hardware Monitor code.
   24.19 +
   24.20 +  The Initial Developer of the Original Code is 
   24.21 +  Michael Möller <m.moeller@gmx.ch>.
   24.22 +  Portions created by the Initial Developer are Copyright (C) 2009-2010
   24.23 +  the Initial Developer. All Rights Reserved.
   24.24 +
   24.25 +  Contributor(s):
   24.26 +
   24.27 +  Alternatively, the contents of this file may be used under the terms of
   24.28 +  either the GNU General Public License Version 2 or later (the "GPL"), or
   24.29 +  the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
   24.30 +  in which case the provisions of the GPL or the LGPL are applicable instead
   24.31 +  of those above. If you wish to allow use of your version of this file only
   24.32 +  under the terms of either the GPL or the LGPL, and not to allow others to
   24.33 +  use your version of this file under the terms of the MPL, indicate your
   24.34 +  decision by deleting the provisions above and replace them with the notice
   24.35 +  and other provisions required by the GPL or the LGPL. If you do not delete
   24.36 +  the provisions above, a recipient may use your version of this file under
   24.37 +  the terms of any one of the MPL, the GPL or the LGPL.
   24.38 + 
   24.39 +*/
   24.40 +
   24.41 +using System;
   24.42 +using System.Collections.Generic;
   24.43 +using System.Drawing;
   24.44 +using System.Reflection;
   24.45 +
   24.46 +namespace OpenHardwareMonitor.Hardware.ATI {
   24.47 +  public class ATIGPU : IHardware {
   24.48 +
   24.49 +    private string name;
   24.50 +    private Image icon;
   24.51 +    private int adapterIndex;
   24.52 +    private Sensor temperature;
   24.53 +    private Sensor fan;
   24.54 +    private Sensor coreClock;
   24.55 +    private Sensor memoryClock;
   24.56 +    private Sensor coreVoltage;
   24.57 +
   24.58 +    public ATIGPU(string name, int adapterIndex) {
   24.59 +      this.name = name;
   24.60 +      this.icon = Utilities.EmbeddedResources.GetImage("ati.png");
   24.61 +      this.adapterIndex = adapterIndex;
   24.62 +
   24.63 +      ADLFanSpeedInfo speedInfo = new ADLFanSpeedInfo();
   24.64 +      ADL.ADL_Overdrive5_FanSpeedInfo_Get(adapterIndex, 0, ref speedInfo);
   24.65 +
   24.66 +      this.temperature = 
   24.67 +        new Sensor("GPU Core", 0, SensorType.Temperature, this);
   24.68 +      this.fan = new Sensor("GPU", 0, speedInfo.MaxRPM, SensorType.Fan, this);
   24.69 +      this.coreClock = new Sensor("GPU Core", 0, SensorType.Clock, this);
   24.70 +      this.memoryClock = new Sensor("GPU Memory", 1, SensorType.Clock, this);
   24.71 +      this.coreVoltage = new Sensor("GPU Core", 0, SensorType.Voltage, this);
   24.72 +      Update();                   
   24.73 +    }
   24.74 +
   24.75 +    public string Name {
   24.76 +      get { return name; }
   24.77 +    }
   24.78 +
   24.79 +    public string Identifier {
   24.80 +      get { return "/atigpu/" + adapterIndex; }
   24.81 +    }
   24.82 +
   24.83 +    public Image Icon {
   24.84 +      get { return icon; }
   24.85 +    }
   24.86 +
   24.87 +    public ISensor[] Sensors {
   24.88 +      get {
   24.89 +        return new ISensor[] { coreVoltage, coreClock, memoryClock, temperature, 
   24.90 +          fan };
   24.91 +      }
   24.92 +    }
   24.93 +
   24.94 +    public string GetReport() {
   24.95 +      return null;
   24.96 +    }
   24.97 +
   24.98 +    public void Update() {
   24.99 +      ADLTemperature adlt = new ADLTemperature();
  24.100 +      ADL.ADL_Overdrive5_Temperature_Get(adapterIndex, 0, ref adlt);
  24.101 +      temperature.Value = 0.001f * adlt.Temperature;
  24.102 +
  24.103 +      ADLFanSpeedValue adlf = new ADLFanSpeedValue();
  24.104 +      adlf.SpeedType = ADL.ADL_DL_FANCTRL_SPEED_TYPE_RPM;
  24.105 +      ADL.ADL_Overdrive5_FanSpeed_Get(adapterIndex, 0, ref adlf);
  24.106 +      fan.Value = adlf.FanSpeed;
  24.107 +
  24.108 +      ADLPMActivity adlp = new ADLPMActivity();
  24.109 +      ADL.ADL_Overdrive5_CurrentActivity_Get(adapterIndex, ref adlp);
  24.110 +      coreClock.Value = 0.01f * adlp.EngineClock;
  24.111 +      memoryClock.Value = 0.01f * adlp.MemoryClock;
  24.112 +      coreVoltage.Value = 0.001f * adlp.Vddc;
  24.113 +    }
  24.114 +
  24.115 +    #pragma warning disable 67
  24.116 +    public event SensorEventHandler SensorAdded;
  24.117 +    public event SensorEventHandler SensorRemoved;
  24.118 +    #pragma warning restore 67
  24.119 +  }
  24.120 +}
    25.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
    25.2 +++ b/Hardware/ATI/ATIGroup.cs	Tue Jan 26 22:37:48 2010 +0000
    25.3 @@ -0,0 +1,111 @@
    25.4 +/*
    25.5 +  
    25.6 +  Version: MPL 1.1/GPL 2.0/LGPL 2.1
    25.7 +
    25.8 +  The contents of this file are subject to the Mozilla Public License Version
    25.9 +  1.1 (the "License"); you may not use this file except in compliance with
   25.10 +  the License. You may obtain a copy of the License at
   25.11 + 
   25.12 +  http://www.mozilla.org/MPL/
   25.13 +
   25.14 +  Software distributed under the License is distributed on an "AS IS" basis,
   25.15 +  WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
   25.16 +  for the specific language governing rights and limitations under the License.
   25.17 +
   25.18 +  The Original Code is the Open Hardware Monitor code.
   25.19 +
   25.20 +  The Initial Developer of the Original Code is 
   25.21 +  Michael Möller <m.moeller@gmx.ch>.
   25.22 +  Portions created by the Initial Developer are Copyright (C) 2009-2010
   25.23 +  the Initial Developer. All Rights Reserved.
   25.24 +
   25.25 +  Contributor(s):
   25.26 +
   25.27 +  Alternatively, the contents of this file may be used under the terms of
   25.28 +  either the GNU General Public License Version 2 or later (the "GPL"), or
   25.29 +  the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
   25.30 +  in which case the provisions of the GPL or the LGPL are applicable instead
   25.31 +  of those above. If you wish to allow use of your version of this file only
   25.32 +  under the terms of either the GPL or the LGPL, and not to allow others to
   25.33 +  use your version of this file under the terms of the MPL, indicate your
   25.34 +  decision by deleting the provisions above and replace them with the notice
   25.35 +  and other provisions required by the GPL or the LGPL. If you do not delete
   25.36 +  the provisions above, a recipient may use your version of this file under
   25.37 +  the terms of any one of the MPL, the GPL or the LGPL.
   25.38 + 
   25.39 +*/
   25.40 +
   25.41 +using System;
   25.42 +using System.Collections.Generic;
   25.43 +using System.Text;
   25.44 +
   25.45 +namespace OpenHardwareMonitor.Hardware.ATI {
   25.46 +  public class ATIGroup : IGroup {
   25.47 +
   25.48 +    private List<ATIGPU> hardware = new List<ATIGPU>();
   25.49 +    private StringBuilder report = new StringBuilder();
   25.50 +
   25.51 +    public ATIGroup() {
   25.52 +      try {
   25.53 +        if (ADL.ADL_Main_Control_Create(1) == ADL.ADL_SUCCESS) {
   25.54 +          int numberOfAdapters = 0;
   25.55 +          ADL.ADL_Adapter_NumberOfAdapters_Get(ref numberOfAdapters);
   25.56 +
   25.57 +          report.AppendLine("AMD Display Library");
   25.58 +          report.AppendLine();
   25.59 +          report.Append("Numer of adapters: "); 
   25.60 +          report.AppendLine(numberOfAdapters.ToString());
   25.61 +          report.AppendLine();
   25.62 +
   25.63 +          if (numberOfAdapters > 0) {
   25.64 +            ADLAdapterInfo[] adapterInfo = new ADLAdapterInfo[numberOfAdapters];
   25.65 +            if (ADL.ADL_Adapter_AdapterInfo_Get(adapterInfo) == ADL.ADL_SUCCESS)
   25.66 +              for (int i = 0; i < numberOfAdapters; i++) {
   25.67 +                int isActive;
   25.68 +                ADL.ADL_Adapter_Active_Get(adapterInfo[i].AdapterIndex,
   25.69 +                  out isActive);
   25.70 +
   25.71 +                report.Append("AdapterIndex: "); 
   25.72 +                report.AppendLine(i.ToString());
   25.73 +                report.Append("isActive: "); 
   25.74 +                report.AppendLine(isActive.ToString());
   25.75 +                report.Append("AdapterName: "); 
   25.76 +                report.AppendLine(adapterInfo[i].AdapterName);     
   25.77 +                report.Append("UDID: ");
   25.78 +                report.AppendLine(adapterInfo[i].UDID);
   25.79 +                report.AppendLine();
   25.80 +
   25.81 +                if (isActive == 1) {
   25.82 +                  int adapterID;
   25.83 +                  ADL.ADL_Adapter_ID_Get(adapterInfo[i].AdapterIndex,
   25.84 +                    out adapterID);
   25.85 +
   25.86 +                  if (adapterID > 0 && adapterInfo[i].UDID != "") {
   25.87 +                    hardware.Add(new ATIGPU(
   25.88 +                      adapterInfo[i].AdapterName,
   25.89 +                      adapterInfo[i].AdapterIndex));
   25.90 +                  }
   25.91 +                }
   25.92 +              }
   25.93 +          }
   25.94 +        }
   25.95 +      } catch (DllNotFoundException) { } catch (EntryPointNotFoundException) { }
   25.96 +    }
   25.97 +
   25.98 +    public IHardware[] Hardware {
   25.99 +      get {
  25.100 +        return hardware.ToArray();
  25.101 +      }
  25.102 +    }
  25.103 +
  25.104 +    public string GetReport() {
  25.105 +      return report.ToString();
  25.106 +    }
  25.107 +
  25.108 +    public void Close() {
  25.109 +      try {
  25.110 +        ADL.ADL_Main_Control_Destroy();
  25.111 +      } catch (Exception) { }
  25.112 +    }
  25.113 +  }
  25.114 +}
    26.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
    26.2 +++ b/Hardware/CPU/AMD10CPU.cs	Tue Jan 26 22:37:48 2010 +0000
    26.3 @@ -0,0 +1,113 @@
    26.4 +/*
    26.5 +  
    26.6 +  Version: MPL 1.1/GPL 2.0/LGPL 2.1
    26.7 +
    26.8 +  The contents of this file are subject to the Mozilla Public License Version
    26.9 +  1.1 (the "License"); you may not use this file except in compliance with
   26.10 +  the License. You may obtain a copy of the License at
   26.11 + 
   26.12 +  http://www.mozilla.org/MPL/
   26.13 +
   26.14 +  Software distributed under the License is distributed on an "AS IS" basis,
   26.15 +  WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
   26.16 +  for the specific language governing rights and limitations under the License.
   26.17 +
   26.18 +  The Original Code is the Open Hardware Monitor code.
   26.19 +
   26.20 +  The Initial Developer of the Original Code is 
   26.21 +  Michael Möller <m.moeller@gmx.ch>.
   26.22 +  Portions created by the Initial Developer are Copyright (C) 2009-2010
   26.23 +  the Initial Developer. All Rights Reserved.
   26.24 +
   26.25 +  Contributor(s):
   26.26 +
   26.27 +  Alternatively, the contents of this file may be used under the terms of
   26.28 +  either the GNU General Public License Version 2 or later (the "GPL"), or
   26.29 +  the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
   26.30 +  in which case the provisions of the GPL or the LGPL are applicable instead
   26.31 +  of those above. If you wish to allow use of your version of this file only
   26.32 +  under the terms of either the GPL or the LGPL, and not to allow others to
   26.33 +  use your version of this file under the terms of the MPL, indicate your
   26.34 +  decision by deleting the provisions above and replace them with the notice
   26.35 +  and other provisions required by the GPL or the LGPL. If you do not delete
   26.36 +  the provisions above, a recipient may use your version of this file under
   26.37 +  the terms of any one of the MPL, the GPL or the LGPL.
   26.38 + 
   26.39 +*/
   26.40 +
   26.41 +using System;
   26.42 +using System.Collections.Generic;
   26.43 +using System.Drawing;
   26.44 +using System.Text;
   26.45 +
   26.46 +namespace OpenHardwareMonitor.Hardware.CPU {
   26.47 +  
   26.48 +  public class AMD10CPU : IHardware {
   26.49 +    private string name;
   26.50 +    private Image icon;
   26.51 +
   26.52 +    private uint pciAddress;
   26.53 +
   26.54 +    private Sensor coreTemperature;
   26.55 +
   26.56 +    private const ushort PCI_AMD_VENDOR_ID = 0x1022;
   26.57 +    private const ushort PCI_AMD_10H_MISCELLANEOUS_DEVICE_ID = 0x1203;
   26.58 +    private const uint REPORTED_TEMPERATURE_CONTROL_REGISTER = 0xA4;
   26.59 +
   26.60 +    public AMD10CPU(string name, uint family, uint model, uint stepping, 
   26.61 +      uint[,] cpuidData, uint[,] cpuidExtData) {
   26.62 +      
   26.63 +      this.name = name;
   26.64 +      this.icon = Utilities.EmbeddedResources.GetImage("cpu.png");     
   26.65 +
   26.66 +      uint coreCount = 1;
   26.67 +      if (cpuidExtData.GetLength(0) > 8)
   26.68 +        coreCount = (cpuidExtData[8, 2] & 0xFF) + 1;
   26.69 +      
   26.70 +      // AMD family 10h processors support only one temperature sensor
   26.71 +      coreTemperature = new Sensor("Core", 0, SensorType.Temperature, this);
   26.72 +
   26.73 +      pciAddress = WinRing0.FindPciDeviceById(PCI_AMD_VENDOR_ID, 
   26.74 +        PCI_AMD_10H_MISCELLANEOUS_DEVICE_ID, 0);
   26.75 +      Update();                   
   26.76 +    }
   26.77 +
   26.78 +    public string Name {
   26.79 +      get { return name; }
   26.80 +    }
   26.81 +
   26.82 +    public string Identifier {
   26.83 +      get { return "/amdcpu/0"; }
   26.84 +    }
   26.85 +
   26.86 +    public Image Icon {
   26.87 +      get { return icon; }
   26.88 +    }
   26.89 +
   26.90 +    public ISensor[] Sensors {
   26.91 +      get {
   26.92 +        return new ISensor[] { coreTemperature };
   26.93 +      }
   26.94 +    }
   26.95 +
   26.96 +    public string GetReport() {
   26.97 +      return null;
   26.98 +    }
   26.99 +
  26.100 +    public void Update() {
  26.101 +      if (pciAddress == 0xFFFFFFFF)
  26.102 +        return;
  26.103 +
  26.104 +      uint value;      
  26.105 +      if (WinRing0.ReadPciConfigDwordEx(pciAddress, 
  26.106 +        REPORTED_TEMPERATURE_CONTROL_REGISTER, out value)) 
  26.107 +        coreTemperature.Value = ((value >> 21) & 0x7FF) / 8.0f;      
  26.108 +    }
  26.109 +
  26.110 +    #pragma warning disable 67
  26.111 +    public event SensorEventHandler SensorAdded;
  26.112 +    public event SensorEventHandler SensorRemoved;
  26.113 +    #pragma warning restore 67
  26.114 +
  26.115 +  }
  26.116 +}
    27.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
    27.2 +++ b/Hardware/CPU/CPUGroup.cs	Tue Jan 26 22:37:48 2010 +0000
    27.3 @@ -0,0 +1,208 @@
    27.4 +/*
    27.5 +  
    27.6 +  Version: MPL 1.1/GPL 2.0/LGPL 2.1
    27.7 +
    27.8 +  The contents of this file are subject to the Mozilla Public License Version
    27.9 +  1.1 (the "License"); you may not use this file except in compliance with
   27.10 +  the License. You may obtain a copy of the License at
   27.11 + 
   27.12 +  http://www.mozilla.org/MPL/
   27.13 +
   27.14 +  Software distributed under the License is distributed on an "AS IS" basis,
   27.15 +  WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
   27.16 +  for the specific language governing rights and limitations under the License.
   27.17 +
   27.18 +  The Original Code is the Open Hardware Monitor code.
   27.19 +
   27.20 +  The Initial Developer of the Original Code is 
   27.21 +  Michael Möller <m.moeller@gmx.ch>.
   27.22 +  Portions created by the Initial Developer are Copyright (C) 2009-2010
   27.23 +  the Initial Developer. All Rights Reserved.
   27.24 +
   27.25 +  Contributor(s):
   27.26 +
   27.27 +  Alternatively, the contents of this file may be used under the terms of
   27.28 +  either the GNU General Public License Version 2 or later (the "GPL"), or
   27.29 +  the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
   27.30 +  in which case the provisions of the GPL or the LGPL are applicable instead
   27.31 +  of those above. If you wish to allow use of your version of this file only
   27.32 +  under the terms of either the GPL or the LGPL, and not to allow others to
   27.33 +  use your version of this file under the terms of the MPL, indicate your
   27.34 +  decision by deleting the provisions above and replace them with the notice
   27.35 +  and other provisions required by the GPL or the LGPL. If you do not delete
   27.36 +  the provisions above, a recipient may use your version of this file under
   27.37 +  the terms of any one of the MPL, the GPL or the LGPL.
   27.38 + 
   27.39 +*/
   27.40 +
   27.41 +using System;
   27.42 +using System.Collections.Generic;
   27.43 +using System.Text;
   27.44 +
   27.45 +namespace OpenHardwareMonitor.Hardware.CPU {
   27.46 +
   27.47 +  public class CPUGroup : IGroup { 
   27.48 +    private List<IHardware> hardware = new List<IHardware>();
   27.49 +
   27.50 +    private string cpuBrandString;
   27.51 +    private string cpuVendor;
   27.52 +    private uint[,] cpuidData;
   27.53 +    private uint[,] cpuidExtData;
   27.54 +
   27.55 +    private uint family;
   27.56 +    private uint model;
   27.57 +    private uint stepping;
   27.58 +
   27.59 +    private static uint CPUID = 0;
   27.60 +    private static uint CPUID_EXT = 0x80000000;
   27.61 +
   27.62 +    public static void AppendRegister(StringBuilder b, uint value) {
   27.63 +      b.Append((char)((value) & 0xff));
   27.64 +      b.Append((char)((value >> 8) & 0xff));
   27.65 +      b.Append((char)((value >> 16) & 0xff));
   27.66 +      b.Append((char)((value >> 24) & 0xff));
   27.67 +    }
   27.68 +
   27.69 +    public CPUGroup() {
   27.70 +
   27.71 +      if (!WinRing0.IsAvailable) 
   27.72 +        return;
   27.73 +
   27.74 +      if (WinRing0.IsCpuid()) {
   27.75 +        uint maxCPUID = 0;
   27.76 +        uint maxCPUID_EXT = 0;
   27.77 +        uint eax, ebx, ecx, edx;
   27.78 +
   27.79 +        
   27.80 +        if (WinRing0.Cpuid(CPUID, out eax, out ebx, out ecx, out edx)) {
   27.81 +          maxCPUID = eax;
   27.82 +          StringBuilder vendorBuilder = new StringBuilder();
   27.83 +          AppendRegister(vendorBuilder, ebx);
   27.84 +          AppendRegister(vendorBuilder, edx);
   27.85 +          AppendRegister(vendorBuilder, ecx);
   27.86 +          cpuVendor = vendorBuilder.ToString();
   27.87 +
   27.88 +          eax = ebx = ecx = edx = 0;
   27.89 +          if (WinRing0.Cpuid(CPUID_EXT, out eax, out ebx, out ecx, out edx)) {
   27.90 +            maxCPUID_EXT = eax - CPUID_EXT;
   27.91 +          }
   27.92 +        }
   27.93 +        if (maxCPUID == 0 || maxCPUID_EXT == 0)
   27.94 +          return;        
   27.95 +
   27.96 +        cpuidData = new uint[maxCPUID + 1, 4];
   27.97 +        for (uint i = 0; i < (maxCPUID + 1); i++)
   27.98 +          WinRing0.Cpuid(CPUID + i, out cpuidData[i, 0], out cpuidData[i, 1],
   27.99 +            out cpuidData[i, 2], out cpuidData[i, 3]);
  27.100 +
  27.101 +        cpuidExtData = new uint[maxCPUID_EXT + 1, 4];
  27.102 +        for (uint i = 0; i < (maxCPUID_EXT + 1); i++)
  27.103 +          WinRing0.Cpuid(CPUID_EXT + i, out cpuidExtData[i, 0],
  27.104 +            out cpuidExtData[i, 1], out cpuidExtData[i, 2],
  27.105 +            out cpuidExtData[i, 3]);
  27.106 +
  27.107 +        StringBuilder nameBuilder = new StringBuilder();
  27.108 +        for (uint i = 2; i <= 4; i++) {
  27.109 +          if (WinRing0.Cpuid(CPUID_EXT + i, out eax, out ebx, out ecx, out edx)) 
  27.110 +          {
  27.111 +            AppendRegister(nameBuilder, eax);
  27.112 +            AppendRegister(nameBuilder, ebx);
  27.113 +            AppendRegister(nameBuilder, ecx);
  27.114 +            AppendRegister(nameBuilder, edx);
  27.115 +          }
  27.116 +        }
  27.117 +        cpuBrandString = nameBuilder.ToString();
  27.118 +        nameBuilder.Replace("(R)", " ");
  27.119 +        nameBuilder.Replace("(TM)", " ");
  27.120 +        nameBuilder.Replace("(tm)", " ");
  27.121 +        nameBuilder.Replace("CPU", "");
  27.122 +        for (int i = 0; i < 10; i++) nameBuilder.Replace("  ", " ");
  27.123 +        string name = nameBuilder.ToString();
  27.124 +        if (name.Contains("@"))
  27.125 +          name = name.Remove(name.LastIndexOf('@')); 
  27.126 +        name = name.Trim();
  27.127 +
  27.128 +        this.family = ((cpuidData[1, 0] & 0x0FF00000) >> 20) +
  27.129 +          ((cpuidData[1, 0] & 0x0F00) >> 8);
  27.130 +        this.model = ((cpuidData[1, 0] & 0x0F0000) >> 12) +
  27.131 +          ((cpuidData[1, 0] & 0xF0) >> 4);
  27.132 +        this.stepping = (cpuidData[1, 0] & 0x0F);
  27.133 +
  27.134 +        switch (cpuVendor) {
  27.135 +          case "GenuineIntel":
  27.136 +            // check if processor supports a digital thermal sensor
  27.137 +            if (maxCPUID >= 6 && (cpuidData[6, 0] & 1) != 0) 
  27.138 +              hardware.Add(new IntelCPU(name, family, model, stepping, 
  27.139 +                cpuidData, cpuidExtData));
  27.140 +            break;
  27.141 +          case "AuthenticAMD":                       
  27.142 +            // check if processor supports a digital thermal sensor            
  27.143 +            if (maxCPUID_EXT >= 7 && (cpuidExtData[7, 3] & 1) != 0) {
  27.144 +              switch (family) {
  27.145 +                case 0x10:
  27.146 +                  hardware.Add(new AMD10CPU(name, family, model, stepping,
  27.147 +                    cpuidData, cpuidExtData));
  27.148 +                  break;
  27.149 +                default:
  27.150 +                  break;
  27.151 +              }
  27.152 +            }
  27.153 +            break;
  27.154 +          default:
  27.155 +            break;
  27.156 +        }
  27.157 +      }
  27.158 +    }
  27.159 +
  27.160 +    public IHardware[] Hardware {
  27.161 +      get {
  27.162 +        return hardware.ToArray();
  27.163 +      }
  27.164 +    }
  27.165 +
  27.166 +    private void AppendCpuidData(StringBuilder r, uint[,] data, uint offset) {
  27.167 +      for (int i = 0; i < data.GetLength(0); i++) {
  27.168 +        r.Append(" ");
  27.169 +        r.Append((i + offset).ToString("X8"));
  27.170 +        for (int j = 0; j < 4; j++) {
  27.171 +          r.Append("  ");
  27.172 +          r.Append(data[i, j].ToString("X8"));
  27.173 +        }
  27.174 +        r.AppendLine();
  27.175 +      }
  27.176 +    }
  27.177 +
  27.178 +    public string GetReport() {
  27.179 +      if (hardware.Count == 0)
  27.180 +        return null;
  27.181 +
  27.182 +      StringBuilder r = new StringBuilder();
  27.183 +
  27.184 +      r.AppendLine("CPUID");
  27.185 +      r.AppendLine();
  27.186 +      r.AppendFormat("Processor Vendor: {0}{1}", cpuVendor, 
  27.187 +        Environment.NewLine);
  27.188 +      r.AppendFormat("Processor Brand: {0}{1}", cpuBrandString, 
  27.189 +        Environment.NewLine);
  27.190 +      r.AppendFormat("Family: 0x{0}{1}", family.ToString("X"),
  27.191 +        Environment.NewLine);
  27.192 +      r.AppendFormat("Model: 0x{0}{1}", model.ToString("X"),
  27.193 +        Environment.NewLine);
  27.194 +      r.AppendFormat("Stepping: 0x{0}{1}", stepping.ToString("X"),
  27.195 +        Environment.NewLine);
  27.196 +      r.AppendLine();
  27.197 +
  27.198 +      r.AppendLine("CPUID Return Values");
  27.199 +      r.AppendLine();
  27.200 +
  27.201 +      r.AppendLine(" Function  EAX       EBX       ECX       EDX");
  27.202 +      AppendCpuidData(r, cpuidData, CPUID);
  27.203 +      AppendCpuidData(r, cpuidExtData, CPUID_EXT);
  27.204 +      r.AppendLine();
  27.205 +
  27.206 +      return r.ToString();
  27.207 +    }
  27.208 +
  27.209 +    public void Close() { }
  27.210 +  }
  27.211 +}
    28.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
    28.2 +++ b/Hardware/CPU/IntelCPU.cs	Tue Jan 26 22:37:48 2010 +0000
    28.3 @@ -0,0 +1,151 @@
    28.4 +/*
    28.5 +  
    28.6 +  Version: MPL 1.1/GPL 2.0/LGPL 2.1
    28.7 +
    28.8 +  The contents of this file are subject to the Mozilla Public License Version
    28.9 +  1.1 (the "License"); you may not use this file except in compliance with
   28.10 +  the License. You may obtain a copy of the License at
   28.11 + 
   28.12 +  http://www.mozilla.org/MPL/
   28.13 +
   28.14 +  Software distributed under the License is distributed on an "AS IS" basis,
   28.15 +  WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
   28.16 +  for the specific language governing rights and limitations under the License.
   28.17 +
   28.18 +  The Original Code is the Open Hardware Monitor code.
   28.19 +
   28.20 +  The Initial Developer of the Original Code is 
   28.21 +  Michael Möller <m.moeller@gmx.ch>.
   28.22 +  Portions created by the Initial Developer are Copyright (C) 2009-2010
   28.23 +  the Initial Developer. All Rights Reserved.
   28.24 +
   28.25 +  Contributor(s):
   28.26 +
   28.27 +  Alternatively, the contents of this file may be used under the terms of
   28.28 +  either the GNU General Public License Version 2 or later (the "GPL"), or
   28.29 +  the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
   28.30 +  in which case the provisions of the GPL or the LGPL are applicable instead
   28.31 +  of those above. If you wish to allow use of your version of this file only
   28.32 +  under the terms of either the GPL or the LGPL, and not to allow others to
   28.33 +  use your version of this file under the terms of the MPL, indicate your
   28.34 +  decision by deleting the provisions above and replace them with the notice
   28.35 +  and other provisions required by the GPL or the LGPL. If you do not delete
   28.36 +  the provisions above, a recipient may use your version of this file under
   28.37 +  the terms of any one of the MPL, the GPL or the LGPL.
   28.38 + 
   28.39 +*/
   28.40 +
   28.41 +using System;
   28.42 +using System.Collections.Generic;
   28.43 +using System.Drawing;
   28.44 +using System.Reflection;
   28.45 +using System.Text;
   28.46 +
   28.47 +namespace OpenHardwareMonitor.Hardware.CPU {
   28.48 +  public class IntelCPU : IHardware {
   28.49 +
   28.50 +    private string name;
   28.51 +    private Image icon;
   28.52 +
   28.53 +    private Sensor[] coreTemperatures;
   28.54 +
   28.55 +    private float tjMax = 0;   
   28.56 +
   28.57 +    private const uint IA32_THERM_STATUS_MSR = 0x019C;
   28.58 +
   28.59 +    public IntelCPU(string name, uint family, uint model, uint stepping, 
   28.60 +      uint[,] cpuidData, uint[,] cpuidExtData) {
   28.61 +      
   28.62 +      this.name = name;
   28.63 +      this.icon = Utilities.EmbeddedResources.GetImage("cpu.png");
   28.64 +      
   28.65 +      uint coreCount = 1;
   28.66 +      if (cpuidData.GetLength(0) > 4)
   28.67 +        coreCount = ((cpuidData[4, 0] >> 26) & 0x3F) + 1;
   28.68 +
   28.69 +      switch (family) {
   28.70 +        case 0x06: {
   28.71 +          switch (model) {
   28.72 +            case 0x0F: // Intel Core 65nm
   28.73 +              switch (stepping) {
   28.74 +                case 0x06: // B2
   28.75 +                  switch (coreCount) {
   28.76 +                    case 2:
   28.77 +                      tjMax = 80; break;
   28.78 +                    case 4:
   28.79 +                      tjMax = 90; break;
   28.80 +                    default:
   28.81 +                      tjMax = 85; break;
   28.82 +                  }
   28.83 +                  tjMax = 80; break;
   28.84 +                case 0x0B: // G0
   28.85 +                  tjMax = 90; break;
   28.86 +                case 0x0D: // M0
   28.87 +                  tjMax = 85; break;
   28.88 +                default:
   28.89 +                  tjMax = 85; break;
   28.90 +              } break;
   28.91 +            case 0x1c: // Intel Atom 
   28.92 +              tjMax = 90; break;
   28.93 +            case 0x17: // Intel Core 45nm
   28.94 +              tjMax = 100; break;
   28.95 +            default:
   28.96 +              tjMax = 100; break;
   28.97 +          }
   28.98 +        } break;
   28.99 +        default: tjMax = 100; break;
  28.100 +      }
  28.101 +
  28.102 +      coreTemperatures = new Sensor[coreCount];
  28.103 +      for (int i = 0; i < coreTemperatures.Length; i++)
  28.104 +        coreTemperatures[i] =
  28.105 +          new Sensor("Core #" + (i + 1), i, tjMax, SensorType.Temperature, 
  28.106 +            this);
  28.107 +
  28.108 +      Update();                   
  28.109 +    }
  28.110 +
  28.111 +    public string Name {
  28.112 +      get { return name; }
  28.113 +    }
  28.114 +
  28.115 +    public string Identifier {
  28.116 +      get { return "/intelcpu/0"; }
  28.117 +    }
  28.118 +
  28.119 +    public Image Icon {
  28.120 +      get { return icon; }
  28.121 +    }
  28.122 +
  28.123 +    public ISensor[] Sensors {
  28.124 +      get {
  28.125 +        return coreTemperatures;
  28.126 +      }
  28.127 +    }
  28.128 +
  28.129 +    public string GetReport() {
  28.130 +      return null;
  28.131 +    }
  28.132 +
  28.133 +    public void Update() {
  28.134 +
  28.135 +      uint eax = 0, edx = 0;      
  28.136 +      for (int i = 0; i < coreTemperatures.Length; i++) {
  28.137 +        if (WinRing0.RdmsrPx(
  28.138 +          IA32_THERM_STATUS_MSR, ref eax, ref edx, (UIntPtr)(1 << i))) 
  28.139 +        {
  28.140 +          // if reading is valid
  28.141 +          if ((eax & 0x80000000) != 0) {
  28.142 +            // get the dist from tjMax from bits 22:16
  28.143 +            coreTemperatures[i].Value = tjMax - ((eax & 0x007F0000) >> 16);
  28.144 +          }
  28.145 +        }        
  28.146 +      }  
  28.147 +    }
  28.148 +
  28.149 +    #pragma warning disable 67
  28.150 +    public event SensorEventHandler SensorAdded;
  28.151 +    public event SensorEventHandler SensorRemoved;
  28.152 +    #pragma warning restore 67
  28.153 +  }
  28.154 +}
    29.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
    29.2 +++ b/Hardware/HDD/HDD.cs	Tue Jan 26 22:37:48 2010 +0000
    29.3 @@ -0,0 +1,110 @@
    29.4 +/*
    29.5 +  
    29.6 +  Version: MPL 1.1/GPL 2.0/LGPL 2.1
    29.7 +
    29.8 +  The contents of this file are subject to the Mozilla Public License Version
    29.9 +  1.1 (the "License"); you may not use this file except in compliance with
   29.10 +  the License. You may obtain a copy of the License at
   29.11 + 
   29.12 +  http://www.mozilla.org/MPL/
   29.13 +
   29.14 +  Software distributed under the License is distributed on an "AS IS" basis,
   29.15 +  WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
   29.16 +  for the specific language governing rights and limitations under the License.
   29.17 +
   29.18 +  The Original Code is the Open Hardware Monitor code.
   29.19 +
   29.20 +  The Initial Developer of the Original Code is 
   29.21 +  Michael Möller <m.moeller@gmx.ch>.
   29.22 +  Portions created by the Initial Developer are Copyright (C) 2009-2010
   29.23 +  the Initial Developer. All Rights Reserved.
   29.24 +
   29.25 +  Contributor(s):
   29.26 +
   29.27 +  Alternatively, the contents of this file may be used under the terms of
   29.28 +  either the GNU General Public License Version 2 or later (the "GPL"), or
   29.29 +  the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
   29.30 +  in which case the provisions of the GPL or the LGPL are applicable instead
   29.31 +  of those above. If you wish to allow use of your version of this file only
   29.32 +  under the terms of either the GPL or the LGPL, and not to allow others to
   29.33 +  use your version of this file under the terms of the MPL, indicate your
   29.34 +  decision by deleting the provisions above and replace them with the notice
   29.35 +  and other provisions required by the GPL or the LGPL. If you do not delete
   29.36 +  the provisions above, a recipient may use your version of this file under
   29.37 +  the terms of any one of the MPL, the GPL or the LGPL.
   29.38 + 
   29.39 +*/
   29.40 +
   29.41 +using System;
   29.42 +using System.Collections.Generic;
   29.43 +using System.Drawing;
   29.44 +
   29.45 +namespace OpenHardwareMonitor.Hardware.HDD {
   29.46 +  public class HDD : IHardware {
   29.47 +
   29.48 +    private const int UPDATE_DIVIDER = 30; // update only every 30s
   29.49 +
   29.50 +    private string name;
   29.51 +    private IntPtr handle;
   29.52 +    private int drive;
   29.53 +    private int attribute;    
   29.54 +    private Image icon;
   29.55 +    private Sensor temperature;
   29.56 +    private int count;
   29.57 +    
   29.58 +
   29.59 +    public HDD(string name, IntPtr handle, int drive, int attribute) {
   29.60 +      this.name = name;
   29.61 +      this.handle = handle;
   29.62 +      this.drive = drive;
   29.63 +      this.attribute = attribute;
   29.64 +      this.count = 0;
   29.65 +      this.icon = Utilities.EmbeddedResources.GetImage("hdd.png");
   29.66 +      this.temperature = new Sensor("HDD", 0, SensorType.Temperature, this);
   29.67 +      Update();
   29.68 +    }
   29.69 +
   29.70 +
   29.71 +    public string Name {
   29.72 +      get { return name; }
   29.73 +    }
   29.74 +
   29.75 +    public string Identifier {
   29.76 +      get { return "/hdd/" + drive; }
   29.77 +    }
   29.78 +
   29.79 +    public Image Icon {
   29.80 +      get { return icon; }
   29.81 +    }
   29.82 +
   29.83 +    public ISensor[] Sensors {
   29.84 +      get {
   29.85 +        return new ISensor[] { temperature };
   29.86 +      }
   29.87 +    }
   29.88 +
   29.89 +    public string GetReport() {
   29.90 +      return null;
   29.91 +    }
   29.92 +
   29.93 +    public void Update() {
   29.94 +      if (count == 0) {
   29.95 +        SMART.DriveAttribute[] attributes = SMART.ReadSmart(handle, drive);
   29.96 +        temperature.Value = attributes[attribute].RawValue[0];
   29.97 +      } else {
   29.98 +        temperature.Value = temperature.Value;
   29.99 +      }
  29.100 +
  29.101 +      count++; count %= UPDATE_DIVIDER; 
  29.102 +    }
  29.103 +
  29.104 +    public void Close() {
  29.105 +      SMART.CloseHandle(handle);
  29.106 +    }
  29.107 +
  29.108 +    #pragma warning disable 67
  29.109 +    public event SensorEventHandler SensorAdded;
  29.110 +    public event SensorEventHandler SensorRemoved;
  29.111 +    #pragma warning restore 67
  29.112 +  }
  29.113 +}
    30.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
    30.2 +++ b/Hardware/HDD/HDDGroup.cs	Tue Jan 26 22:37:48 2010 +0000
    30.3 @@ -0,0 +1,101 @@
    30.4 +/*
    30.5 +  
    30.6 +  Version: MPL 1.1/GPL 2.0/LGPL 2.1
    30.7 +
    30.8 +  The contents of this file are subject to the Mozilla Public License Version
    30.9 +  1.1 (the "License"); you may not use this file except in compliance with
   30.10 +  the License. You may obtain a copy of the License at
   30.11 + 
   30.12 +  http://www.mozilla.org/MPL/
   30.13 +
   30.14 +  Software distributed under the License is distributed on an "AS IS" basis,
   30.15 +  WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
   30.16 +  for the specific language governing rights and limitations under the License.
   30.17 +
   30.18 +  The Original Code is the Open Hardware Monitor code.
   30.19 +
   30.20 +  The Initial Developer of the Original Code is 
   30.21 +  Michael Möller <m.moeller@gmx.ch>.
   30.22 +  Portions created by the Initial Developer are Copyright (C) 2009-2010
   30.23 +  the Initial Developer. All Rights Reserved.
   30.24 +
   30.25 +  Contributor(s):
   30.26 +
   30.27 +  Alternatively, the contents of this file may be used under the terms of
   30.28 +  either the GNU General Public License Version 2 or later (the "GPL"), or
   30.29 +  the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
   30.30 +  in which case the provisions of the GPL or the LGPL are applicable instead
   30.31 +  of those above. If you wish to allow use of your version of this file only
   30.32 +  under the terms of either the GPL or the LGPL, and not to allow others to
   30.33 +  use your version of this file under the terms of the MPL, indicate your
   30.34 +  decision by deleting the provisions above and replace them with the notice
   30.35 +  and other provisions required by the GPL or the LGPL. If you do not delete
   30.36 +  the provisions above, a recipient may use your version of this file under
   30.37 +  the terms of any one of the MPL, the GPL or the LGPL.
   30.38 + 
   30.39 +*/
   30.40 +
   30.41 +using System;
   30.42 +using System.Collections.Generic;
   30.43 +
   30.44 +namespace OpenHardwareMonitor.Hardware.HDD {
   30.45 +  public class HDDGroup : IGroup {
   30.46 +
   30.47 +    private const int MAX_DRIVES = 32;
   30.48 +
   30.49 +    private List<HDD> hardware = new List<HDD>();
   30.50 +
   30.51 +    public HDDGroup() {
   30.52 +
   30.53 +      int p = (int)System.Environment.OSVersion.Platform;
   30.54 +      if ((p != 4) && (p != 128)) {
   30.55 +        for (int drive = 0; drive < MAX_DRIVES; drive++) {
   30.56 +          IntPtr handle = SMART.OpenPhysicalDrive(drive);
   30.57 +
   30.58 +          if (handle == SMART.INVALID_HANDLE_VALUE)
   30.59 +            continue;
   30.60 +
   30.61 +          if (SMART.EnableSmart(handle, drive)) {
   30.62 +
   30.63 +            string name = SMART.ReadName(handle, drive);
   30.64 +            if (name != null) {
   30.65 +
   30.66 +              SMART.DriveAttribute[] attributes =
   30.67 +                SMART.ReadSmart(handle, drive);
   30.68 +
   30.69 +              int attribute = -1;
   30.70 +              for (int i = 0; i < attributes.Length; i++) {
   30.71 +                if (attributes[i].ID == SMART.AttributeID.Temperature) {
   30.72 +                  attribute = i;
   30.73 +                  break;
   30.74 +                }
   30.75 +              }
   30.76 +
   30.77 +              if (attribute >= 0) {
   30.78 +                hardware.Add(new HDD(name, handle, drive, attribute));
   30.79 +                continue;
   30.80 +              }
   30.81 +            }
   30.82 +          }
   30.83 +          SMART.CloseHandle(handle);
   30.84 +        }
   30.85 +      }
   30.86 +    }
   30.87 +
   30.88 +
   30.89 +    public IHardware[] Hardware {
   30.90 +      get {
   30.91 +        return hardware.ToArray();
   30.92 +      }
   30.93 +    }
   30.94 +
   30.95 +    public string GetReport() {
   30.96 +      return null;
   30.97 +    }
   30.98 +
   30.99 +    public void Close() {
  30.100 +      foreach (HDD hdd in hardware) 
  30.101 +        hdd.Close();
  30.102 +    }
  30.103 +  }
  30.104 +}
    31.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
    31.2 +++ b/Hardware/HDD/SMART.cs	Tue Jan 26 22:37:48 2010 +0000
    31.3 @@ -0,0 +1,337 @@
    31.4 +/*
    31.5 +  
    31.6 +  Version: MPL 1.1/GPL 2.0/LGPL 2.1
    31.7 +
    31.8 +  The contents of this file are subject to the Mozilla Public License Version
    31.9 +  1.1 (the "License"); you may not use this file except in compliance with
   31.10 +  the License. You may obtain a copy of the License at
   31.11 + 
   31.12 +  http://www.mozilla.org/MPL/
   31.13 +
   31.14 +  Software distributed under the License is distributed on an "AS IS" basis,
   31.15 +  WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
   31.16 +  for the specific language governing rights and limitations under the License.
   31.17 +
   31.18 +  The Original Code is the Open Hardware Monitor code.
   31.19 +
   31.20 +  The Initial Developer of the Original Code is 
   31.21 +  Michael Möller <m.moeller@gmx.ch>.
   31.22 +  Portions created by the Initial Developer are Copyright (C) 2009-2010
   31.23 +  the Initial Developer. All Rights Reserved.
   31.24 +
   31.25 +  Contributor(s):
   31.26 +
   31.27 +  Alternatively, the contents of this file may be used under the terms of
   31.28 +  either the GNU General Public License Version 2 or later (the "GPL"), or
   31.29 +  the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
   31.30 +  in which case the provisions of the GPL or the LGPL are applicable instead
   31.31 +  of those above. If you wish to allow use of your version of this file only
   31.32 +  under the terms of either the GPL or the LGPL, and not to allow others to
   31.33 +  use your version of this file under the terms of the MPL, indicate your
   31.34 +  decision by deleting the provisions above and replace them with the notice
   31.35 +  and other provisions required by the GPL or the LGPL. If you do not delete
   31.36 +  the provisions above, a recipient may use your version of this file under
   31.37 +  the terms of any one of the MPL, the GPL or the LGPL.
   31.38 + 
   31.39 +*/
   31.40 +
   31.41 +using System;
   31.42 +using System.Collections.Generic;
   31.43 +using System.Runtime.InteropServices;
   31.44 +
   31.45 +namespace OpenHardwareMonitor.Hardware.HDD {
   31.46 +    
   31.47 +  public class SMART {
   31.48 +
   31.49 +    [Flags]
   31.50 +    public enum Status : ushort {
   31.51 +      PreFailureWarranty = 0x01,
   31.52 +      OnLineCollection = 0x02,
   31.53 +      Performance = 0x04,
   31.54 +      ErrorRate = 0x08,
   31.55 +      EventCount = 0x10,
   31.56 +      SelfPreserving = 0x20
   31.57 +    }
   31.58 +
   31.59 +    public enum AttributeID : byte {
   31.60 +      ReadErrorRate = 0x01,
   31.61 +      ThroughputPerformance = 0x02,
   31.62 +      SpinUpTime = 0x03,
   31.63 +      StartStopCount = 0x04,
   31.64 +      ReallocatedSectorsCount = 0x05,
   31.65 +      ReadChannelMargin = 0x06,
   31.66 +      SeekErrorRate = 0x07,
   31.67 +      SeekTimePerformance = 0x08,
   31.68 +      PowerOnHours = 0x09,
   31.69 +      SpinRetryCount = 0x0A,
   31.70 +      RecalibrationRetries = 0x0B,
   31.71 +      PowerCycleCount = 0x0C,
   31.72 +      SoftReadErrorRate = 0x0D,
   31.73 +      Temperature = 0xC2,
   31.74 +      HardwareECCRecovered = 0xC3,
   31.75 +      ReallocationEventCount = 0xC4,
   31.76 +      CurrentPendingSectorCount = 0xC5,
   31.77 +      UncorrectableSectorCount = 0xC6,
   31.78 +      UltraDMACRCErrorCount = 0xC7,
   31.79 +      WriteErrorRate = 0xC8
   31.80 +    }
   31.81 +
   31.82 +    [StructLayout(LayoutKind.Sequential, Pack = 1)]
   31.83 +    public struct DriveAttribute {
   31.84 +      public AttributeID ID;
   31.85 +      public Status StatusFlags;
   31.86 +      public byte AttrValue;
   31.87 +      public byte WorstValue;
   31.88 +      [MarshalAs(UnmanagedType.ByValArray, SizeConst = 6)]
   31.89 +      public byte[] RawValue;
   31.90 +      public byte Reserved;
   31.91 +    };
   31.92 +
   31.93 +    [Flags]
   31.94 +    private enum AccessMode : uint {     
   31.95 +      Read = 0x80000000,    
   31.96 +      Write = 0x40000000,     
   31.97 +      Execute = 0x20000000,     
   31.98 +      All = 0x10000000
   31.99 +    }
  31.100 +
  31.101 +    [Flags]
  31.102 +    private enum ShareMode : uint {
  31.103 +      None = 0,     
  31.104 +      Read = 1,     
  31.105 +      Write = 2,    
  31.106 +      Delete = 4
  31.107 +    }
  31.108 +
  31.109 +    private enum CreationMode : uint {
  31.110 +      New = 1,
  31.111 +      CreateAlways = 2,    
  31.112 +      OpenExisting = 3,    
  31.113 +      OpenAlways = 4,    
  31.114 +      TruncateExisting = 5
  31.115 +    }
  31.116 +
  31.117 +    [Flags]
  31.118 +    private enum FileAttribute : uint {
  31.119 +      Readonly = 0x00000001,
  31.120 +      Hidden = 0x00000002,
  31.121 +      System = 0x00000004,
  31.122 +      Directory = 0x00000010,
  31.123 +      Archive = 0x00000020,
  31.124 +      Device = 0x00000040,
  31.125 +      Normal = 0x00000080,
  31.126 +      Temporary = 0x00000100,
  31.127 +      SparseFile = 0x00000200,
  31.128 +      ReparsePoint = 0x00000400,
  31.129 +      Compressed = 0x00000800,
  31.130 +      Offline = 0x00001000,
  31.131 +      NotContentIndexed = 0x00002000,
  31.132 +      Encrypted = 0x00004000,
  31.133 +    }
  31.134 +
  31.135 +    private enum DriveCommand : uint {
  31.136 +      GetVersion = 0x00074080,
  31.137 +      SendDriveCommand = 0x0007c084,
  31.138 +      ReceiveDriveData = 0x0007c088
  31.139 +    }
  31.140 +
  31.141 +    [StructLayout(LayoutKind.Sequential, Pack = 1)]
  31.142 +    private struct CommandBlockRegisters {
  31.143 +      public byte Features;         
  31.144 +      public byte SectorCount;      
  31.145 +      public byte LBALow;       
  31.146 +      public byte LBAMid;           
  31.147 +      public byte LBAHigh;        
  31.148 +      public byte Device;       
  31.149 +      public byte Command;           
  31.150 +      public byte Reserved;                  
  31.151 +    }
  31.152 +
  31.153 +    [StructLayout(LayoutKind.Sequential, Pack = 1)]
  31.154 +    private struct DriveCommandParameter {
  31.155 +      private uint BufferSize;           
  31.156 +      public CommandBlockRegisters Registers;           
  31.157 +      public byte DriveNumber;   
  31.158 +      [MarshalAs(UnmanagedType.ByValArray, SizeConst = 19)]
  31.159 +      public byte[] Reserved;                                
  31.160 +    }
  31.161 +
  31.162 +    [StructLayout(LayoutKind.Sequential, Pack = 1)]
  31.163 +    private struct DriverStatus {
  31.164 +      public byte DriverError;   
  31.165 +      public byte IDEError;             
  31.166 +      [MarshalAs(UnmanagedType.ByValArray, SizeConst = 10)]
  31.167 +      public byte[] Reserved;               
  31.168 +    }
  31.169 +
  31.170 +    [StructLayout(LayoutKind.Sequential, Pack = 1)]
  31.171 +    private struct DriveCommandResult {
  31.172 +      public uint BufferSize;
  31.173 +      public DriverStatus DriverStatus;
  31.174 +    } 
  31.175 +
  31.176 +    [StructLayout(LayoutKind.Sequential, Pack = 1)]
  31.177 +    private struct DriveSmartReadResult {
  31.178 +      public uint BufferSize;           
  31.179 +      public DriverStatus DriverStatus;
  31.180 +      public byte Version;
  31.181 +      public byte Reserved;
  31.182 +      [MarshalAs(UnmanagedType.ByValArray, SizeConst = MAX_DRIVE_ATTRIBUTES)]
  31.183 +      public DriveAttribute[] Attributes;                                                                                       
  31.184 +    }
  31.185 +
  31.186 +    [StructLayout(LayoutKind.Sequential, Pack = 1)]
  31.187 +    private struct Identify {
  31.188 +      public ushort GeneralConfiguration;
  31.189 +      public ushort NumberOfCylinders;
  31.190 +      public ushort Reserved;
  31.191 +      public ushort NumberOfHeads;
  31.192 +      public ushort UnformattedBytesPerTrack;
  31.193 +      public ushort UnformattedBytesPerSector;
  31.194 +      public ushort SectorsPerTrack;
  31.195 +      [MarshalAs(UnmanagedType.ByValArray, SizeConst = 3)]
  31.196 +      public ushort[] VendorUnique;
  31.197 +      [MarshalAs(UnmanagedType.ByValArray, SizeConst = 20)]
  31.198 +      public byte[] SerialNumber;
  31.199 +      public ushort BufferType;
  31.200 +      public ushort BufferSectorSize;
  31.201 +      public ushort NumberOfEccBytes;
  31.202 +      [MarshalAs(UnmanagedType.ByValArray, SizeConst = 8)]
  31.203 +      public byte[] FirmwareRevision;
  31.204 +      [MarshalAs(UnmanagedType.ByValArray, SizeConst = 40)]
  31.205 +      public byte[] ModelNumber;
  31.206 +      public ushort MoreVendorUnique;
  31.207 +      public ushort DoubleWordIo;
  31.208 +      public ushort Capabilities;
  31.209 +      public ushort MoreReserved;
  31.210 +      public ushort PioCycleTimingMode;
  31.211 +      public ushort DmaCycleTimingMode;
  31.212 +      [MarshalAs(UnmanagedType.ByValArray, SizeConst = 406)]
  31.213 +      public byte[] More;
  31.214 +    }
  31.215 +
  31.216 +    [StructLayout(LayoutKind.Sequential, Pack = 1)]
  31.217 +    private struct DriveIdentifyResult {
  31.218 +      public uint BufferSize;
  31.219 +      public DriverStatus DriverStatus;
  31.220 +      public Identify Identify;
  31.221 +    } 
  31.222 +
  31.223 +    public static readonly IntPtr INVALID_HANDLE_VALUE = (IntPtr)(-1);
  31.224 +
  31.225 +    private const byte SMART_CMD = 0xB0;
  31.226 +    private const byte ID_CMD = 0xEC;
  31.227 +    
  31.228 +    private const byte SMART_READ_DATA = 0xD0;
  31.229 +    private const byte SMART_ENABLE_OPERATIONS = 0xD8;
  31.230 +    
  31.231 +    private const byte SMART_LBA_MID = 0x4F;
  31.232 +    private const byte SMART_LBA_HI = 0xC2;
  31.233 +
  31.234 +    private const int MAX_DRIVE_ATTRIBUTES = 512;
  31.235 +
  31.236 +    private const string KERNEL = "kernel32.dll";
  31.237 +
  31.238 +    [DllImport(KERNEL, CallingConvention = CallingConvention.Winapi)]
  31.239 +    private static extern IntPtr CreateFile(string fileName, 
  31.240 +      AccessMode desiredAccess, ShareMode shareMode, IntPtr securityAttributes,
  31.241 +      CreationMode creationDisposition, FileAttribute flagsAndAttributes, 
  31.242 +      IntPtr templateFilehandle);
  31.243 +
  31.244 +    [DllImport(KERNEL, CallingConvention = CallingConvention.Winapi)]
  31.245 +    public static extern int CloseHandle(IntPtr handle);
  31.246 +
  31.247 +    [DllImport(KERNEL, CallingConvention = CallingConvention.Winapi)]
  31.248 +    private static extern bool DeviceIoControl(IntPtr handle,
  31.249 +      DriveCommand command, ref DriveCommandParameter parameter,
  31.250 +      int parameterSize, out DriveSmartReadResult result, int resultSize, 
  31.251 +      out uint bytesReturned, IntPtr overlapped);
  31.252 +
  31.253 +    [DllImport(KERNEL, CallingConvention = CallingConvention.Winapi)]
  31.254 +    private static extern bool DeviceIoControl(IntPtr handle,
  31.255 +      DriveCommand command, ref DriveCommandParameter parameter,
  31.256 +      int parameterSize, out DriveCommandResult result, int resultSize,
  31.257 +      out uint bytesReturned, IntPtr overlapped);
  31.258 +
  31.259 +    [DllImport(KERNEL, CallingConvention = CallingConvention.Winapi)]
  31.260 +    private static extern bool DeviceIoControl(IntPtr handle,
  31.261 +      DriveCommand command, ref DriveCommandParameter parameter,
  31.262 +      int parameterSize, out DriveIdentifyResult result, int resultSize,
  31.263 +      out uint bytesReturned, IntPtr overlapped);
  31.264 +
  31.265 +    public static IntPtr OpenPhysicalDrive(int driveNumber) {
  31.266 +      return CreateFile(@"\\.\PhysicalDrive" + driveNumber,
  31.267 +        AccessMode.Read | AccessMode.Write, ShareMode.Read | ShareMode.Write,
  31.268 +        IntPtr.Zero, CreationMode.OpenExisting, FileAttribute.Device,
  31.269 +        IntPtr.Zero);
  31.270 +    }
  31.271 +
  31.272 +    public static bool EnableSmart(IntPtr handle, int driveNumber) {
  31.273 +      DriveCommandParameter parameter = new DriveCommandParameter();
  31.274 +      DriveCommandResult result;
  31.275 +      uint bytesReturned;
  31.276 +
  31.277 +      parameter.DriveNumber = (byte)driveNumber;
  31.278 +      parameter.Registers.Features = SMART_ENABLE_OPERATIONS;
  31.279 +      parameter.Registers.LBAMid = SMART_LBA_MID;
  31.280 +      parameter.Registers.LBAHigh = SMART_LBA_HI;
  31.281 +      parameter.Registers.Command = SMART_CMD;
  31.282 +
  31.283 +      return DeviceIoControl(handle, DriveCommand.SendDriveCommand, 
  31.284 +        ref parameter, Marshal.SizeOf(parameter), out result,
  31.285 +        Marshal.SizeOf(typeof(DriveCommandResult)), out bytesReturned, 
  31.286 +        IntPtr.Zero);
  31.287 +    }
  31.288 +
  31.289 +    public static DriveAttribute[] ReadSmart(IntPtr handle, int driveNumber) {
  31.290 +      DriveCommandParameter parameter = new DriveCommandParameter();
  31.291 +      DriveSmartReadResult result;
  31.292 +      uint bytesReturned;
  31.293 +
  31.294 +      parameter.DriveNumber = (byte)driveNumber;
  31.295 +      parameter.Registers.Features = SMART_READ_DATA;
  31.296 +      parameter.Registers.LBAMid = SMART_LBA_MID;
  31.297 +      parameter.Registers.LBAHigh = SMART_LBA_HI;
  31.298 +      parameter.Registers.Command = SMART_CMD;
  31.299 +
  31.300 +      bool valid = DeviceIoControl(handle, DriveCommand.ReceiveDriveData,
  31.301 +        ref parameter, Marshal.SizeOf(parameter), out result,
  31.302 +        Marshal.SizeOf(typeof(DriveSmartReadResult)), out bytesReturned,
  31.303 +        IntPtr.Zero);
  31.304 +
  31.305 +      if (!valid)
  31.306 +        return null;
  31.307 +      else
  31.308 +        return result.Attributes;
  31.309 +    }
  31.310 +
  31.311 +    public static string ReadName(IntPtr handle, int driveNumber) {
  31.312 +      DriveCommandParameter parameter = new DriveCommandParameter();
  31.313 +      DriveIdentifyResult result;
  31.314 +      uint bytesReturned;
  31.315 +
  31.316 +      parameter.DriveNumber = (byte)driveNumber;
  31.317 +      parameter.Registers.Command = ID_CMD;
  31.318 +
  31.319 +      bool valid = DeviceIoControl(handle, DriveCommand.ReceiveDriveData,
  31.320 +        ref parameter, Marshal.SizeOf(parameter), out result,
  31.321 +        Marshal.SizeOf(typeof(DriveIdentifyResult)), out bytesReturned,
  31.322 +        IntPtr.Zero);
  31.323 +
  31.324 +      if (!valid)
  31.325 +        return null;
  31.326 +      else {
  31.327 +
  31.328 +        byte[] bytes = result.Identify.ModelNumber;
  31.329 +        char[] chars = new char[bytes.Length];
  31.330 +        for (int i = 0; i < bytes.Length; i += 2) {
  31.331 +          chars[i] = (char)bytes[i + 1];
  31.332 +          chars[i + 1] = (char)bytes[i];
  31.333 +        }
  31.334 +
  31.335 +        return new string(chars).Trim();
  31.336 +      }
  31.337 +    }
  31.338 +
  31.339 +  }
  31.340 +}
    32.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
    32.2 +++ b/Hardware/IGroup.cs	Tue Jan 26 22:37:48 2010 +0000
    32.3 @@ -0,0 +1,52 @@
    32.4 +/*
    32.5 +  
    32.6 +  Version: MPL 1.1/GPL 2.0/LGPL 2.1
    32.7 +
    32.8 +  The contents of this file are subject to the Mozilla Public License Version
    32.9 +  1.1 (the "License"); you may not use this file except in compliance with
   32.10 +  the License. You may obtain a copy of the License at
   32.11 + 
   32.12 +  http://www.mozilla.org/MPL/
   32.13 +
   32.14 +  Software distributed under the License is distributed on an "AS IS" basis,
   32.15 +  WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
   32.16 +  for the specific language governing rights and limitations under the License.
   32.17 +
   32.18 +  The Original Code is the Open Hardware Monitor code.
   32.19 +
   32.20 +  The Initial Developer of the Original Code is 
   32.21 +  Michael Möller <m.moeller@gmx.ch>.
   32.22 +  Portions created by the Initial Developer are Copyright (C) 2009-2010
   32.23 +  the Initial Developer. All Rights Reserved.
   32.24 +
   32.25 +  Contributor(s):
   32.26 +
   32.27 +  Alternatively, the contents of this file may be used under the terms of
   32.28 +  either the GNU General Public License Version 2 or later (the "GPL"), or
   32.29 +  the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
   32.30 +  in which case the provisions of the GPL or the LGPL are applicable instead
   32.31 +  of those above. If you wish to allow use of your version of this file only
   32.32 +  under the terms of either the GPL or the LGPL, and not to allow others to
   32.33 +  use your version of this file under the terms of the MPL, indicate your
   32.34 +  decision by deleting the provisions above and replace them with the notice
   32.35 +  and other provisions required by the GPL or the LGPL. If you do not delete
   32.36 +  the provisions above, a recipient may use your version of this file under
   32.37 +  the terms of any one of the MPL, the GPL or the LGPL.
   32.38 + 
   32.39 +*/
   32.40 +
   32.41 +using System;
   32.42 +using System.Collections.Generic;
   32.43 +
   32.44 +namespace OpenHardwareMonitor.Hardware {
   32.45 +
   32.46 +  public interface IGroup {
   32.47 +
   32.48 +    IHardware[] Hardware { get; }
   32.49 +
   32.50 +    string GetReport();
   32.51 +
   32.52 +    void Close();
   32.53 +  }
   32.54 +
   32.55 +}
    33.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
    33.2 +++ b/Hardware/IHardware.cs	Tue Jan 26 22:37:48 2010 +0000
    33.3 @@ -0,0 +1,62 @@
    33.4 +/*
    33.5 +  
    33.6 +  Version: MPL 1.1/GPL 2.0/LGPL 2.1
    33.7 +
    33.8 +  The contents of this file are subject to the Mozilla Public License Version
    33.9 +  1.1 (the "License"); you may not use this file except in compliance with
   33.10 +  the License. You may obtain a copy of the License at
   33.11 + 
   33.12 +  http://www.mozilla.org/MPL/
   33.13 +
   33.14 +  Software distributed under the License is distributed on an "AS IS" basis,
   33.15 +  WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
   33.16 +  for the specific language governing rights and limitations under the License.
   33.17 +
   33.18 +  The Original Code is the Open Hardware Monitor code.
   33.19 +
   33.20 +  The Initial Developer of the Original Code is 
   33.21 +  Michael Möller <m.moeller@gmx.ch>.
   33.22 +  Portions created by the Initial Developer are Copyright (C) 2009-2010
   33.23 +  the Initial Developer. All Rights Reserved.
   33.24 +
   33.25 +  Contributor(s):
   33.26 +
   33.27 +  Alternatively, the contents of this file may be used under the terms of
   33.28 +  either the GNU General Public License Version 2 or later (the "GPL"), or
   33.29 +  the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
   33.30 +  in which case the provisions of the GPL or the LGPL are applicable instead
   33.31 +  of those above. If you wish to allow use of your version of this file only
   33.32 +  under the terms of either the GPL or the LGPL, and not to allow others to
   33.33 +  use your version of this file under the terms of the MPL, indicate your
   33.34 +  decision by deleting the provisions above and replace them with the notice
   33.35 +  and other provisions required by the GPL or the LGPL. If you do not delete
   33.36 +  the provisions above, a recipient may use your version of this file under
   33.37 +  the terms of any one of the MPL, the GPL or the LGPL.
   33.38 + 
   33.39 +*/
   33.40 +
   33.41 +using System;
   33.42 +using System.Collections.Generic;
   33.43 +using System.Drawing;
   33.44 +
   33.45 +namespace OpenHardwareMonitor.Hardware {
   33.46 +
   33.47 +  public delegate void SensorEventHandler(ISensor sensor);
   33.48 +
   33.49 +  public interface IHardware {
   33.50 +
   33.51 +    string Name { get; }
   33.52 +    string Identifier { get; }
   33.53 +
   33.54 +    Image Icon { get; }
   33.55 +
   33.56 +    string GetReport();
   33.57 +
   33.58 +    void Update();
   33.59 +
   33.60 +    ISensor[] Sensors { get; }
   33.61 +
   33.62 +    event SensorEventHandler SensorAdded;
   33.63 +    event SensorEventHandler SensorRemoved;
   33.64 +  }
   33.65 +}
    34.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
    34.2 +++ b/Hardware/ISensor.cs	Tue Jan 26 22:37:48 2010 +0000
    34.3 @@ -0,0 +1,66 @@
    34.4 +/*
    34.5 +  
    34.6 +  Version: MPL 1.1/GPL 2.0/LGPL 2.1
    34.7 +
    34.8 +  The contents of this file are subject to the Mozilla Public License Version
    34.9 +  1.1 (the "License"); you may not use this file except in compliance with
   34.10 +  the License. You may obtain a copy of the License at
   34.11 + 
   34.12 +  http://www.mozilla.org/MPL/
   34.13 +
   34.14 +  Software distributed under the License is distributed on an "AS IS" basis,
   34.15 +  WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
   34.16 +  for the specific language governing rights and limitations under the License.
   34.17 +
   34.18 +  The Original Code is the Open Hardware Monitor code.
   34.19 +
   34.20 +  The Initial Developer of the Original Code is 
   34.21 +  Michael Möller <m.moeller@gmx.ch>.
   34.22 +  Portions created by the Initial Developer are Copyright (C) 2009-2010
   34.23 +  the Initial Developer. All Rights Reserved.
   34.24 +
   34.25 +  Contributor(s):
   34.26 +
   34.27 +  Alternatively, the contents of this file may be used under the terms of
   34.28 +  either the GNU General Public License Version 2 or later (the "GPL"), or
   34.29 +  the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
   34.30 +  in which case the provisions of the GPL or the LGPL are applicable instead
   34.31 +  of those above. If you wish to allow use of your version of this file only
   34.32 +  under the terms of either the GPL or the LGPL, and not to allow others to
   34.33 +  use your version of this file under the terms of the MPL, indicate your
   34.34 +  decision by deleting the provisions above and replace them with the notice
   34.35 +  and other provisions required by the GPL or the LGPL. If you do not delete
   34.36 +  the provisions above, a recipient may use your version of this file under
   34.37 +  the terms of any one of the MPL, the GPL or the LGPL.
   34.38 + 
   34.39 +*/
   34.40 +
   34.41 +using System;
   34.42 +using System.Collections.Generic;
   34.43 +
   34.44 +namespace OpenHardwareMonitor.Hardware {
   34.45 +
   34.46 +  public enum SensorType {
   34.47 +    Voltage,
   34.48 +    Clock,
   34.49 +    Temperature,
   34.50 +    Fan    
   34.51 +  }
   34.52 +
   34.53 +  public interface ISensorEntry {
   34.54 +    float Value { get; }
   34.55 +    DateTime Time { get; }
   34.56 +  }
   34.57 +
   34.58 +  public interface ISensor {
   34.59 +    SensorType SensorType { get; }
   34.60 +    string Name { get; set; }
   34.61 +    int Index { get; }
   34.62 +    float? Value { get; }
   34.63 +    float? Min { get; }
   34.64 +    float? Max { get; }
   34.65 +    float? Limit { get; set; }
   34.66 +    IEnumerable<ISensorEntry> Plot { get; }
   34.67 +  }
   34.68 +
   34.69 +}
    35.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
    35.2 +++ b/Hardware/LPC/Chip.cs	Tue Jan 26 22:37:48 2010 +0000
    35.3 @@ -0,0 +1,17 @@
    35.4 +
    35.5 +using System;
    35.6 +using System.Collections.Generic;
    35.7 +using System.Text;
    35.8 +
    35.9 +namespace OpenHardwareMonitor.Hardware.LPC {
   35.10 +
   35.11 +  public enum Chip : ushort {
   35.12 +    Unknown = 0,
   35.13 +    IT8716F = 0x8716,
   35.14 +    IT8718F = 0x8718,
   35.15 +    IT8720F = 0x8720,
   35.16 +    IT8726F = 0x8726,
   35.17 +    W83627DHG = 0xA020
   35.18 +  }
   35.19 +
   35.20 +}
    36.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
    36.2 +++ b/Hardware/LPC/IT87.cs	Tue Jan 26 22:37:48 2010 +0000
    36.3 @@ -0,0 +1,225 @@
    36.4 +/*
    36.5 +  
    36.6 +  Version: MPL 1.1/GPL 2.0/LGPL 2.1
    36.7 +
    36.8 +  The contents of this file are subject to the Mozilla Public License Version
    36.9 +  1.1 (the "License"); you may not use this file except in compliance with
   36.10 +  the License. You may obtain a copy of the License at
   36.11 + 
   36.12 +  http://www.mozilla.org/MPL/
   36.13 +
   36.14 +  Software distributed under the License is distributed on an "AS IS" basis,
   36.15 +  WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
   36.16 +  for the specific language governing rights and limitations under the License.
   36.17 +
   36.18 +  The Original Code is the Open Hardware Monitor code.
   36.19 +
   36.20 +  The Initial Developer of the Original Code is 
   36.21 +  Michael Möller <m.moeller@gmx.ch>.
   36.22 +  Portions created by the Initial Developer are Copyright (C) 2009-2010
   36.23 +  the Initial Developer. All Rights Reserved.
   36.24 +
   36.25 +  Contributor(s):
   36.26 +
   36.27 +  Alternatively, the contents of this file may be used under the terms of
   36.28 +  either the GNU General Public License Version 2 or later (the "GPL"), or
   36.29 +  the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
   36.30 +  in which case the provisions of the GPL or the LGPL are applicable instead
   36.31 +  of those above. If you wish to allow use of your version of this file only
   36.32 +  under the terms of either the GPL or the LGPL, and not to allow others to
   36.33 +  use your version of this file under the terms of the MPL, indicate your
   36.34 +  decision by deleting the provisions above and replace them with the notice
   36.35 +  and other provisions required by the GPL or the LGPL. If you do not delete
   36.36 +  the provisions above, a recipient may use your version of this file under
   36.37 +  the terms of any one of the MPL, the GPL or the LGPL.
   36.38 + 
   36.39 +*/
   36.40 +
   36.41 +using System;
   36.42 +using System.Collections.Generic;
   36.43 +using System.Drawing;
   36.44 +using System.Text;
   36.45 +
   36.46 +namespace OpenHardwareMonitor.Hardware.LPC {
   36.47 +  public class IT87 : IHardware {
   36.48 +
   36.49 +    private string name;
   36.50 +    private Image icon;
   36.51 +        
   36.52 +    private bool available = false;
   36.53 +    private Chip chip;
   36.54 +    private ushort address;
   36.55 +
   36.56 +    private Sensor[] temperatures;
   36.57 +    private Sensor[] fans;
   36.58 +    private Sensor[] voltages;
   36.59 +    private List<ISensor> active = new List<ISensor>();
   36.60 +    private float[] voltageGains;
   36.61 +
   36.62 +   
   36.63 +    // Consts
   36.64 +    private const byte ITE_VENDOR_ID = 0x90;
   36.65 +       
   36.66 +    // Environment Controller
   36.67 +    private const byte ADDRESS_REGISTER_OFFSET = 0x05;
   36.68 +    private const byte DATA_REGISTER_OFFSET = 0x06;
   36.69 +
   36.70 +    // Environment Controller Registers    
   36.71 +    private const byte CONFIGURATION_REGISTER = 0x00;
   36.72 +    private const byte TEMPERATURE_BASE_REG = 0x29;
   36.73 +    private const byte VENDOR_ID_REGISTER = 0x58;
   36.74 +    private const byte FAN_TACHOMETER_16_BIT_ENABLE_REGISTER = 0x0c;
   36.75 +    private byte[] FAN_TACHOMETER_REG = 
   36.76 +      new byte[] { 0x0d, 0x0e, 0x0f, 0x80, 0x82 };
   36.77 +    private byte[] FAN_TACHOMETER_EXT_REG =
   36.78 +      new byte[] { 0x18, 0x19, 0x1a, 0x81, 0x83 };
   36.79 +    private const byte VOLTAGE_BASE_REG = 0x20;  
   36.80 +    
   36.81 +
   36.82 +    private byte ReadByte(byte register) {
   36.83 +      WinRing0.WriteIoPortByte(
   36.84 +        (ushort)(address + ADDRESS_REGISTER_OFFSET), register);
   36.85 +      return WinRing0.ReadIoPortByte((ushort)(address + DATA_REGISTER_OFFSET));
   36.86 +    }
   36.87 +
   36.88 +    public IT87(Chip chip, ushort address) {
   36.89 +      
   36.90 +      this.chip = chip;
   36.91 +      this.address = address;
   36.92 +
   36.93 +      switch (chip) {
   36.94 +        case Chip.IT8716F: name = "ITE IT8716F"; break;
   36.95 +        case Chip.IT8718F: name = "ITE IT8718F"; break;
   36.96 +        case Chip.IT8720F: name = "ITE IT8720F"; break;
   36.97 +        case Chip.IT8726F: name = "ITE IT8726F"; break;
   36.98 +        default: return;
   36.99 +      }
  36.100 +      
  36.101 +      // Check vendor id
  36.102 +      byte vendorId = ReadByte(VENDOR_ID_REGISTER);      
  36.103 +      if (vendorId != ITE_VENDOR_ID)
  36.104 +        return;
  36.105 +
  36.106 +      // Bit 0x10 of the configuration register should always be 1
  36.107 +      if ((ReadByte(CONFIGURATION_REGISTER) & 0x10) == 0)
  36.108 +        return;
  36.109 +
  36.110 +      temperatures = new Sensor[3];
  36.111 +      for (int i = 0; i < temperatures.Length; i++) 
  36.112 +        temperatures[i] = new Sensor("Temperature #" + (i + 1), i,
  36.113 +          SensorType.Temperature, this);
  36.114 +
  36.115 +      fans = new Sensor[4];
  36.116 +      for (int i = 0; i < fans.Length; i++)
  36.117 +        fans[i] = new Sensor("Fan #" + (i + 1), i, SensorType.Fan, this);
  36.118 +
  36.119 +      voltageGains = new float[] { 
  36.120 +        1, 1, 1, (6.8f / 10 + 1), 1, 1, 1, 1, 1 };
  36.121 +
  36.122 +      voltages = new Sensor[2];
  36.123 +      voltages[0] = new Sensor("CPU VCore", 0, SensorType.Voltage, this);
  36.124 +      voltages[1] = new Sensor("Battery", 8, SensorType.Voltage, this);           
  36.125 +
  36.126 +      available = true;
  36.127 +      icon = Utilities.EmbeddedResources.GetImage("chip.png");
  36.128 +    }
  36.129 +
  36.130 +    public bool IsAvailable {
  36.131 +      get { return available; } 
  36.132 +    }
  36.133 +
  36.134 +    public string Name {
  36.135 +      get { return name; }
  36.136 +    }
  36.137 +
  36.138 +    public string Identifier {
  36.139 +      get { return "/lpc/it87"; }
  36.140 +    }
  36.141 +
  36.142 +    public Image Icon {
  36.143 +      get { return icon; }
  36.144 +    }
  36.145 +
  36.146 +    public ISensor[] Sensors {
  36.147 +      get { return active.ToArray(); }
  36.148 +    }
  36.149 +
  36.150 +    public string GetReport() {
  36.151 +      StringBuilder r = new StringBuilder();
  36.152 +
  36.153 +      r.AppendLine("LPC IT87");
  36.154 +      r.AppendLine();
  36.155 +      r.Append("Chip ID: 0x"); r.AppendLine(chip.ToString("X"));
  36.156 +      r.Append("Chip Name: "); r.AppendLine(name);
  36.157 +      r.Append("Base Address: 0x"); r.AppendLine(address.ToString("X"));
  36.158 +      r.AppendLine();
  36.159 +      r.AppendLine("Environment Controller Registers");
  36.160 +      r.AppendLine();
  36.161 +
  36.162 +      r.AppendLine("      00 01 02 03 04 05 06 07 08 09 0A 0B 0C 0D 0E 0F");
  36.163 +      r.AppendLine();
  36.164 +      for (int i = 0; i <= 0xA; i++) {
  36.165 +        r.Append(" "); r.Append((i << 4).ToString("X2")); r.Append("  ");
  36.166 +        for (int j = 0; j <= 0xF; j++) {
  36.167 +          r.Append(" ");
  36.168 +          r.Append(ReadByte((byte)((i << 4) | j)).ToString("X2"));
  36.169 +        }
  36.170 +        r.AppendLine();
  36.171 +      }
  36.172 +      r.AppendLine();
  36.173 +
  36.174 +      return r.ToString();
  36.175 +    }
  36.176 +
  36.177 +    public void Update() {
  36.178 +
  36.179 +      foreach (Sensor sensor in voltages) {
  36.180 +        int value = ReadByte((byte)(VOLTAGE_BASE_REG + sensor.Index));
  36.181 +        sensor.Value = voltageGains[sensor.Index] * 0.001f * (value << 4);
  36.182 +        if (sensor.Value > 0)
  36.183 +          ActivateSensor(sensor);
  36.184 +        else
  36.185 +          DeactivateSensor(sensor);
  36.186 +      }
  36.187 +
  36.188 +      foreach (Sensor sensor in temperatures) {
  36.189 +        int value = ReadByte((byte)(TEMPERATURE_BASE_REG + sensor.Index));
  36.190 +        sensor.Value = value;
  36.191 +        if (value < 254)
  36.192 +          ActivateSensor(sensor);
  36.193 +        else
  36.194 +          DeactivateSensor(sensor);
  36.195 +      }
  36.196 +
  36.197 +      foreach (Sensor sensor in fans) {
  36.198 +        int value = ReadByte(FAN_TACHOMETER_REG[sensor.Index]);
  36.199 +        value |= ReadByte(FAN_TACHOMETER_EXT_REG[sensor.Index]) << 8;
  36.200 +
  36.201 +        if (value > 0) {
  36.202 +          sensor.Value = (value < 0xffff) ? 1.35e6f / ((value) * 2) : 0;
  36.203 +          ActivateSensor(sensor);
  36.204 +        } else {
  36.205 +          DeactivateSensor(sensor);
  36.206 +        }
  36.207 +      }      
  36.208 +    }
  36.209 +
  36.210 +    private void ActivateSensor(Sensor sensor) {
  36.211 +      if (!active.Contains(sensor)) {
  36.212 +        active.Add(sensor);
  36.213 +        SensorAdded(sensor);
  36.214 +      }
  36.215 +    }
  36.216 +
  36.217 +    private void DeactivateSensor(Sensor sensor) {
  36.218 +      if (active.Contains(sensor)) {
  36.219 +        active.Remove(sensor);
  36.220 +        SensorRemoved(sensor);
  36.221 +      }
  36.222 +    }
  36.223 +
  36.224 +    public event SensorEventHandler SensorAdded;
  36.225 +    public event SensorEventHandler SensorRemoved;
  36.226 +
  36.227 +  }
  36.228 +}
    37.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
    37.2 +++ b/Hardware/LPC/LPCGroup.cs	Tue Jan 26 22:37:48 2010 +0000
    37.3 @@ -0,0 +1,176 @@
    37.4 +/*
    37.5 +  
    37.6 +  Version: MPL 1.1/GPL 2.0/LGPL 2.1
    37.7 +
    37.8 +  The contents of this file are subject to the Mozilla Public License Version
    37.9 +  1.1 (the "License"); you may not use this file except in compliance with
   37.10 +  the License. You may obtain a copy of the License at
   37.11 + 
   37.12 +  http://www.mozilla.org/MPL/
   37.13 +
   37.14 +  Software distributed under the License is distributed on an "AS IS" basis,
   37.15 +  WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
   37.16 +  for the specific language governing rights and limitations under the License.
   37.17 +
   37.18 +  The Original Code is the Open Hardware Monitor code.
   37.19 +
   37.20 +  The Initial Developer of the Original Code is 
   37.21 +  Michael Möller <m.moeller@gmx.ch>.
   37.22 +  Portions created by the Initial Developer are Copyright (C) 2009-2010
   37.23 +  the Initial Developer. All Rights Reserved.
   37.24 +
   37.25 +  Contributor(s):
   37.26 +
   37.27 +  Alternatively, the contents of this file may be used under the terms of
   37.28 +  either the GNU General Public License Version 2 or later (the "GPL"), or
   37.29 +  the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
   37.30 +  in which case the provisions of the GPL or the LGPL are applicable instead
   37.31 +  of those above. If you wish to allow use of your version of this file only
   37.32 +  under the terms of either the GPL or the LGPL, and not to allow others to
   37.33 +  use your version of this file under the terms of the MPL, indicate your
   37.34 +  decision by deleting the provisions above and replace them with the notice
   37.35 +  and other provisions required by the GPL or the LGPL. If you do not delete
   37.36 +  the provisions above, a recipient may use your version of this file under
   37.37 +  the terms of any one of the MPL, the GPL or the LGPL.
   37.38 + 
   37.39 +*/
   37.40 +
   37.41 +using System;
   37.42 +using System.Collections.Generic;
   37.43 +using System.Text;
   37.44 +using System.Threading;
   37.45 +
   37.46 +namespace OpenHardwareMonitor.Hardware.LPC {
   37.47 +  public class LPCGroup : IGroup {
   37.48 +    private List<IHardware> hardware = new List<IHardware>();
   37.49 +
   37.50 +    private Chip chip = Chip.Unknown;
   37.51 +
   37.52 +    // I/O Ports
   37.53 +    private const ushort REGISTER_PORT = 0x2e;
   37.54 +    private const ushort VALUE_PORT = 0x2f;
   37.55 +
   37.56 +    // Registers
   37.57 +    private const byte CONFIGURATION_CONTROL_REGISTER = 0x02;
   37.58 +    private const byte DEVCIE_SELECT_REGISTER = 0x07;
   37.59 +    private const byte CHIP_ID_REGISTER = 0x20;
   37.60 +    private const byte CHIP_REVISION_REGISTER = 0x21;
   37.61 +
   37.62 +    private static byte ReadByte(byte register) {
   37.63 +      WinRing0.WriteIoPortByte(REGISTER_PORT, register);
   37.64 +      return WinRing0.ReadIoPortByte(VALUE_PORT);
   37.65 +    }
   37.66 +
   37.67 +    private static ushort ReadWord(byte register) {
   37.68 +      ushort value;
   37.69 +      WinRing0.WriteIoPortByte(REGISTER_PORT, register);
   37.70 +      value = (ushort)(((ushort)WinRing0.ReadIoPortByte(VALUE_PORT)) << 8);
   37.71 +      WinRing0.WriteIoPortByte(REGISTER_PORT, (byte)(register + 1));
   37.72 +      value |= (ushort)WinRing0.ReadIoPortByte(VALUE_PORT);
   37.73 +      return value;
   37.74 +    }
   37.75 +
   37.76 +    private static void Select(byte logicalDeviceNumber) {
   37.77 +      WinRing0.WriteIoPortByte(REGISTER_PORT, DEVCIE_SELECT_REGISTER);
   37.78 +      WinRing0.WriteIoPortByte(VALUE_PORT, logicalDeviceNumber);
   37.79 +    }
   37.80 +
   37.81 +    // IT87
   37.82 +    private const ushort IT8716F_CHIP_ID = 0x8716;
   37.83 +    private const ushort IT8718F_CHIP_ID = 0x8718;
   37.84 +    private const ushort IT8720F_CHIP_ID = 0x8720;
   37.85 +    private const ushort IT8726F_CHIP_ID = 0x8726;
   37.86 +
   37.87 +    private const byte IT87_ENVIRONMENT_CONTROLLER_LDN = 0x04;
   37.88 +    private const byte IT87_ENVIRONMENT_CONTROLLER_BASE_ADDR_REG = 0x60;
   37.89 +
   37.90 +    private static void IT87Enter() {
   37.91 +      WinRing0.WriteIoPortByte(REGISTER_PORT, 0x87);
   37.92 +      WinRing0.WriteIoPortByte(REGISTER_PORT, 0x01);
   37.93 +      WinRing0.WriteIoPortByte(REGISTER_PORT, 0x55);
   37.94 +      WinRing0.WriteIoPortByte(REGISTER_PORT, 0x55);
   37.95 +    }
   37.96 +
   37.97 +    internal static void IT87Exit() {
   37.98 +      WinRing0.WriteIoPortByte(REGISTER_PORT, CONFIGURATION_CONTROL_REGISTER);
   37.99 +      WinRing0.WriteIoPortByte(VALUE_PORT, 0x02);
  37.100 +    }
  37.101 +
  37.102 +    // Winbond
  37.103 +    private static void WinbondEnter() {
  37.104 +      WinRing0.WriteIoPortByte(REGISTER_PORT, 0x87);
  37.105 +      WinRing0.WriteIoPortByte(REGISTER_PORT, 0x87);
  37.106 +    }
  37.107 +
  37.108 +    private static void WinbondExit() {
  37.109 +      WinRing0.WriteIoPortByte(REGISTER_PORT, 0xAA);      
  37.110 +    }
  37.111 +
  37.112 +    public LPCGroup() {
  37.113 +      if (!WinRing0.IsAvailable)
  37.114 +        return;
  37.115 +
  37.116 +      WinbondEnter();
  37.117 +
  37.118 +      byte id = ReadByte(CHIP_ID_REGISTER);
  37.119 +      byte revision = ReadByte(CHIP_REVISION_REGISTER);
  37.120 +      switch (id) {
  37.121 +        case 0xA0:
  37.122 +          switch (revision & 0xF0) {
  37.123 +            case 0x20: chip = Chip.W83627DHG; break;
  37.124 +            default: chip = Chip.Unknown; break;
  37.125 +          } break;
  37.126 +        default: chip = Chip.Unknown; break;
  37.127 +      }
  37.128 +      if (chip != Chip.Unknown) {
  37.129 +
  37.130 +        WinbondExit();
  37.131 +
  37.132 +        W83627DHG w83627dhg = new W83627DHG(revision);
  37.133 +        if (w83627dhg.IsAvailable)
  37.134 +          hardware.Add(w83627dhg);
  37.135 +        return;
  37.136 +      }
  37.137 +
  37.138 +      IT87Enter();
  37.139 +
  37.140 +      switch (ReadWord(CHIP_ID_REGISTER)) {
  37.141 +        case 0x8716: chip = Chip.IT8716F; break;
  37.142 +        case 0x8718: chip = Chip.IT8718F; break;
  37.143 +        case 0x8720: chip = Chip.IT8720F; break;
  37.144 +        case 0x8726: chip = Chip.IT8726F; break;
  37.145 +        default: chip = Chip.Unknown; break;
  37.146 +      }
  37.147 +
  37.148 +      if (chip != Chip.Unknown) {        
  37.149 +        Select(IT87_ENVIRONMENT_CONTROLLER_LDN);
  37.150 +        ushort address = ReadWord(IT87_ENVIRONMENT_CONTROLLER_BASE_ADDR_REG);
  37.151 +        Thread.Sleep(1);
  37.152 +        ushort verify = ReadWord(IT87_ENVIRONMENT_CONTROLLER_BASE_ADDR_REG);
  37.153 +
  37.154 +        IT87Exit();
  37.155 +
  37.156 +        if (address != verify || address == 0 || (address & 0xF007) != 0)
  37.157 +          return;
  37.158 +
  37.159 +        IT87 it87 = new IT87(chip, address);
  37.160 +        if (it87.IsAvailable)
  37.161 +          hardware.Add(it87);
  37.162 +        
  37.163 +        return;
  37.164 +      }                
  37.165 +    }
  37.166 +
  37.167 +    public IHardware[] Hardware {
  37.168 +      get {
  37.169 +        return hardware.ToArray();
  37.170 +      }
  37.171 +    }
  37.172 +
  37.173 +    public string GetReport() {
  37.174 +      return null;
  37.175 +    }
  37.176 +
  37.177 +    public void Close() { }
  37.178 +  }
  37.179 +}
    38.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
    38.2 +++ b/Hardware/LPC/W83627DHG.cs	Tue Jan 26 22:37:48 2010 +0000
    38.3 @@ -0,0 +1,60 @@
    38.4 +using System;
    38.5 +using System.Collections.Generic;
    38.6 +using System.Drawing;
    38.7 +using System.Text;
    38.8 +
    38.9 +namespace OpenHardwareMonitor.Hardware.LPC {
   38.10 +  public class W83627DHG : IHardware {
   38.11 +
   38.12 +    private byte revision;
   38.13 +
   38.14 +    private string name;
   38.15 +    private Image icon;
   38.16 +
   38.17 +    private bool available = false;
   38.18 +
   38.19 +    public W83627DHG(byte revision) {      
   38.20 +      this.revision = revision;
   38.21 +
   38.22 +      this.name = "Winbond W83627DHG";
   38.23 +      this.icon = Utilities.EmbeddedResources.GetImage("chip.png");
   38.24 +    }
   38.25 +
   38.26 +    public bool IsAvailable {
   38.27 +      get { return available; }
   38.28 +    }
   38.29 +
   38.30 +    public string Name {
   38.31 +      get { return name; }
   38.32 +    }
   38.33 +
   38.34 +    public string Identifier {
   38.35 +      get { return "/lpc/w83627dhg"; }
   38.36 +    }
   38.37 +
   38.38 +    public Image Icon {
   38.39 +      get { return icon; }
   38.40 +    }
   38.41 +
   38.42 +    public ISensor[] Sensors {
   38.43 +      get { return new ISensor[0]; }
   38.44 +    }
   38.45 +
   38.46 +    public string GetReport() {
   38.47 +      StringBuilder r = new StringBuilder();
   38.48 +
   38.49 +      r.AppendLine("LPC W83627DHG");
   38.50 +      r.AppendLine();
   38.51 +      r.Append("Chip revision: 0x"); r.AppendLine(revision.ToString("X"));     
   38.52 +
   38.53 +      return r.ToString();
   38.54 +    }
   38.55 +
   38.56 +    public void Update() { }
   38.57 +
   38.58 +    #pragma warning disable 67
   38.59 +    public event SensorEventHandler SensorAdded;
   38.60 +    public event SensorEventHandler SensorRemoved;
   38.61 +    #pragma warning restore 67
   38.62 +  }
   38.63 +}
    39.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
    39.2 +++ b/Hardware/Nvidia/NVAPI.cs	Tue Jan 26 22:37:48 2010 +0000
    39.3 @@ -0,0 +1,243 @@
    39.4 +/*
    39.5 +  
    39.6 +  Version: MPL 1.1/GPL 2.0/LGPL 2.1
    39.7 +
    39.8 +  The contents of this file are subject to the Mozilla Public License Version
    39.9 +  1.1 (the "License"); you may not use this file except in compliance with
   39.10 +  the License. You may obtain a copy of the License at
   39.11 + 
   39.12 +  http://www.mozilla.org/MPL/
   39.13 +
   39.14 +  Software distributed under the License is distributed on an "AS IS" basis,
   39.15 +  WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
   39.16 +  for the specific language governing rights and limitations under the License.
   39.17 +
   39.18 +  The Original Code is the Open Hardware Monitor code.
   39.19 +
   39.20 +  The Initial Developer of the Original Code is 
   39.21 +  Michael Möller <m.moeller@gmx.ch>.
   39.22 +  Portions created by the Initial Developer are Copyright (C) 2009-2010
   39.23 +  the Initial Developer. All Rights Reserved.
   39.24 +
   39.25 +  Contributor(s):
   39.26 +
   39.27 +  Alternatively, the contents of this file may be used under the terms of
   39.28 +  either the GNU General Public License Version 2 or later (the "GPL"), or
   39.29 +  the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
   39.30 +  in which case the provisions of the GPL or the LGPL are applicable instead
   39.31 +  of those above. If you wish to allow use of your version of this file only
   39.32 +  under the terms of either the GPL or the LGPL, and not to allow others to
   39.33 +  use your version of this file under the terms of the MPL, indicate your
   39.34 +  decision by deleting the provisions above and replace them with the notice
   39.35 +  and other provisions required by the GPL or the LGPL. If you do not delete
   39.36 +  the provisions above, a recipient may use your version of this file under
   39.37 +  the terms of any one of the MPL, the GPL or the LGPL.
   39.38 + 
   39.39 +*/
   39.40 +
   39.41 +using System;
   39.42 +using System.Collections.Generic;
   39.43 +using System.Runtime.InteropServices;
   39.44 +using System.Text;
   39.45 +
   39.46 +namespace OpenHardwareMonitor.Hardware.Nvidia {
   39.47 +
   39.48 +  public enum NvStatus {
   39.49 +    OK = 0,
   39.50 +    ERROR = -1,
   39.51 +    LIBRARY_NOT_FOUND = -2,
   39.52 +    NO_IMPLEMENTATION = -3,
   39.53 +    API_NOT_INTIALIZED = -4,
   39.54 +    INVALID_ARGUMENT = -5,
   39.55 +    NVIDIA_DEVICE_NOT_FOUND = -6,
   39.56 +    END_ENUMERATION = -7,
   39.57 +    INVALID_HANDLE = -8,
   39.58 +    INCOMPATIBLE_STRUCT_VERSION = -9,
   39.59 +    HANDLE_INVALIDATED = -10,
   39.60 +    OPENGL_CONTEXT_NOT_CURRENT = -11,
   39.61 +    NO_GL_EXPERT = -12,
   39.62 +    INSTRUMENTATION_DISABLED = -13,
   39.63 +    EXPECTED_LOGICAL_GPU_HANDLE = -100,
   39.64 +    EXPECTED_PHYSICAL_GPU_HANDLE = -101,
   39.65 +    EXPECTED_DISPLAY_HANDLE = -102,
   39.66 +    INVALID_COMBINATION = -103,
   39.67 +    NOT_SUPPORTED = -104,
   39.68 +    PORTID_NOT_FOUND = -105,
   39.69 +    EXPECTED_UNATTACHED_DISPLAY_HANDLE = -106,
   39.70 +    INVALID_PERF_LEVEL = -107,
   39.71 +    DEVICE_BUSY = -108,
   39.72 +    NV_PERSIST_FILE_NOT_FOUND = -109,
   39.73 +    PERSIST_DATA_NOT_FOUND = -110,
   39.74 +    EXPECTED_TV_DISPLAY = -111,
   39.75 +    EXPECTED_TV_DISPLAY_ON_DCONNECTOR = -112,
   39.76 +    NO_ACTIVE_SLI_TOPOLOGY = -113,
   39.77 +    SLI_RENDERING_MODE_NOTALLOWED = -114,
   39.78 +    EXPECTED_DIGITAL_FLAT_PANEL = -115,
   39.79 +    ARGUMENT_EXCEED_MAX_SIZE = -116,
   39.80 +    DEVICE_SWITCHING_NOT_ALLOWED = -117,
   39.81 +    TESTING_CLOCKS_NOT_SUPPORTED = -118,
   39.82 +    UNKNOWN_UNDERSCAN_CONFIG = -119,
   39.83 +    TIMEOUT_RECONFIGURING_GPU_TOPO = -120,
   39.84 +    DATA_NOT_FOUND = -121,
   39.85 +    EXPECTED_ANALOG_DISPLAY = -122,
   39.86 +    NO_VIDLINK = -123,
   39.87 +    REQUIRES_REBOOT = -124,
   39.88 +    INVALID_HYBRID_MODE = -125,
   39.89 +    MIXED_TARGET_TYPES = -126,
   39.90 +    SYSWOW64_NOT_SUPPORTED = -127,
   39.91 +    IMPLICIT_SET_GPU_TOPOLOGY_CHANGE_NOT_ALLOWED = -128,
   39.92 +    REQUEST_USER_TO_CLOSE_NON_MIGRATABLE_APPS = -129,
   39.93 +    OUT_OF_MEMORY = -130,
   39.94 +    WAS_STILL_DRAWING = -131,
   39.95 +    FILE_NOT_FOUND = -132,
   39.96 +    TOO_MANY_UNIQUE_STATE_OBJECTS = -133,
   39.97 +    INVALID_CALL = -134,
   39.98 +    D3D10_1_LIBRARY_NOT_FOUND = -135,
   39.99 +    FUNCTION_NOT_FOUND = -136
  39.100 +  }  
  39.101 +
  39.102 +  public enum NvThermalController {
  39.103 +    NONE = 0,
  39.104 +    GPU_INTERNAL,  
  39.105 +    ADM1032,
  39.106 +    MAX6649,       
  39.107 +    MAX1617,      
  39.108 +    LM99,      
  39.109 +    LM89,         
  39.110 +    LM64,         
  39.111 +    ADT7473,
  39.112 +    SBMAX6649,
  39.113 +    VBIOSEVT,  
  39.114 +    OS,    
  39.115 +    UNKNOWN = -1,
  39.116 +  } 
  39.117 +
  39.118 +  public enum NvThermalTarget {
  39.119 +    NONE = 0,
  39.120 +    GPU = 1,
  39.121 +    MEMORY = 2,
  39.122 +    POWER_SUPPLY = 4,
  39.123 +    BOARD = 8,
  39.124 +    ALL = 15,
  39.125 +    UNKNOWN = -1
  39.126 +  };
  39.127 +
  39.128 +  [StructLayout(LayoutKind.Sequential)]
  39.129 +  public struct NvSensor {
  39.130 +    public NvThermalController Controller;
  39.131 +    public int DefaultMinTemp;
  39.132 +    public int DefaultMaxTemp;
  39.133 +    public int CurrentTemp;
  39.134 +    public NvThermalTarget Target;     
  39.135 +  }
  39.136 +
  39.137 +  [StructLayout(LayoutKind.Sequential)]
  39.138 +  public struct NvGPUThermalSettings {
  39.139 +    public int Version;
  39.140 +    public int Count;
  39.141 +    [MarshalAs(UnmanagedType.ByValArray, 
  39.142 +      SizeConst = NVAPI.MAX_THERMAL_SENSORS_PER_GPU)]
  39.143 +    public NvSensor[] Sensor;
  39.144 +  }
  39.145 +
  39.146 +  [StructLayout(LayoutKind.Sequential)]
  39.147 +  public struct NvDisplayHandle {
  39.148 +    private int handle;
  39.149 +  }
  39.150 +
  39.151 +  [StructLayout(LayoutKind.Sequential)]
  39.152 +  public struct NvPhysicalGpuHandle {
  39.153 +    private int handle;
  39.154 +  }
  39.155 +
  39.156 +  public class NVAPI {
  39.157 +          
  39.158 +    private const int SHORT_STRING_MAX = 64;
  39.159 +
  39.160 +    public const int MAX_THERMAL_SENSORS_PER_GPU = 3;
  39.161 +    public const int MAX_PHYSICAL_GPUS = 64;
  39.162 +    public static readonly int GPU_THERMAL_SETTINGS_VER =
  39.163 +      Marshal.SizeOf(typeof(NvGPUThermalSettings)) | 0x10000;
  39.164 +            
  39.165 +    private delegate IntPtr nvapi_QueryInterfaceDelegate(uint id);
  39.166 +    private delegate NvStatus NvAPI_InitializeDelegate();
  39.167 +    private delegate NvStatus NvAPI_GPU_GetFullNameDelegate(
  39.168 +      NvPhysicalGpuHandle gpuHandle, StringBuilder name);
  39.169 +
  39.170 +    public delegate NvStatus NvAPI_GPU_GetThermalSettingsDelegate(
  39.171 +      NvPhysicalGpuHandle gpuHandle, int sensorIndex, 
  39.172 +      ref NvGPUThermalSettings nvGPUThermalSettings);
  39.173 +    public delegate NvStatus NvAPI_EnumNvidiaDisplayHandleDelegate(int thisEnum,
  39.174 +      ref NvDisplayHandle displayHandle);
  39.175 +    public delegate NvStatus NvAPI_GetPhysicalGPUsFromDisplayDelegate(
  39.176 +      NvDisplayHandle displayHandle, [Out] NvPhysicalGpuHandle[] gpuHandles, 
  39.177 +      out int gpuCount);
  39.178 +    public delegate NvStatus NvAPI_EnumPhysicalGPUsDelegate(
  39.179 +      [Out] NvPhysicalGpuHandle[] gpuHandles, out int gpuCount);
  39.180 +
  39.181 +    private static bool available = false;
  39.182 +    private static nvapi_QueryInterfaceDelegate nvapi_QueryInterface;
  39.183 +    private static NvAPI_InitializeDelegate NvAPI_Initialize;
  39.184 +    private static NvAPI_GPU_GetFullNameDelegate _NvAPI_GPU_GetFullName;
  39.185 +
  39.186 +    public static NvAPI_GPU_GetThermalSettingsDelegate 
  39.187 +      NvAPI_GPU_GetThermalSettings;
  39.188 +    public static NvAPI_EnumNvidiaDisplayHandleDelegate
  39.189 +      NvAPI_EnumNvidiaDisplayHandle;
  39.190 +    public static NvAPI_GetPhysicalGPUsFromDisplayDelegate
  39.191 +      NvAPI_GetPhysicalGPUsFromDisplay;
  39.192 +    public static NvAPI_EnumPhysicalGPUsDelegate
  39.193 +      NvAPI_EnumPhysicalGPUs;
  39.194 +
  39.195 +    public static NvStatus NvAPI_GPU_GetFullName(NvPhysicalGpuHandle gpuHandle,
  39.196 +      out string name) {
  39.197 +      StringBuilder builder = new StringBuilder(SHORT_STRING_MAX);
  39.198 +      NvStatus status = _NvAPI_GPU_GetFullName(gpuHandle, builder);
  39.199 +      name = builder.ToString();
  39.200 +      return status;
  39.201 +    }
  39.202 +
  39.203 +    private static string GetDllName() {
  39.204 +      if (IntPtr.Size == 4) {
  39.205 +        return "nvapi.dll";
  39.206 +      } else {
  39.207 +        return "nvapi64.dll";
  39.208 +      }
  39.209 +    }
  39.210 +
  39.211 +    private static void GetDelegate<T>(uint id, out T newDelegate) 
  39.212 +      where T : class 
  39.213 +    {
  39.214 +      IntPtr ptr = nvapi_QueryInterface(id);
  39.215 +      newDelegate = Marshal.GetDelegateForFunctionPointer(ptr, typeof(T)) as T;      
  39.216 +    }
  39.217 +
  39.218 +    static NVAPI() { 
  39.219 +      DllImportAttribute attribute = new DllImportAttribute(GetDllName());
  39.220 +      attribute.CallingConvention = CallingConvention.Cdecl;
  39.221 +      attribute.PreserveSig = true;
  39.222 +      attribute.EntryPoint = "nvapi_QueryInterface";
  39.223 +      PInvokeDelegateFactory.CreateDelegate(attribute,
  39.224 +        out nvapi_QueryInterface);
  39.225 +
  39.226 +      try {
  39.227 +        GetDelegate(0x0150E828, out NvAPI_Initialize);
  39.228 +      } catch (DllNotFoundException) { return; } 
  39.229 +        catch (ArgumentNullException) { return; }
  39.230 +
  39.231 +      if (NvAPI_Initialize() == NvStatus.OK) {
  39.232 +        GetDelegate(0xE3640A56, out NvAPI_GPU_GetThermalSettings);
  39.233 +        GetDelegate(0xCEEE8E9F, out _NvAPI_GPU_GetFullName);
  39.234 +        GetDelegate(0x9ABDD40D, out NvAPI_EnumNvidiaDisplayHandle);
  39.235 +        GetDelegate(0x34EF9506, out NvAPI_GetPhysicalGPUsFromDisplay);
  39.236 +        GetDelegate(0xE5AC921F, out NvAPI_EnumPhysicalGPUs);
  39.237 +        available = true;
  39.238 +      }
  39.239 +    }
  39.240 +
  39.241 +    public static bool IsAvailable {
  39.242 +      get { return available; }
  39.243 +    }
  39.244 +
  39.245 +  }
  39.246 +}
    40.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
    40.2 +++ b/Hardware/Nvidia/NvidiaGPU.cs	Tue Jan 26 22:37:48 2010 +0000
    40.3 @@ -0,0 +1,126 @@
    40.4 +/*
    40.5 +  
    40.6 +  Version: MPL 1.1/GPL 2.0/LGPL 2.1
    40.7 +
    40.8 +  The contents of this file are subject to the Mozilla Public License Version
    40.9 +  1.1 (the "License"); you may not use this file except in compliance with
   40.10 +  the License. You may obtain a copy of the License at
   40.11 + 
   40.12 +  http://www.mozilla.org/MPL/
   40.13 +
   40.14 +  Software distributed under the License is distributed on an "AS IS" basis,
   40.15 +  WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
   40.16 +  for the specific language governing rights and limitations under the License.
   40.17 +
   40.18 +  The Original Code is the Open Hardware Monitor code.
   40.19 +
   40.20 +  The Initial Developer of the Original Code is 
   40.21 +  Michael Möller <m.moeller@gmx.ch>.
   40.22 +  Portions created by the Initial Developer are Copyright (C) 2009-2010
   40.23 +  the Initial Developer. All Rights Reserved.
   40.24 +
   40.25 +  Contributor(s):
   40.26 +
   40.27 +  Alternatively, the contents of this file may be used under the terms of
   40.28 +  either the GNU General Public License Version 2 or later (the "GPL"), or
   40.29 +  the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
   40.30 +  in which case the provisions of the GPL or the LGPL are applicable instead
   40.31 +  of those above. If you wish to allow use of your version of this file only
   40.32 +  under the terms of either the GPL or the LGPL, and not to allow others to
   40.33 +  use your version of this file under the terms of the MPL, indicate your
   40.34 +  decision by deleting the provisions above and replace them with the notice
   40.35 +  and other provisions required by the GPL or the LGPL. If you do not delete
   40.36 +  the provisions above, a recipient may use your version of this file under
   40.37 +  the terms of any one of the MPL, the GPL or the LGPL.
   40.38 + 
   40.39 +*/
   40.40 +
   40.41 +using System;
   40.42 +using System.Collections.Generic;
   40.43 +using System.Drawing;
   40.44 +
   40.45 +namespace OpenHardwareMonitor.Hardware.Nvidia {
   40.46 +  public class NvidiaGPU : IHardware {
   40.47 +
   40.48 +    private string name;
   40.49 +    private Image icon;
   40.50 +    private int adapterIndex;
   40.51 +    private NvPhysicalGpuHandle handle;
   40.52 +
   40.53 +    private Sensor[] temperatures;
   40.54 +
   40.55 +    public NvidiaGPU(int adapterIndex, NvPhysicalGpuHandle handle) {
   40.56 +      try {
   40.57 +        string gpuName;
   40.58 +        NVAPI.NvAPI_GPU_GetFullName(handle, out gpuName);
   40.59 +        this.name = "NVIDIA " + gpuName;
   40.60 +        this.icon = Utilities.EmbeddedResources.GetImage("nvidia.png");
   40.61 +        this.adapterIndex = adapterIndex;
   40.62 +        this.handle = handle;
   40.63 +
   40.64 +        NvGPUThermalSettings settings = GetThermalSettings();
   40.65 +        temperatures = new Sensor[settings.Count];
   40.66 +        for (int i = 0; i < temperatures.Length; i++) {
   40.67 +          NvSensor sensor = settings.Sensor[i];
   40.68 +          string name;
   40.69 +          switch (sensor.Target) {
   40.70 +            case NvThermalTarget.BOARD: name = "GPU Board"; break;
   40.71 +            case NvThermalTarget.GPU: name = "GPU Core"; break;
   40.72 +            case NvThermalTarget.MEMORY: name = "GPU Memory"; break;
   40.73 +            case NvThermalTarget.POWER_SUPPLY: name = "GPU Power Supply"; break;
   40.74 +            case NvThermalTarget.UNKNOWN: name = "GPU Unknown"; break;
   40.75 +            default: name = "GPU"; break;
   40.76 +          }
   40.77 +          temperatures[i] = new Sensor(name, i, sensor.DefaultMaxTemp, 
   40.78 +            SensorType.Temperature, this);
   40.79 +        }
   40.80 +      } catch (Exception e) {
   40.81 +        System.Windows.Forms.MessageBox.Show(e.Message + "\n" + e.StackTrace);
   40.82 +      }
   40.83 +    }
   40.84 +
   40.85 +    public string Name {
   40.86 +      get { return name; }
   40.87 +    }
   40.88 +
   40.89 +    public string Identifier {
   40.90 +      get { return "/nvidiagpu/" + adapterIndex; }
   40.91 +    }
   40.92 +
   40.93 +    public Image Icon {
   40.94 +      get { return icon; }
   40.95 +    }
   40.96 +
   40.97 +    public ISensor[] Sensors {
   40.98 +      get {
   40.99 +        return temperatures;
  40.100 +      }
  40.101 +    }
  40.102 +
  40.103 +    public string GetReport() {
  40.104 +      return null;
  40.105 +    }
  40.106 +
  40.107 +    private NvGPUThermalSettings GetThermalSettings() {
  40.108 +      NvGPUThermalSettings settings = new NvGPUThermalSettings();
  40.109 +      settings.Version = NVAPI.GPU_THERMAL_SETTINGS_VER;
  40.110 +      settings.Count = NVAPI.MAX_THERMAL_SENSORS_PER_GPU;
  40.111 +      settings.Sensor = new NvSensor[NVAPI.MAX_THERMAL_SENSORS_PER_GPU];
  40.112 +      NVAPI.NvAPI_GPU_GetThermalSettings(handle, (int)NvThermalTarget.ALL,
  40.113 +        ref settings);
  40.114 +      return settings;
  40.115 +    }
  40.116 +
  40.117 +    public void Update() {
  40.118 +      NvGPUThermalSettings settings = GetThermalSettings();
  40.119 +      foreach (Sensor sensor in temperatures) 
  40.120 +        sensor.Value = settings.Sensor[sensor.Index].CurrentTemp;              
  40.121 +    }
  40.122 +
  40.123 +    #pragma warning disable 67
  40.124 +    public event SensorEventHandler SensorAdded;
  40.125 +    public event SensorEventHandler SensorRemoved;
  40.126 +    #pragma warning restore 67
  40.127 +
  40.128 +  }
  40.129 +}
    41.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
    41.2 +++ b/Hardware/Nvidia/NvidiaGroup.cs	Tue Jan 26 22:37:48 2010 +0000
    41.3 @@ -0,0 +1,74 @@
    41.4 +/*
    41.5 +  
    41.6 +  Version: MPL 1.1/GPL 2.0/LGPL 2.1
    41.7 +
    41.8 +  The contents of this file are subject to the Mozilla Public License Version
    41.9 +  1.1 (the "License"); you may not use this file except in compliance with
   41.10 +  the License. You may obtain a copy of the License at
   41.11 + 
   41.12 +  http://www.mozilla.org/MPL/
   41.13 +
   41.14 +  Software distributed under the License is distributed on an "AS IS" basis,
   41.15 +  WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
   41.16 +  for the specific language governing rights and limitations under the License.
   41.17 +
   41.18 +  The Original Code is the Open Hardware Monitor code.
   41.19 +
   41.20 +  The Initial Developer of the Original Code is 
   41.21 +  Michael Möller <m.moeller@gmx.ch>.
   41.22 +  Portions created by the Initial Developer are Copyright (C) 2009-2010
   41.23 +  the Initial Developer. All Rights Reserved.
   41.24 +
   41.25 +  Contributor(s):
   41.26 +
   41.27 +  Alternatively, the contents of this file may be used under the terms of
   41.28 +  either the GNU General Public License Version 2 or later (the "GPL"), or
   41.29 +  the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
   41.30 +  in which case the provisions of the GPL or the LGPL are applicable instead
   41.31 +  of those above. If you wish to allow use of your version of this file only
   41.32 +  under the terms of either the GPL or the LGPL, and not to allow others to
   41.33 +  use your version of this file under the terms of the MPL, indicate your
   41.34 +  decision by deleting the provisions above and replace them with the notice
   41.35 +  and other provisions required by the GPL or the LGPL. If you do not delete
   41.36 +  the provisions above, a recipient may use your version of this file under
   41.37 +  the terms of any one of the MPL, the GPL or the LGPL.
   41.38 + 
   41.39 +*/
   41.40 +
   41.41 +using System;
   41.42 +using System.Collections.Generic;
   41.43 +
   41.44 +namespace OpenHardwareMonitor.Hardware.Nvidia {
   41.45 +
   41.46 +  public class NvidiaGroup : IGroup {
   41.47 +    private List<IHardware> hardware = new List<IHardware>();
   41.48 +
   41.49 +    public NvidiaGroup() {
   41.50 +      if (!NVAPI.IsAvailable)
   41.51 +        return;
   41.52 +
   41.53 +      NvPhysicalGpuHandle[] handles = 
   41.54 +        new NvPhysicalGpuHandle[NVAPI.MAX_PHYSICAL_GPUS];
   41.55 +  
   41.56 +      int count;
   41.57 +      if (NVAPI.NvAPI_EnumPhysicalGPUs(handles, out count) != NvStatus.OK)
   41.58 +        return;
   41.59 +
   41.60 +      for (int i = 0; i < count; i++)         
   41.61 +        hardware.Add(new NvidiaGPU(i, handles[i]));   
   41.62 +    }
   41.63 +
   41.64 +    public IHardware[] Hardware {
   41.65 +      get {
   41.66 +        return hardware.ToArray();
   41.67 +      }
   41.68 +    }
   41.69 +
   41.70 +    public string GetReport() {
   41.71 +      return null;
   41.72 +    }
   41.73 +
   41.74 +    public void Close() {
   41.75 +    }
   41.76 +  }
   41.77 +}
    42.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
    42.2 +++ b/Hardware/ReportWriter.cs	Tue Jan 26 22:37:48 2010 +0000
    42.3 @@ -0,0 +1,47 @@
    42.4 +using System;
    42.5 +using System.Collections.Generic;
    42.6 +using System.IO;
    42.7 +using System.Text;
    42.8 +
    42.9 +namespace OpenHardwareMonitor.Hardware {
   42.10 +  public class ReportWriter {
   42.11 +
   42.12 +    private static void NewSection(TextWriter writer) {      
   42.13 +      for (int i = 0; i < 8; i++)
   42.14 +        writer.Write("----------");
   42.15 +      writer.WriteLine();
   42.16 +      writer.WriteLine();
   42.17 +    }
   42.18 +
   42.19 +    public static void Save(List<IGroup> groupList, Version version) {
   42.20 +
   42.21 +      using (TextWriter w =
   42.22 +        new StreamWriter("OpenHardwareMonitor.Report.txt")) {
   42.23 +
   42.24 +        w.WriteLine();
   42.25 +        w.WriteLine("Open Hardware Monitor Report");
   42.26 +        w.WriteLine();
   42.27 +        NewSection(w);
   42.28 +        w.Write("Version: "); w.WriteLine(version.ToString());
   42.29 +        w.WriteLine();
   42.30 +
   42.31 +        foreach (IGroup group in groupList) {
   42.32 +          string report = group.GetReport();
   42.33 +          if (report != null) {
   42.34 +            NewSection(w);
   42.35 +            w.Write(report);            
   42.36 +          }
   42.37 +
   42.38 +          IHardware[] hardwareArray = group.Hardware;
   42.39 +          foreach (IHardware hardware in hardwareArray) {
   42.40 +            string hardwareReport = hardware.GetReport();
   42.41 +            if (hardwareReport != null) {
   42.42 +              NewSection(w);
   42.43 +              w.Write(hardwareReport);
   42.44 +            }
   42.45 +          }
   42.46 +        }
   42.47 +      }
   42.48 +    }
   42.49 +  }
   42.50 +}
    43.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
    43.2 +++ b/Hardware/SMBIOS/SMBIOSGroup.cs	Tue Jan 26 22:37:48 2010 +0000
    43.3 @@ -0,0 +1,198 @@
    43.4 +/*
    43.5 +  
    43.6 +  Version: MPL 1.1/GPL 2.0/LGPL 2.1
    43.7 +
    43.8 +  The contents of this file are subject to the Mozilla Public License Version
    43.9 +  1.1 (the "License"); you may not use this file except in compliance with
   43.10 +  the License. You may obtain a copy of the License at
   43.11 + 
   43.12 +  http://www.mozilla.org/MPL/
   43.13 +
   43.14 +  Software distributed under the License is distributed on an "AS IS" basis,
   43.15 +  WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
   43.16 +  for the specific language governing rights and limitations under the License.
   43.17 +
   43.18 +  The Original Code is the Open Hardware Monitor code.
   43.19 +
   43.20 +  The Initial Developer of the Original Code is 
   43.21 +  Michael Möller <m.moeller@gmx.ch>.
   43.22 +  Portions created by the Initial Developer are Copyright (C) 2009-2010
   43.23 +  the Initial Developer. All Rights Reserved.
   43.24 +
   43.25 +  Contributor(s):
   43.26 +
   43.27 +  Alternatively, the contents of this file may be used under the terms of
   43.28 +  either the GNU General Public License Version 2 or later (the "GPL"), or
   43.29 +  the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
   43.30 +  in which case the provisions of the GPL or the LGPL are applicable instead
   43.31 +  of those above. If you wish to allow use of your version of this file only
   43.32 +  under the terms of either the GPL or the LGPL, and not to allow others to
   43.33 +  use your version of this file under the terms of the MPL, indicate your
   43.34 +  decision by deleting the provisions above and replace them with the notice
   43.35 +  and other provisions required by the GPL or the LGPL. If you do not delete
   43.36 +  the provisions above, a recipient may use your version of this file under
   43.37 +  the terms of any one of the MPL, the GPL or the LGPL.
   43.38 + 
   43.39 +*/
   43.40 +
   43.41 +using System;
   43.42 +using System.Collections.Generic;
   43.43 +using System.Management;
   43.44 +using System.Text;
   43.45 +
   43.46 +namespace OpenHardwareMonitor.Hardware.SMBIOS {
   43.47 +
   43.48 +  public class SMBIOSGroup : IGroup {
   43.49 +
   43.50 +    private Structure[] table;
   43.51 +
   43.52 +    private BIOSInformation biosInformation = null;
   43.53 +
   43.54 +    private BaseBoardInformation baseBoardInformation = null;
   43.55 +
   43.56 +    public SMBIOSGroup() {
   43.57 +      int p = (int)System.Environment.OSVersion.Platform;
   43.58 +      if ((p == 4) || (p == 128))
   43.59 +        return;
   43.60 +          
   43.61 +      ManagementObjectCollection collection = new ManagementObjectSearcher(
   43.62 +         "root\\WMI", "SELECT SMBiosData FROM MSSMBios_RawSMBiosTables").Get();
   43.63 +
   43.64 +      byte[] raw = null;
   43.65 +      foreach (ManagementObject mo in collection) {
   43.66 +        raw = (byte[])mo["SMBiosData"];
   43.67 +        break;
   43.68 +      }
   43.69 +
   43.70 +      List<Structure> structureList = new List<Structure>();
   43.71 +      if (raw != null && raw.Length > 0) {
   43.72 +        int offset = 0;
   43.73 +        byte type = raw[offset];
   43.74 +        while (offset < raw.Length && type != 127) {
   43.75 +          
   43.76 +          type = raw[offset]; offset++;
   43.77 +          int length = raw[offset]; offset++;
   43.78 +          ushort handle = (ushort)((raw[offset] << 8) | raw[offset + 1]); 
   43.79 +          offset += 2;
   43.80 +          
   43.81 +          byte[] data = new byte[length];
   43.82 +          Array.Copy(raw, offset - 4, data, 0, length); offset += length - 4;
   43.83 +
   43.84 +          List<string> stringsList = new List<string>();
   43.85 +          if (raw[offset] == 0)
   43.86 +            offset++;
   43.87 +          while (raw[offset] != 0) {   
   43.88 +            StringBuilder sb = new StringBuilder();
   43.89 +            while (raw[offset] != 0) {
   43.90 +              sb.Append((char)raw[offset]); offset++;
   43.91 +            }
   43.92 +            offset++;
   43.93 +            stringsList.Add(sb.ToString());
   43.94 +          }
   43.95 +          offset++;
   43.96 +          switch (type) {
   43.97 +            case 0x00:
   43.98 +              this.biosInformation = new BIOSInformation(
   43.99 +                type, handle, data, stringsList.ToArray());
  43.100 +              structureList.Add(this.biosInformation); break;
  43.101 +            case 0x02: this.baseBoardInformation = new BaseBoardInformation(
  43.102 +                type, handle, data, stringsList.ToArray());
  43.103 +              structureList.Add(this.baseBoardInformation); break;
  43.104 +            default: structureList.Add(new Structure(
  43.105 +              type, handle, data, stringsList.ToArray())); break;
  43.106 +          }
  43.107 +        }
  43.108 +      }
  43.109 +      table = structureList.ToArray();
  43.110 +    }
  43.111 +
  43.112 +    public IHardware[] Hardware { get { return new IHardware[0]; } }
  43.113 +
  43.114 +    public string GetReport() {
  43.115 +      StringBuilder r = new StringBuilder();
  43.116 +
  43.117 +      r.AppendLine("SMBIOS");
  43.118 +      r.AppendLine();
  43.119 +
  43.120 +      if (biosInformation != null) {
  43.121 +        r.Append("BIOS Vendor: "); r.AppendLine(biosInformation.Vendor);
  43.122 +        r.Append("BIOS Version: "); r.AppendLine(biosInformation.Version);
  43.123 +        r.AppendLine();
  43.124 +      }
  43.125 +
  43.126 +      if (baseBoardInformation != null) {
  43.127 +        r.Append("Mainboard Manufacturer: "); 
  43.128 +        r.AppendLine(baseBoardInformation.Manufacturer);
  43.129 +        r.Append("Mainboard Name: "); 
  43.130 +        r.AppendLine(baseBoardInformation.ProductName);
  43.131 +        r.AppendLine();
  43.132 +      }
  43.133 +     
  43.134 +      return r.ToString();
  43.135 +    }
  43.136 +
  43.137 +    public void Close() { }
  43.138 +
  43.139 +    public class Structure {
  43.140 +      private byte type;
  43.141 +      private ushort handle;
  43.142 +
  43.143 +      private byte[] data;
  43.144 +      private string[] strings;
  43.145 +
  43.146 +      public Structure(byte type, ushort handle, byte[] data, string[] strings) 
  43.147 +      {
  43.148 +        this.type = type;
  43.149 +        this.handle = handle;
  43.150 +        this.data = data;
  43.151 +        this.strings = strings;
  43.152 +      }
  43.153 +
  43.154 +      public byte Type { get { return type; } }
  43.155 +
  43.156 +      public ushort Handle { get { return handle; } }
  43.157 +    }
  43.158 +
  43.159 +    public class BIOSInformation : Structure {
  43.160 +
  43.161 +      private string vendor = "";
  43.162 +      private string version = "";
  43.163 +
  43.164 +      public BIOSInformation(byte type, ushort handle, byte[] data,
  43.165 +        string[] strings)
  43.166 +        : base(type, handle, data, strings) {
  43.167 +
  43.168 +        if (data[0x04] > 0 && data[0x04] <= strings.Length)
  43.169 +          vendor = strings[data[0x04] - 1];
  43.170 +
  43.171 +        if (data[0x05] > 0 && data[0x05] <= strings.Length)
  43.172 +          version = strings[data[0x05] - 1];
  43.173 +      }
  43.174 +
  43.175 +      public string Vendor { get { return vendor; } }
  43.176 +
  43.177 +      public string Version { get { return version; } }
  43.178 +    }
  43.179 +
  43.180 +    public class BaseBoardInformation : Structure {
  43.181 +
  43.182 +      private string manufacturer  = "";
  43.183 +      private string productName = "";
  43.184 +
  43.185 +      public BaseBoardInformation(byte type, ushort handle, byte[] data,
  43.186 +        string[] strings)
  43.187 +        : base(type, handle, data, strings) {
  43.188 +
  43.189 +        if (data[0x04] > 0 && data[0x04] <= strings.Length)
  43.190 +          manufacturer = strings[data[0x04] - 1];
  43.191 +
  43.192 +        if (data[0x05] > 0 && data[0x05] <= strings.Length)
  43.193 +          productName = strings[data[0x05] - 1];
  43.194 +      }
  43.195 +
  43.196 +      public string Manufacturer { get { return manufacturer; } }
  43.197 +
  43.198 +      public string ProductName { get { return productName; } }
  43.199 +    }
  43.200 +  }
  43.201 +}
    44.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
    44.2 +++ b/Hardware/Sensor.cs	Tue Jan 26 22:37:48 2010 +0000
    44.3 @@ -0,0 +1,185 @@
    44.4 +/*
    44.5 +  
    44.6 +  Version: MPL 1.1/GPL 2.0/LGPL 2.1
    44.7 +
    44.8 +  The contents of this file are subject to the Mozilla Public License Version
    44.9 +  1.1 (the "License"); you may not use this file except in compliance with
   44.10 +  the License. You may obtain a copy of the License at
   44.11 + 
   44.12 +  http://www.mozilla.org/MPL/
   44.13 +
   44.14 +  Software distributed under the License is distributed on an "AS IS" basis,
   44.15 +  WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
   44.16 +  for the specific language governing rights and limitations under the License.
   44.17 +
   44.18 +  The Original Code is the Open Hardware Monitor code.
   44.19 +
   44.20 +  The Initial Developer of the Original Code is 
   44.21 +  Michael Möller <m.moeller@gmx.ch>.
   44.22 +  Portions created by the Initial Developer are Copyright (C) 2009-2010
   44.23 +  the Initial Developer. All Rights Reserved.
   44.24 +
   44.25 +  Contributor(s):
   44.26 +
   44.27 +  Alternatively, the contents of this file may be used under the terms of
   44.28 +  either the GNU General Public License Version 2 or later (the "GPL"), or
   44.29 +  the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
   44.30 +  in which case the provisions of the GPL or the LGPL are applicable instead
   44.31 +  of those above. If you wish to allow use of your version of this file only
   44.32 +  under the terms of either the GPL or the LGPL, and not to allow others to
   44.33 +  use your version of this file under the terms of the MPL, indicate your
   44.34 +  decision by deleting the provisions above and replace them with the notice
   44.35 +  and other provisions required by the GPL or the LGPL. If you do not delete
   44.36 +  the provisions above, a recipient may use your version of this file under
   44.37 +  the terms of any one of the MPL, the GPL or the LGPL.
   44.38 + 
   44.39 +*/
   44.40 +
   44.41 +using System;
   44.42 +using System.Collections.Generic;
   44.43 +
   44.44 +namespace OpenHardwareMonitor.Hardware {
   44.45 +
   44.46 +  public class Sensor : ISensor {
   44.47 +
   44.48 +    private string defaultName;
   44.49 +    private string name;
   44.50 +    private int index;
   44.51 +    private SensorType sensorType;
   44.52 +    private IHardware hardware;
   44.53 +    private float? value;
   44.54 +    private float? min;
   44.55 +    private float? max;
   44.56 +    private float? limit;
   44.57 +    private float? defaultLimit;
   44.58 +    private Queue<ISensorEntry> entries = 
   44.59 +      new Queue<ISensorEntry>(MAX_MINUTES * 15);
   44.60 +    
   44.61 +    private float sum = 0;
   44.62 +    private int count = 0;
   44.63 +
   44.64 +    private const int MAX_MINUTES = 120;
   44.65 +
   44.66 +    private string GetIdentifier() {
   44.67 +      string s = "";
   44.68 +      switch (sensorType) {
   44.69 +        case SensorType.Voltage: s = "voltage"; break;
   44.70 +        case SensorType.Clock: s = "clock"; break;
   44.71 +        case SensorType.Temperature: s = "temperature"; break;
   44.72 +        case SensorType.Fan: s = "fan"; break;
   44.73 +      }
   44.74 +      return hardware.Identifier + "/" + s + "/" + index;
   44.75 +    }
   44.76 +
   44.77 +    public Sensor(string name, int index, SensorType sensorType,
   44.78 +      IHardware hardware)
   44.79 +      : this(name, index, null, sensorType, hardware) { }
   44.80 +
   44.81 +    public Sensor(string name, int index, float? limit, 
   44.82 +      SensorType sensorType, IHardware hardware) 
   44.83 +    {
   44.84 +      this.defaultName = name;      
   44.85 +      this.index = index;
   44.86 +      this.defaultLimit = limit;
   44.87 +      this.sensorType = sensorType;
   44.88 +      this.hardware = hardware;
   44.89 +      string configName = 
   44.90 +        Utilities.Config.Settings[GetIdentifier() + "/name"];
   44.91 +      if (configName != null)
   44.92 +        this.name = configName;
   44.93 +      else
   44.94 +        this.name = name;
   44.95 +      string configLimit =
   44.96 +        Utilities.Config.Settings[GetIdentifier() + "/limit"];
   44.97 +      if (configLimit != null && configLimit != "")
   44.98 +        this.limit = float.Parse(configLimit);
   44.99 +      else
  44.100 +        this.limit = limit;
  44.101 +    }
  44.102 +
  44.103 +    public SensorType SensorType {
  44.104 +      get { return sensorType; }
  44.105 +    }
  44.106 +
  44.107 +    public string Name {
  44.108 +      get { 
  44.109 +        return name; 
  44.110 +      }
  44.111 +      set {
  44.112 +        if (value != "") 
  44.113 +          name = value;          
  44.114 +        else 
  44.115 +          name = defaultName;
  44.116 +        Utilities.Config.Settings[GetIdentifier() + "/name"] = name;
  44.117 +      }
  44.118 +    }
  44.119 +
  44.120 +    public int Index {
  44.121 +      get { return index; }
  44.122 +    }
  44.123 +
  44.124 +    public float? Value {
  44.125 +      get { 
  44.126 +        return value; 
  44.127 +      }
  44.128 +      set {
  44.129 +        while (entries.Count > 0 && 
  44.130 +          (DateTime.Now - entries.Peek().Time).TotalMinutes > MAX_MINUTES)
  44.131 +          entries.Dequeue();
  44.132 +
  44.133 +        if (value.HasValue) {
  44.134 +          sum += value.Value;
  44.135 +          count++;
  44.136 +          if (count == 4) {
  44.137 +            entries.Enqueue(new Entry(sum / count, DateTime.Now));
  44.138 +            sum = 0;
  44.139 +            count = 0;
  44.140 +          }
  44.141 +        }
  44.142 +
  44.143 +        this.value = value;
  44.144 +        if (min > value || !min.HasValue)
  44.145 +          min = value;
  44.146 +        if (max < value || !max.HasValue)
  44.147 +          max = value;
  44.148 +      }
  44.149 +    }
  44.150 +
  44.151 +    public float? Min { get { return min; } }
  44.152 +    public float? Max { get { return max; } }
  44.153 +
  44.154 +    public float? Limit {
  44.155 +      get {
  44.156 +        return limit;
  44.157 +      }
  44.158 +
  44.159 +      set {
  44.160 +        if (value.HasValue) {
  44.161 +          limit = value;
  44.162 +          Utilities.Config.Settings[GetIdentifier() + "/limit"] =
  44.163 +            limit.ToString();
  44.164 +        } else {
  44.165 +          limit = defaultLimit;
  44.166 +          Utilities.Config.Settings[GetIdentifier() + "/limit"] = "";          
  44.167 +        }        
  44.168 +      }
  44.169 +    }
  44.170 +
  44.171 +    public IEnumerable<ISensorEntry> Plot {
  44.172 +      get { return entries; }
  44.173 +    }
  44.174 +
  44.175 +    public struct Entry : ISensorEntry {
  44.176 +      private float value;
  44.177 +      private DateTime time;
  44.178 +
  44.179 +      public Entry(float value, DateTime time) {
  44.180 +        this.value = value;
  44.181 +        this.time = time;
  44.182 +      }
  44.183 +
  44.184 +      public float Value { get { return value; } }
  44.185 +      public DateTime Time { get { return time; } }
  44.186 +    }
  44.187 +  }
  44.188 +}
    45.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
    45.2 +++ b/Hardware/TBalancer/TBalancer.cs	Tue Jan 26 22:37:48 2010 +0000
    45.3 @@ -0,0 +1,198 @@
    45.4 +/*
    45.5 +  
    45.6 +  Version: MPL 1.1/GPL 2.0/LGPL 2.1
    45.7 +
    45.8 +  The contents of this file are subject to the Mozilla Public License Version
    45.9 +  1.1 (the "License"); you may not use this file except in compliance with
   45.10 +  the License. You may obtain a copy of the License at
   45.11 + 
   45.12 +  http://www.mozilla.org/MPL/
   45.13 +
   45.14 +  Software distributed under the License is distributed on an "AS IS" basis,
   45.15 +  WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
   45.16 +  for the specific language governing rights and limitations under the License.
   45.17 +
   45.18 +  The Original Code is the Open Hardware Monitor code.
   45.19 +
   45.20 +  The Initial Developer of the Original Code is 
   45.21 +  Michael Möller <m.moeller@gmx.ch>.
   45.22 +  Portions created by the Initial Developer are Copyright (C) 2009-2010
   45.23 +  the Initial Developer. All Rights Reserved.
   45.24 +
   45.25 +  Contributor(s):
   45.26 +
   45.27 +  Alternatively, the contents of this file may be used under the terms of
   45.28 +  either the GNU General Public License Version 2 or later (the "GPL"), or
   45.29 +  the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
   45.30 +  in which case the provisions of the GPL or the LGPL are applicable instead
   45.31 +  of those above. If you wish to allow use of your version of this file only
   45.32 +  under the terms of either the GPL or the LGPL, and not to allow others to
   45.33 +  use your version of this file under the terms of the MPL, indicate your
   45.34 +  decision by deleting the provisions above and replace them with the notice
   45.35 +  and other provisions required by the GPL or the LGPL. If you do not delete
   45.36 +  the provisions above, a recipient may use your version of this file under
   45.37 +  the terms of any one of the MPL, the GPL or the LGPL.
   45.38 + 
   45.39 +*/
   45.40 +
   45.41 +using System;
   45.42 +using System.Collections.Generic;
   45.43 +using System.Configuration;
   45.44 +using System.Drawing;
   45.45 +using System.IO;
   45.46 +using System.IO.Ports;
   45.47 +using System.Text;
   45.48 +
   45.49 +namespace OpenHardwareMonitor.Hardware.TBalancer {
   45.50 +  public class TBalancer : IHardware {
   45.51 +
   45.52 +    private Image icon;
   45.53 +    private SerialPort serialPort;
   45.54 +    private Sensor[] digitalTemperatures = new Sensor[8];
   45.55 +    private Sensor[] analogTemperatures = new Sensor[4];
   45.56 +    private Sensor[] fans = new Sensor[4];
   45.57 +    private List<ISensor> active = new List<ISensor>();
   45.58 +    private List<ISensor> deactivating = new List<ISensor>();
   45.59 +    private int[] data;
   45.60 +
   45.61 +    public const byte STARTFLAG = 100;
   45.62 +    public const byte PROTOCOL_VERSION = 0x2A;
   45.63 +
   45.64 +    public TBalancer(string portName) {
   45.65 +      icon = Utilities.EmbeddedResources.GetImage("bigng.png");
   45.66 +
   45.67 +      try {
   45.68 +        serialPort = new SerialPort(portName, 19200, Parity.None, 8,
   45.69 +          StopBits.One);
   45.70 +        serialPort.Open();
   45.71 +        Update();
   45.72 +      } catch (IOException) { }
   45.73 +
   45.74 +      for (int i = 0; i < digitalTemperatures.Length; i++) 
   45.75 +        digitalTemperatures[i] = new Sensor("Digital Sensor #" + (i + 1), i, 
   45.76 +          SensorType.Temperature, this);
   45.77 +
   45.78 +      for (int i = 0; i < analogTemperatures.Length; i++)
   45.79 +        analogTemperatures[i] = new Sensor("Analog Sensor #" + (i + 1),
   45.80 +          i + digitalTemperatures.Length, SensorType.Temperature, this);        
   45.81 +    }
   45.82 +
   45.83 +    private void ActivateSensor(Sensor sensor) {
   45.84 +      deactivating.Remove(sensor);
   45.85 +      if (!active.Contains(sensor)) {
   45.86 +        active.Add(sensor);
   45.87 +        SensorAdded(sensor);
   45.88 +      }      
   45.89 +    }
   45.90 +
   45.91 +    private void DeactivateSensor(Sensor sensor) {
   45.92 +      if (deactivating.Contains(sensor)) {
   45.93 +        active.Remove(sensor);
   45.94 +        deactivating.Remove(sensor);
   45.95 +        SensorRemoved(sensor);
   45.96 +      } else if (active.Contains(sensor)) {
   45.97 +        deactivating.Add(sensor);
   45.98 +      }     
   45.99 +    }
  45.100 +
  45.101 +    private void ReadData() {
  45.102 +      int[] data = new int[285];
  45.103 +      for (int i = 0; i < data.Length; i++)
  45.104 +        data[i] = serialPort.ReadByte();
  45.105 +
  45.106 +      if (data[0] != STARTFLAG || data[274] != PROTOCOL_VERSION) {
  45.107 +        serialPort.DiscardInBuffer();   
  45.108 +        return;
  45.109 +      }
  45.110 +
  45.111 +      for (int i = 0; i < digitalTemperatures.Length; i++)
  45.112 +        if (data[238 + i] > 0) {
  45.113 +          digitalTemperatures[i].Value = 0.5f * data[238 + i];
  45.114 +          ActivateSensor(digitalTemperatures[i]);
  45.115 +        } else {
  45.116 +          DeactivateSensor(digitalTemperatures[i]);
  45.117 +        }
  45.118 +
  45.119 +      for (int i = 0; i < analogTemperatures.Length; i++)
  45.120 +        if (data[260 + i] > 0) {
  45.121 +          analogTemperatures[i].Value = 0.5f * data[260 + i];
  45.122 +          ActivateSensor(analogTemperatures[i]);
  45.123 +        } else {
  45.124 +          DeactivateSensor(analogTemperatures[i]);
  45.125 +        }
  45.126 +      
  45.127 +      for (int i = 0; i < fans.Length; i++) {
  45.128 +        float maxRPM = 11.5f * ((data[149 + 2 * i] << 8) | data[148 + 2 * i]);
  45.129 +        
  45.130 +        if (fans[i] == null) 
  45.131 +          fans[i] = new Sensor("Fan #" + (i + 1), i, maxRPM, SensorType.Fan, 
  45.132 +            this);
  45.133 +
  45.134 +        if ((data[136] & (1 << i)) == 0)
  45.135 +          fans[i].Value = maxRPM * 0.01f * data[156 + i]; // pwm mode
  45.136 +        else
  45.137 +          fans[i].Value = maxRPM * 0.01f * data[141 + i]; // analog mode
  45.138 +        ActivateSensor(fans[i]);
  45.139 +      }
  45.140 +      this.data = data;
  45.141 +    }
  45.142 +
  45.143 +    public Image Icon {
  45.144 +      get { return icon; }
  45.145 +    }
  45.146 +
  45.147 +    public string Name {
  45.148 +      get { return "T-Balancer bigNG"; }
  45.149 +    }
  45.150 +
  45.151 +    public string Identifier {
  45.152 +      get { return "/bigng/" + 
  45.153 +        serialPort.PortName.TrimStart(new char[]{'/'}).ToLower(); }
  45.154 +    }
  45.155 +
  45.156 +    public ISensor[] Sensors {
  45.157 +      get { return active.ToArray(); }
  45.158 +    }
  45.159 +
  45.160 +    public string GetReport() {
  45.161 +      StringBuilder r = new StringBuilder();
  45.162 +
  45.163 +      r.AppendLine("T-Balancer bigNG");
  45.164 +      r.AppendLine();
  45.165 +      r.Append("Port Name: "); r.AppendLine(serialPort.PortName);
  45.166 +      r.AppendLine();
  45.167 +      r.AppendLine("System Information Answer");
  45.168 +      r.AppendLine();
  45.169 +
  45.170 +      r.AppendLine("       00 01 02 03 04 05 06 07 08 09 0A 0B 0C 0D 0E 0F");
  45.171 +      r.AppendLine();
  45.172 +      for (int i = 0; i <= 0x11; i++) {
  45.173 +        r.Append(" "); r.Append((i << 4).ToString("X3")); r.Append("  ");
  45.174 +        for (int j = 0; j <= 0xF; j++) {
  45.175 +          int index = ((i << 4) | j);
  45.176 +          if (index < data.Length) {
  45.177 +            r.Append(" ");
  45.178 +            r.Append(data[index].ToString("X2"));
  45.179 +          }          
  45.180 +        }
  45.181 +        r.AppendLine();
  45.182 +      }
  45.183 +      r.AppendLine();
  45.184 +
  45.185 +      return r.ToString();
  45.186 +    }
  45.187 +
  45.188 +    public void Update() {
  45.189 +      while (serialPort.BytesToRead >= 285)
  45.190 +        ReadData();
  45.191 +      serialPort.Write(new byte[] { 0x38 }, 0, 1);
  45.192 +    }
  45.193 +
  45.194 +    public void Close() {
  45.195 +      serialPort.Close();
  45.196 +    }
  45.197 +
  45.198 +    public event SensorEventHandler SensorAdded;
  45.199 +    public event SensorEventHandler SensorRemoved;
  45.200 +  }
  45.201 +}
    46.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
    46.2 +++ b/Hardware/TBalancer/TBalancerGroup.cs	Tue Jan 26 22:37:48 2010 +0000
    46.3 @@ -0,0 +1,112 @@
    46.4 +/*
    46.5 +  
    46.6 +  Version: MPL 1.1/GPL 2.0/LGPL 2.1
    46.7 +
    46.8 +  The contents of this file are subject to the Mozilla Public License Version
    46.9 +  1.1 (the "License"); you may not use this file except in compliance with
   46.10 +  the License. You may obtain a copy of the License at
   46.11 + 
   46.12 +  http://www.mozilla.org/MPL/
   46.13 +
   46.14 +  Software distributed under the License is distributed on an "AS IS" basis,
   46.15 +  WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
   46.16 +  for the specific language governing rights and limitations under the License.
   46.17 +
   46.18 +  The Original Code is the Open Hardware Monitor code.
   46.19 +
   46.20 +  The Initial Developer of the Original Code is 
   46.21 +  Michael Möller <m.moeller@gmx.ch>.
   46.22 +  Portions created by the Initial Developer are Copyright (C) 2009-2010
   46.23 +  the Initial Developer. All Rights Reserved.
   46.24 +
   46.25 +  Contributor(s):
   46.26 +
   46.27 +  Alternatively, the contents of this file may be used under the terms of
   46.28 +  either the GNU General Public License Version 2 or later (the "GPL"), or
   46.29 +  the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
   46.30 +  in which case the provisions of the GPL or the LGPL are applicable instead
   46.31 +  of those above. If you wish to allow use of your version of this file only
   46.32 +  under the terms of either the GPL or the LGPL, and not to allow others to
   46.33 +  use your version of this file under the terms of the MPL, indicate your
   46.34 +  decision by deleting the provisions above and replace them with the notice
   46.35 +  and other provisions required by the GPL or the LGPL. If you do not delete
   46.36 +  the provisions above, a recipient may use your version of this file under
   46.37 +  the terms of any one of the MPL, the GPL or the LGPL.
   46.38 + 
   46.39 +*/
   46.40 +
   46.41 +using System;
   46.42 +using System.Collections.Generic;
   46.43 +using System.IO;
   46.44 +using System.IO.Ports;
   46.45 +using System.Threading;
   46.46 +
   46.47 +namespace OpenHardwareMonitor.Hardware.TBalancer {
   46.48 +  public class TBalancerGroup : IGroup {
   46.49 +
   46.50 +    private List<TBalancer> hardware = new List<TBalancer>();
   46.51 +
   46.52 +    public TBalancerGroup() {
   46.53 +
   46.54 +      string[] portNames = SerialPort.GetPortNames();
   46.55 +      for (int i = portNames.Length - 1; i >= 0; i--) {
   46.56 +        try {
   46.57 +          SerialPort serialPort =
   46.58 +            new SerialPort(portNames[i], 19200, Parity.None, 8, StopBits.One);
   46.59 +          serialPort.Open();
   46.60 +          bool isValid = false;
   46.61 +          if (serialPort.IsOpen && serialPort.CDHolding &&
   46.62 +            serialPort.CtsHolding) {
   46.63 +            serialPort.DiscardInBuffer();
   46.64 +            serialPort.DiscardOutBuffer();
   46.65 +            serialPort.Write(new byte[] { 0x38 }, 0, 1);
   46.66 +            int j = 0;
   46.67 +            while (serialPort.BytesToRead == 0 && j < 2) {
   46.68 +              Thread.Sleep(100);
   46.69 +              j++;
   46.70 +            }
   46.71 +            if (serialPort.BytesToRead > 0 && 
   46.72 +              serialPort.ReadByte() == TBalancer.STARTFLAG) 
   46.73 +            {
   46.74 +              while (serialPort.BytesToRead < 284 && j < 5) {
   46.75 +                Thread.Sleep(100);
   46.76 +                j++;
   46.77 +              }
   46.78 +              if (serialPort.BytesToRead == 284) {
   46.79 +                int[] data = new int[285];
   46.80 +                data[0] = TBalancer.STARTFLAG;
   46.81 +                for (int k = 1; k < data.Length; k++)
   46.82 +                  data[k] = serialPort.ReadByte();
   46.83 +                
   46.84 +                // check protocol version
   46.85 +                isValid = (data[274] == TBalancer.PROTOCOL_VERSION); 
   46.86 +              }
   46.87 +            }
   46.88 +          }
   46.89 +          serialPort.DiscardInBuffer();
   46.90 +          serialPort.Close();
   46.91 +          if (isValid) {
   46.92 +            hardware.Add(new TBalancer(portNames[i]));
   46.93 +            return;
   46.94 +          }
   46.95 +        } catch (IOException) { } catch (UnauthorizedAccessException) { } 
   46.96 +          catch (NullReferenceException) { }
   46.97 +      }
   46.98 +    }
   46.99 +
  46.100 +    public IHardware[] Hardware {
  46.101 +      get {
  46.102 +        return hardware.ToArray();
  46.103 +      }
  46.104 +    }
  46.105 +
  46.106 +    public string GetReport() {
  46.107 +      return null;
  46.108 +    }
  46.109 +
  46.110 +    public void Close() {
  46.111 +      foreach (TBalancer tbalancer in hardware)
  46.112 +        tbalancer.Close();
  46.113 +    }
  46.114 +  }
  46.115 +}
    47.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
    47.2 +++ b/Hardware/WinRing0.cs	Tue Jan 26 22:37:48 2010 +0000
    47.3 @@ -0,0 +1,149 @@
    47.4 +/*
    47.5 +  
    47.6 +  Version: MPL 1.1/GPL 2.0/LGPL 2.1
    47.7 +
    47.8 +  The contents of this file are subject to the Mozilla Public License Version
    47.9 +  1.1 (the "License"); you may not use this file except in compliance with
   47.10 +  the License. You may obtain a copy of the License at
   47.11 + 
   47.12 +  http://www.mozilla.org/MPL/
   47.13 +
   47.14 +  Software distributed under the License is distributed on an "AS IS" basis,
   47.15 +  WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
   47.16 +  for the specific language governing rights and limitations under the License.
   47.17 +
   47.18 +  The Original Code is the Open Hardware Monitor code.
   47.19 +
   47.20 +  The Initial Developer of the Original Code is 
   47.21 +  Michael Möller <m.moeller@gmx.ch>.
   47.22 +  Portions created by the Initial Developer are Copyright (C) 2009-2010
   47.23 +  the Initial Developer. All Rights Reserved.
   47.24 +
   47.25 +  Contributor(s):
   47.26 +
   47.27 +  Alternatively, the contents of this file may be used under the terms of
   47.28 +  either the GNU General Public License Version 2 or later (the "GPL"), or
   47.29 +  the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
   47.30 +  in which case the provisions of the GPL or the LGPL are applicable instead
   47.31 +  of those above. If you wish to allow use of your version of this file only
   47.32 +  under the terms of either the GPL or the LGPL, and not to allow others to
   47.33 +  use your version of this file under the terms of the MPL, indicate your
   47.34 +  decision by deleting the provisions above and replace them with the notice
   47.35 +  and other provisions required by the GPL or the LGPL. If you do not delete
   47.36 +  the provisions above, a recipient may use your version of this file under
   47.37 +  the terms of any one of the MPL, the GPL or the LGPL.
   47.38 + 
   47.39 +*/
   47.40 +
   47.41 +using System;
   47.42 +using System.Collections.Generic;
   47.43 +using System.IO;
   47.44 +using System.Runtime.InteropServices;
   47.45 +using System.Text;
   47.46 +
   47.47 +namespace OpenHardwareMonitor.Hardware {
   47.48 +
   47.49 +  public class WinRing0 {
   47.50 +    
   47.51 +    public enum OlsDllStatus{
   47.52 +      OLS_DLL_NO_ERROR                        = 0,
   47.53 +      OLS_DLL_UNSUPPORTED_PLATFORM            = 1,
   47.54 +      OLS_DLL_DRIVER_NOT_LOADED               = 2,
   47.55 +      OLS_DLL_DRIVER_NOT_FOUND                = 3,
   47.56 +      OLS_DLL_DRIVER_UNLOADED                 = 4,
   47.57 +      OLS_DLL_DRIVER_NOT_LOADED_ON_NETWORK    = 5,
   47.58 +      OLS_DLL_UNKNOWN_ERROR                   = 9
   47.59 +    }
   47.60 +
   47.61 +    private static bool available = false;
   47.62 +
   47.63 +    private static string GetDllName() {   
   47.64 +      int p = (int)System.Environment.OSVersion.Platform;
   47.65 +      if ((p == 4) || (p == 128)) {
   47.66 +        if (IntPtr.Size == 4) {
   47.67 +          return "libring0.so";
   47.68 +        } else {
   47.69 +          return "libring0x64.so";
   47.70 +        }
   47.71 +      } else {
   47.72 +        if (IntPtr.Size == 4) {
   47.73 +          return "WinRing0.dll";
   47.74 +        } else {
   47.75 +          return "WinRing0x64.dll";
   47.76 +        }
   47.77 +      }                       
   47.78 +    }
   47.79 +    
   47.80 +    private delegate bool InitializeOlsDelegate();
   47.81 +    private delegate void DeinitializeOlsDelegate();
   47.82 +    
   47.83 +    public delegate uint GetDllStatusDelegate();
   47.84 +    public delegate bool IsCpuidDelegate();
   47.85 +    public delegate bool CpuidDelegate(uint index, out uint eax, out uint ebx, 
   47.86 +      out uint ecx, out uint edx);
   47.87 +    public delegate bool RdmsrPxDelegate(uint index, ref uint eax, ref uint edx, 
   47.88 +      UIntPtr processAffinityMask);
   47.89 +    public delegate byte ReadIoPortByteDelegate(ushort port);
   47.90 +    public delegate void WriteIoPortByteDelegate(ushort port, byte value);
   47.91 +    public delegate void SetPciMaxBusIndexDelegate(byte max);
   47.92 +    public delegate uint FindPciDeviceByIdDelegate(ushort vendorId, 
   47.93 +      ushort deviceId, byte index);
   47.94 +    public delegate bool ReadPciConfigDwordExDelegate(uint pciAddress, 
   47.95 +      uint regAddress, out uint value);
   47.96 +
   47.97 +    private static InitializeOlsDelegate InitializeOls;
   47.98 +    private static DeinitializeOlsDelegate DeinitializeOls;
   47.99 +
  47.100 +    public static GetDllStatusDelegate GetDllStatus;
  47.101 +    public static IsCpuidDelegate IsCpuid;
  47.102 +    public static CpuidDelegate Cpuid;
  47.103 +    public static RdmsrPxDelegate RdmsrPx;
  47.104 +    public static ReadIoPortByteDelegate ReadIoPortByte;
  47.105 +    public static WriteIoPortByteDelegate WriteIoPortByte;
  47.106 +    public static SetPciMaxBusIndexDelegate SetPciMaxBusIndex;
  47.107 +    public static FindPciDeviceByIdDelegate FindPciDeviceById;
  47.108 +    public static ReadPciConfigDwordExDelegate ReadPciConfigDwordEx;
  47.109 +
  47.110 +    private static void GetDelegate<T>(string entryPoint, out T newDelegate) 
  47.111 +      where T : class 
  47.112 +    {
  47.113 +      DllImportAttribute attribute = new DllImportAttribute(GetDllName());
  47.114 +      attribute.CallingConvention = CallingConvention.Winapi;
  47.115 +      attribute.PreserveSig = true;
  47.116 +      attribute.EntryPoint = entryPoint;
  47.117 +      attribute.CharSet = CharSet.Auto;
  47.118 +      PInvokeDelegateFactory.CreateDelegate(attribute, out newDelegate);
  47.119 +    }
  47.120 +
  47.121 +    static WinRing0() {
  47.122 +      GetDelegate("InitializeOls", out InitializeOls);
  47.123 +      GetDelegate("DeinitializeOls", out DeinitializeOls);
  47.124 +      GetDelegate("GetDllStatus", out GetDllStatus);
  47.125 +      GetDelegate("IsCpuid", out IsCpuid);
  47.126 +      GetDelegate("Cpuid", out Cpuid);
  47.127 +      GetDelegate("RdmsrPx", out  RdmsrPx);
  47.128 +      GetDelegate("ReadIoPortByte", out ReadIoPortByte);
  47.129 +      GetDelegate("WriteIoPortByte", out WriteIoPortByte);
  47.130 +      GetDelegate("SetPciMaxBusIndex", out SetPciMaxBusIndex);
  47.131 +      GetDelegate("FindPciDeviceById", out FindPciDeviceById);
  47.132 +      GetDelegate("ReadPciConfigDwordEx", out ReadPciConfigDwordEx);
  47.133 +
  47.134 +      try {
  47.135 +        if (InitializeOls != null && InitializeOls())
  47.136 +          available = true;
  47.137 +      } catch (DllNotFoundException) { }       
  47.138 +    }
  47.139 +    
  47.140 +    public static bool IsAvailable {
  47.141 +      get { return available; }
  47.142 +    }
  47.143 +
  47.144 +    private static Deinitializer deinitializer = new Deinitializer();
  47.145 +    private class Deinitializer {
  47.146 +      ~Deinitializer() {
  47.147 +        if (available)
  47.148 +          DeinitializeOls();
  47.149 +      }
  47.150 +    }
  47.151 +  }
  47.152 +}
    48.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
    48.2 +++ b/Licenses/Aga.Controls.License.txt	Tue Jan 26 22:37:48 2010 +0000
    48.3 @@ -0,0 +1,25 @@
    48.4 +The BSD License
    48.5 +
    48.6 +Copyright (c) 2009, Andrey Gliznetsov (a.gliznetsov@gmail.com)
    48.7 +
    48.8 +All rights reserved.
    48.9 +
   48.10 +Redistribution and use in source and binary forms, with or without modification, are permitted provided 
   48.11 +that the following conditions are met
   48.12 +
   48.13 +- Redistributions of source code must retain the above copyright notice, this list of conditions 
   48.14 +and the following disclaimer.
   48.15 +- Redistributions in binary form must reproduce the above copyright notice, this list of conditions 
   48.16 +and the following disclaimer in the documentation andor other materials provided with the distribution.
   48.17 +
   48.18 +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
   48.19 +AS IS AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
   48.20 +LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
   48.21 +A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR
   48.22 +CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
   48.23 +EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
   48.24 +PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
   48.25 +PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
   48.26 +LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
   48.27 +NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
   48.28 +SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
   48.29 \ No newline at end of file
    49.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
    49.2 +++ b/Licenses/OpenHardwareMonitor.License.txt	Tue Jan 26 22:37:48 2010 +0000
    49.3 @@ -0,0 +1,470 @@
    49.4 +                          MOZILLA PUBLIC LICENSE
    49.5 +                                Version 1.1
    49.6 +
    49.7 +                              ---------------
    49.8 +
    49.9 +1. Definitions.
   49.10 +
   49.11 +     1.0.1. "Commercial Use" means distribution or otherwise making the
   49.12 +     Covered Code available to a third party.
   49.13 +
   49.14 +     1.1. "Contributor" means each entity that creates or contributes to
   49.15 +     the creation of Modifications.
   49.16 +
   49.17 +     1.2. "Contributor Version" means the combination of the Original
   49.18 +     Code, prior Modifications used by a Contributor, and the Modifications
   49.19 +     made by that particular Contributor.
   49.20 +
   49.21 +     1.3. "Covered Code" means the Original Code or Modifications or the
   49.22 +     combination of the Original Code and Modifications, in each case
   49.23 +     including portions thereof.
   49.24 +
   49.25 +     1.4. "Electronic Distribution Mechanism" means a mechanism generally
   49.26 +     accepted in the software development community for the electronic
   49.27 +     transfer of data.
   49.28 +
   49.29 +     1.5. "Executable" means Covered Code in any form other than Source
   49.30 +     Code.
   49.31 +
   49.32 +     1.6. "Initial Developer" means the individual or entity identified
   49.33 +     as the Initial Developer in the Source Code notice required by Exhibit
   49.34 +     A.
   49.35 +
   49.36 +     1.7. "Larger Work" means a work which combines Covered Code or
   49.37 +     portions thereof with code not governed by the terms of this License.
   49.38 +
   49.39 +     1.8. "License" means this document.
   49.40 +
   49.41 +     1.8.1. "Licensable" means having the right to grant, to the maximum
   49.42 +     extent possible, whether at the time of the initial grant or
   49.43 +     subsequently acquired, any and all of the rights conveyed herein.
   49.44 +
   49.45 +     1.9. "Modifications" means any addition to or deletion from the
   49.46 +     substance or structure of either the Original Code or any previous
   49.47 +     Modifications. When Covered Code is released as a series of files, a
   49.48 +     Modification is:
   49.49 +          A. Any addition to or deletion from the contents of a file
   49.50 +          containing Original Code or previous Modifications.
   49.51 +
   49.52 +          B. Any new file that contains any part of the Original Code or
   49.53 +          previous Modifications.
   49.54 +
   49.55 +     1.10. "Original Code" means Source Code of computer software code
   49.56 +     which is described in the Source Code notice required by Exhibit A as
   49.57 +     Original Code, and which, at the time of its release under this
   49.58 +     License is not already Covered Code governed by this License.
   49.59 +
   49.60 +     1.10.1. "Patent Claims" means any patent claim(s), now owned or
   49.61 +     hereafter acquired, including without limitation,  method, process,
   49.62 +     and apparatus claims, in any patent Licensable by grantor.
   49.63 +
   49.64 +     1.11. "Source Code" means the preferred form of the Covered Code for
   49.65 +     making modifications to it, including all modules it contains, plus
   49.66 +     any associated interface definition files, scripts used to control
   49.67 +     compilation and installation of an Executable, or source code
   49.68 +     differential comparisons against either the Original Code or another
   49.69 +     well known, available Covered Code of the Contributor's choice. The
   49.70 +     Source Code can be in a compressed or archival form, provided the
   49.71 +     appropriate decompression or de-archiving software is widely available
   49.72 +     for no charge.
   49.73 +
   49.74 +     1.12. "You" (or "Your")  means an individual or a legal entity
   49.75 +     exercising rights under, and complying with all of the terms of, this
   49.76 +     License or a future version of this License issued under Section 6.1.
   49.77 +     For legal entities, "You" includes any entity which controls, is
   49.78 +     controlled by, or is under common control with You. For purposes of
   49.79 +     this definition, "control" means (a) the power, direct or indirect,
   49.80 +     to cause the direction or management of such entity, whether by
   49.81 +     contract or otherwise, or (b) ownership of more than fifty percent
   49.82 +     (50%) of the outstanding shares or beneficial ownership of such
   49.83 +     entity.
   49.84 +
   49.85 +2. Source Code License.
   49.86 +
   49.87 +     2.1. The Initial Developer Grant.
   49.88 +     The Initial Developer hereby grants You a world-wide, royalty-free,
   49.89 +     non-exclusive license, subject to third party intellectual property
   49.90 +     claims:
   49.91 +          (a)  under intellectual property rights (other than patent or
   49.92 +          trademark) Licensable by Initial Developer to use, reproduce,
   49.93 +          modify, display, perform, sublicense and distribute the Original
   49.94 +          Code (or portions thereof) with or without Modifications, and/or
   49.95 +          as part of a Larger Work; and
   49.96 +
   49.97 +          (b) under Patents Claims infringed by the making, using or
   49.98 +          selling of Original Code, to make, have made, use, practice,
   49.99 +          sell, and offer for sale, and/or otherwise dispose of the
  49.100 +          Original Code (or portions thereof).
  49.101 +
  49.102 +          (c) the licenses granted in this Section 2.1(a) and (b) are
  49.103 +          effective on the date Initial Developer first distributes
  49.104 +          Original Code under the terms of this License.
  49.105 +
  49.106 +          (d) Notwithstanding Section 2.1(b) above, no patent license is
  49.107 +          granted: 1) for code that You delete from the Original Code; 2)
  49.108 +          separate from the Original Code;  or 3) for infringements caused
  49.109 +          by: i) the modification of the Original Code or ii) the
  49.110 +          combination of the Original Code with other software or devices.
  49.111 +
  49.112 +     2.2. Contributor Grant.
  49.113 +     Subject to third party intellectual property claims, each Contributor
  49.114 +     hereby grants You a world-wide, royalty-free, non-exclusive license
  49.115 +
  49.116 +          (a)  under intellectual property rights (other than patent or
  49.117 +          trademark) Licensable by Contributor, to use, reproduce, modify,
  49.118 +          display, perform, sublicense and distribute the Modifications
  49.119 +          created by such Contributor (or portions thereof) either on an
  49.120 +          unmodified basis, with other Modifications, as Covered Code
  49.121 +          and/or as part of a Larger Work; and
  49.122 +
  49.123 +          (b) under Patent Claims infringed by the making, using, or
  49.124 +          selling of  Modifications made by that Contributor either alone
  49.125 +          and/or in combination with its Contributor Version (or portions
  49.126 +          of such combination), to make, use, sell, offer for sale, have
  49.127 +          made, and/or otherwise dispose of: 1) Modifications made by that
  49.128 +          Contributor (or portions thereof); and 2) the combination of
  49.129 +          Modifications made by that Contributor with its Contributor
  49.130 +          Version (or portions of such combination).
  49.131 +
  49.132 +          (c) the licenses granted in Sections 2.2(a) and 2.2(b) are
  49.133 +          effective on the date Contributor first makes Commercial Use of
  49.134 +          the Covered Code.
  49.135 +
  49.136 +          (d)    Notwithstanding Section 2.2(b) above, no patent license is
  49.137 +          granted: 1) for any code that Contributor has deleted from the
  49.138 +          Contributor Version; 2)  separate from the Contributor Version;
  49.139 +          3)  for infringements caused by: i) third party modifications of
  49.140 +          Contributor Version or ii)  the combination of Modifications made
  49.141 +          by that Contributor with other software  (except as part of the
  49.142 +          Contributor Version) or other devices; or 4) under Patent Claims
  49.143 +          infringed by Covered Code in the absence of Modifications made by
  49.144 +          that Contributor.
  49.145 +
  49.146 +3. Distribution Obligations.
  49.147 +
  49.148 +     3.1. Application of License.
  49.149 +     The Modifications which You create or to which You contribute are
  49.150 +     governed by the terms of this License, including without limitation
  49.151 +     Section 2.2. The Source Code version of Covered Code may be
  49.152 +     distributed only under the terms of this License or a future version
  49.153 +     of this License released under Section 6.1, and You must include a
  49.154 +     copy of this License with every copy of the Source Code You
  49.155 +     distribute. You may not offer or impose any terms on any Source Code
  49.156 +     version that alters or restricts the applicable version of this
  49.157 +     License or the recipients' rights hereunder. However, You may include
  49.158 +     an additional document offering the additional rights described in
  49.159 +     Section 3.5.
  49.160 +
  49.161 +     3.2. Availability of Source Code.
  49.162 +     Any Modification which You create or to which You contribute must be
  49.163 +     made available in Source Code form under the terms of this License
  49.164 +     either on the same media as an Executable version or via an accepted
  49.165 +     Electronic Distribution Mechanism to anyone to whom you made an
  49.166 +     Executable version available; and if made available via Electronic
  49.167 +     Distribution Mechanism, must remain available for at least twelve (12)
  49.168 +     months after the date it initially became available, or at least six
  49.169 +     (6) months after a subsequent version of that particular Modification
  49.170 +     has been made available to such recipients. You are responsible for
  49.171 +     ensuring that the Source Code version remains available even if the
  49.172 +     Electronic Distribution Mechanism is maintained by a third party.
  49.173 +
  49.174 +     3.3. Description of Modifications.
  49.175 +     You must cause all Covered Code to which You contribute to contain a
  49.176 +     file documenting the changes You made to create that Covered Code and
  49.177 +     the date of any change. You must include a prominent statement that
  49.178 +     the Modification is derived, directly or indirectly, from Original
  49.179 +     Code provided by the Initial Developer and including the name of the
  49.180 +     Initial Developer in (a) the Source Code, and (b) in any notice in an
  49.181 +     Executable version or related documentation in which You describe the
  49.182 +     origin or ownership of the Covered Code.
  49.183 +
  49.184 +     3.4. Intellectual Property Matters
  49.185 +          (a) Third Party Claims.
  49.186 +          If Contributor has knowledge that a license under a third party's
  49.187 +          intellectual property rights is required to exercise the rights
  49.188 +          granted by such Contributor under Sections 2.1 or 2.2,
  49.189 +          Contributor must include a text file with the Source Code
  49.190 +          distribution titled "LEGAL" which describes the claim and the
  49.191 +          party making the claim in sufficient detail that a recipient will
  49.192 +          know whom to contact. If Contributor obtains such knowledge after
  49.193 +          the Modification is made available as described in Section 3.2,
  49.194 +          Contributor shall promptly modify the LEGAL file in all copies
  49.195 +          Contributor makes available thereafter and shall take other steps
  49.196 +          (such as notifying appropriate mailing lists or newsgroups)
  49.197 +          reasonably calculated to inform those who received the Covered
  49.198 +          Code that new knowledge has been obtained.
  49.199 +
  49.200 +          (b) Contributor APIs.
  49.201 +          If Contributor's Modifications include an application programming
  49.202 +          interface and Contributor has knowledge of patent licenses which
  49.203 +          are reasonably necessary to implement that API, Contributor must
  49.204 +          also include this information in the LEGAL file.
  49.205 +
  49.206 +               (c)    Representations.
  49.207 +          Contributor represents that, except as disclosed pursuant to
  49.208 +          Section 3.4(a) above, Contributor believes that Contributor's
  49.209 +          Modifications are Contributor's original creation(s) and/or
  49.210 +          Contributor has sufficient rights to grant the rights conveyed by
  49.211 +          this License.
  49.212 +
  49.213 +     3.5. Required Notices.
  49.214 +     You must duplicate the notice in Exhibit A in each file of the Source
  49.215 +     Code.  If it is not possible to put such notice in a particular Source
  49.216 +     Code file due to its structure, then You must include such notice in a
  49.217 +     location (such as a relevant directory) where a user would be likely
  49.218 +     to look for such a notice.  If You created one or more Modification(s)
  49.219 +     You may add your name as a Contributor to the notice described in
  49.220 +     Exhibit A.  You must also duplicate this License in any documentation
  49.221 +     for the Source Code where You describe recipients' rights or ownership
  49.222 +     rights relating to Covered Code.  You may choose to offer, and to
  49.223 +     charge a fee for, warranty, support, indemnity or liability
  49.224 +     obligations to one or more recipients of Covered Code. However, You
  49.225 +     may do so only on Your own behalf, and not on behalf of the Initial
  49.226 +     Developer or any Contributor. You must make it absolutely clear than
  49.227 +     any such warranty, support, indemnity or liability obligation is
  49.228 +     offered by You alone, and You hereby agree to indemnify the Initial
  49.229 +     Developer and every Contributor for any liability incurred by the
  49.230 +     Initial Developer or such Contributor as a result of warranty,
  49.231 +     support, indemnity or liability terms You offer.
  49.232 +
  49.233 +     3.6. Distribution of Executable Versions.
  49.234 +     You may distribute Covered Code in Executable form only if the
  49.235 +     requirements of Section 3.1-3.5 have been met for that Covered Code,
  49.236 +     and if You include a notice stating that the Source Code version of
  49.237 +     the Covered Code is available under the terms of this License,
  49.238 +     including a description of how and where You have fulfilled the
  49.239 +     obligations of Section 3.2. The notice must be conspicuously included
  49.240 +     in any notice in an Executable version, related documentation or
  49.241 +     collateral in which You describe recipients' rights relating to the
  49.242 +     Covered Code. You may distribute the Executable version of Covered
  49.243 +     Code or ownership rights under a license of Your choice, which may
  49.244 +     contain terms different from this License, provided that You are in
  49.245 +     compliance with the terms of this License and that the license for the
  49.246 +     Executable version does not attempt to limit or alter the recipient's
  49.247 +     rights in the Source Code version from the rights set forth in this
  49.248 +     License. If You distribute the Executable version under a different
  49.249 +     license You must make it absolutely clear that any terms which differ
  49.250 +     from this License are offered by You alone, not by the Initial
  49.251 +     Developer or any Contributor. You hereby agree to indemnify the
  49.252 +     Initial Developer and every Contributor for any liability incurred by
  49.253 +     the Initial Developer or such Contributor as a result of any such
  49.254 +     terms You offer.
  49.255 +
  49.256 +     3.7. Larger Works.
  49.257 +     You may create a Larger Work by combining Covered Code with other code
  49.258 +     not governed by the terms of this License and distribute the Larger
  49.259 +     Work as a single product. In such a case, You must make sure the
  49.260 +     requirements of this License are fulfilled for the Covered Code.
  49.261 +
  49.262 +4. Inability to Comply Due to Statute or Regulation.
  49.263 +
  49.264 +     If it is impossible for You to comply with any of the terms of this
  49.265 +     License with respect to some or all of the Covered Code due to
  49.266 +     statute, judicial order, or regulation then You must: (a) comply with
  49.267 +     the terms of this License to the maximum extent possible; and (b)
  49.268 +     describe the limitations and the code they affect. Such description
  49.269 +     must be included in the LEGAL file described in Section 3.4 and must
  49.270 +     be included with all distributions of the Source Code. Except to the
  49.271 +     extent prohibited by statute or regulation, such description must be
  49.272 +     sufficiently detailed for a recipient of ordinary skill to be able to
  49.273 +     understand it.
  49.274 +
  49.275 +5. Application of this License.
  49.276 +
  49.277 +     This License applies to code to which the Initial Developer has
  49.278 +     attached the notice in Exhibit A and to related Covered Code.
  49.279 +
  49.280 +6. Versions of the License.
  49.281 +
  49.282 +     6.1. New Versions.
  49.283 +     Netscape Communications Corporation ("Netscape") may publish revised
  49.284 +     and/or new versions of the License from time to time. Each version
  49.285 +     will be given a distinguishing version number.
  49.286 +
  49.287 +     6.2. Effect of New Versions.
  49.288 +     Once Covered Code has been published under a particular version of the
  49.289 +     License, You may always continue to use it under the terms of that
  49.290 +     version. You may also choose to use such Covered Code under the terms
  49.291 +     of any subsequent version of the License published by Netscape. No one
  49.292 +     other than Netscape has the right to modify the terms applicable to
  49.293 +     Covered Code created under this License.
  49.294 +
  49.295 +     6.3. Derivative Works.
  49.296 +     If You create or use a modified version of this License (which you may
  49.297 +     only do in order to apply it to code which is not already Covered Code
  49.298 +     governed by this License), You must (a) rename Your license so that
  49.299 +     the phrases "Mozilla", "MOZILLAPL", "MOZPL", "Netscape",
  49.300 +     "MPL", "NPL" or any confusingly similar phrase do not appear in your
  49.301 +     license (except to note that your license differs from this License)
  49.302 +     and (b) otherwise make it clear that Your version of the license
  49.303 +     contains terms which differ from the Mozilla Public License and
  49.304 +     Netscape Public License. (Filling in the name of the Initial
  49.305 +     Developer, Original Code or Contributor in the notice described in
  49.306 +     Exhibit A shall not of themselves be deemed to be modifications of
  49.307 +     this License.)
  49.308 +
  49.309 +7. DISCLAIMER OF WARRANTY.
  49.310 +
  49.311 +     COVERED CODE IS PROVIDED UNDER THIS LICENSE ON AN "AS IS" BASIS,
  49.312 +     WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
  49.313 +     WITHOUT LIMITATION, WARRANTIES THAT THE COVERED CODE IS FREE OF
  49.314 +     DEFECTS, MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE OR NON-INFRINGING.
  49.315 +     THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE COVERED CODE
  49.316 +     IS WITH YOU. SHOULD ANY COVERED CODE PROVE DEFECTIVE IN ANY RESPECT,
  49.317 +     YOU (NOT THE INITIAL DEVELOPER OR ANY OTHER CONTRIBUTOR) ASSUME THE
  49.318 +     COST OF ANY NECESSARY SERVICING, REPAIR OR CORRECTION. THIS DISCLAIMER
  49.319 +     OF WARRANTY CONSTITUTES AN ESSENTIAL PART OF THIS LICENSE. NO USE OF
  49.320 +     ANY COVERED CODE IS AUTHORIZED HEREUNDER EXCEPT UNDER THIS DISCLAIMER.
  49.321 +
  49.322 +8. TERMINATION.
  49.323 +
  49.324 +     8.1.  This License and the rights granted hereunder will terminate
  49.325 +     automatically if You fail to comply with terms herein and fail to cure
  49.326 +     such breach within 30 days of becoming aware of the breach. All
  49.327 +     sublicenses to the Covered Code which are properly granted shall
  49.328 +     survive any termination of this License. Provisions which, by their
  49.329 +     nature, must remain in effect beyond the termination of this License
  49.330 +     shall survive.
  49.331 +
  49.332 +     8.2.  If You initiate litigation by asserting a patent infringement
  49.333 +     claim (excluding declatory judgment actions) against Initial Developer
  49.334 +     or a Contributor (the Initial Developer or Contributor against whom
  49.335 +     You file such action is referred to as "Participant")  alleging that:
  49.336 +
  49.337 +     (a)  such Participant's Contributor Version directly or indirectly
  49.338 +     infringes any patent, then any and all rights granted by such
  49.339 +     Participant to You under Sections 2.1 and/or 2.2 of this License
  49.340 +     shall, upon 60 days notice from Participant terminate prospectively,
  49.341 +     unless if within 60 days after receipt of notice You either: (i)
  49.342 +     agree in writing to pay Participant a mutually agreeable reasonable
  49.343 +     royalty for Your past and future use of Modifications made by such
  49.344 +     Participant, or (ii) withdraw Your litigation claim with respect to
  49.345 +     the Contributor Version against such Participant.  If within 60 days
  49.346 +     of notice, a reasonable royalty and payment arrangement are not
  49.347 +     mutually agreed upon in writing by the parties or the litigation claim
  49.348 +     is not withdrawn, the rights granted by Participant to You under
  49.349 +     Sections 2.1 and/or 2.2 automatically terminate at the expiration of
  49.350 +     the 60 day notice period specified above.
  49.351 +
  49.352 +     (b)  any software, hardware, or device, other than such Participant's
  49.353 +     Contributor Version, directly or indirectly infringes any patent, then
  49.354 +     any rights granted to You by such Participant under Sections 2.1(b)
  49.355 +     and 2.2(b) are revoked effective as of the date You first made, used,
  49.356 +     sold, distributed, or had made, Modifications made by that
  49.357 +     Participant.
  49.358 +
  49.359 +     8.3.  If You assert a patent infringement claim against Participant
  49.360 +     alleging that such Participant's Contributor Version directly or
  49.361 +     indirectly infringes any patent where such claim is resolved (such as
  49.362 +     by license or settlement) prior to the initiation of patent
  49.363 +     infringement litigation, then the reasonable value of the licenses
  49.364 +     granted by such Participant under Sections 2.1 or 2.2 shall be taken
  49.365 +     into account in determining the amount or value of any payment or
  49.366 +     license.
  49.367 +
  49.368 +     8.4.  In the event of termination under Sections 8.1 or 8.2 above,
  49.369 +     all end user license agreements (excluding distributors and resellers)
  49.370 +     which have been validly granted by You or any distributor hereunder
  49.371 +     prior to termination shall survive termination.
  49.372 +
  49.373 +9. LIMITATION OF LIABILITY.
  49.374 +
  49.375 +     UNDER NO CIRCUMSTANCES AND UNDER NO LEGAL THEORY, WHETHER TORT
  49.376 +     (INCLUDING NEGLIGENCE), CONTRACT, OR OTHERWISE, SHALL YOU, THE INITIAL
  49.377 +     DEVELOPER, ANY OTHER CONTRIBUTOR, OR ANY DISTRIBUTOR OF COVERED CODE,
  49.378 +     OR ANY SUPPLIER OF ANY OF SUCH PARTIES, BE LIABLE TO ANY PERSON FOR
  49.379 +     ANY INDIRECT, SPECIAL, INCIDENTAL, OR CONSEQUENTIAL DAMAGES OF ANY
  49.380 +     CHARACTER INCLUDING, WITHOUT LIMITATION, DAMAGES FOR LOSS OF GOODWILL,
  49.381 +     WORK STOPPAGE, COMPUTER FAILURE OR MALFUNCTION, OR ANY AND ALL OTHER
  49.382 +     COMMERCIAL DAMAGES OR LOSSES, EVEN IF SUCH PARTY SHALL HAVE BEEN
  49.383 +     INFORMED OF THE POSSIBILITY OF SUCH DAMAGES. THIS LIMITATION OF
  49.384 +     LIABILITY SHALL NOT APPLY TO LIABILITY FOR DEATH OR PERSONAL INJURY
  49.385 +     RESULTING FROM SUCH PARTY'S NEGLIGENCE TO THE EXTENT APPLICABLE LAW
  49.386 +     PROHIBITS SUCH LIMITATION. SOME JURISDICTIONS DO NOT ALLOW THE
  49.387 +     EXCLUSION OR LIMITATION OF INCIDENTAL OR CONSEQUENTIAL DAMAGES, SO
  49.388 +     THIS EXCLUSION AND LIMITATION MAY NOT APPLY TO YOU.
  49.389 +
  49.390 +10. U.S. GOVERNMENT END USERS.
  49.391 +
  49.392 +     The Covered Code is a "commercial item," as that term is defined in
  49.393 +     48 C.F.R. 2.101 (Oct. 1995), consisting of "commercial computer
  49.394 +     software" and "commercial computer software documentation," as such
  49.395 +     terms are used in 48 C.F.R. 12.212 (Sept. 1995). Consistent with 48
  49.396 +     C.F.R. 12.212 and 48 C.F.R. 227.7202-1 through 227.7202-4 (June 1995),
  49.397 +     all U.S. Government End Users acquire Covered Code with only those
  49.398 +     rights set forth herein.
  49.399 +
  49.400 +11. MISCELLANEOUS.
  49.401 +
  49.402 +     This License represents the complete agreement concerning subject
  49.403 +     matter hereof. If any provision of this License is held to be
  49.404 +     unenforceable, such provision shall be reformed only to the extent
  49.405 +     necessary to make it enforceable. This License shall be governed by
  49.406 +     California law provisions (except to the extent applicable law, if
  49.407 +     any, provides otherwise), excluding its conflict-of-law provisions.
  49.408 +     With respect to disputes in which at least one party is a citizen of,
  49.409 +     or an entity chartered or registered to do business in the United
  49.410 +     States of America, any litigation relating to this License shall be
  49.411 +     subject to the jurisdiction of the Federal Courts of the Northern
  49.412 +     District of California, with venue lying in Santa Clara County,
  49.413 +     California, with the losing party responsible for costs, including
  49.414 +     without limitation, court costs and reasonable attorneys' fees and
  49.415 +     expenses. The application of the United Nations Convention on
  49.416 +     Contracts for the International Sale of Goods is expressly excluded.
  49.417 +     Any law or regulation which provides that the language of a contract
  49.418 +     shall be construed against the drafter shall not apply to this
  49.419 +     License.
  49.420 +
  49.421 +12. RESPONSIBILITY FOR CLAIMS.
  49.422 +
  49.423 +     As between Initial Developer and the Contributors, each party is
  49.424 +     responsible for claims and damages arising, directly or indirectly,
  49.425 +     out of its utilization of rights under this License and You agree to
  49.426 +     work with Initial Developer and Contributors to distribute such
  49.427 +     responsibility on an equitable basis. Nothing herein is intended or
  49.428 +     shall be deemed to constitute any admission of liability.
  49.429 +
  49.430 +13. MULTIPLE-LICENSED CODE.
  49.431 +
  49.432 +     Initial Developer may designate portions of the Covered Code as
  49.433 +     "Multiple-Licensed".  "Multiple-Licensed" means that the Initial
  49.434 +     Developer permits you to utilize portions of the Covered Code under
  49.435 +     Your choice of the NPL or the alternative licenses, if any, specified
  49.436 +     by the Initial Developer in the file described in Exhibit A.
  49.437 +
  49.438 +EXHIBIT A -Mozilla Public License.
  49.439 +
  49.440 +     ``The contents of this file are subject to the Mozilla Public License
  49.441 +     Version 1.1 (the "License"); you may not use this file except in
  49.442 +     compliance with the License. You may obtain a copy of the License at
  49.443 +     http://www.mozilla.org/MPL/
  49.444 +
  49.445 +     Software distributed under the License is distributed on an "AS IS"
  49.446 +     basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the
  49.447 +     License for the specific language governing rights and limitations
  49.448 +     under the License.
  49.449 +
  49.450 +     The Original Code is ______________________________________.
  49.451 +
  49.452 +     The Initial Developer of the Original Code is ________________________.
  49.453 +     Portions created by ______________________ are Copyright (C) ______
  49.454 +     _______________________. All Rights Reserved.
  49.455 +
  49.456 +     Contributor(s): ______________________________________.
  49.457 +
  49.458 +     Alternatively, the contents of this file may be used under the terms
  49.459 +     of the _____ license (the  "[___] License"), in which case the
  49.460 +     provisions of [______] License are applicable instead of those
  49.461 +     above.  If you wish to allow use of your version of this file only
  49.462 +     under the terms of the [____] License and not to allow others to use
  49.463 +     your version of this file under the MPL, indicate your decision by
  49.464 +     deleting  the provisions above and replace  them with the notice and
  49.465 +     other provisions required by the [___] License.  If you do not delete
  49.466 +     the provisions above, a recipient may use your version of this file
  49.467 +     under either the MPL or the [___] License."
  49.468 +
  49.469 +     [NOTE: The text of this Exhibit A may differ slightly from the text of
  49.470 +     the notices in the Source Code files of the Original Code. You should
  49.471 +     use the text of this Exhibit A rather than the text found in the
  49.472 +     Original Code Source Code for Your Modifications.]
  49.473 +
    50.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
    50.2 +++ b/Licenses/WinRing0.License.txt	Tue Jan 26 22:37:48 2010 +0000
    50.3 @@ -0,0 +1,21 @@
    50.4 +Copyright (c) 2007-2009 OpenLibSys.org. All rights reserved.
    50.5 +
    50.6 +Redistribution and use in source and binary forms, with or without
    50.7 +modification, are permitted provided that the following conditions
    50.8 +are met:
    50.9 +1. Redistributions of source code must retain the above copyright
   50.10 +   notice, this list of conditions and the following disclaimer.
   50.11 +2. Redistributions in binary form must reproduce the above copyright
   50.12 +   notice, this list of conditions and the following disclaimer in the
   50.13 +   documentation and/or other materials provided with the distribution.
   50.14 +
   50.15 +THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
   50.16 +IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
   50.17 +OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
   50.18 +IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
   50.19 +INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
   50.20 +NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
   50.21 +DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
   50.22 +THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
   50.23 +(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
   50.24 +THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
    51.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
    51.2 +++ b/OpenHardwareMonitor.csproj	Tue Jan 26 22:37:48 2010 +0000
    51.3 @@ -0,0 +1,148 @@
    51.4 +<?xml version="1.0" encoding="utf-8"?>
    51.5 +<Project DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003" ToolsVersion="3.5">
    51.6 +  <PropertyGroup>
    51.7 +    <Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
    51.8 +    <Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
    51.9 +    <ProjectGuid>{F5E0C1F7-9E9B-46F2-AC88-8C9C1C923880}</ProjectGuid>
   51.10 +    <ProductVersion>9.0.21022</ProductVersion>
   51.11 +    <SchemaVersion>2.0</SchemaVersion>
   51.12 +    <OutputType>WinExe</OutputType>
   51.13 +    <NoStandardLibraries>false</NoStandardLibraries>
   51.14 +    <AssemblyName>OpenHardwareMonitor</AssemblyName>
   51.15 +    <TargetFrameworkVersion>v2.0</TargetFrameworkVersion>
   51.16 +    <FileAlignment>512</FileAlignment>
   51.17 +    <RootNamespace>OpenHardwareMonitor</RootNamespace>
   51.18 +    <ApplicationIcon>Resources\icon.ico</ApplicationIcon>
   51.19 +  </PropertyGroup>
   51.20 +  <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
   51.21 +    <DebugSymbols>true</DebugSymbols>
   51.22 +    <DebugType>full</DebugType>
   51.23 +    <Optimize>false</Optimize>
   51.24 +    <OutputPath>Bin\Debug\</OutputPath>
   51.25 +    <DefineConstants>TRACE;DEBUG</DefineConstants>
   51.26 +    <ErrorReport>prompt</ErrorReport>
   51.27 +    <WarningLevel>4</WarningLevel>
   51.28 +    <UseVSHostingProcess>false</UseVSHostingProcess>
   51.29 +  </PropertyGroup>
   51.30 +  <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
   51.31 +    <DebugType>none</DebugType>
   51.32 +    <Optimize>true</Optimize>
   51.33 +    <OutputPath>Bin\Release\</OutputPath>
   51.34 +    <DefineConstants>TRACE</DefineConstants>
   51.35 +    <ErrorReport>prompt</ErrorReport>
   51.36 +    <WarningLevel>4</WarningLevel>
   51.37 +    <UseVSHostingProcess>false</UseVSHostingProcess>
   51.38 +  </PropertyGroup>
   51.39 +  <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Merge|AnyCPU' ">
   51.40 +    <OutputPath>bin\Merge\</OutputPath>
   51.41 +    <DefineConstants>TRACE</DefineConstants>
   51.42 +    <Optimize>true</Optimize>
   51.43 +    <PlatformTarget>AnyCPU</PlatformTarget>
   51.44 +    <UseVSHostingProcess>false</UseVSHostingProcess>
   51.45 +    <ErrorReport>prompt</ErrorReport>
   51.46 +    <OutputType>Module</OutputType>
   51.47 +  </PropertyGroup>
   51.48 +  <ItemGroup>
   51.49 +    <Reference Include="Aga.Controls, Version=1.7.0.0, Culture=neutral, PublicKeyToken=fcc90fbf924463a3, processorArchitecture=MSIL">
   51.50 +      <SpecificVersion>False</SpecificVersion>
   51.51 +      <HintPath>External\Aga.Controls.dll</HintPath>
   51.52 +    </Reference>
   51.53 +    <Reference Include="System" />
   51.54 +    <Reference Include="System.Configuration" />
   51.55 +    <Reference Include="System.Data" />
   51.56 +    <Reference Include="System.Drawing" />
   51.57 +    <Reference Include="System.Management" />
   51.58 +    <Reference Include="System.Windows.Forms" />
   51.59 +    <Reference Include="System.Xml" />
   51.60 +  </ItemGroup>
   51.61 +  <ItemGroup>
   51.62 +    <Compile Include="GUI\TypeNode.cs" />
   51.63 +    <Compile Include="Hardware\CPU\AMD10CPU.cs" />
   51.64 +    <Compile Include="Hardware\HDD\HDD.cs" />
   51.65 +    <Compile Include="Hardware\HDD\HDDGroup.cs" />
   51.66 +    <Compile Include="Hardware\HDD\SMART.cs" />
   51.67 +    <Compile Include="Hardware\LPC\Chip.cs" />
   51.68 +    <Compile Include="Hardware\SMBIOS\SMBIOSGroup.cs" />
   51.69 +    <Compile Include="Hardware\LPC\W83627DHG.cs" />
   51.70 +    <Compile Include="Hardware\ReportWriter.cs" />
   51.71 +    <Compile Include="Properties\AssemblyInfo.cs" />
   51.72 +    <Compile Include="GUI\AboutBox.cs">
   51.73 +      <SubType>Form</SubType>
   51.74 +    </Compile>
   51.75 +    <Compile Include="GUI\AboutBox.Designer.cs">
   51.76 +      <DependentUpon>AboutBox.cs</DependentUpon>
   51.77 +    </Compile>
   51.78 +    <Compile Include="Hardware\ATI\ADL.cs" />
   51.79 +    <Compile Include="Hardware\ATI\ATIGroup.cs" />
   51.80 +    <Compile Include="Hardware\ATI\ATIGPU.cs" />
   51.81 +    <Compile Include="Utilities\Configuration.cs" />
   51.82 +    <Compile Include="Utilities\CrashReport.cs" />
   51.83 +    <Compile Include="Utilities\EmbeddedResources.cs" />
   51.84 +    <Compile Include="GUI\HardwareNode.cs" />
   51.85 +    <Compile Include="Hardware\IGroup.cs" />
   51.86 +    <Compile Include="Hardware\IHardware.cs" />
   51.87 +    <Compile Include="Hardware\ISensor.cs" />
   51.88 +    <Compile Include="Hardware\LPC\IT87.cs" />
   51.89 +    <Compile Include="Hardware\LPC\LPCGroup.cs" />
   51.90 +    <Compile Include="GUI\MainForm.cs">
   51.91 +      <SubType>Form</SubType>
   51.92 +    </Compile>
   51.93 +    <Compile Include="GUI\MainForm.Designer.cs">
   51.94 +      <DependentUpon>MainForm.cs</DependentUpon>
   51.95 +    </Compile>
   51.96 +    <Compile Include="Hardware\Nvidia\NVAPI.cs" />
   51.97 +    <Compile Include="Hardware\Nvidia\NvidiaGPU.cs" />
   51.98 +    <Compile Include="Hardware\Nvidia\NvidiaGroup.cs" />
   51.99 +    <Compile Include="Utilities\PInvokeDelegateFactory.cs" />
  51.100 +    <Compile Include="GUI\PlotPanel.cs">
  51.101 +      <SubType>UserControl</SubType>
  51.102 +    </Compile>
  51.103 +    <Compile Include="GUI\PlotPanel.Designer.cs">
  51.104 +      <DependentUpon>PlotPanel.cs</DependentUpon>
  51.105 +    </Compile>
  51.106 +    <Compile Include="Program.cs" />
  51.107 +    <Compile Include="Hardware\CPU\IntelCPU.cs" />
  51.108 +    <Compile Include="Hardware\CPU\CPUGroup.cs" />
  51.109 +    <Compile Include="Hardware\Sensor.cs" />
  51.110 +    <Compile Include="GUI\SensorNode.cs" />
  51.111 +    <Compile Include="Hardware\TBalancer\TBalancer.cs" />
  51.112 +    <Compile Include="Hardware\TBalancer\TBalancerGroup.cs" />
  51.113 +    <Compile Include="Hardware\WinRing0.cs" />
  51.114 +  </ItemGroup>
  51.115 +  <ItemGroup>
  51.116 +    <EmbeddedResource Include="GUI\AboutBox.resx">
  51.117 +      <DependentUpon>AboutBox.cs</DependentUpon>
  51.118 +    </EmbeddedResource>
  51.119 +    <EmbeddedResource Include="GUI\MainForm.resx">
  51.120 +      <DependentUpon>MainForm.cs</DependentUpon>
  51.121 +    </EmbeddedResource>
  51.122 +    <EmbeddedResource Include="GUI\PlotPanel.resx">
  51.123 +      <DependentUpon>PlotPanel.cs</DependentUpon>
  51.124 +    </EmbeddedResource>
  51.125 +    <EmbeddedResource Include="Resources\ati.png">
  51.126 +    </EmbeddedResource>
  51.127 +    <EmbeddedResource Include="Resources\bigng.png" />
  51.128 +    <EmbeddedResource Include="Resources\clock.png" />
  51.129 +    <EmbeddedResource Include="Resources\computer.png" />
  51.130 +    <EmbeddedResource Include="Resources\cpu.png" />
  51.131 +    <EmbeddedResource Include="Resources\fan.png" />
  51.132 +    <EmbeddedResource Include="Resources\temperature.png" />
  51.133 +  </ItemGroup>
  51.134 +  <ItemGroup>
  51.135 +    <EmbeddedResource Include="Resources\chip.png" />
  51.136 +    <EmbeddedResource Include="Resources\hdd.png" />
  51.137 +    <Content Include="Resources\icon.ico" />
  51.138 +    <EmbeddedResource Include="Resources\voltage.png" />
  51.139 +    <EmbeddedResource Include="Resources\nvidia.png" />
  51.140 +  </ItemGroup>
  51.141 +  <Import Project="$(MSBuildBinPath)\Microsoft.CSharp.targets" />
  51.142 +  <ProjectExtensions>
  51.143 +    <VisualStudio AllowExistingFolder="true" />
  51.144 +  </ProjectExtensions>
  51.145 +  <PropertyGroup>
  51.146 +    <PreBuildEvent>
  51.147 +    </PreBuildEvent>
  51.148 +    <PostBuildEvent>copy "$(ProjectDir)External\*.*" "$(TargetDir)"
  51.149 +copy "$(ProjectDir)Licenses\*.*" "$(TargetDir)"</PostBuildEvent>
  51.150 +  </PropertyGroup>
  51.151 +</Project>
  51.152 \ No newline at end of file
    52.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
    52.2 +++ b/OpenHardwareMonitor.sln	Tue Jan 26 22:37:48 2010 +0000
    52.3 @@ -0,0 +1,41 @@
    52.4 +
    52.5 +Microsoft Visual Studio Solution File, Format Version 10.00
    52.6 +# Visual Studio 2008
    52.7 +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "OpenHardwareMonitor", "OpenHardwareMonitor.csproj", "{F5E0C1F7-9E9B-46F2-AC88-8C9C1C923880}"
    52.8 +EndProject
    52.9 +Global
   52.10 +	GlobalSection(SolutionConfigurationPlatforms) = preSolution
   52.11 +		Debug|Any CPU = Debug|Any CPU
   52.12 +		Release|Any CPU = Release|Any CPU
   52.13 +	EndGlobalSection
   52.14 +	GlobalSection(ProjectConfigurationPlatforms) = postSolution
   52.15 +		{F5E0C1F7-9E9B-46F2-AC88-8C9C1C923880}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
   52.16 +		{F5E0C1F7-9E9B-46F2-AC88-8C9C1C923880}.Debug|Any CPU.Build.0 = Debug|Any CPU
   52.17 +		{F5E0C1F7-9E9B-46F2-AC88-8C9C1C923880}.Release|Any CPU.ActiveCfg = Release|Any CPU
   52.18 +		{F5E0C1F7-9E9B-46F2-AC88-8C9C1C923880}.Release|Any CPU.Build.0 = Release|Any CPU
   52.19 +	EndGlobalSection
   52.20 +	GlobalSection(SolutionProperties) = preSolution
   52.21 +		HideSolutionNode = FALSE
   52.22 +	EndGlobalSection
   52.23 +	GlobalSection(MonoDevelopProperties) = preSolution
   52.24 +		StartupItem = OpenHardwareMonitor.csproj
   52.25 +		Policies = $0
   52.26 +		$0.DotNetNamingPolicy = $1
   52.27 +		$1.DirectoryNamespaceAssociation = None
   52.28 +		$1.ResourceNamePolicy = FileFormatDefault
   52.29 +		$0.TextStylePolicy = $2
   52.30 +		$2.FileWidth = 120
   52.31 +		$2.TabWidth = 2
   52.32 +		$2.NoTabsAfterNonTabs = True
   52.33 +		$2.inheritsSet = VisualStudio
   52.34 +		$2.inheritsScope = text/plain
   52.35 +		$2.scope = text/plain
   52.36 +		$0.TextStylePolicy = $3
   52.37 +		$3.inheritsSet = null
   52.38 +		$3.scope = text/x-csharp
   52.39 +		$0.CSharpFormattingPolicy = $4
   52.40 +		$4.inheritsSet = Mono
   52.41 +		$4.inheritsScope = text/x-csharp
   52.42 +		$4.scope = text/x-csharp
   52.43 +	EndGlobalSection
   52.44 +EndGlobal
    53.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
    53.2 +++ b/Program.cs	Tue Jan 26 22:37:48 2010 +0000
    53.3 @@ -0,0 +1,62 @@
    53.4 +/*
    53.5 +  
    53.6 +  Version: MPL 1.1/GPL 2.0/LGPL 2.1
    53.7 +
    53.8 +  The contents of this file are subject to the Mozilla Public License Version
    53.9 +  1.1 (the "License"); you may not use this file except in compliance with
   53.10 +  the License. You may obtain a copy of the License at
   53.11 + 
   53.12 +  http://www.mozilla.org/MPL/
   53.13 +
   53.14 +  Software distributed under the License is distributed on an "AS IS" basis,
   53.15 +  WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
   53.16 +  for the specific language governing rights and limitations under the License.
   53.17 +
   53.18 +  The Original Code is the Open Hardware Monitor code.
   53.19 +
   53.20 +  The Initial Developer of the Original Code is 
   53.21 +  Michael Möller <m.moeller@gmx.ch>.
   53.22 +  Portions created by the Initial Developer are Copyright (C) 2009-2010
   53.23 +  the Initial Developer. All Rights Reserved.
   53.24 +
   53.25 +  Contributor(s):
   53.26 +
   53.27 +  Alternatively, the contents of this file may be used under the terms of
   53.28 +  either the GNU General Public License Version 2 or later (the "GPL"), or
   53.29 +  the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
   53.30 +  in which case the provisions of the GPL or the LGPL are applicable instead
   53.31 +  of those above. If you wish to allow use of your version of this file only
   53.32 +  under the terms of either the GPL or the LGPL, and not to allow others to
   53.33 +  use your version of this file under the terms of the MPL, indicate your
   53.34 +  decision by deleting the provisions above and replace them with the notice
   53.35 +  and other provisions required by the GPL or the LGPL. If you do not delete
   53.36 +  the provisions above, a recipient may use your version of this file under
   53.37 +  the terms of any one of the MPL, the GPL or the LGPL.
   53.38 + 
   53.39 +*/
   53.40 +
   53.41 +using System;
   53.42 +using System.Windows.Forms;
   53.43 +
   53.44 +
   53.45 +namespace OpenHardwareMonitor {
   53.46 +  static class Program {
   53.47 +    /// <summary>
   53.48 +    /// The main entry point for the application.
   53.49 +    /// </summary>
   53.50 +    [STAThread]
   53.51 +    static void Main() {
   53.52 +      #if !DEBUG
   53.53 +      try {
   53.54 +      #endif
   53.55 +        Application.EnableVisualStyles();
   53.56 +        Application.SetCompatibleTextRenderingDefault(false);
   53.57 +        Application.Run(new GUI.MainForm());
   53.58 +      #if !DEBUG
   53.59 +      } catch (Exception e) {
   53.60 +        Utilities.CrashReport.Save(e);
   53.61 +      }
   53.62 +      #endif
   53.63 +    }
   53.64 +  }
   53.65 +}
    54.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
    54.2 +++ b/Properties/AssemblyInfo.cs	Tue Jan 26 22:37:48 2010 +0000
    54.3 @@ -0,0 +1,36 @@
    54.4 +using System.Reflection;
    54.5 +using System.Runtime.CompilerServices;
    54.6 +using System.Runtime.InteropServices;
    54.7 +
    54.8 +// General Information about an assembly is controlled through the following 
    54.9 +// set of attributes. Change these attribute values to modify the information
   54.10 +// associated with an assembly.
   54.11 +[assembly: AssemblyTitle("Open Hardware Monitor")]
   54.12 +[assembly: AssemblyDescription("")]
   54.13 +[assembly: AssemblyConfiguration("")]
   54.14 +[assembly: AssemblyCompany("")]
   54.15 +[assembly: AssemblyProduct("Open Hardware Monitor")]
   54.16 +[assembly: AssemblyCopyright("Copyright © 2009-2010 Michael Möller")]
   54.17 +[assembly: AssemblyTrademark("")]
   54.18 +[assembly: AssemblyCulture("")]
   54.19 +
   54.20 +// Setting ComVisible to false makes the types in this assembly not visible 
   54.21 +// to COM components.  If you need to access a type in this assembly from 
   54.22 +// COM, set the ComVisible attribute to true on that type.
   54.23 +[assembly: ComVisible(false)]
   54.24 +
   54.25 +// The following GUID is for the ID of the typelib if this project is exposed to COM
   54.26 +[assembly: Guid("f7a1c873-0bec-4762-8707-2edce3a6444d")]
   54.27 +
   54.28 +// Version information for an assembly consists of the following four values:
   54.29 +//
   54.30 +//      Major Version
   54.31 +//      Minor Version 
   54.32 +//      Build Number
   54.33 +//      Revision
   54.34 +//
   54.35 +// You can specify all the values or you can default the Build and Revision Numbers 
   54.36 +// by using the '*' as shown below:
   54.37 +// [assembly: AssemblyVersion("1.0.*")]
   54.38 +[assembly: AssemblyVersion("0.1.0.0")]
   54.39 +[assembly: AssemblyFileVersion("0.1.0.0")]
    55.1 Binary file Resources/ati.png has changed
    56.1 Binary file Resources/bigng.png has changed
    57.1 Binary file Resources/chip.png has changed
    58.1 Binary file Resources/clock.png has changed
    59.1 Binary file Resources/computer.png has changed
    60.1 Binary file Resources/cpu.png has changed
    61.1 Binary file Resources/fan.png has changed
    62.1 Binary file Resources/hdd.png has changed
    63.1 Binary file Resources/icon.ico has changed
    64.1 Binary file Resources/icon.xcf has changed
    65.1 Binary file Resources/nvidia.png has changed
    66.1 Binary file Resources/temperature.png has changed
    67.1 Binary file Resources/voltage.png has changed
    68.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
    68.2 +++ b/Utilities/Configuration.cs	Tue Jan 26 22:37:48 2010 +0000
    68.3 @@ -0,0 +1,133 @@
    68.4 +/*
    68.5 +  
    68.6 +  Version: MPL 1.1/GPL 2.0/LGPL 2.1
    68.7 +
    68.8 +  The contents of this file are subject to the Mozilla Public License Version
    68.9 +  1.1 (the "License"); you may not use this file except in compliance with
   68.10 +  the License. You may obtain a copy of the License at
   68.11 + 
   68.12 +  http://www.mozilla.org/MPL/
   68.13 +
   68.14 +  Software distributed under the License is distributed on an "AS IS" basis,
   68.15 +  WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
   68.16 +  for the specific language governing rights and limitations under the License.
   68.17 +
   68.18 +  The Original Code is the Open Hardware Monitor code.
   68.19 +
   68.20 +  The Initial Developer of the Original Code is 
   68.21 +  Michael Möller <m.moeller@gmx.ch>.
   68.22 +  Portions created by the Initial Developer are Copyright (C) 2009-2010
   68.23 +  the Initial Developer. All Rights Reserved.
   68.24 +
   68.25 +  Contributor(s):
   68.26 +
   68.27 +  Alternatively, the contents of this file may be used under the terms of
   68.28 +  either the GNU General Public License Version 2 or later (the "GPL"), or
   68.29 +  the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
   68.30 +  in which case the provisions of the GPL or the LGPL are applicable instead
   68.31 +  of those above. If you wish to allow use of your version of this file only
   68.32 +  under the terms of either the GPL or the LGPL, and not to allow others to
   68.33 +  use your version of this file under the terms of the MPL, indicate your
   68.34 +  decision by deleting the provisions above and replace them with the notice
   68.35 +  and other provisions required by the GPL or the LGPL. If you do not delete
   68.36 +  the provisions above, a recipient may use your version of this file under
   68.37 +  the terms of any one of the MPL, the GPL or the LGPL.
   68.38 + 
   68.39 +*/
   68.40 +
   68.41 +using System;
   68.42 +using System.Collections.Generic;
   68.43 +using System.IO;
   68.44 +
   68.45 +namespace OpenHardwareMonitor.Utilities {
   68.46 +
   68.47 +  public sealed class Config {
   68.48 +    private static readonly Config instance = new Config();
   68.49 +
   68.50 +    private string fileName;
   68.51 +
   68.52 +    private System.Configuration.Configuration config;
   68.53 +
   68.54 +    private Config() {
   68.55 +      this.fileName = Path.ChangeExtension(
   68.56 +        System.Windows.Forms.Application.ExecutablePath, ".config");
   68.57 +      System.Configuration.ExeConfigurationFileMap fileMap = 
   68.58 +        new System.Configuration.ExeConfigurationFileMap();
   68.59 +      fileMap.ExeConfigFilename = fileName;        
   68.60 +      config = System.Configuration.ConfigurationManager.
   68.61 +        OpenMappedExeConfiguration(fileMap, 
   68.62 +        System.Configuration.ConfigurationUserLevel.None);
   68.63 +    }
   68.64 +
   68.65 +    ~Config() {
   68.66 +      string tempName = Path.ChangeExtension(fileName, ".tmp");
   68.67 +
   68.68 +      if (File.Exists(tempName))
   68.69 +        File.Delete(tempName);
   68.70 +      try {
   68.71 +        config.SaveAs(tempName);
   68.72 +        if (File.Exists(fileName) && File.Exists(tempName))
   68.73 +          File.Delete(fileName);
   68.74 +        File.Move(tempName, fileName);
   68.75 +      } catch (System.Configuration.ConfigurationErrorsException) { }
   68.76 +    }
   68.77 +
   68.78 +    public static Config Settings {
   68.79 +      get {
   68.80 +        return instance;
   68.81 +      }
   68.82 +    }
   68.83 +
   68.84 +    public string this[string name] {
   68.85 +      get {
   68.86 +        System.Configuration.KeyValueConfigurationElement element =
   68.87 +          config.AppSettings.Settings[name];
   68.88 +        if (element != null)
   68.89 +          return element.Value;
   68.90 +        else
   68.91 +          return null;
   68.92 +      }
   68.93 +      set {
   68.94 +        config.AppSettings.Settings.Remove(name);
   68.95 +        config.AppSettings.Settings.Add(name, value);
   68.96 +      }
   68.97 +    }
   68.98 +
   68.99 +    public static bool Contains(string name) {
  68.100 +      System.Configuration.KeyValueConfigurationElement element =
  68.101 +        instance.config.AppSettings.Settings[name];
  68.102 +      return element != null;
  68.103 +    }
  68.104 +
  68.105 +    public static void Set(string name, bool value) {
  68.106 +      instance[name] = value ? "true" : "false";
  68.107 +    }
  68.108 +
  68.109 +    public static bool Get(string name, bool value) {
  68.110 +      System.Configuration.KeyValueConfigurationElement element =
  68.111 +        instance.config.AppSettings.Settings[name];
  68.112 +      if (element == null)
  68.113 +        return value;
  68.114 +      else
  68.115 +        return element.Value == "true"; 
  68.116 +    }
  68.117 +
  68.118 +    public static void Set(string name, int value) {
  68.119 +      instance[name] = value.ToString();
  68.120 +    }
  68.121 +
  68.122 +    public static int Get(string name, int value) {
  68.123 +      System.Configuration.KeyValueConfigurationElement element =
  68.124 +        instance.config.AppSettings.Settings[name];
  68.125 +      if (element == null)
  68.126 +        return value;
  68.127 +      else {
  68.128 +        int parsedValue;
  68.129 +        if (int.TryParse(element.Value, out parsedValue))
  68.130 +          return parsedValue;
  68.131 +        else
  68.132 +          return value;
  68.133 +      }
  68.134 +    }
  68.135 +  }
  68.136 +}
    69.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
    69.2 +++ b/Utilities/CrashReport.cs	Tue Jan 26 22:37:48 2010 +0000
    69.3 @@ -0,0 +1,58 @@
    69.4 +/*
    69.5 +  
    69.6 +  Version: MPL 1.1/GPL 2.0/LGPL 2.1
    69.7 +
    69.8 +  The contents of this file are subject to the Mozilla Public License Version
    69.9 +  1.1 (the "License"); you may not use this file except in compliance with
   69.10 +  the License. You may obtain a copy of the License at
   69.11 + 
   69.12 +  http://www.mozilla.org/MPL/
   69.13 +
   69.14 +  Software distributed under the License is distributed on an "AS IS" basis,
   69.15 +  WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
   69.16 +  for the specific language governing rights and limitations under the License.
   69.17 +
   69.18 +  The Original Code is the Open Hardware Monitor code.
   69.19 +
   69.20 +  The Initial Developer of the Original Code is 
   69.21 +  Michael Möller <m.moeller@gmx.ch>.
   69.22 +  Portions created by the Initial Developer are Copyright (C) 2009-2010
   69.23 +  the Initial Developer. All Rights Reserved.
   69.24 +
   69.25 +  Contributor(s):
   69.26 +
   69.27 +  Alternatively, the contents of this file may be used under the terms of
   69.28 +  either the GNU General Public License Version 2 or later (the "GPL"), or
   69.29 +  the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
   69.30 +  in which case the provisions of the GPL or the LGPL are applicable instead
   69.31 +  of those above. If you wish to allow use of your version of this file only
   69.32 +  under the terms of either the GPL or the LGPL, and not to allow others to
   69.33 +  use your version of this file under the terms of the MPL, indicate your
   69.34 +  decision by deleting the provisions above and replace them with the notice
   69.35 +  and other provisions required by the GPL or the LGPL. If you do not delete
   69.36 +  the provisions above, a recipient may use your version of this file under
   69.37 +  the terms of any one of the MPL, the GPL or the LGPL.
   69.38 + 
   69.39 +*/
   69.40 +
   69.41 +using System;
   69.42 +using System.Collections.Generic;
   69.43 +using System.IO;
   69.44 +using System.Text;
   69.45 +
   69.46 +namespace OpenHardwareMonitor.Utilities {
   69.47 +  public class CrashReport {
   69.48 +
   69.49 +    public static void Save(Exception e) {
   69.50 +       using (TextWriter w =
   69.51 +          new StreamWriter("OpenHardwareMonitor.Crash.txt")) {
   69.52 +          w.WriteLine(e.ToString());
   69.53 +          w.WriteLine();
   69.54 +          if (e.InnerException != null) {
   69.55 +            w.WriteLine(e.InnerException.ToString());
   69.56 +            w.WriteLine();          
   69.57 +          }
   69.58 +        }
   69.59 +    }
   69.60 +  }
   69.61 +}
    70.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
    70.2 +++ b/Utilities/EmbeddedResources.cs	Tue Jan 26 22:37:48 2010 +0000
    70.3 @@ -0,0 +1,61 @@
    70.4 +/*
    70.5 +  
    70.6 +  Version: MPL 1.1/GPL 2.0/LGPL 2.1
    70.7 +
    70.8 +  The contents of this file are subject to the Mozilla Public License Version
    70.9 +  1.1 (the "License"); you may not use this file except in compliance with
   70.10 +  the License. You may obtain a copy of the License at
   70.11 + 
   70.12 +  http://www.mozilla.org/MPL/
   70.13 +
   70.14 +  Software distributed under the License is distributed on an "AS IS" basis,
   70.15 +  WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
   70.16 +  for the specific language governing rights and limitations under the License.
   70.17 +
   70.18 +  The Original Code is the Open Hardware Monitor code.
   70.19 +
   70.20 +  The Initial Developer of the Original Code is 
   70.21 +  Michael Möller <m.moeller@gmx.ch>.
   70.22 +  Portions created by the Initial Developer are Copyright (C) 2009-2010
   70.23 +  the Initial Developer. All Rights Reserved.
   70.24 +
   70.25 +  Contributor(s):
   70.26 +
   70.27 +  Alternatively, the contents of this file may be used under the terms of
   70.28 +  either the GNU General Public License Version 2 or later (the "GPL"), or
   70.29 +  the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
   70.30 +  in which case the provisions of the GPL or the LGPL are applicable instead
   70.31 +  of those above. If you wish to allow use of your version of this file only
   70.32 +  under the terms of either the GPL or the LGPL, and not to allow others to
   70.33 +  use your version of this file under the terms of the MPL, indicate your
   70.34 +  decision by deleting the provisions above and replace them with the notice
   70.35 +  and other provisions required by the GPL or the LGPL. If you do not delete
   70.36 +  the provisions above, a recipient may use your version of this file under
   70.37 +  the terms of any one of the MPL, the GPL or the LGPL.
   70.38 + 
   70.39 +*/
   70.40 +
   70.41 +using System;
   70.42 +using System.Collections.Generic;
   70.43 +using System.Drawing;
   70.44 +using System.Reflection;
   70.45 +
   70.46 +namespace OpenHardwareMonitor.Utilities {
   70.47 +  public class EmbeddedResources {
   70.48 +
   70.49 +    public static Image GetImage(string name) {
   70.50 +      name = "OpenHardwareMonitor.Resources." + name;
   70.51 +
   70.52 +      string[] names = 
   70.53 +        Assembly.GetExecutingAssembly().GetManifestResourceNames();
   70.54 +      for (int i = 0; i < names.Length; i++) {
   70.55 +        if (names[i].Replace('\\', '.') == name)
   70.56 +          return new Bitmap(Assembly.GetExecutingAssembly().
   70.57 +        GetManifestResourceStream(names[i]));
   70.58 +      }
   70.59 +
   70.60 +      return new Bitmap(1, 1);    
   70.61 +    }
   70.62 +         
   70.63 +  }
   70.64 +}
    71.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
    71.2 +++ b/Utilities/PInvokeDelegateFactory.cs	Tue Jan 26 22:37:48 2010 +0000
    71.3 @@ -0,0 +1,118 @@
    71.4 +/*
    71.5 +  
    71.6 +  Version: MPL 1.1/GPL 2.0/LGPL 2.1
    71.7 +
    71.8 +  The contents of this file are subject to the Mozilla Public License Version
    71.9 +  1.1 (the "License"); you may not use this file except in compliance with
   71.10 +  the License. You may obtain a copy of the License at
   71.11 + 
   71.12 +  http://www.mozilla.org/MPL/
   71.13 +
   71.14 +  Software distributed under the License is distributed on an "AS IS" basis,
   71.15 +  WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
   71.16 +  for the specific language governing rights and limitations under the License.
   71.17 +
   71.18 +  The Original Code is the Open Hardware Monitor code.
   71.19 +
   71.20 +  The Initial Developer of the Original Code is 
   71.21 +  Michael Möller <m.moeller@gmx.ch>.
   71.22 +  Portions created by the Initial Developer are Copyright (C) 2009-2010
   71.23 +  the Initial Developer. All Rights Reserved.
   71.24 +
   71.25 +  Contributor(s):
   71.26 +
   71.27 +  Alternatively, the contents of this file may be used under the terms of
   71.28 +  either the GNU General Public License Version 2 or later (the "GPL"), or
   71.29 +  the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
   71.30 +  in which case the provisions of the GPL or the LGPL are applicable instead
   71.31 +  of those above. If you wish to allow use of your version of this file only
   71.32 +  under the terms of either the GPL or the LGPL, and not to allow others to
   71.33 +  use your version of this file under the terms of the MPL, indicate your
   71.34 +  decision by deleting the provisions above and replace them with the notice
   71.35 +  and other provisions required by the GPL or the LGPL. If you do not delete
   71.36 +  the provisions above, a recipient may use your version of this file under
   71.37 +  the terms of any one of the MPL, the GPL or the LGPL.
   71.38 + 
   71.39 +*/
   71.40 +
   71.41 +using System;
   71.42 +using System.Collections.Generic;
   71.43 +using System.Reflection;
   71.44 +using System.Reflection.Emit;
   71.45 +using System.Runtime.InteropServices;
   71.46 +
   71.47 +namespace OpenHardwareMonitor.Hardware {
   71.48 +
   71.49 +  public sealed class PInvokeDelegateFactory {
   71.50 +
   71.51 +    private static AssemblyBuilder assemblyBuilder;
   71.52 +    private static ModuleBuilder moduleBuilder;
   71.53 +
   71.54 +    private static IDictionary<DllImportAttribute, Type> wrapperTypes =
   71.55 +      new Dictionary<DllImportAttribute, Type>();
   71.56 +
   71.57 +    static PInvokeDelegateFactory() {
   71.58 +
   71.59 +      AssemblyName assemblyName = new AssemblyName();
   71.60 +      assemblyName.Name = "PInvokeDelegateFactoryInternalAssembly";
   71.61 +
   71.62 +      assemblyBuilder =
   71.63 +        AppDomain.CurrentDomain.DefineDynamicAssembly(assemblyName,
   71.64 +        AssemblyBuilderAccess.Run);
   71.65 +
   71.66 +      moduleBuilder = assemblyBuilder.DefineDynamicModule(
   71.67 +        "PInvokeDelegateFactoryInternalModule");
   71.68 +    }
   71.69 +
   71.70 +    private PInvokeDelegateFactory() { }
   71.71 +
   71.72 +    public static void CreateDelegate<T>(DllImportAttribute dllImportAttribute,
   71.73 +      out T newDelegate) where T : class 
   71.74 +    {
   71.75 +      Type wrapperType;
   71.76 +      wrapperTypes.TryGetValue(dllImportAttribute, out wrapperType);
   71.77 +
   71.78 +      if (wrapperType == null) {
   71.79 +        wrapperType = CreateWrapperType(typeof(T), dllImportAttribute);
   71.80 +        wrapperTypes.Add(dllImportAttribute, wrapperType);
   71.81 +      }
   71.82 +
   71.83 +      newDelegate = Delegate.CreateDelegate(typeof(T), wrapperType,
   71.84 +        dllImportAttribute.EntryPoint) as T;
   71.85 +    }
   71.86 +
   71.87 +
   71.88 +    private static Type CreateWrapperType(Type delegateType,
   71.89 +      DllImportAttribute dllImportAttribute) {
   71.90 +
   71.91 +      TypeBuilder typeBuilder = moduleBuilder.DefineType(
   71.92 +        "PInvokeDelegateFactoryInternalWrapperType" + wrapperTypes.Count);
   71.93 +
   71.94 +      MethodInfo methodInfo = delegateType.GetMethod("Invoke");
   71.95 +
   71.96 +      ParameterInfo[] parameterInfos = methodInfo.GetParameters();
   71.97 +      int parameterCount = parameterInfos.GetLength(0);
   71.98 +
   71.99 +      Type[] parameterTypes = new Type[parameterCount];
  71.100 +      for (int i = 0; i < parameterCount; i++)
  71.101 +        parameterTypes[i] = parameterInfos[i].ParameterType;
  71.102 +
  71.103 +      MethodBuilder methodBuilder = typeBuilder.DefinePInvokeMethod(
  71.104 +        dllImportAttribute.EntryPoint, dllImportAttribute.Value,
  71.105 +        MethodAttributes.Public | MethodAttributes.Static |
  71.106 +        MethodAttributes.PinvokeImpl, CallingConventions.Standard,
  71.107 +        methodInfo.ReturnType, parameterTypes,
  71.108 +        dllImportAttribute.CallingConvention,
  71.109 +        dllImportAttribute.CharSet);
  71.110 +
  71.111 +      foreach (ParameterInfo parameterInfo in parameterInfos)
  71.112 +        methodBuilder.DefineParameter(parameterInfo.Position + 1,
  71.113 +          parameterInfo.Attributes, parameterInfo.Name);
  71.114 +
  71.115 +      if (dllImportAttribute.PreserveSig)
  71.116 +        methodBuilder.SetImplementationFlags(MethodImplAttributes.PreserveSig);
  71.117 +
  71.118 +      return typeBuilder.CreateType();
  71.119 +    }
  71.120 +  }
  71.121 +}