1
0
Fork 0

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:
curt 2001-12-06 23:10:50 +00:00
parent f716539390
commit d8e7b7b9ff
7 changed files with 24 additions and 19 deletions

View file

@ -95,19 +95,19 @@ FGJSBsim::FGJSBsim( double dt )
result = fdmex->LoadModel( aircraft_path.str(), result = fdmex->LoadModel( aircraft_path.str(),
engine_path.str(), engine_path.str(),
fgGetString("/sim/aircraft") ); fgGetString("/sim/aero") );
if (result) { if (result) {
SG_LOG( SG_FLIGHT, SG_INFO, " loaded aircraft."); SG_LOG( SG_FLIGHT, SG_INFO, " loaded aero.");
} else { } else {
SG_LOG( SG_FLIGHT, SG_INFO, 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); throw(-1);
} }
SG_LOG( SG_FLIGHT, SG_INFO, "" ); SG_LOG( SG_FLIGHT, SG_INFO, "" );
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(); int Neng = Propulsion->GetNumEngines();
SG_LOG( SG_FLIGHT, SG_INFO, "num engines = " << Neng ); SG_LOG( SG_FLIGHT, SG_INFO, "num engines = " << Neng );
@ -143,7 +143,7 @@ FGJSBsim::FGJSBsim( double dt )
rudder_trim = fgGetNode("/fdm/trim/rudder", true ); 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); stall_warning->setDoubleValue(0);
} }

View file

