]> git.mxchange.org Git - flightgear.git/blobdiff - src/Autopilot/predictor.cxx
AircraftModel hacking for package support.
[flightgear.git] / src / Autopilot / predictor.cxx
index d5c854a728662449133d07a5e3ebd39cb703f42e..2ff45c94191bff075d57a7c17fbf7cb9c9d1a346 100644 (file)
 
 using namespace FGXMLAutopilot;
 
-using std::endl;
-using std::cout;
-
+//------------------------------------------------------------------------------
 Predictor::Predictor () :
-    AnalogComponent(),
-    _average(0.0)
+  AnalogComponent(),
+  _last_value(0),
+  _average(0)
 {
 }
 
-bool Predictor::configure(const string& nodeName, SGPropertyNode_ptr configNode)
+//------------------------------------------------------------------------------
+bool Predictor::configure( SGPropertyNode& cfg_node,
+                           const std::string& cfg_name,
+                           SGPropertyNode& prop_root )
 {
-  SG_LOG( SG_AUTOPILOT, SG_BULK, "Predictor::configure(" << nodeName << ")" << endl );
-
-  if( AnalogComponent::configure( nodeName, configNode ) )
-    return true;
-
-  if( nodeName == "config" ) {
-    Component::configure( configNode );
+  if( cfg_name == "config" ) {
+    Component::configure(prop_root, cfg_node);
     return true;
   }
   
-  if (nodeName == "seconds") {
-    _seconds.push_back( new InputValue( configNode, 0 ) );
+  if (cfg_name == "seconds") {
+    _seconds.push_back( new InputValue(prop_root, cfg_node, 0) );
     return true;
   } 
 
-  if (nodeName == "filter-gain") {
-    _filter_gain.push_back( new InputValue( configNode, 0 ) );
+  if (cfg_name == "filter-gain") {
+    _filter_gain.push_back( new InputValue(prop_root, cfg_node, 0) );
     return true;
   }
 
-  SG_LOG( SG_AUTOPILOT, SG_BULK, "Predictor::configure(" << nodeName << ") [unhandled]" << endl );
-  return false;
+  return AnalogComponent::configure(cfg_node, cfg_name, prop_root);
 }
 
+//------------------------------------------------------------------------------
 void Predictor::update( bool firstTime, double dt ) 
 {
     double ivalue = _valueInput.get_value();
@@ -80,5 +77,3 @@ void Predictor::update( bool firstTime, double dt )
 
     _last_value = ivalue;
 }
-
-