修复星座图软件数据显示过慢的bug

master v3.4.4
qubiaobiao 2024-09-06 14:37:03 +08:00
parent e281492a40
commit 0c19184f3a
3 changed files with 41 additions and 3 deletions

View File

@ -5,7 +5,7 @@
</template>
<script setup lang="ts">
import { ref, watch } from 'vue'
import { ref, watch, onMounted } from 'vue'
import { Map, MapMarker, lonlat2Position } from '@/components/Map'
import { useNMEAStore } from '@/stores/nmea'
@ -22,4 +22,13 @@ watch(() => nmea.handled3, (value) => {
mapRef.value.setZoomAndCenter(16, position.value)
nmea.handled3 = false
})
onMounted(() => {
if (!nmea.longitude || !nmea.latitude) return
position.value = lonlat2Position( nmea.longitude, nmea.latitude )
mapRef.value.setZoomAndCenter(16, position.value)
nmea.handled3 = false
})
</script>

View File

@ -5,7 +5,7 @@
</template>
<script lang="ts" setup>
import { watch } from "vue"
import { watch, onMounted } from "vue"
import { use } from "echarts/core"
import { CanvasRenderer } from "echarts/renderers"
import { ScatterChart } from "echarts/charts"
@ -36,4 +36,16 @@ watch(() => nmea.handled1, (value) => {
option.series[0].data = data
nmea.handled1 = false
})
onMounted(() => {
const satellites = nmea.satellites('BD')
if (!satellites) return
const data = satellites.map(({ id, elevationDeg, azimuthTrue, active }) => {
return [parseInt(elevationDeg) * -1, azimuthTrue, id, active]
})
option.series[0].data = data
nmea.handled1 = false
})
</script>

View File

@ -5,7 +5,7 @@
</template>
<script lang="ts" setup>
import { watch } from "vue"
import { watch, onMounted } from "vue"
import { use } from "echarts/core"
import { CanvasRenderer } from "echarts/renderers"
import { BarChart } from "echarts/charts"
@ -41,4 +41,21 @@ watch(() => nmea.handled2, (value) => {
option.series[0].data = seriesData
nmea.handled2 = false
})
onMounted(() => {
const xAxisData = []
const seriesData = []
const satellites = nmea.satellites('BD')
if (!satellites) return
satellites.forEach(({ id, SNRdB, active }) => {
xAxisData.push(id)
seriesData.push([id, SNRdB, active])
})
option.xAxis.data = xAxisData
option.series[0].data = seriesData
nmea.handled2 = false
})
</script>