]> git.mxchange.org Git - flightgear.git/blobdiff - src/FDM/JSBSim/FGModel.cpp
Encapsulate the interpolstion version of FGEnvironment and fix some bugs
[flightgear.git] / src / FDM / JSBSim / FGModel.cpp
index 9462fe79500c88a84bfa28793834642e0b26be7c..a4123e1330eb0cc19f83d4fd3c246b07640cc48c 100644 (file)
@@ -55,6 +55,8 @@ INCLUDES
 #include "FGAuxiliary.h"
 #include "FGOutput.h"
 
+namespace JSBSim {
+
 static const char *IdSrc = "$Id$";
 static const char *IdHdr = ID_MODEL;
 
@@ -85,8 +87,14 @@ FGModel::FGModel(FGFDMExec* fdmex)
   Position        = 0;
   Auxiliary       = 0;
   Output          = 0;
-
+  
+  //in order for FGModel derived classes to self-bind (that is, call
+  //their bind function in the constructor, the PropertyManager pointer
+  //must be brought up now.
+  PropertyManager = FDMExec->GetPropertyManager();
+  
   exe_ctr     = 1;
+  rate        = 1;
 
   if (debug_lvl & 2) cout << "              FGModel Base Class" << endl;
 }
@@ -116,7 +124,7 @@ bool FGModel::InitModel(void)
   Position        = FDMExec->GetPosition();
   Auxiliary       = FDMExec->GetAuxiliary();
   Output          = FDMExec->GetOutput();
-
+  
   if (!State ||
       !Atmosphere ||
       !FCS ||
@@ -194,4 +202,4 @@ void FGModel::Debug(int from)
     }
   }
 }
-
+}