X-Git-Url: https://git.mxchange.org/?a=blobdiff_plain;f=src%2FFDM%2FJSBSim%2Fmodels%2FFGGroundReactions.h;h=5774918ad3a005927f2442fac911f09069d10440;hb=024ef128e3395e8c0e32b360abe19b4d345e4f80;hp=71d39e0e939b0d2f5ed7da1f3b4fbee43403191d;hpb=3ec74d79c23347add2afa088b05ad29af975f65f;p=flightgear.git diff --git a/src/FDM/JSBSim/models/FGGroundReactions.h b/src/FDM/JSBSim/models/FGGroundReactions.h index 71d39e0e9..5774918ad 100644 --- a/src/FDM/JSBSim/models/FGGroundReactions.h +++ b/src/FDM/JSBSim/models/FGGroundReactions.h @@ -4,7 +4,7 @@ Author: Jon S. Berndt Date started: 09/13/00 - ------------- Copyright (C) 1999 Jon S. Berndt (jsb@hal-pc.org) ------------- + ------------- Copyright (C) 1999 Jon S. Berndt (jon@jsbsim.org) ------------- This program is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software @@ -38,23 +38,14 @@ SENTRY INCLUDES %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%*/ -#ifdef FGFS -# include -# ifdef SG_HAVE_STD_INCLUDES -# include -# else -# include -# endif -#else -# include -#endif +#include #include "FGModel.h" #include "FGLGear.h" -#include -#include +#include "math/FGColumnVector3.h" +#include "input_output/FGXMLElement.h" -#define ID_GROUNDREACTIONS "$Id$" +#define ID_GROUNDREACTIONS "$Id: FGGroundReactions.h,v 1.24 2011/08/21 15:13:22 bcoconni Exp $" /*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% FORWARD DECLARATIONS @@ -66,7 +57,21 @@ namespace JSBSim { CLASS DOCUMENTATION %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%*/ -/** Manages ground reactions modeling. +/** Manages ground reactions modeling. Maintains a list of landing gear and + ground contact points, all instances of FGLGear. Sums their forces and + moments so that these may be provided to FGPropagate. Parses the + \ section of the aircraft configuration file. +

Configuration File Format of \ Section:

+@code + + + ... {see FGLGear for specifics of this format} + + ... {more contacts} + +@endcode + + */ /*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% @@ -79,31 +84,43 @@ public: FGGroundReactions(FGFDMExec*); ~FGGroundReactions(void); - bool Run(void); + bool InitModel(void); + /** Runs the Ground Reactions model; called by the Executive + Can pass in a value indicating if the executive is directing the simulation to Hold. + @param 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. + @return false if no error */ + bool Run(bool Holding); bool Load(Element* el); - FGColumnVector3& GetForces(void) {return vForces;} + const FGColumnVector3& GetForces(void) const {return vForces;} double GetForces(int idx) const {return vForces(idx);} - FGColumnVector3& GetMoments(void) {return vMoments;} + const FGColumnVector3& GetMoments(void) const {return vMoments;} double GetMoments(int idx) const {return vMoments(idx);} - string GetGroundReactionStrings(string delimeter); - string GetGroundReactionValues(string delimeter); - bool GetWOW(void); + string GetGroundReactionStrings(string delimeter) const; + string GetGroundReactionValues(string delimeter) const; + bool GetWOW(void) const; - int GetNumGearUnits(void) const { return lGear.size(); } + int GetNumGearUnits(void) const { return (int)lGear.size(); } /** Gets a gear instance @param gear index of gear instance @return a pointer to the FGLGear instance of the gear unit requested */ - inline FGLGear* GetGearUnit(int gear) { return &(lGear[gear]); } + FGLGear* GetGearUnit(int gear) const { return lGear[gear]; } - void bind(void); - void unbind(void); + void RegisterLagrangeMultiplier(LagrangeMultiplier* lmult) { multipliers.push_back(lmult); } + vector * GetMultipliersList(void) { return &multipliers; } + + FGLGear::Inputs in; private: - vector lGear; + vector lGear; FGColumnVector3 vForces; FGColumnVector3 vMoments; + vector multipliers; + void bind(void); void Debug(int from); }; }