40#include "FGFCSFunction.h"
41#include "models/FGFCS.h"
42#include "input_output/FGXMLElement.h"
43#include "input_output/FGLog.h"
55FGFCSFunction::FGFCSFunction(FGFCS* fcs, Element* element)
56 : FGFCSComponent(fcs, element)
58 Element *function_element = element->FindElement(
"function");
61 function =
new FGFunction(fcs->GetExec(), function_element);
63 XMLLogException err(element);
64 err <<
"FCS Function should contain a \"function\" element\n";
68 bind(element, fcs->GetPropertyManager().get());
74FGFCSFunction::~FGFCSFunction()
82bool FGFCSFunction::Run(
void )
84 Output = function->GetValue();
86 if (!InputNodes.empty()) {
87 Input = InputNodes[0]->getDoubleValue();
116void FGFCSFunction::Debug(
int from)
118 if (debug_lvl <= 0)
return;
122 FGLogging log(LogLevel::DEBUG);
123 if (!InputNodes.empty())
124 log <<
" INPUT: " << InputNodes[0]->GetName() <<
"\n";
125 for (
auto node: OutputNodes)
126 log <<
" OUTPUT: " << node->getNameString() <<
"\n";
129 if (debug_lvl & 2 ) {
130 FGLogging log(LogLevel::DEBUG);
131 if (from == 0) log <<
"Instantiated: FGFCSFunction\n";
132 if (from == 1) log <<
"Destroyed: FGFCSFunction\n";
134 if (debug_lvl & 4 ) {
136 if (debug_lvl & 8 ) {
138 if (debug_lvl & 16) {
140 if (debug_lvl & 64) {
Main namespace for the JSBSim Flight Dynamics Model.