v0.5.3: add alarm sounds

This commit is contained in:
GABRIEL Sebastian 2026-11-12 14:34:31 +01:00
commit fcd8c1146f
10 changed files with 1121 additions and 12 deletions

View file

@ -1,4 +1,4 @@
# Patient Monitor Simulation (PaMSim) — v0.5.2
# Patient Monitor Simulation (PaMSim) — v0.5.3
A two-window, Rust/GTK4 patient-monitor simulator for teaching on Fedora Linux.
@ -9,7 +9,7 @@ A two-window, Rust/GTK4 patient-monitor simulator for teaching on Fedora Linux.
## Build and run on Fedora
```bash
sudo dnf install rust cargo gcc pkgconf-pkg-config gtk4-devel
sudo dnf install rust cargo gcc pkgconf-pkg-config gtk4-devel pipewire-utils
cargo test
cargo run --release
```
@ -48,6 +48,35 @@ The monitor can be resized and toggled fullscreen with **F11**; **Esc** exits
fullscreen. On Wayland, move the monitor to the presentation screen before
activating fullscreen. Fullscreen does not lock down the computer.
## Audible alarms (v0.5.3)
Sound is **enabled by default**. The Admin window has an **Audible alarms**
checkbox for muting and a **Test tone** button (works even while muted).
Visual alarms keep blinking normally when sound is off.
- **Critical rhythm alarm:** VT, PVT, VF and asystole produce a double beep
(two short 880 Hz tones), repeated approximately every 1.5 seconds.
- **Numerical and SpO₂ technical alarms:** out-of-range values, **NO SENSOR**
and **NO READING** produce a single 700 Hz beep, repeated approximately
every 2.5 seconds.
- Critical alarms have priority: only one tone pattern is played even if
multiple alarms are active. The sound stops when all alarms clear or when
the checkbox is unchecked. Alarms on hidden monitor channels are excluded.
- Values not yet available (e.g. NIBP before a completed measurement) do not
trigger numerical limit alarms. The cuff measurement cycle by itself is not
an alarm. Audio playback is separate from waveform rendering and simulation.
On Fedora, sound is played through **`pw-play`** from `pipewire-utils`, with
**`paplay`** as a fallback. No additional Rust crates or sound files are needed:
the application creates its own short WAV tones at runtime. If neither player
is installed, Admin reports that audio is unavailable; the monitor continues
to work normally. `Test tone` helps verify the desktop audio output. The
application uses the system output device and mixer volume.
**Important:** These simple teaching tones do not comply with medical-device
alarm standards (including IEC 60601-1-8) and must never be relied on for
clinical monitoring.
## Numerical alarm limits (v0.4.0; layout and presets updated in v0.4.1)
Each displayed numeric measurement has an **independent optional lower (↓) and
@ -411,3 +440,12 @@ The left waveform column and right numeric column now share the same row grid.
NIBP reserves an empty cell in the left waveform column instead of shortening
the other numeric rows. Hiding any channel reflows both columns together.
No NIBP measurement logic or alarm behavior was changed.
## v0.5.3 — Audible alarm output
- Alarm-tone playback through Fedora PipeWire (`pw-play`) or PulseAudio
compatibility (`paplay`), without any new Rust library dependencies.
- Admin controls to mute/unmute alarms or play a test tone.
- Distinct critical-rhythm and standard/technical patterns; critical priority.
- Audio keeps running independently of the monitor's drawing callback.
- Visual alarms and existing physiological simulation remain unchanged.