]> git.mxchange.org Git - flightgear.git/blobdiff - src/FDM/JSBSim/FGInertial.cpp
Updated to match changes in radiostack.[ch]xx
[flightgear.git] / src / FDM / JSBSim / FGInertial.cpp
index 9f680d203cd95cd59ce038975d3a78e813aea8b8..b3d3f598954c2d4658d48525bd44b5a5e077b94c 100644 (file)
@@ -59,6 +59,8 @@ FGInertial::FGInertial(FGFDMExec* fgex) : FGModel(fgex)
   RadiusReference = 20925650.00;
   gAccelReference = GM/(RadiusReference*RadiusReference);
   gAccel          = GM/(RadiusReference*RadiusReference);
+  
+  bind();
 
   Debug(0);
 }
@@ -67,6 +69,7 @@ FGInertial::FGInertial(FGFDMExec* fgex) : FGModel(fgex)
 
 FGInertial::~FGInertial(void)
 {
+  unbind();
   Debug(1);
 }
 
@@ -122,6 +125,28 @@ bool FGInertial::LoadInertial(FGConfigFile* AC_cfg)
   return true;
 }
 
+//%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+
+void FGInertial::bind(void)
+{
+  typedef double (FGInertial::*PMF)(int) const;
+  PropertyManager->Tie("forces/fbx-inertial-lbs", this,1,
+                       (PMF)&FGInertial::GetForces);
+  PropertyManager->Tie("forces/fby-inertial-lbs", this,2,
+                       (PMF)&FGInertial::GetForces);
+  PropertyManager->Tie("forces/fbz-inertial-lbs", this,3,
+                       (PMF)&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
@@ -160,5 +185,11 @@ void FGInertial::Debug(int from)
   }
   if (debug_lvl & 16) { // Sanity checking
   }
+  if (debug_lvl & 64) {
+    if (from == 0) { // Constructor
+      cout << IdSrc << endl;
+      cout << IdHdr << endl;
+    }
+  }
 }