JSBSim Flight Dynamics Model  1.2.0 (05 Nov 2023)
An Open Source Flight Dynamics and Control Software Library in C++
FGFCS Class Reference

Detailed Description

Encapsulates the Flight Control System (FCS) functionality.

This class also encapsulates the identical "system" and "autopilot" capability. FGFCS owns and contains the list of FGFCSComponents that define a system or systems for the modeled aircraft. The config file for the aircraft contains a description of the control path that starts at an input or command and ends at an effector, e.g. an aerosurface. The FCS components which comprise the control laws for an axis are defined sequentially in the configuration file. For instance, for the X-15:

<flight_control name="X-15 SAS">
<channel>
<summer name="Pitch Trim Sum">
<input> fcs/elevator-cmd-norm </input>
<input> fcs/pitch-trim-cmd-norm </input>
<clipto>
<min>-1</min>
<max>1</max>
</clipto>
</summer>
<aerosurface_scale name="Pitch Command Scale">
<input> fcs/pitch-trim-sum </input>
<range>
<min> -50 </min>
<max> 50 </max>
</range>
</aerosurface_scale>
... etc.

In the above case we can see the first few components of the pitch channel defined. The input to the first component (a summer), as can be seen in the "Pitch trim sum" component, is really the sum of two parameters: elevator command (from the stick - a pilot input), and pitch trim. The next component created is an aerosurface scale component - a type of gain (see the LoadFCS() method for insight on how the various types of components map into the actual component classes). This continues until the final component for an axis when the <output> element is usually used to specify where the output is supposed to go. See the individual components for more information on how they are mechanized.

Another option for the flight controls portion of the config file is that in addition to using the "NAME" attribute in,

<flight_control name="X-15 SAS">

one can also supply a filename:

<flight_control name="X-15 SAS" file="X15.xml">
</flight_control>

In this case, the FCS would be read in from another file.

Properties

  • fcs/aileron-cmd-norm normalized aileron command
  • fcs/elevator-cmd-norm normalized elevator command
  • fcs/rudder-cmd-norm
  • fcs/steer-cmd-norm
  • fcs/flap-cmd-norm
  • fcs/speedbrake-cmd-norm
  • fcs/spoiler-cmd-norm
  • fcs/pitch-trim-cmd-norm
  • fcs/roll-trim-cmd-norm
  • fcs/yaw-trim-cmd-norm
  • gear/gear-cmd-norm
  • fcs/left-aileron-pos-rad
  • fcs/left-aileron-pos-deg
  • fcs/left-aileron-pos-norm
  • fcs/mag-left-aileron-pos-rad
  • fcs/right-aileron-pos-rad
  • fcs/right-aileron-pos-deg
  • fcs/right-aileron-pos-norm
  • fcs/mag-right-aileron-pos-rad
  • fcs/elevator-pos-rad
  • fcs/elevator-pos-deg
  • fcs/elevator-pos-norm
  • fcs/mag-elevator-pos-rad
  • fcs/rudder-pos-rad
  • fcs/rudder-pos-deg
  • fcs/rudder-pos-norm
  • fcs/mag-rudder-pos-rad
  • fcs/flap-pos-rad
  • fcs/flap-pos-deg
  • fcs/flap-pos-norm
  • fcs/speedbrake-pos-rad
  • fcs/speedbrake-pos-deg
  • fcs/speedbrake-pos-norm
  • fcs/mag-speedbrake-pos-rad
  • fcs/spoiler-pos-rad
  • fcs/spoiler-pos-deg
  • fcs/spoiler-pos-norm
  • fcs/mag-spoiler-pos-rad
  • fcs/wing-fold-pos-norm
  • gear/gear-pos-norm
  • gear/tailhook-pos-norm
Author
Jon S. Berndt
Version
Revision
1.55
See also
FGActuator
FGDeadBand
FGFCSFunction
FGFilter
FGGain
FGKinemat
FGPID
FGSensor
FGSummer
FGSwitch
FGWaypoint
FGAngles
FGFCSComponent
Element
FGDistributor

Definition at line 188 of file FGFCS.h.

#include <FGFCS.h>

+ Inheritance diagram for FGFCS:
+ Collaboration diagram for FGFCS:

Public Member Functions

 FGFCS (FGFDMExec *)
 Constructor. More...
 
 ~FGFCS () override
 Destructor.
 
bool InitModel (void) override
 
bool Run (bool Holding) override
 Runs the Flight Controls model; called by the Executive Can pass in a value indicating if the executive is directing the simulation to Hold. More...
 
Pilot input command retrieval
double GetDaCmd (void) const
 Gets the aileron command. More...
 
double GetDeCmd (void) const
 Gets the elevator command. More...
 
double GetDrCmd (void) const
 Gets the rudder command. More...
 
double GetDsCmd (void) const
 Gets the steering command. More...
 
double GetDfCmd (void) const
 Gets the flaps command. More...
 
double GetDsbCmd (void) const
 Gets the speedbrake command. More...
 
double GetDspCmd (void) const
 Gets the spoiler command. More...
 
double GetThrottleCmd (int engine) const
 Gets the throttle command. More...
 
const std::vector< double > & GetThrottleCmd () const
 
double GetMixtureCmd (int engine) const
 Gets the mixture command. More...
 
const std::vector< double > & GetMixtureCmd () const
 
double GetPropAdvanceCmd (int engine) const
 Gets the prop pitch command. More...
 
bool GetFeatherCmd (int engine) const
 Gets the prop feather command. More...
 
double GetPitchTrimCmd (void) const
 Gets the pitch trim command. More...
 
double GetYawTrimCmd (void) const
 Gets the rudder trim command. More...
 
double GetRollTrimCmd (void) const
 Gets the aileron trim command. More...
 
double GetGearCmd (void) const
 Get the gear extend/retract command. More...
 
Aerosurface position retrieval
double GetDaLPos (int form=ofRad) const
 Gets the left aileron position. More...
 
double GetDaRPos (int form=ofRad) const
 Gets the right aileron position. More...
 
double GetDePos (int form=ofRad) const
 Gets the elevator position. More...
 
double GetDrPos (int form=ofRad) const
 Gets the rudder position. More...
 
double GetDsbPos (int form=ofRad) const
 Gets the speedbrake position. More...
 
double GetDspPos (int form=ofRad) const
 Gets the spoiler position. More...
 
double GetDfPos (int form=ofRad) const
 Gets the flaps position. More...
 
double GetThrottlePos (int engine) const
 Gets the throttle position. More...
 
const std::vector< double > & GetThrottlePos () const
 
double GetMixturePos (int engine) const
 Gets the mixture position. More...
 
const std::vector< double > & GetMixturePos () const
 
double GetGearPos (void) const
 Gets the gear position (0 up, 1 down), defaults to down. More...
 
