diff options
author | Stefan Fuchs <sfuchs@gmx.de> | 2017-11-29 10:16:00 +0100 |
---|---|---|
committer | Jan Mulder <jlmulder@xs4all.nl> | 2018-02-27 09:17:57 +0100 |
commit | 4cbf8b87a3586d15cff9770d1e3fc9f813498037 (patch) | |
tree | 1e524f5f07080f4d3d19034218e5c762d0104781 /core/statistics.c | |
parent | cd5e17cf79c2f1eb896efd0436c103221de446ae (diff) | |
download | subsurface-4cbf8b87a3586d15cff9770d1e3fc9f813498037.tar.gz |
Updated strategy for removing cylinders
Change the strategy when to allow cylinder removal from a dive:
- Not remove when cylinder has gas switch events, in any other cases
allow removal
- Remove this whole "cylinder with same gas" thing being a criteria
for cylinder removal
When removing a cylinder which has corresponding pressure info in
samples, also remove this pressure info from the samples.
Signed-off-by: Stefan Fuchs <sfuchs@gmx.de>
Diffstat (limited to 'core/statistics.c')
-rw-r--r-- | core/statistics.c | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/core/statistics.c b/core/statistics.c index 678843b99..eed24505c 100644 --- a/core/statistics.c +++ b/core/statistics.c @@ -345,6 +345,19 @@ bool is_cylinder_used(struct dive *dive, int idx) return false; } +bool is_cylinder_prot(struct dive *dive, int idx) +{ + struct divecomputer *dc; + if (cylinder_none(&dive->cylinder[idx])) + return false; + + for_each_dc(dive, dc) { + if (has_gaschange_event(dive, dc, idx)) + return true; + } + return false; +} + void get_gas_used(struct dive *dive, volume_t gases[MAX_CYLINDERS]) { int idx; |