void OrderedTask::GlideSolutionPlanned(const AircraftState &aircraft, const GlidePolar &glide_polar, GlideResult &total, GlideResult &leg, DistanceStat &total_remaining_effective, DistanceStat &leg_remaining_effective, const GlideResult &solution_remaining_total, const GlideResult &solution_remaining_leg) { TaskMacCreadyTotal tm(task_points, active_task_point, task_behaviour.glide, glide_polar); total = tm.glide_solution(aircraft); leg = tm.get_active_solution(); if (solution_remaining_total.IsOk()) total_remaining_effective.SetDistance(tm.effective_distance(solution_remaining_total.time_elapsed)); else total_remaining_effective.Reset(); if (solution_remaining_leg.IsOk()) leg_remaining_effective.SetDistance(tm.effective_leg_distance(solution_remaining_leg.time_elapsed)); else leg_remaining_effective.Reset(); }
static void Copy(DistanceStat &stat, const GlideResult &solution) { if (solution.IsDefined()) stat.set_distance(solution.vector.distance); else stat.Reset(); }
static void CalculatePirker(DistanceStat &pirker, const DistanceStat &planned, const DistanceStat &remaining_effective) { if (planned.IsDefined() && remaining_effective.IsDefined()) pirker.set_distance(planned.get_distance() - remaining_effective.get_distance()); else pirker.Reset(); }
void UnorderedTask::GlideSolutionPlanned(const AircraftState &state, GlideResult &total, GlideResult &leg, DistanceStat &total_remaining_effective, DistanceStat &leg_remaining_effective, const GlideResult &solution_remaining_total, const GlideResult &solution_remaining_leg) { total = solution_remaining_total; leg = solution_remaining_leg; if (total.IsOk()) total_remaining_effective.set_distance(total.vector.distance); else total_remaining_effective.Reset(); if (leg.IsOk()) leg_remaining_effective.set_distance(leg.vector.distance); else leg_remaining_effective.Reset(); }