Browse Source

[完善]标绘完善

非煤矿业企业安全风险监测预警系统
邵佳豪 2 years ago
parent
commit
b27c8a657d
  1. 53
      src/app/system-management/image-label2/image-label2.component.ts

53
src/app/system-management/image-label2/image-label2.component.ts

@ -13,7 +13,7 @@ export class ImageLabel2Component implements OnInit {
private http: HttpClient, private http: HttpClient,
private message: NzMessageService, private message: NzMessageService,
private modal: NzModalService private modal: NzModalService
) {} ) { }
@Input() data: any; //传递id @Input() data: any; //传递id
camerasData: any; //摄像头Data camerasData: any; //摄像头Data
@ -27,7 +27,7 @@ export class ImageLabel2Component implements OnInit {
history.go(-1); history.go(-1);
} }
ngOnInit(): void {} ngOnInit(): void { }
//获取 摄像头图片/标注点位 //获取 摄像头图片/标注点位
getImgMarkData() { getImgMarkData() {
@ -68,8 +68,8 @@ export class ImageLabel2Component implements OnInit {
'向边缘设备发送请求成功,请过一段时间手动刷新页面!' '向边缘设备发送请求成功,请过一段时间手动刷新页面!'
); );
}, },
error: (error: HttpErrorResponse) => {}, error: (error: HttpErrorResponse) => { },
complete: () => {}, complete: () => { },
}); });
} }
@ -378,6 +378,18 @@ export class ImageLabel2Component implements OnInit {
this.arrowPointsOfNorth, this.arrowPointsOfNorth,
]; ];
this.drawLine(arr, context); this.drawLine(arr, context);
this.redrawPolygon(
this.pointsOfmonitor,
this.allpointsOfmonitor,
this.circlesOfmonitor,
context,
'black'
);
} }
if ( if (
this.isDrawArrow && this.isDrawArrow &&
@ -404,6 +416,16 @@ export class ImageLabel2Component implements OnInit {
this.arrowPointsOfNorth, this.arrowPointsOfNorth,
]; ];
this.drawLine(arr, context); this.drawLine(arr, context);
this.redrawPolygon(
this.pointsOfmonitor,
this.allpointsOfmonitor,
this.circlesOfmonitor,
context,
'black'
);
} }
if ( if (
this.isDrawArrow && this.isDrawArrow &&
@ -430,6 +452,17 @@ export class ImageLabel2Component implements OnInit {
this.arrowPointsOfNorth, this.arrowPointsOfNorth,
]; ];
this.drawLine(arr, context); this.drawLine(arr, context);
this.redrawPolygon(
this.pointsOfmonitor,
this.allpointsOfmonitor,
this.circlesOfmonitor,
context,
'black'
);
} }
if ( if (
this.isDrawArrow && this.isDrawArrow &&
@ -762,9 +795,9 @@ export class ImageLabel2Component implements OnInit {
((poly[i].y <= pt.y && pt.y < poly[j].y) || ((poly[i].y <= pt.y && pt.y < poly[j].y) ||
(poly[j].y <= pt.y && pt.y < poly[i].y)) && (poly[j].y <= pt.y && pt.y < poly[i].y)) &&
pt.x < pt.x <
((poly[j].x - poly[i].x) * (pt.y - poly[i].y)) / ((poly[j].x - poly[i].x) * (pt.y - poly[i].y)) /
(poly[j].y - poly[i].y) + (poly[j].y - poly[i].y) +
poly[i].x && poly[i].x &&
(c = !c); (c = !c);
return c; return c;
} }
@ -902,9 +935,9 @@ export class ImageLabel2Component implements OnInit {
((poly[i].y <= pt.y && pt.y < poly[j].y) || ((poly[i].y <= pt.y && pt.y < poly[j].y) ||
(poly[j].y <= pt.y && pt.y < poly[i].y)) && (poly[j].y <= pt.y && pt.y < poly[i].y)) &&
pt.x < pt.x <
((poly[j].x - poly[i].x) * (pt.y - poly[i].y)) / ((poly[j].x - poly[i].x) * (pt.y - poly[i].y)) /
(poly[j].y - poly[i].y) + (poly[j].y - poly[i].y) +
poly[i].x && poly[i].x &&
(c = !c); (c = !c);
return c; return c;
} }

Loading…
Cancel
Save