diff options
| author | PliablePixels <pliablepixels@gmail.com> | 2015-06-04 11:31:09 -0400 |
|---|---|---|
| committer | PliablePixels <pliablepixels@gmail.com> | 2015-06-04 11:31:09 -0400 |
| commit | c76e9d5c78e0cd48f938218dc97fb67e7bcac51d (patch) | |
| tree | 78832a6e30e9c41b48e51bf9b4690884d5c67f9d /www/js | |
| parent | 21bc78c65d0a8b852e88f3e464b4d6fcf2bc96fd (diff) | |
Created new screen for developer options, removed simulation mode (its practically useless)
Diffstat (limited to 'www/js')
| -rw-r--r-- | www/js/DataModel.js | 24 | ||||
| -rw-r--r-- | www/js/DevOptionsCtrl.js | 36 | ||||
| -rw-r--r-- | www/js/MonitorModalCtrl.js | 11 | ||||
| -rw-r--r-- | www/js/app.js | 12 |
4 files changed, 80 insertions, 3 deletions
diff --git a/www/js/DataModel.js b/www/js/DataModel.js index cbb3e74d..b9ede609 100644 --- a/www/js/DataModel.js +++ b/www/js/DataModel.js @@ -20,9 +20,10 @@ angular.module('zmApp.controllers').service('ZMDataModel', ['$http', '$q', '$ion 'password': '', 'url': '', // This is the ZM portal path 'apiurl': '', // This is the API path - 'simulationMode': false, // if true, data will be simulated + 'simulationMode': false, // if true, data will be simulated. Not using this now 'maxMontage': "10", //total # of monitors to display in montage - 'streamingurl': "" + 'streamingurl': "", + 'maxFPS':"3" // image streaming FPS }; // This is really a test mode. This is how I am validating @@ -157,6 +158,15 @@ angular.module('zmApp.controllers').service('ZMDataModel', ['$http', '$q', '$ion } + if (window.localStorage.getItem("maxFPS") != undefined) { + loginData.maxFPS = + window.localStorage.getItem("maxFPS"); + console.log("maxFPS " + loginData.maxFPS); + + } + + + monitorsLoaded = 0; console.log("Getting out of ZMDataModel init"); @@ -182,6 +192,7 @@ angular.module('zmApp.controllers').service('ZMDataModel', ['$http', '$q', '$ion }, setLogin: function (newLogin) { loginData = newLogin; + window.localStorage.setItem("username", loginData.username); window.localStorage.setItem("password", loginData.password); window.localStorage.setItem("url", loginData.url); @@ -189,6 +200,13 @@ angular.module('zmApp.controllers').service('ZMDataModel', ['$http', '$q', '$ion window.localStorage.setItem("simulationMode", loginData.simulationMode); window.localStorage.setItem("streamingurl", loginData.streamingurl); + if (loginData.maxFPS >30) + { + console.log ("MAXFPS Too high, maxing to 30"); + loginData.maxFPS = "30"; + } + window.localStorage.setItem("maxFPS", loginData.maxFPS); + if (!loginData.maxMontage) { @@ -197,7 +215,7 @@ angular.module('zmApp.controllers').service('ZMDataModel', ['$http', '$q', '$ion } if (parseInt(loginData.maxMontage) <= 0) { - console.log("*** TOO LOW ***"); + console.log("*** MAXMONTAGE TOO LOW ***"); loginData.maxMontage = 1; } diff --git a/www/js/DevOptionsCtrl.js b/www/js/DevOptionsCtrl.js new file mode 100644 index 00000000..9bb5a759 --- /dev/null +++ b/www/js/DevOptionsCtrl.js @@ -0,0 +1,36 @@ +/* jshint -W041 */ +/* jslint browser: true*/ +/* global cordova,StatusBar,angular,console */ + +angular.module('zmApp.controllers').controller('zmApp.DevOptionsCtrl', ['$scope', '$rootScope', '$ionicModal', 'ZMDataModel', '$ionicSideMenuDelegate', '$ionicPopup', '$http', '$q', '$ionicLoading', function ($scope, $rootScope, $ionicModal, ZMDataModel, $ionicSideMenuDelegate, $ionicPopup, $http, $q, $ionicLoading) { + $scope.openMenu = function () { + $ionicSideMenuDelegate.toggleLeft(); + }; + + $scope.loginData = ZMDataModel.getLogin(); + + + + // Perform the login action when the user submits the login form + $scope.saveDevOptions = function () { + console.log('Saving Dev Options'); + + if (parseInt($scope.loginData.maxMontage) > 10) { + $ionicPopup.alert({ + title: 'Note', + template: 'You have selected to view more than 10 monitors in the Montage screen. Note that this is very resource intensive and may load the server or cause issues in the application. If you are not sure, please consider limiting this value to 10' + }); + } + + + if ((parseInt($scope.loginData.maxFPS) <0) || (parseInt($scope.loginData.maxFPS)>30)) + { + $scope.loginData.maxFPS='3'; + } + + + ZMDataModel.setLogin($scope.loginData); + }; + + +}]); diff --git a/www/js/MonitorModalCtrl.js b/www/js/MonitorModalCtrl.js new file mode 100644 index 00000000..11306e4c --- /dev/null +++ b/www/js/MonitorModalCtrl.js @@ -0,0 +1,11 @@ +/* jshint -W041 */ +/* jslint browser: true*/ +/* global cordova,StatusBar,angular,console */ + +// controller for Modal Monitor View + +angular.module('zmApp.controllers').controller('zmApp.MonitorModalCtrl', ['$ionicPopup', '$scope', 'ZMDataModel', '$ionicSideMenuDelegate', '$ionicLoading', '$ionicModal', '$state', '$http', function ($ionicPopup,$scope, ZMDataModel, $ionicSideMenuDelegate, $ionicLoading, $ionicModal, $state, $http, $rootScope) { + + + +}]); diff --git a/www/js/app.js b/www/js/app.js index b541128c..7832a7bf 100644 --- a/www/js/app.js +++ b/www/js/app.js @@ -308,6 +308,18 @@ angular.module('zmApp', [ controller: 'zmApp.StateCtrl', }) + + .state('devoptions', { + data: { + requireLogin: true + }, + url: "/devoptions", + templateUrl: "templates/devoptions.html", + controller: 'zmApp.DevOptionsCtrl', + }) + + + .state('montage', { data: { requireLogin: true |
