summaryrefslogtreecommitdiffstats
path: root/planner.c
diff options
context:
space:
mode:
authorGravatar Dirk Hohndel <dirk@hohndel.org>2014-08-19 21:07:43 -0500
committerGravatar Dirk Hohndel <dirk@hohndel.org>2014-08-19 21:18:26 -0500
commit5b0f4e79c4767f6d4e305e1607d7749330531a21 (patch)
tree2598cf819222a91c0f3506eaa08efe202b8d3a8f /planner.c
parentf7119bdccfb2c8777d96a53b3f389cd31d605f2d (diff)
downloadsubsurface-5b0f4e79c4767f6d4e305e1607d7749330531a21.tar.gz
Mark manually entered waypoints as such
With this information, when we re-plan a dive we can bring the user right back to the point where they ended - they have the waypoints in the dive pointes table and handles are shown on the right points in the profile - and the rest of the dive is once again calculated by the planning algorithm. For now this state is lost when saving the dive file as we don't add this flag in the sample to our saved files. So if we don't find any samples marked as manually added we add ALL of the samples as way points on the diveplan and the user has to manually remove the ones that were calculated. Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
Diffstat (limited to 'planner.c')
-rw-r--r--planner.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/planner.c b/planner.c
index 5bc171afc..ec053c880 100644
--- a/planner.c
+++ b/planner.c
@@ -278,6 +278,7 @@ static void create_dive_from_plan(struct diveplan *diveplan, bool track_gas)
sample->po2.mbar = dp->po2;
if (track_gas && cyl->type.workingpressure.mbar)
sample->cylinderpressure.mbar = cyl->end.mbar;
+ sample->manually_entered = true;
finish_sample(dc);
while (dp) {
struct gasmix gasmix = dp->gasmix;
@@ -316,6 +317,7 @@ static void create_dive_from_plan(struct diveplan *diveplan, bool track_gas)
sample[-1].po2.mbar = po2;
sample->time.seconds = lasttime + 1;
sample->depth.mm = lastdepth;
+ sample->manually_entered = dp->entered;
if (track_gas && cyl->type.workingpressure.mbar)
sample->cylinderpressure.mbar = cyl->sample_end.mbar;
finish_sample(dc);
@@ -329,6 +331,7 @@ static void create_dive_from_plan(struct diveplan *diveplan, bool track_gas)
sample->po2.mbar = po2;
sample->time.seconds = lasttime = time;
sample->depth.mm = lastdepth = depth;
+ sample->manually_entered = dp->entered;
if (track_gas) {
update_cylinder_pressure(&displayed_dive, sample[-1].depth.mm, depth, time - sample[-1].time.seconds,
dp->entered ? diveplan->bottomsac : diveplan->decosac, cyl, !dp->entered);