summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGravatar Robert C. Helling <helling@atdotde.de>2015-01-28 15:01:07 +0100
committerGravatar Dirk Hohndel <dirk@hohndel.org>2015-01-29 07:35:15 -0800
commit485fde8979b77f5fa0c6d800c9993254de8a3358 (patch)
tree40dd02eaca8b1c4056f02feb7d681bc102e167ae
parentf291eb6a7920134604efbd7515d5d470a1d7eb91 (diff)
downloadsubsurface-485fde8979b77f5fa0c6d800c9993254de8a3358.tar.gz
Cylinders which have lesser pressure in the end are used
Make cylinders that have at least 5bar less pressure in the end than in the beginning considered "used". Signed-off-by: Robert C. Helling <helling@atdotde.de> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
-rw-r--r--statistics.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/statistics.c b/statistics.c
index bca9e6540..17176f714 100644
--- a/statistics.c
+++ b/statistics.c
@@ -292,6 +292,8 @@ void get_selected_dives_text(char *buffer, int size)
}
}
+#define SOME_GAS 5000 // 5bar drop in cylinder pressure makes cylinder used
+
bool is_cylinder_used(struct dive *dive, int idx)
{
struct divecomputer *dc;
@@ -299,6 +301,8 @@ bool is_cylinder_used(struct dive *dive, int idx)
if (cylinder_none(&dive->cylinder[idx]))
return false;
+ if ((dive->cylinder[idx].start.mbar - dive->cylinder[idx].end.mbar) > SOME_GAS)
+ return true;
for_each_dc(dive, dc) {
struct event *event = get_next_event(dc->events, "gaschange");
while (event) {