Change TimeSinceTOC from Uint16 to TimeSpan

This commit is contained in:
atef 2023-09-18 11:15:18 +02:00
parent 0d400a0eea
commit 9928e732ff
2 changed files with 6 additions and 7 deletions

View File

@ -12,7 +12,6 @@ using Strings = IReadOnlyList<String>;
[SuppressMessage("ReSharper", "ConvertToAutoProperty")] [SuppressMessage("ReSharper", "ConvertToAutoProperty")]
public partial class Battery48TlRecord public partial class Battery48TlRecord
{ {
private UInt16 OneWeekInMinutes => 10080;
public Dc_ Dc => new Dc_(this); public Dc_ Dc => new Dc_(this);
public Leds_ Leds => new Leds_(this); public Leds_ Leds => new Leds_(this);
public Temperatures_ Temperatures => new Temperatures_(this); public Temperatures_ Temperatures => new Temperatures_(this);
@ -31,12 +30,12 @@ public partial class Battery48TlRecord
// Time since TOC is a counter from the last moment when the battery reached EOC // Time since TOC is a counter from the last moment when the battery reached EOC
// When The battery is full charged (reached EOC) the Time Since TOC is set to 0 // When The battery is full charged (reached EOC) the Time Since TOC is set to 0
public UInt16 TimeSinceTOC => _TimeSinceToc; public TimeSpan TimeSinceTOC => TimeSpan.FromMinutes(_TimeSinceToc);
public Current BusCurrent => _BusCurrent; public Current BusCurrent => _BusCurrent;
public Current HeatingCurrent => _BusCurrent - _CellsCurrent; public Current HeatingCurrent => _BusCurrent - _CellsCurrent;
public DcPower HeatingPower => HeatingCurrent * Dc.Voltage; public DcPower HeatingPower => HeatingCurrent * Dc.Voltage;
public Boolean CalibrationChargeRequested => TimeSinceTOC > OneWeekInMinutes; public Boolean CalibrationChargeRequested => TimeSinceTOC > TimeSpan.FromDays(7);
public readonly struct Leds_ public readonly struct Leds_
{ {

View File

@ -14,7 +14,7 @@ public class Battery48TlRecords
public required Percent CurrentMinSoc { get; init; } public required Percent CurrentMinSoc { get; init; }
public required Temperature Temperature { get; init; } public required Temperature Temperature { get; init; }
public required DcPower HeatingPower { get; init; } public required DcPower HeatingPower { get; init; }
public required UInt16 TimeSinceToc { get; init; } public required TimeSpan TimeSinceToc { get; init; }
public required Boolean CalibrationChargeRequested { get; init; } public required Boolean CalibrationChargeRequested { get; init; }
public required IReadOnlyList<Battery48TlRecord> Devices { get; init; } public required IReadOnlyList<Battery48TlRecord> Devices { get; init; }