Skip to content

Commit

Permalink
#1067 don't allow profile switching of montage when a ZM group is active
Browse files Browse the repository at this point in the history
  • Loading branch information
pliablepixels committed May 25, 2021
1 parent 4713bb6 commit 09ffc96
Show file tree
Hide file tree
Showing 2 changed files with 22 additions and 5 deletions.
26 changes: 21 additions & 5 deletions www/js/MontageCtrl.js
Original file line number Diff line number Diff line change
Expand Up @@ -1075,17 +1075,20 @@ angular.module('zmApp.controllers')
}

$scope.MontageMonitors[iz].Monitor.listDisplay = isShow? 'show':'noshow';
NVR.debug ('Group:'+$scope.currentZMGroupName+' setting '+$scope.MontageMonitors[iz].Monitor.Name +' to '+ $scope.MontageMonitors[iz].Monitor.listDisplay);

// console.log ('----> Setting '+ $scope.MontageMonitors[i].Monitor.Name+' to '+ $scope.MontageMonitors[i].Monitor.listDisplay);


}

$scope.monitors = $scope.MontageMonitors;
NVR.setMonitors($scope.MontageMonitors);
ld.packeryPositions = undefined;
NVR.setLogin(ld)
.then (function() {
var ps = NVR.getLogin().packeryPositions;
var p = parsePositions(ps);
matchMonitorsToPositions(p);
//var p = parsePositions(ps);
//matchMonitorsToPositions(p);
initPackery().then (function () {
NVR.debug ("initPackery over, storing positions");
var positions = pckry.getShiftPositions('data-item-id');
Expand Down Expand Up @@ -1972,9 +1975,21 @@ angular.module('zmApp.controllers')
}
// switch to another montage profile
$scope.switchMontageProfile = function () {



var posArray;
var i;

if ($scope.currentZMGroupName) {
$rootScope.zmPopup = $ionicPopup.alert({
title: $translate.instant('kError'),
template: $translate.instant('kErrorMontageProfileZMGroup'),

});
return;
}

try {
posArray = NVR.getLogin().packeryPositionsArray;
//console.log ("PA="+JSON.stringify(posArray));
Expand Down Expand Up @@ -2351,8 +2366,9 @@ angular.module('zmApp.controllers')

}
} // pos
if (!monitor_found) {
mon[m].Monitor.listDisplay = (ld.currentMontageProfile == $translate.instant('kMontageDefaultProfile')) ?'show':'noshow';
if (!monitor_found && !$scope.currentZMGroupName) {
NVR.debug (mon[m].Monitor.Name+' not found, profile='+ld.currentMontageProfile+' and group='+$scope.currentZMGroupName);
mon[m].Monitor.listDisplay = ((ld.currentMontageProfile == $translate.instant('kMontageDefaultProfile') || !ld.currentMontageProfile || !positions.length)) ?'show':'noshow';
NVR.debug (ld.currentMontageProfile + '=> Making '+mon[m].Monitor.Name+' to '+mon[m].Monitor.listDisplay+' as this monitor was not found in profile');

}
Expand Down
1 change: 1 addition & 0 deletions www/lang/locale-en.json
Original file line number Diff line number Diff line change
Expand Up @@ -98,6 +98,7 @@
"kErrorRetrievingFrames" :"error retrieving frames",
"kErrorRetrievingState" :"error retrieving state",
"kErrorSave" :"Error - could not save",
"kErrorMontageProfileZMGroup":"Montage profiles cannot be switched with a ZM group is active",
"kEvent" :"event",
"kEventDeleteConfirm" :"Are you sure you want to delete Event:",
"kEventHistHrs" :"hours ago",
Expand Down

0 comments on commit 09ffc96

Please sign in to comment.