double GetTailhookPos (void) const
 Gets the tailhook position (0 up, 1 down) More...
 
double GetWingFoldPos (void) const
 Gets the wing fold position (0 unfolded, 1 folded) More...
 
double GetPropAdvance (int engine) const
 Gets the prop pitch position. More...
 
const std::vector< double > & GetPropAdvance () const
 
bool GetPropFeather (int engine) const
 Gets the prop feather position. More...
 
const std::vector< bool > & GetPropFeather () const
 
std::string GetComponentStrings (const std::string &delimiter) const
 Retrieves all component names for inclusion in output stream. More...
 
std::string GetComponentValues (const std::string &delimiter) const
 Retrieves all component outputs for inclusion in output stream. More...
 
Pilot input command setting
void SetDaCmd (double cmd)
 Sets the aileron command. More...
 
void SetDeCmd (double cmd)
 Sets the elevator command. More...
 
void SetDrCmd (double cmd)
 Sets the rudder command. More...
 
void SetDsCmd (double cmd)
 Sets the steering command. More...
 
void SetDfCmd (double cmd)
 Sets the flaps command. More...
 
void SetDsbCmd (double cmd)
 Sets the speedbrake command. More...
 
void SetDspCmd (double cmd)
 Sets the spoilers command. More...
 
void SetPitchTrimCmd (double cmd)
 Sets the pitch trim command. More...
 
void SetYawTrimCmd (double cmd)
 Sets the rudder trim command. More...
 
void SetRollTrimCmd (double cmd)
 Sets the aileron trim command. More...
 
void SetThrottleCmd (int engine, double cmd)
 Sets the throttle command for the specified engine. More...
 
void SetMixtureCmd (int engine, double cmd)
 Sets the mixture command for the specified engine. More...
 
void SetGearCmd (double gearcmd)
 Set the gear extend/retract command, defaults to down. More...
 
void SetPropAdvanceCmd (int engine, double cmd)
 Sets the propeller pitch command for the specified engine. More...
 
void SetFeatherCmd (int engine, bool cmd)
 Sets the propeller feather command for the specified engine. More...
 
Aerosurface position setting
void SetDaLPos (int form, double pos)
 Sets the left aileron position. More...
 
void SetDaRPos (int form, double pos)
 Sets the right aileron position. More...
 
void SetDePos (int form, double pos)
 Sets the elevator position. More...
 
void SetDrPos (int form, double pos)
 Sets the rudder position. More...
 
void SetDfPos (int form, double pos)
 Sets the flaps position. More...
 
void SetDsbPos (int form, double pos)
 Sets the speedbrake position. More...
 
void SetDspPos (int form, double pos)
 Sets the spoiler position. More...
 
void SetThrottlePos (int engine, double cmd)
 Sets the actual throttle setting for the specified engine. More...
 
void SetMixturePos (int engine, double cmd)
 Sets the actual mixture setting for the specified engine. More...
 
void SetGearPos (double gearpos)
 Set the gear extend/retract position, defaults to down. More...
 
void SetTailhookPos (double hookpos)
 Set the tailhook position. More...
 
void SetWingFoldPos (double foldpos)
 Set the wing fold position. More...
 
void SetPropAdvance (int engine, double cmd)
 Sets the actual prop pitch setting for the specified engine. More...
 
void SetPropFeather (int engine, bool cmd)
 Sets the actual prop feather setting for the specified engine. More...
 
- Public Member Functions inherited from FGModel
 FGModel (FGFDMExec *)
 Constructor.
 
 ~FGModel () override
 Destructor.
 
FGFDMExecGetExec (void)
 
const std::string & GetName (void)
 
unsigned int GetRate (void)
 Get the output rate for the model in frames.
 
bool InitModel (void) override
 
void SetPropertyManager (std::shared_ptr< FGPropertyManager > fgpm)
 
void SetRate (unsigned int tt)
 Set the ouput rate for the model in frames.
 
- Public Member Functions inherited from FGModelFunctions
std::string GetFunctionStrings (const std::string &delimeter) const
 Gets the strings for the current set of functions. More...
 
std::string GetFunctionValues (const std::string &delimeter) const
 Gets the function values. More...
 
std::shared_ptr< FGFunctionGetPreFunction (const std::string &name)
 Get one of the "pre" function. More...
 
bool Load (Element *el, FGFDMExec *fdmex, std::string prefix="")
 
void PostLoad (Element *el, FGFDMExec *fdmex, std::string prefix="")
 
void PreLoad (Element *el, FGFDMExec *fdmex, std::string prefix="")
 
void RunPostFunctions (void)
 
void RunPreFunctions (void)
 
- Public Member Functions inherited from FGJSBBase
 FGJSBBase ()
 Constructor for FGJSBBase.
 
virtual ~FGJSBBase ()
 Destructor for FGJSBBase.
 
void disableHighLighting (void)
 Disables highlighting in the console output.
 

Landing Gear brakes

enum  SystemType { stFCS , stSystem , stAutoPilot }
 
void SetLBrake (double cmd)
 Sets the left brake group. More...
 
void SetRBrake (double cmd)
 Sets the right brake group. More...
 
void SetCBrake (double cmd)
 Sets the center brake group. More...
 
double GetBrake (FGLGear::BrakeGroup bg)
 Gets the brake for a specified group. More...
 
const std::vector< double > & GetBrakePos () const
 
double GetLBrake (void) const
 Gets the left brake. More...
 
double GetRBrake (void) const
 Gets the right brake. More...
 
double GetCBrake (void) const
 Gets the center brake. More...
 
bool Load (Element *el) override
 Loads the Flight Control System. More...
 
SGPath FindFullPathName (const SGPath &path) const override
 
void AddThrottle (void)
 
double GetDt (void) const
 
std::shared_ptr< FGPropertyManagerGetPropertyManager (void)
 
bool GetTrimStatus (void) const
 
double GetChannelDeltaT (void) const
 

Additional Inherited Members

- Public Types inherited from FGJSBBase
enum  { eL = 1 , eM , eN }
 Moments L, M, N.
 
enum  { eP = 1 , eQ , eR }
 Rates P, Q, R.
 
enum  { eU = 1 , eV , eW }
 Velocities U, V, W.
 
enum  { eX = 1 , eY , eZ }
 Positions X, Y, Z.
 
enum  { ePhi = 1 , eTht , ePsi }
 Euler angles Phi, Theta, Psi.
 
enum  { eDrag = 1 , eSide , eLift }
 Stability axis forces, Drag, Side force, Lift.
 
enum  { eRoll = 1 , ePitch , eYaw }
 Local frame orientation Roll, Pitch, Yaw.
 
enum  { eNorth = 1 , eEast , eDown }
 Local frame position North, East, Down.
 
