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

            // decoding
            ENG.WMOCodes.Decoders.MetarDecoder metarDecoder = new ENG.WMOCodes.Decoders.MetarDecoder();
            ENG.WMOCodes.Codes.Metar           metar        = metarDecoder.Decode(sourceMetar);

            // formatting to short info with US culture
            ENG.WMOCodes.Formatters.ShortInfoFormatter.MetarFormatter metarFormatter =
                new ENG.WMOCodes.Formatters.ShortInfoFormatter.MetarFormatter();

            string str = metarFormatter.ToString(metar);

            Console.WriteLine(str);
            Console.ReadKey();
        }
Exemplo n.º 2
0
        private void btnShortInfo_Click(object sender, EventArgs e)
        {
            AddInfo("Performing short-info print...");

            ENG.WMOCodes.Codes.Metar mtr = GetMetar();

            if (mtr == null)
            {
                return;
            }

            ENG.WMOCodes.Formatters.ShortInfoFormatter.MetarFormatter formatter =
                new ENG.WMOCodes.Formatters.ShortInfoFormatter.MetarFormatter();

            string str = formatter.ToString(mtr);

            AddInfo(str);

            AddInfo("...done");
        }