JSBSim Flight Dynamics Model  1.0 (02 March 2017)
An Open Source Flight Dynamics and Control Software Library in C++
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 (jon@jsbsim.org) -------------
8 
9  This program is free software; you can redistribute it and/or modify it under
10  the terms of the GNU Lesser 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 Lesser General Public License for more
17  details.
18 
19  You should have received a copy of the GNU Lesser 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 Lesser 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 <string>
42 
43 #include "math/FGModelFunctions.h"
44 #include "simgear/misc/sg_path.hxx"
45 
46 /*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
47 DEFINITIONS
48 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%*/
49 
50 #define ID_MODEL "$Id: FGModel.h,v 1.26 2017/02/25 14:23:19 bcoconni Exp $"
51 
52 /*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
53 FORWARD DECLARATIONS
54 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%*/
55 
56 namespace JSBSim {
57 
58 class FGFDMExec;
59 class Element;
60 class FGPropertyManager;
61 
62 /*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
63 CLASS DOCUMENTATION
64 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%*/
65 
70 /*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
71 CLASS DECLARATION
72 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%*/
73 
74 class FGModel : public FGModelFunctions
75 {
76 public:
77 
81  virtual ~FGModel();
82 
83  std::string Name;
84 
94  virtual bool Run(bool Holding);
95 
96  virtual bool InitModel(void);
98  void SetRate(unsigned int tt) {rate = tt;}
100  unsigned int GetRate(void) {return rate;}
101  FGFDMExec* GetExec(void) {return FDMExec;}
102 
103  void SetPropertyManager(FGPropertyManager *fgpm) { PropertyManager=fgpm;}
104  virtual SGPath FindFullPathName(const SGPath& path) const;
105 
106 protected:
107  unsigned int exe_ctr;
108  unsigned int rate;
109 
113  virtual bool Load(Element* el);
114 
115  virtual void Debug(int from);
116 
117  FGFDMExec* FDMExec;
118  FGPropertyManager* PropertyManager;
119 };
120 }
121 //%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
122 #endif
FGModel(FGFDMExec *)
Constructor.
Definition: FGModel.cpp:60
virtual bool Run(bool Holding)
Runs the model; called by the Executive.
Definition: FGModel.cpp:92
void SetRate(unsigned int tt)
Set the ouput rate for the model in frames.
Definition: FGModel.h:98
Base class for all scheduled JSBSim models.
Definition: FGModel.h:74
unsigned int GetRate(void)
Get the output rate for the model in frames.
Definition: FGModel.h:100
virtual ~FGModel()
Destructor.
Definition: FGModel.cpp:77
Encapsulates the JSBSim simulation executive.
Definition: FGFDMExec.h:189
virtual bool Load(Element *el)
Loads this model.
Definition: FGModel.cpp:113
The model functions class provides the capability for loading, storing, and executing arbitrary funct...