From 26422284dddd54aa8c9f5220b9d04354e59042fa Mon Sep 17 00:00:00 2001 From: atef Date: Fri, 1 Sep 2023 14:14:34 +0200 Subject: [PATCH] Change from falg to requested --- csharp/App/SaliMax/src/Ess/Controller.cs | 2 +- .../Battery48TL/Battery48TlRecord.Api.cs | 2 +- .../Devices/Battery48TL/Battery48TlRecords.cs | 22 +++++++++---------- 3 files changed, 13 insertions(+), 13 deletions(-) diff --git a/csharp/App/SaliMax/src/Ess/Controller.cs b/csharp/App/SaliMax/src/Ess/Controller.cs index de7e0fc64..8cf603029 100644 --- a/csharp/App/SaliMax/src/Ess/Controller.cs +++ b/csharp/App/SaliMax/src/Ess/Controller.cs @@ -209,7 +209,7 @@ public static class Controller // no need to return false in case of EOC reached // because the BMS will set the Time Since TOC to 0 as soon a battery reach EOC // then Calibration Charge flag will be set false by the software - return statusRecord.Battery.CalibrationChargeFlag; + return statusRecord.Battery.CalibrationChargeRequested; } diff --git a/csharp/Lib/Devices/Battery48TL/Battery48TlRecord.Api.cs b/csharp/Lib/Devices/Battery48TL/Battery48TlRecord.Api.cs index 81385e3c7..8e8d24217 100644 --- a/csharp/Lib/Devices/Battery48TL/Battery48TlRecord.Api.cs +++ b/csharp/Lib/Devices/Battery48TL/Battery48TlRecord.Api.cs @@ -36,7 +36,7 @@ public partial class Battery48TlRecord public DcPower HeatingPower => HeatingCurrent * Dc.Voltage; - public Boolean CalibrationChargeFlag => TimeSinceTOC > OneWeekInMinutes; + public Boolean CalibrationChargeRequested => TimeSinceTOC > OneWeekInMinutes; public readonly struct Leds_ { diff --git a/csharp/Lib/Devices/Battery48TL/Battery48TlRecords.cs b/csharp/Lib/Devices/Battery48TL/Battery48TlRecords.cs index 8e1ef93a2..445a78452 100644 --- a/csharp/Lib/Devices/Battery48TL/Battery48TlRecords.cs +++ b/csharp/Lib/Devices/Battery48TL/Battery48TlRecords.cs @@ -15,7 +15,7 @@ public class Battery48TlRecords public required Temperature Temperature { get; init; } public required DcPower HeatingPower { get; init; } public required UInt16 TimeSinceToc { get; init; } - public required Boolean CalibrationChargeFlag { get; init; } + public required Boolean CalibrationChargeRequested { get; init; } public required IReadOnlyList Devices { get; init; } @@ -26,16 +26,16 @@ public class Battery48TlRecords return new Battery48TlRecords { - Devices = records, - Eoc = records.All(r => r.Eoc), - Warnings = records.SelectMany(r => r.Warnings).Distinct().ToList(), - Alarms = records.SelectMany(r => r.Alarms).Distinct().ToList(), - Soc = records.Average(r => r.Soc.Value), - CurrentMinSoc = records.Min(r => r.Soc.Value), - Temperature = records.Average(b => b.Temperatures.Cells.Average.Value), - HeatingPower = records.Sum(b => b.HeatingPower), - TimeSinceToc = records.Max(r => r.TimeSinceTOC), - CalibrationChargeFlag = records.Any(r => r.CalibrationChargeFlag), + Devices = records, + Eoc = records.All(r => r.Eoc), + Warnings = records.SelectMany(r => r.Warnings).Distinct().ToList(), + Alarms = records.SelectMany(r => r.Alarms).Distinct().ToList(), + Soc = records.Average(r => r.Soc.Value), + CurrentMinSoc = records.Min(r => r.Soc.Value), + Temperature = records.Average(b => b.Temperatures.Cells.Average.Value), + HeatingPower = records.Sum(b => b.HeatingPower), + TimeSinceToc = records.Max(r => r.TimeSinceTOC), + CalibrationChargeRequested = records.Any(r => r.CalibrationChargeRequested), Dc = new() {