1
0
Fork 0

Rename our own version of pu.h to FlightGear_pu.h per James advice. Remove inclusion of pu.h where it isn't requirted.

This commit is contained in:
Erik Hofman 2020-09-03 12:56:01 +02:00
parent 0451816a82
commit bdc66d5535
18 changed files with 33 additions and 43 deletions

View file

@ -7,7 +7,7 @@ set(SP_FDM_SOURCES
SP/Balloon.cxx
SP/BalloonSim.cpp
SP/MagicCarpet.cxx
SP/AISim.cpp
SP/AISim.cpp
)
set (SP_FDM_HEADERS
SP/ACMS.hxx

View file

@ -48,7 +48,6 @@
FGAISim::FGAISim(double dt) :
br(0),
location_geod(0.0),
NEDdot(0.0f),
vUVW(0.0f),
@ -63,22 +62,9 @@ FGAISim::FGAISim(double dt) :
vUVWaero(0.0f),
b_2U(0.0f),
cbar_2U(0.0f),
velocity(0.0f),
mach(0.0f),
agl(0.0f),
WoW(true),
no_engines(0),
no_gears(0),
cg(0.0f),
I(0.0f),
S(0.0f),
cbar(0.0f),
b(0.0f),
m(0.0f),
gravity_ned(0.0f, 0.0f, AISIM_G),
rho(0.0f),
qbar(0.0f),
sigma(0.0f)
gravity_ned(0.0f, 0.0f, AISIM_G)
{
simd4x4::zeros(xCDYLT);
simd4x4::zeros(xClmnT);
@ -135,9 +121,12 @@ FGAISim::FGAISim(double dt) :
// the aircraft on it's wheels.
for (int i=0; i<no_gears; ++i) {
// convert from structural frame to body frame
gear_pos[i] = simd4_t<float,3>(cg[X]-gear_pos[i][X], gear_pos[i][Y]-cg[Y], cg[Z]-gear_pos[i][Z])*INCHES_TO_FEET;
gear_pos[i] = simd4_t<float,3>( cg[X] - gear_pos[i][X],
-cg[Y] + gear_pos[i][Y],
cg[Z] - gear_pos[i][Z])*INCHES_TO_FEET;
if (gear_pos[i][Z] < agl) agl = gear_pos[i][Z];
}
// Contact point at the Genter of Gravity
if (no_gears > (AISIM_MAX-1)) no_gears = AISIM_MAX-1;
gear_pos[no_gears] = cg*INCHES_TO_FEET;

View file

@ -42,12 +42,12 @@
# define SG_FEET_TO_METER (1/SG_METER_TO_FEET)
# define SGD_DEGREES_TO_RADIANS 0.0174532925
# define SGD_RADIANS_TO_DEGREES (1/SGD_DEGREES_TO_RADIANS)
# define SGD_PI 3.1415926535
# define SGD_PI 3.1415926536
#endif
// #define SG_DEGREES_TO_RADIANS 0.0174532925f
// max. no. gears, maxi. no. engines
// max. no. gears, max. no. engines
#define AISIM_MAX 4
#define AISIM_G 32.174f
@ -173,7 +173,7 @@ private:
/* aircraft normalized controls */
float th; /* throttle command */
float br; /* brake command */
float br = 0.0f; /* brake command */
/* aircraft state */
simd4_t<double,3> location_geod; /* lat, lon, altitude */
@ -201,9 +201,10 @@ private:
simd4_t<float,3> MT[AISIM_MAX]; /* thrust moment */
simd4_t<float,3> b_2U, cbar_2U;
simd4_t<float,3> inv_m;
float velocity, mach;
float agl;
bool WoW;
float velocity = 0.0f;
float mach = 0.0f;
float agl = 0.0f;
bool WoW = true;
/* dynamic coefficients (already multiplied with their value) */
simd4_t<float,3> xCq, xCadot, xCp, xCr;
@ -214,13 +215,16 @@ private:
/* ---------------------------------------------------------------- */
/* aircraft static data */
int no_engines, no_gears;
int no_engines = 0;
int no_gears = 0;
simd4x4_t<float,4> mI, mIinv; /* inertia matrix */
simd4_t<float,3> gear_pos[AISIM_MAX]; /* pos in structural frame */
simd4_t<float,3> cg; /* center of gravity */
simd4_t<float,4> I; /* inertia */
float S, cbar, b; /* wing area, mean average chord, span */
float m; /* mass */
float S = 0.0f; /* wing area */
float cbar = 0.0f; /* mean average chord */
float b = 0.0f; /* wing span */
float m = 0.0f; /* mass */
/* static coefficients, *_n is for normalized surface deflection */
float Cg_spring[AISIM_MAX]; /* gear spring coeffients */
@ -236,7 +240,9 @@ private:
/* environment data */
static float density[101], vsound[101];
simd4_t<float,3> gravity_ned;
float rho, qbar, sigma;
float rho = 0.0f;
float qbar = 0.0f;
float sigma = 0.0f;
};
#endif // _FGAISim_HXX

View file

@ -362,8 +362,8 @@ void FDMShell::createImplementation()
_impl = new FGBalloonSim( dt );
} else if ( model == "magic" ) {
_impl = new FGMagicCarpet( dt );
// } else if ( model == "aisim" ) {
// _impl = new FGAISim( dt );
} else if ( model == "aisim" ) {
_impl = new FGAISim( dt );
}
#else
else if (( model == "ada" )||(model == "acms")||( model == "balloon" )||( model == "magic" )||( model == "aisim" ))

