1
0
Fork 0

JSBSim updates, including MSVC fixes from Bernie Bright

This commit is contained in:
tony 2002-04-30 13:42:26 +00:00
parent 8b411b244b
commit 4a854fcc3e
21 changed files with 148 additions and 119 deletions

View file

@ -225,24 +225,26 @@ string FGAerodynamics::GetCoefficientValues(void)
void FGAerodynamics::bind(void)
{
typedef double (FGAerodynamics::*PMF)(int) const;
PropertyManager->Tie("forces/fbx-aero-lbs", this,1,
&FGAerodynamics::GetForces);
(PMF)&FGAerodynamics::GetForces);
PropertyManager->Tie("forces/fby-aero-lbs", this,2,
&FGAerodynamics::GetForces);
(PMF)&FGAerodynamics::GetForces);
PropertyManager->Tie("forces/fbz-aero-lbs", this,3,
&FGAerodynamics::GetForces);
(PMF)&FGAerodynamics::GetForces);
PropertyManager->Tie("moments/l-aero-lbsft", this,1,
&FGAerodynamics::GetMoments);
(PMF)&FGAerodynamics::GetMoments);
PropertyManager->Tie("moments/m-aero-lbsft", this,2,
&FGAerodynamics::GetMoments);
(PMF)&FGAerodynamics::GetMoments);
PropertyManager->Tie("moments/n-aero-lbsft", this,3,
&FGAerodynamics::GetMoments);
(PMF)&FGAerodynamics::GetMoments);
PropertyManager->Tie("forces/fwx-aero-lbs", this,1,
&FGAerodynamics::GetvFs);
(PMF)&FGAerodynamics::GetvFs);
PropertyManager->Tie("forces/fwy-aero-lbs", this,2,
&FGAerodynamics::GetvFs);
(PMF)&FGAerodynamics::GetvFs);
PropertyManager->Tie("forces/fwz-aero-lbs", this,3,
&FGAerodynamics::GetvFs);
(PMF)&FGAerodynamics::GetvFs);
PropertyManager->Tie("forces/lod-norm", this,
&FGAerodynamics::GetLoD);
PropertyManager->Tie("aero/cl-squared-norm", this,
@ -259,7 +261,7 @@ void FGAerodynamics::bindModel(void)
node = PropertyManager->GetNode("aero/buildup",true);
for (i=0;i<NAxes;i++) {
node = node->GetNode( string(AxisNames[i]),true );
for (j=0; j < Coeff[i].size(); j++) {
for (j=0; j < Coeff[i].size(); j++) {
Coeff[i][j]->bind(node);
}
node = (FGPropertyManager*)node->getParent();

View file

@ -115,17 +115,17 @@ public:
/** Gets the total aerodynamic force vector.
@return a force vector reference. */
FGColumnVector3& GetForces(void) {return vForces;}
inline double GetForces(int n) const {return vForces(n);}
double GetForces(int n) const {return vForces(n);}
/** Gets the total aerodynamic moment vector.
@return a moment vector reference. */
FGColumnVector3& GetMoments(void) {return vMoments;}
inline double GetMoments(int n) const {return vMoments(n);}
double GetMoments(int n) const {return vMoments(n);}
inline FGColumnVector3& GetvLastFs(void) { return vLastFs; }
inline double GetvLastFs(int axis) const { return vLastFs(axis); }
inline FGColumnVector3& GetvFs(void) { return vFs; }
inline double GetvFs(int axis) const { return vFs(axis); }
FGColumnVector3& GetvLastFs(void) { return vLastFs; }
double GetvLastFs(int axis) const { return vLastFs(axis); }
FGColumnVector3& GetvFs(void) { return vFs; }
double GetvFs(int axis) const { return vFs(axis); }
inline double GetLoD(void) const { return lod; }
inline double GetClSquared(void) const { return clsq; }
@ -153,6 +153,8 @@ private:
FGColumnVector3 vLastFs;
FGColumnVector3 vDXYZcg;
double clsq,lod;
typedef double (FGAerodynamics::*PMF)(int) const;
void Debug(int from);
};

View file

@ -281,6 +281,7 @@ bool FGAircraft::Load(FGConfigFile* AC_cfg)
void FGAircraft::bind(void)
{
typedef double (FGAircraft::*PMF)(int) const;
PropertyManager->Tie("metrics/Sw-sqft", this,
&FGAircraft::GetWingArea);
PropertyManager->Tie("metrics/bw-ft", this,
@ -306,29 +307,29 @@ void FGAircraft::bind(void)
PropertyManager->Tie("metrics/vbarv-norm", this,
&FGAircraft::Getvbarv);
PropertyManager->Tie("moments/l-total-lbsft", this,1,
&FGAircraft::GetMoments);
(PMF)&FGAircraft::GetMoments);
PropertyManager->Tie("moments/m-total-lbsft", this,2,
&FGAircraft::GetMoments);
(PMF)&FGAircraft::GetMoments);
PropertyManager->Tie("moments/n-total-lbsft", this,3,
&FGAircraft::GetMoments);
(PMF)&FGAircraft::GetMoments);
PropertyManager->Tie("forces/fbx-total-lbs", this,1,
&FGAircraft::GetForces);
(PMF)&FGAircraft::GetForces);
PropertyManager->Tie("forces/fby-total-lbs", this,2,
&FGAircraft::GetForces);
(PMF)&FGAircraft::GetForces);
PropertyManager->Tie("forces/fbz-total-lbs", this,3,
&FGAircraft::GetForces);
(PMF)&FGAircraft::GetForces);
PropertyManager->Tie("metrics/aero-rp-x-ft", this,1,
&FGAircraft::GetXYZrp);
(PMF)&FGAircraft::GetXYZrp);
PropertyManager->Tie("metrics/aero-rp-y-ft", this,2,
&FGAircraft::GetXYZrp);
(PMF)&FGAircraft::GetXYZrp);
PropertyManager->Tie("metrics/aero-rp-z-ft", this,3,
&FGAircraft::GetXYZrp);
(PMF)&FGAircraft::GetXYZrp);
PropertyManager->Tie("metrics/eyepoint-x-ft", this,1,
&FGAircraft::GetXYZep);
(PMF)&FGAircraft::GetXYZep);
PropertyManager->Tie("metrics/eyepoint-y-ft", this,2,
&FGAircraft::GetXYZep);
(PMF)&FGAircraft::GetXYZep);
PropertyManager->Tie("metrics/eyepoint-z-ft", this,3,
&FGAircraft::GetXYZep);
(PMF)&FGAircraft::GetXYZep);
PropertyManager->Tie("metrics/alpha-max-deg", this,
&FGAircraft::GetAlphaCLMax,
&FGAircraft::SetAlphaCLMax,

View file

@ -36,6 +36,7 @@ HISTORY
11/24/98 JSB Created
07/23/99 TP Added implementation of 1959 Standard Atmosphere
Moved calculation of Mach number to FGTranslation
Later updated to '76 model
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
COMMENTS, REFERENCES, and NOTES
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
@ -298,6 +299,7 @@ void FGAtmosphere::Turbulence(void)
void FGAtmosphere::bind(void)
{
typedef double (FGAtmosphere::*PMF)(int) const;
PropertyManager->Tie("atmosphere/T-R", this,
&FGAtmosphere::GetTemperature);
PropertyManager->Tie("atmosphere/rho-slugs_ft3", this,
@ -325,11 +327,11 @@ void FGAtmosphere::bind(void)
PropertyManager->Tie("atmosphere/psiw-rad", this,
&FGAtmosphere::GetWindPsi);
PropertyManager->Tie("atmosphere/p-turb-rad_sec", this,1,
&FGAtmosphere::GetTurbPQR);
(PMF)&FGAtmosphere::GetTurbPQR);
PropertyManager->Tie("atmosphere/q-turb-rad_sec", this,2,
&FGAtmosphere::GetTurbPQR);
(PMF)&FGAtmosphere::GetTurbPQR);
PropertyManager->Tie("atmosphere/r-turb-rad_sec", this,3,
&FGAtmosphere::GetTurbPQR);
(PMF)&FGAtmosphere::GetTurbPQR);
}
//%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

