Hardware/Mainboard/SuperIOHardware.cs
author moel.mich
Mon, 28 May 2012 13:45:38 +0000
changeset 351 d389607e74ca
parent 341 5172a92c5c20
child 352 0899f651d5cf
permissions -rw-r--r--
Added support for reading more than one TBalancer fan controller.
moel@135
     1
/*
moel@130
     2
 
moel@344
     3
  This Source Code Form is subject to the terms of the Mozilla Public
moel@344
     4
  License, v. 2.0. If a copy of the MPL was not distributed with this
moel@344
     5
  file, You can obtain one at http://mozilla.org/MPL/2.0/.
moel@130
     6
 
moel@344
     7
  Copyright (C) 2009-2012 Michael Möller <mmoeller@openhardwaremonitor.org>
moel@344
     8
	
moel@130
     9
*/
moel@130
    10
moel@228
    11
using System;
moel@130
    12
using System.Collections.Generic;
moel@166
    13
using System.Globalization;
moel@228
    14
using System.Threading;
moel@130
    15
using OpenHardwareMonitor.Hardware.LPC;
moel@130
    16
moel@130
    17
namespace OpenHardwareMonitor.Hardware.Mainboard {
moel@165
    18
  internal class SuperIOHardware : Hardware {
moel@130
    19
moel@195
    20
    private readonly Mainboard mainboard;
moel@195
    21
    private readonly ISuperIO superIO;
moel@130
    22
moel@195
    23
    private readonly List<Sensor> voltages = new List<Sensor>();
moel@195
    24
    private readonly List<Sensor> temperatures = new List<Sensor>();
moel@195
    25
    private readonly List<Sensor> fans = new List<Sensor>();
moel@323
    26
    private readonly List<Sensor> controls = new List<Sensor>();
moel@167
    27
moel@228
    28
    private delegate float? ReadValueDelegate(int index);
moel@228
    29
    private delegate void UpdateDelegate();
moel@228
    30
moel@228
    31
    // delegates for mainboard specific sensor reading code
moel@228
    32
    private readonly ReadValueDelegate readVoltage;
moel@228
    33
    private readonly ReadValueDelegate readTemperature;
moel@228
    34
    private readonly ReadValueDelegate readFan;
moel@323
    35
    private readonly ReadValueDelegate readControl;
moel@228
    36
moel@228
    37
    // delegate for post update mainboard specific code
moel@228
    38
    private readonly UpdateDelegate postUpdate;
moel@228
    39
moel@228
    40
    // mainboard specific mutex
moel@228
    41
    private readonly Mutex mutex;
moel@228
    42
moel@176
    43
    public SuperIOHardware(Mainboard mainboard, ISuperIO superIO, 
moel@176
    44
      Manufacturer manufacturer, Model model, ISettings settings) 
moel@275
    45
      : base(ChipName.GetName(superIO.Chip), new Identifier("lpc", 
moel@275
    46
        superIO.Chip.ToString().ToLower(CultureInfo.InvariantCulture)), 
moel@275
    47
        settings)
moel@130
    48
    {
moel@176
    49
      this.mainboard = mainboard;
moel@130
    50
      this.superIO = superIO;
moel@130
    51
moel@228
    52
      this.readVoltage = (index) => superIO.Voltages[index];
moel@228
    53
      this.readTemperature = (index) => superIO.Temperatures[index];
moel@228
    54
      this.readFan = (index) => superIO.Fans[index];
moel@323
    55
      this.readControl = (index) => superIO.Controls[index];
moel@228
    56
moel@228
    57
      this.postUpdate = () => { };
moel@228
    58
moel@130
    59
      List<Voltage> v = new List<Voltage>();
moel@130
    60
      List<Temperature> t = new List<Temperature>();
moel@130
    61
      List<Fan> f = new List<Fan>();
moel@323
    62
      List<Ctrl> c = new List<Ctrl>();
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@319
    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@228
   122
                  
moel@221
   123
                  v.Add(new Voltage("CPU VCore", 0));
moel@221
   124
                  v.Add(new Voltage("+3.3V", 2));
moel@221
   125
                  v.Add(new Voltage("+12V", 4, 30, 10));
moel@221
   126
                  v.Add(new Voltage("+5V", 5, 6.8f, 10));
moel@221
   127
                  v.Add(new Voltage("VBat", 8));                  
moel@221
   128
                  t.Add(new Temperature("CPU", 0));
moel@221
   129
                  t.Add(new Temperature("Motherboard", 1));
moel@221
   130
                  f.Add(new Fan("CPU Fan", 0));
moel@221
   131
                  f.Add(new Fan("Chassis Fan #1", 1));
moel@228
   132
moel@228
   133
                  // this mutex is also used by the official ASRock tool
moel@228
   134
                  mutex = new Mutex(false, "ASRockOCMark");
moel@228
   135
                  
moel@228
   136
                  bool exclusiveAccess = false;
moel@228
   137
                  try {
moel@228
   138
                    exclusiveAccess = mutex.WaitOne(10, false);
moel@228
   139
                  } catch (AbandonedMutexException) { } 
moel@228
   140
                    catch (InvalidOperationException) { }  
moel@228
   141
moel@228
   142
                  // only read additional fans if we get exclusive access
moel@228
   143
                  if (exclusiveAccess) {
moel@228
   144
moel@228
   145
                    f.Add(new Fan("Chassis Fan #2", 2));
moel@228
   146
                    f.Add(new Fan("Chassis Fan #3", 3));
moel@228
   147
                    f.Add(new Fan("Power Fan", 4));
moel@228
   148
moel@228
   149
                    readFan = (index) => {
moel@228
   150
                      if (index < 2) {
moel@228
   151
                        return superIO.Fans[index];
moel@228
   152
                      } else {
moel@228
   153
                        // get GPIO 80-87
moel@228
   154
                        byte? gpio = superIO.ReadGPIO(7);
moel@228
   155
                        if (!gpio.HasValue)
moel@228
   156
                          return null;
moel@228
   157
moel@228
   158
                        // read the last 3 fans based on GPIO 83-85
moel@228
   159
                        int[] masks = { 0x05, 0x03, 0x06 };
moel@228
   160
                        return (((gpio.Value >> 3) & 0x07) ==
moel@228
   161
                          masks[index - 2]) ? superIO.Fans[2] : null;
moel@228
   162
                      }
moel@228
   163
                    };
moel@228
   164
moel@228
   165
                    int fanIndex = 0;
moel@228
   166
                    postUpdate = () => {
moel@228
   167
                      // get GPIO 80-87
moel@228
   168
                      byte? gpio = superIO.ReadGPIO(7);
moel@228
   169
                      if (!gpio.HasValue)
moel@228
   170
                        return;
moel@228
   171
moel@228
   172
                      // prepare the GPIO 83-85 for the next update
moel@228
   173
                      int[] masks = { 0x05, 0x03, 0x06 };
moel@228
   174
                      superIO.WriteGPIO(7,
moel@228
   175
                        (byte)((gpio.Value & 0xC7) | (masks[fanIndex] << 3)));
moel@228
   176
                      fanIndex = (fanIndex + 1) % 3;
moel@228
   177
                    };
moel@228
   178
                  }
moel@228
   179
moel@221
   180
                  break;
moel@221
   181
                default:
moel@221
   182
                  v.Add(new Voltage("CPU VCore", 0));
moel@221
   183
                  v.Add(new Voltage("Voltage #2", 1, true));
moel@221
   184
                  v.Add(new Voltage("Voltage #3", 2, true));
moel@221
   185
                  v.Add(new Voltage("Voltage #4", 3, true));
moel@221
   186
                  v.Add(new Voltage("Voltage #5", 4, true));
moel@221
   187
                  v.Add(new Voltage("Voltage #6", 5, true));
moel@221
   188
                  v.Add(new Voltage("Voltage #7", 6, true));
moel@221
   189
                  v.Add(new Voltage("Voltage #8", 7, true));
moel@221
   190
                  v.Add(new Voltage("VBat", 8));
moel@221
   191
                  for (int i = 0; i < superIO.Temperatures.Length; i++)
moel@221
   192
                    t.Add(new Temperature("Temperature #" + (i + 1), i));
moel@221
   193
                  for (int i = 0; i < superIO.Fans.Length; i++)
moel@221
   194
                    f.Add(new Fan("Fan #" + (i + 1), i));
moel@221
   195
                  break;
moel@221
   196
              };
moel@221
   197
              break;
moel@221
   198
moel@130
   199
            case Manufacturer.DFI:
moel@130
   200
              switch (model) {
moel@168
   201
                case Model.LP_BI_P45_T2RS_Elite: // IT8718F
moel@130
   202
                  v.Add(new Voltage("CPU VCore", 0));
moel@130
   203
                  v.Add(new Voltage("FSB VTT", 1));
moel@130
   204
                  v.Add(new Voltage("+3.3V", 2));
moel@195
   205
                  v.Add(new Voltage("+5V", 3, 6.8f, 10));
moel@195
   206
                  v.Add(new Voltage("+12V", 4, 30, 10));
moel@130
   207
                  v.Add(new Voltage("NB Core", 5));
moel@130
   208
                  v.Add(new Voltage("VDIMM", 6));
moel@195
   209
                  v.Add(new Voltage("+5VSB", 7, 6.8f, 10));
moel@130
   210
                  v.Add(new Voltage("VBat", 8));
moel@130
   211
                  t.Add(new Temperature("CPU", 0));
moel@130
   212
                  t.Add(new Temperature("System", 1));
moel@130
   213
                  t.Add(new Temperature("Chipset", 2));
moel@130
   214
                  f.Add(new Fan("Fan #1", 0));
moel@130
   215
                  f.Add(new Fan("Fan #2", 1));
moel@130
   216
                  f.Add(new Fan("Fan #3", 2));
moel@130
   217
                  break;
moel@168
   218
                case Model.LP_DK_P55_T3eH9: // IT8720F
moel@130
   219
                  v.Add(new Voltage("CPU VCore", 0));
moel@130
   220
                  v.Add(new Voltage("VTT", 1));
moel@130
   221
                  v.Add(new Voltage("+3.3V", 2));
moel@195
   222
                  v.Add(new Voltage("+5V", 3, 6.8f, 10));
moel@195
   223
                  v.Add(new Voltage("+12V", 4, 30, 10));
moel@130
   224
                  v.Add(new Voltage("CPU PLL", 5));
moel@130
   225
                  v.Add(new Voltage("DRAM", 6));
moel@195
   226
                  v.Add(new Voltage("+5VSB", 7, 6.8f, 10));
moel@130
   227
                  v.Add(new Voltage("VBat", 8));
moel@130
   228
                  t.Add(new Temperature("Chipset", 0));
moel@130
   229
                  t.Add(new Temperature("CPU PWM", 1));
moel@130
   230
                  t.Add(new Temperature("CPU", 2));
moel@130
   231
                  f.Add(new Fan("Fan #1", 0));
moel@130
   232
                  f.Add(new Fan("Fan #2", 1));
moel@130
   233
                  f.Add(new Fan("Fan #3", 2));
moel@130
   234
                  break;
moel@130
   235
                default:
moel@130
   236
                  v.Add(new Voltage("CPU VCore", 0));
moel@130
   237
                  v.Add(new Voltage("VTT", 1, true));
moel@130
   238
                  v.Add(new Voltage("+3.3V", 2, true));
moel@130
   239
                  v.Add(new Voltage("+5V", 3, 6.8f, 10, 0, true));
moel@130
   240
                  v.Add(new Voltage("+12V", 4, 30, 10, 0, true));
moel@130
   241
                  v.Add(new Voltage("Voltage #6", 5, true));
moel@130
   242
                  v.Add(new Voltage("DRAM", 6, true));
moel@130
   243
                  v.Add(new Voltage("+5VSB", 7, 6.8f, 10, 0, true));
moel@130
   244
                  v.Add(new Voltage("VBat", 8));
moel@130
   245
                  for (int i = 0; i < superIO.Temperatures.Length; i++)
moel@130
   246
                    t.Add(new Temperature("Temperature #" + (i + 1), i));
moel@130
   247
                  for (int i = 0; i < superIO.Fans.Length; i++)
moel@130
   248
                    f.Add(new Fan("Fan #" + (i + 1), i));
moel@130
   249
                  break;
moel@130
   250
              }
moel@130
   251
              break;
moel@130
   252
moel@130
   253
            case Manufacturer.Gigabyte:
moel@130
   254
              switch (model) {
moel@168
   255
                case Model._965P_S3: // IT8718F
moel@130
   256
                  v.Add(new Voltage("CPU VCore", 0));
moel@130
   257
                  v.Add(new Voltage("DRAM", 1));
moel@130
   258
                  v.Add(new Voltage("+3.3V", 2));
moel@195
   259
                  v.Add(new Voltage("+5V", 3, 6.8f, 10));
moel@195
   260
                  v.Add(new Voltage("+12V", 7, 27, 9.1f));
moel@130
   261
                  v.Add(new Voltage("VBat", 8));
moel@130
   262
                  t.Add(new Temperature("System", 0));
moel@130
   263
                  t.Add(new Temperature("CPU", 1));
moel@130
   264
                  f.Add(new Fan("CPU Fan", 0));
moel@130
   265
                  f.Add(new Fan("System Fan", 1));
moel@130
   266
                  break;
moel@168
   267
                case Model.EP45_DS3R: // IT8718F
moel@130
   268
                case Model.EP45_UD3R: 
moel@138
   269
                case Model.X38_DS5:    
moel@130
   270
                  v.Add(new Voltage("CPU VCore", 0));
moel@130
   271
                  v.Add(new Voltage("DRAM", 1));
moel@130
   272
                  v.Add(new Voltage("+3.3V", 2));
moel@195
   273
                  v.Add(new Voltage("+5V", 3, 6.8f, 10));
moel@195
   274
                  v.Add(new Voltage("+12V", 7, 27, 9.1f));
moel@130
   275
                  v.Add(new Voltage("VBat", 8));
moel@130
   276
                  t.Add(new Temperature("System", 0));
moel@130
   277
                  t.Add(new Temperature("CPU", 1));
moel@130
   278
                  f.Add(new Fan("CPU Fan", 0));
moel@130
   279
                  f.Add(new Fan("System Fan #2", 1));
moel@130
   280
                  f.Add(new Fan("Power Fan", 2));
moel@130
   281
                  f.Add(new Fan("System Fan #1", 3));
moel@130
   282
                  break;
moel@168
   283
                case Model.EX58_EXTREME: // IT8720F 
moel@133
   284
                  v.Add(new Voltage("CPU VCore", 0));
moel@133
   285
                  v.Add(new Voltage("DRAM", 1));
moel@195
   286
                  v.Add(new Voltage("+5V", 3, 6.8f, 10));
moel@133
   287
                  v.Add(new Voltage("VBat", 8));
moel@133
   288
                  t.Add(new Temperature("System", 0));
moel@133
   289
                  t.Add(new Temperature("CPU", 1));
moel@138
   290
                  t.Add(new Temperature("Northbridge", 2));
moel@133
   291
                  f.Add(new Fan("CPU Fan", 0));
moel@133
   292
                  f.Add(new Fan("System Fan #2", 1));
moel@133
   293
                  f.Add(new Fan("Power Fan", 2));
moel@133
   294
                  f.Add(new Fan("System Fan #1", 3));
moel@133
   295
                  break;
moel@168
   296
                case Model.P35_DS3: // IT8718F 
moel@168
   297
                case Model.P35_DS3L: // IT8718F
moel@130
   298
                  v.Add(new Voltage("CPU VCore", 0));
moel@130
   299
                  v.Add(new Voltage("DRAM", 1));
moel@130
   300
                  v.Add(new Voltage("+3.3V", 2));
moel@195
   301
                  v.Add(new Voltage("+5V", 3, 6.8f, 10));
moel@195
   302
                  v.Add(new Voltage("+12V", 7, 27, 9.1f));
moel@130
   303
                  v.Add(new Voltage("VBat", 8));
moel@130
   304
                  t.Add(new Temperature("System", 0));
moel@130
   305
                  t.Add(new Temperature("CPU", 1));
moel@130
   306
                  f.Add(new Fan("CPU Fan", 0));
moel@130
   307
                  f.Add(new Fan("System Fan #1", 1));
moel@130
   308
                  f.Add(new Fan("System Fan #2", 2));
moel@130
   309
                  f.Add(new Fan("Power Fan", 3));
moel@130
   310
                  break;
moel@168
   311
                case Model.P55_UD4: // IT8720F
moel@168
   312
                case Model.P55M_UD4: // IT8720F
moel@148
   313
                  v.Add(new Voltage("CPU VCore", 0));
moel@148
   314
                  v.Add(new Voltage("DRAM", 1));
moel@148
   315
                  v.Add(new Voltage("+3.3V", 2));
moel@195
   316
                  v.Add(new Voltage("+5V", 3, 6.8f, 10));
moel@195
   317
                  v.Add(new Voltage("+12V", 5, 27, 9.1f));
moel@148
   318
                  v.Add(new Voltage("VBat", 8));
moel@148
   319
                  t.Add(new Temperature("System", 0));
moel@148
   320
                  t.Add(new Temperature("CPU", 2));
moel@148
   321
                  f.Add(new Fan("CPU Fan", 0));
moel@148
   322
                  f.Add(new Fan("System Fan #2", 1));
moel@148
   323
                  f.Add(new Fan("Power Fan", 2));
moel@148
   324
                  f.Add(new Fan("System Fan #1", 3));
moel@148
   325
                  break;
moel@168
   326
                case Model.GA_MA770T_UD3: // IT8720F
moel@154
   327
                  v.Add(new Voltage("CPU VCore", 0));
moel@154
   328
                  v.Add(new Voltage("DRAM", 1));
moel@154
   329
                  v.Add(new Voltage("+3.3V", 2));
moel@195
   330
                  v.Add(new Voltage("+5V", 3, 6.8f, 10));
moel@195
   331
                  v.Add(new Voltage("+12V", 4, 27, 9.1f));
moel@154
   332
                  v.Add(new Voltage("VBat", 8));
moel@154
   333
                  t.Add(new Temperature("System", 0));
moel@154
   334
                  t.Add(new Temperature("CPU", 1));
moel@154
   335
                  f.Add(new Fan("CPU Fan", 0));
moel@154
   336
                  f.Add(new Fan("System Fan #1", 1));
moel@154
   337
                  f.Add(new Fan("System Fan #2", 2));
moel@154
   338
                  f.Add(new Fan("Power Fan", 3));
moel@154
   339
                  break;
moel@168
   340
                case Model.GA_MA785GMT_UD2H: // IT8718F
moel@130
   341
                  v.Add(new Voltage("CPU VCore", 0));
moel@130
   342
                  v.Add(new Voltage("DRAM", 1));
moel@130
   343
                  v.Add(new Voltage("+3.3V", 2));
moel@195
   344
                  v.Add(new Voltage("+5V", 3, 6.8f, 10));
moel@195
   345
                  v.Add(new Voltage("+12V", 4, 27, 9.1f));
moel@130
   346
                  v.Add(new Voltage("VBat", 8));
moel@130
   347
                  t.Add(new Temperature("System", 0));
moel@130
   348
                  t.Add(new Temperature("CPU", 1));
moel@130
   349
                  f.Add(new Fan("CPU Fan", 0));
moel@130
   350
                  f.Add(new Fan("System Fan", 1));
moel@130
   351
                  f.Add(new Fan("NB Fan", 2));
moel@130
   352
                  break;
moel@168
   353
                case Model.X58A_UD3R: // IT8720F 
moel@138
   354
                  v.Add(new Voltage("CPU VCore", 0));
moel@138
   355
                  v.Add(new Voltage("DRAM", 1));
moel@138
   356
                  v.Add(new Voltage("+3.3V", 2));
moel@195
   357
                  v.Add(new Voltage("+5V", 3, 6.8f, 10));
moel@195
   358
                  v.Add(new Voltage("+12V", 5, 27, 9.1f));
moel@138
   359
                  v.Add(new Voltage("VBat", 8));
moel@138
   360
                  t.Add(new Temperature("System", 0));
moel@138
   361
                  t.Add(new Temperature("CPU", 1));
moel@138
   362
                  t.Add(new Temperature("Northbridge", 2));
moel@138
   363
                  f.Add(new Fan("CPU Fan", 0));
moel@138
   364
                  f.Add(new Fan("System Fan #2", 1));
moel@138
   365
                  f.Add(new Fan("Power Fan", 2));
moel@138
   366
                  f.Add(new Fan("System Fan #1", 3));
moel@138
   367
                  break;
moel@130
   368
                default:
moel@130
   369
                  v.Add(new Voltage("CPU VCore", 0));
moel@130
   370
                  v.Add(new Voltage("DRAM", 1, true));
moel@130
   371
                  v.Add(new Voltage("+3.3V", 2, true));
moel@130
   372
                  v.Add(new Voltage("+5V", 3, 6.8f, 10, 0, true));
moel@130
   373
                  v.Add(new Voltage("Voltage #5", 4, true));
moel@130
   374
                  v.Add(new Voltage("Voltage #6", 5, true));
moel@130
   375
                  v.Add(new Voltage("Voltage #7", 6, true));
moel@257
   376
                  v.Add(new Voltage("Voltage #8", 7, true));
moel@130
   377
                  v.Add(new Voltage("VBat", 8));
moel@130
   378
                  for (int i = 0; i < superIO.Temperatures.Length; i++)
moel@130
   379
                    t.Add(new Temperature("Temperature #" + (i + 1), i));
moel@130
   380
                  for (int i = 0; i < superIO.Fans.Length; i++)
moel@130
   381
                    f.Add(new Fan("Fan #" + (i + 1), i));
moel@130
   382
                  break;
moel@130
   383
              }
moel@130
   384
              break;
moel@130
   385
moel@130
   386
            default:
moel@130
   387
              v.Add(new Voltage("CPU VCore", 0));
moel@130
   388
              v.Add(new Voltage("Voltage #2", 1, true));
moel@130
   389
              v.Add(new Voltage("Voltage #3", 2, true));
moel@130
   390
              v.Add(new Voltage("Voltage #4", 3, true));
moel@130
   391
              v.Add(new Voltage("Voltage #5", 4, true));
moel@130
   392
              v.Add(new Voltage("Voltage #6", 5, true));
moel@130
   393
              v.Add(new Voltage("Voltage #7", 6, true));
moel@130
   394
              v.Add(new Voltage("Voltage #8", 7, true));
moel@130
   395
              v.Add(new Voltage("VBat", 8));
moel@130
   396
              for (int i = 0; i < superIO.Temperatures.Length; i++)
moel@130
   397
                t.Add(new Temperature("Temperature #" + (i + 1), i));
moel@130
   398
              for (int i = 0; i < superIO.Fans.Length; i++)
moel@130
   399
                f.Add(new Fan("Fan #" + (i + 1), i));
moel@130
   400
              break;
moel@130
   401
          }
moel@130
   402
          break;
moel@170
   403
moel@170
   404
        case Chip.IT8721F:
moel@277
   405
        case Chip.IT8728F:
moel@341
   406
        case Chip.IT8771E:
moel@319
   407
        case Chip.IT8772E:
moel@177
   408
          switch (manufacturer) {
moel@177
   409
            case Manufacturer.ECS:
moel@177
   410
              switch (model) {
moel@177
   411
                case Model.A890GXM_A: // IT8721F
moel@177
   412
                  v.Add(new Voltage("CPU VCore", 0));
moel@177
   413
                  v.Add(new Voltage("VDIMM", 1));
moel@177
   414
                  v.Add(new Voltage("NB Voltage", 2));
moel@195
   415
                  v.Add(new Voltage("Analog +3.3V", 3, 10, 10));
moel@177
   416
                  // v.Add(new Voltage("VDIMM", 6, true));
moel@195
   417
                  v.Add(new Voltage("Standby +3.3V", 7, 10, 10));
moel@195
   418
                  v.Add(new Voltage("VBat", 8, 10, 10));
moel@177
   419
                  t.Add(new Temperature("CPU", 0));
moel@177
   420
                  t.Add(new Temperature("System", 1));
moel@177
   421
                  t.Add(new Temperature("Northbridge", 2));
moel@177
   422
                  f.Add(new Fan("CPU Fan", 0));
moel@177
   423
                  f.Add(new Fan("System Fan", 1));
moel@177
   424
                  f.Add(new Fan("Power Fan", 2));
moel@177
   425
                  break;
moel@177
   426
                default:
moel@177
   427
                  v.Add(new Voltage("Voltage #1", 0, true));
moel@177
   428
                  v.Add(new Voltage("Voltage #2", 1, true));
moel@177
   429
                  v.Add(new Voltage("Voltage #3", 2, true));
moel@177
   430
                  v.Add(new Voltage("Analog +3.3V", 3, 10, 10, 0, true));
moel@177
   431
                  v.Add(new Voltage("Voltage #5", 4, true));
moel@177
   432
                  v.Add(new Voltage("Voltage #6", 5, true));
moel@177
   433
                  v.Add(new Voltage("Voltage #7", 6, true));
moel@177
   434
                  v.Add(new Voltage("Standby +3.3V", 7, 10, 10, 0, true));
moel@195
   435
                  v.Add(new Voltage("VBat", 8, 10, 10));
moel@177
   436
                  for (int i = 0; i < superIO.Temperatures.Length; i++)
moel@177
   437
                    t.Add(new Temperature("Temperature #" + (i + 1), i));
moel@177
   438
                  for (int i = 0; i < superIO.Fans.Length; i++)
moel@177
   439
                    f.Add(new Fan("Fan #" + (i + 1), i));
moel@177
   440
                  break;
moel@177
   441
              }
moel@177
   442
              break;
moel@278
   443
            case Manufacturer.Gigabyte:
moel@278
   444
              switch (model) {
moel@290
   445
                case Model.P67A_UD4_B3: // IT8728F
moel@278
   446
                  v.Add(new Voltage("+12V", 0, 100, 10));
moel@278
   447
                  v.Add(new Voltage("+5V", 1, 15, 10));
moel@278
   448
                  v.Add(new Voltage("Voltage #3", 2, true));
moel@278
   449
                  v.Add(new Voltage("Voltage #4", 3, true));
moel@278
   450
                  v.Add(new Voltage("Voltage #5", 4, true));
moel@278
   451
                  v.Add(new Voltage("CPU VCore", 5));
moel@278
   452
                  v.Add(new Voltage("DRAM", 6));
moel@278
   453
                  v.Add(new Voltage("Standby +3.3V", 7, 10, 10));
moel@278
   454
                  v.Add(new Voltage("VBat", 8, 10, 10));
moel@278
   455
                  t.Add(new Temperature("System", 0));
moel@278
   456
                  t.Add(new Temperature("CPU", 2));
moel@278
   457
                  f.Add(new Fan("CPU Fan", 0));
moel@278
   458
                  f.Add(new Fan("System Fan #2", 1));
moel@278
   459
                  f.Add(new Fan("Power Fan", 2));
moel@278
   460
                  f.Add(new Fan("System Fan #1", 3));
moel@278
   461
                  break;
moel@290
   462
                case Model.H67A_UD3H_B3: // IT8728F
moel@290
   463
                  v.Add(new Voltage("VTT", 0));
moel@290
   464
                  v.Add(new Voltage("+5V", 1, 15, 10));
moel@290
   465
                  v.Add(new Voltage("+12V", 2, 68, 22));
moel@290
   466
                  v.Add(new Voltage("Voltage #4", 3, true));
moel@290
   467
                  v.Add(new Voltage("Voltage #5", 4, true));
moel@290
   468
                  v.Add(new Voltage("CPU VCore", 5));
moel@290
   469
                  v.Add(new Voltage("DRAM", 6));
moel@290
   470
                  v.Add(new Voltage("Standby +3.3V", 7, 10, 10));
moel@290
   471
                  v.Add(new Voltage("VBat", 8, 10, 10));
moel@290
   472
                  t.Add(new Temperature("System", 0));
moel@290
   473
                  t.Add(new Temperature("CPU", 2));
moel@290
   474
                  f.Add(new Fan("CPU Fan", 0));
moel@290
   475
                  f.Add(new Fan("System Fan #1", 1));
moel@290
   476
                  f.Add(new Fan("Power Fan", 2));
moel@290
   477
                  f.Add(new Fan("System Fan #2", 3));
moel@290
   478
                  break;
moel@305
   479
                case Model.Z68X_UD7_B3: // IT8728F
moel@305
   480
                  v.Add(new Voltage("VTT", 0));
moel@307
   481
                  v.Add(new Voltage("+3.3V", 1, 13.3f, 20.5f));
moel@305
   482
                  v.Add(new Voltage("+12V", 2, 68, 22));
moel@307
   483
                  v.Add(new Voltage("+5V", 3, 14.3f, 20));
moel@305
   484
                  v.Add(new Voltage("CPU VCore", 5));
moel@305
   485
                  v.Add(new Voltage("DRAM", 6));
moel@305
   486
                  v.Add(new Voltage("Standby +3.3V", 7, 10, 10));
moel@305
   487
                  v.Add(new Voltage("VBat", 8, 10, 10));
moel@305
   488
                  t.Add(new Temperature("System", 0));
moel@305
   489
                  t.Add(new Temperature("CPU", 1));
moel@305
   490
                  t.Add(new Temperature("System 3", 2));
moel@305
   491
                  f.Add(new Fan("CPU Fan", 0));
moel@305
   492
                  f.Add(new Fan("Power Fan", 1));
moel@305
   493
                  f.Add(new Fan("System Fan #1", 2));
moel@305
   494
                  f.Add(new Fan("System Fan #2", 3));
moel@305
   495
                  f.Add(new Fan("System Fan #3", 4));
moel@305
   496
                  break;
moel@278
   497
                default:
moel@278
   498
                  v.Add(new Voltage("Voltage #1", 0, true));
moel@278
   499
                  v.Add(new Voltage("Voltage #2", 1, true));
moel@278
   500
                  v.Add(new Voltage("Voltage #3", 2, true));
moel@278
   501
                  v.Add(new Voltage("Voltage #4", 3, true));
moel@278
   502
                  v.Add(new Voltage("Voltage #5", 4, true));
moel@278
   503
                  v.Add(new Voltage("Voltage #6", 5, true));
moel@278
   504
                  v.Add(new Voltage("Voltage #7", 6, true));
moel@278
   505
                  v.Add(new Voltage("Standby +3.3V", 7, 10, 10, 0, true));
moel@278
   506
                  v.Add(new Voltage("VBat", 8, 10, 10));
moel@278
   507
                  for (int i = 0; i < superIO.Temperatures.Length; i++)
moel@278
   508
                    t.Add(new Temperature("Temperature #" + (i + 1), i));
moel@278
   509
                  for (int i = 0; i < superIO.Fans.Length; i++)
moel@278
   510
                    f.Add(new Fan("Fan #" + (i + 1), i));
moel@278
   511
                  break;
moel@278
   512
              }
moel@278
   513
              break;
moel@320
   514
            case Manufacturer.Shuttle:
moel@320
   515
              switch (model) {
moel@320
   516
                case Model.FH67: // IT8772E 
moel@320
   517
                  v.Add(new Voltage("CPU VCore", 0));
moel@320
   518
                  v.Add(new Voltage("DRAM", 1));
moel@320
   519
                  v.Add(new Voltage("PCH VCCIO", 2));
moel@320
   520
                  v.Add(new Voltage("CPU VCCIO", 3));
moel@320
   521
                  v.Add(new Voltage("Graphic Voltage", 4));
moel@320
   522
                  v.Add(new Voltage("Standby +3.3V", 7, 10, 10));
moel@320
   523
                  v.Add(new Voltage("VBat", 8, 10, 10));
moel@320
   524
                  t.Add(new Temperature("System", 0));
moel@320
   525
                  t.Add(new Temperature("CPU", 1));                  
moel@320
   526
                  f.Add(new Fan("Fan #1", 0));
moel@320
   527
                  f.Add(new Fan("CPU Fan", 1));
moel@320
   528
                  break;
moel@320
   529
                default:
moel@320
   530
                  v.Add(new Voltage("Voltage #1", 0, true));
moel@320
   531
                  v.Add(new Voltage("Voltage #2", 1, true));
moel@320
   532
                  v.Add(new Voltage("Voltage #3", 2, true));
moel@320
   533
                  v.Add(new Voltage("Voltage #4", 3, true));
moel@320
   534
                  v.Add(new Voltage("Voltage #5", 4, true));
moel@320
   535
                  v.Add(new Voltage("Voltage #6", 5, true));
moel@320
   536
                  v.Add(new Voltage("Voltage #7", 6, true));
moel@320
   537
                  v.Add(new Voltage("Standby +3.3V", 7, 10, 10, 0, true));
moel@320
   538
                  v.Add(new Voltage("VBat", 8, 10, 10));
moel@320
   539
                  for (int i = 0; i < superIO.Temperatures.Length; i++)
moel@320
   540
                    t.Add(new Temperature("Temperature #" + (i + 1), i));
moel@320
   541
                  for (int i = 0; i < superIO.Fans.Length; i++)
moel@320
   542
                    f.Add(new Fan("Fan #" + (i + 1), i));
moel@320
   543
                  break;
moel@320
   544
              }
moel@320
   545
              break;
moel@177
   546
            default:
moel@177
   547
              v.Add(new Voltage("Voltage #1", 0, true));
moel@177
   548
              v.Add(new Voltage("Voltage #2", 1, true));
moel@177
   549
              v.Add(new Voltage("Voltage #3", 2, true));
moel@277
   550
              v.Add(new Voltage("Voltage #4", 3, true));
moel@177
   551
              v.Add(new Voltage("Voltage #5", 4, true));
moel@177
   552
              v.Add(new Voltage("Voltage #6", 5, true));
moel@177
   553
              v.Add(new Voltage("Voltage #7", 6, true));
moel@177
   554
              v.Add(new Voltage("Standby +3.3V", 7, 10, 10, 0, true));
moel@195
   555
              v.Add(new Voltage("VBat", 8, 10, 10));
moel@177
   556
              for (int i = 0; i < superIO.Temperatures.Length; i++)
moel@177
   557
                t.Add(new Temperature("Temperature #" + (i + 1), i));
moel@177
   558
              for (int i = 0; i < superIO.Fans.Length; i++)
moel@177
   559
                f.Add(new Fan("Fan #" + (i + 1), i));
moel@177
   560
              break;
moel@177
   561
          }
moel@170
   562
          break;
moel@130
   563
          
moel@130
   564
        case Chip.F71858:
moel@195
   565
          v.Add(new Voltage("VCC3V", 0, 150, 150));
moel@195
   566
          v.Add(new Voltage("VSB3V", 1, 150, 150));
moel@195
   567
          v.Add(new Voltage("Battery", 2, 150, 150));
moel@130
   568
          for (int i = 0; i < superIO.Temperatures.Length; i++)
moel@130
   569
            t.Add(new Temperature("Temperature #" + (i + 1), i));
moel@130
   570
          for (int i = 0; i < superIO.Fans.Length; i++)
moel@130
   571
            f.Add(new Fan("Fan #" + (i + 1), i));
moel@130
   572
          break;
moel@130
   573
        case Chip.F71862: 
moel@130
   574
        case Chip.F71869: 
moel@130
   575
        case Chip.F71882:
moel@296
   576
        case Chip.F71889AD: 
moel@130
   577
        case Chip.F71889ED: 
moel@130
   578
        case Chip.F71889F:
moel@132
   579
          switch (manufacturer) {
moel@132
   580
            case Manufacturer.EVGA:
moel@132
   581
              switch (model) {
moel@168
   582
                case Model.X58_SLI_Classified: // F71882 
moel@195
   583
                  v.Add(new Voltage("VCC3V", 0, 150, 150));
moel@195
   584
                  v.Add(new Voltage("CPU VCore", 1, 47, 100));
moel@195
   585
                  v.Add(new Voltage("DIMM", 2, 47, 100));
moel@195
   586
                  v.Add(new Voltage("CPU VTT", 3, 24, 100));
moel@195
   587
                  v.Add(new Voltage("IOH Vcore", 4, 24, 100));
moel@195
   588
                  v.Add(new Voltage("+5V", 5, 51, 12));
moel@195
   589
                  v.Add(new Voltage("+12V", 6, 56, 6.8f));
moel@195
   590
                  v.Add(new Voltage("3VSB", 7, 150, 150));
moel@195
   591
                  v.Add(new Voltage("VBat", 8, 150, 150));
moel@132
   592
                  t.Add(new Temperature("CPU", 0));
moel@132
   593
                  t.Add(new Temperature("VREG", 1));
moel@132
   594
                  t.Add(new Temperature("System", 2));
moel@132
   595
                  f.Add(new Fan("CPU Fan", 0));
moel@132
   596
                  f.Add(new Fan("Power Fan", 1));
moel@132
   597
                  f.Add(new Fan("Chassis Fan", 2));
moel@132
   598
                  break;
moel@132
   599
                default:
moel@195
   600
                  v.Add(new Voltage("VCC3V", 0, 150, 150));
moel@132
   601
                  v.Add(new Voltage("CPU VCore", 1));
moel@132
   602
                  v.Add(new Voltage("Voltage #3", 2, true));
moel@132
   603
                  v.Add(new Voltage("Voltage #4", 3, true));
moel@132
   604
                  v.Add(new Voltage("Voltage #5", 4, true));
moel@132
   605
                  v.Add(new Voltage("Voltage #6", 5, true));
moel@132
   606
                  v.Add(new Voltage("Voltage #7", 6, true));
moel@195
   607
                  v.Add(new Voltage("VSB3V", 7, 150, 150));
moel@195
   608
                  v.Add(new Voltage("VBat", 8, 150, 150));
moel@132
   609
                  for (int i = 0; i < superIO.Temperatures.Length; i++)
moel@132
   610
                    t.Add(new Temperature("Temperature #" + (i + 1), i));
moel@132
   611
                  for (int i = 0; i < superIO.Fans.Length; i++)
moel@132
   612
                    f.Add(new Fan("Fan #" + (i + 1), i));
moel@132
   613
                  break;
moel@132
   614
              }
moel@132
   615
              break;
moel@132
   616
            default:
moel@195
   617
              v.Add(new Voltage("VCC3V", 0, 150, 150));
moel@132
   618
              v.Add(new Voltage("CPU VCore", 1));
moel@132
   619
              v.Add(new Voltage("Voltage #3", 2, true));
moel@132
   620
              v.Add(new Voltage("Voltage #4", 3, true));
moel@132
   621
              v.Add(new Voltage("Voltage #5", 4, true));
moel@132
   622
              v.Add(new Voltage("Voltage #6", 5, true));
moel@132
   623
              v.Add(new Voltage("Voltage #7", 6, true));
moel@195
   624
              v.Add(new Voltage("VSB3V", 7, 150, 150));
moel@195
   625
              v.Add(new Voltage("VBat", 8, 150, 150));
moel@132
   626
              for (int i = 0; i < superIO.Temperatures.Length; i++)
moel@132
   627
                t.Add(new Temperature("Temperature #" + (i + 1), i));
moel@132
   628
              for (int i = 0; i < superIO.Fans.Length; i++)
moel@132
   629
                f.Add(new Fan("Fan #" + (i + 1), i));
moel@132
   630
              break;
moel@132
   631
          }
moel@130
   632
          break;
moel@130
   633
moel@220
   634
        case Chip.W83627EHF:
moel@220
   635
          switch (manufacturer) {
moel@220
   636
            case Manufacturer.ASRock:
moel@220
   637
              switch (model) {
moel@220
   638
                case Model.AOD790GX_128M: // W83627EHF
moel@220
   639
                  v.Add(new Voltage("CPU VCore", 0));
moel@220
   640
                  v.Add(new Voltage("Analog +3.3V", 2, 34, 34));
moel@220
   641
                  v.Add(new Voltage("+3.3V", 4, 10, 10));
moel@220
   642
                  v.Add(new Voltage("+5V", 5, 20, 10));
moel@220
   643
                  v.Add(new Voltage("+12V", 6, 28, 5));
moel@220
   644
                  v.Add(new Voltage("Standby +3.3V", 7, 34, 34));
moel@220
   645
                  v.Add(new Voltage("VBAT", 8, 34, 34));
moel@220
   646
                  t.Add(new Temperature("CPU", 0));
moel@220
   647
                  t.Add(new Temperature("Motherboard", 2));
moel@221
   648
                  f.Add(new Fan("CPU Fan", 0));
moel@221
   649
                  f.Add(new Fan("Chassis Fan", 1));                 
moel@220
   650
                  break;
moel@220
   651
                default:
moel@220
   652
                  v.Add(new Voltage("CPU VCore", 0));
moel@220
   653
                  v.Add(new Voltage("Voltage #2", 1, true));
moel@220
   654
                  v.Add(new Voltage("AVCC", 2, 34, 34));
moel@220
   655
                  v.Add(new Voltage("3VCC", 3, 34, 34));
moel@220
   656
                  v.Add(new Voltage("Voltage #5", 4, true));
moel@220
   657
                  v.Add(new Voltage("Voltage #6", 5, true));
moel@220
   658
                  v.Add(new Voltage("Voltage #7", 6, true));
moel@220
   659
                  v.Add(new Voltage("3VSB", 7, 34, 34));
moel@220
   660
                  v.Add(new Voltage("VBAT", 8, 34, 34));
moel@220
   661
                  v.Add(new Voltage("Voltage #10", 9, true));
moel@220
   662
                  t.Add(new Temperature("CPU", 0));
moel@220
   663
                  t.Add(new Temperature("Auxiliary", 1));
moel@220
   664
                  t.Add(new Temperature("System", 2));
moel@220
   665
                  f.Add(new Fan("System Fan", 0));
moel@220
   666
                  f.Add(new Fan("CPU Fan", 1));
moel@220
   667
                  f.Add(new Fan("Auxiliary Fan", 2));
moel@220
   668
                  f.Add(new Fan("CPU Fan #2", 3));
moel@220
   669
                  f.Add(new Fan("Auxiliary Fan #2", 4));
moel@220
   670
                  break;
moel@220
   671
              } break;
moel@220
   672
            default:
moel@220
   673
              v.Add(new Voltage("CPU VCore", 0));
moel@220
   674
              v.Add(new Voltage("Voltage #2", 1, true));
moel@220
   675
              v.Add(new Voltage("AVCC", 2, 34, 34));
moel@220
   676
              v.Add(new Voltage("3VCC", 3, 34, 34));
moel@220
   677
              v.Add(new Voltage("Voltage #5", 4, true));
moel@220
   678
              v.Add(new Voltage("Voltage #6", 5, true));
moel@220
   679
              v.Add(new Voltage("Voltage #7", 6, true));
moel@220
   680
              v.Add(new Voltage("3VSB", 7, 34, 34));
moel@220
   681
              v.Add(new Voltage("VBAT", 8, 34, 34));
moel@220
   682
              v.Add(new Voltage("Voltage #10", 9, true));
moel@220
   683
              t.Add(new Temperature("CPU", 0));
moel@220
   684
              t.Add(new Temperature("Auxiliary", 1));
moel@220
   685
              t.Add(new Temperature("System", 2));
moel@220
   686
              f.Add(new Fan("System Fan", 0));
moel@220
   687
              f.Add(new Fan("CPU Fan", 1));
moel@220
   688
              f.Add(new Fan("Auxiliary Fan", 2));
moel@220
   689
              f.Add(new Fan("CPU Fan #2", 3));
moel@220
   690
              f.Add(new Fan("Auxiliary Fan #2", 4));
moel@220
   691
              break;
moel@220
   692
          }
moel@130
   693
          break;
moel@130
   694
        case Chip.W83627DHG: 
moel@130
   695
        case Chip.W83627DHGP:                      
moel@130
   696
        case Chip.W83667HG:
moel@130
   697
        case Chip.W83667HGB:
moel@152
   698
          switch (manufacturer) {
moel@153
   699
            case Manufacturer.ASRock:
moel@153
   700
              switch (model) {
moel@168
   701
                case Model._880GMH_USB3: // W83627DHG-P
moel@153
   702
                  v.Add(new Voltage("CPU VCore", 0));
moel@195
   703
                  v.Add(new Voltage("+3.3V", 3, 34, 34));
moel@195
   704
                  v.Add(new Voltage("+5V", 5, 15, 7.5f));
moel@195
   705
                  v.Add(new Voltage("+12V", 6, 56, 10));
moel@195
   706
                  v.Add(new Voltage("Standby +3.3V", 7, 34, 34));
moel@195
   707
                  v.Add(new Voltage("VBAT", 8, 34, 34));
moel@153
   708
                  t.Add(new Temperature("CPU", 0));
moel@153
   709
                  t.Add(new Temperature("Motherboard", 2));
moel@153
   710
                  f.Add(new Fan("Chassis Fan", 0));
moel@153
   711
                  f.Add(new Fan("CPU Fan", 1));
moel@153
   712
                  f.Add(new Fan("Power Fan", 2));
moel@153
   713
                  break;
moel@153
   714
                default:
moel@153
   715
                  v.Add(new Voltage("CPU VCore", 0));
moel@153
   716
                  v.Add(new Voltage("Voltage #2", 1, true));
moel@195
   717
                  v.Add(new Voltage("AVCC", 2, 34, 34));
moel@195
   718
                  v.Add(new Voltage("3VCC", 3, 34, 34));
moel@153
   719
                  v.Add(new Voltage("Voltage #5", 4, true));
moel@153
   720
                  v.Add(new Voltage("Voltage #6", 5, true));
moel@153
   721
                  v.Add(new Voltage("Voltage #7", 6, true));
moel@195
   722
                  v.Add(new Voltage("3VSB", 7, 34, 34));
moel@195
   723
                  v.Add(new Voltage("VBAT", 8, 34, 34));
moel@153
   724
                  t.Add(new Temperature("CPU", 0));
moel@153
   725
                  t.Add(new Temperature("Auxiliary", 1));
moel@153
   726
                  t.Add(new Temperature("System", 2));
moel@153
   727
                  f.Add(new Fan("System Fan", 0));
moel@153
   728
                  f.Add(new Fan("CPU Fan", 1));
moel@153
   729
                  f.Add(new Fan("Auxiliary Fan", 2));
moel@153
   730
                  f.Add(new Fan("CPU Fan #2", 3));
moel@153
   731
                  f.Add(new Fan("Auxiliary Fan #2", 4));
moel@153
   732
                  break;
moel@153
   733
              }
moel@153
   734
              break;
moel@152
   735
            case Manufacturer.ASUS:
moel@152
   736
              switch (model) {
moel@336
   737
                case Model.P6T: // W83667HG
moel@174
   738
                case Model.P6X58D_E: // W83667HG                 
moel@174
   739
                case Model.Rampage_II_GENE: // W83667HG 
moel@152
   740
                  v.Add(new Voltage("CPU VCore", 0));
moel@195
   741
                  v.Add(new Voltage("+12V", 1, 11.5f, 1.91f));
moel@195
   742
                  v.Add(new Voltage("Analog +3.3V", 2, 34, 34));
moel@195
   743
                  v.Add(new Voltage("+3.3V", 3, 34, 34));
moel@195
   744
                  v.Add(new Voltage("+5V", 4, 15, 7.5f));
moel@195
   745
                  v.Add(new Voltage("Standby +3.3V", 7, 34, 34));
moel@195
   746
                  v.Add(new Voltage("VBAT", 8, 34, 34));
moel@174
   747
                  t.Add(new Temperature("CPU", 0));
moel@174
   748
                  t.Add(new Temperature("Motherboard", 2));
moel@174
   749
                  f.Add(new Fan("Chassis Fan #1", 0));
moel@174
   750
                  f.Add(new Fan("CPU Fan", 1));
moel@174
   751
                  f.Add(new Fan("Power Fan", 2));
moel@174
   752
                  f.Add(new Fan("Chassis Fan #2", 3));
moel@174
   753
                  f.Add(new Fan("Chassis Fan #3", 4));
moel@174
   754
                  break;
moel@174
   755
                case Model.Rampage_Extreme: // W83667HG 
moel@174
   756
                  v.Add(new Voltage("CPU VCore", 0));
moel@195
   757
                  v.Add(new Voltage("+12V", 1, 12, 2));
moel@195
   758
                  v.Add(new Voltage("Analog +3.3V", 2, 34, 34));
moel@195
   759
                  v.Add(new Voltage("+3.3V", 3, 34, 34));
moel@195
   760
                  v.Add(new Voltage("+5V", 4, 15, 7.5f));
moel@195
   761
                  v.Add(new Voltage("Standby +3.3V", 7, 34, 34));
moel@195
   762
                  v.Add(new Voltage("VBAT", 8, 34, 34));
moel@152
   763
                  t.Add(new Temperature("CPU", 0));
moel@152
   764
                  t.Add(new Temperature("Motherboard", 2));
moel@152
   765
                  f.Add(new Fan("Chassis Fan #1", 0));
moel@153
   766
                  f.Add(new Fan("CPU Fan", 1));
moel@153
   767
                  f.Add(new Fan("Power Fan", 2));
moel@152
   768
                  f.Add(new Fan("Chassis Fan #2", 3));
moel@152
   769
                  f.Add(new Fan("Chassis Fan #3", 4));
moel@152
   770
                  break;
moel@152
   771
                default:
moel@152
   772
                  v.Add(new Voltage("CPU VCore", 0));
moel@152
   773
                  v.Add(new Voltage("Voltage #2", 1, true));
moel@195
   774
                  v.Add(new Voltage("AVCC", 2, 34, 34));
moel@195
   775
                  v.Add(new Voltage("3VCC", 3, 34, 34));
moel@152
   776
                  v.Add(new Voltage("Voltage #5", 4, true));
moel@152
   777
                  v.Add(new Voltage("Voltage #6", 5, true));
moel@152
   778
                  v.Add(new Voltage("Voltage #7", 6, true));
moel@195
   779
                  v.Add(new Voltage("3VSB", 7, 34, 34));
moel@195
   780
                  v.Add(new Voltage("VBAT", 8, 34, 34));
moel@152
   781
                  t.Add(new Temperature("CPU", 0));
moel@152
   782
                  t.Add(new Temperature("Auxiliary", 1));
moel@152
   783
                  t.Add(new Temperature("System", 2));
moel@153
   784
                  f.Add(new Fan("System Fan", 0));
moel@153
   785
                  f.Add(new Fan("CPU Fan", 1));
moel@153
   786
                  f.Add(new Fan("Auxiliary Fan", 2));
moel@153
   787
                  f.Add(new Fan("CPU Fan #2", 3));
moel@153
   788
                  f.Add(new Fan("Auxiliary Fan #2", 4));
moel@152
   789
                  break;
moel@152
   790
              }
moel@152
   791
              break;
moel@152
   792
            default:
moel@152
   793
              v.Add(new Voltage("CPU VCore", 0));
moel@152
   794
              v.Add(new Voltage("Voltage #2", 1, true));
moel@195
   795
              v.Add(new Voltage("AVCC", 2, 34, 34));
moel@195
   796
              v.Add(new Voltage("3VCC", 3, 34, 34));
moel@152
   797
              v.Add(new Voltage("Voltage #5", 4, true));
moel@152
   798
              v.Add(new Voltage("Voltage #6", 5, true));
moel@152
   799
              v.Add(new Voltage("Voltage #7", 6, true));
moel@195
   800
              v.Add(new Voltage("3VSB", 7, 34, 34));
moel@195
   801
              v.Add(new Voltage("VBAT", 8, 34, 34));
moel@152
   802
              t.Add(new Temperature("CPU", 0));
moel@152
   803
              t.Add(new Temperature("Auxiliary", 1));
moel@152
   804
              t.Add(new Temperature("System", 2));
moel@153
   805
              f.Add(new Fan("System Fan", 0));
moel@153
   806
              f.Add(new Fan("CPU Fan", 1));
moel@153
   807
              f.Add(new Fan("Auxiliary Fan", 2));
moel@153
   808
              f.Add(new Fan("CPU Fan #2", 3));
moel@153
   809
              f.Add(new Fan("Auxiliary Fan #2", 4));
moel@152
   810
              break;
moel@152
   811
          } 
moel@130
   812
          break;
moel@130
   813
        case Chip.W83627HF: 
moel@130
   814
        case Chip.W83627THF: 
moel@130
   815
        case Chip.W83687THF:
moel@130
   816
          v.Add(new Voltage("CPU VCore", 0));
moel@130
   817
          v.Add(new Voltage("Voltage #2", 1, true));
moel@130
   818
          v.Add(new Voltage("Voltage #3", 2, true));
moel@195
   819
          v.Add(new Voltage("AVCC", 3, 34, 51));
moel@130
   820
          v.Add(new Voltage("Voltage #5", 4, true));
moel@195
   821
          v.Add(new Voltage("5VSB", 5, 34, 51));
moel@130
   822
          v.Add(new Voltage("VBAT", 6));
moel@130
   823
          t.Add(new Temperature("CPU", 0));
moel@130
   824
          t.Add(new Temperature("Auxiliary", 1));
moel@130
   825
          t.Add(new Temperature("System", 2));
moel@153
   826
          f.Add(new Fan("System Fan", 0));
moel@153
   827
          f.Add(new Fan("CPU Fan", 1));
moel@153
   828
          f.Add(new Fan("Auxiliary Fan", 2));
moel@130
   829
          break;
moel@245
   830
        case Chip.NCT6771F:
moel@265
   831
        case Chip.NCT6776F:
moel@265
   832
          switch (manufacturer) {
moel@265
   833
            case Manufacturer.ASUS:
moel@265
   834
              switch (model) {
moel@312
   835
                case Model.P8P67: // NCT6776F
moel@311
   836
                case Model.P8P67_EVO: // NCT6776F
moel@265
   837
                case Model.P8P67_PRO: // NCT6776F
moel@265
   838
                  v.Add(new Voltage("CPU VCore", 0));
moel@310
   839
                  v.Add(new Voltage("+12V", 1, 11, 1));
moel@310
   840
                  v.Add(new Voltage("Analog +3.3V", 2, 34, 34));
moel@310
   841
                  v.Add(new Voltage("+3.3V", 3, 34, 34));
moel@310
   842
                  v.Add(new Voltage("+5V", 4, 12, 3));
moel@310
   843
                  v.Add(new Voltage("Standby +3.3V", 7, 34, 34));
moel@265
   844
                  v.Add(new Voltage("VBAT", 8, 34, 34));
moel@310
   845
                  t.Add(new Temperature("CPU", 0));
moel@276
   846
                  t.Add(new Temperature("Auxiliary", 2));
moel@310
   847
                  t.Add(new Temperature("Motherboard", 3));
moel@310
   848
                  f.Add(new Fan("Chassis Fan #1", 0));
moel@265
   849
                  f.Add(new Fan("CPU Fan", 1));
moel@310
   850
                  f.Add(new Fan("Power Fan", 2));
moel@310
   851
                  f.Add(new Fan("Chassis Fan #2", 3));
moel@323
   852
                  c.Add(new Ctrl("Chassis Fan #2", 0));
moel@323
   853
                  c.Add(new Ctrl("CPU Fan", 1));
moel@323
   854
                  c.Add(new Ctrl("Chassis Fan #1", 2));
moel@265
   855
                  break;
moel@276
   856
                case Model.P8P67_M_PRO: // NCT6776F
moel@276
   857
                  v.Add(new Voltage("CPU VCore", 0));
moel@276
   858
                  v.Add(new Voltage("+12V", 1, 11, 1));
moel@276
   859
                  v.Add(new Voltage("Analog +3.3V", 2, 34, 34));
moel@310
   860
                  v.Add(new Voltage("+3.3V", 3, 34, 34));
moel@276
   861
                  v.Add(new Voltage("+5V", 4, 12, 3));
moel@276
   862
                  v.Add(new Voltage("Voltage #6", 5, true));
moel@276
   863
                  v.Add(new Voltage("Voltage #7", 6, true));
moel@276
   864
                  v.Add(new Voltage("Standby +3.3V", 7, 34, 34));
moel@276
   865
                  v.Add(new Voltage("VBAT", 8, 34, 34));
moel@276
   866
                  t.Add(new Temperature("CPU", 0));
moel@276
   867
                  t.Add(new Temperature("Motherboard", 3));
moel@276
   868
                  f.Add(new Fan("Chassis Fan #1", 0));
moel@276
   869
                  f.Add(new Fan("CPU Fan", 1));
moel@276
   870
                  f.Add(new Fan("Chassis Fan #2", 2));
moel@276
   871
                  f.Add(new Fan("Power Fan", 3));
moel@276
   872
                  f.Add(new Fan("Auxiliary Fan", 4));
moel@276
   873
                  break;
moel@337
   874
                case Model.P8Z68_V_PRO: // NCT6776F
moel@337
   875
                  v.Add(new Voltage("CPU VCore", 0));
moel@337
   876
                  v.Add(new Voltage("+12V", 1, 11, 1));
moel@337
   877
                  v.Add(new Voltage("Analog +3.3V", 2, 34, 34));
moel@337
   878
                  v.Add(new Voltage("+3.3V", 3, 34, 34));
moel@337
   879
                  v.Add(new Voltage("+5V", 4, 12, 3));
moel@337
   880
                  v.Add(new Voltage("Standby +3.3V", 7, 34, 34));
moel@337
   881
                  v.Add(new Voltage("VBAT", 8, 34, 34));
moel@337
   882
                  t.Add(new Temperature("CPU", 0));
moel@337
   883
                  t.Add(new Temperature("Auxiliary", 2));
moel@337
   884
                  t.Add(new Temperature("Motherboard", 3));
moel@337
   885
                  for (int i = 0; i < superIO.Fans.Length; i++)
moel@337
   886
                    f.Add(new Fan("Fan #" + (i + 1), i));
moel@337
   887
                  for (int i = 0; i < superIO.Controls.Length; i++)
moel@337
   888
                    c.Add(new Ctrl("Fan #" + (i + 1), i));
moel@337
   889
                  break;
moel@332
   890
                case Model.P9X79: // NCT6776F
moel@332
   891
                  v.Add(new Voltage("CPU VCore", 0));
moel@332
   892
                  v.Add(new Voltage("+12V", 1, 11, 1));
moel@332
   893
                  v.Add(new Voltage("Analog +3.3V", 2, 34, 34));
moel@332
   894
                  v.Add(new Voltage("+3.3V", 3, 34, 34));
moel@332
   895
                  v.Add(new Voltage("+5V", 4, 12, 3));
moel@332
   896
                  v.Add(new Voltage("Standby +3.3V", 7, 34, 34));
moel@332
   897
                  v.Add(new Voltage("VBAT", 8, 34, 34));
moel@332
   898
                  t.Add(new Temperature("CPU", 0));
moel@332
   899
                  t.Add(new Temperature("Motherboard", 3));
moel@332
   900
                  for (int i = 0; i < superIO.Fans.Length; i++)
moel@332
   901
                    f.Add(new Fan("Fan #" + (i + 1), i));
moel@332
   902
                  break;
moel@265
   903
                default:
moel@265
   904
                  v.Add(new Voltage("CPU VCore", 0));
moel@265
   905
                  v.Add(new Voltage("Voltage #2", 1, true));
moel@265
   906
                  v.Add(new Voltage("AVCC", 2, 34, 34));
moel@265
   907
                  v.Add(new Voltage("3VCC", 3, 34, 34));
moel@265
   908
                  v.Add(new Voltage("Voltage #5", 4, true));
moel@265
   909
                  v.Add(new Voltage("Voltage #6", 5, true));
moel@265
   910
                  v.Add(new Voltage("Voltage #7", 6, true));
moel@265
   911
                  v.Add(new Voltage("3VSB", 7, 34, 34));
moel@265
   912
                  v.Add(new Voltage("VBAT", 8, 34, 34));
moel@265
   913
                  t.Add(new Temperature("CPU", 0));
moel@276
   914
                  t.Add(new Temperature("CPU", 1));
moel@276
   915
                  t.Add(new Temperature("Auxiliary", 2));
moel@276
   916
                  t.Add(new Temperature("System", 3));
moel@265
   917
                  for (int i = 0; i < superIO.Fans.Length; i++)
moel@265
   918
                    f.Add(new Fan("Fan #" + (i + 1), i));
moel@265
   919
                  break;
moel@265
   920
              }
moel@265
   921
              break;
moel@265
   922
            default:
moel@265
   923
              v.Add(new Voltage("CPU VCore", 0));
moel@265
   924
              v.Add(new Voltage("Voltage #2", 1, true));
moel@265
   925
              v.Add(new Voltage("AVCC", 2, 34, 34));
moel@265
   926
              v.Add(new Voltage("3VCC", 3, 34, 34));
moel@265
   927
              v.Add(new Voltage("Voltage #5", 4, true));
moel@265
   928
              v.Add(new Voltage("Voltage #6", 5, true));
moel@265
   929
              v.Add(new Voltage("Voltage #7", 6, true));
moel@265
   930
              v.Add(new Voltage("3VSB", 7, 34, 34));
moel@265
   931
              v.Add(new Voltage("VBAT", 8, 34, 34));
moel@265
   932
              t.Add(new Temperature("CPU", 0));
moel@276
   933
              t.Add(new Temperature("CPU", 1));
moel@276
   934
              t.Add(new Temperature("Auxiliary", 2));
moel@276
   935
              t.Add(new Temperature("System", 3));
moel@265
   936
              for (int i = 0; i < superIO.Fans.Length; i++)
moel@265
   937
                f.Add(new Fan("Fan #" + (i + 1), i));
moel@265
   938
              break;
moel@265
   939
          }
moel@245
   940
          break;
moel@130
   941
        default:
moel@130
   942
          for (int i = 0; i < superIO.Voltages.Length; i++)
moel@130
   943
            v.Add(new Voltage("Voltage #" + (i + 1), i, true));
moel@130
   944
          for (int i = 0; i < superIO.Temperatures.Length; i++)
moel@130
   945
            t.Add(new Temperature("Temperature #" + (i + 1), i));
moel@130
   946
          for (int i = 0; i < superIO.Fans.Length; i++)
moel@130
   947
            f.Add(new Fan("Fan #" + (i + 1), i));
moel@323
   948
          for (int i = 0; i < superIO.Controls.Length; i++)
moel@323
   949
            c.Add(new Ctrl("Fan Control #" + (i + 1), i));
moel@130
   950
          break;
moel@130
   951
      }
