Example #1
0
        /// <summary>
        /// 定位观测区
        /// </summary>
        /// <param name="pMapCtr"></param>
        /// <param name="id"></param>
        public static void PositionResaultArea(ESRI.ArcGIS.Controls.AxMapControl pMapCtr, int id)
        {
            Core.Model.SatelliteResault model = new Core.Model.SatelliteResault();
            Core.DAL.SatelliteResault   dal   = new Core.DAL.SatelliteResault();
            try
            {
                model = dal.GetModel(id);
                IPolygon taskarea = Core.Generic.Convertor.ToPolygon(model.POLYGONSTRING);

                IEnvelope envelope;
                envelope = taskarea.Envelope;
                if (!envelope.IsEmpty)
                {
                    envelope.Expand(2, 2, true);
                }
                pMapCtr.Extent = envelope;
                pMapCtr.ActiveView.Refresh();
            }
            catch (Exception ex)
            {
                throw (ex);
            }
            finally
            {
                model = null;
                dal   = null;
            }
        }
Example #2
0
        /// <summary>
        /// 加载单个任务区 根据任务区实体类加载
        /// </summary>
        /// <param name="map"></param>
        /// <param name="model"></param>
        public static void LoadSatelliteResaultArea(Core.Map.MapHelper map, Core.Model.SatelliteResault model)
        {
            CoScheduling.Core.Model.ImgLayoutTempTimewindow img     = new CoScheduling.Core.Model.ImgLayoutTempTimewindow();
            CoScheduling.Core.DAL.ImgLayoutTempTimewindow   dal_img = new CoScheduling.Core.DAL.ImgLayoutTempTimewindow();
            img = dal_img.GetModel(model.LSTR_SEQID.ToString());
            ISymbol  symbol   = map.CreateSimpleFillSymbol(Color.Blue, 1, esriSimpleFillStyle.esriSFSHollow);
            IPolygon pPolygon = Core.Generic.Convertor.ToPolygon(model.POLYGONSTRING);

            SatelliteResaultAreas = new List <IPolygon>();
            SatelliteResaultAreas.Add(pPolygon);
            //添加任务区多边形
            map.AddElement(pPolygon, symbol, "TaskArea");
            map.AddElement(pPolygon, symbol, "SatResaultInfo|" + img.LSTR_SEQID);
            //map.AddTextElement(pPolygon, getTextElement(img.SAT_STKNAME+"/"+img.SENSOR_STKNAME), "TaskAreaMark");
        }
        /// <summary>
        /// 在地图上显示成像区域
        /// </summary>
        public void showSatelliteResault()
        {
            if (Main.MainInterface.SelectedNodeSat == null)
            {
                MessageBox.Show("请先选择观测方案再进行操作!");
                return;
            }
            try
            {
                string tag = Main.MainInterface.SelectedNodeSat.Tag.ToString();

                if (tag.StartsWith("S")) //任务结点
                {
                    int id;
                    int.TryParse(Main.MainInterface.SelectedNodeSat.Tag.ToString().Substring(3), out id);
                    Main.Program.SetStatusLabel("正在加载任务... ...");
                    Coverage.SatelliteResaultHelper.LoadSatelliteResaultAreas(Main.Program.myMap, id, this.dateTimePicker1.Value, this.dateTimePicker2.Value);
                }
                else if (tag.StartsWith("T")) //任务结点
                {
                    int id;
                    int.TryParse(Main.MainInterface.SelectedNodeSat.Tag.ToString().Substring(3), out id);
                    Main.Program.SetStatusLabel("正在加载任务... ...");
                    Coverage.SatelliteResaultHelper.LoadSatelliteResaultAreasByTaskID(Main.Program.myMap, id, this.dateTimePicker1.Value, this.dateTimePicker2.Value);
                }
                else if (tag.StartsWith("I")) //结果点
                {
                    int id;
                    int.TryParse(Main.MainInterface.SelectedNodeSat.Tag.ToString().Substring(3), out id);
                    Main.Program.SetStatusLabel("正在加载任务... ...");
                    Core.Model.SatelliteResault satelliteResault     = new Core.Model.SatelliteResault();
                    Core.DAL.SatelliteResault   dal_satelliteResault = new Core.DAL.SatelliteResault();
                    satelliteResault = dal_satelliteResault.GetModel(id);
                    //读取并图上显示卫星观测区信息
                    Core.Map.MapHelper map = new Core.Map.MapHelper(Main.Program.myMap);
                    //map.ClearAllElement();
                    Coverage.SatelliteResaultHelper.LoadSatelliteResaultArea(map, satelliteResault);
                }

                Main.Program.SetStatusLabel("就绪.");
            }
            catch (Exception ex)
            {
                MessageBox.Show("错误:" + ex);
            }
        }