]> git.mxchange.org Git - flightgear.git/commitdiff
Allow the external FDM to calculate slip/skid ball deflection and override
authorcurt <curt>
Mon, 10 Nov 2003 22:02:38 +0000 (22:02 +0000)
committercurt <curt>
Mon, 10 Nov 2003 22:02:38 +0000 (22:02 +0000)
FlightGear's internal calculation.

src/Network/native_fdm.cxx
src/Network/net_fdm.hxx

index 68133d4da76882e794c10c094c1a7fce307b56c6..1380feea80a88b13fc85a6b77d49a9dc3301452b 100644 (file)
@@ -147,12 +147,15 @@ void FGProps2NetFDM( FGNetFDM *net, bool net_byte_order ) {
     net->v_wind_body_north = cur_fdm_state->get_uBody();
     net->v_wind_body_east = cur_fdm_state->get_vBody();
     net->v_wind_body_down = cur_fdm_state->get_wBody();
-    net->stall_warning = fgGetDouble("/sim/alarms/stall-warning", 0.0);
 
     net->A_X_pilot = cur_fdm_state->get_A_X_pilot();
     net->A_Y_pilot = cur_fdm_state->get_A_Y_pilot();
     net->A_Z_pilot = cur_fdm_state->get_A_Z_pilot();
 
+    net->stall_warning = fgGetDouble("/sim/alarms/stall-warning", 0.0);
+    net->slip_deg
+      = fgGetDouble("/instrumentation/slip-skid-ball/indicated-slip-skid");
+
     // Engine parameters
     net->num_engines = FGNetFDM::FG_MAX_ENGINES;
     for ( i = 0; i < net->num_engines; ++i ) {
@@ -227,12 +230,14 @@ void FGProps2NetFDM( FGNetFDM *net, bool net_byte_order ) {
         htonf(net->v_wind_body_north);
         htonf(net->v_wind_body_east);
         htonf(net->v_wind_body_down);
-        htonf(net->stall_warning);
 
         htonf(net->A_X_pilot);
         htonf(net->A_Y_pilot);
         htonf(net->A_Z_pilot);
 
+        htonf(net->stall_warning);
+        htonf(net->slip_deg);
+
         for ( i = 0; i < net->num_engines; ++i ) {
             net->eng_state[i] = htonl(net->eng_state[i]);
             htonf(net->rpm[i]);
@@ -297,12 +302,14 @@ void FGNetFDM2Props( FGNetFDM *net, bool net_byte_order ) {
         htonf(net->v_wind_body_north);
         htonf(net->v_wind_body_east);
         htonf(net->v_wind_body_down);
-        htonf(net->stall_warning);
 
         htonf(net->A_X_pilot);
         htonf(net->A_Y_pilot);
         htonf(net->A_Z_pilot);
 
+        htonf(net->stall_warning);
+        htonf(net->slip_deg);
+
         net->num_engines = htonl(net->num_engines);
         for ( i = 0; i < net->num_engines; ++i ) {
             net->eng_state[i] = htonl(net->eng_state[i]);
@@ -369,11 +376,15 @@ void FGNetFDM2Props( FGNetFDM *net, bool net_byte_order ) {
                                                   net->v_wind_body_east,
                                                   net->v_wind_body_down );
 
-        fgSetDouble( "/sim/alarms/stall-warning", net->stall_warning );
         cur_fdm_state->_set_Accels_Pilot_Body( net->A_X_pilot,
                                               net->A_Y_pilot,
                                               net->A_Z_pilot );
 
+        fgSetDouble( "/sim/alarms/stall-warning", net->stall_warning );
+       fgSetDouble( "/instrumentation/slip-skid-ball/indicated-slip-skid",
+                    net->slip_deg );
+       fgSetBool( "/instrumentation/slip-skid-ball/override", true );
+
        for ( i = 0; i < net->num_engines; ++i ) {
            SGPropertyNode *node = fgGetNode( "engines/engine", i, true );
            
index eed2c843887fd411c86eb91452ea7884eed8b28e..29a7c8555152b1b4890141e6ae7df5bb0269f04a 100644 (file)
@@ -32,7 +32,7 @@
 
 #include <time.h> // time_t
 
-const int FG_NET_FDM_VERSION = 13;
+const int FG_NET_FDM_VERSION = 14;
 
 
 // Define a structure containing the top level flight dynamics model
@@ -79,14 +79,15 @@ public:
     float v_wind_body_down;     // down/vertical velocity in local/body
                                 // frame relative to local airmass, fps
 
-    // Stall
-    float stall_warning;        // 0.0 - 1.0 indicating the amount of stall
-
     // Accelerations
     float A_X_pilot;           // X accel in body frame ft/sec^2
     float A_Y_pilot;           // Y accel in body frame ft/sec^2
     float A_Z_pilot;           // Z accel in body frame ft/sec^2
 
+    // Stall
+    float stall_warning;        // 0.0 - 1.0 indicating the amount of stall
+    float slip_deg;            // slip ball deflection
+
     // Pressure
     
     // Engine status