static float GetChargeRateInput() { string message = string.Empty; message = CultureInformation.GetCultureInformation().GetString("ChargeRateValue"); Display.PrintMessage(message); return(float.Parse(Console.ReadLine())); }
static float GetTemperatureUnit() { string message = string.Empty; int temperatureUnit; message = CultureInformation.GetCultureInformation().GetString("TemperatureUnit"); Display.PrintMessage(message); temperatureUnit = Convert.ToInt32(Console.ReadLine()); return(GetTemperatureValue(temperatureUnit)); }
private void CheckChargeRateBreach(float chargeRate) { foreach (var chargeRateValue in BatteryLimits.chargeRateBoundary) { if (chargeRateValue.Key.InRange(chargeRate)) { if (chargeRateValue.Value.Item2 == BatteryFactors.BatteryStatus.Breach) { this.BatteryParameter = CultureInformation.GetCultureInformation().GetString("BreachMessage") + "-" + CultureInformation.GetCultureInformation().GetString("CR"); this.BatteryMessage = chargeRateValue.Value.Item1; Notify(); } } } }
private void CheckStateOfChargeBreach(float soc) { foreach (var socValue in BatteryLimits.stateOfChargeBoundary) { if (socValue.Key.InRange(soc)) { if (socValue.Value.Item2 == BatteryFactors.BatteryStatus.Breach) { this.BatteryParameter = CultureInformation.GetCultureInformation().GetString("BreachMessage") + "-" + CultureInformation.GetCultureInformation().GetString("SOC"); this.BatteryMessage = socValue.Value.Item1; Notify(); } } } }
private void CheckTemperatureBreach(float batteryTemperature) { foreach (var temperatureValue in BatteryLimits.temperatureBoundary) { if (temperatureValue.Key.InRange(batteryTemperature)) { if (temperatureValue.Value.Item2 == BatteryFactors.BatteryStatus.Breach) { this.BatteryParameter = CultureInformation.GetCultureInformation().GetString("BreachMessage") + "-" + CultureInformation.GetCultureInformation().GetString("Temp"); this.BatteryMessage = temperatureValue.Value.Item1; Notify(); } } } }
static float GetTemperatureValue(int tempUnit) { string message = string.Empty; message = CultureInformation.GetCultureInformation().GetString("TemperatureValue"); Display.PrintMessage(message); if (tempUnit == 1) { return(float.Parse(Console.ReadLine())); } else { return(BatteryFeatureConversion.ConvertTemperatureFahrenheitToCelsius(float.Parse(Console.ReadLine()))); } }