From 468b14fa8f0c5ce33f9f4e6787d19be5dd2a5123 Mon Sep 17 00:00:00 2001 From: Arjun Roychowdhury Date: Fri, 8 Jan 2016 07:12:19 +0530 Subject: #116 - initial code for preset suppport - still needs work Former-commit-id: e5fcac51dc6c4d836e7c78827b52ed3f3787afcf --- www/css/style.css | 8 ++++++++ www/js/ModalCtrl.js | 7 ++++++- www/js/MonitorCtrl.js | 12 ++++++++++++ www/templates/monitors-modal.html | 24 ++++++++++++++++++++++-- 4 files changed, 48 insertions(+), 3 deletions(-) (limited to 'www') diff --git a/www/css/style.css b/www/css/style.css index 4da670b0..bf6d0228 100644 --- a/www/css/style.css +++ b/www/css/style.css @@ -228,6 +228,14 @@ http://www.cssportal.com/tryit/index.php?file=blog/css-notification-badge */ transform: translate(-50%, -50%); } +.ptzpresetbuttons +{ + position: absolute; + top: 5%; + left: 50%; + transform: translate(-50%, -50%); +} + .timelinebuttons { position: fixed; /* or absolute */ diff --git a/www/js/ModalCtrl.js b/www/js/ModalCtrl.js index 1e3a8e80..185f71a4 100644 --- a/www/js/ModalCtrl.js +++ b/www/js/ModalCtrl.js @@ -268,7 +268,12 @@ angular.module('zmApp.controllers').controller('ModalCtrl', ['$scope', '$rootSco var intervalModalHandle; - +$scope.togglePresets = function() +{ + $scope.presetOn = !$scope.presetOn; + console.log ("Changing preset to " + $scope.presetOn); +}; + //------------------------------------------------------------- // Send PTZ command to ZM // Note: PTZ fails on desktop, don't bother about it diff --git a/www/js/MonitorCtrl.js b/www/js/MonitorCtrl.js index 7fcb8dac..b5f5a47e 100644 --- a/www/js/MonitorCtrl.js +++ b/www/js/MonitorCtrl.js @@ -295,6 +295,7 @@ angular.module('zmApp.controllers') $rootScope.rand = Math.floor(Math.random() * (999999 - 111111 + 1)) + 111111; $scope.ptzMoveCommand = ""; + $scope.presetOn = false; // This is a modal to show the monitor footage @@ -329,6 +330,17 @@ angular.module('zmApp.controllers') $scope.ptzStopCommand = "moveStop"; } + // presets + ZMDataModel.zmDebug ("Preset value is " +data.control.Control.HasPresets); + + if (data.control.Control.HasPresets == '1') + { + $scope.ptzPresetCount = parseInt(data.control.Control.NumPresets); + $scope.ptzPresetCount = 13; + ZMDataModel.zmDebug ("Number of presets is " + $scope.ptzPresetCount); + $scope.ptzPresets = new Array($scope.ptzPresetCount); + + } console.log("***moveCommand: " + $scope.ptzMoveCommand); diff --git a/www/templates/monitors-modal.html b/www/templates/monitors-modal.html index 5b2e374d..f2323282 100644 --- a/www/templates/monitors-modal.html +++ b/www/templates/monitors-modal.html @@ -48,11 +48,31 @@
+
+ +
+
+
+
+ + + + +
+
+ +
+
+ +
+ + presets
- - -- cgit v1.2.3