]> git.mxchange.org Git - flightgear.git/blobdiff - src/FDM/JSBSim/FGPropulsion.h
Updated to match changes in radiostack.[ch]xx
[flightgear.git] / src / FDM / JSBSim / FGPropulsion.h
index 4070128fc0e8047a9c350e52e4a7d0a86acf8dcd..c0a9cf636f2f6e53463e7d5886ad1183b958b71b 100644 (file)
@@ -90,15 +90,22 @@ CLASS DOCUMENTATION
     @see FGEngine
     @see FGTank
     @see FGThruster
+    @see <a href="http://cvs.sourceforge.net/cgi-bin/viewcvs.cgi/jsbsim/JSBSim/FGPropulsion.h?rev=HEAD&content-type=text/vnd.viewcvs-markup">
+         Header File </a>
+    @see <a href="http://cvs.sourceforge.net/cgi-bin/viewcvs.cgi/jsbsim/JSBSim/FGPropulsion.cpp?rev=HEAD&content-type=text/vnd.viewcvs-markup">
+         Source File </a>
 */
 
 /*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
 CLASS DECLARATION
 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%*/
 
-class FGPropulsion : public FGModel {
+class FGPropulsion : public FGModel
+{
 public:
+  /// Constructor
   FGPropulsion(FGFDMExec*);
+  /// Destructor
   ~FGPropulsion();
 
   /** Executes the propulsion model.
@@ -126,7 +133,7 @@ public:
   bool Load(FGConfigFile* AC_cfg);
 
   /// Retrieves the number of engines defined for the aircraft.
-  inline unsigned int GetNumEngines(void) {return Engines.size();}
+  inline unsigned int GetNumEngines(void) const {return Engines.size();}
 
   /** Retrieves an engine object pointer from the list of engines.
       @param index the engine index within the vector container
@@ -136,6 +143,9 @@ public:
                       if (index <= Engines.size()-1) return Engines[index];
                       else                           return 0L;      }
 
+  // Retrieves the number of tanks defined for the aircraft.
+  inline unsigned int GetNumTanks(void) const {return Tanks.size();}
+
   /** Retrieves a tank object pointer from the list of tanks.
       @param index the tank index within the vector container
       @return the address of the specific tank, or zero if no such tank is
@@ -153,10 +163,10 @@ public:
                       else                             return 0L;    }
 
   /** Returns the number of fuel tanks currently actively supplying fuel */
-  inline int GetnumSelectedFuelTanks(void) {return numSelectedFuelTanks;}
+  inline int GetnumSelectedFuelTanks(void) const {return numSelectedFuelTanks;}
 
   /** Returns the number of oxidizer tanks currently actively supplying oxidizer */
-  inline int GetnumSelectedOxiTanks(void)  {return numSelectedOxiTanks;}
+  inline int GetnumSelectedOxiTanks(void) const {return numSelectedOxiTanks;}
 
   /** Loops the engines/thrusters until thrust output steady (used for trimming) */
   bool GetSteadyState(void);
@@ -168,20 +178,23 @@ public:
   string GetPropulsionStrings(void);
   string GetPropulsionValues(void);
 
-  inline FGColumnVector3& GetForces(void)  {return *Forces; }
-  inline float GetForces(int n) { return (*Forces)(n);}
-  inline FGColumnVector3& GetMoments(void) {return *Moments;}
-  inline float GetMoments(int n) {return (*Moments)(n);}
+  inline FGColumnVector3& GetForces(void)  {return vForces; }
+  inline double GetForces(int n) const { return vForces(n);}
+  inline FGColumnVector3& GetMoments(void) {return vMoments;}
+  inline double GetMoments(int n) const {return vMoments(n);}
   
-  FGColumnVector3& GetTanksCG(void);
-  float GetTanksWeight(void);
-
-  float GetTanksIxx(const FGColumnVector3& vXYZcg);
-  float GetTanksIyy(const FGColumnVector3& vXYZcg);
-  float GetTanksIzz(const FGColumnVector3& vXYZcg);
-  float GetTanksIxz(const FGColumnVector3& vXYZcg);
-  float GetTanksIxy(const FGColumnVector3& vXYZcg);
-
+  FGColumnVector3& GetTanksMoment(void);
+  double GetTanksWeight(void);
+
+  double GetTanksIxx(const FGColumnVector3& vXYZcg);
+  double GetTanksIyy(const FGColumnVector3& vXYZcg);
+  double GetTanksIzz(const FGColumnVector3& vXYZcg);
+  double GetTanksIxz(const FGColumnVector3& vXYZcg);
+  double GetTanksIxy(const FGColumnVector3& vXYZcg);
+  
+  void bind();
+  void unbind();
+   
 private:
   vector <FGEngine*>   Engines;
   vector <FGTank*>     Tanks;
@@ -194,11 +207,11 @@ private:
   unsigned int numEngines;
   unsigned int numTanks;
   unsigned int numThrusters;
-  float dt;
-  FGColumnVector3 *Forces;
-  FGColumnVector3 *Moments;
+  double dt;
+  FGColumnVector3 vForces;
+  FGColumnVector3 vMoments;
   FGColumnVector3 vXYZtank;
-  void Debug(void);
+  void Debug(int from);
 };
 
 //%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%