FlightGear next
FGFCSComponent.h
Go to the documentation of this file.
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
26HISTORY
27--------------------------------------------------------------------------------
28
29%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
30SENTRY
31%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%*/
32
33#ifndef FGFCSCOMPONENT_H
34#define FGFCSCOMPONENT_H
35
36/*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
37INCLUDES
38%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%*/
39
40#include "FGJSBBase.h"
42
43/*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
44FORWARD DECLARATIONS
45%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%*/
46
47namespace JSBSim {
48
49class FGFCS;
50class Element;
51
52/*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
53CLASS DOCUMENTATION
54%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%*/
55
79
80/*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
81CLASS DECLARATION
82%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%*/
83
85{
86public:
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
100protected:
103 std::vector <FGPropertyNode_ptr> OutputNodes;
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;
113 unsigned int delay;
114 int index;
115 double dt;
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
virtual double GetOutputPct(void) const
FGFCSComponent(FGFCS *fcs, Element *el)
Constructor.
std::vector< FGPropertyValue_ptr > InitNodes
std::vector< FGPropertyValue_ptr > InputNodes
void CheckInputNodes(size_t MinNodes, size_t MaxNodes, Element *el)
double GetOutput(void) const
std::string GetType(void) const
virtual void Debug(int from)
virtual ~FGFCSComponent()
Destructor.
std::vector< double > output_array
FGParameter_ptr ClipMax
virtual void ResetPastStates(void)
FGPropertyManager * PropertyManager
std::string GetName(void) const
virtual void bind(Element *el)
virtual bool Run(void)
FGParameter_ptr ClipMin
virtual void SetOutput(void)
std::vector< FGPropertyNode_ptr > OutputNodes
FGJSBBase()
Constructor for FGJSBBase.
Definition FGJSBBase.h:81
SGSharedPtr< FGParameter > FGParameter_ptr
Definition FGParameter.h:70