JSBSim Flight Dynamics Model  1.1.11 (13 Feb 2022)
An Open Source Flight Dynamics and Control Software Library in C++
FGModelFunctions.h
1 /*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
2 
3 Header: FGModelFunctions.h
4 Author: Jon Berndt
5 Date started: August 2010
6 
7  ------------- Copyright (C) 2010 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 
26 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
27 SENTRY
28 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%*/
29 
30 #ifndef FGMODELFUNCTIONS_H
31 #define FGMODELFUNCTIONS_H
32 
33 /*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
34 INCLUDES
35 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%*/
36 
37 #include "FGJSBBase.h"
38 #include "input_output/FGPropertyReader.h"
39 
40 /*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
41 FORWARD DECLARATIONS
42 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%*/
43 
44 namespace JSBSim {
45 
46 class FGFunction;
47 class Element;
48 class FGPropertyManager;
49 class FGFDMExec;
50 
51 /*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
52 CLASS DOCUMENTATION
53 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%*/
54 
68 /*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
69 DECLARATION: FGModelFunctions
70 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%*/
71 
73 {
74 public:
75  virtual ~FGModelFunctions();
76  void RunPreFunctions(void);
77  void RunPostFunctions(void);
78  bool Load(Element* el, FGFDMExec* fdmex, std::string prefix="");
79  void PreLoad(Element* el, FGFDMExec* fdmex, std::string prefix="");
80  void PostLoad(Element* el, FGFDMExec* fdmex, std::string prefix="");
81 
85  std::string GetFunctionStrings(const std::string& delimeter) const;
86 
91  std::string GetFunctionValues(const std::string& delimeter) const;
92 
97  FGFunction* GetPreFunction(const std::string& name);
98 
99 protected:
100  std::vector <FGFunction*> PreFunctions;
101  std::vector <FGFunction*> PostFunctions;
102  FGPropertyReader LocalProperties;
103 
104  virtual bool InitModel(void);
105 };
106 
107 } // namespace JSBSim
108 
109 #endif
JSBSim::FGFDMExec
Encapsulates the JSBSim simulation executive.
Definition: FGFDMExec.h:185
JSBSim::FGPropertyReader
Definition: FGPropertyReader.h:62
JSBSim::FGFunction
Represents a mathematical function.
Definition: FGFunction.h:752
JSBSim::FGModelFunctions::GetFunctionValues
std::string GetFunctionValues(const std::string &delimeter) const
Gets the function values.
Definition: FGModelFunctions.cpp:176
JSBSim::FGModelFunctions
The model functions class provides the capability for loading, storing, and executing arbitrary funct...
Definition: FGModelFunctions.h:72
JSBSim::FGJSBBase
JSBSim Base class.
Definition: FGJSBBase.h:78
JSBSim::FGModelFunctions::GetFunctionStrings
std::string GetFunctionStrings(const std::string &delimeter) const
Gets the strings for the current set of functions.
Definition: FGModelFunctions.cpp:153
JSBSim::Element
Definition: FGXMLElement.h:143
JSBSim::FGModelFunctions::GetPreFunction
FGFunction * GetPreFunction(const std::string &name)
Get one of the "pre" function.
Definition: FGModelFunctions.cpp:141