]> git.mxchange.org Git - flightgear.git/blobdiff - src/Traffic/SchedFlight.cxx
- Added ultra-light traffic is now a separate traffic class that can have its
[flightgear.git] / src / Traffic / SchedFlight.cxx
index 2672d3d26dc9a2fff8493e1ac6ee7ef7b1bd7b73..52661664d4924368d76da665792e43c9dc8d03a2 100644 (file)
@@ -127,8 +127,9 @@ FGScheduledFlight::FGScheduledFlight(const string& cs,
     }
   else
     {
-      cerr << "Unknown repeat period" << endl;
-      exit(1);
+      repeatPeriod = 365*24*60*60;
+      SG_LOG( SG_GENERAL, SG_ALERT, "Unknown repeat period in flight plan "
+                                    "of flight '" << cs << "': " << rep );
     }
 
   // What we still need to do is preprocess the departure and
@@ -151,7 +152,6 @@ time_t FGScheduledFlight::processTimeString(const string& theTime)
 {
   int weekday;
   int timeOffsetInDays;
-  int targetDate;
   int targetHour;
   int targetMinute;
   int targetSecond;
@@ -175,6 +175,7 @@ time_t FGScheduledFlight::processTimeString(const string& theTime)
     {
       timeOffsetInDays = 0;
     }
+  // TODO: verify status of each token.
   targetHour   = atoi(timeCopy.substr(0,2).c_str());
   targetMinute = atoi(timeCopy.substr(3,5).c_str());
   targetSecond = atoi(timeCopy.substr(6,8).c_str());
@@ -265,13 +266,13 @@ bool FGScheduledFlight::initializeAirports()
   departurePort = globals->get_airports()->search(depId);
   if(departurePort == NULL)
     {
-      cerr << "Could not find " << depId << endl; 
+      SG_LOG( SG_GENERAL, SG_WARN, "Traffic manager could not find departure airport : " << depId);
       return false;
     }
   arrivalPort = globals->get_airports()->search(arrId);
   if(arrivalPort == NULL)
     {
-      cerr << "Could not find " << arrId << endl;
+      SG_LOG( SG_GENERAL, SG_WARN, "Traffic manager could not find arrival airport   : " << arrId);
       return false;
     }
 
@@ -280,3 +281,9 @@ bool FGScheduledFlight::initializeAirports()
   initialized = true;
   return true;
 }
+
+
+bool compareScheduledFlights(FGScheduledFlight *a, FGScheduledFlight *b) 
+{ 
+  return (*a) < (*b); 
+};