예제 #1
0
        private string OutputText(string Lat0, string Lon0, string Lat1, string Lon1)
        {
            string result = string.Empty;

            if ((Lat0.Length > 0) && (Lon0.Length > 0) && (Lat1.Length > 0) && (Lon1.Length > 0))
            {
                switch (SectionComboBox.SelectedIndex)
                {
                case 0:             // SIDSTAR
                    result = SCTstrings.SSDout(Lat0, Lon0, Lat1, Lon1) + cr;
                    break;

                case 1:             // ARTCC
                    result = SCTstrings.BoundaryOut(PrefixTextBox.Text, Lat0, Lon0, Lat1, Lon1) + cr;
                    break;

                case 2:             // Airway (prefix textbox req'd)
                    result = SCTstrings.AWYout(PrefixTextBox.Text, Lat0, Lon0, Lat1, Lon1, "", "") + cr;
                    break;

                case 3:             // GEO format
                    result = SCTstrings.GeoOut(Lat0, Lon0, Lat1, Lon1, ColorValueTextBox.Text) + cr;
                    break;
                }
            }
            return(result);
        }
예제 #2
0
        private void AddLine()
        {
            // Purpose - to Output a series of lines based upon user options
            // RETURNS - Nothing; writes a string to the Output Textbox
            string cr = Environment.NewLine;
            string Msg;

            // Create the list of points for the line (if not dashed, returns original points)
            string[] strOut = new string[4];
            strOut[0] = strOut[1] = strOut[2] = strOut[3] = string.Empty;
            double[][] Lines = DashedLine(DashedLineRadioButton.Checked);
            if (SSDRadioButton.Checked)
            {
                foreach (double[] Line in Lines)
                {
                    if (Line[0] == -1)
                    {
                        strOut[2] = string.Empty; strOut[3] = string.Empty;
                    }
                    else
                    {
                        strOut[2] = Conversions.Degrees2SCT(Line[0], true);
                        strOut[3] = Conversions.Degrees2SCT(Line[1], false);
                    }
                    if ((strOut[0].Length != 0) && (strOut[2].Length != 0))
                    {
                        switch (OutputType)
                        {
                        case "SSD":
                            OutputTextBox.Text += SCTstrings.SSDout(strOut[0], strOut[1],
                                                                    strOut[2], strOut[3]) + cr;
                            break;

                        case "AWY":
                            if (PrefixTextBox.TextLength != 0)
                            {
                                OutputTextBox.Text += SCTstrings.AWYout(PrefixTextBox.Text, strOut[0], strOut[1],
                                                                        strOut[2], strOut[3], StartFixTextBox.Text, EndFixTextBox.Text) + cr;
                            }
                            else
                            {
                                Msg = "The Airway identifier is required for this format." + cr + "(Place in the prefix text box.)";
                                SCTcommon.SendMessage(Msg);
                                PrefixTextBox.Focus();
                            }
                            break;

                        case "ARTCC":
                            if (PrefixTextBox.TextLength != 0)
                            {
                                OutputTextBox.Text += SCTstrings.BoundaryOut(PrefixTextBox.Text, strOut[0], strOut[1],
                                                                             strOut[2], strOut[3]);
                                if (SuffixTextBox.TextLength != 0)
                                {
                                    OutputTextBox.Text += SuffixTextBox.Text;
                                }
                                OutputTextBox.Text += cr;
                            }
                            else
                            {
                                Msg = "The ARTCC identifier is required for this format." + cr + "(Place in the prefix text box.)";
                                SCTcommon.SendMessage(Msg);
                                PrefixTextBox.Focus();
                            }
                            break;

                        case "GEO":
                            OutputTextBox.Text += SCTstrings.GeoOut(strOut[0], strOut[1],
                                                                    strOut[2], strOut[3], SuffixTextBox.Text) + cr;
                            break;
                        }
                    }
                    strOut[0] = strOut[2]; strOut[1] = strOut[3];
                }
            }
        }