60 if (element->
FindElement(
"noscale")) DoScale =
false;
64 while (setting_element) {
67 Detents.push_back(tmpDetent);
68 TransitionTimes.push_back(tmpTime);
72 if (Detents.size() <= 1) {
74 s <<
"Kinematic component " <<
Name
75 <<
" must have more than 1 setting element";
76 cerr << element->
ReadFrom() << endl << s.str() << endl;
100 if (DoScale)
Input *= Detents.back();
107 if (
fcs->GetTrimStatus())
118 if (ind >= Detents.size())
123 if (TransitionTimes[ind] <= 0.0) {
128 double Rate = (Detents[ind] - Detents[ind-1])/TransitionTimes[ind];
130 double ThisInput =
Constrain(Detents[ind-1],
Input, Detents[ind]);
132 double ThisDt = fabs((ThisInput-
Output)/Rate);
176void FGKinemat::Debug(
int from)
182 cout <<
" INPUT: " <<
InputNodes[0]->GetName() << endl;
183 cout <<
" DETENTS: " << Detents.size() << endl;
184 for (
unsigned int i=0;
i<Detents.size();
i++) {
185 cout <<
" " << Detents[
i] <<
" " << TransitionTimes[
i] << endl;
188 cout <<
" OUTPUT: " << node->getNameString() << endl;
189 if (!DoScale) cout <<
" NOSCALE" << endl;
193 if (from == 0) cout <<
"Instantiated: FGKinemat" << endl;
194 if (from == 1) cout <<
"Destroyed: FGKinemat" << endl;
double FindElementValueAsNumber(const std::string &el="")
Searches for the named element and returns the data belonging to it as a number.
std::string ReadFrom(void) const
Return a string that contains a description of the location where the current XML element was read fr...
Element * FindElement(const std::string &el="")
Searches for a specified element.
Element * FindNextElement(const std::string &el="")
Searches for the next element as specified.
FGFCSComponent(FGFCS *fcs, Element *el)
Constructor.
std::vector< FGPropertyValue_ptr > InputNodes
void CheckInputNodes(size_t MinNodes, size_t MaxNodes, Element *el)
virtual void bind(Element *el)
virtual void SetOutput(void)
std::vector< FGPropertyNode_ptr > OutputNodes
static constexpr double Constrain(double min, double value, double max)
Constrain a value between a minimum and a maximum value.
static bool EqualToRoundoff(double a, double b)
Finite precision comparison.
bool Run(void) override
Run method, overrides FGModel::Run().
FGKinemat(FGFCS *fcs, Element *element)
Constructor.