]> git.mxchange.org Git - flightgear.git/commitdiff
Enable the airway database parsing.
authordurk <durk>
Thu, 27 Jul 2006 14:49:41 +0000 (14:49 +0000)
committerdurk <durk>
Thu, 27 Jul 2006 14:49:41 +0000 (14:49 +0000)
src/Airports/dynamics.cxx
src/Main/fg_init.cxx
src/Main/globals.hxx
src/Traffic/SchedFlight.cxx

index 721abc2bc2a6008c3099cae4b4ece7d944b1fd24..53902ac48f0b9ecb16164b5dda096be4fd2d56d5 100644 (file)
@@ -465,11 +465,11 @@ void FGAirportDynamics::getActiveRunway(const string &trafficType, int action, s
       RunwayGroup *currRunwayGroup = 0;
       int nrActiveRunways = 0;
       time_t dayStart = fgGetLong("/sim/time/utc/day-seconds");
-      if (((dayStart - lastUpdate) > 600) || trafficType != prevTrafficType)
+      if ((fabs(dayStart - lastUpdate) > 600) || trafficType != prevTrafficType)
        {
          landing.clear();
          takeoff.clear();
-         //lastUpdate = dayStart;
+         lastUpdate = dayStart;
          prevTrafficType = trafficType;
 
          FGEnvironment 
index 793b5921a085f330d60c412e84873158bf58542e..8742889016644bdc466bb100726c7d8aafae0f5c 100644 (file)
@@ -1085,6 +1085,16 @@ fgInitNav ()
     fixlist->init( p_fix );
     globals->set_fixlist( fixlist );
 
+    SG_LOG(SG_GENERAL, SG_INFO, "  Airways");
+    SGPath p_awy( globals->get_fg_root() );
+    p_awy.append( "Navaids/awy.dat" );
+    FGAirwayNetwork *awyNet = new FGAirwayNetwork;
+    //cerr << "Loading Airways" << endl;
+    awyNet->load (p_awy );
+    awyNet->init();
+    //cerr << "initializing airways" << endl;
+    globals->set_airwaynet( awyNet );
+
     return true;
 }
 
index e1cef63dde81515b605e0647c7568d3ab42e7624..1f0ff5500df16947d5b0ec4b083951d7b7d55a94 100644 (file)
@@ -73,6 +73,7 @@ class FGControls;
 class FGFlightPlanDispatcher;
 class FGIO;
 class FGNavList;
+class FGAirwayNetwork;
 class FGTACANList;
 class FGFixList;
 class FGLight;
@@ -210,6 +211,7 @@ private:
     FGNavList *carrierlist;
     FGTACANList *channellist;
     FGFixList *fixlist;
+    FGAirwayNetwork *airwaynet;
 
     //Mulitplayer managers
     FGMultiplayMgr *multiplayer_mgr;
@@ -374,6 +376,10 @@ public:
     inline FGTACANList *get_channellist() const { return channellist; }
     inline void set_channellist( FGTACANList *c ) { channellist = c; }
 
+    inline FGAirwayNetwork *get_airwaynet() const { return airwaynet; }
+    inline void set_airwaynet( FGAirwayNetwork *a ) { airwaynet = a; }
+
+
    /**
      * Save the current state as the initial state.
      */
index dc44c53b6b2f952a372cf6866b2fbc54389e08d0..731ee6b8fefe3be576f5b6f602dcd9f1486831f3 100644 (file)
@@ -174,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());