summaryrefslogtreecommitdiff
path: root/www/js
diff options
context:
space:
mode:
authorArjun Roychowdhury <pliablepixels@gmail.com>2015-12-25 08:50:11 -0500
committerArjun Roychowdhury <pliablepixels@gmail.com>2015-12-25 08:50:11 -0500
commitcff53cddf9febd9b9e3a4bb2a0393b8cae2c2f67 (patch)
tree3c7a76e2084d840135a2136f4e33a978deae8a2c /www/js
parent4615dcb2c2eaaca8e151cb3cd32f75c551e88db3 (diff)
#123 - developer options now has a stream via nph-zms mode
Former-commit-id: 9d9e1b55e2f2b6c32748ae3ceded703b2cc5020f
Diffstat (limited to 'www/js')
-rw-r--r--www/js/DataModel.js10
-rw-r--r--www/js/ModalCtrl.js41
2 files changed, 39 insertions, 12 deletions
diff --git a/www/js/DataModel.js b/www/js/DataModel.js
index ebd95b10..a6b491c8 100644
--- a/www/js/DataModel.js
+++ b/www/js/DataModel.js
@@ -61,6 +61,7 @@ angular.module('zmApp.controllers')
'graphSize':200,
'minAlarmCount':'1',
'montageSize':'10',
+ 'useNphZms':false,
};
@@ -216,10 +217,15 @@ angular.module('zmApp.controllers')
if (typeof loginData.montageSize == 'undefined')
{
- zmDebug ("montageSize does not exist, setting to 18 (2 per col)");
- loginData.montageSize = 18;
+ zmDebug ("montageSize does not exist, setting to 2 (2 per col)");
+ loginData.montageSize = 2;
}
+ if (typeof loginData.useNphZms == 'undefined')
+ {
+ zmDebug ("useNphZms does not exist. Setting to false");
+ loginData.useNphZms = false;
+ }
zmLog ("DataModel init recovered this loginData as " + JSON.stringify(loginData));
}
diff --git a/www/js/ModalCtrl.js b/www/js/ModalCtrl.js
index f92c6474..5093f100 100644
--- a/www/js/ModalCtrl.js
+++ b/www/js/ModalCtrl.js
@@ -45,6 +45,11 @@ angular.module('zmApp.controllers').controller('ModalCtrl', ['$scope', '$rootSco
showDelay: 0
});
var ld = ZMDataModel.getLogin();
+
+ $scope.streamMode = ld.useNphZms ? "jpeg":"single";
+ ZMDataModel.zmDebug ("Setting playback to " + $scope.streamMode);
+
+
$rootScope.validMonitorId = $scope.monitors[0].Monitor.Id;
ZMDataModel.getAuthKey($rootScope.validMonitorId)
.then(function (success) {
@@ -197,12 +202,20 @@ angular.module('zmApp.controllers').controller('ModalCtrl', ['$scope', '$rootSco
$interval.cancel(intervalModalHandle);
- intervalModalHandle = $interval(function () {
- loadModalNotifications();
- // console.log ("Refreshing Image...");
- }.bind(this), ld.refreshSec * 1000);
+
+ if (ld.useNphZms == false )
+ {
+ intervalModalHandle = $interval(function () {
+ loadModalNotifications();
+ // console.log ("Refreshing Image...");
+ }.bind(this), ld.refreshSec * 1000);
- loadModalNotifications();
+ loadModalNotifications();
+ }
+ else
+ {
+ ZMDataModel.zmLog("Using nph-zms, no timer needed");
+ }
@@ -222,11 +235,19 @@ angular.module('zmApp.controllers').controller('ModalCtrl', ['$scope', '$rootSco
ZMDataModel.zmLog("ModalCtrl: Restarting Modal timer on resume");
$interval.cancel(intervalModalHandle);
- intervalModalHandle = $interval(function () {
- loadModalNotifications();
- // console.log ("Refreshing Image...");
- }.bind(this), ld.refreshSec * 1000);
-
+
+ var ld = ZMDataModel.getLogin();
+ if (ld.useNphZms == false)
+ {
+ intervalModalHandle = $interval(function () {
+ loadModalNotifications();
+ // console.log ("Refreshing Image...");
+ }.bind(this), ld.refreshSec * 1000);
+ }
+ else
+ {
+ ZMDataModel.zmLog("using nph - no timers needed");
+ }
$rootScope.modalRand = Math.floor((Math.random() * 100000) + 1);