#include "FGElectric.h"
#include "models/FGPropulsion.h"
#include "models/propulsion/FGThruster.h"
+#include "FGPropeller.h"
#include <iostream>
#include <sstream>
namespace JSBSim {
-static const char *IdSrc = "$Id: FGElectric.cpp,v 1.9 2010/08/21 17:13:48 jberndt Exp $";
+static const char *IdSrc = "$Id: FGElectric.cpp,v 1.11 2011/06/06 22:35:08 jentron Exp $";
static const char *IdHdr = ID_ELECTRIC;
/*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
if (el->FindElement("power"))
PowerWatts = el->FindElementValueAsNumberConvertTo("power","WATTS");
+ string property_name, base_property_name;
+ base_property_name = CreateIndexedPropertyName("propulsion/engine", EngineNumber);
+ property_name = base_property_name + "/power-hp";
+ PropertyManager->Tie(property_name, &HP);
+
Debug(0); // Call Debug() routine from constructor if needed
}
Throttle = FCS->GetThrottlePos(EngineNumber);
+ if (Thruster->GetType() == FGThruster::ttPropeller) {
+ ((FGPropeller*)Thruster)->SetAdvance(FCS->GetPropAdvance(EngineNumber));
+ ((FGPropeller*)Thruster)->SetFeather(FCS->GetPropFeather(EngineNumber));
+ }
+
RPM = Thruster->GetRPM() * Thruster->GetGearRatio();
HP = PowerWatts * Throttle / hptowatts;
+
+ Thruster->Calculate(HP * hptoftlbssec);
- PowerAvailable = (HP * hptoftlbssec) - Thruster->GetPowerRequired();
+ RunPostFunctions();
+}
- Thruster->Calculate(PowerAvailable);
+//%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
- RunPostFunctions();
+double FGElectric::CalcFuelNeed(void)
+{
+ return 0;
}
//%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
}
}
-double
-FGElectric::CalcFuelNeed(void)
-{
- return 0;
-}
-
} // namespace JSBSim