mirror of
https://github.com/subsurface/subsurface.git
synced 2025-02-19 22:16:15 +00:00
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>
This commit is contained in:
parent
56395b3894
commit
d054e8c457
4 changed files with 85 additions and 69 deletions
3
dive.h
3
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.
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue