X-Git-Url: https://git.mxchange.org/?a=blobdiff_plain;f=src%2FFDM%2FJSBSim%2Fmodels%2FFGAerodynamics.cpp;h=a793cce2f443df453b2cbc586688f02814c6b14c;hb=edd83dd7e8fd7162ae49da6113ad797c68769f20;hp=5083bf7bc5f4c02d7c5823f1dc6566d32e987115;hpb=e503591af4f16814d78ded49c5979e273d81a0be;p=flightgear.git diff --git a/src/FDM/JSBSim/models/FGAerodynamics.cpp b/src/FDM/JSBSim/models/FGAerodynamics.cpp index 5083bf7bc..a793cce2f 100644 --- a/src/FDM/JSBSim/models/FGAerodynamics.cpp +++ b/src/FDM/JSBSim/models/FGAerodynamics.cpp @@ -108,9 +108,6 @@ FGAerodynamics::~FGAerodynamics() delete[] Coeff; - for (i=0; iHolding()) return false; // if paused don't execute + RunPreFunctions(); + // calculate some oft-used quantities for speed twovel = 2*Auxiliary->GetVt(); @@ -173,13 +172,6 @@ bool FGAerodynamics::Run(void) vFw.InitMatrix(); vFnative.InitMatrix(); - // Tell the variable functions to cache their values, so while the aerodynamic - // functions are being calculated for each axis, these functions do not get - // calculated each time, but instead use the values that have already - // been calculated for this frame. - - for (i=0; icacheValue(true); - for (axis_ctr = 0; axis_ctr < 3; axis_ctr++) { for (ctr=0; ctr < Coeff[axis_ctr].size(); ctr++) { vFnative(axis_ctr+1) += Coeff[axis_ctr][ctr]->GetValue(); @@ -233,6 +225,8 @@ bool FGAerodynamics::Run(void) } } + RunPostFunctions(); + return false; } @@ -324,7 +318,7 @@ bool FGAerodynamics::Load(Element *element) document = element; } - FGModel::Load(element); // Perform base class Load + FGModel::Load(document); // Perform base class Pre-Load DetermineAxisSystem(); // Detemine if Lift/Side/Drag, etc. is used. @@ -349,12 +343,6 @@ bool FGAerodynamics::Load(Element *element) AeroRPShift = new FGFunction(PropertyManager, function_element); } - function_element = document->FindElement("function"); - while (function_element) { - variables.push_back( new FGFunction(PropertyManager, function_element) ); - function_element = document->FindNextElement("function"); - } - axis_element = document->FindElement("axis"); while (axis_element) { CoeffArray ca; @@ -368,6 +356,8 @@ bool FGAerodynamics::Load(Element *element) axis_element = document->FindNextElement("axis"); } + FGModel::PostLoad(document); // Perform base class Post-Load + return true; } @@ -427,15 +417,6 @@ string FGAerodynamics::GetCoefficientStrings(const string& delimeter) const bool firstime = true; unsigned int axis, sd; - for (sd = 0; sd < variables.size(); sd++) { - if (firstime) { - firstime = false; - } else { - CoeffStrings += delimeter; - } - CoeffStrings += variables[sd]->GetName(); - } - for (axis = 0; axis < 6; axis++) { for (sd = 0; sd < Coeff[axis].size(); sd++) { if (firstime) { @@ -455,12 +436,6 @@ string FGAerodynamics::GetCoefficientValues(const string& delimeter) const { ostringstream buf; - buf.precision(6); - for (unsigned int sd = 0; sd < variables.size(); sd++) { - if (buf.tellp() > 0) buf << delimeter; - buf << setw(9) << variables[sd]->GetValue(); - } - for (unsigned int axis = 0; axis < 6; axis++) { for (unsigned int sd = 0; sd < Coeff[axis].size(); sd++) { if (buf.tellp() > 0) buf << delimeter;