Skip to content

Commit

Permalink
FanControl: Change Silent setting name and a way to Clamp
Browse files Browse the repository at this point in the history
  • Loading branch information
ayufan committed Sep 24, 2023
1 parent 75b3bbc commit ad9cf9a
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 5 deletions.
4 changes: 2 additions & 2 deletions FanControl/FanControllerSensors.cs
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@ internal partial class FanController
MinInput = 40,
MaxInput = 95,
A = 1.28f,
B = Settings.Default.Silent4000RPMThreshold - 28,
B = Settings.Default.Silent4000RPMTemp - 28,
C = 3000f
}
},
Expand Down Expand Up @@ -110,7 +110,7 @@ internal partial class FanController
MinInput = 40,
MaxInput = 95,
A = 1.28f,
B = Settings.Default.Silent4000RPMThreshold - 28,
B = Settings.Default.Silent4000RPMTemp - 28,
C = 3000f
}
},
Expand Down
11 changes: 8 additions & 3 deletions FanControl/Settings.cs
Original file line number Diff line number Diff line change
Expand Up @@ -23,15 +23,20 @@ public bool AlwaysOnTop
set { Set("AlwaysOnTop", value); }
}

public int Silent4000RPMThreshold
public int Silent4000RPMTemp
{
get { return Get("Silent4000RPMThreshold", 85); }
set { Set("Silent4000RPMThreshold", Math.Min(Math.Max(80, value), 90)); }
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);
}
}
}

0 comments on commit ad9cf9a

Please sign in to comment.