58 OutMin = OutMax = 0.0;
62 if (
Type ==
"PURE_GAIN") {
76 if (
Type ==
"AEROSURFACE_SCALE") {
87 throw(
string(
"No range supplied for aerosurface scale component"));
94 <<
"Maximum and minimum output values must be supplied for the "
95 "aerosurface scale component" << endl;
96 throw(
"Some inputs are missing.");
103 if (sZeroCentered ==
string(
"0") || sZeroCentered ==
string(
"false")) {
104 ZeroCentered =
false;
109 if (
Type ==
"SCHEDULED_GAIN") {
114 <<
"A table must be provided for the scheduled gain component"
116 throw(
"Some inputs are missing.");
140 if (
Type ==
"PURE_GAIN") {
144 }
else if (
Type ==
"SCHEDULED_GAIN") {
146 double SchedGain = Table->GetValue();
149 }
else if (
Type ==
"AEROSURFACE_SCALE") {
154 }
else if (
Input > 0) {
160 Output = OutMin + ((
Input - InMin) / (InMax - InMin)) * (OutMax - OutMin);
163 Output *= Gain->GetValue();
191void FGGain::Debug(
int from)
197 cout <<
" INPUT: " <<
InputNodes[0]->GetNameWithSign() << endl;
198 cout <<
" GAIN: " << Gain->GetName() << endl;
201 cout <<
" OUTPUT: " << node->getNameString() << endl;
203 if (
Type ==
"AEROSURFACE_SCALE") {
204 cout <<
" In/Out Mapping:" << endl;
205 cout <<
" Input MIN: " << InMin << endl;
206 cout <<
" Input MAX: " << InMax << endl;
207 cout <<
" Output MIN: " << OutMin << endl;
208 cout <<
" Output MAX: " << OutMax << endl;
211 cout <<
" Scheduled by table: " << endl;
217 if (from == 0) cout <<
"Instantiated: FGGain" << endl;
218 if (from == 1) cout <<
"Destroyed: FGGain" << 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...
std::string FindElementValue(const std::string &el="")
Searches for the named element and returns the string data belonging to it.
Element * FindElement(const std::string &el="")
Searches for a specified element.
FGFCSComponent(FGFCS *fcs, Element *el)
Constructor.
std::vector< FGPropertyValue_ptr > InputNodes
void CheckInputNodes(size_t MinNodes, size_t MaxNodes, Element *el)
FGPropertyManager * PropertyManager
virtual void bind(Element *el)
virtual void SetOutput(void)
std::vector< FGPropertyNode_ptr > OutputNodes
FGGain(FGFCS *fcs, Element *element)
static char highint[5]
highlights text
static char normint[6]
normal intensity text
Represents a either a real value or a property value.