]> git.mxchange.org Git - flightgear.git/commitdiff
Melchior FRANZ:
authorehofman <ehofman>
Sun, 15 Aug 2004 14:37:42 +0000 (14:37 +0000)
committerehofman <ehofman>
Sun, 15 Aug 2004 14:37:42 +0000 (14:37 +0000)
this was always only meant to be a test program for the metar lib, but now
that people are referring to it as a means to get metar reports, I think a
usage info is desirable. The list of test ids, on the other hand, isn't
necessary any more. This can still be handled by a Makefile or the commandline.
I'm all for keeping this tool in cvs, however. And also the not-used stuff
therein is a welcome source for how to use the SGMetar class.

src/Main/metar_main.cxx

index 4fdc9dd9599919934627e04a7ec0639cf654f5a0..616edc85b962adc2fced73b7d3fd56b319c2ec8f 100644 (file)
@@ -432,34 +432,19 @@ void printArgs(SGMetar *m, double airport_elevation)
 }
 
 
-
-
-
-const char *metar_list[] = {
-       "LOWW", "VHHH", "ULLI", "EHTW", "EFHK", "CYXU", 0, // note the trailing zero
-       "CYGK", "CYOW", "CYQY", "CYTZ", "CYXU", "EBBR", "EDDB", "EDDK", "EDVE", "EFHF",
-       "EFHK", "EGLC", "EGLL", "EHTW", "EIDW", "ENGM", "GMMN", "KART", "KBFI", "KBOS",
-       "KCCR", "KCEZ", "KCOF", "KDAL", "KDEN", "KDSM", "KEDW", "KEMT", "KENW", "KHON",
-       "KIGM", "KJFK", "KLAX", "KMCI", "KMKE", "KMLB", "KMSY", "KNBC", "KOAK", "KORD",
-       "KPNE", "KSAC", "KSAN", "KSEA", "KSFO", "KSJC", "KSMF", "KSMO", "KSNS", "KSQL",
-       "KSUN", "LBSF", "LEMD", "LFPG", "LFPO", "LGAT", "LHBP", "LIPQ", "LIRA", "LKPR",
-       "LLJR", "LOWG", "LOWI", "LOWK", "LOWL", "LOWS", "LOWW", "LOWZ", "LOXA", "LOXT",
-       "LOXZ", "LSZH", "LYBE", "NZWP", "ORBS", "PHNL", "ULLI", "VHHH", "WMKB", "YSSY",
-       0
-};
-
-
 int main(int argc, char *argv[])
 {
-       const char **src = metar_list;
-       if (argc > 1)
-               src = (const char **)&argv[1];
-
-       for (int i = 0; src[i]; i++) {
-               const char *icao = src[i];
+       if (argc <= 1) {
+               fprintf(stderr,
+                       "Usage:   metar <list of ICAO airport ids>\n"
+                       "Example: metar ksfo koak\n"
+               );
+               return 0;
+       }
 
+       for (int i = 1; i < argc; i++) {
                try {
-                       SGMetar *m = new SGMetar(icao);
+                       SGMetar *m = new SGMetar(argv[i]);
                        //SGMetar *m = new SGMetar("2004/01/11 01:20\nLOWG 110120Z AUTO VRB01KT 0050 1600N R35/0600 FG M06/M06 Q1019 88//////\n");
 
                        printf(G"INPUT: %s\n"N, m->getData());