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