Compare commits
2 Commits
63212c130b
...
48e2a26ed7
Author | SHA1 | Date | |
---|---|---|---|
![]() |
48e2a26ed7 | ||
![]() |
4e3acac032 |
@ -1,7 +1,7 @@
|
|||||||
<template>
|
<template>
|
||||||
<div class="w-100 h-100 mainBox">
|
<div class="w-100 h-100 mainBox">
|
||||||
<!-- 弹出框 -->
|
<!-- 弹出框 -->
|
||||||
<el-dialog :title="dialogTitle" :visible.sync="dialogVisible" width="320px" top="30vh">
|
<el-dialog :title="dialogTitle" :visible.sync="dialogVisible" width="320px" top="30vh" @close="closeCallback" @open="openCallback">
|
||||||
<!-- 起飞设置弹出框 -->
|
<!-- 起飞设置弹出框 -->
|
||||||
<template v-if="dialogItem == 'takeoffBox'">
|
<template v-if="dialogItem == 'takeoffBox'">
|
||||||
<el-slider class="w-100" v-model="takeoffValue" :show-tooltip="false" show-input :min="1" :max="100">
|
<el-slider class="w-100" v-model="takeoffValue" :show-tooltip="false" show-input :min="1" :max="100">
|
||||||
@ -9,7 +9,7 @@
|
|||||||
<span slot="footer" class="dialog-footer">
|
<span slot="footer" class="dialog-footer">
|
||||||
<el-button size="medium" @click="dialogVisible = false">关闭</el-button>
|
<el-button size="medium" @click="dialogVisible = false">关闭</el-button>
|
||||||
<el-button size="medium" type="primary"
|
<el-button size="medium" type="primary"
|
||||||
@click="publishFun(`{setPlaneState:{bit:6,state:1,count:1,param:[${takeoffValue}]}}`); speakText('确认起飞')">确认起飞</el-button>
|
@click="publishFun(`{guidedMode:{alt:${takeoffValue}}}`); speakText('确认起飞')">飞至</el-button>
|
||||||
</span>
|
</span>
|
||||||
</template>
|
</template>
|
||||||
<!-- 摄像头弹出框 -->
|
<!-- 摄像头弹出框 -->
|
||||||
@ -50,6 +50,38 @@
|
|||||||
<el-button size="medium" @click="handlerCloseCompassBox">关闭</el-button>
|
<el-button size="medium" @click="handlerCloseCompassBox">关闭</el-button>
|
||||||
</span>
|
</span>
|
||||||
</template>
|
</template>
|
||||||
|
<!-- 校准加速度计 -->
|
||||||
|
<template v-if="dialogItem === 'acceBox'">
|
||||||
|
<div v-loading="acceState===null"></div>
|
||||||
|
<div v-if="acceState==='level'">
|
||||||
|
水平
|
||||||
|
</div>
|
||||||
|
<div v-else-if="acceState==='left'">
|
||||||
|
左
|
||||||
|
</div>
|
||||||
|
<div v-else-if="acceState==='right'">
|
||||||
|
右
|
||||||
|
</div>
|
||||||
|
<div v-else-if="acceState==='down'">
|
||||||
|
前
|
||||||
|
</div>
|
||||||
|
<div v-else-if="acceState==='up'">
|
||||||
|
后
|
||||||
|
</div>
|
||||||
|
<div v-else-if="acceState==='back'">
|
||||||
|
反
|
||||||
|
</div>
|
||||||
|
<div v-else-if="acceState==='successful'">
|
||||||
|
校准成功,重启飞机即可生效!
|
||||||
|
</div>
|
||||||
|
<div v-else-if="acceState==='failed'">
|
||||||
|
校准失败
|
||||||
|
</div>
|
||||||
|
<span slot="footer" class="dialog-footer">
|
||||||
|
<el-button size="medium" @click="handlerCloseAcceBox">关闭</el-button>
|
||||||
|
<el-button size="medium" v-if="acceState !== 'successful' && acceState !== 'failed' && acceState !== null" @click="publishFun('{initAcce:2}')" type="primary">已摆好</el-button>
|
||||||
|
</span>
|
||||||
|
</template>
|
||||||
</el-dialog>
|
</el-dialog>
|
||||||
<!-- 底边 tab控件组 -->
|
<!-- 底边 tab控件组 -->
|
||||||
<div class="flex column mr mac tabContainer p-l-10 p-r-10">
|
<div class="flex column mr mac tabContainer p-l-10 p-r-10">
|
||||||
@ -100,8 +132,7 @@
|
|||||||
<font class="m-l-5">航点写入中···</font>
|
<font class="m-l-5">航点写入中···</font>
|
||||||
</el-button>
|
</el-button>
|
||||||
<el-button size="mini" class="f-s-14" v-else-if="Number(plane.planeState.state) === 4" type="warning"
|
<el-button size="mini" class="f-s-14" v-else-if="Number(plane.planeState.state) === 4" type="warning"
|
||||||
icon="f-s-14 iconfont icon-jiesuo"
|
icon="f-s-14 iconfont icon-jiesuo" @click="publishFun('{unlock:1}'); speakText('解锁飞机')">
|
||||||
@click="publishFun('{setPlaneState:{bit:3,state:1,count:2,param:[1,0]}}'); speakText('解锁飞机')">
|
|
||||||
<font class="m-l-5">解锁飞机</font>
|
<font class="m-l-5">解锁飞机</font>
|
||||||
</el-button>
|
</el-button>
|
||||||
<el-button size="mini" class="f-s-14" v-else-if="Number(plane.planeState.state) === 12" type="info"
|
<el-button size="mini" class="f-s-14" v-else-if="Number(plane.planeState.state) === 12" type="info"
|
||||||
@ -141,26 +172,27 @@
|
|||||||
</div>
|
</div>
|
||||||
<div class="butIconBox gap10 flex">
|
<div class="butIconBox gap10 flex">
|
||||||
<el-button size="medium" type="primary" class="flex1 butIcon"
|
<el-button size="medium" type="primary" class="flex1 butIcon"
|
||||||
@click="publishFun('{setPlaneState:{bit:3,state:1,count:2,param:[1,0]}}'); speakText('解锁飞机')">
|
@click="publishFun('{unlock:1}'); speakText('解锁飞机')">
|
||||||
<i class="iconfont icon-jiesuo f-s-24"></i>
|
<i class="iconfont icon-jiesuo f-s-24"></i>
|
||||||
<div class="m-t-5">解锁</div>
|
<div class="m-t-5">解锁</div>
|
||||||
</el-button>
|
</el-button>
|
||||||
<el-button size="medium" type="primary" class="flex1 butIcon"
|
<el-button size="medium" type="primary" class="flex1 butIcon"
|
||||||
@click="confirmation('飞机加锁,螺旋桨将停转,请谨慎操作!', '加锁操作', '{setPlaneState:{bit:3,state:0,count:2,param:[0,21196]}}'); speakText('加锁,请注意安全')">
|
@click="confirmation('飞机加锁,螺旋桨将停转,请谨慎操作!', '加锁操作', '{lock:1}'); speakText('加锁,请注意安全')">
|
||||||
<i class=" iconfont icon-suoding f-s-24"></i>
|
<i class=" iconfont icon-suoding f-s-24"></i>
|
||||||
<div class="m-t-5">加锁</div>
|
<div class="m-t-5">加锁</div>
|
||||||
</el-button>
|
</el-button>
|
||||||
<el-button size="medium" type="primary" class="flex1 butIcon"
|
<el-button size="medium" type="primary" class="flex1 butIcon"
|
||||||
@click="dialogVisible = true; dialogTitle = '起飞高度(米)设置'; dialogItem = 'takeoffBox'; speakText('设置起飞高度')">
|
@click="dialogVisible = true; dialogTitle = '高度设置(米)'; dialogItem = 'takeoffBox'; speakText('设置起飞高度')">
|
||||||
<i class="iconfont icon-yangshi_icon_tongyong_departure f-s-24"></i>
|
<i class="iconfont icon-yangshi_icon_tongyong_departure f-s-24"></i>
|
||||||
<div class="m-t-5">起飞</div>
|
<div class="m-t-5">起飞</div>
|
||||||
</el-button>
|
</el-button>
|
||||||
<el-button size="medium" type="primary" class="flex1 butIcon"
|
<el-button size="medium" type="primary" class="flex1 butIcon"
|
||||||
@click="publishFun('{setPlaneState:{bit:7,state:1}}'); speakText('悬停')">
|
@click="publishFun('{loiterMode:1}'); speakText('悬停')">
|
||||||
<i class="iconfont icon-fengzheng1 f-s-24"></i>
|
<i class="iconfont icon-fengzheng1 f-s-24"></i>
|
||||||
<div class="m-t-5">悬停</div>
|
<div class="m-t-5">悬停</div>
|
||||||
</el-button>
|
</el-button>
|
||||||
<el-button size="medium" type="primary" class="flex1 butIcon" @click="speakText('继续执行航线')">
|
<el-button size="medium" type="primary" class="flex1 butIcon"
|
||||||
|
@click="publishFun('{autoMode:1}'); speakText('继续执行航线')">
|
||||||
<i class="iconfont icon-duandianxufei f-s-24"></i>
|
<i class="iconfont icon-duandianxufei f-s-24"></i>
|
||||||
<div class="m-t-5">复航</div>
|
<div class="m-t-5">复航</div>
|
||||||
</el-button>
|
</el-button>
|
||||||
@ -257,11 +289,13 @@
|
|||||||
<i class="iconfont icon-zhinanzhen f-s-24"></i>
|
<i class="iconfont icon-zhinanzhen f-s-24"></i>
|
||||||
<div class="m-t-5">磁罗盘</div>
|
<div class="m-t-5">磁罗盘</div>
|
||||||
</el-button>
|
</el-button>
|
||||||
<el-button size="medium" type="primary" class="flex1 butIcon" @click="speakText('校准加速度计')">
|
<el-button size="medium" type="primary" class="flex1 butIcon"
|
||||||
|
@click="publishFun('{initAcce:1}'); speakText('校准加速度计');dialogVisible = true; dialogTitle = '校准加速度计';dialogItem = 'acceBox';">
|
||||||
<i class="iconfont icon-zuobiaozhoupeizhixiang f-s-24"></i>
|
<i class="iconfont icon-zuobiaozhoupeizhixiang f-s-24"></i>
|
||||||
<div class="m-t-5">加速度计</div>
|
<div class="m-t-5">加速度计</div>
|
||||||
</el-button>
|
</el-button>
|
||||||
<el-button size="medium" type="primary" class="flex1 butIcon" @click="speakText('写入参数')">
|
<el-button size="medium" type="primary" class="flex1 butIcon"
|
||||||
|
@click="speakText('写入参数')">
|
||||||
<i class="iconfont icon-canshupeizhi f-s-24"></i>
|
<i class="iconfont icon-canshupeizhi f-s-24"></i>
|
||||||
<div class="m-t-5">写入参数</div>
|
<div class="m-t-5">写入参数</div>
|
||||||
</el-button>
|
</el-button>
|
||||||
@ -382,19 +416,28 @@ export default {
|
|||||||
* @description: 磁罗盘校准进度
|
* @description: 磁罗盘校准进度
|
||||||
*/
|
*/
|
||||||
completionPct () {
|
completionPct () {
|
||||||
if (this.plane && this.plane.planeState) {
|
if (this.plane && this.plane.planeState && this.plane.planeState.completionPct) {
|
||||||
return Number(this.plane.planeState.completionPct)
|
return Number(this.plane.planeState.completionPct)
|
||||||
}
|
}
|
||||||
return null
|
return 0
|
||||||
},
|
},
|
||||||
/**
|
/**
|
||||||
* @description: 磁罗盘校准结果
|
* @description: 磁罗盘校准结果
|
||||||
*/
|
*/
|
||||||
reportCal () {
|
reportCal () {
|
||||||
if (this.plane && this.plane.planeState) {
|
if (this.plane && this.plane.planeState && this.plane.planeState.reportCal) {
|
||||||
return this.plane.planeState.reportCal
|
return this.plane.planeState.reportCal
|
||||||
}
|
}
|
||||||
return null
|
return null
|
||||||
|
},
|
||||||
|
/**
|
||||||
|
* @description:加速度计 状态
|
||||||
|
*/
|
||||||
|
acceState () {
|
||||||
|
if (this.plane && this.plane.planeState && this.plane.planeState.acceState) {
|
||||||
|
return this.plane.planeState.acceState
|
||||||
|
}
|
||||||
|
return null
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
@ -404,7 +447,25 @@ export default {
|
|||||||
*/
|
*/
|
||||||
handlerCloseCompassBox () {
|
handlerCloseCompassBox () {
|
||||||
this.dialogVisible = false
|
this.dialogVisible = false
|
||||||
|
// 磁罗盘校准进度 校准结果 重置
|
||||||
this.plane.planeState.reportCal = null
|
this.plane.planeState.reportCal = null
|
||||||
|
this.plane.planeState.completionPct = 0
|
||||||
|
},
|
||||||
|
/**
|
||||||
|
*关闭磁盘校准弹出窗口
|
||||||
|
*/
|
||||||
|
handlerCloseAcceBox () {
|
||||||
|
this.dialogVisible = false
|
||||||
|
// 加速度计校准状态 重置
|
||||||
|
this.plane.planeState.acceState = null
|
||||||
|
},
|
||||||
|
/** 弹出框 关闭事件回调 */
|
||||||
|
closeCallback () {
|
||||||
|
if (this.dialogItem === 'compassBox') { this.handlerCloseCompassBox() } else if (this.dialogItem === 'acceBox') { this.handlerCloseAcceBox() }
|
||||||
|
},
|
||||||
|
/** 弹出框 打开事件回调 */
|
||||||
|
openCallback () {
|
||||||
|
if (this.dialogItem === 'compassBox') { this.plane.planeState.reportCal = null }// 如果是校准磁罗盘 先重置校准结果
|
||||||
},
|
},
|
||||||
/**
|
/**
|
||||||
* @description: 摄像头 滑动条松开
|
* @description: 摄像头 滑动条松开
|
||||||
|
@ -278,10 +278,10 @@ const store = new Vuex.Store({
|
|||||||
groundSpeed: null, // 对地速度
|
groundSpeed: null, // 对地速度
|
||||||
satCount: null, // 卫星数量
|
satCount: null, // 卫星数量
|
||||||
fixType: null, // 定位状态
|
fixType: null, // 定位状态
|
||||||
completionPct: null, // 磁罗盘校准进度
|
completionPct: 0, // 磁罗盘校准进度
|
||||||
reportCal: null, // 磁罗盘校准结果
|
reportCal: null, // 磁罗盘校准结果
|
||||||
state: 1, // 飞机状态 默认初始状态为1
|
state: 1, // 飞机状态 默认初始状态为1
|
||||||
pingNet: null, // 网速测试
|
acceState: null, // 加速度计校准状态
|
||||||
getPlaneMode: null, // 飞机模式
|
getPlaneMode: null, // 飞机模式
|
||||||
loadweight: null, // 重量
|
loadweight: null, // 重量
|
||||||
hookstatus: null, // 钩子状态
|
hookstatus: null, // 钩子状态
|
||||||
|
Loading…
Reference in New Issue
Block a user