【类 型】:feat
【主 题】:地图组件 获取航线对象 对象外层加questAss字段 【描 述】: [原因]:mqtt发送控制主题改为 cmd/+ 单主题 航线外层包一个questAss键 [过程]: [影响]: 【结 束】 # 类型 包含: # feat:新功能(feature) # fix:修补bug # docs:文档(documentation) # style: 格式(不影响代码运行的变动) # refactor:重构(即不是新增功能,也不是修改bug的代码变动) # test:增加测试 # chore:构建过程或辅助工具的变动
This commit is contained in:
parent
244d70e6f2
commit
91f024105d
@ -68,25 +68,26 @@
|
||||
</el-form-item>
|
||||
<el-form-item label="飞机操作">
|
||||
<el-button-group>
|
||||
<el-button size="mini" class="f-s-14" v-if="planeState & 1 && airLock" key="pubBut" type="info"
|
||||
<el-button size="mini" class="f-s-14" v-if="planeState.state & 1 && airLock" key="pubBut" type="info"
|
||||
icon="iconfont el-icon-loading" disabled>
|
||||
<font class="m-l-5">注册航线</font>
|
||||
</el-button>
|
||||
<el-button size="mini" class="f-s-14" v-if="planeState & 1 && !airLock" type="primary"
|
||||
<el-button size="mini" class="f-s-14" v-if="planeState.state & 1 && !airLock" type="primary"
|
||||
icon="f-s-14 iconfont icon-chakanzhihangrizhi" @click="checkQuest">
|
||||
<font class="m-l-5">提交任务</font>
|
||||
</el-button>
|
||||
<el-button size="mini" class="f-s-14" v-if="planeState & 2" key="wirteBut" type="info" :loading="true"
|
||||
disabled>
|
||||
<el-button size="mini" class="f-s-14" v-if="planeState.state & 2" key="wirteBut" type="info"
|
||||
:loading="true" disabled>
|
||||
<font class="m-l-5">航点写入中···</font>
|
||||
</el-button>
|
||||
<el-button size="mini" class="f-s-14" v-if="planeState & 4 && !(planeState & 16)" type="warning"
|
||||
icon="f-s-14 iconfont icon-jiesuo"
|
||||
<el-button size="mini" class="f-s-14" v-if="planeState.state & 4 && !(planeState.state & 16)"
|
||||
type="warning" icon="f-s-14 iconfont icon-jiesuo"
|
||||
@click="publishFun('{setPlaneState:{bit:3,state:1,count:2,param:[1,0]}}'); speakText('解锁飞机')">
|
||||
<font class="m-l-5">解锁飞机</font>
|
||||
</el-button>
|
||||
<el-button size="mini" class="f-s-14" v-if="planeState & 16 && !(planeState & 1) && !(planeState & 2)"
|
||||
type="success" icon="f-s-14 iconfont icon-yangshi_icon_tongyong_departure"
|
||||
<el-button size="mini" class="f-s-14"
|
||||
v-if="planeState.state & 16 && !(planeState.state & 1) && !(planeState.state & 2)" type="success"
|
||||
icon="f-s-14 iconfont icon-yangshi_icon_tongyong_departure"
|
||||
@click="publishFun('{setPlaneState:{bit:5,state:1}'); speakText('准备起飞,执行送餐任务')">
|
||||
<font class="m-l-5">执行任务</font>
|
||||
</el-button>
|
||||
@ -675,9 +676,7 @@ export default {
|
||||
},
|
||||
plane: {
|
||||
handler (val) {
|
||||
this.publishFun('{getPlaneState:1}')
|
||||
this.planeState = val.planeState
|
||||
console.log(this.planeState)
|
||||
this.planeState = val.planeState// 实时更新飞机数据
|
||||
},
|
||||
deep: true
|
||||
}
|
||||
|
@ -189,21 +189,21 @@ export default {
|
||||
// 初始化清空航线
|
||||
this.clearRoute()
|
||||
// 获取所有航点 及 非起点所有航点
|
||||
routeObj.tasks.forEach((element, index) => {
|
||||
routeObj.questAss.tasks.forEach((element, index) => {
|
||||
const lngLat = [element.y, element.x, 100]
|
||||
this.lngLats.push(lngLat)
|
||||
if (index > 1 && index < routeObj.taskcount - 1) {
|
||||
if (index > 1 && index < routeObj.questAss.taskcount - 1) {
|
||||
this.wayLngLats.push(lngLat)
|
||||
}
|
||||
})
|
||||
// 跳转home点位置
|
||||
this.goto(this.lngLats[0])
|
||||
// 起飞 降落虚线
|
||||
if (routeObj.tasks[this.lngLats.length - 1].command === 20) {
|
||||
if (routeObj.questAss.tasks[this.lngLats.length - 1].command === 20) {
|
||||
this.takeoffLngLats.push(this.lngLats[2])
|
||||
this.takeoffLngLats.push(this.lngLats[1])
|
||||
this.takeoffLngLats.push(this.lngLats[this.lngLats.length - 2])
|
||||
} else if (routeObj.tasks[this.lngLats.length - 1].command === 21) {
|
||||
} else if (routeObj.questAss.tasks[this.lngLats.length - 1].command === 21) {
|
||||
this.takeoffLngLats.push(this.lngLats[2])
|
||||
this.takeoffLngLats.push(this.lngLats[1])
|
||||
}
|
||||
@ -308,9 +308,9 @@ export default {
|
||||
} else if (index === 1) { // 起飞点
|
||||
let takeoffPoint
|
||||
// 起点图标设定 根据最后一个航点为RETURN_TO_LAUNCH 20 返回起点降落 或者 最后一个航点为LAND 21 指定点降落
|
||||
if (routeObj.tasks[this.lngLats.length - 1].command === 20) {
|
||||
if (routeObj.questAss.tasks[this.lngLats.length - 1].command === 20) {
|
||||
takeoffPoint = 'takeoffLandPoint'
|
||||
} else if (routeObj.tasks[this.lngLats.length - 1].command === 21) {
|
||||
} else if (routeObj.questAss.tasks[this.lngLats.length - 1].command === 21) {
|
||||
takeoffPoint = 'takeoffPoint'
|
||||
}
|
||||
this.map.addSource('takeoff_point', {
|
||||
@ -343,11 +343,11 @@ export default {
|
||||
if (index !== this.lngLats.length - 1) { // 最后一个点不显示 要不和最后一个点结合 要不和起点结合
|
||||
let wayPoint = 'wayPoint'
|
||||
if (index === this.lngLats.length - 2) { // 降落点 如果是LAND 21 和最后一个waypoint点结合
|
||||
if (routeObj.tasks[this.lngLats.length - 1].command === 21) {
|
||||
if (routeObj.questAss.tasks[this.lngLats.length - 1].command === 21) {
|
||||
wayPoint = 'wayLandPoint'
|
||||
}
|
||||
}
|
||||
if (routeObj.tasks[index].command === 94) { // command字段为94既然 投放放勾航点 放勾图标
|
||||
if (routeObj.questAss.tasks[index].command === 94) { // command字段为94既然 投放放勾航点 放勾图标
|
||||
wayPoint = 'hookPoint'
|
||||
}
|
||||
this.map.addSource('way_point' + index, {
|
||||
|
@ -91,7 +91,7 @@ export default {
|
||||
this.form.upFile = ''
|
||||
},
|
||||
handleUpSuccess (res) {
|
||||
this.$refs.mapbox.makeRoute(res.content.questAss)// 绘出航线
|
||||
this.$refs.mapbox.makeRoute(res.content)// 绘出航线
|
||||
if (res.status === 0) {
|
||||
this.fileList = []
|
||||
this.$message.error(res.msg)
|
||||
|
Loading…
Reference in New Issue
Block a user