Merge remote-tracking branch 'origin/main'
This commit is contained in:
commit
da7f75c55c
|
@ -1,3 +1,4 @@
|
|||
using InnovEnergy.App.SaliMax.SystemConfig;
|
||||
using InnovEnergy.Lib.Devices.Battery48TL;
|
||||
using InnovEnergy.Lib.Devices.Battery48TL.DataTypes;
|
||||
using InnovEnergy.Lib.Devices.Trumpf.TruConvertAc.DataTypes;
|
||||
|
@ -189,16 +190,22 @@ public static class Controller
|
|||
private static Boolean MustDoCalibrationCharge(this StatusRecord statusRecord)
|
||||
{
|
||||
var calibrationChargeForced = statusRecord.Config.ForceCalibrationCharge;
|
||||
|
||||
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;
|
||||
}
|
||||
|
||||
|
||||
public static Double ControlGridPower(this StatusRecord status, Double targetPower)
|
||||
private static Double ControlGridPower(this StatusRecord status, Double targetPower)
|
||||
{
|
||||
return ControlPower
|
||||
(
|
||||
|
|
|
@ -25,7 +25,7 @@ public record StatusRecord
|
|||
public required DcPowerDevice? LoadOnDc { get; init; }
|
||||
public required RelaysRecord? Relays { get; init; }
|
||||
public required AmptStatus? PvOnDc { get; init; }
|
||||
public required Config Config { get; init; }
|
||||
public required Config Config { get; set; }
|
||||
public required SystemLog Log { get; set; } // TODO: init only
|
||||
|
||||
public required EssControl EssControl { get; set; } // TODO: init only
|
||||
|
|
|
@ -0,0 +1,8 @@
|
|||
namespace InnovEnergy.App.SaliMax.SystemConfig;
|
||||
|
||||
public enum CalibrationChargeType
|
||||
{
|
||||
No,
|
||||
UntilEoc,
|
||||
Yes
|
||||
}
|
|
@ -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 Boolean ForceCalibrationCharge { get; set; }
|
||||
public required CalibrationChargeType ForceCalibrationCharge { get; set; }
|
||||
public required Boolean DisplayIndividualBatteries { get; set; }
|
||||
public required Double PConstant { get; set; }
|
||||
public required Double GridSetPoint { 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,
|
||||
ForceCalibrationCharge = false,
|
||||
ForceCalibrationCharge = CalibrationChargeType.No,
|
||||
DisplayIndividualBatteries = false,
|
||||
PConstant = .5,
|
||||
GridSetPoint = 0,
|
||||
|
@ -117,7 +117,7 @@ public class Config //TODO: let IE choose from config files (Json) and connect t
|
|||
public static Config Default => new()
|
||||
{
|
||||
MinSoc = 20,
|
||||
ForceCalibrationCharge = false,
|
||||
ForceCalibrationCharge = CalibrationChargeType.No,
|
||||
DisplayIndividualBatteries = false,
|
||||
PConstant = .5,
|
||||
GridSetPoint = 0,
|
||||
|
|
Loading…
Reference in New Issue