]> git.mxchange.org Git - flightgear.git/blobdiff - src/FDM/ExternalNet.cxx
Added flap_deflection so that remote fdm can pass back actual flap deflection
[flightgear.git] / src / FDM / ExternalNet.cxx
index 62c23edc440945b3abcaaf8c03493f12fd2ae67d..160dc2f8370802d71b88aa2ec9b7085275b481f5 100644 (file)
@@ -149,8 +149,8 @@ static void net2global( FGNetFDM *net ) {
     }
 
     net->num_wheels = htonl(net->num_wheels);
-
     // I don't need to convert the Wow flags, since they are one byte in size
+    htond(net->flap_deflection);
 
     net->cur_time = ntohl(net->cur_time);
     net->warp = ntohl(net->warp);
@@ -213,6 +213,8 @@ static void net2global( FGNetFDM *net ) {
            node->setDoubleValue("wow", net->wow[i] );
        }
 
+        fgSetDouble("/surface-positions/flap-pos-norm", net->flap_deflection);
+
        /* these are ignored for now  ... */
        /*
        if ( net->cur_time ) {
@@ -234,7 +236,7 @@ static void net2global( FGNetFDM *net ) {
 
 FGExternalNet::FGExternalNet( double dt, string host, int dop, int dip, int cp )
 {
-    set_delta_t( dt );
+//     set_delta_t( dt );
 
     valid = true;
 
@@ -330,10 +332,13 @@ void FGExternalNet::init() {
 // Run an iteration of the EOM.  This is a NOP here because the flight
 // model values are getting filled in elsewhere (most likely from some
 // external source.)
-void FGExternalNet::update( int multiloop ) {
+void FGExternalNet::update( double dt ) {
     int length;
     int result;
 
+    if (is_suspended())
+      return;
+
     // Send control positions to remote fdm
     length = sizeof(ctrls);
     global2raw( &ctrls );