reformatting must do calibration charge
This commit is contained in:
parent
3311a30a92
commit
7b5b529080
|
@ -188,13 +188,13 @@ public static class Controller
|
|||
private static Boolean MustDoCalibrationCharge(this StatusRecord statusRecord)
|
||||
{
|
||||
var calibrationChargeForced = statusRecord.Config.ForceCalibrationChargeState;
|
||||
var batteryCalibrationChargeRequested = statusRecord.Battery is { CalibrationChargeRequested: true };//BatteryCalibrationChargeRequested(statusRecord.Battery?.CalibrationChargeRequested?? false) ;
|
||||
var additionalCalibrationRequired = CalibrationDateHasBeenPassed(statusRecord.Config.DayAndTimeForAdditionalCalibration);
|
||||
var repetitiveCalibrationRequired = CalibrationDateHasBeenPassed(statusRecord.Config.DayAndTimeForRepetitiveCalibration);
|
||||
//var batteryCalibrationChargeRequested = statusRecord.Battery is { CalibrationChargeRequested: true };
|
||||
|
||||
var mustDoCalibrationCharge = calibrationChargeForced == CalibrationChargeType.ChargePermanently ||
|
||||
(calibrationChargeForced == CalibrationChargeType.AdditionallyOnce
|
||||
&& CalibrationDateHasBeenPassed(statusRecord.Config.DayAndTimeForAdditionalCalibration)) ||
|
||||
(calibrationChargeForced == CalibrationChargeType.RepetitivelyEvery &&
|
||||
CalibrationDateHasBeenPassed(statusRecord.Config.DayAndTimeForRepetitiveCalibration));
|
||||
(calibrationChargeForced == CalibrationChargeType.AdditionallyOnce && additionalCalibrationRequired) ||
|
||||
(calibrationChargeForced == CalibrationChargeType.RepetitivelyEvery && repetitiveCalibrationRequired);
|
||||
|
||||
if (statusRecord.Battery is not null)
|
||||
{
|
||||
|
@ -215,7 +215,6 @@ public static class Controller
|
|||
|
||||
private static Boolean CalibrationDateHasBeenPassed(DateTime calibrationChargeDate)
|
||||
{
|
||||
|
||||
if (!_hasCalibrationChargeChecked)
|
||||
{
|
||||
if (DateTime.Now >= calibrationChargeDate )
|
||||
|
@ -224,7 +223,6 @@ public static class Controller
|
|||
return true;
|
||||
}
|
||||
return false;
|
||||
|
||||
}
|
||||
return true;
|
||||
|
||||
|
|
Loading…
Reference in New Issue