~jtaylor/ubuntu/oneiric/flightgear/fix-749249

« back to all changes in this revision

Viewing changes to src/FDM/JSBSim/FGAuxiliary.cpp

  • Committer: Bazaar Package Importer
  • Author(s): Ove Kaaven
  • Date: 2006-05-17 17:12:09 UTC
  • mfrom: (1.1.5 upstream) (3.1.1 etch)
  • Revision ID: james.westby@ubuntu.com-20060517171209-9qbwm4q1uj05vhcj
Tags: 0.9.10-2
Updated the build dependencies for xorg 7.0. Apparently the
amd64 autobuilder doesn't use Provides.

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
/*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
2
 
 
3
 
 Module:       FGAuxiliary.cpp
4
 
 Author:       Tony Peden, Jon Berndt
5
 
 Date started: 01/26/99
6
 
 Purpose:      Calculates additional parameters needed by the visual system, etc.
7
 
 Called by:    FGSimExec
8
 
 
9
 
 ------------- Copyright (C) 1999  Jon S. Berndt (jsb@hal-pc.org) -------------
10
 
 
11
 
 This program is free software; you can redistribute it and/or modify it under
12
 
 the terms of the GNU General Public License as published by the Free Software
13
 
 Foundation; either version 2 of the License, or (at your option) any later
14
 
 version.
15
 
 
16
 
 This program is distributed in the hope that it will be useful, but WITHOUT
17
 
 ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
18
 
 FOR A PARTICULAR PURPOSE.  See the GNU General Public License for more
19
 
 details.
20
 
 
21
 
 You should have received a copy of the GNU General Public License along with
22
 
 this program; if not, write to the Free Software Foundation, Inc., 59 Temple
23
 
 Place - Suite 330, Boston, MA  02111-1307, USA.
24
 
 
25
 
 Further information about the GNU General Public License can also be found on
26
 
 the world wide web at http://www.gnu.org.
27
 
 
28
 
FUNCTIONAL DESCRIPTION
29
 
--------------------------------------------------------------------------------
30
 
This class calculates various auxiliary parameters.
31
 
 
32
 
REFERENCES
33
 
  Anderson, John D. "Introduction to Flight", 3rd Edition, McGraw-Hill, 1989
34
 
                    pgs. 112-126
35
 
HISTORY
36
 
--------------------------------------------------------------------------------
37
 
01/26/99   JSB   Created
38
 
 
39
 
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
40
 
INCLUDES
41
 
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%*/
42
 
 
43
 
#include "FGAuxiliary.h"
44
 
#include "FGAerodynamics.h"
45
 
#include "FGPropagate.h"
46
 
#include "FGAtmosphere.h"
47
 
#include "FGState.h"
48
 
#include "FGFDMExec.h"
49
 
#include "FGAircraft.h"
50
 
#include "FGInertial.h"
51
 
#include "FGPropertyManager.h"
52
 
 
53
 
