Release version 0.1.11. Added support for load percentage sensor type. Added load sensors for CPUs and ATI GPUs.
1.1 --- a/GUI/HardwareNode.cs Wed Feb 03 18:10:11 2010 +0000
1.2 +++ b/GUI/HardwareNode.cs Wed Feb 03 20:35:10 2010 +0000
1.3 @@ -54,8 +54,9 @@
1.4 this.Image = hardware.Icon;
1.5
1.6 typeNodes.Add(new TypeNode(SensorType.Voltage));
1.7 - typeNodes.Add(new TypeNode(SensorType.Clock));
1.8 + typeNodes.Add(new TypeNode(SensorType.Clock));
1.9 typeNodes.Add(new TypeNode(SensorType.Temperature));
1.10 + typeNodes.Add(new TypeNode(SensorType.Load));
1.11 typeNodes.Add(new TypeNode(SensorType.Fan));
1.12
1.13 foreach (ISensor sensor in hardware.Sensors)
2.1 --- a/GUI/MainForm.Designer.cs Wed Feb 03 18:10:11 2010 +0000
2.2 +++ b/GUI/MainForm.Designer.cs Wed Feb 03 20:35:10 2010 +0000
2.3 @@ -88,6 +88,7 @@
2.4 this.sensorsToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
2.5 this.voltMenuItem = new System.Windows.Forms.ToolStripMenuItem();
2.6 this.clocksMenuItem = new System.Windows.Forms.ToolStripMenuItem();
2.7 + this.loadMenuItem = new System.Windows.Forms.ToolStripMenuItem();
2.8 this.tempMenuItem = new System.Windows.Forms.ToolStripMenuItem();
2.9 this.fansMenuItem = new System.Windows.Forms.ToolStripMenuItem();
2.10 this.toolStripMenuItem1 = new System.Windows.Forms.ToolStripSeparator();
2.11 @@ -328,9 +329,10 @@
2.12 this.voltMenuItem,
2.13 this.clocksMenuItem,
2.14 this.tempMenuItem,
2.15 + this.loadMenuItem,
2.16 this.fansMenuItem});
2.17 this.sensorsToolStripMenuItem.Name = "sensorsToolStripMenuItem";
2.18 - this.sensorsToolStripMenuItem.Size = new System.Drawing.Size(114, 22);
2.19 + this.sensorsToolStripMenuItem.Size = new System.Drawing.Size(152, 22);
2.20 this.sensorsToolStripMenuItem.Text = "Sensors";
2.21 //
2.22 // voltMenuItem
2.23 @@ -339,7 +341,7 @@
2.24 this.voltMenuItem.CheckOnClick = true;
2.25 this.voltMenuItem.CheckState = System.Windows.Forms.CheckState.Checked;
2.26 this.voltMenuItem.Name = "voltMenuItem";
2.27 - this.voltMenuItem.Size = new System.Drawing.Size(147, 22);
2.28 + this.voltMenuItem.Size = new System.Drawing.Size(152, 22);
2.29 this.voltMenuItem.Text = "Voltages";
2.30 this.voltMenuItem.CheckedChanged += new System.EventHandler(this.UpdateSensorTypeChecked);
2.31 //
2.32 @@ -349,17 +351,27 @@
2.33 this.clocksMenuItem.CheckOnClick = true;
2.34 this.clocksMenuItem.CheckState = System.Windows.Forms.CheckState.Checked;
2.35 this.clocksMenuItem.Name = "clocksMenuItem";
2.36 - this.clocksMenuItem.Size = new System.Drawing.Size(147, 22);
2.37 + this.clocksMenuItem.Size = new System.Drawing.Size(152, 22);
2.38 this.clocksMenuItem.Text = "Clocks";
2.39 this.clocksMenuItem.CheckedChanged += new System.EventHandler(this.UpdateSensorTypeChecked);
2.40 //
2.41 + // loadMenuItem
2.42 + //
2.43 + this.loadMenuItem.Checked = true;
2.44 + this.loadMenuItem.CheckOnClick = true;
2.45 + this.loadMenuItem.CheckState = System.Windows.Forms.CheckState.Checked;
2.46 + this.loadMenuItem.Name = "loadMenuItem";
2.47 + this.loadMenuItem.Size = new System.Drawing.Size(152, 22);
2.48 + this.loadMenuItem.Text = "Load";
2.49 + this.loadMenuItem.CheckedChanged += new System.EventHandler(this.UpdateSensorTypeChecked);
2.50 + //
2.51 // tempMenuItem
2.52 //
2.53 this.tempMenuItem.Checked = true;
2.54 this.tempMenuItem.CheckOnClick = true;
2.55 this.tempMenuItem.CheckState = System.Windows.Forms.CheckState.Checked;
2.56 this.tempMenuItem.Name = "tempMenuItem";
2.57 - this.tempMenuItem.Size = new System.Drawing.Size(147, 22);
2.58 + this.tempMenuItem.Size = new System.Drawing.Size(152, 22);
2.59 this.tempMenuItem.Text = "Temperatures";
2.60 this.tempMenuItem.CheckedChanged += new System.EventHandler(this.UpdateSensorTypeChecked);
2.61 //
2.62 @@ -369,14 +381,14 @@
2.63 this.fansMenuItem.CheckOnClick = true;
2.64 this.fansMenuItem.CheckState = System.Windows.Forms.CheckState.Checked;
2.65 this.fansMenuItem.Name = "fansMenuItem";
2.66 - this.fansMenuItem.Size = new System.Drawing.Size(147, 22);
2.67 + this.fansMenuItem.Size = new System.Drawing.Size(152, 22);
2.68 this.fansMenuItem.Text = "Fans";
2.69 this.fansMenuItem.CheckedChanged += new System.EventHandler(this.UpdateSensorTypeChecked);
2.70 //
2.71 // toolStripMenuItem1
2.72 //
2.73 this.toolStripMenuItem1.Name = "toolStripMenuItem1";
2.74 - this.toolStripMenuItem1.Size = new System.Drawing.Size(111, 6);
2.75 + this.toolStripMenuItem1.Size = new System.Drawing.Size(149, 6);
2.76 //
2.77 // plotMenuItem
2.78 //
2.79 @@ -384,7 +396,7 @@
2.80 this.plotMenuItem.CheckOnClick = true;
2.81 this.plotMenuItem.CheckState = System.Windows.Forms.CheckState.Checked;
2.82 this.plotMenuItem.Name = "plotMenuItem";
2.83 - this.plotMenuItem.Size = new System.Drawing.Size(114, 22);
2.84 + this.plotMenuItem.Size = new System.Drawing.Size(152, 22);
2.85 this.plotMenuItem.Text = "Plot";
2.86 this.plotMenuItem.CheckedChanged += new System.EventHandler(this.plotToolStripMenuItem_CheckedChanged);
2.87 //
2.88 @@ -400,7 +412,7 @@
2.89 //
2.90 this.hddMenuItem.CheckOnClick = true;
2.91 this.hddMenuItem.Name = "hddMenuItem";
2.92 - this.hddMenuItem.Size = new System.Drawing.Size(141, 22);
2.93 + this.hddMenuItem.Size = new System.Drawing.Size(152, 22);
2.94 this.hddMenuItem.Text = "HDD sensors";
2.95 this.hddMenuItem.CheckedChanged += new System.EventHandler(this.hddsensorsToolStripMenuItem_CheckedChanged);
2.96 //
2.97 @@ -518,6 +530,7 @@
2.98 private System.Windows.Forms.ToolStripMenuItem fansMenuItem;
2.99 private System.Windows.Forms.ToolStripMenuItem voltMenuItem;
2.100 private System.Windows.Forms.ToolStripMenuItem hddMenuItem;
2.101 + private System.Windows.Forms.ToolStripMenuItem loadMenuItem;
2.102 }
2.103 }
2.104
3.1 --- a/GUI/MainForm.cs Wed Feb 03 18:10:11 2010 +0000
3.2 +++ b/GUI/MainForm.cs Wed Feb 03 20:35:10 2010 +0000
3.3 @@ -130,6 +130,7 @@
3.4
3.5 voltMenuItem.Checked = Utilities.Config.Get(voltMenuItem.Name, true);
3.6 clocksMenuItem.Checked = Utilities.Config.Get(clocksMenuItem.Name, true);
3.7 + loadMenuItem.Checked = Utilities.Config.Get(loadMenuItem.Name, true);
3.8 tempMenuItem.Checked = Utilities.Config.Get(tempMenuItem.Name, true);
3.9 fansMenuItem.Checked = Utilities.Config.Get(fansMenuItem.Name, true);
3.10
3.11 @@ -235,6 +236,7 @@
3.12
3.13 Utilities.Config.Set(voltMenuItem.Name, voltMenuItem.Checked);
3.14 Utilities.Config.Set(clocksMenuItem.Name, clocksMenuItem.Checked);
3.15 + Utilities.Config.Set(loadMenuItem.Name, loadMenuItem.Checked);
3.16 Utilities.Config.Set(tempMenuItem.Name, tempMenuItem.Checked);
3.17 Utilities.Config.Set(fansMenuItem.Name, fansMenuItem.Checked);
3.18
3.19 @@ -319,6 +321,7 @@
3.20 foreach (HardwareNode node in root.Nodes) {
3.21 node.SetVisible(SensorType.Voltage, voltMenuItem.Checked);
3.22 node.SetVisible(SensorType.Clock, clocksMenuItem.Checked);
3.23 + node.SetVisible(SensorType.Load, loadMenuItem.Checked);
3.24 node.SetVisible(SensorType.Temperature, tempMenuItem.Checked);
3.25 node.SetVisible(SensorType.Fan, fansMenuItem.Checked);
3.26 }
4.1 --- a/GUI/SensorNode.cs Wed Feb 03 18:10:11 2010 +0000
4.2 +++ b/GUI/SensorNode.cs Wed Feb 03 20:35:10 2010 +0000
4.3 @@ -59,6 +59,7 @@
4.4 switch (sensor.SensorType) {
4.5 case SensorType.Voltage: format = "{0:F2} V"; break;
4.6 case SensorType.Clock: format = "{0:F0} MHz"; break;
4.7 + case SensorType.Load: format = "{0:F1} %"; break;
4.8 case SensorType.Temperature: format = "{0:F1} °C"; break;
4.9 case SensorType.Fan: format = "{0:F0} RPM"; break;
4.10 }
5.1 --- a/GUI/TypeNode.cs Wed Feb 03 18:10:11 2010 +0000
5.2 +++ b/GUI/TypeNode.cs Wed Feb 03 20:35:10 2010 +0000
5.3 @@ -58,6 +58,10 @@
5.4 this.Image = Utilities.EmbeddedResources.GetImage("clock.png");
5.5 this.Text = "Clocks";
5.6 break;
5.7 + case SensorType.Load:
5.8 + this.Image = Utilities.EmbeddedResources.GetImage("load.png");
5.9 + this.Text = "Load";
5.10 + break;
5.11 case SensorType.Temperature:
5.12 this.Image = Utilities.EmbeddedResources.GetImage("temperature.png");
5.13 this.Text = "Temperatures";
6.1 --- a/Hardware/ATI/ATIGPU.cs Wed Feb 03 18:10:11 2010 +0000
6.2 +++ b/Hardware/ATI/ATIGPU.cs Wed Feb 03 20:35:10 2010 +0000
6.3 @@ -53,6 +53,7 @@
6.4 private Sensor coreClock;
6.5 private Sensor memoryClock;
6.6 private Sensor coreVoltage;
6.7 + private Sensor coreLoad;
6.8
6.9 private List<ISensor> active = new List<ISensor>();
6.10
6.11 @@ -74,6 +75,7 @@
6.12 this.coreClock = new Sensor("GPU Core", 0, SensorType.Clock, this);
6.13 this.memoryClock = new Sensor("GPU Memory", 1, SensorType.Clock, this);
6.14 this.coreVoltage = new Sensor("GPU Core", 0, SensorType.Voltage, this);
6.15 + this.coreLoad = new Sensor("GPU Core", 0, SensorType.Load, this);
6.16 Update();
6.17 }
6.18
6.19 @@ -130,13 +132,16 @@
6.20 coreClock.Value = 0.01f * adlp.EngineClock;
6.21 memoryClock.Value = 0.01f * adlp.MemoryClock;
6.22 coreVoltage.Value = 0.001f * adlp.Vddc;
6.23 + coreLoad.Value = adlp.ActivityPercent;
6.24 ActivateSensor(coreClock);
6.25 ActivateSensor(memoryClock);
6.26 ActivateSensor(coreVoltage);
6.27 + ActivateSensor(coreLoad);
6.28 } else {
6.29 DeactivateSensor(coreClock);
6.30 DeactivateSensor(memoryClock);
6.31 DeactivateSensor(coreVoltage);
6.32 + DeactivateSensor(coreLoad);
6.33 }
6.34 }
6.35
7.1 --- a/Hardware/CPU/AMD0FCPU.cs Wed Feb 03 18:10:11 2010 +0000
7.2 +++ b/Hardware/CPU/AMD0FCPU.cs Wed Feb 03 20:35:10 2010 +0000
7.3 @@ -38,6 +38,7 @@
7.4 using System;
7.5 using System.Collections.Generic;
7.6 using System.Drawing;
7.7 +using System.Diagnostics;
7.8 using System.Text;
7.9
7.10
7.11 @@ -50,8 +51,15 @@
7.12 private uint pciAddress;
7.13
7.14 private Sensor[] coreTemperatures;
7.15 + private float offset;
7.16
7.17 - private float offset;
7.18 + private Sensor totalLoad;
7.19 + private Sensor[] coreLoads;
7.20 +
7.21 + private List<ISensor> active = new List<ISensor>();
7.22 +
7.23 + private PerformanceCounter totalLoadCounter;
7.24 + private PerformanceCounter[] coreLoadCounters;
7.25
7.26 private const ushort PCI_AMD_VENDOR_ID = 0x1022;
7.27 private const ushort PCI_AMD_0FH_MISCELLANEOUS_DEVICE_ID = 0x1103;
7.28 @@ -72,6 +80,23 @@
7.29 // max two cores
7.30 coreCount = coreCount > 2 ? 2 : coreCount;
7.31
7.32 + totalLoadCounter = new PerformanceCounter();
7.33 + totalLoadCounter.CategoryName = "Processor";
7.34 + totalLoadCounter.CounterName = "% Processor Time";
7.35 + totalLoadCounter.InstanceName = "_Total";
7.36 + totalLoad = new Sensor("CPU Total", 0, SensorType.Load, this);
7.37 +
7.38 + coreLoadCounters = new PerformanceCounter[coreCount];
7.39 + coreLoads = new Sensor[coreCount];
7.40 + for (int i = 0; i < coreLoadCounters.Length; i++) {
7.41 + coreLoadCounters[i] = new PerformanceCounter();
7.42 + coreLoadCounters[i].CategoryName = "Processor";
7.43 + coreLoadCounters[i].CounterName = "% Processor Time";
7.44 + coreLoadCounters[i].InstanceName = i.ToString();
7.45 + coreLoads[i] = new Sensor("Core #" + (i + 1), i + 1,
7.46 + SensorType.Load, this);
7.47 + }
7.48 +
7.49 coreTemperatures = new Sensor[coreCount];
7.50 for (int i = 0; i < coreCount; i++)
7.51 coreTemperatures[i] =
7.52 @@ -102,9 +127,7 @@
7.53 }
7.54
7.55 public ISensor[] Sensors {
7.56 - get {
7.57 - return coreTemperatures;
7.58 - }
7.59 + get { return active.ToArray(); }
7.60 }
7.61
7.62 public string GetReport() {
7.63 @@ -121,16 +144,42 @@
7.64 i > 0 ? THERM_SENSE_CORE_SEL_CPU1 : THERM_SENSE_CORE_SEL_CPU0)) {
7.65 uint value;
7.66 if (WinRing0.ReadPciConfigDwordEx(
7.67 - pciAddress, THERMTRIP_STATUS_REGISTER, out value))
7.68 - coreTemperatures[i].Value = ((value >> 16) & 0xFF) + offset;
7.69 + pciAddress, THERMTRIP_STATUS_REGISTER, out value)) {
7.70 + coreTemperatures[i].Value = ((value >> 16) & 0xFF) + offset;
7.71 + ActivateSensor(coreTemperatures[i]);
7.72 + } else {
7.73 + DeactivateSensor(coreTemperatures[i]);
7.74 + }
7.75 }
7.76 - }
7.77 + }
7.78 +
7.79 + totalLoad.Value = totalLoadCounter.NextValue();
7.80 + ActivateSensor(totalLoad);
7.81 +
7.82 + for (int i = 0; i < coreLoads.Length; i++) {
7.83 + coreLoads[i].Value = coreLoadCounters[i].NextValue();
7.84 + ActivateSensor(coreLoads[i]);
7.85 + }
7.86 }
7.87
7.88 - #pragma warning disable 67
7.89 + private void ActivateSensor(Sensor sensor) {
7.90 + if (!active.Contains(sensor)) {
7.91 + active.Add(sensor);
7.92 + if (SensorAdded != null)
7.93 + SensorAdded(sensor);
7.94 + }
7.95 + }
7.96 +
7.97 + private void DeactivateSensor(Sensor sensor) {
7.98 + if (active.Contains(sensor)) {
7.99 + active.Remove(sensor);
7.100 + if (SensorRemoved != null)
7.101 + SensorRemoved(sensor);
7.102 + }
7.103 + }
7.104 +
7.105 public event SensorEventHandler SensorAdded;
7.106 public event SensorEventHandler SensorRemoved;
7.107 - #pragma warning restore 67
7.108
7.109 }
7.110 }
8.1 --- a/Hardware/CPU/AMD10CPU.cs Wed Feb 03 18:10:11 2010 +0000
8.2 +++ b/Hardware/CPU/AMD10CPU.cs Wed Feb 03 20:35:10 2010 +0000
8.3 @@ -38,6 +38,7 @@
8.4 using System;
8.5 using System.Collections.Generic;
8.6 using System.Drawing;
8.7 +using System.Diagnostics;
8.8 using System.Text;
8.9
8.10 namespace OpenHardwareMonitor.Hardware.CPU {
8.11 @@ -49,6 +50,13 @@
8.12 private uint pciAddress;
8.13
8.14 private Sensor coreTemperature;
8.15 + private Sensor totalLoad;
8.16 + private Sensor[] coreLoads;
8.17 +
8.18 + private List<ISensor> active = new List<ISensor>();
8.19 +
8.20 + private PerformanceCounter totalLoadCounter;
8.21 + private PerformanceCounter[] coreLoadCounters;
8.22
8.23 private const ushort PCI_AMD_VENDOR_ID = 0x1022;
8.24 private const ushort PCI_AMD_10H_MISCELLANEOUS_DEVICE_ID = 0x1203;
8.25 @@ -63,6 +71,23 @@
8.26 uint coreCount = 1;
8.27 if (cpuidExtData.GetLength(0) > 8)
8.28 coreCount = (cpuidExtData[8, 2] & 0xFF) + 1;
8.29 +
8.30 + totalLoadCounter = new PerformanceCounter();
8.31 + totalLoadCounter.CategoryName = "Processor";
8.32 + totalLoadCounter.CounterName = "% Processor Time";
8.33 + totalLoadCounter.InstanceName = "_Total";
8.34 + totalLoad = new Sensor("CPU Total", 0, SensorType.Load, this);
8.35 +
8.36 + coreLoadCounters = new PerformanceCounter[coreCount];
8.37 + coreLoads = new Sensor[coreCount];
8.38 + for (int i = 0; i < coreLoadCounters.Length; i++) {
8.39 + coreLoadCounters[i] = new PerformanceCounter();
8.40 + coreLoadCounters[i].CategoryName = "Processor";
8.41 + coreLoadCounters[i].CounterName = "% Processor Time";
8.42 + coreLoadCounters[i].InstanceName = i.ToString();
8.43 + coreLoads[i] = new Sensor("Core #" + (i + 1), i + 1,
8.44 + SensorType.Load, this);
8.45 + }
8.46
8.47 // AMD family 10h processors support only one temperature sensor
8.48 coreTemperature = new Sensor(
8.49 @@ -87,9 +112,7 @@
8.50 }
8.51
8.52 public ISensor[] Sensors {
8.53 - get {
8.54 - return new ISensor[] { coreTemperature };
8.55 - }
8.56 + get { return active.ToArray(); }
8.57 }
8.58
8.59 public string GetReport() {
8.60 @@ -102,14 +125,40 @@
8.61
8.62 uint value;
8.63 if (WinRing0.ReadPciConfigDwordEx(pciAddress,
8.64 - REPORTED_TEMPERATURE_CONTROL_REGISTER, out value))
8.65 - coreTemperature.Value = ((value >> 21) & 0x7FF) / 8.0f;
8.66 + REPORTED_TEMPERATURE_CONTROL_REGISTER, out value)) {
8.67 + coreTemperature.Value = ((value >> 21) & 0x7FF) / 8.0f;
8.68 + ActivateSensor(coreTemperature);
8.69 + } else {
8.70 + DeactivateSensor(coreTemperature);
8.71 + }
8.72 +
8.73 + totalLoad.Value = totalLoadCounter.NextValue();
8.74 + ActivateSensor(totalLoad);
8.75 +
8.76 + for (int i = 0; i < coreLoads.Length; i++) {
8.77 + coreLoads[i].Value = coreLoadCounters[i].NextValue();
8.78 + ActivateSensor(coreLoads[i]);
8.79 + }
8.80 }
8.81
8.82 - #pragma warning disable 67
8.83 + private void ActivateSensor(Sensor sensor) {
8.84 + if (!active.Contains(sensor)) {
8.85 + active.Add(sensor);
8.86 + if (SensorAdded != null)
8.87 + SensorAdded(sensor);
8.88 + }
8.89 + }
8.90 +
8.91 + private void DeactivateSensor(Sensor sensor) {
8.92 + if (active.Contains(sensor)) {
8.93 + active.Remove(sensor);
8.94 + if (SensorRemoved != null)
8.95 + SensorRemoved(sensor);
8.96 + }
8.97 + }
8.98 +
8.99 public event SensorEventHandler SensorAdded;
8.100 public event SensorEventHandler SensorRemoved;
8.101 - #pragma warning restore 67
8.102
8.103 }
8.104 }
9.1 --- a/Hardware/CPU/IntelCPU.cs Wed Feb 03 18:10:11 2010 +0000
9.2 +++ b/Hardware/CPU/IntelCPU.cs Wed Feb 03 20:35:10 2010 +0000
9.3 @@ -38,6 +38,7 @@
9.4 using System;
9.5 using System.Collections.Generic;
9.6 using System.Drawing;
9.7 +using System.Diagnostics;
9.8 using System.Reflection;
9.9 using System.Text;
9.10
9.11 @@ -48,12 +49,19 @@
9.12 private Image icon;
9.13
9.14 private Sensor[] coreTemperatures;
9.15 + private Sensor totalLoad;
9.16 + private Sensor[] coreLoads;
9.17 +
9.18 + private List<ISensor> active = new List<ISensor>();
9.19
9.20 private float tjMax = 0;
9.21 private uint logicalProcessors;
9.22 private uint logicalProcessorsPerCore;
9.23 private uint coreCount;
9.24
9.25 + private PerformanceCounter totalLoadCounter;
9.26 + private PerformanceCounter[] coreLoadCounters;
9.27 +
9.28 private const uint IA32_THERM_STATUS_MSR = 0x019C;
9.29 private const uint IA32_TEMPERATURE_TARGET = 0x01A2;
9.30
9.31 @@ -125,11 +133,29 @@
9.32 default: tjMax = 100; break;
9.33 }
9.34
9.35 + totalLoadCounter = new PerformanceCounter();
9.36 + totalLoadCounter.CategoryName = "Processor";
9.37 + totalLoadCounter.CounterName = "% Processor Time";
9.38 + totalLoadCounter.InstanceName = "_Total";
9.39 + totalLoad = new Sensor("CPU Total", 0, SensorType.Load, this);
9.40 +
9.41 + coreLoadCounters = new PerformanceCounter[
9.42 + coreCount * logicalProcessorsPerCore];
9.43 + for (int i = 0; i < coreLoadCounters.Length; i++) {
9.44 + coreLoadCounters[i] = new PerformanceCounter();
9.45 + coreLoadCounters[i].CategoryName = "Processor";
9.46 + coreLoadCounters[i].CounterName = "% Processor Time";
9.47 + coreLoadCounters[i].InstanceName = i.ToString();
9.48 + }
9.49 +
9.50 coreTemperatures = new Sensor[coreCount];
9.51 - for (int i = 0; i < coreTemperatures.Length; i++)
9.52 - coreTemperatures[i] =
9.53 - new Sensor("Core #" + (i + 1), i, tjMax, SensorType.Temperature,
9.54 - this);
9.55 + coreLoads = new Sensor[coreCount];
9.56 + for (int i = 0; i < coreTemperatures.Length; i++) {
9.57 + coreTemperatures[i] = new Sensor("Core #" + (i + 1), i, tjMax,
9.58 + SensorType.Temperature, this);
9.59 + coreLoads[i] = new Sensor("Core #" + (i + 1), i + 1,
9.60 + SensorType.Load, this);
9.61 + }
9.62
9.63 Update();
9.64 }
9.65 @@ -147,9 +173,7 @@
9.66 }
9.67
9.68 public ISensor[] Sensors {
9.69 - get {
9.70 - return coreTemperatures;
9.71 - }
9.72 + get { return active.ToArray(); }
9.73 }
9.74
9.75 public string GetReport() {
9.76 @@ -180,14 +204,44 @@
9.77 if ((eax & 0x80000000) != 0) {
9.78 // get the dist from tjMax from bits 22:16
9.79 coreTemperatures[i].Value = tjMax - ((eax & 0x007F0000) >> 16);
9.80 + ActivateSensor(coreTemperatures[i]);
9.81 + } else {
9.82 + DeactivateSensor(coreTemperatures[i]);
9.83 }
9.84 }
9.85 - }
9.86 + }
9.87 +
9.88 + totalLoad.Value = totalLoadCounter.NextValue();
9.89 + ActivateSensor(totalLoad);
9.90 +
9.91 + for (int i = 0; i < coreLoads.Length; i++) {
9.92 + float value = 0;
9.93 + for (int j = 0; j < logicalProcessorsPerCore; j++)
9.94 + value += coreLoadCounters[
9.95 + logicalProcessorsPerCore * i + j].NextValue();
9.96 + value /= logicalProcessorsPerCore;
9.97 + coreLoads[i].Value = value;
9.98 + ActivateSensor(coreLoads[i]);
9.99 + }
9.100 }
9.101
9.102 - #pragma warning disable 67
9.103 + private void ActivateSensor(Sensor sensor) {
9.104 + if (!active.Contains(sensor)) {
9.105 + active.Add(sensor);
9.106 + if (SensorAdded != null)
9.107 + SensorAdded(sensor);
9.108 + }
9.109 + }
9.110 +
9.111 + private void DeactivateSensor(Sensor sensor) {
9.112 + if (active.Contains(sensor)) {
9.113 + active.Remove(sensor);
9.114 + if (SensorRemoved != null)
9.115 + SensorRemoved(sensor);
9.116 + }
9.117 + }
9.118 +
9.119 public event SensorEventHandler SensorAdded;
9.120 public event SensorEventHandler SensorRemoved;
9.121 - #pragma warning restore 67
9.122 }
9.123 }
10.1 --- a/Hardware/ISensor.cs Wed Feb 03 18:10:11 2010 +0000
10.2 +++ b/Hardware/ISensor.cs Wed Feb 03 20:35:10 2010 +0000
10.3 @@ -42,8 +42,9 @@
10.4
10.5 public enum SensorType {
10.6 Voltage,
10.7 - Clock,
10.8 + Clock,
10.9 Temperature,
10.10 + Load,
10.11 Fan
10.12 }
10.13
11.1 --- a/OpenHardwareMonitor.csproj Wed Feb 03 18:10:11 2010 +0000
11.2 +++ b/OpenHardwareMonitor.csproj Wed Feb 03 20:35:10 2010 +0000
11.3 @@ -4,7 +4,7 @@
11.4 <Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
11.5 <Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
11.6 <ProjectGuid>{F5E0C1F7-9E9B-46F2-AC88-8C9C1C923880}</ProjectGuid>
11.7 - <ProductVersion>9.0.21022</ProductVersion>
11.8 + <ProductVersion>9.0.30729</ProductVersion>
11.9 <SchemaVersion>2.0</SchemaVersion>
11.10 <OutputType>WinExe</OutputType>
11.11 <NoStandardLibraries>false</NoStandardLibraries>
11.12 @@ -135,6 +135,7 @@
11.13 <EmbeddedResource Include="Resources\chip.png" />
11.14 <EmbeddedResource Include="Resources\hdd.png" />
11.15 <Content Include="Resources\icon.ico" />
11.16 + <EmbeddedResource Include="Resources\load.png" />
11.17 <EmbeddedResource Include="Resources\voltage.png" />
11.18 <EmbeddedResource Include="Resources\nvidia.png" />
11.19 </ItemGroup>
12.1 --- a/Properties/AssemblyInfo.cs Wed Feb 03 18:10:11 2010 +0000
12.2 +++ b/Properties/AssemblyInfo.cs Wed Feb 03 20:35:10 2010 +0000
12.3 @@ -69,5 +69,5 @@
12.4 // You can specify all the values or you can default the Build and Revision Numbers
12.5 // by using the '*' as shown below:
12.6 // [assembly: AssemblyVersion("1.0.*")]
12.7 -[assembly: AssemblyVersion("0.1.10.0")]
12.8 -[assembly: AssemblyFileVersion("0.1.10.0")]
12.9 +[assembly: AssemblyVersion("0.1.11.0")]
12.10 +[assembly: AssemblyFileVersion("0.1.11.0")]
13.1 Binary file Resources/load.png has changed