]> git.mxchange.org Git - flightgear.git/blobdiff - src/FDM/JSBSim/FGAuxiliary.cpp
JSBSim updates. This update changes the file format, so an update of the base
[flightgear.git] / src / FDM / JSBSim / FGAuxiliary.cpp
index 8bdcaffe3af37a33287790f0a2c4a9491950c4c1..0ef2a322193579863976f8d9400d8d6fc956d275 100644 (file)
@@ -41,6 +41,7 @@ INCLUDES
 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%*/
 
 #include "FGAuxiliary.h"
+#include "FGAerodynamics.h"
 #include "FGTranslation.h"
 #include "FGRotation.h"
 #include "FGAtmosphere.h"
@@ -73,6 +74,8 @@ FGAuxiliary::FGAuxiliary(FGFDMExec* fdmex) : FGModel(fdmex)
   
   vPilotAccelN.InitMatrix();
   
+  bind();
+  
   Debug(0);
 }
 
@@ -150,7 +153,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 +200,61 @@ 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,
+                       &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,
+                       (PMF)&FGAuxiliary::GetPilotAccel);
+  PropertyManager->Tie("accelerations/a-pilot-y-ft_sec2", this,2,
+                       (PMF)&FGAuxiliary::GetPilotAccel);
+  PropertyManager->Tie("accelerations/a-pilot-z-ft_sec2", this,3,
+                       (PMF)&FGAuxiliary::GetPilotAccel);
+  PropertyManager->Tie("accelerations/n-pilot-x-norm", this,1,
+                       (PMF)&FGAuxiliary::GetNpilot);
+  PropertyManager->Tie("accelerations/n-pilot-y-norm", this,2,
+                       (PMF)&FGAuxiliary::GetNpilot);
+  PropertyManager->Tie("accelerations/n-pilot-z-norm", this,3,
+                       (PMF)&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 +310,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"); */
-
-}