enum  { eLat = 1 , eLong , eRad }
 Locations Radius, Latitude, Longitude.
 
enum  {
  inNone = 0 , inDegrees , inRadians , inMeters ,
  inFeet
}
 Conversion specifiers.
 
- Static Public Member Functions inherited from FGJSBBase
static const std::string & GetVersion (void)
 Returns the version number of JSBSim. More...
 
static constexpr double KelvinToFahrenheit (double kelvin)
 Converts from degrees Kelvin to degrees Fahrenheit. More...
 
static constexpr double CelsiusToRankine (double celsius)
 Converts from degrees Celsius to degrees Rankine. More...
 
static constexpr double RankineToCelsius (double rankine)
 Converts from degrees Rankine to degrees Celsius. More...
 
static constexpr double KelvinToRankine (double kelvin)
 Converts from degrees Kelvin to degrees Rankine. More...
 
static constexpr double RankineToKelvin (double rankine)
 Converts from degrees Rankine to degrees Kelvin. More...
 
static constexpr double FahrenheitToCelsius (double fahrenheit)
 Converts from degrees Fahrenheit to degrees Celsius. More...
 
static constexpr double CelsiusToFahrenheit (double celsius)
 Converts from degrees Celsius to degrees Fahrenheit. More...
 
static constexpr double CelsiusToKelvin (double celsius)
 Converts from degrees Celsius to degrees Kelvin. More...
 
static constexpr double KelvinToCelsius (double kelvin)
 Converts from degrees Kelvin to degrees Celsius. More...
 
static constexpr double FeetToMeters (double measure)
 Converts from feet to meters. More...
 
static bool EqualToRoundoff (double a, double b)
 Finite precision comparison. More...
 
static bool EqualToRoundoff (float a, float b)
 Finite precision comparison. More...
 
static bool EqualToRoundoff (float a, double b)
 Finite precision comparison. More...
 
static bool EqualToRoundoff (double a, float b)
 Finite precision comparison. More...
 
static constexpr double Constrain (double min, double value, double max)
 Constrain a value between a minimum and a maximum value.
 
static constexpr double sign (double num)
 
- Static Public Attributes inherited from FGJSBBase
static char highint [5] = {27, '[', '1', 'm', '\0' }
 highlights text
 
static char halfint [5] = {27, '[', '2', 'm', '\0' }
 low intensity text
 
static char normint [6] = {27, '[', '2', '2', 'm', '\0' }
 normal intensity text
 
static char reset [5] = {27, '[', '0', 'm', '\0' }
 resets text properties
 
static char underon [5] = {27, '[', '4', 'm', '\0' }
 underlines text
 
static char underoff [6] = {27, '[', '2', '4', 'm', '\0' }
 underline off
 
static char fgblue [6] = {27, '[', '3', '4', 'm', '\0' }
 blue text
 
static char fgcyan [6] = {27, '[', '3', '6', 'm', '\0' }
 cyan text
 
static char fgred [6] = {27, '[', '3', '1', 'm', '\0' }
 red text
 
static char fggreen [6] = {27, '[', '3', '2', 'm', '\0' }
 green text
 
static char fgdef [6] = {27, '[', '3', '9', 'm', '\0' }
 default text
 
static short debug_lvl = 1
 
- Protected Member Functions inherited from FGModel
bool Upload (Element *el, bool preLoad)
 Uploads this model in memory. More...
 
- Static Protected Member Functions inherited from FGJSBBase
static std::string CreateIndexedPropertyName (const std::string &Property, int index)
 
- Protected Attributes inherited from FGModel
unsigned int exe_ctr
 
FGFDMExecFDMExec
 
std::string Name
 
std::shared_ptr< FGPropertyManagerPropertyManager
 
unsigned int rate
 
- Protected Attributes inherited from FGModelFunctions
FGPropertyReader LocalProperties
 
std::vector< std::shared_ptr< FGFunction > > PostFunctions
 
std::vector< std::shared_ptr< FGFunction > > PreFunctions
 
- Static Protected Attributes inherited from FGJSBBase
static constexpr double radtodeg = 180. / M_PI
 
static constexpr double degtorad = M_PI / 180.
 
static constexpr double hptoftlbssec = 550.0
 
static constexpr double psftoinhg = 0.014138
 
static constexpr double psftopa = 47.88
 
static constexpr double fttom = 0.3048
 
static constexpr double ktstofps = 1852./(3600*fttom)
 
static constexpr double fpstokts = 1.0 / ktstofps
 
static constexpr double inchtoft = 1.0/12.0
 
static constexpr double m3toft3 = 1.0/(fttom*fttom*fttom)
 
static constexpr double in3tom3 = inchtoft*inchtoft*inchtoft/m3toft3
 
static constexpr double inhgtopa = 3386.38
 
static constexpr double slugtolb = 32.174049
 Note that definition of lbtoslug by the inverse of slugtolb and not to a different constant you can also get from some tables will make lbtoslug*slugtolb == 1 up to the magnitude of roundoff. More...
 
static constexpr double lbtoslug = 1.0/slugtolb
 
static constexpr double kgtolb = 2.20462
 
static constexpr double kgtoslug = 0.06852168
 
static const std::string needed_cfg_version = "2.0"
 
static const std::string JSBSim_version = JSBSIM_VERSION " " __DATE__ " " __TIME__
 

Constructor & Destructor Documentation

◆ FGFCS()

FGFCS ( FGFDMExec fdm)

Constructor.

Parameters
Executivea pointer to the parent executive object

Definition at line 73 of file FGFCS.cpp.

73  : FGModel(fdm), ChannelRate(1)
74 {
75  int i;
76  Name = "FGFCS";
77  systype = stFCS;
78 
79  fdmex = fdm;
80  DaCmd = DeCmd = DrCmd = DfCmd = DsbCmd = DspCmd = 0;
81  PTrimCmd = YTrimCmd = RTrimCmd = 0.0;
82  GearCmd = GearPos = 1; // default to gear down
83  BrakePos.resize(FGLGear::bgNumBrakeGroups);
84  TailhookPos = WingFoldPos = 0.0;
85 
86  bind();
87  for (i=0;i<NForms;i++) {
88  DePos[i] = DaLPos[i] = DaRPos[i] = DrPos[i] = 0.0;
89  DfPos[i] = DsbPos[i] = DspPos[i] = 0.0;
90  }
91 
92  Debug(0);
93 }
FGModel(FGFDMExec *)
Constructor.
Definition: FGModel.cpp:57

Member Function Documentation

◆ GetBrake()

double GetBrake ( FGLGear::BrakeGroup  bg)

Gets the brake for a specified group.

Parameters
bgwhich brakegroup to retrieve the command for
Returns
the brake setting for the supplied brake group argument

Definition at line 605 of file FGFCS.cpp.

