Hardware/CPU/IntelCPU.cs
changeset 165 813d8bc3192f
parent 155 8ffea928daad
child 166 fa9dfbfc4145
     1.1 --- a/Hardware/CPU/IntelCPU.cs	Thu Aug 05 19:28:50 2010 +0000
     1.2 +++ b/Hardware/CPU/IntelCPU.cs	Sun Aug 08 13:57:26 2010 +0000
     1.3 @@ -37,7 +37,6 @@
     1.4  
     1.5  using System;
     1.6  using System.Collections.Generic;
     1.7 -using System.Drawing;
     1.8  using System.Diagnostics;
     1.9  using System.Globalization;
    1.10  using System.Reflection;
    1.11 @@ -46,14 +45,13 @@
    1.12  using System.Text;
    1.13  
    1.14  namespace OpenHardwareMonitor.Hardware.CPU {
    1.15 -  public class IntelCPU : Hardware, IHardware {
    1.16 +  internal class IntelCPU : Hardware, IHardware {
    1.17  
    1.18      private int processorIndex;
    1.19      private CPUID[][] cpuid;
    1.20      private int coreCount;
    1.21      
    1.22      private string name;
    1.23 -    private Image icon;
    1.24  
    1.25      private uint family;
    1.26      private uint model;
    1.27 @@ -94,13 +92,12 @@
    1.28        return result;
    1.29      }
    1.30  
    1.31 -    public IntelCPU(int processorIndex, CPUID[][] cpuid) {
    1.32 +    public IntelCPU(int processorIndex, CPUID[][] cpuid, ISettings settings) {
    1.33  
    1.34        this.processorIndex = processorIndex;
    1.35        this.cpuid = cpuid;
    1.36        this.coreCount = cpuid.Length;
    1.37        this.name = cpuid[0][0].Name;
    1.38 -      this.icon = Utilities.EmbeddedResources.GetImage("cpu.png");
    1.39  
    1.40        this.family = cpuid[0][0].Family;
    1.41        this.model = cpuid[0][0].Model;
    1.42 @@ -179,7 +176,7 @@
    1.43                  "Temperature = TjMax - TSlope * Value.", tjMax[i]), 
    1.44                new ParameterDescription("TSlope [°C]", 
    1.45                  "Temperature slope of the digital thermal sensor.\n" + 
    1.46 -                "Temperature = TjMax - TSlope * Value.", 1)});
    1.47 +                "Temperature = TjMax - TSlope * Value.", 1)}, settings);
    1.48            ActivateSensor(coreTemperatures[i]);
    1.49          }
    1.50        } else {
    1.51 @@ -187,13 +184,13 @@
    1.52        }
    1.53  
    1.54        if (coreCount > 1)
    1.55 -        totalLoad = new Sensor("CPU Total", 0, SensorType.Load, this);
    1.56 +        totalLoad = new Sensor("CPU Total", 0, SensorType.Load, this, settings);
    1.57        else
    1.58          totalLoad = null;
    1.59        coreLoads = new Sensor[coreCount];
    1.60        for (int i = 0; i < coreLoads.Length; i++)
    1.61          coreLoads[i] = new Sensor(CoreString(i), i + 1,
    1.62 -          SensorType.Load, this);     
    1.63 +          SensorType.Load, this, settings);     
    1.64        cpuLoad = new CPULoad(cpuid);
    1.65        if (cpuLoad.IsAvailable) {
    1.66          foreach (Sensor sensor in coreLoads)
    1.67 @@ -229,11 +226,11 @@
    1.68  
    1.69        lastTimeStampCount = 0;
    1.70        lastTime = 0;
    1.71 -      busClock = new Sensor("Bus Speed", 0, SensorType.Clock, this);      
    1.72 +      busClock = new Sensor("Bus Speed", 0, SensorType.Clock, this, settings);      
    1.73        coreClocks = new Sensor[coreCount];
    1.74        for (int i = 0; i < coreClocks.Length; i++) {
    1.75          coreClocks[i] =
    1.76 -          new Sensor(CoreString(i), i + 1, SensorType.Clock, this);
    1.77 +          new Sensor(CoreString(i), i + 1, SensorType.Clock, this, settings);
    1.78          if (hasTSC)
    1.79            ActivateSensor(coreClocks[i]);
    1.80        }
    1.81 @@ -249,8 +246,8 @@
    1.82        get { return new Identifier("intelcpu", processorIndex.ToString()); }
    1.83      }
    1.84  
    1.85 -    public override Image Icon {
    1.86 -      get { return icon; }
    1.87 +    public override HardwareType HardwareType {
    1.88 +      get { return HardwareType.CPU; }
    1.89      }
    1.90  
    1.91      private void AppendMSRData(StringBuilder r, uint msr, int thread) {