public DialogKMLPath(Waypoint_Path_Gen wpg, GMAP gmap, TreeView treeview, double lat, double lon)
        {
            _lat                = lat;
            _lon                = lon;
            _wpg                = wpg;
            _gmap               = gmap;
            _treeview           = treeview;
            _current_path_index = -1;
            _path               = new Models.Path();
            _wp = new WayPoints();

            InitializeComponent();

            // Fill POI combobox

            cmbKLMPOI.Items.Clear();
            for (int i = 0; i < _wpg.POICount(); i++)
            {
                cmbKLMPOI.Items.Add(_wpg.POIPointAt(i).name);
            }

            // Generate EMpty Path

            _path.Add_Empty_Path(_wpg, _gmap, "Empty Path", "KML");
            _current_path_index = _wpg.PathCount() - 1;
        }
 public DialogEditWP(Waypoint_Path_Gen wpg, GMAP gmap, int path_index, int wp_index)
 {
     _wpg      = wpg;
     _gmap     = gmap;
     _wp_index = wp_index;
     _path     = _wpg.PathAt(path_index);
     _wp_list  = _path.waypoints;
     _wp       = _wp_list.ElementAt(wp_index);
     InitializeComponent();
     txtWPIndex.Text        = Convert.ToString(wp_index);
     txtwplat.Text          = Convert.ToString(_wp.lat);
     txtwplon.Text          = Convert.ToString(_wp.lon);
     txtwpalt.Text          = Convert.ToString(_wp.alt);
     txtwphead.Text         = Convert.ToString(_wp.head);
     txtwpcurvesize.Text    = Convert.ToString(_wp.curvesize);
     txtwprotdirection.Text = Convert.ToString(_wp.rotationdir);
     txtwpgimblemode.Text   = Convert.ToString(_wp.gimblemode);
     txtgimblepitch.Text    = Convert.ToString(_wp.gimblepitch);
     trkHeading.Value       = Convert.ToInt16(_wp.head);
     trkCurveSize.Value     = Convert.ToInt16(_wp.curvesize);
     for (int i = 0; i < _wpg.ActionCount(); i++)
     {
         cmbActions.Items.Add(_wpg.ActionAt(i).name);
     }
     cmbActions.SelectedIndex = 0;
 }
示例#3
0
        public DialogKMLPolygon(Waypoint_Path_Gen wpg, GMAP gmap, TreeView treeview)
        {
            _wpg      = wpg;
            _gmap     = gmap;
            _treeview = treeview;

            InitializeComponent();
        }
 public DialogOutputPath(Options options, Waypoint_Path_Gen wpg, Path path)
 {
     _options = options;
     _wpg     = wpg;
     _path    = path;
     InitializeComponent();
     txtCSVFilePath.Text = _options.def_csv_path;
     txtKMLFilePath.Text = _options.def_kml_path;
 }
