public static string GetSuggestedRunway()
        {
            string rwy_suggested = "";

            switch (App.ATCPosition.Split("_".ToCharArray())[0])
            {
            case "LPPT":
                if (Metars.Metar(App.ATCPosition.Split("_".ToCharArray())[0]).WindDirection != "VRB")
                {
                    if (Convert.ToInt32(Metars.Metar(App.ATCPosition.Split("_".ToCharArray())[0]).WindDirection) > 120 && Convert.ToInt32(Metars.Metar(App.ATCPosition.Split("_".ToCharArray())[0]).WindDirection) < 300)
                    {
                        rwy_suggested = "suggest Runway 21";
                    }
                    else
                    {
                        rwy_suggested = "suggest Runway 03";
                    }
                }
                else
                {
                    rwy_suggested = "suggest Runway 03";
                }

                break;
            }

            return(rwy_suggested);
        }
Пример #2
0
        public static void GetRunways()
        {
            App.mainFrm.cboxRunways.Items.Clear();

            switch (App.ATCPosition.Split("_".ToCharArray())[0])
            {
            case "LPPT":
                App.mainFrm.cboxRunways.Items.Add("03");
                App.mainFrm.cboxRunways.Items.Add("21");

                if (Metars.Metar(App.ATCPosition.Split("_".ToCharArray())[0]).WindDirection != "VRB")
                {
                    if (Convert.ToInt32(Metars.Metar(App.ATCPosition.Split("_".ToCharArray())[0]).WindDirection) > 120 && Convert.ToInt32(Metars.Metar(App.ATCPosition.Split("_".ToCharArray())[0]).WindDirection) < 300)
                    {
                        App.mainFrm.cboxRunways.SelectedIndex = 1;
                    }
                    else
                    {
                        App.mainFrm.cboxRunways.SelectedIndex = 0;
                    }
                }
                else
                {
                    App.mainFrm.cboxRunways.SelectedIndex = 0;
                }
                break;
            }
        }
        public static string GetWindsString()
        {
            string wind_info = "";


            if (Metars.Metar(App.ATCPosition.Split("_".ToCharArray())[0]).WindDirection != "VRB")
            {
                if (Metars.Metar(App.ATCPosition.Split("_".ToCharArray())[0]).WindVariableDir.Count == 0)
                {
                    if (Metars.Metar(App.ATCPosition.Split("_".ToCharArray())[0]).WindGust != "")
                    {
                        wind_info = String.Format("Winds {0} degrees {1} knots gusts {2} knots", Metars.Metar(App.ATCPosition.Split("_".ToCharArray())[0]).WindDirection, Metars.Metar(App.ATCPosition.Split("_".ToCharArray())[0]).WindSpeed, Metars.Metar(App.ATCPosition.Split("_".ToCharArray())[0]).WindGust);
                    }
                    else
                    {
                        wind_info = String.Format("Winds {0} degrees {1} knots", Metars.Metar(App.ATCPosition.Split("_".ToCharArray())[0]).WindDirection, Metars.Metar(App.ATCPosition.Split("_".ToCharArray())[0]).WindSpeed);
                    }
                }
                else
                {
                    if (Metars.Metar(App.ATCPosition.Split("_".ToCharArray())[0]).WindGust != "")
                    {
                        wind_info = String.Format("Winds variables between {0} and {1} degrees {2} knots gusts {3} knots", Metars.Metar(App.ATCPosition.Split("_".ToCharArray())[0]).WindVariableDir[0], Metars.Metar(App.ATCPosition.Split("_".ToCharArray())[0]).WindVariableDir[1], Metars.Metar(App.ATCPosition.Split("_".ToCharArray())[0]).WindSpeed, Metars.Metar(App.ATCPosition.Split("_".ToCharArray())[0]).WindGust);
                    }
                    else
                    {
                        wind_info = String.Format("Winds variables between {0} and {1} degrees {2} knots", Metars.Metar(App.ATCPosition.Split("_".ToCharArray())[0]).WindVariableDir[0], Metars.Metar(App.ATCPosition.Split("_".ToCharArray())[0]).WindVariableDir[1], Metars.Metar(App.ATCPosition.Split("_".ToCharArray())[0]).WindSpeed);
                    }
                }
            }
            else
            {
                wind_info = String.Format("Winds variables {0} knots", Metars.Metar(App.ATCPosition.Split("_".ToCharArray())[0]).WindSpeed);
            }


            return(wind_info);
        }