diff --git a/Cyberpipe.csproj b/Cyberpipe.csproj
index 4038d91..004ec58 100644
--- a/Cyberpipe.csproj
+++ b/Cyberpipe.csproj
@@ -140,6 +140,10 @@
True
bin\x86\Debug\Interop.DSOFramer.dll
+
+ False
+ bin\x86\Debug\log4net.dll
+
False
@@ -1058,6 +1062,7 @@
+
Form
diff --git a/Cyberpipe.csproj b/Cyberpipe.csproj
index 4038d91..004ec58 100644
--- a/Cyberpipe.csproj
+++ b/Cyberpipe.csproj
@@ -140,6 +140,10 @@
True
bin\x86\Debug\Interop.DSOFramer.dll
+
+ False
+ bin\x86\Debug\log4net.dll
+
False
@@ -1058,6 +1062,7 @@
+
Form
diff --git a/FeatureStatisticsService.cs b/FeatureStatisticsService.cs
index 7b5caad..4320c71 100644
--- a/FeatureStatisticsService.cs
+++ b/FeatureStatisticsService.cs
@@ -20,7 +20,7 @@
///
///
- public GSOFeatures Intersect_PointLayerByType(GSOGeoPolygon3D polygon, GSOLayer layer, string type)
+ public static GSOFeatures Intersect_PointLayerByType(GSOGeoPolygon3D polygon, GSOLayer layer, string type)
{
if (layer == null) return null;
diff --git a/Cyberpipe.csproj b/Cyberpipe.csproj
index 4038d91..004ec58 100644
--- a/Cyberpipe.csproj
+++ b/Cyberpipe.csproj
@@ -140,6 +140,10 @@
True
bin\x86\Debug\Interop.DSOFramer.dll
+
+ False
+ bin\x86\Debug\log4net.dll
+
False
@@ -1058,6 +1062,7 @@
+
Form
diff --git a/FeatureStatisticsService.cs b/FeatureStatisticsService.cs
index 7b5caad..4320c71 100644
--- a/FeatureStatisticsService.cs
+++ b/FeatureStatisticsService.cs
@@ -20,7 +20,7 @@
///
///
- public GSOFeatures Intersect_PointLayerByType(GSOGeoPolygon3D polygon, GSOLayer layer, string type)
+ public static GSOFeatures Intersect_PointLayerByType(GSOGeoPolygon3D polygon, GSOLayer layer, string type)
{
if (layer == null) return null;
diff --git a/FrmAllWorkWellStatis.cs b/FrmAllWorkWellStatis.cs
index 3f230df..7bf65dc 100644
--- a/FrmAllWorkWellStatis.cs
+++ b/FrmAllWorkWellStatis.cs
@@ -35,16 +35,18 @@
InitializeComponent();
globeControl1 = ctl;
m_InitDataGridViewX1 = InitDataGridViewX1;
- map = getAccsMap(polygon);
+ this.polygon = polygon;
+
}
private void FrmAllPipelineStatis_Load(object sender, EventArgs e)
{
+ map = getAccsMap(polygon);
drawChart();
}
- public void drawChart()
+ private void drawChart()
{
try
{
@@ -122,13 +124,11 @@
}
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);
@@ -212,7 +212,6 @@
Dictionary map = new Dictionary();
ArrayList listpt = Utility.LayerNamesList;
if (listpt == null || listpt.Count == 0) return null;
- FeatureStatisticsService service = new FeatureStatisticsService();
for (int i = 0; i < listpt.Count; i++)
{
GSOLayer layer = globeControl1.Globe.Layers.GetLayerByCaption(listpt[i] + "管线附属物");
@@ -223,7 +222,7 @@
if (accNames[j].Contains("井") || accNames[j].Contains("孔") || accNames[j].Contains("篦"))
{
- GSOFeatures features = service.Intersect_PointLayerByType(polygon, layer, accNames[j]);
+ GSOFeatures features = FeatureStatisticsService.Intersect_PointLayerByType(polygon, layer, accNames[j]);
if (features == null) continue;
map.Add(listpt[i] + accNames[j], features);
}
diff --git a/Cyberpipe.csproj b/Cyberpipe.csproj
index 4038d91..004ec58 100644
--- a/Cyberpipe.csproj
+++ b/Cyberpipe.csproj
@@ -140,6 +140,10 @@
True
bin\x86\Debug\Interop.DSOFramer.dll
+
+ False
+ bin\x86\Debug\log4net.dll
+
False
@@ -1058,6 +1062,7 @@
+
Form
diff --git a/FeatureStatisticsService.cs b/FeatureStatisticsService.cs
index 7b5caad..4320c71 100644
--- a/FeatureStatisticsService.cs
+++ b/FeatureStatisticsService.cs
@@ -20,7 +20,7 @@
///
///
- public GSOFeatures Intersect_PointLayerByType(GSOGeoPolygon3D polygon, GSOLayer layer, string type)
+ public static GSOFeatures Intersect_PointLayerByType(GSOGeoPolygon3D polygon, GSOLayer layer, string type)
{
if (layer == null) return null;
diff --git a/FrmAllWorkWellStatis.cs b/FrmAllWorkWellStatis.cs
index 3f230df..7bf65dc 100644
--- a/FrmAllWorkWellStatis.cs
+++ b/FrmAllWorkWellStatis.cs
@@ -35,16 +35,18 @@
InitializeComponent();
globeControl1 = ctl;
m_InitDataGridViewX1 = InitDataGridViewX1;
- map = getAccsMap(polygon);
+ this.polygon = polygon;
+
}
private void FrmAllPipelineStatis_Load(object sender, EventArgs e)
{
+ map = getAccsMap(polygon);
drawChart();
}
- public void drawChart()
+ private void drawChart()
{
try
{
@@ -122,13 +124,11 @@
}
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);
@@ -212,7 +212,6 @@
Dictionary map = new Dictionary();
ArrayList listpt = Utility.LayerNamesList;
if (listpt == null || listpt.Count == 0) return null;
- FeatureStatisticsService service = new FeatureStatisticsService();
for (int i = 0; i < listpt.Count; i++)
{
GSOLayer layer = globeControl1.Globe.Layers.GetLayerByCaption(listpt[i] + "管线附属物");
@@ -223,7 +222,7 @@
if (accNames[j].Contains("井") || accNames[j].Contains("孔") || accNames[j].Contains("篦"))
{
- GSOFeatures features = service.Intersect_PointLayerByType(polygon, layer, accNames[j]);
+ GSOFeatures features = FeatureStatisticsService.Intersect_PointLayerByType(polygon, layer, accNames[j]);
if (features == null) continue;
map.Add(listpt[i] + accNames[j], features);
}
diff --git a/FrmValveStatistics.cs b/FrmValveStatistics.cs
index f8f4d3e..672f97a 100644
--- a/FrmValveStatistics.cs
+++ b/FrmValveStatistics.cs
@@ -9,26 +9,40 @@
using GeoScene.Data;
using GeoScene.Globe;
using DevComponents.DotNetBar;
+using System.Collections;
namespace Cyberpipe
{
public partial class FrmValveStatistics : DevComponents.DotNetBar.Office2007Form
{
- Dictionary workWellLengthAndType = new Dictionary();
- List list = new List();
- GSOGlobeControl globeControl1;
+ //Dictionary workWellLengthAndType = new Dictionary();
+ //List list = new List();
+ //GSOGlobeControl globeControl1;
- DataTable table = new DataTable();
- string strLable = "";
+ //DataTable table = new DataTable();
+ //string strLable = "";
+ //private MainFrm.DataGridViewDelegate m_InitDataGridViewX1;
+
private MainFrm.DataGridViewDelegate m_InitDataGridViewX1;
+ private Dictionary map = null;
+ private GSOGlobeControl globeControl1;
+ private GSOGeoPolygon3D polygon;
- public FrmValveStatistics(Dictionary wellLen, List _list,
- GSOGlobeControl ctl, MainFrm.DataGridViewDelegate initDataGridViewX1)
+ //public FrmValveStatistics(Dictionary wellLen, List _list,
+ // GSOGlobeControl ctl, MainFrm.DataGridViewDelegate initDataGridViewX1)
+ //{
+ // InitializeComponent();
+ // workWellLengthAndType = wellLen;
+ // list = _list;
+ // globeControl1 = ctl;
+ // m_InitDataGridViewX1 = initDataGridViewX1;
+ //}
+
+ public FrmValveStatistics(GSOGlobeControl ctl, GSOGeoPolygon3D polygon, MainFrm.DataGridViewDelegate InitDataGridViewX1)
{
InitializeComponent();
- workWellLengthAndType = wellLen;
- list = _list;
globeControl1 = ctl;
- m_InitDataGridViewX1 = initDataGridViewX1;
+ m_InitDataGridViewX1 = InitDataGridViewX1;
+ this.polygon = polygon;
}
///
/// 窗体初始化事件处理
@@ -37,8 +51,13 @@
///
private void FrmLayerSelectedQuery_Load(object sender, EventArgs e)
{
+ this.map = getValveMap(polygon) ;
+ drawChart();
+ }
+
+ private void drawChart() {
try
- {
+ {
chaFamenStatis.ChartAreas["ChartArea1"].AxisX.Title = "阀门类型";
chaFamenStatis.ChartAreas["ChartArea1"].AxisY.Title = "阀门个数";
chaFamenStatis.ChartAreas["ChartArea1"].AxisX.Interval = 1;
@@ -51,14 +70,19 @@
chaFamenStatis.Series["阀门"]["DrawingStyle"] = "Cylinder";
chaFamenStatis.Series["阀门"].IsValueShownAsLabel = true;
+ Dictionary workWellLengthAndType = new Dictionary();
+ foreach (KeyValuePair kv in map)
+ {
+ workWellLengthAndType.Add(kv.Key, kv.Value.Length);
+ }
chaFamenStatis.Series["阀门"].Points.DataBindXY(workWellLengthAndType.Keys, workWellLengthAndType.Values);
for (int m = 0; m < workWellLengthAndType.Values.Count; m++)
{
if (chaFamenStatis.Series["阀门"].Points[m].YValues[0].ToString() != "0")
{
chaFamenStatis.Series["阀门"].Points[m].Label = chaFamenStatis.Series[0].Points[m].YValues[0].ToString();
- }
- }
+ }
+ }
}
catch (Exception ex)
{
@@ -77,52 +101,32 @@
int indexHit = result.PointIndex;
if (indexHit >= 0)
{
-
- GSOFeatures fs = list[indexHit];
+
+ //GSOFeatures fs = list[indexHit];
string sql = "";
string pipetype = chaFamenStatis.Series["阀门"].Points[indexHit].AxisLabel;
+ GSOFeatures fs = map[pipetype];
string layername = pipetype.Substring(0, pipetype.Length - 2) + "管线附属物";
- MainFrm.m_CurrentQueryLayer = layername;
+ //MainFrm.m_CurrentQueryLayer = layername;
GSOLayer layer = globeControl1.Globe.Layers.GetLayerByCaption(layername);
- if (layer == null)
+ if (layer == null || fs.Length <= 0)
{
return;
}
- 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() + "'";
- }
- }
- }
- table = OledbHelper.QueryTable(sql);
- if (table.Rows.Count > 0)
- {
- strLable = " 阀门类型:" + pipetype + "||共有:" + Convert.ToString(table.Rows.Count) + "条记录";
- m_InitDataGridViewX1(table, strLable, layername, true);
- }
- else
- {
- return;
- }
+ sql = "select " + getpipeLineFields.getFields(layername, globeControl1) + " from " + layer.Name;
+ sql += " where 1>2 ";
+ for (int i = 0; i < fs.Length; i++)
+ {
+ sql += " or 编号 = '" + fs[i].GetValue("编号").ToString() + "'";
}
+
+ DataTable table = OledbHelper.QueryTable(sql);
+ string strLable = " 阀门类型:" + pipetype + "||共有:" + Convert.ToString(table.Rows.Count) + "条记录";
+ m_InitDataGridViewX1(table, strLable, layername, true);
+
}
}
///
@@ -150,7 +154,8 @@
///
private void FrmLayerSelectedQuery_FormClosing(object sender, FormClosingEventArgs e)
{
- m_InitDataGridViewX1(table, strLable, "", false);
+ globeControl1.Globe.ClearAnalysis();
+ m_InitDataGridViewX1(null, "", "", false);
}
private void 导出统计专题图ToolStripMenuItem_Click(object sender, EventArgs e)
@@ -159,7 +164,33 @@
PATM_Forms.F_PATMTitle frm = new PATM_Forms.F_PATMTitle("S", chaFamenStatis);
frm.Show();
}
-
-
+ ///
+ /// 获取区域内的各图层阀门
+ ///
+ ///
+ ///
+ public Dictionary getValveMap(GSOGeoPolygon3D polygon)
+ {
+ Dictionary map = new Dictionary();
+ //找到所有阀门
+ if (Utility.LayerNamesList != null)
+ {
+ ArrayList listpt = Utility.LayerNamesList;
+ for (int i = 0; i < listpt.Count; i++)
+ {
+ string pipelineType = (string)Utility.LayerNamesList[i];
+
+ if ((pipelineType == "给水") || (pipelineType == "天然气") || (pipelineType == "热力"))
+ {
+ GSOLayer layer = globeControl1.Globe.Layers.GetLayerByCaption(pipelineType + "管线附属物");
+ if (layer == null) return null;
+ GSOFeatures fs = FeatureStatisticsService.Intersect_PointLayerByType(polygon, layer, "阀门井");
+ if (fs == null) continue;
+ map.Add(pipelineType+"阀门",fs);
+ }
+ }
+ }
+ return map;
+ }
}
}
diff --git a/Cyberpipe.csproj b/Cyberpipe.csproj
index 4038d91..004ec58 100644
--- a/Cyberpipe.csproj
+++ b/Cyberpipe.csproj
@@ -140,6 +140,10 @@
True
bin\x86\Debug\Interop.DSOFramer.dll
+
+ False
+ bin\x86\Debug\log4net.dll
+
False
@@ -1058,6 +1062,7 @@
+
Form
diff --git a/FeatureStatisticsService.cs b/FeatureStatisticsService.cs
index 7b5caad..4320c71 100644
--- a/FeatureStatisticsService.cs
+++ b/FeatureStatisticsService.cs
@@ -20,7 +20,7 @@
///
///
- public GSOFeatures Intersect_PointLayerByType(GSOGeoPolygon3D polygon, GSOLayer layer, string type)
+ public static GSOFeatures Intersect_PointLayerByType(GSOGeoPolygon3D polygon, GSOLayer layer, string type)
{
if (layer == null) return null;
diff --git a/FrmAllWorkWellStatis.cs b/FrmAllWorkWellStatis.cs
index 3f230df..7bf65dc 100644
--- a/FrmAllWorkWellStatis.cs
+++ b/FrmAllWorkWellStatis.cs
@@ -35,16 +35,18 @@
InitializeComponent();
globeControl1 = ctl;
m_InitDataGridViewX1 = InitDataGridViewX1;
- map = getAccsMap(polygon);
+ this.polygon = polygon;
+
}
private void FrmAllPipelineStatis_Load(object sender, EventArgs e)
{
+ map = getAccsMap(polygon);
drawChart();
}
- public void drawChart()
+ private void drawChart()
{
try
{
@@ -122,13 +124,11 @@
}
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);
@@ -212,7 +212,6 @@
Dictionary map = new Dictionary();
ArrayList listpt = Utility.LayerNamesList;
if (listpt == null || listpt.Count == 0) return null;
- FeatureStatisticsService service = new FeatureStatisticsService();
for (int i = 0; i < listpt.Count; i++)
{
GSOLayer layer = globeControl1.Globe.Layers.GetLayerByCaption(listpt[i] + "管线附属物");
@@ -223,7 +222,7 @@
if (accNames[j].Contains("井") || accNames[j].Contains("孔") || accNames[j].Contains("篦"))
{
- GSOFeatures features = service.Intersect_PointLayerByType(polygon, layer, accNames[j]);
+ GSOFeatures features = FeatureStatisticsService.Intersect_PointLayerByType(polygon, layer, accNames[j]);
if (features == null) continue;
map.Add(listpt[i] + accNames[j], features);
}
diff --git a/FrmValveStatistics.cs b/FrmValveStatistics.cs
index f8f4d3e..672f97a 100644
--- a/FrmValveStatistics.cs
+++ b/FrmValveStatistics.cs
@@ -9,26 +9,40 @@
using GeoScene.Data;
using GeoScene.Globe;
using DevComponents.DotNetBar;
+using System.Collections;
namespace Cyberpipe
{
public partial class FrmValveStatistics : DevComponents.DotNetBar.Office2007Form
{
- Dictionary workWellLengthAndType = new Dictionary();
- List list = new List();
- GSOGlobeControl globeControl1;
+ //Dictionary workWellLengthAndType = new Dictionary();
+ //List list = new List();
+ //GSOGlobeControl globeControl1;
- DataTable table = new DataTable();
- string strLable = "";
+ //DataTable table = new DataTable();
+ //string strLable = "";
+ //private MainFrm.DataGridViewDelegate m_InitDataGridViewX1;
+
private MainFrm.DataGridViewDelegate m_InitDataGridViewX1;
+ private Dictionary map = null;
+ private GSOGlobeControl globeControl1;
+ private GSOGeoPolygon3D polygon;
- public FrmValveStatistics(Dictionary wellLen, List _list,
- GSOGlobeControl ctl, MainFrm.DataGridViewDelegate initDataGridViewX1)
+ //public FrmValveStatistics(Dictionary wellLen, List _list,
+ // GSOGlobeControl ctl, MainFrm.DataGridViewDelegate initDataGridViewX1)
+ //{
+ // InitializeComponent();
+ // workWellLengthAndType = wellLen;
+ // list = _list;
+ // globeControl1 = ctl;
+ // m_InitDataGridViewX1 = initDataGridViewX1;
+ //}
+
+ public FrmValveStatistics(GSOGlobeControl ctl, GSOGeoPolygon3D polygon, MainFrm.DataGridViewDelegate InitDataGridViewX1)
{
InitializeComponent();
- workWellLengthAndType = wellLen;
- list = _list;
globeControl1 = ctl;
- m_InitDataGridViewX1 = initDataGridViewX1;
+ m_InitDataGridViewX1 = InitDataGridViewX1;
+ this.polygon = polygon;
}
///
/// 窗体初始化事件处理
@@ -37,8 +51,13 @@
///
private void FrmLayerSelectedQuery_Load(object sender, EventArgs e)
{
+ this.map = getValveMap(polygon) ;
+ drawChart();
+ }
+
+ private void drawChart() {
try
- {
+ {
chaFamenStatis.ChartAreas["ChartArea1"].AxisX.Title = "阀门类型";
chaFamenStatis.ChartAreas["ChartArea1"].AxisY.Title = "阀门个数";
chaFamenStatis.ChartAreas["ChartArea1"].AxisX.Interval = 1;
@@ -51,14 +70,19 @@
chaFamenStatis.Series["阀门"]["DrawingStyle"] = "Cylinder";
chaFamenStatis.Series["阀门"].IsValueShownAsLabel = true;
+ Dictionary workWellLengthAndType = new Dictionary();
+ foreach (KeyValuePair kv in map)
+ {
+ workWellLengthAndType.Add(kv.Key, kv.Value.Length);
+ }
chaFamenStatis.Series["阀门"].Points.DataBindXY(workWellLengthAndType.Keys, workWellLengthAndType.Values);
for (int m = 0; m < workWellLengthAndType.Values.Count; m++)
{
if (chaFamenStatis.Series["阀门"].Points[m].YValues[0].ToString() != "0")
{
chaFamenStatis.Series["阀门"].Points[m].Label = chaFamenStatis.Series[0].Points[m].YValues[0].ToString();
- }
- }
+ }
+ }
}
catch (Exception ex)
{
@@ -77,52 +101,32 @@
int indexHit = result.PointIndex;
if (indexHit >= 0)
{
-
- GSOFeatures fs = list[indexHit];
+
+ //GSOFeatures fs = list[indexHit];
string sql = "";
string pipetype = chaFamenStatis.Series["阀门"].Points[indexHit].AxisLabel;
+ GSOFeatures fs = map[pipetype];
string layername = pipetype.Substring(0, pipetype.Length - 2) + "管线附属物";
- MainFrm.m_CurrentQueryLayer = layername;
+ //MainFrm.m_CurrentQueryLayer = layername;
GSOLayer layer = globeControl1.Globe.Layers.GetLayerByCaption(layername);
- if (layer == null)
+ if (layer == null || fs.Length <= 0)
{
return;
}
- 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() + "'";
- }
- }
- }
- table = OledbHelper.QueryTable(sql);
- if (table.Rows.Count > 0)
- {
- strLable = " 阀门类型:" + pipetype + "||共有:" + Convert.ToString(table.Rows.Count) + "条记录";
- m_InitDataGridViewX1(table, strLable, layername, true);
- }
- else
- {
- return;
- }
+ sql = "select " + getpipeLineFields.getFields(layername, globeControl1) + " from " + layer.Name;
+ sql += " where 1>2 ";
+ for (int i = 0; i < fs.Length; i++)
+ {
+ sql += " or 编号 = '" + fs[i].GetValue("编号").ToString() + "'";
}
+
+ DataTable table = OledbHelper.QueryTable(sql);
+ string strLable = " 阀门类型:" + pipetype + "||共有:" + Convert.ToString(table.Rows.Count) + "条记录";
+ m_InitDataGridViewX1(table, strLable, layername, true);
+
}
}
///
@@ -150,7 +154,8 @@
///
private void FrmLayerSelectedQuery_FormClosing(object sender, FormClosingEventArgs e)
{
- m_InitDataGridViewX1(table, strLable, "", false);
+ globeControl1.Globe.ClearAnalysis();
+ m_InitDataGridViewX1(null, "", "", false);
}
private void 导出统计专题图ToolStripMenuItem_Click(object sender, EventArgs e)
@@ -159,7 +164,33 @@
PATM_Forms.F_PATMTitle frm = new PATM_Forms.F_PATMTitle("S", chaFamenStatis);
frm.Show();
}
-
-
+ ///
+ /// 获取区域内的各图层阀门
+ ///
+ ///
+ ///
+ public Dictionary getValveMap(GSOGeoPolygon3D polygon)
+ {
+ Dictionary map = new Dictionary();
+ //找到所有阀门
+ if (Utility.LayerNamesList != null)
+ {
+ ArrayList listpt = Utility.LayerNamesList;
+ for (int i = 0; i < listpt.Count; i++)
+ {
+ string pipelineType = (string)Utility.LayerNamesList[i];
+
+ if ((pipelineType == "给水") || (pipelineType == "天然气") || (pipelineType == "热力"))
+ {
+ GSOLayer layer = globeControl1.Globe.Layers.GetLayerByCaption(pipelineType + "管线附属物");
+ if (layer == null) return null;
+ GSOFeatures fs = FeatureStatisticsService.Intersect_PointLayerByType(polygon, layer, "阀门井");
+ if (fs == null) continue;
+ map.Add(pipelineType+"阀门",fs);
+ }
+ }
+ }
+ return map;
+ }
}
}
diff --git a/LogHelper.cs b/LogHelper.cs
new file mode 100644
index 0000000..24f4702
--- /dev/null
+++ b/LogHelper.cs
@@ -0,0 +1,43 @@
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+
+[assembly: log4net.Config.XmlConfigurator(Watch = true)]
+namespace Cyberpipe
+{
+ public class LogHelper
+ {
+ ///
+ /// 输出日志到Log4Net
+ ///
+ ///
+ ///
+ #region static void WriteLog(Type t, Exception ex)
+
+ public static void WriteLog(Type t, Exception ex)
+ {
+ log4net.ILog log = log4net.LogManager.GetLogger(t);
+ log.Error("Error", ex);
+ }
+
+ #endregion
+
+ ///
+ /// 输出日志到Log4Net
+ ///
+ ///
+ ///
+ #region static void WriteLog(Type t, string msg)
+
+ public static void WriteLog(Type t, string msg)
+ {
+ log4net.ILog log = log4net.LogManager.GetLogger(t);
+ log.Error(msg);
+ }
+
+ #endregion
+
+
+ }
+}
\ No newline at end of file
diff --git a/Cyberpipe.csproj b/Cyberpipe.csproj
index 4038d91..004ec58 100644
--- a/Cyberpipe.csproj
+++ b/Cyberpipe.csproj
@@ -140,6 +140,10 @@
True
bin\x86\Debug\Interop.DSOFramer.dll
+
+ False
+ bin\x86\Debug\log4net.dll
+
False
@@ -1058,6 +1062,7 @@
+
Form
diff --git a/FeatureStatisticsService.cs b/FeatureStatisticsService.cs
index 7b5caad..4320c71 100644
--- a/FeatureStatisticsService.cs
+++ b/FeatureStatisticsService.cs
@@ -20,7 +20,7 @@
///
///
- public GSOFeatures Intersect_PointLayerByType(GSOGeoPolygon3D polygon, GSOLayer layer, string type)
+ public static GSOFeatures Intersect_PointLayerByType(GSOGeoPolygon3D polygon, GSOLayer layer, string type)
{
if (layer == null) return null;
diff --git a/FrmAllWorkWellStatis.cs b/FrmAllWorkWellStatis.cs
index 3f230df..7bf65dc 100644
--- a/FrmAllWorkWellStatis.cs
+++ b/FrmAllWorkWellStatis.cs
@@ -35,16 +35,18 @@
InitializeComponent();
globeControl1 = ctl;
m_InitDataGridViewX1 = InitDataGridViewX1;
- map = getAccsMap(polygon);
+ this.polygon = polygon;
+
}
private void FrmAllPipelineStatis_Load(object sender, EventArgs e)
{
+ map = getAccsMap(polygon);
drawChart();
}
- public void drawChart()
+ private void drawChart()
{
try
{
@@ -122,13 +124,11 @@
}
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);
@@ -212,7 +212,6 @@
Dictionary map = new Dictionary();
ArrayList listpt = Utility.LayerNamesList;
if (listpt == null || listpt.Count == 0) return null;
- FeatureStatisticsService service = new FeatureStatisticsService();
for (int i = 0; i < listpt.Count; i++)
{
GSOLayer layer = globeControl1.Globe.Layers.GetLayerByCaption(listpt[i] + "管线附属物");
@@ -223,7 +222,7 @@
if (accNames[j].Contains("井") || accNames[j].Contains("孔") || accNames[j].Contains("篦"))
{
- GSOFeatures features = service.Intersect_PointLayerByType(polygon, layer, accNames[j]);
+ GSOFeatures features = FeatureStatisticsService.Intersect_PointLayerByType(polygon, layer, accNames[j]);
if (features == null) continue;
map.Add(listpt[i] + accNames[j], features);
}
diff --git a/FrmValveStatistics.cs b/FrmValveStatistics.cs
index f8f4d3e..672f97a 100644
--- a/FrmValveStatistics.cs
+++ b/FrmValveStatistics.cs
@@ -9,26 +9,40 @@
using GeoScene.Data;
using GeoScene.Globe;
using DevComponents.DotNetBar;
+using System.Collections;
namespace Cyberpipe
{
public partial class FrmValveStatistics : DevComponents.DotNetBar.Office2007Form
{
- Dictionary workWellLengthAndType = new Dictionary();
- List list = new List();
- GSOGlobeControl globeControl1;
+ //Dictionary workWellLengthAndType = new Dictionary();
+ //List list = new List();
+ //GSOGlobeControl globeControl1;
- DataTable table = new DataTable();
- string strLable = "";
+ //DataTable table = new DataTable();
+ //string strLable = "";
+ //private MainFrm.DataGridViewDelegate m_InitDataGridViewX1;
+
private MainFrm.DataGridViewDelegate m_InitDataGridViewX1;
+ private Dictionary map = null;
+ private GSOGlobeControl globeControl1;
+ private GSOGeoPolygon3D polygon;
- public FrmValveStatistics(Dictionary wellLen, List _list,
- GSOGlobeControl ctl, MainFrm.DataGridViewDelegate initDataGridViewX1)
+ //public FrmValveStatistics(Dictionary wellLen, List _list,
+ // GSOGlobeControl ctl, MainFrm.DataGridViewDelegate initDataGridViewX1)
+ //{
+ // InitializeComponent();
+ // workWellLengthAndType = wellLen;
+ // list = _list;
+ // globeControl1 = ctl;
+ // m_InitDataGridViewX1 = initDataGridViewX1;
+ //}
+
+ public FrmValveStatistics(GSOGlobeControl ctl, GSOGeoPolygon3D polygon, MainFrm.DataGridViewDelegate InitDataGridViewX1)
{
InitializeComponent();
- workWellLengthAndType = wellLen;
- list = _list;
globeControl1 = ctl;
- m_InitDataGridViewX1 = initDataGridViewX1;
+ m_InitDataGridViewX1 = InitDataGridViewX1;
+ this.polygon = polygon;
}
///
/// 窗体初始化事件处理
@@ -37,8 +51,13 @@
///
private void FrmLayerSelectedQuery_Load(object sender, EventArgs e)
{
+ this.map = getValveMap(polygon) ;
+ drawChart();
+ }
+
+ private void drawChart() {
try
- {
+ {
chaFamenStatis.ChartAreas["ChartArea1"].AxisX.Title = "阀门类型";
chaFamenStatis.ChartAreas["ChartArea1"].AxisY.Title = "阀门个数";
chaFamenStatis.ChartAreas["ChartArea1"].AxisX.Interval = 1;
@@ -51,14 +70,19 @@
chaFamenStatis.Series["阀门"]["DrawingStyle"] = "Cylinder";
chaFamenStatis.Series["阀门"].IsValueShownAsLabel = true;
+ Dictionary workWellLengthAndType = new Dictionary();
+ foreach (KeyValuePair kv in map)
+ {
+ workWellLengthAndType.Add(kv.Key, kv.Value.Length);
+ }
chaFamenStatis.Series["阀门"].Points.DataBindXY(workWellLengthAndType.Keys, workWellLengthAndType.Values);
for (int m = 0; m < workWellLengthAndType.Values.Count; m++)
{
if (chaFamenStatis.Series["阀门"].Points[m].YValues[0].ToString() != "0")
{
chaFamenStatis.Series["阀门"].Points[m].Label = chaFamenStatis.Series[0].Points[m].YValues[0].ToString();
- }
- }
+ }
+ }
}
catch (Exception ex)
{
@@ -77,52 +101,32 @@
int indexHit = result.PointIndex;
if (indexHit >= 0)
{
-
- GSOFeatures fs = list[indexHit];
+
+ //GSOFeatures fs = list[indexHit];
string sql = "";
string pipetype = chaFamenStatis.Series["阀门"].Points[indexHit].AxisLabel;
+ GSOFeatures fs = map[pipetype];
string layername = pipetype.Substring(0, pipetype.Length - 2) + "管线附属物";
- MainFrm.m_CurrentQueryLayer = layername;
+ //MainFrm.m_CurrentQueryLayer = layername;
GSOLayer layer = globeControl1.Globe.Layers.GetLayerByCaption(layername);
- if (layer == null)
+ if (layer == null || fs.Length <= 0)
{
return;
}
- 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() + "'";
- }
- }
- }
- table = OledbHelper.QueryTable(sql);
- if (table.Rows.Count > 0)
- {
- strLable = " 阀门类型:" + pipetype + "||共有:" + Convert.ToString(table.Rows.Count) + "条记录";
- m_InitDataGridViewX1(table, strLable, layername, true);
- }
- else
- {
- return;
- }
+ sql = "select " + getpipeLineFields.getFields(layername, globeControl1) + " from " + layer.Name;
+ sql += " where 1>2 ";
+ for (int i = 0; i < fs.Length; i++)
+ {
+ sql += " or 编号 = '" + fs[i].GetValue("编号").ToString() + "'";
}
+
+ DataTable table = OledbHelper.QueryTable(sql);
+ string strLable = " 阀门类型:" + pipetype + "||共有:" + Convert.ToString(table.Rows.Count) + "条记录";
+ m_InitDataGridViewX1(table, strLable, layername, true);
+
}
}
///
@@ -150,7 +154,8 @@
///
private void FrmLayerSelectedQuery_FormClosing(object sender, FormClosingEventArgs e)
{
- m_InitDataGridViewX1(table, strLable, "", false);
+ globeControl1.Globe.ClearAnalysis();
+ m_InitDataGridViewX1(null, "", "", false);
}
private void 导出统计专题图ToolStripMenuItem_Click(object sender, EventArgs e)
@@ -159,7 +164,33 @@
PATM_Forms.F_PATMTitle frm = new PATM_Forms.F_PATMTitle("S", chaFamenStatis);
frm.Show();
}
-
-
+ ///
+ /// 获取区域内的各图层阀门
+ ///
+ ///
+ ///
+ public Dictionary getValveMap(GSOGeoPolygon3D polygon)
+ {
+ Dictionary map = new Dictionary();
+ //找到所有阀门
+ if (Utility.LayerNamesList != null)
+ {
+ ArrayList listpt = Utility.LayerNamesList;
+ for (int i = 0; i < listpt.Count; i++)
+ {
+ string pipelineType = (string)Utility.LayerNamesList[i];
+
+ if ((pipelineType == "给水") || (pipelineType == "天然气") || (pipelineType == "热力"))
+ {
+ GSOLayer layer = globeControl1.Globe.Layers.GetLayerByCaption(pipelineType + "管线附属物");
+ if (layer == null) return null;
+ GSOFeatures fs = FeatureStatisticsService.Intersect_PointLayerByType(polygon, layer, "阀门井");
+ if (fs == null) continue;
+ map.Add(pipelineType+"阀门",fs);
+ }
+ }
+ }
+ return map;
+ }
}
}
diff --git a/LogHelper.cs b/LogHelper.cs
new file mode 100644
index 0000000..24f4702
--- /dev/null
+++ b/LogHelper.cs
@@ -0,0 +1,43 @@
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+
+[assembly: log4net.Config.XmlConfigurator(Watch = true)]
+namespace Cyberpipe
+{
+ public class LogHelper
+ {
+ ///
+ /// 输出日志到Log4Net
+ ///
+ ///
+ ///
+ #region static void WriteLog(Type t, Exception ex)
+
+ public static void WriteLog(Type t, Exception ex)
+ {
+ log4net.ILog log = log4net.LogManager.GetLogger(t);
+ log.Error("Error", ex);
+ }
+
+ #endregion
+
+ ///
+ /// 输出日志到Log4Net
+ ///
+ ///
+ ///
+ #region static void WriteLog(Type t, string msg)
+
+ public static void WriteLog(Type t, string msg)
+ {
+ log4net.ILog log = log4net.LogManager.GetLogger(t);
+ log.Error(msg);
+ }
+
+ #endregion
+
+
+ }
+}
\ No newline at end of file
diff --git a/MainFrm.cs b/MainFrm.cs
index d90fe55..1d9bcba 100644
--- a/MainFrm.cs
+++ b/MainFrm.cs
@@ -2894,25 +2894,26 @@
switch (trackflag)
{
case "valvequery":
- workWellLen.Clear();
- List list = new List();
- //找到所有阀门
- if (Utility.LayerNamesList != null)
- {
- ArrayList listpt = Utility.LayerNamesList;
+ //workWellLen.Clear();
+ //List list = new List();
+ ////找到所有阀门
+ //if (Utility.LayerNamesList != null)
+ //{
+ // ArrayList listpt = Utility.LayerNamesList;
- for (int i = 0; i < listpt.Count; i++)
- {
- string pipelineType = (string)Utility.LayerNamesList[i];
+ // for (int i = 0; i < listpt.Count; i++)
+ // {
+ // string pipelineType = (string)Utility.LayerNamesList[i];
- if ((pipelineType == "给水") || (pipelineType == "天然气") || (pipelineType == "热力"))
- {
- GSOFeatures fs = Intersect_PointLayerByType(polygon, pipelineType, "阀门");
- list.Add(fs);
- }
- }
- }
- FrmValveStatistics frm = new FrmValveStatistics(workWellLen, list, globeControl1, new DataGridViewDelegate(InitDataGridViewX1));
+ // if ((pipelineType == "给水") || (pipelineType == "天然气") || (pipelineType == "热力"))
+ // {
+ // GSOFeatures fs = Intersect_PointLayerByType(polygon, pipelineType, "阀门");
+ // list.Add(fs);
+ // }
+ // }
+ //}
+ //FrmValveStatistics frm = new FrmValveStatistics(workWellLen, list, globeControl1, new DataGridViewDelegate(InitDataGridViewX1));
+ FrmValveStatistics frm = new FrmValveStatistics(globeControl1,polygon, new DataGridViewDelegate(InitDataGridViewX1));
frm.Show(this);
//panelEx6.Visible = true;
toolStripFeatureLength.Text = "";
@@ -9696,25 +9697,26 @@
//日志记录
LogManager.saveLog(Utility.userName, "阀门数量统计");
- workWellLen.Clear();
- List list = new List();
- //找到所有阀门
- if (Utility.LayerNamesList != null)
- {
- ArrayList listpt = Utility.LayerNamesList;
+ //workWellLen.Clear();
+ //List list = new List();
+ ////找到所有阀门
+ //if (Utility.LayerNamesList != null)
+ //{
+ // ArrayList listpt = Utility.LayerNamesList;
- for (int i = 0; i < listpt.Count; i++)
- {
- string pipelineType = (string)Utility.LayerNamesList[i];
+ // for (int i = 0; i < listpt.Count; i++)
+ // {
+ // string pipelineType = (string)Utility.LayerNamesList[i];
- if ((pipelineType == "给水") || (pipelineType == "天然气") || (pipelineType == "热力"))
- {
- GSOFeatures fs = Intersect_PointLayerByType(null, pipelineType, "阀门");
- list.Add(fs);
- }
- }
- }
- FrmValveStatistics frm = new FrmValveStatistics(workWellLen, list, globeControl1, new DataGridViewDelegate(InitDataGridViewX1));
+ // if ((pipelineType == "给水") || (pipelineType == "天然气") || (pipelineType == "热力"))
+ // {
+ //GSOFeatures fs = Intersect_PointLayerByType(null, pipelineType, "阀门");
+ // list.Add(fs);
+ // }
+ // }
+ //}
+ //FrmValveStatistics frm = new FrmValveStatistics(workWellLen, list, globeControl1, new DataGridViewDelegate(InitDataGridViewX1));
+ FrmValveStatistics frm = new FrmValveStatistics(globeControl1, null, new DataGridViewDelegate(InitDataGridViewX1));
frm.Show(this);
globeControl1.Globe.Action = EnumAction3D.ActionNull;
diff --git a/Cyberpipe.csproj b/Cyberpipe.csproj
index 4038d91..004ec58 100644
--- a/Cyberpipe.csproj
+++ b/Cyberpipe.csproj
@@ -140,6 +140,10 @@
True
bin\x86\Debug\Interop.DSOFramer.dll
+
+ False
+ bin\x86\Debug\log4net.dll
+
False
@@ -1058,6 +1062,7 @@
+
Form
diff --git a/FeatureStatisticsService.cs b/FeatureStatisticsService.cs
index 7b5caad..4320c71 100644
--- a/FeatureStatisticsService.cs
+++ b/FeatureStatisticsService.cs
@@ -20,7 +20,7 @@
///
///
- public GSOFeatures Intersect_PointLayerByType(GSOGeoPolygon3D polygon, GSOLayer layer, string type)
+ public static GSOFeatures Intersect_PointLayerByType(GSOGeoPolygon3D polygon, GSOLayer layer, string type)
{
if (layer == null) return null;
diff --git a/FrmAllWorkWellStatis.cs b/FrmAllWorkWellStatis.cs
index 3f230df..7bf65dc 100644
--- a/FrmAllWorkWellStatis.cs
+++ b/FrmAllWorkWellStatis.cs
@@ -35,16 +35,18 @@
InitializeComponent();
globeControl1 = ctl;
m_InitDataGridViewX1 = InitDataGridViewX1;
- map = getAccsMap(polygon);
+ this.polygon = polygon;
+
}
private void FrmAllPipelineStatis_Load(object sender, EventArgs e)
{
+ map = getAccsMap(polygon);
drawChart();
}
- public void drawChart()
+ private void drawChart()
{
try
{
@@ -122,13 +124,11 @@
}
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);
@@ -212,7 +212,6 @@
Dictionary map = new Dictionary();
ArrayList listpt = Utility.LayerNamesList;
if (listpt == null || listpt.Count == 0) return null;
- FeatureStatisticsService service = new FeatureStatisticsService();
for (int i = 0; i < listpt.Count; i++)
{
GSOLayer layer = globeControl1.Globe.Layers.GetLayerByCaption(listpt[i] + "管线附属物");
@@ -223,7 +222,7 @@
if (accNames[j].Contains("井") || accNames[j].Contains("孔") || accNames[j].Contains("篦"))
{
- GSOFeatures features = service.Intersect_PointLayerByType(polygon, layer, accNames[j]);
+ GSOFeatures features = FeatureStatisticsService.Intersect_PointLayerByType(polygon, layer, accNames[j]);
if (features == null) continue;
map.Add(listpt[i] + accNames[j], features);
}
diff --git a/FrmValveStatistics.cs b/FrmValveStatistics.cs
index f8f4d3e..672f97a 100644
--- a/FrmValveStatistics.cs
+++ b/FrmValveStatistics.cs
@@ -9,26 +9,40 @@
using GeoScene.Data;
using GeoScene.Globe;
using DevComponents.DotNetBar;
+using System.Collections;
namespace Cyberpipe
{
public partial class FrmValveStatistics : DevComponents.DotNetBar.Office2007Form
{
- Dictionary workWellLengthAndType = new Dictionary();
- List list = new List();
- GSOGlobeControl globeControl1;
+ //Dictionary workWellLengthAndType = new Dictionary();
+ //List list = new List();
+ //GSOGlobeControl globeControl1;
- DataTable table = new DataTable();
- string strLable = "";
+ //DataTable table = new DataTable();
+ //string strLable = "";
+ //private MainFrm.DataGridViewDelegate m_InitDataGridViewX1;
+
private MainFrm.DataGridViewDelegate m_InitDataGridViewX1;
+ private Dictionary map = null;
+ private GSOGlobeControl globeControl1;
+ private GSOGeoPolygon3D polygon;
- public FrmValveStatistics(Dictionary wellLen, List _list,
- GSOGlobeControl ctl, MainFrm.DataGridViewDelegate initDataGridViewX1)
+ //public FrmValveStatistics(Dictionary wellLen, List _list,
+ // GSOGlobeControl ctl, MainFrm.DataGridViewDelegate initDataGridViewX1)
+ //{
+ // InitializeComponent();
+ // workWellLengthAndType = wellLen;
+ // list = _list;
+ // globeControl1 = ctl;
+ // m_InitDataGridViewX1 = initDataGridViewX1;
+ //}
+
+ public FrmValveStatistics(GSOGlobeControl ctl, GSOGeoPolygon3D polygon, MainFrm.DataGridViewDelegate InitDataGridViewX1)
{
InitializeComponent();
- workWellLengthAndType = wellLen;
- list = _list;
globeControl1 = ctl;
- m_InitDataGridViewX1 = initDataGridViewX1;
+ m_InitDataGridViewX1 = InitDataGridViewX1;
+ this.polygon = polygon;
}
///
/// 窗体初始化事件处理
@@ -37,8 +51,13 @@
///
private void FrmLayerSelectedQuery_Load(object sender, EventArgs e)
{
+ this.map = getValveMap(polygon) ;
+ drawChart();
+ }
+
+ private void drawChart() {
try
- {
+ {
chaFamenStatis.ChartAreas["ChartArea1"].AxisX.Title = "阀门类型";
chaFamenStatis.ChartAreas["ChartArea1"].AxisY.Title = "阀门个数";
chaFamenStatis.ChartAreas["ChartArea1"].AxisX.Interval = 1;
@@ -51,14 +70,19 @@
chaFamenStatis.Series["阀门"]["DrawingStyle"] = "Cylinder";
chaFamenStatis.Series["阀门"].IsValueShownAsLabel = true;
+ Dictionary workWellLengthAndType = new Dictionary();
+ foreach (KeyValuePair kv in map)
+ {
+ workWellLengthAndType.Add(kv.Key, kv.Value.Length);
+ }
chaFamenStatis.Series["阀门"].Points.DataBindXY(workWellLengthAndType.Keys, workWellLengthAndType.Values);
for (int m = 0; m < workWellLengthAndType.Values.Count; m++)
{
if (chaFamenStatis.Series["阀门"].Points[m].YValues[0].ToString() != "0")
{
chaFamenStatis.Series["阀门"].Points[m].Label = chaFamenStatis.Series[0].Points[m].YValues[0].ToString();
- }
- }
+ }
+ }
}
catch (Exception ex)
{
@@ -77,52 +101,32 @@
int indexHit = result.PointIndex;
if (indexHit >= 0)
{
-
- GSOFeatures fs = list[indexHit];
+
+ //GSOFeatures fs = list[indexHit];
string sql = "";
string pipetype = chaFamenStatis.Series["阀门"].Points[indexHit].AxisLabel;
+ GSOFeatures fs = map[pipetype];
string layername = pipetype.Substring(0, pipetype.Length - 2) + "管线附属物";
- MainFrm.m_CurrentQueryLayer = layername;
+ //MainFrm.m_CurrentQueryLayer = layername;
GSOLayer layer = globeControl1.Globe.Layers.GetLayerByCaption(layername);
- if (layer == null)
+ if (layer == null || fs.Length <= 0)
{
return;
}
- 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() + "'";
- }
- }
- }
- table = OledbHelper.QueryTable(sql);
- if (table.Rows.Count > 0)
- {
- strLable = " 阀门类型:" + pipetype + "||共有:" + Convert.ToString(table.Rows.Count) + "条记录";
- m_InitDataGridViewX1(table, strLable, layername, true);
- }
- else
- {
- return;
- }
+ sql = "select " + getpipeLineFields.getFields(layername, globeControl1) + " from " + layer.Name;
+ sql += " where 1>2 ";
+ for (int i = 0; i < fs.Length; i++)
+ {
+ sql += " or 编号 = '" + fs[i].GetValue("编号").ToString() + "'";
}
+
+ DataTable table = OledbHelper.QueryTable(sql);
+ string strLable = " 阀门类型:" + pipetype + "||共有:" + Convert.ToString(table.Rows.Count) + "条记录";
+ m_InitDataGridViewX1(table, strLable, layername, true);
+
}
}
///
@@ -150,7 +154,8 @@
///
private void FrmLayerSelectedQuery_FormClosing(object sender, FormClosingEventArgs e)
{
- m_InitDataGridViewX1(table, strLable, "", false);
+ globeControl1.Globe.ClearAnalysis();
+ m_InitDataGridViewX1(null, "", "", false);
}
private void 导出统计专题图ToolStripMenuItem_Click(object sender, EventArgs e)
@@ -159,7 +164,33 @@
PATM_Forms.F_PATMTitle frm = new PATM_Forms.F_PATMTitle("S", chaFamenStatis);
frm.Show();
}
-
-
+ ///
+ /// 获取区域内的各图层阀门
+ ///
+ ///
+ ///
+ public Dictionary getValveMap(GSOGeoPolygon3D polygon)
+ {
+ Dictionary map = new Dictionary();
+ //找到所有阀门
+ if (Utility.LayerNamesList != null)
+ {
+ ArrayList listpt = Utility.LayerNamesList;
+ for (int i = 0; i < listpt.Count; i++)
+ {
+ string pipelineType = (string)Utility.LayerNamesList[i];
+
+ if ((pipelineType == "给水") || (pipelineType == "天然气") || (pipelineType == "热力"))
+ {
+ GSOLayer layer = globeControl1.Globe.Layers.GetLayerByCaption(pipelineType + "管线附属物");
+ if (layer == null) return null;
+ GSOFeatures fs = FeatureStatisticsService.Intersect_PointLayerByType(polygon, layer, "阀门井");
+ if (fs == null) continue;
+ map.Add(pipelineType+"阀门",fs);
+ }
+ }
+ }
+ return map;
+ }
}
}
diff --git a/LogHelper.cs b/LogHelper.cs
new file mode 100644
index 0000000..24f4702
--- /dev/null
+++ b/LogHelper.cs
@@ -0,0 +1,43 @@
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+
+[assembly: log4net.Config.XmlConfigurator(Watch = true)]
+namespace Cyberpipe
+{
+ public class LogHelper
+ {
+ ///
+ /// 输出日志到Log4Net
+ ///
+ ///
+ ///
+ #region static void WriteLog(Type t, Exception ex)
+
+ public static void WriteLog(Type t, Exception ex)
+ {
+ log4net.ILog log = log4net.LogManager.GetLogger(t);
+ log.Error("Error", ex);
+ }
+
+ #endregion
+
+ ///
+ /// 输出日志到Log4Net
+ ///
+ ///
+ ///
+ #region static void WriteLog(Type t, string msg)
+
+ public static void WriteLog(Type t, string msg)
+ {
+ log4net.ILog log = log4net.LogManager.GetLogger(t);
+ log.Error(msg);
+ }
+
+ #endregion
+
+
+ }
+}
\ No newline at end of file
diff --git a/MainFrm.cs b/MainFrm.cs
index d90fe55..1d9bcba 100644
--- a/MainFrm.cs
+++ b/MainFrm.cs
@@ -2894,25 +2894,26 @@
switch (trackflag)
{
case "valvequery":
- workWellLen.Clear();
- List list = new List();
- //找到所有阀门
- if (Utility.LayerNamesList != null)
- {
- ArrayList listpt = Utility.LayerNamesList;
+ //workWellLen.Clear();
+ //List list = new List();
+ ////找到所有阀门
+ //if (Utility.LayerNamesList != null)
+ //{
+ // ArrayList listpt = Utility.LayerNamesList;
- for (int i = 0; i < listpt.Count; i++)
- {
- string pipelineType = (string)Utility.LayerNamesList[i];
+ // for (int i = 0; i < listpt.Count; i++)
+ // {
+ // string pipelineType = (string)Utility.LayerNamesList[i];
- if ((pipelineType == "给水") || (pipelineType == "天然气") || (pipelineType == "热力"))
- {
- GSOFeatures fs = Intersect_PointLayerByType(polygon, pipelineType, "阀门");
- list.Add(fs);
- }
- }
- }
- FrmValveStatistics frm = new FrmValveStatistics(workWellLen, list, globeControl1, new DataGridViewDelegate(InitDataGridViewX1));
+ // if ((pipelineType == "给水") || (pipelineType == "天然气") || (pipelineType == "热力"))
+ // {
+ // GSOFeatures fs = Intersect_PointLayerByType(polygon, pipelineType, "阀门");
+ // list.Add(fs);
+ // }
+ // }
+ //}
+ //FrmValveStatistics frm = new FrmValveStatistics(workWellLen, list, globeControl1, new DataGridViewDelegate(InitDataGridViewX1));
+ FrmValveStatistics frm = new FrmValveStatistics(globeControl1,polygon, new DataGridViewDelegate(InitDataGridViewX1));
frm.Show(this);
//panelEx6.Visible = true;
toolStripFeatureLength.Text = "";
@@ -9696,25 +9697,26 @@
//日志记录
LogManager.saveLog(Utility.userName, "阀门数量统计");
- workWellLen.Clear();
- List list = new List();
- //找到所有阀门
- if (Utility.LayerNamesList != null)
- {
- ArrayList listpt = Utility.LayerNamesList;
+ //workWellLen.Clear();
+ //List list = new List();
+ ////找到所有阀门
+ //if (Utility.LayerNamesList != null)
+ //{
+ // ArrayList listpt = Utility.LayerNamesList;
- for (int i = 0; i < listpt.Count; i++)
- {
- string pipelineType = (string)Utility.LayerNamesList[i];
+ // for (int i = 0; i < listpt.Count; i++)
+ // {
+ // string pipelineType = (string)Utility.LayerNamesList[i];
- if ((pipelineType == "给水") || (pipelineType == "天然气") || (pipelineType == "热力"))
- {
- GSOFeatures fs = Intersect_PointLayerByType(null, pipelineType, "阀门");
- list.Add(fs);
- }
- }
- }
- FrmValveStatistics frm = new FrmValveStatistics(workWellLen, list, globeControl1, new DataGridViewDelegate(InitDataGridViewX1));
+ // if ((pipelineType == "给水") || (pipelineType == "天然气") || (pipelineType == "热力"))
+ // {
+ //GSOFeatures fs = Intersect_PointLayerByType(null, pipelineType, "阀门");
+ // list.Add(fs);
+ // }
+ // }
+ //}
+ //FrmValveStatistics frm = new FrmValveStatistics(workWellLen, list, globeControl1, new DataGridViewDelegate(InitDataGridViewX1));
+ FrmValveStatistics frm = new FrmValveStatistics(globeControl1, null, new DataGridViewDelegate(InitDataGridViewX1));
frm.Show(this);
globeControl1.Globe.Action = EnumAction3D.ActionNull;
diff --git a/app.config b/app.config
index f4cbe66..5753e1b 100644
--- a/app.config
+++ b/app.config
@@ -29,4 +29,30 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/Cyberpipe.csproj b/Cyberpipe.csproj
index 4038d91..004ec58 100644
--- a/Cyberpipe.csproj
+++ b/Cyberpipe.csproj
@@ -140,6 +140,10 @@
True
bin\x86\Debug\Interop.DSOFramer.dll
+
+ False
+ bin\x86\Debug\log4net.dll
+
False
@@ -1058,6 +1062,7 @@
+
Form
diff --git a/FeatureStatisticsService.cs b/FeatureStatisticsService.cs
index 7b5caad..4320c71 100644
--- a/FeatureStatisticsService.cs
+++ b/FeatureStatisticsService.cs
@@ -20,7 +20,7 @@
///
///
- public GSOFeatures Intersect_PointLayerByType(GSOGeoPolygon3D polygon, GSOLayer layer, string type)
+ public static GSOFeatures Intersect_PointLayerByType(GSOGeoPolygon3D polygon, GSOLayer layer, string type)
{
if (layer == null) return null;
diff --git a/FrmAllWorkWellStatis.cs b/FrmAllWorkWellStatis.cs
index 3f230df..7bf65dc 100644
--- a/FrmAllWorkWellStatis.cs
+++ b/FrmAllWorkWellStatis.cs
@@ -35,16 +35,18 @@
InitializeComponent();
globeControl1 = ctl;
m_InitDataGridViewX1 = InitDataGridViewX1;
- map = getAccsMap(polygon);
+ this.polygon = polygon;
+
}
private void FrmAllPipelineStatis_Load(object sender, EventArgs e)
{
+ map = getAccsMap(polygon);
drawChart();
}
- public void drawChart()
+ private void drawChart()
{
try
{
@@ -122,13 +124,11 @@
}
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);
@@ -212,7 +212,6 @@
Dictionary map = new Dictionary();
ArrayList listpt = Utility.LayerNamesList;
if (listpt == null || listpt.Count == 0) return null;
- FeatureStatisticsService service = new FeatureStatisticsService();
for (int i = 0; i < listpt.Count; i++)
{
GSOLayer layer = globeControl1.Globe.Layers.GetLayerByCaption(listpt[i] + "管线附属物");
@@ -223,7 +222,7 @@
if (accNames[j].Contains("井") || accNames[j].Contains("孔") || accNames[j].Contains("篦"))
{
- GSOFeatures features = service.Intersect_PointLayerByType(polygon, layer, accNames[j]);
+ GSOFeatures features = FeatureStatisticsService.Intersect_PointLayerByType(polygon, layer, accNames[j]);
if (features == null) continue;
map.Add(listpt[i] + accNames[j], features);
}
diff --git a/FrmValveStatistics.cs b/FrmValveStatistics.cs
index f8f4d3e..672f97a 100644
--- a/FrmValveStatistics.cs
+++ b/FrmValveStatistics.cs
@@ -9,26 +9,40 @@
using GeoScene.Data;
using GeoScene.Globe;
using DevComponents.DotNetBar;
+using System.Collections;
namespace Cyberpipe
{
public partial class FrmValveStatistics : DevComponents.DotNetBar.Office2007Form
{
- Dictionary workWellLengthAndType = new Dictionary();
- List list = new List();
- GSOGlobeControl globeControl1;
+ //Dictionary workWellLengthAndType = new Dictionary();
+ //List list = new List();
+ //GSOGlobeControl globeControl1;
- DataTable table = new DataTable();
- string strLable = "";
+ //DataTable table = new DataTable();
+ //string strLable = "";
+ //private MainFrm.DataGridViewDelegate m_InitDataGridViewX1;
+
private MainFrm.DataGridViewDelegate m_InitDataGridViewX1;
+ private Dictionary map = null;
+ private GSOGlobeControl globeControl1;
+ private GSOGeoPolygon3D polygon;
- public FrmValveStatistics(Dictionary wellLen, List _list,
- GSOGlobeControl ctl, MainFrm.DataGridViewDelegate initDataGridViewX1)
+ //public FrmValveStatistics(Dictionary wellLen, List _list,
+ // GSOGlobeControl ctl, MainFrm.DataGridViewDelegate initDataGridViewX1)
+ //{
+ // InitializeComponent();
+ // workWellLengthAndType = wellLen;
+ // list = _list;
+ // globeControl1 = ctl;
+ // m_InitDataGridViewX1 = initDataGridViewX1;
+ //}
+
+ public FrmValveStatistics(GSOGlobeControl ctl, GSOGeoPolygon3D polygon, MainFrm.DataGridViewDelegate InitDataGridViewX1)
{
InitializeComponent();
- workWellLengthAndType = wellLen;
- list = _list;
globeControl1 = ctl;
- m_InitDataGridViewX1 = initDataGridViewX1;
+ m_InitDataGridViewX1 = InitDataGridViewX1;
+ this.polygon = polygon;
}
///
/// 窗体初始化事件处理
@@ -37,8 +51,13 @@
///
private void FrmLayerSelectedQuery_Load(object sender, EventArgs e)
{
+ this.map = getValveMap(polygon) ;
+ drawChart();
+ }
+
+ private void drawChart() {
try
- {
+ {
chaFamenStatis.ChartAreas["ChartArea1"].AxisX.Title = "阀门类型";
chaFamenStatis.ChartAreas["ChartArea1"].AxisY.Title = "阀门个数";
chaFamenStatis.ChartAreas["ChartArea1"].AxisX.Interval = 1;
@@ -51,14 +70,19 @@
chaFamenStatis.Series["阀门"]["DrawingStyle"] = "Cylinder";
chaFamenStatis.Series["阀门"].IsValueShownAsLabel = true;
+ Dictionary workWellLengthAndType = new Dictionary();
+ foreach (KeyValuePair kv in map)
+ {
+ workWellLengthAndType.Add(kv.Key, kv.Value.Length);
+ }
chaFamenStatis.Series["阀门"].Points.DataBindXY(workWellLengthAndType.Keys, workWellLengthAndType.Values);
for (int m = 0; m < workWellLengthAndType.Values.Count; m++)
{
if (chaFamenStatis.Series["阀门"].Points[m].YValues[0].ToString() != "0")
{
chaFamenStatis.Series["阀门"].Points[m].Label = chaFamenStatis.Series[0].Points[m].YValues[0].ToString();
- }
- }
+ }
+ }
}
catch (Exception ex)
{
@@ -77,52 +101,32 @@
int indexHit = result.PointIndex;
if (indexHit >= 0)
{
-
- GSOFeatures fs = list[indexHit];
+
+ //GSOFeatures fs = list[indexHit];
string sql = "";
string pipetype = chaFamenStatis.Series["阀门"].Points[indexHit].AxisLabel;
+ GSOFeatures fs = map[pipetype];
string layername = pipetype.Substring(0, pipetype.Length - 2) + "管线附属物";
- MainFrm.m_CurrentQueryLayer = layername;
+ //MainFrm.m_CurrentQueryLayer = layername;
GSOLayer layer = globeControl1.Globe.Layers.GetLayerByCaption(layername);
- if (layer == null)
+ if (layer == null || fs.Length <= 0)
{
return;
}
- 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() + "'";
- }
- }
- }
- table = OledbHelper.QueryTable(sql);
- if (table.Rows.Count > 0)
- {
- strLable = " 阀门类型:" + pipetype + "||共有:" + Convert.ToString(table.Rows.Count) + "条记录";
- m_InitDataGridViewX1(table, strLable, layername, true);
- }
- else
- {
- return;
- }
+ sql = "select " + getpipeLineFields.getFields(layername, globeControl1) + " from " + layer.Name;
+ sql += " where 1>2 ";
+ for (int i = 0; i < fs.Length; i++)
+ {
+ sql += " or 编号 = '" + fs[i].GetValue("编号").ToString() + "'";
}
+
+ DataTable table = OledbHelper.QueryTable(sql);
+ string strLable = " 阀门类型:" + pipetype + "||共有:" + Convert.ToString(table.Rows.Count) + "条记录";
+ m_InitDataGridViewX1(table, strLable, layername, true);
+
}
}
///
@@ -150,7 +154,8 @@
///
private void FrmLayerSelectedQuery_FormClosing(object sender, FormClosingEventArgs e)
{
- m_InitDataGridViewX1(table, strLable, "", false);
+ globeControl1.Globe.ClearAnalysis();
+ m_InitDataGridViewX1(null, "", "", false);
}
private void 导出统计专题图ToolStripMenuItem_Click(object sender, EventArgs e)
@@ -159,7 +164,33 @@
PATM_Forms.F_PATMTitle frm = new PATM_Forms.F_PATMTitle("S", chaFamenStatis);
frm.Show();
}
-
-
+ ///
+ /// 获取区域内的各图层阀门
+ ///
+ ///
+ ///
+ public Dictionary getValveMap(GSOGeoPolygon3D polygon)
+ {
+ Dictionary map = new Dictionary();
+ //找到所有阀门
+ if (Utility.LayerNamesList != null)
+ {
+ ArrayList listpt = Utility.LayerNamesList;
+ for (int i = 0; i < listpt.Count; i++)
+ {
+ string pipelineType = (string)Utility.LayerNamesList[i];
+
+ if ((pipelineType == "给水") || (pipelineType == "天然气") || (pipelineType == "热力"))
+ {
+ GSOLayer layer = globeControl1.Globe.Layers.GetLayerByCaption(pipelineType + "管线附属物");
+ if (layer == null) return null;
+ GSOFeatures fs = FeatureStatisticsService.Intersect_PointLayerByType(polygon, layer, "阀门井");
+ if (fs == null) continue;
+ map.Add(pipelineType+"阀门",fs);
+ }
+ }
+ }
+ return map;
+ }
}
}
diff --git a/LogHelper.cs b/LogHelper.cs
new file mode 100644
index 0000000..24f4702
--- /dev/null
+++ b/LogHelper.cs
@@ -0,0 +1,43 @@
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+
+[assembly: log4net.Config.XmlConfigurator(Watch = true)]
+namespace Cyberpipe
+{
+ public class LogHelper
+ {
+ ///
+ /// 输出日志到Log4Net
+ ///
+ ///
+ ///
+ #region static void WriteLog(Type t, Exception ex)
+
+ public static void WriteLog(Type t, Exception ex)
+ {
+ log4net.ILog log = log4net.LogManager.GetLogger(t);
+ log.Error("Error", ex);
+ }
+
+ #endregion
+
+ ///
+ /// 输出日志到Log4Net
+ ///
+ ///
+ ///
+ #region static void WriteLog(Type t, string msg)
+
+ public static void WriteLog(Type t, string msg)
+ {
+ log4net.ILog log = log4net.LogManager.GetLogger(t);
+ log.Error(msg);
+ }
+
+ #endregion
+
+
+ }
+}
\ No newline at end of file
diff --git a/MainFrm.cs b/MainFrm.cs
index d90fe55..1d9bcba 100644
--- a/MainFrm.cs
+++ b/MainFrm.cs
@@ -2894,25 +2894,26 @@
switch (trackflag)
{
case "valvequery":
- workWellLen.Clear();
- List list = new List();
- //找到所有阀门
- if (Utility.LayerNamesList != null)
- {
- ArrayList listpt = Utility.LayerNamesList;
+ //workWellLen.Clear();
+ //List list = new List();
+ ////找到所有阀门
+ //if (Utility.LayerNamesList != null)
+ //{
+ // ArrayList listpt = Utility.LayerNamesList;
- for (int i = 0; i < listpt.Count; i++)
- {
- string pipelineType = (string)Utility.LayerNamesList[i];
+ // for (int i = 0; i < listpt.Count; i++)
+ // {
+ // string pipelineType = (string)Utility.LayerNamesList[i];
- if ((pipelineType == "给水") || (pipelineType == "天然气") || (pipelineType == "热力"))
- {
- GSOFeatures fs = Intersect_PointLayerByType(polygon, pipelineType, "阀门");
- list.Add(fs);
- }
- }
- }
- FrmValveStatistics frm = new FrmValveStatistics(workWellLen, list, globeControl1, new DataGridViewDelegate(InitDataGridViewX1));
+ // if ((pipelineType == "给水") || (pipelineType == "天然气") || (pipelineType == "热力"))
+ // {
+ // GSOFeatures fs = Intersect_PointLayerByType(polygon, pipelineType, "阀门");
+ // list.Add(fs);
+ // }
+ // }
+ //}
+ //FrmValveStatistics frm = new FrmValveStatistics(workWellLen, list, globeControl1, new DataGridViewDelegate(InitDataGridViewX1));
+ FrmValveStatistics frm = new FrmValveStatistics(globeControl1,polygon, new DataGridViewDelegate(InitDataGridViewX1));
frm.Show(this);
//panelEx6.Visible = true;
toolStripFeatureLength.Text = "";
@@ -9696,25 +9697,26 @@
//日志记录
LogManager.saveLog(Utility.userName, "阀门数量统计");
- workWellLen.Clear();
- List list = new List();
- //找到所有阀门
- if (Utility.LayerNamesList != null)
- {
- ArrayList listpt = Utility.LayerNamesList;
+ //workWellLen.Clear();
+ //List list = new List();
+ ////找到所有阀门
+ //if (Utility.LayerNamesList != null)
+ //{
+ // ArrayList listpt = Utility.LayerNamesList;
- for (int i = 0; i < listpt.Count; i++)
- {
- string pipelineType = (string)Utility.LayerNamesList[i];
+ // for (int i = 0; i < listpt.Count; i++)
+ // {
+ // string pipelineType = (string)Utility.LayerNamesList[i];
- if ((pipelineType == "给水") || (pipelineType == "天然气") || (pipelineType == "热力"))
- {
- GSOFeatures fs = Intersect_PointLayerByType(null, pipelineType, "阀门");
- list.Add(fs);
- }
- }
- }
- FrmValveStatistics frm = new FrmValveStatistics(workWellLen, list, globeControl1, new DataGridViewDelegate(InitDataGridViewX1));
+ // if ((pipelineType == "给水") || (pipelineType == "天然气") || (pipelineType == "热力"))
+ // {
+ //GSOFeatures fs = Intersect_PointLayerByType(null, pipelineType, "阀门");
+ // list.Add(fs);
+ // }
+ // }
+ //}
+ //FrmValveStatistics frm = new FrmValveStatistics(workWellLen, list, globeControl1, new DataGridViewDelegate(InitDataGridViewX1));
+ FrmValveStatistics frm = new FrmValveStatistics(globeControl1, null, new DataGridViewDelegate(InitDataGridViewX1));
frm.Show(this);
globeControl1.Globe.Action = EnumAction3D.ActionNull;
diff --git a/app.config b/app.config
index f4cbe66..5753e1b 100644
--- a/app.config
+++ b/app.config
@@ -29,4 +29,30 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/bin/x86/Debug/Cyberpipe.exe.config b/bin/x86/Debug/Cyberpipe.exe.config
index f4cbe66..5753e1b 100644
--- a/bin/x86/Debug/Cyberpipe.exe.config
+++ b/bin/x86/Debug/Cyberpipe.exe.config
@@ -29,4 +29,30 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/Cyberpipe.csproj b/Cyberpipe.csproj
index 4038d91..004ec58 100644
--- a/Cyberpipe.csproj
+++ b/Cyberpipe.csproj
@@ -140,6 +140,10 @@
True
bin\x86\Debug\Interop.DSOFramer.dll
+
+ False
+ bin\x86\Debug\log4net.dll
+
False
@@ -1058,6 +1062,7 @@
+
Form
diff --git a/FeatureStatisticsService.cs b/FeatureStatisticsService.cs
index 7b5caad..4320c71 100644
--- a/FeatureStatisticsService.cs
+++ b/FeatureStatisticsService.cs
@@ -20,7 +20,7 @@
///
///
- public GSOFeatures Intersect_PointLayerByType(GSOGeoPolygon3D polygon, GSOLayer layer, string type)
+ public static GSOFeatures Intersect_PointLayerByType(GSOGeoPolygon3D polygon, GSOLayer layer, string type)
{
if (layer == null) return null;
diff --git a/FrmAllWorkWellStatis.cs b/FrmAllWorkWellStatis.cs
index 3f230df..7bf65dc 100644
--- a/FrmAllWorkWellStatis.cs
+++ b/FrmAllWorkWellStatis.cs
@@ -35,16 +35,18 @@
InitializeComponent();
globeControl1 = ctl;
m_InitDataGridViewX1 = InitDataGridViewX1;
- map = getAccsMap(polygon);
+ this.polygon = polygon;
+
}
private void FrmAllPipelineStatis_Load(object sender, EventArgs e)
{
+ map = getAccsMap(polygon);
drawChart();
}
- public void drawChart()
+ private void drawChart()
{
try
{
@@ -122,13 +124,11 @@
}
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);
@@ -212,7 +212,6 @@
Dictionary map = new Dictionary();
ArrayList listpt = Utility.LayerNamesList;
if (listpt == null || listpt.Count == 0) return null;
- FeatureStatisticsService service = new FeatureStatisticsService();
for (int i = 0; i < listpt.Count; i++)
{
GSOLayer layer = globeControl1.Globe.Layers.GetLayerByCaption(listpt[i] + "管线附属物");
@@ -223,7 +222,7 @@
if (accNames[j].Contains("井") || accNames[j].Contains("孔") || accNames[j].Contains("篦"))
{
- GSOFeatures features = service.Intersect_PointLayerByType(polygon, layer, accNames[j]);
+ GSOFeatures features = FeatureStatisticsService.Intersect_PointLayerByType(polygon, layer, accNames[j]);
if (features == null) continue;
map.Add(listpt[i] + accNames[j], features);
}
diff --git a/FrmValveStatistics.cs b/FrmValveStatistics.cs
index f8f4d3e..672f97a 100644
--- a/FrmValveStatistics.cs
+++ b/FrmValveStatistics.cs
@@ -9,26 +9,40 @@
using GeoScene.Data;
using GeoScene.Globe;
using DevComponents.DotNetBar;
+using System.Collections;
namespace Cyberpipe
{
public partial class FrmValveStatistics : DevComponents.DotNetBar.Office2007Form
{
- Dictionary workWellLengthAndType = new Dictionary();
- List list = new List();
- GSOGlobeControl globeControl1;
+ //Dictionary workWellLengthAndType = new Dictionary();
+ //List list = new List();
+ //GSOGlobeControl globeControl1;
- DataTable table = new DataTable();
- string strLable = "";
+ //DataTable table = new DataTable();
+ //string strLable = "";
+ //private MainFrm.DataGridViewDelegate m_InitDataGridViewX1;
+
private MainFrm.DataGridViewDelegate m_InitDataGridViewX1;
+ private Dictionary map = null;
+ private GSOGlobeControl globeControl1;
+ private GSOGeoPolygon3D polygon;
- public FrmValveStatistics(Dictionary wellLen, List _list,
- GSOGlobeControl ctl, MainFrm.DataGridViewDelegate initDataGridViewX1)
+ //public FrmValveStatistics(Dictionary wellLen, List _list,
+ // GSOGlobeControl ctl, MainFrm.DataGridViewDelegate initDataGridViewX1)
+ //{
+ // InitializeComponent();
+ // workWellLengthAndType = wellLen;
+ // list = _list;
+ // globeControl1 = ctl;
+ // m_InitDataGridViewX1 = initDataGridViewX1;
+ //}
+
+ public FrmValveStatistics(GSOGlobeControl ctl, GSOGeoPolygon3D polygon, MainFrm.DataGridViewDelegate InitDataGridViewX1)
{
InitializeComponent();
- workWellLengthAndType = wellLen;
- list = _list;
globeControl1 = ctl;
- m_InitDataGridViewX1 = initDataGridViewX1;
+ m_InitDataGridViewX1 = InitDataGridViewX1;
+ this.polygon = polygon;
}
///
/// 窗体初始化事件处理
@@ -37,8 +51,13 @@
///
private void FrmLayerSelectedQuery_Load(object sender, EventArgs e)
{
+ this.map = getValveMap(polygon) ;
+ drawChart();
+ }
+
+ private void drawChart() {
try
- {
+ {
chaFamenStatis.ChartAreas["ChartArea1"].AxisX.Title = "阀门类型";
chaFamenStatis.ChartAreas["ChartArea1"].AxisY.Title = "阀门个数";
chaFamenStatis.ChartAreas["ChartArea1"].AxisX.Interval = 1;
@@ -51,14 +70,19 @@
chaFamenStatis.Series["阀门"]["DrawingStyle"] = "Cylinder";
chaFamenStatis.Series["阀门"].IsValueShownAsLabel = true;
+ Dictionary workWellLengthAndType = new Dictionary();
+ foreach (KeyValuePair kv in map)
+ {
+ workWellLengthAndType.Add(kv.Key, kv.Value.Length);
+ }
chaFamenStatis.Series["阀门"].Points.DataBindXY(workWellLengthAndType.Keys, workWellLengthAndType.Values);
for (int m = 0; m < workWellLengthAndType.Values.Count; m++)
{
if (chaFamenStatis.Series["阀门"].Points[m].YValues[0].ToString() != "0")
{
chaFamenStatis.Series["阀门"].Points[m].Label = chaFamenStatis.Series[0].Points[m].YValues[0].ToString();
- }
- }
+ }
+ }
}
catch (Exception ex)
{
@@ -77,52 +101,32 @@
int indexHit = result.PointIndex;
if (indexHit >= 0)
{
-
- GSOFeatures fs = list[indexHit];
+
+ //GSOFeatures fs = list[indexHit];
string sql = "";
string pipetype = chaFamenStatis.Series["阀门"].Points[indexHit].AxisLabel;
+ GSOFeatures fs = map[pipetype];
string layername = pipetype.Substring(0, pipetype.Length - 2) + "管线附属物";
- MainFrm.m_CurrentQueryLayer = layername;
+ //MainFrm.m_CurrentQueryLayer = layername;
GSOLayer layer = globeControl1.Globe.Layers.GetLayerByCaption(layername);
- if (layer == null)
+ if (layer == null || fs.Length <= 0)
{
return;
}
- 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() + "'";
- }
- }
- }
- table = OledbHelper.QueryTable(sql);
- if (table.Rows.Count > 0)
- {
- strLable = " 阀门类型:" + pipetype + "||共有:" + Convert.ToString(table.Rows.Count) + "条记录";
- m_InitDataGridViewX1(table, strLable, layername, true);
- }
- else
- {
- return;
- }
+ sql = "select " + getpipeLineFields.getFields(layername, globeControl1) + " from " + layer.Name;
+ sql += " where 1>2 ";
+ for (int i = 0; i < fs.Length; i++)
+ {
+ sql += " or 编号 = '" + fs[i].GetValue("编号").ToString() + "'";
}
+
+ DataTable table = OledbHelper.QueryTable(sql);
+ string strLable = " 阀门类型:" + pipetype + "||共有:" + Convert.ToString(table.Rows.Count) + "条记录";
+ m_InitDataGridViewX1(table, strLable, layername, true);
+
}
}
///
@@ -150,7 +154,8 @@
///
private void FrmLayerSelectedQuery_FormClosing(object sender, FormClosingEventArgs e)
{
- m_InitDataGridViewX1(table, strLable, "", false);
+ globeControl1.Globe.ClearAnalysis();
+ m_InitDataGridViewX1(null, "", "", false);
}
private void 导出统计专题图ToolStripMenuItem_Click(object sender, EventArgs e)
@@ -159,7 +164,33 @@
PATM_Forms.F_PATMTitle frm = new PATM_Forms.F_PATMTitle("S", chaFamenStatis);
frm.Show();
}
-
-
+ ///
+ /// 获取区域内的各图层阀门
+ ///
+ ///
+ ///
+ public Dictionary getValveMap(GSOGeoPolygon3D polygon)
+ {
+ Dictionary map = new Dictionary();
+ //找到所有阀门
+ if (Utility.LayerNamesList != null)
+ {
+ ArrayList listpt = Utility.LayerNamesList;
+ for (int i = 0; i < listpt.Count; i++)
+ {
+ string pipelineType = (string)Utility.LayerNamesList[i];
+
+ if ((pipelineType == "给水") || (pipelineType == "天然气") || (pipelineType == "热力"))
+ {
+ GSOLayer layer = globeControl1.Globe.Layers.GetLayerByCaption(pipelineType + "管线附属物");
+ if (layer == null) return null;
+ GSOFeatures fs = FeatureStatisticsService.Intersect_PointLayerByType(polygon, layer, "阀门井");
+ if (fs == null) continue;
+ map.Add(pipelineType+"阀门",fs);
+ }
+ }
+ }
+ return map;
+ }
}
}
diff --git a/LogHelper.cs b/LogHelper.cs
new file mode 100644
index 0000000..24f4702
--- /dev/null
+++ b/LogHelper.cs
@@ -0,0 +1,43 @@
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+
+[assembly: log4net.Config.XmlConfigurator(Watch = true)]
+namespace Cyberpipe
+{
+ public class LogHelper
+ {
+ ///
+ /// 输出日志到Log4Net
+ ///
+ ///
+ ///
+ #region static void WriteLog(Type t, Exception ex)
+
+ public static void WriteLog(Type t, Exception ex)
+ {
+ log4net.ILog log = log4net.LogManager.GetLogger(t);
+ log.Error("Error", ex);
+ }
+
+ #endregion
+
+ ///
+ /// 输出日志到Log4Net
+ ///
+ ///
+ ///
+ #region static void WriteLog(Type t, string msg)
+
+ public static void WriteLog(Type t, string msg)
+ {
+ log4net.ILog log = log4net.LogManager.GetLogger(t);
+ log.Error(msg);
+ }
+
+ #endregion
+
+
+ }
+}
\ No newline at end of file
diff --git a/MainFrm.cs b/MainFrm.cs
index d90fe55..1d9bcba 100644
--- a/MainFrm.cs
+++ b/MainFrm.cs
@@ -2894,25 +2894,26 @@
switch (trackflag)
{
case "valvequery":
- workWellLen.Clear();
- List list = new List();
- //找到所有阀门
- if (Utility.LayerNamesList != null)
- {
- ArrayList listpt = Utility.LayerNamesList;
+ //workWellLen.Clear();
+ //List list = new List();
+ ////找到所有阀门
+ //if (Utility.LayerNamesList != null)
+ //{
+ // ArrayList listpt = Utility.LayerNamesList;
- for (int i = 0; i < listpt.Count; i++)
- {
- string pipelineType = (string)Utility.LayerNamesList[i];
+ // for (int i = 0; i < listpt.Count; i++)
+ // {
+ // string pipelineType = (string)Utility.LayerNamesList[i];
- if ((pipelineType == "给水") || (pipelineType == "天然气") || (pipelineType == "热力"))
- {
- GSOFeatures fs = Intersect_PointLayerByType(polygon, pipelineType, "阀门");
- list.Add(fs);
- }
- }
- }
- FrmValveStatistics frm = new FrmValveStatistics(workWellLen, list, globeControl1, new DataGridViewDelegate(InitDataGridViewX1));
+ // if ((pipelineType == "给水") || (pipelineType == "天然气") || (pipelineType == "热力"))
+ // {
+ // GSOFeatures fs = Intersect_PointLayerByType(polygon, pipelineType, "阀门");
+ // list.Add(fs);
+ // }
+ // }
+ //}
+ //FrmValveStatistics frm = new FrmValveStatistics(workWellLen, list, globeControl1, new DataGridViewDelegate(InitDataGridViewX1));
+ FrmValveStatistics frm = new FrmValveStatistics(globeControl1,polygon, new DataGridViewDelegate(InitDataGridViewX1));
frm.Show(this);
//panelEx6.Visible = true;
toolStripFeatureLength.Text = "";
@@ -9696,25 +9697,26 @@
//日志记录
LogManager.saveLog(Utility.userName, "阀门数量统计");
- workWellLen.Clear();
- List list = new List();
- //找到所有阀门
- if (Utility.LayerNamesList != null)
- {
- ArrayList listpt = Utility.LayerNamesList;
+ //workWellLen.Clear();
+ //List list = new List();
+ ////找到所有阀门
+ //if (Utility.LayerNamesList != null)
+ //{
+ // ArrayList listpt = Utility.LayerNamesList;
- for (int i = 0; i < listpt.Count; i++)
- {
- string pipelineType = (string)Utility.LayerNamesList[i];
+ // for (int i = 0; i < listpt.Count; i++)
+ // {
+ // string pipelineType = (string)Utility.LayerNamesList[i];
- if ((pipelineType == "给水") || (pipelineType == "天然气") || (pipelineType == "热力"))
- {
- GSOFeatures fs = Intersect_PointLayerByType(null, pipelineType, "阀门");
- list.Add(fs);
- }
- }
- }
- FrmValveStatistics frm = new FrmValveStatistics(workWellLen, list, globeControl1, new DataGridViewDelegate(InitDataGridViewX1));
+ // if ((pipelineType == "给水") || (pipelineType == "天然气") || (pipelineType == "热力"))
+ // {
+ //GSOFeatures fs = Intersect_PointLayerByType(null, pipelineType, "阀门");
+ // list.Add(fs);
+ // }
+ // }
+ //}
+ //FrmValveStatistics frm = new FrmValveStatistics(workWellLen, list, globeControl1, new DataGridViewDelegate(InitDataGridViewX1));
+ FrmValveStatistics frm = new FrmValveStatistics(globeControl1, null, new DataGridViewDelegate(InitDataGridViewX1));
frm.Show(this);
globeControl1.Globe.Action = EnumAction3D.ActionNull;
diff --git a/app.config b/app.config
index f4cbe66..5753e1b 100644
--- a/app.config
+++ b/app.config
@@ -29,4 +29,30 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/bin/x86/Debug/Cyberpipe.exe.config b/bin/x86/Debug/Cyberpipe.exe.config
index f4cbe66..5753e1b 100644
--- a/bin/x86/Debug/Cyberpipe.exe.config
+++ b/bin/x86/Debug/Cyberpipe.exe.config
@@ -29,4 +29,30 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/bin/x86/Debug/Cyberpipe.vshost.exe.config b/bin/x86/Debug/Cyberpipe.vshost.exe.config
index f4cbe66..5753e1b 100644
--- a/bin/x86/Debug/Cyberpipe.vshost.exe.config
+++ b/bin/x86/Debug/Cyberpipe.vshost.exe.config
@@ -29,4 +29,30 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/Cyberpipe.csproj b/Cyberpipe.csproj
index 4038d91..004ec58 100644
--- a/Cyberpipe.csproj
+++ b/Cyberpipe.csproj
@@ -140,6 +140,10 @@
True
bin\x86\Debug\Interop.DSOFramer.dll
+
+ False
+ bin\x86\Debug\log4net.dll
+
False
@@ -1058,6 +1062,7 @@
+
Form
diff --git a/FeatureStatisticsService.cs b/FeatureStatisticsService.cs
index 7b5caad..4320c71 100644
--- a/FeatureStatisticsService.cs
+++ b/FeatureStatisticsService.cs
@@ -20,7 +20,7 @@
///
///
- public GSOFeatures Intersect_PointLayerByType(GSOGeoPolygon3D polygon, GSOLayer layer, string type)
+ public static GSOFeatures Intersect_PointLayerByType(GSOGeoPolygon3D polygon, GSOLayer layer, string type)
{
if (layer == null) return null;
diff --git a/FrmAllWorkWellStatis.cs b/FrmAllWorkWellStatis.cs
index 3f230df..7bf65dc 100644
--- a/FrmAllWorkWellStatis.cs
+++ b/FrmAllWorkWellStatis.cs
@@ -35,16 +35,18 @@
InitializeComponent();
globeControl1 = ctl;
m_InitDataGridViewX1 = InitDataGridViewX1;
- map = getAccsMap(polygon);
+ this.polygon = polygon;
+
}
private void FrmAllPipelineStatis_Load(object sender, EventArgs e)
{
+ map = getAccsMap(polygon);
drawChart();
}
- public void drawChart()
+ private void drawChart()
{
try
{
@@ -122,13 +124,11 @@
}
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);
@@ -212,7 +212,6 @@
Dictionary map = new Dictionary();
ArrayList listpt = Utility.LayerNamesList;
if (listpt == null || listpt.Count == 0) return null;
- FeatureStatisticsService service = new FeatureStatisticsService();
for (int i = 0; i < listpt.Count; i++)
{
GSOLayer layer = globeControl1.Globe.Layers.GetLayerByCaption(listpt[i] + "管线附属物");
@@ -223,7 +222,7 @@
if (accNames[j].Contains("井") || accNames[j].Contains("孔") || accNames[j].Contains("篦"))
{
- GSOFeatures features = service.Intersect_PointLayerByType(polygon, layer, accNames[j]);
+ GSOFeatures features = FeatureStatisticsService.Intersect_PointLayerByType(polygon, layer, accNames[j]);
if (features == null) continue;
map.Add(listpt[i] + accNames[j], features);
}
diff --git a/FrmValveStatistics.cs b/FrmValveStatistics.cs
index f8f4d3e..672f97a 100644
--- a/FrmValveStatistics.cs
+++ b/FrmValveStatistics.cs
@@ -9,26 +9,40 @@
using GeoScene.Data;
using GeoScene.Globe;
using DevComponents.DotNetBar;
+using System.Collections;
namespace Cyberpipe
{
public partial class FrmValveStatistics : DevComponents.DotNetBar.Office2007Form
{
- Dictionary workWellLengthAndType = new Dictionary();
- List list = new List();
- GSOGlobeControl globeControl1;
+ //Dictionary workWellLengthAndType = new Dictionary();
+ //List list = new List();
+ //GSOGlobeControl globeControl1;
- DataTable table = new DataTable();
- string strLable = "";
+ //DataTable table = new DataTable();
+ //string strLable = "";
+ //private MainFrm.DataGridViewDelegate m_InitDataGridViewX1;
+
private MainFrm.DataGridViewDelegate m_InitDataGridViewX1;
+ private Dictionary map = null;
+ private GSOGlobeControl globeControl1;
+ private GSOGeoPolygon3D polygon;
- public FrmValveStatistics(Dictionary wellLen, List _list,
- GSOGlobeControl ctl, MainFrm.DataGridViewDelegate initDataGridViewX1)
+ //public FrmValveStatistics(Dictionary wellLen, List _list,
+ // GSOGlobeControl ctl, MainFrm.DataGridViewDelegate initDataGridViewX1)
+ //{
+ // InitializeComponent();
+ // workWellLengthAndType = wellLen;
+ // list = _list;
+ // globeControl1 = ctl;
+ // m_InitDataGridViewX1 = initDataGridViewX1;
+ //}
+
+ public FrmValveStatistics(GSOGlobeControl ctl, GSOGeoPolygon3D polygon, MainFrm.DataGridViewDelegate InitDataGridViewX1)
{
InitializeComponent();
- workWellLengthAndType = wellLen;
- list = _list;
globeControl1 = ctl;
- m_InitDataGridViewX1 = initDataGridViewX1;
+ m_InitDataGridViewX1 = InitDataGridViewX1;
+ this.polygon = polygon;
}
///
/// 窗体初始化事件处理
@@ -37,8 +51,13 @@
///
private void FrmLayerSelectedQuery_Load(object sender, EventArgs e)
{
+ this.map = getValveMap(polygon) ;
+ drawChart();
+ }
+
+ private void drawChart() {
try
- {
+ {
chaFamenStatis.ChartAreas["ChartArea1"].AxisX.Title = "阀门类型";
chaFamenStatis.ChartAreas["ChartArea1"].AxisY.Title = "阀门个数";
chaFamenStatis.ChartAreas["ChartArea1"].AxisX.Interval = 1;
@@ -51,14 +70,19 @@
chaFamenStatis.Series["阀门"]["DrawingStyle"] = "Cylinder";
chaFamenStatis.Series["阀门"].IsValueShownAsLabel = true;
+ Dictionary workWellLengthAndType = new Dictionary();
+ foreach (KeyValuePair kv in map)
+ {
+ workWellLengthAndType.Add(kv.Key, kv.Value.Length);
+ }
chaFamenStatis.Series["阀门"].Points.DataBindXY(workWellLengthAndType.Keys, workWellLengthAndType.Values);
for (int m = 0; m < workWellLengthAndType.Values.Count; m++)
{
if (chaFamenStatis.Series["阀门"].Points[m].YValues[0].ToString() != "0")
{
chaFamenStatis.Series["阀门"].Points[m].Label = chaFamenStatis.Series[0].Points[m].YValues[0].ToString();
- }
- }
+ }
+ }
}
catch (Exception ex)
{
@@ -77,52 +101,32 @@
int indexHit = result.PointIndex;
if (indexHit >= 0)
{
-
- GSOFeatures fs = list[indexHit];
+
+ //GSOFeatures fs = list[indexHit];
string sql = "";
string pipetype = chaFamenStatis.Series["阀门"].Points[indexHit].AxisLabel;
+ GSOFeatures fs = map[pipetype];
string layername = pipetype.Substring(0, pipetype.Length - 2) + "管线附属物";
- MainFrm.m_CurrentQueryLayer = layername;
+ //MainFrm.m_CurrentQueryLayer = layername;
GSOLayer layer = globeControl1.Globe.Layers.GetLayerByCaption(layername);
- if (layer == null)
+ if (layer == null || fs.Length <= 0)
{
return;
}
- 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() + "'";
- }
- }
- }
- table = OledbHelper.QueryTable(sql);
- if (table.Rows.Count > 0)
- {
- strLable = " 阀门类型:" + pipetype + "||共有:" + Convert.ToString(table.Rows.Count) + "条记录";
- m_InitDataGridViewX1(table, strLable, layername, true);
- }
- else
- {
- return;
- }
+ sql = "select " + getpipeLineFields.getFields(layername, globeControl1) + " from " + layer.Name;
+ sql += " where 1>2 ";
+ for (int i = 0; i < fs.Length; i++)
+ {
+ sql += " or 编号 = '" + fs[i].GetValue("编号").ToString() + "'";
}
+
+ DataTable table = OledbHelper.QueryTable(sql);
+ string strLable = " 阀门类型:" + pipetype + "||共有:" + Convert.ToString(table.Rows.Count) + "条记录";
+ m_InitDataGridViewX1(table, strLable, layername, true);
+
}
}
///
@@ -150,7 +154,8 @@
///
private void FrmLayerSelectedQuery_FormClosing(object sender, FormClosingEventArgs e)
{
- m_InitDataGridViewX1(table, strLable, "", false);
+ globeControl1.Globe.ClearAnalysis();
+ m_InitDataGridViewX1(null, "", "", false);
}
private void 导出统计专题图ToolStripMenuItem_Click(object sender, EventArgs e)
@@ -159,7 +164,33 @@
PATM_Forms.F_PATMTitle frm = new PATM_Forms.F_PATMTitle("S", chaFamenStatis);
frm.Show();
}
-
-
+ ///
+ /// 获取区域内的各图层阀门
+ ///
+ ///
+ ///
+ public Dictionary getValveMap(GSOGeoPolygon3D polygon)
+ {
+ Dictionary map = new Dictionary();
+ //找到所有阀门
+ if (Utility.LayerNamesList != null)
+ {
+ ArrayList listpt = Utility.LayerNamesList;
+ for (int i = 0; i < listpt.Count; i++)
+ {
+ string pipelineType = (string)Utility.LayerNamesList[i];
+
+ if ((pipelineType == "给水") || (pipelineType == "天然气") || (pipelineType == "热力"))
+ {
+ GSOLayer layer = globeControl1.Globe.Layers.GetLayerByCaption(pipelineType + "管线附属物");
+ if (layer == null) return null;
+ GSOFeatures fs = FeatureStatisticsService.Intersect_PointLayerByType(polygon, layer, "阀门井");
+ if (fs == null) continue;
+ map.Add(pipelineType+"阀门",fs);
+ }
+ }
+ }
+ return map;
+ }
}
}
diff --git a/LogHelper.cs b/LogHelper.cs
new file mode 100644
index 0000000..24f4702
--- /dev/null
+++ b/LogHelper.cs
@@ -0,0 +1,43 @@
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+
+[assembly: log4net.Config.XmlConfigurator(Watch = true)]
+namespace Cyberpipe
+{
+ public class LogHelper
+ {
+ ///
+ /// 输出日志到Log4Net
+ ///
+ ///
+ ///
+ #region static void WriteLog(Type t, Exception ex)
+
+ public static void WriteLog(Type t, Exception ex)
+ {
+ log4net.ILog log = log4net.LogManager.GetLogger(t);
+ log.Error("Error", ex);
+ }
+
+ #endregion
+
+ ///
+ /// 输出日志到Log4Net
+ ///
+ ///
+ ///
+ #region static void WriteLog(Type t, string msg)
+
+ public static void WriteLog(Type t, string msg)
+ {
+ log4net.ILog log = log4net.LogManager.GetLogger(t);
+ log.Error(msg);
+ }
+
+ #endregion
+
+
+ }
+}
\ No newline at end of file
diff --git a/MainFrm.cs b/MainFrm.cs
index d90fe55..1d9bcba 100644
--- a/MainFrm.cs
+++ b/MainFrm.cs
@@ -2894,25 +2894,26 @@
switch (trackflag)
{
case "valvequery":
- workWellLen.Clear();
- List list = new List();
- //找到所有阀门
- if (Utility.LayerNamesList != null)
- {
- ArrayList listpt = Utility.LayerNamesList;
+ //workWellLen.Clear();
+ //List list = new List();
+ ////找到所有阀门
+ //if (Utility.LayerNamesList != null)
+ //{
+ // ArrayList listpt = Utility.LayerNamesList;
- for (int i = 0; i < listpt.Count; i++)
- {
- string pipelineType = (string)Utility.LayerNamesList[i];
+ // for (int i = 0; i < listpt.Count; i++)
+ // {
+ // string pipelineType = (string)Utility.LayerNamesList[i];
- if ((pipelineType == "给水") || (pipelineType == "天然气") || (pipelineType == "热力"))
- {
- GSOFeatures fs = Intersect_PointLayerByType(polygon, pipelineType, "阀门");
- list.Add(fs);
- }
- }
- }
- FrmValveStatistics frm = new FrmValveStatistics(workWellLen, list, globeControl1, new DataGridViewDelegate(InitDataGridViewX1));
+ // if ((pipelineType == "给水") || (pipelineType == "天然气") || (pipelineType == "热力"))
+ // {
+ // GSOFeatures fs = Intersect_PointLayerByType(polygon, pipelineType, "阀门");
+ // list.Add(fs);
+ // }
+ // }
+ //}
+ //FrmValveStatistics frm = new FrmValveStatistics(workWellLen, list, globeControl1, new DataGridViewDelegate(InitDataGridViewX1));
+ FrmValveStatistics frm = new FrmValveStatistics(globeControl1,polygon, new DataGridViewDelegate(InitDataGridViewX1));
frm.Show(this);
//panelEx6.Visible = true;
toolStripFeatureLength.Text = "";
@@ -9696,25 +9697,26 @@
//日志记录
LogManager.saveLog(Utility.userName, "阀门数量统计");
- workWellLen.Clear();
- List list = new List();
- //找到所有阀门
- if (Utility.LayerNamesList != null)
- {
- ArrayList listpt = Utility.LayerNamesList;
+ //workWellLen.Clear();
+ //List list = new List();
+ ////找到所有阀门
+ //if (Utility.LayerNamesList != null)
+ //{
+ // ArrayList listpt = Utility.LayerNamesList;
- for (int i = 0; i < listpt.Count; i++)
- {
- string pipelineType = (string)Utility.LayerNamesList[i];
+ // for (int i = 0; i < listpt.Count; i++)
+ // {
+ // string pipelineType = (string)Utility.LayerNamesList[i];
- if ((pipelineType == "给水") || (pipelineType == "天然气") || (pipelineType == "热力"))
- {
- GSOFeatures fs = Intersect_PointLayerByType(null, pipelineType, "阀门");
- list.Add(fs);
- }
- }
- }
- FrmValveStatistics frm = new FrmValveStatistics(workWellLen, list, globeControl1, new DataGridViewDelegate(InitDataGridViewX1));
+ // if ((pipelineType == "给水") || (pipelineType == "天然气") || (pipelineType == "热力"))
+ // {
+ //GSOFeatures fs = Intersect_PointLayerByType(null, pipelineType, "阀门");
+ // list.Add(fs);
+ // }
+ // }
+ //}
+ //FrmValveStatistics frm = new FrmValveStatistics(workWellLen, list, globeControl1, new DataGridViewDelegate(InitDataGridViewX1));
+ FrmValveStatistics frm = new FrmValveStatistics(globeControl1, null, new DataGridViewDelegate(InitDataGridViewX1));
frm.Show(this);
globeControl1.Globe.Action = EnumAction3D.ActionNull;
diff --git a/app.config b/app.config
index f4cbe66..5753e1b 100644
--- a/app.config
+++ b/app.config
@@ -29,4 +29,30 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/bin/x86/Debug/Cyberpipe.exe.config b/bin/x86/Debug/Cyberpipe.exe.config
index f4cbe66..5753e1b 100644
--- a/bin/x86/Debug/Cyberpipe.exe.config
+++ b/bin/x86/Debug/Cyberpipe.exe.config
@@ -29,4 +29,30 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/bin/x86/Debug/Cyberpipe.vshost.exe.config b/bin/x86/Debug/Cyberpipe.vshost.exe.config
index f4cbe66..5753e1b 100644
--- a/bin/x86/Debug/Cyberpipe.vshost.exe.config
+++ b/bin/x86/Debug/Cyberpipe.vshost.exe.config
@@ -29,4 +29,30 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/bin/x86/Debug/log4net.dll b/bin/x86/Debug/log4net.dll
new file mode 100644
index 0000000..9a653d6
--- /dev/null
+++ b/bin/x86/Debug/log4net.dll
Binary files differ