JSBSim Flight Dynamics Model 1.3.0 (09 Apr 2026)
An Open Source Flight Dynamics and Control Software Library in C++
Loading...
Searching...
No Matches
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.
 
 ~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.
 
Pilot input command retrieval
double GetDaCmd (void) const
 Gets the aileron command.
 
double GetDeCmd (void) const
 Gets the elevator command.
 
double GetDrCmd (void) const
 Gets the rudder command.
 
double GetDsCmd (void) const
 Gets the steering command.
 
double GetDfCmd (void) const
 Gets the flaps command.
 
double GetDsbCmd (void) const
 Gets the speedbrake command.
 
double GetDspCmd (void) const
 Gets the spoiler command.
 
double GetThrottleCmd (int engine) const
 Gets the throttle command.
 
const std::vector< double > & GetThrottleCmd () const
 
double GetMixtureCmd (int engine) const
 Gets the mixture command.
 
const std::vector< double > & GetMixtureCmd () const
 
double GetPropAdvanceCmd (int engine) const
 Gets the prop pitch command.
 
bool GetFeatherCmd (int engine) const
 Gets the prop feather command.
 
double GetPitchTrimCmd (void) const
 Gets the pitch trim command.
 
double GetYawTrimCmd (void) const
 Gets the rudder trim command.
 
double GetRollTrimCmd (void) const
 Gets the aileron trim command.
 
double GetGearCmd (void) const
 Get the gear extend/retract command.
 
Aerosurface position retrieval
double GetDaLPos (int form=ofRad) const
 Gets the left aileron position.
 
double GetDaRPos (int form=ofRad) const
 Gets the right aileron position.
 
double GetDePos (int form=ofRad) const
 Gets the elevator position.
 
double GetDrPos (int form=ofRad) const
 Gets the rudder position.
 
double GetDsbPos (int form=ofRad) const
 Gets the speedbrake position.
 
double GetDspPos (int form=ofRad) const
 Gets the spoiler position.
 
double GetDfPos (int form=ofRad) const
 Gets the flaps position.
 
double GetThrottlePos (int engine) const
 Gets the throttle position.
 
const std::vector< double > & GetThrottlePos () const
 
double GetMixturePos (int engine) const
 Gets the mixture position.
 
const std::vector< double > & GetMixturePos () const
 
double GetGearPos (void) const
 Gets the gear position (0 up, 1 down), defaults to down.
 
double GetTailhookPos (void) const
 Gets the tailhook position (0 up, 1 down)
 
double GetWingFoldPos (void) const
 Gets the wing fold position (0 unfolded, 1 folded)
 
double GetPropAdvance (int engine) const
 Gets the prop pitch position.
 
const std::vector< double > & GetPropAdvance () const
 
bool GetPropFeather (int engine) const
 Gets the prop feather position.
 
const std::vector< bool > & GetPropFeather () const
 
std::string GetComponentStrings (const std::string &delimiter) const
 Retrieves all component names for inclusion in output stream.
 
std::string GetComponentValues (const std::string &delimiter) const
 Retrieves all component outputs for inclusion in output stream.
 
Pilot input command setting
void SetDaCmd (double cmd)
 Sets the aileron command.
 
void SetDeCmd (double cmd)
 Sets the elevator command.
 
void SetDrCmd (double cmd)
 Sets the rudder command.
 
void SetDsCmd (double cmd)
 Sets the steering command.
 
void SetDfCmd (double cmd)
 Sets the flaps command.
 
void SetDsbCmd (double cmd)
 Sets the speedbrake command.
 
void SetDspCmd (double cmd)
 Sets the spoilers command.
 
void SetPitchTrimCmd (double cmd)
 Sets the pitch trim command.
 
void SetYawTrimCmd (double cmd)
 Sets the rudder trim command.
 
void SetRollTrimCmd (double cmd)
 Sets the aileron trim command.
 
void SetThrottleCmd (int engine, double cmd)
 Sets the throttle command for the specified engine.
 
void SetMixtureCmd (int engine, double cmd)
 Sets the mixture command for the specified engine.
 
void SetGearCmd (double gearcmd)
 Set the gear extend/retract command, defaults to down.
 
void SetPropAdvanceCmd (int engine, double cmd)
 Sets the propeller pitch command for the specified engine.
 
void SetFeatherCmd (int engine, bool cmd)
 Sets the propeller feather command for the specified engine.
 
Aerosurface position setting
void SetDaLPos (int form, double pos)
 Sets the left aileron position.
 
void SetDaRPos (int form, double pos)
 Sets the right aileron position.
 
void SetDePos (int form, double pos)
 Sets the elevator position.
 
void SetDrPos (int form, double pos)
 Sets the rudder position.
 