moel@130
   952
moel@195
   953
      const string formula = "Voltage = value + (value - Vf) * Ri / Rf.";
moel@130
   954
      foreach (Voltage voltage in v) 
moel@130
   955
        if (voltage.Index < superIO.Voltages.Length) {
moel@130
   956
          Sensor sensor = new Sensor(voltage.Name, voltage.Index, 
moel@195
   957
            voltage.Hidden, SensorType.Voltage, this, new [] {
moel@130
   958
            new ParameterDescription("Ri [kΩ]", "Input resistance.\n" + 
moel@130
   959
              formula, voltage.Ri),
moel@130
   960
            new ParameterDescription("Rf [kΩ]", "Reference resistance.\n" + 
moel@130
   961
              formula, voltage.Rf),
moel@130
   962
            new ParameterDescription("Vf [V]", "Reference voltage.\n" + 
moel@130
   963
              formula, voltage.Vf)
moel@165
   964
            }, settings);
moel@130
   965
          voltages.Add(sensor);
moel@130
   966
      }
moel@130
   967
moel@130
   968
      foreach (Temperature temperature in t) 
moel@130
   969
        if (temperature.Index < superIO.Temperatures.Length) {
moel@134
   970
        Sensor sensor = new Sensor(temperature.Name, temperature.Index,
moel@195
   971
          SensorType.Temperature, this, new [] {
moel@130
   972
          new ParameterDescription("Offset [°C]", "Temperature offset.", 0)
moel@165
   973
        }, settings);
moel@130
   974
        temperatures.Add(sensor);
moel@130
   975
      }
