Added the feature of the forceCalibrationCharge in the config file.

This commit is contained in:
atef 2023-09-13 10:57:12 +02:00
parent c51250a380
commit 3b77c4a5b2
2 changed files with 10 additions and 4 deletions

View File

@ -188,7 +188,13 @@ public static class Controller
private static Boolean MustDoCalibrationCharge(this StatusRecord statusRecord)
{
return statusRecord.Battery?.CalibrationChargeRequested ?? false;
var calibrationChargeForced = statusRecord.Config.ForceCalibrationCharge;
var batteryCalibrationChargeRequested = statusRecord.Battery?.CalibrationChargeRequested?? false ;
var mustDoCalibrationCharge = batteryCalibrationChargeRequested || calibrationChargeForced;
return mustDoCalibrationCharge;
}

View File

@ -15,7 +15,7 @@ public class Config //TODO: let IE choose from config files (Json) and connect t
private static readonly JsonSerializerOptions JsonOptions = new() { WriteIndented = true };
public required Double MinSoc { get; set; }
public required UnixTime LastEoc { get; set; }
public required Boolean ForceCalibrationCharge { get; set; }
public required Double PConstant { get; set; }
public required Double GridSetPoint { get; set; }
public required Double BatterySelfDischargePower { get; set; }
@ -40,7 +40,7 @@ public class Config //TODO: let IE choose from config files (Json) and connect t
public static Config Default => new()
{
MinSoc = 20,
LastEoc = UnixTime.Epoch, // TODO: remove, use new LastEoc feature from BMS
ForceCalibrationCharge = false,
PConstant = .5,
GridSetPoint = 0,
BatterySelfDischargePower = 200,
@ -102,7 +102,7 @@ public class Config //TODO: let IE choose from config files (Json) and connect t
public static Config Default => new()
{
MinSoc = 20,
LastEoc = UnixTime.Epoch, // TODO: remove, use new LastEoc feature from BMS
ForceCalibrationCharge = false,
PConstant = .5,
GridSetPoint = 0,
BatterySelfDischargePower = 200,