]> git.mxchange.org Git - flightgear.git/blobdiff - src/FDM/JSBSim/models/propulsion/FGEngine.cpp
Better fix for a compilation problem with MSVC 2012
[flightgear.git] / src / FDM / JSBSim / models / propulsion / FGEngine.cpp
index e0c056b37925ae23bbf369ecf8533269c70c8554..7dbec50a4cc5bd20bd747108e1d64b917ffcffab 100644 (file)
@@ -53,7 +53,7 @@ using namespace std;
 
 namespace JSBSim {
 
-static const char *IdSrc = "$Id: FGEngine.cpp,v 1.47 2011/09/11 11:36:04 bcoconni Exp $";
+static const char *IdSrc = "$Id: FGEngine.cpp,v 1.50 2012/03/17 20:46:29 jentron Exp $";
 static const char *IdHdr = ID_ENGINE;
 
 /*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
@@ -83,7 +83,7 @@ FGEngine::FGEngine(FGFDMExec* exec, Element* engine_element, int engine_number,
 
   Name = engine_element->GetAttributeValue("name");
 
-  Load(engine_element, PropertyManager, to_string(EngineNumber)); // Call ModelFunctions loader
+  Load(engine_element, PropertyManager, ::to_string(EngineNumber)); // Call ModelFunctions loader
 
 // Find and set engine location
 
@@ -132,7 +132,7 @@ FGEngine::FGEngine(FGFDMExec* exec, Element* engine_element, int engine_number,
   property_name = base_property_name + "/fuel-used-lbs";
   PropertyManager->Tie( property_name.c_str(), this, &FGEngine::GetFuelUsedLbs);
 
-  PostLoad(engine_element, PropertyManager, to_string(EngineNumber));
+  PostLoad(engine_element, PropertyManager, ::to_string(EngineNumber));
 
   Debug(0);
 }
@@ -183,7 +183,8 @@ unsigned int FGEngine::GetSourceTank(unsigned int i) const
 
 //%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
 
-void FGEngine::SetPlacement(FGColumnVector3& location, FGColumnVector3& orientation)
+void FGEngine::SetPlacement(const FGColumnVector3& location,
+                            const FGColumnVector3& orientation)
 {
   X = location(eX);
   Y = location(eY);
@@ -201,14 +202,14 @@ double FGEngine::GetThrust(void) const
 
 //%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
 
-  FGColumnVector3& FGEngine::GetBodyForces(void)
+const FGColumnVector3& FGEngine::GetBodyForces(void)
 {
   return Thruster->GetBodyForces();
 }
 
 //%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
 
-FGColumnVector3& FGEngine::GetMoments(void)
+const FGColumnVector3& FGEngine::GetMoments(void)
 {
   return Thruster->GetMoments();
 }
@@ -247,10 +248,10 @@ bool FGEngine::LoadThruster(Element *thruster_element)
 
   thruster_filename = thruster_element->GetAttributeValue("file");
   if ( !thruster_filename.empty()) {
-    thruster_fullpathname = fullpath + thruster_filename + ".xml";
+    thruster_fullpathname = localpath + thruster_filename + ".xml";
     thruster_file.open(thruster_fullpathname.c_str());
     if ( !thruster_file.is_open()) {
-      thruster_fullpathname = localpath + thruster_filename + ".xml";
+      thruster_fullpathname = fullpath + thruster_filename + ".xml";
       thruster_file.open(thruster_fullpathname.c_str());
       if ( !thruster_file.is_open()) {
         cerr << "Could not open thruster file: " << thruster_filename << ".xml" << endl;