From 74fc1387a9a11d2ca94585f169e8d8c1d697e393 Mon Sep 17 00:00:00 2001 From: curt Date: Fri, 5 Oct 2001 20:27:33 +0000 Subject: [PATCH] Begin wiring Dave Luff's engine model into JSBSim. --- src/FDM/JSBSim.cxx | 12 ++++++++++-- src/FDM/LaRCsim.cxx | 5 +++-- src/FDM/flight.hxx | 3 +++ 3 files changed, 16 insertions(+), 4 deletions(-) diff --git a/src/FDM/JSBSim.cxx b/src/FDM/JSBSim.cxx index 406ce3a42..4ec1faf70 100644 --- a/src/FDM/JSBSim.cxx +++ b/src/FDM/JSBSim.cxx @@ -246,8 +246,15 @@ bool FGJSBsim::update( int multiloop ) { } for( i=0; iset_RPM( Propulsion->GetThruster(i)->GetRPM() ); - get_engine(i)->set_Throttle( globals->get_controls()->get_throttle(i) ); + FGEngInterface * e = get_engine(i); + FGEngine * eng = Propulsion->GetEngine(i); + FGThruster * thrust = Propulsion->GetThruster(i); + e->set_Manifold_Pressure( eng->getManifoldPressure_inHg() ); + e->set_RPM( thrust->GetRPM() ); + e->set_EGT( eng->getExhaustGasTemp_degF() ); + e->set_CHT( eng->getCylinderHeadTemp_degF() ); + e->set_Oil_Temp( eng->getOilTemp_degF() ); + e->set_Throttle( globals->get_controls()->get_throttle(i) ); } for ( i=0; i < multiloop; i++ ) { @@ -283,6 +290,7 @@ bool FGJSBsim::copy_to_JSBsim() { FCS->SetCBrake( globals->get_controls()->get_brake( 2 ) ); for (int i = 0; i < get_num_engines(); i++) { FCS->SetThrottleCmd(i, globals->get_controls()->get_throttle(i)); + FCS->SetMixtureCmd(i, globals->get_controls()->get_mixture(i)); } Position->SetSeaLevelRadius( get_Sea_level_radius() ); diff --git a/src/FDM/LaRCsim.cxx b/src/FDM/LaRCsim.cxx index 07ebb0ea5..a61bc1c61 100644 --- a/src/FDM/LaRCsim.cxx +++ b/src/FDM/LaRCsim.cxx @@ -74,8 +74,8 @@ FGLaRCsim::FGLaRCsim( double dt ) { // Hardwired to C172 full tanks for now - need to fix this sometime // Also note that this is the max quantity - the usable quantity // is slightly less - set_Tank1Fuel(28.0); - set_Tank2Fuel(28.0); + set_Tank1Fuel(14.0); + set_Tank2Fuel(14.0); } @@ -128,6 +128,7 @@ bool FGLaRCsim::update( int multiloop ) { e->set_CHT( eng.get_CHT() ); e->set_prop_thrust( eng.get_prop_thrust_SI() ); e->set_Fuel_Flow( eng.get_fuel_flow_gals_hr() ); + e->set_Oil_Temp( eng.get_oil_temp() ); //Assume we are using both tanks equally for now reduce_Tank1Fuel( (eng.get_fuel_flow_gals_hr() / (2 * 3600)) diff --git a/src/FDM/flight.hxx b/src/FDM/flight.hxx index 35e9c2c9d..fd1a24efd 100644 --- a/src/FDM/flight.hxx +++ b/src/FDM/flight.hxx @@ -120,6 +120,7 @@ private: double CHT; //deg F double prop_thrust; //lbs double Fuel_Flow; //Gals/hr + double Oil_Temp; //deg F /* others... double PercentN1,N1; //GE,CFM @@ -147,6 +148,7 @@ public: inline double get_CHT() const { return CHT; } inline double get_prop_thrust() const { return prop_thrust; } inline double get_Fuel_Flow() const { return Fuel_Flow; } + inline double get_Oil_Temp() const { return Oil_Temp; } inline void set_Throttle( double t ) { Throttle = t; } inline void set_Mixture( double m ) { Mixture = m; } @@ -159,6 +161,7 @@ public: inline void set_CHT( double c ) { CHT = c; } inline void set_prop_thrust( double t ) { prop_thrust = t; } inline void set_Fuel_Flow( double f ) { Fuel_Flow = f; } + inline void set_Oil_Temp (double o) { Oil_Temp = o; } };