Add time to TOC request
This commit is contained in:
parent
c955b97c2b
commit
6c2360f0ad
|
@ -173,7 +173,12 @@ 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();
|
||||||
|
|
||||||
|
|
|
@ -24,7 +24,9 @@ public partial class Battery48TlRecord
|
||||||
public Strings Alarms => ParseAlarms() .OrderBy(w => w).ToList();
|
public Strings Alarms => ParseAlarms() .OrderBy(w => w).ToList();
|
||||||
|
|
||||||
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;
|
||||||
|
|
|
@ -22,23 +22,23 @@ public partial class Battery48TlRecord
|
||||||
[InputRegister(1000, Scale = 0.01, Offset = -10000)] private Double _CellsCurrent;
|
[InputRegister(1000, Scale = 0.01, Offset = -10000)] private Double _CellsCurrent;
|
||||||
[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;
|
||||||
[InputRegister(1016, Scale = 0.1, Offset = -400)] private Double _TemperaturesCellsLeft;
|
[InputRegister(1016, Scale = 0.1, Offset = -400)] private Double _TemperaturesCellsLeft;
|
||||||
[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;
|
[InputRegister(1057)] private Double _SerialNum3;
|
||||||
[InputRegister(1057)] private Double _SerialNum3;
|
[InputRegister(1058)] private Double _SerialNum4;
|
||||||
[InputRegister(1058)] private Double _SerialNum4;
|
[InputRegister(1059)] private Double _LimpBitMap;
|
||||||
[InputRegister(1059)] private Double _LimpBitMap;
|
[InputRegister(1060)] private Double _BatteryState1;
|
||||||
[InputRegister(1060)] private Double _BatteryState1;
|
[InputRegister(1061)] private Double _BatteryState2;
|
||||||
[InputRegister(1061)] private Double _BatteryState2;
|
|
||||||
|
|
||||||
private LedState ParseLed(LedColor led) => (LedState)((_LedStates >> (Int32)led) & 3);
|
private LedState ParseLed(LedColor led) => (LedState)((_LedStates >> (Int32)led) & 3);
|
||||||
|
|
||||||
|
|
|
@ -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,7 +33,8 @@ 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
|
||||||
(
|
(
|
||||||
records.Average(r => r.Dc.Voltage),
|
records.Average(r => r.Dc.Voltage),
|
||||||
|
|
Loading…
Reference in New Issue