Ejemplo n.º 1
0
        double HeightAngle3Calc()
        {
            double at     = CMBaseGeoPoint.RadToDegree(Math.Atan(HeightAngle));
            double result = Math.Tan(CMBaseGeoPoint.DegreeToRad(at - ((at / 90) * CMBaseGeoPoint.RadToDegree(Math.Atan(HeightAngle3)))));

            return(result);
        }
Ejemplo n.º 2
0
        void LoadData1()
        {
            Lat_GrVal.Value  = (decimal)CMBaseGeoPoint.GetDegree(mCheckedGeoPoint.Lat);
            Lat_MinVal.Value = (decimal)CMBaseGeoPoint.GetMinutes(mCheckedGeoPoint.Lat);
            Lat_SecVal.Value = (decimal)CMBaseGeoPoint.GetSeconds(mCheckedGeoPoint.Lat);

            Lng_GrVal.Value  = (decimal)CMBaseGeoPoint.GetDegree(mCheckedGeoPoint.Lng);
            Lng_MinVal.Value = (decimal)CMBaseGeoPoint.GetMinutes(mCheckedGeoPoint.Lng);
            Lng_SecVal.Value = (decimal)CMBaseGeoPoint.GetSeconds(mCheckedGeoPoint.Lng);
        }
Ejemplo n.º 3
0
        void StartCheck(CMCheckedGeoPoint STpoint)
        {
            FillPointSpec(STpoint);

            //TODO - убрать в класс
            STpoint.WriteResultCheck(string.Format("Lat {0}; Lng {1}", CMBaseGeoPoint.ShowDegMiSec(STpoint.Lat), CMBaseGeoPoint.ShowDegMiSec(STpoint.Lng)));
            STpoint.WriteResultCheck(string.Format("Азимут {0}; Дальность {1}; Абсолютная высота {2}", STpoint.Angle.ToString(), STpoint.Distance.ToString(), STpoint.Height.ToString()));
            STpoint.WriteResultCheck(string.Format("X ={0}; Y ={1}", STpoint.Offset.Lat.ToString(), STpoint.Offset.Lng.ToString()));


            // Проверка плоскостей
            //Перевести все проверки к такому виду
            STpoint.AddData(APSurfaces.SurfaceA.CheckSurface(STpoint, APSurfaces.SurfaceB));               //горизонтальная
            STpoint.AddData(APSurfaces.SurfaceB.CheckSurface(STpoint, APSurfaces.SurfaceA));               //коническая
            STpoint.AddData(APSurfaces.SurfaceC.CheckSurface(STpoint, APSurfaces.SurfaceB));               //круглая
            STpoint.AddData(APSurfaces.SurfaceOuterHorizontal.CheckSurface(STpoint, APSurfaces.SurfaceB)); //круглая
            STpoint.AddData(APSurfaces.SurfaceE.CheckSurface(STpoint, APSurfaces.SurfaceC));               //круглая
            STpoint.AddData(APSurfaces.SurfaceD.CheckSurface(STpoint, APSurfaces.SurfaceE));               //круглая

            STpoint.AddData(APSurfaces.SurfaceNoiseG.CheckSurface(STpoint));                               //Эллипс
            STpoint.AddData(APSurfaces.SurfaceNoiseV.CheckSurface(STpoint, APSurfaces.SurfaceNoiseG));     //Эллипс
            STpoint.AddData(APSurfaces.SurfaceNoiseB.CheckSurface(STpoint, APSurfaces.SurfaceNoiseV));     //Эллипс

            STpoint.AddData(APSurfaces.ApproachSurface.CheckSurface(STpoint));
            STpoint.AddData(APSurfaces.TakeoffSurface.CheckSurface(STpoint));
            STpoint.AddData(APSurfaces.TakeoffSurfaceInfo.CheckSurface(STpoint));

            STpoint.AddData(APSurfaces.InnerApproachSurface.CheckSurface(STpoint));
            STpoint.AddData(APSurfaces.CancelledApproachSurface.CheckSurface(STpoint, STpoint.Offset.Lat));
            STpoint.AddData(APSurfaces.InnerTransitionSurface.CheckSurface(STpoint, APSurfaces.InnerApproachSurface, APSurfaces.CancelledApproachSurface));
            STpoint.AddData(APSurfaces.TransitionSurface.CheckSurface(STpoint));
            STpoint.AddData(APSurfaces.APPVP_B.CheckSurface(STpoint));

            //Перевести все проверки к такому виду

            TextResult.Text += TextResult.Text.Length > 0 ? Environment.NewLine + "***********************************" + Environment.NewLine : "";
            TextResult.Text += STpoint.ResultCheck + Environment.NewLine;
            TextResult.Text += STpoint.CheckResult() + Environment.NewLine;

            mCheckedGeoPoin.Add(STpoint);
            rtxtDotDescription.Text  = STpoint.ResultCheck + Environment.NewLine;
            rtxtDotDescription.Text += STpoint.CheckResult();

            GMap.NET.WindowsForms.Markers.GMarkerGoogle marker = STpoint.GetGMarkerGoogle(GMap.NET.WindowsForms.Markers.GMarkerGoogleType.green);
            //marker.ToolTipText = STpoint.ResultCheck;

            marker.Tag = new CMBaseGeoPoint(STpoint.GeoDotType, mCheckedGeoPoin.Count - 1);
            polyOverlay.Markers.Add(marker);

            listBox1.Items.Add(STpoint.GetCaption());
        }
