- Rotation = FDMExec->GetRotation();
- Position = FDMExec->GetPosition();
- Auxiliary = FDMExec->GetAuxiliary();
- Output = FDMExec->GetOutput();
-
- Name = engineName;
-
-# ifndef macintosh
- fullpath = enginePath + "/" + engineName + ".xml";
-# else
- fullpath = enginePath + ";" + engineName + ".xml";
-# endif
-
- cout << " Reading engine: " << engineName << " from file: " << fullpath << endl;
- ifstream enginefile(fullpath.c_str());
-
- if (enginefile) {
- enginefile >> tag;
-
- if (tag == "ROCKET") Type = etRocket;
- else if (tag == "PISTON") Type = etPiston;
- else if (tag == "TURBOPROP") Type = etTurboProp;
- else if (tag == "TURBOJET") Type = etTurboJet;
- else Type = etUnknown;
-
- switch(Type) {
- case etTurboProp:
- case etTurboJet:
- cerr << "Unsupported Engine type" << tag << endl;
- break;
- case etUnknown:
- cerr << "Unknown engine type: " << tag << endl;
- break;
- case etPiston:
- enginefile >> X;
- enginefile >> Y;
- enginefile >> Z;
- enginefile >> EnginePitch;
- enginefile >> EngineYaw;
- enginefile >> BrakeHorsePower;
- enginefile >> MaxThrottle;
- enginefile >> MinThrottle;
- enginefile >> SLFuelFlowMax;
- enginefile >> SpeedSlope;
- enginefile >> SpeedIntercept;
- enginefile >> AltitudeSlope;
-
- break;
- case etRocket:
- enginefile >> X;
- enginefile >> Y;
- enginefile >> Z;
- enginefile >> EnginePitch;
- enginefile >> EngineYaw;
- enginefile >> SLThrustMax;
- enginefile >> VacThrustMax;
- enginefile >> MaxThrottle;
- enginefile >> MinThrottle;
- enginefile >> SLFuelFlowMax;
- enginefile >> SLOxiFlowMax;
- break;
- }
-
- enginefile.close();
- } else {
- cerr << "Unable to open engine definition file " << fullpath.c_str() << endl;
- }
-
- EngineNumber = num;
- Thrust = PctPower = 0.0;
- Starved = Flameout = false;
- Running = true;