diff options
author | Dirk Hohndel <dirk@hohndel.org> | 2012-11-11 10:36:46 +0100 |
---|---|---|
committer | Dirk Hohndel <dirk@hohndel.org> | 2012-11-11 10:36:46 +0100 |
commit | 7c09991876ef8b34bda6f5615a37f99e1b476b18 (patch) | |
tree | cea814dea546805424406cc2f9525f5b287c6bf2 /dive.h | |
parent | 4c3dfee446eda061f862e1fdcce93b54a066feff (diff) | |
download | subsurface-7c09991876ef8b34bda6f5615a37f99e1b476b18.tar.gz |
Trim the dive to exclude surface time at beginning and end
We don't change any of the samples, we just don't plot (or consider for
dive time / mean calculations) the samples at the beginning or end of the
dive that are less than a certain threshold under water. Right now that's
an arbitrary 75cm which seems to Do The Right Thing(tm) for the dives I
tried this with - but I'm happy to look at other values if this causes
problems for people with dive computers I do not have access to.
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
Diffstat (limited to 'dive.h')
-rw-r--r-- | dive.h | 3 |
1 files changed, 3 insertions, 0 deletions
@@ -261,6 +261,7 @@ struct dive { tripflag_t tripflag; dive_trip_t *divetrip; int selected; + int start, end; timestamp_t when; char *location; char *notes; @@ -296,6 +297,8 @@ static inline int depth_to_mbar(int depth, struct dive *dive) return depth / 10.0 * specific_weight + surface_pressure + 0.5; } +#define SURFACE_THRESHOLD 750 /* somewhat arbitrary: only below 75cm is it really diving */ + /* this is a global spot for a temporary dive structure that we use to * be able to edit a dive without unintended side effects */ extern struct dive edit_dive; |