Problem
When dives are downloaded from a dive computer, every cylinder is written with the role Back Gas, regardless of the gas it holds. A 99% O₂ deco bottle, a CCR oxygen supply, or a diluent all import as "Back Gas", so the dive log misrepresents the gas plan and the user has to relabel every non-back-gas cylinder by hand.
Cause
The download write paths hardcode the cylinder role to backGas — there is no inference from the dive computer's own tank metadata or from the gas mix.
Proposed fix
Infer the cylinder role on download:
- Use libdivecomputer's native tank usage (
dc_usage_t) when the computer provides it: OXYGEN → oxygenSupply, DILUENT → diluent.
- Otherwise fall back to an open-circuit gas heuristic: a nitrox mix of O₂ ≥ 41% → deco, everything else → back gas.
- Never overwrite a role the user has already set (reparse should only infer for newly created cylinders).
Follow-up to #424 (multi-gas dive-computer download support).
Problem
When dives are downloaded from a dive computer, every cylinder is written with the role Back Gas, regardless of the gas it holds. A 99% O₂ deco bottle, a CCR oxygen supply, or a diluent all import as "Back Gas", so the dive log misrepresents the gas plan and the user has to relabel every non-back-gas cylinder by hand.
Cause
The download write paths hardcode the cylinder role to
backGas— there is no inference from the dive computer's own tank metadata or from the gas mix.Proposed fix
Infer the cylinder role on download:
dc_usage_t) when the computer provides it:OXYGEN → oxygenSupply,DILUENT → diluent.Follow-up to #424 (multi-gas dive-computer download support).