summaryrefslogtreecommitdiffstats
path: root/dive.h
diff options
context:
space:
mode:
authorGravatar Dirk Hohndel <dirk@hohndel.org>2013-02-09 07:12:30 -0800
committerGravatar Dirk Hohndel <dirk@hohndel.org>2013-02-09 07:19:29 -0800
commitb9865d6bbc30ff4f82ffa17d4a2e3e74bc1054ed (patch)
tree0bb5aac0bd1f854ed3ee896b57d4ed73524ffad3 /dive.h
parentc7efcb23a9a838f88c6691cb7b278126ae639c4b (diff)
downloadsubsurface-b9865d6bbc30ff4f82ffa17d4a2e3e74bc1054ed.tar.gz
Move duration to dive structure and replace accessor function
When starting on this quest to stop using the first divecomputer instead of data for the whole dive in commit eb73b5a528c8 ("Duration of a dive is the maximum duration from all divecomputers") I introduced an accessor function that calculates the dive duration on the fly as the maximum of the durations in the divecomputers. Since then Linus and I have added quite a few of the variables back to the dive data structure and it makes perfect sense to do the same thing for the duration as well and simply do the calculation once during fixup. This commit also replaces accesses to the first divecomputer in likely_same_dive to use the maxdepth and meandepth of the dive (those two slipped through the cracks in the previous commits, it seems). Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
Diffstat (limited to 'dive.h')
-rw-r--r--dive.h2
1 files changed, 1 insertions, 1 deletions
diff --git a/dive.h b/dive.h
index 830fcce7d..ace1c9fc2 100644
--- a/dive.h
+++ b/dive.h
@@ -323,6 +323,7 @@ struct dive {
temperature_t mintemp, maxtemp;
depth_t maxdepth, meandepth;
pressure_t surface_pressure;
+ duration_t duration;
int salinity; // kg per 10000 l
struct divecomputer dc;
@@ -557,7 +558,6 @@ extern void report_dives(gboolean imported, gboolean prefer_imported);
extern struct dive *fixup_dive(struct dive *dive);
extern struct dive *merge_dives(struct dive *a, struct dive *b, int offset, gboolean prefer_downloaded);
extern struct dive *try_to_merge(struct dive *a, struct dive *b, gboolean prefer_downloaded);
-extern int get_duration_in_sec(struct dive *dive);
extern void renumber_dives(int nr);
extern void add_gas_switch_event(struct dive *dive, struct divecomputer *dc, int time, int idx);