Overview
Build a proper O2 consumption data pipeline so the CCR Information section shows real data instead of "No CCR gas data available." This replaces the current placeholder with computed values from tank pressure data or manual user input.
Design
Data Sources (in priority order)
-
Transmitter on O2 cylinder: If the user tags one of their tank pressure transmitters as being on an O2 cylinder, we can calculate:
- O2 consumed = start pressure - end pressure (from
tankPressure1Bar or tankPressure2Bar samples)
- O2 rate = O2 consumed / bottom time (converted to appropriate units)
-
Manual input: If the user doesn't have a transmitter on O2, allow them to input O2 consumed during the dive (e.g., "I used 800 psi of O2"). We then calculate the rate for them.
Transmitter Configuration
Need a way for users to define which transmitter channel maps to which cylinder:
- Tank 1 = ? (e.g., "Bailout", "O2", "Diluent", unlabeled)
- Tank 2 = ? (e.g., "Bailout", "O2", "Diluent", unlabeled)
This could be:
- Per-device configuration (in device settings) — "My Petrel 3's T1 is always O2"
- Per-dive override (in dive edit) — in case the user swaps transmitter assignments
Gas Consumed Stat Card
Regardless of O2 calculation, show a "Gas Consumed" stat card for any dive with tank pressure data:
- Value:
max(tankPressure) - min(tankPressure) in psi or bar
- Label: transmitter label if configured, otherwise "Tank 1" / "Tank 2"
CCR Information Section
Transform the current placeholder into a real data display:
- O2 Rate: computed from tagged transmitter data or manual input
- O2 Consumed: from transmitter delta or manual input
- Hide the section entirely when no O2 data is available (no "No data" placeholder)
Schema Changes
Possible additions:
devices table: tank1_label TEXT, tank2_label TEXT (or a separate transmitter_config table)
dives table: o2_consumed_manual_psi REAL, o2_consumed_manual_bar REAL (for manual input)
- Or compute O2 rate/consumed on-the-fly from samples + transmitter config (no new dive columns needed)
Out of Scope
- Per-sensor PPO2 display (separate chart, already exists)
- Automatic cylinder identification from gas analysis (future ML feature)
Overview
Build a proper O2 consumption data pipeline so the CCR Information section shows real data instead of "No CCR gas data available." This replaces the current placeholder with computed values from tank pressure data or manual user input.
Design
Data Sources (in priority order)
Transmitter on O2 cylinder: If the user tags one of their tank pressure transmitters as being on an O2 cylinder, we can calculate:
tankPressure1BarortankPressure2Barsamples)Manual input: If the user doesn't have a transmitter on O2, allow them to input O2 consumed during the dive (e.g., "I used 800 psi of O2"). We then calculate the rate for them.
Transmitter Configuration
Need a way for users to define which transmitter channel maps to which cylinder:
This could be:
Gas Consumed Stat Card
Regardless of O2 calculation, show a "Gas Consumed" stat card for any dive with tank pressure data:
max(tankPressure) - min(tankPressure)in psi or barCCR Information Section
Transform the current placeholder into a real data display:
Schema Changes
Possible additions:
devicestable:tank1_label TEXT,tank2_label TEXT(or a separatetransmitter_configtable)divestable:o2_consumed_manual_psi REAL,o2_consumed_manual_bar REAL(for manual input)Out of Scope