FlightGear next
FGModel.h
Go to the documentation of this file.
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
11 Software Foundation; either version 2 of the License, or (at your option) any
12 later 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
20 with this program; if not, write to the Free Software Foundation, Inc., 59
21 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
22
23 Further information about the GNU Lesser General Public License can also be
24 found on the world wide web at http://www.gnu.org.
25
26HISTORY
27--------------------------------------------------------------------------------
2811/22/98 JSB Created
29
30%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
31SENTRY
32%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%*/
33
34#ifndef FGMODEL_H
35#define FGMODEL_H
36
37/*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
38INCLUDES
39%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%*/
40
41#include <string>
42
44#include "simgear/misc/sg_path.hxx"
45
46/*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
47FORWARD DECLARATIONS
48%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%*/
49
50namespace JSBSim {
51
52class FGFDMExec;
53class Element;
55
56/*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
57CLASS DOCUMENTATION
58%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%*/
59
63
64/*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
65CLASS DECLARATION
66%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%*/
67
69{
70public:
71
73 explicit FGModel(FGFDMExec*);
75 ~FGModel() override;
76
86 virtual bool Run(bool Holding);
87
88 bool InitModel(void) override;
90 void SetRate(unsigned int tt) {rate = tt;}
92 unsigned int GetRate(void) {return rate;}
93 FGFDMExec* GetExec(void) {return FDMExec;}
94
96 virtual SGPath FindFullPathName(const SGPath& path) const;
97 const std::string& GetName(void) { return Name; }
98 virtual bool Load(Element* el) { return true; }
99
100protected:
101 unsigned int exe_ctr;
102 unsigned int rate;
103 std::string Name;
104
112 bool Upload(Element* el, bool preLoad);
113
114 virtual void Debug(int from);
115
118};
119}
120//%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
121#endif
The model functions class provides the capability for loading, storing, and executing arbitrary funct...
unsigned int rate
Definition FGModel.h:102
FGPropertyManager * PropertyManager
Definition FGModel.h:117
bool InitModel(void) override
Definition FGModel.cpp:81
FGFDMExec * FDMExec
Definition FGModel.h:116
void SetRate(unsigned int tt)
Set the ouput rate for the model in frames.
Definition FGModel.h:90
unsigned int GetRate(void)
Get the output rate for the model in frames.
Definition FGModel.h:92
FGFDMExec * GetExec(void)
Definition FGModel.h:93
FGModel(FGFDMExec *)
Constructor.
Definition FGModel.cpp:57
unsigned int exe_ctr
Definition FGModel.h:101
virtual SGPath FindFullPathName(const SGPath &path) const
Definition FGModel.cpp:103
bool Upload(Element *el, bool preLoad)
Uploads this model in memory.
Definition FGModel.cpp:110
virtual bool Load(Element *el)
Definition FGModel.h:98
virtual void Debug(int from)
Definition FGModel.cpp:170
std::string Name
Definition FGModel.h:103
~FGModel() override
Destructor.
Definition FGModel.cpp:74
const std::string & GetName(void)
Definition FGModel.h:97
virtual bool Run(bool Holding)
Runs the model; called by the Executive.
Definition FGModel.cpp:89
void SetPropertyManager(FGPropertyManager *fgpm)
Definition FGModel.h:95