summaryrefslogtreecommitdiff
path: root/www
diff options
context:
space:
mode:
Diffstat (limited to 'www')
-rw-r--r--www/js/DataModel.js10
-rw-r--r--www/js/ModalCtrl.js41
-rw-r--r--www/templates/devoptions.html7
-rw-r--r--www/templates/monitors-modal.html2
4 files changed, 47 insertions, 13 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);
diff --git a/www/templates/devoptions.html b/www/templates/devoptions.html
index ffab7fc9..b859b275 100644
--- a/www/templates/devoptions.html
+++ b/www/templates/devoptions.html
@@ -24,6 +24,13 @@
</label>
</div>
+
+ <label>
+ <ion-toggle ng-model="loginData.useNphZms"
+ ng-checked="{{loginData.useNphZms}}"
+ toggle-class="toggle-calm">use ZMS for single stream</ion-toggle>
+ </label>
+
<div class="item item-input-inset">
Max monitors in montage&nbsp;
<label class="item-input-wrapper">
diff --git a/www/templates/monitors-modal.html b/www/templates/monitors-modal.html
index 1e5ae3cb..5b2e374d 100644
--- a/www/templates/monitors-modal.html
+++ b/www/templates/monitors-modal.html
@@ -20,7 +20,7 @@
<div ng-if="!animationInProgress" >
<img style="width:100vw; height:100vh" imageonload="finishedLoadingImage()"
image-spinner-loader="lines"
- image-spinner-src="{{LoginData.streamingurl}}/nph-zms?mode=single&monitor={{monitorId}}{{$root.authSession}}&rand={{$root.modalRand}}" ng-class="{'object-fit_cover':imageFit==false, 'object-fit_contain':imageFit==true}"
+ image-spinner-src="{{LoginData.streamingurl}}/nph-zms?mode={{streamMode}}&monitor={{monitorId}}{{$root.authSession}}&rand={{$root.modalRand}}" ng-class="{'object-fit_cover':imageFit==false, 'object-fit_contain':imageFit==true}"
on-swipe-left="onSwipe(monitorId,1)"
on-swipe-right="onSwipe(monitorId,-1)" />