Ejemplo n.º 1
0
        private void btnLongInfo_Click(object sender, EventArgs e)
        {
            AddInfo("Performing long-info print...");

            ENG.WMOCodes.Codes.Metar mtr = GetMetar();
            ENG.WMOCodes.Codes.Taf   taf = GetTaf();

            if (mtr != null)
            {
                ENG.WMOCodes.Formatters.InfoFormatter.MetarFormatter formatter =
                    new ENG.WMOCodes.Formatters.InfoFormatter.MetarFormatter();

                string str = formatter.ToString(mtr);

                AddInfo(" === METAR ===");
                AddInfo(str);
            }

            if (taf != null)
            {
                ENG.WMOCodes.Formatters.InfoFormatter.TafFormatter tafFormatter =
                    new ENG.WMOCodes.Formatters.InfoFormatter.TafFormatter();

                string str = tafFormatter.ToString(taf);

                AddInfo(" === TAF ===");
                AddInfo(str);
            }

            AddInfo("...done");
        }
Ejemplo n.º 2
0
        private static void PrintLongInfo()
        {
            string sourceMetar = "METAR LOWG 312320Z AUTO 00000KT 0200 R35/0650N R17/1200D BCFG 06/05 Q1010 RMK BASE S CLD004 N CLD007";

            ENG.WMOCodes.Codes.Metar           m   = null;
            ENG.WMOCodes.Decoders.MetarDecoder dec = new ENG.WMOCodes.Decoders.MetarDecoder();
            m = dec.Decode(sourceMetar);

            ENG.WMOCodes.Formatters.InfoFormatter.MetarFormatter mf = new ENG.WMOCodes.Formatters.InfoFormatter.MetarFormatter();

            string str = mf.ToString(m);

            Console.WriteLine(str);
            Console.ReadKey();
        }