feat: ramp-up/down delay fan control

- Add RampUpSteps and RampUpMinDeltaPercent config
- Gradual ramp in both directions (up and down) to reduce fan oscillation
- Fix Advanced tab layout with RowStyles and label alignment

Made-with: Cursor
This commit is contained in:
2026-03-22 12:53:15 +08:00
parent 1de688b792
commit e8c8a759e0
7 changed files with 91 additions and 7 deletions

View File

@@ -16,6 +16,8 @@ public sealed class AppConfig
public string[]? FanDutyArgs { get; set; }
public string[] AutoFanCtrlArgs { get; set; } = ["autofanctrl"];
public string TempSource { get; set; } = "AverageCore";
public int RampUpSteps { get; set; } = 3;
public int RampUpMinDeltaPercent { get; set; } = 20;
public int FailSafeAfterConsecutiveErrors { get; set; } = 5;
public int FailSafeFanPercent { get; set; } = 100;
public bool FailSafeRestoreAutoFan { get; set; }
@@ -81,6 +83,8 @@ public sealed class AppConfig
if (src.AutoFanCtrlArgs is { Length: > 0 })
dst.AutoFanCtrlArgs = src.AutoFanCtrlArgs;
dst.TempSource = string.Equals(src.TempSource, "MaxCore", StringComparison.OrdinalIgnoreCase) ? "MaxCore" : "AverageCore";
dst.RampUpSteps = Math.Clamp(src.RampUpSteps, 1, 10);
dst.RampUpMinDeltaPercent = Math.Clamp(src.RampUpMinDeltaPercent, 0, 50);
dst.FailSafeAfterConsecutiveErrors = Math.Max(1, src.FailSafeAfterConsecutiveErrors);
dst.FailSafeFanPercent = Math.Clamp(src.FailSafeFanPercent, 0, 100);
dst.FailSafeRestoreAutoFan = src.FailSafeRestoreAutoFan;