예제 #1
0
  void Visit(const AirspaceWarning& as) {
    if (as.GetWarningState() == AirspaceWarning::WARNING_INSIDE) {
      ids_inside.checked_append(&as.GetAirspace());
    } else if (as.GetWarningState() > AirspaceWarning::WARNING_CLEAR) {
      ids_warning.checked_append(&as.GetAirspace());
      locations.checked_append(as.GetSolution().location);
    }

    if (!as.IsAckExpired())
      ids_acked.checked_append(&as.GetAirspace());
  }
예제 #2
0
bool
AirspaceWarning::operator<(const AirspaceWarning &other) const
{
  // compare bother.ack
  if (IsAckExpired() != other.IsAckExpired())
    // least expired top
    return IsAckExpired() > other.IsAckExpired();

  // compare bother.state
  if (GetWarningState() != other.GetWarningState())
    // most severe top
    return GetWarningState() > other.GetWarningState();

  // state and ack equal, compare bother.time to intersect
  return GetSolution().elapsed_time < other.GetSolution().elapsed_time;
}
예제 #3
0
파일: Builder.cpp 프로젝트: rkohel/XCSoar
 void Add(const AirspaceWarning& as) {
   if (as.GetWarningState() > AirspaceWarning::WARNING_CLEAR)
     list.checked_append(&as.GetAirspace());
 }
예제 #4
0
 WarningItem(const AirspaceWarning &warning)
   :airspace(&warning.GetAirspace()),
    state(warning.GetWarningState()),
    solution(warning.GetSolution()),
    ack_expired(warning.IsAckExpired()), ack_day(warning.GetAckDay()) {}
예제 #5
0
 void Add(const AirspaceWarning& as) {
   if (as.GetWarningState() == AirspaceWarning::WARNING_INSIDE)
     ids_inside.checked_append(&as.GetAirspace());
   else if (as.GetWarningState() > AirspaceWarning::WARNING_CLEAR)
     ids_warning.checked_append(&as.GetAirspace());
 }