45 #include "models/FGModel.h" 46 #include "models/FGLGear.h" 47 #include "models/FGGroundReactions.h" 53 #define ID_FCS "$Id: FGFCS.h,v 1.54 2017/02/25 14:23:18 bcoconni Exp $" 62 typedef enum { ofRad=0, ofDeg, ofNorm, ofMag , NForms} OutputForm;
203 bool InitModel(
void);
212 bool Run(
bool Holding);
249 const std::vector<double>& GetThrottleCmd()
const {
return ThrottleCmd;}
256 const std::vector<double>&
GetMixtureCmd()
const {
return MixtureCmd;}
291 const {
return DaLPos[form]; }
296 const {
return DaRPos[form]; }
301 const {
return DePos[form]; }
306 const {
return DrPos[form]; }
311 const {
return DsbPos[form]; }
316 const {
return DspPos[form]; }
321 const {
return DfPos[form]; }
328 const std::vector<double>& GetThrottlePos()
const {
return ThrottlePos;}
335 const std::vector<double>&
GetMixturePos()
const {
return MixturePos;}
354 const std::vector<double>&
GetPropAdvance()
const {
return PropAdvance; }
361 const std::vector<bool>&
GetPropFeather()
const {
return PropFeather; }
454 void SetDePos(
int form ,
double pos );
458 void SetDrPos(
int form ,
double pos );
462 void SetDfPos(
int form ,
double pos );
509 void SetLBrake(
double cmd) {BrakePos[FGLGear::bgLeft] = cmd;}
513 void SetRBrake(
double cmd) {BrakePos[FGLGear::bgRight] = cmd;}
517 void SetCBrake(
double cmd) {BrakePos[FGLGear::bgCenter] = cmd;}
524 const std::vector<double>& GetBrakePos()
const {
return BrakePos;}
528 double GetLBrake(
void)
const {
return BrakePos[FGLGear::bgLeft];}
532 double GetRBrake(
void)
const {
return BrakePos[FGLGear::bgRight];}
536 double GetCBrake(
void)
const {
return BrakePos[FGLGear::bgCenter];}
539 enum SystemType { stFCS, stSystem, stAutoPilot };
547 SGPath FindFullPathName(
const SGPath& path)
const;
549 void AddThrottle(
void);
550 double GetDt(
void)
const;
554 bool GetTrimStatus(
void)
const {
return FDMExec->GetTrimStatus(); }
555 double GetChannelDeltaT(
void)
const {
return GetDt() * ChannelRate; }
558 double DaCmd, DeCmd, DrCmd, DfCmd, DsbCmd, DspCmd;
559 double DePos[NForms], DaLPos[NForms], DaRPos[NForms], DrPos[NForms];
560 double DfPos[NForms], DsbPos[NForms], DspPos[NForms];
561 double PTrimCmd, YTrimCmd, RTrimCmd;
562 std::vector <double> ThrottleCmd;
563 std::vector <double> ThrottlePos;
564 std::vector <double> MixtureCmd;
565 std::vector <double> MixturePos;
566 std::vector <double> PropAdvanceCmd;
567 std::vector <double> PropAdvance;
568 std::vector <bool> PropFeatherCmd;
569 std::vector <bool> PropFeather;
571 std::vector <double> BrakePos;
572 double GearCmd,GearPos;
573 double TailhookPos, WingFoldPos;
578 typedef std::vector <FGFCSChannel*> Channels;
579 Channels SystemChannels;
581 void bindThrottle(
unsigned int);
582 void Debug(
int from);
void SetDePos(int form, double pos)
Sets the elevator position.
double GetDsCmd(void) const
Gets the steering command.
void SetDsbCmd(double cmd)
Sets the speedbrake command.
double GetRBrake(void) const
Gets the right brake.
void SetRollTrimCmd(double cmd)
Sets the aileron trim command.
double GetDsbCmd(void) const
Gets the speedbrake command.
double GetDfPos(int form=ofRad) const
Gets the flaps position.
double GetDeCmd(void) const
Gets the elevator command.
void SetLBrake(double cmd)
Sets the left brake group.
double GetDePos(int form=ofRad) const
Gets the elevator position.
double GetDfCmd(void) const
Gets the flaps command.
void SetPropAdvanceCmd(int engine, double cmd)
Sets the propeller pitch command for the specified engine.
void SetDrPos(int form, double pos)
Sets the rudder position.
double GetDaLPos(int form=ofRad) const
Gets the left aileron position.
void SetDspPos(int form, double pos)
Sets the spoiler position.
BrakeGroup
Brake grouping enumerators.
void SetRBrake(double cmd)
Sets the right brake group.
double GetRollTrimCmd(void) const
Gets the aileron trim command.
void SetDsbPos(int form, double pos)
Sets the speedbrake position.
double GetThrottlePos(int engine) const
Gets the throttle position.
double GetMixtureCmd(int engine) const
Gets the mixture command.
void SetDsCmd(double cmd)
Sets the steering command.
void SetPropFeather(int engine, bool cmd)
Sets the actual prop feather setting for the specified engine.
void SetThrottleCmd(int engine, double cmd)
Sets the throttle command for the specified engine.
void SetDaCmd(double cmd)
Sets the aileron command.
bool Run(bool Holding)
Runs the Flight Controls model; called by the Executive Can pass in a value indicating if the executi...
void SetDaRPos(int form, double pos)
Sets the right aileron position.
void SetDfPos(int form, double pos)
Sets the flaps position.
void SetPitchTrimCmd(double cmd)
Sets the pitch trim command.
double GetCBrake(void) const
Gets the center brake.
FGFCS(FGFDMExec *)
Constructor.
double GetMixturePos(int engine) const
Gets the mixture position.
double GetPitchTrimCmd(void) const
Gets the pitch trim command.
double GetPropAdvance(int engine) const
Gets the prop pitch position.
void SetDaLPos(int form, double pos)
Sets the left aileron position.
double GetThrottleCmd(int engine) const
Gets the throttle command.
bool GetPropFeather(int engine) const
Gets the prop feather position.
void SetYawTrimCmd(double cmd)
Sets the rudder trim command.
bool GetFeatherCmd(int engine) const
Gets the prop feather command.
void SetCBrake(double cmd)
Sets the center brake group.
void SetDspCmd(double cmd)
Sets the spoilers command.
FGGroundReactions * GetGroundReactions(void)
Returns the FGGroundReactions pointer.
std::string GetComponentValues(const std::string &delimiter) const
Retrieves all component outputs for inclusion in output stream.
Base class for all scheduled JSBSim models.
void SetDrCmd(double cmd)
Sets the rudder command.
double GetDsbPos(int form=ofRad) const
Gets the speedbrake position.
double GetYawTrimCmd(void) const
Gets the rudder trim command.
void SetDeCmd(double cmd)
Sets the elevator command.
std::string GetComponentStrings(const std::string &delimiter) const
Retrieves all component names for inclusion in output stream.
void SetGearPos(double gearpos)
Set the gear extend/retract position, defaults to down.
void SetMixturePos(int engine, double cmd)
Sets the actual mixture setting for the specified engine.
bool Load(Element *el)
Loads the Flight Control System.
void SetTailhookPos(double hookpos)
Set the tailhook position.
double GetDaCmd(void) const
Gets the aileron command.
Encapsulates the Flight Control System (FCS) functionality.
double GetGearCmd(void) const
Get the gear extend/retract command.
void SetDfCmd(double cmd)
Sets the flaps command.
void SetWingFoldPos(double foldpos)
Set the wing fold position.
double GetPropAdvanceCmd(int engine) const
Gets the prop pitch command.
void SetThrottlePos(int engine, double cmd)
Sets the actual throttle setting for the specified engine.
void SetPropAdvance(int engine, double cmd)
Sets the actual prop pitch setting for the specified engine.
void SetMixtureCmd(int engine, double cmd)
Sets the mixture command for the specified engine.
double GetDspPos(int form=ofRad) const
Gets the spoiler position.
double GetGearPos(void) const
Gets the gear position (0 up, 1 down), defaults to down.
Encapsulates the JSBSim simulation executive.
double GetDsCmd(void) const
Gets the steering command.
double GetBrake(FGLGear::BrakeGroup bg)
Gets the brake for a specified group.
double GetDspCmd(void) const
Gets the spoiler command.
double GetLBrake(void) const
Gets the left brake.
double GetDrCmd(void) const
Gets the rudder command.
void SetGearCmd(double gearcmd)
Set the gear extend/retract command, defaults to down.
void SetFeatherCmd(int engine, bool cmd)
Sets the propeller feather command for the specified engine.
void SetDsCmd(double cmd)
Sets the steering command.
double GetDaRPos(int form=ofRad) const
Gets the right aileron position.
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 GetDrPos(int form=ofRad) const
Gets the rudder position.