]> git.mxchange.org Git - flightgear.git/commitdiff
Updates. Includes property tree additions and fixes. Also Jon's first cut at
authortony <tony>
Sat, 23 Mar 2002 00:29:21 +0000 (00:29 +0000)
committertony <tony>
Sat, 23 Mar 2002 00:29:21 +0000 (00:29 +0000)
multi-fdm capability.  Thanks also to Erik for pointing out a couple of typos.

21 files changed:
src/FDM/JSBSim/FGAerodynamics.cpp
src/FDM/JSBSim/FGAerodynamics.h
src/FDM/JSBSim/FGAircraft.cpp
src/FDM/JSBSim/FGAtmosphere.cpp
src/FDM/JSBSim/FGCoefficient.cpp
src/FDM/JSBSim/FGCoefficient.h
src/FDM/JSBSim/FGFCS.h
src/FDM/JSBSim/FGFDMExec.cpp
src/FDM/JSBSim/FGFDMExec.h
src/FDM/JSBSim/FGFactorGroup.cpp
src/FDM/JSBSim/FGFactorGroup.h
src/FDM/JSBSim/FGInitialCondition.cpp
src/FDM/JSBSim/FGOutput.cpp
src/FDM/JSBSim/FGPosition.cpp
src/FDM/JSBSim/FGPropeller.cpp
src/FDM/JSBSim/FGPropertyManager.h
src/FDM/JSBSim/FGPropulsion.cpp
src/FDM/JSBSim/FGRotation.h
src/FDM/JSBSim/FGState.cpp
src/FDM/JSBSim/FGTranslation.cpp
src/FDM/JSBSim/FGTranslation.h

index b956f43cb5cb33be29bc49a12f33f70d8c540e1e..9ec9edc8948ef417c69c5e3b69da192f266b7d7d 100644 (file)
@@ -164,11 +164,9 @@ bool FGAerodynamics::Load(FGConfigFile* AC_cfg)
         if( token == "COEFFICIENT" ) {
           ca.push_back( new FGCoefficient(FDMExec) );
           ca.back()->Load(AC_cfg);
-          cm[ca.back()->Getname()]=ca.back();
         } else if ( token == "GROUP" ) {
           ca.push_back( new FGFactorGroup(FDMExec) );
           ca.back()->Load(AC_cfg);
-          cm[ca.back()->Getname()]=ca.back();
         }
       }
       Coeff[AxisIdx[axis]] = ca;
@@ -257,15 +255,14 @@ void FGAerodynamics::bindModel(void) {
  
   unsigned i,j;
   FGPropertyManager* node;
-  string prop_name;
-  
+  string axis_node_name;
+  node = PropertyManager->GetNode("aero/buildup",true);
   for(i=0;i<NAxes;i++) {
+     node=node->GetNode( string(AxisNames[i]),true );
      for (j=0; j < Coeff[i].size(); j++) { 
-       prop_name = "aero/buildup/" + string(AxisNames[i]) 
-                    + "/" + Coeff[i][j]->Getname();
-       node= PropertyManager->GetNode(prop_name,true);
        Coeff[i][j]->bind(node);
-     }                                          
+     } 
+     node=(FGPropertyManager*)node->getParent();                                         
   }
 }
 
index 6d3698e135753948a0c522f1ee3c04181cd9b698..924d82460f0b5beee5b7ea9cf9950e2dca2d6623 100644 (file)
@@ -135,8 +135,6 @@ public:
       coefficients */
   string GetCoefficientValues(void);
   
-  inline FGCoefficient* GetCoefficient(string name) { return cm[name]; }
-
   void bind(void);
   void bindModel(void);
   void unbind(void);
@@ -146,8 +144,6 @@ private:
   AxisIndex AxisIdx;
   typedef vector<FGCoefficient*> CoeffArray;
   CoeffArray* Coeff;
-  typedef map<string,FGCoefficient*> CoeffMap;
-  CoeffMap cm;
   FGColumnVector3 vFs;
   FGColumnVector3 vForces;
   FGColumnVector3 vMoments;
index f3e242b326b001f5ecd0c258805c83c1f2ab57c5..f273d48899f598443bd24c74af540aebc8ce85fe 100644 (file)
@@ -101,7 +101,6 @@ CLASS IMPLEMENTATION
 
 FGAircraft::FGAircraft(FGFDMExec* fdmex) : FGModel(fdmex)
 {
-  
   Name = "FGAircraft";
   alphaclmin = alphaclmax = 0;
   HTailArea = VTailArea = HTailArm = VTailArm = 0.0;
@@ -276,51 +275,9 @@ bool FGAircraft::Load(FGConfigFile* AC_cfg)
 }
 
 //%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
-//    The bitmasked value choices are as follows:
-//    unset: In this case (the default) JSBSim would only print
-//       out the normally expected messages, essentially echoing
-//       the config files as they are read. If the environment
-//       variable is not set, debug_lvl is set to 1 internally
-//    0: This requests JSBSim not to output any messages
-//       whatsoever.
-//    1: This value explicity requests the normal JSBSim
-//       startup messages
-//    2: This value asks for a message to be printed out when
-//       a class is instantiated
-//    4: When this value is set, a message is displayed when a
-//       FGModel object executes its Run() method
-//    8: When this value is set, various runtime state variables
-//       are printed out periodically
-//    16: When set various parameters are sanity checked and
-//       a message is printed out when they go out of bounds
 
