]> git.mxchange.org Git - flightgear.git/blob - src/FDM/JSBSim/FGFCS.h
Oct 2, 2000 JSBSim sync.
[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 #  ifdef FG_HAVE_STD_INCLUDES
44 #    include <vector>
45 #  else
46 #    include <vector.h>
47 #  endif
48 #else
49 #  include <vector>
50 #endif
51
52 #include <string>
53 #include "filtersjb/FGFCSComponent.h"
54 #include "FGModel.h"
55 #include "FGConfigFile.h"
56
57
58 /*******************************************************************************
59 CLASS DECLARATION
60 *******************************************************************************/
61
62 class FGFCS : public FGModel {
63 private:
64   float DaCmd, DeCmd, DrCmd, DfCmd, DsbCmd, DspCmd;
65   float DaPos, DePos, DrPos, DfPos, DsbPos, DspPos;
66   float PTrimCmd;
67   float ThrottleCmd[MAX_ENGINES];
68   float ThrottlePos[MAX_ENGINES];
69
70   vector <FGFCSComponent*> Components;
71
72 public:
73   FGFCS(FGFDMExec*);
74   ~FGFCS(void);
75
76   bool Run(void);
77
78   inline float GetDaCmd(void) { return DaCmd; }
79   inline float GetDeCmd(void) { return DeCmd; }
80   inline float GetDrCmd(void) { return DrCmd; }
81   inline float GetDfCmd(void) { return DfCmd; }
82   inline float GetDsbCmd(void) { return DsbCmd; }
83   inline float GetDspCmd(void) { return DspCmd; }
84   inline float GetThrottleCmd(int ii) { return ThrottleCmd[ii]; }
85   inline float GetPitchTrimCmd(void) { return PTrimCmd; }
86
87   inline float GetDaPos(void) { return DaPos; }
88   inline float GetDePos(void) { return DePos; }
89   inline float GetDrPos(void) { return DrPos; }
90   inline float GetDfPos(void) { return DfPos; }
91   inline float GetDsbPos(void) { return DsbPos; }
92   inline float GetDspPos(void) { return DspPos; }
93
94   inline float GetThrottlePos(int ii) { return ThrottlePos[ii]; }
95   inline FGState* GetState(void) { return State; }
96   float GetComponentOutput(eParam idx);
97   string GetComponentName(int idx);
98
99   inline void SetDaCmd(float tt) { DaCmd = tt; }
100   inline void SetDeCmd(float tt) { DeCmd = tt; }
101   inline void SetDrCmd(float tt) { DrCmd = tt; }
102   inline void SetDfCmd(float tt) { DfCmd = tt; }
103   inline void SetDsbCmd(float tt) { DsbCmd = tt; }
104   inline void SetDspCmd(float tt) { DspCmd = tt; }
105   inline void SetPitchTrimCmd(float tt) { PTrimCmd = tt; }
106
107   void SetThrottleCmd(int ii, float tt);
108
109   inline void SetDaPos(float tt) { DaPos = tt; }
110   inline void SetDePos(float tt) { DePos = tt; }
111   inline void SetDrPos(float tt) { DrPos = tt; }
112   inline void SetDfPos(float tt) { DfPos = tt; }
113   inline void SetDsbPos(float tt) { DsbPos = tt; }
114   inline void SetDspPos(float tt) { DspPos = tt; }
115
116
117   void SetThrottlePos(int ii, float tt);
118
119   bool LoadFCS(FGConfigFile* AC_cfg);
120   string FCSName;
121 };
122
123 #include "FGState.h"
124
125 #endif