feat(uart) clear RX/TX byte count on click

This commit is contained in:
kerms 2024-06-28 11:18:14 +08:00
parent 8a84b215a7
commit d534fd4ec8
2 changed files with 14 additions and 2 deletions

View File

@ -442,6 +442,16 @@ export const useDataViewerStore = defineStore('text-viewer', () => {
let RxByteCountLocal = 0; let RxByteCountLocal = 0;
let RxTotalByteCountLocal = 0; let RxTotalByteCountLocal = 0;
function clearRxCounter() {
RxByteCountLocal = 0;
RxTotalByteCountLocal = 0;
}
function clearTxCounter() {
TxByteCountLocal = 0;
TxTotalByteCountLocal = 0;
}
const enableFilter = ref(true); const enableFilter = ref(true);
const forceToBottom = ref(true); const forceToBottom = ref(true);
const filterChanged = ref(false); const filterChanged = ref(false);
@ -745,6 +755,8 @@ export const useDataViewerStore = defineStore('text-viewer', () => {
RxTotalByteCount, RxTotalByteCount,
TxByteCount, TxByteCount,
TxTotalByteCount, TxTotalByteCount,
clearRxCounter,
clearTxCounter,
forceToBottom, forceToBottom,
filterChanged, filterChanged,

View File

@ -207,12 +207,12 @@
</el-link> </el-link>
</div> </div>
<div class="flex gap-2"> <div class="flex gap-2">
<el-link> <el-link @click="store.clearTxCounter()">
<el-tag class="font-mono font-bold" size="small"> <el-tag class="font-mono font-bold" size="small">
{{ `TX(B):${store.TxByteCount}/ ${store.TxTotalByteCount}` }} {{ `TX(B):${store.TxByteCount}/ ${store.TxTotalByteCount}` }}
</el-tag> </el-tag>
</el-link> </el-link>
<el-link type="success"> <el-link type="success" @click="store.clearRxCounter()">
<el-tag class="font-mono font-bold" size="small" type="success"> <el-tag class="font-mono font-bold" size="small" type="success">
{{ `RX(B):${store.RxByteCount}/ ${store.RxTotalByteCount}` }} {{ `RX(B):${store.RxByteCount}/ ${store.RxTotalByteCount}` }}
</el-tag> </el-tag>