moel@130
   976
moel@130
   977
      foreach (Fan fan in f)
moel@130
   978
        if (fan.Index < superIO.Fans.Length) {
moel@134
   979
          Sensor sensor = new Sensor(fan.Name, fan.Index, SensorType.Fan,
moel@165
   980
            this, settings);
moel@130
   981
          fans.Add(sensor);
moel@130
   982
        }
moel@323
   983
moel@323
   984
      foreach (Ctrl ctrl in c) {
moel@323
   985
        int index = ctrl.Index;
moel@323
   986
        if (index < superIO.Controls.Length) {
moel@323
   987
          Sensor sensor = new Sensor(ctrl.Name, index, SensorType.Control,
moel@323
   988
            this, settings);
moel@323
   989
          Control control = new Control(sensor, settings, 0, 100);
moel@323
   990
          control.ControlModeChanged += (cc) => {
moel@323
   991
            if (cc.ControlMode == ControlMode.Default) {
moel@323
   992
              superIO.SetControl(index, null);
moel@323
   993
            } else {
moel@323
   994
              superIO.SetControl(index, (byte)(cc.SoftwareValue * 2.55));
moel@323
   995
            }
moel@323
   996
          };
moel@323
   997
          control.SoftwareControlValueChanged += (cc) => {
moel@323
   998
            if (cc.ControlMode == ControlMode.Software) 
moel@323
   999
              superIO.SetControl(index, (byte)(cc.SoftwareValue * 2.55));
moel@323
  1000
          };
moel@323
  1001
          if (control.ControlMode == ControlMode.Software) 
moel@323
  1002
            superIO.SetControl(index, (byte)(control.SoftwareValue * 2.55));
moel@323
  1003
          sensor.Control = control;
moel@323
  1004
          controls.Add(sensor);
moel@323
  1005
        }
moel@323
  1006
      }
