예제 #1
0
/** 
 * 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 (!m_warning_manager.get_config().class_enabled(airspace.get_type()) ||
        exclude_alt(airspace))
      return;

    AirspaceWarning& warning = m_warning_manager.get_warning(airspace);
    if (warning.state_accepted(m_warning_state)) {
      AirspaceInterceptSolution solution = intercept(airspace, m_state, m_perf);
      if (solution.valid() && (solution.elapsed_time <= m_max_time)) {
        warning.update_solution(m_warning_state, solution);
        m_found = true;
      }
    }
  }
예제 #2
0
  virtual void intersection(const AbstractAirspace& as) {
#ifdef DO_PRINT
    *fout << "# intersection point\n";
    for (AirspaceIntersectionVector::const_iterator it = m_intersections.begin();
         it != m_intersections.end(); ++it) {
      const GeoPoint start = (it->first);
      const GeoPoint end = (it->second);
      *fout << start.Longitude << " " << start.Latitude << " " << "\n";
      *fout << end.Longitude << " " << end.Latitude << " " << "\n\n";
    }

    AirspaceInterceptSolution solution = intercept(as, m_state, m_perf);
    if (solution.valid()) {
      *iout << "# intercept " << solution.elapsed_time << " h " << solution.altitude << "\n";
      *iout << solution.location.Longitude << " " << solution.location.Latitude << " " << "\n\n";
    }
#endif
  }