示例#5
0
 public DialogEditPolygon(Waypoint_Path_Gen wpg, GMAP gmap, TreeView treeview, int poly_index)
 {
     _wpg        = wpg;
     _gmap       = gmap;
     _treeview   = treeview;
     _poly_index = poly_index;
     _poly       = _wpg.ShapeAt(_poly_index);
     InitializeComponent();
     txtPolyName.Text = _poly.name;
 }
 public frmAddPOI(Waypoint_Path_Gen wpg, GMAP gmap, double lat, double lon)
 {
     _lat  = lat;
     _lon  = lon;
     _wpg  = wpg;
     _gmap = gmap;
     InitializeComponent();
     lblAddPOI.Text       = "Location : " + Convert.ToString(lat) + ", " + Convert.ToString(lon);
     txtAddPOIAlt.Text    = "30";
     txtAddPOICamAlt.Text = "5";
     txtAddPOIElev.Text   = "150";
 }
        public DialogActions(Waypoint_Path_Gen wpg)
        {
            _wpg = wpg;
            InitializeComponent();
            int count = _wpg.ActionCount();

            Models.Action action;
            string        name;

            cmbActionsList.Items.Clear();
            //cmbActionsWaypoints.Items.Clear();

            for (int i = 0; i < count; i++)
            {
                action = _wpg.ActionAt(i);
                name   = action.name;

                cmbActionsList.Items.Add(name);
                //cmbActionsWaypoints.Items.Add(name);
            }

            txtNewActionName.Text     = "";
            cmbAction1.SelectedIndex  = 0;
            cmbAction2.SelectedIndex  = 0;
            cmbAction3.SelectedIndex  = 0;
            cmbAction4.SelectedIndex  = 0;
            cmbAction5.SelectedIndex  = 0;
            cmbAction6.SelectedIndex  = 0;
            cmbAction7.SelectedIndex  = 0;
            cmbAction8.SelectedIndex  = 0;
            cmbAction9.SelectedIndex  = 0;
            cmbAction10.SelectedIndex = 0;
            cmbAction11.SelectedIndex = 0;
            cmbAction12.SelectedIndex = 0;
            cmbAction13.SelectedIndex = 0;
            cmbAction14.SelectedIndex = 0;
            cmbAction15.SelectedIndex = 0;
            txtActionParam1.Text      = "-1";
            txtActionParam2.Text      = "-1";
            txtActionParam3.Text      = "-1";
            txtActionParam4.Text      = "-1";
            txtActionParam5.Text      = "-1";
            txtActionParam6.Text      = "-1";
            txtActionParam7.Text      = "-1";
            txtActionParam8.Text      = "-1";
            txtActionParam9.Text      = "-1";
            txtActionParam10.Text     = "-1";
            txtActionParam11.Text     = "-1";
            txtActionParam12.Text     = "-1";
            txtActionParam13.Text     = "-1";
            txtActionParam14.Text     = "-1";
            txtActionParam15.Text     = "-1";
        }