void SetDfPos (int form, double pos)
 Sets the flaps position.
 
void SetDsbPos (int form, double pos)
 Sets the speedbrake position.
 
void SetDspPos (int form, double pos)
 Sets the spoiler position.
 
void SetThrottlePos (int engine, double cmd)
 Sets the actual throttle setting for the specified engine.
 
void SetMixturePos (int engine, double cmd)
 Sets the actual mixture setting for the specified engine.
 
void SetGearPos (double gearpos)
 Set the gear extend/retract position, defaults to down.
 
void SetTailhookPos (double hookpos)
 Set the tailhook position.
 
void SetWingFoldPos (double foldpos)
 Set the wing fold position.
 
void SetPropAdvance (int engine, double cmd)
 Sets the actual prop pitch setting for the specified engine.
 
void SetPropFeather (int engine, bool cmd)
 Sets the actual prop feather setting for the specified engine.
 
- Public Member Functions inherited from FGModel
 FGModel (FGFDMExec *)
 Constructor.
 
 ~FGModel () override
 Destructor.
 
FGFDMExecGetExec (void) const
 
const std::string & GetName (void) const
 
unsigned int GetRate (void) const
 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.
 
std::string GetFunctionValues (const std::string &delimeter) const
 Gets the function values.
 
std::shared_ptr< FGFunctionGetPreFunction (const std::string &name)
 Get one of the "pre" function.
 
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.
 
void SetRBrake (double cmd)
 Sets the right brake group.
 
void SetCBrake (double cmd)
 Sets the center brake group.
 
double GetBrake (FGLGear::BrakeGroup bg)
 Gets the brake for a specified group.
 
const std::vector< double > & GetBrakePos () const
 
double GetLBrake (void) const
 Gets the left brake.
 
double GetRBrake (void) const
 Gets the right brake.
 
double GetCBrake (void) const
 Gets the center brake.
 
bool Load (Element *el) override
 Loads the Flight Control System.
 
SGPath FindFullPathName (const SGPath &path) const override
 
void AddThrottle (void)
 
double GetDt (void) const
 
