1
0
Fork 0

Add ground elevation to the net_gui.hxx structure.

This commit is contained in:
curt 2003-06-24 15:10:50 +00:00
parent e43034b067
commit 63d58174cb
2 changed files with 8 additions and 2 deletions

View file

@ -35,6 +35,7 @@
#include <Time/tmp.hxx> #include <Time/tmp.hxx>
#include <Main/fg_props.hxx> #include <Main/fg_props.hxx>
#include <Main/globals.hxx> #include <Main/globals.hxx>
#include <Scenery/scenery.hxx>
#include "native_gui.hxx" #include "native_gui.hxx"
@ -144,9 +145,10 @@ void FGProps2NetGUI( FGNetGUI *net ) {
net->fuel_quantity[i] = node->getDoubleValue("level-gal_us"); net->fuel_quantity[i] = node->getDoubleValue("level-gal_us");
} }
// the following really aren't used in this context // Environment
net->cur_time = globals->get_time_params()->get_cur_time(); net->cur_time = globals->get_time_params()->get_cur_time();
net->warp = globals->get_warp(); net->warp = globals->get_warp();
net->ground_elev = globals->get_scenery()->get_cur_elev();
// Approach // Approach
net->tuned_freq = current_radiostack->get_navcom1()->get_nav_freq(); net->tuned_freq = current_radiostack->get_navcom1()->get_nav_freq();
@ -209,6 +211,7 @@ void FGProps2NetGUI( FGNetGUI *net ) {
net->cur_time = htonl( net->cur_time ); net->cur_time = htonl( net->cur_time );
net->warp = htonl( net->warp ); net->warp = htonl( net->warp );
net->ground_elev = htonl( net->ground_elev );
htonf(net->tuned_freq); htonf(net->tuned_freq);
htonf(net->nav_radial); htonf(net->nav_radial);
@ -243,6 +246,7 @@ void FGNetGUI2Props( FGNetGUI *net ) {
net->cur_time = ntohl(net->cur_time); net->cur_time = ntohl(net->cur_time);
net->warp = ntohl(net->warp); net->warp = ntohl(net->warp);
net->ground_elev = htonl( net->ground_elev );
htonf(net->tuned_freq); htonf(net->tuned_freq);
net->in_range = htonl(net->in_range); net->in_range = htonl(net->in_range);
@ -277,6 +281,7 @@ void FGNetGUI2Props( FGNetGUI *net ) {
} }
globals->set_warp( net->warp ); globals->set_warp( net->warp );
globals->get_scenery()->set_cur_elev( net->ground_elev );
// Approach // Approach
fgSetDouble( "/radios/nav[0]/frequencies/selected-mhz", fgSetDouble( "/radios/nav[0]/frequencies/selected-mhz",

View file

@ -31,7 +31,7 @@
#endif #endif
const int FG_NET_GUI_VERSION = 3; const int FG_NET_GUI_VERSION = 4;
// Define a structure containing the top level flight dynamics model // Define a structure containing the top level flight dynamics model
@ -73,6 +73,7 @@ public:
// Environment // Environment
time_t cur_time; // current unix time time_t cur_time; // current unix time
long int warp; // offset in seconds to unix time long int warp; // offset in seconds to unix time
float ground_elev; // ground elev (meters)
// Approach // Approach
float tuned_freq; // currently tuned frequency float tuned_freq; // currently tuned frequency