]> git.mxchange.org Git - flightgear.git/blobdiff - src/FDM/JSBSim/FGThruster.h
Fix stall widths for the "auxilliary" (reverse flow) stalls so they
[flightgear.git] / src / FDM / JSBSim / FGThruster.h
index 723a09fc68dcd10137ab7ba32512a425a1d04716..ff523588df49c244c7f4b4d1f6bca97735cea6b5 100644 (file)
@@ -27,10 +27,6 @@ HISTORY
 --------------------------------------------------------------------------------
 08/24/00  JSB  Created
 
-%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
-COMMENTS, REFERENCES,  and NOTES
-%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
-
 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
 SENTRY
 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%*/
@@ -44,9 +40,30 @@ INCLUDES
 
 #include "FGForce.h"
 #include "FGConfigFile.h"
+#include "FGPropertyManager.h"
+#include <string>
+
+/*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+DEFINITIONS
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%*/
 
 #define ID_THRUSTER "$Id$"
 
+/*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+FORWARD DECLARATIONS
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%*/
+
+namespace JSBSim {
+
+/*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+CLASS DOCUMENTATION
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%*/
+
+/** Base class for specific thrusting devices such as propellers, nozzles, etc.
+    @author Jon Berndt
+    @version $Id$
+    */
+
 /*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
 CLASS DECLARATION
 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%*/
@@ -54,28 +71,50 @@ CLASS DECLARATION
 class FGThruster : public FGForce {
 
 public:
+  /// Constructor
   FGThruster(FGFDMExec *FDMExec);
+  FGThruster(FGFDMExec *FDMExec, FGConfigFile *Eng_cfg, int num );
+  /// Destructor
   virtual ~FGThruster();
 
-  enum eType {ttNozzle, ttRotor, ttPropeller};
+  enum eType {ttNozzle, ttRotor, ttPropeller, ttDirect};
 
-  virtual float Calculate(float) {return 0.0;}
+  virtual double Calculate(double tt) {
+       Thrust = tt;
+       vFn(1) = Thrust * cos(ReverserAngle);
+       return vFn(1);
+  }
   void SetName(string name) {Name = name;}
-  virtual float GetPowerRequired(void) {return 0.0;}
-  virtual void SetdeltaT(float dt) {deltaT = dt;}
-  float GetThrust(void) {return Thrust;}
+  virtual void SetRPM(double rpm) {};
+  virtual double GetPowerRequired(void) {return 0.0;}
+  virtual void SetdeltaT(double dt) {deltaT = dt;}
+  double GetThrust(void) {return Thrust;}
   eType GetType(void) {return Type;}
   string GetName(void) {return Name;}
+  virtual double GetRPM(void) { return 0.0; };
+  double GetGearRatio(void) {return GearRatio; }
+  virtual string GetThrusterLabels(int id, string delimeter);
+  virtual string GetThrusterValues(int id, string delimeter);
+  void SetReverserAngle(double radians) { ReverserAngle = radians; }
+  double GetReverserAngle(void) {return ReverserAngle;}
+
+
+  inline void SetThrustCoefficient(double ct) { ThrustCoeff = ct; }
 
 protected:
   eType Type;
   string Name;
-  float Thrust;
-  float PowerRequired;
-  float deltaT;
-  void Debug(void);
+  double Thrust;
+  double PowerRequired;
+  double deltaT;
+  double GearRatio;
+  double ThrustCoeff;
+  double ReverserAngle;
+  int EngineNum;
+  FGPropertyManager* PropertyManager;
+  virtual void Debug(int from);
 };
-
+}
 //%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
 #endif