/** * Check whether this intersection should be added to, or updated in, the warning manager * * @param airspace Airspace corresponding to current intersection */ void Intersection(const AbstractAirspace& airspace) { if (!airspace.IsActive()) return; // ignore inactive airspaces completely if (!warning_manager.GetConfig().IsClassEnabled(airspace.GetType()) || ExcludeAltitude(airspace)) return; AirspaceWarning *warning = warning_manager.GetWarningPtr(airspace); if (warning == NULL || warning->IsStateAccepted(warning_state)) { AirspaceInterceptSolution solution; if (mode_inside) { airspace.Intercept(state, perf, solution, state.location, state.location); } else { solution = Intercept(airspace, state, perf); } if (!solution.IsValid()) return; if (solution.elapsed_time > max_time) return; if (warning == NULL) warning = warning_manager.GetNewWarningPtr(airspace); warning->UpdateSolution(warning_state, solution); found = true; } }
bool ActiveAirspacePredicate::operator()(const AbstractAirspace &airspace) const { if (warnings != nullptr) { ProtectedAirspaceWarningManager::Lease lease(*warnings); return lease->IsActive(airspace); } else /* fallback */ return airspace.IsActive(); }
bool IsInside(const AbstractAirspace &as) const { return as.IsActive() && Find(as, ids_inside); }
bool IsAcked(const AbstractAirspace &as) const { return (!as.IsActive()) || Find(as, ids_acked); }
bool HasWarning(const AbstractAirspace &as) const { return as.IsActive() && Find(as, ids_warning); }
bool AirspaceWarningManager::IsActive(const AbstractAirspace &airspace) const { return airspace.IsActive() && config.IsClassEnabled(airspace.GetType()) && !GetAckDay(airspace); }