From 750fcc7a862b3ed7006cafd627af0b903a275ee8 Mon Sep 17 00:00:00 2001 From: curt Date: Sun, 21 Jul 2002 15:40:20 +0000 Subject: [PATCH] Support for fuel selector switch. --- src/Network/atc610x.cxx | 34 ++++++++++++++++++---------------- 1 file changed, 18 insertions(+), 16 deletions(-) diff --git a/src/Network/atc610x.cxx b/src/Network/atc610x.cxx index fca8ca3cd..aee6995a3 100644 --- a/src/Network/atc610x.cxx +++ b/src/Network/atc610x.cxx @@ -479,10 +479,12 @@ bool FGATC610x::do_analog_in() { // mixture tmp = (float)analog_in_data[7] / 680.0f; fgSetFloat( "/controls/mixture[0]", tmp ); + fgSetFloat( "/controls/mixture[1]", tmp ); // throttle tmp = (float)analog_in_data[8] / 690.0f; fgSetFloat( "/controls/throttle[0]", tmp ); + fgSetFloat( "/controls/throttle[1]", tmp ); // nav1 volume tmp = (float)analog_in_data[25] / 1024.0f; @@ -1360,13 +1362,13 @@ bool FGATC610x::do_switches() { // flaps float flaps = 0.0; - if ( switch_matrix[board][6][3] == 1 ) { + if ( switch_matrix[board][6][3] ) { flaps = 1.0; - } else if ( switch_matrix[board][5][3] == 1 ) { + } else if ( switch_matrix[board][5][3] ) { flaps = 2.0 / 3.0; - } else if ( switch_matrix[board][4][3] == 1 ) { + } else if ( switch_matrix[board][4][3] ) { flaps = 1.0 / 3.0; - } else if ( switch_matrix[board][4][3] == 0 ) { + } else if ( !switch_matrix[board][4][3] ) { flaps = 0.0; } @@ -1380,23 +1382,23 @@ bool FGATC610x::do_switches() { fgSetFloat( "/controls/flaps", flaps ); } - // fuel selector (not finished) - if ( true ) { + // fuel selector + if ( switch_matrix[board][2][3] ) { // both - fgSetFloat( "/controls/fuel-selector[0]", true ); - fgSetFloat( "/controls/fuel-selector[1]", true ); - } else if ( true ) { + fgSetBool( "/controls/fuel-selector[0]", true ); + fgSetBool( "/controls/fuel-selector[1]", true ); + } else if ( switch_matrix[board][1][3] ) { // left - fgSetFloat( "/controls/fuel-selector[0]", true ); - fgSetFloat( "/controls/fuel-selector[1]", false ); - } else if ( true ) { + fgSetBool( "/controls/fuel-selector[0]", true ); + fgSetBool( "/controls/fuel-selector[1]", false ); + } else if ( switch_matrix[board][3][3] ) { // right - fgSetFloat( "/controls/fuel-selector[0]", false ); - fgSetFloat( "/controls/fuel-selector[1]", true ); + fgSetBool( "/controls/fuel-selector[0]", false ); + fgSetBool( "/controls/fuel-selector[1]", true ); } else { // fuel cutoff - fgSetFloat( "/controls/fuel-selector[0]", false ); - fgSetFloat( "/controls/fuel-selector[1]", false ); + fgSetBool( "/controls/fuel-selector[0]", false ); + fgSetBool( "/controls/fuel-selector[1]", false ); } return true;