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