Add time to TOC request
This commit is contained in:
parent
c955b97c2b
commit
6c2360f0ad
|
@ -174,6 +174,11 @@ internal static class Program
|
||||||
var t = UnixTime.Now;
|
var t = UnixTime.Now;
|
||||||
var record = ReadStatus();
|
var record = ReadStatus();
|
||||||
|
|
||||||
|
var batteryTimeToToc = (3600 - record.Battery.TimeToToc / 60 );
|
||||||
|
|
||||||
|
record.Battery.TimeToToc.WriteLine(" : Value of register 54");
|
||||||
|
batteryTimeToToc .WriteLine(" : Remaining time before next top of charge");
|
||||||
|
|
||||||
record.ControlConstants();
|
record.ControlConstants();
|
||||||
record.ControlSystemState();
|
record.ControlSystemState();
|
||||||
|
|
||||||
|
|
|
@ -25,6 +25,8 @@ public partial class Battery48TlRecord
|
||||||
|
|
||||||
public Percent Soc => _Soc;
|
public Percent Soc => _Soc;
|
||||||
|
|
||||||
|
public UInt16 TimeToTOC => (UInt16)_TimeToTOC;
|
||||||
|
|
||||||
public Current BusCurrent => _BusCurrent;
|
public Current BusCurrent => _BusCurrent;
|
||||||
|
|
||||||
public Current HeatingCurrent => _BusCurrent - _CellsCurrent;
|
public Current HeatingCurrent => _BusCurrent - _CellsCurrent;
|
||||||
|
|
|
@ -23,6 +23,7 @@ public partial class Battery48TlRecord
|
||||||
[InputRegister(1062, Scale = 0.01, Offset = -10000)] private Double _BusCurrent;
|
[InputRegister(1062, Scale = 0.01, Offset = -10000)] private Double _BusCurrent;
|
||||||
|
|
||||||
[InputRegister(1053, Scale = 0.1)] private Double _Soc;
|
[InputRegister(1053, Scale = 0.1)] private Double _Soc;
|
||||||
|
[InputRegister(1052)] private Double _TimeToTOC;
|
||||||
|
|
||||||
[InputRegister(1014, Scale = 0.1, Offset = -400)] private Double _TemperaturesBoard;
|
[InputRegister(1014, Scale = 0.1, Offset = -400)] private Double _TemperaturesBoard;
|
||||||
[InputRegister(1015, Scale = 0.1, Offset = -400)] private Double _TemperaturesCellsCenter;
|
[InputRegister(1015, Scale = 0.1, Offset = -400)] private Double _TemperaturesCellsCenter;
|
||||||
|
@ -30,7 +31,6 @@ public partial class Battery48TlRecord
|
||||||
[InputRegister(1017, Scale = 0.1, Offset = -400)] private Double _TemperaturesCellsRight;
|
[InputRegister(1017, Scale = 0.1, Offset = -400)] private Double _TemperaturesCellsRight;
|
||||||
[InputRegister(1003, Scale = 0.1, Offset = -400)] private Double _TemperaturesCellsAverage;
|
[InputRegister(1003, Scale = 0.1, Offset = -400)] private Double _TemperaturesCellsAverage;
|
||||||
|
|
||||||
|
|
||||||
[InputRegister(1054)] private Double _FwVersion;
|
[InputRegister(1054)] private Double _FwVersion;
|
||||||
[InputRegister(1055)] private Double _SerialNum1;
|
[InputRegister(1055)] private Double _SerialNum1;
|
||||||
[InputRegister(1056)] private Double _SerialNum2;
|
[InputRegister(1056)] private Double _SerialNum2;
|
||||||
|
|
|
@ -14,6 +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 TimeToToc { get; init; }
|
||||||
|
|
||||||
public required IReadOnlyList<Battery48TlRecord> Devices { get; init; }
|
public required IReadOnlyList<Battery48TlRecord> Devices { get; init; }
|
||||||
|
|
||||||
|
@ -32,6 +33,7 @@ public class Battery48TlRecords
|
||||||
CurrentMinSoc = records.Min(r => r.Soc.Value),
|
CurrentMinSoc = records.Min(r => r.Soc.Value),
|
||||||
Temperature = records.Average(b => b.Temperatures.Cells.Average.Value),
|
Temperature = records.Average(b => b.Temperatures.Cells.Average.Value),
|
||||||
HeatingPower = records.Sum(b => b.HeatingPower),
|
HeatingPower = records.Sum(b => b.HeatingPower),
|
||||||
|
TimeToToc = records.Min(r => r.TimeToTOC),
|
||||||
|
|
||||||
Dc = DcBus.FromVoltageCurrent
|
Dc = DcBus.FromVoltageCurrent
|
||||||
(
|
(
|
||||||
|
|
Loading…
Reference in New Issue