From ab70984742dd91600b14cbff8564cc4cb88aa936 Mon Sep 17 00:00:00 2001 From: atef Date: Wed, 19 Mar 2025 11:25:42 +0100 Subject: [PATCH] Add the highest and lowest cell voltage. --- .../Devices/BatteryDeligreen/BatteryDeligreenRecords.cs | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/csharp/Lib/Devices/BatteryDeligreen/BatteryDeligreenRecords.cs b/csharp/Lib/Devices/BatteryDeligreen/BatteryDeligreenRecords.cs index 3dbcf9245..f48c3bdba 100644 --- a/csharp/Lib/Devices/BatteryDeligreen/BatteryDeligreenRecords.cs +++ b/csharp/Lib/Devices/BatteryDeligreen/BatteryDeligreenRecords.cs @@ -1,6 +1,4 @@ using InnovEnergy.Lib.Units; -using InnovEnergy.Lib.Units.Composite; -using InnovEnergy.Lib.Units.Power; namespace InnovEnergy.Lib.Devices.BatteryDeligreen; @@ -14,6 +12,9 @@ public class BatteryDeligreenRecords public required Percent CurrentMinSoc { get; init; } public required Temperature TemperatureCell1 { get; init; } public required Double Power { get; init; } + public required Voltage LowestCellVoltage { get; init; } + public required Voltage HighestCellVoltage { get; init; } + // public required Temperature TemperatureCell2 { get; init; } // public required Temperature TemperatureCell3 { get; init; } @@ -40,7 +41,8 @@ public class BatteryDeligreenRecords Current = records.Sum(r =>r.BatteryDeligreenDataRecord.BusCurrent), Voltage = records.Average(r =>r.BatteryDeligreenDataRecord.BusVoltage), Power = records.Sum(r => r.BatteryDeligreenDataRecord.Power), - + LowestCellVoltage = records.Min(r => r.BatteryDeligreenDataRecord.CellVoltage.Min()), + HighestCellVoltage = records.Max(r => r.BatteryDeligreenDataRecord.CellVoltage.Max()) }; } } \ No newline at end of file