]> git.mxchange.org Git - flightgear.git/blobdiff - src/Network/native_ctrls.cxx
Merge branch 'next' of gitorious.org:fg/flightgear into next
[flightgear.git] / src / Network / native_ctrls.cxx
index d7bd3f6bfa4936a5619b64237dcba25667edbea1..73c9f31ea73815b0ee23d857f727ae769716e7d8 100644 (file)
@@ -29,7 +29,6 @@
 #include <simgear/io/iochannel.hxx>
 #include <simgear/io/lowlevel.hxx> // endian tests
 
-#include <FDM/flight.hxx>
 #include <Main/fg_props.hxx>
 #include <Scenery/scenery.hxx> // ground elevation
 
@@ -118,6 +117,8 @@ void FGProps2NetCtrls( FGNetCtrls *net, bool honor_freezes,
     net->elevator_trim = node->getDoubleValue( "elevator-trim" );
     net->rudder_trim = node->getDoubleValue( "rudder-trim" );
     net->flaps = node->getDoubleValue( "flaps" );
+    net->speedbrake = node->getDoubleValue( "speedbrake" );
+    net->spoilers = node->getDoubleValue( "spoilers" );
     net->flaps_power
         = fgGetDouble( "/systems/electrical/outputs/flaps", 1.0 ) >= 1.0;
     net->flap_motor_ok = node->getBoolValue( "flaps-serviceable" );
@@ -205,12 +206,7 @@ void FGProps2NetCtrls( FGNetCtrls *net, bool honor_freezes,
     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
-    // of the current view point which could change substantially if
-    // the user is switching views.
-    net->hground = cur_fdm_state->get_ground_elev_ft() * SG_FEET_TO_METER;
+    net->hground = fgGetDouble("/position/ground-elev-m");
     net->magvar = fgGetDouble("/environment/magnetic-variation-deg");
 
     net->icing = fgGetBool("/hazards/icing/wing");
@@ -239,6 +235,8 @@ void FGProps2NetCtrls( FGNetCtrls *net, bool honor_freezes,
         htond(net->elevator_trim);
         htond(net->rudder_trim);
         htond(net->flaps);
+        htond(net->speedbrake);
+        htond(net->spoilers);
         net->flaps_power = htonl(net->flaps_power);
         net->flap_motor_ok = htonl(net->flap_motor_ok);
 
@@ -306,6 +304,8 @@ void FGNetCtrls2Props( FGNetCtrls *net, bool honor_freezes,
         htond(net->elevator_trim);
         htond(net->rudder_trim);
         htond(net->flaps);
+        htond(net->speedbrake);
+        htond(net->spoilers);
         net->flaps_power = htonl(net->flaps_power);
         net->flap_motor_ok = htonl(net->flap_motor_ok);
 
@@ -469,7 +469,6 @@ bool FGNativeCtrls::process() {
     int length = sizeof(FGNetCtrls);
 
     if ( get_direction() == SG_IO_OUT ) {
-       // cout << "size of cur_fdm_state = " << length << endl;
 
        FGProps2NetCtrls( &net_ctrls, true, true );