예제 #1
0
        public TestBatteryDraining() : base(null)
        {
            IsNotAvailable = false;

            CurrentCharge         = 100;
            TotalSecondsRemaining = (CurrentCharge / currentChargeStep) * interval;
            SetChargeMinimumMaximum();
            CalculateRemainingTime();

            testBatteryDraining = this;
        }
예제 #2
0
        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);
        }