diff --git a/Cyberpipe.suo b/Cyberpipe.suo index bbc1c97..70ab332 100644 --- a/Cyberpipe.suo +++ b/Cyberpipe.suo Binary files differ diff --git a/Cyberpipe.suo b/Cyberpipe.suo index bbc1c97..70ab332 100644 --- a/Cyberpipe.suo +++ b/Cyberpipe.suo Binary files differ diff --git a/FrmBasicQuery.cs b/FrmBasicQuery.cs index fb54f19..6936477 100644 --- a/FrmBasicQuery.cs +++ b/FrmBasicQuery.cs @@ -135,33 +135,36 @@ string col = str1 + colString1 + str2; lbxFieldValues.Items.Add(col); } - if (table.Rows[0][0].GetType() == typeof(string)) - { - checkBoxX1.Enabled = true; - checkBoxX2.Enabled = false; - checkBoxX3.Enabled = false; - checkBoxX4.Enabled = false; - checkBoxX5.Enabled = false; - checkBoxX6.Enabled = true; - } - else if (table.Rows[0][0].GetType() == typeof(int) || table.Rows[0][0].GetType() == typeof(float) || table.Rows[0][0].GetType() == typeof(double)) - { - checkBoxX1.Enabled = true; - checkBoxX2.Enabled = true; - checkBoxX3.Enabled = true; - checkBoxX4.Enabled = true; - checkBoxX5.Enabled = true; - checkBoxX6.Enabled = true; - } - else if (table.Rows[0][0].GetType() == typeof(DateTime)) - { - checkBoxX1.Enabled = true; - checkBoxX2.Enabled = true; - checkBoxX3.Enabled = true; - checkBoxX4.Enabled = true; - checkBoxX5.Enabled = true; - checkBoxX6.Enabled = false; - } + + string strFiled = cbxFields.SelectedItem.ToString(); + if (table.Rows[0][strFiled].GetType() == typeof(string)) + { + checkBoxX1.Enabled = true; + checkBoxX2.Enabled = false; + checkBoxX3.Enabled = false; + checkBoxX4.Enabled = false; + checkBoxX5.Enabled = false; + checkBoxX6.Enabled = true; + } + else if (table.Rows[0][strFiled].GetType() == typeof(int) || table.Rows[0][strFiled].GetType() == typeof(float) + || table.Rows[0][strFiled].GetType() == typeof(double)) + { + checkBoxX1.Enabled = true; + checkBoxX2.Enabled = true; + checkBoxX3.Enabled = true; + checkBoxX4.Enabled = true; + checkBoxX5.Enabled = true; + checkBoxX6.Enabled = true; + } + else if (table.Rows[0][strFiled].GetType() == typeof(decimal)) + { + checkBoxX1.Enabled = true; + checkBoxX2.Enabled = true; + checkBoxX3.Enabled = true; + checkBoxX4.Enabled = true; + checkBoxX5.Enabled = true; + checkBoxX6.Enabled = false; + } str1 = ""; str2 = ""; @@ -181,9 +184,10 @@ if (layer != null && layer.Dataset != null && layer.Dataset.IsFeatureDataset) { string name = layer.Name; - if (layer.Type == EnumLayerType.FeatureLayer && !name.Contains("\\")&& !name.Contains("/")) + if (layer.Type == EnumLayerType.FeatureLayer && !name.Contains("\\") && !name.Contains("施工") && !name.Contains("跟踪")) { - cbxLayers.Items.Add(layer.Caption); + if(name.EndsWith("管线")||name.EndsWith("附属物")||name.EndsWith("管点")) + cbxLayers.Items.Add(name); } } } @@ -245,15 +249,14 @@ panel.Visible = true; MainFrm.m_CurrentQueryLayer = cbxLayers.Text; dataGridView1.DataSource = table; - toolStripNumbers.Text = " 类型:" + cbxLayers.Text; + toolStripNumbers.Text = cbxLayers.Text; toolStripFeatureLength.Text = " 共有:" + table.Rows.Count + "个"; - } else { MessageBox.Show("没有查找到符合条件的数据!", "提示", MessageBoxButtons.OK, MessageBoxIcon.Information); dataGridView1.DataSource = null; - toolStripNumbers.Text = " 类型:"; + toolStripNumbers.Text = ""; toolStripFeatureLength.Text = " 管线里程:"; panel.Visible = false; } @@ -274,7 +277,7 @@ dataGridView1.DataSource = null; dataGridView1.Refresh(); panel.Visible = false; - toolStripNumbers.Text = " 类型:"; + toolStripNumbers.Text = ""; toolStripFeatureLength.Text = " 管线里程:"; frm = null; diff --git a/Cyberpipe.suo b/Cyberpipe.suo index bbc1c97..70ab332 100644 --- a/Cyberpipe.suo +++ b/Cyberpipe.suo Binary files differ diff --git a/FrmBasicQuery.cs b/FrmBasicQuery.cs index fb54f19..6936477 100644 --- a/FrmBasicQuery.cs +++ b/FrmBasicQuery.cs @@ -135,33 +135,36 @@ string col = str1 + colString1 + str2; lbxFieldValues.Items.Add(col); } - if (table.Rows[0][0].GetType() == typeof(string)) - { - checkBoxX1.Enabled = true; - checkBoxX2.Enabled = false; - checkBoxX3.Enabled = false; - checkBoxX4.Enabled = false; - checkBoxX5.Enabled = false; - checkBoxX6.Enabled = true; - } - else if (table.Rows[0][0].GetType() == typeof(int) || table.Rows[0][0].GetType() == typeof(float) || table.Rows[0][0].GetType() == typeof(double)) - { - checkBoxX1.Enabled = true; - checkBoxX2.Enabled = true; - checkBoxX3.Enabled = true; - checkBoxX4.Enabled = true; - checkBoxX5.Enabled = true; - checkBoxX6.Enabled = true; - } - else if (table.Rows[0][0].GetType() == typeof(DateTime)) - { - checkBoxX1.Enabled = true; - checkBoxX2.Enabled = true; - checkBoxX3.Enabled = true; - checkBoxX4.Enabled = true; - checkBoxX5.Enabled = true; - checkBoxX6.Enabled = false; - } + + string strFiled = cbxFields.SelectedItem.ToString(); + if (table.Rows[0][strFiled].GetType() == typeof(string)) + { + checkBoxX1.Enabled = true; + checkBoxX2.Enabled = false; + checkBoxX3.Enabled = false; + checkBoxX4.Enabled = false; + checkBoxX5.Enabled = false; + checkBoxX6.Enabled = true; + } + else if (table.Rows[0][strFiled].GetType() == typeof(int) || table.Rows[0][strFiled].GetType() == typeof(float) + || table.Rows[0][strFiled].GetType() == typeof(double)) + { + checkBoxX1.Enabled = true; + checkBoxX2.Enabled = true; + checkBoxX3.Enabled = true; + checkBoxX4.Enabled = true; + checkBoxX5.Enabled = true; + checkBoxX6.Enabled = true; + } + else if (table.Rows[0][strFiled].GetType() == typeof(decimal)) + { + checkBoxX1.Enabled = true; + checkBoxX2.Enabled = true; + checkBoxX3.Enabled = true; + checkBoxX4.Enabled = true; + checkBoxX5.Enabled = true; + checkBoxX6.Enabled = false; + } str1 = ""; str2 = ""; @@ -181,9 +184,10 @@ if (layer != null && layer.Dataset != null && layer.Dataset.IsFeatureDataset) { string name = layer.Name; - if (layer.Type == EnumLayerType.FeatureLayer && !name.Contains("\\")&& !name.Contains("/")) + if (layer.Type == EnumLayerType.FeatureLayer && !name.Contains("\\") && !name.Contains("施工") && !name.Contains("跟踪")) { - cbxLayers.Items.Add(layer.Caption); + if(name.EndsWith("管线")||name.EndsWith("附属物")||name.EndsWith("管点")) + cbxLayers.Items.Add(name); } } } @@ -245,15 +249,14 @@ panel.Visible = true; MainFrm.m_CurrentQueryLayer = cbxLayers.Text; dataGridView1.DataSource = table; - toolStripNumbers.Text = " 类型:" + cbxLayers.Text; + toolStripNumbers.Text = cbxLayers.Text; toolStripFeatureLength.Text = " 共有:" + table.Rows.Count + "个"; - } else { MessageBox.Show("没有查找到符合条件的数据!", "提示", MessageBoxButtons.OK, MessageBoxIcon.Information); dataGridView1.DataSource = null; - toolStripNumbers.Text = " 类型:"; + toolStripNumbers.Text = ""; toolStripFeatureLength.Text = " 管线里程:"; panel.Visible = false; } @@ -274,7 +277,7 @@ dataGridView1.DataSource = null; dataGridView1.Refresh(); panel.Visible = false; - toolStripNumbers.Text = " 类型:"; + toolStripNumbers.Text = ""; toolStripFeatureLength.Text = " 管线里程:"; frm = null; diff --git a/FrmHDMAnalysis3.cs b/FrmHDMAnalysis3.cs index bb0765b..e3f526b 100644 --- a/FrmHDMAnalysis3.cs +++ b/FrmHDMAnalysis3.cs @@ -14,7 +14,7 @@ namespace Cyberpipe { - public partial class FrmHDMAnalysis3 : DevComponents.DotNetBar.Office2007Form + public partial class FrmHDMAnalysis3 : Office2007Form { private ArrayList listPoint = new ArrayList(); private ArrayList listFeat = new ArrayList(); @@ -25,7 +25,6 @@ static ArrayList list = new ArrayList(); static DataTable table = new DataTable(); - static DataTable showTable = new DataTable(); GSOGlobeControl globeControl1; object[,] sortIndex; GSOLayer layerTemp; @@ -53,8 +52,8 @@ public FrmHDMAnalysis3(ArrayList arraylistP, ArrayList arraylistF, GSOGeoPolyline3D _line,GSOGlobeControl _ctl) { InitializeComponent(); - this.listPoint = arraylistP; - this.listFeat = arraylistF; + listPoint = arraylistP; + listFeat = arraylistF; line = _line; globeControl1 = _ctl; } @@ -83,7 +82,7 @@ { try { - this.Shown += new EventHandler(Frm_HDMAnalysis2_Shown); + Shown += new EventHandler(Frm_HDMAnalysis2_Shown); chart1.Series["管线"].ChartType = SeriesChartType.Point; @@ -91,13 +90,13 @@ chart1.Series["管线"].MarkerStyle = MarkerStyle.Circle; //点的类型 chart1.Series["管线"].MarkerBorderColor = Color.Black; //点的边框颜色 + chart1.ChartAreas[0].AxisX.Minimum = 0; //x轴的起始点大小 chart1.ChartAreas[0].AxisY.Maximum = 0; //y轴的最大值 chart1.ChartAreas[0].AxisX.Title = "距离 (米)"; chart1.ChartAreas[0].AxisY.Title = "埋深 (米)"; - //chart1.ChartAreas[0].AxisX.ScrollBar.Enabled = true; chart1.ChartAreas[0].AxisY2.Title = "高程 (米)"; double[] depths = new double[listFeat.Count]; for (int i = 0; i < listFeat.Count; i++) @@ -189,24 +188,23 @@ GSOPoint3d geoPoint = (GSOPoint3d)listPoint[i]; GSOFeature feature = listFeat[i] as GSOFeature; //坐标投影 - int id = GeoScene.Data.GSOProjectManager.AddProject(Utility.projectStr); + int id = GSOProjectManager.AddProject(Utility.projectStr); - GeoScene.Data.GSOPoint2d a_Point = GeoScene.Data.GSOProjectManager.Forward(new GSOPoint2d(a_x, a_y), id);//user画的线的起始点 + GSOPoint2d a_Point = GSOProjectManager.Forward(new GSOPoint2d(a_x, a_y), id);//user画的线的起始点 - GeoScene.Data.GSOPoint2d pt2d = new GeoScene.Data.GSOPoint2d(geoPoint.X, geoPoint.Y); - GeoScene.Data.GSOPoint2d result = GeoScene.Data.GSOProjectManager.Forward(pt2d, id); + GSOPoint2d pt2d = new GSOPoint2d(geoPoint.X, geoPoint.Y); + GSOPoint2d result = GSOProjectManager.Forward(pt2d, id); B_x = result.X; B_y = result.Y; - double x = System.Math.Abs(B_x - a_Point.X); - double y = System.Math.Abs(B_y - a_Point.Y); - double Dis = 0.0; - Dis = Math.Round(Math.Sqrt(x * x + y * y) , 2); + double x = Math.Abs(B_x - a_Point.X); + double y = Math.Abs(B_y - a_Point.Y); + double dis = Math.Round(Math.Sqrt(x * x + y * y) , 2); list.Add(geoPoint.Z); - sortIndex[i, 0] = Dis; + sortIndex[i, 0] = dis; sortIndex[i, 1] = i; - chart1.Series["管线"].Points.AddXY(Dis, geoPoint.Z);//绑定数据 + chart1.Series["管线"].Points.AddXY(dis, geoPoint.Z);//绑定数据 string pipeType = feature.Dataset == null ? "" : feature.Dataset.Caption; string number = Convert.ToString(i + 1); @@ -238,7 +236,9 @@ chart1.Series["管线"].Points[i].MarkerBorderWidth = 3; //边框的宽度 chart1.Series["管线"].Points[i].MarkerColor = Color.Transparent; - chart1.Series["管线"].Points[i].MarkerSize = Convert.ToInt32(Math.Floor((feature.GetFieldAsDouble("管径_毫米") / 0.35 + chart1.Series["管线"].Points[i].MarkerBorderWidth) / 100.0));//点的大小 + int scope = (int)chart1.ChartAreas[0].AxisX.Maximum > 100 ? (int)chart1.ChartAreas[0].AxisX.Maximum : 100; + chart1.Series["管线"].Points[i].MarkerSize = Convert.ToInt32(Math.Floor((feature.GetFieldAsDouble("管径_毫米") / 0.35 + chart1.Series["管线"].Points[i].MarkerBorderWidth)/scope));//点的大小 +// chart1.Series["管线"].Points[i].MarkerSize = Convert.ToInt32(Math.Floor((feature.GetFieldAsDouble("管径_毫米") / 0.35 + chart1.Series["管线"].Points[i].MarkerBorderWidth) / 100.0));//点的大小 } @@ -364,11 +364,11 @@ //Cursor cr = this.Cursor; if (result.PointIndex >= 0) { - this.Cursor = Cursors.Hand; + Cursor = Cursors.Hand; } else { - this.Cursor = Cursors.Default; + Cursor = Cursors.Default; } } /// @@ -435,7 +435,7 @@ { double x = a + r * Math.Cos(i * 5.625 * Math.PI / 180); double y = b - r * Math.Sin(i * 5.625 * Math.PI / 180); - GSOPoint2d pt2d = new GeoScene.Data.GSOPoint2d(x, y); + GSOPoint2d pt2d = new GSOPoint2d(x, y); GSOPoint3d pnt = new GSOPoint3d(); pnt.X = pt2d.X; pnt.Y = pt2d.Y;