show detector_trigger in UI logger and minor cleanup
parent
4c380b3cb9
commit
b1ced580e1
|
@ -278,6 +278,7 @@
|
||||||
"Audio streams only": "Audio streams only",
|
"Audio streams only": "Audio streams only",
|
||||||
"Audio stream only from first feed": "Audio stream only from first feed",
|
"Audio stream only from first feed": "Audio stream only from first feed",
|
||||||
"sorryNothingWasFound": "Sorry, nothing was found.",
|
"sorryNothingWasFound": "Sorry, nothing was found.",
|
||||||
|
"Event Occurred": "Event Occurred",
|
||||||
"ONVIF Port": "ONVIF Port",
|
"ONVIF Port": "ONVIF Port",
|
||||||
"ONVIF Scanner": "ONVIF Scanner",
|
"ONVIF Scanner": "ONVIF Scanner",
|
||||||
"ONVIFEventsNotAvailable": "ONVIF Events not Available",
|
"ONVIFEventsNotAvailable": "ONVIF Events not Available",
|
||||||
|
|
|
@ -31,40 +31,41 @@ $.ccio.globalWebsocket=function(d,user){
|
||||||
$('[ke="'+d.ke+'"][mid="'+d.id+'"][auth="'+user.auth_token+'"] .monitor_status').html(d.status);
|
$('[ke="'+d.ke+'"][mid="'+d.id+'"][auth="'+user.auth_token+'"] .monitor_status').html(d.status);
|
||||||
break;
|
break;
|
||||||
case'detector_trigger':
|
case'detector_trigger':
|
||||||
d.e=$('.monitor_item[ke="'+d.ke+'"][mid="'+d.id+'"][auth="'+user.auth_token+'"]')
|
var monitorElement = $('.monitor_item[ke="'+d.ke+'"][mid="'+d.id+'"][auth="'+user.auth_token+'"]')
|
||||||
if($.ccio.mon[d.ke+d.id+user.auth_token]&&d.e.length>0){
|
var monitorObject = $.ccio.mon[d.ke+d.id+user.auth_token]
|
||||||
|
if(monitorObject && monitorElement.length > 0){
|
||||||
if(d.doObjectDetection === true){
|
if(d.doObjectDetection === true){
|
||||||
d.e.addClass('doObjectDetection')
|
monitorElement.addClass('doObjectDetection')
|
||||||
clearTimeout($.ccio.mon[d.ke+d.id+user.auth_token].detector_trigger_doObjectDetection_timeout)
|
clearTimeout(monitorObject.detector_trigger_doObjectDetection_timeout)
|
||||||
$.ccio.mon[d.ke+d.id+user.auth_token].detector_trigger_doObjectDetection_timeout = setTimeout(function(){
|
monitorObject.detector_trigger_doObjectDetection_timeout = setTimeout(function(){
|
||||||
d.e.removeClass('doObjectDetection')
|
monitorElement.removeClass('doObjectDetection')
|
||||||
},3000)
|
},3000)
|
||||||
}else{
|
}else{
|
||||||
d.e.removeClass('doObjectDetection')
|
monitorElement.removeClass('doObjectDetection')
|
||||||
}
|
}
|
||||||
if(d.details.plates&&d.details.plates.length>0){
|
if(d.details.plates&&d.details.plates.length>0){
|
||||||
console.log('licensePlateStream',d.id,d)
|
console.log('licensePlateStream',d.id,d)
|
||||||
}
|
}
|
||||||
if(d.details.matrices&&d.details.matrices.length>0){
|
if(d.details.matrices&&d.details.matrices.length>0){
|
||||||
d.monitorDetails=JSON.parse($.ccio.mon[d.ke+d.id+user.auth_token].details)
|
d.monitorDetails=JSON.parse(monitorObject.details)
|
||||||
d.stream=d.e.find('.stream-element')
|
d.stream=monitorElement.find('.stream-element')
|
||||||
d.streamObjects=d.e.find('.stream-objects')
|
d.streamObjects=monitorElement.find('.stream-objects')
|
||||||
$.ccio.init('drawMatrices',d)
|
$.ccio.init('drawMatrices',d)
|
||||||
}
|
}
|
||||||
if(d.details.points&&Object.keys(d.details.points).length>0){
|
if(d.details.points&&Object.keys(d.details.points).length>0){
|
||||||
d.monitorDetails=JSON.parse($.ccio.mon[d.ke+d.id+user.auth_token].details)
|
d.monitorDetails=JSON.parse(monitorObject.details)
|
||||||
d.stream=d.e.find('.stream-element')
|
d.stream=monitorElement.find('.stream-element')
|
||||||
d.streamObjects=d.e.find('.stream-objects')
|
d.streamObjects=monitorElement.find('.stream-objects')
|
||||||
$.ccio.init('drawPoints',d)
|
$.ccio.init('drawPoints',d)
|
||||||
}
|
}
|
||||||
if(d.details.confidence){
|
if(d.details.confidence){
|
||||||
d.tt=d.details.confidence;
|
d.tt=d.details.confidence;
|
||||||
if (d.tt > 100) { d.tt = 100 }
|
if (d.tt > 100) { d.tt = 100 }
|
||||||
d.e.find('.indifference .progress-bar').css('width',d.tt + '%').find('span').html(d.details.confidence+'% change in <b>'+d.details.name+'</b>')
|
monitorElement.find('.indifference .progress-bar').css('width',d.tt + '%').find('span').html(d.details.confidence+'% change in <b>'+d.details.name+'</b>')
|
||||||
}
|
}
|
||||||
d.e.addClass('detector_triggered')
|
monitorElement.addClass('detector_triggered')
|
||||||
clearTimeout($.ccio.mon[d.ke+d.id+user.auth_token].detector_trigger_timeout);
|
clearTimeout(monitorObject.detector_trigger_timeout);
|
||||||
$.ccio.mon[d.ke+d.id+user.auth_token].detector_trigger_timeout=setTimeout(function(){
|
monitorObject.detector_trigger_timeout=setTimeout(function(){
|
||||||
$('.monitor_item[ke="'+d.ke+'"][mid="'+d.id+'"][auth="'+user.auth_token+'"]').removeClass('detector_triggered').find('.stream-detected-object,.stream-detected-point').remove()
|
$('.monitor_item[ke="'+d.ke+'"][mid="'+d.id+'"][auth="'+user.auth_token+'"]').removeClass('detector_triggered').find('.stream-detected-object,.stream-detected-point').remove()
|
||||||
},5000);
|
},5000);
|
||||||
//noise alert
|
//noise alert
|
||||||
|
@ -90,9 +91,17 @@ $.ccio.globalWebsocket=function(d,user){
|
||||||
},user.details.audio_delay * 1000)
|
},user.details.audio_delay * 1000)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if(user.details.event_mon_pop === '1' && (!$.ccio.mon[d.ke+d.id+user.auth_token].popOut || $.ccio.mon[d.ke+d.id+user.auth_token].popOut.closed === true)){
|
if(user.details.event_mon_pop === '1' && (!monitorObject.popOut || monitorObject.popOut.closed === true)){
|
||||||
popOutMonitor(d.id)
|
popOutMonitor(d.id)
|
||||||
}
|
}
|
||||||
|
$.logWriter.draw('[mid="'+d.id+'"][ke="'+d.ke+'"][auth="'+user.auth_token+'"]',{
|
||||||
|
ke: d.ke,
|
||||||
|
mid: d.id,
|
||||||
|
log: {
|
||||||
|
type: lang['Event Occurred'],
|
||||||
|
msg: d.details,
|
||||||
|
}
|
||||||
|
},user)
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
case'init_success':
|
case'init_success':
|
||||||
|
|
Loading…
Reference in New Issue