1 /**********************************************************************
3 FILENAME: uiuc_controlInput.cpp
5 ----------------------------------------------------------------------
7 DESCRIPTION: sets control surface deflections for specified input
10 ----------------------------------------------------------------------
14 ----------------------------------------------------------------------
18 ----------------------------------------------------------------------
20 HISTORY: 04/08/2000 initial release
22 ----------------------------------------------------------------------
24 AUTHOR(S): Jeff Scott <jscott@mail.com>
26 ----------------------------------------------------------------------
30 ----------------------------------------------------------------------
36 ----------------------------------------------------------------------
38 OUTPUTS: -elevator deflection
40 ----------------------------------------------------------------------
42 CALLED BY: uiuc_coefficients.cpp
44 ----------------------------------------------------------------------
48 ----------------------------------------------------------------------
50 COPYRIGHT: (C) 2000 by Michael Selig
52 This program is free software; you can redistribute it and/or
53 modify it under the terms of the GNU General Public License
54 as published by the Free Software Foundation.
56 This program is distributed in the hope that it will be useful,
57 but WITHOUT ANY WARRANTY; without even the implied warranty of
58 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
59 GNU General Public License for more details.
61 You should have received a copy of the GNU General Public License
62 along with this program; if not, write to the Free Software
63 Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307,
64 USA or view http://www.gnu.org/copyleft/gpl.html.
66 **********************************************************************/
68 #include <simgear/compiler.h>
70 #include "uiuc_controlInput.h"
74 void uiuc_controlInput()
76 // elevator step input
79 if (Simtime >= elevator_step_startTime)
81 elevator = elevator + elevator_step_angle;
85 // elevator singlet input
88 if (Simtime >= elevator_singlet_startTime &&
89 Simtime <= (elevator_singlet_startTime + elevator_singlet_duration))
91 elevator = elevator + elevator_singlet_angle;
95 // elevator doublet input
98 if (Simtime >= elevator_doublet_startTime &&
99 Simtime <= (elevator_doublet_startTime + elevator_doublet_duration/2))
101 elevator = elevator + elevator_doublet_angle;
103 else if (Simtime >= (elevator_doublet_startTime + elevator_doublet_duration/2) &&
104 Simtime <= (elevator_doublet_startTime + elevator_doublet_duration))
106 elevator = elevator - elevator_doublet_angle;
113 double elevator_input_endTime = elevator_input_timeArray[elevator_input_ntime];
114 if (Simtime >= elevator_input_startTime &&
115 Simtime <= (elevator_input_startTime + elevator_input_endTime))
117 double time = Simtime - elevator_input_startTime;
118 elevator = elevator +
119 uiuc_1Dinterpolation(elevator_input_timeArray,
120 elevator_input_deArray,
121 elevator_input_ntime,
128 // end uiuc_controlInput.cpp