JSBSim Flight Dynamics Model  1.0 (02 March 2017)
An Open Source Flight Dynamics and Control Software Library in C++
FGFCSComponent.h
1 /*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
2 
3  Header: FGFCSComponent.h
4  Author: Jon S. Berndt
5  Date started: 05/01/2000
6 
7  ------------- Copyright (C) 2000 Jon S. Berndt (jon@jsbsim.org) -------------
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 <string>
41 #include <vector>
42 
43 #include "FGJSBBase.h"
44 #include "math/FGPropertyValue.h"
45 
46 /*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
47 DEFINITIONS
48 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%*/
49 
50 #define ID_FCSCOMPONENT "$Id: FGFCSComponent.h,v 1.28 2016/02/27 16:54:16 bcoconni Exp $"
51 
52 /*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
53 FORWARD DECLARATIONS
54 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%*/
55 
56 namespace JSBSim {
57 
58 class FGFCS;
59 class Element;
60 
61 /*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
62 CLASS DOCUMENTATION
63 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%*/
64 
90 /*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
91 CLASS DECLARATION
92 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%*/
93 
94 class FGFCSComponent : public FGJSBBase
95 {
96 public:
98  FGFCSComponent(FGFCS* fcs, Element* el);
100  virtual ~FGFCSComponent();
101 
102  virtual bool Run(void) { return true; }
103  virtual void SetOutput(void);
104  void SetDtForFrameCount(int FrameCount);
105  double GetOutput (void) const {return Output;}
106  std::string GetName(void) const {return Name;}
107  std::string GetType(void) const { return Type; }
108  virtual double GetOutputPct(void) const { return 0; }
109  virtual void ResetPastStates(void);
110 
111 protected:
112  FGFCS* fcs;
113  FGPropertyManager* PropertyManager;
114  FGPropertyNode_ptr treenode;
115  std::vector <FGPropertyNode_ptr> OutputNodes;
116  FGPropertyNode_ptr ClipMinPropertyNode;
117  FGPropertyNode_ptr ClipMaxPropertyNode;
118  std::vector <FGPropertyValue*> InitNodes;
119  std::vector <std::string> InitNames;
120  std::vector <float> InitSigns;
121  std::vector <FGPropertyValue*> InputNodes;
122  std::vector <std::string> InputNames;
123  std::vector <float> InputSigns;
124  std::vector <double> output_array;
125  std::string Type;
126  std::string Name;
127  double Input;
128  double Output;
129  double clipmax, clipmin;
130  double delay_time;
131  unsigned int delay;
132  int index;
133  float clipMinSign, clipMaxSign;
134  double dt;
135  bool IsOutput;
136  bool clip;
137 
138  void Delay(void);
139  void Clip(void);
140  virtual void bind();
141  virtual void Debug(int from);
142 };
143 
144 } //namespace JSBSim
145 
146 #endif
virtual ~FGFCSComponent()
Destructor.
JSBSim Base class.
Definition: FGJSBBase.h:80
Encapsulates the Flight Control System (FCS) functionality.
Definition: FGFCS.h:193
Base class for JSBSim Flight Control System Components.
FGFCSComponent(FGFCS *fcs, Element *el)
Constructor.