-void FGAircraft::Debug(int from)
+void FGAircraft::bind(void)
 {
-  if (debug_lvl <= 0) return;
-
-  if (debug_lvl & 1) { // Standard console startup message output
-    if (from == 0) { // Constructor
-    }
-  }
-  if (debug_lvl & 2 ) { // Instantiation/Destruction notification
-    if (from == 0) cout << "Instantiated: FGAircraft" << endl;
-    if (from == 1) cout << "Destroyed:    FGAircraft" << endl;
-  }
-  if (debug_lvl & 4 ) { // Run() method entry print for FGModel-derived objects
-  }
-  if (debug_lvl & 8 ) { // Runtime state variables
-  }
-  if (debug_lvl & 16) { // Sanity checking
-  }
-  if (debug_lvl & 64) {
-    if (from == 0) { // Constructor
-      cout << IdSrc << endl;
-      cout << IdHdr << endl;
-    }
-  }
-}
-
-void FGAircraft::bind(void){
   PropertyManager->Tie("metrics/Sw-sqft", this,
                        &FGAircraft::GetWingArea);
   PropertyManager->Tie("metrics/bw-ft", this,
@@ -387,7 +344,10 @@ void FGAircraft::bind(void){
                         &FGAircraft::GetStallWarn);
 }
 
-void FGAircraft::unbind(void){
+//%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+
+void FGAircraft::unbind(void)
+{
   PropertyManager->Untie("metrics/Sw-sqft");
   PropertyManager->Untie("metrics/bw-ft");
   PropertyManager->Untie("metrics/cbarw-ft");
@@ -412,10 +372,56 @@ 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("metrics/alpha-max-rad");
+  PropertyManager->Untie("metrics/alpha-min-rad");
   PropertyManager->Untie("aero/bi2vel");
   PropertyManager->Untie("aero/ci2vel");
   PropertyManager->Untie("aero/alpha-wing-rad");
   PropertyManager->Untie("systems/stall-warn-norm");
 }
+
+//%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+//    The bitmasked value choices are as follows:
+//    unset: In this case (the default) JSBSim would only print
+//       out the normally expected messages, essentially echoing
+//       the config files as they are read. If the environment
+//       variable is not set, debug_lvl is set to 1 internally
+//    0: This requests JSBSim not to output any messages
+//       whatsoever.
+//    1: This value explicity requests the normal JSBSim
+//       startup messages
+//    2: This value asks for a message to be printed out when
+//       a class is instantiated
+//    4: When this value is set, a message is displayed when a
+//       FGModel object executes its Run() method
+//    8: When this value is set, various runtime state variables
+//       are printed out periodically
+//    16: When set various parameters are sanity checked and
+//       a message is printed out when they go out of bounds
+
+void FGAircraft::Debug(int from)
+{
+  if (debug_lvl <= 0) return;
+
+  if (debug_lvl & 1) { // Standard console startup message output
+    if (from == 0) { // Constructor
+    }
+  }
+  if (debug_lvl & 2 ) { // Instantiation/Destruction notification
+    if (from == 0) cout << "Instantiated: FGAircraft" << endl;
+    if (from == 1) cout << "Destroyed:    FGAircraft" << endl;
+  }
+  if (debug_lvl & 4 ) { // Run() method entry print for FGModel-derived objects
+  }
+  if (debug_lvl & 8 ) { // Runtime state variables
+  }
+  if (debug_lvl & 16) { // Sanity checking
+  }
+  if (debug_lvl & 64) {
+    if (from == 0) { // Constructor
+      cout << IdSrc << endl;
+      cout << IdHdr << endl;
+    }
+  }
+}
+
index f9094b46445468c7b5714550e5254274ae8d6cdf..814c92c7d3755a9e84e736b267a03d22688bb5bf 100644 (file)
@@ -293,6 +293,66 @@ void FGAtmosphere::Turbulence(void)
   }
 }
 
+//%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+
+void FGAtmosphere::bind(void)
+{
+  PropertyManager->Tie("atmosphere/T-R", this,
+                       &FGAtmosphere::GetTemperature);
+  PropertyManager->Tie("atmosphere/rho-slugs_ft3", this,
+                       &FGAtmosphere::GetDensity);
+  PropertyManager->Tie("atmosphere/P-psf", this,
+                       &FGAtmosphere::GetPressure);
+  PropertyManager->Tie("atmosphere/a-fps", this,
+                       &FGAtmosphere::GetSoundSpeed);
+  PropertyManager->Tie("atmosphere/T-sl-R", this,
+                       &FGAtmosphere::GetTemperatureSL);
+  PropertyManager->Tie("atmosphere/rho-sl-slugs_ft3", this,
+                       &FGAtmosphere::GetDensitySL);
+  PropertyManager->Tie("atmosphere/P-sl-psf", this,
+                       &FGAtmosphere::GetPressureSL);
+  PropertyManager->Tie("atmosphere/a-sl-fps", this,
+                       &FGAtmosphere::GetSoundSpeedSL);
+  PropertyManager->Tie("atmosphere/theta-norm", this,
+                       &FGAtmosphere::GetTemperatureRatio);
+  PropertyManager->Tie("atmosphere/sigma-norm", this,
+                       &FGAtmosphere::GetDensityRatio);
+  PropertyManager->Tie("atmosphere/delta-norm", this,
+                       &FGAtmosphere::GetPressureRatio);
+  PropertyManager->Tie("atmosphere/a-norm", this,
+                       &FGAtmosphere::GetSoundSpeedRatio);
+  PropertyManager->Tie("atmosphere/psiw-rad", this,
+                       &FGAtmosphere::GetWindPsi);
+  PropertyManager->Tie("atmosphere/p-turb-rad_sec", this,1,
+                       &FGAtmosphere::GetTurbPQR);
+  PropertyManager->Tie("atmosphere/q-turb-rad_sec", this,2,
+                       &FGAtmosphere::GetTurbPQR);
+  PropertyManager->Tie("atmosphere/r-turb-rad_sec", this,3,
+                       &FGAtmosphere::GetTurbPQR);
+}
+
+//%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+
+void FGAtmosphere::unbind(void)
+{
+  PropertyManager->Untie("atmosphere/T-R");
+  PropertyManager->Untie("atmosphere/rho-slugs_ft3");
+  PropertyManager->Untie("atmosphere/P-psf");
+  PropertyManager->Untie("atmosphere/a-fps");
+  PropertyManager->Untie("atmosphere/T-sl-R");
+  PropertyManager->Untie("atmosphere/rho-sl-slugs_ft3");
+  PropertyManager->Untie("atmosphere/P-sl-psf");
+  PropertyManager->Untie("atmosphere/a-sl-fps");
+  PropertyManager->Untie("atmosphere/theta-norm");
+  PropertyManager->Untie("atmosphere/sigma-norm");
+  PropertyManager->Untie("atmosphere/delta-norm");
+  PropertyManager->Untie("atmosphere/a-norm");
+  PropertyManager->Untie("atmosphere/psiw-rad");
+  PropertyManager->Untie("atmosphere/p-turb-rad_sec");
+  PropertyManager->Untie("atmosphere/q-turb-rad_sec");
+  PropertyManager->Untie("atmosphere/r-turb-rad_sec");
+}
+
 //%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
 //    The bitmasked value choices are as follows:
 //    unset: In this case (the default) JSBSim would only print
@@ -349,56 +409,3 @@ void FGAtmosphere::Debug(int from)
   }
 }
 
