]> git.mxchange.org Git - flightgear.git/blobdiff - src/Autopilot/route_mgr.hxx
ITM radio calculations are only considered valid
[flightgear.git] / src / Autopilot / route_mgr.hxx
index 16b4adc4b046eb69040c00f9a0910cd9f8edae6b..2b3409b131202664105c21b20afac191a9707678 100644 (file)
@@ -35,6 +35,8 @@ class SGPath;
 class PropertyWatcher;
 
 class FGAirport;
+class FGRunway;
+
 typedef SGSharedPtr<FGAirport> FGAirportRef;
 
 /**
@@ -92,6 +94,8 @@ public:
     
   flightgear::Waypt* wayptAtIndex(int index) const;
              
+  SGPropertyNode_ptr wayptNodeAtIndex(int index) const;
+             
   /**
    * Find a waypoint in the route, by position, and return its index, or
    * -1 if no matching waypoint was found in the route.
@@ -118,13 +122,28 @@ public:
    */
   void jumpToIndex(int index);
   
-  void saveRoute();
-  void loadRoute();
+  bool saveRoute(const SGPath& p);
+  bool loadRoute(const SGPath& p);
   
   /**
    * Helper command to setup current airport/runway if necessary
    */
   void initAtPosition();
+  
+    /**
+     * Create a WayPoint from a string in the following format:
+     *  - simple identifier
+     *  - decimal-lon,decimal-lat
+     *  - airport-id/runway-id
+     *  - navaid/radial-deg/offset-nm
+     */
+    flightgear::WayptRef waypointFromString(const std::string& target);
+    
+    FGAirportRef departureAirport() const;
+    FGAirportRef destinationAirport() const;
+    
+    FGRunway* departureRunway() const;
+    FGRunway* destinationRunway() const;
 private:
   flightgear::WayptVec _route;
   int _currentIndex;
@@ -188,17 +207,7 @@ private:
     SGPropertyNode_ptr weightOnWheels;
     
     InputListener *listener;
-    SGPropertyNode_ptr mirror;
-
-    /**
-     * Create a SGWayPoint from a string in the following format:
-     *  - simple identifier
-     *  - decimal-lon,decimal-lat
-     *  - airport-id/runway-id
-     *  - navaid/radial-deg/offset-nm
-     */
-    flightgear::WayptRef waypointFromString(const std::string& target);
-    
+    SGPropertyNode_ptr mirror;    
     
     void departureChanged();
     void buildDeparture(flightgear::WayptRef enroute, flightgear::WayptVec& wps);
@@ -229,7 +238,7 @@ private:
     bool checkFinished();
     
     
-    void loadPlainTextRoute(const SGPath& path);
+    bool loadPlainTextRoute(const SGPath& path);
     
     void loadVersion1XMLRoute(SGPropertyNode_ptr routeData);
     void loadVersion2XMLRoute(SGPropertyNode_ptr routeData);