]> git.mxchange.org Git - flightgear.git/blob - src/FDM/UIUCModel/uiuc_icing_demo.cpp
Robert Deters:
[flightgear.git] / src / FDM / UIUCModel / uiuc_icing_demo.cpp
1 /**********************************************************************
2
3  FILENAME:     uiuc_icing_demo.cpp
4
5 ----------------------------------------------------------------------
6
7  DESCRIPTION:  
8
9 ----------------------------------------------------------------------
10
11  STATUS:       alpha version
12
13 ----------------------------------------------------------------------
14
15  REFERENCES:   
16
17 ----------------------------------------------------------------------
18
19  HISTORY:      12/02/2002   initial release - originally in
20                             uiuc_coefficients()
21
22 ----------------------------------------------------------------------
23
24  AUTHOR(S):    Robert Deters      <rdeters@uiuc.edu>
25
26 ----------------------------------------------------------------------
27
28  VARIABLES:
29
30 ----------------------------------------------------------------------
31
32  INPUTS:       
33
34 ----------------------------------------------------------------------
35
36  OUTPUTS:      
37
38 ----------------------------------------------------------------------
39
40  CALLED BY:    uiuc_coefficients
41
42 ----------------------------------------------------------------------
43
44  CALLS TO:     
45
46 ----------------------------------------------------------------------
47
48  COPYRIGHT:    (C) 2002 by Michael Selig
49
50  This program is free software; you can redistribute it and/or
51  modify it under the terms of the GNU General Public License
52  as published by the Free Software Foundation.
53
54  This program is distributed in the hope that it will be useful,
55  but WITHOUT ANY WARRANTY; without even the implied warranty of
56  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
57  GNU General Public License for more details.
58
59  You should have received a copy of the GNU General Public License
60  along with this program; if not, write to the Free Software
61  Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307,
62  USA or view http://www.gnu.org/copyleft/gpl.html.
63
64 **********************************************************************/
65
66 #include "uiuc_icing_demo.h"
67
68 void uiuc_icing_demo()
69 {
70   // Envelope protection values
71   if (demo_eps_alpha_max) {
72     double time = Simtime - demo_eps_alpha_max_startTime;
73     eps_alpha_max = uiuc_1Dinterpolation(demo_eps_alpha_max_timeArray,
74                                          demo_eps_alpha_max_daArray,
75                                          demo_eps_alpha_max_ntime,
76                                          time);
77   }
78   if (demo_eps_pitch_max) {
79     double time = Simtime - demo_eps_pitch_max_startTime;
80     eps_pitch_max = uiuc_1Dinterpolation(demo_eps_pitch_max_timeArray,
81                                          demo_eps_pitch_max_daArray,
82                                          demo_eps_pitch_max_ntime,
83                                          time);
84   }
85   if (demo_eps_pitch_min) {
86     double time = Simtime - demo_eps_pitch_min_startTime;
87     eps_pitch_min = uiuc_1Dinterpolation(demo_eps_pitch_min_timeArray,
88                                          demo_eps_pitch_min_daArray,
89                                          demo_eps_pitch_min_ntime,
90                                          time);
91   }
92   if (demo_eps_roll_max) {
93     double time = Simtime - demo_eps_roll_max_startTime;
94     eps_roll_max = uiuc_1Dinterpolation(demo_eps_roll_max_timeArray,
95                                         demo_eps_roll_max_daArray,
96                                         demo_eps_roll_max_ntime,
97                                         time);
98   }
99   if (demo_eps_thrust_min) {
100     double time = Simtime - demo_eps_thrust_min_startTime;
101     eps_thrust_min = uiuc_1Dinterpolation(demo_eps_thrust_min_timeArray,
102                                           demo_eps_thrust_min_daArray,
103                                           demo_eps_thrust_min_ntime,
104                                           time);
105   }
106   if (demo_eps_airspeed_max) {
107     double time = Simtime - demo_eps_airspeed_max_startTime;
108     eps_airspeed_max = uiuc_1Dinterpolation(demo_eps_airspeed_max_timeArray,
109                                             demo_eps_airspeed_max_daArray,
110                                             demo_eps_airspeed_max_ntime,
111                                             time);
112   }
113   if (demo_eps_airspeed_min) {
114     double time = Simtime - demo_eps_airspeed_min_startTime;
115     eps_airspeed_min = uiuc_1Dinterpolation(demo_eps_airspeed_min_timeArray,
116                                             demo_eps_airspeed_min_daArray,
117                                             demo_eps_airspeed_min_ntime,
118                                             time);
119   }
120   if (demo_eps_flap_max) {
121     double time = Simtime - demo_eps_flap_max_startTime;
122     eps_flap_max = uiuc_1Dinterpolation(demo_eps_flap_max_timeArray,
123                                         demo_eps_flap_max_daArray,
124                                         demo_eps_flap_max_ntime,
125                                         time);
126   }
127   if (demo_eps_pitch_input) {
128     double time = Simtime - demo_eps_pitch_input_startTime;
129     eps_pitch_input = uiuc_1Dinterpolation(demo_eps_pitch_input_timeArray,
130                                            demo_eps_pitch_input_daArray,
131                                            demo_eps_pitch_input_ntime,
132                                            time);
133   }
134
135   // Boot cycle values
136   if (demo_boot_cycle_tail) {
137     double time = Simtime - demo_boot_cycle_tail_startTime;
138     boot_cycle_tail = uiuc_1Dinterpolation(demo_boot_cycle_tail_timeArray,
139                                            demo_boot_cycle_tail_daArray,
140                                            demo_boot_cycle_tail_ntime,
141                                            time);
142   }
143   if (demo_boot_cycle_wing_left) {
144     double time = Simtime - demo_boot_cycle_wing_left_startTime;
145     boot_cycle_wing_left = uiuc_1Dinterpolation(demo_boot_cycle_wing_left_timeArray,
146                                                 demo_boot_cycle_wing_left_daArray,
147                                                 demo_boot_cycle_wing_left_ntime,
148                                                 time);
149   }
150   if (demo_boot_cycle_wing_right) {
151     double time = Simtime - demo_boot_cycle_wing_right_startTime;
152     boot_cycle_wing_right = uiuc_1Dinterpolation(demo_boot_cycle_wing_right_timeArray,
153                                                  demo_boot_cycle_wing_right_daArray,
154                                                  demo_boot_cycle_wing_right_ntime,
155                                                  time);
156   }
157
158   // Ice values
159   if (demo_ice_tail) {
160     double time = Simtime - demo_ice_tail_startTime;
161     ice_tail = uiuc_1Dinterpolation(demo_ice_tail_timeArray,
162                                     demo_ice_tail_daArray,
163                                     demo_ice_tail_ntime,
164                                     time);
165   }
166   if (demo_ice_left) {
167     double time = Simtime - demo_ice_left_startTime;
168     ice_left = uiuc_1Dinterpolation(demo_ice_left_timeArray,
169                                     demo_ice_left_daArray,
170                                     demo_ice_left_ntime,
171                                     time);
172   }
173   if (demo_ice_right) {
174     double time = Simtime - demo_ice_right_startTime;
175     ice_right = uiuc_1Dinterpolation(demo_ice_right_timeArray,
176                                      demo_ice_right_daArray,
177                                      demo_ice_right_ntime,
178                                      time);
179   }
180
181   // Autopilot
182   if (demo_ap_pah_on){
183     double time = Simtime - demo_ap_pah_on_startTime;
184     ap_pah_on = uiuc_1Dinterpolation(demo_ap_pah_on_timeArray,
185                                      demo_ap_pah_on_daArray,
186                                      demo_ap_pah_on_ntime,
187                                      time);
188   }
189   if (demo_ap_Theta_ref_deg){
190     double time = Simtime - demo_ap_Theta_ref_deg_startTime;
191     ap_Theta_ref_deg = uiuc_1Dinterpolation(demo_ap_Theta_ref_deg_timeArray,
192                                             demo_ap_Theta_ref_deg_daArray,
193                                             demo_ap_Theta_ref_deg_ntime,
194                                             time);
195   }
196
197   return;
198 }