提交 c167407b 作者: 翁进城

fix:

1. 去除无用日志
2. 缺少任务结束提示
3. 无用代码删除
4. 缺少挂载录像操作提示
5. 机库接管接口参数修正
上级 a01d02eb
...@@ -39,7 +39,6 @@ export default { ...@@ -39,7 +39,6 @@ export default {
*/ */
triggerList(){ triggerList(){
if(!this.obstacle){ if(!this.obstacle){
console.log('if(!this.obstacle)')
return []; return [];
} }
......
...@@ -141,7 +141,7 @@ export default { ...@@ -141,7 +141,7 @@ export default {
"clearAirwayEntities", "clearAirwayEntities",
"apiPointsToFKZXPoints", "apiPointsToFKZXPoints",
]), ]),
...mapActions("MMCFlightControlCenter/hangar", ["hangar", "isTakeOver"]), ...mapActions("MMCFlightControlCenter/hangar", ["isTakeOver"]),
/** /**
* 更新任务列表 * 更新任务列表
*/ */
......
...@@ -24,6 +24,15 @@ export default { ...@@ -24,6 +24,15 @@ export default {
}, },
computed: { computed: {
...mapState("MMCFlightControlCenter/hangar", ["showPanel", "hangar"]), ...mapState("MMCFlightControlCenter/hangar", ["showPanel", "hangar"]),
...mapState("MMCFlightControlCenter/uav", ["uavRealTimeData"]),
},
watch: {
'uavRealTimeData.isFlying'(newVal, oldVal){
// 监听飞机降落然后进行任务结束的提示
if(oldVal === true && newVal === false){
this.$message.success('任务结束')
}
}
}, },
beforeDestroy() { beforeDestroy() {
this.$store.commit('MMCFlightControlCenter/setState', { this.$store.commit('MMCFlightControlCenter/setState', {
......
...@@ -119,13 +119,11 @@ export default { ...@@ -119,13 +119,11 @@ export default {
window.$mmc.$store.dispatch("MMCMQTT/publish", { window.$mmc.$store.dispatch("MMCMQTT/publish", {
topic: "PX4/OBTAIN/" + this.uav.deviceId, topic: "PX4/OBTAIN/" + this.uav.deviceId,
data: streamData, data: streamData,
callback: (isOk) => { callback: () => {
if (isOk) { if (streamData.data.data.recordControl) {
if (streamData.data.data.recordControl) { this.$message.success(`录像开始`);
this.$message.success(`录像开始`); } else {
} else { this.$message.success(`录像结束`);
this.$message.success(`录像结束`);
}
} }
}, },
}); });
......
...@@ -183,6 +183,7 @@ export default { ...@@ -183,6 +183,7 @@ export default {
gap: 3px; gap: 3px;
cursor: pointer; cursor: pointer;
box-sizing: border-box; box-sizing: border-box;
overflow: hidden;
> img { > img {
width: 24px; width: 24px;
......
...@@ -7,8 +7,8 @@ ...@@ -7,8 +7,8 @@
</div> </div>
<div class="dialog-content"> <div class="dialog-content">
<el-table :data="list" height="200px"> <el-table :data="list" height="200px">
<el-table-column label="无人机名称" align="center" prop="deviceName"></el-table-column> <el-table-column :label="`${hangar ? '机库' : '无人机'}名称`" align="center" prop="deviceName"></el-table-column>
<el-table-column label="无人机所属单位" align="center" prop="deviceDeptName"></el-table-column> <el-table-column :label="`${hangar ? '机库' : '无人机'}所属单位`" align="center" prop="deviceDeptName"></el-table-column>
<el-table-column label="接管状态" align="center" prop="takeStats"> <el-table-column label="接管状态" align="center" prop="takeStats">
<template slot-scope="scope"> <template slot-scope="scope">
{{scope.row.takeStats ? '接管中' : '未接管'}} {{scope.row.takeStats ? '接管中' : '未接管'}}
...@@ -49,7 +49,7 @@ export default { ...@@ -49,7 +49,7 @@ export default {
}; };
}, },
computed: { computed: {
...mapState("MMCFlightControlCenter/hangar"), ...mapState("MMCFlightControlCenter/hangar", ["hangar"]),
}, },
mounted() { mounted() {
this.init(); this.init();
......
...@@ -29,11 +29,7 @@ export default { ...@@ -29,11 +29,7 @@ export default {
inject: ['bus'], inject: ['bus'],
data() { data() {
return { return {
pointListFlag: false, isFlying: false,
aiPopup: null, //识别图标
keyFlag: false, //NX状态
videoItem: 0,
showCenter: false,
}; };
}, },
computed: { computed: {
...@@ -41,14 +37,18 @@ export default { ...@@ -41,14 +37,18 @@ export default {
"uav", "uav",
"showPlayer", "showPlayer",
"showPanel", "showPanel",
"uavRealTimeData"
]), ]),
}, },
watch: {
'uavRealTimeData.isFlying'(newVal, oldVal){
// 监听飞机降落然后进行任务结束的提示
if(oldVal === true && newVal === false){
this.$message.success('任务结束')
}
}
},
created() { created() {
// 等待航线上传成功在执行
// 判断是否以一键任务
/* Bus.$on("off_take", () => {
this.takeOff = true;
}); */
}, },
mounted() {}, mounted() {},
beforeDestroy() { beforeDestroy() {
...@@ -59,265 +59,6 @@ export default { ...@@ -59,265 +59,6 @@ export default {
}, },
methods: { methods: {
getcanvas(val, item) {
let data = null;
if (item.jsonData) {
data = JSON.parse(item.jsonData);
} else {
data = item;
}
// let targets = data.targets;
setTimeout(() => {
this.canvas = this.$refs.canvas;
this.canvas.width = 1000;
this.canvas.height = 500;
this.image = new Image();
this.image.src = val;
this.image.onload = () => {
if (this.aiType >= 4 && this.aiType != 13) {
this.drawImage(data.targets);
} else if (this.aiType == 1) {
this.drawImage(data.detections);
} else if (this.aiType == 2) {
this.drawImage(data.aiPlateShiJuResultInfoDtoList);
} else if (this.aiType == 3 || this.aiType == 13) {
this.drawImage(data);
}
};
}, 50);
},
drawImage(list) {
this.ctx = this.canvas.getContext("2d");
this.ctx.drawImage(
this.image,
0,
0,
this.canvas.width,
this.canvas.height
);
this.ctx.lineWidth = 2;
this.ctx.strokeStyle = "red";
if (this.aiType >= 4 && this.aiType != 13) {
list.forEach((targets) => {
let plate_detection = {
x: 0,
y: 0,
h: 0,
w: 0,
};
plate_detection.x =
(this.canvas.width * targets.bbox.box.left_top_x) /
this.image.width;
plate_detection.y =
(this.canvas.height * targets.bbox.box.left_top_y) /
this.image.height;
plate_detection.h =
(this.canvas.height *
(targets.bbox.box.right_bottom_y - targets.bbox.box.left_top_y)) /
this.image.height;
plate_detection.w =
(this.canvas.width *
(targets.bbox.box.right_bottom_x - targets.bbox.box.left_top_x)) /
this.image.width;
this.ctx.strokeRect(
plate_detection.x,
plate_detection.y,
plate_detection.w,
plate_detection.h
);
this.ctx.fillStyle = "rgba(0,0,0,0.8)";
let text =
targets.bbox.label +
":" +
(targets.bbox.prob * 100).toFixed(2) +
"%(相似度)";
let offX = 0;
let offY = 0;
if (plate_detection.x + text.length * 11 > 1000) {
offX = 1000 - text.length * 11;
} else {
offX = plate_detection.x - 5;
}
if (plate_detection.y - 20 < 0) {
offY = plate_detection.y + plate_detection.h;
} else {
offY = plate_detection.y - 22;
}
this.ctx.fillRect(
// plate_detection.x - 5,
offX,
offY,
text.length * 11,
20
);
this.ctx.fillStyle = "white"; // 设置文本颜色
this.ctx.font = "16px Arial"; // 设置文本字体大小和样式
this.ctx.fillText(
text,
// plate_detection.x - 5,
offX,
offY + 15
); // 绘制文本
});
} else if (this.aiType == 1) {
list.forEach((targets) => {
let plate_detection = {
x: 0,
y: 0,
h: 0,
w: 0,
};
plate_detection.x =
(this.canvas.width * targets.x) / this.image.width;
plate_detection.y =
(this.canvas.height * targets.y) / this.image.height;
plate_detection.h =
(this.canvas.height * targets.h) / this.image.height;
plate_detection.w =
(this.canvas.width * targets.w) / this.image.width;
this.ctx.strokeRect(
plate_detection.x,
plate_detection.y,
plate_detection.w,
plate_detection.h
);
this.ctx.fillStyle = "rgba(0,0,0,0.5)";
this.ctx.fillRect(
plate_detection.x - 5,
plate_detection.y - 22,
20,
20
);
this.ctx.fillStyle = "white"; // 设置文本颜色
this.ctx.font = "12px Arial"; // 设置文本字体大小和样式
this.ctx.fillText("人", plate_detection.x - 3, plate_detection.y - 8); // 绘制文本
});
} else if (this.aiType == 2) {
list.forEach((targets) => {
let plate_detection = {
x: 0,
y: 0,
h: 0,
w: 0,
};
plate_detection.x =
(this.canvas.width * targets.yiSaPlateDetection.x) /
this.image.width;
plate_detection.y =
(this.canvas.height * targets.yiSaPlateDetection.y) /
this.image.height;
plate_detection.h =
(this.canvas.height * targets.yiSaPlateDetection.h) /
this.image.height;
plate_detection.w =
(this.canvas.width * targets.yiSaPlateDetection.w) /
this.image.width;
this.ctx.strokeRect(
plate_detection.x,
plate_detection.y,
plate_detection.w,
plate_detection.h
);
this.ctx.fillStyle = "rgba(0,0,0,0.5)";
this.ctx.fillRect(
plate_detection.x - 5,
plate_detection.y - 22,
60,
20
);
this.ctx.fillStyle = "white"; // 设置文本颜色
this.ctx.font = "12px Arial"; // 设置文本字体大小和样式
this.ctx.fillText(
targets.plateNum,
plate_detection.x - 3,
plate_detection.y - 8
); // 绘制文本
});
} else if (this.aiType == 3) {
list.forEach((targets) => {
let plate_detection = {
x: 0,
y: 0,
h: 0,
w: 0,
};
plate_detection.x =
(this.canvas.width * targets.bbox[0]) / this.image.width;
plate_detection.y =
(this.canvas.height * targets.bbox[1]) / this.image.height;
plate_detection.h =
(this.canvas.height * (targets.bbox[3] - targets.bbox[1])) /
this.image.height;
plate_detection.w =
(this.canvas.width * (targets.bbox[2] - targets.bbox[0])) /
this.image.width;
this.ctx.strokeRect(
plate_detection.x,
plate_detection.y,
plate_detection.w,
plate_detection.h
);
this.ctx.fillStyle = "rgba(0,0,0,0.5)";
this.ctx.fillRect(
plate_detection.x - 5,
plate_detection.y - 22,
20,
20
);
this.ctx.fillStyle = "white"; // 设置文本颜色
this.ctx.font = "16px Arial"; // 设置文本字体大小和样式
this.ctx.fillText("人", plate_detection.x - 3, plate_detection.y - 8); // 绘制文本
});
} else if (this.aiType == 13) {
list.crowdDensityDataList.forEach((targets) => {
let plate_detection = {
x: 0,
y: 0,
h: 0,
w: 0,
};
plate_detection.x =
(this.canvas.width * targets.bbox[0]) / this.image.width;
plate_detection.y =
(this.canvas.height * targets.bbox[1]) / this.image.height;
plate_detection.h =
(this.canvas.height * (targets.bbox[3] - targets.bbox[1])) /
this.image.height;
plate_detection.w =
(this.canvas.width * (targets.bbox[2] - targets.bbox[0])) /
this.image.width;
this.ctx.strokeRect(
plate_detection.x,
plate_detection.y,
plate_detection.w,
plate_detection.h
);
this.ctx.fillStyle = "rgba(0,0,0,0.5)";
let text = targets.desc;
let offX = 0;
let offY = 0;
if (plate_detection.x + text.length * 11 > 1000) {
offX = 1000 - text.length * 11;
} else {
offX = plate_detection.x - 5;
}
if (plate_detection.y - 20 < 0) {
offY = plate_detection.y + plate_detection.h;
} else {
offY = plate_detection.y - 22;
}
this.ctx.fillRect(offX, offY, text.length * 11, 20);
this.ctx.fillStyle = "white"; // 设置文本颜色
this.ctx.font = "11px Arial"; // 设置文本字体大小和样式
this.ctx.fillText(text, offX, offY + 15); // 绘制文本
});
}
},
onPlayerClose(){ onPlayerClose(){
this.$store.commit('MMCFlightControlCenter/uav/setState', { this.$store.commit('MMCFlightControlCenter/uav/setState', {
key: 'uav', key: 'uav',
......
...@@ -18,6 +18,7 @@ const defaultPos = { ...@@ -18,6 +18,7 @@ const defaultPos = {
function initUavRealTimeData() { function initUavRealTimeData() {
return { return {
isFlying: false, // true 飞机处于飞行中,电动机解锁后,飞机就处于飞行中
attitude: { attitude: {
roll: 0, // 飞机的俯仰值:向前为正,向后为负。单位为度。 roll: 0, // 飞机的俯仰值:向前为正,向后为负。单位为度。
pitch: 0, // 飞机的横滚值:正向为正,反向为负。单位为度。 pitch: 0, // 飞机的横滚值:正向为正,反向为负。单位为度。
......
...@@ -40,7 +40,6 @@ export default { ...@@ -40,7 +40,6 @@ export default {
*/ */
triggerList(){ triggerList(){
if(!this.obstacle){ if(!this.obstacle){
console.log('if(!this.obstacle)')
return []; return [];
} }
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论