]> git.mxchange.org Git - flightgear.git/blobdiff - src/Network/native_ctrls.cxx
Various tweaks to ATC Flight Sim hardware inputs/outputs.
[flightgear.git] / src / Network / native_ctrls.cxx
index 10e78028b10ce106df847803fcd21b8f27bc3ca4..118555abb3150e5b55de3ff4c4510ad305674aad 100644 (file)
@@ -2,7 +2,7 @@
 //
 // Written by Curtis Olson, started July 2001.
 //
-// Copyright (C) 2001  Curtis L. Olson - curt@flightgear.org
+// Copyright (C) 2001  Curtis L. Olson - http://www.flightgear.org/~curt
 //
 // This program is free software; you can redistribute it and/or
 // modify it under the terms of the GNU General Public License as
@@ -138,6 +138,7 @@ void FGProps2NetCtrls( FGNetCtrls *net, bool honor_freezes,
         net->throttle[i] = node->getDoubleValue( "throttle", 0.0 );
        net->mixture[i] = node->getDoubleValue( "mixture", 0.0 );
        net->prop_advance[i] = node->getDoubleValue( "propeller-pitch", 0.0 );
+       net->condition[i] = node->getDoubleValue( "condition", 0.0 );
        net->magnetos[i] = node->getIntValue( "magnetos", 0 );
        if ( i == 0 ) {
          // cout << "Magnetos -> " << node->getIntValue( "magnetos", 0 );
@@ -186,6 +187,10 @@ void FGProps2NetCtrls( FGNetCtrls *net, bool honor_freezes,
     node = fgGetNode("/controls/gear", true);
     net->brake_left = node->getChild("brake-left")->getDoubleValue();
     net->brake_right = node->getChild("brake-right")->getDoubleValue();
+    net->copilot_brake_left
+        = node->getChild("copilot-brake-left")->getDoubleValue();
+    net->copilot_brake_right
+        = node->getChild("copilot-brake-right")->getDoubleValue();
     net->brake_parking = node->getChild("brake-parking")->getDoubleValue();
 
     net->gear_handle = fgGetBool( "controls/gear/gear-down" );
@@ -210,6 +215,9 @@ void FGProps2NetCtrls( FGNetCtrls *net, bool honor_freezes,
     // the user is switching views.
     net->hground = cur_fdm_state->get_ground_elev_ft() * SG_FEET_TO_METER;
     net->magvar = fgGetDouble("/environment/magnetic-variation-deg");
+
+    net->icing = fgGetDouble("/hazards/icing/wing");
+
     net->speedup = fgGetInt("/sim/speed-up");
     net->freeze = 0;
     if ( honor_freezes ) {
@@ -243,6 +251,7 @@ void FGProps2NetCtrls( FGNetCtrls *net, bool honor_freezes,
             htond(net->mixture[i]);
             net->fuel_pump_power[i] = htonl(net->fuel_pump_power[i]);
             htond(net->prop_advance[i]);
+            htond(net->condition[i]);
            net->engine_ok[i] = htonl(net->engine_ok[i]);
            net->mag_left_ok[i] = htonl(net->mag_left_ok[i]);
            net->mag_right_ok[i] = htonl(net->mag_right_ok[i]);
@@ -257,6 +266,8 @@ void FGProps2NetCtrls( FGNetCtrls *net, bool honor_freezes,
         net->num_tanks = htonl(net->num_tanks);
         htond(net->brake_left);
         htond(net->brake_right);
+        htond(net->copilot_brake_left);
+        htond(net->copilot_brake_right);
         htond(net->brake_parking);
         net->gear_handle = htonl(net->gear_handle);
         net->master_avionics = htonl(net->master_avionics);
@@ -267,6 +278,7 @@ void FGProps2NetCtrls( FGNetCtrls *net, bool honor_freezes,
         htond(net->press_inhg);
        htond(net->hground);
         htond(net->magvar);
+        net->icing = htonl(net->icing);
         net->speedup = htonl(net->speedup);
         net->freeze = htonl(net->freeze);
     }
@@ -301,6 +313,7 @@ void FGNetCtrls2Props( FGNetCtrls *net, bool honor_freezes,
             htond(net->mixture[i]);
             net->fuel_pump_power[i] = htonl(net->fuel_pump_power[i]);
             htond(net->prop_advance[i]);
+            htond(net->condition[i]);
            net->engine_ok[i] = htonl(net->engine_ok[i]);
            net->mag_left_ok[i] = htonl(net->mag_left_ok[i]);
            net->mag_right_ok[i] = htonl(net->mag_right_ok[i]);
@@ -314,6 +327,8 @@ void FGNetCtrls2Props( FGNetCtrls *net, bool honor_freezes,
         }
         htond(net->brake_left);
         htond(net->brake_right);
+        htond(net->copilot_brake_left);
+        htond(net->copilot_brake_right);
         htond(net->brake_parking);
         net->gear_handle = htonl(net->gear_handle);
         net->master_avionics = htonl(net->master_avionics);
@@ -324,6 +339,7 @@ void FGNetCtrls2Props( FGNetCtrls *net, bool honor_freezes,
         htond(net->press_inhg);
         htond(net->hground);
         htond(net->magvar);
+        net->icing = htonl(net->icing);
         net->speedup = htonl(net->speedup);
         net->freeze = htonl(net->freeze);
     }
@@ -351,6 +367,8 @@ void FGNetCtrls2Props( FGNetCtrls *net, bool honor_freezes,
         node->getChild( "mixture" )->setDoubleValue( net->mixture[i] );
         node->getChild( "propeller-pitch" )
             ->setDoubleValue( net->prop_advance[i] );
+        node->getChild( "condition" )
+            ->setDoubleValue( net->condition[i] );
         node->getChild( "magnetos" )->setDoubleValue( net->magnetos[i] );
 
        // Faults
@@ -380,6 +398,10 @@ void FGNetCtrls2Props( FGNetCtrls *net, bool honor_freezes,
     if ( node != NULL ) {
         node->getChild( "brake-left" )->setDoubleValue( net->brake_left );
         node->getChild( "brake-right" )->setDoubleValue( net->brake_right );
+        node->getChild( "copilot-brake-left" )
+            ->setDoubleValue( net->copilot_brake_left );
+        node->getChild( "copilot-brake-right" )
+            ->setDoubleValue( net->copilot_brake_right );
         node->getChild( "brake-parking" )->setDoubleValue( net->brake_parking );
     }
 
@@ -404,6 +426,8 @@ void FGNetCtrls2Props( FGNetCtrls *net, bool honor_freezes,
 
     // ground elevation ???
 
+    fgSetDouble("/hazards/icing/wing", net->icing);
+
     fgSetInt( "/sim/speed-up", net->speedup );
 
     if ( honor_freezes ) {