]> git.mxchange.org Git - flightgear.git/blobdiff - src/FDM/JSBSim/models/propulsion/FGThruster.cpp
Merge branch 'next' of http://git.gitorious.org/fg/flightgear into next
[flightgear.git] / src / FDM / JSBSim / models / propulsion / FGThruster.cpp
index 32a508ee17c9f55111a805fe138d776d94537d9d..147aad5dabe57b8736da04622a5389c5c57b4a3e 100644 (file)
@@ -45,7 +45,7 @@ using namespace std;
 
 namespace JSBSim {
 
-static const char *IdSrc = "$Id$";
+static const char *IdSrc = "$Id: FGThruster.cpp,v 1.14 2011/03/10 01:35:25 dpculp Exp $";
 static const char *IdHdr = ID_THRUSTER;
 
 /*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
@@ -66,6 +66,7 @@ FGThruster::FGThruster(FGFDMExec *FDMExec, Element *el, int num ): FGForce(FDMEx
 
   GearRatio = 1.0;
   ReverserAngle = 0.0;
+  ClutchCtrlNorm = 1.0;
   EngineNum = num;
   PropertyManager = FDMExec->GetPropertyManager();
 
@@ -74,11 +75,11 @@ FGThruster::FGThruster(FGFDMExec *FDMExec, Element *el, int num ): FGForce(FDMEx
 
   element = thruster_element->FindElement("location");
   if (element)  location = element->FindElementTripletConvertTo("IN");
-  else          cerr << "No thruster location found." << endl;
+  else          cerr << fgred << "      No thruster location found." << reset << endl;
 
   element = thruster_element->FindElement("orient");
   if (element)  orientation = element->FindElementTripletConvertTo("RAD");
-  else          cerr << "No thruster orientation found." << endl;
+  else          cerr << "      No thruster orientation found." << endl;
 
   SetLocation(location);
   SetAnglesToBody(orientation);
@@ -98,6 +99,13 @@ FGThruster::FGThruster(FGFDMExec *FDMExec, Element *el, int num ): FGForce(FDMEx
                                                           &FGThruster::SetReverserAngle);
   }
 
+  if (el->GetName() == "rotor") // At this time only a rotor can have a clutch.
+  {
+    property_name = base_property_name + "/clutch-ctrl-norm";
+    PropertyManager->Tie( property_name.c_str(), (FGThruster *)this, &FGThruster::GetClutchCtrl,
+                                                          &FGThruster::SetClutchCtrl);
+  }
+
   Debug(0);
 }