1
0
Fork 0

Latest JSBSim changes.

This commit is contained in:
david 2002-04-16 13:15:29 +00:00
parent bd9b1c7558
commit adcb4fc30e
31 changed files with 550 additions and 471 deletions

View file

@ -112,7 +112,7 @@ bool FGAerodynamics::Run(void)
}
//correct signs of drag and lift to wind axes convention
//positive forward, right, down
if( Translation->Getqbar() > 0) {
if ( Translation->Getqbar() > 0) {
clsq = vFs(eLift) / (Aircraft->GetWingArea()*Translation->Getqbar());
clsq *= clsq;
}
@ -161,7 +161,7 @@ bool FGAerodynamics::Load(FGConfigFile* AC_cfg)
axis = AC_cfg->GetValue("NAME");
AC_cfg->GetNextConfigLine();
while ((token = AC_cfg->GetValue()) != string("/AXIS")) {
if( token == "COEFFICIENT" ) {
if ( token == "COEFFICIENT" ) {
ca.push_back( new FGCoefficient(FDMExec) );
ca.back()->Load(AC_cfg);
} else if ( token == "GROUP" ) {
@ -223,8 +223,8 @@ string FGAerodynamics::GetCoefficientValues(void)
//%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
void FGAerodynamics::bind(void){
void FGAerodynamics::bind(void)
{
PropertyManager->Tie("forces/fbx-aero-lbs", this,1,
&FGAerodynamics::GetForces);
PropertyManager->Tie("forces/fby-aero-lbs", this,2,
@ -251,24 +251,25 @@ void FGAerodynamics::bind(void){
//%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
void FGAerodynamics::bindModel(void) {
void FGAerodynamics::bindModel(void)
{
unsigned i,j;
FGPropertyManager* node;
string axis_node_name;
node = PropertyManager->GetNode("aero/buildup",true);
for(i=0;i<NAxes;i++) {
node=node->GetNode( string(AxisNames[i]),true );
for (i=0;i<NAxes;i++) {
node = node->GetNode( string(AxisNames[i]),true );
for (j=0; j < Coeff[i].size(); j++) {
Coeff[i][j]->bind(node);
}
node=(FGPropertyManager*)node->getParent();
node = (FGPropertyManager*)node->getParent();
}
}
//%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
void FGAerodynamics::unbind(void){
void FGAerodynamics::unbind(void)
{
unsigned i,j;
PropertyManager->Untie("forces/fbx-aero-lbs");
@ -283,7 +284,7 @@ void FGAerodynamics::unbind(void){
PropertyManager->Untie("forces/lod-norm");
PropertyManager->Untie("aero/cl-squared-norm");
for( i=0; i<NAxes; i++ ) {
for ( i=0; i<NAxes; i++ ) {
for ( j=0; j < Coeff[i].size(); j++ ) {
Coeff[i][j]->unbind();

View file

@ -115,17 +115,17 @@ public:
/** Gets the total aerodynamic force vector.
@return a force vector reference. */
FGColumnVector3& GetForces(void) {return vForces;}
double GetForces(int n) const {return vForces(n);}
inline double GetForces(int n) const {return vForces(n);}
/** Gets the total aerodynamic moment vector.
@return a moment vector reference. */
FGColumnVector3& GetMoments(void) {return vMoments;}
double GetMoments(int n) const {return vMoments(n);}
inline double GetMoments(int n) const {return vMoments(n);}
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 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); }
inline double GetLoD(void) const { return lod; }
inline double GetClSquared(void) const { return clsq; }

View file

@ -175,13 +175,13 @@ void FGAtmosphere::Calculate(double altitude)
i = lastIndex-1;
while (htab[i] > altitude) i--;
}
} else if (altitude > htab[lastIndex+1]){
if (altitude >= htab[7]){
} else if (altitude > htab[lastIndex+1]) {
if (altitude >= htab[7]) {
i = 7;
altitude = htab[7];
} else {
i = lastIndex+1;
while(htab[i+1] < altitude) i++;
while (htab[i+1] < altitude) i++;
}
}

View file

@ -150,7 +150,7 @@ bool FGAuxiliary::Run()
// The radius R is calculated below in the vector vToEyePt.
vPilotAccel.InitMatrix();
if( Translation->GetVt() > 1 ) {
if ( Translation->GetVt() > 1 ) {
vToEyePt = Aircraft->GetXYZep() - MassBalance->GetXYZcg();
vToEyePt *= inchtoft;
vPilotAccel = Aerodynamics->GetForces()
@ -197,6 +197,60 @@ double FGAuxiliary::GetCrossWind(void)
//%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
void FGAuxiliary::bind(void)
{
PropertyManager->Tie("velocities/vc-fps", this,
&FGAuxiliary::GetVcalibratedFPS);
PropertyManager->Tie("velocities/vc-kts", this,
&FGAuxiliary::GetVcalibratedKTS);
PropertyManager->Tie("velocities/ve-fps", this,
&FGAuxiliary::GetVequivalentFPS);
PropertyManager->Tie("velocities/ve-kts", this,
&FGAuxiliary::GetVequivalentKTS);
PropertyManager->Tie("accelerations/a-pilot-x-ft_sec2", this,1,
&FGAuxiliary::GetPilotAccel);
PropertyManager->Tie("accelerations/a-pilot-y-ft_sec2", this,2,
&FGAuxiliary::GetPilotAccel);
PropertyManager->Tie("accelerations/a-pilot-z-ft_sec2", this,3,
&FGAuxiliary::GetPilotAccel);
PropertyManager->Tie("accelerations/n-pilot-x-norm", this,1,
&FGAuxiliary::GetNpilot);
PropertyManager->Tie("accelerations/n-pilot-y-norm", this,2,
&FGAuxiliary::GetNpilot);
PropertyManager->Tie("accelerations/n-pilot-z-norm", this,3,
&FGAuxiliary::GetNpilot);
PropertyManager->Tie("position/epa-rad", this,
&FGAuxiliary::GetEarthPositionAngle);
/* PropertyManager->Tie("atmosphere/headwind-fps", this,
&FGAuxiliary::GetHeadWind,
true);
PropertyManager->Tie("atmosphere/crosswind-fps", this,
&FGAuxiliary::GetCrossWind,
true); */
}
//%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
void FGAuxiliary::unbind(void)
{
PropertyManager->Untie("velocities/vc-fps");
PropertyManager->Untie("velocities/vc-kts");
PropertyManager->Untie("velocities/ve-fps");
PropertyManager->Untie("velocities/ve-kts");
PropertyManager->Untie("accelerations/a-pilot-x-ft_sec2");
PropertyManager->Untie("accelerations/a-pilot-y-ft_sec2");
PropertyManager->Untie("accelerations/a-pilot-z-ft_sec2");
PropertyManager->Untie("accelerations/n-pilot-x-norm");
PropertyManager->Untie("accelerations/n-pilot-y-norm");
PropertyManager->Untie("accelerations/n-pilot-z-norm");
PropertyManager->Untie("position/epa-rad");
/* PropertyManager->Untie("atmosphere/headwind-fps");
PropertyManager->Untie("atmosphere/crosswind-fps"); */
}
//%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
void FGAuxiliary::GetState(void)
{
qbar = Translation->Getqbar();
@ -252,51 +306,3 @@ void FGAuxiliary::Debug(int from)
}
}
void FGAuxiliary::bind(void){
PropertyManager->Tie("velocities/vc-fps", this,
&FGAuxiliary::GetVcalibratedFPS);
PropertyManager->Tie("velocities/vc-kts", this,
&FGAuxiliary::GetVcalibratedKTS);
PropertyManager->Tie("velocities/ve-fps", this,
&FGAuxiliary::GetVequivalentFPS);
PropertyManager->Tie("velocities/ve-kts", this,
&FGAuxiliary::GetVequivalentKTS);
PropertyManager->Tie("accelerations/a-pilot-x-ft_sec2", this,1,
&FGAuxiliary::GetPilotAccel);
PropertyManager->Tie("accelerations/a-pilot-y-ft_sec2", this,2,
&FGAuxiliary::GetPilotAccel);
PropertyManager->Tie("accelerations/a-pilot-z-ft_sec2", this,3,
&FGAuxiliary::GetPilotAccel);
PropertyManager->Tie("accelerations/n-pilot-x-norm", this,1,
&FGAuxiliary::GetNpilot);
PropertyManager->Tie("accelerations/n-pilot-y-norm", this,2,
&FGAuxiliary::GetNpilot);
PropertyManager->Tie("accelerations/n-pilot-z-norm", this,3,
&FGAuxiliary::GetNpilot);
PropertyManager->Tie("position/epa-rad", this,
&FGAuxiliary::GetEarthPositionAngle);
/* PropertyManager->Tie("atmosphere/headwind-fps", this,
&FGAuxiliary::GetHeadWind,
true);
PropertyManager->Tie("atmosphere/crosswind-fps", this,
&FGAuxiliary::GetCrossWind,
true); */
}
void FGAuxiliary::unbind(void){
PropertyManager->Untie("velocities/vc-fps");
PropertyManager->Untie("velocities/vc-kts");
PropertyManager->Untie("velocities/ve-fps");
PropertyManager->Untie("velocities/ve-kts");
PropertyManager->Untie("accelerations/a-pilot-x-ft_sec2");
PropertyManager->Untie("accelerations/a-pilot-y-ft_sec2");
PropertyManager->Untie("accelerations/a-pilot-z-ft_sec2");
PropertyManager->Untie("accelerations/n-pilot-x-norm");
PropertyManager->Untie("accelerations/n-pilot-y-norm");
PropertyManager->Untie("accelerations/n-pilot-z-norm");
PropertyManager->Untie("position/epa-rad");
/* PropertyManager->Untie("atmosphere/headwind-fps");
PropertyManager->Untie("atmosphere/crosswind-fps"); */
}

View file

@ -68,21 +68,31 @@ CLASS IMPLEMENTATION
FGCoefficient::FGCoefficient( FGFDMExec* fdex )
{
FDMExec = fdex;
State = FDMExec->GetState();
Table = 0;
PropertyManager = FDMExec->GetPropertyManager();
bias=0;
gain=1;
Table = (FGTable*)0L;
LookupR = LookupC = 0;
totalValue = 0;
numInstances = 0;
rows = columns = 0;
if (debug_lvl & 2) cout << "Instantiated: FGCoefficient" << endl;
StaticValue = 0.0;
totalValue = 0.0;
bias = 0.0;
gain = 1.0;
filename.erase();
description.erase();
name.erase();
method.erase();
multparms.erase();
multparmsRow.erase();
multparmsCol.erase();
Debug(0);
}
//%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
@ -90,7 +100,7 @@ FGCoefficient::FGCoefficient( FGFDMExec* fdex )
FGCoefficient::~FGCoefficient()
{
if (Table) delete Table;
if (debug_lvl & 2) cout << "Destroyed: FGCoefficient" << endl;
Debug(1);
}
//%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
@ -284,23 +294,24 @@ string FGCoefficient::GetCoefficientValues(void)
//%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
void FGCoefficient::bind(FGPropertyManager *parent) {
void FGCoefficient::bind(FGPropertyManager *parent)
{
string mult;
unsigned i;
node=parent->GetNode(name,true);
node->SetString("description",description);
if(LookupR) node->SetString("row-parm",LookupR->getName() );
if(LookupC) node->SetString("column-parm",LookupC->getName() );
if (LookupR) node->SetString("row-parm",LookupR->getName() );
if (LookupC) node->SetString("column-parm",LookupC->getName() );
mult="";
if(multipliers.size() == 0)
if (multipliers.size() == 0)
mult="none";
for (i=0; i<multipliers.size(); i++) {
mult += multipliers[i]->getName();
if( i < multipliers.size()-1 ) mult += " ";
if ( i < multipliers.size()-1 ) mult += " ";
}
node->SetString("multipliers",mult);
@ -317,12 +328,14 @@ void FGCoefficient::bind(FGPropertyManager *parent) {
//%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
void FGCoefficient::unbind(void) {
void FGCoefficient::unbind(void)
{
node->Untie("SD-norm");
node->Untie("value-lbs");
node->Untie("bias");
node->Untie("gain");
}
}
//%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
// The bitmasked value choices are as follows:
// unset: In this case (the default) JSBSim would only print

View file

@ -131,13 +131,17 @@ public:
virtual void bind(FGPropertyManager *parent);
virtual void unbind(void);
protected:
FGFDMExec* FDMExec;
string description;
string name;
FGPropertyManager *node;
private:
enum Type {UNKNOWN, VALUE, VECTOR, TABLE, EQUATION};
int numInstances;
string filename;
string description;
string name;
string method;
string multparms;
string multparmsRow;
@ -149,7 +153,6 @@ private:
double totalValue;
double bias,gain;
FGPropertyManager *LookupR, *LookupC;
FGPropertyManager *node;
MultVec multipliers;
int rows, columns;
@ -157,7 +160,6 @@ private:
double SD; // Actual stability derivative (or other coefficient) value
FGTable *Table;
FGFDMExec* FDMExec;
FGState* State;
FGAtmosphere* Atmosphere;
FGFCS* FCS;

View file

@ -136,7 +136,7 @@ private:
string LineComment;
bool CommentsOn;
bool Opened;
unsigned int CurrentIndex;
unsigned int CurrentIndex;
void Debug(int from);
};

View file

@ -76,12 +76,12 @@ FGFCS::FGFCS(FGFDMExec* fdmex) : FGModel(fdmex)
DoNormalize=true;
bind();
for(i=0;i<=NForms;i++) {
for (i=0;i<=NForms;i++) {
DePos[i] = DaLPos[i] = DaRPos[i] = DrPos[i] = 0.0;
DfPos[i] = DsbPos[i] = DspPos[i] = 0.0;
}
for(i=0;i<NNorm;i++) { ToNormalize[i]=-1;}
for (i=0;i<NNorm;i++) { ToNormalize[i]=-1;}
Debug(0);
}
@ -115,7 +115,7 @@ bool FGFCS::Run(void)
for (i=0; i<MixturePos.size(); i++) MixturePos[i] = MixtureCmd[i];
for (i=0; i<PropAdvance.size(); i++) PropAdvance[i] = PropAdvanceCmd[i];
for (i=0; i<Components.size(); i++) Components[i]->Run();
if(DoNormalize) Normalize();
if (DoNormalize) Normalize();
} else {
}
@ -265,7 +265,7 @@ bool FGFCS::Load(FGConfigFile* AC_cfg)
Name = Name + ":" + AC_cfg->GetValue("NAME");
if (debug_lvl > 0) cout << " Control System Name: " << Name << endl;
if( AC_cfg->GetValue("NORMALIZE") == "FALSE") {
if ( AC_cfg->GetValue("NORMALIZE") == "FALSE") {
DoNormalize=false;
cout << " Automatic Control Surface Normalization Disabled" << endl;
}
@ -307,13 +307,13 @@ bool FGFCS::Load(FGConfigFile* AC_cfg)
}
//collect information for normalizing control surfaces
string nodeName;
for(i=0;i<Components.size();i++) {
for (i=0;i<Components.size();i++) {
if( (Components[i]->GetType() == "AEROSURFACE_SCALE"
if ( (Components[i]->GetType() == "AEROSURFACE_SCALE"
|| Components[i]->GetType() == "KINEMAT")
&& Components[i]->GetOutputNode() ) {
nodeName= Components[i]->GetOutputNode()->GetName();
if( nodeName == "elevator-pos-rad" ) {
if ( nodeName == "elevator-pos-rad" ) {
ToNormalize[iDe]=i;
} else if ( nodeName == "left-aileron-pos-rad"
|| nodeName == "aileron-pos-rad" ) {
@ -424,31 +424,31 @@ void FGFCS::Normalize(void) {
//those that are have an index >=0 in the ToNormalize array
//ToNormalize is filled in Load()
if( ToNormalize[iDe] > -1 ) {
if ( ToNormalize[iDe] > -1 ) {
DePos[ofNorm] = Components[ToNormalize[iDe]]->GetOutputPct();
}
if( ToNormalize[iDaL] > -1 ) {
if ( ToNormalize[iDaL] > -1 ) {
DaLPos[ofNorm] = Components[ToNormalize[iDaL]]->GetOutputPct();
}
if( ToNormalize[iDaR] > -1 ) {
if ( ToNormalize[iDaR] > -1 ) {
DaRPos[ofNorm] = Components[ToNormalize[iDaR]]->GetOutputPct();
}
if( ToNormalize[iDr] > -1 ) {
if ( ToNormalize[iDr] > -1 ) {
DrPos[ofNorm] = Components[ToNormalize[iDr]]->GetOutputPct();
}
if( ToNormalize[iDsb] > -1 ) {
if ( ToNormalize[iDsb] > -1 ) {
DsbPos[ofNorm] = Components[ToNormalize[iDsb]]->GetOutputPct();
}
if( ToNormalize[iDsp] > -1 ) {
if ( ToNormalize[iDsp] > -1 ) {
DspPos[ofNorm] = Components[ToNormalize[iDsp]]->GetOutputPct();
}
if( ToNormalize[iDf] > -1 ) {
if ( ToNormalize[iDf] > -1 ) {
DfPos[ofNorm] = Components[ToNormalize[iDf]]->GetOutputPct();
}
@ -464,7 +464,8 @@ void FGFCS::Normalize(void) {
//%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
void FGFCS::bind(void){
void FGFCS::bind(void)
{
PropertyManager->Tie("fcs/aileron-cmd-norm", this,
&FGFCS::GetDaCmd,
&FGFCS::SetDaCmd,
@ -598,11 +599,14 @@ void FGFCS::bind(void){
&FGFCS::SetGearPos,
true);
}
//%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
void FGFCS::bindModel(void){
void FGFCS::bindModel(void)
{
unsigned i;
for(i=0;i<ThrottleCmd.size();i++) {
for (i=0; i<ThrottleCmd.size(); i++) {
PropertyManager->Tie("fcs/throttle-cmd-norm",this,i,
&FGFCS::GetThrottleCmd,
&FGFCS::SetThrottleCmd,
@ -611,7 +615,7 @@ void FGFCS::bindModel(void){
&FGFCS::GetThrottlePos,
&FGFCS::SetThrottlePos,
true );
if( MixtureCmd.size() > i ) {
if ( MixtureCmd.size() > i ) {
PropertyManager->Tie("fcs/mixture-cmd-norm",this,i,
&FGFCS::GetMixtureCmd,
&FGFCS::SetMixtureCmd,
@ -621,7 +625,7 @@ void FGFCS::bindModel(void){
&FGFCS::SetMixturePos,
true );
}
if( PropAdvanceCmd.size() > i ) {
if ( PropAdvanceCmd.size() > i ) {
PropertyManager->Tie("fcs/advance-cmd-norm",this,i,
&FGFCS::GetPropAdvanceCmd,
&FGFCS::SetPropAdvanceCmd,
@ -636,7 +640,8 @@ void FGFCS::bindModel(void){
//%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
void FGFCS::unbind(void){
void FGFCS::unbind(void)
{
PropertyManager->Untie("fcs/aileron-cmd-norm");
PropertyManager->Untie("fcs/elevator-cmd-norm");
PropertyManager->Untie("fcs/rudder-cmd-norm");
@ -670,8 +675,6 @@ void FGFCS::unbind(void){
PropertyManager->Untie("gear/gear-pos-norm");
}
//%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
// The bitmasked value choices are as follows:
// unset: In this case (the default) JSBSim would only print

View file

@ -210,7 +210,7 @@ bool FGFDMExec::Allocate(void)
if (!Aircraft->InitModel()) {
cerr << fgred << "Aircraft model init failed" << fgdef << endl;
Error+=128;}
if (!Translation->InitModel()){
if (!Translation->InitModel()) {
cerr << fgred << "Translation model init failed" << fgdef << endl;
Error+=256;}
if (!Rotation->InitModel()) {

View file

@ -69,6 +69,10 @@ CLASS DOCUMENTATION
/** Encapsulates the JSBSim simulation executive.
@author Jon S. Berndt
@version $Id$
@see <a href="http://cvs.sourceforge.net/cgi-bin/viewcvs.cgi/jsbsim/JSBSim/FGFDMExec.h?rev=HEAD&content-type=text/vnd.viewcvs-markup">
Header File </a>
@see <a href="http://cvs.sourceforge.net/cgi-bin/viewcvs.cgi/jsbsim/JSBSim/FGFDMExec.cpp?rev=HEAD&content-type=text/vnd.viewcvs-markup">
Source File </a>
@doc This class is the interface class through which all other simulation classes
are instantiated, initialized, and run. When integrated with FlightGear (or

View file

@ -121,7 +121,6 @@ double FGFactorGroup::TotalValue(void)
totalValue += sum[i]->TotalValue();
SDtotal += sum[i]->GetSD();
}
//cout << totalValue << " " << FGCoefficient::TotalValue() << endl;
totalValue *= FGCoefficient::TotalValue();
SDtotal *= FGCoefficient::GetSD();
Debug(2);
@ -130,13 +129,10 @@ double FGFactorGroup::TotalValue(void)
/*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%*/
void FGFactorGroup::bind(FGPropertyManager* parent) {
cout << "In FGFactorGroup::bind" << endl;
cout << parent->getName() << endl;
void FGFactorGroup::bind(FGPropertyManager* parent)
{
unsigned i;
node=parent->GetNode(name,true);
cout << node->getName() << endl;
node->SetString("description",description);
FGCoefficient::bind(node);
for (i=0; i < sum.size(); i++) {
@ -148,7 +144,8 @@ void FGFactorGroup::bind(FGPropertyManager* parent) {
/*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%*/
void FGFactorGroup::unbind(void) {
void FGFactorGroup::unbind(void)
{
unsigned i;
FGCoefficient::unbind();

View file

@ -95,31 +95,29 @@ CLASS DOCUMENTATION
CLASS DECLARATION
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%*/
class FGFactorGroup: public FGCoefficient {
public:
FGFactorGroup(FGFDMExec* fdmex);
~FGFactorGroup();
bool Load(FGConfigFile *AC_cfg);
double TotalValue(void);
inline double GetValue(void) const { return totalValue; }
//string GetCoefficientStrings(void);
//string GetCoefficientValues(void);
inline double GetSD(void) { return SDtotal; }
inline double GetFactorSD(void) { return FGCoefficient::GetSD(); }
void bind(FGPropertyManager* parent);
void unbind(void);
private:
FGFDMExec *FDMExec;
string name;
string description;
typedef vector<FGCoefficient*> CoeffArray;
CoeffArray sum;
double SDtotal;
double totalValue;
FGPropertyManager* node;
void Debug(int from);
class FGFactorGroup: public FGCoefficient
{
public:
FGFactorGroup(FGFDMExec* fdmex);
~FGFactorGroup();
bool Load(FGConfigFile *AC_cfg);
double TotalValue(void);
inline double GetValue(void) const { return totalValue; }
//string GetCoefficientStrings(void);
//string GetCoefficientValues(void);
inline double GetSD(void) { return SDtotal; }
inline double GetFactorSD(void) { return FGCoefficient::GetSD(); }
void bind(FGPropertyManager* parent);
void unbind(void);
private:
typedef vector<FGCoefficient*> CoeffArray;
CoeffArray sum;
double SDtotal;
double totalValue;
void Debug(int from);
};
#endif

View file

@ -163,6 +163,39 @@ string FGGroundReactions::GetGroundReactionValues(void)
return GroundReactionValues;
}
//%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
void FGGroundReactions::bind(void)
{
PropertyManager->Tie("gear/num-units", this,
&FGGroundReactions::GetNumGearUnits);
PropertyManager->Tie("moments/l-gear-lbsft", this,1,
&FGGroundReactions::GetMoments);
PropertyManager->Tie("moments/m-gear-lbsft", this,2,
&FGGroundReactions::GetMoments);
PropertyManager->Tie("moments/n-gear-lbsft", this,3,
&FGGroundReactions::GetMoments);
PropertyManager->Tie("forces/fbx-gear-lbs", this,1,
&FGGroundReactions::GetForces);
PropertyManager->Tie("forces/fby-gear-lbs", this,2,
&FGGroundReactions::GetForces);
PropertyManager->Tie("forces/fbz-gear-lbs", this,3,
&FGGroundReactions::GetForces);
}
//%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
void FGGroundReactions::unbind(void)
{
PropertyManager->Untie("gear/num-units");
PropertyManager->Untie("moments/l-gear-lbsft");
PropertyManager->Untie("moments/m-gear-lbsft");
PropertyManager->Untie("moments/n-gear-lbsft");
PropertyManager->Untie("forces/fbx-gear-lbs");
PropertyManager->Untie("forces/fby-gear-lbs");
PropertyManager->Untie("forces/fbz-gear-lbs");
}
//%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
// The bitmasked value choices are as follows:
// unset: In this case (the default) JSBSim would only print
@ -209,30 +242,3 @@ void FGGroundReactions::Debug(int from)
}
}
void FGGroundReactions::bind(void){
PropertyManager->Tie("gear/num-units", this,
&FGGroundReactions::GetNumGearUnits);
PropertyManager->Tie("moments/l-gear-lbsft", this,1,
&FGGroundReactions::GetMoments);
PropertyManager->Tie("moments/m-gear-lbsft", this,2,
&FGGroundReactions::GetMoments);
PropertyManager->Tie("moments/n-gear-lbsft", this,3,
&FGGroundReactions::GetMoments);
PropertyManager->Tie("forces/fbx-gear-lbs", this,1,
&FGGroundReactions::GetForces);
PropertyManager->Tie("forces/fby-gear-lbs", this,2,
&FGGroundReactions::GetForces);
PropertyManager->Tie("forces/fbz-gear-lbs", this,3,
&FGGroundReactions::GetForces);
}
void FGGroundReactions::unbind(void){
PropertyManager->Untie("gear/num-units");
PropertyManager->Untie("moments/l-gear-lbsft");
PropertyManager->Untie("moments/m-gear-lbsft");
PropertyManager->Untie("moments/n-gear-lbsft");
PropertyManager->Untie("forces/fbx-gear-lbs");
PropertyManager->Untie("forces/fby-gear-lbs");
PropertyManager->Untie("forces/fbz-gear-lbs");
}

View file

@ -125,6 +125,27 @@ bool FGInertial::LoadInertial(FGConfigFile* AC_cfg)
return true;
}
//%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
void FGInertial::bind(void)
{
PropertyManager->Tie("forces/fbx-inertial-lbs", this,1,
&FGInertial::GetForces);
PropertyManager->Tie("forces/fby-inertial-lbs", this,2,
&FGInertial::GetForces);
PropertyManager->Tie("forces/fbz-inertial-lbs", this,3,
&FGInertial::GetForces);
}
//%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
void FGInertial::unbind(void)
{
PropertyManager->Untie("forces/fbx-inertial-lbs");
PropertyManager->Untie("forces/fby-inertial-lbs");
PropertyManager->Untie("forces/fbz-inertial-lbs");
}
//%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
// The bitmasked value choices are as follows:
// unset: In this case (the default) JSBSim would only print
@ -171,17 +192,3 @@ void FGInertial::Debug(int from)
}
}
void FGInertial::bind(void){
PropertyManager->Tie("forces/fbx-inertial-lbs", this,1,
&FGInertial::GetForces);
PropertyManager->Tie("forces/fby-inertial-lbs", this,2,
&FGInertial::GetForces);
PropertyManager->Tie("forces/fbz-inertial-lbs", this,3,
&FGInertial::GetForces);
}
void FGInertial::unbind(void){
PropertyManager->Untie("forces/fbx-inertial-lbs");
PropertyManager->Untie("forces/fby-inertial-lbs");
PropertyManager->Untie("forces/fbz-inertial-lbs");
}

View file

@ -188,6 +188,48 @@ double FGMassBalance::GetPMIxz(void)
return I;
}
//%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
void FGMassBalance::bind(void)
{
PropertyManager->Tie("inertia/mass-slugs", this,
&FGMassBalance::GetMass);
PropertyManager->Tie("inertia/weight-lbs", this,
&FGMassBalance::GetWeight);
PropertyManager->Tie("inertia/ixx-lbsft2", this,
&FGMassBalance::GetIxx);
PropertyManager->Tie("inertia/iyy-lbsft2", this,
&FGMassBalance::GetIyy);
PropertyManager->Tie("inertia/izz-lbsft2", this,
&FGMassBalance::GetIzz);
PropertyManager->Tie("inertia/ixy-lbsft2", this,
&FGMassBalance::GetIxy);
PropertyManager->Tie("inertia/ixz-lbsft2", this,
&FGMassBalance::GetIxz);
PropertyManager->Tie("inertia/cg-x-ft", this,1,
&FGMassBalance::GetXYZcg);
PropertyManager->Tie("inertia/cg-y-ft", this,2,
&FGMassBalance::GetXYZcg);
PropertyManager->Tie("inertia/cg-z-ft", this,3,
&FGMassBalance::GetXYZcg);
}
//%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
void FGMassBalance::unbind(void)
{
PropertyManager->Untie("inertia/mass-slugs");
PropertyManager->Untie("inertia/weight-lbs");
PropertyManager->Untie("inertia/ixx-lbsft2");
PropertyManager->Untie("inertia/iyy-lbsft2");
PropertyManager->Untie("inertia/izz-lbsft2");
PropertyManager->Untie("inertia/ixy-lbsft2");
PropertyManager->Untie("inertia/ixz-lbsft2");
PropertyManager->Untie("inertia/cg-x-ft");
PropertyManager->Untie("inertia/cg-y-ft");
PropertyManager->Untie("inertia/cg-z-ft");
}
//%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
// The bitmasked value choices are as follows:
// unset: In this case (the default) JSBSim would only print
@ -242,38 +284,3 @@ void FGMassBalance::Debug(int from)
}
}
void FGMassBalance::bind(void){
PropertyManager->Tie("inertia/mass-slugs", this,
&FGMassBalance::GetMass);
PropertyManager->Tie("inertia/weight-lbs", this,
&FGMassBalance::GetWeight);
PropertyManager->Tie("inertia/ixx-lbsft2", this,
&FGMassBalance::GetIxx);
PropertyManager->Tie("inertia/iyy-lbsft2", this,
&FGMassBalance::GetIyy);
PropertyManager->Tie("inertia/izz-lbsft2", this,
&FGMassBalance::GetIzz);
PropertyManager->Tie("inertia/ixy-lbsft2", this,
&FGMassBalance::GetIxy);
PropertyManager->Tie("inertia/ixz-lbsft2", this,
&FGMassBalance::GetIxz);
PropertyManager->Tie("inertia/cg-x-ft", this,1,
&FGMassBalance::GetXYZcg);
PropertyManager->Tie("inertia/cg-y-ft", this,2,
&FGMassBalance::GetXYZcg);
PropertyManager->Tie("inertia/cg-z-ft", this,3,
&FGMassBalance::GetXYZcg);
}
void FGMassBalance::unbind(void){
PropertyManager->Untie("inertia/mass-slugs");
PropertyManager->Untie("inertia/weight-lbs");
PropertyManager->Untie("inertia/ixx-lbsft2");
PropertyManager->Untie("inertia/iyy-lbsft2");
PropertyManager->Untie("inertia/izz-lbsft2");
PropertyManager->Untie("inertia/ixy-lbsft2");
PropertyManager->Untie("inertia/ixz-lbsft2");
PropertyManager->Untie("inertia/cg-x-ft");
PropertyManager->Untie("inertia/cg-y-ft");
PropertyManager->Untie("inertia/cg-z-ft");
}

View file

@ -328,7 +328,7 @@ FGMatrix33 FGMatrix33::operator/(const double scalar)
{
FGMatrix33 Quot;
if( scalar != 0 ) {
if ( scalar != 0 ) {
double tmp = 1.0/scalar;
Quot(1,1) = data[1][1] * tmp;
Quot(1,2) = data[1][2] * tmp;
@ -351,7 +351,7 @@ FGMatrix33 FGMatrix33::operator/(const double scalar)
void FGMatrix33::operator/=(const double scalar)
{
if( scalar != 0 ) {
if ( scalar != 0 ) {
double tmp = 1.0/scalar;
data[1][1] *= tmp;
data[1][2] *= tmp;

View file

@ -91,7 +91,6 @@ FGModel::FGModel(FGFDMExec* fdmex)
//must be brought up now.
PropertyManager = FDMExec->GetPropertyManager();
exe_ctr = 1;
if (debug_lvl & 2) cout << " FGModel Base Class" << endl;

View file

@ -97,6 +97,10 @@ CLASS DOCUMENTATION
/** Base class for all scheduled JSBSim models
@author Jon S. Berndt
@see <a href="http://cvs.sourceforge.net/cgi-bin/viewcvs.cgi/jsbsim/JSBSim/FGModel.h?rev=HEAD&content-type=text/vnd.viewcvs-markup">
Header File </a>
@see <a href="http://cvs.sourceforge.net/cgi-bin/viewcvs.cgi/jsbsim/JSBSim/FGModel.cpp?rev=HEAD&content-type=text/vnd.viewcvs-markup">
Source File </a>
*/
/*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

View file

@ -117,7 +117,7 @@ void FGOutput::SetType(string type)
Type = otSocket;
} else if (type == "TERMINAL") {
Type = otTerminal;
} else if (type != string("NONE")){
} else if (type != string("NONE")) {
Type = otUnknown;
cerr << "Unknown type of output specified in config file" << endl;
}

View file

@ -163,7 +163,7 @@ double FGPiston::Calculate(double PowerRequired)
//Assume lean limit at 22 AFR for now - thats a thi of 0.668
//This might be a bit generous, but since there's currently no audiable warning of impending
//cutout in the form of misfiring and/or rough running its probably reasonable for now.
if(equivalence_ratio < 0.668)
if (equivalence_ratio < 0.668)
Running = false;
doEnginePower();
@ -231,7 +231,7 @@ void FGPiston::doEngineStartup(void)
if ((!Running) && (spark) && (fuel)) {
// start the engine if revs high enough
if(Cranking) {
if (Cranking) {
if ((RPM > 450) && (crank_counter > 175)) {
//Add a little delay to startup on the starter
Running = true;
@ -355,7 +355,7 @@ void FGPiston::doFuelFlow(void)
void FGPiston::doEnginePower(void)
{
ManifoldPressure_inHg *= p_amb / p_amb_sea_level;
if(Running) {
if (Running) {
double ManXRPM = ManifoldPressure_inHg * RPM;
// FIXME: this needs to be generalized
Percentage_Power = (6e-9 * ManXRPM * ManXRPM) + (8e-4 * ManXRPM) - 1.0;

View file

@ -228,6 +228,77 @@ void FGPosition::SetDistanceAGL(double tt) {
hoverbcg = DistanceAGL/b;
}
//%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
void FGPosition::bind(void)
{
PropertyManager->Tie("velocities/v-north-fps", this,
&FGPosition::GetVn);
PropertyManager->Tie("velocities/v-east-fps", this,
&FGPosition::GetVe);
PropertyManager->Tie("velocities/v-down-fps", this,
&FGPosition::GetVd);
PropertyManager->Tie("velocities/vg-fps", this,
&FGPosition::GetVground);
PropertyManager->Tie("flight-path/psi-gt-rad", this,
&FGPosition::GetGroundTrack);
PropertyManager->Tie("position/h-sl-ft", this,
&FGPosition::Geth,
&FGPosition::Seth,
true);
PropertyManager->Tie("velocities/h-dot-fps", this,
&FGPosition::Gethdot);
PropertyManager->Tie("position/lat-gc-rad", this,
&FGPosition::GetLatitude,
&FGPosition::SetLatitude);
PropertyManager->Tie("position/lat-dot-gc-rad", this,
&FGPosition::GetLatitudeDot);
PropertyManager->Tie("position/long-gc-rad", this,
&FGPosition::GetLongitude,
&FGPosition::SetLongitude,
true);
PropertyManager->Tie("position/long-dot-gc-rad", this,
&FGPosition::GetLongitudeDot);
PropertyManager->Tie("metrics/runway-radius", this,
&FGPosition::GetRunwayRadius,
&FGPosition::SetRunwayRadius);
PropertyManager->Tie("position/h-agl-ft", this,
&FGPosition::GetDistanceAGL,
&FGPosition::SetDistanceAGL);
PropertyManager->Tie("position/radius-to-vehicle-ft", this,
&FGPosition::GetRadius);
PropertyManager->Tie("flight-path/gamma-rad", this,
&FGPosition::GetGamma,
&FGPosition::SetGamma);
PropertyManager->Tie("aero/h_b-cg-ft", this,
&FGPosition::GetHOverBCG);
PropertyManager->Tie("aero/h_b-mac-ft", this,
&FGPosition::GetHOverBMAC);
}
//%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
void FGPosition::unbind(void)
{
PropertyManager->Untie("velocities/v-north-fps");
PropertyManager->Untie("velocities/v-east-fps");
PropertyManager->Untie("velocities/v-down-fps");
PropertyManager->Untie("velocities/vg-fps");
PropertyManager->Untie("flight-path/psi-gt-rad");
PropertyManager->Untie("position/h-sl-ft");
PropertyManager->Untie("velocities/h-dot-fps");
PropertyManager->Untie("position/lat-gc-rad");
PropertyManager->Untie("position/lat-dot-gc-rad");
PropertyManager->Untie("position/long-gc-rad");
PropertyManager->Untie("position/long-dot-gc-rad");
PropertyManager->Untie("metrics/runway-radius");
PropertyManager->Untie("position/h-agl-ft");
PropertyManager->Untie("position/radius-to-vehicle-ft");
PropertyManager->Untie("flight-path/gamma-rad");
PropertyManager->Untie("aero/h_b-cg-ft");
PropertyManager->Untie("aero/h_b-mac-ft");
}
//%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
// The bitmasked value choices are as follows:
// unset: In this case (the default) JSBSim would only print
@ -274,67 +345,3 @@ void FGPosition::Debug(int from)
}
}
void FGPosition::bind(void){
PropertyManager->Tie("velocities/v-north-fps", this,
&FGPosition::GetVn);
PropertyManager->Tie("velocities/v-east-fps", this,
&FGPosition::GetVe);
PropertyManager->Tie("velocities/v-down-fps", this,
&FGPosition::GetVd);
PropertyManager->Tie("velocities/vg-fps", this,
&FGPosition::GetVground);
PropertyManager->Tie("flight-path/psi-gt-rad", this,
&FGPosition::GetGroundTrack);
PropertyManager->Tie("position/h-sl-ft", this,
&FGPosition::Geth,
&FGPosition::Seth,
true);
PropertyManager->Tie("velocities/h-dot-fps", this,
&FGPosition::Gethdot);
PropertyManager->Tie("position/lat-gc-rad", this,
&FGPosition::GetLatitude,
&FGPosition::SetLatitude);
PropertyManager->Tie("position/lat-dot-gc-rad", this,
&FGPosition::GetLatitudeDot);
PropertyManager->Tie("position/long-gc-rad", this,
&FGPosition::GetLongitude,
&FGPosition::SetLongitude,
true);
PropertyManager->Tie("position/long-dot-gc-rad", this,
&FGPosition::GetLongitudeDot);
PropertyManager->Tie("metrics/runway-radius", this,
&FGPosition::GetRunwayRadius,
&FGPosition::SetRunwayRadius);
PropertyManager->Tie("position/h-agl-ft", this,
&FGPosition::GetDistanceAGL,
&FGPosition::SetDistanceAGL);
PropertyManager->Tie("position/radius-to-vehicle-ft", this,
&FGPosition::GetRadius);
PropertyManager->Tie("flight-path/gamma-rad", this,
&FGPosition::GetGamma,
&FGPosition::SetGamma);
PropertyManager->Tie("aero/h_b-cg-ft", this,
&FGPosition::GetHOverBCG);
PropertyManager->Tie("aero/h_b-mac-ft", this,
&FGPosition::GetHOverBMAC);
}
void FGPosition::unbind(void){
PropertyManager->Untie("velocities/v-north-fps");
PropertyManager->Untie("velocities/v-east-fps");
PropertyManager->Untie("velocities/v-down-fps");
PropertyManager->Untie("velocities/vg-fps");
PropertyManager->Untie("flight-path/psi-gt-rad");
PropertyManager->Untie("position/h-sl-ft");
PropertyManager->Untie("velocities/h-dot-fps");
PropertyManager->Untie("position/lat-gc-rad");
PropertyManager->Untie("position/lat-dot-gc-rad");
PropertyManager->Untie("position/long-gc-rad");
PropertyManager->Untie("position/long-dot-gc-rad");
PropertyManager->Untie("metrics/runway-radius");
PropertyManager->Untie("position/h-agl-ft");
PropertyManager->Untie("position/radius-to-vehicle-ft");
PropertyManager->Untie("flight-path/gamma-rad");
PropertyManager->Untie("aero/h_b-cg-ft");
PropertyManager->Untie("aero/h_b-mac-ft");
}

View file

@ -131,9 +131,9 @@ bool FGPropulsion::GetSteadyState(void)
PowerAvailable = Engines[i]->Calculate(Thrusters[i]->GetPowerRequired());
lastThrust = currentThrust;
currentThrust = Thrusters[i]->Calculate(PowerAvailable);
if(fabs(lastThrust-currentThrust) < 0.0001) {
if (fabs(lastThrust-currentThrust) < 0.0001) {
steady_count++;
if(steady_count > 120) { steady=true; }
if (steady_count > 120) { steady=true; }
} else {
steady_count=0;
}
@ -548,7 +548,8 @@ double FGPropulsion::GetTanksIxy(const FGColumnVector3& vXYZcg)
//%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
void FGPropulsion::bind(void){
void FGPropulsion::bind(void)
{
/* PropertyManager->Tie("propulsion/num-engines", this,
&FGPropulsion::GetNumEngines);
PropertyManager->Tie("propulsion/num-tanks", this,
@ -575,7 +576,8 @@ void FGPropulsion::bind(void){
//%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
void FGPropulsion::unbind(void){
void FGPropulsion::unbind(void)
{
/* PropertyManager->Untie("propulsion/num-engines");
PropertyManager->Untie("propulsion/num-tanks"); */
PropertyManager->Untie("propulsion/num-sel-fuel-tanks");

View file

@ -154,6 +154,72 @@ void FGRotation::GetState(void)
Ixz = MassBalance->GetIxz();
}
//%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
void FGRotation::bind(void)
{
PropertyManager->Tie("velocities/p-rad_sec", this,1,
&FGRotation::GetPQR);
PropertyManager->Tie("velocities/q-rad_sec", this,2,
&FGRotation::GetPQR);
PropertyManager->Tie("velocities/r-rad_sec", this,3,
&FGRotation::GetPQR);
PropertyManager->Tie("velocities/p-aero-rad_sec", this,1,
&FGRotation::GetAeroPQR);
PropertyManager->Tie("velocities/q-aero-rad_sec", this,2,
&FGRotation::GetAeroPQR);
PropertyManager->Tie("velocities/r-aero-rad_sec", this,3,
&FGRotation::GetAeroPQR);
PropertyManager->Tie("accelerations/pdot-rad_sec", this,1,
&FGRotation::GetPQRdot);
PropertyManager->Tie("accelerations/qdot-rad_sec", this,2,
&FGRotation::GetPQRdot);
PropertyManager->Tie("accelerations/rdot-rad_sec", this,3,
&FGRotation::GetPQRdot);
PropertyManager->Tie("attitude/roll-rad", this,1,
&FGRotation::GetEuler);
PropertyManager->Tie("attitude/pitch-rad", this,2,
&FGRotation::GetEuler);
PropertyManager->Tie("attitude/heading-true-rad", this,3,
&FGRotation::GetEuler);
PropertyManager->Tie("velocities/phidot-rad_sec", this,1,
&FGRotation::GetEulerRates);
PropertyManager->Tie("velocities/thetadot-rad_sec", this,2,
&FGRotation::GetEulerRates);
PropertyManager->Tie("velocities/psidot-rad_sec", this,3,
&FGRotation::GetEulerRates);
PropertyManager->Tie("attitude/phi-rad", this,
&FGRotation::Getphi);
PropertyManager->Tie("attitude/theta-rad", this,
&FGRotation::Gettht);
PropertyManager->Tie("attitude/psi-true-rad", this,
&FGRotation::Getpsi);
}
//%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
void FGRotation::unbind(void)
{
PropertyManager->Untie("velocities/p-rad_sec");
PropertyManager->Untie("velocities/q-rad_sec");
PropertyManager->Untie("velocities/r-rad_sec");
PropertyManager->Untie("velocities/p-aero-rad_sec");
PropertyManager->Untie("velocities/q-aero-rad_sec");
PropertyManager->Untie("velocities/r-aero-rad_sec");
PropertyManager->Untie("accelerations/pdot-rad_sec");
PropertyManager->Untie("accelerations/qdot-rad_sec");
PropertyManager->Untie("accelerations/rdot-rad_sec");
PropertyManager->Untie("attitude/roll-rad");
PropertyManager->Untie("attitude/pitch-rad");
PropertyManager->Untie("attitude/heading-true-rad");
PropertyManager->Untie("velocities/phidot-rad_sec");
PropertyManager->Untie("velocities/thetadot-rad_sec");
PropertyManager->Untie("velocities/psidot-rad_sec");
PropertyManager->Untie("attitude/phi-rad");
PropertyManager->Untie("attitude/theta-rad");
PropertyManager->Untie("attitude/psi-true-rad");
}
//%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
// The bitmasked value choices are as follows:
// unset: In this case (the default) JSBSim would only print
@ -208,62 +274,3 @@ void FGRotation::Debug(int from)
}
}
void FGRotation::bind(void){
PropertyManager->Tie("velocities/p-rad_sec", this,1,
&FGRotation::GetPQR);
PropertyManager->Tie("velocities/q-rad_sec", this,2,
&FGRotation::GetPQR);
PropertyManager->Tie("velocities/r-rad_sec", this,3,
&FGRotation::GetPQR);
PropertyManager->Tie("velocities/p-aero-rad_sec", this,1,
&FGRotation::GetAeroPQR);
PropertyManager->Tie("velocities/q-aero-rad_sec", this,2,
&FGRotation::GetAeroPQR);
PropertyManager->Tie("velocities/r-aero-rad_sec", this,3,
&FGRotation::GetAeroPQR);
PropertyManager->Tie("accelerations/pdot-rad_sec", this,1,
&FGRotation::GetPQRdot);
PropertyManager->Tie("accelerations/qdot-rad_sec", this,2,
&FGRotation::GetPQRdot);
PropertyManager->Tie("accelerations/rdot-rad_sec", this,3,
&FGRotation::GetPQRdot);
PropertyManager->Tie("attitude/roll-rad", this,1,
&FGRotation::GetEuler);
PropertyManager->Tie("attitude/pitch-rad", this,2,
&FGRotation::GetEuler);
PropertyManager->Tie("attitude/heading-true-rad", this,3,
&FGRotation::GetEuler);
PropertyManager->Tie("velocities/phidot-rad_sec", this,1,
&FGRotation::GetEulerRates);
PropertyManager->Tie("velocities/thetadot-rad_sec", this,2,
&FGRotation::GetEulerRates);
PropertyManager->Tie("velocities/psidot-rad_sec", this,3,
&FGRotation::GetEulerRates);
PropertyManager->Tie("attitude/phi-rad", this,
&FGRotation::Getphi);
PropertyManager->Tie("attitude/theta-rad", this,
&FGRotation::Gettht);
PropertyManager->Tie("attitude/psi-true-rad", this,
&FGRotation::Getpsi);
}
void FGRotation::unbind(void){
PropertyManager->Untie("velocities/p-rad_sec");
PropertyManager->Untie("velocities/q-rad_sec");
PropertyManager->Untie("velocities/r-rad_sec");
PropertyManager->Untie("velocities/p-aero-rad_sec");
PropertyManager->Untie("velocities/q-aero-rad_sec");
PropertyManager->Untie("velocities/r-aero-rad_sec");
PropertyManager->Untie("accelerations/pdot-rad_sec");
PropertyManager->Untie("accelerations/qdot-rad_sec");
PropertyManager->Untie("accelerations/rdot-rad_sec");
PropertyManager->Untie("attitude/roll-rad");
PropertyManager->Untie("attitude/pitch-rad");
PropertyManager->Untie("attitude/heading-true-rad");
PropertyManager->Untie("velocities/phidot-rad_sec");
PropertyManager->Untie("velocities/thetadot-rad_sec");
PropertyManager->Untie("velocities/psidot-rad_sec");
PropertyManager->Untie("attitude/phi-rad");
PropertyManager->Untie("attitude/theta-rad");
PropertyManager->Untie("attitude/psi-true-rad");
}

View file

@ -233,8 +233,8 @@ void FGState::Initialize(double U, double V, double W,
//%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
void FGState::Initialize(FGInitialCondition *FGIC) {
void FGState::Initialize(FGInitialCondition *FGIC)
{
double tht,psi,phi;
double U, V, W, h;
double latitude, longitude;
@ -263,7 +263,8 @@ void FGState::Initialize(FGInitialCondition *FGIC) {
//%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
void FGState::InitMatrices(double phi, double tht, double psi) {
void FGState::InitMatrices(double phi, double tht, double psi)
{
double thtd2, psid2, phid2;
double Sthtd2, Spsid2, Sphid2;
double Cthtd2, Cpsid2, Cphid2;
@ -299,7 +300,8 @@ void FGState::InitMatrices(double phi, double tht, double psi) {
//%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
void FGState::CalcMatrices(void) {
void FGState::CalcMatrices(void)
{
double Q0Q0, Q1Q1, Q2Q2, Q3Q3;
double Q0Q1, Q0Q2, Q0Q3, Q1Q2;
double Q1Q3, Q2Q3;
@ -331,7 +333,8 @@ void FGState::CalcMatrices(void) {
//%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
void FGState::IntegrateQuat(FGColumnVector3 vPQR, int rate) {
void FGState::IntegrateQuat(FGColumnVector3 vPQR, int rate)
{
vQdot(1) = -0.5*(vQtrn(2)*vPQR(eP) + vQtrn(3)*vPQR(eQ) + vQtrn(4)*vPQR(eR));
vQdot(2) = 0.5*(vQtrn(1)*vPQR(eP) + vQtrn(3)*vPQR(eR) - vQtrn(4)*vPQR(eQ));
vQdot(3) = 0.5*(vQtrn(1)*vPQR(eQ) + vQtrn(4)*vPQR(eP) - vQtrn(2)*vPQR(eR));
@ -345,7 +348,8 @@ void FGState::IntegrateQuat(FGColumnVector3 vPQR, int rate) {
//%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
FGColumnVector3& FGState::CalcEuler(void) {
FGColumnVector3& FGState::CalcEuler(void)
{
if (mTl2b(3,3) == 0.0) mTl2b(3,3) = 0.0000001;
if (mTl2b(1,1) == 0.0) mTl2b(1,1) = 0.0000001;
@ -427,16 +431,18 @@ void FGState::ReportState(void)
FDMExec->GetMassBalance()->GetXYZcg(2),
FDMExec->GetMassBalance()->GetXYZcg(3));
cout << out;
if( FCS->GetDfPos() <= 0.01)
if ( FCS->GetDfPos() <= 0.01)
snprintf(flap,10,"Up");
else
snprintf(flap,10,"%2.0f",FCS->GetDfPos());
if(FCS->GetGearPos() < 0.01)
if (FCS->GetGearPos() < 0.01)
snprintf(gear,12,"Up");
else if(FCS->GetGearPos() > 0.99)
else if (FCS->GetGearPos() > 0.99)
snprintf(gear,12,"Down");
else
snprintf(gear,12,"In Transit");
snprintf(gear,12,"In Transit");
snprintf(out,80, " Flaps: %3s Gear: %12s\n",flap,gear);
cout << out;
snprintf(out,80, " Speed: %4.0f KCAS Mach: %5.2f\n",
@ -491,7 +497,8 @@ void FGState::ReportState(void)
//%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
void FGState::InitPropertyMaps(void) {
void FGState::InitPropertyMaps(void)
{
ParamNameToProp[ "FG_TIME" ]="sim-time-sec";
ParamNameToProp[ "FG_QBAR" ]="aero/qbar-psf";
ParamNameToProp[ "FG_WINGAREA" ]="metrics/Sw-sqft";
@ -568,24 +575,23 @@ void FGState::InitPropertyMaps(void) {
ParamNameToProp[ "FG_VBARV" ]="metrics/vbarv-norm";
ParamNameToProp[ "FG_GEAR_CMD" ]="gear/gear-cmd-norm";
ParamNameToProp[ "FG_GEAR_POS" ]="gear/gear-pos-norm";
}
//%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
void FGState::bind(void) {
void FGState::bind(void)
{
PropertyManager->Tie("sim-time-sec",this,
&FGState::Getsim_time);
}
//%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
void FGState::unbind(void) {
void FGState::unbind(void)
{
PropertyManager->Untie("sim-time-sec");
}
//%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
// The bitmasked value choices are as follows:
// unset: In this case (the default) JSBSim would only print
@ -632,4 +638,3 @@ void FGState::Debug(int from)
}
}

View file

@ -115,7 +115,8 @@ double FGTable::GetValue(double key)
int r;
for (r=1; r<=nRows; r++) if (Data[r][0] >= key) break;
r = r < 2 ? 2 : (r > nRows ? nRows : r);
r = Clamp(2, r, nRows);
key = Clamp(Data[1][0], key, Data[nRows][0]);
// make sure denominator below does not go to zero.
@ -140,10 +141,12 @@ double FGTable::GetValue(double rowKey, double colKey)
int r, c;
for (r=1;r<=nRows;r++) if (Data[r][0] >= rowKey) break;
for (c=1;c<=nCols;c++) if (Data[0][c] >= colKey) break;
r = Clamp(2, r, nRows);
rowKey = Clamp(Data[1][0], rowKey, Data[nRows][0]);
c = c < 2 ? 2 : (c > nCols ? nCols : c);
r = r < 2 ? 2 : (r > nRows ? nRows : r);
for (c=1;c<=nCols;c++) if (Data[0][c] >= colKey) break;
c = Clamp(2, c, nCols);
colKey = Clamp(Data[0][1], colKey, Data[0][nCols]);
rFactor = (rowKey - Data[r-1][0]) / (Data[r][0] - Data[r-1][0]);
cFactor = (colKey - Data[0][c-1]) / (Data[0][c] - Data[0][c-1]);

View file

@ -98,10 +98,11 @@ public:
void operator<<(FGConfigFile&);
FGTable& operator<<(const double n);
FGTable& operator<<(const int n);
// FGTable& operator<<(const double n);
inline double GetElement(int r, int c) {return Data[r][c];}
void Print(void);
template <class T> T Clamp(T lower, T value, T upper)
{return value < lower ? lower : (value > upper ? upper : value);}
private:
enum type {tt1D, tt2D} Type;
double** Data;

View file

@ -161,6 +161,88 @@ bool FGTranslation::Run(void)
}
}
//%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
void FGTranslation::bind(void)
{
PropertyManager->Tie("velocities/u-fps", this,1,
&FGTranslation::GetUVW /*,
&FGTranslation::SetUVW,
true */);
PropertyManager->Tie("velocities/v-fps", this,2,
&FGTranslation::GetUVW /*,
&FGTranslation::SetUVW,
true*/);
PropertyManager->Tie("velocities/w-fps", this,3,
&FGTranslation::GetUVW /*,
&FGTranslation::SetUVW,
true*/);
PropertyManager->Tie("accelerations/udot-fps", this,1,
&FGTranslation::GetUVWdot);
PropertyManager->Tie("accelerations/vdot-fps", this,2,
&FGTranslation::GetUVWdot);
PropertyManager->Tie("accelerations/wdot-fps", this,3,
&FGTranslation::GetUVWdot);
PropertyManager->Tie("velocities/u-aero-fps", this,1,
&FGTranslation::GetAeroUVW);
PropertyManager->Tie("velocities/v-aero-fps", this,2,
&FGTranslation::GetAeroUVW);
PropertyManager->Tie("velocities/w-aero-fps", this,3,
&FGTranslation::GetAeroUVW);
PropertyManager->Tie("aero/alpha-rad", this,
&FGTranslation::Getalpha,
&FGTranslation::Setalpha,
true);
PropertyManager->Tie("aero/beta-rad", this,
&FGTranslation::Getbeta,
&FGTranslation::Setbeta,
true);
PropertyManager->Tie("aero/mag-beta-rad", this,
&FGTranslation::GetMagBeta);
PropertyManager->Tie("aero/qbar-psf", this,
&FGTranslation::Getqbar,
&FGTranslation::Setqbar,
true);
PropertyManager->Tie("velocities/vt-fps", this,
&FGTranslation::GetVt,
&FGTranslation::SetVt,
true);
PropertyManager->Tie("velocities/mach-norm", this,
&FGTranslation::GetMach,
&FGTranslation::SetMach,
true);
PropertyManager->Tie("aero/alphadot-rad_sec", this,
&FGTranslation::Getadot,
&FGTranslation::Setadot,
true);
PropertyManager->Tie("aero/betadot-rad_sec", this,
&FGTranslation::Getbdot,
&FGTranslation::Setbdot,
true);
}
//%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
void FGTranslation::unbind(void)
{
PropertyManager->Untie("velocities/u-fps");
PropertyManager->Untie("velocities/v-fps");
PropertyManager->Untie("velocities/w-fps");
PropertyManager->Untie("accelerations/udot-fps");
PropertyManager->Untie("accelerations/vdot-fps");
PropertyManager->Untie("accelerations/wdot-fps");
PropertyManager->Untie("velocities/u-aero-fps");
PropertyManager->Untie("velocities/v-aero-fps");
PropertyManager->Untie("velocities/w-aero-fps");
PropertyManager->Untie("aero/alpha-rad");
PropertyManager->Untie("aero/beta-rad");
PropertyManager->Untie("aero/qbar-psf");
PropertyManager->Untie("velocities/vt-fps");
PropertyManager->Untie("velocities/mach-norm");
PropertyManager->Untie("aero/alphadot-rad_sec");
PropertyManager->Untie("aero/betadot-rad_sec");
}
//%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
// The bitmasked value choices are as follows:
// unset: In this case (the default) JSBSim would only print
@ -223,82 +305,3 @@ void FGTranslation::Debug(int from)
}
}
//%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
void FGTranslation::bind(void){
PropertyManager->Tie("velocities/u-fps", this,1,
&FGTranslation::GetUVW /*,
&FGTranslation::SetUVW,
true */);
PropertyManager->Tie("velocities/v-fps", this,2,
&FGTranslation::GetUVW /*,
&FGTranslation::SetUVW,
true*/);
PropertyManager->Tie("velocities/w-fps", this,3,
&FGTranslation::GetUVW /*,
&FGTranslation::SetUVW,
true*/);
PropertyManager->Tie("accelerations/udot-fps", this,1,
&FGTranslation::GetUVWdot);
PropertyManager->Tie("accelerations/vdot-fps", this,2,
&FGTranslation::GetUVWdot);
PropertyManager->Tie("accelerations/wdot-fps", this,3,
&FGTranslation::GetUVWdot);
PropertyManager->Tie("velocities/u-aero-fps", this,1,
&FGTranslation::GetAeroUVW);
PropertyManager->Tie("velocities/v-aero-fps", this,2,
&FGTranslation::GetAeroUVW);
PropertyManager->Tie("velocities/w-aero-fps", this,3,
&FGTranslation::GetAeroUVW);
PropertyManager->Tie("aero/alpha-rad", this,
&FGTranslation::Getalpha,
&FGTranslation::Setalpha,
true);
PropertyManager->Tie("aero/beta-rad", this,
&FGTranslation::Getbeta,
&FGTranslation::Setbeta,
true);
PropertyManager->Tie("aero/mag-beta-rad", this,
&FGTranslation::GetMagBeta);
PropertyManager->Tie("aero/qbar-psf", this,
&FGTranslation::Getqbar,
&FGTranslation::Setqbar,
true);
PropertyManager->Tie("velocities/vt-fps", this,
&FGTranslation::GetVt,
&FGTranslation::SetVt,
true);
PropertyManager->Tie("velocities/mach-norm", this,
&FGTranslation::GetMach,
&FGTranslation::SetMach,
true);
PropertyManager->Tie("aero/alphadot-rad_sec", this,
&FGTranslation::Getadot,
&FGTranslation::Setadot,
true);
PropertyManager->Tie("aero/betadot-rad_sec", this,
&FGTranslation::Getbdot,
&FGTranslation::Setbdot,
true);
}
//%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
void FGTranslation::unbind(void){
PropertyManager->Untie("velocities/u-fps");
PropertyManager->Untie("velocities/v-fps");
PropertyManager->Untie("velocities/w-fps");
PropertyManager->Untie("accelerations/udot-fps");
PropertyManager->Untie("accelerations/vdot-fps");
PropertyManager->Untie("accelerations/wdot-fps");
PropertyManager->Untie("velocities/u-aero-fps");
PropertyManager->Untie("velocities/v-aero-fps");
PropertyManager->Untie("velocities/w-aero-fps");
PropertyManager->Untie("aero/alpha-rad");
PropertyManager->Untie("aero/beta-rad");
PropertyManager->Untie("aero/qbar-psf");
PropertyManager->Untie("velocities/vt-fps");
PropertyManager->Untie("velocities/mach-norm");
PropertyManager->Untie("aero/alphadot-rad_sec");
PropertyManager->Untie("aero/betadot-rad_sec");
}

View file

@ -89,6 +89,10 @@ CLASS DOCUMENTATION
@author Tony Peden (Maintained and refined)
@version $Id$
@see main in file JSBSim.cpp (use main() wrapper for standalone usage)
@see <a href="http://cvs.sourceforge.net/cgi-bin/viewcvs.cgi/jsbsim/JSBSim/JSBSim.hxx?rev=HEAD&content-type=text/vnd.viewcvs-markup">
Header File </a>
@see <a href="http://cvs.sourceforge.net/cgi-bin/viewcvs.cgi/jsbsim/JSBSim/JSBSim.cxx?rev=HEAD&content-type=text/vnd.viewcvs-markup">
Source File </a>
*/
/*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

View file

@ -48,7 +48,7 @@ libJSBSim_a_SOURCES = \
FGEngine.cpp FGEngine.h \
FGTank.cpp FGTank.h \
FGfdmSocket.cpp FGfdmSocket.h \
FGPropertyManager.h \
FGPropertyManager.h \
JSBSim.cxx JSBSim.hxx

View file

@ -79,7 +79,7 @@ FGKinemat::FGKinemat(FGFCS* fcs, FGConfigFile* AC_cfg) : FGFCSComponent(fcs),
}
} else if ( token == "DETENTS" ) {
*AC_cfg >> NumDetents;
for(int i=0;i<NumDetents;i++) {
for (int i=0;i<NumDetents;i++) {
*AC_cfg >> tmpDetent;
*AC_cfg >> tmpTime;
Detents.push_back(tmpDetent);
@ -114,13 +114,13 @@ bool FGKinemat::Run(void ) {
InputCmd = Input*Detents[NumDetents-1];
OutputPos = OutputNode->getDoubleValue();
if(InputCmd < Detents[0]) {
if (InputCmd < Detents[0]) {
fi=0;
InputCmd=Detents[0];
lastInputCmd=InputCmd;
OutputPos=Detents[0];
Output=OutputPos;
} else if(InputCmd > Detents[NumDetents-1]) {
} else if (InputCmd > Detents[NumDetents-1]) {
fi=NumDetents-1;
InputCmd=Detents[fi];
lastInputCmd=InputCmd;
@ -128,32 +128,32 @@ bool FGKinemat::Run(void ) {
Output=OutputPos;
} else {
//cout << "FGKinemat::Run Handle: " << InputCmd << " Position: " << OutputPos << endl;
if(dt <= 0)
if (dt <= 0)
OutputPos=InputCmd;
else {
if(InputCmd != lastInputCmd) {
if (InputCmd != lastInputCmd) {
InTransit=1;
}
//cout << "FGKinemat::Run, InTransit: " << InTransit << endl;
if(InTransit) {
if (InTransit) {
//fprintf(stderr,"InputCmd: %g, OutputPos: %g\n",InputCmd,OutputPos);
fi=0;
while(Detents[fi] < InputCmd) {
while (Detents[fi] < InputCmd) {
fi++;
}
if(OutputPos < InputCmd) {
if(TransitionTimes[fi] > 0)
if (OutputPos < InputCmd) {
if (TransitionTimes[fi] > 0)
output_transit_rate=(Detents[fi] - Detents[fi-1])/TransitionTimes[fi];
else
output_transit_rate=(Detents[fi] - Detents[fi-1])/5;
//cout << "FGKinemat::Run, output_transit_rate: " << output_transit_rate << endl;
} else {
if(TransitionTimes[fi+1] > 0)
if (TransitionTimes[fi+1] > 0)
output_transit_rate=(Detents[fi] - Detents[fi+1])/TransitionTimes[fi+1];
else
output_transit_rate=(Detents[fi] - Detents[fi+1])/5;
}
if(fabs(OutputPos - InputCmd) > fabs(dt*output_transit_rate) ) {
if (fabs(OutputPos - InputCmd) > fabs(dt*output_transit_rate) ) {
OutputPos+=output_transit_rate*dt;
//cout << "FGKinemat::Run, OutputPos: " << OutputPos
// << " dt: " << dt << endl;
@ -167,7 +167,7 @@ bool FGKinemat::Run(void ) {
Output = OutputPos;
}
if( Detents[NumDetents-1] > 0 ) {
if ( Detents[NumDetents-1] > 0 ) {
OutputPct = Output / Detents[NumDetents-1];
}
@ -204,7 +204,7 @@ void FGKinemat::Debug(int from)
cout << " ID: " << ID << endl;
cout << " INPUT: " << InputNode->getName() << endl;
cout << " DETENTS: " << NumDetents << endl;
for(int i=0;i<NumDetents;i++) {
for (int i=0;i<NumDetents;i++) {
cout << " " << Detents[i] << " " << TransitionTimes[i] << endl;
}
if (IsOutput) cout << " OUTPUT: " << OutputNode->getName() << endl;

View file

@ -110,7 +110,7 @@ FGSummer::FGSummer(FGFCS* fcs, FGConfigFile* AC_cfg) : FGFCSComponent(fcs),
FGSummer::~FGSummer()
{
unsigned i;
for(i=0;i<Inputs.size();i++) {
for (i=0;i<Inputs.size();i++) {
delete Inputs[i];
}
Debug(1);