]> git.mxchange.org Git - flightgear.git/blobdiff - src/FDM/JSBSim/FGJSBBase.cpp
Fix stall widths for the "auxilliary" (reverse flow) stalls so they
[flightgear.git] / src / FDM / JSBSim / FGJSBBase.cpp
index a38a4c6975ef2605459bbdedf8bebc5f740e1520..61669d17967cc3460cfce393f9c5ad3588a8da9a 100644 (file)
@@ -37,6 +37,8 @@ INCLUDES
 
 #include "FGJSBBase.h"
 
+namespace JSBSim {
+
 static const char *IdSrc = "$Id$";
 static const char *IdHdr = ID_JSBBASE;
 
@@ -44,17 +46,31 @@ static const char *IdHdr = ID_JSBBASE;
 CLASS IMPLEMENTATION
 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%*/
 
-char FGJSBBase::highint[5]  = {27, '[', '1', 'm', '\0'      };
-char FGJSBBase::halfint[5]  = {27, '[', '2', 'm', '\0'      };
-char FGJSBBase::normint[6]  = {27, '[', '2', '2', 'm', '\0' };
-char FGJSBBase::reset[5]    = {27, '[', '0', 'm', '\0'      };
-char FGJSBBase::underon[5]  = {27, '[', '4', 'm', '\0'      };
-char FGJSBBase::underoff[6] = {27, '[', '2', '4', 'm', '\0' };
-char FGJSBBase::fgblue[6]   = {27, '[', '3', '4', 'm', '\0' };
-char FGJSBBase::fgcyan[6]   = {27, '[', '3', '6', 'm', '\0' };
-char FGJSBBase::fgred[6]    = {27, '[', '3', '1', 'm', '\0' };
-char FGJSBBase::fggreen[6]  = {27, '[', '3', '2', 'm', '\0' };
-char FGJSBBase::fgdef[6]    = {27, '[', '3', '9', 'm', '\0' };
+#ifndef _MSC_VER
+    char FGJSBBase::highint[5]  = {27, '[', '1', 'm', '\0'      };
+    char FGJSBBase::halfint[5]  = {27, '[', '2', 'm', '\0'      };
+    char FGJSBBase::normint[6]  = {27, '[', '2', '2', 'm', '\0' };
+    char FGJSBBase::reset[5]    = {27, '[', '0', 'm', '\0'      };
+    char FGJSBBase::underon[5]  = {27, '[', '4', 'm', '\0'      };
+    char FGJSBBase::underoff[6] = {27, '[', '2', '4', 'm', '\0' };
+    char FGJSBBase::fgblue[6]   = {27, '[', '3', '4', 'm', '\0' };
+    char FGJSBBase::fgcyan[6]   = {27, '[', '3', '6', 'm', '\0' };
+    char FGJSBBase::fgred[6]    = {27, '[', '3', '1', 'm', '\0' };
+    char FGJSBBase::fggreen[6]  = {27, '[', '3', '2', 'm', '\0' };
+    char FGJSBBase::fgdef[6]    = {27, '[', '3', '9', 'm', '\0' };
+#else
+    char FGJSBBase::highint[5]  = {'\0' };
+    char FGJSBBase::halfint[5]  = {'\0' };
+    char FGJSBBase::normint[6]  = {'\0' };
+    char FGJSBBase::reset[5]    = {'\0' };
+    char FGJSBBase::underon[5]  = {'\0' };
+    char FGJSBBase::underoff[6] = {'\0' };
+    char FGJSBBase::fgblue[6]   = {'\0' };
+    char FGJSBBase::fgcyan[6]   = {'\0' };
+    char FGJSBBase::fgred[6]    = {'\0' };
+    char FGJSBBase::fggreen[6]  = {'\0' };
+    char FGJSBBase::fgdef[6]    = {'\0' };
+#endif
 
 const double FGJSBBase::radtodeg = 57.29578;
 const double FGJSBBase::degtorad = 1.745329E-2;
@@ -64,23 +80,27 @@ const double FGJSBBase::fpstokts = 0.592484;
 const double FGJSBBase::ktstofps = 1.68781;
 const double FGJSBBase::inchtoft = 0.08333333;
 const double FGJSBBase::in3tom3 = 1.638706E-5;
-const double FGJSBBase::Reng = 1716.0;
+double FGJSBBase::Reng = 1716.0;
 const double FGJSBBase::SHRatio = 1.40;
-const string FGJSBBase::needed_cfg_version = "1.60";
-const string FGJSBBase::JSBSim_version = "0.9.2";
 
-queue <FGJSBBase::Message*> FGJSBBase::Messages;
-FGJSBBase::Message FGJSBBase::localMsg;
-unsigned int FGJSBBase::messageId = 0; 
-unsigned int FGJSBBase::frame = 0;
+// Note that definition of lbtoslug by the inverse of slugtolb and not
+// to a different constant you can also get from some tables will make
+// lbtoslug*slugtolb == 1 up to the magnitude of roundoff. So converting from
+// slug to lb and back will yield to the original value you started with up
+// to the magnitude of roundoff.
+// Taken from units gnu commandline tool
+const double FGJSBBase::slugtolb = 32.174049;
+const double FGJSBBase::lbtoslug = 1.0/slugtolb;
 
-short FGJSBBase::debug_lvl  = 0;
+const string FGJSBBase::needed_cfg_version = "1.65";
+const string FGJSBBase::JSBSim_version = "0.9.5";
 
-//%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+std::queue <FGJSBBase::Message*> FGJSBBase::Messages;
+FGJSBBase::Message FGJSBBase::localMsg;
+unsigned int FGJSBBase::messageId = 0;
+unsigned int FGJSBBase::frame = 0;
 
-FGJSBBase::FGJSBBase()
-{
-}
+short FGJSBBase::debug_lvl  = 1;
 
 //%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
 
@@ -92,7 +112,7 @@ FGJSBBase::Message* FGJSBBase::PutMessage(Message* msg)
 
 //%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
 
-FGJSBBase::Message* FGJSBBase::PutMessage(string text)
+FGJSBBase::Message* FGJSBBase::PutMessage(const string& text)
 {
   Message *msg = new Message();
   msg->text = text;
@@ -105,7 +125,7 @@ FGJSBBase::Message* FGJSBBase::PutMessage(string text)
 
 //%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
 
-FGJSBBase::Message* FGJSBBase::PutMessage(string text, bool bVal)
+FGJSBBase::Message* FGJSBBase::PutMessage(const string& text, bool bVal)
 {
   Message *msg = new Message();
   msg->text = text;
@@ -119,7 +139,7 @@ FGJSBBase::Message* FGJSBBase::PutMessage(string text, bool bVal)
 
 //%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
 
-FGJSBBase::Message* FGJSBBase::PutMessage(string text, int iVal)
+FGJSBBase::Message* FGJSBBase::PutMessage(const string& text, int iVal)
 {
   Message *msg = new Message();
   msg->text = text;
@@ -133,7 +153,7 @@ FGJSBBase::Message* FGJSBBase::PutMessage(string text, int iVal)
 
 //%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
 
-FGJSBBase::Message* FGJSBBase::PutMessage(string text, double dVal)
+FGJSBBase::Message* FGJSBBase::PutMessage(const string& text, double dVal)
 {
   Message *msg = new Message();
   msg->text = text;
@@ -159,7 +179,7 @@ FGJSBBase::Message* FGJSBBase::ProcessMessage(void)
 {
   if (!Messages.empty())
     localMsg = *(Messages.front());
-  else 
+  else
     return NULL;
   Messages.pop();
   return &localMsg;
@@ -183,4 +203,5 @@ void FGJSBBase::disableHighLighting(void) {
 
 //%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
 
+} // namespace JSBSim