Syn.c w. JSBSim.
This commit is contained in:
parent
e89194b42a
commit
9b33107551
5 changed files with 20 additions and 18 deletions
|
@ -73,20 +73,21 @@ CLASS DOCUMENTATION
|
||||||
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%*/
|
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%*/
|
||||||
|
|
||||||
/** Encapsulates the aerodynamic calculations.
|
/** Encapsulates the aerodynamic calculations.
|
||||||
This class owns and contains the list of coefficients that define the
|
This class owns and contains the list of force/coefficients that define the
|
||||||
aerodynamic properties of this aircraft. Here also, such unique phenomena
|
aerodynamic properties of an aircraft. Here also, such unique phenomena
|
||||||
as ground effect and maximum lift curve tailoff are handled.
|
as ground effect and maximum lift curve tailoff are handled.
|
||||||
@config
|
|
||||||
<pre>
|
@code
|
||||||
\<AERODYNAMICS>
|
<aerodynamics>
|
||||||
\<AXIS NAME="{LIFT|DRAG|SIDE|ROLL|PITCH|YAW}">
|
<axis name="{LIFT|DRAG|SIDE|ROLL|PITCH|YAW}">
|
||||||
{Coefficient definitions}
|
{force coefficient definitions}
|
||||||
\</AXIS>
|
</axis>
|
||||||
{Additional axis definitions}
|
{additional axis definitions}
|
||||||
\</AERODYNAMICS> </pre>
|
</aerodynamics>
|
||||||
|
@endcode
|
||||||
|
|
||||||
@author Jon S. Berndt, Tony Peden
|
@author Jon S. Berndt, Tony Peden
|
||||||
$Id$
|
@Id $Revision$
|
||||||
*/
|
*/
|
||||||
|
|
||||||
/*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
|
/*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
|
||||||
|
@ -108,7 +109,7 @@ public:
|
||||||
|
|
||||||
/** Loads the Aerodynamics model.
|
/** Loads the Aerodynamics model.
|
||||||
The Load function for this class expects the XML parser to
|
The Load function for this class expects the XML parser to
|
||||||
have found the AERODYNAMICS keyword in the configuration file.
|
have found the aerodynamics keyword in the configuration file.
|
||||||
@param element pointer to the current XML element for aerodynamics parameters.
|
@param element pointer to the current XML element for aerodynamics parameters.
|
||||||
@return true if successful */
|
@return true if successful */
|
||||||
bool Load(Element* element);
|
bool Load(Element* element);
|
||||||
|
@ -164,9 +165,6 @@ public:
|
||||||
coefficients */
|
coefficients */
|
||||||
string GetCoefficientValues(string delimeter);
|
string GetCoefficientValues(string delimeter);
|
||||||
|
|
||||||
void bind(void);
|
|
||||||
void unbind(void);
|
|
||||||
|
|
||||||
private:
|
private:
|
||||||
typedef map<string,int> AxisIndex;
|
typedef map<string,int> AxisIndex;
|
||||||
AxisIndex AxisIdx;
|
AxisIndex AxisIdx;
|
||||||
|
@ -185,6 +183,8 @@ private:
|
||||||
double clsq, lod, qbar_area;
|
double clsq, lod, qbar_area;
|
||||||
|
|
||||||
typedef double (FGAerodynamics::*PMF)(int) const;
|
typedef double (FGAerodynamics::*PMF)(int) const;
|
||||||
|
void bind(void);
|
||||||
|
void unbind(void);
|
||||||
|
|
||||||
void Debug(int from);
|
void Debug(int from);
|
||||||
};
|
};
|
||||||
|
|
|
@ -298,6 +298,7 @@ double FGPiston::Calculate(void)
|
||||||
|
|
||||||
if (Thruster->GetType() == FGThruster::ttPropeller) {
|
if (Thruster->GetType() == FGThruster::ttPropeller) {
|
||||||
((FGPropeller*)Thruster)->SetAdvance(FCS->GetPropAdvance(EngineNumber));
|
((FGPropeller*)Thruster)->SetAdvance(FCS->GetPropAdvance(EngineNumber));
|
||||||
|
((FGPropeller*)Thruster)->SetFeather(FCS->GetPropFeather(EngineNumber));
|
||||||
}
|
}
|
||||||
|
|
||||||
PowerAvailable = (HP * hptoftlbssec) - Thruster->GetPowerRequired();
|
PowerAvailable = (HP * hptoftlbssec) - Thruster->GetPowerRequired();
|
||||||
|
|
|
@ -127,6 +127,8 @@ FGPropeller::FGPropeller(FGFDMExec* exec, Element* prop_element, int num)
|
||||||
PropertyManager->Tie( property_name, &J );
|
PropertyManager->Tie( property_name, &J );
|
||||||
snprintf(property_name, 80, "propulsion/engine[%d]/blade-angle", EngineNum);
|
snprintf(property_name, 80, "propulsion/engine[%d]/blade-angle", EngineNum);
|
||||||
PropertyManager->Tie( property_name, &Pitch );
|
PropertyManager->Tie( property_name, &Pitch );
|
||||||
|
snprintf(property_name, 80, "propulsion/engine[%d]/thrust-coefficient", EngineNum);
|
||||||
|
PropertyManager->Tie( property_name, this, &FGPropeller::GetThrustCoefficient );
|
||||||
|
|
||||||
Debug(0);
|
Debug(0);
|
||||||
}
|
}
|
||||||
|
@ -223,7 +225,7 @@ double FGPropeller::GetPowerRequired(void)
|
||||||
cPReq = cPower->GetValue(J);
|
cPReq = cPower->GetValue(J);
|
||||||
} else { // Variable pitch prop
|
} else { // Variable pitch prop
|
||||||
|
|
||||||
if (MaxRPM != MinRPM) { // constant speed prop
|
if (MaxRPM != MinRPM) { // fixed-speed prop
|
||||||
|
|
||||||
// do normal calculation when propeller is neither feathered nor reversed
|
// do normal calculation when propeller is neither feathered nor reversed
|
||||||
if (!Feathered) {
|
if (!Feathered) {
|
||||||
|
|
|
@ -161,6 +161,7 @@ public:
|
||||||
bool GetReverse (void) { return Reversed; }
|
bool GetReverse (void) { return Reversed; }
|
||||||
void SetFeather (bool f) { Feathered = f; }
|
void SetFeather (bool f) { Feathered = f; }
|
||||||
bool GetFeather (void) { return Feathered; }
|
bool GetFeather (void) { return Feathered; }
|
||||||
|
double GetThrustCoefficient(void) const {return ThrustCoeff;}
|
||||||
|
|
||||||
private:
|
private:
|
||||||
int numBlades;
|
int numBlades;
|
||||||
|
|
|
@ -96,8 +96,6 @@ public:
|
||||||
virtual string GetThrusterLabels(int id, string delimeter);
|
virtual string GetThrusterLabels(int id, string delimeter);
|
||||||
virtual string GetThrusterValues(int id, string delimeter);
|
virtual string GetThrusterValues(int id, string delimeter);
|
||||||
|
|
||||||
inline void SetThrustCoefficient(double ct) { ThrustCoeff = ct; }
|
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
eType Type;
|
eType Type;
|
||||||
string Name;
|
string Name;
|
||||||
|
|
Loading…
Add table
Reference in a new issue