From 5c487a7803ae9bd03fa2eeb391530960d8d18b04 Mon Sep 17 00:00:00 2001 From: curt Date: Mon, 20 Dec 1999 20:26:18 +0000 Subject: [PATCH] Allow JSBsim aircraft model file to be specified from the command line. --- src/Main/options.cxx | 9 +++++++-- src/Main/options.hxx | 4 +++- 2 files changed, 10 insertions(+), 3 deletions(-) diff --git a/src/Main/options.cxx b/src/Main/options.cxx index a7176cc76..d2273470a 100644 --- a/src/Main/options.cxx +++ b/src/Main/options.cxx @@ -161,6 +161,7 @@ fgOPTIONS::fgOPTIONS() : // Flight Model options flight_model( FGInterface::FG_LARCSIM ), + aircraft( "c172" ), model_hz( NEW_DEFAULT_MODEL_HZ ), speed_up( 1 ), @@ -495,7 +496,7 @@ fgOPTIONS::parse_tile_radius( const string& arg ) { // Parse --fdm=abcdefg type option int fgOPTIONS::parse_fdm( const string& fm ) { - // printf("fdm = %s\n", fm); + // cout << "fdm = " << fm << endl; if ( fm == "balloon" ) { return FGInterface::FG_BALLOONSIM; @@ -650,6 +651,8 @@ int fgOPTIONS::parse_option( const string& arg ) { fg_root = arg.substr( 10 ); } else if ( arg.find( "--fdm=" ) != string::npos ) { 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 ) { model_hz = atoi( arg.substr(11) ); } else if ( arg.find( "--speed=" ) != string::npos ) { @@ -865,7 +868,9 @@ void fgOPTIONS::usage ( void ) { cout << 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)" << endl; cout << "\t--speed=n: run the FDM this much faster than real time" << endl; diff --git a/src/Main/options.hxx b/src/Main/options.hxx index ef43963bb..dd32db181 100644 --- a/src/Main/options.hxx +++ b/src/Main/options.hxx @@ -152,7 +152,8 @@ private: bool sound; // play sound effects // 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 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_sound() const { return sound; } 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_speed_up() const { return speed_up; } inline void set_speed_up( int speed ) { speed_up = speed; }