]> git.mxchange.org Git - flightgear.git/blob - src/FDM/JSBSim/models/flight_control/FGFCSComponent.h
Sync. with JSBSim CVS (header cleanups).
[flightgear.git] / src / FDM / JSBSim / models / flight_control / FGFCSComponent.h
1 /*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
2
3  Header:       FGFCSComponent.h
4  Author:       Jon S. Berndt
5  Date started: 05/01/2000
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 FGFCSCOMPONENT_H
34 #define FGFCSCOMPONENT_H
35
36 /*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
37 INCLUDES
38 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%*/
39
40 #include <FGJSBBase.h>
41 #include <input_output/FGPropertyManager.h>
42 #include <input_output/FGXMLElement.h>
43 #include <string>
44 #include <vector>
45
46 /*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
47 DEFINITIONS
48 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%*/
49
50 #define ID_FCSCOMPONENT "$Id$"
51
52 using std::string;
53 using std::vector;
54
55 /*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
56 FORWARD DECLARATIONS
57 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%*/
58
59 namespace JSBSim {
60
61 class FGFCS;
62
63 /*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
64 CLASS DOCUMENTATION
65 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%*/
66
67 /** Base class for JSBSim Flight Control System Components.
68     The Flight Control System (FCS) for JSBSim consists of the FCS container
69     class (see FGFCS), the FGFCSComponent base class, and the
70     component classes from which can be constructed a string, or channel. See:
71
72     - FGSwitch
73     - FGGain
74     - FGKinemat
75     - FGFilter
76     - FGDeadBand
77     - FGSummer
78     - FGSensor
79     - FGFCSFunction
80     - FGPID
81
82     @author Jon S. Berndt
83     @version $Id$
84     @see Documentation for the FGFCS class, and for the configuration file class
85 */
86
87 /*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
88 CLASS DECLARATION
89 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%*/
90
91 class FGFCSComponent : public FGJSBBase
92 {
93 public:
94   /// Constructor
95   FGFCSComponent(FGFCS* fcs, Element* el);
96   /// Destructor
97   virtual ~FGFCSComponent();
98
99   virtual bool Run(void);
100   virtual void SetOutput(void);
101   inline double GetOutput (void) const {return Output;}
102   inline FGPropertyManager* GetOutputNode(void) { return OutputNode; }
103   inline string GetName(void) const {return Name;}
104   inline string GetType(void) const { return Type; }
105   virtual double GetOutputPct(void) const { return 0; }
106
107 protected:
108   FGFCS* fcs;
109   FGPropertyManager* PropertyManager;
110   FGPropertyManager* treenode;
111   FGPropertyManager* OutputNode;
112   FGPropertyManager* ClipMinPropertyNode;
113   FGPropertyManager* ClipMaxPropertyNode;
114   vector <FGPropertyManager*> InputNodes;
115   vector <float> InputSigns;
116   string Type;
117   string Name;
118   double Input;
119   double Output;
120   double clipmax, clipmin;
121   float clipMinSign, clipMaxSign;
122   bool IsOutput;
123   bool clip;
124
125   void Clip(void);
126   virtual void bind();
127   virtual void Debug(int from);
128 };
129
130 } //namespace JSBSim
131
132 #include "../FGFCS.h"
133
134 #endif
135