Added a per-engine fuel pump switch.
This commit is contained in:
parent
02d1d81348
commit
f26e8e5af0
2 changed files with 25 additions and 0 deletions
|
@ -78,6 +78,7 @@ void FGControls::reset_all()
|
||||||
set_throttle( ALL_ENGINES, 0.0 );
|
set_throttle( ALL_ENGINES, 0.0 );
|
||||||
set_starter( ALL_ENGINES, false );
|
set_starter( ALL_ENGINES, false );
|
||||||
set_magnetos( ALL_ENGINES, 0 );
|
set_magnetos( ALL_ENGINES, 0 );
|
||||||
|
set_fuel_pump( ALL_ENGINES, false );
|
||||||
throttle_idle = true;
|
throttle_idle = true;
|
||||||
set_fuel_selector( ALL_TANKS, true );
|
set_fuel_selector( ALL_TANKS, true );
|
||||||
gear_down = true;
|
gear_down = true;
|
||||||
|
@ -95,6 +96,7 @@ FGControls::init ()
|
||||||
for ( int engine = 0; engine < MAX_ENGINES; engine++ ) {
|
for ( int engine = 0; engine < MAX_ENGINES; engine++ ) {
|
||||||
throttle[engine] = 0.0;
|
throttle[engine] = 0.0;
|
||||||
mixture[engine] = 1.0;
|
mixture[engine] = 1.0;
|
||||||
|
fuel_pump[engine] = false;
|
||||||
prop_advance[engine] = 1.0;
|
prop_advance[engine] = 1.0;
|
||||||
magnetos[engine] = 0;
|
magnetos[engine] = 0;
|
||||||
starter[engine] = false;
|
starter[engine] = false;
|
||||||
|
@ -143,6 +145,10 @@ FGControls::bind ()
|
||||||
fgTie(name, this, index,
|
fgTie(name, this, index,
|
||||||
&FGControls::get_mixture, &FGControls::set_mixture);
|
&FGControls::get_mixture, &FGControls::set_mixture);
|
||||||
fgSetArchivable(name);
|
fgSetArchivable(name);
|
||||||
|
sprintf(name, "/controls/fuel-pump[%d]", index);
|
||||||
|
fgTie(name, this, index,
|
||||||
|
&FGControls::get_fuel_pump, &FGControls::set_fuel_pump);
|
||||||
|
fgSetArchivable(name);
|
||||||
sprintf(name, "/controls/propeller-pitch[%d]", index);
|
sprintf(name, "/controls/propeller-pitch[%d]", index);
|
||||||
fgTie(name, this, index,
|
fgTie(name, this, index,
|
||||||
&FGControls::get_prop_advance, &FGControls::set_prop_advance);
|
&FGControls::get_prop_advance, &FGControls::set_prop_advance);
|
||||||
|
@ -197,6 +203,8 @@ FGControls::unbind ()
|
||||||
fgUntie(name);
|
fgUntie(name);
|
||||||
sprintf(name, "/controls/mixture[%d]", index);
|
sprintf(name, "/controls/mixture[%d]", index);
|
||||||
fgUntie(name);
|
fgUntie(name);
|
||||||
|
sprintf(name, "/controls/fuel-pump[%d]", index);
|
||||||
|
fgUntie(name);
|
||||||
sprintf(name, "/controls/propeller-pitch[%d]", index);
|
sprintf(name, "/controls/propeller-pitch[%d]", index);
|
||||||
fgUntie(name);
|
fgUntie(name);
|
||||||
sprintf(name, "/controls/magnetos[%d]", index);
|
sprintf(name, "/controls/magnetos[%d]", index);
|
||||||
|
@ -397,6 +405,20 @@ FGControls::move_mixture( int engine, double amt )
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void
|
||||||
|
FGControls::set_fuel_pump( int engine, bool val )
|
||||||
|
{
|
||||||
|
if ( engine == ALL_ENGINES ) {
|
||||||
|
for ( int i = 0; i < MAX_ENGINES; i++ ) {
|
||||||
|
fuel_pump[i] = val;
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
if ( (engine >= 0) && (engine < MAX_ENGINES) ) {
|
||||||
|
fuel_pump[engine] = val;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
FGControls::set_prop_advance( int engine, double pos )
|
FGControls::set_prop_advance( int engine, double pos )
|
||||||
{
|
{
|
||||||
|
|
|
@ -67,6 +67,7 @@ private:
|
||||||
double flaps;
|
double flaps;
|
||||||
double throttle[MAX_ENGINES];
|
double throttle[MAX_ENGINES];
|
||||||
double mixture[MAX_ENGINES];
|
double mixture[MAX_ENGINES];
|
||||||
|
bool fuel_pump[MAX_ENGINES];
|
||||||
double prop_advance[MAX_ENGINES];
|
double prop_advance[MAX_ENGINES];
|
||||||
double parking_brake;
|
double parking_brake;
|
||||||
double brake[MAX_WHEELS];
|
double brake[MAX_WHEELS];
|
||||||
|
@ -102,6 +103,7 @@ public:
|
||||||
inline double get_flaps() const { return flaps; }
|
inline double get_flaps() const { return flaps; }
|
||||||
inline double get_throttle(int engine) const { return throttle[engine]; }
|
inline double get_throttle(int engine) const { return throttle[engine]; }
|
||||||
inline double get_mixture(int engine) const { return mixture[engine]; }
|
inline double get_mixture(int engine) const { return mixture[engine]; }
|
||||||
|
inline bool get_fuel_pump(int engine) const { return fuel_pump[engine]; }
|
||||||
inline double get_prop_advance(int engine) const {
|
inline double get_prop_advance(int engine) const {
|
||||||
return prop_advance[engine];
|
return prop_advance[engine];
|
||||||
}
|
}
|
||||||
|
@ -133,6 +135,7 @@ public:
|
||||||
void move_throttle( int engine, double amt );
|
void move_throttle( int engine, double amt );
|
||||||
void set_mixture( int engine, double pos );
|
void set_mixture( int engine, double pos );
|
||||||
void move_mixture( int engine, double amt );
|
void move_mixture( int engine, double amt );
|
||||||
|
void set_fuel_pump( int engine, bool val );
|
||||||
void set_prop_advance( int engine, double pos );
|
void set_prop_advance( int engine, double pos );
|
||||||
void move_prop_advance( int engine, double amt );
|
void move_prop_advance( int engine, double amt );
|
||||||
void set_magnetos( int engine, int pos );
|
void set_magnetos( int engine, int pos );
|
||||||
|
|
Loading…
Add table
Reference in a new issue