# HG changeset patch # User moel.mich # Date 1275822477 0 # Node ID 8b3b9b2e28e53a342094a18eb497d335ecb4500a # Parent 9ad699538c8963794f1ec0b75906c688a9fdab10 Fixed Issue 69. diff -r 9ad699538c89 -r 8b3b9b2e28e5 GUI/MainForm.Designer.cs --- a/GUI/MainForm.Designer.cs Sat Jun 05 18:59:54 2010 +0000 +++ b/GUI/MainForm.Designer.cs Sun Jun 06 11:07:57 2010 +0000 @@ -67,14 +67,12 @@ 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 @@ 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 @@ 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 @@ 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 @@ 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 @@ 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 @@ 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 @@ 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 @@ 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 @@ 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 @@ // 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 @@ 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 @@ 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; diff -r 9ad699538c89 -r 8b3b9b2e28e5 GUI/MainForm.cs --- a/GUI/MainForm.cs Sat Jun 05 18:59:54 2010 +0000 +++ b/GUI/MainForm.cs Sun Jun 06 11:07:57 2010 +0000 @@ -73,7 +73,6 @@ 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 @@ 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 @@ 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 @@ 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 @@ 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; diff -r 9ad699538c89 -r 8b3b9b2e28e5 GUI/SensorNode.cs --- a/GUI/SensorNode.cs Sat Jun 05 18:59:54 2010 +0000 +++ b/GUI/SensorNode.cs Sun Jun 06 11:07:57 2010 +0000 @@ -111,18 +111,6 @@ 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; diff -r 9ad699538c89 -r 8b3b9b2e28e5 Hardware/ATI/ATIGPU.cs --- a/Hardware/ATI/ATIGPU.cs Sat Jun 05 18:59:54 2010 +0000 +++ b/Hardware/ATI/ATIGPU.cs Sun Jun 06 11:07:57 2010 +0000 @@ -69,8 +69,7 @@ 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); diff -r 9ad699538c89 -r 8b3b9b2e28e5 Hardware/CPU/AMD0FCPU.cs --- a/Hardware/CPU/AMD0FCPU.cs Sat Jun 05 18:59:54 2010 +0000 +++ b/Hardware/CPU/AMD0FCPU.cs Sun Jun 06 11:07:57 2010 +0000 @@ -88,7 +88,7 @@ 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" + diff -r 9ad699538c89 -r 8b3b9b2e28e5 Hardware/CPU/AMD10CPU.cs --- a/Hardware/CPU/AMD10CPU.cs Sat Jun 05 18:59:54 2010 +0000 +++ b/Hardware/CPU/AMD10CPU.cs Sun Jun 06 11:07:57 2010 +0000 @@ -85,7 +85,7 @@ // 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) }); diff -r 9ad699538c89 -r 8b3b9b2e28e5 Hardware/CPU/IntelCPU.cs --- a/Hardware/CPU/IntelCPU.cs Sat Jun 05 18:59:54 2010 +0000 +++ b/Hardware/CPU/IntelCPU.cs Sun Jun 06 11:07:57 2010 +0000 @@ -172,7 +172,7 @@ { 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" + diff -r 9ad699538c89 -r 8b3b9b2e28e5 Hardware/ISensor.cs --- a/Hardware/ISensor.cs Sat Jun 05 18:59:54 2010 +0000 +++ b/Hardware/ISensor.cs Sun Jun 06 11:07:57 2010 +0000 @@ -72,8 +72,7 @@ float? Value { get; } float? Min { get; } - float? Max { get; } - float? Limit { get; set; } + float? Max { get; } IEnumerable Plot { get; } } diff -r 9ad699538c89 -r 8b3b9b2e28e5 Hardware/Mainboard/SuperIOHardware.cs --- a/Hardware/Mainboard/SuperIOHardware.cs Sat Jun 05 18:59:54 2010 +0000 +++ b/Hardware/Mainboard/SuperIOHardware.cs Sun Jun 06 11:07:57 2010 +0000 @@ -431,7 +431,7 @@ 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 @@ 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 @@ 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); } diff -r 9ad699538c89 -r 8b3b9b2e28e5 Hardware/Nvidia/NvidiaGPU.cs --- a/Hardware/Nvidia/NvidiaGPU.cs Sat Jun 05 18:59:54 2010 +0000 +++ b/Hardware/Nvidia/NvidiaGPU.cs Sun Jun 06 11:07:57 2010 +0000 @@ -74,8 +74,8 @@ 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]); } diff -r 9ad699538c89 -r 8b3b9b2e28e5 Hardware/Sensor.cs --- a/Hardware/Sensor.cs Sat Jun 05 18:59:54 2010 +0000 +++ b/Hardware/Sensor.cs Sun Jun 06 11:07:57 2010 +0000 @@ -53,8 +53,6 @@ private float? value; private float? min; private float? max; - private float? limit; - private float? defaultLimit; private Queue entries = new Queue(MAX_MINUTES * 15); @@ -64,22 +62,21 @@ 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 @@ 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 @@ 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 Plot { get { return entries; } } diff -r 9ad699538c89 -r 8b3b9b2e28e5 Hardware/TBalancer/TBalancer.cs --- a/Hardware/TBalancer/TBalancer.cs Sat Jun 05 18:59:54 2010 +0000 +++ b/Hardware/TBalancer/TBalancer.cs Sun Jun 06 11:07:57 2010 +0000 @@ -78,34 +78,34 @@ 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 @@ 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 @@ 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)