moel@130
  1007
    }
moel@130
  1008
moel@165
  1009
    public override HardwareType HardwareType {
moel@165
  1010
      get { return HardwareType.SuperIO; }
moel@130
  1011
    }
moel@130
  1012
moel@176
  1013
    public override IHardware Parent {
moel@176
  1014
      get { return mainboard; }
moel@176
  1015
    }
moel@176
  1016
moel@130
  1017
moel@130
  1018
    public override string GetReport() {
moel@130
  1019
      return superIO.GetReport();
moel@130
  1020
    }
moel@130
  1021
moel@130
  1022
    public override void Update() {
moel@130
  1023
      superIO.Update();
moel@130
  1024
moel@130
  1025
      foreach (Sensor sensor in voltages) {
moel@228
  1026
        float? value = readVoltage(sensor.Index);
moel@130
  1027
        if (value.HasValue) {
moel@130
  1028
          sensor.Value = value + (value - sensor.Parameters[2].Value) *
moel@130
  1029
            sensor.Parameters[0].Value / sensor.Parameters[1].Value;
moel@130
  1030
          ActivateSensor(sensor);
moel@130
  1031
        }
moel@130
  1032
      }
moel@130
  1033
moel@130
  1034
      foreach (Sensor sensor in temperatures) {
moel@228
  1035
        float? value = readTemperature(sensor.Index);
moel@130
  1036
        if (value.HasValue) {
moel@130
  1037
          sensor.Value = value + sensor.Parameters[0].Value;
moel@130
  1038
          ActivateSensor(sensor);
moel@130
  1039
        }
moel@130
  1040
      }
moel@130
  1041
moel@130
  1042
      foreach (Sensor sensor in fans) {
moel@228
  1043
        float? value = readFan(sensor.Index);
moel@130
  1044
        if (value.HasValue) {
moel@130
  1045
          sensor.Value = value;
moel@130
  1046
          if (value.Value > 0)
moel@130
  1047
            ActivateSensor(sensor);
moel@130
  1048
        }
moel@130
  1049
      }
moel@228
  1050
moel@323
  1051
      foreach (Sensor sensor in controls) {
moel@323
  1052
        float? value = readControl(sensor.Index);
moel@323
  1053
        if (value.HasValue) {
moel@323
  1054
          sensor.Value = value;
moel@323
  1055
          ActivateSensor(sensor);
moel@323
  1056
        }
moel@323
  1057
      }
moel@323
  1058
moel@228
  1059
      postUpdate();
moel@130
  1060
    }
