X-Git-Url: https://git.mxchange.org/?a=blobdiff_plain;f=src%2FTraffic%2FSchedFlight.cxx;h=a66915a1e0831069d2772ada688ab00c2560bef9;hb=e48409d13664500d2ae7bb69c4b37c3c79a21cf9;hp=a65adad8c0b45fee2a4a2317f0feb1b024b0a321;hpb=62a359cc4a338b2f8b720edf8183ab5b69710b14;p=flightgear.git diff --git a/src/Traffic/SchedFlight.cxx b/src/Traffic/SchedFlight.cxx index a65adad8c..a66915a1e 100644 --- a/src/Traffic/SchedFlight.cxx +++ b/src/Traffic/SchedFlight.cxx @@ -14,7 +14,7 @@ * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software - * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * * **************************************************************************/ @@ -36,6 +36,11 @@ * - Find an alternative for the depricated Point3D class * *****************************************************************************/ + +#ifdef HAVE_CONFIG_H +# include "config.h" +#endif + #include #include #include @@ -146,7 +151,6 @@ time_t FGScheduledFlight::processTimeString(const string& theTime) { int weekday; int timeOffsetInDays; - int targetDate; int targetHour; int targetMinute; int targetSecond; @@ -170,6 +174,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()); @@ -260,13 +265,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; } @@ -275,3 +280,9 @@ bool FGScheduledFlight::initializeAirports() initialized = true; return true; } + + +bool compareScheduledFlights(FGScheduledFlight *a, FGScheduledFlight *b) +{ + return (*a) < (*b); +};