]> git.mxchange.org Git - flightgear.git/blob - src/FDM/JSBSim/models/flight_control/FGSummer.h
Update to the latest version of JSBSim which supports Lighter Than Air craft
[flightgear.git] / src / FDM / JSBSim / models / flight_control / FGSummer.h
1 /*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
2
3  Header:       FGSummer.h
4  Author:
5  Date started:
6
7  ------------- Copyright (C)  -------------
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 FGSUMMER_H
34 #define FGSUMMER_H
35
36 /*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
37 INCLUDES
38 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%*/
39
40 #ifdef FGFS
41 #  include <simgear/compiler.h>
42 #  ifdef SG_HAVE_STD_INCLUDES
43 #    include <vector>
44 #  else
45 #    include <vector.h>
46 #  endif
47 #else
48 #  include <vector>
49 #endif
50
51 #include <string>
52 #include "FGFCSComponent.h"
53 #include <input_output/FGXMLElement.h>
54
55 /*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
56 DEFINITIONS
57 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%*/
58
59 #define ID_SUMMER "$Id$"
60
61 /*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
62 FORWARD DECLARATIONS
63 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%*/
64
65 namespace JSBSim {
66
67 /*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
68 CLASS DOCUMENTATION
69 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%*/
70
71 /** Models a flight control system summing component.
72     The Summer component sums two or more inputs. These can be pilot control
73     inputs or state variables, and a bias can also be added in using the BIAS
74     keyword.  The form of the summer component specification is:
75 @code
76     <summer name="{string}">
77       <input> {string} </input>
78       <input> {string} </input>
79       <bias> {number} </bias>
80       <clipto>
81          <min> {number} </min>
82          <max> {number} </max>
83       </clipto>
84       <output> {string} </output>
85     </summer>
86 @endcode
87
88     Note that in the case of an input property the property name may be
89     immediately preceded by a minus sign. Here's an example of a summer
90     component specification:
91
92 @code
93     <summer name="Roll A/P Error summer">
94       <input> velocities/p-rad_sec </input>
95       <input> -fcs/roll-ap-wing-leveler </input>
96       <input> fcs/roll-ap-error-integrator </input>
97       <clipto>
98          <min> -1 </min>
99          <max>  1 </max> 
100       </clipto>
101     </summer>
102 @endcode
103
104 <pre>
105     Notes:
106
107     There can be only one BIAS statement per component.
108
109     There may be any number of inputs.
110 </pre>
111
112     @author Jon S. Berndt
113     @version $Id$
114 */
115
116 /*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
117 CLASS DECLARATION
118 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%*/
119
120 class FGSummer  : public FGFCSComponent
121 {
122 public:
123   /** Constructor.
124       @param fcs a pointer to the parent FGFCS object.
125       @param element a pointer to the configuration file node. */
126   FGSummer(FGFCS* fcs, Element* element);
127   /// Destructor
128   ~FGSummer();
129
130   /// The execution method for this FCS component.
131   bool Run(void);
132
133 private:
134   double Bias;
135   void Debug(int from);
136 };
137 }
138 #endif