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 个修改的文件
包含
27 行增加
和
10 行删除
+27
-10
uav.js
src/components/MMCFlightControlCenter/store/uav.js
+27
-10
没有找到文件。
src/components/MMCFlightControlCenter/store/uav.js
浏览文件 @
d8e69535
...
@@ -6,7 +6,7 @@ let positions = []; // 飞机走过的点, 会一直累计, 每n秒减半一次,
...
@@ -6,7 +6,7 @@ let positions = []; // 飞机走过的点, 会一直累计, 每n秒减半一次,
setInterval
(()
=>
{
setInterval
(()
=>
{
if
(
positions
.
length
>
1000
)
{
if
(
positions
.
length
>
1000
)
{
positions
=
positions
.
filter
((
x
,
index
)
=>
index
%
2
===
0
);
positions
=
positions
.
filter
((
x
,
index
)
=>
index
%
2
===
0
);
console
.
log
(
'飞行轨迹'
,
positions
);
console
.
log
(
"飞行轨迹"
,
positions
);
}
}
},
60000
);
},
60000
);
if
(
!
window
.
$mmc_stl
)
{
if
(
!
window
.
$mmc_stl
)
{
...
@@ -14,7 +14,7 @@ if (!window.$mmc_stl) {
...
@@ -14,7 +14,7 @@ if (!window.$mmc_stl) {
}
}
window
.
$mmc_stl
.
positions
=
()
=>
{
window
.
$mmc_stl
.
positions
=
()
=>
{
console
.
log
(
positions
);
console
.
log
(
positions
);
}
}
;
const
defaultPos
=
{
const
defaultPos
=
{
latitude
:
0
,
// 纬度
latitude
:
0
,
// 纬度
longitude
:
0
,
// 经度
longitude
:
0
,
// 经度
...
@@ -432,7 +432,7 @@ const actions = {
...
@@ -432,7 +432,7 @@ const actions = {
if
(
item
.
mountId
===
type259
.
mountId
)
{
if
(
item
.
mountId
===
type259
.
mountId
)
{
return
{
return
{
...
item
,
...
item
,
...
type259
...
type259
,
};
};
}
}
return
item
;
return
item
;
...
@@ -507,7 +507,11 @@ const actions = {
...
@@ -507,7 +507,11 @@ const actions = {
}
else
{
}
else
{
// const posData = UAVDataParser(state.uavRealTimeData); // 这种写法在执行rollup混淆压缩后, posData对象会变成elementUI的对象,原因未知
// 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
)
{
if
(
!
flag
)
{
positions
.
push
(
UAVDataParser
(
state
.
uavRealTimeData
).
position
);
positions
.
push
(
UAVDataParser
(
state
.
uavRealTimeData
).
position
);
}
}
...
@@ -700,7 +704,12 @@ const actions = {
...
@@ -700,7 +704,12 @@ const actions = {
* @param {object} data.taskInfoId //任务id
* @param {object} data.taskInfoId //任务id
*/
*/
async
takeOff
({
state
,
commit
},
data
)
{
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
)
{
if
(
state
.
uav
.
network
==
2
)
{
try
{
try
{
let
flightSortieId
;
let
flightSortieId
;
...
@@ -709,7 +718,7 @@ const actions = {
...
@@ -709,7 +718,7 @@ const actions = {
taskInfoId
:
data
.
taskInfoId
||
undefined
,
taskInfoId
:
data
.
taskInfoId
||
undefined
,
deviceId
:
state
.
uav
.
deviceId
,
deviceId
:
state
.
uav
.
deviceId
,
reouteId
:
state
.
airlineData
.
id
,
reouteId
:
state
.
airlineData
.
id
,
})
})
;
}
else
{
}
else
{
// 生成架次号
// 生成架次号
flightSortieId
=
await
TaskInfo
.
flightSortieId
({
flightSortieId
=
await
TaskInfo
.
flightSortieId
({
...
@@ -736,9 +745,16 @@ const actions = {
...
@@ -736,9 +745,16 @@ const actions = {
headingMode
:
"AUTO"
,
headingMode
:
"AUTO"
,
isExitMissionOnRCSignalLostEnabled
:
true
,
isExitMissionOnRCSignalLostEnabled
:
true
,
maxFlightSpeed
:
12
,
maxFlightSpeed
:
12
,
rallyList
:
[
{
longitude
:
diversionPointArr
[
0
],
altitude
:
diversionPointArr
[
2
],
latitude
:
diversionPointArr
[
1
],
},
],
},
},
},
},
callback
()
{
},
callback
()
{},
});
});
// 告诉飞控开始任务,并且把架次号和 任务id传过去
// 告诉飞控开始任务,并且把架次号和 任务id传过去
...
@@ -751,7 +767,7 @@ const actions = {
...
@@ -751,7 +767,7 @@ const actions = {
flightSortiesID
:
flightSortieId
.
data
,
flightSortiesID
:
flightSortieId
.
data
,
},
},
},
},
callback
()
{
},
callback
()
{},
});
});
// 起飞指令
// 起飞指令
...
@@ -1317,7 +1333,8 @@ const actions = {
...
@@ -1317,7 +1333,8 @@ const actions = {
window
.
$mmc_stl
.
$store
.
dispatch
(
"MMCMQTT/publish"
,
{
window
.
$mmc_stl
.
$store
.
dispatch
(
"MMCMQTT/publish"
,
{
topic
:
"PX4/OBTAIN/"
+
state
.
uav
.
deviceId
,
topic
:
"PX4/OBTAIN/"
+
state
.
uav
.
deviceId
,
data
:
{
data
:
{
type
:
window
.
$mmc_stl
.
$store
.
state
.
MMCMQTT
.
orders
.
云台控制指令
can
包透传
,
type
:
window
.
$mmc_stl
.
$store
.
state
.
MMCMQTT
.
orders
.
云台控制指令
can
包透传
,
data
:
{
data
:
{
mountId
:
data
.
mountId
,
mountId
:
data
.
mountId
,
payload
:
data
.
buffer
,
payload
:
data
.
buffer
,
...
@@ -1376,7 +1393,7 @@ const actions = {
...
@@ -1376,7 +1393,7 @@ const actions = {
type
:
window
.
$mmc_stl
.
$store
.
state
.
MMCMQTT
.
orders
.
链路切换
,
type
:
window
.
$mmc_stl
.
$store
.
state
.
MMCMQTT
.
orders
.
链路切换
,
data
,
data
,
},
},
callback
()
{
},
callback
()
{},
});
});
},
},
// 键盘控制
// 键盘控制
...
...
编写
预览
Markdown
格式
0%
重试
或
添加新文件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论