]> git.mxchange.org Git - flightgear.git/blobdiff - src/FDM/JSBSim/FGAircraft.cpp
Updated to match changes in radiostack.[ch]xx
[flightgear.git] / src / FDM / JSBSim / FGAircraft.cpp
index 37f2efeb482d949e13e3a5227a25e3a7b2cedb6b..5ee4979c07952e1642e4ab89ba3d2b043731f021 100644 (file)
@@ -102,15 +102,10 @@ CLASS IMPLEMENTATION
 FGAircraft::FGAircraft(FGFDMExec* fdmex) : FGModel(fdmex)
 {
   Name = "FGAircraft";
-  WingIncidence   = 0.0;
-  impending_stall = 0.0;
-  alphaclmin = alphaclmax = 0.0;
   HTailArea = VTailArea = 0.0;
   HTailArm  = VTailArm  = 0.0;
   lbarh = lbarv = 0.0;
   vbarh = vbarv = 0.0;
-  bi2vel = ci2vel = 0.0;
-  alphaw = 0.0;
 
   bind();
 
@@ -129,8 +124,6 @@ FGAircraft::~FGAircraft()
 
 bool FGAircraft::Run(void)
 {
-  double twovel;
-  
   if (!FGModel::Run()) {                 // if false then execute this Run()
     vForces.InitMatrix();
     vForces += Aerodynamics->GetForces();
@@ -150,22 +143,6 @@ bool FGAircraft::Run(void)
     vNwcg = State->GetTb2s() * vNcg;
     vNwcg(3) = -1*vNwcg(3) + 1;
     
-    twovel = 2*Translation->GetVt();
-    if (twovel > 0) {
-      bi2vel = WingSpan / twovel;
-      ci2vel = cbar / twovel;
-    }  
-    
-    alphaw = Translation->Getalpha() + WingIncidence;
-    
-    if (alphaclmax != 0) {
-      if (Translation->Getalpha() > 0.85*alphaclmax) {
-        impending_stall = 10*(Translation->Getalpha()/alphaclmax - 0.85);
-      } else {
-        impending_stall = 0;
-      }
-    }      
-    
     return false;
   } else {                               // skip Run() execution this time
     return true;
@@ -251,11 +228,6 @@ bool FGAircraft::Load(FGConfigFile* AC_cfg)
     } else if (parameter == "AC_AERORP") {
       *AC_cfg >> vXYZrp(eX) >> vXYZrp(eY) >> vXYZrp(eZ);
       if (debug_lvl > 0) cout << "    Ref Pt (x, y, z): " << vXYZrp << endl;
-    } else if (parameter == "AC_ALPHALIMITS") {
-      *AC_cfg >> alphaclmin >> alphaclmax;
-      if (debug_lvl > 0) cout << "    Maximum Alpha: " << alphaclmax
-             << "    Minimum Alpha: " << alphaclmin
-             << endl;
     } else if (parameter == "AC_POINTMASS") {
       *AC_cfg >> pmWt >> pmX >> pmY >> pmZ;
       MassBalance->AddPointMass(pmWt, pmX, pmY, pmZ);
@@ -281,6 +253,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,45 +279,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);
-  PropertyManager->Tie("metrics/alpha-max-deg", this,
-                       &FGAircraft::GetAlphaCLMax,
-                       &FGAircraft::SetAlphaCLMax,
-                       true);
-  PropertyManager->Tie("metrics/alpha-min-deg", this,
-                       &FGAircraft::GetAlphaCLMin,
-                       &FGAircraft::SetAlphaCLMin,
-                       true);
-  PropertyManager->Tie("aero/bi2vel", this,
-                       &FGAircraft::GetBI2Vel);
-  PropertyManager->Tie("aero/ci2vel", this,
-                       &FGAircraft::GetCI2Vel);
-  PropertyManager->Tie("aero/alpha-wing-rad", this,
-                       &FGAircraft::GetAlphaW);
-  PropertyManager->Tie("systems/stall-warn-norm", this,
-                        &FGAircraft::GetStallWarn);
+                       (PMF)&FGAircraft::GetXYZep);
 }
 
 //%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
@@ -375,12 +332,6 @@ void FGAircraft::unbind(void)
   PropertyManager->Untie("metrics/eyepoint-x-ft");
   PropertyManager->Untie("metrics/eyepoint-y-ft");
   PropertyManager->Untie("metrics/eyepoint-z-ft");
-  PropertyManager->Untie("metrics/alpha-max-deg");
-  PropertyManager->Untie("metrics/alpha-min-deg");
-  PropertyManager->Untie("aero/bi2vel");
-  PropertyManager->Untie("aero/ci2vel");
-  PropertyManager->Untie("aero/alpha-wing-rad");
-  PropertyManager->Untie("systems/stall-warn-norm");
 }
 
 //%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%