diff --git a/services/frontend/src/app/styles/index.css b/services/frontend/src/app/styles/index.css index 08ec482..5313301 100644 --- a/services/frontend/src/app/styles/index.css +++ b/services/frontend/src/app/styles/index.css @@ -123,3 +123,15 @@ @apply bg-background text-foreground; } } + +@keyframes spin-slow { + from { + transform: rotate(0deg); + } + to { + transform: rotate(360deg); + } +} +.animate-spin-slow { + animation: spin-slow 4s linear infinite; +} diff --git a/services/frontend/src/features/liveStream/model/liveStream.store.ts b/services/frontend/src/features/liveStream/model/liveStream.store.ts index 48e1285..122a455 100644 --- a/services/frontend/src/features/liveStream/model/liveStream.store.ts +++ b/services/frontend/src/features/liveStream/model/liveStream.store.ts @@ -167,7 +167,7 @@ export const useLiveStreamStore = create()((set, get) => { peakWindow.push(sample); trimPeakWindow(sample.timeMs); - // Throttled UI update (important for Recharts + overall UI smoothness) + // Throttled UI update scheduleFlush(); }, }); diff --git a/services/frontend/src/pages/dashboard/ui/DashboardPage.tsx b/services/frontend/src/pages/dashboard/ui/DashboardPage.tsx index 893aa97..3b6a7d0 100644 --- a/services/frontend/src/pages/dashboard/ui/DashboardPage.tsx +++ b/services/frontend/src/pages/dashboard/ui/DashboardPage.tsx @@ -7,7 +7,7 @@ export function DashboardPage() { return (
-

STM32 Audio Analyze Dashboard

+

STM32 Панель анализа звука

Частоты: 129 Гц - 5,5 кГц; Громкость: -50 - 0 дБ

diff --git a/services/frontend/src/widgets/audioLive/ui/AudioLiveWidget.tsx b/services/frontend/src/widgets/audioLive/ui/AudioLiveWidget.tsx index f97be16..6172f35 100644 --- a/services/frontend/src/widgets/audioLive/ui/AudioLiveWidget.tsx +++ b/services/frontend/src/widgets/audioLive/ui/AudioLiveWidget.tsx @@ -1,4 +1,3 @@ -// src/widgets/audioLive/ui/AudioLiveWidget.tsx import { useMemo } from "react"; import { useLiveStreamStore } from "../../../features/liveStream/model/liveStream.store"; import { WsStatusBadge } from "../../../features/liveStream/ui/WsStatusBadge"; @@ -12,6 +11,8 @@ import { } from "../../../shared/ui/card"; import { freqToNote } from "../../../entities/audioSample/lib/note"; import { formatTimeHHMMSS, isStale } from "../../../shared/lib/time"; +import { FrequencyCurrentDisplay } from "./FrequencyCurrentDisplay"; +import { WaveformDisplay } from "./WaveFormDisplay"; const HZ_OPTIONS: number[] = [0.1, 0.25, 0.5, 1, 2.5, 5, 10, 15] as const; @@ -23,6 +24,11 @@ const WINDOW_OPTIONS: Array<{ label: string; ms: number }> = [ { label: "5m", ms: 300_000 }, ]; +export const LOUDNESS_THRESHOLD = -35.0; + +export const MIN_FREQUENCY = 129; +export const MAX_FREQUENCY = 5500; + export function AudioLiveWidget() { const status = useLiveStreamStore((s) => s.status); const latest = useLiveStreamStore((s) => s.latest); @@ -43,18 +49,18 @@ export function AudioLiveWidget() { }, [latest]); return ( -
-
+
+
-
+
- Live status + Состояние
@@ -62,7 +68,7 @@ export function AudioLiveWidget() {
-
Last update
+
Последнее обновление
{lastMessageAt ? formatTimeHHMMSS(lastMessageAt) : "—"}
-
Frequency
+
Частота
{latest ? `${latest.freq_hz.toFixed(0)} Hz` : "—"}{" "} ({note}) @@ -91,7 +97,7 @@ export function AudioLiveWidget() { {/* Controls */}