summaryrefslogtreecommitdiff
path: root/www/js/MontageCtrl.js
diff options
context:
space:
mode:
authorArjun Roychowdhury <pliablepixels@gmail.com>2016-01-08 14:59:58 +0530
committerArjun Roychowdhury <pliablepixels@gmail.com>2016-01-08 14:59:58 +0530
commitcc9738b412d00436a7a16c6dbe853e55d97aec8a (patch)
tree4f17b16288a3948fa91a36df098a61081abba4d8 /www/js/MontageCtrl.js
parent468b14fa8f0c5ce33f9f4e6787d19be5dd2a5123 (diff)
#116 - presets seems to be working - needs more testing
Former-commit-id: 427b83929240d67fa5c26b9e49cbf0629ecf0f69
Diffstat (limited to 'www/js/MontageCtrl.js')
-rw-r--r--www/js/MontageCtrl.js30
1 files changed, 30 insertions, 0 deletions
diff --git a/www/js/MontageCtrl.js b/www/js/MontageCtrl.js
index d3a0928a..e5f42a00 100644
--- a/www/js/MontageCtrl.js
+++ b/www/js/MontageCtrl.js
@@ -557,6 +557,7 @@ angular.module('zmApp.controllers').controller('zmApp.MontageCtrl', ['$scope', '
$rootScope.modalRand = Math.floor(Math.random() * (999999 - 111111 + 1)) + 111111;
$scope.ptzMoveCommand = "";
$scope.ptzStopCommand = "";
+ $scope.presetOn = false;
// This is a modal to show the monitor footage
// We need to switch to always awake if set so the feed doesn't get interrupted
@@ -575,6 +576,35 @@ angular.module('zmApp.controllers').controller('zmApp.MontageCtrl', ['$scope', '
$scope.ptzMoveCommand = (data.control.Control.CanMoveCon == '1') ? 'moveCon' : 'move';
$scope.ptzStopCommand = "moveStop";
console.log("***moveCommand: " + $scope.ptzMoveCommand);
+
+
+ // presets
+ ZMDataModel.zmDebug ("Preset value is " +data.control.Control.HasPresets);
+
+ if (data.control.Control.HasPresets == '1')
+ {
+ $scope.ptzPresetCount = parseInt(data.control.Control.NumPresets);
+
+ ZMDataModel.zmDebug ("Number of presets is " + $scope.ptzPresetCount);
+
+ $scope.ptzPresets = [];
+ for (var p=0; p<$scope.ptzPresetCount; p++)
+ {
+ $scope.ptzPresets.push ({name:(p+1).toString(), icon:'', cmd:"presetGoto"+(p+1).toString()});
+ // $scope.ptzPresets[p].name = "Arjun " + p;
+ // console.log ("Name to " + $scope.ptzPresets[p].name);
+ }
+
+ if (data.control.Control.HasHomePreset == '1')
+ {
+ $scope.ptzPresets.unshift({name:'', icon:"ion-ios-home", cmd:'presetHome'});
+
+ $scope.ptzPresetCount++;
+ }
+
+ }
+
+
ZMDataModel.zmLog("ControlDB reports PTZ command to be " + $scope.ptzMoveCommand);
})
.error(function (data) {