Fixed Issue 69.

This commit is contained in:
Michael Möller
2010-06-06 11:07:57 +00:00
parent c641a6a2fc
commit dd67a0aa5c
12 changed files with 27 additions and 114 deletions

View File

@@ -67,14 +67,12 @@ namespace OpenHardwareMonitor.GUI {
this.value = new Aga.Controls.Tree.TreeColumn();
this.min = new Aga.Controls.Tree.TreeColumn();
this.max = new Aga.Controls.Tree.TreeColumn();
this.limit = new Aga.Controls.Tree.TreeColumn();
this.nodeImage = new Aga.Controls.Tree.NodeControls.NodeIcon();
this.nodeCheckBox = new Aga.Controls.Tree.NodeControls.NodeCheckBox();
this.nodeTextBoxText = new Aga.Controls.Tree.NodeControls.NodeTextBox();
this.nodeTextBoxValue = new Aga.Controls.Tree.NodeControls.NodeTextBox();
this.nodeTextBoxMin = new Aga.Controls.Tree.NodeControls.NodeTextBox();
this.nodeTextBoxMax = new Aga.Controls.Tree.NodeControls.NodeTextBox();
this.nodeTextBoxLimit = new Aga.Controls.Tree.NodeControls.NodeTextBox();
this.menuStrip = new System.Windows.Forms.MenuStrip();
this.fileToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
this.saveReportToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
@@ -87,7 +85,6 @@ namespace OpenHardwareMonitor.GUI {
this.valueMenuItem = new System.Windows.Forms.ToolStripMenuItem();
this.minMenuItem = new System.Windows.Forms.ToolStripMenuItem();
this.maxMenuItem = new System.Windows.Forms.ToolStripMenuItem();
this.limitMenuItem = new System.Windows.Forms.ToolStripMenuItem();
this.optionsToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
this.startMinMenuItem = new System.Windows.Forms.ToolStripMenuItem();
this.minTrayMenuItem = new System.Windows.Forms.ToolStripMenuItem();
@@ -118,7 +115,6 @@ namespace OpenHardwareMonitor.GUI {
this.treeView.Columns.Add(this.value);
this.treeView.Columns.Add(this.min);
this.treeView.Columns.Add(this.max);
this.treeView.Columns.Add(this.limit);
this.treeView.DefaultToolTipProvider = null;
this.treeView.Dock = System.Windows.Forms.DockStyle.Fill;
this.treeView.DragDropMarkColor = System.Drawing.Color.Black;
@@ -134,7 +130,6 @@ namespace OpenHardwareMonitor.GUI {
this.treeView.NodeControls.Add(this.nodeTextBoxValue);
this.treeView.NodeControls.Add(this.nodeTextBoxMin);
this.treeView.NodeControls.Add(this.nodeTextBoxMax);
this.treeView.NodeControls.Add(this.nodeTextBoxLimit);
this.treeView.RowHeight = 18;
this.treeView.SelectedNode = null;
this.treeView.Size = new System.Drawing.Size(410, 488);
@@ -172,13 +167,6 @@ namespace OpenHardwareMonitor.GUI {
this.max.TooltipText = null;
this.max.Width = 100;
//
// limit
//
this.limit.Header = "Limit";
this.limit.SortOrder = System.Windows.Forms.SortOrder.None;
this.limit.TooltipText = null;
this.limit.Width = 100;
//
// nodeImage
//
this.nodeImage.DataPropertyName = "Image";
@@ -222,14 +210,6 @@ namespace OpenHardwareMonitor.GUI {
this.nodeTextBoxMax.LeftMargin = 3;
this.nodeTextBoxMax.ParentColumn = this.max;
//
// nodeTextBoxLimit
//
this.nodeTextBoxLimit.DataPropertyName = "Limit";
this.nodeTextBoxLimit.EditEnabled = true;
this.nodeTextBoxLimit.IncrementalSearchEnabled = true;
this.nodeTextBoxLimit.LeftMargin = 3;
this.nodeTextBoxLimit.ParentColumn = this.limit;
//
// menuStrip
//
this.menuStrip.Items.AddRange(new System.Windows.Forms.ToolStripItem[] {
@@ -305,8 +285,7 @@ namespace OpenHardwareMonitor.GUI {
this.columnsToolStripMenuItem.DropDownItems.AddRange(new System.Windows.Forms.ToolStripItem[] {
this.valueMenuItem,
this.minMenuItem,
this.maxMenuItem,
this.limitMenuItem});
this.maxMenuItem});
this.columnsToolStripMenuItem.Name = "columnsToolStripMenuItem";
this.columnsToolStripMenuItem.Size = new System.Drawing.Size(188, 22);
this.columnsToolStripMenuItem.Text = "Columns";
@@ -317,7 +296,7 @@ namespace OpenHardwareMonitor.GUI {
this.valueMenuItem.CheckOnClick = true;
this.valueMenuItem.CheckState = System.Windows.Forms.CheckState.Checked;
this.valueMenuItem.Name = "valueMenuItem";
this.valueMenuItem.Size = new System.Drawing.Size(103, 22);
this.valueMenuItem.Size = new System.Drawing.Size(152, 22);
this.valueMenuItem.Text = "Value";
this.valueMenuItem.CheckedChanged += new System.EventHandler(this.valueMenuItem_CheckedChanged);
//
@@ -327,7 +306,7 @@ namespace OpenHardwareMonitor.GUI {
this.minMenuItem.CheckOnClick = true;
this.minMenuItem.CheckState = System.Windows.Forms.CheckState.Checked;
this.minMenuItem.Name = "minMenuItem";
this.minMenuItem.Size = new System.Drawing.Size(103, 22);
this.minMenuItem.Size = new System.Drawing.Size(152, 22);
this.minMenuItem.Text = "Min";
this.minMenuItem.CheckedChanged += new System.EventHandler(this.minMenuItem_CheckedChanged);
//
@@ -337,20 +316,10 @@ namespace OpenHardwareMonitor.GUI {
this.maxMenuItem.CheckOnClick = true;
this.maxMenuItem.CheckState = System.Windows.Forms.CheckState.Checked;
this.maxMenuItem.Name = "maxMenuItem";
this.maxMenuItem.Size = new System.Drawing.Size(103, 22);
this.maxMenuItem.Size = new System.Drawing.Size(152, 22);
this.maxMenuItem.Text = "Max";
this.maxMenuItem.CheckedChanged += new System.EventHandler(this.maxMenuItem_CheckedChanged);
//
// limitMenuItem
//
this.limitMenuItem.Checked = true;
this.limitMenuItem.CheckOnClick = true;
this.limitMenuItem.CheckState = System.Windows.Forms.CheckState.Checked;
this.limitMenuItem.Name = "limitMenuItem";
this.limitMenuItem.Size = new System.Drawing.Size(103, 22);
this.limitMenuItem.Text = "Limit";
this.limitMenuItem.CheckedChanged += new System.EventHandler(this.limitMenuItem_CheckedChanged);
//
// optionsToolStripMenuItem
//
this.optionsToolStripMenuItem.DropDownItems.AddRange(new System.Windows.Forms.ToolStripItem[] {
@@ -476,7 +445,7 @@ namespace OpenHardwareMonitor.GUI {
// sensorContextMenuStrip
//
this.sensorContextMenuStrip.Name = "sensorContextMenuStrip";
this.sensorContextMenuStrip.Size = new System.Drawing.Size(153, 26);
this.sensorContextMenuStrip.Size = new System.Drawing.Size(61, 4);
//
// saveFileDialog
//
@@ -536,8 +505,6 @@ namespace OpenHardwareMonitor.GUI {
private Aga.Controls.Tree.NodeControls.NodeCheckBox nodeCheckBox;
private System.Windows.Forms.ToolStripMenuItem helpToolStripMenuItem;
private System.Windows.Forms.ToolStripMenuItem aboutToolStripMenuItem;
private Aga.Controls.Tree.TreeColumn limit;
private Aga.Controls.Tree.NodeControls.NodeTextBox nodeTextBoxLimit;
private System.Windows.Forms.ToolStripMenuItem saveReportToolStripMenuItem;
private System.Windows.Forms.ToolStripMenuItem optionsToolStripMenuItem;
private System.Windows.Forms.ToolStripMenuItem hddMenuItem;
@@ -554,7 +521,6 @@ namespace OpenHardwareMonitor.GUI {
private System.Windows.Forms.ToolStripMenuItem valueMenuItem;
private System.Windows.Forms.ToolStripMenuItem minMenuItem;
private System.Windows.Forms.ToolStripMenuItem maxMenuItem;
private System.Windows.Forms.ToolStripMenuItem limitMenuItem;
private System.Windows.Forms.ToolStripMenuItem temperatureUnitsToolStripMenuItem;
private System.Windows.Forms.ToolStripSeparator toolStripMenuItem4;
private System.Windows.Forms.ToolStripMenuItem celciusToolStripMenuItem;

View File

@@ -73,7 +73,6 @@ namespace OpenHardwareMonitor.GUI {
nodeTextBoxValue.DrawText += nodeTextBoxText_DrawText;
nodeTextBoxMin.DrawText += nodeTextBoxText_DrawText;
nodeTextBoxMax.DrawText += nodeTextBoxText_DrawText;
nodeTextBoxLimit.DrawText += nodeTextBoxLimit_DrawText;
if (Utilities.Config.Contains("mainForm.Location.X")) {
int x = Utilities.Config.Get("mainForm.Location.X", Location.X);
@@ -131,7 +130,6 @@ namespace OpenHardwareMonitor.GUI {
valueMenuItem.Checked = Config.Get(valueMenuItem.Name, true);
minMenuItem.Checked = Config.Get(minMenuItem.Name, false);
maxMenuItem.Checked = Config.Get(maxMenuItem.Name, true);
limitMenuItem.Checked = Config.Get(limitMenuItem.Name, false);
startMinMenuItem.Checked = Config.Get(startMinMenuItem.Name, false);
minTrayMenuItem.Checked = Config.Get(minTrayMenuItem.Name, true);
@@ -193,12 +191,6 @@ namespace OpenHardwareMonitor.GUI {
root.Nodes.Remove(node);
}
private void nodeTextBoxLimit_DrawText(object sender, DrawEventArgs e) {
SensorNode sensorNode = e.Node.Tag as SensorNode;
if (sensorNode != null)
e.Text = sensorNode.ValueToString(sensorNode.Sensor.Limit);
}
private void nodeTextBoxText_DrawText(object sender, DrawEventArgs e) {
Node node = e.Node.Tag as Node;
if (node != null) {
@@ -262,7 +254,6 @@ namespace OpenHardwareMonitor.GUI {
Config.Set(valueMenuItem.Name, valueMenuItem.Checked);
Config.Set(minMenuItem.Name, minMenuItem.Checked);
Config.Set(maxMenuItem.Name, maxMenuItem.Checked);
Config.Set(limitMenuItem.Name, limitMenuItem.Checked);
Config.Set(startMinMenuItem.Name, startMinMenuItem.Checked);
Config.Set(minTrayMenuItem.Name, minTrayMenuItem.Checked);
@@ -443,10 +434,6 @@ namespace OpenHardwareMonitor.GUI {
treeView.Columns[3].IsVisible = maxMenuItem.Checked;
}
private void limitMenuItem_CheckedChanged(object sender, EventArgs e) {
treeView.Columns[4].IsVisible = limitMenuItem.Checked;
}
private void celciusToolStripMenuItem_Click(object sender, EventArgs e) {
celciusToolStripMenuItem.Checked = true;
fahrenheitToolStripMenuItem.Checked = false;

View File

@@ -111,18 +111,6 @@ namespace OpenHardwareMonitor.GUI {
get { return ValueToString(sensor.Max); }
}
public String Limit {
get {
return sensor.Limit.ToString();
}
set {
if (value != "")
sensor.Limit = float.Parse(value);
else
sensor.Limit = null;
}
}
public override bool Equals(System.Object obj) {
if (obj == null)
return false;

View File

@@ -69,8 +69,7 @@ namespace OpenHardwareMonitor.Hardware.ATI {
this.temperature =
new Sensor("GPU Core", 0, SensorType.Temperature, this);
this.fan = new Sensor("GPU", 0, speedInfo.MaxRPM, SensorType.Fan, this,
null);
this.fan = new Sensor("GPU", 0, SensorType.Fan, this, null);
this.coreClock = new Sensor("GPU Core", 0, SensorType.Clock, this);
this.memoryClock = new Sensor("GPU Memory", 1, SensorType.Clock, this);
this.coreVoltage = new Sensor("GPU Core", 0, SensorType.Voltage, this);

View File

@@ -88,7 +88,7 @@ namespace OpenHardwareMonitor.Hardware.CPU {
coreTemperatures = new Sensor[coreCount];
for (int i = 0; i < coreCount; i++) {
coreTemperatures[i] =
new Sensor("Core #" + (i + 1), i, null, SensorType.Temperature,
new Sensor("Core #" + (i + 1), i, SensorType.Temperature,
this, new ParameterDescription[] {
new ParameterDescription("Offset [°C]",
"Temperature offset of the thermal sensor.\n" +

View File

@@ -85,7 +85,7 @@ namespace OpenHardwareMonitor.Hardware.CPU {
// AMD family 10h processors support only one temperature sensor
coreTemperature = new Sensor(
"Core" + (coreCount > 1 ? " #1 - #" + coreCount : ""), 0, null,
"Core" + (coreCount > 1 ? " #1 - #" + coreCount : ""), 0,
SensorType.Temperature, this, new ParameterDescription[] {
new ParameterDescription("Offset [°C]", "Temperature offset.", 0)
});

View File

@@ -172,7 +172,7 @@ namespace OpenHardwareMonitor.Hardware.CPU {
{
coreTemperatures = new Sensor[coreCount];
for (int i = 0; i < coreTemperatures.Length; i++) {
coreTemperatures[i] = new Sensor(CoreString(i), i, tjMax[i],
coreTemperatures[i] = new Sensor(CoreString(i), i,
SensorType.Temperature, this, new ParameterDescription[] {
new ParameterDescription(
"TjMax [°C]", "TjMax temperature of the core.\n" +

View File

@@ -72,8 +72,7 @@ namespace OpenHardwareMonitor.Hardware {
float? Value { get; }
float? Min { get; }
float? Max { get; }
float? Limit { get; set; }
float? Max { get; }
IEnumerable<ISensorEntry> Plot { get; }
}

View File

@@ -431,7 +431,7 @@ namespace OpenHardwareMonitor.Hardware.Mainboard {
foreach (Voltage voltage in v)
if (voltage.Index < superIO.Voltages.Length) {
Sensor sensor = new Sensor(voltage.Name, voltage.Index,
voltage.Hidden, null, SensorType.Voltage, this,
voltage.Hidden, SensorType.Voltage, this,
new ParameterDescription[] {
new ParameterDescription("Ri [kΩ]", "Input resistance.\n" +
formula, voltage.Ri),
@@ -445,7 +445,7 @@ namespace OpenHardwareMonitor.Hardware.Mainboard {
foreach (Temperature temperature in t)
if (temperature.Index < superIO.Temperatures.Length) {
Sensor sensor = new Sensor(temperature.Name, temperature.Index, null,
Sensor sensor = new Sensor(temperature.Name, temperature.Index,
SensorType.Temperature, this, new ParameterDescription[] {
new ParameterDescription("Offset [°C]", "Temperature offset.", 0)
});
@@ -454,7 +454,7 @@ namespace OpenHardwareMonitor.Hardware.Mainboard {
foreach (Fan fan in f)
if (fan.Index < superIO.Fans.Length) {
Sensor sensor = new Sensor(fan.Name, fan.Index, null, SensorType.Fan,
Sensor sensor = new Sensor(fan.Name, fan.Index, SensorType.Fan,
this, null);
fans.Add(sensor);
}

View File

@@ -74,8 +74,8 @@ namespace OpenHardwareMonitor.Hardware.Nvidia {
case NvThermalTarget.UNKNOWN: name = "GPU Unknown"; break;
default: name = "GPU"; break;
}
temperatures[i] = new Sensor(name, i, sensor.DefaultMaxTemp,
SensorType.Temperature, this, new ParameterDescription[0]);
temperatures[i] = new Sensor(name, i, SensorType.Temperature, this,
new ParameterDescription[0]);
ActivateSensor(temperatures[i]);
}

View File

@@ -53,8 +53,6 @@ namespace OpenHardwareMonitor.Hardware {
private float? value;
private float? min;
private float? max;
private float? limit;
private float? defaultLimit;
private Queue<ISensorEntry> entries =
new Queue<ISensorEntry>(MAX_MINUTES * 15);
@@ -64,22 +62,21 @@ namespace OpenHardwareMonitor.Hardware {
private const int MAX_MINUTES = 120;
public Sensor(string name, int index, SensorType sensorType,
IHardware hardware) : this(name, index, null, sensorType, hardware,
IHardware hardware) : this(name, index, sensorType, hardware,
null) { }
public Sensor(string name, int index, float? limit, SensorType sensorType,
public Sensor(string name, int index, SensorType sensorType,
IHardware hardware, ParameterDescription[] parameterDescriptions) :
this(name, index, false, limit, sensorType, hardware,
this(name, index, false, sensorType, hardware,
parameterDescriptions) { }
public Sensor(string name, int index, bool defaultHidden,
float? limit, SensorType sensorType, IHardware hardware,
SensorType sensorType, IHardware hardware,
ParameterDescription[] parameterDescriptions)
{
this.defaultName = name;
this.index = index;
this.defaultHidden = defaultHidden;
this.defaultLimit = limit;
this.sensorType = sensorType;
this.hardware = hardware;
Parameter[] parameters = new Parameter[parameterDescriptions == null ?
@@ -94,12 +91,6 @@ namespace OpenHardwareMonitor.Hardware {
this.name = configName;
else
this.name = name;
string configLimit = Config.Settings[
new Identifier(Identifier, "limit").ToString()];
if (configLimit != null && configLimit != "")
this.limit = float.Parse(configLimit);
else
this.limit = limit;
}
public IHardware Hardware {
@@ -172,23 +163,6 @@ namespace OpenHardwareMonitor.Hardware {
public float? Min { get { return min; } }
public float? Max { get { return max; } }
public float? Limit {
get {
return limit;
}
set {
if (value.HasValue) {
limit = value;
Config.Settings[new Identifier(Identifier, "limit").ToString()] =
limit.ToString();
} else {
limit = defaultLimit;
Config.Settings[new Identifier(Identifier, "limit").ToString()] = "";
}
}
}
public IEnumerable<ISensorEntry> Plot {
get { return entries; }
}

View File

@@ -78,34 +78,34 @@ namespace OpenHardwareMonitor.Hardware.TBalancer {
int offset = 0;
for (int i = 0; i < digitalTemperatures.Length; i++)
digitalTemperatures[i] = new Sensor("Digital Sensor " + i,
offset + i, null, SensorType.Temperature, this, parameter);
offset + i, SensorType.Temperature, this, parameter);
offset += digitalTemperatures.Length;
for (int i = 0; i < analogTemperatures.Length; i++)
analogTemperatures[i] = new Sensor("Analog Sensor " + (i + 1),
offset + i, null, SensorType.Temperature, this, parameter);
offset + i, SensorType.Temperature, this, parameter);
offset += analogTemperatures.Length;
for (int i = 0; i < sensorhubTemperatures.Length; i++)
sensorhubTemperatures[i] = new Sensor("Sensorhub Sensor " + i,
offset + i, null, SensorType.Temperature, this, parameter);
offset + i, SensorType.Temperature, this, parameter);
offset += sensorhubTemperatures.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,
" Sensor " + (i % 2 + 1), offset + i, 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[] {
i, 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,
controls[i] = new Sensor("Fan Channel " + i, i,
SensorType.Control, this, null);
ActivateSensor(controls[i]);
}
@@ -159,7 +159,7 @@ namespace OpenHardwareMonitor.Hardware.TBalancer {
if (miniNGFans[number * 2 + i] == null)
miniNGFans[number * 2 + i] =
new Sensor("miniNG #" + (number + 1) + " Fan Channel " + (i + 1),
4 + number * 2 + i, maxRPM, SensorType.Fan, this, null);
4 + number * 2 + i, SensorType.Fan, this, null);
Sensor sensor = miniNGFans[number * 2 + i];
@@ -226,7 +226,7 @@ namespace OpenHardwareMonitor.Hardware.TBalancer {
float maxRPM = 11.5f * ((data[149 + 2 * i] << 8) | data[148 + 2 * i]);
if (fans[i] == null)
fans[i] = new Sensor("Fan Channel " + i, i, maxRPM, SensorType.Fan,
fans[i] = new Sensor("Fan Channel " + i, i, SensorType.Fan,
this, new ParameterDescription[] {
new ParameterDescription("MaxRPM",
"Maximum revolutions per minute (RPM) of the fan.", maxRPM)