606 {
607  return BrakePos[bg];
608 }

◆ GetCBrake()

double GetCBrake ( void  ) const
inline

Gets the center brake.

Returns
the center brake setting.

Definition at line 531 of file FGFCS.h.

531 {return BrakePos[FGLGear::bgCenter];}

◆ GetComponentStrings()

string GetComponentStrings ( const std::string &  delimiter) const

Retrieves all component names for inclusion in output stream.

Parameters
delimitereither a tab or comma string depending on output type
Returns
a string containing the descriptive names for all components

Definition at line 634 of file FGFCS.cpp.

635 {
636  string CompStrings = "";
637  bool firstime = true;
638  int total_count=0;
639 
640  for (unsigned int i=0; i<SystemChannels.size(); i++)
641  {
642  for (unsigned int c=0; c<SystemChannels[i]->GetNumComponents(); c++)
643  {
644  if (firstime) firstime = false;
645  else CompStrings += delimiter;
646 
647  CompStrings += SystemChannels[i]->GetComponent(c)->GetName();
648  total_count++;
649  }
650  }
651 
652  return CompStrings;
653 }

◆ GetComponentValues()

string GetComponentValues ( const std::string &  delimiter) const

Retrieves all component outputs for inclusion in output stream.

Parameters
delimitereither a tab or comma string depending on output type
Returns
a string containing the numeric values for the current set of component outputs

Definition at line 657 of file FGFCS.cpp.

658 {
659  std::ostringstream buf;
660 
661  bool firstime = true;
662  int total_count=0;
663 
664  for (unsigned int i=0; i<SystemChannels.size(); i++)
665  {
666  for (unsigned int c=0; c<SystemChannels[i]->GetNumComponents(); c++)
667  {
668  if (firstime) firstime = false;
669  else buf << delimiter;
670 
671  buf << setprecision(9) << SystemChannels[i]->GetComponent(c)->GetOutput();
672  total_count++;
673  }
674  }
675 
676  return buf.str();
677 }

◆ GetDaCmd()

double GetDaCmd ( void  ) const
inline

Gets the aileron command.

Returns
aileron command in range from -1.0 - 1.0

Definition at line 213 of file FGFCS.h.

213 { return DaCmd; }

◆ GetDaLPos()

double GetDaLPos ( int  form = ofRad) const
inline

Gets the left aileron position.

Returns
aileron position in radians

Definition at line 285 of file FGFCS.h.

286  { return DaLPos[form]; }

◆ GetDaRPos()

double GetDaRPos ( int  form = ofRad) const
inline

Gets the right aileron position.

Returns
aileron position in radians

Definition at line 290 of file FGFCS.h.

291  { return DaRPos[form]; }

◆ GetDeCmd()

double GetDeCmd ( void  ) const
inline

Gets the elevator command.

Returns
elevator command in range from -1.0 - 1.0

Definition at line 217 of file FGFCS.h.

217 { return DeCmd; }

◆ GetDePos()

double GetDePos ( int  form = ofRad) const
inline

Gets the elevator position.

Returns
elevator position in radians

Definition at line 295 of file FGFCS.h.

296  { return DePos[form]; }

◆ GetDfCmd()

double GetDfCmd ( void  ) const
inline

Gets the flaps command.

Returns
flaps command in range from 0 to 1.0

Definition at line 229 of file FGFCS.h.

229 { return DfCmd; }

◆ GetDfPos()

double GetDfPos ( int  form = ofRad) const
inline

Gets the flaps position.

Returns
flaps position in radians

Definition at line 315 of file FGFCS.h.

316  { return DfPos[form]; }

◆ GetDrCmd()

double GetDrCmd ( void  ) const
inline

Gets the rudder command.

Returns
rudder command in range from -1.0 - 1.0

Definition at line 221 of file FGFCS.h.

221 { return DrCmd; }

◆ GetDrPos()

double GetDrPos ( int  form = ofRad) const
inline

Gets the rudder position.

Returns
rudder position in radians

Definition at line 300 of file FGFCS.h.

301  { return DrPos[form]; }

◆ GetDsbCmd()

double GetDsbCmd ( void  ) const
inline

Gets the speedbrake command.

Returns
speedbrake command in range from 0 to 1.0

Definition at line 233 of file FGFCS.h.

233 { return DsbCmd; }

◆ GetDsbPos()

double GetDsbPos ( int  form = ofRad) const
inline

Gets the speedbrake position.

Returns
speedbrake position in radians

Definition at line 305 of file FGFCS.h.

306  { return DsbPos[form]; }

◆ GetDsCmd()

double GetDsCmd ( void  ) const
inline

Gets the steering command.

Returns
steering command in range from -1.0 - 1.0

Definition at line 225 of file FGFCS.h.

225 { return fdmex->GetGroundReactions()->GetDsCmd(); }
std::shared_ptr< FGGroundReactions > GetGroundReactions(void) const
Returns the FGGroundReactions pointer.
Definition: FGFDMExec.cpp:348

◆ GetDspCmd()

double GetDspCmd ( void  ) const
inline

Gets the spoiler command.

Returns
spoiler command in range from 0 to 1.0

Definition at line 237 of file FGFCS.h.

237 { return DspCmd; }

◆ GetDspPos()

double GetDspPos ( int  form = ofRad) const
inline

Gets the spoiler position.

Returns
spoiler position in radians

Definition at line 310 of file FGFCS.h.

311  { return DspPos[form]; }

◆ GetFeatherCmd()

bool GetFeatherCmd ( int  engine) const
inline

Gets the prop feather command.

Parameters
engineengine ID number
Returns
feather command for the given engine (on / off)

Definition at line 261 of file FGFCS.h.

261 { return PropFeatherCmd[engine]; }

◆ GetGearCmd()

double GetGearCmd ( void  ) const
inline

Get the gear extend/retract command.

0 commands gear up, 1 down. defaults to down.

Returns
the current value of the gear extend/retract command

Definition at line 278 of file FGFCS.h.

278 { return GearCmd; }

◆ GetGearPos()

double GetGearPos ( void  ) const
inline

Gets the gear position (0 up, 1 down), defaults to down.

Returns
gear position (0 up, 1 down)

Definition at line 334 of file FGFCS.h.

334 { return GearPos; }

◆ GetLBrake()

double GetLBrake ( void  ) const
inline

Gets the left brake.

Returns
the left brake setting.

Definition at line 523 of file FGFCS.h.

523 {return BrakePos[FGLGear::bgLeft];}

◆ GetMixtureCmd()

double GetMixtureCmd ( int  engine) const
inline

Gets the mixture command.

Parameters
engineengine ID number
Returns
mixture command in range from 0 - 1.0 for the given engine

Definition at line 249 of file FGFCS.h.

249 { return MixtureCmd[engine]; }

