From 9bff823e0af78a8b509072b2186fbd32241120c8 Mon Sep 17 00:00:00 2001 From: curt Date: Mon, 13 Jan 2003 00:27:50 +0000 Subject: [PATCH] Added velocity and climb_rate to mini_fdm structure. --- src/Main/options.cxx | 2 +- src/Network/mini_fdm.cxx | 11 +++++++++++ src/Network/net_fdm_mini.hxx | 4 ++++ 3 files changed, 16 insertions(+), 1 deletion(-) diff --git a/src/Main/options.cxx b/src/Main/options.cxx index abe3acb61..dc55328d3 100644 --- a/src/Main/options.cxx +++ b/src/Main/options.cxx @@ -916,7 +916,7 @@ parse_option (const string& arg) } else if ( arg.find( "--native-fdm=" ) == 0 ) { add_channel( "native_fdm", arg.substr(13) ); } else if ( arg.find( "--mini-fdm=" ) == 0 ) { - add_channel( "mini_fdm", arg.substr(13) ); + add_channel( "mini_fdm", arg.substr(11) ); } else if ( arg.find( "--opengc=" ) == 0 ) { // char stop; // cout << "Adding channel for OpenGC Display" << endl; cin >> stop; diff --git a/src/Network/mini_fdm.cxx b/src/Network/mini_fdm.cxx index f5b7ef229..80bb4c4b8 100644 --- a/src/Network/mini_fdm.cxx +++ b/src/Network/mini_fdm.cxx @@ -114,6 +114,10 @@ void FGProps2NetMiniFDM( FGNetMiniFDM *net ) { net->theta = cur_fdm_state->get_Theta(); net->psi = cur_fdm_state->get_Psi(); + // Velocities + net->vcas = cur_fdm_state->get_V_calibrated_kts(); + net->climb_rate = cur_fdm_state->get_Climb_Rate(); + // Consumables net->num_tanks = FGNetMiniFDM::FG_MAX_TANKS; for ( i = 0; i < net->num_tanks; ++i ) { @@ -134,6 +138,8 @@ void FGProps2NetMiniFDM( FGNetMiniFDM *net ) { htond(net->phi); htond(net->theta); htond(net->psi); + htond(net->vcas); + htond(net->climb_rate); for ( i = 0; i < net->num_tanks; ++i ) { htond(net->fuel_quantity[i]); @@ -157,6 +163,8 @@ void FGNetMiniFDM2Props( FGNetMiniFDM *net ) { htond(net->phi); htond(net->theta); htond(net->psi); + htond(net->vcas); + htond(net->climb_rate); net->num_tanks = htonl(net->num_tanks); for ( i = 0; i < net->num_tanks; ++i ) { @@ -178,6 +186,9 @@ void FGNetMiniFDM2Props( FGNetMiniFDM *net ) { net->theta, net->psi ); + cur_fdm_state->_set_V_calibrated_kts( net->vcas ); + cur_fdm_state->_set_Climb_Rate( net->climb_rate ); + for (i = 0; i < net->num_tanks; ++i ) { SGPropertyNode * node = fgGetNode("/consumables/fuel/tank", i, true); diff --git a/src/Network/net_fdm_mini.hxx b/src/Network/net_fdm_mini.hxx index 71c922a7f..d0cabec04 100644 --- a/src/Network/net_fdm_mini.hxx +++ b/src/Network/net_fdm_mini.hxx @@ -62,6 +62,10 @@ public: double theta; // pitch (radians) double psi; // yaw or true heading (radians) + // Velocities + double vcas; + double climb_rate; // feet per second + // Consumables int num_tanks; // Max number of fuel tanks double fuel_quantity[FG_MAX_TANKS];