]> git.mxchange.org Git - flightgear.git/blobdiff - src/FDM/JSBSim/FGAircraft.cpp
Updated to latest JSBSim, including preliminary support for
[flightgear.git] / src / FDM / JSBSim / FGAircraft.cpp
index 5f0573b4f278f17fdd2ff721585519105c487755..6f61c729844766902e0c28db689d4390a0dfc269 100644 (file)
@@ -119,40 +119,6 @@ FGAircraft::~FGAircraft()
 
 //%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
 
-bool FGAircraft::Load(FGConfigFile* AC_cfg)
-{
-  string token;
-
-  if (!ReadPrologue(AC_cfg)) return false;
-
-  while ((AC_cfg->GetNextConfigLine() != string("EOF")) &&
-         (token = AC_cfg->GetValue()) != string("/FDM_CONFIG")) {
-    if (token == "METRICS") {
-      if (debug_lvl > 0) cout << fgcyan << "\n  Reading Metrics" << fgdef << endl;
-      if (!ReadMetrics(AC_cfg)) return false;
-    } else if (token == "AERODYNAMICS") {
-      if (debug_lvl > 0) cout << fgcyan << "\n  Reading Aerodynamics" << fgdef << endl;
-      if (!ReadAerodynamics(AC_cfg)) return false;
-    } else if (token == "UNDERCARRIAGE") {
-      if (debug_lvl > 0) cout << fgcyan << "\n  Reading Landing Gear" << fgdef << endl;
-      if (!ReadUndercarriage(AC_cfg)) return false;
-    } else if (token == "PROPULSION") {
-      if (debug_lvl > 0) cout << fgcyan << "\n  Reading Propulsion" << fgdef << endl;
-      if (!ReadPropulsion(AC_cfg)) return false;
-    } else if (token == "FLIGHT_CONTROL") {
-      if (debug_lvl > 0) cout << fgcyan << "\n  Reading Flight Control" << fgdef << endl;
-      if (!ReadFlightControls(AC_cfg)) return false;
-    } else if (token == "OUTPUT") {
-      if (debug_lvl > 0) cout << fgcyan << "\n  Reading Output directives" << fgdef << endl;
-      if (!ReadOutput(AC_cfg)) return false;
-    }
-  }
-  
-  return true;
-}
-
-//%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
-
 bool FGAircraft::Run(void)
 {
   if (!FGModel::Run()) {                 // if false then execute this Run()
@@ -197,33 +163,7 @@ float FGAircraft::GetNlf(void)
 
 //%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
 
-bool FGAircraft::ReadPrologue(FGConfigFile* AC_cfg)
-{
-  string token = AC_cfg->GetValue();
-  string scratch;
-  AircraftName = AC_cfg->GetValue("NAME");
-  if (debug_lvl > 0) cout << underon << "Reading Aircraft Configuration File"
-            << underoff << ": " << highint << AircraftName << normint << endl;
-  scratch = AC_cfg->GetValue("VERSION").c_str();
-
-  CFGVersion = AC_cfg->GetValue("VERSION");
-
-  if (debug_lvl > 0)
-    cout << "                            Version: " << highint << CFGVersion
-                                                             << normint << endl;
-  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;
-    cerr << "         You have version: " << CFGVersion << endl << fgdef << endl;
-    return false;
-  }
-  return true;
-}
-
-//%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
-
-bool FGAircraft::ReadMetrics(FGConfigFile* AC_cfg)
+bool FGAircraft::Load(FGConfigFile* AC_cfg)
 {
   string token = "";
   string parameter;
@@ -318,61 +258,6 @@ bool FGAircraft::ReadMetrics(FGConfigFile* AC_cfg)
   return true;
 }
 
-//%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
-
-bool FGAircraft::ReadPropulsion(FGConfigFile* AC_cfg)
-{
-  if (!Propulsion->Load(AC_cfg)) {
-    cerr << "  Propulsion not successfully loaded" << endl;
-    return false;
-  }
-  return true;
-}
-
-//%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
-
-bool FGAircraft::ReadFlightControls(FGConfigFile* AC_cfg)
-{
-  if (!FCS->Load(AC_cfg)) {
-    cerr << "  Flight Controls not successfully loaded" << endl;
-    return false;
-  }
-  return true;
-}
-
-//%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
-
-bool FGAircraft::ReadAerodynamics(FGConfigFile* AC_cfg)
-{
-  if (!Aerodynamics->Load(AC_cfg)) {
-    cerr << "  Aerodynamics not successfully loaded" << endl;
-    return false;
-  }
-  return true;
-}
-
-//%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
-
-bool FGAircraft::ReadUndercarriage(FGConfigFile* AC_cfg)
-{
-  if (!GroundReactions->Load(AC_cfg)) {
-    cerr << "  Ground Reactions not successfully loaded" << endl;
-    return false;
-  }
-  return true;
-}
-
-//%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
-
-bool FGAircraft::ReadOutput(FGConfigFile* AC_cfg)
-{
-  if (!Output->Load(AC_cfg)) {
-    cerr << "  Output not successfully loaded" << endl;
-    return false;
-  }
-  return true;
-}
-
 //%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
 //    The bitmasked value choices are as follows:
 //    unset: In this case (the default) JSBSim would only print
@@ -410,7 +295,11 @@ void FGAircraft::Debug(int from)
   }
   if (debug_lvl & 16) { // Sanity checking
   }
-  if (debug_lvl & 32) { // Turbulence
+  if (debug_lvl & 64) {
+    if (from == 0) { // Constructor
+      cout << IdSrc << endl;
+      cout << IdHdr << endl;
+    }
   }
 }