std::shared_ptr< FGPropertyManager > GetPropertyManager (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. More...
 
enum  { eP = 1 , eQ , eR }
 Rates P, Q, R. More...
 
enum  { eU = 1 , eV , eW }
 Velocities U, V, W. More...
 
enum  { eX = 1 , eY , eZ }
 Positions X, Y, Z. More...
 
enum  { ePhi = 1 , eTht , ePsi }
 Euler angles Phi, Theta, Psi. More...
 
enum  { eDrag = 1 , eSide , eLift }
 Stability axis forces, Drag, Side force, Lift. More...
 
enum  { eRoll = 1 , ePitch , eYaw }
 Local frame orientation Roll, Pitch, Yaw. More...
 
enum  { eNorth = 1 , eEast , eDown }
 Local frame position North, East, Down. More...
 
enum  { eLat = 1 , eLong , eRad }
 Locations Radius, Latitude, Longitude. More...
 
enum  {
  inNone = 0 , inDegrees , inRadians , inMeters ,
  inFeet
}
 Conversion specifiers. More...
 
- Static Public Member Functions inherited from FGJSBBase
static const std::string & GetVersion (void)
 Returns the version number of JSBSim.
 
static constexpr double KelvinToFahrenheit (double kelvin)
 Converts from degrees Kelvin to degrees Fahrenheit.
 
static constexpr double CelsiusToRankine (double celsius)
 Converts from degrees Celsius to degrees Rankine.
 
static constexpr double RankineToCelsius (double rankine)
 Converts from degrees Rankine to degrees Celsius.
 
static constexpr double KelvinToRankine (double kelvin)
 Converts from degrees Kelvin to degrees Rankine.
 
static constexpr double RankineToKelvin (double rankine)
 Converts from degrees Rankine to degrees Kelvin.
 
static constexpr double FahrenheitToCelsius (double fahrenheit)
 Converts from degrees Fahrenheit to degrees Celsius.
 
static constexpr double CelsiusToFahrenheit (double celsius)
 Converts from degrees Celsius to degrees Fahrenheit.
 
static constexpr double CelsiusToKelvin (double celsius)
 Converts from degrees Celsius to degrees Kelvin.
 
static constexpr double KelvinToCelsius (double kelvin)
 Converts from degrees Kelvin to degrees Celsius.
 
static constexpr double FeetToMeters (double measure)
 Converts from feet to meters.
 
static bool EqualToRoundoff (double a, double b)
 Finite precision comparison.
 
static bool EqualToRoundoff (float a, float b)
 Finite precision comparison.
 
static bool EqualToRoundoff (float a, double b)
 Finite precision comparison.
 
static bool EqualToRoundoff (double a, float b)
 Finite precision comparison.
 
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.
 
- 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< FGPropertyManager > PropertyManager
 
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.
 
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__
 

Member Enumeration Documentation

◆ SystemType

enum SystemType

Definition at line 553 of file FGFCS.h.

553{ stFCS, stSystem, stAutoPilot };

Constructor & Destructor Documentation

◆ FGFCS()

FGFCS ( FGFDMExec fdm)

Constructor.

Parameters
Executivea pointer to the parent executive object

Definition at line 74 of file FGFCS.cpp.

74 : FGModel(fdm), ChannelRate(1)
75{
76 int i;
77 Name = "FGFCS";
78 systype = stFCS;
79
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:58

◆ ~FGFCS()

~FGFCS ( )
override

Destructor.

Definition at line 97 of file FGFCS.cpp.

98{
99 ThrottleCmd.clear();
100 ThrottlePos.clear();
101 MixtureCmd.clear();
102 MixturePos.clear();
103 PropAdvanceCmd.clear();
104 PropAdvance.clear();
105 PropFeatherCmd.clear();
106 PropFeather.clear();
107
108 unsigned int i;
109
110 for (i=0;i<SystemChannels.size();i++) delete SystemChannels[i];
111 SystemChannels.clear();
112
113 Debug(1);
114}

Member Function Documentation

◆ AddThrottle()

void AddThrottle ( void  )

Definition at line 696 of file FGFCS.cpp.

697{
698 ThrottleCmd.push_back(0.0);
699 ThrottlePos.push_back(0.0);
700 MixtureCmd.push_back(0.0); // assume throttle and mixture are coupled
701 MixturePos.push_back(0.0);
702 PropAdvanceCmd.push_back(0.0); // assume throttle and prop pitch are coupled
703 PropAdvance.push_back(0.0);
704 PropFeatherCmd.push_back(false);
705 PropFeather.push_back(false);
706
707 unsigned int num = (unsigned int)ThrottleCmd.size()-1;
708 bindThrottle(num);
709}

◆ FindFullPathName()

SGPath FindFullPathName ( const SGPath &  path) const
overridevirtual

Reimplemented from FGModel.

Definition at line 627 of file FGFCS.cpp.

628{
629 SGPath name = FGModel::FindFullPathName(path);
630 if (systype != stSystem || !name.isNull()) return name;
631
632#ifdef _WIN32
633 const array<string, 1> dir_names = {"Systems"};
634#else
635 // Check alternative capitalization for case sensitive OSes.
636 const array<string, 2> dir_names = {"Systems", "systems"};
637#endif
638
639 for(const string& dir_name: dir_names) {
640 name = CheckPathName(FDMExec->GetFullAircraftPath()/dir_name, path);
641 if (!name.isNull()) return name;
642 }
643
644 return CheckPathName(FDMExec->GetSystemsPath(), path);
645}
const SGPath & GetFullAircraftPath(void)
Retrieves the full aircraft path name.
Definition FGFDMExec.h:402
const SGPath & GetSystemsPath(void)
Retrieves the systems path.
Definition FGFDMExec.h:400

◆ 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 620 of file FGFCS.cpp.

621{
622 return BrakePos[bg];
623}

◆ GetBrakePos()

const std::vector< double > & GetBrakePos ( ) const
inline

Definition at line 538 of file FGFCS.h.

538{return BrakePos;}

◆ GetCBrake()

double GetCBrake ( void  ) const
inline

Gets the center brake.

Returns
the center brake setting.

Definition at line 550 of file FGFCS.h.

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

◆ GetChannelDeltaT()

double GetChannelDeltaT ( void  ) const
inline

Definition at line 569 of file FGFCS.h.

569{ return GetDt() * ChannelRate; }

◆ 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 649 of file FGFCS.cpp.

650{
651 string CompStrings = "";
652 bool firstime = true;
653 int total_count=0;
654
655 for (unsigned int i=0; i<SystemChannels.size(); i++)
656 {
657 for (unsigned int c=0; c<SystemChannels[i]->GetNumComponents(); c++)
658 {
659 if (firstime) firstime = false;
660 else CompStrings += delimiter;
661
662 CompStrings += SystemChannels[i]->GetComponent(c)->GetName();
663 total_count++;
664 }
665 }
666
667 return CompStrings;
668}

◆ 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 672 of file FGFCS.cpp.

673{
674 std::ostringstream buf;
675
676 bool firstime = true;
677 int total_count=0;
678
679 for (unsigned int i=0; i<SystemChannels.size(); i++)
680 {
681 for (unsigned int c=0; c<SystemChannels[i]->GetNumComponents(); c++)
682 {
683 if (firstime) firstime = false;
684 else buf << delimiter;
685
686 buf << setprecision(9) << SystemChannels[i]->GetComponent(c)->GetOutput();
687 total_count++;
688 }
689 }
690
691 return buf.str();
692}

◆ 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 289 of file FGFCS.h.

290 { return DaLPos[form]; }

◆ GetDaRPos()

double GetDaRPos ( int  form = ofRad) const
inline

Gets the right aileron position.

Returns
aileron position in radians

Definition at line 294 of file FGFCS.h.

295 { 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 299 of file FGFCS.h.

300 { 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 319 of file FGFCS.h.

320 { 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 304 of file FGFCS.h.

305 { 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 309 of file FGFCS.h.

310 { 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 FDMExec->GetGroundReactions()->GetDsCmd(); }
std::shared_ptr< FGGroundReactions > GetGroundReactions(void) const
Returns the FGGroundReactions pointer.
+ Here is the call graph for this function:

◆ 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 314 of file FGFCS.h.

315 { return DspPos[form]; }

◆ GetDt()

double GetDt ( void  ) const

Definition at line 713 of file FGFCS.cpp.

714{
715 return FDMExec->GetDeltaT()*rate;
716}
double GetDeltaT(void) const
Returns the simulation delta T.
Definition FGFDMExec.h:553

◆ 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 265 of file FGFCS.h.

265{ 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 282 of file FGFCS.h.

282{ 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 342 of file FGFCS.h.

342{ return GearPos; }

◆ GetLBrake()

double GetLBrake ( void  ) const
inline

Gets the left brake.

Returns
the left brake setting.

Definition at line 542 of file FGFCS.h.

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

◆ GetMixtureCmd() [1/2]

const std::vector< double > & GetMixtureCmd ( ) const
inline

Definition at line 255 of file FGFCS.h.

255{return MixtureCmd;}

◆ GetMixtureCmd() [2/2]

double GetMixtureCmd ( int  engine) const
inline

Gets the mixture command.

Parameters
engineengine ID number
Returns
mixture command for the given engine
Note
The mixture command is generally in range from 0 - 1.0, but some models might set it to a value above 1.0.
JSBSim does not check nor enforce the value to be within 0.0-1.0.

Definition at line 253 of file FGFCS.h.

253{ return MixtureCmd[engine]; }

◆ GetMixturePos() [1/2]

const std::vector< double > & GetMixturePos ( ) const
inline

Definition at line 338 of file FGFCS.h.

338{return MixturePos;}

◆ GetMixturePos() [2/2]

double GetMixturePos ( int  engine) const
inline

Gets the mixture position.

Parameters
engineengine ID number
Returns
mixture position for the given engine
Note
The mixture position is generally in range from 0 - 1.0, but some models might set it to a value above 1.0.
JSBSim does not check nor enforce the value to be within 0.0-1.0.

Definition at line 336 of file FGFCS.h.

336{ 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 269 of file FGFCS.h.

269{ return PTrimCmd; }

◆ GetPropAdvance() [1/2]

const std::vector< double > & GetPropAdvance ( ) const
inline

Definition at line 357 of file FGFCS.h.

357{ return PropAdvance; }

◆ GetPropAdvance() [2/2]

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 355 of file FGFCS.h.

355{ 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 260 of file FGFCS.h.

260{ return PropAdvanceCmd[engine]; }

◆ GetPropertyManager()

std::shared_ptr< FGPropertyManager > GetPropertyManager ( void  )
inline

Definition at line 566 of file FGFCS.h.

566{ return PropertyManager; }

◆ GetPropFeather() [1/2]

const std::vector< bool > & GetPropFeather ( ) const
inline

Definition at line 364 of file FGFCS.h.

364{ return PropFeather; }

◆ GetPropFeather() [2/2]

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 362 of file FGFCS.h.

362{ return PropFeather[engine]; }

◆ GetRBrake()

double GetRBrake ( void  ) const
inline

Gets the right brake.

Returns
the right brake setting.

Definition at line 546 of file FGFCS.h.

546{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 277 of file FGFCS.h.

277{ 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 346 of file FGFCS.h.

346{ return TailhookPos; }

◆ GetThrottleCmd() [1/2]

const std::vector< double > & GetThrottleCmd ( ) const
inline

Definition at line 244 of file FGFCS.h.

244{return ThrottleCmd;}

◆ GetThrottleCmd() [2/2]

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 357 of file FGFCS.cpp.

358{
359 if (engineNum < (int)ThrottleCmd.size()) {
360 if (engineNum < 0) {
361 FGLogging log(LogLevel::ERROR);
362 log << "Cannot get throttle value for ALL engines" << endl;
363 } else {
364 return ThrottleCmd[engineNum];
365 }
366 } else {
367 FGLogging log(LogLevel::ERROR);
368 log << "Throttle " << engineNum << " does not exist! " << ThrottleCmd.size()
369 << " engines exist, but throttle setting for engine " << engineNum
370 << " is selected" << endl;
371 }
372 return 0.0;
373}

◆ GetThrottlePos() [1/2]

const std::vector< double > & GetThrottlePos ( ) const
inline

Definition at line 327 of file FGFCS.h.

327{return ThrottlePos;}

◆ GetThrottlePos() [2/2]

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 377 of file FGFCS.cpp.

378{
379 if (engineNum < (int)ThrottlePos.size()) {
380 if (engineNum < 0) {
381 FGLogging log(LogLevel::ERROR);
382 log << "Cannot get throttle value for ALL engines" << endl;
383 } else {
384 return ThrottlePos[engineNum];
385 }
386 } else {
387 FGLogging log(LogLevel::ERROR);
388 log << "Throttle " << engineNum << " does not exist! " << ThrottlePos.size()
389 << " engines exist, but attempted throttle position setting is for engine "
390 << engineNum << endl;
391 }
392 return 0.0;
393}

◆ GetTrimStatus()

bool GetTrimStatus ( void  ) const
inline

Definition at line 568 of file FGFCS.h.

568{ return FDMExec->GetTrimStatus(); }

◆ 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 350 of file FGFCS.h.

350{ 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 273 of file FGFCS.h.

273{ return YTrimCmd; }

◆ InitModel()

bool InitModel ( void  )
overridevirtual

Reimplemented from FGModelFunctions.

Definition at line 118 of file FGFCS.cpp.

119{
120 if (!FGModel::InitModel()) return false;
121
122 unsigned int i;
123
124 for (i=0; i<ThrottlePos.size(); i++) ThrottlePos[i] = 0.0;
125 for (i=0; i<MixturePos.size(); i++) MixturePos[i] = 0.0;
126 for (i=0; i<ThrottleCmd.size(); i++) ThrottleCmd[i] = 0.0;
127 for (i=0; i<MixtureCmd.size(); i++) MixtureCmd[i] = 0.0;
128 for (i=0; i<PropAdvance.size(); i++) PropAdvance[i] = 0.0;
129 for (i=0; i<PropFeather.size(); i++) PropFeather[i] = 0.0;
130
131 DaCmd = DeCmd = DrCmd = DfCmd = DsbCmd = DspCmd = 0;
132 PTrimCmd = YTrimCmd = RTrimCmd = 0.0;
133 TailhookPos = WingFoldPos = 0.0;
134
135 for (i=0;i<NForms;i++) {
136 DePos[i] = DaLPos[i] = DaRPos[i] = DrPos[i] = 0.0;
137 DfPos[i] = DsbPos[i] = DspPos[i] = 0.0;
138 }
139
140 // Reset the channels components.
141 for (unsigned int i=0; i<SystemChannels.size(); i++) SystemChannels[i]->Reset();
142
143 return true;
144}

◆ 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 481 of file FGFCS.cpp.

482{
483 if (document->GetName() == "autopilot") {
484 Name = "Autopilot: ";
485 systype = stAutoPilot;
486 } else if (document->GetName() == "flight_control") {
487 Name = "FCS: ";
488 systype = stFCS;
489 } else if (document->GetName() == "system") {
490 Name = "System: ";
491 systype = stSystem;
492 }
493
494 // Load interface properties from document
495 if (!FGModel::Upload(document, true))
496 return false;
497
498 Name += document->GetAttributeValue("name");
499
500 Debug(2);
501
502 Element* channel_element = document->FindElement("channel");
503
504 while (channel_element) {
505
506 FGFCSChannel* newChannel = 0;
507
508 string sOnOffProperty = channel_element->GetAttributeValue("execute");
509 string sChannelName = channel_element->GetAttributeValue("name");
510
511 if (!channel_element->GetAttributeValue("execrate").empty())
512 ChannelRate = channel_element->GetAttributeValueAsNumber("execrate");
513 else
514 ChannelRate = 1;
515
516 if (sOnOffProperty.length() > 0) {
517 SGPropertyNode* OnOffPropertyNode = PropertyManager->GetNode(sOnOffProperty);
518 if (OnOffPropertyNode == nullptr) {
519 XMLLogException err(channel_element);
520 err << LogFormat::BOLD << LogFormat::RED
521 << "The On/Off property, " << sOnOffProperty << " specified for channel "
522 << channel_element->GetAttributeValue("name") << " is undefined or not "
523 << "understood. The simulation will abort" << LogFormat::RESET << endl;
524 throw err;
525 } else
526 newChannel = new FGFCSChannel(this, sChannelName, ChannelRate,
527 OnOffPropertyNode);
528 } else
529 newChannel = new FGFCSChannel(this, sChannelName, ChannelRate);
530
531 SystemChannels.push_back(newChannel);
532
533 if (debug_lvl > 0) {
534 FGLogging log(LogLevel::DEBUG);
535 log << endl << LogFormat::BOLD << LogFormat::BLUE << " Channel "
536 << LogFormat::NORMAL << channel_element->GetAttributeValue("name") << LogFormat::RESET << endl;
537 }
538
539 Element* component_element = channel_element->GetElement();
540 while (component_element) {
541 try {
542 if ((component_element->GetName() == string("lag_filter")) ||
543 (component_element->GetName() == string("lead_lag_filter")) ||
544 (component_element->GetName() == string("washout_filter")) ||
545 (component_element->GetName() == string("second_order_filter")) )
546 {
547 newChannel->Add(new FGFilter(this, component_element));
548 } else if ((component_element->GetName() == string("pure_gain")) ||
549 (component_element->GetName() == string("scheduled_gain")) ||
550 (component_element->GetName() == string("aerosurface_scale")))
551 {
552 newChannel->Add(new FGGain(this, component_element));
553 } else if (component_element->GetName() == string("summer")) {
554 newChannel->Add(new FGSummer(this, component_element));
555 } else if (component_element->GetName() == string("deadband")) {
556 newChannel->Add(new FGDeadBand(this, component_element));
557 } else if (component_element->GetName() == string("switch")) {
558 newChannel->Add(new FGSwitch(this, component_element));
559 } else if (component_element->GetName() == string("kinematic")) {
560 newChannel->Add(new FGKinemat(this, component_element));
561 } else if (component_element->GetName() == string("fcs_function")) {
562 newChannel->Add(new FGFCSFunction(this, component_element));
563 } else if (component_element->GetName() == string("pid")) {
564 newChannel->Add(new FGPID(this, component_element));
565 } else if (component_element->GetName() == string("integrator")) {
566 // <integrator> is equivalent to <pid type="trap">
567 Element* c1_el = component_element->FindElement("c1");
568 if (!c1_el) {
569 XMLLogException err(component_element);
570 err << "INTEGRATOR component " << component_element->GetAttributeValue("name")
571 << " does not provide the parameter <c1>" << endl;
572 throw err;
573 }
574 c1_el->ChangeName("ki");
575 if (!c1_el->HasAttribute("type"))
576 c1_el->AddAttribute("type", "trap");
577 newChannel->Add(new FGPID(this, component_element));
578 } else if (component_element->GetName() == string("actuator")) {
579 newChannel->Add(new FGActuator(this, component_element));
580 } else if (component_element->GetName() == string("sensor")) {
581 newChannel->Add(new FGSensor(this, component_element));
582 } else if (component_element->GetName() == string("accelerometer")) {
583 newChannel->Add(new FGAccelerometer(this, component_element));
584 } else if (component_element->GetName() == string("magnetometer")) {
585 newChannel->Add(new FGMagnetometer(this, component_element));
586 } else if (component_element->GetName() == string("gyro")) {
587 newChannel->Add(new FGGyro(this, component_element));
588 } else if ((component_element->GetName() == string("waypoint_heading")) ||
589 (component_element->GetName() == string("waypoint_distance")))
590 {
591 newChannel->Add(new FGWaypoint(this, component_element));
592 } else if (component_element->GetName() == string("angle")) {
593 newChannel->Add(new FGAngles(this, component_element));
594 } else if (component_element->GetName() == string("distributor")) {
595 newChannel->Add(new FGDistributor(this, component_element));
596 } else if (component_element->GetName() == string("linear_actuator")) {
597 newChannel->Add(new FGLinearActuator(this, component_element));
598 } else {
599 FGXMLLogging log(component_element, LogLevel::ERROR);
600 log << "Unknown FCS component: " << component_element->GetName() << endl;
601 }
602 } catch(string& s) {
603 FGXMLLogging log(component_element, LogLevel::ERROR);
604 log << LogFormat::BOLD << LogFormat::RED << endl << " " << s << endl;
605 log << LogFormat::RESET << endl;
606 return false;
607 }
608 component_element = channel_element->GetNextElement();
609 }
610 channel_element = document->FindNextElement("channel");
611 }
612
613 PostLoad(document, FDMExec);
614
615 return true;
616}
bool Upload(Element *el, bool preLoad)
Uploads this model in memory.
Definition FGModel.cpp:111
A node in a property tree.
Definition props.hxx:747
+ 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) {
171 FGLogging log(LogLevel::DEBUG);
172 log << " Executing System Channel: " << SystemChannels[i]->GetName() << endl;
173 }
174 ChannelRate = SystemChannels[i]->GetRate();
175 SystemChannels[i]->Execute();
176 }
177 ChannelRate = 1;
178
179 RunPostFunctions();
180
181 return false;
182}
virtual bool Run(bool Holding)
Runs the model; called by the Executive.
Definition FGModel.cpp:90
+ 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 531 of file FGFCS.h.

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

◆ SetDaCmd()

void SetDaCmd ( double  cmd)
inline

Sets the aileron command.

Parameters
cmdaileron command

Definition at line 382 of file FGFCS.h.

382{ DaCmd = cmd; }

◆ SetDaLPos()

void SetDaLPos ( int  form,
double  pos 
)

Sets the left aileron position.

Parameters
cmdleft aileron position in radians

Definition at line 186 of file FGFCS.cpp.

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

◆ SetDaRPos()

void SetDaRPos ( int  form,
double  pos 
)

Sets the right aileron position.

Parameters
cmdright aileron position in radians

Definition at line 205 of file FGFCS.cpp.

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

◆ SetDeCmd()

void SetDeCmd ( double  cmd)
inline

Sets the elevator command.

Parameters
cmdelevator command in percent

Definition at line 386 of file FGFCS.h.

386{ DeCmd = cmd; }

◆ SetDePos()

void SetDePos ( int  form,
double  pos 
)

Sets the elevator position.

Parameters
cmdelevator position in radians

Definition at line 224 of file FGFCS.cpp.

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

◆ SetDfCmd()

void SetDfCmd ( double  cmd)
inline

Sets the flaps command.

Parameters
cmdflaps command in percent

Definition at line 398 of file FGFCS.h.

398{ DfCmd = cmd; }

◆ SetDfPos()

void SetDfPos ( int  form,
double  pos 
)

Sets the flaps position.

Parameters
cmdflaps position in radians

Definition at line 262 of file FGFCS.cpp.

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

◆ SetDrCmd()

void SetDrCmd ( double  cmd)
inline

Sets the rudder command.

Parameters
cmdrudder command in percent

Definition at line 390 of file FGFCS.h.

390{ DrCmd = cmd; }

◆ SetDrPos()

void SetDrPos ( int  form,
double  pos 
)

Sets the rudder position.

Parameters
cmdrudder position in radians

Definition at line 243 of file FGFCS.cpp.

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

◆ SetDsbCmd()

void SetDsbCmd ( double  cmd)
inline

Sets the speedbrake command.

Parameters
cmdspeedbrake command in percent

Definition at line 402 of file FGFCS.h.

402{ DsbCmd = cmd; }

◆ SetDsbPos()

void SetDsbPos ( int  form,
double  pos 
)

Sets the speedbrake position.

Parameters
cmdspeedbrake position in radians

Definition at line 281 of file FGFCS.cpp.

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

◆ SetDsCmd()

void SetDsCmd ( double  cmd)
inline

Sets the steering command.

Parameters
cmdsteering command in percent

Definition at line 394 of file FGFCS.h.

394{ FDMExec->GetGroundReactions()->SetDsCmd( cmd ); }
+ Here is the call graph for this function:

◆ SetDspCmd()

void SetDspCmd ( double  cmd)
inline

Sets the spoilers command.

Parameters
cmdspoilers command in percent

Definition at line 406 of file FGFCS.h.

406{ DspCmd = cmd; }

◆ SetDspPos()

void SetDspPos ( int  form,
double  pos 
)

Sets the spoiler position.

Parameters
cmdspoiler position in radians

Definition at line 300 of file FGFCS.cpp.

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

◆ 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 453 of file FGFCS.cpp.

454{
455 if (engineNum < (int)PropFeatherCmd.size()) {
456 if (engineNum < 0) {
457 for (unsigned int ctr=0; ctr<PropFeatherCmd.size(); ctr++)
458 PropFeatherCmd[ctr] = setting;
459 } else {
460 PropFeatherCmd[engineNum] = setting;
461 }
462 }
463}

◆ 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 436 of file FGFCS.h.

436{ 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 498 of file FGFCS.h.

498{ 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 523 of file FGFCS.h.

523{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
Note
The mixture command is generally in range from 0 - 1.0, but some models handle values above 1.0.
JSBSim does not check nor enforce the value to be within 0.0-1.0.

Definition at line 397 of file FGFCS.cpp.

398{
399 if (engineNum < (int)MixtureCmd.size()) {
400 if (engineNum < 0) {
401 for (unsigned int ctr=0; ctr<MixtureCmd.size(); ctr++)
402 MixtureCmd[ctr] = setting;
403 } else {
404 MixtureCmd[engineNum] = setting;
405 }
406 }
407}

◆ SetMixturePos()

void SetMixturePos ( int  engine,
double  cmd 
)

Sets the actual mixture setting for the specified engine.

Parameters
engineengine ID number
cmdnormalized mixture setting
Note
The mixture position is typically within the range of 0 to 1.0, but some models can handle values above 1.0. In the default piston engine model, a mixture position of 1.0 corresponds to the full power setting, and the full rich setting is reached at a value higher than 1.0.
JSBSim does not check nor enforce the value to be within 0.0-1.0.

Definition at line 411 of file FGFCS.cpp.

412{
413 if (engineNum < (int)MixturePos.size()) {
414 if (engineNum < 0) {
415 for (unsigned int ctr=0; ctr<MixtureCmd.size(); ctr++)
416 MixturePos[ctr] = MixtureCmd[ctr];
417 } else {
418 MixturePos[engineNum] = setting;
419 }
420 }
421}

◆ SetPitchTrimCmd()

void SetPitchTrimCmd ( double  cmd)
inline

Sets the pitch trim command.

Parameters
cmdpitch trim command in percent

Definition at line 410 of file FGFCS.h.

410{ 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 439 of file FGFCS.cpp.

440{
441 if (engineNum < (int)PropAdvance.size()) {
442 if (engineNum < 0) {
443 for (unsigned int ctr=0; ctr<PropAdvanceCmd.size(); ctr++)
444 PropAdvance[ctr] = PropAdvanceCmd[ctr];
445 } else {
446 PropAdvance[engineNum] = setting;
447 }
448 }
449}

◆ 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 425 of file FGFCS.cpp.

426{
427 if (engineNum < (int)PropAdvanceCmd.size()) {
428 if (engineNum < 0) {
429 for (unsigned int ctr=0; ctr<PropAdvanceCmd.size(); ctr++)
430 PropAdvanceCmd[ctr] = setting;
431 } else {
432 PropAdvanceCmd[engineNum] = setting;
433 }
434 }
435}

◆ 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 467 of file FGFCS.cpp.

468{
469 if (engineNum < (int)PropFeather.size()) {
470 if (engineNum < 0) {
471 for (unsigned int ctr=0; ctr<PropFeatherCmd.size(); ctr++)
472 PropFeather[ctr] = PropFeatherCmd[ctr];
473 } else {
474 PropFeather[engineNum] = setting;
475 }
476 }
477}

◆ SetRBrake()

void SetRBrake ( double  cmd)
inline

Sets the right brake group.

Parameters
cmdbrake setting in percent (0.0 - 1.0)

Definition at line 527 of file FGFCS.h.

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

◆ SetRollTrimCmd()

void SetRollTrimCmd ( double  cmd)
inline

Sets the aileron trim command.

Parameters
cmdaileron trim command in percent

Definition at line 418 of file FGFCS.h.

418{ RTrimCmd = cmd; }

◆ SetTailhookPos()

void SetTailhookPos ( double  hookpos)
inline

Set the tailhook position.

Parameters
tailhookposition 0 up, 1 down

Definition at line 502 of file FGFCS.h.

502{ 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 319 of file FGFCS.cpp.

320{
321 if (engineNum < (int)ThrottleCmd.size()) {
322 if (engineNum < 0) {
323 for (unsigned int ctr=0; ctr<ThrottleCmd.size(); ctr++)
324 ThrottleCmd[ctr] = setting;
325 } else {
326 ThrottleCmd[engineNum] = setting;
327 }
328 } else {
329 FGLogging log(LogLevel::ERROR);
330 log << "Throttle " << engineNum << " does not exist! " << ThrottleCmd.size()
331 << " engines exist, but attempted throttle command is for engine "
332 << engineNum << endl;
333 }
334}

◆ 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 338 of file FGFCS.cpp.

339{
340 if (engineNum < (int)ThrottlePos.size()) {
341 if (engineNum < 0) {
342 for (unsigned int ctr=0; ctr<ThrottlePos.size(); ctr++)
343 ThrottlePos[ctr] = setting;
344 } else {
345 ThrottlePos[engineNum] = setting;
346 }
347 } else {
348 FGLogging log(LogLevel::ERROR);
349 log << "Throttle " << engineNum << " does not exist! " << ThrottlePos.size()
350 << " engines exist, but attempted throttle position setting is for engine "
351 << engineNum << endl;
352 }
353}

◆ SetWingFoldPos()

void SetWingFoldPos ( double  foldpos)
inline

Set the wing fold position.

Parameters
wingfold position 0 unfolded, 1 folded

Definition at line 506 of file FGFCS.h.

506{ WingFoldPos = foldpos; }

◆ SetYawTrimCmd()

void SetYawTrimCmd ( double  cmd)
inline

Sets the rudder trim command.

Parameters
cmdrudder trim command in percent

Definition at line 414 of file FGFCS.h.

414{ YTrimCmd = cmd; }

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