Beispiel #1
0
        private void btnGenerateClearance_Click(object sender, EventArgs e)
        {
            string ATISmessage = "";

            bool haveATIS = false;

            if (txtSquawk.Text.Length != 4)
            {
                MessageBox.Show("Squawk Invalid");
            }
            else
            {
                btnGenerateClearance.Enabled = false;
                string dest     = lblDestination.Text;
                string sid      = "";
                string squawk   = txtSquawk.Text;
                string infoATIS = "";

                if (cboxSID.SelectedItem != "NONE")
                {
                    sid = cboxSID.SelectedItem.ToString();
                }
                else
                {
                    sid = "After departure fly runway HDG";
                }

                foreach (var atc in App.ATCS)
                {
                    if (atc.callsign == App.ATCPosition.Split("_".ToCharArray())[0] + "_ATIS")
                    {
                        haveATIS    = true;
                        ATISmessage = atc.atis_message;
                    }
                }

                if (haveATIS)
                {
                    infoATIS = ManageStringCommands.GetAtisInfoLetter(ATISmessage);

                    lblTransfer.Text = String.Format("Information {0} is current. Cleared to {1}, {2}, initial climb FL60, squawk {3}.", infoATIS, dest, sid, squawk);
                }
                else
                {
                    string wind_info = ManageStringCommands.GetWindsString();

                    string rwy_suggested = ManageStringCommands.GetSuggestedRunway();

                    string initial_FL = ManageStringCommands.GetInitialFL();

                    string qnh = Metars.Metar(App.ATCPosition.Split("_".ToCharArray())[0]).Altimeter;

                    lblTransfer.Text = String.Format("{0}, {1}, QNH{2}. Cleared to {3}, {4}, {5}, squawk {6}.", wind_info, rwy_suggested, qnh, dest, sid, initial_FL, squawk);
                }

                btnGenerateClearance.Enabled  = true;
                btnAliasSendClearance.Enabled = true;
            }
        }
Beispiel #2
0
 public MainFrm()
 {
     InitializeComponent();
     Console.WriteLine("Populate Departure List...");
     PopulatePilotsList(App.Pilots);
     cboxTransferATC.SelectedIndex = 0;
     lblMetar.Text = Metars.Metar(App.ATCPosition.Split("_".ToCharArray())[0]).RawReport;
 }
Beispiel #3
0
        private void GetTrafficFromPosition_onClient(List <UI.Pilots> pilots, GeoCoordinate location)
        {
            Console.WriteLine("GetGlients Received...");
            Pilots      = pilots;
            ATCLocation = location;



            if (mainFrm == null)
            {
                Console.WriteLine("Prepare Form...");
                mainFrm = new MainFrm();

                mainFrm.Show();

                new Shows();
            }
            else
            {
                mainFrm.lblMetar.Text = Metars.Metar(App.ATCPosition.Split("_".ToCharArray())[0]).RawReport;
                Console.WriteLine("Update Departure List...");
                mainFrm.PopulatePilotsList(pilots);
            }
        }