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