]> git.mxchange.org Git - flightgear.git/blobdiff - src/FDM/JSBSim/models/propulsion/FGNozzle.cpp
Merge branch 'next' of gitorious.org:fg/flightgear into next
[flightgear.git] / src / FDM / JSBSim / models / propulsion / FGNozzle.cpp
index 45b0065c4588e1806a9a069f6532ed59e7d0e106..c9616e1a2f3b78691eee3719ef2d406c9ed729fc 100644 (file)
@@ -35,14 +35,18 @@ HISTORY
 INCLUDES
 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%*/
 
+#include <iostream>
 #include <sstream>
+#include <cstdlib>
 
 #include "FGNozzle.h"
-#include "models/FGAtmosphere.h"
+#include "input_output/FGXMLElement.h"
+
+using namespace std;
 
 namespace JSBSim {
 
-static const char *IdSrc = "$Id$";
+static const char *IdSrc = "$Id: FGNozzle.cpp,v 1.15 2012/03/18 15:48:35 jentron Exp $";
 static const char *IdHdr = ID_NOZZLE;
 
 /*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
@@ -60,13 +64,6 @@ FGNozzle::FGNozzle(FGFDMExec* FDMExec, Element* nozzle_element, int num)
     exit(-1);
   }
 
-  if (nozzle_element->FindElement("pe"))
-    PE = nozzle_element->FindElementValueAsNumberConvertTo("pe", "PSF");
-  else {
-    cerr << "Fatal Error: Nozzle exit pressure must be given in nozzle config file." << endl;
-    exit(-1);
-  }
-
   Thrust = 0;
   Type = ttNozzle;
   
@@ -84,8 +81,7 @@ FGNozzle::~FGNozzle()
 
 double FGNozzle::Calculate(double vacThrust)
 {
-  double pAtm = fdmex->GetAtmosphere()->GetPressure();
-  Thrust = max((double)0.0, vacThrust - pAtm*Area);
+  Thrust = max((double)0.0, vacThrust - in.Pressure*Area);
 
   vFn(1) = Thrust * cos(ReverserAngle);
 
@@ -94,7 +90,7 @@ double FGNozzle::Calculate(double vacThrust)
 
 //%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
 
-string FGNozzle::GetThrusterLabels(int id, string delimeter)
+string FGNozzle::GetThrusterLabels(int id, const string& delimeter)
 {
   std::ostringstream buf;
 
@@ -105,7 +101,7 @@ string FGNozzle::GetThrusterLabels(int id, string delimeter)
 
 //%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
 
-string FGNozzle::GetThrusterValues(int id, string delimeter)
+string FGNozzle::GetThrusterValues(int id, const string& delimeter)
 {
   std::ostringstream buf;