◆ GetMixturePos()

double GetMixturePos ( int  engine) const
inline

Gets the mixture position.

Parameters
engineengine ID number
Returns
mixture position for the given engine in range from 0 - 1.0

Definition at line 328 of file FGFCS.h.

328 { return MixturePos[engine]; }

◆ GetPitchTrimCmd()

double GetPitchTrimCmd ( void  ) const
inline

Gets the pitch trim command.

Returns
pitch trim command in range from -1.0 to 1.0

Definition at line 265 of file FGFCS.h.

265 { return PTrimCmd; }

◆ GetPropAdvance()

double GetPropAdvance ( int  engine) const
inline

Gets the prop pitch position.

Parameters
engineengine ID number
Returns
prop pitch position for the given engine in range from 0 - 1.0

Definition at line 347 of file FGFCS.h.

347 { return PropAdvance[engine]; }

◆ GetPropAdvanceCmd()

double GetPropAdvanceCmd ( int  engine) const
inline

Gets the prop pitch command.

Parameters
engineengine ID number
Returns
pitch command in range from 0.0 - 1.0 for the given engine

Definition at line 256 of file FGFCS.h.

256 { return PropAdvanceCmd[engine]; }

◆ GetPropFeather()

bool GetPropFeather ( int  engine) const
inline

Gets the prop feather position.

Parameters
engineengine ID number
Returns
prop fether for the given engine (on / off)

Definition at line 354 of file FGFCS.h.

354 { return PropFeather[engine]; }

◆ GetRBrake()

double GetRBrake ( void  ) const
inline

Gets the right brake.

Returns
the right brake setting.

Definition at line 527 of file FGFCS.h.

527 {return BrakePos[FGLGear::bgRight];}

◆ GetRollTrimCmd()

double GetRollTrimCmd ( void  ) const
inline

Gets the aileron trim command.

Returns
aileron trim command in range from -1.0 - 1.0

Definition at line 273 of file FGFCS.h.

273 { return RTrimCmd; }

◆ GetTailhookPos()

double GetTailhookPos ( void  ) const
inline

Gets the tailhook position (0 up, 1 down)

Returns
tailhook position (0 up, 1 down)

Definition at line 338 of file FGFCS.h.

338 { return TailhookPos; }

◆ GetThrottleCmd()

double GetThrottleCmd ( int  engine) const

Gets the throttle command.

Parameters
engineengine ID number
Returns
throttle command in range from 0 - 1.0 for the given engine

Definition at line 352 of file FGFCS.cpp.

353 {
354  if (engineNum < (int)ThrottlePos.size()) {
355  if (engineNum < 0) {
356  cerr << "Cannot get throttle value for ALL engines" << endl;
357  } else {
358  return ThrottleCmd[engineNum];
359  }
360  } else {
361  cerr << "Throttle " << engineNum << " does not exist! " << ThrottleCmd.size()
362  << " engines exist, but throttle setting for engine " << engineNum
363  << " is selected" << endl;
364  }
365  return 0.0;
366 }

◆ GetThrottlePos()

double GetThrottlePos ( int  engine) const

Gets the throttle position.

Parameters
engineengine ID number
Returns
throttle position for the given engine in range from 0 - 1.0

Definition at line 370 of file FGFCS.cpp.

371 {
372  if (engineNum < (int)ThrottlePos.size()) {
373  if (engineNum < 0) {
374  cerr << "Cannot get throttle value for ALL engines" << endl;
375  } else {
376  return ThrottlePos[engineNum];
377  }
378  } else {
379  cerr << "Throttle " << engineNum << " does not exist! " << ThrottlePos.size()
380  << " engines exist, but attempted throttle position setting is for engine "
381  << engineNum << endl;
382  }
383  return 0.0;
384 }

◆ GetWingFoldPos()

double GetWingFoldPos ( void  ) const
inline

Gets the wing fold position (0 unfolded, 1 folded)

Returns
wing fold position (0 unfolded, 1 folded)

Definition at line 342 of file FGFCS.h.

342 { return WingFoldPos; }

◆ GetYawTrimCmd()

double GetYawTrimCmd ( void  ) const
inline

Gets the rudder trim command.

Returns
rudder trim command in range from -1.0 - 1.0

Definition at line 269 of file FGFCS.h.

269 { return YTrimCmd; }

◆ Load()

bool Load ( Element el)
overridevirtual

Loads the Flight Control System.

Load() is called from FGFDMExec.

Parameters
elpointer to the Element instance
Returns
true if succesful

Reimplemented from FGModel.

Definition at line 472 of file FGFCS.cpp.

