diff --git a/LibreHardwareMonitor/UI/MainForm.Designer.cs b/LibreHardwareMonitor/UI/MainForm.Designer.cs index 0135057..dba5a5e 100644 --- a/LibreHardwareMonitor/UI/MainForm.Designer.cs +++ b/LibreHardwareMonitor/UI/MainForm.Designer.cs @@ -102,6 +102,7 @@ namespace LibreHardwareMonitor.UI this.splitPanelFixedSensorScalingMenuItem = new LibreHardwareMonitor.UI.ToolStripRadioButtonMenuItem(); this.logSeparatorMenuItem = new System.Windows.Forms.ToolStripSeparator(); this.logSensorsMenuItem = new System.Windows.Forms.ToolStripMenuItem(); + this.forceDriveWakeupItem = new System.Windows.Forms.ToolStripMenuItem(); this.fileRotationMethod = new System.Windows.Forms.ToolStripMenuItem(); this.perSessionFileRotationMenuItem = new LibreHardwareMonitor.UI.ToolStripRadioButtonMenuItem(); this.dailyFileRotationMenuItem = new LibreHardwareMonitor.UI.ToolStripRadioButtonMenuItem(); @@ -485,6 +486,7 @@ namespace LibreHardwareMonitor.UI this.splitPlotPanelScalingMenuItem, this.logSeparatorMenuItem, this.logSensorsMenuItem, + this.forceDriveWakeupItem, this.loggingIntervalMenuItem, this.updateIntervalMenuItem, this.fileRotationMethod, @@ -667,6 +669,12 @@ namespace LibreHardwareMonitor.UI this.logSensorsMenuItem.Size = new System.Drawing.Size(221, 22); this.logSensorsMenuItem.Text = "Log Sensors"; // + // forceDriveWakeupItem + // + this.forceDriveWakeupItem.Name = "forceDriveWakeupItem"; + this.forceDriveWakeupItem.Size = new System.Drawing.Size(221, 22); + this.forceDriveWakeupItem.Text = "Force Drive Wakeup"; + // // fileRotationMethod // this.fileRotationMethod.DropDownItems.AddRange(new System.Windows.Forms.ToolStripItem[] { @@ -1188,6 +1196,7 @@ namespace LibreHardwareMonitor.UI private System.Windows.Forms.ToolStripMenuItem fanControllerMenuItem; private System.Windows.Forms.ToolStripMenuItem ramMenuItem; private System.Windows.Forms.ToolStripMenuItem logSensorsMenuItem; + private System.Windows.Forms.ToolStripMenuItem forceDriveWakeupItem; private System.Windows.Forms.ToolStripSeparator logSeparatorMenuItem; private System.Windows.Forms.ToolStripMenuItem loggingIntervalMenuItem; private ToolStripRadioButtonMenuItem log1sMenuItem; diff --git a/LibreHardwareMonitor/UI/MainForm.cs b/LibreHardwareMonitor/UI/MainForm.cs index b98afb5..0720794 100644 --- a/LibreHardwareMonitor/UI/MainForm.cs +++ b/LibreHardwareMonitor/UI/MainForm.cs @@ -33,6 +33,7 @@ public sealed partial class MainForm : Form private readonly UserRadioGroup _updateInterval; private readonly UserOption _throttleAtaUpdate; private readonly UserOption _logSensors; + private readonly UserOption _forceDriveWakeup; private readonly UserOption _minimizeOnClose; private readonly UserOption _minimizeToTray; private readonly PlotPanel _plotPanel; @@ -286,10 +287,21 @@ public sealed partial class MainForm : Form _showGadget = new UserOption("gadgetMenuItem", false, gadgetMenuItem, _settings); + _forceDriveWakeup = new UserOption("forceDriveWakeupItem", false, forceDriveWakeupItem, _settings); + _forceDriveWakeup.Changed += delegate + { + _computer.Hardware + .OfType() + .ToList() + .ForEach(sd => + { + sd.Storage.ForceWakeup = _forceDriveWakeup.Value; + }); + }; + // Prevent Menu From Closing When UnClicking Hardware Items menuItemFileHardware.DropDown.Closing += StopFileHardwareMenuFromClosing; - _showGadget.Changed += delegate { if (_gadget != null) diff --git a/LibreHardwareMonitorLib/Hardware/Storage/StorageDevice.cs b/LibreHardwareMonitorLib/Hardware/Storage/StorageDevice.cs index dd1913c..63a99d0 100644 --- a/LibreHardwareMonitorLib/Hardware/Storage/StorageDevice.cs +++ b/LibreHardwareMonitorLib/Hardware/Storage/StorageDevice.cs @@ -12,6 +12,7 @@ using System.IO; using System.Linq; using System.Text; using BlackSharp.Core.Converters; +using BlackSharp.Core.Converters.Enums; using DiskInfoToolkit.Interop.Enums; using Windows.Win32; using Windows.Win32.Foundation; @@ -206,7 +207,7 @@ public sealed class StorageDevice : Hardware, ISmart var totalSpaceSensor = new Sensor("Total Space", 32, SensorType.Data, this, _settings) { - Value = (float)DataStorageSizeConverter.ByteToGigabyte(_storage.TotalSize) + Value = (float)DataUnitConverter.ToGigaByte(_storage.TotalSize, DataUnit.Byte) }; ActivateSensor(totalSpaceSensor); @@ -332,7 +333,7 @@ public sealed class StorageDevice : Hardware, ISmart { // Set sensor value _usageSensor.Value = 100.0f - (100.0f * _storage.TotalFreeSize / _storage.TotalSize); - _freeSpaceSensor.Value = (float)DataStorageSizeConverter.ByteToGigabyte(_storage.TotalFreeSize.GetValueOrDefault()); + _freeSpaceSensor.Value = (float)DataUnitConverter.ToGigaByte(_storage.TotalFreeSize.GetValueOrDefault(), DataUnit.Byte); } else { diff --git a/LibreHardwareMonitorLib/LibreHardwareMonitorLib.csproj b/LibreHardwareMonitorLib/LibreHardwareMonitorLib.csproj index 8643844..410d6c4 100644 --- a/LibreHardwareMonitorLib/LibreHardwareMonitorLib.csproj +++ b/LibreHardwareMonitorLib/LibreHardwareMonitorLib.csproj @@ -1,4 +1,4 @@ - + net472;netstandard2.0;net8.0;net9.0;net10.0 x64;x86;ARM64 @@ -61,7 +61,7 @@ - + all