diff options
| author | pliablepixels <pliablepixels@gmail.com> | 2016-04-15 11:54:13 -0400 |
|---|---|---|
| committer | pliablepixels <pliablepixels@gmail.com> | 2016-04-15 11:54:13 -0400 |
| commit | 8fccabcec0f0d0d13ae1bc6b9032f15cfe621914 (patch) | |
| tree | 5dd4d283de41fb1511ce3aa5e64ba314769a6d0d /www | |
| parent | d20c33f7cbdc4d0e4b51d2e318616a3b5f1f7150 (diff) | |
#224 - initial code for zoom support
Former-commit-id: 7b81646df0bef3a3dab87868485d54aed1953b39
Diffstat (limited to 'www')
| -rw-r--r-- | www/js/MonitorCtrl.js | 27 | ||||
| -rw-r--r-- | www/js/MontageCtrl.js | 29 | ||||
| -rw-r--r-- | www/templates/monitors-modal.html | 7 |
3 files changed, 62 insertions, 1 deletions
diff --git a/www/js/MonitorCtrl.js b/www/js/MonitorCtrl.js index 013c9e79..2c918fb7 100644 --- a/www/js/MonitorCtrl.js +++ b/www/js/MonitorCtrl.js @@ -302,7 +302,10 @@ angular.module('zmApp.controllers') $scope.ptzMoveCommand = ""; $scope.presetOn = false; - + $scope.zoomInCommand = ""; + $scope.zoomOutCommand = ""; + $scope.zoomStopCommand = "zoomStop"; + $scope.canZoom = false; // This is a modal to show the monitor footage @@ -321,6 +324,28 @@ angular.module('zmApp.controllers') $scope.ptzMoveCommand = "move"; // start with as move; $scope.ptzStopCommand = ""; + + if (data.control.Control.CanZoom=='1') + { + $scope.canZoom = true; + if (data.control.Control.CanZoomCon == '1') + { + $scope.zoomInCommand = "zoomConTele"; + $scope.zoomOutCommand = "zoomConWide"; + + } + else if (data.control.Control.CanZoomRel == '1') + { + $scope.zoomInCommand = "zoomRelTele"; + $scope.zoomOutCommand = "zoomRelWide"; + } + + else if (data.control.Control.CanZoomAbs == '1') + { + $scope.zoomInCommand = "zoomRelAbs"; + $scope.zoomOutCommand = "zoomRelAbs"; + } + } ZMDataModel.zmDebug ("control PTZ details are " + JSON.stringify(data)); diff --git a/www/js/MontageCtrl.js b/www/js/MontageCtrl.js index eb4358e5..7563da8e 100644 --- a/www/js/MontageCtrl.js +++ b/www/js/MontageCtrl.js @@ -651,7 +651,14 @@ function initPackery() $rootScope.modalRand = Math.floor(Math.random() * (999999 - 111111 + 1)) + 111111; $scope.ptzMoveCommand = ""; $scope.ptzStopCommand = ""; + + $scope.zoomInCommand = ""; + $scope.zoomOutCommand = ""; + $scope.zoomStopCommand = "zoomStop"; + $scope.canZoom = false; + $scope.presetOn = false; + $scope.connKey = (Math.floor((Math.random() * 999999) + 1)).toString(); // This is a modal to show the monitor footage @@ -670,6 +677,28 @@ function initPackery() $scope.ptzMoveCommand = "move"; // start with as move; $scope.ptzStopCommand = ""; + + if (data.control.Control.CanZoom=='1') + { + $scope.canZoom = true; + if (data.control.Control.CanZoomCon == '1') + { + $scope.zoomInCommand = "zoomConTele"; + $scope.zoomOutCommand = "zoomConWide"; + + } + else if (data.control.Control.CanZoomRel == '1') + { + $scope.zoomInCommand = "zoomRelTele"; + $scope.zoomOutCommand = "zoomRelWide"; + } + + else if (data.control.Control.CanZoomAbs == '1') + { + $scope.zoomInCommand = "zoomRelAbs"; + $scope.zoomOutCommand = "zoomRelAbs"; + } + } ZMDataModel.zmDebug("MontageCtrl: control data returned " + JSON.stringify(data)); diff --git a/www/templates/monitors-modal.html b/www/templates/monitors-modal.html index c62155db..2b20562d 100644 --- a/www/templates/monitors-modal.html +++ b/www/templates/monitors-modal.html @@ -52,6 +52,13 @@ <div class="ptzcenteredbutton"> + <div ng-if="canZoom"> + <a class="button button-small button-positive" href="" ng-click="controlPTZ(monitorId, zoomInCommand);">zoom in</a> + <a class="button button-small icon button-positive" href="" ng-click="controlPTZ(monitorId, zoomOutCommand);">zoom out</a> + <a class="button button-small icon button-positive" href="" ng-click="controlPTZ(monitorId, zoomStopCommand);">zoom stop</a> + + </div> + <br/> <a class="button button-small icon ion-stop button-assertive" href="" ng-click="controlPTZ(monitorId, ptzStopCommand);"></a> <a class="button button-small button-royal" href="" ng-click="togglePresets();">presets</a> </div> |
