]> git.mxchange.org Git - flightgear.git/blob - src/FDM/JSBSim/FGFCS.h
Expose the strut compression.
[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 SG_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 "FGLGear.h"
56 #include "FGConfigFile.h"
57
58 /*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
59 DEFINITIONS
60 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%*/
61
62 #define ID_FCS "$Id$"
63
64 /*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
65 FORWARD DECLARATIONS
66 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%*/
67
68 namespace JSBSim {
69
70 typedef enum { iDe=0, iDaL, iDaR, iDr, iDsb, iDsp, iDf, NNorm } FcIdx;
71 typedef enum { ofRad=0, ofNorm, ofMag , NForms} OutputForm;
72
73 /*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
74 CLASS DOCUMENTATION
75 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%*/
76
77 /** Encapsulates the Flight Control System (FCS) functionality.
78     This class owns and contains the list of FGFCSComponents
79     that define the control system for this aircraft. The config file for the
80     aircraft contains a description of the control path that starts at an input
81     or command and ends at an effector, e.g. an aerosurface. The FCS components
82     which comprise the control laws for an axis are defined sequentially in
83     the configuration file. For instance, for the X-15:
84
85     <pre>
86     \<FLIGHT_CONTROL NAME="X-15 SAS">
87
88     \<COMPONENT NAME="Pitch Trim Sum" TYPE="SUMMER">
89        INPUT        fcs/elevator-cmd-norm
90        INPUT        fcs/pitch-trim-cmd-norm
91        CLIPTO       -1 1
92     \</COMPONENT>
93
94     \<COMPONENT NAME="Pitch Command Scale" TYPE="AEROSURFACE_SCALE">
95       INPUT        fcs/pitch-trim-sum
96       MIN         -50
97       MAX          50
98     \</COMPONENT>
99
100     \<COMPONENT NAME="Pitch Gain 1" TYPE="PURE_GAIN">
101       INPUT        fcs/pitch-command-scale
102       GAIN         -0.36
103     \</COMPONENT>
104
105     ... etc.
106     </pre>
107
108     In the above case we can see the first few components of the pitch channel
109     defined. The input to the first component, as can be seen in the "Pitch trim
110     sum" component, is really the sum of two parameters: elevator command (from
111     the stick - a pilot input), and pitch trim. The type of this component is
112     "Summer".
113     The next component created is an aerosurface scale component - a type of
114     gain (see the LoadFCS() method for insight on how the various types of
115     components map into the actual component classes).  This continues until the
116     final component for an axis when the
117     OUTPUT keyword specifies where the output is supposed to go. See the
118     individual components for more information on how they are mechanized.
119
120     Another option for the flight controls portion of the config file is that in
121     addition to using the "NAME" attribute in,
122
123     <pre>
124     \<FLIGHT_CONTROL NAME="X-15 SAS">
125     </pre>
126
127     one can also supply a filename:
128
129     <pre>
130     \<FLIGHT_CONTROL NAME="X-15 SAS" FILE="X15.xml">
131     \</FLIGHT_CONTROL>
132     </pre>
133
134     In this case, the FCS would be read in from another file.
135
136     @author Jon S. Berndt
137     @version $Id$
138     @see FGFCSComponent
139     @see FGConfigFile
140     @see FGGain
141     @see FGSummer
142     @see FGSwitch
143     @see FGGradient
144     @see FGFilter
145     @see FGDeadBand
146 */
147
148 /*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
149 CLASS DECLARATION
150 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%*/
151
152 class FGFCS : public FGModel {
153
154 public:
155   /** Constructor
156       @param Executive a pointer to the parent executive object */
157   FGFCS(FGFDMExec*);
158   /// Destructor
159   ~FGFCS();
160
161   /** Runs the Flight Controls model; called by the Executive
162       @return false if no error */
163   bool Run(void);
164
165   /// @name Pilot input command retrieval
166   //@{
167   /** Gets the aileron command.
168       @return aileron command in percent */
169   inline double GetDaCmd(void) const { return DaCmd; }
170
171   /** Gets the elevator command.
172       @return elevator command in percent */
173   inline double GetDeCmd(void) const { return DeCmd; }
174
175   /** Gets the rudder command.
176       @return rudder command in percent */
177   inline double GetDrCmd(void) const { return DrCmd; }
178
179   /** Gets the steering command.
180       @return steering command in percent */
181   inline double GetDsCmd(void) const { return DsCmd; }
182
183   /** Gets the flaps command.
184       @return flaps command in percent */
185   inline double GetDfCmd(void) const { return DfCmd; }
186
187   /** Gets the speedbrake command.
188       @return speedbrake command in percent */
189   inline double GetDsbCmd(void) const { return DsbCmd; }
190
191   /** Gets the spoiler command.
192       @return spoiler command in percent */
193   inline double GetDspCmd(void) const { return DspCmd; }
194
195   /** Gets the throttle command.
196       @param engine engine ID number
197       @return throttle command in percent ( 0 - 100) for the given engine */
198   double GetThrottleCmd(int engine) const;
199
200   /** Gets the mixture command.
201       @param engine engine ID number
202       @return mixture command in percent ( 0 - 100) for the given engine */
203   inline double GetMixtureCmd(int engine) const { return MixtureCmd[engine]; }
204
205   /** Gets the prop pitch command.
206       @param engine engine ID number
207       @return pitch command in percent ( 0.0 - 1.0) for the given engine */
208   inline double GetPropAdvanceCmd(int engine) const { return PropAdvanceCmd[engine]; }
209
210   /** Gets the pitch trim command.
211       @return pitch trim command in percent */
212   inline double GetPitchTrimCmd(void) const { return PTrimCmd; }
213
214   /** Gets the rudder trim command.
215       @return rudder trim command in percent */
216   inline double GetYawTrimCmd(void) const { return YTrimCmd; }
217
218   /** Gets the aileron trim command.
219       @return aileron trim command in percent */
220   inline double GetRollTrimCmd(void) const { return RTrimCmd; }
221
222   /** Get the gear extend/retract command. 0 commands gear up, 1 down.
223       defaults to down.
224       @return the current value of the gear extend/retract command*/
225   inline double GetGearCmd(void) const { return GearCmd; }
226   //@}
227
228   /// @name AUTOPilot -> FCS effectors command retrieval
229   //@{
230   /** Gets the AUTOPilot aileron command.
231       @return aileron command in radians */
232   inline double GetAPDaCmd(void) const { return AP_DaCmd; }
233
234   /** Gets the AUTOPilot elevator command.
235       @return elevator command in radians */
236   inline double GetAPDeCmd(void) const { return AP_DeCmd; }
237
238   /** Gets the AUTOPilot rudder command.
239       @return rudder command in radians */
240   inline double GetAPDrCmd(void) const { return AP_DrCmd; }
241
242   /** Gets the AUTOPilot throttle (all engines) command.
243       @return throttle command in percent */
244   inline double GetAPThrottleCmd(void) const { return AP_ThrottleCmd; }
245   //@}
246
247   /// @name AUTOPilot setpoint retrieval
248   //@{
249   /** Gets the autopilot pitch attitude setpoint
250       @return Pitch attitude setpoint in radians */
251   inline double GetAPAttitudeSetPt(void) const {return APAttitudeSetPt;}
252
253   /** Gets the autopilot altitude setpoint
254       @return Altitude setpoint in feet */
255   inline double GetAPAltitudeSetPt(void) const {return APAltitudeSetPt;}
256
257   /** Gets the autopilot heading setpoint
258       @return Heading setpoint in radians */
259   inline double GetAPHeadingSetPt(void) const {return APHeadingSetPt;}
260
261   /** Gets the autopilot airspeed setpoint
262       @return Airspeed setpoint in fps */
263   inline double GetAPAirspeedSetPt(void) const {return APAirspeedSetPt;}
264   //@}
265
266   /// @name AUTOPilot setpoint setting
267   //@{
268   /// Sets the autopilot pitch attitude setpoint
269   inline void SetAPAttitudeSetPt(double set) {APAttitudeSetPt = set;}
270
271   /// Sets the autopilot altitude setpoint
272   inline void SetAPAltitudeSetPt(double set) {APAltitudeSetPt = set;}
273
274   /// Sets the autopilot heading setpoint
275   inline void SetAPHeadingSetPt(double set) {APHeadingSetPt = set;}
276
277   /// Sets the autopilot airspeed setpoint
278   inline void SetAPAirspeedSetPt(double set) {APAirspeedSetPt = set;}
279   //@}
280
281
282     /// @name AUTOPilot mode setting
283   //@{
284   /** Turns on/off the attitude-seeking autopilot.
285       @param set true turns the mode on, false turns it off  **/
286   inline void SetAPAcquireAttitude(bool set) {APAcquireAttitude = set;}
287
288   /** Turns on/off the altitude-seeking autopilot.
289       @param set true turns the mode on, false turns it off  **/
290   inline void SetAPAcquireAltitude(bool set) {APAcquireAltitude = set;}
291
292   /** Turns on/off the heading-seeking autopilot.
293       @param set true turns the mode on, false turns it off  **/
294   inline void SetAPAcquireHeading(bool set) {APAcquireHeading = set;}
295
296   /** Turns on/off the airspeed-seeking autopilot.
297       @param set true turns the mode on, false turns it off  **/
298   inline void SetAPAcquireAirspeed(bool set) {APAcquireAirspeed = set;}
299
300   /** Turns on/off the attitude-holding autopilot.
301       @param set true turns the mode on, false turns it off  **/
302   inline void SetAPAttitudeHold(bool set) {APAttitudeHold = set;}
303
304   /** Turns on/off the altitude-holding autopilot.
305       @param set true turns the mode on, false turns it off  **/
306   inline void SetAPAltitudeHold(bool set) {APAltitudeHold = set;}
307
308   /** Turns on/off the heading-holding autopilot.
309       @param set true turns the mode on, false turns it off  **/
310   inline void SetAPHeadingHold(bool set) {APHeadingHold = set;}
311
312   /** Turns on/off the airspeed-holding autopilot.
313       @param set true turns the mode on, false turns it off  **/
314   inline void SetAPAirspeedHold(bool set) {APAirspeedHold = set;}
315
316   /** Turns on/off the wing-leveler autopilot.
317       @param set true turns the mode on, false turns it off  **/
318   inline void SetAPWingsLevelHold(bool set) {APWingsLevelHold = set;}
319   //@}
320
321   /// @name AUTOPilot mode retrieval
322   //@{
323   /** Retrieves the on/off mode of the autopilot AcquireAttitude mode
324       @return true if on, false if off */
325   inline bool GetAPAcquireAttitude(void) const {return APAcquireAttitude;}
326
327   /** Retrieves the on/off mode of the autopilot AcquireAltitude mode
328       @return true if on, false if off */
329   inline bool GetAPAcquireAltitude(void) const {return APAcquireAltitude;}
330
331   /** Retrieves the on/off mode of the autopilot AcquireHeading mode
332       @return true if on, false if off */
333   inline bool GetAPAcquireHeading(void) const {return APAcquireHeading;}
334
335   /** Retrieves the on/off mode of the autopilot AcquireAirspeed mode
336       @return true if on, false if off */
337   inline bool GetAPAcquireAirspeed(void) const {return APAcquireAirspeed;}
338
339   /** Retrieves the on/off mode of the autopilot AttitudeHold mode
340       @return true if on, false if off */
341   inline bool GetAPAttitudeHold(void) const {return APAttitudeHold;}
342
343   /** Retrieves the on/off mode of the autopilot AltitudeHold mode
344       @return true if on, false if off */
345   inline bool GetAPAltitudeHold(void) const {return APAltitudeHold;}
346
347   /** Retrieves the on/off mode of the autopilot HeadingHold mode
348       @return true if on, false if off */
349   inline bool GetAPHeadingHold(void) const {return APHeadingHold;}
350
351   /** Retrieves the on/off mode of the autopilot AirspeedHold mode
352       @return true if on, false if off */
353   inline bool GetAPAirspeedHold(void) const {return APAirspeedHold;}
354
355   /** Retrieves the on/off mode of the autopilot WingsLevelHold mode
356       @return true if on, false if off */
357   inline bool GetAPWingsLevelHold(void) const {return APWingsLevelHold;}
358   //@}
359
360   /// @name Aerosurface position retrieval
361   //@{
362   /** Gets the left aileron position.
363       @return aileron position in radians */
364   inline double GetDaLPos( int form = ofRad )
365                          const { return DaLPos[form]; }
366
367   /// @name Aerosurface position retrieval
368   //@{
369   /** Gets the right aileron position.
370       @return aileron position in radians */
371   inline double GetDaRPos( int form = ofRad )
372                          const { return DaRPos[form]; }
373
374   /** Gets the elevator position.
375       @return elevator position in radians */
376   inline double GetDePos( int form = ofRad )
377                          const { return DePos[form]; }
378
379   /** Gets the rudder position.
380       @return rudder position in radians */
381   inline double GetDrPos( int form = ofRad )
382                          const { return DrPos[form]; }
383
384   /** Gets the speedbrake position.
385       @return speedbrake position in radians */
386   inline double GetDsbPos( int form = ofRad )
387                          const { return DsbPos[form]; }
388
389   /** Gets the spoiler position.
390       @return spoiler position in radians */
391   inline double GetDspPos( int form = ofRad )
392                          const { return DspPos[form]; }
393
394   /** Gets the flaps position.
395       @return flaps position in radians */
396   inline double GetDfPos( int form = ofRad )
397                          const { return DfPos[form]; }
398
399   /** Gets the throttle position.
400       @param engine engine ID number
401       @return throttle position for the given engine in percent ( 0 - 100)*/
402   double GetThrottlePos(int engine) const;
403
404   /** Gets the mixture position.
405       @param engine engine ID number
406       @return mixture position for the given engine in percent ( 0 - 100)*/
407   inline double GetMixturePos(int engine) const { return MixturePos[engine]; }
408
409   /** Gets the steering position.
410       @return steering position in degrees */
411   double GetSteerPosDeg(int gear) const { return SteerPosDeg[gear]; }
412
413   /** Gets the gear position (0 up, 1 down), defaults to down
414       @return gear position (0 up, 1 down) */
415   inline double GetGearPos(void) const { return GearPos; }
416
417   /** Gets the prop pitch position.
418       @param engine engine ID number
419       @return prop pitch position for the given engine in percent ( 0.0-1.0)*/
420   inline double GetPropAdvance(int engine) const { return PropAdvance[engine]; }
421   //@}
422
423   /** Retrieves the State object pointer.
424       This is used by the FGFCS-owned components.
425       @return pointer to the State object */
426   inline FGState* GetState(void) { return State; }
427
428   /** Retrieves all component names for inclusion in output stream
429       @param delimeter either a tab or comma string depending on output type
430       @return a string containing the descriptive names for all components */
431   string GetComponentStrings(string delimeter);
432
433   /** Retrieves all component outputs for inclusion in output stream
434       @param delimeter either a tab or comma string depending on output type
435       @return a string containing the numeric values for the current set of
436       component outputs */
437   string GetComponentValues(string delimeter);
438
439   /// @name Pilot input command setting
440   //@{
441   /** Sets the aileron command
442       @param cmd aileron command in percent*/
443   inline void SetDaCmd( double cmd ) { DaCmd = cmd; }
444
445   /** Sets the elevator command
446       @param cmd elevator command in percent*/
447   inline void SetDeCmd(double cmd ) { DeCmd = cmd; }
448
449   /** Sets the rudder command
450       @param cmd rudder command in percent*/
451   inline void SetDrCmd(double cmd) { DrCmd = cmd; }
452
453   /** Sets the steering command
454       @param cmd steering command in percent*/
455   inline void SetDsCmd(double cmd) { DsCmd = cmd; }
456
457   /** Sets the flaps command
458       @param cmd flaps command in percent*/
459   inline void SetDfCmd(double cmd) { DfCmd = cmd; }
460
461   /** Sets the speedbrake command
462       @param cmd speedbrake command in percent*/
463   inline void SetDsbCmd(double cmd) { DsbCmd = cmd; }
464
465   /** Sets the spoilers command
466       @param cmd spoilers command in percent*/
467   inline void SetDspCmd(double cmd) { DspCmd = cmd; }
468
469   /** Sets the pitch trim command
470       @param cmd pitch trim command in percent*/
471   inline void SetPitchTrimCmd(double cmd) { PTrimCmd = cmd; }
472
473   /** Sets the rudder trim command
474       @param cmd rudder trim command in percent*/
475   inline void SetYawTrimCmd(double cmd) { YTrimCmd = cmd; }
476
477   /** Sets the aileron trim command
478       @param cmd aileron trim command in percent*/
479   inline void SetRollTrimCmd(double cmd) { RTrimCmd = cmd; }
480
481   /** Sets the throttle command for the specified engine
482       @param engine engine ID number
483       @param cmd throttle command in percent (0 - 100)*/
484   void SetThrottleCmd(int engine, double cmd);
485
486   /** Sets the mixture command for the specified engine
487       @param engine engine ID number
488       @param cmd mixture command in percent (0 - 100)*/
489   void SetMixtureCmd(int engine, double cmd);
490
491   /** Set the gear extend/retract command, defaults to down
492       @param gear command 0 for up, 1 for down */
493    void SetGearCmd(double gearcmd) { GearCmd = gearcmd; }
494
495   /** Sets the propeller pitch command for the specified engine
496       @param engine engine ID number
497       @param cmd mixture command in percent (0.0 - 1.0)*/
498   void SetPropAdvanceCmd(int engine, double cmd);
499   //@}
500
501   /// @name AUTOPilot -> FCS effector command setting
502   //@{
503   /** Sets the AUTOPilot aileron command
504       @param cmd AUTOPilot aileron command in radians*/
505   inline void SetAPDaCmd( double cmd ) { AP_DaCmd = cmd; }
506
507   /** Sets the AUTOPilot elevator command
508       @param cmd AUTOPilot elevator command in radians*/
509   inline void SetAPDeCmd(double cmd ) { AP_DeCmd = cmd; }
510
511   /** Sets the AUTOPilot rudder command
512       @param cmd AUTOPilot rudder command in radians*/
513   inline void SetAPDrCmd(double cmd) { AP_DrCmd = cmd; }
514
515   /** Sets the AUTOPilot throttle command
516       @param cmd AUTOPilot throttle command in percent*/
517   inline void SetAPThrottleCmd(double cmd) { AP_ThrottleCmd = cmd; }
518   //@}
519
520   /// @name Aerosurface position setting
521   //@{
522   /** Sets the left aileron position
523       @param cmd left aileron position in radians*/
524   inline void SetDaLPos( int form , double pos )
525                                       { DaLPos[form] = pos; }
526
527   /** Sets the right aileron position
528       @param cmd right aileron position in radians*/
529   inline void SetDaRPos( int form , double pos )
530                                       { DaRPos[form] = pos; }
531
532   /** Sets the elevator position
533       @param cmd elevator position in radians*/
534   inline void SetDePos( int form , double pos )
535                                       { DePos[form] = pos; }
536
537   /** Sets the rudder position
538       @param cmd rudder position in radians*/
539   inline void SetDrPos( int form , double pos )
540                                       { DrPos[form] = pos; }
541
542    /** Sets the flaps position
543       @param cmd flaps position in radians*/
544   inline void SetDfPos( int form , double pos )
545                                       { DfPos[form] = pos; }
546
547   /** Sets the speedbrake position
548       @param cmd speedbrake position in radians*/
549   inline void SetDsbPos( int form , double pos )
550                                       { DsbPos[form] = pos; }
551
552   /** Sets the spoiler position
553       @param cmd spoiler position in radians*/
554   inline void SetDspPos( int form , double pos )
555                                       { DspPos[form] = pos; }
556
557   /** Sets the actual throttle setting for the specified engine
558       @param engine engine ID number
559       @param cmd throttle setting in percent (0 - 100)*/
560   void SetThrottlePos(int engine, double cmd);
561
562   /** Sets the actual mixture setting for the specified engine
563       @param engine engine ID number
564       @param cmd mixture setting in percent (0 - 100)*/
565   void SetMixturePos(int engine, double cmd);
566
567   /** Sets the steering position
568       @param cmd steering position in degrees*/
569   void SetSteerPosDeg(int gear, double pos) { SteerPosDeg[gear] = pos; }
570
571   /** Set the gear extend/retract position, defaults to down
572       @param gear position 0 up, 1 down       */
573    void SetGearPos(double gearpos) { GearPos = gearpos; }
574
575
576   /** Sets the actual prop pitch setting for the specified engine
577       @param engine engine ID number
578       @param cmd prop pitch setting in percent (0.0 - 1.0)*/
579   void SetPropAdvance(int engine, double cmd);
580   //@}
581
582     /// @name Landing Gear brakes
583   //@{
584   /** Sets the left brake group
585       @param cmd brake setting in percent (0.0 - 1.0) */
586   void SetLBrake(double cmd) {LeftBrake = cmd;}
587
588   /** Sets the right brake group
589       @param cmd brake setting in percent (0.0 - 1.0) */
590   void SetRBrake(double cmd) {RightBrake = cmd;}
591
592   /** Sets the center brake group
593       @param cmd brake setting in percent (0.0 - 1.0) */
594   void SetCBrake(double cmd) {CenterBrake = cmd;}
595
596   /** Gets the brake for a specified group.
597       @param bg which brakegroup to retrieve the command for
598       @return the brake setting for the supplied brake group argument */
599   double GetBrake(FGLGear::BrakeGroup bg);
600   //@}
601
602   /** Loads the Flight Control System.
603       The FGAircraft instance is actually responsible for reading the config file
604       and calling the various Loadxx() methods of the other systems, passing in
605       the config file instance pointer. LoadFCS() is called from FGAircraft.
606       @param AC_cfg pointer to the config file instance
607       @return true if succesful */
608   bool Load(FGConfigFile* AC_cfg);
609
610   void AddThrottle(void);
611   void AddGear(void);
612
613   FGPropertyManager* GetPropertyManager(void) { return PropertyManager; }
614   void convert(void);
615
616   void bind(void);
617   void bindModel(void);
618   void unbind(FGPropertyManager *node);
619
620 private:
621   double DaCmd, DeCmd, DrCmd, DsCmd, DfCmd, DsbCmd, DspCmd;
622   double AP_DaCmd, AP_DeCmd, AP_DrCmd, AP_ThrottleCmd;
623   double DePos[NForms], DaLPos[NForms], DaRPos[NForms], DrPos[NForms];
624   double DfPos[NForms], DsbPos[NForms], DspPos[NForms];
625   double PTrimCmd, YTrimCmd, RTrimCmd;
626   vector <double> ThrottleCmd;
627   vector <double> ThrottlePos;
628   vector <double> MixtureCmd;
629   vector <double> MixturePos;
630   vector <double> PropAdvanceCmd;
631   vector <double> PropAdvance;
632   vector <double> SteerPosDeg;
633   double LeftBrake, RightBrake, CenterBrake; // Brake settings
634   double GearCmd,GearPos;
635
636   double APAttitudeSetPt, APAltitudeSetPt, APHeadingSetPt, APAirspeedSetPt;
637   bool APAcquireAttitude, APAcquireAltitude, APAcquireHeading, APAcquireAirspeed;
638   bool APAttitudeHold, APAltitudeHold, APHeadingHold, APAirspeedHold, APWingsLevelHold;
639
640   bool DoNormalize;
641   void Normalize(void);
642
643   vector <FGFCSComponent*> FCSComponents;
644   vector <FGFCSComponent*> APComponents;
645   int ToNormalize[NNorm];
646   void Debug(int from);
647 };
648 }
649
650 #endif
651