Ejemplo n.º 4
0
        private void btnFileOpen_Click(object sender, EventArgs e)
        {
            if (openFileDialog1.ShowDialog() == System.Windows.Forms.DialogResult.OK)
            {
                string FileName = openFileDialog1.FileName;
                if (File.Exists(FileName))
                {
                    FileStream   FS = new FileStream(FileName, FileMode.Open, FileAccess.Read, FileShare.Read);
                    StreamReader sr = new StreamReader(FS, Encoding.Default);
                    btnClear_Click(sender, e);

                    while (sr.EndOfStream == false)
                    {
                        string sGeoPoint;
                        sGeoPoint = sr.ReadLine();

                        MatchCollection coll;
                        Regex           rStr = new Regex("^(?<PointName>[а-яА-Яa-zA-Z0-9 ]*)[;](?<LatDegree>[0-9]*)[;](?<LatMinutes>[0-9]*)[;](?<LatSeconds>[0-9.,]*)[;](?<LngDegree>[0-9]*)[;](?<LngMinutes>[0-9]*)[;](?<LngSeconds>[0-9.,]*)[;](?<Height>[0-9.,]*)[;](?<Description>[а-яА-Яa-zA-Z0-9 ]*)$");

                        coll = rStr.Matches(sGeoPoint);
                        if (coll.Count <= 0)
                        {
                            rStr = new Regex("^(?<PointName>[а-яА-Яa-zA-Z0-9 ]*)[;](?<LatDegree>[0-9]*)[;](?<LatMinutes>[0-9]*)[;](?<LatSeconds>[0-9.,]*)[;](?<LngDegree>[0-9]*)[;](?<LngMinutes>[0-9]*)[;](?<LngSeconds>[0-9.,]*)[;](?<X>[-0-9.,]*)[;](?<Y>[-0-9.,]*)[;](?<Angle>[-0-9.,]*)[;](?<Distance>[-0-9.,]*)[;](?<Height>[0-9.,]*)[;](?<Description>[а-яА-Яa-zA-Z0-9 ]*)$");

                            coll = rStr.Matches(sGeoPoint);
                        }

                        if (coll.Count > 0)
                        {
                            CMCheckedGeoPoint CheckedGeoPoint = new CMCheckedGeoPoint(enumGeoPointType.geoptObstacleDot);
                            CheckedGeoPoint.Text        = coll[0].Groups["PointName"].ToString();
                            CheckedGeoPoint.Height      = Convert.ToDouble(coll[0].Groups["Height"].ToString());
                            CheckedGeoPoint.Description = coll[0].Groups["Description"].ToString();
                            CheckedGeoPoint.Lat         = CMBaseGeoPoint.ShowDegreeFraction(Convert.ToDouble(coll[0].Groups["LatDegree"].ToString()), Convert.ToDouble(coll[0].Groups["LatMinutes"].ToString()), Convert.ToDouble(coll[0].Groups["LatSeconds"].ToString()));
                            CheckedGeoPoint.Lng         = CMBaseGeoPoint.ShowDegreeFraction(Convert.ToDouble(coll[0].Groups["LngDegree"].ToString()), Convert.ToDouble(coll[0].Groups["LngMinutes"].ToString()), Convert.ToDouble(coll[0].Groups["LngSeconds"].ToString()));

                            StartCheck(CheckedGeoPoint);
                        }
                    }

                    sr.Close();
                    FS.Close();
                    FS = null;
                }
            }
        }
