From: curt Date: Mon, 10 Nov 2003 22:02:38 +0000 (+0000) Subject: Allow the external FDM to calculate slip/skid ball deflection and override X-Git-Url: https://git.mxchange.org/?a=commitdiff_plain;h=6e6581497519fb7d70eca1ee917eb2dbf093d958;p=flightgear.git Allow the external FDM to calculate slip/skid ball deflection and override FlightGear's internal calculation. --- diff --git a/src/Network/native_fdm.cxx b/src/Network/native_fdm.cxx index 68133d4da..1380feea8 100644 --- a/src/Network/native_fdm.cxx +++ b/src/Network/native_fdm.cxx @@ -147,12 +147,15 @@ void FGProps2NetFDM( FGNetFDM *net, bool net_byte_order ) { net->v_wind_body_north = cur_fdm_state->get_uBody(); net->v_wind_body_east = cur_fdm_state->get_vBody(); net->v_wind_body_down = cur_fdm_state->get_wBody(); - net->stall_warning = fgGetDouble("/sim/alarms/stall-warning", 0.0); net->A_X_pilot = cur_fdm_state->get_A_X_pilot(); net->A_Y_pilot = cur_fdm_state->get_A_Y_pilot(); net->A_Z_pilot = cur_fdm_state->get_A_Z_pilot(); + net->stall_warning = fgGetDouble("/sim/alarms/stall-warning", 0.0); + net->slip_deg + = fgGetDouble("/instrumentation/slip-skid-ball/indicated-slip-skid"); + // Engine parameters net->num_engines = FGNetFDM::FG_MAX_ENGINES; for ( i = 0; i < net->num_engines; ++i ) { @@ -227,12 +230,14 @@ void FGProps2NetFDM( FGNetFDM *net, bool net_byte_order ) { htonf(net->v_wind_body_north); htonf(net->v_wind_body_east); htonf(net->v_wind_body_down); - htonf(net->stall_warning); htonf(net->A_X_pilot); htonf(net->A_Y_pilot); htonf(net->A_Z_pilot); + htonf(net->stall_warning); + htonf(net->slip_deg); + for ( i = 0; i < net->num_engines; ++i ) { net->eng_state[i] = htonl(net->eng_state[i]); htonf(net->rpm[i]); @@ -297,12 +302,14 @@ void FGNetFDM2Props( FGNetFDM *net, bool net_byte_order ) { htonf(net->v_wind_body_north); htonf(net->v_wind_body_east); htonf(net->v_wind_body_down); - htonf(net->stall_warning); htonf(net->A_X_pilot); htonf(net->A_Y_pilot); htonf(net->A_Z_pilot); + htonf(net->stall_warning); + htonf(net->slip_deg); + net->num_engines = htonl(net->num_engines); for ( i = 0; i < net->num_engines; ++i ) { net->eng_state[i] = htonl(net->eng_state[i]); @@ -369,11 +376,15 @@ void FGNetFDM2Props( FGNetFDM *net, bool net_byte_order ) { net->v_wind_body_east, net->v_wind_body_down ); - fgSetDouble( "/sim/alarms/stall-warning", net->stall_warning ); cur_fdm_state->_set_Accels_Pilot_Body( net->A_X_pilot, net->A_Y_pilot, net->A_Z_pilot ); + fgSetDouble( "/sim/alarms/stall-warning", net->stall_warning ); + fgSetDouble( "/instrumentation/slip-skid-ball/indicated-slip-skid", + net->slip_deg ); + fgSetBool( "/instrumentation/slip-skid-ball/override", true ); + for ( i = 0; i < net->num_engines; ++i ) { SGPropertyNode *node = fgGetNode( "engines/engine", i, true ); diff --git a/src/Network/net_fdm.hxx b/src/Network/net_fdm.hxx index eed2c8438..29a7c8555 100644 --- a/src/Network/net_fdm.hxx +++ b/src/Network/net_fdm.hxx @@ -32,7 +32,7 @@ #include // time_t -const int FG_NET_FDM_VERSION = 13; +const int FG_NET_FDM_VERSION = 14; // Define a structure containing the top level flight dynamics model @@ -79,14 +79,15 @@ public: float v_wind_body_down; // down/vertical velocity in local/body // frame relative to local airmass, fps - // Stall - float stall_warning; // 0.0 - 1.0 indicating the amount of stall - // Accelerations float A_X_pilot; // X accel in body frame ft/sec^2 float A_Y_pilot; // Y accel in body frame ft/sec^2 float A_Z_pilot; // Z accel in body frame ft/sec^2 + // Stall + float stall_warning; // 0.0 - 1.0 indicating the amount of stall + float slip_deg; // slip ball deflection + // Pressure // Engine status