]> git.mxchange.org Git - flightgear.git/blobdiff - src/Autopilot/route_mgr.hxx
Trivial cleanup commit, to test continuous integration server.
[flightgear.git] / src / Autopilot / route_mgr.hxx
index cb79cb07faaba9376e225f42e4aaf25ac8adc77e..f3720d09e58a7bc49cb39331c2e2ddb264f7427a 100644 (file)
@@ -32,6 +32,9 @@
 class SGRoute;
 class SGPath;
 
+class FGAirport;
+typedef SGSharedPtr<FGAirport> FGAirportRef;
+
 /**
  * Top level route manager class
  * 
@@ -44,7 +47,9 @@ private:
     SGRoute* _route;
     time_t _takeoffTime;
     time_t _touchdownTime;
+    FGAirportRef _departure;
+    FGAirportRef _destination;
+    
     // automatic inputs
     SGPropertyNode_ptr lon;
     SGPropertyNode_ptr lat;
@@ -63,7 +68,6 @@ private:
     
     SGPropertyNode_ptr active;
     SGPropertyNode_ptr airborne;
-    SGPropertyNode_ptr currentWp;
     
     SGPropertyNode_ptr wp0;
     SGPropertyNode_ptr wp1;
@@ -71,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);
     
@@ -97,9 +113,14 @@ private:
      */
     SGWayPoint* make_waypoint(const string& target);
     
+    /**
+     * Helper to keep various pieces of state in sync when the SGRoute is
+     * modified (waypoints added, inserted, removed). Notably, this fires the
+     * 'edited' signal.
+     */
+    void waypointsChanged();
     
     void update_mirror();
-    bool near_ground();
     
     void currentWaypointChanged();
     
@@ -107,6 +128,25 @@ private:
      * Parse a route/wp node (from a saved, property-lsit formatted route)
      */
     void parseRouteWaypoint(SGPropertyNode* aWP);
+    
+    /**
+     * Check if we've reached the final waypoint. 
+     * Returns true if we have.
+     */
+    bool checkFinished();
+    
+    
+    void loadPlainTextRoute(const SGPath& path);
+    
+// 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();
@@ -157,6 +197,11 @@ public:
      */
     void jumpToIndex(int index);
     
+    /**
+     * 
+     */
+    void setWaypointTargetAltitudeFt(unsigned int index, int altFt);
+    
     void saveRoute();
     void loadRoute();
 };