]> git.mxchange.org Git - flightgear.git/commitdiff
Add support for shipping out current FlightGear temperature and pressure.
authorcurt <curt>
Mon, 10 Nov 2003 22:01:20 +0000 (22:01 +0000)
committercurt <curt>
Mon, 10 Nov 2003 22:01:20 +0000 (22:01 +0000)
src/Network/native_ctrls.cxx
src/Network/net_ctrls.hxx

index cae87ff4801aa268828863c0fe36db34d9836fb5..89a4ef0bb770bb2af021aedad232447217088317 100644 (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,7 +263,9 @@ void FGProps2NetCtrls( FGNetCtrls *net, bool honor_freezes,
         htond(net->wind_speed_kt);
         htond(net->wind_dir_deg);
         htond(net->turbulence_norm);
-        htond(net->hground);
+       htond(net->temp_c);
+        htond(net->press_inhg);
+       htond(net->hground);
         htond(net->magvar);
         net->speedup = htonl(net->speedup);
         net->freeze = htonl(net->freeze);
@@ -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 );
index d44b9362f05fc33d794bcd3b0635cf68065c3fdd..c536de60cc3b2a433b77bb2afadb5aca225d2f18 100644 (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.