Compare commits

...

6 Commits

19 changed files with 129 additions and 55 deletions

View File

@ -1,6 +1,6 @@
{ {
"name": "bdqh-course-platform", "name": "bdqh-course-platform",
"version": "3.4.3", "version": "3.4.4",
"description": "北斗启航学习机课程平台", "description": "北斗启航学习机课程平台",
"main": "./dist/main/app.js", "main": "./dist/main/app.js",
"scripts": { "scripts": {

Binary file not shown.

Before

Width:  |  Height:  |  Size: 144 KiB

After

Width:  |  Height:  |  Size: 194 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 105 KiB

After

Width:  |  Height:  |  Size: 147 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 195 KiB

After

Width:  |  Height:  |  Size: 194 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 154 KiB

After

Width:  |  Height:  |  Size: 147 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 198 KiB

After

Width:  |  Height:  |  Size: 194 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 155 KiB

After

Width:  |  Height:  |  Size: 147 KiB

View File

@ -62,8 +62,7 @@ await SerialPort.list().then((ports, err) => {
if (ports.length == 0) { if (ports.length == 0) {
console.error('not connect') console.error('not connect')
comreturn = false comreturn = false
return }else {
}else{
const { path, baudRate, dataBits, stopBits, parity } = getSerialPortConstructorArguments(ports) const { path, baudRate, dataBits, stopBits, parity } = getSerialPortConstructorArguments(ports)
console.log(path, baudRate, dataBits, stopBits, parity) console.log(path, baudRate, dataBits, stopBits, parity)
comports = ports comports = ports

View File

@ -250,21 +250,24 @@ export class MainWindow extends LocalSoftwareWindow {
let resport: any let resport: any
await comon().then((res: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) { launchOnlineSoftware(_: IpcMainEvent, param: any) {

View File

@ -17,7 +17,7 @@
<SerialPortReceivingMessageView class="h-full" /> <SerialPortReceivingMessageView class="h-full" />
</n-tab-pane> </n-tab-pane>
<n-tab-pane display-directive="show:lazy" tab="地图" name="map"> <n-tab-pane display-directive="show:lazy" tab="地图" name="map">
<MapView /> <component :is="MapComponent"></component>
</n-tab-pane> </n-tab-pane>
</Tabs> </Tabs>
</Layout> </Layout>
@ -27,7 +27,7 @@
</template> </template>
<script setup lang="ts"> <script setup lang="ts">
import { ref, onMounted, watch } from 'vue' import { ref, defineAsyncComponent, onMounted } from 'vue'
import { NTabPane } from 'naive-ui' import { NTabPane } from 'naive-ui'
import { Application } from '@/components/Application' import { Application } from '@/components/Application'
import { CustomTitleBar } from '@/components/CustomTitleBar' import { CustomTitleBar } from '@/components/CustomTitleBar'
@ -38,7 +38,6 @@ import { SerialPortReceivingMessageView } from '@/components/SerialPort'
import { BasicInfoView } from '@/views/BDDataAnalysisPlatform/BasicInfoView' import { BasicInfoView } from '@/views/BDDataAnalysisPlatform/BasicInfoView'
import { PlanisphereView } from '@/views/BDDataAnalysisPlatform/PlanisphereView' import { PlanisphereView } from '@/views/BDDataAnalysisPlatform/PlanisphereView'
import { SNRView } from '@/views/BDDataAnalysisPlatform/SNRView' import { SNRView } from '@/views/BDDataAnalysisPlatform/SNRView'
import MapView from '@/views/BDDataAnalysisPlatform/MapView.vue'
import { useNMEAStore, NMEADataSource } from '@/stores/nmea' import { useNMEAStore, NMEADataSource } from '@/stores/nmea'
import { LineBreakParser } from '@/utils/parser' import { LineBreakParser } from '@/utils/parser'
@ -55,8 +54,14 @@ const onSerialPortData = (value: Uint8Array) => {
} }
const softwareTitle = ref(null) const softwareTitle = ref(null)
const MapComponent = ref(null)
const MapViewComponent = defineAsyncComponent(() => import('@/views/BDDataAnalysisPlatform/MapView.vue'))
onMounted(() => { onMounted(() => {
softwareTitle.value.title = '北斗数据分析平台' softwareTitle.value.title = '北斗数据分析平台'
setTimeout(async () => {
MapComponent.value = await MapViewComponent
}, 1000)
}) })
window.ipcRenderer.receive('COM_LISTENER', onSerialPortData) window.ipcRenderer.receive('COM_LISTENER', onSerialPortData)

View File

@ -1,10 +1,49 @@
import { ref } from 'vue' import { ref } from 'vue'
import { defineStore } from 'pinia' import { defineStore } from 'pinia'
import { useMessage } from 'naive-ui'
import type { MessageReactive } from 'naive-ui'
export const useNetworkStore = defineStore('network', () => { export const useNetworkStore = defineStore('network', () => {
const message = useMessage()
const isOnLine = ref(window.navigator.onLine) const isOnLine = ref(window.navigator.onLine)
window.addEventListener( 'online' , () => isOnLine.value = true ) let checkLine
window.addEventListener( 'offline', () => isOnLine.value = false ) 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 }
}) })

View File

@ -19,7 +19,7 @@
</template> </template>
<script lang="ts" setup> <script lang="ts" setup>
import { ref, watch, onMounted } from 'vue' import { ref, watch } from 'vue'
import { NDescriptions, NDescriptionsItem, NTime, useMessage } from 'naive-ui' import { NDescriptions, NDescriptionsItem, NTime, useMessage } from 'naive-ui'
import { useNMEAStore } from '@/stores/nmea' import { useNMEAStore } from '@/stores/nmea'
@ -38,10 +38,6 @@ const connectErrMsg = (value: Boolean) => {
window.ipcRenderer.receive('CANNOT_CONNECT',connectErrMsg) window.ipcRenderer.receive('CANNOT_CONNECT',connectErrMsg)
onMounted(() => {
window.ipcRenderer.send('COM_READY')
})
watch(() => nmea.handled, (value) => { watch(() => nmea.handled, (value) => {
if (!value) return if (!value) return

View File

@ -14,10 +14,6 @@ const position = ref()
const mapRef = ref() const mapRef = ref()
onMounted(() => {
window.ipcRenderer.send('COM_READY')
})
watch(() => nmea.handled3, (value) => { watch(() => nmea.handled3, (value) => {
if (!value || !nmea.longitude || !nmea.latitude) return if (!value || !nmea.longitude || !nmea.latitude) return
@ -26,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>

View File

@ -22,10 +22,6 @@ use([
PolarComponent PolarComponent
]) ])
onMounted(() => {
window.ipcRenderer.send('COM_READY')
})
const nmea = useNMEAStore() const nmea = useNMEAStore()
watch(() => nmea.handled1, (value) => { watch(() => nmea.handled1, (value) => {
if (!value) return if (!value) return
@ -40,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>

View File

@ -22,10 +22,6 @@ use([
GridComponent GridComponent
]) ])
onMounted(() => {
window.ipcRenderer.send('COM_READY')
})
const nmea = useNMEAStore() const nmea = useNMEAStore()
watch(() => nmea.handled2, (value) => { watch(() => nmea.handled2, (value) => {
if (!value) return if (!value) return
@ -45,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>

View File

@ -14,7 +14,7 @@
<n-li>北京市海淀区黑泉路8号1幢宝盛广场B座8013</n-li> <n-li>北京市海淀区黑泉路8号1幢宝盛广场B座8013</n-li>
<n-li>400-166-5286</n-li> <n-li>400-166-5286</n-li>
<n-li>sales@hwasmart.com</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-ul>
</n-modal> </n-modal>
</template> </template>

View File

@ -39,8 +39,8 @@ const onBurnProgramBtnClick = async (binFileName: string) => {
dialog.info({ dialog.info({
title: '系统提示', title: '系统提示',
closable: false, closable: true,
maskClosable: false, maskClosable: true,
class: 'text-center', class: 'text-center',
content: () => h( content: () => h(
NSpin, NSpin,

View File

@ -25,6 +25,9 @@ import { h, ref } from 'vue'
import { NDivider, NCard, NDataTable, NInput, NButton, NIcon, useMessage } from 'naive-ui' import { NDivider, NCard, NDataTable, NInput, NButton, NIcon, useMessage } from 'naive-ui'
import { Wifi1BarFilled, Wifi2BarFilled, WifiFilled, RefreshFilled } from '@vicons/material' import { Wifi1BarFilled, Wifi2BarFilled, WifiFilled, RefreshFilled } from '@vicons/material'
import { hasIpcRenderer } from '@/utils' import { hasIpcRenderer } from '@/utils'
import { useNetworkStore } from '@/stores/modules/network'
const network = useNetworkStore()
const emit = defineEmits(['done']) const emit = defineEmits(['done'])
@ -74,12 +77,15 @@ const columns = [
return h( return h(
NButton, NButton,
{ {
type: 'info', type: row.ssid === current.value?.ssid && network.isOnLine ? 'primary' : 'info',
secondary: true, secondary: true,
disabled: row.ssid === current.value?.ssid || !row.password, disabled: row.ssid === current.value?.ssid && network.isOnLine || !row.password || row.password.length < 8,
onClick: () => connect({ ssid:row.ssid, password: row.password }) 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 return
} }
if(connectionOpts.password.length < 8) {
message.error('密码长度不足8位')
return
}
if (!hasIpcRenderer()) return if (!hasIpcRenderer()) return
const result = window.ipcRenderer.sendSync('NETWORK_CONNECT', connectionOpts) const result = window.ipcRenderer.sendSync('NETWORK_CONNECT', connectionOpts)
if (result === 'OK') { if (result === 'OK') {
message.success('网络连接成功') message.success('网络连接请求发送成功')
emit('done') emit('done')
} else { } else {
message.error(result.message) message.error(result.message)

View File

@ -1,18 +1,13 @@
<template> <template>
<n-space class="toolbar"> <n-space class="toolbar">
<div class="button-background"> <div class="button-background">
<n-popover :show="!network.isOnLine" placement="bottom"> <n-button size="large" circle type="info" @click="emit('systemSettings')">
<template #trigger>
<n-button size="large" circle type="info" @click="emit('systemSettings')">
<template #icon> <template #icon>
<n-icon> <n-icon>
<Settings /> <Settings />
</n-icon> </n-icon>
</template> </template>
</n-button> </n-button>
</template>
请连接网络
</n-popover >
<n-button size="large" circle type="info" @click="emit('quickBurning')"> <n-button size="large" circle type="info" @click="emit('quickBurning')">
<template #icon> <template #icon>
@ -42,7 +37,7 @@
</template> </template>
<script setup lang="ts"> <script setup lang="ts">
import { NSpace, NPopover , NButton, NIcon, useDialog } from 'naive-ui' import { NSpace, NButton, NIcon, useDialog } from 'naive-ui'
import { import {
PhoneFilled as Phone, PhoneFilled as Phone,
SettingsFilled as Settings, SettingsFilled as Settings,