]> git.mxchange.org Git - flightgear.git/blobdiff - src/FDM/UIUCModel/uiuc_controlInput.cpp
Port over remaining Point3D usage to the more type and unit safe SG* classes.
[flightgear.git] / src / FDM / UIUCModel / uiuc_controlInput.cpp
index 073e75783c1b669f513b05b14304d7218a059fe2..b18a77c4e395663b2a7af14790f0dbb27dff81ad 100644 (file)
 ----------------------------------------------------------------------
 
  HISTORY:      04/08/2000   initial release
+               06/18/2001   (RD) Added aileron_input and rudder_input
+              07/05/2001   (RD) Code added to allow the pilot to fly
+                           aircraft after the control surface input
+                           files have been used.
 
 ----------------------------------------------------------------------
 
  AUTHOR(S):    Jeff Scott         <jscott@mail.com>
+               Robert Deters      <rdeters@uiuc.edu>
 
 ----------------------------------------------------------------------
 
@@ -60,8 +65,7 @@
 
  You should have received a copy of the GNU General Public License
  along with this program; if not, write to the Free Software
- Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307,
- USA or view http://www.gnu.org/copyleft/gpl.html.
+ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.
 
 **********************************************************************/
 
@@ -69,7 +73,7 @@
 
 #include "uiuc_controlInput.h"
 
-#include STL_IOSTREAM
+#include <iostream>
 
 void uiuc_controlInput()
 {
@@ -115,6 +119,11 @@ void uiuc_controlInput()
           Simtime <= (elevator_input_startTime + elevator_input_endTime))
         {
           double time = Simtime - elevator_input_startTime;
+         if (pilot_elev_no_check)
+           {
+             elevator = 0 + elevator_tab;
+             pilot_elev_no = true;
+           }
           elevator = elevator + 
             uiuc_1Dinterpolation(elevator_input_timeArray,
                                  elevator_input_deArray,
@@ -122,6 +131,66 @@ void uiuc_controlInput()
                                  time);
         }
     }
+
+  // aileron input
+  if (aileron_input)
+    {
+      double aileron_input_endTime = aileron_input_timeArray[aileron_input_ntime];
+      if (Simtime >= aileron_input_startTime && 
+          Simtime <= (aileron_input_startTime + aileron_input_endTime))
+        {
+          double time = Simtime - aileron_input_startTime;
+         if (pilot_ail_no_check)
+           {
+             aileron = 0;
+             if (Simtime==0)             //7-25-01 (RD) Added because
+               pilot_ail_no = false;     //segmentation fault is given
+             else                        //with FG 0.7.8
+               pilot_ail_no = true;
+           }
+          aileron = aileron + 
+            uiuc_1Dinterpolation(aileron_input_timeArray,
+                                 aileron_input_daArray,
+                                 aileron_input_ntime,
+                                 time);
+        }
+    }
+
+  // rudder input
+  if (rudder_input)
+    {
+      double rudder_input_endTime = rudder_input_timeArray[rudder_input_ntime];
+      if (Simtime >= rudder_input_startTime && 
+          Simtime <= (rudder_input_startTime + rudder_input_endTime))
+        {
+          double time = Simtime - rudder_input_startTime;
+         if (pilot_rud_no_check)
+           {
+             rudder = 0;
+             pilot_rud_no = true;
+           }
+          rudder = rudder + 
+            uiuc_1Dinterpolation(rudder_input_timeArray,
+                                 rudder_input_drArray,
+                                 rudder_input_ntime,
+                                 time);
+        }
+    }
+
+  if (flap_pos_input)
+    {
+      double flap_pos_input_endTime = flap_pos_input_timeArray[flap_pos_input_ntime];
+      if (Simtime >= flap_pos_input_startTime && 
+          Simtime <= (flap_pos_input_startTime + flap_pos_input_endTime))
+        {
+          double time = Simtime - flap_pos_input_startTime;
+          flap_pos = uiuc_1Dinterpolation(flap_pos_input_timeArray,
+                                         flap_pos_input_dfArray,
+                                         flap_pos_input_ntime,
+                                         time);
+        }
+    }
+
   return;
 }