45 #include "FGFDMExec.h"
46 #include "models/FGModel.h"
47 #include "models/FGLGear.h"
48 #include "models/FGGroundReactions.h"
57 typedef enum { ofRad=0, ofDeg, ofNorm, ofMag , NForms} OutputForm;
198 bool InitModel(
void)
override;
207 bool Run(
bool Holding)
override;
225 double GetDsCmd(
void)
const {
return fdmex->GetGroundReactions()->GetDsCmd(); }
242 double GetThrottleCmd(
int engine)
const;
244 const std::vector<double>& GetThrottleCmd()
const {
return ThrottleCmd;}
251 const std::vector<double>& GetMixtureCmd()
const {
return MixtureCmd;}
286 const {
return DaLPos[form]; }
291 const {
return DaRPos[form]; }
296 const {
return DePos[form]; }
301 const {
return DrPos[form]; }
306 const {
return DsbPos[form]; }
311 const {
return DspPos[form]; }
316 const {
return DfPos[form]; }
321 double GetThrottlePos(
int engine)
const;
323 const std::vector<double>& GetThrottlePos()
const {
return ThrottlePos;}
330 const std::vector<double>& GetMixturePos()
const {
return MixturePos;}
349 const std::vector<double>& GetPropAdvance()
const {
return PropAdvance; }
356 const std::vector<bool>& GetPropFeather()
const {
return PropFeather; }
362 std::string GetComponentStrings(
const std::string& delimiter)
const;
368 std::string GetComponentValues(
const std::string& delimiter)
const;
386 void SetDsCmd(
double cmd) { fdmex->GetGroundReactions()->SetDsCmd( cmd ); }
415 void SetThrottleCmd(
int engine,
double cmd);
420 void SetMixtureCmd(
int engine,
double cmd);
429 void SetPropAdvanceCmd(
int engine,
double cmd);
434 void SetFeatherCmd(
int engine,
bool cmd);
441 void SetDaLPos(
int form ,
double pos );
445 void SetDaRPos(
int form ,
double pos );
449 void SetDePos(
int form ,
double pos );
453 void SetDrPos(
int form ,
double pos );
457 void SetDfPos(
int form ,
double pos );
461 void SetDsbPos(
int form ,
double pos );
465 void SetDspPos(
int form ,
double pos );
470 void SetThrottlePos(
int engine,
double cmd);
475 void SetMixturePos(
int engine,
double cmd);
492 void SetPropAdvance(
int engine,
double cmd);
497 void SetPropFeather(
int engine,
bool cmd);
504 void SetLBrake(
double cmd) {BrakePos[FGLGear::bgLeft] = cmd;}
508 void SetRBrake(
double cmd) {BrakePos[FGLGear::bgRight] = cmd;}
512 void SetCBrake(
double cmd) {BrakePos[FGLGear::bgCenter] = cmd;}
519 const std::vector<double>& GetBrakePos()
const {
return BrakePos;}
523 double GetLBrake(
void)
const {
return BrakePos[FGLGear::bgLeft];}
527 double GetRBrake(
void)
const {
return BrakePos[FGLGear::bgRight];}
531 double GetCBrake(
void)
const {
return BrakePos[FGLGear::bgCenter];}
534 enum SystemType { stFCS, stSystem, stAutoPilot };
540 bool Load(Element* el)
override;
542 SGPath FindFullPathName(
const SGPath& path)
const override;
544 void AddThrottle(
void);
545 double GetDt(
void)
const;
547 std::shared_ptr<FGPropertyManager> GetPropertyManager(
void) {
return PropertyManager; }
549 bool GetTrimStatus(
void)
const {
return FDMExec->GetTrimStatus(); }
550 double GetChannelDeltaT(
void)
const {
return GetDt() * ChannelRate; }
553 double DaCmd, DeCmd, DrCmd, DfCmd, DsbCmd, DspCmd;
554 double DePos[NForms], DaLPos[NForms], DaRPos[NForms], DrPos[NForms];
555 double DfPos[NForms], DsbPos[NForms], DspPos[NForms];
556 double PTrimCmd, YTrimCmd, RTrimCmd;
557 std::vector <double> ThrottleCmd;
558 std::vector <double> ThrottlePos;
559 std::vector <double> MixtureCmd;
560 std::vector <double> MixturePos;
561 std::vector <double> PropAdvanceCmd;
562 std::vector <double> PropAdvance;
563 std::vector <bool> PropFeatherCmd;
564 std::vector <bool> PropFeather;
566 std::vector <double> BrakePos;
567 double GearCmd,GearPos;
568 double TailhookPos, WingFoldPos;
573 typedef std::vector <FGFCSChannel*> Channels;
574 Channels SystemChannels;
576 void bindThrottle(
unsigned int);
577 void Debug(
int from)
override;
Encapsulates the Flight Control System (FCS) functionality.
void SetPitchTrimCmd(double cmd)
Sets the pitch trim command.
void SetGearPos(double gearpos)
Set the gear extend/retract position, defaults to down.
double GetCBrake(void) const
Gets the center brake.
double GetLBrake(void) const
Gets the left brake.
double GetDfPos(int form=ofRad) const
Gets the flaps position.
void SetDsbCmd(double cmd)
Sets the speedbrake command.
bool GetFeatherCmd(int engine) const
Gets the prop feather command.
double GetDfCmd(void) const
Gets the flaps command.
double GetDeCmd(void) const
Gets the elevator command.
double GetDsCmd(void) const
Gets the steering command.
double GetTailhookPos(void) const
Gets the tailhook position (0 up, 1 down)
double GetPropAdvanceCmd(int engine) const
Gets the prop pitch command.
void SetDeCmd(double cmd)
Sets the elevator command.
double GetDePos(int form=ofRad) const
Gets the elevator position.
void SetDaCmd(double cmd)
Sets the aileron command.
double GetDsbPos(int form=ofRad) const
Gets the speedbrake position.
double GetRBrake(void) const
Gets the right brake.
void SetRBrake(double cmd)
Sets the right brake group.
void SetDrCmd(double cmd)
Sets the rudder command.
double GetDrCmd(void) const
Gets the rudder command.
double GetDaCmd(void) const
Gets the aileron command.
double GetDaLPos(int form=ofRad) const
Gets the left aileron position.
double GetMixtureCmd(int engine) const
Gets the mixture command.
double GetRollTrimCmd(void) const
Gets the aileron trim command.
double GetDaRPos(int form=ofRad) const
Gets the right aileron position.
void SetTailhookPos(double hookpos)
Set the tailhook position.
void SetDfCmd(double cmd)
Sets the flaps command.
void SetDsCmd(double cmd)
Sets the steering command.
double GetWingFoldPos(void) const
Gets the wing fold position (0 unfolded, 1 folded)
double GetDspCmd(void) const
Gets the spoiler command.
double GetPitchTrimCmd(void) const
Gets the pitch trim command.
double GetGearPos(void) const
Gets the gear position (0 up, 1 down), defaults to down.
bool GetPropFeather(int engine) const
Gets the prop feather position.
double GetDsbCmd(void) const
Gets the speedbrake command.
void SetDspCmd(double cmd)
Sets the spoilers command.
void SetLBrake(double cmd)
Sets the left brake group.
double GetPropAdvance(int engine) const
Gets the prop pitch position.
double GetDspPos(int form=ofRad) const
Gets the spoiler position.
void SetCBrake(double cmd)
Sets the center brake group.
double GetYawTrimCmd(void) const
Gets the rudder trim command.
void SetRollTrimCmd(double cmd)
Sets the aileron trim command.
void SetYawTrimCmd(double cmd)
Sets the rudder trim command.
double GetGearCmd(void) const
Get the gear extend/retract command.
double GetMixturePos(int engine) const
Gets the mixture position.
void SetWingFoldPos(double foldpos)
Set the wing fold position.
double GetDrPos(int form=ofRad) const
Gets the rudder position.
void SetGearCmd(double gearcmd)
Set the gear extend/retract command, defaults to down.
Encapsulates the JSBSim simulation executive.
BrakeGroup
Brake grouping enumerators.
Base class for all scheduled JSBSim models.