Irix patches.
Position = fdmex->GetPosition();
Auxiliary = fdmex->GetAuxiliary();
Aerodynamics = fdmex->GetAerodynamics();
-
+
+ Atmosphere->UseInternal();
+
fgic=new FGInitialCondition(fdmex);
needTrim=true;
// each subsequent iteration through the EOM
void FGJSBsim::init() {
- // Explicitly call the superclass's
- // init method first.
- FGInterface::init();
-
- bool result;
-
+
SG_LOG( SG_FLIGHT, SG_INFO, "Starting and initializing JSBsim" );
-
- Atmosphere->UseInternal();
+
+ // Explicitly call the superclass's
+ // init method first.
+ FGInterface::init();
SG_LOG( SG_FLIGHT, SG_INFO, " Initializing JSBSim with:" );
AC_cfg->GetNextConfigLine();
- while ((token = AC_cfg->GetValue()) != string("/AERODYNAMICS")) {
+ while ((token = AC_cfg->GetValue()) != "/AERODYNAMICS") {
if (token == "AXIS") {
CoeffArray ca;
axis = AC_cfg->GetValue("NAME");
AC_cfg->GetNextConfigLine();
- while ((token = AC_cfg->GetValue()) != string("/AXIS")) {
+ while ((token = AC_cfg->GetValue()) != "/AXIS") {
ca.push_back(new FGCoefficient(FDMExec, AC_cfg));
if (debug_lvl > 0) DisplayCoeffFactors(ca.back()->Getmultipliers());
}
ReadPrologue(&AC_cfg);
- while ((AC_cfg.GetNextConfigLine() != string("EOF")) &&
- (token = AC_cfg.GetValue()) != string("/FDM_CONFIG")) {
+ while ((AC_cfg.GetNextConfigLine() != "EOF") &&
+ (token = AC_cfg.GetValue()) != "/FDM_CONFIG") {
if (token == "METRICS") {
if (debug_lvl > 0) cout << fgcyan << "\n Reading Metrics" << fgdef << endl;
ReadMetrics(&AC_cfg);
AC_cfg->GetNextConfigLine();
- while ((token = AC_cfg->GetValue()) != string("/METRICS")) {
+ while ((token = AC_cfg->GetValue()) != "/METRICS") {
*AC_cfg >> parameter;
- if (parameter == string("AC_WINGAREA")) {
+ if (parameter == "AC_WINGAREA") {
*AC_cfg >> WingArea;
if (debug_lvl > 0) cout << " WingArea: " << WingArea << endl;
} else if (parameter == "AC_WINGSPAN") {
AC_cfg->GetNextConfigLine();
- while ((token = AC_cfg->GetValue()) != string("/UNDERCARRIAGE")) {
+ while ((token = AC_cfg->GetValue()) != "/UNDERCARRIAGE") {
lGear.push_back(FGLGear(AC_cfg, FDMExec));
}
}
Output->SetType(token);
AC_cfg->GetNextConfigLine();
- while ((token = AC_cfg->GetValue()) != string("/OUTPUT")) {
+ while ((token = AC_cfg->GetValue()) != "/OUTPUT") {
*AC_cfg >> parameter;
if (parameter == "RATE_IN_HZ") *AC_cfg >> OutRate;
if (parameter == "SIMULATION") {
if (debug_lvl > 0)
cout << " Version: " << highint << CFGVersion
<< normint << endl;
- if (CFGVersion != string(NEEDED_CFG_VERSION)) {
+ if (CFGVersion != NEEDED_CFG_VERSION) {
cerr << endl << fgred << "YOU HAVE AN INCOMPATIBLE CFG FILE FOR THIS AIRCRAFT."
" RESULTS WILL BE UNPREDICTABLE !!" << endl;
cerr << "Current version needed is: " << NEEDED_CFG_VERSION << endl;
FGConfigFile::FGConfigFile(string cfgFileName)
{
+#if defined ( sgi ) && !defined( __GNUC__ )
+ cfgfile.open(cfgFileName.c_str(), ios::in );
+#else
cfgfile.open(cfgFileName.c_str(), ios::in | ios::binary );
+#endif
CommentsOn = false;
CurrentIndex = 0;
Opened = true;
+#if defined ( sgi ) && !defined( __GNUC__ )
+ if (!cfgfile.fail() && !cfgfile.eof()) GetNextConfigLine();
+#else
if (cfgfile.is_open()) GetNextConfigLine();
+#endif
else Opened = false;
if (debug_lvl & 2) cout << "Instantiated: FGConfigFile" << endl;
scratch += (char)test;
} else {
if ((test = cfgfile.get()) != EOF) {
+#if defined ( sgi ) && !defined( __GNUC__ )
+ if (test >= 0x20) cfgfile.putback(test);
+#else
if (test >= 0x20) cfgfile.unget();
+#endif
break;
}
}
# include STL_FSTREAM
# include STL_IOSTREAM
SG_USING_STD(string);
- SG_USING_STD(ostream);
- SG_USING_STD(istream);
- SG_USING_STD(ifstream);
- SG_USING_STD(cerr);
- SG_USING_STD(endl);
- SG_USING_STD(ios);
- SG_USING_STD(cout);
+# if !defined(SG_HAVE_NATIVE_SGI_COMPILERS)
+ SG_USING_STD(ostream);
+ SG_USING_STD(istream);
+ SG_USING_STD(ifstream);
+ SG_USING_STD(cerr);
+ SG_USING_STD(endl);
+ SG_USING_STD(ios);
+ SG_USING_STD(cout);
+# endif
#else
# include <fstream>
# include <iostream>
#define HPTOFTLBSSEC 550
#define METERS_TO_FEET 3.2808
+#if defined ( sgi ) && !defined( __GNUC__ )
+#define __STL_FUNCTION_TMPL_PARTIAL_ORDER
+#endif
+
enum eParam {
FG_UNDEF = 0,
FG_TIME,
INCLUDES
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%*/
+#include "FGDefs.h"
+
#include "FGFCS.h"
#include "FGState.h"
#include "FGFDMExec.h"
# 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);
+# if !defined(SG_HAVE_NATIVE_SGI_COMPILERS)
+ SG_USING_STD(ostream);
+ SG_USING_STD(istream);
+ SG_USING_STD(cerr);
+ SG_USING_STD(cout);
+ SG_USING_STD(endl);
+# endif
#else
# include <fstream>
# include <cmath>
INCLUDES
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%*/
+#include "FGDefs.h"
#include "FGPiston.h"
static const char *IdSrc = "$Id$";
INCLUDES
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%*/
+#include "FGDefs.h"
#include "FGRocket.h"
static const char *IdSrc = "$Id$";
resetDef = path + "/" + acname + "/" + fname + ".xml";
+#if defined ( sgi ) && !defined( __GNUC__ )
+ ifstream resetfile(resetDef.c_str(), ios::in );
+#else
ifstream resetfile(resetDef.c_str(), ios::in | ios::binary );
+#endif
if (resetfile) {
resetfile >> U;
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%*/
#include "FGTable.h"
+
+#if defined ( sgi ) && !defined( __GNUC__ )
+#include <iomanip.h>
+#else
#include <iomanip>
+#endif
static const char *IdSrc = "$Id$";
static const char *IdHdr = ID_TABLE;
INCLUDES
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%*/
+#include "FGDefs.h"
#include "FGTank.h"
static const char *IdSrc = "$Id$";
CLASS IMPLEMENTATION
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%*/
+#if !defined ( sgi ) || defined( __GNUC__ )
using std::cerr;
using std::endl;
using std::cout;
+#endif
FGTank::FGTank(FGConfigFile* AC_cfg)
{
# include <simgear/compiler.h>
# include STL_STRING
SG_USING_STD(string);
- SG_USING_STD(cerr);
- SG_USING_STD(endl);
- SG_USING_STD(cout);
+# if !defined(SG_HAVE_NATIVE_SGI_COMPILERS)
+ SG_USING_STD(cerr);
+ SG_USING_STD(endl);
+ SG_USING_STD(cout);
+# endif
#else
# include <string>
using std::string;
# include STL_STRING
# include STL_IOSTREAM
# include STL_FSTREAM
- SG_USING_STD(cout);
- SG_USING_STD(endl);
+# if !defined(SG_HAVE_NATIVE_SGI_COMPILERS)
+ SG_USING_STD(cout);
+ SG_USING_STD(endl);
+# endif
#else
# include <iostream>
# include <fstream>
lsic=new LaRCsimIC; //this needs to be brought up after LaRCsim is
copy_to_LaRCsim(); // initialize all of LaRCsim's vars
+
//this should go away someday -- formerly done in fg_init.cxx
Mass = 8.547270E+01;
I_xx = 1.048000E+03;
I_yy = 3.000000E+03;
I_zz = 3.530000E+03;
I_xz = 0.000000E+00;
- //current_aircraft.fdm_state->set_Tank1Fuel(15.0);
- //current_aircraft.fdm_state->set_Tank2Fuel(15.0);
- //Tank1Fuel = 15.0;
- //Tank2Fuel = 15.0;
-}
-
-FGLaRCsim::~FGLaRCsim(void) {
- if(lsic != NULL) {
- delete lsic;
- }
-}
-
-// Initialize the LaRCsim flight model, dt is the time increment for
-// each subsequent iteration through the EOM
-void FGLaRCsim::init() {
-
- // Explicitly call the superclass's
- // init method first.
- FGInterface::init();
-
+
ls_set_model_dt( get_delta_t() );
- // Initialize our little engine that hopefully might
+
+ // Initialize our little engine that hopefully might
eng.init( get_delta_t() );
// dcl - in passing dt to init rather than update I am assuming
// that the LaRCsim dt is fixed at one value (yes it is 120hz CLO)
set_Tank1Fuel(28.0);
set_Tank2Fuel(28.0);
- // SG_LOG( SG_FLIGHT, SG_INFO, "FGLaRCsim::init()" );
- double save_alt = 0.0;
+}
- if ( get_Altitude() < -9000.0 ) {
- save_alt = get_Altitude();
- set_Altitude( 0.0 );
+FGLaRCsim::~FGLaRCsim(void) {
+ if(lsic != NULL) {
+ delete lsic;
}
+}
- // translate FG to LaRCsim structure
- copy_to_LaRCsim();
-
- // actual LaRCsim top level init
- // ls_toplevel_init( dt, (char *)fgGetString("/sim/aircraft").c_str() );
-
- SG_LOG( SG_FLIGHT, SG_INFO, "FG pos = " <<
- get_Latitude() );
-
- // translate LaRCsim back to FG structure
- copy_from_LaRCsim();
+// Initialize the LaRCsim flight model, dt is the time increment for
+// each subsequent iteration through the EOM
+void FGLaRCsim::init() {
- // but lets restore our original bogus altitude when we are done
- if ( save_alt < -9000.0 ) {
- set_Altitude( save_alt );
- }
+ // Explicitly call the superclass's
+ // init method first.
+ FGInterface::init();
}