1
0
Fork 0

Make all FDMs selectable at runtime; default LARCsim/UIUC to off.

This commit is contained in:
James Turner 2011-11-01 16:21:59 +00:00
parent d1e5dc95ca
commit e819a4aaa4
2 changed files with 86 additions and 66 deletions

View file

@ -80,8 +80,8 @@ endif()
option(LOGGING "Set to OFF to build FlightGear without logging" ON)
option(SP_FDMS "Set to ON to build FlightGear with special-purpose FDMs" OFF)
option(ENABLE_UIUC_MODEL "Set to ON to build FlightGear with UIUCModel FDM" ON)
option(ENABLE_LARCSIM "Set to ON to build FlightGear with LaRCsim FDM" ON)
option(ENABLE_UIUC_MODEL "Set to ON to build FlightGear with UIUCModel FDM" OFF)
option(ENABLE_LARCSIM "Set to ON to build FlightGear with LaRCsim FDM" OFF)
option(ENABLE_YASIM "Set to ON to build FlightGear with YASIM FDM" ON)
option(ENABLE_JSBSIM "Set to ON to build FlightGear with JSBSim FDM" ON)
option(ENABLE_FGADMIN "Set to ON to build FlightGear with FGADMIN" ON)

View file

@ -43,12 +43,21 @@
#endif
#include <FDM/ExternalNet/ExternalNet.hxx>
#include <FDM/ExternalPipe/ExternalPipe.hxx>
#ifdef ENABLE_JSBSIM
#include <FDM/JSBSim/JSBSim.hxx>
#endif
#ifdef ENABLE_LARCSIM
#include <FDM/LaRCsim/LaRCsim.hxx>
#endif
#include <FDM/UFO.hxx>
#include <FDM/NullFDM.hxx>
#include <FDM/YASim/YASim.hxx>
#ifdef ENABLE_YASIM
#include <FDM/YASim/YASim.hxx>
#endif
/*
* Evil global variable required by Network/FGNative,
@ -194,21 +203,7 @@ void FDMShell::createImplementation()
double dt = 1.0 / fgGetInt("/sim/model-hz");
string model = fgGetString("/sim/flight-model");
if ( model == "larcsim" ) {
_impl = new FGLaRCsim( dt );
} else if ( model == "jsb" ) {
_impl = new FGJSBsim( dt );
#ifdef ENABLE_SP_FDM
} else if ( model == "ada" ) {
_impl = new FGADA( dt );
} else if ( model == "acms" ) {
_impl = new FGACMS( dt );
} else if ( model == "balloon" ) {
_impl = new FGBalloonSim( dt );
} else if ( model == "magic" ) {
_impl = new FGMagicCarpet( dt );
#endif
} else if ( model == "ufo" ) {
if ( model == "ufo" ) {
_impl = new FGUFO( dt );
} else if ( model == "external" ) {
// external is a synonym for "--fdm=null" and is
@ -266,9 +261,34 @@ void FDMShell::createImplementation()
_impl = new FGExternalPipe( dt, pipe_path, pipe_protocol );
} else if ( model == "null" ) {
_impl = new FGNullFDM( dt );
} else if ( model == "yasim" ) {
}
#ifdef ENABLE_LARCSIM
else if ( model == "larcsim" ) {
_impl = new FGLaRCsim( dt );
}
#endif
#ifdef ENABLE_JSBSIM
else if ( model == "jsb" ) {
_impl = new FGJSBsim( dt );
}
#endif
#ifdef ENABLE_SP_FDM
else if ( model == "ada" ) {
_impl = new FGADA( dt );
} else if ( model == "acms" ) {
_impl = new FGACMS( dt );
} else if ( model == "balloon" ) {
_impl = new FGBalloonSim( dt );
} else if ( model == "magic" ) {
_impl = new FGMagicCarpet( dt );
}
#endif
#ifdef ENABLE_YASIM
else if ( model == "yasim" ) {
_impl = new YASim( dt );
} else {
}
#endif
else {
throw sg_exception(string("Unrecognized flight model '") + model
+ "', cannot init flight dynamics model.");
}