예제 #1
0
        public WindData(string windString, WindAngleLimitsData metarWindAngleLimits)
        {
            if (metarWindAngleLimits != null)
            {
                IsAngleLimits = true;
                _angleLimits  = metarWindAngleLimits;
            }

            if (string.IsNullOrEmpty(windString))
            {
                return;
            }

            IsWind = true;

            if (windString.Substring(0, 5) == "00000")
            {
                IsCalm = true;
                GetMetarWindUnit(windString);
                return;
            }
            if (windString.Substring(0, 3) == "VRB")
            {
                IsVariable = true;
                GetMetarWindSpeed(windString);
                GetMetarWindUnit(windString);
                return;
            }

            GetMetarWindAngle(windString);
            GetMetarWindSpeed(windString);

            if (windString[5] == 'G')
            {
                IsWithGusts = true;
                GustsSpeed  = Convert.ToInt32(windString.Substring(6, 2));
            }

            GetMetarWindUnit(windString);
        }
예제 #2
0
        public WindData(string windString, WindAngleLimitsData metarWindAngleLimits)
        {
            if (metarWindAngleLimits != null)
            {
                IsAngleLimits = true;
                _angleLimits = metarWindAngleLimits;
            }

            if (string.IsNullOrEmpty(windString))
                return;

            IsWind = true;

            if (windString.Substring(0, 5) == "00000")
            {
                IsCalm = true;
                GetMetarWindUnit(windString);
                return;
            }
            if (windString.Substring(0, 3) == "VRB")
            {
                IsVariable = true;
                GetMetarWindSpeed(windString);
                GetMetarWindUnit(windString);
                return;
            }

            GetMetarWindAngle(windString);
            GetMetarWindSpeed(windString);

            if (windString[5] == 'G')
            {
                IsWithGusts = true;
                GustsSpeed = Convert.ToInt32(windString.Substring(6, 2));
            }

            GetMetarWindUnit(windString);
        }