public void Setup()
 {
     DecodedMetarsNotStrict = TestMetarSource.Select(metar =>
                                                     MetarDecoder.ParseWithMode(metar, false)
                                                     ).ToList();
     DecodedMetarsStrict = TestMetarSource.Select(metar =>
                                                  MetarDecoder.ParseWithMode(metar, true)
                                                  ).ToList();
 }
        static void Main(string[] args)
        {
            var MetarDecoder = new MetarDecoder();

            MetarDecoder.SetStrictParsing(true);

            var options = new Options();

            if (Parser.Default.ParseArguments(args, options))
            {
                var decodedMetar = MetarDecoder.ParseWithMode(options.Metar);
                Display(decodedMetar);
            }
        }
예제 #3
0
 public void Setup()
 {
     DecodedMetars = TestMetarSource.Select(metar => MetarDecoder.ParseWithMode(metar)).ToList();
 }
예제 #4
0
        /// <summary>
        /// Retrieves a beautified string output of a METAR message
        /// </summary>
        /// <param name="rawMetar">The raw METAR.</param>
        /// <param name="strictMode">METAR strict decoding mode</param>
        /// <returns></returns>
        public static string GetWeatherMessage(string rawMetar, OutputType outputType = OutputType.Text, bool strictMode = true, bool showRawMetar = false, string htmlClass = "")
        {
            var decodedMetar = MetarDecoder.ParseWithMode(rawMetar, strictMode);

            return(decodedMetar.GetWeatherMessage(outputType, showRawMetar, htmlClass));
        }