]> git.mxchange.org Git - flightgear.git/blob - src/FDM/JSBSim/models/flight_control/FGFCSComponent.h
Revert most iostream-related changes to JSBSim
[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 using std::string;
57
58 /*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
59 FORWARD DECLARATIONS
60 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%*/
61
62 namespace JSBSim {
63
64 class FGFCS;
65
66 /*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
67 CLASS DOCUMENTATION
68 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%*/
69
70 /** Base class for JSBSim Flight Control System Components.
71     The Flight Control System (FCS) for JSBSim consists of the FCS container
72     class (see FGFCS), the FGFCSComponent base class, and the
73     component classes from which can be constructed a string, or channel. See:
74
75     - FGSwitch
76     - FGGain
77     - FGKinemat
78     - FGFilter
79     - FGDeadBand
80     - FGSummer
81     - FGSensor
82     - FGFCSFunction
83     - FGPID
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