[PATCH] Don't interpolate gas consumption when at surface
Anton Lundin
glance at acc.umu.se
Wed Nov 20 14:21:05 UTC 2013
Don't calculate pressure-track for depth above SURFACE_THRESHOLD,
because then we would guess that were actually at surface breathing.
Signed-off-by: Anton Lundin <glance at acc.umu.se>
---
profile.c | 3 +++
1 file changed, 3 insertions(+)
diff --git a/profile.c b/profile.c
index 0f90370..453da99 100644
--- a/profile.c
+++ b/profile.c
@@ -496,6 +496,9 @@ static inline int pressure_time(struct dive *dive, struct divecomputer *dc, stru
int time = b->sec - a->sec;
int depth = (a->depth + b->depth)/2;
+ if (depth <= SURFACE_THRESHOLD)
+ return 0;
+
return depth_to_mbar(depth, dive) * time;
}
--
1.8.3.2
More information about the subsurface
mailing list