From a858b980054369ff87ffa9c5ddf483faccc6374e Mon Sep 17 00:00:00 2001 From: JongChern Date: Mon, 16 Nov 2026 14:05:23 +0800 Subject: [PATCH] DEV-1478: Sound_Level gets a Sound level panel of its own In the Other panel its axis was shared with the battery's percentage, the ExG status channels and the event marker, so a few dB of change filled a few percent of the panel. It now has a Sound level panel, just before Other, as shimmer-host-core's CAPTURE.md does from ShimmerResearch/shimmer-host-core#116. Panels, CaptureRulesTest, the README and the window's Sound level tooltip. Co-Authored-By: Claude Opus 5.5 --- .../src/main/java/com/shimmerresearch/capture/Panels.java | 6 +++++- .../src/main/java/com/shimmerresearch/capture/README.md | 6 +++--- .../shimmerresearch/simpleexamples/EventMarkersFrame.java | 2 +- .../java/com/shimmerresearch/capture/CaptureRulesTest.java | 5 +++-- 4 files changed, 12 insertions(+), 7 deletions(-) diff --git a/ShimmerPCBasicExamples/src/main/java/com/shimmerresearch/capture/Panels.java b/ShimmerPCBasicExamples/src/main/java/com/shimmerresearch/capture/Panels.java index 38c48f65f..595fcc5bc 100644 --- a/ShimmerPCBasicExamples/src/main/java/com/shimmerresearch/capture/Panels.java +++ b/ShimmerPCBasicExamples/src/main/java/com/shimmerresearch/capture/Panels.java @@ -14,7 +14,7 @@ public final class Panels { public static final List ALL = Collections.unmodifiableList(Arrays.asList( "Low-noise accel", "Wide-range accel", "Gyro", "Mag", "Battery", "Pressure", "Temperature", - "ADC", "ExG", "GSR", "PPG", "Other")); + "ADC", "ExG", "GSR", "PPG", "Sound level", "Other")); private static final Pattern ADC = Pattern.compile("(Int|Ext)_Exp_A\\d+"); private static final Pattern EXG = Pattern.compile("(ExG[12]_CH|Test_CHIP[12]_CH|ECG_|EMG_).*"); @@ -62,6 +62,10 @@ public static String of(String name) { if (PPG.matcher(name).matches()) { return "PPG"; } + // A panel of its own: a few dB of change would be lost on an axis shared with the battery's percentage + if (name.equals("Sound_Level")) { + return "Sound level"; + } return "Other"; } diff --git a/ShimmerPCBasicExamples/src/main/java/com/shimmerresearch/capture/README.md b/ShimmerPCBasicExamples/src/main/java/com/shimmerresearch/capture/README.md index bfe550c12..4d512f438 100644 --- a/ShimmerPCBasicExamples/src/main/java/com/shimmerresearch/capture/README.md +++ b/ShimmerPCBasicExamples/src/main/java/com/shimmerresearch/capture/README.md @@ -39,8 +39,8 @@ Recordings go to `Shimmer Capture` in Documents. - **Stream tab:** - Start, Stop and Record to CSV. - The plot, in CAPTURE.md's panels by channel name: 5, 10 or 30 s, calibrated or raw, Clear. A - Shimmer3R's `Sound_Level` (nominal dB(A)) is in the Other panel, without the samples where the - unit has no level yet. + Shimmer3R's `Sound_Level` (nominal dB(A)) has a Sound level panel of its own, without the samples + where the unit has no level yet. - **Event markers and audio...**: the event channel and the microphone (below). - **Device tab:** - Read battery, Read status, Toggle red LED (then the status, whose flag says whether it is on). @@ -172,6 +172,6 @@ To try the microphone: 1. Connect, then open Event markers and audio. 2. Set Audio recording to Fingerprint only, tick Sound level, and click Write. 3. Check the line under the buttons for what the unit kept. -4. Start streaming: `Sound_Level` appears in the Other panel. +4. Start streaming: `Sound_Level` appears in the Sound level panel. 5. Stop streaming, start logging on the Device tab, then click Read audio status to see whether it is recording audio. diff --git a/ShimmerPCBasicExamples/src/main/java/com/shimmerresearch/simpleexamples/EventMarkersFrame.java b/ShimmerPCBasicExamples/src/main/java/com/shimmerresearch/simpleexamples/EventMarkersFrame.java index e37e800e9..1d23675d2 100644 --- a/ShimmerPCBasicExamples/src/main/java/com/shimmerresearch/simpleexamples/EventMarkersFrame.java +++ b/ShimmerPCBasicExamples/src/main/java/com/shimmerresearch/simpleexamples/EventMarkersFrame.java @@ -211,7 +211,7 @@ public void actionPerformed(ActionEvent e) { mComboAudioMode.setToolTipText("What the unit saves from its microphone while it logs to its SD card (audio/ on the card)"); audio.add(mComboAudioMode, c); c.gridx = 0; c.gridy = 1; c.gridwidth = 2; - mChkSoundLevel.setToolTipText("A channel in the data: in the plot's Other panel and the CSV. LogAndStream v1.01.026 on."); + mChkSoundLevel.setToolTipText("A channel in the data: in the plot's Sound level panel and the CSV. LogAndStream v1.01.026 on."); audio.add(mChkSoundLevel, c); c.gridwidth = 1; JPanel audioButtons = new JPanel(new FlowLayout(FlowLayout.LEFT, 4, 0)); diff --git a/ShimmerPCBasicExamples/src/test/java/com/shimmerresearch/capture/CaptureRulesTest.java b/ShimmerPCBasicExamples/src/test/java/com/shimmerresearch/capture/CaptureRulesTest.java index 4a39561d8..d64a43125 100644 --- a/ShimmerPCBasicExamples/src/test/java/com/shimmerresearch/capture/CaptureRulesTest.java +++ b/ShimmerPCBasicExamples/src/test/java/com/shimmerresearch/capture/CaptureRulesTest.java @@ -274,7 +274,7 @@ public void channelsGoInThePanelsCaptureMdNames() { assertEquals("GSR", Panels.of("GSR_Skin_Conductance")); assertEquals("PPG", Panels.of("PPG_A13")); assertEquals("PPG", Panels.of("PPG1_A12")); - assertEquals("Other", Panels.of("Sound_Level")); + assertEquals("Sound level", Panels.of("Sound_Level")); assertEquals("Other", Panels.of("Batt_Percentage")); assertNull(Panels.of("Timestamp")); assertNull(Panels.of("System_Timestamp_Plot")); @@ -433,7 +433,8 @@ public void theSoundLevelIsAColumnOfTheRecordingWithNaNWhereThereIsNoLevel() thr assertEquals("-32768", rows[2].split(",")[raw]); assertEquals("54.32", rows[3].split(",")[cal]); assertEquals("5432", rows[3].split(",")[raw]); - assertEquals("Other", Panels.of("Sound_Level")); + assertEquals("Sound level", Panels.of("Sound_Level")); + assertEquals("Sound level", Panels.ALL.get(Panels.ALL.size() - 2)); } }