Display Alarm of each battery

This commit is contained in:
atef 2023-12-06 14:54:38 +01:00
parent 9aad4851b2
commit ecfac5ea94
1 changed files with 14 additions and 7 deletions

View File

@ -428,18 +428,25 @@ internal static class Program
if (record.Battery != null) if (record.Battery != null)
{ {
foreach (var alarm in record.Battery.Alarms) var i = 0;
foreach (var battery in record.Battery.Devices)
{
i++;
foreach (var alarm in battery.Alarms)
{ {
alarmList.Add(new AlarmOrWarning alarmList.Add(new AlarmOrWarning
{ {
Date = DateTime.Now.ToString("yyyy-MM-dd"), Date = DateTime.Now.ToString("yyyy-MM-dd"),
Time = DateTime.Now.ToString("HH:mm:ss"), Time = DateTime.Now.ToString("HH:mm:ss"),
CreatedBy = "Battery", CreatedBy = "Battery" + i,
Description = alarm Description = alarm
}); });
} }
} }
}
foreach (var warning in record.AcDc.Warnings) foreach (var warning in record.AcDc.Warnings)
{ {
warningList.Add(new AlarmOrWarning warningList.Add(new AlarmOrWarning