Show surface degassing in the planner only when configured time != 0

This prevents from useless "Air" tag in profile when this feature is
not used.

Signed-off-by: Stefan Fuchs <sfuchs@gmx.de>
This commit is contained in:
Stefan Fuchs 2019-08-25 20:05:05 +02:00 committed by Robert C. Helling
parent 96f71e6cb1
commit 0e55739f03

View file

@ -1099,6 +1099,7 @@ bool plan(struct deco_state *ds, struct diveplan *diveplan, struct dive *dive, i
diveplan->eff_gflow = lrint(100.0 * (regressiona(ds) * first_stop_depth + regressionb(ds))); diveplan->eff_gflow = lrint(100.0 * (regressiona(ds) * first_stop_depth + regressionb(ds)));
} }
if (prefs.surface_segment != 0) {
for (int i = 0; i < MAX_CYLINDERS; i++) for (int i = 0; i < MAX_CYLINDERS; i++)
if (cylinder_nodata(&dive->cylinder[i])) { if (cylinder_nodata(&dive->cylinder[i])) {
// Switch to an empty air cylinder for breathing air at the surface // Switch to an empty air cylinder for breathing air at the surface
@ -1108,6 +1109,7 @@ bool plan(struct deco_state *ds, struct diveplan *diveplan, struct dive *dive, i
break; break;
} }
plan_add_segment(diveplan, prefs.surface_segment, 0, current_cylinder, 0, false, OC); plan_add_segment(diveplan, prefs.surface_segment, 0, current_cylinder, 0, false, OC);
}
create_dive_from_plan(diveplan, dive, is_planner); create_dive_from_plan(diveplan, dive, is_planner);
add_plan_to_notes(diveplan, dive, show_disclaimer, error); add_plan_to_notes(diveplan, dive, show_disclaimer, error);
fixup_dc_duration(&dive->dc); fixup_dc_duration(&dive->dc);