Ejemplo n.º 1
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.º 2
0
 /// <summary>
 /// Show full view
 /// </summary>
 /// <returns>double data</returns>
 public double ShowFull()
 {
     //return FullView;
     return(CMBaseGeoPoint.ShowDegreeFraction(Degree, Minutes, Seconds));
 }
Ejemplo n.º 3
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.º 4
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;
        }