drag_chute( false ),
throttle_idle( true ),
dump_valve( false ),
- parking_brake( 0.0 ),
+ brake_left( 0.0 ),
+ brake_right( 0.0 ),
+ brake_parking( 0.0 ),
steering( 0.0 ),
gear_down( true ),
antiskid( true ),
APU_bleed( false ),
mode( 0 ),
dump( false ),
+ outflow_valve( 0.0 ),
taxi_light( false ),
logo_lights( false ),
nav_lights( false ),
release_ALL( false ),
vertical_adjust( 0.0 ),
fore_aft_adjust( 0.0 ),
- eject( false ),
off_start_run( 0 ),
APU_fire_switch( false ),
autothrottle_arm( false ),
landing_lights = false;
turn_off_lights = false;
master_arm = false;
- eject = false;
+ set_ejection_seat( ALL_EJECTION_SEATS, false );
+ set_eseat_status( ALL_EJECTION_SEATS, SEAT_SAFED );
+ set_cmd_selector_valve( CMD_SEL_NORM );
APU_fire_switch = false;
autothrottle_arm = false;
autothrottle_engage = false;
reverser[engine] = false;
water_injection[engine] = false;
nitrous_injection[engine] = false;
+ cowl_flaps_norm[engine] = 0.0;
condition[engine] = 0;
}
+ brake_left = brake_right = brake_parking = 0.0;
for ( int wheel = 0; wheel < MAX_WHEELS; wheel++ ) {
- brake[wheel] = 0.0;
alternate_extension[wheel] = false;
}
}
// gear
- fgTie("/controls/gear/parking-brake", this,
- &FGControls::get_parking_brake,
- &FGControls::set_parking_brake);
- fgSetArchivable("/controls/gear/parking-brake");
+ fgTie("/controls/gear/brake-left", this,
+ &FGControls::get_brake_left,
+ &FGControls::set_brake_left);
+ fgSetArchivable("/controls/gear/brake-left");
+
+ fgTie("/controls/gear/brake-right", this,
+ &FGControls::get_brake_right,
+ &FGControls::set_brake_right);
+ fgSetArchivable("/controls/gear/brake-right");
+
+ fgTie("/controls/gear/brake-parking", this,
+ &FGControls::get_brake_parking,
+ &FGControls::set_brake_parking);
+ fgSetArchivable("/controls/gear/brake-parking");
fgTie("/controls/gear/steering", this,
&FGControls::get_steering, &FGControls::set_steering);
for (index = 0; index < MAX_WHEELS; index++) {
char name[MAX_NAME_LEN];
- snprintf(name, MAX_NAME_LEN, "/controls/gear/wheel[%d]/brake", index);
- fgTie(name, this, index,
- &FGControls::get_brake, &FGControls::set_brake);
- fgSetArchivable(name);
-
snprintf(name, MAX_NAME_LEN,
"/controls/gear/wheel[%d]/alternate-extension", index);
fgTie(name, this, index,
&FGControls::set_fore_aft_adjust);
fgSetArchivable("/controls/seat/fore-aft-adjust");
- fgTie("/controls/seat/eject", this,
- &FGControls::get_eject, &FGControls::set_eject);
- fgSetArchivable("/controls/seat/eject");
+ for (index = 0; index < MAX_EJECTION_SEATS; index++) {
+ char name[MAX_NAME_LEN];
+ snprintf(name, MAX_NAME_LEN,
+ "/controls/seat/eject[%d]/initiate", index);
+ fgTie(name, this, index,
+ &FGControls::get_ejection_seat,
+ &FGControls::set_ejection_seat);
+ fgSetArchivable(name);
+
+ snprintf(name, MAX_NAME_LEN,
+ "/controls/seat/eject[%d]/status", index);
+
+ fgTie(name, this, index,
+ &FGControls::get_eseat_status,
+ &FGControls::set_eseat_status);
+
+ fgSetArchivable(name);
+ }
+
+ fgTie("/controls/seat/cmd_selector_valve", this,
+ &FGControls::get_cmd_selector_valve,
+ &FGControls::set_cmd_selector_valve);
+ fgSetArchivable("/controls/seat/eject/cmd_selector_valve");
+
// APU
fgTie("/controls/APU/off-start-run", this,
fgUntie(name);
}
}
- fgUntie("/controls/gear/parking_brake");
+ fgUntie("/controls/gear/brake-left");
+ fgUntie("/controls/gear/brake-right");
+ fgUntie("/controls/gear/brake-parking");
fgUntie("/controls/gear/steering");
fgUntie("/controls/gear/gear_down");
fgUntie("/controls/gear/antiskid");
fgUntie("/controls/gear/tailwheel-lock");
for (index = 0; index < MAX_WHEELS; index++) {
char name[MAX_NAME_LEN];
- snprintf(name, MAX_NAME_LEN, "/controls/gear/wheel[%d]/brakes", index);
- fgUntie(name);
snprintf(name, MAX_NAME_LEN,
"/controls/gear/wheel[%d]/alternate-extension", index);
fgUntie(name);
#endif
fgUntie("/controls/seat/vertical-adjust");
fgUntie("/controls/seat/fore-aft-adjust");
- fgUntie("/controls/seat/eject");
+ for (index = 0; index < MAX_EJECTION_SEATS; index++) {
+ char name[MAX_NAME_LEN];
+ snprintf(name, MAX_NAME_LEN,
+ "/controls/seat/eject[%d]/initiate", index);
+ fgUntie(name);
+ snprintf(name, MAX_NAME_LEN,
+ "/controls/seat/eject[%d]/status", index);
+ fgUntie(name);
+ }
+ fgUntie("/controls/seat/cmd_selector_valve");
+
fgUntie("/controls/APU/off-start-run");
fgUntie("/controls/APU/fire-switch");
for (index = 0; index < MAX_AUTOPILOTS; index++) {
void
-FGControls::set_parking_brake( double pos )
+FGControls::set_brake_left( double pos )
+{
+ brake_left = pos;
+ CLAMP(&brake_left, 0.0, 1.0);
+}
+
+void
+FGControls::move_brake_left( double amt )
{
- parking_brake = pos;
- CLAMP(&parking_brake, 0.0, 1.0);
+ brake_left += amt;
+ CLAMP( &brake_left, 0.0, 1.0 );
+}
+
+void
+FGControls::set_brake_right( double pos )
+{
+ brake_right = pos;
+ CLAMP(&brake_right, 0.0, 1.0);
+}
+
+void
+FGControls::move_brake_right( double amt )
+{
+ brake_right += amt;
+ CLAMP( &brake_right, 0.0, 1.0 );
+}
+
+void
+FGControls::set_brake_parking( double pos )
+{
+ brake_parking = pos;
+ CLAMP(&brake_parking, 0.0, 1.0);
}
void
}
-void
-FGControls::set_brake( int wheel, double pos )
-{
- if ( wheel == ALL_WHEELS ) {
- for ( int i = 0; i < MAX_WHEELS; i++ ) {
- brake[i] = pos;
- CLAMP( &brake[i], 0.0, 1.0 );
- }
- } else {
- if ( (wheel >= 0) && (wheel < MAX_WHEELS) ) {
- brake[wheel] = pos;
- CLAMP( &brake[wheel], 0.0, 1.0 );
- }
- }
-}
-
-void
-FGControls::move_brake( int wheel, double amt )
-{
- if ( wheel == ALL_WHEELS ) {
- for ( int i = 0; i < MAX_WHEELS; i++ ) {
- brake[i] += amt;
- CLAMP( &brake[i], 0.0, 1.0 );
- }
- } else {
- if ( (wheel >= 0) && (wheel < MAX_WHEELS) ) {
- brake[wheel] += amt;
- CLAMP( &brake[wheel], 0.0, 1.0 );
- }
- }
-}
-
void
FGControls::set_alternate_extension( int wheel, bool val )
{
}
void
-FGControls::set_eject( bool val )
+FGControls::set_ejection_seat( int which_seat, bool val )
{
- eject = val;
+ if ( which_seat == ALL_EJECTION_SEATS ) {
+ for ( int i = 0; i < MAX_EJECTION_SEATS; i++ ) {
+ eject[i] = val;
+ }
+ } else {
+ if ( (which_seat >= 0) && (which_seat <= MAX_EJECTION_SEATS) ) {
+ if ( eseat_status[which_seat] == SEAT_SAFED ||
+ eseat_status[which_seat] == SEAT_FAIL )
+ {
+ // we can never eject if SEAT_SAFED or SEAT_FAIL
+ val = false;
+ }
+
+ eject[which_seat] = val;
+ }
+ }
}
+void
+FGControls::set_eseat_status( int which_seat, int val )
+{
+ if ( which_seat == ALL_EJECTION_SEATS ) {
+ for ( int i = 0; i < MAX_EJECTION_SEATS; i++ ) {
+ eseat_status[i] = val;
+ }
+ } else {
+ if ( (which_seat >=0) && (which_seat <= MAX_EJECTION_SEATS) ) {
+ eseat_status[which_seat] = val;
+ }
+ }
+}
+
+void
+FGControls::set_cmd_selector_valve( int val )
+{
+ cmd_selector_valve = val;
+}
+
+
void
FGControls::set_off_start_run( int pos )
{