Restructure README

This commit is contained in:
GABRIEL Sebastian 2026-11-13 12:21:52 +01:00
commit d9c333f8fb
3 changed files with 2753 additions and 674 deletions

View file

@ -6,23 +6,214 @@ A Rust/GTK4 patient-monitor simulator with two main windows for teaching on Fedo
> plethysmography and capnography are schematic mathematical approximations. The
> simulation has no clinical validation and is not a medical device.
## Instructor shortcuts on the Actions tab (v0.6.10)
## Overview
The **Actions & Occurrences** tab keeps **Chest compressions** (Start/Stop button
and quality selector: Good, Adequate, Poor, Bad) permanently visible **above**
the scripted action selector. These are the same controls as on Direct Mode,
backed by the same state; changes in either tab are reflected in the other.
Chest compressions therefore no longer needs a redundant entry in the action
dropdown. Its clinical simulation behavior is unchanged.
**SimPaM** is a touchscreen-capable patient-monitor simulation for teaching
anesthesia, intensive care and emergency medicine. An instructor changes the
patient's physiology in the **Admin** window, while learners see a simulated
bedside monitor that can be resized or shown fullscreen. The application uses
synthetic signals and is intended for demonstrations and scenarios—not patient
monitoring.
A wide **yellow Defibrillation** shortcut with a **red lightning-bolt icon** is
also always available above the scripted actions. One press produces the
**existing transient ECG defibrillation artifact only**. It does not change
rhythm, ART, EtCO₂ or other physiological parameters, and it does not add a
long-running scripted action. For rhythm conversion and hemodynamic targets,
continue to select **Defibrillation + rhythm change** from the dropdown.
| Area | What you can do |
| --- | --- |
| **Direct Mode** | Set ECG rhythm and HR, mechanical capture, oxygen saturation and signal quality, invasive blood pressure, capnography, NIBP and visibility. |
| **Actions & Occurrences** | Trigger time-based deterioration, defibrillation artifacts, simulated interventions and chest compressions; pause, resume or stop scripted changes. |
| **Monitor** | Display ECG, SpO₂/plethysmography, ART, capnography, alarms and numerical measurements. Touch a parameter to adjust its alarm limits. |
| **NIBP** | Start a cuff measurement manually or turn on automatic measurements; at startup there is no NIBP reading and Auto is off. |
| **Sound** | Hear two-tone alarms and the optional saturation-dependent QRS/pulse beep; selectively pause already-active audible alarms for 120 s. |
## Actions & Occurrences (v0.6.9)
### Guide contents
- [Getting started](#getting-started)
- [Windows, monitor layout and touch operation](#windows-monitor-layout-and-touch-operation)
- [Instructor controls and scenarios](#instructor-controls-and-scenarios)
- [Measurements and signal behavior](#measurements-and-signal-behavior)
- [Alarm limits and sounds](#alarm-limits-and-sounds)
- [Technical reference](#technical-reference)
- [Changelog](#changelog)
## Getting started
### Build and run on Fedora
```bash
sudo dnf install rust cargo gcc pkgconf-pkg-config gtk4-devel pipewire-utils
cargo test
cargo run --release
```
Run these commands from the extracted `patient-monitor-simulation` folder.
Window titles show the application version. GTK4 requires a functional graphical
session (e.g., Fedora KDE/Wayland).
### First session
1. Open the **Admin** and **Monitor** windows. In **Direct Mode**, choose a
rhythm and set the initial values. The monitor updates continuously.
2. If needed, enter a patient name and adjust alarm thresholds or choose
**Adult** under **Alert presets**.
3. For a blood-pressure cuff reading, use **Measure now** in Admin or the
NIBP touch menu. **Automatic measurement** is initially OFF.
4. Switch to **Actions & Occurrences** to trigger an event, use the yellow
**Defibrillation** shortcut or control chest compressions. To present the
monitor fullscreen, press **F11**; use **Esc** to exit.
The following sections provide the complete controls, simulation behavior and
technical details. The [Changelog](#changelog) is kept at the end.
## Windows, monitor layout and touch operation
### Windows
**Admin sections** have a narrow colored stripe on their left edge to match the
monitor: ECG **green**, SpO₂ **yellow**, invasive arterial pressure **red**,
capnography **light grey**, NIBP **red**. The Patient section remains
neutral. These accents are drawn by GTK and remain visible independently of
light/dark themes. This is a visual-only change; control behavior is unchanged.
**Admin:** Controls patient name; ECG rhythm and rate; mechanical capture;
SpO₂, signal quality and sensor connection; invasive arterial pressure,
waveform shape and pulse-pressure variation; NIBP; and capnography. Numeric inputs have bidirectionally linked sliders and text fields.
Each of the five monitor parameters (ECG, SpO₂/pleth, ART, CO₂, NIBP) has its
own **Show on monitor** checkbox.
**Monitor:** Black background; ECG green, pleth yellow, ART red and capnogram
light grey. The patient name entered in Admin replaces **PATIENT MONITOR** in
the header immediately; leaving the name blank restores the generic title.
Long names are automatically resized or clipped to fit the header.
Waveforms and vital signs disappear together when their respective
visibility checkbox is cleared. Remaining waveform rows expand to use the space.
Hiding a display channel does **not** stop signal generation or physiological
coupling: for example, hiding ECG does not stop ART or pleth pulses.
The final row is split into four equal-width measurement groups, with **NIBP in
the fourth group**, aligned beneath the regular numeric column. The first
three groups are reserved for future measurements. Hiding NIBP only clears
its own fourth group, without removing the final row.
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.
### Monitor layout (v0.5.7)
The monitor uses a fixed **3:1 column ratio** over the drawable area:
**75% waveform column / 25% numeric column**, regardless of window size.
The last row is reserved for four equal-width numerical measurement groups:
| Group 1 (25%) | Group 2 (25%) | Group 3 (25%) | Group 4 (25%) |
| --- | --- | --- | --- |
| CO / CI | SVRI · GEDI · ELWI | *(empty)* | NIBP |
The first two groups currently display only their headings, with no numerical
values or simulation logic. The third group is completely empty. The fourth
retains the existing red NIBP readings, cuff gauge, progress bar and alarms.
The NIBP visibility toggle hides **only the fourth group's content**; the
bottom measurement row and other three groups remain present. Disabling one
of the four waveform channels still reflows the remaining rows above it.
### Display options (new in v0.3)
The five **Show on monitor** checkboxes affect the presentation only:
| Checkbox | Hidden monitor content |
| --- | --- |
| ECG | ECG waveform, HR and rhythm alarm (when present) |
| Pulse oximetry | Pleth waveform, SpO₂ and PR |
| Invasive arterial blood pressure | ART waveform, pressure values, MAP and PPV label |
| Capnography | CO₂ waveform, EtCO₂ and RR |
| NIBP | Timed cuff-measurement values and red right-column value box |
Remaining visible waveform rows and the bottom measurements row share an equal
portion of the available height and remain aligned across both columns; zero
waveform channels is supported. Hiding NIBP leaves the three future measurement
placeholders visible.
### Header controls: selective alarm pause and settings (v0.6.8)
Two touch/mouse controls are drawn at the far right of the monitor header:
- **Yellow bell (rightmost):** pauses only the *currently active* audible
alarm conditions for **120 seconds**. The caption `paused for x s` counts
down the remaining seconds. Pressing the bell again replaces the suppressed
set with the conditions active at that moment and restarts the 120-second
timer. A newly triggered alarm condition sounds normally, even if another
alarm of the same priority is paused. When a condition clears, it loses its
paused status so a later recurrence can sound. Pauses never change visual
alarms or the separate beat-synchronous QRS sound. Pressing the bell when
no alarms are active does not start a countdown.
- **Gear (left of bell):** opens a black/light-grey monitor-side settings panel
with **QRS beep**, **Audible alarms**, **Alert presets** (`Custom`, `Adult`),
an editable **Patient name** field and the attribution
`PaMSim by Critical Care Club Austria, (c) 2026`. It does **not** create
an on-screen keyboard. **Apply** synchronizes settings with Admin;
**Cancel/Esc** discards changes. The Adult preset affects alarm limits only.
Other channel touch menus are unchanged. NIBP retains its explicitly requested
manual measurement, automatic measurement and interval controls.
### Monitor touchscreen: alarm limits and NIBP controls (v0.6.4)
Tap or click the **waveform or numerical readout** of ECG, SpO₂, ART or CO₂
to open that channel's alarm-limit panel. For NIBP, tap the **rightmost
quarter of the bottom measurement row**. The other three bottom-row groups
are reserved for future measurements and remain non-interactive. The panels
are available in fullscreen and retain a **black background, very light-grey
text, and 0.8-pixel borders and dividers**, in the style of the main monitor.
**Alarm thresholds can be modified from every monitor-side menu.**
No keyboard is required: every lower/upper limit has large **− / +** controls
with a parameter-specific increment and an independent **ON/OFF** control.
Unset limits remain disabled. The lower limit cannot exceed the upper limit.
| Touch area | Available alarm limits | Increment |
| --- | --- | --- |
| ECG | HR | 5 bpm |
| SpO₂ | SpO₂; pulse rate (PR) | 1% SpO₂; 5 bpm PR |
| ART | SYS; MAP; DIA; PPV | 5 mmHg pressure; 1% PPV |
| CO₂ | EtCO₂; respiratory rate (RR) | 1 mmHg EtCO₂; 1 breath/min RR |
| NIBP | SYS; MAP; DIA | 5 mmHg |
**Apply** commits the threshold changes and synchronizes the Admin window.
Changing a threshold sets the alarm preset to **Custom**. **Cancel** or
**Esc** discards the draft changes.
**NIBP is the exception:** its monitor-side menu additionally provides **Measure now**,
**Automatic measurement ON/OFF**, and the **1/3/5/10/20/30/60-minute interval**.
Interval and Auto changes take effect with **Apply** (or are discarded with
Cancel/Esc); **Measure now starts immediately**, even with Auto OFF and before
Apply. The touch controls synchronize with Admin. A measurement already in
progress is not restarted. The simulated failure option and cuff placement
remain Admin-only, as do ECG lead, SpO₂ sensor/quality and waveform choices.
#### NIBP startup and automatic measurements
**Auto measurement is OFF by default.** On startup the monitor shows
`---/---` (MAP `---`) and no measurement is initiated. To obtain a reading,
select **Measure now** in the NIBP monitor menu (or in Admin), or enable
**Automatic NIBP measurement** via the menu (or Admin). The first automatic cycle begins immediately after enabling Auto;
subsequent measurement intervals count from completion of the prior cycle.
Disabling Auto stops further scheduled measurements without interrupting a
cycle already in progress. Manual measurement remains possible while Auto
is off. The interval bar is empty and the monitor displays `AUTO OFF`
whenever automatic measurements are disabled.
#### Horizontal touchscreen alarm matrix (v0.6.3)
All five monitor touch menus now share a compact horizontal alarm-limit matrix.
Each parameter occupies its own row (for ART: **SYS**, **MAP**, **DIA**,
**PPV**), with **↓ Lower** and **↑ Upper** displayed in adjacent columns.
Within each limit cell, the touch controls are ordered **+ · value · − ·
OFF/ON** (the OFF/ON button is immediately right of minus). The original
large button styling, per-parameter increments, last-value restoration,
optional bounds and Apply/Cancel semantics are unchanged. The matrix scrolls
if necessary while Apply and Cancel remain accessible below it. Other
physiological controls remain Admin-only, except for the three explicitly
requested NIBP measurement controls.
## Instructor controls and scenarios
### Actions & Occurrences (v0.6.9)
The Admin window now has two tabs: **Direct Mode** (all original controls) and
**Actions & Occurrences** (time-based instructor scripts). Select an action and
@ -57,116 +248,23 @@ state. All actions are illustrative teaching scenarios, not pharmacokinetic
or validated clinical models. Audible/visual alarms, the selective 120-second
alarm pause, QRS sounds and monitor-side touchscreen menus are unchanged.
## Header controls: selective alarm pause and settings (v0.6.8)
### Instructor shortcuts on the Actions tab (v0.6.10)
Two touch/mouse controls are drawn at the far right of the monitor header:
The **Actions & Occurrences** tab keeps **Chest compressions** (Start/Stop button
and quality selector: Good, Adequate, Poor, Bad) permanently visible **above**
the scripted action selector. These are the same controls as on Direct Mode,
backed by the same state; changes in either tab are reflected in the other.
Chest compressions therefore no longer needs a redundant entry in the action
dropdown. Its clinical simulation behavior is unchanged.
- **Yellow bell (rightmost):** pauses only the *currently active* audible
alarm conditions for **120 seconds**. The caption `paused for x s` counts
down the remaining seconds. Pressing the bell again replaces the suppressed
set with the conditions active at that moment and restarts the 120-second
timer. A newly triggered alarm condition sounds normally, even if another
alarm of the same priority is paused. When a condition clears, it loses its
paused status so a later recurrence can sound. Pauses never change visual
alarms or the separate beat-synchronous QRS sound. Pressing the bell when
no alarms are active does not start a countdown.
- **Gear (left of bell):** opens a black/light-grey monitor-side settings panel
with **QRS beep**, **Audible alarms**, **Alert presets** (`Custom`, `Adult`),
an editable **Patient name** field and the attribution
`PaMSim by Critical Care Club Austria, (c) 2026`. It does **not** create
an on-screen keyboard. **Apply** synchronizes settings with Admin;
**Cancel/Esc** discards changes. The Adult preset affects alarm limits only.
A wide **yellow Defibrillation** shortcut with a **red lightning-bolt icon** is
also always available above the scripted actions. One press produces the
**existing transient ECG defibrillation artifact only**. It does not change
rhythm, ART, EtCO₂ or other physiological parameters, and it does not add a
long-running scripted action. For rhythm conversion and hemodynamic targets,
continue to select **Defibrillation + rhythm change** from the dropdown.
Other channel touch menus are unchanged. NIBP retains its explicitly requested
manual measurement, automatic measurement and interval controls.
## Smooth HR transitions (v0.6.7)
Changing the HR slider now preserves the recent history of *mechanically
captured* beats. PR converges to the new rate using the existing rolling
three-interval average instead of temporarily disappearing. The SpO₂ value,
plethysmography and saturation-dependent QRS tone remain available during
ordinary HR adjustments. Actual loss of mechanical capture, disconnected
sensors, deliberate signal dropout and low-quality/absent signals still
produce their intended alarms immediately.
## Monitor layout (v0.5.7)
The monitor uses a fixed **3:1 column ratio** over the drawable area:
**75% waveform column / 25% numeric column**, regardless of window size.
The last row is reserved for four equal-width numerical measurement groups:
| Group 1 (25%) | Group 2 (25%) | Group 3 (25%) | Group 4 (25%) |
| --- | --- | --- | --- |
| CO / CI | SVRI · GEDI · ELWI | *(empty)* | NIBP |
The first two groups currently display only their headings, with no numerical
values or simulation logic. The third group is completely empty. The fourth
retains the existing red NIBP readings, cuff gauge, progress bar and alarms.
The NIBP visibility toggle hides **only the fourth group's content**; the
bottom measurement row and other three groups remain present. Disabling one
of the four waveform channels still reflows the remaining rows above it.
## Monitor touchscreen: alarm limits and NIBP controls (v0.6.4)
Tap or click the **waveform or numerical readout** of ECG, SpO₂, ART or CO₂
to open that channel's alarm-limit panel. For NIBP, tap the **rightmost
quarter of the bottom measurement row**. The other three bottom-row groups
are reserved for future measurements and remain non-interactive. The panels
are available in fullscreen and retain a **black background, very light-grey
text, and 0.8-pixel borders and dividers**, in the style of the main monitor.
**Alarm thresholds can be modified from every monitor-side menu.**
No keyboard is required: every lower/upper limit has large **− / +** controls
with a parameter-specific increment and an independent **ON/OFF** control.
Unset limits remain disabled. The lower limit cannot exceed the upper limit.
| Touch area | Available alarm limits | Increment |
| --- | --- | --- |
| ECG | HR | 5 bpm |
| SpO₂ | SpO₂; pulse rate (PR) | 1% SpO₂; 5 bpm PR |
| ART | SYS; MAP; DIA; PPV | 5 mmHg pressure; 1% PPV |
| CO₂ | EtCO₂; respiratory rate (RR) | 1 mmHg EtCO₂; 1 breath/min RR |
| NIBP | SYS; MAP; DIA | 5 mmHg |
**Apply** commits the threshold changes and synchronizes the Admin window.
Changing a threshold sets the alarm preset to **Custom**. **Cancel** or
**Esc** discards the draft changes.
**NIBP is the exception:** its monitor-side menu additionally provides **Measure now**,
**Automatic measurement ON/OFF**, and the **1/3/5/10/20/30/60-minute interval**.
Interval and Auto changes take effect with **Apply** (or are discarded with
Cancel/Esc); **Measure now starts immediately**, even with Auto OFF and before
Apply. The touch controls synchronize with Admin. A measurement already in
progress is not restarted. The simulated failure option and cuff placement
remain Admin-only, as do ECG lead, SpO₂ sensor/quality and waveform choices.
### NIBP startup and automatic measurements
**Auto measurement is OFF by default.** On startup the monitor shows
`---/---` (MAP `---`) and no measurement is initiated. To obtain a reading,
select **Measure now** in the NIBP monitor menu (or in Admin), or enable
**Automatic NIBP measurement** via the menu (or Admin). The first automatic cycle begins immediately after enabling Auto;
subsequent measurement intervals count from completion of the prior cycle.
Disabling Auto stops further scheduled measurements without interrupting a
cycle already in progress. Manual measurement remains possible while Auto
is off. The interval bar is empty and the monitor displays `AUTO OFF`
whenever automatic measurements are disabled.
### Horizontal touchscreen alarm matrix (v0.6.3)
All five monitor touch menus now share a compact horizontal alarm-limit matrix.
Each parameter occupies its own row (for ART: **SYS**, **MAP**, **DIA**,
**PPV**), with **↓ Lower** and **↑ Upper** displayed in adjacent columns.
Within each limit cell, the touch controls are ordered **+ · value · − ·
OFF/ON** (the OFF/ON button is immediately right of minus). The original
large button styling, per-parameter increments, last-value restoration,
optional bounds and Apply/Cancel semantics are unchanged. The matrix scrolls
if necessary while Apply and Cancel remain accessible below it. Other
physiological controls remain Admin-only, except for the three explicitly
requested NIBP measurement controls.
## Chest compressions (v0.5.4)
### Chest compressions (v0.5.4)
The **Chest compressions** Admin group provides a large **Start Chest Compressions**
button (green background). While active it changes to **Stop Chest Compressions**
@ -207,192 +305,38 @@ These pressure targets are **didactic assumptions**, not validated CPR
hemodynamic criteria. The exercise must not be used to judge real compression
quality or clinical perfusion.
## Build and run on Fedora
## Measurements and signal behavior
```bash
sudo dnf install rust cargo gcc pkgconf-pkg-config gtk4-devel pipewire-utils
cargo test
cargo run --release
```
### ECG and mechanical coupling
Run these commands from the extracted `patient-monitor-simulation` folder.
Window titles show the application version. GTK4 requires a functional graphical
session (e.g., Fedora KDE/Wayland).
- ECG rhythms: sinus, atrial fibrillation, monomorphic ventricular tachycardia
(potentially perfusing), pulseless ventricular tachycardia (PVT),
ventricular fibrillation and asystole.
- Mechanical capture: **1:1**, **2:1**, **3:1**, **None (PEA)**, or deterministic
pseudo-random capture (~65%). PR is derived from conducted QRS events, never
controlled by a pulse-rate slider.
- A captured QRS leads to an ART upstroke after a schematic **120 ms**, and a
peripheral pleth pulse after **300 ms**. Pleth is strongly damped/filtered.
- VT and PVT selections start with a heart rate of **160 bpm**, and update
both the HR slider and numeric entry. The instructor may modify this afterward.
- PVT, VF, asystole and PEA suppress mechanical pulses; the ART trace then
drifts smoothly at 0–5 mmHg rather than representing a pulsatile pressure.
The ART **SYS** number shows the rounded low transducer pressure (0–5 mmHg),
while DIA and MAP show `--` because they cannot be reliably estimated.
Previous pressure samples scroll out of view. NIBP follows a separate,
time-based simulated cuff-measurement cycle.
## Windows
### Smooth HR transitions (v0.6.7)
**Admin sections** have a narrow colored stripe on their left edge to match the
monitor: ECG **green**, SpO₂ **yellow**, invasive arterial pressure **red**,
capnography **light grey**, NIBP **red**. The Patient section remains
neutral. These accents are drawn by GTK and remain visible independently of
light/dark themes. This is a visual-only change; control behavior is unchanged.
Changing the HR slider now preserves the recent history of *mechanically
captured* beats. PR converges to the new rate using the existing rolling
three-interval average instead of temporarily disappearing. The SpO₂ value,
plethysmography and saturation-dependent QRS tone remain available during
ordinary HR adjustments. Actual loss of mechanical capture, disconnected
sensors, deliberate signal dropout and low-quality/absent signals still
produce their intended alarms immediately.
**Admin:** Controls patient name; ECG rhythm and rate; mechanical capture;
SpO₂, signal quality and sensor connection; invasive arterial pressure,
waveform shape and pulse-pressure variation; NIBP; and capnography. Numeric inputs have bidirectionally linked sliders and text fields.
Each of the five monitor parameters (ECG, SpO₂/pleth, ART, CO₂, NIBP) has its
own **Show on monitor** checkbox.
**Monitor:** Black background; ECG green, pleth yellow, ART red and capnogram
light grey. The patient name entered in Admin replaces **PATIENT MONITOR** in
the header immediately; leaving the name blank restores the generic title.
Long names are automatically resized or clipped to fit the header.
Waveforms and vital signs disappear together when their respective
visibility checkbox is cleared. Remaining waveform rows expand to use the space.
Hiding a display channel does **not** stop signal generation or physiological
coupling: for example, hiding ECG does not stop ART or pleth pulses.
The final row is split into four equal-width measurement groups, with **NIBP in
the fourth group**, aligned beneath the regular numeric column. The first
three groups are reserved for future measurements. Hiding NIBP only clears
its own fourth group, without removing the final row.
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 and QRS tone (updated v0.6.7)
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 higher-pitched
**two-tone** alert (880 Hz followed by 1160 Hz), repeated approximately
every 1.5 seconds.
- **Numerical and SpO₂ technical alarms:** out-of-range values, **NO SENSOR**
and **NO READING** produce a lower-pitched **two-tone** alert
(700 Hz followed by 950 Hz), repeated approximately every 2.5 seconds.
- Both alarm signals use two **different successive pitches**, separated by
a brief silence. The single QRS/pulse beep is independent and configurable
using the new **QRS tone** checkbox in Admin (ON by default).
- 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.
### Beat-synchronous QRS/pulse tone
The **QRS tone** checkbox is independent of **Audible alarms**; turning off
one does not mute the other. Each brief (85 ms), **single-frequency** beep
follows an actual simulated beat event, not a separate rate timer:
- **SpO₂ reading available:** beep on the delayed peripheral pleth pulse;
the pitch follows the *displayed* saturation (including during effective
good-quality chest compressions). Missed mechanical captures produce no
peripheral beep.
- **SpO₂ reading unavailable:** a fixed **500 Hz** beep follows an organized
ECG QRS if ECG is displayed; otherwise it follows an arterial pulse if
ART is displayed. ECG and ART together do not cause duplicate beeps.
- **VF/asystole without effective CPR:** no beat beep is generated. ART pulses
created by CPR can generate the fallback tone, while good CPR with a valid
SpO₂ reading uses the saturation-dependent tone.
| SpO₂ (%) | Tone (Hz) |
| --- | ---: |
| 97–100 | 740 |
| 94–96 | 675 |
| 90–93 | 609 |
| 80–89 | 544 |
| 70–79 | 479 |
| 60–69 | 413 |
| 50–59 | 348 |
| 40–49 | 283 |
| 30–39 | 218 |
| 20–29 | 152 |
| 0–19 | 87 |
Saturation tone pitches are deliberately simplified teaching tones, not
calibrated clinical pulse-oximeter sounds. The QRS beep and two-tone alarm can
sound independently; no alarm priority or visual alarm logic was changed.
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
upper (↑) alarm threshold** in the corresponding Admin section. The lower
and upper entries are placed **in the same row as the corresponding slider**.
Derived values with no separate slider (PR, ART MAP, NIBP MAP) have their own
compact alarm rows. The Admin window opens wider to accommodate these controls.
Alarm fields are text inputs; leave a field **blank** (displayed as `off`) to disable just
that threshold. With both fields blank, the whole numeric alarm is disabled.
The value may equal either limit without triggering an alarm; only readings
strictly below/above the respective threshold are out of range. If both limits
are present, the lower limit must not exceed the upper limit. Invalid input is
highlighted and the last valid configuration stays active.
| Monitor section | Independently configurable alarms |
| --- | --- |
| ECG | HR |
| SpO₂ | Oxygen saturation (SpO₂), derived pulse rate (PR) |
| Invasive arterial pressure (ART) | Systolic (SYS), mean (MAP), diastolic (DIA), PPV |
| NIBP | Systolic (SYS), mean (MAP), diastolic (DIA) |
| Capnography | End-tidal CO₂ (EtCO₂), respiratory rate (RR) |
The current limits are displayed in small type at the **upper-right corner** of
each channel, with an arrow for the corresponding direction. A disabled
boundary is displayed as `---`. For instance:
```text
⚠ SYS ↓80 ↑180
MAP ↓60 ↑---
DIA ↓--- ↑---
```
### Alert presets
The **Alert presets** dropdown at the top of Admin offers **Custom** (manual)
and **Adult**. Choosing **Adult** immediately sets all alarm limits and updates
the lower/upper text fields alongside the sliders. It changes *only* alarm limits:
it does not change heart rate, blood pressure, channel visibility or any other
simulated physiological setting. Editing any alarm field after applying Adult
switches the selector to **Custom** without changing other alarm limits. Select
**Adult** again to reapply the complete preset.
| Parameter | Lower | Upper |
| --- | ---: | ---: |
| HR (bpm) | 60 | 100 |
| SpO₂ (%) | 90 | --- |
| PR (bpm) | --- | --- |
| ART SYS (mmHg) | 80 | 180 |
| ART MAP (mmHg) | 60 | 100 |
| ART DIA (mmHg) | --- | --- |
| PPV (%) | --- | 10 |
| NIBP SYS (mmHg) | 80 | 180 |
| NIBP MAP (mmHg) | 60 | 100 |
| NIBP DIA (mmHg) | --- | --- |
| EtCO₂ (mmHg) | 30 | 50 |
| RR (/min) | 10 | 20 |
`---` denotes a disabled threshold. Adult is a **teaching convenience preset**,
not a clinically validated set of alarm limits. Initially the selector is
**Custom**, with all limits disabled (as in v0.4.0).
When a number violates a configured limit, **that number flashes by inverting
its foreground and background colors** (500 ms inverted / 500 ms normal).
Each pressure component (SYS, DIA, MAP) and the PPV reading flash independently. The waveform
itself remains unchanged. All alarms are **disabled by default** so old
scenarios do not unexpectedly flash.
Numerical threshold alarms only evaluate actual displayed measurements:
`--`, `NO SENSOR`, and other unavailable readings do not trigger low-value
alarms. ECG-derived PR and signal visibility continue to work as in v0.3.2.
Alarms are presentation-only: there is **no audible alarm, alarm latching,
priority classification or clinical alarm validation**. Instructor settings
are held in memory and reset on restart.
## Patient name and pulse oximeter signal state (new in v0.3.2)
### Patient name and pulse oximeter signal state (new in v0.3.2)
The new **Patient name** text field at the top of Admin immediately replaces the
monitor headline. It is optional; an empty or whitespace-only name displays
@ -433,7 +377,45 @@ ART continue unaffected. The **Show on monitor** checkbox still hides the
entire SpO₂ row; sensor/quality controls leave the row visible so the status
can be taught.
## NIBP measurement cycle (v0.5.0)
### Invasive arterial pressure and PPV (new in v0.3)
The arterial waveform has a fixed **0–200 mmHg** display axis, with tick marks
at **0, 50, 100, 150 and 200 mmHg**. Nominal ART systolic and diastolic inputs
are limited to 0–200 mmHg.
**Pulse pressure variation (PPV)** is adjustable from **0% to 60%**, in 1%
increments, via synchronized slider and text field (Admin → Invasive arterial
blood pressure). Its default is **0%** (no respiratory modulation). The
respiratory cycle comes from the same respiratory-rate parameter as the
capnogram. **RR = 0** disables the respiratory modulation (apnea).
The synthetic PPV definition is:
```text
PPV (%) = 100 × (PPmax − PPmin) / ((PPmax + PPmin) / 2)
```
The model applies a sinusoidal variation to **pulse pressure**, sampled for
each mechanically conducted beat. The diastolic baseline remains nominally
fixed, so this is primarily a **beat-to-beat systolic swing**, not an arbitrary
vertical translation of the entire arterial trace. It does not affect ECG,
mechanical capture or pleth amplitude. This is a visual teaching model, not a
validated predictor of fluid responsiveness.
**Example:** ART 120/75 mmHg has nominal pulse pressure 45 mmHg. At PPV 20%,
the ideal pulse-pressure extrema are 40.5 and 49.5 mmHg, corresponding to
systolic peaks of approximately 115.5 and 124.5 mmHg (assuming the diastolic
baseline stays at 75 mmHg). The rendered waveform shape and finite number of
beats per respiratory cycle mean the visible maxima may not reach the ideal
extrema exactly.
The ART sidebar displays the **nominal** systolic/diastolic pressures and MAP,
plus the **configured** PPV percentage when PPV is greater than 0. It does not
measure PPV from sampled arterial data. At very high nominal systolic pressure,
the highest modulated pulses can exceed the 200 mmHg scale; the displayed
curve is then **clipped** at the top, without rescaling the axis.
### NIBP measurement cycle (v0.5.0)
NIBP is **red**, with a dedicated value box in the **right-hand numeric column**.
The bottom measurement row has three placeholder groups to its left, keeping
@ -499,81 +481,153 @@ are introduced. Both cuff-interference options are off by default.
These cuff and SpO₂ interactions are **deliberately simplified training
artifacts**; they should not be interpreted as validated cuff oscillometry.
## ECG and mechanical coupling
## Alarm limits and sounds
- ECG rhythms: sinus, atrial fibrillation, monomorphic ventricular tachycardia
(potentially perfusing), pulseless ventricular tachycardia (PVT),
ventricular fibrillation and asystole.
- Mechanical capture: **1:1**, **2:1**, **3:1**, **None (PEA)**, or deterministic
pseudo-random capture (~65%). PR is derived from conducted QRS events, never
controlled by a pulse-rate slider.
- A captured QRS leads to an ART upstroke after a schematic **120 ms**, and a
peripheral pleth pulse after **300 ms**. Pleth is strongly damped/filtered.
- VT and PVT selections start with a heart rate of **160 bpm**, and update
both the HR slider and numeric entry. The instructor may modify this afterward.
- PVT, VF, asystole and PEA suppress mechanical pulses; the ART trace then
drifts smoothly at 0–5 mmHg rather than representing a pulsatile pressure.
The ART **SYS** number shows the rounded low transducer pressure (0–5 mmHg),
while DIA and MAP show `--` because they cannot be reliably estimated.
Previous pressure samples scroll out of view. NIBP follows a separate,
time-based simulated cuff-measurement cycle.
### Numerical alarm limits (v0.4.0; layout and presets updated in v0.4.1)
## Invasive arterial pressure and PPV (new in v0.3)
Each displayed numeric measurement has an **independent optional lower (↓) and
upper (↑) alarm threshold** in the corresponding Admin section. The lower
and upper entries are placed **in the same row as the corresponding slider**.
Derived values with no separate slider (PR, ART MAP, NIBP MAP) have their own
compact alarm rows. The Admin window opens wider to accommodate these controls.
Alarm fields are text inputs; leave a field **blank** (displayed as `off`) to disable just
that threshold. With both fields blank, the whole numeric alarm is disabled.
The value may equal either limit without triggering an alarm; only readings
strictly below/above the respective threshold are out of range. If both limits
are present, the lower limit must not exceed the upper limit. Invalid input is
highlighted and the last valid configuration stays active.
The arterial waveform has a fixed **0–200 mmHg** display axis, with tick marks
at **0, 50, 100, 150 and 200 mmHg**. Nominal ART systolic and diastolic inputs
are limited to 0–200 mmHg.
| Monitor section | Independently configurable alarms |
| --- | --- |
| ECG | HR |
| SpO₂ | Oxygen saturation (SpO₂), derived pulse rate (PR) |
| Invasive arterial pressure (ART) | Systolic (SYS), mean (MAP), diastolic (DIA), PPV |
| NIBP | Systolic (SYS), mean (MAP), diastolic (DIA) |
| Capnography | End-tidal CO₂ (EtCO₂), respiratory rate (RR) |
**Pulse pressure variation (PPV)** is adjustable from **0% to 60%**, in 1%
increments, via synchronized slider and text field (Admin → Invasive arterial
blood pressure). Its default is **0%** (no respiratory modulation). The
respiratory cycle comes from the same respiratory-rate parameter as the
capnogram. **RR = 0** disables the respiratory modulation (apnea).
The synthetic PPV definition is:
The current limits are displayed in small type at the **upper-right corner** of
each channel, with an arrow for the corresponding direction. A disabled
boundary is displayed as `---`. For instance:
```text
PPV (%) = 100 × (PPmax − PPmin) / ((PPmax + PPmin) / 2)
⚠ SYS ↓80 ↑180
MAP ↓60 ↑---
DIA ↓--- ↑---
```
The model applies a sinusoidal variation to **pulse pressure**, sampled for
each mechanically conducted beat. The diastolic baseline remains nominally
fixed, so this is primarily a **beat-to-beat systolic swing**, not an arbitrary
vertical translation of the entire arterial trace. It does not affect ECG,
mechanical capture or pleth amplitude. This is a visual teaching model, not a
validated predictor of fluid responsiveness.
#### Alert presets
**Example:** ART 120/75 mmHg has nominal pulse pressure 45 mmHg. At PPV 20%,
the ideal pulse-pressure extrema are 40.5 and 49.5 mmHg, corresponding to
systolic peaks of approximately 115.5 and 124.5 mmHg (assuming the diastolic
baseline stays at 75 mmHg). The rendered waveform shape and finite number of
beats per respiratory cycle mean the visible maxima may not reach the ideal
extrema exactly.
The **Alert presets** dropdown at the top of Admin offers **Custom** (manual)
and **Adult**. Choosing **Adult** immediately sets all alarm limits and updates
the lower/upper text fields alongside the sliders. It changes *only* alarm limits:
it does not change heart rate, blood pressure, channel visibility or any other
simulated physiological setting. Editing any alarm field after applying Adult
switches the selector to **Custom** without changing other alarm limits. Select
**Adult** again to reapply the complete preset.
The ART sidebar displays the **nominal** systolic/diastolic pressures and MAP,
plus the **configured** PPV percentage when PPV is greater than 0. It does not
measure PPV from sampled arterial data. At very high nominal systolic pressure,
the highest modulated pulses can exceed the 200 mmHg scale; the displayed
curve is then **clipped** at the top, without rescaling the axis.
| Parameter | Lower | Upper |
| --- | ---: | ---: |
| HR (bpm) | 60 | 100 |
| SpO₂ (%) | 90 | --- |
| PR (bpm) | --- | --- |
| ART SYS (mmHg) | 80 | 180 |
| ART MAP (mmHg) | 60 | 100 |
| ART DIA (mmHg) | --- | --- |
| PPV (%) | --- | 10 |
| NIBP SYS (mmHg) | 80 | 180 |
| NIBP MAP (mmHg) | 60 | 100 |
| NIBP DIA (mmHg) | --- | --- |
| EtCO₂ (mmHg) | 30 | 50 |
| RR (/min) | 10 | 20 |
## Display options (new in v0.3)
`---` denotes a disabled threshold. Adult is a **teaching convenience preset**,
not a clinically validated set of alarm limits. Initially the selector is
**Custom**, with all limits disabled (as in v0.4.0).
The five **Show on monitor** checkboxes affect the presentation only:
When a number violates a configured limit, **that number flashes by inverting
its foreground and background colors** (500 ms inverted / 500 ms normal).
Each pressure component (SYS, DIA, MAP) and the PPV reading flash independently. The waveform
itself remains unchanged. All alarms are **disabled by default** so old
scenarios do not unexpectedly flash.
| Checkbox | Hidden monitor content |
| --- | --- |
| ECG | ECG waveform, HR and rhythm alarm (when present) |
| Pulse oximetry | Pleth waveform, SpO₂ and PR |
| Invasive arterial blood pressure | ART waveform, pressure values, MAP and PPV label |
| Capnography | CO₂ waveform, EtCO₂ and RR |
| NIBP | Timed cuff-measurement values and red right-column value box |
Numerical threshold alarms only evaluate actual displayed measurements:
`--`, `NO SENSOR`, and other unavailable readings do not trigger low-value
alarms. ECG-derived PR and signal visibility continue to work as in v0.3.2.
Alarms are presentation-only: there is **no audible alarm, alarm latching,
priority classification or clinical alarm validation**. Instructor settings
are held in memory and reset on restart.
Remaining visible waveform rows and the bottom measurements row share an equal
portion of the available height and remain aligned across both columns; zero
waveform channels is supported. Hiding NIBP leaves the three future measurement
placeholders visible.
### Audible alarms and QRS tone (updated v0.6.7)
## ECG morphology correction (v0.3.1)
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 higher-pitched
**two-tone** alert (880 Hz followed by 1160 Hz), repeated approximately
every 1.5 seconds.
- **Numerical and SpO₂ technical alarms:** out-of-range values, **NO SENSOR**
and **NO READING** produce a lower-pitched **two-tone** alert
(700 Hz followed by 950 Hz), repeated approximately every 2.5 seconds.
- Both alarm signals use two **different successive pitches**, separated by
a brief silence. The single QRS/pulse beep is independent and configurable
using the new **QRS tone** checkbox in Admin (ON by default).
- 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.
#### Beat-synchronous QRS/pulse tone
The **QRS tone** checkbox is independent of **Audible alarms**; turning off
one does not mute the other. Each brief (85 ms), **single-frequency** beep
follows an actual simulated beat event, not a separate rate timer:
- **SpO₂ reading available:** beep on the delayed peripheral pleth pulse;
the pitch follows the *displayed* saturation (including during effective
good-quality chest compressions). Missed mechanical captures produce no
peripheral beep.
- **SpO₂ reading unavailable:** a fixed **500 Hz** beep follows an organized
ECG QRS if ECG is displayed; otherwise it follows an arterial pulse if
ART is displayed. ECG and ART together do not cause duplicate beeps.
- **VF/asystole without effective CPR:** no beat beep is generated. ART pulses
created by CPR can generate the fallback tone, while good CPR with a valid
SpO₂ reading uses the saturation-dependent tone.
| SpO₂ (%) | Tone (Hz) |
| --- | ---: |
| 97–100 | 740 |
| 94–96 | 675 |
| 90–93 | 609 |
| 80–89 | 544 |
| 70–79 | 479 |
| 60–69 | 413 |
| 50–59 | 348 |
| 40–49 | 283 |
| 30–39 | 218 |
| 20–29 | 152 |
| 0–19 | 87 |
Saturation tone pitches are deliberately simplified teaching tones, not
calibrated clinical pulse-oximeter sounds. The QRS beep and two-tone alarm can
sound independently; no alarm priority or visual alarm logic was changed.
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.
## Technical reference
### ECG morphology correction (v0.3.1)
At high heart rates, the previous ECG generator expressed QRS width as a fixed
fraction of the R–R interval and sampled at 100 Hz. Narrow R waves could fall
@ -595,7 +649,7 @@ The ECG remains a schematic educational signal; no voltage calibration,
lead placement model, diagnostic criteria, or patient-specific physiology
are simulated.
## Signal implementation
### Signal implementation
- 250 Hz synthetic signal samples, 10 s retained history, 8 s scrolling trace.
- Cairo draws into the GTK4 `DrawingArea` and scales with the window.
@ -606,7 +660,7 @@ are simulated.
- Clinical accuracy, calibration, artifact realism and patient-specific physiology
are outside this prototype; its NIBP cycle and alarms are synthetic.
## Project layout
### Project layout
```text
src/
@ -618,7 +672,9 @@ src/
ui.rs Admin controls and monitor window
```
## Changes since v0.2.2
## Changelog
### Changes since v0.2.2
1. Respiratory PPV with a 0–60% instructor setting, coupled to the simulated
respiratory cycle and applied **per arterial beat**.
@ -634,7 +690,7 @@ src/
locally to verify the Rust/GTK build; Rust and GTK4 development components
were not available in the environment where this ZIP was prepared.
## Changes in v0.3.2
### Changes in v0.3.2
1. Added live patient-name header in Admin/Monitor with blank-name fallback.
2. Added four levels of SpO₂ signal quality, quality stars and an irregular,
@ -648,8 +704,7 @@ were not available in the environment where this ZIP was prepared.
The GTK4 application and Rust tests were not compiled in the packaging
environment; run `cargo test` and `cargo run --release` on Fedora.
## v0.4.2 — Rhythm, sensor and missing-reading alarms
### v0.4.2 — Rhythm, sensor and missing-reading alarms
- **VT** remains potentially perfusing. The new **PVT** (pulseless ventricular tachycardia) rhythm retains organized broad QRS complexes but produces no arterial/pleth pulses. VF and asystole are also pulseless regardless of capture selection.
- **ECG**: a flashing **ARRHYTHMIA** message for VT, PVT and VF; a flashing **ASYSTOLE** message for asystole. These event alarms do not depend on numerical HR limits.
@ -658,8 +713,7 @@ environment; run `cargo test` and `cargo run --release` on Fedora.
- **ECG rhythm name** has been removed from the monitor; only HR and the associated alarm message, when present, are visible. The instructor continues to select the rhythm in Admin.
- Numerical alarm thresholds and the Adult preset from v0.4.1 are unchanged. Synthetic demonstration behavior only; not suitable for clinical decisions.
## v0.4.3 — Low arterial pressure, VT rate preset and intermittent Poor SpO₂
### v0.4.3 — Low arterial pressure, VT rate preset and intermittent Poor SpO₂
- Pulseless rhythms, PEA or otherwise absent mechanical capture: invasive SYS
reports the **current measured 0–5 mmHg** pressure, e.g. `3/--` with
@ -678,14 +732,14 @@ environment; run `cargo test` and `cargo run --release` on Fedora.
- No changes to Adult alarm presets, alarm limit ordering, or the 0–200 mmHg
arterial scale. All behavior is synthetic and intended for teaching only.
## v0.5.1 — Aligned monitor columns
### v0.5.1 — Aligned monitor columns
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
### v0.5.3 — Audible alarm output
- Alarm-tone playback through Fedora PipeWire (`pw-play`) or PulseAudio
compatibility (`paplay`), without any new Rust library dependencies.
@ -694,12 +748,10 @@ No NIBP measurement logic or alarm behavior was changed.
- Audio keeps running independently of the monitor's drawing callback.
- Visual alarms and existing physiological simulation remain unchanged.
### v0.5.5 — CPR plethysmography correction
The delayed CPR pleth waveform no longer wraps its trailing portion into the next compression. The regression test now reports the maximum valid waveform amplitude when failing. No other simulation controls were changed.
### v0.5.6 — CPR pleth filter persistence
Corrects the underlying cause of the v0.5.5 test failure: in pulseless rhythms, the simulation had reset the pleth low-pass filter at every 250 Hz sample, preventing CPR-induced signals from accumulating. The filter now persists during good-quality chest compressions while QRS-triggered mechanical pulses are still cleared. Stopping CPR in VF/PVT immediately restores no reading. Additional regression coverage includes PVT.
@ -758,7 +810,6 @@ of Auto. Both monitor and Admin display the selected settings. Other monitor
menus remain limited to alarm thresholds; NIBP cuff placement, the simulated
failed-reading option and non-NIBP signal settings remain Admin-only.
### v0.6.5 — Two-tone audible alarms
Both standard/technical and critical alarm sounds now consist of two distinct
@ -767,7 +818,6 @@ interval; standard alarms retain their slower cadence. The Admin test button
plays the standard two-tone alert. A single QRS beep is reserved for a later
release and is not generated yet. No visual alarm or simulation logic changed.
### v0.6.6 — Optional QRS/pulse beep
Added a separate **QRS tone** checkbox (enabled by default). An 85 ms
@ -778,7 +828,6 @@ ECG QRS or ART pulses trigger a fixed 500 Hz tone. The two-tone alarm sounds
remain unchanged. Added regression tests for band boundaries, event selection
and single-tone WAV output.
### v0.6.8 — Monitor header controls and selective audible-alarm pause
Added a yellow bell button with a 120-second pause countdown and a grey settings
@ -805,3 +854,4 @@ synchronized with Direct Mode. CPR was removed from the dropdown because the
same controls are now permanently available. A high-contrast yellow one-tap
Defibrillation button with a red lightning symbol triggers only the transient
ECG shock artifact; rhythm conversion remains available as a separate action.