Пример #1
0
		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);
			}
		}
Пример #2
0
		public ShortAlarmObject(AlarmViewModel model)
		{
			ObjectName = model.GkEntity.Name;
			ObjectImageSource = model.GkEntity.ImageSource;
		}
Пример #3
0
		public void UpdateAlarms(List<Alarm> alarms)
		{
			CanResetAll = (GetAlarmsToResetCount() > 0);
			CanResetIgnoreAll = GetCanResetIgnoreAll();

			foreach (var alarm in alarms)
			{
				var alarmViewModel = new AlarmViewModel(alarm);
				Alarms.Add(alarmViewModel);
			}
		}
Пример #4
0
		public JsonResult TurnOnAutomatic(AlarmViewModel alarm)
		{
			alarm.TurnOnAutomatic();

			return new JsonResult();
		}
Пример #5
0
		public JsonResult ResetIgnore(AlarmViewModel alarm)
		{
			alarm.ResetIgnore();

			return new JsonResult();
		}