Updated other return values to be bool instead of int.
// Initialize the BalloonSim flight model, dt is the time increment for
// each subsequent iteration through the EOM
-int FGBalloonSim::init( double dt ) {
+bool FGBalloonSim::init( double dt ) {
sgVec3 temp;
FG_LOG( FG_FLIGHT, FG_INFO, "Starting initializing BalloonSim" );
FG_LOG( FG_FLIGHT, FG_INFO, "Finished initializing BalloonSim" );
- return 1;
+ return true;
}
// Run an iteration of the EOM (equations of motion)
-int FGBalloonSim::update( int multiloop ) {
+bool FGBalloonSim::update( int multiloop ) {
double save_alt = 0.0;
// lets try to avoid really screwing up the BalloonSim model
set_Altitude( save_alt );
}
- return 1;
+ return true;
}
// Convert from the FGInterface struct to the BalloonSim
-int FGBalloonSim::copy_to_BalloonSim() {
- return 1;
+bool FGBalloonSim::copy_to_BalloonSim() {
+ return true;
}
// Convert from the BalloonSim to the FGInterface struct
-int FGBalloonSim::copy_from_BalloonSim() {
+bool FGBalloonSim::copy_from_BalloonSim() {
sgVec3 temp;
set_sin_cos_longitude( lon );
set_sin_cos_latitude( lat_geod );
- return 0;
+ return true;
}
public:
// copy FDM state to BalloonSim structures
- int copy_to_BalloonSim();
+ bool copy_to_BalloonSim();
// copy FDM state from BalloonSim structures
- int copy_from_BalloonSim();
+ bool copy_from_BalloonSim();
// reset flight params to a specific position
- int init( double dt );
+ bool init( double dt );
// update position based on inputs, positions, velocities, etc.
- int update( int multiloop );
+ bool update( int multiloop );
};
// Initialize the External flight model, dt is the time increment
// for each subsequent iteration through the EOM
-int FGExternal::init( double dt ) {
+bool FGExternal::init( double dt ) {
// cout << "FGExternal::init()" << endl;
// set valid time for this record
stamp_time();
- return 1;
+ return true;
}
// Run an iteration of the EOM. This is essentially a NOP here
// because these values are getting filled in elsewhere based on
// external input.
-int FGExternal::update( int multiloop ) {
+bool FGExternal::update( int multiloop ) {
// cout << "FGExternal::update()" << endl;
// double time_step = (1.0 / current_options.get_model_hz()) * multiloop;
- return 1;
+ return true;
}
public:
// reset flight params to a specific position
- int init( double dt );
+ bool init( double dt );
// update position based on inputs, positions, velocities, etc.
- int update( int multiloop );
+ bool update( int multiloop );
};
// Initialize the JSBsim flight model, dt is the time increment for
// each subsequent iteration through the EOM
-int FGJSBsim::init( double dt ) {
+bool FGJSBsim::init( double dt ) {
bool result;
if (result) {
FG_LOG( FG_FLIGHT, FG_INFO, " loaded aircraft " << current_options.get_aircraft() );
} else {
- FG_LOG( FG_FLIGHT, FG_INFO, " aircraft" << current_options.get_aircraft()
- << " does not exist");
- return 0;
+ FG_LOG( FG_FLIGHT, FG_INFO, " aircraft " << current_options.get_aircraft()
+ << " does not exist" );
+ return false;
}
FDMExec.GetAtmosphere()->SetExTemperature(get_Static_temperature());
fgic->SetLatitudeRadIC(get_Lat_geocentric());
fgic->SetLongitudeRadIC(get_Longitude());
-
-
-
//FG_LOG( FG_FLIGHT, FG_INFO, " gamma: " << current_options.get_Gamma());
FG_LOG( FG_FLIGHT, FG_INFO, " phi: " << get_Phi());
//FG_LOG( FG_FLIGHT, FG_INFO, " theta: " << get_Theta() );
copy_from_JSBsim();
- return 1;
+ return true;
}
/******************************************************************************/
// Run an iteration of the EOM (equations of motion)
-int FGJSBsim::update( int multiloop ) {
+bool FGJSBsim::update( int multiloop ) {
double save_alt = 0.0;
double time_step = (1.0 / current_options.get_model_hz()) * multiloop;
double start_elev = get_Altitude();
double end_elev = get_Altitude();
- return 1;
+ return true;
}
/******************************************************************************/
// Convert from the FGInterface struct to the JSBsim generic_ struct
-int FGJSBsim::copy_to_JSBsim() {
+bool FGJSBsim::copy_to_JSBsim() {
// copy control positions into the JSBsim structure
FDMExec.GetFCS()->SetDaCmd( controls.get_aileron());
get_V_east_airmass(),
get_V_down_airmass());
- return 1;
+ return true;
}
/******************************************************************************/
// Convert from the JSBsim generic_ struct to the FGInterface struct
-int FGJSBsim::copy_from_JSBsim() {
+bool FGJSBsim::copy_from_JSBsim() {
set_Inertias( FDMExec.GetAircraft()->GetMass(),
FDMExec.GetAircraft()->GetIxx(),
set_Climb_Rate(FDMExec.GetPosition()->Gethdot());
- return 1;
+ return true;
}
public:
// copy FDM state to LaRCsim structures
- int copy_to_JSBsim();
+ bool copy_to_JSBsim();
// copy FDM state from LaRCsim structures
- int copy_from_JSBsim();
+ bool copy_from_JSBsim();
// reset flight params to a specific position
- int init( double dt );
+ bool init( double dt );
// update position based on inputs, positions, velocities, etc.
- int update( int multiloop );
+ bool update( int multiloop );
};
#include "FGNozzle.h"
static const char *IdSrc = "$Header$";
-static const char *IdHdr = ID_NOZZLE;
+static const char *IdHdr = "";
/*******************************************************************************
************************************ CODE **************************************
FGDefs.h \
FGFCS.cpp FGFCS.h \
FGFDMExec.cpp FGFDMExec.h \
- FGForce.cpp FGForce.h \
FGInitialCondition.cpp FGInitialCondition.h \
FGLGear.cpp FGLGear.h \
FGMatrix.cpp FGMatrix.h \
FGModel.cpp FGModel.h \
- FGNozzle.cpp FGNozzle.h \
FGOutput.cpp FGOutput.h \
FGPosition.cpp FGPosition.h \
- FGPropeller.cpp FGPropeller.h \
FGRotation.cpp FGRotation.h \
- FGRotor.cpp FGRotor.h \
FGState.cpp FGState.h \
- FGThruster.cpp FGThruster.h \
FGTranslation.cpp FGTranslation.h \
FGTrim.cpp FGTrim.h \
FGTrimAxis.cpp FGTrimAxis.h \
// Initialize the LaRCsim flight model, dt is the time increment for
// each subsequent iteration through the EOM
-int FGLaRCsim::init( double dt ) {
+bool FGLaRCsim::init( double dt ) {
if ( current_options.get_aircraft() == "c172" ) {
// Initialize our little engine that hopefully might
// set valid time for this record
stamp_time();
- return 1;
+ return true;
}
// Run an iteration of the EOM (equations of motion)
-int FGLaRCsim::update( int multiloop ) {
+bool FGLaRCsim::update( int multiloop ) {
// cout << "FGLaRCsim::update()" << endl;
if ( current_options.get_aircraft() == "c172" ) {
set_Climb_Rate( (end_elev - start_elev) / time_step );
}
- return 1;
+ return true;
}
// Convert from the FGInterface struct to the LaRCsim generic_ struct
-int FGLaRCsim::copy_to_LaRCsim () {
+bool FGLaRCsim::copy_to_LaRCsim () {
Mass = get_Mass();
I_xx = get_I_xx();
I_yy = get_I_yy();
// Y_pilot_rwy = get_Y_pilot_rwy();
// H_pilot_rwy = get_H_pilot_rwy();
- return 1;
+ return true;
}
// Convert from the LaRCsim generic_ struct to the FGInterface struct
-int FGLaRCsim::copy_from_LaRCsim() {
+bool FGLaRCsim::copy_from_LaRCsim() {
// Mass properties and geometry values
set_Inertias( Mass, I_xx, I_yy, I_zz, I_xz );
// printf("sin_lon %f cos_lon %f\n",
// get_sin_longitude(), get_cos_longitude());
- return 1;
+ return true;
}
public:
// copy FDM state to LaRCsim structures
- int copy_to_LaRCsim();
+ bool copy_to_LaRCsim();
// copy FDM state from LaRCsim structures
- int copy_from_LaRCsim();
+ bool copy_from_LaRCsim();
// reset flight params to a specific position
- int init( double dt );
+ bool init( double dt );
// update position based on inputs, positions, velocities, etc.
- int update( int multiloop );
+ bool update( int multiloop );
};
// Initialize the Magic Carpet flight model, dt is the time increment
// for each subsequent iteration through the EOM
-int FGMagicCarpet::init( double dt ) {
+bool FGMagicCarpet::init( double dt ) {
// set valid time for this record
stamp_time();
- return 1;
+ return true;
}
// Run an iteration of the EOM (equations of motion)
-int FGMagicCarpet::update( int multiloop ) {
+bool FGMagicCarpet::update( int multiloop ) {
// cout << "FGLaRCsim::update()" << endl;
double time_step = (1.0 / current_options.get_model_hz()) * multiloop;
set_Sea_level_radius( sl_radius * METER_TO_FEET);
set_Altitude( get_Altitude() + climb );
- return 1;
+ return true;
}
public:
// reset flight params to a specific position
- int init( double dt );
+ bool init( double dt );
// update position based on inputs, positions, velocities, etc.
- int update( int multiloop );
+ bool update( int multiloop );
};
}
-int FGInterface::init( double dt ) {
+bool FGInterface::init( double dt ) {
cout << "dummy init() ... SHOULDN'T BE CALLED!" << endl;
- return 0;
+ return false;
}
-int FGInterface::update( int multi_loop ) {
+bool FGInterface::update( int multi_loop ) {
cout << "dummy update() ... SHOULDN'T BE CALLED!" << endl;
- return 0;
+ return false;
}
FGInterface(void);
virtual ~FGInterface();
- virtual int init( double dt );
- virtual int update( int multi_loop );
+ virtual bool init( double dt );
+ virtual bool update( int multi_loop );
// Define the various supported flight models (many not yet implemented)
enum {