![]() |
JSBSim Flight Dynamics Model 1.0 (23 February 2013)
An Open Source Flight Dynamics and Control Software Library in C++
|
Encapsulates the Flight Control System (FCS) functionality. More...
#include <FGFCS.h>
Inheritance diagram for FGFCS:
Collaboration diagram for FGFCS:Classes | |
| struct | Inputs |
Public Types | |
| enum | SystemType { stFCS, stSystem, stAutoPilot } |
Public Member Functions | |
| FGFCS (FGFDMExec *) | |
| Constructor. | |
| ~FGFCS () | |
| Destructor. | |
| void | AddGear (unsigned int NumGear) |
| void | AddThrottle (void) |
| std::ifstream * | FindSystemFile (const std::string &system_filename) |
| std::string | FindSystemFullPathname (const std::string &system_filename) |
| 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. | |
| double | GetDt (void) |
| FGPropertyManager * | GetPropertyManager (void) |
| bool | GetTrimStatus (void) const |
| bool | InitModel (void) |
| bool | Load (Element *el, SystemType systype) |
| Loads the Flight Control System. | |
| bool | Run (bool Holding) |
| 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 vector< double > & | GetThrottleCmd () const |
| double | GetMixtureCmd (int engine) const |
| Gets the mixture command. | |
| const 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 vector< double > & | GetThrottlePos () const |
| double | GetMixturePos (int engine) const |
| Gets the mixture position. | |
| const vector< double > & | GetMixturePos () const |
| double | GetSteerPosDeg (int gear) const |
| Gets the steering position. | |
| const vector< double > & | GetSteerPosDeg () 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 vector< double > & | GetPropAdvance () const |
| bool | GetPropFeather (int engine) const |
| Gets the prop feather position. | |
| const vector< bool > & | GetPropFeather () const |
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 | SetSteerPosDeg (int gear, double pos) |
| Sets the steering position. | |
| 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. | |
Landing Gear brakes | |
| 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 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. | |
Public Attributes | |
| struct JSBSim::FGFCS::Inputs | in |
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.
| Executive | a pointer to the parent executive object |
Definition at line 76 of file FGFCS.cpp.
: FGModel(fdmex) { int i; Name = "FGFCS"; DaCmd = DeCmd = DrCmd = DsCmd = DfCmd = DsbCmd = DspCmd = 0; PTrimCmd = YTrimCmd = RTrimCmd = 0.0; GearCmd = GearPos = 1; // default to gear down BrakePos.resize(FGLGear::bgNumBrakeGroups); TailhookPos = WingFoldPos = 0.0; bind(); for (i=0;i<NForms;i++) { DePos[i] = DaLPos[i] = DaRPos[i] = DrPos[i] = 0.0; DfPos[i] = DsbPos[i] = DspPos[i] = 0.0; } Debug(0); }
| double GetBrake | ( | FGLGear::BrakeGroup | bg | ) |
| double GetCBrake | ( | void | ) | const [inline] |
| string GetComponentStrings | ( | const std::string & | delimiter | ) | const |
| delimiter | either a tab or comma string depending on output type |
Definition at line 721 of file FGFCS.cpp.
{
string CompStrings = "";
bool firstime = true;
int total_count=0;
for (unsigned int i=0; i<SystemChannels.size(); i++)
{
for (unsigned int c=0; c<SystemChannels[i]->GetNumComponents(); c++)
{
if (firstime) firstime = false;
else CompStrings += delimiter;
CompStrings += SystemChannels[i]->GetComponent(c)->GetName();
total_count++;
}
}
return CompStrings;
}
| string GetComponentValues | ( | const std::string & | delimiter | ) | const |
| delimiter | either a tab or comma string depending on output type |
Definition at line 744 of file FGFCS.cpp.
Referenced by FGOutputSocket::Print().
{
std::ostringstream buf;
bool firstime = true;
int total_count=0;
for (unsigned int i=0; i<SystemChannels.size(); i++)
{
for (unsigned int c=0; c<SystemChannels[i]->GetNumComponents(); c++)
{
if (firstime) firstime = false;
else buf << delimiter;
buf << setprecision(9) << SystemChannels[i]->GetComponent(c)->GetOutput();
total_count++;
}
}
return buf.str();
}
Here is the caller graph for this function:| double GetDaCmd | ( | void | ) | const [inline] |
Definition at line 216 of file FGFCS.h.
Referenced by FGOutputSocket::Print().
{ return DaCmd; }
Here is the caller graph for this function:| double GetDaLPos | ( | int | form = ofRad | ) | const [inline] |
Definition at line 288 of file FGFCS.h.
Referenced by FGOutputSocket::Print().
{ return DaLPos[form]; }
Here is the caller graph for this function:| double GetDaRPos | ( | int | form = ofRad | ) | const [inline] |
Definition at line 293 of file FGFCS.h.
Referenced by FGOutputSocket::Print().
{ return DaRPos[form]; }
Here is the caller graph for this function:| double GetDeCmd | ( | void | ) | const [inline] |
Definition at line 220 of file FGFCS.h.
Referenced by FGOutputSocket::Print().
{ return DeCmd; }
Here is the caller graph for this function:| double GetDePos | ( | int | form = ofRad | ) | const [inline] |
Definition at line 298 of file FGFCS.h.
Referenced by FGOutputSocket::Print().
{ return DePos[form]; }
Here is the caller graph for this function:| double GetDfCmd | ( | void | ) | const [inline] |
Definition at line 232 of file FGFCS.h.
Referenced by FGOutputSocket::Print().
{ return DfCmd; }
Here is the caller graph for this function:| double GetDfPos | ( | int | form = ofRad | ) | const [inline] |
Definition at line 318 of file FGFCS.h.
Referenced by FGOutputSocket::Print().
{ return DfPos[form]; }
Here is the caller graph for this function:| double GetDrCmd | ( | void | ) | const [inline] |
Definition at line 224 of file FGFCS.h.
Referenced by FGOutputSocket::Print().
{ return DrCmd; }
Here is the caller graph for this function:| double GetDrPos | ( | int | form = ofRad | ) | const [inline] |
Definition at line 303 of file FGFCS.h.
Referenced by FGOutputSocket::Print().
{ return DrPos[form]; }
Here is the caller graph for this function:| double GetDsbCmd | ( | void | ) | const [inline] |
| double GetDsbPos | ( | int | form = ofRad | ) | const [inline] |
| double GetDsCmd | ( | void | ) | const [inline] |
Definition at line 228 of file FGFCS.h.
Referenced by FGFCS::Run().
{ return DsCmd; }
Here is the caller graph for this function:| double GetDspCmd | ( | void | ) | const [inline] |
| double GetDspPos | ( | int | form = ofRad | ) | const [inline] |
| bool GetFeatherCmd | ( | int | engine | ) | const [inline] |
| double GetGearCmd | ( | void | ) | const [inline] |
| double GetGearPos | ( | void | ) | const [inline] |
| double GetLBrake | ( | void | ) | const [inline] |
| double GetMixtureCmd | ( | int | engine | ) | const [inline] |
| double GetMixturePos | ( | int | engine | ) | const [inline] |
| double GetPitchTrimCmd | ( | void | ) | const [inline] |
| double GetPropAdvance | ( | int | engine | ) | const [inline] |
| double GetPropAdvanceCmd | ( | int | engine | ) | const [inline] |
| bool GetPropFeather | ( | int | engine | ) | const [inline] |
| double GetRBrake | ( | void | ) | const [inline] |
| double GetRollTrimCmd | ( | void | ) | const [inline] |
| double GetSteerPosDeg | ( | int | gear | ) | const [inline] |
| double GetTailhookPos | ( | void | ) | const [inline] |
| double GetThrottleCmd | ( | int | engine | ) | const |
| engine | engine ID number |
Definition at line 355 of file FGFCS.cpp.
{
if (engineNum < (int)ThrottlePos.size()) {
if (engineNum < 0) {
cerr << "Cannot get throttle value for ALL engines" << endl;
} else {
return ThrottleCmd[engineNum];
}
} else {
cerr << "Throttle " << engineNum << " does not exist! " << ThrottleCmd.size()
<< " engines exist, but throttle setting for engine " << engineNum
<< " is selected" << endl;
}
return 0.0;
}
| double GetThrottlePos | ( | int | engine | ) | const |
| engine | engine ID number |
Definition at line 373 of file FGFCS.cpp.
{
if (engineNum < (int)ThrottlePos.size()) {
if (engineNum < 0) {
cerr << "Cannot get throttle value for ALL engines" << endl;
} else {
return ThrottlePos[engineNum];
}
} else {
cerr << "Throttle " << engineNum << " does not exist! " << ThrottlePos.size()
<< " engines exist, but attempted throttle position setting is for engine "
<< engineNum << endl;
}
return 0.0;
}
| double GetWingFoldPos | ( | void | ) | const [inline] |
| double GetYawTrimCmd | ( | void | ) | const [inline] |
| bool Load | ( | Element * | el, |
| SystemType | systype | ||
| ) |
Load() is called from FGFDMExec.
| el | pointer to the Element instance |
| systype | type of system (FCS, Autopilot, System) |
Definition at line 481 of file FGFCS.cpp.
References FGFCSChannel::Add(), FGJSBBase::fgblue, FGJSBBase::fgred, Element::FindElement(), Element::FindNextElement(), Element::GetAttributeValue(), Element::GetAttributeValueAsNumber(), Element::GetDataLine(), Element::GetElement(), FGFDMExec::GetFullAircraftPath(), Element::GetName(), Element::GetNextElement(), FGJSBBase::highint, FGJSBBase::normint, FGJSBBase::reset, and FGPropertyManager::Tie().
{
string name, file, fname="", interface_property_string, parent_name;
Element *component_element;
Element *channel_element;
// ToDo: The handling of name and file attributes could be improved, here,
// considering that a name can be in the external file, as well.
name = el->GetAttributeValue("name");
if (name.empty() || !el->GetAttributeValue("file").empty()) {
fname = el->GetAttributeValue("file");
if (systype == stSystem) {
file = FindSystemFullPathname(fname);
} else {
file = FDMExec->GetFullAircraftPath() + "/" + fname + ".xml";
}
if (fname.empty()) {
cerr << "FCS, Autopilot, or system does not appear to be defined inline nor in a file" << endl;
return false;
} else {
document = LoadXMLDocument(file);
if (!document) {
cerr << "Error loading file " << file << endl;
return false;
}
name = document->GetAttributeValue("name");
}
} else {
document = el;
}
if (document->GetName() == "autopilot") {
Name = "Autopilot: " + document->GetAttributeValue("name");
} else if (document->GetName() == "flight_control") {
Name = "FCS: " + document->GetAttributeValue("name");
} else if (document->GetName() == "system") {
Name = "System: " + document->GetAttributeValue("name");
}
Debug(2);
if (document->GetName() == "flight_control") bindModel();
FGModel::Load(document); // Load interface properties from document
// After reading interface properties in a file, read properties in the local
// flight_control, autopilot, or system element. This allows general-purpose
// systems to be defined in a file, with overrides or initial loaded constants
// supplied in the relevant element of the aircraft configuration file.
Element* property_element = 0;
if (!fname.empty()) {
property_element = el->FindElement("property");
if (property_element && debug_lvl > 0) cout << endl << " Overriding properties" << endl << endl;
while (property_element) {
double value=0.0;
if ( ! property_element->GetAttributeValue("value").empty())
value = property_element->GetAttributeValueAsNumber("value");
interface_property_string = property_element->GetDataLine();
if (PropertyManager->HasNode(interface_property_string)) {
FGPropertyNode* node = PropertyManager->GetNode(interface_property_string);
if (debug_lvl > 0)
cout << " " << "Overriding value for property " << interface_property_string
<< " (old value: " << node->getDoubleValue() << " new value: " << value << ")" << endl;
node->setDoubleValue(value);
} else {
interface_properties.push_back(new double(value));
PropertyManager->Tie(interface_property_string, interface_properties.back());
if (debug_lvl > 0)
cout << " " << interface_property_string << " (initial value: " << value << ")" << endl;
}
property_element = el->FindNextElement("property");
}
}
channel_element = document->FindElement("channel");
while (channel_element) {
FGFCSChannel* newChannel = 0;
string sOnOffProperty = channel_element->GetAttributeValue("execute");
FGPropertyNode* OnOffPropertyNode = 0;
if (sOnOffProperty.length() > 0) {
OnOffPropertyNode = PropertyManager->GetNode(sOnOffProperty);
if (OnOffPropertyNode == 0) {
cerr << highint << fgred
<< "The On/Off property, " << sOnOffProperty << " specified for channel "
<< channel_element->GetAttributeValue("name") << " is undefined or not "
<< "understood. The simulation will abort" << reset << endl;
throw("Bad system definition");
} else {
newChannel = new FGFCSChannel(OnOffPropertyNode);
}
} else {
newChannel = new FGFCSChannel();
}
SystemChannels.push_back(newChannel);
if (debug_lvl > 0)
cout << endl << highint << fgblue << " Channel "
<< normint << channel_element->GetAttributeValue("name") << reset << endl;
component_element = channel_element->GetElement();
while (component_element) {
try {
if ((component_element->GetName() == string("lag_filter")) ||
(component_element->GetName() == string("lead_lag_filter")) ||
(component_element->GetName() == string("washout_filter")) ||
(component_element->GetName() == string("second_order_filter")) ||
(component_element->GetName() == string("integrator")) )
{
newChannel->Add(new FGFilter(this, component_element));
} else if ((component_element->GetName() == string("pure_gain")) ||
(component_element->GetName() == string("scheduled_gain")) ||
(component_element->GetName() == string("aerosurface_scale")))
{
newChannel->Add(new FGGain(this, component_element));
} else if (component_element->GetName() == string("summer")) {
newChannel->Add(new FGSummer(this, component_element));
} else if (component_element->GetName() == string("deadband")) {
newChannel->Add(new FGDeadBand(this, component_element));
} else if (component_element->GetName() == string("switch")) {
newChannel->Add(new FGSwitch(this, component_element));
} else if (component_element->GetName() == string("kinematic")) {
newChannel->Add(new FGKinemat(this, component_element));
} else if (component_element->GetName() == string("fcs_function")) {
newChannel->Add(new FGFCSFunction(this, component_element));
} else if (component_element->GetName() == string("pid")) {
newChannel->Add(new FGPID(this, component_element));
} else if (component_element->GetName() == string("actuator")) {
newChannel->Add(new FGActuator(this, component_element));
} else if (component_element->GetName() == string("sensor")) {
newChannel->Add(new FGSensor(this, component_element));
} else if (component_element->GetName() == string("accelerometer")) {
newChannel->Add(new FGAccelerometer(this, component_element));
} else if (component_element->GetName() == string("magnetometer")) {
newChannel->Add(new FGMagnetometer(this, component_element));
} else if (component_element->GetName() == string("gyro")) {
newChannel->Add(new FGGyro(this, component_element));
} else {
cerr << "Unknown FCS component: " << component_element->GetName() << endl;
}
} catch(string s) {
cerr << highint << fgred << endl << " " << s << endl;
cerr << reset << endl;
return false;
}
component_element = channel_element->GetNextElement();
}
channel_element = document->FindNextElement("channel");
}
PostLoad(document, PropertyManager);
ResetParser();
return true;
}
Here is the call graph for this function:| bool Run | ( | bool | Holding | ) | [virtual] |
| Holding | if 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. |
Reimplemented from FGModel.
Definition at line 154 of file FGFCS.cpp.
References FGFCS::GetDsCmd(), FGGroundReactions::GetGearUnit(), FGFDMExec::GetGroundReactions(), and FGModel::Run().
{
unsigned int i;
if (FGModel::Run(Holding)) return true; // fast exit if nothing to do
if (Holding) return false;
RunPreFunctions();
for (i=0; i<ThrottlePos.size(); i++) ThrottlePos[i] = ThrottleCmd[i];
for (i=0; i<MixturePos.size(); i++) MixturePos[i] = MixtureCmd[i];
for (i=0; i<PropAdvance.size(); i++) PropAdvance[i] = PropAdvanceCmd[i];
for (i=0; i<PropFeather.size(); i++) PropFeather[i] = PropFeatherCmd[i];
// Set the default steering angle
for (i=0; i<SteerPosDeg.size(); i++) {
FGLGear* gear = FDMExec->GetGroundReactions()->GetGearUnit(i);
SteerPosDeg[i] = gear->GetDefaultSteerAngle( GetDsCmd() );
}
// Execute system channels in order
for (i=0; i<SystemChannels.size(); i++) SystemChannels[i]->Execute();
RunPostFunctions();
return false;
}
Here is the call graph for this function:| void SetCBrake | ( | double | cmd | ) | [inline] |
| void SetDaCmd | ( | double | cmd | ) | [inline] |
| void SetDaLPos | ( | int | form, |
| double | pos | ||
| ) |
| cmd | left aileron position in radians |
Definition at line 184 of file FGFCS.cpp.
{
switch(form) {
case ofRad:
DaLPos[ofRad] = pos;
DaLPos[ofDeg] = pos*radtodeg;
break;
case ofDeg:
DaLPos[ofRad] = pos*degtorad;
DaLPos[ofDeg] = pos;
break;
case ofNorm:
DaLPos[ofNorm] = pos;
}
DaLPos[ofMag] = fabs(DaLPos[ofRad]);
}
| void SetDaRPos | ( | int | form, |
| double | pos | ||
| ) |
| cmd | right aileron position in radians |
Definition at line 203 of file FGFCS.cpp.
{
switch(form) {
case ofRad:
DaRPos[ofRad] = pos;
DaRPos[ofDeg] = pos*radtodeg;
break;
case ofDeg:
DaRPos[ofRad] = pos*degtorad;
DaRPos[ofDeg] = pos;
break;
case ofNorm:
DaRPos[ofNorm] = pos;
}
DaRPos[ofMag] = fabs(DaRPos[ofRad]);
}
| void SetDeCmd | ( | double | cmd | ) | [inline] |
| void SetDePos | ( | int | form, |
| double | pos | ||
| ) |
| cmd | elevator position in radians |
Definition at line 222 of file FGFCS.cpp.
{
switch(form) {
case ofRad:
DePos[ofRad] = pos;
DePos[ofDeg] = pos*radtodeg;
break;
case ofDeg:
DePos[ofRad] = pos*degtorad;
DePos[ofDeg] = pos;
break;
case ofNorm:
DePos[ofNorm] = pos;
}
DePos[ofMag] = fabs(DePos[ofRad]);
}
| void SetDfCmd | ( | double | cmd | ) | [inline] |
| void SetDfPos | ( | int | form, |
| double | pos | ||
| ) |
| cmd | flaps position in radians |
Definition at line 260 of file FGFCS.cpp.
{
switch(form) {
case ofRad:
DfPos[ofRad] = pos;
DfPos[ofDeg] = pos*radtodeg;
break;
case ofDeg:
DfPos[ofRad] = pos*degtorad;
DfPos[ofDeg] = pos;
break;
case ofNorm:
DfPos[ofNorm] = pos;
}
DfPos[ofMag] = fabs(DfPos[ofRad]);
}
| void SetDrCmd | ( | double | cmd | ) | [inline] |
| void SetDrPos | ( | int | form, |
| double | pos | ||
| ) |
| cmd | rudder position in radians |
Definition at line 241 of file FGFCS.cpp.
{
switch(form) {
case ofRad:
DrPos[ofRad] = pos;
DrPos[ofDeg] = pos*radtodeg;
break;
case ofDeg:
DrPos[ofRad] = pos*degtorad;
DrPos[ofDeg] = pos;
break;
case ofNorm:
DrPos[ofNorm] = pos;
}
DrPos[ofMag] = fabs(DrPos[ofRad]);
}
| void SetDsbCmd | ( | double | cmd | ) | [inline] |
| void SetDsbPos | ( | int | form, |
| double | pos | ||
| ) |
| cmd | speedbrake position in radians |
Definition at line 279 of file FGFCS.cpp.
{
switch(form) {
case ofRad:
DsbPos[ofRad] = pos;
DsbPos[ofDeg] = pos*radtodeg;
break;
case ofDeg:
DsbPos[ofRad] = pos*degtorad;
DsbPos[ofDeg] = pos;
break;
case ofNorm:
DsbPos[ofNorm] = pos;
}
DsbPos[ofMag] = fabs(DsbPos[ofRad]);
}
| void SetDsCmd | ( | double | cmd | ) | [inline] |
| void SetDspCmd | ( | double | cmd | ) | [inline] |
| void SetDspPos | ( | int | form, |
| double | pos | ||
| ) |
| cmd | spoiler position in radians |
Definition at line 298 of file FGFCS.cpp.
{
switch(form) {
case ofRad:
DspPos[ofRad] = pos;
DspPos[ofDeg] = pos*radtodeg;
break;
case ofDeg:
DspPos[ofRad] = pos*degtorad;
DspPos[ofDeg] = pos;
break;
case ofNorm:
DspPos[ofNorm] = pos;
}
DspPos[ofMag] = fabs(DspPos[ofRad]);
}
| void SetFeatherCmd | ( | int | engine, |
| bool | cmd | ||
| ) |
| engine | engine ID number |
| cmd | feather (bool) |
Definition at line 451 of file FGFCS.cpp.
{
unsigned int ctr;
if (engineNum < (int)ThrottlePos.size()) {
if (engineNum < 0) {
for (ctr=0;ctr<PropFeatherCmd.size();ctr++) PropFeatherCmd[ctr] = setting;
} else {
PropFeatherCmd[engineNum] = setting;
}
}
}
| void SetGearCmd | ( | double | gearcmd | ) | [inline] |
| void SetGearPos | ( | double | gearpos | ) | [inline] |
| void SetLBrake | ( | double | cmd | ) | [inline] |
| void SetMixtureCmd | ( | int | engine, |
| double | cmd | ||
| ) |
| engine | engine ID number |
| cmd | normalized mixture command (0.0 - 1.0) |
Definition at line 391 of file FGFCS.cpp.
{
unsigned int ctr;
if (engineNum < (int)ThrottlePos.size()) {
if (engineNum < 0) {
for (ctr=0;ctr<MixtureCmd.size();ctr++) MixtureCmd[ctr] = setting;
} else {
MixtureCmd[engineNum] = setting;
}
}
}
| void SetMixturePos | ( | int | engine, |
| double | cmd | ||
| ) |
| engine | engine ID number |
| cmd | normalized mixture setting (0.0 - 1.0) |
Definition at line 406 of file FGFCS.cpp.
{
unsigned int ctr;
if (engineNum < (int)ThrottlePos.size()) {
if (engineNum < 0) {
for (ctr=0;ctr<MixtureCmd.size();ctr++) MixturePos[ctr] = MixtureCmd[ctr];
} else {
MixturePos[engineNum] = setting;
}
}
}
| void SetPitchTrimCmd | ( | double | cmd | ) | [inline] |
| void SetPropAdvance | ( | int | engine, |
| double | cmd | ||
| ) |
| engine | engine ID number |
| cmd | prop pitch setting in percent (0.0 - 1.0) |
Definition at line 436 of file FGFCS.cpp.
{
unsigned int ctr;
if (engineNum < (int)ThrottlePos.size()) {
if (engineNum < 0) {
for (ctr=0;ctr<PropAdvanceCmd.size();ctr++) PropAdvance[ctr] = PropAdvanceCmd[ctr];
} else {
PropAdvance[engineNum] = setting;
}
}
}
| void SetPropAdvanceCmd | ( | int | engine, |
| double | cmd | ||
| ) |
| engine | engine ID number |
| cmd | mixture command in percent (0.0 - 1.0) |
Definition at line 421 of file FGFCS.cpp.
{
unsigned int ctr;
if (engineNum < (int)ThrottlePos.size()) {
if (engineNum < 0) {
for (ctr=0;ctr<PropAdvanceCmd.size();ctr++) PropAdvanceCmd[ctr] = setting;
} else {
PropAdvanceCmd[engineNum] = setting;
}
}
}
| void SetPropFeather | ( | int | engine, |
| bool | cmd | ||
| ) |
| engine | engine ID number |
| cmd | prop fether setting (bool) |
Definition at line 466 of file FGFCS.cpp.
{
unsigned int ctr;
if (engineNum < (int)ThrottlePos.size()) {
if (engineNum < 0) {
for (ctr=0;ctr<PropFeatherCmd.size();ctr++) PropFeather[ctr] = PropFeatherCmd[ctr];
} else {
PropFeather[engineNum] = setting;
}
}
}
| void SetRBrake | ( | double | cmd | ) | [inline] |
| void SetRollTrimCmd | ( | double | cmd | ) | [inline] |
| void SetSteerPosDeg | ( | int | gear, |
| double | pos | ||
| ) | [inline] |
| void SetTailhookPos | ( | double | hookpos | ) | [inline] |
| void SetThrottleCmd | ( | int | engine, |
| double | cmd | ||
| ) |
| engine | engine ID number |
| cmd | normalized throttle command (0.0 - 1.0) |
Definition at line 317 of file FGFCS.cpp.
{
unsigned int ctr;
if (engineNum < (int)ThrottlePos.size()) {
if (engineNum < 0) {
for (ctr=0;ctr<ThrottleCmd.size();ctr++) ThrottleCmd[ctr] = setting;
} else {
ThrottleCmd[engineNum] = setting;
}
} else {
cerr << "Throttle " << engineNum << " does not exist! " << ThrottleCmd.size()
<< " engines exist, but attempted throttle command is for engine "
<< engineNum << endl;
}
}
| void SetThrottlePos | ( | int | engine, |
| double | cmd | ||
| ) |
| engine | engine ID number |
| cmd | normalized throttle setting (0.0 - 1.0) |
Definition at line 336 of file FGFCS.cpp.
{
unsigned int ctr;
if (engineNum < (int)ThrottlePos.size()) {
if (engineNum < 0) {
for (ctr=0;ctr<ThrottlePos.size();ctr++) ThrottlePos[ctr] = setting;
} else {
ThrottlePos[engineNum] = setting;
}
} else {
cerr << "Throttle " << engineNum << " does not exist! " << ThrottlePos.size()
<< " engines exist, but attempted throttle position setting is for engine "
<< engineNum << endl;
}
}
| void SetWingFoldPos | ( | double | foldpos | ) | [inline] |
| void SetYawTrimCmd | ( | double | cmd | ) | [inline] |