Compare commits
6 Commits
Author | SHA1 | Date |
---|---|---|
|
0c19184f3a | |
|
e281492a40 | |
|
297a9747aa | |
|
86522ff589 | |
|
b3a565930b | |
|
3e512acec1 |
|
@ -1,6 +1,6 @@
|
|||
{
|
||||
"name": "bdqh-course-platform",
|
||||
"version": "3.4.3",
|
||||
"version": "3.4.4",
|
||||
"description": "北斗启航学习机课程平台",
|
||||
"main": "./dist/main/app.js",
|
||||
"scripts": {
|
||||
|
|
Before Width: | Height: | Size: 144 KiB After Width: | Height: | Size: 194 KiB |
Before Width: | Height: | Size: 105 KiB After Width: | Height: | Size: 147 KiB |
Before Width: | Height: | Size: 195 KiB After Width: | Height: | Size: 194 KiB |
Before Width: | Height: | Size: 154 KiB After Width: | Height: | Size: 147 KiB |
Before Width: | Height: | Size: 198 KiB After Width: | Height: | Size: 194 KiB |
Before Width: | Height: | Size: 155 KiB After Width: | Height: | Size: 147 KiB |
|
@ -62,8 +62,7 @@ await SerialPort.list().then((ports, err) => {
|
|||
if (ports.length == 0) {
|
||||
console.error('not connect')
|
||||
comreturn = false
|
||||
return
|
||||
}else{
|
||||
}else {
|
||||
const { path, baudRate, dataBits, stopBits, parity } = getSerialPortConstructorArguments(ports)
|
||||
console.log(path, baudRate, dataBits, stopBits, parity)
|
||||
comports = ports
|
||||
|
|
|
@ -250,21 +250,24 @@ export class MainWindow extends LocalSoftwareWindow {
|
|||
let resport: any
|
||||
|
||||
await comon().then((res:any) => {
|
||||
resport = res.comoptions.path
|
||||
if(!res.comoptions) {
|
||||
event.sender.send('BURN_PROGRAM_FEEDBACK', { err: new Error('请先连接核心处理模块') } )
|
||||
}else {
|
||||
resport = res.comoptions.path
|
||||
execFile(ESP_TOOL_PATH,
|
||||
['--chip', 'esp32', '--port', resport, '--baud', '921600', '--before', 'default_reset', '--after', 'hard_reset', 'write_flash', '-z', '--flash_mode', 'dio', '--flash_freq', '80m', '--flash_size', 'detect',
|
||||
'0xe000' , BOOT_APP0_BIN_PATH,
|
||||
'0x1000' , BOOT_LOADER_BIN_PATH,
|
||||
'0x10000', bin_file_path,
|
||||
'0x8000' , PARTITIONS_BIN_PATH], (err:any, stdout:any) => {
|
||||
if (err) {
|
||||
event.sender.send('BURN_PROGRAM_FEEDBACK', { err } )
|
||||
} else {
|
||||
event.sender.send('BURN_PROGRAM_FEEDBACK', { stdout })
|
||||
}
|
||||
});
|
||||
}
|
||||
})
|
||||
|
||||
execFile(ESP_TOOL_PATH,
|
||||
['--chip', 'esp32', '--port', resport, '--baud', '921600', '--before', 'default_reset', '--after', 'hard_reset', 'write_flash', '-z', '--flash_mode', 'dio', '--flash_freq', '80m', '--flash_size', 'detect',
|
||||
'0xe000' , BOOT_APP0_BIN_PATH,
|
||||
'0x1000' , BOOT_LOADER_BIN_PATH,
|
||||
'0x10000', bin_file_path,
|
||||
'0x8000' , PARTITIONS_BIN_PATH], (err:any, stdout:any) => {
|
||||
if (err) {
|
||||
event.sender.send('BURN_PROGRAM_FEEDBACK', { err } )
|
||||
} else {
|
||||
event.sender.send('BURN_PROGRAM_FEEDBACK', { stdout })
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
launchOnlineSoftware(_: IpcMainEvent, param: any) {
|
||||
|
|
|
@ -17,7 +17,7 @@
|
|||
<SerialPortReceivingMessageView class="h-full" />
|
||||
</n-tab-pane>
|
||||
<n-tab-pane display-directive="show:lazy" tab="地图" name="map">
|
||||
<MapView />
|
||||
<component :is="MapComponent"></component>
|
||||
</n-tab-pane>
|
||||
</Tabs>
|
||||
</Layout>
|
||||
|
@ -27,7 +27,7 @@
|
|||
</template>
|
||||
|
||||
<script setup lang="ts">
|
||||
import { ref, onMounted, watch } from 'vue'
|
||||
import { ref, defineAsyncComponent, onMounted } from 'vue'
|
||||
import { NTabPane } from 'naive-ui'
|
||||
import { Application } from '@/components/Application'
|
||||
import { CustomTitleBar } from '@/components/CustomTitleBar'
|
||||
|
@ -38,7 +38,6 @@ import { SerialPortReceivingMessageView } from '@/components/SerialPort'
|
|||
import { BasicInfoView } from '@/views/BDDataAnalysisPlatform/BasicInfoView'
|
||||
import { PlanisphereView } from '@/views/BDDataAnalysisPlatform/PlanisphereView'
|
||||
import { SNRView } from '@/views/BDDataAnalysisPlatform/SNRView'
|
||||
import MapView from '@/views/BDDataAnalysisPlatform/MapView.vue'
|
||||
|
||||
import { useNMEAStore, NMEADataSource } from '@/stores/nmea'
|
||||
import { LineBreakParser } from '@/utils/parser'
|
||||
|
@ -55,8 +54,14 @@ const onSerialPortData = (value: Uint8Array) => {
|
|||
}
|
||||
|
||||
const softwareTitle = ref(null)
|
||||
const MapComponent = ref(null)
|
||||
const MapViewComponent = defineAsyncComponent(() => import('@/views/BDDataAnalysisPlatform/MapView.vue'))
|
||||
|
||||
onMounted(() => {
|
||||
softwareTitle.value.title = '北斗数据分析平台'
|
||||
setTimeout(async () => {
|
||||
MapComponent.value = await MapViewComponent
|
||||
}, 1000)
|
||||
})
|
||||
|
||||
window.ipcRenderer.receive('COM_LISTENER', onSerialPortData)
|
||||
|
|
|
@ -1,10 +1,49 @@
|
|||
import { ref } from 'vue'
|
||||
import { defineStore } from 'pinia'
|
||||
import { useMessage } from 'naive-ui'
|
||||
import type { MessageReactive } from 'naive-ui'
|
||||
|
||||
export const useNetworkStore = defineStore('network', () => {
|
||||
const message = useMessage()
|
||||
const isOnLine = ref(window.navigator.onLine)
|
||||
window.addEventListener( 'online' , () => isOnLine.value = true )
|
||||
window.addEventListener( 'offline', () => isOnLine.value = false )
|
||||
let checkLine
|
||||
let messageReactive: MessageReactive | null = null
|
||||
const createMessage = () => {
|
||||
if (!messageReactive) {
|
||||
messageReactive = message.loading('正在连接中', {
|
||||
duration: 0
|
||||
})
|
||||
}
|
||||
}
|
||||
const removeMessage = () => {
|
||||
if (messageReactive) {
|
||||
messageReactive.destroy()
|
||||
messageReactive = null
|
||||
}
|
||||
}
|
||||
const setCheck = () => {
|
||||
createMessage()
|
||||
checkLine = setTimeout(() => {
|
||||
removeMessage()
|
||||
if(isOnLine.value) {
|
||||
message.success('连接成功')
|
||||
} else {
|
||||
message.error('连接失败')
|
||||
}
|
||||
}, 20000)
|
||||
}
|
||||
window.addEventListener( 'online' , () => {
|
||||
isOnLine.value = true
|
||||
clearTimeout(checkLine)
|
||||
removeMessage()
|
||||
message.success('连接成功')
|
||||
} )
|
||||
window.addEventListener( 'offline', () => {
|
||||
isOnLine.value = false
|
||||
clearTimeout(checkLine)
|
||||
removeMessage()
|
||||
message.error('连接失败')
|
||||
} )
|
||||
|
||||
return { isOnLine }
|
||||
return { isOnLine, setCheck }
|
||||
})
|
||||
|
|
|
@ -19,7 +19,7 @@
|
|||
</template>
|
||||
|
||||
<script lang="ts" setup>
|
||||
import { ref, watch, onMounted } from 'vue'
|
||||
import { ref, watch } from 'vue'
|
||||
import { NDescriptions, NDescriptionsItem, NTime, useMessage } from 'naive-ui'
|
||||
import { useNMEAStore } from '@/stores/nmea'
|
||||
|
||||
|
@ -38,10 +38,6 @@ const connectErrMsg = (value: Boolean) => {
|
|||
|
||||
window.ipcRenderer.receive('CANNOT_CONNECT',connectErrMsg)
|
||||
|
||||
onMounted(() => {
|
||||
window.ipcRenderer.send('COM_READY')
|
||||
})
|
||||
|
||||
watch(() => nmea.handled, (value) => {
|
||||
if (!value) return
|
||||
|
||||
|
|
|
@ -14,10 +14,6 @@ const position = ref()
|
|||
|
||||
const mapRef = ref()
|
||||
|
||||
onMounted(() => {
|
||||
window.ipcRenderer.send('COM_READY')
|
||||
})
|
||||
|
||||
watch(() => nmea.handled3, (value) => {
|
||||
if (!value || !nmea.longitude || !nmea.latitude) return
|
||||
|
||||
|
@ -26,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>
|
||||
|
|
|
@ -22,10 +22,6 @@ use([
|
|||
PolarComponent
|
||||
])
|
||||
|
||||
onMounted(() => {
|
||||
window.ipcRenderer.send('COM_READY')
|
||||
})
|
||||
|
||||
const nmea = useNMEAStore()
|
||||
watch(() => nmea.handled1, (value) => {
|
||||
if (!value) return
|
||||
|
@ -40,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>
|
||||
|
|
|
@ -22,10 +22,6 @@ use([
|
|||
GridComponent
|
||||
])
|
||||
|
||||
onMounted(() => {
|
||||
window.ipcRenderer.send('COM_READY')
|
||||
})
|
||||
|
||||
const nmea = useNMEAStore()
|
||||
watch(() => nmea.handled2, (value) => {
|
||||
if (!value) return
|
||||
|
@ -45,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>
|
||||
|
|
|
@ -14,7 +14,7 @@
|
|||
<n-li>北京市海淀区黑泉路8号1幢宝盛广场B座8013</n-li>
|
||||
<n-li>400-166-5286</n-li>
|
||||
<n-li>sales@hwasmart.com</n-li>
|
||||
<n-li>版本号(bmp280):{{ version }}</n-li>
|
||||
<n-li>北斗实验平台软件V2.0 (bmp280:{{ version }})</n-li>
|
||||
</n-ul>
|
||||
</n-modal>
|
||||
</template>
|
||||
|
|
|
@ -39,8 +39,8 @@ const onBurnProgramBtnClick = async (binFileName: string) => {
|
|||
|
||||
dialog.info({
|
||||
title: '系统提示',
|
||||
closable: false,
|
||||
maskClosable: false,
|
||||
closable: true,
|
||||
maskClosable: true,
|
||||
class: 'text-center',
|
||||
content: () => h(
|
||||
NSpin,
|
||||
|
|
|
@ -25,6 +25,9 @@ import { h, ref } from 'vue'
|
|||
import { NDivider, NCard, NDataTable, NInput, NButton, NIcon, useMessage } from 'naive-ui'
|
||||
import { Wifi1BarFilled, Wifi2BarFilled, WifiFilled, RefreshFilled } from '@vicons/material'
|
||||
import { hasIpcRenderer } from '@/utils'
|
||||
import { useNetworkStore } from '@/stores/modules/network'
|
||||
|
||||
const network = useNetworkStore()
|
||||
|
||||
const emit = defineEmits(['done'])
|
||||
|
||||
|
@ -74,12 +77,15 @@ const columns = [
|
|||
return h(
|
||||
NButton,
|
||||
{
|
||||
type: 'info',
|
||||
type: row.ssid === current.value?.ssid && network.isOnLine ? 'primary' : 'info',
|
||||
secondary: true,
|
||||
disabled: row.ssid === current.value?.ssid || !row.password,
|
||||
onClick: () => connect({ ssid:row.ssid, password: row.password })
|
||||
disabled: row.ssid === current.value?.ssid && network.isOnLine || !row.password || row.password.length < 8,
|
||||
onClick: () => {
|
||||
connect({ ssid:row.ssid, password: row.password })
|
||||
network.setCheck();
|
||||
}
|
||||
},
|
||||
{ default: () => row.ssid === current.value?.ssid ? '已连接' : '连 接' }
|
||||
{ default: () => row.ssid === current.value?.ssid && network.isOnLine ? '已连接' : '连 接' }
|
||||
)
|
||||
}
|
||||
}
|
||||
|
@ -91,11 +97,16 @@ const connect = ( connectionOpts ) => {
|
|||
return
|
||||
}
|
||||
|
||||
if(connectionOpts.password.length < 8) {
|
||||
message.error('密码长度不足8位')
|
||||
return
|
||||
}
|
||||
|
||||
if (!hasIpcRenderer()) return
|
||||
|
||||
const result = window.ipcRenderer.sendSync('NETWORK_CONNECT', connectionOpts)
|
||||
if (result === 'OK') {
|
||||
message.success('网络连接成功')
|
||||
message.success('网络连接请求发送成功')
|
||||
emit('done')
|
||||
} else {
|
||||
message.error(result.message)
|
||||
|
|
|
@ -1,18 +1,13 @@
|
|||
<template>
|
||||
<n-space class="toolbar">
|
||||
<div class="button-background">
|
||||
<n-popover :show="!network.isOnLine" placement="bottom">
|
||||
<template #trigger>
|
||||
<n-button size="large" circle type="info" @click="emit('systemSettings')">
|
||||
<n-button size="large" circle type="info" @click="emit('systemSettings')">
|
||||
<template #icon>
|
||||
<n-icon>
|
||||
<Settings />
|
||||
</n-icon>
|
||||
</template>
|
||||
</n-button>
|
||||
</template>
|
||||
请连接网络
|
||||
</n-popover >
|
||||
|
||||
<n-button size="large" circle type="info" @click="emit('quickBurning')">
|
||||
<template #icon>
|
||||
|
@ -42,7 +37,7 @@
|
|||
</template>
|
||||
|
||||
<script setup lang="ts">
|
||||
import { NSpace, NPopover , NButton, NIcon, useDialog } from 'naive-ui'
|
||||
import { NSpace, NButton, NIcon, useDialog } from 'naive-ui'
|
||||
import {
|
||||
PhoneFilled as Phone,
|
||||
SettingsFilled as Settings,
|
||||
|
|