]> git.mxchange.org Git - flightgear.git/blob - src/FDM/JSBSim/models/flight_control/FGFCSComponent.h
Merge branch 'next' of git://gitorious.org/fg/flightgear into next
[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 "math/FGPropertyValue.h"
42 #include <string>
43 #include <vector>
44
45 /*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
46 DEFINITIONS
47 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%*/
48
49 #define ID_FCSCOMPONENT "$Id: FGFCSComponent.h,v 1.20 2011/06/16 03:39:38 jberndt Exp $"
50
51 /*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
52 FORWARD DECLARATIONS
53 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%*/
54
55 namespace JSBSim {
56
57 class FGFCS;
58 class FGPropertyManager;
59 class Element;
60
61 /*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
62 CLASS DOCUMENTATION
63 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%*/
64
65 /** Base class for JSBSim Flight Control System Components.
66     The Flight Control System (FCS) for JSBSim consists of the FCS container
67     class (see FGFCS), the FGFCSComponent base class, and the
68     component classes from which can be constructed a string, or channel. See:
69
70     - FGSwitch
71     - FGGain
72     - FGKinemat
73     - FGFilter
74     - FGDeadBand
75     - FGSummer
76     - FGSensor
77     - FGFCSFunction
78     - FGPID
79     - FGAccelerometer
80     - FGGyro
81     - FGActuator
82
83     @author Jon S. Berndt
84     @version $Id: FGFCSComponent.h,v 1.20 2011/06/16 03:39:38 jberndt Exp $
85     @see Documentation for the FGFCS class, and for the configuration file class
86 */
87
88 /*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
89 CLASS DECLARATION
90 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%*/
91
92 class FGFCSComponent : public FGJSBBase
93 {
94 public:
95   /// Constructor
96   FGFCSComponent(FGFCS* fcs, Element* el);
97   /// Destructor
98   virtual ~FGFCSComponent();
99
100   virtual bool Run(void);
101   virtual void SetOutput(void);
102   double GetOutput (void) const {return Output;}
103   std::string GetName(void) const {return Name;}
104   std::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   std::vector <FGPropertyManager*> OutputNodes;
112   FGPropertyManager* ClipMinPropertyNode;
113   FGPropertyManager* ClipMaxPropertyNode;
114   std::vector <FGPropertyValue*> InputNodes;
115   std::vector <std::string> InputNames;
116   std::vector <float> InputSigns;
117   std::vector <double> output_array;
118   std::string Type;
119   std::string Name;
120   double Input;
121   double Output;
122   double clipmax, clipmin;
123   double delay_time;
124   unsigned int delay;
125   int index;
126   float clipMinSign, clipMaxSign;
127   double dt;
128   bool IsOutput;
129   bool clip;
130
131   void Delay(void);
132   void Clip(void);
133   virtual void bind();
134   virtual void Debug(int from);
135 };
136
137 } //namespace JSBSim
138
139 #include "../FGFCS.h"
140
141 #endif
142