summaryrefslogtreecommitdiff
path: root/www/js/MontageCtrl.js
diff options
context:
space:
mode:
authorPliablePixels <pliablepixels@gmail.com>2015-06-26 13:43:17 -0400
committerPliablePixels <pliablepixels@gmail.com>2015-06-26 13:43:17 -0400
commit544413f2d6de83e085d4489a1b9ccbaac3fa192d (patch)
treecd6a3d0ae439109adbe09de2fa524aaaa76c77e2 /www/js/MontageCtrl.js
parent0e83a778b541591ef468d7ebda1493a000a545e5 (diff)
I am now reading the PTZ DB to figure out the right "move" command for the cameras
Diffstat (limited to 'www/js/MontageCtrl.js')
-rw-r--r--www/js/MontageCtrl.js26
1 files changed, 24 insertions, 2 deletions
diff --git a/www/js/MontageCtrl.js b/www/js/MontageCtrl.js
index 2a8dce2f..bd2ab1ef 100644
--- a/www/js/MontageCtrl.js
+++ b/www/js/MontageCtrl.js
@@ -121,14 +121,36 @@ angular.module('zmApp.controllers').controller('zmApp.MontageCtrl', ['$scope', '
//---------------------------------------------------------------------
// main monitor modal open
//---------------------------------------------------------------------
- $scope.openModal = function (mid, controllable) {
- console.log("Open Monitor Modal");
+ $scope.openModal = function (mid, controllable, controlid) {
+ console.log("Open Monitor Modal with monitor Id=" + mid + " and Controllable:" + controllable + " with control ID:"+controlid);
// Note: no need to setAwake(true) as its already awake
// in montage view
$scope.monitorId = mid;
$scope.LoginData = ZMDataModel.getLogin();
$scope.rand = Math.floor(Math.random() * (999999 - 111111 + 1)) + 111111;
+ $scope.ptzMoveCommand = "";
+
+ // 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
+ ZMDataModel.setAwake(ZMDataModel.getKeepAwake());
+
+ // if its controllable, lets get the control command
+ if (controllable == '1')
+ {
+ var apiurl = $scope.LoginData.apiurl;
+ var myurl = apiurl+"/controls/"+controlid+".json";
+ console.log ("getting control details:"+myurl);
+
+ $http.get(myurl)
+ .success(function(data) {
+ $scope.ptzMoveCommand = (data.control.Control.CanMoveCon == '1')? 'moveCon':'move';
+ console.log("***moveCommand: " +$scope.ptzMoveCommand );
+ })
+ .error(function(data) {
+ console.log ("** Error retrieving move PTZ command");
+ });
+ }
// This is a modal to show the monitor footage
$ionicModal.fromTemplateUrl('templates/monitors-modal.html', {