473 {
474  if (document->GetName() == "autopilot") {
475  Name = "Autopilot: ";
476  systype = stAutoPilot;
477  } else if (document->GetName() == "flight_control") {
478  Name = "FCS: ";
479  systype = stFCS;
480  } else if (document->GetName() == "system") {
481  Name = "System: ";
482  systype = stSystem;
483  }
484 
485  // Load interface properties from document
486  if (!FGModel::Upload(document, true))
487  return false;
488 
489  Name += document->GetAttributeValue("name");
490 
491  Debug(2);
492 
493  Element* channel_element = document->FindElement("channel");
494 
495  while (channel_element) {
496 
497  FGFCSChannel* newChannel = 0;
498 
499  string sOnOffProperty = channel_element->GetAttributeValue("execute");
500  string sChannelName = channel_element->GetAttributeValue("name");
501 
502  if (!channel_element->GetAttributeValue("execrate").empty())
503  ChannelRate = channel_element->GetAttributeValueAsNumber("execrate");
504  else
505  ChannelRate = 1;
506 
507  if (sOnOffProperty.length() > 0) {
508  FGPropertyNode* OnOffPropertyNode = PropertyManager->GetNode(sOnOffProperty);
509  if (OnOffPropertyNode == 0) {
510  cerr << channel_element->ReadFrom() << highint << fgred
511  << "The On/Off property, " << sOnOffProperty << " specified for channel "
512  << channel_element->GetAttributeValue("name") << " is undefined or not "
513  << "understood. The simulation will abort" << reset << endl;
514  throw("Bad system definition");
515  } else
516  newChannel = new FGFCSChannel(this, sChannelName, ChannelRate,
517  OnOffPropertyNode);
518  } else
519  newChannel = new FGFCSChannel(this, sChannelName, ChannelRate);
520 
521  SystemChannels.push_back(newChannel);
522 
523  if (debug_lvl > 0)
524  cout << endl << highint << fgblue << " Channel "
525  << normint << channel_element->GetAttributeValue("name") << reset << endl;
526 
527  Element* component_element = channel_element->GetElement();
528  while (component_element) {
529  try {
530  if ((component_element->GetName() == string("lag_filter")) ||
531  (component_element->GetName() == string("lead_lag_filter")) ||
532  (component_element->GetName() == string("washout_filter")) ||
533  (component_element->GetName() == string("second_order_filter")) )
534  {
535  newChannel->Add(new FGFilter(this, component_element));
536  } else if ((component_element->GetName() == string("pure_gain")) ||
537  (component_element->GetName() == string("scheduled_gain")) ||
538  (component_element->GetName() == string("aerosurface_scale")))
539  {
540  newChannel->Add(new FGGain(this, component_element));
541  } else if (component_element->GetName() == string("summer")) {
542  newChannel->Add(new FGSummer(this, component_element));
543  } else if (component_element->GetName() == string("deadband")) {
544  newChannel->Add(new FGDeadBand(this, component_element));
545  } else if (component_element->GetName() == string("switch")) {
546  newChannel->Add(new FGSwitch(this, component_element));
547  } else if (component_element->GetName() == string("kinematic")) {
548  newChannel->Add(new FGKinemat(this, component_element));
549  } else if (component_element->GetName() == string("fcs_function")) {
550  newChannel->Add(new FGFCSFunction(this, component_element));
551  } else if (component_element->GetName() == string("pid")) {
552  newChannel->Add(new FGPID(this, component_element));
553  } else if (component_element->GetName() == string("integrator")) {
554  // <integrator> is equivalent to <pid type="trap">
555  Element* c1_el = component_element->FindElement("c1");
556  if (!c1_el) {
557  cerr << component_element->ReadFrom();
558  throw("INTEGRATOR component " + component_element->GetAttributeValue("name")
559  + " does not provide the parameter <c1>");
560  }
561  c1_el->ChangeName("ki");
562  if (!c1_el->HasAttribute("type"))
563  c1_el->AddAttribute("type", "trap");
564  newChannel->Add(new FGPID(this, component_element));
565  } else if (component_element->GetName() == string("actuator")) {
566  newChannel->Add(new FGActuator(this, component_element));
567  } else if (component_element->GetName() == string("sensor")) {
568  newChannel->Add(new FGSensor(this, component_element));
569  } else if (component_element->GetName() == string("accelerometer")) {
570  newChannel->Add(new FGAccelerometer(this, component_element));
571  } else if (component_element->GetName() == string("magnetometer")) {
572  newChannel->Add(new FGMagnetometer(this, component_element));
573  } else if (component_element->GetName() == string("gyro")) {
574  newChannel->Add(new FGGyro(this, component_element));
575  } else if ((component_element->GetName() == string("waypoint_heading")) ||
576  (component_element->GetName() == string("waypoint_distance")))
577  {
578  newChannel->Add(new FGWaypoint(this, component_element));
579  } else if (component_element->GetName() == string("angle")) {
580  newChannel->Add(new FGAngles(this, component_element));
581  } else if (component_element->GetName() == string("distributor")) {
582  newChannel->Add(new FGDistributor(this, component_element));
583  } else if (component_element->GetName() == string("linear_actuator")) {
584  newChannel->Add(new FGLinearActuator(this, component_element));
585  } else {
586  cerr << "Unknown FCS component: " << component_element->GetName() << endl;
587  }
588  } catch(string& s) {
589  cerr << highint << fgred << endl << " " << s << endl;
590  cerr << reset << endl;
591  return false;
592  }
593  component_element = channel_element->GetNextElement();
594  }
595  channel_element = document->FindNextElement("channel");
596  }
597 
598  PostLoad(document, FDMExec);
599 
600  return true;
601 }
static char normint[6]
normal intensity text
Definition: FGJSBBase.h:155
static char fgred[6]
red text
Definition: FGJSBBase.h:167
static char fgblue[6]
blue text
Definition: FGJSBBase.h:163
static char reset[5]
resets text properties
Definition: FGJSBBase.h:157
static char highint[5]
highlights text
Definition: FGJSBBase.h:151
bool Upload(Element *el, bool preLoad)
Uploads this model in memory.
Definition: FGModel.cpp:110
+ Here is the call graph for this function:

◆ Run()

bool Run ( bool  Holding)
overridevirtual

Runs the Flight Controls model; called by the Executive Can pass in a value indicating if the executive is directing the simulation to Hold.

Parameters
Holdingif true, the executive has been directed to hold the sim from advancing time. Some models may ignore this flag, such as the Input model, which may need to be active to listen on a socket for the "Resume" command to be given.
Returns
false if no error

Reimplemented from FGModel.

Definition at line 154 of file FGFCS.cpp.

155 {
156  unsigned int i;
157 
158  if (FGModel::Run(Holding)) return true; // fast exit if nothing to do
159  if (Holding) return false;
160 
161  RunPreFunctions();
162 
163  for (i=0; i<ThrottlePos.size(); i++) ThrottlePos[i] = ThrottleCmd[i];
164  for (i=0; i<MixturePos.size(); i++) MixturePos[i] = MixtureCmd[i];
165  for (i=0; i<PropAdvance.size(); i++) PropAdvance[i] = PropAdvanceCmd[i];
166  for (i=0; i<PropFeather.size(); i++) PropFeather[i] = PropFeatherCmd[i];
167 
168  // Execute system channels in order
169  for (i=0; i<SystemChannels.size(); i++) {
170  if (debug_lvl & 4) cout << " Executing System Channel: " << SystemChannels[i]->GetName() << endl;
171  ChannelRate = SystemChannels[i]->GetRate();
172  SystemChannels[i]->Execute();
173  }
174  ChannelRate = 1;
175 
176  RunPostFunctions();
177 
178  return false;
179 }
virtual bool Run(bool Holding)
Runs the model; called by the Executive.
Definition: FGModel.cpp:89
+ Here is the call graph for this function:

◆ SetCBrake()

void SetCBrake ( double  cmd)
inline

Sets the center brake group.

Parameters
cmdbrake setting in percent (0.0 - 1.0)

Definition at line 512 of file FGFCS.h.

512 {BrakePos[FGLGear::bgCenter] = cmd;}

◆ SetDaCmd()

void SetDaCmd ( double  cmd)
inline

Sets the aileron command.

Parameters
cmdaileron command

Definition at line 374 of file FGFCS.h.

374 { DaCmd = cmd; }

◆ SetDaLPos()

void SetDaLPos ( int  form,
double  pos 
)

Sets the left aileron position.

Parameters
cmdleft aileron position in radians

Definition at line 183 of file FGFCS.cpp.

184 {
185  switch(form) {
186  case ofRad:
187  DaLPos[ofRad] = pos;
188  DaLPos[ofDeg] = pos*radtodeg;
189  break;
190  case ofDeg:
191  DaLPos[ofRad] = pos*degtorad;
192  DaLPos[ofDeg] = pos;
193  break;
194  case ofNorm:
195  DaLPos[ofNorm] = pos;
196  }
197  DaLPos[ofMag] = fabs(DaLPos[ofRad]);
198 }

