/// <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; } }
/// <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); } }