]> git.mxchange.org Git - flightgear.git/blobdiff - src/FDM/JSBSim/FGScript.cpp
Fix stall widths for the "auxilliary" (reverse flow) stalls so they
[flightgear.git] / src / FDM / JSBSim / FGScript.cpp
index 13526278f9d031552dffabcfc5d5d588e3dfee66..8634b2ebb0a0259fdc8708d7099a2548f284d03c 100644 (file)
@@ -46,7 +46,7 @@ INCLUDES
 #  include STL_IOSTREAM
 #  include STL_ITERATOR
 #else
-#  if defined(sgi) && !defined(__GNUC__)
+#  if defined(sgi) && !defined(__GNUC__) && (_COMPILER_VERSION < 740)
 #    include <iostream.h>
 #  else
 #    include <iostream>
@@ -56,6 +56,9 @@ INCLUDES
 
 #include "FGScript.h"
 #include "FGConfigFile.h"
+#include "FGTrim.h"
+
+namespace JSBSim {
 
 static const char *IdSrc = "$Id$";
 static const char *IdHdr = ID_FGSCRIPT;
@@ -103,7 +106,7 @@ bool FGScript::LoadScript( string script )
   if (Script.GetValue("runscript").length() <= 0) {
     cerr << "File: " << script << " is not a script file" << endl;
     delete FDMExec;
-    return false; 
+    return false;
   }
   ScriptName = Script.GetValue("name");
   Scripted = true;
@@ -143,12 +146,12 @@ bool FGScript::LoadScript( string script )
           newCondition = new struct condition();
           while (token != string("/when")) {
             if (token == "parameter") {
-              prop_name = State->GetPropertyName( Script.GetValue("name") );
+              prop_name = Script.GetValue("name");
               newCondition->TestParam.push_back( PropertyManager->GetNode(prop_name) );
               newCondition->TestValue.push_back(strtod(Script.GetValue("value").c_str(), NULL));
               newCondition->Comparison.push_back(Script.GetValue("comparison"));
             } else if (token == "set") {
-              prop_name = State->GetPropertyName( Script.GetValue("name") );
+              prop_name = Script.GetValue("name");
               newCondition->SetParam.push_back( PropertyManager->GetNode(prop_name) );
               newCondition->SetValue.push_back(strtod(Script.GetValue("value").c_str(), NULL));
               newCondition->Triggered.push_back(false);
@@ -166,14 +169,14 @@ bool FGScript::LoadScript( string script )
               else if (tempCompare == "FG_STEP") newCondition->Action.push_back(FG_STEP);
               else if (tempCompare == "FG_EXP")  newCondition->Action.push_back(FG_EXP);
               else                               newCondition->Action.push_back((eAction)0);
-              
+
               if (Script.GetValue("persistent") == "true")
                 newCondition->Persistent.push_back(true);
               else
                 newCondition->Persistent.push_back(false);
-               
+
               newCondition->TC.push_back(strtod(Script.GetValue("tc").c_str(), NULL));
-             
+
             } else {
               cerr << "Unrecognized keyword in script file: \" [when] " << token << "\"" << endl;
             }
@@ -209,7 +212,13 @@ bool FGScript::LoadScript( string script )
     cerr << "Initialization unsuccessful" << endl;
     exit(-1);
   }
-
+/* comment this out for conversion capability
+  FGTrim fgt(FDMExec, tFull);
+  if ( !fgt.DoTrim() ) {
+    cout << "Trim Failed" << endl;
+  }
+  fgt.Report();
+*/
   return true;
 }
 
@@ -415,4 +424,4 @@ void FGScript::Debug(int from)
     }
   }
 }
-
+}