]> git.mxchange.org Git - flightgear.git/blobdiff - src/Traffic/TrafficMgr.hxx
Canvas: CSS like property value inheritance.
[flightgear.git] / src / Traffic / TrafficMgr.hxx
index a9bb9a305184c305e26bf0dcd485563c51a74a3b..41d31de8480c6b25576472b326ec5f766afd5445 100644 (file)
 #ifndef _TRAFFICMGR_HXX_
 #define _TRAFFICMGR_HXX_
 
+#include <set>
 #include <simgear/structure/subsystem_mgr.hxx>
 #include <simgear/props/propertyObject.hxx>
 #include <simgear/xml/easyxml.hxx>
 #include <simgear/misc/sg_path.hxx>
+#include <simgear/misc/sg_dir.hxx>
 
 #include "SchedFlight.hxx"
 #include "Schedule.hxx"
@@ -64,6 +66,7 @@ public:
    std::string registration;
    unsigned int runCount;
    unsigned int hits;
+   unsigned int lastRun;
 };
 
 typedef std::vector<Heuristic> heuristicsVector;
@@ -79,11 +82,16 @@ class FGTrafficManager : public SGSubsystem, public XMLVisitor
 {
 private:
   bool inited;
+  bool doingInit;
   
   ScheduleVector scheduledAircraft;
   ScheduleVectorIterator currAircraft, currAircraftClosest;
   vector<string> elementValueStack;
 
+  // record model paths which are missing, to avoid duplicate
+  // warnings when parsing traffic schedules.
+  std::set<std::string> missingModels;
+    
   std::string mdl, livery, registration, callsign, fltrules, 
     port, timeString, departurePort, departureTime, arrivalPort, arrivalTime,
     repeat, acType, airline, m_class, flighttype, requiredAircraft, homePort;
@@ -99,7 +107,16 @@ private:
   void readTimeTableFromFile(SGPath infilename);
   void Tokenize(const string& str, vector<string>& tokens, const string& delimiters = " ");
 
-  simgear::PropertyObject<bool> enabled, aiEnabled, metarValid;
+  simgear::PropertyObject<bool> enabled, aiEnabled, realWxEnabled, metarValid;
+  
+  void loadHeuristics();
+  
+  void initStep();
+  void finishInit();
+  void shutdown();
+  
+  // during incremental init, contains the XML files still be read in
+  simgear::PathList schedulesToRead;
 public:
   FGTrafficManager();
   ~FGTrafficManager();
@@ -111,6 +128,8 @@ public:
   FGScheduledFlightVecIterator getFirstFlight(const string &ref) { return flights[ref].begin(); }
   FGScheduledFlightVecIterator getLastFlight(const string &ref) { return flights[ref].end(); }
 
+  void endAircraft();
+  
   // Some overloaded virtual XMLVisitor members
   virtual void startXML (); 
   virtual void endXML   ();