Allow the external FDM to calculate slip/skid ball deflection and override
FlightGear's internal calculation.
This commit is contained in:
parent
4cf43a8e9f
commit
6e65814975
2 changed files with 20 additions and 8 deletions
|
@ -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_north = cur_fdm_state->get_uBody();
|
||||||
net->v_wind_body_east = cur_fdm_state->get_vBody();
|
net->v_wind_body_east = cur_fdm_state->get_vBody();
|
||||||
net->v_wind_body_down = cur_fdm_state->get_wBody();
|
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_X_pilot = cur_fdm_state->get_A_X_pilot();
|
||||||
net->A_Y_pilot = cur_fdm_state->get_A_Y_pilot();
|
net->A_Y_pilot = cur_fdm_state->get_A_Y_pilot();
|
||||||
net->A_Z_pilot = cur_fdm_state->get_A_Z_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
|
// Engine parameters
|
||||||
net->num_engines = FGNetFDM::FG_MAX_ENGINES;
|
net->num_engines = FGNetFDM::FG_MAX_ENGINES;
|
||||||
for ( i = 0; i < net->num_engines; ++i ) {
|
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_north);
|
||||||
htonf(net->v_wind_body_east);
|
htonf(net->v_wind_body_east);
|
||||||
htonf(net->v_wind_body_down);
|
htonf(net->v_wind_body_down);
|
||||||
htonf(net->stall_warning);
|
|
||||||
|
|
||||||
htonf(net->A_X_pilot);
|
htonf(net->A_X_pilot);
|
||||||
htonf(net->A_Y_pilot);
|
htonf(net->A_Y_pilot);
|
||||||
htonf(net->A_Z_pilot);
|
htonf(net->A_Z_pilot);
|
||||||
|
|
||||||
|
htonf(net->stall_warning);
|
||||||
|
htonf(net->slip_deg);
|
||||||
|
|
||||||
for ( i = 0; i < net->num_engines; ++i ) {
|
for ( i = 0; i < net->num_engines; ++i ) {
|
||||||
net->eng_state[i] = htonl(net->eng_state[i]);
|
net->eng_state[i] = htonl(net->eng_state[i]);
|
||||||
htonf(net->rpm[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_north);
|
||||||
htonf(net->v_wind_body_east);
|
htonf(net->v_wind_body_east);
|
||||||
htonf(net->v_wind_body_down);
|
htonf(net->v_wind_body_down);
|
||||||
htonf(net->stall_warning);
|
|
||||||
|
|
||||||
htonf(net->A_X_pilot);
|
htonf(net->A_X_pilot);
|
||||||
htonf(net->A_Y_pilot);
|
htonf(net->A_Y_pilot);
|
||||||
htonf(net->A_Z_pilot);
|
htonf(net->A_Z_pilot);
|
||||||
|
|
||||||
|
htonf(net->stall_warning);
|
||||||
|
htonf(net->slip_deg);
|
||||||
|
|
||||||
net->num_engines = htonl(net->num_engines);
|
net->num_engines = htonl(net->num_engines);
|
||||||
for ( i = 0; i < net->num_engines; ++i ) {
|
for ( i = 0; i < net->num_engines; ++i ) {
|
||||||
net->eng_state[i] = htonl(net->eng_state[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_east,
|
||||||
net->v_wind_body_down );
|
net->v_wind_body_down );
|
||||||
|
|
||||||
fgSetDouble( "/sim/alarms/stall-warning", net->stall_warning );
|
|
||||||
cur_fdm_state->_set_Accels_Pilot_Body( net->A_X_pilot,
|
cur_fdm_state->_set_Accels_Pilot_Body( net->A_X_pilot,
|
||||||
net->A_Y_pilot,
|
net->A_Y_pilot,
|
||||||
net->A_Z_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 ) {
|
for ( i = 0; i < net->num_engines; ++i ) {
|
||||||
SGPropertyNode *node = fgGetNode( "engines/engine", i, true );
|
SGPropertyNode *node = fgGetNode( "engines/engine", i, true );
|
||||||
|
|
||||||
|
|
|
@ -32,7 +32,7 @@
|
||||||
|
|
||||||
#include <time.h> // time_t
|
#include <time.h> // 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
|
// 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
|
float v_wind_body_down; // down/vertical velocity in local/body
|
||||||
// frame relative to local airmass, fps
|
// frame relative to local airmass, fps
|
||||||
|
|
||||||
// Stall
|
|
||||||
float stall_warning; // 0.0 - 1.0 indicating the amount of stall
|
|
||||||
|
|
||||||
// Accelerations
|
// Accelerations
|
||||||
float A_X_pilot; // X accel in body frame ft/sec^2
|
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_Y_pilot; // Y accel in body frame ft/sec^2
|
||||||
float A_Z_pilot; // Z 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
|
// Pressure
|
||||||
|
|
||||||
// Engine status
|
// Engine status
|
||||||
|
|
Loading…
Add table
Reference in a new issue