From 4e5e7d28a94106dab8ecf8ff08acfdf5589fe4c6 Mon Sep 17 00:00:00 2001 From: Arjun Roychowdhury Date: Thu, 12 Nov 2015 17:02:18 -0500 Subject: #82 - initial commits towards showing monitor specific alarm notitications in montage Former-commit-id: 278d0c8fb24ef38e607caf66f1f6279b2e36f70b --- www/js/MontageCtrl.js | 27 +++++++++++++++++++++++++++ 1 file changed, 27 insertions(+) (limited to 'www/js/MontageCtrl.js') diff --git a/www/js/MontageCtrl.js b/www/js/MontageCtrl.js index 2e5feb8c..40b3a69c 100644 --- a/www/js/MontageCtrl.js +++ b/www/js/MontageCtrl.js @@ -199,6 +199,33 @@ angular.module('zmApp.controllers').controller('zmApp.MontageCtrl', ['$scope', ' $scope.modal.remove(); }; + + + //---------------------------------------------------------------- + // Alarm emit handling + //---------------------------------------------------------------- + $rootScope.$on("alarm", function (event, args) { + console.log ("***EVENT TRAP***"); + var alarmMonitors = args.message; + for (var i=0; i< alarmMonitors.length; i++) + { + console.log ("**** TRAPPED EVENT: "+alarmMonitors[i]); + + for (var j=0; i<$scope.monitors.length; i++) + { + if ($scope.monitors[j].Monitor.Id == alarmMonitors[i]) + { + $scope.monitors[j].Monitor.isAlarmed="true"; + } + } + + } + + + + + + }); //---------------------------------------------------------------- // Alarm notification handling -- cgit v1.2.3