-void FGAtmosphere::bind(void){
-  PropertyManager->Tie("atmosphere/T-R", this,
-                       &FGAtmosphere::GetTemperature);
-  PropertyManager->Tie("atmosphere/rho-slugs_ft3", this,
-                       &FGAtmosphere::GetDensity);
-  PropertyManager->Tie("atmosphere/P-psf", this,
-                       &FGAtmosphere::GetPressure);
-  PropertyManager->Tie("atmosphere/a-fps", this,
-                       &FGAtmosphere::GetSoundSpeed);
-  PropertyManager->Tie("atmosphere/T-sl-R", this,
-                       &FGAtmosphere::GetTemperatureSL);
-  PropertyManager->Tie("atmosphere/rho-sl-slugs_ft3", this,
-                       &FGAtmosphere::GetDensitySL);
-  PropertyManager->Tie("atmosphere/P-sl-psf", this,
-                       &FGAtmosphere::GetPressureSL);
-  PropertyManager->Tie("atmosphere/a-sl-fps", this,
-                       &FGAtmosphere::GetSoundSpeedSL);
-  PropertyManager->Tie("atmosphere/theta-norm", this,
-                       &FGAtmosphere::GetTemperatureRatio);
-  PropertyManager->Tie("atmosphere/sigma-norm", this,
-                       &FGAtmosphere::GetDensityRatio);
-  PropertyManager->Tie("atmosphere/delta-norm", this,
-                       &FGAtmosphere::GetPressureRatio);
-  PropertyManager->Tie("atmosphere/a-norm", this,
-                       &FGAtmosphere::GetSoundSpeedRatio);
-  PropertyManager->Tie("atmosphere/psiw-rad", this,
-                       &FGAtmosphere::GetWindPsi);
-  PropertyManager->Tie("atmosphere/p-turb-rad_sec", this,1,
-                       &FGAtmosphere::GetTurbPQR);
-  PropertyManager->Tie("atmosphere/q-turb-rad_sec", this,2,
-                       &FGAtmosphere::GetTurbPQR);
-  PropertyManager->Tie("atmosphere/r-turb-rad_sec", this,3,
-                       &FGAtmosphere::GetTurbPQR);
-}
-
-void FGAtmosphere::unbind(void){
-  PropertyManager->Untie("atmosphere/T-R");
-  PropertyManager->Untie("atmosphere/rho-slugs_ft3");
-  PropertyManager->Untie("atmosphere/P-psf");
-  PropertyManager->Untie("atmosphere/a-fps");
-  PropertyManager->Untie("atmosphere/T-sl-R");
-  PropertyManager->Untie("atmosphere/rho-sl-slugs_ft3");
-  PropertyManager->Untie("atmosphere/P-sl-psf");
-  PropertyManager->Untie("atmosphere/a-sl-fps");
-  PropertyManager->Untie("atmosphere/theta-norm");
-  PropertyManager->Untie("atmosphere/sigma-norm");
-  PropertyManager->Untie("atmosphere/delta-norm");
-  PropertyManager->Untie("atmosphere/a-norm");
-  PropertyManager->Untie("atmosphere/psiw-rad");
-  PropertyManager->Untie("atmosphere/p-turb-rad_sec");
-  PropertyManager->Untie("atmosphere/q-turb-rad_sec");
-  PropertyManager->Untie("atmosphere/r-turb-rad_sec");
-}
index c752213815e5921c3299e27ddace56f4a21c173f..7714e7eaf4c3f5d775857ecfdb20a97991ff8903 100644 (file)
@@ -285,20 +285,23 @@ string FGCoefficient::GetCoefficientValues(void)
 
 //%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
 
