]> git.mxchange.org Git - flightgear.git/blobdiff - src/FDM/JSBSim/models/propulsion/FGPropeller.h
Better fix for a compilation problem with MSVC 2012
[flightgear.git] / src / FDM / JSBSim / models / propulsion / FGPropeller.h
index ea7953e1eabc8eba4c422104b02b3b63e7d3b932..1b353d2cba81a1437cfe90a5f97a3d387c124433 100644 (file)
@@ -45,7 +45,7 @@ INCLUDES
 DEFINITIONS
 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%*/
 
-#define ID_PROPELLER "$Id: FGPropeller.h,v 1.16 2010/04/09 12:44:06 jberndt Exp $"
+#define ID_PROPELLER "$Id: FGPropeller.h,v 1.20 2011/10/31 14:54:41 bcoconni Exp $"
 
 /*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
 FORWARD DECLARATIONS
@@ -62,6 +62,7 @@ CLASS DOCUMENTATION
 
 <h3>Configuration File Format:</h3>
 @code
+<sense> {1 | -1} </sense> 
 <propeller name="{string}">
   <ixx> {number} </ixx>
   <diameter unit="IN"> {number} </diameter>
@@ -73,7 +74,6 @@ CLASS DOCUMENTATION
   <maxrpm> {number} </maxrpm>
   <constspeed> {number} </constspeed>
   <reversepitch> {number} </reversepitch>
-  <sense> {1 | -1} </sense>
   <p_factor> {number} </p_factor>
   <ct_factor> {number} </ct_factor>
   <cp_factor> {number} </cp_factor>
@@ -119,7 +119,8 @@ CLASS DOCUMENTATION
     \<constspeed>    - 1 = constant speed mode, 0 = manual pitch mode. 
     \<reversepitch>  - Blade pitch angle for reverse.
     \<sense>         - Direction of rotation (1=clockwise as viewed from cockpit,
-                        -1=anti-clockwise as viewed from cockpit).
+                        -1=anti-clockwise as viewed from cockpit). Sense is
+                       specified in the parent tag of the propeller.
     \<p_factor>      - P factor.
     \<ct_factor>     - A multiplier for the coefficients of thrust.
     \<cp_factor>     - A multiplier for the coefficients of power.
@@ -141,7 +142,7 @@ CLASS DOCUMENTATION
     <li>Various NACA Technical Notes and Reports</li>
     </ul>
     @author Jon S. Berndt
-    @version $Id: FGPropeller.h,v 1.16 2010/04/09 12:44:06 jberndt Exp $
+    @version $Id: FGPropeller.h,v 1.20 2011/10/31 14:54:41 bcoconni Exp $
     @see FGEngine
     @see FGThruster
 */
@@ -170,8 +171,11 @@ public:
       @param rpm the rotational velocity of the propeller */
   void SetRPM(double rpm) {RPM = rpm;}
 
+  /** Sets the Revolutions Per Minute for the propeller using the engine gear ratio **/
+  void SetEngineRPM(double rpm) {RPM = rpm/GearRatio;}
+
   /// Returns true of this propeller is variable pitch
-  bool IsVPitch(void) {return MaxPitch != MinPitch;}
+  bool IsVPitch(void) const {return MaxPitch != MinPitch;}
 
   /** This commands the pitch of the blade to change to the value supplied.
       This call is meant to be issued either from the cockpit or by the flight
@@ -203,22 +207,25 @@ public:
   void SetSense(double s) { Sense = s;}
 
   /// Retrieves the pitch of the propeller in degrees.
-  double GetPitch(void)         { return Pitch;         }
+  double GetPitch(void) const     { return Pitch;         }
 
   /// Retrieves the RPMs of the propeller
-  double GetRPM(void)     const { return RPM;           } 
+  double GetRPM(void) const       { return RPM;           } 
+
+  /// Calculates the RPMs of the engine based on gear ratio
+  double GetEngineRPM(void) const { return RPM * GearRatio;  } 
 
   /// Retrieves the propeller moment of inertia
-  double GetIxx(void)           { return Ixx;           }
+  double GetIxx(void) const       { return Ixx;           }
 
   /// Retrieves the coefficient of thrust multiplier
-  double GetCtFactor(void)      { return CtFactor;      }
+  double GetCtFactor(void) const  { return CtFactor;      }
 
   /// Retrieves the coefficient of power multiplier
-  double GetCpFactor(void)      { return CpFactor;      }
+  double GetCpFactor(void) const  { return CpFactor;      }
 
   /// Retrieves the propeller diameter
-  double GetDiameter(void)      { return Diameter;      }
+  double GetDiameter(void) const  { return Diameter;      }
 
   /// Retrieves propeller thrust table
   FGTable* GetCThrustTable(void) const { return cThrust;}
@@ -231,7 +238,7 @@ public:
   FGTable* GetCpMachTable(void) const { return CpMach; }
 
   /// Retrieves the Torque in foot-pounds (Don't you love the English system?)
-  double GetTorque(void)        { return vTorque(eX);    }
+  double GetTorque(void) const  { return vTorque(eX); }
 
   /** Retrieves the power required (or "absorbed") by the propeller -
       i.e. the power required to keep spinning the propeller at the current
@@ -247,17 +254,17 @@ public:
       accelerate the prop. It could be negative, dictating that the propeller
       would be slowed.
       @return the thrust in pounds */
-  double Calculate(double PowerAvailable);
-  FGColumnVector3 GetPFactor(void);
-  string GetThrusterLabels(int id, string delimeter);
-  string GetThrusterValues(int id, string delimeter);
+  double Calculate(double EnginePower);
+  FGColumnVector3 GetPFactor(void) const;
+  string GetThrusterLabels(int id, const string& delimeter);
+  string GetThrusterValues(int id, const string& delimeter);
 
   void   SetReverseCoef (double c) { Reverse_coef = c; }
-  double GetReverseCoef (void) { return Reverse_coef; }
+  double GetReverseCoef (void) const { return Reverse_coef; }
   void   SetReverse (bool r) { Reversed = r; }
-  bool   GetReverse (void) { return Reversed; }
+  bool   GetReverse (void) const { return Reversed; }
   void   SetFeather (bool f) { Feathered = f; }
-  bool   GetFeather (void) { return Feathered; }
+  bool   GetFeather (void) const { return Feathered; }
   double GetThrustCoefficient(void) const {return ThrustCoeff;}
   double GetHelicalTipMach(void) const {return HelicalTipMach;}
   int    GetConstantSpeed(void) const {return ConstantSpeed;}