]> git.mxchange.org Git - flightgear.git/blobdiff - src/Autopilot/route_mgr.hxx
Merge branch 'jmt/units-fix' into maint
[flightgear.git] / src / Autopilot / route_mgr.hxx
index dbbe4577d22dbdfc17b5439630dd4d62cf5752ec..b096572591533419f4a429cedde07d820c64240a 100644 (file)
@@ -32,6 +32,9 @@
 class SGRoute;
 class SGPath;
 
+class FGAirport;
+typedef SGSharedPtr<FGAirport> FGAirportRef;
+
 /**
  * Top level route manager class
  * 
@@ -44,8 +47,8 @@ private:
     SGRoute* _route;
     time_t _takeoffTime;
     time_t _touchdownTime;
-    bool _autoSequence; // true if we are doing internal sequencing
-      // false if other code (FMS/GPS) is managing sequencing
+    FGAirportRef _departure;
+    FGAirportRef _destination;
     
     // automatic inputs
     SGPropertyNode_ptr lon;
@@ -53,10 +56,7 @@ private:
     SGPropertyNode_ptr alt;
     SGPropertyNode_ptr magvar;
     
-    // automatic outputs
-    SGPropertyNode_ptr target_altitude_ft;
-    SGPropertyNode_ptr altitude_lock;
-
+    // automatic outputs    
     SGPropertyNode_ptr departure; ///< departure airport information
     SGPropertyNode_ptr destination; ///< destination airport information
     SGPropertyNode_ptr alternate; ///< alternate airport information
@@ -68,7 +68,6 @@ private:
     
     SGPropertyNode_ptr active;
     SGPropertyNode_ptr airborne;
-    SGPropertyNode_ptr currentWp;
     
     SGPropertyNode_ptr wp0;
     SGPropertyNode_ptr wp1;
@@ -76,6 +75,18 @@ private:
     
     
     SGPropertyNode_ptr _pathNode;
+    SGPropertyNode_ptr _currentWpt;
+    
+    
+    /** 
+     * Signal property to notify people that the route was edited
+     */
+    SGPropertyNode_ptr _edited;
+    
+    /**
+     * Signal property to notify when the last waypoint is reached
+     */
+    SGPropertyNode_ptr _finished;
     
     void setETAPropertyFromDistance(SGPropertyNode_ptr aProp, double aDistance);
     
@@ -92,7 +103,6 @@ private:
     
     InputListener *listener;
     SGPropertyNode_ptr mirror;
-    bool altitude_set;
 
     /**
      * Create a SGWayPoint from a string in the following format:
@@ -105,20 +115,29 @@ private:
     
     
     void update_mirror();
-    bool near_ground();
     
     void currentWaypointChanged();
     
     /**
-     * Helper to update the target_altitude_ft and altitude_set flag when wp0
-     * changes
+     * Parse a route/wp node (from a saved, property-lsit formatted route)
      */
-    void updateTargetAltitude();
+    void parseRouteWaypoint(SGPropertyNode* aWP);
     
     /**
-     * Parse a route/wp node (from a saved, property-lsit formatted route)
+     * Check if we've reached the final waypoint. 
+     * Returns true if we have.
      */
-    void parseRouteWaypoint(SGPropertyNode* aWP);
+    bool checkFinished();
+    
+// tied getters and setters
+    const char* getDepartureICAO() const;
+    const char* getDepartureName() const;
+    void setDepartureICAO(const char* aIdent);
+    
+    const char* getDestinationICAO() const;
+    const char* getDestinationName() const;
+    void setDestinationICAO(const char* aIdent);
+    
 public:
 
     FGRouteMgr();