Revert most iostream-related changes to JSBSim
So many files in JSBSim use cout that it is not productive to remove iostream from header files.
This commit is contained in:
parent
18bece731a
commit
bfc1967529
27 changed files with 164 additions and 139 deletions
|
@ -36,15 +36,8 @@ INCLUDES
|
||||||
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%*/
|
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%*/
|
||||||
|
|
||||||
#include <string>
|
#include <string>
|
||||||
#ifdef FGFS
|
#include <iostream>
|
||||||
# include <simgear/props/props.hxx>
|
#include "simgear/props/props.hxx"
|
||||||
# include <simgear/debug/logstream.hxx>
|
|
||||||
# define JSBDEBUG sglog() << loglevel(SG_FLIGHT, SG_ALERT)
|
|
||||||
#else
|
|
||||||
# include <iostream>
|
|
||||||
# include "simgear/props/props.hxx"
|
|
||||||
# define JSBDEBUG std::cout
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#include "FGJSBBase.h"
|
#include "FGJSBBase.h"
|
||||||
|
|
||||||
|
@ -59,7 +52,7 @@ FORWARD DECLARATIONS
|
||||||
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%*/
|
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%*/
|
||||||
|
|
||||||
namespace JSBSim {
|
namespace JSBSim {
|
||||||
// Yuck - shouldn't be using in header files
|
using std::cout;
|
||||||
using std::string;
|
using std::string;
|
||||||
using std::endl;
|
using std::endl;
|
||||||
|
|
||||||
|
@ -518,9 +511,9 @@ class FGPropertyManager : public SGPropertyNode, public FGJSBBase
|
||||||
Tie (const string &name, V (*getter)(), void (*setter)(V) = 0, bool useDefault = true)
|
Tie (const string &name, V (*getter)(), void (*setter)(V) = 0, bool useDefault = true)
|
||||||
{
|
{
|
||||||
if (!tie(name.c_str(), SGRawValueFunctions<V>(getter, setter), useDefault))
|
if (!tie(name.c_str(), SGRawValueFunctions<V>(getter, setter), useDefault))
|
||||||
JSBDEBUG << "Failed to tie property " << name << " to functions" << endl;
|
cout << "Failed to tie property " << name << " to functions" << endl;
|
||||||
else if (debug_lvl & 0x20)
|
else if (debug_lvl & 0x20)
|
||||||
JSBDEBUG << name << endl;
|
cout << name << endl;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@ -546,9 +539,9 @@ class FGPropertyManager : public SGPropertyNode, public FGJSBBase
|
||||||
void (*setter)(int, V) = 0, bool useDefault = true)
|
void (*setter)(int, V) = 0, bool useDefault = true)
|
||||||
{
|
{
|
||||||
if (!tie(name.c_str(), SGRawValueFunctionsIndexed<V>(index, getter, setter), useDefault))
|
if (!tie(name.c_str(), SGRawValueFunctionsIndexed<V>(index, getter, setter), useDefault))
|
||||||
JSBDEBUG << "Failed to tie property " << name << " to indexed functions" << endl;
|
cout << "Failed to tie property " << name << " to indexed functions" << endl;
|
||||||
else if (debug_lvl & 0x20)
|
else if (debug_lvl & 0x20)
|
||||||
JSBDEBUG << name << endl;
|
cout << name << endl;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@ -576,9 +569,9 @@ class FGPropertyManager : public SGPropertyNode, public FGJSBBase
|
||||||
void (T::*setter)(V) = 0, bool useDefault = true)
|
void (T::*setter)(V) = 0, bool useDefault = true)
|
||||||
{
|
{
|
||||||
if (!tie(name.c_str(), SGRawValueMethods<T,V>(*obj, getter, setter), useDefault))
|
if (!tie(name.c_str(), SGRawValueMethods<T,V>(*obj, getter, setter), useDefault))
|
||||||
JSBDEBUG << "Failed to tie property " << name << " to object methods" << endl;
|
cout << "Failed to tie property " << name << " to object methods" << endl;
|
||||||
else if (debug_lvl & 0x20)
|
else if (debug_lvl & 0x20)
|
||||||
JSBDEBUG << name << endl;
|
cout << name << endl;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -605,9 +598,9 @@ class FGPropertyManager : public SGPropertyNode, public FGJSBBase
|
||||||
void (T::*setter)(int, V) = 0, bool useDefault = true)
|
void (T::*setter)(int, V) = 0, bool useDefault = true)
|
||||||
{
|
{
|
||||||
if (!tie(name.c_str(), SGRawValueMethodsIndexed<T,V>(*obj, index, getter, setter), useDefault))
|
if (!tie(name.c_str(), SGRawValueMethodsIndexed<T,V>(*obj, index, getter, setter), useDefault))
|
||||||
JSBDEBUG << "Failed to tie property " << name << " to indexed object methods" << endl;
|
cout << "Failed to tie property " << name << " to indexed object methods" << endl;
|
||||||
else if (debug_lvl & 0x20)
|
else if (debug_lvl & 0x20)
|
||||||
JSBDEBUG << name << endl;
|
cout << name << endl;
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
|
@ -53,8 +53,6 @@ INCLUDES
|
||||||
#include <stdlib.h>
|
#include <stdlib.h>
|
||||||
#include <math.h>
|
#include <math.h>
|
||||||
|
|
||||||
#include <iostream>
|
|
||||||
|
|
||||||
/*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
|
/*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
|
||||||
FORWARD DECLARATIONS
|
FORWARD DECLARATIONS
|
||||||
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%*/
|
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%*/
|
||||||
|
@ -64,10 +62,6 @@ namespace JSBSim {
|
||||||
static const char *IdSrc = "$Id$";
|
static const char *IdSrc = "$Id$";
|
||||||
static const char *IdHdr = ID_XMLELEMENT;
|
static const char *IdHdr = ID_XMLELEMENT;
|
||||||
|
|
||||||
using std::cerr;
|
|
||||||
using std::cout;
|
|
||||||
using std::endl;
|
|
||||||
|
|
||||||
/*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
|
/*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
|
||||||
CLASS IMPLEMENTATION
|
CLASS IMPLEMENTATION
|
||||||
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%*/
|
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%*/
|
||||||
|
|
|
@ -39,17 +39,30 @@ INCLUDES
|
||||||
# ifdef SG_HAVE_STD_INCLUDES
|
# ifdef SG_HAVE_STD_INCLUDES
|
||||||
# include <string>
|
# include <string>
|
||||||
# include <vector>
|
# include <vector>
|
||||||
|
# include <iostream>
|
||||||
# include <map>
|
# include <map>
|
||||||
# else
|
# else
|
||||||
# include <vector.h>
|
# include <vector.h>
|
||||||
# include <string>
|
# include <string>
|
||||||
|
# include <iostream.h>
|
||||||
# include <map.h>
|
# include <map.h>
|
||||||
# endif
|
# endif
|
||||||
#else
|
#else
|
||||||
# include <string>
|
# include <string>
|
||||||
# include <map>
|
# include <map>
|
||||||
|
# include <iostream>
|
||||||
# include <vector>
|
# include <vector>
|
||||||
|
using std::string;
|
||||||
|
using std::map;
|
||||||
|
using std::vector;
|
||||||
|
using std::cout;
|
||||||
|
using std::endl;
|
||||||
#endif
|
#endif
|
||||||
|
using std::string;
|
||||||
|
using std::map;
|
||||||
|
using std::vector;
|
||||||
|
using std::cout;
|
||||||
|
using std::endl;
|
||||||
|
|
||||||
#include <math/FGColumnVector3.h>
|
#include <math/FGColumnVector3.h>
|
||||||
|
|
||||||
|
@ -146,7 +159,7 @@ public:
|
||||||
/** Constructor
|
/** Constructor
|
||||||
@param nm the name of this element (if given)
|
@param nm the name of this element (if given)
|
||||||
*/
|
*/
|
||||||
Element(std::string nm);
|
Element(string nm);
|
||||||
/// Destructor
|
/// Destructor
|
||||||
~Element(void);
|
~Element(void);
|
||||||
|
|
||||||
|
@ -154,23 +167,23 @@ public:
|
||||||
@param key specifies the attribute key to retrieve the value of.
|
@param key specifies the attribute key to retrieve the value of.
|
||||||
@return the key value (as a string), or the empty string if no such
|
@return the key value (as a string), or the empty string if no such
|
||||||
attribute exists. */
|
attribute exists. */
|
||||||
std::string GetAttributeValue(std::string key);
|
string GetAttributeValue(string key);
|
||||||
|
|
||||||
/** Retrieves an attribute value as a double precision real number.
|
/** Retrieves an attribute value as a double precision real number.
|
||||||
@param key specifies the attribute key to retrieve the value of.
|
@param key specifies the attribute key to retrieve the value of.
|
||||||
@return the key value (as a number), or the HUGE_VAL if no such
|
@return the key value (as a number), or the HUGE_VAL if no such
|
||||||
attribute exists. */
|
attribute exists. */
|
||||||
double GetAttributeValueAsNumber(std::string key);
|
double GetAttributeValueAsNumber(string key);
|
||||||
|
|
||||||
/** Retrieves the element name.
|
/** Retrieves the element name.
|
||||||
@return the element name, or the empty string if no name has been set.*/
|
@return the element name, or the empty string if no name has been set.*/
|
||||||
std::string GetName(void) {return name;}
|
string GetName(void) {return name;}
|
||||||
|
|
||||||
/** Gets a line of data belonging to an element.
|
/** Gets a line of data belonging to an element.
|
||||||
@param i the index of the data line to return (0 by default).
|
@param i the index of the data line to return (0 by default).
|
||||||
@return a string representing the data line requested, or the empty string
|
@return a string representing the data line requested, or the empty string
|
||||||
if none exists.*/
|
if none exists.*/
|
||||||
std::string GetDataLine(unsigned int i=0);
|
string GetDataLine(unsigned int i=0);
|
||||||
|
|
||||||
/// Returns the number of lines of data stored
|
/// Returns the number of lines of data stored
|
||||||
unsigned int GetNumDataLines(void) {return (unsigned int)data_lines.size();}
|
unsigned int GetNumDataLines(void) {return (unsigned int)data_lines.size();}
|
||||||
|
@ -179,7 +192,7 @@ public:
|
||||||
unsigned int GetNumElements(void) {return (unsigned int)children.size();}
|
unsigned int GetNumElements(void) {return (unsigned int)children.size();}
|
||||||
|
|
||||||
/// Returns the number of named child elements for this element.
|
/// Returns the number of named child elements for this element.
|
||||||
unsigned int GetNumElements(std::string);
|
unsigned int GetNumElements(string);
|
||||||
|
|
||||||
/** Converts the element data to a number.
|
/** Converts the element data to a number.
|
||||||
This function attempts to convert the first (and presumably only) line of
|
This function attempts to convert the first (and presumably only) line of
|
||||||
|
@ -212,12 +225,12 @@ public:
|
||||||
Element* GetParent(void) {return parent;}
|
Element* GetParent(void) {return parent;}
|
||||||
|
|
||||||
/** Searches for a specified element.
|
/** Searches for a specified element.
|
||||||
Finds the first element that matches the supplied std::string, or simply the first
|
Finds the first element that matches the supplied string, or simply the first
|
||||||
element if no search std::string is supplied. This function call resets the internal
|
element if no search string is supplied. This function call resets the internal
|
||||||
element counter to the first element.
|
element counter to the first element.
|
||||||
@param el the search std::string (empty std::string by default).
|
@param el the search string (empty string by default).
|
||||||
@return a pointer to the first element that matches the supplied search std::string. */
|
@return a pointer to the first element that matches the supplied search string. */
|
||||||
Element* FindElement(std::string el="");
|
Element* FindElement(string el="");
|
||||||
|
|
||||||
/** Searches for the next element as specified.
|
/** Searches for the next element as specified.
|
||||||
This function would be called after FindElement() is first called (in order to
|
This function would be called after FindElement() is first called (in order to
|
||||||
|
@ -228,7 +241,7 @@ public:
|
||||||
@param el the name of the next element to find.
|
@param el the name of the next element to find.
|
||||||
@return the pointer to the found element, or 0 if no appropriate element us
|
@return the pointer to the found element, or 0 if no appropriate element us
|
||||||
found.*/
|
found.*/
|
||||||
Element* FindNextElement(std::string el="");
|
Element* FindNextElement(string el="");
|
||||||
|
|
||||||
/** Searches for the named element and returns the string data belonging to it.
|
/** Searches for the named element and returns the string data belonging to it.
|
||||||
This function allows the data belonging to a named element to be returned
|
This function allows the data belonging to a named element to be returned
|
||||||
|
@ -238,7 +251,7 @@ public:
|
||||||
default)
|
default)
|
||||||
@return the data value for the named element as a string, or the empty
|
@return the data value for the named element as a string, or the empty
|
||||||
string if the element cannot be found. */
|
string if the element cannot be found. */
|
||||||
std::string FindElementValue(std::string el="");
|
string FindElementValue(string el="");
|
||||||
|
|
||||||
/** Searches for the named element and returns the data belonging to it as a number.
|
/** Searches for the named element and returns the data belonging to it as a number.
|
||||||
This function allows the data belonging to a named element to be returned
|
This function allows the data belonging to a named element to be returned
|
||||||
|
@ -248,7 +261,7 @@ public:
|
||||||
default)
|
default)
|
||||||
@return the data value for the named element as a double, or HUGE_VAL if the
|
@return the data value for the named element as a double, or HUGE_VAL if the
|
||||||
data is missing. */
|
data is missing. */
|
||||||
double FindElementValueAsNumber(std::string el="");
|
double FindElementValueAsNumber(string el="");
|
||||||
|
|
||||||
/** Searches for the named element and converts and returns the data belonging to it.
|
/** Searches for the named element and converts and returns the data belonging to it.
|
||||||
This function allows the data belonging to a named element to be returned
|
This function allows the data belonging to a named element to be returned
|
||||||
|
@ -265,7 +278,7 @@ public:
|
||||||
to which the value returned will be converted.
|
to which the value returned will be converted.
|
||||||
@return the unit-converted data value for the named element as a double,
|
@return the unit-converted data value for the named element as a double,
|
||||||
or HUGE_VAL if the data is missing. */
|
or HUGE_VAL if the data is missing. */
|
||||||
double FindElementValueAsNumberConvertTo(std::string el, std::string target_units);
|
double FindElementValueAsNumberConvertTo(string el, string target_units);
|
||||||
|
|
||||||
/** Searches for the named element and converts and returns the data belonging to it.
|
/** Searches for the named element and converts and returns the data belonging to it.
|
||||||
This function allows the data belonging to a named element to be returned
|
This function allows the data belonging to a named element to be returned
|
||||||
|
@ -284,9 +297,9 @@ public:
|
||||||
to which the value returned will be converted.
|
to which the value returned will be converted.
|
||||||
@return the unit-converted data value for the named element as a double,
|
@return the unit-converted data value for the named element as a double,
|
||||||
or HUGE_VAL if the data is missing. */
|
or HUGE_VAL if the data is missing. */
|
||||||
double FindElementValueAsNumberConvertFromTo( std::string el,
|
double FindElementValueAsNumberConvertFromTo( string el,
|
||||||
std::string supplied_units,
|
string supplied_units,
|
||||||
std::string target_units);
|
string target_units);
|
||||||
|
|
||||||
/** Composes a 3-element column vector for the supplied location or orientation.
|
/** Composes a 3-element column vector for the supplied location or orientation.
|
||||||
This function processes a LOCATION or ORIENTATION construct, returning a
|
This function processes a LOCATION or ORIENTATION construct, returning a
|
||||||
|
@ -297,7 +310,7 @@ public:
|
||||||
@param target_units the string representing the native units used by JSBSim
|
@param target_units the string representing the native units used by JSBSim
|
||||||
to which the value returned will be converted.
|
to which the value returned will be converted.
|
||||||
@return a column vector object built from the LOCATION or ORIENT components. */
|
@return a column vector object built from the LOCATION or ORIENT components. */
|
||||||
FGColumnVector3 FindElementTripletConvertTo( std::string target_units);
|
FGColumnVector3 FindElementTripletConvertTo( string target_units);
|
||||||
|
|
||||||
/** This function sets the value of the parent class attribute to the supplied
|
/** This function sets the value of the parent class attribute to the supplied
|
||||||
Element pointer.
|
Element pointer.
|
||||||
|
@ -311,11 +324,11 @@ public:
|
||||||
/** Stores an attribute belonging to this element.
|
/** Stores an attribute belonging to this element.
|
||||||
* @param name The string name of the attribute.
|
* @param name The string name of the attribute.
|
||||||
* @param value The string value of the attribute. */
|
* @param value The string value of the attribute. */
|
||||||
void AddAttribute(std::string name, std::string value);
|
void AddAttribute(string name, string value);
|
||||||
|
|
||||||
/** Stores data belonging to this element.
|
/** Stores data belonging to this element.
|
||||||
* @param d the data to store. */
|
* @param d the data to store. */
|
||||||
void AddData(std::string d);
|
void AddData(string d);
|
||||||
|
|
||||||
/** Prints the element.
|
/** Prints the element.
|
||||||
* Prints this element and calls the Print routine for child elements.
|
* Prints this element and calls the Print routine for child elements.
|
||||||
|
@ -323,14 +336,14 @@ public:
|
||||||
void Print(unsigned int level=0);
|
void Print(unsigned int level=0);
|
||||||
|
|
||||||
private:
|
private:
|
||||||
std::string name;
|
string name;
|
||||||
std::map <std::string, std::string> attributes;
|
map <string, string> attributes;
|
||||||
std::vector <std::string> data_lines;
|
vector <string> data_lines;
|
||||||
std::vector <Element*> children;
|
vector <Element*> children;
|
||||||
std::vector <std::string> attribute_key;
|
vector <string> attribute_key;
|
||||||
Element *parent;
|
Element *parent;
|
||||||
unsigned int element_index;
|
unsigned int element_index;
|
||||||
typedef std::map <std::string, std::map <std::string, double> > tMapConvert;
|
typedef map <string, map <string, double> > tMapConvert;
|
||||||
tMapConvert convert;
|
tMapConvert convert;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
|
@ -35,7 +35,6 @@ SENTRY
|
||||||
INCLUDES
|
INCLUDES
|
||||||
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%*/
|
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%*/
|
||||||
|
|
||||||
#include <fstream>
|
|
||||||
#include <input_output/FGXMLParse.h>
|
#include <input_output/FGXMLParse.h>
|
||||||
|
|
||||||
/*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
|
/*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
|
||||||
|
@ -59,7 +58,7 @@ protected:
|
||||||
Element* document;
|
Element* document;
|
||||||
Element* LoadXMLDocument(string XML_filename)
|
Element* LoadXMLDocument(string XML_filename)
|
||||||
{
|
{
|
||||||
std::ifstream infile;
|
ifstream infile;
|
||||||
|
|
||||||
if ( !XML_filename.empty() ) {
|
if ( !XML_filename.empty() ) {
|
||||||
if (XML_filename.find(".xml") == string::npos) XML_filename += ".xml";
|
if (XML_filename.find(".xml") == string::npos) XML_filename += ".xml";
|
||||||
|
|
|
@ -38,7 +38,6 @@ INCLUDES
|
||||||
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%*/
|
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%*/
|
||||||
|
|
||||||
#include <cstring>
|
#include <cstring>
|
||||||
#include <iostream>
|
|
||||||
|
|
||||||
#include "FGfdmSocket.h"
|
#include "FGfdmSocket.h"
|
||||||
|
|
||||||
|
@ -47,10 +46,6 @@ namespace JSBSim {
|
||||||
static const char *IdSrc = "$Id$";
|
static const char *IdSrc = "$Id$";
|
||||||
static const char *IdHdr = ID_FDMSOCKET;
|
static const char *IdHdr = ID_FDMSOCKET;
|
||||||
|
|
||||||
using std::cerr;
|
|
||||||
using std::cout;
|
|
||||||
using std::endl;
|
|
||||||
|
|
||||||
/*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
|
/*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
|
||||||
CLASS IMPLEMENTATION
|
CLASS IMPLEMENTATION
|
||||||
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%*/
|
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%*/
|
||||||
|
|
|
@ -43,8 +43,21 @@ INCLUDES
|
||||||
#ifdef FGFS
|
#ifdef FGFS
|
||||||
# include <simgear/compiler.h>
|
# include <simgear/compiler.h>
|
||||||
# include STL_STRING
|
# include STL_STRING
|
||||||
|
# include STL_IOSTREAM
|
||||||
|
# include STL_FSTREAM
|
||||||
|
SG_USING_STD(cout);
|
||||||
|
SG_USING_STD(endl);
|
||||||
#else
|
#else
|
||||||
# include <string>
|
# include <string>
|
||||||
|
# if defined(sgi) && !defined(__GNUC__) && (_COMPILER_VERSION < 740)
|
||||||
|
# include <iostream.h>
|
||||||
|
# include <fstream.h>
|
||||||
|
# else
|
||||||
|
# include <iostream>
|
||||||
|
# include <fstream>
|
||||||
|
using std::cout;
|
||||||
|
using std::endl;
|
||||||
|
# endif
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#include <sys/types.h>
|
#include <sys/types.h>
|
||||||
|
|
|
@ -39,18 +39,12 @@ INCLUDES
|
||||||
|
|
||||||
#include "FGColumnVector3.h"
|
#include "FGColumnVector3.h"
|
||||||
#include <stdio.h>
|
#include <stdio.h>
|
||||||
#include <iostream>
|
|
||||||
|
|
||||||
namespace JSBSim {
|
namespace JSBSim {
|
||||||
|
|
||||||
static const char *IdSrc = "$Id$";
|
static const char *IdSrc = "$Id$";
|
||||||
static const char *IdHdr = ID_COLUMNVECTOR3;
|
static const char *IdHdr = ID_COLUMNVECTOR3;
|
||||||
|
|
||||||
using std::ostream;
|
|
||||||
using std::cerr;
|
|
||||||
using std::cout;
|
|
||||||
using std::endl;
|
|
||||||
|
|
||||||
/*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
|
/*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
|
||||||
CLASS IMPLEMENTATION
|
CLASS IMPLEMENTATION
|
||||||
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%*/
|
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%*/
|
||||||
|
|
|
@ -44,8 +44,14 @@ INCLUDES
|
||||||
# include <math.h>
|
# include <math.h>
|
||||||
# include <simgear/compiler.h>
|
# include <simgear/compiler.h>
|
||||||
# include STL_STRING
|
# include STL_STRING
|
||||||
# include <iosfwd>
|
|
||||||
# include STL_FSTREAM
|
# include STL_FSTREAM
|
||||||
|
# include STL_IOSTREAM
|
||||||
|
SG_USING_STD(string);
|
||||||
|
SG_USING_STD(ostream);
|
||||||
|
SG_USING_STD(istream);
|
||||||
|
SG_USING_STD(cerr);
|
||||||
|
SG_USING_STD(cout);
|
||||||
|
SG_USING_STD(endl);
|
||||||
#else
|
#else
|
||||||
# include <string>
|
# include <string>
|
||||||
# if defined(sgi) && !defined(__GNUC__) && (_COMPILER_VERSION < 740)
|
# if defined(sgi) && !defined(__GNUC__) && (_COMPILER_VERSION < 740)
|
||||||
|
@ -60,10 +66,16 @@ INCLUDES
|
||||||
# else
|
# else
|
||||||
# include <cmath>
|
# include <cmath>
|
||||||
# endif
|
# endif
|
||||||
|
using std::ostream;
|
||||||
|
using std::istream;
|
||||||
|
using std::cerr;
|
||||||
|
using std::cout;
|
||||||
|
using std::endl;
|
||||||
# if !(defined(_MSC_VER) && _MSC_VER <= 1200)
|
# if !(defined(_MSC_VER) && _MSC_VER <= 1200)
|
||||||
using std::sqrt;
|
using std::sqrt;
|
||||||
# endif
|
# endif
|
||||||
# endif
|
# endif
|
||||||
|
using std::string;
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#include "FGJSBBase.h"
|
#include "FGJSBBase.h"
|
||||||
|
@ -162,7 +174,7 @@ public:
|
||||||
/** Prints the contents of the vector
|
/** Prints the contents of the vector
|
||||||
@param delimeter the item separator (tab or comma)
|
@param delimeter the item separator (tab or comma)
|
||||||
@return a string with the delimeter-separated contents of the vector */
|
@return a string with the delimeter-separated contents of the vector */
|
||||||
std::string Dump(std::string delimeter) const;
|
string Dump(string delimeter) const;
|
||||||
|
|
||||||
/** Assignment operator.
|
/** Assignment operator.
|
||||||
@param b source vector.
|
@param b source vector.
|
||||||
|
@ -304,7 +316,7 @@ inline FGColumnVector3 operator*(double scalar, const FGColumnVector3& A) {
|
||||||
@param os Stream to write to.
|
@param os Stream to write to.
|
||||||
@param M Matrix to write.
|
@param M Matrix to write.
|
||||||
Write the matrix to a stream.*/
|
Write the matrix to a stream.*/
|
||||||
std::ostream& operator<<(std::ostream& os, const FGColumnVector3& col);
|
ostream& operator<<(ostream& os, const FGColumnVector3& col);
|
||||||
|
|
||||||
} // namespace JSBSim
|
} // namespace JSBSim
|
||||||
|
|
||||||
|
|
|
@ -34,8 +34,6 @@ COMMENTS, REFERENCES, and NOTES
|
||||||
INCLUDES
|
INCLUDES
|
||||||
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%*/
|
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%*/
|
||||||
|
|
||||||
#include <iostream>
|
|
||||||
|
|
||||||
#include "FGCondition.h"
|
#include "FGCondition.h"
|
||||||
|
|
||||||
namespace JSBSim {
|
namespace JSBSim {
|
||||||
|
@ -43,11 +41,6 @@ namespace JSBSim {
|
||||||
static const char *IdSrc = "$Id$";
|
static const char *IdSrc = "$Id$";
|
||||||
static const char *IdHdr = ID_CONDITION;
|
static const char *IdHdr = ID_CONDITION;
|
||||||
|
|
||||||
using std::cerr;
|
|
||||||
using std::cout;
|
|
||||||
using std::endl;
|
|
||||||
using std::vector;
|
|
||||||
|
|
||||||
/*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
|
/*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
|
||||||
CLASS IMPLEMENTATION
|
CLASS IMPLEMENTATION
|
||||||
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%*/
|
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%*/
|
||||||
|
|
|
@ -38,8 +38,6 @@ INCLUDES
|
||||||
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%*/
|
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%*/
|
||||||
|
|
||||||
#include <map>
|
#include <map>
|
||||||
#include <string>
|
|
||||||
|
|
||||||
#include <FGJSBBase.h>
|
#include <FGJSBBase.h>
|
||||||
#include <input_output/FGXMLElement.h>
|
#include <input_output/FGXMLElement.h>
|
||||||
#include <input_output/FGPropertyManager.h>
|
#include <input_output/FGPropertyManager.h>
|
||||||
|
@ -71,7 +69,7 @@ class FGCondition : public FGJSBBase
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
FGCondition(Element* element, FGPropertyManager* PropertyManager);
|
FGCondition(Element* element, FGPropertyManager* PropertyManager);
|
||||||
FGCondition(std::string test, FGPropertyManager* PropertyManager);
|
FGCondition(string test, FGPropertyManager* PropertyManager);
|
||||||
~FGCondition(void);
|
~FGCondition(void);
|
||||||
|
|
||||||
bool Evaluate(void);
|
bool Evaluate(void);
|
||||||
|
@ -80,18 +78,18 @@ public:
|
||||||
private:
|
private:
|
||||||
enum eComparison {ecUndef=0, eEQ, eNE, eGT, eGE, eLT, eLE};
|
enum eComparison {ecUndef=0, eEQ, eNE, eGT, eGE, eLT, eLE};
|
||||||
enum eLogic {elUndef=0, eAND, eOR};
|
enum eLogic {elUndef=0, eAND, eOR};
|
||||||
std::map <std::string, eComparison> mComparison;
|
map <string, eComparison> mComparison;
|
||||||
eLogic Logic;
|
eLogic Logic;
|
||||||
|
|
||||||
FGPropertyManager *TestParam1, *TestParam2, *PropertyManager;
|
FGPropertyManager *TestParam1, *TestParam2, *PropertyManager;
|
||||||
double TestValue;
|
double TestValue;
|
||||||
eComparison Comparison;
|
eComparison Comparison;
|
||||||
bool isGroup;
|
bool isGroup;
|
||||||
std::string conditional;
|
string conditional;
|
||||||
|
|
||||||
static std::string indent;
|
static string indent;
|
||||||
|
|
||||||
std::vector <FGCondition> conditions;
|
vector <FGCondition> conditions;
|
||||||
void InitializeConditionals(void);
|
void InitializeConditionals(void);
|
||||||
|
|
||||||
void Debug(int from);
|
void Debug(int from);
|
||||||
|
|
|
@ -29,7 +29,6 @@ INCLUDES
|
||||||
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%*/
|
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%*/
|
||||||
|
|
||||||
#include <stdio.h>
|
#include <stdio.h>
|
||||||
#include <iostream>
|
|
||||||
|
|
||||||
#include "FGFunction.h"
|
#include "FGFunction.h"
|
||||||
#include "FGTable.h"
|
#include "FGTable.h"
|
||||||
|
@ -41,9 +40,6 @@ namespace JSBSim {
|
||||||
static const char *IdSrc = "$Id$";
|
static const char *IdSrc = "$Id$";
|
||||||
static const char *IdHdr = ID_FUNCTION;
|
static const char *IdHdr = ID_FUNCTION;
|
||||||
|
|
||||||
using std::cerr;
|
|
||||||
using std::cout;
|
|
||||||
|
|
||||||
/*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
|
/*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
|
||||||
CLASS IMPLEMENTATION
|
CLASS IMPLEMENTATION
|
||||||
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%*/
|
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%*/
|
||||||
|
|
|
@ -180,7 +180,7 @@ public:
|
||||||
void cacheValue(bool shouldCache);
|
void cacheValue(bool shouldCache);
|
||||||
|
|
||||||
private:
|
private:
|
||||||
std::vector <FGParameter*> Parameters;
|
vector <FGParameter*> Parameters;
|
||||||
FGPropertyManager* const PropertyManager;
|
FGPropertyManager* const PropertyManager;
|
||||||
bool cached;
|
bool cached;
|
||||||
string Prefix;
|
string Prefix;
|
||||||
|
|
|
@ -45,9 +45,6 @@ namespace JSBSim {
|
||||||
static const char *IdSrc = "$Id$";
|
static const char *IdSrc = "$Id$";
|
||||||
static const char *IdHdr = ID_MATRIX33;
|
static const char *IdHdr = ID_MATRIX33;
|
||||||
|
|
||||||
using std::cout;
|
|
||||||
using std::endl;
|
|
||||||
|
|
||||||
/*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
|
/*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
|
||||||
CLASS IMPLEMENTATION
|
CLASS IMPLEMENTATION
|
||||||
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%*/
|
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%*/
|
||||||
|
@ -64,7 +61,7 @@ FGMatrix33::FGMatrix33(void)
|
||||||
|
|
||||||
//%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
|
//%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
|
||||||
|
|
||||||
std::ostream& operator<<(std::ostream& os, const FGMatrix33& M)
|
ostream& operator<<(ostream& os, const FGMatrix33& M)
|
||||||
{
|
{
|
||||||
for (unsigned int i=1; i<=M.Rows(); i++) {
|
for (unsigned int i=1; i<=M.Rows(); i++) {
|
||||||
for (unsigned int j=1; j<=M.Cols(); j++) {
|
for (unsigned int j=1; j<=M.Cols(); j++) {
|
||||||
|
@ -79,7 +76,7 @@ std::ostream& operator<<(std::ostream& os, const FGMatrix33& M)
|
||||||
|
|
||||||
//%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
|
//%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
|
||||||
|
|
||||||
std::istream& operator>>(std::istream& is, FGMatrix33& M)
|
istream& operator>>(istream& is, FGMatrix33& M)
|
||||||
{
|
{
|
||||||
for (unsigned int i=1; i<=M.Rows(); i++) {
|
for (unsigned int i=1; i<=M.Rows(); i++) {
|
||||||
for (unsigned int j=1; j<=M.Cols(); j++) {
|
for (unsigned int j=1; j<=M.Cols(); j++) {
|
||||||
|
|
|
@ -45,7 +45,14 @@ INCLUDES
|
||||||
# include <math.h>
|
# include <math.h>
|
||||||
# include <simgear/compiler.h>
|
# include <simgear/compiler.h>
|
||||||
# include STL_STRING
|
# include STL_STRING
|
||||||
# include <iosfwd>
|
# include STL_FSTREAM
|
||||||
|
# include STL_IOSTREAM
|
||||||
|
SG_USING_STD(string);
|
||||||
|
SG_USING_STD(ostream);
|
||||||
|
SG_USING_STD(istream);
|
||||||
|
SG_USING_STD(cerr);
|
||||||
|
SG_USING_STD(cout);
|
||||||
|
SG_USING_STD(endl);
|
||||||
#else
|
#else
|
||||||
# include <string>
|
# include <string>
|
||||||
# if defined(sgi) && !defined(__GNUC__) && (_COMPILER_VERSION < 740)
|
# if defined(sgi) && !defined(__GNUC__) && (_COMPILER_VERSION < 740)
|
||||||
|
@ -54,13 +61,19 @@ INCLUDES
|
||||||
# include <math.h>
|
# include <math.h>
|
||||||
# else
|
# else
|
||||||
# include <fstream>
|
# include <fstream>
|
||||||
# include <iosfwd>
|
# include <iostream>
|
||||||
# if defined(sgi) && !defined(__GNUC__)
|
# if defined(sgi) && !defined(__GNUC__)
|
||||||
# include <math.h>
|
# include <math.h>
|
||||||
# else
|
# else
|
||||||
# include <cmath>
|
# include <cmath>
|
||||||
# endif
|
# endif
|
||||||
|
using std::ostream;
|
||||||
|
using std::istream;
|
||||||
|
using std::cerr;
|
||||||
|
using std::cout;
|
||||||
|
using std::endl;
|
||||||
# endif
|
# endif
|
||||||
|
using std::string;
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#include "FGColumnVector3.h"
|
#include "FGColumnVector3.h"
|
||||||
|
@ -94,7 +107,7 @@ DECLARATION: MatrixException
|
||||||
class MatrixException : public FGJSBBase
|
class MatrixException : public FGJSBBase
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
std::string Message;
|
string Message;
|
||||||
};
|
};
|
||||||
|
|
||||||
/*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
|
/*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
|
||||||
|
@ -460,7 +473,7 @@ inline FGMatrix33 operator*(double scalar, const FGMatrix33& A) {
|
||||||
|
|
||||||
Write the matrix to a stream.
|
Write the matrix to a stream.
|
||||||
*/
|
*/
|
||||||
std::ostream& operator<<(std::ostream& os, const FGMatrix33& M);
|
ostream& operator<<(ostream& os, const FGMatrix33& M);
|
||||||
|
|
||||||
/** Read matrix from a stream.
|
/** Read matrix from a stream.
|
||||||
|
|
||||||
|
@ -469,7 +482,7 @@ std::ostream& operator<<(std::ostream& os, const FGMatrix33& M);
|
||||||
|
|
||||||
Read matrix from a stream.
|
Read matrix from a stream.
|
||||||
*/
|
*/
|
||||||
std::istream& operator>>(std::istream& is, FGMatrix33& M);
|
istream& operator>>(istream& is, FGMatrix33& M);
|
||||||
|
|
||||||
} // namespace JSBSim
|
} // namespace JSBSim
|
||||||
|
|
||||||
|
|
|
@ -165,20 +165,20 @@ public:
|
||||||
/** Gets the strings for the current set of coefficients.
|
/** Gets the strings for the current set of coefficients.
|
||||||
@param delimeter either a tab or comma string depending on output type
|
@param delimeter either a tab or comma string depending on output type
|
||||||
@return a string containing the descriptive names for all coefficients */
|
@return a string containing the descriptive names for all coefficients */
|
||||||
std::string GetCoefficientStrings(std::string delimeter);
|
string GetCoefficientStrings(string delimeter);
|
||||||
|
|
||||||
/** Gets the coefficient values.
|
/** Gets the coefficient values.
|
||||||
@param delimeter either a tab or comma string depending on output type
|
@param delimeter either a tab or comma string depending on output type
|
||||||
@return a string containing the numeric values for the current set of
|
@return a string containing the numeric values for the current set of
|
||||||
coefficients */
|
coefficients */
|
||||||
std::string GetCoefficientValues(std::string delimeter);
|
string GetCoefficientValues(string delimeter);
|
||||||
|
|
||||||
private:
|
private:
|
||||||
typedef std::map<std::string,int> AxisIndex;
|
typedef map<string,int> AxisIndex;
|
||||||
AxisIndex AxisIdx;
|
AxisIndex AxisIdx;
|
||||||
FGFunction* AeroRPShift;
|
FGFunction* AeroRPShift;
|
||||||
std::vector <FGFunction*> variables;
|
vector <FGFunction*> variables;
|
||||||
typedef std::vector <FGFunction*> CoeffArray;
|
typedef vector <FGFunction*> CoeffArray;
|
||||||
CoeffArray* Coeff;
|
CoeffArray* Coeff;
|
||||||
FGColumnVector3 vFs;
|
FGColumnVector3 vFs;
|
||||||
FGColumnVector3 vForces;
|
FGColumnVector3 vForces;
|
||||||
|
|
|
@ -46,9 +46,6 @@ namespace JSBSim {
|
||||||
static const char *IdSrc = "$Id$";
|
static const char *IdSrc = "$Id$";
|
||||||
static const char *IdHdr = ID_GROUNDREACTIONS;
|
static const char *IdHdr = ID_GROUNDREACTIONS;
|
||||||
|
|
||||||
using std::ostringstream;
|
|
||||||
using std::setprecision;
|
|
||||||
|
|
||||||
/*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
|
/*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
|
||||||
CLASS IMPLEMENTATION
|
CLASS IMPLEMENTATION
|
||||||
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%*/
|
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%*/
|
||||||
|
@ -142,7 +139,7 @@ bool FGGroundReactions::Load(Element* el)
|
||||||
|
|
||||||
string FGGroundReactions::GetGroundReactionStrings(string delimeter)
|
string FGGroundReactions::GetGroundReactionStrings(string delimeter)
|
||||||
{
|
{
|
||||||
ostringstream buf;
|
std::ostringstream buf;
|
||||||
|
|
||||||
for (unsigned int i=0;i<lGear.size();i++) {
|
for (unsigned int i=0;i<lGear.size();i++) {
|
||||||
if (lGear[i].IsBogey()) {
|
if (lGear[i].IsBogey()) {
|
||||||
|
|
|
@ -42,6 +42,16 @@ INCLUDES
|
||||||
|
|
||||||
#ifdef FGFS
|
#ifdef FGFS
|
||||||
# include <simgear/compiler.h>
|
# include <simgear/compiler.h>
|
||||||
|
# include STL_IOSTREAM
|
||||||
|
# include STL_FSTREAM
|
||||||
|
#else
|
||||||
|
# if defined(sgi) && !defined(__GNUC__) && (_COMPILER_VERSION < 740)
|
||||||
|
# include <iostream.h>
|
||||||
|
# include <fstream.h>
|
||||||
|
# else
|
||||||
|
# include <iostream>
|
||||||
|
# include <fstream>
|
||||||
|
# endif
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#include <input_output/FGfdmSocket.h>
|
#include <input_output/FGfdmSocket.h>
|
||||||
|
|
|
@ -38,8 +38,6 @@ HISTORY
|
||||||
INCLUDES
|
INCLUDES
|
||||||
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%*/
|
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%*/
|
||||||
|
|
||||||
#include <algorithm>
|
|
||||||
|
|
||||||
#include "FGLGear.h"
|
#include "FGLGear.h"
|
||||||
|
|
||||||
namespace JSBSim {
|
namespace JSBSim {
|
||||||
|
@ -652,11 +650,11 @@ void FGLGear::ComputeVerticalStrutForce(void)
|
||||||
} else {
|
} else {
|
||||||
dampForce = -compressSpeed * bDampRebound;
|
dampForce = -compressSpeed * bDampRebound;
|
||||||
}
|
}
|
||||||
vLocalForce(eZ) = std::min(springForce + dampForce, (double)0.0);
|
vLocalForce(eZ) = min(springForce + dampForce, (double)0.0);
|
||||||
|
|
||||||
// Remember these values for reporting
|
// Remember these values for reporting
|
||||||
MaximumStrutForce = std::max(MaximumStrutForce, fabs(vLocalForce(eZ)));
|
MaximumStrutForce = max(MaximumStrutForce, fabs(vLocalForce(eZ)));
|
||||||
MaximumStrutTravel = std::max(MaximumStrutTravel, fabs(compressLength));
|
MaximumStrutTravel = max(MaximumStrutTravel, fabs(compressLength));
|
||||||
}
|
}
|
||||||
|
|
||||||
//%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
|
//%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
|
||||||
|
|
|
@ -154,7 +154,7 @@ private:
|
||||||
double Weight;
|
double Weight;
|
||||||
};
|
};
|
||||||
|
|
||||||
std::vector <struct PointMass> PointMasses;
|
vector <struct PointMass> PointMasses;
|
||||||
|
|
||||||
void Debug(int from);
|
void Debug(int from);
|
||||||
};
|
};
|
||||||
|
|
|
@ -44,6 +44,17 @@ INCLUDES
|
||||||
|
|
||||||
#ifdef FGFS
|
#ifdef FGFS
|
||||||
# include <simgear/compiler.h>
|
# include <simgear/compiler.h>
|
||||||
|
# ifdef SG_HAVE_STD_INCLUDES
|
||||||
|
# include <iostream>
|
||||||
|
# else
|
||||||
|
# include <iostream.h>
|
||||||
|
# endif
|
||||||
|
#else
|
||||||
|
# if defined(sgi) && !defined(__GNUC__) && (_COMPILER_VERSION < 740)
|
||||||
|
# include <iostream.h>
|
||||||
|
# else
|
||||||
|
# include <iostream>
|
||||||
|
# endif
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#include <string>
|
#include <string>
|
||||||
|
@ -54,6 +65,8 @@ DEFINITIONS
|
||||||
|
|
||||||
#define ID_MODEL "$Id$"
|
#define ID_MODEL "$Id$"
|
||||||
|
|
||||||
|
using namespace std;
|
||||||
|
|
||||||
/*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
|
/*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
|
||||||
FORWARD DECLARATIONS
|
FORWARD DECLARATIONS
|
||||||
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%*/
|
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%*/
|
||||||
|
@ -100,7 +113,7 @@ public:
|
||||||
virtual bool Load(Element* el) {return true;}
|
virtual bool Load(Element* el) {return true;}
|
||||||
|
|
||||||
FGModel* NextModel;
|
FGModel* NextModel;
|
||||||
std::string Name;
|
string Name;
|
||||||
|
|
||||||
/** Runs the model; called by the Executive
|
/** Runs the model; called by the Executive
|
||||||
@see JSBSim.cpp documentation
|
@see JSBSim.cpp documentation
|
||||||
|
|
|
@ -59,8 +59,6 @@ namespace JSBSim {
|
||||||
static const char *IdSrc = "$Id$";
|
static const char *IdSrc = "$Id$";
|
||||||
static const char *IdHdr = ID_OUTPUT;
|
static const char *IdHdr = ID_OUTPUT;
|
||||||
|
|
||||||
using std::setprecision;
|
|
||||||
|
|
||||||
/*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
|
/*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
|
||||||
CLASS IMPLEMENTATION
|
CLASS IMPLEMENTATION
|
||||||
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%*/
|
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%*/
|
||||||
|
|
|
@ -42,18 +42,18 @@ INCLUDES
|
||||||
|
|
||||||
#ifdef FGFS
|
#ifdef FGFS
|
||||||
# include <simgear/compiler.h>
|
# include <simgear/compiler.h>
|
||||||
|
# include STL_IOSTREAM
|
||||||
# include STL_FSTREAM
|
# include STL_FSTREAM
|
||||||
#else
|
#else
|
||||||
# if defined(sgi) && !defined(__GNUC__) && (_COMPILER_VERSION < 740)
|
# if defined(sgi) && !defined(__GNUC__) && (_COMPILER_VERSION < 740)
|
||||||
|
# include <iostream.h>
|
||||||
# include <fstream.h>
|
# include <fstream.h>
|
||||||
# else
|
# else
|
||||||
|
# include <iostream>
|
||||||
# include <fstream>
|
# include <fstream>
|
||||||
# endif
|
# endif
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#include <string>
|
|
||||||
#include <vector>
|
|
||||||
|
|
||||||
#include <input_output/FGfdmSocket.h>
|
#include <input_output/FGfdmSocket.h>
|
||||||
#include <input_output/FGXMLFileRead.h>
|
#include <input_output/FGXMLFileRead.h>
|
||||||
|
|
||||||
|
@ -165,10 +165,10 @@ private:
|
||||||
enum {otNone, otCSV, otTab, otSocket, otTerminal, otUnknown} Type;
|
enum {otNone, otCSV, otTab, otSocket, otTerminal, otUnknown} Type;
|
||||||
bool sFirstPass, dFirstPass, enabled;
|
bool sFirstPass, dFirstPass, enabled;
|
||||||
int SubSystems;
|
int SubSystems;
|
||||||
std::string output_file_name, delimeter, Filename, DirectivesFile;
|
string output_file_name, delimeter, Filename, DirectivesFile;
|
||||||
std::ofstream datafile;
|
ofstream datafile;
|
||||||
FGfdmSocket* socket;
|
FGfdmSocket* socket;
|
||||||
std::vector <FGPropertyManager*> OutputProperties;
|
vector <FGPropertyManager*> OutputProperties;
|
||||||
|
|
||||||
void Debug(int from);
|
void Debug(int from);
|
||||||
};
|
};
|
||||||
|
|
|
@ -62,7 +62,6 @@ static const char *IdHdr = ID_PROPULSION;
|
||||||
|
|
||||||
extern short debug_lvl;
|
extern short debug_lvl;
|
||||||
|
|
||||||
using std::ifstream;
|
|
||||||
|
|
||||||
/*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
|
/*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
|
||||||
CLASS IMPLEMENTATION
|
CLASS IMPLEMENTATION
|
||||||
|
|
|
@ -153,8 +153,8 @@ public:
|
||||||
be done before calling this (i.e. magnetos, starter engage, etc.) */
|
be done before calling this (i.e. magnetos, starter engage, etc.) */
|
||||||
bool ICEngineStart(void);
|
bool ICEngineStart(void);
|
||||||
|
|
||||||
std::string GetPropulsionStrings(std::string delimeter);
|
string GetPropulsionStrings(string delimeter);
|
||||||
std::string GetPropulsionValues(std::string delimeter);
|
string GetPropulsionValues(string delimeter);
|
||||||
|
|
||||||
inline FGColumnVector3& GetForces(void) {return vForces; }
|
inline FGColumnVector3& GetForces(void) {return vForces; }
|
||||||
inline double GetForces(int n) const { return vForces(n);}
|
inline double GetForces(int n) const { return vForces(n);}
|
||||||
|
@ -169,8 +169,8 @@ public:
|
||||||
FGColumnVector3& GetTanksMoment(void);
|
FGColumnVector3& GetTanksMoment(void);
|
||||||
double GetTanksWeight(void);
|
double GetTanksWeight(void);
|
||||||
|
|
||||||
std::ifstream* FindEngineFile(std::string filename);
|
ifstream* FindEngineFile(string filename);
|
||||||
std::string FindEngineFullPathname(std::string engine_filename);
|
string FindEngineFullPathname(string engine_filename);
|
||||||
inline int GetActiveEngine(void) const {return ActiveEngine;}
|
inline int GetActiveEngine(void) const {return ActiveEngine;}
|
||||||
inline bool GetFuelFreeze(void) {return fuel_freeze;}
|
inline bool GetFuelFreeze(void) {return fuel_freeze;}
|
||||||
double GetTotalFuelQuantity(void) const {return TotalFuelQuantity;}
|
double GetTotalFuelQuantity(void) const {return TotalFuelQuantity;}
|
||||||
|
@ -186,9 +186,9 @@ public:
|
||||||
void unbind();
|
void unbind();
|
||||||
|
|
||||||
private:
|
private:
|
||||||
std::vector <FGEngine*> Engines;
|
vector <FGEngine*> Engines;
|
||||||
std::vector <FGTank*> Tanks;
|
vector <FGTank*> Tanks;
|
||||||
std::vector <FGTank*>::iterator iTank;
|
vector <FGTank*>::iterator iTank;
|
||||||
unsigned int numSelectedFuelTanks;
|
unsigned int numSelectedFuelTanks;
|
||||||
unsigned int numSelectedOxiTanks;
|
unsigned int numSelectedOxiTanks;
|
||||||
unsigned int numFuelTanks;
|
unsigned int numFuelTanks;
|
||||||
|
|
|
@ -37,8 +37,6 @@ COMMENTS, REFERENCES, and NOTES
|
||||||
INCLUDES
|
INCLUDES
|
||||||
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%*/
|
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%*/
|
||||||
|
|
||||||
#include <algorithm>
|
|
||||||
|
|
||||||
#include "FGActuator.h"
|
#include "FGActuator.h"
|
||||||
|
|
||||||
namespace JSBSim {
|
namespace JSBSim {
|
||||||
|
@ -155,9 +153,9 @@ void FGActuator::Hysteresis(void)
|
||||||
double input = Output;
|
double input = Output;
|
||||||
|
|
||||||
if (input > PreviousHystOutput) {
|
if (input > PreviousHystOutput) {
|
||||||
Output = std::max(PreviousHystOutput, input-0.5*hysteresis_width);
|
Output = max(PreviousHystOutput, input-0.5*hysteresis_width);
|
||||||
} else if (input < PreviousHystOutput) {
|
} else if (input < PreviousHystOutput) {
|
||||||
Output = std::min(PreviousHystOutput, input+0.5*hysteresis_width);
|
Output = min(PreviousHystOutput, input+0.5*hysteresis_width);
|
||||||
}
|
}
|
||||||
|
|
||||||
PreviousHystOutput = Output;
|
PreviousHystOutput = Output;
|
||||||
|
|
|
@ -53,6 +53,8 @@ DEFINITIONS
|
||||||
|
|
||||||
#define ID_FCSCOMPONENT "$Id$"
|
#define ID_FCSCOMPONENT "$Id$"
|
||||||
|
|
||||||
|
using std::string;
|
||||||
|
|
||||||
/*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
|
/*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
|
||||||
FORWARD DECLARATIONS
|
FORWARD DECLARATIONS
|
||||||
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%*/
|
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%*/
|
||||||
|
@ -101,8 +103,8 @@ public:
|
||||||
virtual void SetOutput(void);
|
virtual void SetOutput(void);
|
||||||
inline double GetOutput (void) const {return Output;}
|
inline double GetOutput (void) const {return Output;}
|
||||||
inline FGPropertyManager* GetOutputNode(void) { return OutputNode; }
|
inline FGPropertyManager* GetOutputNode(void) { return OutputNode; }
|
||||||
inline std::string GetName(void) const {return Name;}
|
inline string GetName(void) const {return Name;}
|
||||||
inline std::string GetType(void) const { return Type; }
|
inline string GetType(void) const { return Type; }
|
||||||
virtual double GetOutputPct(void) const { return 0; }
|
virtual double GetOutputPct(void) const { return 0; }
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
|
@ -112,10 +114,10 @@ protected:
|
||||||
FGPropertyManager* OutputNode;
|
FGPropertyManager* OutputNode;
|
||||||
FGPropertyManager* ClipMinPropertyNode;
|
FGPropertyManager* ClipMinPropertyNode;
|
||||||
FGPropertyManager* ClipMaxPropertyNode;
|
FGPropertyManager* ClipMaxPropertyNode;
|
||||||
std::vector <FGPropertyManager*> InputNodes;
|
vector <FGPropertyManager*> InputNodes;
|
||||||
std::vector <float> InputSigns;
|
vector <float> InputSigns;
|
||||||
std::string Type;
|
string Type;
|
||||||
std::string Name;
|
string Name;
|
||||||
double Input;
|
double Input;
|
||||||
double Output;
|
double Output;
|
||||||
double clipmax, clipmin;
|
double clipmax, clipmin;
|
||||||
|
|
|
@ -250,7 +250,7 @@ bool FGEngine::LoadThruster(Element *thruster_element)
|
||||||
double P_Factor = 0, Sense = 0.0;
|
double P_Factor = 0, Sense = 0.0;
|
||||||
string enginePath = FDMExec->GetEnginePath();
|
string enginePath = FDMExec->GetEnginePath();
|
||||||
string aircraftPath = FDMExec->GetFullAircraftPath();
|
string aircraftPath = FDMExec->GetFullAircraftPath();
|
||||||
std::ifstream thruster_file;
|
ifstream thruster_file;
|
||||||
FGColumnVector3 location, orientation;
|
FGColumnVector3 location, orientation;
|
||||||
string separator = "/";
|
string separator = "/";
|
||||||
|
|
||||||
|
|
Loading…
Add table
Reference in a new issue