bool AbortTask::is_reachable(const GlideResult &result, const bool final_glide) const { return !positive(result.Vector.Distance) || (!negative(result.TimeElapsed) && result.glide_reachable(final_glide)); }
void InfoBoxContentNextAltitudeArrival::Update(InfoBoxWindow &infobox) { // pilots want this to be assuming terminal flight to this wp const TaskStats &task_stats = XCSoarInterface::Calculated().task_stats; const GlideResult next_solution = XCSoarInterface::Calculated().common_stats.next_solution; if (!task_stats.task_valid || !next_solution.glide_reachable(true)) { infobox.SetInvalid(); return; } // Set Value TCHAR tmp[32]; fixed alt = XCSoarInterface::Basic().NavAltitude-next_solution.HeightGlide; Units::FormatUserAltitude(alt, tmp, 32, false); infobox.SetValue(tmp); // Set Unit infobox.SetValueUnit(Units::AltitudeUnit); }