]> git.mxchange.org Git - flightgear.git/blob - src/FDM/JSBSim/FGFCS.h
Updated JSBsim code.
[flightgear.git] / src / FDM / JSBSim / FGFCS.h
1 /*******************************************************************************
2
3  Header:       FGGFCS.h
4  Author:       Jon S. Berndt
5  Date started: 12/12/98
6
7  ------------- Copyright (C) 1999  Jon S. Berndt (jsb@hal-pc.org) -------------
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 12/12/98   JSB   Created
29
30 ********************************************************************************
31 SENTRY
32 *******************************************************************************/
33
34 #ifndef FGFCS_H
35 #define FGFCS_H
36
37 /*******************************************************************************
38 INCLUDES
39 *******************************************************************************/
40
41 #ifdef FGFS
42 #  include <simgear/compiler.h>
43 #  include STL_STRING
44    FG_USING_STD(string);
45 #  ifdef FG_HAVE_STD_INCLUDES
46 #    include <vector>
47 #  else
48 #    include <vector.h>
49 #  endif
50 #else
51 #  include <vector>
52 #  include <string>
53 #endif
54
55 #include "filtersjb/FGFCSComponent.h"
56 #include "FGModel.h"
57 #include "FGConfigFile.h"
58
59
60 /*******************************************************************************
61 CLASS DECLARATION
62 *******************************************************************************/
63
64 using namespace std;
65
66 class FGFCS : public FGModel
67 {
68 private:
69   float DaCmd, DeCmd, DrCmd, DfCmd, DsbCmd, DspCmd;
70   float DaPos, DePos, DrPos, DfPos, DsbPos, DspPos;
71   float ThrottleCmd[MAX_ENGINES];
72   float ThrottlePos[MAX_ENGINES];
73
74   vector <FGFCSComponent*> Components;
75
76 public:
77         FGFCS(FGFDMExec*);
78         ~FGFCS(void);
79
80         bool Run(void);
81
82         inline float GetDaCmd(void) {return DaCmd;}
83         inline float GetDeCmd(void) {return DeCmd;}
84         inline float GetDrCmd(void) {return DrCmd;}
85         inline float GetDfCmd(void) {return DfCmd;}
86         inline float GetDsbCmd(void) {return DsbCmd;}
87         inline float GetDspCmd(void) {return DspCmd;}
88         inline float GetThrottleCmd(int ii) {return ThrottleCmd[ii];}
89
90         inline float GetDaPos(void) {return DaPos;}
91         inline float GetDePos(void) {return DePos;}
92         inline float GetDrPos(void) {return DrPos;}
93         inline float GetDfPos(void) {return DfPos;}
94         inline float GetDsbPos(void) {return DsbPos;}
95         inline float GetDspPos(void) {return DspPos;}
96         inline float GetThrottlePos(int ii) {return ThrottlePos[ii];}
97
98   inline FGState* GetState(void) {return State;}
99   float GetComponentOutput(int idx);
100   string GetComponentName(int idx);
101
102         inline void SetDaCmd(float tt) {DaCmd = tt;}
103         inline void SetDeCmd(float tt) {DeCmd = tt;}
104         inline void SetDrCmd(float tt) {DrCmd = tt;}
105         inline void SetDfCmd(float tt) {DfCmd = tt;}
106         inline void SetDsbCmd(float tt) {DsbCmd = tt;}
107         inline void SetDspCmd(float tt) {DspCmd = tt;}
108         void SetThrottleCmd(int ii, float tt);
109
110         inline void SetDaPos(float tt) {DaPos = tt;}
111         inline void SetDePos(float tt) {DePos = tt;}
112         inline void SetDrPos(float tt) {DrPos = tt;}
113         inline void SetDfPos(float tt) {DfPos = tt;}
114         inline void SetDsbPos(float tt) {DsbPos = tt;}
115         inline void SetDspPos(float tt) {DspPos = tt;}
116         void SetThrottlePos(int ii, float tt);
117
118   bool LoadFCS(FGConfigFile* AC_cfg);
119   string FCSName;
120 };
121
122 #include "FGState.h"
123
124 #endif