]> git.mxchange.org Git - flightgear.git/blob - src/FDM/JSBSim/FGModel.h
Latest JSBSim changes, including a kludge from Tony to keep the
[flightgear.git] / src / FDM / JSBSim / FGModel.h
1 /*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
2
3  Header:       FGModel.h
4  Author:       Jon Berndt
5  Date started: 11/21/98
6
7  ------------- Copyright (C) 1999  Jon S. Berndt (jsb@hal-pc.org) -------------
8
9  This program is free software; you can redistribute it and/or modify it under
10  the terms of the GNU General Public License as published by the Free Software
11  Foundation; either version 2 of the License, or (at your option) any later
12  version.
13
14  This program is distributed in the hope that it will be useful, but WITHOUT
15  ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
16  FOR A PARTICULAR PURPOSE.  See the GNU General Public License for more
17  details.
18
19  You should have received a copy of the GNU General Public License along with
20  this program; if not, write to the Free Software Foundation, Inc., 59 Temple
21  Place - Suite 330, Boston, MA  02111-1307, USA.
22
23  Further information about the GNU General Public License can also be found on
24  the world wide web at http://www.gnu.org.
25
26 HISTORY
27 --------------------------------------------------------------------------------
28 11/22/98   JSB   Created
29
30 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
31 SENTRY
32 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%*/
33
34 #ifndef FGMODEL_H
35 #define FGMODEL_H
36
37 /*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
38 INCLUDES
39 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%*/
40
41 #include "FGJSBBase.h"
42
43 #ifdef FGFS
44 #  include <simgear/compiler.h>
45 #  ifdef SG_HAVE_STD_INCLUDES
46 #    include <iostream>
47 #  else
48 #    include <iostream.h>
49 #  endif
50 #else
51 #  if defined(sgi) && !defined(__GNUC__)
52 #    include <iostream.h>
53 #  else
54 #    include <iostream>
55 #  endif
56 #endif
57
58 #include <string>
59
60 #define ID_MODEL "$Id$"
61
62 /*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
63 DEFINITIONS
64 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%*/
65
66 using namespace std;
67
68 /*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
69 FORWARD DECLARATIONS
70 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%*/
71
72 class FGFDMExec;
73 class FGState;
74 class FGAtmosphere;
75 class FGFCS;
76 class FGPropulsion;
77 class FGMassBalance;
78 class FGAerodynamics;
79 class FGInertial;
80 class FGGroundReactions;
81 class FGAircraft;
82 class FGTranslation;
83 class FGRotation;
84 class FGPosition;
85 class FGAuxiliary;
86 class FGOutput;
87 class FGConfigFile;
88
89 /*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
90 COMMENTS, REFERENCES, and NOTES [use "class documentation" below for API docs]
91 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%*/
92
93 /*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
94 CLASS DOCUMENTATION
95 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%*/
96
97 /** Base class for all scheduled JSBSim models
98     @author Jon S. Berndt
99   */
100
101 /*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
102 CLASS DECLARATION
103 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%*/
104
105 class FGModel : public FGJSBBase
106 {
107 public:
108
109   /// Constructor
110   FGModel(FGFDMExec*);
111   /// Destructor
112   virtual ~FGModel();
113
114   /** Loads this model.
115       @param Config a pointer to the config file instance
116       @return true if model is successfully loaded*/
117   virtual bool Load(FGConfigFile* Config) {return true;}
118  
119   FGModel* NextModel;
120   string Name;
121
122   /** Runs the model; called by the Executive
123       @see JSBSim.cpp documentation
124       @return false if no error */
125   virtual bool Run(void);
126   virtual bool InitModel(void);
127   virtual void SetRate(int tt) {rate = tt;}
128   virtual int  GetRate(void)   {return rate;}
129
130 protected:
131   int exe_ctr;
132   int rate;
133   
134   virtual void Debug(int from);
135
136   FGFDMExec*         FDMExec;
137   FGState*           State;
138   FGAtmosphere*      Atmosphere;
139   FGFCS*             FCS;
140   FGPropulsion*      Propulsion;
141   FGMassBalance*     MassBalance;
142   FGAerodynamics*    Aerodynamics;
143   FGInertial*        Inertial;
144   FGGroundReactions* GroundReactions;
145   FGAircraft*        Aircraft;
146   FGTranslation*     Translation;
147   FGRotation*        Rotation;
148   FGPosition*        Position;
149   FGAuxiliary*       Auxiliary;
150   FGOutput*          Output;
151 };
152
153 //%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
154 #endif
155