parent
e281492a40
commit
0c19184f3a
|
@ -5,7 +5,7 @@
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script setup lang="ts">
|
<script setup lang="ts">
|
||||||
import { ref, watch } from 'vue'
|
import { ref, watch, onMounted } from 'vue'
|
||||||
import { Map, MapMarker, lonlat2Position } from '@/components/Map'
|
import { Map, MapMarker, lonlat2Position } from '@/components/Map'
|
||||||
import { useNMEAStore } from '@/stores/nmea'
|
import { useNMEAStore } from '@/stores/nmea'
|
||||||
|
|
||||||
|
@ -22,4 +22,13 @@ watch(() => nmea.handled3, (value) => {
|
||||||
mapRef.value.setZoomAndCenter(16, position.value)
|
mapRef.value.setZoomAndCenter(16, position.value)
|
||||||
nmea.handled3 = false
|
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>
|
</script>
|
||||||
|
|
|
@ -5,7 +5,7 @@
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script lang="ts" setup>
|
<script lang="ts" setup>
|
||||||
import { watch } from "vue"
|
import { watch, onMounted } from "vue"
|
||||||
import { use } from "echarts/core"
|
import { use } from "echarts/core"
|
||||||
import { CanvasRenderer } from "echarts/renderers"
|
import { CanvasRenderer } from "echarts/renderers"
|
||||||
import { ScatterChart } from "echarts/charts"
|
import { ScatterChart } from "echarts/charts"
|
||||||
|
@ -36,4 +36,16 @@ watch(() => nmea.handled1, (value) => {
|
||||||
option.series[0].data = data
|
option.series[0].data = data
|
||||||
nmea.handled1 = false
|
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>
|
</script>
|
||||||
|
|
|
@ -5,7 +5,7 @@
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script lang="ts" setup>
|
<script lang="ts" setup>
|
||||||
import { watch } from "vue"
|
import { watch, onMounted } from "vue"
|
||||||
import { use } from "echarts/core"
|
import { use } from "echarts/core"
|
||||||
import { CanvasRenderer } from "echarts/renderers"
|
import { CanvasRenderer } from "echarts/renderers"
|
||||||
import { BarChart } from "echarts/charts"
|
import { BarChart } from "echarts/charts"
|
||||||
|
@ -41,4 +41,21 @@ watch(() => nmea.handled2, (value) => {
|
||||||
option.series[0].data = seriesData
|
option.series[0].data = seriesData
|
||||||
nmea.handled2 = false
|
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>
|
</script>
|
||||||
|
|
Loading…
Reference in New Issue