JSBSim Flight Dynamics Model 1.3.3 (16 Oct 2026)
An Open Source Flight Dynamics and Control Software Library in C++
Loading...
Searching...
No Matches
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
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#include <memory>
43
44#include "math/FGModelFunctions.h"
45#include "simgear/misc/sg_path.hxx"
46
47/*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
48FORWARD DECLARATIONS
49%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%*/
50
51namespace JSBSim {
52
53class FGFDMExec;
54class Element;
55class FGPropertyManager;
56
57/*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
58CLASS DOCUMENTATION
59%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%*/
60
74/*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
75CLASS DECLARATION
76%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%*/
77
78class JSBSIM_API FGModel : public FGModelFunctions
79{
80public:
81
85 FGModel(FGFDMExec*, const std::string& name);
87 ~FGModel() override;
88
98 virtual bool Run(bool Holding);
99
100 bool InitModel(void) override;
102 void SetRate(unsigned int tt) {rate = tt;}
104 unsigned int GetRate(void) const { return rate; }
105 FGFDMExec* GetExec(void) const { return FDMExec; }
106
107 void SetPropertyManager(std::shared_ptr<FGPropertyManager> fgpm) { PropertyManager=fgpm;}
108 virtual SGPath FindFullPathName(const SGPath& path) const;
109 const std::string& GetName(void) const { return Name; }
110 virtual bool Load(Element* el) { return true; }
111
112protected:
113 unsigned int exe_ctr;
114 unsigned int rate;
115 bool enabled = true;
116 std::string Name;
117
125 bool Upload(Element* el, bool preLoad);
126
127 virtual void Debug(int from);
128
129 FGFDMExec* FDMExec;
130 std::shared_ptr<FGPropertyManager> PropertyManager;
131};
132}
133//%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
134#endif
Encapsulates the JSBSim simulation executive.
Definition FGFDMExec.h:185
The model functions class provides the capability for loading, storing, and executing arbitrary funct...
Base class for all scheduled JSBSim models.
Definition FGModel.h:79
void SetRate(unsigned int tt)
Set the ouput rate for the model in frames.
Definition FGModel.h:102
unsigned int GetRate(void) const
Get the output rate for the model in frames.
Definition FGModel.h:104
Main namespace for the JSBSim Flight Dynamics Model.
Definition FGFDMExec.cpp:73