From c76e9d5c78e0cd48f938218dc97fb67e7bcac51d Mon Sep 17 00:00:00 2001 From: PliablePixels Date: Thu, 4 Jun 2015 11:31:09 -0400 Subject: Created new screen for developer options, removed simulation mode (its practically useless) --- www/index.html | 9 ++++++++- www/js/DataModel.js | 24 +++++++++++++++++++++--- www/js/DevOptionsCtrl.js | 36 ++++++++++++++++++++++++++++++++++++ www/js/MonitorModalCtrl.js | 11 +++++++++++ www/js/app.js | 12 ++++++++++++ www/templates/devoptions.html | 39 +++++++++++++++++++++++++++++++++++++++ www/templates/events-modal.html | 2 +- www/templates/help.html | 10 ---------- www/templates/login.html | 13 ------------- www/templates/monitors-modal.html | 2 +- 10 files changed, 129 insertions(+), 29 deletions(-) create mode 100644 www/js/DevOptionsCtrl.js create mode 100644 www/js/MonitorModalCtrl.js create mode 100644 www/templates/devoptions.html diff --git a/www/index.html b/www/index.html index cb4d9677..f5c9e47e 100644 --- a/www/index.html +++ b/www/index.html @@ -49,6 +49,7 @@ + @@ -114,7 +115,13 @@ - Settings + ZM Settings + + + + + + Developer Settings 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 diff --git a/www/templates/devoptions.html b/www/templates/devoptions.html new file mode 100644 index 00000000..95c6d4e3 --- /dev/null +++ b/www/templates/devoptions.html @@ -0,0 +1,39 @@ + + + + + + + + +
+ + Developer Options + + + +
+ + Max Monitors in Montage  + + +
+ +
+ + Max FPS for streaming  + + +
+ + + + + + + + diff --git a/www/templates/events-modal.html b/www/templates/events-modal.html index 4cb76867..ca73ae9c 100644 --- a/www/templates/events-modal.html +++ b/www/templates/events-modal.html @@ -16,7 +16,7 @@
- + diff --git a/www/templates/help.html b/www/templates/help.html index c2c43947..55d22d9e 100644 --- a/www/templates/help.html +++ b/www/templates/help.html @@ -43,16 +43,6 @@ should be reloaded. - -

What is this simulator mode?

- It was really a way for me to test how the app behaves when there are 1000s of events and many monitors. - Practically, you won't have a need for it -
- - -

When I switch between Simulator to Real mode, the data does not change

- Pull to refresh. -

I want to contribute!

diff --git a/www/templates/login.html b/www/templates/login.html index d5537641..3c074c99 100644 --- a/www/templates/login.html +++ b/www/templates/login.html @@ -27,19 +27,6 @@
- Developer Options - Simulation Mode -
- Max Monitors in Montage  - - - - -
- - diff --git a/www/templates/monitors-modal.html b/www/templates/monitors-modal.html index f21beae4..23562a7a 100644 --- a/www/templates/monitors-modal.html +++ b/www/templates/monitors-modal.html @@ -17,7 +17,7 @@
- + -- cgit v1.2.3