JSBSim Flight Dynamics Model  1.2.0 (05 Nov 2023)
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
11  Software Foundation; either version 2 of the License, or (at your option) any
12  later 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
20  with this program; if not, write to the Free Software Foundation, Inc., 59
21  Temple Place - Suite 330, Boston, MA 02111-1307, USA.
22 
23  Further information about the GNU Lesser General Public License can also be
24  found on 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 
43 /*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
44 FORWARD DECLARATIONS
45 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%*/
46 
47 namespace JSBSim {
48 
49 class FGFCS;
50 class Element;
51 
52 /*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
53 CLASS DOCUMENTATION
54 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%*/
55 
80 /*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
81 CLASS DECLARATION
82 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%*/
83 
84 class FGFCSComponent : public FGJSBBase
85 {
86 public:
88  FGFCSComponent(FGFCS* fcs, Element* el);
90  virtual ~FGFCSComponent();
91 
92  virtual bool Run(void) { return true; }
93  virtual void SetOutput(void);
94  double GetOutput (void) const {return Output;}
95  std::string GetName(void) const {return Name;}
96  std::string GetType(void) const { return Type; }
97  virtual double GetOutputPct(void) const { return 0; }
98  virtual void ResetPastStates(void);
99 
100 protected:
101  FGFCS* fcs;
102  std::vector <FGPropertyNode_ptr> OutputNodes;
103  FGParameter_ptr ClipMin, ClipMax;
104  std::vector <FGPropertyValue_ptr> InitNodes;
105  std::vector <FGPropertyValue_ptr> InputNodes;
106  std::vector <double> output_array;
107  std::string Type;
108  std::string Name;
109  double Input;
110  double Output;
111  double delay_time;
112  unsigned int delay;
113  int index;
114  double dt;
115  bool clip, cyclic_clip;
116 
117  void Delay(void);
118  void Clip(void);
119  void CheckInputNodes(size_t MinNodes, size_t MaxNodes, Element* el);
120  virtual void bind(Element* el, FGPropertyManager* pm);
121  virtual void Debug(int from);
122 };
123 
124 } //namespace JSBSim
125 
126 #endif
Base class for JSBSim Flight Control System Components.
virtual ~FGFCSComponent()
Destructor.
FGFCSComponent(FGFCS *fcs, Element *el)
Constructor.
Encapsulates the Flight Control System (FCS) functionality.
Definition: FGFCS.h:189
JSBSim Base class.
Definition: FGJSBBase.h:118