]> git.mxchange.org Git - flightgear.git/blob - src/FDM/JSBSim/models/flight_control/FGFCSFunction.h
latest changes for JSBSim (1.0 prerelease)
[flightgear.git] / src / FDM / JSBSim / models / flight_control / FGFCSFunction.h
1 /*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
2
3  Header:       FGFCSFunction.h
4  Author:       Jon Berndt
5  Date started: 2005
6
7  ------------- Copyright (C) 2005 Jon S. Berndt -------------
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
29 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
30 SENTRY
31 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%*/
32
33 #ifndef FGFCSFUNCTION_H
34 #define FGFCSFUNCTION_H
35
36 /*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
37 INCLUDES
38 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%*/
39
40 #include "FGFCSComponent.h"
41 #include <input_output/FGXMLElement.h>
42 #include <math/FGFunction.h>
43
44 /*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
45 DEFINITIONS
46 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%*/
47
48 #define ID_FCSFUNCTION "$Id$"
49
50 /*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
51 FORWARD DECLARATIONS
52 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%*/
53
54 namespace JSBSim {
55
56 class FGFCS;
57
58 /*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
59 CLASS DOCUMENTATION
60 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%*/
61
62 /** Models a FCSFunction object.
63     @author Jon S. Berndt
64
65 One of the most recent additions to the FCS component set is the FCS Function
66 component. This component allows a function to be created when no other component
67 is suitable. Available mathematical operations are described in the FGFunction class.  
68 The function component is defined as follows:
69
70 @code
71 <fcs_function name="Windup Trigger">
72   [<input> [-]property </input>]
73   <function>
74     ...
75   </function>
76   [<clipto>
77     <min> {[-]property name | value} </min>
78     <max> {[-]property name | value} </max>
79   </clipto>]
80   [<output> {property} </output>]
81 </ fcs_function >
82 @endcode
83
84 The function definition itself can include a nested series of products, sums,
85 quotients, etc. as well as trig and other math functions. Here's an example of
86 a function (from an aero specification):
87
88 @code
89 <function name="aero/coefficient/CDo">
90     <description>Drag_at_zero_lift</description>
91     <product>
92         <property>aero/qbar-psf</property>
93         <property>metrics/Sw-sqft</property>
94         <table>
95             <independentVar>velocities/mach</independentVar>
96             <tableData>
97                 0.0000  0.0220
98                 0.2000  0.0200
99                 0.6500  0.0220
100                 0.9000  0.0240
101                 0.9700  0.0500
102             </tableData>
103         </table>
104     </product>
105 </function>
106 @endcode
107
108     @version $Id$
109 */
110
111 /*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
112 CLASS DECLARATION
113 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%*/
114
115 class FGFCSFunction  : public FGFCSComponent
116 {
117 public:
118   FGFCSFunction(FGFCS* fcs, Element* element);
119   ~FGFCSFunction();
120
121   bool Run(void);
122
123 private:
124   FGFunction* function;
125
126   void Debug(int from);
127 };
128 }
129 //%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
130
131 #endif