]> git.mxchange.org Git - flightgear.git/blob - src/FDM/JSBSim/FGFactorGroup.h
Converted FCS to use property tree internally, documentation updates.
[flightgear.git] / src / FDM / JSBSim / FGFactorGroup.h
1 /*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
2
3  Header:       FGFactorGroup.h
4  Author:       Tony Peden
5  Date started: 7/14/01
6
7  ------------- Copyright (C) 2001  Tony Peden (apeden@earthlink.net ------------
8
9  This program is free software; you can redistribute it and/or modify it under
10  the terms of the GNU General Public License as published by the Free Software
11  Foundation; either version 2 of the License, or (at your option) any later
12  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 General Public License for more
17  details.
18
19  You should have received a copy of the GNU General Public License along with
20  this program; if not, write to the Free Software Foundation, Inc., 59 Temple
21  Place - Suite 330, Boston, MA  02111-1307, USA.
22
23  Further information about the GNU General Public License can also be found on
24  the world wide web at http://www.gnu.org.
25
26 HISTORY
27 --------------------------------------------------------------------------------
28 12/28/98   JSB   Created
29
30 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
31 SENTRY
32 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%*/
33
34 #ifndef FGFACTORGROUP_H
35 #define FGFACTORGROUP_H
36
37 /*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
38 INCLUDES
39 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%*/
40
41 #ifdef FGFS
42 #  include <simgear/compiler.h>
43 #endif
44
45 #include <vector>
46 #include <string>
47 #include "FGConfigFile.h"
48 #include "FGTable.h"
49 #include "FGCoefficient.h"
50 #include "FGAerodynamics.h"
51 #include "FGFactorGroup.h"
52
53 /*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
54 DEFINITIONS
55 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%*/
56
57 #define ID_FACTORGROUP "$Id$"
58
59 using std::vector;
60
61 /*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
62 FORWARD DECLARATIONS
63 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%*/
64
65 class FGFDMExec;
66 class FGState;
67 class FGAtmosphere;
68 class FGFCS;
69 class FGAircraft;
70 class FGTranslation;
71 class FGRotation;
72 class FGPosition;
73 class FGAuxiliary;
74 class FGOutput;
75
76 /*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
77 COMMENTS, REFERENCES, and NOTES [use "class documentation" below for API docs]
78 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
79
80
81 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
82 CLASS DOCUMENTATION
83 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%*/
84
85 /** This class encapsulates the functionality needed to manage a factor group
86     i.e. factor*(coeff1 + coeff2 + coeff3)
87     @author Tony Peden
88     @see <a href="http://cvs.sourceforge.net/cgi-bin/viewcvs.cgi/jsbsim/JSBSim/FGFactorGroup.h?rev=HEAD&content-type=text/vnd.viewcvs-markup">
89          Header File </a>
90     @see <a href="http://cvs.sourceforge.net/cgi-bin/viewcvs.cgi/jsbsim/JSBSim/FGFactorGroup.cpp?rev=HEAD&content-type=text/vnd.viewcvs-markup">
91          Source File </a>
92 */
93
94 /*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
95 CLASS DECLARATION
96 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%*/
97
98 class FGFactorGroup: public FGCoefficient {
99   public:
100     FGFactorGroup(FGFDMExec* fdmex);
101     ~FGFactorGroup();
102     
103     bool Load(FGConfigFile *AC_cfg);
104     double TotalValue(void);
105     inline double GetValue(void) const { return totalValue; }
106     //string GetCoefficientStrings(void);
107     //string GetCoefficientValues(void);
108     inline double GetSD(void) { return SDtotal; }
109     inline double GetFactorSD(void) { return FGCoefficient::GetSD(); }
110     
111     void bind(FGPropertyManager* parent);
112     void unbind(void);
113   private:
114     FGFDMExec *FDMExec;
115     string name;
116     string description;
117     typedef vector<FGCoefficient*> CoeffArray;
118     CoeffArray sum;
119     double SDtotal;
120     double totalValue;
121     FGPropertyManager* node;
122     void Debug(int from);
123 };
124     
125 #endif