Hardware/Mainboard/SuperIOHardware.cs
author paulwerelds
Sat, 16 Oct 2010 14:15:41 +0000
changeset 224 be9534663a55
parent 220 e51749b206ee
child 228 458a6c3de579
permissions -rw-r--r--
Added license to the WMI stuff and refactored a few things a little.
moel@135
     1
/*
moel@130
     2
  
moel@130
     3
  Version: MPL 1.1/GPL 2.0/LGPL 2.1
moel@130
     4
moel@130
     5
  The contents of this file are subject to the Mozilla Public License Version
moel@130
     6
  1.1 (the "License"); you may not use this file except in compliance with
moel@130
     7
  the License. You may obtain a copy of the License at
moel@130
     8
 
moel@130
     9
  http://www.mozilla.org/MPL/
moel@130
    10
moel@130
    11
  Software distributed under the License is distributed on an "AS IS" basis,
moel@130
    12
  WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
moel@130
    13
  for the specific language governing rights and limitations under the License.
moel@130
    14
moel@130
    15
  The Original Code is the Open Hardware Monitor code.
moel@130
    16
moel@130
    17
  The Initial Developer of the Original Code is 
moel@130
    18
  Michael Möller <m.moeller@gmx.ch>.
moel@130
    19
  Portions created by the Initial Developer are Copyright (C) 2009-2010
moel@130
    20
  the Initial Developer. All Rights Reserved.
moel@130
    21
moel@130
    22
  Contributor(s):
moel@130
    23
moel@130
    24
  Alternatively, the contents of this file may be used under the terms of
moel@130
    25
  either the GNU General Public License Version 2 or later (the "GPL"), or
moel@130
    26
  the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
moel@130
    27
  in which case the provisions of the GPL or the LGPL are applicable instead
moel@130
    28
  of those above. If you wish to allow use of your version of this file only
moel@130
    29
  under the terms of either the GPL or the LGPL, and not to allow others to
moel@130
    30
  use your version of this file under the terms of the MPL, indicate your
moel@130
    31
  decision by deleting the provisions above and replace them with the notice
moel@130
    32
  and other provisions required by the GPL or the LGPL. If you do not delete
moel@130
    33
  the provisions above, a recipient may use your version of this file under
moel@130
    34
  the terms of any one of the MPL, the GPL or the LGPL.
moel@130
    35
 
moel@130
    36
*/
moel@130
    37
moel@130
    38
using System.Collections.Generic;
moel@166
    39
using System.Globalization;
moel@130
    40
using OpenHardwareMonitor.Hardware.LPC;
moel@130
    41
moel@130
    42
