Skip to content
项目
群组
代码片段
帮助
当前项目
正在载入...
登录 / 注册
切换导航面板
M
mmc-stl-vue2
概览
概览
详情
活动
周期分析
版本库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
统计图
问题
0
议题
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
日程表
图表
维基
Wiki
代码片段
代码片段
成员
成员
折叠边栏
关闭边栏
活动
图像
聊天
创建新问题
作业
提交
问题看板
Open sidebar
Administrator
mmc-stl-vue2
Commits
6d902d12
提交
6d902d12
authored
8月 31, 2024
作者:
翁进城
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
fix: 航点动作AI补充
上级
afacdbff
隐藏空白字符变更
内嵌
并排
正在显示
6 个修改的文件
包含
119 行增加
和
50 行删除
+119
-50
index.vue
...eft/components/airwayList/components/normalTask/index.vue
+2
-2
index.vue
...el/components/controlLeft/components/airwayList/index.vue
+9
-2
index.vue
...pplications/components/player/components/aiList/index.vue
+23
-11
index.vue
...ications/components/player/components/pointList/index.vue
+17
-20
index.vue
...er/components/uavApplications/components/player/index.vue
+53
-11
uav.js
src/components/MMCFlightControlCenter/store/uav.js
+15
-4
没有找到文件。
src/components/MMCFlightControlCenter/components/hangar/components/controlPanel/components/controlLeft/components/airwayList/components/normalTask/index.vue
浏览文件 @
6d902d12
...
...
@@ -132,8 +132,8 @@ export default {
await
this
.
getAirwayList
();
// 获取正在飞行的航线
console
.
log
(
'当前飞行状态'
,
this
.
uavRealTimeData
.
isFlying
);
if
(
this
.
uav
&&
this
.
uavRealTimeData
.
isFlying
)
{
console
.
log
(
'当前飞行状态'
,
this
.
uavRealTimeData
?
.
isFlying
);
if
(
this
.
uav
&&
this
.
uavRealTimeData
?
.
isFlying
)
{
let
res
=
await
TaskInfo
.
getTaskInfoRecord
({
deviceId
:
this
.
uav
.
deviceId
,
});
...
...
src/components/MMCFlightControlCenter/components/uavApplications/components/controlPanel/components/controlLeft/components/airwayList/index.vue
浏览文件 @
6d902d12
...
...
@@ -112,13 +112,20 @@ export default {
this
.
bus
.
$on
(
"refreshAirway"
,
this
.
getAirwayList
);
await
this
.
getAirwayList
();
// 获取正在飞行的航线
console
.
log
(
"当前飞行状态"
,
this
.
uavRealTimeData
.
isFlying
);
if
(
this
.
uav
&&
this
.
uavRealTimeData
.
isFlying
)
{
console
.
log
(
"当前飞行状态"
,
this
.
uavRealTimeData
?
.
isFlying
);
if
(
this
.
uav
&&
this
.
uavRealTimeData
?
.
isFlying
)
{
let
res
=
await
TaskInfo
.
getTaskInfoRecord
({
deviceId
:
this
.
uav
.
deviceId
,
});
if
(
res
.
code
===
0
)
{
this
.
selectedAirwayId
=
res
.
data
.
reouteId
;
// 在一次时机中再取航线数据存进store中
this
.
$nextTick
(()
=>
this
.
$store
.
commit
(
"MMCFlightControlCenter/uav/setState"
,
{
key
:
"airlineData"
,
value
:
this
.
selectedAirway
,
})
);
}
}
},
...
...
src/components/MMCFlightControlCenter/components/uavApplications/components/player/components/aiList/index.vue
浏览文件 @
6d902d12
...
...
@@ -3,7 +3,7 @@
<el-tooltip
content=
"AI识别"
placement=
"bottom"
>
<div
class=
"menu-item"
>
<img
src=
"./assets/images/car1.png"
@
click=
"aiVisible = !aiVisible"
/>
<div
class=
"ai-list"
v-
if
=
"aiVisible"
>
<div
class=
"ai-list"
v-
show
=
"aiVisible"
>
<el-tooltip
v-for=
"(item,index) in aiIdentifyList"
:key=
"index"
...
...
@@ -68,7 +68,7 @@ export default {
{
title
:
"烟雾识别"
,
type
:
"smoke"
,
typeId
:
4
,
typeId
:
7
,
img
:
require
(
"./assets/images/烟雾识别.svg"
),
},
{
...
...
@@ -98,6 +98,21 @@ export default {
* ai识别事件
*/
onAiIdentify
(
type
)
{
this
.
aiIdentify
(
type
,
(
img
)
=>
{
if
(
img
)
{
// 展示识别结果
this
.
$message
.
success
(
"识别成功"
);
this
.
aiResultImg
=
img
;
this
.
aiResultShow
=
true
;
}
else
{
this
.
$message
.
error
(
"识别失败"
);
}
});
},
/**
* ai处理, 父组件也调用
*/
aiIdentify
(
type
,
callback
)
{
let
find
=
this
.
aiIdentifyList
.
find
((
item
)
=>
item
.
type
===
type
);
this
.
aiTitle
=
find
.
title
;
let
isSuccess
=
false
;
...
...
@@ -117,7 +132,7 @@ export default {
];
switch
(
type
)
{
// 车牌识别 自研
/* case "plate": {
/* case "plate": {
let formData = new FormData();
formData.append("image", blob, `下载.jpeg`);
formData.append("iscount", 1);
...
...
@@ -238,7 +253,7 @@ export default {
]; */
results
=
res
?.
data
?.
data
?.
targets
?.
/* targets. */
map
((
item
)
=>
{
res
?.
data
?.
data
?.
targets
?.
/* targets. */
map
((
item
)
=>
{
return
{
x
:
item
.
bbox
.
box
.
left_top_x
,
y
:
item
.
bbox
.
box
.
left_top_y
,
...
...
@@ -260,7 +275,7 @@ export default {
if
(
isSuccess
)
{
console
.
log
(
"识别结果"
,
results
);
this
.
$message
.
success
(
"识别成功"
);
// 将识别结果绘制到图片上
let
img
=
new
Image
();
img
.
onload
=
async
()
=>
{
...
...
@@ -271,11 +286,9 @@ export default {
// 现在可以在Canvas上绘制图片和矩形框
let
canvas
=
this
.
drawOnCanvas
(
img
,
width
,
height
,
results
);
// 展示识别结果
this
.
aiResultImg
=
canvas
.
toDataURL
(
"image/svg"
);
this
.
aiResultShow
=
true
;
// 识别结果上传到视图库
callback
(
canvas
.
toDataURL
(
"image/svg"
));
// 识别结果上传到视图库
canvas
.
toBlob
(
async
(
blob1
)
=>
{
console
.
log
(
"识别结果"
,
blob1
);
let
formData
=
new
FormData
();
...
...
@@ -303,9 +316,8 @@ export default {
});
};
img
.
src
=
base64
;
// img.src = testImg;
}
else
{
this
.
$message
.
error
(
"识别失败"
);
callback
(
false
);
}
},
});
...
...
src/components/MMCFlightControlCenter/components/uavApplications/components/player/components/pointList/index.vue
浏览文件 @
6d902d12
...
...
@@ -240,7 +240,13 @@ export default {
console
.
log
(
val
,
"航点"
);
val
.
speed
=
this
.
speed
;
// this.$set(val, "aiList", this.aiList);
val
.
aiList
=
JSON
.
parse
(
JSON
.
stringify
(
this
.
aiList
));
val
.
aiList
=
this
.
aiList
.
filter
((
item
)
=>
item
.
switch
)
.
map
((
item
)
=>
({
id
:
item
.
id
,
type
:
item
.
type
,
isSingle
:
item
.
check
,
}));
val
.
actions
[
2
].
param1
=
this
.
min
*
60
+
this
.
se
;
}
});
...
...
@@ -326,7 +332,7 @@ export default {
img
:
svgFace
,
},
{
id
:
2
,
id
:
8
,
type
:
"车牌识别"
,
switch
:
false
,
check
:
false
,
...
...
@@ -339,23 +345,24 @@ export default {
check
:
false
,
img
:
svgPeople
,
},
{
id
:
4
,
type
:
"
游泳
识别"
,
id
:
7
,
type
:
"
烟雾
识别"
,
switch
:
false
,
check
:
false
,
img
:
svg
Swim
,
img
:
svg
Yan
,
},
{
id
:
7
,
type
:
"
烟雾
识别"
,
id
:
4
,
type
:
"
漏油
识别"
,
switch
:
false
,
check
:
false
,
img
:
svg
Yan
,
img
:
svg
Swim
,
},
{
id
:
6
,
type
:
"
异物
识别"
,
type
:
"
裸土
识别"
,
switch
:
false
,
check
:
false
,
img
:
svgThings
,
...
...
@@ -488,16 +495,6 @@ export default {
});
let
time
=
parseInt
(
distance
/
6
);
let
aiList
=
this
.
aiList
.
filter
((
item
)
=>
item
.
switch
)
.
map
((
item
)
=>
{
return
{
id
:
item
.
id
,
type
:
item
.
type
,
isSingle
:
item
.
check
,
};
});
let
waypoints
=
this
.
pointList
.
map
((
val
)
=>
{
return
{
altitude
:
val
.
alt
,
...
...
@@ -509,7 +506,7 @@ export default {
speed
:
this
.
speed
,
stay
:
0
,
waypointActions
:
val
.
actions
,
aiList
:
aiList
,
aiList
:
val
.
aiList
,
};
});
let
data
=
{
...
...
src/components/MMCFlightControlCenter/components/uavApplications/components/player/index.vue
浏览文件 @
6d902d12
...
...
@@ -336,7 +336,7 @@
<img
src=
"./assets/images/photojz.svg"
/>
</div>
</el-tooltip>
<AiList
@
screenShot=
"onAiScreenShot"
></AiList>
<AiList
ref=
"aiList"
@
screenShot=
"onAiScreenShot"
></AiList>
<div
class=
"menu-item"
@
click=
"startLinePoint"
content=
"航点动作"
>
<img
src=
"./assets/images/point_small.svg"
/>
</div>
...
...
@@ -362,7 +362,7 @@ import SRSPlayer from "./components/srs";
import
{
to_moveMount
}
from
"../../../../utils/to_moveMount.js"
;
import
Obstacle
from
"./components/obstacle"
;
import
PointList
from
"./components/pointList"
;
import
videoModelChange
from
"./components/videoModelChange"
;
;
import
videoModelChange
from
"./components/videoModelChange"
;
import
{
mapState
}
from
"vuex"
;
import
AiList
from
"./components/aiList"
;
...
...
@@ -426,10 +426,16 @@ export default {
},
isInfoShow
:
false
,
showFlywayAction
:
false
,
//显示航点动作
aiTimeHandle
:
null
,
//ai执行定时句柄
};
},
computed
:
{
...
mapState
(
"MMCFlightControlCenter/uav"
,
[
"uav"
,
"selectMount"
,
"isQingLiu"
]),
...
mapState
(
"MMCFlightControlCenter/uav"
,
[
"uav"
,
"selectMount"
,
"isQingLiu"
,
"airlineData"
,
]),
/**
* 播放器组件名
*/
...
...
@@ -550,17 +556,52 @@ export default {
}
},
},
uavRealTimeData
:
function
(
newval
)
{
"uavRealTimeData.airlineProgress"
:
{
handler
(
newVal
,
oldVal
)
{
//获取当前航线航点的ai, 进行ai操作
if
(
newVal
?.
waypointIndex
===
oldVal
?.
waypointIndex
)
{
return
;
}
//清除上一个航点的执行定时器
clearInterval
(
this
.
aiTimeHandle
);
let
find
=
this
.
airlineData
?.
linePointSaveReqVOS
?.
find
(
(
item
,
i
)
=>
i
===
newVal
.
waypointIndex
);
if
(
find
)
{
let
singleList
=
find
.
pointDetectorSaveReqVOS
.
filter
(
(
item
)
=>
item
.
detectorValue
===
0
);
//汇总单点
let
manyList
=
find
.
pointDetectorSaveReqVOS
.
filter
(
(
item
)
=>
item
.
detectorValue
===
1
);
//汇总多次
//执行单点
this
.
$nextTick
(()
=>
{
singleList
.
forEach
((
item
)
=>
{
this
.
$refs
.
aiList
.
aiIdentify
(
item
.
id
);
});
});
//定时执行
this
.
aiTimeHandle
=
setInterval
(()
=>
{
manyList
?.
forEach
((
item
)
=>
{
this
.
$refs
.
aiList
.
aiIdentify
(
item
.
id
);
});
},
3000
);
}
},
},
uavRealTimeData
:
function
(
newVal
)
{
let
gps
=
null
;
if
(
new
v
al
&&
new
v
al
.
rtk
&&
new
v
al
.
rtk
.
type
==
19
&&
new
v
al
.
rtk
.
isMainSensor
new
V
al
&&
new
V
al
.
rtk
&&
new
V
al
.
rtk
.
type
==
19
&&
new
V
al
.
rtk
.
isMainSensor
)
{
gps
=
new
v
al
.
rtk
;
gps
=
new
V
al
.
rtk
;
}
else
{
gps
=
new
v
al
.
gps
;
gps
=
new
V
al
.
gps
;
}
if
(
!
gps
)
{
return
;
...
...
@@ -610,6 +651,7 @@ export default {
},
beforeDestroy
()
{
window
.
removeEventListener
(
"resize"
,
this
.
fullScreenChangeFn
);
clearInterval
(
this
.
aiTimeHandle
);
},
methods
:
{
startLinePoint
()
{
...
...
@@ -747,7 +789,7 @@ export default {
this
.
$store
.
dispatch
(
"MMCFlightControlCenter/uav/takePhotos"
,
{
isQingLiu
:
this
.
isQingLiu
,
videoID
:
1
,
// 视频通道ID(需保持唯一)
/* dbID: "929", // 历史记录id
/* dbID: "929", // 历史记录id
name: "z30Pro", // 挂载名称(如果知道挂载名称,将传名称即可,通道号可以不用传)
taskID: "", // 任务ID,可传可不传 */
callback
:
(
isOk
)
=>
{
...
...
src/components/MMCFlightControlCenter/store/uav.js
浏览文件 @
6d902d12
...
...
@@ -18,7 +18,7 @@ const defaultPos = {
function
initUavRealTimeData
()
{
return
{
isFlying
:
false
,
// true 飞机处于飞行中,电动机解锁后,飞机就处于飞行中
isFlying
:
false
,
// true 飞机处于飞行中,电动机解锁后,飞机就处于飞行中
attitude
:
{
roll
:
0
,
// 飞机的俯仰值:向前为正,向后为负。单位为度。
pitch
:
0
,
// 飞机的横滚值:正向为正,反向为负。单位为度。
...
...
@@ -183,6 +183,15 @@ function initUavRealTimeData() {
autoFlightSpeed
:
0
,
//航线飞行速度默认5m
waypointList
:
null
,
},
airlineProgress
:
{
action
:
"NON"
,
//执行的动作,NON表示飞到航点位置
actionIndex
:
1
,
//航点动作执行索引
isFinish
:
true
,
//true航线任务执行完成,false未完成
isFinishAction
:
true
,
//航点执行完成,true执行完成,false为执行完成
progress
:
0
,
//航线任务执行进度
totalWaypointCount
:
0
,
//航线任务总进度
waypointIndex
:
1
,
//执行航点索引值,从1开始
},
};
}
...
...
@@ -313,6 +322,7 @@ const actions = {
const
type270
=
data
[
270
]?.
data
;
// 飞控应答消息
const
type260
=
data
[
260
]?.
data
;
// 无人机提示信息
const
type261
=
data
[
261
]?.
data
;
// 航线上传完成信息
const
type265
=
data
[
265
]?.
data
;
// 航线执行进度
let
msgList
=
state
.
uavRealTimeData
.
msgList
||
[];
...
...
@@ -392,6 +402,7 @@ const actions = {
msg
:
type270
,
msgList
,
uploadAirline
:
type261
,
airlineProgress
:
type265
,
},
});
...
...
@@ -674,7 +685,7 @@ const actions = {
// 生成架次号
const
flightSortieId
=
await
TaskInfo
.
flightSortieId
({
device_id
:
state
.
hangar
.
uav
.
deviceId
,
reouteId
:
state
.
airlineData
.
id
reouteId
:
state
.
airlineData
.
id
,
});
/* const flightSortieId = {
data: `tmj-v4-${Date.now()}`
...
...
@@ -1176,7 +1187,7 @@ const actions = {
type
:
528
,
};
let
isQingLiu
=
state
.
isQingLiu
;
if
(
data
.
isQingLiu
!==
undefined
)
{
if
(
data
.
isQingLiu
!==
undefined
)
{
isQingLiu
=
data
.
isQingLiu
;
}
if
(
isQingLiu
)
{
...
...
@@ -1246,7 +1257,7 @@ const actions = {
type
:
528
,
};
let
isQingLiu
=
state
.
isQingLiu
;
if
(
data
.
isQingLiu
!==
undefined
)
{
if
(
data
.
isQingLiu
!==
undefined
)
{
isQingLiu
=
data
.
isQingLiu
;
}
if
(
isQingLiu
)
{
...
...
编写
预览
Markdown
格式
0%
重试
或
添加新文件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论