Exemple #1
0
        private string DrawFix_Label()
        {
            // This will need to be offset based upon the hold pattern
            string result = string.Empty;
            string curFix = HoldFixTextBox.Text;
            double Lat1   = HoldLat;
            double Lon1   = HoldLon;

            result += Hershey.WriteHF(curFix, Lat1, Lon1, -1 * (int)MagVar);
            return(result);
        }
Exemple #2
0
        private string DrawFix_Symbol()
        {
            string result = string.Empty;
            string curFix = HoldFixTextBox.Text;

            object[] NavData;
            if (DrawFixSymbol)
            {
                NavData = SCTcommon.GetNavData(curFix);
                result += Hershey.DrawSymbol(NavData);
            }
            return(result);
        }
Exemple #3
0
        private void DrawButton_Click(object sender, EventArgs e)
        {
            string result = string.Empty;

            object[] NavData; string curFix;
            double   Lat1  = Conversions.DMS2Degrees(LatTextBox.Text, ".");
            double   Lon1  = Conversions.DMS2Degrees(LonTextBox.Text, ".");
            int      Brg   = Convert.ToInt32(BearingTextBox.Text) - 90;     // Rotation in addition to MagVar
            float    Scale = Convert.ToSingle(ScaleTextBox.Text);           // Scaling beyond internal 1/3600

            if (IncludeSymbolCheckBox.Checked && (FixListDataGridView.CurrentRow != null))
            {
                curFix  = FixListDataGridView.CurrentRow.Cells[0].Value.ToString();
                NavData = SCTcommon.GetNavData(curFix);
                result += Hershey.DrawSymbol(NavData);
            }
            result            += Hershey.WriteHF(LabelTextBox.Text, Lat1, Lon1, Brg, Scale);
            OutputTextBox.Text = result;
        }
Exemple #4
0
        private static string DrawFixInfo(List <string> FixNames, int Angle = 0, float Scale = 1f)
        {
            // Calling function for fixes in diagrams
            // Because labels and/or symbols might be drawn
            // Will need to add the DrawFixNames for ALT and SPEED here
            string result = string.Empty;
            float  Latitude;
            float  Longitude;

            float[] AdjustedCoords = null;
            foreach (string Fix in FixNames)
            {
                // FixInfo returns: 0-Fix (calling ID), 1-Freq, 2-Lat, 3-Lon, 4-Name or Use, 5-Type
                object[] FixData = SCTcommon.GetNavData(Fix);
                if ((FixData[5].ToString() != "NA") && (FixData[0].ToString().Length != 0))
                {
                    Latitude  = Convert.ToSingle(FixData[3]);
                    Longitude = Convert.ToSingle(FixData[4]);
                    if ((Latitude != 0) && (Longitude != 0))
                    {
                        if (InfoSection.DrawFixSymbolsOnDiagrams)
                        {
                            result        += Hershey.DrawSymbol(FixData);
                            AdjustedCoords = Hershey.Adjust(Latitude, Longitude, 15, -30);
                        }
                        if (InfoSection.DrawFixLabelsOnDiagrams)
                        {
                            if (!InfoSection.DrawFixSymbolsOnDiagrams)
                            {
                                AdjustedCoords = Hershey.Adjust(Latitude, Longitude, 5, 0);
                            }
                            result += Hershey.WriteHF(Fix, AdjustedCoords[0], AdjustedCoords[1], Angle, Scale);
                        }
                    }
                }
            }
            return(result);
        }