1 /***************************************************************************
5 ----------------------------------------------------------------------------
7 FUNCTION: Model loop executive
9 ----------------------------------------------------------------------------
11 MODULE STATUS: developmental
13 ----------------------------------------------------------------------------
15 GENEALOGY: Created 15 October 1992 as part of LaRCSIM project
18 ----------------------------------------------------------------------------
20 DESIGNED BY: Bruce Jackson
22 CODED BY: Bruce Jackson
24 MAINTAINED BY: maintainer
26 ----------------------------------------------------------------------------
32 950306 Added parameters to call: dt, which is the step size
33 to be taken this loop (caution: may vary from call to call)
34 and Initialize, which if non-zero, implies an initialization
37 CURRENT RCS HEADER INFO:
40 Revision 1.3 2003/05/13 18:45:06 curt
43 I have attached some revisions for the UIUCModel and some LaRCsim.
44 The only thing you should need to check is LaRCsim.cxx. The file
45 I attached is a revised version of 1.5 and the latest is 1.7. Also,
46 uiuc_getwind.c and uiuc_getwind.h are no longer in the LaRCsim
47 directory. They have been moved over to UIUCModel.
49 Revision 1.2 2003/03/31 03:05:41 m-selig
50 uiuc wind changes, MSS
52 Revision 1.1.1.1 2003/02/28 01:33:39 rob
53 uiuc version of FlightGear v0.9.0
55 Revision 1.3 2002/12/12 00:01:04 rob
56 *** empty log message ***
58 Revision 1.2 2002/10/22 21:06:49 rob
59 *** empty log message ***
61 Revision 1.2 2002/08/29 18:56:37 rob
62 *** empty log message ***
64 Revision 1.1.1.1 2002/04/24 17:08:23 rob
65 UIUC version of FlightGear-0.7.pre11
67 Revision 1.5 2002/04/01 19:37:34 curt
68 I have attached revisions to the UIUC code. The revisions include the
69 ability to run a nonlinear model with flaps. The files ls_model.c and
70 uiuc_aero.c were changed since we had some functions with the same
71 name. The name changes doesn't affect the code, it just makes it a
72 little easier to read. There are changes in LaRCsim.cxx so UIUC
73 models have engine sound. Could you send me an email when you receive
74 this and/or when the changes make it to the CVS? Thanks.
76 Also I noticed you have some outdated files that are no longer used in
77 the UIUCModel directory. They are uiuc_initializemaps1.cpp,
78 uiuc_initializemaps2.cpp, uiuc_initializemaps3.cpp, and
79 uiuc_initializemaps4.cpp
83 Revision 1.4 2001/09/14 18:47:27 curt
84 More changes in support of UIUCModel.
86 Revision 1.3 2000/10/28 14:30:33 curt
87 Updates by Tony working on the FDM interface bus.
89 Revision 1.2 2000/04/10 18:09:41 curt
90 David Megginson made a few (mostly minor) mods to the LaRCsim files, and
91 it's now possible to choose the LaRCsim model at runtime, as in
97 fgfs --aircraft=uiuc --aircraft-dir=Aircraft-uiuc/Boeing747
99 I did this so that I could play with the UIUC stuff without losing
100 Tony's C172 with its flaps, etc. I did my best to respect the design
101 of the LaRCsim code by staying in C, making only minimal changes, and
102 not introducing any dependencies on the rest of FlightGear. The
103 modified files are attached.
105 Revision 1.1.1.1 1999/06/17 18:07:33 curt
106 Start of 0.7.x branch
108 Revision 1.1.1.1 1999/04/05 21:32:45 curt
109 Start of 0.6.x branch.
111 Revision 1.3 1998/08/06 12:46:39 curt
114 Revision 1.2 1998/01/19 18:40:27 curt
115 Tons of little changes to clean up the code and to remove fatal errors
116 when building with the c++ compiler.
118 Revision 1.1 1997/05/29 00:09:58 curt
119 Initial Flight Gear revision.
121 * Revision 1.3 1995/03/06 18:49:46 bjax
122 * Added dt and initialize flag parameters to subroutine calls. This will
123 * support trim routine (to allow single throttle setting to drive
124 * all four throttle positions, for example, if initialize is TRUE).
126 * Revision 1.2 1993/03/10 06:38:09 bjax
127 * Added additional calls: inertias() and subsystems()... EBJ
129 * Revision 1.1 92/12/30 13:19:08 bjax
133 ----------------------------------------------------------------------------
137 ----------------------------------------------------------------------------
139 CALLED BY: ls_step (in initialization), ls_loop (planned)
141 ----------------------------------------------------------------------------
143 CALLS TO: aero(), engine(), gear()
145 ----------------------------------------------------------------------------
149 ----------------------------------------------------------------------------
153 --------------------------------------------------------------------------*/
154 #include "ls_types.h"
155 #include "ls_model.h"
156 #include "default_model_routines.h"
161 void ls_model( SCALAR dt, int Initialize ) {
162 switch (current_model) {
164 inertias( dt, Initialize );
165 subsystems( dt, Initialize );
166 navion_aero( dt, Initialize );
167 navion_engine( dt, Initialize );
168 navion_gear( dt, Initialize );
171 if(Initialize < 0) c172_init();
172 inertias( dt, Initialize );
173 subsystems( dt, Initialize );
174 c172_aero( dt, Initialize );
175 c172_engine( dt, Initialize );
176 c172_gear( dt, Initialize );
179 inertias( dt, Initialize );
180 subsystems( dt, Initialize );
181 cherokee_aero( dt, Initialize );
182 cherokee_engine( dt, Initialize );
183 cherokee_gear( dt, Initialize );
186 inertias( dt, Initialize );
187 subsystems( dt, Initialize );
188 uiuc_init_2_wrapper();
189 uiuc_network_recv_2_wrapper();
190 uiuc_engine_2_wrapper( dt, Initialize );
191 uiuc_wind_2_wrapper( dt, Initialize );
192 uiuc_aero_2_wrapper( dt, Initialize );
193 uiuc_gear_2_wrapper( dt, Initialize );
194 uiuc_network_send_2_wrapper();
195 uiuc_record_2_wrapper(dt);