public void Update(List<Alarm> alarms) { Count = AlarmsViewModel.GetAlarmsToResetCount(); CanReset = (Count > 0); foreach (var alarmGroup in AlarmGroups) { var alarmViewModels = new List<AlarmViewModel>(); foreach (var alarm in alarms) { if (alarm.AlarmType == alarmGroup.AlarmType) { var alarmViewModel = new AlarmViewModel(alarm); alarmViewModels.Add(alarmViewModel); } } alarmGroup.Update(alarmViewModels); } }
public ShortAlarmObject(AlarmViewModel model) { ObjectName = model.GkEntity.Name; ObjectImageSource = model.GkEntity.ImageSource; }
public void UpdateAlarms(List<Alarm> alarms) { CanResetAll = (GetAlarmsToResetCount() > 0); CanResetIgnoreAll = GetCanResetIgnoreAll(); foreach (var alarm in alarms) { var alarmViewModel = new AlarmViewModel(alarm); Alarms.Add(alarmViewModel); } }
public JsonResult TurnOnAutomatic(AlarmViewModel alarm) { alarm.TurnOnAutomatic(); return new JsonResult(); }
public JsonResult ResetIgnore(AlarmViewModel alarm) { alarm.ResetIgnore(); return new JsonResult(); }