diff --git a/Cyberpipe.suo b/Cyberpipe.suo index c38d01e..fe31fe2 100644 --- a/Cyberpipe.suo +++ b/Cyberpipe.suo Binary files differ diff --git a/Cyberpipe.suo b/Cyberpipe.suo index c38d01e..fe31fe2 100644 --- a/Cyberpipe.suo +++ b/Cyberpipe.suo Binary files differ diff --git a/FrmAllWorkWellStatis.cs b/FrmAllWorkWellStatis.cs index fe2b7f8..3f230df 100644 --- a/FrmAllWorkWellStatis.cs +++ b/FrmAllWorkWellStatis.cs @@ -17,22 +17,20 @@ private MainFrm.DataGridViewDelegate m_InitDataGridViewX1; private Dictionary map = null; - DataGridView dataGridViewX1; - ToolStripStatusLabel toolStripNumbers; - GSOGlobeControl globeControl1; - PanelEx panel; + private GSOGlobeControl globeControl1; + private GSOGeoPolygon3D polygon; //TODOLIST:用晓伟的代理进行操作,功能拆分细化 - public FrmAllWorkWellStatis(GSOGeoPolygon3D polygon, DataGridView dataGridViewX11, ToolStripStatusLabel toolStripNumbers1, GSOGlobeControl ctl, PanelEx p) - { - InitializeComponent(); - panel = p; - dataGridViewX1 = dataGridViewX11; - toolStripNumbers = toolStripNumbers1; - globeControl1 = ctl; - map = getAccsMap(polygon); + //public FrmAllWorkWellStatis(GSOGeoPolygon3D polygon, DataGridView dataGridViewX11, ToolStripStatusLabel toolStripNumbers1, GSOGlobeControl ctl, PanelEx p) + //{ + // InitializeComponent(); + // panel = p; + // dataGridViewX1 = dataGridViewX11; + // toolStripNumbers = toolStripNumbers1; + // globeControl1 = ctl; + // map = getAccsMap(polygon); - } - public FrmAllWorkWellStatis(GSOGeoPolygon3D polygon, MainFrm.DataGridViewDelegate InitDataGridViewX1, GSOGlobeControl ctl) + //} + public FrmAllWorkWellStatis(GSOGlobeControl ctl,GSOGeoPolygon3D polygon, MainFrm.DataGridViewDelegate InitDataGridViewX1) { InitializeComponent(); globeControl1 = ctl; @@ -88,93 +86,49 @@ { HitTestResult result = chartAllAreaPipeline.HitTest(e.X, e.Y, true); int indexHit = result.PointIndex; - if (indexHit >= 0) + if (indexHit < 0) return; + + + //GSOFeatures fs = list[indexHit]; + string sql = ""; + + string pipetype = chartAllAreaPipeline.Series["井盖"].Points[indexHit].AxisLabel; + GSOFeatures fs = map[pipetype]; + string layername = ""; + if (pipetype.EndsWith("窖井") || pipetype.EndsWith("表井") || + (pipetype.EndsWith("窨井")) || pipetype.EndsWith("孔") || + pipetype.EndsWith("篦")) { - - //GSOFeatures fs = list[indexHit]; - string sql = ""; - - string pipetype = chartAllAreaPipeline.Series["井盖"].Points[indexHit].AxisLabel; - GSOFeatures fs = map[pipetype]; - string layername = ""; - if (pipetype.EndsWith("窖井") || pipetype.EndsWith("表井") || - (pipetype.EndsWith("窨井")) || pipetype.EndsWith("孔") || - pipetype.EndsWith("篦")) - { - layername = pipetype.Substring(0, pipetype.Length - 2) + "管线附属物"; - } - else - { - layername = pipetype.Substring(0, pipetype.Length - 3) + "管线附属物"; - } - MainFrm.m_CurrentQueryLayer = layername; - GSOLayer layer = globeControl1.Globe.Layers.GetLayerByCaption(layername); - if (layer == null) - { - return; - } - //从图层获取datatable数据,不涉及数据库操作,速度会快一些 - //string [] fieldNames = GSOFeatureUtils.getFields(layername, globeControl1); - //DataTable dt = GSOFeatureUtils.convertGSOFeatures2DataTable(fs,fieldNames); - //if (dt.Rows.Count > 0) - //{ - // dataGridViewX1.DataSource = dt; - // panel.Visible = true; - // toolStripNumbers.Text = " 井盖类型:" + pipetype + "||共有:" + Convert.ToString(dt.Rows.Count) + "条记录"; - //} - //else - //{ - // panel.Visible = false; - // dataGridViewX1.DataSource = null; - // dataGridViewX1.Refresh(); - // toolStripNumbers.Text = "类型:"; - //} - //数据库获取数据 - if (fs.Length > 0) - { - sql = "select " + getpipeLineFields.getFields(layername, globeControl1) + " from " + layer.Name; - sql += " where "; - for (int i = 0; i < fs.Length; i++) - { - if (i == 0) - { - if (fs[i].GetFieldDefn("编号") != null) - { - sql += " 编号='" + fs[i].GetValue("编号").ToString() + "'"; - } - } - else - { - if (fs[i].GetFieldDefn("编号") != null) - { - sql += " or 编号 = '" + fs[i].GetValue("编号").ToString() + "'"; - } - } - } - - DataTable dt = OledbHelper.QueryTable(sql); - if (dt.Rows.Count > 0) - { - dataGridViewX1.DataSource = dt; - panel.Visible = true; - string strLable = toolStripNumbers.Text = " 井盖类型:" + pipetype + "||共有:" + Convert.ToString(dt.Rows.Count) + "条记录"; - //m_InitDataGridViewX1(dt, strLable, "", true); - } - else - { - panel.Visible = false; - dataGridViewX1.DataSource = null; - dataGridViewX1.Refresh(); - toolStripNumbers.Text = "类型:"; - } - - - - } + layername = pipetype.Substring(0, pipetype.Length - 2) + "管线附属物"; + } + else + { + layername = pipetype.Substring(0, pipetype.Length - 3) + "管线附属物"; + } + //MainFrm.m_CurrentQueryLayer = layername; + GSOLayer layer = globeControl1.Globe.Layers.GetLayerByCaption(layername); + if (layer == null || fs.Length <= 0) + { + return; } - } + sql = "select " + getpipeLineFields.getFields(layername, globeControl1) + " from " + layer.Name; + sql += " where 1>2 "; + for (int i = 0; i < fs.Length && fs[i].GetFieldDefn("编号") != null; i++) + { + sql += " or 编号 = '" + fs[i].GetValue("编号").ToString() + "'"; + + } + + DataTable dt = OledbHelper.QueryTable(sql); + + string strLable = " 井盖类型:" + pipetype + "||共有:" + Convert.ToString(dt.Rows.Count) + "条记录"; + m_InitDataGridViewX1(dt, strLable, "", true); + + + + } private void chartAllAreaPipeline_MouseMove(object sender, MouseEventArgs e) { HitTestResult result = chartAllAreaPipeline.HitTest(e.X, e.Y, true); @@ -193,10 +147,10 @@ { globeControl1.Globe.ClearAnalysis(); //layerTemp.RemoveAllFeature(); - panel.Visible = false; - dataGridViewX1.DataSource = null; - dataGridViewX1.Refresh(); - toolStripNumbers.Text = "类型:"; + //panel.Visible = false; + //dataGridViewX1.DataSource = null; + //dataGridViewX1.Refresh(); + //toolStripNumbers.Text = "类型:"; for (int i = 0; i < globeControl1.Globe.Layers.Count; i++) { GSOLayer layer = globeControl1.Globe.Layers[i]; @@ -210,8 +164,9 @@ } } } - //m_InitDataGridViewX1(null,"","" , false); + globeControl1.Globe.MemoryLayer.RemoveAllFeature(); + m_InitDataGridViewX1(null, "", "", false); } private void 导出统计专题图ToolStripMenuItem_Click(object sender, EventArgs e) @@ -220,7 +175,11 @@ frm.Show(); } - //获取指定layer类型的附属物名称列表 + /// + /// 获取指定layer类型的附属物名称列表 + /// + /// + /// public string[] getLayerAccNames(string layerType) { GSOLayer layer = globeControl1.Globe.Layers.GetLayerByCaption(layerType + "管线附属物"); @@ -245,8 +204,7 @@ /// 获取区域内各图层的井、孔、蓖的map /// /// 区域 - /// 要查找的附属物名称数组、如井、孔、蓖 - /// 返回值为:<图层+附属物名称,附属物列表> + /// 返回值为:图层+附属物名称,附属物列表 public Dictionary getAccsMap(GSOGeoPolygon3D polygon) { diff --git a/Cyberpipe.suo b/Cyberpipe.suo index c38d01e..fe31fe2 100644 --- a/Cyberpipe.suo +++ b/Cyberpipe.suo Binary files differ diff --git a/FrmAllWorkWellStatis.cs b/FrmAllWorkWellStatis.cs index fe2b7f8..3f230df 100644 --- a/FrmAllWorkWellStatis.cs +++ b/FrmAllWorkWellStatis.cs @@ -17,22 +17,20 @@ private MainFrm.DataGridViewDelegate m_InitDataGridViewX1; private Dictionary map = null; - DataGridView dataGridViewX1; - ToolStripStatusLabel toolStripNumbers; - GSOGlobeControl globeControl1; - PanelEx panel; + private GSOGlobeControl globeControl1; + private GSOGeoPolygon3D polygon; //TODOLIST:用晓伟的代理进行操作,功能拆分细化 - public FrmAllWorkWellStatis(GSOGeoPolygon3D polygon, DataGridView dataGridViewX11, ToolStripStatusLabel toolStripNumbers1, GSOGlobeControl ctl, PanelEx p) - { - InitializeComponent(); - panel = p; - dataGridViewX1 = dataGridViewX11; - toolStripNumbers = toolStripNumbers1; - globeControl1 = ctl; - map = getAccsMap(polygon); + //public FrmAllWorkWellStatis(GSOGeoPolygon3D polygon, DataGridView dataGridViewX11, ToolStripStatusLabel toolStripNumbers1, GSOGlobeControl ctl, PanelEx p) + //{ + // InitializeComponent(); + // panel = p; + // dataGridViewX1 = dataGridViewX11; + // toolStripNumbers = toolStripNumbers1; + // globeControl1 = ctl; + // map = getAccsMap(polygon); - } - public FrmAllWorkWellStatis(GSOGeoPolygon3D polygon, MainFrm.DataGridViewDelegate InitDataGridViewX1, GSOGlobeControl ctl) + //} + public FrmAllWorkWellStatis(GSOGlobeControl ctl,GSOGeoPolygon3D polygon, MainFrm.DataGridViewDelegate InitDataGridViewX1) { InitializeComponent(); globeControl1 = ctl; @@ -88,93 +86,49 @@ { HitTestResult result = chartAllAreaPipeline.HitTest(e.X, e.Y, true); int indexHit = result.PointIndex; - if (indexHit >= 0) + if (indexHit < 0) return; + + + //GSOFeatures fs = list[indexHit]; + string sql = ""; + + string pipetype = chartAllAreaPipeline.Series["井盖"].Points[indexHit].AxisLabel; + GSOFeatures fs = map[pipetype]; + string layername = ""; + if (pipetype.EndsWith("窖井") || pipetype.EndsWith("表井") || + (pipetype.EndsWith("窨井")) || pipetype.EndsWith("孔") || + pipetype.EndsWith("篦")) { - - //GSOFeatures fs = list[indexHit]; - string sql = ""; - - string pipetype = chartAllAreaPipeline.Series["井盖"].Points[indexHit].AxisLabel; - GSOFeatures fs = map[pipetype]; - string layername = ""; - if (pipetype.EndsWith("窖井") || pipetype.EndsWith("表井") || - (pipetype.EndsWith("窨井")) || pipetype.EndsWith("孔") || - pipetype.EndsWith("篦")) - { - layername = pipetype.Substring(0, pipetype.Length - 2) + "管线附属物"; - } - else - { - layername = pipetype.Substring(0, pipetype.Length - 3) + "管线附属物"; - } - MainFrm.m_CurrentQueryLayer = layername; - GSOLayer layer = globeControl1.Globe.Layers.GetLayerByCaption(layername); - if (layer == null) - { - return; - } - //从图层获取datatable数据,不涉及数据库操作,速度会快一些 - //string [] fieldNames = GSOFeatureUtils.getFields(layername, globeControl1); - //DataTable dt = GSOFeatureUtils.convertGSOFeatures2DataTable(fs,fieldNames); - //if (dt.Rows.Count > 0) - //{ - // dataGridViewX1.DataSource = dt; - // panel.Visible = true; - // toolStripNumbers.Text = " 井盖类型:" + pipetype + "||共有:" + Convert.ToString(dt.Rows.Count) + "条记录"; - //} - //else - //{ - // panel.Visible = false; - // dataGridViewX1.DataSource = null; - // dataGridViewX1.Refresh(); - // toolStripNumbers.Text = "类型:"; - //} - //数据库获取数据 - if (fs.Length > 0) - { - sql = "select " + getpipeLineFields.getFields(layername, globeControl1) + " from " + layer.Name; - sql += " where "; - for (int i = 0; i < fs.Length; i++) - { - if (i == 0) - { - if (fs[i].GetFieldDefn("编号") != null) - { - sql += " 编号='" + fs[i].GetValue("编号").ToString() + "'"; - } - } - else - { - if (fs[i].GetFieldDefn("编号") != null) - { - sql += " or 编号 = '" + fs[i].GetValue("编号").ToString() + "'"; - } - } - } - - DataTable dt = OledbHelper.QueryTable(sql); - if (dt.Rows.Count > 0) - { - dataGridViewX1.DataSource = dt; - panel.Visible = true; - string strLable = toolStripNumbers.Text = " 井盖类型:" + pipetype + "||共有:" + Convert.ToString(dt.Rows.Count) + "条记录"; - //m_InitDataGridViewX1(dt, strLable, "", true); - } - else - { - panel.Visible = false; - dataGridViewX1.DataSource = null; - dataGridViewX1.Refresh(); - toolStripNumbers.Text = "类型:"; - } - - - - } + layername = pipetype.Substring(0, pipetype.Length - 2) + "管线附属物"; + } + else + { + layername = pipetype.Substring(0, pipetype.Length - 3) + "管线附属物"; + } + //MainFrm.m_CurrentQueryLayer = layername; + GSOLayer layer = globeControl1.Globe.Layers.GetLayerByCaption(layername); + if (layer == null || fs.Length <= 0) + { + return; } - } + sql = "select " + getpipeLineFields.getFields(layername, globeControl1) + " from " + layer.Name; + sql += " where 1>2 "; + for (int i = 0; i < fs.Length && fs[i].GetFieldDefn("编号") != null; i++) + { + sql += " or 编号 = '" + fs[i].GetValue("编号").ToString() + "'"; + + } + + DataTable dt = OledbHelper.QueryTable(sql); + + string strLable = " 井盖类型:" + pipetype + "||共有:" + Convert.ToString(dt.Rows.Count) + "条记录"; + m_InitDataGridViewX1(dt, strLable, "", true); + + + + } private void chartAllAreaPipeline_MouseMove(object sender, MouseEventArgs e) { HitTestResult result = chartAllAreaPipeline.HitTest(e.X, e.Y, true); @@ -193,10 +147,10 @@ { globeControl1.Globe.ClearAnalysis(); //layerTemp.RemoveAllFeature(); - panel.Visible = false; - dataGridViewX1.DataSource = null; - dataGridViewX1.Refresh(); - toolStripNumbers.Text = "类型:"; + //panel.Visible = false; + //dataGridViewX1.DataSource = null; + //dataGridViewX1.Refresh(); + //toolStripNumbers.Text = "类型:"; for (int i = 0; i < globeControl1.Globe.Layers.Count; i++) { GSOLayer layer = globeControl1.Globe.Layers[i]; @@ -210,8 +164,9 @@ } } } - //m_InitDataGridViewX1(null,"","" , false); + globeControl1.Globe.MemoryLayer.RemoveAllFeature(); + m_InitDataGridViewX1(null, "", "", false); } private void 导出统计专题图ToolStripMenuItem_Click(object sender, EventArgs e) @@ -220,7 +175,11 @@ frm.Show(); } - //获取指定layer类型的附属物名称列表 + /// + /// 获取指定layer类型的附属物名称列表 + /// + /// + /// public string[] getLayerAccNames(string layerType) { GSOLayer layer = globeControl1.Globe.Layers.GetLayerByCaption(layerType + "管线附属物"); @@ -245,8 +204,7 @@ /// 获取区域内各图层的井、孔、蓖的map /// /// 区域 - /// 要查找的附属物名称数组、如井、孔、蓖 - /// 返回值为:<图层+附属物名称,附属物列表> + /// 返回值为:图层+附属物名称,附属物列表 public Dictionary getAccsMap(GSOGeoPolygon3D polygon) { diff --git a/MainFrm.cs b/MainFrm.cs index b584749..d90fe55 100644 --- a/MainFrm.cs +++ b/MainFrm.cs @@ -2979,7 +2979,8 @@ // } //} - FrmAllWorkWellStatis frmWell = new FrmAllWorkWellStatis(polygon, dataGridViewX1, toolStripNumbers, globeControl1, panelOfTable); + //FrmAllWorkWellStatis frmWell = new FrmAllWorkWellStatis(polygon, dataGridViewX1, toolStripNumbers, globeControl1, panelOfTable); + FrmAllWorkWellStatis frmWell = new FrmAllWorkWellStatis(globeControl1, polygon, new DataGridViewDelegate(InitDataGridViewX1)); frmWell.Show(this); globeControl1.Globe.Action = EnumAction3D.ActionNull; @@ -9770,7 +9771,8 @@ // } //} - FrmAllWorkWellStatis frm = new FrmAllWorkWellStatis(null, dataGridViewX1, toolStripNumbers, globeControl1, panelOfTable); + //FrmAllWorkWellStatis frm = new FrmAllWorkWellStatis(null, dataGridViewX1, toolStripNumbers, globeControl1, panelOfTable); + FrmAllWorkWellStatis frm = new FrmAllWorkWellStatis(globeControl1, null, new DataGridViewDelegate(InitDataGridViewX1)); frm.Show(this); } /// diff --git a/Cyberpipe.suo b/Cyberpipe.suo index c38d01e..fe31fe2 100644 --- a/Cyberpipe.suo +++ b/Cyberpipe.suo Binary files differ diff --git a/FrmAllWorkWellStatis.cs b/FrmAllWorkWellStatis.cs index fe2b7f8..3f230df 100644 --- a/FrmAllWorkWellStatis.cs +++ b/FrmAllWorkWellStatis.cs @@ -17,22 +17,20 @@ private MainFrm.DataGridViewDelegate m_InitDataGridViewX1; private Dictionary map = null; - DataGridView dataGridViewX1; - ToolStripStatusLabel toolStripNumbers; - GSOGlobeControl globeControl1; - PanelEx panel; + private GSOGlobeControl globeControl1; + private GSOGeoPolygon3D polygon; //TODOLIST:用晓伟的代理进行操作,功能拆分细化 - public FrmAllWorkWellStatis(GSOGeoPolygon3D polygon, DataGridView dataGridViewX11, ToolStripStatusLabel toolStripNumbers1, GSOGlobeControl ctl, PanelEx p) - { - InitializeComponent(); - panel = p; - dataGridViewX1 = dataGridViewX11; - toolStripNumbers = toolStripNumbers1; - globeControl1 = ctl; - map = getAccsMap(polygon); + //public FrmAllWorkWellStatis(GSOGeoPolygon3D polygon, DataGridView dataGridViewX11, ToolStripStatusLabel toolStripNumbers1, GSOGlobeControl ctl, PanelEx p) + //{ + // InitializeComponent(); + // panel = p; + // dataGridViewX1 = dataGridViewX11; + // toolStripNumbers = toolStripNumbers1; + // globeControl1 = ctl; + // map = getAccsMap(polygon); - } - public FrmAllWorkWellStatis(GSOGeoPolygon3D polygon, MainFrm.DataGridViewDelegate InitDataGridViewX1, GSOGlobeControl ctl) + //} + public FrmAllWorkWellStatis(GSOGlobeControl ctl,GSOGeoPolygon3D polygon, MainFrm.DataGridViewDelegate InitDataGridViewX1) { InitializeComponent(); globeControl1 = ctl; @@ -88,93 +86,49 @@ { HitTestResult result = chartAllAreaPipeline.HitTest(e.X, e.Y, true); int indexHit = result.PointIndex; - if (indexHit >= 0) + if (indexHit < 0) return; + + + //GSOFeatures fs = list[indexHit]; + string sql = ""; + + string pipetype = chartAllAreaPipeline.Series["井盖"].Points[indexHit].AxisLabel; + GSOFeatures fs = map[pipetype]; + string layername = ""; + if (pipetype.EndsWith("窖井") || pipetype.EndsWith("表井") || + (pipetype.EndsWith("窨井")) || pipetype.EndsWith("孔") || + pipetype.EndsWith("篦")) { - - //GSOFeatures fs = list[indexHit]; - string sql = ""; - - string pipetype = chartAllAreaPipeline.Series["井盖"].Points[indexHit].AxisLabel; - GSOFeatures fs = map[pipetype]; - string layername = ""; - if (pipetype.EndsWith("窖井") || pipetype.EndsWith("表井") || - (pipetype.EndsWith("窨井")) || pipetype.EndsWith("孔") || - pipetype.EndsWith("篦")) - { - layername = pipetype.Substring(0, pipetype.Length - 2) + "管线附属物"; - } - else - { - layername = pipetype.Substring(0, pipetype.Length - 3) + "管线附属物"; - } - MainFrm.m_CurrentQueryLayer = layername; - GSOLayer layer = globeControl1.Globe.Layers.GetLayerByCaption(layername); - if (layer == null) - { - return; - } - //从图层获取datatable数据,不涉及数据库操作,速度会快一些 - //string [] fieldNames = GSOFeatureUtils.getFields(layername, globeControl1); - //DataTable dt = GSOFeatureUtils.convertGSOFeatures2DataTable(fs,fieldNames); - //if (dt.Rows.Count > 0) - //{ - // dataGridViewX1.DataSource = dt; - // panel.Visible = true; - // toolStripNumbers.Text = " 井盖类型:" + pipetype + "||共有:" + Convert.ToString(dt.Rows.Count) + "条记录"; - //} - //else - //{ - // panel.Visible = false; - // dataGridViewX1.DataSource = null; - // dataGridViewX1.Refresh(); - // toolStripNumbers.Text = "类型:"; - //} - //数据库获取数据 - if (fs.Length > 0) - { - sql = "select " + getpipeLineFields.getFields(layername, globeControl1) + " from " + layer.Name; - sql += " where "; - for (int i = 0; i < fs.Length; i++) - { - if (i == 0) - { - if (fs[i].GetFieldDefn("编号") != null) - { - sql += " 编号='" + fs[i].GetValue("编号").ToString() + "'"; - } - } - else - { - if (fs[i].GetFieldDefn("编号") != null) - { - sql += " or 编号 = '" + fs[i].GetValue("编号").ToString() + "'"; - } - } - } - - DataTable dt = OledbHelper.QueryTable(sql); - if (dt.Rows.Count > 0) - { - dataGridViewX1.DataSource = dt; - panel.Visible = true; - string strLable = toolStripNumbers.Text = " 井盖类型:" + pipetype + "||共有:" + Convert.ToString(dt.Rows.Count) + "条记录"; - //m_InitDataGridViewX1(dt, strLable, "", true); - } - else - { - panel.Visible = false; - dataGridViewX1.DataSource = null; - dataGridViewX1.Refresh(); - toolStripNumbers.Text = "类型:"; - } - - - - } + layername = pipetype.Substring(0, pipetype.Length - 2) + "管线附属物"; + } + else + { + layername = pipetype.Substring(0, pipetype.Length - 3) + "管线附属物"; + } + //MainFrm.m_CurrentQueryLayer = layername; + GSOLayer layer = globeControl1.Globe.Layers.GetLayerByCaption(layername); + if (layer == null || fs.Length <= 0) + { + return; } - } + sql = "select " + getpipeLineFields.getFields(layername, globeControl1) + " from " + layer.Name; + sql += " where 1>2 "; + for (int i = 0; i < fs.Length && fs[i].GetFieldDefn("编号") != null; i++) + { + sql += " or 编号 = '" + fs[i].GetValue("编号").ToString() + "'"; + + } + + DataTable dt = OledbHelper.QueryTable(sql); + + string strLable = " 井盖类型:" + pipetype + "||共有:" + Convert.ToString(dt.Rows.Count) + "条记录"; + m_InitDataGridViewX1(dt, strLable, "", true); + + + + } private void chartAllAreaPipeline_MouseMove(object sender, MouseEventArgs e) { HitTestResult result = chartAllAreaPipeline.HitTest(e.X, e.Y, true); @@ -193,10 +147,10 @@ { globeControl1.Globe.ClearAnalysis(); //layerTemp.RemoveAllFeature(); - panel.Visible = false; - dataGridViewX1.DataSource = null; - dataGridViewX1.Refresh(); - toolStripNumbers.Text = "类型:"; + //panel.Visible = false; + //dataGridViewX1.DataSource = null; + //dataGridViewX1.Refresh(); + //toolStripNumbers.Text = "类型:"; for (int i = 0; i < globeControl1.Globe.Layers.Count; i++) { GSOLayer layer = globeControl1.Globe.Layers[i]; @@ -210,8 +164,9 @@ } } } - //m_InitDataGridViewX1(null,"","" , false); + globeControl1.Globe.MemoryLayer.RemoveAllFeature(); + m_InitDataGridViewX1(null, "", "", false); } private void 导出统计专题图ToolStripMenuItem_Click(object sender, EventArgs e) @@ -220,7 +175,11 @@ frm.Show(); } - //获取指定layer类型的附属物名称列表 + /// + /// 获取指定layer类型的附属物名称列表 + /// + /// + /// public string[] getLayerAccNames(string layerType) { GSOLayer layer = globeControl1.Globe.Layers.GetLayerByCaption(layerType + "管线附属物"); @@ -245,8 +204,7 @@ /// 获取区域内各图层的井、孔、蓖的map /// /// 区域 - /// 要查找的附属物名称数组、如井、孔、蓖 - /// 返回值为:<图层+附属物名称,附属物列表> + /// 返回值为:图层+附属物名称,附属物列表 public Dictionary getAccsMap(GSOGeoPolygon3D polygon) { diff --git a/MainFrm.cs b/MainFrm.cs index b584749..d90fe55 100644 --- a/MainFrm.cs +++ b/MainFrm.cs @@ -2979,7 +2979,8 @@ // } //} - FrmAllWorkWellStatis frmWell = new FrmAllWorkWellStatis(polygon, dataGridViewX1, toolStripNumbers, globeControl1, panelOfTable); + //FrmAllWorkWellStatis frmWell = new FrmAllWorkWellStatis(polygon, dataGridViewX1, toolStripNumbers, globeControl1, panelOfTable); + FrmAllWorkWellStatis frmWell = new FrmAllWorkWellStatis(globeControl1, polygon, new DataGridViewDelegate(InitDataGridViewX1)); frmWell.Show(this); globeControl1.Globe.Action = EnumAction3D.ActionNull; @@ -9770,7 +9771,8 @@ // } //} - FrmAllWorkWellStatis frm = new FrmAllWorkWellStatis(null, dataGridViewX1, toolStripNumbers, globeControl1, panelOfTable); + //FrmAllWorkWellStatis frm = new FrmAllWorkWellStatis(null, dataGridViewX1, toolStripNumbers, globeControl1, panelOfTable); + FrmAllWorkWellStatis frm = new FrmAllWorkWellStatis(globeControl1, null, new DataGridViewDelegate(InitDataGridViewX1)); frm.Show(this); } /// diff --git a/bin/x86/Debug/Cyberpipe.exe b/bin/x86/Debug/Cyberpipe.exe index db2138e..771434f 100644 --- a/bin/x86/Debug/Cyberpipe.exe +++ b/bin/x86/Debug/Cyberpipe.exe Binary files differ diff --git a/Cyberpipe.suo b/Cyberpipe.suo index c38d01e..fe31fe2 100644 --- a/Cyberpipe.suo +++ b/Cyberpipe.suo Binary files differ diff --git a/FrmAllWorkWellStatis.cs b/FrmAllWorkWellStatis.cs index fe2b7f8..3f230df 100644 --- a/FrmAllWorkWellStatis.cs +++ b/FrmAllWorkWellStatis.cs @@ -17,22 +17,20 @@ private MainFrm.DataGridViewDelegate m_InitDataGridViewX1; private Dictionary map = null; - DataGridView dataGridViewX1; - ToolStripStatusLabel toolStripNumbers; - GSOGlobeControl globeControl1; - PanelEx panel; + private GSOGlobeControl globeControl1; + private GSOGeoPolygon3D polygon; //TODOLIST:用晓伟的代理进行操作,功能拆分细化 - public FrmAllWorkWellStatis(GSOGeoPolygon3D polygon, DataGridView dataGridViewX11, ToolStripStatusLabel toolStripNumbers1, GSOGlobeControl ctl, PanelEx p) - { - InitializeComponent(); - panel = p; - dataGridViewX1 = dataGridViewX11; - toolStripNumbers = toolStripNumbers1; - globeControl1 = ctl; - map = getAccsMap(polygon); + //public FrmAllWorkWellStatis(GSOGeoPolygon3D polygon, DataGridView dataGridViewX11, ToolStripStatusLabel toolStripNumbers1, GSOGlobeControl ctl, PanelEx p) + //{ + // InitializeComponent(); + // panel = p; + // dataGridViewX1 = dataGridViewX11; + // toolStripNumbers = toolStripNumbers1; + // globeControl1 = ctl; + // map = getAccsMap(polygon); - } - public FrmAllWorkWellStatis(GSOGeoPolygon3D polygon, MainFrm.DataGridViewDelegate InitDataGridViewX1, GSOGlobeControl ctl) + //} + public FrmAllWorkWellStatis(GSOGlobeControl ctl,GSOGeoPolygon3D polygon, MainFrm.DataGridViewDelegate InitDataGridViewX1) { InitializeComponent(); globeControl1 = ctl; @@ -88,93 +86,49 @@ { HitTestResult result = chartAllAreaPipeline.HitTest(e.X, e.Y, true); int indexHit = result.PointIndex; - if (indexHit >= 0) + if (indexHit < 0) return; + + + //GSOFeatures fs = list[indexHit]; + string sql = ""; + + string pipetype = chartAllAreaPipeline.Series["井盖"].Points[indexHit].AxisLabel; + GSOFeatures fs = map[pipetype]; + string layername = ""; + if (pipetype.EndsWith("窖井") || pipetype.EndsWith("表井") || + (pipetype.EndsWith("窨井")) || pipetype.EndsWith("孔") || + pipetype.EndsWith("篦")) { - - //GSOFeatures fs = list[indexHit]; - string sql = ""; - - string pipetype = chartAllAreaPipeline.Series["井盖"].Points[indexHit].AxisLabel; - GSOFeatures fs = map[pipetype]; - string layername = ""; - if (pipetype.EndsWith("窖井") || pipetype.EndsWith("表井") || - (pipetype.EndsWith("窨井")) || pipetype.EndsWith("孔") || - pipetype.EndsWith("篦")) - { - layername = pipetype.Substring(0, pipetype.Length - 2) + "管线附属物"; - } - else - { - layername = pipetype.Substring(0, pipetype.Length - 3) + "管线附属物"; - } - MainFrm.m_CurrentQueryLayer = layername; - GSOLayer layer = globeControl1.Globe.Layers.GetLayerByCaption(layername); - if (layer == null) - { - return; - } - //从图层获取datatable数据,不涉及数据库操作,速度会快一些 - //string [] fieldNames = GSOFeatureUtils.getFields(layername, globeControl1); - //DataTable dt = GSOFeatureUtils.convertGSOFeatures2DataTable(fs,fieldNames); - //if (dt.Rows.Count > 0) - //{ - // dataGridViewX1.DataSource = dt; - // panel.Visible = true; - // toolStripNumbers.Text = " 井盖类型:" + pipetype + "||共有:" + Convert.ToString(dt.Rows.Count) + "条记录"; - //} - //else - //{ - // panel.Visible = false; - // dataGridViewX1.DataSource = null; - // dataGridViewX1.Refresh(); - // toolStripNumbers.Text = "类型:"; - //} - //数据库获取数据 - if (fs.Length > 0) - { - sql = "select " + getpipeLineFields.getFields(layername, globeControl1) + " from " + layer.Name; - sql += " where "; - for (int i = 0; i < fs.Length; i++) - { - if (i == 0) - { - if (fs[i].GetFieldDefn("编号") != null) - { - sql += " 编号='" + fs[i].GetValue("编号").ToString() + "'"; - } - } - else - { - if (fs[i].GetFieldDefn("编号") != null) - { - sql += " or 编号 = '" + fs[i].GetValue("编号").ToString() + "'"; - } - } - } - - DataTable dt = OledbHelper.QueryTable(sql); - if (dt.Rows.Count > 0) - { - dataGridViewX1.DataSource = dt; - panel.Visible = true; - string strLable = toolStripNumbers.Text = " 井盖类型:" + pipetype + "||共有:" + Convert.ToString(dt.Rows.Count) + "条记录"; - //m_InitDataGridViewX1(dt, strLable, "", true); - } - else - { - panel.Visible = false; - dataGridViewX1.DataSource = null; - dataGridViewX1.Refresh(); - toolStripNumbers.Text = "类型:"; - } - - - - } + layername = pipetype.Substring(0, pipetype.Length - 2) + "管线附属物"; + } + else + { + layername = pipetype.Substring(0, pipetype.Length - 3) + "管线附属物"; + } + //MainFrm.m_CurrentQueryLayer = layername; + GSOLayer layer = globeControl1.Globe.Layers.GetLayerByCaption(layername); + if (layer == null || fs.Length <= 0) + { + return; } - } + sql = "select " + getpipeLineFields.getFields(layername, globeControl1) + " from " + layer.Name; + sql += " where 1>2 "; + for (int i = 0; i < fs.Length && fs[i].GetFieldDefn("编号") != null; i++) + { + sql += " or 编号 = '" + fs[i].GetValue("编号").ToString() + "'"; + + } + + DataTable dt = OledbHelper.QueryTable(sql); + + string strLable = " 井盖类型:" + pipetype + "||共有:" + Convert.ToString(dt.Rows.Count) + "条记录"; + m_InitDataGridViewX1(dt, strLable, "", true); + + + + } private void chartAllAreaPipeline_MouseMove(object sender, MouseEventArgs e) { HitTestResult result = chartAllAreaPipeline.HitTest(e.X, e.Y, true); @@ -193,10 +147,10 @@ { globeControl1.Globe.ClearAnalysis(); //layerTemp.RemoveAllFeature(); - panel.Visible = false; - dataGridViewX1.DataSource = null; - dataGridViewX1.Refresh(); - toolStripNumbers.Text = "类型:"; + //panel.Visible = false; + //dataGridViewX1.DataSource = null; + //dataGridViewX1.Refresh(); + //toolStripNumbers.Text = "类型:"; for (int i = 0; i < globeControl1.Globe.Layers.Count; i++) { GSOLayer layer = globeControl1.Globe.Layers[i]; @@ -210,8 +164,9 @@ } } } - //m_InitDataGridViewX1(null,"","" , false); + globeControl1.Globe.MemoryLayer.RemoveAllFeature(); + m_InitDataGridViewX1(null, "", "", false); } private void 导出统计专题图ToolStripMenuItem_Click(object sender, EventArgs e) @@ -220,7 +175,11 @@ frm.Show(); } - //获取指定layer类型的附属物名称列表 + /// + /// 获取指定layer类型的附属物名称列表 + /// + /// + /// public string[] getLayerAccNames(string layerType) { GSOLayer layer = globeControl1.Globe.Layers.GetLayerByCaption(layerType + "管线附属物"); @@ -245,8 +204,7 @@ /// 获取区域内各图层的井、孔、蓖的map /// /// 区域 - /// 要查找的附属物名称数组、如井、孔、蓖 - /// 返回值为:<图层+附属物名称,附属物列表> + /// 返回值为:图层+附属物名称,附属物列表 public Dictionary getAccsMap(GSOGeoPolygon3D polygon) { diff --git a/MainFrm.cs b/MainFrm.cs index b584749..d90fe55 100644 --- a/MainFrm.cs +++ b/MainFrm.cs @@ -2979,7 +2979,8 @@ // } //} - FrmAllWorkWellStatis frmWell = new FrmAllWorkWellStatis(polygon, dataGridViewX1, toolStripNumbers, globeControl1, panelOfTable); + //FrmAllWorkWellStatis frmWell = new FrmAllWorkWellStatis(polygon, dataGridViewX1, toolStripNumbers, globeControl1, panelOfTable); + FrmAllWorkWellStatis frmWell = new FrmAllWorkWellStatis(globeControl1, polygon, new DataGridViewDelegate(InitDataGridViewX1)); frmWell.Show(this); globeControl1.Globe.Action = EnumAction3D.ActionNull; @@ -9770,7 +9771,8 @@ // } //} - FrmAllWorkWellStatis frm = new FrmAllWorkWellStatis(null, dataGridViewX1, toolStripNumbers, globeControl1, panelOfTable); + //FrmAllWorkWellStatis frm = new FrmAllWorkWellStatis(null, dataGridViewX1, toolStripNumbers, globeControl1, panelOfTable); + FrmAllWorkWellStatis frm = new FrmAllWorkWellStatis(globeControl1, null, new DataGridViewDelegate(InitDataGridViewX1)); frm.Show(this); } /// diff --git a/bin/x86/Debug/Cyberpipe.exe b/bin/x86/Debug/Cyberpipe.exe index db2138e..771434f 100644 --- a/bin/x86/Debug/Cyberpipe.exe +++ b/bin/x86/Debug/Cyberpipe.exe Binary files differ diff --git a/bin/x86/Debug/Cyberpipe.pdb b/bin/x86/Debug/Cyberpipe.pdb index c1fbc5e..187c222 100644 --- a/bin/x86/Debug/Cyberpipe.pdb +++ b/bin/x86/Debug/Cyberpipe.pdb Binary files differ diff --git a/Cyberpipe.suo b/Cyberpipe.suo index c38d01e..fe31fe2 100644 --- a/Cyberpipe.suo +++ b/Cyberpipe.suo Binary files differ diff --git a/FrmAllWorkWellStatis.cs b/FrmAllWorkWellStatis.cs index fe2b7f8..3f230df 100644 --- a/FrmAllWorkWellStatis.cs +++ b/FrmAllWorkWellStatis.cs @@ -17,22 +17,20 @@ private MainFrm.DataGridViewDelegate m_InitDataGridViewX1; private Dictionary map = null; - DataGridView dataGridViewX1; - ToolStripStatusLabel toolStripNumbers; - GSOGlobeControl globeControl1; - PanelEx panel; + private GSOGlobeControl globeControl1; + private GSOGeoPolygon3D polygon; //TODOLIST:用晓伟的代理进行操作,功能拆分细化 - public FrmAllWorkWellStatis(GSOGeoPolygon3D polygon, DataGridView dataGridViewX11, ToolStripStatusLabel toolStripNumbers1, GSOGlobeControl ctl, PanelEx p) - { - InitializeComponent(); - panel = p; - dataGridViewX1 = dataGridViewX11; - toolStripNumbers = toolStripNumbers1; - globeControl1 = ctl; - map = getAccsMap(polygon); + //public FrmAllWorkWellStatis(GSOGeoPolygon3D polygon, DataGridView dataGridViewX11, ToolStripStatusLabel toolStripNumbers1, GSOGlobeControl ctl, PanelEx p) + //{ + // InitializeComponent(); + // panel = p; + // dataGridViewX1 = dataGridViewX11; + // toolStripNumbers = toolStripNumbers1; + // globeControl1 = ctl; + // map = getAccsMap(polygon); - } - public FrmAllWorkWellStatis(GSOGeoPolygon3D polygon, MainFrm.DataGridViewDelegate InitDataGridViewX1, GSOGlobeControl ctl) + //} + public FrmAllWorkWellStatis(GSOGlobeControl ctl,GSOGeoPolygon3D polygon, MainFrm.DataGridViewDelegate InitDataGridViewX1) { InitializeComponent(); globeControl1 = ctl; @@ -88,93 +86,49 @@ { HitTestResult result = chartAllAreaPipeline.HitTest(e.X, e.Y, true); int indexHit = result.PointIndex; - if (indexHit >= 0) + if (indexHit < 0) return; + + + //GSOFeatures fs = list[indexHit]; + string sql = ""; + + string pipetype = chartAllAreaPipeline.Series["井盖"].Points[indexHit].AxisLabel; + GSOFeatures fs = map[pipetype]; + string layername = ""; + if (pipetype.EndsWith("窖井") || pipetype.EndsWith("表井") || + (pipetype.EndsWith("窨井")) || pipetype.EndsWith("孔") || + pipetype.EndsWith("篦")) { - - //GSOFeatures fs = list[indexHit]; - string sql = ""; - - string pipetype = chartAllAreaPipeline.Series["井盖"].Points[indexHit].AxisLabel; - GSOFeatures fs = map[pipetype]; - string layername = ""; - if (pipetype.EndsWith("窖井") || pipetype.EndsWith("表井") || - (pipetype.EndsWith("窨井")) || pipetype.EndsWith("孔") || - pipetype.EndsWith("篦")) - { - layername = pipetype.Substring(0, pipetype.Length - 2) + "管线附属物"; - } - else - { - layername = pipetype.Substring(0, pipetype.Length - 3) + "管线附属物"; - } - MainFrm.m_CurrentQueryLayer = layername; - GSOLayer layer = globeControl1.Globe.Layers.GetLayerByCaption(layername); - if (layer == null) - { - return; - } - //从图层获取datatable数据,不涉及数据库操作,速度会快一些 - //string [] fieldNames = GSOFeatureUtils.getFields(layername, globeControl1); - //DataTable dt = GSOFeatureUtils.convertGSOFeatures2DataTable(fs,fieldNames); - //if (dt.Rows.Count > 0) - //{ - // dataGridViewX1.DataSource = dt; - // panel.Visible = true; - // toolStripNumbers.Text = " 井盖类型:" + pipetype + "||共有:" + Convert.ToString(dt.Rows.Count) + "条记录"; - //} - //else - //{ - // panel.Visible = false; - // dataGridViewX1.DataSource = null; - // dataGridViewX1.Refresh(); - // toolStripNumbers.Text = "类型:"; - //} - //数据库获取数据 - if (fs.Length > 0) - { - sql = "select " + getpipeLineFields.getFields(layername, globeControl1) + " from " + layer.Name; - sql += " where "; - for (int i = 0; i < fs.Length; i++) - { - if (i == 0) - { - if (fs[i].GetFieldDefn("编号") != null) - { - sql += " 编号='" + fs[i].GetValue("编号").ToString() + "'"; - } - } - else - { - if (fs[i].GetFieldDefn("编号") != null) - { - sql += " or 编号 = '" + fs[i].GetValue("编号").ToString() + "'"; - } - } - } - - DataTable dt = OledbHelper.QueryTable(sql); - if (dt.Rows.Count > 0) - { - dataGridViewX1.DataSource = dt; - panel.Visible = true; - string strLable = toolStripNumbers.Text = " 井盖类型:" + pipetype + "||共有:" + Convert.ToString(dt.Rows.Count) + "条记录"; - //m_InitDataGridViewX1(dt, strLable, "", true); - } - else - { - panel.Visible = false; - dataGridViewX1.DataSource = null; - dataGridViewX1.Refresh(); - toolStripNumbers.Text = "类型:"; - } - - - - } + layername = pipetype.Substring(0, pipetype.Length - 2) + "管线附属物"; + } + else + { + layername = pipetype.Substring(0, pipetype.Length - 3) + "管线附属物"; + } + //MainFrm.m_CurrentQueryLayer = layername; + GSOLayer layer = globeControl1.Globe.Layers.GetLayerByCaption(layername); + if (layer == null || fs.Length <= 0) + { + return; } - } + sql = "select " + getpipeLineFields.getFields(layername, globeControl1) + " from " + layer.Name; + sql += " where 1>2 "; + for (int i = 0; i < fs.Length && fs[i].GetFieldDefn("编号") != null; i++) + { + sql += " or 编号 = '" + fs[i].GetValue("编号").ToString() + "'"; + + } + + DataTable dt = OledbHelper.QueryTable(sql); + + string strLable = " 井盖类型:" + pipetype + "||共有:" + Convert.ToString(dt.Rows.Count) + "条记录"; + m_InitDataGridViewX1(dt, strLable, "", true); + + + + } private void chartAllAreaPipeline_MouseMove(object sender, MouseEventArgs e) { HitTestResult result = chartAllAreaPipeline.HitTest(e.X, e.Y, true); @@ -193,10 +147,10 @@ { globeControl1.Globe.ClearAnalysis(); //layerTemp.RemoveAllFeature(); - panel.Visible = false; - dataGridViewX1.DataSource = null; - dataGridViewX1.Refresh(); - toolStripNumbers.Text = "类型:"; + //panel.Visible = false; + //dataGridViewX1.DataSource = null; + //dataGridViewX1.Refresh(); + //toolStripNumbers.Text = "类型:"; for (int i = 0; i < globeControl1.Globe.Layers.Count; i++) { GSOLayer layer = globeControl1.Globe.Layers[i]; @@ -210,8 +164,9 @@ } } } - //m_InitDataGridViewX1(null,"","" , false); + globeControl1.Globe.MemoryLayer.RemoveAllFeature(); + m_InitDataGridViewX1(null, "", "", false); } private void 导出统计专题图ToolStripMenuItem_Click(object sender, EventArgs e) @@ -220,7 +175,11 @@ frm.Show(); } - //获取指定layer类型的附属物名称列表 + /// + /// 获取指定layer类型的附属物名称列表 + /// + /// + /// public string[] getLayerAccNames(string layerType) { GSOLayer layer = globeControl1.Globe.Layers.GetLayerByCaption(layerType + "管线附属物"); @@ -245,8 +204,7 @@ /// 获取区域内各图层的井、孔、蓖的map /// /// 区域 - /// 要查找的附属物名称数组、如井、孔、蓖 - /// 返回值为:<图层+附属物名称,附属物列表> + /// 返回值为:图层+附属物名称,附属物列表 public Dictionary getAccsMap(GSOGeoPolygon3D polygon) { diff --git a/MainFrm.cs b/MainFrm.cs index b584749..d90fe55 100644 --- a/MainFrm.cs +++ b/MainFrm.cs @@ -2979,7 +2979,8 @@ // } //} - FrmAllWorkWellStatis frmWell = new FrmAllWorkWellStatis(polygon, dataGridViewX1, toolStripNumbers, globeControl1, panelOfTable); + //FrmAllWorkWellStatis frmWell = new FrmAllWorkWellStatis(polygon, dataGridViewX1, toolStripNumbers, globeControl1, panelOfTable); + FrmAllWorkWellStatis frmWell = new FrmAllWorkWellStatis(globeControl1, polygon, new DataGridViewDelegate(InitDataGridViewX1)); frmWell.Show(this); globeControl1.Globe.Action = EnumAction3D.ActionNull; @@ -9770,7 +9771,8 @@ // } //} - FrmAllWorkWellStatis frm = new FrmAllWorkWellStatis(null, dataGridViewX1, toolStripNumbers, globeControl1, panelOfTable); + //FrmAllWorkWellStatis frm = new FrmAllWorkWellStatis(null, dataGridViewX1, toolStripNumbers, globeControl1, panelOfTable); + FrmAllWorkWellStatis frm = new FrmAllWorkWellStatis(globeControl1, null, new DataGridViewDelegate(InitDataGridViewX1)); frm.Show(this); } /// diff --git a/bin/x86/Debug/Cyberpipe.exe b/bin/x86/Debug/Cyberpipe.exe index db2138e..771434f 100644 --- a/bin/x86/Debug/Cyberpipe.exe +++ b/bin/x86/Debug/Cyberpipe.exe Binary files differ diff --git a/bin/x86/Debug/Cyberpipe.pdb b/bin/x86/Debug/Cyberpipe.pdb index c1fbc5e..187c222 100644 --- a/bin/x86/Debug/Cyberpipe.pdb +++ b/bin/x86/Debug/Cyberpipe.pdb Binary files differ diff --git a/obj/x64/Debug/Cyberpipe.exe b/obj/x64/Debug/Cyberpipe.exe index db2138e..771434f 100644 --- a/obj/x64/Debug/Cyberpipe.exe +++ b/obj/x64/Debug/Cyberpipe.exe Binary files differ diff --git a/Cyberpipe.suo b/Cyberpipe.suo index c38d01e..fe31fe2 100644 --- a/Cyberpipe.suo +++ b/Cyberpipe.suo Binary files differ diff --git a/FrmAllWorkWellStatis.cs b/FrmAllWorkWellStatis.cs index fe2b7f8..3f230df 100644 --- a/FrmAllWorkWellStatis.cs +++ b/FrmAllWorkWellStatis.cs @@ -17,22 +17,20 @@ private MainFrm.DataGridViewDelegate m_InitDataGridViewX1; private Dictionary map = null; - DataGridView dataGridViewX1; - ToolStripStatusLabel toolStripNumbers; - GSOGlobeControl globeControl1; - PanelEx panel; + private GSOGlobeControl globeControl1; + private GSOGeoPolygon3D polygon; //TODOLIST:用晓伟的代理进行操作,功能拆分细化 - public FrmAllWorkWellStatis(GSOGeoPolygon3D polygon, DataGridView dataGridViewX11, ToolStripStatusLabel toolStripNumbers1, GSOGlobeControl ctl, PanelEx p) - { - InitializeComponent(); - panel = p; - dataGridViewX1 = dataGridViewX11; - toolStripNumbers = toolStripNumbers1; - globeControl1 = ctl; - map = getAccsMap(polygon); + //public FrmAllWorkWellStatis(GSOGeoPolygon3D polygon, DataGridView dataGridViewX11, ToolStripStatusLabel toolStripNumbers1, GSOGlobeControl ctl, PanelEx p) + //{ + // InitializeComponent(); + // panel = p; + // dataGridViewX1 = dataGridViewX11; + // toolStripNumbers = toolStripNumbers1; + // globeControl1 = ctl; + // map = getAccsMap(polygon); - } - public FrmAllWorkWellStatis(GSOGeoPolygon3D polygon, MainFrm.DataGridViewDelegate InitDataGridViewX1, GSOGlobeControl ctl) + //} + public FrmAllWorkWellStatis(GSOGlobeControl ctl,GSOGeoPolygon3D polygon, MainFrm.DataGridViewDelegate InitDataGridViewX1) { InitializeComponent(); globeControl1 = ctl; @@ -88,93 +86,49 @@ { HitTestResult result = chartAllAreaPipeline.HitTest(e.X, e.Y, true); int indexHit = result.PointIndex; - if (indexHit >= 0) + if (indexHit < 0) return; + + + //GSOFeatures fs = list[indexHit]; + string sql = ""; + + string pipetype = chartAllAreaPipeline.Series["井盖"].Points[indexHit].AxisLabel; + GSOFeatures fs = map[pipetype]; + string layername = ""; + if (pipetype.EndsWith("窖井") || pipetype.EndsWith("表井") || + (pipetype.EndsWith("窨井")) || pipetype.EndsWith("孔") || + pipetype.EndsWith("篦")) { - - //GSOFeatures fs = list[indexHit]; - string sql = ""; - - string pipetype = chartAllAreaPipeline.Series["井盖"].Points[indexHit].AxisLabel; - GSOFeatures fs = map[pipetype]; - string layername = ""; - if (pipetype.EndsWith("窖井") || pipetype.EndsWith("表井") || - (pipetype.EndsWith("窨井")) || pipetype.EndsWith("孔") || - pipetype.EndsWith("篦")) - { - layername = pipetype.Substring(0, pipetype.Length - 2) + "管线附属物"; - } - else - { - layername = pipetype.Substring(0, pipetype.Length - 3) + "管线附属物"; - } - MainFrm.m_CurrentQueryLayer = layername; - GSOLayer layer = globeControl1.Globe.Layers.GetLayerByCaption(layername); - if (layer == null) - { - return; - } - //从图层获取datatable数据,不涉及数据库操作,速度会快一些 - //string [] fieldNames = GSOFeatureUtils.getFields(layername, globeControl1); - //DataTable dt = GSOFeatureUtils.convertGSOFeatures2DataTable(fs,fieldNames); - //if (dt.Rows.Count > 0) - //{ - // dataGridViewX1.DataSource = dt; - // panel.Visible = true; - // toolStripNumbers.Text = " 井盖类型:" + pipetype + "||共有:" + Convert.ToString(dt.Rows.Count) + "条记录"; - //} - //else - //{ - // panel.Visible = false; - // dataGridViewX1.DataSource = null; - // dataGridViewX1.Refresh(); - // toolStripNumbers.Text = "类型:"; - //} - //数据库获取数据 - if (fs.Length > 0) - { - sql = "select " + getpipeLineFields.getFields(layername, globeControl1) + " from " + layer.Name; - sql += " where "; - for (int i = 0; i < fs.Length; i++) - { - if (i == 0) - { - if (fs[i].GetFieldDefn("编号") != null) - { - sql += " 编号='" + fs[i].GetValue("编号").ToString() + "'"; - } - } - else - { - if (fs[i].GetFieldDefn("编号") != null) - { - sql += " or 编号 = '" + fs[i].GetValue("编号").ToString() + "'"; - } - } - } - - DataTable dt = OledbHelper.QueryTable(sql); - if (dt.Rows.Count > 0) - { - dataGridViewX1.DataSource = dt; - panel.Visible = true; - string strLable = toolStripNumbers.Text = " 井盖类型:" + pipetype + "||共有:" + Convert.ToString(dt.Rows.Count) + "条记录"; - //m_InitDataGridViewX1(dt, strLable, "", true); - } - else - { - panel.Visible = false; - dataGridViewX1.DataSource = null; - dataGridViewX1.Refresh(); - toolStripNumbers.Text = "类型:"; - } - - - - } + layername = pipetype.Substring(0, pipetype.Length - 2) + "管线附属物"; + } + else + { + layername = pipetype.Substring(0, pipetype.Length - 3) + "管线附属物"; + } + //MainFrm.m_CurrentQueryLayer = layername; + GSOLayer layer = globeControl1.Globe.Layers.GetLayerByCaption(layername); + if (layer == null || fs.Length <= 0) + { + return; } - } + sql = "select " + getpipeLineFields.getFields(layername, globeControl1) + " from " + layer.Name; + sql += " where 1>2 "; + for (int i = 0; i < fs.Length && fs[i].GetFieldDefn("编号") != null; i++) + { + sql += " or 编号 = '" + fs[i].GetValue("编号").ToString() + "'"; + + } + + DataTable dt = OledbHelper.QueryTable(sql); + + string strLable = " 井盖类型:" + pipetype + "||共有:" + Convert.ToString(dt.Rows.Count) + "条记录"; + m_InitDataGridViewX1(dt, strLable, "", true); + + + + } private void chartAllAreaPipeline_MouseMove(object sender, MouseEventArgs e) { HitTestResult result = chartAllAreaPipeline.HitTest(e.X, e.Y, true); @@ -193,10 +147,10 @@ { globeControl1.Globe.ClearAnalysis(); //layerTemp.RemoveAllFeature(); - panel.Visible = false; - dataGridViewX1.DataSource = null; - dataGridViewX1.Refresh(); - toolStripNumbers.Text = "类型:"; + //panel.Visible = false; + //dataGridViewX1.DataSource = null; + //dataGridViewX1.Refresh(); + //toolStripNumbers.Text = "类型:"; for (int i = 0; i < globeControl1.Globe.Layers.Count; i++) { GSOLayer layer = globeControl1.Globe.Layers[i]; @@ -210,8 +164,9 @@ } } } - //m_InitDataGridViewX1(null,"","" , false); + globeControl1.Globe.MemoryLayer.RemoveAllFeature(); + m_InitDataGridViewX1(null, "", "", false); } private void 导出统计专题图ToolStripMenuItem_Click(object sender, EventArgs e) @@ -220,7 +175,11 @@ frm.Show(); } - //获取指定layer类型的附属物名称列表 + /// + /// 获取指定layer类型的附属物名称列表 + /// + /// + /// public string[] getLayerAccNames(string layerType) { GSOLayer layer = globeControl1.Globe.Layers.GetLayerByCaption(layerType + "管线附属物"); @@ -245,8 +204,7 @@ /// 获取区域内各图层的井、孔、蓖的map /// /// 区域 - /// 要查找的附属物名称数组、如井、孔、蓖 - /// 返回值为:<图层+附属物名称,附属物列表> + /// 返回值为:图层+附属物名称,附属物列表 public Dictionary getAccsMap(GSOGeoPolygon3D polygon) { diff --git a/MainFrm.cs b/MainFrm.cs index b584749..d90fe55 100644 --- a/MainFrm.cs +++ b/MainFrm.cs @@ -2979,7 +2979,8 @@ // } //} - FrmAllWorkWellStatis frmWell = new FrmAllWorkWellStatis(polygon, dataGridViewX1, toolStripNumbers, globeControl1, panelOfTable); + //FrmAllWorkWellStatis frmWell = new FrmAllWorkWellStatis(polygon, dataGridViewX1, toolStripNumbers, globeControl1, panelOfTable); + FrmAllWorkWellStatis frmWell = new FrmAllWorkWellStatis(globeControl1, polygon, new DataGridViewDelegate(InitDataGridViewX1)); frmWell.Show(this); globeControl1.Globe.Action = EnumAction3D.ActionNull; @@ -9770,7 +9771,8 @@ // } //} - FrmAllWorkWellStatis frm = new FrmAllWorkWellStatis(null, dataGridViewX1, toolStripNumbers, globeControl1, panelOfTable); + //FrmAllWorkWellStatis frm = new FrmAllWorkWellStatis(null, dataGridViewX1, toolStripNumbers, globeControl1, panelOfTable); + FrmAllWorkWellStatis frm = new FrmAllWorkWellStatis(globeControl1, null, new DataGridViewDelegate(InitDataGridViewX1)); frm.Show(this); } /// diff --git a/bin/x86/Debug/Cyberpipe.exe b/bin/x86/Debug/Cyberpipe.exe index db2138e..771434f 100644 --- a/bin/x86/Debug/Cyberpipe.exe +++ b/bin/x86/Debug/Cyberpipe.exe Binary files differ diff --git a/bin/x86/Debug/Cyberpipe.pdb b/bin/x86/Debug/Cyberpipe.pdb index c1fbc5e..187c222 100644 --- a/bin/x86/Debug/Cyberpipe.pdb +++ b/bin/x86/Debug/Cyberpipe.pdb Binary files differ diff --git a/obj/x64/Debug/Cyberpipe.exe b/obj/x64/Debug/Cyberpipe.exe index db2138e..771434f 100644 --- a/obj/x64/Debug/Cyberpipe.exe +++ b/obj/x64/Debug/Cyberpipe.exe Binary files differ diff --git a/obj/x64/Debug/ResolveAssemblyReference.cache b/obj/x64/Debug/ResolveAssemblyReference.cache index 042bafc..3b0c4fc 100644 --- a/obj/x64/Debug/ResolveAssemblyReference.cache +++ b/obj/x64/Debug/ResolveAssemblyReference.cache Binary files differ