mirror of
https://github.com/openhardwaremonitor/openhardwaremonitor
synced 2025-08-30 05:47:38 +00:00
Fixed Issue 82.
This commit is contained in:
parent
a72af71590
commit
c7ef3b8ecf
38
GUI/MainForm.Designer.cs
generated
38
GUI/MainForm.Designer.cs
generated
@ -76,6 +76,8 @@ namespace OpenHardwareMonitor.GUI {
|
|||||||
this.menuStrip = new System.Windows.Forms.MenuStrip();
|
this.menuStrip = new System.Windows.Forms.MenuStrip();
|
||||||
this.fileToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
|
this.fileToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
|
||||||
this.saveReportToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
|
this.saveReportToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
|
||||||
|
this.sumbitReportToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
|
||||||
|
this.toolStripMenuItem2 = new System.Windows.Forms.ToolStripSeparator();
|
||||||
this.exitToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
|
this.exitToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
|
||||||
this.viewToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
|
this.viewToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
|
||||||
this.hiddenMenuItem = new System.Windows.Forms.ToolStripMenuItem();
|
this.hiddenMenuItem = new System.Windows.Forms.ToolStripMenuItem();
|
||||||
@ -102,8 +104,8 @@ namespace OpenHardwareMonitor.GUI {
|
|||||||
this.sensorContextMenuStrip = new System.Windows.Forms.ContextMenuStrip(this.components);
|
this.sensorContextMenuStrip = new System.Windows.Forms.ContextMenuStrip(this.components);
|
||||||
this.saveFileDialog = new System.Windows.Forms.SaveFileDialog();
|
this.saveFileDialog = new System.Windows.Forms.SaveFileDialog();
|
||||||
this.timer = new System.Windows.Forms.Timer(this.components);
|
this.timer = new System.Windows.Forms.Timer(this.components);
|
||||||
this.toolStripMenuItem2 = new System.Windows.Forms.ToolStripSeparator();
|
this.toolStripMenuItem3 = new System.Windows.Forms.ToolStripSeparator();
|
||||||
this.sumbitReportToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
|
this.resetMinMaxMenuItem = new System.Windows.Forms.ToolStripMenuItem();
|
||||||
this.menuStrip.SuspendLayout();
|
this.menuStrip.SuspendLayout();
|
||||||
this.splitContainer.Panel1.SuspendLayout();
|
this.splitContainer.Panel1.SuspendLayout();
|
||||||
this.splitContainer.Panel2.SuspendLayout();
|
this.splitContainer.Panel2.SuspendLayout();
|
||||||
@ -243,6 +245,18 @@ namespace OpenHardwareMonitor.GUI {
|
|||||||
this.saveReportToolStripMenuItem.Text = "Save Report...";
|
this.saveReportToolStripMenuItem.Text = "Save Report...";
|
||||||
this.saveReportToolStripMenuItem.Click += new System.EventHandler(this.saveReportToolStripMenuItem_Click);
|
this.saveReportToolStripMenuItem.Click += new System.EventHandler(this.saveReportToolStripMenuItem_Click);
|
||||||
//
|
//
|
||||||
|
// sumbitReportToolStripMenuItem
|
||||||
|
//
|
||||||
|
this.sumbitReportToolStripMenuItem.Name = "sumbitReportToolStripMenuItem";
|
||||||
|
this.sumbitReportToolStripMenuItem.Size = new System.Drawing.Size(159, 22);
|
||||||
|
this.sumbitReportToolStripMenuItem.Text = "Submit Report...";
|
||||||
|
this.sumbitReportToolStripMenuItem.Click += new System.EventHandler(this.sumbitReportToolStripMenuItem_Click);
|
||||||
|
//
|
||||||
|
// toolStripMenuItem2
|
||||||
|
//
|
||||||
|
this.toolStripMenuItem2.Name = "toolStripMenuItem2";
|
||||||
|
this.toolStripMenuItem2.Size = new System.Drawing.Size(156, 6);
|
||||||
|
//
|
||||||
// exitToolStripMenuItem
|
// exitToolStripMenuItem
|
||||||
//
|
//
|
||||||
this.exitToolStripMenuItem.Name = "exitToolStripMenuItem";
|
this.exitToolStripMenuItem.Name = "exitToolStripMenuItem";
|
||||||
@ -253,6 +267,8 @@ namespace OpenHardwareMonitor.GUI {
|
|||||||
// viewToolStripMenuItem
|
// viewToolStripMenuItem
|
||||||
//
|
//
|
||||||
this.viewToolStripMenuItem.DropDownItems.AddRange(new System.Windows.Forms.ToolStripItem[] {
|
this.viewToolStripMenuItem.DropDownItems.AddRange(new System.Windows.Forms.ToolStripItem[] {
|
||||||
|
this.resetMinMaxMenuItem,
|
||||||
|
this.toolStripMenuItem3,
|
||||||
this.hiddenMenuItem,
|
this.hiddenMenuItem,
|
||||||
this.plotMenuItem,
|
this.plotMenuItem,
|
||||||
this.toolStripMenuItem1,
|
this.toolStripMenuItem1,
|
||||||
@ -464,17 +480,17 @@ namespace OpenHardwareMonitor.GUI {
|
|||||||
this.timer.Interval = 1000;
|
this.timer.Interval = 1000;
|
||||||
this.timer.Tick += new System.EventHandler(this.timer_Tick);
|
this.timer.Tick += new System.EventHandler(this.timer_Tick);
|
||||||
//
|
//
|
||||||
// toolStripMenuItem2
|
// toolStripMenuItem3
|
||||||
//
|
//
|
||||||
this.toolStripMenuItem2.Name = "toolStripMenuItem2";
|
this.toolStripMenuItem3.Name = "toolStripMenuItem3";
|
||||||
this.toolStripMenuItem2.Size = new System.Drawing.Size(156, 6);
|
this.toolStripMenuItem3.Size = new System.Drawing.Size(185, 6);
|
||||||
//
|
//
|
||||||
// sumbitReportToolStripMenuItem
|
// resetMinMaxMenuItem
|
||||||
//
|
//
|
||||||
this.sumbitReportToolStripMenuItem.Name = "sumbitReportToolStripMenuItem";
|
this.resetMinMaxMenuItem.Name = "resetMinMaxMenuItem";
|
||||||
this.sumbitReportToolStripMenuItem.Size = new System.Drawing.Size(159, 22);
|
this.resetMinMaxMenuItem.Size = new System.Drawing.Size(188, 22);
|
||||||
this.sumbitReportToolStripMenuItem.Text = "Submit Report...";
|
this.resetMinMaxMenuItem.Text = "Reset Min/Max";
|
||||||
this.sumbitReportToolStripMenuItem.Click += new System.EventHandler(this.sumbitReportToolStripMenuItem_Click);
|
this.resetMinMaxMenuItem.Click += new System.EventHandler(this.resetMinMaxMenuItem_Click);
|
||||||
//
|
//
|
||||||
// MainForm
|
// MainForm
|
||||||
//
|
//
|
||||||
@ -543,6 +559,8 @@ namespace OpenHardwareMonitor.GUI {
|
|||||||
private System.Windows.Forms.ToolStripMenuItem fahrenheitToolStripMenuItem;
|
private System.Windows.Forms.ToolStripMenuItem fahrenheitToolStripMenuItem;
|
||||||
private System.Windows.Forms.ToolStripMenuItem sumbitReportToolStripMenuItem;
|
private System.Windows.Forms.ToolStripMenuItem sumbitReportToolStripMenuItem;
|
||||||
private System.Windows.Forms.ToolStripSeparator toolStripMenuItem2;
|
private System.Windows.Forms.ToolStripSeparator toolStripMenuItem2;
|
||||||
|
private System.Windows.Forms.ToolStripMenuItem resetMinMaxMenuItem;
|
||||||
|
private System.Windows.Forms.ToolStripSeparator toolStripMenuItem3;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -462,5 +462,10 @@ namespace OpenHardwareMonitor.GUI {
|
|||||||
form.Report = computer.GetReport();
|
form.Report = computer.GetReport();
|
||||||
form.ShowDialog();
|
form.ShowDialog();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private void resetMinMaxMenuItem_Click(object sender, EventArgs e) {
|
||||||
|
IVisitor visitor = new ResetMinMaxVisitor();
|
||||||
|
computer.Accept(visitor);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
59
GUI/ResetMinMaxVisitor.cs
Normal file
59
GUI/ResetMinMaxVisitor.cs
Normal file
@ -0,0 +1,59 @@
|
|||||||
|
/*
|
||||||
|
|
||||||
|
Version: MPL 1.1/GPL 2.0/LGPL 2.1
|
||||||
|
|
||||||
|
The contents of this file are subject to the Mozilla Public License Version
|
||||||
|
1.1 (the "License"); you may not use this file except in compliance with
|
||||||
|
the License. You may obtain a copy of the License at
|
||||||
|
|
||||||
|
http://www.mozilla.org/MPL/
|
||||||
|
|
||||||
|
Software distributed under the License is distributed on an "AS IS" basis,
|
||||||
|
WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
|
||||||
|
for the specific language governing rights and limitations under the License.
|
||||||
|
|
||||||
|
The Original Code is the Open Hardware Monitor code.
|
||||||
|
|
||||||
|
The Initial Developer of the Original Code is
|
||||||
|
Michael Möller <m.moeller@gmx.ch>.
|
||||||
|
Portions created by the Initial Developer are Copyright (C) 2009-2010
|
||||||
|
the Initial Developer. All Rights Reserved.
|
||||||
|
|
||||||
|
Contributor(s):
|
||||||
|
|
||||||
|
Alternatively, the contents of this file may be used under the terms of
|
||||||
|
either the GNU General Public License Version 2 or later (the "GPL"), or
|
||||||
|
the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
|
||||||
|
in which case the provisions of the GPL or the LGPL are applicable instead
|
||||||
|
of those above. If you wish to allow use of your version of this file only
|
||||||
|
under the terms of either the GPL or the LGPL, and not to allow others to
|
||||||
|
use your version of this file under the terms of the MPL, indicate your
|
||||||
|
decision by deleting the provisions above and replace them with the notice
|
||||||
|
and other provisions required by the GPL or the LGPL. If you do not delete
|
||||||
|
the provisions above, a recipient may use your version of this file under
|
||||||
|
the terms of any one of the MPL, the GPL or the LGPL.
|
||||||
|
|
||||||
|
*/
|
||||||
|
|
||||||
|
using System;
|
||||||
|
using System.Collections.Generic;
|
||||||
|
using OpenHardwareMonitor.Hardware;
|
||||||
|
|
||||||
|
namespace OpenHardwareMonitor.GUI {
|
||||||
|
public class ResetMinMaxVisitor : IVisitor {
|
||||||
|
public void VisitComputer(IComputer computer) {
|
||||||
|
computer.Traverse(this);
|
||||||
|
}
|
||||||
|
|
||||||
|
public void VisitHardware(IHardware hardware) {
|
||||||
|
hardware.Traverse(this);
|
||||||
|
}
|
||||||
|
|
||||||
|
public void VisitSensor(ISensor sensor) {
|
||||||
|
sensor.ResetMin();
|
||||||
|
sensor.ResetMax();
|
||||||
|
}
|
||||||
|
|
||||||
|
public void VisitParameter(IParameter parameter) { }
|
||||||
|
}
|
||||||
|
}
|
@ -72,7 +72,10 @@ namespace OpenHardwareMonitor.Hardware {
|
|||||||
|
|
||||||
float? Value { get; }
|
float? Value { get; }
|
||||||
float? Min { get; }
|
float? Min { get; }
|
||||||
float? Max { get; }
|
float? Max { get; }
|
||||||
|
|
||||||
|
void ResetMin();
|
||||||
|
void ResetMax();
|
||||||
|
|
||||||
IEnumerable<ISensorEntry> Plot { get; }
|
IEnumerable<ISensorEntry> Plot { get; }
|
||||||
}
|
}
|
||||||
|
@ -163,6 +163,14 @@ namespace OpenHardwareMonitor.Hardware {
|
|||||||
public float? Min { get { return min; } }
|
public float? Min { get { return min; } }
|
||||||
public float? Max { get { return max; } }
|
public float? Max { get { return max; } }
|
||||||
|
|
||||||
|
public void ResetMin() {
|
||||||
|
min = null;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void ResetMax() {
|
||||||
|
max = null;
|
||||||
|
}
|
||||||
|
|
||||||
public IEnumerable<ISensorEntry> Plot {
|
public IEnumerable<ISensorEntry> Plot {
|
||||||
get { return entries; }
|
get { return entries; }
|
||||||
}
|
}
|
||||||
|
@ -80,6 +80,7 @@
|
|||||||
<Compile Include="GUI\ParameterForm.Designer.cs">
|
<Compile Include="GUI\ParameterForm.Designer.cs">
|
||||||
<DependentUpon>ParameterForm.cs</DependentUpon>
|
<DependentUpon>ParameterForm.cs</DependentUpon>
|
||||||
</Compile>
|
</Compile>
|
||||||
|
<Compile Include="GUI\ResetMinMaxVisitor.cs" />
|
||||||
<Compile Include="GUI\SensorNotifyIcon.cs" />
|
<Compile Include="GUI\SensorNotifyIcon.cs" />
|
||||||
<Compile Include="GUI\SystemTray.cs" />
|
<Compile Include="GUI\SystemTray.cs" />
|
||||||
<Compile Include="GUI\StartupManager.cs" />
|
<Compile Include="GUI\StartupManager.cs" />
|
||||||
|
@ -69,5 +69,5 @@ using System.Runtime.InteropServices;
|
|||||||
// You can specify all the values or you can default the Build and Revision Numbers
|
// You can specify all the values or you can default the Build and Revision Numbers
|
||||||
// by using the '*' as shown below:
|
// by using the '*' as shown below:
|
||||||
// [assembly: AssemblyVersion("1.0.*")]
|
// [assembly: AssemblyVersion("1.0.*")]
|
||||||
[assembly: AssemblyVersion("0.1.36.0")]
|
[assembly: AssemblyVersion("0.1.37.0")]
|
||||||
[assembly: AssemblyFileVersion("0.1.36.0")]
|
[assembly: AssemblyFileVersion("0.1.37.0")]
|
||||||
|
Loading…
x
Reference in New Issue
Block a user