1
0
Fork 0

Make separate left/right flap surface positions in the net_fdm.hxx

structure for future use.  Right now they are tied together.
This commit is contained in:
curt 2004-10-29 00:13:32 +00:00
parent e3c89b1d33
commit b82cc40c58
4 changed files with 44 additions and 12 deletions

View file

@ -1251,21 +1251,31 @@ bool FGATC610x::do_radio_switches() {
// ADF buttons
#define CURT_HARDWARE
fgSetInt( "/radios/kr-87/inputs/adf-btn",
(radio_switch_data[23] & 0x01) );
fgSetInt( "/radios/kr-87/inputs/bfo-btn",
(radio_switch_data[23] >> 1 & 0x01) );
#ifdef CURT_HARDWARE
fgSetInt( "/radios/kr-87/inputs/frq-btn",
!(radio_switch_data[23] >> 2 & 0x01) );
#else
fgSetInt( "/radios/kr-87/inputs/frq-btn",
(radio_switch_data[23] >> 2 & 0x01) );
#endif
#ifdef CURT_HARDWARE
fgSetInt( "/radios/kr-87/inputs/flt-et-btn",
!(radio_switch_data[23] >> 3 & 0x01) );
#else
fgSetInt( "/radios/kr-87/inputs/flt-et-btn",
(radio_switch_data[23] >> 3 & 0x01) );
#endif
#ifdef CURT_HARDWARE
fgSetInt( "/radios/kr-87/inputs/set-rst-btn",
!(radio_switch_data[23] >> 4 & 0x01) );
#else
fgSetInt( "/radios/kr-87/inputs/set-rst-btn",
(radio_switch_data[23] >> 4 & 0x01) );
#endif
fgSetInt( "/radios/kr-87/inputs/power-btn",
radio_switch_data[23] >> 5 & 0x01 );
/* cout << "adf = " << !(radio_switch_data[23] & 0x01)
@ -1767,6 +1777,18 @@ bool FGATC610x::do_switches() {
update_switch_matrix( board, switch_data, switch_matrix );
// master switches
#define CURT_HARDWARE
#ifdef CURT_HARDWARE
fgSetBool( "/controls/engines/engine[0]/master-bat",
switch_matrix[board][5][1] );
fgSetBool( "/controls/engines/engine[1]/master-bat",
switch_matrix[board][5][1] );
fgSetBool( "/controls/engines/engine[0]/master-alt",
switch_matrix[board][4][1] );
fgSetBool( "/controls/engines/engine[1]/master-alt",
switch_matrix[board][4][1] );
#else
fgSetBool( "/controls/engines/engine[0]/master-bat",
switch_matrix[board][4][1] );
fgSetBool( "/controls/engines/engine[1]/master-bat",
@ -1776,6 +1798,7 @@ bool FGATC610x::do_switches() {
switch_matrix[board][5][1] );
fgSetBool( "/controls/engines/engine[1]/master-alt",
switch_matrix[board][5][1] );
#endif
fgSetBool( "/controls/switches/master-avionics",
switch_matrix[board][0][3] );

View file

@ -205,7 +205,9 @@ void FGProps2NetFDM( FGNetFDM *net, bool net_byte_order ) {
net->elevator = node->getDoubleValue( "elevator-pos-norm" );
net->elevator_trim_tab
= node->getDoubleValue( "elevator-trim-tab-pos-norm" );
net->flaps = node->getDoubleValue( "flap-pos-norm" );
// FIXME: CLO 10/28/04 - This really should be separated out into 2 values
net->left_flap = node->getDoubleValue( "flap-pos-norm" );
net->right_flap = node->getDoubleValue( "flap-pos-norm" );
net->left_aileron = node->getDoubleValue( "left-aileron-pos-norm" );
net->right_aileron = node->getDoubleValue( "right-aileron-pos-norm" );
net->rudder = node->getDoubleValue( "rudder-pos-norm" );
@ -276,7 +278,8 @@ void FGProps2NetFDM( FGNetFDM *net, bool net_byte_order ) {
htonf(net->elevator);
htonf(net->elevator_trim_tab);
htonf(net->flaps);
htonf(net->left_flap);
htonf(net->right_flap);
htonf(net->left_aileron);
htonf(net->right_aileron);
htonf(net->rudder);
@ -353,7 +356,8 @@ void FGNetFDM2Props( FGNetFDM *net, bool net_byte_order ) {
htonf(net->elevator);
htonf(net->elevator_trim_tab);
htonf(net->flaps);
htonf(net->left_flap);
htonf(net->right_flap);
htonf(net->left_aileron);
htonf(net->right_aileron);
htonf(net->rudder);
@ -457,7 +461,10 @@ void FGNetFDM2Props( FGNetFDM *net, bool net_byte_order ) {
node->setDoubleValue("elevator-pos-norm", net->elevator);
node->setDoubleValue("elevator-trim-tab-pos-norm",
net->elevator_trim_tab);
node->setDoubleValue("flap-pos-norm", net->flaps);
// FIXME: CLO 10/28/04 - This really should be separated out
// into 2 values
node->setDoubleValue("flap-pos-norm", net->left_flap);
node->setDoubleValue("flap-pos-norm", net->right_flap);
node->setDoubleValue("left-aileron-pos-norm", net->left_aileron);
node->setDoubleValue("right-aileron-pos-norm", net->right_aileron);
node->setDoubleValue("rudder-pos-norm", net->rudder);

View file

@ -18,7 +18,7 @@
#include <time.h> // time_t
const int FG_NET_FDM_VERSION = 18;
const int FG_NET_FDM_VERSION = 19;
// Define a structure containing the top level flight dynamics model
@ -107,7 +107,8 @@ public:
// Control surface positions (normalized values)
float elevator;
float elevator_trim_tab;
float flaps;
float left_flap;
float right_flap;
float left_aileron;
float right_aileron;
float rudder;

View file

@ -299,7 +299,8 @@ static FGReplayData interpolate( double time, FGReplayData f1, FGReplayData f2 )
// Control surface positions (normalized values)
result.fdm.elevator = weight( fdm1.elevator, fdm2.elevator, ratio );
result.fdm.flaps = weight( fdm1.flaps, fdm2.flaps, ratio );
result.fdm.left_flap = weight( fdm1.left_flap, fdm2.left_flap, ratio );
result.fdm.right_flap = weight( fdm1.right_flap, fdm2.right_flap, ratio );
result.fdm.left_aileron
= weight( fdm1.left_aileron, fdm2.left_aileron, ratio );
result.fdm.right_aileron