Exemplo n.º 1
0
bool
AATPoint::SetRange(const fixed p, const bool force_if_current)
{
  if (target_locked)
    return false;

  switch (GetActiveState()) {
  case CURRENT_ACTIVE:
    if (!HasEntered() || force_if_current) {
      target_location = GetLocationMin().Interpolate(GetLocationMax(),p);
      return true;
    }
    return false;

  case AFTER_ACTIVE:
    if (GetActiveState() == AFTER_ACTIVE) {
      target_location = GetLocationMin().Interpolate(GetLocationMax(),p);
      return true;
    }
    return false;

  default:
    return false;
  }
}
Exemplo n.º 2
0
bool
AATPoint::SetRange(const fixed p, const bool force_if_current)
{
  if (target_locked)
    return false;

  switch (GetActiveState()) {
  case BEFORE_ACTIVE:
    return false;

  case CURRENT_ACTIVE:
    if (!HasEntered() || force_if_current) {
      target_location = InterpolateLocationMinMax(p);
      return true;
    }
    return false;

  case AFTER_ACTIVE:
    target_location = InterpolateLocationMinMax(p);
    return true;
  }

  assert(false);
  gcc_unreachable();
}
Exemplo n.º 3
0
const GeoPoint&
AATPoint::GetLocationRemaining() const
{
  if (GetActiveState() != BEFORE_ACTIVE)
    return target_location;

  if (HasSampled())
    return GetLocationMax();

  return GetLocationMin();
}
Exemplo n.º 4
0
bool
AATPoint::CheckTarget(const AircraftState &state, const bool known_outside)
{
  if (GetActiveState() == CURRENT_ACTIVE && target_locked)
    return false;

  bool moved = false;
  if (!known_outside && IsInSector(state))
    moved = CheckTargetInside(state);
  else
    moved = CheckTargetOutside(state);

  return moved;
}