Bugfixes (#155)
* Fix: https://github.com/LibreHardwareMonitor/LibreHardwareMonitor/issues/153 Add temperature Sensor Ranges Fix: https://github.com/LibreHardwareMonitor/LibreHardwareMonitor/issues/152 New exit function Fix: https://github.com/LibreHardwareMonitor/LibreHardwareMonitor/pull/138 No drive info exception when LHM is in a Virtual Machine * Bugfix Update
This commit is contained in:
-1
@@ -770,7 +770,6 @@ namespace LibreHardwareMonitor.UI
|
||||
this.Name = "MainForm";
|
||||
this.StartPosition = System.Windows.Forms.FormStartPosition.Manual;
|
||||
this.Text = "Libre Hardware Monitor";
|
||||
this.FormClosed += new System.Windows.Forms.FormClosedEventHandler(this.MainForm_FormClosed);
|
||||
this.Load += new System.EventHandler(this.MainForm_Load);
|
||||
this.ResizeEnd += new System.EventHandler(this.MainForm_MoveOrResize);
|
||||
this.Move += new System.EventHandler(this.MainForm_MoveOrResize);
|
||||
|
||||
@@ -457,7 +457,7 @@ namespace LibreHardwareMonitor.UI
|
||||
_settings.SetValue("plotForm.Height", _plotForm.Bounds.Height);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
_plotForm.Move += MoveOrResizePlotForm;
|
||||
_plotForm.Resize += MoveOrResizePlotForm;
|
||||
|
||||
@@ -614,7 +614,7 @@ namespace LibreHardwareMonitor.UI
|
||||
|
||||
private void ExitClick(object sender, EventArgs e)
|
||||
{
|
||||
Close();
|
||||
CloseApplication();
|
||||
}
|
||||
|
||||
private void Timer_Tick(object sender, EventArgs e)
|
||||
@@ -672,8 +672,7 @@ namespace LibreHardwareMonitor.UI
|
||||
Height = _settings.GetValue("mainForm.Height", 640)
|
||||
};
|
||||
|
||||
Rectangle fullWorkingArea = new Rectangle(int.MaxValue, int.MaxValue,
|
||||
int.MinValue, int.MinValue);
|
||||
Rectangle fullWorkingArea = new Rectangle(int.MaxValue, int.MaxValue, int.MinValue, int.MinValue);
|
||||
|
||||
foreach (Screen screen in Screen.AllScreens)
|
||||
fullWorkingArea = Rectangle.Union(fullWorkingArea, screen.Bounds);
|
||||
@@ -685,10 +684,13 @@ namespace LibreHardwareMonitor.UI
|
||||
newBounds.Y = (Screen.PrimaryScreen.WorkingArea.Height / 2) - (newBounds.Height / 2);
|
||||
}
|
||||
Bounds = newBounds;
|
||||
FormClosed += MainForm_FormClosed;
|
||||
}
|
||||
|
||||
private void MainForm_FormClosed(object sender, FormClosedEventArgs e)
|
||||
private void CloseApplication()
|
||||
{
|
||||
FormClosed -= MainForm_FormClosed;
|
||||
|
||||
Visible = false;
|
||||
_systemTray.IsMainIconEnabled = false;
|
||||
timer.Enabled = false;
|
||||
@@ -697,6 +699,13 @@ namespace LibreHardwareMonitor.UI
|
||||
if (_runWebServer.Value)
|
||||
Server.Quit();
|
||||
_systemTray.Dispose();
|
||||
|
||||
Application.Exit();
|
||||
}
|
||||
|
||||
private void MainForm_FormClosed(object sender, FormClosedEventArgs e)
|
||||
{
|
||||
CloseApplication();
|
||||
}
|
||||
|
||||
private void AboutMenuItem_Click(object sender, EventArgs e)
|
||||
|
||||
@@ -68,6 +68,9 @@ namespace LibreHardwareMonitor.Hardware.Storage
|
||||
public static AbstractStorage CreateInstance(string deviceId, uint driveNumber, ulong diskSize, int scsiPort, ISettings settings)
|
||||
{
|
||||
StorageInfo info = WindowsStorage.GetStorageInfo(deviceId, driveNumber);
|
||||
if (info == null)
|
||||
return null;
|
||||
|
||||
info.DiskSize = diskSize;
|
||||
info.DeviceId = deviceId;
|
||||
info.Scsi = $@"\\.\SCSI{scsiPort}:";
|
||||
|
||||
@@ -72,8 +72,8 @@ namespace LibreHardwareMonitor.Hardware.Storage
|
||||
private void AddSensor(string name, int index, bool defaultHidden, SensorType sensorType, GetSensorValue getValue)
|
||||
{
|
||||
var sensor = new NVMeSensor(name, index, defaultHidden, sensorType, this, _settings, getValue);
|
||||
ActivateSensor(sensor);
|
||||
sensor.Value = 0;
|
||||
ActivateSensor(sensor);
|
||||
_sensors.Add(sensor);
|
||||
}
|
||||
|
||||
@@ -175,7 +175,13 @@ namespace LibreHardwareMonitor.Hardware.Storage
|
||||
|
||||
public void Update(NVMeHealthInfo health)
|
||||
{
|
||||
Value = _getValue(health);
|
||||
float v = _getValue(health);
|
||||
if (SensorType == SensorType.Temperature)
|
||||
{
|
||||
if (v < -1000 || v > 1000)
|
||||
return;
|
||||
}
|
||||
Value = v;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user