summaryrefslogtreecommitdiffstats
path: root/planner.c
diff options
context:
space:
mode:
authorGravatar Dirk Hohndel <dirk@hohndel.org>2014-03-31 22:18:00 -0700
committerGravatar Dirk Hohndel <dirk@hohndel.org>2014-03-31 22:18:00 -0700
commit0de21c24fa0bfdad5a828a39821c7761ecc2f946 (patch)
tree30d6a5bb9bc3bd8a1ddeae731ce72d749b002030 /planner.c
parent45767961e88c85eb3bf3f8cbff1c9c675eca4904 (diff)
parent18ec989ef51b5357d76db85d467626141d5e2429 (diff)
downloadsubsurface-0de21c24fa0bfdad5a828a39821c7761ecc2f946.tar.gz
Merge branch 'planner-mods'
Nothing exciting here, just a few independent changes close to each other. Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
Diffstat (limited to 'planner.c')
-rw-r--r--planner.c11
1 files changed, 6 insertions, 5 deletions
diff --git a/planner.c b/planner.c
index 825f39f1a..9df5c894c 100644
--- a/planner.c
+++ b/planner.c
@@ -380,9 +380,10 @@ void add_to_end_of_diveplan(struct diveplan *diveplan, struct divedatapoint *dp)
dp->time += lasttime;
}
-struct divedatapoint *plan_add_segment(struct diveplan *diveplan, int duration, int depth, int o2, int he, int po2)
+struct divedatapoint *plan_add_segment(struct diveplan *diveplan, int duration, int depth, int o2, int he, int po2, bool entered)
{
struct divedatapoint *dp = create_dp(duration, depth, o2, he, po2);
+ dp->entered = entered;
add_to_end_of_diveplan(diveplan, dp);
return (dp);
}
@@ -618,7 +619,7 @@ void plan(struct diveplan *diveplan, char **cached_datap, struct dive **divep, b
/* if all we wanted was the dive just get us back to the surface */
if (!add_deco) {
transitiontime = depth / 75; /* this still needs to be made configurable */
- plan_add_segment(diveplan, transitiontime, 0, o2, he, po2);
+ plan_add_segment(diveplan, transitiontime, 0, o2, he, po2, false);
/* re-create the dive */
delete_single_dive(dive_table.nr - 1);
*divep = dive = create_dive_from_plan(diveplan);
@@ -660,7 +661,7 @@ void plan(struct diveplan *diveplan, char **cached_datap, struct dive **divep, b
#if DEBUG_PLAN & 2
printf("transitiontime %d:%02d to depth %5.2lfm\n", FRACTION(transitiontime, 60), stoplevels[stopidx] / 1000.0);
#endif
- plan_add_segment(diveplan, transitiontime, stoplevels[stopidx], o2, he, po2);
+ plan_add_segment(diveplan, transitiontime, stoplevels[stopidx], o2, he, po2, false);
/* re-create the dive */
delete_single_dive(dive_table.nr - 1);
*divep = dive = create_dive_from_plan(diveplan);
@@ -695,13 +696,13 @@ void plan(struct diveplan *diveplan, char **cached_datap, struct dive **divep, b
stoplevels[stopidx] / 1000.0, ceiling / 1000.0);
#endif
if (wait_time)
- plan_add_segment(diveplan, wait_time, stoplevels[stopidx], o2, he, po2);
+ plan_add_segment(diveplan, wait_time, stoplevels[stopidx], o2, he, po2, false);
/* right now all the transitions are at 30ft/min - this needs to be configurable */
transitiontime = (stoplevels[stopidx] - stoplevels[stopidx - 1]) / 150;
#if DEBUG_PLAN & 2
printf("transitiontime %d:%02d to depth %5.2lfm\n", FRACTION(transitiontime, 60), stoplevels[stopidx - 1] / 1000.0);
#endif
- plan_add_segment(diveplan, transitiontime, stoplevels[stopidx - 1], o2, he, po2);
+ plan_add_segment(diveplan, transitiontime, stoplevels[stopidx - 1], o2, he, po2, false);
/* re-create the dive */
delete_single_dive(dive_table.nr - 1);
*divep = dive = create_dive_from_plan(diveplan);