Ejemplo n.º 1
0
		public JsonResult GetAlarms()
		{
			var alarms = AlarmsViewModel.OnGKObjectsStateChanged(null);
			var alarmsViewModel = new AlarmsViewModel();
			alarmsViewModel.UpdateAlarms(alarms);
			return Json(alarmsViewModel, JsonRequestBehavior.AllowGet);
		}
Ejemplo n.º 2
0
		public void BroadcastAlarms()
		{
			var alarms = AlarmsViewModel.OnGKObjectsStateChanged(null);
			var alarmsViewModel = new AlarmsViewModel();
			alarmsViewModel.UpdateAlarms(alarms);
			var alarmGroupsViewModel = new AlarmGroupsViewModel();
			alarmGroupsViewModel.Update(alarms);
            Clients.All.updateAlarms(new {alarms = alarmsViewModel, groups = alarmGroupsViewModel});
		}