From e9f4b9980e2bae17d766ddaf0fec0331d5cad0b3 Mon Sep 17 00:00:00 2001 From: qubiaobiao <3294694717@qq.com> Date: Fri, 14 Jun 2024 11:09:17 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E5=A4=8D=E5=8D=AB=E6=98=9F=E4=B8=8E?= =?UTF-8?q?=E9=80=9A=E4=BF=A1=E4=B8=AD=E6=98=9F=E5=BA=A7=E5=9B=BE=E7=9A=84?= =?UTF-8?q?=E8=BF=9B=E7=A8=8B=E5=BD=B1=E5=93=8D=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/render/stores/nmea.ts | 6 ++++++ src/render/views/BDDataAnalysisPlatform/MapView.vue | 3 ++- .../views/BDDataAnalysisPlatform/PlanisphereView/index.vue | 3 ++- src/render/views/BDDataAnalysisPlatform/SNRView/index.vue | 3 ++- .../views/VoltageMonitoring/SelectDeviceView/index.vue | 2 +- 5 files changed, 13 insertions(+), 4 deletions(-) diff --git a/src/render/stores/nmea.ts b/src/render/stores/nmea.ts index ffcf7a2..6caa9c1 100644 --- a/src/render/stores/nmea.ts +++ b/src/render/stores/nmea.ts @@ -38,6 +38,9 @@ export const useNMEAStore = defineStore('nmea', { // INS: null, // TIM: null, handled: false, + handled1: false, + handled2: false, + handled3: false, }), getters: { dateTime () { @@ -120,6 +123,9 @@ export const useNMEAStore = defineStore('nmea', { // 监听最后一条语句,并设置handled为true if (result.sentence === 'TXT') { this.handled = true + this.handled1 = true + this.handled2 = true + this.handled3 = true } }) }, diff --git a/src/render/views/BDDataAnalysisPlatform/MapView.vue b/src/render/views/BDDataAnalysisPlatform/MapView.vue index 60ea92a..27dd598 100644 --- a/src/render/views/BDDataAnalysisPlatform/MapView.vue +++ b/src/render/views/BDDataAnalysisPlatform/MapView.vue @@ -18,11 +18,12 @@ onMounted(() => { window.ipcRenderer.send('COM_READY') }) -watch(() => nmea.handled, (value) => { +watch(() => nmea.handled3, (value) => { if (!value || !nmea.longitude || !nmea.latitude) return position.value = lonlat2Position( nmea.longitude, nmea.latitude ) mapRef.value.setZoomAndCenter(16, position.value) + nmea.handled3 = false }) diff --git a/src/render/views/BDDataAnalysisPlatform/PlanisphereView/index.vue b/src/render/views/BDDataAnalysisPlatform/PlanisphereView/index.vue index 21b249b..1c97ed4 100644 --- a/src/render/views/BDDataAnalysisPlatform/PlanisphereView/index.vue +++ b/src/render/views/BDDataAnalysisPlatform/PlanisphereView/index.vue @@ -27,7 +27,7 @@ onMounted(() => { }) const nmea = useNMEAStore() -watch(() => nmea.handled, (value) => { +watch(() => nmea.handled1, (value) => { if (!value) return const satellites = nmea.satellites('BD') @@ -38,5 +38,6 @@ watch(() => nmea.handled, (value) => { }) option.series[0].data = data + nmea.handled1 = false }) diff --git a/src/render/views/BDDataAnalysisPlatform/SNRView/index.vue b/src/render/views/BDDataAnalysisPlatform/SNRView/index.vue index 68a36f4..87b63f1 100644 --- a/src/render/views/BDDataAnalysisPlatform/SNRView/index.vue +++ b/src/render/views/BDDataAnalysisPlatform/SNRView/index.vue @@ -27,7 +27,7 @@ onMounted(() => { }) const nmea = useNMEAStore() -watch(() => nmea.handled, (value) => { +watch(() => nmea.handled2, (value) => { if (!value) return const xAxisData = [] @@ -43,5 +43,6 @@ watch(() => nmea.handled, (value) => { option.xAxis.data = xAxisData option.series[0].data = seriesData + nmea.handled2 = false }) diff --git a/src/render/views/VoltageMonitoring/SelectDeviceView/index.vue b/src/render/views/VoltageMonitoring/SelectDeviceView/index.vue index 789625f..3983ac4 100644 --- a/src/render/views/VoltageMonitoring/SelectDeviceView/index.vue +++ b/src/render/views/VoltageMonitoring/SelectDeviceView/index.vue @@ -39,7 +39,7 @@ const onBtnClick = async () => { const decoder = new TextDecoder() const parser = new LineBreakParser() const onSerialPortData = (value: Uint8Array) => { - debugger + // debugger const result: Array = parser.parse(decoder.decode(value)) if (result.length === 0) return