Compare commits

..

6 commits

Author SHA1 Message Date
762c0df773 update 2024-02-05 23:20:22 +08:00
2fa972d5de update 2024-02-05 23:07:47 +08:00
039af54405 update 2024-02-05 22:28:05 +08:00
bc66c4fbdf update 2024-02-05 22:26:06 +08:00
1f3e9a4653 update 2024-02-05 19:17:26 +08:00
77bbe4d2d1 update 2024-02-05 17:58:37 +08:00
5 changed files with 66 additions and 3 deletions

View file

@ -5,6 +5,23 @@
<link rel="shortcut icon" type="image/x-icon" href="https://unpkg.byted-static.com/latest/byted/arco-config/assets/favicon.ico">
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>K5Web</title>
<style>
::-webkit-scrollbar {
width: 12px;
height: 4px;
}
::-webkit-scrollbar-thumb {
border: 4px solid transparent;
background-clip: padding-box;
border-radius: 7px;
background-color: var(--color-text-4);
}
::-webkit-scrollbar-thumb:hover {
background-color: var(--color-text-3);
}
</style>
</head>
<body>
<div id="app"></div>

BIN
public/gy.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 236 KiB

View file

@ -13,6 +13,9 @@
存储大小{{ state.eepromSize }} <a-button size="mini" type="primary" @click="checkEeprom">检测</a-button>
</a-card>
</a-space>
<div>
<img style="margin-bottom: 10px;" width="600px" src="/gy.png" />
</div>
</a-col>
</template>

View file

@ -5,6 +5,10 @@
<a-col :span="24">
<a-card class="general-card" title="卫星写入">
<a-spin :loading="loading" style="width: 100%;" tip="正在处理 ...">
<a-form-item :label-col-style="{ width: '25%' }" field="dt" label="浏览器时间">
{{ state.dt }}
<!-- &nbsp;&nbsp;<t-button size="small" theme="success" @click="syncTime">同步时间到台站</t-button> -->
</a-form-item>
<a-form-item :label-col-style="{ width: '25%' }" field="sat" label="选择卫星">
<a-select v-model="state.sat" @change="changeSat" placeholder="选择卫星 ..." allow-search allow-clear>
<a-option v-for="item in state.satData" :key="item.name" :value="item.name">{{ item.name }}</a-option>
@ -64,7 +68,7 @@
</template>
<script lang="ts" setup>
import { reactive, nextTick } from 'vue';
import { reactive, nextTick, onMounted, onUnmounted } from 'vue';
import { useAppStore } from '@/store';
import { eeprom_write, eeprom_reboot, eeprom_init, hexReverseStringToUint8Array, stringToUint8Array } from '@/utils/serial.js';
import useLoading from '@/hooks/loading';
@ -87,6 +91,8 @@ const state: {
pass: any,
passOption: any[],
rxTone: number | undefined,
dt: any,
timer: any
} = reactive({
status: "点击写入按钮写入卫星数据到设备<br/><br/>",
sat: '',
@ -106,9 +112,36 @@ const state: {
203.5, 206.5, 210.7, 218.1, 225.7, 229.1, 233.6, 241.8,
250.3, 254.1],
pass: undefined,
passOption: []
passOption: [],
dt: '',
timer: undefined
})
onMounted(()=>{
state.timer = setInterval(()=>{
state.dt = new Date().toLocaleString('zh-CN', { timeZone: 'Asia/Shanghai' })
}, 1000)
})
onUnmounted(()=>{
try{
clearInterval(state.timer)
}catch{}
})
const syncTime = async () => {
const date = new Date();
const dateArray = [
...hexReverseStringToUint8Array(parseInt(date.getFullYear().toString().substring(2,4)).toString(16)),
...hexReverseStringToUint8Array((date.getMonth() + 1).toString(16)),
...hexReverseStringToUint8Array(date.getDate().toString(16)),
...hexReverseStringToUint8Array(date.getHours().toString(16)),
...hexReverseStringToUint8Array(date.getMinutes().toString(16)),
...hexReverseStringToUint8Array(date.getSeconds().toString(16))
]
await eeprom_write(appStore.connectPort, 0x02BC0, new Uint8Array(dateArray), 0x06, appStore.configuration?.uart);
}
const changeSat = async (sat: any) => {
const data = state.satData.find(e => e.name == sat);
if (data && data.path) {
@ -169,7 +202,6 @@ const restoreRange = async (start: any = 0, uint8Array: any) => {
})
}
state.status = state.status + "写入进度100.0%<br/>";
await eeprom_reboot(appStore.connectPort);
}
const getPass = async () => {
@ -306,6 +338,8 @@ const writeIt = async () => {
payload = new Uint8Array(0x1E00)
payload.set(new Uint8Array(shift_arr).subarray(0, 0x1E00))
await restoreRange(0x1E200, payload)
await syncTime()
await eeprom_reboot(appStore.connectPort);
setLoading(false)
}
</script>

View file

@ -31,6 +31,7 @@
</a-col>
</a-row>
<t-table
class="ttable"
:loading="loading"
size="medium"
:columns="columns"
@ -668,4 +669,12 @@
cursor: pointer;
}
}
.ttable {
:deep(.t-table__affixed-header-elm-wrap){
height: 60px !important;
}
:deep(.t-table__content){
scrollbar-width: auto !important;
}
}
</style>