View file

@ -20,7 +20,7 @@
#define CANVASWIDGET_HXX_
#include <Main/fg_props.hxx>
#include "pu.h"
#include "FlightGear_pu.h"
#include <simgear/canvas/canvas_fwd.hxx>

View file

@ -19,7 +19,7 @@
// this is our one in 3rdparty
#include "fnt.h"
#include "pu.h"
#include "FlightGear_pu.h"
#include <simgear/props/props.hxx>
#include <simgear/misc/sg_dir.hxx>

View file

@ -14,7 +14,7 @@
#include "new_gui.hxx"
#include "FGPUIMenuBar.hxx"
#include "pu.h"
#include "FlightGear_pu.h"
using std::vector;
using std::string;

View file

@ -8,7 +8,6 @@
#include <Navaids/positioned.hxx>
#include "pu.h"
#include "FGPUIDialog.hxx"
// forward decls

View file

@ -9,7 +9,6 @@
#include <simgear/timing/timestamp.hxx>
#include <simgear/misc/strutils.hxx>
#include "pu.h"
#include "FGPUIDialog.hxx" // for GUI_ID
// forward decls

View file

@ -2,7 +2,7 @@
#include <config.h>
#endif
#include "pu.h"
#include "FlightGear_pu.h"
#include "fnt.h"

View file

@ -31,7 +31,7 @@
#include <simgear/structure/exception.hxx>
#include "pu.h"
#include "FlightGear_pu.h"
#define TR_HIRES_SNAP 1

View file

@ -4,7 +4,7 @@
#include <simgear/props/props.hxx>
#include "pu.h"
#include "FlightGear_pu.h"
#include "layout.hxx"
// This file contains the code implementing the LayoutWidget class in

View file

@ -11,8 +11,6 @@
#include <cstring>
#include <sys/types.h>
#include "pu.h"
#include <simgear/compiler.h>
#include <simgear/structure/exception.hxx>
#include <simgear/props/props_io.hxx>

View file

@ -21,7 +21,6 @@
#include <config.h>
#endif
#include <GUI/pu.h>
#include <osg/GraphicsContext>
#include <Viewer/renderer.hxx>

View file

@ -20,7 +20,7 @@
#include <simgear/scene/util/SGSceneUserData.hxx>
#include <simgear/scene/util/SGNodeMasks.hxx>
#include <GUI/pu.h>
#include <GUI/FlightGear_pu.h>
#include <Main/fg_os.hxx>
#include <Cockpit/panel.hxx>
#include <Cockpit/panel_io.hxx>

View file

@ -7,7 +7,7 @@
#include <osg/Viewport>
#include <osgViewer/Viewer>
#include <GUI/pu.h>
#include <GUI/FlightGear_pu.h>
#include <Main/fg_props.hxx>
#include "CameraGroup.hxx"
#include "FGEventHandler.hxx"

View file

@ -36,7 +36,7 @@
#include <simgear/scene/util/SGNodeMasks.hxx>
#include <GUI/pu.h>
#include <GUI/FlightGear_pu.h>
#include <Main/fg_props.hxx>
#include <Main/globals.hxx>
#include <Main/locale.hxx>