|
|
|
@ -49,7 +49,7 @@ export class HostConfigComponent implements OnInit {
|
|
|
|
|
// return item
|
|
|
|
|
// }
|
|
|
|
|
// })
|
|
|
|
|
if (data.configFiles) { |
|
|
|
|
if (data.configFiles && data.configFiles.length != 0) { |
|
|
|
|
this.isSourceYaml = true |
|
|
|
|
} else { |
|
|
|
|
this.isSourceYaml = false |
|
|
|
@ -75,7 +75,7 @@ export class HostConfigComponent implements OnInit {
|
|
|
|
|
EdgeDeviceId: this.hostId |
|
|
|
|
} |
|
|
|
|
this.isLoading = true |
|
|
|
|
this.http.get('/api/Cameras',{ params: params }).subscribe((data: any) => { |
|
|
|
|
this.http.get('/api/Cameras', { params: params }).subscribe((data: any) => { |
|
|
|
|
data.items.forEach(element => { |
|
|
|
|
element.dimensionedPointsObj = JSON.parse(element.dimensionedPoints) |
|
|
|
|
}); |
|
|
|
@ -231,16 +231,16 @@ export class HostConfigComponent implements OnInit {
|
|
|
|
|
|
|
|
|
|
connect() { |
|
|
|
|
|
|
|
|
|
let isAllLabel = this.listOfData.find((item: any) => { |
|
|
|
|
if (item.type != 1 && !item.dimensionedPoints) { |
|
|
|
|
console.log('存在摄像头未标注的情况') |
|
|
|
|
return item |
|
|
|
|
} |
|
|
|
|
}) |
|
|
|
|
if (isAllLabel) { |
|
|
|
|
this.message.create('error', '存在摄像头未标注的情况'); |
|
|
|
|
return |
|
|
|
|
} |
|
|
|
|
// let isAllLabel = this.listOfData.find((item: any) => {
|
|
|
|
|
// if (item.type != 1 && !item.dimensionedPoints) {
|
|
|
|
|
// console.log('存在摄像头未标注的情况')
|
|
|
|
|
// return item
|
|
|
|
|
// }
|
|
|
|
|
// })
|
|
|
|
|
// if (isAllLabel) {
|
|
|
|
|
// this.message.create('error', '存在摄像头未标注的情况');
|
|
|
|
|
// return
|
|
|
|
|
// }
|
|
|
|
|
let ids = [] |
|
|
|
|
this.listOfData.forEach((item: any) => { |
|
|
|
|
ids.push(item.id) |
|
|
|
@ -352,10 +352,10 @@ logging_interval : 600
|
|
|
|
|
|
|
|
|
|
if (item.type == 0) { |
|
|
|
|
let str = '' |
|
|
|
|
item.dimensionedPointsObj.polygon.forEach(element => { |
|
|
|
|
item.dimensionedPointsObj ? item.dimensionedPointsObj.polygon.forEach(element => { |
|
|
|
|
str += element.x + ',' |
|
|
|
|
str += element.y + ',' |
|
|
|
|
}); |
|
|
|
|
}) : 0; |
|
|
|
|
str = str.substring(0, str.lastIndexOf(',')) |
|
|
|
|
console.log('进出口多边形', str) |
|
|
|
|
config1 += ` |
|
|
|
@ -393,22 +393,19 @@ mode=strict
|
|
|
|
|
` |
|
|
|
|
} |
|
|
|
|
}) |
|
|
|
|
if (xieyouqu.length != 1) { |
|
|
|
|
this.message.create('warning', '有且只能有一个卸油区!'); |
|
|
|
|
return |
|
|
|
|
} else { |
|
|
|
|
let xieyouguan = '' |
|
|
|
|
let jingdian = '' |
|
|
|
|
xieyouqu[0].dimensionedPointsObj.rectangle.forEach(element => { |
|
|
|
|
if (element.oilUnloadingArea) { |
|
|
|
|
xieyouguan = element.x + ',' + element.y + ',' + element.width + ',' + element.height |
|
|
|
|
} else { |
|
|
|
|
jingdian = element.x + ',' + element.y + ',' + element.width + ',' + element.height |
|
|
|
|
} |
|
|
|
|
}); |
|
|
|
|
console.log('泄油管区域', xieyouguan) |
|
|
|
|
console.log('静电接地', jingdian) |
|
|
|
|
config2 = `# The all in one config file.
|
|
|
|
|
|
|
|
|
|
let xieyouguan = '' |
|
|
|
|
let jingdian = '' |
|
|
|
|
xieyouqu.length != 0 ? xieyouqu[0].dimensionedPointsObj.rectangle.forEach(element => { |
|
|
|
|
if (element.oilUnloadingArea) { |
|
|
|
|
xieyouguan = element.x + ',' + element.y + ',' + element.width + ',' + element.height |
|
|
|
|
} else { |
|
|
|
|
jingdian = element.x + ',' + element.y + ',' + element.width + ',' + element.height |
|
|
|
|
} |
|
|
|
|
}) : ''; |
|
|
|
|
console.log('泄油管区域', xieyouguan) |
|
|
|
|
console.log('静电接地', jingdian) |
|
|
|
|
config2 = `# The all in one config file.
|
|
|
|
|
# RTSP sources |
|
|
|
|
# type |
|
|
|
|
# 0 ViolateArea.ENTRANCE, |
|
|
|
@ -515,7 +512,7 @@ rule_threshold:
|
|
|
|
|
threshold_connecting: 0.667 #rolling mean confidence |
|
|
|
|
threshold_identity: 0.1 #only to filter out people net error |
|
|
|
|
` |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
sessionStorage.setItem('config1', config1) |
|
|
|
|
sessionStorage.setItem('config2', config2) |
|
|
|
|
sessionStorage.setItem('config3', config3) |
|
|
|
|