Add hte IO states as boolean variables

This commit is contained in:
atef 2024-02-06 11:47:39 +01:00
parent 01fcb60f24
commit 37bdd4a338
1 changed files with 12 additions and 5 deletions

View File

@ -18,6 +18,13 @@ public partial class Battery48TlRecord
public StringActive_ BatteryStrings => new StringActive_(this);
public Boolean ConnectedToDcBus => (_IoStates & 1) == 0;
public Boolean AlarmOutActive => (_IoStates & 2) == 0;
public Boolean InternalFanActive => (_IoStates & 4) == 1;
public Boolean VoltMeasurementAllowed => (_IoStates & 8) == 1;
public Boolean AuxRelayBus => (_IoStates & 16) == 0;
public Boolean RemoteStateActive => (_IoStates & 32) == 1;
public Boolean RiscActive => (_IoStates & 64) == 1;
public Boolean Eoc => Leds is { Green: On, Amber: Off, Blue : Off };
public UInt16 IoStates => _IoStates;
@ -31,9 +38,9 @@ public partial class Battery48TlRecord
public Double SOCAh => _SOCAh;
public Current BusCurrent => _BusCurrent;
public UInt16 BusCurrentHex => _BusCurrentHex;
//public UInt16 BusCurrentHex => _BusCurrentHex;
public UInt16 CellsCurrentHex => _CellsCurrentHex;
public Current CellsCurrent => _CellsCurrent;
public Current HeatingCurrent => _BusCurrent - _CellsCurrent;
public DcPower HeatingPower => HeatingCurrent * Dc.Voltage;
@ -42,7 +49,7 @@ public partial class Battery48TlRecord
// When The battery is full charged (reached EOC) the Time Since TOC is set to 0
public TimeSpan TimeSinceTOC => TimeSpan.FromMinutes(_TimeSinceToc);
public Boolean CalibrationChargeRequested => TimeSinceTOC > TimeSpan.FromDays(13); // Each 14 days , we do calibration. But there is wait time for all batteries to request and for next day calibration rule we put this 13 days
public Boolean CalibrationChargeRequested => TimeSinceTOC > TimeSpan.FromDays(7); // Each 14 days , we do calibration. But there is wait time for all batteries to request and for next day calibration rule we put this 13 days
public readonly struct Leds_
{