summaryrefslogtreecommitdiff
path: root/www/js/EventsGraphsCtrl.js
diff options
context:
space:
mode:
Diffstat (limited to 'www/js/EventsGraphsCtrl.js')
-rw-r--r--www/js/EventsGraphsCtrl.js20
1 files changed, 10 insertions, 10 deletions
diff --git a/www/js/EventsGraphsCtrl.js b/www/js/EventsGraphsCtrl.js
index cda51415..98859649 100644
--- a/www/js/EventsGraphsCtrl.js
+++ b/www/js/EventsGraphsCtrl.js
@@ -8,7 +8,7 @@
// the main function is generateChart. I call generate chart with required parameters
// from the template file
-angular.module('zmApp.controllers').controller('zmApp.EventsGraphsCtrl', ['$ionicPlatform', '$scope', 'zm', 'ZMDataModel', '$ionicSideMenuDelegate', '$rootScope', '$http', '$ionicHistory', '$state', function ($ionicPlatform, $scope, zm, ZMDataModel, $ionicSideMenuDelegate, $rootScope, $http, $ionicHistory, $state) {
+angular.module('zmApp.controllers').controller('zmApp.EventsGraphsCtrl', ['$ionicPlatform', '$scope', 'zm', 'NVRDataModel', '$ionicSideMenuDelegate', '$rootScope', '$http', '$ionicHistory', '$state', function ($ionicPlatform, $scope, zm, NVRDataModel, $ionicSideMenuDelegate, $rootScope, $http, $ionicHistory, $state) {
//console.log("Inside Graphs controller");
$scope.openMenu = function () {
$ionicSideMenuDelegate.toggleLeft();
@@ -46,7 +46,7 @@ angular.module('zmApp.controllers').controller('zmApp.EventsGraphsCtrl', ['$ioni
//------------------------------------------------------------------------
$scope.$on('$ionicView.enter', function () {
// console.log("**VIEW ** EventsGraphs Ctrl Entered");
- ZMDataModel.setAwake(false);
+ NVRDataModel.setAwake(false);
});
$scope.$on('$ionicView.leave', function () {
@@ -145,14 +145,14 @@ angular.module('zmApp.controllers').controller('zmApp.EventsGraphsCtrl', ['$ioni
if (hrs) {
// Apply a time based filter if I am not watching all events
var cur = moment();
- endDate = cur.format("YYYY-MM-DD " + ZMDataModel.getTimeFormat());
- startDate = cur.subtract(hrs, 'hours').format("YYYY-MM-DD " + ZMDataModel.getTimeFormat());
+ endDate = cur.format("YYYY-MM-DD " + NVRDataModel.getTimeFormat());
+ startDate = cur.subtract(hrs, 'hours').format("YYYY-MM-DD " + NVRDataModel.getTimeFormat());
//console.log("Start and End " + startDate + "==" + endDate);
- ZMDataModel.zmLog("Generating graph for " + startDate + " to " + endDate);
+ NVRDataModel.log("Generating graph for " + startDate + " to " + endDate);
}
- var loginData = ZMDataModel.getLogin();
+ var loginData = NVRDataModel.getLogin();
//$scope.chart.data = {};
$scope.chart.data = {
labels: [],
@@ -167,7 +167,7 @@ angular.module('zmApp.controllers').controller('zmApp.EventsGraphsCtrl', ['$ioni
]
};
- ZMDataModel.getMonitors(0).then(function (data) {
+ NVRDataModel.getMonitors(0).then(function (data) {
monitors = data;
var adjustedHeight = monitors.length * 30;
if (adjustedHeight > $rootScope.devHeight) {
@@ -194,10 +194,10 @@ angular.module('zmApp.controllers').controller('zmApp.EventsGraphsCtrl', ['$ioni
"/events/index/MonitorId:" + monitors[j].Monitor.Id + dateString +
".json?page=1";
// console.log("Monitor event URL:" + url);
- ZMDataModel.zmLog("EventGraph: composed url is " + url);
+ NVRDataModel.log("EventGraph: composed url is " + url);
$http.get(url /*,{timeout:15000}*/ )
.success(function (data) {
- ZMDataModel.zmDebug("Event count for monitor" +
+ NVRDataModel.debug("Event count for monitor" +
monitors[j].Monitor.Id + " is " + data.pagination.count);
$scope.chart.data.datasets[0].data[j] = data.pagination.count;
})
@@ -206,7 +206,7 @@ angular.module('zmApp.controllers').controller('zmApp.EventsGraphsCtrl', ['$ioni
// but what I am really doing now is treating it like no events
// works but TBD: make this into a proper error handler
$scope.chart.data.datasets[0].data[j] = 0;
- ZMDataModel.zmLog("Error retrieving events for graph " + JSON.stringify(data), "error");
+ NVRDataModel.log("Error retrieving events for graph " + JSON.stringify(data), "error");
});
})(i); // j
} //for