diff --git a/GUI/HardwareNode.cs b/GUI/HardwareNode.cs index 16572cc..ca93f6a 100644 --- a/GUI/HardwareNode.cs +++ b/GUI/HardwareNode.cs @@ -58,6 +58,7 @@ namespace OpenHardwareMonitor.GUI { typeNodes.Add(new TypeNode(SensorType.Load)); typeNodes.Add(new TypeNode(SensorType.Fan)); typeNodes.Add(new TypeNode(SensorType.Flow)); + typeNodes.Add(new TypeNode(SensorType.Control)); foreach (ISensor sensor in hardware.Sensors) SensorAdded(sensor); diff --git a/GUI/SensorNode.cs b/GUI/SensorNode.cs index d4e8976..8ecc7a8 100644 --- a/GUI/SensorNode.cs +++ b/GUI/SensorNode.cs @@ -63,6 +63,7 @@ namespace OpenHardwareMonitor.GUI { case SensorType.Temperature: format = "{0:F1} °C"; break; case SensorType.Fan: format = "{0:F0} RPM"; break; case SensorType.Flow: format = "{0:F0} L/h"; break; + case SensorType.Control: format = "{0:F1} %"; break; } bool hidden = Config.Get(new Identifier(sensor.Identifier, diff --git a/GUI/SensorNotifyIcon.cs b/GUI/SensorNotifyIcon.cs index 8bc5cdf..1d90978 100644 --- a/GUI/SensorNotifyIcon.cs +++ b/GUI/SensorNotifyIcon.cs @@ -151,13 +151,15 @@ namespace OpenHardwareMonitor.GUI { case SensorType.Clock: return string.Format("{0:F11}", 1e-3f * sensor.Value); case SensorType.Load: - return string.Format("{0:F0}", sensor.Value < 99 ? sensor.Value : 99); + return string.Format("{0:F0}", sensor.Value); case SensorType.Temperature: return string.Format("{0:F0}", sensor.Value); case SensorType.Fan: return string.Format("{0:F11}", 1e-3f * sensor.Value); case SensorType.Flow: return string.Format("{0:F11}", 1e-3f * sensor.Value); + case SensorType.Control: + return string.Format("{0:F0}", sensor.Value); } return "-"; } @@ -235,6 +237,7 @@ namespace OpenHardwareMonitor.GUI { case SensorType.Temperature: format = "\n{0}: {1:F1} °C"; break; case SensorType.Fan: format = "\n{0}: {1:F0} RPM"; break; case SensorType.Flow: format = "\n{0}: {1:F0} L/h"; break; + case SensorType.Control: format = "\n{0}: {1:F1} %"; break; } string formattedValue = string.Format(format, sensor.Name, sensor.Value); string hardwareName = sensor.Hardware.Name; diff --git a/GUI/TypeNode.cs b/GUI/TypeNode.cs index 08fe496..eabd722 100644 --- a/GUI/TypeNode.cs +++ b/GUI/TypeNode.cs @@ -72,6 +72,10 @@ namespace OpenHardwareMonitor.GUI { this.Image = Utilities.EmbeddedResources.GetImage("flow.png"); this.Text = "Flows"; break; + case SensorType.Control: + this.Image = Utilities.EmbeddedResources.GetImage("control.png"); + this.Text = "Controls"; + break; } NodeAdded += new NodeEventHandler(TypeNode_NodeAdded); diff --git a/Hardware/ISensor.cs b/Hardware/ISensor.cs index 672a121..67be541 100644 --- a/Hardware/ISensor.cs +++ b/Hardware/ISensor.cs @@ -47,7 +47,8 @@ namespace OpenHardwareMonitor.Hardware { Temperature, Load, Fan, - Flow + Flow, + Control } public interface ISensorEntry { diff --git a/Hardware/TBalancer/TBalancer.cs b/Hardware/TBalancer/TBalancer.cs index 283c987..2dbfdd8 100644 --- a/Hardware/TBalancer/TBalancer.cs +++ b/Hardware/TBalancer/TBalancer.cs @@ -53,6 +53,7 @@ namespace OpenHardwareMonitor.Hardware.TBalancer { private Sensor[] sensorhubTemperatures = new Sensor[6]; private Sensor[] sensorhubFlows = new Sensor[2]; private Sensor[] fans = new Sensor[4]; + private Sensor[] controls = new Sensor[4]; private Sensor[] miniNGTemperatures = new Sensor[4]; private Sensor[] miniNGFans = new Sensor[4]; private List active = new List(); @@ -90,20 +91,25 @@ namespace OpenHardwareMonitor.Hardware.TBalancer { offset + i, null, SensorType.Temperature, this, parameter); offset += sensorhubTemperatures.Length; - for (int i = 0; i < sensorhubFlows.Length; i++) - sensorhubFlows[i] = new Sensor("Flowmeter " + (i + 1), - offset + i, null, SensorType.Flow, this, new ParameterDescription[] { - new ParameterDescription("Impulse Rate", - "The impulse rate of the flowmeter in pulses/L", 509) - }); - offset += sensorhubFlows.Length; - for (int i = 0; i < miniNGTemperatures.Length; i++) miniNGTemperatures[i] = new Sensor("miniNG #" + (i / 2 + 1) + " Sensor " + (i % 2 + 1), offset + i, null, SensorType.Temperature, this, parameter); offset += miniNGTemperatures.Length; + for (int i = 0; i < sensorhubFlows.Length; i++) + sensorhubFlows[i] = new Sensor("Flowmeter " + (i + 1), + i, null, SensorType.Flow, this, new ParameterDescription[] { + new ParameterDescription("Impulse Rate", + "The impulse rate of the flowmeter in pulses/L", 509) + }); + + for (int i = 0; i < controls.Length; i++) { + controls[i] = new Sensor("Fan Channel " + i, i, null, + SensorType.Control, this, null); + ActivateSensor(controls[i]); + } + alternativeRequest = new MethodDelegate(DelayedAlternativeRequest); Open(); @@ -226,11 +232,16 @@ namespace OpenHardwareMonitor.Hardware.TBalancer { "Maximum revolutions per minute (RPM) of the fan.", maxRPM) }); - if ((data[136] & (1 << i)) == 0) // pwm mode - fans[i].Value = fans[i].Parameters[0].Value * 0.02f * data[137 + i]; + float value; + if ((data[136] & (1 << i)) == 0) // pwm mode + value = 0.02f * data[137 + i]; else // analog mode - fans[i].Value = fans[i].Parameters[0].Value * 0.01f * data[141 + i]; + value = 0.01f * data[141 + i]; + + fans[i].Value = fans[i].Parameters[0].Value * value; ActivateSensor(fans[i]); + + controls[i].Value = 100 * value; } } else if (data[1] == 253) { // miniNG #1 diff --git a/OpenHardwareMonitor.csproj b/OpenHardwareMonitor.csproj index 8dcf543..22ec9e5 100644 --- a/OpenHardwareMonitor.csproj +++ b/OpenHardwareMonitor.csproj @@ -200,6 +200,9 @@ + + + diff --git a/Resources/control.png b/Resources/control.png new file mode 100644 index 0000000..52f6212 Binary files /dev/null and b/Resources/control.png differ