实现载造比数据的更新
parent
ce6dc0b882
commit
9e19585d1f
|
@ -50,12 +50,10 @@ const doHandle = (value) => {
|
|||
nmeaObj.GGA = result
|
||||
break;
|
||||
case 'GSA':
|
||||
if (result.talker_id === 'BD') nmeaObj.GSA.push(result)
|
||||
nmeaObj.GSA.push(result)
|
||||
break;
|
||||
case 'GSV':
|
||||
if (result.talker_id === 'BD') nmeaObj.GSV.push(result)
|
||||
break;
|
||||
case 'TXT':
|
||||
nmeaObj.GSV.push(result)
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -22,9 +22,9 @@ function createWindow(page: String) {
|
|||
}
|
||||
|
||||
function launch() {
|
||||
createWindow('satellite-data-monitor-platform')
|
||||
// createWindow('satellite-data-monitor-platform')
|
||||
// createWindow('satellite-info-monitor-platform')
|
||||
// createWindow('satellite-signal-monitor-platform')
|
||||
createWindow('satellite-signal-monitor-platform')
|
||||
// createWindow('satellite-state-monitor-platform')
|
||||
}
|
||||
|
||||
|
|
|
@ -25,7 +25,7 @@ const props = defineProps({
|
|||
title: String
|
||||
})
|
||||
|
||||
const BAR_COUNT = 16
|
||||
const BAR_COUNT = 30
|
||||
const UN_POSITIONING_COLOR = '#9ca3af'
|
||||
const IN_POSITIONING_COLOR = new graphic.LinearGradient(
|
||||
0, 1, 0, 0,
|
||||
|
@ -39,9 +39,6 @@ const option = reactive({
|
|||
title: {
|
||||
text: props.title,
|
||||
left: 'center'
|
||||
},
|
||||
grid: {
|
||||
containLabel: true
|
||||
},
|
||||
xAxis: {
|
||||
type: 'category',
|
||||
|
@ -52,12 +49,8 @@ const option = reactive({
|
|||
}
|
||||
},
|
||||
yAxis: {
|
||||
max: 60,
|
||||
axisLabel: {
|
||||
textStyle: {
|
||||
fontSize: 24
|
||||
}
|
||||
}
|
||||
show: false,
|
||||
max: 60
|
||||
},
|
||||
series: [{
|
||||
type: 'bar',
|
||||
|
@ -97,7 +90,7 @@ const getSNROption = (GSVArr: Array<any>, GSAArr: Array<any>) => {
|
|||
try {
|
||||
let xAxis_data : Array<any> = []
|
||||
let series_data : Array<any> = []
|
||||
const in_positioning_id = utils.get_in_positioning_id(GSAArr)
|
||||
const in_positioning_id = get_in_positioning_id(GSAArr)
|
||||
|
||||
GSAArr.forEach(({ satellites }) => {
|
||||
in_positioning_id.push(...satellites)
|
||||
|
|
|
@ -4,16 +4,16 @@
|
|||
|
||||
<div class="main-content flex-1 grid grid-cols-2 grid-rows-2">
|
||||
<div>
|
||||
<SNRView title="北斗" />
|
||||
<SNRView ref="BDSNRView" title="北斗" />
|
||||
</div>
|
||||
<div>
|
||||
<SNRView title="GPS" />
|
||||
<SNRView ref="GPSNRView" title="GPS" />
|
||||
</div>
|
||||
<div>
|
||||
<SNRView title="格洛纳斯" />
|
||||
<SNRView ref="GLSNRView" title="格洛纳斯" />
|
||||
</div>
|
||||
<div>
|
||||
<SNRView title="伽利略" />
|
||||
<SNRView ref="GASNRView" title="伽利略" />
|
||||
</div>
|
||||
</div>
|
||||
</full-screen-container>
|
||||
|
@ -24,13 +24,57 @@ import FullScreenContainer from '../components/Layout/FullScreenContainer.vue'
|
|||
import TheHeader from '../components/Layout/TheHeader.vue'
|
||||
import SNRView from '../components/SNRView.vue'
|
||||
|
||||
import { onMounted } from 'vue'
|
||||
import { ref, onMounted } from 'vue'
|
||||
import { getNMEAObj } from '../api/util'
|
||||
|
||||
const BDSNRView = ref()
|
||||
const GPSNRView = ref()
|
||||
const GLSNRView = ref()
|
||||
const GASNRView = ref()
|
||||
const update = (nmeaStr: string) => {
|
||||
const data: any = getMonitoringData(nmeaStr)
|
||||
if (!data) return
|
||||
|
||||
const { bd, gp, gl, ga } = data
|
||||
|
||||
// TODO: 找到bdgsv语句有7条的原因以及gsa语句配置talker_id为各个卫星导航系统自己的名字
|
||||
BDSNRView.value.update(bd.GSVArr, bd.GSAArr)
|
||||
GPSNRView.value.update(gp.GSVArr, gp.GSAArr)
|
||||
GLSNRView.value.update(gl.GSVArr, gl.GSAArr)
|
||||
GASNRView.value.update(ga.GSVArr, ga.GSAArr)
|
||||
}
|
||||
|
||||
onMounted(() => {
|
||||
if ('ipcRenderer' in window) {
|
||||
ipcRenderer.receive('nmea', console.log)
|
||||
ipcRenderer.receive('nmea', update)
|
||||
|
||||
ipcRenderer.send('APP_MOUNTED')
|
||||
}
|
||||
})
|
||||
|
||||
const getMonitoringData = (nmeaStr: string) => {
|
||||
const nmeaObj: any = getNMEAObj(nmeaStr)
|
||||
console.log(nmeaObj, '================')
|
||||
if (!nmeaObj || !nmeaObj.GSV || !nmeaObj.GSA) return null
|
||||
|
||||
const { GSV, GSA } = nmeaObj
|
||||
const bd = {
|
||||
GSVArr: GSV.filter((gsv: any) => gsv.talker_id === 'BD'),
|
||||
GSAArr: GSA.filter((gsa: any) => gsa.talker_id === 'BD')
|
||||
}
|
||||
const gp = {
|
||||
GSVArr: GSV.filter((gsv: any) => gsv.talker_id === 'GP'),
|
||||
GSAArr: GSA.filter((gsa: any) => gsa.talker_id === 'GP')
|
||||
}
|
||||
const gl = {
|
||||
GSVArr: GSV.filter((gsv: any) => gsv.talker_id === 'GL'),
|
||||
GSAArr: GSA.filter((gsa: any) => gsa.talker_id === 'GL')
|
||||
}
|
||||
const ga = {
|
||||
GSVArr: GSV.filter((gsv: any) => gsv.talker_id === 'GA'),
|
||||
GSAArr: GSA.filter((gsa: any) => gsa.talker_id === 'GA')
|
||||
}
|
||||
|
||||
return { bd, gp, gl, ga }
|
||||
}
|
||||
</script>
|
||||
|
|
Loading…
Reference in New Issue