]> git.mxchange.org Git - flightgear.git/commitdiff
Make separate left/right flap surface positions in the net_fdm.hxx
authorcurt <curt>
Fri, 29 Oct 2004 00:13:32 +0000 (00:13 +0000)
committercurt <curt>
Fri, 29 Oct 2004 00:13:32 +0000 (00:13 +0000)
structure for future use.  Right now they are tied together.

src/Network/atc610x.cxx
src/Network/native_fdm.cxx
src/Network/net_fdm.hxx
src/Replay/replay.cxx

index e4822da58d5af4dec6d47db8be4200ff2589c522..0f164ddf6d88fabad99257bf9f4cbcc069f38eb9 100644 (file)
@@ -1251,21 +1251,31 @@ bool FGATC610x::do_radio_switches() {
 
 
     // ADF buttons 
+#define CURT_HARDWARE
     fgSetInt( "/radios/kr-87/inputs/adf-btn",
               (radio_switch_data[23] & 0x01) );
     fgSetInt( "/radios/kr-87/inputs/bfo-btn",
               (radio_switch_data[23] >> 1 & 0x01) );
-#ifdef CURT_HARDWARE
-    fgSetInt( "/radios/kr-87/inputs/frq-btn",
-              !(radio_switch_data[23] >> 2 & 0x01) );
-#else
+
     fgSetInt( "/radios/kr-87/inputs/frq-btn",
               (radio_switch_data[23] >> 2 & 0x01) );
-#endif
+
+#ifdef CURT_HARDWARE
+    fgSetInt( "/radios/kr-87/inputs/flt-et-btn",
+              !(radio_switch_data[23] >> 3 & 0x01) );
+#else
     fgSetInt( "/radios/kr-87/inputs/flt-et-btn",
               (radio_switch_data[23] >> 3 & 0x01) );
+#endif
+
+#ifdef CURT_HARDWARE
+    fgSetInt( "/radios/kr-87/inputs/set-rst-btn",
+              !(radio_switch_data[23] >> 4 & 0x01) );
+#else
     fgSetInt( "/radios/kr-87/inputs/set-rst-btn",
               (radio_switch_data[23] >> 4 & 0x01) );
+#endif
+
     fgSetInt( "/radios/kr-87/inputs/power-btn",
               radio_switch_data[23] >> 5 & 0x01 );
     /* cout << "adf = " << !(radio_switch_data[23] & 0x01)
@@ -1767,6 +1777,18 @@ bool FGATC610x::do_switches() {
     update_switch_matrix( board, switch_data, switch_matrix );
 
     // master switches
+#define CURT_HARDWARE
+#ifdef CURT_HARDWARE
+    fgSetBool( "/controls/engines/engine[0]/master-bat",
+               switch_matrix[board][5][1] );
+    fgSetBool( "/controls/engines/engine[1]/master-bat",
+               switch_matrix[board][5][1] );
+
+    fgSetBool( "/controls/engines/engine[0]/master-alt",
+               switch_matrix[board][4][1] );
+    fgSetBool( "/controls/engines/engine[1]/master-alt",
+               switch_matrix[board][4][1] );
+#else
     fgSetBool( "/controls/engines/engine[0]/master-bat",
                switch_matrix[board][4][1] );
     fgSetBool( "/controls/engines/engine[1]/master-bat",
@@ -1776,6 +1798,7 @@ bool FGATC610x::do_switches() {
                switch_matrix[board][5][1] );
     fgSetBool( "/controls/engines/engine[1]/master-alt",
                switch_matrix[board][5][1] );
+#endif
 
     fgSetBool( "/controls/switches/master-avionics",
                switch_matrix[board][0][3] );
index 939c93dda248435272b916c2c9820d87f7601809..6b83931361937acd8e7418807e56e5f903a99e7f 100644 (file)
@@ -205,7 +205,9 @@ void FGProps2NetFDM( FGNetFDM *net, bool net_byte_order ) {
     net->elevator = node->getDoubleValue( "elevator-pos-norm" );
     net->elevator_trim_tab
         = node->getDoubleValue( "elevator-trim-tab-pos-norm" );
-    net->flaps = node->getDoubleValue( "flap-pos-norm" );
+    // FIXME: CLO 10/28/04 - This really should be separated out into 2 values
+    net->left_flap = node->getDoubleValue( "flap-pos-norm" );
+    net->right_flap = node->getDoubleValue( "flap-pos-norm" );
     net->left_aileron = node->getDoubleValue( "left-aileron-pos-norm" );
     net->right_aileron = node->getDoubleValue( "right-aileron-pos-norm" );
     net->rudder = node->getDoubleValue( "rudder-pos-norm" );
@@ -276,7 +278,8 @@ void FGProps2NetFDM( FGNetFDM *net, bool net_byte_order ) {
 
         htonf(net->elevator);
         htonf(net->elevator_trim_tab);
-        htonf(net->flaps);
+        htonf(net->left_flap);
+        htonf(net->right_flap);
         htonf(net->left_aileron);
         htonf(net->right_aileron);
         htonf(net->rudder);
@@ -353,7 +356,8 @@ void FGNetFDM2Props( FGNetFDM *net, bool net_byte_order ) {
 
         htonf(net->elevator);
         htonf(net->elevator_trim_tab);
-        htonf(net->flaps);
+        htonf(net->left_flap);
+        htonf(net->right_flap);
         htonf(net->left_aileron);
         htonf(net->right_aileron);
         htonf(net->rudder);
@@ -457,7 +461,10 @@ void FGNetFDM2Props( FGNetFDM *net, bool net_byte_order ) {
         node->setDoubleValue("elevator-pos-norm", net->elevator);
         node->setDoubleValue("elevator-trim-tab-pos-norm",
                              net->elevator_trim_tab);
-        node->setDoubleValue("flap-pos-norm", net->flaps);
+       // FIXME: CLO 10/28/04 - This really should be separated out
+       // into 2 values
+        node->setDoubleValue("flap-pos-norm", net->left_flap);
+        node->setDoubleValue("flap-pos-norm", net->right_flap);
         node->setDoubleValue("left-aileron-pos-norm", net->left_aileron);
         node->setDoubleValue("right-aileron-pos-norm", net->right_aileron);
         node->setDoubleValue("rudder-pos-norm", net->rudder);
index 160a54ba6313c9027b1cbb4bf404253c25a823f8..d9419be7209649bd81765d466f491b3db00f03f3 100644 (file)
@@ -18,7 +18,7 @@
 
 #include <time.h> // time_t
 
-const int FG_NET_FDM_VERSION = 18;
+const int FG_NET_FDM_VERSION = 19;
 
 
 // Define a structure containing the top level flight dynamics model
@@ -107,7 +107,8 @@ public:
     // Control surface positions (normalized values)
     float elevator;
     float elevator_trim_tab;
-    float flaps;
+    float left_flap;
+    float right_flap;
     float left_aileron;
     float right_aileron;
     float rudder;
index ac91a71aa6bf8f8d793270f81469092530e95bbd..0e4249e4250480a467ee3c3eb5815c47bd8b5549 100644 (file)
@@ -299,7 +299,8 @@ static FGReplayData interpolate( double time, FGReplayData f1, FGReplayData f2 )
 
     // Control surface positions (normalized values)
     result.fdm.elevator = weight( fdm1.elevator, fdm2.elevator, ratio );
-    result.fdm.flaps = weight( fdm1.flaps, fdm2.flaps, ratio );
+    result.fdm.left_flap = weight( fdm1.left_flap, fdm2.left_flap, ratio );
+    result.fdm.right_flap = weight( fdm1.right_flap, fdm2.right_flap, ratio );
     result.fdm.left_aileron
         = weight( fdm1.left_aileron, fdm2.left_aileron, ratio );
     result.fdm.right_aileron