Exemple #1
0
        public void ReplacePOI(int index, POIPoints pnt)
        {
            poi_list.ElementAt(index).name     = pnt.name;
            poi_list.ElementAt(index).lat      = pnt.lat;
            poi_list.ElementAt(index).lon      = pnt.lon;
            poi_list.ElementAt(index).alt      = pnt.alt;
            poi_list.ElementAt(index).cam_alt  = pnt.cam_alt;
            poi_list.ElementAt(index).elev     = pnt.elev;
            poi_list.ElementAt(index).selected = pnt.selected;
            poi_list.ElementAt(index).visible  = pnt.visible;

            /*
             * int count = 0;
             * LinkedListNode<POIPoints> node = poi_list.First;
             * LinkedListNode<POIPoints> next_node;
             * while (node != null)
             * {
             *  next_node = node.Next;
             *  if (count == index)
             *  {
             *
             *      poi_list.AddBefore(node, pnt);
             *      next_node = node.Next;
             *      poi_list.Remove(node);
             *      break;
             *  }
             *  count++;
             *  node = next_node;
             * }
             */
        }
Exemple #2
0
        public void UnselectAll()
        {
            // Unselect All Paths, including Waypoints

            for (int i = 0; i < PathCount(); i++)
            {
                Path path = PathAt(i);
                path.selected = false;
                LinkedList <WayPoints> wp_list = path.waypoints;
                for (int j = 0; j < wp_list.Count; j++)
                {
                    wp_list.ElementAt(j).selected = false;
                }
            }
            // All Shapes

            for (int i = 0; i < ShapeCount(); i++)
            {
                Shape shape = ShapeAt(i);
                shape.selected = false;
            }

            // All POIs

            for (int i = 0; i < POICount(); i++)
            {
                POIPoints pnt = POIPointAt(i);
                pnt.selected = false;
            }
        }
Exemple #3
0
        public void ReadPOI()
        {
            // Read POI File

            ClearPOI();
            if (File.Exists("waypoint_path_generator.poi"))
            {
                System.IO.StreamReader file = new System.IO.StreamReader("c:\\tmp\\waypoint_path_generator.poi");
                int       count             = 0;
                string    line;
                POIPoints poipoint = new POIPoints();

                while ((line = file.ReadLine()) != null)
                {
                    var items = line.Split(',');
                    poipoint.name    = items[0];
                    poipoint.lat     = Convert.ToDouble(items[1]);
                    poipoint.lon     = Convert.ToDouble(items[2]);
                    poipoint.elev    = Convert.ToDouble(items[3]);
                    poipoint.alt     = Convert.ToDouble(items[4]);
                    poipoint.cam_alt = Convert.ToDouble(items[5]);

                    AddPOI(poipoint);
                    count++;
                }

                file.Close();
            }
        }
Exemple #4
0
 public void AddPOIId(int id, POIPoints poipoint)
 {
     poipoint.internal_id = id;
     if (id > _internal_id)
     {
         _internal_id = id;
     }
     poi_list.AddLast(poipoint);
 }
Exemple #5
0
 public void POIReplace(int index, POIPoints newpoint)
 {
     poi_list.ElementAt(index).name     = newpoint.name;
     poi_list.ElementAt(index).lat      = newpoint.lat;
     poi_list.ElementAt(index).lon      = newpoint.lon;
     poi_list.ElementAt(index).alt      = newpoint.alt;
     poi_list.ElementAt(index).elev     = newpoint.elev;
     poi_list.ElementAt(index).cam_alt  = newpoint.cam_alt;
     poi_list.ElementAt(index).selected = newpoint.selected;
     poi_list.ElementAt(index).visible  = newpoint.visible;
 }
Exemple #6
0
        public void ReadXml_POI(string file_name)
        {
            ClearPOI();
            XmlDocument xmlDoc = new XmlDocument();

            xmlDoc.Load(file_name);
            XmlNodeList nodelist = xmlDoc.DocumentElement.SelectNodes("/WPG/POI");

            foreach (XmlNode node in nodelist)
            {
                POIPoints point = new POIPoints();
                point.name        = node.SelectSingleNode("Name").InnerText;
                point.internal_id = Convert.ToInt16(node.SelectSingleNode("InternalId").InnerText);
                point.lat         = Convert.ToDouble(node.SelectSingleNode("Lat").InnerText);
                point.lon         = Convert.ToDouble(node.SelectSingleNode("Lon").InnerText);
                point.elev        = Convert.ToDouble(node.SelectSingleNode("Elev").InnerText);
                point.alt         = Convert.ToDouble(node.SelectSingleNode("Alt").InnerText);
                point.cam_alt     = Convert.ToDouble(node.SelectSingleNode("Cam_Alt").InnerText);
                point.selected    = false;
                point.visible     = false;
                AddPOIId(point.internal_id, point);
            }
        }
Exemple #7
0
 public void AddPOI(POIPoints poipoint)
 {
     poipoint.internal_id = next_internal_id();
     poi_list.AddLast(poipoint);
 }
Exemple #8
0
        public void POIPointDeleteAt(int index)
        {
            POIPoints point = POIPointAt(index);

            poi_list.Remove(point);
        }