mirror of
https://github.com/silenty4ng/k5web
synced 2025-01-15 16:22:44 +00:00
Compare commits
No commits in common. "762c0df773799bf202dde01f41f9d9086c28e5de" and "fc410bbac2aa1a661c62c3fe163cba1de54dbf33" have entirely different histories.
762c0df773
...
fc410bbac2
5 changed files with 3 additions and 66 deletions
17
index.html
17
index.html
|
@ -5,23 +5,6 @@
|
||||||
<link rel="shortcut icon" type="image/x-icon" href="https://unpkg.byted-static.com/latest/byted/arco-config/assets/favicon.ico">
|
<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" />
|
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
|
||||||
<title>K5Web</title>
|
<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>
|
</head>
|
||||||
<body>
|
<body>
|
||||||
<div id="app"></div>
|
<div id="app"></div>
|
||||||
|
|
BIN
public/gy.png
BIN
public/gy.png
Binary file not shown.
Before Width: | Height: | Size: 236 KiB |
|
@ -13,9 +13,6 @@
|
||||||
存储大小:{{ state.eepromSize }} <a-button size="mini" type="primary" @click="checkEeprom">检测</a-button>
|
存储大小:{{ state.eepromSize }} <a-button size="mini" type="primary" @click="checkEeprom">检测</a-button>
|
||||||
</a-card>
|
</a-card>
|
||||||
</a-space>
|
</a-space>
|
||||||
<div>
|
|
||||||
<img style="margin-bottom: 10px;" width="600px" src="/gy.png" />
|
|
||||||
</div>
|
|
||||||
</a-col>
|
</a-col>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
|
|
|
@ -5,10 +5,6 @@
|
||||||
<a-col :span="24">
|
<a-col :span="24">
|
||||||
<a-card class="general-card" title="卫星写入">
|
<a-card class="general-card" title="卫星写入">
|
||||||
<a-spin :loading="loading" style="width: 100%;" tip="正在处理 ...">
|
<a-spin :loading="loading" style="width: 100%;" tip="正在处理 ...">
|
||||||
<a-form-item :label-col-style="{ width: '25%' }" field="dt" label="浏览器时间">
|
|
||||||
{{ state.dt }}
|
|
||||||
<!-- <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-form-item :label-col-style="{ width: '25%' }" field="sat" label="选择卫星">
|
||||||
<a-select v-model="state.sat" @change="changeSat" placeholder="选择卫星 ..." allow-search allow-clear>
|
<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>
|
<a-option v-for="item in state.satData" :key="item.name" :value="item.name">{{ item.name }}</a-option>
|
||||||
|
@ -68,7 +64,7 @@
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script lang="ts" setup>
|
<script lang="ts" setup>
|
||||||
import { reactive, nextTick, onMounted, onUnmounted } from 'vue';
|
import { reactive, nextTick } from 'vue';
|
||||||
import { useAppStore } from '@/store';
|
import { useAppStore } from '@/store';
|
||||||
import { eeprom_write, eeprom_reboot, eeprom_init, hexReverseStringToUint8Array, stringToUint8Array } from '@/utils/serial.js';
|
import { eeprom_write, eeprom_reboot, eeprom_init, hexReverseStringToUint8Array, stringToUint8Array } from '@/utils/serial.js';
|
||||||
import useLoading from '@/hooks/loading';
|
import useLoading from '@/hooks/loading';
|
||||||
|
@ -91,8 +87,6 @@ const state: {
|
||||||
pass: any,
|
pass: any,
|
||||||
passOption: any[],
|
passOption: any[],
|
||||||
rxTone: number | undefined,
|
rxTone: number | undefined,
|
||||||
dt: any,
|
|
||||||
timer: any
|
|
||||||
} = reactive({
|
} = reactive({
|
||||||
status: "点击写入按钮写入卫星数据到设备<br/><br/>",
|
status: "点击写入按钮写入卫星数据到设备<br/><br/>",
|
||||||
sat: '',
|
sat: '',
|
||||||
|
@ -112,36 +106,9 @@ const state: {
|
||||||
203.5, 206.5, 210.7, 218.1, 225.7, 229.1, 233.6, 241.8,
|
203.5, 206.5, 210.7, 218.1, 225.7, 229.1, 233.6, 241.8,
|
||||||
250.3, 254.1],
|
250.3, 254.1],
|
||||||
pass: undefined,
|
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 changeSat = async (sat: any) => {
|
||||||
const data = state.satData.find(e => e.name == sat);
|
const data = state.satData.find(e => e.name == sat);
|
||||||
if (data && data.path) {
|
if (data && data.path) {
|
||||||
|
@ -202,6 +169,7 @@ const restoreRange = async (start: any = 0, uint8Array: any) => {
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
state.status = state.status + "写入进度:100.0%<br/>";
|
state.status = state.status + "写入进度:100.0%<br/>";
|
||||||
|
await eeprom_reboot(appStore.connectPort);
|
||||||
}
|
}
|
||||||
|
|
||||||
const getPass = async () => {
|
const getPass = async () => {
|
||||||
|
@ -338,8 +306,6 @@ const writeIt = async () => {
|
||||||
payload = new Uint8Array(0x1E00)
|
payload = new Uint8Array(0x1E00)
|
||||||
payload.set(new Uint8Array(shift_arr).subarray(0, 0x1E00))
|
payload.set(new Uint8Array(shift_arr).subarray(0, 0x1E00))
|
||||||
await restoreRange(0x1E200, payload)
|
await restoreRange(0x1E200, payload)
|
||||||
await syncTime()
|
|
||||||
await eeprom_reboot(appStore.connectPort);
|
|
||||||
setLoading(false)
|
setLoading(false)
|
||||||
}
|
}
|
||||||
</script>
|
</script>
|
||||||
|
|
|
@ -31,7 +31,6 @@
|
||||||
</a-col>
|
</a-col>
|
||||||
</a-row>
|
</a-row>
|
||||||
<t-table
|
<t-table
|
||||||
class="ttable"
|
|
||||||
:loading="loading"
|
:loading="loading"
|
||||||
size="medium"
|
size="medium"
|
||||||
:columns="columns"
|
:columns="columns"
|
||||||
|
@ -669,12 +668,4 @@
|
||||||
cursor: pointer;
|
cursor: pointer;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
.ttable {
|
|
||||||
:deep(.t-table__affixed-header-elm-wrap){
|
|
||||||
height: 60px !important;
|
|
||||||
}
|
|
||||||
:deep(.t-table__content){
|
|
||||||
scrollbar-width: auto !important;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
</style>
|
</style>
|
||||||
|
|
Loading…
Reference in a new issue