]> git.mxchange.org Git - flightgear.git/blobdiff - src/FDM/JSBSim/FGThruster.cpp
Frederic Bouvier:
[flightgear.git] / src / FDM / JSBSim / FGThruster.cpp
index f1330f967b222f5c37c4fd29c660213bf199a74f..a03df18f433d76ec8fe9bfcc1d901333a329226d 100644 (file)
@@ -35,8 +35,12 @@ HISTORY
 INCLUDES
 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%*/
 
+#include <sstream>
+
 #include "FGThruster.h"
 
+namespace JSBSim {
+
 static const char *IdSrc = "$Id$";
 static const char *IdHdr = ID_THRUSTER;
 
@@ -45,9 +49,9 @@ CLASS IMPLEMENTATION
 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%*/
 
 
-FGThruster::FGThruster(FGFDMExec *FDMExec) : FGForce(FDMExec),
-                                             ThrusterNumber(0)
+FGThruster::FGThruster(FGFDMExec *FDMExec) : FGForce(FDMExec)
 {
+  Type = ttDirect;
   SetTransformType(FGForce::tCustom);
 
   Debug(0);
@@ -55,13 +59,15 @@ FGThruster::FGThruster(FGFDMExec *FDMExec) : FGForce(FDMExec),
 
 //%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
 
-FGThruster::FGThruster(FGFDMExec *FDMExec, 
-                       FGConfigFile *Eng_cfg ): FGForce(FDMExec) {
-   ThrusterNumber=0;                   
-   SetTransformType(FGForce::tCustom);
-   Name=Eng_cfg->GetValue();
-   Debug(0);
-}   
+FGThruster::FGThruster(FGFDMExec *FDMExec,
+                       FGConfigFile *Eng_cfg ): FGForce(FDMExec)
+{
+  Type = ttDirect;
+  SetTransformType(FGForce::tCustom);
+  Name = Eng_cfg->GetValue();
+  GearRatio = 1.0;
+  Debug(0);
+}
 
 //%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
 
@@ -70,6 +76,28 @@ FGThruster::~FGThruster()
   Debug(1);
 }
 
+//%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+
+string FGThruster::GetThrusterLabels(int id)
+{
+  std::ostringstream buf;
+
+  buf << Name << "_Thrust[" << id << "]";
+
+  return buf.str();
+}
+
+//%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+
+string FGThruster::GetThrusterValues(int id)
+{
+  std::ostringstream buf;
+
+  buf << Thrust;
+
+  return buf.str();
+}
+
 //%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
 //    The bitmasked value choices are as follows:
 //    unset: In this case (the default) JSBSim would only print
@@ -115,4 +143,4 @@ void FGThruster::Debug(int from)
     }
   }
 }
-
+}