-void FGCoefficient::bind(FGPropertyManager *node) {
+void FGCoefficient::bind(FGPropertyManager *parent) {
   string mult;
   unsigned i;
   
-  FGCoefficient::node=node;
+  node=parent->GetNode(name,true);
   
   node->SetString("description",description);
   if(LookupR) node->SetString("row-parm",LookupR->getName() );
   if(LookupC) node->SetString("column-parm",LookupC->getName() );
   
   mult="";
+  if(multipliers.size() == 0) 
+    mult="none";
+    
   for (i=0; i<multipliers.size(); i++) {
       mult += multipliers[i]->getName();
-      if( i < multipliers.size()-1 ) mult += "|"; 
+      if( i < multipliers.size()-1 ) mult += " "; 
   }
   node->SetString("multipliers",mult);
   
index 69e3d1d04bedd434a69194ee84ff4ae5149f4ad8..ca262c8febf7d4a3b8dd10ef4ddee0222be5e420 100644 (file)
@@ -125,8 +125,8 @@ public:
   inline double getBias(void) const { return bias; }
   inline double getGain(void) const { return gain; }
   
-  void bind(FGPropertyManager *node);
-  void unbind(void);
+  virtual void bind(FGPropertyManager *parent);
+  virtual void unbind(void);
 
 private:
   enum Type {UNKNOWN, VALUE, VECTOR, TABLE, EQUATION};
index 3bed31dd0d448bf5859cf7392f55b6987f9a3e73..7734fe48a15a46d96cb7f167bbb6454ef805faf3 100644 (file)
@@ -65,6 +65,11 @@ DEFINITIONS
 FORWARD DECLARATIONS
 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%*/
 
+typedef enum { iDe=0, iDaL, iDaR, iDr, iDsb, iDsp, iDf } FcIdx;
+int const NNorm=7;
+typedef enum { ofRad=0, ofNorm, ofMag } OutputForm;
+int const NForms=3;
+
 /*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
 COMMENTS, REFERENCES, and NOTES [use "class documentation" below for API docs]
 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%*/
@@ -153,11 +158,6 @@ CLASS DOCUMENTATION
 CLASS DECLARATION
 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%*/
 
-typedef enum { iDe=0, iDaL, iDaR, iDr, iDsb, iDsp, iDf } FcIdx;
-int const NNorm=7;
-typedef enum { ofRad=0, ofNorm, ofMag } OutputForm;
-int const NForms=3;
-
 class FGFCS : public FGModel {
 
 public:
@@ -267,9 +267,8 @@ public:
   /** Gets the flaps position.
       @return flaps position in radians */
   inline double GetDfPos( int form = ofRad ) 
-                         const { return DspPos[form]; }
+                         const { return DfPos[form]; }
                          
-  
   /** Gets the throttle position.
       @param engine engine ID number
       @return throttle position for the given engine in percent ( 0 - 100)*/
index d918a9d644a296b229147154dae06adef156637a..c0e9f8f52d2073e30e59b79c4f273a6ca3ebe68d 100644 (file)
@@ -81,6 +81,7 @@ GLOBAL DECLARATIONS
 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%*/
 
 unsigned int FGFDMExec::FDMctr = 0;
+FGPropertyManager* FGFDMExec::master=0;
 
 /*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
 CLASS IMPLEMENTATION
@@ -112,6 +113,7 @@ FGFDMExec::FGFDMExec(FGPropertyManager* root)
   terminate = false;
   frozen = false;
   modelLoaded = false;
+  IsSlave = false;
 
   IdFDM = FDMctr;
   FDMctr++;
@@ -124,11 +126,9 @@ FGFDMExec::FGFDMExec(FGPropertyManager* root)
     debug_lvl = 1;
   }
 
+  if (root == 0)  master= new FGPropertyManager;
+  else            master = root;
 
-  if(root == 0) 
-    master= new FGPropertyManager;
-  else
-    master = root;  
   instance = master->GetNode("/fdm/jsbsim",IdFDM,true);
   instance->SetDouble("zero",0);  
   
@@ -154,6 +154,9 @@ FGFDMExec::~FGFDMExec()
     cout << "Caught error: " << msg << endl;
   }    
 
+  for (int i=1; i<SlaveFDMList.size(); i++) delete SlaveFDMList[i]->exec;
+  SlaveFDMList.clear();
   Debug(1);
 }
 
@@ -329,6 +332,11 @@ bool FGFDMExec::Run(void)
 
   Debug(2);
 
+  for (int i=0; i<SlaveFDMList.size(); i++) {
+    // TransferState(i);
+    // Run(i)
+  }
+
   while (!model_iterator->Run()) {
     model_iterator = model_iterator->NextModel;
     if (model_iterator == 0L) break;
@@ -353,6 +361,31 @@ bool FGFDMExec::RunIC(FGInitialCondition *fgic)
 
 //%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
 
+void FGFDMExec::TransferState(int idxFDM)
+{
+  SlaveFDMList[idxFDM]->exec->GetRotation()->SetEuler(Rotation->GetEuler());
+  SlaveFDMList[idxFDM]->exec->GetRotation()->SetAeroPQR(Rotation->GetAeroPQR());
+  SlaveFDMList[idxFDM]->exec->GetTranslation()->SetAeroUVW(Translation->GetAeroUVW());
+  SlaveFDMList[idxFDM]->exec->GetRotation()->SetEuler(Rotation->GetEuler());
+}
+
+//%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+
+vector <string> FGFDMExec::EnumerateFDMs(void)
+{
+  vector <string> FDMList;
+
+  FDMList.push_back(Aircraft->GetAircraftName());
+
+  for (int i=1; i<SlaveFDMList.size(); i++) {
+    FDMList.push_back(SlaveFDMList[i]->exec->GetAircraft()->GetAircraftName());
+  }
+
+  return FDMList;
+}
+
+//%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+
 bool FGFDMExec::LoadModel(string APath, string EPath, string model)
 {
   bool result = true;
@@ -383,6 +416,10 @@ bool FGFDMExec::LoadModel(string APath, string EPath, string model)
     if (token == "METRICS") {
       if (debug_lvl > 0) cout << fgcyan << "\n  Reading Metrics" << fgdef << endl;
       if (!ReadMetrics(&AC_cfg)) result = false;
+    } else if (token == "SLAVE") {
+      if (debug_lvl > 0) cout << fgcyan << "\n  Reading Slave flight vehicle: " << fgdef
+                                        << AC_cfg.GetValue("NAME") << endl;
+      if (!ReadSlave(&AC_cfg)) result = false;
     } else if (token == "AERODYNAMICS") {
       if (debug_lvl > 0) cout << fgcyan << "\n  Reading Aerodynamics" << fgdef << endl;
       if (!ReadAerodynamics(&AC_cfg)) result = false;
@@ -420,7 +457,7 @@ bool FGFDMExec::ReadPrologue(FGConfigFile* AC_cfg)
   string token = AC_cfg->GetValue();
   string scratch;
   string AircraftName;
-  
+
   AircraftName = AC_cfg->GetValue("NAME");
   Aircraft->SetAircraftName(AircraftName);
 
@@ -432,7 +469,7 @@ bool FGFDMExec::ReadPrologue(FGConfigFile* AC_cfg)
 
   if (debug_lvl > 0)
     cout << "                            Version: " << highint << CFGVersion
-                                                             << normint << endl;
+                                                    << normint << endl;
   if (CFGVersion != needed_cfg_version) {
     cerr << endl << fgred << "YOU HAVE AN INCOMPATIBLE CFG FILE FOR THIS AIRCRAFT."
             " RESULTS WILL BE UNPREDICTABLE !!" << endl;
@@ -440,6 +477,34 @@ bool FGFDMExec::ReadPrologue(FGConfigFile* AC_cfg)
     cerr << "         You have version: " << CFGVersion << endl << fgdef << endl;
     return false;
   }
+
+  return true;
+}
+
+//%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+
+bool FGFDMExec::ReadSlave(FGConfigFile* AC_cfg)
+{
+  // Add a new slaveData object to the slave FDM list
+  // Populate that slaveData element with a new FDMExec object
+  // Set the IsSlave flag for that FDMExec object
+  // Get the aircraft name
+  // set debug level to print out no additional data for slave objects
+  // Load the model given the aircraft name
+  // reset debug level to prior setting
+
+  int saved_debug_lvl = debug_lvl;
+
+  SlaveFDMList.push_back(new slaveData);
+  SlaveFDMList.back()->exec = new FGFDMExec();
+  SlaveFDMList.back()->exec->SetSlave();
+
+  string AircraftName = AC_cfg->GetValue("FILE");
+
+  debug_lvl = 0;
+  SlaveFDMList.back()->exec->LoadModel("aircraft", "engine", AircraftName);
+  debug_lvl = saved_debug_lvl;
+
   return true;
 }
 
index 365efb29db1880b28c12e83d186f9d3962f6258b..5ced2e4c3756b414ab6a542c6e48aa0f7db72dd9 100644 (file)
@@ -113,7 +113,6 @@ class FGFDMExec : public FGJSBBase
 {
 public:
 
-  
   /// Default constructor
   FGFDMExec(FGPropertyManager* root = 0);
   
@@ -202,6 +201,8 @@ public:
   inline string GetAircraftPath(void)        {return AircraftPath;}
   
   FGPropertyManager* GetPropertyManager(void);
+  vector <string> EnumerateFDMs(void);
+  void SetSlave(void) {IsSlave = true;}
 
 private:
   FGModel* FirstModel;
@@ -213,10 +214,29 @@ private:
   unsigned int IdFDM;
   static unsigned int FDMctr;
   bool modelLoaded;
-  
-  FGPropertyManager *master;
+  bool IsSlave;
+  static FGPropertyManager *master;
   FGPropertyManager *instance;
 
+  struct slaveData {
+    FGFDMExec* exec;
+    string info;
+    double x, y, z;
+    double roll, pitch, yaw;
+    bool mated;
+
+    slaveData(void) {
+      info = "";
+      x = y = z = 0.0;
+      roll = pitch = yaw = 0.0;
+      mated = true;
+    }
+
+    ~slaveData(void) {
+      delete exec;
+    }
+  };
+
   string AircraftPath;
   string EnginePath;
   string CFGVersion;
@@ -236,7 +256,10 @@ private:
   FGAuxiliary*       Auxiliary;
   FGOutput*          Output;
 
+  vector <slaveData*> SlaveFDMList;
+
   bool ReadMetrics(FGConfigFile*);
+  bool ReadSlave(FGConfigFile*);
   bool ReadPropulsion(FGConfigFile*);
   bool ReadFlightControls(FGConfigFile*);
   bool ReadAerodynamics(FGConfigFile*);
@@ -244,6 +267,7 @@ private:
   bool ReadPrologue(FGConfigFile*);
   bool ReadOutput(FGConfigFile*);
 
+  void TransferState(int idx);
   bool Allocate(void);
   bool DeAllocate(void);
   void Debug(int from);
index 796bcb94e4212b23711e99fbdc17b03051dc08d0..32a8d4e71610bb46ad9fff7b33524468895328ec 100644 (file)
@@ -128,6 +128,35 @@ double FGFactorGroup::TotalValue(void)
   return totalValue;
 }
 
+/*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%*/
+
+void FGFactorGroup::bind(FGPropertyManager* parent) {
+  
+  cout << "In FGFactorGroup::bind" << endl;
+  cout << parent->getName() << endl;
+  unsigned i;
+  node=parent->GetNode(name,true);
+  cout << node->getName() << endl;
+  node->SetString("description",description);
+  FGCoefficient::bind(node);
+  for (i=0; i < sum.size(); i++) { 
+    sum[i]->bind(node);
+  } 
+  node=(FGPropertyManager*)node->getParent();                                         
+
+}
+
+/*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%*/
+  
+void FGFactorGroup::unbind(void) {
+  unsigned i;
+  
+  FGCoefficient::unbind();
+  for (i=0; i < sum.size(); i++) { 
+    sum[i]->unbind();
+  } 
+}
+
 /*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%*/
 //    The bitmasked value choices are as follows:
 //    unset: In this case (the default) JSBSim would only print
index d3e2afd2a7c6d0a98422e128702d04a10afe75b9..296f2a0fb5cf1cb0c2b1ee178ecf041535ed55ac 100644 (file)
@@ -105,6 +105,8 @@ class FGFactorGroup: public FGCoefficient {
     inline double GetSD(void) { return SDtotal; }
     inline double GetFactorSD(void) { return FGCoefficient::GetSD(); }
     
+    void bind(FGPropertyManager* parent);
+    void unbind(void);
   private:
     FGFDMExec *FDMExec;
     string name;
@@ -113,6 +115,7 @@ class FGFactorGroup: public FGCoefficient {
     CoeffArray sum;
     double SDtotal;
     double totalValue;
+    FGPropertyManager* node;
     void Debug(int from);
 };
     
index 7cfa2303084512830feecec5cc84c43e77d4c5ff..e8f381a8b1c1150fc8af9684b588377c0e688061 100644 (file)
@@ -775,48 +775,7 @@ bool FGInitialCondition::Load(string acpath, string acname, string rstfile)
   return true;
 }
 
-//%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
-//    The bitmasked value choices are as follows:
-//    unset: In this case (the default) JSBSim would only print
-//       out the normally expected messages, essentially echoing
-//       the config files as they are read. If the environment
-//       variable is not set, debug_lvl is set to 1 internally
-//    0: This requests JSBSim not to output any messages
-//       whatsoever.
-//    1: This value explicity requests the normal JSBSim
-//       startup messages
-//    2: This value asks for a message to be printed out when
-//       a class is instantiated
-//    4: When this value is set, a message is displayed when a
-//       FGModel object executes its Run() method
-//    8: When this value is set, various runtime state variables
-//       are printed out periodically
-//    16: When set various parameters are sanity checked and
-//       a message is printed out when they go out of bounds
-
-void FGInitialCondition::Debug(int from)
-{
-  if (debug_lvl <= 0) return;
-
-  if (debug_lvl & 1) { // Standard console startup message output
-  }
-  if (debug_lvl & 2 ) { // Instantiation/Destruction notification
-    if (from == 0) cout << "Instantiated: FGInitialCondition" << endl;
-    if (from == 1) cout << "Destroyed:    FGInitialCondition" << endl;
-  }
-  if (debug_lvl & 4 ) { // Run() method entry print for FGModel-derived objects
-  }
-  if (debug_lvl & 8 ) { // Runtime state variables
-  }
-  if (debug_lvl & 16) { // Sanity checking
-  }
-  if (debug_lvl & 64) {
-    if (from == 0) { // Constructor
-      cout << IdSrc << endl;
-      cout << IdHdr << endl;
-    }
-  }
-}
+//******************************************************************************
 
 void FGInitialCondition::bind(void){
   PropertyManager->Tie("ic/vc-kts", this,
@@ -965,6 +924,8 @@ void FGInitialCondition::bind(void){
                        true);
 }
 
+//******************************************************************************
+
 void FGInitialCondition::unbind(void){
   PropertyManager->Untie("ic/vc-kts");
   PropertyManager->Untie("ic/ve-kts");
@@ -1010,3 +971,47 @@ void FGInitialCondition::unbind(void){
   PropertyManager->Untie("ic/lat-gc-rad");
   PropertyManager->Untie("ic/long-gc-rad");
 }
+
+//%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+//    The bitmasked value choices are as follows:
+//    unset: In this case (the default) JSBSim would only print
+//       out the normally expected messages, essentially echoing
+//       the config files as they are read. If the environment
+//       variable is not set, debug_lvl is set to 1 internally
+//    0: This requests JSBSim not to output any messages
+//       whatsoever.
+//    1: This value explicity requests the normal JSBSim
+//       startup messages
+//    2: This value asks for a message to be printed out when
+//       a class is instantiated
+//    4: When this value is set, a message is displayed when a
+//       FGModel object executes its Run() method
+//    8: When this value is set, various runtime state variables
+//       are printed out periodically
+//    16: When set various parameters are sanity checked and
+//       a message is printed out when they go out of bounds
+
+void FGInitialCondition::Debug(int from)
+{
+  if (debug_lvl <= 0) return;
+
+  if (debug_lvl & 1) { // Standard console startup message output
+  }
+  if (debug_lvl & 2 ) { // Instantiation/Destruction notification
+    if (from == 0) cout << "Instantiated: FGInitialCondition" << endl;
+    if (from == 1) cout << "Destroyed:    FGInitialCondition" << endl;
+  }
+  if (debug_lvl & 4 ) { // Run() method entry print for FGModel-derived objects
+  }
+  if (debug_lvl & 8 ) { // Runtime state variables
+  }
+  if (debug_lvl & 16) { // Sanity checking
+  }
+  if (debug_lvl & 64) {
+    if (from == 0) { // Constructor
+      cout << IdSrc << endl;
+      cout << IdHdr << endl;
+    }
+  }
+}
+
index c82c43d934e8ddc18400083ab3c683b89ae706a8..e7efe9cfbe95c0b36327459b92d67bb235d5a203 100644 (file)
@@ -245,7 +245,7 @@ void FGOutput::DelimitedOutput(string fname)
     outstream << Translation->Getqbar() << ", ";
     outstream << Translation->GetVt() << ", ";
     outstream << Translation->GetUVW() << ", ";
-    outstream << Translation->GetvAeroUVW() << ", ";
+    outstream << Translation->GetAeroUVW() << ", ";
     outstream << Position->GetVel();
   }
   if (SubSystems & ssForces) {
@@ -367,9 +367,9 @@ void FGOutput::SocketOutput(void)
   socket->Append(Translation->GetUVW(eU));
   socket->Append(Translation->GetUVW(eV));
   socket->Append(Translation->GetUVW(eW));
-  socket->Append(Translation->GetvAeroUVW(eU));
-  socket->Append(Translation->GetvAeroUVW(eV));
-  socket->Append(Translation->GetvAeroUVW(eW));
+  socket->Append(Translation->GetAeroUVW(eU));
+  socket->Append(Translation->GetAeroUVW(eV));
+  socket->Append(Translation->GetAeroUVW(eW));
   socket->Append(Position->GetVn());
   socket->Append(Position->GetVe());
   socket->Append(Position->GetVd());
index d19af1d27c03403218c25c06f73985207222e1c8..1fcd1e56191f8a9512b2a7ae8447f653214c6bdb 100644 (file)
@@ -289,18 +289,18 @@ void FGPosition::bind(void){
                        &FGPosition::Geth,
                        &FGPosition::Seth,
                        true);
-  PropertyManager->Tie("postition/h-dot-fps", this,
+  PropertyManager->Tie("velocities/h-dot-fps", this,
                        &FGPosition::Gethdot);
-  PropertyManager->Tie("postition/lat-gc-rad", this,
+  PropertyManager->Tie("position/lat-gc-rad", this,
                        &FGPosition::GetLatitude,
                        &FGPosition::SetLatitude);
-  PropertyManager->Tie("postition/lat-dot-gc-rad", this,
+  PropertyManager->Tie("position/lat-dot-gc-rad", this,
                        &FGPosition::GetLatitudeDot);
-  PropertyManager->Tie("postition/long-gc-rad", this,
+  PropertyManager->Tie("position/long-gc-rad", this,
                        &FGPosition::GetLongitude,
                        &FGPosition::SetLongitude,
                        true);
-  PropertyManager->Tie("postition/long-dot-gc-rad", this,
+  PropertyManager->Tie("position/long-dot-gc-rad", this,
                        &FGPosition::GetLongitudeDot);
   PropertyManager->Tie("metrics/runway-radius", this,
                        &FGPosition::GetRunwayRadius,
@@ -313,9 +313,9 @@ void FGPosition::bind(void){
   PropertyManager->Tie("flight-path/gamma-rad", this,
                        &FGPosition::GetGamma,
                        &FGPosition::SetGamma);
-  PropertyManager->Tie("position/h_b-cg-ft", this,
+  PropertyManager->Tie("aero/h_b-cg-ft", this,
                        &FGPosition::GetHOverBCG);
-  PropertyManager->Tie("position/h_b-mac-ft", this,
+  PropertyManager->Tie("aero/h_b-mac-ft", this,
                        &FGPosition::GetHOverBMAC);
 }
 
@@ -326,15 +326,15 @@ void FGPosition::unbind(void){
   PropertyManager->Untie("velocities/vg-fps");
   PropertyManager->Untie("flight-path/psi-gt-rad");
   PropertyManager->Untie("position/h-sl-ft");
-  PropertyManager->Untie("postition/h-dot-fps");
-  PropertyManager->Untie("postition/lat-gc-rad");
-  PropertyManager->Untie("postition/lat-dot-gc-rad");
-  PropertyManager->Untie("postition/long-gc-rad");
-  PropertyManager->Untie("postition/long-dot-gc-rad");
+  PropertyManager->Untie("velocities/h-dot-fps");
+  PropertyManager->Untie("position/lat-gc-rad");
+  PropertyManager->Untie("position/lat-dot-gc-rad");
+  PropertyManager->Untie("position/long-gc-rad");
+  PropertyManager->Untie("position/long-dot-gc-rad");
   PropertyManager->Untie("metrics/runway-radius");
   PropertyManager->Untie("position/h-agl-ft");
   PropertyManager->Untie("position/radius-to-vehicle-ft");
   PropertyManager->Untie("flight-path/gamma-rad");
-  PropertyManager->Untie("position/h_b-cg-ft");
-  PropertyManager->Untie("position/h_b-mac-ft");
+  PropertyManager->Untie("aero/h_b-cg-ft");
+  PropertyManager->Untie("aero/h_b-mac-ft");
 }
index e4d54e7ad80ea747aaa302e7b8a2621251231040..1d9a9e0af7f6f7b7d03eaf44a53455419351a485 100644 (file)
@@ -127,7 +127,7 @@ FGPropeller::~FGPropeller()
 double FGPropeller::Calculate(double PowerAvailable)
 {
   double J, C_Thrust, omega;
-  double Vel = fdmex->GetTranslation()->GetvAeroUVW(eU);
+  double Vel = fdmex->GetTranslation()->GetAeroUVW(eU);
   double rho = fdmex->GetAtmosphere()->GetDensity();
   double RPS = RPM/60.0;
   double alpha, beta;
@@ -190,7 +190,7 @@ double FGPropeller::GetPowerRequired(void)
 
   double cPReq, RPS = RPM / 60.0;
 
-  double J = fdmex->GetTranslation()->GetvAeroUVW(eU) / (Diameter * RPS);
+  double J = fdmex->GetTranslation()->GetAeroUVW(eU) / (Diameter * RPS);
   double rho = fdmex->GetAtmosphere()->GetDensity();
 
   if (MaxPitch == MinPitch) { // Fixed pitch prop
index c98011d8a7dcd5e71a8fe9bcb3866bcf8289d65d..a3051196a2d118a58c7238033c4037f8e9485077 100644 (file)
@@ -1,23 +1,79 @@
-// FGPropertyManager.h
-// Class wrapper for property handling.
-// based on FlightGear source src/Main/fg_props.hxx 
-// Originally written by David Megginson, started 2000.
-//
-// This file is in the Public Domain, and comes with no warranty.
+/*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+ Header:       FGPropertyManager.h
+ Author:       Tony Peden
+               Based on work originally by David Megginson
+ Date:         2/2002
+ ------------- Copyright (C) 2002 -------------
+ This program is free software; you can redistribute it and/or modify it under
+ the terms of the GNU General Public License as published by the Free Software
+ Foundation; either version 2 of the License, or (at your option) any later
+ version.
+ This program is distributed in the hope that it will be useful, but WITHOUT
+ ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
+ FOR A PARTICULAR PURPOSE.  See the GNU General Public License for more
+ details.
+ You should have received a copy of the GNU General Public License along with
+ this program; if not, write to the Free Software Foundation, Inc., 59 Temple
+ Place - Suite 330, Boston, MA  02111-1307, USA.
+
+ Further information about the GNU General Public License can also be found on
+ the world wide web at http://www.gnu.org.
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+SENTRY
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%*/
 
 #ifndef FGPROPERTYMANAGER_H
 #define FGPROPERTYMANAGER_H
 
+/*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+INCLUDES
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%*/
+
 #include <simgear/misc/props.hxx>
 
+/*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+DEFINITIONS
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%*/
+
+#define ID_PROPERTYMANAGER "$Id$"
+
+/*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+FORWARD DECLARATIONS
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%*/
+
 using namespace std;
 
+/*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+COMMENTS, REFERENCES, and NOTES [use "class documentation" below for API docs]
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+CLASS DOCUMENTATION
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%*/
+
+/** Class wrapper for property handling.
+    @author David Megginson, Tony Peden
+    @see <a href="http://cvs.sourceforge.net/cgi-bin/viewcvs.cgi/jsbsim/JSBSim/FGPropertyManager.h?rev=HEAD&content-type=text/vnd.viewcvs-markup">
+         Header File </a>
+  */
+  
+/*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+CLASS DECLARATION
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%*/
+
 class FGPropertyManager:public SGPropertyNode {
   public:
+    /// Constructor
     FGPropertyManager(void) {
       
     }
-    
+    /// Destructor
     ~FGPropertyManager(void) {
       
     }   
@@ -505,19 +561,19 @@ class FGPropertyManager:public SGPropertyNode {
     }
 
     /* template <class V> void
-    FGPropertyManager::Tie (const string &name, V (*getter)(), void (*setter)(V) = 0,
+    Tie (const string &name, V (*getter)(), void (*setter)(V) = 0,
            bool useDefault = true);
     
     template <class V> void
-    FGPropertyManager::Tie (const string &name, int index, V (*getter)(int),
+    Tie (const string &name, int index, V (*getter)(int),
            void (*setter)(int, V) = 0, bool useDefault = true);
     
     template <class T, class V> void
-    FGPropertyManager::Tie (const string &name, T * obj, V (T::*getter)() const,
+    Tie (const string &name, T * obj, V (T::*getter)() const,
            void (T::*setter)(V) = 0, bool useDefault = true);
 
     template <class T, class V> void 
-    FGPropertyManager::Tie (const string &name, T * obj, int index,
+    Tie (const string &name, T * obj, int index,
            V (T::*getter)(int) const, void (T::*setter)(int, V) = 0,
            bool useDefault = true); */
 
@@ -539,7 +595,7 @@ class FGPropertyManager:public SGPropertyNode {
      */
     template <class V>
     inline void
-    FGPropertyManager::Tie (const string &name, V (*getter)(), void (*setter)(V) = 0,
+    Tie (const string &name, V (*getter)(), void (*setter)(V) = 0,
            bool useDefault = true)
     {
       if (!tie(name.c_str(), SGRawValueFunctions<V>(getter, setter),
@@ -569,7 +625,7 @@ class FGPropertyManager:public SGPropertyNode {
      */
     template <class V>
     inline void
-    FGPropertyManager::Tie (const string &name, int index, V (*getter)(int),
+    Tie (const string &name, int index, V (*getter)(int),
            void (*setter)(int, V) = 0, bool useDefault = true)
     {
       if (!tie(name.c_str(),
@@ -603,7 +659,7 @@ class FGPropertyManager:public SGPropertyNode {
      */
     template <class T, class V>
     inline void
-    FGPropertyManager::Tie (const string &name, T * obj, V (T::*getter)() const,
+    Tie (const string &name, T * obj, V (T::*getter)() const,
            void (T::*setter)(V) = 0, bool useDefault = true)
     {
       if (!tie(name.c_str(),
@@ -635,7 +691,7 @@ class FGPropertyManager:public SGPropertyNode {
      */
     template <class T, class V>
     inline void 
-    FGPropertyManager::Tie (const string &name, T * obj, int index,
+    Tie (const string &name, T * obj, int index,
            V (T::*getter)(int) const, void (T::*setter)(int, V) = 0,
            bool useDefault = true)
     {
index df614a6ee5d0d3d8e04b838c4227bf6c0d24cdb1..645ff44db978db1116b86f0d6da018ecf1489640 100644 (file)
@@ -545,6 +545,49 @@ double FGPropulsion::GetTanksIxy(const FGColumnVector3& vXYZcg)
   return I;
 }
 
+//%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+
+void FGPropulsion::bind(void){
+  /* PropertyManager->Tie("propulsion/num-engines", this,
+                       &FGPropulsion::GetNumEngines);
+  PropertyManager->Tie("propulsion/num-tanks", this,
+                       &FGPropulsion::GetNumTanks); */
+  PropertyManager->Tie("propulsion/num-sel-fuel-tanks", this,
+                       &FGPropulsion::GetnumSelectedFuelTanks);
+  PropertyManager->Tie("propulsion/num-sel-ox-tanks", this,
+                       &FGPropulsion::GetnumSelectedOxiTanks);
+  PropertyManager->Tie("forces/fbx-prop-lbs", this,1,
+                       &FGPropulsion::GetForces);
+  PropertyManager->Tie("forces/fby-prop-lbs", this,2,
+                       &FGPropulsion::GetForces);
+  PropertyManager->Tie("forces/fbz-prop-lbs", this,3,
+                       &FGPropulsion::GetForces);
+  PropertyManager->Tie("moments/l-prop-lbsft", this,1,
+                       &FGPropulsion::GetMoments);
+  PropertyManager->Tie("moments/m-prop-lbsft", this,2,
+                       &FGPropulsion::GetMoments);
+  PropertyManager->Tie("moments/n-prop-lbsft", this,3,
+                       &FGPropulsion::GetMoments);
+  //PropertyManager->Tie("propulsion/tanks-weight-lbs", this,
+  //                     &FGPropulsion::GetTanksWeight);
+}
+
+//%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+
+void FGPropulsion::unbind(void){
+  /* PropertyManager->Untie("propulsion/num-engines");
+  PropertyManager->Untie("propulsion/num-tanks"); */
+  PropertyManager->Untie("propulsion/num-sel-fuel-tanks");
+  PropertyManager->Untie("propulsion/num-sel-ox-tanks");
+  PropertyManager->Untie("forces/fbx-prop-lbs");
+  PropertyManager->Untie("forces/fby-prop-lbs");
+  PropertyManager->Untie("forces/fbz-prop-lbs");
+  PropertyManager->Untie("moments/l-prop-lbsft");
+  PropertyManager->Untie("moments/m-prop-lbsft");
+  PropertyManager->Untie("moments/n-prop-lbsft");
+  //PropertyManager->Untie("propulsion/tanks-weight-lbs");
+}
+
 //%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
 //    The bitmasked value choices are as follows:
 //    unset: In this case (the default) JSBSim would only print
@@ -591,41 +634,3 @@ void FGPropulsion::Debug(int from)
   }
 }
 
-void FGPropulsion::bind(void){
-  /* PropertyManager->Tie("propulsion/num-engines", this,
-                       &FGPropulsion::GetNumEngines);
-  PropertyManager->Tie("propulsion/num-tanks", this,
-                       &FGPropulsion::GetNumTanks); */
-  PropertyManager->Tie("propulsion/num-sel-fuel-tanks", this,
-                       &FGPropulsion::GetnumSelectedFuelTanks);
-  PropertyManager->Tie("propulsion/num-sel-ox-tanks", this,
-                       &FGPropulsion::GetnumSelectedOxiTanks);
-  PropertyManager->Tie("propulsion/fbx-prop-lbs", this,1,
-                       &FGPropulsion::GetForces);
-  PropertyManager->Tie("propulsion/fby-prop-lbs", this,2,
-                       &FGPropulsion::GetForces);
-  PropertyManager->Tie("propulsion/fbz-prop-lbs", this,3,
-                       &FGPropulsion::GetForces);
-  PropertyManager->Tie("propulsion/l-prop-lbsft", this,1,
-                       &FGPropulsion::GetMoments);
-  PropertyManager->Tie("propulsion/m-prop-lbsft", this,2,
-                       &FGPropulsion::GetMoments);
-  PropertyManager->Tie("propulsion/n-prop-lbsft", this,3,
-                       &FGPropulsion::GetMoments);
-  //PropertyManager->Tie("propulsion/tanks-weight-lbs", this,
-  //                     &FGPropulsion::GetTanksWeight);
-}
-
-void FGPropulsion::unbind(void){
-  /* PropertyManager->Untie("propulsion/num-engines");
-  PropertyManager->Untie("propulsion/num-tanks"); */
-  PropertyManager->Untie("propulsion/num-sel-fuel-tanks");
-  PropertyManager->Untie("propulsion/num-sel-ox-tanks");
-  PropertyManager->Untie("propulsion/fbx-prop-lbs");
-  PropertyManager->Untie("propulsion/fby-prop-lbs");
-  PropertyManager->Untie("propulsion/fbz-prop-lbs");
-  PropertyManager->Untie("propulsion/l-prop-lbsft");
-  PropertyManager->Untie("propulsion/m-prop-lbsft");
-  PropertyManager->Untie("propulsion/n-prop-lbsft");
-  //PropertyManager->Untie("propulsion/tanks-weight-lbs");
-}
index c20887184514740f5efdd6a2009771001ecdc634..068b44c290dccb154d56bf5812776143a10e540a 100644 (file)
@@ -100,6 +100,10 @@ public:
   inline void SetPQR(double p, double q, double r) {vPQR(eP)=p;
                                                     vPQR(eQ)=q;
                                                     vPQR(eR)=r;}
+  inline void SetAeroPQR(FGColumnVector3 tt) {vAeroPQR = tt;}
+  inline void SetAeroPQR(double p, double q, double r) {vAeroPQR(eP)=p;
+                                                        vAeroPQR(eQ)=q;
+                                                        vAeroPQR(eR)=r;}
   inline void SetEuler(FGColumnVector3 tt) {vEuler = tt;}
   
   inline double Getphi(void) const {return vEuler(1);}
index 11cdbfcac618f21b3c84f53be32aebd7963f1230..a3a23045018f987c9c9afceaaf70a0df02907c99 100644 (file)
@@ -998,7 +998,7 @@ void FGState::InitPropertyMaps(void)  {
   ParamToProp[  FG_MAGNETO_CMD ]="zero";
   ParamToProp[  FG_STARTER_CMD ]="zero";
   ParamToProp[  FG_ACTIVE_ENGINE ]="zero";
-  ParamToProp[  FG_HOVERB ]="position/h_b-mac-ft";
+  ParamToProp[  FG_HOVERB ]="aero/h_b-mac-ft";
   ParamToProp[  FG_PITCH_TRIM_CMD ]="fcs/pitch-trim-cmd-norm";
   ParamToProp[  FG_YAW_TRIM_CMD ]="fcs/yaw-trim-cmd-norm";
   ParamToProp[  FG_ROLL_TRIM_CMD ]="fcs/roll-trim-cmd-norm";
@@ -1068,7 +1068,7 @@ void FGState::InitPropertyMaps(void)  {
   PropToParam[ "fcs/speedbrake-cmd-norm" ]      = FG_SPDBRAKE_CMD;
   PropToParam[ "fcs/spoiler-cmd-norm" ]         = FG_SPOILERS_CMD;
   PropToParam[ "fcs/flap-cmd-norm" ]            = FG_FLAPS_CMD;
-  PropToParam[ "position/h_b-mac-ft" ]          = FG_HOVERB;
+  PropToParam[ "aero/h_b-mac-ft" ]              = FG_HOVERB;
   PropToParam[ "fcs/pitch-trim-cmd-norm" ]      = FG_PITCH_TRIM_CMD;
   PropToParam[ "fcs/yaw-trim-cmd-norm" ]        = FG_YAW_TRIM_CMD;
   PropToParam[ "fcs/roll-trim-cmd-norm" ]       = FG_ROLL_TRIM_CMD;
index 51bcb31468a8553398c4818485242b00d3e709e1..bee3a0adfabafc34f7010b027c5e6d4999093d65 100644 (file)
@@ -245,11 +245,11 @@ void FGTranslation::bind(void){
   PropertyManager->Tie("accelerations/wdot-fps", this,3,
                        &FGTranslation::GetUVWdot);
   PropertyManager->Tie("velocities/u-aero-fps", this,1,
-                       &FGTranslation::GetvAeroUVW);
+                       &FGTranslation::GetAeroUVW);
   PropertyManager->Tie("velocities/v-aero-fps", this,2,
-                       &FGTranslation::GetvAeroUVW);
+                       &FGTranslation::GetAeroUVW);
   PropertyManager->Tie("velocities/w-aero-fps", this,3,
-                       &FGTranslation::GetvAeroUVW);
+                       &FGTranslation::GetAeroUVW);
   PropertyManager->Tie("aero/alpha-rad", this,
                        &FGTranslation::Getalpha,
                        &FGTranslation::Setalpha,
index 25bd748b507d488960267994005078caa383d73b..177ee2f4c72efc2cd7027fec8a923671edf1ab7e 100644 (file)
@@ -91,8 +91,8 @@ public:
   inline FGColumnVector3& GetUVW   (void)    { return vUVW; }
   inline FGColumnVector3& GetUVWdot(void)    { return vUVWdot; }
   inline double           GetUVWdot(int idx) const { return vUVWdot(idx); }
-  inline FGColumnVector3& GetvAeroUVW (void)    { return vAeroUVW; }
-  inline double           GetvAeroUVW (int idx) const { return vAeroUVW(idx); }
+  inline FGColumnVector3& GetAeroUVW (void)    { return vAeroUVW; }
+  inline double           GetAeroUVW (int idx) const { return vAeroUVW(idx); }
 
   double Getalpha(void) const { return alpha; }
   double Getbeta (void) const { return beta; }
@@ -104,6 +104,7 @@ public:
   double Getbdot (void) const { return bdot; }
 
   void SetUVW(FGColumnVector3 tt) { vUVW = tt; }
+  void SetAeroUVW(FGColumnVector3 tt) { vAeroUVW = tt; }
 
   inline void Setalpha(double tt) { alpha = tt; }
   inline void Setbeta (double tt) { beta  = tt; }