Skip to content
项目
群组
代码片段
帮助
当前项目
正在载入...
登录 / 注册
切换导航面板
M
mmc-stl-vue2
概览
概览
详情
活动
周期分析
版本库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
统计图
问题
0
议题
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
日程表
图表
维基
Wiki
代码片段
代码片段
成员
成员
折叠边栏
关闭边栏
活动
图像
聊天
创建新问题
作业
提交
问题看板
Open sidebar
Administrator
mmc-stl-vue2
Commits
d8e69535
提交
d8e69535
authored
5月 29, 2025
作者:
温凯
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
fix(uav): 修复一键起飞时未检查备降点的问题
上级
47f051c4
隐藏空白字符变更
内嵌
并排
正在显示
1 个修改的文件
包含
41 行增加
和
24 行删除
+41
-24
uav.js
src/components/MMCFlightControlCenter/store/uav.js
+41
-24
没有找到文件。
src/components/MMCFlightControlCenter/store/uav.js
浏览文件 @
d8e69535
...
...
@@ -6,7 +6,7 @@ let positions = []; // 飞机走过的点, 会一直累计, 每n秒减半一次,
setInterval
(()
=>
{
if
(
positions
.
length
>
1000
)
{
positions
=
positions
.
filter
((
x
,
index
)
=>
index
%
2
===
0
);
console
.
log
(
'飞行轨迹'
,
positions
);
console
.
log
(
"飞行轨迹"
,
positions
);
}
},
60000
);
if
(
!
window
.
$mmc_stl
)
{
...
...
@@ -14,7 +14,7 @@ if (!window.$mmc_stl) {
}
window
.
$mmc_stl
.
positions
=
()
=>
{
console
.
log
(
positions
);
}
}
;
const
defaultPos
=
{
latitude
:
0
,
// 纬度
longitude
:
0
,
// 经度
...
...
@@ -355,16 +355,16 @@ const actions = {
type260
.
grade
<=
2
?
"[危险]"
:
type260
.
grade
==
3
?
"[错误]"
:
type260
.
grade
==
4
?
"[警告]"
:
type260
.
grade
==
5
?
"[通知]"
:
type260
.
grade
==
6
?
"[正常]"
:
type260
.
grade
==
7
?
"[调试]"
:
"AUTO"
,
?
"[错误]"
:
type260
.
grade
==
4
?
"[警告]"
:
type260
.
grade
==
5
?
"[通知]"
:
type260
.
grade
==
6
?
"[正常]"
:
type260
.
grade
==
7
?
"[调试]"
:
"AUTO"
,
text
:
type260
.
msg
,
time
:
moment
(
type260
.
timestamp
).
format
(
"YYYY-MM-DD HH:mm:ss"
),
timestamp
:
type260
.
timestamp
,
...
...
@@ -432,7 +432,7 @@ const actions = {
if
(
item
.
mountId
===
type259
.
mountId
)
{
return
{
...
item
,
...
type259
...
type259
,
};
}
return
item
;
...
...
@@ -499,15 +499,19 @@ const actions = {
if
(
state
.
uavRealTimeData
.
locationCoordinate3D
.
longitude
)
{
if
(
state
.
uavRealTimeData
.
locationCoordinate3D
.
longitude
===
defaultPos
.
longitude
&&
defaultPos
.
longitude
&&
state
.
uavRealTimeData
.
locationCoordinate3D
.
latitude
===
defaultPos
.
latitude
defaultPos
.
latitude
)
{
// 默认坐标不记录
}
else
{
// const posData = UAVDataParser(state.uavRealTimeData); // 这种写法在执行rollup混淆压缩后, posData对象会变成elementUI的对象,原因未知
// 更新轨迹
let
flag
=
positions
.
some
(
val
=>
val
.
x
==
UAVDataParser
(
state
.
uavRealTimeData
).
position
.
x
&&
val
.
y
==
UAVDataParser
(
state
.
uavRealTimeData
).
position
.
y
)
let
flag
=
positions
.
some
(
(
val
)
=>
val
.
x
==
UAVDataParser
(
state
.
uavRealTimeData
).
position
.
x
&&
val
.
y
==
UAVDataParser
(
state
.
uavRealTimeData
).
position
.
y
);
if
(
!
flag
)
{
positions
.
push
(
UAVDataParser
(
state
.
uavRealTimeData
).
position
);
}
...
...
@@ -516,7 +520,7 @@ const actions = {
if
(
state
.
uavRealTimeData
.
locationCoordinate3D
.
longitude
!==
defaultPos
.
longitude
&&
defaultPos
.
longitude
&&
!
state
.
uavModelEntity
)
{
dispatch
(
"createUavModel"
);
...
...
@@ -700,7 +704,12 @@ const actions = {
* @param {object} data.taskInfoId //任务id
*/
async
takeOff
({
state
,
commit
},
data
)
{
console
.
log
(
state
.
airlineData
,
data
);
let
diversionPoint
=
state
.
uav
.
diversionPoint
;
if
(
!
diversionPoint
)
{
return
this
.
$message
.
warning
(
"设备暂无备降点,无法进行一键起飞!"
);
}
let
diversionPointArr
=
diversionPoint
.
split
(
","
);
console
.
log
(
diversionPointArr
,
"diversionPointArr"
);
if
(
state
.
uav
.
network
==
2
)
{
try
{
let
flightSortieId
;
...
...
@@ -709,7 +718,7 @@ const actions = {
taskInfoId
:
data
.
taskInfoId
||
undefined
,
deviceId
:
state
.
uav
.
deviceId
,
reouteId
:
state
.
airlineData
.
id
,
})
})
;
}
else
{
// 生成架次号
flightSortieId
=
await
TaskInfo
.
flightSortieId
({
...
...
@@ -736,9 +745,16 @@ const actions = {
headingMode
:
"AUTO"
,
isExitMissionOnRCSignalLostEnabled
:
true
,
maxFlightSpeed
:
12
,
rallyList
:
[
{
longitude
:
diversionPointArr
[
0
],
altitude
:
diversionPointArr
[
2
],
latitude
:
diversionPointArr
[
1
],
},
],
},
},
callback
()
{
},
callback
()
{},
});
// 告诉飞控开始任务,并且把架次号和 任务id传过去
...
...
@@ -751,7 +767,7 @@ const actions = {
flightSortiesID
:
flightSortieId
.
data
,
},
},
callback
()
{
},
callback
()
{},
});
// 起飞指令
...
...
@@ -1317,7 +1333,8 @@ const actions = {
window
.
$mmc_stl
.
$store
.
dispatch
(
"MMCMQTT/publish"
,
{
topic
:
"PX4/OBTAIN/"
+
state
.
uav
.
deviceId
,
data
:
{
type
:
window
.
$mmc_stl
.
$store
.
state
.
MMCMQTT
.
orders
.
云台控制指令
can
包透传
,
type
:
window
.
$mmc_stl
.
$store
.
state
.
MMCMQTT
.
orders
.
云台控制指令
can
包透传
,
data
:
{
mountId
:
data
.
mountId
,
payload
:
data
.
buffer
,
...
...
@@ -1358,7 +1375,7 @@ const actions = {
if
(
res
.
data
.
currentOperator
&&
res
.
data
.
currentOperator
===
window
.
$mmc_stl
.
$store
.
state
.
MMCFlightControlCenter
.
userInfo
.
id
window
.
$mmc_stl
.
$store
.
state
.
MMCFlightControlCenter
.
userInfo
.
id
)
{
return
true
;
}
...
...
@@ -1376,7 +1393,7 @@ const actions = {
type
:
window
.
$mmc_stl
.
$store
.
state
.
MMCMQTT
.
orders
.
链路切换
,
data
,
},
callback
()
{
},
callback
()
{},
});
},
// 键盘控制
...
...
编写
预览
Markdown
格式
0%
重试
或
添加新文件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论