Fix per_cylinder_mean_depth calculation for CCR

This patch is bigger than necessary because I also renamed the
get_cylinder_use() function to the much more accurate
get_cylinder_idx_by_use().

If we have no gas changes (except for a possible explicit first gas),
(which in the CCR case also means no bailout), this code will give you
correct per cylinder depth and duration for oxygen and diluent and
therefore create more reasonable gas consumption data for CCR dives.

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
This commit is contained in:
Dirk Hohndel 2014-11-17 00:09:59 +00:00
parent ee7dd4307a
commit 3e5cb7e2aa
2 changed files with 17 additions and 9 deletions

2
dive.h
View file

@ -341,7 +341,7 @@ struct dive {
int oxygen_cylinder_index, diluent_cylinder_index; // CCR dive cylinder indices
};
extern int get_cylinder_use(struct dive *dive, enum cylinderuse cylinder_use_type);
extern int get_cylinder_idx_by_use(struct dive *dive, enum cylinderuse cylinder_use_type);
/* when selectively copying dive information, which parts should be copied? */
struct dive_components {