📄 fglgear.h
字号:
/*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%CLASS DECLARATION%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%*/class FGLGear : public FGJSBBase{public: /// Brake grouping enumerators enum BrakeGroup {bgNone=0, bgLeft, bgRight, bgCenter, bgNose, bgTail }; /// Steering group membership enumerators enum SteerType {stSteer, stFixed, stCaster}; /// Contact point type enum ContactType {ctBOGEY, ctSTRUCTURE, ctUNKNOWN}; /// Report type enumerators enum ReportType {erNone=0, erTakeoff, erLand}; /// Damping types enum DampType {dtLinear=0, dtSquare}; /** Constructor @param el a pointer to the XML element that contains the CONTACT info. @param Executive a pointer to the parent executive object @param number integer identifier for this instance of FGLGear */ FGLGear(Element* el, FGFDMExec* Executive, int number); /** Constructor @param lgear a reference to an existing FGLGear object */ FGLGear(const FGLGear& lgear); /// Destructor ~FGLGear(); /// The Force vector for this gear FGColumnVector3& Force(void); /// The Moment vector for this gear FGColumnVector3& Moment(void) {return vMoment;} /// Gets the location of the gear in Body axes FGColumnVector3& GetBodyLocation(void) { return vWhlBodyVec; } double GetBodyLocation(int idx) const { return vWhlBodyVec(idx); } FGColumnVector3& GetLocalGear(void) { return vLocalGear; } double GetLocalGear(int idx) const { return vLocalGear(idx); } /// Gets the name of the gear inline string GetName(void) const {return name; } /// Gets the Weight On Wheels flag value inline bool GetWOW(void) const {return WOW; } /// Gets the current compressed length of the gear in feet inline double GetCompLen(void) const {return compressLength;} /// Gets the current gear compression velocity in ft/sec inline double GetCompVel(void) const {return compressSpeed; } /// Gets the gear compression force in pounds inline double GetCompForce(void) const {return vForce(eZ); } inline double GetBrakeFCoeff(void) const {return BrakeFCoeff;} /// Gets the current normalized tire pressure inline double GetTirePressure(void) const { return TirePressureNorm; } /// Sets the new normalized tire pressure inline void SetTirePressure(double p) { TirePressureNorm = p; } /// Sets the brake value in percent (0 - 100) inline void SetBrake(double bp) {brakePct = bp;} /** Set the console touchdown reporting feature @param flag true turns on touchdown reporting, false turns it off */ inline void SetReport(bool flag) { ReportEnable = flag; } /** Get the console touchdown reporting feature @return true if reporting is turned on */ inline bool GetReport(void) const { return ReportEnable; } double GetSteerNorm(void) const { return radtodeg/maxSteerAngle*SteerAngle; } double GetDefaultSteerAngle(double cmd) const { return cmd*maxSteerAngle; } double GetstaticFCoeff(void) const { return staticFCoeff; } inline int GetBrakeGroup(void) const { return (int)eBrakeGrp; } inline int GetSteerType(void) const { return (int)eSteerType; } inline double GetZPosition(void) const { return vXYZ(3); } inline void SetZPosition(double z) { vXYZ(3) = z; } bool GetSteerable(void) const { return eSteerType != stFixed; } inline bool GetRetractable(void) const { return isRetractable; } inline bool GetGearUnitUp(void) const { return GearUp; } inline bool GetGearUnitDown(void) const { return GearDown; } inline double GetWheelSideForce(void) const { return SideForce; } inline double GetWheelRollForce(void) const { return RollingForce; } inline double GetWheelSideVel(void) const { return SideWhlVel; } inline double GetWheelRollVel(void) const { return RollingWhlVel; } inline double GetBodyXForce(void) const { return vLocalForce(eX); } inline double GetBodyYForce(void) const { return vLocalForce(eY); } inline double GetWheelSlipAngle(void) const { return WheelSlip; } double GetWheelVel(int axis) const { return vWhlVelVec(axis);} bool IsBogey(void) const { return (eContactType == ctBOGEY);} double GetGearUnitPos(void); void bind(void);private: int GearNumber; FGColumnVector3 vXYZ; FGColumnVector3 vMoment; FGColumnVector3 vWhlBodyVec; FGColumnVector3 vLocalGear; FGColumnVector3 vForce; FGColumnVector3 last_vForce; // remove this FGColumnVector3 vLocalForce; FGColumnVector3 vWhlVelVec; // Velocity of this wheel (Local) FGColumnVector3 normal, cvel; FGColumnVector3 prevOut, prevIn; FGLocation contact, gearLoc; FGTable *ForceY_Table; double dT; double SteerAngle; double kSpring; double bDamp; double bDampRebound; double compressLength; double compressSpeed; double staticFCoeff, dynamicFCoeff, rollingFCoeff; double brakePct; double BrakeFCoeff; double maxCompLen; double SinkRate; double GroundSpeed; double TakeoffDistanceTraveled; double TakeoffDistanceTraveled50ft; double LandingDistanceTraveled; double MaximumStrutForce; double MaximumStrutTravel; double SideWhlVel, RollingWhlVel; double RollingForce, SideForce, FCoeff; double WheelSlip; double prevSlipIn; double prevSlipOut; double TirePressureNorm; double SinWheel, CosWheel; double GearPos; bool useFCSGearPos; bool WOW; bool lastWOW; bool FirstContact; bool StartedGroundRun; bool LandingReported; bool TakeoffReported; bool ReportEnable; bool isRetractable; bool GearUp, GearDown; bool Servicable; string name; string sSteerType; string sBrakeGroup; string sRetractable; string sContactType; BrakeGroup eBrakeGrp; ContactType eContactType; SteerType eSteerType; DampType eDampType; DampType eDampTypeRebound; double maxSteerAngle; double RFRV; // Rolling force relaxation velocity double SFRV; // Side force relaxation velocity double LongForceLagFilterCoeff; // Longitudinal Force Lag Filter Coefficient double LatForceLagFilterCoeff; // Lateral Force Lag Filter Coefficient double WheelSlipLagFilterCoeff; // Wheel slip angle lag filter coefficient FGFDMExec* Exec; FGState* State; FGAircraft* Aircraft; FGPropagate* Propagate; FGAuxiliary* Auxiliary; FGFCS* FCS; FGMassBalance* MassBalance; void ComputeRetractionState(void); void ComputeBrakeForceCoefficient(void); void ComputeSteeringAngle(void); void ComputeSlipAngle(void); void ComputeSideForceCoefficient(void); void ComputeVerticalStrutForce(void); void CrashDetect(void); void InitializeReporting(void); void ResetReporting(void); void ReportTakeoffOrLanding(void); void Report(ReportType rt); void Debug(int from);};}#include "FGAircraft.h"#include "FGPropagate.h"#include "FGAuxiliary.h"#include "FGFCS.h"#include "FGMassBalance.h"#include "FGState.h"//%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%#endif
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -