From: curt Date: Mon, 16 Oct 2000 20:01:23 +0000 (+0000) Subject: Renamed new FGEngine to FGNewEngine to avoid conflict with stuff in JSBSim. X-Git-Url: https://git.mxchange.org/?a=commitdiff_plain;h=0750b9d34f9e14630ae5875de191437473dc1d6a;p=flightgear.git Renamed new FGEngine to FGNewEngine to avoid conflict with stuff in JSBSim. --- diff --git a/src/FDM/IO360.cxx b/src/FDM/IO360.cxx index 64840d047..323578aee 100644 --- a/src/FDM/IO360.cxx +++ b/src/FDM/IO360.cxx @@ -67,8 +67,8 @@ // but it is by no means currently at a completed stage - DCL 15/9/00 // // DCL 28/9/00 - Added estimate of engine and prop inertia and changed engine speed calculation to be calculated from Angular acceleration = Torque / Inertia. -// Requires a timestep to be passed to FGEngine::init and currently assumes this timestep does not change. -// Could easily be altered to pass a variable timestep to FGEngine::update every step instead if required. +// Requires a timestep to be passed to FGNewEngine::init and currently assumes this timestep does not change. +// Could easily be altered to pass a variable timestep to FGNewEngine::update every step instead if required. // ////////////////////////////////////////////////////////////////////// @@ -88,7 +88,7 @@ FG_USING_STD(cout); // Calculate Engine RPM based on Propellor Lever Position -float FGEngine::Calc_Engine_RPM (float LeverPosition) +float FGNewEngine::Calc_Engine_RPM (float LeverPosition) { // Calculate RPM as set by Prop Lever Position. Assumes engine // will run at 1000 RPM at full course @@ -104,7 +104,7 @@ float FGEngine::Calc_Engine_RPM (float LeverPosition) return RPM; } -float FGEngine::Lookup_Combustion_Efficiency(float thi_actual) +float FGNewEngine::Lookup_Combustion_Efficiency(float thi_actual) { float thi[11]; //array of equivalence ratio values float neta_comb[11]; //corresponding array of combustion efficiency values @@ -165,12 +165,12 @@ float FGEngine::Lookup_Combustion_Efficiency(float thi_actual) } //if we get here something has gone badly wrong - cout << "ERROR: error in FGEngine::Lookup_Combustion_Efficiency\n"; + cout << "ERROR: error in FGNewEngine::Lookup_Combustion_Efficiency\n"; //exit(-1); return neta_comb_actual; //keeps the compiler happy } /* -float FGEngine::Calculate_Delta_T_Exhaust(void) +float FGNewEngine::Calculate_Delta_T_Exhaust(void) { float dT_exhaust; heat_capacity_exhaust = (Cp_air * m_dot_air) + (Cp_fuel * m_dot_fuel); @@ -201,7 +201,7 @@ static float Calc_Manifold_Pressure ( float LeverPosn, float MaxMan, float MinMa // set initial default values -void FGEngine::init(double dt) { +void FGNewEngine::init(double dt) { CONVERT_CUBIC_INCHES_TO_METERS_CUBED = 1.638706e-5; // Control and environment inputs @@ -346,7 +346,7 @@ static float IAS_to_FPS (float x) // update the engine model based on current control positions -void FGEngine::update() { +void FGNewEngine::update() { // Declare local variables int num = 0; // const int num2 = 500; // default is 100, number if iterations to run diff --git a/src/FDM/IO360.hxx b/src/FDM/IO360.hxx index 01fa64c8a..12f199dae 100644 --- a/src/FDM/IO360.hxx +++ b/src/FDM/IO360.hxx @@ -64,7 +64,7 @@ FG_USING_STD(ofstream); -class FGEngine { +class FGNewEngine { private: @@ -194,12 +194,12 @@ public: ofstream outfile; //constructor - FGEngine() { + FGNewEngine() { // outfile.open("FGEngine.dat", ios::out|ios::trunc); } //destructor - ~FGEngine() { + ~FGNewEngine() { // outfile.close(); } diff --git a/src/FDM/JSBSim.cxx b/src/FDM/JSBSim.cxx index db8ee0c3f..7037273e0 100644 --- a/src/FDM/JSBSim.cxx +++ b/src/FDM/JSBSim.cxx @@ -147,23 +147,25 @@ bool FGJSBsim::init( double dt ) { << current_options.get_altitude() ); //must check > 0, != 0 will give bad result if --notrim set if(current_options.get_trim_mode() > 0) { - FDMExec.RunIC(fgic); - FG_LOG( FG_FLIGHT, FG_INFO, " Starting trim..." ); - FGTrim *fgtrim=new FGTrim(&FDMExec,fgic,tLongitudinal); - fgtrim->DoTrim(); - fgtrim->Report(); - fgtrim->TrimStats(); - fgtrim->ReportState(); - - - controls.set_elevator_trim(FDMExec.GetFCS()->GetPitchTrimCmd()); - controls.set_throttle(FGControls::ALL_ENGINES,FDMExec.GetFCS()->GetThrottleCmd(0)/100); - trimmed=true; - trim_elev=FDMExec.GetFCS()->GetPitchTrimCmd(); - trim_throttle=FDMExec.GetFCS()->GetThrottleCmd(0)/100; - //the trimming routine only knows how to get 1 value for throttle - - delete fgtrim; + if(fgic->GetVcalibratedKtsIC() > 50) { + FDMExec.RunIC(fgic); + FG_LOG( FG_FLIGHT, FG_INFO, " Starting trim..." ); + FGTrim *fgtrim=new FGTrim(&FDMExec,fgic,tLongitudinal); + fgtrim->DoTrim(); + fgtrim->Report(); + fgtrim->TrimStats(); + fgtrim->ReportState(); + + + controls.set_elevator_trim(FDMExec.GetFCS()->GetPitchTrimCmd()); + controls.set_throttle(FGControls::ALL_ENGINES,FDMExec.GetFCS()->GetThrottleCmd(0)/100); + trimmed=true; + trim_elev=FDMExec.GetFCS()->GetPitchTrimCmd(); + trim_throttle=FDMExec.GetFCS()->GetThrottleCmd(0)/100; + //the trimming routine only knows how to get 1 value for throttle + + delete fgtrim; + } FG_LOG( FG_FLIGHT, FG_INFO, " Trim complete." ); } else { FG_LOG( FG_FLIGHT, FG_INFO, " Initializing without trim" ); @@ -247,7 +249,7 @@ bool FGJSBsim::copy_to_JSBsim() { FDMExec.GetFCS()->SetDaCmd( controls.get_aileron()); FDMExec.GetFCS()->SetDeCmd( controls.get_elevator()); FDMExec.GetFCS()->SetPitchTrimCmd(controls.get_elevator_trim()); - FDMExec.GetFCS()->SetDrCmd( controls.get_rudder()); + FDMExec.GetFCS()->SetDrCmd( -1*controls.get_rudder()); FDMExec.GetFCS()->SetDfCmd( controls.get_flaps() ); FDMExec.GetFCS()->SetDsbCmd( 0.0 ); //speedbrakes FDMExec.GetFCS()->SetDspCmd( 0.0 ); //spoilers diff --git a/src/FDM/JSBSim.hxx b/src/FDM/JSBSim.hxx index 3933678c9..0091e4623 100644 --- a/src/FDM/JSBSim.hxx +++ b/src/FDM/JSBSim.hxx @@ -29,6 +29,7 @@ #include +#define ID_JSBSIMXX "$Header" class FGJSBsim: public FGInterface { diff --git a/src/FDM/LaRCsim.hxx b/src/FDM/LaRCsim.hxx index 97773f3c9..0be365291 100644 --- a/src/FDM/LaRCsim.hxx +++ b/src/FDM/LaRCsim.hxx @@ -33,7 +33,7 @@ class FGLaRCsim: public FGInterface { - FGEngine eng; + FGNewEngine eng; public: diff --git a/src/FDM/engine.cxx b/src/FDM/engine.cxx index a87b3aace..34619ef19 100644 --- a/src/FDM/engine.cxx +++ b/src/FDM/engine.cxx @@ -3,7 +3,7 @@ #include "IO360.hxx" int main() { - FGEngine e; + FGNewEngine e; e.init( 1.0 / 120.0 );