diff options
| author | PliablePixels <pliablepixels@gmail.com> | 2015-09-10 08:20:44 +0100 |
|---|---|---|
| committer | PliablePixels <pliablepixels@gmail.com> | 2015-09-10 08:20:44 +0100 |
| commit | f2ef2c5d4eac539db86a5f0dbacad9e1bd205ba5 (patch) | |
| tree | 97885710659426fdd1d883d3f3b2d400ac64e4c9 /www/js | |
| parent | a1de1fd608ce07949a18a5b2089e5b5cf81364b2 (diff) | |
You can now modify frame change delay - to take control in spotty/slow network conditions
Diffstat (limited to 'www/js')
| -rw-r--r-- | www/js/DataModel.js | 18 | ||||
| -rw-r--r-- | www/js/DevOptionsCtrl.js | 5 | ||||
| -rw-r--r-- | www/js/ModalCtrl.js | 5 | ||||
| -rw-r--r-- | www/js/MontageCtrl.js | 12 |
4 files changed, 32 insertions, 8 deletions
diff --git a/www/js/DataModel.js b/www/js/DataModel.js index 2068b497..25fd0aed 100644 --- a/www/js/DataModel.js +++ b/www/js/DataModel.js @@ -25,7 +25,8 @@ angular.module('zmApp.controllers').service('ZMDataModel', ['$http', '$q', '$ion 'montageQuality': "50", // montage streaming quality in % 'useSSL':false, // "1" if HTTPS 'keepAwake':true, // don't dim/dim during live view - 'isUseAuth':true // true if user wants ZM auth + 'isUseAuth':true, // true if user wants ZM auth + 'refreshSec':"1", // timer value for frame change in sec }; var configParams = { 'ZM_EVENT_IMAGE_DIGITS':'-1' @@ -105,6 +106,17 @@ angular.module('zmApp.controllers').service('ZMDataModel', ['$http', '$q', '$ion window.localStorage.getItem("username"); } + + + if (window.localStorage.getItem("refreshSec") != undefined) { + loginData.refreshSec = + parseInt(window.localStorage.getItem("refreshSec")); + zmLog ("Refresh in seconds is " + loginData.refreshSec); + + } + else{ + zmLog ("Refresh is not defined, using " + loginData.refreshSec); + } if (window.localStorage.getItem("montageQuality") != undefined) { @@ -244,6 +256,7 @@ angular.module('zmApp.controllers').service('ZMDataModel', ['$http', '$q', '$ion setLogin: function (newLogin) { loginData = newLogin; zmLog("Saving all parameters to storage"); + window.localStorage.setItem("username", loginData.username); window.localStorage.setItem("password", loginData.password); window.localStorage.setItem("url", loginData.url); @@ -253,6 +266,9 @@ angular.module('zmApp.controllers').service('ZMDataModel', ['$http', '$q', '$ion window.localStorage.setItem("keepAwake", loginData.keepAwake?"1":"0"); window.localStorage.setItem("maxMontage", loginData.maxMontage); window.localStorage.setItem("montageQuality", loginData.montageQuality); + window.localStorage.setItem("refreshSec", loginData.refreshSec); + + window.localStorage.setItem("isUseAuth", loginData.isUseAuth); console.log ("***** SETTING ISUSEAUTH TO " + loginData.isUseAuth); diff --git a/www/js/DevOptionsCtrl.js b/www/js/DevOptionsCtrl.js index 9396ecfa..1a857cda 100644 --- a/www/js/DevOptionsCtrl.js +++ b/www/js/DevOptionsCtrl.js @@ -38,6 +38,11 @@ angular.module('zmApp.controllers').controller('zmApp.DevOptionsCtrl', ['$scope' if ((parseInt($scope.loginData.maxFPS) < 0) || (parseInt($scope.loginData.maxFPS) > zm.maxFPS)) { $scope.loginData.maxFPS = zm.defaultFPS.toString(); } + + if (parseInt($scope.loginData.refeshSec) <=0) + { + $scope.loginData.refreshSec=1; + } if ((parseInt($scope.loginData.montageQuality) < zm.safeMontageLimit) || (parseInt($scope.loginData.montageQuality) > 70)) { diff --git a/www/js/ModalCtrl.js b/www/js/ModalCtrl.js index 3cb2787d..64fdc523 100644 --- a/www/js/ModalCtrl.js +++ b/www/js/ModalCtrl.js @@ -172,11 +172,12 @@ angular.module('zmApp.controllers').controller('ModalCtrl', ['$scope', '$rootSco }, ]}; + $interval.cancel(intervalModalHandle); intervalModalHandle= $interval(function () { loadModalNotifications(); // console.log ("Refreshing Image..."); - }.bind(this), 1000); + }.bind(this), ld.refreshSec * 1000); loadModalNotifications(); @@ -202,7 +203,7 @@ angular.module('zmApp.controllers').controller('ModalCtrl', ['$scope', '$rootSco intervalModalHandle= $interval(function () { loadModalNotifications(); // console.log ("Refreshing Image..."); - }.bind(this), 1000); + }.bind(this), ld.refreshSec*1000); $rootScope.modalRand = Math.floor((Math.random() * 100000) + 1); diff --git a/www/js/MontageCtrl.js b/www/js/MontageCtrl.js index 26e5af6b..3e25ba5a 100644 --- a/www/js/MontageCtrl.js +++ b/www/js/MontageCtrl.js @@ -205,7 +205,7 @@ angular.module('zmApp.controllers').controller('zmApp.MontageCtrl', ['$scope', ' function loadNotifications() { $rootScope.rand = Math.floor((Math.random() * 100000) + 1); - // console.log ("Inside Montage timer..."); + console.log ("Inside Montage timer..."); } @@ -532,12 +532,12 @@ angular.module('zmApp.controllers').controller('zmApp.MontageCtrl', ['$scope', ' $scope.isModalActive = false; ZMDataModel.zmLog("Restarting montage timer, closing Modal..."); - + var ld = ZMDataModel.getLogin(); $interval.cancel(intervalHandle); intervalHandle= $interval(function () { loadNotifications(); // console.log ("Refreshing Image..."); - }.bind(this), 1000); + }.bind(this), ld.refreshSec*1000); //$interval.cancel(modalIntervalHandle); @@ -618,13 +618,14 @@ angular.module('zmApp.controllers').controller('zmApp.MontageCtrl', ['$scope', ' { if (!$scope.isModalActive) { + var ld = ZMDataModel.getLogin(); ZMDataModel.zmLog ("Restarting montage timer on resume"); $rootScope.rand = Math.floor((Math.random() * 100000) + 1); $interval.cancel(intervalHandle); intervalHandle= $interval(function () { loadNotifications(); // console.log ("Refreshing Image..."); - }.bind(this), 1000); + }.bind(this), ld.refreshSec*1000); } else // modal is active { @@ -656,6 +657,7 @@ angular.module('zmApp.controllers').controller('zmApp.MontageCtrl', ['$scope', ' $scope.$on('$ionicView.enter', function () { console.log("**VIEW ** Montage Ctrl Entered, Starting loadNotifications"); + var ld = ZMDataModel.getLogin(); console.log("Setting Awake to " + ZMDataModel.getKeepAwake()); ZMDataModel.setAwake(ZMDataModel.getKeepAwake()); @@ -663,7 +665,7 @@ angular.module('zmApp.controllers').controller('zmApp.MontageCtrl', ['$scope', ' intervalHandle= $interval(function () { loadNotifications(); // console.log ("Refreshing Image..."); - }.bind(this), 1000); + }.bind(this), ld.refreshSec*1000); loadNotifications(); }); |
