X-Git-Url: https://git.mxchange.org/?a=blobdiff_plain;f=src%2FFDM%2FJSBSim%2Fmodels%2FFGExternalReactions.h;h=7945abf88565830145d2a8e79f158d4357e00b0f;hb=1575fad886a0b18825363d41d53a287e8d36b9c8;hp=f32cab28f46eb4f8d80335d4e66cf77ee8f65adb;hpb=3b3f6719746e3877a3aeedbd6b944a55960ae792;p=flightgear.git diff --git a/src/FDM/JSBSim/models/FGExternalReactions.h b/src/FDM/JSBSim/models/FGExternalReactions.h old mode 100755 new mode 100644 index f32cab28f..7945abf88 --- a/src/FDM/JSBSim/models/FGExternalReactions.h +++ b/src/FDM/JSBSim/models/FGExternalReactions.h @@ -38,15 +38,17 @@ SENTRY INCLUDES %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%*/ +#include #include "FGModel.h" #include "FGExternalForce.h" -#include +#include "input_output/FGXMLFileRead.h" + /*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% DEFINITIONS %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%*/ -#define ID_EXTERNALREACTIONS "$Id$" +#define ID_EXTERNALREACTIONS "$Id: FGExternalReactions.h,v 1.14 2011/10/31 14:54:41 bcoconni Exp $" /*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% FORWARD DECLARATIONS @@ -54,6 +56,8 @@ FORWARD DECLARATIONS namespace JSBSim { +class Element; + /*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% CLASS DOCUMENTATION %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%*/ @@ -113,7 +117,7 @@ CLASS DOCUMENTATION CLASS DECLARATION %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%*/ -class FGExternalReactions : public FGModel +class FGExternalReactions : public FGModel, public FGXMLFileRead { public: /** Constructor. @@ -130,9 +134,13 @@ public: bool InitModel(void); /** Sum all the constituent forces for this cycle. - @return true always. - */ - bool Run(void); + 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 true always. */ + bool Run(bool Holding); /** Loads the external forces from the XML configuration file. If the external_reactions section is encountered in the vehicle configuration @@ -145,23 +153,25 @@ public: /** Retrieves the total forces defined in the external reactions. @return the total force in pounds. */ - FGColumnVector3 GetForces(void) {return vTotalForces;} + const FGColumnVector3& GetForces(void) const {return vTotalForces;} + double GetForces(int idx) const {return vTotalForces(idx);} /** Retrieves the total moment resulting from the forces defined in the external reactions. @return the total moment in foot-pounds. */ - FGColumnVector3 GetMoments(void) {return vTotalMoments;} + const FGColumnVector3& GetMoments(void) const {return vTotalMoments;} + double GetMoments(int idx) const {return vTotalMoments(idx);} private: - vector Forces; + std::vector Forces; unsigned int numForces; FGColumnVector3 vTotalForces; FGColumnVector3 vTotalMoments; - vector interface_properties; bool NoneDefined; + void bind(void); void Debug(int from); }; }