From a552ec7a81dae7b82f161b63f8cfcbed5fdc25c4 Mon Sep 17 00:00:00 2001 From: SHAOJIAHAO <55341701@qq.com> Date: Fri, 29 Apr 2022 11:29:06 +0800 Subject: [PATCH] =?UTF-8?q?[=E5=AE=8C=E5=96=84]=E4=BF=9D=E5=AD=98=E9=85=8D?= =?UTF-8?q?=E7=BD=AE=E6=96=87=E4=BB=B6?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../host-config/host-config.component.html | 11 ++++- .../host-config/host-config.component.ts | 43 +++++++++++++++---- src/styles.scss | 5 +++ 3 files changed, 48 insertions(+), 11 deletions(-) diff --git a/src/app/system-management/host-config/host-config.component.html b/src/app/system-management/host-config/host-config.component.html index 9147e54..6cce934 100644 --- a/src/app/system-management/host-config/host-config.component.html +++ b/src/app/system-management/host-config/host-config.component.html @@ -25,10 +25,17 @@ {{ item.password }} {{ item.uri }} {{ item.type | cameraType}} - 标注情况 + + + 不需要标注 + + + {{item.dimensionedPoints ? '已标注' : '未标注'}} + + 编辑 - 标注 + 标注 删除 diff --git a/src/app/system-management/host-config/host-config.component.ts b/src/app/system-management/host-config/host-config.component.ts index b907cdb..888be89 100644 --- a/src/app/system-management/host-config/host-config.component.ts +++ b/src/app/system-management/host-config/host-config.component.ts @@ -14,7 +14,8 @@ interface Camera { user: string; password: string; uri: string; - type: number + type: number; + dimensionedPoints: string } @Component({ @@ -42,6 +43,9 @@ export class HostConfigComponent implements OnInit { //摄像头 getCamera() { this.http.get('/api/Cameras').subscribe((data: any) => { + data.items.forEach(element => { + element.dimensionedPointsObj = JSON.parse(element.dimensionedPoints) + }); this.listOfData = data.items console.log('摄像头列表', data.items) }) @@ -134,7 +138,7 @@ export class HostConfigComponent implements OnInit { } label(item) { - this.router.navigate(['/system/host/camera/imageLabel'],{queryParams: {id : item.id}}) + this.router.navigate(['/system/host/camera/imageLabel'], { queryParams: { id: item.id } }) } connect() { @@ -190,6 +194,13 @@ inference_buffer_second: 10` type: ${item.type} ` if (item.type == 0) { + let str = '' + item.dimensionedPointsObj.polygon.forEach(element => { + str += element.x + ',' + str += element.y + ',' + }); + str = str.substring(0, str.lastIndexOf(',')) + console.log('进出口多边形', str) config1 += ` ## Per stream configuration [roi-filtering-stream-${index}] @@ -197,18 +208,21 @@ inference_buffer_second: 10` #enable or disable following feature enable=1 #ROI to filter select objects, and remove from meta data -roi-RF=${index} +roi-RF=${str} #remove objects in the ROI inverse-roi=0 class-id=-1 ` } - if (item.type == 2 || item.type == 3) { + if ((item.type == 2 || item.type == 3) && item.dimensionedPointsObj) { + let arrowArr = item.dimensionedPointsObj.arrow + let str = arrowArr[0].startX + ',' + arrowArr[0].startY + ',' + arrowArr[0].endX + ',' + arrowArr[0].endY + ',' + arrowArr[1].startX + ',' + arrowArr[1].startY + ',' + arrowArr[1].endX + ',' + arrowArr[1].endY + console.log('十字箭头', str) config1 += ` [line-crossing-stream-${index}] enable=1 #Label;direction;lc -line-crossing-Entry=${index} +line-crossing-Entry=${str} # line-crossing-Exit=789;672;1084;900;851;773;1203;732 class-id=0 #extended when 0- only counts crossing on the configured Line @@ -226,6 +240,17 @@ mode=strict 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. # RTSP sources # type @@ -316,9 +341,9 @@ connet: apply_on: 2 roi: - 'oil_tube-3': - - ${xieyouqu[0].xxx} + - [${xieyouguan}] - 'grounder-3': - - ${xieyouqu[0].xxx} + - [${jingdian}] interval: 1 batch_size: 2 @@ -333,11 +358,11 @@ 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) sessionStorage.setItem('config4', config4) - console.log('config4', config4) + // console.log('config4', config4) } } diff --git a/src/styles.scss b/src/styles.scss index 5228fd3..96f53d1 100644 --- a/src/styles.scss +++ b/src/styles.scss @@ -126,4 +126,9 @@ app-root { display: flex; align-items: center; justify-content: center; +} + +.forbid{ + color: gray; + pointer-events:none } \ No newline at end of file