コード例 #1
0
 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;
 }
コード例 #2
0
ファイル: MainWindow.xaml.cs プロジェクト: cabal95/aeroctl
        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();
        }
コード例 #3
0
        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);
                }
            }
        }