summaryrefslogtreecommitdiffstats
path: root/dive.h
diff options
context:
space:
mode:
authorGravatar Dirk Hohndel <dirk@hohndel.org>2014-05-29 14:36:14 -0700
committerGravatar Dirk Hohndel <dirk@hohndel.org>2014-05-29 14:43:24 -0700
commitd054e8c457c2113b39a7d8fe21215c99a86d1d9d (patch)
treee59c1a2a1948078e8970d157a619eaf3381cffc5 /dive.h
parent56395b38946d4b7de9e485098e928e8e432ef920 (diff)
downloadsubsurface-d054e8c457c2113b39a7d8fe21215c99a86d1d9d.tar.gz
Planner: track gas consumption in cylinders and samples
This commit is a little bigger than I usually prefer, but it's all somewhat interconnected. - we pass around the cylinders throughout the planning process and as we create the plan we calculate the gas consumption in every segment and track this both in the end pressure of the cylinder and over time in the samples - because of that we no longer try to calculate the gas consumption after being done planning; we just use what we calculated along the way - we also no longer add gases during the planning process - all gases have to come from the list of cylinders passed in (which makes sense as we should only use those gases that the user added in the UI or inherited from a the selected dive (when starting to plan with a dive already selected) With this patch I think we are close do being able to move all of the planning logic back into the planner.c code where it belongs. The one issue that still bothers me is that we are juggling so many dive structures and then keep copying content around. It seems like we should be able to reduce that. Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
Diffstat (limited to 'dive.h')
-rw-r--r--dive.h3
1 files changed, 2 insertions, 1 deletions
diff --git a/dive.h b/dive.h
index 03acea496..277573f5b 100644
--- a/dive.h
+++ b/dive.h
@@ -655,7 +655,7 @@ struct divedatapoint *create_dp(int time_incr, int depth, int o2, int he, int po
#if DEBUG_PLAN
void dump_plan(struct diveplan *diveplan);
#endif
-void plan(struct diveplan *diveplan, char **cached_datap, struct dive **divep, bool add_deco);
+void plan(struct diveplan *diveplan, char **cached_datap, struct dive **divep, struct dive *master_dive, bool add_deco);
void delete_single_dive(int idx);
struct event *get_next_event(struct event *event, char *name);
@@ -687,6 +687,7 @@ extern bool no_weightsystems(weightsystem_t *ws);
extern bool weightsystems_equal(weightsystem_t *ws1, weightsystem_t *ws2);
extern void remove_cylinder(struct dive *dive, int idx);
extern void remove_weightsystem(struct dive *dive, int idx);
+extern void reset_cylinders(struct dive *dive);
/*
* String handling.