public TestBatteryDraining() : base(null) { IsNotAvailable = false; CurrentCharge = 100; TotalSecondsRemaining = (CurrentCharge / currentChargeStep) * interval; SetChargeMinimumMaximum(); CalculateRemainingTime(); testBatteryDraining = this; }
public override BatteryData GetNextTestData() { if (++count % interval == 0) { var newCurrentCharge = testBatteryDraining.CurrentCharge + currentChargeStep; var newTotalSecondsRemaining = newCurrentCharge / currentChargeStep * interval; testBatteryDraining = new TestBatteryDraining { CurrentCharge = newCurrentCharge, TotalSecondsRemaining = newTotalSecondsRemaining }; testBatteryDraining.SetChargeMinimumMaximum(); testBatteryDraining.CalculateRemainingTime(); if (newCurrentCharge < 10) { testBatteryDraining.IsCriticalCharge = true; } } return(testBatteryDraining); }