FlightGear
next
FGFilter.h
Go to the documentation of this file.
1
/*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
2
3
Header: FGFilter.h
4
Author: Jon S. Berndt
5
Date started: 4/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 FGFILTER_H
34
#define FGFILTER_H
35
36
/*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
37
INCLUDES
38
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%*/
39
40
#include "
FGFCSComponent.h
"
41
42
/*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
43
FORWARD DECLARATIONS
44
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%*/
45
46
namespace
JSBSim
{
47
48
class
Element
;
49
class
FGPropertyManager
;
50
class
FGFCS
;
51
52
/*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
53
CLASS DOCUMENTATION
54
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%*/
55
210
211
/*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
212
CLASS DECLARATION
213
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%*/
214
215
class
FGFilter
:
public
FGFCSComponent
216
{
217
public
:
218
FGFilter
(
FGFCS
*
fcs
,
Element
* element);
219
~FGFilter
();
220
221
bool
Run
(
void
)
override
;
222
223
void
ResetPastStates
(
void
)
override
;
224
225
private
:
226
bool
DynamicFilter;
229
bool
Initialize;
230
double
ca, cb, cc, cd, ce;
231
FGParameter_ptr
C[7];
// There are 6 coefficients, indexing is "1" based.
232
double
PreviousInput1, PreviousInput2;
233
double
PreviousOutput1, PreviousOutput2;
234
235
enum
{eLag, eLeadLag, eOrder2, eWashout, eUnknown} FilterType;
236
237
void
CalculateDynamicFilters(
void
);
238
void
ReadFilterCoefficients(
Element
* el,
int
index
);
239
void
Debug(
int
from)
override
;
240
};
241
}
242
#endif
243
FGFCSComponent.h
JSBSim::Element
Definition
FGXMLElement.h:143
JSBSim::FGFCSComponent::FGFCSComponent
FGFCSComponent(FGFCS *fcs, Element *el)
Constructor.
Definition
FGFCSComponent.cpp:52
JSBSim::FGFCSComponent::index
int index
Definition
FGFCSComponent.h:114
JSBSim::FGFCSComponent::fcs
FGFCS * fcs
Definition
FGFCSComponent.h:101
JSBSim::FGFCS
Definition
FGFCS.h:188
JSBSim::FGFilter::ResetPastStates
void ResetPastStates(void) override
Definition
FGFilter.cpp:83
JSBSim::FGFilter::FGFilter
FGFilter(FGFCS *fcs, Element *element)
Definition
FGFilter.cpp:51
JSBSim::FGFilter::Run
bool Run(void) override
Definition
FGFilter.cpp:147
JSBSim::FGFilter::~FGFilter
~FGFilter()
Definition
FGFilter.cpp:76
JSBSim::FGPropertyManager
Definition
FGPropertyManager.h:355
JSBSim
Definition
FGFDMExec.cpp:67
JSBSim::FGParameter_ptr
SGSharedPtr< FGParameter > FGParameter_ptr
Definition
FGParameter.h:70
src
FDM
JSBSim
models
flight_control
FGFilter.h
Generated on Tue Jun 3 2025 12:58:38 for FlightGear by
1.13.2