diff --git a/csharp/Lib/Devices/Battery48TL/Battery48TlRecord.Api.cs b/csharp/Lib/Devices/Battery48TL/Battery48TlRecord.Api.cs index 0bc4a0869..973f86deb 100644 --- a/csharp/Lib/Devices/Battery48TL/Battery48TlRecord.Api.cs +++ b/csharp/Lib/Devices/Battery48TL/Battery48TlRecord.Api.cs @@ -2,6 +2,7 @@ using System.Diagnostics.CodeAnalysis; using InnovEnergy.Lib.Devices.Battery48TL.DataTypes; using InnovEnergy.Lib.Units; using InnovEnergy.Lib.Units.Power; +using InnovEnergy.Lib.Utils; using static InnovEnergy.Lib.Devices.Battery48TL.DataTypes.LedState; namespace InnovEnergy.Lib.Devices.Battery48TL; @@ -28,6 +29,8 @@ public partial class Battery48TlRecord public Current HeatingCurrent => _BusCurrent - _CellsCurrent; + public DcPower HeatingPower => HeatingCurrent * Dc.Voltage; + public readonly struct Leds_ { public LedState Blue => Self.ParseLed(LedColor.Blue); diff --git a/csharp/Lib/Devices/Battery48TL/Battery48TlRecords.cs b/csharp/Lib/Devices/Battery48TL/Battery48TlRecords.cs index 8d13298c1..74deccb57 100644 --- a/csharp/Lib/Devices/Battery48TL/Battery48TlRecords.cs +++ b/csharp/Lib/Devices/Battery48TL/Battery48TlRecords.cs @@ -1,5 +1,7 @@ using InnovEnergy.Lib.Units; using InnovEnergy.Lib.Units.Composite; +using InnovEnergy.Lib.Units.Power; +using InnovEnergy.Lib.Utils; namespace InnovEnergy.Lib.Devices.Battery48TL; @@ -16,8 +18,8 @@ public class Battery48TlRecords Soc = empty ? 0 : records.Average(r => r.Soc.Value); CurrentMinSoc = empty ? 0 : records.Min(r => r.Soc.Value); Temperature = records.Any() ? records.Average(b => b.Temperatures.Cells.Average.Value) : 0; - HeatingCurrent = records.Any() ? records.Sum(b => b.HeatingCurrent) : 0; - + HeatingPower = records.Any() ? records.Sum(b => b.HeatingPower) : 0; + Dc = empty ? DcBus.Null : DcBus.FromVoltageCurrent @@ -35,6 +37,7 @@ public class Battery48TlRecords public Percent CurrentMinSoc { get; init; } public Temperature Temperature { get; init; } public Current HeatingCurrent { get; init; } + public DcPower HeatingPower { get; init; } public IReadOnlyList Devices { get; init; }