Add heating power to the average battery.
This commit is contained in:
parent
db6fe5ecbf
commit
57c5faf1e6
|
@ -2,6 +2,7 @@ using System.Diagnostics.CodeAnalysis;
|
||||||
using InnovEnergy.Lib.Devices.Battery48TL.DataTypes;
|
using InnovEnergy.Lib.Devices.Battery48TL.DataTypes;
|
||||||
using InnovEnergy.Lib.Units;
|
using InnovEnergy.Lib.Units;
|
||||||
using InnovEnergy.Lib.Units.Power;
|
using InnovEnergy.Lib.Units.Power;
|
||||||
|
using InnovEnergy.Lib.Utils;
|
||||||
using static InnovEnergy.Lib.Devices.Battery48TL.DataTypes.LedState;
|
using static InnovEnergy.Lib.Devices.Battery48TL.DataTypes.LedState;
|
||||||
|
|
||||||
namespace InnovEnergy.Lib.Devices.Battery48TL;
|
namespace InnovEnergy.Lib.Devices.Battery48TL;
|
||||||
|
@ -28,6 +29,8 @@ public partial class Battery48TlRecord
|
||||||
|
|
||||||
public Current HeatingCurrent => _BusCurrent - _CellsCurrent;
|
public Current HeatingCurrent => _BusCurrent - _CellsCurrent;
|
||||||
|
|
||||||
|
public DcPower HeatingPower => HeatingCurrent * Dc.Voltage;
|
||||||
|
|
||||||
public readonly struct Leds_
|
public readonly struct Leds_
|
||||||
{
|
{
|
||||||
public LedState Blue => Self.ParseLed(LedColor.Blue);
|
public LedState Blue => Self.ParseLed(LedColor.Blue);
|
||||||
|
|
|
@ -1,5 +1,7 @@
|
||||||
using InnovEnergy.Lib.Units;
|
using InnovEnergy.Lib.Units;
|
||||||
using InnovEnergy.Lib.Units.Composite;
|
using InnovEnergy.Lib.Units.Composite;
|
||||||
|
using InnovEnergy.Lib.Units.Power;
|
||||||
|
using InnovEnergy.Lib.Utils;
|
||||||
|
|
||||||
namespace InnovEnergy.Lib.Devices.Battery48TL;
|
namespace InnovEnergy.Lib.Devices.Battery48TL;
|
||||||
|
|
||||||
|
@ -16,8 +18,8 @@ public class Battery48TlRecords
|
||||||
Soc = empty ? 0 : records.Average(r => r.Soc.Value);
|
Soc = empty ? 0 : records.Average(r => r.Soc.Value);
|
||||||
CurrentMinSoc = empty ? 0 : records.Min(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;
|
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
|
Dc = empty
|
||||||
? DcBus.Null
|
? DcBus.Null
|
||||||
: DcBus.FromVoltageCurrent
|
: DcBus.FromVoltageCurrent
|
||||||
|
@ -35,6 +37,7 @@ public class Battery48TlRecords
|
||||||
public Percent CurrentMinSoc { 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; }
|
||||||
|
public DcPower HeatingPower { get; init; }
|
||||||
|
|
||||||
public IReadOnlyList<Battery48TlRecord> Devices { get; init; }
|
public IReadOnlyList<Battery48TlRecord> Devices { get; init; }
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue