X-Git-Url: https://git.mxchange.org/?a=blobdiff_plain;f=src%2FAutopilot%2Fpidcontroller.cxx;h=4f71fd574f2d4d3614e05d558f3e8aecfc6f6418;hb=564177933b4225fca89adb4039f3c0bf6e8bc828;hp=cff8da0db3759a7c79ad7fecffe6c135fa077a0c;hpb=5b537b6999744c1ab98c1e0f22f547314a8533b9;p=flightgear.git diff --git a/src/Autopilot/pidcontroller.cxx b/src/Autopilot/pidcontroller.cxx index cff8da0db..4f71fd574 100644 --- a/src/Autopilot/pidcontroller.cxx +++ b/src/Autopilot/pidcontroller.cxx @@ -193,54 +193,50 @@ void PIDController::update( bool firstTime, double dt ) } } -bool PIDController::configure( const std::string & nodeName, SGPropertyNode_ptr configNode ) +//------------------------------------------------------------------------------ +bool PIDController::configure( SGPropertyNode& cfg_node, + const std::string& cfg_name, + SGPropertyNode& prop_root ) { - SG_LOG( SG_AUTOPILOT, SG_BULK, "PIDController::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 == "Ts") { - desiredTs = configNode->getDoubleValue(); + if (cfg_name == "Ts") { + desiredTs = cfg_node.getDoubleValue(); return true; } - if (nodeName == "Kp") { - Kp.push_back( new InputValue(configNode) ); + if (cfg_name == "Kp") { + Kp.push_back( new InputValue(prop_root, cfg_node) ); return true; } - if (nodeName == "Ti") { - Ti.push_back( new InputValue(configNode) ); + if (cfg_name == "Ti") { + Ti.push_back( new InputValue(prop_root, cfg_node) ); return true; } - if (nodeName == "Td") { - Td.push_back( new InputValue(configNode) ); + if (cfg_name == "Td") { + Td.push_back( new InputValue(prop_root, cfg_node) ); return true; } - if (nodeName == "beta") { - beta = configNode->getDoubleValue(); + if (cfg_name == "beta") { + beta = cfg_node.getDoubleValue(); return true; } - if (nodeName == "alpha") { - alpha = configNode->getDoubleValue(); + if (cfg_name == "alpha") { + alpha = cfg_node.getDoubleValue(); return true; } - if (nodeName == "gamma") { - gamma = configNode->getDoubleValue(); + if (cfg_name == "gamma") { + gamma = cfg_node.getDoubleValue(); return true; - } + } - SG_LOG( SG_AUTOPILOT, SG_BULK, "PIDController::configure(" << nodeName << ") [unhandled]" << endl ); - return false; + return AnalogComponent::configure(cfg_node, cfg_name, prop_root); } -