View file

@ -29,6 +29,7 @@ HISTORY
11/24/98 JSB Created
07/23/99 TP Added implementation of 1959 Standard Atmosphere
Moved calculation of Mach number to FGTranslation
Updated to '76 model
********************************************************************************

View file

@ -199,6 +199,7 @@ double FGAuxiliary::GetCrossWind(void)
void FGAuxiliary::bind(void)
{
typedef double (FGAuxiliary::*PMF)(int) const;
PropertyManager->Tie("velocities/vc-fps", this,
&FGAuxiliary::GetVcalibratedFPS);
PropertyManager->Tie("velocities/vc-kts", this,
@ -208,17 +209,17 @@ void FGAuxiliary::bind(void)
PropertyManager->Tie("velocities/ve-kts", this,
&FGAuxiliary::GetVequivalentKTS);
PropertyManager->Tie("accelerations/a-pilot-x-ft_sec2", this,1,
&FGAuxiliary::GetPilotAccel);
(PMF)&FGAuxiliary::GetPilotAccel);
PropertyManager->Tie("accelerations/a-pilot-y-ft_sec2", this,2,
&FGAuxiliary::GetPilotAccel);
(PMF)&FGAuxiliary::GetPilotAccel);
PropertyManager->Tie("accelerations/a-pilot-z-ft_sec2", this,3,
&FGAuxiliary::GetPilotAccel);
(PMF)&FGAuxiliary::GetPilotAccel);
PropertyManager->Tie("accelerations/n-pilot-x-norm", this,1,
&FGAuxiliary::GetNpilot);
(PMF)&FGAuxiliary::GetNpilot);
PropertyManager->Tie("accelerations/n-pilot-y-norm", this,2,
&FGAuxiliary::GetNpilot);
(PMF)&FGAuxiliary::GetNpilot);
PropertyManager->Tie("accelerations/n-pilot-z-norm", this,3,
&FGAuxiliary::GetNpilot);
(PMF)&FGAuxiliary::GetNpilot);
PropertyManager->Tie("position/epa-rad", this,
&FGAuxiliary::GetEarthPositionAngle);
/* PropertyManager->Tie("atmosphere/headwind-fps", this,

View file

@ -133,14 +133,14 @@ public:
protected:
FGFDMExec* FDMExec;
string description;
string name;
FGPropertyManager *node;
private:
enum Type {UNKNOWN, VALUE, VECTOR, TABLE, EQUATION};
int numInstances;
string description;
string name;
string filename;
string method;
string multparms;
@ -154,6 +154,8 @@ private:
double bias,gain;
FGPropertyManager *LookupR, *LookupC;
FGPropertyManager *node; // must be private!!
MultVec multipliers;
int rows, columns;
Type type;

View file

@ -605,32 +605,39 @@ void FGFCS::bind(void)
void FGFCS::bindModel(void)
{
unsigned i;
char tmp[80];
for (i=0; i<ThrottleCmd.size(); i++) {
PropertyManager->Tie("fcs/throttle-cmd-norm",this,i,
snprintf(tmp,80,"fcs/throttle-cmd-norm[%u]",i);
PropertyManager->Tie( tmp,this,i,
&FGFCS::GetThrottleCmd,
&FGFCS::SetThrottleCmd,
true );
PropertyManager->Tie("fcs/throttle-pos-norm",this,i,
snprintf(tmp,80,"fcs/throttle-pos-norm[%u]",i);
PropertyManager->Tie( tmp,this,i,
&FGFCS::GetThrottlePos,
&FGFCS::SetThrottlePos,
true );
if ( MixtureCmd.size() > i ) {
PropertyManager->Tie("fcs/mixture-cmd-norm",this,i,
snprintf(tmp,80,"fcs/mixture-cmd-norm[%u]",i);
PropertyManager->Tie( tmp,this,i,
&FGFCS::GetMixtureCmd,
&FGFCS::SetMixtureCmd,
true );
PropertyManager->Tie("fcs/mixture-pos-norm",this,i,
snprintf(tmp,80,"fcs/mixture-pos-norm[%u]",i);
PropertyManager->Tie( tmp,this,i,
&FGFCS::GetMixturePos,
&FGFCS::SetMixturePos,
true );
}
if ( PropAdvanceCmd.size() > i ) {
PropertyManager->Tie("fcs/advance-cmd-norm",this,i,
snprintf(tmp,80,"fcs/advance-cmd-norm[%u]",i);
PropertyManager->Tie( tmp,this,i,
&FGFCS::GetPropAdvanceCmd,
&FGFCS::SetPropAdvanceCmd,
true );
PropertyManager->Tie("fcs/advance-pos-norm",this,i,
snprintf(tmp,80,"fcs/advance-pos-norm[%u]",i);
PropertyManager->Tie( tmp,this,i,
&FGFCS::GetPropAdvance,
&FGFCS::SetPropAdvance,
true );

View file

@ -117,7 +117,7 @@ FGFDMExec::FGFDMExec(FGPropertyManager* root)
IdFDM = FDMctr;
FDMctr++;
try {
char* num = getenv("JSBSIM_DEBUG");
if (!num) debug_lvl = 1;
@ -154,7 +154,7 @@ FGFDMExec::~FGFDMExec()
cout << "Caught error: " << msg << endl;
}
for (int i=1; i<SlaveFDMList.size(); i++) delete SlaveFDMList[i]->exec;
for (unsigned int i=1; i<SlaveFDMList.size(); i++) delete SlaveFDMList[i]->exec;
SlaveFDMList.clear();
Debug(1);
@ -332,7 +332,7 @@ bool FGFDMExec::Run(void)
Debug(2);
for (int i=0; i<SlaveFDMList.size(); i++) {
for (unsigned int i=0; i<SlaveFDMList.size(); i++) {
// TransferState(i);
// Run(i)
}
@ -344,7 +344,6 @@ bool FGFDMExec::Run(void)
frame = Frame++;
State->IncrTime();
return true;
}
@ -377,7 +376,7 @@ vector <string> FGFDMExec::EnumerateFDMs(void)
FDMList.push_back(Aircraft->GetAircraftName());
for (int i=1; i<SlaveFDMList.size(); i++) {
for (unsigned int i=1; i<SlaveFDMList.size(); i++) {
FDMList.push_back(SlaveFDMList[i]->exec->GetAircraft()->GetAircraftName());
}

View file

@ -207,7 +207,7 @@ public:
FGPropertyManager* GetPropertyManager(void);
vector <string> EnumerateFDMs(void);
void SetSlave(void) {IsSlave = true;}
private:
FGModel* FirstModel;
@ -221,7 +221,7 @@ private:
bool IsSlave;
static FGPropertyManager *master;
FGPropertyManager *instance;
struct slaveData {
FGFDMExec* exec;
string info;

View file

@ -147,7 +147,6 @@ void FGFactorGroup::bind(FGPropertyManager* parent)
void FGFactorGroup::unbind(void)
{
unsigned i;
FGCoefficient::unbind();
for (i=0; i < sum.size(); i++) {
sum[i]->unbind();

View file

@ -117,6 +117,9 @@ private:
CoeffArray sum;
double SDtotal;
double totalValue;
string description;
string name;
FGPropertyManager *node;
void Debug(int from);
};

View file

@ -166,21 +166,22 @@ string FGGroundReactions::GetGroundReactionValues(void)
//%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
void FGGroundReactions::bind(void)
{
{
typedef double (FGGroundReactions::*PMF)(int) const;
PropertyManager->Tie("gear/num-units", this,
&FGGroundReactions::GetNumGearUnits);
PropertyManager->Tie("moments/l-gear-lbsft", this,1,
&FGGroundReactions::GetMoments);
(PMF)&FGGroundReactions::GetMoments);
PropertyManager->Tie("moments/m-gear-lbsft", this,2,
&FGGroundReactions::GetMoments);
(PMF)&FGGroundReactions::GetMoments);
PropertyManager->Tie("moments/n-gear-lbsft", this,3,
&FGGroundReactions::GetMoments);
(PMF)&FGGroundReactions::GetMoments);
PropertyManager->Tie("forces/fbx-gear-lbs", this,1,
&FGGroundReactions::GetForces);
(PMF)&FGGroundReactions::GetForces);
PropertyManager->Tie("forces/fby-gear-lbs", this,2,
&FGGroundReactions::GetForces);
(PMF)&FGGroundReactions::GetForces);
PropertyManager->Tie("forces/fbz-gear-lbs", this,3,
&FGGroundReactions::GetForces);
(PMF)&FGGroundReactions::GetForces);
}
//%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

View file

@ -129,12 +129,13 @@ bool FGInertial::LoadInertial(FGConfigFile* AC_cfg)
void FGInertial::bind(void)
{
typedef double (FGInertial::*PMF)(int) const;
PropertyManager->Tie("forces/fbx-inertial-lbs", this,1,
&FGInertial::GetForces);
(PMF)&FGInertial::GetForces);
PropertyManager->Tie("forces/fby-inertial-lbs", this,2,
&FGInertial::GetForces);
(PMF)&FGInertial::GetForces);
PropertyManager->Tie("forces/fbz-inertial-lbs", this,3,
&FGInertial::GetForces);
(PMF)&FGInertial::GetForces);
}
//%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

View file

@ -191,7 +191,8 @@ double FGMassBalance::GetPMIxz(void)
//%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
void FGMassBalance::bind(void)
{
{
typedef double (FGMassBalance::*PMF)(int) const;
PropertyManager->Tie("inertia/mass-slugs", this,
&FGMassBalance::GetMass);
PropertyManager->Tie("inertia/weight-lbs", this,
@ -207,11 +208,11 @@ void FGMassBalance::bind(void)
PropertyManager->Tie("inertia/ixz-lbsft2", this,
&FGMassBalance::GetIxz);
PropertyManager->Tie("inertia/cg-x-ft", this,1,
&FGMassBalance::GetXYZcg);
(PMF)&FGMassBalance::GetXYZcg);
PropertyManager->Tie("inertia/cg-y-ft", this,2,
&FGMassBalance::GetXYZcg);
(PMF)&FGMassBalance::GetXYZcg);
PropertyManager->Tie("inertia/cg-z-ft", this,3,
&FGMassBalance::GetXYZcg);
(PMF)&FGMassBalance::GetXYZcg);
}
//%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

View file

@ -357,7 +357,6 @@ class FGPropertyManager:public SGPropertyNode {
}
////////////////////////////////////////////////////////////////////////
// Convenience functions for setting property attributes.
////////////////////////////////////////////////////////////////////////
@ -382,7 +381,7 @@ class FGPropertyManager:public SGPropertyNode {
if (node == 0)
cout <<
"Attempt to set archive flag for non-existant property "
<< name;
<< name << endl;
else
node->setAttribute(SGPropertyNode::ARCHIVE, state);
}
@ -407,7 +406,7 @@ class FGPropertyManager:public SGPropertyNode {
if (node == 0)
cout <<
"Attempt to set read flag for non-existant property "
<< name;
<< name << endl;
else
node->setAttribute(SGPropertyNode::READ, state);
}
@ -432,13 +431,12 @@ class FGPropertyManager:public SGPropertyNode {
if (node == 0)
cout <<
"Attempt to set write flag for non-existant property "
<< name;
<< name << endl;
else
node->setAttribute(SGPropertyNode::WRITE, state);
}
////////////////////////////////////////////////////////////////////////
// Convenience functions for tying properties, with logging.
////////////////////////////////////////////////////////////////////////
@ -454,7 +452,7 @@ class FGPropertyManager:public SGPropertyNode {
Untie (const string &name)
{
if (!untie(name.c_str()))
cout << "Failed to untie property " << name;
cout << "Failed to untie property " << name << endl;
}
@ -478,7 +476,7 @@ class FGPropertyManager:public SGPropertyNode {
if (!tie(name.c_str(), SGRawValuePointer<bool>(pointer),
useDefault))
cout <<
"Failed to tie property " << name << " to a pointer";
"Failed to tie property " << name << " to a pointer" << endl;
}
@ -500,7 +498,7 @@ class FGPropertyManager:public SGPropertyNode {
if (!tie(name.c_str(), SGRawValuePointer<int>(pointer),
useDefault))
cout <<
"Failed to tie property " << name << " to a pointer";
"Failed to tie property " << name << " to a pointer" << endl;
}
@ -522,7 +520,7 @@ class FGPropertyManager:public SGPropertyNode {
if (!tie(name.c_str(), SGRawValuePointer<long>(pointer),
useDefault))
cout <<
"Failed to tie property " << name << " to a pointer";
"Failed to tie property " << name << " to a pointer" << endl;
}
@ -544,7 +542,7 @@ class FGPropertyManager:public SGPropertyNode {
if (!tie(name.c_str(), SGRawValuePointer<float>(pointer),
useDefault))
cout <<
"Failed to tie property " << name << " to a pointer";
"Failed to tie property " << name << " to a pointer" << endl;
}
@ -566,7 +564,7 @@ class FGPropertyManager:public SGPropertyNode {
if (!tie(name.c_str(), SGRawValuePointer<double>(pointer),
useDefault))
cout <<
"Failed to tie property " << name << " to a pointer";
"Failed to tie property " << name << " to a pointer" << endl;
}
/* template <class V> void
@ -610,7 +608,7 @@ class FGPropertyManager:public SGPropertyNode {
if (!tie(name.c_str(), SGRawValueFunctions<V>(getter, setter),
useDefault))
cout <<
"Failed to tie property " << name << " to functions";
"Failed to tie property " << name << " to functions" << endl;
}
@ -643,7 +641,7 @@ class FGPropertyManager:public SGPropertyNode {
setter),
useDefault))
cout <<
"Failed to tie property " << name << " to indexed functions";
"Failed to tie property " << name << " to indexed functions" << endl;
}
@ -675,7 +673,7 @@ class FGPropertyManager:public SGPropertyNode {
SGRawValueMethods<T,V>(*obj, getter, setter),
useDefault))
cout <<
"Failed to tie property " << name << " to object methods";
"Failed to tie property " << name << " to object methods" << endl;
}
@ -711,11 +709,10 @@ class FGPropertyManager:public SGPropertyNode {
setter),
useDefault))
cout <<
"Failed to tie property " << name << " to indexed object methods";
"Failed to tie property " << name << " to indexed object methods" << endl;
}
};
#endif // FGPROPERTYMANAGER_H

View file

@ -550,6 +550,7 @@ double FGPropulsion::GetTanksIxy(const FGColumnVector3& vXYZcg)
void FGPropulsion::bind(void)
{
typedef double (FGPropulsion::*PMF)(int) const;
/* PropertyManager->Tie("propulsion/num-engines", this,
&FGPropulsion::GetNumEngines);
PropertyManager->Tie("propulsion/num-tanks", this,
@ -559,17 +560,17 @@ void FGPropulsion::bind(void)
PropertyManager->Tie("propulsion/num-sel-ox-tanks", this,
&FGPropulsion::GetnumSelectedOxiTanks);
PropertyManager->Tie("forces/fbx-prop-lbs", this,1,
&FGPropulsion::GetForces);
(PMF)&FGPropulsion::GetForces);
PropertyManager->Tie("forces/fby-prop-lbs", this,2,
&FGPropulsion::GetForces);
(PMF)&FGPropulsion::GetForces);
PropertyManager->Tie("forces/fbz-prop-lbs", this,3,
&FGPropulsion::GetForces);
(PMF)&FGPropulsion::GetForces);
PropertyManager->Tie("moments/l-prop-lbsft", this,1,
&FGPropulsion::GetMoments);
(PMF)&FGPropulsion::GetMoments);
PropertyManager->Tie("moments/m-prop-lbsft", this,2,
&FGPropulsion::GetMoments);
(PMF)&FGPropulsion::GetMoments);
PropertyManager->Tie("moments/n-prop-lbsft", this,3,
&FGPropulsion::GetMoments);
(PMF)&FGPropulsion::GetMoments);
//PropertyManager->Tie("propulsion/tanks-weight-lbs", this,
// &FGPropulsion::GetTanksWeight);
}

View file

@ -158,36 +158,37 @@ void FGRotation::GetState(void)
void FGRotation::bind(void)
{
typedef double (FGRotation::*PMF)(int) const;
PropertyManager->Tie("velocities/p-rad_sec", this,1,
&FGRotation::GetPQR);
(PMF)&FGRotation::GetPQR);
PropertyManager->Tie("velocities/q-rad_sec", this,2,
&FGRotation::GetPQR);
(PMF)&FGRotation::GetPQR);
PropertyManager->Tie("velocities/r-rad_sec", this,3,
&FGRotation::GetPQR);
(PMF)&FGRotation::GetPQR);
PropertyManager->Tie("velocities/p-aero-rad_sec", this,1,
&FGRotation::GetAeroPQR);
(PMF)&FGRotation::GetAeroPQR);
PropertyManager->Tie("velocities/q-aero-rad_sec", this,2,
&FGRotation::GetAeroPQR);
(PMF)&FGRotation::GetAeroPQR);
PropertyManager->Tie("velocities/r-aero-rad_sec", this,3,
&FGRotation::GetAeroPQR);
(PMF)&FGRotation::GetAeroPQR);
PropertyManager->Tie("accelerations/pdot-rad_sec", this,1,
&FGRotation::GetPQRdot);
(PMF)&FGRotation::GetPQRdot);
PropertyManager->Tie("accelerations/qdot-rad_sec", this,2,
&FGRotation::GetPQRdot);
(PMF)&FGRotation::GetPQRdot);
PropertyManager->Tie("accelerations/rdot-rad_sec", this,3,
&FGRotation::GetPQRdot);
(PMF)&FGRotation::GetPQRdot);
PropertyManager->Tie("attitude/roll-rad", this,1,
&FGRotation::GetEuler);
(PMF)&FGRotation::GetEuler);
PropertyManager->Tie("attitude/pitch-rad", this,2,
&FGRotation::GetEuler);
(PMF)&FGRotation::GetEuler);
PropertyManager->Tie("attitude/heading-true-rad", this,3,
&FGRotation::GetEuler);
(PMF)&FGRotation::GetEuler);
PropertyManager->Tie("velocities/phidot-rad_sec", this,1,
&FGRotation::GetEulerRates);
(PMF)&FGRotation::GetEulerRates);
PropertyManager->Tie("velocities/thetadot-rad_sec", this,2,
&FGRotation::GetEulerRates);
(PMF)&FGRotation::GetEulerRates);
PropertyManager->Tie("velocities/psidot-rad_sec", this,3,
&FGRotation::GetEulerRates);
(PMF)&FGRotation::GetEulerRates);
PropertyManager->Tie("attitude/phi-rad", this,
&FGRotation::Getphi);
PropertyManager->Tie("attitude/theta-rad", this,

View file

@ -165,30 +165,31 @@ bool FGTranslation::Run(void)
void FGTranslation::bind(void)
{
typedef double (FGTranslation::*PMF)(int) const;
PropertyManager->Tie("velocities/u-fps", this,1,
&FGTranslation::GetUVW /*,
(PMF)&FGTranslation::GetUVW /*,
&FGTranslation::SetUVW,
true */);
PropertyManager->Tie("velocities/v-fps", this,2,
&FGTranslation::GetUVW /*,
(PMF)&FGTranslation::GetUVW /*,
&FGTranslation::SetUVW,
true*/);
PropertyManager->Tie("velocities/w-fps", this,3,
&FGTranslation::GetUVW /*,
(PMF)&FGTranslation::GetUVW /*,
&FGTranslation::SetUVW,
true*/);
PropertyManager->Tie("accelerations/udot-fps", this,1,
&FGTranslation::GetUVWdot);
(PMF)&FGTranslation::GetUVWdot);
PropertyManager->Tie("accelerations/vdot-fps", this,2,
&FGTranslation::GetUVWdot);
(PMF)&FGTranslation::GetUVWdot);
PropertyManager->Tie("accelerations/wdot-fps", this,3,
&FGTranslation::GetUVWdot);
(PMF)&FGTranslation::GetUVWdot);
PropertyManager->Tie("velocities/u-aero-fps", this,1,
&FGTranslation::GetAeroUVW);
(PMF)&FGTranslation::GetAeroUVW);
PropertyManager->Tie("velocities/v-aero-fps", this,2,
&FGTranslation::GetAeroUVW);
(PMF)&FGTranslation::GetAeroUVW);
PropertyManager->Tie("velocities/w-aero-fps", this,3,
&FGTranslation::GetAeroUVW);
(PMF)&FGTranslation::GetAeroUVW);
PropertyManager->Tie("aero/alpha-rad", this,
&FGTranslation::Getalpha,
&FGTranslation::Setalpha,

View file

@ -610,23 +610,26 @@ void FGTrim::setupTurn(void){
g = fdmex->GetInertial()->gravity();
psidot = g*tan(phi) / fgic->GetUBodyFpsIC();
cout << targetNlf << ", " << psidot << endl;
}
}
}
void FGTrim::updateRates(void){
if( mode == tTurn ) {
double phi = fgic->GetRollAngleRadIC();
double g = fdmex->GetInertial()->gravity();
double p,q,r,theta;
if(fabs(phi) > 0.001 && fabs(phi) < 1.56 ) {
double p,q,r,theta,phi;
theta=fgic->GetPitchAngleRadIC();
phi=fgic->GetRollAngleRadIC();
psidot = g*tan(phi) / fgic->GetUBodyFpsIC();
p=-psidot*sin(theta);
q=psidot*cos(theta)*sin(phi);
r=psidot*cos(theta)*cos(phi);
fdmex->GetRotation()->SetPQR(p,q,r);
}
} else {
p=q=r=0;
}
fdmex->GetRotation()->SetPQR(p,q,r);
} else if( mode == tPullup && fabs(targetNlf-1) > 0.01) {
float g,q,cgamma;
FGColumnVector3 vPQR;

View file

@ -32,6 +32,10 @@
INCLUDES
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%*/
#ifdef _MSC_VER
# pragma warning (disable : 4786)
#endif
#include <string>
#include <stdlib.h>