namespace JSBSim {
54
 
 
55
 
static const char *IdSrc = "$Id: FGAuxiliary.cpp,v 1.12 2004/09/11 12:41:05 ehofman Exp $";
56
 
static const char *IdHdr = ID_AUXILIARY;
57
 
 
58
 
/*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
59
 
CLASS IMPLEMENTATION
60
 
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%*/
61
 
 
62
 
 
63
 
FGAuxiliary::FGAuxiliary(FGFDMExec* fdmex) : FGModel(fdmex)
64
 
{
65
 
  Name = "FGAuxiliary";
66
 
  vcas = veas = pt = tat = 0;
67
 
  psl = rhosl = 1;
68
 
  earthPosAngle = 0.0;
69
 
  qbar = 0;
70
 
  qbarUW = 0.0;
71
 
  qbarUV = 0.0;
72
 
  Mach = 0.0;
73
 
  alpha = beta = 0.0;
74
 
  adot = bdot = 0.0;
75
 
  gamma = Vt = Vground = 0.0;
76
 
  psigt = 0.0;
77
 
  day_of_year = 1;
78
 
  seconds_in_day = 0.0;
79
 
  hoverbmac = hoverbcg = 0.0;
80
 
 
81
 
  vPilotAccel.InitMatrix();
82
 
  vPilotAccelN.InitMatrix();
83
 
  vToEyePt.InitMatrix();
84
 
  vAeroPQR.InitMatrix();
85
 
  vEulerRates.InitMatrix();
86
 
 
87
 
  bind();
88
 
 
89
 
  Debug(0);
90
 
}
91
 
 
92
 
//%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
93
 
 
94
 
FGAuxiliary::~FGAuxiliary()
95
 
{
96
 
  unbind();
97
 
  Debug(1);
98
 
}
99
 
 
100
 
//%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
101
 
 
102
 
bool FGAuxiliary::Run()
103
 
{
104
 
  double A,B,D, hdot_Vt;
105
 
  const FGColumnVector3& vPQR = Propagate->GetPQR();
106
 
  const FGColumnVector3& vUVW = Propagate->GetUVW();
107
 
  const FGColumnVector3& vUVWdot = Propagate->GetUVWdot();
108
 
  const FGColumnVector3& vVel = Propagate->GetVel();
109
 
 
110
 
  if (!FGModel::Run())
111
 
  {
112
 
    p = Atmosphere->GetPressure();
113
 
    rhosl = Atmosphere->GetDensitySL();
114
 
    psl = Atmosphere->GetPressureSL();
115
 
    sat = Atmosphere->GetTemperature();
116
 
 
117
 
// Rotation
118
 
 
119
 
    double cTht = Propagate->GetCosEuler(eTht);
120
 
    double cPhi = Propagate->GetCosEuler(ePhi);
121
 
    double sPhi = Propagate->GetSinEuler(ePhi);
122
 
 
123
 
    vEulerRates(eTht) = vPQR(eQ)*cPhi - vPQR(eR)*sPhi;
124
 
    if (cTht != 0.0) {
125
 
      vEulerRates(ePsi) = (vPQR(eQ)*sPhi + vPQR(eR)*cPhi)/cTht;
126
 
      vEulerRates(ePhi) = vPQR(eP) + vEulerRates(ePsi)*sPhi;
127
 
    }
128
 
 
129
 
    vAeroPQR = vPQR + Atmosphere->GetTurbPQR();
130
 
 
131
 
// Translation
132
 
 
133
 
    vAeroUVW = vUVW + Propagate->GetTl2b()*Atmosphere->GetWindNED();
134
 
 
135
 
    Vt = vAeroUVW.Magnitude();
136
 
    if ( Vt > 0.05) {
137
 
      if (vAeroUVW(eW) != 0.0)
138
 
        alpha = vAeroUVW(eU)*vAeroUVW(eU) > 0.0 ? atan2(vAeroUVW(eW), vAeroUVW(eU)) : 0.0;
139
 
      if (vAeroUVW(eV) != 0.0)
140
 
        beta = vAeroUVW(eU)*vAeroUVW(eU)+vAeroUVW(eW)*vAeroUVW(eW) > 0.0 ? atan2(vAeroUVW(eV),
141
 
               sqrt(vAeroUVW(eU)*vAeroUVW(eU) + vAeroUVW(eW)*vAeroUVW(eW))) : 0.0;
142
 
 
143
 
      double mUW = (vAeroUVW(eU)*vAeroUVW(eU) + vAeroUVW(eW)*vAeroUVW(eW));
144
 
      double signU=1;
145
 
      if (vAeroUVW(eU) != 0.0)
146
 
        signU = vAeroUVW(eU)/fabs(vAeroUVW(eU));
147
 
 
148
 
      if ( (mUW == 0.0) || (Vt == 0.0) ) {
149
 
        adot = 0.0;
150
 
        bdot = 0.0;
151
 
      } else {
152
 
        adot = (vAeroUVW(eU)*vUVWdot(eW) - vAeroUVW(eW)*vUVWdot(eU))/mUW;
153
 
        bdot = (signU*mUW*vUVWdot(eV) - vAeroUVW(eV)*(vAeroUVW(eU)*vUVWdot(eU)
154
 
                + vAeroUVW(eW)*vUVWdot(eW)))/(Vt*Vt*sqrt(mUW));
155
 
      }
156
 
    } else {
157
 
      alpha = beta = adot = bdot = 0;
158
 
    }
159
 
 
160
 
    qbar = 0.5*Atmosphere->GetDensity()*Vt*Vt;
161
 
    qbarUW = 0.5*Atmosphere->GetDensity()*(vAeroUVW(eU)*vAeroUVW(eU) + vAeroUVW(eW)*vAeroUVW(eW));
162
 
    qbarUV = 0.5*Atmosphere->GetDensity()*(vAeroUVW(eU)*vAeroUVW(eU) + vAeroUVW(eV)*vAeroUVW(eV));
163
 
    Mach = Vt / Atmosphere->GetSoundSpeed();
164
 
    MachU = vMachUVW(eU) = vAeroUVW(eU) / Atmosphere->GetSoundSpeed();
165
 
    vMachUVW(eV) = vAeroUVW(eV) / Atmosphere->GetSoundSpeed();
166
 
    vMachUVW(eW) = vAeroUVW(eW) / Atmosphere->GetSoundSpeed();
167
 
 
168
 
// Position
169
 
 
170
 
    Vground = sqrt( vVel(eNorth)*vVel(eNorth) + vVel(eEast)*vVel(eEast) );
171
 
 
172
 
    if (vVel(eNorth) == 0) psigt = 0;
173
 
    else psigt =  atan2(vVel(eEast), vVel(eNorth));
174
 
 
175
 
    if (psigt < 0.0) psigt += 2*M_PI;
176
 
 
177
 
    if (Vt != 0) {
178
 
      hdot_Vt = -vVel(eDown)/Vt;
179
 
      if (fabs(hdot_Vt) <= 1) gamma = asin(hdot_Vt);
180
 
    } else {
181
 
      gamma = 0.0;
182
 
    }
183
 
 
184
 
    tat = sat*(1 + 0.2*Mach*Mach); // Total Temperature, isentropic flow
185
 
    tatc = RankineToCelsius(tat);
186
 
 
187
 
    if (MachU < 1) {   // Calculate total pressure assuming isentropic flow
188
 
      pt = p*pow((1 + 0.2*MachU*MachU),3.5);
189
 
    } else {
190
 
      // Use Rayleigh pitot tube formula for normal shock in front of pitot tube
191
 
      B = 5.76*MachU*MachU/(5.6*MachU*MachU - 0.8);
192
 
      D = (2.8*MachU*MachU-0.4)*0.4167;
193
 
      pt = p*pow(B,3.5)*D;
194
 
    }
195
 
 
196
 
    A = pow(((pt-p)/psl+1),0.28571);
197
 
    if (MachU > 0.0) {
198
 
      vcas = sqrt(7*psl/rhosl*(A-1));
199
 
      veas = sqrt(2*qbar/rhosl);
200
 
    } else {
201
 
      vcas = veas = 0.0;
202
 
    }
203
 
 
204
 
    vPilotAccel.InitMatrix();
205
 
    if ( Vt > 1.0 ) {
206
 
       vPilotAccel =  Aerodynamics->GetForces()
207
 
                      +  Propulsion->GetForces()
208
 
                      +  GroundReactions->GetForces();
209
 
       vPilotAccel /= MassBalance->GetMass();
210
 
       vToEyePt = MassBalance->StructuralToBody(Aircraft->GetXYZep());
211
 
       vPilotAccel += Propagate->GetPQRdot() * vToEyePt;
212
 
       vPilotAccel += vPQR * (vPQR * vToEyePt);
213
 
    } else {
214
 
       vPilotAccel = Propagate->GetTl2b() * FGColumnVector3( 0.0, 0.0, Inertial->gravity() );
215
 
    }
216
 
 
217
 
    vPilotAccelN = vPilotAccel/Inertial->gravity();
218
 
 
219
 
    earthPosAngle += State->Getdt()*Inertial->omega();
220
 
 
221
 
    // VRP computation
222
 
    const FGLocation& vLocation = Propagate->GetLocation();
223
 
    FGColumnVector3 vrpStructural = Aircraft->GetXYZvrp();
224
 
    FGColumnVector3 vrpBody = MassBalance->StructuralToBody( vrpStructural );
225
 
    FGColumnVector3 vrpLocal = Propagate->GetTb2l() * vrpBody;
226
 
    vLocationVRP = vLocation.LocalToLocation( vrpLocal );
227
 
 
228
 
    // Recompute some derived values now that we know the dependent parameters values ...
229
 
    hoverbcg = Propagate->GetDistanceAGL() / Aircraft->GetWingSpan();
230
 
 
231
 
    FGColumnVector3 vMac = Propagate->GetTb2l()*MassBalance->StructuralToBody(Aircraft->GetXYZrp());
232
 
    hoverbmac = (Propagate->GetDistanceAGL() + vMac(3)) / Aircraft->GetWingSpan();
233
 
 
234
 
    return false;
235
 
  } else {
236
 
    return true;
237
 
  }
238
 
}
239
 
 
240
 
//%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
241
 
 
242
 
double FGAuxiliary::GetHeadWind(void)
243
 
{
244
 
  double psiw,vw;
245
 
 
246
 
  psiw = Atmosphere->GetWindPsi();
247
 
  vw = Atmosphere->GetWindNED().Magnitude();
248
 
 
249
 
  return vw*cos(psiw - Propagate->GetEuler(ePsi));
250
 
}
251
 
 
252
 
//%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
253
 
 
254
 
double FGAuxiliary::GetCrossWind(void)
255
 
{
256
 
  double psiw,vw;
257
 
 
258
 
  psiw = Atmosphere->GetWindPsi();
259
 
  vw = Atmosphere->GetWindNED().Magnitude();
260
 
 
261
 
  return  vw*sin(psiw - Propagate->GetEuler(ePsi));
262
 
}
263
 
 
264
 
//%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
265
 
 
266
 
void FGAuxiliary::bind(void)
267
 
{
268
 
  typedef double (FGAuxiliary::*PMF)(int) const;
269
 
  typedef double (FGAuxiliary::*PF)(void) const;
270
 
  PropertyManager->Tie("velocities/vc-fps", this, &FGAuxiliary::GetVcalibratedFPS);
271
 
  PropertyManager->Tie("velocities/vc-kts", this, &FGAuxiliary::GetVcalibratedKTS);
272
 
  PropertyManager->Tie("velocities/ve-fps", this, &FGAuxiliary::GetVequivalentFPS);
273
 
  PropertyManager->Tie("velocities/ve-kts", this, &FGAuxiliary::GetVequivalentKTS);
274
 
  PropertyManager->Tie("velocities/machU", this, &FGAuxiliary::GetMachU);
275
 
  PropertyManager->Tie("velocities/tat-r", this, &FGAuxiliary::GetTotalTemperature);
276
 
  PropertyManager->Tie("velocities/tat-c", this, &FGAuxiliary::GetTAT_C);
277
 
  PropertyManager->Tie("velocities/pt-lbs_sqft", this, &FGAuxiliary::GetTotalPressure);
278
 
  PropertyManager->Tie("velocities/p-aero-rad_sec", this, eX, (PMF)&FGAuxiliary::GetAeroPQR);
279
 
  PropertyManager->Tie("velocities/q-aero-rad_sec", this, eY, (PMF)&FGAuxiliary::GetAeroPQR);
280
 
  PropertyManager->Tie("velocities/r-aero-rad_sec", this, eZ, (PMF)&FGAuxiliary::GetAeroPQR);
281
 
  PropertyManager->Tie("velocities/phidot-rad_sec", this, ePhi, (PMF)&FGAuxiliary::GetEulerRates);
282
 
  PropertyManager->Tie("velocities/thetadot-rad_sec", this, eTht, (PMF)&FGAuxiliary::GetEulerRates);
283
 
  PropertyManager->Tie("velocities/psidot-rad_sec", this, ePsi, (PMF)&FGAuxiliary::GetEulerRates);
284
 
  PropertyManager->Tie("velocities/u-aero-fps", this, eU, (PMF)&FGAuxiliary::GetAeroUVW);
285
 
  PropertyManager->Tie("velocities/v-aero-fps", this, eV, (PMF)&FGAuxiliary::GetAeroUVW);
286
 
  PropertyManager->Tie("velocities/w-aero-fps", this, eW, (PMF)&FGAuxiliary::GetAeroUVW);
287
 
  PropertyManager->Tie("velocities/vt-fps", this, &FGAuxiliary::GetVt, &FGAuxiliary::SetVt, true);
288
 
  PropertyManager->Tie("velocities/mach-norm", this, &FGAuxiliary::GetMach, &FGAuxiliary::SetMach, true);
289
 
  PropertyManager->Tie("velocities/vg-fps", this, &FGAuxiliary::GetVground);
290
 
  PropertyManager->Tie("accelerations/a-pilot-x-ft_sec2", this, eX, (PMF)&FGAuxiliary::GetPilotAccel);
291
 
  PropertyManager->Tie("accelerations/a-pilot-y-ft_sec2", this, eY, (PMF)&FGAuxiliary::GetPilotAccel);
292
 
  PropertyManager->Tie("accelerations/a-pilot-z-ft_sec2", this, eZ, (PMF)&FGAuxiliary::GetPilotAccel);
293
 
  PropertyManager->Tie("accelerations/n-pilot-x-norm", this, eX, (PMF)&FGAuxiliary::GetNpilot);
294
 
  PropertyManager->Tie("accelerations/n-pilot-y-norm", this, eY, (PMF)&FGAuxiliary::GetNpilot);
295
 
  PropertyManager->Tie("accelerations/n-pilot-z-norm", this, eZ, (PMF)&FGAuxiliary::GetNpilot);
296
 
  PropertyManager->Tie("position/epa-rad", this, &FGAuxiliary::GetEarthPositionAngle);
297
 
  /* PropertyManager->Tie("atmosphere/headwind-fps", this, &FGAuxiliary::GetHeadWind, true);
298
 
  PropertyManager->Tie("atmosphere/crosswind-fps", this, &FGAuxiliary::GetCrossWind, true); */
299
 
  PropertyManager->Tie("aero/alpha-rad", this, (PF)&FGAuxiliary::Getalpha, &FGAuxiliary::Setalpha, true);
300
 
  PropertyManager->Tie("aero/beta-rad", this, (PF)&FGAuxiliary::Getbeta, &FGAuxiliary::Setbeta, true);
301
 
  PropertyManager->Tie("aero/mag-beta-rad", this, (PF)&FGAuxiliary::GetMagBeta);
302
 
  PropertyManager->Tie("aero/alpha-deg", this, inDegrees, (PMF)&FGAuxiliary::Getalpha);
303
 
  PropertyManager->Tie("aero/beta-deg", this, inDegrees, (PMF)&FGAuxiliary::Getbeta);
304
 
  PropertyManager->Tie("aero/mag-beta-deg", this, inDegrees, (PMF)&FGAuxiliary::GetMagBeta);
305
 
  PropertyManager->Tie("aero/qbar-psf", this, &FGAuxiliary::Getqbar, &FGAuxiliary::Setqbar, true);
306
 
  PropertyManager->Tie("aero/qbarUW-psf", this, &FGAuxiliary::GetqbarUW, &FGAuxiliary::SetqbarUW, true);
307
 
  PropertyManager->Tie("aero/qbarUV-psf", this, &FGAuxiliary::GetqbarUV, &FGAuxiliary::SetqbarUV, true);
308
 
  PropertyManager->Tie("aero/alphadot-rad_sec", this, (PF)&FGAuxiliary::Getadot, &FGAuxiliary::Setadot, true);
309
 
  PropertyManager->Tie("aero/betadot-rad_sec", this, (PF)&FGAuxiliary::Getbdot, &FGAuxiliary::Setbdot, true);
310
 
  PropertyManager->Tie("aero/alphadot-deg_sec", this, inDegrees, (PMF)&FGAuxiliary::Getadot);
311
 
  PropertyManager->Tie("aero/betadot-deg_sec", this, inDegrees, (PMF)&FGAuxiliary::Getbdot);
312
 
  PropertyManager->Tie("aero/h_b-cg-ft", this, &FGAuxiliary::GetHOverBCG);
313
 
  PropertyManager->Tie("aero/h_b-mac-ft", this, &FGAuxiliary::GetHOverBMAC);
314
 
  PropertyManager->Tie("flight-path/gamma-rad", this, &FGAuxiliary::GetGamma, &FGAuxiliary::SetGamma);
315
 
  PropertyManager->Tie("flight-path/psi-gt-rad", this, &FGAuxiliary::GetGroundTrack);
316
 
}
317
 
 
318
 
//%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
319
 
 
320
 
void FGAuxiliary::unbind(void)
321
 
{
322
 
  PropertyManager->Untie("velocities/vc-fps");
323
 
  PropertyManager->Untie("velocities/vc-kts");
324
 
  PropertyManager->Untie("velocities/ve-fps");
325
 
  PropertyManager->Untie("velocities/ve-kts");
326
 
  PropertyManager->Untie("velocities/machU");
327
 
  PropertyManager->Untie("velocities/tat-r");
328
 
  PropertyManager->Untie("velocities/tat-c");
329
 
  PropertyManager->Untie("velocities/p-aero-rad_sec");
330
 
  PropertyManager->Untie("velocities/q-aero-rad_sec");
331
 
  PropertyManager->Untie("velocities/r-aero-rad_sec");
332
 
  PropertyManager->Untie("velocities/pt-lbs_sqft");
333
 
  PropertyManager->Untie("velocities/phidot-rad_sec");
334
 
  PropertyManager->Untie("velocities/thetadot-rad_sec");
335
 
  PropertyManager->Untie("velocities/psidot-rad_sec");
336
 
  PropertyManager->Untie("velocities/u-aero-fps");
337
 
  PropertyManager->Untie("velocities/v-aero-fps");
338
 
  PropertyManager->Untie("velocities/w-aero-fps");
339
 
  PropertyManager->Untie("velocities/vt-fps");
340
 
  PropertyManager->Untie("velocities/mach-norm");
341
 
  PropertyManager->Untie("velocities/vg-fps");
342
 
  PropertyManager->Untie("accelerations/a-pilot-x-ft_sec2");
343
 
  PropertyManager->Untie("accelerations/a-pilot-y-ft_sec2");
344
 
  PropertyManager->Untie("accelerations/a-pilot-z-ft_sec2");
345
 
  PropertyManager->Untie("accelerations/n-pilot-x-norm");
346
 
  PropertyManager->Untie("accelerations/n-pilot-y-norm");
347
 
  PropertyManager->Untie("accelerations/n-pilot-z-norm");
348
 
  PropertyManager->Untie("position/epa-rad");
349
 
  /* PropertyManager->Untie("atmosphere/headwind-fps");
350
 
  PropertyManager->Untie("atmosphere/crosswind-fps"); */
351
 
  PropertyManager->Untie("aero/qbar-psf");
352
 
  PropertyManager->Untie("aero/qbarUW-psf");
353
 
  PropertyManager->Untie("aero/qbarUV-psf");
354
 
  PropertyManager->Untie("aero/alpha-rad");
355
 
  PropertyManager->Untie("aero/beta-rad");
356
 
  PropertyManager->Untie("aero/alpha-deg");
357
 
  PropertyManager->Untie("aero/beta-deg");
358
 
  PropertyManager->Untie("aero/alphadot-rad_sec");
359
 
  PropertyManager->Untie("aero/betadot-rad_sec");
360
 
  PropertyManager->Untie("aero/mag-beta-rad");
361
 
  PropertyManager->Untie("aero/alphadot-deg_sec");
362
 
  PropertyManager->Untie("aero/betadot-deg_sec");
363
 
  PropertyManager->Untie("aero/mag-beta-deg");
364
 
  PropertyManager->Untie("aero/h_b-cg-ft");
365
 
  PropertyManager->Untie("aero/h_b-mac-ft");
366
 
  PropertyManager->Untie("flight-path/gamma-rad");
367
 
  PropertyManager->Untie("flight-path/psi-gt-rad");
368
 
}
369
 
 
370
 
//%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
371
 
//    The bitmasked value choices are as follows:
372
 
//    unset: In this case (the default) JSBSim would only print
373
 
//       out the normally expected messages, essentially echoing
374
 
//       the config files as they are read. If the environment
375
 
//       variable is not set, debug_lvl is set to 1 internally
376
 
//    0: This requests JSBSim not to output any messages
377
 
//       whatsoever.
378
 
//    1: This value explicity requests the normal JSBSim
379
 
//       startup messages
380
 
//    2: This value asks for a message to be printed out when
381
 
//       a class is instantiated
382
 
//    4: When this value is set, a message is displayed when a
383
 
//       FGModel object executes its Run() method
384
 
//    8: When this value is set, various runtime state variables
385
 
//       are printed out periodically
386
 
//    16: When set various parameters are sanity checked and
387
 
//       a message is printed out when they go out of bounds
388
 
 
389
 
void FGAuxiliary::Debug(int from)
390
 
{
391
 
  if (debug_lvl <= 0) return;
392
 
 
393
 
  if (debug_lvl & 1) { // Standard console startup message output
394
 
    if (from == 0) { // Constructor
395
 
 
396
 
    }
397
 
  }
398
 
  if (debug_lvl & 2 ) { // Instantiation/Destruction notification
399
 
    if (from == 0) cout << "Instantiated: FGAuxiliary" << endl;
400
 
    if (from == 1) cout << "Destroyed:    FGAuxiliary" << endl;
401
 
  }
402
 
  if (debug_lvl & 4 ) { // Run() method entry print for FGModel-derived objects
403
 
  }
404
 
  if (debug_lvl & 8 ) { // Runtime state variables
405
 
  }
406
 
  if (debug_lvl & 16) { // Sanity checking
407
 
    if (Mach > 100 || Mach < 0.00)
408
 
      cout << "FGPropagate::Mach is out of bounds: " << Mach << endl;
409
 
    if (qbar > 1e6 || qbar < 0.00)
410
 
      cout << "FGPropagate::qbar is out of bounds: " << qbar << endl;
411
 
  }
412
 
  if (debug_lvl & 64) {
413
 
    if (from == 0) { // Constructor
414
 
      cout << IdSrc << endl;
415
 
      cout << IdHdr << endl;
416
 
    }
417
 
  }
418
 
}
419
 
 
420
 
} // namespace JSBSim