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 | |
| parent | 1d0228ef8e388e011b58716ab6aebf812ab500ce (diff) | |
#530 - allow you to customize timer for montage cycle
| -rw-r--r-- | config.xml | 2 | ||||
| -rw-r--r-- | ionic.config.json | 6 | ||||
| -rw-r--r-- | www/js/MontageCtrl.js | 23 | ||||
| -rw-r--r-- | www/lang/locale-en.json | 1 | ||||
| -rw-r--r-- | www/templates/devoptions.html | 9 |
5 files changed, 36 insertions, 5 deletions
@@ -1,5 +1,5 @@ <?xml version='1.0' encoding='utf-8'?> -<widget android-packageName="com.pliablepixels.zmninja_pro" id="com.pliablepixels.zmninjapro" ios-CFBundleIdentifier="com.pliablepixels.zmninja-pro" version="1.2.42" xmlns="http://www.w3.org/ns/widgets" xmlns:cdv="http://cordova.apache.org/ns/1.0"> +<widget android-packageName="com.pliablepixels.zmninja_pro" id="com.pliablepixels.zmninjapro" ios-CFBundleIdentifier="com.pliablepixels.zmninja-pro" version="1.2.43" xmlns="http://www.w3.org/ns/widgets" xmlns:cdv="http://cordova.apache.org/ns/1.0"> <name>zmNinja</name> <description> High performance ZoneMinder client diff --git a/ionic.config.json b/ionic.config.json index 37856ace..85f26fa8 100644 --- a/ionic.config.json +++ b/ionic.config.json @@ -25,5 +25,9 @@ "!www/lib/**/*", "scss/**/*" ], - "type": "ionic-angular" + "type": "ionic-angular", + "integrations": { + "gulp": {}, + "cordova": {} + } } 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(); diff --git a/www/lang/locale-en.json b/www/lang/locale-en.json index 44481f5c..ffc5c5de 100644 --- a/www/lang/locale-en.json +++ b/www/lang/locale-en.json @@ -48,6 +48,7 @@ "kCustomRange" :"Custom Range", "kCycleMonitors" :"cycle monitors", "kCycleMonitorsInterval" :"monitor cycle interval", + "kCycleMontageInterval" :"montage cycle interval", "kDay" :"Day", "kDecreaseSize" :"decrease size", "kDelete" :"Delete", diff --git a/www/templates/devoptions.html b/www/templates/devoptions.html index bc950d81..db1f8887 100644 --- a/www/templates/devoptions.html +++ b/www/templates/devoptions.html @@ -148,6 +148,15 @@ <input type="tel" placeholder="" ng-model="loginData.cycleMonitorsInterval"> </label> </div> + + <div class="item item-text-wrap item-input-inset"> + {{'kCycleMontageInterval'|translate}}({{'kSec'|translate}}.) + <label class="item-input-wrapper"> + <input type="tel" placeholder="" ng-model="loginData.cycleMontageInterval"> + </label> + </div> + + <label> <ion-toggle ng-if="loginData.enableLogs" ng-model="loginData.enableDebug" ng-checked="{{loginData.enableDebug}}" toggle-class="toggle-calm"><span class="item-text-wrap">{{'kEnableDebug' | translate}}</span></ion-toggle> </label> |
