add CurrentMinSoc

This commit is contained in:
atef 2023-07-24 10:48:23 +02:00
parent 9768a542b3
commit f8cdcb420d
1 changed files with 5 additions and 3 deletions

View File

@ -13,9 +13,10 @@ public class Battery48TlRecords
Eoc = !empty && records.All(r => r.Eoc); Eoc = !empty && records.All(r => r.Eoc);
Warnings = records.SelectMany(r => r.Warnings).Distinct().ToList(); Warnings = records.SelectMany(r => r.Warnings).Distinct().ToList();
Alarms = records.SelectMany(r => r.Alarms).Distinct().ToList(); Alarms = records.SelectMany(r => r.Alarms).Distinct().ToList();
Soc = empty ? 0 : records.Min(r => r.Soc.Value); Soc = empty ? 0 : records.Average(r => r.Soc.Value);
Temperature = records.Any() ? records.Average(b => b.Temperatures.Cells.Average.Value) : 0; CurrentMinSoc = empty ? 0 : records.Min(r => r.Soc.Value);
HeatingCurrent = records.Any() ? records.Sum(b => b.HeatingCurrent) : 0; Temperature = records.Any() ? records.Average(b => b.Temperatures.Cells.Average.Value) : 0;
HeatingCurrent = records.Any() ? records.Sum(b => b.HeatingCurrent) : 0;
Dc = empty Dc = empty
? DcBus.FromVoltageCurrent(0, 0) ? DcBus.FromVoltageCurrent(0, 0)
@ -31,6 +32,7 @@ public class Battery48TlRecords
public IReadOnlyList<String> Warnings { get; init; } public IReadOnlyList<String> Warnings { get; init; }
public IReadOnlyList<String> Alarms { get; init; } public IReadOnlyList<String> Alarms { get; init; }
public Percent Soc { get; init; } public Percent Soc { get; init; }
public Percent CurrentMinSoc { get; init; }
public Temperature Temperature { get; init; } public Temperature Temperature { get; init; }
public Current HeatingCurrent { get; init; } public Current HeatingCurrent { get; init; }