1 /*******************************************************************************
7 ------------- Copyright (C) 1999 Jon S. Berndt (jsb@hal-pc.org) -------------
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
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
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.
23 Further information about the GNU General Public License can also be found on
24 the world wide web at http://www.gnu.org.
27 --------------------------------------------------------------------------------
30 ********************************************************************************
32 *******************************************************************************/
37 /*******************************************************************************
39 *******************************************************************************/
42 # include <simgear/compiler.h>
43 # ifdef FG_HAVE_STD_INCLUDES
54 #include "filtersjb/FGFCSComponent.h"
56 #include "FGConfigFile.h"
59 /*******************************************************************************
61 *******************************************************************************/
63 class FGFCS : public FGModel {
65 float DaCmd, DeCmd, DrCmd, DfCmd, DsbCmd, DspCmd;
66 float DaPos, DePos, DrPos, DfPos, DsbPos, DspPos;
68 float ThrottleCmd[MAX_ENGINES];
69 float ThrottlePos[MAX_ENGINES];
71 vector <FGFCSComponent*> Components;
79 inline float GetDaCmd(void) { return DaCmd; }
80 inline float GetDeCmd(void) { return DeCmd; }
81 inline float GetDrCmd(void) { return DrCmd; }
82 inline float GetDfCmd(void) { return DfCmd; }
83 inline float GetDsbCmd(void) { return DsbCmd; }
84 inline float GetDspCmd(void) { return DspCmd; }
85 inline float GetThrottleCmd(int ii) { return ThrottleCmd[ii]; }
86 inline float GetPitchTrimCmd(void) { return PTrimCmd; }
88 inline float GetDaPos(void) { return DaPos; }
89 inline float GetDePos(void) { return DePos; }
90 inline float GetDrPos(void) { return DrPos; }
91 inline float GetDfPos(void) { return DfPos; }
92 inline float GetDsbPos(void) { return DsbPos; }
93 inline float GetDspPos(void) { return DspPos; }
95 inline float GetThrottlePos(int ii) { return ThrottlePos[ii]; }
96 inline FGState* GetState(void) { return State; }
97 float GetComponentOutput(int idx);
98 string GetComponentName(int idx);
100 inline void SetDaCmd(float tt) { DaCmd = tt; }
101 inline void SetDeCmd(float tt) { DeCmd = tt; }
102 inline void SetDrCmd(float tt) { DrCmd = tt; }
103 inline void SetDfCmd(float tt) { DfCmd = tt; }
104 inline void SetDsbCmd(float tt) { DsbCmd = tt; }
105 inline void SetDspCmd(float tt) { DspCmd = tt; }
106 inline void SetPitchTrimCmd(float tt) { PTrimCmd = tt; }
108 void SetThrottleCmd(int ii, float tt);
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; }
118 void SetThrottlePos(int ii, float tt);
120 bool LoadFCS(FGConfigFile* AC_cfg);