◆ SetDaRPos()

void SetDaRPos ( int  form,
double  pos 
)

Sets the right aileron position.

Parameters
cmdright aileron position in radians

Definition at line 202 of file FGFCS.cpp.

203 {
204  switch(form) {
205  case ofRad:
206  DaRPos[ofRad] = pos;
207  DaRPos[ofDeg] = pos*radtodeg;
208  break;
209  case ofDeg:
210  DaRPos[ofRad] = pos*degtorad;
211  DaRPos[ofDeg] = pos;
212  break;
213  case ofNorm:
214  DaRPos[ofNorm] = pos;
215  }
216  DaRPos[ofMag] = fabs(DaRPos[ofRad]);
217 }

◆ SetDeCmd()

void SetDeCmd ( double  cmd)
inline

Sets the elevator command.

Parameters
cmdelevator command in percent

Definition at line 378 of file FGFCS.h.

378 { DeCmd = cmd; }

◆ SetDePos()

void SetDePos ( int  form,
double  pos 
)

Sets the elevator position.

Parameters
cmdelevator position in radians

Definition at line 221 of file FGFCS.cpp.

222 {
223  switch(form) {
224  case ofRad:
225  DePos[ofRad] = pos;
226  DePos[ofDeg] = pos*radtodeg;
227  break;
228  case ofDeg:
229  DePos[ofRad] = pos*degtorad;
230  DePos[ofDeg] = pos;
231  break;
232  case ofNorm:
233  DePos[ofNorm] = pos;
234  }
235  DePos[ofMag] = fabs(DePos[ofRad]);
236 }

◆ SetDfCmd()

void SetDfCmd ( double  cmd)
inline

Sets the flaps command.

Parameters
cmdflaps command in percent

Definition at line 390 of file FGFCS.h.

390 { DfCmd = cmd; }

◆ SetDfPos()

void SetDfPos ( int  form,
double  pos 
)

Sets the flaps position.

Parameters
cmdflaps position in radians

Definition at line 259 of file FGFCS.cpp.

260 {
261  switch(form) {
262  case ofRad:
263  DfPos[ofRad] = pos;
264  DfPos[ofDeg] = pos*radtodeg;
265  break;
266  case ofDeg:
267  DfPos[ofRad] = pos*degtorad;
268  DfPos[ofDeg] = pos;
269  break;
270  case ofNorm:
271  DfPos[ofNorm] = pos;
272  }
273  DfPos[ofMag] = fabs(DfPos[ofRad]);
274 }

◆ SetDrCmd()

void SetDrCmd ( double  cmd)
inline

Sets the rudder command.

Parameters
cmdrudder command in percent

Definition at line 382 of file FGFCS.h.

382 { DrCmd = cmd; }

◆ SetDrPos()

void SetDrPos ( int  form,
double  pos 
)

Sets the rudder position.

Parameters
cmdrudder position in radians

Definition at line 240 of file FGFCS.cpp.

241 {
242  switch(form) {
243  case ofRad:
244  DrPos[ofRad] = pos;
245  DrPos[ofDeg] = pos*radtodeg;
246  break;
247  case ofDeg:
248  DrPos[ofRad] = pos*degtorad;
249  DrPos[ofDeg] = pos;
250  break;
251  case ofNorm:
252  DrPos[ofNorm] = pos;
253  }
254  DrPos[ofMag] = fabs(DrPos[ofRad]);
255 }

◆ SetDsbCmd()

void SetDsbCmd ( double  cmd)
inline

Sets the speedbrake command.

Parameters
cmdspeedbrake command in percent

Definition at line 394 of file FGFCS.h.

394 { DsbCmd = cmd; }

◆ SetDsbPos()

void SetDsbPos ( int  form,
double  pos 
)

Sets the speedbrake position.

Parameters
cmdspeedbrake position in radians

Definition at line 278 of file FGFCS.cpp.

279 {
280  switch(form) {
281  case ofRad:
282  DsbPos[ofRad] = pos;
283  DsbPos[ofDeg] = pos*radtodeg;
284  break;
285  case ofDeg:
286  DsbPos[ofRad] = pos*degtorad;
287  DsbPos[ofDeg] = pos;
288  break;
289  case ofNorm:
290  DsbPos[ofNorm] = pos;
291  }
292  DsbPos[ofMag] = fabs(DsbPos[ofRad]);
293 }

◆ SetDsCmd()

void SetDsCmd ( double  cmd)
inline

Sets the steering command.

Parameters
cmdsteering command in percent

Definition at line 386 of file FGFCS.h.

386 { fdmex->GetGroundReactions()->SetDsCmd( cmd ); }

◆ SetDspCmd()

void SetDspCmd ( double  cmd)
inline

Sets the spoilers command.

Parameters
cmdspoilers command in percent

Definition at line 398 of file FGFCS.h.

398 { DspCmd = cmd; }

◆ SetDspPos()

void SetDspPos ( int  form,
double  pos 
)

Sets the spoiler position.

Parameters
cmdspoiler position in radians

Definition at line 297 of file FGFCS.cpp.

298 {
299  switch(form) {
300  case ofRad:
301  DspPos[ofRad] = pos;
302  DspPos[ofDeg] = pos*radtodeg;
303  break;
304  case ofDeg:
305  DspPos[ofRad] = pos*degtorad;
306  DspPos[ofDeg] = pos;
307  break;
308  case ofNorm:
309  DspPos[ofNorm] = pos;
310  }
311  DspPos[ofMag] = fabs(DspPos[ofRad]);
312 }

◆ SetFeatherCmd()

void SetFeatherCmd ( int  engine,
bool  cmd 
)

Sets the propeller feather command for the specified engine.

Parameters
engineengine ID number
cmdfeather (bool)

Definition at line 444 of file FGFCS.cpp.

445 {
446  if (engineNum < (int)ThrottlePos.size()) {
447  if (engineNum < 0) {
448  for (unsigned int ctr=0; ctr<PropFeatherCmd.size(); ctr++)
449  PropFeatherCmd[ctr] = setting;
450  } else {
451  PropFeatherCmd[engineNum] = setting;
452  }
453  }
454 }

◆ SetGearCmd()

void SetGearCmd ( double  gearcmd)
inline

Set the gear extend/retract command, defaults to down.

Parameters
gearcommand 0 for up, 1 for down

Definition at line 424 of file FGFCS.h.

424 { GearCmd = gearcmd; }

◆ SetGearPos()

void SetGearPos ( double  gearpos)
inline

Set the gear extend/retract position, defaults to down.

Parameters
gearposition 0 up, 1 down

Definition at line 479 of file FGFCS.h.

479 { GearPos = gearpos; }

◆ SetLBrake()

