1
0
Fork 0

Allow JSBsim aircraft model file to be specified from the command line.

This commit is contained in:
curt 1999-12-20 20:26:18 +00:00
parent 3cca59bf1f
commit 5c487a7803
2 changed files with 10 additions and 3 deletions

View file

@ -161,6 +161,7 @@ fgOPTIONS::fgOPTIONS() :
// Flight Model options // Flight Model options
flight_model( FGInterface::FG_LARCSIM ), flight_model( FGInterface::FG_LARCSIM ),
aircraft( "c172" ),
model_hz( NEW_DEFAULT_MODEL_HZ ), model_hz( NEW_DEFAULT_MODEL_HZ ),
speed_up( 1 ), speed_up( 1 ),
@ -495,7 +496,7 @@ fgOPTIONS::parse_tile_radius( const string& arg ) {
// Parse --fdm=abcdefg type option // Parse --fdm=abcdefg type option
int int
fgOPTIONS::parse_fdm( const string& fm ) { fgOPTIONS::parse_fdm( const string& fm ) {
// printf("fdm = %s\n", fm); // cout << "fdm = " << fm << endl;
if ( fm == "balloon" ) { if ( fm == "balloon" ) {
return FGInterface::FG_BALLOONSIM; return FGInterface::FG_BALLOONSIM;
@ -650,6 +651,8 @@ int fgOPTIONS::parse_option( const string& arg ) {
fg_root = arg.substr( 10 ); fg_root = arg.substr( 10 );
} else if ( arg.find( "--fdm=" ) != string::npos ) { } else if ( arg.find( "--fdm=" ) != string::npos ) {
flight_model = parse_fdm( arg.substr(6) ); flight_model = parse_fdm( arg.substr(6) );
} else if ( arg.find( "--aircraft=" ) != string::npos ) {
aircraft = arg.substr(11);
} else if ( arg.find( "--model-hz=" ) != string::npos ) { } else if ( arg.find( "--model-hz=" ) != string::npos ) {
model_hz = atoi( arg.substr(11) ); model_hz = atoi( arg.substr(11) );
} else if ( arg.find( "--speed=" ) != string::npos ) { } else if ( arg.find( "--speed=" ) != string::npos ) {
@ -865,7 +868,9 @@ void fgOPTIONS::usage ( void ) {
cout << endl; cout << endl;
cout << "Flight Model:" << endl; cout << "Flight Model:" << endl;
cout << "\t--fdm=abcd: one of slew, jsb, larcsim, or external" << endl; cout << "\t--fdm=abcd: selects the core flight model code." << endl;
cout << "\t\tcan be one of jsb, larcsim, magic, or external" << endl;
cout << "\t--aircraft=abcd: aircraft 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

@ -152,7 +152,8 @@ private:
bool sound; // play sound effects bool sound; // play sound effects
// Flight Model options // Flight Model options
int flight_model; // Flight Model: FG_SLEW, FG_LARCSIM, etc. int flight_model; // Core flight model code: jsb, larcsim, magic, etc.
string aircraft; // Aircraft to model
int model_hz; // number of FDM iterations per second int model_hz; // number of FDM iterations per second
int speed_up; // Sim mechanics run this much faster than normal speed int speed_up; // Sim mechanics run this much faster than normal speed
@ -238,6 +239,7 @@ public:
inline bool get_panel_status() const { return panel_status; } inline bool get_panel_status() const { return panel_status; }
inline bool get_sound() const { return sound; } inline bool get_sound() const { return sound; }
inline int get_flight_model() const { return flight_model; } inline int get_flight_model() const { return flight_model; }
inline string get_aircraft() const { return aircraft; }
inline int get_model_hz() const { return model_hz; } inline int get_model_hz() const { return model_hz; }
inline int get_speed_up() const { return speed_up; } inline int get_speed_up() const { return speed_up; }
inline void set_speed_up( int speed ) { speed_up = speed; } inline void set_speed_up( int speed ) { speed_up = speed; }