diff options
| author | Pliable Pixels <pliablepixels@gmail.com> | 2017-08-24 12:33:18 -0400 |
|---|---|---|
| committer | Pliable Pixels <pliablepixels@gmail.com> | 2017-08-24 12:33:18 -0400 |
| commit | 66ee9fe3e85e10c9201659b9ae9b3032592f9a79 (patch) | |
| tree | 546a034bfd1ee494c551f30f623472b1ca094359 /www/js | |
| parent | 1d0228ef8e388e011b58716ab6aebf812ab500ce (diff) | |
#530 - allow you to customize timer for montage cycle
Diffstat (limited to 'www/js')
| -rw-r--r-- | www/js/MontageCtrl.js | 23 |
1 files changed, 20 insertions, 3 deletions
diff --git a/www/js/MontageCtrl.js b/www/js/MontageCtrl.js index d1185a8c..e2e26c00 100644 --- a/www/js/MontageCtrl.js +++ b/www/js/MontageCtrl.js @@ -365,8 +365,22 @@ angular.module('zmApp.controllers') function findNext (key,obj) { + console.log (" key is: "+ key); + console.log ("array is " + JSON.stringify (obj)); var keys = Object.keys(obj); - return keys[(keys.indexOf(key) + 1) % keys.length]; + + var len = keys.length; + var curindex = keys.indexOf(key); + var modulus = (curindex + 1) % len; + + console.log ("*********** len="+len+" curr="+curindex+" next="+modulus); + + //console.log ("Keys array "+ JSON.stringify(keys)); + + //console.log ("Current index: "+ keys.indexOf(key) ); + //console.log ("returning index of " + (keys.indexOf(key) + 1) % (keys.length)); + // console.log ("keys length is "+ keys.length); + return keys[modulus]; /* var size = Object.keys(obj).length; var i; @@ -503,7 +517,7 @@ angular.module('zmApp.controllers') function randEachTime() { $scope.randToAvoidCacheMem = new Date().getTime(); //$scope.randToAvoidCacheMem = "1"; - console.log ("Generating:"+$scope.randToAvoidCacheMem); + //console.log ("Generating:"+$scope.randToAvoidCacheMem); } //----------------------------------------------------------------------- @@ -514,7 +528,7 @@ angular.module('zmApp.controllers') { randEachTime(); - console.log ($scope.randToAvoidCacheMem); + //console.log ($scope.randToAvoidCacheMem); if ($scope.areImagesLoading) { @@ -612,6 +626,8 @@ angular.module('zmApp.controllers') ld.cycleMontageProfiles = !ld.cycleMontageProfiles; NVRDataModel.setLogin(ld); NVRDataModel.debug ("cycle="+ld.cycleMontageProfiles); + NVRDataModel.debug ("cycle interval="+ld.cycleMontageInterval); + }; @@ -1607,6 +1623,7 @@ angular.module('zmApp.controllers') // console.log ("Refreshing Image..."); }.bind(this), refreshSec * 1000); + NVRDataModel.debug ("Setting up cycle interval of:"+ NVRDataModel.getLogin().cycleMontageInterval* 1000); intervalHandleMontageCycle = $interval(function() { cycleMontageProfiles(); |