void SetLBrake ( double  cmd)
inline

Sets the left brake group.

Parameters
cmdbrake setting in percent (0.0 - 1.0)

Definition at line 504 of file FGFCS.h.

504 {BrakePos[FGLGear::bgLeft] = cmd;}

◆ SetMixtureCmd()

void SetMixtureCmd ( int  engine,
double  cmd 
)

Sets the mixture command for the specified engine.

Parameters
engineengine ID number
cmdnormalized mixture command (0.0 - 1.0)

Definition at line 388 of file FGFCS.cpp.

389 {
390  if (engineNum < (int)ThrottlePos.size()) {
391  if (engineNum < 0) {
392  for (unsigned int ctr=0; ctr<MixtureCmd.size(); ctr++)
393  MixtureCmd[ctr] = setting;
394  } else {
395  MixtureCmd[engineNum] = setting;
396  }
397  }
398 }

◆ SetMixturePos()

void SetMixturePos ( int  engine,
double  cmd 
)

Sets the actual mixture setting for the specified engine.

Parameters
engineengine ID number
cmdnormalized mixture setting (0.0 - 1.0)

Definition at line 402 of file FGFCS.cpp.

403 {
404  if (engineNum < (int)ThrottlePos.size()) {
405  if (engineNum < 0) {
406  for (unsigned int ctr=0; ctr<MixtureCmd.size(); ctr++)
407  MixturePos[ctr] = MixtureCmd[ctr];
408  } else {
409  MixturePos[engineNum] = setting;
410  }
411  }
412 }

◆ SetPitchTrimCmd()

void SetPitchTrimCmd ( double  cmd)
inline

Sets the pitch trim command.

Parameters
cmdpitch trim command in percent

Definition at line 402 of file FGFCS.h.

402 { PTrimCmd = cmd; }

◆ SetPropAdvance()

void SetPropAdvance ( int  engine,
double  cmd 
)

Sets the actual prop pitch setting for the specified engine.

Parameters
engineengine ID number
cmdprop pitch setting in percent (0.0 - 1.0)

Definition at line 430 of file FGFCS.cpp.

431 {
432  if (engineNum < (int)ThrottlePos.size()) {
433  if (engineNum < 0) {
434  for (unsigned int ctr=0; ctr<PropAdvanceCmd.size(); ctr++)
435  PropAdvance[ctr] = PropAdvanceCmd[ctr];
436  } else {
437  PropAdvance[engineNum] = setting;
438  }
439  }
440 }

◆ SetPropAdvanceCmd()

void SetPropAdvanceCmd ( int  engine,
double  cmd 
)

Sets the propeller pitch command for the specified engine.

Parameters
engineengine ID number
cmdpitch command in percent (0.0 - 1.0)

Definition at line 416 of file FGFCS.cpp.

417 {
418  if (engineNum < (int)ThrottlePos.size()) {
419  if (engineNum < 0) {
420  for (unsigned int ctr=0; ctr<PropAdvanceCmd.size(); ctr++)
421  PropAdvanceCmd[ctr] = setting;
422  } else {
423  PropAdvanceCmd[engineNum] = setting;
424  }
425  }
426 }

◆ SetPropFeather()

void SetPropFeather ( int  engine,
bool  cmd 
)

Sets the actual prop feather setting for the specified engine.

Parameters
engineengine ID number
cmdprop fether setting (bool)

Definition at line 458 of file FGFCS.cpp.

459 {
460  if (engineNum < (int)ThrottlePos.size()) {
461  if (engineNum < 0) {
462  for (unsigned int ctr=0; ctr<PropFeatherCmd.size(); ctr++)
463  PropFeather[ctr] = PropFeatherCmd[ctr];
464  } else {
465  PropFeather[engineNum] = setting;
466  }
467  }
468 }

◆ SetRBrake()

void SetRBrake ( double  cmd)
inline

Sets the right brake group.

Parameters
cmdbrake setting in percent (0.0 - 1.0)

Definition at line 508 of file FGFCS.h.

508 {BrakePos[FGLGear::bgRight] = cmd;}

◆ SetRollTrimCmd()

void SetRollTrimCmd ( double  cmd)
inline

Sets the aileron trim command.

Parameters
cmdaileron trim command in percent

Definition at line 410 of file FGFCS.h.

410 { RTrimCmd = cmd; }

◆ SetTailhookPos()

void SetTailhookPos ( double  hookpos)
inline

Set the tailhook position.

Parameters
tailhookposition 0 up, 1 down

Definition at line 483 of file FGFCS.h.

483 { TailhookPos = hookpos; }

◆ SetThrottleCmd()

void SetThrottleCmd ( int  engine,
double  cmd 
)

Sets the throttle command for the specified engine.

Parameters
engineengine ID number
cmdnormalized throttle command (0.0 - 1.0)

Definition at line 316 of file FGFCS.cpp.

317 {
318  if (engineNum < (int)ThrottlePos.size()) {
319  if (engineNum < 0) {
320  for (unsigned int ctr=0; ctr<ThrottleCmd.size(); ctr++)
321  ThrottleCmd[ctr] = setting;
322  } else {
323  ThrottleCmd[engineNum] = setting;
324  }
325  } else {
326  cerr << "Throttle " << engineNum << " does not exist! " << ThrottleCmd.size()
327  << " engines exist, but attempted throttle command is for engine "
328  << engineNum << endl;
329  }
330 }

◆ SetThrottlePos()

void SetThrottlePos ( int  engine,
double  cmd 
)

Sets the actual throttle setting for the specified engine.

Parameters
engineengine ID number
cmdnormalized throttle setting (0.0 - 1.0)

Definition at line 334 of file FGFCS.cpp.

335 {
336  if (engineNum < (int)ThrottlePos.size()) {
337  if (engineNum < 0) {
338  for (unsigned int ctr=0; ctr<ThrottlePos.size(); ctr++)
339  ThrottlePos[ctr] = setting;
340  } else {
341  ThrottlePos[engineNum] = setting;
342  }
343  } else {
344  cerr << "Throttle " << engineNum << " does not exist! " << ThrottlePos.size()
345  << " engines exist, but attempted throttle position setting is for engine "
346  << engineNum << endl;
347  }
348 }

◆ SetWingFoldPos()

void SetWingFoldPos ( double  foldpos)
inline

Set the wing fold position.

Parameters
wingfold position 0 unfolded, 1 folded

Definition at line 487 of file FGFCS.h.

487 { WingFoldPos = foldpos; }

◆ SetYawTrimCmd()

void SetYawTrimCmd ( double  cmd)
inline

Sets the rudder trim command.

Parameters
cmdrudder trim command in percent

Definition at line 406 of file FGFCS.h.

406 { YTrimCmd = cmd; }

The documentation for this class was generated from the following files: