summaryrefslogtreecommitdiff
path: root/www/js
diff options
context:
space:
mode:
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);