1
0
Fork 0

Add support for shipping out current FlightGear temperature and pressure.

This commit is contained in:
curt 2003-11-10 22:01:20 +00:00
parent baa5b9d6ac
commit 4cf43a8e9f
2 changed files with 18 additions and 2 deletions

View file

@ -199,6 +199,9 @@ void FGProps2NetCtrls( FGNetCtrls *net, bool honor_freezes,
net->turbulence_norm =
fgGetDouble("/environment/turbulence/magnitude-norm");
net->temp_c = fgGetDouble("/environment/temperature-degc");
net->press_inhg = fgGetDouble("/environment/pressure-sea-level-inhg");
// cur_fdm_state->get_ground_elev_ft() is what we want ... this
// reports the altitude of the aircraft.
// "/environment/ground-elevation-m" reports the ground elevation
@ -260,6 +263,8 @@ void FGProps2NetCtrls( FGNetCtrls *net, bool honor_freezes,
htond(net->wind_speed_kt);
htond(net->wind_dir_deg);
htond(net->turbulence_norm);
htond(net->temp_c);
htond(net->press_inhg);
htond(net->hground);
htond(net->magvar);
net->speedup = htonl(net->speedup);
@ -316,6 +321,8 @@ void FGNetCtrls2Props( FGNetCtrls *net, bool honor_freezes,
htond(net->wind_speed_kt);
htond(net->wind_dir_deg);
htond(net->turbulence_norm);
htond(net->temp_c);
htond(net->press_inhg);
htond(net->hground);
htond(net->magvar);
net->speedup = htonl(net->speedup);
@ -391,6 +398,11 @@ void FGNetCtrls2Props( FGNetCtrls *net, bool honor_freezes,
node->setDoubleValue( "turbulence/magnitude-norm", net->turbulence_norm );
node->setBoolValue( "magnetic-variation-deg", net->magvar );
node->setDoubleValue( "/environment/temperature-degc",
net->temp_c );
node->setDoubleValue( "/environment/pressure-sea-level-inhg",
net->press_inhg );
// ground elevation ???
fgSetInt( "/sim/speed-up", net->speedup );

View file

@ -30,7 +30,7 @@
# error This library requires C++
#endif
const int FG_NET_CTRLS_VERSION = 17;
const int FG_NET_CTRLS_VERSION = 18;
// Define a structure containing the control parameters
@ -96,6 +96,10 @@ public:
double wind_dir_deg;
double turbulence_norm;
// temp and pressure
double temp_c;
double press_inhg;
// other information about environment
double hground; // ground elevation (meters)
double magvar; // local magnetic variation in degs.