Add new Alarms on the deligreen library
This commit is contained in:
parent
ffd34b24c8
commit
6abb0497ae
|
|
@ -14,6 +14,15 @@ public class BatteryDeligreenRecords
|
||||||
public required Double Power { get; init; }
|
public required Double Power { get; init; }
|
||||||
public required Voltage LowestCellVoltage { get; init; }
|
public required Voltage LowestCellVoltage { get; init; }
|
||||||
public required Voltage HighestCellVoltage { get; init; }
|
public required Voltage HighestCellVoltage { get; init; }
|
||||||
|
public required Boolean MonomerHighVoltageAlarm { get; init; }
|
||||||
|
public required Boolean MonomerLowVoltageAlarm { get; init; }
|
||||||
|
public required Boolean ChargeSwitchState { get; init; }
|
||||||
|
public required Boolean DischargeSwitchState { get; init; }
|
||||||
|
public required Int32 AvailableDischBatteries { get; init; }
|
||||||
|
public required Int32 AvailableChBatteries { get; init; }
|
||||||
|
public required Boolean Eoc { get; init; } // End of Charge
|
||||||
|
public required Boolean Eod { get; init; } // End of Discharge
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
// public required Temperature TemperatureCell2 { get; init; }
|
// public required Temperature TemperatureCell2 { get; init; }
|
||||||
|
|
@ -42,7 +51,15 @@ public class BatteryDeligreenRecords
|
||||||
Voltage = records.Average(r =>r.BatteryDeligreenDataRecord.BusVoltage),
|
Voltage = records.Average(r =>r.BatteryDeligreenDataRecord.BusVoltage),
|
||||||
Power = records.Sum(r => r.BatteryDeligreenDataRecord.Power),
|
Power = records.Sum(r => r.BatteryDeligreenDataRecord.Power),
|
||||||
LowestCellVoltage = records.Min(r => r.BatteryDeligreenDataRecord.CellVoltage.Min()),
|
LowestCellVoltage = records.Min(r => r.BatteryDeligreenDataRecord.CellVoltage.Min()),
|
||||||
HighestCellVoltage = records.Max(r => r.BatteryDeligreenDataRecord.CellVoltage.Max())
|
HighestCellVoltage = records.Max(r => r.BatteryDeligreenDataRecord.CellVoltage.Max()),
|
||||||
|
MonomerHighVoltageAlarm = records.Any(r => r.BatteryDeligreenAlarmRecord.AlarmEvent2.MonomerHighVoltageAlarm),
|
||||||
|
MonomerLowVoltageAlarm = records.Any(r => r.BatteryDeligreenAlarmRecord.AlarmEvent2.MonomerLowVoltageAlarm),
|
||||||
|
ChargeSwitchState = records.All(r => r.BatteryDeligreenAlarmRecord.OnOffState.ChargeSwitchState),
|
||||||
|
DischargeSwitchState = records.All(r => r.BatteryDeligreenAlarmRecord.OnOffState.DischargeSwitchState),
|
||||||
|
AvailableDischBatteries = records.Select(r => r.BatteryDeligreenAlarmRecord.OnOffState.DischargeSwitchState ? 1 : 0).Sum(),
|
||||||
|
AvailableChBatteries = records.Select(r => r.BatteryDeligreenAlarmRecord.OnOffState.ChargeSwitchState ? 1 : 0).Sum(),
|
||||||
|
Eoc = records.All(r => r.BatteryDeligreenAlarmRecord.AlarmEvent2.MonomerOvervoltageProtection),
|
||||||
|
Eod = records.All(r => r.BatteryDeligreenAlarmRecord.AlarmEvent2.MonomerUnderVoltageProtection),
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
Loading…
Reference in New Issue