add heating and total current value to battery records

This commit is contained in:
atef 2023-07-03 14:21:00 +02:00
parent 869a83b799
commit 7d0dd25696
2 changed files with 11 additions and 5 deletions

View File

@ -24,6 +24,10 @@ public partial class Battery48TlRecord
public Percent Soc => _Soc;
public Current BusCurrent => _BusCurrent;
public Current HeatingCurrent => _BusCurrent - _CellsCurrent;
public readonly struct Leds_
{
public LedState Blue => Self.ParseLed(LedColor.Blue);
@ -65,9 +69,9 @@ public partial class Battery48TlRecord
public readonly struct Dc_
{
public Voltage Voltage => Self._DcVoltage;
public Current Current => Self._DcCurrent;
public ActivePower Power => Self._DcVoltage * Self._DcCurrent;
public Voltage Voltage => Self._CellsVoltage;
public Current Current => Self._CellsCurrent;
public ActivePower Power => Self._CellsVoltage * Self._CellsCurrent;
internal Dc_(Battery48TlRecord self) => Self = self;
private Battery48TlRecord Self { get; }

View File

@ -17,8 +17,10 @@ public partial class Battery48TlRecord
[InputRegister<UInt64>(1009)] private UInt64 _AlarmFlags;
[InputRegister(1013)] private UInt16 _IoStates;
[InputRegister(999, Scale = 0.01)] private Double _DcVoltage;
[InputRegister(1000, Scale = 0.01, Offset = -10000)] private Double _DcCurrent;
[InputRegister(999, Scale = 0.01)] private Double _CellsVoltage;
[InputRegister(1001, Scale = 0.01)] private Double _BusVoltage;
[InputRegister(1000, Scale = 0.01, Offset = -10000)] private Double _CellsCurrent;
[InputRegister(1062, Scale = 0.01, Offset = -10000)] private Double _BusCurrent;
[InputRegister(1053, Scale = 0.1)] private Double _Soc;