~ubuntu-branches/ubuntu/precise/flightgear/precise

« back to all changes in this revision

Viewing changes to src/FDM/JSBSim/models/FGGasCell.h

  • Committer: Bazaar Package Importer
  • Author(s): Ove Kaaven
  • Date: 2011-01-30 15:46:35 UTC
  • mfrom: (3.1.7 sid)
  • Revision ID: james.westby@ubuntu.com-20110130154635-rlynmg9n5hzxq5xe
Tags: 2.0.0-3
* Recommend fgfs-aircraft-base and fgfs-models-base.
  Closes. #610276.
* Added note about scenery SharedModels.tgz to README.Debian.

Show diffs side-by-side

added added

removed removed

Lines of Context:
39
39
INCLUDES
40
40
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%*/
41
41
 
42
 
#include <FGJSBBase.h>
43
 
#include <input_output/FGXMLElement.h>
44
 
#include <math/FGColumnVector3.h>
45
 
#include <models/propulsion/FGForce.h>
46
 
#include <math/FGFunction.h>
 
42
#include "FGJSBBase.h"
 
43
#include "math/FGColumnVector3.h"
 
44
#include "models/propulsion/FGForce.h"
 
45
#include "math/FGFunction.h"
47
46
 
48
47
#include <string>
49
 
using std::string;
50
 
using std::cerr;
51
 
using std::endl;
52
 
using std::cout;
53
48
 
54
49
/*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
55
50
DEFINITIONS
64
59
namespace JSBSim {
65
60
 
66
61
class FGBallonet;
 
62
class Element;
67
63
 
68
64
/*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
69
65
CLASS DOCUMENTATION
189
185
 
190
186
  /** Get the index of this gas cell
191
187
      @return gas cell index. */
192
 
  int GetIndex(void) {return CellNum;}
193
 
 
194
 
  /** Get the center of gravity location of the gas cell
195
 
      (including any ballonets)
196
 
      @return CoG location in the structural frame. */
197
 
  const FGColumnVector3& GetXYZ(void) {return vXYZ;}
198
 
 
199
 
  /** Get the center of gravity location of the gas cell
200
 
      (including any ballonets)
201
 
      @return CoG location in the structural frame. */
202
 
  double GetXYZ(int idx) {return vXYZ(idx);}
 
188
  int GetIndex(void) const {return CellNum;}
 
189
 
 
190
  /** Get the center of gravity location of the gas cell
 
191
      (including any ballonets)
 
192
      @return CoG location in the structural frame. */
 
193
  const FGColumnVector3& GetXYZ(void) const {return vXYZ;}
 
194
 
 
195
  /** Get the center of gravity location of the gas cell
 
196
      (including any ballonets)
 
197
      @return CoG location in the structural frame. */
 
198
  double GetXYZ(int idx) const {return vXYZ(idx);}
203
199
 
204
200
  /** Get the current mass of the gas cell (including any ballonets)
205
201
      @return gas mass in slug. */
206
 
  double GetMass(void) {return Mass;}
 
202
  double GetMass(void) const {return Mass;}
207
203
 
208
204
  /** Get the moments of inertia of the gas cell (including any ballonets)
209
 
      @return moments of inertia matrix in slug ft<sup>2</sup>. */
210
 
  FGMatrix33& GetInertia(void) {return gasCellJ;}
 
205
      @return moments of inertia matrix relative the gas cell location
 
206
      in slug ft<sup>2</sup>. */
 
207
  const FGMatrix33& GetInertia(void) const {return gasCellJ;}
211
208
 
212
209
  /** Get the moment due to mass of the gas cell (including any ballonets)
213
210
 
214
211
      Note that the buoyancy of the gas cell is handled separately by the
215
212
      FGForce part and not included here.
216
213
      @return moment vector in lbs ft. */
217
 
  FGColumnVector3& GetMassMoment(void) {return gasCellM;}
 
214
  const FGColumnVector3& GetMassMoment(void) const {return gasCellM;}
218
215
 
219
216
  /** Get the current gas temperature inside the gas cell
220
217
      @return gas temperature in Rankine. */
221
 
  double GetTemperature(void) {return Temperature;}
 
218
  double GetTemperature(void) const {return Temperature;}
222
219
 
223
220
  /** Get the current gas pressure inside the gas cell
224
221
      @return gas pressure in lbs / ft<sup>2</sup>. */
225
 
  double GetPressure(void) {return Pressure;}
 
222
  double GetPressure(void) const {return Pressure;}
226
223
 
227
224
private:
228
225
 
229
226
  enum GasType {ttUNKNOWN, ttHYDROGEN, ttHELIUM, ttAIR};
230
227
 
231
228
  GasType Type;
232
 
  string type;
 
229
  std::string type;
233
230
  int CellNum;
234
231
  // Structural constants
235
232
  double MaxVolume;                 // [ft�]
316
313
 
317
314
  /** Get the center of gravity location of the ballonet
318
315
      @return CoG location in the structural frame. */
319
 
  const FGColumnVector3& GetXYZ(void) {return vXYZ;}
 
316
  const FGColumnVector3& GetXYZ(void) const {return vXYZ;}
320
317
  /** Get the center of gravity location of the ballonet
321
318
      @return CoG location in the structural frame. */
322
 
  double GetXYZ(int idx) {return vXYZ(idx);}
 
319
  double GetXYZ(int idx) const {return vXYZ(idx);}
323
320
 
324
321
  /** Get the current mass of the ballonets
325
322
      @return mass in slug. */
326
 
  double GetMass(void) {return Contents * M_air;}
 
323
  double GetMass(void) const {return Contents * M_air;}
327
324
 
328
325
  /** Get the moments of inertia of the ballonet
329
326
      @return moments of inertia matrix in slug ft<sup>2</sup>. */
330
 
  FGMatrix33& GetInertia(void) {return ballonetJ;}
 
327
  const FGMatrix33& GetInertia(void) const {return ballonetJ;}
331
328
 
332
329
  /** Get the current volume of the ballonet
333
330
      @return volume in ft<sup>3</sup>. */
334
 
  double GetVolume(void) {return Volume;}
 
331
  double GetVolume(void) const {return Volume;}
335
332
  /** Get the current heat flow into the ballonet
336
333
      @return heat flow in lbs ft / sec. */
337
 
  double GetHeatFlow(void) {return dU;}             // [lbs ft / sec]
 
334
  double GetHeatFlow(void) const {return dU;}       // [lbs ft / sec]
338
335
 
339
336
private:
340
337
  int CellNum;