diff --git a/csharp/Lib/Devices/Battery48TL/Battery48TlRecord.Api.cs b/csharp/Lib/Devices/Battery48TL/Battery48TlRecord.Api.cs index 7a6989768..e8f1320d3 100644 --- a/csharp/Lib/Devices/Battery48TL/Battery48TlRecord.Api.cs +++ b/csharp/Lib/Devices/Battery48TL/Battery48TlRecord.Api.cs @@ -27,6 +27,7 @@ public partial class Battery48TlRecord public Strings Alarms => ParseAlarms() .OrderBy(w => w).ToList(); public Percent Soc => _Soc; + public Double SOCAh => _SOCAh; public Current BusCurrent => _BusCurrent; public UInt16 BusCurrentHex => _BusCurrentHex; @@ -40,7 +41,7 @@ public partial class Battery48TlRecord // When The battery is full charged (reached EOC) the Time Since TOC is set to 0 public TimeSpan TimeSinceTOC => TimeSpan.FromMinutes(_TimeSinceToc); - public Boolean CalibrationChargeRequested => TimeSinceTOC > TimeSpan.FromDays(14); + public Boolean CalibrationChargeRequested => TimeSinceTOC > TimeSpan.FromDays(13); // Each 14 days , we do calibration. But there is wait time for all batteries to request and for next day calibration rule we put this 13 days public readonly struct Leds_ { diff --git a/csharp/Lib/Devices/Battery48TL/Battery48TlRecord.Modbus.cs b/csharp/Lib/Devices/Battery48TL/Battery48TlRecord.Modbus.cs index 8d7882710..1c8435765 100644 --- a/csharp/Lib/Devices/Battery48TL/Battery48TlRecord.Modbus.cs +++ b/csharp/Lib/Devices/Battery48TL/Battery48TlRecord.Modbus.cs @@ -21,7 +21,8 @@ public partial class Battery48TlRecord [InputRegister(1001, Scale = 0.01)] private Double _BusVoltage; [InputRegister(1000, Scale = 0.01, Offset = -10000)] private Double _CellsCurrent; [InputRegister(1000)] private UInt16 _CellsCurrentHex; - + [InputRegister(1002, Scale = 0.1, Offset = -10000)] private Double _SOCAh; + [InputRegister(1062, Scale = 0.01, Offset = -10000)] private Double _BusCurrent; [InputRegister(1062)] private UInt16 _BusCurrentHex; diff --git a/csharp/Lib/Devices/Battery48TL/Battery48TlRecords.cs b/csharp/Lib/Devices/Battery48TL/Battery48TlRecords.cs index b4e96aaad..a59f34e22 100644 --- a/csharp/Lib/Devices/Battery48TL/Battery48TlRecords.cs +++ b/csharp/Lib/Devices/Battery48TL/Battery48TlRecords.cs @@ -11,6 +11,7 @@ public class Battery48TlRecords public required IReadOnlyList Warnings { get; init; } public required IReadOnlyList Alarms { get; init; } public required Percent Soc { get; init; } + public required Double SocAh { get; init; } public required Percent CurrentMinSoc { get; init; } public required Temperature Temperature { get; init; } public required DcPower HeatingPower { get; init; } @@ -31,6 +32,7 @@ public class Battery48TlRecords Warnings = records.SelectMany(r => r.Warnings).Distinct().ToList(), Alarms = records.SelectMany(r => r.Alarms).Distinct().ToList(), Soc = records.Average(r => r.Soc.Value), + SocAh = records.Average(r => r.SOCAh), CurrentMinSoc = records.Min(r => r.Soc.Value), Temperature = records.Average(b => b.Temperatures.Cells.Average.Value), HeatingPower = records.Sum(b => b.HeatingPower),