Ejemplo n.º 5
0
        private void btnFileSave_Click(object sender, EventArgs e)
        {
            if (mCheckedGeoPoin.Count > 0)
            {
                if (saveFileDialog1.ShowDialog() == System.Windows.Forms.DialogResult.OK)
                {
                    string FileName = saveFileDialog1.FileName;

                    StreamWriter sw = new StreamWriter(FileName, false, Encoding.Default);

                    sw.WriteLine("PointName;LatDegree;LatMinutes;LatSeconds;LngDegree;LngMinutes;LngSeconds;X;Y;Angle;Distance;Height;Description");

                    for (int i = 0; i < mCheckedGeoPoin.Count; i++)
                    {
                        string sGeoPoint;
                        //sGeoPoint = string.Format("{0};{1};{2}", ((CLMGeo.CMGeoPoint)(mCheckedGeoPoin[0])).Lat, ((CLMGeo.CMGeoPoint)(mCheckedGeoPoin[0])).Lng, ((CLMGeo.CMGeoPoint)(mCheckedGeoPoin[0])).Height);

                        sGeoPoint = string.Format("{0};{1};{2};{3};{4};{5};{6};{7};{8};{9};{10};{11};{12}",
                                                  ((CLMGeo.CMCheckedGeoPoint)(mCheckedGeoPoin[i])).Text
                                                  , CMBaseGeoPoint.GetDegree(((CLMGeo.CMCheckedGeoPoint)(mCheckedGeoPoin[i])).Lat)
                                                  , CMBaseGeoPoint.GetMinutes(((CLMGeo.CMCheckedGeoPoint)(mCheckedGeoPoin[i])).Lat)
                                                  , CMBaseGeoPoint.GetSeconds(((CLMGeo.CMCheckedGeoPoint)(mCheckedGeoPoin[i])).Lat)
                                                  , CMBaseGeoPoint.GetDegree(((CLMGeo.CMCheckedGeoPoint)(mCheckedGeoPoin[i])).Lng)
                                                  , CMBaseGeoPoint.GetMinutes(((CLMGeo.CMCheckedGeoPoint)(mCheckedGeoPoin[i])).Lng)
                                                  , CMBaseGeoPoint.GetSeconds(((CLMGeo.CMCheckedGeoPoint)(mCheckedGeoPoin[i])).Lng)
                                                  , mCheckedGeoPoin[i].Offset.Lat
                                                  , mCheckedGeoPoin[i].Offset.Lng
                                                  , mCheckedGeoPoin[i].Angle
                                                  , mCheckedGeoPoin[i].Distance
                                                  , ((CLMGeo.CMGeoPoint)(mCheckedGeoPoin[i])).Height
                                                  , ((CLMGeo.CMCheckedGeoPoint)(mCheckedGeoPoin[i])).Description
                                                  );
                        sw.WriteLine(sGeoPoint);
                        TextResult.Text += sGeoPoint + " \r\n";
                    }
                    sw.Close();
                }
            }
            //
        }
