]> git.mxchange.org Git - flightgear.git/blob - src/Main/options.cxx
7b89e72a99968706b937ed870b9ab0493354ce39
[flightgear.git] / src / Main / options.cxx
1 // options.cxx -- class to handle command line options
2 //
3 // Written by Curtis Olson, started April 1998.
4 //
5 // Copyright (C) 1998  Curtis L. Olson  - curt@me.umn.edu
6 //
7 // This program is free software; you can redistribute it and/or
8 // modify it under the terms of the GNU General Public License as
9 // published by the Free Software Foundation; either version 2 of the
10 // License, or (at your option) any later version.
11 //
12 // This program is distributed in the hope that it will be useful, but
13 // WITHOUT ANY WARRANTY; without even the implied warranty of
14 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
15 // General Public License for more details.
16 //
17 // You should have received a copy of the GNU General Public License
18 // along with this program; if not, write to the Free Software
19 // Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
20 //
21 // $Id$
22
23
24 #ifdef HAVE_CONFIG_H
25 #  include <config.h>
26 #endif
27
28 #include <simgear/compiler.h>
29
30 /* normans fix */
31 #if defined(FX) && defined(XMESA)
32 bool global_fullscreen = true;
33 #endif
34
35 #include <math.h>            // rint()
36 #include <stdio.h>
37 #include <stdlib.h>          // atof(), atoi()
38 #include <string.h>
39
40 #include STL_STRING
41
42 #include <simgear/misc/sgstream.hxx>
43
44 // #include <Include/general.hxx>
45 // #include <Airports/simple.hxx>
46 // #include <Cockpit/cockpit.hxx>
47 // #include <FDM/flight.hxx>
48 // #include <FDM/UIUCModel/uiuc_aircraftdir.h>
49 #ifdef FG_NETWORK_OLK
50 #  include <NetworkOLK/network.h>
51 #endif
52
53 #include "globals.hxx"
54 #include "fg_init.hxx"
55 #include "fg_props.hxx"
56 #include "options.hxx"
57
58 SG_USING_STD(string);
59 SG_USING_NAMESPACE(std);
60
61
62 #define NEW_DEFAULT_MODEL_HZ 120
63
64 enum
65 {
66     FG_OPTIONS_OK = 0,
67     FG_OPTIONS_HELP = 1,
68     FG_OPTIONS_ERROR = 2
69 };
70
71 static double
72 atof( const string& str )
73 {
74
75 #ifdef __MWERKS__ 
76     // -dw- if ::atof is called, then we get an infinite loop
77     return std::atof( str.c_str() );
78 #else
79     return ::atof( str.c_str() );
80 #endif
81 }
82
83 static int
84 atoi( const string& str )
85 {
86 #ifdef __MWERKS__ 
87     // -dw- if ::atoi is called, then we get an infinite loop
88     return std::atoi( str.c_str() );
89 #else
90     return ::atoi( str.c_str() );
91 #endif
92 }
93
94
95 /**
96  * Set a few fail-safe default property values.
97  *
98  * These should all be set in $FG_ROOT/preferences.xml, but just
99  * in case, we provide some initial sane values here. This method 
100  * should be invoked *before* reading any init files.
101  */
102 void
103 fgSetDefaults ()
104 {
105     // set a possibly independent location for scenery data
106     char *envp = ::getenv( "FG_SCENERY" );
107
108     if ( envp != NULL ) {
109         // fg_root could be anywhere, so default to environmental
110         // variable $FG_ROOT if it is set.
111         globals->set_fg_scenery(envp);
112     } else {
113         // Otherwise, default to Scenery being in $FG_ROOT/Scenery
114         globals->set_fg_scenery("");
115     }
116                                 // Position (Globe, AZ)
117     fgSetDouble("/position/longitude", -110.6642444);
118     fgSetDouble("/position/latitude", 33.3528917);
119     fgSetDouble("/position/altitude", -9999.0);
120
121                                 // Orientation
122     fgSetDouble("/orientation/heading", 270);
123     fgSetDouble("/orientation/roll", 0);
124     fgSetDouble("/orientation/pitch", 0.424);
125
126                                 // Velocities
127     fgSetString("/sim/startup/speed-set", "knots");
128     fgSetDouble("/velocities/uBody", 0.0);
129     fgSetDouble("/velocities/vBody", 0.0);
130     fgSetDouble("/velocities/wBody", 0.0);
131     fgSetDouble("/velocities/speed-north", 0.0);
132     fgSetDouble("/velocities/speed-east", 0.0);
133     fgSetDouble("/velocities/speed-down", 0.0);
134     fgSetDouble("/velocities/airspeed", 0.0);
135     fgSetDouble("/velocities/mach", 0.0);
136
137                                 // Miscellaneous
138     fgSetBool("/sim/startup/game-mode", false);
139     fgSetBool("/sim/startup/splash-screen", true);
140     fgSetBool("/sim/startup/intro-music", true);
141     // we want mouse-pointer to have an undefined value if nothing is
142     // specified so we can do the right thing for voodoo-1/2 cards.
143     // fgSetString("/sim/startup/mouse-pointer", "disabled");
144     fgSetString("/sim/control-mode", "joystick");
145     fgSetBool("/sim/auto-coordination", false);
146
147                                 // Features
148     fgSetBool("/sim/hud/visibility", false);
149     fgSetBool("/sim/panel/visibility", true);
150     fgSetBool("/sim/sound", true);
151     fgSetBool("/sim/hud/antialiased", false);
152
153                                 // Flight Model options
154     fgSetString("/sim/flight-model", "larcsim");
155     fgSetString("/sim/aircraft", "c172");
156     fgSetInt("/sim/model-hz", NEW_DEFAULT_MODEL_HZ);
157     fgSetInt("/sim/speed-up", 1);
158     fgSetBool("/sim/startup/trim", false);
159     fgSetBool("/sim/startup/onground", true);
160
161                                 // Rendering options
162     fgSetString("/sim/rendering/fog", "nicest");
163     fgSetBool("/environment/clouds/status", true);
164     fgSetDouble("/environment/clouds/altitude", 5000);
165     fgSetBool("/sim/startup/fullscreen", false);
166     fgSetBool("/sim/rendering/shading", true);
167     fgSetBool("/sim/rendering/skyblend", true);
168     fgSetBool("/sim/rendering/textures", true);
169     fgSetBool("/sim/rendering/wireframe", false);
170     fgSetInt("/sim/startup/xsize", 800);
171     fgSetInt("/sim/startup/ysize", 600);
172     fgSetInt("/sim/rendering/bits-per-pixel", 16);
173     fgSetString("/sim/view-mode", "pilot");
174     fgSetDouble("/sim/view/offset", 0);
175     fgSetDouble("/environment/visibility", 20000);
176
177                                 // HUD options
178     fgSetString("/sim/startup/units", "feet");
179     fgSetString("/sim/hud/frame-stat-type", "tris");
180         
181                                 // Time options
182     fgSetInt("/sim/startup/time-offset", 0);
183     fgSetString("/sim/startup/time-offset-type", "system-offset");
184
185     fgSetBool("/sim/networking/network-olk", false);
186     fgSetString("/sim/networking/call-sign", "Johnny");
187 }
188
189
190 // parse a time string ([+/-]%f[:%f[:%f]]) into hours
191 static double
192 parse_time(const string& time_in) {
193     char *time_str, num[256];
194     double hours, minutes, seconds;
195     double result = 0.0;
196     int sign = 1;
197     int i;
198
199     time_str = (char *)time_in.c_str();
200
201     // printf("parse_time(): %s\n", time_str);
202
203     // check for sign
204     if ( strlen(time_str) ) {
205         if ( time_str[0] == '+' ) {
206             sign = 1;
207             time_str++;
208         } else if ( time_str[0] == '-' ) {
209             sign = -1;
210             time_str++;
211         }
212     }
213     // printf("sign = %d\n", sign);
214
215     // get hours
216     if ( strlen(time_str) ) {
217         i = 0;
218         while ( (time_str[0] != ':') && (time_str[0] != '\0') ) {
219             num[i] = time_str[0];
220             time_str++;
221             i++;
222         }
223         if ( time_str[0] == ':' ) {
224             time_str++;
225         }
226         num[i] = '\0';
227         hours = atof(num);
228         // printf("hours = %.2lf\n", hours);
229
230         result += hours;
231     }
232
233     // get minutes
234     if ( strlen(time_str) ) {
235         i = 0;
236         while ( (time_str[0] != ':') && (time_str[0] != '\0') ) {
237             num[i] = time_str[0];
238             time_str++;
239             i++;
240         }
241         if ( time_str[0] == ':' ) {
242             time_str++;
243         }
244         num[i] = '\0';
245         minutes = atof(num);
246         // printf("minutes = %.2lf\n", minutes);
247
248         result += minutes / 60.0;
249     }
250
251     // get seconds
252     if ( strlen(time_str) ) {
253         i = 0;
254         while ( (time_str[0] != ':') && (time_str[0] != '\0') ) {
255             num[i] = time_str[0];
256             time_str++;
257             i++;
258         }
259         num[i] = '\0';
260         seconds = atof(num);
261         // printf("seconds = %.2lf\n", seconds);
262
263         result += seconds / 3600.0;
264     }
265
266     return(sign * result);
267 }
268
269
270 // parse a date string (yyyy:mm:dd:hh:mm:ss) into a time_t (seconds)
271 static long int 
272 parse_date( const string& date)
273 {
274     struct tm gmt;
275     char * date_str, num[256];
276     int i;
277     // initialize to zero
278     gmt.tm_sec = 0;
279     gmt.tm_min = 0;
280     gmt.tm_hour = 0;
281     gmt.tm_mday = 0;
282     gmt.tm_mon = 0;
283     gmt.tm_year = 0;
284     gmt.tm_isdst = 0; // ignore daylight savings time for the moment
285     date_str = (char *)date.c_str();
286     // get year
287     if ( strlen(date_str) ) {
288         i = 0;
289         while ( (date_str[0] != ':') && (date_str[0] != '\0') ) {
290             num[i] = date_str[0];
291             date_str++;
292             i++;
293         }
294         if ( date_str[0] == ':' ) {
295             date_str++;
296         }
297         num[i] = '\0';
298         gmt.tm_year = atoi(num) - 1900;
299     }
300     // get month
301     if ( strlen(date_str) ) {
302         i = 0;
303         while ( (date_str[0] != ':') && (date_str[0] != '\0') ) {
304             num[i] = date_str[0];
305             date_str++;
306             i++;
307         }
308         if ( date_str[0] == ':' ) {
309             date_str++;
310         }
311         num[i] = '\0';
312         gmt.tm_mon = atoi(num) -1;
313     }
314     // get day
315     if ( strlen(date_str) ) {
316         i = 0;
317         while ( (date_str[0] != ':') && (date_str[0] != '\0') ) {
318             num[i] = date_str[0];
319             date_str++;
320             i++;
321         }
322         if ( date_str[0] == ':' ) {
323             date_str++;
324         }
325         num[i] = '\0';
326         gmt.tm_mday = atoi(num);
327     }
328     // get hour
329     if ( strlen(date_str) ) {
330         i = 0;
331         while ( (date_str[0] != ':') && (date_str[0] != '\0') ) {
332             num[i] = date_str[0];
333             date_str++;
334             i++;
335         }
336         if ( date_str[0] == ':' ) {
337             date_str++;
338         }
339         num[i] = '\0';
340         gmt.tm_hour = atoi(num);
341     }
342     // get minute
343     if ( strlen(date_str) ) {
344         i = 0;
345         while ( (date_str[0] != ':') && (date_str[0] != '\0') ) {
346             num[i] = date_str[0];
347             date_str++;
348             i++;
349         }
350         if ( date_str[0] == ':' ) {
351             date_str++;
352         }
353         num[i] = '\0';
354         gmt.tm_min = atoi(num);
355     }
356     // get second
357     if ( strlen(date_str) ) {
358         i = 0;
359         while ( (date_str[0] != ':') && (date_str[0] != '\0') ) {
360             num[i] = date_str[0];
361             date_str++;
362             i++;
363         }
364         if ( date_str[0] == ':' ) {
365             date_str++;
366         }
367         num[i] = '\0';
368         gmt.tm_sec = atoi(num);
369     }
370     time_t theTime = sgTimeGetGMT( gmt.tm_year, gmt.tm_mon, gmt.tm_mday,
371                                    gmt.tm_hour, gmt.tm_min, gmt.tm_sec );
372     //printf ("Date is %s\n", ctime(&theTime));
373     //printf ("in seconds that is %d\n", theTime);
374     //exit(1);
375     return (theTime);
376 }
377
378
379 // parse angle in the form of [+/-]ddd:mm:ss into degrees
380 static double
381 parse_degree( const string& degree_str) {
382     double result = parse_time( degree_str );
383
384     // printf("Degree = %.4f\n", result);
385
386     return(result);
387 }
388
389
390 // parse time offset string into seconds
391 static int
392 parse_time_offset( const string& time_str) {
393     int result;
394
395     // printf("time offset = %s\n", time_str);
396
397 #ifdef HAVE_RINT
398     result = (int)rint(parse_time(time_str) * 3600.0);
399 #else
400     result = (int)(parse_time(time_str) * 3600.0);
401 #endif
402
403     // printf("parse_time_offset(): %d\n", result);
404
405     return( result );
406 }
407
408
409 // Parse --fov=x.xx type option 
410 static double
411 parse_fov( const string& arg ) {
412     double fov = atof(arg);
413
414     if ( fov < FG_FOV_MIN ) { fov = FG_FOV_MIN; }
415     if ( fov > FG_FOV_MAX ) { fov = FG_FOV_MAX; }
416
417     fgSetDouble("/sim/field-of-view", fov);
418
419     // printf("parse_fov(): result = %.4f\n", fov);
420
421     return fov;
422 }
423
424
425 // Parse I/O channel option
426 //
427 // Format is "--protocol=medium,direction,hz,medium_options,..."
428 //
429 //   protocol = { native, nmea, garmin, fgfs, rul, pve, etc. }
430 //   medium = { serial, socket, file, etc. }
431 //   direction = { in, out, bi }
432 //   hz = number of times to process channel per second (floating
433 //        point values are ok.
434 //
435 // Serial example "--nmea=serial,dir,hz,device,baud" where
436 // 
437 //  device = OS device name of serial line to be open()'ed
438 //  baud = {300, 1200, 2400, ..., 230400}
439 //
440 // Socket exacmple "--native=socket,dir,hz,machine,port,style" where
441 // 
442 //  machine = machine name or ip address if client (leave empty if server)
443 //  port = port, leave empty to let system choose
444 //  style = tcp or udp
445 //
446 // File example "--garmin=file,dir,hz,filename" where
447 // 
448 //  filename = file system file name
449
450 static bool 
451 parse_channel( const string& type, const string& channel_str ) {
452     // cout << "Channel string = " << channel_str << endl;
453
454     globals->get_channel_options_list()->push_back( type + "," + channel_str );
455
456     return true;
457 }
458
459
460 // Parse --wp=ID[@alt]
461 static bool 
462 parse_wp( const string& arg ) {
463     string id, alt_str;
464     double alt = 0.0;
465
466     unsigned int pos = arg.find( "@" );
467     if ( pos != string::npos ) {
468         id = arg.substr( 0, pos );
469         alt_str = arg.substr( pos + 1 );
470         // cout << "id str = " << id << "  alt str = " << alt_str << endl;
471         alt = atof( alt_str.c_str() );
472         if ( fgGetString("/sim/startup/units") == "feet" ) {
473             alt *= SG_FEET_TO_METER;
474         }
475     } else {
476         id = arg;
477     }
478
479     FGAirport a;
480     if ( fgFindAirportID( id, &a ) ) {
481         SGWayPoint wp( a.longitude, a.latitude, alt, SGWayPoint::WGS84, id );
482         globals->get_route()->add_waypoint( wp );
483
484         return true;
485     } else {
486         return false;
487     }
488 }
489
490
491 // Parse --flight-plan=[file]
492 static bool 
493 parse_flightplan(const string& arg)
494 {
495     sg_gzifstream in(arg.c_str());
496     if ( !in.is_open() ) {
497         return false;
498     }
499     while ( true ) {
500         string line;
501
502 #if defined( macintosh )
503         getline( in, line, '\r' );
504 #else
505         getline( in, line, '\n' );
506 #endif
507
508         // catch extraneous (DOS) line ending character
509         if ( line[line.length() - 1] < 32 ) {
510             line = line.substr( 0, line.length()-1 );
511         }
512
513         if ( in.eof() ) {
514             break;
515         }
516         parse_wp(line);
517     }
518
519     return true;
520 }
521
522
523 // Parse a single option
524 static int 
525 parse_option (const string& arg) 
526 {
527     // General Options
528     if ( (arg == "--help") || (arg == "-h") ) {
529         // help/usage request
530         return(FG_OPTIONS_HELP);
531     } else if ( arg == "--disable-game-mode") {
532         fgSetBool("/sim/startup/game-mode", false);
533     } else if ( arg == "--enable-game-mode" ) {
534         fgSetBool("/sim/startup/game-mode", true);
535     } else if ( arg == "--disable-splash-screen" ) {
536         fgSetBool("/sim/startup/splash-screen", false); 
537     } else if ( arg == "--enable-splash-screen" ) {
538         fgSetBool("/sim/startup/splash-screen", true);
539     } else if ( arg == "--disable-intro-music" ) {
540         fgSetBool("/sim/startup/intro-music", false);
541     } else if ( arg == "--enable-intro-music" ) {
542         fgSetBool("/sim/startup/intro-music", true);
543     } else if ( arg == "--disable-mouse-pointer" ) {
544         fgSetString("/sim/startup/mouse-pointer", "disabled");
545     } else if ( arg == "--enable-mouse-pointer" ) {
546         fgSetString("/sim/startup/mouse-pointer", "enabled");
547     } else if ( arg == "--disable-freeze" ) {
548         fgSetBool("/sim/freeze", false);
549     } else if ( arg == "--enable-freeze" ) {
550         fgSetBool("/sim/freeze", true);
551     } else if ( arg == "--disable-anti-alias-hud" ) {
552         fgSetBool("/sim/hud/antialiased", false);
553     } else if ( arg == "--enable-anti-alias-hud" ) {
554         fgSetBool("/sim/hud/antialiased", true);
555     } else if ( arg.find( "--control=") == 0 ) {
556         fgSetString("/sim/control-mode", arg.substr(10));
557     } else if ( arg == "--disable-auto-coordination" ) {
558         fgSetBool("/sim/auto-coordination", false);
559     } else if ( arg == "--enable-auto-coordination" ) {
560         fgSetBool("/sim/auto-coordination", true);
561     } else if ( arg == "--disable-hud" ) {
562         fgSetBool("/sim/hud/visibility", false);
563     } else if ( arg == "--enable-hud" ) {
564         fgSetBool("/sim/hud/visibility", true);
565     } else if ( arg == "--disable-panel" ) {
566         fgSetBool("/sim/panel/visibility", false);
567     } else if ( arg == "--enable-panel" ) {
568         fgSetBool("/sim/panel/visibility", true);
569     } else if ( arg == "--disable-sound" ) {
570         fgSetBool("/sim/sound", false);
571     } else if ( arg == "--enable-sound" ) {
572         fgSetBool("/sim/sound", true);
573     } else if ( arg.find( "--airport-id=") == 0 ) {
574                                 // NB: changed property name!!!
575         fgSetString("/sim/startup/airport-id", arg.substr(13));
576     } else if ( arg.find( "--offset-distance=") == 0 ) {
577         fgSetDouble("/sim/startup/offset-distance", atof(arg.substr(18)));
578     } else if ( arg.find( "--offset-azimuth=") == 0 ) {
579         fgSetDouble("/sim/startup/offset-azimuth", atof(arg.substr(17))); 
580     } else if ( arg.find( "--lon=" ) == 0 ) {
581         fgSetDouble("/position/longitude",
582                               parse_degree(arg.substr(6)));
583         fgSetString("/sim/startup/airport-id", "");
584     } else if ( arg.find( "--lat=" ) == 0 ) {
585         fgSetDouble("/position/latitude",
586                               parse_degree(arg.substr(6)));
587         fgSetString("/sim/startup/airport-id", "");
588     } else if ( arg.find( "--altitude=" ) == 0 ) {
589         fgSetBool("/sim/startup/onground", false);
590         if ( fgGetString("/sim/startup/units") == "feet" )
591             fgSetDouble("/position/altitude", atof(arg.substr(11)));
592         else
593             fgSetDouble("/position/altitude",
594                         atof(arg.substr(11)) * SG_METER_TO_FEET);
595     } else if ( arg.find( "--uBody=" ) == 0 ) {
596         fgSetString("/sim/startup/speed-set", "UVW");
597         if ( fgGetString("/sim/startup/units") == "feet" )
598           fgSetDouble("/velocities/uBody", atof(arg.substr(8)));
599         else
600           fgSetDouble("/velocities/uBody",
601                                atof(arg.substr(8)) * SG_METER_TO_FEET);
602     } else if ( arg.find( "--vBody=" ) == 0 ) {
603         fgSetString("/sim/startup/speed-set", "UVW");
604         if ( fgGetString("/sim/startup/units") == "feet" )
605           fgSetDouble("/velocities/vBody", atof(arg.substr(8)));
606         else
607           fgSetDouble("/velocities/vBody",
608                                atof(arg.substr(8)) * SG_METER_TO_FEET);
609     } else if ( arg.find( "--wBody=" ) == 0 ) {
610         fgSetString("/sim/startup/speed-set", "UVW");
611         if ( fgGetString("/sim/startup/units") == "feet" )
612           fgSetDouble("/velocities/wBody", atof(arg.substr(8)));
613         else
614           fgSetDouble("/velocities/wBody",
615                                atof(arg.substr(8)) * SG_METER_TO_FEET);
616     } else if ( arg.find( "--vNorth=" ) == 0 ) {
617         fgSetString("/sim/startup/speed-set", "NED");
618         if ( fgGetString("/sim/startup/units") == "feet" )
619           fgSetDouble("/velocities/speed-north", atof(arg.substr(9)));
620         else
621           fgSetDouble("/velocities/speed-north",
622                                atof(arg.substr(9)) * SG_METER_TO_FEET);
623     } else if ( arg.find( "--vEast=" ) == 0 ) {
624         fgSetString("/sim/startup/speed-set", "NED");
625         if ( fgGetString("/sim/startup/units") == "feet" )
626           fgSetDouble("/velocities/speed-east", atof(arg.substr(8)));
627         else
628           fgSetDouble("/velocities/speed-east",
629                                atof(arg.substr(8)) * SG_METER_TO_FEET);
630     } else if ( arg.find( "--vDown=" ) == 0 ) {
631         fgSetString("/sim/startup/speed-set", "NED");
632         if ( fgGetString("/sim/startup/units") == "feet" )
633           fgSetDouble("/velocities/speed-down", atof(arg.substr(8)));
634         else
635           fgSetDouble("/velocities/speed-down",
636                                atof(arg.substr(8)) * SG_METER_TO_FEET);
637     } else if ( arg.find( "--vc=" ) == 0) {
638         fgSetString("/sim/startup/speed-set", "knots");
639         fgSetDouble("/velocities/airspeed", atof(arg.substr(5)));
640     } else if ( arg.find( "--mach=" ) == 0) {
641         fgSetString("/sim/startup/speed-set", "mach");
642         fgSetDouble("/velocities/mach", atof(arg.substr(7)));
643     } else if ( arg.find( "--heading=" ) == 0 ) {
644         fgSetDouble("/orientation/heading", atof(arg.substr(10)));
645     } else if ( arg.find( "--roll=" ) == 0 ) {
646         fgSetDouble("/orientation/roll", atof(arg.substr(7)));
647     } else if ( arg.find( "--pitch=" ) == 0 ) {
648         fgSetDouble("/orientation/pitch", atof(arg.substr(8)));
649     } else if ( arg.find( "--fg-root=" ) == 0 ) {
650         globals->set_fg_root(arg.substr( 10 ));
651     } else if ( arg.find( "--fg-scenery=" ) == 0 ) {
652         globals->set_fg_scenery(arg.substr( 13 ));
653     } else if ( arg.find( "--fdm=" ) == 0 ) {
654         fgSetString("/sim/flight-model", arg.substr(6));
655     } else if ( arg.find( "--aircraft=" ) == 0 ) {
656         fgSetString("/sim/aircraft", arg.substr(11));
657     } else if ( arg.find( "--aircraft-dir=" ) == 0 ) {
658         fgSetString("/sim/aircraft-dir", arg.substr(15));
659     } else if ( arg.find( "--model-hz=" ) == 0 ) {
660         fgSetInt("/sim/model-hz", atoi(arg.substr(11)));
661     } else if ( arg.find( "--speed=" ) == 0 ) {
662         fgSetInt("/sim/speed-up", atoi(arg.substr(8)));
663     } else if ( arg.find( "--trim") == 0) {
664         fgSetBool("/sim/startup/trim", true);
665     } else if ( arg.find( "--notrim") == 0) {
666         fgSetBool("/sim/startup/trim", false);
667     } else if ( arg.find( "--on-ground") == 0) {
668         fgSetBool("/sim/startup/onground", true);
669     } else if ( arg.find( "--in-air") == 0) {
670         fgSetBool("/sim/startup/onground", false);
671     } else if ( arg == "--fog-disable" ) {
672         fgSetString("/sim/rendering/fog", "disabled");
673     } else if ( arg == "--fog-fastest" ) {
674         fgSetString("/sim/rendering/fog", "fastest");
675     } else if ( arg == "--fog-nicest" ) {
676         fgSetString("/sim/fog", "nicest");
677     } else if ( arg == "--disable-clouds" ) {
678         fgSetBool("/environment/clouds/status", false);
679     } else if ( arg == "--enable-clouds" ) {
680         fgSetBool("/environment/clouds/status", true);
681     } else if ( arg.find( "--clouds-asl=" ) == 0 ) {
682                                 // FIXME: check units
683         if ( fgGetString("/sim/startup/units") == "feet" )
684           fgSetDouble("/environment/clouds/altitude",
685                                 atof(arg.substr(13)) * SG_FEET_TO_METER);
686         else
687           fgSetDouble("/environment/clouds/altitude",
688                                 atof(arg.substr(13)));
689     } else if ( arg.find( "--fov=" ) == 0 ) {
690         parse_fov( arg.substr(6) );
691     } else if ( arg == "--disable-fullscreen" ) {
692         fgSetBool("/sim/startup/fullscreen", false);
693     } else if ( arg== "--enable-fullscreen") {
694         fgSetBool("/sim/startup/fullscreen", true);
695     } else if ( arg == "--shading-flat") {
696         fgSetBool("/sim/rendering/shading", false);
697     } else if ( arg == "--shading-smooth") {
698         fgSetBool("/sim/rendering/shading", true);
699     } else if ( arg == "--disable-skyblend") {
700         fgSetBool("/sim/rendering/skyblend", false);
701     } else if ( arg== "--enable-skyblend" ) {
702         fgSetBool("/sim/rendering/skyblend", true);
703     } else if ( arg == "--disable-textures" ) {
704         fgSetBool("/sim/rendering/textures", false);
705     } else if ( arg == "--enable-textures" ) {
706         fgSetBool("/sim/rendering/textures", true);
707     } else if ( arg == "--disable-wireframe" ) {
708         fgSetBool("/sim/rendering/wireframe", false);
709     } else if ( arg == "--enable-wireframe" ) {
710         fgSetBool("/sim/rendering/wireframe", true);
711     } else if ( arg.find( "--geometry=" ) == 0 ) {
712         bool geometry_ok = true;
713         int xsize = 0, ysize = 0;
714         string geometry = arg.substr( 11 );
715         string::size_type i = geometry.find('x');
716
717         if (i != string::npos) {
718             xsize = atoi(geometry.substr(0, i));
719             ysize = atoi(geometry.substr(i+1));
720         } else {
721             geometry_ok = false;
722         }
723
724         if ( xsize <= 0 || ysize <= 0 ) {
725             xsize = 640;
726             ysize = 480;
727             geometry_ok = false;
728         }
729
730         if ( !geometry_ok ) {
731             SG_LOG( SG_GENERAL, SG_ALERT, "Unknown geometry: " << geometry );
732             SG_LOG( SG_GENERAL, SG_ALERT,
733                     "Setting geometry to " << xsize << 'x' << ysize << '\n');
734         } else {
735           SG_LOG( SG_GENERAL, SG_INFO,
736                   "Setting geometry to " << xsize << 'x' << ysize << '\n');
737           fgSetInt("/sim/startup/xsize", xsize);
738           fgSetInt("/sim/startup/ysize", ysize);
739         }
740     } else if ( arg.find( "--bpp=" ) == 0 ) {
741         string bits_per_pix = arg.substr( 6 );
742         if ( bits_per_pix == "16" ) {
743             fgSetInt("/sim/rendering/bits-per-pixel", 16);
744         } else if ( bits_per_pix == "24" ) {
745             fgSetInt("/sim/rendering/bits-per-pixel", 24);
746         } else if ( bits_per_pix == "32" ) {
747             fgSetInt("/sim/rendering/bits-per-pixel", 32);
748         } else {
749           SG_LOG(SG_GENERAL, SG_ALERT, "Unsupported bpp " << bits_per_pix);
750         }
751     } else if ( arg == "--units-feet" ) {
752         fgSetString("/sim/startup/units", "feet");
753     } else if ( arg == "--units-meters" ) {
754         fgSetString("/sim/startup/units", "meters");
755     } else if ( arg.find( "--time-offset" ) == 0 ) {
756         fgSetInt("/sim/startup/time-offset",
757                            parse_time_offset( (arg.substr(14)) ));
758     } else if ( arg.find( "--time-match-real") == 0 ) {
759         fgSetString("/sim/startup/time-offset-type",
760                               "system-offset");
761     } else if ( arg.find( "--time-match-local") == 0 ) {
762         fgSetString("/sim/startup/time-offset-type",
763                               "latitude-offset");
764     } else if ( arg.find( "--start-date-sys=") == 0 ) {
765         fgSetInt("/sim/startup/time-offset",
766                            parse_date((arg.substr(17))));
767         fgSetString("/sim/startup/time-offset-type", "system");
768     } else if ( arg.find( "--start-date-lat=") == 0 ) {
769         fgSetInt("/sim/startup/time-offset",
770                            parse_date((arg.substr(17))));
771         fgSetString("/sim/startup/time-offset-type",
772                            "latitude");
773     } else if ( arg.find( "--start-date-gmt=") == 0 ) {
774         fgSetInt("/sim/startup/time-offset",
775                            parse_date((arg.substr(17))));
776         fgSetString("/sim/startup/time-offset-type", "gmt");
777     } else if ( arg == "--hud-tris" ) {
778         fgSetString("/sim/hud/frame-stat-type", "tris");
779     } else if ( arg == "--hud-culled" ) {
780         fgSetString("/sim/hud/frame-stat-type", "culled");
781     } else if ( arg.find( "--atlas=" ) == 0 ) {
782         parse_channel( "atlas", arg.substr(8) );
783     } else if ( arg.find( "--native=" ) == 0 ) {
784         parse_channel( "native", arg.substr(9) );
785     } else if ( arg.find( "--garmin=" ) == 0 ) {
786         parse_channel( "garmin", arg.substr(9) );
787     } else if ( arg.find( "--nmea=" ) == 0 ) {
788         parse_channel( "nmea", arg.substr(7) );
789     } else if ( arg.find( "--props=" ) == 0 ) {
790         parse_channel( "props", arg.substr(8) );
791     } else if ( arg.find( "--pve=" ) == 0 ) {
792         parse_channel( "pve", arg.substr(6) );
793     } else if ( arg.find( "--ray=" ) == 0 ) {
794         parse_channel( "ray", arg.substr(6) );
795     } else if ( arg.find( "--rul=" ) == 0 ) {
796         parse_channel( "rul", arg.substr(6) );
797     } else if ( arg.find( "--joyclient=" ) == 0 ) {
798         parse_channel( "joyclient", arg.substr(12) );
799 #ifdef FG_NETWORK_OLK
800     } else if ( arg == "--disable-network-olk" ) {
801         fgSetBool("/sim/networking/olk", false);
802     } else if ( arg== "--enable-network-olk") {
803         fgSetBool("/sim/networking/olk", true);
804     } else if ( arg == "--net-hud" ) {
805         fgSetBool("/sim/hud/net-display", true);
806         net_hud_display = 1;    // FIXME
807     } else if ( arg.find( "--net-id=") == 0 ) {
808         fgSetString("sim/networking/call-sign", arg.substr(9));
809 #endif
810     } else if ( arg.find( "--prop:" ) == 0 ) {
811         string assign = arg.substr(7);
812         unsigned int pos = assign.find('=');
813         if ( pos == arg.npos || pos == 0 ) {
814             SG_LOG( SG_GENERAL, SG_ALERT, "Bad property assignment: " << arg );
815             return FG_OPTIONS_ERROR;
816         }
817         string name = assign.substr(0, pos);
818         string value = assign.substr(pos + 1);
819         fgSetString(name.c_str(), value);
820         // SG_LOG(SG_GENERAL, SG_INFO, "Setting default value of property "
821         //        << name << " to \"" << value << '"');
822     // $$$ begin - added VS Renganathan, 14 Oct 2K
823     // for multi-window outside window imagery
824     } else if ( arg.find( "--view-offset=" ) == 0 ) {
825         string woffset = arg.substr( 14 );
826         double default_view_offset = 0.0;
827         if ( woffset == "LEFT" ) {
828                default_view_offset = SGD_PI * 0.25;
829         } else if ( woffset == "RIGHT" ) {
830             default_view_offset = SGD_PI * 1.75;
831         } else if ( woffset == "CENTER" ) {
832             default_view_offset = 0.00;
833         } else {
834             default_view_offset = atof( woffset.c_str() ) * SGD_DEGREES_TO_RADIANS;
835         }
836         FGViewerRPH *pilot_view =
837             (FGViewerRPH *)globals->get_viewmgr()->get_view( 0 );
838         pilot_view->set_view_offset( default_view_offset );
839         pilot_view->set_goal_view_offset( default_view_offset );
840         fgSetDouble("/sim/view/offset", default_view_offset);
841     // $$$ end - added VS Renganathan, 14 Oct 2K
842     } else if ( arg.find( "--visibility=" ) == 0 ) {
843         fgSetDouble("/environment/visibility", atof(arg.substr(13)));
844     } else if ( arg.find( "--visibility-miles=" ) == 0 ) {
845         double visibility = atof(arg.substr(19)) * 5280.0 * SG_FEET_TO_METER;
846         fgSetDouble("/environment/visibility", visibility);
847     } else if ( arg.find( "--wind=" ) == 0 ) {
848         string val = arg.substr(7);
849         unsigned int pos = val.find('@');
850         if ( pos == string::npos ) {
851           SG_LOG( SG_GENERAL, SG_ALERT, "bad wind value " << val );
852           return FG_OPTIONS_ERROR;
853         }
854         double dir = atof(val.substr(0,pos).c_str());
855         double speed = atof(val.substr(pos+1).c_str());
856         SG_LOG(SG_GENERAL, SG_INFO, "WIND: " << dir << '@' << 
857                speed << " knots" << endl);
858                                 // convert to fps
859         speed *= SG_NM_TO_METER * SG_METER_TO_FEET * (1.0/3600);
860         dir += 180;
861         if (dir >= 360)
862           dir -= 360;
863         dir *= SGD_DEGREES_TO_RADIANS;
864         fgSetDouble("/environment/wind-north",
865                                              speed * cos(dir));
866         fgSetDouble("/environment/wind-east",
867                                              speed * sin(dir));
868     } else if ( arg.find( "--wp=" ) == 0 ) {
869         parse_wp( arg.substr( 5 ) );
870     } else if ( arg.find( "--flight-plan=") == 0) {
871         parse_flightplan ( arg.substr (14) );
872     } else if ( arg.find( "--config=" ) == 0 ) {
873         string file = arg.substr(9);
874         if (!readProperties(file, globals->get_props())) {
875           SG_LOG(SG_IO, SG_ALERT,
876                  "--config: failed to read properties from " << file);
877           return FG_OPTIONS_ERROR;
878         }
879     } else {
880         SG_LOG( SG_GENERAL, SG_ALERT, "Unknown option '" << arg << "'" );
881         return FG_OPTIONS_ERROR;
882     }
883     
884     return FG_OPTIONS_OK;
885 }
886
887
888 // Scan the command line options for an fg_root definition and set
889 // just that.
890 string
891 fgScanForRoot (int argc, char **argv) 
892 {
893     int i = 1;
894
895     SG_LOG(SG_GENERAL, SG_INFO, "Scanning for root: command line");
896
897     while ( i < argc ) {
898         SG_LOG( SG_GENERAL, SG_DEBUG, "argv[" << i << "] = " << argv[i] );
899
900         string arg = argv[i];
901         if ( arg.find( "--fg-root=" ) == 0 ) {
902             return arg.substr( 10 );
903         }
904
905         i++;
906     }
907
908     return "";
909 }
910
911
912 // Scan the config file for an fg_root definition and set just that.
913 string
914 fgScanForRoot (const string& path)
915 {
916     sg_gzifstream in( path );
917     if ( !in.is_open() )
918       return "";
919
920     SG_LOG( SG_GENERAL, SG_INFO, "Scanning for root: " << path );
921
922     in >> skipcomment;
923 #ifndef __MWERKS__
924     while ( ! in.eof() ) {
925 #else
926     char c = '\0';
927     while ( in.get(c) && c != '\0' ) {
928         in.putback(c);
929 #endif
930         string line;
931
932 #if defined( macintosh )
933         getline( in, line, '\r' );
934 #else
935         getline( in, line, '\n' );
936 #endif
937
938         // catch extraneous (DOS) line ending character
939         if ( line[line.length() - 1] < 32 ) {
940             line = line.substr( 0, line.length()-1 );
941         }
942
943         if ( line.find( "--fg-root=" ) == 0 ) {
944             return line.substr( 10 );
945         }
946
947         in >> skipcomment;
948     }
949
950     return "";
951 }
952
953
954 // Parse the command line options
955 void
956 fgParseOptions (int argc, char **argv) {
957     int i = 1;
958     int result;
959
960     SG_LOG(SG_GENERAL, SG_INFO, "Processing command line arguments");
961
962     while ( i < argc ) {
963         SG_LOG( SG_GENERAL, SG_DEBUG, "argv[" << i << "] = " << argv[i] );
964
965         result = parse_option(argv[i]);
966         if ( (result == FG_OPTIONS_HELP) || (result == FG_OPTIONS_ERROR) ) {
967             fgUsage();
968             exit(-1);
969         }
970
971         i++;
972     }
973 }
974
975
976 // Parse config file options
977 void
978 fgParseOptions (const string& path) {
979     sg_gzifstream in( path );
980     if ( !in.is_open() ) {
981         return;
982     }
983
984     SG_LOG( SG_GENERAL, SG_INFO, "Processing config file: " << path );
985
986     in >> skipcomment;
987 #ifndef __MWERKS__
988     while ( ! in.eof() ) {
989 #else
990     char c = '\0';
991     while ( in.get(c) && c != '\0' ) {
992         in.putback(c);
993 #endif
994         string line;
995
996 #if defined( macintosh )
997         getline( in, line, '\r' );
998 #else
999         getline( in, line, '\n' );
1000 #endif
1001
1002         // catch extraneous (DOS) line ending character
1003         if ( line[line.length() - 1] < 32 ) {
1004             line = line.substr( 0, line.length()-1 );
1005         }
1006
1007         if ( parse_option( line ) == FG_OPTIONS_ERROR ) {
1008             SG_LOG( SG_GENERAL, SG_ALERT, 
1009                     "Config file parse error: " << path << " '" 
1010                     << line << "'" );
1011             fgUsage();
1012             exit(-1);
1013         }
1014         in >> skipcomment;
1015     }
1016 }
1017
1018
1019 // Print usage message
1020 void 
1021 fgUsage ()
1022 {
1023     cout << "Usage: fgfs [ options ... ]" << endl;
1024     cout << endl;
1025
1026     cout << "General Options:" << endl;
1027     cout << "\t--help -h:  print usage" << endl;
1028     cout << "\t--fg-root=path:  specify the root path for all the data files"
1029          << endl;
1030     cout << "\t--fg-scenery=path:  specify the base path for all the scenery"
1031          << " data." << endl
1032          << "\t\tdefaults to $FG_ROOT/Scenery" << endl;
1033     cout << "\t--disable-game-mode:  disable full-screen game mode" << endl;
1034     cout << "\t--enable-game-mode:  enable full-screen game mode" << endl;
1035     cout << "\t--disable-splash-screen:  disable splash screen" << endl;
1036     cout << "\t--enable-splash-screen:  enable splash screen" << endl;
1037     cout << "\t--disable-intro-music:  disable introduction music" << endl;
1038     cout << "\t--enable-intro-music:  enable introduction music" << endl;
1039     cout << "\t--disable-mouse-pointer:  disable extra mouse pointer" << endl;
1040     cout << "\t--enable-mouse-pointer:  enable extra mouse pointer (i.e. for"
1041          << endl;
1042     cout << "\t\tfull screen voodoo/voodoo-II based cards.)" << endl;
1043     cout << "\t--disable-freeze:  start out in an running state" << endl;
1044     cout << "\t--enable-freeze:  start out in a frozen state" << endl;
1045     cout << "\t--control=mode:  primary control mode " 
1046          << "(joystick, keyboard, mouse)" << endl;
1047     cout << "\t--prop:name=value:  set property <name> to <value>" << endl;
1048     cout << "\t--config=path:  load additional properties from path" << endl;
1049     cout << endl;
1050
1051     cout << "Features:" << endl;
1052     cout << "\t--disable-hud:  disable heads up display" << endl;
1053     cout << "\t--enable-hud:  enable heads up display" << endl;
1054     cout << "\t--disable-panel:  disable instrument panel" << endl;
1055     cout << "\t--enable-panel:  enable instrumetn panel" << endl;
1056     cout << "\t--disable-sound:  disable sound effects" << endl;
1057     cout << "\t--enable-sound:  enable sound effects" << endl;
1058     cout << "\t--disable-anti-alias-hud:  disable anti aliased hud" << endl;
1059     cout << "\t--enable-anti-alias-hud:  enable anti aliased hud" << endl;
1060     cout << endl;
1061  
1062     cout << "Flight Model:" << endl;
1063     cout << "\t--fdm=abcd:  selects the core flight model code." << endl;
1064     cout << "\t\tcan be one of jsb, larcsim, magic, external, balloon, or ada"
1065          << endl;
1066     cout << "\t--aircraft=abcd:  aircraft model to load" << endl;
1067     cout << "\t--model-hz=n:  run the FDM this rate (iterations per second)" 
1068          << endl;
1069     cout << "\t--speed=n:  run the FDM this much faster than real time" << endl;
1070     cout << "\t--notrim:  Do NOT attempt to trim the model when initializing JSBsim" << endl;
1071     cout << "\t--on-ground:  Start up at ground level (default)" << endl;
1072     cout << "\t--in-air:  Start up in air (implied by specifying an initial"
1073          << " altitude above ground level." << endl;
1074     cout << "\t--wind=DIR@SPEED: specify wind coming from DIR (degrees) at SPEED (knots)" << endl;
1075     cout << endl;
1076
1077     //(UIUC)
1078     cout <<"Aircraft model directory:" << endl;
1079     cout <<"\t--aircraft-dir=<path> path is relative to the path of the executable" << endl;
1080     cout << endl;
1081
1082     cout << "Initial Position and Orientation:" << endl;
1083     cout << "\t--airport-id=ABCD:  specify starting postion by airport id" 
1084          << endl;
1085     cout << "\t--offset-distance:  specify distance to threshhold"
1086          << " (NM)" << endl; 
1087     cout << "\t--offset-azimuth:  specify heading to threshhold (deg) " 
1088          << endl;    
1089     cout << "\t--lon=degrees:  starting longitude in degrees (west = -)" 
1090          << endl;
1091     cout << "\t--lat=degrees:  starting latitude in degrees (south = -)"
1092          << endl;
1093     cout << "\t--altitude=feet:  starting altitude in feet" << endl;
1094     cout << "\t\t(unless --units-meters specified" << endl;
1095     cout << "\t--heading=degrees:  heading (yaw) angle in degress (Psi)"
1096          << endl;
1097     cout << "\t--roll=degrees:  roll angle in degrees (Phi)" << endl;
1098     cout << "\t--pitch=degrees:  pitch angle in degrees (Theta)" << endl;
1099     cout << "\t--uBody=feet per second:  velocity along the body X axis"
1100          << endl;
1101     cout << "\t--vBody=feet per second:  velocity along the body Y axis"
1102          << endl;
1103     cout << "\t--wBody=feet per second:  velocity along the body Z axis"
1104          << endl;
1105     cout << "\t\t(unless --units-meters specified" << endl;
1106     cout << "\t--vc= initial airspeed in knots (--fdm=jsb only)" << endl;
1107     cout << "\t--mach= initial mach number (--fdm=jsb only)" << endl;
1108     cout << endl;
1109
1110     cout << "Rendering Options:" << endl;
1111     cout << "\t--fog-disable:  disable fog/haze" << endl;
1112     cout << "\t--fog-fastest:  enable fastest fog/haze" << endl;
1113     cout << "\t--fog-nicest:  enable nicest fog/haze" << endl;
1114     cout << "\t--enable-clouds:  enable demo cloud layer" << endl;
1115     cout << "\t--disable-clouds:  disable demo cloud layer" << endl;
1116     cout << "\t--clouds-asl=xxx:  specify altitude of cloud layer above sea level" << endl;
1117     cout << "\t--fov=xx.x:  specify initial field of view angle in degrees"
1118          << endl;
1119     cout << "\t--disable-fullscreen:  disable fullscreen mode" << endl;
1120     cout << "\t--enable-fullscreen:  enable fullscreen mode" << endl;
1121     cout << "\t--shading-flat:  enable flat shading" << endl;
1122     cout << "\t--shading-smooth:  enable smooth shading" << endl;
1123     cout << "\t--disable-skyblend:  disable sky blending" << endl;
1124     cout << "\t--enable-skyblend:  enable sky blending" << endl;
1125     cout << "\t--disable-textures:  disable textures" << endl;
1126     cout << "\t--enable-textures:  enable textures" << endl;
1127     cout << "\t--disable-wireframe:  disable wireframe drawing mode" << endl;
1128     cout << "\t--enable-wireframe:  enable wireframe drawing mode" << endl;
1129     cout << "\t--geometry=WWWxHHH:  window geometry: 640x480, 800x600, etc."
1130          << endl;
1131     cout << "\t--view-offset=xxx:  set the default forward view direction"
1132          << endl;
1133     cout << "\t\tas an offset from straight ahead.  Allowable values are"
1134          << endl;
1135     cout << "\t\tLEFT, RIGHT, CENTER, or a specific number of degrees" << endl;
1136     cout << "\t--visibility=xxx:  specify initial visibility in meters" << endl;
1137     cout << "\t--visibility-miles=xxx:  specify initial visibility in miles"
1138          << endl;
1139     cout << endl;
1140
1141     cout << "Scenery Options:" << endl;
1142     cout << "\t--tile-radius=n:  specify tile radius, must be 1 - 4" << endl;
1143     cout << endl;
1144
1145     cout << "Hud Options:" << endl;
1146     cout << "\t--units-feet:  Hud displays units in feet" << endl;
1147     cout << "\t--units-meters:  Hud displays units in meters" << endl;
1148     cout << "\t--hud-tris:  Hud displays number of triangles rendered" << endl;
1149     cout << "\t--hud-culled:  Hud displays percentage of triangles culled"
1150          << endl;
1151     cout << endl;
1152         
1153     cout << "Time Options:" << endl;
1154     cout << "\t--time-offset=[+-]hh:mm:ss: add this time offset" << endl;
1155     cout << "\t--time-match-real: Synchronize real-world and FlightGear" << endl
1156          << "\t\ttime. Can be used in combination with --time-offset." << endl;
1157     cout << "\t--time-match-local:Synchronize local real-world and " << endl
1158          << "\t\tFlightGear time" << endl;   
1159     cout << "\t--start-date-sys=yyyy:mm:dd:hh:mm:ss: specify a starting" << endl
1160          << "\t\tdate/time. Uses your system time " << endl;
1161     cout << "\t--start-date-gmt=yyyy:mm:dd:hh:mm:ss: specify a starting" << endl
1162          << "\t\tdate/time. Uses Greenwich Mean Time" << endl;
1163     cout << "\t--start-date-lat=yyyy:mm:dd:hh:mm:ss: specify a starting" << endl
1164          << "\t\tdate/time. Uses Local Aircraft Time" << endl;
1165 #ifdef FG_NETWORK_OLK
1166     cout << endl;
1167
1168     cout << "Network Options:" << endl;
1169     cout << "\t--enable-network-olk:  enable Multipilot mode" << endl;
1170     cout << "\t--disable-network-olk:  disable Multipilot mode (default)" << endl;
1171     cout << "\t--net-hud:  Hud displays network info" << endl;
1172     cout << "\t--net-id=name:  specify your own callsign" << endl;
1173 #endif
1174
1175     cout << endl;
1176     cout << "Route/Way Point Options:" << endl;
1177     cout << "\t--wp=ID[@alt]:  specify a waypoint for the GC autopilot" << endl;
1178     cout << "\t\tYou can specify multiple waypoints (a route) with multiple"
1179          << endl;
1180     cout << "\t\tinstances of --wp=" << endl;
1181     cout << "\t--flight-plan=[file]: Read all waypoints from [file]" <<endl;
1182 }