Exemple #1
0
 private EnergyInterval CorrectEnergyError(EnergyInterval energy)
 {
     if (energy.watts > _tdp * 10 || energy.joules > Settings.Default.TimerInterval * _tdp * 10)
     {
         energy.joules = _tdp * Settings.Default.TimerInterval;
         energy.watts  = _tdp;
     }
     return(energy);
 }
Exemple #2
0
        private void WriteData(EnergyInterval energy)
        {
            var line = $"{DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss")}, " +
                       $"{(_locked ? "Locked" : "Unlocked")}, " +
                       $"{(_sleeping ? "Sleeping" : "Awake")}, " +
                       $"{Math.Round(_joulesTotal / 3600.0, 4)}, " +
                       $"{GetTotalWattUsage(energy, _numMonitors)}, " +
                       $"{_numMonitors}\n";

            Logging.Log(line);
        }
Exemple #3
0
 private double GetTotalWattUsage(EnergyInterval energy, int numMonitors)
 {
     return(energy.watts + GetMonitorWattUsage(numMonitors));
 }