Ejemplo n.º 6
0
        void testproc()
        {
            //показать на карте точки, которые образуют данный полигон


            //GetAsimut( APInf.CRW.RunwayEnd, APInf.CRW.RunwayBegin);
            //GetAsimut(APInf.CRW.RunwayBegin, APInf.CRW.RunwayEnd);


            //CMGeoPoint FinishPoint = CMGeoBase.GetCoordinate(new CMGeoPoint(enumGeoPointType.geoptControlDot, 43.389269, 132.130642, 9.87, "07R"), CMBaseGeoPoint.ShowDegreeFraction(61, 1, 30), 3502.54);

            ////CMGeoPoint FinishPoint = GetCoordinate(new CMGeoPoint(enumGeoPointType.geoptControlDot, 43.389269, 132.130642, 9.87, "07R"), CMBaseGeoPoint.ShowDegreeFraction(61, 1, 30), 3502.54);
            //////CMGeoPoint FinishPoint = GetCoordinate(new CMGeoPoint(enumGeoPointType.geoptControlDot, CMBaseGeoPoint.ShowDegreeFraction(42, 0, 10.5), CMBaseGeoPoint.ShowDegreeFraction(105, 47, 19.4567), 14.8, "КТА"), CMBaseGeoPoint.ShowDegreeFraction(48, 18, 03.4), 25258.87);
            //TextResult.Text  =  string.Format ("{0} --- {1}",CMBaseGeoPoint.ShowDegMiSec(FinishPoint.Coordinates.Lat),CMBaseGeoPoint.ShowDegMiSec(FinishPoint.Coordinates.Lng));

            //TextResult.Text  += string.Format("{0}",CMGeoBase.GetDistance(APInf.CRW.RunwayBegin,APInf.CRW.RunwayEnd));

            TextResult.Text += string.Format("Начало ВПП {0}  {1}", CMBaseGeoPoint.ShowDegMiSec(APInf.CRW.RunwayBegin.Coordinates.Lat), CMBaseGeoPoint.ShowDegMiSec(APInf.CRW.RunwayBegin.Coordinates.Lng)) + " \r\n";
            TextResult.Text += string.Format("Конец ВПП {0}  {1}", CMBaseGeoPoint.ShowDegMiSec(APInf.CRW.RunwayEnd.Coordinates.Lat), CMBaseGeoPoint.ShowDegMiSec(APInf.CRW.RunwayEnd.Coordinates.Lng)) + " \r\n";



            //TextResult.Text += string.Format(" {0} ", GetAsimut(APInf.CRW.RunwayEnd, APInf.CRW.RunwayBegin)) + " \r\n";

            TextResult.Text += string.Format("Расстояние <=> {0} ", CMGeoBase.GetDistance(APInf.CRW.RunwayBegin, APInf.CRW.RunwayEnd)) + " \r\n";


            TextResult.Text += string.Format("А1 с К-> Н {0} ", CMBaseGeoPoint.ShowDegMiSec(CMGeoBase.GetAsimut(APInf.CRW.RunwayEnd, APInf.CRW.RunwayBegin, 0))) + " \r\n";
            TextResult.Text += string.Format("А2 с К-> Н {0} ", CMBaseGeoPoint.ShowDegMiSec(CMGeoBase.GetAsimut(APInf.CRW.RunwayEnd, APInf.CRW.RunwayBegin, 1))) + " \r\n";

            TextResult.Text += string.Format("А1 с Н-> К {0} ", CMBaseGeoPoint.ShowDegMiSec(CMGeoBase.GetAsimut(APInf.CRW.RunwayBegin, APInf.CRW.RunwayEnd, 0))) + " \r\n";
            TextResult.Text += string.Format("А2 с Н-> К {0} ", CMBaseGeoPoint.ShowDegMiSec(CMGeoBase.GetAsimut(APInf.CRW.RunwayBegin, APInf.CRW.RunwayEnd, 1))) + " \r\n";

            TextResult.Text += string.Format("Аold с Н-> К {0} ", CMBaseGeoPoint.ShowDegMiSec(CMGeoBase.Azimut(APInf.CRW.RunwayBegin.Coordinates, APInf.CRW.RunwayEnd.Coordinates))) + " \r\n";
            TextResult.Text += string.Format("Аold с К-> Н {0} ", CMBaseGeoPoint.ShowDegMiSec(CMGeoBase.Azimut(APInf.CRW.RunwayEnd.Coordinates, APInf.CRW.RunwayBegin.Coordinates))) + " \r\n";
        }
