Merge remote-tracking branch 'upstream/dev' into dev

build-default-monitor-config-from-definitions
Ian Rubado 2020-04-05 22:15:01 -04:00
commit d3329d52ae
5 changed files with 28 additions and 13 deletions

View File

@ -27,6 +27,7 @@ var yolo = require('node-yolo-shinobi');//this is @vapi/node-yolo@1.2.4 without
// var yolo = require('@vapi/node-yolo');
var detector = new yolo(__dirname + "/models", "cfg/coco.data", "cfg/yolov3.cfg", "yolov3.weights");
s.detectObject=function(buffer,d,tx,frameLocation){
var timeStart = new Date()
var detectStuff = function(frame,callback){
detector.detect(frame)
.then(detections => {
@ -52,7 +53,8 @@ s.detectObject=function(buffer,d,tx,frameLocation){
reason:'object',
matrices:matrices,
imgHeight:parseFloat(d.mon.detector_scale_y),
imgWidth:parseFloat(d.mon.detector_scale_x)
imgWidth:parseFloat(d.mon.detector_scale_x),
time: (new Date()) - timeStart
}
})
}

View File

@ -301,6 +301,7 @@ $.ccio.globalWebsocket=function(d,user){
uid: user.uid,
ke: d.ke,
id: d.id,
subscriptionId: subscriptionId,
// channel: channel
})
if(!$.ccio.mon[d.ke+d.id+user.auth_token].ctx||$.ccio.mon[d.ke+d.id+user.auth_token].ctx.length===0){

View File

@ -137,19 +137,19 @@ $(document).ready(function(e){
var selectedMonitor = $.timelapseJpeg.monitors.val()
var generatorUrl = $.timelapseJpeg.pointer + $user.auth_token + '/timelapse/' + $user.ke + '/' + selectedMonitor
$.getJSON(generatorUrl + '?' + queryString.join('&'),function(response){
_this.text(lang['Download'])
if(response.fileExists){
_this.text(lang['Download'])
var downloadName = startDate + '_' + endDate + '_' + selectedMonitor + '.mp4'
var a = document.createElement('a')
a.href = generatorUrl + '?' + queryString.concat(['download="1"']).join('&')
a.download = downloadName
a.click()
}else{
_this.html('&nbsp;<i class="fa fa-spinner fa-pulse"></i>&nbsp;')
clearTimeout($.timelapseJpeg.downloadRecheckTimers[timerId])
$.timelapseJpeg.downloadRecheckTimers[timerId] = setTimeout(function(){
runDownloader()
},5000)
// _this.html('&nbsp;<i class="fa fa-spinner fa-pulse"></i>&nbsp;')
// clearTimeout($.timelapseJpeg.downloadRecheckTimers[timerId])
// $.timelapseJpeg.downloadRecheckTimers[timerId] = setTimeout(function(){
// runDownloader()
// },5000)
}
})
}

View File

@ -102,9 +102,15 @@
<script><% include ../libs/js/bootstrap-table.min.js %></script>
<script>
$.ccio={subs:{}};$.ls=localStorage;
$.ccio.ws=io(location.origin,{
path : tool.checkCorrectPathEnding(location.pathname)+'socket.io'
});
if(location.search === '?assemble=1'){
$.ccio.ws=io(location.origin,{
path : '/socket.io'
});
}else{
$.ccio.ws=io(location.origin,{
path : tool.checkCorrectPathEnding(location.pathname)+'socket.io'
});
}
$.ccio.cx=function(x){if(!x.ke){x.ke=$user.ke;};if(!x.uid){x.uid=$user.uid;};return $.ccio.ws.emit('a',x)}
$.ccio.ws.on('connect',function(d){
$.ccio.cx({f:'init',auth:$user.auth_token});

View File

@ -229,9 +229,15 @@ switch($user.lang){
})
break;
}
$.ccio.ws=io(location.origin,{
path : tool.checkCorrectPathEnding(location.pathname)+'socket.io'
});
if(location.search === '?assemble=1'){
$.ccio.ws=io(location.origin,{
path : '/socket.io'
});
}else{
$.ccio.ws=io(location.origin,{
path : tool.checkCorrectPathEnding(location.pathname)+'socket.io'
});
}
$.ccio.cx=function(x){return $.ccio.ws.emit('super',x)}
$.ccio.ws.on('connect',function(d){
$.ccio.cx({f:'init',mail:$user.mail,pass:$user.pass})