summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPliable Pixels <pliablepixels@gmail.com>2018-11-24 17:39:13 -0500
committerPliable Pixels <pliablepixels@gmail.com>2018-11-24 17:39:13 -0500
commit1c7176e5eb8f2ed98bc04ec133b470cb309d4035 (patch)
tree8c9ac189933a24666bd68f50f21acb0f46744d0f
parent3a44adee3d077c605c63c2469b6369e0d63a8824 (diff)
integrate object detection mode in event list
-rw-r--r--www/js/DataModel.js18
-rw-r--r--www/js/EventCtrl.js19
-rw-r--r--www/lang/locale-en.json3
-rw-r--r--www/templates/events-popover.html3
4 files changed, 42 insertions, 1 deletions
diff --git a/www/js/DataModel.js b/www/js/DataModel.js
index 2fe14d46..bb8092a6 100644
--- a/www/js/DataModel.js
+++ b/www/js/DataModel.js
@@ -190,6 +190,7 @@ angular.module('zmApp.controllers')
'currentServerVersion': '',
'saveToCloud': true,
'montageReviewCollapse': true,
+ 'objectDetectionFilter': false,
};
@@ -1501,6 +1502,12 @@ angular.module('zmApp.controllers')
}
+ if (typeof loginData.objectDetectionFilter == 'undefined') {
+
+ loginData.objectDetectionFilter = false;
+
+ }
+
loginData.canSwipeMonitors = true;
loginData.forceImageModePath = false;
@@ -2649,6 +2656,12 @@ angular.module('zmApp.controllers')
myurl = myurl + "/AlarmFrames >=:" + (loginData.enableAlarmCount ? loginData.minAlarmCount : 0);
+ //https:///zm/api/events/index/Notes%20REGEXP:detected%3A.json
+ if (loginData.objectDetectionFilter) {
+ myurl = myurl + '/Notes%20REGEXP:detected%3A';
+ }
+
+
myurl = myurl + ".json";
//console.log (">>>>>Constructed URL " + myurl);
@@ -2732,6 +2745,11 @@ angular.module('zmApp.controllers')
myurl = myurl + "/AlarmFrames >=:" + (loginData.enableAlarmCount ? loginData.minAlarmCount : 0);
+ //https:///zm/api/events/index/Notes%20REGEXP:detected%3A.json
+ if (loginData.objectDetectionFilter) {
+ myurl = myurl + '/Notes%20REGEXP:detected%3A';
+ }
+
myurl = myurl + ".json?&sort=StartTime&direction=desc&page=" + pageId;
diff --git a/www/js/EventCtrl.js b/www/js/EventCtrl.js
index 8947df19..5f9a77fd 100644
--- a/www/js/EventCtrl.js
+++ b/www/js/EventCtrl.js
@@ -1825,6 +1825,12 @@ angular.module('zmApp.controllers')
var af = "/AlarmFrames >=:" + (ld.enableAlarmCount ? ld.minAlarmCount : 0);
+ if (ld.objectDetectionFilter) {
+ af = af + '/Notes%20REGEXP:detected%3A';
+ }
+
+
+
var apiurl = ld.apiurl + "/events/consoleEvents/1 hour" + af + ".json";
//NVRDataModel.debug("consoleEvents API:" + apiurl);
@@ -2921,6 +2927,17 @@ angular.module('zmApp.controllers')
};
+ $scope.toggleObjectDetectionFilter = function () {
+
+ var ld = NVRDataModel.getLogin();
+ ld.objectDetectionFilter = !ld.objectDetectionFilter;
+ NVRDataModel.setLogin(ld);
+ NVRDataModel.debug ("object detection filter: "+ld.objectDetectionFilter);
+ $scope.loginData = NVRDataModel.getLogin();
+ doRefresh();
+
+ };
+
$scope.toggleMinAlarmFrameCount = function () {
var ld = NVRDataModel.getLogin();
@@ -3009,6 +3026,8 @@ angular.module('zmApp.controllers')
function doRefresh() {
// console.log("***Pull to Refresh");
+
+
NVRDataModel.debug("Reloading monitors");
maxEventsPage = 1;
currEventsPage = 1;
diff --git a/www/lang/locale-en.json b/www/lang/locale-en.json
index 6fa72e72..9770f145 100644
--- a/www/lang/locale-en.json
+++ b/www/lang/locale-en.json
@@ -345,6 +345,7 @@
"kSettingsSaved" :"Settings Saved",
"kShowAlarmedEvents" :"Show alarmed events",
"kShowAllEvents" :"Show all events",
+ "kShowObjectDetectionEvents" :"Only detected objects",
"kShowAllFrames" :"all",
"kShowLiveForInProgress" :"play live feed if event recording in progress",
"kShowTimeDiffFrames" :"unique times",
@@ -387,7 +388,7 @@
"kToDate" :"To Date",
"kToTime" :"To Time",
"kToastSearchingPage" :"searching page ",
- "kToggleSummary" :"toggle summary",
+ "kToggleSummary" :"Toggle summary",
"kTrue" :"true",
"kTrying" :"trying",
"kType" :"type",
diff --git a/www/templates/events-popover.html b/www/templates/events-popover.html
index 2620c9b3..8ccc1c8f 100644
--- a/www/templates/events-popover.html
+++ b/www/templates/events-popover.html
@@ -15,6 +15,9 @@
<a class="item" ng-href="" ng-click="popover.hide();toggleMinAlarmFrameCount();" ng-if="!loginData.enableAlarmCount">
{{'kShowAlarmedEvents' | translate}}</a>
+ <a class="item" ng-href="" ng-click="popover.hide();toggleObjectDetectionFilter();" > <i ng-if="loginData.objectDetectionFilter" class="ion-record" style="color:green;">&nbsp;</i> {{'kShowObjectDetectionEvents'
+ | translate}}</a>
+
<a class="item" ng-href="" ng-click="popover.hide();footerToggle();" >
{{ 'kToggleSummary' | translate}}</a>