43 #include "FGFCSFunction.h" 44 #include "input_output/FGXMLElement.h" 50 IDENT(IdSrc,
"$Id: FGFCSFunction.cpp,v 1.15 2014/01/13 10:46:08 ehofman Exp $");
51 IDENT(IdHdr,ID_FCSFUNCTION);
59 FGFCSFunction::FGFCSFunction(FGFCS* fcs, Element* element) : FGFCSComponent(fcs, element)
61 Element *function_element = element->FindElement(
"function");
64 function =
new FGFunction(PropertyManager, function_element);
66 cerr <<
"FCS Function should contain a \"function\" element" << endl;
70 FGFCSComponent::bind();
76 FGFCSFunction::~FGFCSFunction()
84 bool FGFCSFunction::Run(
void )
86 Output =
function->GetValue();
88 if (InputNodes.size() > 0) {
89 Input = InputNodes[0]->getDoubleValue() * InputSigns[0];
94 if (IsOutput) SetOutput();
118 void FGFCSFunction::Debug(
int from)
120 if (debug_lvl <= 0)
return;
124 if (InputNodes.size()>0)
125 cout <<
" INPUT: " << InputNodes[0]->GetName() << endl;
128 for (
unsigned int i=0; i<OutputNodes.size(); i++)
129 cout <<
" OUTPUT: " << OutputNodes[i]->getName() << endl;
133 if (debug_lvl & 2 ) {
134 if (from == 0) cout <<
"Instantiated: FGFCSFunction" << endl;
135 if (from == 1) cout <<
"Destroyed: FGFCSFunction" << endl;
137 if (debug_lvl & 4 ) {
139 if (debug_lvl & 8 ) {
141 if (debug_lvl & 16) {
143 if (debug_lvl & 64) {
145 cout << IdSrc << endl;
146 cout << IdHdr << endl;