]> git.mxchange.org Git - flightgear.git/blobdiff - src/FDM/JSBSim/FGJSBBase.h
Encapsulate the interpolstion version of FGEnvironment and fix some bugs
[flightgear.git] / src / FDM / JSBSim / FGJSBBase.h
index 80d3e17ea78e11d18dba47760d350a6daf366f5b..9f05b313f66e180bc5a16681a369dd9afc201502 100644 (file)
@@ -45,7 +45,11 @@ INCLUDES
 #  include STL_STRING
 
 SG_USING_STD(string);
-SG_USING_STD(queue);
+
+# ifndef M_PI
+#  include <simgear/constants.h>
+#  define M_PI SG_PI
+# endif
 
 #else
 
@@ -58,12 +62,15 @@ SG_USING_STD(queue);
 #  endif
 
 using std::string;
-using std::queue;
+
+# ifndef M_PI
+#  define M_PI 3.14159265358979323846
+# endif
+
 #endif
 
-#ifndef M_PI 
-#  include <simgear/constants.h>
-#  define M_PI SG_PI
+#if !defined(WIN32) || defined(__GNUC__)
+using std::max;
 #endif
 
 #ifdef __FreeBSD__ // define gcvt on FreeBSD
@@ -72,8 +79,8 @@ using std::queue;
 
 static char *gcvt(double number, size_t ndigit, char *buf)
 {
-     sprintf(buf, "%f", number);
-     return buf;
+  sprintf(buf, "%f", number);
+  return buf;
 }
 #endif
 
@@ -87,10 +94,7 @@ DEFINITIONS
 FORWARD DECLARATIONS
 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%*/
 
-
-/*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
-COMMENTS, REFERENCES, and NOTES [use "class documentation" below for API docs]
-%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%*/
+namespace JSBSim {
 
 /*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
 CLASS DOCUMENTATION
@@ -105,8 +109,6 @@ CLASS DOCUMENTATION
 CLASS DECLARATION
 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%*/
 
-namespace JSBSim {
-
 class FGJSBBase {
 public:
   /// Constructor for FGJSBBase.
@@ -209,14 +211,22 @@ public:
   
   void disableHighLighting(void);
 
+  static short debug_lvl;
+  double KelvinToFahrenheit (double kelvin) {
+    return 1.8*kelvin - 459.4;
+  }
+
+  double RankineToCelsius (double rankine) {
+    return (rankine - 491.67)/1.8;
+  }
+
 protected:
   static Message localMsg;
   
-  static queue <Message*> Messages;
+  static std::queue <Message*> Messages;
 
   virtual void Debug(int from) {};
 
-  static short debug_lvl;
   static unsigned int frame;
   static unsigned int messageId;
   
@@ -228,7 +238,7 @@ protected:
   static const double ktstofps;
   static const double inchtoft;
   static const double in3tom3;
-  static const double Reng;         // Specific Gas Constant,ft^2/(sec^2*R)
+  static double Reng;         // Specific Gas Constant,ft^2/(sec^2*R)
   static const double SHRatio;
   static const string needed_cfg_version;
   static const string JSBSim_version;