Add support to planner to use additional gases during the ascent

This change ended up being quite a bit bigger than expected as it
uncovered a number of bugs in the existing code.

The planner now handles gas changes correctly by creating (and later
parsing) events in the simulated divecomputer. At the end of the dive
specified in the input form the algorithm starts with the deepest
interesting depth: either the first stop below our ceiling or the deepest
depth at which we can change gases. It then traverses all the stop and all
the gas change depth and at each stage ensures that we are allowed to
ascend further before going on.

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
This commit is contained in:
Dirk Hohndel 2013-01-09 16:01:15 -08:00
parent fbea5e31ca
commit c0ce218df4
2 changed files with 210 additions and 43 deletions

View file

@ -425,7 +425,7 @@ static void save_dc(FILE *f, struct dive *dive, struct divecomputer *dc)
fprintf(f, " </divecomputer>\n");
}
static void save_dive(FILE *f, struct dive *dive)
void save_dive(FILE *f, struct dive *dive)
{
struct divecomputer *dc;