Beispiel #1
0
 private static void DisplayReport(string property, BatteryCondition.BatteryLevel batteryLevel, IReport report)
 {
     if (batteryLevel == BatteryCondition.BatteryLevel.High || batteryLevel == BatteryCondition.BatteryLevel.Low)
     {
         report.Logger($"battery {property} threshold is {batteryLevel}");
     }
 }
        public void CheckChargeState(float soc)
        {
            float minStateOfCharge = 20;
            float maxStateOfCharge = 80;

            CheckBatteryLevel(soc, minStateOfCharge, maxStateOfCharge);
            BatteryCondition.BatteryLevel batteryChargeState = BatteryCondition.CheckBatteryCondition(soc, minStateOfCharge, maxStateOfCharge);
            StatusMessages.DisplayBatteryStatus("State of charge", batteryChargeState, report);
        }
        public void CheckTemperature(float temperature)
        {
            float minTemperature = 0;
            float maxTemperature = 45;

            CheckBatteryLevel(temperature, minTemperature, maxTemperature);
            BatteryCondition.BatteryLevel batteryTemperature = BatteryCondition.CheckBatteryCondition(temperature, minTemperature, maxTemperature);
            StatusMessages.DisplayBatteryStatus("Temperature", batteryTemperature, report);
        }
        public void CheckChargeRate(float chargeRate)
        {
            float minChargeRate = 0.3f;
            float maxChargeRate = 0.8f;

            CheckBatteryLevel(chargeRate, minChargeRate, maxChargeRate);
            BatteryCondition.BatteryLevel batteryChargeRate = BatteryCondition.CheckBatteryCondition(chargeRate, minChargeRate, maxChargeRate);
            StatusMessages.DisplayBatteryStatus("Charge Rate", batteryChargeRate, report);
        }
Beispiel #5
0
        public static void DisplayBatteryStatus(string property, BatteryCondition.BatteryLevel batteryLevel, IReport report)
        {
            DisplayReport(property, batteryLevel, report);

            if (GermanLanguage)
            {
                Console.WriteLine($"Batterie {property} ist {batteryLevel}");
                return;
            }
            Console.WriteLine($"Battery {property} is {batteryLevel}");
        }