]> git.mxchange.org Git - flightgear.git/commitdiff
Allow JSBsim aircraft model file to be specified from the command line.
authorcurt <curt>
Mon, 20 Dec 1999 20:26:18 +0000 (20:26 +0000)
committercurt <curt>
Mon, 20 Dec 1999 20:26:18 +0000 (20:26 +0000)
src/Main/options.cxx
src/Main/options.hxx

index a7176cc767ff0a4f82cf9acfff1aaa9b167111c2..d2273470addebb02b49c42cc95d2e3d63f761be6 100644 (file)
@@ -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;
index ef43963bb27ca9300a62e699a8d2c74ab3e182bd..dd32db18115389ff8b388a3264c88e6326516876 100644 (file)
@@ -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; }