// not just the X-axis of the engine/propeller. This may or may not work for a
// helicopter.
-FGPropeller::FGPropeller(FGFDMExec* exec, FGConfigFile* Prop_cfg) : FGThruster(exec)
+FGPropeller::FGPropeller(FGFDMExec* exec, FGConfigFile* Prop_cfg, int num) : FGThruster(exec)
{
string token;
int rows, cols;
RPM = 0;
vTorque.InitMatrix();
+ char property_name[80];
+ snprintf(property_name, 80, "propulsion/c-thrust[%u]", EngineNum);
+ PropertyManager->Tie( property_name, &ThrustCoeff );
+
Debug(0);
}
{
if (cThrust) delete cThrust;
if (cPower) delete cPower;
+
+ char property_name[80];
+ snprintf(property_name, 80, "propulsion/c-thrust[%u]", EngineNum);
+ PropertyManager->Untie( property_name );
+
Debug(1);
}
double FGPropeller::Calculate(double PowerAvailable)
{
- double J, C_Thrust, omega;
+ double J, omega;
double Vel = fdmex->GetAuxiliary()->GetAeroUVW(eU);
double rho = fdmex->GetAtmosphere()->GetDensity();
double RPS = RPM/60.0;
}
if (MaxPitch == MinPitch) { // Fixed pitch prop
- C_Thrust = cThrust->GetValue(J);
+ ThrustCoeff = cThrust->GetValue(J);
} else { // Variable pitch prop
- C_Thrust = cThrust->GetValue(J, Pitch);
+ ThrustCoeff = cThrust->GetValue(J, Pitch);
}
if (P_Factor > 0.0001) {
cerr << "P-Factor value in config file must be greater than zero" << endl;
}
- Thrust = C_Thrust*RPS*RPS*Diameter*Diameter*Diameter*Diameter*rho;
+ Thrust = ThrustCoeff*RPS*RPS*Diameter*Diameter*Diameter*Diameter*rho;
omega = RPS*2.0*M_PI;
vFn(1) = Thrust;
//%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
-string FGPropeller::GetThrusterLabels(int id)
+string FGPropeller::GetThrusterLabels(int id, string delimeter)
{
std::ostringstream buf;
- buf << Name << "_Torque[" << id << "], "
- << Name << "_PFactor_Pitch[" << id << "], "
- << Name << "_PFactor_Yaw[" << id << "], "
- << Name << "_Thrust[" << id << "], ";
+ buf << Name << "_Torque[" << id << "]" << delimeter
+ << Name << "_PFactor_Pitch[" << id << "]" << delimeter
+ << Name << "_PFactor_Yaw[" << id << "]" << delimeter
+ << Name << "_Thrust[" << id << "]" << delimeter;
if (IsVPitch())
- buf << Name << "_Pitch[" << id << "], ";
+ buf << Name << "_Pitch[" << id << "]" << delimeter;
buf << Name << "_RPM[" << id << "]";
return buf.str();
//%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
-string FGPropeller::GetThrusterValues(int id)
+string FGPropeller::GetThrusterValues(int id, string delimeter)
{
std::ostringstream buf;
FGColumnVector3 vPFactor = GetPFactor();
- buf << vTorque(eX) << ", "
- << vPFactor(ePitch) << ", "
- << vPFactor(eYaw) << ", "
- << Thrust << ", ";
+ buf << vTorque(eX) << delimeter
+ << vPFactor(ePitch) << delimeter
+ << vPFactor(eYaw) << delimeter
+ << Thrust << delimeter;
if (IsVPitch())
- buf << Pitch << ", ";
+ buf << Pitch << delimeter;
buf << RPM;
return buf.str();