Planner remove unnecessary gas consumption info from notes

If we consumed 0l/0bar in total from a cylinder there is no need to also
state that we consumed 0l/0bar during ascend.

Signed-off-by: Stefan Fuchs <sfuchs@gmx.de>
This commit is contained in:
Stefan Fuchs 2017-10-20 15:07:13 +02:00 committed by Robert C. Helling
parent 2bfcc5554f
commit 16f330e6c9

View file

@ -448,11 +448,18 @@ void add_plan_to_notes(struct diveplan *diveplan, struct dive *dive, bool show_d
}
}
/* Print the gas consumption for every cylinder here to temp buffer. */
snprintf(temp, sz_temp, translate("gettextFromC", "%.0f%s/%.0f%s of <span style='color: red;'><b>%s</b></span> (%.0f%s/%.0f%s in planned ascent)"), volume, unit, pressure, pressure_unit, gasname(&cyl->gasmix), deco_volume, unit, deco_pressure, pressure_unit);
if (lrint(volume) > 0)
snprintf(temp, sz_temp, translate("gettextFromC", "%.0f%s/%.0f%s of <span style='color: red;'><b>%s</b></span> (%.0f%s/%.0f%s in planned ascent)"), volume, unit, pressure, pressure_unit, gasname(&cyl->gasmix), deco_volume, unit, deco_pressure, pressure_unit);
else
snprintf(temp, sz_temp, translate("gettextFromC", "%.0f%s/%.0f%s of <span style='color: red;'><b>%s</b></span>"), volume, unit, pressure, pressure_unit, gasname(&cyl->gasmix));
} else {
snprintf(temp, sz_temp, translate("gettextFromC", "%.0f%s (%.0f%s during planned ascent) of <span style='color: red;'><b>%s</b></span>"),
volume, unit, deco_volume, unit, gasname(&cyl->gasmix));
if (lrint(volume) > 0)
snprintf(temp, sz_temp, translate("gettextFromC", "%.0f%s of <span style='color: red;'><b>%s</b></span> (%.0f%s during planned ascent)"),
volume, unit, gasname(&cyl->gasmix), deco_volume, unit);
else
snprintf(temp, sz_temp, translate("gettextFromC", "%.0f%s of <span style='color: red;'><b>%s</b></span>"),
volume, unit, gasname(&cyl->gasmix));
}
/* Gas consumption: Now finally print all strings to output */
len += snprintf(buffer + len, sz_buffer - len, "%s%s%s<br>", temp, warning, mingas);