]> git.mxchange.org Git - flightgear.git/blobdiff - src/Autopilot/route_mgr.hxx
only activate heading & altitude lock when in air (and even then it should
[flightgear.git] / src / Autopilot / route_mgr.hxx
index 0cc05250fe279dcae3af0944db814478a14d3485..69fa508af84aa934975b08df5bf8da6fe9011a8d 100644 (file)
@@ -64,6 +64,8 @@ private:
 
     // automatic outputs
     SGPropertyNode_ptr true_hdg_deg;
+    SGPropertyNode_ptr target_altitude_ft;
+    SGPropertyNode_ptr altitude_lock;
 
     SGPropertyNode_ptr wp0_id;
     SGPropertyNode_ptr wp0_dist;
@@ -78,6 +80,23 @@ private:
     SGPropertyNode_ptr wpn_eta;
 
 
+    class Listener : public SGPropertyChangeListener {
+    public:
+        Listener(FGRouteMgr *m) : mgr(m) {}
+        virtual void valueChanged (SGPropertyNode * prop);
+    private:
+        FGRouteMgr *mgr;
+    };
+
+    SGPropertyNode_ptr input;
+    Listener *listener;
+    SGPropertyNode_ptr mirror;
+    bool altitude_set;
+
+    int make_waypoint( SGWayPoint **wp, string& target );
+    void update_mirror();
+    bool on_ground();
+
 public:
 
     FGRouteMgr();
@@ -91,19 +110,18 @@ public:
 
     bool build ();
 
-    void add_waypoint( const SGWayPoint& wp ) {
-        route->add_waypoint( wp );
-    }
+    int new_waypoint( const string& tgt_alt, int n = -1 );
+    void add_waypoint( const SGWayPoint& wp, int n = -1 );
+    SGWayPoint pop_waypoint( int i = 0 );
 
     SGWayPoint get_waypoint( int i ) const {
         return route->get_waypoint(i);
     }
 
-    SGWayPoint pop_waypoint();
-
     int size() const {
         return route->size();
     }
+
 };