@ -43,12 +43,12 @@ FGLaRCsim::FGLaRCsim( double dt ) {
set_delta_t( dt ); set_delta_t( dt );
speed_up = fgGetNode("/sim/speed-up", true); 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 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 copy_to_LaRCsim(); // initialize all of LaRCsim's vars
//this should go away someday -- formerly done in fg_init.cxx //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) // Run an iteration of the EOM (equations of motion)
bool FGLaRCsim::update( int multiloop ) { bool FGLaRCsim::update( int multiloop ) {
if ( aircraft->getStringValue() == "c172" ) { if ( aero->getStringValue() == "c172" ) {
// set control inputs // set control inputs
// cout << "V_calibrated_kts = " << V_calibrated_kts << '\n'; // cout << "V_calibrated_kts = " << V_calibrated_kts << '\n';
eng.set_IAS( V_calibrated_kts ); eng.set_IAS( V_calibrated_kts );
@ -172,7 +172,7 @@ bool FGLaRCsim::update( int multiloop ) {
speed_up->getIntValue(); speed_up->getIntValue();
Flap_handle = 30.0 * globals->get_controls()->get_flaps(); Flap_handle = 30.0 * globals->get_controls()->get_flaps();
if ( aircraft->getStringValue() == "c172" ) { if ( aero->getStringValue() == "c172" ) {
Use_External_Engine = 1; Use_External_Engine = 1;
} else { } else {
Use_External_Engine = 0; Use_External_Engine = 0;
@ -544,7 +544,7 @@ bool FGLaRCsim::copy_from_LaRCsim() {
_set_Climb_Rate( -1 * V_down ); _set_Climb_Rate( -1 * V_down );
// cout << "climb rate = " << -V_down * 60 << endl; // cout << "climb rate = " << -V_down * 60 << endl;
if ( aircraft->getStringValue() == "uiuc" ) { if ( aero->getStringValue() == "uiuc" ) {
if (pilot_elev_no) { if (pilot_elev_no) {
globals->get_controls()->set_elevator(Long_control); globals->get_controls()->set_elevator(Long_control);
globals->get_controls()->set_elevator_trim(Long_trim); globals->get_controls()->set_elevator_trim(Long_trim);

View file

@ -41,7 +41,7 @@ private:
void snap_shot(void); void snap_shot(void);
double time_step; double time_step;
SGPropertyNode *speed_up; SGPropertyNode *speed_up;
SGPropertyNode *aircraft; SGPropertyNode *aero;
public: public:

View file

@ -566,7 +566,7 @@ bool fgInitSubsystems( void ) {
} else { } else {
SG_LOG(SG_GENERAL, SG_ALERT, SG_LOG(SG_GENERAL, SG_ALERT,
"Unrecognized flight model '" << model "Unrecognized flight model '" << model
<< ", can't init aircraft"); << "', cannot init flight dynamics model.");
exit(-1); exit(-1);
} }
} catch ( ... ) { } catch ( ... ) {
@ -942,7 +942,7 @@ void fgReInitSubsystems( void )
} else { } else {
SG_LOG(SG_GENERAL, SG_ALERT, SG_LOG(SG_GENERAL, SG_ALERT,
"Unrecognized flight model '" << model "Unrecognized flight model '" << model
<< ", can't init aircraft"); << "', cannot init flight dynamics model.");
exit(-1); exit(-1);
} }
} catch ( ... ) { } catch ( ... ) {

View file

@ -160,7 +160,7 @@ fgSetDefaults ()
// Flight Model options // Flight Model options
fgSetString("/sim/flight-model", "jsb"); fgSetString("/sim/flight-model", "jsb");
fgSetString("/sim/aircraft", "c172"); fgSetString("/sim/aero", "c172");
fgSetInt("/sim/model-hz", NEW_DEFAULT_MODEL_HZ); fgSetInt("/sim/model-hz", NEW_DEFAULT_MODEL_HZ);
fgSetInt("/sim/speed-up", 1); fgSetInt("/sim/speed-up", 1);
fgSetBool("/sim/startup/trim", false); fgSetBool("/sim/startup/trim", false);
@ -662,8 +662,8 @@ parse_option (const string& arg)
globals->set_fg_scenery(arg.substr( 13 )); globals->set_fg_scenery(arg.substr( 13 ));
} else if ( arg.find( "--fdm=" ) == 0 ) { } else if ( arg.find( "--fdm=" ) == 0 ) {
fgSetString("/sim/flight-model", arg.substr(6)); fgSetString("/sim/flight-model", arg.substr(6));
} else if ( arg.find( "--aircraft=" ) == 0 ) { } else if ( arg.find( "--aero=" ) == 0 ) {
fgSetString("/sim/aircraft", arg.substr(11)); fgSetString("/sim/aero", arg.substr(7));
} else if ( arg.find( "--aircraft-dir=" ) == 0 ) { } else if ( arg.find( "--aircraft-dir=" ) == 0 ) {
fgSetString("/sim/aircraft-dir", arg.substr(15)); fgSetString("/sim/aircraft-dir", arg.substr(15));
} else if ( arg.find( "--model-hz=" ) == 0 ) { } 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--fdm=abcd: selects the core flight model code." << endl;
cout << "\t\tcan be one of jsb, larcsim, magic, null, external, balloon, or ada" cout << "\t\tcan be one of jsb, larcsim, magic, null, external, balloon, or ada"
<< endl; << 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)" cout << "\t--model-hz=n: run the FDM this rate (iterations per second)"
<< endl; << endl;
cout << "\t--speed=n: run the FDM this much faster than real time" << endl; cout << "\t--speed=n: run the FDM this much faster than real time" << endl;

View file

@ -188,7 +188,7 @@ FGFX::init ()
sprintf(buf, "/engines/engine[%d]/cranking", i); sprintf(buf, "/engines/engine[%d]/cranking", i);
_engine_cranking_prop[i] = fgGetNode(buf, true); _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); _vc_prop = fgGetNode("/velocities/airspeed-kt", true);
_flaps_prop = fgGetNode("/controls/flaps", true); _flaps_prop = fgGetNode("/controls/flaps", true);
_gear_prop = fgGetNode("/controls/gear-down", true); _gear_prop = fgGetNode("/controls/gear-down", true);

View file

@ -48,6 +48,11 @@ void fgUpdateLocalTime() {
SGPath zone( globals->get_fg_root() ); SGPath zone( globals->get_fg_root() );
zone.append( "Timezone" ); 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() globals->get_time_params()->updateLocal( longitude->getDoubleValue()
* SGD_DEGREES_TO_RADIANS, * SGD_DEGREES_TO_RADIANS,
latitude->getDoubleValue() latitude->getDoubleValue()