Example #1
0
bool 
StartPoint::CheckExitTransition(const AircraftState & ref_now, 
                                  const AircraftState & ref_last) const
{
  const bool now_in_height = 
    ordered_task_behaviour.CheckStartHeight(ref_now, margins,
                                            GetBaseElevation());
  const bool last_in_height = 
    ordered_task_behaviour.CheckStartHeight(ref_last, margins,
                                            GetBaseElevation());

  if (now_in_height && last_in_height) {
    // both within height limit, so use normal location checks
    return OrderedTaskPoint::CheckExitTransition(ref_now, ref_last);
  }
  if (!TransitionConstraint(ref_now.location, ref_last.location)) {
    // don't allow vertical crossings for line OZ's
    return false;
  }

  // transition inside sector to above 
  return !now_in_height && last_in_height 
    && OrderedTaskPoint::IsInSector(ref_last)
    && CanStartThroughTop();
}
Example #2
0
bool
StartPoint::CheckExitTransition(const AircraftState &ref_now,
                                const AircraftState &ref_last) const
{
  if (!constraints.open_time_span.HasBegun(RoughTime::FromSecondOfDayChecked(unsigned(ref_last.time))))
    /* the start gate is not yet open when we left the OZ */
    return false;

  if (constraints.open_time_span.HasEnded(RoughTime::FromSecondOfDayChecked(unsigned(ref_now.time))))
    /* the start gate was already closed when we left the OZ */
    return false;

  const bool now_in_height =
    constraints.CheckHeight(ref_now, margins, GetBaseElevation());
  const bool last_in_height =
    constraints.CheckHeight(ref_last, margins, GetBaseElevation());

  if (now_in_height && last_in_height) {
    // both within height limit, so use normal location checks
    return OrderedTaskPoint::CheckExitTransition(ref_now, ref_last);
  }
  if (!TransitionConstraint(ref_now.location, ref_last.location)) {
    // don't allow vertical crossings for line OZ's
    return false;
  }

  // transition inside sector to above
  return !now_in_height && last_in_height
    && OrderedTaskPoint::IsInSector(ref_last)
    && CanStartThroughTop();
}