]> git.mxchange.org Git - flightgear.git/blob - src/FDM/JSBSim/models/flight_control/FGFCSComponent.h
Sync. with JSBSim (CVS) again
[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     - FGAccelerometer
82     - FGGyro
83     - FGActuator
84
85     @author Jon S. Berndt
86     @version $Id$
87     @see Documentation for the FGFCS class, and for the configuration file class
88 */
89
90 /*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
91 CLASS DECLARATION
92 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%*/
93
94 class FGFCSComponent : public FGJSBBase
95 {
96 public:
97   /// Constructor
98   FGFCSComponent(FGFCS* fcs, Element* el);
99   /// Destructor
100   virtual ~FGFCSComponent();
101
102   virtual bool Run(void);
103   virtual void SetOutput(void);
104   inline double GetOutput (void) const {return Output;}
105   inline FGPropertyManager* GetOutputNode(void) { return OutputNode; }
106   inline string GetName(void) const {return Name;}
107   inline string GetType(void) const { return Type; }
108   virtual double GetOutputPct(void) const { return 0; }
109
110 protected:
111   FGFCS* fcs;
112   FGPropertyManager* PropertyManager;
113   FGPropertyManager* treenode;
114   FGPropertyManager* OutputNode;
115   FGPropertyManager* ClipMinPropertyNode;
116   FGPropertyManager* ClipMaxPropertyNode;
117   vector <FGPropertyManager*> InputNodes;
118   vector <float> InputSigns;
119   string Type;
120   string Name;
121   double Input;
122   double Output;
123   double clipmax, clipmin;
124   float clipMinSign, clipMaxSign;
125   bool IsOutput;
126   bool clip;
127
128   void Clip(void);
129   virtual void bind();
130   virtual void Debug(int from);
131 };
132
133 } //namespace JSBSim
134
135 #include "../FGFCS.h"
136
137 #endif
138