]> git.mxchange.org Git - flightgear.git/blobdiff - src/Autopilot/xmlauto.hxx
Create a "passive" mode for the autopilot. This is analogous to running the
[flightgear.git] / src / Autopilot / xmlauto.hxx
index ded9219245af3935fe9bc6c5aac9f4f0d0e8f2f8..38cfef890dc4957409b05878a6a3c2846f4f5817 100644 (file)
@@ -16,7 +16,7 @@
 //
 // You should have received a copy of the GNU General Public License
 // along with this program; if not, write to the Free Software
-// Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
+// Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.
 //
 // $Id$
 
@@ -45,6 +45,8 @@ SG_USING_STD(deque);
 #include <simgear/props/props.hxx>
 #include <simgear/structure/subsystem_mgr.hxx>
 
+#include <Main/fg_props.hxx>
+
 
 /**
  * Base class for other autopilot components
@@ -56,20 +58,24 @@ protected:
 
     string name;
 
-    SGPropertyNode *enable_prop;
+    SGPropertyNode_ptr enable_prop;
+    SGPropertyNode_ptr passive_mode;
     string enable_value;
+    bool honor_passive;
     bool enabled;
 
-    SGPropertyNode *input_prop;
-    SGPropertyNode *r_n_prop;
+    SGPropertyNode_ptr input_prop;
+    SGPropertyNode_ptr r_n_prop;
     double r_n_value;
-    vector <SGPropertyNode *> output_list;
+    vector <SGPropertyNode_ptr> output_list;
 
 public:
 
     FGXMLAutoComponent() :
       enable_prop( NULL ),
+      passive_mode( fgGetNode("/autopilot/settings/passive-mode", true) ),
       enable_value( "" ),
+      honor_passive( false ),
       enabled( false ),
       input_prop( NULL ),
       r_n_prop( NULL ),
@@ -78,9 +84,9 @@ public:
 
     virtual ~FGXMLAutoComponent() {}
 
-    virtual void update (double dt) {}
+    virtual void update (double dt)=0;
     
-    inline string get_name() { return name; }
+    inline const string& get_name() { return name; }
 };
 
 
@@ -152,7 +158,7 @@ private:
     // proportional component data
     bool proportional;
     double Kp;
-    SGPropertyNode *offset_prop;
+    SGPropertyNode_ptr offset_prop;
     double offset_value;
 
     // integral component data
@@ -274,7 +280,7 @@ protected:
 private:
 
     bool serviceable;
-    SGPropertyNode *config_props;
+    SGPropertyNode_ptr config_props;
     comp_list components;
 };