1
0
Fork 0

Begin wiring Dave Luff's engine model into JSBSim.

This commit is contained in:
curt 2001-10-05 20:27:33 +00:00
parent 07f5955f8c
commit 74fc1387a9
3 changed files with 16 additions and 4 deletions

View file

@ -246,8 +246,15 @@ bool FGJSBsim::update( int multiloop ) {
}
for( i=0; i<get_num_engines(); i++ ) {
get_engine(i)->set_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() );

View file

@ -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))

View file

@ -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; }
};