From add4af2a4bce9b97ca482ef0b309412c160aa4f8 Mon Sep 17 00:00:00 2001 From: tk Date: Fri, 26 Jul 2024 23:33:09 +0800 Subject: [PATCH] =?UTF-8?q?=E3=80=90=E7=B1=BB=20=20=E5=9E=8B=E3=80=91?= =?UTF-8?q?=EF=BC=9Afacotr=20esp32=E5=8F=91=E9=80=81=E8=BF=87=E6=9D=A5?= =?UTF-8?q?=E7=9A=84=E7=94=B5=E6=B1=A0=E6=80=BB=E5=AE=B9=E9=87=8F=20?= =?UTF-8?q?=E6=9C=89json=20=E6=94=B9=E4=B8=BA=E9=94=AE=EF=BC=88=E7=94=B5?= =?UTF-8?q?=E6=B1=A0=E6=80=BB=E5=AE=B9=E9=87=8F=EF=BC=89:=20=E5=80=BC=20?= =?UTF-8?q?=E5=AE=B9=E9=87=8F=EF=BC=88=E5=80=BC=EF=BC=89=20=E3=80=90?= =?UTF-8?q?=E5=8E=9F=20=20=E5=9B=A0=E3=80=91=EF=BC=9Aesp32=E8=BF=87?= =?UTF-8?q?=E6=BB=A4=E5=87=BA=E7=94=B5=E6=B1=A0=E6=80=BB=E5=AE=B9=E9=87=8F?= =?UTF-8?q?=20=E5=8F=91=E9=80=81=E5=88=B0=E6=8E=A7=E5=88=B6=E7=AB=AF=20?= =?UTF-8?q?=E4=B8=8D=E7=94=A8=E5=9C=A8=E6=8E=A7=E5=88=B6=E7=AB=AF=E5=86=8D?= =?UTF-8?q?=E8=BF=87=E6=BB=A4=E4=BA=86=20=E3=80=90=E8=BF=87=20=20=E7=A8=8B?= =?UTF-8?q?=E3=80=91=EF=BC=9A=20=E3=80=90=E5=BD=B1=20=20=E5=93=8D=E3=80=91?= =?UTF-8?q?=EF=BC=9A?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit # 类型 包含: # feat:新功能(feature) # fix:修补bug # docs:文档(documentation) # style: 格式(不影响代码运行的变动) # refactor:重构(即不是新增功能,也不是修改bug的代码变动) # test:增加测试 # chore:构建过程或辅助工具的变动 --- src/components/BatteryStatus.vue | 2 +- src/store/index.js | 3 ++- src/views/layout/components/main/planes/index.vue | 3 --- src/views/layout/index.vue | 8 -------- 4 files changed, 3 insertions(+), 13 deletions(-) diff --git a/src/components/BatteryStatus.vue b/src/components/BatteryStatus.vue index c66cfdc..d23ca1d 100644 --- a/src/components/BatteryStatus.vue +++ b/src/components/BatteryStatus.vue @@ -93,7 +93,7 @@ export default { }, created () { setInterval(() => { - this.rtlRemainingPower += 10 + this.rtlRemainingPower += 0 }, 1) } } diff --git a/src/store/index.js b/src/store/index.js index 69e31e4..40ea8a2 100644 --- a/src/store/index.js +++ b/src/store/index.js @@ -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) { diff --git a/src/views/layout/components/main/planes/index.vue b/src/views/layout/components/main/planes/index.vue index c46b036..aa6bcc7 100644 --- a/src/views/layout/components/main/planes/index.vue +++ b/src/views/layout/components/main/planes/index.vue @@ -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: 更新飞机位置 并画出轨迹 跟随飞机 diff --git a/src/views/layout/index.vue b/src/views/layout/index.vue index 74fed76..e998f76 100644 --- a/src/views/layout/index.vue +++ b/src/views/layout/index.vue @@ -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] // 按订阅信息 刷新飞机状态 }