示例#8
0
        public DialogAddHelixPath(Waypoint_Path_Gen wpg, GMAP gmap, Path path, double lat, double lon)
        {
            _wp   = new WayPoints();
            _wpg  = wpg;
            _gmap = gmap;
            _lat  = lat;
            _lon  = lon;

            InitializeComponent();

            if (path == null)
            {
                _new_path     = true;
                _first_pass   = true;
                _path         = new Path();
                _path.visible = true;
                _build        = true;
            }
            else
            {
                _new_path   = false;
                _first_pass = false;
                _build      = false;
                _path       = path;
                HelicalGUI gui = _path.helixgui;
                txtAddHelixPathName.Text = gui.name;
                _lat = gui.lat;
                _lon = gui.lon;
                txtHelixStartAlt.Text    = Convert.ToString(gui.start_alt);
                txtHelixEndAlt.Text      = Convert.ToString(gui.end_alt);
                txtHelixStartRadius.Text = Convert.ToString(gui.start_rad);
                txtHelixEndRadius.Text   = Convert.ToString(gui.end_rad);
                txtHelixStartAngle.Text  = Convert.ToString(gui.start_angle);
                txtHelixSpan.Text        = Convert.ToString(gui.helix_span);
                txtHelixNumPoints.Text   = Convert.ToString(gui.num_points);
                chkHelicalHome.Checked   = gui.startend;
                chkHelixPOI.Checked      = gui.poimode;
                cmbHelixPOI.SelectedText = gui.poiname;
                _build         = true;
                _path.selected = false;
            }

            buildHelicalPath();

            _gmap.ReDrawgMap();
            //_current_path_index = _wpg.PathCount() - 1;
            cmbHelixPOI.Items.Clear();
            for (int i = 0; i < _wpg.POICount(); i++)
            {
                cmbHelixPOI.Items.Add(_wpg.POIPointAt(i).name);
            }
        }
        public DialogEditWPActions(Waypoint_Path_Gen wpg, GMAP gmap, Path path)
        {
            _wpg  = wpg;
            _gmap = gmap;
            _path = path;
            InitializeComponent();

            // Fill Actions CMB

            Update_Actioncmb();

            // Fill Data grid view with Waypoints

            int    path_id   = _path.id;
            string path_name = _path.name;
            string path_type = _path.type;
            LinkedList <WayPoints> waypoints = _path.waypoints;

            dgvActionsWaypoints.Rows.Clear();
            int wp_count    = waypoints.Count;
            int count       = 0;
            int path_wcount = waypoints.Count();

            while (count < path_wcount)
            {
                double lat         = waypoints.ElementAt(count).lat;
                double lon         = waypoints.ElementAt(count).lon;
                double alt         = waypoints.ElementAt(count).alt;
                double head        = waypoints.ElementAt(count).head;
                int    gimblemode  = waypoints.ElementAt(count).gimblemode;
                double gimblepitch = waypoints.ElementAt(count).gimblepitch;
                double curvesize   = waypoints.ElementAt(count).curvesize;
                double rotdir      = waypoints.ElementAt(count).rotationdir;
                int[,] actions = waypoints.ElementAt(count).actions;
                if (head < 0.0)
                {
                    head = head + 360.0;
                }
                dgvActionsWaypoints.Rows.Add(count, Convert.ToString(lat), Convert.ToString(lon), Convert.ToString(alt), Convert.ToString(head),
                                             Convert.ToString(curvesize), Convert.ToString(rotdir), Convert.ToString(gimblemode), Convert.ToString(gimblepitch)
                                             , Convert.ToString(actions[0, 0]), Convert.ToString(actions[0, 1])
                                             , Convert.ToString(actions[1, 0]), Convert.ToString(actions[1, 1])
                                             , Convert.ToString(actions[2, 0]), Convert.ToString(actions[2, 1])
                                             , Convert.ToString(actions[3, 0]), Convert.ToString(actions[3, 1])
                                             );
                count++;
            }
            foreach (DataGridViewColumn dgvc in dgvActionsWaypoints.Columns)
            {
                dgvc.SortMode = DataGridViewColumnSortMode.NotSortable;
            }
        }
        public DialogEditPath(Waypoint_Path_Gen wpg, GMAP gmap, TreeView treeview, int path_index)
        {
            _wpg        = wpg;
            _gmap       = gmap;
            _treeview   = treeview;
            _path_index = path_index;
            _path       = _wpg.PathAt(path_index);

            InitializeComponent();
            // Set text boxes
            txtPathName.Text = _path.name;
            txtPathType.Text = _path.type;
        }
示例#11
0
        public GMAP(Waypoint_Path_Gen wpg, GMapControl mapcontrol, int index)
        {
            _wpg                = wpg;
            _mapcontrol         = mapcontrol;
            _mapcontrol.MinZoom = 1;
            _mapcontrol.MaxZoom = 24;

            switch (index)
            {
            case 0:
                _mapcontrol.MapProvider = global::GMap.NET.MapProviders.BingSatelliteMapProvider.Instance;
                break;

            case 1:
                _mapcontrol.MapProvider = global::GMap.NET.MapProviders.GoogleMapProvider.Instance;
                break;

            case 2:
                _mapcontrol.MapProvider = global::GMap.NET.MapProviders.GoogleTerrainMapProvider.Instance;
                break;

            case 3:
                _mapcontrol.MapProvider = global::GMap.NET.MapProviders.GoogleHybridMapProvider.Instance;
                break;

            case 4:
                _mapcontrol.MapProvider = global::GMap.NET.MapProviders.GoogleChinaSatelliteMapProvider.Instance;
                break;

            case 5:
                _mapcontrol.MapProvider = global::GMap.NET.MapProviders.ArcGIS_Topo_US_2D_MapProvider.Instance;
                break;

            case 6:
                _mapcontrol.MapProvider = global::GMap.NET.MapProviders.GoogleSatelliteMapProvider.Instance;
                break;
            }

            //_mapcontrol.MapProvider = global::GMap.NET.MapProviders.BingSatelliteMapProvider.Instance;
            global::GMap.NET.GMaps.Instance.Mode = global::GMap.NET.AccessMode.ServerOnly;
            _mapcontrol.DragButton = MouseButtons.Middle;
            //_mapcontrol.ShowCenter = false;
            _overmarkers = new GMapOverlay("markers");
            _overroutes  = new GMapOverlay("routes");
            _overpolys   = new GMapOverlay("polygons");
            _mapcontrol.Overlays.Add(_overmarkers);
            _mapcontrol.Overlays.Add(_overroutes);
            _mapcontrol.Overlays.Add(_overpolys);
            _poi_image          = (Bitmap)Image.FromFile("camera.png", true);
            _poi_selected_image = (Bitmap)Image.FromFile("camera_selected.png", true);
        }