namespace OpenHardwareMonitor.Hardware.Mainboard {
moel@165
    43
  internal class SuperIOHardware : Hardware {
moel@130
    44
moel@195
    45
    private readonly Mainboard mainboard;
moel@195
    46
    private readonly ISuperIO superIO;
moel@195
    47
    private readonly string name;
moel@130
    48
moel@195
    49
    private readonly List<Sensor> voltages = new List<Sensor>();
moel@195
    50
    private readonly List<Sensor> temperatures = new List<Sensor>();
moel@195
    51
    private readonly List<Sensor> fans = new List<Sensor>();
moel@167
    52
moel@176
    53
    public SuperIOHardware(Mainboard mainboard, ISuperIO superIO, 
moel@176
    54
      Manufacturer manufacturer, Model model, ISettings settings) 
moel@130
    55
    {
moel@176
    56
      this.mainboard = mainboard;
moel@130
    57
      this.superIO = superIO;
moel@167
    58
      this.name = ChipName.GetName(superIO.Chip);
moel@130
    59
moel@130
    60
      List<Voltage> v = new List<Voltage>();
moel@130
    61
      List<Temperature> t = new List<Temperature>();
moel@130
    62
      List<Fan> f = new List<Fan>();
moel@130
    63
moel@130
    64
      switch (superIO.Chip) {
moel@130
    65
        case Chip.IT8712F:
moel@130
    66
        case Chip.IT8716F:
moel@130
    67
        case Chip.IT8718F:
moel@177
    68
        case Chip.IT8720F: 
moel@130
    69
        case Chip.IT8726F:
moel@130
    70
          switch (manufacturer) {
moel@133
    71
            case Manufacturer.ASUS:
moel@133
    72
              switch (model) {
moel@168
    73
                case Model.Crosshair_III_Formula: // IT8720F
moel@133
    74
                  v.Add(new Voltage("VBat", 8));
moel@133
    75
                  t.Add(new Temperature("CPU", 0));
moel@133
    76
                  for (int i = 0; i < superIO.Fans.Length; i++)
moel@133
    77
                    f.Add(new Fan("Fan #" + (i + 1), i));
moel@133
    78
                  break;
moel@144
    79
                case Model.M2N_SLI_DELUXE:                
moel@133
    80
                  v.Add(new Voltage("CPU VCore", 0));
moel@133
    81
                  v.Add(new Voltage("+3.3V", 1));
moel@195
    82
                  v.Add(new Voltage("+5V", 3, 6.8f, 10));
moel@195
    83
                  v.Add(new Voltage("+12V", 4, 30, 10));
moel@195
    84
                  v.Add(new Voltage("+5VSB", 7, 6.8f, 10));
moel@133
    85
                  v.Add(new Voltage("VBat", 8));
moel@133
    86
                  t.Add(new Temperature("CPU", 0));
moel@133
    87
                  t.Add(new Temperature("Motherboard", 1));
moel@133
    88
                  f.Add(new Fan("CPU Fan", 0));
moel@133
    89
                  f.Add(new Fan("Chassis Fan #1", 1));
moel@133
    90
                  f.Add(new Fan("Power Fan", 2));
moel@133
    91
                  break;
moel@168
    92
                case Model.M4A79XTD_EVO: // IT8720F           
moel@195
    93
                  v.Add(new Voltage("+5V", 3, 6.8f, 10));
moel@144
    94
                  v.Add(new Voltage("VBat", 8));
moel@144
    95
                  t.Add(new Temperature("CPU", 0));
moel@144
    96
                  t.Add(new Temperature("Motherboard", 1));
moel@144
    97
                  f.Add(new Fan("CPU Fan", 0));
moel@144
    98
                  f.Add(new Fan("Chassis Fan #1", 1));
moel@144
    99
                  f.Add(new Fan("Chassis Fan #2", 2));
moel@144
   100
                  break;
moel@133
   101
                default:
moel@133
   102
                  v.Add(new Voltage("CPU VCore", 0));
moel@133
   103
                  v.Add(new Voltage("Voltage #2", 1, true));
moel@133
   104
                  v.Add(new Voltage("Voltage #3", 2, true));
moel@133
   105
                  v.Add(new Voltage("Voltage #4", 3, true));
moel@133
   106
                  v.Add(new Voltage("Voltage #5", 4, true));
moel@133
   107
                  v.Add(new Voltage("Voltage #6", 5, true));
moel@133
   108
                  v.Add(new Voltage("Voltage #7", 6, true));
moel@133
   109
                  v.Add(new Voltage("Voltage #8", 7, true));
moel@133
   110
                  v.Add(new Voltage("VBat", 8));
moel@133
   111
                  for (int i = 0; i < superIO.Temperatures.Length; i++)
moel@133
   112
                    t.Add(new Temperature("Temperature #" + (i + 1), i));
moel@133
   113
                  for (int i = 0; i < superIO.Fans.Length; i++)
moel@133
   114
                    f.Add(new Fan("Fan #" + (i + 1), i));
moel@133
   115
                  break;
moel@133
   116
              }
moel@133
   117
              break;
moel@221
   118
moel@221
   119
            case Manufacturer.ASRock:
moel@221
   120
              switch (model) {
moel@221
   121
                case Model.P55_Deluxe: // IT8720F
moel@221
   122
                  v.Add(new Voltage("CPU VCore", 0));
moel@221
   123
                  v.Add(new Voltage("+3.3V", 2));
moel@221
   124
                  v.Add(new Voltage("+12V", 4, 30, 10));
moel@221
   125
                  v.Add(new Voltage("+5V", 5, 6.8f, 10));
moel@221
   126
                  v.Add(new Voltage("VBat", 8));                  
moel@221
   127
                  t.Add(new Temperature("CPU", 0));
moel@221
   128
                  t.Add(new Temperature("Motherboard", 1));
moel@221
   129
                  f.Add(new Fan("CPU Fan", 0));
moel@221
   130
                  f.Add(new Fan("Chassis Fan #1", 1));
moel@221
   131
                  // fan channel 2 can connect to 3 different fan headers
moel@221
   132
                  // which fan is read is configured with gpio 83-85
moel@221
   133
                  break;
moel@221
   134
                default:
moel@221
   135
                  v.Add(new Voltage("CPU VCore", 0));
moel@221
   136
                  v.Add(new Voltage("Voltage #2", 1, true));
moel@221
   137
                  v.Add(new Voltage("Voltage #3", 2, true));
moel@221
   138
                  v.Add(new Voltage("Voltage #4", 3, true));
moel@221
   139
                  v.Add(new Voltage("Voltage #5", 4, true));
moel@221
   140
                  v.Add(new Voltage("Voltage #6", 5, true));
moel@221
   141
                  v.Add(new Voltage("Voltage #7", 6, true));
moel@221
   142
                  v.Add(new Voltage("Voltage #8", 7, true));
moel@221
   143
                  v.Add(new Voltage("VBat", 8));
moel@221
   144
                  for (int i = 0; i < superIO.Temperatures.Length; i++)
moel@221
   145
                    t.Add(new Temperature("Temperature #" + (i + 1), i));
moel@221
   146
                  for (int i = 0; i < superIO.Fans.Length; i++)
moel@221
   147
                    f.Add(new Fan("Fan #" + (i + 1), i));
moel@221
   148
                  break;
moel@221
   149
              };
moel@221
   150
              break;
moel@221
   151
moel@130
   152
            case Manufacturer.DFI:
moel@130
   153
              switch (model) {
moel@168
   154
                case Model.LP_BI_P45_T2RS_Elite: // IT8718F
moel@130
   155
                  v.Add(new Voltage("CPU VCore", 0));
moel@130
   156
                  v.Add(new Voltage("FSB VTT", 1));
moel@130
   157
                  v.Add(new Voltage("+3.3V", 2));
moel@195
   158
                  v.Add(new Voltage("+5V", 3, 6.8f, 10));
moel@195
   159
                  v.Add(new Voltage("+12V", 4, 30, 10));
moel@130
   160
                  v.Add(new Voltage("NB Core", 5));
moel@130
   161
                  v.Add(new Voltage("VDIMM", 6));
moel@195
   162
                  v.Add(new Voltage("+5VSB", 7, 6.8f, 10));
moel@130
   163
                  v.Add(new Voltage("VBat", 8));
moel@130
   164
                  t.Add(new Temperature("CPU", 0));
moel@130
   165
                  t.Add(new Temperature("System", 1));
moel@130
   166
                  t.Add(new Temperature("Chipset", 2));
moel@130
   167
                  f.Add(new Fan("Fan #1", 0));
moel@130
   168
                  f.Add(new Fan("Fan #2", 1));
moel@130
   169
                  f.Add(new Fan("Fan #3", 2));
moel@130
   170
                  break;
moel@168
   171
                case Model.LP_DK_P55_T3eH9: // IT8720F
moel@130
   172
                  v.Add(new Voltage("CPU VCore", 0));
moel@130
   173
                  v.Add(new Voltage("VTT", 1));
moel@130
   174
                  v.Add(new Voltage("+3.3V", 2));
moel@195
   175
                  v.Add(new Voltage("+5V", 3, 6.8f, 10));
moel@195
   176
                  v.Add(new Voltage("+12V", 4, 30, 10));
moel@130
   177
                  v.Add(new Voltage("CPU PLL", 5));
moel@130
   178
                  v.Add(new Voltage("DRAM", 6));
moel@195
   179
                  v.Add(new Voltage("+5VSB", 7, 6.8f, 10));
moel@130
   180
                  v.Add(new Voltage("VBat", 8));
moel@130
   181
                  t.Add(new Temperature("Chipset", 0));
moel@130
   182
                  t.Add(new Temperature("CPU PWM", 1));
moel@130
   183
                  t.Add(new Temperature("CPU", 2));
moel@130
   184
                  f.Add(new Fan("Fan #1", 0));
moel@130
   185
                  f.Add(new Fan("Fan #2", 1));
moel@130
   186
                  f.Add(new Fan("Fan #3", 2));
moel@130
   187
                  break;
moel@130
   188
                default:
moel@130
   189
                  v.Add(new Voltage("CPU VCore", 0));
moel@130
   190
                  v.Add(new Voltage("VTT", 1, true));
moel@130
   191
                  v.Add(new Voltage("+3.3V", 2, true));
moel@130
   192
                  v.Add(new Voltage("+5V", 3, 6.8f, 10, 0, true));
moel@130
   193
                  v.Add(new Voltage("+12V", 4, 30, 10, 0, true));
moel@130
   194
                  v.Add(new Voltage("Voltage #6", 5, true));
moel@130
   195
                  v.Add(new Voltage("DRAM", 6, true));
moel@130
   196
                  v.Add(new Voltage("+5VSB", 7, 6.8f, 10, 0, true));
moel@130
   197
                  v.Add(new Voltage("VBat", 8));
moel@130
   198
                  for (int i = 0; i < superIO.Temperatures.Length; i++)
moel@130
   199
                    t.Add(new Temperature("Temperature #" + (i + 1), i));
moel@130
   200
                  for (int i = 0; i < superIO.Fans.Length; i++)
moel@130
   201
                    f.Add(new Fan("Fan #" + (i + 1), i));
moel@130
   202
                  break;
moel@130
   203
              }
moel@130
   204
              break;
moel@130
   205
moel@130
   206
            case Manufacturer.Gigabyte:
moel@130
   207
              switch (model) {
moel@168
   208
                case Model._965P_S3: // IT8718F
moel@130
   209
                  v.Add(new Voltage("CPU VCore", 0));
moel@130
   210
                  v.Add(new Voltage("DRAM", 1));
moel@130
   211
                  v.Add(new Voltage("+3.3V", 2));
moel@195
   212
                  v.Add(new Voltage("+5V", 3, 6.8f, 10));
moel@195
   213
                  v.Add(new Voltage("+12V", 7, 27, 9.1f));
moel@130
   214
                  v.Add(new Voltage("VBat", 8));
moel@130
   215
                  t.Add(new Temperature("System", 0));
moel@130
   216
                  t.Add(new Temperature("CPU", 1));
moel@130
   217
                  f.Add(new Fan("CPU Fan", 0));
moel@130
   218
                  f.Add(new Fan("System Fan", 1));
moel@130
   219
                  break;
moel@168
   220
                case Model.EP45_DS3R: // IT8718F
moel@130
   221
                case Model.EP45_UD3R: 
moel@138
   222
                case Model.X38_DS5:    
moel@130
   223
                  v.Add(new Voltage("CPU VCore", 0));
moel@130
   224
                  v.Add(new Voltage("DRAM", 1));
moel@130
   225
                  v.Add(new Voltage("+3.3V", 2));
moel@195
   226
                  v.Add(new Voltage("+5V", 3, 6.8f, 10));
moel@195
   227
                  v.Add(new Voltage("+12V", 7, 27, 9.1f));
moel@130
   228
                  v.Add(new Voltage("VBat", 8));
moel@130
   229
                  t.Add(new Temperature("System", 0));
moel@130
   230
                  t.Add(new Temperature("CPU", 1));
moel@130
   231
                  f.Add(new Fan("CPU Fan", 0));
moel@130
   232
                  f.Add(new Fan("System Fan #2", 1));
moel@130
   233
                  f.Add(new Fan("Power Fan", 2));
moel@130
   234
                  f.Add(new Fan("System Fan #1", 3));
moel@130
   235
                  break;
moel@168
   236
                case Model.EX58_EXTREME: // IT8720F 
moel@133
   237
                  v.Add(new Voltage("CPU VCore", 0));
moel@133
   238
                  v.Add(new Voltage("DRAM", 1));
moel@195
   239
                  v.Add(new Voltage("+5V", 3, 6.8f, 10));
moel@133
   240
                  v.Add(new Voltage("VBat", 8));
moel@133
   241
                  t.Add(new Temperature("System", 0));
moel@133
   242
                  t.Add(new Temperature("CPU", 1));
moel@138
   243
                  t.Add(new Temperature("Northbridge", 2));
moel@133
   244
                  f.Add(new Fan("CPU Fan", 0));
moel@133
   245
                  f.Add(new Fan("System Fan #2", 1));
moel@133
   246
                  f.Add(new Fan("Power Fan", 2));
moel@133
   247
                  f.Add(new Fan("System Fan #1", 3));
moel@133
   248
                  break;
moel@168
   249
                case Model.P35_DS3: // IT8718F 
moel@168
   250
                case Model.P35_DS3L: // IT8718F
moel@130
   251
                  v.Add(new Voltage("CPU VCore", 0));
moel@130
   252
                  v.Add(new Voltage("DRAM", 1));
moel@130
   253
                  v.Add(new Voltage("+3.3V", 2));
moel@195
   254
                  v.Add(new Voltage("+5V", 3, 6.8f, 10));
moel@195
   255
                  v.Add(new Voltage("+12V", 7, 27, 9.1f));
moel@130
   256
                  v.Add(new Voltage("VBat", 8));
moel@130
   257
                  t.Add(new Temperature("System", 0));
moel@130
   258
                  t.Add(new Temperature("CPU", 1));
moel@130
   259
                  f.Add(new Fan("CPU Fan", 0));
moel@130
   260
                  f.Add(new Fan("System Fan #1", 1));
moel@130
   261
                  f.Add(new Fan("System Fan #2", 2));
moel@130
   262
                  f.Add(new Fan("Power Fan", 3));
moel@130
   263
                  break;
moel@168
   264
                case Model.P55_UD4: // IT8720F
moel@168
   265
                case Model.P55M_UD4: // IT8720F
moel@148
   266
                  v.Add(new Voltage("CPU VCore", 0));
moel@148
   267
                  v.Add(new Voltage("DRAM", 1));
moel@148
   268
                  v.Add(new Voltage("+3.3V", 2));
moel@195
   269
                  v.Add(new Voltage("+5V", 3, 6.8f, 10));
moel@195
   270
                  v.Add(new Voltage("+12V", 5, 27, 9.1f));
moel@148
   271
                  v.Add(new Voltage("VBat", 8));
moel@148
   272
                  t.Add(new Temperature("System", 0));
moel@148
   273
                  t.Add(new Temperature("CPU", 2));
moel@148
   274
                  f.Add(new Fan("CPU Fan", 0));
moel@148
   275
                  f.Add(new Fan("System Fan #2", 1));
moel@148
   276
                  f.Add(new Fan("Power Fan", 2));
moel@148
   277
                  f.Add(new Fan("System Fan #1", 3));
moel@148
   278
                  break;
moel@168
   279
                case Model.GA_MA770T_UD3: // IT8720F
moel@154
   280
                  v.Add(new Voltage("CPU VCore", 0));
moel@154
   281
                  v.Add(new Voltage("DRAM", 1));
moel@154
   282
                  v.Add(new Voltage("+3.3V", 2));
moel@195
   283
                  v.Add(new Voltage("+5V", 3, 6.8f, 10));
moel@195
   284
                  v.Add(new Voltage("+12V", 4, 27, 9.1f));
moel@154
   285
                  v.Add(new Voltage("VBat", 8));
moel@154
   286
                  t.Add(new Temperature("System", 0));
moel@154
   287
                  t.Add(new Temperature("CPU", 1));
moel@154
   288
                  f.Add(new Fan("CPU Fan", 0));
moel@154
   289
                  f.Add(new Fan("System Fan #1", 1));
moel@154
   290
                  f.Add(new Fan("System Fan #2", 2));
moel@154
   291
                  f.Add(new Fan("Power Fan", 3));
moel@154
   292
                  break;
moel@168
   293
                case Model.GA_MA785GMT_UD2H: // IT8718F
moel@130
   294
                  v.Add(new Voltage("CPU VCore", 0));
moel@130
   295
                  v.Add(new Voltage("DRAM", 1));
moel@130
   296
                  v.Add(new Voltage("+3.3V", 2));
moel@195
   297
                  v.Add(new Voltage("+5V", 3, 6.8f, 10));
moel@195
   298
                  v.Add(new Voltage("+12V", 4, 27, 9.1f));
moel@130
   299
                  v.Add(new Voltage("VBat", 8));
moel@130
   300
                  t.Add(new Temperature("System", 0));
moel@130
   301
                  t.Add(new Temperature("CPU", 1));
moel@130
   302
                  f.Add(new Fan("CPU Fan", 0));
moel@130
   303
                  f.Add(new Fan("System Fan", 1));
moel@130
   304
                  f.Add(new Fan("NB Fan", 2));
moel@130
   305
                  break;
moel@168
   306
                case Model.X58A_UD3R: // IT8720F 
moel@138
   307
                  v.Add(new Voltage("CPU VCore", 0));
moel@138
   308
                  v.Add(new Voltage("DRAM", 1));
moel@138
   309
                  v.Add(new Voltage("+3.3V", 2));
moel@195
   310
                  v.Add(new Voltage("+5V", 3, 6.8f, 10));
moel@195
   311
                  v.Add(new Voltage("+12V", 5, 27, 9.1f));
moel@138
   312
                  v.Add(new Voltage("VBat", 8));
moel@138
   313
                  t.Add(new Temperature("System", 0));
moel@138
   314
                  t.Add(new Temperature("CPU", 1));
moel@138
   315
                  t.Add(new Temperature("Northbridge", 2));
moel@138
   316
                  f.Add(new Fan("CPU Fan", 0));
moel@138
   317
                  f.Add(new Fan("System Fan #2", 1));
moel@138
   318
                  f.Add(new Fan("Power Fan", 2));
moel@138
   319
                  f.Add(new Fan("System Fan #1", 3));
moel@138
   320
                  break;
moel@130
   321
                default:
moel@130
   322
                  v.Add(new Voltage("CPU VCore", 0));
moel@130
   323
                  v.Add(new Voltage("DRAM", 1, true));
moel@130
   324
                  v.Add(new Voltage("+3.3V", 2, true));
moel@130
   325
                  v.Add(new Voltage("+5V", 3, 6.8f, 10, 0, true));
moel@130
   326
                  v.Add(new Voltage("Voltage #5", 4, true));
moel@130
   327
                  v.Add(new Voltage("Voltage #6", 5, true));
moel@130
   328
                  v.Add(new Voltage("Voltage #7", 6, true));
moel@130
   329
                  v.Add(new Voltage("+12V", 7, 27, 9.1f, 0, true));
moel@130
   330
                  v.Add(new Voltage("VBat", 8));
moel@130
   331
                  for (int i = 0; i < superIO.Temperatures.Length; i++)
moel@130
   332
                    t.Add(new Temperature("Temperature #" + (i + 1), i));
moel@130
   333
                  for (int i = 0; i < superIO.Fans.Length; i++)
moel@130
   334
                    f.Add(new Fan("Fan #" + (i + 1), i));
moel@130
   335
                  break;
moel@130
   336
              }
moel@130
   337
              break;
moel@130
   338
moel@130
   339
            default:
moel@130
   340
              v.Add(new Voltage("CPU VCore", 0));
moel@130
   341
              v.Add(new Voltage("Voltage #2", 1, true));
moel@130
   342
              v.Add(new Voltage("Voltage #3", 2, true));
moel@130
   343
              v.Add(new Voltage("Voltage #4", 3, true));
moel@130
   344
              v.Add(new Voltage("Voltage #5", 4, true));
moel@130
   345
              v.Add(new Voltage("Voltage #6", 5, true));
moel@130
   346
              v.Add(new Voltage("Voltage #7", 6, true));
moel@130
   347
              v.Add(new Voltage("Voltage #8", 7, true));
moel@130
   348
              v.Add(new Voltage("VBat", 8));
moel@130
   349
              for (int i = 0; i < superIO.Temperatures.Length; i++)
moel@130
   350
                t.Add(new Temperature("Temperature #" + (i + 1), i));
moel@130
   351
              for (int i = 0; i < superIO.Fans.Length; i++)
moel@130
   352
                f.Add(new Fan("Fan #" + (i + 1), i));
moel@130
   353
              break;
moel@130
   354
          }
moel@130
   355
          break;
moel@170
   356
moel@170
   357
        case Chip.IT8721F:
moel@177
   358
          switch (manufacturer) {
moel@177
   359
            case Manufacturer.ECS:
moel@177
   360
              switch (model) {
moel@177
   361
                case Model.A890GXM_A: // IT8721F
moel@177
   362
                  v.Add(new Voltage("CPU VCore", 0));
moel@177
   363
                  v.Add(new Voltage("VDIMM", 1));
moel@177
   364
                  v.Add(new Voltage("NB Voltage", 2));
moel@195
   365
                  v.Add(new Voltage("Analog +3.3V", 3, 10, 10));
moel@177
   366
                  // v.Add(new Voltage("VDIMM", 6, true));
moel@195
   367
                  v.Add(new Voltage("Standby +3.3V", 7, 10, 10));
moel@195
   368
                  v.Add(new Voltage("VBat", 8, 10, 10));
moel@177
   369
                  t.Add(new Temperature("CPU", 0));
moel@177
   370
                  t.Add(new Temperature("System", 1));
moel@177
   371
                  t.Add(new Temperature("Northbridge", 2));
moel@177
   372
                  f.Add(new Fan("CPU Fan", 0));
moel@177
   373
                  f.Add(new Fan("System Fan", 1));
moel@177
   374
                  f.Add(new Fan("Power Fan", 2));
moel@177
   375
                  break;
moel@177
   376
                default:
moel@177
   377
                  v.Add(new Voltage("Voltage #1", 0, true));
moel@177
   378
                  v.Add(new Voltage("Voltage #2", 1, true));
moel@177
   379
                  v.Add(new Voltage("Voltage #3", 2, true));
moel@177
   380
                  v.Add(new Voltage("Analog +3.3V", 3, 10, 10, 0, true));
moel@177
   381
                  v.Add(new Voltage("Voltage #5", 4, true));
moel@177
   382
                  v.Add(new Voltage("Voltage #6", 5, true));
moel@177
   383
                  v.Add(new Voltage("Voltage #7", 6, true));
moel@177
   384
                  v.Add(new Voltage("Standby +3.3V", 7, 10, 10, 0, true));
moel@195
   385
                  v.Add(new Voltage("VBat", 8, 10, 10));
moel@177
   386
                  for (int i = 0; i < superIO.Temperatures.Length; i++)
moel@177
   387
                    t.Add(new Temperature("Temperature #" + (i + 1), i));
moel@177
   388
                  for (int i = 0; i < superIO.Fans.Length; i++)
moel@177
   389
                    f.Add(new Fan("Fan #" + (i + 1), i));
moel@177
   390
                  break;
moel@177
   391
              }
moel@177
   392
              break;
moel@177
   393
            default:
moel@177
   394
              v.Add(new Voltage("Voltage #1", 0, true));
moel@177
   395
              v.Add(new Voltage("Voltage #2", 1, true));
moel@177
   396
              v.Add(new Voltage("Voltage #3", 2, true));
moel@177
   397
              v.Add(new Voltage("Analog +3.3V", 3, 10, 10, 0, true));
moel@177
   398
              v.Add(new Voltage("Voltage #5", 4, true));
moel@177
   399
              v.Add(new Voltage("Voltage #6", 5, true));
moel@177
   400
              v.Add(new Voltage("Voltage #7", 6, true));
moel@177
   401
              v.Add(new Voltage("Standby +3.3V", 7, 10, 10, 0, true));
moel@195
   402
              v.Add(new Voltage("VBat", 8, 10, 10));
moel@177
   403
              for (int i = 0; i < superIO.Temperatures.Length; i++)
moel@177
   404
                t.Add(new Temperature("Temperature #" + (i + 1), i));
moel@177
   405
              for (int i = 0; i < superIO.Fans.Length; i++)
moel@177
   406
                f.Add(new Fan("Fan #" + (i + 1), i));
moel@177
   407
              break;
moel@177
   408
          }
moel@170
   409
          break;
moel@130
   410
          
moel@130
   411
        case Chip.F71858:
moel@195
   412
          v.Add(new Voltage("VCC3V", 0, 150, 150));
moel@195
   413
          v.Add(new Voltage("VSB3V", 1, 150, 150));
moel@195
   414
          v.Add(new Voltage("Battery", 2, 150, 150));
moel@130
   415
          for (int i = 0; i < superIO.Temperatures.Length; i++)
moel@130
   416
            t.Add(new Temperature("Temperature #" + (i + 1), i));
moel@130
   417
          for (int i = 0; i < superIO.Fans.Length; i++)
moel@130
   418
            f.Add(new Fan("Fan #" + (i + 1), i));
moel@130
   419
          break;
moel@130
   420
        case Chip.F71862: 
moel@130
   421
        case Chip.F71869: 
moel@130
   422
        case Chip.F71882:
moel@130
   423
        case Chip.F71889ED: 
moel@130
   424
        case Chip.F71889F:
moel@132
   425
          switch (manufacturer) {
moel@132
   426
            case Manufacturer.EVGA:
moel@132
   427
              switch (model) {
moel@168
   428
                case Model.X58_SLI_Classified: // F71882 
moel@195
   429
                  v.Add(new Voltage("VCC3V", 0, 150, 150));
moel@195
   430
                  v.Add(new Voltage("CPU VCore", 1, 47, 100));
moel@195
   431
                  v.Add(new Voltage("DIMM", 2, 47, 100));
moel@195
   432
                  v.Add(new Voltage("CPU VTT", 3, 24, 100));
moel@195
   433
                  v.Add(new Voltage("IOH Vcore", 4, 24, 100));
moel@195
   434
                  v.Add(new Voltage("+5V", 5, 51, 12));
moel@195
   435
                  v.Add(new Voltage("+12V", 6, 56, 6.8f));
moel@195
   436
                  v.Add(new Voltage("3VSB", 7, 150, 150));
moel@195
   437
                  v.Add(new Voltage("VBat", 8, 150, 150));
moel@132
   438
                  t.Add(new Temperature("CPU", 0));
moel@132
   439
                  t.Add(new Temperature("VREG", 1));
moel@132
   440
                  t.Add(new Temperature("System", 2));
moel@132
   441
                  f.Add(new Fan("CPU Fan", 0));
moel@132
   442
                  f.Add(new Fan("Power Fan", 1));
moel@132
   443
                  f.Add(new Fan("Chassis Fan", 2));
moel@132
   444
                  break;
moel@132
   445
                default:
moel@195
   446
                  v.Add(new Voltage("VCC3V", 0, 150, 150));
moel@132
   447
                  v.Add(new Voltage("CPU VCore", 1));
moel@132
   448
                  v.Add(new Voltage("Voltage #3", 2, true));
moel@132
   449
                  v.Add(new Voltage("Voltage #4", 3, true));
moel@132
   450
                  v.Add(new Voltage("Voltage #5", 4, true));
moel@132
   451
                  v.Add(new Voltage("Voltage #6", 5, true));
moel@132
   452
                  v.Add(new Voltage("Voltage #7", 6, true));
moel@195
   453
                  v.Add(new Voltage("VSB3V", 7, 150, 150));
moel@195
   454
                  v.Add(new Voltage("VBat", 8, 150, 150));
moel@132
   455
                  for (int i = 0; i < superIO.Temperatures.Length; i++)
moel@132
   456
                    t.Add(new Temperature("Temperature #" + (i + 1), i));
moel@132
   457
                  for (int i = 0; i < superIO.Fans.Length; i++)
moel@132
   458
                    f.Add(new Fan("Fan #" + (i + 1), i));
moel@132
   459
                  break;
moel@132
   460
              }
moel@132
   461
              break;
moel@132
   462
            default:
moel@195
   463
              v.Add(new Voltage("VCC3V", 0, 150, 150));
moel@132
   464
              v.Add(new Voltage("CPU VCore", 1));
moel@132
   465
              v.Add(new Voltage("Voltage #3", 2, true));
moel@132
   466
              v.Add(new Voltage("Voltage #4", 3, true));
moel@132
   467
              v.Add(new Voltage("Voltage #5", 4, true));
moel@132
   468
              v.Add(new Voltage("Voltage #6", 5, true));
moel@132
   469
              v.Add(new Voltage("Voltage #7", 6, true));
moel@195
   470
              v.Add(new Voltage("VSB3V", 7, 150, 150));
moel@195
   471
              v.Add(new Voltage("VBat", 8, 150, 150));
moel@132
   472
              for (int i = 0; i < superIO.Temperatures.Length; i++)
moel@132
   473
                t.Add(new Temperature("Temperature #" + (i + 1), i));
moel@132
   474
              for (int i = 0; i < superIO.Fans.Length; i++)
moel@132
   475
                f.Add(new Fan("Fan #" + (i + 1), i));
moel@132
   476
              break;
moel@132
   477
          }
moel@130
   478
          break;
moel@130
   479
moel@220
   480
        case Chip.W83627EHF:
moel@220
   481
          switch (manufacturer) {
moel@220
   482
            case Manufacturer.ASRock:
moel@220
   483
              switch (model) {
moel@220
   484
                case Model.AOD790GX_128M: // W83627EHF
moel@220
   485
                  v.Add(new Voltage("CPU VCore", 0));
moel@220
   486
                  v.Add(new Voltage("Analog +3.3V", 2, 34, 34));
moel@220
   487
                  v.Add(new Voltage("+3.3V", 4, 10, 10));
moel@220
   488
                  v.Add(new Voltage("+5V", 5, 20, 10));
moel@220
   489
                  v.Add(new Voltage("+12V", 6, 28, 5));
moel@220
   490
                  v.Add(new Voltage("Standby +3.3V", 7, 34, 34));
moel@220
   491
                  v.Add(new Voltage("VBAT", 8, 34, 34));
moel@220
   492
                  t.Add(new Temperature("CPU", 0));
moel@220
   493
                  t.Add(new Temperature("Motherboard", 2));
moel@221
   494
                  f.Add(new Fan("CPU Fan", 0));
moel@221
   495
                  f.Add(new Fan("Chassis Fan", 1));                 
moel@220
   496
                  break;
moel@220
   497
                default:
moel@220
   498
                  v.Add(new Voltage("CPU VCore", 0));
moel@220
   499
                  v.Add(new Voltage("Voltage #2", 1, true));
moel@220
   500
                  v.Add(new Voltage("AVCC", 2, 34, 34));
moel@220
   501
                  v.Add(new Voltage("3VCC", 3, 34, 34));
moel@220
   502
                  v.Add(new Voltage("Voltage #5", 4, true));
moel@220
   503
                  v.Add(new Voltage("Voltage #6", 5, true));
moel@220
   504
                  v.Add(new Voltage("Voltage #7", 6, true));
moel@220
   505
                  v.Add(new Voltage("3VSB", 7, 34, 34));
moel@220
   506
                  v.Add(new Voltage("VBAT", 8, 34, 34));
moel@220
   507
                  v.Add(new Voltage("Voltage #10", 9, true));
moel@220
   508
                  t.Add(new Temperature("CPU", 0));
moel@220
   509
                  t.Add(new Temperature("Auxiliary", 1));
moel@220
   510
                  t.Add(new Temperature("System", 2));
moel@220
   511
                  f.Add(new Fan("System Fan", 0));
moel@220
   512
                  f.Add(new Fan("CPU Fan", 1));
moel@220
   513
                  f.Add(new Fan("Auxiliary Fan", 2));
moel@220
   514
                  f.Add(new Fan("CPU Fan #2", 3));
moel@220
   515
                  f.Add(new Fan("Auxiliary Fan #2", 4));
moel@220
   516
                  break;
moel@220
   517
              } break;
moel@220
   518
            default:
moel@220
   519
              v.Add(new Voltage("CPU VCore", 0));
moel@220
   520
              v.Add(new Voltage("Voltage #2", 1, true));
moel@220
   521
              v.Add(new Voltage("AVCC", 2, 34, 34));
moel@220
   522
              v.Add(new Voltage("3VCC", 3, 34, 34));
moel@220
   523
              v.Add(new Voltage("Voltage #5", 4, true));
moel@220
   524
              v.Add(new Voltage("Voltage #6", 5, true));
moel@220
   525
              v.Add(new Voltage("Voltage #7", 6, true));
moel@220
   526
              v.Add(new Voltage("3VSB", 7, 34, 34));
moel@220
   527
              v.Add(new Voltage("VBAT", 8, 34, 34));
moel@220
   528
              v.Add(new Voltage("Voltage #10", 9, true));
moel@220
   529
              t.Add(new Temperature("CPU", 0));
moel@220
   530
              t.Add(new Temperature("Auxiliary", 1));
moel@220
   531
              t.Add(new Temperature("System", 2));
moel@220
   532
              f.Add(new Fan("System Fan", 0));
moel@220
   533
              f.Add(new Fan("CPU Fan", 1));
moel@220
   534
              f.Add(new Fan("Auxiliary Fan", 2));
moel@220
   535
              f.Add(new Fan("CPU Fan #2", 3));
moel@220
   536
              f.Add(new Fan("Auxiliary Fan #2", 4));
moel@220
   537
              break;
moel@220
   538
          }
moel@130
   539
          break;
moel@130
   540
        case Chip.W83627DHG: 
moel@130
   541
        case Chip.W83627DHGP:                      
moel@130
   542
        case Chip.W83667HG:
moel@130
   543
        case Chip.W83667HGB:
moel@152
   544
          switch (manufacturer) {
moel@153
   545
            case Manufacturer.ASRock:
moel@153
   546
              switch (model) {
moel@168
   547
                case Model._880GMH_USB3: // W83627DHG-P
moel@153
   548
                  v.Add(new Voltage("CPU VCore", 0));
moel@195
   549
                  v.Add(new Voltage("+3.3V", 3, 34, 34));
moel@195
   550
                  v.Add(new Voltage("+5V", 5, 15, 7.5f));
moel@195
   551
                  v.Add(new Voltage("+12V", 6, 56, 10));
moel@195
   552
                  v.Add(new Voltage("Standby +3.3V", 7, 34, 34));
moel@195
   553
                  v.Add(new Voltage("VBAT", 8, 34, 34));
moel@153
   554
                  t.Add(new Temperature("CPU", 0));
moel@153
   555
                  t.Add(new Temperature("Motherboard", 2));
moel@153
   556
                  f.Add(new Fan("Chassis Fan", 0));
moel@153
   557
                  f.Add(new Fan("CPU Fan", 1));
moel@153
   558
                  f.Add(new Fan("Power Fan", 2));
moel@153
   559
                  break;
moel@153
   560
                default:
moel@153
   561
                  v.Add(new Voltage("CPU VCore", 0));
moel@153
   562
                  v.Add(new Voltage("Voltage #2", 1, true));
moel@195
   563
                  v.Add(new Voltage("AVCC", 2, 34, 34));
moel@195
   564
                  v.Add(new Voltage("3VCC", 3, 34, 34));
moel@153
   565
                  v.Add(new Voltage("Voltage #5", 4, true));
moel@153
   566
                  v.Add(new Voltage("Voltage #6", 5, true));
moel@153
   567
                  v.Add(new Voltage("Voltage #7", 6, true));
moel@195
   568
                  v.Add(new Voltage("3VSB", 7, 34, 34));
moel@195
   569
                  v.Add(new Voltage("VBAT", 8, 34, 34));
moel@153
   570
                  t.Add(new Temperature("CPU", 0));
moel@153
   571
                  t.Add(new Temperature("Auxiliary", 1));
moel@153
   572
                  t.Add(new Temperature("System", 2));
moel@153
   573
                  f.Add(new Fan("System Fan", 0));
moel@153
   574
                  f.Add(new Fan("CPU Fan", 1));
moel@153
   575
                  f.Add(new Fan("Auxiliary Fan", 2));
moel@153
   576
                  f.Add(new Fan("CPU Fan #2", 3));
moel@153
   577
                  f.Add(new Fan("Auxiliary Fan #2", 4));
moel@153
   578
                  break;
moel@153
   579
              }
moel@153
   580
              break;
moel@152
   581
            case Manufacturer.ASUS:
moel@152
   582
              switch (model) {
moel@174
   583
                case Model.P6X58D_E: // W83667HG                 
moel@174
   584
                case Model.Rampage_II_GENE: // W83667HG 
moel@152
   585
                  v.Add(new Voltage("CPU VCore", 0));
moel@195
   586
                  v.Add(new Voltage("+12V", 1, 11.5f, 1.91f));
moel@195
   587
                  v.Add(new Voltage("Analog +3.3V", 2, 34, 34));
moel@195
   588
                  v.Add(new Voltage("+3.3V", 3, 34, 34));
moel@195
   589
                  v.Add(new Voltage("+5V", 4, 15, 7.5f));
moel@195
   590
                  v.Add(new Voltage("Standby +3.3V", 7, 34, 34));
moel@195
   591
                  v.Add(new Voltage("VBAT", 8, 34, 34));
moel@174
   592
                  t.Add(new Temperature("CPU", 0));
moel@174
   593
                  t.Add(new Temperature("Motherboard", 2));
moel@174
   594
                  f.Add(new Fan("Chassis Fan #1", 0));
moel@174
   595
                  f.Add(new Fan("CPU Fan", 1));
moel@174
   596
                  f.Add(new Fan("Power Fan", 2));
moel@174
   597
                  f.Add(new Fan("Chassis Fan #2", 3));
moel@174
   598
                  f.Add(new Fan("Chassis Fan #3", 4));
moel@174
   599
                  break;
moel@174
   600
                case Model.Rampage_Extreme: // W83667HG 
moel@174
   601
                  v.Add(new Voltage("CPU VCore", 0));
moel@195
   602
                  v.Add(new Voltage("+12V", 1, 12, 2));
moel@195
   603
                  v.Add(new Voltage("Analog +3.3V", 2, 34, 34));
moel@195
   604
                  v.Add(new Voltage("+3.3V", 3, 34, 34));
moel@195
   605
                  v.Add(new Voltage("+5V", 4, 15, 7.5f));
moel@195
   606
                  v.Add(new Voltage("Standby +3.3V", 7, 34, 34));
moel@195
   607
                  v.Add(new Voltage("VBAT", 8, 34, 34));
moel@152
   608
                  t.Add(new Temperature("CPU", 0));
moel@152
   609
                  t.Add(new Temperature("Motherboard", 2));
moel@152
   610
                  f.Add(new Fan("Chassis Fan #1", 0));
moel@153
   611
                  f.Add(new Fan("CPU Fan", 1));
moel@153
   612
                  f.Add(new Fan("Power Fan", 2));
moel@152
   613
                  f.Add(new Fan("Chassis Fan #2", 3));
moel@152
   614
                  f.Add(new Fan("Chassis Fan #3", 4));
moel@152
   615
                  break;
moel@152
   616
                default:
moel@152
   617
                  v.Add(new Voltage("CPU VCore", 0));
moel@152
   618
                  v.Add(new Voltage("Voltage #2", 1, true));
moel@195
   619
                  v.Add(new Voltage("AVCC", 2, 34, 34));
moel@195
   620
                  v.Add(new Voltage("3VCC", 3, 34, 34));
moel@152
   621
                  v.Add(new Voltage("Voltage #5", 4, true));
moel@152
   622
                  v.Add(new Voltage("Voltage #6", 5, true));
moel@152
   623
                  v.Add(new Voltage("Voltage #7", 6, true));
moel@195
   624
                  v.Add(new Voltage("3VSB", 7, 34, 34));
moel@195
   625
                  v.Add(new Voltage("VBAT", 8, 34, 34));
moel@152
   626
                  t.Add(new Temperature("CPU", 0));
moel@152
   627
                  t.Add(new Temperature("Auxiliary", 1));
moel@152
   628
                  t.Add(new Temperature("System", 2));
moel@153
   629
                  f.Add(new Fan("System Fan", 0));
moel@153
   630
                  f.Add(new Fan("CPU Fan", 1));
moel@153
   631
                  f.Add(new Fan("Auxiliary Fan", 2));
moel@153
   632
                  f.Add(new Fan("CPU Fan #2", 3));
moel@153
   633
                  f.Add(new Fan("Auxiliary Fan #2", 4));
moel@152
   634
                  break;
moel@152
   635
              }
moel@152
   636
              break;
moel@152
   637
            default:
moel@152
   638
              v.Add(new Voltage("CPU VCore", 0));
moel@152
   639
              v.Add(new Voltage("Voltage #2", 1, true));
moel@195
   640
              v.Add(new Voltage("AVCC", 2, 34, 34));
moel@195
   641
              v.Add(new Voltage("3VCC", 3, 34, 34));
moel@152
   642
              v.Add(new Voltage("Voltage #5", 4, true));
moel@152
   643
              v.Add(new Voltage("Voltage #6", 5, true));
moel@152
   644
              v.Add(new Voltage("Voltage #7", 6, true));
moel@195
   645
              v.Add(new Voltage("3VSB", 7, 34, 34));
moel@195
   646
              v.Add(new Voltage("VBAT", 8, 34, 34));
moel@152
   647
              t.Add(new Temperature("CPU", 0));
moel@152
   648
              t.Add(new Temperature("Auxiliary", 1));
moel@152
   649
              t.Add(new Temperature("System", 2));
moel@153
   650
              f.Add(new Fan("System Fan", 0));
moel@153
   651
              f.Add(new Fan("CPU Fan", 1));
moel@153
   652
              f.Add(new Fan("Auxiliary Fan", 2));
moel@153
   653
              f.Add(new Fan("CPU Fan #2", 3));
moel@153
   654
              f.Add(new Fan("Auxiliary Fan #2", 4));
moel@152
   655
              break;
moel@152
   656
          } 
moel@130
   657
          break;
moel@130
   658
        case Chip.W83627HF: 
moel@130
   659
        case Chip.W83627THF: 
moel@130
   660
        case Chip.W83687THF:
moel@130
   661
          v.Add(new Voltage("CPU VCore", 0));
moel@130
   662
          v.Add(new Voltage("Voltage #2", 1, true));
moel@130
   663
          v.Add(new Voltage("Voltage #3", 2, true));
moel@195
   664
          v.Add(new Voltage("AVCC", 3, 34, 51));
moel@130
   665
          v.Add(new Voltage("Voltage #5", 4, true));
moel@195
   666
          v.Add(new Voltage("5VSB", 5, 34, 51));
moel@130
   667
          v.Add(new Voltage("VBAT", 6));
moel@130
   668
          t.Add(new Temperature("CPU", 0));
moel@130
   669
          t.Add(new Temperature("Auxiliary", 1));
moel@130
   670
          t.Add(new Temperature("System", 2));
moel@153
   671
          f.Add(new Fan("System Fan", 0));
moel@153
   672
          f.Add(new Fan("CPU Fan", 1));
moel@153
   673
          f.Add(new Fan("Auxiliary Fan", 2));
moel@130
   674
          break;
moel@130
   675
        default:
moel@130
   676
          for (int i = 0; i < superIO.Voltages.Length; i++)
moel@130
   677
            v.Add(new Voltage("Voltage #" + (i + 1), i, true));
moel@130
   678
          for (int i = 0; i < superIO.Temperatures.Length; i++)
moel@130
   679
            t.Add(new Temperature("Temperature #" + (i + 1), i));
moel@130
   680
          for (int i = 0; i < superIO.Fans.Length; i++)
moel@130
   681
            f.Add(new Fan("Fan #" + (i + 1), i));
moel@130
   682
          break;
moel@130
   683
      }
moel@130
   684
moel@195
   685
      const string formula = "Voltage = value + (value - Vf) * Ri / Rf.";
moel@130
   686
      foreach (Voltage voltage in v) 
moel@130
   687
        if (voltage.Index < superIO.Voltages.Length) {
moel@130
   688
          Sensor sensor = new Sensor(voltage.Name, voltage.Index, 
moel@195
   689
            voltage.Hidden, SensorType.Voltage, this, new [] {
moel@130
   690
            new ParameterDescription("Ri [kΩ]", "Input resistance.\n" + 
moel@130
   691
              formula, voltage.Ri),
moel@130
   692
            new ParameterDescription("Rf [kΩ]", "Reference resistance.\n" + 
moel@130
   693
              formula, voltage.Rf),
moel@130
   694
            new ParameterDescription("Vf [V]", "Reference voltage.\n" + 
moel@130
   695
              formula, voltage.Vf)
moel@165
   696
            }, settings);
moel@130
   697
          voltages.Add(sensor);
moel@130
   698
      }
moel@130
   699
moel@130
   700
      foreach (Temperature temperature in t) 
moel@130
   701
        if (temperature.Index < superIO.Temperatures.Length) {
moel@134
   702
        Sensor sensor = new Sensor(temperature.Name, temperature.Index,
moel@195
   703
          SensorType.Temperature, this, new [] {
moel@130
   704
          new ParameterDescription("Offset [°C]", "Temperature offset.", 0)
moel@165
   705
        }, settings);
moel@130
   706
        temperatures.Add(sensor);
moel@130
   707
      }
moel@130
   708
moel@130
   709
      foreach (Fan fan in f)
moel@130
   710
        if (fan.Index < superIO.Fans.Length) {
moel@134
   711
          Sensor sensor = new Sensor(fan.Name, fan.Index, SensorType.Fan,
moel@165
   712
            this, settings);
moel@130
   713
          fans.Add(sensor);
moel@130
   714
        }
moel@130
   715
    }
moel@130
   716
moel@130
   717
    public override Identifier Identifier {
moel@166
   718
      get { 
moel@166
   719
        return new Identifier("lpc", 
moel@166
   720
          superIO.Chip.ToString().ToLower(CultureInfo.InvariantCulture)); 
moel@166
   721
      }
moel@130
   722
    }
moel@130
   723
moel@165
   724
    public override HardwareType HardwareType {
moel@165
   725
      get { return HardwareType.SuperIO; }
moel@130
   726
    }
moel@130
   727
moel@176
   728
    public override IHardware Parent {
moel@176
   729
      get { return mainboard; }
moel@176
   730
    }
moel@176
   731
moel@130
   732
    public override string Name {
moel@130
   733
      get { return name; }
moel@130
   734
    }
moel@130
   735
moel@130
   736
    public override string GetReport() {
moel@130
   737
      return superIO.GetReport();
moel@130
   738
    }
moel@130
   739
moel@130
   740
    public override void Update() {
moel@130
   741
      superIO.Update();
moel@130
   742
moel@130
   743
      foreach (Sensor sensor in voltages) {
moel@130
   744
        float? value = superIO.Voltages[sensor.Index];
moel@130
   745
        if (value.HasValue) {
moel@130
   746
          sensor.Value = value + (value - sensor.Parameters[2].Value) *
moel@130
   747
            sensor.Parameters[0].Value / sensor.Parameters[1].Value;
moel@130
   748
          ActivateSensor(sensor);
moel@130
   749
        }
moel@130
   750
      }
moel@130
   751
moel@130
   752
      foreach (Sensor sensor in temperatures) {
moel@130
   753
        float? value = superIO.Temperatures[sensor.Index];
moel@130
   754
        if (value.HasValue) {
moel@130
   755
          sensor.Value = value + sensor.Parameters[0].Value;
moel@130
   756
          ActivateSensor(sensor);
moel@130
   757
        }
moel@130
   758
      }
moel@130
   759
moel@130
   760
      foreach (Sensor sensor in fans) {
moel@130
   761
        float? value = superIO.Fans[sensor.Index];
moel@130
   762
        if (value.HasValue) {
moel@130
   763
          sensor.Value = value;
moel@130
   764
          if (value.Value > 0)
moel@130
   765
            ActivateSensor(sensor);
moel@130
   766
        }
moel@130
   767
      }
moel@130
   768
    }
moel@130
   769
moel@130
   770
    private class Voltage {
moel@130
   771
      public readonly string Name;
moel@130
   772
      public readonly int Index;
moel@130
   773
      public readonly float Ri;
moel@130
   774
      public readonly float Rf;
moel@130
   775
      public readonly float Vf;
moel@130
   776
      public readonly bool Hidden;
moel@130
   777
moel@202
   778
      public Voltage(string name, int index) :
moel@202
   779
        this(name, index, false) { }
moel@202
   780
      
moel@130
   781
      public Voltage(string name, int index, bool hidden) :
moel@130
   782
        this(name, index, 0, 1, 0, hidden) { }
moel@202
   783
      
moel@202
   784
      public Voltage(string name, int index, float ri, float rf) :
moel@202
   785
        this(name, index, ri, rf, 0, false) { }
moel@202
   786
      
moel@202
   787
      // float ri = 0, float rf = 1, float vf = 0, bool hidden = false) 
moel@202
   788
      
moel@195
   789
      public Voltage(string name, int index, 
moel@202
   790
        float ri, float rf, float vf, bool hidden) 
moel@195
   791
      {
moel@130
   792
        this.Name = name;
moel@130
   793
        this.Index = index;
moel@130
   794
        this.Ri = ri;
moel@130
   795
        this.Rf = rf;
moel@130
   796
        this.Vf = vf;
moel@130
   797
        this.Hidden = hidden;
moel@130
   798
      }
moel@130
   799
    }
moel@130
   800
moel@130
   801
    private class Temperature {
moel@130
   802
      public readonly string Name;
moel@130
   803
      public readonly int Index;
moel@130
   804
moel@167
   805
      public Temperature(string name, int index) {
moel@130
   806
        this.Name = name;
moel@130
   807
        this.Index = index;
moel@130
   808
      }
moel@130
   809
    }
moel@130
   810
moel@130
   811
    private class Fan {
moel@130
   812
      public readonly string Name;
moel@130
   813
      public readonly int Index;
moel@130
   814
moel@130
   815
      public Fan(string name, int index) {
moel@130
   816
        this.Name = name;
moel@130
   817
        this.Index = index;
moel@130
   818
      }
moel@130
   819
    }
moel@130
   820
  }
moel@130
   821
}