- if ( cname == "name" ) {
- name = cval;
- } else if ( cname == "debug" ) {
- debug = child->getBoolValue();
- } else if ( cname == "enable" ) {
- // cout << "parsing enable" << endl;
- SGPropertyNode *prop = child->getChild( "prop" );
- if ( prop != NULL ) {
- // cout << "prop = " << prop->getStringValue() << endl;
- enable_prop = fgGetNode( prop->getStringValue(), true );
- } else {
- // cout << "no prop child" << endl;
- }
- SGPropertyNode *val = child->getChild( "value" );
- if ( val != NULL ) {
- enable_value = val->getStringValue();
- }
- } else if ( cname == "input" ) {
- SGPropertyNode *prop = child->getChild( "prop" );
- if ( prop != NULL ) {
- input_prop = fgGetNode( prop->getStringValue(), true );
- }
- prop = child->getChild( "scale" );
- if ( prop != NULL ) {
- y_scale = prop->getDoubleValue();
- }
- } else if ( cname == "reference" ) {
- SGPropertyNode *prop = child->getChild( "prop" );
- if ( prop != NULL ) {
- r_n_prop = fgGetNode( prop->getStringValue(), true );
- } else {
- prop = child->getChild( "value" );
- if ( prop != NULL ) {
- r_n_value = prop->getDoubleValue();
- }
- }
- prop = child->getChild( "scale" );
- if ( prop != NULL ) {
- r_scale = prop->getDoubleValue();
- }
- } else if ( cname == "output" ) {
- int i = 0;
- SGPropertyNode *prop;
- while ( (prop = child->getChild("prop", i)) != NULL ) {
- SGPropertyNode *tmp = fgGetNode( prop->getStringValue(), true );
- output_list.push_back( tmp );
- i++;
- }
- } else if ( cname == "config" ) {
- SGPropertyNode *prop;
-
- prop = child->getChild( "Kp" );
- if ( prop != NULL ) {
- SGPropertyNode *val = prop->getChild( "value" );
- if ( val != NULL ) {
- Kp = val->getDoubleValue();
- }
-
- SGPropertyNode *prop1 = prop->getChild( "prop" );
- if ( prop1 != NULL ) {
- Kp_prop = fgGetNode( prop1->getStringValue(), true );
- if ( val != NULL ) {
- Kp_prop->setDoubleValue(Kp);
- }
- }
-
- // output deprecated usage warning
- if (val == NULL && prop1 == NULL) {
- Kp = prop->getDoubleValue();
- SG_LOG( SG_AUTOPILOT, SG_WARN, "Deprecated Kp config. Please use <prop> and/or <value> tags." );
- }
- proportional = true;
- }
-
- prop = child->getChild( "Ki" );
- if ( prop != NULL ) {
- Ki = prop->getDoubleValue();
- integral = true;
- }
-
- prop = child->getChild( "u_min" );
- if ( prop != NULL ) {
- SGPropertyNode *val = prop->getChild( "value" );
- if ( val != NULL ) {
- u_min = val->getDoubleValue();
- }
-
- SGPropertyNode *prop1 = prop->getChild( "prop" );
- if ( prop1 != NULL ) {
- umin_prop = fgGetNode( prop1->getStringValue(), true );
- if ( val != NULL ) {
- umin_prop->setDoubleValue(u_min);
- }
- }
-
- // output deprecated usage warning
- if (val == NULL && prop1 == NULL) {
- u_min = prop->getDoubleValue();
- SG_LOG( SG_AUTOPILOT, SG_WARN, "Deprecated u_min config. Please use <prop> and/or <value> tags." );
- }
- clamp = true;
- }
-
- prop = child->getChild( "u_max" );
- if ( prop != NULL ) {
- SGPropertyNode *val = prop->getChild( "value" );
- if ( val != NULL ) {
- u_max = val->getDoubleValue();
- }
-
- SGPropertyNode *prop1 = prop->getChild( "prop" );
- if ( prop1 != NULL ) {
- umax_prop = fgGetNode( prop1->getStringValue(), true );
- if ( val != NULL ) {
- umax_prop->setDoubleValue(u_max);
- }
- }
-
- // output deprecated usage warning
- if (val == NULL && prop1 == NULL) {
- u_max = prop->getDoubleValue();
- SG_LOG( SG_AUTOPILOT, SG_WARN, "Deprecated u_max config. Please use <prop> and/or <value> tags." );
- }
- clamp = true;
- }