Compare commits

..

No commits in common. "48e2a26ed7e26c156a13154262e459a9afd1493b" and "63212c130b0b2d288cd26facbe99a7083481af3d" have entirely different histories.

2 changed files with 16 additions and 77 deletions

View File

@ -1,7 +1,7 @@
<template>
<div class="w-100 h-100 mainBox">
<!-- 弹出框 -->
<el-dialog :title="dialogTitle" :visible.sync="dialogVisible" width="320px" top="30vh" @close="closeCallback" @open="openCallback">
<el-dialog :title="dialogTitle" :visible.sync="dialogVisible" width="320px" top="30vh">
<!-- 起飞设置弹出框 -->
<template v-if="dialogItem == 'takeoffBox'">
<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">
<el-button size="medium" @click="dialogVisible = false">关闭</el-button>
<el-button size="medium" type="primary"
@click="publishFun(`{guidedMode:{alt:${takeoffValue}}}`); speakText('确认起飞')"></el-button>
@click="publishFun(`{setPlaneState:{bit:6,state:1,count:1,param:[${takeoffValue}]}}`); speakText('确认起飞')">确认起</el-button>
</span>
</template>
<!-- 摄像头弹出框 -->
@ -50,38 +50,6 @@
<el-button size="medium" @click="handlerCloseCompassBox">关闭</el-button>
</span>
</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>
<!-- 底边 tab控件组 -->
<div class="flex column mr mac tabContainer p-l-10 p-r-10">
@ -132,7 +100,8 @@
<font class="m-l-5">航点写入中···</font>
</el-button>
<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" @click="publishFun('{unlock:1}'); speakText('解锁飞机')">
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-else-if="Number(plane.planeState.state) === 12" type="info"
@ -172,27 +141,26 @@
</div>
<div class="butIconBox gap10 flex">
<el-button size="medium" type="primary" class="flex1 butIcon"
@click="publishFun('{unlock:1}'); speakText('解锁飞机')">
@click="publishFun('{setPlaneState:{bit:3,state:1,count:2,param:[1,0]}}'); speakText('解锁飞机')">
<i class="iconfont icon-jiesuo f-s-24"></i>
<div class="m-t-5">解锁</div>
</el-button>
<el-button size="medium" type="primary" class="flex1 butIcon"
@click="confirmation('飞机加锁,螺旋桨将停转,请谨慎操作!', '加锁操作', '{lock:1}'); speakText('加锁,请注意安全')">
@click="confirmation('飞机加锁,螺旋桨将停转,请谨慎操作!', '加锁操作', '{setPlaneState:{bit:3,state:0,count:2,param:[0,21196]}}'); speakText('加锁,请注意安全')">
<i class=" iconfont icon-suoding f-s-24"></i>
<div class="m-t-5">加锁</div>
</el-button>
<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>
<div class="m-t-5">起飞</div>
</el-button>
<el-button size="medium" type="primary" class="flex1 butIcon"
@click="publishFun('{loiterMode:1}'); speakText('悬停')">
@click="publishFun('{setPlaneState:{bit:7,state:1}}'); speakText('悬停')">
<i class="iconfont icon-fengzheng1 f-s-24"></i>
<div class="m-t-5">悬停</div>
</el-button>
<el-button size="medium" type="primary" class="flex1 butIcon"
@click="publishFun('{autoMode:1}'); speakText('继续执行航线')">
<el-button size="medium" type="primary" class="flex1 butIcon" @click="speakText('继续执行航线')">
<i class="iconfont icon-duandianxufei f-s-24"></i>
<div class="m-t-5">复航</div>
</el-button>
@ -289,13 +257,11 @@
<i class="iconfont icon-zhinanzhen f-s-24"></i>
<div class="m-t-5">磁罗盘</div>
</el-button>
<el-button size="medium" type="primary" class="flex1 butIcon"
@click="publishFun('{initAcce:1}'); speakText('校准加速度计');dialogVisible = true; dialogTitle = '校准加速度计';dialogItem = 'acceBox';">
<el-button size="medium" type="primary" class="flex1 butIcon" @click="speakText('校准加速度计')">
<i class="iconfont icon-zuobiaozhoupeizhixiang f-s-24"></i>
<div class="m-t-5">加速度计</div>
</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>
<div class="m-t-5">写入参数</div>
</el-button>
@ -416,28 +382,19 @@ export default {
* @description: 磁罗盘校准进度
*/
completionPct () {
if (this.plane && this.plane.planeState && this.plane.planeState.completionPct) {
if (this.plane && this.plane.planeState) {
return Number(this.plane.planeState.completionPct)
}
return 0
return null
},
/**
* @description: 磁罗盘校准结果
*/
reportCal () {
if (this.plane && this.plane.planeState && this.plane.planeState.reportCal) {
if (this.plane && this.plane.planeState) {
return this.plane.planeState.reportCal
}
return null
},
/**
* @description:加速度计 状态
*/
acceState () {
if (this.plane && this.plane.planeState && this.plane.planeState.acceState) {
return this.plane.planeState.acceState
}
return null
}
},
methods: {
@ -447,25 +404,7 @@ export default {
*/
handlerCloseCompassBox () {
this.dialogVisible = false
//
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: 摄像头 滑动条松开

View File

@ -278,10 +278,10 @@ const store = new Vuex.Store({
groundSpeed: null, // 对地速度
satCount: null, // 卫星数量
fixType: null, // 定位状态
completionPct: 0, // 磁罗盘校准进度
completionPct: null, // 磁罗盘校准进度
reportCal: null, // 磁罗盘校准结果
state: 1, // 飞机状态 默认初始状态为1
acceState: null, // 加速度计校准状态
pingNet: null, // 网速测试
getPlaneMode: null, // 飞机模式
loadweight: null, // 重量
hookstatus: null, // 钩子状态