]> git.mxchange.org Git - flightgear.git/blob - src/FDM/JSBSim/filtersjb/FGFCSComponent.h
Initial revision.
[flightgear.git] / src / FDM / JSBSim / filtersjb / 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 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 General Public License for more
17  details.
18
19  You should have received a copy of the GNU 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 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 #ifdef FGFS
41 #  include <simgear/compiler.h>
42 #endif
43
44 #include <string>
45 #include <vector>
46 #include "../FGJSBBase.h"
47 #include "../FGPropertyManager.h"
48
49
50 /*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
51 DEFINITIONS
52 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%*/
53
54 #define ID_FCSCOMPONENT "$Id$"
55
56 using std::string;
57
58 /*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
59 FORWARD DECLARATIONS
60 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%*/
61
62 namespace JSBSim {
63
64 class FGFCS;
65
66 /*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
67 COMMENTS, REFERENCES, and NOTES [use "class documentation" below for API docs]
68 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%*/
69
70 /*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
71 CLASS DOCUMENTATION
72 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%*/
73
74 /** Base class for JSBSim Flight Control System Components.
75     The Flight Control System (FCS) for JSBSim consists of the FCS container
76     class (see \URL[FGFCS]{FGFCS.html}), the FGFCSComponent base class, and the
77     component classes from which can be constructed a string, or channel. See:
78     <ul>
79     <li>\URL[Switch Component]{FGSwitch.html}</li>
80     <li>\URL[Gain Component]{FGGain.html}</li>
81     <li>\URL[Flaps Component]{FGFlaps.html}</li>
82     <li>\URL[Filter Component]{FGFilter.html}</li>
83     <li>\URL[Deadband Component]{FGDeadBand.html}</li>
84     <li>\URL[Summer Component]{FGSummer.html}</li>
85     <li>\URL[Gradient Component]{FGGradient.html}</li>
86     </ul>
87     @author Jon S. Berndt
88     @version $Id$
89     @see Documentation for the FGFCS class, and for the configuration file class
90          FGConfigFile.
91 */
92
93 /*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
94 CLASS DECLARATION
95 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%*/
96
97 class FGFCSComponent : public FGJSBBase
98 {
99 public:
100   /// Constructor
101   FGFCSComponent(FGFCS*);
102   /// Destructor
103   virtual ~FGFCSComponent();
104
105   virtual bool Run(void);
106   virtual void SetOutput(void);
107   inline double GetOutput (void) const {return Output;}
108   inline FGPropertyManager* GetOutputNode(void) { return OutputNode; }
109   inline string GetName(void) const {return Name;}
110   inline string GetType(void) const { return Type; }
111   virtual double GetOutputPct(void) const { return 0; }
112   
113   virtual void bind();
114   FGPropertyManager* resolveSymbol(string token);
115   
116 protected:
117    /// Pilot/Aircraft, FCS, Autopilot inputs
118   enum eInputType {itPilotAC, itFCS, itAP, itBias} InputType;
119   FGFCS* fcs;
120   FGPropertyManager* PropertyManager;
121   FGPropertyManager* treenode;
122   string Type;
123   string Name;
124   vector <FGPropertyManager*> InputNodes;
125   double Input;
126   FGPropertyManager* OutputNode;
127   double Output;
128   bool IsOutput;
129   virtual void Debug(int from);
130 };
131 }
132 #include "../FGFCS.h"
133
134 #endif
135