public FanController(FanCurve quietProfile, FanCurve sustainedProfile, int?overheatThreshold, byte maxTemperature, TimeSpan maxOverheatAllowance) { _quietProfile = quietProfile; _sustainedProfile = sustainedProfile; _overheatThreshold = (byte)(overheatThreshold ?? quietProfile.Thresholds.Max(t => t.temp)); _maxTemperature = Math.Max(maxTemperature, _overheatThreshold); _maxOverheatAllowance = maxOverheatAllowance; _temperature = new TemperatureRecord(TimeSpan.FromSeconds(Math.Max(15, maxOverheatAllowance.TotalSeconds))); _currentMode = Mode.SustainedLoad; }
private void onEditHwCurveClicked(object sender, RoutedEventArgs e) { FanCurve curve = this.Controller.Aero.Fans.GetFanCurve(); FanPoint[] clone = curve.ToArray(); FanCurveEditor editor = new FanCurveEditor(clone, FanCurveKind.Step); editor.CurveApplied += (s, e2) => { for (int i = 0; i < curve.Count; ++i) { curve[i] = clone[i]; } }; editor.ShowDialog(); }
public void AutoLow() { if (!_autoLowRunning) { _autoLowRunning = true; while (true) { if (!_autoLowRunning) { break; } try { decimal maxTemp = _temperatureService.GetMaxTemperature(); if (maxTemp > _cutoff) { _fanService.SwitchToAutomatic(); } else { System.Diagnostics.Debug.WriteLine($"maxTemp: {maxTemp} | FanCurve: {FanCurve.GetFanSpeed(maxTemp)}"); _fanService.SwitchToManual(FanCurve.GetFanSpeed(maxTemp)); } } catch (Exception) { _fanService.SwitchToAutomatic(); } Thread.Sleep(10000); } } }