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,
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();
/** 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; }
FGColumnVector3 vLastFs;
FGColumnVector3 vDXYZcg;
double clsq,lod;
+
+ typedef double (FGAerodynamics::*PMF)(int) const;
void Debug(int from);
};
void FGAircraft::bind(void)
{
+ typedef double (FGAircraft::*PMF)(int) const;
PropertyManager->Tie("metrics/Sw-sqft", this,
&FGAircraft::GetWingArea);
PropertyManager->Tie("metrics/bw-ft", this,
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,
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
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
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,
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);
}
//%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
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
********************************************************************************
void FGAuxiliary::bind(void)
{
+ typedef double (FGAuxiliary::*PMF)(int) const;
PropertyManager->Tie("velocities/vc-fps", this,
&FGAuxiliary::GetVcalibratedFPS);
PropertyManager->Tie("velocities/vc-kts", this,
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,
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;
double bias,gain;
FGPropertyManager *LookupR, *LookupC;
+ FGPropertyManager *node; // must be private!!
+
MultVec multipliers;
int rows, columns;
Type type;
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 );
IdFDM = FDMctr;
FDMctr++;
-
+
try {
char* num = getenv("JSBSIM_DEBUG");
if (!num) debug_lvl = 1;
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);
Debug(2);
- for (int i=0; i<SlaveFDMList.size(); i++) {
+ for (unsigned int i=0; i<SlaveFDMList.size(); i++) {
// TransferState(i);
// Run(i)
}
frame = Frame++;
State->IncrTime();
-
return true;
}
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());
}
FGPropertyManager* GetPropertyManager(void);
vector <string> EnumerateFDMs(void);
void SetSlave(void) {IsSlave = true;}
-
+
private:
FGModel* FirstModel;
bool IsSlave;
static FGPropertyManager *master;
FGPropertyManager *instance;
-
+
struct slaveData {
FGFDMExec* exec;
string info;
void FGFactorGroup::unbind(void)
{
unsigned i;
-
FGCoefficient::unbind();
for (i=0; i < sum.size(); i++) {
sum[i]->unbind();
CoeffArray sum;
double SDtotal;
double totalValue;
+ string description;
+ string name;
+ FGPropertyManager *node;
void Debug(int from);
};
//%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
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);
}
//%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
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);
}
//%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
//%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
void FGMassBalance::bind(void)
-{
+{
+ typedef double (FGMassBalance::*PMF)(int) const;
PropertyManager->Tie("inertia/mass-slugs", this,
&FGMassBalance::GetMass);
PropertyManager->Tie("inertia/weight-lbs", this,
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);
}
//%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
}
- \f
////////////////////////////////////////////////////////////////////////
// Convenience functions for setting property attributes.
////////////////////////////////////////////////////////////////////////
if (node == 0)
cout <<
"Attempt to set archive flag for non-existant property "
- << name;
+ << name << endl;
else
node->setAttribute(SGPropertyNode::ARCHIVE, state);
}
if (node == 0)
cout <<
"Attempt to set read flag for non-existant property "
- << name;
+ << name << endl;
else
node->setAttribute(SGPropertyNode::READ, state);
}
if (node == 0)
cout <<
"Attempt to set write flag for non-existant property "
- << name;
+ << name << endl;
else
node->setAttribute(SGPropertyNode::WRITE, state);
}
- \f
////////////////////////////////////////////////////////////////////////
// Convenience functions for tying properties, with logging.
////////////////////////////////////////////////////////////////////////
Untie (const string &name)
{
if (!untie(name.c_str()))
- cout << "Failed to untie property " << name;
+ cout << "Failed to untie property " << name << endl;
}
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;
}
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;
}
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;
}
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;
}
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
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;
}
setter),
useDefault))
cout <<
- "Failed to tie property " << name << " to indexed functions";
+ "Failed to tie property " << name << " to indexed functions" << endl;
}
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;
}
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
void FGPropulsion::bind(void)
{
+ typedef double (FGPropulsion::*PMF)(int) const;
/* PropertyManager->Tie("propulsion/num-engines", this,
&FGPropulsion::GetNumEngines);
PropertyManager->Tie("propulsion/num-tanks", this,
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);
}
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,
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,
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;
INCLUDES
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%*/
+#ifdef _MSC_VER
+# pragma warning (disable : 4786)
+#endif
+
#include <string>
#include <stdlib.h>