示例#12
0
 public DialogPolyPerimPath(Waypoint_Path_Gen wpg, GMAP gmap, Options options, TreeView treeview)
 {
     _wpg      = wpg;
     _gmap     = gmap;
     _options  = options;
     _treeview = treeview;
     InitializeComponent();
     txtAltPolyPath.Text = Convert.ToString(_options.def_altitude);
     cmbPolyPath.Items.Clear();
     for (int i = 0; i < _wpg.ShapeCount(); i++)
     {
         cmbPolyPath.Items.Add(_wpg.ShapeAt(i).name);
     }
 }
        public DialogManualPath(Waypoint_Path_Gen wpg, GMAP gmap, TreeView treeview, Path path, Options options, double lat, double lon)
        {
            _wpg            = wpg;
            _gmap           = gmap;
            _treeview       = treeview;
            _options        = options;
            _path           = path;
            _lat            = lat;
            _lon            = lon;
            int[,] _actions = new int[, ] {
                { -1, 0 }, { -1, 0 }, { -1, 0 }, { -1, 0 }, { -1, 0 }, { -1, 0 }, { -1, 0 }, { -1, 0 }, { -1, 0 }, { -1, 0 }, { -1, 0 }, { -1, 0 }, { -1, 0 }, { -1, 0 }, { -1, 0 }
            };


            InitializeComponent();

            // Create new Path with a Single Waypoint

            _alt = _options.def_altitude;

            _handler_off           = true;
            txtManualAltitude.Text = Convert.ToString(_alt);
            _handler_off           = false;
            string name = txtPathName.Text;

            _path.name     = name;;
            _path.type     = "Manual";
            _path.visible  = true;
            _path.selected = true;
            _wp_list       = new LinkedList <WayPoints>();
            _wp            = new WayPoints();
            _wp.lat        = _lat;
            _wp.lon        = _lon;
            _wp.visible    = true;
            _wp.selected   = false;
            _wp.head       = 0;
            _wp.alt        = _alt;
            _wp.actions    = _actions;
            _wp_list.AddLast(_wp);
            _wp_list.AddLast(_wp);
            _path.waypoints = _wp_list;
            _wpg.AddPath(_path);


            GMAPTree.Update_GMapTree(_wpg, _treeview);
            _gmap.ReDrawgMap();
        }
        public DialogEditPOI(Waypoint_Path_Gen wpg, GMAP gmap, TreeView treeview, int poi_index)
        {
            _wpg       = wpg;
            _gmap      = gmap;
            _treeview  = treeview;
            _poi_index = poi_index;
            InitializeComponent();
            POIPoints pnt;

            pnt                  = _wpg.POIPointAt(_poi_index);
            txtPOIName.Text      = pnt.name;
            txtPOILatitude.Text  = Convert.ToString(pnt.lat);
            txtPOILongitude.Text = Convert.ToString(pnt.lon);
            txtPOIElevation.Text = Convert.ToString(pnt.elev);
            txtPOIAltitude.Text  = Convert.ToString(pnt.alt);
            txtPOICameraAlt.Text = Convert.ToString(pnt.cam_alt);
        }
        public dialogAddCircularPath(Waypoint_Path_Gen wpg, GMAP gmap, Options options, Path path, double lat, double lon)
        {
            // Save arguments
            _wp      = new WayPoints();
            _wpg     = wpg;
            _gmap    = gmap;
            _options = options;
            _lat     = lat;
            _lon     = lon;

            // Initialize Dialog

            InitializeComponent();

            // Setup Dialog GUI

            txtDiaAddCircPathAlt.Text = Convert.ToString(_options.def_altitude);
            cmbCircPOI.Items.Clear();
            cmbCircPOI.Items.Add("");
            for (int i = 0; i < _wpg.POICount(); i++)
            {
                cmbCircPOI.Items.Add(_wpg.POIPointAt(i).name);
            }

            // See if new path

            if (path == null)
            {
                _new_path   = true;
                _first_pass = true;
                _path       = new Path();
                //_current_path_index = -1;
                _path.visible  = true;
                _path.selected = false;
                double      altitude          = Convert.ToDouble(txtDiaAddCircPathAlt.Text);
                double      circle_radius     = Convert.ToDouble(txtDiaAddCircPathRadius.Text);
                double      start_angle       = Convert.ToDouble(txtCircStartAngle.Text);
                double      circle_span       = Convert.ToDouble(txtCircSpan.Text);
                int         circle_num_points = Convert.ToInt16(txtCircNumPoints.Text);
                bool        startend          = chkCircHome.Checked;
                CircularGUI gui = new CircularGUI();
                gui.CW          = startend;
                gui.name        = txtDiaAddCircPathName.Text;
                gui.lat         = _lat;
                gui.lon         = _lon;
                gui.altitude    = altitude;
                gui.radius      = circle_radius;
                gui.numpoints   = circle_num_points;
                gui.fullcirc    = chkFullCircle.Checked;
                gui.start_angle = start_angle;
                gui.circ_span   = circle_span;
                gui.startend    = startend;
                gui.poimode     = chkCircPOI.Checked;
                gui.poiname     = cmbCircPOI.GetItemText(cmbCircPOI.SelectedItem);
                _path.circgui   = gui;
            }
            else
            {
                _build         = false;
                _new_path      = false;
                _path          = path;
                _path.selected = false;
                _path.visible  = true;
                //_current_path_index = _path.id;
                CircularGUI gui = _path.circgui;
                txtDiaAddCircPathName.Text = gui.name;
                _lat = gui.lat;
                _lon = gui.lon;
                txtDiaAddCircPathAlt.Text    = Convert.ToString(gui.altitude);
                txtDiaAddCircPathRadius.Text = Convert.ToString(gui.radius);
                txtCircNumPoints.Text        = Convert.ToString(gui.numpoints);
                chkFullCircle.Checked        = gui.fullcirc;
                txtCircStartAngle.Text       = Convert.ToString(gui.start_angle);
                txtCircSpan.Text             = Convert.ToString(gui.circ_span);
                chkCircHome.Checked          = gui.startend;
                chkCircPOI.Checked           = gui.poimode;
                int index = cmbCircPOI.Items.IndexOf(gui.poiname);
                cmbCircPOI.SelectedIndex = index;
                _first_pass = false;
                _build      = true;
            }
            buildCircPath();
        }
        public DialogAddRectPath(Waypoint_Path_Gen wpg, GMAP gmap, Options options, Path path, double lat, double lon)
        {
            _wp               = new WayPoints();
            _wpg              = wpg;
            _gmap             = gmap;
            _options          = options;
            _lat              = lat;
            _lon              = lon;
            _camera_angle_hor = _options.focal_angle_hor;
            _camera_angle_ver = _options.focal_angle_ver;
            //_overlap_width = over_wid;
            //_overlap_height = over_hgt;
            _overlap_width  = _options.hor_overlap_percent;
            _overlap_height = _options.ver_overlap_percent;
            _poly           = new Shape();

            InitializeComponent();

            // Fill POI combobox
            cmbRectCamPOI.Items.Clear();
            for (int i = 0; i < _wpg.POICount(); i++)
            {
                cmbRectCamPOI.Items.Add(_wpg.POIPointAt(i).name);
            }

            // New or Redefine Path

            if (path == null)
            {
                _new_path        = true;
                _first_pass      = true;
                _path            = new Path();
                _path.visible    = true;
                _path.selected   = false;
                _build           = true;
                txtPathAlt.Text  = Convert.ToString(_options.def_altitude);
                trkRectAlt.Value = Convert.ToInt16(_options.def_altitude);
            }
            else
            {
                _new_path      = false;
                _path          = path;
                _path.selected = false;
                _current_intid = path.internal_id;
                RectanglarGUI gui = _path.rectanglegui;
                _build = false;
                txtRectPathName.Text  = gui.name;
                radioVideo.Checked    = Convert.ToBoolean(gui.video);
                chkRectHome.Checked   = Convert.ToBoolean(gui.startend);
                txtPathAlt.Text       = Convert.ToString(gui.altitude);
                txtGridRotation.Text  = Convert.ToString(gui.heading);
                txtGridLength.Text    = Convert.ToString(gui.length);
                txtGridWidth.Text     = Convert.ToString(gui.width);
                chkOnePass.Checked    = Convert.ToBoolean(gui.single);
                chkRectCamPOI.Checked = Convert.ToBoolean(gui.poimode);
                int index = cmbRectCamPOI.Items.IndexOf(gui.poiname);
                cmbRectCamPOI.SelectedIndex = index;
                _build = true;
            }
            _build = true;
            BuildRectPath();
        }
        public DialogAddPolyGridPath(Waypoint_Path_Gen wpg, GMAP gmap, Options options, Path path, double lat, double lon)
        {
            _wpg         = wpg;
            _gmap        = gmap;
            _options     = options;
            _wp          = new WayPoints();
            _lat         = lat;
            _lon         = lon;
            _cam_ang_hor = _options.focal_angle_hor;
            _cam_ang_ver = _options.focal_angle_ver;
            _over_wid    = _options.hor_overlap_percent;
            _over_hgt    = _options.ver_overlap_percent;

            InitializeComponent();

            // Get selected Polygon


            int shape_count = _wpg.ShapeCount();

            for (int i = 0; i < shape_count; i++)
            {
                if (_wpg.ShapeAt(i).selected)
                {
                    _poly_index   = i;
                    _poly_intid   = _wpg.ShapeAt(i).internal_id;
                    _poly         = _wpg.ShapeAt(i);
                    _poly.visible = true;
                    break;
                }
            }

            if (path == null)
            {
                _new_path       = true;
                _first_pass     = true;
                _path           = new Path();
                _path.visible   = true;
                _path.selected  = false;
                _build          = false;
                txtGridAlt.Text = Convert.ToString(_options.def_altitude);
                _build          = true;
            }
            else
            {
                _new_path      = false;
                _path          = path;
                _path.selected = false;
                _current_intid = path.internal_id;
                _build         = false;
                PolygonGridGUI gui = _path.polygridgui;
                txtPolyPathName.Text = gui.name;
                radioVideo.Checked   = gui.video;
                chkRectHome.Checked  = gui.startend;
                txtGridAlt.Text      = Convert.ToString(gui.altitude);
                txtHeading.Text      = Convert.ToString(gui.heading);
                _poly_intid          = gui.poly_internal_id;
                _poly         = _wpg.ShapeWithId(_poly_intid);
                _poly.visible = true;
                _build        = true;
            }
            BuildPolyGridPath();
        }