From 8abc01e8e31e61682a7b5907749492da02dda20c Mon Sep 17 00:00:00 2001 From: Adravil Date: Tue, 5 Sep 2023 22:46:18 +0300 Subject: [PATCH] FanControl: Add `Silent4000RPMTemp` to `Silent Fan Profile` Merged #151 --- CommonHelpers/GlobalConfig.cs | 7 +------ FanControl/FanControllerSensors.cs | 12 ++++++------ FanControl/Settings.cs | 11 +++++++++++ 3 files changed, 18 insertions(+), 12 deletions(-) diff --git a/CommonHelpers/GlobalConfig.cs b/CommonHelpers/GlobalConfig.cs index 83161ed..9500745 100644 --- a/CommonHelpers/GlobalConfig.cs +++ b/CommonHelpers/GlobalConfig.cs @@ -1,9 +1,4 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using System.Runtime.InteropServices; -using System.Text; -using System.Threading.Tasks; +using System.Runtime.InteropServices; namespace CommonHelpers { diff --git a/FanControl/FanControllerSensors.cs b/FanControl/FanControllerSensors.cs index d5df406..30af3d4 100644 --- a/FanControl/FanControllerSensors.cs +++ b/FanControl/FanControllerSensors.cs @@ -71,10 +71,10 @@ namespace FanControl FanMode.Silent, new FanSensor.Profile() { Type = FanSensor.Profile.ProfileType.Exponential, - MinInput = 55, - MaxInput = 93, + MinInput = 40, + MaxInput = 95, A = 1.28f, - B = 60f, + B = Settings.Default.Silent4000RPMTemp - 28, C = 3000f } }, @@ -107,10 +107,10 @@ namespace FanControl FanMode.Silent, new FanSensor.Profile() { Type = FanSensor.Profile.ProfileType.Exponential, - MinInput = 55, - MaxInput = 93, + MinInput = 40, + MaxInput = 95, A = 1.28f, - B = 60f, + B = Settings.Default.Silent4000RPMTemp - 28, C = 3000f } }, diff --git a/FanControl/Settings.cs b/FanControl/Settings.cs index 0dc4af8..82d769d 100644 --- a/FanControl/Settings.cs +++ b/FanControl/Settings.cs @@ -23,9 +23,20 @@ namespace FanControl set { Set("AlwaysOnTop", value); } } + public int Silent4000RPMTemp + { + get { return ClampSilent4000RPMTemp(Get("Silent4000RPMTemp", 85)); } + set { Set("Silent4000RPMTemp", ClampSilent4000RPMTemp(value)); } + } + public bool EnableExperimentalFeatures { get { return Instance.IsDEBUG; } } + + private int ClampSilent4000RPMTemp(int value) + { + return Math.Clamp(value, 70, 90); + } } }