diff options
author | Robert C. Helling <helling@atdotde.de> | 2014-06-03 13:00:51 +0200 |
---|---|---|
committer | Dirk Hohndel <dirk@hohndel.org> | 2014-06-03 07:54:01 -0700 |
commit | 1f1dcecc02a5c33c81d41a8a7c6aa2b9cc6b6da5 (patch) | |
tree | 6828db0ae5b745c343f2b2686add8aa24460e456 | |
parent | 7651de361a9045f734ced6f790d44b85c2c91cb9 (diff) | |
download | subsurface-1f1dcecc02a5c33c81d41a8a7c6aa2b9cc6b6da5.tar.gz |
Planner: Show waypoints for gas changes but no double depths
Signed-off-by: Robert C. Helling <helling@atdotde.de>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
-rw-r--r-- | planner.c | 6 |
1 files changed, 4 insertions, 2 deletions
@@ -561,13 +561,15 @@ static void add_plan_to_notes(struct diveplan *diveplan, struct dive *dive, bool dp->depth != lastdepth && nextdp->depth != dp->depth) continue; + if (dp->time - lasttime < 10 && !(gaschange && dp->next && dp->depth != dp->next->depth)) + continue; gasidx = get_gasidx(dive, &gasmix); len = strlen(buffer); if (nextdp && gasmix_distance(&gasmix, &newgasmix)) gaschange = true; if (plan_verbatim) { if (dp->depth != lastdepth) { - if (plan_display_transitions || dp->entered || !dp->next) + if (plan_display_transitions || dp->entered || !dp->next || (gaschange && dp->next && dp->depth != dp->next->depth)) len += snprintf(buffer + len, sizeof(buffer) - len, translate("gettextFromC", "Transition to %.*f %s in %d:%02d min - runtime %d:%02u on %s<br>"), decimals, depthvalue, depth_unit, FRACTION(dp->time - lasttime, 60), @@ -581,7 +583,7 @@ static void add_plan_to_notes(struct diveplan *diveplan, struct dive *dive, bool gasname(&gasmix)); } } else { - if (dp->depth == lastdepth || plan_display_transitions || dp->entered || !dp->next) { + if (dp->depth == lastdepth || plan_display_transitions || dp->entered || !dp->next || (gaschange && dp->next && dp->depth != dp->next->depth)) { len += snprintf(buffer + len, sizeof(buffer) - len, translate("gettextFromC", "<tr><td align=right>%3.0f%s</td>"), depthvalue, depth_unit); if (plan_display_runtime) len += snprintf(buffer + len, sizeof(buffer) - len, translate("gettextFromC", " <td align=right>%3dmin</td> "), (dp->time + 30) / 60); |