示例#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();
		}