Change condition lever position from an "int" to a "double".
This commit is contained in:
parent
99a7850cc7
commit
e5f0163ce0
2 changed files with 10 additions and 10 deletions
|
@ -148,7 +148,7 @@ void FGControls::reset_all()
|
||||||
set_augmentation( ALL_ENGINES, false );
|
set_augmentation( ALL_ENGINES, false );
|
||||||
set_reverser( ALL_ENGINES, false );
|
set_reverser( ALL_ENGINES, false );
|
||||||
set_water_injection( ALL_ENGINES, false );
|
set_water_injection( ALL_ENGINES, false );
|
||||||
set_condition( ALL_ENGINES, 0 );
|
set_condition( ALL_ENGINES, 1.0 );
|
||||||
throttle_idle = true;
|
throttle_idle = true;
|
||||||
set_fuel_selector( ALL_TANKS, true );
|
set_fuel_selector( ALL_TANKS, true );
|
||||||
dump_valve = false;
|
dump_valve = false;
|
||||||
|
@ -201,7 +201,7 @@ FGControls::init ()
|
||||||
water_injection[engine] = false;
|
water_injection[engine] = false;
|
||||||
nitrous_injection[engine] = false;
|
nitrous_injection[engine] = false;
|
||||||
cowl_flaps_norm[engine] = 0.0;
|
cowl_flaps_norm[engine] = 0.0;
|
||||||
condition[engine] = 0;
|
condition[engine] = 1.0;
|
||||||
}
|
}
|
||||||
|
|
||||||
brake_left = brake_right = brake_parking = 0.0;
|
brake_left = brake_right = brake_parking = 0.0;
|
||||||
|
@ -348,7 +348,8 @@ FGControls::bind ()
|
||||||
&FGControls::set_cowl_flaps_norm);
|
&FGControls::set_cowl_flaps_norm);
|
||||||
fgSetArchivable(name);
|
fgSetArchivable(name);
|
||||||
|
|
||||||
snprintf(name, MAX_NAME_LEN, "/controls/engines/engine[%d]/feather", index);
|
snprintf(name, MAX_NAME_LEN,
|
||||||
|
"/controls/engines/engine[%d]/propeller-feather", index);
|
||||||
fgTie(name, this, index,
|
fgTie(name, this, index,
|
||||||
&FGControls::get_feather, &FGControls::set_feather);
|
&FGControls::get_feather, &FGControls::set_feather);
|
||||||
fgSetArchivable(name);
|
fgSetArchivable(name);
|
||||||
|
@ -841,7 +842,8 @@ void FGControls::unbind ()
|
||||||
snprintf(name, MAX_NAME_LEN,
|
snprintf(name, MAX_NAME_LEN,
|
||||||
"/controls/engines/engine[%d]/cowl-flaps-norm", index);
|
"/controls/engines/engine[%d]/cowl-flaps-norm", index);
|
||||||
fgUntie(name);
|
fgUntie(name);
|
||||||
snprintf(name, MAX_NAME_LEN, "/controls/engines/engine[%d]/feather", index);
|
snprintf(name, MAX_NAME_LEN,
|
||||||
|
"/controls/engines/engine[%d]/propeller-feather", index);
|
||||||
fgUntie(name);
|
fgUntie(name);
|
||||||
snprintf(name, MAX_NAME_LEN,
|
snprintf(name, MAX_NAME_LEN,
|
||||||
"/controls/engines/engine[%d]/ignition", index);
|
"/controls/engines/engine[%d]/ignition", index);
|
||||||
|
@ -1521,17 +1523,15 @@ FGControls::set_water_injection( int engine, bool val )
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
FGControls::set_condition( int engine, int val )
|
FGControls::set_condition( int engine, double val )
|
||||||
{
|
{
|
||||||
if ( engine == ALL_ENGINES ) {
|
if ( engine == ALL_ENGINES ) {
|
||||||
for ( int i = 0; i < MAX_ENGINES; i++ ) {
|
for ( int i = 0; i < MAX_ENGINES; i++ ) {
|
||||||
condition[i] = val;
|
condition[i] = val;
|
||||||
CLAMP( &condition[i], 0, 3 );
|
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
if ( (engine >= 0) && (engine < MAX_ENGINES) ) {
|
if ( (engine >= 0) && (engine < MAX_ENGINES) ) {
|
||||||
condition[engine] = val;
|
condition[engine] = val;
|
||||||
CLAMP( &condition[engine], 0, 3 );
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -140,7 +140,7 @@ private:
|
||||||
bool augmentation[MAX_ENGINES];
|
bool augmentation[MAX_ENGINES];
|
||||||
bool reverser[MAX_ENGINES];
|
bool reverser[MAX_ENGINES];
|
||||||
bool water_injection[MAX_ENGINES];
|
bool water_injection[MAX_ENGINES];
|
||||||
int condition[MAX_ENGINES]; // turboprop speed select
|
double condition[MAX_ENGINES]; // turboprop speed select
|
||||||
|
|
||||||
// controls/fuel/
|
// controls/fuel/
|
||||||
bool dump_valve;
|
bool dump_valve;
|
||||||
|
@ -316,7 +316,7 @@ public:
|
||||||
inline bool get_water_injection(int engine) const {
|
inline bool get_water_injection(int engine) const {
|
||||||
return water_injection[engine];
|
return water_injection[engine];
|
||||||
}
|
}
|
||||||
inline int get_condition(int engine) const { return condition[engine]; }
|
inline double get_condition(int engine) const { return condition[engine]; }
|
||||||
|
|
||||||
// controls/fuel/
|
// controls/fuel/
|
||||||
inline bool get_dump_valve() const { return dump_valve; }
|
inline bool get_dump_valve() const { return dump_valve; }
|
||||||
|
@ -501,7 +501,7 @@ public:
|
||||||
void set_augmentation( int engine, bool val );
|
void set_augmentation( int engine, bool val );
|
||||||
void set_reverser( int engine, bool val );
|
void set_reverser( int engine, bool val );
|
||||||
void set_water_injection( int engine, bool val );
|
void set_water_injection( int engine, bool val );
|
||||||
void set_condition( int engine, int val );
|
void set_condition( int engine, double val );
|
||||||
|
|
||||||
// controls/fuel
|
// controls/fuel
|
||||||
void set_dump_valve( bool val );
|
void set_dump_valve( bool val );
|
||||||
|
|
Loading…
Add table
Reference in a new issue