moel@130
  1061
moel@323
  1062
    public override void Close() {
moel@323
  1063
      foreach (Sensor sensor in controls) {
moel@323
  1064
        // restore all controls back to default
moel@323
  1065
        superIO.SetControl(sensor.Index, null);
moel@323
  1066
      }
moel@323
  1067
      base.Close();
moel@323
  1068
    }
moel@323
  1069
moel@130
  1070
    private class Voltage {
moel@130
  1071
      public readonly string Name;
moel@130
  1072
      public readonly int Index;
moel@130
  1073
      public readonly float Ri;
moel@130
  1074
      public readonly float Rf;
moel@130
  1075
      public readonly float Vf;
moel@130
  1076
      public readonly bool Hidden;
moel@130
  1077
moel@202
  1078
      public Voltage(string name, int index) :
moel@202
  1079
        this(name, index, false) { }
moel@202
  1080
      
moel@130
  1081
      public Voltage(string name, int index, bool hidden) :
moel@130
  1082
        this(name, index, 0, 1, 0, hidden) { }
moel@202
  1083
      
moel@202
  1084
      public Voltage(string name, int index, float ri, float rf) :
moel@202
  1085
        this(name, index, ri, rf, 0, false) { }
moel@202
  1086
      
moel@202
  1087
      // float ri = 0, float rf = 1, float vf = 0, bool hidden = false) 
moel@202
  1088
      
moel@195
  1089
      public Voltage(string name, int index, 
moel@202
  1090
        float ri, float rf, float vf, bool hidden) 
moel@195
  1091
      {
moel@130
  1092
        this.Name = name;
moel@130
  1093
        this.Index = index;
moel@130
  1094
        this.Ri = ri;
moel@130
  1095
        this.Rf = rf;
moel@130
  1096
        this.Vf = vf;
moel@130
  1097
        this.Hidden = hidden;
moel@130
  1098
      }
moel@130
  1099
    }
moel@130
  1100
moel@130
  1101
    private class Temperature {
moel@130
  1102
      public readonly string Name;
moel@130
  1103
      public readonly int Index;
moel@130
  1104
moel@167
  1105
      public Temperature(string name, int index) {
moel@130
  1106
        this.Name = name;
moel@130
  1107
        this.Index = index;
moel@130
  1108
      }
moel@130
  1109
    }
moel@130
  1110
moel@130
  1111
    private class Fan {
moel@130
  1112
      public readonly string Name;
moel@130
  1113
      public readonly int Index;
moel@130
  1114
moel@130
  1115
      public Fan(string name, int index) {
moel@130
  1116
        this.Name = name;
moel@130
  1117
        this.Index = index;
moel@130
  1118
      }
moel@130
  1119
    }
moel@323
  1120
moel@323
  1121
    private class Ctrl {
moel@323
  1122
      public readonly string Name;
moel@323
  1123
      public readonly int Index;
moel@323
  1124
moel@323
  1125
      public Ctrl(string name, int index) {
moel@323
  1126
        this.Name = name;
moel@323
  1127
        this.Index = index;
moel@323
  1128
      }
moel@323
  1129
    }
moel@130
  1130
  }
moel@130
  1131
}