【类 型】:facotr esp32发送过来的电池总容量 有json 改为键(电池总容量): 值 容量(值)
【原 因】:esp32过滤出电池总容量 发送到控制端 不用在控制端再过滤了 【过 程】: 【影 响】: # 类型 包含: # feat:新功能(feature) # fix:修补bug # docs:文档(documentation) # style: 格式(不影响代码运行的变动) # refactor:重构(即不是新增功能,也不是修改bug的代码变动) # test:增加测试 # chore:构建过程或辅助工具的变动
This commit is contained in:
parent
3b1ca3619b
commit
add4af2a4b
@ -93,7 +93,7 @@ export default {
|
||||
},
|
||||
created () {
|
||||
setInterval(() => {
|
||||
this.rtlRemainingPower += 10
|
||||
this.rtlRemainingPower += 0
|
||||
}, 1)
|
||||
}
|
||||
}
|
||||
|
@ -286,7 +286,8 @@ const store = new Vuex.Store({
|
||||
loadweight: null, // 重量
|
||||
hookstatus: null, // 钩子状态
|
||||
position: [], // [[经度,维度,海拔高度]]累计数组
|
||||
battCapacity: null// 电池容量
|
||||
battCapacity: null, // 电池容量
|
||||
homePosition: null // 返航点位置
|
||||
}
|
||||
})
|
||||
if (res.data.status === 1) {
|
||||
|
@ -107,9 +107,6 @@ export default {
|
||||
watch: {
|
||||
plane (val) {
|
||||
this.makePlane(val)// 有飞机数据之后 在地图上创建飞机
|
||||
if (!val.planeState.battCapacity) {
|
||||
mqtt.publishFun(`cmd/${this.plane.macadd}`, '{"getBattCapacity":1}')// 发送设置飞机状态主题 请求飞控返回 电池总容量
|
||||
}
|
||||
},
|
||||
/**
|
||||
* @description: 更新飞机位置 并画出轨迹 跟随飞机
|
||||
|
@ -102,14 +102,6 @@ export default {
|
||||
if (plane.planeState.position.length > 1000) {
|
||||
plane.planeState.position.shift() // 删除最早的经纬度
|
||||
}
|
||||
} else if (key === 'parameter') {
|
||||
// 如果是 get飞控参数 判断设置对应值
|
||||
const parameter = JSON.parse(jsonData.parameter.trim())
|
||||
for (const k in parameter) {
|
||||
if (k === 'BATT_CAPACITY') {
|
||||
plane.planeState.battCapacity = parameter.BATT_CAPACITY
|
||||
}
|
||||
}
|
||||
} else {
|
||||
plane.planeState[key] = jsonData[key] // 按订阅信息 刷新飞机状态
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user