Ejemplo n.º 7
0
 /// <summary>
 /// Show Simple view
 /// </summary>
 /// <returns>string data</returns>
 public string ShowSimple()
 {
     //return String.Format("{0}°{1}'{2}''", this.Gr, this.Min, this.Sec);
     return(CMBaseGeoPoint.ShowDegMiSec(this.Degree, this.Minutes, this.Seconds));
 }
Ejemplo n.º 8
0
 /// <summary>
 /// Show full view
 /// </summary>
 /// <returns>double data</returns>
 public double ShowFull()
 {
     //return FullView;
     return(CMBaseGeoPoint.ShowDegreeFraction(Degree, Minutes, Seconds));
 }
Ejemplo n.º 9
0
        double HeightAngle2Calc()
        {
            double at = CMBaseGeoPoint.RadToDegree(Math.Atan(HeightAngle));

            return(Math.Tan(CMBaseGeoPoint.DegreeToRad(at - ((at / 90) * CMBaseGeoPoint.RadToDegree(Math.Atan(HeightAngle2))))));
        }
Ejemplo n.º 10
0
 void SaveData1()
 {
     CheckedGeoPoint.Lat = CMBaseGeoPoint.ShowDegreeFraction((double)Lat_GrVal.Value, (double)Lat_MinVal.Value, (double)Lat_SecVal.Value);
     CheckedGeoPoint.Lng = CMBaseGeoPoint.ShowDegreeFraction((double)Lng_GrVal.Value, (double)Lng_MinVal.Value, (double)Lng_SecVal.Value);
 }
Ejemplo n.º 11
0
 private void gmaper_MouseMove(object sender, MouseEventArgs e)
 {
     lblCurPosition.Text = string.Format("{0} {1}", CMBaseGeoPoint.ShowDegMiSec(gmaper.FromLocalToLatLng(e.X, e.Y).Lat), CMBaseGeoPoint.ShowDegMiSec(gmaper.FromLocalToLatLng(e.X, e.Y).Lng));
 }
Ejemplo n.º 12
0
        private void LoadAPInf()
        {
            APInf.AirfieldHeight = 17.87;
            APInf.KTA            = new CMGeoPoint(enumGeoPointType.geoptControlDot, 43.398056, 132.148889, 14.8, "КТА");

            APInf.Runways.Add(new CMAPRunway("ВПП1", 3502.54, 60, new CMRunwayThreshold(enumGeoPointType.geoptRunwayThreshold, 43.389269, 132.130642, 9.87, CMBaseGeoPoint.ShowDegreeFraction(61, 0, 44), 71, "07R", 16.5), new CMRunwayThreshold(enumGeoPointType.geoptRunwayThreshold, 43.404542, 132.168464, 13.30, CMBaseGeoPoint.ShowDegreeFraction(241, 2, 18), 251, "25L", 16.0)));
            APInf.Runways.Add(new CMAPRunway("ВПП2", 3503.23, 60, new CMRunwayThreshold(enumGeoPointType.geoptRunwayThreshold, 43.391319, 132.129086, 9.67, CMBaseGeoPoint.ShowDegreeFraction(61, 2, 56), 71, "07L", 16.5), new CMRunwayThreshold(enumGeoPointType.geoptRunwayThreshold, 43.406583, 132.166925, 9.79, CMBaseGeoPoint.ShowDegreeFraction(241, 2, 56), 251, "25R", 16.0)));

            cmbListCoursesLA.Items.AddRange(APInf.Runways.GetArrListCoursesLA());
            cmbListCoursesLA.SelectedIndex = 1;
        }