From: curt Date: Wed, 2 Apr 2003 03:45:08 +0000 (+0000) Subject: Fixed a remaining typo from the death and destruction earlier today. X-Git-Url: https://git.mxchange.org/?a=commitdiff_plain;h=b5f776186198a8ab6ffe87f707709028981cd46c;p=flightgear.git Fixed a remaining typo from the death and destruction earlier today. Added an option to avoid using non-existant rudder pedals if they truely non-exist. --- diff --git a/src/Network/atc610x.cxx b/src/Network/atc610x.cxx index 4c56b590b..d1ee97947 100644 --- a/src/Network/atc610x.cxx +++ b/src/Network/atc610x.cxx @@ -733,18 +733,22 @@ bool FGATC610x::do_analog_in() { fgSetFloat( "/controls/engines/engine[1]/throttle", tmp ); // cout << "throttle = " << tmp << endl; - // rudder - tmp = scale( rudder_center->getIntValue(), rudder_min->getIntValue(), - rudder_max->getIntValue(), analog_in_data[10] ); - fgSetFloat( "/controls/flight/rudder", -tmp ); - - // toe brakes - tmp = scale( brake_left_min->getIntValue(), brake_left_max->getIntValue(), - analog_in_data[20] ); - fgSetFloat( "/controls/gear/wheel[0]/brake", tmp ); - tmp = scale( brake_right_min->getIntValue(), brake_right_max->getIntValue(), - analog_in_data[21] ); - fgSetFloat( "/controls/gear/wheel[1]/brake", tmp ); + if ( use_rudder ) { + // rudder + tmp = scale( rudder_center->getIntValue(), rudder_min->getIntValue(), + rudder_max->getIntValue(), analog_in_data[10] ); + fgSetFloat( "/controls/flight/rudder", -tmp ); + + // toe brakes + tmp = scale( brake_left_min->getIntValue(), + brake_left_max->getIntValue(), + analog_in_data[20] ); + fgSetFloat( "/controls/gear/wheel[0]/brake", tmp ); + tmp = scale( brake_right_min->getIntValue(), + brake_right_max->getIntValue(), + analog_in_data[21] ); + fgSetFloat( "/controls/gear/wheel[1]/brake", tmp ); + } // nav1 volume tmp = (float)analog_in_data[25] / 1024.0f; @@ -1767,7 +1771,7 @@ bool FGATC610x::do_switches() { mag2 = mag1; mag1 = magnetos; if ( mag1 == mag2 && mag2 == mag3 ) { - fgSetInt( "/controls/engines/engine[0]/magneto", magnetos ); + fgSetInt( "/controls/engines/engine[0]/magnetos", magnetos ); } static bool start1, start2, start3; start3 = start2; diff --git a/src/Network/atc610x.hxx b/src/Network/atc610x.hxx index 7819660eb..beec6f88c 100644 --- a/src/Network/atc610x.hxx +++ b/src/Network/atc610x.hxx @@ -47,6 +47,8 @@ class FGATC610x : public FGProtocol { + bool use_rudder; + int board; int lock_fd; @@ -97,7 +99,7 @@ class FGATC610x : public FGProtocol { SGPropertyNode *xpdr_func_knob, *xpdr_id_code, *xpdr_flight_level; SGPropertyNode *xpdr_fl_ann, *xpdr_alt_ann, *xpdr_gnd_ann, *xpdr_on_ann; SGPropertyNode *xpdr_sby_ann, *xpdr_reply_ann; - SGPropertyNode *ati_bird, *alt_press; + SGPropertyNode *ati_bird, *alt_press; // Faults SGPropertyNode *comm1_servicable, *comm2_servicable; @@ -149,7 +151,7 @@ class FGATC610x : public FGProtocol { public: - FGATC610x() { } + FGATC610x() : use_rudder(true) { } ~FGATC610x() { } bool open(); @@ -158,6 +160,8 @@ public: bool process(); bool close(); + + inline void set_use_rudder( bool value ) { use_rudder = value; } };