# include <fstream.h>
# endif
#else
-# if defined(sgi) && !defined(__GNUC__)
+# if defined(sgi) && !defined(__GNUC__) && (_COMPILER_VERSION < 740)
# include <fstream.h>
# else
# include <fstream>
FGEngine::FGEngine(FGFDMExec* exec)
- : Name(""),
- Type(etUnknown),
- X(0), Y(0), Z(0),
- EnginePitch(0), EngineYaw(0),
- SLFuelFlowMax(0), SLOxiFlowMax(0),
- MaxThrottle(1.0), MinThrottle(0.0),
- Thrust(0.0),
- Throttle(0.0),
- Mixture(1.0),
- Magnetos(0),
- Starter(false),
- FuelNeed(0.0), OxidizerNeed(0.0),
- Starved(false), Flameout(false), Running(false), Cranking(false),
- PctPower(0.0),
- EngineNumber(-1),
- TrimMode(false),
- FuelFlow_gph(0.0),
- ManifoldPressure_inHg(0.0),
- ExhaustGasTemp_degK(0.0),
- CylinderHeadTemp_degK(0.0),
- OilPressure_psi(0.0),
- OilTemp_degK(0.0),
- FDMExec(exec),
- State(FDMExec->GetState()),
- Atmosphere(FDMExec->GetAtmosphere()),
- FCS(FDMExec->GetFCS()),
- Propulsion(FDMExec->GetPropulsion()),
- Aircraft(FDMExec->GetAircraft()),
- Translation(FDMExec->GetTranslation()),
- Rotation(FDMExec->GetRotation()),
- Position(FDMExec->GetPosition()),
- Auxiliary(FDMExec->GetAuxiliary()),
- Output(FDMExec->GetOutput())
{
+ Name.clear();
+ Type = etUnknown;
+ X = Y = Z = 0.0;
+ EnginePitch = EngineYaw = 0.0;
+ SLFuelFlowMax = SLOxiFlowMax = 0.0;
+ MaxThrottle = 1.0;
+ MinThrottle = 0.0;
+ Thrust = 0.0;
+ Throttle = 0.0;
+ Mixture = 1.0;
+ Starter = false;
+ FuelNeed = OxidizerNeed = 0.0;
+ Starved = Running = Cranking = false;
+ PctPower = 0.0;
+ EngineNumber = -1;
+ TrimMode = false;
+ FuelFlow_gph = 0.0;
+ FuelFlow_pph = 0.0;
+
+ FDMExec = exec;
+ State = FDMExec->GetState();
+ Atmosphere = FDMExec->GetAtmosphere();
+ FCS = FDMExec->GetFCS();
+ Propulsion = FDMExec->GetPropulsion();
+ Aircraft = FDMExec->GetAircraft();
+ Translation = FDMExec->GetTranslation();
+ Rotation = FDMExec->GetRotation();
+ Position = FDMExec->GetPosition();
+ Auxiliary = FDMExec->GetAuxiliary();
+ Output = FDMExec->GetOutput();
+
+ PropertyManager = FDMExec->GetPropertyManager();
+
Debug(0);
}
if (TrimMode) return;
Fshortage = Oshortage = 0.0;
for (unsigned int i=0; i<SourceTanks.size(); i++) {
- Tank = Propulsion->GetTank(i);
+ Tank = Propulsion->GetTank(SourceTanks[i]);
if (Tank->GetType() == FGTank::ttFUEL) {
Fshortage += Tank->Reduce(CalcFuelNeed()/Propulsion->GetnumSelectedFuelTanks());
} else {
//%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
-double FGEngine::CalcFuelNeed(void) {
+double FGEngine::CalcFuelNeed(void)
+{
FuelNeed = SLFuelFlowMax*PctPower*State->Getdt()*Propulsion->GetRate();
return FuelNeed;
}
//%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
-double FGEngine::CalcOxidizerNeed(void) {
+double FGEngine::CalcOxidizerNeed(void)
+{
OxidizerNeed = SLOxiFlowMax*PctPower*State->Getdt()*Propulsion->GetRate();
return OxidizerNeed;
}
//%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
-void FGEngine::SetPlacement(double x, double y, double z, double pitch, double yaw) {
+void FGEngine::SetPlacement(double x, double y, double z, double pitch, double yaw)
+{
X = x;
Y = y;
Z = z;