1 /*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
7 ------------- Copyright (C) 2001 Jon S. Berndt (jsb@hal-pc.org) -------------
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
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
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.
23 Further information about the GNU General Public License can also be found on
24 the world wide web at http://www.gnu.org.
27 --------------------------------------------------------------------------------
30 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
32 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%*/
37 /*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
39 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%*/
42 # include <simgear/compiler.h>
54 # if defined(sgi) && !defined(__GNUC__)
65 # include <simgear/constants.h>
69 /*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
71 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%*/
73 #define ID_JSBBASE "$Id$"
75 /*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
77 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%*/
131 FG_LBARH, //normalized horizontal tail arm
132 FG_LBARV, //normalized vertical tail arm
135 FG_VBARH, //horizontal tail volume
136 FG_VBARV //vertical tail volume
139 /*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
140 COMMENTS, REFERENCES, and NOTES [use "class documentation" below for API docs]
141 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%*/
143 /*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
145 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%*/
147 /** JSBSim Base class.
148 @author Jon S. Berndt
152 /*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
154 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%*/
158 /// Constructor for FGJSBBase.
161 /// Destructor for FGJSBBase.
162 virtual ~FGJSBBase() {};
164 /// JSBSim Message structure
167 unsigned int messageId;
170 enum mType {eText, eInteger, eDouble, eBool} type;
176 ///@name JSBSim Enums.
179 enum {eL = 1, eM, eN };
181 enum {eP = 1, eQ, eR };
182 /// Velocities U, V, W
183 enum {eU = 1, eV, eW };
184 /// Positions X, Y, Z
185 enum {eX = 1, eY, eZ };
186 /// Euler angles Phi, Theta, Psi
187 enum {ePhi = 1, eTht, ePsi };
188 /// Stability axis forces, Drag, Side force, Lift
189 enum {eDrag = 1, eSide, eLift };
190 /// Local frame orientation Roll, Pitch, Yaw
191 enum {eRoll = 1, ePitch, eYaw };
192 /// Local frame position North, East, Down
193 enum {eNorth = 1, eEast, eDown };
196 ///@name JSBSim console output highlighting terms.
199 static char highint[5];
200 /// low intensity text
201 static char halfint[5];
202 /// normal intensity text
203 static char normint[6];
204 /// resets text properties
205 static char reset[5];
207 static char underon[5];
209 static char underoff[6];
211 static char fgblue[6];
213 static char fgcyan[6];
215 static char fgred[6];
217 static char fggreen[6];
219 static char fgdef[6];
222 ///@name JSBSim Messaging functions
224 /** Places a Message structure on the Message queue.
225 @param msg pointer to a Message structure
226 @return pointer to a Message structure */
227 struct Message* PutMessage(struct Message* msg);
228 /** Creates a message with the given text and places it on the queue.
229 @param text message text
230 @return pointer to a Message structure */
231 struct Message* PutMessage(string text);
232 /** Creates a message with the given text and boolean value and places it on the queue.
233 @param text message text
234 @param bVal boolean value associated with the message
235 @return pointer to a Message structure */
236 struct Message* PutMessage(string text, bool bVal);
237 /** Creates a message with the given text and integer value and places it on the queue.
238 @param text message text
239 @param iVal integer value associated with the message
240 @return pointer to a Message structure */
241 struct Message* PutMessage(string text, int iVal);
242 /** Creates a message with the given text and double value and places it on the queue.
243 @param text message text
244 @param dVal double value associated with the message
245 @return pointer to a Message structure */
246 struct Message* PutMessage(string text, double dVal);
247 /** Reads the message on the queue (but does not delete it).
248 @return pointer to a Message structure (or NULL if no mesage) */
249 struct Message* ReadMessage(void);
250 /** Reads the message on the queue and removes it from the queue.
251 @return pointer to a Message structure (or NULL if no mesage) */
252 struct Message* ProcessMessage(void);
256 static struct Message localMsg;
258 static queue <struct Message*> Messages;
260 virtual void Debug(void) {};
262 static short debug_lvl;
264 static unsigned int messageId;
266 static const double radtodeg;
267 static const double degtorad;
268 static const double hptoftlbssec;
269 static const double fpstokts;
270 static const double ktstofps;
271 static const double inchtoft;
272 static const double Reng; // Specific Gas Constant,ft^2/(sec^2*R)
273 static const double SHRatio;
274 static const string needed_cfg_version;
275 static const string JSBSim_version;
278 //%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%