]> git.mxchange.org Git - flightgear.git/commitdiff
Synced to latest version of JSBSim which [hopefully] includes all of Erik's
authorcurt <curt>
Wed, 20 Jun 2001 22:29:31 +0000 (22:29 +0000)
committercurt <curt>
Wed, 20 Jun 2001 22:29:31 +0000 (22:29 +0000)
Irix patches.

16 files changed:
src/FDM/JSBSim.cxx
src/FDM/JSBSim/FGAerodynamics.cpp
src/FDM/JSBSim/FGAircraft.cpp
src/FDM/JSBSim/FGConfigFile.cpp
src/FDM/JSBSim/FGConfigFile.h
src/FDM/JSBSim/FGDefs.h
src/FDM/JSBSim/FGFCS.cpp
src/FDM/JSBSim/FGMatrix.h
src/FDM/JSBSim/FGPiston.cpp
src/FDM/JSBSim/FGRocket.cpp
src/FDM/JSBSim/FGState.cpp
src/FDM/JSBSim/FGTable.cpp
src/FDM/JSBSim/FGTank.cpp
src/FDM/JSBSim/FGTank.h
src/FDM/JSBSim/FGfdmSocket.h
src/FDM/LaRCsim.cxx

index 301f60553ee0fb64144a4af3ef2ccc9c0b7628e5..c3fa97bf123de300d7f102a030468cdee2e41ca0 100644 (file)
@@ -77,7 +77,9 @@ FGJSBsim::FGJSBsim( double dt )
     Position     = fdmex->GetPosition();
     Auxiliary    = fdmex->GetAuxiliary();
     Aerodynamics = fdmex->GetAerodynamics();
-
+    
+    Atmosphere->UseInternal();
+    
     fgic=new FGInitialCondition(fdmex);
     needTrim=true;
   
@@ -130,15 +132,12 @@ FGJSBsim::~FGJSBsim(void) {
 // 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:" );
 
index 778dd95380f263e68d9e66c52ab8d9832a311a93..1e18f3bb75ae9b5547ec63267f6a25fa6a9c29c4 100644 (file)
@@ -137,12 +137,12 @@ bool FGAerodynamics::LoadAerodynamics(FGConfigFile* AC_cfg)
 
   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());
       }
index 19294eaaf7a3403082db180371d115e4e6152523..65b863f88b45c09b86919a657ee7f2697a82d812 100644 (file)
@@ -210,8 +210,8 @@ bool FGAircraft::LoadAircraft(string aircraft_path, string engine_path, string f
 
   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);
@@ -318,9 +318,9 @@ void FGAircraft::ReadMetrics(FGConfigFile* 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") {
@@ -405,7 +405,7 @@ void FGAircraft::ReadUndercarriage(FGConfigFile* AC_cfg) {
 
   AC_cfg->GetNextConfigLine();
 
-  while ((token = AC_cfg->GetValue()) != string("/UNDERCARRIAGE")) {
+  while ((token = AC_cfg->GetValue()) != "/UNDERCARRIAGE") {
     lGear.push_back(FGLGear(AC_cfg, FDMExec));
   }
 }
@@ -423,7 +423,7 @@ void FGAircraft::ReadOutput(FGConfigFile* AC_cfg) {
   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") {
@@ -501,7 +501,7 @@ void FGAircraft::ReadPrologue(FGConfigFile* AC_cfg) {
   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;
index 2aa97e12a11928c6561489d42f5d624ddef6f7f4..4676353addbb97744c2920bb6192de34d09e284b 100644 (file)
@@ -32,11 +32,19 @@ CLASS IMPLEMENTATION
 
 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;
@@ -167,7 +175,11 @@ string FGConfigFile::GetLine(void)
       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;
       }
     }
index 5a458bea9137cb35dc9b970e0c87f7d3dba95b0d..017498970b3c2336a09fa192d3335822d8ef4483 100644 (file)
@@ -44,13 +44,15 @@ INCLUDES
 #  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>
index 72ed411dd9de1955fae7e713e4c4baf936f8f2fc..2b1ec119c4ff88f26bb0a86d19a84d79510cf9ac 100644 (file)
@@ -59,6 +59,10 @@ SENTRY
 #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,
index bb92800b6dca62d46ae57d632ba1c686e2f3a626..466e0147f0c59b6212f68fcd1b5125fc057079d9 100644 (file)
@@ -37,6 +37,8 @@ HISTORY
 INCLUDES
 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%*/
 
+#include "FGDefs.h"
+
 #include "FGFCS.h"
 #include "FGState.h"
 #include "FGFDMExec.h"
index 99673444ed604c2f8f37b2813fc04424bd460b03..9d46522e3f1096f05231b9a01714bc2856e0b576 100644 (file)
@@ -28,11 +28,13 @@ INCLUDES
 #  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>
index e60a65fa39f3e8fc63631b2fca3fc4364998ee2c..805200f18025037ef561f4ea51f3a6fd60a3635e 100644 (file)
@@ -38,6 +38,7 @@ HISTORY
 INCLUDES
 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%*/
 
+#include "FGDefs.h"
 #include "FGPiston.h"
 
 static const char *IdSrc = "$Id$";
index 080dff9d5cd825334f2a51085bfd27ca2debcad1..0b0a0c30fbb04d491bf6c069d7d358b040090fdc 100644 (file)
@@ -38,6 +38,7 @@ HISTORY
 INCLUDES
 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%*/
 
+#include "FGDefs.h"
 #include "FGRocket.h"
 
 static const char *IdSrc = "$Id$";
index 58ca50ab5c1a8f6318534c54a9732d3da4a12bb5..d97dfb439cabc98b893d099ab6733e93fffcc5d1 100644 (file)
@@ -344,7 +344,11 @@ bool FGState::Reset(string path, string acname, string fname) {
 
   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;
index 54ddab0b668565b9c30991a0a0605f336f30acf4..0ef6f324248332c3ef85f930d19a43ddd0278c21 100644 (file)
@@ -37,7 +37,12 @@ INCLUDES
 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%*/
 
 #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;
index 7162dd88ec48e9131c28ebddee3737abea84e87a..6efda682146efc58e9115b9b33496da3b7d9b8c4 100644 (file)
@@ -36,6 +36,7 @@ HISTORY
 INCLUDES
 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%*/
 
+#include "FGDefs.h"
 #include "FGTank.h"
 
 static const char *IdSrc = "$Id$";
@@ -47,9 +48,11 @@ extern short debug_lvl;
 CLASS IMPLEMENTATION
 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%*/
 
+#if !defined ( sgi ) || defined( __GNUC__ )
 using std::cerr;
 using std::endl;
 using std::cout;
+#endif
 
 FGTank::FGTank(FGConfigFile* AC_cfg)
 {
index 05790440a93079644bf4686f4111983e9d9f2c29..d70933ce99481c24ea8e10f3c4473e7484dea8ea 100644 (file)
@@ -50,9 +50,11 @@ INCLUDES
 #  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;
index 803c01f5747364e35e1b187ee01aa9f31cc73622..f2009d46f78058513616bbfd76ff0c2514f3019d 100644 (file)
@@ -49,8 +49,10 @@ INCLUDES
 #  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>
index 39e012382ff9cf394ce55b604919942285062e95..1ef2fbb68f3d124196591f946c8e5deec2c79d2a 100644 (file)
@@ -48,34 +48,17 @@ FGLaRCsim::FGLaRCsim( double dt ) {
 
     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)
@@ -91,31 +74,22 @@ void FGLaRCsim::init() {
     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();
 }