Add the new force calibration charge in the controller
This commit is contained in:
parent
732274933b
commit
825a6c87bd
|
@ -1,3 +1,4 @@
|
||||||
|
using InnovEnergy.App.SaliMax.SystemConfig;
|
||||||
using InnovEnergy.Lib.Devices.Battery48TL;
|
using InnovEnergy.Lib.Devices.Battery48TL;
|
||||||
using InnovEnergy.Lib.Devices.Battery48TL.DataTypes;
|
using InnovEnergy.Lib.Devices.Battery48TL.DataTypes;
|
||||||
using InnovEnergy.Lib.Devices.Trumpf.TruConvertAc.DataTypes;
|
using InnovEnergy.Lib.Devices.Trumpf.TruConvertAc.DataTypes;
|
||||||
|
@ -187,18 +188,24 @@ public static class Controller
|
||||||
}
|
}
|
||||||
|
|
||||||
private static Boolean MustDoCalibrationCharge(this StatusRecord statusRecord)
|
private static Boolean MustDoCalibrationCharge(this StatusRecord statusRecord)
|
||||||
{
|
{
|
||||||
var calibrationChargeForced = statusRecord.Config.ForceCalibrationCharge;
|
var calibrationChargeForced = statusRecord.Config.ForceCalibrationCharge;
|
||||||
|
|
||||||
var batteryCalibrationChargeRequested = statusRecord.Battery?.CalibrationChargeRequested?? false ;
|
var batteryCalibrationChargeRequested = statusRecord.Battery?.CalibrationChargeRequested?? false ;
|
||||||
|
|
||||||
var mustDoCalibrationCharge = batteryCalibrationChargeRequested || calibrationChargeForced;
|
var mustDoCalibrationCharge = batteryCalibrationChargeRequested || calibrationChargeForced == CalibrationChargeType.Yes || calibrationChargeForced == CalibrationChargeType.UntilEoc ;
|
||||||
|
|
||||||
|
if (statusRecord.Battery is not null)
|
||||||
|
{
|
||||||
|
if (calibrationChargeForced == CalibrationChargeType.UntilEoc && statusRecord.Battery.Eoc )
|
||||||
|
{
|
||||||
|
statusRecord.Config.ForceCalibrationCharge = CalibrationChargeType.No;
|
||||||
|
}
|
||||||
|
}
|
||||||
return mustDoCalibrationCharge;
|
return mustDoCalibrationCharge;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
public static Double ControlGridPower(this StatusRecord status, Double targetPower)
|
private static Double ControlGridPower(this StatusRecord status, Double targetPower)
|
||||||
{
|
{
|
||||||
return ControlPower
|
return ControlPower
|
||||||
(
|
(
|
||||||
|
|
Loading…
Reference in New Issue