]> git.mxchange.org Git - flightgear.git/blob - src/FDM/JSBSim/models/flight_control/FGSummer.h
Sync w. JSBSim CVS (merge from PRE_OSG_PLIB_20061029 branch)
[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 <pre>
76     \<COMPONENT NAME="name" TYPE="SUMMER">
77       INPUT \<property>
78       INPUT \<property>
79       [BIAS \<value>]
80       [?]
81       [CLIPTO \<min> \<max> 1]
82       [OUTPUT \<property>]
83     \</COMPONENT>
84 </pre>
85     Note that in the case of an input property the property name may be
86     immediately preceded by a minus sign. Here's an example of a summer
87     component specification:
88 <pre>
89     \<COMPONENT NAME="Roll A/P Error summer" TYPE="SUMMER">
90       INPUT  velocities/p-rad_sec
91       INPUT -fcs/roll-ap-wing-leveler
92       INPUT  fcs/roll-ap-error-integrator
93       CLIPTO -1 1
94     \</COMPONENT>
95 </pre>
96     Note that there can be only one BIAS statement per component.
97
98     @author Jon S. Berndt
99     @version $Id$
100 */
101
102 /*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
103 CLASS DECLARATION
104 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%*/
105
106 class FGSummer  : public FGFCSComponent
107 {
108 public:
109   /** Constructor.
110       @param fcs a pointer to the parent FGFCS object.
111       @param AC_cfg a pointer to the configuration file object. */
112   FGSummer(FGFCS* fcs, Element* element);
113   /// Destructor
114   ~FGSummer();
115
116   /// The execution method for this FCS component.
117   bool Run(void);
118
119 private:
120   double Bias;
121   void Debug(int from);
122 };
123 }
124 #endif