]> git.mxchange.org Git - flightgear.git/blobdiff - src/FDM/JSBSim/FGNozzle.cpp
Frederic Bouvier:
[flightgear.git] / src / FDM / JSBSim / FGNozzle.cpp
index 001df2463445504eb0faff4742828e2f2675aa67..fa890f2ee884589d2ec3f0f3b4092c4031babfd3 100644 (file)
@@ -35,14 +35,12 @@ HISTORY
 INCLUDES
 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%*/
 
-#ifdef FGFS
-#  include <simgear/compiler.h>
-#  include STL_ALGORITHM
-#else
-#  include <algorithm>
-#endif
+#include <sstream>
 
 #include "FGNozzle.h"
+#include "FGAtmosphere.h"
+
+namespace JSBSim {
 
 static const char *IdSrc = "$Id$";
 static const char *IdHdr = ID_NOZZLE;
@@ -68,6 +66,7 @@ FGNozzle::FGNozzle(FGFDMExec* FDMExec, FGConfigFile* Nzl_cfg) : FGThruster(FDMEx
   }
 
   Thrust = 0;
+  ReverserAngle = 0.0;
   Type = ttNozzle;
   Area2 = (Diameter*Diameter/4.0)*M_PI;
   AreaT = Area2/ExpR;
@@ -88,7 +87,7 @@ double FGNozzle::Calculate(double CfPc)
 {
   double pAtm = fdmex->GetAtmosphere()->GetPressure();
   Thrust = max((double)0.0, (CfPc * AreaT + (PE - pAtm)*Area2) * nzlEff);
-  vFn(1) = Thrust;
+  vFn(1) = Thrust * cos(ReverserAngle);
 
   return Thrust;
 }
@@ -100,6 +99,28 @@ double FGNozzle::GetPowerRequired(void)
   return PE;
 }
 
+//%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+
+string FGNozzle::GetThrusterLabels(int id)
+{
+  std::ostringstream buf;
+
+  buf << Name << "_Thrust[" << id << ']';
+
+  return buf.str();
+}
+
+//%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+
+string FGNozzle::GetThrusterValues(int id)
+{
+  std::ostringstream buf;
+
+  buf << Thrust;
+
+  return buf.str();
+}
+
 //%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
 //    The bitmasked value choices are as follows:
 //    unset: In this case (the default) JSBSim would only print
@@ -142,5 +163,11 @@ void FGNozzle::Debug(int from)
   }
   if (debug_lvl & 16) { // Sanity checking
   }
+  if (debug_lvl & 64) {
+    if (from == 0) { // Constructor
+      cout << IdSrc << endl;
+      cout << IdHdr << endl;
+    }
+  }
+}
 }
-