Debian Codegraph @

src/FDM/JSBSim/models/FGGroundReactions.h

raw symbols SCIP
1 /*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
2
3 Header: FGGroundReactions.h
4 Author: Jon S. Berndt
5 Date started: 09/13/00
6
7 ------------- Copyright (C) 1999 Jon S. Berndt ([email protected]) -------------
8
9 This program is free software; you can redistribute it and/or modify it under
10 the terms of the GNU Lesser General Public License as published by the Free
11 Software Foundation; either version 2 of the License, or (at your option) any
12 later version.
13
14 This program is distributed in the hope that it will be useful, but WITHOUT
15 ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
16 FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more
17 details.
18
19 You should have received a copy of the GNU Lesser General Public License along
20 with this program; if not, write to the Free Software Foundation, Inc., 59
21 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
22
23 Further information about the GNU Lesser General Public License can also be
24 found on the world wide web at http://www.gnu.org.
25
26 HISTORY
27 --------------------------------------------------------------------------------
28 09/13/00 JSB Created
29
30 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
31 SENTRY
32 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%*/
33
34 #ifndef FGGROUNDREACTIONS_H
35 #define FGGROUNDREACTIONS_H
36
37 /*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
38 INCLUDES
39 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%*/
40
41 #include <vector>
42
43 #include "FGSurface.h"
44 #include "FGModel.h"
45 #include "FGLGear.h"
46 #include "math/FGColumnVector3.h"
47
48 /*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
49 FORWARD DECLARATIONS
50 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%*/
51
52 namespace JSBSim {
53
54 /*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
55 CLASS DOCUMENTATION
56 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%*/
57
58 /** Manages ground reactions modeling. Maintains a list of landing gear and
59 ground contact points, all instances of FGLGear. Sums their forces and
60 moments so that these may be provided to FGPropagate. Parses the
61 \<ground_reactions> section of the aircraft configuration file.
62 <h3>Configuration File Format of \<ground_reactions> Section:</h3>
63 @code{.xml}
64 <ground_reactions>
65 <contact>
66 ... {see FGLGear for specifics of this format}
67 </contact>
68 ... {more contacts}
69 </ground_reactions>
70 @endcode
71
72
73 */
74
75 /*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
76 CLASS DECLARATION
77 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%*/
78
79 class JSBSIM_API FGGroundReactions : public FGModel, public FGSurface
80 {
81 public:
82 FGGroundReactions(FGFDMExec*);
83 ~FGGroundReactions(void) override;
84
85 bool InitModel(void) override;
86 /** Runs the Ground Reactions model; called by the Executive
87 Can pass in a value indicating if the executive is directing the simulation to Hold.
88 @param Holding if true, the executive has been directed to hold the sim from
89 advancing time. Some models may ignore this flag, such as the Input
90 model, which may need to be active to listen on a socket for the
91 "Resume" command to be given.
92 @return false if no error */
93 bool Run(bool Holding) override;
94 bool Load(Element* el) override;
95 const FGColumnVector3& GetForces(void) const {return vForces;}
96 double GetForces(int idx) const {return vForces(idx);}
97 const FGColumnVector3& GetMoments(void) const {return vMoments;}
98 double GetMoments(int idx) const {return vMoments(idx);}
99 std::string GetGroundReactionStrings(std::string delimeter) const;
100 std::string GetGroundReactionValues(std::string delimeter) const;
101 bool GetWOW(void) const;
102
103 /** Gets the number of gears.
104 @return the number of gears of the aircraft.*/
105 int GetNumGearUnits(void) const { return (int)lGear.size(); }
106
107 /** Gets a gear instance
108 @param gear index of gear instance
109 @return a pointer to the FGLGear instance of the gear unit requested */
110 FGLGear* GetGearUnit(int gear) const { return lGear[gear]; }
111
112 /** Gets the steering command.
113 @return steering command in range from -1.0 - 1.0 */
114 double GetDsCmd(void) const { return DsCmd; }
115
116 /** Sets the steering command
117 @param cmd steering command in percent*/
118 void SetDsCmd(double cmd);
119
120 void RegisterLagrangeMultiplier(LagrangeMultiplier* lmult) { multipliers.push_back(lmult); }
121 std::vector <LagrangeMultiplier*>* GetMultipliersList(void) { return &multipliers; }
122
123 FGLGear::Inputs in;
124
125 private:
126 std::vector <FGLGear*> lGear;
127 FGColumnVector3 vForces;
128 FGColumnVector3 vMoments;
129 std::vector <LagrangeMultiplier*> multipliers;
130 double DsCmd;
131
132 void bind(void);
133 void Debug(int from) override;
134 };
135 }
136 //%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
137 #endif