parent
31ad7459d5
commit
e9f4b9980e
|
@ -38,6 +38,9 @@ export const useNMEAStore = defineStore('nmea', {
|
||||||
// INS: null,
|
// INS: null,
|
||||||
// TIM: null,
|
// TIM: null,
|
||||||
handled: false,
|
handled: false,
|
||||||
|
handled1: false,
|
||||||
|
handled2: false,
|
||||||
|
handled3: false,
|
||||||
}),
|
}),
|
||||||
getters: {
|
getters: {
|
||||||
dateTime () {
|
dateTime () {
|
||||||
|
@ -120,6 +123,9 @@ export const useNMEAStore = defineStore('nmea', {
|
||||||
// 监听最后一条语句,并设置handled为true
|
// 监听最后一条语句,并设置handled为true
|
||||||
if (result.sentence === 'TXT') {
|
if (result.sentence === 'TXT') {
|
||||||
this.handled = true
|
this.handled = true
|
||||||
|
this.handled1 = true
|
||||||
|
this.handled2 = true
|
||||||
|
this.handled3 = true
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
},
|
},
|
||||||
|
|
|
@ -18,11 +18,12 @@ onMounted(() => {
|
||||||
window.ipcRenderer.send('COM_READY')
|
window.ipcRenderer.send('COM_READY')
|
||||||
})
|
})
|
||||||
|
|
||||||
watch(() => nmea.handled, (value) => {
|
watch(() => nmea.handled3, (value) => {
|
||||||
if (!value || !nmea.longitude || !nmea.latitude) return
|
if (!value || !nmea.longitude || !nmea.latitude) return
|
||||||
|
|
||||||
position.value = lonlat2Position( nmea.longitude, nmea.latitude )
|
position.value = lonlat2Position( nmea.longitude, nmea.latitude )
|
||||||
|
|
||||||
mapRef.value.setZoomAndCenter(16, position.value)
|
mapRef.value.setZoomAndCenter(16, position.value)
|
||||||
|
nmea.handled3 = false
|
||||||
})
|
})
|
||||||
</script>
|
</script>
|
||||||
|
|
|
@ -27,7 +27,7 @@ onMounted(() => {
|
||||||
})
|
})
|
||||||
|
|
||||||
const nmea = useNMEAStore()
|
const nmea = useNMEAStore()
|
||||||
watch(() => nmea.handled, (value) => {
|
watch(() => nmea.handled1, (value) => {
|
||||||
if (!value) return
|
if (!value) return
|
||||||
|
|
||||||
const satellites = nmea.satellites('BD')
|
const satellites = nmea.satellites('BD')
|
||||||
|
@ -38,5 +38,6 @@ watch(() => nmea.handled, (value) => {
|
||||||
})
|
})
|
||||||
|
|
||||||
option.series[0].data = data
|
option.series[0].data = data
|
||||||
|
nmea.handled1 = false
|
||||||
})
|
})
|
||||||
</script>
|
</script>
|
||||||
|
|
|
@ -27,7 +27,7 @@ onMounted(() => {
|
||||||
})
|
})
|
||||||
|
|
||||||
const nmea = useNMEAStore()
|
const nmea = useNMEAStore()
|
||||||
watch(() => nmea.handled, (value) => {
|
watch(() => nmea.handled2, (value) => {
|
||||||
if (!value) return
|
if (!value) return
|
||||||
|
|
||||||
const xAxisData = []
|
const xAxisData = []
|
||||||
|
@ -43,5 +43,6 @@ watch(() => nmea.handled, (value) => {
|
||||||
|
|
||||||
option.xAxis.data = xAxisData
|
option.xAxis.data = xAxisData
|
||||||
option.series[0].data = seriesData
|
option.series[0].data = seriesData
|
||||||
|
nmea.handled2 = false
|
||||||
})
|
})
|
||||||
</script>
|
</script>
|
||||||
|
|
|
@ -39,7 +39,7 @@ const onBtnClick = async () => {
|
||||||
const decoder = new TextDecoder()
|
const decoder = new TextDecoder()
|
||||||
const parser = new LineBreakParser()
|
const parser = new LineBreakParser()
|
||||||
const onSerialPortData = (value: Uint8Array) => {
|
const onSerialPortData = (value: Uint8Array) => {
|
||||||
debugger
|
// debugger
|
||||||
const result: Array<String> = parser.parse(decoder.decode(value))
|
const result: Array<String> = parser.parse(decoder.decode(value))
|
||||||
if (result.length === 0) return
|
if (result.length === 0) return
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue