%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%*/
#include "FGGain.h"
+#include "input_output/FGXMLElement.h"
+#include <iostream>
+#include <string>
+#include <cstdlib>
+
+using namespace std;
namespace JSBSim {
-static const char *IdSrc = "$Id$";
+static const char *IdSrc = "$Id: FGGain.cpp,v 1.23 2011/04/18 08:51:12 andgi Exp $";
static const char *IdHdr = ID_GAIN;
/*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
if (Type == "PURE_GAIN") {
if ( !element->FindElement("gain") ) {
- cout << highint << " No GAIN specified (default: 1.0)" << normint << endl;
+ cerr << highint << " No GAIN specified (default: 1.0)" << normint << endl;
}
}
if ( element->FindElement("gain") ) {
gain_string = element->FindElementValue("gain");
- if (gain_string.find_first_not_of("+-.0123456789Ee") != string::npos) { // property
+ if (!is_number(gain_string)) { // property
if (gain_string[0] == '-') {
GainPropertySign = -1.0;
gain_string.erase(0,1);
zero_centered = element->FindElement("zero_centered");
//ToDo if zero centered, then mins must be <0 and max's must be >0
if (zero_centered) {
- sZeroCentered = zero_centered->FindElementValue("zero_centered");
+ sZeroCentered = element->FindElementValue("zero_centered");
if (sZeroCentered == string("0") || sZeroCentered == string("false")) {
ZeroCentered = false;
}
if (debug_lvl & 1) { // Standard console startup message output
if (from == 0) { // Constructor
if (InputSigns[0] < 0)
- cout << " INPUT: -" << InputNodes[0]->getName() << endl;
+ cout << " INPUT: -" << InputNodes[0]->GetName() << endl;
else
- cout << " INPUT: " << InputNodes[0]->getName() << endl;
+ cout << " INPUT: " << InputNodes[0]->GetName() << endl;
- cout << " GAIN: " << Gain << endl;
- if (IsOutput) cout << " OUTPUT: " << OutputNode->getName() << endl;
+ if (GainPropertyNode != 0) {
+ cout << " GAIN: " << GainPropertyNode->GetName() << endl;
+ } else {
+ cout << " GAIN: " << Gain << endl;
+ }
+ if (IsOutput) {
+ for (unsigned int i=0; i<OutputNodes.size(); i++)
+ cout << " OUTPUT: " << OutputNodes[i]->getName() << endl;
+ }
if (Type == "AEROSURFACE_SCALE") {
cout << " In/Out Mapping:" << endl;
cout << " Input MIN: " << InMin << endl;