]> git.mxchange.org Git - flightgear.git/blob - src/FDM/JSBSim/models/flight_control/FGFCSComponent.h
Merge branch 'jmt/dialog'
[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 <string>
42 #include <vector>
43
44 /*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
45 DEFINITIONS
46 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%*/
47
48 #define ID_FCSCOMPONENT "$Id$"
49
50 /*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
51 FORWARD DECLARATIONS
52 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%*/
53
54 namespace JSBSim {
55
56 class FGFCS;
57 class FGPropertyManager;
58 class Element;
59
60 /*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
61 CLASS DOCUMENTATION
62 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%*/
63
64 /** Base class for JSBSim Flight Control System Components.
65     The Flight Control System (FCS) for JSBSim consists of the FCS container
66     class (see FGFCS), the FGFCSComponent base class, and the
67     component classes from which can be constructed a string, or channel. See:
68
69     - FGSwitch
70     - FGGain
71     - FGKinemat
72     - FGFilter
73     - FGDeadBand
74     - FGSummer
75     - FGSensor
76     - FGFCSFunction
77     - FGPID
78     - FGAccelerometer
79     - FGGyro
80     - FGActuator
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   double GetOutput (void) const {return Output;}
102   std::string GetName(void) const {return Name;}
103   std::string GetType(void) const { return Type; }
104   virtual double GetOutputPct(void) const { return 0; }
105
106 protected:
107   FGFCS* fcs;
108   FGPropertyManager* PropertyManager;
109   FGPropertyManager* treenode;
110   std::vector <FGPropertyManager*> OutputNodes;
111   FGPropertyManager* ClipMinPropertyNode;
112   FGPropertyManager* ClipMaxPropertyNode;
113   std::vector <FGPropertyManager*> InputNodes;
114   std::vector <float> InputSigns;
115   std::vector <double> output_array;
116   std::string Type;
117   std::string Name;
118   double Input;
119   double Output;
120   double clipmax, clipmin;
121   int delay;
122   int index;
123   float clipMinSign, clipMaxSign;
124   double dt;
125   bool IsOutput;
126   bool clip;
127
128   void Delay(void);
129   void Clip(void);
130   virtual void bind();
131   virtual void Debug(int from);
132 };
133
134 } //namespace JSBSim
135
136 #include "../FGFCS.h"
137
138 #endif
139