Beispiel #1
0
        private void SendDivertReport()
        {
            string icao = divertAirportCombo.Text;

            if (icao == "")
            {
                MessageBox.Show("You must enter ICAO of the airport you diverted to");
                return;
            }
            string comment = this.reasonTxt.Text;

            if (comment == "")
            {
                MessageBox.Show("You must enter the reason for divert");
                return;
            }

            FlightEvent blockOn          = FlightTracking.GetFlightEvent("BlockOn");
            TimeSpan    duration         = AcarsBuilder.duration;
            string      durationString   = duration.Hours.ToString("00") + ":" + duration.Minutes.ToString("00") + ":" + duration.Seconds.ToString("00");
            bool        sendDivertResult = Connector.SendDivertReport(icao, comment, pirepId, blockOn.latitude, blockOn.longitude, durationString);

            if (sendDivertResult)
            {
                MessageBox.Show("Divert report has been sent. It is safe to close Šemík now.");
                this.Close();
            }
            else
            {
                MessageBox.Show("Divert report has not been sent. You can try again or see log for details of the error. Contact support if the problem continues.");
            }
        }
Beispiel #2
0
        private void ShowDivert()
        {
            this.tabControl.TabPages.Add(this.tabDivert);
            this.tabControl.SelectedTab = this.tabDivert;
            string message = "It appears you have not landed on destination airport " + FlightTracking.flightInit.arrival + ".\n";

            message += "You can create a divert report here to complete the divert. The report will be sent to the airline staff to approve. Once approved, the flight be logged as diverted, allowing you to continue from the airport, to which you have diverted.";
            this.divertMessageTxt.Text = message;
            FlightEvent blockOn      = FlightTracking.GetFlightEvent("BlockOn");
            XmlNodeList airports     = Connector.GetNearestAirport(blockOn.latitude, blockOn.longitude);
            string      errorMessage = "It appears you didn`t land on an airport at all. You can still submit a report, but in the text be more specific about what had happened during your flight.";

            if (airports == null)
            {
                MessageBox.Show(errorMessage);
            }
            else
            {
                if (airports.Count > 0)
                {
                    this.divertAirportCombo.Items.Clear();
                    for (int i = 0; i < airports.Count; i++)
                    {
                        XmlElement airport = (XmlElement)airports[i];
                        this.divertAirportCombo.Items.Add(airport.GetAttribute("icao"));
                    }
                    this.divertAirportCombo.SelectedItem = this.divertAirportCombo.Items[0];
                }
                else
                {
                    MessageBox.Show(errorMessage);
                }
            }
        }
Beispiel #3
0
 private void btnModeLanding_Click(object sender, EventArgs e)
 {
     if (FlightTracking.fsData.onGround)
     {
         return;
     }
     Logger.Log("Manual mode change - Landing");
     FlightTracking.changeFlightMode(7, true);
 }
Beispiel #4
0
        public void CreateTracking()
        {
            this.eventsGrid.Rows.Clear();
            this.messagesGrid.Rows.Clear();
            this.acarsTree.Nodes.Clear();
            FlightInit fi = mainForm.fplForm.InitFlight();

            FlightTracking.Create(fi, mainForm.fsData, this, mainForm.pilot);
            FlightTracking.Start();
            disableButtons();
        }
Beispiel #5
0
        private void button8_Click(object sender, EventArgs e)
        {
            // cancel
            Logger.Log("Manual tracking cancelation");
            DialogResult res = MessageBox.Show("Do you really wish to cancel current flight?", "Really cancel?", MessageBoxButtons.YesNo, MessageBoxIcon.Question);

            if (res == DialogResult.Yes)
            {
                FlightTracking.FinishTracking(true);
            }
        }
Beispiel #6
0
 private void button2_Click(object sender, EventArgs e)
 {
     FlightTracking.endFlight();
 }
Beispiel #7
0
 private void button7_Click(object sender, EventArgs e)
 {
     // departure
     Logger.Log("Manual mode change - Departure");
     FlightTracking.changeFlightMode(2, true);
 }