INCLUDES
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%*/
-#ifdef FGFS
-# include <simgear/compiler.h>
-# include STL_ALGORITHM
-#else
-# include <algorithm>
-#endif
+#include <sstream>
#include "FGNozzle.h"
#include "FGAtmosphere.h"
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%*/
-FGNozzle::FGNozzle(FGFDMExec* FDMExec, FGConfigFile* Nzl_cfg) : FGThruster(FDMExec)
+FGNozzle::FGNozzle(FGFDMExec* FDMExec, FGConfigFile* Nzl_cfg, int num) : FGThruster(FDMExec)
{
string token;
}
Thrust = 0;
- ReverserAngle = 0.0;
Type = ttNozzle;
Area2 = (Diameter*Diameter/4.0)*M_PI;
AreaT = Area2/ExpR;
+ char property_name[80];
+ snprintf(property_name, 80, "propulsion/c-thrust[%u]", EngineNum);
+ PropertyManager->Tie( property_name, &ThrustCoeff );
+
Debug(0);
}
FGNozzle::~FGNozzle()
{
+ char property_name[80];
+ snprintf(property_name, 80, "propulsion/c-thrust[%u]", EngineNum);
+ PropertyManager->Untie( property_name );
+
Debug(1);
}
{
double pAtm = fdmex->GetAtmosphere()->GetPressure();
Thrust = max((double)0.0, (CfPc * AreaT + (PE - pAtm)*Area2) * nzlEff);
- vFn(1) = Thrust * cos(ReverserAngle);
+ vFn(1) = Thrust;
+
+ ThrustCoeff = max((double)0.0, CfPc / ((pAtm - PE) * Area2));
return Thrust;
}
return PE;
}
+//%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+
+string FGNozzle::GetThrusterLabels(int id, string delimeter)
+{
+ std::ostringstream buf;
+
+ buf << Name << "_Thrust[" << id << ']';
+
+ return buf.str();
+}
+
+//%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+
+string FGNozzle::GetThrusterValues(int id, string delimeter)
+{
+ 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