]> git.mxchange.org Git - flightgear.git/blob - src/FDM/LaRCsim/ls_model.c
Updates to the scenery loading infrastructure to make it more flexible,
[flightgear.git] / src / FDM / LaRCsim / ls_model.c
1 /***************************************************************************
2
3         TITLE:          ls_model()      
4         
5 ----------------------------------------------------------------------------
6
7         FUNCTION:       Model loop executive
8
9 ----------------------------------------------------------------------------
10
11         MODULE STATUS:  developmental
12
13 ----------------------------------------------------------------------------
14
15         GENEALOGY:      Created 15 October 1992 as part of LaRCSIM project
16                         by Bruce Jackson.
17
18 ----------------------------------------------------------------------------
19
20         DESIGNED BY:    Bruce Jackson
21         
22         CODED BY:       Bruce Jackson
23         
24         MAINTAINED BY:  maintainer
25
26 ----------------------------------------------------------------------------
27
28         MODIFICATION HISTORY:
29         
30         DATE    PURPOSE                                         BY
31
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
35                 is requested.                                   EBJ
36
37         CURRENT RCS HEADER INFO:
38 $Header$
39 $Log$
40 Revision 1.4  2001/09/14 18:47:27  curt
41 More changes in support of UIUCModel.
42
43 Revision 1.3  2000/10/28 14:30:33  curt
44 Updates by Tony working on the FDM interface bus.
45
46 Revision 1.2  2000/04/10 18:09:41  curt
47 David Megginson made a few (mostly minor) mods to the LaRCsim files, and
48 it's now possible to choose the LaRCsim model at runtime, as in
49
50   fgfs --aircraft=c172
51
52 or
53
54   fgfs --aircraft=uiuc --aircraft-dir=Aircraft-uiuc/Boeing747
55
56 I did this so that I could play with the UIUC stuff without losing
57 Tony's C172 with its flaps, etc.  I did my best to respect the design
58 of the LaRCsim code by staying in C, making only minimal changes, and
59 not introducing any dependencies on the rest of FlightGear.  The
60 modified files are attached.
61
62 Revision 1.1.1.1  1999/06/17 18:07:33  curt
63 Start of 0.7.x branch
64
65 Revision 1.1.1.1  1999/04/05 21:32:45  curt
66 Start of 0.6.x branch.
67
68 Revision 1.3  1998/08/06 12:46:39  curt
69 Header change.
70
71 Revision 1.2  1998/01/19 18:40:27  curt
72 Tons of little changes to clean up the code and to remove fatal errors
73 when building with the c++ compiler.
74
75 Revision 1.1  1997/05/29 00:09:58  curt
76 Initial Flight Gear revision.
77
78  * Revision 1.3  1995/03/06  18:49:46  bjax
79  * Added dt and initialize flag parameters to subroutine calls. This will
80  * support trim routine (to allow single throttle setting to drive
81  * all four throttle positions, for example, if initialize is TRUE).
82  *
83  * Revision 1.2  1993/03/10  06:38:09  bjax
84  * Added additional calls: inertias() and subsystems()... EBJ
85  *
86  * Revision 1.1  92/12/30  13:19:08  bjax
87  * Initial revision
88  * 
89
90 ----------------------------------------------------------------------------
91
92         REFERENCES:
93
94 ----------------------------------------------------------------------------
95
96         CALLED BY:      ls_step (in initialization), ls_loop (planned)
97
98 ----------------------------------------------------------------------------
99
100         CALLS TO:       aero(), engine(), gear()
101
102 ----------------------------------------------------------------------------
103
104         INPUTS:
105
106 ----------------------------------------------------------------------------
107
108         OUTPUTS:
109
110 --------------------------------------------------------------------------*/
111 #include "ls_types.h"
112 #include "ls_model.h"
113 #include "default_model_routines.h"
114
115 Model current_model;
116
117
118 void ls_model( SCALAR dt, int Initialize ) {
119     switch (current_model) {
120     case NAVION:
121       inertias( dt, Initialize );
122       subsystems( dt, Initialize );
123       navion_aero( dt, Initialize );
124       navion_engine( dt, Initialize );
125       navion_gear( dt, Initialize );
126       break;
127     case C172:
128       if(Initialize < 0) c172_init();
129       inertias( dt, Initialize );
130       subsystems( dt, Initialize );
131       c172_aero( dt, Initialize );
132       c172_engine( dt, Initialize );
133       c172_gear( dt, Initialize );
134       break;
135     case CHEROKEE:
136       inertias( dt, Initialize );
137       subsystems( dt, Initialize );
138       cherokee_aero( dt, Initialize );
139       cherokee_engine( dt, Initialize );
140       cherokee_gear( dt, Initialize );
141       break;
142     case UIUC:
143       inertias( dt, Initialize );
144       subsystems( dt, Initialize );
145       uiuc_aero( dt, Initialize );
146       uiuc_engine( dt, Initialize );
147       uiuc_gear( dt, Initialize );
148       uiuc_record(dt);
149       break;
150     }
151 }