]> git.mxchange.org Git - flightgear.git/commitdiff
Latest jsbsim updates.
authorcurt <curt>
Mon, 2 Apr 2001 03:12:38 +0000 (03:12 +0000)
committercurt <curt>
Mon, 2 Apr 2001 03:12:38 +0000 (03:12 +0000)
15 files changed:
src/FDM/JSBSim/FGAircraft.cpp
src/FDM/JSBSim/FGCoefficient.cpp
src/FDM/JSBSim/FGControls.cpp
src/FDM/JSBSim/FGControls.h
src/FDM/JSBSim/FGFDMExec.cpp
src/FDM/JSBSim/FGFDMExec.h
src/FDM/JSBSim/FGLGear.cpp
src/FDM/JSBSim/FGMatrix.h
src/FDM/JSBSim/FGNozzle.cpp
src/FDM/JSBSim/FGPropeller.cpp
src/FDM/JSBSim/FGPropeller.h
src/FDM/JSBSim/FGPropulsion.cpp
src/FDM/JSBSim/FGPropulsion.h
src/FDM/JSBSim/FGThruster.h
src/FDM/JSBSim/FGfdmSocket.h

index ed10a42db3e6a1649efaa303ed39380dbea4d56d..1ff7e595147549cf3ce22a7b316d42ed607f8484 100644 (file)
@@ -225,8 +225,8 @@ bool FGAircraft::LoadAircraft(string aircraft_path, string engine_path, string f
 
   ReadPrologue(&AC_cfg);
 
-  while ((AC_cfg.GetNextConfigLine() != "EOF") &&
-         (token = AC_cfg.GetValue()) != "/FDM_CONFIG") {
+  while ((AC_cfg.GetNextConfigLine() != string("EOF")) &&
+         (token = AC_cfg.GetValue()) != string("/FDM_CONFIG")) {
     if (token == "METRICS") {
       cout << fgcyan << "\n  Reading Metrics" << fgdef << endl;
       ReadMetrics(&AC_cfg);
@@ -455,9 +455,9 @@ void FGAircraft::ReadMetrics(FGConfigFile* AC_cfg) {
 
   AC_cfg->GetNextConfigLine();
 
-  while ((token = AC_cfg->GetValue()) != "/METRICS") {
+  while ((token = AC_cfg->GetValue()) != string("/METRICS")) {
     *AC_cfg >> parameter;
-    if (parameter == "AC_WINGAREA") {
+    if (parameter == string("AC_WINGAREA")) {
         *AC_cfg >> WingArea;
         cout << "    WingArea: " << WingArea  << endl; 
     } else if (parameter == "AC_WINGSPAN") {
@@ -522,12 +522,12 @@ void FGAircraft::ReadAerodynamics(FGConfigFile* AC_cfg) {
 
   AC_cfg->GetNextConfigLine();
   
-  while ((token = AC_cfg->GetValue()) != "/AERODYNAMICS") {
+  while ((token = AC_cfg->GetValue()) != string("/AERODYNAMICS")) {
     if (token == "AXIS") {
       CoeffArray ca;
       axis = AC_cfg->GetValue("NAME");
       AC_cfg->GetNextConfigLine();
-      while ((token = AC_cfg->GetValue()) != "/AXIS") {
+      while ((token = AC_cfg->GetValue()) != string("/AXIS")) {
         ca.push_back(new FGCoefficient(FDMExec, AC_cfg));
         DisplayCoeffFactors(ca.back()->Getmultipliers());
       }
@@ -544,7 +544,7 @@ void FGAircraft::ReadUndercarriage(FGConfigFile* AC_cfg) {
 
   AC_cfg->GetNextConfigLine();
 
-  while ((token = AC_cfg->GetValue()) != "/UNDERCARRIAGE") {
+  while ((token = AC_cfg->GetValue()) != string("/UNDERCARRIAGE")) {
     lGear.push_back(FGLGear(AC_cfg, FDMExec));
   }
 }
@@ -562,7 +562,7 @@ void FGAircraft::ReadOutput(FGConfigFile* AC_cfg) {
   Output->SetType(token);
   AC_cfg->GetNextConfigLine();
 
-  while ((token = AC_cfg->GetValue()) != "/OUTPUT") {
+  while ((token = AC_cfg->GetValue()) != string("/OUTPUT")) {
     *AC_cfg >> parameter;
     if (parameter == "RATE_IN_HZ") *AC_cfg >> OutRate;
     if (parameter == "SIMULATION") {
@@ -634,7 +634,7 @@ void FGAircraft::ReadPrologue(FGConfigFile* AC_cfg) {
   CFGVersion = AC_cfg->GetValue("VERSION");
   cout << "                            Version: " << highint << CFGVersion
                                                              << normint << endl;
-  if (CFGVersion != NEEDED_CFG_VERSION) {
+  if (CFGVersion != string(NEEDED_CFG_VERSION)) {
     cout << endl << fgred << "YOU HAVE AN INCOMPATIBLE CFG FILE FOR THIS AIRCRAFT."
     " RESULTS WILL BE UNPREDICTABLE !!" << endl;
     cout << "Current version needed is: " << NEEDED_CFG_VERSION << endl;
index f3c7bd1beb9189c1835b4ae1b02a13c8fe545572..449a835933043c5756fd006f9efcebd30097218f 100644 (file)
@@ -48,7 +48,11 @@ INCLUDES
 #include "FGState.h"
 #include "FGFDMExec.h"
 
-#include <iomanip.h>
+#ifndef FGFS\r
+#  include <iomanip.h>\r
+#else\r
+#  include STL_IOMANIP\r
+#endif\r
 
 static const char *IdSrc = "$Id$";
 static const char *IdHdr = "ID_COEFFICIENT";
index 5866515380e97a5b4928deddb9064419253c4485..88bfba5112db2e7746c35bb7663ead5040c0d35d 100644 (file)
@@ -53,8 +53,8 @@ FGControls::~FGControls() {
 
 
 // $Log$
-// Revision 1.22  2001/03/29 23:04:51  curt
-// Latest round of JSBSim updates.
+// Revision 1.23  2001/04/02 01:12:38  curt
+// Latest jsbsim updates.
 //
 // Revision 1.7  2001/03/22 14:10:24  jberndt
 // Fixed ID comment
index ea9078356e3dd4a8cdd1b4002eacac76b16ceeaf..94a5ab77f031f4d74dedce979996cb895d7eb569 100644 (file)
@@ -178,8 +178,8 @@ extern FGControls controls;
 
 
 // $Log$
-// Revision 1.21  2001/03/29 23:04:51  curt
-// Latest round of JSBSim updates.
+// Revision 1.22  2001/04/02 01:12:38  curt
+// Latest jsbsim updates.
 //
 // Revision 1.10  2001/03/22 14:10:24  jberndt
 // Fixed ID comment
index d98f24038b1944d497c920a5a37587d90765d8b0..f3098ef8a73ed8dde433729b4b4080767692f1ca 100644 (file)
@@ -117,6 +117,7 @@ CLASS IMPLEMENTATION
 
 FGFDMExec::FGFDMExec(void)
 {
+  Frame       = 0;
   FirstModel  = 0;
   Error       = 0;
   State       = 0;
@@ -304,13 +305,16 @@ bool FGFDMExec::Run(void)
     if (State->Getsim_time() >= EndTime) return false;
   }
 
-  if (debug_lvl & 4) cout << "=========================" << endl;
+  if (debug_lvl & 4)
+    cout << "================== Frame: " << Frame << "  Time: "
+         << State->Getsim_time() << endl;
 
   while (!model_iterator->Run()) {
     model_iterator = model_iterator->NextModel;
     if (model_iterator == 0L) break;
   }
 
+  Frame++;
   State->IncrTime();
 
   return true;
index 046b2403f0a367697c787e6b56bed3598145f1f9..973bc37b3d559d9684c244a6ff28454f4d6356f5 100644 (file)
-/*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%\r
- Header:       FGFDMExec.h\r
- Author:       Jon Berndt\r
- Date started: 11/17/98\r
-\r
- ------------- Copyright (C) 1999  Jon S. Berndt (jsb@hal-pc.org) -------------\r
-\r
- This program is free software; you can redistribute it and/or modify it under\r
- the terms of the GNU General Public License as published by the Free Software\r
- Foundation; either version 2 of the License, or (at your option) any later\r
- version.\r
-\r
- This program is distributed in the hope that it will be useful, but WITHOUT\r
- ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS\r
- FOR A PARTICULAR PURPOSE.  See the GNU General Public License for more\r
- details.\r
-\r
- You should have received a copy of the GNU General Public License along with\r
- this program; if not, write to the Free Software Foundation, Inc., 59 Temple\r
- Place - Suite 330, Boston, MA  02111-1307, USA.\r
-\r
- Further information about the GNU General Public License can also be found on\r
- the world wide web at http://www.gnu.org.\r
-\r
-HISTORY\r
---------------------------------------------------------------------------------\r
-11/17/98   JSB   Created\r
-7/31/99     TP   Added RunIC function that runs the sim so that every frame\r
-                 begins with the IC values from the given FGInitialCondition\r
-                                  object and dt=0.\r
-\r
-%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%\r
-SENTRY\r
-%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%*/\r
-\r
-#ifndef FGFDMEXEC_HEADER_H\r
-#define FGFDMEXEC_HEADER_H\r
-\r
-/*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%\r
-INCLUDES\r
-%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%*/\r
-\r
-#ifdef FGFS\r
-#  include <simgear/compiler.h>\r
-#  ifdef FG_HAVE_STD_INCLUDES\r
-#    include <vector>\r
-#  else\r
-#    include <vector.h>\r
-#  endif\r
-#else\r
-#  include <vector>\r
-#endif\r
-\r
-#include "FGModel.h"\r
-#include "FGInitialCondition.h"\r
-\r
-/*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%\r
-DEFINITIONS\r
-%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%*/\r
-\r
-#define ID_FDMEXEC "$Id$"\r
-\r
-/*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%\r
-FORWARD DECLARATIONS\r
-%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%*/\r
-\r
-class FGState;\r
-class FGAtmosphere;\r
-class FGFCS;\r
-class FGPropulsion;\r
-class FGAircraft;\r
-class FGTranslation;\r
-class FGRotation;\r
-class FGPosition;\r
-class FGAuxiliary;\r
-class FGOutput;\r
-class FGInitialCondition;\r
-\r
-struct condition {\r
-  vector <eParam>  TestParam;\r
-  vector <eParam>  SetParam;\r
-  vector <float>   TestValue;\r
-  vector <float>   SetValue;\r
-  vector <string>  Comparison;\r
-  vector <float>   TC;\r
-  vector <bool>    Persistent;\r
-  vector <eAction> Action;\r
-  vector <eType>   Type;\r
-  vector <bool>    Triggered;\r
-  vector <float>   newValue;\r
-  vector <float>   OriginalValue;\r
-  vector <float>   StartTime;\r
-  vector <float>   EndTime;\r
-\r
-  condition() {\r
-  }\r
-};\r
-\r
-/*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%\r
-COMMENTS, REFERENCES, and NOTES [use "class documentation" below for API docs]\r
-%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%*/\r
-\r
-/*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%\r
-CLASS DOCUMENTATION\r
-%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%*/\r
-\r
-/** Encapsulates the JSBSim simulation executive.\r
-    @author Jon S. Berndt\r
-    @version $Id$\r
-\r
-    @doc This class is the interface class through which all other simulation classes\r
-    are instantiated, initialized, and run. When integrated with FlightGear (or\r
-    other flight simulator) this class is typically instantiated by an interface\r
-    class on the simulator side.\r
-\r
-    <h4>Scripting support provided in the Executive</h4>\r
-\r
-    <p>There is simple scripting support provided in the FGFDMExec\r
-    class. Commands are specified using the <u>Simple Scripting\r
-    Directives for JSBSim</u> (SSDJ). The script file is in XML\r
-    format. A test condition (or conditions) can be set up in the\r
-    script and when the condition evaluates to true, the specified\r
-    action[s] is/are taken. A test condition can be <em>persistent</em>,\r
-    meaning that if a test condition evaluates to true, then passes\r
-    and evaluates to false, the condition is reset and may again be\r
-    triggered. When the set of tests evaluates to true for a given\r
-    condition, an item may be set to another value. This value might\r
-    be a boolean, a value, or a delta value, and the change from the\r
-    current value to the new value can be either via a step function,\r
-    a ramp, or an exponential approach. The speed of a ramp or\r
-    approach is specified via the time constant. Here is the format\r
-    of the script file:</p>\r
-\r
-    <pre><strong>&lt;?xml version=&quot;1.0&quot;?&gt;\r
-    &lt;runscript name=&quot;C172-01A&quot;&gt;\r
-\r
-    &lt;!--\r
-    This run is for testing C172 runs\r
-    --&gt;\r
-\r
-    &lt;use aircraft=&quot;c172&quot;&gt;\r
-    &lt;use initialize=&quot;reset00&quot;&gt;\r
-\r
-    &lt;run start=&quot;0.0&quot; end=&quot;4.5&quot; dt=&quot;0.05&quot;&gt;\r
-      &lt;when&gt;\r
-        &lt;parameter name=&quot;FG_TIME&quot; comparison=&quot;ge&quot; value=&quot;0.25&quot;&gt;\r
-        &lt;parameter name=&quot;FG_TIME&quot; comparison=&quot;le&quot; value=&quot;0.50&quot;&gt;\r
-        &lt;set name=&quot;FG_AILERON_CMD&quot; type=&quot;FG_VALUE&quot; value=&quot;0.25&quot;\r
-        action=&quot;FG_STEP&quot; persistent=&quot;false&quot; tc =&quot;0.25&quot;&gt;\r
-      &lt;/when&gt;\r
-      &lt;when&gt;\r
-        &lt;parameter name=&quot;FG_TIME&quot; comparison=&quot;ge&quot; value=&quot;0.5&quot;&gt;\r
-        &lt;parameter name=&quot;FG_TIME&quot; comparison=&quot;le&quot; value=&quot;1.5&quot;&gt;\r
-        &lt;set name=&quot;FG_AILERON_CMD&quot; type=&quot;FG_DELTA&quot; value=&quot;0.5&quot;\r
-        action=&quot;FG_EXP&quot; persistent=&quot;false&quot; tc =&quot;0.5&quot;&gt;\r
-      &lt;/when&gt;\r
-      &lt;when&gt;\r
-        &lt;parameter name=&quot;FG_TIME&quot; comparison=&quot;ge&quot; value=&quot;1.5&quot;&gt;\r
-        &lt;parameter name=&quot;FG_TIME&quot; comparison=&quot;le&quot; value=&quot;2.5&quot;&gt;\r
-        &lt;set name=&quot;FG_RUDDER_CMD&quot; type=&quot;FG_DELTA&quot; value=&quot;0.5&quot;\r
-        action=&quot;FG_RAMP&quot; persistent=&quot;false&quot; tc =&quot;0.5&quot;&gt;\r
-      &lt;/when&gt;\r
-    &lt;/run&gt;\r
-\r
-    &lt;/runscript&gt;</strong></pre>\r
-\r
-    <p>The first line must always be present. The second line\r
-    identifies this file as a script file, and gives a descriptive\r
-    name to the script file. Comments are next, delineated by the\r
-    &lt;!-- and --&gt; symbols. The aircraft and initialization files\r
-    to be used are specified in the &quot;use&quot; lines. Next,\r
-    comes the &quot;run&quot; section, where the conditions are\r
-    described in &quot;when&quot; clauses.</p>\r
-\r
-    <h4>JSBSim Debugging Directives</h4>\r
-\r
-    This describes to any interested entity the debug level\r
-    requested by setting the JSBSIM_DEBUG environment variable.\r
-    The bitmasked value choices are as follows:<ol>\r
-    <li><b>unset</b>: In this case (the default) JSBSim would only print\r
-       out the normally expected messages, essentially echoing\r
-       the config files as they are read. If the environment\r
-       variable is not set, debug_lvl is set to 1 internally</li>\r
-    <li><b>0</b>: This requests JSBSim not to output any messages\r
-       whatsoever.</li>\r
-    <li><b>1</b>: This value explicity requests the normal JSBSim\r
-       startup messages</li>\r
-    <li><b>2</b>: This value asks for a message to be printed out when\r
-       a class is instantiated</li>\r
-    <li><b>4</b>: When this value is set, a message is displayed when a\r
-       FGModel object executes its Run() method</li>\r
-    <li><b>8</b>: When this value is set, various runtime state variables\r
-       are printed out periodically</li>\r
-    </ol>\r
-\r
-*/\r
-\r
-/*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%\r
-CLASS DECLARATION\r
-%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%*/\r
-\r
-class FGFDMExec\r
-{\r
-public:\r
-  /// Default constructor\r
-  FGFDMExec(void);\r
-\r
-  /// Default destructor\r
-  ~FGFDMExec();\r
-\r
-  /** This routine places a model into the runlist at the specified rate. The\r
-      "rate" is not really a clock rate. It represents how many calls to the\r
-      FGFDMExec::Run() method must be made before the model is executed. A\r
-      value of 1 means that the model will be executed for each call to the\r
-      exec's Run() method. A value of 5 means that the model will only be\r
-      executed every 5th call to the exec's Run() method.\r
-      @param model A pointer to the model being scheduled.\r
-      @param rate The rate at which to execute the model as described above.\r
-      @return Currently returns 0 always. */\r
-  int  Schedule(FGModel* model, int rate);\r
-\r
-  /** This executes each scheduled model in succession, as well as running any\r
-      scripts which are loaded.\r
-      @return true if successful, false if sim should be ended  */\r
-  bool Run(void);\r
-\r
-  /** Initializes the sim with a set of initial conditions.\r
-      @param fgic A pointer to a filled out initial conditions class which\r
-      describes the desired initial conditions.\r
-      @return true if successful\r
-       */\r
-  bool RunIC(FGInitialCondition *fgic);\r
-\r
-  /// Freezes the sim\r
-  void Freeze(void) {frozen = true;}\r
-\r
-  /// Resumes the sim\r
-  void Resume(void) {frozen = false;}\r
-\r
-  /** Loads an aircraft model.\r
-      @param AircraftPath path to the aircraft directory. For instance:\r
-      "aircraft". Under aircraft, then, would be directories for various\r
-      modeled aircraft such as C172/, x15/, etc.\r
-      @param EnginePath path to the directory under which engine config\r
-      files are kept, for instance "engine"\r
-      @param model the name of the aircraft model itself. This file will\r
-      be looked for in the directory specified in the AircraftPath variable,\r
-      and in turn under the directory with the same name as the model. For\r
-      instance: "aircraft/x15/x15.xml"\r
-      @return true if successful*/\r
-  bool LoadModel(string AircraftPath, string EnginePath, string model);\r
-\r
-  /** Loads a script to drive JSBSim (usually in standalone mode).\r
-      The language is the Simple Script Directives for JSBSim (SSDJ).\r
-      @param script the filename (including path name, if any) for the script.\r
-      @return true if successful */\r
-  bool LoadScript(string script);\r
-\r
-  /** This function is called each pass through the executive Run() method IF\r
-      scripting is enabled. */\r
-  void RunScript(void);\r
-\r
-  bool SetEnginePath(string path)   {EnginePath = path; return true;}\r
-  bool SetAircraftPath(string path) {AircraftPath = path; return true;}\r
-  bool SetScriptPath(string path)   {ScriptPath = path; return true;}\r
-\r
-  /// @name Top-level executive State and Model retrieval mechanism\r
-  //@{\r
-  /// Returns the FGState pointer.\r
-  inline FGState* GetState(void)              {return State;}\r
-  /// Returns the FGAtmosphere pointer.\r
-  inline FGAtmosphere* GetAtmosphere(void)    {return Atmosphere;}\r
-  /// Returns the FGFCS pointer.\r
-  inline FGFCS* GetFCS(void)                  {return FCS;}\r
-  /// Returns the FGPropulsion pointer.\r
-  inline FGPropulsion* GetPropulsion(void)    {return Propulsion;}\r
-  /// Returns the FGAircraft pointer.\r
-  inline FGAircraft* GetAircraft(void)        {return Aircraft;}\r
-  /// Returns the FGTranslation pointer.\r
-  inline FGTranslation* GetTranslation(void)  {return Translation;}\r
-  /// Returns the FGRotation pointer.\r
-  inline FGRotation* GetRotation(void)        {return Rotation;}\r
-  /// Returns the FGPosition pointer.\r
-  inline FGPosition* GetPosition(void)        {return Position;}\r
-  /// Returns the FGAuxiliary pointer.\r
-  inline FGAuxiliary* GetAuxiliary(void)      {return Auxiliary;}\r
-  /// Returns the FGOutput pointer.\r
-  inline FGOutput* GetOutput(void)            {return Output;}\r
-  //@}\r
-\r
-  /// Retrieves the engine path.\r
-  inline string GetEnginePath(void)          {return EnginePath;}\r
-  /// Retrieves the aircraft path.\r
-  inline string GetAircraftPath(void)        {return AircraftPath;}\r
-\r
-private:\r
-  FGModel* FirstModel;\r
-\r
-  bool frozen;\r
-  bool terminate;\r
-  int  Error;\r
-  bool modelLoaded;\r
-  bool Scripted;\r
-\r
-  string AircraftPath;\r
-  string EnginePath;\r
-  string ScriptPath;\r
-  string ScriptName;\r
-  float  StartTime;\r
-  float  EndTime;\r
-  vector <struct condition> Conditions;\r
-\r
-  FGState*       State;\r
-  FGAtmosphere*  Atmosphere;\r
-  FGFCS*         FCS;\r
-  FGPropulsion*  Propulsion;\r
-  FGAircraft*    Aircraft;\r
-  FGTranslation* Translation;\r
-  FGRotation*    Rotation;\r
-  FGPosition*    Position;\r
-  FGAuxiliary*   Auxiliary;\r
-  FGOutput*      Output;\r
-\r
-  bool Allocate(void);\r
-  bool DeAllocate(void);\r
-  void Debug(void);\r
-};\r
-\r
-//%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%\r
-#endif\r
-\r
+/*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+ Header:       FGFDMExec.h
+ Author:       Jon Berndt
+ Date started: 11/17/98
+
+ ------------- Copyright (C) 1999  Jon S. Berndt (jsb@hal-pc.org) -------------
+
+ This program is free software; you can redistribute it and/or modify it under
+ the terms of the GNU General Public License as published by the Free Software
+ Foundation; either version 2 of the License, or (at your option) any later
+ version.
+
+ This program is distributed in the hope that it will be useful, but WITHOUT
+ ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
+ FOR A PARTICULAR PURPOSE.  See the GNU General Public License for more
+ details.
+
+ You should have received a copy of the GNU General Public License along with
+ this program; if not, write to the Free Software Foundation, Inc., 59 Temple
+ Place - Suite 330, Boston, MA  02111-1307, USA.
+
+ Further information about the GNU General Public License can also be found on
+ the world wide web at http://www.gnu.org.
+
+HISTORY
+--------------------------------------------------------------------------------
+11/17/98   JSB   Created
+7/31/99     TP   Added RunIC function that runs the sim so that every frame
+                 begins with the IC values from the given FGInitialCondition
+                                  object and dt=0.
+
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+SENTRY
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%*/
+
+#ifndef FGFDMEXEC_HEADER_H
+#define FGFDMEXEC_HEADER_H
+
+/*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+INCLUDES
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%*/
+
+#ifdef FGFS
+#  include <simgear/compiler.h>
+#  ifdef FG_HAVE_STD_INCLUDES
+#    include <vector>
+#  else
+#    include <vector.h>
+#  endif
+#else
+#  include <vector>
+#endif
+
+#include "FGModel.h"
+#include "FGInitialCondition.h"
+
+/*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+DEFINITIONS
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%*/
+
+#define ID_FDMEXEC "$Id$"
+
+/*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+FORWARD DECLARATIONS
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%*/
+
+class FGState;
+class FGAtmosphere;
+class FGFCS;
+class FGPropulsion;
+class FGAircraft;
+class FGTranslation;
+class FGRotation;
+class FGPosition;
+class FGAuxiliary;
+class FGOutput;
+class FGInitialCondition;
+
+struct condition {
+  vector <eParam>  TestParam;
+  vector <eParam>  SetParam;
+  vector <float>   TestValue;
+  vector <float>   SetValue;
+  vector <string>  Comparison;
+  vector <float>   TC;
+  vector <bool>    Persistent;
+  vector <eAction> Action;
+  vector <eType>   Type;
+  vector <bool>    Triggered;
+  vector <float>   newValue;
+  vector <float>   OriginalValue;
+  vector <float>   StartTime;
+  vector <float>   EndTime;
+
+  condition() {
+  }
+};
+
+/*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+COMMENTS, REFERENCES, and NOTES [use "class documentation" below for API docs]
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%*/
+
+/*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+CLASS DOCUMENTATION
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%*/
+
+/** Encapsulates the JSBSim simulation executive.
+    @author Jon S. Berndt
+    @version $Id$
+
+    @doc This class is the interface class through which all other simulation classes
+    are instantiated, initialized, and run. When integrated with FlightGear (or
+    other flight simulator) this class is typically instantiated by an interface
+    class on the simulator side.
+
+    <h4>Scripting support provided in the Executive</h4>
+
+    <p>There is simple scripting support provided in the FGFDMExec
+    class. Commands are specified using the <u>Simple Scripting
+    Directives for JSBSim</u> (SSDJ). The script file is in XML
+    format. A test condition (or conditions) can be set up in the
+    script and when the condition evaluates to true, the specified
+    action[s] is/are taken. A test condition can be <em>persistent</em>,
+    meaning that if a test condition evaluates to true, then passes
+    and evaluates to false, the condition is reset and may again be
+    triggered. When the set of tests evaluates to true for a given
+    condition, an item may be set to another value. This value might
+    be a boolean, a value, or a delta value, and the change from the
+    current value to the new value can be either via a step function,
+    a ramp, or an exponential approach. The speed of a ramp or
+    approach is specified via the time constant. Here is the format
+    of the script file:</p>
+
+    <pre><strong>&lt;?xml version=&quot;1.0&quot;?&gt;
+    &lt;runscript name=&quot;C172-01A&quot;&gt;
+
+    &lt;!--
+    This run is for testing C172 runs
+    --&gt;
+
+    &lt;use aircraft=&quot;c172&quot;&gt;
+    &lt;use initialize=&quot;reset00&quot;&gt;
+
+    &lt;run start=&quot;0.0&quot; end=&quot;4.5&quot; dt=&quot;0.05&quot;&gt;
+      &lt;when&gt;
+        &lt;parameter name=&quot;FG_TIME&quot; comparison=&quot;ge&quot; value=&quot;0.25&quot;&gt;
+        &lt;parameter name=&quot;FG_TIME&quot; comparison=&quot;le&quot; value=&quot;0.50&quot;&gt;
+        &lt;set name=&quot;FG_AILERON_CMD&quot; type=&quot;FG_VALUE&quot; value=&quot;0.25&quot;
+        action=&quot;FG_STEP&quot; persistent=&quot;false&quot; tc =&quot;0.25&quot;&gt;
+      &lt;/when&gt;
+      &lt;when&gt;
+        &lt;parameter name=&quot;FG_TIME&quot; comparison=&quot;ge&quot; value=&quot;0.5&quot;&gt;
+        &lt;parameter name=&quot;FG_TIME&quot; comparison=&quot;le&quot; value=&quot;1.5&quot;&gt;
+        &lt;set name=&quot;FG_AILERON_CMD&quot; type=&quot;FG_DELTA&quot; value=&quot;0.5&quot;
+        action=&quot;FG_EXP&quot; persistent=&quot;false&quot; tc =&quot;0.5&quot;&gt;
+      &lt;/when&gt;
+      &lt;when&gt;
+        &lt;parameter name=&quot;FG_TIME&quot; comparison=&quot;ge&quot; value=&quot;1.5&quot;&gt;
+        &lt;parameter name=&quot;FG_TIME&quot; comparison=&quot;le&quot; value=&quot;2.5&quot;&gt;
+        &lt;set name=&quot;FG_RUDDER_CMD&quot; type=&quot;FG_DELTA&quot; value=&quot;0.5&quot;
+        action=&quot;FG_RAMP&quot; persistent=&quot;false&quot; tc =&quot;0.5&quot;&gt;
+      &lt;/when&gt;
+    &lt;/run&gt;
+
+    &lt;/runscript&gt;</strong></pre>
+
+    <p>The first line must always be present. The second line
+    identifies this file as a script file, and gives a descriptive
+    name to the script file. Comments are next, delineated by the
+    &lt;!-- and --&gt; symbols. The aircraft and initialization files
+    to be used are specified in the &quot;use&quot; lines. Next,
+    comes the &quot;run&quot; section, where the conditions are
+    described in &quot;when&quot; clauses.</p>
+
+    <h4>JSBSim Debugging Directives</h4>
+
+    This describes to any interested entity the debug level
+    requested by setting the JSBSIM_DEBUG environment variable.
+    The bitmasked value choices are as follows:<ol>
+    <li><b>unset</b>: In this case (the default) JSBSim would only print
+       out the normally expected messages, essentially echoing
+       the config files as they are read. If the environment
+       variable is not set, debug_lvl is set to 1 internally</li>
+    <li><b>0</b>: This requests JSBSim not to output any messages
+       whatsoever.</li>
+    <li><b>1</b>: This value explicity requests the normal JSBSim
+       startup messages</li>
+    <li><b>2</b>: This value asks for a message to be printed out when
+       a class is instantiated</li>
+    <li><b>4</b>: When this value is set, a message is displayed when a
+       FGModel object executes its Run() method</li>
+    <li><b>8</b>: When this value is set, various runtime state variables
+       are printed out periodically</li>
+    </ol>
+
+*/
+
+/*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+CLASS DECLARATION
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%*/
+
+class FGFDMExec
+{
+public:
+  /// Default constructor
+  FGFDMExec(void);
+
+  /// Default destructor
+  ~FGFDMExec();
+
+  /** This routine places a model into the runlist at the specified rate. The
+      "rate" is not really a clock rate. It represents how many calls to the
+      FGFDMExec::Run() method must be made before the model is executed. A
+      value of 1 means that the model will be executed for each call to the
+      exec's Run() method. A value of 5 means that the model will only be
+      executed every 5th call to the exec's Run() method.
+      @param model A pointer to the model being scheduled.
+      @param rate The rate at which to execute the model as described above.
+      @return Currently returns 0 always. */
+  int  Schedule(FGModel* model, int rate);
+
+  /** This executes each scheduled model in succession, as well as running any
+      scripts which are loaded.
+      @return true if successful, false if sim should be ended  */
+  bool Run(void);
+
+  /** Initializes the sim with a set of initial conditions.
+      @param fgic A pointer to a filled out initial conditions class which
+      describes the desired initial conditions.
+      @return true if successful
+       */
+  bool RunIC(FGInitialCondition *fgic);
+
+  /// Freezes the sim
+  void Freeze(void) {frozen = true;}
+
+  /// Resumes the sim
+  void Resume(void) {frozen = false;}
+
+  /** Loads an aircraft model.
+      @param AircraftPath path to the aircraft directory. For instance:
+      "aircraft". Under aircraft, then, would be directories for various
+      modeled aircraft such as C172/, x15/, etc.
+      @param EnginePath path to the directory under which engine config
+      files are kept, for instance "engine"
+      @param model the name of the aircraft model itself. This file will
+      be looked for in the directory specified in the AircraftPath variable,
+      and in turn under the directory with the same name as the model. For
+      instance: "aircraft/x15/x15.xml"
+      @return true if successful*/
+  bool LoadModel(string AircraftPath, string EnginePath, string model);
+
+  /** Loads a script to drive JSBSim (usually in standalone mode).
+      The language is the Simple Script Directives for JSBSim (SSDJ).
+      @param script the filename (including path name, if any) for the script.
+      @return true if successful */
+  bool LoadScript(string script);
+
+  /** This function is called each pass through the executive Run() method IF
+      scripting is enabled. */
+  void RunScript(void);
+
+  bool SetEnginePath(string path)   {EnginePath = path; return true;}
+  bool SetAircraftPath(string path) {AircraftPath = path; return true;}
+  bool SetScriptPath(string path)   {ScriptPath = path; return true;}
+
+  /// @name Top-level executive State and Model retrieval mechanism
+  //@{
+  /// Returns the FGState pointer.
+  inline FGState* GetState(void)              {return State;}
+  /// Returns the FGAtmosphere pointer.
+  inline FGAtmosphere* GetAtmosphere(void)    {return Atmosphere;}
+  /// Returns the FGFCS pointer.
+  inline FGFCS* GetFCS(void)                  {return FCS;}
+  /// Returns the FGPropulsion pointer.
+  inline FGPropulsion* GetPropulsion(void)    {return Propulsion;}
+  /// Returns the FGAircraft pointer.
+  inline FGAircraft* GetAircraft(void)        {return Aircraft;}
+  /// Returns the FGTranslation pointer.
+  inline FGTranslation* GetTranslation(void)  {return Translation;}
+  /// Returns the FGRotation pointer.
+  inline FGRotation* GetRotation(void)        {return Rotation;}
+  /// Returns the FGPosition pointer.
+  inline FGPosition* GetPosition(void)        {return Position;}
+  /// Returns the FGAuxiliary pointer.
+  inline FGAuxiliary* GetAuxiliary(void)      {return Auxiliary;}
+  /// Returns the FGOutput pointer.
+  inline FGOutput* GetOutput(void)            {return Output;}
+  //@}
+
+  /// Retrieves the engine path.
+  inline string GetEnginePath(void)          {return EnginePath;}
+  /// Retrieves the aircraft path.
+  inline string GetAircraftPath(void)        {return AircraftPath;}
+
+private:
+  FGModel* FirstModel;
+
+  bool frozen;
+  bool terminate;
+  int  Error;
+  int  Frame;
+  bool modelLoaded;
+  bool Scripted;
+
+  string AircraftPath;
+  string EnginePath;
+  string ScriptPath;
+  string ScriptName;
+  float  StartTime;
+  float  EndTime;
+  vector <struct condition> Conditions;
+
+  FGState*       State;
+  FGAtmosphere*  Atmosphere;
+  FGFCS*         FCS;
+  FGPropulsion*  Propulsion;
+  FGAircraft*    Aircraft;
+  FGTranslation* Translation;
+  FGRotation*    Rotation;
+  FGPosition*    Position;
+  FGAuxiliary*   Auxiliary;
+  FGOutput*      Output;
+
+  bool Allocate(void);
+  bool DeAllocate(void);
+  void Debug(void);
+};
+
+//%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+#endif
+
index 1f044a5483825a7d7c5824cfad7e90b9c6bfe8e3..5aa1c9d38399dbab3b2523e8d9c5b188473b6408 100644 (file)
@@ -186,7 +186,7 @@ FGColumnVector FGLGear::Force(void)
   FGColumnVector vLocalForce(3);
   //FGColumnVector vLocalGear(3);     // Vector: CG to this wheel (Local)
   FGColumnVector vWhlVelVec(3);     // Velocity of this wheel (Local)
-  
+
   vWhlBodyVec     = (vXYZ - Aircraft->GetXYZcg()) / 12.0;
   vWhlBodyVec(eX) = -vWhlBodyVec(eX);
   vWhlBodyVec(eZ) = -vWhlBodyVec(eZ);
@@ -259,7 +259,7 @@ FGColumnVector FGLGear::Force(void)
 
     switch (eSteerType) {
     case stSteer:
-      SteerAngle = SteerGain*RudderPedal;
+      SteerAngle = SteerGain*FCS->GetDrCmd();
       break;
     case stFixed:
       SteerAngle = 0.0;
@@ -322,7 +322,10 @@ FGColumnVector FGLGear::Force(void)
 
 // Compute the forces in the wheel ground plane.
 
-    RollingForce = vLocalForce(eZ) * BrakeFCoeff * fabs(RollingWhlVel)/RollingWhlVel;
+    RollingForce = 0;
+    if(fabs(RollingWhlVel) > 1E-3) { 
+      RollingForce = vLocalForce(eZ) * BrakeFCoeff * fabs(RollingWhlVel)/RollingWhlVel;
+    }
     SideForce    = vLocalForce(eZ) * FCoeff;
 
 // Transform these forces back to the local reference frame.
index 068be0fff8a3e0566db3820bbb4abc5278f74227..c34dac64d7cf738df98884f1b9e53a80533b35b8 100644 (file)
@@ -23,6 +23,12 @@ INCLUDES
 #include <stdlib.h>
 #ifdef FGFS
 #  include <simgear/compiler.h>
+#  include STL_STRING
+   SG_USING_STD(string);
+   SG_USING_STD(ostream);
+   SG_USING_STD(istream);
+   SG_USING_STD(cerr);
+   SG_USING_STD(endl);
 #  ifdef FG_HAVE_STD_INCLUDES
 #    include <fstream>
 #    include <cmath>
@@ -36,9 +42,14 @@ INCLUDES
 #  include <fstream>
 #  include <cmath>
 #  include <iostream>
+#  include <string>
+   using std::string;
+   using std::ostream;
+   using std::istream;
+   using std::cerr;
+   using std::endl;
 #endif
 
-#include <string>
 
 /*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
 DEFINITIONS
@@ -46,12 +57,6 @@ DEFINITIONS
 
 #define ID_MATRIX "$Id$"
 
-using std::string;
-using std::ostream;
-using std::istream;
-using std::cerr;
-using std::endl;
-
 /*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
 FORWARD DECLARATIONS
 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%*/
@@ -148,45 +153,12 @@ public:
   friend FGColumnVector operator*(const FGMatrix& M, const FGColumnVector& V);
 
   double& operator()(int m) const;
-  
+
   FGColumnVector& multElementWise(const FGColumnVector& V);
 
 private:
   void Debug(void);
 };
 
-/*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
-DECLARATION: FGMatrix3x3
-%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%*/
-
-class FGMatrix3x3 : public FGMatrix
-{
-public:
-  FGMatrix3x3(void) {FGMatrix(3,3);}
-//  ~FGMatrix3x3(void) {~FGMatrix();}
-};
-
-/*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
-DECLARATION: FGColumnVector4
-%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%*/
-
-class FGColumnVector4 : public FGColumnVector
-{
-public:
-  FGColumnVector4(void) {FGColumnVector(4);}
-//  ~FGColumnVector4(void) {~FGColumnVector();}
-};
-
-/*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
-DECLARATION: FGColumnVector3
-%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%*/
-
-class FGColumnVector3 : public FGColumnVector
-{
-public:
-  FGColumnVector3(void) {FGColumnVector(3);}
-//  ~FGColumnVector3(void) {~FGColumnVector();}
-};
-
 //%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
 #endif
index c5faef38b9514efaf0525e4019008664e64d33ef..7d4db6af3500ce9cca4e82c4b7d92c74a677e75f 100644 (file)
@@ -73,6 +73,8 @@ FGNozzle::FGNozzle(FGFDMExec* FDMExec, FGConfigFile* Nzl_cfg) : FGThruster(FDMEx
     }
   }
 
+  Thrust = 0;
+
   if (debug_lvl & 2) cout << "Instantiated: FGNozzle" << endl;
 }
 
@@ -87,7 +89,6 @@ FGNozzle::~FGNozzle()
 
 float FGNozzle::Calculate(float CfPc)
 {
-  float Thrust;
   float pAtm = fdmex->GetAtmosphere()->GetPressure();
   
   Thrust = (CfPc + (PE - pAtm)*ExpR) * (Diameter / ExpR) * nzlEff;
index 96176e0f52e0bec526cb712123e34fdb27067af7..27ea9266d0a851898b43b285af9033d7564025c1 100644 (file)
@@ -52,8 +52,8 @@ FGPropeller::FGPropeller(FGFDMExec* exec, FGConfigFile* Prop_cfg) : FGThruster(e
   string token;
   int rows, cols;
 
-  PropName = Prop_cfg->GetValue("NAME");
-  cout << "\n    Propeller Name: " << PropName << endl;
+  Name = Prop_cfg->GetValue("NAME");
+  cout << "\n    Propeller Name: " << Name << endl;
   Prop_cfg->GetNextConfigLine();
   while (Prop_cfg->GetValue() != "/FG_PROPELLER") {
     *Prop_cfg >> token;
index aaabfea56a0134f6d5dfe7444cf099af856221b6..cd014c76fa47d034683ba8fd8fec0c183f5600a6 100644 (file)
@@ -124,9 +124,6 @@ public:
   /// Retrieves the propeller moment of inertia
   float GetIxx(void)           { return Ixx;           }
   
-  /// Retrieves the Thrust in pounds
-  float GetThrust(void)        { return Thrust;        }
-  
   /// Retrieves the Torque in foot-pounds (Don't you love the English system?)
   float GetTorque(void)        { return Torque;        }
   
@@ -147,7 +144,6 @@ public:
   float Calculate(float PowerAvailable);
 
 private:
-  string PropName;
   int   numBlades;
   float RPM;
   float Ixx;
@@ -155,7 +151,6 @@ private:
   float MaxPitch;
   float MinPitch;
   float Pitch;
-  float Thrust;
   float Torque;
   FGTable *Efficiency;
   FGTable *cThrust;
index 2530429a3d79d09ff04100e1b120b06644a79822..68335b4a6cfea1dae6bbebd8f586e6bd796d5122 100644 (file)
@@ -206,12 +206,12 @@ bool FGPropulsion::LoadPropulsion(FGConfigFile* AC_cfg)
           } else cerr << "Unknown identifier: " << token << " in engine file: "
                                                         << engineFileName << endl;
         }
-        
+
         Engines[numEngines]->SetPlacement(xLoc, yLoc, zLoc, Pitch, Yaw);
         numEngines++;
 
       } else {
-      
+
         cerr << "Could not read engine config file: " << fullpath
                                                   + engineFileName + ".xml" << endl;
         return false;
@@ -231,7 +231,7 @@ bool FGPropulsion::LoadPropulsion(FGConfigFile* AC_cfg)
         numOxiTanks++;
         break;
       }
-      
+
       numTanks++;
 
     } else if (token == "AC_THRUSTER") {          // ========== READING THRUSTERS
@@ -285,6 +285,87 @@ bool FGPropulsion::LoadPropulsion(FGConfigFile* AC_cfg)
 
 //%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
 
+string FGPropulsion::GetPropulsionStrings(void)
+{
+  string PropulsionStrings = "";
+  bool firstime = true;
+
+  for (unsigned int i=0;i<Engines.size();i++) {
+    if (!firstime) {
+      PropulsionStrings += ", ";
+      firstime = false;
+    }
+/*
+    switch(Engines[i].GetType()) {
+    case etPiston:
+      PropulsionStrings += (Engines[i].GetName() + "_PwrAvail, ");
+      break;
+    case etRocket:
+      break;
+    case etTurboJet:
+    case etTurboProp:
+    case etTurboShaft:
+      break;
+    }
+
+    switch(Thrusters[i].GetType()) {
+    case ttNozzle:
+      PropulsionStrings += (Thrusters[i].GetName() + "_Thrust, ");
+      break;
+    case ttRotor:
+      break;
+    case ttPropeller:
+      break;
+    }
+*/    
+  }
+
+  return PropulsionStrings;
+}
+
+//%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+
+string FGPropulsion::GetPropulsionValues(void)
+{
+  char buff[20];
+  string PropulsionValues = "";
+  bool firstime = true;
+
+  for (unsigned int i=0;i<Engines.size();i++) {
+    if (!firstime) {
+      PropulsionValues += ", ";
+      firstime = false;
+    }
+/*
+    switch(Engines[i].GetType()) {
+    case etPiston:
+      PropulsionValues += (string(gcvt(Thrusters[i].GetPowerAvailable(), 10, buff)) + ", ");
+      break;
+    case etRocket:
+      break;
+    case etTurboJet:
+    case etTurboProp:
+    case etTurboShaft:
+      break;
+    }
+
+    switch(Thrusters[i].GetType()) {
+    case ttNozzle:
+      PropulsionValues += (string(gcvt(Thrusters[i].GetThrust(), 10, buff)) + ", ");
+      break;
+    case ttRotor:
+      break;
+    case ttPropeller:
+      break;
+    }
+*/
+  }
+
+  return PropulsionValues;
+}
+
+//%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+
 void FGPropulsion::Debug(void)
 {
     //TODO: Add your source code here
index bd2e667d6adfa847af587bc793f3e9e25c1f82bd..049f489466ac6b890ae519733d576a14251aa006 100644 (file)
@@ -157,6 +157,8 @@ public:
 
   bool GetSteadyState(void);
 
+  string GetPropulsionStrings(void);
+  string GetPropulsionValues(void);
 
   inline FGColumnVector& GetForces(void)  {return *Forces; }
   inline FGColumnVector& GetMoments(void) {return *Moments;}
index d03e92ede6e36a21a93dc39ce26c817d56dd2a5a..fc9389c95e0d39abe6e46d3b4024bc31a524b1d8 100644 (file)
@@ -63,6 +63,7 @@ public:
   void SetName(string name) {Name = name;}
   virtual float GetPowerRequired(void) {return 0.0;}
   virtual void SetdeltaT(float dt) {deltaT = dt;}
+  float GetThrust(void) {return Thrust;}
 
 protected:
   string Name;
index e5064a519fa2d62e2815e3b82fd3f7ec1ad4563d..0507a69f18c798fbc61b40e894a685a0922bfd0f 100644 (file)
@@ -46,6 +46,9 @@ INCLUDES
 
 #ifdef FGFS
 #  include <simgear/compiler.h>
+#  include STL_STRING
+   SG_USING_STD(cout);
+   SG_USING_STD(endl);
 #  ifdef FG_HAVE_STD_INCLUDES
 #    include <iostream>
 #    include <fstream>
@@ -56,9 +59,11 @@ INCLUDES
 #else
 #  include <iostream>
 #  include <fstream>
+#  include <string>
+   using std::cout;
+   using std::endl;
 #endif
 
-#include <string>
 #include <sys/types.h>
 
 #if defined(__BORLANDC__) || defined(_MSC_VER)
@@ -76,9 +81,6 @@ DEFINITIONS
 
 #define ID_FDMSOCKET "$Id$"
 
-using std::cout;
-using std::endl;
-
 /*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
 CLASS DECLARATION
 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%*/