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; } }
private void btnGenFIXALT_Click(object sender, EventArgs e) { lblTransfer.Text = String.Format("For your destination we need {0} altitude to approve your flight plan. Suggest FL{1} or FL{2}, report altitude requested", ManageStringCommands.getBetween(lblFlightLevelIsValid.Text, "be ", "!"), (Convert.ToInt32(lblFlightLevel.Text.Split("FL".ToCharArray())[lblFlightLevel.Text.Split("FL".ToCharArray()).Count() - 1]) - 10), (Convert.ToInt32(lblFlightLevel.Text.Split("FL".ToCharArray())[lblFlightLevel.Text.Split("FL".ToCharArray()).Count() - 1]) + 10)); btnAliasSendFIXALT.Visible = true; }