]> git.mxchange.org Git - flightgear.git/commitdiff
Fixed autopilot/Predictor.
authorThorsten Brehm <brehm@patagonia.southamerica>
Fri, 8 Oct 2010 19:41:09 +0000 (21:41 +0200)
committerThorsten Brehm <brehm@patagonia.southamerica>
Fri, 8 Oct 2010 19:41:09 +0000 (21:41 +0200)
Signature of Predictor::configure must match AnalogComponent::configure,
otherwise the inherited method isn't overridden.
=> predictor couldn't be configured.
=> speed predictor rules in "generic-autopilot-helper.xml" weren't working.

src/Autopilot/predictor.cxx
src/Autopilot/predictor.hxx

index fe16d14dbeda80a48e3de164608757e99fbd5f4c..eece5cf37e4960fa3cc3b4649f2a29f419f1e3ae 100644 (file)
@@ -40,9 +40,18 @@ Predictor::Predictor () :
 {
 }
 
-bool Predictor::configure(const string& nodeName, SGPropertyNode* configNode)
+bool Predictor::configure(const string& nodeName, SGPropertyNode_ptr configNode)
 {
   SG_LOG( SG_AUTOPILOT, SG_BULK, "Predictor::configure(" << nodeName << ")" << endl );
+
+  if( AnalogComponent::configure( nodeName, configNode ) )
+    return true;
+
+  if( nodeName == "config" ) {
+    Component::configure( configNode );
+    return true;
+  }
+  
   if (nodeName == "seconds") {
     _seconds.push_back( new InputValue( configNode, 0 ) );
     return true;
index 5418b337f08d0f69a7d454f19a4ed76f8e99989a..e4c21b51430f17808c21efee6e0e9b0a9fcb25fc 100644 (file)
@@ -53,7 +53,7 @@ private:
     InputValueList _filter_gain;
 
 protected:
-  bool configure(const std::string& nodeName, SGPropertyNode* configNode );
+  bool configure(const std::string& nodeName, SGPropertyNode_ptr configNode );
 
 public:
     Predictor();