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
26HISTORY
27--------------------------------------------------------------------------------
28
29%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
30SENTRY
31%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%*/
32
33#ifndef FGFILTER_H
34#define FGFILTER_H
35
36/*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
37INCLUDES
38%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%*/
39
40#include "FGFCSComponent.h"
41
42/*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
43FORWARD DECLARATIONS
44%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%*/
45
46namespace JSBSim {
47
48class Element;
50class FGFCS;
51
52/*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
53CLASS DOCUMENTATION
54%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%*/
55
210
211/*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
212CLASS DECLARATION
213%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%*/
214
216{
217public:
218 FGFilter(FGFCS* fcs, Element* element);
219 ~FGFilter();
220
221 bool Run (void) override;
222
223 void ResetPastStates(void) override;
224
225private:
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(FGFCS *fcs, Element *el)
Constructor.
void ResetPastStates(void) override
Definition FGFilter.cpp:83
FGFilter(FGFCS *fcs, Element *element)
Definition FGFilter.cpp:51
bool Run(void) override
Definition FGFilter.cpp:147
SGSharedPtr< FGParameter > FGParameter_ptr
Definition FGParameter.h:70