]> git.mxchange.org Git - flightgear.git/blob - src/FDM/JSBSim/models/flight_control/FGFCSFunction.h
Sync. w. JSB CVS as of 15/01/2007
[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. The function component is defined as follows:
68
69 @code
70 <fcs_function name="Windup Trigger">
71   [<input> [-]property </input>]
72   <function>
73     \85
74   </function>
75   [<clipto>
76     <min> {[-]property name | value} </min>
77     <max> {[-]property name | value} </max>
78   </clipto>]
79   [<output> {property} </output>]
80 </ fcs_function >
81 @endcode
82
83 The function definition itself can include a nested series of products, sums,
84 quotients, etc. as well as trig and other math functions. Here\92s an example of
85 a function (from an aero specification):
86
87 @code
88 <function name="aero/coefficient/CDo">
89     <description>Drag_at_zero_lift</description>
90     <product>
91         <property>aero/qbar-psf</property>
92         <property>metrics/Sw-sqft</property>
93         <table>
94             <independentVar>velocities/mach</independentVar>
95             <tableData>
96                 0.0000  0.0220
97                 0.2000  0.0200
98                 0.6500  0.0220
99                 0.9000  0.0240
100                 0.9700  0.0500
101             </tableData>
102         </table>
103     </product>
104 </function>
105 @endcode
106     @version $Id$
107 */
108
109 /*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
110 CLASS DECLARATION
111 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%*/
112
113 class FGFCSFunction  : public FGFCSComponent
114 {
115 public:
116   FGFCSFunction(FGFCS* fcs, Element* element);
117   ~FGFCSFunction();
118
119   bool Run(void);
120
121 private:
122   FGFunction* function;
123
124   void Debug(int from);
125 };
126 }
127 //%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
128
129 #endif