Ejemplo n.º 1
0
        private static void ParseXForecast(XElement xForecast, List <AbstractParameter> parameters)
        {
            var xPhenomena = xForecast.Element("PHENOMENA");

            parameters.Add(Cloudiness.FromRange(
                               xPhenomena.Attribute("cloudiness").Value, maxClouds));
            parameters.Add(PrecipitationKind.FromGismeteoBased(
                               xPhenomena.Attribute("precipitation").Value));

            var xPres = xForecast.Element("PRESSURE");

            parameters.Add(new Pressure(
                               xPres.Attribute("max").Value));
            parameters.Add(new Pressure(
                               xPres.Attribute("min").Value));

            var xTemp = xForecast.Element("TEMPERATURE");

            parameters.Add(new Temperature(
                               xTemp.Attribute("max").Value));
            parameters.Add(new Temperature(
                               xTemp.Attribute("min").Value));

            var xWind = xForecast.Element("WIND");

            parameters.Add(WindDirection.FromRange(
                               xWind.Attribute("direction").Value, maxWindDir));
            parameters.Add(new WindSpeed(
                               xWind.Attribute("max").Value));
            parameters.Add(new WindSpeed(
                               xWind.Attribute("min").Value));

            var xHum = xForecast.Element("RELWET");

            parameters.Add(new Humidity(
                               xHum.Attribute("max").Value));
            parameters.Add(new Humidity(
                               xHum.Attribute("min").Value));
        }