summaryrefslogtreecommitdiffstats
path: root/planner.c
diff options
context:
space:
mode:
authorGravatar Dirk Hohndel <dirk@hohndel.org>2014-05-31 21:24:27 -0700
committerGravatar Dirk Hohndel <dirk@hohndel.org>2014-05-31 21:25:03 -0700
commited26dfdd6bd095f117d4f43a638688d19bb9be5b (patch)
treeb21aa2efbb64add781488657b011ea3093386b57 /planner.c
parent6333f3aa35d12d7e9f1c02389df0f6129adb93b3 (diff)
downloadsubsurface-ed26dfdd6bd095f117d4f43a638688d19bb9be5b.tar.gz
Planner: don't include the disclaimer in the dive plan detail widget
We want the disclaimer in the final dive that can be printed, but it's distracting when shown while planning the dive. Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
Diffstat (limited to 'planner.c')
-rw-r--r--planner.c18
1 files changed, 10 insertions, 8 deletions
diff --git a/planner.c b/planner.c
index 1feb8467d..f062ee699 100644
--- a/planner.c
+++ b/planner.c
@@ -517,24 +517,26 @@ static unsigned int *sort_stops(int *dstops, int dnr, struct gaschanges *gstops,
return stoplevels;
}
-static void add_plan_to_notes(struct diveplan *diveplan, struct dive *dive)
+static void add_plan_to_notes(struct diveplan *diveplan, struct dive *dive, bool show_disclaimer)
{
char buffer[20000];
int consumption[MAX_CYLINDERS] = { 0, };
int len, gasidx, lastdepth = 0, lasttime = 0;
struct divedatapoint *dp = diveplan->dp;
int o2, he;
+ const char *disclaimer = "";
if (!dp)
return;
+ if (show_disclaimer)
+ disclaimer = translate("gettextFromC", "DISCLAIMER / WARNING: THIS IS A NEW IMPLEMENTATION OF THE BUHLMANN "
+ "ALGORITHM AND A DIVE PLANNER IMPLEMENTION BASED ON THAT WHICH HAS "
+ "RECEIVED ONLY A LIMITED AMOUNT OF TESTING. WE STRONGLY RECOMMEND NOT TO "
+ "PLAN DIVES SIMPLY BASED ON THE RESULTS GIVEN HERE.");
snprintf(buffer, sizeof(buffer),
translate("gettextFromC", "%s\nSubsurface dive plan\nbased on GFlow = %d and GFhigh = %d\n\n"),
- translate("gettextFromC", "DISCLAIMER / WARNING: THIS IS A NEW IMPLEMENTATION OF THE BUHLMANN "
- "ALGORITHM AND A DIVE PLANNER IMPLEMENTION BASED ON THAT WHICH HAS "
- "RECEIVED ONLY A LIMITED AMOUNT OF TESTING. WE STRONGLY RECOMMEND NOT TO "
- "PLAN DIVES SIMPLY BASED ON THE RESULTS GIVEN HERE."),
- diveplan->gflow, diveplan->gfhigh);
+ disclaimer, diveplan->gflow, diveplan->gfhigh);
/* we start with gas 0, then check if that was changed */
o2 = get_o2(&dive->cylinder[0].gasmix);
he = get_he(&dive->cylinder[0].gasmix);
@@ -627,7 +629,7 @@ int ascend_velocity(int depth, int avg_depth, int bottom_time)
return 6000 / 60;
}
-void plan(struct diveplan *diveplan, char **cached_datap, struct dive **divep, struct dive *master_dive, bool add_deco)
+void plan(struct diveplan *diveplan, char **cached_datap, struct dive **divep, struct dive *master_dive, bool add_deco, bool show_disclaimer)
{
struct dive *dive;
struct sample *sample;
@@ -812,7 +814,7 @@ void plan(struct diveplan *diveplan, char **cached_datap, struct dive **divep, s
*divep = dive = create_dive_from_plan(diveplan, master_dive);
if (!dive)
goto error_exit;
- add_plan_to_notes(diveplan, dive);
+ add_plan_to_notes(diveplan, dive, show_disclaimer);
error_exit:
free(stoplevels);