From 7d0dd2569608ec07991cdaa2c9484c87f4d6a771 Mon Sep 17 00:00:00 2001 From: atef Date: Mon, 3 Jul 2023 14:21:00 +0200 Subject: [PATCH] add heating and total current value to battery records --- .../Lib/Devices/Battery48TL/Battery48TlRecord.Api.cs | 10 +++++++--- .../Devices/Battery48TL/Battery48TlRecord.Modbus.cs | 6 ++++-- 2 files changed, 11 insertions(+), 5 deletions(-) diff --git a/csharp/Lib/Devices/Battery48TL/Battery48TlRecord.Api.cs b/csharp/Lib/Devices/Battery48TL/Battery48TlRecord.Api.cs index 40d925310..9f99e104c 100644 --- a/csharp/Lib/Devices/Battery48TL/Battery48TlRecord.Api.cs +++ b/csharp/Lib/Devices/Battery48TL/Battery48TlRecord.Api.cs @@ -23,6 +23,10 @@ public partial class Battery48TlRecord public Strings Alarms => ParseAlarms() .OrderBy(w => w).ToList(); public Percent Soc => _Soc; + + public Current BusCurrent => _BusCurrent; + + public Current HeatingCurrent => _BusCurrent - _CellsCurrent; public readonly struct Leds_ { @@ -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; } diff --git a/csharp/Lib/Devices/Battery48TL/Battery48TlRecord.Modbus.cs b/csharp/Lib/Devices/Battery48TL/Battery48TlRecord.Modbus.cs index 45e41f8a5..e2bf89a13 100644 --- a/csharp/Lib/Devices/Battery48TL/Battery48TlRecord.Modbus.cs +++ b/csharp/Lib/Devices/Battery48TL/Battery48TlRecord.Modbus.cs @@ -17,8 +17,10 @@ public partial class Battery48TlRecord [InputRegister(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;