]> git.mxchange.org Git - flightgear.git/blob - src/FDM/JSBSim/models/flight_control/FGKinemat.h
sync. with JSBSim v. 2.0
[flightgear.git] / src / FDM / JSBSim / models / flight_control / FGKinemat.h
1 /*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
2  
3  Header:       FGKinemat.h
4  Author:       Tony Peden, for flight control system authored by Jon S. Berndt
5  Date started: 12/02/01 
6  
7  ------------- Copyright (C) Anthony K. Peden -------------
8  
9  This program is free software; you can redistribute it and/or modify it under
10  the terms of the GNU General Public License as published by the Free Software
11  Foundation; either version 2 of the License, or (at your option) any later
12  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 General Public License for more
17  details.
18  
19  You should have received a copy of the GNU General Public License along with
20  this program; if not, write to the Free Software Foundation, Inc., 59 Temple
21  Place - Suite 330, Boston, MA  02111-1307, USA.
22  
23  Further information about the GNU General Public License can also be found on
24  the world wide web at http://www.gnu.org.
25  
26 HISTORY
27 --------------------------------------------------------------------------------
28  
29 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
30 SENTRY
31 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%*/
32
33 #ifndef FGKinemat_H
34 #define FGKinemat_H
35
36 /*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
37 INCLUDES
38 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%*/
39
40 #ifdef FGFS
41 #  include <simgear/compiler.h>
42 #  ifdef SG_HAVE_STD_INCLUDES
43 #    include <vector>
44 #  else
45 #    include <vector.h>
46 #  endif
47 #else
48 #  include <vector>
49 #endif
50
51 #include <string>
52 #include "FGFCSComponent.h"
53 #include <input_output/FGXMLElement.h>
54
55 /*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
56 DEFINITIONS
57 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%*/
58
59 #define ID_FLAPS "$Id$"
60
61 /*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
62 FORWARD DECLARATIONS
63 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%*/
64
65 namespace JSBSim {
66
67 /*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
68 CLASS DOCUMENTATION
69 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%*/
70
71 /** Encapsulates a kinematic component for the flight control system.
72   */
73
74 /*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
75 CLASS DECLARATION
76 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%*/
77
78 class FGKinemat  : public FGFCSComponent {
79 public:
80   /** Initializer.
81       @param fcs A reference to the ccurrent flightcontrolsystem.
82       @param AC_cfg reference to the current aircraft configuration file.
83       Initializes the FGKinemat object from the given configuration
84       file. The Configuration file is expected to be at the stream
85       position where the KINEMAT object starts. Also it is expected to
86       be past the end of the current KINEMAT configuration on exit.
87    */
88   FGKinemat(FGFCS* fcs, Element* element);
89
90   /** Destructor.
91    */
92   ~FGKinemat();
93   
94   /** Kinemat output value.
95       @return the current output of the kinemat object on the range of [0,1].
96    */
97   double GetOutputPct() const { return OutputPct; }
98     
99   /** Run method, overwrites FGModel::Run().
100       @return false on success, true on failure.
101       The routine doing the work.
102    */
103   bool Run (void);
104   
105 private:
106   vector<double> Detents;
107   vector<double> TransitionTimes;
108   int NumDetents;
109   double OutputPct;
110   bool  DoScale;
111
112   void Debug(int from);
113 };
114 }
115 #endif