From d534fd4ec8dda4aad607a8c1f153e936e189989d Mon Sep 17 00:00:00 2001 From: kerms Date: Fri, 28 Jun 2024 11:18:14 +0800 Subject: [PATCH] feat(uart) clear RX/TX byte count on click --- src/stores/dataViewerStore.ts | 12 ++++++++++++ src/views/text-data-viewer/textDataViewer.vue | 4 ++-- 2 files changed, 14 insertions(+), 2 deletions(-) diff --git a/src/stores/dataViewerStore.ts b/src/stores/dataViewerStore.ts index 5a28993..e4b9288 100644 --- a/src/stores/dataViewerStore.ts +++ b/src/stores/dataViewerStore.ts @@ -442,6 +442,16 @@ export const useDataViewerStore = defineStore('text-viewer', () => { let RxByteCountLocal = 0; let RxTotalByteCountLocal = 0; + function clearRxCounter() { + RxByteCountLocal = 0; + RxTotalByteCountLocal = 0; + } + + function clearTxCounter() { + TxByteCountLocal = 0; + TxTotalByteCountLocal = 0; + } + const enableFilter = ref(true); const forceToBottom = ref(true); const filterChanged = ref(false); @@ -745,6 +755,8 @@ export const useDataViewerStore = defineStore('text-viewer', () => { RxTotalByteCount, TxByteCount, TxTotalByteCount, + clearRxCounter, + clearTxCounter, forceToBottom, filterChanged, diff --git a/src/views/text-data-viewer/textDataViewer.vue b/src/views/text-data-viewer/textDataViewer.vue index a9d6d45..11943f5 100644 --- a/src/views/text-data-viewer/textDataViewer.vue +++ b/src/views/text-data-viewer/textDataViewer.vue @@ -207,12 +207,12 @@
- + {{ `TX(B):${store.TxByteCount}/ ${store.TxTotalByteCount}` }} - + {{ `RX(B):${store.RxByteCount}/ ${store.RxTotalByteCount}` }}