Hardware/Mainboard/SuperIOHardware.cs
changeset 130 80065ab20b84
child 132 680ed54e05ca
     1.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     1.2 +++ b/Hardware/Mainboard/SuperIOHardware.cs	Thu Jun 03 22:40:18 2010 +0000
     1.3 @@ -0,0 +1,465 @@
     1.4 +/*
     1.5 +  
     1.6 +  Version: MPL 1.1/GPL 2.0/LGPL 2.1
     1.7 +
     1.8 +  The contents of this file are subject to the Mozilla Public License Version
     1.9 +  1.1 (the "License"); you may not use this file except in compliance with
    1.10 +  the License. You may obtain a copy of the License at
    1.11 + 
    1.12 +  http://www.mozilla.org/MPL/
    1.13 +
    1.14 +  Software distributed under the License is distributed on an "AS IS" basis,
    1.15 +  WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
    1.16 +  for the specific language governing rights and limitations under the License.
    1.17 +
    1.18 +  The Original Code is the Open Hardware Monitor code.
    1.19 +
    1.20 +  The Initial Developer of the Original Code is 
    1.21 +  Michael Möller <m.moeller@gmx.ch>.
    1.22 +  Portions created by the Initial Developer are Copyright (C) 2009-2010
    1.23 +  the Initial Developer. All Rights Reserved.
    1.24 +
    1.25 +  Contributor(s):
    1.26 +
    1.27 +  Alternatively, the contents of this file may be used under the terms of
    1.28 +  either the GNU General Public License Version 2 or later (the "GPL"), or
    1.29 +  the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
    1.30 +  in which case the provisions of the GPL or the LGPL are applicable instead
    1.31 +  of those above. If you wish to allow use of your version of this file only
    1.32 +  under the terms of either the GPL or the LGPL, and not to allow others to
    1.33 +  use your version of this file under the terms of the MPL, indicate your
    1.34 +  decision by deleting the provisions above and replace them with the notice
    1.35 +  and other provisions required by the GPL or the LGPL. If you do not delete
    1.36 +  the provisions above, a recipient may use your version of this file under
    1.37 +  the terms of any one of the MPL, the GPL or the LGPL.
    1.38 + 
    1.39 +*/
    1.40 +
    1.41 +using System;
    1.42 +using System.Collections.Generic;
    1.43 +using System.Drawing;
    1.44 +using OpenHardwareMonitor.Hardware.LPC;
    1.45 +
    1.46 +namespace OpenHardwareMonitor.Hardware.Mainboard {
    1.47 +  public class SuperIOHardware : Hardware {
    1.48 +
    1.49 +    private ISuperIO superIO;
    1.50 +    private Image icon;
    1.51 +    protected readonly string name;
    1.52 +
    1.53 +    private List<Sensor> voltages = new List<Sensor>();
    1.54 +    private List<Sensor> temperatures = new List<Sensor>();
    1.55 +    private List<Sensor> fans = new List<Sensor>();  
    1.56 +
    1.57 +    public SuperIOHardware(ISuperIO superIO, Manufacturer manufacturer, 
    1.58 +      Model model) 
    1.59 +    {
    1.60 +      this.superIO = superIO;
    1.61 +      this.icon = Utilities.EmbeddedResources.GetImage("chip.png");
    1.62 +
    1.63 +      switch (superIO.Chip) {
    1.64 +        case Chip.F71858: name = "Fintek F71858"; break;
    1.65 +        case Chip.F71862: name = "Fintek F71862"; break;
    1.66 +        case Chip.F71869: name = "Fintek F71869"; break;
    1.67 +        case Chip.F71882: name = "Fintek F71882"; break;
    1.68 +        case Chip.F71889ED: name = "Fintek F71889ED"; break;
    1.69 +        case Chip.F71889F: name = "Fintek F71889F"; break;
    1.70 +        case Chip.IT8712F: this.name = "ITE IT8712F"; break;
    1.71 +        case Chip.IT8716F: this.name = "ITE IT8716F"; break;
    1.72 +        case Chip.IT8718F: this.name = "ITE IT8718F"; break;
    1.73 +        case Chip.IT8720F: this.name = "ITE IT8720F"; break;
    1.74 +        case Chip.IT8726F: this.name = "ITE IT8726F"; break;
    1.75 +        case Chip.W83627DHG: this.name = "Winbond W83627DHG"; break;
    1.76 +        case Chip.W83627DHGP: this.name = "Winbond W83627DHG-P"; break;
    1.77 +        case Chip.W83627EHF: this.name = "Winbond W83627EHF"; break;
    1.78 +        case Chip.W83627HF: this.name = "Winbond W83627HF"; break;
    1.79 +        case Chip.W83627THF: this.name = "Winbond W83627THF"; break;
    1.80 +        case Chip.W83667HG: this.name = "Winbond W83667HG"; break;
    1.81 +        case Chip.W83667HGB: this.name = "Winbond W83667HG-B"; break;
    1.82 +        case Chip.W83687THF: this.name = "Winbond W83687THF"; break;
    1.83 +      }
    1.84 +
    1.85 +      List<Voltage> v = new List<Voltage>();
    1.86 +      List<Temperature> t = new List<Temperature>();
    1.87 +      List<Fan> f = new List<Fan>();
    1.88 +
    1.89 +      switch (superIO.Chip) {
    1.90 +        case Chip.IT8712F:
    1.91 +        case Chip.IT8716F:
    1.92 +        case Chip.IT8718F:
    1.93 +        case Chip.IT8720F:
    1.94 +        case Chip.IT8726F:
    1.95 +          switch (manufacturer) {
    1.96 +            case Manufacturer.DFI:
    1.97 +              switch (model) {
    1.98 +                case Model.LP_BI_P45_T2RS_Elite:
    1.99 +                  v.Add(new Voltage("CPU VCore", 0));
   1.100 +                  v.Add(new Voltage("FSB VTT", 1));
   1.101 +                  v.Add(new Voltage("+3.3V", 2));
   1.102 +                  v.Add(new Voltage("+5V", 3, 6.8f, 10, 0));
   1.103 +                  v.Add(new Voltage("+12V", 4, 30, 10, 0));
   1.104 +                  v.Add(new Voltage("NB Core", 5));
   1.105 +                  v.Add(new Voltage("VDIMM", 6));
   1.106 +                  v.Add(new Voltage("+5VSB", 7, 6.8f, 10, 0));
   1.107 +                  v.Add(new Voltage("VBat", 8));
   1.108 +                  t.Add(new Temperature("CPU", 0));
   1.109 +                  t.Add(new Temperature("System", 1));
   1.110 +                  t.Add(new Temperature("Chipset", 2));
   1.111 +                  f.Add(new Fan("Fan #1", 0));
   1.112 +                  f.Add(new Fan("Fan #2", 1));
   1.113 +                  f.Add(new Fan("Fan #3", 2));
   1.114 +                  break;
   1.115 +                case Model.LP_DK_P55_T3eH9:
   1.116 +                  v.Add(new Voltage("CPU VCore", 0));
   1.117 +                  v.Add(new Voltage("VTT", 1));
   1.118 +                  v.Add(new Voltage("+3.3V", 2));
   1.119 +                  v.Add(new Voltage("+5V", 3, 6.8f, 10, 0));
   1.120 +                  v.Add(new Voltage("+12V", 4, 30, 10, 0));
   1.121 +                  v.Add(new Voltage("CPU PLL", 5));
   1.122 +                  v.Add(new Voltage("DRAM", 6));
   1.123 +                  v.Add(new Voltage("+5VSB", 7, 6.8f, 10, 0));
   1.124 +                  v.Add(new Voltage("VBat", 8));
   1.125 +                  t.Add(new Temperature("Chipset", 0));
   1.126 +                  t.Add(new Temperature("CPU PWM", 1));
   1.127 +                  t.Add(new Temperature("CPU", 2));
   1.128 +                  f.Add(new Fan("Fan #1", 0));
   1.129 +                  f.Add(new Fan("Fan #2", 1));
   1.130 +                  f.Add(new Fan("Fan #3", 2));
   1.131 +                  break;
   1.132 +                default:
   1.133 +                  v.Add(new Voltage("CPU VCore", 0));
   1.134 +                  v.Add(new Voltage("VTT", 1, true));
   1.135 +                  v.Add(new Voltage("+3.3V", 2, true));
   1.136 +                  v.Add(new Voltage("+5V", 3, 6.8f, 10, 0, true));
   1.137 +                  v.Add(new Voltage("+12V", 4, 30, 10, 0, true));
   1.138 +                  v.Add(new Voltage("Voltage #6", 5, true));
   1.139 +                  v.Add(new Voltage("DRAM", 6, true));
   1.140 +                  v.Add(new Voltage("+5VSB", 7, 6.8f, 10, 0, true));
   1.141 +                  v.Add(new Voltage("VBat", 8));
   1.142 +                  for (int i = 0; i < superIO.Temperatures.Length; i++)
   1.143 +                    t.Add(new Temperature("Temperature #" + (i + 1), i));
   1.144 +                  for (int i = 0; i < superIO.Fans.Length; i++)
   1.145 +                    f.Add(new Fan("Fan #" + (i + 1), i));
   1.146 +                  break;
   1.147 +              }
   1.148 +              break;
   1.149 +
   1.150 +            case Manufacturer.Gigabyte:
   1.151 +              switch (model) {
   1.152 +                case Model._965P_S3:
   1.153 +                  v.Add(new Voltage("CPU VCore", 0));
   1.154 +                  v.Add(new Voltage("DRAM", 1));
   1.155 +                  v.Add(new Voltage("+3.3V", 2));
   1.156 +                  v.Add(new Voltage("+5V", 3, 6.8f, 10, 0));
   1.157 +                  v.Add(new Voltage("+12V", 7, 27, 9.1f, 0));
   1.158 +                  v.Add(new Voltage("VBat", 8));
   1.159 +                  t.Add(new Temperature("System", 0));
   1.160 +                  t.Add(new Temperature("CPU", 1));
   1.161 +                  f.Add(new Fan("CPU Fan", 0));
   1.162 +                  f.Add(new Fan("System Fan", 1));
   1.163 +                  break;
   1.164 +                case Model.EP45_DS3R:
   1.165 +                case Model.EP45_UD3R: 
   1.166 +                case Model.X38_DS5:
   1.167 +                  v.Add(new Voltage("CPU VCore", 0));
   1.168 +                  v.Add(new Voltage("DRAM", 1));
   1.169 +                  v.Add(new Voltage("+3.3V", 2));
   1.170 +                  v.Add(new Voltage("+5V", 3, 6.8f, 10, 0));
   1.171 +                  v.Add(new Voltage("+12V", 7, 27, 9.1f, 0));
   1.172 +                  v.Add(new Voltage("VBat", 8));
   1.173 +                  t.Add(new Temperature("System", 0));
   1.174 +                  t.Add(new Temperature("CPU", 1));
   1.175 +                  f.Add(new Fan("CPU Fan", 0));
   1.176 +                  f.Add(new Fan("System Fan #2", 1));
   1.177 +                  f.Add(new Fan("Power Fan", 2));
   1.178 +                  f.Add(new Fan("System Fan #1", 3));
   1.179 +                  break;
   1.180 +                case Model.P35_DS3:
   1.181 +                  v.Add(new Voltage("CPU VCore", 0));
   1.182 +                  v.Add(new Voltage("DRAM", 1));
   1.183 +                  v.Add(new Voltage("+3.3V", 2));
   1.184 +                  v.Add(new Voltage("+5V", 3, 6.8f, 10, 0));
   1.185 +                  v.Add(new Voltage("+12V", 7, 27, 9.1f, 0));
   1.186 +                  v.Add(new Voltage("VBat", 8));
   1.187 +                  t.Add(new Temperature("System", 0));
   1.188 +                  t.Add(new Temperature("CPU", 1));
   1.189 +                  f.Add(new Fan("CPU Fan", 0));
   1.190 +                  f.Add(new Fan("System Fan #1", 1));
   1.191 +                  f.Add(new Fan("System Fan #2", 2));
   1.192 +                  f.Add(new Fan("Power Fan", 3));
   1.193 +                  break;
   1.194 +                case Model.GA_MA785GMT_UD2H:
   1.195 +                  v.Add(new Voltage("CPU VCore", 0));
   1.196 +                  v.Add(new Voltage("DRAM", 1));
   1.197 +                  v.Add(new Voltage("+3.3V", 2));
   1.198 +                  v.Add(new Voltage("+5V", 3, 6.8f, 10, 0));
   1.199 +                  v.Add(new Voltage("+12V", 4, 27, 9.1f, 0));
   1.200 +                  v.Add(new Voltage("VBat", 8));
   1.201 +                  t.Add(new Temperature("System", 0));
   1.202 +                  t.Add(new Temperature("CPU", 1));
   1.203 +                  f.Add(new Fan("CPU Fan", 0));
   1.204 +                  f.Add(new Fan("System Fan", 1));
   1.205 +                  f.Add(new Fan("NB Fan", 2));
   1.206 +                  break;
   1.207 +                default:
   1.208 +                  v.Add(new Voltage("CPU VCore", 0));
   1.209 +                  v.Add(new Voltage("DRAM", 1, true));
   1.210 +                  v.Add(new Voltage("+3.3V", 2, true));
   1.211 +                  v.Add(new Voltage("+5V", 3, 6.8f, 10, 0, true));
   1.212 +                  v.Add(new Voltage("Voltage #5", 4, true));
   1.213 +                  v.Add(new Voltage("Voltage #6", 5, true));
   1.214 +                  v.Add(new Voltage("Voltage #7", 6, true));
   1.215 +                  v.Add(new Voltage("+12V", 7, 27, 9.1f, 0, true));
   1.216 +                  v.Add(new Voltage("VBat", 8));
   1.217 +                  for (int i = 0; i < superIO.Temperatures.Length; i++)
   1.218 +                    t.Add(new Temperature("Temperature #" + (i + 1), i));
   1.219 +                  for (int i = 0; i < superIO.Fans.Length; i++)
   1.220 +                    f.Add(new Fan("Fan #" + (i + 1), i));
   1.221 +                  break;
   1.222 +              }
   1.223 +              break;
   1.224 +
   1.225 +            default:
   1.226 +              v.Add(new Voltage("CPU VCore", 0));
   1.227 +              v.Add(new Voltage("Voltage #2", 1, true));
   1.228 +              v.Add(new Voltage("Voltage #3", 2, true));
   1.229 +              v.Add(new Voltage("Voltage #4", 3, true));
   1.230 +              v.Add(new Voltage("Voltage #5", 4, true));
   1.231 +              v.Add(new Voltage("Voltage #6", 5, true));
   1.232 +              v.Add(new Voltage("Voltage #7", 6, true));
   1.233 +              v.Add(new Voltage("Voltage #8", 7, true));
   1.234 +              v.Add(new Voltage("VBat", 8));
   1.235 +              for (int i = 0; i < superIO.Temperatures.Length; i++)
   1.236 +                t.Add(new Temperature("Temperature #" + (i + 1), i));
   1.237 +              for (int i = 0; i < superIO.Fans.Length; i++)
   1.238 +                f.Add(new Fan("Fan #" + (i + 1), i));
   1.239 +              break;
   1.240 +          }
   1.241 +          break;
   1.242 +          
   1.243 +        case Chip.F71858:
   1.244 +          v.Add(new Voltage("VCC3V", 0));
   1.245 +          v.Add(new Voltage("VSB3V", 1));
   1.246 +          v.Add(new Voltage("Battery", 2));
   1.247 +          for (int i = 0; i < superIO.Temperatures.Length; i++)
   1.248 +            t.Add(new Temperature("Temperature #" + (i + 1), i));
   1.249 +          for (int i = 0; i < superIO.Fans.Length; i++)
   1.250 +            f.Add(new Fan("Fan #" + (i + 1), i));
   1.251 +          break;
   1.252 +        case Chip.F71862: 
   1.253 +        case Chip.F71869: 
   1.254 +        case Chip.F71882:
   1.255 +        case Chip.F71889ED: 
   1.256 +        case Chip.F71889F:
   1.257 +          v.Add(new Voltage("VCC3V", 0));
   1.258 +          v.Add(new Voltage("CPU VCore", 1));
   1.259 +          v.Add(new Voltage("Voltage #3", 2, true));
   1.260 +          v.Add(new Voltage("Voltage #4", 3, true));
   1.261 +          v.Add(new Voltage("Voltage #5", 4, true));
   1.262 +          v.Add(new Voltage("Voltage #6", 5, true));
   1.263 +          v.Add(new Voltage("Voltage #7", 6, true));
   1.264 +          v.Add(new Voltage("VSB3V", 7));
   1.265 +          v.Add(new Voltage("Battery", 8));
   1.266 +          for (int i = 0; i < superIO.Temperatures.Length; i++)
   1.267 +            t.Add(new Temperature("Temperature #" + (i + 1), i));
   1.268 +          for (int i = 0; i < superIO.Fans.Length; i++)
   1.269 +            f.Add(new Fan("Fan #" + (i + 1), i));
   1.270 +          break;
   1.271 +
   1.272 +        case Chip.W83627EHF:          
   1.273 +          v.Add(new Voltage("CPU VCore", 0));
   1.274 +          v.Add(new Voltage("Voltage #2", 1, true));
   1.275 +          v.Add(new Voltage("AVCC", 2, 34, 34, 0));
   1.276 +          v.Add(new Voltage("3VCC", 3, 34, 34, 0));
   1.277 +          v.Add(new Voltage("Voltage #5", 4, true));
   1.278 +          v.Add(new Voltage("Voltage #6", 5, true));
   1.279 +          v.Add(new Voltage("Voltage #7", 6, true));
   1.280 +          v.Add(new Voltage("3VSB", 7, 34, 34, 0));
   1.281 +          v.Add(new Voltage("VBAT", 8, 34, 34, 0));
   1.282 +          v.Add(new Voltage("Voltage #10", 9, true));
   1.283 +          t.Add(new Temperature("CPU", 0));
   1.284 +          t.Add(new Temperature("Auxiliary", 1));
   1.285 +          t.Add(new Temperature("System", 2));
   1.286 +          f.Add(new Fan("System", 0));
   1.287 +          f.Add(new Fan("CPU", 1));
   1.288 +          f.Add(new Fan("Auxiliary", 2));
   1.289 +          f.Add(new Fan("CPU #2", 3));
   1.290 +          f.Add(new Fan("Auxiliary #2", 4));
   1.291 +          break;
   1.292 +        case Chip.W83627DHG: 
   1.293 +        case Chip.W83627DHGP:                      
   1.294 +        case Chip.W83667HG:
   1.295 +        case Chip.W83667HGB:
   1.296 +          v.Add(new Voltage("CPU VCore", 0));
   1.297 +          v.Add(new Voltage("Voltage #2", 1, true));
   1.298 +          v.Add(new Voltage("AVCC", 2, 34, 34, 0));
   1.299 +          v.Add(new Voltage("3VCC", 3, 34, 34, 0));
   1.300 +          v.Add(new Voltage("Voltage #5", 4, true));
   1.301 +          v.Add(new Voltage("Voltage #6", 5, true));
   1.302 +          v.Add(new Voltage("Voltage #7", 6, true));
   1.303 +          v.Add(new Voltage("3VSB", 7, 34, 34, 0));
   1.304 +          v.Add(new Voltage("VBAT", 8, 34, 34, 0));
   1.305 +          t.Add(new Temperature("CPU", 0));
   1.306 +          t.Add(new Temperature("Auxiliary", 1));
   1.307 +          t.Add(new Temperature("System", 2));
   1.308 +          f.Add(new Fan("System", 0));
   1.309 +          f.Add(new Fan("CPU", 1));
   1.310 +          f.Add(new Fan("Auxiliary", 2));
   1.311 +          f.Add(new Fan("CPU #2", 3));
   1.312 +          f.Add(new Fan("Auxiliary #2", 4));            
   1.313 +          break;
   1.314 +        case Chip.W83627HF: 
   1.315 +        case Chip.W83627THF: 
   1.316 +        case Chip.W83687THF:
   1.317 +          v.Add(new Voltage("CPU VCore", 0));
   1.318 +          v.Add(new Voltage("Voltage #2", 1, true));
   1.319 +          v.Add(new Voltage("Voltage #3", 2, true));
   1.320 +          v.Add(new Voltage("AVCC", 3, 34, 51, 0));
   1.321 +          v.Add(new Voltage("Voltage #5", 4, true));
   1.322 +          v.Add(new Voltage("5VSB", 5, 34, 51, 0));
   1.323 +          v.Add(new Voltage("VBAT", 6));
   1.324 +          t.Add(new Temperature("CPU", 0));
   1.325 +          t.Add(new Temperature("Auxiliary", 1));
   1.326 +          t.Add(new Temperature("System", 2));
   1.327 +          f.Add(new Fan("System", 0));
   1.328 +          f.Add(new Fan("CPU", 1));
   1.329 +          f.Add(new Fan("Auxiliary", 2));
   1.330 +          break;
   1.331 +        default:
   1.332 +          for (int i = 0; i < superIO.Voltages.Length; i++)
   1.333 +            v.Add(new Voltage("Voltage #" + (i + 1), i, true));
   1.334 +          for (int i = 0; i < superIO.Temperatures.Length; i++)
   1.335 +            t.Add(new Temperature("Temperature #" + (i + 1), i));
   1.336 +          for (int i = 0; i < superIO.Fans.Length; i++)
   1.337 +            f.Add(new Fan("Fan #" + (i + 1), i));
   1.338 +          break;
   1.339 +      }
   1.340 +
   1.341 +      string formula = "Voltage = value + (value - Vf) * Ri / Rf.";
   1.342 +      foreach (Voltage voltage in v) 
   1.343 +        if (voltage.Index < superIO.Voltages.Length) {
   1.344 +          Sensor sensor = new Sensor(voltage.Name, voltage.Index, 
   1.345 +            voltage.Hidden, null, SensorType.Voltage, this, 
   1.346 +            new ParameterDescription[] {
   1.347 +            new ParameterDescription("Ri [kΩ]", "Input resistance.\n" + 
   1.348 +              formula, voltage.Ri),
   1.349 +            new ParameterDescription("Rf [kΩ]", "Reference resistance.\n" + 
   1.350 +              formula, voltage.Rf),
   1.351 +            new ParameterDescription("Vf [V]", "Reference voltage.\n" + 
   1.352 +              formula, voltage.Vf)
   1.353 +            });
   1.354 +          voltages.Add(sensor);
   1.355 +      }
   1.356 +
   1.357 +      foreach (Temperature temperature in t) 
   1.358 +        if (temperature.Index < superIO.Temperatures.Length) {
   1.359 +        Sensor sensor = new Sensor(temperature.Name, temperature.Index, null,
   1.360 +          SensorType.Temperature, this, new ParameterDescription[] {
   1.361 +          new ParameterDescription("Offset [°C]", "Temperature offset.", 0)
   1.362 +        });
   1.363 +        temperatures.Add(sensor);
   1.364 +      }
   1.365 +
   1.366 +      foreach (Fan fan in f)
   1.367 +        if (fan.Index < superIO.Fans.Length) {
   1.368 +          Sensor sensor = new Sensor(fan.Name, fan.Index, null, SensorType.Fan,
   1.369 +            this, null);
   1.370 +          fans.Add(sensor);
   1.371 +        }
   1.372 +    }
   1.373 +
   1.374 +    public override Identifier Identifier {
   1.375 +      get { return new Identifier("lpc", superIO.Chip.ToString().ToLower()); }
   1.376 +    }
   1.377 +
   1.378 +    public override Image Icon {
   1.379 +      get { return icon; }
   1.380 +    }
   1.381 +
   1.382 +    public override string Name {
   1.383 +      get { return name; }
   1.384 +    }
   1.385 +
   1.386 +    public override string GetReport() {
   1.387 +      return superIO.GetReport();
   1.388 +    }
   1.389 +
   1.390 +    public override void Update() {
   1.391 +      superIO.Update();
   1.392 +
   1.393 +      foreach (Sensor sensor in voltages) {
   1.394 +        float? value = superIO.Voltages[sensor.Index];
   1.395 +        if (value.HasValue) {
   1.396 +          sensor.Value = value + (value - sensor.Parameters[2].Value) *
   1.397 +            sensor.Parameters[0].Value / sensor.Parameters[1].Value;
   1.398 +          ActivateSensor(sensor);
   1.399 +        }
   1.400 +      }
   1.401 +
   1.402 +      foreach (Sensor sensor in temperatures) {
   1.403 +        float? value = superIO.Temperatures[sensor.Index];
   1.404 +        if (value.HasValue) {
   1.405 +          sensor.Value = value + sensor.Parameters[0].Value;
   1.406 +          ActivateSensor(sensor);
   1.407 +        }
   1.408 +      }
   1.409 +
   1.410 +      foreach (Sensor sensor in fans) {
   1.411 +        float? value = superIO.Fans[sensor.Index];
   1.412 +        if (value.HasValue) {
   1.413 +          sensor.Value = value;
   1.414 +          if (value.Value > 0)
   1.415 +            ActivateSensor(sensor);
   1.416 +        }
   1.417 +      }
   1.418 +    }
   1.419 +
   1.420 +    private class Voltage {
   1.421 +      public readonly string Name;
   1.422 +      public readonly int Index;
   1.423 +      public readonly float Ri;
   1.424 +      public readonly float Rf;
   1.425 +      public readonly float Vf;
   1.426 +      public readonly bool Hidden;
   1.427 +
   1.428 +      public Voltage(string name, int index) :
   1.429 +        this(name, index, 0, 1, 0, false) { }
   1.430 +
   1.431 +      public Voltage(string name, int index, bool hidden) :
   1.432 +        this(name, index, 0, 1, 0, hidden) { }
   1.433 +
   1.434 +      public Voltage(string name, int index, float ri, float rf, float vf) :
   1.435 +        this(name, index, ri, rf, vf, false) { }
   1.436 +
   1.437 +      public Voltage(string name, int index, float ri, float rf, float vf,
   1.438 +        bool hidden) {
   1.439 +        this.Name = name;
   1.440 +        this.Index = index;
   1.441 +        this.Ri = ri;
   1.442 +        this.Rf = rf;
   1.443 +        this.Vf = vf;
   1.444 +        this.Hidden = hidden;
   1.445 +      }
   1.446 +    }
   1.447 +
   1.448 +    private class Temperature {
   1.449 +      public readonly string Name;
   1.450 +      public readonly int Index;
   1.451 +
   1.452 +      public Temperature(string name, int index) {
   1.453 +        this.Name = name;
   1.454 +        this.Index = index;
   1.455 +      }
   1.456 +    }
   1.457 +
   1.458 +    private class Fan {
   1.459 +      public readonly string Name;
   1.460 +      public readonly int Index;
   1.461 +
   1.462 +      public Fan(string name, int index) {
   1.463 +        this.Name = name;
   1.464 +        this.Index = index;
   1.465 +      }
   1.466 +    }
   1.467 +  }
   1.468 +}