JSBSim Flight Dynamics Model  1.1.11 (13 Feb 2022)
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  FGPropertyManager* PropertyManager;
103  std::vector <FGPropertyNode_ptr> OutputNodes;
104  FGParameter_ptr ClipMin, ClipMax;
105  std::vector <FGPropertyValue_ptr> InitNodes;
106  std::vector <FGPropertyValue_ptr> InputNodes;
107  std::vector <double> output_array;
108  std::string Type;
109  std::string Name;
110  double Input;
111  double Output;
112  double delay_time;
113  unsigned int delay;
114  int index;
115  double dt;
116  bool clip, cyclic_clip;
117 
118  void Delay(void);
119  void Clip(void);
120  void CheckInputNodes(size_t MinNodes, size_t MaxNodes, Element* el);
121  virtual void bind(Element* el);
122  virtual void Debug(int from);
123 };
124 
125 } //namespace JSBSim
126 
127 #endif
JSBSim::FGFCSComponent
Base class for JSBSim Flight Control System Components.
Definition: FGFCSComponent.h:84
JSBSim::FGJSBBase
JSBSim Base class.
Definition: FGJSBBase.h:78
JSBSim::FGFCSComponent::~FGFCSComponent
virtual ~FGFCSComponent()
Destructor.
Definition: FGFCSComponent.cpp:199
JSBSim::FGFCS
Encapsulates the Flight Control System (FCS) functionality.
Definition: FGFCS.h:187
JSBSim::FGFCSComponent::FGFCSComponent
FGFCSComponent(FGFCS *fcs, Element *el)
Constructor.
Definition: FGFCSComponent.cpp:52
JSBSim::FGPropertyManager
Definition: FGPropertyManager.h:373
JSBSim::Element
Definition: FGXMLElement.h:143