Changed --aircraft= to --aero= to make way for a high level aircraft definition
that will tie together fdm, aero model, 3d model, sounds, etc. into one top level config file.
This commit is contained in:
parent
f716539390
commit
d8e7b7b9ff
7 changed files with 24 additions and 19 deletions
|
@ -95,19 +95,19 @@ FGJSBsim::FGJSBsim( double dt )
|
|||
|
||||
result = fdmex->LoadModel( aircraft_path.str(),
|
||||
engine_path.str(),
|
||||
fgGetString("/sim/aircraft") );
|
||||
fgGetString("/sim/aero") );
|
||||
|
||||
if (result) {
|
||||
SG_LOG( SG_FLIGHT, SG_INFO, " loaded aircraft.");
|
||||
SG_LOG( SG_FLIGHT, SG_INFO, " loaded aero.");
|
||||
} else {
|
||||
SG_LOG( SG_FLIGHT, SG_INFO,
|
||||
" aircraft does not exist (you may have mis-typed the name).");
|
||||
" aero does not exist (you may have mis-typed the name).");
|
||||
throw(-1);
|
||||
}
|
||||
|
||||
SG_LOG( SG_FLIGHT, SG_INFO, "" );
|
||||
SG_LOG( SG_FLIGHT, SG_INFO, "" );
|
||||
SG_LOG( SG_FLIGHT, SG_INFO, "After loading aircraft definition file ..." );
|
||||
SG_LOG( SG_FLIGHT, SG_INFO, "After loading aero definition file ..." );
|
||||
|
||||
int Neng = Propulsion->GetNumEngines();
|
||||
SG_LOG( SG_FLIGHT, SG_INFO, "num engines = " << Neng );
|
||||
|
@ -143,7 +143,7 @@ FGJSBsim::FGJSBsim( double dt )
|
|||
rudder_trim = fgGetNode("/fdm/trim/rudder", true );
|
||||
|
||||
|
||||
stall_warning = fgGetNode("/sim/aircraft/alarms/stall-warning",true);
|
||||
stall_warning = fgGetNode("/sim/aero/alarms/stall-warning",true);
|
||||
stall_warning->setDoubleValue(0);
|
||||
}
|
||||
|
||||
|
|
|
@ -43,12 +43,12 @@ FGLaRCsim::FGLaRCsim( double dt ) {
|
|||
set_delta_t( dt );
|
||||
|
||||
speed_up = fgGetNode("/sim/speed-up", true);
|
||||
aircraft = fgGetNode("/sim/aircraft", true);
|
||||
aero = fgGetNode("/sim/aero", true);
|
||||
|
||||
ls_toplevel_init( 0.0, (char *)(aircraft->getStringValue().c_str()) );
|
||||
ls_toplevel_init( 0.0, (char *)(aero->getStringValue().c_str()) );
|
||||
|
||||
lsic=new LaRCsimIC; //this needs to be brought up after LaRCsim is
|
||||
if ( aircraft->getStringValue() == "c172" ) {
|
||||
if ( aero->getStringValue() == "c172" ) {
|
||||
copy_to_LaRCsim(); // initialize all of LaRCsim's vars
|
||||
|
||||
//this should go away someday -- formerly done in fg_init.cxx
|
||||
|
@ -98,7 +98,7 @@ void FGLaRCsim::init() {
|
|||
// Run an iteration of the EOM (equations of motion)
|
||||
bool FGLaRCsim::update( int multiloop ) {
|
||||
|
||||
if ( aircraft->getStringValue() == "c172" ) {
|
||||
if ( aero->getStringValue() == "c172" ) {
|
||||
// set control inputs
|
||||
// cout << "V_calibrated_kts = " << V_calibrated_kts << '\n';
|
||||
eng.set_IAS( V_calibrated_kts );
|
||||
|
@ -172,7 +172,7 @@ bool FGLaRCsim::update( int multiloop ) {
|
|||
speed_up->getIntValue();
|
||||
Flap_handle = 30.0 * globals->get_controls()->get_flaps();
|
||||
|
||||
if ( aircraft->getStringValue() == "c172" ) {
|
||||
if ( aero->getStringValue() == "c172" ) {
|
||||
Use_External_Engine = 1;
|
||||
} else {
|
||||
Use_External_Engine = 0;
|
||||
|
@ -544,7 +544,7 @@ bool FGLaRCsim::copy_from_LaRCsim() {
|
|||
_set_Climb_Rate( -1 * V_down );
|
||||
// cout << "climb rate = " << -V_down * 60 << endl;
|
||||
|
||||
if ( aircraft->getStringValue() == "uiuc" ) {
|
||||
if ( aero->getStringValue() == "uiuc" ) {
|
||||
if (pilot_elev_no) {
|
||||
globals->get_controls()->set_elevator(Long_control);
|
||||
globals->get_controls()->set_elevator_trim(Long_trim);
|
||||
|
|
|
@ -41,7 +41,7 @@ private:
|
|||
void snap_shot(void);
|
||||
double time_step;
|
||||
SGPropertyNode *speed_up;
|
||||
SGPropertyNode *aircraft;
|
||||
SGPropertyNode *aero;
|
||||
|
||||
public:
|
||||
|
||||
|
|
|
@ -566,7 +566,7 @@ bool fgInitSubsystems( void ) {
|
|||
} else {
|
||||
SG_LOG(SG_GENERAL, SG_ALERT,
|
||||
"Unrecognized flight model '" << model
|
||||
<< ", can't init aircraft");
|
||||
<< "', cannot init flight dynamics model.");
|
||||
exit(-1);
|
||||
}
|
||||
} catch ( ... ) {
|
||||
|
@ -942,7 +942,7 @@ void fgReInitSubsystems( void )
|
|||
} else {
|
||||
SG_LOG(SG_GENERAL, SG_ALERT,
|
||||
"Unrecognized flight model '" << model
|
||||
<< ", can't init aircraft");
|
||||
<< "', cannot init flight dynamics model.");
|
||||
exit(-1);
|
||||
}
|
||||
} catch ( ... ) {
|
||||
|
|
|
@ -160,7 +160,7 @@ fgSetDefaults ()
|
|||
|
||||
// Flight Model options
|
||||
fgSetString("/sim/flight-model", "jsb");
|
||||
fgSetString("/sim/aircraft", "c172");
|
||||
fgSetString("/sim/aero", "c172");
|
||||
fgSetInt("/sim/model-hz", NEW_DEFAULT_MODEL_HZ);
|
||||
fgSetInt("/sim/speed-up", 1);
|
||||
fgSetBool("/sim/startup/trim", false);
|
||||
|
@ -662,8 +662,8 @@ parse_option (const string& arg)
|
|||
globals->set_fg_scenery(arg.substr( 13 ));
|
||||
} else if ( arg.find( "--fdm=" ) == 0 ) {
|
||||
fgSetString("/sim/flight-model", arg.substr(6));
|
||||
} else if ( arg.find( "--aircraft=" ) == 0 ) {
|
||||
fgSetString("/sim/aircraft", arg.substr(11));
|
||||
} else if ( arg.find( "--aero=" ) == 0 ) {
|
||||
fgSetString("/sim/aero", arg.substr(7));
|
||||
} else if ( arg.find( "--aircraft-dir=" ) == 0 ) {
|
||||
fgSetString("/sim/aircraft-dir", arg.substr(15));
|
||||
} else if ( arg.find( "--model-hz=" ) == 0 ) {
|
||||
|
@ -1092,7 +1092,7 @@ fgUsage ()
|
|||
cout << "\t--fdm=abcd: selects the core flight model code." << endl;
|
||||
cout << "\t\tcan be one of jsb, larcsim, magic, null, external, balloon, or ada"
|
||||
<< endl;
|
||||
cout << "\t--aircraft=abcd: aircraft model to load" << endl;
|
||||
cout << "\t--aero=abcd: aerodynamics model to load" << endl;
|
||||
cout << "\t--model-hz=n: run the FDM this rate (iterations per second)"
|
||||
<< endl;
|
||||
cout << "\t--speed=n: run the FDM this much faster than real time" << endl;
|
||||
|
|
|
@ -188,7 +188,7 @@ FGFX::init ()
|
|||
sprintf(buf, "/engines/engine[%d]/cranking", i);
|
||||
_engine_cranking_prop[i] = fgGetNode(buf, true);
|
||||
}
|
||||
_stall_warning_prop = fgGetNode("/sim/aircraft/alarms/stall-warning", true);
|
||||
_stall_warning_prop = fgGetNode("/sim/aero/alarms/stall-warning", true);
|
||||
_vc_prop = fgGetNode("/velocities/airspeed-kt", true);
|
||||
_flaps_prop = fgGetNode("/controls/flaps", true);
|
||||
_gear_prop = fgGetNode("/controls/gear-down", true);
|
||||
|
|
|
@ -48,6 +48,11 @@ void fgUpdateLocalTime() {
|
|||
SGPath zone( globals->get_fg_root() );
|
||||
zone.append( "Timezone" );
|
||||
|
||||
cout << "updateLocal("
|
||||
<< longitude->getDoubleValue() * SGD_DEGREES_TO_RADIANS
|
||||
<< ", "
|
||||
<< latitude->getDoubleValue() * SGD_DEGREES_TO_RADIANS
|
||||
<< ", " << zone.str() << ")" << endl;
|
||||
globals->get_time_params()->updateLocal( longitude->getDoubleValue()
|
||||
* SGD_DEGREES_TO_RADIANS,
|
||||
latitude->getDoubleValue()
|
||||
|
|
Loading…
Reference in a new issue