namespace JSBSim {
-static const char *IdSrc = "$Id$";
+static const char *IdSrc = "$Id: FGFCSComponent.cpp,v 1.29 2010/09/07 00:40:03 jberndt Exp $";
static const char *IdHdr = ID_FCSCOMPONENT;
/*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
} else {
InputSigns.push_back( 1.0);
}
- tmp = PropertyManager->GetNode(input);
- if (tmp) {
- InputNodes.push_back( tmp );
+ if (PropertyManager->HasNode(input)) {
+ tmp = PropertyManager->GetNode(input);
} else {
- cerr << fgred << " In component: " << Name << " unknown property "
- << input << " referenced. Aborting" << reset << endl;
- exit(-1);
+ tmp = 0L;
+ // cerr << fgcyan << "In component: " + Name + " property "
+ // + input + " is initially undefined." << reset << endl;
}
+ InputNodes.push_back( tmp );
+ InputNames.push_back( input );
+
input_element = element->FindNextElement("input");
}
}
}
+//%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+
+void FGFCSComponent::LateBind(void)
+{
+ FGPropertyManager* node = 0L;
+
+ for (unsigned int i=0; i<InputNodes.size(); i++) {
+ if (!InputNodes[i]) {
+ if (PropertyManager->HasNode(InputNames[i])) {
+ node = PropertyManager->GetNode(InputNames[i]);
+ InputNodes[i] = node;
+ } else {
+ throw(InputNames[i]);
+ }
+ }
+ }
+}
+
//%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
//
// The old way of naming FCS components allowed upper or lower case, spaces, etc.