From 10e4a82e5b3f41c9a33ff83cd508558638177352 Mon Sep 17 00:00:00 2001 From: SikongJueluo Date: Tue, 22 Jul 2025 02:17:45 +0800 Subject: [PATCH] =?UTF-8?q?feat:=20=E4=BF=AE=E6=94=B9=E7=A4=BA=E6=B3=A2?= =?UTF-8?q?=E5=99=A8=E5=A4=96=E8=A7=82?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Oscilloscope/OscilloscopeManager.ts | 7 +- src/views/Project/Oscilloscope.vue | 164 +++++++----------- 2 files changed, 65 insertions(+), 106 deletions(-) diff --git a/src/components/Oscilloscope/OscilloscopeManager.ts b/src/components/Oscilloscope/OscilloscopeManager.ts index 3ad528e..821e82d 100644 --- a/src/components/Oscilloscope/OscilloscopeManager.ts +++ b/src/components/Oscilloscope/OscilloscopeManager.ts @@ -26,7 +26,7 @@ const DEFAULT_CONFIG: OscilloscopeFullConfig = new OscilloscopeFullConfig({ triggerLevel: 128, triggerRisingEdge: true, horizontalShift: 0, - decimationRate: 0, + decimationRate: 50, autoRefreshRAM: false, }); @@ -137,6 +137,7 @@ const [useProvideOscilloscope, useOscilloscopeState] = createInjectionState(() = if (refreshIntervalId !== undefined) { clearInterval(refreshIntervalId); refreshIntervalId = undefined; + isCapturing.value = false; } }; @@ -161,7 +162,6 @@ const [useProvideOscilloscope, useOscilloscopeState] = createInjectionState(() = isCapturing.value = false; stopAutoRefresh(); } finally { - isCapturing.value = false; release(); } }; @@ -181,6 +181,7 @@ const [useProvideOscilloscope, useOscilloscopeState] = createInjectionState(() = alert.info("捕获已停止", 2000); } catch (error) { alert.error("停止捕获失败", 3000); + isCapturing.value = true; } finally { release(); } @@ -226,7 +227,7 @@ const [useProvideOscilloscope, useOscilloscopeState] = createInjectionState(() = try { const ok = await client.refreshRAM(); if (ok) { - alert.success("RAM已刷新", 2000); + // alert.success("RAM已刷新", 2000); } else { throw new Error(); } diff --git a/src/views/Project/Oscilloscope.vue b/src/views/Project/Oscilloscope.vue index 9da0ae1..93ac6c1 100644 --- a/src/views/Project/Oscilloscope.vue +++ b/src/views/Project/Oscilloscope.vue @@ -3,9 +3,16 @@
-

- - 波形显示 +

+
+ + 波形显示 +
+
+ +

@@ -16,122 +23,73 @@

示波器配置

-
+
- + -
-
- - +
+
+
+ +
+ + + + +
- - -
-
-

捕获控制

- - - - -
-
- - -
-
-

RAM 操作

- -
-