diff --git a/Cyberpipe.csproj b/Cyberpipe.csproj index 07a8c1a..e3cd12c 100644 --- a/Cyberpipe.csproj +++ b/Cyberpipe.csproj @@ -204,25 +204,6 @@ - - Form - - - F_GKT1数据输入输出.cs - - - Form - - - F_GKT1添加文件.cs - - - Form - - - F_GKT1添加项目.cs - - Form @@ -1068,18 +1049,6 @@ Frm_password_reset.cs - - Form - - - GKT.cs - - - Form - - - GKT1.cs - Form @@ -1258,12 +1227,6 @@ F_Projedit.cs - - Form - - - PED.cs - Form @@ -1331,16 +1294,6 @@ True Reference.map - - F_GKT1数据输入输出.cs - Designer - - - F_GKT1添加文件.cs - - - F_GKT1添加项目.cs - Form_EditTask.cs @@ -1836,12 +1789,6 @@ Frm_password_reset.cs - - GKT.cs - - - GKT1.cs - F_GKT数据输入输出.cs @@ -1934,9 +1881,6 @@ F_Projedit.cs - - PED.cs - F_数据输入输出.cs diff --git a/Cyberpipe.csproj b/Cyberpipe.csproj index 07a8c1a..e3cd12c 100644 --- a/Cyberpipe.csproj +++ b/Cyberpipe.csproj @@ -204,25 +204,6 @@ - - Form - - - F_GKT1数据输入输出.cs - - - Form - - - F_GKT1添加文件.cs - - - Form - - - F_GKT1添加项目.cs - - Form @@ -1068,18 +1049,6 @@ Frm_password_reset.cs - - Form - - - GKT.cs - - - Form - - - GKT1.cs - Form @@ -1258,12 +1227,6 @@ F_Projedit.cs - - Form - - - PED.cs - Form @@ -1331,16 +1294,6 @@ True Reference.map - - F_GKT1数据输入输出.cs - Designer - - - F_GKT1添加文件.cs - - - F_GKT1添加项目.cs - Form_EditTask.cs @@ -1836,12 +1789,6 @@ Frm_password_reset.cs - - GKT.cs - - - GKT1.cs - F_GKT数据输入输出.cs @@ -1934,9 +1881,6 @@ F_Projedit.cs - - PED.cs - F_数据输入输出.cs diff --git a/Cyberpipe.suo b/Cyberpipe.suo index 68ced4f..a1aecf8 100644 --- a/Cyberpipe.suo +++ b/Cyberpipe.suo Binary files differ diff --git a/Cyberpipe.csproj b/Cyberpipe.csproj index 07a8c1a..e3cd12c 100644 --- a/Cyberpipe.csproj +++ b/Cyberpipe.csproj @@ -204,25 +204,6 @@ - - Form - - - F_GKT1数据输入输出.cs - - - Form - - - F_GKT1添加文件.cs - - - Form - - - F_GKT1添加项目.cs - - Form @@ -1068,18 +1049,6 @@ Frm_password_reset.cs - - Form - - - GKT.cs - - - Form - - - GKT1.cs - Form @@ -1258,12 +1227,6 @@ F_Projedit.cs - - Form - - - PED.cs - Form @@ -1331,16 +1294,6 @@ True Reference.map - - F_GKT1数据输入输出.cs - Designer - - - F_GKT1添加文件.cs - - - F_GKT1添加项目.cs - Form_EditTask.cs @@ -1836,12 +1789,6 @@ Frm_password_reset.cs - - GKT.cs - - - GKT1.cs - F_GKT数据输入输出.cs @@ -1934,9 +1881,6 @@ F_Projedit.cs - - PED.cs - F_数据输入输出.cs diff --git a/Cyberpipe.suo b/Cyberpipe.suo index 68ced4f..a1aecf8 100644 --- a/Cyberpipe.suo +++ b/Cyberpipe.suo Binary files differ diff --git a/EMS_Forms/Form_EditTask.cs b/EMS_Forms/Form_EditTask.cs index 718992f..f1d791f 100644 --- a/EMS_Forms/Form_EditTask.cs +++ b/EMS_Forms/Form_EditTask.cs @@ -119,7 +119,8 @@ String name = Convert.ToString(dr["USERNAME"]); comboBox_userName.Items.Add(name); - } + } + dr.Close(); comboBox_road.Items.Clear(); roadList = new List(); @@ -135,7 +136,7 @@ comboBox_road.Items.Add(name); } } - + dr1.Close(); conn.Close(); bool flag2 = false; @@ -185,7 +186,7 @@ catch (Exception ex) { - MessageBox.Show(ex.ToString()); + LogHelper.WriteLog(typeof(Form_EditTask), ex.Message); } } @@ -288,7 +289,7 @@ } catch (Exception ex) { - MessageBox.Show(ex.ToString()); + LogHelper.WriteLog(typeof(Form_EditTask), ex.Message); } } @@ -474,7 +475,7 @@ } catch (Exception ex) { - MessageBox.Show(ex.ToString()); + LogHelper.WriteLog(typeof(Form_EditTask), ex.Message); } this.Close(); @@ -495,6 +496,7 @@ { numList.Add(Convert.ToInt32(dr["DBID"])); } + dr.Close(); if (numList.Count == 0) { taskNumber = Convert.ToInt32(number) * 100; @@ -674,6 +676,7 @@ } } } + dr.Close(); conn.Close(); } diff --git a/Cyberpipe.csproj b/Cyberpipe.csproj index 07a8c1a..e3cd12c 100644 --- a/Cyberpipe.csproj +++ b/Cyberpipe.csproj @@ -204,25 +204,6 @@ - - Form - - - F_GKT1数据输入输出.cs - - - Form - - - F_GKT1添加文件.cs - - - Form - - - F_GKT1添加项目.cs - - Form @@ -1068,18 +1049,6 @@ Frm_password_reset.cs - - Form - - - GKT.cs - - - Form - - - GKT1.cs - Form @@ -1258,12 +1227,6 @@ F_Projedit.cs - - Form - - - PED.cs - Form @@ -1331,16 +1294,6 @@ True Reference.map - - F_GKT1数据输入输出.cs - Designer - - - F_GKT1添加文件.cs - - - F_GKT1添加项目.cs - Form_EditTask.cs @@ -1836,12 +1789,6 @@ Frm_password_reset.cs - - GKT.cs - - - GKT1.cs - F_GKT数据输入输出.cs @@ -1934,9 +1881,6 @@ F_Projedit.cs - - PED.cs - F_数据输入输出.cs diff --git a/Cyberpipe.suo b/Cyberpipe.suo index 68ced4f..a1aecf8 100644 --- a/Cyberpipe.suo +++ b/Cyberpipe.suo Binary files differ diff --git a/EMS_Forms/Form_EditTask.cs b/EMS_Forms/Form_EditTask.cs index 718992f..f1d791f 100644 --- a/EMS_Forms/Form_EditTask.cs +++ b/EMS_Forms/Form_EditTask.cs @@ -119,7 +119,8 @@ String name = Convert.ToString(dr["USERNAME"]); comboBox_userName.Items.Add(name); - } + } + dr.Close(); comboBox_road.Items.Clear(); roadList = new List(); @@ -135,7 +136,7 @@ comboBox_road.Items.Add(name); } } - + dr1.Close(); conn.Close(); bool flag2 = false; @@ -185,7 +186,7 @@ catch (Exception ex) { - MessageBox.Show(ex.ToString()); + LogHelper.WriteLog(typeof(Form_EditTask), ex.Message); } } @@ -288,7 +289,7 @@ } catch (Exception ex) { - MessageBox.Show(ex.ToString()); + LogHelper.WriteLog(typeof(Form_EditTask), ex.Message); } } @@ -474,7 +475,7 @@ } catch (Exception ex) { - MessageBox.Show(ex.ToString()); + LogHelper.WriteLog(typeof(Form_EditTask), ex.Message); } this.Close(); @@ -495,6 +496,7 @@ { numList.Add(Convert.ToInt32(dr["DBID"])); } + dr.Close(); if (numList.Count == 0) { taskNumber = Convert.ToInt32(number) * 100; @@ -674,6 +676,7 @@ } } } + dr.Close(); conn.Close(); } diff --git a/EMS_Forms/Form_EventManager.cs b/EMS_Forms/Form_EventManager.cs index b18c45b..84807b2 100644 --- a/EMS_Forms/Form_EventManager.cs +++ b/EMS_Forms/Form_EventManager.cs @@ -64,6 +64,7 @@ comboBox_name.Items.Add(name); } + dr.Close(); conn.Close(); diff --git a/Cyberpipe.csproj b/Cyberpipe.csproj index 07a8c1a..e3cd12c 100644 --- a/Cyberpipe.csproj +++ b/Cyberpipe.csproj @@ -204,25 +204,6 @@ - - Form - - - F_GKT1数据输入输出.cs - - - Form - - - F_GKT1添加文件.cs - - - Form - - - F_GKT1添加项目.cs - - Form @@ -1068,18 +1049,6 @@ Frm_password_reset.cs - - Form - - - GKT.cs - - - Form - - - GKT1.cs - Form @@ -1258,12 +1227,6 @@ F_Projedit.cs - - Form - - - PED.cs - Form @@ -1331,16 +1294,6 @@ True Reference.map - - F_GKT1数据输入输出.cs - Designer - - - F_GKT1添加文件.cs - - - F_GKT1添加项目.cs - Form_EditTask.cs @@ -1836,12 +1789,6 @@ Frm_password_reset.cs - - GKT.cs - - - GKT1.cs - F_GKT数据输入输出.cs @@ -1934,9 +1881,6 @@ F_Projedit.cs - - PED.cs - F_数据输入输出.cs diff --git a/Cyberpipe.suo b/Cyberpipe.suo index 68ced4f..a1aecf8 100644 --- a/Cyberpipe.suo +++ b/Cyberpipe.suo Binary files differ diff --git a/EMS_Forms/Form_EditTask.cs b/EMS_Forms/Form_EditTask.cs index 718992f..f1d791f 100644 --- a/EMS_Forms/Form_EditTask.cs +++ b/EMS_Forms/Form_EditTask.cs @@ -119,7 +119,8 @@ String name = Convert.ToString(dr["USERNAME"]); comboBox_userName.Items.Add(name); - } + } + dr.Close(); comboBox_road.Items.Clear(); roadList = new List(); @@ -135,7 +136,7 @@ comboBox_road.Items.Add(name); } } - + dr1.Close(); conn.Close(); bool flag2 = false; @@ -185,7 +186,7 @@ catch (Exception ex) { - MessageBox.Show(ex.ToString()); + LogHelper.WriteLog(typeof(Form_EditTask), ex.Message); } } @@ -288,7 +289,7 @@ } catch (Exception ex) { - MessageBox.Show(ex.ToString()); + LogHelper.WriteLog(typeof(Form_EditTask), ex.Message); } } @@ -474,7 +475,7 @@ } catch (Exception ex) { - MessageBox.Show(ex.ToString()); + LogHelper.WriteLog(typeof(Form_EditTask), ex.Message); } this.Close(); @@ -495,6 +496,7 @@ { numList.Add(Convert.ToInt32(dr["DBID"])); } + dr.Close(); if (numList.Count == 0) { taskNumber = Convert.ToInt32(number) * 100; @@ -674,6 +676,7 @@ } } } + dr.Close(); conn.Close(); } diff --git a/EMS_Forms/Form_EventManager.cs b/EMS_Forms/Form_EventManager.cs index b18c45b..84807b2 100644 --- a/EMS_Forms/Form_EventManager.cs +++ b/EMS_Forms/Form_EventManager.cs @@ -64,6 +64,7 @@ comboBox_name.Items.Add(name); } + dr.Close(); conn.Close(); diff --git a/Forms/FrmMnModify.cs b/Forms/FrmMnModify.cs index 31cfc5f..d036360 100644 --- a/Forms/FrmMnModify.cs +++ b/Forms/FrmMnModify.cs @@ -68,15 +68,7 @@ questionGrid.Rows[idx].Cells[1].Value = sr.question; } } - /// 选中对象 - /// - /// - /// - /// - private void buttonX1_Click(object sender, EventArgs e) - { - globecontrol.Globe.Action = EnumAction3D.SelectObject; - } + /// /// 选中某一行 /// diff --git a/Cyberpipe.csproj b/Cyberpipe.csproj index 07a8c1a..e3cd12c 100644 --- a/Cyberpipe.csproj +++ b/Cyberpipe.csproj @@ -204,25 +204,6 @@ - - Form - - - F_GKT1数据输入输出.cs - - - Form - - - F_GKT1添加文件.cs - - - Form - - - F_GKT1添加项目.cs - - Form @@ -1068,18 +1049,6 @@ Frm_password_reset.cs - - Form - - - GKT.cs - - - Form - - - GKT1.cs - Form @@ -1258,12 +1227,6 @@ F_Projedit.cs - - Form - - - PED.cs - Form @@ -1331,16 +1294,6 @@ True Reference.map - - F_GKT1数据输入输出.cs - Designer - - - F_GKT1添加文件.cs - - - F_GKT1添加项目.cs - Form_EditTask.cs @@ -1836,12 +1789,6 @@ Frm_password_reset.cs - - GKT.cs - - - GKT1.cs - F_GKT数据输入输出.cs @@ -1934,9 +1881,6 @@ F_Projedit.cs - - PED.cs - F_数据输入输出.cs diff --git a/Cyberpipe.suo b/Cyberpipe.suo index 68ced4f..a1aecf8 100644 --- a/Cyberpipe.suo +++ b/Cyberpipe.suo Binary files differ diff --git a/EMS_Forms/Form_EditTask.cs b/EMS_Forms/Form_EditTask.cs index 718992f..f1d791f 100644 --- a/EMS_Forms/Form_EditTask.cs +++ b/EMS_Forms/Form_EditTask.cs @@ -119,7 +119,8 @@ String name = Convert.ToString(dr["USERNAME"]); comboBox_userName.Items.Add(name); - } + } + dr.Close(); comboBox_road.Items.Clear(); roadList = new List(); @@ -135,7 +136,7 @@ comboBox_road.Items.Add(name); } } - + dr1.Close(); conn.Close(); bool flag2 = false; @@ -185,7 +186,7 @@ catch (Exception ex) { - MessageBox.Show(ex.ToString()); + LogHelper.WriteLog(typeof(Form_EditTask), ex.Message); } } @@ -288,7 +289,7 @@ } catch (Exception ex) { - MessageBox.Show(ex.ToString()); + LogHelper.WriteLog(typeof(Form_EditTask), ex.Message); } } @@ -474,7 +475,7 @@ } catch (Exception ex) { - MessageBox.Show(ex.ToString()); + LogHelper.WriteLog(typeof(Form_EditTask), ex.Message); } this.Close(); @@ -495,6 +496,7 @@ { numList.Add(Convert.ToInt32(dr["DBID"])); } + dr.Close(); if (numList.Count == 0) { taskNumber = Convert.ToInt32(number) * 100; @@ -674,6 +676,7 @@ } } } + dr.Close(); conn.Close(); } diff --git a/EMS_Forms/Form_EventManager.cs b/EMS_Forms/Form_EventManager.cs index b18c45b..84807b2 100644 --- a/EMS_Forms/Form_EventManager.cs +++ b/EMS_Forms/Form_EventManager.cs @@ -64,6 +64,7 @@ comboBox_name.Items.Add(name); } + dr.Close(); conn.Close(); diff --git a/Forms/FrmMnModify.cs b/Forms/FrmMnModify.cs index 31cfc5f..d036360 100644 --- a/Forms/FrmMnModify.cs +++ b/Forms/FrmMnModify.cs @@ -68,15 +68,7 @@ questionGrid.Rows[idx].Cells[1].Value = sr.question; } } - /// 选中对象 - /// - /// - /// - /// - private void buttonX1_Click(object sender, EventArgs e) - { - globecontrol.Globe.Action = EnumAction3D.SelectObject; - } + /// /// 选中某一行 /// diff --git a/Forms/FrmPipelineModelDataBase.cs b/Forms/FrmPipelineModelDataBase.cs index 2acf0ca..7ce573f 100644 --- a/Forms/FrmPipelineModelDataBase.cs +++ b/Forms/FrmPipelineModelDataBase.cs @@ -35,19 +35,7 @@ ds = _ds; InitializeComponent(); } - /// - /// 单击选择shp格式文件 - /// - /// - /// - private void btnBrowseModel_Click(object sender, EventArgs e) - { - saveFileDialog1.Filter = "*.lgd|*.lgd"; - if (saveFileDialog1.ShowDialog() == DialogResult.OK) - { - txtModelLayer.Text = saveFileDialog1.FileName; - } - } + /// /// 窗体初始化事件处理 /// @@ -100,49 +88,6 @@ } } } - - private object convertFieldValue(string fieldname, object obj) - { - if (obj == null) - return null; - - try - { - string type = fields_types[fieldname].ToString(); - switch (type) - { - case "string": - return obj.ToString(); - case "int": - //return 101; - int intResult; - if (int.TryParse(obj.ToString(), out intResult)) - return intResult; - else - return null; - case "double": - //return 202.5; - double doubleResult; - if (double.TryParse(obj.ToString(), out doubleResult)) - return doubleResult; - else - return null; - case "date": - DateTime dtResult; - if (DateTime.TryParse(obj.ToString(), out dtResult)) - return dtResult; - else - return null; - } - return null; - } - catch (Exception ex) - { - MessageBox.Show(ex.ToString()); - return null; - } - } - public string lgdFilePath = ""; /// /// 选择管线颜色 @@ -610,33 +555,6 @@ { this.Close(); } - - private void cmbLayer_SelectedIndexChanged(object sender, EventArgs e) //选择图层 - { - GSOLayer layer = ctl.Globe.Layers.GetLayerByCaption(selectLayerName); - GSOFeatures features = layer.GetAllFeatures(); - if (features.Length == 0) - return; - - cmbFrom.Items.Clear(); - cmbTo.Items.Clear(); - cmbRadius.Items.Clear(); - cmbID.Items.Clear(); - for (int i = 0; i < features[0].GetFieldCount(); i++) - { - GeoScene.Data.GSOFieldDefn fielddef = (GeoScene.Data.GSOFieldDefn)(features[0].GetFieldDefn(i)); - - cmbFrom.Items.Add(fielddef.Name); - cmbTo.Items.Add(fielddef.Name); - cmbRadius.Items.Add(fielddef.Name); - cmbID.Items.Add(fielddef.Name); - } - cmbFrom.SelectedItem = "Deep1"; - cmbTo.SelectedItem = "Deep2"; - cmbRadius.SelectedItem = "Diameter"; - cmbID.SelectedItem = "Handle"; - } - private void buttonXLayerPath_Click(object sender, EventArgs e)//单击 选择shp格式的文件 { OpenFileDialog dlg = new OpenFileDialog(); diff --git a/Cyberpipe.csproj b/Cyberpipe.csproj index 07a8c1a..e3cd12c 100644 --- a/Cyberpipe.csproj +++ b/Cyberpipe.csproj @@ -204,25 +204,6 @@ - - Form - - - F_GKT1数据输入输出.cs - - - Form - - - F_GKT1添加文件.cs - - - Form - - - F_GKT1添加项目.cs - - Form @@ -1068,18 +1049,6 @@ Frm_password_reset.cs - - Form - - - GKT.cs - - - Form - - - GKT1.cs - Form @@ -1258,12 +1227,6 @@ F_Projedit.cs - - Form - - - PED.cs - Form @@ -1331,16 +1294,6 @@ True Reference.map - - F_GKT1数据输入输出.cs - Designer - - - F_GKT1添加文件.cs - - - F_GKT1添加项目.cs - Form_EditTask.cs @@ -1836,12 +1789,6 @@ Frm_password_reset.cs - - GKT.cs - - - GKT1.cs - F_GKT数据输入输出.cs @@ -1934,9 +1881,6 @@ F_Projedit.cs - - PED.cs - F_数据输入输出.cs diff --git a/Cyberpipe.suo b/Cyberpipe.suo index 68ced4f..a1aecf8 100644 --- a/Cyberpipe.suo +++ b/Cyberpipe.suo Binary files differ diff --git a/EMS_Forms/Form_EditTask.cs b/EMS_Forms/Form_EditTask.cs index 718992f..f1d791f 100644 --- a/EMS_Forms/Form_EditTask.cs +++ b/EMS_Forms/Form_EditTask.cs @@ -119,7 +119,8 @@ String name = Convert.ToString(dr["USERNAME"]); comboBox_userName.Items.Add(name); - } + } + dr.Close(); comboBox_road.Items.Clear(); roadList = new List(); @@ -135,7 +136,7 @@ comboBox_road.Items.Add(name); } } - + dr1.Close(); conn.Close(); bool flag2 = false; @@ -185,7 +186,7 @@ catch (Exception ex) { - MessageBox.Show(ex.ToString()); + LogHelper.WriteLog(typeof(Form_EditTask), ex.Message); } } @@ -288,7 +289,7 @@ } catch (Exception ex) { - MessageBox.Show(ex.ToString()); + LogHelper.WriteLog(typeof(Form_EditTask), ex.Message); } } @@ -474,7 +475,7 @@ } catch (Exception ex) { - MessageBox.Show(ex.ToString()); + LogHelper.WriteLog(typeof(Form_EditTask), ex.Message); } this.Close(); @@ -495,6 +496,7 @@ { numList.Add(Convert.ToInt32(dr["DBID"])); } + dr.Close(); if (numList.Count == 0) { taskNumber = Convert.ToInt32(number) * 100; @@ -674,6 +676,7 @@ } } } + dr.Close(); conn.Close(); } diff --git a/EMS_Forms/Form_EventManager.cs b/EMS_Forms/Form_EventManager.cs index b18c45b..84807b2 100644 --- a/EMS_Forms/Form_EventManager.cs +++ b/EMS_Forms/Form_EventManager.cs @@ -64,6 +64,7 @@ comboBox_name.Items.Add(name); } + dr.Close(); conn.Close(); diff --git a/Forms/FrmMnModify.cs b/Forms/FrmMnModify.cs index 31cfc5f..d036360 100644 --- a/Forms/FrmMnModify.cs +++ b/Forms/FrmMnModify.cs @@ -68,15 +68,7 @@ questionGrid.Rows[idx].Cells[1].Value = sr.question; } } - /// 选中对象 - /// - /// - /// - /// - private void buttonX1_Click(object sender, EventArgs e) - { - globecontrol.Globe.Action = EnumAction3D.SelectObject; - } + /// /// 选中某一行 /// diff --git a/Forms/FrmPipelineModelDataBase.cs b/Forms/FrmPipelineModelDataBase.cs index 2acf0ca..7ce573f 100644 --- a/Forms/FrmPipelineModelDataBase.cs +++ b/Forms/FrmPipelineModelDataBase.cs @@ -35,19 +35,7 @@ ds = _ds; InitializeComponent(); } - /// - /// 单击选择shp格式文件 - /// - /// - /// - private void btnBrowseModel_Click(object sender, EventArgs e) - { - saveFileDialog1.Filter = "*.lgd|*.lgd"; - if (saveFileDialog1.ShowDialog() == DialogResult.OK) - { - txtModelLayer.Text = saveFileDialog1.FileName; - } - } + /// /// 窗体初始化事件处理 /// @@ -100,49 +88,6 @@ } } } - - private object convertFieldValue(string fieldname, object obj) - { - if (obj == null) - return null; - - try - { - string type = fields_types[fieldname].ToString(); - switch (type) - { - case "string": - return obj.ToString(); - case "int": - //return 101; - int intResult; - if (int.TryParse(obj.ToString(), out intResult)) - return intResult; - else - return null; - case "double": - //return 202.5; - double doubleResult; - if (double.TryParse(obj.ToString(), out doubleResult)) - return doubleResult; - else - return null; - case "date": - DateTime dtResult; - if (DateTime.TryParse(obj.ToString(), out dtResult)) - return dtResult; - else - return null; - } - return null; - } - catch (Exception ex) - { - MessageBox.Show(ex.ToString()); - return null; - } - } - public string lgdFilePath = ""; /// /// 选择管线颜色 @@ -610,33 +555,6 @@ { this.Close(); } - - private void cmbLayer_SelectedIndexChanged(object sender, EventArgs e) //选择图层 - { - GSOLayer layer = ctl.Globe.Layers.GetLayerByCaption(selectLayerName); - GSOFeatures features = layer.GetAllFeatures(); - if (features.Length == 0) - return; - - cmbFrom.Items.Clear(); - cmbTo.Items.Clear(); - cmbRadius.Items.Clear(); - cmbID.Items.Clear(); - for (int i = 0; i < features[0].GetFieldCount(); i++) - { - GeoScene.Data.GSOFieldDefn fielddef = (GeoScene.Data.GSOFieldDefn)(features[0].GetFieldDefn(i)); - - cmbFrom.Items.Add(fielddef.Name); - cmbTo.Items.Add(fielddef.Name); - cmbRadius.Items.Add(fielddef.Name); - cmbID.Items.Add(fielddef.Name); - } - cmbFrom.SelectedItem = "Deep1"; - cmbTo.SelectedItem = "Deep2"; - cmbRadius.SelectedItem = "Diameter"; - cmbID.SelectedItem = "Handle"; - } - private void buttonXLayerPath_Click(object sender, EventArgs e)//单击 选择shp格式的文件 { OpenFileDialog dlg = new OpenFileDialog(); diff --git a/Forms/FrmPipelineModelDataOneStep.cs b/Forms/FrmPipelineModelDataOneStep.cs index 18afda7..ec93b8a 100644 --- a/Forms/FrmPipelineModelDataOneStep.cs +++ b/Forms/FrmPipelineModelDataOneStep.cs @@ -38,19 +38,7 @@ layerTree = _layerTree; InitializeComponent(); } - /// - /// 单击选择shp格式文件 - /// - /// - /// - private void btnBrowseModel_Click(object sender, EventArgs e) - { - saveFileDialog1.Filter = "*.lgd|*.lgd"; - if (saveFileDialog1.ShowDialog() == DialogResult.OK) - { - txtModelLayer.Text = saveFileDialog1.FileName; - } - } + /// /// 窗体初始化事件处理 /// @@ -107,48 +95,7 @@ } } - private object convertFieldValue(string fieldname, object obj) - { - if (obj == null) - return null; - - try - { - string type = fields_types[fieldname].ToString(); - switch (type) - { - case "string": - return obj.ToString(); - case "int": - //return 101; - int intResult; - if (int.TryParse(obj.ToString(), out intResult)) - return intResult; - else - return null; - case "double": - //return 202.5; - double doubleResult; - if (double.TryParse(obj.ToString(), out doubleResult)) - return doubleResult; - else - return null; - case "date": - DateTime dtResult; - if (DateTime.TryParse(obj.ToString(), out dtResult)) - return dtResult; - else - return null; - } - return null; - } - catch (Exception ex) - { - MessageBox.Show(ex.ToString()); - return null; - } - } - + public string lgdFilePath = ""; /// /// 选择管线颜色 @@ -673,32 +620,6 @@ return featDs; } - private void cmbLayer_SelectedIndexChanged(object sender, EventArgs e) //选择图层 - { - GSOLayer layer = ctl.Globe.Layers.GetLayerByCaption(selectLayerName); - GSOFeatures features = layer.GetAllFeatures(); - if (features.Length == 0) - return; - - cmbFrom.Items.Clear(); - cmbTo.Items.Clear(); - cmbRadius.Items.Clear(); - cmbID.Items.Clear(); - for (int i = 0; i < features[0].GetFieldCount(); i++) - { - GeoScene.Data.GSOFieldDefn fielddef = (GeoScene.Data.GSOFieldDefn)(features[0].GetFieldDefn(i)); - - cmbFrom.Items.Add(fielddef.Name); - cmbTo.Items.Add(fielddef.Name); - cmbRadius.Items.Add(fielddef.Name); - cmbID.Items.Add(fielddef.Name); - } - cmbFrom.SelectedItem = "Deep1"; - cmbTo.SelectedItem = "Deep2"; - cmbRadius.SelectedItem = "Diameter"; - cmbID.SelectedItem = "Handle"; - } - private void buttonXLayerPath_Click(object sender, EventArgs e)//单击 选择shp格式的文件 { OpenFileDialog dlg = new OpenFileDialog(); @@ -949,38 +870,6 @@ } //txtLayername.Text = type + layername; } - /// - /// 连接数据库 - /// - /// - /// - private void buttonX1_Click(object sender, EventArgs e) - { - if (ds == null) - { - //没连的话,直接连接审核库; //审核库配置读配置文件 - string dbIp = Utility.sgdbip; - string database = Utility.sgdbname; - string user = Utility.sgdbuser; - string pass = Utility.sgdbpwd; - - if (!Utility.isNetworkConnectionSuccess(dbIp.Trim())) - { - MessageBox.Show("网络连接失败!", "提示"); - return; - } - - ds = ctl.Globe.DataManager.OpenOracleDataSource(dbIp + "/" + database, "", "", user, pass); - if (ds == null) - { - MessageBox.Show("数据库连接失败!", "提示", MessageBoxButtons.OK, MessageBoxIcon.Warning); - } - else - { - btnCreateModel.Enabled = true; - } - } - } private void btnClose_Click(object sender, EventArgs e) { diff --git a/Cyberpipe.csproj b/Cyberpipe.csproj index 07a8c1a..e3cd12c 100644 --- a/Cyberpipe.csproj +++ b/Cyberpipe.csproj @@ -204,25 +204,6 @@ - - Form - - - F_GKT1数据输入输出.cs - - - Form - - - F_GKT1添加文件.cs - - - Form - - - F_GKT1添加项目.cs - - Form @@ -1068,18 +1049,6 @@ Frm_password_reset.cs - - Form - - - GKT.cs - - - Form - - - GKT1.cs - Form @@ -1258,12 +1227,6 @@ F_Projedit.cs - - Form - - - PED.cs - Form @@ -1331,16 +1294,6 @@ True Reference.map - - F_GKT1数据输入输出.cs - Designer - - - F_GKT1添加文件.cs - - - F_GKT1添加项目.cs - Form_EditTask.cs @@ -1836,12 +1789,6 @@ Frm_password_reset.cs - - GKT.cs - - - GKT1.cs - F_GKT数据输入输出.cs @@ -1934,9 +1881,6 @@ F_Projedit.cs - - PED.cs - F_数据输入输出.cs diff --git a/Cyberpipe.suo b/Cyberpipe.suo index 68ced4f..a1aecf8 100644 --- a/Cyberpipe.suo +++ b/Cyberpipe.suo Binary files differ diff --git a/EMS_Forms/Form_EditTask.cs b/EMS_Forms/Form_EditTask.cs index 718992f..f1d791f 100644 --- a/EMS_Forms/Form_EditTask.cs +++ b/EMS_Forms/Form_EditTask.cs @@ -119,7 +119,8 @@ String name = Convert.ToString(dr["USERNAME"]); comboBox_userName.Items.Add(name); - } + } + dr.Close(); comboBox_road.Items.Clear(); roadList = new List(); @@ -135,7 +136,7 @@ comboBox_road.Items.Add(name); } } - + dr1.Close(); conn.Close(); bool flag2 = false; @@ -185,7 +186,7 @@ catch (Exception ex) { - MessageBox.Show(ex.ToString()); + LogHelper.WriteLog(typeof(Form_EditTask), ex.Message); } } @@ -288,7 +289,7 @@ } catch (Exception ex) { - MessageBox.Show(ex.ToString()); + LogHelper.WriteLog(typeof(Form_EditTask), ex.Message); } } @@ -474,7 +475,7 @@ } catch (Exception ex) { - MessageBox.Show(ex.ToString()); + LogHelper.WriteLog(typeof(Form_EditTask), ex.Message); } this.Close(); @@ -495,6 +496,7 @@ { numList.Add(Convert.ToInt32(dr["DBID"])); } + dr.Close(); if (numList.Count == 0) { taskNumber = Convert.ToInt32(number) * 100; @@ -674,6 +676,7 @@ } } } + dr.Close(); conn.Close(); } diff --git a/EMS_Forms/Form_EventManager.cs b/EMS_Forms/Form_EventManager.cs index b18c45b..84807b2 100644 --- a/EMS_Forms/Form_EventManager.cs +++ b/EMS_Forms/Form_EventManager.cs @@ -64,6 +64,7 @@ comboBox_name.Items.Add(name); } + dr.Close(); conn.Close(); diff --git a/Forms/FrmMnModify.cs b/Forms/FrmMnModify.cs index 31cfc5f..d036360 100644 --- a/Forms/FrmMnModify.cs +++ b/Forms/FrmMnModify.cs @@ -68,15 +68,7 @@ questionGrid.Rows[idx].Cells[1].Value = sr.question; } } - /// 选中对象 - /// - /// - /// - /// - private void buttonX1_Click(object sender, EventArgs e) - { - globecontrol.Globe.Action = EnumAction3D.SelectObject; - } + /// /// 选中某一行 /// diff --git a/Forms/FrmPipelineModelDataBase.cs b/Forms/FrmPipelineModelDataBase.cs index 2acf0ca..7ce573f 100644 --- a/Forms/FrmPipelineModelDataBase.cs +++ b/Forms/FrmPipelineModelDataBase.cs @@ -35,19 +35,7 @@ ds = _ds; InitializeComponent(); } - /// - /// 单击选择shp格式文件 - /// - /// - /// - private void btnBrowseModel_Click(object sender, EventArgs e) - { - saveFileDialog1.Filter = "*.lgd|*.lgd"; - if (saveFileDialog1.ShowDialog() == DialogResult.OK) - { - txtModelLayer.Text = saveFileDialog1.FileName; - } - } + /// /// 窗体初始化事件处理 /// @@ -100,49 +88,6 @@ } } } - - private object convertFieldValue(string fieldname, object obj) - { - if (obj == null) - return null; - - try - { - string type = fields_types[fieldname].ToString(); - switch (type) - { - case "string": - return obj.ToString(); - case "int": - //return 101; - int intResult; - if (int.TryParse(obj.ToString(), out intResult)) - return intResult; - else - return null; - case "double": - //return 202.5; - double doubleResult; - if (double.TryParse(obj.ToString(), out doubleResult)) - return doubleResult; - else - return null; - case "date": - DateTime dtResult; - if (DateTime.TryParse(obj.ToString(), out dtResult)) - return dtResult; - else - return null; - } - return null; - } - catch (Exception ex) - { - MessageBox.Show(ex.ToString()); - return null; - } - } - public string lgdFilePath = ""; /// /// 选择管线颜色 @@ -610,33 +555,6 @@ { this.Close(); } - - private void cmbLayer_SelectedIndexChanged(object sender, EventArgs e) //选择图层 - { - GSOLayer layer = ctl.Globe.Layers.GetLayerByCaption(selectLayerName); - GSOFeatures features = layer.GetAllFeatures(); - if (features.Length == 0) - return; - - cmbFrom.Items.Clear(); - cmbTo.Items.Clear(); - cmbRadius.Items.Clear(); - cmbID.Items.Clear(); - for (int i = 0; i < features[0].GetFieldCount(); i++) - { - GeoScene.Data.GSOFieldDefn fielddef = (GeoScene.Data.GSOFieldDefn)(features[0].GetFieldDefn(i)); - - cmbFrom.Items.Add(fielddef.Name); - cmbTo.Items.Add(fielddef.Name); - cmbRadius.Items.Add(fielddef.Name); - cmbID.Items.Add(fielddef.Name); - } - cmbFrom.SelectedItem = "Deep1"; - cmbTo.SelectedItem = "Deep2"; - cmbRadius.SelectedItem = "Diameter"; - cmbID.SelectedItem = "Handle"; - } - private void buttonXLayerPath_Click(object sender, EventArgs e)//单击 选择shp格式的文件 { OpenFileDialog dlg = new OpenFileDialog(); diff --git a/Forms/FrmPipelineModelDataOneStep.cs b/Forms/FrmPipelineModelDataOneStep.cs index 18afda7..ec93b8a 100644 --- a/Forms/FrmPipelineModelDataOneStep.cs +++ b/Forms/FrmPipelineModelDataOneStep.cs @@ -38,19 +38,7 @@ layerTree = _layerTree; InitializeComponent(); } - /// - /// 单击选择shp格式文件 - /// - /// - /// - private void btnBrowseModel_Click(object sender, EventArgs e) - { - saveFileDialog1.Filter = "*.lgd|*.lgd"; - if (saveFileDialog1.ShowDialog() == DialogResult.OK) - { - txtModelLayer.Text = saveFileDialog1.FileName; - } - } + /// /// 窗体初始化事件处理 /// @@ -107,48 +95,7 @@ } } - private object convertFieldValue(string fieldname, object obj) - { - if (obj == null) - return null; - - try - { - string type = fields_types[fieldname].ToString(); - switch (type) - { - case "string": - return obj.ToString(); - case "int": - //return 101; - int intResult; - if (int.TryParse(obj.ToString(), out intResult)) - return intResult; - else - return null; - case "double": - //return 202.5; - double doubleResult; - if (double.TryParse(obj.ToString(), out doubleResult)) - return doubleResult; - else - return null; - case "date": - DateTime dtResult; - if (DateTime.TryParse(obj.ToString(), out dtResult)) - return dtResult; - else - return null; - } - return null; - } - catch (Exception ex) - { - MessageBox.Show(ex.ToString()); - return null; - } - } - + public string lgdFilePath = ""; /// /// 选择管线颜色 @@ -673,32 +620,6 @@ return featDs; } - private void cmbLayer_SelectedIndexChanged(object sender, EventArgs e) //选择图层 - { - GSOLayer layer = ctl.Globe.Layers.GetLayerByCaption(selectLayerName); - GSOFeatures features = layer.GetAllFeatures(); - if (features.Length == 0) - return; - - cmbFrom.Items.Clear(); - cmbTo.Items.Clear(); - cmbRadius.Items.Clear(); - cmbID.Items.Clear(); - for (int i = 0; i < features[0].GetFieldCount(); i++) - { - GeoScene.Data.GSOFieldDefn fielddef = (GeoScene.Data.GSOFieldDefn)(features[0].GetFieldDefn(i)); - - cmbFrom.Items.Add(fielddef.Name); - cmbTo.Items.Add(fielddef.Name); - cmbRadius.Items.Add(fielddef.Name); - cmbID.Items.Add(fielddef.Name); - } - cmbFrom.SelectedItem = "Deep1"; - cmbTo.SelectedItem = "Deep2"; - cmbRadius.SelectedItem = "Diameter"; - cmbID.SelectedItem = "Handle"; - } - private void buttonXLayerPath_Click(object sender, EventArgs e)//单击 选择shp格式的文件 { OpenFileDialog dlg = new OpenFileDialog(); @@ -949,38 +870,6 @@ } //txtLayername.Text = type + layername; } - /// - /// 连接数据库 - /// - /// - /// - private void buttonX1_Click(object sender, EventArgs e) - { - if (ds == null) - { - //没连的话,直接连接审核库; //审核库配置读配置文件 - string dbIp = Utility.sgdbip; - string database = Utility.sgdbname; - string user = Utility.sgdbuser; - string pass = Utility.sgdbpwd; - - if (!Utility.isNetworkConnectionSuccess(dbIp.Trim())) - { - MessageBox.Show("网络连接失败!", "提示"); - return; - } - - ds = ctl.Globe.DataManager.OpenOracleDataSource(dbIp + "/" + database, "", "", user, pass); - if (ds == null) - { - MessageBox.Show("数据库连接失败!", "提示", MessageBoxButtons.OK, MessageBoxIcon.Warning); - } - else - { - btnCreateModel.Enabled = true; - } - } - } private void btnClose_Click(object sender, EventArgs e) { diff --git a/Forms/FrmShRK.cs b/Forms/FrmShRK.cs index 0e2e722..f1d83cb 100644 --- a/Forms/FrmShRK.cs +++ b/Forms/FrmShRK.cs @@ -215,6 +215,7 @@ { sourcefeatds = sourcefeat as GSOFeatureDataset; } + if (sourcefeatds == null) return; sourcefeatds.Open(); GSOFeatures sourcefeatures = sourcefeatds.GetAllFeatures(); @@ -251,6 +252,7 @@ { desfeatds = desfeat as GSOFeatureDataset; } + if (desfeatds == null) return; desfeatds.Open(); //向新数据集写入字段 diff --git a/Cyberpipe.csproj b/Cyberpipe.csproj index 07a8c1a..e3cd12c 100644 --- a/Cyberpipe.csproj +++ b/Cyberpipe.csproj @@ -204,25 +204,6 @@ - - Form - - - F_GKT1数据输入输出.cs - - - Form - - - F_GKT1添加文件.cs - - - Form - - - F_GKT1添加项目.cs - - Form @@ -1068,18 +1049,6 @@ Frm_password_reset.cs - - Form - - - GKT.cs - - - Form - - - GKT1.cs - Form @@ -1258,12 +1227,6 @@ F_Projedit.cs - - Form - - - PED.cs - Form @@ -1331,16 +1294,6 @@ True Reference.map - - F_GKT1数据输入输出.cs - Designer - - - F_GKT1添加文件.cs - - - F_GKT1添加项目.cs - Form_EditTask.cs @@ -1836,12 +1789,6 @@ Frm_password_reset.cs - - GKT.cs - - - GKT1.cs - F_GKT数据输入输出.cs @@ -1934,9 +1881,6 @@ F_Projedit.cs - - PED.cs - F_数据输入输出.cs diff --git a/Cyberpipe.suo b/Cyberpipe.suo index 68ced4f..a1aecf8 100644 --- a/Cyberpipe.suo +++ b/Cyberpipe.suo Binary files differ diff --git a/EMS_Forms/Form_EditTask.cs b/EMS_Forms/Form_EditTask.cs index 718992f..f1d791f 100644 --- a/EMS_Forms/Form_EditTask.cs +++ b/EMS_Forms/Form_EditTask.cs @@ -119,7 +119,8 @@ String name = Convert.ToString(dr["USERNAME"]); comboBox_userName.Items.Add(name); - } + } + dr.Close(); comboBox_road.Items.Clear(); roadList = new List(); @@ -135,7 +136,7 @@ comboBox_road.Items.Add(name); } } - + dr1.Close(); conn.Close(); bool flag2 = false; @@ -185,7 +186,7 @@ catch (Exception ex) { - MessageBox.Show(ex.ToString()); + LogHelper.WriteLog(typeof(Form_EditTask), ex.Message); } } @@ -288,7 +289,7 @@ } catch (Exception ex) { - MessageBox.Show(ex.ToString()); + LogHelper.WriteLog(typeof(Form_EditTask), ex.Message); } } @@ -474,7 +475,7 @@ } catch (Exception ex) { - MessageBox.Show(ex.ToString()); + LogHelper.WriteLog(typeof(Form_EditTask), ex.Message); } this.Close(); @@ -495,6 +496,7 @@ { numList.Add(Convert.ToInt32(dr["DBID"])); } + dr.Close(); if (numList.Count == 0) { taskNumber = Convert.ToInt32(number) * 100; @@ -674,6 +676,7 @@ } } } + dr.Close(); conn.Close(); } diff --git a/EMS_Forms/Form_EventManager.cs b/EMS_Forms/Form_EventManager.cs index b18c45b..84807b2 100644 --- a/EMS_Forms/Form_EventManager.cs +++ b/EMS_Forms/Form_EventManager.cs @@ -64,6 +64,7 @@ comboBox_name.Items.Add(name); } + dr.Close(); conn.Close(); diff --git a/Forms/FrmMnModify.cs b/Forms/FrmMnModify.cs index 31cfc5f..d036360 100644 --- a/Forms/FrmMnModify.cs +++ b/Forms/FrmMnModify.cs @@ -68,15 +68,7 @@ questionGrid.Rows[idx].Cells[1].Value = sr.question; } } - /// 选中对象 - /// - /// - /// - /// - private void buttonX1_Click(object sender, EventArgs e) - { - globecontrol.Globe.Action = EnumAction3D.SelectObject; - } + /// /// 选中某一行 /// diff --git a/Forms/FrmPipelineModelDataBase.cs b/Forms/FrmPipelineModelDataBase.cs index 2acf0ca..7ce573f 100644 --- a/Forms/FrmPipelineModelDataBase.cs +++ b/Forms/FrmPipelineModelDataBase.cs @@ -35,19 +35,7 @@ ds = _ds; InitializeComponent(); } - /// - /// 单击选择shp格式文件 - /// - /// - /// - private void btnBrowseModel_Click(object sender, EventArgs e) - { - saveFileDialog1.Filter = "*.lgd|*.lgd"; - if (saveFileDialog1.ShowDialog() == DialogResult.OK) - { - txtModelLayer.Text = saveFileDialog1.FileName; - } - } + /// /// 窗体初始化事件处理 /// @@ -100,49 +88,6 @@ } } } - - private object convertFieldValue(string fieldname, object obj) - { - if (obj == null) - return null; - - try - { - string type = fields_types[fieldname].ToString(); - switch (type) - { - case "string": - return obj.ToString(); - case "int": - //return 101; - int intResult; - if (int.TryParse(obj.ToString(), out intResult)) - return intResult; - else - return null; - case "double": - //return 202.5; - double doubleResult; - if (double.TryParse(obj.ToString(), out doubleResult)) - return doubleResult; - else - return null; - case "date": - DateTime dtResult; - if (DateTime.TryParse(obj.ToString(), out dtResult)) - return dtResult; - else - return null; - } - return null; - } - catch (Exception ex) - { - MessageBox.Show(ex.ToString()); - return null; - } - } - public string lgdFilePath = ""; /// /// 选择管线颜色 @@ -610,33 +555,6 @@ { this.Close(); } - - private void cmbLayer_SelectedIndexChanged(object sender, EventArgs e) //选择图层 - { - GSOLayer layer = ctl.Globe.Layers.GetLayerByCaption(selectLayerName); - GSOFeatures features = layer.GetAllFeatures(); - if (features.Length == 0) - return; - - cmbFrom.Items.Clear(); - cmbTo.Items.Clear(); - cmbRadius.Items.Clear(); - cmbID.Items.Clear(); - for (int i = 0; i < features[0].GetFieldCount(); i++) - { - GeoScene.Data.GSOFieldDefn fielddef = (GeoScene.Data.GSOFieldDefn)(features[0].GetFieldDefn(i)); - - cmbFrom.Items.Add(fielddef.Name); - cmbTo.Items.Add(fielddef.Name); - cmbRadius.Items.Add(fielddef.Name); - cmbID.Items.Add(fielddef.Name); - } - cmbFrom.SelectedItem = "Deep1"; - cmbTo.SelectedItem = "Deep2"; - cmbRadius.SelectedItem = "Diameter"; - cmbID.SelectedItem = "Handle"; - } - private void buttonXLayerPath_Click(object sender, EventArgs e)//单击 选择shp格式的文件 { OpenFileDialog dlg = new OpenFileDialog(); diff --git a/Forms/FrmPipelineModelDataOneStep.cs b/Forms/FrmPipelineModelDataOneStep.cs index 18afda7..ec93b8a 100644 --- a/Forms/FrmPipelineModelDataOneStep.cs +++ b/Forms/FrmPipelineModelDataOneStep.cs @@ -38,19 +38,7 @@ layerTree = _layerTree; InitializeComponent(); } - /// - /// 单击选择shp格式文件 - /// - /// - /// - private void btnBrowseModel_Click(object sender, EventArgs e) - { - saveFileDialog1.Filter = "*.lgd|*.lgd"; - if (saveFileDialog1.ShowDialog() == DialogResult.OK) - { - txtModelLayer.Text = saveFileDialog1.FileName; - } - } + /// /// 窗体初始化事件处理 /// @@ -107,48 +95,7 @@ } } - private object convertFieldValue(string fieldname, object obj) - { - if (obj == null) - return null; - - try - { - string type = fields_types[fieldname].ToString(); - switch (type) - { - case "string": - return obj.ToString(); - case "int": - //return 101; - int intResult; - if (int.TryParse(obj.ToString(), out intResult)) - return intResult; - else - return null; - case "double": - //return 202.5; - double doubleResult; - if (double.TryParse(obj.ToString(), out doubleResult)) - return doubleResult; - else - return null; - case "date": - DateTime dtResult; - if (DateTime.TryParse(obj.ToString(), out dtResult)) - return dtResult; - else - return null; - } - return null; - } - catch (Exception ex) - { - MessageBox.Show(ex.ToString()); - return null; - } - } - + public string lgdFilePath = ""; /// /// 选择管线颜色 @@ -673,32 +620,6 @@ return featDs; } - private void cmbLayer_SelectedIndexChanged(object sender, EventArgs e) //选择图层 - { - GSOLayer layer = ctl.Globe.Layers.GetLayerByCaption(selectLayerName); - GSOFeatures features = layer.GetAllFeatures(); - if (features.Length == 0) - return; - - cmbFrom.Items.Clear(); - cmbTo.Items.Clear(); - cmbRadius.Items.Clear(); - cmbID.Items.Clear(); - for (int i = 0; i < features[0].GetFieldCount(); i++) - { - GeoScene.Data.GSOFieldDefn fielddef = (GeoScene.Data.GSOFieldDefn)(features[0].GetFieldDefn(i)); - - cmbFrom.Items.Add(fielddef.Name); - cmbTo.Items.Add(fielddef.Name); - cmbRadius.Items.Add(fielddef.Name); - cmbID.Items.Add(fielddef.Name); - } - cmbFrom.SelectedItem = "Deep1"; - cmbTo.SelectedItem = "Deep2"; - cmbRadius.SelectedItem = "Diameter"; - cmbID.SelectedItem = "Handle"; - } - private void buttonXLayerPath_Click(object sender, EventArgs e)//单击 选择shp格式的文件 { OpenFileDialog dlg = new OpenFileDialog(); @@ -949,38 +870,6 @@ } //txtLayername.Text = type + layername; } - /// - /// 连接数据库 - /// - /// - /// - private void buttonX1_Click(object sender, EventArgs e) - { - if (ds == null) - { - //没连的话,直接连接审核库; //审核库配置读配置文件 - string dbIp = Utility.sgdbip; - string database = Utility.sgdbname; - string user = Utility.sgdbuser; - string pass = Utility.sgdbpwd; - - if (!Utility.isNetworkConnectionSuccess(dbIp.Trim())) - { - MessageBox.Show("网络连接失败!", "提示"); - return; - } - - ds = ctl.Globe.DataManager.OpenOracleDataSource(dbIp + "/" + database, "", "", user, pass); - if (ds == null) - { - MessageBox.Show("数据库连接失败!", "提示", MessageBoxButtons.OK, MessageBoxIcon.Warning); - } - else - { - btnCreateModel.Enabled = true; - } - } - } private void btnClose_Click(object sender, EventArgs e) { diff --git a/Forms/FrmShRK.cs b/Forms/FrmShRK.cs index 0e2e722..f1d83cb 100644 --- a/Forms/FrmShRK.cs +++ b/Forms/FrmShRK.cs @@ -215,6 +215,7 @@ { sourcefeatds = sourcefeat as GSOFeatureDataset; } + if (sourcefeatds == null) return; sourcefeatds.Open(); GSOFeatures sourcefeatures = sourcefeatds.GetAllFeatures(); @@ -251,6 +252,7 @@ { desfeatds = desfeat as GSOFeatureDataset; } + if (desfeatds == null) return; desfeatds.Open(); //向新数据集写入字段 diff --git a/FrmAccessoriesSensor.cs b/FrmAccessoriesSensor.cs index 09fcdf1..2a7a80e 100644 --- a/FrmAccessoriesSensor.cs +++ b/FrmAccessoriesSensor.cs @@ -209,7 +209,7 @@ chart1.Series[0].Points.DataBindXY(dic.Keys, dic.Values); for (int m = 0; m < dic.Values.Count; m++) { - if (chart1.Series[0].Points[m].YValues[0].ToString() != "0") + if (chart1.Series[0].Points[m]!=null&&chart1.Series[0].Points[m].YValues[0].ToString() != "0") { chart1.Series[0].Points[m].Label = chart1.Series[0].Points[m].YValues[0].ToString(); } diff --git a/Cyberpipe.csproj b/Cyberpipe.csproj index 07a8c1a..e3cd12c 100644 --- a/Cyberpipe.csproj +++ b/Cyberpipe.csproj @@ -204,25 +204,6 @@ - - Form - - - F_GKT1数据输入输出.cs - - - Form - - - F_GKT1添加文件.cs - - - Form - - - F_GKT1添加项目.cs - - Form @@ -1068,18 +1049,6 @@ Frm_password_reset.cs - - Form - - - GKT.cs - - - Form - - - GKT1.cs - Form @@ -1258,12 +1227,6 @@ F_Projedit.cs - - Form - - - PED.cs - Form @@ -1331,16 +1294,6 @@ True Reference.map - - F_GKT1数据输入输出.cs - Designer - - - F_GKT1添加文件.cs - - - F_GKT1添加项目.cs - Form_EditTask.cs @@ -1836,12 +1789,6 @@ Frm_password_reset.cs - - GKT.cs - - - GKT1.cs - F_GKT数据输入输出.cs @@ -1934,9 +1881,6 @@ F_Projedit.cs - - PED.cs - F_数据输入输出.cs diff --git a/Cyberpipe.suo b/Cyberpipe.suo index 68ced4f..a1aecf8 100644 --- a/Cyberpipe.suo +++ b/Cyberpipe.suo Binary files differ diff --git a/EMS_Forms/Form_EditTask.cs b/EMS_Forms/Form_EditTask.cs index 718992f..f1d791f 100644 --- a/EMS_Forms/Form_EditTask.cs +++ b/EMS_Forms/Form_EditTask.cs @@ -119,7 +119,8 @@ String name = Convert.ToString(dr["USERNAME"]); comboBox_userName.Items.Add(name); - } + } + dr.Close(); comboBox_road.Items.Clear(); roadList = new List(); @@ -135,7 +136,7 @@ comboBox_road.Items.Add(name); } } - + dr1.Close(); conn.Close(); bool flag2 = false; @@ -185,7 +186,7 @@ catch (Exception ex) { - MessageBox.Show(ex.ToString()); + LogHelper.WriteLog(typeof(Form_EditTask), ex.Message); } } @@ -288,7 +289,7 @@ } catch (Exception ex) { - MessageBox.Show(ex.ToString()); + LogHelper.WriteLog(typeof(Form_EditTask), ex.Message); } } @@ -474,7 +475,7 @@ } catch (Exception ex) { - MessageBox.Show(ex.ToString()); + LogHelper.WriteLog(typeof(Form_EditTask), ex.Message); } this.Close(); @@ -495,6 +496,7 @@ { numList.Add(Convert.ToInt32(dr["DBID"])); } + dr.Close(); if (numList.Count == 0) { taskNumber = Convert.ToInt32(number) * 100; @@ -674,6 +676,7 @@ } } } + dr.Close(); conn.Close(); } diff --git a/EMS_Forms/Form_EventManager.cs b/EMS_Forms/Form_EventManager.cs index b18c45b..84807b2 100644 --- a/EMS_Forms/Form_EventManager.cs +++ b/EMS_Forms/Form_EventManager.cs @@ -64,6 +64,7 @@ comboBox_name.Items.Add(name); } + dr.Close(); conn.Close(); diff --git a/Forms/FrmMnModify.cs b/Forms/FrmMnModify.cs index 31cfc5f..d036360 100644 --- a/Forms/FrmMnModify.cs +++ b/Forms/FrmMnModify.cs @@ -68,15 +68,7 @@ questionGrid.Rows[idx].Cells[1].Value = sr.question; } } - /// 选中对象 - /// - /// - /// - /// - private void buttonX1_Click(object sender, EventArgs e) - { - globecontrol.Globe.Action = EnumAction3D.SelectObject; - } + /// /// 选中某一行 /// diff --git a/Forms/FrmPipelineModelDataBase.cs b/Forms/FrmPipelineModelDataBase.cs index 2acf0ca..7ce573f 100644 --- a/Forms/FrmPipelineModelDataBase.cs +++ b/Forms/FrmPipelineModelDataBase.cs @@ -35,19 +35,7 @@ ds = _ds; InitializeComponent(); } - /// - /// 单击选择shp格式文件 - /// - /// - /// - private void btnBrowseModel_Click(object sender, EventArgs e) - { - saveFileDialog1.Filter = "*.lgd|*.lgd"; - if (saveFileDialog1.ShowDialog() == DialogResult.OK) - { - txtModelLayer.Text = saveFileDialog1.FileName; - } - } + /// /// 窗体初始化事件处理 /// @@ -100,49 +88,6 @@ } } } - - private object convertFieldValue(string fieldname, object obj) - { - if (obj == null) - return null; - - try - { - string type = fields_types[fieldname].ToString(); - switch (type) - { - case "string": - return obj.ToString(); - case "int": - //return 101; - int intResult; - if (int.TryParse(obj.ToString(), out intResult)) - return intResult; - else - return null; - case "double": - //return 202.5; - double doubleResult; - if (double.TryParse(obj.ToString(), out doubleResult)) - return doubleResult; - else - return null; - case "date": - DateTime dtResult; - if (DateTime.TryParse(obj.ToString(), out dtResult)) - return dtResult; - else - return null; - } - return null; - } - catch (Exception ex) - { - MessageBox.Show(ex.ToString()); - return null; - } - } - public string lgdFilePath = ""; /// /// 选择管线颜色 @@ -610,33 +555,6 @@ { this.Close(); } - - private void cmbLayer_SelectedIndexChanged(object sender, EventArgs e) //选择图层 - { - GSOLayer layer = ctl.Globe.Layers.GetLayerByCaption(selectLayerName); - GSOFeatures features = layer.GetAllFeatures(); - if (features.Length == 0) - return; - - cmbFrom.Items.Clear(); - cmbTo.Items.Clear(); - cmbRadius.Items.Clear(); - cmbID.Items.Clear(); - for (int i = 0; i < features[0].GetFieldCount(); i++) - { - GeoScene.Data.GSOFieldDefn fielddef = (GeoScene.Data.GSOFieldDefn)(features[0].GetFieldDefn(i)); - - cmbFrom.Items.Add(fielddef.Name); - cmbTo.Items.Add(fielddef.Name); - cmbRadius.Items.Add(fielddef.Name); - cmbID.Items.Add(fielddef.Name); - } - cmbFrom.SelectedItem = "Deep1"; - cmbTo.SelectedItem = "Deep2"; - cmbRadius.SelectedItem = "Diameter"; - cmbID.SelectedItem = "Handle"; - } - private void buttonXLayerPath_Click(object sender, EventArgs e)//单击 选择shp格式的文件 { OpenFileDialog dlg = new OpenFileDialog(); diff --git a/Forms/FrmPipelineModelDataOneStep.cs b/Forms/FrmPipelineModelDataOneStep.cs index 18afda7..ec93b8a 100644 --- a/Forms/FrmPipelineModelDataOneStep.cs +++ b/Forms/FrmPipelineModelDataOneStep.cs @@ -38,19 +38,7 @@ layerTree = _layerTree; InitializeComponent(); } - /// - /// 单击选择shp格式文件 - /// - /// - /// - private void btnBrowseModel_Click(object sender, EventArgs e) - { - saveFileDialog1.Filter = "*.lgd|*.lgd"; - if (saveFileDialog1.ShowDialog() == DialogResult.OK) - { - txtModelLayer.Text = saveFileDialog1.FileName; - } - } + /// /// 窗体初始化事件处理 /// @@ -107,48 +95,7 @@ } } - private object convertFieldValue(string fieldname, object obj) - { - if (obj == null) - return null; - - try - { - string type = fields_types[fieldname].ToString(); - switch (type) - { - case "string": - return obj.ToString(); - case "int": - //return 101; - int intResult; - if (int.TryParse(obj.ToString(), out intResult)) - return intResult; - else - return null; - case "double": - //return 202.5; - double doubleResult; - if (double.TryParse(obj.ToString(), out doubleResult)) - return doubleResult; - else - return null; - case "date": - DateTime dtResult; - if (DateTime.TryParse(obj.ToString(), out dtResult)) - return dtResult; - else - return null; - } - return null; - } - catch (Exception ex) - { - MessageBox.Show(ex.ToString()); - return null; - } - } - + public string lgdFilePath = ""; /// /// 选择管线颜色 @@ -673,32 +620,6 @@ return featDs; } - private void cmbLayer_SelectedIndexChanged(object sender, EventArgs e) //选择图层 - { - GSOLayer layer = ctl.Globe.Layers.GetLayerByCaption(selectLayerName); - GSOFeatures features = layer.GetAllFeatures(); - if (features.Length == 0) - return; - - cmbFrom.Items.Clear(); - cmbTo.Items.Clear(); - cmbRadius.Items.Clear(); - cmbID.Items.Clear(); - for (int i = 0; i < features[0].GetFieldCount(); i++) - { - GeoScene.Data.GSOFieldDefn fielddef = (GeoScene.Data.GSOFieldDefn)(features[0].GetFieldDefn(i)); - - cmbFrom.Items.Add(fielddef.Name); - cmbTo.Items.Add(fielddef.Name); - cmbRadius.Items.Add(fielddef.Name); - cmbID.Items.Add(fielddef.Name); - } - cmbFrom.SelectedItem = "Deep1"; - cmbTo.SelectedItem = "Deep2"; - cmbRadius.SelectedItem = "Diameter"; - cmbID.SelectedItem = "Handle"; - } - private void buttonXLayerPath_Click(object sender, EventArgs e)//单击 选择shp格式的文件 { OpenFileDialog dlg = new OpenFileDialog(); @@ -949,38 +870,6 @@ } //txtLayername.Text = type + layername; } - /// - /// 连接数据库 - /// - /// - /// - private void buttonX1_Click(object sender, EventArgs e) - { - if (ds == null) - { - //没连的话,直接连接审核库; //审核库配置读配置文件 - string dbIp = Utility.sgdbip; - string database = Utility.sgdbname; - string user = Utility.sgdbuser; - string pass = Utility.sgdbpwd; - - if (!Utility.isNetworkConnectionSuccess(dbIp.Trim())) - { - MessageBox.Show("网络连接失败!", "提示"); - return; - } - - ds = ctl.Globe.DataManager.OpenOracleDataSource(dbIp + "/" + database, "", "", user, pass); - if (ds == null) - { - MessageBox.Show("数据库连接失败!", "提示", MessageBoxButtons.OK, MessageBoxIcon.Warning); - } - else - { - btnCreateModel.Enabled = true; - } - } - } private void btnClose_Click(object sender, EventArgs e) { diff --git a/Forms/FrmShRK.cs b/Forms/FrmShRK.cs index 0e2e722..f1d83cb 100644 --- a/Forms/FrmShRK.cs +++ b/Forms/FrmShRK.cs @@ -215,6 +215,7 @@ { sourcefeatds = sourcefeat as GSOFeatureDataset; } + if (sourcefeatds == null) return; sourcefeatds.Open(); GSOFeatures sourcefeatures = sourcefeatds.GetAllFeatures(); @@ -251,6 +252,7 @@ { desfeatds = desfeat as GSOFeatureDataset; } + if (desfeatds == null) return; desfeatds.Open(); //向新数据集写入字段 diff --git a/FrmAccessoriesSensor.cs b/FrmAccessoriesSensor.cs index 09fcdf1..2a7a80e 100644 --- a/FrmAccessoriesSensor.cs +++ b/FrmAccessoriesSensor.cs @@ -209,7 +209,7 @@ chart1.Series[0].Points.DataBindXY(dic.Keys, dic.Values); for (int m = 0; m < dic.Values.Count; m++) { - if (chart1.Series[0].Points[m].YValues[0].ToString() != "0") + if (chart1.Series[0].Points[m]!=null&&chart1.Series[0].Points[m].YValues[0].ToString() != "0") { chart1.Series[0].Points[m].Label = chart1.Series[0].Points[m].YValues[0].ToString(); } diff --git a/FrmAccessoriesgather.cs b/FrmAccessoriesgather.cs index 9e331e1..a475d9e 100644 --- a/FrmAccessoriesgather.cs +++ b/FrmAccessoriesgather.cs @@ -338,7 +338,7 @@ chart1.Series[0].Points.DataBindXY(dic.Keys, dic.Values); for (int m = 0; m < dic.Values.Count; m++) { - if (chart1.Series[0].Points[m].YValues[0].ToString() != "0") + if (chart1.Series[0].Points[m]!=null&&chart1.Series[0].Points[m].YValues[0].ToString() != "0") { chart1.Series[0].Points[m].Label = chart1.Series[0].Points[m].YValues[0].ToString(); } diff --git a/Cyberpipe.csproj b/Cyberpipe.csproj index 07a8c1a..e3cd12c 100644 --- a/Cyberpipe.csproj +++ b/Cyberpipe.csproj @@ -204,25 +204,6 @@ - - Form - - - F_GKT1数据输入输出.cs - - - Form - - - F_GKT1添加文件.cs - - - Form - - - F_GKT1添加项目.cs - - Form @@ -1068,18 +1049,6 @@ Frm_password_reset.cs - - Form - - - GKT.cs - - - Form - - - GKT1.cs - Form @@ -1258,12 +1227,6 @@ F_Projedit.cs - - Form - - - PED.cs - Form @@ -1331,16 +1294,6 @@ True Reference.map - - F_GKT1数据输入输出.cs - Designer - - - F_GKT1添加文件.cs - - - F_GKT1添加项目.cs - Form_EditTask.cs @@ -1836,12 +1789,6 @@ Frm_password_reset.cs - - GKT.cs - - - GKT1.cs - F_GKT数据输入输出.cs @@ -1934,9 +1881,6 @@ F_Projedit.cs - - PED.cs - F_数据输入输出.cs diff --git a/Cyberpipe.suo b/Cyberpipe.suo index 68ced4f..a1aecf8 100644 --- a/Cyberpipe.suo +++ b/Cyberpipe.suo Binary files differ diff --git a/EMS_Forms/Form_EditTask.cs b/EMS_Forms/Form_EditTask.cs index 718992f..f1d791f 100644 --- a/EMS_Forms/Form_EditTask.cs +++ b/EMS_Forms/Form_EditTask.cs @@ -119,7 +119,8 @@ String name = Convert.ToString(dr["USERNAME"]); comboBox_userName.Items.Add(name); - } + } + dr.Close(); comboBox_road.Items.Clear(); roadList = new List(); @@ -135,7 +136,7 @@ comboBox_road.Items.Add(name); } } - + dr1.Close(); conn.Close(); bool flag2 = false; @@ -185,7 +186,7 @@ catch (Exception ex) { - MessageBox.Show(ex.ToString()); + LogHelper.WriteLog(typeof(Form_EditTask), ex.Message); } } @@ -288,7 +289,7 @@ } catch (Exception ex) { - MessageBox.Show(ex.ToString()); + LogHelper.WriteLog(typeof(Form_EditTask), ex.Message); } } @@ -474,7 +475,7 @@ } catch (Exception ex) { - MessageBox.Show(ex.ToString()); + LogHelper.WriteLog(typeof(Form_EditTask), ex.Message); } this.Close(); @@ -495,6 +496,7 @@ { numList.Add(Convert.ToInt32(dr["DBID"])); } + dr.Close(); if (numList.Count == 0) { taskNumber = Convert.ToInt32(number) * 100; @@ -674,6 +676,7 @@ } } } + dr.Close(); conn.Close(); } diff --git a/EMS_Forms/Form_EventManager.cs b/EMS_Forms/Form_EventManager.cs index b18c45b..84807b2 100644 --- a/EMS_Forms/Form_EventManager.cs +++ b/EMS_Forms/Form_EventManager.cs @@ -64,6 +64,7 @@ comboBox_name.Items.Add(name); } + dr.Close(); conn.Close(); diff --git a/Forms/FrmMnModify.cs b/Forms/FrmMnModify.cs index 31cfc5f..d036360 100644 --- a/Forms/FrmMnModify.cs +++ b/Forms/FrmMnModify.cs @@ -68,15 +68,7 @@ questionGrid.Rows[idx].Cells[1].Value = sr.question; } } - /// 选中对象 - /// - /// - /// - /// - private void buttonX1_Click(object sender, EventArgs e) - { - globecontrol.Globe.Action = EnumAction3D.SelectObject; - } + /// /// 选中某一行 /// diff --git a/Forms/FrmPipelineModelDataBase.cs b/Forms/FrmPipelineModelDataBase.cs index 2acf0ca..7ce573f 100644 --- a/Forms/FrmPipelineModelDataBase.cs +++ b/Forms/FrmPipelineModelDataBase.cs @@ -35,19 +35,7 @@ ds = _ds; InitializeComponent(); } - /// - /// 单击选择shp格式文件 - /// - /// - /// - private void btnBrowseModel_Click(object sender, EventArgs e) - { - saveFileDialog1.Filter = "*.lgd|*.lgd"; - if (saveFileDialog1.ShowDialog() == DialogResult.OK) - { - txtModelLayer.Text = saveFileDialog1.FileName; - } - } + /// /// 窗体初始化事件处理 /// @@ -100,49 +88,6 @@ } } } - - private object convertFieldValue(string fieldname, object obj) - { - if (obj == null) - return null; - - try - { - string type = fields_types[fieldname].ToString(); - switch (type) - { - case "string": - return obj.ToString(); - case "int": - //return 101; - int intResult; - if (int.TryParse(obj.ToString(), out intResult)) - return intResult; - else - return null; - case "double": - //return 202.5; - double doubleResult; - if (double.TryParse(obj.ToString(), out doubleResult)) - return doubleResult; - else - return null; - case "date": - DateTime dtResult; - if (DateTime.TryParse(obj.ToString(), out dtResult)) - return dtResult; - else - return null; - } - return null; - } - catch (Exception ex) - { - MessageBox.Show(ex.ToString()); - return null; - } - } - public string lgdFilePath = ""; /// /// 选择管线颜色 @@ -610,33 +555,6 @@ { this.Close(); } - - private void cmbLayer_SelectedIndexChanged(object sender, EventArgs e) //选择图层 - { - GSOLayer layer = ctl.Globe.Layers.GetLayerByCaption(selectLayerName); - GSOFeatures features = layer.GetAllFeatures(); - if (features.Length == 0) - return; - - cmbFrom.Items.Clear(); - cmbTo.Items.Clear(); - cmbRadius.Items.Clear(); - cmbID.Items.Clear(); - for (int i = 0; i < features[0].GetFieldCount(); i++) - { - GeoScene.Data.GSOFieldDefn fielddef = (GeoScene.Data.GSOFieldDefn)(features[0].GetFieldDefn(i)); - - cmbFrom.Items.Add(fielddef.Name); - cmbTo.Items.Add(fielddef.Name); - cmbRadius.Items.Add(fielddef.Name); - cmbID.Items.Add(fielddef.Name); - } - cmbFrom.SelectedItem = "Deep1"; - cmbTo.SelectedItem = "Deep2"; - cmbRadius.SelectedItem = "Diameter"; - cmbID.SelectedItem = "Handle"; - } - private void buttonXLayerPath_Click(object sender, EventArgs e)//单击 选择shp格式的文件 { OpenFileDialog dlg = new OpenFileDialog(); diff --git a/Forms/FrmPipelineModelDataOneStep.cs b/Forms/FrmPipelineModelDataOneStep.cs index 18afda7..ec93b8a 100644 --- a/Forms/FrmPipelineModelDataOneStep.cs +++ b/Forms/FrmPipelineModelDataOneStep.cs @@ -38,19 +38,7 @@ layerTree = _layerTree; InitializeComponent(); } - /// - /// 单击选择shp格式文件 - /// - /// - /// - private void btnBrowseModel_Click(object sender, EventArgs e) - { - saveFileDialog1.Filter = "*.lgd|*.lgd"; - if (saveFileDialog1.ShowDialog() == DialogResult.OK) - { - txtModelLayer.Text = saveFileDialog1.FileName; - } - } + /// /// 窗体初始化事件处理 /// @@ -107,48 +95,7 @@ } } - private object convertFieldValue(string fieldname, object obj) - { - if (obj == null) - return null; - - try - { - string type = fields_types[fieldname].ToString(); - switch (type) - { - case "string": - return obj.ToString(); - case "int": - //return 101; - int intResult; - if (int.TryParse(obj.ToString(), out intResult)) - return intResult; - else - return null; - case "double": - //return 202.5; - double doubleResult; - if (double.TryParse(obj.ToString(), out doubleResult)) - return doubleResult; - else - return null; - case "date": - DateTime dtResult; - if (DateTime.TryParse(obj.ToString(), out dtResult)) - return dtResult; - else - return null; - } - return null; - } - catch (Exception ex) - { - MessageBox.Show(ex.ToString()); - return null; - } - } - + public string lgdFilePath = ""; /// /// 选择管线颜色 @@ -673,32 +620,6 @@ return featDs; } - private void cmbLayer_SelectedIndexChanged(object sender, EventArgs e) //选择图层 - { - GSOLayer layer = ctl.Globe.Layers.GetLayerByCaption(selectLayerName); - GSOFeatures features = layer.GetAllFeatures(); - if (features.Length == 0) - return; - - cmbFrom.Items.Clear(); - cmbTo.Items.Clear(); - cmbRadius.Items.Clear(); - cmbID.Items.Clear(); - for (int i = 0; i < features[0].GetFieldCount(); i++) - { - GeoScene.Data.GSOFieldDefn fielddef = (GeoScene.Data.GSOFieldDefn)(features[0].GetFieldDefn(i)); - - cmbFrom.Items.Add(fielddef.Name); - cmbTo.Items.Add(fielddef.Name); - cmbRadius.Items.Add(fielddef.Name); - cmbID.Items.Add(fielddef.Name); - } - cmbFrom.SelectedItem = "Deep1"; - cmbTo.SelectedItem = "Deep2"; - cmbRadius.SelectedItem = "Diameter"; - cmbID.SelectedItem = "Handle"; - } - private void buttonXLayerPath_Click(object sender, EventArgs e)//单击 选择shp格式的文件 { OpenFileDialog dlg = new OpenFileDialog(); @@ -949,38 +870,6 @@ } //txtLayername.Text = type + layername; } - /// - /// 连接数据库 - /// - /// - /// - private void buttonX1_Click(object sender, EventArgs e) - { - if (ds == null) - { - //没连的话,直接连接审核库; //审核库配置读配置文件 - string dbIp = Utility.sgdbip; - string database = Utility.sgdbname; - string user = Utility.sgdbuser; - string pass = Utility.sgdbpwd; - - if (!Utility.isNetworkConnectionSuccess(dbIp.Trim())) - { - MessageBox.Show("网络连接失败!", "提示"); - return; - } - - ds = ctl.Globe.DataManager.OpenOracleDataSource(dbIp + "/" + database, "", "", user, pass); - if (ds == null) - { - MessageBox.Show("数据库连接失败!", "提示", MessageBoxButtons.OK, MessageBoxIcon.Warning); - } - else - { - btnCreateModel.Enabled = true; - } - } - } private void btnClose_Click(object sender, EventArgs e) { diff --git a/Forms/FrmShRK.cs b/Forms/FrmShRK.cs index 0e2e722..f1d83cb 100644 --- a/Forms/FrmShRK.cs +++ b/Forms/FrmShRK.cs @@ -215,6 +215,7 @@ { sourcefeatds = sourcefeat as GSOFeatureDataset; } + if (sourcefeatds == null) return; sourcefeatds.Open(); GSOFeatures sourcefeatures = sourcefeatds.GetAllFeatures(); @@ -251,6 +252,7 @@ { desfeatds = desfeat as GSOFeatureDataset; } + if (desfeatds == null) return; desfeatds.Open(); //向新数据集写入字段 diff --git a/FrmAccessoriesSensor.cs b/FrmAccessoriesSensor.cs index 09fcdf1..2a7a80e 100644 --- a/FrmAccessoriesSensor.cs +++ b/FrmAccessoriesSensor.cs @@ -209,7 +209,7 @@ chart1.Series[0].Points.DataBindXY(dic.Keys, dic.Values); for (int m = 0; m < dic.Values.Count; m++) { - if (chart1.Series[0].Points[m].YValues[0].ToString() != "0") + if (chart1.Series[0].Points[m]!=null&&chart1.Series[0].Points[m].YValues[0].ToString() != "0") { chart1.Series[0].Points[m].Label = chart1.Series[0].Points[m].YValues[0].ToString(); } diff --git a/FrmAccessoriesgather.cs b/FrmAccessoriesgather.cs index 9e331e1..a475d9e 100644 --- a/FrmAccessoriesgather.cs +++ b/FrmAccessoriesgather.cs @@ -338,7 +338,7 @@ chart1.Series[0].Points.DataBindXY(dic.Keys, dic.Values); for (int m = 0; m < dic.Values.Count; m++) { - if (chart1.Series[0].Points[m].YValues[0].ToString() != "0") + if (chart1.Series[0].Points[m]!=null&&chart1.Series[0].Points[m].YValues[0].ToString() != "0") { chart1.Series[0].Points[m].Label = chart1.Series[0].Points[m].YValues[0].ToString(); } diff --git a/FrmAccessoryAnalysis.cs b/FrmAccessoryAnalysis.cs index 71d4579..44d4065 100644 --- a/FrmAccessoryAnalysis.cs +++ b/FrmAccessoryAnalysis.cs @@ -66,39 +66,6 @@ globeControl1.Refresh(); } /// - /// 键盘按键按下事件处理 - /// - /// - /// - private void txtRadius_KeyPress(object sender, KeyPressEventArgs e) - { - TextBox text = sender as TextBox; - if ((e.KeyChar < 48 || e.KeyChar > 57) && (e.KeyChar != 8) && (int)e.KeyChar != 46) - { - e.Handled = true; - } - if ((int)e.KeyChar == 46) //小数点 - { - if (text.Text.Length <= 0) - e.Handled = true; //小数点不能在第一位 - else //处理不规则的小数点 - { - float f; - float oldf; - bool b1 = false, b2 = false; - b1 = float.TryParse(text.Text, out oldf); - b2 = float.TryParse(text.Text + e.KeyChar.ToString(), out f); - if (b2 == false) - { - if (b1 == true) - e.Handled = true; - else - e.Handled = false; - } - } - } - } - /// /// 确定按钮事件处理 /// /// diff --git a/Cyberpipe.csproj b/Cyberpipe.csproj index 07a8c1a..e3cd12c 100644 --- a/Cyberpipe.csproj +++ b/Cyberpipe.csproj @@ -204,25 +204,6 @@ - - Form - - - F_GKT1数据输入输出.cs - - - Form - - - F_GKT1添加文件.cs - - - Form - - - F_GKT1添加项目.cs - - Form @@ -1068,18 +1049,6 @@ Frm_password_reset.cs - - Form - - - GKT.cs - - - Form - - - GKT1.cs - Form @@ -1258,12 +1227,6 @@ F_Projedit.cs - - Form - - - PED.cs - Form @@ -1331,16 +1294,6 @@ True Reference.map - - F_GKT1数据输入输出.cs - Designer - - - F_GKT1添加文件.cs - - - F_GKT1添加项目.cs - Form_EditTask.cs @@ -1836,12 +1789,6 @@ Frm_password_reset.cs - - GKT.cs - - - GKT1.cs - F_GKT数据输入输出.cs @@ -1934,9 +1881,6 @@ F_Projedit.cs - - PED.cs - F_数据输入输出.cs diff --git a/Cyberpipe.suo b/Cyberpipe.suo index 68ced4f..a1aecf8 100644 --- a/Cyberpipe.suo +++ b/Cyberpipe.suo Binary files differ diff --git a/EMS_Forms/Form_EditTask.cs b/EMS_Forms/Form_EditTask.cs index 718992f..f1d791f 100644 --- a/EMS_Forms/Form_EditTask.cs +++ b/EMS_Forms/Form_EditTask.cs @@ -119,7 +119,8 @@ String name = Convert.ToString(dr["USERNAME"]); comboBox_userName.Items.Add(name); - } + } + dr.Close(); comboBox_road.Items.Clear(); roadList = new List(); @@ -135,7 +136,7 @@ comboBox_road.Items.Add(name); } } - + dr1.Close(); conn.Close(); bool flag2 = false; @@ -185,7 +186,7 @@ catch (Exception ex) { - MessageBox.Show(ex.ToString()); + LogHelper.WriteLog(typeof(Form_EditTask), ex.Message); } } @@ -288,7 +289,7 @@ } catch (Exception ex) { - MessageBox.Show(ex.ToString()); + LogHelper.WriteLog(typeof(Form_EditTask), ex.Message); } } @@ -474,7 +475,7 @@ } catch (Exception ex) { - MessageBox.Show(ex.ToString()); + LogHelper.WriteLog(typeof(Form_EditTask), ex.Message); } this.Close(); @@ -495,6 +496,7 @@ { numList.Add(Convert.ToInt32(dr["DBID"])); } + dr.Close(); if (numList.Count == 0) { taskNumber = Convert.ToInt32(number) * 100; @@ -674,6 +676,7 @@ } } } + dr.Close(); conn.Close(); } diff --git a/EMS_Forms/Form_EventManager.cs b/EMS_Forms/Form_EventManager.cs index b18c45b..84807b2 100644 --- a/EMS_Forms/Form_EventManager.cs +++ b/EMS_Forms/Form_EventManager.cs @@ -64,6 +64,7 @@ comboBox_name.Items.Add(name); } + dr.Close(); conn.Close(); diff --git a/Forms/FrmMnModify.cs b/Forms/FrmMnModify.cs index 31cfc5f..d036360 100644 --- a/Forms/FrmMnModify.cs +++ b/Forms/FrmMnModify.cs @@ -68,15 +68,7 @@ questionGrid.Rows[idx].Cells[1].Value = sr.question; } } - /// 选中对象 - /// - /// - /// - /// - private void buttonX1_Click(object sender, EventArgs e) - { - globecontrol.Globe.Action = EnumAction3D.SelectObject; - } + /// /// 选中某一行 /// diff --git a/Forms/FrmPipelineModelDataBase.cs b/Forms/FrmPipelineModelDataBase.cs index 2acf0ca..7ce573f 100644 --- a/Forms/FrmPipelineModelDataBase.cs +++ b/Forms/FrmPipelineModelDataBase.cs @@ -35,19 +35,7 @@ ds = _ds; InitializeComponent(); } - /// - /// 单击选择shp格式文件 - /// - /// - /// - private void btnBrowseModel_Click(object sender, EventArgs e) - { - saveFileDialog1.Filter = "*.lgd|*.lgd"; - if (saveFileDialog1.ShowDialog() == DialogResult.OK) - { - txtModelLayer.Text = saveFileDialog1.FileName; - } - } + /// /// 窗体初始化事件处理 /// @@ -100,49 +88,6 @@ } } } - - private object convertFieldValue(string fieldname, object obj) - { - if (obj == null) - return null; - - try - { - string type = fields_types[fieldname].ToString(); - switch (type) - { - case "string": - return obj.ToString(); - case "int": - //return 101; - int intResult; - if (int.TryParse(obj.ToString(), out intResult)) - return intResult; - else - return null; - case "double": - //return 202.5; - double doubleResult; - if (double.TryParse(obj.ToString(), out doubleResult)) - return doubleResult; - else - return null; - case "date": - DateTime dtResult; - if (DateTime.TryParse(obj.ToString(), out dtResult)) - return dtResult; - else - return null; - } - return null; - } - catch (Exception ex) - { - MessageBox.Show(ex.ToString()); - return null; - } - } - public string lgdFilePath = ""; /// /// 选择管线颜色 @@ -610,33 +555,6 @@ { this.Close(); } - - private void cmbLayer_SelectedIndexChanged(object sender, EventArgs e) //选择图层 - { - GSOLayer layer = ctl.Globe.Layers.GetLayerByCaption(selectLayerName); - GSOFeatures features = layer.GetAllFeatures(); - if (features.Length == 0) - return; - - cmbFrom.Items.Clear(); - cmbTo.Items.Clear(); - cmbRadius.Items.Clear(); - cmbID.Items.Clear(); - for (int i = 0; i < features[0].GetFieldCount(); i++) - { - GeoScene.Data.GSOFieldDefn fielddef = (GeoScene.Data.GSOFieldDefn)(features[0].GetFieldDefn(i)); - - cmbFrom.Items.Add(fielddef.Name); - cmbTo.Items.Add(fielddef.Name); - cmbRadius.Items.Add(fielddef.Name); - cmbID.Items.Add(fielddef.Name); - } - cmbFrom.SelectedItem = "Deep1"; - cmbTo.SelectedItem = "Deep2"; - cmbRadius.SelectedItem = "Diameter"; - cmbID.SelectedItem = "Handle"; - } - private void buttonXLayerPath_Click(object sender, EventArgs e)//单击 选择shp格式的文件 { OpenFileDialog dlg = new OpenFileDialog(); diff --git a/Forms/FrmPipelineModelDataOneStep.cs b/Forms/FrmPipelineModelDataOneStep.cs index 18afda7..ec93b8a 100644 --- a/Forms/FrmPipelineModelDataOneStep.cs +++ b/Forms/FrmPipelineModelDataOneStep.cs @@ -38,19 +38,7 @@ layerTree = _layerTree; InitializeComponent(); } - /// - /// 单击选择shp格式文件 - /// - /// - /// - private void btnBrowseModel_Click(object sender, EventArgs e) - { - saveFileDialog1.Filter = "*.lgd|*.lgd"; - if (saveFileDialog1.ShowDialog() == DialogResult.OK) - { - txtModelLayer.Text = saveFileDialog1.FileName; - } - } + /// /// 窗体初始化事件处理 /// @@ -107,48 +95,7 @@ } } - private object convertFieldValue(string fieldname, object obj) - { - if (obj == null) - return null; - - try - { - string type = fields_types[fieldname].ToString(); - switch (type) - { - case "string": - return obj.ToString(); - case "int": - //return 101; - int intResult; - if (int.TryParse(obj.ToString(), out intResult)) - return intResult; - else - return null; - case "double": - //return 202.5; - double doubleResult; - if (double.TryParse(obj.ToString(), out doubleResult)) - return doubleResult; - else - return null; - case "date": - DateTime dtResult; - if (DateTime.TryParse(obj.ToString(), out dtResult)) - return dtResult; - else - return null; - } - return null; - } - catch (Exception ex) - { - MessageBox.Show(ex.ToString()); - return null; - } - } - + public string lgdFilePath = ""; /// /// 选择管线颜色 @@ -673,32 +620,6 @@ return featDs; } - private void cmbLayer_SelectedIndexChanged(object sender, EventArgs e) //选择图层 - { - GSOLayer layer = ctl.Globe.Layers.GetLayerByCaption(selectLayerName); - GSOFeatures features = layer.GetAllFeatures(); - if (features.Length == 0) - return; - - cmbFrom.Items.Clear(); - cmbTo.Items.Clear(); - cmbRadius.Items.Clear(); - cmbID.Items.Clear(); - for (int i = 0; i < features[0].GetFieldCount(); i++) - { - GeoScene.Data.GSOFieldDefn fielddef = (GeoScene.Data.GSOFieldDefn)(features[0].GetFieldDefn(i)); - - cmbFrom.Items.Add(fielddef.Name); - cmbTo.Items.Add(fielddef.Name); - cmbRadius.Items.Add(fielddef.Name); - cmbID.Items.Add(fielddef.Name); - } - cmbFrom.SelectedItem = "Deep1"; - cmbTo.SelectedItem = "Deep2"; - cmbRadius.SelectedItem = "Diameter"; - cmbID.SelectedItem = "Handle"; - } - private void buttonXLayerPath_Click(object sender, EventArgs e)//单击 选择shp格式的文件 { OpenFileDialog dlg = new OpenFileDialog(); @@ -949,38 +870,6 @@ } //txtLayername.Text = type + layername; } - /// - /// 连接数据库 - /// - /// - /// - private void buttonX1_Click(object sender, EventArgs e) - { - if (ds == null) - { - //没连的话,直接连接审核库; //审核库配置读配置文件 - string dbIp = Utility.sgdbip; - string database = Utility.sgdbname; - string user = Utility.sgdbuser; - string pass = Utility.sgdbpwd; - - if (!Utility.isNetworkConnectionSuccess(dbIp.Trim())) - { - MessageBox.Show("网络连接失败!", "提示"); - return; - } - - ds = ctl.Globe.DataManager.OpenOracleDataSource(dbIp + "/" + database, "", "", user, pass); - if (ds == null) - { - MessageBox.Show("数据库连接失败!", "提示", MessageBoxButtons.OK, MessageBoxIcon.Warning); - } - else - { - btnCreateModel.Enabled = true; - } - } - } private void btnClose_Click(object sender, EventArgs e) { diff --git a/Forms/FrmShRK.cs b/Forms/FrmShRK.cs index 0e2e722..f1d83cb 100644 --- a/Forms/FrmShRK.cs +++ b/Forms/FrmShRK.cs @@ -215,6 +215,7 @@ { sourcefeatds = sourcefeat as GSOFeatureDataset; } + if (sourcefeatds == null) return; sourcefeatds.Open(); GSOFeatures sourcefeatures = sourcefeatds.GetAllFeatures(); @@ -251,6 +252,7 @@ { desfeatds = desfeat as GSOFeatureDataset; } + if (desfeatds == null) return; desfeatds.Open(); //向新数据集写入字段 diff --git a/FrmAccessoriesSensor.cs b/FrmAccessoriesSensor.cs index 09fcdf1..2a7a80e 100644 --- a/FrmAccessoriesSensor.cs +++ b/FrmAccessoriesSensor.cs @@ -209,7 +209,7 @@ chart1.Series[0].Points.DataBindXY(dic.Keys, dic.Values); for (int m = 0; m < dic.Values.Count; m++) { - if (chart1.Series[0].Points[m].YValues[0].ToString() != "0") + if (chart1.Series[0].Points[m]!=null&&chart1.Series[0].Points[m].YValues[0].ToString() != "0") { chart1.Series[0].Points[m].Label = chart1.Series[0].Points[m].YValues[0].ToString(); } diff --git a/FrmAccessoriesgather.cs b/FrmAccessoriesgather.cs index 9e331e1..a475d9e 100644 --- a/FrmAccessoriesgather.cs +++ b/FrmAccessoriesgather.cs @@ -338,7 +338,7 @@ chart1.Series[0].Points.DataBindXY(dic.Keys, dic.Values); for (int m = 0; m < dic.Values.Count; m++) { - if (chart1.Series[0].Points[m].YValues[0].ToString() != "0") + if (chart1.Series[0].Points[m]!=null&&chart1.Series[0].Points[m].YValues[0].ToString() != "0") { chart1.Series[0].Points[m].Label = chart1.Series[0].Points[m].YValues[0].ToString(); } diff --git a/FrmAccessoryAnalysis.cs b/FrmAccessoryAnalysis.cs index 71d4579..44d4065 100644 --- a/FrmAccessoryAnalysis.cs +++ b/FrmAccessoryAnalysis.cs @@ -66,39 +66,6 @@ globeControl1.Refresh(); } /// - /// 键盘按键按下事件处理 - /// - /// - /// - private void txtRadius_KeyPress(object sender, KeyPressEventArgs e) - { - TextBox text = sender as TextBox; - if ((e.KeyChar < 48 || e.KeyChar > 57) && (e.KeyChar != 8) && (int)e.KeyChar != 46) - { - e.Handled = true; - } - if ((int)e.KeyChar == 46) //小数点 - { - if (text.Text.Length <= 0) - e.Handled = true; //小数点不能在第一位 - else //处理不规则的小数点 - { - float f; - float oldf; - bool b1 = false, b2 = false; - b1 = float.TryParse(text.Text, out oldf); - b2 = float.TryParse(text.Text + e.KeyChar.ToString(), out f); - if (b2 == false) - { - if (b1 == true) - e.Handled = true; - else - e.Handled = false; - } - } - } - } - /// /// 确定按钮事件处理 /// /// diff --git a/FrmAddValve.cs b/FrmAddValve.cs index 34d2fec..5f405b9 100644 --- a/FrmAddValve.cs +++ b/FrmAddValve.cs @@ -486,56 +486,6 @@ } } - - - - - - - - private void cmbLayer_SelectedIndexChanged(object sender, EventArgs e) - { - GSOLayer layer = globeControl1.Globe.Layers.GetLayerByCaption(selectLayerName); - GSOFeatures features = layer.GetAllFeatures(); - if (features.Length == 0) - return; - - combPath.Items.Clear(); - combZ.Items.Clear(); - combModelName.Items.Clear(); - - for (int i = 0; i < features[0].GetFieldCount(); i++) - { - GeoScene.Data.GSOFieldDefn fielddef = (GeoScene.Data.GSOFieldDefn)(features[0].GetFieldDefn(i)); - combPath.Items.Add(fielddef.Name); - combZ.Items.Add(fielddef.Name); - combModelName.Items.Add(fielddef.Name); - } - combModelName.SelectedItem = "编号"; - combPath.SelectedItem = "模型路径"; - if (combfile.SelectedIndex != -1) - { - - string layerCaption = combfile.SelectedItem.ToString().Trim(); - rukuLayer = globeControl1.Globe.Layers.GetLayerByCaption(layerCaption); - if (rukuLayer != null) - { - combPath.Items.Clear(); - combZ.Items.Clear(); - combModelName.Items.Clear(); - - } - for (int i = 0; i < features[0].GetFieldCount(); i++) - { - GeoScene.Data.GSOFieldDefn fielddef = (GeoScene.Data.GSOFieldDefn)(features[0].GetFieldDefn(i)); - combPath.Items.Add(fielddef.Name); - combZ.Items.Add(fielddef.Name); - combModelName.Items.Add(fielddef.Name); - } - combModelName.SelectedItem = "编号"; - combPath.SelectedItem = "模型路径"; - } - } /// /// 单击选择shp格式文件 /// diff --git a/Cyberpipe.csproj b/Cyberpipe.csproj index 07a8c1a..e3cd12c 100644 --- a/Cyberpipe.csproj +++ b/Cyberpipe.csproj @@ -204,25 +204,6 @@ - - Form - - - F_GKT1数据输入输出.cs - - - Form - - - F_GKT1添加文件.cs - - - Form - - - F_GKT1添加项目.cs - - Form @@ -1068,18 +1049,6 @@ Frm_password_reset.cs - - Form - - - GKT.cs - - - Form - - - GKT1.cs - Form @@ -1258,12 +1227,6 @@ F_Projedit.cs - - Form - - - PED.cs - Form @@ -1331,16 +1294,6 @@ True Reference.map - - F_GKT1数据输入输出.cs - Designer - - - F_GKT1添加文件.cs - - - F_GKT1添加项目.cs - Form_EditTask.cs @@ -1836,12 +1789,6 @@ Frm_password_reset.cs - - GKT.cs - - - GKT1.cs - F_GKT数据输入输出.cs @@ -1934,9 +1881,6 @@ F_Projedit.cs - - PED.cs - F_数据输入输出.cs diff --git a/Cyberpipe.suo b/Cyberpipe.suo index 68ced4f..a1aecf8 100644 --- a/Cyberpipe.suo +++ b/Cyberpipe.suo Binary files differ diff --git a/EMS_Forms/Form_EditTask.cs b/EMS_Forms/Form_EditTask.cs index 718992f..f1d791f 100644 --- a/EMS_Forms/Form_EditTask.cs +++ b/EMS_Forms/Form_EditTask.cs @@ -119,7 +119,8 @@ String name = Convert.ToString(dr["USERNAME"]); comboBox_userName.Items.Add(name); - } + } + dr.Close(); comboBox_road.Items.Clear(); roadList = new List(); @@ -135,7 +136,7 @@ comboBox_road.Items.Add(name); } } - + dr1.Close(); conn.Close(); bool flag2 = false; @@ -185,7 +186,7 @@ catch (Exception ex) { - MessageBox.Show(ex.ToString()); + LogHelper.WriteLog(typeof(Form_EditTask), ex.Message); } } @@ -288,7 +289,7 @@ } catch (Exception ex) { - MessageBox.Show(ex.ToString()); + LogHelper.WriteLog(typeof(Form_EditTask), ex.Message); } } @@ -474,7 +475,7 @@ } catch (Exception ex) { - MessageBox.Show(ex.ToString()); + LogHelper.WriteLog(typeof(Form_EditTask), ex.Message); } this.Close(); @@ -495,6 +496,7 @@ { numList.Add(Convert.ToInt32(dr["DBID"])); } + dr.Close(); if (numList.Count == 0) { taskNumber = Convert.ToInt32(number) * 100; @@ -674,6 +676,7 @@ } } } + dr.Close(); conn.Close(); } diff --git a/EMS_Forms/Form_EventManager.cs b/EMS_Forms/Form_EventManager.cs index b18c45b..84807b2 100644 --- a/EMS_Forms/Form_EventManager.cs +++ b/EMS_Forms/Form_EventManager.cs @@ -64,6 +64,7 @@ comboBox_name.Items.Add(name); } + dr.Close(); conn.Close(); diff --git a/Forms/FrmMnModify.cs b/Forms/FrmMnModify.cs index 31cfc5f..d036360 100644 --- a/Forms/FrmMnModify.cs +++ b/Forms/FrmMnModify.cs @@ -68,15 +68,7 @@ questionGrid.Rows[idx].Cells[1].Value = sr.question; } } - /// 选中对象 - /// - /// - /// - /// - private void buttonX1_Click(object sender, EventArgs e) - { - globecontrol.Globe.Action = EnumAction3D.SelectObject; - } + /// /// 选中某一行 /// diff --git a/Forms/FrmPipelineModelDataBase.cs b/Forms/FrmPipelineModelDataBase.cs index 2acf0ca..7ce573f 100644 --- a/Forms/FrmPipelineModelDataBase.cs +++ b/Forms/FrmPipelineModelDataBase.cs @@ -35,19 +35,7 @@ ds = _ds; InitializeComponent(); } - /// - /// 单击选择shp格式文件 - /// - /// - /// - private void btnBrowseModel_Click(object sender, EventArgs e) - { - saveFileDialog1.Filter = "*.lgd|*.lgd"; - if (saveFileDialog1.ShowDialog() == DialogResult.OK) - { - txtModelLayer.Text = saveFileDialog1.FileName; - } - } + /// /// 窗体初始化事件处理 /// @@ -100,49 +88,6 @@ } } } - - private object convertFieldValue(string fieldname, object obj) - { - if (obj == null) - return null; - - try - { - string type = fields_types[fieldname].ToString(); - switch (type) - { - case "string": - return obj.ToString(); - case "int": - //return 101; - int intResult; - if (int.TryParse(obj.ToString(), out intResult)) - return intResult; - else - return null; - case "double": - //return 202.5; - double doubleResult; - if (double.TryParse(obj.ToString(), out doubleResult)) - return doubleResult; - else - return null; - case "date": - DateTime dtResult; - if (DateTime.TryParse(obj.ToString(), out dtResult)) - return dtResult; - else - return null; - } - return null; - } - catch (Exception ex) - { - MessageBox.Show(ex.ToString()); - return null; - } - } - public string lgdFilePath = ""; /// /// 选择管线颜色 @@ -610,33 +555,6 @@ { this.Close(); } - - private void cmbLayer_SelectedIndexChanged(object sender, EventArgs e) //选择图层 - { - GSOLayer layer = ctl.Globe.Layers.GetLayerByCaption(selectLayerName); - GSOFeatures features = layer.GetAllFeatures(); - if (features.Length == 0) - return; - - cmbFrom.Items.Clear(); - cmbTo.Items.Clear(); - cmbRadius.Items.Clear(); - cmbID.Items.Clear(); - for (int i = 0; i < features[0].GetFieldCount(); i++) - { - GeoScene.Data.GSOFieldDefn fielddef = (GeoScene.Data.GSOFieldDefn)(features[0].GetFieldDefn(i)); - - cmbFrom.Items.Add(fielddef.Name); - cmbTo.Items.Add(fielddef.Name); - cmbRadius.Items.Add(fielddef.Name); - cmbID.Items.Add(fielddef.Name); - } - cmbFrom.SelectedItem = "Deep1"; - cmbTo.SelectedItem = "Deep2"; - cmbRadius.SelectedItem = "Diameter"; - cmbID.SelectedItem = "Handle"; - } - private void buttonXLayerPath_Click(object sender, EventArgs e)//单击 选择shp格式的文件 { OpenFileDialog dlg = new OpenFileDialog(); diff --git a/Forms/FrmPipelineModelDataOneStep.cs b/Forms/FrmPipelineModelDataOneStep.cs index 18afda7..ec93b8a 100644 --- a/Forms/FrmPipelineModelDataOneStep.cs +++ b/Forms/FrmPipelineModelDataOneStep.cs @@ -38,19 +38,7 @@ layerTree = _layerTree; InitializeComponent(); } - /// - /// 单击选择shp格式文件 - /// - /// - /// - private void btnBrowseModel_Click(object sender, EventArgs e) - { - saveFileDialog1.Filter = "*.lgd|*.lgd"; - if (saveFileDialog1.ShowDialog() == DialogResult.OK) - { - txtModelLayer.Text = saveFileDialog1.FileName; - } - } + /// /// 窗体初始化事件处理 /// @@ -107,48 +95,7 @@ } } - private object convertFieldValue(string fieldname, object obj) - { - if (obj == null) - return null; - - try - { - string type = fields_types[fieldname].ToString(); - switch (type) - { - case "string": - return obj.ToString(); - case "int": - //return 101; - int intResult; - if (int.TryParse(obj.ToString(), out intResult)) - return intResult; - else - return null; - case "double": - //return 202.5; - double doubleResult; - if (double.TryParse(obj.ToString(), out doubleResult)) - return doubleResult; - else - return null; - case "date": - DateTime dtResult; - if (DateTime.TryParse(obj.ToString(), out dtResult)) - return dtResult; - else - return null; - } - return null; - } - catch (Exception ex) - { - MessageBox.Show(ex.ToString()); - return null; - } - } - + public string lgdFilePath = ""; /// /// 选择管线颜色 @@ -673,32 +620,6 @@ return featDs; } - private void cmbLayer_SelectedIndexChanged(object sender, EventArgs e) //选择图层 - { - GSOLayer layer = ctl.Globe.Layers.GetLayerByCaption(selectLayerName); - GSOFeatures features = layer.GetAllFeatures(); - if (features.Length == 0) - return; - - cmbFrom.Items.Clear(); - cmbTo.Items.Clear(); - cmbRadius.Items.Clear(); - cmbID.Items.Clear(); - for (int i = 0; i < features[0].GetFieldCount(); i++) - { - GeoScene.Data.GSOFieldDefn fielddef = (GeoScene.Data.GSOFieldDefn)(features[0].GetFieldDefn(i)); - - cmbFrom.Items.Add(fielddef.Name); - cmbTo.Items.Add(fielddef.Name); - cmbRadius.Items.Add(fielddef.Name); - cmbID.Items.Add(fielddef.Name); - } - cmbFrom.SelectedItem = "Deep1"; - cmbTo.SelectedItem = "Deep2"; - cmbRadius.SelectedItem = "Diameter"; - cmbID.SelectedItem = "Handle"; - } - private void buttonXLayerPath_Click(object sender, EventArgs e)//单击 选择shp格式的文件 { OpenFileDialog dlg = new OpenFileDialog(); @@ -949,38 +870,6 @@ } //txtLayername.Text = type + layername; } - /// - /// 连接数据库 - /// - /// - /// - private void buttonX1_Click(object sender, EventArgs e) - { - if (ds == null) - { - //没连的话,直接连接审核库; //审核库配置读配置文件 - string dbIp = Utility.sgdbip; - string database = Utility.sgdbname; - string user = Utility.sgdbuser; - string pass = Utility.sgdbpwd; - - if (!Utility.isNetworkConnectionSuccess(dbIp.Trim())) - { - MessageBox.Show("网络连接失败!", "提示"); - return; - } - - ds = ctl.Globe.DataManager.OpenOracleDataSource(dbIp + "/" + database, "", "", user, pass); - if (ds == null) - { - MessageBox.Show("数据库连接失败!", "提示", MessageBoxButtons.OK, MessageBoxIcon.Warning); - } - else - { - btnCreateModel.Enabled = true; - } - } - } private void btnClose_Click(object sender, EventArgs e) { diff --git a/Forms/FrmShRK.cs b/Forms/FrmShRK.cs index 0e2e722..f1d83cb 100644 --- a/Forms/FrmShRK.cs +++ b/Forms/FrmShRK.cs @@ -215,6 +215,7 @@ { sourcefeatds = sourcefeat as GSOFeatureDataset; } + if (sourcefeatds == null) return; sourcefeatds.Open(); GSOFeatures sourcefeatures = sourcefeatds.GetAllFeatures(); @@ -251,6 +252,7 @@ { desfeatds = desfeat as GSOFeatureDataset; } + if (desfeatds == null) return; desfeatds.Open(); //向新数据集写入字段 diff --git a/FrmAccessoriesSensor.cs b/FrmAccessoriesSensor.cs index 09fcdf1..2a7a80e 100644 --- a/FrmAccessoriesSensor.cs +++ b/FrmAccessoriesSensor.cs @@ -209,7 +209,7 @@ chart1.Series[0].Points.DataBindXY(dic.Keys, dic.Values); for (int m = 0; m < dic.Values.Count; m++) { - if (chart1.Series[0].Points[m].YValues[0].ToString() != "0") + if (chart1.Series[0].Points[m]!=null&&chart1.Series[0].Points[m].YValues[0].ToString() != "0") { chart1.Series[0].Points[m].Label = chart1.Series[0].Points[m].YValues[0].ToString(); } diff --git a/FrmAccessoriesgather.cs b/FrmAccessoriesgather.cs index 9e331e1..a475d9e 100644 --- a/FrmAccessoriesgather.cs +++ b/FrmAccessoriesgather.cs @@ -338,7 +338,7 @@ chart1.Series[0].Points.DataBindXY(dic.Keys, dic.Values); for (int m = 0; m < dic.Values.Count; m++) { - if (chart1.Series[0].Points[m].YValues[0].ToString() != "0") + if (chart1.Series[0].Points[m]!=null&&chart1.Series[0].Points[m].YValues[0].ToString() != "0") { chart1.Series[0].Points[m].Label = chart1.Series[0].Points[m].YValues[0].ToString(); } diff --git a/FrmAccessoryAnalysis.cs b/FrmAccessoryAnalysis.cs index 71d4579..44d4065 100644 --- a/FrmAccessoryAnalysis.cs +++ b/FrmAccessoryAnalysis.cs @@ -66,39 +66,6 @@ globeControl1.Refresh(); } /// - /// 键盘按键按下事件处理 - /// - /// - /// - private void txtRadius_KeyPress(object sender, KeyPressEventArgs e) - { - TextBox text = sender as TextBox; - if ((e.KeyChar < 48 || e.KeyChar > 57) && (e.KeyChar != 8) && (int)e.KeyChar != 46) - { - e.Handled = true; - } - if ((int)e.KeyChar == 46) //小数点 - { - if (text.Text.Length <= 0) - e.Handled = true; //小数点不能在第一位 - else //处理不规则的小数点 - { - float f; - float oldf; - bool b1 = false, b2 = false; - b1 = float.TryParse(text.Text, out oldf); - b2 = float.TryParse(text.Text + e.KeyChar.ToString(), out f); - if (b2 == false) - { - if (b1 == true) - e.Handled = true; - else - e.Handled = false; - } - } - } - } - /// /// 确定按钮事件处理 /// /// diff --git a/FrmAddValve.cs b/FrmAddValve.cs index 34d2fec..5f405b9 100644 --- a/FrmAddValve.cs +++ b/FrmAddValve.cs @@ -486,56 +486,6 @@ } } - - - - - - - - private void cmbLayer_SelectedIndexChanged(object sender, EventArgs e) - { - GSOLayer layer = globeControl1.Globe.Layers.GetLayerByCaption(selectLayerName); - GSOFeatures features = layer.GetAllFeatures(); - if (features.Length == 0) - return; - - combPath.Items.Clear(); - combZ.Items.Clear(); - combModelName.Items.Clear(); - - for (int i = 0; i < features[0].GetFieldCount(); i++) - { - GeoScene.Data.GSOFieldDefn fielddef = (GeoScene.Data.GSOFieldDefn)(features[0].GetFieldDefn(i)); - combPath.Items.Add(fielddef.Name); - combZ.Items.Add(fielddef.Name); - combModelName.Items.Add(fielddef.Name); - } - combModelName.SelectedItem = "编号"; - combPath.SelectedItem = "模型路径"; - if (combfile.SelectedIndex != -1) - { - - string layerCaption = combfile.SelectedItem.ToString().Trim(); - rukuLayer = globeControl1.Globe.Layers.GetLayerByCaption(layerCaption); - if (rukuLayer != null) - { - combPath.Items.Clear(); - combZ.Items.Clear(); - combModelName.Items.Clear(); - - } - for (int i = 0; i < features[0].GetFieldCount(); i++) - { - GeoScene.Data.GSOFieldDefn fielddef = (GeoScene.Data.GSOFieldDefn)(features[0].GetFieldDefn(i)); - combPath.Items.Add(fielddef.Name); - combZ.Items.Add(fielddef.Name); - combModelName.Items.Add(fielddef.Name); - } - combModelName.SelectedItem = "编号"; - combPath.SelectedItem = "模型路径"; - } - } /// /// 单击选择shp格式文件 /// diff --git a/FrmAddWellShp.cs b/FrmAddWellShp.cs index bb79ec0..a249725 100644 --- a/FrmAddWellShp.cs +++ b/FrmAddWellShp.cs @@ -478,32 +478,6 @@ } } } - - private void cmbLayer_SelectedIndexChanged(object sender, EventArgs e) - { - GSOLayer layer = globeControl1.Globe.Layers.GetLayerByCaption(selectLayerName); - GSOFeatures features = layer.GetAllFeatures(); - if (features.Length == 0) - return; - - combCode.Items.Clear(); - combDeep.Items.Clear(); - combModelName.Items.Clear(); - combAngle.Items.Clear(); - - for (int i = 0; i < features[0].GetFieldCount(); i++) - { - GeoScene.Data.GSOFieldDefn fielddef = (GeoScene.Data.GSOFieldDefn)(features[0].GetFieldDefn(i)); - combCode.Items.Add(fielddef.Name); - combDeep.Items.Add(fielddef.Name); - combModelName.Items.Add(fielddef.Name); - combAngle.Items.Add(fielddef.Name); - } - combCode.SelectedItem = "附属物编码"; - combDeep.SelectedItem = "井深"; - combModelName.SelectedItem = "编号"; - combAngle.SelectedItem = "符号角度"; - } /// /// 单击选择shp格式文件 /// diff --git a/Cyberpipe.csproj b/Cyberpipe.csproj index 07a8c1a..e3cd12c 100644 --- a/Cyberpipe.csproj +++ b/Cyberpipe.csproj @@ -204,25 +204,6 @@ - - Form - - - F_GKT1数据输入输出.cs - - - Form - - - F_GKT1添加文件.cs - - - Form - - - F_GKT1添加项目.cs - - Form @@ -1068,18 +1049,6 @@ Frm_password_reset.cs - - Form - - - GKT.cs - - - Form - - - GKT1.cs - Form @@ -1258,12 +1227,6 @@ F_Projedit.cs - - Form - - - PED.cs - Form @@ -1331,16 +1294,6 @@ True Reference.map - - F_GKT1数据输入输出.cs - Designer - - - F_GKT1添加文件.cs - - - F_GKT1添加项目.cs - Form_EditTask.cs @@ -1836,12 +1789,6 @@ Frm_password_reset.cs - - GKT.cs - - - GKT1.cs - F_GKT数据输入输出.cs @@ -1934,9 +1881,6 @@ F_Projedit.cs - - PED.cs - F_数据输入输出.cs diff --git a/Cyberpipe.suo b/Cyberpipe.suo index 68ced4f..a1aecf8 100644 --- a/Cyberpipe.suo +++ b/Cyberpipe.suo Binary files differ diff --git a/EMS_Forms/Form_EditTask.cs b/EMS_Forms/Form_EditTask.cs index 718992f..f1d791f 100644 --- a/EMS_Forms/Form_EditTask.cs +++ b/EMS_Forms/Form_EditTask.cs @@ -119,7 +119,8 @@ String name = Convert.ToString(dr["USERNAME"]); comboBox_userName.Items.Add(name); - } + } + dr.Close(); comboBox_road.Items.Clear(); roadList = new List(); @@ -135,7 +136,7 @@ comboBox_road.Items.Add(name); } } - + dr1.Close(); conn.Close(); bool flag2 = false; @@ -185,7 +186,7 @@ catch (Exception ex) { - MessageBox.Show(ex.ToString()); + LogHelper.WriteLog(typeof(Form_EditTask), ex.Message); } } @@ -288,7 +289,7 @@ } catch (Exception ex) { - MessageBox.Show(ex.ToString()); + LogHelper.WriteLog(typeof(Form_EditTask), ex.Message); } } @@ -474,7 +475,7 @@ } catch (Exception ex) { - MessageBox.Show(ex.ToString()); + LogHelper.WriteLog(typeof(Form_EditTask), ex.Message); } this.Close(); @@ -495,6 +496,7 @@ { numList.Add(Convert.ToInt32(dr["DBID"])); } + dr.Close(); if (numList.Count == 0) { taskNumber = Convert.ToInt32(number) * 100; @@ -674,6 +676,7 @@ } } } + dr.Close(); conn.Close(); } diff --git a/EMS_Forms/Form_EventManager.cs b/EMS_Forms/Form_EventManager.cs index b18c45b..84807b2 100644 --- a/EMS_Forms/Form_EventManager.cs +++ b/EMS_Forms/Form_EventManager.cs @@ -64,6 +64,7 @@ comboBox_name.Items.Add(name); } + dr.Close(); conn.Close(); diff --git a/Forms/FrmMnModify.cs b/Forms/FrmMnModify.cs index 31cfc5f..d036360 100644 --- a/Forms/FrmMnModify.cs +++ b/Forms/FrmMnModify.cs @@ -68,15 +68,7 @@ questionGrid.Rows[idx].Cells[1].Value = sr.question; } } - /// 选中对象 - /// - /// - /// - /// - private void buttonX1_Click(object sender, EventArgs e) - { - globecontrol.Globe.Action = EnumAction3D.SelectObject; - } + /// /// 选中某一行 /// diff --git a/Forms/FrmPipelineModelDataBase.cs b/Forms/FrmPipelineModelDataBase.cs index 2acf0ca..7ce573f 100644 --- a/Forms/FrmPipelineModelDataBase.cs +++ b/Forms/FrmPipelineModelDataBase.cs @@ -35,19 +35,7 @@ ds = _ds; InitializeComponent(); } - /// - /// 单击选择shp格式文件 - /// - /// - /// - private void btnBrowseModel_Click(object sender, EventArgs e) - { - saveFileDialog1.Filter = "*.lgd|*.lgd"; - if (saveFileDialog1.ShowDialog() == DialogResult.OK) - { - txtModelLayer.Text = saveFileDialog1.FileName; - } - } + /// /// 窗体初始化事件处理 /// @@ -100,49 +88,6 @@ } } } - - private object convertFieldValue(string fieldname, object obj) - { - if (obj == null) - return null; - - try - { - string type = fields_types[fieldname].ToString(); - switch (type) - { - case "string": - return obj.ToString(); - case "int": - //return 101; - int intResult; - if (int.TryParse(obj.ToString(), out intResult)) - return intResult; - else - return null; - case "double": - //return 202.5; - double doubleResult; - if (double.TryParse(obj.ToString(), out doubleResult)) - return doubleResult; - else - return null; - case "date": - DateTime dtResult; - if (DateTime.TryParse(obj.ToString(), out dtResult)) - return dtResult; - else - return null; - } - return null; - } - catch (Exception ex) - { - MessageBox.Show(ex.ToString()); - return null; - } - } - public string lgdFilePath = ""; /// /// 选择管线颜色 @@ -610,33 +555,6 @@ { this.Close(); } - - private void cmbLayer_SelectedIndexChanged(object sender, EventArgs e) //选择图层 - { - GSOLayer layer = ctl.Globe.Layers.GetLayerByCaption(selectLayerName); - GSOFeatures features = layer.GetAllFeatures(); - if (features.Length == 0) - return; - - cmbFrom.Items.Clear(); - cmbTo.Items.Clear(); - cmbRadius.Items.Clear(); - cmbID.Items.Clear(); - for (int i = 0; i < features[0].GetFieldCount(); i++) - { - GeoScene.Data.GSOFieldDefn fielddef = (GeoScene.Data.GSOFieldDefn)(features[0].GetFieldDefn(i)); - - cmbFrom.Items.Add(fielddef.Name); - cmbTo.Items.Add(fielddef.Name); - cmbRadius.Items.Add(fielddef.Name); - cmbID.Items.Add(fielddef.Name); - } - cmbFrom.SelectedItem = "Deep1"; - cmbTo.SelectedItem = "Deep2"; - cmbRadius.SelectedItem = "Diameter"; - cmbID.SelectedItem = "Handle"; - } - private void buttonXLayerPath_Click(object sender, EventArgs e)//单击 选择shp格式的文件 { OpenFileDialog dlg = new OpenFileDialog(); diff --git a/Forms/FrmPipelineModelDataOneStep.cs b/Forms/FrmPipelineModelDataOneStep.cs index 18afda7..ec93b8a 100644 --- a/Forms/FrmPipelineModelDataOneStep.cs +++ b/Forms/FrmPipelineModelDataOneStep.cs @@ -38,19 +38,7 @@ layerTree = _layerTree; InitializeComponent(); } - /// - /// 单击选择shp格式文件 - /// - /// - /// - private void btnBrowseModel_Click(object sender, EventArgs e) - { - saveFileDialog1.Filter = "*.lgd|*.lgd"; - if (saveFileDialog1.ShowDialog() == DialogResult.OK) - { - txtModelLayer.Text = saveFileDialog1.FileName; - } - } + /// /// 窗体初始化事件处理 /// @@ -107,48 +95,7 @@ } } - private object convertFieldValue(string fieldname, object obj) - { - if (obj == null) - return null; - - try - { - string type = fields_types[fieldname].ToString(); - switch (type) - { - case "string": - return obj.ToString(); - case "int": - //return 101; - int intResult; - if (int.TryParse(obj.ToString(), out intResult)) - return intResult; - else - return null; - case "double": - //return 202.5; - double doubleResult; - if (double.TryParse(obj.ToString(), out doubleResult)) - return doubleResult; - else - return null; - case "date": - DateTime dtResult; - if (DateTime.TryParse(obj.ToString(), out dtResult)) - return dtResult; - else - return null; - } - return null; - } - catch (Exception ex) - { - MessageBox.Show(ex.ToString()); - return null; - } - } - + public string lgdFilePath = ""; /// /// 选择管线颜色 @@ -673,32 +620,6 @@ return featDs; } - private void cmbLayer_SelectedIndexChanged(object sender, EventArgs e) //选择图层 - { - GSOLayer layer = ctl.Globe.Layers.GetLayerByCaption(selectLayerName); - GSOFeatures features = layer.GetAllFeatures(); - if (features.Length == 0) - return; - - cmbFrom.Items.Clear(); - cmbTo.Items.Clear(); - cmbRadius.Items.Clear(); - cmbID.Items.Clear(); - for (int i = 0; i < features[0].GetFieldCount(); i++) - { - GeoScene.Data.GSOFieldDefn fielddef = (GeoScene.Data.GSOFieldDefn)(features[0].GetFieldDefn(i)); - - cmbFrom.Items.Add(fielddef.Name); - cmbTo.Items.Add(fielddef.Name); - cmbRadius.Items.Add(fielddef.Name); - cmbID.Items.Add(fielddef.Name); - } - cmbFrom.SelectedItem = "Deep1"; - cmbTo.SelectedItem = "Deep2"; - cmbRadius.SelectedItem = "Diameter"; - cmbID.SelectedItem = "Handle"; - } - private void buttonXLayerPath_Click(object sender, EventArgs e)//单击 选择shp格式的文件 { OpenFileDialog dlg = new OpenFileDialog(); @@ -949,38 +870,6 @@ } //txtLayername.Text = type + layername; } - /// - /// 连接数据库 - /// - /// - /// - private void buttonX1_Click(object sender, EventArgs e) - { - if (ds == null) - { - //没连的话,直接连接审核库; //审核库配置读配置文件 - string dbIp = Utility.sgdbip; - string database = Utility.sgdbname; - string user = Utility.sgdbuser; - string pass = Utility.sgdbpwd; - - if (!Utility.isNetworkConnectionSuccess(dbIp.Trim())) - { - MessageBox.Show("网络连接失败!", "提示"); - return; - } - - ds = ctl.Globe.DataManager.OpenOracleDataSource(dbIp + "/" + database, "", "", user, pass); - if (ds == null) - { - MessageBox.Show("数据库连接失败!", "提示", MessageBoxButtons.OK, MessageBoxIcon.Warning); - } - else - { - btnCreateModel.Enabled = true; - } - } - } private void btnClose_Click(object sender, EventArgs e) { diff --git a/Forms/FrmShRK.cs b/Forms/FrmShRK.cs index 0e2e722..f1d83cb 100644 --- a/Forms/FrmShRK.cs +++ b/Forms/FrmShRK.cs @@ -215,6 +215,7 @@ { sourcefeatds = sourcefeat as GSOFeatureDataset; } + if (sourcefeatds == null) return; sourcefeatds.Open(); GSOFeatures sourcefeatures = sourcefeatds.GetAllFeatures(); @@ -251,6 +252,7 @@ { desfeatds = desfeat as GSOFeatureDataset; } + if (desfeatds == null) return; desfeatds.Open(); //向新数据集写入字段 diff --git a/FrmAccessoriesSensor.cs b/FrmAccessoriesSensor.cs index 09fcdf1..2a7a80e 100644 --- a/FrmAccessoriesSensor.cs +++ b/FrmAccessoriesSensor.cs @@ -209,7 +209,7 @@ chart1.Series[0].Points.DataBindXY(dic.Keys, dic.Values); for (int m = 0; m < dic.Values.Count; m++) { - if (chart1.Series[0].Points[m].YValues[0].ToString() != "0") + if (chart1.Series[0].Points[m]!=null&&chart1.Series[0].Points[m].YValues[0].ToString() != "0") { chart1.Series[0].Points[m].Label = chart1.Series[0].Points[m].YValues[0].ToString(); } diff --git a/FrmAccessoriesgather.cs b/FrmAccessoriesgather.cs index 9e331e1..a475d9e 100644 --- a/FrmAccessoriesgather.cs +++ b/FrmAccessoriesgather.cs @@ -338,7 +338,7 @@ chart1.Series[0].Points.DataBindXY(dic.Keys, dic.Values); for (int m = 0; m < dic.Values.Count; m++) { - if (chart1.Series[0].Points[m].YValues[0].ToString() != "0") + if (chart1.Series[0].Points[m]!=null&&chart1.Series[0].Points[m].YValues[0].ToString() != "0") { chart1.Series[0].Points[m].Label = chart1.Series[0].Points[m].YValues[0].ToString(); } diff --git a/FrmAccessoryAnalysis.cs b/FrmAccessoryAnalysis.cs index 71d4579..44d4065 100644 --- a/FrmAccessoryAnalysis.cs +++ b/FrmAccessoryAnalysis.cs @@ -66,39 +66,6 @@ globeControl1.Refresh(); } /// - /// 键盘按键按下事件处理 - /// - /// - /// - private void txtRadius_KeyPress(object sender, KeyPressEventArgs e) - { - TextBox text = sender as TextBox; - if ((e.KeyChar < 48 || e.KeyChar > 57) && (e.KeyChar != 8) && (int)e.KeyChar != 46) - { - e.Handled = true; - } - if ((int)e.KeyChar == 46) //小数点 - { - if (text.Text.Length <= 0) - e.Handled = true; //小数点不能在第一位 - else //处理不规则的小数点 - { - float f; - float oldf; - bool b1 = false, b2 = false; - b1 = float.TryParse(text.Text, out oldf); - b2 = float.TryParse(text.Text + e.KeyChar.ToString(), out f); - if (b2 == false) - { - if (b1 == true) - e.Handled = true; - else - e.Handled = false; - } - } - } - } - /// /// 确定按钮事件处理 /// /// diff --git a/FrmAddValve.cs b/FrmAddValve.cs index 34d2fec..5f405b9 100644 --- a/FrmAddValve.cs +++ b/FrmAddValve.cs @@ -486,56 +486,6 @@ } } - - - - - - - - private void cmbLayer_SelectedIndexChanged(object sender, EventArgs e) - { - GSOLayer layer = globeControl1.Globe.Layers.GetLayerByCaption(selectLayerName); - GSOFeatures features = layer.GetAllFeatures(); - if (features.Length == 0) - return; - - combPath.Items.Clear(); - combZ.Items.Clear(); - combModelName.Items.Clear(); - - for (int i = 0; i < features[0].GetFieldCount(); i++) - { - GeoScene.Data.GSOFieldDefn fielddef = (GeoScene.Data.GSOFieldDefn)(features[0].GetFieldDefn(i)); - combPath.Items.Add(fielddef.Name); - combZ.Items.Add(fielddef.Name); - combModelName.Items.Add(fielddef.Name); - } - combModelName.SelectedItem = "编号"; - combPath.SelectedItem = "模型路径"; - if (combfile.SelectedIndex != -1) - { - - string layerCaption = combfile.SelectedItem.ToString().Trim(); - rukuLayer = globeControl1.Globe.Layers.GetLayerByCaption(layerCaption); - if (rukuLayer != null) - { - combPath.Items.Clear(); - combZ.Items.Clear(); - combModelName.Items.Clear(); - - } - for (int i = 0; i < features[0].GetFieldCount(); i++) - { - GeoScene.Data.GSOFieldDefn fielddef = (GeoScene.Data.GSOFieldDefn)(features[0].GetFieldDefn(i)); - combPath.Items.Add(fielddef.Name); - combZ.Items.Add(fielddef.Name); - combModelName.Items.Add(fielddef.Name); - } - combModelName.SelectedItem = "编号"; - combPath.SelectedItem = "模型路径"; - } - } /// /// 单击选择shp格式文件 /// diff --git a/FrmAddWellShp.cs b/FrmAddWellShp.cs index bb79ec0..a249725 100644 --- a/FrmAddWellShp.cs +++ b/FrmAddWellShp.cs @@ -478,32 +478,6 @@ } } } - - private void cmbLayer_SelectedIndexChanged(object sender, EventArgs e) - { - GSOLayer layer = globeControl1.Globe.Layers.GetLayerByCaption(selectLayerName); - GSOFeatures features = layer.GetAllFeatures(); - if (features.Length == 0) - return; - - combCode.Items.Clear(); - combDeep.Items.Clear(); - combModelName.Items.Clear(); - combAngle.Items.Clear(); - - for (int i = 0; i < features[0].GetFieldCount(); i++) - { - GeoScene.Data.GSOFieldDefn fielddef = (GeoScene.Data.GSOFieldDefn)(features[0].GetFieldDefn(i)); - combCode.Items.Add(fielddef.Name); - combDeep.Items.Add(fielddef.Name); - combModelName.Items.Add(fielddef.Name); - combAngle.Items.Add(fielddef.Name); - } - combCode.SelectedItem = "附属物编码"; - combDeep.SelectedItem = "井深"; - combModelName.SelectedItem = "编号"; - combAngle.SelectedItem = "符号角度"; - } /// /// 单击选择shp格式文件 /// diff --git a/FrmAddYuBiZiShp.cs b/FrmAddYuBiZiShp.cs index b312d51..332f037 100644 --- a/FrmAddYuBiZiShp.cs +++ b/FrmAddYuBiZiShp.cs @@ -383,80 +383,7 @@ } } - private void cmbLayer_SelectedIndexChanged(object sender, EventArgs e) - { - GSOLayer layer = globeControl1.Globe.Layers.GetLayerByCaption(selectLayerName); - GSOFeatures features = layer.GetAllFeatures(); - if (features.Length == 0) - return; - - combCode.Items.Clear(); - combDeep.Items.Clear(); - combModelName.Items.Clear(); - //comboLoad.Items.Clear(); - for (int i = 0; i < features[0].GetFieldCount(); i++) - { - GeoScene.Data.GSOFieldDefn fielddef = (GeoScene.Data.GSOFieldDefn)(features[0].GetFieldDefn(i)); - combCode.Items.Add(fielddef.Name); - combDeep.Items.Add(fielddef.Name); - combModelName.Items.Add(fielddef.Name); - //comboLoad.Items.Add(fielddef.Name); - } - combCode.SelectedItem = "附属物编码"; - combDeep.SelectedItem = "Z坐标"; - combModelName.SelectedItem = "编号"; - //comboLoad.SelectedItem = "模型路径"; - } - - private void buttonXLayerPath_Click(object sender, EventArgs e) - { - OpenFileDialog dlg = new OpenFileDialog(); - dlg.Filter = "*.shp|*.shp"; - dlg.Multiselect = false; - if (dlg.ShowDialog() == DialogResult.OK) - { - GSOLayer layer = globeControl1.Globe.Layers.Add(dlg.FileName); - string txtMessage = valiYBdata(layer); - if (txtMessage != "") - { - button3.Enabled = false; - //textBoxLayer.Text = ""; - combCode.Items.Clear(); - combDeep.Items.Clear(); - combModelName.Items.Clear(); - globeControl1.Globe.Layers.Remove(layer); - FrmValiDataShowErrorMessage showErrorMessage = new FrmValiDataShowErrorMessage(dlg.FileName, txtMessage); - showErrorMessage.ShowDialog(); - return; - } - else - { - button3.Enabled = true; - //textBoxLayer.Text = dlg.FileName; - selectLayerName = layer.Caption; - txtLayerName.Text = layer.Caption; - GSOFeatures features = layer.GetAllFeatures(); - if (features.Length == 0) - return; - - combCode.Items.Clear(); - combDeep.Items.Clear(); - combModelName.Items.Clear(); - for (int i = 0; i < features[0].GetFieldCount(); i++) - { - GeoScene.Data.GSOFieldDefn fielddef = (GeoScene.Data.GSOFieldDefn)(features[0].GetFieldDefn(i)); - combCode.Items.Add(fielddef.Name); - combDeep.Items.Add(fielddef.Name); - combModelName.Items.Add(fielddef.Name); - //comboLoad.Items.Add(fielddef.Name); - } - combCode.SelectedItem = "管点编码"; - combDeep.SelectedItem = "Z坐标"; - combModelName.SelectedItem = "编号"; - } - } - } - + private void FrmAddYuBiZiShp_FormClosing(object sender, FormClosingEventArgs e) { globeControl1.Globe.Refresh(); diff --git a/Cyberpipe.csproj b/Cyberpipe.csproj index 07a8c1a..e3cd12c 100644 --- a/Cyberpipe.csproj +++ b/Cyberpipe.csproj @@ -204,25 +204,6 @@ - - Form - - - F_GKT1数据输入输出.cs - - - Form - - - F_GKT1添加文件.cs - - - Form - - - F_GKT1添加项目.cs - - Form @@ -1068,18 +1049,6 @@ Frm_password_reset.cs - - Form - - - GKT.cs - - - Form - - - GKT1.cs - Form @@ -1258,12 +1227,6 @@ F_Projedit.cs - - Form - - - PED.cs - Form @@ -1331,16 +1294,6 @@ True Reference.map - - F_GKT1数据输入输出.cs - Designer - - - F_GKT1添加文件.cs - - - F_GKT1添加项目.cs - Form_EditTask.cs @@ -1836,12 +1789,6 @@ Frm_password_reset.cs - - GKT.cs - - - GKT1.cs - F_GKT数据输入输出.cs @@ -1934,9 +1881,6 @@ F_Projedit.cs - - PED.cs - F_数据输入输出.cs diff --git a/Cyberpipe.suo b/Cyberpipe.suo index 68ced4f..a1aecf8 100644 --- a/Cyberpipe.suo +++ b/Cyberpipe.suo Binary files differ diff --git a/EMS_Forms/Form_EditTask.cs b/EMS_Forms/Form_EditTask.cs index 718992f..f1d791f 100644 --- a/EMS_Forms/Form_EditTask.cs +++ b/EMS_Forms/Form_EditTask.cs @@ -119,7 +119,8 @@ String name = Convert.ToString(dr["USERNAME"]); comboBox_userName.Items.Add(name); - } + } + dr.Close(); comboBox_road.Items.Clear(); roadList = new List(); @@ -135,7 +136,7 @@ comboBox_road.Items.Add(name); } } - + dr1.Close(); conn.Close(); bool flag2 = false; @@ -185,7 +186,7 @@ catch (Exception ex) { - MessageBox.Show(ex.ToString()); + LogHelper.WriteLog(typeof(Form_EditTask), ex.Message); } } @@ -288,7 +289,7 @@ } catch (Exception ex) { - MessageBox.Show(ex.ToString()); + LogHelper.WriteLog(typeof(Form_EditTask), ex.Message); } } @@ -474,7 +475,7 @@ } catch (Exception ex) { - MessageBox.Show(ex.ToString()); + LogHelper.WriteLog(typeof(Form_EditTask), ex.Message); } this.Close(); @@ -495,6 +496,7 @@ { numList.Add(Convert.ToInt32(dr["DBID"])); } + dr.Close(); if (numList.Count == 0) { taskNumber = Convert.ToInt32(number) * 100; @@ -674,6 +676,7 @@ } } } + dr.Close(); conn.Close(); } diff --git a/EMS_Forms/Form_EventManager.cs b/EMS_Forms/Form_EventManager.cs index b18c45b..84807b2 100644 --- a/EMS_Forms/Form_EventManager.cs +++ b/EMS_Forms/Form_EventManager.cs @@ -64,6 +64,7 @@ comboBox_name.Items.Add(name); } + dr.Close(); conn.Close(); diff --git a/Forms/FrmMnModify.cs b/Forms/FrmMnModify.cs index 31cfc5f..d036360 100644 --- a/Forms/FrmMnModify.cs +++ b/Forms/FrmMnModify.cs @@ -68,15 +68,7 @@ questionGrid.Rows[idx].Cells[1].Value = sr.question; } } - /// 选中对象 - /// - /// - /// - /// - private void buttonX1_Click(object sender, EventArgs e) - { - globecontrol.Globe.Action = EnumAction3D.SelectObject; - } + /// /// 选中某一行 /// diff --git a/Forms/FrmPipelineModelDataBase.cs b/Forms/FrmPipelineModelDataBase.cs index 2acf0ca..7ce573f 100644 --- a/Forms/FrmPipelineModelDataBase.cs +++ b/Forms/FrmPipelineModelDataBase.cs @@ -35,19 +35,7 @@ ds = _ds; InitializeComponent(); } - /// - /// 单击选择shp格式文件 - /// - /// - /// - private void btnBrowseModel_Click(object sender, EventArgs e) - { - saveFileDialog1.Filter = "*.lgd|*.lgd"; - if (saveFileDialog1.ShowDialog() == DialogResult.OK) - { - txtModelLayer.Text = saveFileDialog1.FileName; - } - } + /// /// 窗体初始化事件处理 /// @@ -100,49 +88,6 @@ } } } - - private object convertFieldValue(string fieldname, object obj) - { - if (obj == null) - return null; - - try - { - string type = fields_types[fieldname].ToString(); - switch (type) - { - case "string": - return obj.ToString(); - case "int": - //return 101; - int intResult; - if (int.TryParse(obj.ToString(), out intResult)) - return intResult; - else - return null; - case "double": - //return 202.5; - double doubleResult; - if (double.TryParse(obj.ToString(), out doubleResult)) - return doubleResult; - else - return null; - case "date": - DateTime dtResult; - if (DateTime.TryParse(obj.ToString(), out dtResult)) - return dtResult; - else - return null; - } - return null; - } - catch (Exception ex) - { - MessageBox.Show(ex.ToString()); - return null; - } - } - public string lgdFilePath = ""; /// /// 选择管线颜色 @@ -610,33 +555,6 @@ { this.Close(); } - - private void cmbLayer_SelectedIndexChanged(object sender, EventArgs e) //选择图层 - { - GSOLayer layer = ctl.Globe.Layers.GetLayerByCaption(selectLayerName); - GSOFeatures features = layer.GetAllFeatures(); - if (features.Length == 0) - return; - - cmbFrom.Items.Clear(); - cmbTo.Items.Clear(); - cmbRadius.Items.Clear(); - cmbID.Items.Clear(); - for (int i = 0; i < features[0].GetFieldCount(); i++) - { - GeoScene.Data.GSOFieldDefn fielddef = (GeoScene.Data.GSOFieldDefn)(features[0].GetFieldDefn(i)); - - cmbFrom.Items.Add(fielddef.Name); - cmbTo.Items.Add(fielddef.Name); - cmbRadius.Items.Add(fielddef.Name); - cmbID.Items.Add(fielddef.Name); - } - cmbFrom.SelectedItem = "Deep1"; - cmbTo.SelectedItem = "Deep2"; - cmbRadius.SelectedItem = "Diameter"; - cmbID.SelectedItem = "Handle"; - } - private void buttonXLayerPath_Click(object sender, EventArgs e)//单击 选择shp格式的文件 { OpenFileDialog dlg = new OpenFileDialog(); diff --git a/Forms/FrmPipelineModelDataOneStep.cs b/Forms/FrmPipelineModelDataOneStep.cs index 18afda7..ec93b8a 100644 --- a/Forms/FrmPipelineModelDataOneStep.cs +++ b/Forms/FrmPipelineModelDataOneStep.cs @@ -38,19 +38,7 @@ layerTree = _layerTree; InitializeComponent(); } - /// - /// 单击选择shp格式文件 - /// - /// - /// - private void btnBrowseModel_Click(object sender, EventArgs e) - { - saveFileDialog1.Filter = "*.lgd|*.lgd"; - if (saveFileDialog1.ShowDialog() == DialogResult.OK) - { - txtModelLayer.Text = saveFileDialog1.FileName; - } - } + /// /// 窗体初始化事件处理 /// @@ -107,48 +95,7 @@ } } - private object convertFieldValue(string fieldname, object obj) - { - if (obj == null) - return null; - - try - { - string type = fields_types[fieldname].ToString(); - switch (type) - { - case "string": - return obj.ToString(); - case "int": - //return 101; - int intResult; - if (int.TryParse(obj.ToString(), out intResult)) - return intResult; - else - return null; - case "double": - //return 202.5; - double doubleResult; - if (double.TryParse(obj.ToString(), out doubleResult)) - return doubleResult; - else - return null; - case "date": - DateTime dtResult; - if (DateTime.TryParse(obj.ToString(), out dtResult)) - return dtResult; - else - return null; - } - return null; - } - catch (Exception ex) - { - MessageBox.Show(ex.ToString()); - return null; - } - } - + public string lgdFilePath = ""; /// /// 选择管线颜色 @@ -673,32 +620,6 @@ return featDs; } - private void cmbLayer_SelectedIndexChanged(object sender, EventArgs e) //选择图层 - { - GSOLayer layer = ctl.Globe.Layers.GetLayerByCaption(selectLayerName); - GSOFeatures features = layer.GetAllFeatures(); - if (features.Length == 0) - return; - - cmbFrom.Items.Clear(); - cmbTo.Items.Clear(); - cmbRadius.Items.Clear(); - cmbID.Items.Clear(); - for (int i = 0; i < features[0].GetFieldCount(); i++) - { - GeoScene.Data.GSOFieldDefn fielddef = (GeoScene.Data.GSOFieldDefn)(features[0].GetFieldDefn(i)); - - cmbFrom.Items.Add(fielddef.Name); - cmbTo.Items.Add(fielddef.Name); - cmbRadius.Items.Add(fielddef.Name); - cmbID.Items.Add(fielddef.Name); - } - cmbFrom.SelectedItem = "Deep1"; - cmbTo.SelectedItem = "Deep2"; - cmbRadius.SelectedItem = "Diameter"; - cmbID.SelectedItem = "Handle"; - } - private void buttonXLayerPath_Click(object sender, EventArgs e)//单击 选择shp格式的文件 { OpenFileDialog dlg = new OpenFileDialog(); @@ -949,38 +870,6 @@ } //txtLayername.Text = type + layername; } - /// - /// 连接数据库 - /// - /// - /// - private void buttonX1_Click(object sender, EventArgs e) - { - if (ds == null) - { - //没连的话,直接连接审核库; //审核库配置读配置文件 - string dbIp = Utility.sgdbip; - string database = Utility.sgdbname; - string user = Utility.sgdbuser; - string pass = Utility.sgdbpwd; - - if (!Utility.isNetworkConnectionSuccess(dbIp.Trim())) - { - MessageBox.Show("网络连接失败!", "提示"); - return; - } - - ds = ctl.Globe.DataManager.OpenOracleDataSource(dbIp + "/" + database, "", "", user, pass); - if (ds == null) - { - MessageBox.Show("数据库连接失败!", "提示", MessageBoxButtons.OK, MessageBoxIcon.Warning); - } - else - { - btnCreateModel.Enabled = true; - } - } - } private void btnClose_Click(object sender, EventArgs e) { diff --git a/Forms/FrmShRK.cs b/Forms/FrmShRK.cs index 0e2e722..f1d83cb 100644 --- a/Forms/FrmShRK.cs +++ b/Forms/FrmShRK.cs @@ -215,6 +215,7 @@ { sourcefeatds = sourcefeat as GSOFeatureDataset; } + if (sourcefeatds == null) return; sourcefeatds.Open(); GSOFeatures sourcefeatures = sourcefeatds.GetAllFeatures(); @@ -251,6 +252,7 @@ { desfeatds = desfeat as GSOFeatureDataset; } + if (desfeatds == null) return; desfeatds.Open(); //向新数据集写入字段 diff --git a/FrmAccessoriesSensor.cs b/FrmAccessoriesSensor.cs index 09fcdf1..2a7a80e 100644 --- a/FrmAccessoriesSensor.cs +++ b/FrmAccessoriesSensor.cs @@ -209,7 +209,7 @@ chart1.Series[0].Points.DataBindXY(dic.Keys, dic.Values); for (int m = 0; m < dic.Values.Count; m++) { - if (chart1.Series[0].Points[m].YValues[0].ToString() != "0") + if (chart1.Series[0].Points[m]!=null&&chart1.Series[0].Points[m].YValues[0].ToString() != "0") { chart1.Series[0].Points[m].Label = chart1.Series[0].Points[m].YValues[0].ToString(); } diff --git a/FrmAccessoriesgather.cs b/FrmAccessoriesgather.cs index 9e331e1..a475d9e 100644 --- a/FrmAccessoriesgather.cs +++ b/FrmAccessoriesgather.cs @@ -338,7 +338,7 @@ chart1.Series[0].Points.DataBindXY(dic.Keys, dic.Values); for (int m = 0; m < dic.Values.Count; m++) { - if (chart1.Series[0].Points[m].YValues[0].ToString() != "0") + if (chart1.Series[0].Points[m]!=null&&chart1.Series[0].Points[m].YValues[0].ToString() != "0") { chart1.Series[0].Points[m].Label = chart1.Series[0].Points[m].YValues[0].ToString(); } diff --git a/FrmAccessoryAnalysis.cs b/FrmAccessoryAnalysis.cs index 71d4579..44d4065 100644 --- a/FrmAccessoryAnalysis.cs +++ b/FrmAccessoryAnalysis.cs @@ -66,39 +66,6 @@ globeControl1.Refresh(); } /// - /// 键盘按键按下事件处理 - /// - /// - /// - private void txtRadius_KeyPress(object sender, KeyPressEventArgs e) - { - TextBox text = sender as TextBox; - if ((e.KeyChar < 48 || e.KeyChar > 57) && (e.KeyChar != 8) && (int)e.KeyChar != 46) - { - e.Handled = true; - } - if ((int)e.KeyChar == 46) //小数点 - { - if (text.Text.Length <= 0) - e.Handled = true; //小数点不能在第一位 - else //处理不规则的小数点 - { - float f; - float oldf; - bool b1 = false, b2 = false; - b1 = float.TryParse(text.Text, out oldf); - b2 = float.TryParse(text.Text + e.KeyChar.ToString(), out f); - if (b2 == false) - { - if (b1 == true) - e.Handled = true; - else - e.Handled = false; - } - } - } - } - /// /// 确定按钮事件处理 /// /// diff --git a/FrmAddValve.cs b/FrmAddValve.cs index 34d2fec..5f405b9 100644 --- a/FrmAddValve.cs +++ b/FrmAddValve.cs @@ -486,56 +486,6 @@ } } - - - - - - - - private void cmbLayer_SelectedIndexChanged(object sender, EventArgs e) - { - GSOLayer layer = globeControl1.Globe.Layers.GetLayerByCaption(selectLayerName); - GSOFeatures features = layer.GetAllFeatures(); - if (features.Length == 0) - return; - - combPath.Items.Clear(); - combZ.Items.Clear(); - combModelName.Items.Clear(); - - for (int i = 0; i < features[0].GetFieldCount(); i++) - { - GeoScene.Data.GSOFieldDefn fielddef = (GeoScene.Data.GSOFieldDefn)(features[0].GetFieldDefn(i)); - combPath.Items.Add(fielddef.Name); - combZ.Items.Add(fielddef.Name); - combModelName.Items.Add(fielddef.Name); - } - combModelName.SelectedItem = "编号"; - combPath.SelectedItem = "模型路径"; - if (combfile.SelectedIndex != -1) - { - - string layerCaption = combfile.SelectedItem.ToString().Trim(); - rukuLayer = globeControl1.Globe.Layers.GetLayerByCaption(layerCaption); - if (rukuLayer != null) - { - combPath.Items.Clear(); - combZ.Items.Clear(); - combModelName.Items.Clear(); - - } - for (int i = 0; i < features[0].GetFieldCount(); i++) - { - GeoScene.Data.GSOFieldDefn fielddef = (GeoScene.Data.GSOFieldDefn)(features[0].GetFieldDefn(i)); - combPath.Items.Add(fielddef.Name); - combZ.Items.Add(fielddef.Name); - combModelName.Items.Add(fielddef.Name); - } - combModelName.SelectedItem = "编号"; - combPath.SelectedItem = "模型路径"; - } - } /// /// 单击选择shp格式文件 /// diff --git a/FrmAddWellShp.cs b/FrmAddWellShp.cs index bb79ec0..a249725 100644 --- a/FrmAddWellShp.cs +++ b/FrmAddWellShp.cs @@ -478,32 +478,6 @@ } } } - - private void cmbLayer_SelectedIndexChanged(object sender, EventArgs e) - { - GSOLayer layer = globeControl1.Globe.Layers.GetLayerByCaption(selectLayerName); - GSOFeatures features = layer.GetAllFeatures(); - if (features.Length == 0) - return; - - combCode.Items.Clear(); - combDeep.Items.Clear(); - combModelName.Items.Clear(); - combAngle.Items.Clear(); - - for (int i = 0; i < features[0].GetFieldCount(); i++) - { - GeoScene.Data.GSOFieldDefn fielddef = (GeoScene.Data.GSOFieldDefn)(features[0].GetFieldDefn(i)); - combCode.Items.Add(fielddef.Name); - combDeep.Items.Add(fielddef.Name); - combModelName.Items.Add(fielddef.Name); - combAngle.Items.Add(fielddef.Name); - } - combCode.SelectedItem = "附属物编码"; - combDeep.SelectedItem = "井深"; - combModelName.SelectedItem = "编号"; - combAngle.SelectedItem = "符号角度"; - } /// /// 单击选择shp格式文件 /// diff --git a/FrmAddYuBiZiShp.cs b/FrmAddYuBiZiShp.cs index b312d51..332f037 100644 --- a/FrmAddYuBiZiShp.cs +++ b/FrmAddYuBiZiShp.cs @@ -383,80 +383,7 @@ } } - private void cmbLayer_SelectedIndexChanged(object sender, EventArgs e) - { - GSOLayer layer = globeControl1.Globe.Layers.GetLayerByCaption(selectLayerName); - GSOFeatures features = layer.GetAllFeatures(); - if (features.Length == 0) - return; - - combCode.Items.Clear(); - combDeep.Items.Clear(); - combModelName.Items.Clear(); - //comboLoad.Items.Clear(); - for (int i = 0; i < features[0].GetFieldCount(); i++) - { - GeoScene.Data.GSOFieldDefn fielddef = (GeoScene.Data.GSOFieldDefn)(features[0].GetFieldDefn(i)); - combCode.Items.Add(fielddef.Name); - combDeep.Items.Add(fielddef.Name); - combModelName.Items.Add(fielddef.Name); - //comboLoad.Items.Add(fielddef.Name); - } - combCode.SelectedItem = "附属物编码"; - combDeep.SelectedItem = "Z坐标"; - combModelName.SelectedItem = "编号"; - //comboLoad.SelectedItem = "模型路径"; - } - - private void buttonXLayerPath_Click(object sender, EventArgs e) - { - OpenFileDialog dlg = new OpenFileDialog(); - dlg.Filter = "*.shp|*.shp"; - dlg.Multiselect = false; - if (dlg.ShowDialog() == DialogResult.OK) - { - GSOLayer layer = globeControl1.Globe.Layers.Add(dlg.FileName); - string txtMessage = valiYBdata(layer); - if (txtMessage != "") - { - button3.Enabled = false; - //textBoxLayer.Text = ""; - combCode.Items.Clear(); - combDeep.Items.Clear(); - combModelName.Items.Clear(); - globeControl1.Globe.Layers.Remove(layer); - FrmValiDataShowErrorMessage showErrorMessage = new FrmValiDataShowErrorMessage(dlg.FileName, txtMessage); - showErrorMessage.ShowDialog(); - return; - } - else - { - button3.Enabled = true; - //textBoxLayer.Text = dlg.FileName; - selectLayerName = layer.Caption; - txtLayerName.Text = layer.Caption; - GSOFeatures features = layer.GetAllFeatures(); - if (features.Length == 0) - return; - - combCode.Items.Clear(); - combDeep.Items.Clear(); - combModelName.Items.Clear(); - for (int i = 0; i < features[0].GetFieldCount(); i++) - { - GeoScene.Data.GSOFieldDefn fielddef = (GeoScene.Data.GSOFieldDefn)(features[0].GetFieldDefn(i)); - combCode.Items.Add(fielddef.Name); - combDeep.Items.Add(fielddef.Name); - combModelName.Items.Add(fielddef.Name); - //comboLoad.Items.Add(fielddef.Name); - } - combCode.SelectedItem = "管点编码"; - combDeep.SelectedItem = "Z坐标"; - combModelName.SelectedItem = "编号"; - } - } - } - + private void FrmAddYuBiZiShp_FormClosing(object sender, FormClosingEventArgs e) { globeControl1.Globe.Refresh(); diff --git a/FrmAllPipelineStatis.cs b/FrmAllPipelineStatis.cs index 6421a26..a6eea29 100644 --- a/FrmAllPipelineStatis.cs +++ b/FrmAllPipelineStatis.cs @@ -84,7 +84,7 @@ chartAllAreaPipeline.Series["管线"].Points.DataBindXY(pipelineLengthAndType.Keys, pipelineLengthAndType.Values); for (int m = 0; m < pipelineLengthAndType.Values.Count; m++) { - if (chartAllAreaPipeline.Series["管线"].Points[m].YValues[0].ToString() != "0") + if (chartAllAreaPipeline.Series["管线"].Points[m]!=null&&chartAllAreaPipeline.Series["管线"].Points[m].YValues[0].ToString() != "0") { chartAllAreaPipeline.Series["管线"].Points[m].Label = chartAllAreaPipeline.Series[0].Points[m].YValues[0].ToString(); } @@ -94,7 +94,7 @@ } catch (Exception ex) { - //LogError.PublishError(ex); + LogHelper.WriteLog(typeof(FrmAllPipelineStatis), ex.Message); } } @@ -147,7 +147,7 @@ } DataTable dt = OledbHelper.QueryTable(sql); - if (dt != null && dt.Rows.Count > 0) + if (dt != null && dt.Rows.Count > 0 && chartAllAreaPipeline.Series["管线"].Points[indexHit]!=null) { dataGridViewX1.DataSource = dt; panel.Visible = true; diff --git a/Cyberpipe.csproj b/Cyberpipe.csproj index 07a8c1a..e3cd12c 100644 --- a/Cyberpipe.csproj +++ b/Cyberpipe.csproj @@ -204,25 +204,6 @@ - - Form - - - F_GKT1数据输入输出.cs - - - Form - - - F_GKT1添加文件.cs - - - Form - - - F_GKT1添加项目.cs - - Form @@ -1068,18 +1049,6 @@ Frm_password_reset.cs - - Form - - - GKT.cs - - - Form - - - GKT1.cs - Form @@ -1258,12 +1227,6 @@ F_Projedit.cs - - Form - - - PED.cs - Form @@ -1331,16 +1294,6 @@ True Reference.map - - F_GKT1数据输入输出.cs - Designer - - - F_GKT1添加文件.cs - - - F_GKT1添加项目.cs - Form_EditTask.cs @@ -1836,12 +1789,6 @@ Frm_password_reset.cs - - GKT.cs - - - GKT1.cs - F_GKT数据输入输出.cs @@ -1934,9 +1881,6 @@ F_Projedit.cs - - PED.cs - F_数据输入输出.cs diff --git a/Cyberpipe.suo b/Cyberpipe.suo index 68ced4f..a1aecf8 100644 --- a/Cyberpipe.suo +++ b/Cyberpipe.suo Binary files differ diff --git a/EMS_Forms/Form_EditTask.cs b/EMS_Forms/Form_EditTask.cs index 718992f..f1d791f 100644 --- a/EMS_Forms/Form_EditTask.cs +++ b/EMS_Forms/Form_EditTask.cs @@ -119,7 +119,8 @@ String name = Convert.ToString(dr["USERNAME"]); comboBox_userName.Items.Add(name); - } + } + dr.Close(); comboBox_road.Items.Clear(); roadList = new List(); @@ -135,7 +136,7 @@ comboBox_road.Items.Add(name); } } - + dr1.Close(); conn.Close(); bool flag2 = false; @@ -185,7 +186,7 @@ catch (Exception ex) { - MessageBox.Show(ex.ToString()); + LogHelper.WriteLog(typeof(Form_EditTask), ex.Message); } } @@ -288,7 +289,7 @@ } catch (Exception ex) { - MessageBox.Show(ex.ToString()); + LogHelper.WriteLog(typeof(Form_EditTask), ex.Message); } } @@ -474,7 +475,7 @@ } catch (Exception ex) { - MessageBox.Show(ex.ToString()); + LogHelper.WriteLog(typeof(Form_EditTask), ex.Message); } this.Close(); @@ -495,6 +496,7 @@ { numList.Add(Convert.ToInt32(dr["DBID"])); } + dr.Close(); if (numList.Count == 0) { taskNumber = Convert.ToInt32(number) * 100; @@ -674,6 +676,7 @@ } } } + dr.Close(); conn.Close(); } diff --git a/EMS_Forms/Form_EventManager.cs b/EMS_Forms/Form_EventManager.cs index b18c45b..84807b2 100644 --- a/EMS_Forms/Form_EventManager.cs +++ b/EMS_Forms/Form_EventManager.cs @@ -64,6 +64,7 @@ comboBox_name.Items.Add(name); } + dr.Close(); conn.Close(); diff --git a/Forms/FrmMnModify.cs b/Forms/FrmMnModify.cs index 31cfc5f..d036360 100644 --- a/Forms/FrmMnModify.cs +++ b/Forms/FrmMnModify.cs @@ -68,15 +68,7 @@ questionGrid.Rows[idx].Cells[1].Value = sr.question; } } - /// 选中对象 - /// - /// - /// - /// - private void buttonX1_Click(object sender, EventArgs e) - { - globecontrol.Globe.Action = EnumAction3D.SelectObject; - } + /// /// 选中某一行 /// diff --git a/Forms/FrmPipelineModelDataBase.cs b/Forms/FrmPipelineModelDataBase.cs index 2acf0ca..7ce573f 100644 --- a/Forms/FrmPipelineModelDataBase.cs +++ b/Forms/FrmPipelineModelDataBase.cs @@ -35,19 +35,7 @@ ds = _ds; InitializeComponent(); } - /// - /// 单击选择shp格式文件 - /// - /// - /// - private void btnBrowseModel_Click(object sender, EventArgs e) - { - saveFileDialog1.Filter = "*.lgd|*.lgd"; - if (saveFileDialog1.ShowDialog() == DialogResult.OK) - { - txtModelLayer.Text = saveFileDialog1.FileName; - } - } + /// /// 窗体初始化事件处理 /// @@ -100,49 +88,6 @@ } } } - - private object convertFieldValue(string fieldname, object obj) - { - if (obj == null) - return null; - - try - { - string type = fields_types[fieldname].ToString(); - switch (type) - { - case "string": - return obj.ToString(); - case "int": - //return 101; - int intResult; - if (int.TryParse(obj.ToString(), out intResult)) - return intResult; - else - return null; - case "double": - //return 202.5; - double doubleResult; - if (double.TryParse(obj.ToString(), out doubleResult)) - return doubleResult; - else - return null; - case "date": - DateTime dtResult; - if (DateTime.TryParse(obj.ToString(), out dtResult)) - return dtResult; - else - return null; - } - return null; - } - catch (Exception ex) - { - MessageBox.Show(ex.ToString()); - return null; - } - } - public string lgdFilePath = ""; /// /// 选择管线颜色 @@ -610,33 +555,6 @@ { this.Close(); } - - private void cmbLayer_SelectedIndexChanged(object sender, EventArgs e) //选择图层 - { - GSOLayer layer = ctl.Globe.Layers.GetLayerByCaption(selectLayerName); - GSOFeatures features = layer.GetAllFeatures(); - if (features.Length == 0) - return; - - cmbFrom.Items.Clear(); - cmbTo.Items.Clear(); - cmbRadius.Items.Clear(); - cmbID.Items.Clear(); - for (int i = 0; i < features[0].GetFieldCount(); i++) - { - GeoScene.Data.GSOFieldDefn fielddef = (GeoScene.Data.GSOFieldDefn)(features[0].GetFieldDefn(i)); - - cmbFrom.Items.Add(fielddef.Name); - cmbTo.Items.Add(fielddef.Name); - cmbRadius.Items.Add(fielddef.Name); - cmbID.Items.Add(fielddef.Name); - } - cmbFrom.SelectedItem = "Deep1"; - cmbTo.SelectedItem = "Deep2"; - cmbRadius.SelectedItem = "Diameter"; - cmbID.SelectedItem = "Handle"; - } - private void buttonXLayerPath_Click(object sender, EventArgs e)//单击 选择shp格式的文件 { OpenFileDialog dlg = new OpenFileDialog(); diff --git a/Forms/FrmPipelineModelDataOneStep.cs b/Forms/FrmPipelineModelDataOneStep.cs index 18afda7..ec93b8a 100644 --- a/Forms/FrmPipelineModelDataOneStep.cs +++ b/Forms/FrmPipelineModelDataOneStep.cs @@ -38,19 +38,7 @@ layerTree = _layerTree; InitializeComponent(); } - /// - /// 单击选择shp格式文件 - /// - /// - /// - private void btnBrowseModel_Click(object sender, EventArgs e) - { - saveFileDialog1.Filter = "*.lgd|*.lgd"; - if (saveFileDialog1.ShowDialog() == DialogResult.OK) - { - txtModelLayer.Text = saveFileDialog1.FileName; - } - } + /// /// 窗体初始化事件处理 /// @@ -107,48 +95,7 @@ } } - private object convertFieldValue(string fieldname, object obj) - { - if (obj == null) - return null; - - try - { - string type = fields_types[fieldname].ToString(); - switch (type) - { - case "string": - return obj.ToString(); - case "int": - //return 101; - int intResult; - if (int.TryParse(obj.ToString(), out intResult)) - return intResult; - else - return null; - case "double": - //return 202.5; - double doubleResult; - if (double.TryParse(obj.ToString(), out doubleResult)) - return doubleResult; - else - return null; - case "date": - DateTime dtResult; - if (DateTime.TryParse(obj.ToString(), out dtResult)) - return dtResult; - else - return null; - } - return null; - } - catch (Exception ex) - { - MessageBox.Show(ex.ToString()); - return null; - } - } - + public string lgdFilePath = ""; /// /// 选择管线颜色 @@ -673,32 +620,6 @@ return featDs; } - private void cmbLayer_SelectedIndexChanged(object sender, EventArgs e) //选择图层 - { - GSOLayer layer = ctl.Globe.Layers.GetLayerByCaption(selectLayerName); - GSOFeatures features = layer.GetAllFeatures(); - if (features.Length == 0) - return; - - cmbFrom.Items.Clear(); - cmbTo.Items.Clear(); - cmbRadius.Items.Clear(); - cmbID.Items.Clear(); - for (int i = 0; i < features[0].GetFieldCount(); i++) - { - GeoScene.Data.GSOFieldDefn fielddef = (GeoScene.Data.GSOFieldDefn)(features[0].GetFieldDefn(i)); - - cmbFrom.Items.Add(fielddef.Name); - cmbTo.Items.Add(fielddef.Name); - cmbRadius.Items.Add(fielddef.Name); - cmbID.Items.Add(fielddef.Name); - } - cmbFrom.SelectedItem = "Deep1"; - cmbTo.SelectedItem = "Deep2"; - cmbRadius.SelectedItem = "Diameter"; - cmbID.SelectedItem = "Handle"; - } - private void buttonXLayerPath_Click(object sender, EventArgs e)//单击 选择shp格式的文件 { OpenFileDialog dlg = new OpenFileDialog(); @@ -949,38 +870,6 @@ } //txtLayername.Text = type + layername; } - /// - /// 连接数据库 - /// - /// - /// - private void buttonX1_Click(object sender, EventArgs e) - { - if (ds == null) - { - //没连的话,直接连接审核库; //审核库配置读配置文件 - string dbIp = Utility.sgdbip; - string database = Utility.sgdbname; - string user = Utility.sgdbuser; - string pass = Utility.sgdbpwd; - - if (!Utility.isNetworkConnectionSuccess(dbIp.Trim())) - { - MessageBox.Show("网络连接失败!", "提示"); - return; - } - - ds = ctl.Globe.DataManager.OpenOracleDataSource(dbIp + "/" + database, "", "", user, pass); - if (ds == null) - { - MessageBox.Show("数据库连接失败!", "提示", MessageBoxButtons.OK, MessageBoxIcon.Warning); - } - else - { - btnCreateModel.Enabled = true; - } - } - } private void btnClose_Click(object sender, EventArgs e) { diff --git a/Forms/FrmShRK.cs b/Forms/FrmShRK.cs index 0e2e722..f1d83cb 100644 --- a/Forms/FrmShRK.cs +++ b/Forms/FrmShRK.cs @@ -215,6 +215,7 @@ { sourcefeatds = sourcefeat as GSOFeatureDataset; } + if (sourcefeatds == null) return; sourcefeatds.Open(); GSOFeatures sourcefeatures = sourcefeatds.GetAllFeatures(); @@ -251,6 +252,7 @@ { desfeatds = desfeat as GSOFeatureDataset; } + if (desfeatds == null) return; desfeatds.Open(); //向新数据集写入字段 diff --git a/FrmAccessoriesSensor.cs b/FrmAccessoriesSensor.cs index 09fcdf1..2a7a80e 100644 --- a/FrmAccessoriesSensor.cs +++ b/FrmAccessoriesSensor.cs @@ -209,7 +209,7 @@ chart1.Series[0].Points.DataBindXY(dic.Keys, dic.Values); for (int m = 0; m < dic.Values.Count; m++) { - if (chart1.Series[0].Points[m].YValues[0].ToString() != "0") + if (chart1.Series[0].Points[m]!=null&&chart1.Series[0].Points[m].YValues[0].ToString() != "0") { chart1.Series[0].Points[m].Label = chart1.Series[0].Points[m].YValues[0].ToString(); } diff --git a/FrmAccessoriesgather.cs b/FrmAccessoriesgather.cs index 9e331e1..a475d9e 100644 --- a/FrmAccessoriesgather.cs +++ b/FrmAccessoriesgather.cs @@ -338,7 +338,7 @@ chart1.Series[0].Points.DataBindXY(dic.Keys, dic.Values); for (int m = 0; m < dic.Values.Count; m++) { - if (chart1.Series[0].Points[m].YValues[0].ToString() != "0") + if (chart1.Series[0].Points[m]!=null&&chart1.Series[0].Points[m].YValues[0].ToString() != "0") { chart1.Series[0].Points[m].Label = chart1.Series[0].Points[m].YValues[0].ToString(); } diff --git a/FrmAccessoryAnalysis.cs b/FrmAccessoryAnalysis.cs index 71d4579..44d4065 100644 --- a/FrmAccessoryAnalysis.cs +++ b/FrmAccessoryAnalysis.cs @@ -66,39 +66,6 @@ globeControl1.Refresh(); } /// - /// 键盘按键按下事件处理 - /// - /// - /// - private void txtRadius_KeyPress(object sender, KeyPressEventArgs e) - { - TextBox text = sender as TextBox; - if ((e.KeyChar < 48 || e.KeyChar > 57) && (e.KeyChar != 8) && (int)e.KeyChar != 46) - { - e.Handled = true; - } - if ((int)e.KeyChar == 46) //小数点 - { - if (text.Text.Length <= 0) - e.Handled = true; //小数点不能在第一位 - else //处理不规则的小数点 - { - float f; - float oldf; - bool b1 = false, b2 = false; - b1 = float.TryParse(text.Text, out oldf); - b2 = float.TryParse(text.Text + e.KeyChar.ToString(), out f); - if (b2 == false) - { - if (b1 == true) - e.Handled = true; - else - e.Handled = false; - } - } - } - } - /// /// 确定按钮事件处理 /// /// diff --git a/FrmAddValve.cs b/FrmAddValve.cs index 34d2fec..5f405b9 100644 --- a/FrmAddValve.cs +++ b/FrmAddValve.cs @@ -486,56 +486,6 @@ } } - - - - - - - - private void cmbLayer_SelectedIndexChanged(object sender, EventArgs e) - { - GSOLayer layer = globeControl1.Globe.Layers.GetLayerByCaption(selectLayerName); - GSOFeatures features = layer.GetAllFeatures(); - if (features.Length == 0) - return; - - combPath.Items.Clear(); - combZ.Items.Clear(); - combModelName.Items.Clear(); - - for (int i = 0; i < features[0].GetFieldCount(); i++) - { - GeoScene.Data.GSOFieldDefn fielddef = (GeoScene.Data.GSOFieldDefn)(features[0].GetFieldDefn(i)); - combPath.Items.Add(fielddef.Name); - combZ.Items.Add(fielddef.Name); - combModelName.Items.Add(fielddef.Name); - } - combModelName.SelectedItem = "编号"; - combPath.SelectedItem = "模型路径"; - if (combfile.SelectedIndex != -1) - { - - string layerCaption = combfile.SelectedItem.ToString().Trim(); - rukuLayer = globeControl1.Globe.Layers.GetLayerByCaption(layerCaption); - if (rukuLayer != null) - { - combPath.Items.Clear(); - combZ.Items.Clear(); - combModelName.Items.Clear(); - - } - for (int i = 0; i < features[0].GetFieldCount(); i++) - { - GeoScene.Data.GSOFieldDefn fielddef = (GeoScene.Data.GSOFieldDefn)(features[0].GetFieldDefn(i)); - combPath.Items.Add(fielddef.Name); - combZ.Items.Add(fielddef.Name); - combModelName.Items.Add(fielddef.Name); - } - combModelName.SelectedItem = "编号"; - combPath.SelectedItem = "模型路径"; - } - } /// /// 单击选择shp格式文件 /// diff --git a/FrmAddWellShp.cs b/FrmAddWellShp.cs index bb79ec0..a249725 100644 --- a/FrmAddWellShp.cs +++ b/FrmAddWellShp.cs @@ -478,32 +478,6 @@ } } } - - private void cmbLayer_SelectedIndexChanged(object sender, EventArgs e) - { - GSOLayer layer = globeControl1.Globe.Layers.GetLayerByCaption(selectLayerName); - GSOFeatures features = layer.GetAllFeatures(); - if (features.Length == 0) - return; - - combCode.Items.Clear(); - combDeep.Items.Clear(); - combModelName.Items.Clear(); - combAngle.Items.Clear(); - - for (int i = 0; i < features[0].GetFieldCount(); i++) - { - GeoScene.Data.GSOFieldDefn fielddef = (GeoScene.Data.GSOFieldDefn)(features[0].GetFieldDefn(i)); - combCode.Items.Add(fielddef.Name); - combDeep.Items.Add(fielddef.Name); - combModelName.Items.Add(fielddef.Name); - combAngle.Items.Add(fielddef.Name); - } - combCode.SelectedItem = "附属物编码"; - combDeep.SelectedItem = "井深"; - combModelName.SelectedItem = "编号"; - combAngle.SelectedItem = "符号角度"; - } /// /// 单击选择shp格式文件 /// diff --git a/FrmAddYuBiZiShp.cs b/FrmAddYuBiZiShp.cs index b312d51..332f037 100644 --- a/FrmAddYuBiZiShp.cs +++ b/FrmAddYuBiZiShp.cs @@ -383,80 +383,7 @@ } } - private void cmbLayer_SelectedIndexChanged(object sender, EventArgs e) - { - GSOLayer layer = globeControl1.Globe.Layers.GetLayerByCaption(selectLayerName); - GSOFeatures features = layer.GetAllFeatures(); - if (features.Length == 0) - return; - - combCode.Items.Clear(); - combDeep.Items.Clear(); - combModelName.Items.Clear(); - //comboLoad.Items.Clear(); - for (int i = 0; i < features[0].GetFieldCount(); i++) - { - GeoScene.Data.GSOFieldDefn fielddef = (GeoScene.Data.GSOFieldDefn)(features[0].GetFieldDefn(i)); - combCode.Items.Add(fielddef.Name); - combDeep.Items.Add(fielddef.Name); - combModelName.Items.Add(fielddef.Name); - //comboLoad.Items.Add(fielddef.Name); - } - combCode.SelectedItem = "附属物编码"; - combDeep.SelectedItem = "Z坐标"; - combModelName.SelectedItem = "编号"; - //comboLoad.SelectedItem = "模型路径"; - } - - private void buttonXLayerPath_Click(object sender, EventArgs e) - { - OpenFileDialog dlg = new OpenFileDialog(); - dlg.Filter = "*.shp|*.shp"; - dlg.Multiselect = false; - if (dlg.ShowDialog() == DialogResult.OK) - { - GSOLayer layer = globeControl1.Globe.Layers.Add(dlg.FileName); - string txtMessage = valiYBdata(layer); - if (txtMessage != "") - { - button3.Enabled = false; - //textBoxLayer.Text = ""; - combCode.Items.Clear(); - combDeep.Items.Clear(); - combModelName.Items.Clear(); - globeControl1.Globe.Layers.Remove(layer); - FrmValiDataShowErrorMessage showErrorMessage = new FrmValiDataShowErrorMessage(dlg.FileName, txtMessage); - showErrorMessage.ShowDialog(); - return; - } - else - { - button3.Enabled = true; - //textBoxLayer.Text = dlg.FileName; - selectLayerName = layer.Caption; - txtLayerName.Text = layer.Caption; - GSOFeatures features = layer.GetAllFeatures(); - if (features.Length == 0) - return; - - combCode.Items.Clear(); - combDeep.Items.Clear(); - combModelName.Items.Clear(); - for (int i = 0; i < features[0].GetFieldCount(); i++) - { - GeoScene.Data.GSOFieldDefn fielddef = (GeoScene.Data.GSOFieldDefn)(features[0].GetFieldDefn(i)); - combCode.Items.Add(fielddef.Name); - combDeep.Items.Add(fielddef.Name); - combModelName.Items.Add(fielddef.Name); - //comboLoad.Items.Add(fielddef.Name); - } - combCode.SelectedItem = "管点编码"; - combDeep.SelectedItem = "Z坐标"; - combModelName.SelectedItem = "编号"; - } - } - } - + private void FrmAddYuBiZiShp_FormClosing(object sender, FormClosingEventArgs e) { globeControl1.Globe.Refresh(); diff --git a/FrmAllPipelineStatis.cs b/FrmAllPipelineStatis.cs index 6421a26..a6eea29 100644 --- a/FrmAllPipelineStatis.cs +++ b/FrmAllPipelineStatis.cs @@ -84,7 +84,7 @@ chartAllAreaPipeline.Series["管线"].Points.DataBindXY(pipelineLengthAndType.Keys, pipelineLengthAndType.Values); for (int m = 0; m < pipelineLengthAndType.Values.Count; m++) { - if (chartAllAreaPipeline.Series["管线"].Points[m].YValues[0].ToString() != "0") + if (chartAllAreaPipeline.Series["管线"].Points[m]!=null&&chartAllAreaPipeline.Series["管线"].Points[m].YValues[0].ToString() != "0") { chartAllAreaPipeline.Series["管线"].Points[m].Label = chartAllAreaPipeline.Series[0].Points[m].YValues[0].ToString(); } @@ -94,7 +94,7 @@ } catch (Exception ex) { - //LogError.PublishError(ex); + LogHelper.WriteLog(typeof(FrmAllPipelineStatis), ex.Message); } } @@ -147,7 +147,7 @@ } DataTable dt = OledbHelper.QueryTable(sql); - if (dt != null && dt.Rows.Count > 0) + if (dt != null && dt.Rows.Count > 0 && chartAllAreaPipeline.Series["管线"].Points[indexHit]!=null) { dataGridViewX1.DataSource = dt; panel.Visible = true; diff --git a/FrmAllWorkWellStatis.cs b/FrmAllWorkWellStatis.cs index 6fec7af..6af8e4c 100644 --- a/FrmAllWorkWellStatis.cs +++ b/FrmAllWorkWellStatis.cs @@ -52,7 +52,7 @@ chartAllAreaPipeline.Series["井盖"].Points.DataBindXY(workWellLengthAndType.Keys, workWellLengthAndType.Values); for (int m = 0; m < workWellLengthAndType.Values.Count; m++) { - if (chartAllAreaPipeline.Series["井盖"].Points[m].YValues[0].ToString().Trim() != "0") + if (chartAllAreaPipeline.Series["井盖"].Points[m]!=null&&chartAllAreaPipeline.Series["井盖"].Points[m].YValues[0].ToString().Trim() != "0") { chartAllAreaPipeline.Series["井盖"].Points[m].Label = chartAllAreaPipeline.Series[0].Points[m].YValues[0].ToString(); } @@ -60,7 +60,7 @@ } catch (Exception ex) { - //LogError.PublishError(ex); + LogHelper.WriteLog(typeof(FrmAllWorkWellStatis), ex.Message); } } diff --git a/Cyberpipe.csproj b/Cyberpipe.csproj index 07a8c1a..e3cd12c 100644 --- a/Cyberpipe.csproj +++ b/Cyberpipe.csproj @@ -204,25 +204,6 @@ - - Form - - - F_GKT1数据输入输出.cs - - - Form - - - F_GKT1添加文件.cs - - - Form - - - F_GKT1添加项目.cs - - Form @@ -1068,18 +1049,6 @@ Frm_password_reset.cs - - Form - - - GKT.cs - - - Form - - - GKT1.cs - Form @@ -1258,12 +1227,6 @@ F_Projedit.cs - - Form - - - PED.cs - Form @@ -1331,16 +1294,6 @@ True Reference.map - - F_GKT1数据输入输出.cs - Designer - - - F_GKT1添加文件.cs - - - F_GKT1添加项目.cs - Form_EditTask.cs @@ -1836,12 +1789,6 @@ Frm_password_reset.cs - - GKT.cs - - - GKT1.cs - F_GKT数据输入输出.cs @@ -1934,9 +1881,6 @@ F_Projedit.cs - - PED.cs - F_数据输入输出.cs diff --git a/Cyberpipe.suo b/Cyberpipe.suo index 68ced4f..a1aecf8 100644 --- a/Cyberpipe.suo +++ b/Cyberpipe.suo Binary files differ diff --git a/EMS_Forms/Form_EditTask.cs b/EMS_Forms/Form_EditTask.cs index 718992f..f1d791f 100644 --- a/EMS_Forms/Form_EditTask.cs +++ b/EMS_Forms/Form_EditTask.cs @@ -119,7 +119,8 @@ String name = Convert.ToString(dr["USERNAME"]); comboBox_userName.Items.Add(name); - } + } + dr.Close(); comboBox_road.Items.Clear(); roadList = new List(); @@ -135,7 +136,7 @@ comboBox_road.Items.Add(name); } } - + dr1.Close(); conn.Close(); bool flag2 = false; @@ -185,7 +186,7 @@ catch (Exception ex) { - MessageBox.Show(ex.ToString()); + LogHelper.WriteLog(typeof(Form_EditTask), ex.Message); } } @@ -288,7 +289,7 @@ } catch (Exception ex) { - MessageBox.Show(ex.ToString()); + LogHelper.WriteLog(typeof(Form_EditTask), ex.Message); } } @@ -474,7 +475,7 @@ } catch (Exception ex) { - MessageBox.Show(ex.ToString()); + LogHelper.WriteLog(typeof(Form_EditTask), ex.Message); } this.Close(); @@ -495,6 +496,7 @@ { numList.Add(Convert.ToInt32(dr["DBID"])); } + dr.Close(); if (numList.Count == 0) { taskNumber = Convert.ToInt32(number) * 100; @@ -674,6 +676,7 @@ } } } + dr.Close(); conn.Close(); } diff --git a/EMS_Forms/Form_EventManager.cs b/EMS_Forms/Form_EventManager.cs index b18c45b..84807b2 100644 --- a/EMS_Forms/Form_EventManager.cs +++ b/EMS_Forms/Form_EventManager.cs @@ -64,6 +64,7 @@ comboBox_name.Items.Add(name); } + dr.Close(); conn.Close(); diff --git a/Forms/FrmMnModify.cs b/Forms/FrmMnModify.cs index 31cfc5f..d036360 100644 --- a/Forms/FrmMnModify.cs +++ b/Forms/FrmMnModify.cs @@ -68,15 +68,7 @@ questionGrid.Rows[idx].Cells[1].Value = sr.question; } } - /// 选中对象 - /// - /// - /// - /// - private void buttonX1_Click(object sender, EventArgs e) - { - globecontrol.Globe.Action = EnumAction3D.SelectObject; - } + /// /// 选中某一行 /// diff --git a/Forms/FrmPipelineModelDataBase.cs b/Forms/FrmPipelineModelDataBase.cs index 2acf0ca..7ce573f 100644 --- a/Forms/FrmPipelineModelDataBase.cs +++ b/Forms/FrmPipelineModelDataBase.cs @@ -35,19 +35,7 @@ ds = _ds; InitializeComponent(); } - /// - /// 单击选择shp格式文件 - /// - /// - /// - private void btnBrowseModel_Click(object sender, EventArgs e) - { - saveFileDialog1.Filter = "*.lgd|*.lgd"; - if (saveFileDialog1.ShowDialog() == DialogResult.OK) - { - txtModelLayer.Text = saveFileDialog1.FileName; - } - } + /// /// 窗体初始化事件处理 /// @@ -100,49 +88,6 @@ } } } - - private object convertFieldValue(string fieldname, object obj) - { - if (obj == null) - return null; - - try - { - string type = fields_types[fieldname].ToString(); - switch (type) - { - case "string": - return obj.ToString(); - case "int": - //return 101; - int intResult; - if (int.TryParse(obj.ToString(), out intResult)) - return intResult; - else - return null; - case "double": - //return 202.5; - double doubleResult; - if (double.TryParse(obj.ToString(), out doubleResult)) - return doubleResult; - else - return null; - case "date": - DateTime dtResult; - if (DateTime.TryParse(obj.ToString(), out dtResult)) - return dtResult; - else - return null; - } - return null; - } - catch (Exception ex) - { - MessageBox.Show(ex.ToString()); - return null; - } - } - public string lgdFilePath = ""; /// /// 选择管线颜色 @@ -610,33 +555,6 @@ { this.Close(); } - - private void cmbLayer_SelectedIndexChanged(object sender, EventArgs e) //选择图层 - { - GSOLayer layer = ctl.Globe.Layers.GetLayerByCaption(selectLayerName); - GSOFeatures features = layer.GetAllFeatures(); - if (features.Length == 0) - return; - - cmbFrom.Items.Clear(); - cmbTo.Items.Clear(); - cmbRadius.Items.Clear(); - cmbID.Items.Clear(); - for (int i = 0; i < features[0].GetFieldCount(); i++) - { - GeoScene.Data.GSOFieldDefn fielddef = (GeoScene.Data.GSOFieldDefn)(features[0].GetFieldDefn(i)); - - cmbFrom.Items.Add(fielddef.Name); - cmbTo.Items.Add(fielddef.Name); - cmbRadius.Items.Add(fielddef.Name); - cmbID.Items.Add(fielddef.Name); - } - cmbFrom.SelectedItem = "Deep1"; - cmbTo.SelectedItem = "Deep2"; - cmbRadius.SelectedItem = "Diameter"; - cmbID.SelectedItem = "Handle"; - } - private void buttonXLayerPath_Click(object sender, EventArgs e)//单击 选择shp格式的文件 { OpenFileDialog dlg = new OpenFileDialog(); diff --git a/Forms/FrmPipelineModelDataOneStep.cs b/Forms/FrmPipelineModelDataOneStep.cs index 18afda7..ec93b8a 100644 --- a/Forms/FrmPipelineModelDataOneStep.cs +++ b/Forms/FrmPipelineModelDataOneStep.cs @@ -38,19 +38,7 @@ layerTree = _layerTree; InitializeComponent(); } - /// - /// 单击选择shp格式文件 - /// - /// - /// - private void btnBrowseModel_Click(object sender, EventArgs e) - { - saveFileDialog1.Filter = "*.lgd|*.lgd"; - if (saveFileDialog1.ShowDialog() == DialogResult.OK) - { - txtModelLayer.Text = saveFileDialog1.FileName; - } - } + /// /// 窗体初始化事件处理 /// @@ -107,48 +95,7 @@ } } - private object convertFieldValue(string fieldname, object obj) - { - if (obj == null) - return null; - - try - { - string type = fields_types[fieldname].ToString(); - switch (type) - { - case "string": - return obj.ToString(); - case "int": - //return 101; - int intResult; - if (int.TryParse(obj.ToString(), out intResult)) - return intResult; - else - return null; - case "double": - //return 202.5; - double doubleResult; - if (double.TryParse(obj.ToString(), out doubleResult)) - return doubleResult; - else - return null; - case "date": - DateTime dtResult; - if (DateTime.TryParse(obj.ToString(), out dtResult)) - return dtResult; - else - return null; - } - return null; - } - catch (Exception ex) - { - MessageBox.Show(ex.ToString()); - return null; - } - } - + public string lgdFilePath = ""; /// /// 选择管线颜色 @@ -673,32 +620,6 @@ return featDs; } - private void cmbLayer_SelectedIndexChanged(object sender, EventArgs e) //选择图层 - { - GSOLayer layer = ctl.Globe.Layers.GetLayerByCaption(selectLayerName); - GSOFeatures features = layer.GetAllFeatures(); - if (features.Length == 0) - return; - - cmbFrom.Items.Clear(); - cmbTo.Items.Clear(); - cmbRadius.Items.Clear(); - cmbID.Items.Clear(); - for (int i = 0; i < features[0].GetFieldCount(); i++) - { - GeoScene.Data.GSOFieldDefn fielddef = (GeoScene.Data.GSOFieldDefn)(features[0].GetFieldDefn(i)); - - cmbFrom.Items.Add(fielddef.Name); - cmbTo.Items.Add(fielddef.Name); - cmbRadius.Items.Add(fielddef.Name); - cmbID.Items.Add(fielddef.Name); - } - cmbFrom.SelectedItem = "Deep1"; - cmbTo.SelectedItem = "Deep2"; - cmbRadius.SelectedItem = "Diameter"; - cmbID.SelectedItem = "Handle"; - } - private void buttonXLayerPath_Click(object sender, EventArgs e)//单击 选择shp格式的文件 { OpenFileDialog dlg = new OpenFileDialog(); @@ -949,38 +870,6 @@ } //txtLayername.Text = type + layername; } - /// - /// 连接数据库 - /// - /// - /// - private void buttonX1_Click(object sender, EventArgs e) - { - if (ds == null) - { - //没连的话,直接连接审核库; //审核库配置读配置文件 - string dbIp = Utility.sgdbip; - string database = Utility.sgdbname; - string user = Utility.sgdbuser; - string pass = Utility.sgdbpwd; - - if (!Utility.isNetworkConnectionSuccess(dbIp.Trim())) - { - MessageBox.Show("网络连接失败!", "提示"); - return; - } - - ds = ctl.Globe.DataManager.OpenOracleDataSource(dbIp + "/" + database, "", "", user, pass); - if (ds == null) - { - MessageBox.Show("数据库连接失败!", "提示", MessageBoxButtons.OK, MessageBoxIcon.Warning); - } - else - { - btnCreateModel.Enabled = true; - } - } - } private void btnClose_Click(object sender, EventArgs e) { diff --git a/Forms/FrmShRK.cs b/Forms/FrmShRK.cs index 0e2e722..f1d83cb 100644 --- a/Forms/FrmShRK.cs +++ b/Forms/FrmShRK.cs @@ -215,6 +215,7 @@ { sourcefeatds = sourcefeat as GSOFeatureDataset; } + if (sourcefeatds == null) return; sourcefeatds.Open(); GSOFeatures sourcefeatures = sourcefeatds.GetAllFeatures(); @@ -251,6 +252,7 @@ { desfeatds = desfeat as GSOFeatureDataset; } + if (desfeatds == null) return; desfeatds.Open(); //向新数据集写入字段 diff --git a/FrmAccessoriesSensor.cs b/FrmAccessoriesSensor.cs index 09fcdf1..2a7a80e 100644 --- a/FrmAccessoriesSensor.cs +++ b/FrmAccessoriesSensor.cs @@ -209,7 +209,7 @@ chart1.Series[0].Points.DataBindXY(dic.Keys, dic.Values); for (int m = 0; m < dic.Values.Count; m++) { - if (chart1.Series[0].Points[m].YValues[0].ToString() != "0") + if (chart1.Series[0].Points[m]!=null&&chart1.Series[0].Points[m].YValues[0].ToString() != "0") { chart1.Series[0].Points[m].Label = chart1.Series[0].Points[m].YValues[0].ToString(); } diff --git a/FrmAccessoriesgather.cs b/FrmAccessoriesgather.cs index 9e331e1..a475d9e 100644 --- a/FrmAccessoriesgather.cs +++ b/FrmAccessoriesgather.cs @@ -338,7 +338,7 @@ chart1.Series[0].Points.DataBindXY(dic.Keys, dic.Values); for (int m = 0; m < dic.Values.Count; m++) { - if (chart1.Series[0].Points[m].YValues[0].ToString() != "0") + if (chart1.Series[0].Points[m]!=null&&chart1.Series[0].Points[m].YValues[0].ToString() != "0") { chart1.Series[0].Points[m].Label = chart1.Series[0].Points[m].YValues[0].ToString(); } diff --git a/FrmAccessoryAnalysis.cs b/FrmAccessoryAnalysis.cs index 71d4579..44d4065 100644 --- a/FrmAccessoryAnalysis.cs +++ b/FrmAccessoryAnalysis.cs @@ -66,39 +66,6 @@ globeControl1.Refresh(); } /// - /// 键盘按键按下事件处理 - /// - /// - /// - private void txtRadius_KeyPress(object sender, KeyPressEventArgs e) - { - TextBox text = sender as TextBox; - if ((e.KeyChar < 48 || e.KeyChar > 57) && (e.KeyChar != 8) && (int)e.KeyChar != 46) - { - e.Handled = true; - } - if ((int)e.KeyChar == 46) //小数点 - { - if (text.Text.Length <= 0) - e.Handled = true; //小数点不能在第一位 - else //处理不规则的小数点 - { - float f; - float oldf; - bool b1 = false, b2 = false; - b1 = float.TryParse(text.Text, out oldf); - b2 = float.TryParse(text.Text + e.KeyChar.ToString(), out f); - if (b2 == false) - { - if (b1 == true) - e.Handled = true; - else - e.Handled = false; - } - } - } - } - /// /// 确定按钮事件处理 /// /// diff --git a/FrmAddValve.cs b/FrmAddValve.cs index 34d2fec..5f405b9 100644 --- a/FrmAddValve.cs +++ b/FrmAddValve.cs @@ -486,56 +486,6 @@ } } - - - - - - - - private void cmbLayer_SelectedIndexChanged(object sender, EventArgs e) - { - GSOLayer layer = globeControl1.Globe.Layers.GetLayerByCaption(selectLayerName); - GSOFeatures features = layer.GetAllFeatures(); - if (features.Length == 0) - return; - - combPath.Items.Clear(); - combZ.Items.Clear(); - combModelName.Items.Clear(); - - for (int i = 0; i < features[0].GetFieldCount(); i++) - { - GeoScene.Data.GSOFieldDefn fielddef = (GeoScene.Data.GSOFieldDefn)(features[0].GetFieldDefn(i)); - combPath.Items.Add(fielddef.Name); - combZ.Items.Add(fielddef.Name); - combModelName.Items.Add(fielddef.Name); - } - combModelName.SelectedItem = "编号"; - combPath.SelectedItem = "模型路径"; - if (combfile.SelectedIndex != -1) - { - - string layerCaption = combfile.SelectedItem.ToString().Trim(); - rukuLayer = globeControl1.Globe.Layers.GetLayerByCaption(layerCaption); - if (rukuLayer != null) - { - combPath.Items.Clear(); - combZ.Items.Clear(); - combModelName.Items.Clear(); - - } - for (int i = 0; i < features[0].GetFieldCount(); i++) - { - GeoScene.Data.GSOFieldDefn fielddef = (GeoScene.Data.GSOFieldDefn)(features[0].GetFieldDefn(i)); - combPath.Items.Add(fielddef.Name); - combZ.Items.Add(fielddef.Name); - combModelName.Items.Add(fielddef.Name); - } - combModelName.SelectedItem = "编号"; - combPath.SelectedItem = "模型路径"; - } - } /// /// 单击选择shp格式文件 /// diff --git a/FrmAddWellShp.cs b/FrmAddWellShp.cs index bb79ec0..a249725 100644 --- a/FrmAddWellShp.cs +++ b/FrmAddWellShp.cs @@ -478,32 +478,6 @@ } } } - - private void cmbLayer_SelectedIndexChanged(object sender, EventArgs e) - { - GSOLayer layer = globeControl1.Globe.Layers.GetLayerByCaption(selectLayerName); - GSOFeatures features = layer.GetAllFeatures(); - if (features.Length == 0) - return; - - combCode.Items.Clear(); - combDeep.Items.Clear(); - combModelName.Items.Clear(); - combAngle.Items.Clear(); - - for (int i = 0; i < features[0].GetFieldCount(); i++) - { - GeoScene.Data.GSOFieldDefn fielddef = (GeoScene.Data.GSOFieldDefn)(features[0].GetFieldDefn(i)); - combCode.Items.Add(fielddef.Name); - combDeep.Items.Add(fielddef.Name); - combModelName.Items.Add(fielddef.Name); - combAngle.Items.Add(fielddef.Name); - } - combCode.SelectedItem = "附属物编码"; - combDeep.SelectedItem = "井深"; - combModelName.SelectedItem = "编号"; - combAngle.SelectedItem = "符号角度"; - } /// /// 单击选择shp格式文件 /// diff --git a/FrmAddYuBiZiShp.cs b/FrmAddYuBiZiShp.cs index b312d51..332f037 100644 --- a/FrmAddYuBiZiShp.cs +++ b/FrmAddYuBiZiShp.cs @@ -383,80 +383,7 @@ } } - private void cmbLayer_SelectedIndexChanged(object sender, EventArgs e) - { - GSOLayer layer = globeControl1.Globe.Layers.GetLayerByCaption(selectLayerName); - GSOFeatures features = layer.GetAllFeatures(); - if (features.Length == 0) - return; - - combCode.Items.Clear(); - combDeep.Items.Clear(); - combModelName.Items.Clear(); - //comboLoad.Items.Clear(); - for (int i = 0; i < features[0].GetFieldCount(); i++) - { - GeoScene.Data.GSOFieldDefn fielddef = (GeoScene.Data.GSOFieldDefn)(features[0].GetFieldDefn(i)); - combCode.Items.Add(fielddef.Name); - combDeep.Items.Add(fielddef.Name); - combModelName.Items.Add(fielddef.Name); - //comboLoad.Items.Add(fielddef.Name); - } - combCode.SelectedItem = "附属物编码"; - combDeep.SelectedItem = "Z坐标"; - combModelName.SelectedItem = "编号"; - //comboLoad.SelectedItem = "模型路径"; - } - - private void buttonXLayerPath_Click(object sender, EventArgs e) - { - OpenFileDialog dlg = new OpenFileDialog(); - dlg.Filter = "*.shp|*.shp"; - dlg.Multiselect = false; - if (dlg.ShowDialog() == DialogResult.OK) - { - GSOLayer layer = globeControl1.Globe.Layers.Add(dlg.FileName); - string txtMessage = valiYBdata(layer); - if (txtMessage != "") - { - button3.Enabled = false; - //textBoxLayer.Text = ""; - combCode.Items.Clear(); - combDeep.Items.Clear(); - combModelName.Items.Clear(); - globeControl1.Globe.Layers.Remove(layer); - FrmValiDataShowErrorMessage showErrorMessage = new FrmValiDataShowErrorMessage(dlg.FileName, txtMessage); - showErrorMessage.ShowDialog(); - return; - } - else - { - button3.Enabled = true; - //textBoxLayer.Text = dlg.FileName; - selectLayerName = layer.Caption; - txtLayerName.Text = layer.Caption; - GSOFeatures features = layer.GetAllFeatures(); - if (features.Length == 0) - return; - - combCode.Items.Clear(); - combDeep.Items.Clear(); - combModelName.Items.Clear(); - for (int i = 0; i < features[0].GetFieldCount(); i++) - { - GeoScene.Data.GSOFieldDefn fielddef = (GeoScene.Data.GSOFieldDefn)(features[0].GetFieldDefn(i)); - combCode.Items.Add(fielddef.Name); - combDeep.Items.Add(fielddef.Name); - combModelName.Items.Add(fielddef.Name); - //comboLoad.Items.Add(fielddef.Name); - } - combCode.SelectedItem = "管点编码"; - combDeep.SelectedItem = "Z坐标"; - combModelName.SelectedItem = "编号"; - } - } - } - + private void FrmAddYuBiZiShp_FormClosing(object sender, FormClosingEventArgs e) { globeControl1.Globe.Refresh(); diff --git a/FrmAllPipelineStatis.cs b/FrmAllPipelineStatis.cs index 6421a26..a6eea29 100644 --- a/FrmAllPipelineStatis.cs +++ b/FrmAllPipelineStatis.cs @@ -84,7 +84,7 @@ chartAllAreaPipeline.Series["管线"].Points.DataBindXY(pipelineLengthAndType.Keys, pipelineLengthAndType.Values); for (int m = 0; m < pipelineLengthAndType.Values.Count; m++) { - if (chartAllAreaPipeline.Series["管线"].Points[m].YValues[0].ToString() != "0") + if (chartAllAreaPipeline.Series["管线"].Points[m]!=null&&chartAllAreaPipeline.Series["管线"].Points[m].YValues[0].ToString() != "0") { chartAllAreaPipeline.Series["管线"].Points[m].Label = chartAllAreaPipeline.Series[0].Points[m].YValues[0].ToString(); } @@ -94,7 +94,7 @@ } catch (Exception ex) { - //LogError.PublishError(ex); + LogHelper.WriteLog(typeof(FrmAllPipelineStatis), ex.Message); } } @@ -147,7 +147,7 @@ } DataTable dt = OledbHelper.QueryTable(sql); - if (dt != null && dt.Rows.Count > 0) + if (dt != null && dt.Rows.Count > 0 && chartAllAreaPipeline.Series["管线"].Points[indexHit]!=null) { dataGridViewX1.DataSource = dt; panel.Visible = true; diff --git a/FrmAllWorkWellStatis.cs b/FrmAllWorkWellStatis.cs index 6fec7af..6af8e4c 100644 --- a/FrmAllWorkWellStatis.cs +++ b/FrmAllWorkWellStatis.cs @@ -52,7 +52,7 @@ chartAllAreaPipeline.Series["井盖"].Points.DataBindXY(workWellLengthAndType.Keys, workWellLengthAndType.Values); for (int m = 0; m < workWellLengthAndType.Values.Count; m++) { - if (chartAllAreaPipeline.Series["井盖"].Points[m].YValues[0].ToString().Trim() != "0") + if (chartAllAreaPipeline.Series["井盖"].Points[m]!=null&&chartAllAreaPipeline.Series["井盖"].Points[m].YValues[0].ToString().Trim() != "0") { chartAllAreaPipeline.Series["井盖"].Points[m].Label = chartAllAreaPipeline.Series[0].Points[m].YValues[0].ToString(); } @@ -60,7 +60,7 @@ } catch (Exception ex) { - //LogError.PublishError(ex); + LogHelper.WriteLog(typeof(FrmAllWorkWellStatis), ex.Message); } } diff --git a/FrmBSQDuoBianXingStatis.cs b/FrmBSQDuoBianXingStatis.cs index e8b7d52..3e889b6 100644 --- a/FrmBSQDuoBianXingStatis.cs +++ b/FrmBSQDuoBianXingStatis.cs @@ -60,7 +60,7 @@ { for (int m = 0; m < bsq1.Values.Count; m++) { - if (chart1.Series["标识器"].Points[m].YValues[0].ToString() != "0") + if (chart1.Series["标识器"].Points[m]!=null&&chart1.Series["标识器"].Points[m].YValues[0].ToString() != "0") { count += Convert.ToInt16(chart1.Series[0].Points[m].YValues[0].ToString()); chart1.Series["标识器"].Points[m].Label = chart1.Series[0].Points[m].YValues[0].ToString(); diff --git a/Cyberpipe.csproj b/Cyberpipe.csproj index 07a8c1a..e3cd12c 100644 --- a/Cyberpipe.csproj +++ b/Cyberpipe.csproj @@ -204,25 +204,6 @@ - - Form - - - F_GKT1数据输入输出.cs - - - Form - - - F_GKT1添加文件.cs - - - Form - - - F_GKT1添加项目.cs - - Form @@ -1068,18 +1049,6 @@ Frm_password_reset.cs - - Form - - - GKT.cs - - - Form - - - GKT1.cs - Form @@ -1258,12 +1227,6 @@ F_Projedit.cs - - Form - - - PED.cs - Form @@ -1331,16 +1294,6 @@ True Reference.map - - F_GKT1数据输入输出.cs - Designer - - - F_GKT1添加文件.cs - - - F_GKT1添加项目.cs - Form_EditTask.cs @@ -1836,12 +1789,6 @@ Frm_password_reset.cs - - GKT.cs - - - GKT1.cs - F_GKT数据输入输出.cs @@ -1934,9 +1881,6 @@ F_Projedit.cs - - PED.cs - F_数据输入输出.cs diff --git a/Cyberpipe.suo b/Cyberpipe.suo index 68ced4f..a1aecf8 100644 --- a/Cyberpipe.suo +++ b/Cyberpipe.suo Binary files differ diff --git a/EMS_Forms/Form_EditTask.cs b/EMS_Forms/Form_EditTask.cs index 718992f..f1d791f 100644 --- a/EMS_Forms/Form_EditTask.cs +++ b/EMS_Forms/Form_EditTask.cs @@ -119,7 +119,8 @@ String name = Convert.ToString(dr["USERNAME"]); comboBox_userName.Items.Add(name); - } + } + dr.Close(); comboBox_road.Items.Clear(); roadList = new List(); @@ -135,7 +136,7 @@ comboBox_road.Items.Add(name); } } - + dr1.Close(); conn.Close(); bool flag2 = false; @@ -185,7 +186,7 @@ catch (Exception ex) { - MessageBox.Show(ex.ToString()); + LogHelper.WriteLog(typeof(Form_EditTask), ex.Message); } } @@ -288,7 +289,7 @@ } catch (Exception ex) { - MessageBox.Show(ex.ToString()); + LogHelper.WriteLog(typeof(Form_EditTask), ex.Message); } } @@ -474,7 +475,7 @@ } catch (Exception ex) { - MessageBox.Show(ex.ToString()); + LogHelper.WriteLog(typeof(Form_EditTask), ex.Message); } this.Close(); @@ -495,6 +496,7 @@ { numList.Add(Convert.ToInt32(dr["DBID"])); } + dr.Close(); if (numList.Count == 0) { taskNumber = Convert.ToInt32(number) * 100; @@ -674,6 +676,7 @@ } } } + dr.Close(); conn.Close(); } diff --git a/EMS_Forms/Form_EventManager.cs b/EMS_Forms/Form_EventManager.cs index b18c45b..84807b2 100644 --- a/EMS_Forms/Form_EventManager.cs +++ b/EMS_Forms/Form_EventManager.cs @@ -64,6 +64,7 @@ comboBox_name.Items.Add(name); } + dr.Close(); conn.Close(); diff --git a/Forms/FrmMnModify.cs b/Forms/FrmMnModify.cs index 31cfc5f..d036360 100644 --- a/Forms/FrmMnModify.cs +++ b/Forms/FrmMnModify.cs @@ -68,15 +68,7 @@ questionGrid.Rows[idx].Cells[1].Value = sr.question; } } - /// 选中对象 - /// - /// - /// - /// - private void buttonX1_Click(object sender, EventArgs e) - { - globecontrol.Globe.Action = EnumAction3D.SelectObject; - } + /// /// 选中某一行 /// diff --git a/Forms/FrmPipelineModelDataBase.cs b/Forms/FrmPipelineModelDataBase.cs index 2acf0ca..7ce573f 100644 --- a/Forms/FrmPipelineModelDataBase.cs +++ b/Forms/FrmPipelineModelDataBase.cs @@ -35,19 +35,7 @@ ds = _ds; InitializeComponent(); } - /// - /// 单击选择shp格式文件 - /// - /// - /// - private void btnBrowseModel_Click(object sender, EventArgs e) - { - saveFileDialog1.Filter = "*.lgd|*.lgd"; - if (saveFileDialog1.ShowDialog() == DialogResult.OK) - { - txtModelLayer.Text = saveFileDialog1.FileName; - } - } + /// /// 窗体初始化事件处理 /// @@ -100,49 +88,6 @@ } } } - - private object convertFieldValue(string fieldname, object obj) - { - if (obj == null) - return null; - - try - { - string type = fields_types[fieldname].ToString(); - switch (type) - { - case "string": - return obj.ToString(); - case "int": - //return 101; - int intResult; - if (int.TryParse(obj.ToString(), out intResult)) - return intResult; - else - return null; - case "double": - //return 202.5; - double doubleResult; - if (double.TryParse(obj.ToString(), out doubleResult)) - return doubleResult; - else - return null; - case "date": - DateTime dtResult; - if (DateTime.TryParse(obj.ToString(), out dtResult)) - return dtResult; - else - return null; - } - return null; - } - catch (Exception ex) - { - MessageBox.Show(ex.ToString()); - return null; - } - } - public string lgdFilePath = ""; /// /// 选择管线颜色 @@ -610,33 +555,6 @@ { this.Close(); } - - private void cmbLayer_SelectedIndexChanged(object sender, EventArgs e) //选择图层 - { - GSOLayer layer = ctl.Globe.Layers.GetLayerByCaption(selectLayerName); - GSOFeatures features = layer.GetAllFeatures(); - if (features.Length == 0) - return; - - cmbFrom.Items.Clear(); - cmbTo.Items.Clear(); - cmbRadius.Items.Clear(); - cmbID.Items.Clear(); - for (int i = 0; i < features[0].GetFieldCount(); i++) - { - GeoScene.Data.GSOFieldDefn fielddef = (GeoScene.Data.GSOFieldDefn)(features[0].GetFieldDefn(i)); - - cmbFrom.Items.Add(fielddef.Name); - cmbTo.Items.Add(fielddef.Name); - cmbRadius.Items.Add(fielddef.Name); - cmbID.Items.Add(fielddef.Name); - } - cmbFrom.SelectedItem = "Deep1"; - cmbTo.SelectedItem = "Deep2"; - cmbRadius.SelectedItem = "Diameter"; - cmbID.SelectedItem = "Handle"; - } - private void buttonXLayerPath_Click(object sender, EventArgs e)//单击 选择shp格式的文件 { OpenFileDialog dlg = new OpenFileDialog(); diff --git a/Forms/FrmPipelineModelDataOneStep.cs b/Forms/FrmPipelineModelDataOneStep.cs index 18afda7..ec93b8a 100644 --- a/Forms/FrmPipelineModelDataOneStep.cs +++ b/Forms/FrmPipelineModelDataOneStep.cs @@ -38,19 +38,7 @@ layerTree = _layerTree; InitializeComponent(); } - /// - /// 单击选择shp格式文件 - /// - /// - /// - private void btnBrowseModel_Click(object sender, EventArgs e) - { - saveFileDialog1.Filter = "*.lgd|*.lgd"; - if (saveFileDialog1.ShowDialog() == DialogResult.OK) - { - txtModelLayer.Text = saveFileDialog1.FileName; - } - } + /// /// 窗体初始化事件处理 /// @@ -107,48 +95,7 @@ } } - private object convertFieldValue(string fieldname, object obj) - { - if (obj == null) - return null; - - try - { - string type = fields_types[fieldname].ToString(); - switch (type) - { - case "string": - return obj.ToString(); - case "int": - //return 101; - int intResult; - if (int.TryParse(obj.ToString(), out intResult)) - return intResult; - else - return null; - case "double": - //return 202.5; - double doubleResult; - if (double.TryParse(obj.ToString(), out doubleResult)) - return doubleResult; - else - return null; - case "date": - DateTime dtResult; - if (DateTime.TryParse(obj.ToString(), out dtResult)) - return dtResult; - else - return null; - } - return null; - } - catch (Exception ex) - { - MessageBox.Show(ex.ToString()); - return null; - } - } - + public string lgdFilePath = ""; /// /// 选择管线颜色 @@ -673,32 +620,6 @@ return featDs; } - private void cmbLayer_SelectedIndexChanged(object sender, EventArgs e) //选择图层 - { - GSOLayer layer = ctl.Globe.Layers.GetLayerByCaption(selectLayerName); - GSOFeatures features = layer.GetAllFeatures(); - if (features.Length == 0) - return; - - cmbFrom.Items.Clear(); - cmbTo.Items.Clear(); - cmbRadius.Items.Clear(); - cmbID.Items.Clear(); - for (int i = 0; i < features[0].GetFieldCount(); i++) - { - GeoScene.Data.GSOFieldDefn fielddef = (GeoScene.Data.GSOFieldDefn)(features[0].GetFieldDefn(i)); - - cmbFrom.Items.Add(fielddef.Name); - cmbTo.Items.Add(fielddef.Name); - cmbRadius.Items.Add(fielddef.Name); - cmbID.Items.Add(fielddef.Name); - } - cmbFrom.SelectedItem = "Deep1"; - cmbTo.SelectedItem = "Deep2"; - cmbRadius.SelectedItem = "Diameter"; - cmbID.SelectedItem = "Handle"; - } - private void buttonXLayerPath_Click(object sender, EventArgs e)//单击 选择shp格式的文件 { OpenFileDialog dlg = new OpenFileDialog(); @@ -949,38 +870,6 @@ } //txtLayername.Text = type + layername; } - /// - /// 连接数据库 - /// - /// - /// - private void buttonX1_Click(object sender, EventArgs e) - { - if (ds == null) - { - //没连的话,直接连接审核库; //审核库配置读配置文件 - string dbIp = Utility.sgdbip; - string database = Utility.sgdbname; - string user = Utility.sgdbuser; - string pass = Utility.sgdbpwd; - - if (!Utility.isNetworkConnectionSuccess(dbIp.Trim())) - { - MessageBox.Show("网络连接失败!", "提示"); - return; - } - - ds = ctl.Globe.DataManager.OpenOracleDataSource(dbIp + "/" + database, "", "", user, pass); - if (ds == null) - { - MessageBox.Show("数据库连接失败!", "提示", MessageBoxButtons.OK, MessageBoxIcon.Warning); - } - else - { - btnCreateModel.Enabled = true; - } - } - } private void btnClose_Click(object sender, EventArgs e) { diff --git a/Forms/FrmShRK.cs b/Forms/FrmShRK.cs index 0e2e722..f1d83cb 100644 --- a/Forms/FrmShRK.cs +++ b/Forms/FrmShRK.cs @@ -215,6 +215,7 @@ { sourcefeatds = sourcefeat as GSOFeatureDataset; } + if (sourcefeatds == null) return; sourcefeatds.Open(); GSOFeatures sourcefeatures = sourcefeatds.GetAllFeatures(); @@ -251,6 +252,7 @@ { desfeatds = desfeat as GSOFeatureDataset; } + if (desfeatds == null) return; desfeatds.Open(); //向新数据集写入字段 diff --git a/FrmAccessoriesSensor.cs b/FrmAccessoriesSensor.cs index 09fcdf1..2a7a80e 100644 --- a/FrmAccessoriesSensor.cs +++ b/FrmAccessoriesSensor.cs @@ -209,7 +209,7 @@ chart1.Series[0].Points.DataBindXY(dic.Keys, dic.Values); for (int m = 0; m < dic.Values.Count; m++) { - if (chart1.Series[0].Points[m].YValues[0].ToString() != "0") + if (chart1.Series[0].Points[m]!=null&&chart1.Series[0].Points[m].YValues[0].ToString() != "0") { chart1.Series[0].Points[m].Label = chart1.Series[0].Points[m].YValues[0].ToString(); } diff --git a/FrmAccessoriesgather.cs b/FrmAccessoriesgather.cs index 9e331e1..a475d9e 100644 --- a/FrmAccessoriesgather.cs +++ b/FrmAccessoriesgather.cs @@ -338,7 +338,7 @@ chart1.Series[0].Points.DataBindXY(dic.Keys, dic.Values); for (int m = 0; m < dic.Values.Count; m++) { - if (chart1.Series[0].Points[m].YValues[0].ToString() != "0") + if (chart1.Series[0].Points[m]!=null&&chart1.Series[0].Points[m].YValues[0].ToString() != "0") { chart1.Series[0].Points[m].Label = chart1.Series[0].Points[m].YValues[0].ToString(); } diff --git a/FrmAccessoryAnalysis.cs b/FrmAccessoryAnalysis.cs index 71d4579..44d4065 100644 --- a/FrmAccessoryAnalysis.cs +++ b/FrmAccessoryAnalysis.cs @@ -66,39 +66,6 @@ globeControl1.Refresh(); } /// - /// 键盘按键按下事件处理 - /// - /// - /// - private void txtRadius_KeyPress(object sender, KeyPressEventArgs e) - { - TextBox text = sender as TextBox; - if ((e.KeyChar < 48 || e.KeyChar > 57) && (e.KeyChar != 8) && (int)e.KeyChar != 46) - { - e.Handled = true; - } - if ((int)e.KeyChar == 46) //小数点 - { - if (text.Text.Length <= 0) - e.Handled = true; //小数点不能在第一位 - else //处理不规则的小数点 - { - float f; - float oldf; - bool b1 = false, b2 = false; - b1 = float.TryParse(text.Text, out oldf); - b2 = float.TryParse(text.Text + e.KeyChar.ToString(), out f); - if (b2 == false) - { - if (b1 == true) - e.Handled = true; - else - e.Handled = false; - } - } - } - } - /// /// 确定按钮事件处理 /// /// diff --git a/FrmAddValve.cs b/FrmAddValve.cs index 34d2fec..5f405b9 100644 --- a/FrmAddValve.cs +++ b/FrmAddValve.cs @@ -486,56 +486,6 @@ } } - - - - - - - - private void cmbLayer_SelectedIndexChanged(object sender, EventArgs e) - { - GSOLayer layer = globeControl1.Globe.Layers.GetLayerByCaption(selectLayerName); - GSOFeatures features = layer.GetAllFeatures(); - if (features.Length == 0) - return; - - combPath.Items.Clear(); - combZ.Items.Clear(); - combModelName.Items.Clear(); - - for (int i = 0; i < features[0].GetFieldCount(); i++) - { - GeoScene.Data.GSOFieldDefn fielddef = (GeoScene.Data.GSOFieldDefn)(features[0].GetFieldDefn(i)); - combPath.Items.Add(fielddef.Name); - combZ.Items.Add(fielddef.Name); - combModelName.Items.Add(fielddef.Name); - } - combModelName.SelectedItem = "编号"; - combPath.SelectedItem = "模型路径"; - if (combfile.SelectedIndex != -1) - { - - string layerCaption = combfile.SelectedItem.ToString().Trim(); - rukuLayer = globeControl1.Globe.Layers.GetLayerByCaption(layerCaption); - if (rukuLayer != null) - { - combPath.Items.Clear(); - combZ.Items.Clear(); - combModelName.Items.Clear(); - - } - for (int i = 0; i < features[0].GetFieldCount(); i++) - { - GeoScene.Data.GSOFieldDefn fielddef = (GeoScene.Data.GSOFieldDefn)(features[0].GetFieldDefn(i)); - combPath.Items.Add(fielddef.Name); - combZ.Items.Add(fielddef.Name); - combModelName.Items.Add(fielddef.Name); - } - combModelName.SelectedItem = "编号"; - combPath.SelectedItem = "模型路径"; - } - } /// /// 单击选择shp格式文件 /// diff --git a/FrmAddWellShp.cs b/FrmAddWellShp.cs index bb79ec0..a249725 100644 --- a/FrmAddWellShp.cs +++ b/FrmAddWellShp.cs @@ -478,32 +478,6 @@ } } } - - private void cmbLayer_SelectedIndexChanged(object sender, EventArgs e) - { - GSOLayer layer = globeControl1.Globe.Layers.GetLayerByCaption(selectLayerName); - GSOFeatures features = layer.GetAllFeatures(); - if (features.Length == 0) - return; - - combCode.Items.Clear(); - combDeep.Items.Clear(); - combModelName.Items.Clear(); - combAngle.Items.Clear(); - - for (int i = 0; i < features[0].GetFieldCount(); i++) - { - GeoScene.Data.GSOFieldDefn fielddef = (GeoScene.Data.GSOFieldDefn)(features[0].GetFieldDefn(i)); - combCode.Items.Add(fielddef.Name); - combDeep.Items.Add(fielddef.Name); - combModelName.Items.Add(fielddef.Name); - combAngle.Items.Add(fielddef.Name); - } - combCode.SelectedItem = "附属物编码"; - combDeep.SelectedItem = "井深"; - combModelName.SelectedItem = "编号"; - combAngle.SelectedItem = "符号角度"; - } /// /// 单击选择shp格式文件 /// diff --git a/FrmAddYuBiZiShp.cs b/FrmAddYuBiZiShp.cs index b312d51..332f037 100644 --- a/FrmAddYuBiZiShp.cs +++ b/FrmAddYuBiZiShp.cs @@ -383,80 +383,7 @@ } } - private void cmbLayer_SelectedIndexChanged(object sender, EventArgs e) - { - GSOLayer layer = globeControl1.Globe.Layers.GetLayerByCaption(selectLayerName); - GSOFeatures features = layer.GetAllFeatures(); - if (features.Length == 0) - return; - - combCode.Items.Clear(); - combDeep.Items.Clear(); - combModelName.Items.Clear(); - //comboLoad.Items.Clear(); - for (int i = 0; i < features[0].GetFieldCount(); i++) - { - GeoScene.Data.GSOFieldDefn fielddef = (GeoScene.Data.GSOFieldDefn)(features[0].GetFieldDefn(i)); - combCode.Items.Add(fielddef.Name); - combDeep.Items.Add(fielddef.Name); - combModelName.Items.Add(fielddef.Name); - //comboLoad.Items.Add(fielddef.Name); - } - combCode.SelectedItem = "附属物编码"; - combDeep.SelectedItem = "Z坐标"; - combModelName.SelectedItem = "编号"; - //comboLoad.SelectedItem = "模型路径"; - } - - private void buttonXLayerPath_Click(object sender, EventArgs e) - { - OpenFileDialog dlg = new OpenFileDialog(); - dlg.Filter = "*.shp|*.shp"; - dlg.Multiselect = false; - if (dlg.ShowDialog() == DialogResult.OK) - { - GSOLayer layer = globeControl1.Globe.Layers.Add(dlg.FileName); - string txtMessage = valiYBdata(layer); - if (txtMessage != "") - { - button3.Enabled = false; - //textBoxLayer.Text = ""; - combCode.Items.Clear(); - combDeep.Items.Clear(); - combModelName.Items.Clear(); - globeControl1.Globe.Layers.Remove(layer); - FrmValiDataShowErrorMessage showErrorMessage = new FrmValiDataShowErrorMessage(dlg.FileName, txtMessage); - showErrorMessage.ShowDialog(); - return; - } - else - { - button3.Enabled = true; - //textBoxLayer.Text = dlg.FileName; - selectLayerName = layer.Caption; - txtLayerName.Text = layer.Caption; - GSOFeatures features = layer.GetAllFeatures(); - if (features.Length == 0) - return; - - combCode.Items.Clear(); - combDeep.Items.Clear(); - combModelName.Items.Clear(); - for (int i = 0; i < features[0].GetFieldCount(); i++) - { - GeoScene.Data.GSOFieldDefn fielddef = (GeoScene.Data.GSOFieldDefn)(features[0].GetFieldDefn(i)); - combCode.Items.Add(fielddef.Name); - combDeep.Items.Add(fielddef.Name); - combModelName.Items.Add(fielddef.Name); - //comboLoad.Items.Add(fielddef.Name); - } - combCode.SelectedItem = "管点编码"; - combDeep.SelectedItem = "Z坐标"; - combModelName.SelectedItem = "编号"; - } - } - } - + private void FrmAddYuBiZiShp_FormClosing(object sender, FormClosingEventArgs e) { globeControl1.Globe.Refresh(); diff --git a/FrmAllPipelineStatis.cs b/FrmAllPipelineStatis.cs index 6421a26..a6eea29 100644 --- a/FrmAllPipelineStatis.cs +++ b/FrmAllPipelineStatis.cs @@ -84,7 +84,7 @@ chartAllAreaPipeline.Series["管线"].Points.DataBindXY(pipelineLengthAndType.Keys, pipelineLengthAndType.Values); for (int m = 0; m < pipelineLengthAndType.Values.Count; m++) { - if (chartAllAreaPipeline.Series["管线"].Points[m].YValues[0].ToString() != "0") + if (chartAllAreaPipeline.Series["管线"].Points[m]!=null&&chartAllAreaPipeline.Series["管线"].Points[m].YValues[0].ToString() != "0") { chartAllAreaPipeline.Series["管线"].Points[m].Label = chartAllAreaPipeline.Series[0].Points[m].YValues[0].ToString(); } @@ -94,7 +94,7 @@ } catch (Exception ex) { - //LogError.PublishError(ex); + LogHelper.WriteLog(typeof(FrmAllPipelineStatis), ex.Message); } } @@ -147,7 +147,7 @@ } DataTable dt = OledbHelper.QueryTable(sql); - if (dt != null && dt.Rows.Count > 0) + if (dt != null && dt.Rows.Count > 0 && chartAllAreaPipeline.Series["管线"].Points[indexHit]!=null) { dataGridViewX1.DataSource = dt; panel.Visible = true; diff --git a/FrmAllWorkWellStatis.cs b/FrmAllWorkWellStatis.cs index 6fec7af..6af8e4c 100644 --- a/FrmAllWorkWellStatis.cs +++ b/FrmAllWorkWellStatis.cs @@ -52,7 +52,7 @@ chartAllAreaPipeline.Series["井盖"].Points.DataBindXY(workWellLengthAndType.Keys, workWellLengthAndType.Values); for (int m = 0; m < workWellLengthAndType.Values.Count; m++) { - if (chartAllAreaPipeline.Series["井盖"].Points[m].YValues[0].ToString().Trim() != "0") + if (chartAllAreaPipeline.Series["井盖"].Points[m]!=null&&chartAllAreaPipeline.Series["井盖"].Points[m].YValues[0].ToString().Trim() != "0") { chartAllAreaPipeline.Series["井盖"].Points[m].Label = chartAllAreaPipeline.Series[0].Points[m].YValues[0].ToString(); } @@ -60,7 +60,7 @@ } catch (Exception ex) { - //LogError.PublishError(ex); + LogHelper.WriteLog(typeof(FrmAllWorkWellStatis), ex.Message); } } diff --git a/FrmBSQDuoBianXingStatis.cs b/FrmBSQDuoBianXingStatis.cs index e8b7d52..3e889b6 100644 --- a/FrmBSQDuoBianXingStatis.cs +++ b/FrmBSQDuoBianXingStatis.cs @@ -60,7 +60,7 @@ { for (int m = 0; m < bsq1.Values.Count; m++) { - if (chart1.Series["标识器"].Points[m].YValues[0].ToString() != "0") + if (chart1.Series["标识器"].Points[m]!=null&&chart1.Series["标识器"].Points[m].YValues[0].ToString() != "0") { count += Convert.ToInt16(chart1.Series[0].Points[m].YValues[0].ToString()); chart1.Series["标识器"].Points[m].Label = chart1.Series[0].Points[m].YValues[0].ToString(); diff --git a/FrmBSQDuoBianXingStreet.cs b/FrmBSQDuoBianXingStreet.cs index 2005ebb..1db5777 100644 --- a/FrmBSQDuoBianXingStreet.cs +++ b/FrmBSQDuoBianXingStreet.cs @@ -63,7 +63,7 @@ chartStatis.Series[0].Points.DataBindXY(bsq.Keys, bsq.Values); for (int m = 0; m < bsq.Values.Count; m++) { - if (chartStatis.Series[0].Points[m].YValues[0].ToString().Trim() != "0") + if (chartStatis.Series[0].Points[m]!=null&&chartStatis.Series[0].Points[m].YValues[0].ToString().Trim() != "0") { count += Convert.ToInt16(chartStatis.Series[0].Points[m].YValues[0].ToString()); chartStatis.Series[0].Points[m].Label = chartStatis.Series[0].Points[m].YValues[0].ToString(); diff --git a/Cyberpipe.csproj b/Cyberpipe.csproj index 07a8c1a..e3cd12c 100644 --- a/Cyberpipe.csproj +++ b/Cyberpipe.csproj @@ -204,25 +204,6 @@ - - Form - - - F_GKT1数据输入输出.cs - - - Form - - - F_GKT1添加文件.cs - - - Form - - - F_GKT1添加项目.cs - - Form @@ -1068,18 +1049,6 @@ Frm_password_reset.cs - - Form - - - GKT.cs - - - Form - - - GKT1.cs - Form @@ -1258,12 +1227,6 @@ F_Projedit.cs - - Form - - - PED.cs - Form @@ -1331,16 +1294,6 @@ True Reference.map - - F_GKT1数据输入输出.cs - Designer - - - F_GKT1添加文件.cs - - - F_GKT1添加项目.cs - Form_EditTask.cs @@ -1836,12 +1789,6 @@ Frm_password_reset.cs - - GKT.cs - - - GKT1.cs - F_GKT数据输入输出.cs @@ -1934,9 +1881,6 @@ F_Projedit.cs - - PED.cs - F_数据输入输出.cs diff --git a/Cyberpipe.suo b/Cyberpipe.suo index 68ced4f..a1aecf8 100644 --- a/Cyberpipe.suo +++ b/Cyberpipe.suo Binary files differ diff --git a/EMS_Forms/Form_EditTask.cs b/EMS_Forms/Form_EditTask.cs index 718992f..f1d791f 100644 --- a/EMS_Forms/Form_EditTask.cs +++ b/EMS_Forms/Form_EditTask.cs @@ -119,7 +119,8 @@ String name = Convert.ToString(dr["USERNAME"]); comboBox_userName.Items.Add(name); - } + } + dr.Close(); comboBox_road.Items.Clear(); roadList = new List(); @@ -135,7 +136,7 @@ comboBox_road.Items.Add(name); } } - + dr1.Close(); conn.Close(); bool flag2 = false; @@ -185,7 +186,7 @@ catch (Exception ex) { - MessageBox.Show(ex.ToString()); + LogHelper.WriteLog(typeof(Form_EditTask), ex.Message); } } @@ -288,7 +289,7 @@ } catch (Exception ex) { - MessageBox.Show(ex.ToString()); + LogHelper.WriteLog(typeof(Form_EditTask), ex.Message); } } @@ -474,7 +475,7 @@ } catch (Exception ex) { - MessageBox.Show(ex.ToString()); + LogHelper.WriteLog(typeof(Form_EditTask), ex.Message); } this.Close(); @@ -495,6 +496,7 @@ { numList.Add(Convert.ToInt32(dr["DBID"])); } + dr.Close(); if (numList.Count == 0) { taskNumber = Convert.ToInt32(number) * 100; @@ -674,6 +676,7 @@ } } } + dr.Close(); conn.Close(); } diff --git a/EMS_Forms/Form_EventManager.cs b/EMS_Forms/Form_EventManager.cs index b18c45b..84807b2 100644 --- a/EMS_Forms/Form_EventManager.cs +++ b/EMS_Forms/Form_EventManager.cs @@ -64,6 +64,7 @@ comboBox_name.Items.Add(name); } + dr.Close(); conn.Close(); diff --git a/Forms/FrmMnModify.cs b/Forms/FrmMnModify.cs index 31cfc5f..d036360 100644 --- a/Forms/FrmMnModify.cs +++ b/Forms/FrmMnModify.cs @@ -68,15 +68,7 @@ questionGrid.Rows[idx].Cells[1].Value = sr.question; } } - /// 选中对象 - /// - /// - /// - /// - private void buttonX1_Click(object sender, EventArgs e) - { - globecontrol.Globe.Action = EnumAction3D.SelectObject; - } + /// /// 选中某一行 /// diff --git a/Forms/FrmPipelineModelDataBase.cs b/Forms/FrmPipelineModelDataBase.cs index 2acf0ca..7ce573f 100644 --- a/Forms/FrmPipelineModelDataBase.cs +++ b/Forms/FrmPipelineModelDataBase.cs @@ -35,19 +35,7 @@ ds = _ds; InitializeComponent(); } - /// - /// 单击选择shp格式文件 - /// - /// - /// - private void btnBrowseModel_Click(object sender, EventArgs e) - { - saveFileDialog1.Filter = "*.lgd|*.lgd"; - if (saveFileDialog1.ShowDialog() == DialogResult.OK) - { - txtModelLayer.Text = saveFileDialog1.FileName; - } - } + /// /// 窗体初始化事件处理 /// @@ -100,49 +88,6 @@ } } } - - private object convertFieldValue(string fieldname, object obj) - { - if (obj == null) - return null; - - try - { - string type = fields_types[fieldname].ToString(); - switch (type) - { - case "string": - return obj.ToString(); - case "int": - //return 101; - int intResult; - if (int.TryParse(obj.ToString(), out intResult)) - return intResult; - else - return null; - case "double": - //return 202.5; - double doubleResult; - if (double.TryParse(obj.ToString(), out doubleResult)) - return doubleResult; - else - return null; - case "date": - DateTime dtResult; - if (DateTime.TryParse(obj.ToString(), out dtResult)) - return dtResult; - else - return null; - } - return null; - } - catch (Exception ex) - { - MessageBox.Show(ex.ToString()); - return null; - } - } - public string lgdFilePath = ""; /// /// 选择管线颜色 @@ -610,33 +555,6 @@ { this.Close(); } - - private void cmbLayer_SelectedIndexChanged(object sender, EventArgs e) //选择图层 - { - GSOLayer layer = ctl.Globe.Layers.GetLayerByCaption(selectLayerName); - GSOFeatures features = layer.GetAllFeatures(); - if (features.Length == 0) - return; - - cmbFrom.Items.Clear(); - cmbTo.Items.Clear(); - cmbRadius.Items.Clear(); - cmbID.Items.Clear(); - for (int i = 0; i < features[0].GetFieldCount(); i++) - { - GeoScene.Data.GSOFieldDefn fielddef = (GeoScene.Data.GSOFieldDefn)(features[0].GetFieldDefn(i)); - - cmbFrom.Items.Add(fielddef.Name); - cmbTo.Items.Add(fielddef.Name); - cmbRadius.Items.Add(fielddef.Name); - cmbID.Items.Add(fielddef.Name); - } - cmbFrom.SelectedItem = "Deep1"; - cmbTo.SelectedItem = "Deep2"; - cmbRadius.SelectedItem = "Diameter"; - cmbID.SelectedItem = "Handle"; - } - private void buttonXLayerPath_Click(object sender, EventArgs e)//单击 选择shp格式的文件 { OpenFileDialog dlg = new OpenFileDialog(); diff --git a/Forms/FrmPipelineModelDataOneStep.cs b/Forms/FrmPipelineModelDataOneStep.cs index 18afda7..ec93b8a 100644 --- a/Forms/FrmPipelineModelDataOneStep.cs +++ b/Forms/FrmPipelineModelDataOneStep.cs @@ -38,19 +38,7 @@ layerTree = _layerTree; InitializeComponent(); } - /// - /// 单击选择shp格式文件 - /// - /// - /// - private void btnBrowseModel_Click(object sender, EventArgs e) - { - saveFileDialog1.Filter = "*.lgd|*.lgd"; - if (saveFileDialog1.ShowDialog() == DialogResult.OK) - { - txtModelLayer.Text = saveFileDialog1.FileName; - } - } + /// /// 窗体初始化事件处理 /// @@ -107,48 +95,7 @@ } } - private object convertFieldValue(string fieldname, object obj) - { - if (obj == null) - return null; - - try - { - string type = fields_types[fieldname].ToString(); - switch (type) - { - case "string": - return obj.ToString(); - case "int": - //return 101; - int intResult; - if (int.TryParse(obj.ToString(), out intResult)) - return intResult; - else - return null; - case "double": - //return 202.5; - double doubleResult; - if (double.TryParse(obj.ToString(), out doubleResult)) - return doubleResult; - else - return null; - case "date": - DateTime dtResult; - if (DateTime.TryParse(obj.ToString(), out dtResult)) - return dtResult; - else - return null; - } - return null; - } - catch (Exception ex) - { - MessageBox.Show(ex.ToString()); - return null; - } - } - + public string lgdFilePath = ""; /// /// 选择管线颜色 @@ -673,32 +620,6 @@ return featDs; } - private void cmbLayer_SelectedIndexChanged(object sender, EventArgs e) //选择图层 - { - GSOLayer layer = ctl.Globe.Layers.GetLayerByCaption(selectLayerName); - GSOFeatures features = layer.GetAllFeatures(); - if (features.Length == 0) - return; - - cmbFrom.Items.Clear(); - cmbTo.Items.Clear(); - cmbRadius.Items.Clear(); - cmbID.Items.Clear(); - for (int i = 0; i < features[0].GetFieldCount(); i++) - { - GeoScene.Data.GSOFieldDefn fielddef = (GeoScene.Data.GSOFieldDefn)(features[0].GetFieldDefn(i)); - - cmbFrom.Items.Add(fielddef.Name); - cmbTo.Items.Add(fielddef.Name); - cmbRadius.Items.Add(fielddef.Name); - cmbID.Items.Add(fielddef.Name); - } - cmbFrom.SelectedItem = "Deep1"; - cmbTo.SelectedItem = "Deep2"; - cmbRadius.SelectedItem = "Diameter"; - cmbID.SelectedItem = "Handle"; - } - private void buttonXLayerPath_Click(object sender, EventArgs e)//单击 选择shp格式的文件 { OpenFileDialog dlg = new OpenFileDialog(); @@ -949,38 +870,6 @@ } //txtLayername.Text = type + layername; } - /// - /// 连接数据库 - /// - /// - /// - private void buttonX1_Click(object sender, EventArgs e) - { - if (ds == null) - { - //没连的话,直接连接审核库; //审核库配置读配置文件 - string dbIp = Utility.sgdbip; - string database = Utility.sgdbname; - string user = Utility.sgdbuser; - string pass = Utility.sgdbpwd; - - if (!Utility.isNetworkConnectionSuccess(dbIp.Trim())) - { - MessageBox.Show("网络连接失败!", "提示"); - return; - } - - ds = ctl.Globe.DataManager.OpenOracleDataSource(dbIp + "/" + database, "", "", user, pass); - if (ds == null) - { - MessageBox.Show("数据库连接失败!", "提示", MessageBoxButtons.OK, MessageBoxIcon.Warning); - } - else - { - btnCreateModel.Enabled = true; - } - } - } private void btnClose_Click(object sender, EventArgs e) { diff --git a/Forms/FrmShRK.cs b/Forms/FrmShRK.cs index 0e2e722..f1d83cb 100644 --- a/Forms/FrmShRK.cs +++ b/Forms/FrmShRK.cs @@ -215,6 +215,7 @@ { sourcefeatds = sourcefeat as GSOFeatureDataset; } + if (sourcefeatds == null) return; sourcefeatds.Open(); GSOFeatures sourcefeatures = sourcefeatds.GetAllFeatures(); @@ -251,6 +252,7 @@ { desfeatds = desfeat as GSOFeatureDataset; } + if (desfeatds == null) return; desfeatds.Open(); //向新数据集写入字段 diff --git a/FrmAccessoriesSensor.cs b/FrmAccessoriesSensor.cs index 09fcdf1..2a7a80e 100644 --- a/FrmAccessoriesSensor.cs +++ b/FrmAccessoriesSensor.cs @@ -209,7 +209,7 @@ chart1.Series[0].Points.DataBindXY(dic.Keys, dic.Values); for (int m = 0; m < dic.Values.Count; m++) { - if (chart1.Series[0].Points[m].YValues[0].ToString() != "0") + if (chart1.Series[0].Points[m]!=null&&chart1.Series[0].Points[m].YValues[0].ToString() != "0") { chart1.Series[0].Points[m].Label = chart1.Series[0].Points[m].YValues[0].ToString(); } diff --git a/FrmAccessoriesgather.cs b/FrmAccessoriesgather.cs index 9e331e1..a475d9e 100644 --- a/FrmAccessoriesgather.cs +++ b/FrmAccessoriesgather.cs @@ -338,7 +338,7 @@ chart1.Series[0].Points.DataBindXY(dic.Keys, dic.Values); for (int m = 0; m < dic.Values.Count; m++) { - if (chart1.Series[0].Points[m].YValues[0].ToString() != "0") + if (chart1.Series[0].Points[m]!=null&&chart1.Series[0].Points[m].YValues[0].ToString() != "0") { chart1.Series[0].Points[m].Label = chart1.Series[0].Points[m].YValues[0].ToString(); } diff --git a/FrmAccessoryAnalysis.cs b/FrmAccessoryAnalysis.cs index 71d4579..44d4065 100644 --- a/FrmAccessoryAnalysis.cs +++ b/FrmAccessoryAnalysis.cs @@ -66,39 +66,6 @@ globeControl1.Refresh(); } /// - /// 键盘按键按下事件处理 - /// - /// - /// - private void txtRadius_KeyPress(object sender, KeyPressEventArgs e) - { - TextBox text = sender as TextBox; - if ((e.KeyChar < 48 || e.KeyChar > 57) && (e.KeyChar != 8) && (int)e.KeyChar != 46) - { - e.Handled = true; - } - if ((int)e.KeyChar == 46) //小数点 - { - if (text.Text.Length <= 0) - e.Handled = true; //小数点不能在第一位 - else //处理不规则的小数点 - { - float f; - float oldf; - bool b1 = false, b2 = false; - b1 = float.TryParse(text.Text, out oldf); - b2 = float.TryParse(text.Text + e.KeyChar.ToString(), out f); - if (b2 == false) - { - if (b1 == true) - e.Handled = true; - else - e.Handled = false; - } - } - } - } - /// /// 确定按钮事件处理 /// /// diff --git a/FrmAddValve.cs b/FrmAddValve.cs index 34d2fec..5f405b9 100644 --- a/FrmAddValve.cs +++ b/FrmAddValve.cs @@ -486,56 +486,6 @@ } } - - - - - - - - private void cmbLayer_SelectedIndexChanged(object sender, EventArgs e) - { - GSOLayer layer = globeControl1.Globe.Layers.GetLayerByCaption(selectLayerName); - GSOFeatures features = layer.GetAllFeatures(); - if (features.Length == 0) - return; - - combPath.Items.Clear(); - combZ.Items.Clear(); - combModelName.Items.Clear(); - - for (int i = 0; i < features[0].GetFieldCount(); i++) - { - GeoScene.Data.GSOFieldDefn fielddef = (GeoScene.Data.GSOFieldDefn)(features[0].GetFieldDefn(i)); - combPath.Items.Add(fielddef.Name); - combZ.Items.Add(fielddef.Name); - combModelName.Items.Add(fielddef.Name); - } - combModelName.SelectedItem = "编号"; - combPath.SelectedItem = "模型路径"; - if (combfile.SelectedIndex != -1) - { - - string layerCaption = combfile.SelectedItem.ToString().Trim(); - rukuLayer = globeControl1.Globe.Layers.GetLayerByCaption(layerCaption); - if (rukuLayer != null) - { - combPath.Items.Clear(); - combZ.Items.Clear(); - combModelName.Items.Clear(); - - } - for (int i = 0; i < features[0].GetFieldCount(); i++) - { - GeoScene.Data.GSOFieldDefn fielddef = (GeoScene.Data.GSOFieldDefn)(features[0].GetFieldDefn(i)); - combPath.Items.Add(fielddef.Name); - combZ.Items.Add(fielddef.Name); - combModelName.Items.Add(fielddef.Name); - } - combModelName.SelectedItem = "编号"; - combPath.SelectedItem = "模型路径"; - } - } /// /// 单击选择shp格式文件 /// diff --git a/FrmAddWellShp.cs b/FrmAddWellShp.cs index bb79ec0..a249725 100644 --- a/FrmAddWellShp.cs +++ b/FrmAddWellShp.cs @@ -478,32 +478,6 @@ } } } - - private void cmbLayer_SelectedIndexChanged(object sender, EventArgs e) - { - GSOLayer layer = globeControl1.Globe.Layers.GetLayerByCaption(selectLayerName); - GSOFeatures features = layer.GetAllFeatures(); - if (features.Length == 0) - return; - - combCode.Items.Clear(); - combDeep.Items.Clear(); - combModelName.Items.Clear(); - combAngle.Items.Clear(); - - for (int i = 0; i < features[0].GetFieldCount(); i++) - { - GeoScene.Data.GSOFieldDefn fielddef = (GeoScene.Data.GSOFieldDefn)(features[0].GetFieldDefn(i)); - combCode.Items.Add(fielddef.Name); - combDeep.Items.Add(fielddef.Name); - combModelName.Items.Add(fielddef.Name); - combAngle.Items.Add(fielddef.Name); - } - combCode.SelectedItem = "附属物编码"; - combDeep.SelectedItem = "井深"; - combModelName.SelectedItem = "编号"; - combAngle.SelectedItem = "符号角度"; - } /// /// 单击选择shp格式文件 /// diff --git a/FrmAddYuBiZiShp.cs b/FrmAddYuBiZiShp.cs index b312d51..332f037 100644 --- a/FrmAddYuBiZiShp.cs +++ b/FrmAddYuBiZiShp.cs @@ -383,80 +383,7 @@ } } - private void cmbLayer_SelectedIndexChanged(object sender, EventArgs e) - { - GSOLayer layer = globeControl1.Globe.Layers.GetLayerByCaption(selectLayerName); - GSOFeatures features = layer.GetAllFeatures(); - if (features.Length == 0) - return; - - combCode.Items.Clear(); - combDeep.Items.Clear(); - combModelName.Items.Clear(); - //comboLoad.Items.Clear(); - for (int i = 0; i < features[0].GetFieldCount(); i++) - { - GeoScene.Data.GSOFieldDefn fielddef = (GeoScene.Data.GSOFieldDefn)(features[0].GetFieldDefn(i)); - combCode.Items.Add(fielddef.Name); - combDeep.Items.Add(fielddef.Name); - combModelName.Items.Add(fielddef.Name); - //comboLoad.Items.Add(fielddef.Name); - } - combCode.SelectedItem = "附属物编码"; - combDeep.SelectedItem = "Z坐标"; - combModelName.SelectedItem = "编号"; - //comboLoad.SelectedItem = "模型路径"; - } - - private void buttonXLayerPath_Click(object sender, EventArgs e) - { - OpenFileDialog dlg = new OpenFileDialog(); - dlg.Filter = "*.shp|*.shp"; - dlg.Multiselect = false; - if (dlg.ShowDialog() == DialogResult.OK) - { - GSOLayer layer = globeControl1.Globe.Layers.Add(dlg.FileName); - string txtMessage = valiYBdata(layer); - if (txtMessage != "") - { - button3.Enabled = false; - //textBoxLayer.Text = ""; - combCode.Items.Clear(); - combDeep.Items.Clear(); - combModelName.Items.Clear(); - globeControl1.Globe.Layers.Remove(layer); - FrmValiDataShowErrorMessage showErrorMessage = new FrmValiDataShowErrorMessage(dlg.FileName, txtMessage); - showErrorMessage.ShowDialog(); - return; - } - else - { - button3.Enabled = true; - //textBoxLayer.Text = dlg.FileName; - selectLayerName = layer.Caption; - txtLayerName.Text = layer.Caption; - GSOFeatures features = layer.GetAllFeatures(); - if (features.Length == 0) - return; - - combCode.Items.Clear(); - combDeep.Items.Clear(); - combModelName.Items.Clear(); - for (int i = 0; i < features[0].GetFieldCount(); i++) - { - GeoScene.Data.GSOFieldDefn fielddef = (GeoScene.Data.GSOFieldDefn)(features[0].GetFieldDefn(i)); - combCode.Items.Add(fielddef.Name); - combDeep.Items.Add(fielddef.Name); - combModelName.Items.Add(fielddef.Name); - //comboLoad.Items.Add(fielddef.Name); - } - combCode.SelectedItem = "管点编码"; - combDeep.SelectedItem = "Z坐标"; - combModelName.SelectedItem = "编号"; - } - } - } - + private void FrmAddYuBiZiShp_FormClosing(object sender, FormClosingEventArgs e) { globeControl1.Globe.Refresh(); diff --git a/FrmAllPipelineStatis.cs b/FrmAllPipelineStatis.cs index 6421a26..a6eea29 100644 --- a/FrmAllPipelineStatis.cs +++ b/FrmAllPipelineStatis.cs @@ -84,7 +84,7 @@ chartAllAreaPipeline.Series["管线"].Points.DataBindXY(pipelineLengthAndType.Keys, pipelineLengthAndType.Values); for (int m = 0; m < pipelineLengthAndType.Values.Count; m++) { - if (chartAllAreaPipeline.Series["管线"].Points[m].YValues[0].ToString() != "0") + if (chartAllAreaPipeline.Series["管线"].Points[m]!=null&&chartAllAreaPipeline.Series["管线"].Points[m].YValues[0].ToString() != "0") { chartAllAreaPipeline.Series["管线"].Points[m].Label = chartAllAreaPipeline.Series[0].Points[m].YValues[0].ToString(); } @@ -94,7 +94,7 @@ } catch (Exception ex) { - //LogError.PublishError(ex); + LogHelper.WriteLog(typeof(FrmAllPipelineStatis), ex.Message); } } @@ -147,7 +147,7 @@ } DataTable dt = OledbHelper.QueryTable(sql); - if (dt != null && dt.Rows.Count > 0) + if (dt != null && dt.Rows.Count > 0 && chartAllAreaPipeline.Series["管线"].Points[indexHit]!=null) { dataGridViewX1.DataSource = dt; panel.Visible = true; diff --git a/FrmAllWorkWellStatis.cs b/FrmAllWorkWellStatis.cs index 6fec7af..6af8e4c 100644 --- a/FrmAllWorkWellStatis.cs +++ b/FrmAllWorkWellStatis.cs @@ -52,7 +52,7 @@ chartAllAreaPipeline.Series["井盖"].Points.DataBindXY(workWellLengthAndType.Keys, workWellLengthAndType.Values); for (int m = 0; m < workWellLengthAndType.Values.Count; m++) { - if (chartAllAreaPipeline.Series["井盖"].Points[m].YValues[0].ToString().Trim() != "0") + if (chartAllAreaPipeline.Series["井盖"].Points[m]!=null&&chartAllAreaPipeline.Series["井盖"].Points[m].YValues[0].ToString().Trim() != "0") { chartAllAreaPipeline.Series["井盖"].Points[m].Label = chartAllAreaPipeline.Series[0].Points[m].YValues[0].ToString(); } @@ -60,7 +60,7 @@ } catch (Exception ex) { - //LogError.PublishError(ex); + LogHelper.WriteLog(typeof(FrmAllWorkWellStatis), ex.Message); } } diff --git a/FrmBSQDuoBianXingStatis.cs b/FrmBSQDuoBianXingStatis.cs index e8b7d52..3e889b6 100644 --- a/FrmBSQDuoBianXingStatis.cs +++ b/FrmBSQDuoBianXingStatis.cs @@ -60,7 +60,7 @@ { for (int m = 0; m < bsq1.Values.Count; m++) { - if (chart1.Series["标识器"].Points[m].YValues[0].ToString() != "0") + if (chart1.Series["标识器"].Points[m]!=null&&chart1.Series["标识器"].Points[m].YValues[0].ToString() != "0") { count += Convert.ToInt16(chart1.Series[0].Points[m].YValues[0].ToString()); chart1.Series["标识器"].Points[m].Label = chart1.Series[0].Points[m].YValues[0].ToString(); diff --git a/FrmBSQDuoBianXingStreet.cs b/FrmBSQDuoBianXingStreet.cs index 2005ebb..1db5777 100644 --- a/FrmBSQDuoBianXingStreet.cs +++ b/FrmBSQDuoBianXingStreet.cs @@ -63,7 +63,7 @@ chartStatis.Series[0].Points.DataBindXY(bsq.Keys, bsq.Values); for (int m = 0; m < bsq.Values.Count; m++) { - if (chartStatis.Series[0].Points[m].YValues[0].ToString().Trim() != "0") + if (chartStatis.Series[0].Points[m]!=null&&chartStatis.Series[0].Points[m].YValues[0].ToString().Trim() != "0") { count += Convert.ToInt16(chartStatis.Series[0].Points[m].YValues[0].ToString()); chartStatis.Series[0].Points[m].Label = chartStatis.Series[0].Points[m].YValues[0].ToString(); diff --git a/FrmBSQStatis.cs b/FrmBSQStatis.cs index 390a55c..4aa0ee6 100644 --- a/FrmBSQStatis.cs +++ b/FrmBSQStatis.cs @@ -95,6 +95,8 @@ } } } + + dr.Close(); conn.Close(); for (int i = 0; i < typeLists.Count; i++) { @@ -123,7 +125,7 @@ chartStatis.Series[0].Points.DataBindXY(bsq.Keys, bsq.Values); for (int m = 0; m < bsq.Values.Count; m++) { - if (chartStatis.Series[0].Points[m].YValues[0].ToString().Trim() != "0") + if (chartStatis.Series[0].Points[m]!=null&&chartStatis.Series[0].Points[m].YValues[0].ToString().Trim() != "0") { //count += Convert.ToInt16(chartStatis.Series[0].Points[m].YValues[0].ToString()); chartStatis.Series[0].Points[m].Label = chartStatis.Series[0].Points[m].YValues[0].ToString(); diff --git a/Cyberpipe.csproj b/Cyberpipe.csproj index 07a8c1a..e3cd12c 100644 --- a/Cyberpipe.csproj +++ b/Cyberpipe.csproj @@ -204,25 +204,6 @@ - - Form - - - F_GKT1数据输入输出.cs - - - Form - - - F_GKT1添加文件.cs - - - Form - - - F_GKT1添加项目.cs - - Form @@ -1068,18 +1049,6 @@ Frm_password_reset.cs - - Form - - - GKT.cs - - - Form - - - GKT1.cs - Form @@ -1258,12 +1227,6 @@ F_Projedit.cs - - Form - - - PED.cs - Form @@ -1331,16 +1294,6 @@ True Reference.map - - F_GKT1数据输入输出.cs - Designer - - - F_GKT1添加文件.cs - - - F_GKT1添加项目.cs - Form_EditTask.cs @@ -1836,12 +1789,6 @@ Frm_password_reset.cs - - GKT.cs - - - GKT1.cs - F_GKT数据输入输出.cs @@ -1934,9 +1881,6 @@ F_Projedit.cs - - PED.cs - F_数据输入输出.cs diff --git a/Cyberpipe.suo b/Cyberpipe.suo index 68ced4f..a1aecf8 100644 --- a/Cyberpipe.suo +++ b/Cyberpipe.suo Binary files differ diff --git a/EMS_Forms/Form_EditTask.cs b/EMS_Forms/Form_EditTask.cs index 718992f..f1d791f 100644 --- a/EMS_Forms/Form_EditTask.cs +++ b/EMS_Forms/Form_EditTask.cs @@ -119,7 +119,8 @@ String name = Convert.ToString(dr["USERNAME"]); comboBox_userName.Items.Add(name); - } + } + dr.Close(); comboBox_road.Items.Clear(); roadList = new List(); @@ -135,7 +136,7 @@ comboBox_road.Items.Add(name); } } - + dr1.Close(); conn.Close(); bool flag2 = false; @@ -185,7 +186,7 @@ catch (Exception ex) { - MessageBox.Show(ex.ToString()); + LogHelper.WriteLog(typeof(Form_EditTask), ex.Message); } } @@ -288,7 +289,7 @@ } catch (Exception ex) { - MessageBox.Show(ex.ToString()); + LogHelper.WriteLog(typeof(Form_EditTask), ex.Message); } } @@ -474,7 +475,7 @@ } catch (Exception ex) { - MessageBox.Show(ex.ToString()); + LogHelper.WriteLog(typeof(Form_EditTask), ex.Message); } this.Close(); @@ -495,6 +496,7 @@ { numList.Add(Convert.ToInt32(dr["DBID"])); } + dr.Close(); if (numList.Count == 0) { taskNumber = Convert.ToInt32(number) * 100; @@ -674,6 +676,7 @@ } } } + dr.Close(); conn.Close(); } diff --git a/EMS_Forms/Form_EventManager.cs b/EMS_Forms/Form_EventManager.cs index b18c45b..84807b2 100644 --- a/EMS_Forms/Form_EventManager.cs +++ b/EMS_Forms/Form_EventManager.cs @@ -64,6 +64,7 @@ comboBox_name.Items.Add(name); } + dr.Close(); conn.Close(); diff --git a/Forms/FrmMnModify.cs b/Forms/FrmMnModify.cs index 31cfc5f..d036360 100644 --- a/Forms/FrmMnModify.cs +++ b/Forms/FrmMnModify.cs @@ -68,15 +68,7 @@ questionGrid.Rows[idx].Cells[1].Value = sr.question; } } - /// 选中对象 - /// - /// - /// - /// - private void buttonX1_Click(object sender, EventArgs e) - { - globecontrol.Globe.Action = EnumAction3D.SelectObject; - } + /// /// 选中某一行 /// diff --git a/Forms/FrmPipelineModelDataBase.cs b/Forms/FrmPipelineModelDataBase.cs index 2acf0ca..7ce573f 100644 --- a/Forms/FrmPipelineModelDataBase.cs +++ b/Forms/FrmPipelineModelDataBase.cs @@ -35,19 +35,7 @@ ds = _ds; InitializeComponent(); } - /// - /// 单击选择shp格式文件 - /// - /// - /// - private void btnBrowseModel_Click(object sender, EventArgs e) - { - saveFileDialog1.Filter = "*.lgd|*.lgd"; - if (saveFileDialog1.ShowDialog() == DialogResult.OK) - { - txtModelLayer.Text = saveFileDialog1.FileName; - } - } + /// /// 窗体初始化事件处理 /// @@ -100,49 +88,6 @@ } } } - - private object convertFieldValue(string fieldname, object obj) - { - if (obj == null) - return null; - - try - { - string type = fields_types[fieldname].ToString(); - switch (type) - { - case "string": - return obj.ToString(); - case "int": - //return 101; - int intResult; - if (int.TryParse(obj.ToString(), out intResult)) - return intResult; - else - return null; - case "double": - //return 202.5; - double doubleResult; - if (double.TryParse(obj.ToString(), out doubleResult)) - return doubleResult; - else - return null; - case "date": - DateTime dtResult; - if (DateTime.TryParse(obj.ToString(), out dtResult)) - return dtResult; - else - return null; - } - return null; - } - catch (Exception ex) - { - MessageBox.Show(ex.ToString()); - return null; - } - } - public string lgdFilePath = ""; /// /// 选择管线颜色 @@ -610,33 +555,6 @@ { this.Close(); } - - private void cmbLayer_SelectedIndexChanged(object sender, EventArgs e) //选择图层 - { - GSOLayer layer = ctl.Globe.Layers.GetLayerByCaption(selectLayerName); - GSOFeatures features = layer.GetAllFeatures(); - if (features.Length == 0) - return; - - cmbFrom.Items.Clear(); - cmbTo.Items.Clear(); - cmbRadius.Items.Clear(); - cmbID.Items.Clear(); - for (int i = 0; i < features[0].GetFieldCount(); i++) - { - GeoScene.Data.GSOFieldDefn fielddef = (GeoScene.Data.GSOFieldDefn)(features[0].GetFieldDefn(i)); - - cmbFrom.Items.Add(fielddef.Name); - cmbTo.Items.Add(fielddef.Name); - cmbRadius.Items.Add(fielddef.Name); - cmbID.Items.Add(fielddef.Name); - } - cmbFrom.SelectedItem = "Deep1"; - cmbTo.SelectedItem = "Deep2"; - cmbRadius.SelectedItem = "Diameter"; - cmbID.SelectedItem = "Handle"; - } - private void buttonXLayerPath_Click(object sender, EventArgs e)//单击 选择shp格式的文件 { OpenFileDialog dlg = new OpenFileDialog(); diff --git a/Forms/FrmPipelineModelDataOneStep.cs b/Forms/FrmPipelineModelDataOneStep.cs index 18afda7..ec93b8a 100644 --- a/Forms/FrmPipelineModelDataOneStep.cs +++ b/Forms/FrmPipelineModelDataOneStep.cs @@ -38,19 +38,7 @@ layerTree = _layerTree; InitializeComponent(); } - /// - /// 单击选择shp格式文件 - /// - /// - /// - private void btnBrowseModel_Click(object sender, EventArgs e) - { - saveFileDialog1.Filter = "*.lgd|*.lgd"; - if (saveFileDialog1.ShowDialog() == DialogResult.OK) - { - txtModelLayer.Text = saveFileDialog1.FileName; - } - } + /// /// 窗体初始化事件处理 /// @@ -107,48 +95,7 @@ } } - private object convertFieldValue(string fieldname, object obj) - { - if (obj == null) - return null; - - try - { - string type = fields_types[fieldname].ToString(); - switch (type) - { - case "string": - return obj.ToString(); - case "int": - //return 101; - int intResult; - if (int.TryParse(obj.ToString(), out intResult)) - return intResult; - else - return null; - case "double": - //return 202.5; - double doubleResult; - if (double.TryParse(obj.ToString(), out doubleResult)) - return doubleResult; - else - return null; - case "date": - DateTime dtResult; - if (DateTime.TryParse(obj.ToString(), out dtResult)) - return dtResult; - else - return null; - } - return null; - } - catch (Exception ex) - { - MessageBox.Show(ex.ToString()); - return null; - } - } - + public string lgdFilePath = ""; /// /// 选择管线颜色 @@ -673,32 +620,6 @@ return featDs; } - private void cmbLayer_SelectedIndexChanged(object sender, EventArgs e) //选择图层 - { - GSOLayer layer = ctl.Globe.Layers.GetLayerByCaption(selectLayerName); - GSOFeatures features = layer.GetAllFeatures(); - if (features.Length == 0) - return; - - cmbFrom.Items.Clear(); - cmbTo.Items.Clear(); - cmbRadius.Items.Clear(); - cmbID.Items.Clear(); - for (int i = 0; i < features[0].GetFieldCount(); i++) - { - GeoScene.Data.GSOFieldDefn fielddef = (GeoScene.Data.GSOFieldDefn)(features[0].GetFieldDefn(i)); - - cmbFrom.Items.Add(fielddef.Name); - cmbTo.Items.Add(fielddef.Name); - cmbRadius.Items.Add(fielddef.Name); - cmbID.Items.Add(fielddef.Name); - } - cmbFrom.SelectedItem = "Deep1"; - cmbTo.SelectedItem = "Deep2"; - cmbRadius.SelectedItem = "Diameter"; - cmbID.SelectedItem = "Handle"; - } - private void buttonXLayerPath_Click(object sender, EventArgs e)//单击 选择shp格式的文件 { OpenFileDialog dlg = new OpenFileDialog(); @@ -949,38 +870,6 @@ } //txtLayername.Text = type + layername; } - /// - /// 连接数据库 - /// - /// - /// - private void buttonX1_Click(object sender, EventArgs e) - { - if (ds == null) - { - //没连的话,直接连接审核库; //审核库配置读配置文件 - string dbIp = Utility.sgdbip; - string database = Utility.sgdbname; - string user = Utility.sgdbuser; - string pass = Utility.sgdbpwd; - - if (!Utility.isNetworkConnectionSuccess(dbIp.Trim())) - { - MessageBox.Show("网络连接失败!", "提示"); - return; - } - - ds = ctl.Globe.DataManager.OpenOracleDataSource(dbIp + "/" + database, "", "", user, pass); - if (ds == null) - { - MessageBox.Show("数据库连接失败!", "提示", MessageBoxButtons.OK, MessageBoxIcon.Warning); - } - else - { - btnCreateModel.Enabled = true; - } - } - } private void btnClose_Click(object sender, EventArgs e) { diff --git a/Forms/FrmShRK.cs b/Forms/FrmShRK.cs index 0e2e722..f1d83cb 100644 --- a/Forms/FrmShRK.cs +++ b/Forms/FrmShRK.cs @@ -215,6 +215,7 @@ { sourcefeatds = sourcefeat as GSOFeatureDataset; } + if (sourcefeatds == null) return; sourcefeatds.Open(); GSOFeatures sourcefeatures = sourcefeatds.GetAllFeatures(); @@ -251,6 +252,7 @@ { desfeatds = desfeat as GSOFeatureDataset; } + if (desfeatds == null) return; desfeatds.Open(); //向新数据集写入字段 diff --git a/FrmAccessoriesSensor.cs b/FrmAccessoriesSensor.cs index 09fcdf1..2a7a80e 100644 --- a/FrmAccessoriesSensor.cs +++ b/FrmAccessoriesSensor.cs @@ -209,7 +209,7 @@ chart1.Series[0].Points.DataBindXY(dic.Keys, dic.Values); for (int m = 0; m < dic.Values.Count; m++) { - if (chart1.Series[0].Points[m].YValues[0].ToString() != "0") + if (chart1.Series[0].Points[m]!=null&&chart1.Series[0].Points[m].YValues[0].ToString() != "0") { chart1.Series[0].Points[m].Label = chart1.Series[0].Points[m].YValues[0].ToString(); } diff --git a/FrmAccessoriesgather.cs b/FrmAccessoriesgather.cs index 9e331e1..a475d9e 100644 --- a/FrmAccessoriesgather.cs +++ b/FrmAccessoriesgather.cs @@ -338,7 +338,7 @@ chart1.Series[0].Points.DataBindXY(dic.Keys, dic.Values); for (int m = 0; m < dic.Values.Count; m++) { - if (chart1.Series[0].Points[m].YValues[0].ToString() != "0") + if (chart1.Series[0].Points[m]!=null&&chart1.Series[0].Points[m].YValues[0].ToString() != "0") { chart1.Series[0].Points[m].Label = chart1.Series[0].Points[m].YValues[0].ToString(); } diff --git a/FrmAccessoryAnalysis.cs b/FrmAccessoryAnalysis.cs index 71d4579..44d4065 100644 --- a/FrmAccessoryAnalysis.cs +++ b/FrmAccessoryAnalysis.cs @@ -66,39 +66,6 @@ globeControl1.Refresh(); } /// - /// 键盘按键按下事件处理 - /// - /// - /// - private void txtRadius_KeyPress(object sender, KeyPressEventArgs e) - { - TextBox text = sender as TextBox; - if ((e.KeyChar < 48 || e.KeyChar > 57) && (e.KeyChar != 8) && (int)e.KeyChar != 46) - { - e.Handled = true; - } - if ((int)e.KeyChar == 46) //小数点 - { - if (text.Text.Length <= 0) - e.Handled = true; //小数点不能在第一位 - else //处理不规则的小数点 - { - float f; - float oldf; - bool b1 = false, b2 = false; - b1 = float.TryParse(text.Text, out oldf); - b2 = float.TryParse(text.Text + e.KeyChar.ToString(), out f); - if (b2 == false) - { - if (b1 == true) - e.Handled = true; - else - e.Handled = false; - } - } - } - } - /// /// 确定按钮事件处理 /// /// diff --git a/FrmAddValve.cs b/FrmAddValve.cs index 34d2fec..5f405b9 100644 --- a/FrmAddValve.cs +++ b/FrmAddValve.cs @@ -486,56 +486,6 @@ } } - - - - - - - - private void cmbLayer_SelectedIndexChanged(object sender, EventArgs e) - { - GSOLayer layer = globeControl1.Globe.Layers.GetLayerByCaption(selectLayerName); - GSOFeatures features = layer.GetAllFeatures(); - if (features.Length == 0) - return; - - combPath.Items.Clear(); - combZ.Items.Clear(); - combModelName.Items.Clear(); - - for (int i = 0; i < features[0].GetFieldCount(); i++) - { - GeoScene.Data.GSOFieldDefn fielddef = (GeoScene.Data.GSOFieldDefn)(features[0].GetFieldDefn(i)); - combPath.Items.Add(fielddef.Name); - combZ.Items.Add(fielddef.Name); - combModelName.Items.Add(fielddef.Name); - } - combModelName.SelectedItem = "编号"; - combPath.SelectedItem = "模型路径"; - if (combfile.SelectedIndex != -1) - { - - string layerCaption = combfile.SelectedItem.ToString().Trim(); - rukuLayer = globeControl1.Globe.Layers.GetLayerByCaption(layerCaption); - if (rukuLayer != null) - { - combPath.Items.Clear(); - combZ.Items.Clear(); - combModelName.Items.Clear(); - - } - for (int i = 0; i < features[0].GetFieldCount(); i++) - { - GeoScene.Data.GSOFieldDefn fielddef = (GeoScene.Data.GSOFieldDefn)(features[0].GetFieldDefn(i)); - combPath.Items.Add(fielddef.Name); - combZ.Items.Add(fielddef.Name); - combModelName.Items.Add(fielddef.Name); - } - combModelName.SelectedItem = "编号"; - combPath.SelectedItem = "模型路径"; - } - } /// /// 单击选择shp格式文件 /// diff --git a/FrmAddWellShp.cs b/FrmAddWellShp.cs index bb79ec0..a249725 100644 --- a/FrmAddWellShp.cs +++ b/FrmAddWellShp.cs @@ -478,32 +478,6 @@ } } } - - private void cmbLayer_SelectedIndexChanged(object sender, EventArgs e) - { - GSOLayer layer = globeControl1.Globe.Layers.GetLayerByCaption(selectLayerName); - GSOFeatures features = layer.GetAllFeatures(); - if (features.Length == 0) - return; - - combCode.Items.Clear(); - combDeep.Items.Clear(); - combModelName.Items.Clear(); - combAngle.Items.Clear(); - - for (int i = 0; i < features[0].GetFieldCount(); i++) - { - GeoScene.Data.GSOFieldDefn fielddef = (GeoScene.Data.GSOFieldDefn)(features[0].GetFieldDefn(i)); - combCode.Items.Add(fielddef.Name); - combDeep.Items.Add(fielddef.Name); - combModelName.Items.Add(fielddef.Name); - combAngle.Items.Add(fielddef.Name); - } - combCode.SelectedItem = "附属物编码"; - combDeep.SelectedItem = "井深"; - combModelName.SelectedItem = "编号"; - combAngle.SelectedItem = "符号角度"; - } /// /// 单击选择shp格式文件 /// diff --git a/FrmAddYuBiZiShp.cs b/FrmAddYuBiZiShp.cs index b312d51..332f037 100644 --- a/FrmAddYuBiZiShp.cs +++ b/FrmAddYuBiZiShp.cs @@ -383,80 +383,7 @@ } } - private void cmbLayer_SelectedIndexChanged(object sender, EventArgs e) - { - GSOLayer layer = globeControl1.Globe.Layers.GetLayerByCaption(selectLayerName); - GSOFeatures features = layer.GetAllFeatures(); - if (features.Length == 0) - return; - - combCode.Items.Clear(); - combDeep.Items.Clear(); - combModelName.Items.Clear(); - //comboLoad.Items.Clear(); - for (int i = 0; i < features[0].GetFieldCount(); i++) - { - GeoScene.Data.GSOFieldDefn fielddef = (GeoScene.Data.GSOFieldDefn)(features[0].GetFieldDefn(i)); - combCode.Items.Add(fielddef.Name); - combDeep.Items.Add(fielddef.Name); - combModelName.Items.Add(fielddef.Name); - //comboLoad.Items.Add(fielddef.Name); - } - combCode.SelectedItem = "附属物编码"; - combDeep.SelectedItem = "Z坐标"; - combModelName.SelectedItem = "编号"; - //comboLoad.SelectedItem = "模型路径"; - } - - private void buttonXLayerPath_Click(object sender, EventArgs e) - { - OpenFileDialog dlg = new OpenFileDialog(); - dlg.Filter = "*.shp|*.shp"; - dlg.Multiselect = false; - if (dlg.ShowDialog() == DialogResult.OK) - { - GSOLayer layer = globeControl1.Globe.Layers.Add(dlg.FileName); - string txtMessage = valiYBdata(layer); - if (txtMessage != "") - { - button3.Enabled = false; - //textBoxLayer.Text = ""; - combCode.Items.Clear(); - combDeep.Items.Clear(); - combModelName.Items.Clear(); - globeControl1.Globe.Layers.Remove(layer); - FrmValiDataShowErrorMessage showErrorMessage = new FrmValiDataShowErrorMessage(dlg.FileName, txtMessage); - showErrorMessage.ShowDialog(); - return; - } - else - { - button3.Enabled = true; - //textBoxLayer.Text = dlg.FileName; - selectLayerName = layer.Caption; - txtLayerName.Text = layer.Caption; - GSOFeatures features = layer.GetAllFeatures(); - if (features.Length == 0) - return; - - combCode.Items.Clear(); - combDeep.Items.Clear(); - combModelName.Items.Clear(); - for (int i = 0; i < features[0].GetFieldCount(); i++) - { - GeoScene.Data.GSOFieldDefn fielddef = (GeoScene.Data.GSOFieldDefn)(features[0].GetFieldDefn(i)); - combCode.Items.Add(fielddef.Name); - combDeep.Items.Add(fielddef.Name); - combModelName.Items.Add(fielddef.Name); - //comboLoad.Items.Add(fielddef.Name); - } - combCode.SelectedItem = "管点编码"; - combDeep.SelectedItem = "Z坐标"; - combModelName.SelectedItem = "编号"; - } - } - } - + private void FrmAddYuBiZiShp_FormClosing(object sender, FormClosingEventArgs e) { globeControl1.Globe.Refresh(); diff --git a/FrmAllPipelineStatis.cs b/FrmAllPipelineStatis.cs index 6421a26..a6eea29 100644 --- a/FrmAllPipelineStatis.cs +++ b/FrmAllPipelineStatis.cs @@ -84,7 +84,7 @@ chartAllAreaPipeline.Series["管线"].Points.DataBindXY(pipelineLengthAndType.Keys, pipelineLengthAndType.Values); for (int m = 0; m < pipelineLengthAndType.Values.Count; m++) { - if (chartAllAreaPipeline.Series["管线"].Points[m].YValues[0].ToString() != "0") + if (chartAllAreaPipeline.Series["管线"].Points[m]!=null&&chartAllAreaPipeline.Series["管线"].Points[m].YValues[0].ToString() != "0") { chartAllAreaPipeline.Series["管线"].Points[m].Label = chartAllAreaPipeline.Series[0].Points[m].YValues[0].ToString(); } @@ -94,7 +94,7 @@ } catch (Exception ex) { - //LogError.PublishError(ex); + LogHelper.WriteLog(typeof(FrmAllPipelineStatis), ex.Message); } } @@ -147,7 +147,7 @@ } DataTable dt = OledbHelper.QueryTable(sql); - if (dt != null && dt.Rows.Count > 0) + if (dt != null && dt.Rows.Count > 0 && chartAllAreaPipeline.Series["管线"].Points[indexHit]!=null) { dataGridViewX1.DataSource = dt; panel.Visible = true; diff --git a/FrmAllWorkWellStatis.cs b/FrmAllWorkWellStatis.cs index 6fec7af..6af8e4c 100644 --- a/FrmAllWorkWellStatis.cs +++ b/FrmAllWorkWellStatis.cs @@ -52,7 +52,7 @@ chartAllAreaPipeline.Series["井盖"].Points.DataBindXY(workWellLengthAndType.Keys, workWellLengthAndType.Values); for (int m = 0; m < workWellLengthAndType.Values.Count; m++) { - if (chartAllAreaPipeline.Series["井盖"].Points[m].YValues[0].ToString().Trim() != "0") + if (chartAllAreaPipeline.Series["井盖"].Points[m]!=null&&chartAllAreaPipeline.Series["井盖"].Points[m].YValues[0].ToString().Trim() != "0") { chartAllAreaPipeline.Series["井盖"].Points[m].Label = chartAllAreaPipeline.Series[0].Points[m].YValues[0].ToString(); } @@ -60,7 +60,7 @@ } catch (Exception ex) { - //LogError.PublishError(ex); + LogHelper.WriteLog(typeof(FrmAllWorkWellStatis), ex.Message); } } diff --git a/FrmBSQDuoBianXingStatis.cs b/FrmBSQDuoBianXingStatis.cs index e8b7d52..3e889b6 100644 --- a/FrmBSQDuoBianXingStatis.cs +++ b/FrmBSQDuoBianXingStatis.cs @@ -60,7 +60,7 @@ { for (int m = 0; m < bsq1.Values.Count; m++) { - if (chart1.Series["标识器"].Points[m].YValues[0].ToString() != "0") + if (chart1.Series["标识器"].Points[m]!=null&&chart1.Series["标识器"].Points[m].YValues[0].ToString() != "0") { count += Convert.ToInt16(chart1.Series[0].Points[m].YValues[0].ToString()); chart1.Series["标识器"].Points[m].Label = chart1.Series[0].Points[m].YValues[0].ToString(); diff --git a/FrmBSQDuoBianXingStreet.cs b/FrmBSQDuoBianXingStreet.cs index 2005ebb..1db5777 100644 --- a/FrmBSQDuoBianXingStreet.cs +++ b/FrmBSQDuoBianXingStreet.cs @@ -63,7 +63,7 @@ chartStatis.Series[0].Points.DataBindXY(bsq.Keys, bsq.Values); for (int m = 0; m < bsq.Values.Count; m++) { - if (chartStatis.Series[0].Points[m].YValues[0].ToString().Trim() != "0") + if (chartStatis.Series[0].Points[m]!=null&&chartStatis.Series[0].Points[m].YValues[0].ToString().Trim() != "0") { count += Convert.ToInt16(chartStatis.Series[0].Points[m].YValues[0].ToString()); chartStatis.Series[0].Points[m].Label = chartStatis.Series[0].Points[m].YValues[0].ToString(); diff --git a/FrmBSQStatis.cs b/FrmBSQStatis.cs index 390a55c..4aa0ee6 100644 --- a/FrmBSQStatis.cs +++ b/FrmBSQStatis.cs @@ -95,6 +95,8 @@ } } } + + dr.Close(); conn.Close(); for (int i = 0; i < typeLists.Count; i++) { @@ -123,7 +125,7 @@ chartStatis.Series[0].Points.DataBindXY(bsq.Keys, bsq.Values); for (int m = 0; m < bsq.Values.Count; m++) { - if (chartStatis.Series[0].Points[m].YValues[0].ToString().Trim() != "0") + if (chartStatis.Series[0].Points[m]!=null&&chartStatis.Series[0].Points[m].YValues[0].ToString().Trim() != "0") { //count += Convert.ToInt16(chartStatis.Series[0].Points[m].YValues[0].ToString()); chartStatis.Series[0].Points[m].Label = chartStatis.Series[0].Points[m].YValues[0].ToString(); diff --git a/FrmBSQStreet.cs b/FrmBSQStreet.cs index 9d88adb..7fbacad 100644 --- a/FrmBSQStreet.cs +++ b/FrmBSQStreet.cs @@ -44,7 +44,7 @@ chartStatis.Series[0].Points.DataBindXY(bsq.Keys, bsq.Values); for (int m = 0; m < bsq.Values.Count; m++) { - if (chartStatis.Series[0].Points[m].YValues[0].ToString().Trim() != "0") + if (chartStatis.Series[0].Points[m]!=null&&chartStatis.Series[0].Points[m].YValues[0].ToString().Trim() != "0") { count += Convert.ToInt16(chartStatis.Series[0].Points[m].YValues[0].ToString()); chartStatis.Series[0].Points[m].Label = chartStatis.Series[0].Points[m].YValues[0].ToString(); diff --git a/Cyberpipe.csproj b/Cyberpipe.csproj index 07a8c1a..e3cd12c 100644 --- a/Cyberpipe.csproj +++ b/Cyberpipe.csproj @@ -204,25 +204,6 @@ - - Form - - - F_GKT1数据输入输出.cs - - - Form - - - F_GKT1添加文件.cs - - - Form - - - F_GKT1添加项目.cs - - Form @@ -1068,18 +1049,6 @@ Frm_password_reset.cs - - Form - - - GKT.cs - - - Form - - - GKT1.cs - Form @@ -1258,12 +1227,6 @@ F_Projedit.cs - - Form - - - PED.cs - Form @@ -1331,16 +1294,6 @@ True Reference.map - - F_GKT1数据输入输出.cs - Designer - - - F_GKT1添加文件.cs - - - F_GKT1添加项目.cs - Form_EditTask.cs @@ -1836,12 +1789,6 @@ Frm_password_reset.cs - - GKT.cs - - - GKT1.cs - F_GKT数据输入输出.cs @@ -1934,9 +1881,6 @@ F_Projedit.cs - - PED.cs - F_数据输入输出.cs diff --git a/Cyberpipe.suo b/Cyberpipe.suo index 68ced4f..a1aecf8 100644 --- a/Cyberpipe.suo +++ b/Cyberpipe.suo Binary files differ diff --git a/EMS_Forms/Form_EditTask.cs b/EMS_Forms/Form_EditTask.cs index 718992f..f1d791f 100644 --- a/EMS_Forms/Form_EditTask.cs +++ b/EMS_Forms/Form_EditTask.cs @@ -119,7 +119,8 @@ String name = Convert.ToString(dr["USERNAME"]); comboBox_userName.Items.Add(name); - } + } + dr.Close(); comboBox_road.Items.Clear(); roadList = new List(); @@ -135,7 +136,7 @@ comboBox_road.Items.Add(name); } } - + dr1.Close(); conn.Close(); bool flag2 = false; @@ -185,7 +186,7 @@ catch (Exception ex) { - MessageBox.Show(ex.ToString()); + LogHelper.WriteLog(typeof(Form_EditTask), ex.Message); } } @@ -288,7 +289,7 @@ } catch (Exception ex) { - MessageBox.Show(ex.ToString()); + LogHelper.WriteLog(typeof(Form_EditTask), ex.Message); } } @@ -474,7 +475,7 @@ } catch (Exception ex) { - MessageBox.Show(ex.ToString()); + LogHelper.WriteLog(typeof(Form_EditTask), ex.Message); } this.Close(); @@ -495,6 +496,7 @@ { numList.Add(Convert.ToInt32(dr["DBID"])); } + dr.Close(); if (numList.Count == 0) { taskNumber = Convert.ToInt32(number) * 100; @@ -674,6 +676,7 @@ } } } + dr.Close(); conn.Close(); } diff --git a/EMS_Forms/Form_EventManager.cs b/EMS_Forms/Form_EventManager.cs index b18c45b..84807b2 100644 --- a/EMS_Forms/Form_EventManager.cs +++ b/EMS_Forms/Form_EventManager.cs @@ -64,6 +64,7 @@ comboBox_name.Items.Add(name); } + dr.Close(); conn.Close(); diff --git a/Forms/FrmMnModify.cs b/Forms/FrmMnModify.cs index 31cfc5f..d036360 100644 --- a/Forms/FrmMnModify.cs +++ b/Forms/FrmMnModify.cs @@ -68,15 +68,7 @@ questionGrid.Rows[idx].Cells[1].Value = sr.question; } } - /// 选中对象 - /// - /// - /// - /// - private void buttonX1_Click(object sender, EventArgs e) - { - globecontrol.Globe.Action = EnumAction3D.SelectObject; - } + /// /// 选中某一行 /// diff --git a/Forms/FrmPipelineModelDataBase.cs b/Forms/FrmPipelineModelDataBase.cs index 2acf0ca..7ce573f 100644 --- a/Forms/FrmPipelineModelDataBase.cs +++ b/Forms/FrmPipelineModelDataBase.cs @@ -35,19 +35,7 @@ ds = _ds; InitializeComponent(); } - /// - /// 单击选择shp格式文件 - /// - /// - /// - private void btnBrowseModel_Click(object sender, EventArgs e) - { - saveFileDialog1.Filter = "*.lgd|*.lgd"; - if (saveFileDialog1.ShowDialog() == DialogResult.OK) - { - txtModelLayer.Text = saveFileDialog1.FileName; - } - } + /// /// 窗体初始化事件处理 /// @@ -100,49 +88,6 @@ } } } - - private object convertFieldValue(string fieldname, object obj) - { - if (obj == null) - return null; - - try - { - string type = fields_types[fieldname].ToString(); - switch (type) - { - case "string": - return obj.ToString(); - case "int": - //return 101; - int intResult; - if (int.TryParse(obj.ToString(), out intResult)) - return intResult; - else - return null; - case "double": - //return 202.5; - double doubleResult; - if (double.TryParse(obj.ToString(), out doubleResult)) - return doubleResult; - else - return null; - case "date": - DateTime dtResult; - if (DateTime.TryParse(obj.ToString(), out dtResult)) - return dtResult; - else - return null; - } - return null; - } - catch (Exception ex) - { - MessageBox.Show(ex.ToString()); - return null; - } - } - public string lgdFilePath = ""; /// /// 选择管线颜色 @@ -610,33 +555,6 @@ { this.Close(); } - - private void cmbLayer_SelectedIndexChanged(object sender, EventArgs e) //选择图层 - { - GSOLayer layer = ctl.Globe.Layers.GetLayerByCaption(selectLayerName); - GSOFeatures features = layer.GetAllFeatures(); - if (features.Length == 0) - return; - - cmbFrom.Items.Clear(); - cmbTo.Items.Clear(); - cmbRadius.Items.Clear(); - cmbID.Items.Clear(); - for (int i = 0; i < features[0].GetFieldCount(); i++) - { - GeoScene.Data.GSOFieldDefn fielddef = (GeoScene.Data.GSOFieldDefn)(features[0].GetFieldDefn(i)); - - cmbFrom.Items.Add(fielddef.Name); - cmbTo.Items.Add(fielddef.Name); - cmbRadius.Items.Add(fielddef.Name); - cmbID.Items.Add(fielddef.Name); - } - cmbFrom.SelectedItem = "Deep1"; - cmbTo.SelectedItem = "Deep2"; - cmbRadius.SelectedItem = "Diameter"; - cmbID.SelectedItem = "Handle"; - } - private void buttonXLayerPath_Click(object sender, EventArgs e)//单击 选择shp格式的文件 { OpenFileDialog dlg = new OpenFileDialog(); diff --git a/Forms/FrmPipelineModelDataOneStep.cs b/Forms/FrmPipelineModelDataOneStep.cs index 18afda7..ec93b8a 100644 --- a/Forms/FrmPipelineModelDataOneStep.cs +++ b/Forms/FrmPipelineModelDataOneStep.cs @@ -38,19 +38,7 @@ layerTree = _layerTree; InitializeComponent(); } - /// - /// 单击选择shp格式文件 - /// - /// - /// - private void btnBrowseModel_Click(object sender, EventArgs e) - { - saveFileDialog1.Filter = "*.lgd|*.lgd"; - if (saveFileDialog1.ShowDialog() == DialogResult.OK) - { - txtModelLayer.Text = saveFileDialog1.FileName; - } - } + /// /// 窗体初始化事件处理 /// @@ -107,48 +95,7 @@ } } - private object convertFieldValue(string fieldname, object obj) - { - if (obj == null) - return null; - - try - { - string type = fields_types[fieldname].ToString(); - switch (type) - { - case "string": - return obj.ToString(); - case "int": - //return 101; - int intResult; - if (int.TryParse(obj.ToString(), out intResult)) - return intResult; - else - return null; - case "double": - //return 202.5; - double doubleResult; - if (double.TryParse(obj.ToString(), out doubleResult)) - return doubleResult; - else - return null; - case "date": - DateTime dtResult; - if (DateTime.TryParse(obj.ToString(), out dtResult)) - return dtResult; - else - return null; - } - return null; - } - catch (Exception ex) - { - MessageBox.Show(ex.ToString()); - return null; - } - } - + public string lgdFilePath = ""; /// /// 选择管线颜色 @@ -673,32 +620,6 @@ return featDs; } - private void cmbLayer_SelectedIndexChanged(object sender, EventArgs e) //选择图层 - { - GSOLayer layer = ctl.Globe.Layers.GetLayerByCaption(selectLayerName); - GSOFeatures features = layer.GetAllFeatures(); - if (features.Length == 0) - return; - - cmbFrom.Items.Clear(); - cmbTo.Items.Clear(); - cmbRadius.Items.Clear(); - cmbID.Items.Clear(); - for (int i = 0; i < features[0].GetFieldCount(); i++) - { - GeoScene.Data.GSOFieldDefn fielddef = (GeoScene.Data.GSOFieldDefn)(features[0].GetFieldDefn(i)); - - cmbFrom.Items.Add(fielddef.Name); - cmbTo.Items.Add(fielddef.Name); - cmbRadius.Items.Add(fielddef.Name); - cmbID.Items.Add(fielddef.Name); - } - cmbFrom.SelectedItem = "Deep1"; - cmbTo.SelectedItem = "Deep2"; - cmbRadius.SelectedItem = "Diameter"; - cmbID.SelectedItem = "Handle"; - } - private void buttonXLayerPath_Click(object sender, EventArgs e)//单击 选择shp格式的文件 { OpenFileDialog dlg = new OpenFileDialog(); @@ -949,38 +870,6 @@ } //txtLayername.Text = type + layername; } - /// - /// 连接数据库 - /// - /// - /// - private void buttonX1_Click(object sender, EventArgs e) - { - if (ds == null) - { - //没连的话,直接连接审核库; //审核库配置读配置文件 - string dbIp = Utility.sgdbip; - string database = Utility.sgdbname; - string user = Utility.sgdbuser; - string pass = Utility.sgdbpwd; - - if (!Utility.isNetworkConnectionSuccess(dbIp.Trim())) - { - MessageBox.Show("网络连接失败!", "提示"); - return; - } - - ds = ctl.Globe.DataManager.OpenOracleDataSource(dbIp + "/" + database, "", "", user, pass); - if (ds == null) - { - MessageBox.Show("数据库连接失败!", "提示", MessageBoxButtons.OK, MessageBoxIcon.Warning); - } - else - { - btnCreateModel.Enabled = true; - } - } - } private void btnClose_Click(object sender, EventArgs e) { diff --git a/Forms/FrmShRK.cs b/Forms/FrmShRK.cs index 0e2e722..f1d83cb 100644 --- a/Forms/FrmShRK.cs +++ b/Forms/FrmShRK.cs @@ -215,6 +215,7 @@ { sourcefeatds = sourcefeat as GSOFeatureDataset; } + if (sourcefeatds == null) return; sourcefeatds.Open(); GSOFeatures sourcefeatures = sourcefeatds.GetAllFeatures(); @@ -251,6 +252,7 @@ { desfeatds = desfeat as GSOFeatureDataset; } + if (desfeatds == null) return; desfeatds.Open(); //向新数据集写入字段 diff --git a/FrmAccessoriesSensor.cs b/FrmAccessoriesSensor.cs index 09fcdf1..2a7a80e 100644 --- a/FrmAccessoriesSensor.cs +++ b/FrmAccessoriesSensor.cs @@ -209,7 +209,7 @@ chart1.Series[0].Points.DataBindXY(dic.Keys, dic.Values); for (int m = 0; m < dic.Values.Count; m++) { - if (chart1.Series[0].Points[m].YValues[0].ToString() != "0") + if (chart1.Series[0].Points[m]!=null&&chart1.Series[0].Points[m].YValues[0].ToString() != "0") { chart1.Series[0].Points[m].Label = chart1.Series[0].Points[m].YValues[0].ToString(); } diff --git a/FrmAccessoriesgather.cs b/FrmAccessoriesgather.cs index 9e331e1..a475d9e 100644 --- a/FrmAccessoriesgather.cs +++ b/FrmAccessoriesgather.cs @@ -338,7 +338,7 @@ chart1.Series[0].Points.DataBindXY(dic.Keys, dic.Values); for (int m = 0; m < dic.Values.Count; m++) { - if (chart1.Series[0].Points[m].YValues[0].ToString() != "0") + if (chart1.Series[0].Points[m]!=null&&chart1.Series[0].Points[m].YValues[0].ToString() != "0") { chart1.Series[0].Points[m].Label = chart1.Series[0].Points[m].YValues[0].ToString(); } diff --git a/FrmAccessoryAnalysis.cs b/FrmAccessoryAnalysis.cs index 71d4579..44d4065 100644 --- a/FrmAccessoryAnalysis.cs +++ b/FrmAccessoryAnalysis.cs @@ -66,39 +66,6 @@ globeControl1.Refresh(); } /// - /// 键盘按键按下事件处理 - /// - /// - /// - private void txtRadius_KeyPress(object sender, KeyPressEventArgs e) - { - TextBox text = sender as TextBox; - if ((e.KeyChar < 48 || e.KeyChar > 57) && (e.KeyChar != 8) && (int)e.KeyChar != 46) - { - e.Handled = true; - } - if ((int)e.KeyChar == 46) //小数点 - { - if (text.Text.Length <= 0) - e.Handled = true; //小数点不能在第一位 - else //处理不规则的小数点 - { - float f; - float oldf; - bool b1 = false, b2 = false; - b1 = float.TryParse(text.Text, out oldf); - b2 = float.TryParse(text.Text + e.KeyChar.ToString(), out f); - if (b2 == false) - { - if (b1 == true) - e.Handled = true; - else - e.Handled = false; - } - } - } - } - /// /// 确定按钮事件处理 /// /// diff --git a/FrmAddValve.cs b/FrmAddValve.cs index 34d2fec..5f405b9 100644 --- a/FrmAddValve.cs +++ b/FrmAddValve.cs @@ -486,56 +486,6 @@ } } - - - - - - - - private void cmbLayer_SelectedIndexChanged(object sender, EventArgs e) - { - GSOLayer layer = globeControl1.Globe.Layers.GetLayerByCaption(selectLayerName); - GSOFeatures features = layer.GetAllFeatures(); - if (features.Length == 0) - return; - - combPath.Items.Clear(); - combZ.Items.Clear(); - combModelName.Items.Clear(); - - for (int i = 0; i < features[0].GetFieldCount(); i++) - { - GeoScene.Data.GSOFieldDefn fielddef = (GeoScene.Data.GSOFieldDefn)(features[0].GetFieldDefn(i)); - combPath.Items.Add(fielddef.Name); - combZ.Items.Add(fielddef.Name); - combModelName.Items.Add(fielddef.Name); - } - combModelName.SelectedItem = "编号"; - combPath.SelectedItem = "模型路径"; - if (combfile.SelectedIndex != -1) - { - - string layerCaption = combfile.SelectedItem.ToString().Trim(); - rukuLayer = globeControl1.Globe.Layers.GetLayerByCaption(layerCaption); - if (rukuLayer != null) - { - combPath.Items.Clear(); - combZ.Items.Clear(); - combModelName.Items.Clear(); - - } - for (int i = 0; i < features[0].GetFieldCount(); i++) - { - GeoScene.Data.GSOFieldDefn fielddef = (GeoScene.Data.GSOFieldDefn)(features[0].GetFieldDefn(i)); - combPath.Items.Add(fielddef.Name); - combZ.Items.Add(fielddef.Name); - combModelName.Items.Add(fielddef.Name); - } - combModelName.SelectedItem = "编号"; - combPath.SelectedItem = "模型路径"; - } - } /// /// 单击选择shp格式文件 /// diff --git a/FrmAddWellShp.cs b/FrmAddWellShp.cs index bb79ec0..a249725 100644 --- a/FrmAddWellShp.cs +++ b/FrmAddWellShp.cs @@ -478,32 +478,6 @@ } } } - - private void cmbLayer_SelectedIndexChanged(object sender, EventArgs e) - { - GSOLayer layer = globeControl1.Globe.Layers.GetLayerByCaption(selectLayerName); - GSOFeatures features = layer.GetAllFeatures(); - if (features.Length == 0) - return; - - combCode.Items.Clear(); - combDeep.Items.Clear(); - combModelName.Items.Clear(); - combAngle.Items.Clear(); - - for (int i = 0; i < features[0].GetFieldCount(); i++) - { - GeoScene.Data.GSOFieldDefn fielddef = (GeoScene.Data.GSOFieldDefn)(features[0].GetFieldDefn(i)); - combCode.Items.Add(fielddef.Name); - combDeep.Items.Add(fielddef.Name); - combModelName.Items.Add(fielddef.Name); - combAngle.Items.Add(fielddef.Name); - } - combCode.SelectedItem = "附属物编码"; - combDeep.SelectedItem = "井深"; - combModelName.SelectedItem = "编号"; - combAngle.SelectedItem = "符号角度"; - } /// /// 单击选择shp格式文件 /// diff --git a/FrmAddYuBiZiShp.cs b/FrmAddYuBiZiShp.cs index b312d51..332f037 100644 --- a/FrmAddYuBiZiShp.cs +++ b/FrmAddYuBiZiShp.cs @@ -383,80 +383,7 @@ } } - private void cmbLayer_SelectedIndexChanged(object sender, EventArgs e) - { - GSOLayer layer = globeControl1.Globe.Layers.GetLayerByCaption(selectLayerName); - GSOFeatures features = layer.GetAllFeatures(); - if (features.Length == 0) - return; - - combCode.Items.Clear(); - combDeep.Items.Clear(); - combModelName.Items.Clear(); - //comboLoad.Items.Clear(); - for (int i = 0; i < features[0].GetFieldCount(); i++) - { - GeoScene.Data.GSOFieldDefn fielddef = (GeoScene.Data.GSOFieldDefn)(features[0].GetFieldDefn(i)); - combCode.Items.Add(fielddef.Name); - combDeep.Items.Add(fielddef.Name); - combModelName.Items.Add(fielddef.Name); - //comboLoad.Items.Add(fielddef.Name); - } - combCode.SelectedItem = "附属物编码"; - combDeep.SelectedItem = "Z坐标"; - combModelName.SelectedItem = "编号"; - //comboLoad.SelectedItem = "模型路径"; - } - - private void buttonXLayerPath_Click(object sender, EventArgs e) - { - OpenFileDialog dlg = new OpenFileDialog(); - dlg.Filter = "*.shp|*.shp"; - dlg.Multiselect = false; - if (dlg.ShowDialog() == DialogResult.OK) - { - GSOLayer layer = globeControl1.Globe.Layers.Add(dlg.FileName); - string txtMessage = valiYBdata(layer); - if (txtMessage != "") - { - button3.Enabled = false; - //textBoxLayer.Text = ""; - combCode.Items.Clear(); - combDeep.Items.Clear(); - combModelName.Items.Clear(); - globeControl1.Globe.Layers.Remove(layer); - FrmValiDataShowErrorMessage showErrorMessage = new FrmValiDataShowErrorMessage(dlg.FileName, txtMessage); - showErrorMessage.ShowDialog(); - return; - } - else - { - button3.Enabled = true; - //textBoxLayer.Text = dlg.FileName; - selectLayerName = layer.Caption; - txtLayerName.Text = layer.Caption; - GSOFeatures features = layer.GetAllFeatures(); - if (features.Length == 0) - return; - - combCode.Items.Clear(); - combDeep.Items.Clear(); - combModelName.Items.Clear(); - for (int i = 0; i < features[0].GetFieldCount(); i++) - { - GeoScene.Data.GSOFieldDefn fielddef = (GeoScene.Data.GSOFieldDefn)(features[0].GetFieldDefn(i)); - combCode.Items.Add(fielddef.Name); - combDeep.Items.Add(fielddef.Name); - combModelName.Items.Add(fielddef.Name); - //comboLoad.Items.Add(fielddef.Name); - } - combCode.SelectedItem = "管点编码"; - combDeep.SelectedItem = "Z坐标"; - combModelName.SelectedItem = "编号"; - } - } - } - + private void FrmAddYuBiZiShp_FormClosing(object sender, FormClosingEventArgs e) { globeControl1.Globe.Refresh(); diff --git a/FrmAllPipelineStatis.cs b/FrmAllPipelineStatis.cs index 6421a26..a6eea29 100644 --- a/FrmAllPipelineStatis.cs +++ b/FrmAllPipelineStatis.cs @@ -84,7 +84,7 @@ chartAllAreaPipeline.Series["管线"].Points.DataBindXY(pipelineLengthAndType.Keys, pipelineLengthAndType.Values); for (int m = 0; m < pipelineLengthAndType.Values.Count; m++) { - if (chartAllAreaPipeline.Series["管线"].Points[m].YValues[0].ToString() != "0") + if (chartAllAreaPipeline.Series["管线"].Points[m]!=null&&chartAllAreaPipeline.Series["管线"].Points[m].YValues[0].ToString() != "0") { chartAllAreaPipeline.Series["管线"].Points[m].Label = chartAllAreaPipeline.Series[0].Points[m].YValues[0].ToString(); } @@ -94,7 +94,7 @@ } catch (Exception ex) { - //LogError.PublishError(ex); + LogHelper.WriteLog(typeof(FrmAllPipelineStatis), ex.Message); } } @@ -147,7 +147,7 @@ } DataTable dt = OledbHelper.QueryTable(sql); - if (dt != null && dt.Rows.Count > 0) + if (dt != null && dt.Rows.Count > 0 && chartAllAreaPipeline.Series["管线"].Points[indexHit]!=null) { dataGridViewX1.DataSource = dt; panel.Visible = true; diff --git a/FrmAllWorkWellStatis.cs b/FrmAllWorkWellStatis.cs index 6fec7af..6af8e4c 100644 --- a/FrmAllWorkWellStatis.cs +++ b/FrmAllWorkWellStatis.cs @@ -52,7 +52,7 @@ chartAllAreaPipeline.Series["井盖"].Points.DataBindXY(workWellLengthAndType.Keys, workWellLengthAndType.Values); for (int m = 0; m < workWellLengthAndType.Values.Count; m++) { - if (chartAllAreaPipeline.Series["井盖"].Points[m].YValues[0].ToString().Trim() != "0") + if (chartAllAreaPipeline.Series["井盖"].Points[m]!=null&&chartAllAreaPipeline.Series["井盖"].Points[m].YValues[0].ToString().Trim() != "0") { chartAllAreaPipeline.Series["井盖"].Points[m].Label = chartAllAreaPipeline.Series[0].Points[m].YValues[0].ToString(); } @@ -60,7 +60,7 @@ } catch (Exception ex) { - //LogError.PublishError(ex); + LogHelper.WriteLog(typeof(FrmAllWorkWellStatis), ex.Message); } } diff --git a/FrmBSQDuoBianXingStatis.cs b/FrmBSQDuoBianXingStatis.cs index e8b7d52..3e889b6 100644 --- a/FrmBSQDuoBianXingStatis.cs +++ b/FrmBSQDuoBianXingStatis.cs @@ -60,7 +60,7 @@ { for (int m = 0; m < bsq1.Values.Count; m++) { - if (chart1.Series["标识器"].Points[m].YValues[0].ToString() != "0") + if (chart1.Series["标识器"].Points[m]!=null&&chart1.Series["标识器"].Points[m].YValues[0].ToString() != "0") { count += Convert.ToInt16(chart1.Series[0].Points[m].YValues[0].ToString()); chart1.Series["标识器"].Points[m].Label = chart1.Series[0].Points[m].YValues[0].ToString(); diff --git a/FrmBSQDuoBianXingStreet.cs b/FrmBSQDuoBianXingStreet.cs index 2005ebb..1db5777 100644 --- a/FrmBSQDuoBianXingStreet.cs +++ b/FrmBSQDuoBianXingStreet.cs @@ -63,7 +63,7 @@ chartStatis.Series[0].Points.DataBindXY(bsq.Keys, bsq.Values); for (int m = 0; m < bsq.Values.Count; m++) { - if (chartStatis.Series[0].Points[m].YValues[0].ToString().Trim() != "0") + if (chartStatis.Series[0].Points[m]!=null&&chartStatis.Series[0].Points[m].YValues[0].ToString().Trim() != "0") { count += Convert.ToInt16(chartStatis.Series[0].Points[m].YValues[0].ToString()); chartStatis.Series[0].Points[m].Label = chartStatis.Series[0].Points[m].YValues[0].ToString(); diff --git a/FrmBSQStatis.cs b/FrmBSQStatis.cs index 390a55c..4aa0ee6 100644 --- a/FrmBSQStatis.cs +++ b/FrmBSQStatis.cs @@ -95,6 +95,8 @@ } } } + + dr.Close(); conn.Close(); for (int i = 0; i < typeLists.Count; i++) { @@ -123,7 +125,7 @@ chartStatis.Series[0].Points.DataBindXY(bsq.Keys, bsq.Values); for (int m = 0; m < bsq.Values.Count; m++) { - if (chartStatis.Series[0].Points[m].YValues[0].ToString().Trim() != "0") + if (chartStatis.Series[0].Points[m]!=null&&chartStatis.Series[0].Points[m].YValues[0].ToString().Trim() != "0") { //count += Convert.ToInt16(chartStatis.Series[0].Points[m].YValues[0].ToString()); chartStatis.Series[0].Points[m].Label = chartStatis.Series[0].Points[m].YValues[0].ToString(); diff --git a/FrmBSQStreet.cs b/FrmBSQStreet.cs index 9d88adb..7fbacad 100644 --- a/FrmBSQStreet.cs +++ b/FrmBSQStreet.cs @@ -44,7 +44,7 @@ chartStatis.Series[0].Points.DataBindXY(bsq.Keys, bsq.Values); for (int m = 0; m < bsq.Values.Count; m++) { - if (chartStatis.Series[0].Points[m].YValues[0].ToString().Trim() != "0") + if (chartStatis.Series[0].Points[m]!=null&&chartStatis.Series[0].Points[m].YValues[0].ToString().Trim() != "0") { count += Convert.ToInt16(chartStatis.Series[0].Points[m].YValues[0].ToString()); chartStatis.Series[0].Points[m].Label = chartStatis.Series[0].Points[m].YValues[0].ToString(); diff --git a/FrmBoosterValvers.cs b/FrmBoosterValvers.cs index 5061efc..df9b62b 100644 --- a/FrmBoosterValvers.cs +++ b/FrmBoosterValvers.cs @@ -236,199 +236,6 @@ count = 0; } } - /// - /// 添加火苗 - /// - /// - /// - /// - /// - private GSOFeature AddFire(double x,double y,double z) - { - // 烟火示例 - - string strResPath = Application.StartupPath + "/Resource"; - - // 烟火粒子示例,由三个发射器构成 - GSOGeoParticle geoParticle = new GSOGeoParticle(); - geoParticle.SetPosition(x, y, z); // 添加到这个经纬度位置 - geoParticle.AltitudeMode = EnumAltitudeMode.RelativeToGround; - - GSORingParticleEmitter emitter = new GSORingParticleEmitter(); - emitter.TexturePath = strResPath + "/ParticleImage/flare.png"; - - emitter.SetSizeFix(1, 1); - emitter.VelFix = 1; - emitter.VelRnd = 5; - - emitter.AngleXYFix = 0; - emitter.AngleXYRnd = 180; - - emitter.AngleXZFix = 90; - emitter.AngleXZRnd = 0; - - emitter.LifeFix = 0.5f; - emitter.LifeRnd = 0.0f; - - emitter.RotFix = 0; - emitter.RotRnd = 0; - - emitter.RotVelFix = 0; - emitter.RotVelRnd = 0; - - emitter.EmitPerSec = 100; - - // 采用线性插值生成粒子的初始颜色 - emitter.ColorRndStart = Color.White; - emitter.ColorRndEnd = Color.Red; - - - GSOColorParticleEffector effector2 = new GSOColorParticleEffector(); - effector2.SetColorChanged(0, -1, -1, 0); - effector2.StartTime = 0.0f; - effector2.EndTime = -1.0f; - emitter.AddEffector(effector2); - - // 将三个发射器添加到粒子对象中 - geoParticle.AddEmitter(emitter); - - geoParticle.Play(); - - GSOFeature feature = new GSOFeature(); - - feature.Geometry = geoParticle; - - globeControl1.Globe.MemoryLayer.AddFeature(feature); - - - return feature; - } - - /// - /// 添加喷泉 - /// - /// - private GSOFeature AddFountain() - { - string strResPath = Application.StartupPath + "/Resource"; - - GSOGeoParticle geoParticle = new GSOGeoParticle(); - geoParticle.SetPosition(116.314, 39.84, 0); // 添加到这个经纬度位置 - - GSOPointParticleEmitter emitter = new GSOPointParticleEmitter(); - emitter.TexturePath = strResPath + "/ParticleImage/test.png"; - - emitter.SetSizeFix(0.5f, 2); - emitter.VelFix = 10; - emitter.VelRnd = 2; - - emitter.GravityAcc = 9.8f; - emitter.AngleXYFix = 0; - emitter.AngleXYRnd = 180; - - emitter.AngleXZFix = 88; - emitter.AngleXZRnd = 2; - - //emitter.InnerRadius = 0; - // emitter.OuterRadius = 0.03f; - - emitter.LifeFix = 5.0f; - emitter.LifeRnd = 1.0f; - - emitter.RotFix = 0; - emitter.RotRnd = 0; - - emitter.RotVelFix = 0; - emitter.RotVelRnd = 0; - - emitter.EmitPerSec = 1000; - emitter.ColorRndStart = Color.FromArgb(33, 255, 255, 255); - emitter.ColorRndEnd = Color.FromArgb(11, 255, 255, 255); - emitter.IsLumAdded = false; - - // 将三个发射器添加到粒子对象中 - geoParticle.AddEmitter(emitter); - - geoParticle.Play(); - GSOFeature feature = new GSOFeature(); - - feature.Geometry = geoParticle; - - //globeControl1.Globe.MemoryLayer.AddFeature(feature); - globeControl1.Globe.FlyToFeature(feature); - - return feature; - } - - /// - /// 添加水柱 - /// - /// - private GSOFeature AddWaterLine() - { - string strResPath = Application.StartupPath + "/Resource"; - - GSOGeoParticle geoParticle = new GSOGeoParticle(); - geoParticle.SetPosition(116.308, 39.84, 0); // 添加到这个经纬度位置 - - GSOPointParticleEmitter emitter = new GSOPointParticleEmitter(); - - emitter.TexturePath = strResPath + "/ParticleImage/drop3.png"; - - geoParticle.TimerInterval = 1; - - emitter.SetSizeFix(2.0f, 2.0f); - - emitter.VelFix = 50; - emitter.VelRnd = 2; - - // emitter.IsLumAdded = false; - - emitter.GravityAcc = 9.8f; - emitter.AngleXYFix = 0; - emitter.AngleXYRnd = 2; - - emitter.AngleXZFix = 60; - emitter.AngleXZRnd = 2; - - //emitter.InnerRadius = 0; - // emitter.OuterRadius = 0.1f; - - emitter.LifeFix = 5.0f; - emitter.LifeRnd = 1.0f; - - emitter.RotFix = 0; - emitter.RotRnd = 0; - - emitter.RotVelFix = 0; - emitter.RotVelRnd = 0; - - emitter.EmitPerSec = 1500; - - emitter.ColorRndStart = Color.FromArgb(100, 222, 222, 222); - emitter.ColorRndEnd = Color.FromArgb(50, 222, 222, 222); - - /* - - GSOScaleParticleEffector effector1 = new GSOScaleParticleEffector(); - effector1.SetScale(0.2f, 0.2f); - effector1.StartTime = 0; - effector1.EndTime = -1; // 负数表示整个粒子生命结束 - emitter.AddEffector(effector1); - */ - - // 将三个发射器添加到粒子对象中 - geoParticle.AddEmitter(emitter); - - geoParticle.Play(); - GSOFeature feature = new GSOFeature(); - - feature.Geometry = geoParticle; - - //globeControl1.Globe.MemoryLayer.AddFeature(feature); - globeControl1.Globe.FlyToFeature(feature); - - return feature; - } + } } diff --git a/Cyberpipe.csproj b/Cyberpipe.csproj index 07a8c1a..e3cd12c 100644 --- a/Cyberpipe.csproj +++ b/Cyberpipe.csproj @@ -204,25 +204,6 @@ - - Form - - - F_GKT1数据输入输出.cs - - - Form - - - F_GKT1添加文件.cs - - - Form - - - F_GKT1添加项目.cs - - Form @@ -1068,18 +1049,6 @@ Frm_password_reset.cs - - Form - - - GKT.cs - - - Form - - - GKT1.cs - Form @@ -1258,12 +1227,6 @@ F_Projedit.cs - - Form - - - PED.cs - Form @@ -1331,16 +1294,6 @@ True Reference.map - - F_GKT1数据输入输出.cs - Designer - - - F_GKT1添加文件.cs - - - F_GKT1添加项目.cs - Form_EditTask.cs @@ -1836,12 +1789,6 @@ Frm_password_reset.cs - - GKT.cs - - - GKT1.cs - F_GKT数据输入输出.cs @@ -1934,9 +1881,6 @@ F_Projedit.cs - - PED.cs - F_数据输入输出.cs diff --git a/Cyberpipe.suo b/Cyberpipe.suo index 68ced4f..a1aecf8 100644 --- a/Cyberpipe.suo +++ b/Cyberpipe.suo Binary files differ diff --git a/EMS_Forms/Form_EditTask.cs b/EMS_Forms/Form_EditTask.cs index 718992f..f1d791f 100644 --- a/EMS_Forms/Form_EditTask.cs +++ b/EMS_Forms/Form_EditTask.cs @@ -119,7 +119,8 @@ String name = Convert.ToString(dr["USERNAME"]); comboBox_userName.Items.Add(name); - } + } + dr.Close(); comboBox_road.Items.Clear(); roadList = new List(); @@ -135,7 +136,7 @@ comboBox_road.Items.Add(name); } } - + dr1.Close(); conn.Close(); bool flag2 = false; @@ -185,7 +186,7 @@ catch (Exception ex) { - MessageBox.Show(ex.ToString()); + LogHelper.WriteLog(typeof(Form_EditTask), ex.Message); } } @@ -288,7 +289,7 @@ } catch (Exception ex) { - MessageBox.Show(ex.ToString()); + LogHelper.WriteLog(typeof(Form_EditTask), ex.Message); } } @@ -474,7 +475,7 @@ } catch (Exception ex) { - MessageBox.Show(ex.ToString()); + LogHelper.WriteLog(typeof(Form_EditTask), ex.Message); } this.Close(); @@ -495,6 +496,7 @@ { numList.Add(Convert.ToInt32(dr["DBID"])); } + dr.Close(); if (numList.Count == 0) { taskNumber = Convert.ToInt32(number) * 100; @@ -674,6 +676,7 @@ } } } + dr.Close(); conn.Close(); } diff --git a/EMS_Forms/Form_EventManager.cs b/EMS_Forms/Form_EventManager.cs index b18c45b..84807b2 100644 --- a/EMS_Forms/Form_EventManager.cs +++ b/EMS_Forms/Form_EventManager.cs @@ -64,6 +64,7 @@ comboBox_name.Items.Add(name); } + dr.Close(); conn.Close(); diff --git a/Forms/FrmMnModify.cs b/Forms/FrmMnModify.cs index 31cfc5f..d036360 100644 --- a/Forms/FrmMnModify.cs +++ b/Forms/FrmMnModify.cs @@ -68,15 +68,7 @@ questionGrid.Rows[idx].Cells[1].Value = sr.question; } } - /// 选中对象 - /// - /// - /// - /// - private void buttonX1_Click(object sender, EventArgs e) - { - globecontrol.Globe.Action = EnumAction3D.SelectObject; - } + /// /// 选中某一行 /// diff --git a/Forms/FrmPipelineModelDataBase.cs b/Forms/FrmPipelineModelDataBase.cs index 2acf0ca..7ce573f 100644 --- a/Forms/FrmPipelineModelDataBase.cs +++ b/Forms/FrmPipelineModelDataBase.cs @@ -35,19 +35,7 @@ ds = _ds; InitializeComponent(); } - /// - /// 单击选择shp格式文件 - /// - /// - /// - private void btnBrowseModel_Click(object sender, EventArgs e) - { - saveFileDialog1.Filter = "*.lgd|*.lgd"; - if (saveFileDialog1.ShowDialog() == DialogResult.OK) - { - txtModelLayer.Text = saveFileDialog1.FileName; - } - } + /// /// 窗体初始化事件处理 /// @@ -100,49 +88,6 @@ } } } - - private object convertFieldValue(string fieldname, object obj) - { - if (obj == null) - return null; - - try - { - string type = fields_types[fieldname].ToString(); - switch (type) - { - case "string": - return obj.ToString(); - case "int": - //return 101; - int intResult; - if (int.TryParse(obj.ToString(), out intResult)) - return intResult; - else - return null; - case "double": - //return 202.5; - double doubleResult; - if (double.TryParse(obj.ToString(), out doubleResult)) - return doubleResult; - else - return null; - case "date": - DateTime dtResult; - if (DateTime.TryParse(obj.ToString(), out dtResult)) - return dtResult; - else - return null; - } - return null; - } - catch (Exception ex) - { - MessageBox.Show(ex.ToString()); - return null; - } - } - public string lgdFilePath = ""; /// /// 选择管线颜色 @@ -610,33 +555,6 @@ { this.Close(); } - - private void cmbLayer_SelectedIndexChanged(object sender, EventArgs e) //选择图层 - { - GSOLayer layer = ctl.Globe.Layers.GetLayerByCaption(selectLayerName); - GSOFeatures features = layer.GetAllFeatures(); - if (features.Length == 0) - return; - - cmbFrom.Items.Clear(); - cmbTo.Items.Clear(); - cmbRadius.Items.Clear(); - cmbID.Items.Clear(); - for (int i = 0; i < features[0].GetFieldCount(); i++) - { - GeoScene.Data.GSOFieldDefn fielddef = (GeoScene.Data.GSOFieldDefn)(features[0].GetFieldDefn(i)); - - cmbFrom.Items.Add(fielddef.Name); - cmbTo.Items.Add(fielddef.Name); - cmbRadius.Items.Add(fielddef.Name); - cmbID.Items.Add(fielddef.Name); - } - cmbFrom.SelectedItem = "Deep1"; - cmbTo.SelectedItem = "Deep2"; - cmbRadius.SelectedItem = "Diameter"; - cmbID.SelectedItem = "Handle"; - } - private void buttonXLayerPath_Click(object sender, EventArgs e)//单击 选择shp格式的文件 { OpenFileDialog dlg = new OpenFileDialog(); diff --git a/Forms/FrmPipelineModelDataOneStep.cs b/Forms/FrmPipelineModelDataOneStep.cs index 18afda7..ec93b8a 100644 --- a/Forms/FrmPipelineModelDataOneStep.cs +++ b/Forms/FrmPipelineModelDataOneStep.cs @@ -38,19 +38,7 @@ layerTree = _layerTree; InitializeComponent(); } - /// - /// 单击选择shp格式文件 - /// - /// - /// - private void btnBrowseModel_Click(object sender, EventArgs e) - { - saveFileDialog1.Filter = "*.lgd|*.lgd"; - if (saveFileDialog1.ShowDialog() == DialogResult.OK) - { - txtModelLayer.Text = saveFileDialog1.FileName; - } - } + /// /// 窗体初始化事件处理 /// @@ -107,48 +95,7 @@ } } - private object convertFieldValue(string fieldname, object obj) - { - if (obj == null) - return null; - - try - { - string type = fields_types[fieldname].ToString(); - switch (type) - { - case "string": - return obj.ToString(); - case "int": - //return 101; - int intResult; - if (int.TryParse(obj.ToString(), out intResult)) - return intResult; - else - return null; - case "double": - //return 202.5; - double doubleResult; - if (double.TryParse(obj.ToString(), out doubleResult)) - return doubleResult; - else - return null; - case "date": - DateTime dtResult; - if (DateTime.TryParse(obj.ToString(), out dtResult)) - return dtResult; - else - return null; - } - return null; - } - catch (Exception ex) - { - MessageBox.Show(ex.ToString()); - return null; - } - } - + public string lgdFilePath = ""; /// /// 选择管线颜色 @@ -673,32 +620,6 @@ return featDs; } - private void cmbLayer_SelectedIndexChanged(object sender, EventArgs e) //选择图层 - { - GSOLayer layer = ctl.Globe.Layers.GetLayerByCaption(selectLayerName); - GSOFeatures features = layer.GetAllFeatures(); - if (features.Length == 0) - return; - - cmbFrom.Items.Clear(); - cmbTo.Items.Clear(); - cmbRadius.Items.Clear(); - cmbID.Items.Clear(); - for (int i = 0; i < features[0].GetFieldCount(); i++) - { - GeoScene.Data.GSOFieldDefn fielddef = (GeoScene.Data.GSOFieldDefn)(features[0].GetFieldDefn(i)); - - cmbFrom.Items.Add(fielddef.Name); - cmbTo.Items.Add(fielddef.Name); - cmbRadius.Items.Add(fielddef.Name); - cmbID.Items.Add(fielddef.Name); - } - cmbFrom.SelectedItem = "Deep1"; - cmbTo.SelectedItem = "Deep2"; - cmbRadius.SelectedItem = "Diameter"; - cmbID.SelectedItem = "Handle"; - } - private void buttonXLayerPath_Click(object sender, EventArgs e)//单击 选择shp格式的文件 { OpenFileDialog dlg = new OpenFileDialog(); @@ -949,38 +870,6 @@ } //txtLayername.Text = type + layername; } - /// - /// 连接数据库 - /// - /// - /// - private void buttonX1_Click(object sender, EventArgs e) - { - if (ds == null) - { - //没连的话,直接连接审核库; //审核库配置读配置文件 - string dbIp = Utility.sgdbip; - string database = Utility.sgdbname; - string user = Utility.sgdbuser; - string pass = Utility.sgdbpwd; - - if (!Utility.isNetworkConnectionSuccess(dbIp.Trim())) - { - MessageBox.Show("网络连接失败!", "提示"); - return; - } - - ds = ctl.Globe.DataManager.OpenOracleDataSource(dbIp + "/" + database, "", "", user, pass); - if (ds == null) - { - MessageBox.Show("数据库连接失败!", "提示", MessageBoxButtons.OK, MessageBoxIcon.Warning); - } - else - { - btnCreateModel.Enabled = true; - } - } - } private void btnClose_Click(object sender, EventArgs e) { diff --git a/Forms/FrmShRK.cs b/Forms/FrmShRK.cs index 0e2e722..f1d83cb 100644 --- a/Forms/FrmShRK.cs +++ b/Forms/FrmShRK.cs @@ -215,6 +215,7 @@ { sourcefeatds = sourcefeat as GSOFeatureDataset; } + if (sourcefeatds == null) return; sourcefeatds.Open(); GSOFeatures sourcefeatures = sourcefeatds.GetAllFeatures(); @@ -251,6 +252,7 @@ { desfeatds = desfeat as GSOFeatureDataset; } + if (desfeatds == null) return; desfeatds.Open(); //向新数据集写入字段 diff --git a/FrmAccessoriesSensor.cs b/FrmAccessoriesSensor.cs index 09fcdf1..2a7a80e 100644 --- a/FrmAccessoriesSensor.cs +++ b/FrmAccessoriesSensor.cs @@ -209,7 +209,7 @@ chart1.Series[0].Points.DataBindXY(dic.Keys, dic.Values); for (int m = 0; m < dic.Values.Count; m++) { - if (chart1.Series[0].Points[m].YValues[0].ToString() != "0") + if (chart1.Series[0].Points[m]!=null&&chart1.Series[0].Points[m].YValues[0].ToString() != "0") { chart1.Series[0].Points[m].Label = chart1.Series[0].Points[m].YValues[0].ToString(); } diff --git a/FrmAccessoriesgather.cs b/FrmAccessoriesgather.cs index 9e331e1..a475d9e 100644 --- a/FrmAccessoriesgather.cs +++ b/FrmAccessoriesgather.cs @@ -338,7 +338,7 @@ chart1.Series[0].Points.DataBindXY(dic.Keys, dic.Values); for (int m = 0; m < dic.Values.Count; m++) { - if (chart1.Series[0].Points[m].YValues[0].ToString() != "0") + if (chart1.Series[0].Points[m]!=null&&chart1.Series[0].Points[m].YValues[0].ToString() != "0") { chart1.Series[0].Points[m].Label = chart1.Series[0].Points[m].YValues[0].ToString(); } diff --git a/FrmAccessoryAnalysis.cs b/FrmAccessoryAnalysis.cs index 71d4579..44d4065 100644 --- a/FrmAccessoryAnalysis.cs +++ b/FrmAccessoryAnalysis.cs @@ -66,39 +66,6 @@ globeControl1.Refresh(); } /// - /// 键盘按键按下事件处理 - /// - /// - /// - private void txtRadius_KeyPress(object sender, KeyPressEventArgs e) - { - TextBox text = sender as TextBox; - if ((e.KeyChar < 48 || e.KeyChar > 57) && (e.KeyChar != 8) && (int)e.KeyChar != 46) - { - e.Handled = true; - } - if ((int)e.KeyChar == 46) //小数点 - { - if (text.Text.Length <= 0) - e.Handled = true; //小数点不能在第一位 - else //处理不规则的小数点 - { - float f; - float oldf; - bool b1 = false, b2 = false; - b1 = float.TryParse(text.Text, out oldf); - b2 = float.TryParse(text.Text + e.KeyChar.ToString(), out f); - if (b2 == false) - { - if (b1 == true) - e.Handled = true; - else - e.Handled = false; - } - } - } - } - /// /// 确定按钮事件处理 /// /// diff --git a/FrmAddValve.cs b/FrmAddValve.cs index 34d2fec..5f405b9 100644 --- a/FrmAddValve.cs +++ b/FrmAddValve.cs @@ -486,56 +486,6 @@ } } - - - - - - - - private void cmbLayer_SelectedIndexChanged(object sender, EventArgs e) - { - GSOLayer layer = globeControl1.Globe.Layers.GetLayerByCaption(selectLayerName); - GSOFeatures features = layer.GetAllFeatures(); - if (features.Length == 0) - return; - - combPath.Items.Clear(); - combZ.Items.Clear(); - combModelName.Items.Clear(); - - for (int i = 0; i < features[0].GetFieldCount(); i++) - { - GeoScene.Data.GSOFieldDefn fielddef = (GeoScene.Data.GSOFieldDefn)(features[0].GetFieldDefn(i)); - combPath.Items.Add(fielddef.Name); - combZ.Items.Add(fielddef.Name); - combModelName.Items.Add(fielddef.Name); - } - combModelName.SelectedItem = "编号"; - combPath.SelectedItem = "模型路径"; - if (combfile.SelectedIndex != -1) - { - - string layerCaption = combfile.SelectedItem.ToString().Trim(); - rukuLayer = globeControl1.Globe.Layers.GetLayerByCaption(layerCaption); - if (rukuLayer != null) - { - combPath.Items.Clear(); - combZ.Items.Clear(); - combModelName.Items.Clear(); - - } - for (int i = 0; i < features[0].GetFieldCount(); i++) - { - GeoScene.Data.GSOFieldDefn fielddef = (GeoScene.Data.GSOFieldDefn)(features[0].GetFieldDefn(i)); - combPath.Items.Add(fielddef.Name); - combZ.Items.Add(fielddef.Name); - combModelName.Items.Add(fielddef.Name); - } - combModelName.SelectedItem = "编号"; - combPath.SelectedItem = "模型路径"; - } - } /// /// 单击选择shp格式文件 /// diff --git a/FrmAddWellShp.cs b/FrmAddWellShp.cs index bb79ec0..a249725 100644 --- a/FrmAddWellShp.cs +++ b/FrmAddWellShp.cs @@ -478,32 +478,6 @@ } } } - - private void cmbLayer_SelectedIndexChanged(object sender, EventArgs e) - { - GSOLayer layer = globeControl1.Globe.Layers.GetLayerByCaption(selectLayerName); - GSOFeatures features = layer.GetAllFeatures(); - if (features.Length == 0) - return; - - combCode.Items.Clear(); - combDeep.Items.Clear(); - combModelName.Items.Clear(); - combAngle.Items.Clear(); - - for (int i = 0; i < features[0].GetFieldCount(); i++) - { - GeoScene.Data.GSOFieldDefn fielddef = (GeoScene.Data.GSOFieldDefn)(features[0].GetFieldDefn(i)); - combCode.Items.Add(fielddef.Name); - combDeep.Items.Add(fielddef.Name); - combModelName.Items.Add(fielddef.Name); - combAngle.Items.Add(fielddef.Name); - } - combCode.SelectedItem = "附属物编码"; - combDeep.SelectedItem = "井深"; - combModelName.SelectedItem = "编号"; - combAngle.SelectedItem = "符号角度"; - } /// /// 单击选择shp格式文件 /// diff --git a/FrmAddYuBiZiShp.cs b/FrmAddYuBiZiShp.cs index b312d51..332f037 100644 --- a/FrmAddYuBiZiShp.cs +++ b/FrmAddYuBiZiShp.cs @@ -383,80 +383,7 @@ } } - private void cmbLayer_SelectedIndexChanged(object sender, EventArgs e) - { - GSOLayer layer = globeControl1.Globe.Layers.GetLayerByCaption(selectLayerName); - GSOFeatures features = layer.GetAllFeatures(); - if (features.Length == 0) - return; - - combCode.Items.Clear(); - combDeep.Items.Clear(); - combModelName.Items.Clear(); - //comboLoad.Items.Clear(); - for (int i = 0; i < features[0].GetFieldCount(); i++) - { - GeoScene.Data.GSOFieldDefn fielddef = (GeoScene.Data.GSOFieldDefn)(features[0].GetFieldDefn(i)); - combCode.Items.Add(fielddef.Name); - combDeep.Items.Add(fielddef.Name); - combModelName.Items.Add(fielddef.Name); - //comboLoad.Items.Add(fielddef.Name); - } - combCode.SelectedItem = "附属物编码"; - combDeep.SelectedItem = "Z坐标"; - combModelName.SelectedItem = "编号"; - //comboLoad.SelectedItem = "模型路径"; - } - - private void buttonXLayerPath_Click(object sender, EventArgs e) - { - OpenFileDialog dlg = new OpenFileDialog(); - dlg.Filter = "*.shp|*.shp"; - dlg.Multiselect = false; - if (dlg.ShowDialog() == DialogResult.OK) - { - GSOLayer layer = globeControl1.Globe.Layers.Add(dlg.FileName); - string txtMessage = valiYBdata(layer); - if (txtMessage != "") - { - button3.Enabled = false; - //textBoxLayer.Text = ""; - combCode.Items.Clear(); - combDeep.Items.Clear(); - combModelName.Items.Clear(); - globeControl1.Globe.Layers.Remove(layer); - FrmValiDataShowErrorMessage showErrorMessage = new FrmValiDataShowErrorMessage(dlg.FileName, txtMessage); - showErrorMessage.ShowDialog(); - return; - } - else - { - button3.Enabled = true; - //textBoxLayer.Text = dlg.FileName; - selectLayerName = layer.Caption; - txtLayerName.Text = layer.Caption; - GSOFeatures features = layer.GetAllFeatures(); - if (features.Length == 0) - return; - - combCode.Items.Clear(); - combDeep.Items.Clear(); - combModelName.Items.Clear(); - for (int i = 0; i < features[0].GetFieldCount(); i++) - { - GeoScene.Data.GSOFieldDefn fielddef = (GeoScene.Data.GSOFieldDefn)(features[0].GetFieldDefn(i)); - combCode.Items.Add(fielddef.Name); - combDeep.Items.Add(fielddef.Name); - combModelName.Items.Add(fielddef.Name); - //comboLoad.Items.Add(fielddef.Name); - } - combCode.SelectedItem = "管点编码"; - combDeep.SelectedItem = "Z坐标"; - combModelName.SelectedItem = "编号"; - } - } - } - + private void FrmAddYuBiZiShp_FormClosing(object sender, FormClosingEventArgs e) { globeControl1.Globe.Refresh(); diff --git a/FrmAllPipelineStatis.cs b/FrmAllPipelineStatis.cs index 6421a26..a6eea29 100644 --- a/FrmAllPipelineStatis.cs +++ b/FrmAllPipelineStatis.cs @@ -84,7 +84,7 @@ chartAllAreaPipeline.Series["管线"].Points.DataBindXY(pipelineLengthAndType.Keys, pipelineLengthAndType.Values); for (int m = 0; m < pipelineLengthAndType.Values.Count; m++) { - if (chartAllAreaPipeline.Series["管线"].Points[m].YValues[0].ToString() != "0") + if (chartAllAreaPipeline.Series["管线"].Points[m]!=null&&chartAllAreaPipeline.Series["管线"].Points[m].YValues[0].ToString() != "0") { chartAllAreaPipeline.Series["管线"].Points[m].Label = chartAllAreaPipeline.Series[0].Points[m].YValues[0].ToString(); } @@ -94,7 +94,7 @@ } catch (Exception ex) { - //LogError.PublishError(ex); + LogHelper.WriteLog(typeof(FrmAllPipelineStatis), ex.Message); } } @@ -147,7 +147,7 @@ } DataTable dt = OledbHelper.QueryTable(sql); - if (dt != null && dt.Rows.Count > 0) + if (dt != null && dt.Rows.Count > 0 && chartAllAreaPipeline.Series["管线"].Points[indexHit]!=null) { dataGridViewX1.DataSource = dt; panel.Visible = true; diff --git a/FrmAllWorkWellStatis.cs b/FrmAllWorkWellStatis.cs index 6fec7af..6af8e4c 100644 --- a/FrmAllWorkWellStatis.cs +++ b/FrmAllWorkWellStatis.cs @@ -52,7 +52,7 @@ chartAllAreaPipeline.Series["井盖"].Points.DataBindXY(workWellLengthAndType.Keys, workWellLengthAndType.Values); for (int m = 0; m < workWellLengthAndType.Values.Count; m++) { - if (chartAllAreaPipeline.Series["井盖"].Points[m].YValues[0].ToString().Trim() != "0") + if (chartAllAreaPipeline.Series["井盖"].Points[m]!=null&&chartAllAreaPipeline.Series["井盖"].Points[m].YValues[0].ToString().Trim() != "0") { chartAllAreaPipeline.Series["井盖"].Points[m].Label = chartAllAreaPipeline.Series[0].Points[m].YValues[0].ToString(); } @@ -60,7 +60,7 @@ } catch (Exception ex) { - //LogError.PublishError(ex); + LogHelper.WriteLog(typeof(FrmAllWorkWellStatis), ex.Message); } } diff --git a/FrmBSQDuoBianXingStatis.cs b/FrmBSQDuoBianXingStatis.cs index e8b7d52..3e889b6 100644 --- a/FrmBSQDuoBianXingStatis.cs +++ b/FrmBSQDuoBianXingStatis.cs @@ -60,7 +60,7 @@ { for (int m = 0; m < bsq1.Values.Count; m++) { - if (chart1.Series["标识器"].Points[m].YValues[0].ToString() != "0") + if (chart1.Series["标识器"].Points[m]!=null&&chart1.Series["标识器"].Points[m].YValues[0].ToString() != "0") { count += Convert.ToInt16(chart1.Series[0].Points[m].YValues[0].ToString()); chart1.Series["标识器"].Points[m].Label = chart1.Series[0].Points[m].YValues[0].ToString(); diff --git a/FrmBSQDuoBianXingStreet.cs b/FrmBSQDuoBianXingStreet.cs index 2005ebb..1db5777 100644 --- a/FrmBSQDuoBianXingStreet.cs +++ b/FrmBSQDuoBianXingStreet.cs @@ -63,7 +63,7 @@ chartStatis.Series[0].Points.DataBindXY(bsq.Keys, bsq.Values); for (int m = 0; m < bsq.Values.Count; m++) { - if (chartStatis.Series[0].Points[m].YValues[0].ToString().Trim() != "0") + if (chartStatis.Series[0].Points[m]!=null&&chartStatis.Series[0].Points[m].YValues[0].ToString().Trim() != "0") { count += Convert.ToInt16(chartStatis.Series[0].Points[m].YValues[0].ToString()); chartStatis.Series[0].Points[m].Label = chartStatis.Series[0].Points[m].YValues[0].ToString(); diff --git a/FrmBSQStatis.cs b/FrmBSQStatis.cs index 390a55c..4aa0ee6 100644 --- a/FrmBSQStatis.cs +++ b/FrmBSQStatis.cs @@ -95,6 +95,8 @@ } } } + + dr.Close(); conn.Close(); for (int i = 0; i < typeLists.Count; i++) { @@ -123,7 +125,7 @@ chartStatis.Series[0].Points.DataBindXY(bsq.Keys, bsq.Values); for (int m = 0; m < bsq.Values.Count; m++) { - if (chartStatis.Series[0].Points[m].YValues[0].ToString().Trim() != "0") + if (chartStatis.Series[0].Points[m]!=null&&chartStatis.Series[0].Points[m].YValues[0].ToString().Trim() != "0") { //count += Convert.ToInt16(chartStatis.Series[0].Points[m].YValues[0].ToString()); chartStatis.Series[0].Points[m].Label = chartStatis.Series[0].Points[m].YValues[0].ToString(); diff --git a/FrmBSQStreet.cs b/FrmBSQStreet.cs index 9d88adb..7fbacad 100644 --- a/FrmBSQStreet.cs +++ b/FrmBSQStreet.cs @@ -44,7 +44,7 @@ chartStatis.Series[0].Points.DataBindXY(bsq.Keys, bsq.Values); for (int m = 0; m < bsq.Values.Count; m++) { - if (chartStatis.Series[0].Points[m].YValues[0].ToString().Trim() != "0") + if (chartStatis.Series[0].Points[m]!=null&&chartStatis.Series[0].Points[m].YValues[0].ToString().Trim() != "0") { count += Convert.ToInt16(chartStatis.Series[0].Points[m].YValues[0].ToString()); chartStatis.Series[0].Points[m].Label = chartStatis.Series[0].Points[m].YValues[0].ToString(); diff --git a/FrmBoosterValvers.cs b/FrmBoosterValvers.cs index 5061efc..df9b62b 100644 --- a/FrmBoosterValvers.cs +++ b/FrmBoosterValvers.cs @@ -236,199 +236,6 @@ count = 0; } } - /// - /// 添加火苗 - /// - /// - /// - /// - /// - private GSOFeature AddFire(double x,double y,double z) - { - // 烟火示例 - - string strResPath = Application.StartupPath + "/Resource"; - - // 烟火粒子示例,由三个发射器构成 - GSOGeoParticle geoParticle = new GSOGeoParticle(); - geoParticle.SetPosition(x, y, z); // 添加到这个经纬度位置 - geoParticle.AltitudeMode = EnumAltitudeMode.RelativeToGround; - - GSORingParticleEmitter emitter = new GSORingParticleEmitter(); - emitter.TexturePath = strResPath + "/ParticleImage/flare.png"; - - emitter.SetSizeFix(1, 1); - emitter.VelFix = 1; - emitter.VelRnd = 5; - - emitter.AngleXYFix = 0; - emitter.AngleXYRnd = 180; - - emitter.AngleXZFix = 90; - emitter.AngleXZRnd = 0; - - emitter.LifeFix = 0.5f; - emitter.LifeRnd = 0.0f; - - emitter.RotFix = 0; - emitter.RotRnd = 0; - - emitter.RotVelFix = 0; - emitter.RotVelRnd = 0; - - emitter.EmitPerSec = 100; - - // 采用线性插值生成粒子的初始颜色 - emitter.ColorRndStart = Color.White; - emitter.ColorRndEnd = Color.Red; - - - GSOColorParticleEffector effector2 = new GSOColorParticleEffector(); - effector2.SetColorChanged(0, -1, -1, 0); - effector2.StartTime = 0.0f; - effector2.EndTime = -1.0f; - emitter.AddEffector(effector2); - - // 将三个发射器添加到粒子对象中 - geoParticle.AddEmitter(emitter); - - geoParticle.Play(); - - GSOFeature feature = new GSOFeature(); - - feature.Geometry = geoParticle; - - globeControl1.Globe.MemoryLayer.AddFeature(feature); - - - return feature; - } - - /// - /// 添加喷泉 - /// - /// - private GSOFeature AddFountain() - { - string strResPath = Application.StartupPath + "/Resource"; - - GSOGeoParticle geoParticle = new GSOGeoParticle(); - geoParticle.SetPosition(116.314, 39.84, 0); // 添加到这个经纬度位置 - - GSOPointParticleEmitter emitter = new GSOPointParticleEmitter(); - emitter.TexturePath = strResPath + "/ParticleImage/test.png"; - - emitter.SetSizeFix(0.5f, 2); - emitter.VelFix = 10; - emitter.VelRnd = 2; - - emitter.GravityAcc = 9.8f; - emitter.AngleXYFix = 0; - emitter.AngleXYRnd = 180; - - emitter.AngleXZFix = 88; - emitter.AngleXZRnd = 2; - - //emitter.InnerRadius = 0; - // emitter.OuterRadius = 0.03f; - - emitter.LifeFix = 5.0f; - emitter.LifeRnd = 1.0f; - - emitter.RotFix = 0; - emitter.RotRnd = 0; - - emitter.RotVelFix = 0; - emitter.RotVelRnd = 0; - - emitter.EmitPerSec = 1000; - emitter.ColorRndStart = Color.FromArgb(33, 255, 255, 255); - emitter.ColorRndEnd = Color.FromArgb(11, 255, 255, 255); - emitter.IsLumAdded = false; - - // 将三个发射器添加到粒子对象中 - geoParticle.AddEmitter(emitter); - - geoParticle.Play(); - GSOFeature feature = new GSOFeature(); - - feature.Geometry = geoParticle; - - //globeControl1.Globe.MemoryLayer.AddFeature(feature); - globeControl1.Globe.FlyToFeature(feature); - - return feature; - } - - /// - /// 添加水柱 - /// - /// - private GSOFeature AddWaterLine() - { - string strResPath = Application.StartupPath + "/Resource"; - - GSOGeoParticle geoParticle = new GSOGeoParticle(); - geoParticle.SetPosition(116.308, 39.84, 0); // 添加到这个经纬度位置 - - GSOPointParticleEmitter emitter = new GSOPointParticleEmitter(); - - emitter.TexturePath = strResPath + "/ParticleImage/drop3.png"; - - geoParticle.TimerInterval = 1; - - emitter.SetSizeFix(2.0f, 2.0f); - - emitter.VelFix = 50; - emitter.VelRnd = 2; - - // emitter.IsLumAdded = false; - - emitter.GravityAcc = 9.8f; - emitter.AngleXYFix = 0; - emitter.AngleXYRnd = 2; - - emitter.AngleXZFix = 60; - emitter.AngleXZRnd = 2; - - //emitter.InnerRadius = 0; - // emitter.OuterRadius = 0.1f; - - emitter.LifeFix = 5.0f; - emitter.LifeRnd = 1.0f; - - emitter.RotFix = 0; - emitter.RotRnd = 0; - - emitter.RotVelFix = 0; - emitter.RotVelRnd = 0; - - emitter.EmitPerSec = 1500; - - emitter.ColorRndStart = Color.FromArgb(100, 222, 222, 222); - emitter.ColorRndEnd = Color.FromArgb(50, 222, 222, 222); - - /* - - GSOScaleParticleEffector effector1 = new GSOScaleParticleEffector(); - effector1.SetScale(0.2f, 0.2f); - effector1.StartTime = 0; - effector1.EndTime = -1; // 负数表示整个粒子生命结束 - emitter.AddEffector(effector1); - */ - - // 将三个发射器添加到粒子对象中 - geoParticle.AddEmitter(emitter); - - geoParticle.Play(); - GSOFeature feature = new GSOFeature(); - - feature.Geometry = geoParticle; - - //globeControl1.Globe.MemoryLayer.AddFeature(feature); - globeControl1.Globe.FlyToFeature(feature); - - return feature; - } + } } diff --git a/FrmBufferAnalysis.cs b/FrmBufferAnalysis.cs index f711133..db8ca59 100644 --- a/FrmBufferAnalysis.cs +++ b/FrmBufferAnalysis.cs @@ -123,39 +123,6 @@ } } /// - /// 半径文本框的键盘按键按下事件处理 - /// - /// - /// - private void txtRadius_KeyPress(object sender, KeyPressEventArgs e) - { - TextBox text = sender as TextBox; - if ((e.KeyChar < 48 || e.KeyChar > 57) && (e.KeyChar != 8) && (int)e.KeyChar != 46) - { - e.Handled = true; - } - if ((int)e.KeyChar == 46) //小数点 - { - if (text.Text.Length <= 0) - e.Handled = true; //小数点不能在第一位 - else //处理不规则的小数点 - { - float f; - float oldf; - bool b1 = false, b2 = false; - b1 = float.TryParse(text.Text, out oldf); - b2 = float.TryParse(text.Text + e.KeyChar.ToString(), out f); - if (b2 == false) - { - if (b1 == true) - e.Handled = true; - else - e.Handled = false; - } - } - } - } - /// /// 窗体关闭事件处理 /// /// diff --git a/Cyberpipe.csproj b/Cyberpipe.csproj index 07a8c1a..e3cd12c 100644 --- a/Cyberpipe.csproj +++ b/Cyberpipe.csproj @@ -204,25 +204,6 @@ - - Form - - - F_GKT1数据输入输出.cs - - - Form - - - F_GKT1添加文件.cs - - - Form - - - F_GKT1添加项目.cs - - Form @@ -1068,18 +1049,6 @@ Frm_password_reset.cs - - Form - - - GKT.cs - - - Form - - - GKT1.cs - Form @@ -1258,12 +1227,6 @@ F_Projedit.cs - - Form - - - PED.cs - Form @@ -1331,16 +1294,6 @@ True Reference.map - - F_GKT1数据输入输出.cs - Designer - - - F_GKT1添加文件.cs - - - F_GKT1添加项目.cs - Form_EditTask.cs @@ -1836,12 +1789,6 @@ Frm_password_reset.cs - - GKT.cs - - - GKT1.cs - F_GKT数据输入输出.cs @@ -1934,9 +1881,6 @@ F_Projedit.cs - - PED.cs - F_数据输入输出.cs diff --git a/Cyberpipe.suo b/Cyberpipe.suo index 68ced4f..a1aecf8 100644 --- a/Cyberpipe.suo +++ b/Cyberpipe.suo Binary files differ diff --git a/EMS_Forms/Form_EditTask.cs b/EMS_Forms/Form_EditTask.cs index 718992f..f1d791f 100644 --- a/EMS_Forms/Form_EditTask.cs +++ b/EMS_Forms/Form_EditTask.cs @@ -119,7 +119,8 @@ String name = Convert.ToString(dr["USERNAME"]); comboBox_userName.Items.Add(name); - } + } + dr.Close(); comboBox_road.Items.Clear(); roadList = new List(); @@ -135,7 +136,7 @@ comboBox_road.Items.Add(name); } } - + dr1.Close(); conn.Close(); bool flag2 = false; @@ -185,7 +186,7 @@ catch (Exception ex) { - MessageBox.Show(ex.ToString()); + LogHelper.WriteLog(typeof(Form_EditTask), ex.Message); } } @@ -288,7 +289,7 @@ } catch (Exception ex) { - MessageBox.Show(ex.ToString()); + LogHelper.WriteLog(typeof(Form_EditTask), ex.Message); } } @@ -474,7 +475,7 @@ } catch (Exception ex) { - MessageBox.Show(ex.ToString()); + LogHelper.WriteLog(typeof(Form_EditTask), ex.Message); } this.Close(); @@ -495,6 +496,7 @@ { numList.Add(Convert.ToInt32(dr["DBID"])); } + dr.Close(); if (numList.Count == 0) { taskNumber = Convert.ToInt32(number) * 100; @@ -674,6 +676,7 @@ } } } + dr.Close(); conn.Close(); } diff --git a/EMS_Forms/Form_EventManager.cs b/EMS_Forms/Form_EventManager.cs index b18c45b..84807b2 100644 --- a/EMS_Forms/Form_EventManager.cs +++ b/EMS_Forms/Form_EventManager.cs @@ -64,6 +64,7 @@ comboBox_name.Items.Add(name); } + dr.Close(); conn.Close(); diff --git a/Forms/FrmMnModify.cs b/Forms/FrmMnModify.cs index 31cfc5f..d036360 100644 --- a/Forms/FrmMnModify.cs +++ b/Forms/FrmMnModify.cs @@ -68,15 +68,7 @@ questionGrid.Rows[idx].Cells[1].Value = sr.question; } } - /// 选中对象 - /// - /// - /// - /// - private void buttonX1_Click(object sender, EventArgs e) - { - globecontrol.Globe.Action = EnumAction3D.SelectObject; - } + /// /// 选中某一行 /// diff --git a/Forms/FrmPipelineModelDataBase.cs b/Forms/FrmPipelineModelDataBase.cs index 2acf0ca..7ce573f 100644 --- a/Forms/FrmPipelineModelDataBase.cs +++ b/Forms/FrmPipelineModelDataBase.cs @@ -35,19 +35,7 @@ ds = _ds; InitializeComponent(); } - /// - /// 单击选择shp格式文件 - /// - /// - /// - private void btnBrowseModel_Click(object sender, EventArgs e) - { - saveFileDialog1.Filter = "*.lgd|*.lgd"; - if (saveFileDialog1.ShowDialog() == DialogResult.OK) - { - txtModelLayer.Text = saveFileDialog1.FileName; - } - } + /// /// 窗体初始化事件处理 /// @@ -100,49 +88,6 @@ } } } - - private object convertFieldValue(string fieldname, object obj) - { - if (obj == null) - return null; - - try - { - string type = fields_types[fieldname].ToString(); - switch (type) - { - case "string": - return obj.ToString(); - case "int": - //return 101; - int intResult; - if (int.TryParse(obj.ToString(), out intResult)) - return intResult; - else - return null; - case "double": - //return 202.5; - double doubleResult; - if (double.TryParse(obj.ToString(), out doubleResult)) - return doubleResult; - else - return null; - case "date": - DateTime dtResult; - if (DateTime.TryParse(obj.ToString(), out dtResult)) - return dtResult; - else - return null; - } - return null; - } - catch (Exception ex) - { - MessageBox.Show(ex.ToString()); - return null; - } - } - public string lgdFilePath = ""; /// /// 选择管线颜色 @@ -610,33 +555,6 @@ { this.Close(); } - - private void cmbLayer_SelectedIndexChanged(object sender, EventArgs e) //选择图层 - { - GSOLayer layer = ctl.Globe.Layers.GetLayerByCaption(selectLayerName); - GSOFeatures features = layer.GetAllFeatures(); - if (features.Length == 0) - return; - - cmbFrom.Items.Clear(); - cmbTo.Items.Clear(); - cmbRadius.Items.Clear(); - cmbID.Items.Clear(); - for (int i = 0; i < features[0].GetFieldCount(); i++) - { - GeoScene.Data.GSOFieldDefn fielddef = (GeoScene.Data.GSOFieldDefn)(features[0].GetFieldDefn(i)); - - cmbFrom.Items.Add(fielddef.Name); - cmbTo.Items.Add(fielddef.Name); - cmbRadius.Items.Add(fielddef.Name); - cmbID.Items.Add(fielddef.Name); - } - cmbFrom.SelectedItem = "Deep1"; - cmbTo.SelectedItem = "Deep2"; - cmbRadius.SelectedItem = "Diameter"; - cmbID.SelectedItem = "Handle"; - } - private void buttonXLayerPath_Click(object sender, EventArgs e)//单击 选择shp格式的文件 { OpenFileDialog dlg = new OpenFileDialog(); diff --git a/Forms/FrmPipelineModelDataOneStep.cs b/Forms/FrmPipelineModelDataOneStep.cs index 18afda7..ec93b8a 100644 --- a/Forms/FrmPipelineModelDataOneStep.cs +++ b/Forms/FrmPipelineModelDataOneStep.cs @@ -38,19 +38,7 @@ layerTree = _layerTree; InitializeComponent(); } - /// - /// 单击选择shp格式文件 - /// - /// - /// - private void btnBrowseModel_Click(object sender, EventArgs e) - { - saveFileDialog1.Filter = "*.lgd|*.lgd"; - if (saveFileDialog1.ShowDialog() == DialogResult.OK) - { - txtModelLayer.Text = saveFileDialog1.FileName; - } - } + /// /// 窗体初始化事件处理 /// @@ -107,48 +95,7 @@ } } - private object convertFieldValue(string fieldname, object obj) - { - if (obj == null) - return null; - - try - { - string type = fields_types[fieldname].ToString(); - switch (type) - { - case "string": - return obj.ToString(); - case "int": - //return 101; - int intResult; - if (int.TryParse(obj.ToString(), out intResult)) - return intResult; - else - return null; - case "double": - //return 202.5; - double doubleResult; - if (double.TryParse(obj.ToString(), out doubleResult)) - return doubleResult; - else - return null; - case "date": - DateTime dtResult; - if (DateTime.TryParse(obj.ToString(), out dtResult)) - return dtResult; - else - return null; - } - return null; - } - catch (Exception ex) - { - MessageBox.Show(ex.ToString()); - return null; - } - } - + public string lgdFilePath = ""; /// /// 选择管线颜色 @@ -673,32 +620,6 @@ return featDs; } - private void cmbLayer_SelectedIndexChanged(object sender, EventArgs e) //选择图层 - { - GSOLayer layer = ctl.Globe.Layers.GetLayerByCaption(selectLayerName); - GSOFeatures features = layer.GetAllFeatures(); - if (features.Length == 0) - return; - - cmbFrom.Items.Clear(); - cmbTo.Items.Clear(); - cmbRadius.Items.Clear(); - cmbID.Items.Clear(); - for (int i = 0; i < features[0].GetFieldCount(); i++) - { - GeoScene.Data.GSOFieldDefn fielddef = (GeoScene.Data.GSOFieldDefn)(features[0].GetFieldDefn(i)); - - cmbFrom.Items.Add(fielddef.Name); - cmbTo.Items.Add(fielddef.Name); - cmbRadius.Items.Add(fielddef.Name); - cmbID.Items.Add(fielddef.Name); - } - cmbFrom.SelectedItem = "Deep1"; - cmbTo.SelectedItem = "Deep2"; - cmbRadius.SelectedItem = "Diameter"; - cmbID.SelectedItem = "Handle"; - } - private void buttonXLayerPath_Click(object sender, EventArgs e)//单击 选择shp格式的文件 { OpenFileDialog dlg = new OpenFileDialog(); @@ -949,38 +870,6 @@ } //txtLayername.Text = type + layername; } - /// - /// 连接数据库 - /// - /// - /// - private void buttonX1_Click(object sender, EventArgs e) - { - if (ds == null) - { - //没连的话,直接连接审核库; //审核库配置读配置文件 - string dbIp = Utility.sgdbip; - string database = Utility.sgdbname; - string user = Utility.sgdbuser; - string pass = Utility.sgdbpwd; - - if (!Utility.isNetworkConnectionSuccess(dbIp.Trim())) - { - MessageBox.Show("网络连接失败!", "提示"); - return; - } - - ds = ctl.Globe.DataManager.OpenOracleDataSource(dbIp + "/" + database, "", "", user, pass); - if (ds == null) - { - MessageBox.Show("数据库连接失败!", "提示", MessageBoxButtons.OK, MessageBoxIcon.Warning); - } - else - { - btnCreateModel.Enabled = true; - } - } - } private void btnClose_Click(object sender, EventArgs e) { diff --git a/Forms/FrmShRK.cs b/Forms/FrmShRK.cs index 0e2e722..f1d83cb 100644 --- a/Forms/FrmShRK.cs +++ b/Forms/FrmShRK.cs @@ -215,6 +215,7 @@ { sourcefeatds = sourcefeat as GSOFeatureDataset; } + if (sourcefeatds == null) return; sourcefeatds.Open(); GSOFeatures sourcefeatures = sourcefeatds.GetAllFeatures(); @@ -251,6 +252,7 @@ { desfeatds = desfeat as GSOFeatureDataset; } + if (desfeatds == null) return; desfeatds.Open(); //向新数据集写入字段 diff --git a/FrmAccessoriesSensor.cs b/FrmAccessoriesSensor.cs index 09fcdf1..2a7a80e 100644 --- a/FrmAccessoriesSensor.cs +++ b/FrmAccessoriesSensor.cs @@ -209,7 +209,7 @@ chart1.Series[0].Points.DataBindXY(dic.Keys, dic.Values); for (int m = 0; m < dic.Values.Count; m++) { - if (chart1.Series[0].Points[m].YValues[0].ToString() != "0") + if (chart1.Series[0].Points[m]!=null&&chart1.Series[0].Points[m].YValues[0].ToString() != "0") { chart1.Series[0].Points[m].Label = chart1.Series[0].Points[m].YValues[0].ToString(); } diff --git a/FrmAccessoriesgather.cs b/FrmAccessoriesgather.cs index 9e331e1..a475d9e 100644 --- a/FrmAccessoriesgather.cs +++ b/FrmAccessoriesgather.cs @@ -338,7 +338,7 @@ chart1.Series[0].Points.DataBindXY(dic.Keys, dic.Values); for (int m = 0; m < dic.Values.Count; m++) { - if (chart1.Series[0].Points[m].YValues[0].ToString() != "0") + if (chart1.Series[0].Points[m]!=null&&chart1.Series[0].Points[m].YValues[0].ToString() != "0") { chart1.Series[0].Points[m].Label = chart1.Series[0].Points[m].YValues[0].ToString(); } diff --git a/FrmAccessoryAnalysis.cs b/FrmAccessoryAnalysis.cs index 71d4579..44d4065 100644 --- a/FrmAccessoryAnalysis.cs +++ b/FrmAccessoryAnalysis.cs @@ -66,39 +66,6 @@ globeControl1.Refresh(); } /// - /// 键盘按键按下事件处理 - /// - /// - /// - private void txtRadius_KeyPress(object sender, KeyPressEventArgs e) - { - TextBox text = sender as TextBox; - if ((e.KeyChar < 48 || e.KeyChar > 57) && (e.KeyChar != 8) && (int)e.KeyChar != 46) - { - e.Handled = true; - } - if ((int)e.KeyChar == 46) //小数点 - { - if (text.Text.Length <= 0) - e.Handled = true; //小数点不能在第一位 - else //处理不规则的小数点 - { - float f; - float oldf; - bool b1 = false, b2 = false; - b1 = float.TryParse(text.Text, out oldf); - b2 = float.TryParse(text.Text + e.KeyChar.ToString(), out f); - if (b2 == false) - { - if (b1 == true) - e.Handled = true; - else - e.Handled = false; - } - } - } - } - /// /// 确定按钮事件处理 /// /// diff --git a/FrmAddValve.cs b/FrmAddValve.cs index 34d2fec..5f405b9 100644 --- a/FrmAddValve.cs +++ b/FrmAddValve.cs @@ -486,56 +486,6 @@ } } - - - - - - - - private void cmbLayer_SelectedIndexChanged(object sender, EventArgs e) - { - GSOLayer layer = globeControl1.Globe.Layers.GetLayerByCaption(selectLayerName); - GSOFeatures features = layer.GetAllFeatures(); - if (features.Length == 0) - return; - - combPath.Items.Clear(); - combZ.Items.Clear(); - combModelName.Items.Clear(); - - for (int i = 0; i < features[0].GetFieldCount(); i++) - { - GeoScene.Data.GSOFieldDefn fielddef = (GeoScene.Data.GSOFieldDefn)(features[0].GetFieldDefn(i)); - combPath.Items.Add(fielddef.Name); - combZ.Items.Add(fielddef.Name); - combModelName.Items.Add(fielddef.Name); - } - combModelName.SelectedItem = "编号"; - combPath.SelectedItem = "模型路径"; - if (combfile.SelectedIndex != -1) - { - - string layerCaption = combfile.SelectedItem.ToString().Trim(); - rukuLayer = globeControl1.Globe.Layers.GetLayerByCaption(layerCaption); - if (rukuLayer != null) - { - combPath.Items.Clear(); - combZ.Items.Clear(); - combModelName.Items.Clear(); - - } - for (int i = 0; i < features[0].GetFieldCount(); i++) - { - GeoScene.Data.GSOFieldDefn fielddef = (GeoScene.Data.GSOFieldDefn)(features[0].GetFieldDefn(i)); - combPath.Items.Add(fielddef.Name); - combZ.Items.Add(fielddef.Name); - combModelName.Items.Add(fielddef.Name); - } - combModelName.SelectedItem = "编号"; - combPath.SelectedItem = "模型路径"; - } - } /// /// 单击选择shp格式文件 /// diff --git a/FrmAddWellShp.cs b/FrmAddWellShp.cs index bb79ec0..a249725 100644 --- a/FrmAddWellShp.cs +++ b/FrmAddWellShp.cs @@ -478,32 +478,6 @@ } } } - - private void cmbLayer_SelectedIndexChanged(object sender, EventArgs e) - { - GSOLayer layer = globeControl1.Globe.Layers.GetLayerByCaption(selectLayerName); - GSOFeatures features = layer.GetAllFeatures(); - if (features.Length == 0) - return; - - combCode.Items.Clear(); - combDeep.Items.Clear(); - combModelName.Items.Clear(); - combAngle.Items.Clear(); - - for (int i = 0; i < features[0].GetFieldCount(); i++) - { - GeoScene.Data.GSOFieldDefn fielddef = (GeoScene.Data.GSOFieldDefn)(features[0].GetFieldDefn(i)); - combCode.Items.Add(fielddef.Name); - combDeep.Items.Add(fielddef.Name); - combModelName.Items.Add(fielddef.Name); - combAngle.Items.Add(fielddef.Name); - } - combCode.SelectedItem = "附属物编码"; - combDeep.SelectedItem = "井深"; - combModelName.SelectedItem = "编号"; - combAngle.SelectedItem = "符号角度"; - } /// /// 单击选择shp格式文件 /// diff --git a/FrmAddYuBiZiShp.cs b/FrmAddYuBiZiShp.cs index b312d51..332f037 100644 --- a/FrmAddYuBiZiShp.cs +++ b/FrmAddYuBiZiShp.cs @@ -383,80 +383,7 @@ } } - private void cmbLayer_SelectedIndexChanged(object sender, EventArgs e) - { - GSOLayer layer = globeControl1.Globe.Layers.GetLayerByCaption(selectLayerName); - GSOFeatures features = layer.GetAllFeatures(); - if (features.Length == 0) - return; - - combCode.Items.Clear(); - combDeep.Items.Clear(); - combModelName.Items.Clear(); - //comboLoad.Items.Clear(); - for (int i = 0; i < features[0].GetFieldCount(); i++) - { - GeoScene.Data.GSOFieldDefn fielddef = (GeoScene.Data.GSOFieldDefn)(features[0].GetFieldDefn(i)); - combCode.Items.Add(fielddef.Name); - combDeep.Items.Add(fielddef.Name); - combModelName.Items.Add(fielddef.Name); - //comboLoad.Items.Add(fielddef.Name); - } - combCode.SelectedItem = "附属物编码"; - combDeep.SelectedItem = "Z坐标"; - combModelName.SelectedItem = "编号"; - //comboLoad.SelectedItem = "模型路径"; - } - - private void buttonXLayerPath_Click(object sender, EventArgs e) - { - OpenFileDialog dlg = new OpenFileDialog(); - dlg.Filter = "*.shp|*.shp"; - dlg.Multiselect = false; - if (dlg.ShowDialog() == DialogResult.OK) - { - GSOLayer layer = globeControl1.Globe.Layers.Add(dlg.FileName); - string txtMessage = valiYBdata(layer); - if (txtMessage != "") - { - button3.Enabled = false; - //textBoxLayer.Text = ""; - combCode.Items.Clear(); - combDeep.Items.Clear(); - combModelName.Items.Clear(); - globeControl1.Globe.Layers.Remove(layer); - FrmValiDataShowErrorMessage showErrorMessage = new FrmValiDataShowErrorMessage(dlg.FileName, txtMessage); - showErrorMessage.ShowDialog(); - return; - } - else - { - button3.Enabled = true; - //textBoxLayer.Text = dlg.FileName; - selectLayerName = layer.Caption; - txtLayerName.Text = layer.Caption; - GSOFeatures features = layer.GetAllFeatures(); - if (features.Length == 0) - return; - - combCode.Items.Clear(); - combDeep.Items.Clear(); - combModelName.Items.Clear(); - for (int i = 0; i < features[0].GetFieldCount(); i++) - { - GeoScene.Data.GSOFieldDefn fielddef = (GeoScene.Data.GSOFieldDefn)(features[0].GetFieldDefn(i)); - combCode.Items.Add(fielddef.Name); - combDeep.Items.Add(fielddef.Name); - combModelName.Items.Add(fielddef.Name); - //comboLoad.Items.Add(fielddef.Name); - } - combCode.SelectedItem = "管点编码"; - combDeep.SelectedItem = "Z坐标"; - combModelName.SelectedItem = "编号"; - } - } - } - + private void FrmAddYuBiZiShp_FormClosing(object sender, FormClosingEventArgs e) { globeControl1.Globe.Refresh(); diff --git a/FrmAllPipelineStatis.cs b/FrmAllPipelineStatis.cs index 6421a26..a6eea29 100644 --- a/FrmAllPipelineStatis.cs +++ b/FrmAllPipelineStatis.cs @@ -84,7 +84,7 @@ chartAllAreaPipeline.Series["管线"].Points.DataBindXY(pipelineLengthAndType.Keys, pipelineLengthAndType.Values); for (int m = 0; m < pipelineLengthAndType.Values.Count; m++) { - if (chartAllAreaPipeline.Series["管线"].Points[m].YValues[0].ToString() != "0") + if (chartAllAreaPipeline.Series["管线"].Points[m]!=null&&chartAllAreaPipeline.Series["管线"].Points[m].YValues[0].ToString() != "0") { chartAllAreaPipeline.Series["管线"].Points[m].Label = chartAllAreaPipeline.Series[0].Points[m].YValues[0].ToString(); } @@ -94,7 +94,7 @@ } catch (Exception ex) { - //LogError.PublishError(ex); + LogHelper.WriteLog(typeof(FrmAllPipelineStatis), ex.Message); } } @@ -147,7 +147,7 @@ } DataTable dt = OledbHelper.QueryTable(sql); - if (dt != null && dt.Rows.Count > 0) + if (dt != null && dt.Rows.Count > 0 && chartAllAreaPipeline.Series["管线"].Points[indexHit]!=null) { dataGridViewX1.DataSource = dt; panel.Visible = true; diff --git a/FrmAllWorkWellStatis.cs b/FrmAllWorkWellStatis.cs index 6fec7af..6af8e4c 100644 --- a/FrmAllWorkWellStatis.cs +++ b/FrmAllWorkWellStatis.cs @@ -52,7 +52,7 @@ chartAllAreaPipeline.Series["井盖"].Points.DataBindXY(workWellLengthAndType.Keys, workWellLengthAndType.Values); for (int m = 0; m < workWellLengthAndType.Values.Count; m++) { - if (chartAllAreaPipeline.Series["井盖"].Points[m].YValues[0].ToString().Trim() != "0") + if (chartAllAreaPipeline.Series["井盖"].Points[m]!=null&&chartAllAreaPipeline.Series["井盖"].Points[m].YValues[0].ToString().Trim() != "0") { chartAllAreaPipeline.Series["井盖"].Points[m].Label = chartAllAreaPipeline.Series[0].Points[m].YValues[0].ToString(); } @@ -60,7 +60,7 @@ } catch (Exception ex) { - //LogError.PublishError(ex); + LogHelper.WriteLog(typeof(FrmAllWorkWellStatis), ex.Message); } } diff --git a/FrmBSQDuoBianXingStatis.cs b/FrmBSQDuoBianXingStatis.cs index e8b7d52..3e889b6 100644 --- a/FrmBSQDuoBianXingStatis.cs +++ b/FrmBSQDuoBianXingStatis.cs @@ -60,7 +60,7 @@ { for (int m = 0; m < bsq1.Values.Count; m++) { - if (chart1.Series["标识器"].Points[m].YValues[0].ToString() != "0") + if (chart1.Series["标识器"].Points[m]!=null&&chart1.Series["标识器"].Points[m].YValues[0].ToString() != "0") { count += Convert.ToInt16(chart1.Series[0].Points[m].YValues[0].ToString()); chart1.Series["标识器"].Points[m].Label = chart1.Series[0].Points[m].YValues[0].ToString(); diff --git a/FrmBSQDuoBianXingStreet.cs b/FrmBSQDuoBianXingStreet.cs index 2005ebb..1db5777 100644 --- a/FrmBSQDuoBianXingStreet.cs +++ b/FrmBSQDuoBianXingStreet.cs @@ -63,7 +63,7 @@ chartStatis.Series[0].Points.DataBindXY(bsq.Keys, bsq.Values); for (int m = 0; m < bsq.Values.Count; m++) { - if (chartStatis.Series[0].Points[m].YValues[0].ToString().Trim() != "0") + if (chartStatis.Series[0].Points[m]!=null&&chartStatis.Series[0].Points[m].YValues[0].ToString().Trim() != "0") { count += Convert.ToInt16(chartStatis.Series[0].Points[m].YValues[0].ToString()); chartStatis.Series[0].Points[m].Label = chartStatis.Series[0].Points[m].YValues[0].ToString(); diff --git a/FrmBSQStatis.cs b/FrmBSQStatis.cs index 390a55c..4aa0ee6 100644 --- a/FrmBSQStatis.cs +++ b/FrmBSQStatis.cs @@ -95,6 +95,8 @@ } } } + + dr.Close(); conn.Close(); for (int i = 0; i < typeLists.Count; i++) { @@ -123,7 +125,7 @@ chartStatis.Series[0].Points.DataBindXY(bsq.Keys, bsq.Values); for (int m = 0; m < bsq.Values.Count; m++) { - if (chartStatis.Series[0].Points[m].YValues[0].ToString().Trim() != "0") + if (chartStatis.Series[0].Points[m]!=null&&chartStatis.Series[0].Points[m].YValues[0].ToString().Trim() != "0") { //count += Convert.ToInt16(chartStatis.Series[0].Points[m].YValues[0].ToString()); chartStatis.Series[0].Points[m].Label = chartStatis.Series[0].Points[m].YValues[0].ToString(); diff --git a/FrmBSQStreet.cs b/FrmBSQStreet.cs index 9d88adb..7fbacad 100644 --- a/FrmBSQStreet.cs +++ b/FrmBSQStreet.cs @@ -44,7 +44,7 @@ chartStatis.Series[0].Points.DataBindXY(bsq.Keys, bsq.Values); for (int m = 0; m < bsq.Values.Count; m++) { - if (chartStatis.Series[0].Points[m].YValues[0].ToString().Trim() != "0") + if (chartStatis.Series[0].Points[m]!=null&&chartStatis.Series[0].Points[m].YValues[0].ToString().Trim() != "0") { count += Convert.ToInt16(chartStatis.Series[0].Points[m].YValues[0].ToString()); chartStatis.Series[0].Points[m].Label = chartStatis.Series[0].Points[m].YValues[0].ToString(); diff --git a/FrmBoosterValvers.cs b/FrmBoosterValvers.cs index 5061efc..df9b62b 100644 --- a/FrmBoosterValvers.cs +++ b/FrmBoosterValvers.cs @@ -236,199 +236,6 @@ count = 0; } } - /// - /// 添加火苗 - /// - /// - /// - /// - /// - private GSOFeature AddFire(double x,double y,double z) - { - // 烟火示例 - - string strResPath = Application.StartupPath + "/Resource"; - - // 烟火粒子示例,由三个发射器构成 - GSOGeoParticle geoParticle = new GSOGeoParticle(); - geoParticle.SetPosition(x, y, z); // 添加到这个经纬度位置 - geoParticle.AltitudeMode = EnumAltitudeMode.RelativeToGround; - - GSORingParticleEmitter emitter = new GSORingParticleEmitter(); - emitter.TexturePath = strResPath + "/ParticleImage/flare.png"; - - emitter.SetSizeFix(1, 1); - emitter.VelFix = 1; - emitter.VelRnd = 5; - - emitter.AngleXYFix = 0; - emitter.AngleXYRnd = 180; - - emitter.AngleXZFix = 90; - emitter.AngleXZRnd = 0; - - emitter.LifeFix = 0.5f; - emitter.LifeRnd = 0.0f; - - emitter.RotFix = 0; - emitter.RotRnd = 0; - - emitter.RotVelFix = 0; - emitter.RotVelRnd = 0; - - emitter.EmitPerSec = 100; - - // 采用线性插值生成粒子的初始颜色 - emitter.ColorRndStart = Color.White; - emitter.ColorRndEnd = Color.Red; - - - GSOColorParticleEffector effector2 = new GSOColorParticleEffector(); - effector2.SetColorChanged(0, -1, -1, 0); - effector2.StartTime = 0.0f; - effector2.EndTime = -1.0f; - emitter.AddEffector(effector2); - - // 将三个发射器添加到粒子对象中 - geoParticle.AddEmitter(emitter); - - geoParticle.Play(); - - GSOFeature feature = new GSOFeature(); - - feature.Geometry = geoParticle; - - globeControl1.Globe.MemoryLayer.AddFeature(feature); - - - return feature; - } - - /// - /// 添加喷泉 - /// - /// - private GSOFeature AddFountain() - { - string strResPath = Application.StartupPath + "/Resource"; - - GSOGeoParticle geoParticle = new GSOGeoParticle(); - geoParticle.SetPosition(116.314, 39.84, 0); // 添加到这个经纬度位置 - - GSOPointParticleEmitter emitter = new GSOPointParticleEmitter(); - emitter.TexturePath = strResPath + "/ParticleImage/test.png"; - - emitter.SetSizeFix(0.5f, 2); - emitter.VelFix = 10; - emitter.VelRnd = 2; - - emitter.GravityAcc = 9.8f; - emitter.AngleXYFix = 0; - emitter.AngleXYRnd = 180; - - emitter.AngleXZFix = 88; - emitter.AngleXZRnd = 2; - - //emitter.InnerRadius = 0; - // emitter.OuterRadius = 0.03f; - - emitter.LifeFix = 5.0f; - emitter.LifeRnd = 1.0f; - - emitter.RotFix = 0; - emitter.RotRnd = 0; - - emitter.RotVelFix = 0; - emitter.RotVelRnd = 0; - - emitter.EmitPerSec = 1000; - emitter.ColorRndStart = Color.FromArgb(33, 255, 255, 255); - emitter.ColorRndEnd = Color.FromArgb(11, 255, 255, 255); - emitter.IsLumAdded = false; - - // 将三个发射器添加到粒子对象中 - geoParticle.AddEmitter(emitter); - - geoParticle.Play(); - GSOFeature feature = new GSOFeature(); - - feature.Geometry = geoParticle; - - //globeControl1.Globe.MemoryLayer.AddFeature(feature); - globeControl1.Globe.FlyToFeature(feature); - - return feature; - } - - /// - /// 添加水柱 - /// - /// - private GSOFeature AddWaterLine() - { - string strResPath = Application.StartupPath + "/Resource"; - - GSOGeoParticle geoParticle = new GSOGeoParticle(); - geoParticle.SetPosition(116.308, 39.84, 0); // 添加到这个经纬度位置 - - GSOPointParticleEmitter emitter = new GSOPointParticleEmitter(); - - emitter.TexturePath = strResPath + "/ParticleImage/drop3.png"; - - geoParticle.TimerInterval = 1; - - emitter.SetSizeFix(2.0f, 2.0f); - - emitter.VelFix = 50; - emitter.VelRnd = 2; - - // emitter.IsLumAdded = false; - - emitter.GravityAcc = 9.8f; - emitter.AngleXYFix = 0; - emitter.AngleXYRnd = 2; - - emitter.AngleXZFix = 60; - emitter.AngleXZRnd = 2; - - //emitter.InnerRadius = 0; - // emitter.OuterRadius = 0.1f; - - emitter.LifeFix = 5.0f; - emitter.LifeRnd = 1.0f; - - emitter.RotFix = 0; - emitter.RotRnd = 0; - - emitter.RotVelFix = 0; - emitter.RotVelRnd = 0; - - emitter.EmitPerSec = 1500; - - emitter.ColorRndStart = Color.FromArgb(100, 222, 222, 222); - emitter.ColorRndEnd = Color.FromArgb(50, 222, 222, 222); - - /* - - GSOScaleParticleEffector effector1 = new GSOScaleParticleEffector(); - effector1.SetScale(0.2f, 0.2f); - effector1.StartTime = 0; - effector1.EndTime = -1; // 负数表示整个粒子生命结束 - emitter.AddEffector(effector1); - */ - - // 将三个发射器添加到粒子对象中 - geoParticle.AddEmitter(emitter); - - geoParticle.Play(); - GSOFeature feature = new GSOFeature(); - - feature.Geometry = geoParticle; - - //globeControl1.Globe.MemoryLayer.AddFeature(feature); - globeControl1.Globe.FlyToFeature(feature); - - return feature; - } + } } diff --git a/FrmBufferAnalysis.cs b/FrmBufferAnalysis.cs index f711133..db8ca59 100644 --- a/FrmBufferAnalysis.cs +++ b/FrmBufferAnalysis.cs @@ -123,39 +123,6 @@ } } /// - /// 半径文本框的键盘按键按下事件处理 - /// - /// - /// - private void txtRadius_KeyPress(object sender, KeyPressEventArgs e) - { - TextBox text = sender as TextBox; - if ((e.KeyChar < 48 || e.KeyChar > 57) && (e.KeyChar != 8) && (int)e.KeyChar != 46) - { - e.Handled = true; - } - if ((int)e.KeyChar == 46) //小数点 - { - if (text.Text.Length <= 0) - e.Handled = true; //小数点不能在第一位 - else //处理不规则的小数点 - { - float f; - float oldf; - bool b1 = false, b2 = false; - b1 = float.TryParse(text.Text, out oldf); - b2 = float.TryParse(text.Text + e.KeyChar.ToString(), out f); - if (b2 == false) - { - if (b1 == true) - e.Handled = true; - else - e.Handled = false; - } - } - } - } - /// /// 窗体关闭事件处理 /// /// diff --git a/FrmBufferAnalysisBSQ.cs b/FrmBufferAnalysisBSQ.cs index 24a96ca..f54208f 100644 --- a/FrmBufferAnalysisBSQ.cs +++ b/FrmBufferAnalysisBSQ.cs @@ -137,35 +137,7 @@ } } - private void txtRadius_KeyPress(object sender, KeyPressEventArgs e) - { - TextBox text = sender as TextBox; - if ((e.KeyChar < 48 || e.KeyChar > 57) && (e.KeyChar != 8) && (int)e.KeyChar != 46) - { - e.Handled = true; - } - if ((int)e.KeyChar == 46) //小数点 - { - if (text.Text.Length <= 0) - e.Handled = true; //小数点不能在第一位 - else //处理不规则的小数点 - { - float f; - float oldf; - bool b1 = false, b2 = false; - b1 = float.TryParse(text.Text, out oldf); - b2 = float.TryParse(text.Text + e.KeyChar.ToString(), out f); - if (b2 == false) - { - if (b1 == true) - e.Handled = true; - else - e.Handled = false; - } - } - } - } - + private void FrmBufferAnalysis_FormClosing(object sender, FormClosingEventArgs e) { //Form1.y = 0; @@ -316,27 +288,6 @@ } } - private void FlyToMenu_Click(object sender, EventArgs e) - { - if (m_feature != null) - { - if (m_feature.Geometry != null && m_feature.Geometry.Type == EnumGeometryType.GeoPolyline3D) - { - GSOGeoPolyline3D line = m_feature.Geometry as GSOGeoPolyline3D; - double length = line.GetSpaceLength(true, 6378137); - GSOGeoPolyline3D lineLine = line.GetSegment(0, length / 2); - GSOPoint3d point3d = lineLine[lineLine.PartCount - 1][lineLine[lineLine.PartCount - 1].Count - 1]; - - globeControl1.Globe.FlyToPosition(point3d, EnumAltitudeMode.Absolute, 0, 45, 5); - } - else - { - globeControl1.Globe.FlyToFeature(m_feature, 0, 45, 3); - } - LightMenu_Click(sender, e); - } - } - private void LightMenu_Click(object sender, EventArgs e) { flashflag = "single"; diff --git a/Cyberpipe.csproj b/Cyberpipe.csproj index 07a8c1a..e3cd12c 100644 --- a/Cyberpipe.csproj +++ b/Cyberpipe.csproj @@ -204,25 +204,6 @@ - - Form - - - F_GKT1数据输入输出.cs - - - Form - - - F_GKT1添加文件.cs - - - Form - - - F_GKT1添加项目.cs - - Form @@ -1068,18 +1049,6 @@ Frm_password_reset.cs - - Form - - - GKT.cs - - - Form - - - GKT1.cs - Form @@ -1258,12 +1227,6 @@ F_Projedit.cs - - Form - - - PED.cs - Form @@ -1331,16 +1294,6 @@ True Reference.map - - F_GKT1数据输入输出.cs - Designer - - - F_GKT1添加文件.cs - - - F_GKT1添加项目.cs - Form_EditTask.cs @@ -1836,12 +1789,6 @@ Frm_password_reset.cs - - GKT.cs - - - GKT1.cs - F_GKT数据输入输出.cs @@ -1934,9 +1881,6 @@ F_Projedit.cs - - PED.cs - F_数据输入输出.cs diff --git a/Cyberpipe.suo b/Cyberpipe.suo index 68ced4f..a1aecf8 100644 --- a/Cyberpipe.suo +++ b/Cyberpipe.suo Binary files differ diff --git a/EMS_Forms/Form_EditTask.cs b/EMS_Forms/Form_EditTask.cs index 718992f..f1d791f 100644 --- a/EMS_Forms/Form_EditTask.cs +++ b/EMS_Forms/Form_EditTask.cs @@ -119,7 +119,8 @@ String name = Convert.ToString(dr["USERNAME"]); comboBox_userName.Items.Add(name); - } + } + dr.Close(); comboBox_road.Items.Clear(); roadList = new List(); @@ -135,7 +136,7 @@ comboBox_road.Items.Add(name); } } - + dr1.Close(); conn.Close(); bool flag2 = false; @@ -185,7 +186,7 @@ catch (Exception ex) { - MessageBox.Show(ex.ToString()); + LogHelper.WriteLog(typeof(Form_EditTask), ex.Message); } } @@ -288,7 +289,7 @@ } catch (Exception ex) { - MessageBox.Show(ex.ToString()); + LogHelper.WriteLog(typeof(Form_EditTask), ex.Message); } } @@ -474,7 +475,7 @@ } catch (Exception ex) { - MessageBox.Show(ex.ToString()); + LogHelper.WriteLog(typeof(Form_EditTask), ex.Message); } this.Close(); @@ -495,6 +496,7 @@ { numList.Add(Convert.ToInt32(dr["DBID"])); } + dr.Close(); if (numList.Count == 0) { taskNumber = Convert.ToInt32(number) * 100; @@ -674,6 +676,7 @@ } } } + dr.Close(); conn.Close(); } diff --git a/EMS_Forms/Form_EventManager.cs b/EMS_Forms/Form_EventManager.cs index b18c45b..84807b2 100644 --- a/EMS_Forms/Form_EventManager.cs +++ b/EMS_Forms/Form_EventManager.cs @@ -64,6 +64,7 @@ comboBox_name.Items.Add(name); } + dr.Close(); conn.Close(); diff --git a/Forms/FrmMnModify.cs b/Forms/FrmMnModify.cs index 31cfc5f..d036360 100644 --- a/Forms/FrmMnModify.cs +++ b/Forms/FrmMnModify.cs @@ -68,15 +68,7 @@ questionGrid.Rows[idx].Cells[1].Value = sr.question; } } - /// 选中对象 - /// - /// - /// - /// - private void buttonX1_Click(object sender, EventArgs e) - { - globecontrol.Globe.Action = EnumAction3D.SelectObject; - } + /// /// 选中某一行 /// diff --git a/Forms/FrmPipelineModelDataBase.cs b/Forms/FrmPipelineModelDataBase.cs index 2acf0ca..7ce573f 100644 --- a/Forms/FrmPipelineModelDataBase.cs +++ b/Forms/FrmPipelineModelDataBase.cs @@ -35,19 +35,7 @@ ds = _ds; InitializeComponent(); } - /// - /// 单击选择shp格式文件 - /// - /// - /// - private void btnBrowseModel_Click(object sender, EventArgs e) - { - saveFileDialog1.Filter = "*.lgd|*.lgd"; - if (saveFileDialog1.ShowDialog() == DialogResult.OK) - { - txtModelLayer.Text = saveFileDialog1.FileName; - } - } + /// /// 窗体初始化事件处理 /// @@ -100,49 +88,6 @@ } } } - - private object convertFieldValue(string fieldname, object obj) - { - if (obj == null) - return null; - - try - { - string type = fields_types[fieldname].ToString(); - switch (type) - { - case "string": - return obj.ToString(); - case "int": - //return 101; - int intResult; - if (int.TryParse(obj.ToString(), out intResult)) - return intResult; - else - return null; - case "double": - //return 202.5; - double doubleResult; - if (double.TryParse(obj.ToString(), out doubleResult)) - return doubleResult; - else - return null; - case "date": - DateTime dtResult; - if (DateTime.TryParse(obj.ToString(), out dtResult)) - return dtResult; - else - return null; - } - return null; - } - catch (Exception ex) - { - MessageBox.Show(ex.ToString()); - return null; - } - } - public string lgdFilePath = ""; /// /// 选择管线颜色 @@ -610,33 +555,6 @@ { this.Close(); } - - private void cmbLayer_SelectedIndexChanged(object sender, EventArgs e) //选择图层 - { - GSOLayer layer = ctl.Globe.Layers.GetLayerByCaption(selectLayerName); - GSOFeatures features = layer.GetAllFeatures(); - if (features.Length == 0) - return; - - cmbFrom.Items.Clear(); - cmbTo.Items.Clear(); - cmbRadius.Items.Clear(); - cmbID.Items.Clear(); - for (int i = 0; i < features[0].GetFieldCount(); i++) - { - GeoScene.Data.GSOFieldDefn fielddef = (GeoScene.Data.GSOFieldDefn)(features[0].GetFieldDefn(i)); - - cmbFrom.Items.Add(fielddef.Name); - cmbTo.Items.Add(fielddef.Name); - cmbRadius.Items.Add(fielddef.Name); - cmbID.Items.Add(fielddef.Name); - } - cmbFrom.SelectedItem = "Deep1"; - cmbTo.SelectedItem = "Deep2"; - cmbRadius.SelectedItem = "Diameter"; - cmbID.SelectedItem = "Handle"; - } - private void buttonXLayerPath_Click(object sender, EventArgs e)//单击 选择shp格式的文件 { OpenFileDialog dlg = new OpenFileDialog(); diff --git a/Forms/FrmPipelineModelDataOneStep.cs b/Forms/FrmPipelineModelDataOneStep.cs index 18afda7..ec93b8a 100644 --- a/Forms/FrmPipelineModelDataOneStep.cs +++ b/Forms/FrmPipelineModelDataOneStep.cs @@ -38,19 +38,7 @@ layerTree = _layerTree; InitializeComponent(); } - /// - /// 单击选择shp格式文件 - /// - /// - /// - private void btnBrowseModel_Click(object sender, EventArgs e) - { - saveFileDialog1.Filter = "*.lgd|*.lgd"; - if (saveFileDialog1.ShowDialog() == DialogResult.OK) - { - txtModelLayer.Text = saveFileDialog1.FileName; - } - } + /// /// 窗体初始化事件处理 /// @@ -107,48 +95,7 @@ } } - private object convertFieldValue(string fieldname, object obj) - { - if (obj == null) - return null; - - try - { - string type = fields_types[fieldname].ToString(); - switch (type) - { - case "string": - return obj.ToString(); - case "int": - //return 101; - int intResult; - if (int.TryParse(obj.ToString(), out intResult)) - return intResult; - else - return null; - case "double": - //return 202.5; - double doubleResult; - if (double.TryParse(obj.ToString(), out doubleResult)) - return doubleResult; - else - return null; - case "date": - DateTime dtResult; - if (DateTime.TryParse(obj.ToString(), out dtResult)) - return dtResult; - else - return null; - } - return null; - } - catch (Exception ex) - { - MessageBox.Show(ex.ToString()); - return null; - } - } - + public string lgdFilePath = ""; /// /// 选择管线颜色 @@ -673,32 +620,6 @@ return featDs; } - private void cmbLayer_SelectedIndexChanged(object sender, EventArgs e) //选择图层 - { - GSOLayer layer = ctl.Globe.Layers.GetLayerByCaption(selectLayerName); - GSOFeatures features = layer.GetAllFeatures(); - if (features.Length == 0) - return; - - cmbFrom.Items.Clear(); - cmbTo.Items.Clear(); - cmbRadius.Items.Clear(); - cmbID.Items.Clear(); - for (int i = 0; i < features[0].GetFieldCount(); i++) - { - GeoScene.Data.GSOFieldDefn fielddef = (GeoScene.Data.GSOFieldDefn)(features[0].GetFieldDefn(i)); - - cmbFrom.Items.Add(fielddef.Name); - cmbTo.Items.Add(fielddef.Name); - cmbRadius.Items.Add(fielddef.Name); - cmbID.Items.Add(fielddef.Name); - } - cmbFrom.SelectedItem = "Deep1"; - cmbTo.SelectedItem = "Deep2"; - cmbRadius.SelectedItem = "Diameter"; - cmbID.SelectedItem = "Handle"; - } - private void buttonXLayerPath_Click(object sender, EventArgs e)//单击 选择shp格式的文件 { OpenFileDialog dlg = new OpenFileDialog(); @@ -949,38 +870,6 @@ } //txtLayername.Text = type + layername; } - /// - /// 连接数据库 - /// - /// - /// - private void buttonX1_Click(object sender, EventArgs e) - { - if (ds == null) - { - //没连的话,直接连接审核库; //审核库配置读配置文件 - string dbIp = Utility.sgdbip; - string database = Utility.sgdbname; - string user = Utility.sgdbuser; - string pass = Utility.sgdbpwd; - - if (!Utility.isNetworkConnectionSuccess(dbIp.Trim())) - { - MessageBox.Show("网络连接失败!", "提示"); - return; - } - - ds = ctl.Globe.DataManager.OpenOracleDataSource(dbIp + "/" + database, "", "", user, pass); - if (ds == null) - { - MessageBox.Show("数据库连接失败!", "提示", MessageBoxButtons.OK, MessageBoxIcon.Warning); - } - else - { - btnCreateModel.Enabled = true; - } - } - } private void btnClose_Click(object sender, EventArgs e) { diff --git a/Forms/FrmShRK.cs b/Forms/FrmShRK.cs index 0e2e722..f1d83cb 100644 --- a/Forms/FrmShRK.cs +++ b/Forms/FrmShRK.cs @@ -215,6 +215,7 @@ { sourcefeatds = sourcefeat as GSOFeatureDataset; } + if (sourcefeatds == null) return; sourcefeatds.Open(); GSOFeatures sourcefeatures = sourcefeatds.GetAllFeatures(); @@ -251,6 +252,7 @@ { desfeatds = desfeat as GSOFeatureDataset; } + if (desfeatds == null) return; desfeatds.Open(); //向新数据集写入字段 diff --git a/FrmAccessoriesSensor.cs b/FrmAccessoriesSensor.cs index 09fcdf1..2a7a80e 100644 --- a/FrmAccessoriesSensor.cs +++ b/FrmAccessoriesSensor.cs @@ -209,7 +209,7 @@ chart1.Series[0].Points.DataBindXY(dic.Keys, dic.Values); for (int m = 0; m < dic.Values.Count; m++) { - if (chart1.Series[0].Points[m].YValues[0].ToString() != "0") + if (chart1.Series[0].Points[m]!=null&&chart1.Series[0].Points[m].YValues[0].ToString() != "0") { chart1.Series[0].Points[m].Label = chart1.Series[0].Points[m].YValues[0].ToString(); } diff --git a/FrmAccessoriesgather.cs b/FrmAccessoriesgather.cs index 9e331e1..a475d9e 100644 --- a/FrmAccessoriesgather.cs +++ b/FrmAccessoriesgather.cs @@ -338,7 +338,7 @@ chart1.Series[0].Points.DataBindXY(dic.Keys, dic.Values); for (int m = 0; m < dic.Values.Count; m++) { - if (chart1.Series[0].Points[m].YValues[0].ToString() != "0") + if (chart1.Series[0].Points[m]!=null&&chart1.Series[0].Points[m].YValues[0].ToString() != "0") { chart1.Series[0].Points[m].Label = chart1.Series[0].Points[m].YValues[0].ToString(); } diff --git a/FrmAccessoryAnalysis.cs b/FrmAccessoryAnalysis.cs index 71d4579..44d4065 100644 --- a/FrmAccessoryAnalysis.cs +++ b/FrmAccessoryAnalysis.cs @@ -66,39 +66,6 @@ globeControl1.Refresh(); } /// - /// 键盘按键按下事件处理 - /// - /// - /// - private void txtRadius_KeyPress(object sender, KeyPressEventArgs e) - { - TextBox text = sender as TextBox; - if ((e.KeyChar < 48 || e.KeyChar > 57) && (e.KeyChar != 8) && (int)e.KeyChar != 46) - { - e.Handled = true; - } - if ((int)e.KeyChar == 46) //小数点 - { - if (text.Text.Length <= 0) - e.Handled = true; //小数点不能在第一位 - else //处理不规则的小数点 - { - float f; - float oldf; - bool b1 = false, b2 = false; - b1 = float.TryParse(text.Text, out oldf); - b2 = float.TryParse(text.Text + e.KeyChar.ToString(), out f); - if (b2 == false) - { - if (b1 == true) - e.Handled = true; - else - e.Handled = false; - } - } - } - } - /// /// 确定按钮事件处理 /// /// diff --git a/FrmAddValve.cs b/FrmAddValve.cs index 34d2fec..5f405b9 100644 --- a/FrmAddValve.cs +++ b/FrmAddValve.cs @@ -486,56 +486,6 @@ } } - - - - - - - - private void cmbLayer_SelectedIndexChanged(object sender, EventArgs e) - { - GSOLayer layer = globeControl1.Globe.Layers.GetLayerByCaption(selectLayerName); - GSOFeatures features = layer.GetAllFeatures(); - if (features.Length == 0) - return; - - combPath.Items.Clear(); - combZ.Items.Clear(); - combModelName.Items.Clear(); - - for (int i = 0; i < features[0].GetFieldCount(); i++) - { - GeoScene.Data.GSOFieldDefn fielddef = (GeoScene.Data.GSOFieldDefn)(features[0].GetFieldDefn(i)); - combPath.Items.Add(fielddef.Name); - combZ.Items.Add(fielddef.Name); - combModelName.Items.Add(fielddef.Name); - } - combModelName.SelectedItem = "编号"; - combPath.SelectedItem = "模型路径"; - if (combfile.SelectedIndex != -1) - { - - string layerCaption = combfile.SelectedItem.ToString().Trim(); - rukuLayer = globeControl1.Globe.Layers.GetLayerByCaption(layerCaption); - if (rukuLayer != null) - { - combPath.Items.Clear(); - combZ.Items.Clear(); - combModelName.Items.Clear(); - - } - for (int i = 0; i < features[0].GetFieldCount(); i++) - { - GeoScene.Data.GSOFieldDefn fielddef = (GeoScene.Data.GSOFieldDefn)(features[0].GetFieldDefn(i)); - combPath.Items.Add(fielddef.Name); - combZ.Items.Add(fielddef.Name); - combModelName.Items.Add(fielddef.Name); - } - combModelName.SelectedItem = "编号"; - combPath.SelectedItem = "模型路径"; - } - } /// /// 单击选择shp格式文件 /// diff --git a/FrmAddWellShp.cs b/FrmAddWellShp.cs index bb79ec0..a249725 100644 --- a/FrmAddWellShp.cs +++ b/FrmAddWellShp.cs @@ -478,32 +478,6 @@ } } } - - private void cmbLayer_SelectedIndexChanged(object sender, EventArgs e) - { - GSOLayer layer = globeControl1.Globe.Layers.GetLayerByCaption(selectLayerName); - GSOFeatures features = layer.GetAllFeatures(); - if (features.Length == 0) - return; - - combCode.Items.Clear(); - combDeep.Items.Clear(); - combModelName.Items.Clear(); - combAngle.Items.Clear(); - - for (int i = 0; i < features[0].GetFieldCount(); i++) - { - GeoScene.Data.GSOFieldDefn fielddef = (GeoScene.Data.GSOFieldDefn)(features[0].GetFieldDefn(i)); - combCode.Items.Add(fielddef.Name); - combDeep.Items.Add(fielddef.Name); - combModelName.Items.Add(fielddef.Name); - combAngle.Items.Add(fielddef.Name); - } - combCode.SelectedItem = "附属物编码"; - combDeep.SelectedItem = "井深"; - combModelName.SelectedItem = "编号"; - combAngle.SelectedItem = "符号角度"; - } /// /// 单击选择shp格式文件 /// diff --git a/FrmAddYuBiZiShp.cs b/FrmAddYuBiZiShp.cs index b312d51..332f037 100644 --- a/FrmAddYuBiZiShp.cs +++ b/FrmAddYuBiZiShp.cs @@ -383,80 +383,7 @@ } } - private void cmbLayer_SelectedIndexChanged(object sender, EventArgs e) - { - GSOLayer layer = globeControl1.Globe.Layers.GetLayerByCaption(selectLayerName); - GSOFeatures features = layer.GetAllFeatures(); - if (features.Length == 0) - return; - - combCode.Items.Clear(); - combDeep.Items.Clear(); - combModelName.Items.Clear(); - //comboLoad.Items.Clear(); - for (int i = 0; i < features[0].GetFieldCount(); i++) - { - GeoScene.Data.GSOFieldDefn fielddef = (GeoScene.Data.GSOFieldDefn)(features[0].GetFieldDefn(i)); - combCode.Items.Add(fielddef.Name); - combDeep.Items.Add(fielddef.Name); - combModelName.Items.Add(fielddef.Name); - //comboLoad.Items.Add(fielddef.Name); - } - combCode.SelectedItem = "附属物编码"; - combDeep.SelectedItem = "Z坐标"; - combModelName.SelectedItem = "编号"; - //comboLoad.SelectedItem = "模型路径"; - } - - private void buttonXLayerPath_Click(object sender, EventArgs e) - { - OpenFileDialog dlg = new OpenFileDialog(); - dlg.Filter = "*.shp|*.shp"; - dlg.Multiselect = false; - if (dlg.ShowDialog() == DialogResult.OK) - { - GSOLayer layer = globeControl1.Globe.Layers.Add(dlg.FileName); - string txtMessage = valiYBdata(layer); - if (txtMessage != "") - { - button3.Enabled = false; - //textBoxLayer.Text = ""; - combCode.Items.Clear(); - combDeep.Items.Clear(); - combModelName.Items.Clear(); - globeControl1.Globe.Layers.Remove(layer); - FrmValiDataShowErrorMessage showErrorMessage = new FrmValiDataShowErrorMessage(dlg.FileName, txtMessage); - showErrorMessage.ShowDialog(); - return; - } - else - { - button3.Enabled = true; - //textBoxLayer.Text = dlg.FileName; - selectLayerName = layer.Caption; - txtLayerName.Text = layer.Caption; - GSOFeatures features = layer.GetAllFeatures(); - if (features.Length == 0) - return; - - combCode.Items.Clear(); - combDeep.Items.Clear(); - combModelName.Items.Clear(); - for (int i = 0; i < features[0].GetFieldCount(); i++) - { - GeoScene.Data.GSOFieldDefn fielddef = (GeoScene.Data.GSOFieldDefn)(features[0].GetFieldDefn(i)); - combCode.Items.Add(fielddef.Name); - combDeep.Items.Add(fielddef.Name); - combModelName.Items.Add(fielddef.Name); - //comboLoad.Items.Add(fielddef.Name); - } - combCode.SelectedItem = "管点编码"; - combDeep.SelectedItem = "Z坐标"; - combModelName.SelectedItem = "编号"; - } - } - } - + private void FrmAddYuBiZiShp_FormClosing(object sender, FormClosingEventArgs e) { globeControl1.Globe.Refresh(); diff --git a/FrmAllPipelineStatis.cs b/FrmAllPipelineStatis.cs index 6421a26..a6eea29 100644 --- a/FrmAllPipelineStatis.cs +++ b/FrmAllPipelineStatis.cs @@ -84,7 +84,7 @@ chartAllAreaPipeline.Series["管线"].Points.DataBindXY(pipelineLengthAndType.Keys, pipelineLengthAndType.Values); for (int m = 0; m < pipelineLengthAndType.Values.Count; m++) { - if (chartAllAreaPipeline.Series["管线"].Points[m].YValues[0].ToString() != "0") + if (chartAllAreaPipeline.Series["管线"].Points[m]!=null&&chartAllAreaPipeline.Series["管线"].Points[m].YValues[0].ToString() != "0") { chartAllAreaPipeline.Series["管线"].Points[m].Label = chartAllAreaPipeline.Series[0].Points[m].YValues[0].ToString(); } @@ -94,7 +94,7 @@ } catch (Exception ex) { - //LogError.PublishError(ex); + LogHelper.WriteLog(typeof(FrmAllPipelineStatis), ex.Message); } } @@ -147,7 +147,7 @@ } DataTable dt = OledbHelper.QueryTable(sql); - if (dt != null && dt.Rows.Count > 0) + if (dt != null && dt.Rows.Count > 0 && chartAllAreaPipeline.Series["管线"].Points[indexHit]!=null) { dataGridViewX1.DataSource = dt; panel.Visible = true; diff --git a/FrmAllWorkWellStatis.cs b/FrmAllWorkWellStatis.cs index 6fec7af..6af8e4c 100644 --- a/FrmAllWorkWellStatis.cs +++ b/FrmAllWorkWellStatis.cs @@ -52,7 +52,7 @@ chartAllAreaPipeline.Series["井盖"].Points.DataBindXY(workWellLengthAndType.Keys, workWellLengthAndType.Values); for (int m = 0; m < workWellLengthAndType.Values.Count; m++) { - if (chartAllAreaPipeline.Series["井盖"].Points[m].YValues[0].ToString().Trim() != "0") + if (chartAllAreaPipeline.Series["井盖"].Points[m]!=null&&chartAllAreaPipeline.Series["井盖"].Points[m].YValues[0].ToString().Trim() != "0") { chartAllAreaPipeline.Series["井盖"].Points[m].Label = chartAllAreaPipeline.Series[0].Points[m].YValues[0].ToString(); } @@ -60,7 +60,7 @@ } catch (Exception ex) { - //LogError.PublishError(ex); + LogHelper.WriteLog(typeof(FrmAllWorkWellStatis), ex.Message); } } diff --git a/FrmBSQDuoBianXingStatis.cs b/FrmBSQDuoBianXingStatis.cs index e8b7d52..3e889b6 100644 --- a/FrmBSQDuoBianXingStatis.cs +++ b/FrmBSQDuoBianXingStatis.cs @@ -60,7 +60,7 @@ { for (int m = 0; m < bsq1.Values.Count; m++) { - if (chart1.Series["标识器"].Points[m].YValues[0].ToString() != "0") + if (chart1.Series["标识器"].Points[m]!=null&&chart1.Series["标识器"].Points[m].YValues[0].ToString() != "0") { count += Convert.ToInt16(chart1.Series[0].Points[m].YValues[0].ToString()); chart1.Series["标识器"].Points[m].Label = chart1.Series[0].Points[m].YValues[0].ToString(); diff --git a/FrmBSQDuoBianXingStreet.cs b/FrmBSQDuoBianXingStreet.cs index 2005ebb..1db5777 100644 --- a/FrmBSQDuoBianXingStreet.cs +++ b/FrmBSQDuoBianXingStreet.cs @@ -63,7 +63,7 @@ chartStatis.Series[0].Points.DataBindXY(bsq.Keys, bsq.Values); for (int m = 0; m < bsq.Values.Count; m++) { - if (chartStatis.Series[0].Points[m].YValues[0].ToString().Trim() != "0") + if (chartStatis.Series[0].Points[m]!=null&&chartStatis.Series[0].Points[m].YValues[0].ToString().Trim() != "0") { count += Convert.ToInt16(chartStatis.Series[0].Points[m].YValues[0].ToString()); chartStatis.Series[0].Points[m].Label = chartStatis.Series[0].Points[m].YValues[0].ToString(); diff --git a/FrmBSQStatis.cs b/FrmBSQStatis.cs index 390a55c..4aa0ee6 100644 --- a/FrmBSQStatis.cs +++ b/FrmBSQStatis.cs @@ -95,6 +95,8 @@ } } } + + dr.Close(); conn.Close(); for (int i = 0; i < typeLists.Count; i++) { @@ -123,7 +125,7 @@ chartStatis.Series[0].Points.DataBindXY(bsq.Keys, bsq.Values); for (int m = 0; m < bsq.Values.Count; m++) { - if (chartStatis.Series[0].Points[m].YValues[0].ToString().Trim() != "0") + if (chartStatis.Series[0].Points[m]!=null&&chartStatis.Series[0].Points[m].YValues[0].ToString().Trim() != "0") { //count += Convert.ToInt16(chartStatis.Series[0].Points[m].YValues[0].ToString()); chartStatis.Series[0].Points[m].Label = chartStatis.Series[0].Points[m].YValues[0].ToString(); diff --git a/FrmBSQStreet.cs b/FrmBSQStreet.cs index 9d88adb..7fbacad 100644 --- a/FrmBSQStreet.cs +++ b/FrmBSQStreet.cs @@ -44,7 +44,7 @@ chartStatis.Series[0].Points.DataBindXY(bsq.Keys, bsq.Values); for (int m = 0; m < bsq.Values.Count; m++) { - if (chartStatis.Series[0].Points[m].YValues[0].ToString().Trim() != "0") + if (chartStatis.Series[0].Points[m]!=null&&chartStatis.Series[0].Points[m].YValues[0].ToString().Trim() != "0") { count += Convert.ToInt16(chartStatis.Series[0].Points[m].YValues[0].ToString()); chartStatis.Series[0].Points[m].Label = chartStatis.Series[0].Points[m].YValues[0].ToString(); diff --git a/FrmBoosterValvers.cs b/FrmBoosterValvers.cs index 5061efc..df9b62b 100644 --- a/FrmBoosterValvers.cs +++ b/FrmBoosterValvers.cs @@ -236,199 +236,6 @@ count = 0; } } - /// - /// 添加火苗 - /// - /// - /// - /// - /// - private GSOFeature AddFire(double x,double y,double z) - { - // 烟火示例 - - string strResPath = Application.StartupPath + "/Resource"; - - // 烟火粒子示例,由三个发射器构成 - GSOGeoParticle geoParticle = new GSOGeoParticle(); - geoParticle.SetPosition(x, y, z); // 添加到这个经纬度位置 - geoParticle.AltitudeMode = EnumAltitudeMode.RelativeToGround; - - GSORingParticleEmitter emitter = new GSORingParticleEmitter(); - emitter.TexturePath = strResPath + "/ParticleImage/flare.png"; - - emitter.SetSizeFix(1, 1); - emitter.VelFix = 1; - emitter.VelRnd = 5; - - emitter.AngleXYFix = 0; - emitter.AngleXYRnd = 180; - - emitter.AngleXZFix = 90; - emitter.AngleXZRnd = 0; - - emitter.LifeFix = 0.5f; - emitter.LifeRnd = 0.0f; - - emitter.RotFix = 0; - emitter.RotRnd = 0; - - emitter.RotVelFix = 0; - emitter.RotVelRnd = 0; - - emitter.EmitPerSec = 100; - - // 采用线性插值生成粒子的初始颜色 - emitter.ColorRndStart = Color.White; - emitter.ColorRndEnd = Color.Red; - - - GSOColorParticleEffector effector2 = new GSOColorParticleEffector(); - effector2.SetColorChanged(0, -1, -1, 0); - effector2.StartTime = 0.0f; - effector2.EndTime = -1.0f; - emitter.AddEffector(effector2); - - // 将三个发射器添加到粒子对象中 - geoParticle.AddEmitter(emitter); - - geoParticle.Play(); - - GSOFeature feature = new GSOFeature(); - - feature.Geometry = geoParticle; - - globeControl1.Globe.MemoryLayer.AddFeature(feature); - - - return feature; - } - - /// - /// 添加喷泉 - /// - /// - private GSOFeature AddFountain() - { - string strResPath = Application.StartupPath + "/Resource"; - - GSOGeoParticle geoParticle = new GSOGeoParticle(); - geoParticle.SetPosition(116.314, 39.84, 0); // 添加到这个经纬度位置 - - GSOPointParticleEmitter emitter = new GSOPointParticleEmitter(); - emitter.TexturePath = strResPath + "/ParticleImage/test.png"; - - emitter.SetSizeFix(0.5f, 2); - emitter.VelFix = 10; - emitter.VelRnd = 2; - - emitter.GravityAcc = 9.8f; - emitter.AngleXYFix = 0; - emitter.AngleXYRnd = 180; - - emitter.AngleXZFix = 88; - emitter.AngleXZRnd = 2; - - //emitter.InnerRadius = 0; - // emitter.OuterRadius = 0.03f; - - emitter.LifeFix = 5.0f; - emitter.LifeRnd = 1.0f; - - emitter.RotFix = 0; - emitter.RotRnd = 0; - - emitter.RotVelFix = 0; - emitter.RotVelRnd = 0; - - emitter.EmitPerSec = 1000; - emitter.ColorRndStart = Color.FromArgb(33, 255, 255, 255); - emitter.ColorRndEnd = Color.FromArgb(11, 255, 255, 255); - emitter.IsLumAdded = false; - - // 将三个发射器添加到粒子对象中 - geoParticle.AddEmitter(emitter); - - geoParticle.Play(); - GSOFeature feature = new GSOFeature(); - - feature.Geometry = geoParticle; - - //globeControl1.Globe.MemoryLayer.AddFeature(feature); - globeControl1.Globe.FlyToFeature(feature); - - return feature; - } - - /// - /// 添加水柱 - /// - /// - private GSOFeature AddWaterLine() - { - string strResPath = Application.StartupPath + "/Resource"; - - GSOGeoParticle geoParticle = new GSOGeoParticle(); - geoParticle.SetPosition(116.308, 39.84, 0); // 添加到这个经纬度位置 - - GSOPointParticleEmitter emitter = new GSOPointParticleEmitter(); - - emitter.TexturePath = strResPath + "/ParticleImage/drop3.png"; - - geoParticle.TimerInterval = 1; - - emitter.SetSizeFix(2.0f, 2.0f); - - emitter.VelFix = 50; - emitter.VelRnd = 2; - - // emitter.IsLumAdded = false; - - emitter.GravityAcc = 9.8f; - emitter.AngleXYFix = 0; - emitter.AngleXYRnd = 2; - - emitter.AngleXZFix = 60; - emitter.AngleXZRnd = 2; - - //emitter.InnerRadius = 0; - // emitter.OuterRadius = 0.1f; - - emitter.LifeFix = 5.0f; - emitter.LifeRnd = 1.0f; - - emitter.RotFix = 0; - emitter.RotRnd = 0; - - emitter.RotVelFix = 0; - emitter.RotVelRnd = 0; - - emitter.EmitPerSec = 1500; - - emitter.ColorRndStart = Color.FromArgb(100, 222, 222, 222); - emitter.ColorRndEnd = Color.FromArgb(50, 222, 222, 222); - - /* - - GSOScaleParticleEffector effector1 = new GSOScaleParticleEffector(); - effector1.SetScale(0.2f, 0.2f); - effector1.StartTime = 0; - effector1.EndTime = -1; // 负数表示整个粒子生命结束 - emitter.AddEffector(effector1); - */ - - // 将三个发射器添加到粒子对象中 - geoParticle.AddEmitter(emitter); - - geoParticle.Play(); - GSOFeature feature = new GSOFeature(); - - feature.Geometry = geoParticle; - - //globeControl1.Globe.MemoryLayer.AddFeature(feature); - globeControl1.Globe.FlyToFeature(feature); - - return feature; - } + } } diff --git a/FrmBufferAnalysis.cs b/FrmBufferAnalysis.cs index f711133..db8ca59 100644 --- a/FrmBufferAnalysis.cs +++ b/FrmBufferAnalysis.cs @@ -123,39 +123,6 @@ } } /// - /// 半径文本框的键盘按键按下事件处理 - /// - /// - /// - private void txtRadius_KeyPress(object sender, KeyPressEventArgs e) - { - TextBox text = sender as TextBox; - if ((e.KeyChar < 48 || e.KeyChar > 57) && (e.KeyChar != 8) && (int)e.KeyChar != 46) - { - e.Handled = true; - } - if ((int)e.KeyChar == 46) //小数点 - { - if (text.Text.Length <= 0) - e.Handled = true; //小数点不能在第一位 - else //处理不规则的小数点 - { - float f; - float oldf; - bool b1 = false, b2 = false; - b1 = float.TryParse(text.Text, out oldf); - b2 = float.TryParse(text.Text + e.KeyChar.ToString(), out f); - if (b2 == false) - { - if (b1 == true) - e.Handled = true; - else - e.Handled = false; - } - } - } - } - /// /// 窗体关闭事件处理 /// /// diff --git a/FrmBufferAnalysisBSQ.cs b/FrmBufferAnalysisBSQ.cs index 24a96ca..f54208f 100644 --- a/FrmBufferAnalysisBSQ.cs +++ b/FrmBufferAnalysisBSQ.cs @@ -137,35 +137,7 @@ } } - private void txtRadius_KeyPress(object sender, KeyPressEventArgs e) - { - TextBox text = sender as TextBox; - if ((e.KeyChar < 48 || e.KeyChar > 57) && (e.KeyChar != 8) && (int)e.KeyChar != 46) - { - e.Handled = true; - } - if ((int)e.KeyChar == 46) //小数点 - { - if (text.Text.Length <= 0) - e.Handled = true; //小数点不能在第一位 - else //处理不规则的小数点 - { - float f; - float oldf; - bool b1 = false, b2 = false; - b1 = float.TryParse(text.Text, out oldf); - b2 = float.TryParse(text.Text + e.KeyChar.ToString(), out f); - if (b2 == false) - { - if (b1 == true) - e.Handled = true; - else - e.Handled = false; - } - } - } - } - + private void FrmBufferAnalysis_FormClosing(object sender, FormClosingEventArgs e) { //Form1.y = 0; @@ -316,27 +288,6 @@ } } - private void FlyToMenu_Click(object sender, EventArgs e) - { - if (m_feature != null) - { - if (m_feature.Geometry != null && m_feature.Geometry.Type == EnumGeometryType.GeoPolyline3D) - { - GSOGeoPolyline3D line = m_feature.Geometry as GSOGeoPolyline3D; - double length = line.GetSpaceLength(true, 6378137); - GSOGeoPolyline3D lineLine = line.GetSegment(0, length / 2); - GSOPoint3d point3d = lineLine[lineLine.PartCount - 1][lineLine[lineLine.PartCount - 1].Count - 1]; - - globeControl1.Globe.FlyToPosition(point3d, EnumAltitudeMode.Absolute, 0, 45, 5); - } - else - { - globeControl1.Globe.FlyToFeature(m_feature, 0, 45, 3); - } - LightMenu_Click(sender, e); - } - } - private void LightMenu_Click(object sender, EventArgs e) { flashflag = "single"; diff --git a/FrmDataBaseOpt.cs b/FrmDataBaseOpt.cs index b0c4b5d..8d7b69d 100644 --- a/FrmDataBaseOpt.cs +++ b/FrmDataBaseOpt.cs @@ -362,6 +362,7 @@ dbCombor.Items.Add(dblist[i].title); } } + /* /// /// 从配置文件读取数据库参数配置 /// @@ -428,6 +429,8 @@ } } + * */ + /* /// /// 向配置文件写入连接数据库的参数配置 /// @@ -485,6 +488,7 @@ MessageBox.Show(exp.ToString()); } } + * */ /// /// /// diff --git a/Cyberpipe.csproj b/Cyberpipe.csproj index 07a8c1a..e3cd12c 100644 --- a/Cyberpipe.csproj +++ b/Cyberpipe.csproj @@ -204,25 +204,6 @@ - - Form - - - F_GKT1数据输入输出.cs - - - Form - - - F_GKT1添加文件.cs - - - Form - - - F_GKT1添加项目.cs - - Form @@ -1068,18 +1049,6 @@ Frm_password_reset.cs - - Form - - - GKT.cs - - - Form - - - GKT1.cs - Form @@ -1258,12 +1227,6 @@ F_Projedit.cs - - Form - - - PED.cs - Form @@ -1331,16 +1294,6 @@ True Reference.map - - F_GKT1数据输入输出.cs - Designer - - - F_GKT1添加文件.cs - - - F_GKT1添加项目.cs - Form_EditTask.cs @@ -1836,12 +1789,6 @@ Frm_password_reset.cs - - GKT.cs - - - GKT1.cs - F_GKT数据输入输出.cs @@ -1934,9 +1881,6 @@ F_Projedit.cs - - PED.cs - F_数据输入输出.cs diff --git a/Cyberpipe.suo b/Cyberpipe.suo index 68ced4f..a1aecf8 100644 --- a/Cyberpipe.suo +++ b/Cyberpipe.suo Binary files differ diff --git a/EMS_Forms/Form_EditTask.cs b/EMS_Forms/Form_EditTask.cs index 718992f..f1d791f 100644 --- a/EMS_Forms/Form_EditTask.cs +++ b/EMS_Forms/Form_EditTask.cs @@ -119,7 +119,8 @@ String name = Convert.ToString(dr["USERNAME"]); comboBox_userName.Items.Add(name); - } + } + dr.Close(); comboBox_road.Items.Clear(); roadList = new List(); @@ -135,7 +136,7 @@ comboBox_road.Items.Add(name); } } - + dr1.Close(); conn.Close(); bool flag2 = false; @@ -185,7 +186,7 @@ catch (Exception ex) { - MessageBox.Show(ex.ToString()); + LogHelper.WriteLog(typeof(Form_EditTask), ex.Message); } } @@ -288,7 +289,7 @@ } catch (Exception ex) { - MessageBox.Show(ex.ToString()); + LogHelper.WriteLog(typeof(Form_EditTask), ex.Message); } } @@ -474,7 +475,7 @@ } catch (Exception ex) { - MessageBox.Show(ex.ToString()); + LogHelper.WriteLog(typeof(Form_EditTask), ex.Message); } this.Close(); @@ -495,6 +496,7 @@ { numList.Add(Convert.ToInt32(dr["DBID"])); } + dr.Close(); if (numList.Count == 0) { taskNumber = Convert.ToInt32(number) * 100; @@ -674,6 +676,7 @@ } } } + dr.Close(); conn.Close(); } diff --git a/EMS_Forms/Form_EventManager.cs b/EMS_Forms/Form_EventManager.cs index b18c45b..84807b2 100644 --- a/EMS_Forms/Form_EventManager.cs +++ b/EMS_Forms/Form_EventManager.cs @@ -64,6 +64,7 @@ comboBox_name.Items.Add(name); } + dr.Close(); conn.Close(); diff --git a/Forms/FrmMnModify.cs b/Forms/FrmMnModify.cs index 31cfc5f..d036360 100644 --- a/Forms/FrmMnModify.cs +++ b/Forms/FrmMnModify.cs @@ -68,15 +68,7 @@ questionGrid.Rows[idx].Cells[1].Value = sr.question; } } - /// 选中对象 - /// - /// - /// - /// - private void buttonX1_Click(object sender, EventArgs e) - { - globecontrol.Globe.Action = EnumAction3D.SelectObject; - } + /// /// 选中某一行 /// diff --git a/Forms/FrmPipelineModelDataBase.cs b/Forms/FrmPipelineModelDataBase.cs index 2acf0ca..7ce573f 100644 --- a/Forms/FrmPipelineModelDataBase.cs +++ b/Forms/FrmPipelineModelDataBase.cs @@ -35,19 +35,7 @@ ds = _ds; InitializeComponent(); } - /// - /// 单击选择shp格式文件 - /// - /// - /// - private void btnBrowseModel_Click(object sender, EventArgs e) - { - saveFileDialog1.Filter = "*.lgd|*.lgd"; - if (saveFileDialog1.ShowDialog() == DialogResult.OK) - { - txtModelLayer.Text = saveFileDialog1.FileName; - } - } + /// /// 窗体初始化事件处理 /// @@ -100,49 +88,6 @@ } } } - - private object convertFieldValue(string fieldname, object obj) - { - if (obj == null) - return null; - - try - { - string type = fields_types[fieldname].ToString(); - switch (type) - { - case "string": - return obj.ToString(); - case "int": - //return 101; - int intResult; - if (int.TryParse(obj.ToString(), out intResult)) - return intResult; - else - return null; - case "double": - //return 202.5; - double doubleResult; - if (double.TryParse(obj.ToString(), out doubleResult)) - return doubleResult; - else - return null; - case "date": - DateTime dtResult; - if (DateTime.TryParse(obj.ToString(), out dtResult)) - return dtResult; - else - return null; - } - return null; - } - catch (Exception ex) - { - MessageBox.Show(ex.ToString()); - return null; - } - } - public string lgdFilePath = ""; /// /// 选择管线颜色 @@ -610,33 +555,6 @@ { this.Close(); } - - private void cmbLayer_SelectedIndexChanged(object sender, EventArgs e) //选择图层 - { - GSOLayer layer = ctl.Globe.Layers.GetLayerByCaption(selectLayerName); - GSOFeatures features = layer.GetAllFeatures(); - if (features.Length == 0) - return; - - cmbFrom.Items.Clear(); - cmbTo.Items.Clear(); - cmbRadius.Items.Clear(); - cmbID.Items.Clear(); - for (int i = 0; i < features[0].GetFieldCount(); i++) - { - GeoScene.Data.GSOFieldDefn fielddef = (GeoScene.Data.GSOFieldDefn)(features[0].GetFieldDefn(i)); - - cmbFrom.Items.Add(fielddef.Name); - cmbTo.Items.Add(fielddef.Name); - cmbRadius.Items.Add(fielddef.Name); - cmbID.Items.Add(fielddef.Name); - } - cmbFrom.SelectedItem = "Deep1"; - cmbTo.SelectedItem = "Deep2"; - cmbRadius.SelectedItem = "Diameter"; - cmbID.SelectedItem = "Handle"; - } - private void buttonXLayerPath_Click(object sender, EventArgs e)//单击 选择shp格式的文件 { OpenFileDialog dlg = new OpenFileDialog(); diff --git a/Forms/FrmPipelineModelDataOneStep.cs b/Forms/FrmPipelineModelDataOneStep.cs index 18afda7..ec93b8a 100644 --- a/Forms/FrmPipelineModelDataOneStep.cs +++ b/Forms/FrmPipelineModelDataOneStep.cs @@ -38,19 +38,7 @@ layerTree = _layerTree; InitializeComponent(); } - /// - /// 单击选择shp格式文件 - /// - /// - /// - private void btnBrowseModel_Click(object sender, EventArgs e) - { - saveFileDialog1.Filter = "*.lgd|*.lgd"; - if (saveFileDialog1.ShowDialog() == DialogResult.OK) - { - txtModelLayer.Text = saveFileDialog1.FileName; - } - } + /// /// 窗体初始化事件处理 /// @@ -107,48 +95,7 @@ } } - private object convertFieldValue(string fieldname, object obj) - { - if (obj == null) - return null; - - try - { - string type = fields_types[fieldname].ToString(); - switch (type) - { - case "string": - return obj.ToString(); - case "int": - //return 101; - int intResult; - if (int.TryParse(obj.ToString(), out intResult)) - return intResult; - else - return null; - case "double": - //return 202.5; - double doubleResult; - if (double.TryParse(obj.ToString(), out doubleResult)) - return doubleResult; - else - return null; - case "date": - DateTime dtResult; - if (DateTime.TryParse(obj.ToString(), out dtResult)) - return dtResult; - else - return null; - } - return null; - } - catch (Exception ex) - { - MessageBox.Show(ex.ToString()); - return null; - } - } - + public string lgdFilePath = ""; /// /// 选择管线颜色 @@ -673,32 +620,6 @@ return featDs; } - private void cmbLayer_SelectedIndexChanged(object sender, EventArgs e) //选择图层 - { - GSOLayer layer = ctl.Globe.Layers.GetLayerByCaption(selectLayerName); - GSOFeatures features = layer.GetAllFeatures(); - if (features.Length == 0) - return; - - cmbFrom.Items.Clear(); - cmbTo.Items.Clear(); - cmbRadius.Items.Clear(); - cmbID.Items.Clear(); - for (int i = 0; i < features[0].GetFieldCount(); i++) - { - GeoScene.Data.GSOFieldDefn fielddef = (GeoScene.Data.GSOFieldDefn)(features[0].GetFieldDefn(i)); - - cmbFrom.Items.Add(fielddef.Name); - cmbTo.Items.Add(fielddef.Name); - cmbRadius.Items.Add(fielddef.Name); - cmbID.Items.Add(fielddef.Name); - } - cmbFrom.SelectedItem = "Deep1"; - cmbTo.SelectedItem = "Deep2"; - cmbRadius.SelectedItem = "Diameter"; - cmbID.SelectedItem = "Handle"; - } - private void buttonXLayerPath_Click(object sender, EventArgs e)//单击 选择shp格式的文件 { OpenFileDialog dlg = new OpenFileDialog(); @@ -949,38 +870,6 @@ } //txtLayername.Text = type + layername; } - /// - /// 连接数据库 - /// - /// - /// - private void buttonX1_Click(object sender, EventArgs e) - { - if (ds == null) - { - //没连的话,直接连接审核库; //审核库配置读配置文件 - string dbIp = Utility.sgdbip; - string database = Utility.sgdbname; - string user = Utility.sgdbuser; - string pass = Utility.sgdbpwd; - - if (!Utility.isNetworkConnectionSuccess(dbIp.Trim())) - { - MessageBox.Show("网络连接失败!", "提示"); - return; - } - - ds = ctl.Globe.DataManager.OpenOracleDataSource(dbIp + "/" + database, "", "", user, pass); - if (ds == null) - { - MessageBox.Show("数据库连接失败!", "提示", MessageBoxButtons.OK, MessageBoxIcon.Warning); - } - else - { - btnCreateModel.Enabled = true; - } - } - } private void btnClose_Click(object sender, EventArgs e) { diff --git a/Forms/FrmShRK.cs b/Forms/FrmShRK.cs index 0e2e722..f1d83cb 100644 --- a/Forms/FrmShRK.cs +++ b/Forms/FrmShRK.cs @@ -215,6 +215,7 @@ { sourcefeatds = sourcefeat as GSOFeatureDataset; } + if (sourcefeatds == null) return; sourcefeatds.Open(); GSOFeatures sourcefeatures = sourcefeatds.GetAllFeatures(); @@ -251,6 +252,7 @@ { desfeatds = desfeat as GSOFeatureDataset; } + if (desfeatds == null) return; desfeatds.Open(); //向新数据集写入字段 diff --git a/FrmAccessoriesSensor.cs b/FrmAccessoriesSensor.cs index 09fcdf1..2a7a80e 100644 --- a/FrmAccessoriesSensor.cs +++ b/FrmAccessoriesSensor.cs @@ -209,7 +209,7 @@ chart1.Series[0].Points.DataBindXY(dic.Keys, dic.Values); for (int m = 0; m < dic.Values.Count; m++) { - if (chart1.Series[0].Points[m].YValues[0].ToString() != "0") + if (chart1.Series[0].Points[m]!=null&&chart1.Series[0].Points[m].YValues[0].ToString() != "0") { chart1.Series[0].Points[m].Label = chart1.Series[0].Points[m].YValues[0].ToString(); } diff --git a/FrmAccessoriesgather.cs b/FrmAccessoriesgather.cs index 9e331e1..a475d9e 100644 --- a/FrmAccessoriesgather.cs +++ b/FrmAccessoriesgather.cs @@ -338,7 +338,7 @@ chart1.Series[0].Points.DataBindXY(dic.Keys, dic.Values); for (int m = 0; m < dic.Values.Count; m++) { - if (chart1.Series[0].Points[m].YValues[0].ToString() != "0") + if (chart1.Series[0].Points[m]!=null&&chart1.Series[0].Points[m].YValues[0].ToString() != "0") { chart1.Series[0].Points[m].Label = chart1.Series[0].Points[m].YValues[0].ToString(); } diff --git a/FrmAccessoryAnalysis.cs b/FrmAccessoryAnalysis.cs index 71d4579..44d4065 100644 --- a/FrmAccessoryAnalysis.cs +++ b/FrmAccessoryAnalysis.cs @@ -66,39 +66,6 @@ globeControl1.Refresh(); } /// - /// 键盘按键按下事件处理 - /// - /// - /// - private void txtRadius_KeyPress(object sender, KeyPressEventArgs e) - { - TextBox text = sender as TextBox; - if ((e.KeyChar < 48 || e.KeyChar > 57) && (e.KeyChar != 8) && (int)e.KeyChar != 46) - { - e.Handled = true; - } - if ((int)e.KeyChar == 46) //小数点 - { - if (text.Text.Length <= 0) - e.Handled = true; //小数点不能在第一位 - else //处理不规则的小数点 - { - float f; - float oldf; - bool b1 = false, b2 = false; - b1 = float.TryParse(text.Text, out oldf); - b2 = float.TryParse(text.Text + e.KeyChar.ToString(), out f); - if (b2 == false) - { - if (b1 == true) - e.Handled = true; - else - e.Handled = false; - } - } - } - } - /// /// 确定按钮事件处理 /// /// diff --git a/FrmAddValve.cs b/FrmAddValve.cs index 34d2fec..5f405b9 100644 --- a/FrmAddValve.cs +++ b/FrmAddValve.cs @@ -486,56 +486,6 @@ } } - - - - - - - - private void cmbLayer_SelectedIndexChanged(object sender, EventArgs e) - { - GSOLayer layer = globeControl1.Globe.Layers.GetLayerByCaption(selectLayerName); - GSOFeatures features = layer.GetAllFeatures(); - if (features.Length == 0) - return; - - combPath.Items.Clear(); - combZ.Items.Clear(); - combModelName.Items.Clear(); - - for (int i = 0; i < features[0].GetFieldCount(); i++) - { - GeoScene.Data.GSOFieldDefn fielddef = (GeoScene.Data.GSOFieldDefn)(features[0].GetFieldDefn(i)); - combPath.Items.Add(fielddef.Name); - combZ.Items.Add(fielddef.Name); - combModelName.Items.Add(fielddef.Name); - } - combModelName.SelectedItem = "编号"; - combPath.SelectedItem = "模型路径"; - if (combfile.SelectedIndex != -1) - { - - string layerCaption = combfile.SelectedItem.ToString().Trim(); - rukuLayer = globeControl1.Globe.Layers.GetLayerByCaption(layerCaption); - if (rukuLayer != null) - { - combPath.Items.Clear(); - combZ.Items.Clear(); - combModelName.Items.Clear(); - - } - for (int i = 0; i < features[0].GetFieldCount(); i++) - { - GeoScene.Data.GSOFieldDefn fielddef = (GeoScene.Data.GSOFieldDefn)(features[0].GetFieldDefn(i)); - combPath.Items.Add(fielddef.Name); - combZ.Items.Add(fielddef.Name); - combModelName.Items.Add(fielddef.Name); - } - combModelName.SelectedItem = "编号"; - combPath.SelectedItem = "模型路径"; - } - } /// /// 单击选择shp格式文件 /// diff --git a/FrmAddWellShp.cs b/FrmAddWellShp.cs index bb79ec0..a249725 100644 --- a/FrmAddWellShp.cs +++ b/FrmAddWellShp.cs @@ -478,32 +478,6 @@ } } } - - private void cmbLayer_SelectedIndexChanged(object sender, EventArgs e) - { - GSOLayer layer = globeControl1.Globe.Layers.GetLayerByCaption(selectLayerName); - GSOFeatures features = layer.GetAllFeatures(); - if (features.Length == 0) - return; - - combCode.Items.Clear(); - combDeep.Items.Clear(); - combModelName.Items.Clear(); - combAngle.Items.Clear(); - - for (int i = 0; i < features[0].GetFieldCount(); i++) - { - GeoScene.Data.GSOFieldDefn fielddef = (GeoScene.Data.GSOFieldDefn)(features[0].GetFieldDefn(i)); - combCode.Items.Add(fielddef.Name); - combDeep.Items.Add(fielddef.Name); - combModelName.Items.Add(fielddef.Name); - combAngle.Items.Add(fielddef.Name); - } - combCode.SelectedItem = "附属物编码"; - combDeep.SelectedItem = "井深"; - combModelName.SelectedItem = "编号"; - combAngle.SelectedItem = "符号角度"; - } /// /// 单击选择shp格式文件 /// diff --git a/FrmAddYuBiZiShp.cs b/FrmAddYuBiZiShp.cs index b312d51..332f037 100644 --- a/FrmAddYuBiZiShp.cs +++ b/FrmAddYuBiZiShp.cs @@ -383,80 +383,7 @@ } } - private void cmbLayer_SelectedIndexChanged(object sender, EventArgs e) - { - GSOLayer layer = globeControl1.Globe.Layers.GetLayerByCaption(selectLayerName); - GSOFeatures features = layer.GetAllFeatures(); - if (features.Length == 0) - return; - - combCode.Items.Clear(); - combDeep.Items.Clear(); - combModelName.Items.Clear(); - //comboLoad.Items.Clear(); - for (int i = 0; i < features[0].GetFieldCount(); i++) - { - GeoScene.Data.GSOFieldDefn fielddef = (GeoScene.Data.GSOFieldDefn)(features[0].GetFieldDefn(i)); - combCode.Items.Add(fielddef.Name); - combDeep.Items.Add(fielddef.Name); - combModelName.Items.Add(fielddef.Name); - //comboLoad.Items.Add(fielddef.Name); - } - combCode.SelectedItem = "附属物编码"; - combDeep.SelectedItem = "Z坐标"; - combModelName.SelectedItem = "编号"; - //comboLoad.SelectedItem = "模型路径"; - } - - private void buttonXLayerPath_Click(object sender, EventArgs e) - { - OpenFileDialog dlg = new OpenFileDialog(); - dlg.Filter = "*.shp|*.shp"; - dlg.Multiselect = false; - if (dlg.ShowDialog() == DialogResult.OK) - { - GSOLayer layer = globeControl1.Globe.Layers.Add(dlg.FileName); - string txtMessage = valiYBdata(layer); - if (txtMessage != "") - { - button3.Enabled = false; - //textBoxLayer.Text = ""; - combCode.Items.Clear(); - combDeep.Items.Clear(); - combModelName.Items.Clear(); - globeControl1.Globe.Layers.Remove(layer); - FrmValiDataShowErrorMessage showErrorMessage = new FrmValiDataShowErrorMessage(dlg.FileName, txtMessage); - showErrorMessage.ShowDialog(); - return; - } - else - { - button3.Enabled = true; - //textBoxLayer.Text = dlg.FileName; - selectLayerName = layer.Caption; - txtLayerName.Text = layer.Caption; - GSOFeatures features = layer.GetAllFeatures(); - if (features.Length == 0) - return; - - combCode.Items.Clear(); - combDeep.Items.Clear(); - combModelName.Items.Clear(); - for (int i = 0; i < features[0].GetFieldCount(); i++) - { - GeoScene.Data.GSOFieldDefn fielddef = (GeoScene.Data.GSOFieldDefn)(features[0].GetFieldDefn(i)); - combCode.Items.Add(fielddef.Name); - combDeep.Items.Add(fielddef.Name); - combModelName.Items.Add(fielddef.Name); - //comboLoad.Items.Add(fielddef.Name); - } - combCode.SelectedItem = "管点编码"; - combDeep.SelectedItem = "Z坐标"; - combModelName.SelectedItem = "编号"; - } - } - } - + private void FrmAddYuBiZiShp_FormClosing(object sender, FormClosingEventArgs e) { globeControl1.Globe.Refresh(); diff --git a/FrmAllPipelineStatis.cs b/FrmAllPipelineStatis.cs index 6421a26..a6eea29 100644 --- a/FrmAllPipelineStatis.cs +++ b/FrmAllPipelineStatis.cs @@ -84,7 +84,7 @@ chartAllAreaPipeline.Series["管线"].Points.DataBindXY(pipelineLengthAndType.Keys, pipelineLengthAndType.Values); for (int m = 0; m < pipelineLengthAndType.Values.Count; m++) { - if (chartAllAreaPipeline.Series["管线"].Points[m].YValues[0].ToString() != "0") + if (chartAllAreaPipeline.Series["管线"].Points[m]!=null&&chartAllAreaPipeline.Series["管线"].Points[m].YValues[0].ToString() != "0") { chartAllAreaPipeline.Series["管线"].Points[m].Label = chartAllAreaPipeline.Series[0].Points[m].YValues[0].ToString(); } @@ -94,7 +94,7 @@ } catch (Exception ex) { - //LogError.PublishError(ex); + LogHelper.WriteLog(typeof(FrmAllPipelineStatis), ex.Message); } } @@ -147,7 +147,7 @@ } DataTable dt = OledbHelper.QueryTable(sql); - if (dt != null && dt.Rows.Count > 0) + if (dt != null && dt.Rows.Count > 0 && chartAllAreaPipeline.Series["管线"].Points[indexHit]!=null) { dataGridViewX1.DataSource = dt; panel.Visible = true; diff --git a/FrmAllWorkWellStatis.cs b/FrmAllWorkWellStatis.cs index 6fec7af..6af8e4c 100644 --- a/FrmAllWorkWellStatis.cs +++ b/FrmAllWorkWellStatis.cs @@ -52,7 +52,7 @@ chartAllAreaPipeline.Series["井盖"].Points.DataBindXY(workWellLengthAndType.Keys, workWellLengthAndType.Values); for (int m = 0; m < workWellLengthAndType.Values.Count; m++) { - if (chartAllAreaPipeline.Series["井盖"].Points[m].YValues[0].ToString().Trim() != "0") + if (chartAllAreaPipeline.Series["井盖"].Points[m]!=null&&chartAllAreaPipeline.Series["井盖"].Points[m].YValues[0].ToString().Trim() != "0") { chartAllAreaPipeline.Series["井盖"].Points[m].Label = chartAllAreaPipeline.Series[0].Points[m].YValues[0].ToString(); } @@ -60,7 +60,7 @@ } catch (Exception ex) { - //LogError.PublishError(ex); + LogHelper.WriteLog(typeof(FrmAllWorkWellStatis), ex.Message); } } diff --git a/FrmBSQDuoBianXingStatis.cs b/FrmBSQDuoBianXingStatis.cs index e8b7d52..3e889b6 100644 --- a/FrmBSQDuoBianXingStatis.cs +++ b/FrmBSQDuoBianXingStatis.cs @@ -60,7 +60,7 @@ { for (int m = 0; m < bsq1.Values.Count; m++) { - if (chart1.Series["标识器"].Points[m].YValues[0].ToString() != "0") + if (chart1.Series["标识器"].Points[m]!=null&&chart1.Series["标识器"].Points[m].YValues[0].ToString() != "0") { count += Convert.ToInt16(chart1.Series[0].Points[m].YValues[0].ToString()); chart1.Series["标识器"].Points[m].Label = chart1.Series[0].Points[m].YValues[0].ToString(); diff --git a/FrmBSQDuoBianXingStreet.cs b/FrmBSQDuoBianXingStreet.cs index 2005ebb..1db5777 100644 --- a/FrmBSQDuoBianXingStreet.cs +++ b/FrmBSQDuoBianXingStreet.cs @@ -63,7 +63,7 @@ chartStatis.Series[0].Points.DataBindXY(bsq.Keys, bsq.Values); for (int m = 0; m < bsq.Values.Count; m++) { - if (chartStatis.Series[0].Points[m].YValues[0].ToString().Trim() != "0") + if (chartStatis.Series[0].Points[m]!=null&&chartStatis.Series[0].Points[m].YValues[0].ToString().Trim() != "0") { count += Convert.ToInt16(chartStatis.Series[0].Points[m].YValues[0].ToString()); chartStatis.Series[0].Points[m].Label = chartStatis.Series[0].Points[m].YValues[0].ToString(); diff --git a/FrmBSQStatis.cs b/FrmBSQStatis.cs index 390a55c..4aa0ee6 100644 --- a/FrmBSQStatis.cs +++ b/FrmBSQStatis.cs @@ -95,6 +95,8 @@ } } } + + dr.Close(); conn.Close(); for (int i = 0; i < typeLists.Count; i++) { @@ -123,7 +125,7 @@ chartStatis.Series[0].Points.DataBindXY(bsq.Keys, bsq.Values); for (int m = 0; m < bsq.Values.Count; m++) { - if (chartStatis.Series[0].Points[m].YValues[0].ToString().Trim() != "0") + if (chartStatis.Series[0].Points[m]!=null&&chartStatis.Series[0].Points[m].YValues[0].ToString().Trim() != "0") { //count += Convert.ToInt16(chartStatis.Series[0].Points[m].YValues[0].ToString()); chartStatis.Series[0].Points[m].Label = chartStatis.Series[0].Points[m].YValues[0].ToString(); diff --git a/FrmBSQStreet.cs b/FrmBSQStreet.cs index 9d88adb..7fbacad 100644 --- a/FrmBSQStreet.cs +++ b/FrmBSQStreet.cs @@ -44,7 +44,7 @@ chartStatis.Series[0].Points.DataBindXY(bsq.Keys, bsq.Values); for (int m = 0; m < bsq.Values.Count; m++) { - if (chartStatis.Series[0].Points[m].YValues[0].ToString().Trim() != "0") + if (chartStatis.Series[0].Points[m]!=null&&chartStatis.Series[0].Points[m].YValues[0].ToString().Trim() != "0") { count += Convert.ToInt16(chartStatis.Series[0].Points[m].YValues[0].ToString()); chartStatis.Series[0].Points[m].Label = chartStatis.Series[0].Points[m].YValues[0].ToString(); diff --git a/FrmBoosterValvers.cs b/FrmBoosterValvers.cs index 5061efc..df9b62b 100644 --- a/FrmBoosterValvers.cs +++ b/FrmBoosterValvers.cs @@ -236,199 +236,6 @@ count = 0; } } - /// - /// 添加火苗 - /// - /// - /// - /// - /// - private GSOFeature AddFire(double x,double y,double z) - { - // 烟火示例 - - string strResPath = Application.StartupPath + "/Resource"; - - // 烟火粒子示例,由三个发射器构成 - GSOGeoParticle geoParticle = new GSOGeoParticle(); - geoParticle.SetPosition(x, y, z); // 添加到这个经纬度位置 - geoParticle.AltitudeMode = EnumAltitudeMode.RelativeToGround; - - GSORingParticleEmitter emitter = new GSORingParticleEmitter(); - emitter.TexturePath = strResPath + "/ParticleImage/flare.png"; - - emitter.SetSizeFix(1, 1); - emitter.VelFix = 1; - emitter.VelRnd = 5; - - emitter.AngleXYFix = 0; - emitter.AngleXYRnd = 180; - - emitter.AngleXZFix = 90; - emitter.AngleXZRnd = 0; - - emitter.LifeFix = 0.5f; - emitter.LifeRnd = 0.0f; - - emitter.RotFix = 0; - emitter.RotRnd = 0; - - emitter.RotVelFix = 0; - emitter.RotVelRnd = 0; - - emitter.EmitPerSec = 100; - - // 采用线性插值生成粒子的初始颜色 - emitter.ColorRndStart = Color.White; - emitter.ColorRndEnd = Color.Red; - - - GSOColorParticleEffector effector2 = new GSOColorParticleEffector(); - effector2.SetColorChanged(0, -1, -1, 0); - effector2.StartTime = 0.0f; - effector2.EndTime = -1.0f; - emitter.AddEffector(effector2); - - // 将三个发射器添加到粒子对象中 - geoParticle.AddEmitter(emitter); - - geoParticle.Play(); - - GSOFeature feature = new GSOFeature(); - - feature.Geometry = geoParticle; - - globeControl1.Globe.MemoryLayer.AddFeature(feature); - - - return feature; - } - - /// - /// 添加喷泉 - /// - /// - private GSOFeature AddFountain() - { - string strResPath = Application.StartupPath + "/Resource"; - - GSOGeoParticle geoParticle = new GSOGeoParticle(); - geoParticle.SetPosition(116.314, 39.84, 0); // 添加到这个经纬度位置 - - GSOPointParticleEmitter emitter = new GSOPointParticleEmitter(); - emitter.TexturePath = strResPath + "/ParticleImage/test.png"; - - emitter.SetSizeFix(0.5f, 2); - emitter.VelFix = 10; - emitter.VelRnd = 2; - - emitter.GravityAcc = 9.8f; - emitter.AngleXYFix = 0; - emitter.AngleXYRnd = 180; - - emitter.AngleXZFix = 88; - emitter.AngleXZRnd = 2; - - //emitter.InnerRadius = 0; - // emitter.OuterRadius = 0.03f; - - emitter.LifeFix = 5.0f; - emitter.LifeRnd = 1.0f; - - emitter.RotFix = 0; - emitter.RotRnd = 0; - - emitter.RotVelFix = 0; - emitter.RotVelRnd = 0; - - emitter.EmitPerSec = 1000; - emitter.ColorRndStart = Color.FromArgb(33, 255, 255, 255); - emitter.ColorRndEnd = Color.FromArgb(11, 255, 255, 255); - emitter.IsLumAdded = false; - - // 将三个发射器添加到粒子对象中 - geoParticle.AddEmitter(emitter); - - geoParticle.Play(); - GSOFeature feature = new GSOFeature(); - - feature.Geometry = geoParticle; - - //globeControl1.Globe.MemoryLayer.AddFeature(feature); - globeControl1.Globe.FlyToFeature(feature); - - return feature; - } - - /// - /// 添加水柱 - /// - /// - private GSOFeature AddWaterLine() - { - string strResPath = Application.StartupPath + "/Resource"; - - GSOGeoParticle geoParticle = new GSOGeoParticle(); - geoParticle.SetPosition(116.308, 39.84, 0); // 添加到这个经纬度位置 - - GSOPointParticleEmitter emitter = new GSOPointParticleEmitter(); - - emitter.TexturePath = strResPath + "/ParticleImage/drop3.png"; - - geoParticle.TimerInterval = 1; - - emitter.SetSizeFix(2.0f, 2.0f); - - emitter.VelFix = 50; - emitter.VelRnd = 2; - - // emitter.IsLumAdded = false; - - emitter.GravityAcc = 9.8f; - emitter.AngleXYFix = 0; - emitter.AngleXYRnd = 2; - - emitter.AngleXZFix = 60; - emitter.AngleXZRnd = 2; - - //emitter.InnerRadius = 0; - // emitter.OuterRadius = 0.1f; - - emitter.LifeFix = 5.0f; - emitter.LifeRnd = 1.0f; - - emitter.RotFix = 0; - emitter.RotRnd = 0; - - emitter.RotVelFix = 0; - emitter.RotVelRnd = 0; - - emitter.EmitPerSec = 1500; - - emitter.ColorRndStart = Color.FromArgb(100, 222, 222, 222); - emitter.ColorRndEnd = Color.FromArgb(50, 222, 222, 222); - - /* - - GSOScaleParticleEffector effector1 = new GSOScaleParticleEffector(); - effector1.SetScale(0.2f, 0.2f); - effector1.StartTime = 0; - effector1.EndTime = -1; // 负数表示整个粒子生命结束 - emitter.AddEffector(effector1); - */ - - // 将三个发射器添加到粒子对象中 - geoParticle.AddEmitter(emitter); - - geoParticle.Play(); - GSOFeature feature = new GSOFeature(); - - feature.Geometry = geoParticle; - - //globeControl1.Globe.MemoryLayer.AddFeature(feature); - globeControl1.Globe.FlyToFeature(feature); - - return feature; - } + } } diff --git a/FrmBufferAnalysis.cs b/FrmBufferAnalysis.cs index f711133..db8ca59 100644 --- a/FrmBufferAnalysis.cs +++ b/FrmBufferAnalysis.cs @@ -123,39 +123,6 @@ } } /// - /// 半径文本框的键盘按键按下事件处理 - /// - /// - /// - private void txtRadius_KeyPress(object sender, KeyPressEventArgs e) - { - TextBox text = sender as TextBox; - if ((e.KeyChar < 48 || e.KeyChar > 57) && (e.KeyChar != 8) && (int)e.KeyChar != 46) - { - e.Handled = true; - } - if ((int)e.KeyChar == 46) //小数点 - { - if (text.Text.Length <= 0) - e.Handled = true; //小数点不能在第一位 - else //处理不规则的小数点 - { - float f; - float oldf; - bool b1 = false, b2 = false; - b1 = float.TryParse(text.Text, out oldf); - b2 = float.TryParse(text.Text + e.KeyChar.ToString(), out f); - if (b2 == false) - { - if (b1 == true) - e.Handled = true; - else - e.Handled = false; - } - } - } - } - /// /// 窗体关闭事件处理 /// /// diff --git a/FrmBufferAnalysisBSQ.cs b/FrmBufferAnalysisBSQ.cs index 24a96ca..f54208f 100644 --- a/FrmBufferAnalysisBSQ.cs +++ b/FrmBufferAnalysisBSQ.cs @@ -137,35 +137,7 @@ } } - private void txtRadius_KeyPress(object sender, KeyPressEventArgs e) - { - TextBox text = sender as TextBox; - if ((e.KeyChar < 48 || e.KeyChar > 57) && (e.KeyChar != 8) && (int)e.KeyChar != 46) - { - e.Handled = true; - } - if ((int)e.KeyChar == 46) //小数点 - { - if (text.Text.Length <= 0) - e.Handled = true; //小数点不能在第一位 - else //处理不规则的小数点 - { - float f; - float oldf; - bool b1 = false, b2 = false; - b1 = float.TryParse(text.Text, out oldf); - b2 = float.TryParse(text.Text + e.KeyChar.ToString(), out f); - if (b2 == false) - { - if (b1 == true) - e.Handled = true; - else - e.Handled = false; - } - } - } - } - + private void FrmBufferAnalysis_FormClosing(object sender, FormClosingEventArgs e) { //Form1.y = 0; @@ -316,27 +288,6 @@ } } - private void FlyToMenu_Click(object sender, EventArgs e) - { - if (m_feature != null) - { - if (m_feature.Geometry != null && m_feature.Geometry.Type == EnumGeometryType.GeoPolyline3D) - { - GSOGeoPolyline3D line = m_feature.Geometry as GSOGeoPolyline3D; - double length = line.GetSpaceLength(true, 6378137); - GSOGeoPolyline3D lineLine = line.GetSegment(0, length / 2); - GSOPoint3d point3d = lineLine[lineLine.PartCount - 1][lineLine[lineLine.PartCount - 1].Count - 1]; - - globeControl1.Globe.FlyToPosition(point3d, EnumAltitudeMode.Absolute, 0, 45, 5); - } - else - { - globeControl1.Globe.FlyToFeature(m_feature, 0, 45, 3); - } - LightMenu_Click(sender, e); - } - } - private void LightMenu_Click(object sender, EventArgs e) { flashflag = "single"; diff --git a/FrmDataBaseOpt.cs b/FrmDataBaseOpt.cs index b0c4b5d..8d7b69d 100644 --- a/FrmDataBaseOpt.cs +++ b/FrmDataBaseOpt.cs @@ -362,6 +362,7 @@ dbCombor.Items.Add(dblist[i].title); } } + /* /// /// 从配置文件读取数据库参数配置 /// @@ -428,6 +429,8 @@ } } + * */ + /* /// /// 向配置文件写入连接数据库的参数配置 /// @@ -485,6 +488,7 @@ MessageBox.Show(exp.ToString()); } } + * */ /// /// /// diff --git a/FrmDatabaseParaSetting.cs b/FrmDatabaseParaSetting.cs index a6fea46..63b596b 100644 --- a/FrmDatabaseParaSetting.cs +++ b/FrmDatabaseParaSetting.cs @@ -152,6 +152,7 @@ this.DialogResult = DialogResult.OK; this.Close(); } + /* /// /// 从配置文件读取数据库连接参数配置 /// @@ -218,6 +219,8 @@ } } + * */ + /* /// /// 向配置文件写入数据库参数配置 /// @@ -276,7 +279,7 @@ MessageBox.Show(ex.ToString()); } } - + */ /// /// 取消按钮事件处理 /// diff --git a/Cyberpipe.csproj b/Cyberpipe.csproj index 07a8c1a..e3cd12c 100644 --- a/Cyberpipe.csproj +++ b/Cyberpipe.csproj @@ -204,25 +204,6 @@ - - Form - - - F_GKT1数据输入输出.cs - - - Form - - - F_GKT1添加文件.cs - - - Form - - - F_GKT1添加项目.cs - - Form @@ -1068,18 +1049,6 @@ Frm_password_reset.cs - - Form - - - GKT.cs - - - Form - - - GKT1.cs - Form @@ -1258,12 +1227,6 @@ F_Projedit.cs - - Form - - - PED.cs - Form @@ -1331,16 +1294,6 @@ True Reference.map - - F_GKT1数据输入输出.cs - Designer - - - F_GKT1添加文件.cs - - - F_GKT1添加项目.cs - Form_EditTask.cs @@ -1836,12 +1789,6 @@ Frm_password_reset.cs - - GKT.cs - - - GKT1.cs - F_GKT数据输入输出.cs @@ -1934,9 +1881,6 @@ F_Projedit.cs - - PED.cs - F_数据输入输出.cs diff --git a/Cyberpipe.suo b/Cyberpipe.suo index 68ced4f..a1aecf8 100644 --- a/Cyberpipe.suo +++ b/Cyberpipe.suo Binary files differ diff --git a/EMS_Forms/Form_EditTask.cs b/EMS_Forms/Form_EditTask.cs index 718992f..f1d791f 100644 --- a/EMS_Forms/Form_EditTask.cs +++ b/EMS_Forms/Form_EditTask.cs @@ -119,7 +119,8 @@ String name = Convert.ToString(dr["USERNAME"]); comboBox_userName.Items.Add(name); - } + } + dr.Close(); comboBox_road.Items.Clear(); roadList = new List(); @@ -135,7 +136,7 @@ comboBox_road.Items.Add(name); } } - + dr1.Close(); conn.Close(); bool flag2 = false; @@ -185,7 +186,7 @@ catch (Exception ex) { - MessageBox.Show(ex.ToString()); + LogHelper.WriteLog(typeof(Form_EditTask), ex.Message); } } @@ -288,7 +289,7 @@ } catch (Exception ex) { - MessageBox.Show(ex.ToString()); + LogHelper.WriteLog(typeof(Form_EditTask), ex.Message); } } @@ -474,7 +475,7 @@ } catch (Exception ex) { - MessageBox.Show(ex.ToString()); + LogHelper.WriteLog(typeof(Form_EditTask), ex.Message); } this.Close(); @@ -495,6 +496,7 @@ { numList.Add(Convert.ToInt32(dr["DBID"])); } + dr.Close(); if (numList.Count == 0) { taskNumber = Convert.ToInt32(number) * 100; @@ -674,6 +676,7 @@ } } } + dr.Close(); conn.Close(); } diff --git a/EMS_Forms/Form_EventManager.cs b/EMS_Forms/Form_EventManager.cs index b18c45b..84807b2 100644 --- a/EMS_Forms/Form_EventManager.cs +++ b/EMS_Forms/Form_EventManager.cs @@ -64,6 +64,7 @@ comboBox_name.Items.Add(name); } + dr.Close(); conn.Close(); diff --git a/Forms/FrmMnModify.cs b/Forms/FrmMnModify.cs index 31cfc5f..d036360 100644 --- a/Forms/FrmMnModify.cs +++ b/Forms/FrmMnModify.cs @@ -68,15 +68,7 @@ questionGrid.Rows[idx].Cells[1].Value = sr.question; } } - /// 选中对象 - /// - /// - /// - /// - private void buttonX1_Click(object sender, EventArgs e) - { - globecontrol.Globe.Action = EnumAction3D.SelectObject; - } + /// /// 选中某一行 /// diff --git a/Forms/FrmPipelineModelDataBase.cs b/Forms/FrmPipelineModelDataBase.cs index 2acf0ca..7ce573f 100644 --- a/Forms/FrmPipelineModelDataBase.cs +++ b/Forms/FrmPipelineModelDataBase.cs @@ -35,19 +35,7 @@ ds = _ds; InitializeComponent(); } - /// - /// 单击选择shp格式文件 - /// - /// - /// - private void btnBrowseModel_Click(object sender, EventArgs e) - { - saveFileDialog1.Filter = "*.lgd|*.lgd"; - if (saveFileDialog1.ShowDialog() == DialogResult.OK) - { - txtModelLayer.Text = saveFileDialog1.FileName; - } - } + /// /// 窗体初始化事件处理 /// @@ -100,49 +88,6 @@ } } } - - private object convertFieldValue(string fieldname, object obj) - { - if (obj == null) - return null; - - try - { - string type = fields_types[fieldname].ToString(); - switch (type) - { - case "string": - return obj.ToString(); - case "int": - //return 101; - int intResult; - if (int.TryParse(obj.ToString(), out intResult)) - return intResult; - else - return null; - case "double": - //return 202.5; - double doubleResult; - if (double.TryParse(obj.ToString(), out doubleResult)) - return doubleResult; - else - return null; - case "date": - DateTime dtResult; - if (DateTime.TryParse(obj.ToString(), out dtResult)) - return dtResult; - else - return null; - } - return null; - } - catch (Exception ex) - { - MessageBox.Show(ex.ToString()); - return null; - } - } - public string lgdFilePath = ""; /// /// 选择管线颜色 @@ -610,33 +555,6 @@ { this.Close(); } - - private void cmbLayer_SelectedIndexChanged(object sender, EventArgs e) //选择图层 - { - GSOLayer layer = ctl.Globe.Layers.GetLayerByCaption(selectLayerName); - GSOFeatures features = layer.GetAllFeatures(); - if (features.Length == 0) - return; - - cmbFrom.Items.Clear(); - cmbTo.Items.Clear(); - cmbRadius.Items.Clear(); - cmbID.Items.Clear(); - for (int i = 0; i < features[0].GetFieldCount(); i++) - { - GeoScene.Data.GSOFieldDefn fielddef = (GeoScene.Data.GSOFieldDefn)(features[0].GetFieldDefn(i)); - - cmbFrom.Items.Add(fielddef.Name); - cmbTo.Items.Add(fielddef.Name); - cmbRadius.Items.Add(fielddef.Name); - cmbID.Items.Add(fielddef.Name); - } - cmbFrom.SelectedItem = "Deep1"; - cmbTo.SelectedItem = "Deep2"; - cmbRadius.SelectedItem = "Diameter"; - cmbID.SelectedItem = "Handle"; - } - private void buttonXLayerPath_Click(object sender, EventArgs e)//单击 选择shp格式的文件 { OpenFileDialog dlg = new OpenFileDialog(); diff --git a/Forms/FrmPipelineModelDataOneStep.cs b/Forms/FrmPipelineModelDataOneStep.cs index 18afda7..ec93b8a 100644 --- a/Forms/FrmPipelineModelDataOneStep.cs +++ b/Forms/FrmPipelineModelDataOneStep.cs @@ -38,19 +38,7 @@ layerTree = _layerTree; InitializeComponent(); } - /// - /// 单击选择shp格式文件 - /// - /// - /// - private void btnBrowseModel_Click(object sender, EventArgs e) - { - saveFileDialog1.Filter = "*.lgd|*.lgd"; - if (saveFileDialog1.ShowDialog() == DialogResult.OK) - { - txtModelLayer.Text = saveFileDialog1.FileName; - } - } + /// /// 窗体初始化事件处理 /// @@ -107,48 +95,7 @@ } } - private object convertFieldValue(string fieldname, object obj) - { - if (obj == null) - return null; - - try - { - string type = fields_types[fieldname].ToString(); - switch (type) - { - case "string": - return obj.ToString(); - case "int": - //return 101; - int intResult; - if (int.TryParse(obj.ToString(), out intResult)) - return intResult; - else - return null; - case "double": - //return 202.5; - double doubleResult; - if (double.TryParse(obj.ToString(), out doubleResult)) - return doubleResult; - else - return null; - case "date": - DateTime dtResult; - if (DateTime.TryParse(obj.ToString(), out dtResult)) - return dtResult; - else - return null; - } - return null; - } - catch (Exception ex) - { - MessageBox.Show(ex.ToString()); - return null; - } - } - + public string lgdFilePath = ""; /// /// 选择管线颜色 @@ -673,32 +620,6 @@ return featDs; } - private void cmbLayer_SelectedIndexChanged(object sender, EventArgs e) //选择图层 - { - GSOLayer layer = ctl.Globe.Layers.GetLayerByCaption(selectLayerName); - GSOFeatures features = layer.GetAllFeatures(); - if (features.Length == 0) - return; - - cmbFrom.Items.Clear(); - cmbTo.Items.Clear(); - cmbRadius.Items.Clear(); - cmbID.Items.Clear(); - for (int i = 0; i < features[0].GetFieldCount(); i++) - { - GeoScene.Data.GSOFieldDefn fielddef = (GeoScene.Data.GSOFieldDefn)(features[0].GetFieldDefn(i)); - - cmbFrom.Items.Add(fielddef.Name); - cmbTo.Items.Add(fielddef.Name); - cmbRadius.Items.Add(fielddef.Name); - cmbID.Items.Add(fielddef.Name); - } - cmbFrom.SelectedItem = "Deep1"; - cmbTo.SelectedItem = "Deep2"; - cmbRadius.SelectedItem = "Diameter"; - cmbID.SelectedItem = "Handle"; - } - private void buttonXLayerPath_Click(object sender, EventArgs e)//单击 选择shp格式的文件 { OpenFileDialog dlg = new OpenFileDialog(); @@ -949,38 +870,6 @@ } //txtLayername.Text = type + layername; } - /// - /// 连接数据库 - /// - /// - /// - private void buttonX1_Click(object sender, EventArgs e) - { - if (ds == null) - { - //没连的话,直接连接审核库; //审核库配置读配置文件 - string dbIp = Utility.sgdbip; - string database = Utility.sgdbname; - string user = Utility.sgdbuser; - string pass = Utility.sgdbpwd; - - if (!Utility.isNetworkConnectionSuccess(dbIp.Trim())) - { - MessageBox.Show("网络连接失败!", "提示"); - return; - } - - ds = ctl.Globe.DataManager.OpenOracleDataSource(dbIp + "/" + database, "", "", user, pass); - if (ds == null) - { - MessageBox.Show("数据库连接失败!", "提示", MessageBoxButtons.OK, MessageBoxIcon.Warning); - } - else - { - btnCreateModel.Enabled = true; - } - } - } private void btnClose_Click(object sender, EventArgs e) { diff --git a/Forms/FrmShRK.cs b/Forms/FrmShRK.cs index 0e2e722..f1d83cb 100644 --- a/Forms/FrmShRK.cs +++ b/Forms/FrmShRK.cs @@ -215,6 +215,7 @@ { sourcefeatds = sourcefeat as GSOFeatureDataset; } + if (sourcefeatds == null) return; sourcefeatds.Open(); GSOFeatures sourcefeatures = sourcefeatds.GetAllFeatures(); @@ -251,6 +252,7 @@ { desfeatds = desfeat as GSOFeatureDataset; } + if (desfeatds == null) return; desfeatds.Open(); //向新数据集写入字段 diff --git a/FrmAccessoriesSensor.cs b/FrmAccessoriesSensor.cs index 09fcdf1..2a7a80e 100644 --- a/FrmAccessoriesSensor.cs +++ b/FrmAccessoriesSensor.cs @@ -209,7 +209,7 @@ chart1.Series[0].Points.DataBindXY(dic.Keys, dic.Values); for (int m = 0; m < dic.Values.Count; m++) { - if (chart1.Series[0].Points[m].YValues[0].ToString() != "0") + if (chart1.Series[0].Points[m]!=null&&chart1.Series[0].Points[m].YValues[0].ToString() != "0") { chart1.Series[0].Points[m].Label = chart1.Series[0].Points[m].YValues[0].ToString(); } diff --git a/FrmAccessoriesgather.cs b/FrmAccessoriesgather.cs index 9e331e1..a475d9e 100644 --- a/FrmAccessoriesgather.cs +++ b/FrmAccessoriesgather.cs @@ -338,7 +338,7 @@ chart1.Series[0].Points.DataBindXY(dic.Keys, dic.Values); for (int m = 0; m < dic.Values.Count; m++) { - if (chart1.Series[0].Points[m].YValues[0].ToString() != "0") + if (chart1.Series[0].Points[m]!=null&&chart1.Series[0].Points[m].YValues[0].ToString() != "0") { chart1.Series[0].Points[m].Label = chart1.Series[0].Points[m].YValues[0].ToString(); } diff --git a/FrmAccessoryAnalysis.cs b/FrmAccessoryAnalysis.cs index 71d4579..44d4065 100644 --- a/FrmAccessoryAnalysis.cs +++ b/FrmAccessoryAnalysis.cs @@ -66,39 +66,6 @@ globeControl1.Refresh(); } /// - /// 键盘按键按下事件处理 - /// - /// - /// - private void txtRadius_KeyPress(object sender, KeyPressEventArgs e) - { - TextBox text = sender as TextBox; - if ((e.KeyChar < 48 || e.KeyChar > 57) && (e.KeyChar != 8) && (int)e.KeyChar != 46) - { - e.Handled = true; - } - if ((int)e.KeyChar == 46) //小数点 - { - if (text.Text.Length <= 0) - e.Handled = true; //小数点不能在第一位 - else //处理不规则的小数点 - { - float f; - float oldf; - bool b1 = false, b2 = false; - b1 = float.TryParse(text.Text, out oldf); - b2 = float.TryParse(text.Text + e.KeyChar.ToString(), out f); - if (b2 == false) - { - if (b1 == true) - e.Handled = true; - else - e.Handled = false; - } - } - } - } - /// /// 确定按钮事件处理 /// /// diff --git a/FrmAddValve.cs b/FrmAddValve.cs index 34d2fec..5f405b9 100644 --- a/FrmAddValve.cs +++ b/FrmAddValve.cs @@ -486,56 +486,6 @@ } } - - - - - - - - private void cmbLayer_SelectedIndexChanged(object sender, EventArgs e) - { - GSOLayer layer = globeControl1.Globe.Layers.GetLayerByCaption(selectLayerName); - GSOFeatures features = layer.GetAllFeatures(); - if (features.Length == 0) - return; - - combPath.Items.Clear(); - combZ.Items.Clear(); - combModelName.Items.Clear(); - - for (int i = 0; i < features[0].GetFieldCount(); i++) - { - GeoScene.Data.GSOFieldDefn fielddef = (GeoScene.Data.GSOFieldDefn)(features[0].GetFieldDefn(i)); - combPath.Items.Add(fielddef.Name); - combZ.Items.Add(fielddef.Name); - combModelName.Items.Add(fielddef.Name); - } - combModelName.SelectedItem = "编号"; - combPath.SelectedItem = "模型路径"; - if (combfile.SelectedIndex != -1) - { - - string layerCaption = combfile.SelectedItem.ToString().Trim(); - rukuLayer = globeControl1.Globe.Layers.GetLayerByCaption(layerCaption); - if (rukuLayer != null) - { - combPath.Items.Clear(); - combZ.Items.Clear(); - combModelName.Items.Clear(); - - } - for (int i = 0; i < features[0].GetFieldCount(); i++) - { - GeoScene.Data.GSOFieldDefn fielddef = (GeoScene.Data.GSOFieldDefn)(features[0].GetFieldDefn(i)); - combPath.Items.Add(fielddef.Name); - combZ.Items.Add(fielddef.Name); - combModelName.Items.Add(fielddef.Name); - } - combModelName.SelectedItem = "编号"; - combPath.SelectedItem = "模型路径"; - } - } /// /// 单击选择shp格式文件 /// diff --git a/FrmAddWellShp.cs b/FrmAddWellShp.cs index bb79ec0..a249725 100644 --- a/FrmAddWellShp.cs +++ b/FrmAddWellShp.cs @@ -478,32 +478,6 @@ } } } - - private void cmbLayer_SelectedIndexChanged(object sender, EventArgs e) - { - GSOLayer layer = globeControl1.Globe.Layers.GetLayerByCaption(selectLayerName); - GSOFeatures features = layer.GetAllFeatures(); - if (features.Length == 0) - return; - - combCode.Items.Clear(); - combDeep.Items.Clear(); - combModelName.Items.Clear(); - combAngle.Items.Clear(); - - for (int i = 0; i < features[0].GetFieldCount(); i++) - { - GeoScene.Data.GSOFieldDefn fielddef = (GeoScene.Data.GSOFieldDefn)(features[0].GetFieldDefn(i)); - combCode.Items.Add(fielddef.Name); - combDeep.Items.Add(fielddef.Name); - combModelName.Items.Add(fielddef.Name); - combAngle.Items.Add(fielddef.Name); - } - combCode.SelectedItem = "附属物编码"; - combDeep.SelectedItem = "井深"; - combModelName.SelectedItem = "编号"; - combAngle.SelectedItem = "符号角度"; - } /// /// 单击选择shp格式文件 /// diff --git a/FrmAddYuBiZiShp.cs b/FrmAddYuBiZiShp.cs index b312d51..332f037 100644 --- a/FrmAddYuBiZiShp.cs +++ b/FrmAddYuBiZiShp.cs @@ -383,80 +383,7 @@ } } - private void cmbLayer_SelectedIndexChanged(object sender, EventArgs e) - { - GSOLayer layer = globeControl1.Globe.Layers.GetLayerByCaption(selectLayerName); - GSOFeatures features = layer.GetAllFeatures(); - if (features.Length == 0) - return; - - combCode.Items.Clear(); - combDeep.Items.Clear(); - combModelName.Items.Clear(); - //comboLoad.Items.Clear(); - for (int i = 0; i < features[0].GetFieldCount(); i++) - { - GeoScene.Data.GSOFieldDefn fielddef = (GeoScene.Data.GSOFieldDefn)(features[0].GetFieldDefn(i)); - combCode.Items.Add(fielddef.Name); - combDeep.Items.Add(fielddef.Name); - combModelName.Items.Add(fielddef.Name); - //comboLoad.Items.Add(fielddef.Name); - } - combCode.SelectedItem = "附属物编码"; - combDeep.SelectedItem = "Z坐标"; - combModelName.SelectedItem = "编号"; - //comboLoad.SelectedItem = "模型路径"; - } - - private void buttonXLayerPath_Click(object sender, EventArgs e) - { - OpenFileDialog dlg = new OpenFileDialog(); - dlg.Filter = "*.shp|*.shp"; - dlg.Multiselect = false; - if (dlg.ShowDialog() == DialogResult.OK) - { - GSOLayer layer = globeControl1.Globe.Layers.Add(dlg.FileName); - string txtMessage = valiYBdata(layer); - if (txtMessage != "") - { - button3.Enabled = false; - //textBoxLayer.Text = ""; - combCode.Items.Clear(); - combDeep.Items.Clear(); - combModelName.Items.Clear(); - globeControl1.Globe.Layers.Remove(layer); - FrmValiDataShowErrorMessage showErrorMessage = new FrmValiDataShowErrorMessage(dlg.FileName, txtMessage); - showErrorMessage.ShowDialog(); - return; - } - else - { - button3.Enabled = true; - //textBoxLayer.Text = dlg.FileName; - selectLayerName = layer.Caption; - txtLayerName.Text = layer.Caption; - GSOFeatures features = layer.GetAllFeatures(); - if (features.Length == 0) - return; - - combCode.Items.Clear(); - combDeep.Items.Clear(); - combModelName.Items.Clear(); - for (int i = 0; i < features[0].GetFieldCount(); i++) - { - GeoScene.Data.GSOFieldDefn fielddef = (GeoScene.Data.GSOFieldDefn)(features[0].GetFieldDefn(i)); - combCode.Items.Add(fielddef.Name); - combDeep.Items.Add(fielddef.Name); - combModelName.Items.Add(fielddef.Name); - //comboLoad.Items.Add(fielddef.Name); - } - combCode.SelectedItem = "管点编码"; - combDeep.SelectedItem = "Z坐标"; - combModelName.SelectedItem = "编号"; - } - } - } - + private void FrmAddYuBiZiShp_FormClosing(object sender, FormClosingEventArgs e) { globeControl1.Globe.Refresh(); diff --git a/FrmAllPipelineStatis.cs b/FrmAllPipelineStatis.cs index 6421a26..a6eea29 100644 --- a/FrmAllPipelineStatis.cs +++ b/FrmAllPipelineStatis.cs @@ -84,7 +84,7 @@ chartAllAreaPipeline.Series["管线"].Points.DataBindXY(pipelineLengthAndType.Keys, pipelineLengthAndType.Values); for (int m = 0; m < pipelineLengthAndType.Values.Count; m++) { - if (chartAllAreaPipeline.Series["管线"].Points[m].YValues[0].ToString() != "0") + if (chartAllAreaPipeline.Series["管线"].Points[m]!=null&&chartAllAreaPipeline.Series["管线"].Points[m].YValues[0].ToString() != "0") { chartAllAreaPipeline.Series["管线"].Points[m].Label = chartAllAreaPipeline.Series[0].Points[m].YValues[0].ToString(); } @@ -94,7 +94,7 @@ } catch (Exception ex) { - //LogError.PublishError(ex); + LogHelper.WriteLog(typeof(FrmAllPipelineStatis), ex.Message); } } @@ -147,7 +147,7 @@ } DataTable dt = OledbHelper.QueryTable(sql); - if (dt != null && dt.Rows.Count > 0) + if (dt != null && dt.Rows.Count > 0 && chartAllAreaPipeline.Series["管线"].Points[indexHit]!=null) { dataGridViewX1.DataSource = dt; panel.Visible = true; diff --git a/FrmAllWorkWellStatis.cs b/FrmAllWorkWellStatis.cs index 6fec7af..6af8e4c 100644 --- a/FrmAllWorkWellStatis.cs +++ b/FrmAllWorkWellStatis.cs @@ -52,7 +52,7 @@ chartAllAreaPipeline.Series["井盖"].Points.DataBindXY(workWellLengthAndType.Keys, workWellLengthAndType.Values); for (int m = 0; m < workWellLengthAndType.Values.Count; m++) { - if (chartAllAreaPipeline.Series["井盖"].Points[m].YValues[0].ToString().Trim() != "0") + if (chartAllAreaPipeline.Series["井盖"].Points[m]!=null&&chartAllAreaPipeline.Series["井盖"].Points[m].YValues[0].ToString().Trim() != "0") { chartAllAreaPipeline.Series["井盖"].Points[m].Label = chartAllAreaPipeline.Series[0].Points[m].YValues[0].ToString(); } @@ -60,7 +60,7 @@ } catch (Exception ex) { - //LogError.PublishError(ex); + LogHelper.WriteLog(typeof(FrmAllWorkWellStatis), ex.Message); } } diff --git a/FrmBSQDuoBianXingStatis.cs b/FrmBSQDuoBianXingStatis.cs index e8b7d52..3e889b6 100644 --- a/FrmBSQDuoBianXingStatis.cs +++ b/FrmBSQDuoBianXingStatis.cs @@ -60,7 +60,7 @@ { for (int m = 0; m < bsq1.Values.Count; m++) { - if (chart1.Series["标识器"].Points[m].YValues[0].ToString() != "0") + if (chart1.Series["标识器"].Points[m]!=null&&chart1.Series["标识器"].Points[m].YValues[0].ToString() != "0") { count += Convert.ToInt16(chart1.Series[0].Points[m].YValues[0].ToString()); chart1.Series["标识器"].Points[m].Label = chart1.Series[0].Points[m].YValues[0].ToString(); diff --git a/FrmBSQDuoBianXingStreet.cs b/FrmBSQDuoBianXingStreet.cs index 2005ebb..1db5777 100644 --- a/FrmBSQDuoBianXingStreet.cs +++ b/FrmBSQDuoBianXingStreet.cs @@ -63,7 +63,7 @@ chartStatis.Series[0].Points.DataBindXY(bsq.Keys, bsq.Values); for (int m = 0; m < bsq.Values.Count; m++) { - if (chartStatis.Series[0].Points[m].YValues[0].ToString().Trim() != "0") + if (chartStatis.Series[0].Points[m]!=null&&chartStatis.Series[0].Points[m].YValues[0].ToString().Trim() != "0") { count += Convert.ToInt16(chartStatis.Series[0].Points[m].YValues[0].ToString()); chartStatis.Series[0].Points[m].Label = chartStatis.Series[0].Points[m].YValues[0].ToString(); diff --git a/FrmBSQStatis.cs b/FrmBSQStatis.cs index 390a55c..4aa0ee6 100644 --- a/FrmBSQStatis.cs +++ b/FrmBSQStatis.cs @@ -95,6 +95,8 @@ } } } + + dr.Close(); conn.Close(); for (int i = 0; i < typeLists.Count; i++) { @@ -123,7 +125,7 @@ chartStatis.Series[0].Points.DataBindXY(bsq.Keys, bsq.Values); for (int m = 0; m < bsq.Values.Count; m++) { - if (chartStatis.Series[0].Points[m].YValues[0].ToString().Trim() != "0") + if (chartStatis.Series[0].Points[m]!=null&&chartStatis.Series[0].Points[m].YValues[0].ToString().Trim() != "0") { //count += Convert.ToInt16(chartStatis.Series[0].Points[m].YValues[0].ToString()); chartStatis.Series[0].Points[m].Label = chartStatis.Series[0].Points[m].YValues[0].ToString(); diff --git a/FrmBSQStreet.cs b/FrmBSQStreet.cs index 9d88adb..7fbacad 100644 --- a/FrmBSQStreet.cs +++ b/FrmBSQStreet.cs @@ -44,7 +44,7 @@ chartStatis.Series[0].Points.DataBindXY(bsq.Keys, bsq.Values); for (int m = 0; m < bsq.Values.Count; m++) { - if (chartStatis.Series[0].Points[m].YValues[0].ToString().Trim() != "0") + if (chartStatis.Series[0].Points[m]!=null&&chartStatis.Series[0].Points[m].YValues[0].ToString().Trim() != "0") { count += Convert.ToInt16(chartStatis.Series[0].Points[m].YValues[0].ToString()); chartStatis.Series[0].Points[m].Label = chartStatis.Series[0].Points[m].YValues[0].ToString(); diff --git a/FrmBoosterValvers.cs b/FrmBoosterValvers.cs index 5061efc..df9b62b 100644 --- a/FrmBoosterValvers.cs +++ b/FrmBoosterValvers.cs @@ -236,199 +236,6 @@ count = 0; } } - /// - /// 添加火苗 - /// - /// - /// - /// - /// - private GSOFeature AddFire(double x,double y,double z) - { - // 烟火示例 - - string strResPath = Application.StartupPath + "/Resource"; - - // 烟火粒子示例,由三个发射器构成 - GSOGeoParticle geoParticle = new GSOGeoParticle(); - geoParticle.SetPosition(x, y, z); // 添加到这个经纬度位置 - geoParticle.AltitudeMode = EnumAltitudeMode.RelativeToGround; - - GSORingParticleEmitter emitter = new GSORingParticleEmitter(); - emitter.TexturePath = strResPath + "/ParticleImage/flare.png"; - - emitter.SetSizeFix(1, 1); - emitter.VelFix = 1; - emitter.VelRnd = 5; - - emitter.AngleXYFix = 0; - emitter.AngleXYRnd = 180; - - emitter.AngleXZFix = 90; - emitter.AngleXZRnd = 0; - - emitter.LifeFix = 0.5f; - emitter.LifeRnd = 0.0f; - - emitter.RotFix = 0; - emitter.RotRnd = 0; - - emitter.RotVelFix = 0; - emitter.RotVelRnd = 0; - - emitter.EmitPerSec = 100; - - // 采用线性插值生成粒子的初始颜色 - emitter.ColorRndStart = Color.White; - emitter.ColorRndEnd = Color.Red; - - - GSOColorParticleEffector effector2 = new GSOColorParticleEffector(); - effector2.SetColorChanged(0, -1, -1, 0); - effector2.StartTime = 0.0f; - effector2.EndTime = -1.0f; - emitter.AddEffector(effector2); - - // 将三个发射器添加到粒子对象中 - geoParticle.AddEmitter(emitter); - - geoParticle.Play(); - - GSOFeature feature = new GSOFeature(); - - feature.Geometry = geoParticle; - - globeControl1.Globe.MemoryLayer.AddFeature(feature); - - - return feature; - } - - /// - /// 添加喷泉 - /// - /// - private GSOFeature AddFountain() - { - string strResPath = Application.StartupPath + "/Resource"; - - GSOGeoParticle geoParticle = new GSOGeoParticle(); - geoParticle.SetPosition(116.314, 39.84, 0); // 添加到这个经纬度位置 - - GSOPointParticleEmitter emitter = new GSOPointParticleEmitter(); - emitter.TexturePath = strResPath + "/ParticleImage/test.png"; - - emitter.SetSizeFix(0.5f, 2); - emitter.VelFix = 10; - emitter.VelRnd = 2; - - emitter.GravityAcc = 9.8f; - emitter.AngleXYFix = 0; - emitter.AngleXYRnd = 180; - - emitter.AngleXZFix = 88; - emitter.AngleXZRnd = 2; - - //emitter.InnerRadius = 0; - // emitter.OuterRadius = 0.03f; - - emitter.LifeFix = 5.0f; - emitter.LifeRnd = 1.0f; - - emitter.RotFix = 0; - emitter.RotRnd = 0; - - emitter.RotVelFix = 0; - emitter.RotVelRnd = 0; - - emitter.EmitPerSec = 1000; - emitter.ColorRndStart = Color.FromArgb(33, 255, 255, 255); - emitter.ColorRndEnd = Color.FromArgb(11, 255, 255, 255); - emitter.IsLumAdded = false; - - // 将三个发射器添加到粒子对象中 - geoParticle.AddEmitter(emitter); - - geoParticle.Play(); - GSOFeature feature = new GSOFeature(); - - feature.Geometry = geoParticle; - - //globeControl1.Globe.MemoryLayer.AddFeature(feature); - globeControl1.Globe.FlyToFeature(feature); - - return feature; - } - - /// - /// 添加水柱 - /// - /// - private GSOFeature AddWaterLine() - { - string strResPath = Application.StartupPath + "/Resource"; - - GSOGeoParticle geoParticle = new GSOGeoParticle(); - geoParticle.SetPosition(116.308, 39.84, 0); // 添加到这个经纬度位置 - - GSOPointParticleEmitter emitter = new GSOPointParticleEmitter(); - - emitter.TexturePath = strResPath + "/ParticleImage/drop3.png"; - - geoParticle.TimerInterval = 1; - - emitter.SetSizeFix(2.0f, 2.0f); - - emitter.VelFix = 50; - emitter.VelRnd = 2; - - // emitter.IsLumAdded = false; - - emitter.GravityAcc = 9.8f; - emitter.AngleXYFix = 0; - emitter.AngleXYRnd = 2; - - emitter.AngleXZFix = 60; - emitter.AngleXZRnd = 2; - - //emitter.InnerRadius = 0; - // emitter.OuterRadius = 0.1f; - - emitter.LifeFix = 5.0f; - emitter.LifeRnd = 1.0f; - - emitter.RotFix = 0; - emitter.RotRnd = 0; - - emitter.RotVelFix = 0; - emitter.RotVelRnd = 0; - - emitter.EmitPerSec = 1500; - - emitter.ColorRndStart = Color.FromArgb(100, 222, 222, 222); - emitter.ColorRndEnd = Color.FromArgb(50, 222, 222, 222); - - /* - - GSOScaleParticleEffector effector1 = new GSOScaleParticleEffector(); - effector1.SetScale(0.2f, 0.2f); - effector1.StartTime = 0; - effector1.EndTime = -1; // 负数表示整个粒子生命结束 - emitter.AddEffector(effector1); - */ - - // 将三个发射器添加到粒子对象中 - geoParticle.AddEmitter(emitter); - - geoParticle.Play(); - GSOFeature feature = new GSOFeature(); - - feature.Geometry = geoParticle; - - //globeControl1.Globe.MemoryLayer.AddFeature(feature); - globeControl1.Globe.FlyToFeature(feature); - - return feature; - } + } } diff --git a/FrmBufferAnalysis.cs b/FrmBufferAnalysis.cs index f711133..db8ca59 100644 --- a/FrmBufferAnalysis.cs +++ b/FrmBufferAnalysis.cs @@ -123,39 +123,6 @@ } } /// - /// 半径文本框的键盘按键按下事件处理 - /// - /// - /// - private void txtRadius_KeyPress(object sender, KeyPressEventArgs e) - { - TextBox text = sender as TextBox; - if ((e.KeyChar < 48 || e.KeyChar > 57) && (e.KeyChar != 8) && (int)e.KeyChar != 46) - { - e.Handled = true; - } - if ((int)e.KeyChar == 46) //小数点 - { - if (text.Text.Length <= 0) - e.Handled = true; //小数点不能在第一位 - else //处理不规则的小数点 - { - float f; - float oldf; - bool b1 = false, b2 = false; - b1 = float.TryParse(text.Text, out oldf); - b2 = float.TryParse(text.Text + e.KeyChar.ToString(), out f); - if (b2 == false) - { - if (b1 == true) - e.Handled = true; - else - e.Handled = false; - } - } - } - } - /// /// 窗体关闭事件处理 /// /// diff --git a/FrmBufferAnalysisBSQ.cs b/FrmBufferAnalysisBSQ.cs index 24a96ca..f54208f 100644 --- a/FrmBufferAnalysisBSQ.cs +++ b/FrmBufferAnalysisBSQ.cs @@ -137,35 +137,7 @@ } } - private void txtRadius_KeyPress(object sender, KeyPressEventArgs e) - { - TextBox text = sender as TextBox; - if ((e.KeyChar < 48 || e.KeyChar > 57) && (e.KeyChar != 8) && (int)e.KeyChar != 46) - { - e.Handled = true; - } - if ((int)e.KeyChar == 46) //小数点 - { - if (text.Text.Length <= 0) - e.Handled = true; //小数点不能在第一位 - else //处理不规则的小数点 - { - float f; - float oldf; - bool b1 = false, b2 = false; - b1 = float.TryParse(text.Text, out oldf); - b2 = float.TryParse(text.Text + e.KeyChar.ToString(), out f); - if (b2 == false) - { - if (b1 == true) - e.Handled = true; - else - e.Handled = false; - } - } - } - } - + private void FrmBufferAnalysis_FormClosing(object sender, FormClosingEventArgs e) { //Form1.y = 0; @@ -316,27 +288,6 @@ } } - private void FlyToMenu_Click(object sender, EventArgs e) - { - if (m_feature != null) - { - if (m_feature.Geometry != null && m_feature.Geometry.Type == EnumGeometryType.GeoPolyline3D) - { - GSOGeoPolyline3D line = m_feature.Geometry as GSOGeoPolyline3D; - double length = line.GetSpaceLength(true, 6378137); - GSOGeoPolyline3D lineLine = line.GetSegment(0, length / 2); - GSOPoint3d point3d = lineLine[lineLine.PartCount - 1][lineLine[lineLine.PartCount - 1].Count - 1]; - - globeControl1.Globe.FlyToPosition(point3d, EnumAltitudeMode.Absolute, 0, 45, 5); - } - else - { - globeControl1.Globe.FlyToFeature(m_feature, 0, 45, 3); - } - LightMenu_Click(sender, e); - } - } - private void LightMenu_Click(object sender, EventArgs e) { flashflag = "single"; diff --git a/FrmDataBaseOpt.cs b/FrmDataBaseOpt.cs index b0c4b5d..8d7b69d 100644 --- a/FrmDataBaseOpt.cs +++ b/FrmDataBaseOpt.cs @@ -362,6 +362,7 @@ dbCombor.Items.Add(dblist[i].title); } } + /* /// /// 从配置文件读取数据库参数配置 /// @@ -428,6 +429,8 @@ } } + * */ + /* /// /// 向配置文件写入连接数据库的参数配置 /// @@ -485,6 +488,7 @@ MessageBox.Show(exp.ToString()); } } + * */ /// /// /// diff --git a/FrmDatabaseParaSetting.cs b/FrmDatabaseParaSetting.cs index a6fea46..63b596b 100644 --- a/FrmDatabaseParaSetting.cs +++ b/FrmDatabaseParaSetting.cs @@ -152,6 +152,7 @@ this.DialogResult = DialogResult.OK; this.Close(); } + /* /// /// 从配置文件读取数据库连接参数配置 /// @@ -218,6 +219,8 @@ } } + * */ + /* /// /// 向配置文件写入数据库参数配置 /// @@ -276,7 +279,7 @@ MessageBox.Show(ex.ToString()); } } - + */ /// /// 取消按钮事件处理 /// diff --git a/FrmDatabaseParaSetting2.cs b/FrmDatabaseParaSetting2.cs index 932d05e..96a87d5 100644 --- a/FrmDatabaseParaSetting2.cs +++ b/FrmDatabaseParaSetting2.cs @@ -148,6 +148,7 @@ this.DialogResult = DialogResult.OK; this.Close(); } + /* /// /// 从配置文件读取数据库连接参数配置 /// @@ -214,6 +215,8 @@ } } + * */ + /* /// /// 向配置文件写入数据库参数配置 /// @@ -272,7 +275,7 @@ MessageBox.Show(exp.ToString()); } } - + */ /// /// 取消按钮事件处理 /// diff --git a/Cyberpipe.csproj b/Cyberpipe.csproj index 07a8c1a..e3cd12c 100644 --- a/Cyberpipe.csproj +++ b/Cyberpipe.csproj @@ -204,25 +204,6 @@ - - Form - - - F_GKT1数据输入输出.cs - - - Form - - - F_GKT1添加文件.cs - - - Form - - - F_GKT1添加项目.cs - - Form @@ -1068,18 +1049,6 @@ Frm_password_reset.cs - - Form - - - GKT.cs - - - Form - - - GKT1.cs - Form @@ -1258,12 +1227,6 @@ F_Projedit.cs - - Form - - - PED.cs - Form @@ -1331,16 +1294,6 @@ True Reference.map - - F_GKT1数据输入输出.cs - Designer - - - F_GKT1添加文件.cs - - - F_GKT1添加项目.cs - Form_EditTask.cs @@ -1836,12 +1789,6 @@ Frm_password_reset.cs - - GKT.cs - - - GKT1.cs - F_GKT数据输入输出.cs @@ -1934,9 +1881,6 @@ F_Projedit.cs - - PED.cs - F_数据输入输出.cs diff --git a/Cyberpipe.suo b/Cyberpipe.suo index 68ced4f..a1aecf8 100644 --- a/Cyberpipe.suo +++ b/Cyberpipe.suo Binary files differ diff --git a/EMS_Forms/Form_EditTask.cs b/EMS_Forms/Form_EditTask.cs index 718992f..f1d791f 100644 --- a/EMS_Forms/Form_EditTask.cs +++ b/EMS_Forms/Form_EditTask.cs @@ -119,7 +119,8 @@ String name = Convert.ToString(dr["USERNAME"]); comboBox_userName.Items.Add(name); - } + } + dr.Close(); comboBox_road.Items.Clear(); roadList = new List(); @@ -135,7 +136,7 @@ comboBox_road.Items.Add(name); } } - + dr1.Close(); conn.Close(); bool flag2 = false; @@ -185,7 +186,7 @@ catch (Exception ex) { - MessageBox.Show(ex.ToString()); + LogHelper.WriteLog(typeof(Form_EditTask), ex.Message); } } @@ -288,7 +289,7 @@ } catch (Exception ex) { - MessageBox.Show(ex.ToString()); + LogHelper.WriteLog(typeof(Form_EditTask), ex.Message); } } @@ -474,7 +475,7 @@ } catch (Exception ex) { - MessageBox.Show(ex.ToString()); + LogHelper.WriteLog(typeof(Form_EditTask), ex.Message); } this.Close(); @@ -495,6 +496,7 @@ { numList.Add(Convert.ToInt32(dr["DBID"])); } + dr.Close(); if (numList.Count == 0) { taskNumber = Convert.ToInt32(number) * 100; @@ -674,6 +676,7 @@ } } } + dr.Close(); conn.Close(); } diff --git a/EMS_Forms/Form_EventManager.cs b/EMS_Forms/Form_EventManager.cs index b18c45b..84807b2 100644 --- a/EMS_Forms/Form_EventManager.cs +++ b/EMS_Forms/Form_EventManager.cs @@ -64,6 +64,7 @@ comboBox_name.Items.Add(name); } + dr.Close(); conn.Close(); diff --git a/Forms/FrmMnModify.cs b/Forms/FrmMnModify.cs index 31cfc5f..d036360 100644 --- a/Forms/FrmMnModify.cs +++ b/Forms/FrmMnModify.cs @@ -68,15 +68,7 @@ questionGrid.Rows[idx].Cells[1].Value = sr.question; } } - /// 选中对象 - /// - /// - /// - /// - private void buttonX1_Click(object sender, EventArgs e) - { - globecontrol.Globe.Action = EnumAction3D.SelectObject; - } + /// /// 选中某一行 /// diff --git a/Forms/FrmPipelineModelDataBase.cs b/Forms/FrmPipelineModelDataBase.cs index 2acf0ca..7ce573f 100644 --- a/Forms/FrmPipelineModelDataBase.cs +++ b/Forms/FrmPipelineModelDataBase.cs @@ -35,19 +35,7 @@ ds = _ds; InitializeComponent(); } - /// - /// 单击选择shp格式文件 - /// - /// - /// - private void btnBrowseModel_Click(object sender, EventArgs e) - { - saveFileDialog1.Filter = "*.lgd|*.lgd"; - if (saveFileDialog1.ShowDialog() == DialogResult.OK) - { - txtModelLayer.Text = saveFileDialog1.FileName; - } - } + /// /// 窗体初始化事件处理 /// @@ -100,49 +88,6 @@ } } } - - private object convertFieldValue(string fieldname, object obj) - { - if (obj == null) - return null; - - try - { - string type = fields_types[fieldname].ToString(); - switch (type) - { - case "string": - return obj.ToString(); - case "int": - //return 101; - int intResult; - if (int.TryParse(obj.ToString(), out intResult)) - return intResult; - else - return null; - case "double": - //return 202.5; - double doubleResult; - if (double.TryParse(obj.ToString(), out doubleResult)) - return doubleResult; - else - return null; - case "date": - DateTime dtResult; - if (DateTime.TryParse(obj.ToString(), out dtResult)) - return dtResult; - else - return null; - } - return null; - } - catch (Exception ex) - { - MessageBox.Show(ex.ToString()); - return null; - } - } - public string lgdFilePath = ""; /// /// 选择管线颜色 @@ -610,33 +555,6 @@ { this.Close(); } - - private void cmbLayer_SelectedIndexChanged(object sender, EventArgs e) //选择图层 - { - GSOLayer layer = ctl.Globe.Layers.GetLayerByCaption(selectLayerName); - GSOFeatures features = layer.GetAllFeatures(); - if (features.Length == 0) - return; - - cmbFrom.Items.Clear(); - cmbTo.Items.Clear(); - cmbRadius.Items.Clear(); - cmbID.Items.Clear(); - for (int i = 0; i < features[0].GetFieldCount(); i++) - { - GeoScene.Data.GSOFieldDefn fielddef = (GeoScene.Data.GSOFieldDefn)(features[0].GetFieldDefn(i)); - - cmbFrom.Items.Add(fielddef.Name); - cmbTo.Items.Add(fielddef.Name); - cmbRadius.Items.Add(fielddef.Name); - cmbID.Items.Add(fielddef.Name); - } - cmbFrom.SelectedItem = "Deep1"; - cmbTo.SelectedItem = "Deep2"; - cmbRadius.SelectedItem = "Diameter"; - cmbID.SelectedItem = "Handle"; - } - private void buttonXLayerPath_Click(object sender, EventArgs e)//单击 选择shp格式的文件 { OpenFileDialog dlg = new OpenFileDialog(); diff --git a/Forms/FrmPipelineModelDataOneStep.cs b/Forms/FrmPipelineModelDataOneStep.cs index 18afda7..ec93b8a 100644 --- a/Forms/FrmPipelineModelDataOneStep.cs +++ b/Forms/FrmPipelineModelDataOneStep.cs @@ -38,19 +38,7 @@ layerTree = _layerTree; InitializeComponent(); } - /// - /// 单击选择shp格式文件 - /// - /// - /// - private void btnBrowseModel_Click(object sender, EventArgs e) - { - saveFileDialog1.Filter = "*.lgd|*.lgd"; - if (saveFileDialog1.ShowDialog() == DialogResult.OK) - { - txtModelLayer.Text = saveFileDialog1.FileName; - } - } + /// /// 窗体初始化事件处理 /// @@ -107,48 +95,7 @@ } } - private object convertFieldValue(string fieldname, object obj) - { - if (obj == null) - return null; - - try - { - string type = fields_types[fieldname].ToString(); - switch (type) - { - case "string": - return obj.ToString(); - case "int": - //return 101; - int intResult; - if (int.TryParse(obj.ToString(), out intResult)) - return intResult; - else - return null; - case "double": - //return 202.5; - double doubleResult; - if (double.TryParse(obj.ToString(), out doubleResult)) - return doubleResult; - else - return null; - case "date": - DateTime dtResult; - if (DateTime.TryParse(obj.ToString(), out dtResult)) - return dtResult; - else - return null; - } - return null; - } - catch (Exception ex) - { - MessageBox.Show(ex.ToString()); - return null; - } - } - + public string lgdFilePath = ""; /// /// 选择管线颜色 @@ -673,32 +620,6 @@ return featDs; } - private void cmbLayer_SelectedIndexChanged(object sender, EventArgs e) //选择图层 - { - GSOLayer layer = ctl.Globe.Layers.GetLayerByCaption(selectLayerName); - GSOFeatures features = layer.GetAllFeatures(); - if (features.Length == 0) - return; - - cmbFrom.Items.Clear(); - cmbTo.Items.Clear(); - cmbRadius.Items.Clear(); - cmbID.Items.Clear(); - for (int i = 0; i < features[0].GetFieldCount(); i++) - { - GeoScene.Data.GSOFieldDefn fielddef = (GeoScene.Data.GSOFieldDefn)(features[0].GetFieldDefn(i)); - - cmbFrom.Items.Add(fielddef.Name); - cmbTo.Items.Add(fielddef.Name); - cmbRadius.Items.Add(fielddef.Name); - cmbID.Items.Add(fielddef.Name); - } - cmbFrom.SelectedItem = "Deep1"; - cmbTo.SelectedItem = "Deep2"; - cmbRadius.SelectedItem = "Diameter"; - cmbID.SelectedItem = "Handle"; - } - private void buttonXLayerPath_Click(object sender, EventArgs e)//单击 选择shp格式的文件 { OpenFileDialog dlg = new OpenFileDialog(); @@ -949,38 +870,6 @@ } //txtLayername.Text = type + layername; } - /// - /// 连接数据库 - /// - /// - /// - private void buttonX1_Click(object sender, EventArgs e) - { - if (ds == null) - { - //没连的话,直接连接审核库; //审核库配置读配置文件 - string dbIp = Utility.sgdbip; - string database = Utility.sgdbname; - string user = Utility.sgdbuser; - string pass = Utility.sgdbpwd; - - if (!Utility.isNetworkConnectionSuccess(dbIp.Trim())) - { - MessageBox.Show("网络连接失败!", "提示"); - return; - } - - ds = ctl.Globe.DataManager.OpenOracleDataSource(dbIp + "/" + database, "", "", user, pass); - if (ds == null) - { - MessageBox.Show("数据库连接失败!", "提示", MessageBoxButtons.OK, MessageBoxIcon.Warning); - } - else - { - btnCreateModel.Enabled = true; - } - } - } private void btnClose_Click(object sender, EventArgs e) { diff --git a/Forms/FrmShRK.cs b/Forms/FrmShRK.cs index 0e2e722..f1d83cb 100644 --- a/Forms/FrmShRK.cs +++ b/Forms/FrmShRK.cs @@ -215,6 +215,7 @@ { sourcefeatds = sourcefeat as GSOFeatureDataset; } + if (sourcefeatds == null) return; sourcefeatds.Open(); GSOFeatures sourcefeatures = sourcefeatds.GetAllFeatures(); @@ -251,6 +252,7 @@ { desfeatds = desfeat as GSOFeatureDataset; } + if (desfeatds == null) return; desfeatds.Open(); //向新数据集写入字段 diff --git a/FrmAccessoriesSensor.cs b/FrmAccessoriesSensor.cs index 09fcdf1..2a7a80e 100644 --- a/FrmAccessoriesSensor.cs +++ b/FrmAccessoriesSensor.cs @@ -209,7 +209,7 @@ chart1.Series[0].Points.DataBindXY(dic.Keys, dic.Values); for (int m = 0; m < dic.Values.Count; m++) { - if (chart1.Series[0].Points[m].YValues[0].ToString() != "0") + if (chart1.Series[0].Points[m]!=null&&chart1.Series[0].Points[m].YValues[0].ToString() != "0") { chart1.Series[0].Points[m].Label = chart1.Series[0].Points[m].YValues[0].ToString(); } diff --git a/FrmAccessoriesgather.cs b/FrmAccessoriesgather.cs index 9e331e1..a475d9e 100644 --- a/FrmAccessoriesgather.cs +++ b/FrmAccessoriesgather.cs @@ -338,7 +338,7 @@ chart1.Series[0].Points.DataBindXY(dic.Keys, dic.Values); for (int m = 0; m < dic.Values.Count; m++) { - if (chart1.Series[0].Points[m].YValues[0].ToString() != "0") + if (chart1.Series[0].Points[m]!=null&&chart1.Series[0].Points[m].YValues[0].ToString() != "0") { chart1.Series[0].Points[m].Label = chart1.Series[0].Points[m].YValues[0].ToString(); } diff --git a/FrmAccessoryAnalysis.cs b/FrmAccessoryAnalysis.cs index 71d4579..44d4065 100644 --- a/FrmAccessoryAnalysis.cs +++ b/FrmAccessoryAnalysis.cs @@ -66,39 +66,6 @@ globeControl1.Refresh(); } /// - /// 键盘按键按下事件处理 - /// - /// - /// - private void txtRadius_KeyPress(object sender, KeyPressEventArgs e) - { - TextBox text = sender as TextBox; - if ((e.KeyChar < 48 || e.KeyChar > 57) && (e.KeyChar != 8) && (int)e.KeyChar != 46) - { - e.Handled = true; - } - if ((int)e.KeyChar == 46) //小数点 - { - if (text.Text.Length <= 0) - e.Handled = true; //小数点不能在第一位 - else //处理不规则的小数点 - { - float f; - float oldf; - bool b1 = false, b2 = false; - b1 = float.TryParse(text.Text, out oldf); - b2 = float.TryParse(text.Text + e.KeyChar.ToString(), out f); - if (b2 == false) - { - if (b1 == true) - e.Handled = true; - else - e.Handled = false; - } - } - } - } - /// /// 确定按钮事件处理 /// /// diff --git a/FrmAddValve.cs b/FrmAddValve.cs index 34d2fec..5f405b9 100644 --- a/FrmAddValve.cs +++ b/FrmAddValve.cs @@ -486,56 +486,6 @@ } } - - - - - - - - private void cmbLayer_SelectedIndexChanged(object sender, EventArgs e) - { - GSOLayer layer = globeControl1.Globe.Layers.GetLayerByCaption(selectLayerName); - GSOFeatures features = layer.GetAllFeatures(); - if (features.Length == 0) - return; - - combPath.Items.Clear(); - combZ.Items.Clear(); - combModelName.Items.Clear(); - - for (int i = 0; i < features[0].GetFieldCount(); i++) - { - GeoScene.Data.GSOFieldDefn fielddef = (GeoScene.Data.GSOFieldDefn)(features[0].GetFieldDefn(i)); - combPath.Items.Add(fielddef.Name); - combZ.Items.Add(fielddef.Name); - combModelName.Items.Add(fielddef.Name); - } - combModelName.SelectedItem = "编号"; - combPath.SelectedItem = "模型路径"; - if (combfile.SelectedIndex != -1) - { - - string layerCaption = combfile.SelectedItem.ToString().Trim(); - rukuLayer = globeControl1.Globe.Layers.GetLayerByCaption(layerCaption); - if (rukuLayer != null) - { - combPath.Items.Clear(); - combZ.Items.Clear(); - combModelName.Items.Clear(); - - } - for (int i = 0; i < features[0].GetFieldCount(); i++) - { - GeoScene.Data.GSOFieldDefn fielddef = (GeoScene.Data.GSOFieldDefn)(features[0].GetFieldDefn(i)); - combPath.Items.Add(fielddef.Name); - combZ.Items.Add(fielddef.Name); - combModelName.Items.Add(fielddef.Name); - } - combModelName.SelectedItem = "编号"; - combPath.SelectedItem = "模型路径"; - } - } /// /// 单击选择shp格式文件 /// diff --git a/FrmAddWellShp.cs b/FrmAddWellShp.cs index bb79ec0..a249725 100644 --- a/FrmAddWellShp.cs +++ b/FrmAddWellShp.cs @@ -478,32 +478,6 @@ } } } - - private void cmbLayer_SelectedIndexChanged(object sender, EventArgs e) - { - GSOLayer layer = globeControl1.Globe.Layers.GetLayerByCaption(selectLayerName); - GSOFeatures features = layer.GetAllFeatures(); - if (features.Length == 0) - return; - - combCode.Items.Clear(); - combDeep.Items.Clear(); - combModelName.Items.Clear(); - combAngle.Items.Clear(); - - for (int i = 0; i < features[0].GetFieldCount(); i++) - { - GeoScene.Data.GSOFieldDefn fielddef = (GeoScene.Data.GSOFieldDefn)(features[0].GetFieldDefn(i)); - combCode.Items.Add(fielddef.Name); - combDeep.Items.Add(fielddef.Name); - combModelName.Items.Add(fielddef.Name); - combAngle.Items.Add(fielddef.Name); - } - combCode.SelectedItem = "附属物编码"; - combDeep.SelectedItem = "井深"; - combModelName.SelectedItem = "编号"; - combAngle.SelectedItem = "符号角度"; - } /// /// 单击选择shp格式文件 /// diff --git a/FrmAddYuBiZiShp.cs b/FrmAddYuBiZiShp.cs index b312d51..332f037 100644 --- a/FrmAddYuBiZiShp.cs +++ b/FrmAddYuBiZiShp.cs @@ -383,80 +383,7 @@ } } - private void cmbLayer_SelectedIndexChanged(object sender, EventArgs e) - { - GSOLayer layer = globeControl1.Globe.Layers.GetLayerByCaption(selectLayerName); - GSOFeatures features = layer.GetAllFeatures(); - if (features.Length == 0) - return; - - combCode.Items.Clear(); - combDeep.Items.Clear(); - combModelName.Items.Clear(); - //comboLoad.Items.Clear(); - for (int i = 0; i < features[0].GetFieldCount(); i++) - { - GeoScene.Data.GSOFieldDefn fielddef = (GeoScene.Data.GSOFieldDefn)(features[0].GetFieldDefn(i)); - combCode.Items.Add(fielddef.Name); - combDeep.Items.Add(fielddef.Name); - combModelName.Items.Add(fielddef.Name); - //comboLoad.Items.Add(fielddef.Name); - } - combCode.SelectedItem = "附属物编码"; - combDeep.SelectedItem = "Z坐标"; - combModelName.SelectedItem = "编号"; - //comboLoad.SelectedItem = "模型路径"; - } - - private void buttonXLayerPath_Click(object sender, EventArgs e) - { - OpenFileDialog dlg = new OpenFileDialog(); - dlg.Filter = "*.shp|*.shp"; - dlg.Multiselect = false; - if (dlg.ShowDialog() == DialogResult.OK) - { - GSOLayer layer = globeControl1.Globe.Layers.Add(dlg.FileName); - string txtMessage = valiYBdata(layer); - if (txtMessage != "") - { - button3.Enabled = false; - //textBoxLayer.Text = ""; - combCode.Items.Clear(); - combDeep.Items.Clear(); - combModelName.Items.Clear(); - globeControl1.Globe.Layers.Remove(layer); - FrmValiDataShowErrorMessage showErrorMessage = new FrmValiDataShowErrorMessage(dlg.FileName, txtMessage); - showErrorMessage.ShowDialog(); - return; - } - else - { - button3.Enabled = true; - //textBoxLayer.Text = dlg.FileName; - selectLayerName = layer.Caption; - txtLayerName.Text = layer.Caption; - GSOFeatures features = layer.GetAllFeatures(); - if (features.Length == 0) - return; - - combCode.Items.Clear(); - combDeep.Items.Clear(); - combModelName.Items.Clear(); - for (int i = 0; i < features[0].GetFieldCount(); i++) - { - GeoScene.Data.GSOFieldDefn fielddef = (GeoScene.Data.GSOFieldDefn)(features[0].GetFieldDefn(i)); - combCode.Items.Add(fielddef.Name); - combDeep.Items.Add(fielddef.Name); - combModelName.Items.Add(fielddef.Name); - //comboLoad.Items.Add(fielddef.Name); - } - combCode.SelectedItem = "管点编码"; - combDeep.SelectedItem = "Z坐标"; - combModelName.SelectedItem = "编号"; - } - } - } - + private void FrmAddYuBiZiShp_FormClosing(object sender, FormClosingEventArgs e) { globeControl1.Globe.Refresh(); diff --git a/FrmAllPipelineStatis.cs b/FrmAllPipelineStatis.cs index 6421a26..a6eea29 100644 --- a/FrmAllPipelineStatis.cs +++ b/FrmAllPipelineStatis.cs @@ -84,7 +84,7 @@ chartAllAreaPipeline.Series["管线"].Points.DataBindXY(pipelineLengthAndType.Keys, pipelineLengthAndType.Values); for (int m = 0; m < pipelineLengthAndType.Values.Count; m++) { - if (chartAllAreaPipeline.Series["管线"].Points[m].YValues[0].ToString() != "0") + if (chartAllAreaPipeline.Series["管线"].Points[m]!=null&&chartAllAreaPipeline.Series["管线"].Points[m].YValues[0].ToString() != "0") { chartAllAreaPipeline.Series["管线"].Points[m].Label = chartAllAreaPipeline.Series[0].Points[m].YValues[0].ToString(); } @@ -94,7 +94,7 @@ } catch (Exception ex) { - //LogError.PublishError(ex); + LogHelper.WriteLog(typeof(FrmAllPipelineStatis), ex.Message); } } @@ -147,7 +147,7 @@ } DataTable dt = OledbHelper.QueryTable(sql); - if (dt != null && dt.Rows.Count > 0) + if (dt != null && dt.Rows.Count > 0 && chartAllAreaPipeline.Series["管线"].Points[indexHit]!=null) { dataGridViewX1.DataSource = dt; panel.Visible = true; diff --git a/FrmAllWorkWellStatis.cs b/FrmAllWorkWellStatis.cs index 6fec7af..6af8e4c 100644 --- a/FrmAllWorkWellStatis.cs +++ b/FrmAllWorkWellStatis.cs @@ -52,7 +52,7 @@ chartAllAreaPipeline.Series["井盖"].Points.DataBindXY(workWellLengthAndType.Keys, workWellLengthAndType.Values); for (int m = 0; m < workWellLengthAndType.Values.Count; m++) { - if (chartAllAreaPipeline.Series["井盖"].Points[m].YValues[0].ToString().Trim() != "0") + if (chartAllAreaPipeline.Series["井盖"].Points[m]!=null&&chartAllAreaPipeline.Series["井盖"].Points[m].YValues[0].ToString().Trim() != "0") { chartAllAreaPipeline.Series["井盖"].Points[m].Label = chartAllAreaPipeline.Series[0].Points[m].YValues[0].ToString(); } @@ -60,7 +60,7 @@ } catch (Exception ex) { - //LogError.PublishError(ex); + LogHelper.WriteLog(typeof(FrmAllWorkWellStatis), ex.Message); } } diff --git a/FrmBSQDuoBianXingStatis.cs b/FrmBSQDuoBianXingStatis.cs index e8b7d52..3e889b6 100644 --- a/FrmBSQDuoBianXingStatis.cs +++ b/FrmBSQDuoBianXingStatis.cs @@ -60,7 +60,7 @@ { for (int m = 0; m < bsq1.Values.Count; m++) { - if (chart1.Series["标识器"].Points[m].YValues[0].ToString() != "0") + if (chart1.Series["标识器"].Points[m]!=null&&chart1.Series["标识器"].Points[m].YValues[0].ToString() != "0") { count += Convert.ToInt16(chart1.Series[0].Points[m].YValues[0].ToString()); chart1.Series["标识器"].Points[m].Label = chart1.Series[0].Points[m].YValues[0].ToString(); diff --git a/FrmBSQDuoBianXingStreet.cs b/FrmBSQDuoBianXingStreet.cs index 2005ebb..1db5777 100644 --- a/FrmBSQDuoBianXingStreet.cs +++ b/FrmBSQDuoBianXingStreet.cs @@ -63,7 +63,7 @@ chartStatis.Series[0].Points.DataBindXY(bsq.Keys, bsq.Values); for (int m = 0; m < bsq.Values.Count; m++) { - if (chartStatis.Series[0].Points[m].YValues[0].ToString().Trim() != "0") + if (chartStatis.Series[0].Points[m]!=null&&chartStatis.Series[0].Points[m].YValues[0].ToString().Trim() != "0") { count += Convert.ToInt16(chartStatis.Series[0].Points[m].YValues[0].ToString()); chartStatis.Series[0].Points[m].Label = chartStatis.Series[0].Points[m].YValues[0].ToString(); diff --git a/FrmBSQStatis.cs b/FrmBSQStatis.cs index 390a55c..4aa0ee6 100644 --- a/FrmBSQStatis.cs +++ b/FrmBSQStatis.cs @@ -95,6 +95,8 @@ } } } + + dr.Close(); conn.Close(); for (int i = 0; i < typeLists.Count; i++) { @@ -123,7 +125,7 @@ chartStatis.Series[0].Points.DataBindXY(bsq.Keys, bsq.Values); for (int m = 0; m < bsq.Values.Count; m++) { - if (chartStatis.Series[0].Points[m].YValues[0].ToString().Trim() != "0") + if (chartStatis.Series[0].Points[m]!=null&&chartStatis.Series[0].Points[m].YValues[0].ToString().Trim() != "0") { //count += Convert.ToInt16(chartStatis.Series[0].Points[m].YValues[0].ToString()); chartStatis.Series[0].Points[m].Label = chartStatis.Series[0].Points[m].YValues[0].ToString(); diff --git a/FrmBSQStreet.cs b/FrmBSQStreet.cs index 9d88adb..7fbacad 100644 --- a/FrmBSQStreet.cs +++ b/FrmBSQStreet.cs @@ -44,7 +44,7 @@ chartStatis.Series[0].Points.DataBindXY(bsq.Keys, bsq.Values); for (int m = 0; m < bsq.Values.Count; m++) { - if (chartStatis.Series[0].Points[m].YValues[0].ToString().Trim() != "0") + if (chartStatis.Series[0].Points[m]!=null&&chartStatis.Series[0].Points[m].YValues[0].ToString().Trim() != "0") { count += Convert.ToInt16(chartStatis.Series[0].Points[m].YValues[0].ToString()); chartStatis.Series[0].Points[m].Label = chartStatis.Series[0].Points[m].YValues[0].ToString(); diff --git a/FrmBoosterValvers.cs b/FrmBoosterValvers.cs index 5061efc..df9b62b 100644 --- a/FrmBoosterValvers.cs +++ b/FrmBoosterValvers.cs @@ -236,199 +236,6 @@ count = 0; } } - /// - /// 添加火苗 - /// - /// - /// - /// - /// - private GSOFeature AddFire(double x,double y,double z) - { - // 烟火示例 - - string strResPath = Application.StartupPath + "/Resource"; - - // 烟火粒子示例,由三个发射器构成 - GSOGeoParticle geoParticle = new GSOGeoParticle(); - geoParticle.SetPosition(x, y, z); // 添加到这个经纬度位置 - geoParticle.AltitudeMode = EnumAltitudeMode.RelativeToGround; - - GSORingParticleEmitter emitter = new GSORingParticleEmitter(); - emitter.TexturePath = strResPath + "/ParticleImage/flare.png"; - - emitter.SetSizeFix(1, 1); - emitter.VelFix = 1; - emitter.VelRnd = 5; - - emitter.AngleXYFix = 0; - emitter.AngleXYRnd = 180; - - emitter.AngleXZFix = 90; - emitter.AngleXZRnd = 0; - - emitter.LifeFix = 0.5f; - emitter.LifeRnd = 0.0f; - - emitter.RotFix = 0; - emitter.RotRnd = 0; - - emitter.RotVelFix = 0; - emitter.RotVelRnd = 0; - - emitter.EmitPerSec = 100; - - // 采用线性插值生成粒子的初始颜色 - emitter.ColorRndStart = Color.White; - emitter.ColorRndEnd = Color.Red; - - - GSOColorParticleEffector effector2 = new GSOColorParticleEffector(); - effector2.SetColorChanged(0, -1, -1, 0); - effector2.StartTime = 0.0f; - effector2.EndTime = -1.0f; - emitter.AddEffector(effector2); - - // 将三个发射器添加到粒子对象中 - geoParticle.AddEmitter(emitter); - - geoParticle.Play(); - - GSOFeature feature = new GSOFeature(); - - feature.Geometry = geoParticle; - - globeControl1.Globe.MemoryLayer.AddFeature(feature); - - - return feature; - } - - /// - /// 添加喷泉 - /// - /// - private GSOFeature AddFountain() - { - string strResPath = Application.StartupPath + "/Resource"; - - GSOGeoParticle geoParticle = new GSOGeoParticle(); - geoParticle.SetPosition(116.314, 39.84, 0); // 添加到这个经纬度位置 - - GSOPointParticleEmitter emitter = new GSOPointParticleEmitter(); - emitter.TexturePath = strResPath + "/ParticleImage/test.png"; - - emitter.SetSizeFix(0.5f, 2); - emitter.VelFix = 10; - emitter.VelRnd = 2; - - emitter.GravityAcc = 9.8f; - emitter.AngleXYFix = 0; - emitter.AngleXYRnd = 180; - - emitter.AngleXZFix = 88; - emitter.AngleXZRnd = 2; - - //emitter.InnerRadius = 0; - // emitter.OuterRadius = 0.03f; - - emitter.LifeFix = 5.0f; - emitter.LifeRnd = 1.0f; - - emitter.RotFix = 0; - emitter.RotRnd = 0; - - emitter.RotVelFix = 0; - emitter.RotVelRnd = 0; - - emitter.EmitPerSec = 1000; - emitter.ColorRndStart = Color.FromArgb(33, 255, 255, 255); - emitter.ColorRndEnd = Color.FromArgb(11, 255, 255, 255); - emitter.IsLumAdded = false; - - // 将三个发射器添加到粒子对象中 - geoParticle.AddEmitter(emitter); - - geoParticle.Play(); - GSOFeature feature = new GSOFeature(); - - feature.Geometry = geoParticle; - - //globeControl1.Globe.MemoryLayer.AddFeature(feature); - globeControl1.Globe.FlyToFeature(feature); - - return feature; - } - - /// - /// 添加水柱 - /// - /// - private GSOFeature AddWaterLine() - { - string strResPath = Application.StartupPath + "/Resource"; - - GSOGeoParticle geoParticle = new GSOGeoParticle(); - geoParticle.SetPosition(116.308, 39.84, 0); // 添加到这个经纬度位置 - - GSOPointParticleEmitter emitter = new GSOPointParticleEmitter(); - - emitter.TexturePath = strResPath + "/ParticleImage/drop3.png"; - - geoParticle.TimerInterval = 1; - - emitter.SetSizeFix(2.0f, 2.0f); - - emitter.VelFix = 50; - emitter.VelRnd = 2; - - // emitter.IsLumAdded = false; - - emitter.GravityAcc = 9.8f; - emitter.AngleXYFix = 0; - emitter.AngleXYRnd = 2; - - emitter.AngleXZFix = 60; - emitter.AngleXZRnd = 2; - - //emitter.InnerRadius = 0; - // emitter.OuterRadius = 0.1f; - - emitter.LifeFix = 5.0f; - emitter.LifeRnd = 1.0f; - - emitter.RotFix = 0; - emitter.RotRnd = 0; - - emitter.RotVelFix = 0; - emitter.RotVelRnd = 0; - - emitter.EmitPerSec = 1500; - - emitter.ColorRndStart = Color.FromArgb(100, 222, 222, 222); - emitter.ColorRndEnd = Color.FromArgb(50, 222, 222, 222); - - /* - - GSOScaleParticleEffector effector1 = new GSOScaleParticleEffector(); - effector1.SetScale(0.2f, 0.2f); - effector1.StartTime = 0; - effector1.EndTime = -1; // 负数表示整个粒子生命结束 - emitter.AddEffector(effector1); - */ - - // 将三个发射器添加到粒子对象中 - geoParticle.AddEmitter(emitter); - - geoParticle.Play(); - GSOFeature feature = new GSOFeature(); - - feature.Geometry = geoParticle; - - //globeControl1.Globe.MemoryLayer.AddFeature(feature); - globeControl1.Globe.FlyToFeature(feature); - - return feature; - } + } } diff --git a/FrmBufferAnalysis.cs b/FrmBufferAnalysis.cs index f711133..db8ca59 100644 --- a/FrmBufferAnalysis.cs +++ b/FrmBufferAnalysis.cs @@ -123,39 +123,6 @@ } } /// - /// 半径文本框的键盘按键按下事件处理 - /// - /// - /// - private void txtRadius_KeyPress(object sender, KeyPressEventArgs e) - { - TextBox text = sender as TextBox; - if ((e.KeyChar < 48 || e.KeyChar > 57) && (e.KeyChar != 8) && (int)e.KeyChar != 46) - { - e.Handled = true; - } - if ((int)e.KeyChar == 46) //小数点 - { - if (text.Text.Length <= 0) - e.Handled = true; //小数点不能在第一位 - else //处理不规则的小数点 - { - float f; - float oldf; - bool b1 = false, b2 = false; - b1 = float.TryParse(text.Text, out oldf); - b2 = float.TryParse(text.Text + e.KeyChar.ToString(), out f); - if (b2 == false) - { - if (b1 == true) - e.Handled = true; - else - e.Handled = false; - } - } - } - } - /// /// 窗体关闭事件处理 /// /// diff --git a/FrmBufferAnalysisBSQ.cs b/FrmBufferAnalysisBSQ.cs index 24a96ca..f54208f 100644 --- a/FrmBufferAnalysisBSQ.cs +++ b/FrmBufferAnalysisBSQ.cs @@ -137,35 +137,7 @@ } } - private void txtRadius_KeyPress(object sender, KeyPressEventArgs e) - { - TextBox text = sender as TextBox; - if ((e.KeyChar < 48 || e.KeyChar > 57) && (e.KeyChar != 8) && (int)e.KeyChar != 46) - { - e.Handled = true; - } - if ((int)e.KeyChar == 46) //小数点 - { - if (text.Text.Length <= 0) - e.Handled = true; //小数点不能在第一位 - else //处理不规则的小数点 - { - float f; - float oldf; - bool b1 = false, b2 = false; - b1 = float.TryParse(text.Text, out oldf); - b2 = float.TryParse(text.Text + e.KeyChar.ToString(), out f); - if (b2 == false) - { - if (b1 == true) - e.Handled = true; - else - e.Handled = false; - } - } - } - } - + private void FrmBufferAnalysis_FormClosing(object sender, FormClosingEventArgs e) { //Form1.y = 0; @@ -316,27 +288,6 @@ } } - private void FlyToMenu_Click(object sender, EventArgs e) - { - if (m_feature != null) - { - if (m_feature.Geometry != null && m_feature.Geometry.Type == EnumGeometryType.GeoPolyline3D) - { - GSOGeoPolyline3D line = m_feature.Geometry as GSOGeoPolyline3D; - double length = line.GetSpaceLength(true, 6378137); - GSOGeoPolyline3D lineLine = line.GetSegment(0, length / 2); - GSOPoint3d point3d = lineLine[lineLine.PartCount - 1][lineLine[lineLine.PartCount - 1].Count - 1]; - - globeControl1.Globe.FlyToPosition(point3d, EnumAltitudeMode.Absolute, 0, 45, 5); - } - else - { - globeControl1.Globe.FlyToFeature(m_feature, 0, 45, 3); - } - LightMenu_Click(sender, e); - } - } - private void LightMenu_Click(object sender, EventArgs e) { flashflag = "single"; diff --git a/FrmDataBaseOpt.cs b/FrmDataBaseOpt.cs index b0c4b5d..8d7b69d 100644 --- a/FrmDataBaseOpt.cs +++ b/FrmDataBaseOpt.cs @@ -362,6 +362,7 @@ dbCombor.Items.Add(dblist[i].title); } } + /* /// /// 从配置文件读取数据库参数配置 /// @@ -428,6 +429,8 @@ } } + * */ + /* /// /// 向配置文件写入连接数据库的参数配置 /// @@ -485,6 +488,7 @@ MessageBox.Show(exp.ToString()); } } + * */ /// /// /// diff --git a/FrmDatabaseParaSetting.cs b/FrmDatabaseParaSetting.cs index a6fea46..63b596b 100644 --- a/FrmDatabaseParaSetting.cs +++ b/FrmDatabaseParaSetting.cs @@ -152,6 +152,7 @@ this.DialogResult = DialogResult.OK; this.Close(); } + /* /// /// 从配置文件读取数据库连接参数配置 /// @@ -218,6 +219,8 @@ } } + * */ + /* /// /// 向配置文件写入数据库参数配置 /// @@ -276,7 +279,7 @@ MessageBox.Show(ex.ToString()); } } - + */ /// /// 取消按钮事件处理 /// diff --git a/FrmDatabaseParaSetting2.cs b/FrmDatabaseParaSetting2.cs index 932d05e..96a87d5 100644 --- a/FrmDatabaseParaSetting2.cs +++ b/FrmDatabaseParaSetting2.cs @@ -148,6 +148,7 @@ this.DialogResult = DialogResult.OK; this.Close(); } + /* /// /// 从配置文件读取数据库连接参数配置 /// @@ -214,6 +215,8 @@ } } + * */ + /* /// /// 向配置文件写入数据库参数配置 /// @@ -272,7 +275,7 @@ MessageBox.Show(exp.ToString()); } } - + */ /// /// 取消按钮事件处理 /// diff --git a/FrmDiameterQuery.cs b/FrmDiameterQuery.cs index 68c948b..9a5215b 100644 --- a/FrmDiameterQuery.cs +++ b/FrmDiameterQuery.cs @@ -77,18 +77,7 @@ isBetween = true; } } - /// - /// 键盘按键按下事件处理 - /// - /// - /// - private void textBoxX1_KeyPress(object sender, KeyPressEventArgs e) - { - if ((e.KeyChar < 48 || e.KeyChar > 57) && e.KeyChar != 8) - { - e.Handled = true;//屏蔽 - } - } + bool isBetween = false; /// diff --git a/Cyberpipe.csproj b/Cyberpipe.csproj index 07a8c1a..e3cd12c 100644 --- a/Cyberpipe.csproj +++ b/Cyberpipe.csproj @@ -204,25 +204,6 @@ - - Form - - - F_GKT1数据输入输出.cs - - - Form - - - F_GKT1添加文件.cs - - - Form - - - F_GKT1添加项目.cs - - Form @@ -1068,18 +1049,6 @@ Frm_password_reset.cs - - Form - - - GKT.cs - - - Form - - - GKT1.cs - Form @@ -1258,12 +1227,6 @@ F_Projedit.cs - - Form - - - PED.cs - Form @@ -1331,16 +1294,6 @@ True Reference.map - - F_GKT1数据输入输出.cs - Designer - - - F_GKT1添加文件.cs - - - F_GKT1添加项目.cs - Form_EditTask.cs @@ -1836,12 +1789,6 @@ Frm_password_reset.cs - - GKT.cs - - - GKT1.cs - F_GKT数据输入输出.cs @@ -1934,9 +1881,6 @@ F_Projedit.cs - - PED.cs - F_数据输入输出.cs diff --git a/Cyberpipe.suo b/Cyberpipe.suo index 68ced4f..a1aecf8 100644 --- a/Cyberpipe.suo +++ b/Cyberpipe.suo Binary files differ diff --git a/EMS_Forms/Form_EditTask.cs b/EMS_Forms/Form_EditTask.cs index 718992f..f1d791f 100644 --- a/EMS_Forms/Form_EditTask.cs +++ b/EMS_Forms/Form_EditTask.cs @@ -119,7 +119,8 @@ String name = Convert.ToString(dr["USERNAME"]); comboBox_userName.Items.Add(name); - } + } + dr.Close(); comboBox_road.Items.Clear(); roadList = new List(); @@ -135,7 +136,7 @@ comboBox_road.Items.Add(name); } } - + dr1.Close(); conn.Close(); bool flag2 = false; @@ -185,7 +186,7 @@ catch (Exception ex) { - MessageBox.Show(ex.ToString()); + LogHelper.WriteLog(typeof(Form_EditTask), ex.Message); } } @@ -288,7 +289,7 @@ } catch (Exception ex) { - MessageBox.Show(ex.ToString()); + LogHelper.WriteLog(typeof(Form_EditTask), ex.Message); } } @@ -474,7 +475,7 @@ } catch (Exception ex) { - MessageBox.Show(ex.ToString()); + LogHelper.WriteLog(typeof(Form_EditTask), ex.Message); } this.Close(); @@ -495,6 +496,7 @@ { numList.Add(Convert.ToInt32(dr["DBID"])); } + dr.Close(); if (numList.Count == 0) { taskNumber = Convert.ToInt32(number) * 100; @@ -674,6 +676,7 @@ } } } + dr.Close(); conn.Close(); } diff --git a/EMS_Forms/Form_EventManager.cs b/EMS_Forms/Form_EventManager.cs index b18c45b..84807b2 100644 --- a/EMS_Forms/Form_EventManager.cs +++ b/EMS_Forms/Form_EventManager.cs @@ -64,6 +64,7 @@ comboBox_name.Items.Add(name); } + dr.Close(); conn.Close(); diff --git a/Forms/FrmMnModify.cs b/Forms/FrmMnModify.cs index 31cfc5f..d036360 100644 --- a/Forms/FrmMnModify.cs +++ b/Forms/FrmMnModify.cs @@ -68,15 +68,7 @@ questionGrid.Rows[idx].Cells[1].Value = sr.question; } } - /// 选中对象 - /// - /// - /// - /// - private void buttonX1_Click(object sender, EventArgs e) - { - globecontrol.Globe.Action = EnumAction3D.SelectObject; - } + /// /// 选中某一行 /// diff --git a/Forms/FrmPipelineModelDataBase.cs b/Forms/FrmPipelineModelDataBase.cs index 2acf0ca..7ce573f 100644 --- a/Forms/FrmPipelineModelDataBase.cs +++ b/Forms/FrmPipelineModelDataBase.cs @@ -35,19 +35,7 @@ ds = _ds; InitializeComponent(); } - /// - /// 单击选择shp格式文件 - /// - /// - /// - private void btnBrowseModel_Click(object sender, EventArgs e) - { - saveFileDialog1.Filter = "*.lgd|*.lgd"; - if (saveFileDialog1.ShowDialog() == DialogResult.OK) - { - txtModelLayer.Text = saveFileDialog1.FileName; - } - } + /// /// 窗体初始化事件处理 /// @@ -100,49 +88,6 @@ } } } - - private object convertFieldValue(string fieldname, object obj) - { - if (obj == null) - return null; - - try - { - string type = fields_types[fieldname].ToString(); - switch (type) - { - case "string": - return obj.ToString(); - case "int": - //return 101; - int intResult; - if (int.TryParse(obj.ToString(), out intResult)) - return intResult; - else - return null; - case "double": - //return 202.5; - double doubleResult; - if (double.TryParse(obj.ToString(), out doubleResult)) - return doubleResult; - else - return null; - case "date": - DateTime dtResult; - if (DateTime.TryParse(obj.ToString(), out dtResult)) - return dtResult; - else - return null; - } - return null; - } - catch (Exception ex) - { - MessageBox.Show(ex.ToString()); - return null; - } - } - public string lgdFilePath = ""; /// /// 选择管线颜色 @@ -610,33 +555,6 @@ { this.Close(); } - - private void cmbLayer_SelectedIndexChanged(object sender, EventArgs e) //选择图层 - { - GSOLayer layer = ctl.Globe.Layers.GetLayerByCaption(selectLayerName); - GSOFeatures features = layer.GetAllFeatures(); - if (features.Length == 0) - return; - - cmbFrom.Items.Clear(); - cmbTo.Items.Clear(); - cmbRadius.Items.Clear(); - cmbID.Items.Clear(); - for (int i = 0; i < features[0].GetFieldCount(); i++) - { - GeoScene.Data.GSOFieldDefn fielddef = (GeoScene.Data.GSOFieldDefn)(features[0].GetFieldDefn(i)); - - cmbFrom.Items.Add(fielddef.Name); - cmbTo.Items.Add(fielddef.Name); - cmbRadius.Items.Add(fielddef.Name); - cmbID.Items.Add(fielddef.Name); - } - cmbFrom.SelectedItem = "Deep1"; - cmbTo.SelectedItem = "Deep2"; - cmbRadius.SelectedItem = "Diameter"; - cmbID.SelectedItem = "Handle"; - } - private void buttonXLayerPath_Click(object sender, EventArgs e)//单击 选择shp格式的文件 { OpenFileDialog dlg = new OpenFileDialog(); diff --git a/Forms/FrmPipelineModelDataOneStep.cs b/Forms/FrmPipelineModelDataOneStep.cs index 18afda7..ec93b8a 100644 --- a/Forms/FrmPipelineModelDataOneStep.cs +++ b/Forms/FrmPipelineModelDataOneStep.cs @@ -38,19 +38,7 @@ layerTree = _layerTree; InitializeComponent(); } - /// - /// 单击选择shp格式文件 - /// - /// - /// - private void btnBrowseModel_Click(object sender, EventArgs e) - { - saveFileDialog1.Filter = "*.lgd|*.lgd"; - if (saveFileDialog1.ShowDialog() == DialogResult.OK) - { - txtModelLayer.Text = saveFileDialog1.FileName; - } - } + /// /// 窗体初始化事件处理 /// @@ -107,48 +95,7 @@ } } - private object convertFieldValue(string fieldname, object obj) - { - if (obj == null) - return null; - - try - { - string type = fields_types[fieldname].ToString(); - switch (type) - { - case "string": - return obj.ToString(); - case "int": - //return 101; - int intResult; - if (int.TryParse(obj.ToString(), out intResult)) - return intResult; - else - return null; - case "double": - //return 202.5; - double doubleResult; - if (double.TryParse(obj.ToString(), out doubleResult)) - return doubleResult; - else - return null; - case "date": - DateTime dtResult; - if (DateTime.TryParse(obj.ToString(), out dtResult)) - return dtResult; - else - return null; - } - return null; - } - catch (Exception ex) - { - MessageBox.Show(ex.ToString()); - return null; - } - } - + public string lgdFilePath = ""; /// /// 选择管线颜色 @@ -673,32 +620,6 @@ return featDs; } - private void cmbLayer_SelectedIndexChanged(object sender, EventArgs e) //选择图层 - { - GSOLayer layer = ctl.Globe.Layers.GetLayerByCaption(selectLayerName); - GSOFeatures features = layer.GetAllFeatures(); - if (features.Length == 0) - return; - - cmbFrom.Items.Clear(); - cmbTo.Items.Clear(); - cmbRadius.Items.Clear(); - cmbID.Items.Clear(); - for (int i = 0; i < features[0].GetFieldCount(); i++) - { - GeoScene.Data.GSOFieldDefn fielddef = (GeoScene.Data.GSOFieldDefn)(features[0].GetFieldDefn(i)); - - cmbFrom.Items.Add(fielddef.Name); - cmbTo.Items.Add(fielddef.Name); - cmbRadius.Items.Add(fielddef.Name); - cmbID.Items.Add(fielddef.Name); - } - cmbFrom.SelectedItem = "Deep1"; - cmbTo.SelectedItem = "Deep2"; - cmbRadius.SelectedItem = "Diameter"; - cmbID.SelectedItem = "Handle"; - } - private void buttonXLayerPath_Click(object sender, EventArgs e)//单击 选择shp格式的文件 { OpenFileDialog dlg = new OpenFileDialog(); @@ -949,38 +870,6 @@ } //txtLayername.Text = type + layername; } - /// - /// 连接数据库 - /// - /// - /// - private void buttonX1_Click(object sender, EventArgs e) - { - if (ds == null) - { - //没连的话,直接连接审核库; //审核库配置读配置文件 - string dbIp = Utility.sgdbip; - string database = Utility.sgdbname; - string user = Utility.sgdbuser; - string pass = Utility.sgdbpwd; - - if (!Utility.isNetworkConnectionSuccess(dbIp.Trim())) - { - MessageBox.Show("网络连接失败!", "提示"); - return; - } - - ds = ctl.Globe.DataManager.OpenOracleDataSource(dbIp + "/" + database, "", "", user, pass); - if (ds == null) - { - MessageBox.Show("数据库连接失败!", "提示", MessageBoxButtons.OK, MessageBoxIcon.Warning); - } - else - { - btnCreateModel.Enabled = true; - } - } - } private void btnClose_Click(object sender, EventArgs e) { diff --git a/Forms/FrmShRK.cs b/Forms/FrmShRK.cs index 0e2e722..f1d83cb 100644 --- a/Forms/FrmShRK.cs +++ b/Forms/FrmShRK.cs @@ -215,6 +215,7 @@ { sourcefeatds = sourcefeat as GSOFeatureDataset; } + if (sourcefeatds == null) return; sourcefeatds.Open(); GSOFeatures sourcefeatures = sourcefeatds.GetAllFeatures(); @@ -251,6 +252,7 @@ { desfeatds = desfeat as GSOFeatureDataset; } + if (desfeatds == null) return; desfeatds.Open(); //向新数据集写入字段 diff --git a/FrmAccessoriesSensor.cs b/FrmAccessoriesSensor.cs index 09fcdf1..2a7a80e 100644 --- a/FrmAccessoriesSensor.cs +++ b/FrmAccessoriesSensor.cs @@ -209,7 +209,7 @@ chart1.Series[0].Points.DataBindXY(dic.Keys, dic.Values); for (int m = 0; m < dic.Values.Count; m++) { - if (chart1.Series[0].Points[m].YValues[0].ToString() != "0") + if (chart1.Series[0].Points[m]!=null&&chart1.Series[0].Points[m].YValues[0].ToString() != "0") { chart1.Series[0].Points[m].Label = chart1.Series[0].Points[m].YValues[0].ToString(); } diff --git a/FrmAccessoriesgather.cs b/FrmAccessoriesgather.cs index 9e331e1..a475d9e 100644 --- a/FrmAccessoriesgather.cs +++ b/FrmAccessoriesgather.cs @@ -338,7 +338,7 @@ chart1.Series[0].Points.DataBindXY(dic.Keys, dic.Values); for (int m = 0; m < dic.Values.Count; m++) { - if (chart1.Series[0].Points[m].YValues[0].ToString() != "0") + if (chart1.Series[0].Points[m]!=null&&chart1.Series[0].Points[m].YValues[0].ToString() != "0") { chart1.Series[0].Points[m].Label = chart1.Series[0].Points[m].YValues[0].ToString(); } diff --git a/FrmAccessoryAnalysis.cs b/FrmAccessoryAnalysis.cs index 71d4579..44d4065 100644 --- a/FrmAccessoryAnalysis.cs +++ b/FrmAccessoryAnalysis.cs @@ -66,39 +66,6 @@ globeControl1.Refresh(); } /// - /// 键盘按键按下事件处理 - /// - /// - /// - private void txtRadius_KeyPress(object sender, KeyPressEventArgs e) - { - TextBox text = sender as TextBox; - if ((e.KeyChar < 48 || e.KeyChar > 57) && (e.KeyChar != 8) && (int)e.KeyChar != 46) - { - e.Handled = true; - } - if ((int)e.KeyChar == 46) //小数点 - { - if (text.Text.Length <= 0) - e.Handled = true; //小数点不能在第一位 - else //处理不规则的小数点 - { - float f; - float oldf; - bool b1 = false, b2 = false; - b1 = float.TryParse(text.Text, out oldf); - b2 = float.TryParse(text.Text + e.KeyChar.ToString(), out f); - if (b2 == false) - { - if (b1 == true) - e.Handled = true; - else - e.Handled = false; - } - } - } - } - /// /// 确定按钮事件处理 /// /// diff --git a/FrmAddValve.cs b/FrmAddValve.cs index 34d2fec..5f405b9 100644 --- a/FrmAddValve.cs +++ b/FrmAddValve.cs @@ -486,56 +486,6 @@ } } - - - - - - - - private void cmbLayer_SelectedIndexChanged(object sender, EventArgs e) - { - GSOLayer layer = globeControl1.Globe.Layers.GetLayerByCaption(selectLayerName); - GSOFeatures features = layer.GetAllFeatures(); - if (features.Length == 0) - return; - - combPath.Items.Clear(); - combZ.Items.Clear(); - combModelName.Items.Clear(); - - for (int i = 0; i < features[0].GetFieldCount(); i++) - { - GeoScene.Data.GSOFieldDefn fielddef = (GeoScene.Data.GSOFieldDefn)(features[0].GetFieldDefn(i)); - combPath.Items.Add(fielddef.Name); - combZ.Items.Add(fielddef.Name); - combModelName.Items.Add(fielddef.Name); - } - combModelName.SelectedItem = "编号"; - combPath.SelectedItem = "模型路径"; - if (combfile.SelectedIndex != -1) - { - - string layerCaption = combfile.SelectedItem.ToString().Trim(); - rukuLayer = globeControl1.Globe.Layers.GetLayerByCaption(layerCaption); - if (rukuLayer != null) - { - combPath.Items.Clear(); - combZ.Items.Clear(); - combModelName.Items.Clear(); - - } - for (int i = 0; i < features[0].GetFieldCount(); i++) - { - GeoScene.Data.GSOFieldDefn fielddef = (GeoScene.Data.GSOFieldDefn)(features[0].GetFieldDefn(i)); - combPath.Items.Add(fielddef.Name); - combZ.Items.Add(fielddef.Name); - combModelName.Items.Add(fielddef.Name); - } - combModelName.SelectedItem = "编号"; - combPath.SelectedItem = "模型路径"; - } - } /// /// 单击选择shp格式文件 /// diff --git a/FrmAddWellShp.cs b/FrmAddWellShp.cs index bb79ec0..a249725 100644 --- a/FrmAddWellShp.cs +++ b/FrmAddWellShp.cs @@ -478,32 +478,6 @@ } } } - - private void cmbLayer_SelectedIndexChanged(object sender, EventArgs e) - { - GSOLayer layer = globeControl1.Globe.Layers.GetLayerByCaption(selectLayerName); - GSOFeatures features = layer.GetAllFeatures(); - if (features.Length == 0) - return; - - combCode.Items.Clear(); - combDeep.Items.Clear(); - combModelName.Items.Clear(); - combAngle.Items.Clear(); - - for (int i = 0; i < features[0].GetFieldCount(); i++) - { - GeoScene.Data.GSOFieldDefn fielddef = (GeoScene.Data.GSOFieldDefn)(features[0].GetFieldDefn(i)); - combCode.Items.Add(fielddef.Name); - combDeep.Items.Add(fielddef.Name); - combModelName.Items.Add(fielddef.Name); - combAngle.Items.Add(fielddef.Name); - } - combCode.SelectedItem = "附属物编码"; - combDeep.SelectedItem = "井深"; - combModelName.SelectedItem = "编号"; - combAngle.SelectedItem = "符号角度"; - } /// /// 单击选择shp格式文件 /// diff --git a/FrmAddYuBiZiShp.cs b/FrmAddYuBiZiShp.cs index b312d51..332f037 100644 --- a/FrmAddYuBiZiShp.cs +++ b/FrmAddYuBiZiShp.cs @@ -383,80 +383,7 @@ } } - private void cmbLayer_SelectedIndexChanged(object sender, EventArgs e) - { - GSOLayer layer = globeControl1.Globe.Layers.GetLayerByCaption(selectLayerName); - GSOFeatures features = layer.GetAllFeatures(); - if (features.Length == 0) - return; - - combCode.Items.Clear(); - combDeep.Items.Clear(); - combModelName.Items.Clear(); - //comboLoad.Items.Clear(); - for (int i = 0; i < features[0].GetFieldCount(); i++) - { - GeoScene.Data.GSOFieldDefn fielddef = (GeoScene.Data.GSOFieldDefn)(features[0].GetFieldDefn(i)); - combCode.Items.Add(fielddef.Name); - combDeep.Items.Add(fielddef.Name); - combModelName.Items.Add(fielddef.Name); - //comboLoad.Items.Add(fielddef.Name); - } - combCode.SelectedItem = "附属物编码"; - combDeep.SelectedItem = "Z坐标"; - combModelName.SelectedItem = "编号"; - //comboLoad.SelectedItem = "模型路径"; - } - - private void buttonXLayerPath_Click(object sender, EventArgs e) - { - OpenFileDialog dlg = new OpenFileDialog(); - dlg.Filter = "*.shp|*.shp"; - dlg.Multiselect = false; - if (dlg.ShowDialog() == DialogResult.OK) - { - GSOLayer layer = globeControl1.Globe.Layers.Add(dlg.FileName); - string txtMessage = valiYBdata(layer); - if (txtMessage != "") - { - button3.Enabled = false; - //textBoxLayer.Text = ""; - combCode.Items.Clear(); - combDeep.Items.Clear(); - combModelName.Items.Clear(); - globeControl1.Globe.Layers.Remove(layer); - FrmValiDataShowErrorMessage showErrorMessage = new FrmValiDataShowErrorMessage(dlg.FileName, txtMessage); - showErrorMessage.ShowDialog(); - return; - } - else - { - button3.Enabled = true; - //textBoxLayer.Text = dlg.FileName; - selectLayerName = layer.Caption; - txtLayerName.Text = layer.Caption; - GSOFeatures features = layer.GetAllFeatures(); - if (features.Length == 0) - return; - - combCode.Items.Clear(); - combDeep.Items.Clear(); - combModelName.Items.Clear(); - for (int i = 0; i < features[0].GetFieldCount(); i++) - { - GeoScene.Data.GSOFieldDefn fielddef = (GeoScene.Data.GSOFieldDefn)(features[0].GetFieldDefn(i)); - combCode.Items.Add(fielddef.Name); - combDeep.Items.Add(fielddef.Name); - combModelName.Items.Add(fielddef.Name); - //comboLoad.Items.Add(fielddef.Name); - } - combCode.SelectedItem = "管点编码"; - combDeep.SelectedItem = "Z坐标"; - combModelName.SelectedItem = "编号"; - } - } - } - + private void FrmAddYuBiZiShp_FormClosing(object sender, FormClosingEventArgs e) { globeControl1.Globe.Refresh(); diff --git a/FrmAllPipelineStatis.cs b/FrmAllPipelineStatis.cs index 6421a26..a6eea29 100644 --- a/FrmAllPipelineStatis.cs +++ b/FrmAllPipelineStatis.cs @@ -84,7 +84,7 @@ chartAllAreaPipeline.Series["管线"].Points.DataBindXY(pipelineLengthAndType.Keys, pipelineLengthAndType.Values); for (int m = 0; m < pipelineLengthAndType.Values.Count; m++) { - if (chartAllAreaPipeline.Series["管线"].Points[m].YValues[0].ToString() != "0") + if (chartAllAreaPipeline.Series["管线"].Points[m]!=null&&chartAllAreaPipeline.Series["管线"].Points[m].YValues[0].ToString() != "0") { chartAllAreaPipeline.Series["管线"].Points[m].Label = chartAllAreaPipeline.Series[0].Points[m].YValues[0].ToString(); } @@ -94,7 +94,7 @@ } catch (Exception ex) { - //LogError.PublishError(ex); + LogHelper.WriteLog(typeof(FrmAllPipelineStatis), ex.Message); } } @@ -147,7 +147,7 @@ } DataTable dt = OledbHelper.QueryTable(sql); - if (dt != null && dt.Rows.Count > 0) + if (dt != null && dt.Rows.Count > 0 && chartAllAreaPipeline.Series["管线"].Points[indexHit]!=null) { dataGridViewX1.DataSource = dt; panel.Visible = true; diff --git a/FrmAllWorkWellStatis.cs b/FrmAllWorkWellStatis.cs index 6fec7af..6af8e4c 100644 --- a/FrmAllWorkWellStatis.cs +++ b/FrmAllWorkWellStatis.cs @@ -52,7 +52,7 @@ chartAllAreaPipeline.Series["井盖"].Points.DataBindXY(workWellLengthAndType.Keys, workWellLengthAndType.Values); for (int m = 0; m < workWellLengthAndType.Values.Count; m++) { - if (chartAllAreaPipeline.Series["井盖"].Points[m].YValues[0].ToString().Trim() != "0") + if (chartAllAreaPipeline.Series["井盖"].Points[m]!=null&&chartAllAreaPipeline.Series["井盖"].Points[m].YValues[0].ToString().Trim() != "0") { chartAllAreaPipeline.Series["井盖"].Points[m].Label = chartAllAreaPipeline.Series[0].Points[m].YValues[0].ToString(); } @@ -60,7 +60,7 @@ } catch (Exception ex) { - //LogError.PublishError(ex); + LogHelper.WriteLog(typeof(FrmAllWorkWellStatis), ex.Message); } } diff --git a/FrmBSQDuoBianXingStatis.cs b/FrmBSQDuoBianXingStatis.cs index e8b7d52..3e889b6 100644 --- a/FrmBSQDuoBianXingStatis.cs +++ b/FrmBSQDuoBianXingStatis.cs @@ -60,7 +60,7 @@ { for (int m = 0; m < bsq1.Values.Count; m++) { - if (chart1.Series["标识器"].Points[m].YValues[0].ToString() != "0") + if (chart1.Series["标识器"].Points[m]!=null&&chart1.Series["标识器"].Points[m].YValues[0].ToString() != "0") { count += Convert.ToInt16(chart1.Series[0].Points[m].YValues[0].ToString()); chart1.Series["标识器"].Points[m].Label = chart1.Series[0].Points[m].YValues[0].ToString(); diff --git a/FrmBSQDuoBianXingStreet.cs b/FrmBSQDuoBianXingStreet.cs index 2005ebb..1db5777 100644 --- a/FrmBSQDuoBianXingStreet.cs +++ b/FrmBSQDuoBianXingStreet.cs @@ -63,7 +63,7 @@ chartStatis.Series[0].Points.DataBindXY(bsq.Keys, bsq.Values); for (int m = 0; m < bsq.Values.Count; m++) { - if (chartStatis.Series[0].Points[m].YValues[0].ToString().Trim() != "0") + if (chartStatis.Series[0].Points[m]!=null&&chartStatis.Series[0].Points[m].YValues[0].ToString().Trim() != "0") { count += Convert.ToInt16(chartStatis.Series[0].Points[m].YValues[0].ToString()); chartStatis.Series[0].Points[m].Label = chartStatis.Series[0].Points[m].YValues[0].ToString(); diff --git a/FrmBSQStatis.cs b/FrmBSQStatis.cs index 390a55c..4aa0ee6 100644 --- a/FrmBSQStatis.cs +++ b/FrmBSQStatis.cs @@ -95,6 +95,8 @@ } } } + + dr.Close(); conn.Close(); for (int i = 0; i < typeLists.Count; i++) { @@ -123,7 +125,7 @@ chartStatis.Series[0].Points.DataBindXY(bsq.Keys, bsq.Values); for (int m = 0; m < bsq.Values.Count; m++) { - if (chartStatis.Series[0].Points[m].YValues[0].ToString().Trim() != "0") + if (chartStatis.Series[0].Points[m]!=null&&chartStatis.Series[0].Points[m].YValues[0].ToString().Trim() != "0") { //count += Convert.ToInt16(chartStatis.Series[0].Points[m].YValues[0].ToString()); chartStatis.Series[0].Points[m].Label = chartStatis.Series[0].Points[m].YValues[0].ToString(); diff --git a/FrmBSQStreet.cs b/FrmBSQStreet.cs index 9d88adb..7fbacad 100644 --- a/FrmBSQStreet.cs +++ b/FrmBSQStreet.cs @@ -44,7 +44,7 @@ chartStatis.Series[0].Points.DataBindXY(bsq.Keys, bsq.Values); for (int m = 0; m < bsq.Values.Count; m++) { - if (chartStatis.Series[0].Points[m].YValues[0].ToString().Trim() != "0") + if (chartStatis.Series[0].Points[m]!=null&&chartStatis.Series[0].Points[m].YValues[0].ToString().Trim() != "0") { count += Convert.ToInt16(chartStatis.Series[0].Points[m].YValues[0].ToString()); chartStatis.Series[0].Points[m].Label = chartStatis.Series[0].Points[m].YValues[0].ToString(); diff --git a/FrmBoosterValvers.cs b/FrmBoosterValvers.cs index 5061efc..df9b62b 100644 --- a/FrmBoosterValvers.cs +++ b/FrmBoosterValvers.cs @@ -236,199 +236,6 @@ count = 0; } } - /// - /// 添加火苗 - /// - /// - /// - /// - /// - private GSOFeature AddFire(double x,double y,double z) - { - // 烟火示例 - - string strResPath = Application.StartupPath + "/Resource"; - - // 烟火粒子示例,由三个发射器构成 - GSOGeoParticle geoParticle = new GSOGeoParticle(); - geoParticle.SetPosition(x, y, z); // 添加到这个经纬度位置 - geoParticle.AltitudeMode = EnumAltitudeMode.RelativeToGround; - - GSORingParticleEmitter emitter = new GSORingParticleEmitter(); - emitter.TexturePath = strResPath + "/ParticleImage/flare.png"; - - emitter.SetSizeFix(1, 1); - emitter.VelFix = 1; - emitter.VelRnd = 5; - - emitter.AngleXYFix = 0; - emitter.AngleXYRnd = 180; - - emitter.AngleXZFix = 90; - emitter.AngleXZRnd = 0; - - emitter.LifeFix = 0.5f; - emitter.LifeRnd = 0.0f; - - emitter.RotFix = 0; - emitter.RotRnd = 0; - - emitter.RotVelFix = 0; - emitter.RotVelRnd = 0; - - emitter.EmitPerSec = 100; - - // 采用线性插值生成粒子的初始颜色 - emitter.ColorRndStart = Color.White; - emitter.ColorRndEnd = Color.Red; - - - GSOColorParticleEffector effector2 = new GSOColorParticleEffector(); - effector2.SetColorChanged(0, -1, -1, 0); - effector2.StartTime = 0.0f; - effector2.EndTime = -1.0f; - emitter.AddEffector(effector2); - - // 将三个发射器添加到粒子对象中 - geoParticle.AddEmitter(emitter); - - geoParticle.Play(); - - GSOFeature feature = new GSOFeature(); - - feature.Geometry = geoParticle; - - globeControl1.Globe.MemoryLayer.AddFeature(feature); - - - return feature; - } - - /// - /// 添加喷泉 - /// - /// - private GSOFeature AddFountain() - { - string strResPath = Application.StartupPath + "/Resource"; - - GSOGeoParticle geoParticle = new GSOGeoParticle(); - geoParticle.SetPosition(116.314, 39.84, 0); // 添加到这个经纬度位置 - - GSOPointParticleEmitter emitter = new GSOPointParticleEmitter(); - emitter.TexturePath = strResPath + "/ParticleImage/test.png"; - - emitter.SetSizeFix(0.5f, 2); - emitter.VelFix = 10; - emitter.VelRnd = 2; - - emitter.GravityAcc = 9.8f; - emitter.AngleXYFix = 0; - emitter.AngleXYRnd = 180; - - emitter.AngleXZFix = 88; - emitter.AngleXZRnd = 2; - - //emitter.InnerRadius = 0; - // emitter.OuterRadius = 0.03f; - - emitter.LifeFix = 5.0f; - emitter.LifeRnd = 1.0f; - - emitter.RotFix = 0; - emitter.RotRnd = 0; - - emitter.RotVelFix = 0; - emitter.RotVelRnd = 0; - - emitter.EmitPerSec = 1000; - emitter.ColorRndStart = Color.FromArgb(33, 255, 255, 255); - emitter.ColorRndEnd = Color.FromArgb(11, 255, 255, 255); - emitter.IsLumAdded = false; - - // 将三个发射器添加到粒子对象中 - geoParticle.AddEmitter(emitter); - - geoParticle.Play(); - GSOFeature feature = new GSOFeature(); - - feature.Geometry = geoParticle; - - //globeControl1.Globe.MemoryLayer.AddFeature(feature); - globeControl1.Globe.FlyToFeature(feature); - - return feature; - } - - /// - /// 添加水柱 - /// - /// - private GSOFeature AddWaterLine() - { - string strResPath = Application.StartupPath + "/Resource"; - - GSOGeoParticle geoParticle = new GSOGeoParticle(); - geoParticle.SetPosition(116.308, 39.84, 0); // 添加到这个经纬度位置 - - GSOPointParticleEmitter emitter = new GSOPointParticleEmitter(); - - emitter.TexturePath = strResPath + "/ParticleImage/drop3.png"; - - geoParticle.TimerInterval = 1; - - emitter.SetSizeFix(2.0f, 2.0f); - - emitter.VelFix = 50; - emitter.VelRnd = 2; - - // emitter.IsLumAdded = false; - - emitter.GravityAcc = 9.8f; - emitter.AngleXYFix = 0; - emitter.AngleXYRnd = 2; - - emitter.AngleXZFix = 60; - emitter.AngleXZRnd = 2; - - //emitter.InnerRadius = 0; - // emitter.OuterRadius = 0.1f; - - emitter.LifeFix = 5.0f; - emitter.LifeRnd = 1.0f; - - emitter.RotFix = 0; - emitter.RotRnd = 0; - - emitter.RotVelFix = 0; - emitter.RotVelRnd = 0; - - emitter.EmitPerSec = 1500; - - emitter.ColorRndStart = Color.FromArgb(100, 222, 222, 222); - emitter.ColorRndEnd = Color.FromArgb(50, 222, 222, 222); - - /* - - GSOScaleParticleEffector effector1 = new GSOScaleParticleEffector(); - effector1.SetScale(0.2f, 0.2f); - effector1.StartTime = 0; - effector1.EndTime = -1; // 负数表示整个粒子生命结束 - emitter.AddEffector(effector1); - */ - - // 将三个发射器添加到粒子对象中 - geoParticle.AddEmitter(emitter); - - geoParticle.Play(); - GSOFeature feature = new GSOFeature(); - - feature.Geometry = geoParticle; - - //globeControl1.Globe.MemoryLayer.AddFeature(feature); - globeControl1.Globe.FlyToFeature(feature); - - return feature; - } + } } diff --git a/FrmBufferAnalysis.cs b/FrmBufferAnalysis.cs index f711133..db8ca59 100644 --- a/FrmBufferAnalysis.cs +++ b/FrmBufferAnalysis.cs @@ -123,39 +123,6 @@ } } /// - /// 半径文本框的键盘按键按下事件处理 - /// - /// - /// - private void txtRadius_KeyPress(object sender, KeyPressEventArgs e) - { - TextBox text = sender as TextBox; - if ((e.KeyChar < 48 || e.KeyChar > 57) && (e.KeyChar != 8) && (int)e.KeyChar != 46) - { - e.Handled = true; - } - if ((int)e.KeyChar == 46) //小数点 - { - if (text.Text.Length <= 0) - e.Handled = true; //小数点不能在第一位 - else //处理不规则的小数点 - { - float f; - float oldf; - bool b1 = false, b2 = false; - b1 = float.TryParse(text.Text, out oldf); - b2 = float.TryParse(text.Text + e.KeyChar.ToString(), out f); - if (b2 == false) - { - if (b1 == true) - e.Handled = true; - else - e.Handled = false; - } - } - } - } - /// /// 窗体关闭事件处理 /// /// diff --git a/FrmBufferAnalysisBSQ.cs b/FrmBufferAnalysisBSQ.cs index 24a96ca..f54208f 100644 --- a/FrmBufferAnalysisBSQ.cs +++ b/FrmBufferAnalysisBSQ.cs @@ -137,35 +137,7 @@ } } - private void txtRadius_KeyPress(object sender, KeyPressEventArgs e) - { - TextBox text = sender as TextBox; - if ((e.KeyChar < 48 || e.KeyChar > 57) && (e.KeyChar != 8) && (int)e.KeyChar != 46) - { - e.Handled = true; - } - if ((int)e.KeyChar == 46) //小数点 - { - if (text.Text.Length <= 0) - e.Handled = true; //小数点不能在第一位 - else //处理不规则的小数点 - { - float f; - float oldf; - bool b1 = false, b2 = false; - b1 = float.TryParse(text.Text, out oldf); - b2 = float.TryParse(text.Text + e.KeyChar.ToString(), out f); - if (b2 == false) - { - if (b1 == true) - e.Handled = true; - else - e.Handled = false; - } - } - } - } - + private void FrmBufferAnalysis_FormClosing(object sender, FormClosingEventArgs e) { //Form1.y = 0; @@ -316,27 +288,6 @@ } } - private void FlyToMenu_Click(object sender, EventArgs e) - { - if (m_feature != null) - { - if (m_feature.Geometry != null && m_feature.Geometry.Type == EnumGeometryType.GeoPolyline3D) - { - GSOGeoPolyline3D line = m_feature.Geometry as GSOGeoPolyline3D; - double length = line.GetSpaceLength(true, 6378137); - GSOGeoPolyline3D lineLine = line.GetSegment(0, length / 2); - GSOPoint3d point3d = lineLine[lineLine.PartCount - 1][lineLine[lineLine.PartCount - 1].Count - 1]; - - globeControl1.Globe.FlyToPosition(point3d, EnumAltitudeMode.Absolute, 0, 45, 5); - } - else - { - globeControl1.Globe.FlyToFeature(m_feature, 0, 45, 3); - } - LightMenu_Click(sender, e); - } - } - private void LightMenu_Click(object sender, EventArgs e) { flashflag = "single"; diff --git a/FrmDataBaseOpt.cs b/FrmDataBaseOpt.cs index b0c4b5d..8d7b69d 100644 --- a/FrmDataBaseOpt.cs +++ b/FrmDataBaseOpt.cs @@ -362,6 +362,7 @@ dbCombor.Items.Add(dblist[i].title); } } + /* /// /// 从配置文件读取数据库参数配置 /// @@ -428,6 +429,8 @@ } } + * */ + /* /// /// 向配置文件写入连接数据库的参数配置 /// @@ -485,6 +488,7 @@ MessageBox.Show(exp.ToString()); } } + * */ /// /// /// diff --git a/FrmDatabaseParaSetting.cs b/FrmDatabaseParaSetting.cs index a6fea46..63b596b 100644 --- a/FrmDatabaseParaSetting.cs +++ b/FrmDatabaseParaSetting.cs @@ -152,6 +152,7 @@ this.DialogResult = DialogResult.OK; this.Close(); } + /* /// /// 从配置文件读取数据库连接参数配置 /// @@ -218,6 +219,8 @@ } } + * */ + /* /// /// 向配置文件写入数据库参数配置 /// @@ -276,7 +279,7 @@ MessageBox.Show(ex.ToString()); } } - + */ /// /// 取消按钮事件处理 /// diff --git a/FrmDatabaseParaSetting2.cs b/FrmDatabaseParaSetting2.cs index 932d05e..96a87d5 100644 --- a/FrmDatabaseParaSetting2.cs +++ b/FrmDatabaseParaSetting2.cs @@ -148,6 +148,7 @@ this.DialogResult = DialogResult.OK; this.Close(); } + /* /// /// 从配置文件读取数据库连接参数配置 /// @@ -214,6 +215,8 @@ } } + * */ + /* /// /// 向配置文件写入数据库参数配置 /// @@ -272,7 +275,7 @@ MessageBox.Show(exp.ToString()); } } - + */ /// /// 取消按钮事件处理 /// diff --git a/FrmDiameterQuery.cs b/FrmDiameterQuery.cs index 68c948b..9a5215b 100644 --- a/FrmDiameterQuery.cs +++ b/FrmDiameterQuery.cs @@ -77,18 +77,7 @@ isBetween = true; } } - /// - /// 键盘按键按下事件处理 - /// - /// - /// - private void textBoxX1_KeyPress(object sender, KeyPressEventArgs e) - { - if ((e.KeyChar < 48 || e.KeyChar > 57) && e.KeyChar != 8) - { - e.Handled = true;//屏蔽 - } - } + bool isBetween = false; /// diff --git a/FrmDocumentEdit.cs b/FrmDocumentEdit.cs index aab2d31..e78a7ff 100644 --- a/FrmDocumentEdit.cs +++ b/FrmDocumentEdit.cs @@ -256,121 +256,6 @@ } - // - /// 将本地文件上传到指定的服务器(HttpWebRequest方法) - /// - /// 文件上传到的服务器 - /// 要上传的本地文件(全路径) - /// 文件上传后的名称 - /// 上传进度条 - /// 成功返回1,失败返回0 - private int Upload_Request(string address, string fileNamePath, string saveName, ProgressBar progressBar) - { - int returnValue = 0; - // 要上传的文件 - FileStream fs = new FileStream(fileNamePath, FileMode.Open, FileAccess.Read); - BinaryReader r = new BinaryReader(fs); - //时间戳 - string strBoundary = "----------" + DateTime.Now.Ticks.ToString("x"); - byte[] boundaryBytes = Encoding.ASCII.GetBytes("/r/n--" + strBoundary + "/r/n"); - //请求头部信息 - StringBuilder sb = new StringBuilder(); - sb.Append("--"); - sb.Append(strBoundary); - sb.Append("\r\n"); - sb.Append("Content-Disposition: form-data; name=\""); - sb.Append("file"); - sb.Append("\"; filename=\""); - sb.Append(saveName); - sb.Append("\""); - sb.Append("\r\n"); - sb.Append("Content-Type: "); - sb.Append("application/octet-stream"); - sb.Append("\r\n"); - sb.Append("\r\n"); - string strPostHeader = sb.ToString(); - byte[] postHeaderBytes = Encoding.UTF8.GetBytes(strPostHeader); - // 根据uri创建HttpWebRequest对象 - HttpWebRequest httpReq = (HttpWebRequest)WebRequest.Create(new Uri(address)); - httpReq.Method = "POST"; - //对发送的数据不使用缓存 - httpReq.AllowWriteStreamBuffering = false; - //设置获得响应的超时时间(300秒) - httpReq.Timeout = 300000; - httpReq.ContentType = "multipart/form-data; boundary=" + strBoundary; - long length = fs.Length + postHeaderBytes.Length + boundaryBytes.Length; - long fileLength = fs.Length; - httpReq.ContentLength = length; - try - { - progressBar.Maximum = int.MaxValue; - progressBar.Minimum = 0; - progressBar.Value = 0; - //每次上传4k - int bufferLength = 4096; - byte[] buffer = new byte[bufferLength]; - //已上传的字节数 - long offset = 0; - //开始上传时间 - DateTime startTime = DateTime.Now; - int size = r.Read(buffer, 0, bufferLength); - Stream postStream = httpReq.GetRequestStream(); - //发送请求头部消息 - postStream.Write(postHeaderBytes, 0, postHeaderBytes.Length); - while (size > 0) - { - postStream.Write(buffer, 0, size); - offset += size; - progressBar.Value = (int)(offset * (int.MaxValue / length)); - TimeSpan span = DateTime.Now - startTime; - double second = span.TotalSeconds; - //lblTime.Text = "已用时:" + second.ToString("F2") + "秒"; - //if (second > 0.001) - //{ - // lblSpeed.Text = " 平均速度:" + (offset / 1024 / second).ToString("0.00") + "KB/秒"; - //} - //else - //{ - // lblSpeed.Text = " 正在连接…"; - //} - //lblState.Text = "已上传:" + (offset * 100.0 / length).ToString("F2") + "%"; - //lblSize.Text = (offset / 1048576.0).ToString("F2") + "M/" + (fileLength / 1048576.0).ToString("F2") + "M"; - Application.DoEvents(); - size = r.Read(buffer, 0, bufferLength); - } - //添加尾部的时间戳 - postStream.Write(boundaryBytes, 0, boundaryBytes.Length); - postStream.Close(); - //获取服务器端的响应 - WebResponse webRespon = httpReq.GetResponse(); - Stream s = webRespon.GetResponseStream(); - StreamReader sr = new StreamReader(s); - //读取服务器端返回的消息 - String sReturnString = sr.ReadLine(); - s.Close(); - sr.Close(); - if (sReturnString == "Success") - { - returnValue = 1; - } - else if (sReturnString == "Error") - { - returnValue = 0; - } - } - catch(Exception ex) - { - returnValue = 0; - string str = ex.ToString(); - } - finally - { - fs.Close(); - r.Close(); - } - return returnValue; - } - private void btn_file_Click(object sender, EventArgs e) { OpenFileDialog dlg = new OpenFileDialog(); diff --git a/Cyberpipe.csproj b/Cyberpipe.csproj index 07a8c1a..e3cd12c 100644 --- a/Cyberpipe.csproj +++ b/Cyberpipe.csproj @@ -204,25 +204,6 @@ - - Form - - - F_GKT1数据输入输出.cs - - - Form - - - F_GKT1添加文件.cs - - - Form - - - F_GKT1添加项目.cs - - Form @@ -1068,18 +1049,6 @@ Frm_password_reset.cs - - Form - - - GKT.cs - - - Form - - - GKT1.cs - Form @@ -1258,12 +1227,6 @@ F_Projedit.cs - - Form - - - PED.cs - Form @@ -1331,16 +1294,6 @@ True Reference.map - - F_GKT1数据输入输出.cs - Designer - - - F_GKT1添加文件.cs - - - F_GKT1添加项目.cs - Form_EditTask.cs @@ -1836,12 +1789,6 @@ Frm_password_reset.cs - - GKT.cs - - - GKT1.cs - F_GKT数据输入输出.cs @@ -1934,9 +1881,6 @@ F_Projedit.cs - - PED.cs - F_数据输入输出.cs diff --git a/Cyberpipe.suo b/Cyberpipe.suo index 68ced4f..a1aecf8 100644 --- a/Cyberpipe.suo +++ b/Cyberpipe.suo Binary files differ diff --git a/EMS_Forms/Form_EditTask.cs b/EMS_Forms/Form_EditTask.cs index 718992f..f1d791f 100644 --- a/EMS_Forms/Form_EditTask.cs +++ b/EMS_Forms/Form_EditTask.cs @@ -119,7 +119,8 @@ String name = Convert.ToString(dr["USERNAME"]); comboBox_userName.Items.Add(name); - } + } + dr.Close(); comboBox_road.Items.Clear(); roadList = new List(); @@ -135,7 +136,7 @@ comboBox_road.Items.Add(name); } } - + dr1.Close(); conn.Close(); bool flag2 = false; @@ -185,7 +186,7 @@ catch (Exception ex) { - MessageBox.Show(ex.ToString()); + LogHelper.WriteLog(typeof(Form_EditTask), ex.Message); } } @@ -288,7 +289,7 @@ } catch (Exception ex) { - MessageBox.Show(ex.ToString()); + LogHelper.WriteLog(typeof(Form_EditTask), ex.Message); } } @@ -474,7 +475,7 @@ } catch (Exception ex) { - MessageBox.Show(ex.ToString()); + LogHelper.WriteLog(typeof(Form_EditTask), ex.Message); } this.Close(); @@ -495,6 +496,7 @@ { numList.Add(Convert.ToInt32(dr["DBID"])); } + dr.Close(); if (numList.Count == 0) { taskNumber = Convert.ToInt32(number) * 100; @@ -674,6 +676,7 @@ } } } + dr.Close(); conn.Close(); } diff --git a/EMS_Forms/Form_EventManager.cs b/EMS_Forms/Form_EventManager.cs index b18c45b..84807b2 100644 --- a/EMS_Forms/Form_EventManager.cs +++ b/EMS_Forms/Form_EventManager.cs @@ -64,6 +64,7 @@ comboBox_name.Items.Add(name); } + dr.Close(); conn.Close(); diff --git a/Forms/FrmMnModify.cs b/Forms/FrmMnModify.cs index 31cfc5f..d036360 100644 --- a/Forms/FrmMnModify.cs +++ b/Forms/FrmMnModify.cs @@ -68,15 +68,7 @@ questionGrid.Rows[idx].Cells[1].Value = sr.question; } } - /// 选中对象 - /// - /// - /// - /// - private void buttonX1_Click(object sender, EventArgs e) - { - globecontrol.Globe.Action = EnumAction3D.SelectObject; - } + /// /// 选中某一行 /// diff --git a/Forms/FrmPipelineModelDataBase.cs b/Forms/FrmPipelineModelDataBase.cs index 2acf0ca..7ce573f 100644 --- a/Forms/FrmPipelineModelDataBase.cs +++ b/Forms/FrmPipelineModelDataBase.cs @@ -35,19 +35,7 @@ ds = _ds; InitializeComponent(); } - /// - /// 单击选择shp格式文件 - /// - /// - /// - private void btnBrowseModel_Click(object sender, EventArgs e) - { - saveFileDialog1.Filter = "*.lgd|*.lgd"; - if (saveFileDialog1.ShowDialog() == DialogResult.OK) - { - txtModelLayer.Text = saveFileDialog1.FileName; - } - } + /// /// 窗体初始化事件处理 /// @@ -100,49 +88,6 @@ } } } - - private object convertFieldValue(string fieldname, object obj) - { - if (obj == null) - return null; - - try - { - string type = fields_types[fieldname].ToString(); - switch (type) - { - case "string": - return obj.ToString(); - case "int": - //return 101; - int intResult; - if (int.TryParse(obj.ToString(), out intResult)) - return intResult; - else - return null; - case "double": - //return 202.5; - double doubleResult; - if (double.TryParse(obj.ToString(), out doubleResult)) - return doubleResult; - else - return null; - case "date": - DateTime dtResult; - if (DateTime.TryParse(obj.ToString(), out dtResult)) - return dtResult; - else - return null; - } - return null; - } - catch (Exception ex) - { - MessageBox.Show(ex.ToString()); - return null; - } - } - public string lgdFilePath = ""; /// /// 选择管线颜色 @@ -610,33 +555,6 @@ { this.Close(); } - - private void cmbLayer_SelectedIndexChanged(object sender, EventArgs e) //选择图层 - { - GSOLayer layer = ctl.Globe.Layers.GetLayerByCaption(selectLayerName); - GSOFeatures features = layer.GetAllFeatures(); - if (features.Length == 0) - return; - - cmbFrom.Items.Clear(); - cmbTo.Items.Clear(); - cmbRadius.Items.Clear(); - cmbID.Items.Clear(); - for (int i = 0; i < features[0].GetFieldCount(); i++) - { - GeoScene.Data.GSOFieldDefn fielddef = (GeoScene.Data.GSOFieldDefn)(features[0].GetFieldDefn(i)); - - cmbFrom.Items.Add(fielddef.Name); - cmbTo.Items.Add(fielddef.Name); - cmbRadius.Items.Add(fielddef.Name); - cmbID.Items.Add(fielddef.Name); - } - cmbFrom.SelectedItem = "Deep1"; - cmbTo.SelectedItem = "Deep2"; - cmbRadius.SelectedItem = "Diameter"; - cmbID.SelectedItem = "Handle"; - } - private void buttonXLayerPath_Click(object sender, EventArgs e)//单击 选择shp格式的文件 { OpenFileDialog dlg = new OpenFileDialog(); diff --git a/Forms/FrmPipelineModelDataOneStep.cs b/Forms/FrmPipelineModelDataOneStep.cs index 18afda7..ec93b8a 100644 --- a/Forms/FrmPipelineModelDataOneStep.cs +++ b/Forms/FrmPipelineModelDataOneStep.cs @@ -38,19 +38,7 @@ layerTree = _layerTree; InitializeComponent(); } - /// - /// 单击选择shp格式文件 - /// - /// - /// - private void btnBrowseModel_Click(object sender, EventArgs e) - { - saveFileDialog1.Filter = "*.lgd|*.lgd"; - if (saveFileDialog1.ShowDialog() == DialogResult.OK) - { - txtModelLayer.Text = saveFileDialog1.FileName; - } - } + /// /// 窗体初始化事件处理 /// @@ -107,48 +95,7 @@ } } - private object convertFieldValue(string fieldname, object obj) - { - if (obj == null) - return null; - - try - { - string type = fields_types[fieldname].ToString(); - switch (type) - { - case "string": - return obj.ToString(); - case "int": - //return 101; - int intResult; - if (int.TryParse(obj.ToString(), out intResult)) - return intResult; - else - return null; - case "double": - //return 202.5; - double doubleResult; - if (double.TryParse(obj.ToString(), out doubleResult)) - return doubleResult; - else - return null; - case "date": - DateTime dtResult; - if (DateTime.TryParse(obj.ToString(), out dtResult)) - return dtResult; - else - return null; - } - return null; - } - catch (Exception ex) - { - MessageBox.Show(ex.ToString()); - return null; - } - } - + public string lgdFilePath = ""; /// /// 选择管线颜色 @@ -673,32 +620,6 @@ return featDs; } - private void cmbLayer_SelectedIndexChanged(object sender, EventArgs e) //选择图层 - { - GSOLayer layer = ctl.Globe.Layers.GetLayerByCaption(selectLayerName); - GSOFeatures features = layer.GetAllFeatures(); - if (features.Length == 0) - return; - - cmbFrom.Items.Clear(); - cmbTo.Items.Clear(); - cmbRadius.Items.Clear(); - cmbID.Items.Clear(); - for (int i = 0; i < features[0].GetFieldCount(); i++) - { - GeoScene.Data.GSOFieldDefn fielddef = (GeoScene.Data.GSOFieldDefn)(features[0].GetFieldDefn(i)); - - cmbFrom.Items.Add(fielddef.Name); - cmbTo.Items.Add(fielddef.Name); - cmbRadius.Items.Add(fielddef.Name); - cmbID.Items.Add(fielddef.Name); - } - cmbFrom.SelectedItem = "Deep1"; - cmbTo.SelectedItem = "Deep2"; - cmbRadius.SelectedItem = "Diameter"; - cmbID.SelectedItem = "Handle"; - } - private void buttonXLayerPath_Click(object sender, EventArgs e)//单击 选择shp格式的文件 { OpenFileDialog dlg = new OpenFileDialog(); @@ -949,38 +870,6 @@ } //txtLayername.Text = type + layername; } - /// - /// 连接数据库 - /// - /// - /// - private void buttonX1_Click(object sender, EventArgs e) - { - if (ds == null) - { - //没连的话,直接连接审核库; //审核库配置读配置文件 - string dbIp = Utility.sgdbip; - string database = Utility.sgdbname; - string user = Utility.sgdbuser; - string pass = Utility.sgdbpwd; - - if (!Utility.isNetworkConnectionSuccess(dbIp.Trim())) - { - MessageBox.Show("网络连接失败!", "提示"); - return; - } - - ds = ctl.Globe.DataManager.OpenOracleDataSource(dbIp + "/" + database, "", "", user, pass); - if (ds == null) - { - MessageBox.Show("数据库连接失败!", "提示", MessageBoxButtons.OK, MessageBoxIcon.Warning); - } - else - { - btnCreateModel.Enabled = true; - } - } - } private void btnClose_Click(object sender, EventArgs e) { diff --git a/Forms/FrmShRK.cs b/Forms/FrmShRK.cs index 0e2e722..f1d83cb 100644 --- a/Forms/FrmShRK.cs +++ b/Forms/FrmShRK.cs @@ -215,6 +215,7 @@ { sourcefeatds = sourcefeat as GSOFeatureDataset; } + if (sourcefeatds == null) return; sourcefeatds.Open(); GSOFeatures sourcefeatures = sourcefeatds.GetAllFeatures(); @@ -251,6 +252,7 @@ { desfeatds = desfeat as GSOFeatureDataset; } + if (desfeatds == null) return; desfeatds.Open(); //向新数据集写入字段 diff --git a/FrmAccessoriesSensor.cs b/FrmAccessoriesSensor.cs index 09fcdf1..2a7a80e 100644 --- a/FrmAccessoriesSensor.cs +++ b/FrmAccessoriesSensor.cs @@ -209,7 +209,7 @@ chart1.Series[0].Points.DataBindXY(dic.Keys, dic.Values); for (int m = 0; m < dic.Values.Count; m++) { - if (chart1.Series[0].Points[m].YValues[0].ToString() != "0") + if (chart1.Series[0].Points[m]!=null&&chart1.Series[0].Points[m].YValues[0].ToString() != "0") { chart1.Series[0].Points[m].Label = chart1.Series[0].Points[m].YValues[0].ToString(); } diff --git a/FrmAccessoriesgather.cs b/FrmAccessoriesgather.cs index 9e331e1..a475d9e 100644 --- a/FrmAccessoriesgather.cs +++ b/FrmAccessoriesgather.cs @@ -338,7 +338,7 @@ chart1.Series[0].Points.DataBindXY(dic.Keys, dic.Values); for (int m = 0; m < dic.Values.Count; m++) { - if (chart1.Series[0].Points[m].YValues[0].ToString() != "0") + if (chart1.Series[0].Points[m]!=null&&chart1.Series[0].Points[m].YValues[0].ToString() != "0") { chart1.Series[0].Points[m].Label = chart1.Series[0].Points[m].YValues[0].ToString(); } diff --git a/FrmAccessoryAnalysis.cs b/FrmAccessoryAnalysis.cs index 71d4579..44d4065 100644 --- a/FrmAccessoryAnalysis.cs +++ b/FrmAccessoryAnalysis.cs @@ -66,39 +66,6 @@ globeControl1.Refresh(); } /// - /// 键盘按键按下事件处理 - /// - /// - /// - private void txtRadius_KeyPress(object sender, KeyPressEventArgs e) - { - TextBox text = sender as TextBox; - if ((e.KeyChar < 48 || e.KeyChar > 57) && (e.KeyChar != 8) && (int)e.KeyChar != 46) - { - e.Handled = true; - } - if ((int)e.KeyChar == 46) //小数点 - { - if (text.Text.Length <= 0) - e.Handled = true; //小数点不能在第一位 - else //处理不规则的小数点 - { - float f; - float oldf; - bool b1 = false, b2 = false; - b1 = float.TryParse(text.Text, out oldf); - b2 = float.TryParse(text.Text + e.KeyChar.ToString(), out f); - if (b2 == false) - { - if (b1 == true) - e.Handled = true; - else - e.Handled = false; - } - } - } - } - /// /// 确定按钮事件处理 /// /// diff --git a/FrmAddValve.cs b/FrmAddValve.cs index 34d2fec..5f405b9 100644 --- a/FrmAddValve.cs +++ b/FrmAddValve.cs @@ -486,56 +486,6 @@ } } - - - - - - - - private void cmbLayer_SelectedIndexChanged(object sender, EventArgs e) - { - GSOLayer layer = globeControl1.Globe.Layers.GetLayerByCaption(selectLayerName); - GSOFeatures features = layer.GetAllFeatures(); - if (features.Length == 0) - return; - - combPath.Items.Clear(); - combZ.Items.Clear(); - combModelName.Items.Clear(); - - for (int i = 0; i < features[0].GetFieldCount(); i++) - { - GeoScene.Data.GSOFieldDefn fielddef = (GeoScene.Data.GSOFieldDefn)(features[0].GetFieldDefn(i)); - combPath.Items.Add(fielddef.Name); - combZ.Items.Add(fielddef.Name); - combModelName.Items.Add(fielddef.Name); - } - combModelName.SelectedItem = "编号"; - combPath.SelectedItem = "模型路径"; - if (combfile.SelectedIndex != -1) - { - - string layerCaption = combfile.SelectedItem.ToString().Trim(); - rukuLayer = globeControl1.Globe.Layers.GetLayerByCaption(layerCaption); - if (rukuLayer != null) - { - combPath.Items.Clear(); - combZ.Items.Clear(); - combModelName.Items.Clear(); - - } - for (int i = 0; i < features[0].GetFieldCount(); i++) - { - GeoScene.Data.GSOFieldDefn fielddef = (GeoScene.Data.GSOFieldDefn)(features[0].GetFieldDefn(i)); - combPath.Items.Add(fielddef.Name); - combZ.Items.Add(fielddef.Name); - combModelName.Items.Add(fielddef.Name); - } - combModelName.SelectedItem = "编号"; - combPath.SelectedItem = "模型路径"; - } - } /// /// 单击选择shp格式文件 /// diff --git a/FrmAddWellShp.cs b/FrmAddWellShp.cs index bb79ec0..a249725 100644 --- a/FrmAddWellShp.cs +++ b/FrmAddWellShp.cs @@ -478,32 +478,6 @@ } } } - - private void cmbLayer_SelectedIndexChanged(object sender, EventArgs e) - { - GSOLayer layer = globeControl1.Globe.Layers.GetLayerByCaption(selectLayerName); - GSOFeatures features = layer.GetAllFeatures(); - if (features.Length == 0) - return; - - combCode.Items.Clear(); - combDeep.Items.Clear(); - combModelName.Items.Clear(); - combAngle.Items.Clear(); - - for (int i = 0; i < features[0].GetFieldCount(); i++) - { - GeoScene.Data.GSOFieldDefn fielddef = (GeoScene.Data.GSOFieldDefn)(features[0].GetFieldDefn(i)); - combCode.Items.Add(fielddef.Name); - combDeep.Items.Add(fielddef.Name); - combModelName.Items.Add(fielddef.Name); - combAngle.Items.Add(fielddef.Name); - } - combCode.SelectedItem = "附属物编码"; - combDeep.SelectedItem = "井深"; - combModelName.SelectedItem = "编号"; - combAngle.SelectedItem = "符号角度"; - } /// /// 单击选择shp格式文件 /// diff --git a/FrmAddYuBiZiShp.cs b/FrmAddYuBiZiShp.cs index b312d51..332f037 100644 --- a/FrmAddYuBiZiShp.cs +++ b/FrmAddYuBiZiShp.cs @@ -383,80 +383,7 @@ } } - private void cmbLayer_SelectedIndexChanged(object sender, EventArgs e) - { - GSOLayer layer = globeControl1.Globe.Layers.GetLayerByCaption(selectLayerName); - GSOFeatures features = layer.GetAllFeatures(); - if (features.Length == 0) - return; - - combCode.Items.Clear(); - combDeep.Items.Clear(); - combModelName.Items.Clear(); - //comboLoad.Items.Clear(); - for (int i = 0; i < features[0].GetFieldCount(); i++) - { - GeoScene.Data.GSOFieldDefn fielddef = (GeoScene.Data.GSOFieldDefn)(features[0].GetFieldDefn(i)); - combCode.Items.Add(fielddef.Name); - combDeep.Items.Add(fielddef.Name); - combModelName.Items.Add(fielddef.Name); - //comboLoad.Items.Add(fielddef.Name); - } - combCode.SelectedItem = "附属物编码"; - combDeep.SelectedItem = "Z坐标"; - combModelName.SelectedItem = "编号"; - //comboLoad.SelectedItem = "模型路径"; - } - - private void buttonXLayerPath_Click(object sender, EventArgs e) - { - OpenFileDialog dlg = new OpenFileDialog(); - dlg.Filter = "*.shp|*.shp"; - dlg.Multiselect = false; - if (dlg.ShowDialog() == DialogResult.OK) - { - GSOLayer layer = globeControl1.Globe.Layers.Add(dlg.FileName); - string txtMessage = valiYBdata(layer); - if (txtMessage != "") - { - button3.Enabled = false; - //textBoxLayer.Text = ""; - combCode.Items.Clear(); - combDeep.Items.Clear(); - combModelName.Items.Clear(); - globeControl1.Globe.Layers.Remove(layer); - FrmValiDataShowErrorMessage showErrorMessage = new FrmValiDataShowErrorMessage(dlg.FileName, txtMessage); - showErrorMessage.ShowDialog(); - return; - } - else - { - button3.Enabled = true; - //textBoxLayer.Text = dlg.FileName; - selectLayerName = layer.Caption; - txtLayerName.Text = layer.Caption; - GSOFeatures features = layer.GetAllFeatures(); - if (features.Length == 0) - return; - - combCode.Items.Clear(); - combDeep.Items.Clear(); - combModelName.Items.Clear(); - for (int i = 0; i < features[0].GetFieldCount(); i++) - { - GeoScene.Data.GSOFieldDefn fielddef = (GeoScene.Data.GSOFieldDefn)(features[0].GetFieldDefn(i)); - combCode.Items.Add(fielddef.Name); - combDeep.Items.Add(fielddef.Name); - combModelName.Items.Add(fielddef.Name); - //comboLoad.Items.Add(fielddef.Name); - } - combCode.SelectedItem = "管点编码"; - combDeep.SelectedItem = "Z坐标"; - combModelName.SelectedItem = "编号"; - } - } - } - + private void FrmAddYuBiZiShp_FormClosing(object sender, FormClosingEventArgs e) { globeControl1.Globe.Refresh(); diff --git a/FrmAllPipelineStatis.cs b/FrmAllPipelineStatis.cs index 6421a26..a6eea29 100644 --- a/FrmAllPipelineStatis.cs +++ b/FrmAllPipelineStatis.cs @@ -84,7 +84,7 @@ chartAllAreaPipeline.Series["管线"].Points.DataBindXY(pipelineLengthAndType.Keys, pipelineLengthAndType.Values); for (int m = 0; m < pipelineLengthAndType.Values.Count; m++) { - if (chartAllAreaPipeline.Series["管线"].Points[m].YValues[0].ToString() != "0") + if (chartAllAreaPipeline.Series["管线"].Points[m]!=null&&chartAllAreaPipeline.Series["管线"].Points[m].YValues[0].ToString() != "0") { chartAllAreaPipeline.Series["管线"].Points[m].Label = chartAllAreaPipeline.Series[0].Points[m].YValues[0].ToString(); } @@ -94,7 +94,7 @@ } catch (Exception ex) { - //LogError.PublishError(ex); + LogHelper.WriteLog(typeof(FrmAllPipelineStatis), ex.Message); } } @@ -147,7 +147,7 @@ } DataTable dt = OledbHelper.QueryTable(sql); - if (dt != null && dt.Rows.Count > 0) + if (dt != null && dt.Rows.Count > 0 && chartAllAreaPipeline.Series["管线"].Points[indexHit]!=null) { dataGridViewX1.DataSource = dt; panel.Visible = true; diff --git a/FrmAllWorkWellStatis.cs b/FrmAllWorkWellStatis.cs index 6fec7af..6af8e4c 100644 --- a/FrmAllWorkWellStatis.cs +++ b/FrmAllWorkWellStatis.cs @@ -52,7 +52,7 @@ chartAllAreaPipeline.Series["井盖"].Points.DataBindXY(workWellLengthAndType.Keys, workWellLengthAndType.Values); for (int m = 0; m < workWellLengthAndType.Values.Count; m++) { - if (chartAllAreaPipeline.Series["井盖"].Points[m].YValues[0].ToString().Trim() != "0") + if (chartAllAreaPipeline.Series["井盖"].Points[m]!=null&&chartAllAreaPipeline.Series["井盖"].Points[m].YValues[0].ToString().Trim() != "0") { chartAllAreaPipeline.Series["井盖"].Points[m].Label = chartAllAreaPipeline.Series[0].Points[m].YValues[0].ToString(); } @@ -60,7 +60,7 @@ } catch (Exception ex) { - //LogError.PublishError(ex); + LogHelper.WriteLog(typeof(FrmAllWorkWellStatis), ex.Message); } } diff --git a/FrmBSQDuoBianXingStatis.cs b/FrmBSQDuoBianXingStatis.cs index e8b7d52..3e889b6 100644 --- a/FrmBSQDuoBianXingStatis.cs +++ b/FrmBSQDuoBianXingStatis.cs @@ -60,7 +60,7 @@ { for (int m = 0; m < bsq1.Values.Count; m++) { - if (chart1.Series["标识器"].Points[m].YValues[0].ToString() != "0") + if (chart1.Series["标识器"].Points[m]!=null&&chart1.Series["标识器"].Points[m].YValues[0].ToString() != "0") { count += Convert.ToInt16(chart1.Series[0].Points[m].YValues[0].ToString()); chart1.Series["标识器"].Points[m].Label = chart1.Series[0].Points[m].YValues[0].ToString(); diff --git a/FrmBSQDuoBianXingStreet.cs b/FrmBSQDuoBianXingStreet.cs index 2005ebb..1db5777 100644 --- a/FrmBSQDuoBianXingStreet.cs +++ b/FrmBSQDuoBianXingStreet.cs @@ -63,7 +63,7 @@ chartStatis.Series[0].Points.DataBindXY(bsq.Keys, bsq.Values); for (int m = 0; m < bsq.Values.Count; m++) { - if (chartStatis.Series[0].Points[m].YValues[0].ToString().Trim() != "0") + if (chartStatis.Series[0].Points[m]!=null&&chartStatis.Series[0].Points[m].YValues[0].ToString().Trim() != "0") { count += Convert.ToInt16(chartStatis.Series[0].Points[m].YValues[0].ToString()); chartStatis.Series[0].Points[m].Label = chartStatis.Series[0].Points[m].YValues[0].ToString(); diff --git a/FrmBSQStatis.cs b/FrmBSQStatis.cs index 390a55c..4aa0ee6 100644 --- a/FrmBSQStatis.cs +++ b/FrmBSQStatis.cs @@ -95,6 +95,8 @@ } } } + + dr.Close(); conn.Close(); for (int i = 0; i < typeLists.Count; i++) { @@ -123,7 +125,7 @@ chartStatis.Series[0].Points.DataBindXY(bsq.Keys, bsq.Values); for (int m = 0; m < bsq.Values.Count; m++) { - if (chartStatis.Series[0].Points[m].YValues[0].ToString().Trim() != "0") + if (chartStatis.Series[0].Points[m]!=null&&chartStatis.Series[0].Points[m].YValues[0].ToString().Trim() != "0") { //count += Convert.ToInt16(chartStatis.Series[0].Points[m].YValues[0].ToString()); chartStatis.Series[0].Points[m].Label = chartStatis.Series[0].Points[m].YValues[0].ToString(); diff --git a/FrmBSQStreet.cs b/FrmBSQStreet.cs index 9d88adb..7fbacad 100644 --- a/FrmBSQStreet.cs +++ b/FrmBSQStreet.cs @@ -44,7 +44,7 @@ chartStatis.Series[0].Points.DataBindXY(bsq.Keys, bsq.Values); for (int m = 0; m < bsq.Values.Count; m++) { - if (chartStatis.Series[0].Points[m].YValues[0].ToString().Trim() != "0") + if (chartStatis.Series[0].Points[m]!=null&&chartStatis.Series[0].Points[m].YValues[0].ToString().Trim() != "0") { count += Convert.ToInt16(chartStatis.Series[0].Points[m].YValues[0].ToString()); chartStatis.Series[0].Points[m].Label = chartStatis.Series[0].Points[m].YValues[0].ToString(); diff --git a/FrmBoosterValvers.cs b/FrmBoosterValvers.cs index 5061efc..df9b62b 100644 --- a/FrmBoosterValvers.cs +++ b/FrmBoosterValvers.cs @@ -236,199 +236,6 @@ count = 0; } } - /// - /// 添加火苗 - /// - /// - /// - /// - /// - private GSOFeature AddFire(double x,double y,double z) - { - // 烟火示例 - - string strResPath = Application.StartupPath + "/Resource"; - - // 烟火粒子示例,由三个发射器构成 - GSOGeoParticle geoParticle = new GSOGeoParticle(); - geoParticle.SetPosition(x, y, z); // 添加到这个经纬度位置 - geoParticle.AltitudeMode = EnumAltitudeMode.RelativeToGround; - - GSORingParticleEmitter emitter = new GSORingParticleEmitter(); - emitter.TexturePath = strResPath + "/ParticleImage/flare.png"; - - emitter.SetSizeFix(1, 1); - emitter.VelFix = 1; - emitter.VelRnd = 5; - - emitter.AngleXYFix = 0; - emitter.AngleXYRnd = 180; - - emitter.AngleXZFix = 90; - emitter.AngleXZRnd = 0; - - emitter.LifeFix = 0.5f; - emitter.LifeRnd = 0.0f; - - emitter.RotFix = 0; - emitter.RotRnd = 0; - - emitter.RotVelFix = 0; - emitter.RotVelRnd = 0; - - emitter.EmitPerSec = 100; - - // 采用线性插值生成粒子的初始颜色 - emitter.ColorRndStart = Color.White; - emitter.ColorRndEnd = Color.Red; - - - GSOColorParticleEffector effector2 = new GSOColorParticleEffector(); - effector2.SetColorChanged(0, -1, -1, 0); - effector2.StartTime = 0.0f; - effector2.EndTime = -1.0f; - emitter.AddEffector(effector2); - - // 将三个发射器添加到粒子对象中 - geoParticle.AddEmitter(emitter); - - geoParticle.Play(); - - GSOFeature feature = new GSOFeature(); - - feature.Geometry = geoParticle; - - globeControl1.Globe.MemoryLayer.AddFeature(feature); - - - return feature; - } - - /// - /// 添加喷泉 - /// - /// - private GSOFeature AddFountain() - { - string strResPath = Application.StartupPath + "/Resource"; - - GSOGeoParticle geoParticle = new GSOGeoParticle(); - geoParticle.SetPosition(116.314, 39.84, 0); // 添加到这个经纬度位置 - - GSOPointParticleEmitter emitter = new GSOPointParticleEmitter(); - emitter.TexturePath = strResPath + "/ParticleImage/test.png"; - - emitter.SetSizeFix(0.5f, 2); - emitter.VelFix = 10; - emitter.VelRnd = 2; - - emitter.GravityAcc = 9.8f; - emitter.AngleXYFix = 0; - emitter.AngleXYRnd = 180; - - emitter.AngleXZFix = 88; - emitter.AngleXZRnd = 2; - - //emitter.InnerRadius = 0; - // emitter.OuterRadius = 0.03f; - - emitter.LifeFix = 5.0f; - emitter.LifeRnd = 1.0f; - - emitter.RotFix = 0; - emitter.RotRnd = 0; - - emitter.RotVelFix = 0; - emitter.RotVelRnd = 0; - - emitter.EmitPerSec = 1000; - emitter.ColorRndStart = Color.FromArgb(33, 255, 255, 255); - emitter.ColorRndEnd = Color.FromArgb(11, 255, 255, 255); - emitter.IsLumAdded = false; - - // 将三个发射器添加到粒子对象中 - geoParticle.AddEmitter(emitter); - - geoParticle.Play(); - GSOFeature feature = new GSOFeature(); - - feature.Geometry = geoParticle; - - //globeControl1.Globe.MemoryLayer.AddFeature(feature); - globeControl1.Globe.FlyToFeature(feature); - - return feature; - } - - /// - /// 添加水柱 - /// - /// - private GSOFeature AddWaterLine() - { - string strResPath = Application.StartupPath + "/Resource"; - - GSOGeoParticle geoParticle = new GSOGeoParticle(); - geoParticle.SetPosition(116.308, 39.84, 0); // 添加到这个经纬度位置 - - GSOPointParticleEmitter emitter = new GSOPointParticleEmitter(); - - emitter.TexturePath = strResPath + "/ParticleImage/drop3.png"; - - geoParticle.TimerInterval = 1; - - emitter.SetSizeFix(2.0f, 2.0f); - - emitter.VelFix = 50; - emitter.VelRnd = 2; - - // emitter.IsLumAdded = false; - - emitter.GravityAcc = 9.8f; - emitter.AngleXYFix = 0; - emitter.AngleXYRnd = 2; - - emitter.AngleXZFix = 60; - emitter.AngleXZRnd = 2; - - //emitter.InnerRadius = 0; - // emitter.OuterRadius = 0.1f; - - emitter.LifeFix = 5.0f; - emitter.LifeRnd = 1.0f; - - emitter.RotFix = 0; - emitter.RotRnd = 0; - - emitter.RotVelFix = 0; - emitter.RotVelRnd = 0; - - emitter.EmitPerSec = 1500; - - emitter.ColorRndStart = Color.FromArgb(100, 222, 222, 222); - emitter.ColorRndEnd = Color.FromArgb(50, 222, 222, 222); - - /* - - GSOScaleParticleEffector effector1 = new GSOScaleParticleEffector(); - effector1.SetScale(0.2f, 0.2f); - effector1.StartTime = 0; - effector1.EndTime = -1; // 负数表示整个粒子生命结束 - emitter.AddEffector(effector1); - */ - - // 将三个发射器添加到粒子对象中 - geoParticle.AddEmitter(emitter); - - geoParticle.Play(); - GSOFeature feature = new GSOFeature(); - - feature.Geometry = geoParticle; - - //globeControl1.Globe.MemoryLayer.AddFeature(feature); - globeControl1.Globe.FlyToFeature(feature); - - return feature; - } + } } diff --git a/FrmBufferAnalysis.cs b/FrmBufferAnalysis.cs index f711133..db8ca59 100644 --- a/FrmBufferAnalysis.cs +++ b/FrmBufferAnalysis.cs @@ -123,39 +123,6 @@ } } /// - /// 半径文本框的键盘按键按下事件处理 - /// - /// - /// - private void txtRadius_KeyPress(object sender, KeyPressEventArgs e) - { - TextBox text = sender as TextBox; - if ((e.KeyChar < 48 || e.KeyChar > 57) && (e.KeyChar != 8) && (int)e.KeyChar != 46) - { - e.Handled = true; - } - if ((int)e.KeyChar == 46) //小数点 - { - if (text.Text.Length <= 0) - e.Handled = true; //小数点不能在第一位 - else //处理不规则的小数点 - { - float f; - float oldf; - bool b1 = false, b2 = false; - b1 = float.TryParse(text.Text, out oldf); - b2 = float.TryParse(text.Text + e.KeyChar.ToString(), out f); - if (b2 == false) - { - if (b1 == true) - e.Handled = true; - else - e.Handled = false; - } - } - } - } - /// /// 窗体关闭事件处理 /// /// diff --git a/FrmBufferAnalysisBSQ.cs b/FrmBufferAnalysisBSQ.cs index 24a96ca..f54208f 100644 --- a/FrmBufferAnalysisBSQ.cs +++ b/FrmBufferAnalysisBSQ.cs @@ -137,35 +137,7 @@ } } - private void txtRadius_KeyPress(object sender, KeyPressEventArgs e) - { - TextBox text = sender as TextBox; - if ((e.KeyChar < 48 || e.KeyChar > 57) && (e.KeyChar != 8) && (int)e.KeyChar != 46) - { - e.Handled = true; - } - if ((int)e.KeyChar == 46) //小数点 - { - if (text.Text.Length <= 0) - e.Handled = true; //小数点不能在第一位 - else //处理不规则的小数点 - { - float f; - float oldf; - bool b1 = false, b2 = false; - b1 = float.TryParse(text.Text, out oldf); - b2 = float.TryParse(text.Text + e.KeyChar.ToString(), out f); - if (b2 == false) - { - if (b1 == true) - e.Handled = true; - else - e.Handled = false; - } - } - } - } - + private void FrmBufferAnalysis_FormClosing(object sender, FormClosingEventArgs e) { //Form1.y = 0; @@ -316,27 +288,6 @@ } } - private void FlyToMenu_Click(object sender, EventArgs e) - { - if (m_feature != null) - { - if (m_feature.Geometry != null && m_feature.Geometry.Type == EnumGeometryType.GeoPolyline3D) - { - GSOGeoPolyline3D line = m_feature.Geometry as GSOGeoPolyline3D; - double length = line.GetSpaceLength(true, 6378137); - GSOGeoPolyline3D lineLine = line.GetSegment(0, length / 2); - GSOPoint3d point3d = lineLine[lineLine.PartCount - 1][lineLine[lineLine.PartCount - 1].Count - 1]; - - globeControl1.Globe.FlyToPosition(point3d, EnumAltitudeMode.Absolute, 0, 45, 5); - } - else - { - globeControl1.Globe.FlyToFeature(m_feature, 0, 45, 3); - } - LightMenu_Click(sender, e); - } - } - private void LightMenu_Click(object sender, EventArgs e) { flashflag = "single"; diff --git a/FrmDataBaseOpt.cs b/FrmDataBaseOpt.cs index b0c4b5d..8d7b69d 100644 --- a/FrmDataBaseOpt.cs +++ b/FrmDataBaseOpt.cs @@ -362,6 +362,7 @@ dbCombor.Items.Add(dblist[i].title); } } + /* /// /// 从配置文件读取数据库参数配置 /// @@ -428,6 +429,8 @@ } } + * */ + /* /// /// 向配置文件写入连接数据库的参数配置 /// @@ -485,6 +488,7 @@ MessageBox.Show(exp.ToString()); } } + * */ /// /// /// diff --git a/FrmDatabaseParaSetting.cs b/FrmDatabaseParaSetting.cs index a6fea46..63b596b 100644 --- a/FrmDatabaseParaSetting.cs +++ b/FrmDatabaseParaSetting.cs @@ -152,6 +152,7 @@ this.DialogResult = DialogResult.OK; this.Close(); } + /* /// /// 从配置文件读取数据库连接参数配置 /// @@ -218,6 +219,8 @@ } } + * */ + /* /// /// 向配置文件写入数据库参数配置 /// @@ -276,7 +279,7 @@ MessageBox.Show(ex.ToString()); } } - + */ /// /// 取消按钮事件处理 /// diff --git a/FrmDatabaseParaSetting2.cs b/FrmDatabaseParaSetting2.cs index 932d05e..96a87d5 100644 --- a/FrmDatabaseParaSetting2.cs +++ b/FrmDatabaseParaSetting2.cs @@ -148,6 +148,7 @@ this.DialogResult = DialogResult.OK; this.Close(); } + /* /// /// 从配置文件读取数据库连接参数配置 /// @@ -214,6 +215,8 @@ } } + * */ + /* /// /// 向配置文件写入数据库参数配置 /// @@ -272,7 +275,7 @@ MessageBox.Show(exp.ToString()); } } - + */ /// /// 取消按钮事件处理 /// diff --git a/FrmDiameterQuery.cs b/FrmDiameterQuery.cs index 68c948b..9a5215b 100644 --- a/FrmDiameterQuery.cs +++ b/FrmDiameterQuery.cs @@ -77,18 +77,7 @@ isBetween = true; } } - /// - /// 键盘按键按下事件处理 - /// - /// - /// - private void textBoxX1_KeyPress(object sender, KeyPressEventArgs e) - { - if ((e.KeyChar < 48 || e.KeyChar > 57) && e.KeyChar != 8) - { - e.Handled = true;//屏蔽 - } - } + bool isBetween = false; /// diff --git a/FrmDocumentEdit.cs b/FrmDocumentEdit.cs index aab2d31..e78a7ff 100644 --- a/FrmDocumentEdit.cs +++ b/FrmDocumentEdit.cs @@ -256,121 +256,6 @@ } - // - /// 将本地文件上传到指定的服务器(HttpWebRequest方法) - /// - /// 文件上传到的服务器 - /// 要上传的本地文件(全路径) - /// 文件上传后的名称 - /// 上传进度条 - /// 成功返回1,失败返回0 - private int Upload_Request(string address, string fileNamePath, string saveName, ProgressBar progressBar) - { - int returnValue = 0; - // 要上传的文件 - FileStream fs = new FileStream(fileNamePath, FileMode.Open, FileAccess.Read); - BinaryReader r = new BinaryReader(fs); - //时间戳 - string strBoundary = "----------" + DateTime.Now.Ticks.ToString("x"); - byte[] boundaryBytes = Encoding.ASCII.GetBytes("/r/n--" + strBoundary + "/r/n"); - //请求头部信息 - StringBuilder sb = new StringBuilder(); - sb.Append("--"); - sb.Append(strBoundary); - sb.Append("\r\n"); - sb.Append("Content-Disposition: form-data; name=\""); - sb.Append("file"); - sb.Append("\"; filename=\""); - sb.Append(saveName); - sb.Append("\""); - sb.Append("\r\n"); - sb.Append("Content-Type: "); - sb.Append("application/octet-stream"); - sb.Append("\r\n"); - sb.Append("\r\n"); - string strPostHeader = sb.ToString(); - byte[] postHeaderBytes = Encoding.UTF8.GetBytes(strPostHeader); - // 根据uri创建HttpWebRequest对象 - HttpWebRequest httpReq = (HttpWebRequest)WebRequest.Create(new Uri(address)); - httpReq.Method = "POST"; - //对发送的数据不使用缓存 - httpReq.AllowWriteStreamBuffering = false; - //设置获得响应的超时时间(300秒) - httpReq.Timeout = 300000; - httpReq.ContentType = "multipart/form-data; boundary=" + strBoundary; - long length = fs.Length + postHeaderBytes.Length + boundaryBytes.Length; - long fileLength = fs.Length; - httpReq.ContentLength = length; - try - { - progressBar.Maximum = int.MaxValue; - progressBar.Minimum = 0; - progressBar.Value = 0; - //每次上传4k - int bufferLength = 4096; - byte[] buffer = new byte[bufferLength]; - //已上传的字节数 - long offset = 0; - //开始上传时间 - DateTime startTime = DateTime.Now; - int size = r.Read(buffer, 0, bufferLength); - Stream postStream = httpReq.GetRequestStream(); - //发送请求头部消息 - postStream.Write(postHeaderBytes, 0, postHeaderBytes.Length); - while (size > 0) - { - postStream.Write(buffer, 0, size); - offset += size; - progressBar.Value = (int)(offset * (int.MaxValue / length)); - TimeSpan span = DateTime.Now - startTime; - double second = span.TotalSeconds; - //lblTime.Text = "已用时:" + second.ToString("F2") + "秒"; - //if (second > 0.001) - //{ - // lblSpeed.Text = " 平均速度:" + (offset / 1024 / second).ToString("0.00") + "KB/秒"; - //} - //else - //{ - // lblSpeed.Text = " 正在连接…"; - //} - //lblState.Text = "已上传:" + (offset * 100.0 / length).ToString("F2") + "%"; - //lblSize.Text = (offset / 1048576.0).ToString("F2") + "M/" + (fileLength / 1048576.0).ToString("F2") + "M"; - Application.DoEvents(); - size = r.Read(buffer, 0, bufferLength); - } - //添加尾部的时间戳 - postStream.Write(boundaryBytes, 0, boundaryBytes.Length); - postStream.Close(); - //获取服务器端的响应 - WebResponse webRespon = httpReq.GetResponse(); - Stream s = webRespon.GetResponseStream(); - StreamReader sr = new StreamReader(s); - //读取服务器端返回的消息 - String sReturnString = sr.ReadLine(); - s.Close(); - sr.Close(); - if (sReturnString == "Success") - { - returnValue = 1; - } - else if (sReturnString == "Error") - { - returnValue = 0; - } - } - catch(Exception ex) - { - returnValue = 0; - string str = ex.ToString(); - } - finally - { - fs.Close(); - r.Close(); - } - return returnValue; - } - private void btn_file_Click(object sender, EventArgs e) { OpenFileDialog dlg = new OpenFileDialog(); diff --git a/FrmExportCADS.cs b/FrmExportCADS.cs index 98772ea..59629dd 100644 --- a/FrmExportCADS.cs +++ b/FrmExportCADS.cs @@ -108,65 +108,6 @@ MessageBox.Show("请选中要导出的图层!", "提示", MessageBoxButtons.OK, MessageBoxIcon.Warning); } } - private Boolean MerageToFile(GSOFeatures features, String strDestFile, String strProj4)//图层追加 - { - if (features == null) - { - return false; - } - Boolean bSuccess = false; - - string strDir = GSOUtility.GetFileDir(strDestFile); - string strLPRJFile = GSOUtility.ChangeExt(strDestFile, ".lprj"); - string strExt = GSOUtility.GetFileExt(strDestFile); - - // 如果投影文件存在,投影以投影文件为准 - if (File.Exists(strLPRJFile)) - { - // 如果是dxf,则这样处理 - if (strExt.ToLower() == ".dxf") - { - string strTempSrcFile = strDir + "srcFeatures_dxftmp" + strExt; - globeControl1.Globe.DataManager.SaveFeatureData(features, strTempSrcFile, strLPRJFile, 4); - bSuccess = GSOUtility.MergeTwoDXFFileFeatures(strDestFile, strTempSrcFile); - File.Delete(strTempSrcFile); - } - else - { - GSOFeatures srcFeatures = globeControl1.Globe.DataManager.ReadFeatureData(strDestFile); - int nCount = features.Length; - int i = 0; - for (i = 0; i < nCount; i++) - { - srcFeatures.Add(features[i]); - } - bSuccess = globeControl1.Globe.DataManager.SaveFeatureData(srcFeatures, strDestFile, strLPRJFile, 4); - } - } - else - { - // 如果是dxf,则这样处理 - if (strExt.ToLower() == ".dxf") - { - string strTempSrcFile = strDir + "srcFeatures_dxftmp" + strExt; - globeControl1.Globe.DataManager.SaveFeatureData(features, strTempSrcFile, strProj4, 0); - bSuccess = GSOUtility.MergeTwoDXFFileFeatures(strDestFile, strTempSrcFile); - File.Delete(strTempSrcFile); - } - else - { - GSOFeatures srcFeatures = globeControl1.Globe.DataManager.ReadFeatureData(strDestFile); - int nCount = features.Length; - int i = 0; - for (i = 0; i < nCount; i++) - { - srcFeatures.Add(features[i]); - } - bSuccess = globeControl1.Globe.DataManager.SaveFeatureData(srcFeatures, strDestFile, strProj4, 0); - } - } - return bSuccess; - } /// /// 关闭按钮事件处理 /// diff --git a/Cyberpipe.csproj b/Cyberpipe.csproj index 07a8c1a..e3cd12c 100644 --- a/Cyberpipe.csproj +++ b/Cyberpipe.csproj @@ -204,25 +204,6 @@ - - Form - - - F_GKT1数据输入输出.cs - - - Form - - - F_GKT1添加文件.cs - - - Form - - - F_GKT1添加项目.cs - - Form @@ -1068,18 +1049,6 @@ Frm_password_reset.cs - - Form - - - GKT.cs - - - Form - - - GKT1.cs - Form @@ -1258,12 +1227,6 @@ F_Projedit.cs - - Form - - - PED.cs - Form @@ -1331,16 +1294,6 @@ True Reference.map - - F_GKT1数据输入输出.cs - Designer - - - F_GKT1添加文件.cs - - - F_GKT1添加项目.cs - Form_EditTask.cs @@ -1836,12 +1789,6 @@ Frm_password_reset.cs - - GKT.cs - - - GKT1.cs - F_GKT数据输入输出.cs @@ -1934,9 +1881,6 @@ F_Projedit.cs - - PED.cs - F_数据输入输出.cs diff --git a/Cyberpipe.suo b/Cyberpipe.suo index 68ced4f..a1aecf8 100644 --- a/Cyberpipe.suo +++ b/Cyberpipe.suo Binary files differ diff --git a/EMS_Forms/Form_EditTask.cs b/EMS_Forms/Form_EditTask.cs index 718992f..f1d791f 100644 --- a/EMS_Forms/Form_EditTask.cs +++ b/EMS_Forms/Form_EditTask.cs @@ -119,7 +119,8 @@ String name = Convert.ToString(dr["USERNAME"]); comboBox_userName.Items.Add(name); - } + } + dr.Close(); comboBox_road.Items.Clear(); roadList = new List(); @@ -135,7 +136,7 @@ comboBox_road.Items.Add(name); } } - + dr1.Close(); conn.Close(); bool flag2 = false; @@ -185,7 +186,7 @@ catch (Exception ex) { - MessageBox.Show(ex.ToString()); + LogHelper.WriteLog(typeof(Form_EditTask), ex.Message); } } @@ -288,7 +289,7 @@ } catch (Exception ex) { - MessageBox.Show(ex.ToString()); + LogHelper.WriteLog(typeof(Form_EditTask), ex.Message); } } @@ -474,7 +475,7 @@ } catch (Exception ex) { - MessageBox.Show(ex.ToString()); + LogHelper.WriteLog(typeof(Form_EditTask), ex.Message); } this.Close(); @@ -495,6 +496,7 @@ { numList.Add(Convert.ToInt32(dr["DBID"])); } + dr.Close(); if (numList.Count == 0) { taskNumber = Convert.ToInt32(number) * 100; @@ -674,6 +676,7 @@ } } } + dr.Close(); conn.Close(); } diff --git a/EMS_Forms/Form_EventManager.cs b/EMS_Forms/Form_EventManager.cs index b18c45b..84807b2 100644 --- a/EMS_Forms/Form_EventManager.cs +++ b/EMS_Forms/Form_EventManager.cs @@ -64,6 +64,7 @@ comboBox_name.Items.Add(name); } + dr.Close(); conn.Close(); diff --git a/Forms/FrmMnModify.cs b/Forms/FrmMnModify.cs index 31cfc5f..d036360 100644 --- a/Forms/FrmMnModify.cs +++ b/Forms/FrmMnModify.cs @@ -68,15 +68,7 @@ questionGrid.Rows[idx].Cells[1].Value = sr.question; } } - /// 选中对象 - /// - /// - /// - /// - private void buttonX1_Click(object sender, EventArgs e) - { - globecontrol.Globe.Action = EnumAction3D.SelectObject; - } + /// /// 选中某一行 /// diff --git a/Forms/FrmPipelineModelDataBase.cs b/Forms/FrmPipelineModelDataBase.cs index 2acf0ca..7ce573f 100644 --- a/Forms/FrmPipelineModelDataBase.cs +++ b/Forms/FrmPipelineModelDataBase.cs @@ -35,19 +35,7 @@ ds = _ds; InitializeComponent(); } - /// - /// 单击选择shp格式文件 - /// - /// - /// - private void btnBrowseModel_Click(object sender, EventArgs e) - { - saveFileDialog1.Filter = "*.lgd|*.lgd"; - if (saveFileDialog1.ShowDialog() == DialogResult.OK) - { - txtModelLayer.Text = saveFileDialog1.FileName; - } - } + /// /// 窗体初始化事件处理 /// @@ -100,49 +88,6 @@ } } } - - private object convertFieldValue(string fieldname, object obj) - { - if (obj == null) - return null; - - try - { - string type = fields_types[fieldname].ToString(); - switch (type) - { - case "string": - return obj.ToString(); - case "int": - //return 101; - int intResult; - if (int.TryParse(obj.ToString(), out intResult)) - return intResult; - else - return null; - case "double": - //return 202.5; - double doubleResult; - if (double.TryParse(obj.ToString(), out doubleResult)) - return doubleResult; - else - return null; - case "date": - DateTime dtResult; - if (DateTime.TryParse(obj.ToString(), out dtResult)) - return dtResult; - else - return null; - } - return null; - } - catch (Exception ex) - { - MessageBox.Show(ex.ToString()); - return null; - } - } - public string lgdFilePath = ""; /// /// 选择管线颜色 @@ -610,33 +555,6 @@ { this.Close(); } - - private void cmbLayer_SelectedIndexChanged(object sender, EventArgs e) //选择图层 - { - GSOLayer layer = ctl.Globe.Layers.GetLayerByCaption(selectLayerName); - GSOFeatures features = layer.GetAllFeatures(); - if (features.Length == 0) - return; - - cmbFrom.Items.Clear(); - cmbTo.Items.Clear(); - cmbRadius.Items.Clear(); - cmbID.Items.Clear(); - for (int i = 0; i < features[0].GetFieldCount(); i++) - { - GeoScene.Data.GSOFieldDefn fielddef = (GeoScene.Data.GSOFieldDefn)(features[0].GetFieldDefn(i)); - - cmbFrom.Items.Add(fielddef.Name); - cmbTo.Items.Add(fielddef.Name); - cmbRadius.Items.Add(fielddef.Name); - cmbID.Items.Add(fielddef.Name); - } - cmbFrom.SelectedItem = "Deep1"; - cmbTo.SelectedItem = "Deep2"; - cmbRadius.SelectedItem = "Diameter"; - cmbID.SelectedItem = "Handle"; - } - private void buttonXLayerPath_Click(object sender, EventArgs e)//单击 选择shp格式的文件 { OpenFileDialog dlg = new OpenFileDialog(); diff --git a/Forms/FrmPipelineModelDataOneStep.cs b/Forms/FrmPipelineModelDataOneStep.cs index 18afda7..ec93b8a 100644 --- a/Forms/FrmPipelineModelDataOneStep.cs +++ b/Forms/FrmPipelineModelDataOneStep.cs @@ -38,19 +38,7 @@ layerTree = _layerTree; InitializeComponent(); } - /// - /// 单击选择shp格式文件 - /// - /// - /// - private void btnBrowseModel_Click(object sender, EventArgs e) - { - saveFileDialog1.Filter = "*.lgd|*.lgd"; - if (saveFileDialog1.ShowDialog() == DialogResult.OK) - { - txtModelLayer.Text = saveFileDialog1.FileName; - } - } + /// /// 窗体初始化事件处理 /// @@ -107,48 +95,7 @@ } } - private object convertFieldValue(string fieldname, object obj) - { - if (obj == null) - return null; - - try - { - string type = fields_types[fieldname].ToString(); - switch (type) - { - case "string": - return obj.ToString(); - case "int": - //return 101; - int intResult; - if (int.TryParse(obj.ToString(), out intResult)) - return intResult; - else - return null; - case "double": - //return 202.5; - double doubleResult; - if (double.TryParse(obj.ToString(), out doubleResult)) - return doubleResult; - else - return null; - case "date": - DateTime dtResult; - if (DateTime.TryParse(obj.ToString(), out dtResult)) - return dtResult; - else - return null; - } - return null; - } - catch (Exception ex) - { - MessageBox.Show(ex.ToString()); - return null; - } - } - + public string lgdFilePath = ""; /// /// 选择管线颜色 @@ -673,32 +620,6 @@ return featDs; } - private void cmbLayer_SelectedIndexChanged(object sender, EventArgs e) //选择图层 - { - GSOLayer layer = ctl.Globe.Layers.GetLayerByCaption(selectLayerName); - GSOFeatures features = layer.GetAllFeatures(); - if (features.Length == 0) - return; - - cmbFrom.Items.Clear(); - cmbTo.Items.Clear(); - cmbRadius.Items.Clear(); - cmbID.Items.Clear(); - for (int i = 0; i < features[0].GetFieldCount(); i++) - { - GeoScene.Data.GSOFieldDefn fielddef = (GeoScene.Data.GSOFieldDefn)(features[0].GetFieldDefn(i)); - - cmbFrom.Items.Add(fielddef.Name); - cmbTo.Items.Add(fielddef.Name); - cmbRadius.Items.Add(fielddef.Name); - cmbID.Items.Add(fielddef.Name); - } - cmbFrom.SelectedItem = "Deep1"; - cmbTo.SelectedItem = "Deep2"; - cmbRadius.SelectedItem = "Diameter"; - cmbID.SelectedItem = "Handle"; - } - private void buttonXLayerPath_Click(object sender, EventArgs e)//单击 选择shp格式的文件 { OpenFileDialog dlg = new OpenFileDialog(); @@ -949,38 +870,6 @@ } //txtLayername.Text = type + layername; } - /// - /// 连接数据库 - /// - /// - /// - private void buttonX1_Click(object sender, EventArgs e) - { - if (ds == null) - { - //没连的话,直接连接审核库; //审核库配置读配置文件 - string dbIp = Utility.sgdbip; - string database = Utility.sgdbname; - string user = Utility.sgdbuser; - string pass = Utility.sgdbpwd; - - if (!Utility.isNetworkConnectionSuccess(dbIp.Trim())) - { - MessageBox.Show("网络连接失败!", "提示"); - return; - } - - ds = ctl.Globe.DataManager.OpenOracleDataSource(dbIp + "/" + database, "", "", user, pass); - if (ds == null) - { - MessageBox.Show("数据库连接失败!", "提示", MessageBoxButtons.OK, MessageBoxIcon.Warning); - } - else - { - btnCreateModel.Enabled = true; - } - } - } private void btnClose_Click(object sender, EventArgs e) { diff --git a/Forms/FrmShRK.cs b/Forms/FrmShRK.cs index 0e2e722..f1d83cb 100644 --- a/Forms/FrmShRK.cs +++ b/Forms/FrmShRK.cs @@ -215,6 +215,7 @@ { sourcefeatds = sourcefeat as GSOFeatureDataset; } + if (sourcefeatds == null) return; sourcefeatds.Open(); GSOFeatures sourcefeatures = sourcefeatds.GetAllFeatures(); @@ -251,6 +252,7 @@ { desfeatds = desfeat as GSOFeatureDataset; } + if (desfeatds == null) return; desfeatds.Open(); //向新数据集写入字段 diff --git a/FrmAccessoriesSensor.cs b/FrmAccessoriesSensor.cs index 09fcdf1..2a7a80e 100644 --- a/FrmAccessoriesSensor.cs +++ b/FrmAccessoriesSensor.cs @@ -209,7 +209,7 @@ chart1.Series[0].Points.DataBindXY(dic.Keys, dic.Values); for (int m = 0; m < dic.Values.Count; m++) { - if (chart1.Series[0].Points[m].YValues[0].ToString() != "0") + if (chart1.Series[0].Points[m]!=null&&chart1.Series[0].Points[m].YValues[0].ToString() != "0") { chart1.Series[0].Points[m].Label = chart1.Series[0].Points[m].YValues[0].ToString(); } diff --git a/FrmAccessoriesgather.cs b/FrmAccessoriesgather.cs index 9e331e1..a475d9e 100644 --- a/FrmAccessoriesgather.cs +++ b/FrmAccessoriesgather.cs @@ -338,7 +338,7 @@ chart1.Series[0].Points.DataBindXY(dic.Keys, dic.Values); for (int m = 0; m < dic.Values.Count; m++) { - if (chart1.Series[0].Points[m].YValues[0].ToString() != "0") + if (chart1.Series[0].Points[m]!=null&&chart1.Series[0].Points[m].YValues[0].ToString() != "0") { chart1.Series[0].Points[m].Label = chart1.Series[0].Points[m].YValues[0].ToString(); } diff --git a/FrmAccessoryAnalysis.cs b/FrmAccessoryAnalysis.cs index 71d4579..44d4065 100644 --- a/FrmAccessoryAnalysis.cs +++ b/FrmAccessoryAnalysis.cs @@ -66,39 +66,6 @@ globeControl1.Refresh(); } /// - /// 键盘按键按下事件处理 - /// - /// - /// - private void txtRadius_KeyPress(object sender, KeyPressEventArgs e) - { - TextBox text = sender as TextBox; - if ((e.KeyChar < 48 || e.KeyChar > 57) && (e.KeyChar != 8) && (int)e.KeyChar != 46) - { - e.Handled = true; - } - if ((int)e.KeyChar == 46) //小数点 - { - if (text.Text.Length <= 0) - e.Handled = true; //小数点不能在第一位 - else //处理不规则的小数点 - { - float f; - float oldf; - bool b1 = false, b2 = false; - b1 = float.TryParse(text.Text, out oldf); - b2 = float.TryParse(text.Text + e.KeyChar.ToString(), out f); - if (b2 == false) - { - if (b1 == true) - e.Handled = true; - else - e.Handled = false; - } - } - } - } - /// /// 确定按钮事件处理 /// /// diff --git a/FrmAddValve.cs b/FrmAddValve.cs index 34d2fec..5f405b9 100644 --- a/FrmAddValve.cs +++ b/FrmAddValve.cs @@ -486,56 +486,6 @@ } } - - - - - - - - private void cmbLayer_SelectedIndexChanged(object sender, EventArgs e) - { - GSOLayer layer = globeControl1.Globe.Layers.GetLayerByCaption(selectLayerName); - GSOFeatures features = layer.GetAllFeatures(); - if (features.Length == 0) - return; - - combPath.Items.Clear(); - combZ.Items.Clear(); - combModelName.Items.Clear(); - - for (int i = 0; i < features[0].GetFieldCount(); i++) - { - GeoScene.Data.GSOFieldDefn fielddef = (GeoScene.Data.GSOFieldDefn)(features[0].GetFieldDefn(i)); - combPath.Items.Add(fielddef.Name); - combZ.Items.Add(fielddef.Name); - combModelName.Items.Add(fielddef.Name); - } - combModelName.SelectedItem = "编号"; - combPath.SelectedItem = "模型路径"; - if (combfile.SelectedIndex != -1) - { - - string layerCaption = combfile.SelectedItem.ToString().Trim(); - rukuLayer = globeControl1.Globe.Layers.GetLayerByCaption(layerCaption); - if (rukuLayer != null) - { - combPath.Items.Clear(); - combZ.Items.Clear(); - combModelName.Items.Clear(); - - } - for (int i = 0; i < features[0].GetFieldCount(); i++) - { - GeoScene.Data.GSOFieldDefn fielddef = (GeoScene.Data.GSOFieldDefn)(features[0].GetFieldDefn(i)); - combPath.Items.Add(fielddef.Name); - combZ.Items.Add(fielddef.Name); - combModelName.Items.Add(fielddef.Name); - } - combModelName.SelectedItem = "编号"; - combPath.SelectedItem = "模型路径"; - } - } /// /// 单击选择shp格式文件 /// diff --git a/FrmAddWellShp.cs b/FrmAddWellShp.cs index bb79ec0..a249725 100644 --- a/FrmAddWellShp.cs +++ b/FrmAddWellShp.cs @@ -478,32 +478,6 @@ } } } - - private void cmbLayer_SelectedIndexChanged(object sender, EventArgs e) - { - GSOLayer layer = globeControl1.Globe.Layers.GetLayerByCaption(selectLayerName); - GSOFeatures features = layer.GetAllFeatures(); - if (features.Length == 0) - return; - - combCode.Items.Clear(); - combDeep.Items.Clear(); - combModelName.Items.Clear(); - combAngle.Items.Clear(); - - for (int i = 0; i < features[0].GetFieldCount(); i++) - { - GeoScene.Data.GSOFieldDefn fielddef = (GeoScene.Data.GSOFieldDefn)(features[0].GetFieldDefn(i)); - combCode.Items.Add(fielddef.Name); - combDeep.Items.Add(fielddef.Name); - combModelName.Items.Add(fielddef.Name); - combAngle.Items.Add(fielddef.Name); - } - combCode.SelectedItem = "附属物编码"; - combDeep.SelectedItem = "井深"; - combModelName.SelectedItem = "编号"; - combAngle.SelectedItem = "符号角度"; - } /// /// 单击选择shp格式文件 /// diff --git a/FrmAddYuBiZiShp.cs b/FrmAddYuBiZiShp.cs index b312d51..332f037 100644 --- a/FrmAddYuBiZiShp.cs +++ b/FrmAddYuBiZiShp.cs @@ -383,80 +383,7 @@ } } - private void cmbLayer_SelectedIndexChanged(object sender, EventArgs e) - { - GSOLayer layer = globeControl1.Globe.Layers.GetLayerByCaption(selectLayerName); - GSOFeatures features = layer.GetAllFeatures(); - if (features.Length == 0) - return; - - combCode.Items.Clear(); - combDeep.Items.Clear(); - combModelName.Items.Clear(); - //comboLoad.Items.Clear(); - for (int i = 0; i < features[0].GetFieldCount(); i++) - { - GeoScene.Data.GSOFieldDefn fielddef = (GeoScene.Data.GSOFieldDefn)(features[0].GetFieldDefn(i)); - combCode.Items.Add(fielddef.Name); - combDeep.Items.Add(fielddef.Name); - combModelName.Items.Add(fielddef.Name); - //comboLoad.Items.Add(fielddef.Name); - } - combCode.SelectedItem = "附属物编码"; - combDeep.SelectedItem = "Z坐标"; - combModelName.SelectedItem = "编号"; - //comboLoad.SelectedItem = "模型路径"; - } - - private void buttonXLayerPath_Click(object sender, EventArgs e) - { - OpenFileDialog dlg = new OpenFileDialog(); - dlg.Filter = "*.shp|*.shp"; - dlg.Multiselect = false; - if (dlg.ShowDialog() == DialogResult.OK) - { - GSOLayer layer = globeControl1.Globe.Layers.Add(dlg.FileName); - string txtMessage = valiYBdata(layer); - if (txtMessage != "") - { - button3.Enabled = false; - //textBoxLayer.Text = ""; - combCode.Items.Clear(); - combDeep.Items.Clear(); - combModelName.Items.Clear(); - globeControl1.Globe.Layers.Remove(layer); - FrmValiDataShowErrorMessage showErrorMessage = new FrmValiDataShowErrorMessage(dlg.FileName, txtMessage); - showErrorMessage.ShowDialog(); - return; - } - else - { - button3.Enabled = true; - //textBoxLayer.Text = dlg.FileName; - selectLayerName = layer.Caption; - txtLayerName.Text = layer.Caption; - GSOFeatures features = layer.GetAllFeatures(); - if (features.Length == 0) - return; - - combCode.Items.Clear(); - combDeep.Items.Clear(); - combModelName.Items.Clear(); - for (int i = 0; i < features[0].GetFieldCount(); i++) - { - GeoScene.Data.GSOFieldDefn fielddef = (GeoScene.Data.GSOFieldDefn)(features[0].GetFieldDefn(i)); - combCode.Items.Add(fielddef.Name); - combDeep.Items.Add(fielddef.Name); - combModelName.Items.Add(fielddef.Name); - //comboLoad.Items.Add(fielddef.Name); - } - combCode.SelectedItem = "管点编码"; - combDeep.SelectedItem = "Z坐标"; - combModelName.SelectedItem = "编号"; - } - } - } - + private void FrmAddYuBiZiShp_FormClosing(object sender, FormClosingEventArgs e) { globeControl1.Globe.Refresh(); diff --git a/FrmAllPipelineStatis.cs b/FrmAllPipelineStatis.cs index 6421a26..a6eea29 100644 --- a/FrmAllPipelineStatis.cs +++ b/FrmAllPipelineStatis.cs @@ -84,7 +84,7 @@ chartAllAreaPipeline.Series["管线"].Points.DataBindXY(pipelineLengthAndType.Keys, pipelineLengthAndType.Values); for (int m = 0; m < pipelineLengthAndType.Values.Count; m++) { - if (chartAllAreaPipeline.Series["管线"].Points[m].YValues[0].ToString() != "0") + if (chartAllAreaPipeline.Series["管线"].Points[m]!=null&&chartAllAreaPipeline.Series["管线"].Points[m].YValues[0].ToString() != "0") { chartAllAreaPipeline.Series["管线"].Points[m].Label = chartAllAreaPipeline.Series[0].Points[m].YValues[0].ToString(); } @@ -94,7 +94,7 @@ } catch (Exception ex) { - //LogError.PublishError(ex); + LogHelper.WriteLog(typeof(FrmAllPipelineStatis), ex.Message); } } @@ -147,7 +147,7 @@ } DataTable dt = OledbHelper.QueryTable(sql); - if (dt != null && dt.Rows.Count > 0) + if (dt != null && dt.Rows.Count > 0 && chartAllAreaPipeline.Series["管线"].Points[indexHit]!=null) { dataGridViewX1.DataSource = dt; panel.Visible = true; diff --git a/FrmAllWorkWellStatis.cs b/FrmAllWorkWellStatis.cs index 6fec7af..6af8e4c 100644 --- a/FrmAllWorkWellStatis.cs +++ b/FrmAllWorkWellStatis.cs @@ -52,7 +52,7 @@ chartAllAreaPipeline.Series["井盖"].Points.DataBindXY(workWellLengthAndType.Keys, workWellLengthAndType.Values); for (int m = 0; m < workWellLengthAndType.Values.Count; m++) { - if (chartAllAreaPipeline.Series["井盖"].Points[m].YValues[0].ToString().Trim() != "0") + if (chartAllAreaPipeline.Series["井盖"].Points[m]!=null&&chartAllAreaPipeline.Series["井盖"].Points[m].YValues[0].ToString().Trim() != "0") { chartAllAreaPipeline.Series["井盖"].Points[m].Label = chartAllAreaPipeline.Series[0].Points[m].YValues[0].ToString(); } @@ -60,7 +60,7 @@ } catch (Exception ex) { - //LogError.PublishError(ex); + LogHelper.WriteLog(typeof(FrmAllWorkWellStatis), ex.Message); } } diff --git a/FrmBSQDuoBianXingStatis.cs b/FrmBSQDuoBianXingStatis.cs index e8b7d52..3e889b6 100644 --- a/FrmBSQDuoBianXingStatis.cs +++ b/FrmBSQDuoBianXingStatis.cs @@ -60,7 +60,7 @@ { for (int m = 0; m < bsq1.Values.Count; m++) { - if (chart1.Series["标识器"].Points[m].YValues[0].ToString() != "0") + if (chart1.Series["标识器"].Points[m]!=null&&chart1.Series["标识器"].Points[m].YValues[0].ToString() != "0") { count += Convert.ToInt16(chart1.Series[0].Points[m].YValues[0].ToString()); chart1.Series["标识器"].Points[m].Label = chart1.Series[0].Points[m].YValues[0].ToString(); diff --git a/FrmBSQDuoBianXingStreet.cs b/FrmBSQDuoBianXingStreet.cs index 2005ebb..1db5777 100644 --- a/FrmBSQDuoBianXingStreet.cs +++ b/FrmBSQDuoBianXingStreet.cs @@ -63,7 +63,7 @@ chartStatis.Series[0].Points.DataBindXY(bsq.Keys, bsq.Values); for (int m = 0; m < bsq.Values.Count; m++) { - if (chartStatis.Series[0].Points[m].YValues[0].ToString().Trim() != "0") + if (chartStatis.Series[0].Points[m]!=null&&chartStatis.Series[0].Points[m].YValues[0].ToString().Trim() != "0") { count += Convert.ToInt16(chartStatis.Series[0].Points[m].YValues[0].ToString()); chartStatis.Series[0].Points[m].Label = chartStatis.Series[0].Points[m].YValues[0].ToString(); diff --git a/FrmBSQStatis.cs b/FrmBSQStatis.cs index 390a55c..4aa0ee6 100644 --- a/FrmBSQStatis.cs +++ b/FrmBSQStatis.cs @@ -95,6 +95,8 @@ } } } + + dr.Close(); conn.Close(); for (int i = 0; i < typeLists.Count; i++) { @@ -123,7 +125,7 @@ chartStatis.Series[0].Points.DataBindXY(bsq.Keys, bsq.Values); for (int m = 0; m < bsq.Values.Count; m++) { - if (chartStatis.Series[0].Points[m].YValues[0].ToString().Trim() != "0") + if (chartStatis.Series[0].Points[m]!=null&&chartStatis.Series[0].Points[m].YValues[0].ToString().Trim() != "0") { //count += Convert.ToInt16(chartStatis.Series[0].Points[m].YValues[0].ToString()); chartStatis.Series[0].Points[m].Label = chartStatis.Series[0].Points[m].YValues[0].ToString(); diff --git a/FrmBSQStreet.cs b/FrmBSQStreet.cs index 9d88adb..7fbacad 100644 --- a/FrmBSQStreet.cs +++ b/FrmBSQStreet.cs @@ -44,7 +44,7 @@ chartStatis.Series[0].Points.DataBindXY(bsq.Keys, bsq.Values); for (int m = 0; m < bsq.Values.Count; m++) { - if (chartStatis.Series[0].Points[m].YValues[0].ToString().Trim() != "0") + if (chartStatis.Series[0].Points[m]!=null&&chartStatis.Series[0].Points[m].YValues[0].ToString().Trim() != "0") { count += Convert.ToInt16(chartStatis.Series[0].Points[m].YValues[0].ToString()); chartStatis.Series[0].Points[m].Label = chartStatis.Series[0].Points[m].YValues[0].ToString(); diff --git a/FrmBoosterValvers.cs b/FrmBoosterValvers.cs index 5061efc..df9b62b 100644 --- a/FrmBoosterValvers.cs +++ b/FrmBoosterValvers.cs @@ -236,199 +236,6 @@ count = 0; } } - /// - /// 添加火苗 - /// - /// - /// - /// - /// - private GSOFeature AddFire(double x,double y,double z) - { - // 烟火示例 - - string strResPath = Application.StartupPath + "/Resource"; - - // 烟火粒子示例,由三个发射器构成 - GSOGeoParticle geoParticle = new GSOGeoParticle(); - geoParticle.SetPosition(x, y, z); // 添加到这个经纬度位置 - geoParticle.AltitudeMode = EnumAltitudeMode.RelativeToGround; - - GSORingParticleEmitter emitter = new GSORingParticleEmitter(); - emitter.TexturePath = strResPath + "/ParticleImage/flare.png"; - - emitter.SetSizeFix(1, 1); - emitter.VelFix = 1; - emitter.VelRnd = 5; - - emitter.AngleXYFix = 0; - emitter.AngleXYRnd = 180; - - emitter.AngleXZFix = 90; - emitter.AngleXZRnd = 0; - - emitter.LifeFix = 0.5f; - emitter.LifeRnd = 0.0f; - - emitter.RotFix = 0; - emitter.RotRnd = 0; - - emitter.RotVelFix = 0; - emitter.RotVelRnd = 0; - - emitter.EmitPerSec = 100; - - // 采用线性插值生成粒子的初始颜色 - emitter.ColorRndStart = Color.White; - emitter.ColorRndEnd = Color.Red; - - - GSOColorParticleEffector effector2 = new GSOColorParticleEffector(); - effector2.SetColorChanged(0, -1, -1, 0); - effector2.StartTime = 0.0f; - effector2.EndTime = -1.0f; - emitter.AddEffector(effector2); - - // 将三个发射器添加到粒子对象中 - geoParticle.AddEmitter(emitter); - - geoParticle.Play(); - - GSOFeature feature = new GSOFeature(); - - feature.Geometry = geoParticle; - - globeControl1.Globe.MemoryLayer.AddFeature(feature); - - - return feature; - } - - /// - /// 添加喷泉 - /// - /// - private GSOFeature AddFountain() - { - string strResPath = Application.StartupPath + "/Resource"; - - GSOGeoParticle geoParticle = new GSOGeoParticle(); - geoParticle.SetPosition(116.314, 39.84, 0); // 添加到这个经纬度位置 - - GSOPointParticleEmitter emitter = new GSOPointParticleEmitter(); - emitter.TexturePath = strResPath + "/ParticleImage/test.png"; - - emitter.SetSizeFix(0.5f, 2); - emitter.VelFix = 10; - emitter.VelRnd = 2; - - emitter.GravityAcc = 9.8f; - emitter.AngleXYFix = 0; - emitter.AngleXYRnd = 180; - - emitter.AngleXZFix = 88; - emitter.AngleXZRnd = 2; - - //emitter.InnerRadius = 0; - // emitter.OuterRadius = 0.03f; - - emitter.LifeFix = 5.0f; - emitter.LifeRnd = 1.0f; - - emitter.RotFix = 0; - emitter.RotRnd = 0; - - emitter.RotVelFix = 0; - emitter.RotVelRnd = 0; - - emitter.EmitPerSec = 1000; - emitter.ColorRndStart = Color.FromArgb(33, 255, 255, 255); - emitter.ColorRndEnd = Color.FromArgb(11, 255, 255, 255); - emitter.IsLumAdded = false; - - // 将三个发射器添加到粒子对象中 - geoParticle.AddEmitter(emitter); - - geoParticle.Play(); - GSOFeature feature = new GSOFeature(); - - feature.Geometry = geoParticle; - - //globeControl1.Globe.MemoryLayer.AddFeature(feature); - globeControl1.Globe.FlyToFeature(feature); - - return feature; - } - - /// - /// 添加水柱 - /// - /// - private GSOFeature AddWaterLine() - { - string strResPath = Application.StartupPath + "/Resource"; - - GSOGeoParticle geoParticle = new GSOGeoParticle(); - geoParticle.SetPosition(116.308, 39.84, 0); // 添加到这个经纬度位置 - - GSOPointParticleEmitter emitter = new GSOPointParticleEmitter(); - - emitter.TexturePath = strResPath + "/ParticleImage/drop3.png"; - - geoParticle.TimerInterval = 1; - - emitter.SetSizeFix(2.0f, 2.0f); - - emitter.VelFix = 50; - emitter.VelRnd = 2; - - // emitter.IsLumAdded = false; - - emitter.GravityAcc = 9.8f; - emitter.AngleXYFix = 0; - emitter.AngleXYRnd = 2; - - emitter.AngleXZFix = 60; - emitter.AngleXZRnd = 2; - - //emitter.InnerRadius = 0; - // emitter.OuterRadius = 0.1f; - - emitter.LifeFix = 5.0f; - emitter.LifeRnd = 1.0f; - - emitter.RotFix = 0; - emitter.RotRnd = 0; - - emitter.RotVelFix = 0; - emitter.RotVelRnd = 0; - - emitter.EmitPerSec = 1500; - - emitter.ColorRndStart = Color.FromArgb(100, 222, 222, 222); - emitter.ColorRndEnd = Color.FromArgb(50, 222, 222, 222); - - /* - - GSOScaleParticleEffector effector1 = new GSOScaleParticleEffector(); - effector1.SetScale(0.2f, 0.2f); - effector1.StartTime = 0; - effector1.EndTime = -1; // 负数表示整个粒子生命结束 - emitter.AddEffector(effector1); - */ - - // 将三个发射器添加到粒子对象中 - geoParticle.AddEmitter(emitter); - - geoParticle.Play(); - GSOFeature feature = new GSOFeature(); - - feature.Geometry = geoParticle; - - //globeControl1.Globe.MemoryLayer.AddFeature(feature); - globeControl1.Globe.FlyToFeature(feature); - - return feature; - } + } } diff --git a/FrmBufferAnalysis.cs b/FrmBufferAnalysis.cs index f711133..db8ca59 100644 --- a/FrmBufferAnalysis.cs +++ b/FrmBufferAnalysis.cs @@ -123,39 +123,6 @@ } } /// - /// 半径文本框的键盘按键按下事件处理 - /// - /// - /// - private void txtRadius_KeyPress(object sender, KeyPressEventArgs e) - { - TextBox text = sender as TextBox; - if ((e.KeyChar < 48 || e.KeyChar > 57) && (e.KeyChar != 8) && (int)e.KeyChar != 46) - { - e.Handled = true; - } - if ((int)e.KeyChar == 46) //小数点 - { - if (text.Text.Length <= 0) - e.Handled = true; //小数点不能在第一位 - else //处理不规则的小数点 - { - float f; - float oldf; - bool b1 = false, b2 = false; - b1 = float.TryParse(text.Text, out oldf); - b2 = float.TryParse(text.Text + e.KeyChar.ToString(), out f); - if (b2 == false) - { - if (b1 == true) - e.Handled = true; - else - e.Handled = false; - } - } - } - } - /// /// 窗体关闭事件处理 /// /// diff --git a/FrmBufferAnalysisBSQ.cs b/FrmBufferAnalysisBSQ.cs index 24a96ca..f54208f 100644 --- a/FrmBufferAnalysisBSQ.cs +++ b/FrmBufferAnalysisBSQ.cs @@ -137,35 +137,7 @@ } } - private void txtRadius_KeyPress(object sender, KeyPressEventArgs e) - { - TextBox text = sender as TextBox; - if ((e.KeyChar < 48 || e.KeyChar > 57) && (e.KeyChar != 8) && (int)e.KeyChar != 46) - { - e.Handled = true; - } - if ((int)e.KeyChar == 46) //小数点 - { - if (text.Text.Length <= 0) - e.Handled = true; //小数点不能在第一位 - else //处理不规则的小数点 - { - float f; - float oldf; - bool b1 = false, b2 = false; - b1 = float.TryParse(text.Text, out oldf); - b2 = float.TryParse(text.Text + e.KeyChar.ToString(), out f); - if (b2 == false) - { - if (b1 == true) - e.Handled = true; - else - e.Handled = false; - } - } - } - } - + private void FrmBufferAnalysis_FormClosing(object sender, FormClosingEventArgs e) { //Form1.y = 0; @@ -316,27 +288,6 @@ } } - private void FlyToMenu_Click(object sender, EventArgs e) - { - if (m_feature != null) - { - if (m_feature.Geometry != null && m_feature.Geometry.Type == EnumGeometryType.GeoPolyline3D) - { - GSOGeoPolyline3D line = m_feature.Geometry as GSOGeoPolyline3D; - double length = line.GetSpaceLength(true, 6378137); - GSOGeoPolyline3D lineLine = line.GetSegment(0, length / 2); - GSOPoint3d point3d = lineLine[lineLine.PartCount - 1][lineLine[lineLine.PartCount - 1].Count - 1]; - - globeControl1.Globe.FlyToPosition(point3d, EnumAltitudeMode.Absolute, 0, 45, 5); - } - else - { - globeControl1.Globe.FlyToFeature(m_feature, 0, 45, 3); - } - LightMenu_Click(sender, e); - } - } - private void LightMenu_Click(object sender, EventArgs e) { flashflag = "single"; diff --git a/FrmDataBaseOpt.cs b/FrmDataBaseOpt.cs index b0c4b5d..8d7b69d 100644 --- a/FrmDataBaseOpt.cs +++ b/FrmDataBaseOpt.cs @@ -362,6 +362,7 @@ dbCombor.Items.Add(dblist[i].title); } } + /* /// /// 从配置文件读取数据库参数配置 /// @@ -428,6 +429,8 @@ } } + * */ + /* /// /// 向配置文件写入连接数据库的参数配置 /// @@ -485,6 +488,7 @@ MessageBox.Show(exp.ToString()); } } + * */ /// /// /// diff --git a/FrmDatabaseParaSetting.cs b/FrmDatabaseParaSetting.cs index a6fea46..63b596b 100644 --- a/FrmDatabaseParaSetting.cs +++ b/FrmDatabaseParaSetting.cs @@ -152,6 +152,7 @@ this.DialogResult = DialogResult.OK; this.Close(); } + /* /// /// 从配置文件读取数据库连接参数配置 /// @@ -218,6 +219,8 @@ } } + * */ + /* /// /// 向配置文件写入数据库参数配置 /// @@ -276,7 +279,7 @@ MessageBox.Show(ex.ToString()); } } - + */ /// /// 取消按钮事件处理 /// diff --git a/FrmDatabaseParaSetting2.cs b/FrmDatabaseParaSetting2.cs index 932d05e..96a87d5 100644 --- a/FrmDatabaseParaSetting2.cs +++ b/FrmDatabaseParaSetting2.cs @@ -148,6 +148,7 @@ this.DialogResult = DialogResult.OK; this.Close(); } + /* /// /// 从配置文件读取数据库连接参数配置 /// @@ -214,6 +215,8 @@ } } + * */ + /* /// /// 向配置文件写入数据库参数配置 /// @@ -272,7 +275,7 @@ MessageBox.Show(exp.ToString()); } } - + */ /// /// 取消按钮事件处理 /// diff --git a/FrmDiameterQuery.cs b/FrmDiameterQuery.cs index 68c948b..9a5215b 100644 --- a/FrmDiameterQuery.cs +++ b/FrmDiameterQuery.cs @@ -77,18 +77,7 @@ isBetween = true; } } - /// - /// 键盘按键按下事件处理 - /// - /// - /// - private void textBoxX1_KeyPress(object sender, KeyPressEventArgs e) - { - if ((e.KeyChar < 48 || e.KeyChar > 57) && e.KeyChar != 8) - { - e.Handled = true;//屏蔽 - } - } + bool isBetween = false; /// diff --git a/FrmDocumentEdit.cs b/FrmDocumentEdit.cs index aab2d31..e78a7ff 100644 --- a/FrmDocumentEdit.cs +++ b/FrmDocumentEdit.cs @@ -256,121 +256,6 @@ } - // - /// 将本地文件上传到指定的服务器(HttpWebRequest方法) - /// - /// 文件上传到的服务器 - /// 要上传的本地文件(全路径) - /// 文件上传后的名称 - /// 上传进度条 - /// 成功返回1,失败返回0 - private int Upload_Request(string address, string fileNamePath, string saveName, ProgressBar progressBar) - { - int returnValue = 0; - // 要上传的文件 - FileStream fs = new FileStream(fileNamePath, FileMode.Open, FileAccess.Read); - BinaryReader r = new BinaryReader(fs); - //时间戳 - string strBoundary = "----------" + DateTime.Now.Ticks.ToString("x"); - byte[] boundaryBytes = Encoding.ASCII.GetBytes("/r/n--" + strBoundary + "/r/n"); - //请求头部信息 - StringBuilder sb = new StringBuilder(); - sb.Append("--"); - sb.Append(strBoundary); - sb.Append("\r\n"); - sb.Append("Content-Disposition: form-data; name=\""); - sb.Append("file"); - sb.Append("\"; filename=\""); - sb.Append(saveName); - sb.Append("\""); - sb.Append("\r\n"); - sb.Append("Content-Type: "); - sb.Append("application/octet-stream"); - sb.Append("\r\n"); - sb.Append("\r\n"); - string strPostHeader = sb.ToString(); - byte[] postHeaderBytes = Encoding.UTF8.GetBytes(strPostHeader); - // 根据uri创建HttpWebRequest对象 - HttpWebRequest httpReq = (HttpWebRequest)WebRequest.Create(new Uri(address)); - httpReq.Method = "POST"; - //对发送的数据不使用缓存 - httpReq.AllowWriteStreamBuffering = false; - //设置获得响应的超时时间(300秒) - httpReq.Timeout = 300000; - httpReq.ContentType = "multipart/form-data; boundary=" + strBoundary; - long length = fs.Length + postHeaderBytes.Length + boundaryBytes.Length; - long fileLength = fs.Length; - httpReq.ContentLength = length; - try - { - progressBar.Maximum = int.MaxValue; - progressBar.Minimum = 0; - progressBar.Value = 0; - //每次上传4k - int bufferLength = 4096; - byte[] buffer = new byte[bufferLength]; - //已上传的字节数 - long offset = 0; - //开始上传时间 - DateTime startTime = DateTime.Now; - int size = r.Read(buffer, 0, bufferLength); - Stream postStream = httpReq.GetRequestStream(); - //发送请求头部消息 - postStream.Write(postHeaderBytes, 0, postHeaderBytes.Length); - while (size > 0) - { - postStream.Write(buffer, 0, size); - offset += size; - progressBar.Value = (int)(offset * (int.MaxValue / length)); - TimeSpan span = DateTime.Now - startTime; - double second = span.TotalSeconds; - //lblTime.Text = "已用时:" + second.ToString("F2") + "秒"; - //if (second > 0.001) - //{ - // lblSpeed.Text = " 平均速度:" + (offset / 1024 / second).ToString("0.00") + "KB/秒"; - //} - //else - //{ - // lblSpeed.Text = " 正在连接…"; - //} - //lblState.Text = "已上传:" + (offset * 100.0 / length).ToString("F2") + "%"; - //lblSize.Text = (offset / 1048576.0).ToString("F2") + "M/" + (fileLength / 1048576.0).ToString("F2") + "M"; - Application.DoEvents(); - size = r.Read(buffer, 0, bufferLength); - } - //添加尾部的时间戳 - postStream.Write(boundaryBytes, 0, boundaryBytes.Length); - postStream.Close(); - //获取服务器端的响应 - WebResponse webRespon = httpReq.GetResponse(); - Stream s = webRespon.GetResponseStream(); - StreamReader sr = new StreamReader(s); - //读取服务器端返回的消息 - String sReturnString = sr.ReadLine(); - s.Close(); - sr.Close(); - if (sReturnString == "Success") - { - returnValue = 1; - } - else if (sReturnString == "Error") - { - returnValue = 0; - } - } - catch(Exception ex) - { - returnValue = 0; - string str = ex.ToString(); - } - finally - { - fs.Close(); - r.Close(); - } - return returnValue; - } - private void btn_file_Click(object sender, EventArgs e) { OpenFileDialog dlg = new OpenFileDialog(); diff --git a/FrmExportCADS.cs b/FrmExportCADS.cs index 98772ea..59629dd 100644 --- a/FrmExportCADS.cs +++ b/FrmExportCADS.cs @@ -108,65 +108,6 @@ MessageBox.Show("请选中要导出的图层!", "提示", MessageBoxButtons.OK, MessageBoxIcon.Warning); } } - private Boolean MerageToFile(GSOFeatures features, String strDestFile, String strProj4)//图层追加 - { - if (features == null) - { - return false; - } - Boolean bSuccess = false; - - string strDir = GSOUtility.GetFileDir(strDestFile); - string strLPRJFile = GSOUtility.ChangeExt(strDestFile, ".lprj"); - string strExt = GSOUtility.GetFileExt(strDestFile); - - // 如果投影文件存在,投影以投影文件为准 - if (File.Exists(strLPRJFile)) - { - // 如果是dxf,则这样处理 - if (strExt.ToLower() == ".dxf") - { - string strTempSrcFile = strDir + "srcFeatures_dxftmp" + strExt; - globeControl1.Globe.DataManager.SaveFeatureData(features, strTempSrcFile, strLPRJFile, 4); - bSuccess = GSOUtility.MergeTwoDXFFileFeatures(strDestFile, strTempSrcFile); - File.Delete(strTempSrcFile); - } - else - { - GSOFeatures srcFeatures = globeControl1.Globe.DataManager.ReadFeatureData(strDestFile); - int nCount = features.Length; - int i = 0; - for (i = 0; i < nCount; i++) - { - srcFeatures.Add(features[i]); - } - bSuccess = globeControl1.Globe.DataManager.SaveFeatureData(srcFeatures, strDestFile, strLPRJFile, 4); - } - } - else - { - // 如果是dxf,则这样处理 - if (strExt.ToLower() == ".dxf") - { - string strTempSrcFile = strDir + "srcFeatures_dxftmp" + strExt; - globeControl1.Globe.DataManager.SaveFeatureData(features, strTempSrcFile, strProj4, 0); - bSuccess = GSOUtility.MergeTwoDXFFileFeatures(strDestFile, strTempSrcFile); - File.Delete(strTempSrcFile); - } - else - { - GSOFeatures srcFeatures = globeControl1.Globe.DataManager.ReadFeatureData(strDestFile); - int nCount = features.Length; - int i = 0; - for (i = 0; i < nCount; i++) - { - srcFeatures.Add(features[i]); - } - bSuccess = globeControl1.Globe.DataManager.SaveFeatureData(srcFeatures, strDestFile, strProj4, 0); - } - } - return bSuccess; - } /// /// 关闭按钮事件处理 /// diff --git a/FrmHDMAnalysis3.cs b/FrmHDMAnalysis3.cs index 4f73af6..2ada735 100644 --- a/FrmHDMAnalysis3.cs +++ b/FrmHDMAnalysis3.cs @@ -436,29 +436,6 @@ } layerTemp.RemoveAllFeature(); } - private void Export(GSOPoint3d _pnt, double r) - { - GSOPoint3ds pnts = new GSOPoint3ds(); - GSOPoint3d pnt = new GSOPoint3d(); - pnt.X = _pnt.X; - pnt.Y = _pnt.Y; - pnt.Z = _pnt.Z; - pnts.Add(pnt); - pnt.X = _pnt.X; - pnt.Y = _pnt.Y - 0.0000000005; - pnt.Z = _pnt.Z; - pnts.Add(pnt); - GSOGeoPolyline3D line = new GSOGeoPolyline3D(); - line.AddPart(pnts); - GSOGeoPolygon3D polygon = line.CreateBuffer(r * 2, true, 5, true, false); - GSOPoint3ds points = polygon[0]; - GSOGeoPolyline3D newLine = new GSOGeoPolyline3D(); - newLine.AddPart(points); - newLine.AltitudeMode = EnumAltitudeMode.RelativeToGround; - GSOFeature newFeature = new GSOFeature(); - newFeature.Geometry = newLine; - globeControl1.Globe.MemoryLayer.AddFeature(newFeature); - } private void ExportCAD(double a, double b, double r) { diff --git a/Cyberpipe.csproj b/Cyberpipe.csproj index 07a8c1a..e3cd12c 100644 --- a/Cyberpipe.csproj +++ b/Cyberpipe.csproj @@ -204,25 +204,6 @@ - - Form - - - F_GKT1数据输入输出.cs - - - Form - - - F_GKT1添加文件.cs - - - Form - - - F_GKT1添加项目.cs - - Form @@ -1068,18 +1049,6 @@ Frm_password_reset.cs - - Form - - - GKT.cs - - - Form - - - GKT1.cs - Form @@ -1258,12 +1227,6 @@ F_Projedit.cs - - Form - - - PED.cs - Form @@ -1331,16 +1294,6 @@ True Reference.map - - F_GKT1数据输入输出.cs - Designer - - - F_GKT1添加文件.cs - - - F_GKT1添加项目.cs - Form_EditTask.cs @@ -1836,12 +1789,6 @@ Frm_password_reset.cs - - GKT.cs - - - GKT1.cs - F_GKT数据输入输出.cs @@ -1934,9 +1881,6 @@ F_Projedit.cs - - PED.cs - F_数据输入输出.cs diff --git a/Cyberpipe.suo b/Cyberpipe.suo index 68ced4f..a1aecf8 100644 --- a/Cyberpipe.suo +++ b/Cyberpipe.suo Binary files differ diff --git a/EMS_Forms/Form_EditTask.cs b/EMS_Forms/Form_EditTask.cs index 718992f..f1d791f 100644 --- a/EMS_Forms/Form_EditTask.cs +++ b/EMS_Forms/Form_EditTask.cs @@ -119,7 +119,8 @@ String name = Convert.ToString(dr["USERNAME"]); comboBox_userName.Items.Add(name); - } + } + dr.Close(); comboBox_road.Items.Clear(); roadList = new List(); @@ -135,7 +136,7 @@ comboBox_road.Items.Add(name); } } - + dr1.Close(); conn.Close(); bool flag2 = false; @@ -185,7 +186,7 @@ catch (Exception ex) { - MessageBox.Show(ex.ToString()); + LogHelper.WriteLog(typeof(Form_EditTask), ex.Message); } } @@ -288,7 +289,7 @@ } catch (Exception ex) { - MessageBox.Show(ex.ToString()); + LogHelper.WriteLog(typeof(Form_EditTask), ex.Message); } } @@ -474,7 +475,7 @@ } catch (Exception ex) { - MessageBox.Show(ex.ToString()); + LogHelper.WriteLog(typeof(Form_EditTask), ex.Message); } this.Close(); @@ -495,6 +496,7 @@ { numList.Add(Convert.ToInt32(dr["DBID"])); } + dr.Close(); if (numList.Count == 0) { taskNumber = Convert.ToInt32(number) * 100; @@ -674,6 +676,7 @@ } } } + dr.Close(); conn.Close(); } diff --git a/EMS_Forms/Form_EventManager.cs b/EMS_Forms/Form_EventManager.cs index b18c45b..84807b2 100644 --- a/EMS_Forms/Form_EventManager.cs +++ b/EMS_Forms/Form_EventManager.cs @@ -64,6 +64,7 @@ comboBox_name.Items.Add(name); } + dr.Close(); conn.Close(); diff --git a/Forms/FrmMnModify.cs b/Forms/FrmMnModify.cs index 31cfc5f..d036360 100644 --- a/Forms/FrmMnModify.cs +++ b/Forms/FrmMnModify.cs @@ -68,15 +68,7 @@ questionGrid.Rows[idx].Cells[1].Value = sr.question; } } - /// 选中对象 - /// - /// - /// - /// - private void buttonX1_Click(object sender, EventArgs e) - { - globecontrol.Globe.Action = EnumAction3D.SelectObject; - } + /// /// 选中某一行 /// diff --git a/Forms/FrmPipelineModelDataBase.cs b/Forms/FrmPipelineModelDataBase.cs index 2acf0ca..7ce573f 100644 --- a/Forms/FrmPipelineModelDataBase.cs +++ b/Forms/FrmPipelineModelDataBase.cs @@ -35,19 +35,7 @@ ds = _ds; InitializeComponent(); } - /// - /// 单击选择shp格式文件 - /// - /// - /// - private void btnBrowseModel_Click(object sender, EventArgs e) - { - saveFileDialog1.Filter = "*.lgd|*.lgd"; - if (saveFileDialog1.ShowDialog() == DialogResult.OK) - { - txtModelLayer.Text = saveFileDialog1.FileName; - } - } + /// /// 窗体初始化事件处理 /// @@ -100,49 +88,6 @@ } } } - - private object convertFieldValue(string fieldname, object obj) - { - if (obj == null) - return null; - - try - { - string type = fields_types[fieldname].ToString(); - switch (type) - { - case "string": - return obj.ToString(); - case "int": - //return 101; - int intResult; - if (int.TryParse(obj.ToString(), out intResult)) - return intResult; - else - return null; - case "double": - //return 202.5; - double doubleResult; - if (double.TryParse(obj.ToString(), out doubleResult)) - return doubleResult; - else - return null; - case "date": - DateTime dtResult; - if (DateTime.TryParse(obj.ToString(), out dtResult)) - return dtResult; - else - return null; - } - return null; - } - catch (Exception ex) - { - MessageBox.Show(ex.ToString()); - return null; - } - } - public string lgdFilePath = ""; /// /// 选择管线颜色 @@ -610,33 +555,6 @@ { this.Close(); } - - private void cmbLayer_SelectedIndexChanged(object sender, EventArgs e) //选择图层 - { - GSOLayer layer = ctl.Globe.Layers.GetLayerByCaption(selectLayerName); - GSOFeatures features = layer.GetAllFeatures(); - if (features.Length == 0) - return; - - cmbFrom.Items.Clear(); - cmbTo.Items.Clear(); - cmbRadius.Items.Clear(); - cmbID.Items.Clear(); - for (int i = 0; i < features[0].GetFieldCount(); i++) - { - GeoScene.Data.GSOFieldDefn fielddef = (GeoScene.Data.GSOFieldDefn)(features[0].GetFieldDefn(i)); - - cmbFrom.Items.Add(fielddef.Name); - cmbTo.Items.Add(fielddef.Name); - cmbRadius.Items.Add(fielddef.Name); - cmbID.Items.Add(fielddef.Name); - } - cmbFrom.SelectedItem = "Deep1"; - cmbTo.SelectedItem = "Deep2"; - cmbRadius.SelectedItem = "Diameter"; - cmbID.SelectedItem = "Handle"; - } - private void buttonXLayerPath_Click(object sender, EventArgs e)//单击 选择shp格式的文件 { OpenFileDialog dlg = new OpenFileDialog(); diff --git a/Forms/FrmPipelineModelDataOneStep.cs b/Forms/FrmPipelineModelDataOneStep.cs index 18afda7..ec93b8a 100644 --- a/Forms/FrmPipelineModelDataOneStep.cs +++ b/Forms/FrmPipelineModelDataOneStep.cs @@ -38,19 +38,7 @@ layerTree = _layerTree; InitializeComponent(); } - /// - /// 单击选择shp格式文件 - /// - /// - /// - private void btnBrowseModel_Click(object sender, EventArgs e) - { - saveFileDialog1.Filter = "*.lgd|*.lgd"; - if (saveFileDialog1.ShowDialog() == DialogResult.OK) - { - txtModelLayer.Text = saveFileDialog1.FileName; - } - } + /// /// 窗体初始化事件处理 /// @@ -107,48 +95,7 @@ } } - private object convertFieldValue(string fieldname, object obj) - { - if (obj == null) - return null; - - try - { - string type = fields_types[fieldname].ToString(); - switch (type) - { - case "string": - return obj.ToString(); - case "int": - //return 101; - int intResult; - if (int.TryParse(obj.ToString(), out intResult)) - return intResult; - else - return null; - case "double": - //return 202.5; - double doubleResult; - if (double.TryParse(obj.ToString(), out doubleResult)) - return doubleResult; - else - return null; - case "date": - DateTime dtResult; - if (DateTime.TryParse(obj.ToString(), out dtResult)) - return dtResult; - else - return null; - } - return null; - } - catch (Exception ex) - { - MessageBox.Show(ex.ToString()); - return null; - } - } - + public string lgdFilePath = ""; /// /// 选择管线颜色 @@ -673,32 +620,6 @@ return featDs; } - private void cmbLayer_SelectedIndexChanged(object sender, EventArgs e) //选择图层 - { - GSOLayer layer = ctl.Globe.Layers.GetLayerByCaption(selectLayerName); - GSOFeatures features = layer.GetAllFeatures(); - if (features.Length == 0) - return; - - cmbFrom.Items.Clear(); - cmbTo.Items.Clear(); - cmbRadius.Items.Clear(); - cmbID.Items.Clear(); - for (int i = 0; i < features[0].GetFieldCount(); i++) - { - GeoScene.Data.GSOFieldDefn fielddef = (GeoScene.Data.GSOFieldDefn)(features[0].GetFieldDefn(i)); - - cmbFrom.Items.Add(fielddef.Name); - cmbTo.Items.Add(fielddef.Name); - cmbRadius.Items.Add(fielddef.Name); - cmbID.Items.Add(fielddef.Name); - } - cmbFrom.SelectedItem = "Deep1"; - cmbTo.SelectedItem = "Deep2"; - cmbRadius.SelectedItem = "Diameter"; - cmbID.SelectedItem = "Handle"; - } - private void buttonXLayerPath_Click(object sender, EventArgs e)//单击 选择shp格式的文件 { OpenFileDialog dlg = new OpenFileDialog(); @@ -949,38 +870,6 @@ } //txtLayername.Text = type + layername; } - /// - /// 连接数据库 - /// - /// - /// - private void buttonX1_Click(object sender, EventArgs e) - { - if (ds == null) - { - //没连的话,直接连接审核库; //审核库配置读配置文件 - string dbIp = Utility.sgdbip; - string database = Utility.sgdbname; - string user = Utility.sgdbuser; - string pass = Utility.sgdbpwd; - - if (!Utility.isNetworkConnectionSuccess(dbIp.Trim())) - { - MessageBox.Show("网络连接失败!", "提示"); - return; - } - - ds = ctl.Globe.DataManager.OpenOracleDataSource(dbIp + "/" + database, "", "", user, pass); - if (ds == null) - { - MessageBox.Show("数据库连接失败!", "提示", MessageBoxButtons.OK, MessageBoxIcon.Warning); - } - else - { - btnCreateModel.Enabled = true; - } - } - } private void btnClose_Click(object sender, EventArgs e) { diff --git a/Forms/FrmShRK.cs b/Forms/FrmShRK.cs index 0e2e722..f1d83cb 100644 --- a/Forms/FrmShRK.cs +++ b/Forms/FrmShRK.cs @@ -215,6 +215,7 @@ { sourcefeatds = sourcefeat as GSOFeatureDataset; } + if (sourcefeatds == null) return; sourcefeatds.Open(); GSOFeatures sourcefeatures = sourcefeatds.GetAllFeatures(); @@ -251,6 +252,7 @@ { desfeatds = desfeat as GSOFeatureDataset; } + if (desfeatds == null) return; desfeatds.Open(); //向新数据集写入字段 diff --git a/FrmAccessoriesSensor.cs b/FrmAccessoriesSensor.cs index 09fcdf1..2a7a80e 100644 --- a/FrmAccessoriesSensor.cs +++ b/FrmAccessoriesSensor.cs @@ -209,7 +209,7 @@ chart1.Series[0].Points.DataBindXY(dic.Keys, dic.Values); for (int m = 0; m < dic.Values.Count; m++) { - if (chart1.Series[0].Points[m].YValues[0].ToString() != "0") + if (chart1.Series[0].Points[m]!=null&&chart1.Series[0].Points[m].YValues[0].ToString() != "0") { chart1.Series[0].Points[m].Label = chart1.Series[0].Points[m].YValues[0].ToString(); } diff --git a/FrmAccessoriesgather.cs b/FrmAccessoriesgather.cs index 9e331e1..a475d9e 100644 --- a/FrmAccessoriesgather.cs +++ b/FrmAccessoriesgather.cs @@ -338,7 +338,7 @@ chart1.Series[0].Points.DataBindXY(dic.Keys, dic.Values); for (int m = 0; m < dic.Values.Count; m++) { - if (chart1.Series[0].Points[m].YValues[0].ToString() != "0") + if (chart1.Series[0].Points[m]!=null&&chart1.Series[0].Points[m].YValues[0].ToString() != "0") { chart1.Series[0].Points[m].Label = chart1.Series[0].Points[m].YValues[0].ToString(); } diff --git a/FrmAccessoryAnalysis.cs b/FrmAccessoryAnalysis.cs index 71d4579..44d4065 100644 --- a/FrmAccessoryAnalysis.cs +++ b/FrmAccessoryAnalysis.cs @@ -66,39 +66,6 @@ globeControl1.Refresh(); } /// - /// 键盘按键按下事件处理 - /// - /// - /// - private void txtRadius_KeyPress(object sender, KeyPressEventArgs e) - { - TextBox text = sender as TextBox; - if ((e.KeyChar < 48 || e.KeyChar > 57) && (e.KeyChar != 8) && (int)e.KeyChar != 46) - { - e.Handled = true; - } - if ((int)e.KeyChar == 46) //小数点 - { - if (text.Text.Length <= 0) - e.Handled = true; //小数点不能在第一位 - else //处理不规则的小数点 - { - float f; - float oldf; - bool b1 = false, b2 = false; - b1 = float.TryParse(text.Text, out oldf); - b2 = float.TryParse(text.Text + e.KeyChar.ToString(), out f); - if (b2 == false) - { - if (b1 == true) - e.Handled = true; - else - e.Handled = false; - } - } - } - } - /// /// 确定按钮事件处理 /// /// diff --git a/FrmAddValve.cs b/FrmAddValve.cs index 34d2fec..5f405b9 100644 --- a/FrmAddValve.cs +++ b/FrmAddValve.cs @@ -486,56 +486,6 @@ } } - - - - - - - - private void cmbLayer_SelectedIndexChanged(object sender, EventArgs e) - { - GSOLayer layer = globeControl1.Globe.Layers.GetLayerByCaption(selectLayerName); - GSOFeatures features = layer.GetAllFeatures(); - if (features.Length == 0) - return; - - combPath.Items.Clear(); - combZ.Items.Clear(); - combModelName.Items.Clear(); - - for (int i = 0; i < features[0].GetFieldCount(); i++) - { - GeoScene.Data.GSOFieldDefn fielddef = (GeoScene.Data.GSOFieldDefn)(features[0].GetFieldDefn(i)); - combPath.Items.Add(fielddef.Name); - combZ.Items.Add(fielddef.Name); - combModelName.Items.Add(fielddef.Name); - } - combModelName.SelectedItem = "编号"; - combPath.SelectedItem = "模型路径"; - if (combfile.SelectedIndex != -1) - { - - string layerCaption = combfile.SelectedItem.ToString().Trim(); - rukuLayer = globeControl1.Globe.Layers.GetLayerByCaption(layerCaption); - if (rukuLayer != null) - { - combPath.Items.Clear(); - combZ.Items.Clear(); - combModelName.Items.Clear(); - - } - for (int i = 0; i < features[0].GetFieldCount(); i++) - { - GeoScene.Data.GSOFieldDefn fielddef = (GeoScene.Data.GSOFieldDefn)(features[0].GetFieldDefn(i)); - combPath.Items.Add(fielddef.Name); - combZ.Items.Add(fielddef.Name); - combModelName.Items.Add(fielddef.Name); - } - combModelName.SelectedItem = "编号"; - combPath.SelectedItem = "模型路径"; - } - } /// /// 单击选择shp格式文件 /// diff --git a/FrmAddWellShp.cs b/FrmAddWellShp.cs index bb79ec0..a249725 100644 --- a/FrmAddWellShp.cs +++ b/FrmAddWellShp.cs @@ -478,32 +478,6 @@ } } } - - private void cmbLayer_SelectedIndexChanged(object sender, EventArgs e) - { - GSOLayer layer = globeControl1.Globe.Layers.GetLayerByCaption(selectLayerName); - GSOFeatures features = layer.GetAllFeatures(); - if (features.Length == 0) - return; - - combCode.Items.Clear(); - combDeep.Items.Clear(); - combModelName.Items.Clear(); - combAngle.Items.Clear(); - - for (int i = 0; i < features[0].GetFieldCount(); i++) - { - GeoScene.Data.GSOFieldDefn fielddef = (GeoScene.Data.GSOFieldDefn)(features[0].GetFieldDefn(i)); - combCode.Items.Add(fielddef.Name); - combDeep.Items.Add(fielddef.Name); - combModelName.Items.Add(fielddef.Name); - combAngle.Items.Add(fielddef.Name); - } - combCode.SelectedItem = "附属物编码"; - combDeep.SelectedItem = "井深"; - combModelName.SelectedItem = "编号"; - combAngle.SelectedItem = "符号角度"; - } /// /// 单击选择shp格式文件 /// diff --git a/FrmAddYuBiZiShp.cs b/FrmAddYuBiZiShp.cs index b312d51..332f037 100644 --- a/FrmAddYuBiZiShp.cs +++ b/FrmAddYuBiZiShp.cs @@ -383,80 +383,7 @@ } } - private void cmbLayer_SelectedIndexChanged(object sender, EventArgs e) - { - GSOLayer layer = globeControl1.Globe.Layers.GetLayerByCaption(selectLayerName); - GSOFeatures features = layer.GetAllFeatures(); - if (features.Length == 0) - return; - - combCode.Items.Clear(); - combDeep.Items.Clear(); - combModelName.Items.Clear(); - //comboLoad.Items.Clear(); - for (int i = 0; i < features[0].GetFieldCount(); i++) - { - GeoScene.Data.GSOFieldDefn fielddef = (GeoScene.Data.GSOFieldDefn)(features[0].GetFieldDefn(i)); - combCode.Items.Add(fielddef.Name); - combDeep.Items.Add(fielddef.Name); - combModelName.Items.Add(fielddef.Name); - //comboLoad.Items.Add(fielddef.Name); - } - combCode.SelectedItem = "附属物编码"; - combDeep.SelectedItem = "Z坐标"; - combModelName.SelectedItem = "编号"; - //comboLoad.SelectedItem = "模型路径"; - } - - private void buttonXLayerPath_Click(object sender, EventArgs e) - { - OpenFileDialog dlg = new OpenFileDialog(); - dlg.Filter = "*.shp|*.shp"; - dlg.Multiselect = false; - if (dlg.ShowDialog() == DialogResult.OK) - { - GSOLayer layer = globeControl1.Globe.Layers.Add(dlg.FileName); - string txtMessage = valiYBdata(layer); - if (txtMessage != "") - { - button3.Enabled = false; - //textBoxLayer.Text = ""; - combCode.Items.Clear(); - combDeep.Items.Clear(); - combModelName.Items.Clear(); - globeControl1.Globe.Layers.Remove(layer); - FrmValiDataShowErrorMessage showErrorMessage = new FrmValiDataShowErrorMessage(dlg.FileName, txtMessage); - showErrorMessage.ShowDialog(); - return; - } - else - { - button3.Enabled = true; - //textBoxLayer.Text = dlg.FileName; - selectLayerName = layer.Caption; - txtLayerName.Text = layer.Caption; - GSOFeatures features = layer.GetAllFeatures(); - if (features.Length == 0) - return; - - combCode.Items.Clear(); - combDeep.Items.Clear(); - combModelName.Items.Clear(); - for (int i = 0; i < features[0].GetFieldCount(); i++) - { - GeoScene.Data.GSOFieldDefn fielddef = (GeoScene.Data.GSOFieldDefn)(features[0].GetFieldDefn(i)); - combCode.Items.Add(fielddef.Name); - combDeep.Items.Add(fielddef.Name); - combModelName.Items.Add(fielddef.Name); - //comboLoad.Items.Add(fielddef.Name); - } - combCode.SelectedItem = "管点编码"; - combDeep.SelectedItem = "Z坐标"; - combModelName.SelectedItem = "编号"; - } - } - } - + private void FrmAddYuBiZiShp_FormClosing(object sender, FormClosingEventArgs e) { globeControl1.Globe.Refresh(); diff --git a/FrmAllPipelineStatis.cs b/FrmAllPipelineStatis.cs index 6421a26..a6eea29 100644 --- a/FrmAllPipelineStatis.cs +++ b/FrmAllPipelineStatis.cs @@ -84,7 +84,7 @@ chartAllAreaPipeline.Series["管线"].Points.DataBindXY(pipelineLengthAndType.Keys, pipelineLengthAndType.Values); for (int m = 0; m < pipelineLengthAndType.Values.Count; m++) { - if (chartAllAreaPipeline.Series["管线"].Points[m].YValues[0].ToString() != "0") + if (chartAllAreaPipeline.Series["管线"].Points[m]!=null&&chartAllAreaPipeline.Series["管线"].Points[m].YValues[0].ToString() != "0") { chartAllAreaPipeline.Series["管线"].Points[m].Label = chartAllAreaPipeline.Series[0].Points[m].YValues[0].ToString(); } @@ -94,7 +94,7 @@ } catch (Exception ex) { - //LogError.PublishError(ex); + LogHelper.WriteLog(typeof(FrmAllPipelineStatis), ex.Message); } } @@ -147,7 +147,7 @@ } DataTable dt = OledbHelper.QueryTable(sql); - if (dt != null && dt.Rows.Count > 0) + if (dt != null && dt.Rows.Count > 0 && chartAllAreaPipeline.Series["管线"].Points[indexHit]!=null) { dataGridViewX1.DataSource = dt; panel.Visible = true; diff --git a/FrmAllWorkWellStatis.cs b/FrmAllWorkWellStatis.cs index 6fec7af..6af8e4c 100644 --- a/FrmAllWorkWellStatis.cs +++ b/FrmAllWorkWellStatis.cs @@ -52,7 +52,7 @@ chartAllAreaPipeline.Series["井盖"].Points.DataBindXY(workWellLengthAndType.Keys, workWellLengthAndType.Values); for (int m = 0; m < workWellLengthAndType.Values.Count; m++) { - if (chartAllAreaPipeline.Series["井盖"].Points[m].YValues[0].ToString().Trim() != "0") + if (chartAllAreaPipeline.Series["井盖"].Points[m]!=null&&chartAllAreaPipeline.Series["井盖"].Points[m].YValues[0].ToString().Trim() != "0") { chartAllAreaPipeline.Series["井盖"].Points[m].Label = chartAllAreaPipeline.Series[0].Points[m].YValues[0].ToString(); } @@ -60,7 +60,7 @@ } catch (Exception ex) { - //LogError.PublishError(ex); + LogHelper.WriteLog(typeof(FrmAllWorkWellStatis), ex.Message); } } diff --git a/FrmBSQDuoBianXingStatis.cs b/FrmBSQDuoBianXingStatis.cs index e8b7d52..3e889b6 100644 --- a/FrmBSQDuoBianXingStatis.cs +++ b/FrmBSQDuoBianXingStatis.cs @@ -60,7 +60,7 @@ { for (int m = 0; m < bsq1.Values.Count; m++) { - if (chart1.Series["标识器"].Points[m].YValues[0].ToString() != "0") + if (chart1.Series["标识器"].Points[m]!=null&&chart1.Series["标识器"].Points[m].YValues[0].ToString() != "0") { count += Convert.ToInt16(chart1.Series[0].Points[m].YValues[0].ToString()); chart1.Series["标识器"].Points[m].Label = chart1.Series[0].Points[m].YValues[0].ToString(); diff --git a/FrmBSQDuoBianXingStreet.cs b/FrmBSQDuoBianXingStreet.cs index 2005ebb..1db5777 100644 --- a/FrmBSQDuoBianXingStreet.cs +++ b/FrmBSQDuoBianXingStreet.cs @@ -63,7 +63,7 @@ chartStatis.Series[0].Points.DataBindXY(bsq.Keys, bsq.Values); for (int m = 0; m < bsq.Values.Count; m++) { - if (chartStatis.Series[0].Points[m].YValues[0].ToString().Trim() != "0") + if (chartStatis.Series[0].Points[m]!=null&&chartStatis.Series[0].Points[m].YValues[0].ToString().Trim() != "0") { count += Convert.ToInt16(chartStatis.Series[0].Points[m].YValues[0].ToString()); chartStatis.Series[0].Points[m].Label = chartStatis.Series[0].Points[m].YValues[0].ToString(); diff --git a/FrmBSQStatis.cs b/FrmBSQStatis.cs index 390a55c..4aa0ee6 100644 --- a/FrmBSQStatis.cs +++ b/FrmBSQStatis.cs @@ -95,6 +95,8 @@ } } } + + dr.Close(); conn.Close(); for (int i = 0; i < typeLists.Count; i++) { @@ -123,7 +125,7 @@ chartStatis.Series[0].Points.DataBindXY(bsq.Keys, bsq.Values); for (int m = 0; m < bsq.Values.Count; m++) { - if (chartStatis.Series[0].Points[m].YValues[0].ToString().Trim() != "0") + if (chartStatis.Series[0].Points[m]!=null&&chartStatis.Series[0].Points[m].YValues[0].ToString().Trim() != "0") { //count += Convert.ToInt16(chartStatis.Series[0].Points[m].YValues[0].ToString()); chartStatis.Series[0].Points[m].Label = chartStatis.Series[0].Points[m].YValues[0].ToString(); diff --git a/FrmBSQStreet.cs b/FrmBSQStreet.cs index 9d88adb..7fbacad 100644 --- a/FrmBSQStreet.cs +++ b/FrmBSQStreet.cs @@ -44,7 +44,7 @@ chartStatis.Series[0].Points.DataBindXY(bsq.Keys, bsq.Values); for (int m = 0; m < bsq.Values.Count; m++) { - if (chartStatis.Series[0].Points[m].YValues[0].ToString().Trim() != "0") + if (chartStatis.Series[0].Points[m]!=null&&chartStatis.Series[0].Points[m].YValues[0].ToString().Trim() != "0") { count += Convert.ToInt16(chartStatis.Series[0].Points[m].YValues[0].ToString()); chartStatis.Series[0].Points[m].Label = chartStatis.Series[0].Points[m].YValues[0].ToString(); diff --git a/FrmBoosterValvers.cs b/FrmBoosterValvers.cs index 5061efc..df9b62b 100644 --- a/FrmBoosterValvers.cs +++ b/FrmBoosterValvers.cs @@ -236,199 +236,6 @@ count = 0; } } - /// - /// 添加火苗 - /// - /// - /// - /// - /// - private GSOFeature AddFire(double x,double y,double z) - { - // 烟火示例 - - string strResPath = Application.StartupPath + "/Resource"; - - // 烟火粒子示例,由三个发射器构成 - GSOGeoParticle geoParticle = new GSOGeoParticle(); - geoParticle.SetPosition(x, y, z); // 添加到这个经纬度位置 - geoParticle.AltitudeMode = EnumAltitudeMode.RelativeToGround; - - GSORingParticleEmitter emitter = new GSORingParticleEmitter(); - emitter.TexturePath = strResPath + "/ParticleImage/flare.png"; - - emitter.SetSizeFix(1, 1); - emitter.VelFix = 1; - emitter.VelRnd = 5; - - emitter.AngleXYFix = 0; - emitter.AngleXYRnd = 180; - - emitter.AngleXZFix = 90; - emitter.AngleXZRnd = 0; - - emitter.LifeFix = 0.5f; - emitter.LifeRnd = 0.0f; - - emitter.RotFix = 0; - emitter.RotRnd = 0; - - emitter.RotVelFix = 0; - emitter.RotVelRnd = 0; - - emitter.EmitPerSec = 100; - - // 采用线性插值生成粒子的初始颜色 - emitter.ColorRndStart = Color.White; - emitter.ColorRndEnd = Color.Red; - - - GSOColorParticleEffector effector2 = new GSOColorParticleEffector(); - effector2.SetColorChanged(0, -1, -1, 0); - effector2.StartTime = 0.0f; - effector2.EndTime = -1.0f; - emitter.AddEffector(effector2); - - // 将三个发射器添加到粒子对象中 - geoParticle.AddEmitter(emitter); - - geoParticle.Play(); - - GSOFeature feature = new GSOFeature(); - - feature.Geometry = geoParticle; - - globeControl1.Globe.MemoryLayer.AddFeature(feature); - - - return feature; - } - - /// - /// 添加喷泉 - /// - /// - private GSOFeature AddFountain() - { - string strResPath = Application.StartupPath + "/Resource"; - - GSOGeoParticle geoParticle = new GSOGeoParticle(); - geoParticle.SetPosition(116.314, 39.84, 0); // 添加到这个经纬度位置 - - GSOPointParticleEmitter emitter = new GSOPointParticleEmitter(); - emitter.TexturePath = strResPath + "/ParticleImage/test.png"; - - emitter.SetSizeFix(0.5f, 2); - emitter.VelFix = 10; - emitter.VelRnd = 2; - - emitter.GravityAcc = 9.8f; - emitter.AngleXYFix = 0; - emitter.AngleXYRnd = 180; - - emitter.AngleXZFix = 88; - emitter.AngleXZRnd = 2; - - //emitter.InnerRadius = 0; - // emitter.OuterRadius = 0.03f; - - emitter.LifeFix = 5.0f; - emitter.LifeRnd = 1.0f; - - emitter.RotFix = 0; - emitter.RotRnd = 0; - - emitter.RotVelFix = 0; - emitter.RotVelRnd = 0; - - emitter.EmitPerSec = 1000; - emitter.ColorRndStart = Color.FromArgb(33, 255, 255, 255); - emitter.ColorRndEnd = Color.FromArgb(11, 255, 255, 255); - emitter.IsLumAdded = false; - - // 将三个发射器添加到粒子对象中 - geoParticle.AddEmitter(emitter); - - geoParticle.Play(); - GSOFeature feature = new GSOFeature(); - - feature.Geometry = geoParticle; - - //globeControl1.Globe.MemoryLayer.AddFeature(feature); - globeControl1.Globe.FlyToFeature(feature); - - return feature; - } - - /// - /// 添加水柱 - /// - /// - private GSOFeature AddWaterLine() - { - string strResPath = Application.StartupPath + "/Resource"; - - GSOGeoParticle geoParticle = new GSOGeoParticle(); - geoParticle.SetPosition(116.308, 39.84, 0); // 添加到这个经纬度位置 - - GSOPointParticleEmitter emitter = new GSOPointParticleEmitter(); - - emitter.TexturePath = strResPath + "/ParticleImage/drop3.png"; - - geoParticle.TimerInterval = 1; - - emitter.SetSizeFix(2.0f, 2.0f); - - emitter.VelFix = 50; - emitter.VelRnd = 2; - - // emitter.IsLumAdded = false; - - emitter.GravityAcc = 9.8f; - emitter.AngleXYFix = 0; - emitter.AngleXYRnd = 2; - - emitter.AngleXZFix = 60; - emitter.AngleXZRnd = 2; - - //emitter.InnerRadius = 0; - // emitter.OuterRadius = 0.1f; - - emitter.LifeFix = 5.0f; - emitter.LifeRnd = 1.0f; - - emitter.RotFix = 0; - emitter.RotRnd = 0; - - emitter.RotVelFix = 0; - emitter.RotVelRnd = 0; - - emitter.EmitPerSec = 1500; - - emitter.ColorRndStart = Color.FromArgb(100, 222, 222, 222); - emitter.ColorRndEnd = Color.FromArgb(50, 222, 222, 222); - - /* - - GSOScaleParticleEffector effector1 = new GSOScaleParticleEffector(); - effector1.SetScale(0.2f, 0.2f); - effector1.StartTime = 0; - effector1.EndTime = -1; // 负数表示整个粒子生命结束 - emitter.AddEffector(effector1); - */ - - // 将三个发射器添加到粒子对象中 - geoParticle.AddEmitter(emitter); - - geoParticle.Play(); - GSOFeature feature = new GSOFeature(); - - feature.Geometry = geoParticle; - - //globeControl1.Globe.MemoryLayer.AddFeature(feature); - globeControl1.Globe.FlyToFeature(feature); - - return feature; - } + } } diff --git a/FrmBufferAnalysis.cs b/FrmBufferAnalysis.cs index f711133..db8ca59 100644 --- a/FrmBufferAnalysis.cs +++ b/FrmBufferAnalysis.cs @@ -123,39 +123,6 @@ } } /// - /// 半径文本框的键盘按键按下事件处理 - /// - /// - /// - private void txtRadius_KeyPress(object sender, KeyPressEventArgs e) - { - TextBox text = sender as TextBox; - if ((e.KeyChar < 48 || e.KeyChar > 57) && (e.KeyChar != 8) && (int)e.KeyChar != 46) - { - e.Handled = true; - } - if ((int)e.KeyChar == 46) //小数点 - { - if (text.Text.Length <= 0) - e.Handled = true; //小数点不能在第一位 - else //处理不规则的小数点 - { - float f; - float oldf; - bool b1 = false, b2 = false; - b1 = float.TryParse(text.Text, out oldf); - b2 = float.TryParse(text.Text + e.KeyChar.ToString(), out f); - if (b2 == false) - { - if (b1 == true) - e.Handled = true; - else - e.Handled = false; - } - } - } - } - /// /// 窗体关闭事件处理 /// /// diff --git a/FrmBufferAnalysisBSQ.cs b/FrmBufferAnalysisBSQ.cs index 24a96ca..f54208f 100644 --- a/FrmBufferAnalysisBSQ.cs +++ b/FrmBufferAnalysisBSQ.cs @@ -137,35 +137,7 @@ } } - private void txtRadius_KeyPress(object sender, KeyPressEventArgs e) - { - TextBox text = sender as TextBox; - if ((e.KeyChar < 48 || e.KeyChar > 57) && (e.KeyChar != 8) && (int)e.KeyChar != 46) - { - e.Handled = true; - } - if ((int)e.KeyChar == 46) //小数点 - { - if (text.Text.Length <= 0) - e.Handled = true; //小数点不能在第一位 - else //处理不规则的小数点 - { - float f; - float oldf; - bool b1 = false, b2 = false; - b1 = float.TryParse(text.Text, out oldf); - b2 = float.TryParse(text.Text + e.KeyChar.ToString(), out f); - if (b2 == false) - { - if (b1 == true) - e.Handled = true; - else - e.Handled = false; - } - } - } - } - + private void FrmBufferAnalysis_FormClosing(object sender, FormClosingEventArgs e) { //Form1.y = 0; @@ -316,27 +288,6 @@ } } - private void FlyToMenu_Click(object sender, EventArgs e) - { - if (m_feature != null) - { - if (m_feature.Geometry != null && m_feature.Geometry.Type == EnumGeometryType.GeoPolyline3D) - { - GSOGeoPolyline3D line = m_feature.Geometry as GSOGeoPolyline3D; - double length = line.GetSpaceLength(true, 6378137); - GSOGeoPolyline3D lineLine = line.GetSegment(0, length / 2); - GSOPoint3d point3d = lineLine[lineLine.PartCount - 1][lineLine[lineLine.PartCount - 1].Count - 1]; - - globeControl1.Globe.FlyToPosition(point3d, EnumAltitudeMode.Absolute, 0, 45, 5); - } - else - { - globeControl1.Globe.FlyToFeature(m_feature, 0, 45, 3); - } - LightMenu_Click(sender, e); - } - } - private void LightMenu_Click(object sender, EventArgs e) { flashflag = "single"; diff --git a/FrmDataBaseOpt.cs b/FrmDataBaseOpt.cs index b0c4b5d..8d7b69d 100644 --- a/FrmDataBaseOpt.cs +++ b/FrmDataBaseOpt.cs @@ -362,6 +362,7 @@ dbCombor.Items.Add(dblist[i].title); } } + /* /// /// 从配置文件读取数据库参数配置 /// @@ -428,6 +429,8 @@ } } + * */ + /* /// /// 向配置文件写入连接数据库的参数配置 /// @@ -485,6 +488,7 @@ MessageBox.Show(exp.ToString()); } } + * */ /// /// /// diff --git a/FrmDatabaseParaSetting.cs b/FrmDatabaseParaSetting.cs index a6fea46..63b596b 100644 --- a/FrmDatabaseParaSetting.cs +++ b/FrmDatabaseParaSetting.cs @@ -152,6 +152,7 @@ this.DialogResult = DialogResult.OK; this.Close(); } + /* /// /// 从配置文件读取数据库连接参数配置 /// @@ -218,6 +219,8 @@ } } + * */ + /* /// /// 向配置文件写入数据库参数配置 /// @@ -276,7 +279,7 @@ MessageBox.Show(ex.ToString()); } } - + */ /// /// 取消按钮事件处理 /// diff --git a/FrmDatabaseParaSetting2.cs b/FrmDatabaseParaSetting2.cs index 932d05e..96a87d5 100644 --- a/FrmDatabaseParaSetting2.cs +++ b/FrmDatabaseParaSetting2.cs @@ -148,6 +148,7 @@ this.DialogResult = DialogResult.OK; this.Close(); } + /* /// /// 从配置文件读取数据库连接参数配置 /// @@ -214,6 +215,8 @@ } } + * */ + /* /// /// 向配置文件写入数据库参数配置 /// @@ -272,7 +275,7 @@ MessageBox.Show(exp.ToString()); } } - + */ /// /// 取消按钮事件处理 /// diff --git a/FrmDiameterQuery.cs b/FrmDiameterQuery.cs index 68c948b..9a5215b 100644 --- a/FrmDiameterQuery.cs +++ b/FrmDiameterQuery.cs @@ -77,18 +77,7 @@ isBetween = true; } } - /// - /// 键盘按键按下事件处理 - /// - /// - /// - private void textBoxX1_KeyPress(object sender, KeyPressEventArgs e) - { - if ((e.KeyChar < 48 || e.KeyChar > 57) && e.KeyChar != 8) - { - e.Handled = true;//屏蔽 - } - } + bool isBetween = false; /// diff --git a/FrmDocumentEdit.cs b/FrmDocumentEdit.cs index aab2d31..e78a7ff 100644 --- a/FrmDocumentEdit.cs +++ b/FrmDocumentEdit.cs @@ -256,121 +256,6 @@ } - // - /// 将本地文件上传到指定的服务器(HttpWebRequest方法) - /// - /// 文件上传到的服务器 - /// 要上传的本地文件(全路径) - /// 文件上传后的名称 - /// 上传进度条 - /// 成功返回1,失败返回0 - private int Upload_Request(string address, string fileNamePath, string saveName, ProgressBar progressBar) - { - int returnValue = 0; - // 要上传的文件 - FileStream fs = new FileStream(fileNamePath, FileMode.Open, FileAccess.Read); - BinaryReader r = new BinaryReader(fs); - //时间戳 - string strBoundary = "----------" + DateTime.Now.Ticks.ToString("x"); - byte[] boundaryBytes = Encoding.ASCII.GetBytes("/r/n--" + strBoundary + "/r/n"); - //请求头部信息 - StringBuilder sb = new StringBuilder(); - sb.Append("--"); - sb.Append(strBoundary); - sb.Append("\r\n"); - sb.Append("Content-Disposition: form-data; name=\""); - sb.Append("file"); - sb.Append("\"; filename=\""); - sb.Append(saveName); - sb.Append("\""); - sb.Append("\r\n"); - sb.Append("Content-Type: "); - sb.Append("application/octet-stream"); - sb.Append("\r\n"); - sb.Append("\r\n"); - string strPostHeader = sb.ToString(); - byte[] postHeaderBytes = Encoding.UTF8.GetBytes(strPostHeader); - // 根据uri创建HttpWebRequest对象 - HttpWebRequest httpReq = (HttpWebRequest)WebRequest.Create(new Uri(address)); - httpReq.Method = "POST"; - //对发送的数据不使用缓存 - httpReq.AllowWriteStreamBuffering = false; - //设置获得响应的超时时间(300秒) - httpReq.Timeout = 300000; - httpReq.ContentType = "multipart/form-data; boundary=" + strBoundary; - long length = fs.Length + postHeaderBytes.Length + boundaryBytes.Length; - long fileLength = fs.Length; - httpReq.ContentLength = length; - try - { - progressBar.Maximum = int.MaxValue; - progressBar.Minimum = 0; - progressBar.Value = 0; - //每次上传4k - int bufferLength = 4096; - byte[] buffer = new byte[bufferLength]; - //已上传的字节数 - long offset = 0; - //开始上传时间 - DateTime startTime = DateTime.Now; - int size = r.Read(buffer, 0, bufferLength); - Stream postStream = httpReq.GetRequestStream(); - //发送请求头部消息 - postStream.Write(postHeaderBytes, 0, postHeaderBytes.Length); - while (size > 0) - { - postStream.Write(buffer, 0, size); - offset += size; - progressBar.Value = (int)(offset * (int.MaxValue / length)); - TimeSpan span = DateTime.Now - startTime; - double second = span.TotalSeconds; - //lblTime.Text = "已用时:" + second.ToString("F2") + "秒"; - //if (second > 0.001) - //{ - // lblSpeed.Text = " 平均速度:" + (offset / 1024 / second).ToString("0.00") + "KB/秒"; - //} - //else - //{ - // lblSpeed.Text = " 正在连接…"; - //} - //lblState.Text = "已上传:" + (offset * 100.0 / length).ToString("F2") + "%"; - //lblSize.Text = (offset / 1048576.0).ToString("F2") + "M/" + (fileLength / 1048576.0).ToString("F2") + "M"; - Application.DoEvents(); - size = r.Read(buffer, 0, bufferLength); - } - //添加尾部的时间戳 - postStream.Write(boundaryBytes, 0, boundaryBytes.Length); - postStream.Close(); - //获取服务器端的响应 - WebResponse webRespon = httpReq.GetResponse(); - Stream s = webRespon.GetResponseStream(); - StreamReader sr = new StreamReader(s); - //读取服务器端返回的消息 - String sReturnString = sr.ReadLine(); - s.Close(); - sr.Close(); - if (sReturnString == "Success") - { - returnValue = 1; - } - else if (sReturnString == "Error") - { - returnValue = 0; - } - } - catch(Exception ex) - { - returnValue = 0; - string str = ex.ToString(); - } - finally - { - fs.Close(); - r.Close(); - } - return returnValue; - } - private void btn_file_Click(object sender, EventArgs e) { OpenFileDialog dlg = new OpenFileDialog(); diff --git a/FrmExportCADS.cs b/FrmExportCADS.cs index 98772ea..59629dd 100644 --- a/FrmExportCADS.cs +++ b/FrmExportCADS.cs @@ -108,65 +108,6 @@ MessageBox.Show("请选中要导出的图层!", "提示", MessageBoxButtons.OK, MessageBoxIcon.Warning); } } - private Boolean MerageToFile(GSOFeatures features, String strDestFile, String strProj4)//图层追加 - { - if (features == null) - { - return false; - } - Boolean bSuccess = false; - - string strDir = GSOUtility.GetFileDir(strDestFile); - string strLPRJFile = GSOUtility.ChangeExt(strDestFile, ".lprj"); - string strExt = GSOUtility.GetFileExt(strDestFile); - - // 如果投影文件存在,投影以投影文件为准 - if (File.Exists(strLPRJFile)) - { - // 如果是dxf,则这样处理 - if (strExt.ToLower() == ".dxf") - { - string strTempSrcFile = strDir + "srcFeatures_dxftmp" + strExt; - globeControl1.Globe.DataManager.SaveFeatureData(features, strTempSrcFile, strLPRJFile, 4); - bSuccess = GSOUtility.MergeTwoDXFFileFeatures(strDestFile, strTempSrcFile); - File.Delete(strTempSrcFile); - } - else - { - GSOFeatures srcFeatures = globeControl1.Globe.DataManager.ReadFeatureData(strDestFile); - int nCount = features.Length; - int i = 0; - for (i = 0; i < nCount; i++) - { - srcFeatures.Add(features[i]); - } - bSuccess = globeControl1.Globe.DataManager.SaveFeatureData(srcFeatures, strDestFile, strLPRJFile, 4); - } - } - else - { - // 如果是dxf,则这样处理 - if (strExt.ToLower() == ".dxf") - { - string strTempSrcFile = strDir + "srcFeatures_dxftmp" + strExt; - globeControl1.Globe.DataManager.SaveFeatureData(features, strTempSrcFile, strProj4, 0); - bSuccess = GSOUtility.MergeTwoDXFFileFeatures(strDestFile, strTempSrcFile); - File.Delete(strTempSrcFile); - } - else - { - GSOFeatures srcFeatures = globeControl1.Globe.DataManager.ReadFeatureData(strDestFile); - int nCount = features.Length; - int i = 0; - for (i = 0; i < nCount; i++) - { - srcFeatures.Add(features[i]); - } - bSuccess = globeControl1.Globe.DataManager.SaveFeatureData(srcFeatures, strDestFile, strProj4, 0); - } - } - return bSuccess; - } /// /// 关闭按钮事件处理 /// diff --git a/FrmHDMAnalysis3.cs b/FrmHDMAnalysis3.cs index 4f73af6..2ada735 100644 --- a/FrmHDMAnalysis3.cs +++ b/FrmHDMAnalysis3.cs @@ -436,29 +436,6 @@ } layerTemp.RemoveAllFeature(); } - private void Export(GSOPoint3d _pnt, double r) - { - GSOPoint3ds pnts = new GSOPoint3ds(); - GSOPoint3d pnt = new GSOPoint3d(); - pnt.X = _pnt.X; - pnt.Y = _pnt.Y; - pnt.Z = _pnt.Z; - pnts.Add(pnt); - pnt.X = _pnt.X; - pnt.Y = _pnt.Y - 0.0000000005; - pnt.Z = _pnt.Z; - pnts.Add(pnt); - GSOGeoPolyline3D line = new GSOGeoPolyline3D(); - line.AddPart(pnts); - GSOGeoPolygon3D polygon = line.CreateBuffer(r * 2, true, 5, true, false); - GSOPoint3ds points = polygon[0]; - GSOGeoPolyline3D newLine = new GSOGeoPolyline3D(); - newLine.AddPart(points); - newLine.AltitudeMode = EnumAltitudeMode.RelativeToGround; - GSOFeature newFeature = new GSOFeature(); - newFeature.Geometry = newLine; - globeControl1.Globe.MemoryLayer.AddFeature(newFeature); - } private void ExportCAD(double a, double b, double r) { diff --git a/FrmHotFuncStat.cs b/FrmHotFuncStat.cs index c980f34..2eb1476 100644 --- a/FrmHotFuncStat.cs +++ b/FrmHotFuncStat.cs @@ -421,13 +421,6 @@ } } - private void HFS_Pderive_Click(object sender, EventArgs e) - { - if (TV_Files.SelectedNode != null) - { - HFSClass.GuideEdit_form("G", TV_Files, int.Parse(((ToolStripMenuItem)sender).Tag.ToString())); - } - } private void 导入ToolStripMenuItem_Click(object sender, EventArgs e) { @@ -530,22 +523,8 @@ } } - private void 导出ToolStripMenuItem1_Click(object sender, EventArgs e) - { - 导出ToolStripMenuItem2_Click(sender, e); - } + - private void TV_HFSSrchRslt_AfterCollapse(object sender, TreeViewEventArgs e) - { - e.Node.ImageIndex = 0; - } - - private void TV_HFSSrchRslt_AfterExpand(object sender, TreeViewEventArgs e) - { - HFSClass.ADD_TreeNode(TV_Files, e.Node); - e.Node.ImageIndex = 1; - } - private void 导出ToolStripMenuItem1_Click_1(object sender, EventArgs e) { if ((TV_HFSSrchRslt.SelectedNode != null) && (TV_HFSSrchRslt.SelectedNode.Parent != null)) diff --git a/Cyberpipe.csproj b/Cyberpipe.csproj index 07a8c1a..e3cd12c 100644 --- a/Cyberpipe.csproj +++ b/Cyberpipe.csproj @@ -204,25 +204,6 @@ - - Form - - - F_GKT1数据输入输出.cs - - - Form - - - F_GKT1添加文件.cs - - - Form - - - F_GKT1添加项目.cs - - Form @@ -1068,18 +1049,6 @@ Frm_password_reset.cs - - Form - - - GKT.cs - - - Form - - - GKT1.cs - Form @@ -1258,12 +1227,6 @@ F_Projedit.cs - - Form - - - PED.cs - Form @@ -1331,16 +1294,6 @@ True Reference.map - - F_GKT1数据输入输出.cs - Designer - - - F_GKT1添加文件.cs - - - F_GKT1添加项目.cs - Form_EditTask.cs @@ -1836,12 +1789,6 @@ Frm_password_reset.cs - - GKT.cs - - - GKT1.cs - F_GKT数据输入输出.cs @@ -1934,9 +1881,6 @@ F_Projedit.cs - - PED.cs - F_数据输入输出.cs diff --git a/Cyberpipe.suo b/Cyberpipe.suo index 68ced4f..a1aecf8 100644 --- a/Cyberpipe.suo +++ b/Cyberpipe.suo Binary files differ diff --git a/EMS_Forms/Form_EditTask.cs b/EMS_Forms/Form_EditTask.cs index 718992f..f1d791f 100644 --- a/EMS_Forms/Form_EditTask.cs +++ b/EMS_Forms/Form_EditTask.cs @@ -119,7 +119,8 @@ String name = Convert.ToString(dr["USERNAME"]); comboBox_userName.Items.Add(name); - } + } + dr.Close(); comboBox_road.Items.Clear(); roadList = new List(); @@ -135,7 +136,7 @@ comboBox_road.Items.Add(name); } } - + dr1.Close(); conn.Close(); bool flag2 = false; @@ -185,7 +186,7 @@ catch (Exception ex) { - MessageBox.Show(ex.ToString()); + LogHelper.WriteLog(typeof(Form_EditTask), ex.Message); } } @@ -288,7 +289,7 @@ } catch (Exception ex) { - MessageBox.Show(ex.ToString()); + LogHelper.WriteLog(typeof(Form_EditTask), ex.Message); } } @@ -474,7 +475,7 @@ } catch (Exception ex) { - MessageBox.Show(ex.ToString()); + LogHelper.WriteLog(typeof(Form_EditTask), ex.Message); } this.Close(); @@ -495,6 +496,7 @@ { numList.Add(Convert.ToInt32(dr["DBID"])); } + dr.Close(); if (numList.Count == 0) { taskNumber = Convert.ToInt32(number) * 100; @@ -674,6 +676,7 @@ } } } + dr.Close(); conn.Close(); } diff --git a/EMS_Forms/Form_EventManager.cs b/EMS_Forms/Form_EventManager.cs index b18c45b..84807b2 100644 --- a/EMS_Forms/Form_EventManager.cs +++ b/EMS_Forms/Form_EventManager.cs @@ -64,6 +64,7 @@ comboBox_name.Items.Add(name); } + dr.Close(); conn.Close(); diff --git a/Forms/FrmMnModify.cs b/Forms/FrmMnModify.cs index 31cfc5f..d036360 100644 --- a/Forms/FrmMnModify.cs +++ b/Forms/FrmMnModify.cs @@ -68,15 +68,7 @@ questionGrid.Rows[idx].Cells[1].Value = sr.question; } } - /// 选中对象 - /// - /// - /// - /// - private void buttonX1_Click(object sender, EventArgs e) - { - globecontrol.Globe.Action = EnumAction3D.SelectObject; - } + /// /// 选中某一行 /// diff --git a/Forms/FrmPipelineModelDataBase.cs b/Forms/FrmPipelineModelDataBase.cs index 2acf0ca..7ce573f 100644 --- a/Forms/FrmPipelineModelDataBase.cs +++ b/Forms/FrmPipelineModelDataBase.cs @@ -35,19 +35,7 @@ ds = _ds; InitializeComponent(); } - /// - /// 单击选择shp格式文件 - /// - /// - /// - private void btnBrowseModel_Click(object sender, EventArgs e) - { - saveFileDialog1.Filter = "*.lgd|*.lgd"; - if (saveFileDialog1.ShowDialog() == DialogResult.OK) - { - txtModelLayer.Text = saveFileDialog1.FileName; - } - } + /// /// 窗体初始化事件处理 /// @@ -100,49 +88,6 @@ } } } - - private object convertFieldValue(string fieldname, object obj) - { - if (obj == null) - return null; - - try - { - string type = fields_types[fieldname].ToString(); - switch (type) - { - case "string": - return obj.ToString(); - case "int": - //return 101; - int intResult; - if (int.TryParse(obj.ToString(), out intResult)) - return intResult; - else - return null; - case "double": - //return 202.5; - double doubleResult; - if (double.TryParse(obj.ToString(), out doubleResult)) - return doubleResult; - else - return null; - case "date": - DateTime dtResult; - if (DateTime.TryParse(obj.ToString(), out dtResult)) - return dtResult; - else - return null; - } - return null; - } - catch (Exception ex) - { - MessageBox.Show(ex.ToString()); - return null; - } - } - public string lgdFilePath = ""; /// /// 选择管线颜色 @@ -610,33 +555,6 @@ { this.Close(); } - - private void cmbLayer_SelectedIndexChanged(object sender, EventArgs e) //选择图层 - { - GSOLayer layer = ctl.Globe.Layers.GetLayerByCaption(selectLayerName); - GSOFeatures features = layer.GetAllFeatures(); - if (features.Length == 0) - return; - - cmbFrom.Items.Clear(); - cmbTo.Items.Clear(); - cmbRadius.Items.Clear(); - cmbID.Items.Clear(); - for (int i = 0; i < features[0].GetFieldCount(); i++) - { - GeoScene.Data.GSOFieldDefn fielddef = (GeoScene.Data.GSOFieldDefn)(features[0].GetFieldDefn(i)); - - cmbFrom.Items.Add(fielddef.Name); - cmbTo.Items.Add(fielddef.Name); - cmbRadius.Items.Add(fielddef.Name); - cmbID.Items.Add(fielddef.Name); - } - cmbFrom.SelectedItem = "Deep1"; - cmbTo.SelectedItem = "Deep2"; - cmbRadius.SelectedItem = "Diameter"; - cmbID.SelectedItem = "Handle"; - } - private void buttonXLayerPath_Click(object sender, EventArgs e)//单击 选择shp格式的文件 { OpenFileDialog dlg = new OpenFileDialog(); diff --git a/Forms/FrmPipelineModelDataOneStep.cs b/Forms/FrmPipelineModelDataOneStep.cs index 18afda7..ec93b8a 100644 --- a/Forms/FrmPipelineModelDataOneStep.cs +++ b/Forms/FrmPipelineModelDataOneStep.cs @@ -38,19 +38,7 @@ layerTree = _layerTree; InitializeComponent(); } - /// - /// 单击选择shp格式文件 - /// - /// - /// - private void btnBrowseModel_Click(object sender, EventArgs e) - { - saveFileDialog1.Filter = "*.lgd|*.lgd"; - if (saveFileDialog1.ShowDialog() == DialogResult.OK) - { - txtModelLayer.Text = saveFileDialog1.FileName; - } - } + /// /// 窗体初始化事件处理 /// @@ -107,48 +95,7 @@ } } - private object convertFieldValue(string fieldname, object obj) - { - if (obj == null) - return null; - - try - { - string type = fields_types[fieldname].ToString(); - switch (type) - { - case "string": - return obj.ToString(); - case "int": - //return 101; - int intResult; - if (int.TryParse(obj.ToString(), out intResult)) - return intResult; - else - return null; - case "double": - //return 202.5; - double doubleResult; - if (double.TryParse(obj.ToString(), out doubleResult)) - return doubleResult; - else - return null; - case "date": - DateTime dtResult; - if (DateTime.TryParse(obj.ToString(), out dtResult)) - return dtResult; - else - return null; - } - return null; - } - catch (Exception ex) - { - MessageBox.Show(ex.ToString()); - return null; - } - } - + public string lgdFilePath = ""; /// /// 选择管线颜色 @@ -673,32 +620,6 @@ return featDs; } - private void cmbLayer_SelectedIndexChanged(object sender, EventArgs e) //选择图层 - { - GSOLayer layer = ctl.Globe.Layers.GetLayerByCaption(selectLayerName); - GSOFeatures features = layer.GetAllFeatures(); - if (features.Length == 0) - return; - - cmbFrom.Items.Clear(); - cmbTo.Items.Clear(); - cmbRadius.Items.Clear(); - cmbID.Items.Clear(); - for (int i = 0; i < features[0].GetFieldCount(); i++) - { - GeoScene.Data.GSOFieldDefn fielddef = (GeoScene.Data.GSOFieldDefn)(features[0].GetFieldDefn(i)); - - cmbFrom.Items.Add(fielddef.Name); - cmbTo.Items.Add(fielddef.Name); - cmbRadius.Items.Add(fielddef.Name); - cmbID.Items.Add(fielddef.Name); - } - cmbFrom.SelectedItem = "Deep1"; - cmbTo.SelectedItem = "Deep2"; - cmbRadius.SelectedItem = "Diameter"; - cmbID.SelectedItem = "Handle"; - } - private void buttonXLayerPath_Click(object sender, EventArgs e)//单击 选择shp格式的文件 { OpenFileDialog dlg = new OpenFileDialog(); @@ -949,38 +870,6 @@ } //txtLayername.Text = type + layername; } - /// - /// 连接数据库 - /// - /// - /// - private void buttonX1_Click(object sender, EventArgs e) - { - if (ds == null) - { - //没连的话,直接连接审核库; //审核库配置读配置文件 - string dbIp = Utility.sgdbip; - string database = Utility.sgdbname; - string user = Utility.sgdbuser; - string pass = Utility.sgdbpwd; - - if (!Utility.isNetworkConnectionSuccess(dbIp.Trim())) - { - MessageBox.Show("网络连接失败!", "提示"); - return; - } - - ds = ctl.Globe.DataManager.OpenOracleDataSource(dbIp + "/" + database, "", "", user, pass); - if (ds == null) - { - MessageBox.Show("数据库连接失败!", "提示", MessageBoxButtons.OK, MessageBoxIcon.Warning); - } - else - { - btnCreateModel.Enabled = true; - } - } - } private void btnClose_Click(object sender, EventArgs e) { diff --git a/Forms/FrmShRK.cs b/Forms/FrmShRK.cs index 0e2e722..f1d83cb 100644 --- a/Forms/FrmShRK.cs +++ b/Forms/FrmShRK.cs @@ -215,6 +215,7 @@ { sourcefeatds = sourcefeat as GSOFeatureDataset; } + if (sourcefeatds == null) return; sourcefeatds.Open(); GSOFeatures sourcefeatures = sourcefeatds.GetAllFeatures(); @@ -251,6 +252,7 @@ { desfeatds = desfeat as GSOFeatureDataset; } + if (desfeatds == null) return; desfeatds.Open(); //向新数据集写入字段 diff --git a/FrmAccessoriesSensor.cs b/FrmAccessoriesSensor.cs index 09fcdf1..2a7a80e 100644 --- a/FrmAccessoriesSensor.cs +++ b/FrmAccessoriesSensor.cs @@ -209,7 +209,7 @@ chart1.Series[0].Points.DataBindXY(dic.Keys, dic.Values); for (int m = 0; m < dic.Values.Count; m++) { - if (chart1.Series[0].Points[m].YValues[0].ToString() != "0") + if (chart1.Series[0].Points[m]!=null&&chart1.Series[0].Points[m].YValues[0].ToString() != "0") { chart1.Series[0].Points[m].Label = chart1.Series[0].Points[m].YValues[0].ToString(); } diff --git a/FrmAccessoriesgather.cs b/FrmAccessoriesgather.cs index 9e331e1..a475d9e 100644 --- a/FrmAccessoriesgather.cs +++ b/FrmAccessoriesgather.cs @@ -338,7 +338,7 @@ chart1.Series[0].Points.DataBindXY(dic.Keys, dic.Values); for (int m = 0; m < dic.Values.Count; m++) { - if (chart1.Series[0].Points[m].YValues[0].ToString() != "0") + if (chart1.Series[0].Points[m]!=null&&chart1.Series[0].Points[m].YValues[0].ToString() != "0") { chart1.Series[0].Points[m].Label = chart1.Series[0].Points[m].YValues[0].ToString(); } diff --git a/FrmAccessoryAnalysis.cs b/FrmAccessoryAnalysis.cs index 71d4579..44d4065 100644 --- a/FrmAccessoryAnalysis.cs +++ b/FrmAccessoryAnalysis.cs @@ -66,39 +66,6 @@ globeControl1.Refresh(); } /// - /// 键盘按键按下事件处理 - /// - /// - /// - private void txtRadius_KeyPress(object sender, KeyPressEventArgs e) - { - TextBox text = sender as TextBox; - if ((e.KeyChar < 48 || e.KeyChar > 57) && (e.KeyChar != 8) && (int)e.KeyChar != 46) - { - e.Handled = true; - } - if ((int)e.KeyChar == 46) //小数点 - { - if (text.Text.Length <= 0) - e.Handled = true; //小数点不能在第一位 - else //处理不规则的小数点 - { - float f; - float oldf; - bool b1 = false, b2 = false; - b1 = float.TryParse(text.Text, out oldf); - b2 = float.TryParse(text.Text + e.KeyChar.ToString(), out f); - if (b2 == false) - { - if (b1 == true) - e.Handled = true; - else - e.Handled = false; - } - } - } - } - /// /// 确定按钮事件处理 /// /// diff --git a/FrmAddValve.cs b/FrmAddValve.cs index 34d2fec..5f405b9 100644 --- a/FrmAddValve.cs +++ b/FrmAddValve.cs @@ -486,56 +486,6 @@ } } - - - - - - - - private void cmbLayer_SelectedIndexChanged(object sender, EventArgs e) - { - GSOLayer layer = globeControl1.Globe.Layers.GetLayerByCaption(selectLayerName); - GSOFeatures features = layer.GetAllFeatures(); - if (features.Length == 0) - return; - - combPath.Items.Clear(); - combZ.Items.Clear(); - combModelName.Items.Clear(); - - for (int i = 0; i < features[0].GetFieldCount(); i++) - { - GeoScene.Data.GSOFieldDefn fielddef = (GeoScene.Data.GSOFieldDefn)(features[0].GetFieldDefn(i)); - combPath.Items.Add(fielddef.Name); - combZ.Items.Add(fielddef.Name); - combModelName.Items.Add(fielddef.Name); - } - combModelName.SelectedItem = "编号"; - combPath.SelectedItem = "模型路径"; - if (combfile.SelectedIndex != -1) - { - - string layerCaption = combfile.SelectedItem.ToString().Trim(); - rukuLayer = globeControl1.Globe.Layers.GetLayerByCaption(layerCaption); - if (rukuLayer != null) - { - combPath.Items.Clear(); - combZ.Items.Clear(); - combModelName.Items.Clear(); - - } - for (int i = 0; i < features[0].GetFieldCount(); i++) - { - GeoScene.Data.GSOFieldDefn fielddef = (GeoScene.Data.GSOFieldDefn)(features[0].GetFieldDefn(i)); - combPath.Items.Add(fielddef.Name); - combZ.Items.Add(fielddef.Name); - combModelName.Items.Add(fielddef.Name); - } - combModelName.SelectedItem = "编号"; - combPath.SelectedItem = "模型路径"; - } - } /// /// 单击选择shp格式文件 /// diff --git a/FrmAddWellShp.cs b/FrmAddWellShp.cs index bb79ec0..a249725 100644 --- a/FrmAddWellShp.cs +++ b/FrmAddWellShp.cs @@ -478,32 +478,6 @@ } } } - - private void cmbLayer_SelectedIndexChanged(object sender, EventArgs e) - { - GSOLayer layer = globeControl1.Globe.Layers.GetLayerByCaption(selectLayerName); - GSOFeatures features = layer.GetAllFeatures(); - if (features.Length == 0) - return; - - combCode.Items.Clear(); - combDeep.Items.Clear(); - combModelName.Items.Clear(); - combAngle.Items.Clear(); - - for (int i = 0; i < features[0].GetFieldCount(); i++) - { - GeoScene.Data.GSOFieldDefn fielddef = (GeoScene.Data.GSOFieldDefn)(features[0].GetFieldDefn(i)); - combCode.Items.Add(fielddef.Name); - combDeep.Items.Add(fielddef.Name); - combModelName.Items.Add(fielddef.Name); - combAngle.Items.Add(fielddef.Name); - } - combCode.SelectedItem = "附属物编码"; - combDeep.SelectedItem = "井深"; - combModelName.SelectedItem = "编号"; - combAngle.SelectedItem = "符号角度"; - } /// /// 单击选择shp格式文件 /// diff --git a/FrmAddYuBiZiShp.cs b/FrmAddYuBiZiShp.cs index b312d51..332f037 100644 --- a/FrmAddYuBiZiShp.cs +++ b/FrmAddYuBiZiShp.cs @@ -383,80 +383,7 @@ } } - private void cmbLayer_SelectedIndexChanged(object sender, EventArgs e) - { - GSOLayer layer = globeControl1.Globe.Layers.GetLayerByCaption(selectLayerName); - GSOFeatures features = layer.GetAllFeatures(); - if (features.Length == 0) - return; - - combCode.Items.Clear(); - combDeep.Items.Clear(); - combModelName.Items.Clear(); - //comboLoad.Items.Clear(); - for (int i = 0; i < features[0].GetFieldCount(); i++) - { - GeoScene.Data.GSOFieldDefn fielddef = (GeoScene.Data.GSOFieldDefn)(features[0].GetFieldDefn(i)); - combCode.Items.Add(fielddef.Name); - combDeep.Items.Add(fielddef.Name); - combModelName.Items.Add(fielddef.Name); - //comboLoad.Items.Add(fielddef.Name); - } - combCode.SelectedItem = "附属物编码"; - combDeep.SelectedItem = "Z坐标"; - combModelName.SelectedItem = "编号"; - //comboLoad.SelectedItem = "模型路径"; - } - - private void buttonXLayerPath_Click(object sender, EventArgs e) - { - OpenFileDialog dlg = new OpenFileDialog(); - dlg.Filter = "*.shp|*.shp"; - dlg.Multiselect = false; - if (dlg.ShowDialog() == DialogResult.OK) - { - GSOLayer layer = globeControl1.Globe.Layers.Add(dlg.FileName); - string txtMessage = valiYBdata(layer); - if (txtMessage != "") - { - button3.Enabled = false; - //textBoxLayer.Text = ""; - combCode.Items.Clear(); - combDeep.Items.Clear(); - combModelName.Items.Clear(); - globeControl1.Globe.Layers.Remove(layer); - FrmValiDataShowErrorMessage showErrorMessage = new FrmValiDataShowErrorMessage(dlg.FileName, txtMessage); - showErrorMessage.ShowDialog(); - return; - } - else - { - button3.Enabled = true; - //textBoxLayer.Text = dlg.FileName; - selectLayerName = layer.Caption; - txtLayerName.Text = layer.Caption; - GSOFeatures features = layer.GetAllFeatures(); - if (features.Length == 0) - return; - - combCode.Items.Clear(); - combDeep.Items.Clear(); - combModelName.Items.Clear(); - for (int i = 0; i < features[0].GetFieldCount(); i++) - { - GeoScene.Data.GSOFieldDefn fielddef = (GeoScene.Data.GSOFieldDefn)(features[0].GetFieldDefn(i)); - combCode.Items.Add(fielddef.Name); - combDeep.Items.Add(fielddef.Name); - combModelName.Items.Add(fielddef.Name); - //comboLoad.Items.Add(fielddef.Name); - } - combCode.SelectedItem = "管点编码"; - combDeep.SelectedItem = "Z坐标"; - combModelName.SelectedItem = "编号"; - } - } - } - + private void FrmAddYuBiZiShp_FormClosing(object sender, FormClosingEventArgs e) { globeControl1.Globe.Refresh(); diff --git a/FrmAllPipelineStatis.cs b/FrmAllPipelineStatis.cs index 6421a26..a6eea29 100644 --- a/FrmAllPipelineStatis.cs +++ b/FrmAllPipelineStatis.cs @@ -84,7 +84,7 @@ chartAllAreaPipeline.Series["管线"].Points.DataBindXY(pipelineLengthAndType.Keys, pipelineLengthAndType.Values); for (int m = 0; m < pipelineLengthAndType.Values.Count; m++) { - if (chartAllAreaPipeline.Series["管线"].Points[m].YValues[0].ToString() != "0") + if (chartAllAreaPipeline.Series["管线"].Points[m]!=null&&chartAllAreaPipeline.Series["管线"].Points[m].YValues[0].ToString() != "0") { chartAllAreaPipeline.Series["管线"].Points[m].Label = chartAllAreaPipeline.Series[0].Points[m].YValues[0].ToString(); } @@ -94,7 +94,7 @@ } catch (Exception ex) { - //LogError.PublishError(ex); + LogHelper.WriteLog(typeof(FrmAllPipelineStatis), ex.Message); } } @@ -147,7 +147,7 @@ } DataTable dt = OledbHelper.QueryTable(sql); - if (dt != null && dt.Rows.Count > 0) + if (dt != null && dt.Rows.Count > 0 && chartAllAreaPipeline.Series["管线"].Points[indexHit]!=null) { dataGridViewX1.DataSource = dt; panel.Visible = true; diff --git a/FrmAllWorkWellStatis.cs b/FrmAllWorkWellStatis.cs index 6fec7af..6af8e4c 100644 --- a/FrmAllWorkWellStatis.cs +++ b/FrmAllWorkWellStatis.cs @@ -52,7 +52,7 @@ chartAllAreaPipeline.Series["井盖"].Points.DataBindXY(workWellLengthAndType.Keys, workWellLengthAndType.Values); for (int m = 0; m < workWellLengthAndType.Values.Count; m++) { - if (chartAllAreaPipeline.Series["井盖"].Points[m].YValues[0].ToString().Trim() != "0") + if (chartAllAreaPipeline.Series["井盖"].Points[m]!=null&&chartAllAreaPipeline.Series["井盖"].Points[m].YValues[0].ToString().Trim() != "0") { chartAllAreaPipeline.Series["井盖"].Points[m].Label = chartAllAreaPipeline.Series[0].Points[m].YValues[0].ToString(); } @@ -60,7 +60,7 @@ } catch (Exception ex) { - //LogError.PublishError(ex); + LogHelper.WriteLog(typeof(FrmAllWorkWellStatis), ex.Message); } } diff --git a/FrmBSQDuoBianXingStatis.cs b/FrmBSQDuoBianXingStatis.cs index e8b7d52..3e889b6 100644 --- a/FrmBSQDuoBianXingStatis.cs +++ b/FrmBSQDuoBianXingStatis.cs @@ -60,7 +60,7 @@ { for (int m = 0; m < bsq1.Values.Count; m++) { - if (chart1.Series["标识器"].Points[m].YValues[0].ToString() != "0") + if (chart1.Series["标识器"].Points[m]!=null&&chart1.Series["标识器"].Points[m].YValues[0].ToString() != "0") { count += Convert.ToInt16(chart1.Series[0].Points[m].YValues[0].ToString()); chart1.Series["标识器"].Points[m].Label = chart1.Series[0].Points[m].YValues[0].ToString(); diff --git a/FrmBSQDuoBianXingStreet.cs b/FrmBSQDuoBianXingStreet.cs index 2005ebb..1db5777 100644 --- a/FrmBSQDuoBianXingStreet.cs +++ b/FrmBSQDuoBianXingStreet.cs @@ -63,7 +63,7 @@ chartStatis.Series[0].Points.DataBindXY(bsq.Keys, bsq.Values); for (int m = 0; m < bsq.Values.Count; m++) { - if (chartStatis.Series[0].Points[m].YValues[0].ToString().Trim() != "0") + if (chartStatis.Series[0].Points[m]!=null&&chartStatis.Series[0].Points[m].YValues[0].ToString().Trim() != "0") { count += Convert.ToInt16(chartStatis.Series[0].Points[m].YValues[0].ToString()); chartStatis.Series[0].Points[m].Label = chartStatis.Series[0].Points[m].YValues[0].ToString(); diff --git a/FrmBSQStatis.cs b/FrmBSQStatis.cs index 390a55c..4aa0ee6 100644 --- a/FrmBSQStatis.cs +++ b/FrmBSQStatis.cs @@ -95,6 +95,8 @@ } } } + + dr.Close(); conn.Close(); for (int i = 0; i < typeLists.Count; i++) { @@ -123,7 +125,7 @@ chartStatis.Series[0].Points.DataBindXY(bsq.Keys, bsq.Values); for (int m = 0; m < bsq.Values.Count; m++) { - if (chartStatis.Series[0].Points[m].YValues[0].ToString().Trim() != "0") + if (chartStatis.Series[0].Points[m]!=null&&chartStatis.Series[0].Points[m].YValues[0].ToString().Trim() != "0") { //count += Convert.ToInt16(chartStatis.Series[0].Points[m].YValues[0].ToString()); chartStatis.Series[0].Points[m].Label = chartStatis.Series[0].Points[m].YValues[0].ToString(); diff --git a/FrmBSQStreet.cs b/FrmBSQStreet.cs index 9d88adb..7fbacad 100644 --- a/FrmBSQStreet.cs +++ b/FrmBSQStreet.cs @@ -44,7 +44,7 @@ chartStatis.Series[0].Points.DataBindXY(bsq.Keys, bsq.Values); for (int m = 0; m < bsq.Values.Count; m++) { - if (chartStatis.Series[0].Points[m].YValues[0].ToString().Trim() != "0") + if (chartStatis.Series[0].Points[m]!=null&&chartStatis.Series[0].Points[m].YValues[0].ToString().Trim() != "0") { count += Convert.ToInt16(chartStatis.Series[0].Points[m].YValues[0].ToString()); chartStatis.Series[0].Points[m].Label = chartStatis.Series[0].Points[m].YValues[0].ToString(); diff --git a/FrmBoosterValvers.cs b/FrmBoosterValvers.cs index 5061efc..df9b62b 100644 --- a/FrmBoosterValvers.cs +++ b/FrmBoosterValvers.cs @@ -236,199 +236,6 @@ count = 0; } } - /// - /// 添加火苗 - /// - /// - /// - /// - /// - private GSOFeature AddFire(double x,double y,double z) - { - // 烟火示例 - - string strResPath = Application.StartupPath + "/Resource"; - - // 烟火粒子示例,由三个发射器构成 - GSOGeoParticle geoParticle = new GSOGeoParticle(); - geoParticle.SetPosition(x, y, z); // 添加到这个经纬度位置 - geoParticle.AltitudeMode = EnumAltitudeMode.RelativeToGround; - - GSORingParticleEmitter emitter = new GSORingParticleEmitter(); - emitter.TexturePath = strResPath + "/ParticleImage/flare.png"; - - emitter.SetSizeFix(1, 1); - emitter.VelFix = 1; - emitter.VelRnd = 5; - - emitter.AngleXYFix = 0; - emitter.AngleXYRnd = 180; - - emitter.AngleXZFix = 90; - emitter.AngleXZRnd = 0; - - emitter.LifeFix = 0.5f; - emitter.LifeRnd = 0.0f; - - emitter.RotFix = 0; - emitter.RotRnd = 0; - - emitter.RotVelFix = 0; - emitter.RotVelRnd = 0; - - emitter.EmitPerSec = 100; - - // 采用线性插值生成粒子的初始颜色 - emitter.ColorRndStart = Color.White; - emitter.ColorRndEnd = Color.Red; - - - GSOColorParticleEffector effector2 = new GSOColorParticleEffector(); - effector2.SetColorChanged(0, -1, -1, 0); - effector2.StartTime = 0.0f; - effector2.EndTime = -1.0f; - emitter.AddEffector(effector2); - - // 将三个发射器添加到粒子对象中 - geoParticle.AddEmitter(emitter); - - geoParticle.Play(); - - GSOFeature feature = new GSOFeature(); - - feature.Geometry = geoParticle; - - globeControl1.Globe.MemoryLayer.AddFeature(feature); - - - return feature; - } - - /// - /// 添加喷泉 - /// - /// - private GSOFeature AddFountain() - { - string strResPath = Application.StartupPath + "/Resource"; - - GSOGeoParticle geoParticle = new GSOGeoParticle(); - geoParticle.SetPosition(116.314, 39.84, 0); // 添加到这个经纬度位置 - - GSOPointParticleEmitter emitter = new GSOPointParticleEmitter(); - emitter.TexturePath = strResPath + "/ParticleImage/test.png"; - - emitter.SetSizeFix(0.5f, 2); - emitter.VelFix = 10; - emitter.VelRnd = 2; - - emitter.GravityAcc = 9.8f; - emitter.AngleXYFix = 0; - emitter.AngleXYRnd = 180; - - emitter.AngleXZFix = 88; - emitter.AngleXZRnd = 2; - - //emitter.InnerRadius = 0; - // emitter.OuterRadius = 0.03f; - - emitter.LifeFix = 5.0f; - emitter.LifeRnd = 1.0f; - - emitter.RotFix = 0; - emitter.RotRnd = 0; - - emitter.RotVelFix = 0; - emitter.RotVelRnd = 0; - - emitter.EmitPerSec = 1000; - emitter.ColorRndStart = Color.FromArgb(33, 255, 255, 255); - emitter.ColorRndEnd = Color.FromArgb(11, 255, 255, 255); - emitter.IsLumAdded = false; - - // 将三个发射器添加到粒子对象中 - geoParticle.AddEmitter(emitter); - - geoParticle.Play(); - GSOFeature feature = new GSOFeature(); - - feature.Geometry = geoParticle; - - //globeControl1.Globe.MemoryLayer.AddFeature(feature); - globeControl1.Globe.FlyToFeature(feature); - - return feature; - } - - /// - /// 添加水柱 - /// - /// - private GSOFeature AddWaterLine() - { - string strResPath = Application.StartupPath + "/Resource"; - - GSOGeoParticle geoParticle = new GSOGeoParticle(); - geoParticle.SetPosition(116.308, 39.84, 0); // 添加到这个经纬度位置 - - GSOPointParticleEmitter emitter = new GSOPointParticleEmitter(); - - emitter.TexturePath = strResPath + "/ParticleImage/drop3.png"; - - geoParticle.TimerInterval = 1; - - emitter.SetSizeFix(2.0f, 2.0f); - - emitter.VelFix = 50; - emitter.VelRnd = 2; - - // emitter.IsLumAdded = false; - - emitter.GravityAcc = 9.8f; - emitter.AngleXYFix = 0; - emitter.AngleXYRnd = 2; - - emitter.AngleXZFix = 60; - emitter.AngleXZRnd = 2; - - //emitter.InnerRadius = 0; - // emitter.OuterRadius = 0.1f; - - emitter.LifeFix = 5.0f; - emitter.LifeRnd = 1.0f; - - emitter.RotFix = 0; - emitter.RotRnd = 0; - - emitter.RotVelFix = 0; - emitter.RotVelRnd = 0; - - emitter.EmitPerSec = 1500; - - emitter.ColorRndStart = Color.FromArgb(100, 222, 222, 222); - emitter.ColorRndEnd = Color.FromArgb(50, 222, 222, 222); - - /* - - GSOScaleParticleEffector effector1 = new GSOScaleParticleEffector(); - effector1.SetScale(0.2f, 0.2f); - effector1.StartTime = 0; - effector1.EndTime = -1; // 负数表示整个粒子生命结束 - emitter.AddEffector(effector1); - */ - - // 将三个发射器添加到粒子对象中 - geoParticle.AddEmitter(emitter); - - geoParticle.Play(); - GSOFeature feature = new GSOFeature(); - - feature.Geometry = geoParticle; - - //globeControl1.Globe.MemoryLayer.AddFeature(feature); - globeControl1.Globe.FlyToFeature(feature); - - return feature; - } + } } diff --git a/FrmBufferAnalysis.cs b/FrmBufferAnalysis.cs index f711133..db8ca59 100644 --- a/FrmBufferAnalysis.cs +++ b/FrmBufferAnalysis.cs @@ -123,39 +123,6 @@ } } /// - /// 半径文本框的键盘按键按下事件处理 - /// - /// - /// - private void txtRadius_KeyPress(object sender, KeyPressEventArgs e) - { - TextBox text = sender as TextBox; - if ((e.KeyChar < 48 || e.KeyChar > 57) && (e.KeyChar != 8) && (int)e.KeyChar != 46) - { - e.Handled = true; - } - if ((int)e.KeyChar == 46) //小数点 - { - if (text.Text.Length <= 0) - e.Handled = true; //小数点不能在第一位 - else //处理不规则的小数点 - { - float f; - float oldf; - bool b1 = false, b2 = false; - b1 = float.TryParse(text.Text, out oldf); - b2 = float.TryParse(text.Text + e.KeyChar.ToString(), out f); - if (b2 == false) - { - if (b1 == true) - e.Handled = true; - else - e.Handled = false; - } - } - } - } - /// /// 窗体关闭事件处理 /// /// diff --git a/FrmBufferAnalysisBSQ.cs b/FrmBufferAnalysisBSQ.cs index 24a96ca..f54208f 100644 --- a/FrmBufferAnalysisBSQ.cs +++ b/FrmBufferAnalysisBSQ.cs @@ -137,35 +137,7 @@ } } - private void txtRadius_KeyPress(object sender, KeyPressEventArgs e) - { - TextBox text = sender as TextBox; - if ((e.KeyChar < 48 || e.KeyChar > 57) && (e.KeyChar != 8) && (int)e.KeyChar != 46) - { - e.Handled = true; - } - if ((int)e.KeyChar == 46) //小数点 - { - if (text.Text.Length <= 0) - e.Handled = true; //小数点不能在第一位 - else //处理不规则的小数点 - { - float f; - float oldf; - bool b1 = false, b2 = false; - b1 = float.TryParse(text.Text, out oldf); - b2 = float.TryParse(text.Text + e.KeyChar.ToString(), out f); - if (b2 == false) - { - if (b1 == true) - e.Handled = true; - else - e.Handled = false; - } - } - } - } - + private void FrmBufferAnalysis_FormClosing(object sender, FormClosingEventArgs e) { //Form1.y = 0; @@ -316,27 +288,6 @@ } } - private void FlyToMenu_Click(object sender, EventArgs e) - { - if (m_feature != null) - { - if (m_feature.Geometry != null && m_feature.Geometry.Type == EnumGeometryType.GeoPolyline3D) - { - GSOGeoPolyline3D line = m_feature.Geometry as GSOGeoPolyline3D; - double length = line.GetSpaceLength(true, 6378137); - GSOGeoPolyline3D lineLine = line.GetSegment(0, length / 2); - GSOPoint3d point3d = lineLine[lineLine.PartCount - 1][lineLine[lineLine.PartCount - 1].Count - 1]; - - globeControl1.Globe.FlyToPosition(point3d, EnumAltitudeMode.Absolute, 0, 45, 5); - } - else - { - globeControl1.Globe.FlyToFeature(m_feature, 0, 45, 3); - } - LightMenu_Click(sender, e); - } - } - private void LightMenu_Click(object sender, EventArgs e) { flashflag = "single"; diff --git a/FrmDataBaseOpt.cs b/FrmDataBaseOpt.cs index b0c4b5d..8d7b69d 100644 --- a/FrmDataBaseOpt.cs +++ b/FrmDataBaseOpt.cs @@ -362,6 +362,7 @@ dbCombor.Items.Add(dblist[i].title); } } + /* /// /// 从配置文件读取数据库参数配置 /// @@ -428,6 +429,8 @@ } } + * */ + /* /// /// 向配置文件写入连接数据库的参数配置 /// @@ -485,6 +488,7 @@ MessageBox.Show(exp.ToString()); } } + * */ /// /// /// diff --git a/FrmDatabaseParaSetting.cs b/FrmDatabaseParaSetting.cs index a6fea46..63b596b 100644 --- a/FrmDatabaseParaSetting.cs +++ b/FrmDatabaseParaSetting.cs @@ -152,6 +152,7 @@ this.DialogResult = DialogResult.OK; this.Close(); } + /* /// /// 从配置文件读取数据库连接参数配置 /// @@ -218,6 +219,8 @@ } } + * */ + /* /// /// 向配置文件写入数据库参数配置 /// @@ -276,7 +279,7 @@ MessageBox.Show(ex.ToString()); } } - + */ /// /// 取消按钮事件处理 /// diff --git a/FrmDatabaseParaSetting2.cs b/FrmDatabaseParaSetting2.cs index 932d05e..96a87d5 100644 --- a/FrmDatabaseParaSetting2.cs +++ b/FrmDatabaseParaSetting2.cs @@ -148,6 +148,7 @@ this.DialogResult = DialogResult.OK; this.Close(); } + /* /// /// 从配置文件读取数据库连接参数配置 /// @@ -214,6 +215,8 @@ } } + * */ + /* /// /// 向配置文件写入数据库参数配置 /// @@ -272,7 +275,7 @@ MessageBox.Show(exp.ToString()); } } - + */ /// /// 取消按钮事件处理 /// diff --git a/FrmDiameterQuery.cs b/FrmDiameterQuery.cs index 68c948b..9a5215b 100644 --- a/FrmDiameterQuery.cs +++ b/FrmDiameterQuery.cs @@ -77,18 +77,7 @@ isBetween = true; } } - /// - /// 键盘按键按下事件处理 - /// - /// - /// - private void textBoxX1_KeyPress(object sender, KeyPressEventArgs e) - { - if ((e.KeyChar < 48 || e.KeyChar > 57) && e.KeyChar != 8) - { - e.Handled = true;//屏蔽 - } - } + bool isBetween = false; /// diff --git a/FrmDocumentEdit.cs b/FrmDocumentEdit.cs index aab2d31..e78a7ff 100644 --- a/FrmDocumentEdit.cs +++ b/FrmDocumentEdit.cs @@ -256,121 +256,6 @@ } - // - /// 将本地文件上传到指定的服务器(HttpWebRequest方法) - /// - /// 文件上传到的服务器 - /// 要上传的本地文件(全路径) - /// 文件上传后的名称 - /// 上传进度条 - /// 成功返回1,失败返回0 - private int Upload_Request(string address, string fileNamePath, string saveName, ProgressBar progressBar) - { - int returnValue = 0; - // 要上传的文件 - FileStream fs = new FileStream(fileNamePath, FileMode.Open, FileAccess.Read); - BinaryReader r = new BinaryReader(fs); - //时间戳 - string strBoundary = "----------" + DateTime.Now.Ticks.ToString("x"); - byte[] boundaryBytes = Encoding.ASCII.GetBytes("/r/n--" + strBoundary + "/r/n"); - //请求头部信息 - StringBuilder sb = new StringBuilder(); - sb.Append("--"); - sb.Append(strBoundary); - sb.Append("\r\n"); - sb.Append("Content-Disposition: form-data; name=\""); - sb.Append("file"); - sb.Append("\"; filename=\""); - sb.Append(saveName); - sb.Append("\""); - sb.Append("\r\n"); - sb.Append("Content-Type: "); - sb.Append("application/octet-stream"); - sb.Append("\r\n"); - sb.Append("\r\n"); - string strPostHeader = sb.ToString(); - byte[] postHeaderBytes = Encoding.UTF8.GetBytes(strPostHeader); - // 根据uri创建HttpWebRequest对象 - HttpWebRequest httpReq = (HttpWebRequest)WebRequest.Create(new Uri(address)); - httpReq.Method = "POST"; - //对发送的数据不使用缓存 - httpReq.AllowWriteStreamBuffering = false; - //设置获得响应的超时时间(300秒) - httpReq.Timeout = 300000; - httpReq.ContentType = "multipart/form-data; boundary=" + strBoundary; - long length = fs.Length + postHeaderBytes.Length + boundaryBytes.Length; - long fileLength = fs.Length; - httpReq.ContentLength = length; - try - { - progressBar.Maximum = int.MaxValue; - progressBar.Minimum = 0; - progressBar.Value = 0; - //每次上传4k - int bufferLength = 4096; - byte[] buffer = new byte[bufferLength]; - //已上传的字节数 - long offset = 0; - //开始上传时间 - DateTime startTime = DateTime.Now; - int size = r.Read(buffer, 0, bufferLength); - Stream postStream = httpReq.GetRequestStream(); - //发送请求头部消息 - postStream.Write(postHeaderBytes, 0, postHeaderBytes.Length); - while (size > 0) - { - postStream.Write(buffer, 0, size); - offset += size; - progressBar.Value = (int)(offset * (int.MaxValue / length)); - TimeSpan span = DateTime.Now - startTime; - double second = span.TotalSeconds; - //lblTime.Text = "已用时:" + second.ToString("F2") + "秒"; - //if (second > 0.001) - //{ - // lblSpeed.Text = " 平均速度:" + (offset / 1024 / second).ToString("0.00") + "KB/秒"; - //} - //else - //{ - // lblSpeed.Text = " 正在连接…"; - //} - //lblState.Text = "已上传:" + (offset * 100.0 / length).ToString("F2") + "%"; - //lblSize.Text = (offset / 1048576.0).ToString("F2") + "M/" + (fileLength / 1048576.0).ToString("F2") + "M"; - Application.DoEvents(); - size = r.Read(buffer, 0, bufferLength); - } - //添加尾部的时间戳 - postStream.Write(boundaryBytes, 0, boundaryBytes.Length); - postStream.Close(); - //获取服务器端的响应 - WebResponse webRespon = httpReq.GetResponse(); - Stream s = webRespon.GetResponseStream(); - StreamReader sr = new StreamReader(s); - //读取服务器端返回的消息 - String sReturnString = sr.ReadLine(); - s.Close(); - sr.Close(); - if (sReturnString == "Success") - { - returnValue = 1; - } - else if (sReturnString == "Error") - { - returnValue = 0; - } - } - catch(Exception ex) - { - returnValue = 0; - string str = ex.ToString(); - } - finally - { - fs.Close(); - r.Close(); - } - return returnValue; - } - private void btn_file_Click(object sender, EventArgs e) { OpenFileDialog dlg = new OpenFileDialog(); diff --git a/FrmExportCADS.cs b/FrmExportCADS.cs index 98772ea..59629dd 100644 --- a/FrmExportCADS.cs +++ b/FrmExportCADS.cs @@ -108,65 +108,6 @@ MessageBox.Show("请选中要导出的图层!", "提示", MessageBoxButtons.OK, MessageBoxIcon.Warning); } } - private Boolean MerageToFile(GSOFeatures features, String strDestFile, String strProj4)//图层追加 - { - if (features == null) - { - return false; - } - Boolean bSuccess = false; - - string strDir = GSOUtility.GetFileDir(strDestFile); - string strLPRJFile = GSOUtility.ChangeExt(strDestFile, ".lprj"); - string strExt = GSOUtility.GetFileExt(strDestFile); - - // 如果投影文件存在,投影以投影文件为准 - if (File.Exists(strLPRJFile)) - { - // 如果是dxf,则这样处理 - if (strExt.ToLower() == ".dxf") - { - string strTempSrcFile = strDir + "srcFeatures_dxftmp" + strExt; - globeControl1.Globe.DataManager.SaveFeatureData(features, strTempSrcFile, strLPRJFile, 4); - bSuccess = GSOUtility.MergeTwoDXFFileFeatures(strDestFile, strTempSrcFile); - File.Delete(strTempSrcFile); - } - else - { - GSOFeatures srcFeatures = globeControl1.Globe.DataManager.ReadFeatureData(strDestFile); - int nCount = features.Length; - int i = 0; - for (i = 0; i < nCount; i++) - { - srcFeatures.Add(features[i]); - } - bSuccess = globeControl1.Globe.DataManager.SaveFeatureData(srcFeatures, strDestFile, strLPRJFile, 4); - } - } - else - { - // 如果是dxf,则这样处理 - if (strExt.ToLower() == ".dxf") - { - string strTempSrcFile = strDir + "srcFeatures_dxftmp" + strExt; - globeControl1.Globe.DataManager.SaveFeatureData(features, strTempSrcFile, strProj4, 0); - bSuccess = GSOUtility.MergeTwoDXFFileFeatures(strDestFile, strTempSrcFile); - File.Delete(strTempSrcFile); - } - else - { - GSOFeatures srcFeatures = globeControl1.Globe.DataManager.ReadFeatureData(strDestFile); - int nCount = features.Length; - int i = 0; - for (i = 0; i < nCount; i++) - { - srcFeatures.Add(features[i]); - } - bSuccess = globeControl1.Globe.DataManager.SaveFeatureData(srcFeatures, strDestFile, strProj4, 0); - } - } - return bSuccess; - } /// /// 关闭按钮事件处理 /// diff --git a/FrmHDMAnalysis3.cs b/FrmHDMAnalysis3.cs index 4f73af6..2ada735 100644 --- a/FrmHDMAnalysis3.cs +++ b/FrmHDMAnalysis3.cs @@ -436,29 +436,6 @@ } layerTemp.RemoveAllFeature(); } - private void Export(GSOPoint3d _pnt, double r) - { - GSOPoint3ds pnts = new GSOPoint3ds(); - GSOPoint3d pnt = new GSOPoint3d(); - pnt.X = _pnt.X; - pnt.Y = _pnt.Y; - pnt.Z = _pnt.Z; - pnts.Add(pnt); - pnt.X = _pnt.X; - pnt.Y = _pnt.Y - 0.0000000005; - pnt.Z = _pnt.Z; - pnts.Add(pnt); - GSOGeoPolyline3D line = new GSOGeoPolyline3D(); - line.AddPart(pnts); - GSOGeoPolygon3D polygon = line.CreateBuffer(r * 2, true, 5, true, false); - GSOPoint3ds points = polygon[0]; - GSOGeoPolyline3D newLine = new GSOGeoPolyline3D(); - newLine.AddPart(points); - newLine.AltitudeMode = EnumAltitudeMode.RelativeToGround; - GSOFeature newFeature = new GSOFeature(); - newFeature.Geometry = newLine; - globeControl1.Globe.MemoryLayer.AddFeature(newFeature); - } private void ExportCAD(double a, double b, double r) { diff --git a/FrmHotFuncStat.cs b/FrmHotFuncStat.cs index c980f34..2eb1476 100644 --- a/FrmHotFuncStat.cs +++ b/FrmHotFuncStat.cs @@ -421,13 +421,6 @@ } } - private void HFS_Pderive_Click(object sender, EventArgs e) - { - if (TV_Files.SelectedNode != null) - { - HFSClass.GuideEdit_form("G", TV_Files, int.Parse(((ToolStripMenuItem)sender).Tag.ToString())); - } - } private void 导入ToolStripMenuItem_Click(object sender, EventArgs e) { @@ -530,22 +523,8 @@ } } - private void 导出ToolStripMenuItem1_Click(object sender, EventArgs e) - { - 导出ToolStripMenuItem2_Click(sender, e); - } + - private void TV_HFSSrchRslt_AfterCollapse(object sender, TreeViewEventArgs e) - { - e.Node.ImageIndex = 0; - } - - private void TV_HFSSrchRslt_AfterExpand(object sender, TreeViewEventArgs e) - { - HFSClass.ADD_TreeNode(TV_Files, e.Node); - e.Node.ImageIndex = 1; - } - private void 导出ToolStripMenuItem1_Click_1(object sender, EventArgs e) { if ((TV_HFSSrchRslt.SelectedNode != null) && (TV_HFSSrchRslt.SelectedNode.Parent != null)) diff --git a/FrmLayerControl.cs b/FrmLayerControl.cs index e7917c3..28fa14d 100644 --- a/FrmLayerControl.cs +++ b/FrmLayerControl.cs @@ -312,26 +312,7 @@ layerManagerNode.Expand(); terrainManagerNode.Expand(); } - /// - /// 刷新节点树 - /// - private void RefreshDataTree() - { - layerTree2.Nodes[0].Nodes.Clear(); - Int32 nCount = globeControl2.Globe.Layers.Count; - Int32 i = 0; - for (i = 0; i < nCount; i++) - { - GSODataset dataSpace = globeControl2.Globe.Layers[i].Dataset; - TreeNode node = new TreeNode(); - node.Text = dataSpace.Name; - node.ImageIndex = 0; - node.SelectedImageIndex = 0; - node.Checked = true; - node.Tag = dataSpace; - layerTree2.Nodes[0].Nodes.Add(node); - } - } + /// /// 目标图层按钮事件处理 /// @@ -494,22 +475,8 @@ } } } - /// - /// 改变指定节点的选中状态 - /// - /// - /// - private void CheckTreeNode(TreeNode node, Boolean bChecked) - { - CheckChildTreeNode(node, bChecked); - // 对于kml图层,如果当前处理的节点是true,那么要把所有的祖宗节点置为true - // 只有所有节点都未false,那么这个节点才为false - // CheckFatherTreeNode(node, bChecked); - globeControl1.Globe.Refresh(); - globeControl2.Globe.Refresh(); - - } + private void CheckChildTreeNode(TreeNode node, Boolean bChecked) { if (node == null) @@ -696,59 +663,7 @@ //} //CheckControl(e); } - /// - /// 树节点选中方法 - /// - /// - private void CheckControl(TreeViewEventArgs e) - { - if (e.Action != TreeViewAction.Unknown) - { - if (e.Node != null && !Convert.IsDBNull(e.Node)) - { - CheckParentNode(e.Node); - if (e.Node.Nodes.Count > 0) - { - CheckAllChildNodes(e.Node, e.Node.Checked); - } - } - } - } - /// - /// 改变所有子节点的状态 - /// - /// - /// - private void CheckAllChildNodes(TreeNode pn, bool IsChecked) - { - foreach (TreeNode tn in pn.Nodes) - { - tn.Checked = IsChecked; - if (tn.Tag.ToString().Contains("|")) - { - string nodeTag = tn.Tag.ToString().Split('|')[1]; - GSOLayer layer = globeControl1.Globe.Layers.GetLayerByCaption(nodeTag); - if (layer != null) - { - layer.Visible = IsChecked; - globeControl1.Globe.Refresh(); - } - } - if (tn.Tag is GSOFeature) - { - if (tn.Nodes.Count == 0) - { - GSOFeature feat = tn.Tag as GSOFeature; - feat.Visible = IsChecked; - globeControl1.Globe.Refresh(); - } - } - if (tn.Nodes.Count > 0) - { - CheckAllChildNodes(tn, IsChecked); - } - } - } + /// /// 改变父节点的选中状态,此处为所有子节点不选中时才取消父节点选中,可以根据需要修改 /// diff --git a/Cyberpipe.csproj b/Cyberpipe.csproj index 07a8c1a..e3cd12c 100644 --- a/Cyberpipe.csproj +++ b/Cyberpipe.csproj @@ -204,25 +204,6 @@ - - Form - - - F_GKT1数据输入输出.cs - - - Form - - - F_GKT1添加文件.cs - - - Form - - - F_GKT1添加项目.cs - - Form @@ -1068,18 +1049,6 @@ Frm_password_reset.cs - - Form - - - GKT.cs - - - Form - - - GKT1.cs - Form @@ -1258,12 +1227,6 @@ F_Projedit.cs - - Form - - - PED.cs - Form @@ -1331,16 +1294,6 @@ True Reference.map - - F_GKT1数据输入输出.cs - Designer - - - F_GKT1添加文件.cs - - - F_GKT1添加项目.cs - Form_EditTask.cs @@ -1836,12 +1789,6 @@ Frm_password_reset.cs - - GKT.cs - - - GKT1.cs - F_GKT数据输入输出.cs @@ -1934,9 +1881,6 @@ F_Projedit.cs - - PED.cs - F_数据输入输出.cs diff --git a/Cyberpipe.suo b/Cyberpipe.suo index 68ced4f..a1aecf8 100644 --- a/Cyberpipe.suo +++ b/Cyberpipe.suo Binary files differ diff --git a/EMS_Forms/Form_EditTask.cs b/EMS_Forms/Form_EditTask.cs index 718992f..f1d791f 100644 --- a/EMS_Forms/Form_EditTask.cs +++ b/EMS_Forms/Form_EditTask.cs @@ -119,7 +119,8 @@ String name = Convert.ToString(dr["USERNAME"]); comboBox_userName.Items.Add(name); - } + } + dr.Close(); comboBox_road.Items.Clear(); roadList = new List(); @@ -135,7 +136,7 @@ comboBox_road.Items.Add(name); } } - + dr1.Close(); conn.Close(); bool flag2 = false; @@ -185,7 +186,7 @@ catch (Exception ex) { - MessageBox.Show(ex.ToString()); + LogHelper.WriteLog(typeof(Form_EditTask), ex.Message); } } @@ -288,7 +289,7 @@ } catch (Exception ex) { - MessageBox.Show(ex.ToString()); + LogHelper.WriteLog(typeof(Form_EditTask), ex.Message); } } @@ -474,7 +475,7 @@ } catch (Exception ex) { - MessageBox.Show(ex.ToString()); + LogHelper.WriteLog(typeof(Form_EditTask), ex.Message); } this.Close(); @@ -495,6 +496,7 @@ { numList.Add(Convert.ToInt32(dr["DBID"])); } + dr.Close(); if (numList.Count == 0) { taskNumber = Convert.ToInt32(number) * 100; @@ -674,6 +676,7 @@ } } } + dr.Close(); conn.Close(); } diff --git a/EMS_Forms/Form_EventManager.cs b/EMS_Forms/Form_EventManager.cs index b18c45b..84807b2 100644 --- a/EMS_Forms/Form_EventManager.cs +++ b/EMS_Forms/Form_EventManager.cs @@ -64,6 +64,7 @@ comboBox_name.Items.Add(name); } + dr.Close(); conn.Close(); diff --git a/Forms/FrmMnModify.cs b/Forms/FrmMnModify.cs index 31cfc5f..d036360 100644 --- a/Forms/FrmMnModify.cs +++ b/Forms/FrmMnModify.cs @@ -68,15 +68,7 @@ questionGrid.Rows[idx].Cells[1].Value = sr.question; } } - /// 选中对象 - /// - /// - /// - /// - private void buttonX1_Click(object sender, EventArgs e) - { - globecontrol.Globe.Action = EnumAction3D.SelectObject; - } + /// /// 选中某一行 /// diff --git a/Forms/FrmPipelineModelDataBase.cs b/Forms/FrmPipelineModelDataBase.cs index 2acf0ca..7ce573f 100644 --- a/Forms/FrmPipelineModelDataBase.cs +++ b/Forms/FrmPipelineModelDataBase.cs @@ -35,19 +35,7 @@ ds = _ds; InitializeComponent(); } - /// - /// 单击选择shp格式文件 - /// - /// - /// - private void btnBrowseModel_Click(object sender, EventArgs e) - { - saveFileDialog1.Filter = "*.lgd|*.lgd"; - if (saveFileDialog1.ShowDialog() == DialogResult.OK) - { - txtModelLayer.Text = saveFileDialog1.FileName; - } - } + /// /// 窗体初始化事件处理 /// @@ -100,49 +88,6 @@ } } } - - private object convertFieldValue(string fieldname, object obj) - { - if (obj == null) - return null; - - try - { - string type = fields_types[fieldname].ToString(); - switch (type) - { - case "string": - return obj.ToString(); - case "int": - //return 101; - int intResult; - if (int.TryParse(obj.ToString(), out intResult)) - return intResult; - else - return null; - case "double": - //return 202.5; - double doubleResult; - if (double.TryParse(obj.ToString(), out doubleResult)) - return doubleResult; - else - return null; - case "date": - DateTime dtResult; - if (DateTime.TryParse(obj.ToString(), out dtResult)) - return dtResult; - else - return null; - } - return null; - } - catch (Exception ex) - { - MessageBox.Show(ex.ToString()); - return null; - } - } - public string lgdFilePath = ""; /// /// 选择管线颜色 @@ -610,33 +555,6 @@ { this.Close(); } - - private void cmbLayer_SelectedIndexChanged(object sender, EventArgs e) //选择图层 - { - GSOLayer layer = ctl.Globe.Layers.GetLayerByCaption(selectLayerName); - GSOFeatures features = layer.GetAllFeatures(); - if (features.Length == 0) - return; - - cmbFrom.Items.Clear(); - cmbTo.Items.Clear(); - cmbRadius.Items.Clear(); - cmbID.Items.Clear(); - for (int i = 0; i < features[0].GetFieldCount(); i++) - { - GeoScene.Data.GSOFieldDefn fielddef = (GeoScene.Data.GSOFieldDefn)(features[0].GetFieldDefn(i)); - - cmbFrom.Items.Add(fielddef.Name); - cmbTo.Items.Add(fielddef.Name); - cmbRadius.Items.Add(fielddef.Name); - cmbID.Items.Add(fielddef.Name); - } - cmbFrom.SelectedItem = "Deep1"; - cmbTo.SelectedItem = "Deep2"; - cmbRadius.SelectedItem = "Diameter"; - cmbID.SelectedItem = "Handle"; - } - private void buttonXLayerPath_Click(object sender, EventArgs e)//单击 选择shp格式的文件 { OpenFileDialog dlg = new OpenFileDialog(); diff --git a/Forms/FrmPipelineModelDataOneStep.cs b/Forms/FrmPipelineModelDataOneStep.cs index 18afda7..ec93b8a 100644 --- a/Forms/FrmPipelineModelDataOneStep.cs +++ b/Forms/FrmPipelineModelDataOneStep.cs @@ -38,19 +38,7 @@ layerTree = _layerTree; InitializeComponent(); } - /// - /// 单击选择shp格式文件 - /// - /// - /// - private void btnBrowseModel_Click(object sender, EventArgs e) - { - saveFileDialog1.Filter = "*.lgd|*.lgd"; - if (saveFileDialog1.ShowDialog() == DialogResult.OK) - { - txtModelLayer.Text = saveFileDialog1.FileName; - } - } + /// /// 窗体初始化事件处理 /// @@ -107,48 +95,7 @@ } } - private object convertFieldValue(string fieldname, object obj) - { - if (obj == null) - return null; - - try - { - string type = fields_types[fieldname].ToString(); - switch (type) - { - case "string": - return obj.ToString(); - case "int": - //return 101; - int intResult; - if (int.TryParse(obj.ToString(), out intResult)) - return intResult; - else - return null; - case "double": - //return 202.5; - double doubleResult; - if (double.TryParse(obj.ToString(), out doubleResult)) - return doubleResult; - else - return null; - case "date": - DateTime dtResult; - if (DateTime.TryParse(obj.ToString(), out dtResult)) - return dtResult; - else - return null; - } - return null; - } - catch (Exception ex) - { - MessageBox.Show(ex.ToString()); - return null; - } - } - + public string lgdFilePath = ""; /// /// 选择管线颜色 @@ -673,32 +620,6 @@ return featDs; } - private void cmbLayer_SelectedIndexChanged(object sender, EventArgs e) //选择图层 - { - GSOLayer layer = ctl.Globe.Layers.GetLayerByCaption(selectLayerName); - GSOFeatures features = layer.GetAllFeatures(); - if (features.Length == 0) - return; - - cmbFrom.Items.Clear(); - cmbTo.Items.Clear(); - cmbRadius.Items.Clear(); - cmbID.Items.Clear(); - for (int i = 0; i < features[0].GetFieldCount(); i++) - { - GeoScene.Data.GSOFieldDefn fielddef = (GeoScene.Data.GSOFieldDefn)(features[0].GetFieldDefn(i)); - - cmbFrom.Items.Add(fielddef.Name); - cmbTo.Items.Add(fielddef.Name); - cmbRadius.Items.Add(fielddef.Name); - cmbID.Items.Add(fielddef.Name); - } - cmbFrom.SelectedItem = "Deep1"; - cmbTo.SelectedItem = "Deep2"; - cmbRadius.SelectedItem = "Diameter"; - cmbID.SelectedItem = "Handle"; - } - private void buttonXLayerPath_Click(object sender, EventArgs e)//单击 选择shp格式的文件 { OpenFileDialog dlg = new OpenFileDialog(); @@ -949,38 +870,6 @@ } //txtLayername.Text = type + layername; } - /// - /// 连接数据库 - /// - /// - /// - private void buttonX1_Click(object sender, EventArgs e) - { - if (ds == null) - { - //没连的话,直接连接审核库; //审核库配置读配置文件 - string dbIp = Utility.sgdbip; - string database = Utility.sgdbname; - string user = Utility.sgdbuser; - string pass = Utility.sgdbpwd; - - if (!Utility.isNetworkConnectionSuccess(dbIp.Trim())) - { - MessageBox.Show("网络连接失败!", "提示"); - return; - } - - ds = ctl.Globe.DataManager.OpenOracleDataSource(dbIp + "/" + database, "", "", user, pass); - if (ds == null) - { - MessageBox.Show("数据库连接失败!", "提示", MessageBoxButtons.OK, MessageBoxIcon.Warning); - } - else - { - btnCreateModel.Enabled = true; - } - } - } private void btnClose_Click(object sender, EventArgs e) { diff --git a/Forms/FrmShRK.cs b/Forms/FrmShRK.cs index 0e2e722..f1d83cb 100644 --- a/Forms/FrmShRK.cs +++ b/Forms/FrmShRK.cs @@ -215,6 +215,7 @@ { sourcefeatds = sourcefeat as GSOFeatureDataset; } + if (sourcefeatds == null) return; sourcefeatds.Open(); GSOFeatures sourcefeatures = sourcefeatds.GetAllFeatures(); @@ -251,6 +252,7 @@ { desfeatds = desfeat as GSOFeatureDataset; } + if (desfeatds == null) return; desfeatds.Open(); //向新数据集写入字段 diff --git a/FrmAccessoriesSensor.cs b/FrmAccessoriesSensor.cs index 09fcdf1..2a7a80e 100644 --- a/FrmAccessoriesSensor.cs +++ b/FrmAccessoriesSensor.cs @@ -209,7 +209,7 @@ chart1.Series[0].Points.DataBindXY(dic.Keys, dic.Values); for (int m = 0; m < dic.Values.Count; m++) { - if (chart1.Series[0].Points[m].YValues[0].ToString() != "0") + if (chart1.Series[0].Points[m]!=null&&chart1.Series[0].Points[m].YValues[0].ToString() != "0") { chart1.Series[0].Points[m].Label = chart1.Series[0].Points[m].YValues[0].ToString(); } diff --git a/FrmAccessoriesgather.cs b/FrmAccessoriesgather.cs index 9e331e1..a475d9e 100644 --- a/FrmAccessoriesgather.cs +++ b/FrmAccessoriesgather.cs @@ -338,7 +338,7 @@ chart1.Series[0].Points.DataBindXY(dic.Keys, dic.Values); for (int m = 0; m < dic.Values.Count; m++) { - if (chart1.Series[0].Points[m].YValues[0].ToString() != "0") + if (chart1.Series[0].Points[m]!=null&&chart1.Series[0].Points[m].YValues[0].ToString() != "0") { chart1.Series[0].Points[m].Label = chart1.Series[0].Points[m].YValues[0].ToString(); } diff --git a/FrmAccessoryAnalysis.cs b/FrmAccessoryAnalysis.cs index 71d4579..44d4065 100644 --- a/FrmAccessoryAnalysis.cs +++ b/FrmAccessoryAnalysis.cs @@ -66,39 +66,6 @@ globeControl1.Refresh(); } /// - /// 键盘按键按下事件处理 - /// - /// - /// - private void txtRadius_KeyPress(object sender, KeyPressEventArgs e) - { - TextBox text = sender as TextBox; - if ((e.KeyChar < 48 || e.KeyChar > 57) && (e.KeyChar != 8) && (int)e.KeyChar != 46) - { - e.Handled = true; - } - if ((int)e.KeyChar == 46) //小数点 - { - if (text.Text.Length <= 0) - e.Handled = true; //小数点不能在第一位 - else //处理不规则的小数点 - { - float f; - float oldf; - bool b1 = false, b2 = false; - b1 = float.TryParse(text.Text, out oldf); - b2 = float.TryParse(text.Text + e.KeyChar.ToString(), out f); - if (b2 == false) - { - if (b1 == true) - e.Handled = true; - else - e.Handled = false; - } - } - } - } - /// /// 确定按钮事件处理 /// /// diff --git a/FrmAddValve.cs b/FrmAddValve.cs index 34d2fec..5f405b9 100644 --- a/FrmAddValve.cs +++ b/FrmAddValve.cs @@ -486,56 +486,6 @@ } } - - - - - - - - private void cmbLayer_SelectedIndexChanged(object sender, EventArgs e) - { - GSOLayer layer = globeControl1.Globe.Layers.GetLayerByCaption(selectLayerName); - GSOFeatures features = layer.GetAllFeatures(); - if (features.Length == 0) - return; - - combPath.Items.Clear(); - combZ.Items.Clear(); - combModelName.Items.Clear(); - - for (int i = 0; i < features[0].GetFieldCount(); i++) - { - GeoScene.Data.GSOFieldDefn fielddef = (GeoScene.Data.GSOFieldDefn)(features[0].GetFieldDefn(i)); - combPath.Items.Add(fielddef.Name); - combZ.Items.Add(fielddef.Name); - combModelName.Items.Add(fielddef.Name); - } - combModelName.SelectedItem = "编号"; - combPath.SelectedItem = "模型路径"; - if (combfile.SelectedIndex != -1) - { - - string layerCaption = combfile.SelectedItem.ToString().Trim(); - rukuLayer = globeControl1.Globe.Layers.GetLayerByCaption(layerCaption); - if (rukuLayer != null) - { - combPath.Items.Clear(); - combZ.Items.Clear(); - combModelName.Items.Clear(); - - } - for (int i = 0; i < features[0].GetFieldCount(); i++) - { - GeoScene.Data.GSOFieldDefn fielddef = (GeoScene.Data.GSOFieldDefn)(features[0].GetFieldDefn(i)); - combPath.Items.Add(fielddef.Name); - combZ.Items.Add(fielddef.Name); - combModelName.Items.Add(fielddef.Name); - } - combModelName.SelectedItem = "编号"; - combPath.SelectedItem = "模型路径"; - } - } /// /// 单击选择shp格式文件 /// diff --git a/FrmAddWellShp.cs b/FrmAddWellShp.cs index bb79ec0..a249725 100644 --- a/FrmAddWellShp.cs +++ b/FrmAddWellShp.cs @@ -478,32 +478,6 @@ } } } - - private void cmbLayer_SelectedIndexChanged(object sender, EventArgs e) - { - GSOLayer layer = globeControl1.Globe.Layers.GetLayerByCaption(selectLayerName); - GSOFeatures features = layer.GetAllFeatures(); - if (features.Length == 0) - return; - - combCode.Items.Clear(); - combDeep.Items.Clear(); - combModelName.Items.Clear(); - combAngle.Items.Clear(); - - for (int i = 0; i < features[0].GetFieldCount(); i++) - { - GeoScene.Data.GSOFieldDefn fielddef = (GeoScene.Data.GSOFieldDefn)(features[0].GetFieldDefn(i)); - combCode.Items.Add(fielddef.Name); - combDeep.Items.Add(fielddef.Name); - combModelName.Items.Add(fielddef.Name); - combAngle.Items.Add(fielddef.Name); - } - combCode.SelectedItem = "附属物编码"; - combDeep.SelectedItem = "井深"; - combModelName.SelectedItem = "编号"; - combAngle.SelectedItem = "符号角度"; - } /// /// 单击选择shp格式文件 /// diff --git a/FrmAddYuBiZiShp.cs b/FrmAddYuBiZiShp.cs index b312d51..332f037 100644 --- a/FrmAddYuBiZiShp.cs +++ b/FrmAddYuBiZiShp.cs @@ -383,80 +383,7 @@ } } - private void cmbLayer_SelectedIndexChanged(object sender, EventArgs e) - { - GSOLayer layer = globeControl1.Globe.Layers.GetLayerByCaption(selectLayerName); - GSOFeatures features = layer.GetAllFeatures(); - if (features.Length == 0) - return; - - combCode.Items.Clear(); - combDeep.Items.Clear(); - combModelName.Items.Clear(); - //comboLoad.Items.Clear(); - for (int i = 0; i < features[0].GetFieldCount(); i++) - { - GeoScene.Data.GSOFieldDefn fielddef = (GeoScene.Data.GSOFieldDefn)(features[0].GetFieldDefn(i)); - combCode.Items.Add(fielddef.Name); - combDeep.Items.Add(fielddef.Name); - combModelName.Items.Add(fielddef.Name); - //comboLoad.Items.Add(fielddef.Name); - } - combCode.SelectedItem = "附属物编码"; - combDeep.SelectedItem = "Z坐标"; - combModelName.SelectedItem = "编号"; - //comboLoad.SelectedItem = "模型路径"; - } - - private void buttonXLayerPath_Click(object sender, EventArgs e) - { - OpenFileDialog dlg = new OpenFileDialog(); - dlg.Filter = "*.shp|*.shp"; - dlg.Multiselect = false; - if (dlg.ShowDialog() == DialogResult.OK) - { - GSOLayer layer = globeControl1.Globe.Layers.Add(dlg.FileName); - string txtMessage = valiYBdata(layer); - if (txtMessage != "") - { - button3.Enabled = false; - //textBoxLayer.Text = ""; - combCode.Items.Clear(); - combDeep.Items.Clear(); - combModelName.Items.Clear(); - globeControl1.Globe.Layers.Remove(layer); - FrmValiDataShowErrorMessage showErrorMessage = new FrmValiDataShowErrorMessage(dlg.FileName, txtMessage); - showErrorMessage.ShowDialog(); - return; - } - else - { - button3.Enabled = true; - //textBoxLayer.Text = dlg.FileName; - selectLayerName = layer.Caption; - txtLayerName.Text = layer.Caption; - GSOFeatures features = layer.GetAllFeatures(); - if (features.Length == 0) - return; - - combCode.Items.Clear(); - combDeep.Items.Clear(); - combModelName.Items.Clear(); - for (int i = 0; i < features[0].GetFieldCount(); i++) - { - GeoScene.Data.GSOFieldDefn fielddef = (GeoScene.Data.GSOFieldDefn)(features[0].GetFieldDefn(i)); - combCode.Items.Add(fielddef.Name); - combDeep.Items.Add(fielddef.Name); - combModelName.Items.Add(fielddef.Name); - //comboLoad.Items.Add(fielddef.Name); - } - combCode.SelectedItem = "管点编码"; - combDeep.SelectedItem = "Z坐标"; - combModelName.SelectedItem = "编号"; - } - } - } - + private void FrmAddYuBiZiShp_FormClosing(object sender, FormClosingEventArgs e) { globeControl1.Globe.Refresh(); diff --git a/FrmAllPipelineStatis.cs b/FrmAllPipelineStatis.cs index 6421a26..a6eea29 100644 --- a/FrmAllPipelineStatis.cs +++ b/FrmAllPipelineStatis.cs @@ -84,7 +84,7 @@ chartAllAreaPipeline.Series["管线"].Points.DataBindXY(pipelineLengthAndType.Keys, pipelineLengthAndType.Values); for (int m = 0; m < pipelineLengthAndType.Values.Count; m++) { - if (chartAllAreaPipeline.Series["管线"].Points[m].YValues[0].ToString() != "0") + if (chartAllAreaPipeline.Series["管线"].Points[m]!=null&&chartAllAreaPipeline.Series["管线"].Points[m].YValues[0].ToString() != "0") { chartAllAreaPipeline.Series["管线"].Points[m].Label = chartAllAreaPipeline.Series[0].Points[m].YValues[0].ToString(); } @@ -94,7 +94,7 @@ } catch (Exception ex) { - //LogError.PublishError(ex); + LogHelper.WriteLog(typeof(FrmAllPipelineStatis), ex.Message); } } @@ -147,7 +147,7 @@ } DataTable dt = OledbHelper.QueryTable(sql); - if (dt != null && dt.Rows.Count > 0) + if (dt != null && dt.Rows.Count > 0 && chartAllAreaPipeline.Series["管线"].Points[indexHit]!=null) { dataGridViewX1.DataSource = dt; panel.Visible = true; diff --git a/FrmAllWorkWellStatis.cs b/FrmAllWorkWellStatis.cs index 6fec7af..6af8e4c 100644 --- a/FrmAllWorkWellStatis.cs +++ b/FrmAllWorkWellStatis.cs @@ -52,7 +52,7 @@ chartAllAreaPipeline.Series["井盖"].Points.DataBindXY(workWellLengthAndType.Keys, workWellLengthAndType.Values); for (int m = 0; m < workWellLengthAndType.Values.Count; m++) { - if (chartAllAreaPipeline.Series["井盖"].Points[m].YValues[0].ToString().Trim() != "0") + if (chartAllAreaPipeline.Series["井盖"].Points[m]!=null&&chartAllAreaPipeline.Series["井盖"].Points[m].YValues[0].ToString().Trim() != "0") { chartAllAreaPipeline.Series["井盖"].Points[m].Label = chartAllAreaPipeline.Series[0].Points[m].YValues[0].ToString(); } @@ -60,7 +60,7 @@ } catch (Exception ex) { - //LogError.PublishError(ex); + LogHelper.WriteLog(typeof(FrmAllWorkWellStatis), ex.Message); } } diff --git a/FrmBSQDuoBianXingStatis.cs b/FrmBSQDuoBianXingStatis.cs index e8b7d52..3e889b6 100644 --- a/FrmBSQDuoBianXingStatis.cs +++ b/FrmBSQDuoBianXingStatis.cs @@ -60,7 +60,7 @@ { for (int m = 0; m < bsq1.Values.Count; m++) { - if (chart1.Series["标识器"].Points[m].YValues[0].ToString() != "0") + if (chart1.Series["标识器"].Points[m]!=null&&chart1.Series["标识器"].Points[m].YValues[0].ToString() != "0") { count += Convert.ToInt16(chart1.Series[0].Points[m].YValues[0].ToString()); chart1.Series["标识器"].Points[m].Label = chart1.Series[0].Points[m].YValues[0].ToString(); diff --git a/FrmBSQDuoBianXingStreet.cs b/FrmBSQDuoBianXingStreet.cs index 2005ebb..1db5777 100644 --- a/FrmBSQDuoBianXingStreet.cs +++ b/FrmBSQDuoBianXingStreet.cs @@ -63,7 +63,7 @@ chartStatis.Series[0].Points.DataBindXY(bsq.Keys, bsq.Values); for (int m = 0; m < bsq.Values.Count; m++) { - if (chartStatis.Series[0].Points[m].YValues[0].ToString().Trim() != "0") + if (chartStatis.Series[0].Points[m]!=null&&chartStatis.Series[0].Points[m].YValues[0].ToString().Trim() != "0") { count += Convert.ToInt16(chartStatis.Series[0].Points[m].YValues[0].ToString()); chartStatis.Series[0].Points[m].Label = chartStatis.Series[0].Points[m].YValues[0].ToString(); diff --git a/FrmBSQStatis.cs b/FrmBSQStatis.cs index 390a55c..4aa0ee6 100644 --- a/FrmBSQStatis.cs +++ b/FrmBSQStatis.cs @@ -95,6 +95,8 @@ } } } + + dr.Close(); conn.Close(); for (int i = 0; i < typeLists.Count; i++) { @@ -123,7 +125,7 @@ chartStatis.Series[0].Points.DataBindXY(bsq.Keys, bsq.Values); for (int m = 0; m < bsq.Values.Count; m++) { - if (chartStatis.Series[0].Points[m].YValues[0].ToString().Trim() != "0") + if (chartStatis.Series[0].Points[m]!=null&&chartStatis.Series[0].Points[m].YValues[0].ToString().Trim() != "0") { //count += Convert.ToInt16(chartStatis.Series[0].Points[m].YValues[0].ToString()); chartStatis.Series[0].Points[m].Label = chartStatis.Series[0].Points[m].YValues[0].ToString(); diff --git a/FrmBSQStreet.cs b/FrmBSQStreet.cs index 9d88adb..7fbacad 100644 --- a/FrmBSQStreet.cs +++ b/FrmBSQStreet.cs @@ -44,7 +44,7 @@ chartStatis.Series[0].Points.DataBindXY(bsq.Keys, bsq.Values); for (int m = 0; m < bsq.Values.Count; m++) { - if (chartStatis.Series[0].Points[m].YValues[0].ToString().Trim() != "0") + if (chartStatis.Series[0].Points[m]!=null&&chartStatis.Series[0].Points[m].YValues[0].ToString().Trim() != "0") { count += Convert.ToInt16(chartStatis.Series[0].Points[m].YValues[0].ToString()); chartStatis.Series[0].Points[m].Label = chartStatis.Series[0].Points[m].YValues[0].ToString(); diff --git a/FrmBoosterValvers.cs b/FrmBoosterValvers.cs index 5061efc..df9b62b 100644 --- a/FrmBoosterValvers.cs +++ b/FrmBoosterValvers.cs @@ -236,199 +236,6 @@ count = 0; } } - /// - /// 添加火苗 - /// - /// - /// - /// - /// - private GSOFeature AddFire(double x,double y,double z) - { - // 烟火示例 - - string strResPath = Application.StartupPath + "/Resource"; - - // 烟火粒子示例,由三个发射器构成 - GSOGeoParticle geoParticle = new GSOGeoParticle(); - geoParticle.SetPosition(x, y, z); // 添加到这个经纬度位置 - geoParticle.AltitudeMode = EnumAltitudeMode.RelativeToGround; - - GSORingParticleEmitter emitter = new GSORingParticleEmitter(); - emitter.TexturePath = strResPath + "/ParticleImage/flare.png"; - - emitter.SetSizeFix(1, 1); - emitter.VelFix = 1; - emitter.VelRnd = 5; - - emitter.AngleXYFix = 0; - emitter.AngleXYRnd = 180; - - emitter.AngleXZFix = 90; - emitter.AngleXZRnd = 0; - - emitter.LifeFix = 0.5f; - emitter.LifeRnd = 0.0f; - - emitter.RotFix = 0; - emitter.RotRnd = 0; - - emitter.RotVelFix = 0; - emitter.RotVelRnd = 0; - - emitter.EmitPerSec = 100; - - // 采用线性插值生成粒子的初始颜色 - emitter.ColorRndStart = Color.White; - emitter.ColorRndEnd = Color.Red; - - - GSOColorParticleEffector effector2 = new GSOColorParticleEffector(); - effector2.SetColorChanged(0, -1, -1, 0); - effector2.StartTime = 0.0f; - effector2.EndTime = -1.0f; - emitter.AddEffector(effector2); - - // 将三个发射器添加到粒子对象中 - geoParticle.AddEmitter(emitter); - - geoParticle.Play(); - - GSOFeature feature = new GSOFeature(); - - feature.Geometry = geoParticle; - - globeControl1.Globe.MemoryLayer.AddFeature(feature); - - - return feature; - } - - /// - /// 添加喷泉 - /// - /// - private GSOFeature AddFountain() - { - string strResPath = Application.StartupPath + "/Resource"; - - GSOGeoParticle geoParticle = new GSOGeoParticle(); - geoParticle.SetPosition(116.314, 39.84, 0); // 添加到这个经纬度位置 - - GSOPointParticleEmitter emitter = new GSOPointParticleEmitter(); - emitter.TexturePath = strResPath + "/ParticleImage/test.png"; - - emitter.SetSizeFix(0.5f, 2); - emitter.VelFix = 10; - emitter.VelRnd = 2; - - emitter.GravityAcc = 9.8f; - emitter.AngleXYFix = 0; - emitter.AngleXYRnd = 180; - - emitter.AngleXZFix = 88; - emitter.AngleXZRnd = 2; - - //emitter.InnerRadius = 0; - // emitter.OuterRadius = 0.03f; - - emitter.LifeFix = 5.0f; - emitter.LifeRnd = 1.0f; - - emitter.RotFix = 0; - emitter.RotRnd = 0; - - emitter.RotVelFix = 0; - emitter.RotVelRnd = 0; - - emitter.EmitPerSec = 1000; - emitter.ColorRndStart = Color.FromArgb(33, 255, 255, 255); - emitter.ColorRndEnd = Color.FromArgb(11, 255, 255, 255); - emitter.IsLumAdded = false; - - // 将三个发射器添加到粒子对象中 - geoParticle.AddEmitter(emitter); - - geoParticle.Play(); - GSOFeature feature = new GSOFeature(); - - feature.Geometry = geoParticle; - - //globeControl1.Globe.MemoryLayer.AddFeature(feature); - globeControl1.Globe.FlyToFeature(feature); - - return feature; - } - - /// - /// 添加水柱 - /// - /// - private GSOFeature AddWaterLine() - { - string strResPath = Application.StartupPath + "/Resource"; - - GSOGeoParticle geoParticle = new GSOGeoParticle(); - geoParticle.SetPosition(116.308, 39.84, 0); // 添加到这个经纬度位置 - - GSOPointParticleEmitter emitter = new GSOPointParticleEmitter(); - - emitter.TexturePath = strResPath + "/ParticleImage/drop3.png"; - - geoParticle.TimerInterval = 1; - - emitter.SetSizeFix(2.0f, 2.0f); - - emitter.VelFix = 50; - emitter.VelRnd = 2; - - // emitter.IsLumAdded = false; - - emitter.GravityAcc = 9.8f; - emitter.AngleXYFix = 0; - emitter.AngleXYRnd = 2; - - emitter.AngleXZFix = 60; - emitter.AngleXZRnd = 2; - - //emitter.InnerRadius = 0; - // emitter.OuterRadius = 0.1f; - - emitter.LifeFix = 5.0f; - emitter.LifeRnd = 1.0f; - - emitter.RotFix = 0; - emitter.RotRnd = 0; - - emitter.RotVelFix = 0; - emitter.RotVelRnd = 0; - - emitter.EmitPerSec = 1500; - - emitter.ColorRndStart = Color.FromArgb(100, 222, 222, 222); - emitter.ColorRndEnd = Color.FromArgb(50, 222, 222, 222); - - /* - - GSOScaleParticleEffector effector1 = new GSOScaleParticleEffector(); - effector1.SetScale(0.2f, 0.2f); - effector1.StartTime = 0; - effector1.EndTime = -1; // 负数表示整个粒子生命结束 - emitter.AddEffector(effector1); - */ - - // 将三个发射器添加到粒子对象中 - geoParticle.AddEmitter(emitter); - - geoParticle.Play(); - GSOFeature feature = new GSOFeature(); - - feature.Geometry = geoParticle; - - //globeControl1.Globe.MemoryLayer.AddFeature(feature); - globeControl1.Globe.FlyToFeature(feature); - - return feature; - } + } } diff --git a/FrmBufferAnalysis.cs b/FrmBufferAnalysis.cs index f711133..db8ca59 100644 --- a/FrmBufferAnalysis.cs +++ b/FrmBufferAnalysis.cs @@ -123,39 +123,6 @@ } } /// - /// 半径文本框的键盘按键按下事件处理 - /// - /// - /// - private void txtRadius_KeyPress(object sender, KeyPressEventArgs e) - { - TextBox text = sender as TextBox; - if ((e.KeyChar < 48 || e.KeyChar > 57) && (e.KeyChar != 8) && (int)e.KeyChar != 46) - { - e.Handled = true; - } - if ((int)e.KeyChar == 46) //小数点 - { - if (text.Text.Length <= 0) - e.Handled = true; //小数点不能在第一位 - else //处理不规则的小数点 - { - float f; - float oldf; - bool b1 = false, b2 = false; - b1 = float.TryParse(text.Text, out oldf); - b2 = float.TryParse(text.Text + e.KeyChar.ToString(), out f); - if (b2 == false) - { - if (b1 == true) - e.Handled = true; - else - e.Handled = false; - } - } - } - } - /// /// 窗体关闭事件处理 /// /// diff --git a/FrmBufferAnalysisBSQ.cs b/FrmBufferAnalysisBSQ.cs index 24a96ca..f54208f 100644 --- a/FrmBufferAnalysisBSQ.cs +++ b/FrmBufferAnalysisBSQ.cs @@ -137,35 +137,7 @@ } } - private void txtRadius_KeyPress(object sender, KeyPressEventArgs e) - { - TextBox text = sender as TextBox; - if ((e.KeyChar < 48 || e.KeyChar > 57) && (e.KeyChar != 8) && (int)e.KeyChar != 46) - { - e.Handled = true; - } - if ((int)e.KeyChar == 46) //小数点 - { - if (text.Text.Length <= 0) - e.Handled = true; //小数点不能在第一位 - else //处理不规则的小数点 - { - float f; - float oldf; - bool b1 = false, b2 = false; - b1 = float.TryParse(text.Text, out oldf); - b2 = float.TryParse(text.Text + e.KeyChar.ToString(), out f); - if (b2 == false) - { - if (b1 == true) - e.Handled = true; - else - e.Handled = false; - } - } - } - } - + private void FrmBufferAnalysis_FormClosing(object sender, FormClosingEventArgs e) { //Form1.y = 0; @@ -316,27 +288,6 @@ } } - private void FlyToMenu_Click(object sender, EventArgs e) - { - if (m_feature != null) - { - if (m_feature.Geometry != null && m_feature.Geometry.Type == EnumGeometryType.GeoPolyline3D) - { - GSOGeoPolyline3D line = m_feature.Geometry as GSOGeoPolyline3D; - double length = line.GetSpaceLength(true, 6378137); - GSOGeoPolyline3D lineLine = line.GetSegment(0, length / 2); - GSOPoint3d point3d = lineLine[lineLine.PartCount - 1][lineLine[lineLine.PartCount - 1].Count - 1]; - - globeControl1.Globe.FlyToPosition(point3d, EnumAltitudeMode.Absolute, 0, 45, 5); - } - else - { - globeControl1.Globe.FlyToFeature(m_feature, 0, 45, 3); - } - LightMenu_Click(sender, e); - } - } - private void LightMenu_Click(object sender, EventArgs e) { flashflag = "single"; diff --git a/FrmDataBaseOpt.cs b/FrmDataBaseOpt.cs index b0c4b5d..8d7b69d 100644 --- a/FrmDataBaseOpt.cs +++ b/FrmDataBaseOpt.cs @@ -362,6 +362,7 @@ dbCombor.Items.Add(dblist[i].title); } } + /* /// /// 从配置文件读取数据库参数配置 /// @@ -428,6 +429,8 @@ } } + * */ + /* /// /// 向配置文件写入连接数据库的参数配置 /// @@ -485,6 +488,7 @@ MessageBox.Show(exp.ToString()); } } + * */ /// /// /// diff --git a/FrmDatabaseParaSetting.cs b/FrmDatabaseParaSetting.cs index a6fea46..63b596b 100644 --- a/FrmDatabaseParaSetting.cs +++ b/FrmDatabaseParaSetting.cs @@ -152,6 +152,7 @@ this.DialogResult = DialogResult.OK; this.Close(); } + /* /// /// 从配置文件读取数据库连接参数配置 /// @@ -218,6 +219,8 @@ } } + * */ + /* /// /// 向配置文件写入数据库参数配置 /// @@ -276,7 +279,7 @@ MessageBox.Show(ex.ToString()); } } - + */ /// /// 取消按钮事件处理 /// diff --git a/FrmDatabaseParaSetting2.cs b/FrmDatabaseParaSetting2.cs index 932d05e..96a87d5 100644 --- a/FrmDatabaseParaSetting2.cs +++ b/FrmDatabaseParaSetting2.cs @@ -148,6 +148,7 @@ this.DialogResult = DialogResult.OK; this.Close(); } + /* /// /// 从配置文件读取数据库连接参数配置 /// @@ -214,6 +215,8 @@ } } + * */ + /* /// /// 向配置文件写入数据库参数配置 /// @@ -272,7 +275,7 @@ MessageBox.Show(exp.ToString()); } } - + */ /// /// 取消按钮事件处理 /// diff --git a/FrmDiameterQuery.cs b/FrmDiameterQuery.cs index 68c948b..9a5215b 100644 --- a/FrmDiameterQuery.cs +++ b/FrmDiameterQuery.cs @@ -77,18 +77,7 @@ isBetween = true; } } - /// - /// 键盘按键按下事件处理 - /// - /// - /// - private void textBoxX1_KeyPress(object sender, KeyPressEventArgs e) - { - if ((e.KeyChar < 48 || e.KeyChar > 57) && e.KeyChar != 8) - { - e.Handled = true;//屏蔽 - } - } + bool isBetween = false; /// diff --git a/FrmDocumentEdit.cs b/FrmDocumentEdit.cs index aab2d31..e78a7ff 100644 --- a/FrmDocumentEdit.cs +++ b/FrmDocumentEdit.cs @@ -256,121 +256,6 @@ } - // - /// 将本地文件上传到指定的服务器(HttpWebRequest方法) - /// - /// 文件上传到的服务器 - /// 要上传的本地文件(全路径) - /// 文件上传后的名称 - /// 上传进度条 - /// 成功返回1,失败返回0 - private int Upload_Request(string address, string fileNamePath, string saveName, ProgressBar progressBar) - { - int returnValue = 0; - // 要上传的文件 - FileStream fs = new FileStream(fileNamePath, FileMode.Open, FileAccess.Read); - BinaryReader r = new BinaryReader(fs); - //时间戳 - string strBoundary = "----------" + DateTime.Now.Ticks.ToString("x"); - byte[] boundaryBytes = Encoding.ASCII.GetBytes("/r/n--" + strBoundary + "/r/n"); - //请求头部信息 - StringBuilder sb = new StringBuilder(); - sb.Append("--"); - sb.Append(strBoundary); - sb.Append("\r\n"); - sb.Append("Content-Disposition: form-data; name=\""); - sb.Append("file"); - sb.Append("\"; filename=\""); - sb.Append(saveName); - sb.Append("\""); - sb.Append("\r\n"); - sb.Append("Content-Type: "); - sb.Append("application/octet-stream"); - sb.Append("\r\n"); - sb.Append("\r\n"); - string strPostHeader = sb.ToString(); - byte[] postHeaderBytes = Encoding.UTF8.GetBytes(strPostHeader); - // 根据uri创建HttpWebRequest对象 - HttpWebRequest httpReq = (HttpWebRequest)WebRequest.Create(new Uri(address)); - httpReq.Method = "POST"; - //对发送的数据不使用缓存 - httpReq.AllowWriteStreamBuffering = false; - //设置获得响应的超时时间(300秒) - httpReq.Timeout = 300000; - httpReq.ContentType = "multipart/form-data; boundary=" + strBoundary; - long length = fs.Length + postHeaderBytes.Length + boundaryBytes.Length; - long fileLength = fs.Length; - httpReq.ContentLength = length; - try - { - progressBar.Maximum = int.MaxValue; - progressBar.Minimum = 0; - progressBar.Value = 0; - //每次上传4k - int bufferLength = 4096; - byte[] buffer = new byte[bufferLength]; - //已上传的字节数 - long offset = 0; - //开始上传时间 - DateTime startTime = DateTime.Now; - int size = r.Read(buffer, 0, bufferLength); - Stream postStream = httpReq.GetRequestStream(); - //发送请求头部消息 - postStream.Write(postHeaderBytes, 0, postHeaderBytes.Length); - while (size > 0) - { - postStream.Write(buffer, 0, size); - offset += size; - progressBar.Value = (int)(offset * (int.MaxValue / length)); - TimeSpan span = DateTime.Now - startTime; - double second = span.TotalSeconds; - //lblTime.Text = "已用时:" + second.ToString("F2") + "秒"; - //if (second > 0.001) - //{ - // lblSpeed.Text = " 平均速度:" + (offset / 1024 / second).ToString("0.00") + "KB/秒"; - //} - //else - //{ - // lblSpeed.Text = " 正在连接…"; - //} - //lblState.Text = "已上传:" + (offset * 100.0 / length).ToString("F2") + "%"; - //lblSize.Text = (offset / 1048576.0).ToString("F2") + "M/" + (fileLength / 1048576.0).ToString("F2") + "M"; - Application.DoEvents(); - size = r.Read(buffer, 0, bufferLength); - } - //添加尾部的时间戳 - postStream.Write(boundaryBytes, 0, boundaryBytes.Length); - postStream.Close(); - //获取服务器端的响应 - WebResponse webRespon = httpReq.GetResponse(); - Stream s = webRespon.GetResponseStream(); - StreamReader sr = new StreamReader(s); - //读取服务器端返回的消息 - String sReturnString = sr.ReadLine(); - s.Close(); - sr.Close(); - if (sReturnString == "Success") - { - returnValue = 1; - } - else if (sReturnString == "Error") - { - returnValue = 0; - } - } - catch(Exception ex) - { - returnValue = 0; - string str = ex.ToString(); - } - finally - { - fs.Close(); - r.Close(); - } - return returnValue; - } - private void btn_file_Click(object sender, EventArgs e) { OpenFileDialog dlg = new OpenFileDialog(); diff --git a/FrmExportCADS.cs b/FrmExportCADS.cs index 98772ea..59629dd 100644 --- a/FrmExportCADS.cs +++ b/FrmExportCADS.cs @@ -108,65 +108,6 @@ MessageBox.Show("请选中要导出的图层!", "提示", MessageBoxButtons.OK, MessageBoxIcon.Warning); } } - private Boolean MerageToFile(GSOFeatures features, String strDestFile, String strProj4)//图层追加 - { - if (features == null) - { - return false; - } - Boolean bSuccess = false; - - string strDir = GSOUtility.GetFileDir(strDestFile); - string strLPRJFile = GSOUtility.ChangeExt(strDestFile, ".lprj"); - string strExt = GSOUtility.GetFileExt(strDestFile); - - // 如果投影文件存在,投影以投影文件为准 - if (File.Exists(strLPRJFile)) - { - // 如果是dxf,则这样处理 - if (strExt.ToLower() == ".dxf") - { - string strTempSrcFile = strDir + "srcFeatures_dxftmp" + strExt; - globeControl1.Globe.DataManager.SaveFeatureData(features, strTempSrcFile, strLPRJFile, 4); - bSuccess = GSOUtility.MergeTwoDXFFileFeatures(strDestFile, strTempSrcFile); - File.Delete(strTempSrcFile); - } - else - { - GSOFeatures srcFeatures = globeControl1.Globe.DataManager.ReadFeatureData(strDestFile); - int nCount = features.Length; - int i = 0; - for (i = 0; i < nCount; i++) - { - srcFeatures.Add(features[i]); - } - bSuccess = globeControl1.Globe.DataManager.SaveFeatureData(srcFeatures, strDestFile, strLPRJFile, 4); - } - } - else - { - // 如果是dxf,则这样处理 - if (strExt.ToLower() == ".dxf") - { - string strTempSrcFile = strDir + "srcFeatures_dxftmp" + strExt; - globeControl1.Globe.DataManager.SaveFeatureData(features, strTempSrcFile, strProj4, 0); - bSuccess = GSOUtility.MergeTwoDXFFileFeatures(strDestFile, strTempSrcFile); - File.Delete(strTempSrcFile); - } - else - { - GSOFeatures srcFeatures = globeControl1.Globe.DataManager.ReadFeatureData(strDestFile); - int nCount = features.Length; - int i = 0; - for (i = 0; i < nCount; i++) - { - srcFeatures.Add(features[i]); - } - bSuccess = globeControl1.Globe.DataManager.SaveFeatureData(srcFeatures, strDestFile, strProj4, 0); - } - } - return bSuccess; - } /// /// 关闭按钮事件处理 /// diff --git a/FrmHDMAnalysis3.cs b/FrmHDMAnalysis3.cs index 4f73af6..2ada735 100644 --- a/FrmHDMAnalysis3.cs +++ b/FrmHDMAnalysis3.cs @@ -436,29 +436,6 @@ } layerTemp.RemoveAllFeature(); } - private void Export(GSOPoint3d _pnt, double r) - { - GSOPoint3ds pnts = new GSOPoint3ds(); - GSOPoint3d pnt = new GSOPoint3d(); - pnt.X = _pnt.X; - pnt.Y = _pnt.Y; - pnt.Z = _pnt.Z; - pnts.Add(pnt); - pnt.X = _pnt.X; - pnt.Y = _pnt.Y - 0.0000000005; - pnt.Z = _pnt.Z; - pnts.Add(pnt); - GSOGeoPolyline3D line = new GSOGeoPolyline3D(); - line.AddPart(pnts); - GSOGeoPolygon3D polygon = line.CreateBuffer(r * 2, true, 5, true, false); - GSOPoint3ds points = polygon[0]; - GSOGeoPolyline3D newLine = new GSOGeoPolyline3D(); - newLine.AddPart(points); - newLine.AltitudeMode = EnumAltitudeMode.RelativeToGround; - GSOFeature newFeature = new GSOFeature(); - newFeature.Geometry = newLine; - globeControl1.Globe.MemoryLayer.AddFeature(newFeature); - } private void ExportCAD(double a, double b, double r) { diff --git a/FrmHotFuncStat.cs b/FrmHotFuncStat.cs index c980f34..2eb1476 100644 --- a/FrmHotFuncStat.cs +++ b/FrmHotFuncStat.cs @@ -421,13 +421,6 @@ } } - private void HFS_Pderive_Click(object sender, EventArgs e) - { - if (TV_Files.SelectedNode != null) - { - HFSClass.GuideEdit_form("G", TV_Files, int.Parse(((ToolStripMenuItem)sender).Tag.ToString())); - } - } private void 导入ToolStripMenuItem_Click(object sender, EventArgs e) { @@ -530,22 +523,8 @@ } } - private void 导出ToolStripMenuItem1_Click(object sender, EventArgs e) - { - 导出ToolStripMenuItem2_Click(sender, e); - } + - private void TV_HFSSrchRslt_AfterCollapse(object sender, TreeViewEventArgs e) - { - e.Node.ImageIndex = 0; - } - - private void TV_HFSSrchRslt_AfterExpand(object sender, TreeViewEventArgs e) - { - HFSClass.ADD_TreeNode(TV_Files, e.Node); - e.Node.ImageIndex = 1; - } - private void 导出ToolStripMenuItem1_Click_1(object sender, EventArgs e) { if ((TV_HFSSrchRslt.SelectedNode != null) && (TV_HFSSrchRslt.SelectedNode.Parent != null)) diff --git a/FrmLayerControl.cs b/FrmLayerControl.cs index e7917c3..28fa14d 100644 --- a/FrmLayerControl.cs +++ b/FrmLayerControl.cs @@ -312,26 +312,7 @@ layerManagerNode.Expand(); terrainManagerNode.Expand(); } - /// - /// 刷新节点树 - /// - private void RefreshDataTree() - { - layerTree2.Nodes[0].Nodes.Clear(); - Int32 nCount = globeControl2.Globe.Layers.Count; - Int32 i = 0; - for (i = 0; i < nCount; i++) - { - GSODataset dataSpace = globeControl2.Globe.Layers[i].Dataset; - TreeNode node = new TreeNode(); - node.Text = dataSpace.Name; - node.ImageIndex = 0; - node.SelectedImageIndex = 0; - node.Checked = true; - node.Tag = dataSpace; - layerTree2.Nodes[0].Nodes.Add(node); - } - } + /// /// 目标图层按钮事件处理 /// @@ -494,22 +475,8 @@ } } } - /// - /// 改变指定节点的选中状态 - /// - /// - /// - private void CheckTreeNode(TreeNode node, Boolean bChecked) - { - CheckChildTreeNode(node, bChecked); - // 对于kml图层,如果当前处理的节点是true,那么要把所有的祖宗节点置为true - // 只有所有节点都未false,那么这个节点才为false - // CheckFatherTreeNode(node, bChecked); - globeControl1.Globe.Refresh(); - globeControl2.Globe.Refresh(); - - } + private void CheckChildTreeNode(TreeNode node, Boolean bChecked) { if (node == null) @@ -696,59 +663,7 @@ //} //CheckControl(e); } - /// - /// 树节点选中方法 - /// - /// - private void CheckControl(TreeViewEventArgs e) - { - if (e.Action != TreeViewAction.Unknown) - { - if (e.Node != null && !Convert.IsDBNull(e.Node)) - { - CheckParentNode(e.Node); - if (e.Node.Nodes.Count > 0) - { - CheckAllChildNodes(e.Node, e.Node.Checked); - } - } - } - } - /// - /// 改变所有子节点的状态 - /// - /// - /// - private void CheckAllChildNodes(TreeNode pn, bool IsChecked) - { - foreach (TreeNode tn in pn.Nodes) - { - tn.Checked = IsChecked; - if (tn.Tag.ToString().Contains("|")) - { - string nodeTag = tn.Tag.ToString().Split('|')[1]; - GSOLayer layer = globeControl1.Globe.Layers.GetLayerByCaption(nodeTag); - if (layer != null) - { - layer.Visible = IsChecked; - globeControl1.Globe.Refresh(); - } - } - if (tn.Tag is GSOFeature) - { - if (tn.Nodes.Count == 0) - { - GSOFeature feat = tn.Tag as GSOFeature; - feat.Visible = IsChecked; - globeControl1.Globe.Refresh(); - } - } - if (tn.Nodes.Count > 0) - { - CheckAllChildNodes(tn, IsChecked); - } - } - } + /// /// 改变父节点的选中状态,此处为所有子节点不选中时才取消父节点选中,可以根据需要修改 /// diff --git a/FrmLogin.cs b/FrmLogin.cs index 320fdd5..2afe46e 100644 --- a/FrmLogin.cs +++ b/FrmLogin.cs @@ -59,70 +59,6 @@ textBoxPassWord.Clear(); } } - - /// - /// 验证端口号 - /// - /// - private bool ValiPort() - { - Ping p = new Ping();//创建Ping对象p - PingReply pr = p.Send(Utility.localicenseserverip);//向指定IP或者主机名的计算机发送ICMP协议的ping数据包 - if (pr.Status == IPStatus.Success)//如果ping成功 - { - try - { - TcpClient tcpc = new TcpClient(Utility.localicenseserverip, Utility.localicenseserverport);//对IP地址为"192.168.0.105"的计算机的1500端口提出连接申请 - tcpc.Close(); - return true; - } - catch (Exception ex) - { - MessageBox.Show("端口连接错误!" + ex.Message); - return false; - } - } - else - { - int times = 0;//重新连接次数; - int count = 2;//设置尝试次数 - while (times < count) - { - //Thread.Sleep(1000);//等待时间(方便测试的话,你可以改为1000) - pr = p.Send(Utility.localicenseserverip); - - if (pr.Status == IPStatus.Success) - { - try - { - TcpClient tcpc = new TcpClient(Utility.localicenseserverip, Utility.localicenseserverport);//对IP地址为"192.168.0.105"的计算机的1500端口提出连接申请 - tcpc.Close(); - return true; - } - catch (Exception ex) - { - MessageBox.Show("端口连接错误!" + ex.Message); - return false; - } - } - else - { - times++; - if (times < count) - { - continue; - } - else - { - MessageBox.Show("重新尝试连接失败"); - return false; - } - } - - } - return false; - } - } /// /// 验证用户名、密码 /// diff --git a/Cyberpipe.csproj b/Cyberpipe.csproj index 07a8c1a..e3cd12c 100644 --- a/Cyberpipe.csproj +++ b/Cyberpipe.csproj @@ -204,25 +204,6 @@ - - Form - - - F_GKT1数据输入输出.cs - - - Form - - - F_GKT1添加文件.cs - - - Form - - - F_GKT1添加项目.cs - - Form @@ -1068,18 +1049,6 @@ Frm_password_reset.cs - - Form - - - GKT.cs - - - Form - - - GKT1.cs - Form @@ -1258,12 +1227,6 @@ F_Projedit.cs - - Form - - - PED.cs - Form @@ -1331,16 +1294,6 @@ True Reference.map - - F_GKT1数据输入输出.cs - Designer - - - F_GKT1添加文件.cs - - - F_GKT1添加项目.cs - Form_EditTask.cs @@ -1836,12 +1789,6 @@ Frm_password_reset.cs - - GKT.cs - - - GKT1.cs - F_GKT数据输入输出.cs @@ -1934,9 +1881,6 @@ F_Projedit.cs - - PED.cs - F_数据输入输出.cs diff --git a/Cyberpipe.suo b/Cyberpipe.suo index 68ced4f..a1aecf8 100644 --- a/Cyberpipe.suo +++ b/Cyberpipe.suo Binary files differ diff --git a/EMS_Forms/Form_EditTask.cs b/EMS_Forms/Form_EditTask.cs index 718992f..f1d791f 100644 --- a/EMS_Forms/Form_EditTask.cs +++ b/EMS_Forms/Form_EditTask.cs @@ -119,7 +119,8 @@ String name = Convert.ToString(dr["USERNAME"]); comboBox_userName.Items.Add(name); - } + } + dr.Close(); comboBox_road.Items.Clear(); roadList = new List(); @@ -135,7 +136,7 @@ comboBox_road.Items.Add(name); } } - + dr1.Close(); conn.Close(); bool flag2 = false; @@ -185,7 +186,7 @@ catch (Exception ex) { - MessageBox.Show(ex.ToString()); + LogHelper.WriteLog(typeof(Form_EditTask), ex.Message); } } @@ -288,7 +289,7 @@ } catch (Exception ex) { - MessageBox.Show(ex.ToString()); + LogHelper.WriteLog(typeof(Form_EditTask), ex.Message); } } @@ -474,7 +475,7 @@ } catch (Exception ex) { - MessageBox.Show(ex.ToString()); + LogHelper.WriteLog(typeof(Form_EditTask), ex.Message); } this.Close(); @@ -495,6 +496,7 @@ { numList.Add(Convert.ToInt32(dr["DBID"])); } + dr.Close(); if (numList.Count == 0) { taskNumber = Convert.ToInt32(number) * 100; @@ -674,6 +676,7 @@ } } } + dr.Close(); conn.Close(); } diff --git a/EMS_Forms/Form_EventManager.cs b/EMS_Forms/Form_EventManager.cs index b18c45b..84807b2 100644 --- a/EMS_Forms/Form_EventManager.cs +++ b/EMS_Forms/Form_EventManager.cs @@ -64,6 +64,7 @@ comboBox_name.Items.Add(name); } + dr.Close(); conn.Close(); diff --git a/Forms/FrmMnModify.cs b/Forms/FrmMnModify.cs index 31cfc5f..d036360 100644 --- a/Forms/FrmMnModify.cs +++ b/Forms/FrmMnModify.cs @@ -68,15 +68,7 @@ questionGrid.Rows[idx].Cells[1].Value = sr.question; } } - /// 选中对象 - /// - /// - /// - /// - private void buttonX1_Click(object sender, EventArgs e) - { - globecontrol.Globe.Action = EnumAction3D.SelectObject; - } + /// /// 选中某一行 /// diff --git a/Forms/FrmPipelineModelDataBase.cs b/Forms/FrmPipelineModelDataBase.cs index 2acf0ca..7ce573f 100644 --- a/Forms/FrmPipelineModelDataBase.cs +++ b/Forms/FrmPipelineModelDataBase.cs @@ -35,19 +35,7 @@ ds = _ds; InitializeComponent(); } - /// - /// 单击选择shp格式文件 - /// - /// - /// - private void btnBrowseModel_Click(object sender, EventArgs e) - { - saveFileDialog1.Filter = "*.lgd|*.lgd"; - if (saveFileDialog1.ShowDialog() == DialogResult.OK) - { - txtModelLayer.Text = saveFileDialog1.FileName; - } - } + /// /// 窗体初始化事件处理 /// @@ -100,49 +88,6 @@ } } } - - private object convertFieldValue(string fieldname, object obj) - { - if (obj == null) - return null; - - try - { - string type = fields_types[fieldname].ToString(); - switch (type) - { - case "string": - return obj.ToString(); - case "int": - //return 101; - int intResult; - if (int.TryParse(obj.ToString(), out intResult)) - return intResult; - else - return null; - case "double": - //return 202.5; - double doubleResult; - if (double.TryParse(obj.ToString(), out doubleResult)) - return doubleResult; - else - return null; - case "date": - DateTime dtResult; - if (DateTime.TryParse(obj.ToString(), out dtResult)) - return dtResult; - else - return null; - } - return null; - } - catch (Exception ex) - { - MessageBox.Show(ex.ToString()); - return null; - } - } - public string lgdFilePath = ""; /// /// 选择管线颜色 @@ -610,33 +555,6 @@ { this.Close(); } - - private void cmbLayer_SelectedIndexChanged(object sender, EventArgs e) //选择图层 - { - GSOLayer layer = ctl.Globe.Layers.GetLayerByCaption(selectLayerName); - GSOFeatures features = layer.GetAllFeatures(); - if (features.Length == 0) - return; - - cmbFrom.Items.Clear(); - cmbTo.Items.Clear(); - cmbRadius.Items.Clear(); - cmbID.Items.Clear(); - for (int i = 0; i < features[0].GetFieldCount(); i++) - { - GeoScene.Data.GSOFieldDefn fielddef = (GeoScene.Data.GSOFieldDefn)(features[0].GetFieldDefn(i)); - - cmbFrom.Items.Add(fielddef.Name); - cmbTo.Items.Add(fielddef.Name); - cmbRadius.Items.Add(fielddef.Name); - cmbID.Items.Add(fielddef.Name); - } - cmbFrom.SelectedItem = "Deep1"; - cmbTo.SelectedItem = "Deep2"; - cmbRadius.SelectedItem = "Diameter"; - cmbID.SelectedItem = "Handle"; - } - private void buttonXLayerPath_Click(object sender, EventArgs e)//单击 选择shp格式的文件 { OpenFileDialog dlg = new OpenFileDialog(); diff --git a/Forms/FrmPipelineModelDataOneStep.cs b/Forms/FrmPipelineModelDataOneStep.cs index 18afda7..ec93b8a 100644 --- a/Forms/FrmPipelineModelDataOneStep.cs +++ b/Forms/FrmPipelineModelDataOneStep.cs @@ -38,19 +38,7 @@ layerTree = _layerTree; InitializeComponent(); } - /// - /// 单击选择shp格式文件 - /// - /// - /// - private void btnBrowseModel_Click(object sender, EventArgs e) - { - saveFileDialog1.Filter = "*.lgd|*.lgd"; - if (saveFileDialog1.ShowDialog() == DialogResult.OK) - { - txtModelLayer.Text = saveFileDialog1.FileName; - } - } + /// /// 窗体初始化事件处理 /// @@ -107,48 +95,7 @@ } } - private object convertFieldValue(string fieldname, object obj) - { - if (obj == null) - return null; - - try - { - string type = fields_types[fieldname].ToString(); - switch (type) - { - case "string": - return obj.ToString(); - case "int": - //return 101; - int intResult; - if (int.TryParse(obj.ToString(), out intResult)) - return intResult; - else - return null; - case "double": - //return 202.5; - double doubleResult; - if (double.TryParse(obj.ToString(), out doubleResult)) - return doubleResult; - else - return null; - case "date": - DateTime dtResult; - if (DateTime.TryParse(obj.ToString(), out dtResult)) - return dtResult; - else - return null; - } - return null; - } - catch (Exception ex) - { - MessageBox.Show(ex.ToString()); - return null; - } - } - + public string lgdFilePath = ""; /// /// 选择管线颜色 @@ -673,32 +620,6 @@ return featDs; } - private void cmbLayer_SelectedIndexChanged(object sender, EventArgs e) //选择图层 - { - GSOLayer layer = ctl.Globe.Layers.GetLayerByCaption(selectLayerName); - GSOFeatures features = layer.GetAllFeatures(); - if (features.Length == 0) - return; - - cmbFrom.Items.Clear(); - cmbTo.Items.Clear(); - cmbRadius.Items.Clear(); - cmbID.Items.Clear(); - for (int i = 0; i < features[0].GetFieldCount(); i++) - { - GeoScene.Data.GSOFieldDefn fielddef = (GeoScene.Data.GSOFieldDefn)(features[0].GetFieldDefn(i)); - - cmbFrom.Items.Add(fielddef.Name); - cmbTo.Items.Add(fielddef.Name); - cmbRadius.Items.Add(fielddef.Name); - cmbID.Items.Add(fielddef.Name); - } - cmbFrom.SelectedItem = "Deep1"; - cmbTo.SelectedItem = "Deep2"; - cmbRadius.SelectedItem = "Diameter"; - cmbID.SelectedItem = "Handle"; - } - private void buttonXLayerPath_Click(object sender, EventArgs e)//单击 选择shp格式的文件 { OpenFileDialog dlg = new OpenFileDialog(); @@ -949,38 +870,6 @@ } //txtLayername.Text = type + layername; } - /// - /// 连接数据库 - /// - /// - /// - private void buttonX1_Click(object sender, EventArgs e) - { - if (ds == null) - { - //没连的话,直接连接审核库; //审核库配置读配置文件 - string dbIp = Utility.sgdbip; - string database = Utility.sgdbname; - string user = Utility.sgdbuser; - string pass = Utility.sgdbpwd; - - if (!Utility.isNetworkConnectionSuccess(dbIp.Trim())) - { - MessageBox.Show("网络连接失败!", "提示"); - return; - } - - ds = ctl.Globe.DataManager.OpenOracleDataSource(dbIp + "/" + database, "", "", user, pass); - if (ds == null) - { - MessageBox.Show("数据库连接失败!", "提示", MessageBoxButtons.OK, MessageBoxIcon.Warning); - } - else - { - btnCreateModel.Enabled = true; - } - } - } private void btnClose_Click(object sender, EventArgs e) { diff --git a/Forms/FrmShRK.cs b/Forms/FrmShRK.cs index 0e2e722..f1d83cb 100644 --- a/Forms/FrmShRK.cs +++ b/Forms/FrmShRK.cs @@ -215,6 +215,7 @@ { sourcefeatds = sourcefeat as GSOFeatureDataset; } + if (sourcefeatds == null) return; sourcefeatds.Open(); GSOFeatures sourcefeatures = sourcefeatds.GetAllFeatures(); @@ -251,6 +252,7 @@ { desfeatds = desfeat as GSOFeatureDataset; } + if (desfeatds == null) return; desfeatds.Open(); //向新数据集写入字段 diff --git a/FrmAccessoriesSensor.cs b/FrmAccessoriesSensor.cs index 09fcdf1..2a7a80e 100644 --- a/FrmAccessoriesSensor.cs +++ b/FrmAccessoriesSensor.cs @@ -209,7 +209,7 @@ chart1.Series[0].Points.DataBindXY(dic.Keys, dic.Values); for (int m = 0; m < dic.Values.Count; m++) { - if (chart1.Series[0].Points[m].YValues[0].ToString() != "0") + if (chart1.Series[0].Points[m]!=null&&chart1.Series[0].Points[m].YValues[0].ToString() != "0") { chart1.Series[0].Points[m].Label = chart1.Series[0].Points[m].YValues[0].ToString(); } diff --git a/FrmAccessoriesgather.cs b/FrmAccessoriesgather.cs index 9e331e1..a475d9e 100644 --- a/FrmAccessoriesgather.cs +++ b/FrmAccessoriesgather.cs @@ -338,7 +338,7 @@ chart1.Series[0].Points.DataBindXY(dic.Keys, dic.Values); for (int m = 0; m < dic.Values.Count; m++) { - if (chart1.Series[0].Points[m].YValues[0].ToString() != "0") + if (chart1.Series[0].Points[m]!=null&&chart1.Series[0].Points[m].YValues[0].ToString() != "0") { chart1.Series[0].Points[m].Label = chart1.Series[0].Points[m].YValues[0].ToString(); } diff --git a/FrmAccessoryAnalysis.cs b/FrmAccessoryAnalysis.cs index 71d4579..44d4065 100644 --- a/FrmAccessoryAnalysis.cs +++ b/FrmAccessoryAnalysis.cs @@ -66,39 +66,6 @@ globeControl1.Refresh(); } /// - /// 键盘按键按下事件处理 - /// - /// - /// - private void txtRadius_KeyPress(object sender, KeyPressEventArgs e) - { - TextBox text = sender as TextBox; - if ((e.KeyChar < 48 || e.KeyChar > 57) && (e.KeyChar != 8) && (int)e.KeyChar != 46) - { - e.Handled = true; - } - if ((int)e.KeyChar == 46) //小数点 - { - if (text.Text.Length <= 0) - e.Handled = true; //小数点不能在第一位 - else //处理不规则的小数点 - { - float f; - float oldf; - bool b1 = false, b2 = false; - b1 = float.TryParse(text.Text, out oldf); - b2 = float.TryParse(text.Text + e.KeyChar.ToString(), out f); - if (b2 == false) - { - if (b1 == true) - e.Handled = true; - else - e.Handled = false; - } - } - } - } - /// /// 确定按钮事件处理 /// /// diff --git a/FrmAddValve.cs b/FrmAddValve.cs index 34d2fec..5f405b9 100644 --- a/FrmAddValve.cs +++ b/FrmAddValve.cs @@ -486,56 +486,6 @@ } } - - - - - - - - private void cmbLayer_SelectedIndexChanged(object sender, EventArgs e) - { - GSOLayer layer = globeControl1.Globe.Layers.GetLayerByCaption(selectLayerName); - GSOFeatures features = layer.GetAllFeatures(); - if (features.Length == 0) - return; - - combPath.Items.Clear(); - combZ.Items.Clear(); - combModelName.Items.Clear(); - - for (int i = 0; i < features[0].GetFieldCount(); i++) - { - GeoScene.Data.GSOFieldDefn fielddef = (GeoScene.Data.GSOFieldDefn)(features[0].GetFieldDefn(i)); - combPath.Items.Add(fielddef.Name); - combZ.Items.Add(fielddef.Name); - combModelName.Items.Add(fielddef.Name); - } - combModelName.SelectedItem = "编号"; - combPath.SelectedItem = "模型路径"; - if (combfile.SelectedIndex != -1) - { - - string layerCaption = combfile.SelectedItem.ToString().Trim(); - rukuLayer = globeControl1.Globe.Layers.GetLayerByCaption(layerCaption); - if (rukuLayer != null) - { - combPath.Items.Clear(); - combZ.Items.Clear(); - combModelName.Items.Clear(); - - } - for (int i = 0; i < features[0].GetFieldCount(); i++) - { - GeoScene.Data.GSOFieldDefn fielddef = (GeoScene.Data.GSOFieldDefn)(features[0].GetFieldDefn(i)); - combPath.Items.Add(fielddef.Name); - combZ.Items.Add(fielddef.Name); - combModelName.Items.Add(fielddef.Name); - } - combModelName.SelectedItem = "编号"; - combPath.SelectedItem = "模型路径"; - } - } /// /// 单击选择shp格式文件 /// diff --git a/FrmAddWellShp.cs b/FrmAddWellShp.cs index bb79ec0..a249725 100644 --- a/FrmAddWellShp.cs +++ b/FrmAddWellShp.cs @@ -478,32 +478,6 @@ } } } - - private void cmbLayer_SelectedIndexChanged(object sender, EventArgs e) - { - GSOLayer layer = globeControl1.Globe.Layers.GetLayerByCaption(selectLayerName); - GSOFeatures features = layer.GetAllFeatures(); - if (features.Length == 0) - return; - - combCode.Items.Clear(); - combDeep.Items.Clear(); - combModelName.Items.Clear(); - combAngle.Items.Clear(); - - for (int i = 0; i < features[0].GetFieldCount(); i++) - { - GeoScene.Data.GSOFieldDefn fielddef = (GeoScene.Data.GSOFieldDefn)(features[0].GetFieldDefn(i)); - combCode.Items.Add(fielddef.Name); - combDeep.Items.Add(fielddef.Name); - combModelName.Items.Add(fielddef.Name); - combAngle.Items.Add(fielddef.Name); - } - combCode.SelectedItem = "附属物编码"; - combDeep.SelectedItem = "井深"; - combModelName.SelectedItem = "编号"; - combAngle.SelectedItem = "符号角度"; - } /// /// 单击选择shp格式文件 /// diff --git a/FrmAddYuBiZiShp.cs b/FrmAddYuBiZiShp.cs index b312d51..332f037 100644 --- a/FrmAddYuBiZiShp.cs +++ b/FrmAddYuBiZiShp.cs @@ -383,80 +383,7 @@ } } - private void cmbLayer_SelectedIndexChanged(object sender, EventArgs e) - { - GSOLayer layer = globeControl1.Globe.Layers.GetLayerByCaption(selectLayerName); - GSOFeatures features = layer.GetAllFeatures(); - if (features.Length == 0) - return; - - combCode.Items.Clear(); - combDeep.Items.Clear(); - combModelName.Items.Clear(); - //comboLoad.Items.Clear(); - for (int i = 0; i < features[0].GetFieldCount(); i++) - { - GeoScene.Data.GSOFieldDefn fielddef = (GeoScene.Data.GSOFieldDefn)(features[0].GetFieldDefn(i)); - combCode.Items.Add(fielddef.Name); - combDeep.Items.Add(fielddef.Name); - combModelName.Items.Add(fielddef.Name); - //comboLoad.Items.Add(fielddef.Name); - } - combCode.SelectedItem = "附属物编码"; - combDeep.SelectedItem = "Z坐标"; - combModelName.SelectedItem = "编号"; - //comboLoad.SelectedItem = "模型路径"; - } - - private void buttonXLayerPath_Click(object sender, EventArgs e) - { - OpenFileDialog dlg = new OpenFileDialog(); - dlg.Filter = "*.shp|*.shp"; - dlg.Multiselect = false; - if (dlg.ShowDialog() == DialogResult.OK) - { - GSOLayer layer = globeControl1.Globe.Layers.Add(dlg.FileName); - string txtMessage = valiYBdata(layer); - if (txtMessage != "") - { - button3.Enabled = false; - //textBoxLayer.Text = ""; - combCode.Items.Clear(); - combDeep.Items.Clear(); - combModelName.Items.Clear(); - globeControl1.Globe.Layers.Remove(layer); - FrmValiDataShowErrorMessage showErrorMessage = new FrmValiDataShowErrorMessage(dlg.FileName, txtMessage); - showErrorMessage.ShowDialog(); - return; - } - else - { - button3.Enabled = true; - //textBoxLayer.Text = dlg.FileName; - selectLayerName = layer.Caption; - txtLayerName.Text = layer.Caption; - GSOFeatures features = layer.GetAllFeatures(); - if (features.Length == 0) - return; - - combCode.Items.Clear(); - combDeep.Items.Clear(); - combModelName.Items.Clear(); - for (int i = 0; i < features[0].GetFieldCount(); i++) - { - GeoScene.Data.GSOFieldDefn fielddef = (GeoScene.Data.GSOFieldDefn)(features[0].GetFieldDefn(i)); - combCode.Items.Add(fielddef.Name); - combDeep.Items.Add(fielddef.Name); - combModelName.Items.Add(fielddef.Name); - //comboLoad.Items.Add(fielddef.Name); - } - combCode.SelectedItem = "管点编码"; - combDeep.SelectedItem = "Z坐标"; - combModelName.SelectedItem = "编号"; - } - } - } - + private void FrmAddYuBiZiShp_FormClosing(object sender, FormClosingEventArgs e) { globeControl1.Globe.Refresh(); diff --git a/FrmAllPipelineStatis.cs b/FrmAllPipelineStatis.cs index 6421a26..a6eea29 100644 --- a/FrmAllPipelineStatis.cs +++ b/FrmAllPipelineStatis.cs @@ -84,7 +84,7 @@ chartAllAreaPipeline.Series["管线"].Points.DataBindXY(pipelineLengthAndType.Keys, pipelineLengthAndType.Values); for (int m = 0; m < pipelineLengthAndType.Values.Count; m++) { - if (chartAllAreaPipeline.Series["管线"].Points[m].YValues[0].ToString() != "0") + if (chartAllAreaPipeline.Series["管线"].Points[m]!=null&&chartAllAreaPipeline.Series["管线"].Points[m].YValues[0].ToString() != "0") { chartAllAreaPipeline.Series["管线"].Points[m].Label = chartAllAreaPipeline.Series[0].Points[m].YValues[0].ToString(); } @@ -94,7 +94,7 @@ } catch (Exception ex) { - //LogError.PublishError(ex); + LogHelper.WriteLog(typeof(FrmAllPipelineStatis), ex.Message); } } @@ -147,7 +147,7 @@ } DataTable dt = OledbHelper.QueryTable(sql); - if (dt != null && dt.Rows.Count > 0) + if (dt != null && dt.Rows.Count > 0 && chartAllAreaPipeline.Series["管线"].Points[indexHit]!=null) { dataGridViewX1.DataSource = dt; panel.Visible = true; diff --git a/FrmAllWorkWellStatis.cs b/FrmAllWorkWellStatis.cs index 6fec7af..6af8e4c 100644 --- a/FrmAllWorkWellStatis.cs +++ b/FrmAllWorkWellStatis.cs @@ -52,7 +52,7 @@ chartAllAreaPipeline.Series["井盖"].Points.DataBindXY(workWellLengthAndType.Keys, workWellLengthAndType.Values); for (int m = 0; m < workWellLengthAndType.Values.Count; m++) { - if (chartAllAreaPipeline.Series["井盖"].Points[m].YValues[0].ToString().Trim() != "0") + if (chartAllAreaPipeline.Series["井盖"].Points[m]!=null&&chartAllAreaPipeline.Series["井盖"].Points[m].YValues[0].ToString().Trim() != "0") { chartAllAreaPipeline.Series["井盖"].Points[m].Label = chartAllAreaPipeline.Series[0].Points[m].YValues[0].ToString(); } @@ -60,7 +60,7 @@ } catch (Exception ex) { - //LogError.PublishError(ex); + LogHelper.WriteLog(typeof(FrmAllWorkWellStatis), ex.Message); } } diff --git a/FrmBSQDuoBianXingStatis.cs b/FrmBSQDuoBianXingStatis.cs index e8b7d52..3e889b6 100644 --- a/FrmBSQDuoBianXingStatis.cs +++ b/FrmBSQDuoBianXingStatis.cs @@ -60,7 +60,7 @@ { for (int m = 0; m < bsq1.Values.Count; m++) { - if (chart1.Series["标识器"].Points[m].YValues[0].ToString() != "0") + if (chart1.Series["标识器"].Points[m]!=null&&chart1.Series["标识器"].Points[m].YValues[0].ToString() != "0") { count += Convert.ToInt16(chart1.Series[0].Points[m].YValues[0].ToString()); chart1.Series["标识器"].Points[m].Label = chart1.Series[0].Points[m].YValues[0].ToString(); diff --git a/FrmBSQDuoBianXingStreet.cs b/FrmBSQDuoBianXingStreet.cs index 2005ebb..1db5777 100644 --- a/FrmBSQDuoBianXingStreet.cs +++ b/FrmBSQDuoBianXingStreet.cs @@ -63,7 +63,7 @@ chartStatis.Series[0].Points.DataBindXY(bsq.Keys, bsq.Values); for (int m = 0; m < bsq.Values.Count; m++) { - if (chartStatis.Series[0].Points[m].YValues[0].ToString().Trim() != "0") + if (chartStatis.Series[0].Points[m]!=null&&chartStatis.Series[0].Points[m].YValues[0].ToString().Trim() != "0") { count += Convert.ToInt16(chartStatis.Series[0].Points[m].YValues[0].ToString()); chartStatis.Series[0].Points[m].Label = chartStatis.Series[0].Points[m].YValues[0].ToString(); diff --git a/FrmBSQStatis.cs b/FrmBSQStatis.cs index 390a55c..4aa0ee6 100644 --- a/FrmBSQStatis.cs +++ b/FrmBSQStatis.cs @@ -95,6 +95,8 @@ } } } + + dr.Close(); conn.Close(); for (int i = 0; i < typeLists.Count; i++) { @@ -123,7 +125,7 @@ chartStatis.Series[0].Points.DataBindXY(bsq.Keys, bsq.Values); for (int m = 0; m < bsq.Values.Count; m++) { - if (chartStatis.Series[0].Points[m].YValues[0].ToString().Trim() != "0") + if (chartStatis.Series[0].Points[m]!=null&&chartStatis.Series[0].Points[m].YValues[0].ToString().Trim() != "0") { //count += Convert.ToInt16(chartStatis.Series[0].Points[m].YValues[0].ToString()); chartStatis.Series[0].Points[m].Label = chartStatis.Series[0].Points[m].YValues[0].ToString(); diff --git a/FrmBSQStreet.cs b/FrmBSQStreet.cs index 9d88adb..7fbacad 100644 --- a/FrmBSQStreet.cs +++ b/FrmBSQStreet.cs @@ -44,7 +44,7 @@ chartStatis.Series[0].Points.DataBindXY(bsq.Keys, bsq.Values); for (int m = 0; m < bsq.Values.Count; m++) { - if (chartStatis.Series[0].Points[m].YValues[0].ToString().Trim() != "0") + if (chartStatis.Series[0].Points[m]!=null&&chartStatis.Series[0].Points[m].YValues[0].ToString().Trim() != "0") { count += Convert.ToInt16(chartStatis.Series[0].Points[m].YValues[0].ToString()); chartStatis.Series[0].Points[m].Label = chartStatis.Series[0].Points[m].YValues[0].ToString(); diff --git a/FrmBoosterValvers.cs b/FrmBoosterValvers.cs index 5061efc..df9b62b 100644 --- a/FrmBoosterValvers.cs +++ b/FrmBoosterValvers.cs @@ -236,199 +236,6 @@ count = 0; } } - /// - /// 添加火苗 - /// - /// - /// - /// - /// - private GSOFeature AddFire(double x,double y,double z) - { - // 烟火示例 - - string strResPath = Application.StartupPath + "/Resource"; - - // 烟火粒子示例,由三个发射器构成 - GSOGeoParticle geoParticle = new GSOGeoParticle(); - geoParticle.SetPosition(x, y, z); // 添加到这个经纬度位置 - geoParticle.AltitudeMode = EnumAltitudeMode.RelativeToGround; - - GSORingParticleEmitter emitter = new GSORingParticleEmitter(); - emitter.TexturePath = strResPath + "/ParticleImage/flare.png"; - - emitter.SetSizeFix(1, 1); - emitter.VelFix = 1; - emitter.VelRnd = 5; - - emitter.AngleXYFix = 0; - emitter.AngleXYRnd = 180; - - emitter.AngleXZFix = 90; - emitter.AngleXZRnd = 0; - - emitter.LifeFix = 0.5f; - emitter.LifeRnd = 0.0f; - - emitter.RotFix = 0; - emitter.RotRnd = 0; - - emitter.RotVelFix = 0; - emitter.RotVelRnd = 0; - - emitter.EmitPerSec = 100; - - // 采用线性插值生成粒子的初始颜色 - emitter.ColorRndStart = Color.White; - emitter.ColorRndEnd = Color.Red; - - - GSOColorParticleEffector effector2 = new GSOColorParticleEffector(); - effector2.SetColorChanged(0, -1, -1, 0); - effector2.StartTime = 0.0f; - effector2.EndTime = -1.0f; - emitter.AddEffector(effector2); - - // 将三个发射器添加到粒子对象中 - geoParticle.AddEmitter(emitter); - - geoParticle.Play(); - - GSOFeature feature = new GSOFeature(); - - feature.Geometry = geoParticle; - - globeControl1.Globe.MemoryLayer.AddFeature(feature); - - - return feature; - } - - /// - /// 添加喷泉 - /// - /// - private GSOFeature AddFountain() - { - string strResPath = Application.StartupPath + "/Resource"; - - GSOGeoParticle geoParticle = new GSOGeoParticle(); - geoParticle.SetPosition(116.314, 39.84, 0); // 添加到这个经纬度位置 - - GSOPointParticleEmitter emitter = new GSOPointParticleEmitter(); - emitter.TexturePath = strResPath + "/ParticleImage/test.png"; - - emitter.SetSizeFix(0.5f, 2); - emitter.VelFix = 10; - emitter.VelRnd = 2; - - emitter.GravityAcc = 9.8f; - emitter.AngleXYFix = 0; - emitter.AngleXYRnd = 180; - - emitter.AngleXZFix = 88; - emitter.AngleXZRnd = 2; - - //emitter.InnerRadius = 0; - // emitter.OuterRadius = 0.03f; - - emitter.LifeFix = 5.0f; - emitter.LifeRnd = 1.0f; - - emitter.RotFix = 0; - emitter.RotRnd = 0; - - emitter.RotVelFix = 0; - emitter.RotVelRnd = 0; - - emitter.EmitPerSec = 1000; - emitter.ColorRndStart = Color.FromArgb(33, 255, 255, 255); - emitter.ColorRndEnd = Color.FromArgb(11, 255, 255, 255); - emitter.IsLumAdded = false; - - // 将三个发射器添加到粒子对象中 - geoParticle.AddEmitter(emitter); - - geoParticle.Play(); - GSOFeature feature = new GSOFeature(); - - feature.Geometry = geoParticle; - - //globeControl1.Globe.MemoryLayer.AddFeature(feature); - globeControl1.Globe.FlyToFeature(feature); - - return feature; - } - - /// - /// 添加水柱 - /// - /// - private GSOFeature AddWaterLine() - { - string strResPath = Application.StartupPath + "/Resource"; - - GSOGeoParticle geoParticle = new GSOGeoParticle(); - geoParticle.SetPosition(116.308, 39.84, 0); // 添加到这个经纬度位置 - - GSOPointParticleEmitter emitter = new GSOPointParticleEmitter(); - - emitter.TexturePath = strResPath + "/ParticleImage/drop3.png"; - - geoParticle.TimerInterval = 1; - - emitter.SetSizeFix(2.0f, 2.0f); - - emitter.VelFix = 50; - emitter.VelRnd = 2; - - // emitter.IsLumAdded = false; - - emitter.GravityAcc = 9.8f; - emitter.AngleXYFix = 0; - emitter.AngleXYRnd = 2; - - emitter.AngleXZFix = 60; - emitter.AngleXZRnd = 2; - - //emitter.InnerRadius = 0; - // emitter.OuterRadius = 0.1f; - - emitter.LifeFix = 5.0f; - emitter.LifeRnd = 1.0f; - - emitter.RotFix = 0; - emitter.RotRnd = 0; - - emitter.RotVelFix = 0; - emitter.RotVelRnd = 0; - - emitter.EmitPerSec = 1500; - - emitter.ColorRndStart = Color.FromArgb(100, 222, 222, 222); - emitter.ColorRndEnd = Color.FromArgb(50, 222, 222, 222); - - /* - - GSOScaleParticleEffector effector1 = new GSOScaleParticleEffector(); - effector1.SetScale(0.2f, 0.2f); - effector1.StartTime = 0; - effector1.EndTime = -1; // 负数表示整个粒子生命结束 - emitter.AddEffector(effector1); - */ - - // 将三个发射器添加到粒子对象中 - geoParticle.AddEmitter(emitter); - - geoParticle.Play(); - GSOFeature feature = new GSOFeature(); - - feature.Geometry = geoParticle; - - //globeControl1.Globe.MemoryLayer.AddFeature(feature); - globeControl1.Globe.FlyToFeature(feature); - - return feature; - } + } } diff --git a/FrmBufferAnalysis.cs b/FrmBufferAnalysis.cs index f711133..db8ca59 100644 --- a/FrmBufferAnalysis.cs +++ b/FrmBufferAnalysis.cs @@ -123,39 +123,6 @@ } } /// - /// 半径文本框的键盘按键按下事件处理 - /// - /// - /// - private void txtRadius_KeyPress(object sender, KeyPressEventArgs e) - { - TextBox text = sender as TextBox; - if ((e.KeyChar < 48 || e.KeyChar > 57) && (e.KeyChar != 8) && (int)e.KeyChar != 46) - { - e.Handled = true; - } - if ((int)e.KeyChar == 46) //小数点 - { - if (text.Text.Length <= 0) - e.Handled = true; //小数点不能在第一位 - else //处理不规则的小数点 - { - float f; - float oldf; - bool b1 = false, b2 = false; - b1 = float.TryParse(text.Text, out oldf); - b2 = float.TryParse(text.Text + e.KeyChar.ToString(), out f); - if (b2 == false) - { - if (b1 == true) - e.Handled = true; - else - e.Handled = false; - } - } - } - } - /// /// 窗体关闭事件处理 /// /// diff --git a/FrmBufferAnalysisBSQ.cs b/FrmBufferAnalysisBSQ.cs index 24a96ca..f54208f 100644 --- a/FrmBufferAnalysisBSQ.cs +++ b/FrmBufferAnalysisBSQ.cs @@ -137,35 +137,7 @@ } } - private void txtRadius_KeyPress(object sender, KeyPressEventArgs e) - { - TextBox text = sender as TextBox; - if ((e.KeyChar < 48 || e.KeyChar > 57) && (e.KeyChar != 8) && (int)e.KeyChar != 46) - { - e.Handled = true; - } - if ((int)e.KeyChar == 46) //小数点 - { - if (text.Text.Length <= 0) - e.Handled = true; //小数点不能在第一位 - else //处理不规则的小数点 - { - float f; - float oldf; - bool b1 = false, b2 = false; - b1 = float.TryParse(text.Text, out oldf); - b2 = float.TryParse(text.Text + e.KeyChar.ToString(), out f); - if (b2 == false) - { - if (b1 == true) - e.Handled = true; - else - e.Handled = false; - } - } - } - } - + private void FrmBufferAnalysis_FormClosing(object sender, FormClosingEventArgs e) { //Form1.y = 0; @@ -316,27 +288,6 @@ } } - private void FlyToMenu_Click(object sender, EventArgs e) - { - if (m_feature != null) - { - if (m_feature.Geometry != null && m_feature.Geometry.Type == EnumGeometryType.GeoPolyline3D) - { - GSOGeoPolyline3D line = m_feature.Geometry as GSOGeoPolyline3D; - double length = line.GetSpaceLength(true, 6378137); - GSOGeoPolyline3D lineLine = line.GetSegment(0, length / 2); - GSOPoint3d point3d = lineLine[lineLine.PartCount - 1][lineLine[lineLine.PartCount - 1].Count - 1]; - - globeControl1.Globe.FlyToPosition(point3d, EnumAltitudeMode.Absolute, 0, 45, 5); - } - else - { - globeControl1.Globe.FlyToFeature(m_feature, 0, 45, 3); - } - LightMenu_Click(sender, e); - } - } - private void LightMenu_Click(object sender, EventArgs e) { flashflag = "single"; diff --git a/FrmDataBaseOpt.cs b/FrmDataBaseOpt.cs index b0c4b5d..8d7b69d 100644 --- a/FrmDataBaseOpt.cs +++ b/FrmDataBaseOpt.cs @@ -362,6 +362,7 @@ dbCombor.Items.Add(dblist[i].title); } } + /* /// /// 从配置文件读取数据库参数配置 /// @@ -428,6 +429,8 @@ } } + * */ + /* /// /// 向配置文件写入连接数据库的参数配置 /// @@ -485,6 +488,7 @@ MessageBox.Show(exp.ToString()); } } + * */ /// /// /// diff --git a/FrmDatabaseParaSetting.cs b/FrmDatabaseParaSetting.cs index a6fea46..63b596b 100644 --- a/FrmDatabaseParaSetting.cs +++ b/FrmDatabaseParaSetting.cs @@ -152,6 +152,7 @@ this.DialogResult = DialogResult.OK; this.Close(); } + /* /// /// 从配置文件读取数据库连接参数配置 /// @@ -218,6 +219,8 @@ } } + * */ + /* /// /// 向配置文件写入数据库参数配置 /// @@ -276,7 +279,7 @@ MessageBox.Show(ex.ToString()); } } - + */ /// /// 取消按钮事件处理 /// diff --git a/FrmDatabaseParaSetting2.cs b/FrmDatabaseParaSetting2.cs index 932d05e..96a87d5 100644 --- a/FrmDatabaseParaSetting2.cs +++ b/FrmDatabaseParaSetting2.cs @@ -148,6 +148,7 @@ this.DialogResult = DialogResult.OK; this.Close(); } + /* /// /// 从配置文件读取数据库连接参数配置 /// @@ -214,6 +215,8 @@ } } + * */ + /* /// /// 向配置文件写入数据库参数配置 /// @@ -272,7 +275,7 @@ MessageBox.Show(exp.ToString()); } } - + */ /// /// 取消按钮事件处理 /// diff --git a/FrmDiameterQuery.cs b/FrmDiameterQuery.cs index 68c948b..9a5215b 100644 --- a/FrmDiameterQuery.cs +++ b/FrmDiameterQuery.cs @@ -77,18 +77,7 @@ isBetween = true; } } - /// - /// 键盘按键按下事件处理 - /// - /// - /// - private void textBoxX1_KeyPress(object sender, KeyPressEventArgs e) - { - if ((e.KeyChar < 48 || e.KeyChar > 57) && e.KeyChar != 8) - { - e.Handled = true;//屏蔽 - } - } + bool isBetween = false; /// diff --git a/FrmDocumentEdit.cs b/FrmDocumentEdit.cs index aab2d31..e78a7ff 100644 --- a/FrmDocumentEdit.cs +++ b/FrmDocumentEdit.cs @@ -256,121 +256,6 @@ } - // - /// 将本地文件上传到指定的服务器(HttpWebRequest方法) - /// - /// 文件上传到的服务器 - /// 要上传的本地文件(全路径) - /// 文件上传后的名称 - /// 上传进度条 - /// 成功返回1,失败返回0 - private int Upload_Request(string address, string fileNamePath, string saveName, ProgressBar progressBar) - { - int returnValue = 0; - // 要上传的文件 - FileStream fs = new FileStream(fileNamePath, FileMode.Open, FileAccess.Read); - BinaryReader r = new BinaryReader(fs); - //时间戳 - string strBoundary = "----------" + DateTime.Now.Ticks.ToString("x"); - byte[] boundaryBytes = Encoding.ASCII.GetBytes("/r/n--" + strBoundary + "/r/n"); - //请求头部信息 - StringBuilder sb = new StringBuilder(); - sb.Append("--"); - sb.Append(strBoundary); - sb.Append("\r\n"); - sb.Append("Content-Disposition: form-data; name=\""); - sb.Append("file"); - sb.Append("\"; filename=\""); - sb.Append(saveName); - sb.Append("\""); - sb.Append("\r\n"); - sb.Append("Content-Type: "); - sb.Append("application/octet-stream"); - sb.Append("\r\n"); - sb.Append("\r\n"); - string strPostHeader = sb.ToString(); - byte[] postHeaderBytes = Encoding.UTF8.GetBytes(strPostHeader); - // 根据uri创建HttpWebRequest对象 - HttpWebRequest httpReq = (HttpWebRequest)WebRequest.Create(new Uri(address)); - httpReq.Method = "POST"; - //对发送的数据不使用缓存 - httpReq.AllowWriteStreamBuffering = false; - //设置获得响应的超时时间(300秒) - httpReq.Timeout = 300000; - httpReq.ContentType = "multipart/form-data; boundary=" + strBoundary; - long length = fs.Length + postHeaderBytes.Length + boundaryBytes.Length; - long fileLength = fs.Length; - httpReq.ContentLength = length; - try - { - progressBar.Maximum = int.MaxValue; - progressBar.Minimum = 0; - progressBar.Value = 0; - //每次上传4k - int bufferLength = 4096; - byte[] buffer = new byte[bufferLength]; - //已上传的字节数 - long offset = 0; - //开始上传时间 - DateTime startTime = DateTime.Now; - int size = r.Read(buffer, 0, bufferLength); - Stream postStream = httpReq.GetRequestStream(); - //发送请求头部消息 - postStream.Write(postHeaderBytes, 0, postHeaderBytes.Length); - while (size > 0) - { - postStream.Write(buffer, 0, size); - offset += size; - progressBar.Value = (int)(offset * (int.MaxValue / length)); - TimeSpan span = DateTime.Now - startTime; - double second = span.TotalSeconds; - //lblTime.Text = "已用时:" + second.ToString("F2") + "秒"; - //if (second > 0.001) - //{ - // lblSpeed.Text = " 平均速度:" + (offset / 1024 / second).ToString("0.00") + "KB/秒"; - //} - //else - //{ - // lblSpeed.Text = " 正在连接…"; - //} - //lblState.Text = "已上传:" + (offset * 100.0 / length).ToString("F2") + "%"; - //lblSize.Text = (offset / 1048576.0).ToString("F2") + "M/" + (fileLength / 1048576.0).ToString("F2") + "M"; - Application.DoEvents(); - size = r.Read(buffer, 0, bufferLength); - } - //添加尾部的时间戳 - postStream.Write(boundaryBytes, 0, boundaryBytes.Length); - postStream.Close(); - //获取服务器端的响应 - WebResponse webRespon = httpReq.GetResponse(); - Stream s = webRespon.GetResponseStream(); - StreamReader sr = new StreamReader(s); - //读取服务器端返回的消息 - String sReturnString = sr.ReadLine(); - s.Close(); - sr.Close(); - if (sReturnString == "Success") - { - returnValue = 1; - } - else if (sReturnString == "Error") - { - returnValue = 0; - } - } - catch(Exception ex) - { - returnValue = 0; - string str = ex.ToString(); - } - finally - { - fs.Close(); - r.Close(); - } - return returnValue; - } - private void btn_file_Click(object sender, EventArgs e) { OpenFileDialog dlg = new OpenFileDialog(); diff --git a/FrmExportCADS.cs b/FrmExportCADS.cs index 98772ea..59629dd 100644 --- a/FrmExportCADS.cs +++ b/FrmExportCADS.cs @@ -108,65 +108,6 @@ MessageBox.Show("请选中要导出的图层!", "提示", MessageBoxButtons.OK, MessageBoxIcon.Warning); } } - private Boolean MerageToFile(GSOFeatures features, String strDestFile, String strProj4)//图层追加 - { - if (features == null) - { - return false; - } - Boolean bSuccess = false; - - string strDir = GSOUtility.GetFileDir(strDestFile); - string strLPRJFile = GSOUtility.ChangeExt(strDestFile, ".lprj"); - string strExt = GSOUtility.GetFileExt(strDestFile); - - // 如果投影文件存在,投影以投影文件为准 - if (File.Exists(strLPRJFile)) - { - // 如果是dxf,则这样处理 - if (strExt.ToLower() == ".dxf") - { - string strTempSrcFile = strDir + "srcFeatures_dxftmp" + strExt; - globeControl1.Globe.DataManager.SaveFeatureData(features, strTempSrcFile, strLPRJFile, 4); - bSuccess = GSOUtility.MergeTwoDXFFileFeatures(strDestFile, strTempSrcFile); - File.Delete(strTempSrcFile); - } - else - { - GSOFeatures srcFeatures = globeControl1.Globe.DataManager.ReadFeatureData(strDestFile); - int nCount = features.Length; - int i = 0; - for (i = 0; i < nCount; i++) - { - srcFeatures.Add(features[i]); - } - bSuccess = globeControl1.Globe.DataManager.SaveFeatureData(srcFeatures, strDestFile, strLPRJFile, 4); - } - } - else - { - // 如果是dxf,则这样处理 - if (strExt.ToLower() == ".dxf") - { - string strTempSrcFile = strDir + "srcFeatures_dxftmp" + strExt; - globeControl1.Globe.DataManager.SaveFeatureData(features, strTempSrcFile, strProj4, 0); - bSuccess = GSOUtility.MergeTwoDXFFileFeatures(strDestFile, strTempSrcFile); - File.Delete(strTempSrcFile); - } - else - { - GSOFeatures srcFeatures = globeControl1.Globe.DataManager.ReadFeatureData(strDestFile); - int nCount = features.Length; - int i = 0; - for (i = 0; i < nCount; i++) - { - srcFeatures.Add(features[i]); - } - bSuccess = globeControl1.Globe.DataManager.SaveFeatureData(srcFeatures, strDestFile, strProj4, 0); - } - } - return bSuccess; - } /// /// 关闭按钮事件处理 /// diff --git a/FrmHDMAnalysis3.cs b/FrmHDMAnalysis3.cs index 4f73af6..2ada735 100644 --- a/FrmHDMAnalysis3.cs +++ b/FrmHDMAnalysis3.cs @@ -436,29 +436,6 @@ } layerTemp.RemoveAllFeature(); } - private void Export(GSOPoint3d _pnt, double r) - { - GSOPoint3ds pnts = new GSOPoint3ds(); - GSOPoint3d pnt = new GSOPoint3d(); - pnt.X = _pnt.X; - pnt.Y = _pnt.Y; - pnt.Z = _pnt.Z; - pnts.Add(pnt); - pnt.X = _pnt.X; - pnt.Y = _pnt.Y - 0.0000000005; - pnt.Z = _pnt.Z; - pnts.Add(pnt); - GSOGeoPolyline3D line = new GSOGeoPolyline3D(); - line.AddPart(pnts); - GSOGeoPolygon3D polygon = line.CreateBuffer(r * 2, true, 5, true, false); - GSOPoint3ds points = polygon[0]; - GSOGeoPolyline3D newLine = new GSOGeoPolyline3D(); - newLine.AddPart(points); - newLine.AltitudeMode = EnumAltitudeMode.RelativeToGround; - GSOFeature newFeature = new GSOFeature(); - newFeature.Geometry = newLine; - globeControl1.Globe.MemoryLayer.AddFeature(newFeature); - } private void ExportCAD(double a, double b, double r) { diff --git a/FrmHotFuncStat.cs b/FrmHotFuncStat.cs index c980f34..2eb1476 100644 --- a/FrmHotFuncStat.cs +++ b/FrmHotFuncStat.cs @@ -421,13 +421,6 @@ } } - private void HFS_Pderive_Click(object sender, EventArgs e) - { - if (TV_Files.SelectedNode != null) - { - HFSClass.GuideEdit_form("G", TV_Files, int.Parse(((ToolStripMenuItem)sender).Tag.ToString())); - } - } private void 导入ToolStripMenuItem_Click(object sender, EventArgs e) { @@ -530,22 +523,8 @@ } } - private void 导出ToolStripMenuItem1_Click(object sender, EventArgs e) - { - 导出ToolStripMenuItem2_Click(sender, e); - } + - private void TV_HFSSrchRslt_AfterCollapse(object sender, TreeViewEventArgs e) - { - e.Node.ImageIndex = 0; - } - - private void TV_HFSSrchRslt_AfterExpand(object sender, TreeViewEventArgs e) - { - HFSClass.ADD_TreeNode(TV_Files, e.Node); - e.Node.ImageIndex = 1; - } - private void 导出ToolStripMenuItem1_Click_1(object sender, EventArgs e) { if ((TV_HFSSrchRslt.SelectedNode != null) && (TV_HFSSrchRslt.SelectedNode.Parent != null)) diff --git a/FrmLayerControl.cs b/FrmLayerControl.cs index e7917c3..28fa14d 100644 --- a/FrmLayerControl.cs +++ b/FrmLayerControl.cs @@ -312,26 +312,7 @@ layerManagerNode.Expand(); terrainManagerNode.Expand(); } - /// - /// 刷新节点树 - /// - private void RefreshDataTree() - { - layerTree2.Nodes[0].Nodes.Clear(); - Int32 nCount = globeControl2.Globe.Layers.Count; - Int32 i = 0; - for (i = 0; i < nCount; i++) - { - GSODataset dataSpace = globeControl2.Globe.Layers[i].Dataset; - TreeNode node = new TreeNode(); - node.Text = dataSpace.Name; - node.ImageIndex = 0; - node.SelectedImageIndex = 0; - node.Checked = true; - node.Tag = dataSpace; - layerTree2.Nodes[0].Nodes.Add(node); - } - } + /// /// 目标图层按钮事件处理 /// @@ -494,22 +475,8 @@ } } } - /// - /// 改变指定节点的选中状态 - /// - /// - /// - private void CheckTreeNode(TreeNode node, Boolean bChecked) - { - CheckChildTreeNode(node, bChecked); - // 对于kml图层,如果当前处理的节点是true,那么要把所有的祖宗节点置为true - // 只有所有节点都未false,那么这个节点才为false - // CheckFatherTreeNode(node, bChecked); - globeControl1.Globe.Refresh(); - globeControl2.Globe.Refresh(); - - } + private void CheckChildTreeNode(TreeNode node, Boolean bChecked) { if (node == null) @@ -696,59 +663,7 @@ //} //CheckControl(e); } - /// - /// 树节点选中方法 - /// - /// - private void CheckControl(TreeViewEventArgs e) - { - if (e.Action != TreeViewAction.Unknown) - { - if (e.Node != null && !Convert.IsDBNull(e.Node)) - { - CheckParentNode(e.Node); - if (e.Node.Nodes.Count > 0) - { - CheckAllChildNodes(e.Node, e.Node.Checked); - } - } - } - } - /// - /// 改变所有子节点的状态 - /// - /// - /// - private void CheckAllChildNodes(TreeNode pn, bool IsChecked) - { - foreach (TreeNode tn in pn.Nodes) - { - tn.Checked = IsChecked; - if (tn.Tag.ToString().Contains("|")) - { - string nodeTag = tn.Tag.ToString().Split('|')[1]; - GSOLayer layer = globeControl1.Globe.Layers.GetLayerByCaption(nodeTag); - if (layer != null) - { - layer.Visible = IsChecked; - globeControl1.Globe.Refresh(); - } - } - if (tn.Tag is GSOFeature) - { - if (tn.Nodes.Count == 0) - { - GSOFeature feat = tn.Tag as GSOFeature; - feat.Visible = IsChecked; - globeControl1.Globe.Refresh(); - } - } - if (tn.Nodes.Count > 0) - { - CheckAllChildNodes(tn, IsChecked); - } - } - } + /// /// 改变父节点的选中状态,此处为所有子节点不选中时才取消父节点选中,可以根据需要修改 /// diff --git a/FrmLogin.cs b/FrmLogin.cs index 320fdd5..2afe46e 100644 --- a/FrmLogin.cs +++ b/FrmLogin.cs @@ -59,70 +59,6 @@ textBoxPassWord.Clear(); } } - - /// - /// 验证端口号 - /// - /// - private bool ValiPort() - { - Ping p = new Ping();//创建Ping对象p - PingReply pr = p.Send(Utility.localicenseserverip);//向指定IP或者主机名的计算机发送ICMP协议的ping数据包 - if (pr.Status == IPStatus.Success)//如果ping成功 - { - try - { - TcpClient tcpc = new TcpClient(Utility.localicenseserverip, Utility.localicenseserverport);//对IP地址为"192.168.0.105"的计算机的1500端口提出连接申请 - tcpc.Close(); - return true; - } - catch (Exception ex) - { - MessageBox.Show("端口连接错误!" + ex.Message); - return false; - } - } - else - { - int times = 0;//重新连接次数; - int count = 2;//设置尝试次数 - while (times < count) - { - //Thread.Sleep(1000);//等待时间(方便测试的话,你可以改为1000) - pr = p.Send(Utility.localicenseserverip); - - if (pr.Status == IPStatus.Success) - { - try - { - TcpClient tcpc = new TcpClient(Utility.localicenseserverip, Utility.localicenseserverport);//对IP地址为"192.168.0.105"的计算机的1500端口提出连接申请 - tcpc.Close(); - return true; - } - catch (Exception ex) - { - MessageBox.Show("端口连接错误!" + ex.Message); - return false; - } - } - else - { - times++; - if (times < count) - { - continue; - } - else - { - MessageBox.Show("重新尝试连接失败"); - return false; - } - } - - } - return false; - } - } /// /// 验证用户名、密码 /// diff --git a/FrmMetadata.cs b/FrmMetadata.cs index 886f65a..0365372 100644 --- a/FrmMetadata.cs +++ b/FrmMetadata.cs @@ -27,11 +27,7 @@ InitializeComponent(); loadTreeView(layerTree); } - private void FrmMetadata_Load(object sender, EventArgs e) - { - //this.ntLblC.Text = "nn"; - // loadTreeView(layerTree); - } + private void loadTreeView(TreeView tv)//构建图层树 { try diff --git a/Cyberpipe.csproj b/Cyberpipe.csproj index 07a8c1a..e3cd12c 100644 --- a/Cyberpipe.csproj +++ b/Cyberpipe.csproj @@ -204,25 +204,6 @@ - - Form - - - F_GKT1数据输入输出.cs - - - Form - - - F_GKT1添加文件.cs - - - Form - - - F_GKT1添加项目.cs - - Form @@ -1068,18 +1049,6 @@ Frm_password_reset.cs - - Form - - - GKT.cs - - - Form - - - GKT1.cs - Form @@ -1258,12 +1227,6 @@ F_Projedit.cs - - Form - - - PED.cs - Form @@ -1331,16 +1294,6 @@ True Reference.map - - F_GKT1数据输入输出.cs - Designer - - - F_GKT1添加文件.cs - - - F_GKT1添加项目.cs - Form_EditTask.cs @@ -1836,12 +1789,6 @@ Frm_password_reset.cs - - GKT.cs - - - GKT1.cs - F_GKT数据输入输出.cs @@ -1934,9 +1881,6 @@ F_Projedit.cs - - PED.cs - F_数据输入输出.cs diff --git a/Cyberpipe.suo b/Cyberpipe.suo index 68ced4f..a1aecf8 100644 --- a/Cyberpipe.suo +++ b/Cyberpipe.suo Binary files differ diff --git a/EMS_Forms/Form_EditTask.cs b/EMS_Forms/Form_EditTask.cs index 718992f..f1d791f 100644 --- a/EMS_Forms/Form_EditTask.cs +++ b/EMS_Forms/Form_EditTask.cs @@ -119,7 +119,8 @@ String name = Convert.ToString(dr["USERNAME"]); comboBox_userName.Items.Add(name); - } + } + dr.Close(); comboBox_road.Items.Clear(); roadList = new List(); @@ -135,7 +136,7 @@ comboBox_road.Items.Add(name); } } - + dr1.Close(); conn.Close(); bool flag2 = false; @@ -185,7 +186,7 @@ catch (Exception ex) { - MessageBox.Show(ex.ToString()); + LogHelper.WriteLog(typeof(Form_EditTask), ex.Message); } } @@ -288,7 +289,7 @@ } catch (Exception ex) { - MessageBox.Show(ex.ToString()); + LogHelper.WriteLog(typeof(Form_EditTask), ex.Message); } } @@ -474,7 +475,7 @@ } catch (Exception ex) { - MessageBox.Show(ex.ToString()); + LogHelper.WriteLog(typeof(Form_EditTask), ex.Message); } this.Close(); @@ -495,6 +496,7 @@ { numList.Add(Convert.ToInt32(dr["DBID"])); } + dr.Close(); if (numList.Count == 0) { taskNumber = Convert.ToInt32(number) * 100; @@ -674,6 +676,7 @@ } } } + dr.Close(); conn.Close(); } diff --git a/EMS_Forms/Form_EventManager.cs b/EMS_Forms/Form_EventManager.cs index b18c45b..84807b2 100644 --- a/EMS_Forms/Form_EventManager.cs +++ b/EMS_Forms/Form_EventManager.cs @@ -64,6 +64,7 @@ comboBox_name.Items.Add(name); } + dr.Close(); conn.Close(); diff --git a/Forms/FrmMnModify.cs b/Forms/FrmMnModify.cs index 31cfc5f..d036360 100644 --- a/Forms/FrmMnModify.cs +++ b/Forms/FrmMnModify.cs @@ -68,15 +68,7 @@ questionGrid.Rows[idx].Cells[1].Value = sr.question; } } - /// 选中对象 - /// - /// - /// - /// - private void buttonX1_Click(object sender, EventArgs e) - { - globecontrol.Globe.Action = EnumAction3D.SelectObject; - } + /// /// 选中某一行 /// diff --git a/Forms/FrmPipelineModelDataBase.cs b/Forms/FrmPipelineModelDataBase.cs index 2acf0ca..7ce573f 100644 --- a/Forms/FrmPipelineModelDataBase.cs +++ b/Forms/FrmPipelineModelDataBase.cs @@ -35,19 +35,7 @@ ds = _ds; InitializeComponent(); } - /// - /// 单击选择shp格式文件 - /// - /// - /// - private void btnBrowseModel_Click(object sender, EventArgs e) - { - saveFileDialog1.Filter = "*.lgd|*.lgd"; - if (saveFileDialog1.ShowDialog() == DialogResult.OK) - { - txtModelLayer.Text = saveFileDialog1.FileName; - } - } + /// /// 窗体初始化事件处理 /// @@ -100,49 +88,6 @@ } } } - - private object convertFieldValue(string fieldname, object obj) - { - if (obj == null) - return null; - - try - { - string type = fields_types[fieldname].ToString(); - switch (type) - { - case "string": - return obj.ToString(); - case "int": - //return 101; - int intResult; - if (int.TryParse(obj.ToString(), out intResult)) - return intResult; - else - return null; - case "double": - //return 202.5; - double doubleResult; - if (double.TryParse(obj.ToString(), out doubleResult)) - return doubleResult; - else - return null; - case "date": - DateTime dtResult; - if (DateTime.TryParse(obj.ToString(), out dtResult)) - return dtResult; - else - return null; - } - return null; - } - catch (Exception ex) - { - MessageBox.Show(ex.ToString()); - return null; - } - } - public string lgdFilePath = ""; /// /// 选择管线颜色 @@ -610,33 +555,6 @@ { this.Close(); } - - private void cmbLayer_SelectedIndexChanged(object sender, EventArgs e) //选择图层 - { - GSOLayer layer = ctl.Globe.Layers.GetLayerByCaption(selectLayerName); - GSOFeatures features = layer.GetAllFeatures(); - if (features.Length == 0) - return; - - cmbFrom.Items.Clear(); - cmbTo.Items.Clear(); - cmbRadius.Items.Clear(); - cmbID.Items.Clear(); - for (int i = 0; i < features[0].GetFieldCount(); i++) - { - GeoScene.Data.GSOFieldDefn fielddef = (GeoScene.Data.GSOFieldDefn)(features[0].GetFieldDefn(i)); - - cmbFrom.Items.Add(fielddef.Name); - cmbTo.Items.Add(fielddef.Name); - cmbRadius.Items.Add(fielddef.Name); - cmbID.Items.Add(fielddef.Name); - } - cmbFrom.SelectedItem = "Deep1"; - cmbTo.SelectedItem = "Deep2"; - cmbRadius.SelectedItem = "Diameter"; - cmbID.SelectedItem = "Handle"; - } - private void buttonXLayerPath_Click(object sender, EventArgs e)//单击 选择shp格式的文件 { OpenFileDialog dlg = new OpenFileDialog(); diff --git a/Forms/FrmPipelineModelDataOneStep.cs b/Forms/FrmPipelineModelDataOneStep.cs index 18afda7..ec93b8a 100644 --- a/Forms/FrmPipelineModelDataOneStep.cs +++ b/Forms/FrmPipelineModelDataOneStep.cs @@ -38,19 +38,7 @@ layerTree = _layerTree; InitializeComponent(); } - /// - /// 单击选择shp格式文件 - /// - /// - /// - private void btnBrowseModel_Click(object sender, EventArgs e) - { - saveFileDialog1.Filter = "*.lgd|*.lgd"; - if (saveFileDialog1.ShowDialog() == DialogResult.OK) - { - txtModelLayer.Text = saveFileDialog1.FileName; - } - } + /// /// 窗体初始化事件处理 /// @@ -107,48 +95,7 @@ } } - private object convertFieldValue(string fieldname, object obj) - { - if (obj == null) - return null; - - try - { - string type = fields_types[fieldname].ToString(); - switch (type) - { - case "string": - return obj.ToString(); - case "int": - //return 101; - int intResult; - if (int.TryParse(obj.ToString(), out intResult)) - return intResult; - else - return null; - case "double": - //return 202.5; - double doubleResult; - if (double.TryParse(obj.ToString(), out doubleResult)) - return doubleResult; - else - return null; - case "date": - DateTime dtResult; - if (DateTime.TryParse(obj.ToString(), out dtResult)) - return dtResult; - else - return null; - } - return null; - } - catch (Exception ex) - { - MessageBox.Show(ex.ToString()); - return null; - } - } - + public string lgdFilePath = ""; /// /// 选择管线颜色 @@ -673,32 +620,6 @@ return featDs; } - private void cmbLayer_SelectedIndexChanged(object sender, EventArgs e) //选择图层 - { - GSOLayer layer = ctl.Globe.Layers.GetLayerByCaption(selectLayerName); - GSOFeatures features = layer.GetAllFeatures(); - if (features.Length == 0) - return; - - cmbFrom.Items.Clear(); - cmbTo.Items.Clear(); - cmbRadius.Items.Clear(); - cmbID.Items.Clear(); - for (int i = 0; i < features[0].GetFieldCount(); i++) - { - GeoScene.Data.GSOFieldDefn fielddef = (GeoScene.Data.GSOFieldDefn)(features[0].GetFieldDefn(i)); - - cmbFrom.Items.Add(fielddef.Name); - cmbTo.Items.Add(fielddef.Name); - cmbRadius.Items.Add(fielddef.Name); - cmbID.Items.Add(fielddef.Name); - } - cmbFrom.SelectedItem = "Deep1"; - cmbTo.SelectedItem = "Deep2"; - cmbRadius.SelectedItem = "Diameter"; - cmbID.SelectedItem = "Handle"; - } - private void buttonXLayerPath_Click(object sender, EventArgs e)//单击 选择shp格式的文件 { OpenFileDialog dlg = new OpenFileDialog(); @@ -949,38 +870,6 @@ } //txtLayername.Text = type + layername; } - /// - /// 连接数据库 - /// - /// - /// - private void buttonX1_Click(object sender, EventArgs e) - { - if (ds == null) - { - //没连的话,直接连接审核库; //审核库配置读配置文件 - string dbIp = Utility.sgdbip; - string database = Utility.sgdbname; - string user = Utility.sgdbuser; - string pass = Utility.sgdbpwd; - - if (!Utility.isNetworkConnectionSuccess(dbIp.Trim())) - { - MessageBox.Show("网络连接失败!", "提示"); - return; - } - - ds = ctl.Globe.DataManager.OpenOracleDataSource(dbIp + "/" + database, "", "", user, pass); - if (ds == null) - { - MessageBox.Show("数据库连接失败!", "提示", MessageBoxButtons.OK, MessageBoxIcon.Warning); - } - else - { - btnCreateModel.Enabled = true; - } - } - } private void btnClose_Click(object sender, EventArgs e) { diff --git a/Forms/FrmShRK.cs b/Forms/FrmShRK.cs index 0e2e722..f1d83cb 100644 --- a/Forms/FrmShRK.cs +++ b/Forms/FrmShRK.cs @@ -215,6 +215,7 @@ { sourcefeatds = sourcefeat as GSOFeatureDataset; } + if (sourcefeatds == null) return; sourcefeatds.Open(); GSOFeatures sourcefeatures = sourcefeatds.GetAllFeatures(); @@ -251,6 +252,7 @@ { desfeatds = desfeat as GSOFeatureDataset; } + if (desfeatds == null) return; desfeatds.Open(); //向新数据集写入字段 diff --git a/FrmAccessoriesSensor.cs b/FrmAccessoriesSensor.cs index 09fcdf1..2a7a80e 100644 --- a/FrmAccessoriesSensor.cs +++ b/FrmAccessoriesSensor.cs @@ -209,7 +209,7 @@ chart1.Series[0].Points.DataBindXY(dic.Keys, dic.Values); for (int m = 0; m < dic.Values.Count; m++) { - if (chart1.Series[0].Points[m].YValues[0].ToString() != "0") + if (chart1.Series[0].Points[m]!=null&&chart1.Series[0].Points[m].YValues[0].ToString() != "0") { chart1.Series[0].Points[m].Label = chart1.Series[0].Points[m].YValues[0].ToString(); } diff --git a/FrmAccessoriesgather.cs b/FrmAccessoriesgather.cs index 9e331e1..a475d9e 100644 --- a/FrmAccessoriesgather.cs +++ b/FrmAccessoriesgather.cs @@ -338,7 +338,7 @@ chart1.Series[0].Points.DataBindXY(dic.Keys, dic.Values); for (int m = 0; m < dic.Values.Count; m++) { - if (chart1.Series[0].Points[m].YValues[0].ToString() != "0") + if (chart1.Series[0].Points[m]!=null&&chart1.Series[0].Points[m].YValues[0].ToString() != "0") { chart1.Series[0].Points[m].Label = chart1.Series[0].Points[m].YValues[0].ToString(); } diff --git a/FrmAccessoryAnalysis.cs b/FrmAccessoryAnalysis.cs index 71d4579..44d4065 100644 --- a/FrmAccessoryAnalysis.cs +++ b/FrmAccessoryAnalysis.cs @@ -66,39 +66,6 @@ globeControl1.Refresh(); } /// - /// 键盘按键按下事件处理 - /// - /// - /// - private void txtRadius_KeyPress(object sender, KeyPressEventArgs e) - { - TextBox text = sender as TextBox; - if ((e.KeyChar < 48 || e.KeyChar > 57) && (e.KeyChar != 8) && (int)e.KeyChar != 46) - { - e.Handled = true; - } - if ((int)e.KeyChar == 46) //小数点 - { - if (text.Text.Length <= 0) - e.Handled = true; //小数点不能在第一位 - else //处理不规则的小数点 - { - float f; - float oldf; - bool b1 = false, b2 = false; - b1 = float.TryParse(text.Text, out oldf); - b2 = float.TryParse(text.Text + e.KeyChar.ToString(), out f); - if (b2 == false) - { - if (b1 == true) - e.Handled = true; - else - e.Handled = false; - } - } - } - } - /// /// 确定按钮事件处理 /// /// diff --git a/FrmAddValve.cs b/FrmAddValve.cs index 34d2fec..5f405b9 100644 --- a/FrmAddValve.cs +++ b/FrmAddValve.cs @@ -486,56 +486,6 @@ } } - - - - - - - - private void cmbLayer_SelectedIndexChanged(object sender, EventArgs e) - { - GSOLayer layer = globeControl1.Globe.Layers.GetLayerByCaption(selectLayerName); - GSOFeatures features = layer.GetAllFeatures(); - if (features.Length == 0) - return; - - combPath.Items.Clear(); - combZ.Items.Clear(); - combModelName.Items.Clear(); - - for (int i = 0; i < features[0].GetFieldCount(); i++) - { - GeoScene.Data.GSOFieldDefn fielddef = (GeoScene.Data.GSOFieldDefn)(features[0].GetFieldDefn(i)); - combPath.Items.Add(fielddef.Name); - combZ.Items.Add(fielddef.Name); - combModelName.Items.Add(fielddef.Name); - } - combModelName.SelectedItem = "编号"; - combPath.SelectedItem = "模型路径"; - if (combfile.SelectedIndex != -1) - { - - string layerCaption = combfile.SelectedItem.ToString().Trim(); - rukuLayer = globeControl1.Globe.Layers.GetLayerByCaption(layerCaption); - if (rukuLayer != null) - { - combPath.Items.Clear(); - combZ.Items.Clear(); - combModelName.Items.Clear(); - - } - for (int i = 0; i < features[0].GetFieldCount(); i++) - { - GeoScene.Data.GSOFieldDefn fielddef = (GeoScene.Data.GSOFieldDefn)(features[0].GetFieldDefn(i)); - combPath.Items.Add(fielddef.Name); - combZ.Items.Add(fielddef.Name); - combModelName.Items.Add(fielddef.Name); - } - combModelName.SelectedItem = "编号"; - combPath.SelectedItem = "模型路径"; - } - } /// /// 单击选择shp格式文件 /// diff --git a/FrmAddWellShp.cs b/FrmAddWellShp.cs index bb79ec0..a249725 100644 --- a/FrmAddWellShp.cs +++ b/FrmAddWellShp.cs @@ -478,32 +478,6 @@ } } } - - private void cmbLayer_SelectedIndexChanged(object sender, EventArgs e) - { - GSOLayer layer = globeControl1.Globe.Layers.GetLayerByCaption(selectLayerName); - GSOFeatures features = layer.GetAllFeatures(); - if (features.Length == 0) - return; - - combCode.Items.Clear(); - combDeep.Items.Clear(); - combModelName.Items.Clear(); - combAngle.Items.Clear(); - - for (int i = 0; i < features[0].GetFieldCount(); i++) - { - GeoScene.Data.GSOFieldDefn fielddef = (GeoScene.Data.GSOFieldDefn)(features[0].GetFieldDefn(i)); - combCode.Items.Add(fielddef.Name); - combDeep.Items.Add(fielddef.Name); - combModelName.Items.Add(fielddef.Name); - combAngle.Items.Add(fielddef.Name); - } - combCode.SelectedItem = "附属物编码"; - combDeep.SelectedItem = "井深"; - combModelName.SelectedItem = "编号"; - combAngle.SelectedItem = "符号角度"; - } /// /// 单击选择shp格式文件 /// diff --git a/FrmAddYuBiZiShp.cs b/FrmAddYuBiZiShp.cs index b312d51..332f037 100644 --- a/FrmAddYuBiZiShp.cs +++ b/FrmAddYuBiZiShp.cs @@ -383,80 +383,7 @@ } } - private void cmbLayer_SelectedIndexChanged(object sender, EventArgs e) - { - GSOLayer layer = globeControl1.Globe.Layers.GetLayerByCaption(selectLayerName); - GSOFeatures features = layer.GetAllFeatures(); - if (features.Length == 0) - return; - - combCode.Items.Clear(); - combDeep.Items.Clear(); - combModelName.Items.Clear(); - //comboLoad.Items.Clear(); - for (int i = 0; i < features[0].GetFieldCount(); i++) - { - GeoScene.Data.GSOFieldDefn fielddef = (GeoScene.Data.GSOFieldDefn)(features[0].GetFieldDefn(i)); - combCode.Items.Add(fielddef.Name); - combDeep.Items.Add(fielddef.Name); - combModelName.Items.Add(fielddef.Name); - //comboLoad.Items.Add(fielddef.Name); - } - combCode.SelectedItem = "附属物编码"; - combDeep.SelectedItem = "Z坐标"; - combModelName.SelectedItem = "编号"; - //comboLoad.SelectedItem = "模型路径"; - } - - private void buttonXLayerPath_Click(object sender, EventArgs e) - { - OpenFileDialog dlg = new OpenFileDialog(); - dlg.Filter = "*.shp|*.shp"; - dlg.Multiselect = false; - if (dlg.ShowDialog() == DialogResult.OK) - { - GSOLayer layer = globeControl1.Globe.Layers.Add(dlg.FileName); - string txtMessage = valiYBdata(layer); - if (txtMessage != "") - { - button3.Enabled = false; - //textBoxLayer.Text = ""; - combCode.Items.Clear(); - combDeep.Items.Clear(); - combModelName.Items.Clear(); - globeControl1.Globe.Layers.Remove(layer); - FrmValiDataShowErrorMessage showErrorMessage = new FrmValiDataShowErrorMessage(dlg.FileName, txtMessage); - showErrorMessage.ShowDialog(); - return; - } - else - { - button3.Enabled = true; - //textBoxLayer.Text = dlg.FileName; - selectLayerName = layer.Caption; - txtLayerName.Text = layer.Caption; - GSOFeatures features = layer.GetAllFeatures(); - if (features.Length == 0) - return; - - combCode.Items.Clear(); - combDeep.Items.Clear(); - combModelName.Items.Clear(); - for (int i = 0; i < features[0].GetFieldCount(); i++) - { - GeoScene.Data.GSOFieldDefn fielddef = (GeoScene.Data.GSOFieldDefn)(features[0].GetFieldDefn(i)); - combCode.Items.Add(fielddef.Name); - combDeep.Items.Add(fielddef.Name); - combModelName.Items.Add(fielddef.Name); - //comboLoad.Items.Add(fielddef.Name); - } - combCode.SelectedItem = "管点编码"; - combDeep.SelectedItem = "Z坐标"; - combModelName.SelectedItem = "编号"; - } - } - } - + private void FrmAddYuBiZiShp_FormClosing(object sender, FormClosingEventArgs e) { globeControl1.Globe.Refresh(); diff --git a/FrmAllPipelineStatis.cs b/FrmAllPipelineStatis.cs index 6421a26..a6eea29 100644 --- a/FrmAllPipelineStatis.cs +++ b/FrmAllPipelineStatis.cs @@ -84,7 +84,7 @@ chartAllAreaPipeline.Series["管线"].Points.DataBindXY(pipelineLengthAndType.Keys, pipelineLengthAndType.Values); for (int m = 0; m < pipelineLengthAndType.Values.Count; m++) { - if (chartAllAreaPipeline.Series["管线"].Points[m].YValues[0].ToString() != "0") + if (chartAllAreaPipeline.Series["管线"].Points[m]!=null&&chartAllAreaPipeline.Series["管线"].Points[m].YValues[0].ToString() != "0") { chartAllAreaPipeline.Series["管线"].Points[m].Label = chartAllAreaPipeline.Series[0].Points[m].YValues[0].ToString(); } @@ -94,7 +94,7 @@ } catch (Exception ex) { - //LogError.PublishError(ex); + LogHelper.WriteLog(typeof(FrmAllPipelineStatis), ex.Message); } } @@ -147,7 +147,7 @@ } DataTable dt = OledbHelper.QueryTable(sql); - if (dt != null && dt.Rows.Count > 0) + if (dt != null && dt.Rows.Count > 0 && chartAllAreaPipeline.Series["管线"].Points[indexHit]!=null) { dataGridViewX1.DataSource = dt; panel.Visible = true; diff --git a/FrmAllWorkWellStatis.cs b/FrmAllWorkWellStatis.cs index 6fec7af..6af8e4c 100644 --- a/FrmAllWorkWellStatis.cs +++ b/FrmAllWorkWellStatis.cs @@ -52,7 +52,7 @@ chartAllAreaPipeline.Series["井盖"].Points.DataBindXY(workWellLengthAndType.Keys, workWellLengthAndType.Values); for (int m = 0; m < workWellLengthAndType.Values.Count; m++) { - if (chartAllAreaPipeline.Series["井盖"].Points[m].YValues[0].ToString().Trim() != "0") + if (chartAllAreaPipeline.Series["井盖"].Points[m]!=null&&chartAllAreaPipeline.Series["井盖"].Points[m].YValues[0].ToString().Trim() != "0") { chartAllAreaPipeline.Series["井盖"].Points[m].Label = chartAllAreaPipeline.Series[0].Points[m].YValues[0].ToString(); } @@ -60,7 +60,7 @@ } catch (Exception ex) { - //LogError.PublishError(ex); + LogHelper.WriteLog(typeof(FrmAllWorkWellStatis), ex.Message); } } diff --git a/FrmBSQDuoBianXingStatis.cs b/FrmBSQDuoBianXingStatis.cs index e8b7d52..3e889b6 100644 --- a/FrmBSQDuoBianXingStatis.cs +++ b/FrmBSQDuoBianXingStatis.cs @@ -60,7 +60,7 @@ { for (int m = 0; m < bsq1.Values.Count; m++) { - if (chart1.Series["标识器"].Points[m].YValues[0].ToString() != "0") + if (chart1.Series["标识器"].Points[m]!=null&&chart1.Series["标识器"].Points[m].YValues[0].ToString() != "0") { count += Convert.ToInt16(chart1.Series[0].Points[m].YValues[0].ToString()); chart1.Series["标识器"].Points[m].Label = chart1.Series[0].Points[m].YValues[0].ToString(); diff --git a/FrmBSQDuoBianXingStreet.cs b/FrmBSQDuoBianXingStreet.cs index 2005ebb..1db5777 100644 --- a/FrmBSQDuoBianXingStreet.cs +++ b/FrmBSQDuoBianXingStreet.cs @@ -63,7 +63,7 @@ chartStatis.Series[0].Points.DataBindXY(bsq.Keys, bsq.Values); for (int m = 0; m < bsq.Values.Count; m++) { - if (chartStatis.Series[0].Points[m].YValues[0].ToString().Trim() != "0") + if (chartStatis.Series[0].Points[m]!=null&&chartStatis.Series[0].Points[m].YValues[0].ToString().Trim() != "0") { count += Convert.ToInt16(chartStatis.Series[0].Points[m].YValues[0].ToString()); chartStatis.Series[0].Points[m].Label = chartStatis.Series[0].Points[m].YValues[0].ToString(); diff --git a/FrmBSQStatis.cs b/FrmBSQStatis.cs index 390a55c..4aa0ee6 100644 --- a/FrmBSQStatis.cs +++ b/FrmBSQStatis.cs @@ -95,6 +95,8 @@ } } } + + dr.Close(); conn.Close(); for (int i = 0; i < typeLists.Count; i++) { @@ -123,7 +125,7 @@ chartStatis.Series[0].Points.DataBindXY(bsq.Keys, bsq.Values); for (int m = 0; m < bsq.Values.Count; m++) { - if (chartStatis.Series[0].Points[m].YValues[0].ToString().Trim() != "0") + if (chartStatis.Series[0].Points[m]!=null&&chartStatis.Series[0].Points[m].YValues[0].ToString().Trim() != "0") { //count += Convert.ToInt16(chartStatis.Series[0].Points[m].YValues[0].ToString()); chartStatis.Series[0].Points[m].Label = chartStatis.Series[0].Points[m].YValues[0].ToString(); diff --git a/FrmBSQStreet.cs b/FrmBSQStreet.cs index 9d88adb..7fbacad 100644 --- a/FrmBSQStreet.cs +++ b/FrmBSQStreet.cs @@ -44,7 +44,7 @@ chartStatis.Series[0].Points.DataBindXY(bsq.Keys, bsq.Values); for (int m = 0; m < bsq.Values.Count; m++) { - if (chartStatis.Series[0].Points[m].YValues[0].ToString().Trim() != "0") + if (chartStatis.Series[0].Points[m]!=null&&chartStatis.Series[0].Points[m].YValues[0].ToString().Trim() != "0") { count += Convert.ToInt16(chartStatis.Series[0].Points[m].YValues[0].ToString()); chartStatis.Series[0].Points[m].Label = chartStatis.Series[0].Points[m].YValues[0].ToString(); diff --git a/FrmBoosterValvers.cs b/FrmBoosterValvers.cs index 5061efc..df9b62b 100644 --- a/FrmBoosterValvers.cs +++ b/FrmBoosterValvers.cs @@ -236,199 +236,6 @@ count = 0; } } - /// - /// 添加火苗 - /// - /// - /// - /// - /// - private GSOFeature AddFire(double x,double y,double z) - { - // 烟火示例 - - string strResPath = Application.StartupPath + "/Resource"; - - // 烟火粒子示例,由三个发射器构成 - GSOGeoParticle geoParticle = new GSOGeoParticle(); - geoParticle.SetPosition(x, y, z); // 添加到这个经纬度位置 - geoParticle.AltitudeMode = EnumAltitudeMode.RelativeToGround; - - GSORingParticleEmitter emitter = new GSORingParticleEmitter(); - emitter.TexturePath = strResPath + "/ParticleImage/flare.png"; - - emitter.SetSizeFix(1, 1); - emitter.VelFix = 1; - emitter.VelRnd = 5; - - emitter.AngleXYFix = 0; - emitter.AngleXYRnd = 180; - - emitter.AngleXZFix = 90; - emitter.AngleXZRnd = 0; - - emitter.LifeFix = 0.5f; - emitter.LifeRnd = 0.0f; - - emitter.RotFix = 0; - emitter.RotRnd = 0; - - emitter.RotVelFix = 0; - emitter.RotVelRnd = 0; - - emitter.EmitPerSec = 100; - - // 采用线性插值生成粒子的初始颜色 - emitter.ColorRndStart = Color.White; - emitter.ColorRndEnd = Color.Red; - - - GSOColorParticleEffector effector2 = new GSOColorParticleEffector(); - effector2.SetColorChanged(0, -1, -1, 0); - effector2.StartTime = 0.0f; - effector2.EndTime = -1.0f; - emitter.AddEffector(effector2); - - // 将三个发射器添加到粒子对象中 - geoParticle.AddEmitter(emitter); - - geoParticle.Play(); - - GSOFeature feature = new GSOFeature(); - - feature.Geometry = geoParticle; - - globeControl1.Globe.MemoryLayer.AddFeature(feature); - - - return feature; - } - - /// - /// 添加喷泉 - /// - /// - private GSOFeature AddFountain() - { - string strResPath = Application.StartupPath + "/Resource"; - - GSOGeoParticle geoParticle = new GSOGeoParticle(); - geoParticle.SetPosition(116.314, 39.84, 0); // 添加到这个经纬度位置 - - GSOPointParticleEmitter emitter = new GSOPointParticleEmitter(); - emitter.TexturePath = strResPath + "/ParticleImage/test.png"; - - emitter.SetSizeFix(0.5f, 2); - emitter.VelFix = 10; - emitter.VelRnd = 2; - - emitter.GravityAcc = 9.8f; - emitter.AngleXYFix = 0; - emitter.AngleXYRnd = 180; - - emitter.AngleXZFix = 88; - emitter.AngleXZRnd = 2; - - //emitter.InnerRadius = 0; - // emitter.OuterRadius = 0.03f; - - emitter.LifeFix = 5.0f; - emitter.LifeRnd = 1.0f; - - emitter.RotFix = 0; - emitter.RotRnd = 0; - - emitter.RotVelFix = 0; - emitter.RotVelRnd = 0; - - emitter.EmitPerSec = 1000; - emitter.ColorRndStart = Color.FromArgb(33, 255, 255, 255); - emitter.ColorRndEnd = Color.FromArgb(11, 255, 255, 255); - emitter.IsLumAdded = false; - - // 将三个发射器添加到粒子对象中 - geoParticle.AddEmitter(emitter); - - geoParticle.Play(); - GSOFeature feature = new GSOFeature(); - - feature.Geometry = geoParticle; - - //globeControl1.Globe.MemoryLayer.AddFeature(feature); - globeControl1.Globe.FlyToFeature(feature); - - return feature; - } - - /// - /// 添加水柱 - /// - /// - private GSOFeature AddWaterLine() - { - string strResPath = Application.StartupPath + "/Resource"; - - GSOGeoParticle geoParticle = new GSOGeoParticle(); - geoParticle.SetPosition(116.308, 39.84, 0); // 添加到这个经纬度位置 - - GSOPointParticleEmitter emitter = new GSOPointParticleEmitter(); - - emitter.TexturePath = strResPath + "/ParticleImage/drop3.png"; - - geoParticle.TimerInterval = 1; - - emitter.SetSizeFix(2.0f, 2.0f); - - emitter.VelFix = 50; - emitter.VelRnd = 2; - - // emitter.IsLumAdded = false; - - emitter.GravityAcc = 9.8f; - emitter.AngleXYFix = 0; - emitter.AngleXYRnd = 2; - - emitter.AngleXZFix = 60; - emitter.AngleXZRnd = 2; - - //emitter.InnerRadius = 0; - // emitter.OuterRadius = 0.1f; - - emitter.LifeFix = 5.0f; - emitter.LifeRnd = 1.0f; - - emitter.RotFix = 0; - emitter.RotRnd = 0; - - emitter.RotVelFix = 0; - emitter.RotVelRnd = 0; - - emitter.EmitPerSec = 1500; - - emitter.ColorRndStart = Color.FromArgb(100, 222, 222, 222); - emitter.ColorRndEnd = Color.FromArgb(50, 222, 222, 222); - - /* - - GSOScaleParticleEffector effector1 = new GSOScaleParticleEffector(); - effector1.SetScale(0.2f, 0.2f); - effector1.StartTime = 0; - effector1.EndTime = -1; // 负数表示整个粒子生命结束 - emitter.AddEffector(effector1); - */ - - // 将三个发射器添加到粒子对象中 - geoParticle.AddEmitter(emitter); - - geoParticle.Play(); - GSOFeature feature = new GSOFeature(); - - feature.Geometry = geoParticle; - - //globeControl1.Globe.MemoryLayer.AddFeature(feature); - globeControl1.Globe.FlyToFeature(feature); - - return feature; - } + } } diff --git a/FrmBufferAnalysis.cs b/FrmBufferAnalysis.cs index f711133..db8ca59 100644 --- a/FrmBufferAnalysis.cs +++ b/FrmBufferAnalysis.cs @@ -123,39 +123,6 @@ } } /// - /// 半径文本框的键盘按键按下事件处理 - /// - /// - /// - private void txtRadius_KeyPress(object sender, KeyPressEventArgs e) - { - TextBox text = sender as TextBox; - if ((e.KeyChar < 48 || e.KeyChar > 57) && (e.KeyChar != 8) && (int)e.KeyChar != 46) - { - e.Handled = true; - } - if ((int)e.KeyChar == 46) //小数点 - { - if (text.Text.Length <= 0) - e.Handled = true; //小数点不能在第一位 - else //处理不规则的小数点 - { - float f; - float oldf; - bool b1 = false, b2 = false; - b1 = float.TryParse(text.Text, out oldf); - b2 = float.TryParse(text.Text + e.KeyChar.ToString(), out f); - if (b2 == false) - { - if (b1 == true) - e.Handled = true; - else - e.Handled = false; - } - } - } - } - /// /// 窗体关闭事件处理 /// /// diff --git a/FrmBufferAnalysisBSQ.cs b/FrmBufferAnalysisBSQ.cs index 24a96ca..f54208f 100644 --- a/FrmBufferAnalysisBSQ.cs +++ b/FrmBufferAnalysisBSQ.cs @@ -137,35 +137,7 @@ } } - private void txtRadius_KeyPress(object sender, KeyPressEventArgs e) - { - TextBox text = sender as TextBox; - if ((e.KeyChar < 48 || e.KeyChar > 57) && (e.KeyChar != 8) && (int)e.KeyChar != 46) - { - e.Handled = true; - } - if ((int)e.KeyChar == 46) //小数点 - { - if (text.Text.Length <= 0) - e.Handled = true; //小数点不能在第一位 - else //处理不规则的小数点 - { - float f; - float oldf; - bool b1 = false, b2 = false; - b1 = float.TryParse(text.Text, out oldf); - b2 = float.TryParse(text.Text + e.KeyChar.ToString(), out f); - if (b2 == false) - { - if (b1 == true) - e.Handled = true; - else - e.Handled = false; - } - } - } - } - + private void FrmBufferAnalysis_FormClosing(object sender, FormClosingEventArgs e) { //Form1.y = 0; @@ -316,27 +288,6 @@ } } - private void FlyToMenu_Click(object sender, EventArgs e) - { - if (m_feature != null) - { - if (m_feature.Geometry != null && m_feature.Geometry.Type == EnumGeometryType.GeoPolyline3D) - { - GSOGeoPolyline3D line = m_feature.Geometry as GSOGeoPolyline3D; - double length = line.GetSpaceLength(true, 6378137); - GSOGeoPolyline3D lineLine = line.GetSegment(0, length / 2); - GSOPoint3d point3d = lineLine[lineLine.PartCount - 1][lineLine[lineLine.PartCount - 1].Count - 1]; - - globeControl1.Globe.FlyToPosition(point3d, EnumAltitudeMode.Absolute, 0, 45, 5); - } - else - { - globeControl1.Globe.FlyToFeature(m_feature, 0, 45, 3); - } - LightMenu_Click(sender, e); - } - } - private void LightMenu_Click(object sender, EventArgs e) { flashflag = "single"; diff --git a/FrmDataBaseOpt.cs b/FrmDataBaseOpt.cs index b0c4b5d..8d7b69d 100644 --- a/FrmDataBaseOpt.cs +++ b/FrmDataBaseOpt.cs @@ -362,6 +362,7 @@ dbCombor.Items.Add(dblist[i].title); } } + /* /// /// 从配置文件读取数据库参数配置 /// @@ -428,6 +429,8 @@ } } + * */ + /* /// /// 向配置文件写入连接数据库的参数配置 /// @@ -485,6 +488,7 @@ MessageBox.Show(exp.ToString()); } } + * */ /// /// /// diff --git a/FrmDatabaseParaSetting.cs b/FrmDatabaseParaSetting.cs index a6fea46..63b596b 100644 --- a/FrmDatabaseParaSetting.cs +++ b/FrmDatabaseParaSetting.cs @@ -152,6 +152,7 @@ this.DialogResult = DialogResult.OK; this.Close(); } + /* /// /// 从配置文件读取数据库连接参数配置 /// @@ -218,6 +219,8 @@ } } + * */ + /* /// /// 向配置文件写入数据库参数配置 /// @@ -276,7 +279,7 @@ MessageBox.Show(ex.ToString()); } } - + */ /// /// 取消按钮事件处理 /// diff --git a/FrmDatabaseParaSetting2.cs b/FrmDatabaseParaSetting2.cs index 932d05e..96a87d5 100644 --- a/FrmDatabaseParaSetting2.cs +++ b/FrmDatabaseParaSetting2.cs @@ -148,6 +148,7 @@ this.DialogResult = DialogResult.OK; this.Close(); } + /* /// /// 从配置文件读取数据库连接参数配置 /// @@ -214,6 +215,8 @@ } } + * */ + /* /// /// 向配置文件写入数据库参数配置 /// @@ -272,7 +275,7 @@ MessageBox.Show(exp.ToString()); } } - + */ /// /// 取消按钮事件处理 /// diff --git a/FrmDiameterQuery.cs b/FrmDiameterQuery.cs index 68c948b..9a5215b 100644 --- a/FrmDiameterQuery.cs +++ b/FrmDiameterQuery.cs @@ -77,18 +77,7 @@ isBetween = true; } } - /// - /// 键盘按键按下事件处理 - /// - /// - /// - private void textBoxX1_KeyPress(object sender, KeyPressEventArgs e) - { - if ((e.KeyChar < 48 || e.KeyChar > 57) && e.KeyChar != 8) - { - e.Handled = true;//屏蔽 - } - } + bool isBetween = false; /// diff --git a/FrmDocumentEdit.cs b/FrmDocumentEdit.cs index aab2d31..e78a7ff 100644 --- a/FrmDocumentEdit.cs +++ b/FrmDocumentEdit.cs @@ -256,121 +256,6 @@ } - // - /// 将本地文件上传到指定的服务器(HttpWebRequest方法) - /// - /// 文件上传到的服务器 - /// 要上传的本地文件(全路径) - /// 文件上传后的名称 - /// 上传进度条 - /// 成功返回1,失败返回0 - private int Upload_Request(string address, string fileNamePath, string saveName, ProgressBar progressBar) - { - int returnValue = 0; - // 要上传的文件 - FileStream fs = new FileStream(fileNamePath, FileMode.Open, FileAccess.Read); - BinaryReader r = new BinaryReader(fs); - //时间戳 - string strBoundary = "----------" + DateTime.Now.Ticks.ToString("x"); - byte[] boundaryBytes = Encoding.ASCII.GetBytes("/r/n--" + strBoundary + "/r/n"); - //请求头部信息 - StringBuilder sb = new StringBuilder(); - sb.Append("--"); - sb.Append(strBoundary); - sb.Append("\r\n"); - sb.Append("Content-Disposition: form-data; name=\""); - sb.Append("file"); - sb.Append("\"; filename=\""); - sb.Append(saveName); - sb.Append("\""); - sb.Append("\r\n"); - sb.Append("Content-Type: "); - sb.Append("application/octet-stream"); - sb.Append("\r\n"); - sb.Append("\r\n"); - string strPostHeader = sb.ToString(); - byte[] postHeaderBytes = Encoding.UTF8.GetBytes(strPostHeader); - // 根据uri创建HttpWebRequest对象 - HttpWebRequest httpReq = (HttpWebRequest)WebRequest.Create(new Uri(address)); - httpReq.Method = "POST"; - //对发送的数据不使用缓存 - httpReq.AllowWriteStreamBuffering = false; - //设置获得响应的超时时间(300秒) - httpReq.Timeout = 300000; - httpReq.ContentType = "multipart/form-data; boundary=" + strBoundary; - long length = fs.Length + postHeaderBytes.Length + boundaryBytes.Length; - long fileLength = fs.Length; - httpReq.ContentLength = length; - try - { - progressBar.Maximum = int.MaxValue; - progressBar.Minimum = 0; - progressBar.Value = 0; - //每次上传4k - int bufferLength = 4096; - byte[] buffer = new byte[bufferLength]; - //已上传的字节数 - long offset = 0; - //开始上传时间 - DateTime startTime = DateTime.Now; - int size = r.Read(buffer, 0, bufferLength); - Stream postStream = httpReq.GetRequestStream(); - //发送请求头部消息 - postStream.Write(postHeaderBytes, 0, postHeaderBytes.Length); - while (size > 0) - { - postStream.Write(buffer, 0, size); - offset += size; - progressBar.Value = (int)(offset * (int.MaxValue / length)); - TimeSpan span = DateTime.Now - startTime; - double second = span.TotalSeconds; - //lblTime.Text = "已用时:" + second.ToString("F2") + "秒"; - //if (second > 0.001) - //{ - // lblSpeed.Text = " 平均速度:" + (offset / 1024 / second).ToString("0.00") + "KB/秒"; - //} - //else - //{ - // lblSpeed.Text = " 正在连接…"; - //} - //lblState.Text = "已上传:" + (offset * 100.0 / length).ToString("F2") + "%"; - //lblSize.Text = (offset / 1048576.0).ToString("F2") + "M/" + (fileLength / 1048576.0).ToString("F2") + "M"; - Application.DoEvents(); - size = r.Read(buffer, 0, bufferLength); - } - //添加尾部的时间戳 - postStream.Write(boundaryBytes, 0, boundaryBytes.Length); - postStream.Close(); - //获取服务器端的响应 - WebResponse webRespon = httpReq.GetResponse(); - Stream s = webRespon.GetResponseStream(); - StreamReader sr = new StreamReader(s); - //读取服务器端返回的消息 - String sReturnString = sr.ReadLine(); - s.Close(); - sr.Close(); - if (sReturnString == "Success") - { - returnValue = 1; - } - else if (sReturnString == "Error") - { - returnValue = 0; - } - } - catch(Exception ex) - { - returnValue = 0; - string str = ex.ToString(); - } - finally - { - fs.Close(); - r.Close(); - } - return returnValue; - } - private void btn_file_Click(object sender, EventArgs e) { OpenFileDialog dlg = new OpenFileDialog(); diff --git a/FrmExportCADS.cs b/FrmExportCADS.cs index 98772ea..59629dd 100644 --- a/FrmExportCADS.cs +++ b/FrmExportCADS.cs @@ -108,65 +108,6 @@ MessageBox.Show("请选中要导出的图层!", "提示", MessageBoxButtons.OK, MessageBoxIcon.Warning); } } - private Boolean MerageToFile(GSOFeatures features, String strDestFile, String strProj4)//图层追加 - { - if (features == null) - { - return false; - } - Boolean bSuccess = false; - - string strDir = GSOUtility.GetFileDir(strDestFile); - string strLPRJFile = GSOUtility.ChangeExt(strDestFile, ".lprj"); - string strExt = GSOUtility.GetFileExt(strDestFile); - - // 如果投影文件存在,投影以投影文件为准 - if (File.Exists(strLPRJFile)) - { - // 如果是dxf,则这样处理 - if (strExt.ToLower() == ".dxf") - { - string strTempSrcFile = strDir + "srcFeatures_dxftmp" + strExt; - globeControl1.Globe.DataManager.SaveFeatureData(features, strTempSrcFile, strLPRJFile, 4); - bSuccess = GSOUtility.MergeTwoDXFFileFeatures(strDestFile, strTempSrcFile); - File.Delete(strTempSrcFile); - } - else - { - GSOFeatures srcFeatures = globeControl1.Globe.DataManager.ReadFeatureData(strDestFile); - int nCount = features.Length; - int i = 0; - for (i = 0; i < nCount; i++) - { - srcFeatures.Add(features[i]); - } - bSuccess = globeControl1.Globe.DataManager.SaveFeatureData(srcFeatures, strDestFile, strLPRJFile, 4); - } - } - else - { - // 如果是dxf,则这样处理 - if (strExt.ToLower() == ".dxf") - { - string strTempSrcFile = strDir + "srcFeatures_dxftmp" + strExt; - globeControl1.Globe.DataManager.SaveFeatureData(features, strTempSrcFile, strProj4, 0); - bSuccess = GSOUtility.MergeTwoDXFFileFeatures(strDestFile, strTempSrcFile); - File.Delete(strTempSrcFile); - } - else - { - GSOFeatures srcFeatures = globeControl1.Globe.DataManager.ReadFeatureData(strDestFile); - int nCount = features.Length; - int i = 0; - for (i = 0; i < nCount; i++) - { - srcFeatures.Add(features[i]); - } - bSuccess = globeControl1.Globe.DataManager.SaveFeatureData(srcFeatures, strDestFile, strProj4, 0); - } - } - return bSuccess; - } /// /// 关闭按钮事件处理 /// diff --git a/FrmHDMAnalysis3.cs b/FrmHDMAnalysis3.cs index 4f73af6..2ada735 100644 --- a/FrmHDMAnalysis3.cs +++ b/FrmHDMAnalysis3.cs @@ -436,29 +436,6 @@ } layerTemp.RemoveAllFeature(); } - private void Export(GSOPoint3d _pnt, double r) - { - GSOPoint3ds pnts = new GSOPoint3ds(); - GSOPoint3d pnt = new GSOPoint3d(); - pnt.X = _pnt.X; - pnt.Y = _pnt.Y; - pnt.Z = _pnt.Z; - pnts.Add(pnt); - pnt.X = _pnt.X; - pnt.Y = _pnt.Y - 0.0000000005; - pnt.Z = _pnt.Z; - pnts.Add(pnt); - GSOGeoPolyline3D line = new GSOGeoPolyline3D(); - line.AddPart(pnts); - GSOGeoPolygon3D polygon = line.CreateBuffer(r * 2, true, 5, true, false); - GSOPoint3ds points = polygon[0]; - GSOGeoPolyline3D newLine = new GSOGeoPolyline3D(); - newLine.AddPart(points); - newLine.AltitudeMode = EnumAltitudeMode.RelativeToGround; - GSOFeature newFeature = new GSOFeature(); - newFeature.Geometry = newLine; - globeControl1.Globe.MemoryLayer.AddFeature(newFeature); - } private void ExportCAD(double a, double b, double r) { diff --git a/FrmHotFuncStat.cs b/FrmHotFuncStat.cs index c980f34..2eb1476 100644 --- a/FrmHotFuncStat.cs +++ b/FrmHotFuncStat.cs @@ -421,13 +421,6 @@ } } - private void HFS_Pderive_Click(object sender, EventArgs e) - { - if (TV_Files.SelectedNode != null) - { - HFSClass.GuideEdit_form("G", TV_Files, int.Parse(((ToolStripMenuItem)sender).Tag.ToString())); - } - } private void 导入ToolStripMenuItem_Click(object sender, EventArgs e) { @@ -530,22 +523,8 @@ } } - private void 导出ToolStripMenuItem1_Click(object sender, EventArgs e) - { - 导出ToolStripMenuItem2_Click(sender, e); - } + - private void TV_HFSSrchRslt_AfterCollapse(object sender, TreeViewEventArgs e) - { - e.Node.ImageIndex = 0; - } - - private void TV_HFSSrchRslt_AfterExpand(object sender, TreeViewEventArgs e) - { - HFSClass.ADD_TreeNode(TV_Files, e.Node); - e.Node.ImageIndex = 1; - } - private void 导出ToolStripMenuItem1_Click_1(object sender, EventArgs e) { if ((TV_HFSSrchRslt.SelectedNode != null) && (TV_HFSSrchRslt.SelectedNode.Parent != null)) diff --git a/FrmLayerControl.cs b/FrmLayerControl.cs index e7917c3..28fa14d 100644 --- a/FrmLayerControl.cs +++ b/FrmLayerControl.cs @@ -312,26 +312,7 @@ layerManagerNode.Expand(); terrainManagerNode.Expand(); } - /// - /// 刷新节点树 - /// - private void RefreshDataTree() - { - layerTree2.Nodes[0].Nodes.Clear(); - Int32 nCount = globeControl2.Globe.Layers.Count; - Int32 i = 0; - for (i = 0; i < nCount; i++) - { - GSODataset dataSpace = globeControl2.Globe.Layers[i].Dataset; - TreeNode node = new TreeNode(); - node.Text = dataSpace.Name; - node.ImageIndex = 0; - node.SelectedImageIndex = 0; - node.Checked = true; - node.Tag = dataSpace; - layerTree2.Nodes[0].Nodes.Add(node); - } - } + /// /// 目标图层按钮事件处理 /// @@ -494,22 +475,8 @@ } } } - /// - /// 改变指定节点的选中状态 - /// - /// - /// - private void CheckTreeNode(TreeNode node, Boolean bChecked) - { - CheckChildTreeNode(node, bChecked); - // 对于kml图层,如果当前处理的节点是true,那么要把所有的祖宗节点置为true - // 只有所有节点都未false,那么这个节点才为false - // CheckFatherTreeNode(node, bChecked); - globeControl1.Globe.Refresh(); - globeControl2.Globe.Refresh(); - - } + private void CheckChildTreeNode(TreeNode node, Boolean bChecked) { if (node == null) @@ -696,59 +663,7 @@ //} //CheckControl(e); } - /// - /// 树节点选中方法 - /// - /// - private void CheckControl(TreeViewEventArgs e) - { - if (e.Action != TreeViewAction.Unknown) - { - if (e.Node != null && !Convert.IsDBNull(e.Node)) - { - CheckParentNode(e.Node); - if (e.Node.Nodes.Count > 0) - { - CheckAllChildNodes(e.Node, e.Node.Checked); - } - } - } - } - /// - /// 改变所有子节点的状态 - /// - /// - /// - private void CheckAllChildNodes(TreeNode pn, bool IsChecked) - { - foreach (TreeNode tn in pn.Nodes) - { - tn.Checked = IsChecked; - if (tn.Tag.ToString().Contains("|")) - { - string nodeTag = tn.Tag.ToString().Split('|')[1]; - GSOLayer layer = globeControl1.Globe.Layers.GetLayerByCaption(nodeTag); - if (layer != null) - { - layer.Visible = IsChecked; - globeControl1.Globe.Refresh(); - } - } - if (tn.Tag is GSOFeature) - { - if (tn.Nodes.Count == 0) - { - GSOFeature feat = tn.Tag as GSOFeature; - feat.Visible = IsChecked; - globeControl1.Globe.Refresh(); - } - } - if (tn.Nodes.Count > 0) - { - CheckAllChildNodes(tn, IsChecked); - } - } - } + /// /// 改变父节点的选中状态,此处为所有子节点不选中时才取消父节点选中,可以根据需要修改 /// diff --git a/FrmLogin.cs b/FrmLogin.cs index 320fdd5..2afe46e 100644 --- a/FrmLogin.cs +++ b/FrmLogin.cs @@ -59,70 +59,6 @@ textBoxPassWord.Clear(); } } - - /// - /// 验证端口号 - /// - /// - private bool ValiPort() - { - Ping p = new Ping();//创建Ping对象p - PingReply pr = p.Send(Utility.localicenseserverip);//向指定IP或者主机名的计算机发送ICMP协议的ping数据包 - if (pr.Status == IPStatus.Success)//如果ping成功 - { - try - { - TcpClient tcpc = new TcpClient(Utility.localicenseserverip, Utility.localicenseserverport);//对IP地址为"192.168.0.105"的计算机的1500端口提出连接申请 - tcpc.Close(); - return true; - } - catch (Exception ex) - { - MessageBox.Show("端口连接错误!" + ex.Message); - return false; - } - } - else - { - int times = 0;//重新连接次数; - int count = 2;//设置尝试次数 - while (times < count) - { - //Thread.Sleep(1000);//等待时间(方便测试的话,你可以改为1000) - pr = p.Send(Utility.localicenseserverip); - - if (pr.Status == IPStatus.Success) - { - try - { - TcpClient tcpc = new TcpClient(Utility.localicenseserverip, Utility.localicenseserverport);//对IP地址为"192.168.0.105"的计算机的1500端口提出连接申请 - tcpc.Close(); - return true; - } - catch (Exception ex) - { - MessageBox.Show("端口连接错误!" + ex.Message); - return false; - } - } - else - { - times++; - if (times < count) - { - continue; - } - else - { - MessageBox.Show("重新尝试连接失败"); - return false; - } - } - - } - return false; - } - } /// /// 验证用户名、密码 /// diff --git a/FrmMetadata.cs b/FrmMetadata.cs index 886f65a..0365372 100644 --- a/FrmMetadata.cs +++ b/FrmMetadata.cs @@ -27,11 +27,7 @@ InitializeComponent(); loadTreeView(layerTree); } - private void FrmMetadata_Load(object sender, EventArgs e) - { - //this.ntLblC.Text = "nn"; - // loadTreeView(layerTree); - } + private void loadTreeView(TreeView tv)//构建图层树 { try diff --git a/FrmMetadataStat.cs b/FrmMetadataStat.cs index 790658a..e7696c6 100644 --- a/FrmMetadataStat.cs +++ b/FrmMetadataStat.cs @@ -197,9 +197,5 @@ } } - private void buttonX1_Click(object sender, EventArgs e) - { - drawChart(); - } } } diff --git a/Cyberpipe.csproj b/Cyberpipe.csproj index 07a8c1a..e3cd12c 100644 --- a/Cyberpipe.csproj +++ b/Cyberpipe.csproj @@ -204,25 +204,6 @@ - - Form - - - F_GKT1数据输入输出.cs - - - Form - - - F_GKT1添加文件.cs - - - Form - - - F_GKT1添加项目.cs - - Form @@ -1068,18 +1049,6 @@ Frm_password_reset.cs - - Form - - - GKT.cs - - - Form - - - GKT1.cs - Form @@ -1258,12 +1227,6 @@ F_Projedit.cs - - Form - - - PED.cs - Form @@ -1331,16 +1294,6 @@ True Reference.map - - F_GKT1数据输入输出.cs - Designer - - - F_GKT1添加文件.cs - - - F_GKT1添加项目.cs - Form_EditTask.cs @@ -1836,12 +1789,6 @@ Frm_password_reset.cs - - GKT.cs - - - GKT1.cs - F_GKT数据输入输出.cs @@ -1934,9 +1881,6 @@ F_Projedit.cs - - PED.cs - F_数据输入输出.cs diff --git a/Cyberpipe.suo b/Cyberpipe.suo index 68ced4f..a1aecf8 100644 --- a/Cyberpipe.suo +++ b/Cyberpipe.suo Binary files differ diff --git a/EMS_Forms/Form_EditTask.cs b/EMS_Forms/Form_EditTask.cs index 718992f..f1d791f 100644 --- a/EMS_Forms/Form_EditTask.cs +++ b/EMS_Forms/Form_EditTask.cs @@ -119,7 +119,8 @@ String name = Convert.ToString(dr["USERNAME"]); comboBox_userName.Items.Add(name); - } + } + dr.Close(); comboBox_road.Items.Clear(); roadList = new List(); @@ -135,7 +136,7 @@ comboBox_road.Items.Add(name); } } - + dr1.Close(); conn.Close(); bool flag2 = false; @@ -185,7 +186,7 @@ catch (Exception ex) { - MessageBox.Show(ex.ToString()); + LogHelper.WriteLog(typeof(Form_EditTask), ex.Message); } } @@ -288,7 +289,7 @@ } catch (Exception ex) { - MessageBox.Show(ex.ToString()); + LogHelper.WriteLog(typeof(Form_EditTask), ex.Message); } } @@ -474,7 +475,7 @@ } catch (Exception ex) { - MessageBox.Show(ex.ToString()); + LogHelper.WriteLog(typeof(Form_EditTask), ex.Message); } this.Close(); @@ -495,6 +496,7 @@ { numList.Add(Convert.ToInt32(dr["DBID"])); } + dr.Close(); if (numList.Count == 0) { taskNumber = Convert.ToInt32(number) * 100; @@ -674,6 +676,7 @@ } } } + dr.Close(); conn.Close(); } diff --git a/EMS_Forms/Form_EventManager.cs b/EMS_Forms/Form_EventManager.cs index b18c45b..84807b2 100644 --- a/EMS_Forms/Form_EventManager.cs +++ b/EMS_Forms/Form_EventManager.cs @@ -64,6 +64,7 @@ comboBox_name.Items.Add(name); } + dr.Close(); conn.Close(); diff --git a/Forms/FrmMnModify.cs b/Forms/FrmMnModify.cs index 31cfc5f..d036360 100644 --- a/Forms/FrmMnModify.cs +++ b/Forms/FrmMnModify.cs @@ -68,15 +68,7 @@ questionGrid.Rows[idx].Cells[1].Value = sr.question; } } - /// 选中对象 - /// - /// - /// - /// - private void buttonX1_Click(object sender, EventArgs e) - { - globecontrol.Globe.Action = EnumAction3D.SelectObject; - } + /// /// 选中某一行 /// diff --git a/Forms/FrmPipelineModelDataBase.cs b/Forms/FrmPipelineModelDataBase.cs index 2acf0ca..7ce573f 100644 --- a/Forms/FrmPipelineModelDataBase.cs +++ b/Forms/FrmPipelineModelDataBase.cs @@ -35,19 +35,7 @@ ds = _ds; InitializeComponent(); } - /// - /// 单击选择shp格式文件 - /// - /// - /// - private void btnBrowseModel_Click(object sender, EventArgs e) - { - saveFileDialog1.Filter = "*.lgd|*.lgd"; - if (saveFileDialog1.ShowDialog() == DialogResult.OK) - { - txtModelLayer.Text = saveFileDialog1.FileName; - } - } + /// /// 窗体初始化事件处理 /// @@ -100,49 +88,6 @@ } } } - - private object convertFieldValue(string fieldname, object obj) - { - if (obj == null) - return null; - - try - { - string type = fields_types[fieldname].ToString(); - switch (type) - { - case "string": - return obj.ToString(); - case "int": - //return 101; - int intResult; - if (int.TryParse(obj.ToString(), out intResult)) - return intResult; - else - return null; - case "double": - //return 202.5; - double doubleResult; - if (double.TryParse(obj.ToString(), out doubleResult)) - return doubleResult; - else - return null; - case "date": - DateTime dtResult; - if (DateTime.TryParse(obj.ToString(), out dtResult)) - return dtResult; - else - return null; - } - return null; - } - catch (Exception ex) - { - MessageBox.Show(ex.ToString()); - return null; - } - } - public string lgdFilePath = ""; /// /// 选择管线颜色 @@ -610,33 +555,6 @@ { this.Close(); } - - private void cmbLayer_SelectedIndexChanged(object sender, EventArgs e) //选择图层 - { - GSOLayer layer = ctl.Globe.Layers.GetLayerByCaption(selectLayerName); - GSOFeatures features = layer.GetAllFeatures(); - if (features.Length == 0) - return; - - cmbFrom.Items.Clear(); - cmbTo.Items.Clear(); - cmbRadius.Items.Clear(); - cmbID.Items.Clear(); - for (int i = 0; i < features[0].GetFieldCount(); i++) - { - GeoScene.Data.GSOFieldDefn fielddef = (GeoScene.Data.GSOFieldDefn)(features[0].GetFieldDefn(i)); - - cmbFrom.Items.Add(fielddef.Name); - cmbTo.Items.Add(fielddef.Name); - cmbRadius.Items.Add(fielddef.Name); - cmbID.Items.Add(fielddef.Name); - } - cmbFrom.SelectedItem = "Deep1"; - cmbTo.SelectedItem = "Deep2"; - cmbRadius.SelectedItem = "Diameter"; - cmbID.SelectedItem = "Handle"; - } - private void buttonXLayerPath_Click(object sender, EventArgs e)//单击 选择shp格式的文件 { OpenFileDialog dlg = new OpenFileDialog(); diff --git a/Forms/FrmPipelineModelDataOneStep.cs b/Forms/FrmPipelineModelDataOneStep.cs index 18afda7..ec93b8a 100644 --- a/Forms/FrmPipelineModelDataOneStep.cs +++ b/Forms/FrmPipelineModelDataOneStep.cs @@ -38,19 +38,7 @@ layerTree = _layerTree; InitializeComponent(); } - /// - /// 单击选择shp格式文件 - /// - /// - /// - private void btnBrowseModel_Click(object sender, EventArgs e) - { - saveFileDialog1.Filter = "*.lgd|*.lgd"; - if (saveFileDialog1.ShowDialog() == DialogResult.OK) - { - txtModelLayer.Text = saveFileDialog1.FileName; - } - } + /// /// 窗体初始化事件处理 /// @@ -107,48 +95,7 @@ } } - private object convertFieldValue(string fieldname, object obj) - { - if (obj == null) - return null; - - try - { - string type = fields_types[fieldname].ToString(); - switch (type) - { - case "string": - return obj.ToString(); - case "int": - //return 101; - int intResult; - if (int.TryParse(obj.ToString(), out intResult)) - return intResult; - else - return null; - case "double": - //return 202.5; - double doubleResult; - if (double.TryParse(obj.ToString(), out doubleResult)) - return doubleResult; - else - return null; - case "date": - DateTime dtResult; - if (DateTime.TryParse(obj.ToString(), out dtResult)) - return dtResult; - else - return null; - } - return null; - } - catch (Exception ex) - { - MessageBox.Show(ex.ToString()); - return null; - } - } - + public string lgdFilePath = ""; /// /// 选择管线颜色 @@ -673,32 +620,6 @@ return featDs; } - private void cmbLayer_SelectedIndexChanged(object sender, EventArgs e) //选择图层 - { - GSOLayer layer = ctl.Globe.Layers.GetLayerByCaption(selectLayerName); - GSOFeatures features = layer.GetAllFeatures(); - if (features.Length == 0) - return; - - cmbFrom.Items.Clear(); - cmbTo.Items.Clear(); - cmbRadius.Items.Clear(); - cmbID.Items.Clear(); - for (int i = 0; i < features[0].GetFieldCount(); i++) - { - GeoScene.Data.GSOFieldDefn fielddef = (GeoScene.Data.GSOFieldDefn)(features[0].GetFieldDefn(i)); - - cmbFrom.Items.Add(fielddef.Name); - cmbTo.Items.Add(fielddef.Name); - cmbRadius.Items.Add(fielddef.Name); - cmbID.Items.Add(fielddef.Name); - } - cmbFrom.SelectedItem = "Deep1"; - cmbTo.SelectedItem = "Deep2"; - cmbRadius.SelectedItem = "Diameter"; - cmbID.SelectedItem = "Handle"; - } - private void buttonXLayerPath_Click(object sender, EventArgs e)//单击 选择shp格式的文件 { OpenFileDialog dlg = new OpenFileDialog(); @@ -949,38 +870,6 @@ } //txtLayername.Text = type + layername; } - /// - /// 连接数据库 - /// - /// - /// - private void buttonX1_Click(object sender, EventArgs e) - { - if (ds == null) - { - //没连的话,直接连接审核库; //审核库配置读配置文件 - string dbIp = Utility.sgdbip; - string database = Utility.sgdbname; - string user = Utility.sgdbuser; - string pass = Utility.sgdbpwd; - - if (!Utility.isNetworkConnectionSuccess(dbIp.Trim())) - { - MessageBox.Show("网络连接失败!", "提示"); - return; - } - - ds = ctl.Globe.DataManager.OpenOracleDataSource(dbIp + "/" + database, "", "", user, pass); - if (ds == null) - { - MessageBox.Show("数据库连接失败!", "提示", MessageBoxButtons.OK, MessageBoxIcon.Warning); - } - else - { - btnCreateModel.Enabled = true; - } - } - } private void btnClose_Click(object sender, EventArgs e) { diff --git a/Forms/FrmShRK.cs b/Forms/FrmShRK.cs index 0e2e722..f1d83cb 100644 --- a/Forms/FrmShRK.cs +++ b/Forms/FrmShRK.cs @@ -215,6 +215,7 @@ { sourcefeatds = sourcefeat as GSOFeatureDataset; } + if (sourcefeatds == null) return; sourcefeatds.Open(); GSOFeatures sourcefeatures = sourcefeatds.GetAllFeatures(); @@ -251,6 +252,7 @@ { desfeatds = desfeat as GSOFeatureDataset; } + if (desfeatds == null) return; desfeatds.Open(); //向新数据集写入字段 diff --git a/FrmAccessoriesSensor.cs b/FrmAccessoriesSensor.cs index 09fcdf1..2a7a80e 100644 --- a/FrmAccessoriesSensor.cs +++ b/FrmAccessoriesSensor.cs @@ -209,7 +209,7 @@ chart1.Series[0].Points.DataBindXY(dic.Keys, dic.Values); for (int m = 0; m < dic.Values.Count; m++) { - if (chart1.Series[0].Points[m].YValues[0].ToString() != "0") + if (chart1.Series[0].Points[m]!=null&&chart1.Series[0].Points[m].YValues[0].ToString() != "0") { chart1.Series[0].Points[m].Label = chart1.Series[0].Points[m].YValues[0].ToString(); } diff --git a/FrmAccessoriesgather.cs b/FrmAccessoriesgather.cs index 9e331e1..a475d9e 100644 --- a/FrmAccessoriesgather.cs +++ b/FrmAccessoriesgather.cs @@ -338,7 +338,7 @@ chart1.Series[0].Points.DataBindXY(dic.Keys, dic.Values); for (int m = 0; m < dic.Values.Count; m++) { - if (chart1.Series[0].Points[m].YValues[0].ToString() != "0") + if (chart1.Series[0].Points[m]!=null&&chart1.Series[0].Points[m].YValues[0].ToString() != "0") { chart1.Series[0].Points[m].Label = chart1.Series[0].Points[m].YValues[0].ToString(); } diff --git a/FrmAccessoryAnalysis.cs b/FrmAccessoryAnalysis.cs index 71d4579..44d4065 100644 --- a/FrmAccessoryAnalysis.cs +++ b/FrmAccessoryAnalysis.cs @@ -66,39 +66,6 @@ globeControl1.Refresh(); } /// - /// 键盘按键按下事件处理 - /// - /// - /// - private void txtRadius_KeyPress(object sender, KeyPressEventArgs e) - { - TextBox text = sender as TextBox; - if ((e.KeyChar < 48 || e.KeyChar > 57) && (e.KeyChar != 8) && (int)e.KeyChar != 46) - { - e.Handled = true; - } - if ((int)e.KeyChar == 46) //小数点 - { - if (text.Text.Length <= 0) - e.Handled = true; //小数点不能在第一位 - else //处理不规则的小数点 - { - float f; - float oldf; - bool b1 = false, b2 = false; - b1 = float.TryParse(text.Text, out oldf); - b2 = float.TryParse(text.Text + e.KeyChar.ToString(), out f); - if (b2 == false) - { - if (b1 == true) - e.Handled = true; - else - e.Handled = false; - } - } - } - } - /// /// 确定按钮事件处理 /// /// diff --git a/FrmAddValve.cs b/FrmAddValve.cs index 34d2fec..5f405b9 100644 --- a/FrmAddValve.cs +++ b/FrmAddValve.cs @@ -486,56 +486,6 @@ } } - - - - - - - - private void cmbLayer_SelectedIndexChanged(object sender, EventArgs e) - { - GSOLayer layer = globeControl1.Globe.Layers.GetLayerByCaption(selectLayerName); - GSOFeatures features = layer.GetAllFeatures(); - if (features.Length == 0) - return; - - combPath.Items.Clear(); - combZ.Items.Clear(); - combModelName.Items.Clear(); - - for (int i = 0; i < features[0].GetFieldCount(); i++) - { - GeoScene.Data.GSOFieldDefn fielddef = (GeoScene.Data.GSOFieldDefn)(features[0].GetFieldDefn(i)); - combPath.Items.Add(fielddef.Name); - combZ.Items.Add(fielddef.Name); - combModelName.Items.Add(fielddef.Name); - } - combModelName.SelectedItem = "编号"; - combPath.SelectedItem = "模型路径"; - if (combfile.SelectedIndex != -1) - { - - string layerCaption = combfile.SelectedItem.ToString().Trim(); - rukuLayer = globeControl1.Globe.Layers.GetLayerByCaption(layerCaption); - if (rukuLayer != null) - { - combPath.Items.Clear(); - combZ.Items.Clear(); - combModelName.Items.Clear(); - - } - for (int i = 0; i < features[0].GetFieldCount(); i++) - { - GeoScene.Data.GSOFieldDefn fielddef = (GeoScene.Data.GSOFieldDefn)(features[0].GetFieldDefn(i)); - combPath.Items.Add(fielddef.Name); - combZ.Items.Add(fielddef.Name); - combModelName.Items.Add(fielddef.Name); - } - combModelName.SelectedItem = "编号"; - combPath.SelectedItem = "模型路径"; - } - } /// /// 单击选择shp格式文件 /// diff --git a/FrmAddWellShp.cs b/FrmAddWellShp.cs index bb79ec0..a249725 100644 --- a/FrmAddWellShp.cs +++ b/FrmAddWellShp.cs @@ -478,32 +478,6 @@ } } } - - private void cmbLayer_SelectedIndexChanged(object sender, EventArgs e) - { - GSOLayer layer = globeControl1.Globe.Layers.GetLayerByCaption(selectLayerName); - GSOFeatures features = layer.GetAllFeatures(); - if (features.Length == 0) - return; - - combCode.Items.Clear(); - combDeep.Items.Clear(); - combModelName.Items.Clear(); - combAngle.Items.Clear(); - - for (int i = 0; i < features[0].GetFieldCount(); i++) - { - GeoScene.Data.GSOFieldDefn fielddef = (GeoScene.Data.GSOFieldDefn)(features[0].GetFieldDefn(i)); - combCode.Items.Add(fielddef.Name); - combDeep.Items.Add(fielddef.Name); - combModelName.Items.Add(fielddef.Name); - combAngle.Items.Add(fielddef.Name); - } - combCode.SelectedItem = "附属物编码"; - combDeep.SelectedItem = "井深"; - combModelName.SelectedItem = "编号"; - combAngle.SelectedItem = "符号角度"; - } /// /// 单击选择shp格式文件 /// diff --git a/FrmAddYuBiZiShp.cs b/FrmAddYuBiZiShp.cs index b312d51..332f037 100644 --- a/FrmAddYuBiZiShp.cs +++ b/FrmAddYuBiZiShp.cs @@ -383,80 +383,7 @@ } } - private void cmbLayer_SelectedIndexChanged(object sender, EventArgs e) - { - GSOLayer layer = globeControl1.Globe.Layers.GetLayerByCaption(selectLayerName); - GSOFeatures features = layer.GetAllFeatures(); - if (features.Length == 0) - return; - - combCode.Items.Clear(); - combDeep.Items.Clear(); - combModelName.Items.Clear(); - //comboLoad.Items.Clear(); - for (int i = 0; i < features[0].GetFieldCount(); i++) - { - GeoScene.Data.GSOFieldDefn fielddef = (GeoScene.Data.GSOFieldDefn)(features[0].GetFieldDefn(i)); - combCode.Items.Add(fielddef.Name); - combDeep.Items.Add(fielddef.Name); - combModelName.Items.Add(fielddef.Name); - //comboLoad.Items.Add(fielddef.Name); - } - combCode.SelectedItem = "附属物编码"; - combDeep.SelectedItem = "Z坐标"; - combModelName.SelectedItem = "编号"; - //comboLoad.SelectedItem = "模型路径"; - } - - private void buttonXLayerPath_Click(object sender, EventArgs e) - { - OpenFileDialog dlg = new OpenFileDialog(); - dlg.Filter = "*.shp|*.shp"; - dlg.Multiselect = false; - if (dlg.ShowDialog() == DialogResult.OK) - { - GSOLayer layer = globeControl1.Globe.Layers.Add(dlg.FileName); - string txtMessage = valiYBdata(layer); - if (txtMessage != "") - { - button3.Enabled = false; - //textBoxLayer.Text = ""; - combCode.Items.Clear(); - combDeep.Items.Clear(); - combModelName.Items.Clear(); - globeControl1.Globe.Layers.Remove(layer); - FrmValiDataShowErrorMessage showErrorMessage = new FrmValiDataShowErrorMessage(dlg.FileName, txtMessage); - showErrorMessage.ShowDialog(); - return; - } - else - { - button3.Enabled = true; - //textBoxLayer.Text = dlg.FileName; - selectLayerName = layer.Caption; - txtLayerName.Text = layer.Caption; - GSOFeatures features = layer.GetAllFeatures(); - if (features.Length == 0) - return; - - combCode.Items.Clear(); - combDeep.Items.Clear(); - combModelName.Items.Clear(); - for (int i = 0; i < features[0].GetFieldCount(); i++) - { - GeoScene.Data.GSOFieldDefn fielddef = (GeoScene.Data.GSOFieldDefn)(features[0].GetFieldDefn(i)); - combCode.Items.Add(fielddef.Name); - combDeep.Items.Add(fielddef.Name); - combModelName.Items.Add(fielddef.Name); - //comboLoad.Items.Add(fielddef.Name); - } - combCode.SelectedItem = "管点编码"; - combDeep.SelectedItem = "Z坐标"; - combModelName.SelectedItem = "编号"; - } - } - } - + private void FrmAddYuBiZiShp_FormClosing(object sender, FormClosingEventArgs e) { globeControl1.Globe.Refresh(); diff --git a/FrmAllPipelineStatis.cs b/FrmAllPipelineStatis.cs index 6421a26..a6eea29 100644 --- a/FrmAllPipelineStatis.cs +++ b/FrmAllPipelineStatis.cs @@ -84,7 +84,7 @@ chartAllAreaPipeline.Series["管线"].Points.DataBindXY(pipelineLengthAndType.Keys, pipelineLengthAndType.Values); for (int m = 0; m < pipelineLengthAndType.Values.Count; m++) { - if (chartAllAreaPipeline.Series["管线"].Points[m].YValues[0].ToString() != "0") + if (chartAllAreaPipeline.Series["管线"].Points[m]!=null&&chartAllAreaPipeline.Series["管线"].Points[m].YValues[0].ToString() != "0") { chartAllAreaPipeline.Series["管线"].Points[m].Label = chartAllAreaPipeline.Series[0].Points[m].YValues[0].ToString(); } @@ -94,7 +94,7 @@ } catch (Exception ex) { - //LogError.PublishError(ex); + LogHelper.WriteLog(typeof(FrmAllPipelineStatis), ex.Message); } } @@ -147,7 +147,7 @@ } DataTable dt = OledbHelper.QueryTable(sql); - if (dt != null && dt.Rows.Count > 0) + if (dt != null && dt.Rows.Count > 0 && chartAllAreaPipeline.Series["管线"].Points[indexHit]!=null) { dataGridViewX1.DataSource = dt; panel.Visible = true; diff --git a/FrmAllWorkWellStatis.cs b/FrmAllWorkWellStatis.cs index 6fec7af..6af8e4c 100644 --- a/FrmAllWorkWellStatis.cs +++ b/FrmAllWorkWellStatis.cs @@ -52,7 +52,7 @@ chartAllAreaPipeline.Series["井盖"].Points.DataBindXY(workWellLengthAndType.Keys, workWellLengthAndType.Values); for (int m = 0; m < workWellLengthAndType.Values.Count; m++) { - if (chartAllAreaPipeline.Series["井盖"].Points[m].YValues[0].ToString().Trim() != "0") + if (chartAllAreaPipeline.Series["井盖"].Points[m]!=null&&chartAllAreaPipeline.Series["井盖"].Points[m].YValues[0].ToString().Trim() != "0") { chartAllAreaPipeline.Series["井盖"].Points[m].Label = chartAllAreaPipeline.Series[0].Points[m].YValues[0].ToString(); } @@ -60,7 +60,7 @@ } catch (Exception ex) { - //LogError.PublishError(ex); + LogHelper.WriteLog(typeof(FrmAllWorkWellStatis), ex.Message); } } diff --git a/FrmBSQDuoBianXingStatis.cs b/FrmBSQDuoBianXingStatis.cs index e8b7d52..3e889b6 100644 --- a/FrmBSQDuoBianXingStatis.cs +++ b/FrmBSQDuoBianXingStatis.cs @@ -60,7 +60,7 @@ { for (int m = 0; m < bsq1.Values.Count; m++) { - if (chart1.Series["标识器"].Points[m].YValues[0].ToString() != "0") + if (chart1.Series["标识器"].Points[m]!=null&&chart1.Series["标识器"].Points[m].YValues[0].ToString() != "0") { count += Convert.ToInt16(chart1.Series[0].Points[m].YValues[0].ToString()); chart1.Series["标识器"].Points[m].Label = chart1.Series[0].Points[m].YValues[0].ToString(); diff --git a/FrmBSQDuoBianXingStreet.cs b/FrmBSQDuoBianXingStreet.cs index 2005ebb..1db5777 100644 --- a/FrmBSQDuoBianXingStreet.cs +++ b/FrmBSQDuoBianXingStreet.cs @@ -63,7 +63,7 @@ chartStatis.Series[0].Points.DataBindXY(bsq.Keys, bsq.Values); for (int m = 0; m < bsq.Values.Count; m++) { - if (chartStatis.Series[0].Points[m].YValues[0].ToString().Trim() != "0") + if (chartStatis.Series[0].Points[m]!=null&&chartStatis.Series[0].Points[m].YValues[0].ToString().Trim() != "0") { count += Convert.ToInt16(chartStatis.Series[0].Points[m].YValues[0].ToString()); chartStatis.Series[0].Points[m].Label = chartStatis.Series[0].Points[m].YValues[0].ToString(); diff --git a/FrmBSQStatis.cs b/FrmBSQStatis.cs index 390a55c..4aa0ee6 100644 --- a/FrmBSQStatis.cs +++ b/FrmBSQStatis.cs @@ -95,6 +95,8 @@ } } } + + dr.Close(); conn.Close(); for (int i = 0; i < typeLists.Count; i++) { @@ -123,7 +125,7 @@ chartStatis.Series[0].Points.DataBindXY(bsq.Keys, bsq.Values); for (int m = 0; m < bsq.Values.Count; m++) { - if (chartStatis.Series[0].Points[m].YValues[0].ToString().Trim() != "0") + if (chartStatis.Series[0].Points[m]!=null&&chartStatis.Series[0].Points[m].YValues[0].ToString().Trim() != "0") { //count += Convert.ToInt16(chartStatis.Series[0].Points[m].YValues[0].ToString()); chartStatis.Series[0].Points[m].Label = chartStatis.Series[0].Points[m].YValues[0].ToString(); diff --git a/FrmBSQStreet.cs b/FrmBSQStreet.cs index 9d88adb..7fbacad 100644 --- a/FrmBSQStreet.cs +++ b/FrmBSQStreet.cs @@ -44,7 +44,7 @@ chartStatis.Series[0].Points.DataBindXY(bsq.Keys, bsq.Values); for (int m = 0; m < bsq.Values.Count; m++) { - if (chartStatis.Series[0].Points[m].YValues[0].ToString().Trim() != "0") + if (chartStatis.Series[0].Points[m]!=null&&chartStatis.Series[0].Points[m].YValues[0].ToString().Trim() != "0") { count += Convert.ToInt16(chartStatis.Series[0].Points[m].YValues[0].ToString()); chartStatis.Series[0].Points[m].Label = chartStatis.Series[0].Points[m].YValues[0].ToString(); diff --git a/FrmBoosterValvers.cs b/FrmBoosterValvers.cs index 5061efc..df9b62b 100644 --- a/FrmBoosterValvers.cs +++ b/FrmBoosterValvers.cs @@ -236,199 +236,6 @@ count = 0; } } - /// - /// 添加火苗 - /// - /// - /// - /// - /// - private GSOFeature AddFire(double x,double y,double z) - { - // 烟火示例 - - string strResPath = Application.StartupPath + "/Resource"; - - // 烟火粒子示例,由三个发射器构成 - GSOGeoParticle geoParticle = new GSOGeoParticle(); - geoParticle.SetPosition(x, y, z); // 添加到这个经纬度位置 - geoParticle.AltitudeMode = EnumAltitudeMode.RelativeToGround; - - GSORingParticleEmitter emitter = new GSORingParticleEmitter(); - emitter.TexturePath = strResPath + "/ParticleImage/flare.png"; - - emitter.SetSizeFix(1, 1); - emitter.VelFix = 1; - emitter.VelRnd = 5; - - emitter.AngleXYFix = 0; - emitter.AngleXYRnd = 180; - - emitter.AngleXZFix = 90; - emitter.AngleXZRnd = 0; - - emitter.LifeFix = 0.5f; - emitter.LifeRnd = 0.0f; - - emitter.RotFix = 0; - emitter.RotRnd = 0; - - emitter.RotVelFix = 0; - emitter.RotVelRnd = 0; - - emitter.EmitPerSec = 100; - - // 采用线性插值生成粒子的初始颜色 - emitter.ColorRndStart = Color.White; - emitter.ColorRndEnd = Color.Red; - - - GSOColorParticleEffector effector2 = new GSOColorParticleEffector(); - effector2.SetColorChanged(0, -1, -1, 0); - effector2.StartTime = 0.0f; - effector2.EndTime = -1.0f; - emitter.AddEffector(effector2); - - // 将三个发射器添加到粒子对象中 - geoParticle.AddEmitter(emitter); - - geoParticle.Play(); - - GSOFeature feature = new GSOFeature(); - - feature.Geometry = geoParticle; - - globeControl1.Globe.MemoryLayer.AddFeature(feature); - - - return feature; - } - - /// - /// 添加喷泉 - /// - /// - private GSOFeature AddFountain() - { - string strResPath = Application.StartupPath + "/Resource"; - - GSOGeoParticle geoParticle = new GSOGeoParticle(); - geoParticle.SetPosition(116.314, 39.84, 0); // 添加到这个经纬度位置 - - GSOPointParticleEmitter emitter = new GSOPointParticleEmitter(); - emitter.TexturePath = strResPath + "/ParticleImage/test.png"; - - emitter.SetSizeFix(0.5f, 2); - emitter.VelFix = 10; - emitter.VelRnd = 2; - - emitter.GravityAcc = 9.8f; - emitter.AngleXYFix = 0; - emitter.AngleXYRnd = 180; - - emitter.AngleXZFix = 88; - emitter.AngleXZRnd = 2; - - //emitter.InnerRadius = 0; - // emitter.OuterRadius = 0.03f; - - emitter.LifeFix = 5.0f; - emitter.LifeRnd = 1.0f; - - emitter.RotFix = 0; - emitter.RotRnd = 0; - - emitter.RotVelFix = 0; - emitter.RotVelRnd = 0; - - emitter.EmitPerSec = 1000; - emitter.ColorRndStart = Color.FromArgb(33, 255, 255, 255); - emitter.ColorRndEnd = Color.FromArgb(11, 255, 255, 255); - emitter.IsLumAdded = false; - - // 将三个发射器添加到粒子对象中 - geoParticle.AddEmitter(emitter); - - geoParticle.Play(); - GSOFeature feature = new GSOFeature(); - - feature.Geometry = geoParticle; - - //globeControl1.Globe.MemoryLayer.AddFeature(feature); - globeControl1.Globe.FlyToFeature(feature); - - return feature; - } - - /// - /// 添加水柱 - /// - /// - private GSOFeature AddWaterLine() - { - string strResPath = Application.StartupPath + "/Resource"; - - GSOGeoParticle geoParticle = new GSOGeoParticle(); - geoParticle.SetPosition(116.308, 39.84, 0); // 添加到这个经纬度位置 - - GSOPointParticleEmitter emitter = new GSOPointParticleEmitter(); - - emitter.TexturePath = strResPath + "/ParticleImage/drop3.png"; - - geoParticle.TimerInterval = 1; - - emitter.SetSizeFix(2.0f, 2.0f); - - emitter.VelFix = 50; - emitter.VelRnd = 2; - - // emitter.IsLumAdded = false; - - emitter.GravityAcc = 9.8f; - emitter.AngleXYFix = 0; - emitter.AngleXYRnd = 2; - - emitter.AngleXZFix = 60; - emitter.AngleXZRnd = 2; - - //emitter.InnerRadius = 0; - // emitter.OuterRadius = 0.1f; - - emitter.LifeFix = 5.0f; - emitter.LifeRnd = 1.0f; - - emitter.RotFix = 0; - emitter.RotRnd = 0; - - emitter.RotVelFix = 0; - emitter.RotVelRnd = 0; - - emitter.EmitPerSec = 1500; - - emitter.ColorRndStart = Color.FromArgb(100, 222, 222, 222); - emitter.ColorRndEnd = Color.FromArgb(50, 222, 222, 222); - - /* - - GSOScaleParticleEffector effector1 = new GSOScaleParticleEffector(); - effector1.SetScale(0.2f, 0.2f); - effector1.StartTime = 0; - effector1.EndTime = -1; // 负数表示整个粒子生命结束 - emitter.AddEffector(effector1); - */ - - // 将三个发射器添加到粒子对象中 - geoParticle.AddEmitter(emitter); - - geoParticle.Play(); - GSOFeature feature = new GSOFeature(); - - feature.Geometry = geoParticle; - - //globeControl1.Globe.MemoryLayer.AddFeature(feature); - globeControl1.Globe.FlyToFeature(feature); - - return feature; - } + } } diff --git a/FrmBufferAnalysis.cs b/FrmBufferAnalysis.cs index f711133..db8ca59 100644 --- a/FrmBufferAnalysis.cs +++ b/FrmBufferAnalysis.cs @@ -123,39 +123,6 @@ } } /// - /// 半径文本框的键盘按键按下事件处理 - /// - /// - /// - private void txtRadius_KeyPress(object sender, KeyPressEventArgs e) - { - TextBox text = sender as TextBox; - if ((e.KeyChar < 48 || e.KeyChar > 57) && (e.KeyChar != 8) && (int)e.KeyChar != 46) - { - e.Handled = true; - } - if ((int)e.KeyChar == 46) //小数点 - { - if (text.Text.Length <= 0) - e.Handled = true; //小数点不能在第一位 - else //处理不规则的小数点 - { - float f; - float oldf; - bool b1 = false, b2 = false; - b1 = float.TryParse(text.Text, out oldf); - b2 = float.TryParse(text.Text + e.KeyChar.ToString(), out f); - if (b2 == false) - { - if (b1 == true) - e.Handled = true; - else - e.Handled = false; - } - } - } - } - /// /// 窗体关闭事件处理 /// /// diff --git a/FrmBufferAnalysisBSQ.cs b/FrmBufferAnalysisBSQ.cs index 24a96ca..f54208f 100644 --- a/FrmBufferAnalysisBSQ.cs +++ b/FrmBufferAnalysisBSQ.cs @@ -137,35 +137,7 @@ } } - private void txtRadius_KeyPress(object sender, KeyPressEventArgs e) - { - TextBox text = sender as TextBox; - if ((e.KeyChar < 48 || e.KeyChar > 57) && (e.KeyChar != 8) && (int)e.KeyChar != 46) - { - e.Handled = true; - } - if ((int)e.KeyChar == 46) //小数点 - { - if (text.Text.Length <= 0) - e.Handled = true; //小数点不能在第一位 - else //处理不规则的小数点 - { - float f; - float oldf; - bool b1 = false, b2 = false; - b1 = float.TryParse(text.Text, out oldf); - b2 = float.TryParse(text.Text + e.KeyChar.ToString(), out f); - if (b2 == false) - { - if (b1 == true) - e.Handled = true; - else - e.Handled = false; - } - } - } - } - + private void FrmBufferAnalysis_FormClosing(object sender, FormClosingEventArgs e) { //Form1.y = 0; @@ -316,27 +288,6 @@ } } - private void FlyToMenu_Click(object sender, EventArgs e) - { - if (m_feature != null) - { - if (m_feature.Geometry != null && m_feature.Geometry.Type == EnumGeometryType.GeoPolyline3D) - { - GSOGeoPolyline3D line = m_feature.Geometry as GSOGeoPolyline3D; - double length = line.GetSpaceLength(true, 6378137); - GSOGeoPolyline3D lineLine = line.GetSegment(0, length / 2); - GSOPoint3d point3d = lineLine[lineLine.PartCount - 1][lineLine[lineLine.PartCount - 1].Count - 1]; - - globeControl1.Globe.FlyToPosition(point3d, EnumAltitudeMode.Absolute, 0, 45, 5); - } - else - { - globeControl1.Globe.FlyToFeature(m_feature, 0, 45, 3); - } - LightMenu_Click(sender, e); - } - } - private void LightMenu_Click(object sender, EventArgs e) { flashflag = "single"; diff --git a/FrmDataBaseOpt.cs b/FrmDataBaseOpt.cs index b0c4b5d..8d7b69d 100644 --- a/FrmDataBaseOpt.cs +++ b/FrmDataBaseOpt.cs @@ -362,6 +362,7 @@ dbCombor.Items.Add(dblist[i].title); } } + /* /// /// 从配置文件读取数据库参数配置 /// @@ -428,6 +429,8 @@ } } + * */ + /* /// /// 向配置文件写入连接数据库的参数配置 /// @@ -485,6 +488,7 @@ MessageBox.Show(exp.ToString()); } } + * */ /// /// /// diff --git a/FrmDatabaseParaSetting.cs b/FrmDatabaseParaSetting.cs index a6fea46..63b596b 100644 --- a/FrmDatabaseParaSetting.cs +++ b/FrmDatabaseParaSetting.cs @@ -152,6 +152,7 @@ this.DialogResult = DialogResult.OK; this.Close(); } + /* /// /// 从配置文件读取数据库连接参数配置 /// @@ -218,6 +219,8 @@ } } + * */ + /* /// /// 向配置文件写入数据库参数配置 /// @@ -276,7 +279,7 @@ MessageBox.Show(ex.ToString()); } } - + */ /// /// 取消按钮事件处理 /// diff --git a/FrmDatabaseParaSetting2.cs b/FrmDatabaseParaSetting2.cs index 932d05e..96a87d5 100644 --- a/FrmDatabaseParaSetting2.cs +++ b/FrmDatabaseParaSetting2.cs @@ -148,6 +148,7 @@ this.DialogResult = DialogResult.OK; this.Close(); } + /* /// /// 从配置文件读取数据库连接参数配置 /// @@ -214,6 +215,8 @@ } } + * */ + /* /// /// 向配置文件写入数据库参数配置 /// @@ -272,7 +275,7 @@ MessageBox.Show(exp.ToString()); } } - + */ /// /// 取消按钮事件处理 /// diff --git a/FrmDiameterQuery.cs b/FrmDiameterQuery.cs index 68c948b..9a5215b 100644 --- a/FrmDiameterQuery.cs +++ b/FrmDiameterQuery.cs @@ -77,18 +77,7 @@ isBetween = true; } } - /// - /// 键盘按键按下事件处理 - /// - /// - /// - private void textBoxX1_KeyPress(object sender, KeyPressEventArgs e) - { - if ((e.KeyChar < 48 || e.KeyChar > 57) && e.KeyChar != 8) - { - e.Handled = true;//屏蔽 - } - } + bool isBetween = false; /// diff --git a/FrmDocumentEdit.cs b/FrmDocumentEdit.cs index aab2d31..e78a7ff 100644 --- a/FrmDocumentEdit.cs +++ b/FrmDocumentEdit.cs @@ -256,121 +256,6 @@ } - // - /// 将本地文件上传到指定的服务器(HttpWebRequest方法) - /// - /// 文件上传到的服务器 - /// 要上传的本地文件(全路径) - /// 文件上传后的名称 - /// 上传进度条 - /// 成功返回1,失败返回0 - private int Upload_Request(string address, string fileNamePath, string saveName, ProgressBar progressBar) - { - int returnValue = 0; - // 要上传的文件 - FileStream fs = new FileStream(fileNamePath, FileMode.Open, FileAccess.Read); - BinaryReader r = new BinaryReader(fs); - //时间戳 - string strBoundary = "----------" + DateTime.Now.Ticks.ToString("x"); - byte[] boundaryBytes = Encoding.ASCII.GetBytes("/r/n--" + strBoundary + "/r/n"); - //请求头部信息 - StringBuilder sb = new StringBuilder(); - sb.Append("--"); - sb.Append(strBoundary); - sb.Append("\r\n"); - sb.Append("Content-Disposition: form-data; name=\""); - sb.Append("file"); - sb.Append("\"; filename=\""); - sb.Append(saveName); - sb.Append("\""); - sb.Append("\r\n"); - sb.Append("Content-Type: "); - sb.Append("application/octet-stream"); - sb.Append("\r\n"); - sb.Append("\r\n"); - string strPostHeader = sb.ToString(); - byte[] postHeaderBytes = Encoding.UTF8.GetBytes(strPostHeader); - // 根据uri创建HttpWebRequest对象 - HttpWebRequest httpReq = (HttpWebRequest)WebRequest.Create(new Uri(address)); - httpReq.Method = "POST"; - //对发送的数据不使用缓存 - httpReq.AllowWriteStreamBuffering = false; - //设置获得响应的超时时间(300秒) - httpReq.Timeout = 300000; - httpReq.ContentType = "multipart/form-data; boundary=" + strBoundary; - long length = fs.Length + postHeaderBytes.Length + boundaryBytes.Length; - long fileLength = fs.Length; - httpReq.ContentLength = length; - try - { - progressBar.Maximum = int.MaxValue; - progressBar.Minimum = 0; - progressBar.Value = 0; - //每次上传4k - int bufferLength = 4096; - byte[] buffer = new byte[bufferLength]; - //已上传的字节数 - long offset = 0; - //开始上传时间 - DateTime startTime = DateTime.Now; - int size = r.Read(buffer, 0, bufferLength); - Stream postStream = httpReq.GetRequestStream(); - //发送请求头部消息 - postStream.Write(postHeaderBytes, 0, postHeaderBytes.Length); - while (size > 0) - { - postStream.Write(buffer, 0, size); - offset += size; - progressBar.Value = (int)(offset * (int.MaxValue / length)); - TimeSpan span = DateTime.Now - startTime; - double second = span.TotalSeconds; - //lblTime.Text = "已用时:" + second.ToString("F2") + "秒"; - //if (second > 0.001) - //{ - // lblSpeed.Text = " 平均速度:" + (offset / 1024 / second).ToString("0.00") + "KB/秒"; - //} - //else - //{ - // lblSpeed.Text = " 正在连接…"; - //} - //lblState.Text = "已上传:" + (offset * 100.0 / length).ToString("F2") + "%"; - //lblSize.Text = (offset / 1048576.0).ToString("F2") + "M/" + (fileLength / 1048576.0).ToString("F2") + "M"; - Application.DoEvents(); - size = r.Read(buffer, 0, bufferLength); - } - //添加尾部的时间戳 - postStream.Write(boundaryBytes, 0, boundaryBytes.Length); - postStream.Close(); - //获取服务器端的响应 - WebResponse webRespon = httpReq.GetResponse(); - Stream s = webRespon.GetResponseStream(); - StreamReader sr = new StreamReader(s); - //读取服务器端返回的消息 - String sReturnString = sr.ReadLine(); - s.Close(); - sr.Close(); - if (sReturnString == "Success") - { - returnValue = 1; - } - else if (sReturnString == "Error") - { - returnValue = 0; - } - } - catch(Exception ex) - { - returnValue = 0; - string str = ex.ToString(); - } - finally - { - fs.Close(); - r.Close(); - } - return returnValue; - } - private void btn_file_Click(object sender, EventArgs e) { OpenFileDialog dlg = new OpenFileDialog(); diff --git a/FrmExportCADS.cs b/FrmExportCADS.cs index 98772ea..59629dd 100644 --- a/FrmExportCADS.cs +++ b/FrmExportCADS.cs @@ -108,65 +108,6 @@ MessageBox.Show("请选中要导出的图层!", "提示", MessageBoxButtons.OK, MessageBoxIcon.Warning); } } - private Boolean MerageToFile(GSOFeatures features, String strDestFile, String strProj4)//图层追加 - { - if (features == null) - { - return false; - } - Boolean bSuccess = false; - - string strDir = GSOUtility.GetFileDir(strDestFile); - string strLPRJFile = GSOUtility.ChangeExt(strDestFile, ".lprj"); - string strExt = GSOUtility.GetFileExt(strDestFile); - - // 如果投影文件存在,投影以投影文件为准 - if (File.Exists(strLPRJFile)) - { - // 如果是dxf,则这样处理 - if (strExt.ToLower() == ".dxf") - { - string strTempSrcFile = strDir + "srcFeatures_dxftmp" + strExt; - globeControl1.Globe.DataManager.SaveFeatureData(features, strTempSrcFile, strLPRJFile, 4); - bSuccess = GSOUtility.MergeTwoDXFFileFeatures(strDestFile, strTempSrcFile); - File.Delete(strTempSrcFile); - } - else - { - GSOFeatures srcFeatures = globeControl1.Globe.DataManager.ReadFeatureData(strDestFile); - int nCount = features.Length; - int i = 0; - for (i = 0; i < nCount; i++) - { - srcFeatures.Add(features[i]); - } - bSuccess = globeControl1.Globe.DataManager.SaveFeatureData(srcFeatures, strDestFile, strLPRJFile, 4); - } - } - else - { - // 如果是dxf,则这样处理 - if (strExt.ToLower() == ".dxf") - { - string strTempSrcFile = strDir + "srcFeatures_dxftmp" + strExt; - globeControl1.Globe.DataManager.SaveFeatureData(features, strTempSrcFile, strProj4, 0); - bSuccess = GSOUtility.MergeTwoDXFFileFeatures(strDestFile, strTempSrcFile); - File.Delete(strTempSrcFile); - } - else - { - GSOFeatures srcFeatures = globeControl1.Globe.DataManager.ReadFeatureData(strDestFile); - int nCount = features.Length; - int i = 0; - for (i = 0; i < nCount; i++) - { - srcFeatures.Add(features[i]); - } - bSuccess = globeControl1.Globe.DataManager.SaveFeatureData(srcFeatures, strDestFile, strProj4, 0); - } - } - return bSuccess; - } /// /// 关闭按钮事件处理 /// diff --git a/FrmHDMAnalysis3.cs b/FrmHDMAnalysis3.cs index 4f73af6..2ada735 100644 --- a/FrmHDMAnalysis3.cs +++ b/FrmHDMAnalysis3.cs @@ -436,29 +436,6 @@ } layerTemp.RemoveAllFeature(); } - private void Export(GSOPoint3d _pnt, double r) - { - GSOPoint3ds pnts = new GSOPoint3ds(); - GSOPoint3d pnt = new GSOPoint3d(); - pnt.X = _pnt.X; - pnt.Y = _pnt.Y; - pnt.Z = _pnt.Z; - pnts.Add(pnt); - pnt.X = _pnt.X; - pnt.Y = _pnt.Y - 0.0000000005; - pnt.Z = _pnt.Z; - pnts.Add(pnt); - GSOGeoPolyline3D line = new GSOGeoPolyline3D(); - line.AddPart(pnts); - GSOGeoPolygon3D polygon = line.CreateBuffer(r * 2, true, 5, true, false); - GSOPoint3ds points = polygon[0]; - GSOGeoPolyline3D newLine = new GSOGeoPolyline3D(); - newLine.AddPart(points); - newLine.AltitudeMode = EnumAltitudeMode.RelativeToGround; - GSOFeature newFeature = new GSOFeature(); - newFeature.Geometry = newLine; - globeControl1.Globe.MemoryLayer.AddFeature(newFeature); - } private void ExportCAD(double a, double b, double r) { diff --git a/FrmHotFuncStat.cs b/FrmHotFuncStat.cs index c980f34..2eb1476 100644 --- a/FrmHotFuncStat.cs +++ b/FrmHotFuncStat.cs @@ -421,13 +421,6 @@ } } - private void HFS_Pderive_Click(object sender, EventArgs e) - { - if (TV_Files.SelectedNode != null) - { - HFSClass.GuideEdit_form("G", TV_Files, int.Parse(((ToolStripMenuItem)sender).Tag.ToString())); - } - } private void 导入ToolStripMenuItem_Click(object sender, EventArgs e) { @@ -530,22 +523,8 @@ } } - private void 导出ToolStripMenuItem1_Click(object sender, EventArgs e) - { - 导出ToolStripMenuItem2_Click(sender, e); - } + - private void TV_HFSSrchRslt_AfterCollapse(object sender, TreeViewEventArgs e) - { - e.Node.ImageIndex = 0; - } - - private void TV_HFSSrchRslt_AfterExpand(object sender, TreeViewEventArgs e) - { - HFSClass.ADD_TreeNode(TV_Files, e.Node); - e.Node.ImageIndex = 1; - } - private void 导出ToolStripMenuItem1_Click_1(object sender, EventArgs e) { if ((TV_HFSSrchRslt.SelectedNode != null) && (TV_HFSSrchRslt.SelectedNode.Parent != null)) diff --git a/FrmLayerControl.cs b/FrmLayerControl.cs index e7917c3..28fa14d 100644 --- a/FrmLayerControl.cs +++ b/FrmLayerControl.cs @@ -312,26 +312,7 @@ layerManagerNode.Expand(); terrainManagerNode.Expand(); } - /// - /// 刷新节点树 - /// - private void RefreshDataTree() - { - layerTree2.Nodes[0].Nodes.Clear(); - Int32 nCount = globeControl2.Globe.Layers.Count; - Int32 i = 0; - for (i = 0; i < nCount; i++) - { - GSODataset dataSpace = globeControl2.Globe.Layers[i].Dataset; - TreeNode node = new TreeNode(); - node.Text = dataSpace.Name; - node.ImageIndex = 0; - node.SelectedImageIndex = 0; - node.Checked = true; - node.Tag = dataSpace; - layerTree2.Nodes[0].Nodes.Add(node); - } - } + /// /// 目标图层按钮事件处理 /// @@ -494,22 +475,8 @@ } } } - /// - /// 改变指定节点的选中状态 - /// - /// - /// - private void CheckTreeNode(TreeNode node, Boolean bChecked) - { - CheckChildTreeNode(node, bChecked); - // 对于kml图层,如果当前处理的节点是true,那么要把所有的祖宗节点置为true - // 只有所有节点都未false,那么这个节点才为false - // CheckFatherTreeNode(node, bChecked); - globeControl1.Globe.Refresh(); - globeControl2.Globe.Refresh(); - - } + private void CheckChildTreeNode(TreeNode node, Boolean bChecked) { if (node == null) @@ -696,59 +663,7 @@ //} //CheckControl(e); } - /// - /// 树节点选中方法 - /// - /// - private void CheckControl(TreeViewEventArgs e) - { - if (e.Action != TreeViewAction.Unknown) - { - if (e.Node != null && !Convert.IsDBNull(e.Node)) - { - CheckParentNode(e.Node); - if (e.Node.Nodes.Count > 0) - { - CheckAllChildNodes(e.Node, e.Node.Checked); - } - } - } - } - /// - /// 改变所有子节点的状态 - /// - /// - /// - private void CheckAllChildNodes(TreeNode pn, bool IsChecked) - { - foreach (TreeNode tn in pn.Nodes) - { - tn.Checked = IsChecked; - if (tn.Tag.ToString().Contains("|")) - { - string nodeTag = tn.Tag.ToString().Split('|')[1]; - GSOLayer layer = globeControl1.Globe.Layers.GetLayerByCaption(nodeTag); - if (layer != null) - { - layer.Visible = IsChecked; - globeControl1.Globe.Refresh(); - } - } - if (tn.Tag is GSOFeature) - { - if (tn.Nodes.Count == 0) - { - GSOFeature feat = tn.Tag as GSOFeature; - feat.Visible = IsChecked; - globeControl1.Globe.Refresh(); - } - } - if (tn.Nodes.Count > 0) - { - CheckAllChildNodes(tn, IsChecked); - } - } - } + /// /// 改变父节点的选中状态,此处为所有子节点不选中时才取消父节点选中,可以根据需要修改 /// diff --git a/FrmLogin.cs b/FrmLogin.cs index 320fdd5..2afe46e 100644 --- a/FrmLogin.cs +++ b/FrmLogin.cs @@ -59,70 +59,6 @@ textBoxPassWord.Clear(); } } - - /// - /// 验证端口号 - /// - /// - private bool ValiPort() - { - Ping p = new Ping();//创建Ping对象p - PingReply pr = p.Send(Utility.localicenseserverip);//向指定IP或者主机名的计算机发送ICMP协议的ping数据包 - if (pr.Status == IPStatus.Success)//如果ping成功 - { - try - { - TcpClient tcpc = new TcpClient(Utility.localicenseserverip, Utility.localicenseserverport);//对IP地址为"192.168.0.105"的计算机的1500端口提出连接申请 - tcpc.Close(); - return true; - } - catch (Exception ex) - { - MessageBox.Show("端口连接错误!" + ex.Message); - return false; - } - } - else - { - int times = 0;//重新连接次数; - int count = 2;//设置尝试次数 - while (times < count) - { - //Thread.Sleep(1000);//等待时间(方便测试的话,你可以改为1000) - pr = p.Send(Utility.localicenseserverip); - - if (pr.Status == IPStatus.Success) - { - try - { - TcpClient tcpc = new TcpClient(Utility.localicenseserverip, Utility.localicenseserverport);//对IP地址为"192.168.0.105"的计算机的1500端口提出连接申请 - tcpc.Close(); - return true; - } - catch (Exception ex) - { - MessageBox.Show("端口连接错误!" + ex.Message); - return false; - } - } - else - { - times++; - if (times < count) - { - continue; - } - else - { - MessageBox.Show("重新尝试连接失败"); - return false; - } - } - - } - return false; - } - } /// /// 验证用户名、密码 /// diff --git a/FrmMetadata.cs b/FrmMetadata.cs index 886f65a..0365372 100644 --- a/FrmMetadata.cs +++ b/FrmMetadata.cs @@ -27,11 +27,7 @@ InitializeComponent(); loadTreeView(layerTree); } - private void FrmMetadata_Load(object sender, EventArgs e) - { - //this.ntLblC.Text = "nn"; - // loadTreeView(layerTree); - } + private void loadTreeView(TreeView tv)//构建图层树 { try diff --git a/FrmMetadataStat.cs b/FrmMetadataStat.cs index 790658a..e7696c6 100644 --- a/FrmMetadataStat.cs +++ b/FrmMetadataStat.cs @@ -197,9 +197,5 @@ } } - private void buttonX1_Click(object sender, EventArgs e) - { - drawChart(); - } } } diff --git a/FrmPatrolerManager.cs b/FrmPatrolerManager.cs index 37f8ffd..9e66aeb 100644 --- a/FrmPatrolerManager.cs +++ b/FrmPatrolerManager.cs @@ -109,82 +109,8 @@ this.winGridViewPager1.AllToExport = table; } - /// - /// 编辑 - /// - /// - /// - private void winGridViewPager1_OnEditSelected(object sender, EventArgs e) - { - - DataGridView grid = sender as DataGridView; - if (grid != null && grid.SelectedRows.Count>0) - { - DataGridViewRow row = grid.SelectedRows[0]; - try - { - long dbid = long.Parse(row.Cells["编号"].Value.ToString()); - String name = row.Cells["姓名"].Value.ToString(); - String sex = row.Cells["性别"].Value.ToString(); - String age = row.Cells["年龄"].Value.ToString(); - string phone = row.Cells["电话"].Value.ToString(); - age = String.IsNullOrEmpty(age.ToString().Trim()) ? "1" : age.ToString().Trim(); - FrmPatrolerEdit frm = new FrmPatrolerEdit(dbid.ToString(), name, age, sex, phone); - frm.reloadGrid += new ReloadPatrolerGrid(LoadData); - frm.ShowDialog(); - winGridViewPager1.Refresh(); - } - catch (Exception ex) - { - MessageBox.Show("编辑失败:" + ex.ToString(), "错误", MessageBoxButtons.OK, MessageBoxIcon.Error); - } - } - else - { - MessageBox.Show("没有选择记录", "提示"); - } - - } - - /// - /// 删除 - /// - /// - /// - private void winGridViewPager1_OnDeleteSelected(object sender, EventArgs e) - { - DataGridView grid = sender as DataGridView; - if (grid != null && grid.SelectedRows.Count > 0) - { - DataGridViewRow row = grid.SelectedRows[0]; - long dbid = long.Parse(row.Cells["编号"].Value.ToString()); - try - { - string state = row.Cells["状态"].Value.ToString(); - if ("在线".Equals(state)) - { - if (MessageBox.Show("确定注销?", "确认", MessageBoxButtons.YesNo, MessageBoxIcon.Question) == DialogResult.Yes) - { - String sql = "update patroler t set t.accountstate='LEAVER' where t.dbid=" + dbid; - OracleUtils.ExecuteNonQuery(OracleUtils.ConnectionString, CommandType.Text, sql); - } - } - else { - MessageBox.Show("人员不在线,无法注销", "信息"); - } - } - catch (Exception ex) - { - MessageBox.Show("人员注销失败:" + ex.ToString(), "错误", MessageBoxButtons.OK, MessageBoxIcon.Error); - } - } - else - { - MessageBox.Show("没有选择记录", "提示"); - } - } - - + + private void LoadData() { int pageIndex = winGridViewPager1.PagerInfo.CurrenetPageIndex; diff --git a/Cyberpipe.csproj b/Cyberpipe.csproj index 07a8c1a..e3cd12c 100644 --- a/Cyberpipe.csproj +++ b/Cyberpipe.csproj @@ -204,25 +204,6 @@ - - Form - - - F_GKT1数据输入输出.cs - - - Form - - - F_GKT1添加文件.cs - - - Form - - - F_GKT1添加项目.cs - - Form @@ -1068,18 +1049,6 @@ Frm_password_reset.cs - - Form - - - GKT.cs - - - Form - - - GKT1.cs - Form @@ -1258,12 +1227,6 @@ F_Projedit.cs - - Form - - - PED.cs - Form @@ -1331,16 +1294,6 @@ True Reference.map - - F_GKT1数据输入输出.cs - Designer - - - F_GKT1添加文件.cs - - - F_GKT1添加项目.cs - Form_EditTask.cs @@ -1836,12 +1789,6 @@ Frm_password_reset.cs - - GKT.cs - - - GKT1.cs - F_GKT数据输入输出.cs @@ -1934,9 +1881,6 @@ F_Projedit.cs - - PED.cs - F_数据输入输出.cs diff --git a/Cyberpipe.suo b/Cyberpipe.suo index 68ced4f..a1aecf8 100644 --- a/Cyberpipe.suo +++ b/Cyberpipe.suo Binary files differ diff --git a/EMS_Forms/Form_EditTask.cs b/EMS_Forms/Form_EditTask.cs index 718992f..f1d791f 100644 --- a/EMS_Forms/Form_EditTask.cs +++ b/EMS_Forms/Form_EditTask.cs @@ -119,7 +119,8 @@ String name = Convert.ToString(dr["USERNAME"]); comboBox_userName.Items.Add(name); - } + } + dr.Close(); comboBox_road.Items.Clear(); roadList = new List(); @@ -135,7 +136,7 @@ comboBox_road.Items.Add(name); } } - + dr1.Close(); conn.Close(); bool flag2 = false; @@ -185,7 +186,7 @@ catch (Exception ex) { - MessageBox.Show(ex.ToString()); + LogHelper.WriteLog(typeof(Form_EditTask), ex.Message); } } @@ -288,7 +289,7 @@ } catch (Exception ex) { - MessageBox.Show(ex.ToString()); + LogHelper.WriteLog(typeof(Form_EditTask), ex.Message); } } @@ -474,7 +475,7 @@ } catch (Exception ex) { - MessageBox.Show(ex.ToString()); + LogHelper.WriteLog(typeof(Form_EditTask), ex.Message); } this.Close(); @@ -495,6 +496,7 @@ { numList.Add(Convert.ToInt32(dr["DBID"])); } + dr.Close(); if (numList.Count == 0) { taskNumber = Convert.ToInt32(number) * 100; @@ -674,6 +676,7 @@ } } } + dr.Close(); conn.Close(); } diff --git a/EMS_Forms/Form_EventManager.cs b/EMS_Forms/Form_EventManager.cs index b18c45b..84807b2 100644 --- a/EMS_Forms/Form_EventManager.cs +++ b/EMS_Forms/Form_EventManager.cs @@ -64,6 +64,7 @@ comboBox_name.Items.Add(name); } + dr.Close(); conn.Close(); diff --git a/Forms/FrmMnModify.cs b/Forms/FrmMnModify.cs index 31cfc5f..d036360 100644 --- a/Forms/FrmMnModify.cs +++ b/Forms/FrmMnModify.cs @@ -68,15 +68,7 @@ questionGrid.Rows[idx].Cells[1].Value = sr.question; } } - /// 选中对象 - /// - /// - /// - /// - private void buttonX1_Click(object sender, EventArgs e) - { - globecontrol.Globe.Action = EnumAction3D.SelectObject; - } + /// /// 选中某一行 /// diff --git a/Forms/FrmPipelineModelDataBase.cs b/Forms/FrmPipelineModelDataBase.cs index 2acf0ca..7ce573f 100644 --- a/Forms/FrmPipelineModelDataBase.cs +++ b/Forms/FrmPipelineModelDataBase.cs @@ -35,19 +35,7 @@ ds = _ds; InitializeComponent(); } - /// - /// 单击选择shp格式文件 - /// - /// - /// - private void btnBrowseModel_Click(object sender, EventArgs e) - { - saveFileDialog1.Filter = "*.lgd|*.lgd"; - if (saveFileDialog1.ShowDialog() == DialogResult.OK) - { - txtModelLayer.Text = saveFileDialog1.FileName; - } - } + /// /// 窗体初始化事件处理 /// @@ -100,49 +88,6 @@ } } } - - private object convertFieldValue(string fieldname, object obj) - { - if (obj == null) - return null; - - try - { - string type = fields_types[fieldname].ToString(); - switch (type) - { - case "string": - return obj.ToString(); - case "int": - //return 101; - int intResult; - if (int.TryParse(obj.ToString(), out intResult)) - return intResult; - else - return null; - case "double": - //return 202.5; - double doubleResult; - if (double.TryParse(obj.ToString(), out doubleResult)) - return doubleResult; - else - return null; - case "date": - DateTime dtResult; - if (DateTime.TryParse(obj.ToString(), out dtResult)) - return dtResult; - else - return null; - } - return null; - } - catch (Exception ex) - { - MessageBox.Show(ex.ToString()); - return null; - } - } - public string lgdFilePath = ""; /// /// 选择管线颜色 @@ -610,33 +555,6 @@ { this.Close(); } - - private void cmbLayer_SelectedIndexChanged(object sender, EventArgs e) //选择图层 - { - GSOLayer layer = ctl.Globe.Layers.GetLayerByCaption(selectLayerName); - GSOFeatures features = layer.GetAllFeatures(); - if (features.Length == 0) - return; - - cmbFrom.Items.Clear(); - cmbTo.Items.Clear(); - cmbRadius.Items.Clear(); - cmbID.Items.Clear(); - for (int i = 0; i < features[0].GetFieldCount(); i++) - { - GeoScene.Data.GSOFieldDefn fielddef = (GeoScene.Data.GSOFieldDefn)(features[0].GetFieldDefn(i)); - - cmbFrom.Items.Add(fielddef.Name); - cmbTo.Items.Add(fielddef.Name); - cmbRadius.Items.Add(fielddef.Name); - cmbID.Items.Add(fielddef.Name); - } - cmbFrom.SelectedItem = "Deep1"; - cmbTo.SelectedItem = "Deep2"; - cmbRadius.SelectedItem = "Diameter"; - cmbID.SelectedItem = "Handle"; - } - private void buttonXLayerPath_Click(object sender, EventArgs e)//单击 选择shp格式的文件 { OpenFileDialog dlg = new OpenFileDialog(); diff --git a/Forms/FrmPipelineModelDataOneStep.cs b/Forms/FrmPipelineModelDataOneStep.cs index 18afda7..ec93b8a 100644 --- a/Forms/FrmPipelineModelDataOneStep.cs +++ b/Forms/FrmPipelineModelDataOneStep.cs @@ -38,19 +38,7 @@ layerTree = _layerTree; InitializeComponent(); } - /// - /// 单击选择shp格式文件 - /// - /// - /// - private void btnBrowseModel_Click(object sender, EventArgs e) - { - saveFileDialog1.Filter = "*.lgd|*.lgd"; - if (saveFileDialog1.ShowDialog() == DialogResult.OK) - { - txtModelLayer.Text = saveFileDialog1.FileName; - } - } + /// /// 窗体初始化事件处理 /// @@ -107,48 +95,7 @@ } } - private object convertFieldValue(string fieldname, object obj) - { - if (obj == null) - return null; - - try - { - string type = fields_types[fieldname].ToString(); - switch (type) - { - case "string": - return obj.ToString(); - case "int": - //return 101; - int intResult; - if (int.TryParse(obj.ToString(), out intResult)) - return intResult; - else - return null; - case "double": - //return 202.5; - double doubleResult; - if (double.TryParse(obj.ToString(), out doubleResult)) - return doubleResult; - else - return null; - case "date": - DateTime dtResult; - if (DateTime.TryParse(obj.ToString(), out dtResult)) - return dtResult; - else - return null; - } - return null; - } - catch (Exception ex) - { - MessageBox.Show(ex.ToString()); - return null; - } - } - + public string lgdFilePath = ""; /// /// 选择管线颜色 @@ -673,32 +620,6 @@ return featDs; } - private void cmbLayer_SelectedIndexChanged(object sender, EventArgs e) //选择图层 - { - GSOLayer layer = ctl.Globe.Layers.GetLayerByCaption(selectLayerName); - GSOFeatures features = layer.GetAllFeatures(); - if (features.Length == 0) - return; - - cmbFrom.Items.Clear(); - cmbTo.Items.Clear(); - cmbRadius.Items.Clear(); - cmbID.Items.Clear(); - for (int i = 0; i < features[0].GetFieldCount(); i++) - { - GeoScene.Data.GSOFieldDefn fielddef = (GeoScene.Data.GSOFieldDefn)(features[0].GetFieldDefn(i)); - - cmbFrom.Items.Add(fielddef.Name); - cmbTo.Items.Add(fielddef.Name); - cmbRadius.Items.Add(fielddef.Name); - cmbID.Items.Add(fielddef.Name); - } - cmbFrom.SelectedItem = "Deep1"; - cmbTo.SelectedItem = "Deep2"; - cmbRadius.SelectedItem = "Diameter"; - cmbID.SelectedItem = "Handle"; - } - private void buttonXLayerPath_Click(object sender, EventArgs e)//单击 选择shp格式的文件 { OpenFileDialog dlg = new OpenFileDialog(); @@ -949,38 +870,6 @@ } //txtLayername.Text = type + layername; } - /// - /// 连接数据库 - /// - /// - /// - private void buttonX1_Click(object sender, EventArgs e) - { - if (ds == null) - { - //没连的话,直接连接审核库; //审核库配置读配置文件 - string dbIp = Utility.sgdbip; - string database = Utility.sgdbname; - string user = Utility.sgdbuser; - string pass = Utility.sgdbpwd; - - if (!Utility.isNetworkConnectionSuccess(dbIp.Trim())) - { - MessageBox.Show("网络连接失败!", "提示"); - return; - } - - ds = ctl.Globe.DataManager.OpenOracleDataSource(dbIp + "/" + database, "", "", user, pass); - if (ds == null) - { - MessageBox.Show("数据库连接失败!", "提示", MessageBoxButtons.OK, MessageBoxIcon.Warning); - } - else - { - btnCreateModel.Enabled = true; - } - } - } private void btnClose_Click(object sender, EventArgs e) { diff --git a/Forms/FrmShRK.cs b/Forms/FrmShRK.cs index 0e2e722..f1d83cb 100644 --- a/Forms/FrmShRK.cs +++ b/Forms/FrmShRK.cs @@ -215,6 +215,7 @@ { sourcefeatds = sourcefeat as GSOFeatureDataset; } + if (sourcefeatds == null) return; sourcefeatds.Open(); GSOFeatures sourcefeatures = sourcefeatds.GetAllFeatures(); @@ -251,6 +252,7 @@ { desfeatds = desfeat as GSOFeatureDataset; } + if (desfeatds == null) return; desfeatds.Open(); //向新数据集写入字段 diff --git a/FrmAccessoriesSensor.cs b/FrmAccessoriesSensor.cs index 09fcdf1..2a7a80e 100644 --- a/FrmAccessoriesSensor.cs +++ b/FrmAccessoriesSensor.cs @@ -209,7 +209,7 @@ chart1.Series[0].Points.DataBindXY(dic.Keys, dic.Values); for (int m = 0; m < dic.Values.Count; m++) { - if (chart1.Series[0].Points[m].YValues[0].ToString() != "0") + if (chart1.Series[0].Points[m]!=null&&chart1.Series[0].Points[m].YValues[0].ToString() != "0") { chart1.Series[0].Points[m].Label = chart1.Series[0].Points[m].YValues[0].ToString(); } diff --git a/FrmAccessoriesgather.cs b/FrmAccessoriesgather.cs index 9e331e1..a475d9e 100644 --- a/FrmAccessoriesgather.cs +++ b/FrmAccessoriesgather.cs @@ -338,7 +338,7 @@ chart1.Series[0].Points.DataBindXY(dic.Keys, dic.Values); for (int m = 0; m < dic.Values.Count; m++) { - if (chart1.Series[0].Points[m].YValues[0].ToString() != "0") + if (chart1.Series[0].Points[m]!=null&&chart1.Series[0].Points[m].YValues[0].ToString() != "0") { chart1.Series[0].Points[m].Label = chart1.Series[0].Points[m].YValues[0].ToString(); } diff --git a/FrmAccessoryAnalysis.cs b/FrmAccessoryAnalysis.cs index 71d4579..44d4065 100644 --- a/FrmAccessoryAnalysis.cs +++ b/FrmAccessoryAnalysis.cs @@ -66,39 +66,6 @@ globeControl1.Refresh(); } /// - /// 键盘按键按下事件处理 - /// - /// - /// - private void txtRadius_KeyPress(object sender, KeyPressEventArgs e) - { - TextBox text = sender as TextBox; - if ((e.KeyChar < 48 || e.KeyChar > 57) && (e.KeyChar != 8) && (int)e.KeyChar != 46) - { - e.Handled = true; - } - if ((int)e.KeyChar == 46) //小数点 - { - if (text.Text.Length <= 0) - e.Handled = true; //小数点不能在第一位 - else //处理不规则的小数点 - { - float f; - float oldf; - bool b1 = false, b2 = false; - b1 = float.TryParse(text.Text, out oldf); - b2 = float.TryParse(text.Text + e.KeyChar.ToString(), out f); - if (b2 == false) - { - if (b1 == true) - e.Handled = true; - else - e.Handled = false; - } - } - } - } - /// /// 确定按钮事件处理 /// /// diff --git a/FrmAddValve.cs b/FrmAddValve.cs index 34d2fec..5f405b9 100644 --- a/FrmAddValve.cs +++ b/FrmAddValve.cs @@ -486,56 +486,6 @@ } } - - - - - - - - private void cmbLayer_SelectedIndexChanged(object sender, EventArgs e) - { - GSOLayer layer = globeControl1.Globe.Layers.GetLayerByCaption(selectLayerName); - GSOFeatures features = layer.GetAllFeatures(); - if (features.Length == 0) - return; - - combPath.Items.Clear(); - combZ.Items.Clear(); - combModelName.Items.Clear(); - - for (int i = 0; i < features[0].GetFieldCount(); i++) - { - GeoScene.Data.GSOFieldDefn fielddef = (GeoScene.Data.GSOFieldDefn)(features[0].GetFieldDefn(i)); - combPath.Items.Add(fielddef.Name); - combZ.Items.Add(fielddef.Name); - combModelName.Items.Add(fielddef.Name); - } - combModelName.SelectedItem = "编号"; - combPath.SelectedItem = "模型路径"; - if (combfile.SelectedIndex != -1) - { - - string layerCaption = combfile.SelectedItem.ToString().Trim(); - rukuLayer = globeControl1.Globe.Layers.GetLayerByCaption(layerCaption); - if (rukuLayer != null) - { - combPath.Items.Clear(); - combZ.Items.Clear(); - combModelName.Items.Clear(); - - } - for (int i = 0; i < features[0].GetFieldCount(); i++) - { - GeoScene.Data.GSOFieldDefn fielddef = (GeoScene.Data.GSOFieldDefn)(features[0].GetFieldDefn(i)); - combPath.Items.Add(fielddef.Name); - combZ.Items.Add(fielddef.Name); - combModelName.Items.Add(fielddef.Name); - } - combModelName.SelectedItem = "编号"; - combPath.SelectedItem = "模型路径"; - } - } /// /// 单击选择shp格式文件 /// diff --git a/FrmAddWellShp.cs b/FrmAddWellShp.cs index bb79ec0..a249725 100644 --- a/FrmAddWellShp.cs +++ b/FrmAddWellShp.cs @@ -478,32 +478,6 @@ } } } - - private void cmbLayer_SelectedIndexChanged(object sender, EventArgs e) - { - GSOLayer layer = globeControl1.Globe.Layers.GetLayerByCaption(selectLayerName); - GSOFeatures features = layer.GetAllFeatures(); - if (features.Length == 0) - return; - - combCode.Items.Clear(); - combDeep.Items.Clear(); - combModelName.Items.Clear(); - combAngle.Items.Clear(); - - for (int i = 0; i < features[0].GetFieldCount(); i++) - { - GeoScene.Data.GSOFieldDefn fielddef = (GeoScene.Data.GSOFieldDefn)(features[0].GetFieldDefn(i)); - combCode.Items.Add(fielddef.Name); - combDeep.Items.Add(fielddef.Name); - combModelName.Items.Add(fielddef.Name); - combAngle.Items.Add(fielddef.Name); - } - combCode.SelectedItem = "附属物编码"; - combDeep.SelectedItem = "井深"; - combModelName.SelectedItem = "编号"; - combAngle.SelectedItem = "符号角度"; - } /// /// 单击选择shp格式文件 /// diff --git a/FrmAddYuBiZiShp.cs b/FrmAddYuBiZiShp.cs index b312d51..332f037 100644 --- a/FrmAddYuBiZiShp.cs +++ b/FrmAddYuBiZiShp.cs @@ -383,80 +383,7 @@ } } - private void cmbLayer_SelectedIndexChanged(object sender, EventArgs e) - { - GSOLayer layer = globeControl1.Globe.Layers.GetLayerByCaption(selectLayerName); - GSOFeatures features = layer.GetAllFeatures(); - if (features.Length == 0) - return; - - combCode.Items.Clear(); - combDeep.Items.Clear(); - combModelName.Items.Clear(); - //comboLoad.Items.Clear(); - for (int i = 0; i < features[0].GetFieldCount(); i++) - { - GeoScene.Data.GSOFieldDefn fielddef = (GeoScene.Data.GSOFieldDefn)(features[0].GetFieldDefn(i)); - combCode.Items.Add(fielddef.Name); - combDeep.Items.Add(fielddef.Name); - combModelName.Items.Add(fielddef.Name); - //comboLoad.Items.Add(fielddef.Name); - } - combCode.SelectedItem = "附属物编码"; - combDeep.SelectedItem = "Z坐标"; - combModelName.SelectedItem = "编号"; - //comboLoad.SelectedItem = "模型路径"; - } - - private void buttonXLayerPath_Click(object sender, EventArgs e) - { - OpenFileDialog dlg = new OpenFileDialog(); - dlg.Filter = "*.shp|*.shp"; - dlg.Multiselect = false; - if (dlg.ShowDialog() == DialogResult.OK) - { - GSOLayer layer = globeControl1.Globe.Layers.Add(dlg.FileName); - string txtMessage = valiYBdata(layer); - if (txtMessage != "") - { - button3.Enabled = false; - //textBoxLayer.Text = ""; - combCode.Items.Clear(); - combDeep.Items.Clear(); - combModelName.Items.Clear(); - globeControl1.Globe.Layers.Remove(layer); - FrmValiDataShowErrorMessage showErrorMessage = new FrmValiDataShowErrorMessage(dlg.FileName, txtMessage); - showErrorMessage.ShowDialog(); - return; - } - else - { - button3.Enabled = true; - //textBoxLayer.Text = dlg.FileName; - selectLayerName = layer.Caption; - txtLayerName.Text = layer.Caption; - GSOFeatures features = layer.GetAllFeatures(); - if (features.Length == 0) - return; - - combCode.Items.Clear(); - combDeep.Items.Clear(); - combModelName.Items.Clear(); - for (int i = 0; i < features[0].GetFieldCount(); i++) - { - GeoScene.Data.GSOFieldDefn fielddef = (GeoScene.Data.GSOFieldDefn)(features[0].GetFieldDefn(i)); - combCode.Items.Add(fielddef.Name); - combDeep.Items.Add(fielddef.Name); - combModelName.Items.Add(fielddef.Name); - //comboLoad.Items.Add(fielddef.Name); - } - combCode.SelectedItem = "管点编码"; - combDeep.SelectedItem = "Z坐标"; - combModelName.SelectedItem = "编号"; - } - } - } - + private void FrmAddYuBiZiShp_FormClosing(object sender, FormClosingEventArgs e) { globeControl1.Globe.Refresh(); diff --git a/FrmAllPipelineStatis.cs b/FrmAllPipelineStatis.cs index 6421a26..a6eea29 100644 --- a/FrmAllPipelineStatis.cs +++ b/FrmAllPipelineStatis.cs @@ -84,7 +84,7 @@ chartAllAreaPipeline.Series["管线"].Points.DataBindXY(pipelineLengthAndType.Keys, pipelineLengthAndType.Values); for (int m = 0; m < pipelineLengthAndType.Values.Count; m++) { - if (chartAllAreaPipeline.Series["管线"].Points[m].YValues[0].ToString() != "0") + if (chartAllAreaPipeline.Series["管线"].Points[m]!=null&&chartAllAreaPipeline.Series["管线"].Points[m].YValues[0].ToString() != "0") { chartAllAreaPipeline.Series["管线"].Points[m].Label = chartAllAreaPipeline.Series[0].Points[m].YValues[0].ToString(); } @@ -94,7 +94,7 @@ } catch (Exception ex) { - //LogError.PublishError(ex); + LogHelper.WriteLog(typeof(FrmAllPipelineStatis), ex.Message); } } @@ -147,7 +147,7 @@ } DataTable dt = OledbHelper.QueryTable(sql); - if (dt != null && dt.Rows.Count > 0) + if (dt != null && dt.Rows.Count > 0 && chartAllAreaPipeline.Series["管线"].Points[indexHit]!=null) { dataGridViewX1.DataSource = dt; panel.Visible = true; diff --git a/FrmAllWorkWellStatis.cs b/FrmAllWorkWellStatis.cs index 6fec7af..6af8e4c 100644 --- a/FrmAllWorkWellStatis.cs +++ b/FrmAllWorkWellStatis.cs @@ -52,7 +52,7 @@ chartAllAreaPipeline.Series["井盖"].Points.DataBindXY(workWellLengthAndType.Keys, workWellLengthAndType.Values); for (int m = 0; m < workWellLengthAndType.Values.Count; m++) { - if (chartAllAreaPipeline.Series["井盖"].Points[m].YValues[0].ToString().Trim() != "0") + if (chartAllAreaPipeline.Series["井盖"].Points[m]!=null&&chartAllAreaPipeline.Series["井盖"].Points[m].YValues[0].ToString().Trim() != "0") { chartAllAreaPipeline.Series["井盖"].Points[m].Label = chartAllAreaPipeline.Series[0].Points[m].YValues[0].ToString(); } @@ -60,7 +60,7 @@ } catch (Exception ex) { - //LogError.PublishError(ex); + LogHelper.WriteLog(typeof(FrmAllWorkWellStatis), ex.Message); } } diff --git a/FrmBSQDuoBianXingStatis.cs b/FrmBSQDuoBianXingStatis.cs index e8b7d52..3e889b6 100644 --- a/FrmBSQDuoBianXingStatis.cs +++ b/FrmBSQDuoBianXingStatis.cs @@ -60,7 +60,7 @@ { for (int m = 0; m < bsq1.Values.Count; m++) { - if (chart1.Series["标识器"].Points[m].YValues[0].ToString() != "0") + if (chart1.Series["标识器"].Points[m]!=null&&chart1.Series["标识器"].Points[m].YValues[0].ToString() != "0") { count += Convert.ToInt16(chart1.Series[0].Points[m].YValues[0].ToString()); chart1.Series["标识器"].Points[m].Label = chart1.Series[0].Points[m].YValues[0].ToString(); diff --git a/FrmBSQDuoBianXingStreet.cs b/FrmBSQDuoBianXingStreet.cs index 2005ebb..1db5777 100644 --- a/FrmBSQDuoBianXingStreet.cs +++ b/FrmBSQDuoBianXingStreet.cs @@ -63,7 +63,7 @@ chartStatis.Series[0].Points.DataBindXY(bsq.Keys, bsq.Values); for (int m = 0; m < bsq.Values.Count; m++) { - if (chartStatis.Series[0].Points[m].YValues[0].ToString().Trim() != "0") + if (chartStatis.Series[0].Points[m]!=null&&chartStatis.Series[0].Points[m].YValues[0].ToString().Trim() != "0") { count += Convert.ToInt16(chartStatis.Series[0].Points[m].YValues[0].ToString()); chartStatis.Series[0].Points[m].Label = chartStatis.Series[0].Points[m].YValues[0].ToString(); diff --git a/FrmBSQStatis.cs b/FrmBSQStatis.cs index 390a55c..4aa0ee6 100644 --- a/FrmBSQStatis.cs +++ b/FrmBSQStatis.cs @@ -95,6 +95,8 @@ } } } + + dr.Close(); conn.Close(); for (int i = 0; i < typeLists.Count; i++) { @@ -123,7 +125,7 @@ chartStatis.Series[0].Points.DataBindXY(bsq.Keys, bsq.Values); for (int m = 0; m < bsq.Values.Count; m++) { - if (chartStatis.Series[0].Points[m].YValues[0].ToString().Trim() != "0") + if (chartStatis.Series[0].Points[m]!=null&&chartStatis.Series[0].Points[m].YValues[0].ToString().Trim() != "0") { //count += Convert.ToInt16(chartStatis.Series[0].Points[m].YValues[0].ToString()); chartStatis.Series[0].Points[m].Label = chartStatis.Series[0].Points[m].YValues[0].ToString(); diff --git a/FrmBSQStreet.cs b/FrmBSQStreet.cs index 9d88adb..7fbacad 100644 --- a/FrmBSQStreet.cs +++ b/FrmBSQStreet.cs @@ -44,7 +44,7 @@ chartStatis.Series[0].Points.DataBindXY(bsq.Keys, bsq.Values); for (int m = 0; m < bsq.Values.Count; m++) { - if (chartStatis.Series[0].Points[m].YValues[0].ToString().Trim() != "0") + if (chartStatis.Series[0].Points[m]!=null&&chartStatis.Series[0].Points[m].YValues[0].ToString().Trim() != "0") { count += Convert.ToInt16(chartStatis.Series[0].Points[m].YValues[0].ToString()); chartStatis.Series[0].Points[m].Label = chartStatis.Series[0].Points[m].YValues[0].ToString(); diff --git a/FrmBoosterValvers.cs b/FrmBoosterValvers.cs index 5061efc..df9b62b 100644 --- a/FrmBoosterValvers.cs +++ b/FrmBoosterValvers.cs @@ -236,199 +236,6 @@ count = 0; } } - /// - /// 添加火苗 - /// - /// - /// - /// - /// - private GSOFeature AddFire(double x,double y,double z) - { - // 烟火示例 - - string strResPath = Application.StartupPath + "/Resource"; - - // 烟火粒子示例,由三个发射器构成 - GSOGeoParticle geoParticle = new GSOGeoParticle(); - geoParticle.SetPosition(x, y, z); // 添加到这个经纬度位置 - geoParticle.AltitudeMode = EnumAltitudeMode.RelativeToGround; - - GSORingParticleEmitter emitter = new GSORingParticleEmitter(); - emitter.TexturePath = strResPath + "/ParticleImage/flare.png"; - - emitter.SetSizeFix(1, 1); - emitter.VelFix = 1; - emitter.VelRnd = 5; - - emitter.AngleXYFix = 0; - emitter.AngleXYRnd = 180; - - emitter.AngleXZFix = 90; - emitter.AngleXZRnd = 0; - - emitter.LifeFix = 0.5f; - emitter.LifeRnd = 0.0f; - - emitter.RotFix = 0; - emitter.RotRnd = 0; - - emitter.RotVelFix = 0; - emitter.RotVelRnd = 0; - - emitter.EmitPerSec = 100; - - // 采用线性插值生成粒子的初始颜色 - emitter.ColorRndStart = Color.White; - emitter.ColorRndEnd = Color.Red; - - - GSOColorParticleEffector effector2 = new GSOColorParticleEffector(); - effector2.SetColorChanged(0, -1, -1, 0); - effector2.StartTime = 0.0f; - effector2.EndTime = -1.0f; - emitter.AddEffector(effector2); - - // 将三个发射器添加到粒子对象中 - geoParticle.AddEmitter(emitter); - - geoParticle.Play(); - - GSOFeature feature = new GSOFeature(); - - feature.Geometry = geoParticle; - - globeControl1.Globe.MemoryLayer.AddFeature(feature); - - - return feature; - } - - /// - /// 添加喷泉 - /// - /// - private GSOFeature AddFountain() - { - string strResPath = Application.StartupPath + "/Resource"; - - GSOGeoParticle geoParticle = new GSOGeoParticle(); - geoParticle.SetPosition(116.314, 39.84, 0); // 添加到这个经纬度位置 - - GSOPointParticleEmitter emitter = new GSOPointParticleEmitter(); - emitter.TexturePath = strResPath + "/ParticleImage/test.png"; - - emitter.SetSizeFix(0.5f, 2); - emitter.VelFix = 10; - emitter.VelRnd = 2; - - emitter.GravityAcc = 9.8f; - emitter.AngleXYFix = 0; - emitter.AngleXYRnd = 180; - - emitter.AngleXZFix = 88; - emitter.AngleXZRnd = 2; - - //emitter.InnerRadius = 0; - // emitter.OuterRadius = 0.03f; - - emitter.LifeFix = 5.0f; - emitter.LifeRnd = 1.0f; - - emitter.RotFix = 0; - emitter.RotRnd = 0; - - emitter.RotVelFix = 0; - emitter.RotVelRnd = 0; - - emitter.EmitPerSec = 1000; - emitter.ColorRndStart = Color.FromArgb(33, 255, 255, 255); - emitter.ColorRndEnd = Color.FromArgb(11, 255, 255, 255); - emitter.IsLumAdded = false; - - // 将三个发射器添加到粒子对象中 - geoParticle.AddEmitter(emitter); - - geoParticle.Play(); - GSOFeature feature = new GSOFeature(); - - feature.Geometry = geoParticle; - - //globeControl1.Globe.MemoryLayer.AddFeature(feature); - globeControl1.Globe.FlyToFeature(feature); - - return feature; - } - - /// - /// 添加水柱 - /// - /// - private GSOFeature AddWaterLine() - { - string strResPath = Application.StartupPath + "/Resource"; - - GSOGeoParticle geoParticle = new GSOGeoParticle(); - geoParticle.SetPosition(116.308, 39.84, 0); // 添加到这个经纬度位置 - - GSOPointParticleEmitter emitter = new GSOPointParticleEmitter(); - - emitter.TexturePath = strResPath + "/ParticleImage/drop3.png"; - - geoParticle.TimerInterval = 1; - - emitter.SetSizeFix(2.0f, 2.0f); - - emitter.VelFix = 50; - emitter.VelRnd = 2; - - // emitter.IsLumAdded = false; - - emitter.GravityAcc = 9.8f; - emitter.AngleXYFix = 0; - emitter.AngleXYRnd = 2; - - emitter.AngleXZFix = 60; - emitter.AngleXZRnd = 2; - - //emitter.InnerRadius = 0; - // emitter.OuterRadius = 0.1f; - - emitter.LifeFix = 5.0f; - emitter.LifeRnd = 1.0f; - - emitter.RotFix = 0; - emitter.RotRnd = 0; - - emitter.RotVelFix = 0; - emitter.RotVelRnd = 0; - - emitter.EmitPerSec = 1500; - - emitter.ColorRndStart = Color.FromArgb(100, 222, 222, 222); - emitter.ColorRndEnd = Color.FromArgb(50, 222, 222, 222); - - /* - - GSOScaleParticleEffector effector1 = new GSOScaleParticleEffector(); - effector1.SetScale(0.2f, 0.2f); - effector1.StartTime = 0; - effector1.EndTime = -1; // 负数表示整个粒子生命结束 - emitter.AddEffector(effector1); - */ - - // 将三个发射器添加到粒子对象中 - geoParticle.AddEmitter(emitter); - - geoParticle.Play(); - GSOFeature feature = new GSOFeature(); - - feature.Geometry = geoParticle; - - //globeControl1.Globe.MemoryLayer.AddFeature(feature); - globeControl1.Globe.FlyToFeature(feature); - - return feature; - } + } } diff --git a/FrmBufferAnalysis.cs b/FrmBufferAnalysis.cs index f711133..db8ca59 100644 --- a/FrmBufferAnalysis.cs +++ b/FrmBufferAnalysis.cs @@ -123,39 +123,6 @@ } } /// - /// 半径文本框的键盘按键按下事件处理 - /// - /// - /// - private void txtRadius_KeyPress(object sender, KeyPressEventArgs e) - { - TextBox text = sender as TextBox; - if ((e.KeyChar < 48 || e.KeyChar > 57) && (e.KeyChar != 8) && (int)e.KeyChar != 46) - { - e.Handled = true; - } - if ((int)e.KeyChar == 46) //小数点 - { - if (text.Text.Length <= 0) - e.Handled = true; //小数点不能在第一位 - else //处理不规则的小数点 - { - float f; - float oldf; - bool b1 = false, b2 = false; - b1 = float.TryParse(text.Text, out oldf); - b2 = float.TryParse(text.Text + e.KeyChar.ToString(), out f); - if (b2 == false) - { - if (b1 == true) - e.Handled = true; - else - e.Handled = false; - } - } - } - } - /// /// 窗体关闭事件处理 /// /// diff --git a/FrmBufferAnalysisBSQ.cs b/FrmBufferAnalysisBSQ.cs index 24a96ca..f54208f 100644 --- a/FrmBufferAnalysisBSQ.cs +++ b/FrmBufferAnalysisBSQ.cs @@ -137,35 +137,7 @@ } } - private void txtRadius_KeyPress(object sender, KeyPressEventArgs e) - { - TextBox text = sender as TextBox; - if ((e.KeyChar < 48 || e.KeyChar > 57) && (e.KeyChar != 8) && (int)e.KeyChar != 46) - { - e.Handled = true; - } - if ((int)e.KeyChar == 46) //小数点 - { - if (text.Text.Length <= 0) - e.Handled = true; //小数点不能在第一位 - else //处理不规则的小数点 - { - float f; - float oldf; - bool b1 = false, b2 = false; - b1 = float.TryParse(text.Text, out oldf); - b2 = float.TryParse(text.Text + e.KeyChar.ToString(), out f); - if (b2 == false) - { - if (b1 == true) - e.Handled = true; - else - e.Handled = false; - } - } - } - } - + private void FrmBufferAnalysis_FormClosing(object sender, FormClosingEventArgs e) { //Form1.y = 0; @@ -316,27 +288,6 @@ } } - private void FlyToMenu_Click(object sender, EventArgs e) - { - if (m_feature != null) - { - if (m_feature.Geometry != null && m_feature.Geometry.Type == EnumGeometryType.GeoPolyline3D) - { - GSOGeoPolyline3D line = m_feature.Geometry as GSOGeoPolyline3D; - double length = line.GetSpaceLength(true, 6378137); - GSOGeoPolyline3D lineLine = line.GetSegment(0, length / 2); - GSOPoint3d point3d = lineLine[lineLine.PartCount - 1][lineLine[lineLine.PartCount - 1].Count - 1]; - - globeControl1.Globe.FlyToPosition(point3d, EnumAltitudeMode.Absolute, 0, 45, 5); - } - else - { - globeControl1.Globe.FlyToFeature(m_feature, 0, 45, 3); - } - LightMenu_Click(sender, e); - } - } - private void LightMenu_Click(object sender, EventArgs e) { flashflag = "single"; diff --git a/FrmDataBaseOpt.cs b/FrmDataBaseOpt.cs index b0c4b5d..8d7b69d 100644 --- a/FrmDataBaseOpt.cs +++ b/FrmDataBaseOpt.cs @@ -362,6 +362,7 @@ dbCombor.Items.Add(dblist[i].title); } } + /* /// /// 从配置文件读取数据库参数配置 /// @@ -428,6 +429,8 @@ } } + * */ + /* /// /// 向配置文件写入连接数据库的参数配置 /// @@ -485,6 +488,7 @@ MessageBox.Show(exp.ToString()); } } + * */ /// /// /// diff --git a/FrmDatabaseParaSetting.cs b/FrmDatabaseParaSetting.cs index a6fea46..63b596b 100644 --- a/FrmDatabaseParaSetting.cs +++ b/FrmDatabaseParaSetting.cs @@ -152,6 +152,7 @@ this.DialogResult = DialogResult.OK; this.Close(); } + /* /// /// 从配置文件读取数据库连接参数配置 /// @@ -218,6 +219,8 @@ } } + * */ + /* /// /// 向配置文件写入数据库参数配置 /// @@ -276,7 +279,7 @@ MessageBox.Show(ex.ToString()); } } - + */ /// /// 取消按钮事件处理 /// diff --git a/FrmDatabaseParaSetting2.cs b/FrmDatabaseParaSetting2.cs index 932d05e..96a87d5 100644 --- a/FrmDatabaseParaSetting2.cs +++ b/FrmDatabaseParaSetting2.cs @@ -148,6 +148,7 @@ this.DialogResult = DialogResult.OK; this.Close(); } + /* /// /// 从配置文件读取数据库连接参数配置 /// @@ -214,6 +215,8 @@ } } + * */ + /* /// /// 向配置文件写入数据库参数配置 /// @@ -272,7 +275,7 @@ MessageBox.Show(exp.ToString()); } } - + */ /// /// 取消按钮事件处理 /// diff --git a/FrmDiameterQuery.cs b/FrmDiameterQuery.cs index 68c948b..9a5215b 100644 --- a/FrmDiameterQuery.cs +++ b/FrmDiameterQuery.cs @@ -77,18 +77,7 @@ isBetween = true; } } - /// - /// 键盘按键按下事件处理 - /// - /// - /// - private void textBoxX1_KeyPress(object sender, KeyPressEventArgs e) - { - if ((e.KeyChar < 48 || e.KeyChar > 57) && e.KeyChar != 8) - { - e.Handled = true;//屏蔽 - } - } + bool isBetween = false; /// diff --git a/FrmDocumentEdit.cs b/FrmDocumentEdit.cs index aab2d31..e78a7ff 100644 --- a/FrmDocumentEdit.cs +++ b/FrmDocumentEdit.cs @@ -256,121 +256,6 @@ } - // - /// 将本地文件上传到指定的服务器(HttpWebRequest方法) - /// - /// 文件上传到的服务器 - /// 要上传的本地文件(全路径) - /// 文件上传后的名称 - /// 上传进度条 - /// 成功返回1,失败返回0 - private int Upload_Request(string address, string fileNamePath, string saveName, ProgressBar progressBar) - { - int returnValue = 0; - // 要上传的文件 - FileStream fs = new FileStream(fileNamePath, FileMode.Open, FileAccess.Read); - BinaryReader r = new BinaryReader(fs); - //时间戳 - string strBoundary = "----------" + DateTime.Now.Ticks.ToString("x"); - byte[] boundaryBytes = Encoding.ASCII.GetBytes("/r/n--" + strBoundary + "/r/n"); - //请求头部信息 - StringBuilder sb = new StringBuilder(); - sb.Append("--"); - sb.Append(strBoundary); - sb.Append("\r\n"); - sb.Append("Content-Disposition: form-data; name=\""); - sb.Append("file"); - sb.Append("\"; filename=\""); - sb.Append(saveName); - sb.Append("\""); - sb.Append("\r\n"); - sb.Append("Content-Type: "); - sb.Append("application/octet-stream"); - sb.Append("\r\n"); - sb.Append("\r\n"); - string strPostHeader = sb.ToString(); - byte[] postHeaderBytes = Encoding.UTF8.GetBytes(strPostHeader); - // 根据uri创建HttpWebRequest对象 - HttpWebRequest httpReq = (HttpWebRequest)WebRequest.Create(new Uri(address)); - httpReq.Method = "POST"; - //对发送的数据不使用缓存 - httpReq.AllowWriteStreamBuffering = false; - //设置获得响应的超时时间(300秒) - httpReq.Timeout = 300000; - httpReq.ContentType = "multipart/form-data; boundary=" + strBoundary; - long length = fs.Length + postHeaderBytes.Length + boundaryBytes.Length; - long fileLength = fs.Length; - httpReq.ContentLength = length; - try - { - progressBar.Maximum = int.MaxValue; - progressBar.Minimum = 0; - progressBar.Value = 0; - //每次上传4k - int bufferLength = 4096; - byte[] buffer = new byte[bufferLength]; - //已上传的字节数 - long offset = 0; - //开始上传时间 - DateTime startTime = DateTime.Now; - int size = r.Read(buffer, 0, bufferLength); - Stream postStream = httpReq.GetRequestStream(); - //发送请求头部消息 - postStream.Write(postHeaderBytes, 0, postHeaderBytes.Length); - while (size > 0) - { - postStream.Write(buffer, 0, size); - offset += size; - progressBar.Value = (int)(offset * (int.MaxValue / length)); - TimeSpan span = DateTime.Now - startTime; - double second = span.TotalSeconds; - //lblTime.Text = "已用时:" + second.ToString("F2") + "秒"; - //if (second > 0.001) - //{ - // lblSpeed.Text = " 平均速度:" + (offset / 1024 / second).ToString("0.00") + "KB/秒"; - //} - //else - //{ - // lblSpeed.Text = " 正在连接…"; - //} - //lblState.Text = "已上传:" + (offset * 100.0 / length).ToString("F2") + "%"; - //lblSize.Text = (offset / 1048576.0).ToString("F2") + "M/" + (fileLength / 1048576.0).ToString("F2") + "M"; - Application.DoEvents(); - size = r.Read(buffer, 0, bufferLength); - } - //添加尾部的时间戳 - postStream.Write(boundaryBytes, 0, boundaryBytes.Length); - postStream.Close(); - //获取服务器端的响应 - WebResponse webRespon = httpReq.GetResponse(); - Stream s = webRespon.GetResponseStream(); - StreamReader sr = new StreamReader(s); - //读取服务器端返回的消息 - String sReturnString = sr.ReadLine(); - s.Close(); - sr.Close(); - if (sReturnString == "Success") - { - returnValue = 1; - } - else if (sReturnString == "Error") - { - returnValue = 0; - } - } - catch(Exception ex) - { - returnValue = 0; - string str = ex.ToString(); - } - finally - { - fs.Close(); - r.Close(); - } - return returnValue; - } - private void btn_file_Click(object sender, EventArgs e) { OpenFileDialog dlg = new OpenFileDialog(); diff --git a/FrmExportCADS.cs b/FrmExportCADS.cs index 98772ea..59629dd 100644 --- a/FrmExportCADS.cs +++ b/FrmExportCADS.cs @@ -108,65 +108,6 @@ MessageBox.Show("请选中要导出的图层!", "提示", MessageBoxButtons.OK, MessageBoxIcon.Warning); } } - private Boolean MerageToFile(GSOFeatures features, String strDestFile, String strProj4)//图层追加 - { - if (features == null) - { - return false; - } - Boolean bSuccess = false; - - string strDir = GSOUtility.GetFileDir(strDestFile); - string strLPRJFile = GSOUtility.ChangeExt(strDestFile, ".lprj"); - string strExt = GSOUtility.GetFileExt(strDestFile); - - // 如果投影文件存在,投影以投影文件为准 - if (File.Exists(strLPRJFile)) - { - // 如果是dxf,则这样处理 - if (strExt.ToLower() == ".dxf") - { - string strTempSrcFile = strDir + "srcFeatures_dxftmp" + strExt; - globeControl1.Globe.DataManager.SaveFeatureData(features, strTempSrcFile, strLPRJFile, 4); - bSuccess = GSOUtility.MergeTwoDXFFileFeatures(strDestFile, strTempSrcFile); - File.Delete(strTempSrcFile); - } - else - { - GSOFeatures srcFeatures = globeControl1.Globe.DataManager.ReadFeatureData(strDestFile); - int nCount = features.Length; - int i = 0; - for (i = 0; i < nCount; i++) - { - srcFeatures.Add(features[i]); - } - bSuccess = globeControl1.Globe.DataManager.SaveFeatureData(srcFeatures, strDestFile, strLPRJFile, 4); - } - } - else - { - // 如果是dxf,则这样处理 - if (strExt.ToLower() == ".dxf") - { - string strTempSrcFile = strDir + "srcFeatures_dxftmp" + strExt; - globeControl1.Globe.DataManager.SaveFeatureData(features, strTempSrcFile, strProj4, 0); - bSuccess = GSOUtility.MergeTwoDXFFileFeatures(strDestFile, strTempSrcFile); - File.Delete(strTempSrcFile); - } - else - { - GSOFeatures srcFeatures = globeControl1.Globe.DataManager.ReadFeatureData(strDestFile); - int nCount = features.Length; - int i = 0; - for (i = 0; i < nCount; i++) - { - srcFeatures.Add(features[i]); - } - bSuccess = globeControl1.Globe.DataManager.SaveFeatureData(srcFeatures, strDestFile, strProj4, 0); - } - } - return bSuccess; - } /// /// 关闭按钮事件处理 /// diff --git a/FrmHDMAnalysis3.cs b/FrmHDMAnalysis3.cs index 4f73af6..2ada735 100644 --- a/FrmHDMAnalysis3.cs +++ b/FrmHDMAnalysis3.cs @@ -436,29 +436,6 @@ } layerTemp.RemoveAllFeature(); } - private void Export(GSOPoint3d _pnt, double r) - { - GSOPoint3ds pnts = new GSOPoint3ds(); - GSOPoint3d pnt = new GSOPoint3d(); - pnt.X = _pnt.X; - pnt.Y = _pnt.Y; - pnt.Z = _pnt.Z; - pnts.Add(pnt); - pnt.X = _pnt.X; - pnt.Y = _pnt.Y - 0.0000000005; - pnt.Z = _pnt.Z; - pnts.Add(pnt); - GSOGeoPolyline3D line = new GSOGeoPolyline3D(); - line.AddPart(pnts); - GSOGeoPolygon3D polygon = line.CreateBuffer(r * 2, true, 5, true, false); - GSOPoint3ds points = polygon[0]; - GSOGeoPolyline3D newLine = new GSOGeoPolyline3D(); - newLine.AddPart(points); - newLine.AltitudeMode = EnumAltitudeMode.RelativeToGround; - GSOFeature newFeature = new GSOFeature(); - newFeature.Geometry = newLine; - globeControl1.Globe.MemoryLayer.AddFeature(newFeature); - } private void ExportCAD(double a, double b, double r) { diff --git a/FrmHotFuncStat.cs b/FrmHotFuncStat.cs index c980f34..2eb1476 100644 --- a/FrmHotFuncStat.cs +++ b/FrmHotFuncStat.cs @@ -421,13 +421,6 @@ } } - private void HFS_Pderive_Click(object sender, EventArgs e) - { - if (TV_Files.SelectedNode != null) - { - HFSClass.GuideEdit_form("G", TV_Files, int.Parse(((ToolStripMenuItem)sender).Tag.ToString())); - } - } private void 导入ToolStripMenuItem_Click(object sender, EventArgs e) { @@ -530,22 +523,8 @@ } } - private void 导出ToolStripMenuItem1_Click(object sender, EventArgs e) - { - 导出ToolStripMenuItem2_Click(sender, e); - } + - private void TV_HFSSrchRslt_AfterCollapse(object sender, TreeViewEventArgs e) - { - e.Node.ImageIndex = 0; - } - - private void TV_HFSSrchRslt_AfterExpand(object sender, TreeViewEventArgs e) - { - HFSClass.ADD_TreeNode(TV_Files, e.Node); - e.Node.ImageIndex = 1; - } - private void 导出ToolStripMenuItem1_Click_1(object sender, EventArgs e) { if ((TV_HFSSrchRslt.SelectedNode != null) && (TV_HFSSrchRslt.SelectedNode.Parent != null)) diff --git a/FrmLayerControl.cs b/FrmLayerControl.cs index e7917c3..28fa14d 100644 --- a/FrmLayerControl.cs +++ b/FrmLayerControl.cs @@ -312,26 +312,7 @@ layerManagerNode.Expand(); terrainManagerNode.Expand(); } - /// - /// 刷新节点树 - /// - private void RefreshDataTree() - { - layerTree2.Nodes[0].Nodes.Clear(); - Int32 nCount = globeControl2.Globe.Layers.Count; - Int32 i = 0; - for (i = 0; i < nCount; i++) - { - GSODataset dataSpace = globeControl2.Globe.Layers[i].Dataset; - TreeNode node = new TreeNode(); - node.Text = dataSpace.Name; - node.ImageIndex = 0; - node.SelectedImageIndex = 0; - node.Checked = true; - node.Tag = dataSpace; - layerTree2.Nodes[0].Nodes.Add(node); - } - } + /// /// 目标图层按钮事件处理 /// @@ -494,22 +475,8 @@ } } } - /// - /// 改变指定节点的选中状态 - /// - /// - /// - private void CheckTreeNode(TreeNode node, Boolean bChecked) - { - CheckChildTreeNode(node, bChecked); - // 对于kml图层,如果当前处理的节点是true,那么要把所有的祖宗节点置为true - // 只有所有节点都未false,那么这个节点才为false - // CheckFatherTreeNode(node, bChecked); - globeControl1.Globe.Refresh(); - globeControl2.Globe.Refresh(); - - } + private void CheckChildTreeNode(TreeNode node, Boolean bChecked) { if (node == null) @@ -696,59 +663,7 @@ //} //CheckControl(e); } - /// - /// 树节点选中方法 - /// - /// - private void CheckControl(TreeViewEventArgs e) - { - if (e.Action != TreeViewAction.Unknown) - { - if (e.Node != null && !Convert.IsDBNull(e.Node)) - { - CheckParentNode(e.Node); - if (e.Node.Nodes.Count > 0) - { - CheckAllChildNodes(e.Node, e.Node.Checked); - } - } - } - } - /// - /// 改变所有子节点的状态 - /// - /// - /// - private void CheckAllChildNodes(TreeNode pn, bool IsChecked) - { - foreach (TreeNode tn in pn.Nodes) - { - tn.Checked = IsChecked; - if (tn.Tag.ToString().Contains("|")) - { - string nodeTag = tn.Tag.ToString().Split('|')[1]; - GSOLayer layer = globeControl1.Globe.Layers.GetLayerByCaption(nodeTag); - if (layer != null) - { - layer.Visible = IsChecked; - globeControl1.Globe.Refresh(); - } - } - if (tn.Tag is GSOFeature) - { - if (tn.Nodes.Count == 0) - { - GSOFeature feat = tn.Tag as GSOFeature; - feat.Visible = IsChecked; - globeControl1.Globe.Refresh(); - } - } - if (tn.Nodes.Count > 0) - { - CheckAllChildNodes(tn, IsChecked); - } - } - } + /// /// 改变父节点的选中状态,此处为所有子节点不选中时才取消父节点选中,可以根据需要修改 /// diff --git a/FrmLogin.cs b/FrmLogin.cs index 320fdd5..2afe46e 100644 --- a/FrmLogin.cs +++ b/FrmLogin.cs @@ -59,70 +59,6 @@ textBoxPassWord.Clear(); } } - - /// - /// 验证端口号 - /// - /// - private bool ValiPort() - { - Ping p = new Ping();//创建Ping对象p - PingReply pr = p.Send(Utility.localicenseserverip);//向指定IP或者主机名的计算机发送ICMP协议的ping数据包 - if (pr.Status == IPStatus.Success)//如果ping成功 - { - try - { - TcpClient tcpc = new TcpClient(Utility.localicenseserverip, Utility.localicenseserverport);//对IP地址为"192.168.0.105"的计算机的1500端口提出连接申请 - tcpc.Close(); - return true; - } - catch (Exception ex) - { - MessageBox.Show("端口连接错误!" + ex.Message); - return false; - } - } - else - { - int times = 0;//重新连接次数; - int count = 2;//设置尝试次数 - while (times < count) - { - //Thread.Sleep(1000);//等待时间(方便测试的话,你可以改为1000) - pr = p.Send(Utility.localicenseserverip); - - if (pr.Status == IPStatus.Success) - { - try - { - TcpClient tcpc = new TcpClient(Utility.localicenseserverip, Utility.localicenseserverport);//对IP地址为"192.168.0.105"的计算机的1500端口提出连接申请 - tcpc.Close(); - return true; - } - catch (Exception ex) - { - MessageBox.Show("端口连接错误!" + ex.Message); - return false; - } - } - else - { - times++; - if (times < count) - { - continue; - } - else - { - MessageBox.Show("重新尝试连接失败"); - return false; - } - } - - } - return false; - } - } /// /// 验证用户名、密码 /// diff --git a/FrmMetadata.cs b/FrmMetadata.cs index 886f65a..0365372 100644 --- a/FrmMetadata.cs +++ b/FrmMetadata.cs @@ -27,11 +27,7 @@ InitializeComponent(); loadTreeView(layerTree); } - private void FrmMetadata_Load(object sender, EventArgs e) - { - //this.ntLblC.Text = "nn"; - // loadTreeView(layerTree); - } + private void loadTreeView(TreeView tv)//构建图层树 { try diff --git a/FrmMetadataStat.cs b/FrmMetadataStat.cs index 790658a..e7696c6 100644 --- a/FrmMetadataStat.cs +++ b/FrmMetadataStat.cs @@ -197,9 +197,5 @@ } } - private void buttonX1_Click(object sender, EventArgs e) - { - drawChart(); - } } } diff --git a/FrmPatrolerManager.cs b/FrmPatrolerManager.cs index 37f8ffd..9e66aeb 100644 --- a/FrmPatrolerManager.cs +++ b/FrmPatrolerManager.cs @@ -109,82 +109,8 @@ this.winGridViewPager1.AllToExport = table; } - /// - /// 编辑 - /// - /// - /// - private void winGridViewPager1_OnEditSelected(object sender, EventArgs e) - { - - DataGridView grid = sender as DataGridView; - if (grid != null && grid.SelectedRows.Count>0) - { - DataGridViewRow row = grid.SelectedRows[0]; - try - { - long dbid = long.Parse(row.Cells["编号"].Value.ToString()); - String name = row.Cells["姓名"].Value.ToString(); - String sex = row.Cells["性别"].Value.ToString(); - String age = row.Cells["年龄"].Value.ToString(); - string phone = row.Cells["电话"].Value.ToString(); - age = String.IsNullOrEmpty(age.ToString().Trim()) ? "1" : age.ToString().Trim(); - FrmPatrolerEdit frm = new FrmPatrolerEdit(dbid.ToString(), name, age, sex, phone); - frm.reloadGrid += new ReloadPatrolerGrid(LoadData); - frm.ShowDialog(); - winGridViewPager1.Refresh(); - } - catch (Exception ex) - { - MessageBox.Show("编辑失败:" + ex.ToString(), "错误", MessageBoxButtons.OK, MessageBoxIcon.Error); - } - } - else - { - MessageBox.Show("没有选择记录", "提示"); - } - - } - - /// - /// 删除 - /// - /// - /// - private void winGridViewPager1_OnDeleteSelected(object sender, EventArgs e) - { - DataGridView grid = sender as DataGridView; - if (grid != null && grid.SelectedRows.Count > 0) - { - DataGridViewRow row = grid.SelectedRows[0]; - long dbid = long.Parse(row.Cells["编号"].Value.ToString()); - try - { - string state = row.Cells["状态"].Value.ToString(); - if ("在线".Equals(state)) - { - if (MessageBox.Show("确定注销?", "确认", MessageBoxButtons.YesNo, MessageBoxIcon.Question) == DialogResult.Yes) - { - String sql = "update patroler t set t.accountstate='LEAVER' where t.dbid=" + dbid; - OracleUtils.ExecuteNonQuery(OracleUtils.ConnectionString, CommandType.Text, sql); - } - } - else { - MessageBox.Show("人员不在线,无法注销", "信息"); - } - } - catch (Exception ex) - { - MessageBox.Show("人员注销失败:" + ex.ToString(), "错误", MessageBoxButtons.OK, MessageBoxIcon.Error); - } - } - else - { - MessageBox.Show("没有选择记录", "提示"); - } - } - - + + private void LoadData() { int pageIndex = winGridViewPager1.PagerInfo.CurrenetPageIndex; diff --git a/FrmRoadHDM.cs b/FrmRoadHDM.cs index e765313..e871dd5 100644 --- a/FrmRoadHDM.cs +++ b/FrmRoadHDM.cs @@ -333,31 +333,6 @@ this.Cursor = Cursors.Default; } } - - private void Export(GSOPoint3d _pnt, double r) - { - GSOPoint3ds pnts = new GSOPoint3ds(); - GSOPoint3d pnt = new GSOPoint3d(); - pnt.X = _pnt.X; - pnt.Y = _pnt.Y; - pnt.Z = _pnt.Z; - pnts.Add(pnt); - pnt.X = _pnt.X; - pnt.Y = _pnt.Y - 0.0000000005; - pnt.Z = _pnt.Z; - pnts.Add(pnt); - GSOGeoPolyline3D line = new GSOGeoPolyline3D(); - line.AddPart(pnts); - GSOGeoPolygon3D polygon = line.CreateBuffer(r * 2, true, 5, true, false); - GSOPoint3ds points = polygon[0]; - GSOGeoPolyline3D newLine = new GSOGeoPolyline3D(); - newLine.AddPart(points); - newLine.AltitudeMode = EnumAltitudeMode.RelativeToGround; - GSOFeature newFeature = new GSOFeature(); - newFeature.Geometry = newLine; - globeControl1.Globe.MemoryLayer.AddFeature(newFeature); - } - private void ExportCAD(double a, double b, double r) { GSOPoint3ds pnts = new GSOPoint3ds(); diff --git a/Cyberpipe.csproj b/Cyberpipe.csproj index 07a8c1a..e3cd12c 100644 --- a/Cyberpipe.csproj +++ b/Cyberpipe.csproj @@ -204,25 +204,6 @@ - - Form - - - F_GKT1数据输入输出.cs - - - Form - - - F_GKT1添加文件.cs - - - Form - - - F_GKT1添加项目.cs - - Form @@ -1068,18 +1049,6 @@ Frm_password_reset.cs - - Form - - - GKT.cs - - - Form - - - GKT1.cs - Form @@ -1258,12 +1227,6 @@ F_Projedit.cs - - Form - - - PED.cs - Form @@ -1331,16 +1294,6 @@ True Reference.map - - F_GKT1数据输入输出.cs - Designer - - - F_GKT1添加文件.cs - - - F_GKT1添加项目.cs - Form_EditTask.cs @@ -1836,12 +1789,6 @@ Frm_password_reset.cs - - GKT.cs - - - GKT1.cs - F_GKT数据输入输出.cs @@ -1934,9 +1881,6 @@ F_Projedit.cs - - PED.cs - F_数据输入输出.cs diff --git a/Cyberpipe.suo b/Cyberpipe.suo index 68ced4f..a1aecf8 100644 --- a/Cyberpipe.suo +++ b/Cyberpipe.suo Binary files differ diff --git a/EMS_Forms/Form_EditTask.cs b/EMS_Forms/Form_EditTask.cs index 718992f..f1d791f 100644 --- a/EMS_Forms/Form_EditTask.cs +++ b/EMS_Forms/Form_EditTask.cs @@ -119,7 +119,8 @@ String name = Convert.ToString(dr["USERNAME"]); comboBox_userName.Items.Add(name); - } + } + dr.Close(); comboBox_road.Items.Clear(); roadList = new List(); @@ -135,7 +136,7 @@ comboBox_road.Items.Add(name); } } - + dr1.Close(); conn.Close(); bool flag2 = false; @@ -185,7 +186,7 @@ catch (Exception ex) { - MessageBox.Show(ex.ToString()); + LogHelper.WriteLog(typeof(Form_EditTask), ex.Message); } } @@ -288,7 +289,7 @@ } catch (Exception ex) { - MessageBox.Show(ex.ToString()); + LogHelper.WriteLog(typeof(Form_EditTask), ex.Message); } } @@ -474,7 +475,7 @@ } catch (Exception ex) { - MessageBox.Show(ex.ToString()); + LogHelper.WriteLog(typeof(Form_EditTask), ex.Message); } this.Close(); @@ -495,6 +496,7 @@ { numList.Add(Convert.ToInt32(dr["DBID"])); } + dr.Close(); if (numList.Count == 0) { taskNumber = Convert.ToInt32(number) * 100; @@ -674,6 +676,7 @@ } } } + dr.Close(); conn.Close(); } diff --git a/EMS_Forms/Form_EventManager.cs b/EMS_Forms/Form_EventManager.cs index b18c45b..84807b2 100644 --- a/EMS_Forms/Form_EventManager.cs +++ b/EMS_Forms/Form_EventManager.cs @@ -64,6 +64,7 @@ comboBox_name.Items.Add(name); } + dr.Close(); conn.Close(); diff --git a/Forms/FrmMnModify.cs b/Forms/FrmMnModify.cs index 31cfc5f..d036360 100644 --- a/Forms/FrmMnModify.cs +++ b/Forms/FrmMnModify.cs @@ -68,15 +68,7 @@ questionGrid.Rows[idx].Cells[1].Value = sr.question; } } - /// 选中对象 - /// - /// - /// - /// - private void buttonX1_Click(object sender, EventArgs e) - { - globecontrol.Globe.Action = EnumAction3D.SelectObject; - } + /// /// 选中某一行 /// diff --git a/Forms/FrmPipelineModelDataBase.cs b/Forms/FrmPipelineModelDataBase.cs index 2acf0ca..7ce573f 100644 --- a/Forms/FrmPipelineModelDataBase.cs +++ b/Forms/FrmPipelineModelDataBase.cs @@ -35,19 +35,7 @@ ds = _ds; InitializeComponent(); } - /// - /// 单击选择shp格式文件 - /// - /// - /// - private void btnBrowseModel_Click(object sender, EventArgs e) - { - saveFileDialog1.Filter = "*.lgd|*.lgd"; - if (saveFileDialog1.ShowDialog() == DialogResult.OK) - { - txtModelLayer.Text = saveFileDialog1.FileName; - } - } + /// /// 窗体初始化事件处理 /// @@ -100,49 +88,6 @@ } } } - - private object convertFieldValue(string fieldname, object obj) - { - if (obj == null) - return null; - - try - { - string type = fields_types[fieldname].ToString(); - switch (type) - { - case "string": - return obj.ToString(); - case "int": - //return 101; - int intResult; - if (int.TryParse(obj.ToString(), out intResult)) - return intResult; - else - return null; - case "double": - //return 202.5; - double doubleResult; - if (double.TryParse(obj.ToString(), out doubleResult)) - return doubleResult; - else - return null; - case "date": - DateTime dtResult; - if (DateTime.TryParse(obj.ToString(), out dtResult)) - return dtResult; - else - return null; - } - return null; - } - catch (Exception ex) - { - MessageBox.Show(ex.ToString()); - return null; - } - } - public string lgdFilePath = ""; /// /// 选择管线颜色 @@ -610,33 +555,6 @@ { this.Close(); } - - private void cmbLayer_SelectedIndexChanged(object sender, EventArgs e) //选择图层 - { - GSOLayer layer = ctl.Globe.Layers.GetLayerByCaption(selectLayerName); - GSOFeatures features = layer.GetAllFeatures(); - if (features.Length == 0) - return; - - cmbFrom.Items.Clear(); - cmbTo.Items.Clear(); - cmbRadius.Items.Clear(); - cmbID.Items.Clear(); - for (int i = 0; i < features[0].GetFieldCount(); i++) - { - GeoScene.Data.GSOFieldDefn fielddef = (GeoScene.Data.GSOFieldDefn)(features[0].GetFieldDefn(i)); - - cmbFrom.Items.Add(fielddef.Name); - cmbTo.Items.Add(fielddef.Name); - cmbRadius.Items.Add(fielddef.Name); - cmbID.Items.Add(fielddef.Name); - } - cmbFrom.SelectedItem = "Deep1"; - cmbTo.SelectedItem = "Deep2"; - cmbRadius.SelectedItem = "Diameter"; - cmbID.SelectedItem = "Handle"; - } - private void buttonXLayerPath_Click(object sender, EventArgs e)//单击 选择shp格式的文件 { OpenFileDialog dlg = new OpenFileDialog(); diff --git a/Forms/FrmPipelineModelDataOneStep.cs b/Forms/FrmPipelineModelDataOneStep.cs index 18afda7..ec93b8a 100644 --- a/Forms/FrmPipelineModelDataOneStep.cs +++ b/Forms/FrmPipelineModelDataOneStep.cs @@ -38,19 +38,7 @@ layerTree = _layerTree; InitializeComponent(); } - /// - /// 单击选择shp格式文件 - /// - /// - /// - private void btnBrowseModel_Click(object sender, EventArgs e) - { - saveFileDialog1.Filter = "*.lgd|*.lgd"; - if (saveFileDialog1.ShowDialog() == DialogResult.OK) - { - txtModelLayer.Text = saveFileDialog1.FileName; - } - } + /// /// 窗体初始化事件处理 /// @@ -107,48 +95,7 @@ } } - private object convertFieldValue(string fieldname, object obj) - { - if (obj == null) - return null; - - try - { - string type = fields_types[fieldname].ToString(); - switch (type) - { - case "string": - return obj.ToString(); - case "int": - //return 101; - int intResult; - if (int.TryParse(obj.ToString(), out intResult)) - return intResult; - else - return null; - case "double": - //return 202.5; - double doubleResult; - if (double.TryParse(obj.ToString(), out doubleResult)) - return doubleResult; - else - return null; - case "date": - DateTime dtResult; - if (DateTime.TryParse(obj.ToString(), out dtResult)) - return dtResult; - else - return null; - } - return null; - } - catch (Exception ex) - { - MessageBox.Show(ex.ToString()); - return null; - } - } - + public string lgdFilePath = ""; /// /// 选择管线颜色 @@ -673,32 +620,6 @@ return featDs; } - private void cmbLayer_SelectedIndexChanged(object sender, EventArgs e) //选择图层 - { - GSOLayer layer = ctl.Globe.Layers.GetLayerByCaption(selectLayerName); - GSOFeatures features = layer.GetAllFeatures(); - if (features.Length == 0) - return; - - cmbFrom.Items.Clear(); - cmbTo.Items.Clear(); - cmbRadius.Items.Clear(); - cmbID.Items.Clear(); - for (int i = 0; i < features[0].GetFieldCount(); i++) - { - GeoScene.Data.GSOFieldDefn fielddef = (GeoScene.Data.GSOFieldDefn)(features[0].GetFieldDefn(i)); - - cmbFrom.Items.Add(fielddef.Name); - cmbTo.Items.Add(fielddef.Name); - cmbRadius.Items.Add(fielddef.Name); - cmbID.Items.Add(fielddef.Name); - } - cmbFrom.SelectedItem = "Deep1"; - cmbTo.SelectedItem = "Deep2"; - cmbRadius.SelectedItem = "Diameter"; - cmbID.SelectedItem = "Handle"; - } - private void buttonXLayerPath_Click(object sender, EventArgs e)//单击 选择shp格式的文件 { OpenFileDialog dlg = new OpenFileDialog(); @@ -949,38 +870,6 @@ } //txtLayername.Text = type + layername; } - /// - /// 连接数据库 - /// - /// - /// - private void buttonX1_Click(object sender, EventArgs e) - { - if (ds == null) - { - //没连的话,直接连接审核库; //审核库配置读配置文件 - string dbIp = Utility.sgdbip; - string database = Utility.sgdbname; - string user = Utility.sgdbuser; - string pass = Utility.sgdbpwd; - - if (!Utility.isNetworkConnectionSuccess(dbIp.Trim())) - { - MessageBox.Show("网络连接失败!", "提示"); - return; - } - - ds = ctl.Globe.DataManager.OpenOracleDataSource(dbIp + "/" + database, "", "", user, pass); - if (ds == null) - { - MessageBox.Show("数据库连接失败!", "提示", MessageBoxButtons.OK, MessageBoxIcon.Warning); - } - else - { - btnCreateModel.Enabled = true; - } - } - } private void btnClose_Click(object sender, EventArgs e) { diff --git a/Forms/FrmShRK.cs b/Forms/FrmShRK.cs index 0e2e722..f1d83cb 100644 --- a/Forms/FrmShRK.cs +++ b/Forms/FrmShRK.cs @@ -215,6 +215,7 @@ { sourcefeatds = sourcefeat as GSOFeatureDataset; } + if (sourcefeatds == null) return; sourcefeatds.Open(); GSOFeatures sourcefeatures = sourcefeatds.GetAllFeatures(); @@ -251,6 +252,7 @@ { desfeatds = desfeat as GSOFeatureDataset; } + if (desfeatds == null) return; desfeatds.Open(); //向新数据集写入字段 diff --git a/FrmAccessoriesSensor.cs b/FrmAccessoriesSensor.cs index 09fcdf1..2a7a80e 100644 --- a/FrmAccessoriesSensor.cs +++ b/FrmAccessoriesSensor.cs @@ -209,7 +209,7 @@ chart1.Series[0].Points.DataBindXY(dic.Keys, dic.Values); for (int m = 0; m < dic.Values.Count; m++) { - if (chart1.Series[0].Points[m].YValues[0].ToString() != "0") + if (chart1.Series[0].Points[m]!=null&&chart1.Series[0].Points[m].YValues[0].ToString() != "0") { chart1.Series[0].Points[m].Label = chart1.Series[0].Points[m].YValues[0].ToString(); } diff --git a/FrmAccessoriesgather.cs b/FrmAccessoriesgather.cs index 9e331e1..a475d9e 100644 --- a/FrmAccessoriesgather.cs +++ b/FrmAccessoriesgather.cs @@ -338,7 +338,7 @@ chart1.Series[0].Points.DataBindXY(dic.Keys, dic.Values); for (int m = 0; m < dic.Values.Count; m++) { - if (chart1.Series[0].Points[m].YValues[0].ToString() != "0") + if (chart1.Series[0].Points[m]!=null&&chart1.Series[0].Points[m].YValues[0].ToString() != "0") { chart1.Series[0].Points[m].Label = chart1.Series[0].Points[m].YValues[0].ToString(); } diff --git a/FrmAccessoryAnalysis.cs b/FrmAccessoryAnalysis.cs index 71d4579..44d4065 100644 --- a/FrmAccessoryAnalysis.cs +++ b/FrmAccessoryAnalysis.cs @@ -66,39 +66,6 @@ globeControl1.Refresh(); } /// - /// 键盘按键按下事件处理 - /// - /// - /// - private void txtRadius_KeyPress(object sender, KeyPressEventArgs e) - { - TextBox text = sender as TextBox; - if ((e.KeyChar < 48 || e.KeyChar > 57) && (e.KeyChar != 8) && (int)e.KeyChar != 46) - { - e.Handled = true; - } - if ((int)e.KeyChar == 46) //小数点 - { - if (text.Text.Length <= 0) - e.Handled = true; //小数点不能在第一位 - else //处理不规则的小数点 - { - float f; - float oldf; - bool b1 = false, b2 = false; - b1 = float.TryParse(text.Text, out oldf); - b2 = float.TryParse(text.Text + e.KeyChar.ToString(), out f); - if (b2 == false) - { - if (b1 == true) - e.Handled = true; - else - e.Handled = false; - } - } - } - } - /// /// 确定按钮事件处理 /// /// diff --git a/FrmAddValve.cs b/FrmAddValve.cs index 34d2fec..5f405b9 100644 --- a/FrmAddValve.cs +++ b/FrmAddValve.cs @@ -486,56 +486,6 @@ } } - - - - - - - - private void cmbLayer_SelectedIndexChanged(object sender, EventArgs e) - { - GSOLayer layer = globeControl1.Globe.Layers.GetLayerByCaption(selectLayerName); - GSOFeatures features = layer.GetAllFeatures(); - if (features.Length == 0) - return; - - combPath.Items.Clear(); - combZ.Items.Clear(); - combModelName.Items.Clear(); - - for (int i = 0; i < features[0].GetFieldCount(); i++) - { - GeoScene.Data.GSOFieldDefn fielddef = (GeoScene.Data.GSOFieldDefn)(features[0].GetFieldDefn(i)); - combPath.Items.Add(fielddef.Name); - combZ.Items.Add(fielddef.Name); - combModelName.Items.Add(fielddef.Name); - } - combModelName.SelectedItem = "编号"; - combPath.SelectedItem = "模型路径"; - if (combfile.SelectedIndex != -1) - { - - string layerCaption = combfile.SelectedItem.ToString().Trim(); - rukuLayer = globeControl1.Globe.Layers.GetLayerByCaption(layerCaption); - if (rukuLayer != null) - { - combPath.Items.Clear(); - combZ.Items.Clear(); - combModelName.Items.Clear(); - - } - for (int i = 0; i < features[0].GetFieldCount(); i++) - { - GeoScene.Data.GSOFieldDefn fielddef = (GeoScene.Data.GSOFieldDefn)(features[0].GetFieldDefn(i)); - combPath.Items.Add(fielddef.Name); - combZ.Items.Add(fielddef.Name); - combModelName.Items.Add(fielddef.Name); - } - combModelName.SelectedItem = "编号"; - combPath.SelectedItem = "模型路径"; - } - } /// /// 单击选择shp格式文件 /// diff --git a/FrmAddWellShp.cs b/FrmAddWellShp.cs index bb79ec0..a249725 100644 --- a/FrmAddWellShp.cs +++ b/FrmAddWellShp.cs @@ -478,32 +478,6 @@ } } } - - private void cmbLayer_SelectedIndexChanged(object sender, EventArgs e) - { - GSOLayer layer = globeControl1.Globe.Layers.GetLayerByCaption(selectLayerName); - GSOFeatures features = layer.GetAllFeatures(); - if (features.Length == 0) - return; - - combCode.Items.Clear(); - combDeep.Items.Clear(); - combModelName.Items.Clear(); - combAngle.Items.Clear(); - - for (int i = 0; i < features[0].GetFieldCount(); i++) - { - GeoScene.Data.GSOFieldDefn fielddef = (GeoScene.Data.GSOFieldDefn)(features[0].GetFieldDefn(i)); - combCode.Items.Add(fielddef.Name); - combDeep.Items.Add(fielddef.Name); - combModelName.Items.Add(fielddef.Name); - combAngle.Items.Add(fielddef.Name); - } - combCode.SelectedItem = "附属物编码"; - combDeep.SelectedItem = "井深"; - combModelName.SelectedItem = "编号"; - combAngle.SelectedItem = "符号角度"; - } /// /// 单击选择shp格式文件 /// diff --git a/FrmAddYuBiZiShp.cs b/FrmAddYuBiZiShp.cs index b312d51..332f037 100644 --- a/FrmAddYuBiZiShp.cs +++ b/FrmAddYuBiZiShp.cs @@ -383,80 +383,7 @@ } } - private void cmbLayer_SelectedIndexChanged(object sender, EventArgs e) - { - GSOLayer layer = globeControl1.Globe.Layers.GetLayerByCaption(selectLayerName); - GSOFeatures features = layer.GetAllFeatures(); - if (features.Length == 0) - return; - - combCode.Items.Clear(); - combDeep.Items.Clear(); - combModelName.Items.Clear(); - //comboLoad.Items.Clear(); - for (int i = 0; i < features[0].GetFieldCount(); i++) - { - GeoScene.Data.GSOFieldDefn fielddef = (GeoScene.Data.GSOFieldDefn)(features[0].GetFieldDefn(i)); - combCode.Items.Add(fielddef.Name); - combDeep.Items.Add(fielddef.Name); - combModelName.Items.Add(fielddef.Name); - //comboLoad.Items.Add(fielddef.Name); - } - combCode.SelectedItem = "附属物编码"; - combDeep.SelectedItem = "Z坐标"; - combModelName.SelectedItem = "编号"; - //comboLoad.SelectedItem = "模型路径"; - } - - private void buttonXLayerPath_Click(object sender, EventArgs e) - { - OpenFileDialog dlg = new OpenFileDialog(); - dlg.Filter = "*.shp|*.shp"; - dlg.Multiselect = false; - if (dlg.ShowDialog() == DialogResult.OK) - { - GSOLayer layer = globeControl1.Globe.Layers.Add(dlg.FileName); - string txtMessage = valiYBdata(layer); - if (txtMessage != "") - { - button3.Enabled = false; - //textBoxLayer.Text = ""; - combCode.Items.Clear(); - combDeep.Items.Clear(); - combModelName.Items.Clear(); - globeControl1.Globe.Layers.Remove(layer); - FrmValiDataShowErrorMessage showErrorMessage = new FrmValiDataShowErrorMessage(dlg.FileName, txtMessage); - showErrorMessage.ShowDialog(); - return; - } - else - { - button3.Enabled = true; - //textBoxLayer.Text = dlg.FileName; - selectLayerName = layer.Caption; - txtLayerName.Text = layer.Caption; - GSOFeatures features = layer.GetAllFeatures(); - if (features.Length == 0) - return; - - combCode.Items.Clear(); - combDeep.Items.Clear(); - combModelName.Items.Clear(); - for (int i = 0; i < features[0].GetFieldCount(); i++) - { - GeoScene.Data.GSOFieldDefn fielddef = (GeoScene.Data.GSOFieldDefn)(features[0].GetFieldDefn(i)); - combCode.Items.Add(fielddef.Name); - combDeep.Items.Add(fielddef.Name); - combModelName.Items.Add(fielddef.Name); - //comboLoad.Items.Add(fielddef.Name); - } - combCode.SelectedItem = "管点编码"; - combDeep.SelectedItem = "Z坐标"; - combModelName.SelectedItem = "编号"; - } - } - } - + private void FrmAddYuBiZiShp_FormClosing(object sender, FormClosingEventArgs e) { globeControl1.Globe.Refresh(); diff --git a/FrmAllPipelineStatis.cs b/FrmAllPipelineStatis.cs index 6421a26..a6eea29 100644 --- a/FrmAllPipelineStatis.cs +++ b/FrmAllPipelineStatis.cs @@ -84,7 +84,7 @@ chartAllAreaPipeline.Series["管线"].Points.DataBindXY(pipelineLengthAndType.Keys, pipelineLengthAndType.Values); for (int m = 0; m < pipelineLengthAndType.Values.Count; m++) { - if (chartAllAreaPipeline.Series["管线"].Points[m].YValues[0].ToString() != "0") + if (chartAllAreaPipeline.Series["管线"].Points[m]!=null&&chartAllAreaPipeline.Series["管线"].Points[m].YValues[0].ToString() != "0") { chartAllAreaPipeline.Series["管线"].Points[m].Label = chartAllAreaPipeline.Series[0].Points[m].YValues[0].ToString(); } @@ -94,7 +94,7 @@ } catch (Exception ex) { - //LogError.PublishError(ex); + LogHelper.WriteLog(typeof(FrmAllPipelineStatis), ex.Message); } } @@ -147,7 +147,7 @@ } DataTable dt = OledbHelper.QueryTable(sql); - if (dt != null && dt.Rows.Count > 0) + if (dt != null && dt.Rows.Count > 0 && chartAllAreaPipeline.Series["管线"].Points[indexHit]!=null) { dataGridViewX1.DataSource = dt; panel.Visible = true; diff --git a/FrmAllWorkWellStatis.cs b/FrmAllWorkWellStatis.cs index 6fec7af..6af8e4c 100644 --- a/FrmAllWorkWellStatis.cs +++ b/FrmAllWorkWellStatis.cs @@ -52,7 +52,7 @@ chartAllAreaPipeline.Series["井盖"].Points.DataBindXY(workWellLengthAndType.Keys, workWellLengthAndType.Values); for (int m = 0; m < workWellLengthAndType.Values.Count; m++) { - if (chartAllAreaPipeline.Series["井盖"].Points[m].YValues[0].ToString().Trim() != "0") + if (chartAllAreaPipeline.Series["井盖"].Points[m]!=null&&chartAllAreaPipeline.Series["井盖"].Points[m].YValues[0].ToString().Trim() != "0") { chartAllAreaPipeline.Series["井盖"].Points[m].Label = chartAllAreaPipeline.Series[0].Points[m].YValues[0].ToString(); } @@ -60,7 +60,7 @@ } catch (Exception ex) { - //LogError.PublishError(ex); + LogHelper.WriteLog(typeof(FrmAllWorkWellStatis), ex.Message); } } diff --git a/FrmBSQDuoBianXingStatis.cs b/FrmBSQDuoBianXingStatis.cs index e8b7d52..3e889b6 100644 --- a/FrmBSQDuoBianXingStatis.cs +++ b/FrmBSQDuoBianXingStatis.cs @@ -60,7 +60,7 @@ { for (int m = 0; m < bsq1.Values.Count; m++) { - if (chart1.Series["标识器"].Points[m].YValues[0].ToString() != "0") + if (chart1.Series["标识器"].Points[m]!=null&&chart1.Series["标识器"].Points[m].YValues[0].ToString() != "0") { count += Convert.ToInt16(chart1.Series[0].Points[m].YValues[0].ToString()); chart1.Series["标识器"].Points[m].Label = chart1.Series[0].Points[m].YValues[0].ToString(); diff --git a/FrmBSQDuoBianXingStreet.cs b/FrmBSQDuoBianXingStreet.cs index 2005ebb..1db5777 100644 --- a/FrmBSQDuoBianXingStreet.cs +++ b/FrmBSQDuoBianXingStreet.cs @@ -63,7 +63,7 @@ chartStatis.Series[0].Points.DataBindXY(bsq.Keys, bsq.Values); for (int m = 0; m < bsq.Values.Count; m++) { - if (chartStatis.Series[0].Points[m].YValues[0].ToString().Trim() != "0") + if (chartStatis.Series[0].Points[m]!=null&&chartStatis.Series[0].Points[m].YValues[0].ToString().Trim() != "0") { count += Convert.ToInt16(chartStatis.Series[0].Points[m].YValues[0].ToString()); chartStatis.Series[0].Points[m].Label = chartStatis.Series[0].Points[m].YValues[0].ToString(); diff --git a/FrmBSQStatis.cs b/FrmBSQStatis.cs index 390a55c..4aa0ee6 100644 --- a/FrmBSQStatis.cs +++ b/FrmBSQStatis.cs @@ -95,6 +95,8 @@ } } } + + dr.Close(); conn.Close(); for (int i = 0; i < typeLists.Count; i++) { @@ -123,7 +125,7 @@ chartStatis.Series[0].Points.DataBindXY(bsq.Keys, bsq.Values); for (int m = 0; m < bsq.Values.Count; m++) { - if (chartStatis.Series[0].Points[m].YValues[0].ToString().Trim() != "0") + if (chartStatis.Series[0].Points[m]!=null&&chartStatis.Series[0].Points[m].YValues[0].ToString().Trim() != "0") { //count += Convert.ToInt16(chartStatis.Series[0].Points[m].YValues[0].ToString()); chartStatis.Series[0].Points[m].Label = chartStatis.Series[0].Points[m].YValues[0].ToString(); diff --git a/FrmBSQStreet.cs b/FrmBSQStreet.cs index 9d88adb..7fbacad 100644 --- a/FrmBSQStreet.cs +++ b/FrmBSQStreet.cs @@ -44,7 +44,7 @@ chartStatis.Series[0].Points.DataBindXY(bsq.Keys, bsq.Values); for (int m = 0; m < bsq.Values.Count; m++) { - if (chartStatis.Series[0].Points[m].YValues[0].ToString().Trim() != "0") + if (chartStatis.Series[0].Points[m]!=null&&chartStatis.Series[0].Points[m].YValues[0].ToString().Trim() != "0") { count += Convert.ToInt16(chartStatis.Series[0].Points[m].YValues[0].ToString()); chartStatis.Series[0].Points[m].Label = chartStatis.Series[0].Points[m].YValues[0].ToString(); diff --git a/FrmBoosterValvers.cs b/FrmBoosterValvers.cs index 5061efc..df9b62b 100644 --- a/FrmBoosterValvers.cs +++ b/FrmBoosterValvers.cs @@ -236,199 +236,6 @@ count = 0; } } - /// - /// 添加火苗 - /// - /// - /// - /// - /// - private GSOFeature AddFire(double x,double y,double z) - { - // 烟火示例 - - string strResPath = Application.StartupPath + "/Resource"; - - // 烟火粒子示例,由三个发射器构成 - GSOGeoParticle geoParticle = new GSOGeoParticle(); - geoParticle.SetPosition(x, y, z); // 添加到这个经纬度位置 - geoParticle.AltitudeMode = EnumAltitudeMode.RelativeToGround; - - GSORingParticleEmitter emitter = new GSORingParticleEmitter(); - emitter.TexturePath = strResPath + "/ParticleImage/flare.png"; - - emitter.SetSizeFix(1, 1); - emitter.VelFix = 1; - emitter.VelRnd = 5; - - emitter.AngleXYFix = 0; - emitter.AngleXYRnd = 180; - - emitter.AngleXZFix = 90; - emitter.AngleXZRnd = 0; - - emitter.LifeFix = 0.5f; - emitter.LifeRnd = 0.0f; - - emitter.RotFix = 0; - emitter.RotRnd = 0; - - emitter.RotVelFix = 0; - emitter.RotVelRnd = 0; - - emitter.EmitPerSec = 100; - - // 采用线性插值生成粒子的初始颜色 - emitter.ColorRndStart = Color.White; - emitter.ColorRndEnd = Color.Red; - - - GSOColorParticleEffector effector2 = new GSOColorParticleEffector(); - effector2.SetColorChanged(0, -1, -1, 0); - effector2.StartTime = 0.0f; - effector2.EndTime = -1.0f; - emitter.AddEffector(effector2); - - // 将三个发射器添加到粒子对象中 - geoParticle.AddEmitter(emitter); - - geoParticle.Play(); - - GSOFeature feature = new GSOFeature(); - - feature.Geometry = geoParticle; - - globeControl1.Globe.MemoryLayer.AddFeature(feature); - - - return feature; - } - - /// - /// 添加喷泉 - /// - /// - private GSOFeature AddFountain() - { - string strResPath = Application.StartupPath + "/Resource"; - - GSOGeoParticle geoParticle = new GSOGeoParticle(); - geoParticle.SetPosition(116.314, 39.84, 0); // 添加到这个经纬度位置 - - GSOPointParticleEmitter emitter = new GSOPointParticleEmitter(); - emitter.TexturePath = strResPath + "/ParticleImage/test.png"; - - emitter.SetSizeFix(0.5f, 2); - emitter.VelFix = 10; - emitter.VelRnd = 2; - - emitter.GravityAcc = 9.8f; - emitter.AngleXYFix = 0; - emitter.AngleXYRnd = 180; - - emitter.AngleXZFix = 88; - emitter.AngleXZRnd = 2; - - //emitter.InnerRadius = 0; - // emitter.OuterRadius = 0.03f; - - emitter.LifeFix = 5.0f; - emitter.LifeRnd = 1.0f; - - emitter.RotFix = 0; - emitter.RotRnd = 0; - - emitter.RotVelFix = 0; - emitter.RotVelRnd = 0; - - emitter.EmitPerSec = 1000; - emitter.ColorRndStart = Color.FromArgb(33, 255, 255, 255); - emitter.ColorRndEnd = Color.FromArgb(11, 255, 255, 255); - emitter.IsLumAdded = false; - - // 将三个发射器添加到粒子对象中 - geoParticle.AddEmitter(emitter); - - geoParticle.Play(); - GSOFeature feature = new GSOFeature(); - - feature.Geometry = geoParticle; - - //globeControl1.Globe.MemoryLayer.AddFeature(feature); - globeControl1.Globe.FlyToFeature(feature); - - return feature; - } - - /// - /// 添加水柱 - /// - /// - private GSOFeature AddWaterLine() - { - string strResPath = Application.StartupPath + "/Resource"; - - GSOGeoParticle geoParticle = new GSOGeoParticle(); - geoParticle.SetPosition(116.308, 39.84, 0); // 添加到这个经纬度位置 - - GSOPointParticleEmitter emitter = new GSOPointParticleEmitter(); - - emitter.TexturePath = strResPath + "/ParticleImage/drop3.png"; - - geoParticle.TimerInterval = 1; - - emitter.SetSizeFix(2.0f, 2.0f); - - emitter.VelFix = 50; - emitter.VelRnd = 2; - - // emitter.IsLumAdded = false; - - emitter.GravityAcc = 9.8f; - emitter.AngleXYFix = 0; - emitter.AngleXYRnd = 2; - - emitter.AngleXZFix = 60; - emitter.AngleXZRnd = 2; - - //emitter.InnerRadius = 0; - // emitter.OuterRadius = 0.1f; - - emitter.LifeFix = 5.0f; - emitter.LifeRnd = 1.0f; - - emitter.RotFix = 0; - emitter.RotRnd = 0; - - emitter.RotVelFix = 0; - emitter.RotVelRnd = 0; - - emitter.EmitPerSec = 1500; - - emitter.ColorRndStart = Color.FromArgb(100, 222, 222, 222); - emitter.ColorRndEnd = Color.FromArgb(50, 222, 222, 222); - - /* - - GSOScaleParticleEffector effector1 = new GSOScaleParticleEffector(); - effector1.SetScale(0.2f, 0.2f); - effector1.StartTime = 0; - effector1.EndTime = -1; // 负数表示整个粒子生命结束 - emitter.AddEffector(effector1); - */ - - // 将三个发射器添加到粒子对象中 - geoParticle.AddEmitter(emitter); - - geoParticle.Play(); - GSOFeature feature = new GSOFeature(); - - feature.Geometry = geoParticle; - - //globeControl1.Globe.MemoryLayer.AddFeature(feature); - globeControl1.Globe.FlyToFeature(feature); - - return feature; - } + } } diff --git a/FrmBufferAnalysis.cs b/FrmBufferAnalysis.cs index f711133..db8ca59 100644 --- a/FrmBufferAnalysis.cs +++ b/FrmBufferAnalysis.cs @@ -123,39 +123,6 @@ } } /// - /// 半径文本框的键盘按键按下事件处理 - /// - /// - /// - private void txtRadius_KeyPress(object sender, KeyPressEventArgs e) - { - TextBox text = sender as TextBox; - if ((e.KeyChar < 48 || e.KeyChar > 57) && (e.KeyChar != 8) && (int)e.KeyChar != 46) - { - e.Handled = true; - } - if ((int)e.KeyChar == 46) //小数点 - { - if (text.Text.Length <= 0) - e.Handled = true; //小数点不能在第一位 - else //处理不规则的小数点 - { - float f; - float oldf; - bool b1 = false, b2 = false; - b1 = float.TryParse(text.Text, out oldf); - b2 = float.TryParse(text.Text + e.KeyChar.ToString(), out f); - if (b2 == false) - { - if (b1 == true) - e.Handled = true; - else - e.Handled = false; - } - } - } - } - /// /// 窗体关闭事件处理 /// /// diff --git a/FrmBufferAnalysisBSQ.cs b/FrmBufferAnalysisBSQ.cs index 24a96ca..f54208f 100644 --- a/FrmBufferAnalysisBSQ.cs +++ b/FrmBufferAnalysisBSQ.cs @@ -137,35 +137,7 @@ } } - private void txtRadius_KeyPress(object sender, KeyPressEventArgs e) - { - TextBox text = sender as TextBox; - if ((e.KeyChar < 48 || e.KeyChar > 57) && (e.KeyChar != 8) && (int)e.KeyChar != 46) - { - e.Handled = true; - } - if ((int)e.KeyChar == 46) //小数点 - { - if (text.Text.Length <= 0) - e.Handled = true; //小数点不能在第一位 - else //处理不规则的小数点 - { - float f; - float oldf; - bool b1 = false, b2 = false; - b1 = float.TryParse(text.Text, out oldf); - b2 = float.TryParse(text.Text + e.KeyChar.ToString(), out f); - if (b2 == false) - { - if (b1 == true) - e.Handled = true; - else - e.Handled = false; - } - } - } - } - + private void FrmBufferAnalysis_FormClosing(object sender, FormClosingEventArgs e) { //Form1.y = 0; @@ -316,27 +288,6 @@ } } - private void FlyToMenu_Click(object sender, EventArgs e) - { - if (m_feature != null) - { - if (m_feature.Geometry != null && m_feature.Geometry.Type == EnumGeometryType.GeoPolyline3D) - { - GSOGeoPolyline3D line = m_feature.Geometry as GSOGeoPolyline3D; - double length = line.GetSpaceLength(true, 6378137); - GSOGeoPolyline3D lineLine = line.GetSegment(0, length / 2); - GSOPoint3d point3d = lineLine[lineLine.PartCount - 1][lineLine[lineLine.PartCount - 1].Count - 1]; - - globeControl1.Globe.FlyToPosition(point3d, EnumAltitudeMode.Absolute, 0, 45, 5); - } - else - { - globeControl1.Globe.FlyToFeature(m_feature, 0, 45, 3); - } - LightMenu_Click(sender, e); - } - } - private void LightMenu_Click(object sender, EventArgs e) { flashflag = "single"; diff --git a/FrmDataBaseOpt.cs b/FrmDataBaseOpt.cs index b0c4b5d..8d7b69d 100644 --- a/FrmDataBaseOpt.cs +++ b/FrmDataBaseOpt.cs @@ -362,6 +362,7 @@ dbCombor.Items.Add(dblist[i].title); } } + /* /// /// 从配置文件读取数据库参数配置 /// @@ -428,6 +429,8 @@ } } + * */ + /* /// /// 向配置文件写入连接数据库的参数配置 /// @@ -485,6 +488,7 @@ MessageBox.Show(exp.ToString()); } } + * */ /// /// /// diff --git a/FrmDatabaseParaSetting.cs b/FrmDatabaseParaSetting.cs index a6fea46..63b596b 100644 --- a/FrmDatabaseParaSetting.cs +++ b/FrmDatabaseParaSetting.cs @@ -152,6 +152,7 @@ this.DialogResult = DialogResult.OK; this.Close(); } + /* /// /// 从配置文件读取数据库连接参数配置 /// @@ -218,6 +219,8 @@ } } + * */ + /* /// /// 向配置文件写入数据库参数配置 /// @@ -276,7 +279,7 @@ MessageBox.Show(ex.ToString()); } } - + */ /// /// 取消按钮事件处理 /// diff --git a/FrmDatabaseParaSetting2.cs b/FrmDatabaseParaSetting2.cs index 932d05e..96a87d5 100644 --- a/FrmDatabaseParaSetting2.cs +++ b/FrmDatabaseParaSetting2.cs @@ -148,6 +148,7 @@ this.DialogResult = DialogResult.OK; this.Close(); } + /* /// /// 从配置文件读取数据库连接参数配置 /// @@ -214,6 +215,8 @@ } } + * */ + /* /// /// 向配置文件写入数据库参数配置 /// @@ -272,7 +275,7 @@ MessageBox.Show(exp.ToString()); } } - + */ /// /// 取消按钮事件处理 /// diff --git a/FrmDiameterQuery.cs b/FrmDiameterQuery.cs index 68c948b..9a5215b 100644 --- a/FrmDiameterQuery.cs +++ b/FrmDiameterQuery.cs @@ -77,18 +77,7 @@ isBetween = true; } } - /// - /// 键盘按键按下事件处理 - /// - /// - /// - private void textBoxX1_KeyPress(object sender, KeyPressEventArgs e) - { - if ((e.KeyChar < 48 || e.KeyChar > 57) && e.KeyChar != 8) - { - e.Handled = true;//屏蔽 - } - } + bool isBetween = false; /// diff --git a/FrmDocumentEdit.cs b/FrmDocumentEdit.cs index aab2d31..e78a7ff 100644 --- a/FrmDocumentEdit.cs +++ b/FrmDocumentEdit.cs @@ -256,121 +256,6 @@ } - // - /// 将本地文件上传到指定的服务器(HttpWebRequest方法) - /// - /// 文件上传到的服务器 - /// 要上传的本地文件(全路径) - /// 文件上传后的名称 - /// 上传进度条 - /// 成功返回1,失败返回0 - private int Upload_Request(string address, string fileNamePath, string saveName, ProgressBar progressBar) - { - int returnValue = 0; - // 要上传的文件 - FileStream fs = new FileStream(fileNamePath, FileMode.Open, FileAccess.Read); - BinaryReader r = new BinaryReader(fs); - //时间戳 - string strBoundary = "----------" + DateTime.Now.Ticks.ToString("x"); - byte[] boundaryBytes = Encoding.ASCII.GetBytes("/r/n--" + strBoundary + "/r/n"); - //请求头部信息 - StringBuilder sb = new StringBuilder(); - sb.Append("--"); - sb.Append(strBoundary); - sb.Append("\r\n"); - sb.Append("Content-Disposition: form-data; name=\""); - sb.Append("file"); - sb.Append("\"; filename=\""); - sb.Append(saveName); - sb.Append("\""); - sb.Append("\r\n"); - sb.Append("Content-Type: "); - sb.Append("application/octet-stream"); - sb.Append("\r\n"); - sb.Append("\r\n"); - string strPostHeader = sb.ToString(); - byte[] postHeaderBytes = Encoding.UTF8.GetBytes(strPostHeader); - // 根据uri创建HttpWebRequest对象 - HttpWebRequest httpReq = (HttpWebRequest)WebRequest.Create(new Uri(address)); - httpReq.Method = "POST"; - //对发送的数据不使用缓存 - httpReq.AllowWriteStreamBuffering = false; - //设置获得响应的超时时间(300秒) - httpReq.Timeout = 300000; - httpReq.ContentType = "multipart/form-data; boundary=" + strBoundary; - long length = fs.Length + postHeaderBytes.Length + boundaryBytes.Length; - long fileLength = fs.Length; - httpReq.ContentLength = length; - try - { - progressBar.Maximum = int.MaxValue; - progressBar.Minimum = 0; - progressBar.Value = 0; - //每次上传4k - int bufferLength = 4096; - byte[] buffer = new byte[bufferLength]; - //已上传的字节数 - long offset = 0; - //开始上传时间 - DateTime startTime = DateTime.Now; - int size = r.Read(buffer, 0, bufferLength); - Stream postStream = httpReq.GetRequestStream(); - //发送请求头部消息 - postStream.Write(postHeaderBytes, 0, postHeaderBytes.Length); - while (size > 0) - { - postStream.Write(buffer, 0, size); - offset += size; - progressBar.Value = (int)(offset * (int.MaxValue / length)); - TimeSpan span = DateTime.Now - startTime; - double second = span.TotalSeconds; - //lblTime.Text = "已用时:" + second.ToString("F2") + "秒"; - //if (second > 0.001) - //{ - // lblSpeed.Text = " 平均速度:" + (offset / 1024 / second).ToString("0.00") + "KB/秒"; - //} - //else - //{ - // lblSpeed.Text = " 正在连接…"; - //} - //lblState.Text = "已上传:" + (offset * 100.0 / length).ToString("F2") + "%"; - //lblSize.Text = (offset / 1048576.0).ToString("F2") + "M/" + (fileLength / 1048576.0).ToString("F2") + "M"; - Application.DoEvents(); - size = r.Read(buffer, 0, bufferLength); - } - //添加尾部的时间戳 - postStream.Write(boundaryBytes, 0, boundaryBytes.Length); - postStream.Close(); - //获取服务器端的响应 - WebResponse webRespon = httpReq.GetResponse(); - Stream s = webRespon.GetResponseStream(); - StreamReader sr = new StreamReader(s); - //读取服务器端返回的消息 - String sReturnString = sr.ReadLine(); - s.Close(); - sr.Close(); - if (sReturnString == "Success") - { - returnValue = 1; - } - else if (sReturnString == "Error") - { - returnValue = 0; - } - } - catch(Exception ex) - { - returnValue = 0; - string str = ex.ToString(); - } - finally - { - fs.Close(); - r.Close(); - } - return returnValue; - } - private void btn_file_Click(object sender, EventArgs e) { OpenFileDialog dlg = new OpenFileDialog(); diff --git a/FrmExportCADS.cs b/FrmExportCADS.cs index 98772ea..59629dd 100644 --- a/FrmExportCADS.cs +++ b/FrmExportCADS.cs @@ -108,65 +108,6 @@ MessageBox.Show("请选中要导出的图层!", "提示", MessageBoxButtons.OK, MessageBoxIcon.Warning); } } - private Boolean MerageToFile(GSOFeatures features, String strDestFile, String strProj4)//图层追加 - { - if (features == null) - { - return false; - } - Boolean bSuccess = false; - - string strDir = GSOUtility.GetFileDir(strDestFile); - string strLPRJFile = GSOUtility.ChangeExt(strDestFile, ".lprj"); - string strExt = GSOUtility.GetFileExt(strDestFile); - - // 如果投影文件存在,投影以投影文件为准 - if (File.Exists(strLPRJFile)) - { - // 如果是dxf,则这样处理 - if (strExt.ToLower() == ".dxf") - { - string strTempSrcFile = strDir + "srcFeatures_dxftmp" + strExt; - globeControl1.Globe.DataManager.SaveFeatureData(features, strTempSrcFile, strLPRJFile, 4); - bSuccess = GSOUtility.MergeTwoDXFFileFeatures(strDestFile, strTempSrcFile); - File.Delete(strTempSrcFile); - } - else - { - GSOFeatures srcFeatures = globeControl1.Globe.DataManager.ReadFeatureData(strDestFile); - int nCount = features.Length; - int i = 0; - for (i = 0; i < nCount; i++) - { - srcFeatures.Add(features[i]); - } - bSuccess = globeControl1.Globe.DataManager.SaveFeatureData(srcFeatures, strDestFile, strLPRJFile, 4); - } - } - else - { - // 如果是dxf,则这样处理 - if (strExt.ToLower() == ".dxf") - { - string strTempSrcFile = strDir + "srcFeatures_dxftmp" + strExt; - globeControl1.Globe.DataManager.SaveFeatureData(features, strTempSrcFile, strProj4, 0); - bSuccess = GSOUtility.MergeTwoDXFFileFeatures(strDestFile, strTempSrcFile); - File.Delete(strTempSrcFile); - } - else - { - GSOFeatures srcFeatures = globeControl1.Globe.DataManager.ReadFeatureData(strDestFile); - int nCount = features.Length; - int i = 0; - for (i = 0; i < nCount; i++) - { - srcFeatures.Add(features[i]); - } - bSuccess = globeControl1.Globe.DataManager.SaveFeatureData(srcFeatures, strDestFile, strProj4, 0); - } - } - return bSuccess; - } /// /// 关闭按钮事件处理 /// diff --git a/FrmHDMAnalysis3.cs b/FrmHDMAnalysis3.cs index 4f73af6..2ada735 100644 --- a/FrmHDMAnalysis3.cs +++ b/FrmHDMAnalysis3.cs @@ -436,29 +436,6 @@ } layerTemp.RemoveAllFeature(); } - private void Export(GSOPoint3d _pnt, double r) - { - GSOPoint3ds pnts = new GSOPoint3ds(); - GSOPoint3d pnt = new GSOPoint3d(); - pnt.X = _pnt.X; - pnt.Y = _pnt.Y; - pnt.Z = _pnt.Z; - pnts.Add(pnt); - pnt.X = _pnt.X; - pnt.Y = _pnt.Y - 0.0000000005; - pnt.Z = _pnt.Z; - pnts.Add(pnt); - GSOGeoPolyline3D line = new GSOGeoPolyline3D(); - line.AddPart(pnts); - GSOGeoPolygon3D polygon = line.CreateBuffer(r * 2, true, 5, true, false); - GSOPoint3ds points = polygon[0]; - GSOGeoPolyline3D newLine = new GSOGeoPolyline3D(); - newLine.AddPart(points); - newLine.AltitudeMode = EnumAltitudeMode.RelativeToGround; - GSOFeature newFeature = new GSOFeature(); - newFeature.Geometry = newLine; - globeControl1.Globe.MemoryLayer.AddFeature(newFeature); - } private void ExportCAD(double a, double b, double r) { diff --git a/FrmHotFuncStat.cs b/FrmHotFuncStat.cs index c980f34..2eb1476 100644 --- a/FrmHotFuncStat.cs +++ b/FrmHotFuncStat.cs @@ -421,13 +421,6 @@ } } - private void HFS_Pderive_Click(object sender, EventArgs e) - { - if (TV_Files.SelectedNode != null) - { - HFSClass.GuideEdit_form("G", TV_Files, int.Parse(((ToolStripMenuItem)sender).Tag.ToString())); - } - } private void 导入ToolStripMenuItem_Click(object sender, EventArgs e) { @@ -530,22 +523,8 @@ } } - private void 导出ToolStripMenuItem1_Click(object sender, EventArgs e) - { - 导出ToolStripMenuItem2_Click(sender, e); - } + - private void TV_HFSSrchRslt_AfterCollapse(object sender, TreeViewEventArgs e) - { - e.Node.ImageIndex = 0; - } - - private void TV_HFSSrchRslt_AfterExpand(object sender, TreeViewEventArgs e) - { - HFSClass.ADD_TreeNode(TV_Files, e.Node); - e.Node.ImageIndex = 1; - } - private void 导出ToolStripMenuItem1_Click_1(object sender, EventArgs e) { if ((TV_HFSSrchRslt.SelectedNode != null) && (TV_HFSSrchRslt.SelectedNode.Parent != null)) diff --git a/FrmLayerControl.cs b/FrmLayerControl.cs index e7917c3..28fa14d 100644 --- a/FrmLayerControl.cs +++ b/FrmLayerControl.cs @@ -312,26 +312,7 @@ layerManagerNode.Expand(); terrainManagerNode.Expand(); } - /// - /// 刷新节点树 - /// - private void RefreshDataTree() - { - layerTree2.Nodes[0].Nodes.Clear(); - Int32 nCount = globeControl2.Globe.Layers.Count; - Int32 i = 0; - for (i = 0; i < nCount; i++) - { - GSODataset dataSpace = globeControl2.Globe.Layers[i].Dataset; - TreeNode node = new TreeNode(); - node.Text = dataSpace.Name; - node.ImageIndex = 0; - node.SelectedImageIndex = 0; - node.Checked = true; - node.Tag = dataSpace; - layerTree2.Nodes[0].Nodes.Add(node); - } - } + /// /// 目标图层按钮事件处理 /// @@ -494,22 +475,8 @@ } } } - /// - /// 改变指定节点的选中状态 - /// - /// - /// - private void CheckTreeNode(TreeNode node, Boolean bChecked) - { - CheckChildTreeNode(node, bChecked); - // 对于kml图层,如果当前处理的节点是true,那么要把所有的祖宗节点置为true - // 只有所有节点都未false,那么这个节点才为false - // CheckFatherTreeNode(node, bChecked); - globeControl1.Globe.Refresh(); - globeControl2.Globe.Refresh(); - - } + private void CheckChildTreeNode(TreeNode node, Boolean bChecked) { if (node == null) @@ -696,59 +663,7 @@ //} //CheckControl(e); } - /// - /// 树节点选中方法 - /// - /// - private void CheckControl(TreeViewEventArgs e) - { - if (e.Action != TreeViewAction.Unknown) - { - if (e.Node != null && !Convert.IsDBNull(e.Node)) - { - CheckParentNode(e.Node); - if (e.Node.Nodes.Count > 0) - { - CheckAllChildNodes(e.Node, e.Node.Checked); - } - } - } - } - /// - /// 改变所有子节点的状态 - /// - /// - /// - private void CheckAllChildNodes(TreeNode pn, bool IsChecked) - { - foreach (TreeNode tn in pn.Nodes) - { - tn.Checked = IsChecked; - if (tn.Tag.ToString().Contains("|")) - { - string nodeTag = tn.Tag.ToString().Split('|')[1]; - GSOLayer layer = globeControl1.Globe.Layers.GetLayerByCaption(nodeTag); - if (layer != null) - { - layer.Visible = IsChecked; - globeControl1.Globe.Refresh(); - } - } - if (tn.Tag is GSOFeature) - { - if (tn.Nodes.Count == 0) - { - GSOFeature feat = tn.Tag as GSOFeature; - feat.Visible = IsChecked; - globeControl1.Globe.Refresh(); - } - } - if (tn.Nodes.Count > 0) - { - CheckAllChildNodes(tn, IsChecked); - } - } - } + /// /// 改变父节点的选中状态,此处为所有子节点不选中时才取消父节点选中,可以根据需要修改 /// diff --git a/FrmLogin.cs b/FrmLogin.cs index 320fdd5..2afe46e 100644 --- a/FrmLogin.cs +++ b/FrmLogin.cs @@ -59,70 +59,6 @@ textBoxPassWord.Clear(); } } - - /// - /// 验证端口号 - /// - /// - private bool ValiPort() - { - Ping p = new Ping();//创建Ping对象p - PingReply pr = p.Send(Utility.localicenseserverip);//向指定IP或者主机名的计算机发送ICMP协议的ping数据包 - if (pr.Status == IPStatus.Success)//如果ping成功 - { - try - { - TcpClient tcpc = new TcpClient(Utility.localicenseserverip, Utility.localicenseserverport);//对IP地址为"192.168.0.105"的计算机的1500端口提出连接申请 - tcpc.Close(); - return true; - } - catch (Exception ex) - { - MessageBox.Show("端口连接错误!" + ex.Message); - return false; - } - } - else - { - int times = 0;//重新连接次数; - int count = 2;//设置尝试次数 - while (times < count) - { - //Thread.Sleep(1000);//等待时间(方便测试的话,你可以改为1000) - pr = p.Send(Utility.localicenseserverip); - - if (pr.Status == IPStatus.Success) - { - try - { - TcpClient tcpc = new TcpClient(Utility.localicenseserverip, Utility.localicenseserverport);//对IP地址为"192.168.0.105"的计算机的1500端口提出连接申请 - tcpc.Close(); - return true; - } - catch (Exception ex) - { - MessageBox.Show("端口连接错误!" + ex.Message); - return false; - } - } - else - { - times++; - if (times < count) - { - continue; - } - else - { - MessageBox.Show("重新尝试连接失败"); - return false; - } - } - - } - return false; - } - } /// /// 验证用户名、密码 /// diff --git a/FrmMetadata.cs b/FrmMetadata.cs index 886f65a..0365372 100644 --- a/FrmMetadata.cs +++ b/FrmMetadata.cs @@ -27,11 +27,7 @@ InitializeComponent(); loadTreeView(layerTree); } - private void FrmMetadata_Load(object sender, EventArgs e) - { - //this.ntLblC.Text = "nn"; - // loadTreeView(layerTree); - } + private void loadTreeView(TreeView tv)//构建图层树 { try diff --git a/FrmMetadataStat.cs b/FrmMetadataStat.cs index 790658a..e7696c6 100644 --- a/FrmMetadataStat.cs +++ b/FrmMetadataStat.cs @@ -197,9 +197,5 @@ } } - private void buttonX1_Click(object sender, EventArgs e) - { - drawChart(); - } } } diff --git a/FrmPatrolerManager.cs b/FrmPatrolerManager.cs index 37f8ffd..9e66aeb 100644 --- a/FrmPatrolerManager.cs +++ b/FrmPatrolerManager.cs @@ -109,82 +109,8 @@ this.winGridViewPager1.AllToExport = table; } - /// - /// 编辑 - /// - /// - /// - private void winGridViewPager1_OnEditSelected(object sender, EventArgs e) - { - - DataGridView grid = sender as DataGridView; - if (grid != null && grid.SelectedRows.Count>0) - { - DataGridViewRow row = grid.SelectedRows[0]; - try - { - long dbid = long.Parse(row.Cells["编号"].Value.ToString()); - String name = row.Cells["姓名"].Value.ToString(); - String sex = row.Cells["性别"].Value.ToString(); - String age = row.Cells["年龄"].Value.ToString(); - string phone = row.Cells["电话"].Value.ToString(); - age = String.IsNullOrEmpty(age.ToString().Trim()) ? "1" : age.ToString().Trim(); - FrmPatrolerEdit frm = new FrmPatrolerEdit(dbid.ToString(), name, age, sex, phone); - frm.reloadGrid += new ReloadPatrolerGrid(LoadData); - frm.ShowDialog(); - winGridViewPager1.Refresh(); - } - catch (Exception ex) - { - MessageBox.Show("编辑失败:" + ex.ToString(), "错误", MessageBoxButtons.OK, MessageBoxIcon.Error); - } - } - else - { - MessageBox.Show("没有选择记录", "提示"); - } - - } - - /// - /// 删除 - /// - /// - /// - private void winGridViewPager1_OnDeleteSelected(object sender, EventArgs e) - { - DataGridView grid = sender as DataGridView; - if (grid != null && grid.SelectedRows.Count > 0) - { - DataGridViewRow row = grid.SelectedRows[0]; - long dbid = long.Parse(row.Cells["编号"].Value.ToString()); - try - { - string state = row.Cells["状态"].Value.ToString(); - if ("在线".Equals(state)) - { - if (MessageBox.Show("确定注销?", "确认", MessageBoxButtons.YesNo, MessageBoxIcon.Question) == DialogResult.Yes) - { - String sql = "update patroler t set t.accountstate='LEAVER' where t.dbid=" + dbid; - OracleUtils.ExecuteNonQuery(OracleUtils.ConnectionString, CommandType.Text, sql); - } - } - else { - MessageBox.Show("人员不在线,无法注销", "信息"); - } - } - catch (Exception ex) - { - MessageBox.Show("人员注销失败:" + ex.ToString(), "错误", MessageBoxButtons.OK, MessageBoxIcon.Error); - } - } - else - { - MessageBox.Show("没有选择记录", "提示"); - } - } - - + + private void LoadData() { int pageIndex = winGridViewPager1.PagerInfo.CurrenetPageIndex; diff --git a/FrmRoadHDM.cs b/FrmRoadHDM.cs index e765313..e871dd5 100644 --- a/FrmRoadHDM.cs +++ b/FrmRoadHDM.cs @@ -333,31 +333,6 @@ this.Cursor = Cursors.Default; } } - - private void Export(GSOPoint3d _pnt, double r) - { - GSOPoint3ds pnts = new GSOPoint3ds(); - GSOPoint3d pnt = new GSOPoint3d(); - pnt.X = _pnt.X; - pnt.Y = _pnt.Y; - pnt.Z = _pnt.Z; - pnts.Add(pnt); - pnt.X = _pnt.X; - pnt.Y = _pnt.Y - 0.0000000005; - pnt.Z = _pnt.Z; - pnts.Add(pnt); - GSOGeoPolyline3D line = new GSOGeoPolyline3D(); - line.AddPart(pnts); - GSOGeoPolygon3D polygon = line.CreateBuffer(r * 2, true, 5, true, false); - GSOPoint3ds points = polygon[0]; - GSOGeoPolyline3D newLine = new GSOGeoPolyline3D(); - newLine.AddPart(points); - newLine.AltitudeMode = EnumAltitudeMode.RelativeToGround; - GSOFeature newFeature = new GSOFeature(); - newFeature.Geometry = newLine; - globeControl1.Globe.MemoryLayer.AddFeature(newFeature); - } - private void ExportCAD(double a, double b, double r) { GSOPoint3ds pnts = new GSOPoint3ds(); diff --git a/FrmUserAdd.cs b/FrmUserAdd.cs index c612ab4..f826427 100644 --- a/FrmUserAdd.cs +++ b/FrmUserAdd.cs @@ -231,24 +231,6 @@ //cbxRegion.SelectedIndexChanged += new EventHandler(cbxRegion_SelectedIndexChanged); } } - /// - /// 下拉框选中项改变事件处理 - /// - /// - /// - private void cbxRegion_SelectedIndexChanged(object sender, EventArgs e) - { - string sql = ""; - //string sql = "select casic_role.\"name\" from casic_role join casic_regionrole on casic_role.\"id\"=casic_regionrole.\"rid\" where casic_regionrole.\"reid\"=" + region[cbxRegion.SelectedItem.ToString().Trim()]; - DataTable dt = OledbHelper.QueryTable(sql); - if (dt != null && dt.Rows.Count > 0) - { - comboBoxExRegionRole.Items.Clear(); - for (int i = 0; i < dt.Rows.Count; i++) - { - comboBoxExRegionRole.Items.Add(dt.Rows[i][0].ToString().Trim());//部门角色 - } - } - } + } } diff --git a/Cyberpipe.csproj b/Cyberpipe.csproj index 07a8c1a..e3cd12c 100644 --- a/Cyberpipe.csproj +++ b/Cyberpipe.csproj @@ -204,25 +204,6 @@ - - Form - - - F_GKT1数据输入输出.cs - - - Form - - - F_GKT1添加文件.cs - - - Form - - - F_GKT1添加项目.cs - - Form @@ -1068,18 +1049,6 @@ Frm_password_reset.cs - - Form - - - GKT.cs - - - Form - - - GKT1.cs - Form @@ -1258,12 +1227,6 @@ F_Projedit.cs - - Form - - - PED.cs - Form @@ -1331,16 +1294,6 @@ True Reference.map - - F_GKT1数据输入输出.cs - Designer - - - F_GKT1添加文件.cs - - - F_GKT1添加项目.cs - Form_EditTask.cs @@ -1836,12 +1789,6 @@ Frm_password_reset.cs - - GKT.cs - - - GKT1.cs - F_GKT数据输入输出.cs @@ -1934,9 +1881,6 @@ F_Projedit.cs - - PED.cs - F_数据输入输出.cs diff --git a/Cyberpipe.suo b/Cyberpipe.suo index 68ced4f..a1aecf8 100644 --- a/Cyberpipe.suo +++ b/Cyberpipe.suo Binary files differ diff --git a/EMS_Forms/Form_EditTask.cs b/EMS_Forms/Form_EditTask.cs index 718992f..f1d791f 100644 --- a/EMS_Forms/Form_EditTask.cs +++ b/EMS_Forms/Form_EditTask.cs @@ -119,7 +119,8 @@ String name = Convert.ToString(dr["USERNAME"]); comboBox_userName.Items.Add(name); - } + } + dr.Close(); comboBox_road.Items.Clear(); roadList = new List(); @@ -135,7 +136,7 @@ comboBox_road.Items.Add(name); } } - + dr1.Close(); conn.Close(); bool flag2 = false; @@ -185,7 +186,7 @@ catch (Exception ex) { - MessageBox.Show(ex.ToString()); + LogHelper.WriteLog(typeof(Form_EditTask), ex.Message); } } @@ -288,7 +289,7 @@ } catch (Exception ex) { - MessageBox.Show(ex.ToString()); + LogHelper.WriteLog(typeof(Form_EditTask), ex.Message); } } @@ -474,7 +475,7 @@ } catch (Exception ex) { - MessageBox.Show(ex.ToString()); + LogHelper.WriteLog(typeof(Form_EditTask), ex.Message); } this.Close(); @@ -495,6 +496,7 @@ { numList.Add(Convert.ToInt32(dr["DBID"])); } + dr.Close(); if (numList.Count == 0) { taskNumber = Convert.ToInt32(number) * 100; @@ -674,6 +676,7 @@ } } } + dr.Close(); conn.Close(); } diff --git a/EMS_Forms/Form_EventManager.cs b/EMS_Forms/Form_EventManager.cs index b18c45b..84807b2 100644 --- a/EMS_Forms/Form_EventManager.cs +++ b/EMS_Forms/Form_EventManager.cs @@ -64,6 +64,7 @@ comboBox_name.Items.Add(name); } + dr.Close(); conn.Close(); diff --git a/Forms/FrmMnModify.cs b/Forms/FrmMnModify.cs index 31cfc5f..d036360 100644 --- a/Forms/FrmMnModify.cs +++ b/Forms/FrmMnModify.cs @@ -68,15 +68,7 @@ questionGrid.Rows[idx].Cells[1].Value = sr.question; } } - /// 选中对象 - /// - /// - /// - /// - private void buttonX1_Click(object sender, EventArgs e) - { - globecontrol.Globe.Action = EnumAction3D.SelectObject; - } + /// /// 选中某一行 /// diff --git a/Forms/FrmPipelineModelDataBase.cs b/Forms/FrmPipelineModelDataBase.cs index 2acf0ca..7ce573f 100644 --- a/Forms/FrmPipelineModelDataBase.cs +++ b/Forms/FrmPipelineModelDataBase.cs @@ -35,19 +35,7 @@ ds = _ds; InitializeComponent(); } - /// - /// 单击选择shp格式文件 - /// - /// - /// - private void btnBrowseModel_Click(object sender, EventArgs e) - { - saveFileDialog1.Filter = "*.lgd|*.lgd"; - if (saveFileDialog1.ShowDialog() == DialogResult.OK) - { - txtModelLayer.Text = saveFileDialog1.FileName; - } - } + /// /// 窗体初始化事件处理 /// @@ -100,49 +88,6 @@ } } } - - private object convertFieldValue(string fieldname, object obj) - { - if (obj == null) - return null; - - try - { - string type = fields_types[fieldname].ToString(); - switch (type) - { - case "string": - return obj.ToString(); - case "int": - //return 101; - int intResult; - if (int.TryParse(obj.ToString(), out intResult)) - return intResult; - else - return null; - case "double": - //return 202.5; - double doubleResult; - if (double.TryParse(obj.ToString(), out doubleResult)) - return doubleResult; - else - return null; - case "date": - DateTime dtResult; - if (DateTime.TryParse(obj.ToString(), out dtResult)) - return dtResult; - else - return null; - } - return null; - } - catch (Exception ex) - { - MessageBox.Show(ex.ToString()); - return null; - } - } - public string lgdFilePath = ""; /// /// 选择管线颜色 @@ -610,33 +555,6 @@ { this.Close(); } - - private void cmbLayer_SelectedIndexChanged(object sender, EventArgs e) //选择图层 - { - GSOLayer layer = ctl.Globe.Layers.GetLayerByCaption(selectLayerName); - GSOFeatures features = layer.GetAllFeatures(); - if (features.Length == 0) - return; - - cmbFrom.Items.Clear(); - cmbTo.Items.Clear(); - cmbRadius.Items.Clear(); - cmbID.Items.Clear(); - for (int i = 0; i < features[0].GetFieldCount(); i++) - { - GeoScene.Data.GSOFieldDefn fielddef = (GeoScene.Data.GSOFieldDefn)(features[0].GetFieldDefn(i)); - - cmbFrom.Items.Add(fielddef.Name); - cmbTo.Items.Add(fielddef.Name); - cmbRadius.Items.Add(fielddef.Name); - cmbID.Items.Add(fielddef.Name); - } - cmbFrom.SelectedItem = "Deep1"; - cmbTo.SelectedItem = "Deep2"; - cmbRadius.SelectedItem = "Diameter"; - cmbID.SelectedItem = "Handle"; - } - private void buttonXLayerPath_Click(object sender, EventArgs e)//单击 选择shp格式的文件 { OpenFileDialog dlg = new OpenFileDialog(); diff --git a/Forms/FrmPipelineModelDataOneStep.cs b/Forms/FrmPipelineModelDataOneStep.cs index 18afda7..ec93b8a 100644 --- a/Forms/FrmPipelineModelDataOneStep.cs +++ b/Forms/FrmPipelineModelDataOneStep.cs @@ -38,19 +38,7 @@ layerTree = _layerTree; InitializeComponent(); } - /// - /// 单击选择shp格式文件 - /// - /// - /// - private void btnBrowseModel_Click(object sender, EventArgs e) - { - saveFileDialog1.Filter = "*.lgd|*.lgd"; - if (saveFileDialog1.ShowDialog() == DialogResult.OK) - { - txtModelLayer.Text = saveFileDialog1.FileName; - } - } + /// /// 窗体初始化事件处理 /// @@ -107,48 +95,7 @@ } } - private object convertFieldValue(string fieldname, object obj) - { - if (obj == null) - return null; - - try - { - string type = fields_types[fieldname].ToString(); - switch (type) - { - case "string": - return obj.ToString(); - case "int": - //return 101; - int intResult; - if (int.TryParse(obj.ToString(), out intResult)) - return intResult; - else - return null; - case "double": - //return 202.5; - double doubleResult; - if (double.TryParse(obj.ToString(), out doubleResult)) - return doubleResult; - else - return null; - case "date": - DateTime dtResult; - if (DateTime.TryParse(obj.ToString(), out dtResult)) - return dtResult; - else - return null; - } - return null; - } - catch (Exception ex) - { - MessageBox.Show(ex.ToString()); - return null; - } - } - + public string lgdFilePath = ""; /// /// 选择管线颜色 @@ -673,32 +620,6 @@ return featDs; } - private void cmbLayer_SelectedIndexChanged(object sender, EventArgs e) //选择图层 - { - GSOLayer layer = ctl.Globe.Layers.GetLayerByCaption(selectLayerName); - GSOFeatures features = layer.GetAllFeatures(); - if (features.Length == 0) - return; - - cmbFrom.Items.Clear(); - cmbTo.Items.Clear(); - cmbRadius.Items.Clear(); - cmbID.Items.Clear(); - for (int i = 0; i < features[0].GetFieldCount(); i++) - { - GeoScene.Data.GSOFieldDefn fielddef = (GeoScene.Data.GSOFieldDefn)(features[0].GetFieldDefn(i)); - - cmbFrom.Items.Add(fielddef.Name); - cmbTo.Items.Add(fielddef.Name); - cmbRadius.Items.Add(fielddef.Name); - cmbID.Items.Add(fielddef.Name); - } - cmbFrom.SelectedItem = "Deep1"; - cmbTo.SelectedItem = "Deep2"; - cmbRadius.SelectedItem = "Diameter"; - cmbID.SelectedItem = "Handle"; - } - private void buttonXLayerPath_Click(object sender, EventArgs e)//单击 选择shp格式的文件 { OpenFileDialog dlg = new OpenFileDialog(); @@ -949,38 +870,6 @@ } //txtLayername.Text = type + layername; } - /// - /// 连接数据库 - /// - /// - /// - private void buttonX1_Click(object sender, EventArgs e) - { - if (ds == null) - { - //没连的话,直接连接审核库; //审核库配置读配置文件 - string dbIp = Utility.sgdbip; - string database = Utility.sgdbname; - string user = Utility.sgdbuser; - string pass = Utility.sgdbpwd; - - if (!Utility.isNetworkConnectionSuccess(dbIp.Trim())) - { - MessageBox.Show("网络连接失败!", "提示"); - return; - } - - ds = ctl.Globe.DataManager.OpenOracleDataSource(dbIp + "/" + database, "", "", user, pass); - if (ds == null) - { - MessageBox.Show("数据库连接失败!", "提示", MessageBoxButtons.OK, MessageBoxIcon.Warning); - } - else - { - btnCreateModel.Enabled = true; - } - } - } private void btnClose_Click(object sender, EventArgs e) { diff --git a/Forms/FrmShRK.cs b/Forms/FrmShRK.cs index 0e2e722..f1d83cb 100644 --- a/Forms/FrmShRK.cs +++ b/Forms/FrmShRK.cs @@ -215,6 +215,7 @@ { sourcefeatds = sourcefeat as GSOFeatureDataset; } + if (sourcefeatds == null) return; sourcefeatds.Open(); GSOFeatures sourcefeatures = sourcefeatds.GetAllFeatures(); @@ -251,6 +252,7 @@ { desfeatds = desfeat as GSOFeatureDataset; } + if (desfeatds == null) return; desfeatds.Open(); //向新数据集写入字段 diff --git a/FrmAccessoriesSensor.cs b/FrmAccessoriesSensor.cs index 09fcdf1..2a7a80e 100644 --- a/FrmAccessoriesSensor.cs +++ b/FrmAccessoriesSensor.cs @@ -209,7 +209,7 @@ chart1.Series[0].Points.DataBindXY(dic.Keys, dic.Values); for (int m = 0; m < dic.Values.Count; m++) { - if (chart1.Series[0].Points[m].YValues[0].ToString() != "0") + if (chart1.Series[0].Points[m]!=null&&chart1.Series[0].Points[m].YValues[0].ToString() != "0") { chart1.Series[0].Points[m].Label = chart1.Series[0].Points[m].YValues[0].ToString(); } diff --git a/FrmAccessoriesgather.cs b/FrmAccessoriesgather.cs index 9e331e1..a475d9e 100644 --- a/FrmAccessoriesgather.cs +++ b/FrmAccessoriesgather.cs @@ -338,7 +338,7 @@ chart1.Series[0].Points.DataBindXY(dic.Keys, dic.Values); for (int m = 0; m < dic.Values.Count; m++) { - if (chart1.Series[0].Points[m].YValues[0].ToString() != "0") + if (chart1.Series[0].Points[m]!=null&&chart1.Series[0].Points[m].YValues[0].ToString() != "0") { chart1.Series[0].Points[m].Label = chart1.Series[0].Points[m].YValues[0].ToString(); } diff --git a/FrmAccessoryAnalysis.cs b/FrmAccessoryAnalysis.cs index 71d4579..44d4065 100644 --- a/FrmAccessoryAnalysis.cs +++ b/FrmAccessoryAnalysis.cs @@ -66,39 +66,6 @@ globeControl1.Refresh(); } /// - /// 键盘按键按下事件处理 - /// - /// - /// - private void txtRadius_KeyPress(object sender, KeyPressEventArgs e) - { - TextBox text = sender as TextBox; - if ((e.KeyChar < 48 || e.KeyChar > 57) && (e.KeyChar != 8) && (int)e.KeyChar != 46) - { - e.Handled = true; - } - if ((int)e.KeyChar == 46) //小数点 - { - if (text.Text.Length <= 0) - e.Handled = true; //小数点不能在第一位 - else //处理不规则的小数点 - { - float f; - float oldf; - bool b1 = false, b2 = false; - b1 = float.TryParse(text.Text, out oldf); - b2 = float.TryParse(text.Text + e.KeyChar.ToString(), out f); - if (b2 == false) - { - if (b1 == true) - e.Handled = true; - else - e.Handled = false; - } - } - } - } - /// /// 确定按钮事件处理 /// /// diff --git a/FrmAddValve.cs b/FrmAddValve.cs index 34d2fec..5f405b9 100644 --- a/FrmAddValve.cs +++ b/FrmAddValve.cs @@ -486,56 +486,6 @@ } } - - - - - - - - private void cmbLayer_SelectedIndexChanged(object sender, EventArgs e) - { - GSOLayer layer = globeControl1.Globe.Layers.GetLayerByCaption(selectLayerName); - GSOFeatures features = layer.GetAllFeatures(); - if (features.Length == 0) - return; - - combPath.Items.Clear(); - combZ.Items.Clear(); - combModelName.Items.Clear(); - - for (int i = 0; i < features[0].GetFieldCount(); i++) - { - GeoScene.Data.GSOFieldDefn fielddef = (GeoScene.Data.GSOFieldDefn)(features[0].GetFieldDefn(i)); - combPath.Items.Add(fielddef.Name); - combZ.Items.Add(fielddef.Name); - combModelName.Items.Add(fielddef.Name); - } - combModelName.SelectedItem = "编号"; - combPath.SelectedItem = "模型路径"; - if (combfile.SelectedIndex != -1) - { - - string layerCaption = combfile.SelectedItem.ToString().Trim(); - rukuLayer = globeControl1.Globe.Layers.GetLayerByCaption(layerCaption); - if (rukuLayer != null) - { - combPath.Items.Clear(); - combZ.Items.Clear(); - combModelName.Items.Clear(); - - } - for (int i = 0; i < features[0].GetFieldCount(); i++) - { - GeoScene.Data.GSOFieldDefn fielddef = (GeoScene.Data.GSOFieldDefn)(features[0].GetFieldDefn(i)); - combPath.Items.Add(fielddef.Name); - combZ.Items.Add(fielddef.Name); - combModelName.Items.Add(fielddef.Name); - } - combModelName.SelectedItem = "编号"; - combPath.SelectedItem = "模型路径"; - } - } /// /// 单击选择shp格式文件 /// diff --git a/FrmAddWellShp.cs b/FrmAddWellShp.cs index bb79ec0..a249725 100644 --- a/FrmAddWellShp.cs +++ b/FrmAddWellShp.cs @@ -478,32 +478,6 @@ } } } - - private void cmbLayer_SelectedIndexChanged(object sender, EventArgs e) - { - GSOLayer layer = globeControl1.Globe.Layers.GetLayerByCaption(selectLayerName); - GSOFeatures features = layer.GetAllFeatures(); - if (features.Length == 0) - return; - - combCode.Items.Clear(); - combDeep.Items.Clear(); - combModelName.Items.Clear(); - combAngle.Items.Clear(); - - for (int i = 0; i < features[0].GetFieldCount(); i++) - { - GeoScene.Data.GSOFieldDefn fielddef = (GeoScene.Data.GSOFieldDefn)(features[0].GetFieldDefn(i)); - combCode.Items.Add(fielddef.Name); - combDeep.Items.Add(fielddef.Name); - combModelName.Items.Add(fielddef.Name); - combAngle.Items.Add(fielddef.Name); - } - combCode.SelectedItem = "附属物编码"; - combDeep.SelectedItem = "井深"; - combModelName.SelectedItem = "编号"; - combAngle.SelectedItem = "符号角度"; - } /// /// 单击选择shp格式文件 /// diff --git a/FrmAddYuBiZiShp.cs b/FrmAddYuBiZiShp.cs index b312d51..332f037 100644 --- a/FrmAddYuBiZiShp.cs +++ b/FrmAddYuBiZiShp.cs @@ -383,80 +383,7 @@ } } - private void cmbLayer_SelectedIndexChanged(object sender, EventArgs e) - { - GSOLayer layer = globeControl1.Globe.Layers.GetLayerByCaption(selectLayerName); - GSOFeatures features = layer.GetAllFeatures(); - if (features.Length == 0) - return; - - combCode.Items.Clear(); - combDeep.Items.Clear(); - combModelName.Items.Clear(); - //comboLoad.Items.Clear(); - for (int i = 0; i < features[0].GetFieldCount(); i++) - { - GeoScene.Data.GSOFieldDefn fielddef = (GeoScene.Data.GSOFieldDefn)(features[0].GetFieldDefn(i)); - combCode.Items.Add(fielddef.Name); - combDeep.Items.Add(fielddef.Name); - combModelName.Items.Add(fielddef.Name); - //comboLoad.Items.Add(fielddef.Name); - } - combCode.SelectedItem = "附属物编码"; - combDeep.SelectedItem = "Z坐标"; - combModelName.SelectedItem = "编号"; - //comboLoad.SelectedItem = "模型路径"; - } - - private void buttonXLayerPath_Click(object sender, EventArgs e) - { - OpenFileDialog dlg = new OpenFileDialog(); - dlg.Filter = "*.shp|*.shp"; - dlg.Multiselect = false; - if (dlg.ShowDialog() == DialogResult.OK) - { - GSOLayer layer = globeControl1.Globe.Layers.Add(dlg.FileName); - string txtMessage = valiYBdata(layer); - if (txtMessage != "") - { - button3.Enabled = false; - //textBoxLayer.Text = ""; - combCode.Items.Clear(); - combDeep.Items.Clear(); - combModelName.Items.Clear(); - globeControl1.Globe.Layers.Remove(layer); - FrmValiDataShowErrorMessage showErrorMessage = new FrmValiDataShowErrorMessage(dlg.FileName, txtMessage); - showErrorMessage.ShowDialog(); - return; - } - else - { - button3.Enabled = true; - //textBoxLayer.Text = dlg.FileName; - selectLayerName = layer.Caption; - txtLayerName.Text = layer.Caption; - GSOFeatures features = layer.GetAllFeatures(); - if (features.Length == 0) - return; - - combCode.Items.Clear(); - combDeep.Items.Clear(); - combModelName.Items.Clear(); - for (int i = 0; i < features[0].GetFieldCount(); i++) - { - GeoScene.Data.GSOFieldDefn fielddef = (GeoScene.Data.GSOFieldDefn)(features[0].GetFieldDefn(i)); - combCode.Items.Add(fielddef.Name); - combDeep.Items.Add(fielddef.Name); - combModelName.Items.Add(fielddef.Name); - //comboLoad.Items.Add(fielddef.Name); - } - combCode.SelectedItem = "管点编码"; - combDeep.SelectedItem = "Z坐标"; - combModelName.SelectedItem = "编号"; - } - } - } - + private void FrmAddYuBiZiShp_FormClosing(object sender, FormClosingEventArgs e) { globeControl1.Globe.Refresh(); diff --git a/FrmAllPipelineStatis.cs b/FrmAllPipelineStatis.cs index 6421a26..a6eea29 100644 --- a/FrmAllPipelineStatis.cs +++ b/FrmAllPipelineStatis.cs @@ -84,7 +84,7 @@ chartAllAreaPipeline.Series["管线"].Points.DataBindXY(pipelineLengthAndType.Keys, pipelineLengthAndType.Values); for (int m = 0; m < pipelineLengthAndType.Values.Count; m++) { - if (chartAllAreaPipeline.Series["管线"].Points[m].YValues[0].ToString() != "0") + if (chartAllAreaPipeline.Series["管线"].Points[m]!=null&&chartAllAreaPipeline.Series["管线"].Points[m].YValues[0].ToString() != "0") { chartAllAreaPipeline.Series["管线"].Points[m].Label = chartAllAreaPipeline.Series[0].Points[m].YValues[0].ToString(); } @@ -94,7 +94,7 @@ } catch (Exception ex) { - //LogError.PublishError(ex); + LogHelper.WriteLog(typeof(FrmAllPipelineStatis), ex.Message); } } @@ -147,7 +147,7 @@ } DataTable dt = OledbHelper.QueryTable(sql); - if (dt != null && dt.Rows.Count > 0) + if (dt != null && dt.Rows.Count > 0 && chartAllAreaPipeline.Series["管线"].Points[indexHit]!=null) { dataGridViewX1.DataSource = dt; panel.Visible = true; diff --git a/FrmAllWorkWellStatis.cs b/FrmAllWorkWellStatis.cs index 6fec7af..6af8e4c 100644 --- a/FrmAllWorkWellStatis.cs +++ b/FrmAllWorkWellStatis.cs @@ -52,7 +52,7 @@ chartAllAreaPipeline.Series["井盖"].Points.DataBindXY(workWellLengthAndType.Keys, workWellLengthAndType.Values); for (int m = 0; m < workWellLengthAndType.Values.Count; m++) { - if (chartAllAreaPipeline.Series["井盖"].Points[m].YValues[0].ToString().Trim() != "0") + if (chartAllAreaPipeline.Series["井盖"].Points[m]!=null&&chartAllAreaPipeline.Series["井盖"].Points[m].YValues[0].ToString().Trim() != "0") { chartAllAreaPipeline.Series["井盖"].Points[m].Label = chartAllAreaPipeline.Series[0].Points[m].YValues[0].ToString(); } @@ -60,7 +60,7 @@ } catch (Exception ex) { - //LogError.PublishError(ex); + LogHelper.WriteLog(typeof(FrmAllWorkWellStatis), ex.Message); } } diff --git a/FrmBSQDuoBianXingStatis.cs b/FrmBSQDuoBianXingStatis.cs index e8b7d52..3e889b6 100644 --- a/FrmBSQDuoBianXingStatis.cs +++ b/FrmBSQDuoBianXingStatis.cs @@ -60,7 +60,7 @@ { for (int m = 0; m < bsq1.Values.Count; m++) { - if (chart1.Series["标识器"].Points[m].YValues[0].ToString() != "0") + if (chart1.Series["标识器"].Points[m]!=null&&chart1.Series["标识器"].Points[m].YValues[0].ToString() != "0") { count += Convert.ToInt16(chart1.Series[0].Points[m].YValues[0].ToString()); chart1.Series["标识器"].Points[m].Label = chart1.Series[0].Points[m].YValues[0].ToString(); diff --git a/FrmBSQDuoBianXingStreet.cs b/FrmBSQDuoBianXingStreet.cs index 2005ebb..1db5777 100644 --- a/FrmBSQDuoBianXingStreet.cs +++ b/FrmBSQDuoBianXingStreet.cs @@ -63,7 +63,7 @@ chartStatis.Series[0].Points.DataBindXY(bsq.Keys, bsq.Values); for (int m = 0; m < bsq.Values.Count; m++) { - if (chartStatis.Series[0].Points[m].YValues[0].ToString().Trim() != "0") + if (chartStatis.Series[0].Points[m]!=null&&chartStatis.Series[0].Points[m].YValues[0].ToString().Trim() != "0") { count += Convert.ToInt16(chartStatis.Series[0].Points[m].YValues[0].ToString()); chartStatis.Series[0].Points[m].Label = chartStatis.Series[0].Points[m].YValues[0].ToString(); diff --git a/FrmBSQStatis.cs b/FrmBSQStatis.cs index 390a55c..4aa0ee6 100644 --- a/FrmBSQStatis.cs +++ b/FrmBSQStatis.cs @@ -95,6 +95,8 @@ } } } + + dr.Close(); conn.Close(); for (int i = 0; i < typeLists.Count; i++) { @@ -123,7 +125,7 @@ chartStatis.Series[0].Points.DataBindXY(bsq.Keys, bsq.Values); for (int m = 0; m < bsq.Values.Count; m++) { - if (chartStatis.Series[0].Points[m].YValues[0].ToString().Trim() != "0") + if (chartStatis.Series[0].Points[m]!=null&&chartStatis.Series[0].Points[m].YValues[0].ToString().Trim() != "0") { //count += Convert.ToInt16(chartStatis.Series[0].Points[m].YValues[0].ToString()); chartStatis.Series[0].Points[m].Label = chartStatis.Series[0].Points[m].YValues[0].ToString(); diff --git a/FrmBSQStreet.cs b/FrmBSQStreet.cs index 9d88adb..7fbacad 100644 --- a/FrmBSQStreet.cs +++ b/FrmBSQStreet.cs @@ -44,7 +44,7 @@ chartStatis.Series[0].Points.DataBindXY(bsq.Keys, bsq.Values); for (int m = 0; m < bsq.Values.Count; m++) { - if (chartStatis.Series[0].Points[m].YValues[0].ToString().Trim() != "0") + if (chartStatis.Series[0].Points[m]!=null&&chartStatis.Series[0].Points[m].YValues[0].ToString().Trim() != "0") { count += Convert.ToInt16(chartStatis.Series[0].Points[m].YValues[0].ToString()); chartStatis.Series[0].Points[m].Label = chartStatis.Series[0].Points[m].YValues[0].ToString(); diff --git a/FrmBoosterValvers.cs b/FrmBoosterValvers.cs index 5061efc..df9b62b 100644 --- a/FrmBoosterValvers.cs +++ b/FrmBoosterValvers.cs @@ -236,199 +236,6 @@ count = 0; } } - /// - /// 添加火苗 - /// - /// - /// - /// - /// - private GSOFeature AddFire(double x,double y,double z) - { - // 烟火示例 - - string strResPath = Application.StartupPath + "/Resource"; - - // 烟火粒子示例,由三个发射器构成 - GSOGeoParticle geoParticle = new GSOGeoParticle(); - geoParticle.SetPosition(x, y, z); // 添加到这个经纬度位置 - geoParticle.AltitudeMode = EnumAltitudeMode.RelativeToGround; - - GSORingParticleEmitter emitter = new GSORingParticleEmitter(); - emitter.TexturePath = strResPath + "/ParticleImage/flare.png"; - - emitter.SetSizeFix(1, 1); - emitter.VelFix = 1; - emitter.VelRnd = 5; - - emitter.AngleXYFix = 0; - emitter.AngleXYRnd = 180; - - emitter.AngleXZFix = 90; - emitter.AngleXZRnd = 0; - - emitter.LifeFix = 0.5f; - emitter.LifeRnd = 0.0f; - - emitter.RotFix = 0; - emitter.RotRnd = 0; - - emitter.RotVelFix = 0; - emitter.RotVelRnd = 0; - - emitter.EmitPerSec = 100; - - // 采用线性插值生成粒子的初始颜色 - emitter.ColorRndStart = Color.White; - emitter.ColorRndEnd = Color.Red; - - - GSOColorParticleEffector effector2 = new GSOColorParticleEffector(); - effector2.SetColorChanged(0, -1, -1, 0); - effector2.StartTime = 0.0f; - effector2.EndTime = -1.0f; - emitter.AddEffector(effector2); - - // 将三个发射器添加到粒子对象中 - geoParticle.AddEmitter(emitter); - - geoParticle.Play(); - - GSOFeature feature = new GSOFeature(); - - feature.Geometry = geoParticle; - - globeControl1.Globe.MemoryLayer.AddFeature(feature); - - - return feature; - } - - /// - /// 添加喷泉 - /// - /// - private GSOFeature AddFountain() - { - string strResPath = Application.StartupPath + "/Resource"; - - GSOGeoParticle geoParticle = new GSOGeoParticle(); - geoParticle.SetPosition(116.314, 39.84, 0); // 添加到这个经纬度位置 - - GSOPointParticleEmitter emitter = new GSOPointParticleEmitter(); - emitter.TexturePath = strResPath + "/ParticleImage/test.png"; - - emitter.SetSizeFix(0.5f, 2); - emitter.VelFix = 10; - emitter.VelRnd = 2; - - emitter.GravityAcc = 9.8f; - emitter.AngleXYFix = 0; - emitter.AngleXYRnd = 180; - - emitter.AngleXZFix = 88; - emitter.AngleXZRnd = 2; - - //emitter.InnerRadius = 0; - // emitter.OuterRadius = 0.03f; - - emitter.LifeFix = 5.0f; - emitter.LifeRnd = 1.0f; - - emitter.RotFix = 0; - emitter.RotRnd = 0; - - emitter.RotVelFix = 0; - emitter.RotVelRnd = 0; - - emitter.EmitPerSec = 1000; - emitter.ColorRndStart = Color.FromArgb(33, 255, 255, 255); - emitter.ColorRndEnd = Color.FromArgb(11, 255, 255, 255); - emitter.IsLumAdded = false; - - // 将三个发射器添加到粒子对象中 - geoParticle.AddEmitter(emitter); - - geoParticle.Play(); - GSOFeature feature = new GSOFeature(); - - feature.Geometry = geoParticle; - - //globeControl1.Globe.MemoryLayer.AddFeature(feature); - globeControl1.Globe.FlyToFeature(feature); - - return feature; - } - - /// - /// 添加水柱 - /// - /// - private GSOFeature AddWaterLine() - { - string strResPath = Application.StartupPath + "/Resource"; - - GSOGeoParticle geoParticle = new GSOGeoParticle(); - geoParticle.SetPosition(116.308, 39.84, 0); // 添加到这个经纬度位置 - - GSOPointParticleEmitter emitter = new GSOPointParticleEmitter(); - - emitter.TexturePath = strResPath + "/ParticleImage/drop3.png"; - - geoParticle.TimerInterval = 1; - - emitter.SetSizeFix(2.0f, 2.0f); - - emitter.VelFix = 50; - emitter.VelRnd = 2; - - // emitter.IsLumAdded = false; - - emitter.GravityAcc = 9.8f; - emitter.AngleXYFix = 0; - emitter.AngleXYRnd = 2; - - emitter.AngleXZFix = 60; - emitter.AngleXZRnd = 2; - - //emitter.InnerRadius = 0; - // emitter.OuterRadius = 0.1f; - - emitter.LifeFix = 5.0f; - emitter.LifeRnd = 1.0f; - - emitter.RotFix = 0; - emitter.RotRnd = 0; - - emitter.RotVelFix = 0; - emitter.RotVelRnd = 0; - - emitter.EmitPerSec = 1500; - - emitter.ColorRndStart = Color.FromArgb(100, 222, 222, 222); - emitter.ColorRndEnd = Color.FromArgb(50, 222, 222, 222); - - /* - - GSOScaleParticleEffector effector1 = new GSOScaleParticleEffector(); - effector1.SetScale(0.2f, 0.2f); - effector1.StartTime = 0; - effector1.EndTime = -1; // 负数表示整个粒子生命结束 - emitter.AddEffector(effector1); - */ - - // 将三个发射器添加到粒子对象中 - geoParticle.AddEmitter(emitter); - - geoParticle.Play(); - GSOFeature feature = new GSOFeature(); - - feature.Geometry = geoParticle; - - //globeControl1.Globe.MemoryLayer.AddFeature(feature); - globeControl1.Globe.FlyToFeature(feature); - - return feature; - } + } } diff --git a/FrmBufferAnalysis.cs b/FrmBufferAnalysis.cs index f711133..db8ca59 100644 --- a/FrmBufferAnalysis.cs +++ b/FrmBufferAnalysis.cs @@ -123,39 +123,6 @@ } } /// - /// 半径文本框的键盘按键按下事件处理 - /// - /// - /// - private void txtRadius_KeyPress(object sender, KeyPressEventArgs e) - { - TextBox text = sender as TextBox; - if ((e.KeyChar < 48 || e.KeyChar > 57) && (e.KeyChar != 8) && (int)e.KeyChar != 46) - { - e.Handled = true; - } - if ((int)e.KeyChar == 46) //小数点 - { - if (text.Text.Length <= 0) - e.Handled = true; //小数点不能在第一位 - else //处理不规则的小数点 - { - float f; - float oldf; - bool b1 = false, b2 = false; - b1 = float.TryParse(text.Text, out oldf); - b2 = float.TryParse(text.Text + e.KeyChar.ToString(), out f); - if (b2 == false) - { - if (b1 == true) - e.Handled = true; - else - e.Handled = false; - } - } - } - } - /// /// 窗体关闭事件处理 /// /// diff --git a/FrmBufferAnalysisBSQ.cs b/FrmBufferAnalysisBSQ.cs index 24a96ca..f54208f 100644 --- a/FrmBufferAnalysisBSQ.cs +++ b/FrmBufferAnalysisBSQ.cs @@ -137,35 +137,7 @@ } } - private void txtRadius_KeyPress(object sender, KeyPressEventArgs e) - { - TextBox text = sender as TextBox; - if ((e.KeyChar < 48 || e.KeyChar > 57) && (e.KeyChar != 8) && (int)e.KeyChar != 46) - { - e.Handled = true; - } - if ((int)e.KeyChar == 46) //小数点 - { - if (text.Text.Length <= 0) - e.Handled = true; //小数点不能在第一位 - else //处理不规则的小数点 - { - float f; - float oldf; - bool b1 = false, b2 = false; - b1 = float.TryParse(text.Text, out oldf); - b2 = float.TryParse(text.Text + e.KeyChar.ToString(), out f); - if (b2 == false) - { - if (b1 == true) - e.Handled = true; - else - e.Handled = false; - } - } - } - } - + private void FrmBufferAnalysis_FormClosing(object sender, FormClosingEventArgs e) { //Form1.y = 0; @@ -316,27 +288,6 @@ } } - private void FlyToMenu_Click(object sender, EventArgs e) - { - if (m_feature != null) - { - if (m_feature.Geometry != null && m_feature.Geometry.Type == EnumGeometryType.GeoPolyline3D) - { - GSOGeoPolyline3D line = m_feature.Geometry as GSOGeoPolyline3D; - double length = line.GetSpaceLength(true, 6378137); - GSOGeoPolyline3D lineLine = line.GetSegment(0, length / 2); - GSOPoint3d point3d = lineLine[lineLine.PartCount - 1][lineLine[lineLine.PartCount - 1].Count - 1]; - - globeControl1.Globe.FlyToPosition(point3d, EnumAltitudeMode.Absolute, 0, 45, 5); - } - else - { - globeControl1.Globe.FlyToFeature(m_feature, 0, 45, 3); - } - LightMenu_Click(sender, e); - } - } - private void LightMenu_Click(object sender, EventArgs e) { flashflag = "single"; diff --git a/FrmDataBaseOpt.cs b/FrmDataBaseOpt.cs index b0c4b5d..8d7b69d 100644 --- a/FrmDataBaseOpt.cs +++ b/FrmDataBaseOpt.cs @@ -362,6 +362,7 @@ dbCombor.Items.Add(dblist[i].title); } } + /* /// /// 从配置文件读取数据库参数配置 /// @@ -428,6 +429,8 @@ } } + * */ + /* /// /// 向配置文件写入连接数据库的参数配置 /// @@ -485,6 +488,7 @@ MessageBox.Show(exp.ToString()); } } + * */ /// /// /// diff --git a/FrmDatabaseParaSetting.cs b/FrmDatabaseParaSetting.cs index a6fea46..63b596b 100644 --- a/FrmDatabaseParaSetting.cs +++ b/FrmDatabaseParaSetting.cs @@ -152,6 +152,7 @@ this.DialogResult = DialogResult.OK; this.Close(); } + /* /// /// 从配置文件读取数据库连接参数配置 /// @@ -218,6 +219,8 @@ } } + * */ + /* /// /// 向配置文件写入数据库参数配置 /// @@ -276,7 +279,7 @@ MessageBox.Show(ex.ToString()); } } - + */ /// /// 取消按钮事件处理 /// diff --git a/FrmDatabaseParaSetting2.cs b/FrmDatabaseParaSetting2.cs index 932d05e..96a87d5 100644 --- a/FrmDatabaseParaSetting2.cs +++ b/FrmDatabaseParaSetting2.cs @@ -148,6 +148,7 @@ this.DialogResult = DialogResult.OK; this.Close(); } + /* /// /// 从配置文件读取数据库连接参数配置 /// @@ -214,6 +215,8 @@ } } + * */ + /* /// /// 向配置文件写入数据库参数配置 /// @@ -272,7 +275,7 @@ MessageBox.Show(exp.ToString()); } } - + */ /// /// 取消按钮事件处理 /// diff --git a/FrmDiameterQuery.cs b/FrmDiameterQuery.cs index 68c948b..9a5215b 100644 --- a/FrmDiameterQuery.cs +++ b/FrmDiameterQuery.cs @@ -77,18 +77,7 @@ isBetween = true; } } - /// - /// 键盘按键按下事件处理 - /// - /// - /// - private void textBoxX1_KeyPress(object sender, KeyPressEventArgs e) - { - if ((e.KeyChar < 48 || e.KeyChar > 57) && e.KeyChar != 8) - { - e.Handled = true;//屏蔽 - } - } + bool isBetween = false; /// diff --git a/FrmDocumentEdit.cs b/FrmDocumentEdit.cs index aab2d31..e78a7ff 100644 --- a/FrmDocumentEdit.cs +++ b/FrmDocumentEdit.cs @@ -256,121 +256,6 @@ } - // - /// 将本地文件上传到指定的服务器(HttpWebRequest方法) - /// - /// 文件上传到的服务器 - /// 要上传的本地文件(全路径) - /// 文件上传后的名称 - /// 上传进度条 - /// 成功返回1,失败返回0 - private int Upload_Request(string address, string fileNamePath, string saveName, ProgressBar progressBar) - { - int returnValue = 0; - // 要上传的文件 - FileStream fs = new FileStream(fileNamePath, FileMode.Open, FileAccess.Read); - BinaryReader r = new BinaryReader(fs); - //时间戳 - string strBoundary = "----------" + DateTime.Now.Ticks.ToString("x"); - byte[] boundaryBytes = Encoding.ASCII.GetBytes("/r/n--" + strBoundary + "/r/n"); - //请求头部信息 - StringBuilder sb = new StringBuilder(); - sb.Append("--"); - sb.Append(strBoundary); - sb.Append("\r\n"); - sb.Append("Content-Disposition: form-data; name=\""); - sb.Append("file"); - sb.Append("\"; filename=\""); - sb.Append(saveName); - sb.Append("\""); - sb.Append("\r\n"); - sb.Append("Content-Type: "); - sb.Append("application/octet-stream"); - sb.Append("\r\n"); - sb.Append("\r\n"); - string strPostHeader = sb.ToString(); - byte[] postHeaderBytes = Encoding.UTF8.GetBytes(strPostHeader); - // 根据uri创建HttpWebRequest对象 - HttpWebRequest httpReq = (HttpWebRequest)WebRequest.Create(new Uri(address)); - httpReq.Method = "POST"; - //对发送的数据不使用缓存 - httpReq.AllowWriteStreamBuffering = false; - //设置获得响应的超时时间(300秒) - httpReq.Timeout = 300000; - httpReq.ContentType = "multipart/form-data; boundary=" + strBoundary; - long length = fs.Length + postHeaderBytes.Length + boundaryBytes.Length; - long fileLength = fs.Length; - httpReq.ContentLength = length; - try - { - progressBar.Maximum = int.MaxValue; - progressBar.Minimum = 0; - progressBar.Value = 0; - //每次上传4k - int bufferLength = 4096; - byte[] buffer = new byte[bufferLength]; - //已上传的字节数 - long offset = 0; - //开始上传时间 - DateTime startTime = DateTime.Now; - int size = r.Read(buffer, 0, bufferLength); - Stream postStream = httpReq.GetRequestStream(); - //发送请求头部消息 - postStream.Write(postHeaderBytes, 0, postHeaderBytes.Length); - while (size > 0) - { - postStream.Write(buffer, 0, size); - offset += size; - progressBar.Value = (int)(offset * (int.MaxValue / length)); - TimeSpan span = DateTime.Now - startTime; - double second = span.TotalSeconds; - //lblTime.Text = "已用时:" + second.ToString("F2") + "秒"; - //if (second > 0.001) - //{ - // lblSpeed.Text = " 平均速度:" + (offset / 1024 / second).ToString("0.00") + "KB/秒"; - //} - //else - //{ - // lblSpeed.Text = " 正在连接…"; - //} - //lblState.Text = "已上传:" + (offset * 100.0 / length).ToString("F2") + "%"; - //lblSize.Text = (offset / 1048576.0).ToString("F2") + "M/" + (fileLength / 1048576.0).ToString("F2") + "M"; - Application.DoEvents(); - size = r.Read(buffer, 0, bufferLength); - } - //添加尾部的时间戳 - postStream.Write(boundaryBytes, 0, boundaryBytes.Length); - postStream.Close(); - //获取服务器端的响应 - WebResponse webRespon = httpReq.GetResponse(); - Stream s = webRespon.GetResponseStream(); - StreamReader sr = new StreamReader(s); - //读取服务器端返回的消息 - String sReturnString = sr.ReadLine(); - s.Close(); - sr.Close(); - if (sReturnString == "Success") - { - returnValue = 1; - } - else if (sReturnString == "Error") - { - returnValue = 0; - } - } - catch(Exception ex) - { - returnValue = 0; - string str = ex.ToString(); - } - finally - { - fs.Close(); - r.Close(); - } - return returnValue; - } - private void btn_file_Click(object sender, EventArgs e) { OpenFileDialog dlg = new OpenFileDialog(); diff --git a/FrmExportCADS.cs b/FrmExportCADS.cs index 98772ea..59629dd 100644 --- a/FrmExportCADS.cs +++ b/FrmExportCADS.cs @@ -108,65 +108,6 @@ MessageBox.Show("请选中要导出的图层!", "提示", MessageBoxButtons.OK, MessageBoxIcon.Warning); } } - private Boolean MerageToFile(GSOFeatures features, String strDestFile, String strProj4)//图层追加 - { - if (features == null) - { - return false; - } - Boolean bSuccess = false; - - string strDir = GSOUtility.GetFileDir(strDestFile); - string strLPRJFile = GSOUtility.ChangeExt(strDestFile, ".lprj"); - string strExt = GSOUtility.GetFileExt(strDestFile); - - // 如果投影文件存在,投影以投影文件为准 - if (File.Exists(strLPRJFile)) - { - // 如果是dxf,则这样处理 - if (strExt.ToLower() == ".dxf") - { - string strTempSrcFile = strDir + "srcFeatures_dxftmp" + strExt; - globeControl1.Globe.DataManager.SaveFeatureData(features, strTempSrcFile, strLPRJFile, 4); - bSuccess = GSOUtility.MergeTwoDXFFileFeatures(strDestFile, strTempSrcFile); - File.Delete(strTempSrcFile); - } - else - { - GSOFeatures srcFeatures = globeControl1.Globe.DataManager.ReadFeatureData(strDestFile); - int nCount = features.Length; - int i = 0; - for (i = 0; i < nCount; i++) - { - srcFeatures.Add(features[i]); - } - bSuccess = globeControl1.Globe.DataManager.SaveFeatureData(srcFeatures, strDestFile, strLPRJFile, 4); - } - } - else - { - // 如果是dxf,则这样处理 - if (strExt.ToLower() == ".dxf") - { - string strTempSrcFile = strDir + "srcFeatures_dxftmp" + strExt; - globeControl1.Globe.DataManager.SaveFeatureData(features, strTempSrcFile, strProj4, 0); - bSuccess = GSOUtility.MergeTwoDXFFileFeatures(strDestFile, strTempSrcFile); - File.Delete(strTempSrcFile); - } - else - { - GSOFeatures srcFeatures = globeControl1.Globe.DataManager.ReadFeatureData(strDestFile); - int nCount = features.Length; - int i = 0; - for (i = 0; i < nCount; i++) - { - srcFeatures.Add(features[i]); - } - bSuccess = globeControl1.Globe.DataManager.SaveFeatureData(srcFeatures, strDestFile, strProj4, 0); - } - } - return bSuccess; - } /// /// 关闭按钮事件处理 /// diff --git a/FrmHDMAnalysis3.cs b/FrmHDMAnalysis3.cs index 4f73af6..2ada735 100644 --- a/FrmHDMAnalysis3.cs +++ b/FrmHDMAnalysis3.cs @@ -436,29 +436,6 @@ } layerTemp.RemoveAllFeature(); } - private void Export(GSOPoint3d _pnt, double r) - { - GSOPoint3ds pnts = new GSOPoint3ds(); - GSOPoint3d pnt = new GSOPoint3d(); - pnt.X = _pnt.X; - pnt.Y = _pnt.Y; - pnt.Z = _pnt.Z; - pnts.Add(pnt); - pnt.X = _pnt.X; - pnt.Y = _pnt.Y - 0.0000000005; - pnt.Z = _pnt.Z; - pnts.Add(pnt); - GSOGeoPolyline3D line = new GSOGeoPolyline3D(); - line.AddPart(pnts); - GSOGeoPolygon3D polygon = line.CreateBuffer(r * 2, true, 5, true, false); - GSOPoint3ds points = polygon[0]; - GSOGeoPolyline3D newLine = new GSOGeoPolyline3D(); - newLine.AddPart(points); - newLine.AltitudeMode = EnumAltitudeMode.RelativeToGround; - GSOFeature newFeature = new GSOFeature(); - newFeature.Geometry = newLine; - globeControl1.Globe.MemoryLayer.AddFeature(newFeature); - } private void ExportCAD(double a, double b, double r) { diff --git a/FrmHotFuncStat.cs b/FrmHotFuncStat.cs index c980f34..2eb1476 100644 --- a/FrmHotFuncStat.cs +++ b/FrmHotFuncStat.cs @@ -421,13 +421,6 @@ } } - private void HFS_Pderive_Click(object sender, EventArgs e) - { - if (TV_Files.SelectedNode != null) - { - HFSClass.GuideEdit_form("G", TV_Files, int.Parse(((ToolStripMenuItem)sender).Tag.ToString())); - } - } private void 导入ToolStripMenuItem_Click(object sender, EventArgs e) { @@ -530,22 +523,8 @@ } } - private void 导出ToolStripMenuItem1_Click(object sender, EventArgs e) - { - 导出ToolStripMenuItem2_Click(sender, e); - } + - private void TV_HFSSrchRslt_AfterCollapse(object sender, TreeViewEventArgs e) - { - e.Node.ImageIndex = 0; - } - - private void TV_HFSSrchRslt_AfterExpand(object sender, TreeViewEventArgs e) - { - HFSClass.ADD_TreeNode(TV_Files, e.Node); - e.Node.ImageIndex = 1; - } - private void 导出ToolStripMenuItem1_Click_1(object sender, EventArgs e) { if ((TV_HFSSrchRslt.SelectedNode != null) && (TV_HFSSrchRslt.SelectedNode.Parent != null)) diff --git a/FrmLayerControl.cs b/FrmLayerControl.cs index e7917c3..28fa14d 100644 --- a/FrmLayerControl.cs +++ b/FrmLayerControl.cs @@ -312,26 +312,7 @@ layerManagerNode.Expand(); terrainManagerNode.Expand(); } - /// - /// 刷新节点树 - /// - private void RefreshDataTree() - { - layerTree2.Nodes[0].Nodes.Clear(); - Int32 nCount = globeControl2.Globe.Layers.Count; - Int32 i = 0; - for (i = 0; i < nCount; i++) - { - GSODataset dataSpace = globeControl2.Globe.Layers[i].Dataset; - TreeNode node = new TreeNode(); - node.Text = dataSpace.Name; - node.ImageIndex = 0; - node.SelectedImageIndex = 0; - node.Checked = true; - node.Tag = dataSpace; - layerTree2.Nodes[0].Nodes.Add(node); - } - } + /// /// 目标图层按钮事件处理 /// @@ -494,22 +475,8 @@ } } } - /// - /// 改变指定节点的选中状态 - /// - /// - /// - private void CheckTreeNode(TreeNode node, Boolean bChecked) - { - CheckChildTreeNode(node, bChecked); - // 对于kml图层,如果当前处理的节点是true,那么要把所有的祖宗节点置为true - // 只有所有节点都未false,那么这个节点才为false - // CheckFatherTreeNode(node, bChecked); - globeControl1.Globe.Refresh(); - globeControl2.Globe.Refresh(); - - } + private void CheckChildTreeNode(TreeNode node, Boolean bChecked) { if (node == null) @@ -696,59 +663,7 @@ //} //CheckControl(e); } - /// - /// 树节点选中方法 - /// - /// - private void CheckControl(TreeViewEventArgs e) - { - if (e.Action != TreeViewAction.Unknown) - { - if (e.Node != null && !Convert.IsDBNull(e.Node)) - { - CheckParentNode(e.Node); - if (e.Node.Nodes.Count > 0) - { - CheckAllChildNodes(e.Node, e.Node.Checked); - } - } - } - } - /// - /// 改变所有子节点的状态 - /// - /// - /// - private void CheckAllChildNodes(TreeNode pn, bool IsChecked) - { - foreach (TreeNode tn in pn.Nodes) - { - tn.Checked = IsChecked; - if (tn.Tag.ToString().Contains("|")) - { - string nodeTag = tn.Tag.ToString().Split('|')[1]; - GSOLayer layer = globeControl1.Globe.Layers.GetLayerByCaption(nodeTag); - if (layer != null) - { - layer.Visible = IsChecked; - globeControl1.Globe.Refresh(); - } - } - if (tn.Tag is GSOFeature) - { - if (tn.Nodes.Count == 0) - { - GSOFeature feat = tn.Tag as GSOFeature; - feat.Visible = IsChecked; - globeControl1.Globe.Refresh(); - } - } - if (tn.Nodes.Count > 0) - { - CheckAllChildNodes(tn, IsChecked); - } - } - } + /// /// 改变父节点的选中状态,此处为所有子节点不选中时才取消父节点选中,可以根据需要修改 /// diff --git a/FrmLogin.cs b/FrmLogin.cs index 320fdd5..2afe46e 100644 --- a/FrmLogin.cs +++ b/FrmLogin.cs @@ -59,70 +59,6 @@ textBoxPassWord.Clear(); } } - - /// - /// 验证端口号 - /// - /// - private bool ValiPort() - { - Ping p = new Ping();//创建Ping对象p - PingReply pr = p.Send(Utility.localicenseserverip);//向指定IP或者主机名的计算机发送ICMP协议的ping数据包 - if (pr.Status == IPStatus.Success)//如果ping成功 - { - try - { - TcpClient tcpc = new TcpClient(Utility.localicenseserverip, Utility.localicenseserverport);//对IP地址为"192.168.0.105"的计算机的1500端口提出连接申请 - tcpc.Close(); - return true; - } - catch (Exception ex) - { - MessageBox.Show("端口连接错误!" + ex.Message); - return false; - } - } - else - { - int times = 0;//重新连接次数; - int count = 2;//设置尝试次数 - while (times < count) - { - //Thread.Sleep(1000);//等待时间(方便测试的话,你可以改为1000) - pr = p.Send(Utility.localicenseserverip); - - if (pr.Status == IPStatus.Success) - { - try - { - TcpClient tcpc = new TcpClient(Utility.localicenseserverip, Utility.localicenseserverport);//对IP地址为"192.168.0.105"的计算机的1500端口提出连接申请 - tcpc.Close(); - return true; - } - catch (Exception ex) - { - MessageBox.Show("端口连接错误!" + ex.Message); - return false; - } - } - else - { - times++; - if (times < count) - { - continue; - } - else - { - MessageBox.Show("重新尝试连接失败"); - return false; - } - } - - } - return false; - } - } /// /// 验证用户名、密码 /// diff --git a/FrmMetadata.cs b/FrmMetadata.cs index 886f65a..0365372 100644 --- a/FrmMetadata.cs +++ b/FrmMetadata.cs @@ -27,11 +27,7 @@ InitializeComponent(); loadTreeView(layerTree); } - private void FrmMetadata_Load(object sender, EventArgs e) - { - //this.ntLblC.Text = "nn"; - // loadTreeView(layerTree); - } + private void loadTreeView(TreeView tv)//构建图层树 { try diff --git a/FrmMetadataStat.cs b/FrmMetadataStat.cs index 790658a..e7696c6 100644 --- a/FrmMetadataStat.cs +++ b/FrmMetadataStat.cs @@ -197,9 +197,5 @@ } } - private void buttonX1_Click(object sender, EventArgs e) - { - drawChart(); - } } } diff --git a/FrmPatrolerManager.cs b/FrmPatrolerManager.cs index 37f8ffd..9e66aeb 100644 --- a/FrmPatrolerManager.cs +++ b/FrmPatrolerManager.cs @@ -109,82 +109,8 @@ this.winGridViewPager1.AllToExport = table; } - /// - /// 编辑 - /// - /// - /// - private void winGridViewPager1_OnEditSelected(object sender, EventArgs e) - { - - DataGridView grid = sender as DataGridView; - if (grid != null && grid.SelectedRows.Count>0) - { - DataGridViewRow row = grid.SelectedRows[0]; - try - { - long dbid = long.Parse(row.Cells["编号"].Value.ToString()); - String name = row.Cells["姓名"].Value.ToString(); - String sex = row.Cells["性别"].Value.ToString(); - String age = row.Cells["年龄"].Value.ToString(); - string phone = row.Cells["电话"].Value.ToString(); - age = String.IsNullOrEmpty(age.ToString().Trim()) ? "1" : age.ToString().Trim(); - FrmPatrolerEdit frm = new FrmPatrolerEdit(dbid.ToString(), name, age, sex, phone); - frm.reloadGrid += new ReloadPatrolerGrid(LoadData); - frm.ShowDialog(); - winGridViewPager1.Refresh(); - } - catch (Exception ex) - { - MessageBox.Show("编辑失败:" + ex.ToString(), "错误", MessageBoxButtons.OK, MessageBoxIcon.Error); - } - } - else - { - MessageBox.Show("没有选择记录", "提示"); - } - - } - - /// - /// 删除 - /// - /// - /// - private void winGridViewPager1_OnDeleteSelected(object sender, EventArgs e) - { - DataGridView grid = sender as DataGridView; - if (grid != null && grid.SelectedRows.Count > 0) - { - DataGridViewRow row = grid.SelectedRows[0]; - long dbid = long.Parse(row.Cells["编号"].Value.ToString()); - try - { - string state = row.Cells["状态"].Value.ToString(); - if ("在线".Equals(state)) - { - if (MessageBox.Show("确定注销?", "确认", MessageBoxButtons.YesNo, MessageBoxIcon.Question) == DialogResult.Yes) - { - String sql = "update patroler t set t.accountstate='LEAVER' where t.dbid=" + dbid; - OracleUtils.ExecuteNonQuery(OracleUtils.ConnectionString, CommandType.Text, sql); - } - } - else { - MessageBox.Show("人员不在线,无法注销", "信息"); - } - } - catch (Exception ex) - { - MessageBox.Show("人员注销失败:" + ex.ToString(), "错误", MessageBoxButtons.OK, MessageBoxIcon.Error); - } - } - else - { - MessageBox.Show("没有选择记录", "提示"); - } - } - - + + private void LoadData() { int pageIndex = winGridViewPager1.PagerInfo.CurrenetPageIndex; diff --git a/FrmRoadHDM.cs b/FrmRoadHDM.cs index e765313..e871dd5 100644 --- a/FrmRoadHDM.cs +++ b/FrmRoadHDM.cs @@ -333,31 +333,6 @@ this.Cursor = Cursors.Default; } } - - private void Export(GSOPoint3d _pnt, double r) - { - GSOPoint3ds pnts = new GSOPoint3ds(); - GSOPoint3d pnt = new GSOPoint3d(); - pnt.X = _pnt.X; - pnt.Y = _pnt.Y; - pnt.Z = _pnt.Z; - pnts.Add(pnt); - pnt.X = _pnt.X; - pnt.Y = _pnt.Y - 0.0000000005; - pnt.Z = _pnt.Z; - pnts.Add(pnt); - GSOGeoPolyline3D line = new GSOGeoPolyline3D(); - line.AddPart(pnts); - GSOGeoPolygon3D polygon = line.CreateBuffer(r * 2, true, 5, true, false); - GSOPoint3ds points = polygon[0]; - GSOGeoPolyline3D newLine = new GSOGeoPolyline3D(); - newLine.AddPart(points); - newLine.AltitudeMode = EnumAltitudeMode.RelativeToGround; - GSOFeature newFeature = new GSOFeature(); - newFeature.Geometry = newLine; - globeControl1.Globe.MemoryLayer.AddFeature(newFeature); - } - private void ExportCAD(double a, double b, double r) { GSOPoint3ds pnts = new GSOPoint3ds(); diff --git a/FrmUserAdd.cs b/FrmUserAdd.cs index c612ab4..f826427 100644 --- a/FrmUserAdd.cs +++ b/FrmUserAdd.cs @@ -231,24 +231,6 @@ //cbxRegion.SelectedIndexChanged += new EventHandler(cbxRegion_SelectedIndexChanged); } } - /// - /// 下拉框选中项改变事件处理 - /// - /// - /// - private void cbxRegion_SelectedIndexChanged(object sender, EventArgs e) - { - string sql = ""; - //string sql = "select casic_role.\"name\" from casic_role join casic_regionrole on casic_role.\"id\"=casic_regionrole.\"rid\" where casic_regionrole.\"reid\"=" + region[cbxRegion.SelectedItem.ToString().Trim()]; - DataTable dt = OledbHelper.QueryTable(sql); - if (dt != null && dt.Rows.Count > 0) - { - comboBoxExRegionRole.Items.Clear(); - for (int i = 0; i < dt.Rows.Count; i++) - { - comboBoxExRegionRole.Items.Add(dt.Rows[i][0].ToString().Trim());//部门角色 - } - } - } + } } diff --git a/FrmUserManager.cs b/FrmUserManager.cs index 571f0f0..ae254bc 100644 --- a/FrmUserManager.cs +++ b/FrmUserManager.cs @@ -81,11 +81,6 @@ } } } - //创建新用户 - private void buttonX2_Click(object sender, EventArgs e) - { - FrmUserAdd frm = new FrmUserAdd(-1); - frm.ShowDialog(); - } + } } diff --git a/Cyberpipe.csproj b/Cyberpipe.csproj index 07a8c1a..e3cd12c 100644 --- a/Cyberpipe.csproj +++ b/Cyberpipe.csproj @@ -204,25 +204,6 @@ - - Form - - - F_GKT1数据输入输出.cs - - - Form - - - F_GKT1添加文件.cs - - - Form - - - F_GKT1添加项目.cs - - Form @@ -1068,18 +1049,6 @@ Frm_password_reset.cs - - Form - - - GKT.cs - - - Form - - - GKT1.cs - Form @@ -1258,12 +1227,6 @@ F_Projedit.cs - - Form - - - PED.cs - Form @@ -1331,16 +1294,6 @@ True Reference.map - - F_GKT1数据输入输出.cs - Designer - - - F_GKT1添加文件.cs - - - F_GKT1添加项目.cs - Form_EditTask.cs @@ -1836,12 +1789,6 @@ Frm_password_reset.cs - - GKT.cs - - - GKT1.cs - F_GKT数据输入输出.cs @@ -1934,9 +1881,6 @@ F_Projedit.cs - - PED.cs - F_数据输入输出.cs diff --git a/Cyberpipe.suo b/Cyberpipe.suo index 68ced4f..a1aecf8 100644 --- a/Cyberpipe.suo +++ b/Cyberpipe.suo Binary files differ diff --git a/EMS_Forms/Form_EditTask.cs b/EMS_Forms/Form_EditTask.cs index 718992f..f1d791f 100644 --- a/EMS_Forms/Form_EditTask.cs +++ b/EMS_Forms/Form_EditTask.cs @@ -119,7 +119,8 @@ String name = Convert.ToString(dr["USERNAME"]); comboBox_userName.Items.Add(name); - } + } + dr.Close(); comboBox_road.Items.Clear(); roadList = new List(); @@ -135,7 +136,7 @@ comboBox_road.Items.Add(name); } } - + dr1.Close(); conn.Close(); bool flag2 = false; @@ -185,7 +186,7 @@ catch (Exception ex) { - MessageBox.Show(ex.ToString()); + LogHelper.WriteLog(typeof(Form_EditTask), ex.Message); } } @@ -288,7 +289,7 @@ } catch (Exception ex) { - MessageBox.Show(ex.ToString()); + LogHelper.WriteLog(typeof(Form_EditTask), ex.Message); } } @@ -474,7 +475,7 @@ } catch (Exception ex) { - MessageBox.Show(ex.ToString()); + LogHelper.WriteLog(typeof(Form_EditTask), ex.Message); } this.Close(); @@ -495,6 +496,7 @@ { numList.Add(Convert.ToInt32(dr["DBID"])); } + dr.Close(); if (numList.Count == 0) { taskNumber = Convert.ToInt32(number) * 100; @@ -674,6 +676,7 @@ } } } + dr.Close(); conn.Close(); } diff --git a/EMS_Forms/Form_EventManager.cs b/EMS_Forms/Form_EventManager.cs index b18c45b..84807b2 100644 --- a/EMS_Forms/Form_EventManager.cs +++ b/EMS_Forms/Form_EventManager.cs @@ -64,6 +64,7 @@ comboBox_name.Items.Add(name); } + dr.Close(); conn.Close(); diff --git a/Forms/FrmMnModify.cs b/Forms/FrmMnModify.cs index 31cfc5f..d036360 100644 --- a/Forms/FrmMnModify.cs +++ b/Forms/FrmMnModify.cs @@ -68,15 +68,7 @@ questionGrid.Rows[idx].Cells[1].Value = sr.question; } } - /// 选中对象 - /// - /// - /// - /// - private void buttonX1_Click(object sender, EventArgs e) - { - globecontrol.Globe.Action = EnumAction3D.SelectObject; - } + /// /// 选中某一行 /// diff --git a/Forms/FrmPipelineModelDataBase.cs b/Forms/FrmPipelineModelDataBase.cs index 2acf0ca..7ce573f 100644 --- a/Forms/FrmPipelineModelDataBase.cs +++ b/Forms/FrmPipelineModelDataBase.cs @@ -35,19 +35,7 @@ ds = _ds; InitializeComponent(); } - /// - /// 单击选择shp格式文件 - /// - /// - /// - private void btnBrowseModel_Click(object sender, EventArgs e) - { - saveFileDialog1.Filter = "*.lgd|*.lgd"; - if (saveFileDialog1.ShowDialog() == DialogResult.OK) - { - txtModelLayer.Text = saveFileDialog1.FileName; - } - } + /// /// 窗体初始化事件处理 /// @@ -100,49 +88,6 @@ } } } - - private object convertFieldValue(string fieldname, object obj) - { - if (obj == null) - return null; - - try - { - string type = fields_types[fieldname].ToString(); - switch (type) - { - case "string": - return obj.ToString(); - case "int": - //return 101; - int intResult; - if (int.TryParse(obj.ToString(), out intResult)) - return intResult; - else - return null; - case "double": - //return 202.5; - double doubleResult; - if (double.TryParse(obj.ToString(), out doubleResult)) - return doubleResult; - else - return null; - case "date": - DateTime dtResult; - if (DateTime.TryParse(obj.ToString(), out dtResult)) - return dtResult; - else - return null; - } - return null; - } - catch (Exception ex) - { - MessageBox.Show(ex.ToString()); - return null; - } - } - public string lgdFilePath = ""; /// /// 选择管线颜色 @@ -610,33 +555,6 @@ { this.Close(); } - - private void cmbLayer_SelectedIndexChanged(object sender, EventArgs e) //选择图层 - { - GSOLayer layer = ctl.Globe.Layers.GetLayerByCaption(selectLayerName); - GSOFeatures features = layer.GetAllFeatures(); - if (features.Length == 0) - return; - - cmbFrom.Items.Clear(); - cmbTo.Items.Clear(); - cmbRadius.Items.Clear(); - cmbID.Items.Clear(); - for (int i = 0; i < features[0].GetFieldCount(); i++) - { - GeoScene.Data.GSOFieldDefn fielddef = (GeoScene.Data.GSOFieldDefn)(features[0].GetFieldDefn(i)); - - cmbFrom.Items.Add(fielddef.Name); - cmbTo.Items.Add(fielddef.Name); - cmbRadius.Items.Add(fielddef.Name); - cmbID.Items.Add(fielddef.Name); - } - cmbFrom.SelectedItem = "Deep1"; - cmbTo.SelectedItem = "Deep2"; - cmbRadius.SelectedItem = "Diameter"; - cmbID.SelectedItem = "Handle"; - } - private void buttonXLayerPath_Click(object sender, EventArgs e)//单击 选择shp格式的文件 { OpenFileDialog dlg = new OpenFileDialog(); diff --git a/Forms/FrmPipelineModelDataOneStep.cs b/Forms/FrmPipelineModelDataOneStep.cs index 18afda7..ec93b8a 100644 --- a/Forms/FrmPipelineModelDataOneStep.cs +++ b/Forms/FrmPipelineModelDataOneStep.cs @@ -38,19 +38,7 @@ layerTree = _layerTree; InitializeComponent(); } - /// - /// 单击选择shp格式文件 - /// - /// - /// - private void btnBrowseModel_Click(object sender, EventArgs e) - { - saveFileDialog1.Filter = "*.lgd|*.lgd"; - if (saveFileDialog1.ShowDialog() == DialogResult.OK) - { - txtModelLayer.Text = saveFileDialog1.FileName; - } - } + /// /// 窗体初始化事件处理 /// @@ -107,48 +95,7 @@ } } - private object convertFieldValue(string fieldname, object obj) - { - if (obj == null) - return null; - - try - { - string type = fields_types[fieldname].ToString(); - switch (type) - { - case "string": - return obj.ToString(); - case "int": - //return 101; - int intResult; - if (int.TryParse(obj.ToString(), out intResult)) - return intResult; - else - return null; - case "double": - //return 202.5; - double doubleResult; - if (double.TryParse(obj.ToString(), out doubleResult)) - return doubleResult; - else - return null; - case "date": - DateTime dtResult; - if (DateTime.TryParse(obj.ToString(), out dtResult)) - return dtResult; - else - return null; - } - return null; - } - catch (Exception ex) - { - MessageBox.Show(ex.ToString()); - return null; - } - } - + public string lgdFilePath = ""; /// /// 选择管线颜色 @@ -673,32 +620,6 @@ return featDs; } - private void cmbLayer_SelectedIndexChanged(object sender, EventArgs e) //选择图层 - { - GSOLayer layer = ctl.Globe.Layers.GetLayerByCaption(selectLayerName); - GSOFeatures features = layer.GetAllFeatures(); - if (features.Length == 0) - return; - - cmbFrom.Items.Clear(); - cmbTo.Items.Clear(); - cmbRadius.Items.Clear(); - cmbID.Items.Clear(); - for (int i = 0; i < features[0].GetFieldCount(); i++) - { - GeoScene.Data.GSOFieldDefn fielddef = (GeoScene.Data.GSOFieldDefn)(features[0].GetFieldDefn(i)); - - cmbFrom.Items.Add(fielddef.Name); - cmbTo.Items.Add(fielddef.Name); - cmbRadius.Items.Add(fielddef.Name); - cmbID.Items.Add(fielddef.Name); - } - cmbFrom.SelectedItem = "Deep1"; - cmbTo.SelectedItem = "Deep2"; - cmbRadius.SelectedItem = "Diameter"; - cmbID.SelectedItem = "Handle"; - } - private void buttonXLayerPath_Click(object sender, EventArgs e)//单击 选择shp格式的文件 { OpenFileDialog dlg = new OpenFileDialog(); @@ -949,38 +870,6 @@ } //txtLayername.Text = type + layername; } - /// - /// 连接数据库 - /// - /// - /// - private void buttonX1_Click(object sender, EventArgs e) - { - if (ds == null) - { - //没连的话,直接连接审核库; //审核库配置读配置文件 - string dbIp = Utility.sgdbip; - string database = Utility.sgdbname; - string user = Utility.sgdbuser; - string pass = Utility.sgdbpwd; - - if (!Utility.isNetworkConnectionSuccess(dbIp.Trim())) - { - MessageBox.Show("网络连接失败!", "提示"); - return; - } - - ds = ctl.Globe.DataManager.OpenOracleDataSource(dbIp + "/" + database, "", "", user, pass); - if (ds == null) - { - MessageBox.Show("数据库连接失败!", "提示", MessageBoxButtons.OK, MessageBoxIcon.Warning); - } - else - { - btnCreateModel.Enabled = true; - } - } - } private void btnClose_Click(object sender, EventArgs e) { diff --git a/Forms/FrmShRK.cs b/Forms/FrmShRK.cs index 0e2e722..f1d83cb 100644 --- a/Forms/FrmShRK.cs +++ b/Forms/FrmShRK.cs @@ -215,6 +215,7 @@ { sourcefeatds = sourcefeat as GSOFeatureDataset; } + if (sourcefeatds == null) return; sourcefeatds.Open(); GSOFeatures sourcefeatures = sourcefeatds.GetAllFeatures(); @@ -251,6 +252,7 @@ { desfeatds = desfeat as GSOFeatureDataset; } + if (desfeatds == null) return; desfeatds.Open(); //向新数据集写入字段 diff --git a/FrmAccessoriesSensor.cs b/FrmAccessoriesSensor.cs index 09fcdf1..2a7a80e 100644 --- a/FrmAccessoriesSensor.cs +++ b/FrmAccessoriesSensor.cs @@ -209,7 +209,7 @@ chart1.Series[0].Points.DataBindXY(dic.Keys, dic.Values); for (int m = 0; m < dic.Values.Count; m++) { - if (chart1.Series[0].Points[m].YValues[0].ToString() != "0") + if (chart1.Series[0].Points[m]!=null&&chart1.Series[0].Points[m].YValues[0].ToString() != "0") { chart1.Series[0].Points[m].Label = chart1.Series[0].Points[m].YValues[0].ToString(); } diff --git a/FrmAccessoriesgather.cs b/FrmAccessoriesgather.cs index 9e331e1..a475d9e 100644 --- a/FrmAccessoriesgather.cs +++ b/FrmAccessoriesgather.cs @@ -338,7 +338,7 @@ chart1.Series[0].Points.DataBindXY(dic.Keys, dic.Values); for (int m = 0; m < dic.Values.Count; m++) { - if (chart1.Series[0].Points[m].YValues[0].ToString() != "0") + if (chart1.Series[0].Points[m]!=null&&chart1.Series[0].Points[m].YValues[0].ToString() != "0") { chart1.Series[0].Points[m].Label = chart1.Series[0].Points[m].YValues[0].ToString(); } diff --git a/FrmAccessoryAnalysis.cs b/FrmAccessoryAnalysis.cs index 71d4579..44d4065 100644 --- a/FrmAccessoryAnalysis.cs +++ b/FrmAccessoryAnalysis.cs @@ -66,39 +66,6 @@ globeControl1.Refresh(); } /// - /// 键盘按键按下事件处理 - /// - /// - /// - private void txtRadius_KeyPress(object sender, KeyPressEventArgs e) - { - TextBox text = sender as TextBox; - if ((e.KeyChar < 48 || e.KeyChar > 57) && (e.KeyChar != 8) && (int)e.KeyChar != 46) - { - e.Handled = true; - } - if ((int)e.KeyChar == 46) //小数点 - { - if (text.Text.Length <= 0) - e.Handled = true; //小数点不能在第一位 - else //处理不规则的小数点 - { - float f; - float oldf; - bool b1 = false, b2 = false; - b1 = float.TryParse(text.Text, out oldf); - b2 = float.TryParse(text.Text + e.KeyChar.ToString(), out f); - if (b2 == false) - { - if (b1 == true) - e.Handled = true; - else - e.Handled = false; - } - } - } - } - /// /// 确定按钮事件处理 /// /// diff --git a/FrmAddValve.cs b/FrmAddValve.cs index 34d2fec..5f405b9 100644 --- a/FrmAddValve.cs +++ b/FrmAddValve.cs @@ -486,56 +486,6 @@ } } - - - - - - - - private void cmbLayer_SelectedIndexChanged(object sender, EventArgs e) - { - GSOLayer layer = globeControl1.Globe.Layers.GetLayerByCaption(selectLayerName); - GSOFeatures features = layer.GetAllFeatures(); - if (features.Length == 0) - return; - - combPath.Items.Clear(); - combZ.Items.Clear(); - combModelName.Items.Clear(); - - for (int i = 0; i < features[0].GetFieldCount(); i++) - { - GeoScene.Data.GSOFieldDefn fielddef = (GeoScene.Data.GSOFieldDefn)(features[0].GetFieldDefn(i)); - combPath.Items.Add(fielddef.Name); - combZ.Items.Add(fielddef.Name); - combModelName.Items.Add(fielddef.Name); - } - combModelName.SelectedItem = "编号"; - combPath.SelectedItem = "模型路径"; - if (combfile.SelectedIndex != -1) - { - - string layerCaption = combfile.SelectedItem.ToString().Trim(); - rukuLayer = globeControl1.Globe.Layers.GetLayerByCaption(layerCaption); - if (rukuLayer != null) - { - combPath.Items.Clear(); - combZ.Items.Clear(); - combModelName.Items.Clear(); - - } - for (int i = 0; i < features[0].GetFieldCount(); i++) - { - GeoScene.Data.GSOFieldDefn fielddef = (GeoScene.Data.GSOFieldDefn)(features[0].GetFieldDefn(i)); - combPath.Items.Add(fielddef.Name); - combZ.Items.Add(fielddef.Name); - combModelName.Items.Add(fielddef.Name); - } - combModelName.SelectedItem = "编号"; - combPath.SelectedItem = "模型路径"; - } - } /// /// 单击选择shp格式文件 /// diff --git a/FrmAddWellShp.cs b/FrmAddWellShp.cs index bb79ec0..a249725 100644 --- a/FrmAddWellShp.cs +++ b/FrmAddWellShp.cs @@ -478,32 +478,6 @@ } } } - - private void cmbLayer_SelectedIndexChanged(object sender, EventArgs e) - { - GSOLayer layer = globeControl1.Globe.Layers.GetLayerByCaption(selectLayerName); - GSOFeatures features = layer.GetAllFeatures(); - if (features.Length == 0) - return; - - combCode.Items.Clear(); - combDeep.Items.Clear(); - combModelName.Items.Clear(); - combAngle.Items.Clear(); - - for (int i = 0; i < features[0].GetFieldCount(); i++) - { - GeoScene.Data.GSOFieldDefn fielddef = (GeoScene.Data.GSOFieldDefn)(features[0].GetFieldDefn(i)); - combCode.Items.Add(fielddef.Name); - combDeep.Items.Add(fielddef.Name); - combModelName.Items.Add(fielddef.Name); - combAngle.Items.Add(fielddef.Name); - } - combCode.SelectedItem = "附属物编码"; - combDeep.SelectedItem = "井深"; - combModelName.SelectedItem = "编号"; - combAngle.SelectedItem = "符号角度"; - } /// /// 单击选择shp格式文件 /// diff --git a/FrmAddYuBiZiShp.cs b/FrmAddYuBiZiShp.cs index b312d51..332f037 100644 --- a/FrmAddYuBiZiShp.cs +++ b/FrmAddYuBiZiShp.cs @@ -383,80 +383,7 @@ } } - private void cmbLayer_SelectedIndexChanged(object sender, EventArgs e) - { - GSOLayer layer = globeControl1.Globe.Layers.GetLayerByCaption(selectLayerName); - GSOFeatures features = layer.GetAllFeatures(); - if (features.Length == 0) - return; - - combCode.Items.Clear(); - combDeep.Items.Clear(); - combModelName.Items.Clear(); - //comboLoad.Items.Clear(); - for (int i = 0; i < features[0].GetFieldCount(); i++) - { - GeoScene.Data.GSOFieldDefn fielddef = (GeoScene.Data.GSOFieldDefn)(features[0].GetFieldDefn(i)); - combCode.Items.Add(fielddef.Name); - combDeep.Items.Add(fielddef.Name); - combModelName.Items.Add(fielddef.Name); - //comboLoad.Items.Add(fielddef.Name); - } - combCode.SelectedItem = "附属物编码"; - combDeep.SelectedItem = "Z坐标"; - combModelName.SelectedItem = "编号"; - //comboLoad.SelectedItem = "模型路径"; - } - - private void buttonXLayerPath_Click(object sender, EventArgs e) - { - OpenFileDialog dlg = new OpenFileDialog(); - dlg.Filter = "*.shp|*.shp"; - dlg.Multiselect = false; - if (dlg.ShowDialog() == DialogResult.OK) - { - GSOLayer layer = globeControl1.Globe.Layers.Add(dlg.FileName); - string txtMessage = valiYBdata(layer); - if (txtMessage != "") - { - button3.Enabled = false; - //textBoxLayer.Text = ""; - combCode.Items.Clear(); - combDeep.Items.Clear(); - combModelName.Items.Clear(); - globeControl1.Globe.Layers.Remove(layer); - FrmValiDataShowErrorMessage showErrorMessage = new FrmValiDataShowErrorMessage(dlg.FileName, txtMessage); - showErrorMessage.ShowDialog(); - return; - } - else - { - button3.Enabled = true; - //textBoxLayer.Text = dlg.FileName; - selectLayerName = layer.Caption; - txtLayerName.Text = layer.Caption; - GSOFeatures features = layer.GetAllFeatures(); - if (features.Length == 0) - return; - - combCode.Items.Clear(); - combDeep.Items.Clear(); - combModelName.Items.Clear(); - for (int i = 0; i < features[0].GetFieldCount(); i++) - { - GeoScene.Data.GSOFieldDefn fielddef = (GeoScene.Data.GSOFieldDefn)(features[0].GetFieldDefn(i)); - combCode.Items.Add(fielddef.Name); - combDeep.Items.Add(fielddef.Name); - combModelName.Items.Add(fielddef.Name); - //comboLoad.Items.Add(fielddef.Name); - } - combCode.SelectedItem = "管点编码"; - combDeep.SelectedItem = "Z坐标"; - combModelName.SelectedItem = "编号"; - } - } - } - + private void FrmAddYuBiZiShp_FormClosing(object sender, FormClosingEventArgs e) { globeControl1.Globe.Refresh(); diff --git a/FrmAllPipelineStatis.cs b/FrmAllPipelineStatis.cs index 6421a26..a6eea29 100644 --- a/FrmAllPipelineStatis.cs +++ b/FrmAllPipelineStatis.cs @@ -84,7 +84,7 @@ chartAllAreaPipeline.Series["管线"].Points.DataBindXY(pipelineLengthAndType.Keys, pipelineLengthAndType.Values); for (int m = 0; m < pipelineLengthAndType.Values.Count; m++) { - if (chartAllAreaPipeline.Series["管线"].Points[m].YValues[0].ToString() != "0") + if (chartAllAreaPipeline.Series["管线"].Points[m]!=null&&chartAllAreaPipeline.Series["管线"].Points[m].YValues[0].ToString() != "0") { chartAllAreaPipeline.Series["管线"].Points[m].Label = chartAllAreaPipeline.Series[0].Points[m].YValues[0].ToString(); } @@ -94,7 +94,7 @@ } catch (Exception ex) { - //LogError.PublishError(ex); + LogHelper.WriteLog(typeof(FrmAllPipelineStatis), ex.Message); } } @@ -147,7 +147,7 @@ } DataTable dt = OledbHelper.QueryTable(sql); - if (dt != null && dt.Rows.Count > 0) + if (dt != null && dt.Rows.Count > 0 && chartAllAreaPipeline.Series["管线"].Points[indexHit]!=null) { dataGridViewX1.DataSource = dt; panel.Visible = true; diff --git a/FrmAllWorkWellStatis.cs b/FrmAllWorkWellStatis.cs index 6fec7af..6af8e4c 100644 --- a/FrmAllWorkWellStatis.cs +++ b/FrmAllWorkWellStatis.cs @@ -52,7 +52,7 @@ chartAllAreaPipeline.Series["井盖"].Points.DataBindXY(workWellLengthAndType.Keys, workWellLengthAndType.Values); for (int m = 0; m < workWellLengthAndType.Values.Count; m++) { - if (chartAllAreaPipeline.Series["井盖"].Points[m].YValues[0].ToString().Trim() != "0") + if (chartAllAreaPipeline.Series["井盖"].Points[m]!=null&&chartAllAreaPipeline.Series["井盖"].Points[m].YValues[0].ToString().Trim() != "0") { chartAllAreaPipeline.Series["井盖"].Points[m].Label = chartAllAreaPipeline.Series[0].Points[m].YValues[0].ToString(); } @@ -60,7 +60,7 @@ } catch (Exception ex) { - //LogError.PublishError(ex); + LogHelper.WriteLog(typeof(FrmAllWorkWellStatis), ex.Message); } } diff --git a/FrmBSQDuoBianXingStatis.cs b/FrmBSQDuoBianXingStatis.cs index e8b7d52..3e889b6 100644 --- a/FrmBSQDuoBianXingStatis.cs +++ b/FrmBSQDuoBianXingStatis.cs @@ -60,7 +60,7 @@ { for (int m = 0; m < bsq1.Values.Count; m++) { - if (chart1.Series["标识器"].Points[m].YValues[0].ToString() != "0") + if (chart1.Series["标识器"].Points[m]!=null&&chart1.Series["标识器"].Points[m].YValues[0].ToString() != "0") { count += Convert.ToInt16(chart1.Series[0].Points[m].YValues[0].ToString()); chart1.Series["标识器"].Points[m].Label = chart1.Series[0].Points[m].YValues[0].ToString(); diff --git a/FrmBSQDuoBianXingStreet.cs b/FrmBSQDuoBianXingStreet.cs index 2005ebb..1db5777 100644 --- a/FrmBSQDuoBianXingStreet.cs +++ b/FrmBSQDuoBianXingStreet.cs @@ -63,7 +63,7 @@ chartStatis.Series[0].Points.DataBindXY(bsq.Keys, bsq.Values); for (int m = 0; m < bsq.Values.Count; m++) { - if (chartStatis.Series[0].Points[m].YValues[0].ToString().Trim() != "0") + if (chartStatis.Series[0].Points[m]!=null&&chartStatis.Series[0].Points[m].YValues[0].ToString().Trim() != "0") { count += Convert.ToInt16(chartStatis.Series[0].Points[m].YValues[0].ToString()); chartStatis.Series[0].Points[m].Label = chartStatis.Series[0].Points[m].YValues[0].ToString(); diff --git a/FrmBSQStatis.cs b/FrmBSQStatis.cs index 390a55c..4aa0ee6 100644 --- a/FrmBSQStatis.cs +++ b/FrmBSQStatis.cs @@ -95,6 +95,8 @@ } } } + + dr.Close(); conn.Close(); for (int i = 0; i < typeLists.Count; i++) { @@ -123,7 +125,7 @@ chartStatis.Series[0].Points.DataBindXY(bsq.Keys, bsq.Values); for (int m = 0; m < bsq.Values.Count; m++) { - if (chartStatis.Series[0].Points[m].YValues[0].ToString().Trim() != "0") + if (chartStatis.Series[0].Points[m]!=null&&chartStatis.Series[0].Points[m].YValues[0].ToString().Trim() != "0") { //count += Convert.ToInt16(chartStatis.Series[0].Points[m].YValues[0].ToString()); chartStatis.Series[0].Points[m].Label = chartStatis.Series[0].Points[m].YValues[0].ToString(); diff --git a/FrmBSQStreet.cs b/FrmBSQStreet.cs index 9d88adb..7fbacad 100644 --- a/FrmBSQStreet.cs +++ b/FrmBSQStreet.cs @@ -44,7 +44,7 @@ chartStatis.Series[0].Points.DataBindXY(bsq.Keys, bsq.Values); for (int m = 0; m < bsq.Values.Count; m++) { - if (chartStatis.Series[0].Points[m].YValues[0].ToString().Trim() != "0") + if (chartStatis.Series[0].Points[m]!=null&&chartStatis.Series[0].Points[m].YValues[0].ToString().Trim() != "0") { count += Convert.ToInt16(chartStatis.Series[0].Points[m].YValues[0].ToString()); chartStatis.Series[0].Points[m].Label = chartStatis.Series[0].Points[m].YValues[0].ToString(); diff --git a/FrmBoosterValvers.cs b/FrmBoosterValvers.cs index 5061efc..df9b62b 100644 --- a/FrmBoosterValvers.cs +++ b/FrmBoosterValvers.cs @@ -236,199 +236,6 @@ count = 0; } } - /// - /// 添加火苗 - /// - /// - /// - /// - /// - private GSOFeature AddFire(double x,double y,double z) - { - // 烟火示例 - - string strResPath = Application.StartupPath + "/Resource"; - - // 烟火粒子示例,由三个发射器构成 - GSOGeoParticle geoParticle = new GSOGeoParticle(); - geoParticle.SetPosition(x, y, z); // 添加到这个经纬度位置 - geoParticle.AltitudeMode = EnumAltitudeMode.RelativeToGround; - - GSORingParticleEmitter emitter = new GSORingParticleEmitter(); - emitter.TexturePath = strResPath + "/ParticleImage/flare.png"; - - emitter.SetSizeFix(1, 1); - emitter.VelFix = 1; - emitter.VelRnd = 5; - - emitter.AngleXYFix = 0; - emitter.AngleXYRnd = 180; - - emitter.AngleXZFix = 90; - emitter.AngleXZRnd = 0; - - emitter.LifeFix = 0.5f; - emitter.LifeRnd = 0.0f; - - emitter.RotFix = 0; - emitter.RotRnd = 0; - - emitter.RotVelFix = 0; - emitter.RotVelRnd = 0; - - emitter.EmitPerSec = 100; - - // 采用线性插值生成粒子的初始颜色 - emitter.ColorRndStart = Color.White; - emitter.ColorRndEnd = Color.Red; - - - GSOColorParticleEffector effector2 = new GSOColorParticleEffector(); - effector2.SetColorChanged(0, -1, -1, 0); - effector2.StartTime = 0.0f; - effector2.EndTime = -1.0f; - emitter.AddEffector(effector2); - - // 将三个发射器添加到粒子对象中 - geoParticle.AddEmitter(emitter); - - geoParticle.Play(); - - GSOFeature feature = new GSOFeature(); - - feature.Geometry = geoParticle; - - globeControl1.Globe.MemoryLayer.AddFeature(feature); - - - return feature; - } - - /// - /// 添加喷泉 - /// - /// - private GSOFeature AddFountain() - { - string strResPath = Application.StartupPath + "/Resource"; - - GSOGeoParticle geoParticle = new GSOGeoParticle(); - geoParticle.SetPosition(116.314, 39.84, 0); // 添加到这个经纬度位置 - - GSOPointParticleEmitter emitter = new GSOPointParticleEmitter(); - emitter.TexturePath = strResPath + "/ParticleImage/test.png"; - - emitter.SetSizeFix(0.5f, 2); - emitter.VelFix = 10; - emitter.VelRnd = 2; - - emitter.GravityAcc = 9.8f; - emitter.AngleXYFix = 0; - emitter.AngleXYRnd = 180; - - emitter.AngleXZFix = 88; - emitter.AngleXZRnd = 2; - - //emitter.InnerRadius = 0; - // emitter.OuterRadius = 0.03f; - - emitter.LifeFix = 5.0f; - emitter.LifeRnd = 1.0f; - - emitter.RotFix = 0; - emitter.RotRnd = 0; - - emitter.RotVelFix = 0; - emitter.RotVelRnd = 0; - - emitter.EmitPerSec = 1000; - emitter.ColorRndStart = Color.FromArgb(33, 255, 255, 255); - emitter.ColorRndEnd = Color.FromArgb(11, 255, 255, 255); - emitter.IsLumAdded = false; - - // 将三个发射器添加到粒子对象中 - geoParticle.AddEmitter(emitter); - - geoParticle.Play(); - GSOFeature feature = new GSOFeature(); - - feature.Geometry = geoParticle; - - //globeControl1.Globe.MemoryLayer.AddFeature(feature); - globeControl1.Globe.FlyToFeature(feature); - - return feature; - } - - /// - /// 添加水柱 - /// - /// - private GSOFeature AddWaterLine() - { - string strResPath = Application.StartupPath + "/Resource"; - - GSOGeoParticle geoParticle = new GSOGeoParticle(); - geoParticle.SetPosition(116.308, 39.84, 0); // 添加到这个经纬度位置 - - GSOPointParticleEmitter emitter = new GSOPointParticleEmitter(); - - emitter.TexturePath = strResPath + "/ParticleImage/drop3.png"; - - geoParticle.TimerInterval = 1; - - emitter.SetSizeFix(2.0f, 2.0f); - - emitter.VelFix = 50; - emitter.VelRnd = 2; - - // emitter.IsLumAdded = false; - - emitter.GravityAcc = 9.8f; - emitter.AngleXYFix = 0; - emitter.AngleXYRnd = 2; - - emitter.AngleXZFix = 60; - emitter.AngleXZRnd = 2; - - //emitter.InnerRadius = 0; - // emitter.OuterRadius = 0.1f; - - emitter.LifeFix = 5.0f; - emitter.LifeRnd = 1.0f; - - emitter.RotFix = 0; - emitter.RotRnd = 0; - - emitter.RotVelFix = 0; - emitter.RotVelRnd = 0; - - emitter.EmitPerSec = 1500; - - emitter.ColorRndStart = Color.FromArgb(100, 222, 222, 222); - emitter.ColorRndEnd = Color.FromArgb(50, 222, 222, 222); - - /* - - GSOScaleParticleEffector effector1 = new GSOScaleParticleEffector(); - effector1.SetScale(0.2f, 0.2f); - effector1.StartTime = 0; - effector1.EndTime = -1; // 负数表示整个粒子生命结束 - emitter.AddEffector(effector1); - */ - - // 将三个发射器添加到粒子对象中 - geoParticle.AddEmitter(emitter); - - geoParticle.Play(); - GSOFeature feature = new GSOFeature(); - - feature.Geometry = geoParticle; - - //globeControl1.Globe.MemoryLayer.AddFeature(feature); - globeControl1.Globe.FlyToFeature(feature); - - return feature; - } + } } diff --git a/FrmBufferAnalysis.cs b/FrmBufferAnalysis.cs index f711133..db8ca59 100644 --- a/FrmBufferAnalysis.cs +++ b/FrmBufferAnalysis.cs @@ -123,39 +123,6 @@ } } /// - /// 半径文本框的键盘按键按下事件处理 - /// - /// - /// - private void txtRadius_KeyPress(object sender, KeyPressEventArgs e) - { - TextBox text = sender as TextBox; - if ((e.KeyChar < 48 || e.KeyChar > 57) && (e.KeyChar != 8) && (int)e.KeyChar != 46) - { - e.Handled = true; - } - if ((int)e.KeyChar == 46) //小数点 - { - if (text.Text.Length <= 0) - e.Handled = true; //小数点不能在第一位 - else //处理不规则的小数点 - { - float f; - float oldf; - bool b1 = false, b2 = false; - b1 = float.TryParse(text.Text, out oldf); - b2 = float.TryParse(text.Text + e.KeyChar.ToString(), out f); - if (b2 == false) - { - if (b1 == true) - e.Handled = true; - else - e.Handled = false; - } - } - } - } - /// /// 窗体关闭事件处理 /// /// diff --git a/FrmBufferAnalysisBSQ.cs b/FrmBufferAnalysisBSQ.cs index 24a96ca..f54208f 100644 --- a/FrmBufferAnalysisBSQ.cs +++ b/FrmBufferAnalysisBSQ.cs @@ -137,35 +137,7 @@ } } - private void txtRadius_KeyPress(object sender, KeyPressEventArgs e) - { - TextBox text = sender as TextBox; - if ((e.KeyChar < 48 || e.KeyChar > 57) && (e.KeyChar != 8) && (int)e.KeyChar != 46) - { - e.Handled = true; - } - if ((int)e.KeyChar == 46) //小数点 - { - if (text.Text.Length <= 0) - e.Handled = true; //小数点不能在第一位 - else //处理不规则的小数点 - { - float f; - float oldf; - bool b1 = false, b2 = false; - b1 = float.TryParse(text.Text, out oldf); - b2 = float.TryParse(text.Text + e.KeyChar.ToString(), out f); - if (b2 == false) - { - if (b1 == true) - e.Handled = true; - else - e.Handled = false; - } - } - } - } - + private void FrmBufferAnalysis_FormClosing(object sender, FormClosingEventArgs e) { //Form1.y = 0; @@ -316,27 +288,6 @@ } } - private void FlyToMenu_Click(object sender, EventArgs e) - { - if (m_feature != null) - { - if (m_feature.Geometry != null && m_feature.Geometry.Type == EnumGeometryType.GeoPolyline3D) - { - GSOGeoPolyline3D line = m_feature.Geometry as GSOGeoPolyline3D; - double length = line.GetSpaceLength(true, 6378137); - GSOGeoPolyline3D lineLine = line.GetSegment(0, length / 2); - GSOPoint3d point3d = lineLine[lineLine.PartCount - 1][lineLine[lineLine.PartCount - 1].Count - 1]; - - globeControl1.Globe.FlyToPosition(point3d, EnumAltitudeMode.Absolute, 0, 45, 5); - } - else - { - globeControl1.Globe.FlyToFeature(m_feature, 0, 45, 3); - } - LightMenu_Click(sender, e); - } - } - private void LightMenu_Click(object sender, EventArgs e) { flashflag = "single"; diff --git a/FrmDataBaseOpt.cs b/FrmDataBaseOpt.cs index b0c4b5d..8d7b69d 100644 --- a/FrmDataBaseOpt.cs +++ b/FrmDataBaseOpt.cs @@ -362,6 +362,7 @@ dbCombor.Items.Add(dblist[i].title); } } + /* /// /// 从配置文件读取数据库参数配置 /// @@ -428,6 +429,8 @@ } } + * */ + /* /// /// 向配置文件写入连接数据库的参数配置 /// @@ -485,6 +488,7 @@ MessageBox.Show(exp.ToString()); } } + * */ /// /// /// diff --git a/FrmDatabaseParaSetting.cs b/FrmDatabaseParaSetting.cs index a6fea46..63b596b 100644 --- a/FrmDatabaseParaSetting.cs +++ b/FrmDatabaseParaSetting.cs @@ -152,6 +152,7 @@ this.DialogResult = DialogResult.OK; this.Close(); } + /* /// /// 从配置文件读取数据库连接参数配置 /// @@ -218,6 +219,8 @@ } } + * */ + /* /// /// 向配置文件写入数据库参数配置 /// @@ -276,7 +279,7 @@ MessageBox.Show(ex.ToString()); } } - + */ /// /// 取消按钮事件处理 /// diff --git a/FrmDatabaseParaSetting2.cs b/FrmDatabaseParaSetting2.cs index 932d05e..96a87d5 100644 --- a/FrmDatabaseParaSetting2.cs +++ b/FrmDatabaseParaSetting2.cs @@ -148,6 +148,7 @@ this.DialogResult = DialogResult.OK; this.Close(); } + /* /// /// 从配置文件读取数据库连接参数配置 /// @@ -214,6 +215,8 @@ } } + * */ + /* /// /// 向配置文件写入数据库参数配置 /// @@ -272,7 +275,7 @@ MessageBox.Show(exp.ToString()); } } - + */ /// /// 取消按钮事件处理 /// diff --git a/FrmDiameterQuery.cs b/FrmDiameterQuery.cs index 68c948b..9a5215b 100644 --- a/FrmDiameterQuery.cs +++ b/FrmDiameterQuery.cs @@ -77,18 +77,7 @@ isBetween = true; } } - /// - /// 键盘按键按下事件处理 - /// - /// - /// - private void textBoxX1_KeyPress(object sender, KeyPressEventArgs e) - { - if ((e.KeyChar < 48 || e.KeyChar > 57) && e.KeyChar != 8) - { - e.Handled = true;//屏蔽 - } - } + bool isBetween = false; /// diff --git a/FrmDocumentEdit.cs b/FrmDocumentEdit.cs index aab2d31..e78a7ff 100644 --- a/FrmDocumentEdit.cs +++ b/FrmDocumentEdit.cs @@ -256,121 +256,6 @@ } - // - /// 将本地文件上传到指定的服务器(HttpWebRequest方法) - /// - /// 文件上传到的服务器 - /// 要上传的本地文件(全路径) - /// 文件上传后的名称 - /// 上传进度条 - /// 成功返回1,失败返回0 - private int Upload_Request(string address, string fileNamePath, string saveName, ProgressBar progressBar) - { - int returnValue = 0; - // 要上传的文件 - FileStream fs = new FileStream(fileNamePath, FileMode.Open, FileAccess.Read); - BinaryReader r = new BinaryReader(fs); - //时间戳 - string strBoundary = "----------" + DateTime.Now.Ticks.ToString("x"); - byte[] boundaryBytes = Encoding.ASCII.GetBytes("/r/n--" + strBoundary + "/r/n"); - //请求头部信息 - StringBuilder sb = new StringBuilder(); - sb.Append("--"); - sb.Append(strBoundary); - sb.Append("\r\n"); - sb.Append("Content-Disposition: form-data; name=\""); - sb.Append("file"); - sb.Append("\"; filename=\""); - sb.Append(saveName); - sb.Append("\""); - sb.Append("\r\n"); - sb.Append("Content-Type: "); - sb.Append("application/octet-stream"); - sb.Append("\r\n"); - sb.Append("\r\n"); - string strPostHeader = sb.ToString(); - byte[] postHeaderBytes = Encoding.UTF8.GetBytes(strPostHeader); - // 根据uri创建HttpWebRequest对象 - HttpWebRequest httpReq = (HttpWebRequest)WebRequest.Create(new Uri(address)); - httpReq.Method = "POST"; - //对发送的数据不使用缓存 - httpReq.AllowWriteStreamBuffering = false; - //设置获得响应的超时时间(300秒) - httpReq.Timeout = 300000; - httpReq.ContentType = "multipart/form-data; boundary=" + strBoundary; - long length = fs.Length + postHeaderBytes.Length + boundaryBytes.Length; - long fileLength = fs.Length; - httpReq.ContentLength = length; - try - { - progressBar.Maximum = int.MaxValue; - progressBar.Minimum = 0; - progressBar.Value = 0; - //每次上传4k - int bufferLength = 4096; - byte[] buffer = new byte[bufferLength]; - //已上传的字节数 - long offset = 0; - //开始上传时间 - DateTime startTime = DateTime.Now; - int size = r.Read(buffer, 0, bufferLength); - Stream postStream = httpReq.GetRequestStream(); - //发送请求头部消息 - postStream.Write(postHeaderBytes, 0, postHeaderBytes.Length); - while (size > 0) - { - postStream.Write(buffer, 0, size); - offset += size; - progressBar.Value = (int)(offset * (int.MaxValue / length)); - TimeSpan span = DateTime.Now - startTime; - double second = span.TotalSeconds; - //lblTime.Text = "已用时:" + second.ToString("F2") + "秒"; - //if (second > 0.001) - //{ - // lblSpeed.Text = " 平均速度:" + (offset / 1024 / second).ToString("0.00") + "KB/秒"; - //} - //else - //{ - // lblSpeed.Text = " 正在连接…"; - //} - //lblState.Text = "已上传:" + (offset * 100.0 / length).ToString("F2") + "%"; - //lblSize.Text = (offset / 1048576.0).ToString("F2") + "M/" + (fileLength / 1048576.0).ToString("F2") + "M"; - Application.DoEvents(); - size = r.Read(buffer, 0, bufferLength); - } - //添加尾部的时间戳 - postStream.Write(boundaryBytes, 0, boundaryBytes.Length); - postStream.Close(); - //获取服务器端的响应 - WebResponse webRespon = httpReq.GetResponse(); - Stream s = webRespon.GetResponseStream(); - StreamReader sr = new StreamReader(s); - //读取服务器端返回的消息 - String sReturnString = sr.ReadLine(); - s.Close(); - sr.Close(); - if (sReturnString == "Success") - { - returnValue = 1; - } - else if (sReturnString == "Error") - { - returnValue = 0; - } - } - catch(Exception ex) - { - returnValue = 0; - string str = ex.ToString(); - } - finally - { - fs.Close(); - r.Close(); - } - return returnValue; - } - private void btn_file_Click(object sender, EventArgs e) { OpenFileDialog dlg = new OpenFileDialog(); diff --git a/FrmExportCADS.cs b/FrmExportCADS.cs index 98772ea..59629dd 100644 --- a/FrmExportCADS.cs +++ b/FrmExportCADS.cs @@ -108,65 +108,6 @@ MessageBox.Show("请选中要导出的图层!", "提示", MessageBoxButtons.OK, MessageBoxIcon.Warning); } } - private Boolean MerageToFile(GSOFeatures features, String strDestFile, String strProj4)//图层追加 - { - if (features == null) - { - return false; - } - Boolean bSuccess = false; - - string strDir = GSOUtility.GetFileDir(strDestFile); - string strLPRJFile = GSOUtility.ChangeExt(strDestFile, ".lprj"); - string strExt = GSOUtility.GetFileExt(strDestFile); - - // 如果投影文件存在,投影以投影文件为准 - if (File.Exists(strLPRJFile)) - { - // 如果是dxf,则这样处理 - if (strExt.ToLower() == ".dxf") - { - string strTempSrcFile = strDir + "srcFeatures_dxftmp" + strExt; - globeControl1.Globe.DataManager.SaveFeatureData(features, strTempSrcFile, strLPRJFile, 4); - bSuccess = GSOUtility.MergeTwoDXFFileFeatures(strDestFile, strTempSrcFile); - File.Delete(strTempSrcFile); - } - else - { - GSOFeatures srcFeatures = globeControl1.Globe.DataManager.ReadFeatureData(strDestFile); - int nCount = features.Length; - int i = 0; - for (i = 0; i < nCount; i++) - { - srcFeatures.Add(features[i]); - } - bSuccess = globeControl1.Globe.DataManager.SaveFeatureData(srcFeatures, strDestFile, strLPRJFile, 4); - } - } - else - { - // 如果是dxf,则这样处理 - if (strExt.ToLower() == ".dxf") - { - string strTempSrcFile = strDir + "srcFeatures_dxftmp" + strExt; - globeControl1.Globe.DataManager.SaveFeatureData(features, strTempSrcFile, strProj4, 0); - bSuccess = GSOUtility.MergeTwoDXFFileFeatures(strDestFile, strTempSrcFile); - File.Delete(strTempSrcFile); - } - else - { - GSOFeatures srcFeatures = globeControl1.Globe.DataManager.ReadFeatureData(strDestFile); - int nCount = features.Length; - int i = 0; - for (i = 0; i < nCount; i++) - { - srcFeatures.Add(features[i]); - } - bSuccess = globeControl1.Globe.DataManager.SaveFeatureData(srcFeatures, strDestFile, strProj4, 0); - } - } - return bSuccess; - } /// /// 关闭按钮事件处理 /// diff --git a/FrmHDMAnalysis3.cs b/FrmHDMAnalysis3.cs index 4f73af6..2ada735 100644 --- a/FrmHDMAnalysis3.cs +++ b/FrmHDMAnalysis3.cs @@ -436,29 +436,6 @@ } layerTemp.RemoveAllFeature(); } - private void Export(GSOPoint3d _pnt, double r) - { - GSOPoint3ds pnts = new GSOPoint3ds(); - GSOPoint3d pnt = new GSOPoint3d(); - pnt.X = _pnt.X; - pnt.Y = _pnt.Y; - pnt.Z = _pnt.Z; - pnts.Add(pnt); - pnt.X = _pnt.X; - pnt.Y = _pnt.Y - 0.0000000005; - pnt.Z = _pnt.Z; - pnts.Add(pnt); - GSOGeoPolyline3D line = new GSOGeoPolyline3D(); - line.AddPart(pnts); - GSOGeoPolygon3D polygon = line.CreateBuffer(r * 2, true, 5, true, false); - GSOPoint3ds points = polygon[0]; - GSOGeoPolyline3D newLine = new GSOGeoPolyline3D(); - newLine.AddPart(points); - newLine.AltitudeMode = EnumAltitudeMode.RelativeToGround; - GSOFeature newFeature = new GSOFeature(); - newFeature.Geometry = newLine; - globeControl1.Globe.MemoryLayer.AddFeature(newFeature); - } private void ExportCAD(double a, double b, double r) { diff --git a/FrmHotFuncStat.cs b/FrmHotFuncStat.cs index c980f34..2eb1476 100644 --- a/FrmHotFuncStat.cs +++ b/FrmHotFuncStat.cs @@ -421,13 +421,6 @@ } } - private void HFS_Pderive_Click(object sender, EventArgs e) - { - if (TV_Files.SelectedNode != null) - { - HFSClass.GuideEdit_form("G", TV_Files, int.Parse(((ToolStripMenuItem)sender).Tag.ToString())); - } - } private void 导入ToolStripMenuItem_Click(object sender, EventArgs e) { @@ -530,22 +523,8 @@ } } - private void 导出ToolStripMenuItem1_Click(object sender, EventArgs e) - { - 导出ToolStripMenuItem2_Click(sender, e); - } + - private void TV_HFSSrchRslt_AfterCollapse(object sender, TreeViewEventArgs e) - { - e.Node.ImageIndex = 0; - } - - private void TV_HFSSrchRslt_AfterExpand(object sender, TreeViewEventArgs e) - { - HFSClass.ADD_TreeNode(TV_Files, e.Node); - e.Node.ImageIndex = 1; - } - private void 导出ToolStripMenuItem1_Click_1(object sender, EventArgs e) { if ((TV_HFSSrchRslt.SelectedNode != null) && (TV_HFSSrchRslt.SelectedNode.Parent != null)) diff --git a/FrmLayerControl.cs b/FrmLayerControl.cs index e7917c3..28fa14d 100644 --- a/FrmLayerControl.cs +++ b/FrmLayerControl.cs @@ -312,26 +312,7 @@ layerManagerNode.Expand(); terrainManagerNode.Expand(); } - /// - /// 刷新节点树 - /// - private void RefreshDataTree() - { - layerTree2.Nodes[0].Nodes.Clear(); - Int32 nCount = globeControl2.Globe.Layers.Count; - Int32 i = 0; - for (i = 0; i < nCount; i++) - { - GSODataset dataSpace = globeControl2.Globe.Layers[i].Dataset; - TreeNode node = new TreeNode(); - node.Text = dataSpace.Name; - node.ImageIndex = 0; - node.SelectedImageIndex = 0; - node.Checked = true; - node.Tag = dataSpace; - layerTree2.Nodes[0].Nodes.Add(node); - } - } + /// /// 目标图层按钮事件处理 /// @@ -494,22 +475,8 @@ } } } - /// - /// 改变指定节点的选中状态 - /// - /// - /// - private void CheckTreeNode(TreeNode node, Boolean bChecked) - { - CheckChildTreeNode(node, bChecked); - // 对于kml图层,如果当前处理的节点是true,那么要把所有的祖宗节点置为true - // 只有所有节点都未false,那么这个节点才为false - // CheckFatherTreeNode(node, bChecked); - globeControl1.Globe.Refresh(); - globeControl2.Globe.Refresh(); - - } + private void CheckChildTreeNode(TreeNode node, Boolean bChecked) { if (node == null) @@ -696,59 +663,7 @@ //} //CheckControl(e); } - /// - /// 树节点选中方法 - /// - /// - private void CheckControl(TreeViewEventArgs e) - { - if (e.Action != TreeViewAction.Unknown) - { - if (e.Node != null && !Convert.IsDBNull(e.Node)) - { - CheckParentNode(e.Node); - if (e.Node.Nodes.Count > 0) - { - CheckAllChildNodes(e.Node, e.Node.Checked); - } - } - } - } - /// - /// 改变所有子节点的状态 - /// - /// - /// - private void CheckAllChildNodes(TreeNode pn, bool IsChecked) - { - foreach (TreeNode tn in pn.Nodes) - { - tn.Checked = IsChecked; - if (tn.Tag.ToString().Contains("|")) - { - string nodeTag = tn.Tag.ToString().Split('|')[1]; - GSOLayer layer = globeControl1.Globe.Layers.GetLayerByCaption(nodeTag); - if (layer != null) - { - layer.Visible = IsChecked; - globeControl1.Globe.Refresh(); - } - } - if (tn.Tag is GSOFeature) - { - if (tn.Nodes.Count == 0) - { - GSOFeature feat = tn.Tag as GSOFeature; - feat.Visible = IsChecked; - globeControl1.Globe.Refresh(); - } - } - if (tn.Nodes.Count > 0) - { - CheckAllChildNodes(tn, IsChecked); - } - } - } + /// /// 改变父节点的选中状态,此处为所有子节点不选中时才取消父节点选中,可以根据需要修改 /// diff --git a/FrmLogin.cs b/FrmLogin.cs index 320fdd5..2afe46e 100644 --- a/FrmLogin.cs +++ b/FrmLogin.cs @@ -59,70 +59,6 @@ textBoxPassWord.Clear(); } } - - /// - /// 验证端口号 - /// - /// - private bool ValiPort() - { - Ping p = new Ping();//创建Ping对象p - PingReply pr = p.Send(Utility.localicenseserverip);//向指定IP或者主机名的计算机发送ICMP协议的ping数据包 - if (pr.Status == IPStatus.Success)//如果ping成功 - { - try - { - TcpClient tcpc = new TcpClient(Utility.localicenseserverip, Utility.localicenseserverport);//对IP地址为"192.168.0.105"的计算机的1500端口提出连接申请 - tcpc.Close(); - return true; - } - catch (Exception ex) - { - MessageBox.Show("端口连接错误!" + ex.Message); - return false; - } - } - else - { - int times = 0;//重新连接次数; - int count = 2;//设置尝试次数 - while (times < count) - { - //Thread.Sleep(1000);//等待时间(方便测试的话,你可以改为1000) - pr = p.Send(Utility.localicenseserverip); - - if (pr.Status == IPStatus.Success) - { - try - { - TcpClient tcpc = new TcpClient(Utility.localicenseserverip, Utility.localicenseserverport);//对IP地址为"192.168.0.105"的计算机的1500端口提出连接申请 - tcpc.Close(); - return true; - } - catch (Exception ex) - { - MessageBox.Show("端口连接错误!" + ex.Message); - return false; - } - } - else - { - times++; - if (times < count) - { - continue; - } - else - { - MessageBox.Show("重新尝试连接失败"); - return false; - } - } - - } - return false; - } - } /// /// 验证用户名、密码 /// diff --git a/FrmMetadata.cs b/FrmMetadata.cs index 886f65a..0365372 100644 --- a/FrmMetadata.cs +++ b/FrmMetadata.cs @@ -27,11 +27,7 @@ InitializeComponent(); loadTreeView(layerTree); } - private void FrmMetadata_Load(object sender, EventArgs e) - { - //this.ntLblC.Text = "nn"; - // loadTreeView(layerTree); - } + private void loadTreeView(TreeView tv)//构建图层树 { try diff --git a/FrmMetadataStat.cs b/FrmMetadataStat.cs index 790658a..e7696c6 100644 --- a/FrmMetadataStat.cs +++ b/FrmMetadataStat.cs @@ -197,9 +197,5 @@ } } - private void buttonX1_Click(object sender, EventArgs e) - { - drawChart(); - } } } diff --git a/FrmPatrolerManager.cs b/FrmPatrolerManager.cs index 37f8ffd..9e66aeb 100644 --- a/FrmPatrolerManager.cs +++ b/FrmPatrolerManager.cs @@ -109,82 +109,8 @@ this.winGridViewPager1.AllToExport = table; } - /// - /// 编辑 - /// - /// - /// - private void winGridViewPager1_OnEditSelected(object sender, EventArgs e) - { - - DataGridView grid = sender as DataGridView; - if (grid != null && grid.SelectedRows.Count>0) - { - DataGridViewRow row = grid.SelectedRows[0]; - try - { - long dbid = long.Parse(row.Cells["编号"].Value.ToString()); - String name = row.Cells["姓名"].Value.ToString(); - String sex = row.Cells["性别"].Value.ToString(); - String age = row.Cells["年龄"].Value.ToString(); - string phone = row.Cells["电话"].Value.ToString(); - age = String.IsNullOrEmpty(age.ToString().Trim()) ? "1" : age.ToString().Trim(); - FrmPatrolerEdit frm = new FrmPatrolerEdit(dbid.ToString(), name, age, sex, phone); - frm.reloadGrid += new ReloadPatrolerGrid(LoadData); - frm.ShowDialog(); - winGridViewPager1.Refresh(); - } - catch (Exception ex) - { - MessageBox.Show("编辑失败:" + ex.ToString(), "错误", MessageBoxButtons.OK, MessageBoxIcon.Error); - } - } - else - { - MessageBox.Show("没有选择记录", "提示"); - } - - } - - /// - /// 删除 - /// - /// - /// - private void winGridViewPager1_OnDeleteSelected(object sender, EventArgs e) - { - DataGridView grid = sender as DataGridView; - if (grid != null && grid.SelectedRows.Count > 0) - { - DataGridViewRow row = grid.SelectedRows[0]; - long dbid = long.Parse(row.Cells["编号"].Value.ToString()); - try - { - string state = row.Cells["状态"].Value.ToString(); - if ("在线".Equals(state)) - { - if (MessageBox.Show("确定注销?", "确认", MessageBoxButtons.YesNo, MessageBoxIcon.Question) == DialogResult.Yes) - { - String sql = "update patroler t set t.accountstate='LEAVER' where t.dbid=" + dbid; - OracleUtils.ExecuteNonQuery(OracleUtils.ConnectionString, CommandType.Text, sql); - } - } - else { - MessageBox.Show("人员不在线,无法注销", "信息"); - } - } - catch (Exception ex) - { - MessageBox.Show("人员注销失败:" + ex.ToString(), "错误", MessageBoxButtons.OK, MessageBoxIcon.Error); - } - } - else - { - MessageBox.Show("没有选择记录", "提示"); - } - } - - + + private void LoadData() { int pageIndex = winGridViewPager1.PagerInfo.CurrenetPageIndex; diff --git a/FrmRoadHDM.cs b/FrmRoadHDM.cs index e765313..e871dd5 100644 --- a/FrmRoadHDM.cs +++ b/FrmRoadHDM.cs @@ -333,31 +333,6 @@ this.Cursor = Cursors.Default; } } - - private void Export(GSOPoint3d _pnt, double r) - { - GSOPoint3ds pnts = new GSOPoint3ds(); - GSOPoint3d pnt = new GSOPoint3d(); - pnt.X = _pnt.X; - pnt.Y = _pnt.Y; - pnt.Z = _pnt.Z; - pnts.Add(pnt); - pnt.X = _pnt.X; - pnt.Y = _pnt.Y - 0.0000000005; - pnt.Z = _pnt.Z; - pnts.Add(pnt); - GSOGeoPolyline3D line = new GSOGeoPolyline3D(); - line.AddPart(pnts); - GSOGeoPolygon3D polygon = line.CreateBuffer(r * 2, true, 5, true, false); - GSOPoint3ds points = polygon[0]; - GSOGeoPolyline3D newLine = new GSOGeoPolyline3D(); - newLine.AddPart(points); - newLine.AltitudeMode = EnumAltitudeMode.RelativeToGround; - GSOFeature newFeature = new GSOFeature(); - newFeature.Geometry = newLine; - globeControl1.Globe.MemoryLayer.AddFeature(newFeature); - } - private void ExportCAD(double a, double b, double r) { GSOPoint3ds pnts = new GSOPoint3ds(); diff --git a/FrmUserAdd.cs b/FrmUserAdd.cs index c612ab4..f826427 100644 --- a/FrmUserAdd.cs +++ b/FrmUserAdd.cs @@ -231,24 +231,6 @@ //cbxRegion.SelectedIndexChanged += new EventHandler(cbxRegion_SelectedIndexChanged); } } - /// - /// 下拉框选中项改变事件处理 - /// - /// - /// - private void cbxRegion_SelectedIndexChanged(object sender, EventArgs e) - { - string sql = ""; - //string sql = "select casic_role.\"name\" from casic_role join casic_regionrole on casic_role.\"id\"=casic_regionrole.\"rid\" where casic_regionrole.\"reid\"=" + region[cbxRegion.SelectedItem.ToString().Trim()]; - DataTable dt = OledbHelper.QueryTable(sql); - if (dt != null && dt.Rows.Count > 0) - { - comboBoxExRegionRole.Items.Clear(); - for (int i = 0; i < dt.Rows.Count; i++) - { - comboBoxExRegionRole.Items.Add(dt.Rows[i][0].ToString().Trim());//部门角色 - } - } - } + } } diff --git a/FrmUserManager.cs b/FrmUserManager.cs index 571f0f0..ae254bc 100644 --- a/FrmUserManager.cs +++ b/FrmUserManager.cs @@ -81,11 +81,6 @@ } } } - //创建新用户 - private void buttonX2_Click(object sender, EventArgs e) - { - FrmUserAdd frm = new FrmUserAdd(-1); - frm.ShowDialog(); - } + } } diff --git a/FrmValveStatistics.cs b/FrmValveStatistics.cs index 545d56c..dd76777 100644 --- a/FrmValveStatistics.cs +++ b/FrmValveStatistics.cs @@ -54,7 +54,7 @@ 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") + if (chaFamenStatis.Series["阀门"].Points[m]!=null&&chaFamenStatis.Series["阀门"].Points[m].YValues[0].ToString() != "0") { chaFamenStatis.Series["阀门"].Points[m].Label = chaFamenStatis.Series[0].Points[m].YValues[0].ToString(); } diff --git a/Cyberpipe.csproj b/Cyberpipe.csproj index 07a8c1a..e3cd12c 100644 --- a/Cyberpipe.csproj +++ b/Cyberpipe.csproj @@ -204,25 +204,6 @@ - - Form - - - F_GKT1数据输入输出.cs - - - Form - - - F_GKT1添加文件.cs - - - Form - - - F_GKT1添加项目.cs - - Form @@ -1068,18 +1049,6 @@ Frm_password_reset.cs - - Form - - - GKT.cs - - - Form - - - GKT1.cs - Form @@ -1258,12 +1227,6 @@ F_Projedit.cs - - Form - - - PED.cs - Form @@ -1331,16 +1294,6 @@ True Reference.map - - F_GKT1数据输入输出.cs - Designer - - - F_GKT1添加文件.cs - - - F_GKT1添加项目.cs - Form_EditTask.cs @@ -1836,12 +1789,6 @@ Frm_password_reset.cs - - GKT.cs - - - GKT1.cs - F_GKT数据输入输出.cs @@ -1934,9 +1881,6 @@ F_Projedit.cs - - PED.cs - F_数据输入输出.cs diff --git a/Cyberpipe.suo b/Cyberpipe.suo index 68ced4f..a1aecf8 100644 --- a/Cyberpipe.suo +++ b/Cyberpipe.suo Binary files differ diff --git a/EMS_Forms/Form_EditTask.cs b/EMS_Forms/Form_EditTask.cs index 718992f..f1d791f 100644 --- a/EMS_Forms/Form_EditTask.cs +++ b/EMS_Forms/Form_EditTask.cs @@ -119,7 +119,8 @@ String name = Convert.ToString(dr["USERNAME"]); comboBox_userName.Items.Add(name); - } + } + dr.Close(); comboBox_road.Items.Clear(); roadList = new List(); @@ -135,7 +136,7 @@ comboBox_road.Items.Add(name); } } - + dr1.Close(); conn.Close(); bool flag2 = false; @@ -185,7 +186,7 @@ catch (Exception ex) { - MessageBox.Show(ex.ToString()); + LogHelper.WriteLog(typeof(Form_EditTask), ex.Message); } } @@ -288,7 +289,7 @@ } catch (Exception ex) { - MessageBox.Show(ex.ToString()); + LogHelper.WriteLog(typeof(Form_EditTask), ex.Message); } } @@ -474,7 +475,7 @@ } catch (Exception ex) { - MessageBox.Show(ex.ToString()); + LogHelper.WriteLog(typeof(Form_EditTask), ex.Message); } this.Close(); @@ -495,6 +496,7 @@ { numList.Add(Convert.ToInt32(dr["DBID"])); } + dr.Close(); if (numList.Count == 0) { taskNumber = Convert.ToInt32(number) * 100; @@ -674,6 +676,7 @@ } } } + dr.Close(); conn.Close(); } diff --git a/EMS_Forms/Form_EventManager.cs b/EMS_Forms/Form_EventManager.cs index b18c45b..84807b2 100644 --- a/EMS_Forms/Form_EventManager.cs +++ b/EMS_Forms/Form_EventManager.cs @@ -64,6 +64,7 @@ comboBox_name.Items.Add(name); } + dr.Close(); conn.Close(); diff --git a/Forms/FrmMnModify.cs b/Forms/FrmMnModify.cs index 31cfc5f..d036360 100644 --- a/Forms/FrmMnModify.cs +++ b/Forms/FrmMnModify.cs @@ -68,15 +68,7 @@ questionGrid.Rows[idx].Cells[1].Value = sr.question; } } - /// 选中对象 - /// - /// - /// - /// - private void buttonX1_Click(object sender, EventArgs e) - { - globecontrol.Globe.Action = EnumAction3D.SelectObject; - } + /// /// 选中某一行 /// diff --git a/Forms/FrmPipelineModelDataBase.cs b/Forms/FrmPipelineModelDataBase.cs index 2acf0ca..7ce573f 100644 --- a/Forms/FrmPipelineModelDataBase.cs +++ b/Forms/FrmPipelineModelDataBase.cs @@ -35,19 +35,7 @@ ds = _ds; InitializeComponent(); } - /// - /// 单击选择shp格式文件 - /// - /// - /// - private void btnBrowseModel_Click(object sender, EventArgs e) - { - saveFileDialog1.Filter = "*.lgd|*.lgd"; - if (saveFileDialog1.ShowDialog() == DialogResult.OK) - { - txtModelLayer.Text = saveFileDialog1.FileName; - } - } + /// /// 窗体初始化事件处理 /// @@ -100,49 +88,6 @@ } } } - - private object convertFieldValue(string fieldname, object obj) - { - if (obj == null) - return null; - - try - { - string type = fields_types[fieldname].ToString(); - switch (type) - { - case "string": - return obj.ToString(); - case "int": - //return 101; - int intResult; - if (int.TryParse(obj.ToString(), out intResult)) - return intResult; - else - return null; - case "double": - //return 202.5; - double doubleResult; - if (double.TryParse(obj.ToString(), out doubleResult)) - return doubleResult; - else - return null; - case "date": - DateTime dtResult; - if (DateTime.TryParse(obj.ToString(), out dtResult)) - return dtResult; - else - return null; - } - return null; - } - catch (Exception ex) - { - MessageBox.Show(ex.ToString()); - return null; - } - } - public string lgdFilePath = ""; /// /// 选择管线颜色 @@ -610,33 +555,6 @@ { this.Close(); } - - private void cmbLayer_SelectedIndexChanged(object sender, EventArgs e) //选择图层 - { - GSOLayer layer = ctl.Globe.Layers.GetLayerByCaption(selectLayerName); - GSOFeatures features = layer.GetAllFeatures(); - if (features.Length == 0) - return; - - cmbFrom.Items.Clear(); - cmbTo.Items.Clear(); - cmbRadius.Items.Clear(); - cmbID.Items.Clear(); - for (int i = 0; i < features[0].GetFieldCount(); i++) - { - GeoScene.Data.GSOFieldDefn fielddef = (GeoScene.Data.GSOFieldDefn)(features[0].GetFieldDefn(i)); - - cmbFrom.Items.Add(fielddef.Name); - cmbTo.Items.Add(fielddef.Name); - cmbRadius.Items.Add(fielddef.Name); - cmbID.Items.Add(fielddef.Name); - } - cmbFrom.SelectedItem = "Deep1"; - cmbTo.SelectedItem = "Deep2"; - cmbRadius.SelectedItem = "Diameter"; - cmbID.SelectedItem = "Handle"; - } - private void buttonXLayerPath_Click(object sender, EventArgs e)//单击 选择shp格式的文件 { OpenFileDialog dlg = new OpenFileDialog(); diff --git a/Forms/FrmPipelineModelDataOneStep.cs b/Forms/FrmPipelineModelDataOneStep.cs index 18afda7..ec93b8a 100644 --- a/Forms/FrmPipelineModelDataOneStep.cs +++ b/Forms/FrmPipelineModelDataOneStep.cs @@ -38,19 +38,7 @@ layerTree = _layerTree; InitializeComponent(); } - /// - /// 单击选择shp格式文件 - /// - /// - /// - private void btnBrowseModel_Click(object sender, EventArgs e) - { - saveFileDialog1.Filter = "*.lgd|*.lgd"; - if (saveFileDialog1.ShowDialog() == DialogResult.OK) - { - txtModelLayer.Text = saveFileDialog1.FileName; - } - } + /// /// 窗体初始化事件处理 /// @@ -107,48 +95,7 @@ } } - private object convertFieldValue(string fieldname, object obj) - { - if (obj == null) - return null; - - try - { - string type = fields_types[fieldname].ToString(); - switch (type) - { - case "string": - return obj.ToString(); - case "int": - //return 101; - int intResult; - if (int.TryParse(obj.ToString(), out intResult)) - return intResult; - else - return null; - case "double": - //return 202.5; - double doubleResult; - if (double.TryParse(obj.ToString(), out doubleResult)) - return doubleResult; - else - return null; - case "date": - DateTime dtResult; - if (DateTime.TryParse(obj.ToString(), out dtResult)) - return dtResult; - else - return null; - } - return null; - } - catch (Exception ex) - { - MessageBox.Show(ex.ToString()); - return null; - } - } - + public string lgdFilePath = ""; /// /// 选择管线颜色 @@ -673,32 +620,6 @@ return featDs; } - private void cmbLayer_SelectedIndexChanged(object sender, EventArgs e) //选择图层 - { - GSOLayer layer = ctl.Globe.Layers.GetLayerByCaption(selectLayerName); - GSOFeatures features = layer.GetAllFeatures(); - if (features.Length == 0) - return; - - cmbFrom.Items.Clear(); - cmbTo.Items.Clear(); - cmbRadius.Items.Clear(); - cmbID.Items.Clear(); - for (int i = 0; i < features[0].GetFieldCount(); i++) - { - GeoScene.Data.GSOFieldDefn fielddef = (GeoScene.Data.GSOFieldDefn)(features[0].GetFieldDefn(i)); - - cmbFrom.Items.Add(fielddef.Name); - cmbTo.Items.Add(fielddef.Name); - cmbRadius.Items.Add(fielddef.Name); - cmbID.Items.Add(fielddef.Name); - } - cmbFrom.SelectedItem = "Deep1"; - cmbTo.SelectedItem = "Deep2"; - cmbRadius.SelectedItem = "Diameter"; - cmbID.SelectedItem = "Handle"; - } - private void buttonXLayerPath_Click(object sender, EventArgs e)//单击 选择shp格式的文件 { OpenFileDialog dlg = new OpenFileDialog(); @@ -949,38 +870,6 @@ } //txtLayername.Text = type + layername; } - /// - /// 连接数据库 - /// - /// - /// - private void buttonX1_Click(object sender, EventArgs e) - { - if (ds == null) - { - //没连的话,直接连接审核库; //审核库配置读配置文件 - string dbIp = Utility.sgdbip; - string database = Utility.sgdbname; - string user = Utility.sgdbuser; - string pass = Utility.sgdbpwd; - - if (!Utility.isNetworkConnectionSuccess(dbIp.Trim())) - { - MessageBox.Show("网络连接失败!", "提示"); - return; - } - - ds = ctl.Globe.DataManager.OpenOracleDataSource(dbIp + "/" + database, "", "", user, pass); - if (ds == null) - { - MessageBox.Show("数据库连接失败!", "提示", MessageBoxButtons.OK, MessageBoxIcon.Warning); - } - else - { - btnCreateModel.Enabled = true; - } - } - } private void btnClose_Click(object sender, EventArgs e) { diff --git a/Forms/FrmShRK.cs b/Forms/FrmShRK.cs index 0e2e722..f1d83cb 100644 --- a/Forms/FrmShRK.cs +++ b/Forms/FrmShRK.cs @@ -215,6 +215,7 @@ { sourcefeatds = sourcefeat as GSOFeatureDataset; } + if (sourcefeatds == null) return; sourcefeatds.Open(); GSOFeatures sourcefeatures = sourcefeatds.GetAllFeatures(); @@ -251,6 +252,7 @@ { desfeatds = desfeat as GSOFeatureDataset; } + if (desfeatds == null) return; desfeatds.Open(); //向新数据集写入字段 diff --git a/FrmAccessoriesSensor.cs b/FrmAccessoriesSensor.cs index 09fcdf1..2a7a80e 100644 --- a/FrmAccessoriesSensor.cs +++ b/FrmAccessoriesSensor.cs @@ -209,7 +209,7 @@ chart1.Series[0].Points.DataBindXY(dic.Keys, dic.Values); for (int m = 0; m < dic.Values.Count; m++) { - if (chart1.Series[0].Points[m].YValues[0].ToString() != "0") + if (chart1.Series[0].Points[m]!=null&&chart1.Series[0].Points[m].YValues[0].ToString() != "0") { chart1.Series[0].Points[m].Label = chart1.Series[0].Points[m].YValues[0].ToString(); } diff --git a/FrmAccessoriesgather.cs b/FrmAccessoriesgather.cs index 9e331e1..a475d9e 100644 --- a/FrmAccessoriesgather.cs +++ b/FrmAccessoriesgather.cs @@ -338,7 +338,7 @@ chart1.Series[0].Points.DataBindXY(dic.Keys, dic.Values); for (int m = 0; m < dic.Values.Count; m++) { - if (chart1.Series[0].Points[m].YValues[0].ToString() != "0") + if (chart1.Series[0].Points[m]!=null&&chart1.Series[0].Points[m].YValues[0].ToString() != "0") { chart1.Series[0].Points[m].Label = chart1.Series[0].Points[m].YValues[0].ToString(); } diff --git a/FrmAccessoryAnalysis.cs b/FrmAccessoryAnalysis.cs index 71d4579..44d4065 100644 --- a/FrmAccessoryAnalysis.cs +++ b/FrmAccessoryAnalysis.cs @@ -66,39 +66,6 @@ globeControl1.Refresh(); } /// - /// 键盘按键按下事件处理 - /// - /// - /// - private void txtRadius_KeyPress(object sender, KeyPressEventArgs e) - { - TextBox text = sender as TextBox; - if ((e.KeyChar < 48 || e.KeyChar > 57) && (e.KeyChar != 8) && (int)e.KeyChar != 46) - { - e.Handled = true; - } - if ((int)e.KeyChar == 46) //小数点 - { - if (text.Text.Length <= 0) - e.Handled = true; //小数点不能在第一位 - else //处理不规则的小数点 - { - float f; - float oldf; - bool b1 = false, b2 = false; - b1 = float.TryParse(text.Text, out oldf); - b2 = float.TryParse(text.Text + e.KeyChar.ToString(), out f); - if (b2 == false) - { - if (b1 == true) - e.Handled = true; - else - e.Handled = false; - } - } - } - } - /// /// 确定按钮事件处理 /// /// diff --git a/FrmAddValve.cs b/FrmAddValve.cs index 34d2fec..5f405b9 100644 --- a/FrmAddValve.cs +++ b/FrmAddValve.cs @@ -486,56 +486,6 @@ } } - - - - - - - - private void cmbLayer_SelectedIndexChanged(object sender, EventArgs e) - { - GSOLayer layer = globeControl1.Globe.Layers.GetLayerByCaption(selectLayerName); - GSOFeatures features = layer.GetAllFeatures(); - if (features.Length == 0) - return; - - combPath.Items.Clear(); - combZ.Items.Clear(); - combModelName.Items.Clear(); - - for (int i = 0; i < features[0].GetFieldCount(); i++) - { - GeoScene.Data.GSOFieldDefn fielddef = (GeoScene.Data.GSOFieldDefn)(features[0].GetFieldDefn(i)); - combPath.Items.Add(fielddef.Name); - combZ.Items.Add(fielddef.Name); - combModelName.Items.Add(fielddef.Name); - } - combModelName.SelectedItem = "编号"; - combPath.SelectedItem = "模型路径"; - if (combfile.SelectedIndex != -1) - { - - string layerCaption = combfile.SelectedItem.ToString().Trim(); - rukuLayer = globeControl1.Globe.Layers.GetLayerByCaption(layerCaption); - if (rukuLayer != null) - { - combPath.Items.Clear(); - combZ.Items.Clear(); - combModelName.Items.Clear(); - - } - for (int i = 0; i < features[0].GetFieldCount(); i++) - { - GeoScene.Data.GSOFieldDefn fielddef = (GeoScene.Data.GSOFieldDefn)(features[0].GetFieldDefn(i)); - combPath.Items.Add(fielddef.Name); - combZ.Items.Add(fielddef.Name); - combModelName.Items.Add(fielddef.Name); - } - combModelName.SelectedItem = "编号"; - combPath.SelectedItem = "模型路径"; - } - } /// /// 单击选择shp格式文件 /// diff --git a/FrmAddWellShp.cs b/FrmAddWellShp.cs index bb79ec0..a249725 100644 --- a/FrmAddWellShp.cs +++ b/FrmAddWellShp.cs @@ -478,32 +478,6 @@ } } } - - private void cmbLayer_SelectedIndexChanged(object sender, EventArgs e) - { - GSOLayer layer = globeControl1.Globe.Layers.GetLayerByCaption(selectLayerName); - GSOFeatures features = layer.GetAllFeatures(); - if (features.Length == 0) - return; - - combCode.Items.Clear(); - combDeep.Items.Clear(); - combModelName.Items.Clear(); - combAngle.Items.Clear(); - - for (int i = 0; i < features[0].GetFieldCount(); i++) - { - GeoScene.Data.GSOFieldDefn fielddef = (GeoScene.Data.GSOFieldDefn)(features[0].GetFieldDefn(i)); - combCode.Items.Add(fielddef.Name); - combDeep.Items.Add(fielddef.Name); - combModelName.Items.Add(fielddef.Name); - combAngle.Items.Add(fielddef.Name); - } - combCode.SelectedItem = "附属物编码"; - combDeep.SelectedItem = "井深"; - combModelName.SelectedItem = "编号"; - combAngle.SelectedItem = "符号角度"; - } /// /// 单击选择shp格式文件 /// diff --git a/FrmAddYuBiZiShp.cs b/FrmAddYuBiZiShp.cs index b312d51..332f037 100644 --- a/FrmAddYuBiZiShp.cs +++ b/FrmAddYuBiZiShp.cs @@ -383,80 +383,7 @@ } } - private void cmbLayer_SelectedIndexChanged(object sender, EventArgs e) - { - GSOLayer layer = globeControl1.Globe.Layers.GetLayerByCaption(selectLayerName); - GSOFeatures features = layer.GetAllFeatures(); - if (features.Length == 0) - return; - - combCode.Items.Clear(); - combDeep.Items.Clear(); - combModelName.Items.Clear(); - //comboLoad.Items.Clear(); - for (int i = 0; i < features[0].GetFieldCount(); i++) - { - GeoScene.Data.GSOFieldDefn fielddef = (GeoScene.Data.GSOFieldDefn)(features[0].GetFieldDefn(i)); - combCode.Items.Add(fielddef.Name); - combDeep.Items.Add(fielddef.Name); - combModelName.Items.Add(fielddef.Name); - //comboLoad.Items.Add(fielddef.Name); - } - combCode.SelectedItem = "附属物编码"; - combDeep.SelectedItem = "Z坐标"; - combModelName.SelectedItem = "编号"; - //comboLoad.SelectedItem = "模型路径"; - } - - private void buttonXLayerPath_Click(object sender, EventArgs e) - { - OpenFileDialog dlg = new OpenFileDialog(); - dlg.Filter = "*.shp|*.shp"; - dlg.Multiselect = false; - if (dlg.ShowDialog() == DialogResult.OK) - { - GSOLayer layer = globeControl1.Globe.Layers.Add(dlg.FileName); - string txtMessage = valiYBdata(layer); - if (txtMessage != "") - { - button3.Enabled = false; - //textBoxLayer.Text = ""; - combCode.Items.Clear(); - combDeep.Items.Clear(); - combModelName.Items.Clear(); - globeControl1.Globe.Layers.Remove(layer); - FrmValiDataShowErrorMessage showErrorMessage = new FrmValiDataShowErrorMessage(dlg.FileName, txtMessage); - showErrorMessage.ShowDialog(); - return; - } - else - { - button3.Enabled = true; - //textBoxLayer.Text = dlg.FileName; - selectLayerName = layer.Caption; - txtLayerName.Text = layer.Caption; - GSOFeatures features = layer.GetAllFeatures(); - if (features.Length == 0) - return; - - combCode.Items.Clear(); - combDeep.Items.Clear(); - combModelName.Items.Clear(); - for (int i = 0; i < features[0].GetFieldCount(); i++) - { - GeoScene.Data.GSOFieldDefn fielddef = (GeoScene.Data.GSOFieldDefn)(features[0].GetFieldDefn(i)); - combCode.Items.Add(fielddef.Name); - combDeep.Items.Add(fielddef.Name); - combModelName.Items.Add(fielddef.Name); - //comboLoad.Items.Add(fielddef.Name); - } - combCode.SelectedItem = "管点编码"; - combDeep.SelectedItem = "Z坐标"; - combModelName.SelectedItem = "编号"; - } - } - } - + private void FrmAddYuBiZiShp_FormClosing(object sender, FormClosingEventArgs e) { globeControl1.Globe.Refresh(); diff --git a/FrmAllPipelineStatis.cs b/FrmAllPipelineStatis.cs index 6421a26..a6eea29 100644 --- a/FrmAllPipelineStatis.cs +++ b/FrmAllPipelineStatis.cs @@ -84,7 +84,7 @@ chartAllAreaPipeline.Series["管线"].Points.DataBindXY(pipelineLengthAndType.Keys, pipelineLengthAndType.Values); for (int m = 0; m < pipelineLengthAndType.Values.Count; m++) { - if (chartAllAreaPipeline.Series["管线"].Points[m].YValues[0].ToString() != "0") + if (chartAllAreaPipeline.Series["管线"].Points[m]!=null&&chartAllAreaPipeline.Series["管线"].Points[m].YValues[0].ToString() != "0") { chartAllAreaPipeline.Series["管线"].Points[m].Label = chartAllAreaPipeline.Series[0].Points[m].YValues[0].ToString(); } @@ -94,7 +94,7 @@ } catch (Exception ex) { - //LogError.PublishError(ex); + LogHelper.WriteLog(typeof(FrmAllPipelineStatis), ex.Message); } } @@ -147,7 +147,7 @@ } DataTable dt = OledbHelper.QueryTable(sql); - if (dt != null && dt.Rows.Count > 0) + if (dt != null && dt.Rows.Count > 0 && chartAllAreaPipeline.Series["管线"].Points[indexHit]!=null) { dataGridViewX1.DataSource = dt; panel.Visible = true; diff --git a/FrmAllWorkWellStatis.cs b/FrmAllWorkWellStatis.cs index 6fec7af..6af8e4c 100644 --- a/FrmAllWorkWellStatis.cs +++ b/FrmAllWorkWellStatis.cs @@ -52,7 +52,7 @@ chartAllAreaPipeline.Series["井盖"].Points.DataBindXY(workWellLengthAndType.Keys, workWellLengthAndType.Values); for (int m = 0; m < workWellLengthAndType.Values.Count; m++) { - if (chartAllAreaPipeline.Series["井盖"].Points[m].YValues[0].ToString().Trim() != "0") + if (chartAllAreaPipeline.Series["井盖"].Points[m]!=null&&chartAllAreaPipeline.Series["井盖"].Points[m].YValues[0].ToString().Trim() != "0") { chartAllAreaPipeline.Series["井盖"].Points[m].Label = chartAllAreaPipeline.Series[0].Points[m].YValues[0].ToString(); } @@ -60,7 +60,7 @@ } catch (Exception ex) { - //LogError.PublishError(ex); + LogHelper.WriteLog(typeof(FrmAllWorkWellStatis), ex.Message); } } diff --git a/FrmBSQDuoBianXingStatis.cs b/FrmBSQDuoBianXingStatis.cs index e8b7d52..3e889b6 100644 --- a/FrmBSQDuoBianXingStatis.cs +++ b/FrmBSQDuoBianXingStatis.cs @@ -60,7 +60,7 @@ { for (int m = 0; m < bsq1.Values.Count; m++) { - if (chart1.Series["标识器"].Points[m].YValues[0].ToString() != "0") + if (chart1.Series["标识器"].Points[m]!=null&&chart1.Series["标识器"].Points[m].YValues[0].ToString() != "0") { count += Convert.ToInt16(chart1.Series[0].Points[m].YValues[0].ToString()); chart1.Series["标识器"].Points[m].Label = chart1.Series[0].Points[m].YValues[0].ToString(); diff --git a/FrmBSQDuoBianXingStreet.cs b/FrmBSQDuoBianXingStreet.cs index 2005ebb..1db5777 100644 --- a/FrmBSQDuoBianXingStreet.cs +++ b/FrmBSQDuoBianXingStreet.cs @@ -63,7 +63,7 @@ chartStatis.Series[0].Points.DataBindXY(bsq.Keys, bsq.Values); for (int m = 0; m < bsq.Values.Count; m++) { - if (chartStatis.Series[0].Points[m].YValues[0].ToString().Trim() != "0") + if (chartStatis.Series[0].Points[m]!=null&&chartStatis.Series[0].Points[m].YValues[0].ToString().Trim() != "0") { count += Convert.ToInt16(chartStatis.Series[0].Points[m].YValues[0].ToString()); chartStatis.Series[0].Points[m].Label = chartStatis.Series[0].Points[m].YValues[0].ToString(); diff --git a/FrmBSQStatis.cs b/FrmBSQStatis.cs index 390a55c..4aa0ee6 100644 --- a/FrmBSQStatis.cs +++ b/FrmBSQStatis.cs @@ -95,6 +95,8 @@ } } } + + dr.Close(); conn.Close(); for (int i = 0; i < typeLists.Count; i++) { @@ -123,7 +125,7 @@ chartStatis.Series[0].Points.DataBindXY(bsq.Keys, bsq.Values); for (int m = 0; m < bsq.Values.Count; m++) { - if (chartStatis.Series[0].Points[m].YValues[0].ToString().Trim() != "0") + if (chartStatis.Series[0].Points[m]!=null&&chartStatis.Series[0].Points[m].YValues[0].ToString().Trim() != "0") { //count += Convert.ToInt16(chartStatis.Series[0].Points[m].YValues[0].ToString()); chartStatis.Series[0].Points[m].Label = chartStatis.Series[0].Points[m].YValues[0].ToString(); diff --git a/FrmBSQStreet.cs b/FrmBSQStreet.cs index 9d88adb..7fbacad 100644 --- a/FrmBSQStreet.cs +++ b/FrmBSQStreet.cs @@ -44,7 +44,7 @@ chartStatis.Series[0].Points.DataBindXY(bsq.Keys, bsq.Values); for (int m = 0; m < bsq.Values.Count; m++) { - if (chartStatis.Series[0].Points[m].YValues[0].ToString().Trim() != "0") + if (chartStatis.Series[0].Points[m]!=null&&chartStatis.Series[0].Points[m].YValues[0].ToString().Trim() != "0") { count += Convert.ToInt16(chartStatis.Series[0].Points[m].YValues[0].ToString()); chartStatis.Series[0].Points[m].Label = chartStatis.Series[0].Points[m].YValues[0].ToString(); diff --git a/FrmBoosterValvers.cs b/FrmBoosterValvers.cs index 5061efc..df9b62b 100644 --- a/FrmBoosterValvers.cs +++ b/FrmBoosterValvers.cs @@ -236,199 +236,6 @@ count = 0; } } - /// - /// 添加火苗 - /// - /// - /// - /// - /// - private GSOFeature AddFire(double x,double y,double z) - { - // 烟火示例 - - string strResPath = Application.StartupPath + "/Resource"; - - // 烟火粒子示例,由三个发射器构成 - GSOGeoParticle geoParticle = new GSOGeoParticle(); - geoParticle.SetPosition(x, y, z); // 添加到这个经纬度位置 - geoParticle.AltitudeMode = EnumAltitudeMode.RelativeToGround; - - GSORingParticleEmitter emitter = new GSORingParticleEmitter(); - emitter.TexturePath = strResPath + "/ParticleImage/flare.png"; - - emitter.SetSizeFix(1, 1); - emitter.VelFix = 1; - emitter.VelRnd = 5; - - emitter.AngleXYFix = 0; - emitter.AngleXYRnd = 180; - - emitter.AngleXZFix = 90; - emitter.AngleXZRnd = 0; - - emitter.LifeFix = 0.5f; - emitter.LifeRnd = 0.0f; - - emitter.RotFix = 0; - emitter.RotRnd = 0; - - emitter.RotVelFix = 0; - emitter.RotVelRnd = 0; - - emitter.EmitPerSec = 100; - - // 采用线性插值生成粒子的初始颜色 - emitter.ColorRndStart = Color.White; - emitter.ColorRndEnd = Color.Red; - - - GSOColorParticleEffector effector2 = new GSOColorParticleEffector(); - effector2.SetColorChanged(0, -1, -1, 0); - effector2.StartTime = 0.0f; - effector2.EndTime = -1.0f; - emitter.AddEffector(effector2); - - // 将三个发射器添加到粒子对象中 - geoParticle.AddEmitter(emitter); - - geoParticle.Play(); - - GSOFeature feature = new GSOFeature(); - - feature.Geometry = geoParticle; - - globeControl1.Globe.MemoryLayer.AddFeature(feature); - - - return feature; - } - - /// - /// 添加喷泉 - /// - /// - private GSOFeature AddFountain() - { - string strResPath = Application.StartupPath + "/Resource"; - - GSOGeoParticle geoParticle = new GSOGeoParticle(); - geoParticle.SetPosition(116.314, 39.84, 0); // 添加到这个经纬度位置 - - GSOPointParticleEmitter emitter = new GSOPointParticleEmitter(); - emitter.TexturePath = strResPath + "/ParticleImage/test.png"; - - emitter.SetSizeFix(0.5f, 2); - emitter.VelFix = 10; - emitter.VelRnd = 2; - - emitter.GravityAcc = 9.8f; - emitter.AngleXYFix = 0; - emitter.AngleXYRnd = 180; - - emitter.AngleXZFix = 88; - emitter.AngleXZRnd = 2; - - //emitter.InnerRadius = 0; - // emitter.OuterRadius = 0.03f; - - emitter.LifeFix = 5.0f; - emitter.LifeRnd = 1.0f; - - emitter.RotFix = 0; - emitter.RotRnd = 0; - - emitter.RotVelFix = 0; - emitter.RotVelRnd = 0; - - emitter.EmitPerSec = 1000; - emitter.ColorRndStart = Color.FromArgb(33, 255, 255, 255); - emitter.ColorRndEnd = Color.FromArgb(11, 255, 255, 255); - emitter.IsLumAdded = false; - - // 将三个发射器添加到粒子对象中 - geoParticle.AddEmitter(emitter); - - geoParticle.Play(); - GSOFeature feature = new GSOFeature(); - - feature.Geometry = geoParticle; - - //globeControl1.Globe.MemoryLayer.AddFeature(feature); - globeControl1.Globe.FlyToFeature(feature); - - return feature; - } - - /// - /// 添加水柱 - /// - /// - private GSOFeature AddWaterLine() - { - string strResPath = Application.StartupPath + "/Resource"; - - GSOGeoParticle geoParticle = new GSOGeoParticle(); - geoParticle.SetPosition(116.308, 39.84, 0); // 添加到这个经纬度位置 - - GSOPointParticleEmitter emitter = new GSOPointParticleEmitter(); - - emitter.TexturePath = strResPath + "/ParticleImage/drop3.png"; - - geoParticle.TimerInterval = 1; - - emitter.SetSizeFix(2.0f, 2.0f); - - emitter.VelFix = 50; - emitter.VelRnd = 2; - - // emitter.IsLumAdded = false; - - emitter.GravityAcc = 9.8f; - emitter.AngleXYFix = 0; - emitter.AngleXYRnd = 2; - - emitter.AngleXZFix = 60; - emitter.AngleXZRnd = 2; - - //emitter.InnerRadius = 0; - // emitter.OuterRadius = 0.1f; - - emitter.LifeFix = 5.0f; - emitter.LifeRnd = 1.0f; - - emitter.RotFix = 0; - emitter.RotRnd = 0; - - emitter.RotVelFix = 0; - emitter.RotVelRnd = 0; - - emitter.EmitPerSec = 1500; - - emitter.ColorRndStart = Color.FromArgb(100, 222, 222, 222); - emitter.ColorRndEnd = Color.FromArgb(50, 222, 222, 222); - - /* - - GSOScaleParticleEffector effector1 = new GSOScaleParticleEffector(); - effector1.SetScale(0.2f, 0.2f); - effector1.StartTime = 0; - effector1.EndTime = -1; // 负数表示整个粒子生命结束 - emitter.AddEffector(effector1); - */ - - // 将三个发射器添加到粒子对象中 - geoParticle.AddEmitter(emitter); - - geoParticle.Play(); - GSOFeature feature = new GSOFeature(); - - feature.Geometry = geoParticle; - - //globeControl1.Globe.MemoryLayer.AddFeature(feature); - globeControl1.Globe.FlyToFeature(feature); - - return feature; - } + } } diff --git a/FrmBufferAnalysis.cs b/FrmBufferAnalysis.cs index f711133..db8ca59 100644 --- a/FrmBufferAnalysis.cs +++ b/FrmBufferAnalysis.cs @@ -123,39 +123,6 @@ } } /// - /// 半径文本框的键盘按键按下事件处理 - /// - /// - /// - private void txtRadius_KeyPress(object sender, KeyPressEventArgs e) - { - TextBox text = sender as TextBox; - if ((e.KeyChar < 48 || e.KeyChar > 57) && (e.KeyChar != 8) && (int)e.KeyChar != 46) - { - e.Handled = true; - } - if ((int)e.KeyChar == 46) //小数点 - { - if (text.Text.Length <= 0) - e.Handled = true; //小数点不能在第一位 - else //处理不规则的小数点 - { - float f; - float oldf; - bool b1 = false, b2 = false; - b1 = float.TryParse(text.Text, out oldf); - b2 = float.TryParse(text.Text + e.KeyChar.ToString(), out f); - if (b2 == false) - { - if (b1 == true) - e.Handled = true; - else - e.Handled = false; - } - } - } - } - /// /// 窗体关闭事件处理 /// /// diff --git a/FrmBufferAnalysisBSQ.cs b/FrmBufferAnalysisBSQ.cs index 24a96ca..f54208f 100644 --- a/FrmBufferAnalysisBSQ.cs +++ b/FrmBufferAnalysisBSQ.cs @@ -137,35 +137,7 @@ } } - private void txtRadius_KeyPress(object sender, KeyPressEventArgs e) - { - TextBox text = sender as TextBox; - if ((e.KeyChar < 48 || e.KeyChar > 57) && (e.KeyChar != 8) && (int)e.KeyChar != 46) - { - e.Handled = true; - } - if ((int)e.KeyChar == 46) //小数点 - { - if (text.Text.Length <= 0) - e.Handled = true; //小数点不能在第一位 - else //处理不规则的小数点 - { - float f; - float oldf; - bool b1 = false, b2 = false; - b1 = float.TryParse(text.Text, out oldf); - b2 = float.TryParse(text.Text + e.KeyChar.ToString(), out f); - if (b2 == false) - { - if (b1 == true) - e.Handled = true; - else - e.Handled = false; - } - } - } - } - + private void FrmBufferAnalysis_FormClosing(object sender, FormClosingEventArgs e) { //Form1.y = 0; @@ -316,27 +288,6 @@ } } - private void FlyToMenu_Click(object sender, EventArgs e) - { - if (m_feature != null) - { - if (m_feature.Geometry != null && m_feature.Geometry.Type == EnumGeometryType.GeoPolyline3D) - { - GSOGeoPolyline3D line = m_feature.Geometry as GSOGeoPolyline3D; - double length = line.GetSpaceLength(true, 6378137); - GSOGeoPolyline3D lineLine = line.GetSegment(0, length / 2); - GSOPoint3d point3d = lineLine[lineLine.PartCount - 1][lineLine[lineLine.PartCount - 1].Count - 1]; - - globeControl1.Globe.FlyToPosition(point3d, EnumAltitudeMode.Absolute, 0, 45, 5); - } - else - { - globeControl1.Globe.FlyToFeature(m_feature, 0, 45, 3); - } - LightMenu_Click(sender, e); - } - } - private void LightMenu_Click(object sender, EventArgs e) { flashflag = "single"; diff --git a/FrmDataBaseOpt.cs b/FrmDataBaseOpt.cs index b0c4b5d..8d7b69d 100644 --- a/FrmDataBaseOpt.cs +++ b/FrmDataBaseOpt.cs @@ -362,6 +362,7 @@ dbCombor.Items.Add(dblist[i].title); } } + /* /// /// 从配置文件读取数据库参数配置 /// @@ -428,6 +429,8 @@ } } + * */ + /* /// /// 向配置文件写入连接数据库的参数配置 /// @@ -485,6 +488,7 @@ MessageBox.Show(exp.ToString()); } } + * */ /// /// /// diff --git a/FrmDatabaseParaSetting.cs b/FrmDatabaseParaSetting.cs index a6fea46..63b596b 100644 --- a/FrmDatabaseParaSetting.cs +++ b/FrmDatabaseParaSetting.cs @@ -152,6 +152,7 @@ this.DialogResult = DialogResult.OK; this.Close(); } + /* /// /// 从配置文件读取数据库连接参数配置 /// @@ -218,6 +219,8 @@ } } + * */ + /* /// /// 向配置文件写入数据库参数配置 /// @@ -276,7 +279,7 @@ MessageBox.Show(ex.ToString()); } } - + */ /// /// 取消按钮事件处理 /// diff --git a/FrmDatabaseParaSetting2.cs b/FrmDatabaseParaSetting2.cs index 932d05e..96a87d5 100644 --- a/FrmDatabaseParaSetting2.cs +++ b/FrmDatabaseParaSetting2.cs @@ -148,6 +148,7 @@ this.DialogResult = DialogResult.OK; this.Close(); } + /* /// /// 从配置文件读取数据库连接参数配置 /// @@ -214,6 +215,8 @@ } } + * */ + /* /// /// 向配置文件写入数据库参数配置 /// @@ -272,7 +275,7 @@ MessageBox.Show(exp.ToString()); } } - + */ /// /// 取消按钮事件处理 /// diff --git a/FrmDiameterQuery.cs b/FrmDiameterQuery.cs index 68c948b..9a5215b 100644 --- a/FrmDiameterQuery.cs +++ b/FrmDiameterQuery.cs @@ -77,18 +77,7 @@ isBetween = true; } } - /// - /// 键盘按键按下事件处理 - /// - /// - /// - private void textBoxX1_KeyPress(object sender, KeyPressEventArgs e) - { - if ((e.KeyChar < 48 || e.KeyChar > 57) && e.KeyChar != 8) - { - e.Handled = true;//屏蔽 - } - } + bool isBetween = false; /// diff --git a/FrmDocumentEdit.cs b/FrmDocumentEdit.cs index aab2d31..e78a7ff 100644 --- a/FrmDocumentEdit.cs +++ b/FrmDocumentEdit.cs @@ -256,121 +256,6 @@ } - // - /// 将本地文件上传到指定的服务器(HttpWebRequest方法) - /// - /// 文件上传到的服务器 - /// 要上传的本地文件(全路径) - /// 文件上传后的名称 - /// 上传进度条 - /// 成功返回1,失败返回0 - private int Upload_Request(string address, string fileNamePath, string saveName, ProgressBar progressBar) - { - int returnValue = 0; - // 要上传的文件 - FileStream fs = new FileStream(fileNamePath, FileMode.Open, FileAccess.Read); - BinaryReader r = new BinaryReader(fs); - //时间戳 - string strBoundary = "----------" + DateTime.Now.Ticks.ToString("x"); - byte[] boundaryBytes = Encoding.ASCII.GetBytes("/r/n--" + strBoundary + "/r/n"); - //请求头部信息 - StringBuilder sb = new StringBuilder(); - sb.Append("--"); - sb.Append(strBoundary); - sb.Append("\r\n"); - sb.Append("Content-Disposition: form-data; name=\""); - sb.Append("file"); - sb.Append("\"; filename=\""); - sb.Append(saveName); - sb.Append("\""); - sb.Append("\r\n"); - sb.Append("Content-Type: "); - sb.Append("application/octet-stream"); - sb.Append("\r\n"); - sb.Append("\r\n"); - string strPostHeader = sb.ToString(); - byte[] postHeaderBytes = Encoding.UTF8.GetBytes(strPostHeader); - // 根据uri创建HttpWebRequest对象 - HttpWebRequest httpReq = (HttpWebRequest)WebRequest.Create(new Uri(address)); - httpReq.Method = "POST"; - //对发送的数据不使用缓存 - httpReq.AllowWriteStreamBuffering = false; - //设置获得响应的超时时间(300秒) - httpReq.Timeout = 300000; - httpReq.ContentType = "multipart/form-data; boundary=" + strBoundary; - long length = fs.Length + postHeaderBytes.Length + boundaryBytes.Length; - long fileLength = fs.Length; - httpReq.ContentLength = length; - try - { - progressBar.Maximum = int.MaxValue; - progressBar.Minimum = 0; - progressBar.Value = 0; - //每次上传4k - int bufferLength = 4096; - byte[] buffer = new byte[bufferLength]; - //已上传的字节数 - long offset = 0; - //开始上传时间 - DateTime startTime = DateTime.Now; - int size = r.Read(buffer, 0, bufferLength); - Stream postStream = httpReq.GetRequestStream(); - //发送请求头部消息 - postStream.Write(postHeaderBytes, 0, postHeaderBytes.Length); - while (size > 0) - { - postStream.Write(buffer, 0, size); - offset += size; - progressBar.Value = (int)(offset * (int.MaxValue / length)); - TimeSpan span = DateTime.Now - startTime; - double second = span.TotalSeconds; - //lblTime.Text = "已用时:" + second.ToString("F2") + "秒"; - //if (second > 0.001) - //{ - // lblSpeed.Text = " 平均速度:" + (offset / 1024 / second).ToString("0.00") + "KB/秒"; - //} - //else - //{ - // lblSpeed.Text = " 正在连接…"; - //} - //lblState.Text = "已上传:" + (offset * 100.0 / length).ToString("F2") + "%"; - //lblSize.Text = (offset / 1048576.0).ToString("F2") + "M/" + (fileLength / 1048576.0).ToString("F2") + "M"; - Application.DoEvents(); - size = r.Read(buffer, 0, bufferLength); - } - //添加尾部的时间戳 - postStream.Write(boundaryBytes, 0, boundaryBytes.Length); - postStream.Close(); - //获取服务器端的响应 - WebResponse webRespon = httpReq.GetResponse(); - Stream s = webRespon.GetResponseStream(); - StreamReader sr = new StreamReader(s); - //读取服务器端返回的消息 - String sReturnString = sr.ReadLine(); - s.Close(); - sr.Close(); - if (sReturnString == "Success") - { - returnValue = 1; - } - else if (sReturnString == "Error") - { - returnValue = 0; - } - } - catch(Exception ex) - { - returnValue = 0; - string str = ex.ToString(); - } - finally - { - fs.Close(); - r.Close(); - } - return returnValue; - } - private void btn_file_Click(object sender, EventArgs e) { OpenFileDialog dlg = new OpenFileDialog(); diff --git a/FrmExportCADS.cs b/FrmExportCADS.cs index 98772ea..59629dd 100644 --- a/FrmExportCADS.cs +++ b/FrmExportCADS.cs @@ -108,65 +108,6 @@ MessageBox.Show("请选中要导出的图层!", "提示", MessageBoxButtons.OK, MessageBoxIcon.Warning); } } - private Boolean MerageToFile(GSOFeatures features, String strDestFile, String strProj4)//图层追加 - { - if (features == null) - { - return false; - } - Boolean bSuccess = false; - - string strDir = GSOUtility.GetFileDir(strDestFile); - string strLPRJFile = GSOUtility.ChangeExt(strDestFile, ".lprj"); - string strExt = GSOUtility.GetFileExt(strDestFile); - - // 如果投影文件存在,投影以投影文件为准 - if (File.Exists(strLPRJFile)) - { - // 如果是dxf,则这样处理 - if (strExt.ToLower() == ".dxf") - { - string strTempSrcFile = strDir + "srcFeatures_dxftmp" + strExt; - globeControl1.Globe.DataManager.SaveFeatureData(features, strTempSrcFile, strLPRJFile, 4); - bSuccess = GSOUtility.MergeTwoDXFFileFeatures(strDestFile, strTempSrcFile); - File.Delete(strTempSrcFile); - } - else - { - GSOFeatures srcFeatures = globeControl1.Globe.DataManager.ReadFeatureData(strDestFile); - int nCount = features.Length; - int i = 0; - for (i = 0; i < nCount; i++) - { - srcFeatures.Add(features[i]); - } - bSuccess = globeControl1.Globe.DataManager.SaveFeatureData(srcFeatures, strDestFile, strLPRJFile, 4); - } - } - else - { - // 如果是dxf,则这样处理 - if (strExt.ToLower() == ".dxf") - { - string strTempSrcFile = strDir + "srcFeatures_dxftmp" + strExt; - globeControl1.Globe.DataManager.SaveFeatureData(features, strTempSrcFile, strProj4, 0); - bSuccess = GSOUtility.MergeTwoDXFFileFeatures(strDestFile, strTempSrcFile); - File.Delete(strTempSrcFile); - } - else - { - GSOFeatures srcFeatures = globeControl1.Globe.DataManager.ReadFeatureData(strDestFile); - int nCount = features.Length; - int i = 0; - for (i = 0; i < nCount; i++) - { - srcFeatures.Add(features[i]); - } - bSuccess = globeControl1.Globe.DataManager.SaveFeatureData(srcFeatures, strDestFile, strProj4, 0); - } - } - return bSuccess; - } /// /// 关闭按钮事件处理 /// diff --git a/FrmHDMAnalysis3.cs b/FrmHDMAnalysis3.cs index 4f73af6..2ada735 100644 --- a/FrmHDMAnalysis3.cs +++ b/FrmHDMAnalysis3.cs @@ -436,29 +436,6 @@ } layerTemp.RemoveAllFeature(); } - private void Export(GSOPoint3d _pnt, double r) - { - GSOPoint3ds pnts = new GSOPoint3ds(); - GSOPoint3d pnt = new GSOPoint3d(); - pnt.X = _pnt.X; - pnt.Y = _pnt.Y; - pnt.Z = _pnt.Z; - pnts.Add(pnt); - pnt.X = _pnt.X; - pnt.Y = _pnt.Y - 0.0000000005; - pnt.Z = _pnt.Z; - pnts.Add(pnt); - GSOGeoPolyline3D line = new GSOGeoPolyline3D(); - line.AddPart(pnts); - GSOGeoPolygon3D polygon = line.CreateBuffer(r * 2, true, 5, true, false); - GSOPoint3ds points = polygon[0]; - GSOGeoPolyline3D newLine = new GSOGeoPolyline3D(); - newLine.AddPart(points); - newLine.AltitudeMode = EnumAltitudeMode.RelativeToGround; - GSOFeature newFeature = new GSOFeature(); - newFeature.Geometry = newLine; - globeControl1.Globe.MemoryLayer.AddFeature(newFeature); - } private void ExportCAD(double a, double b, double r) { diff --git a/FrmHotFuncStat.cs b/FrmHotFuncStat.cs index c980f34..2eb1476 100644 --- a/FrmHotFuncStat.cs +++ b/FrmHotFuncStat.cs @@ -421,13 +421,6 @@ } } - private void HFS_Pderive_Click(object sender, EventArgs e) - { - if (TV_Files.SelectedNode != null) - { - HFSClass.GuideEdit_form("G", TV_Files, int.Parse(((ToolStripMenuItem)sender).Tag.ToString())); - } - } private void 导入ToolStripMenuItem_Click(object sender, EventArgs e) { @@ -530,22 +523,8 @@ } } - private void 导出ToolStripMenuItem1_Click(object sender, EventArgs e) - { - 导出ToolStripMenuItem2_Click(sender, e); - } + - private void TV_HFSSrchRslt_AfterCollapse(object sender, TreeViewEventArgs e) - { - e.Node.ImageIndex = 0; - } - - private void TV_HFSSrchRslt_AfterExpand(object sender, TreeViewEventArgs e) - { - HFSClass.ADD_TreeNode(TV_Files, e.Node); - e.Node.ImageIndex = 1; - } - private void 导出ToolStripMenuItem1_Click_1(object sender, EventArgs e) { if ((TV_HFSSrchRslt.SelectedNode != null) && (TV_HFSSrchRslt.SelectedNode.Parent != null)) diff --git a/FrmLayerControl.cs b/FrmLayerControl.cs index e7917c3..28fa14d 100644 --- a/FrmLayerControl.cs +++ b/FrmLayerControl.cs @@ -312,26 +312,7 @@ layerManagerNode.Expand(); terrainManagerNode.Expand(); } - /// - /// 刷新节点树 - /// - private void RefreshDataTree() - { - layerTree2.Nodes[0].Nodes.Clear(); - Int32 nCount = globeControl2.Globe.Layers.Count; - Int32 i = 0; - for (i = 0; i < nCount; i++) - { - GSODataset dataSpace = globeControl2.Globe.Layers[i].Dataset; - TreeNode node = new TreeNode(); - node.Text = dataSpace.Name; - node.ImageIndex = 0; - node.SelectedImageIndex = 0; - node.Checked = true; - node.Tag = dataSpace; - layerTree2.Nodes[0].Nodes.Add(node); - } - } + /// /// 目标图层按钮事件处理 /// @@ -494,22 +475,8 @@ } } } - /// - /// 改变指定节点的选中状态 - /// - /// - /// - private void CheckTreeNode(TreeNode node, Boolean bChecked) - { - CheckChildTreeNode(node, bChecked); - // 对于kml图层,如果当前处理的节点是true,那么要把所有的祖宗节点置为true - // 只有所有节点都未false,那么这个节点才为false - // CheckFatherTreeNode(node, bChecked); - globeControl1.Globe.Refresh(); - globeControl2.Globe.Refresh(); - - } + private void CheckChildTreeNode(TreeNode node, Boolean bChecked) { if (node == null) @@ -696,59 +663,7 @@ //} //CheckControl(e); } - /// - /// 树节点选中方法 - /// - /// - private void CheckControl(TreeViewEventArgs e) - { - if (e.Action != TreeViewAction.Unknown) - { - if (e.Node != null && !Convert.IsDBNull(e.Node)) - { - CheckParentNode(e.Node); - if (e.Node.Nodes.Count > 0) - { - CheckAllChildNodes(e.Node, e.Node.Checked); - } - } - } - } - /// - /// 改变所有子节点的状态 - /// - /// - /// - private void CheckAllChildNodes(TreeNode pn, bool IsChecked) - { - foreach (TreeNode tn in pn.Nodes) - { - tn.Checked = IsChecked; - if (tn.Tag.ToString().Contains("|")) - { - string nodeTag = tn.Tag.ToString().Split('|')[1]; - GSOLayer layer = globeControl1.Globe.Layers.GetLayerByCaption(nodeTag); - if (layer != null) - { - layer.Visible = IsChecked; - globeControl1.Globe.Refresh(); - } - } - if (tn.Tag is GSOFeature) - { - if (tn.Nodes.Count == 0) - { - GSOFeature feat = tn.Tag as GSOFeature; - feat.Visible = IsChecked; - globeControl1.Globe.Refresh(); - } - } - if (tn.Nodes.Count > 0) - { - CheckAllChildNodes(tn, IsChecked); - } - } - } + /// /// 改变父节点的选中状态,此处为所有子节点不选中时才取消父节点选中,可以根据需要修改 /// diff --git a/FrmLogin.cs b/FrmLogin.cs index 320fdd5..2afe46e 100644 --- a/FrmLogin.cs +++ b/FrmLogin.cs @@ -59,70 +59,6 @@ textBoxPassWord.Clear(); } } - - /// - /// 验证端口号 - /// - /// - private bool ValiPort() - { - Ping p = new Ping();//创建Ping对象p - PingReply pr = p.Send(Utility.localicenseserverip);//向指定IP或者主机名的计算机发送ICMP协议的ping数据包 - if (pr.Status == IPStatus.Success)//如果ping成功 - { - try - { - TcpClient tcpc = new TcpClient(Utility.localicenseserverip, Utility.localicenseserverport);//对IP地址为"192.168.0.105"的计算机的1500端口提出连接申请 - tcpc.Close(); - return true; - } - catch (Exception ex) - { - MessageBox.Show("端口连接错误!" + ex.Message); - return false; - } - } - else - { - int times = 0;//重新连接次数; - int count = 2;//设置尝试次数 - while (times < count) - { - //Thread.Sleep(1000);//等待时间(方便测试的话,你可以改为1000) - pr = p.Send(Utility.localicenseserverip); - - if (pr.Status == IPStatus.Success) - { - try - { - TcpClient tcpc = new TcpClient(Utility.localicenseserverip, Utility.localicenseserverport);//对IP地址为"192.168.0.105"的计算机的1500端口提出连接申请 - tcpc.Close(); - return true; - } - catch (Exception ex) - { - MessageBox.Show("端口连接错误!" + ex.Message); - return false; - } - } - else - { - times++; - if (times < count) - { - continue; - } - else - { - MessageBox.Show("重新尝试连接失败"); - return false; - } - } - - } - return false; - } - } /// /// 验证用户名、密码 /// diff --git a/FrmMetadata.cs b/FrmMetadata.cs index 886f65a..0365372 100644 --- a/FrmMetadata.cs +++ b/FrmMetadata.cs @@ -27,11 +27,7 @@ InitializeComponent(); loadTreeView(layerTree); } - private void FrmMetadata_Load(object sender, EventArgs e) - { - //this.ntLblC.Text = "nn"; - // loadTreeView(layerTree); - } + private void loadTreeView(TreeView tv)//构建图层树 { try diff --git a/FrmMetadataStat.cs b/FrmMetadataStat.cs index 790658a..e7696c6 100644 --- a/FrmMetadataStat.cs +++ b/FrmMetadataStat.cs @@ -197,9 +197,5 @@ } } - private void buttonX1_Click(object sender, EventArgs e) - { - drawChart(); - } } } diff --git a/FrmPatrolerManager.cs b/FrmPatrolerManager.cs index 37f8ffd..9e66aeb 100644 --- a/FrmPatrolerManager.cs +++ b/FrmPatrolerManager.cs @@ -109,82 +109,8 @@ this.winGridViewPager1.AllToExport = table; } - /// - /// 编辑 - /// - /// - /// - private void winGridViewPager1_OnEditSelected(object sender, EventArgs e) - { - - DataGridView grid = sender as DataGridView; - if (grid != null && grid.SelectedRows.Count>0) - { - DataGridViewRow row = grid.SelectedRows[0]; - try - { - long dbid = long.Parse(row.Cells["编号"].Value.ToString()); - String name = row.Cells["姓名"].Value.ToString(); - String sex = row.Cells["性别"].Value.ToString(); - String age = row.Cells["年龄"].Value.ToString(); - string phone = row.Cells["电话"].Value.ToString(); - age = String.IsNullOrEmpty(age.ToString().Trim()) ? "1" : age.ToString().Trim(); - FrmPatrolerEdit frm = new FrmPatrolerEdit(dbid.ToString(), name, age, sex, phone); - frm.reloadGrid += new ReloadPatrolerGrid(LoadData); - frm.ShowDialog(); - winGridViewPager1.Refresh(); - } - catch (Exception ex) - { - MessageBox.Show("编辑失败:" + ex.ToString(), "错误", MessageBoxButtons.OK, MessageBoxIcon.Error); - } - } - else - { - MessageBox.Show("没有选择记录", "提示"); - } - - } - - /// - /// 删除 - /// - /// - /// - private void winGridViewPager1_OnDeleteSelected(object sender, EventArgs e) - { - DataGridView grid = sender as DataGridView; - if (grid != null && grid.SelectedRows.Count > 0) - { - DataGridViewRow row = grid.SelectedRows[0]; - long dbid = long.Parse(row.Cells["编号"].Value.ToString()); - try - { - string state = row.Cells["状态"].Value.ToString(); - if ("在线".Equals(state)) - { - if (MessageBox.Show("确定注销?", "确认", MessageBoxButtons.YesNo, MessageBoxIcon.Question) == DialogResult.Yes) - { - String sql = "update patroler t set t.accountstate='LEAVER' where t.dbid=" + dbid; - OracleUtils.ExecuteNonQuery(OracleUtils.ConnectionString, CommandType.Text, sql); - } - } - else { - MessageBox.Show("人员不在线,无法注销", "信息"); - } - } - catch (Exception ex) - { - MessageBox.Show("人员注销失败:" + ex.ToString(), "错误", MessageBoxButtons.OK, MessageBoxIcon.Error); - } - } - else - { - MessageBox.Show("没有选择记录", "提示"); - } - } - - + + private void LoadData() { int pageIndex = winGridViewPager1.PagerInfo.CurrenetPageIndex; diff --git a/FrmRoadHDM.cs b/FrmRoadHDM.cs index e765313..e871dd5 100644 --- a/FrmRoadHDM.cs +++ b/FrmRoadHDM.cs @@ -333,31 +333,6 @@ this.Cursor = Cursors.Default; } } - - private void Export(GSOPoint3d _pnt, double r) - { - GSOPoint3ds pnts = new GSOPoint3ds(); - GSOPoint3d pnt = new GSOPoint3d(); - pnt.X = _pnt.X; - pnt.Y = _pnt.Y; - pnt.Z = _pnt.Z; - pnts.Add(pnt); - pnt.X = _pnt.X; - pnt.Y = _pnt.Y - 0.0000000005; - pnt.Z = _pnt.Z; - pnts.Add(pnt); - GSOGeoPolyline3D line = new GSOGeoPolyline3D(); - line.AddPart(pnts); - GSOGeoPolygon3D polygon = line.CreateBuffer(r * 2, true, 5, true, false); - GSOPoint3ds points = polygon[0]; - GSOGeoPolyline3D newLine = new GSOGeoPolyline3D(); - newLine.AddPart(points); - newLine.AltitudeMode = EnumAltitudeMode.RelativeToGround; - GSOFeature newFeature = new GSOFeature(); - newFeature.Geometry = newLine; - globeControl1.Globe.MemoryLayer.AddFeature(newFeature); - } - private void ExportCAD(double a, double b, double r) { GSOPoint3ds pnts = new GSOPoint3ds(); diff --git a/FrmUserAdd.cs b/FrmUserAdd.cs index c612ab4..f826427 100644 --- a/FrmUserAdd.cs +++ b/FrmUserAdd.cs @@ -231,24 +231,6 @@ //cbxRegion.SelectedIndexChanged += new EventHandler(cbxRegion_SelectedIndexChanged); } } - /// - /// 下拉框选中项改变事件处理 - /// - /// - /// - private void cbxRegion_SelectedIndexChanged(object sender, EventArgs e) - { - string sql = ""; - //string sql = "select casic_role.\"name\" from casic_role join casic_regionrole on casic_role.\"id\"=casic_regionrole.\"rid\" where casic_regionrole.\"reid\"=" + region[cbxRegion.SelectedItem.ToString().Trim()]; - DataTable dt = OledbHelper.QueryTable(sql); - if (dt != null && dt.Rows.Count > 0) - { - comboBoxExRegionRole.Items.Clear(); - for (int i = 0; i < dt.Rows.Count; i++) - { - comboBoxExRegionRole.Items.Add(dt.Rows[i][0].ToString().Trim());//部门角色 - } - } - } + } } diff --git a/FrmUserManager.cs b/FrmUserManager.cs index 571f0f0..ae254bc 100644 --- a/FrmUserManager.cs +++ b/FrmUserManager.cs @@ -81,11 +81,6 @@ } } } - //创建新用户 - private void buttonX2_Click(object sender, EventArgs e) - { - FrmUserAdd frm = new FrmUserAdd(-1); - frm.ShowDialog(); - } + } } diff --git a/FrmValveStatistics.cs b/FrmValveStatistics.cs index 545d56c..dd76777 100644 --- a/FrmValveStatistics.cs +++ b/FrmValveStatistics.cs @@ -54,7 +54,7 @@ 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") + if (chaFamenStatis.Series["阀门"].Points[m]!=null&&chaFamenStatis.Series["阀门"].Points[m].YValues[0].ToString() != "0") { chaFamenStatis.Series["阀门"].Points[m].Label = chaFamenStatis.Series[0].Points[m].YValues[0].ToString(); } diff --git a/Frm_password_reset.cs b/Frm_password_reset.cs index 7b51039..b9e5dc3 100644 --- a/Frm_password_reset.cs +++ b/Frm_password_reset.cs @@ -41,6 +41,7 @@ } catch (Exception ex) { + LogHelper.WriteLog(typeof(Frm_password_reset), ex.Message); } } private void initCombox() diff --git a/Cyberpipe.csproj b/Cyberpipe.csproj index 07a8c1a..e3cd12c 100644 --- a/Cyberpipe.csproj +++ b/Cyberpipe.csproj @@ -204,25 +204,6 @@ - - Form - - - F_GKT1数据输入输出.cs - - - Form - - - F_GKT1添加文件.cs - - - Form - - - F_GKT1添加项目.cs - - Form @@ -1068,18 +1049,6 @@ Frm_password_reset.cs - - Form - - - GKT.cs - - - Form - - - GKT1.cs - Form @@ -1258,12 +1227,6 @@ F_Projedit.cs - - Form - - - PED.cs - Form @@ -1331,16 +1294,6 @@ True Reference.map - - F_GKT1数据输入输出.cs - Designer - - - F_GKT1添加文件.cs - - - F_GKT1添加项目.cs - Form_EditTask.cs @@ -1836,12 +1789,6 @@ Frm_password_reset.cs - - GKT.cs - - - GKT1.cs - F_GKT数据输入输出.cs @@ -1934,9 +1881,6 @@ F_Projedit.cs - - PED.cs - F_数据输入输出.cs diff --git a/Cyberpipe.suo b/Cyberpipe.suo index 68ced4f..a1aecf8 100644 --- a/Cyberpipe.suo +++ b/Cyberpipe.suo Binary files differ diff --git a/EMS_Forms/Form_EditTask.cs b/EMS_Forms/Form_EditTask.cs index 718992f..f1d791f 100644 --- a/EMS_Forms/Form_EditTask.cs +++ b/EMS_Forms/Form_EditTask.cs @@ -119,7 +119,8 @@ String name = Convert.ToString(dr["USERNAME"]); comboBox_userName.Items.Add(name); - } + } + dr.Close(); comboBox_road.Items.Clear(); roadList = new List(); @@ -135,7 +136,7 @@ comboBox_road.Items.Add(name); } } - + dr1.Close(); conn.Close(); bool flag2 = false; @@ -185,7 +186,7 @@ catch (Exception ex) { - MessageBox.Show(ex.ToString()); + LogHelper.WriteLog(typeof(Form_EditTask), ex.Message); } } @@ -288,7 +289,7 @@ } catch (Exception ex) { - MessageBox.Show(ex.ToString()); + LogHelper.WriteLog(typeof(Form_EditTask), ex.Message); } } @@ -474,7 +475,7 @@ } catch (Exception ex) { - MessageBox.Show(ex.ToString()); + LogHelper.WriteLog(typeof(Form_EditTask), ex.Message); } this.Close(); @@ -495,6 +496,7 @@ { numList.Add(Convert.ToInt32(dr["DBID"])); } + dr.Close(); if (numList.Count == 0) { taskNumber = Convert.ToInt32(number) * 100; @@ -674,6 +676,7 @@ } } } + dr.Close(); conn.Close(); } diff --git a/EMS_Forms/Form_EventManager.cs b/EMS_Forms/Form_EventManager.cs index b18c45b..84807b2 100644 --- a/EMS_Forms/Form_EventManager.cs +++ b/EMS_Forms/Form_EventManager.cs @@ -64,6 +64,7 @@ comboBox_name.Items.Add(name); } + dr.Close(); conn.Close(); diff --git a/Forms/FrmMnModify.cs b/Forms/FrmMnModify.cs index 31cfc5f..d036360 100644 --- a/Forms/FrmMnModify.cs +++ b/Forms/FrmMnModify.cs @@ -68,15 +68,7 @@ questionGrid.Rows[idx].Cells[1].Value = sr.question; } } - /// 选中对象 - /// - /// - /// - /// - private void buttonX1_Click(object sender, EventArgs e) - { - globecontrol.Globe.Action = EnumAction3D.SelectObject; - } + /// /// 选中某一行 /// diff --git a/Forms/FrmPipelineModelDataBase.cs b/Forms/FrmPipelineModelDataBase.cs index 2acf0ca..7ce573f 100644 --- a/Forms/FrmPipelineModelDataBase.cs +++ b/Forms/FrmPipelineModelDataBase.cs @@ -35,19 +35,7 @@ ds = _ds; InitializeComponent(); } - /// - /// 单击选择shp格式文件 - /// - /// - /// - private void btnBrowseModel_Click(object sender, EventArgs e) - { - saveFileDialog1.Filter = "*.lgd|*.lgd"; - if (saveFileDialog1.ShowDialog() == DialogResult.OK) - { - txtModelLayer.Text = saveFileDialog1.FileName; - } - } + /// /// 窗体初始化事件处理 /// @@ -100,49 +88,6 @@ } } } - - private object convertFieldValue(string fieldname, object obj) - { - if (obj == null) - return null; - - try - { - string type = fields_types[fieldname].ToString(); - switch (type) - { - case "string": - return obj.ToString(); - case "int": - //return 101; - int intResult; - if (int.TryParse(obj.ToString(), out intResult)) - return intResult; - else - return null; - case "double": - //return 202.5; - double doubleResult; - if (double.TryParse(obj.ToString(), out doubleResult)) - return doubleResult; - else - return null; - case "date": - DateTime dtResult; - if (DateTime.TryParse(obj.ToString(), out dtResult)) - return dtResult; - else - return null; - } - return null; - } - catch (Exception ex) - { - MessageBox.Show(ex.ToString()); - return null; - } - } - public string lgdFilePath = ""; /// /// 选择管线颜色 @@ -610,33 +555,6 @@ { this.Close(); } - - private void cmbLayer_SelectedIndexChanged(object sender, EventArgs e) //选择图层 - { - GSOLayer layer = ctl.Globe.Layers.GetLayerByCaption(selectLayerName); - GSOFeatures features = layer.GetAllFeatures(); - if (features.Length == 0) - return; - - cmbFrom.Items.Clear(); - cmbTo.Items.Clear(); - cmbRadius.Items.Clear(); - cmbID.Items.Clear(); - for (int i = 0; i < features[0].GetFieldCount(); i++) - { - GeoScene.Data.GSOFieldDefn fielddef = (GeoScene.Data.GSOFieldDefn)(features[0].GetFieldDefn(i)); - - cmbFrom.Items.Add(fielddef.Name); - cmbTo.Items.Add(fielddef.Name); - cmbRadius.Items.Add(fielddef.Name); - cmbID.Items.Add(fielddef.Name); - } - cmbFrom.SelectedItem = "Deep1"; - cmbTo.SelectedItem = "Deep2"; - cmbRadius.SelectedItem = "Diameter"; - cmbID.SelectedItem = "Handle"; - } - private void buttonXLayerPath_Click(object sender, EventArgs e)//单击 选择shp格式的文件 { OpenFileDialog dlg = new OpenFileDialog(); diff --git a/Forms/FrmPipelineModelDataOneStep.cs b/Forms/FrmPipelineModelDataOneStep.cs index 18afda7..ec93b8a 100644 --- a/Forms/FrmPipelineModelDataOneStep.cs +++ b/Forms/FrmPipelineModelDataOneStep.cs @@ -38,19 +38,7 @@ layerTree = _layerTree; InitializeComponent(); } - /// - /// 单击选择shp格式文件 - /// - /// - /// - private void btnBrowseModel_Click(object sender, EventArgs e) - { - saveFileDialog1.Filter = "*.lgd|*.lgd"; - if (saveFileDialog1.ShowDialog() == DialogResult.OK) - { - txtModelLayer.Text = saveFileDialog1.FileName; - } - } + /// /// 窗体初始化事件处理 /// @@ -107,48 +95,7 @@ } } - private object convertFieldValue(string fieldname, object obj) - { - if (obj == null) - return null; - - try - { - string type = fields_types[fieldname].ToString(); - switch (type) - { - case "string": - return obj.ToString(); - case "int": - //return 101; - int intResult; - if (int.TryParse(obj.ToString(), out intResult)) - return intResult; - else - return null; - case "double": - //return 202.5; - double doubleResult; - if (double.TryParse(obj.ToString(), out doubleResult)) - return doubleResult; - else - return null; - case "date": - DateTime dtResult; - if (DateTime.TryParse(obj.ToString(), out dtResult)) - return dtResult; - else - return null; - } - return null; - } - catch (Exception ex) - { - MessageBox.Show(ex.ToString()); - return null; - } - } - + public string lgdFilePath = ""; /// /// 选择管线颜色 @@ -673,32 +620,6 @@ return featDs; } - private void cmbLayer_SelectedIndexChanged(object sender, EventArgs e) //选择图层 - { - GSOLayer layer = ctl.Globe.Layers.GetLayerByCaption(selectLayerName); - GSOFeatures features = layer.GetAllFeatures(); - if (features.Length == 0) - return; - - cmbFrom.Items.Clear(); - cmbTo.Items.Clear(); - cmbRadius.Items.Clear(); - cmbID.Items.Clear(); - for (int i = 0; i < features[0].GetFieldCount(); i++) - { - GeoScene.Data.GSOFieldDefn fielddef = (GeoScene.Data.GSOFieldDefn)(features[0].GetFieldDefn(i)); - - cmbFrom.Items.Add(fielddef.Name); - cmbTo.Items.Add(fielddef.Name); - cmbRadius.Items.Add(fielddef.Name); - cmbID.Items.Add(fielddef.Name); - } - cmbFrom.SelectedItem = "Deep1"; - cmbTo.SelectedItem = "Deep2"; - cmbRadius.SelectedItem = "Diameter"; - cmbID.SelectedItem = "Handle"; - } - private void buttonXLayerPath_Click(object sender, EventArgs e)//单击 选择shp格式的文件 { OpenFileDialog dlg = new OpenFileDialog(); @@ -949,38 +870,6 @@ } //txtLayername.Text = type + layername; } - /// - /// 连接数据库 - /// - /// - /// - private void buttonX1_Click(object sender, EventArgs e) - { - if (ds == null) - { - //没连的话,直接连接审核库; //审核库配置读配置文件 - string dbIp = Utility.sgdbip; - string database = Utility.sgdbname; - string user = Utility.sgdbuser; - string pass = Utility.sgdbpwd; - - if (!Utility.isNetworkConnectionSuccess(dbIp.Trim())) - { - MessageBox.Show("网络连接失败!", "提示"); - return; - } - - ds = ctl.Globe.DataManager.OpenOracleDataSource(dbIp + "/" + database, "", "", user, pass); - if (ds == null) - { - MessageBox.Show("数据库连接失败!", "提示", MessageBoxButtons.OK, MessageBoxIcon.Warning); - } - else - { - btnCreateModel.Enabled = true; - } - } - } private void btnClose_Click(object sender, EventArgs e) { diff --git a/Forms/FrmShRK.cs b/Forms/FrmShRK.cs index 0e2e722..f1d83cb 100644 --- a/Forms/FrmShRK.cs +++ b/Forms/FrmShRK.cs @@ -215,6 +215,7 @@ { sourcefeatds = sourcefeat as GSOFeatureDataset; } + if (sourcefeatds == null) return; sourcefeatds.Open(); GSOFeatures sourcefeatures = sourcefeatds.GetAllFeatures(); @@ -251,6 +252,7 @@ { desfeatds = desfeat as GSOFeatureDataset; } + if (desfeatds == null) return; desfeatds.Open(); //向新数据集写入字段 diff --git a/FrmAccessoriesSensor.cs b/FrmAccessoriesSensor.cs index 09fcdf1..2a7a80e 100644 --- a/FrmAccessoriesSensor.cs +++ b/FrmAccessoriesSensor.cs @@ -209,7 +209,7 @@ chart1.Series[0].Points.DataBindXY(dic.Keys, dic.Values); for (int m = 0; m < dic.Values.Count; m++) { - if (chart1.Series[0].Points[m].YValues[0].ToString() != "0") + if (chart1.Series[0].Points[m]!=null&&chart1.Series[0].Points[m].YValues[0].ToString() != "0") { chart1.Series[0].Points[m].Label = chart1.Series[0].Points[m].YValues[0].ToString(); } diff --git a/FrmAccessoriesgather.cs b/FrmAccessoriesgather.cs index 9e331e1..a475d9e 100644 --- a/FrmAccessoriesgather.cs +++ b/FrmAccessoriesgather.cs @@ -338,7 +338,7 @@ chart1.Series[0].Points.DataBindXY(dic.Keys, dic.Values); for (int m = 0; m < dic.Values.Count; m++) { - if (chart1.Series[0].Points[m].YValues[0].ToString() != "0") + if (chart1.Series[0].Points[m]!=null&&chart1.Series[0].Points[m].YValues[0].ToString() != "0") { chart1.Series[0].Points[m].Label = chart1.Series[0].Points[m].YValues[0].ToString(); } diff --git a/FrmAccessoryAnalysis.cs b/FrmAccessoryAnalysis.cs index 71d4579..44d4065 100644 --- a/FrmAccessoryAnalysis.cs +++ b/FrmAccessoryAnalysis.cs @@ -66,39 +66,6 @@ globeControl1.Refresh(); } /// - /// 键盘按键按下事件处理 - /// - /// - /// - private void txtRadius_KeyPress(object sender, KeyPressEventArgs e) - { - TextBox text = sender as TextBox; - if ((e.KeyChar < 48 || e.KeyChar > 57) && (e.KeyChar != 8) && (int)e.KeyChar != 46) - { - e.Handled = true; - } - if ((int)e.KeyChar == 46) //小数点 - { - if (text.Text.Length <= 0) - e.Handled = true; //小数点不能在第一位 - else //处理不规则的小数点 - { - float f; - float oldf; - bool b1 = false, b2 = false; - b1 = float.TryParse(text.Text, out oldf); - b2 = float.TryParse(text.Text + e.KeyChar.ToString(), out f); - if (b2 == false) - { - if (b1 == true) - e.Handled = true; - else - e.Handled = false; - } - } - } - } - /// /// 确定按钮事件处理 /// /// diff --git a/FrmAddValve.cs b/FrmAddValve.cs index 34d2fec..5f405b9 100644 --- a/FrmAddValve.cs +++ b/FrmAddValve.cs @@ -486,56 +486,6 @@ } } - - - - - - - - private void cmbLayer_SelectedIndexChanged(object sender, EventArgs e) - { - GSOLayer layer = globeControl1.Globe.Layers.GetLayerByCaption(selectLayerName); - GSOFeatures features = layer.GetAllFeatures(); - if (features.Length == 0) - return; - - combPath.Items.Clear(); - combZ.Items.Clear(); - combModelName.Items.Clear(); - - for (int i = 0; i < features[0].GetFieldCount(); i++) - { - GeoScene.Data.GSOFieldDefn fielddef = (GeoScene.Data.GSOFieldDefn)(features[0].GetFieldDefn(i)); - combPath.Items.Add(fielddef.Name); - combZ.Items.Add(fielddef.Name); - combModelName.Items.Add(fielddef.Name); - } - combModelName.SelectedItem = "编号"; - combPath.SelectedItem = "模型路径"; - if (combfile.SelectedIndex != -1) - { - - string layerCaption = combfile.SelectedItem.ToString().Trim(); - rukuLayer = globeControl1.Globe.Layers.GetLayerByCaption(layerCaption); - if (rukuLayer != null) - { - combPath.Items.Clear(); - combZ.Items.Clear(); - combModelName.Items.Clear(); - - } - for (int i = 0; i < features[0].GetFieldCount(); i++) - { - GeoScene.Data.GSOFieldDefn fielddef = (GeoScene.Data.GSOFieldDefn)(features[0].GetFieldDefn(i)); - combPath.Items.Add(fielddef.Name); - combZ.Items.Add(fielddef.Name); - combModelName.Items.Add(fielddef.Name); - } - combModelName.SelectedItem = "编号"; - combPath.SelectedItem = "模型路径"; - } - } /// /// 单击选择shp格式文件 /// diff --git a/FrmAddWellShp.cs b/FrmAddWellShp.cs index bb79ec0..a249725 100644 --- a/FrmAddWellShp.cs +++ b/FrmAddWellShp.cs @@ -478,32 +478,6 @@ } } } - - private void cmbLayer_SelectedIndexChanged(object sender, EventArgs e) - { - GSOLayer layer = globeControl1.Globe.Layers.GetLayerByCaption(selectLayerName); - GSOFeatures features = layer.GetAllFeatures(); - if (features.Length == 0) - return; - - combCode.Items.Clear(); - combDeep.Items.Clear(); - combModelName.Items.Clear(); - combAngle.Items.Clear(); - - for (int i = 0; i < features[0].GetFieldCount(); i++) - { - GeoScene.Data.GSOFieldDefn fielddef = (GeoScene.Data.GSOFieldDefn)(features[0].GetFieldDefn(i)); - combCode.Items.Add(fielddef.Name); - combDeep.Items.Add(fielddef.Name); - combModelName.Items.Add(fielddef.Name); - combAngle.Items.Add(fielddef.Name); - } - combCode.SelectedItem = "附属物编码"; - combDeep.SelectedItem = "井深"; - combModelName.SelectedItem = "编号"; - combAngle.SelectedItem = "符号角度"; - } /// /// 单击选择shp格式文件 /// diff --git a/FrmAddYuBiZiShp.cs b/FrmAddYuBiZiShp.cs index b312d51..332f037 100644 --- a/FrmAddYuBiZiShp.cs +++ b/FrmAddYuBiZiShp.cs @@ -383,80 +383,7 @@ } } - private void cmbLayer_SelectedIndexChanged(object sender, EventArgs e) - { - GSOLayer layer = globeControl1.Globe.Layers.GetLayerByCaption(selectLayerName); - GSOFeatures features = layer.GetAllFeatures(); - if (features.Length == 0) - return; - - combCode.Items.Clear(); - combDeep.Items.Clear(); - combModelName.Items.Clear(); - //comboLoad.Items.Clear(); - for (int i = 0; i < features[0].GetFieldCount(); i++) - { - GeoScene.Data.GSOFieldDefn fielddef = (GeoScene.Data.GSOFieldDefn)(features[0].GetFieldDefn(i)); - combCode.Items.Add(fielddef.Name); - combDeep.Items.Add(fielddef.Name); - combModelName.Items.Add(fielddef.Name); - //comboLoad.Items.Add(fielddef.Name); - } - combCode.SelectedItem = "附属物编码"; - combDeep.SelectedItem = "Z坐标"; - combModelName.SelectedItem = "编号"; - //comboLoad.SelectedItem = "模型路径"; - } - - private void buttonXLayerPath_Click(object sender, EventArgs e) - { - OpenFileDialog dlg = new OpenFileDialog(); - dlg.Filter = "*.shp|*.shp"; - dlg.Multiselect = false; - if (dlg.ShowDialog() == DialogResult.OK) - { - GSOLayer layer = globeControl1.Globe.Layers.Add(dlg.FileName); - string txtMessage = valiYBdata(layer); - if (txtMessage != "") - { - button3.Enabled = false; - //textBoxLayer.Text = ""; - combCode.Items.Clear(); - combDeep.Items.Clear(); - combModelName.Items.Clear(); - globeControl1.Globe.Layers.Remove(layer); - FrmValiDataShowErrorMessage showErrorMessage = new FrmValiDataShowErrorMessage(dlg.FileName, txtMessage); - showErrorMessage.ShowDialog(); - return; - } - else - { - button3.Enabled = true; - //textBoxLayer.Text = dlg.FileName; - selectLayerName = layer.Caption; - txtLayerName.Text = layer.Caption; - GSOFeatures features = layer.GetAllFeatures(); - if (features.Length == 0) - return; - - combCode.Items.Clear(); - combDeep.Items.Clear(); - combModelName.Items.Clear(); - for (int i = 0; i < features[0].GetFieldCount(); i++) - { - GeoScene.Data.GSOFieldDefn fielddef = (GeoScene.Data.GSOFieldDefn)(features[0].GetFieldDefn(i)); - combCode.Items.Add(fielddef.Name); - combDeep.Items.Add(fielddef.Name); - combModelName.Items.Add(fielddef.Name); - //comboLoad.Items.Add(fielddef.Name); - } - combCode.SelectedItem = "管点编码"; - combDeep.SelectedItem = "Z坐标"; - combModelName.SelectedItem = "编号"; - } - } - } - + private void FrmAddYuBiZiShp_FormClosing(object sender, FormClosingEventArgs e) { globeControl1.Globe.Refresh(); diff --git a/FrmAllPipelineStatis.cs b/FrmAllPipelineStatis.cs index 6421a26..a6eea29 100644 --- a/FrmAllPipelineStatis.cs +++ b/FrmAllPipelineStatis.cs @@ -84,7 +84,7 @@ chartAllAreaPipeline.Series["管线"].Points.DataBindXY(pipelineLengthAndType.Keys, pipelineLengthAndType.Values); for (int m = 0; m < pipelineLengthAndType.Values.Count; m++) { - if (chartAllAreaPipeline.Series["管线"].Points[m].YValues[0].ToString() != "0") + if (chartAllAreaPipeline.Series["管线"].Points[m]!=null&&chartAllAreaPipeline.Series["管线"].Points[m].YValues[0].ToString() != "0") { chartAllAreaPipeline.Series["管线"].Points[m].Label = chartAllAreaPipeline.Series[0].Points[m].YValues[0].ToString(); } @@ -94,7 +94,7 @@ } catch (Exception ex) { - //LogError.PublishError(ex); + LogHelper.WriteLog(typeof(FrmAllPipelineStatis), ex.Message); } } @@ -147,7 +147,7 @@ } DataTable dt = OledbHelper.QueryTable(sql); - if (dt != null && dt.Rows.Count > 0) + if (dt != null && dt.Rows.Count > 0 && chartAllAreaPipeline.Series["管线"].Points[indexHit]!=null) { dataGridViewX1.DataSource = dt; panel.Visible = true; diff --git a/FrmAllWorkWellStatis.cs b/FrmAllWorkWellStatis.cs index 6fec7af..6af8e4c 100644 --- a/FrmAllWorkWellStatis.cs +++ b/FrmAllWorkWellStatis.cs @@ -52,7 +52,7 @@ chartAllAreaPipeline.Series["井盖"].Points.DataBindXY(workWellLengthAndType.Keys, workWellLengthAndType.Values); for (int m = 0; m < workWellLengthAndType.Values.Count; m++) { - if (chartAllAreaPipeline.Series["井盖"].Points[m].YValues[0].ToString().Trim() != "0") + if (chartAllAreaPipeline.Series["井盖"].Points[m]!=null&&chartAllAreaPipeline.Series["井盖"].Points[m].YValues[0].ToString().Trim() != "0") { chartAllAreaPipeline.Series["井盖"].Points[m].Label = chartAllAreaPipeline.Series[0].Points[m].YValues[0].ToString(); } @@ -60,7 +60,7 @@ } catch (Exception ex) { - //LogError.PublishError(ex); + LogHelper.WriteLog(typeof(FrmAllWorkWellStatis), ex.Message); } } diff --git a/FrmBSQDuoBianXingStatis.cs b/FrmBSQDuoBianXingStatis.cs index e8b7d52..3e889b6 100644 --- a/FrmBSQDuoBianXingStatis.cs +++ b/FrmBSQDuoBianXingStatis.cs @@ -60,7 +60,7 @@ { for (int m = 0; m < bsq1.Values.Count; m++) { - if (chart1.Series["标识器"].Points[m].YValues[0].ToString() != "0") + if (chart1.Series["标识器"].Points[m]!=null&&chart1.Series["标识器"].Points[m].YValues[0].ToString() != "0") { count += Convert.ToInt16(chart1.Series[0].Points[m].YValues[0].ToString()); chart1.Series["标识器"].Points[m].Label = chart1.Series[0].Points[m].YValues[0].ToString(); diff --git a/FrmBSQDuoBianXingStreet.cs b/FrmBSQDuoBianXingStreet.cs index 2005ebb..1db5777 100644 --- a/FrmBSQDuoBianXingStreet.cs +++ b/FrmBSQDuoBianXingStreet.cs @@ -63,7 +63,7 @@ chartStatis.Series[0].Points.DataBindXY(bsq.Keys, bsq.Values); for (int m = 0; m < bsq.Values.Count; m++) { - if (chartStatis.Series[0].Points[m].YValues[0].ToString().Trim() != "0") + if (chartStatis.Series[0].Points[m]!=null&&chartStatis.Series[0].Points[m].YValues[0].ToString().Trim() != "0") { count += Convert.ToInt16(chartStatis.Series[0].Points[m].YValues[0].ToString()); chartStatis.Series[0].Points[m].Label = chartStatis.Series[0].Points[m].YValues[0].ToString(); diff --git a/FrmBSQStatis.cs b/FrmBSQStatis.cs index 390a55c..4aa0ee6 100644 --- a/FrmBSQStatis.cs +++ b/FrmBSQStatis.cs @@ -95,6 +95,8 @@ } } } + + dr.Close(); conn.Close(); for (int i = 0; i < typeLists.Count; i++) { @@ -123,7 +125,7 @@ chartStatis.Series[0].Points.DataBindXY(bsq.Keys, bsq.Values); for (int m = 0; m < bsq.Values.Count; m++) { - if (chartStatis.Series[0].Points[m].YValues[0].ToString().Trim() != "0") + if (chartStatis.Series[0].Points[m]!=null&&chartStatis.Series[0].Points[m].YValues[0].ToString().Trim() != "0") { //count += Convert.ToInt16(chartStatis.Series[0].Points[m].YValues[0].ToString()); chartStatis.Series[0].Points[m].Label = chartStatis.Series[0].Points[m].YValues[0].ToString(); diff --git a/FrmBSQStreet.cs b/FrmBSQStreet.cs index 9d88adb..7fbacad 100644 --- a/FrmBSQStreet.cs +++ b/FrmBSQStreet.cs @@ -44,7 +44,7 @@ chartStatis.Series[0].Points.DataBindXY(bsq.Keys, bsq.Values); for (int m = 0; m < bsq.Values.Count; m++) { - if (chartStatis.Series[0].Points[m].YValues[0].ToString().Trim() != "0") + if (chartStatis.Series[0].Points[m]!=null&&chartStatis.Series[0].Points[m].YValues[0].ToString().Trim() != "0") { count += Convert.ToInt16(chartStatis.Series[0].Points[m].YValues[0].ToString()); chartStatis.Series[0].Points[m].Label = chartStatis.Series[0].Points[m].YValues[0].ToString(); diff --git a/FrmBoosterValvers.cs b/FrmBoosterValvers.cs index 5061efc..df9b62b 100644 --- a/FrmBoosterValvers.cs +++ b/FrmBoosterValvers.cs @@ -236,199 +236,6 @@ count = 0; } } - /// - /// 添加火苗 - /// - /// - /// - /// - /// - private GSOFeature AddFire(double x,double y,double z) - { - // 烟火示例 - - string strResPath = Application.StartupPath + "/Resource"; - - // 烟火粒子示例,由三个发射器构成 - GSOGeoParticle geoParticle = new GSOGeoParticle(); - geoParticle.SetPosition(x, y, z); // 添加到这个经纬度位置 - geoParticle.AltitudeMode = EnumAltitudeMode.RelativeToGround; - - GSORingParticleEmitter emitter = new GSORingParticleEmitter(); - emitter.TexturePath = strResPath + "/ParticleImage/flare.png"; - - emitter.SetSizeFix(1, 1); - emitter.VelFix = 1; - emitter.VelRnd = 5; - - emitter.AngleXYFix = 0; - emitter.AngleXYRnd = 180; - - emitter.AngleXZFix = 90; - emitter.AngleXZRnd = 0; - - emitter.LifeFix = 0.5f; - emitter.LifeRnd = 0.0f; - - emitter.RotFix = 0; - emitter.RotRnd = 0; - - emitter.RotVelFix = 0; - emitter.RotVelRnd = 0; - - emitter.EmitPerSec = 100; - - // 采用线性插值生成粒子的初始颜色 - emitter.ColorRndStart = Color.White; - emitter.ColorRndEnd = Color.Red; - - - GSOColorParticleEffector effector2 = new GSOColorParticleEffector(); - effector2.SetColorChanged(0, -1, -1, 0); - effector2.StartTime = 0.0f; - effector2.EndTime = -1.0f; - emitter.AddEffector(effector2); - - // 将三个发射器添加到粒子对象中 - geoParticle.AddEmitter(emitter); - - geoParticle.Play(); - - GSOFeature feature = new GSOFeature(); - - feature.Geometry = geoParticle; - - globeControl1.Globe.MemoryLayer.AddFeature(feature); - - - return feature; - } - - /// - /// 添加喷泉 - /// - /// - private GSOFeature AddFountain() - { - string strResPath = Application.StartupPath + "/Resource"; - - GSOGeoParticle geoParticle = new GSOGeoParticle(); - geoParticle.SetPosition(116.314, 39.84, 0); // 添加到这个经纬度位置 - - GSOPointParticleEmitter emitter = new GSOPointParticleEmitter(); - emitter.TexturePath = strResPath + "/ParticleImage/test.png"; - - emitter.SetSizeFix(0.5f, 2); - emitter.VelFix = 10; - emitter.VelRnd = 2; - - emitter.GravityAcc = 9.8f; - emitter.AngleXYFix = 0; - emitter.AngleXYRnd = 180; - - emitter.AngleXZFix = 88; - emitter.AngleXZRnd = 2; - - //emitter.InnerRadius = 0; - // emitter.OuterRadius = 0.03f; - - emitter.LifeFix = 5.0f; - emitter.LifeRnd = 1.0f; - - emitter.RotFix = 0; - emitter.RotRnd = 0; - - emitter.RotVelFix = 0; - emitter.RotVelRnd = 0; - - emitter.EmitPerSec = 1000; - emitter.ColorRndStart = Color.FromArgb(33, 255, 255, 255); - emitter.ColorRndEnd = Color.FromArgb(11, 255, 255, 255); - emitter.IsLumAdded = false; - - // 将三个发射器添加到粒子对象中 - geoParticle.AddEmitter(emitter); - - geoParticle.Play(); - GSOFeature feature = new GSOFeature(); - - feature.Geometry = geoParticle; - - //globeControl1.Globe.MemoryLayer.AddFeature(feature); - globeControl1.Globe.FlyToFeature(feature); - - return feature; - } - - /// - /// 添加水柱 - /// - /// - private GSOFeature AddWaterLine() - { - string strResPath = Application.StartupPath + "/Resource"; - - GSOGeoParticle geoParticle = new GSOGeoParticle(); - geoParticle.SetPosition(116.308, 39.84, 0); // 添加到这个经纬度位置 - - GSOPointParticleEmitter emitter = new GSOPointParticleEmitter(); - - emitter.TexturePath = strResPath + "/ParticleImage/drop3.png"; - - geoParticle.TimerInterval = 1; - - emitter.SetSizeFix(2.0f, 2.0f); - - emitter.VelFix = 50; - emitter.VelRnd = 2; - - // emitter.IsLumAdded = false; - - emitter.GravityAcc = 9.8f; - emitter.AngleXYFix = 0; - emitter.AngleXYRnd = 2; - - emitter.AngleXZFix = 60; - emitter.AngleXZRnd = 2; - - //emitter.InnerRadius = 0; - // emitter.OuterRadius = 0.1f; - - emitter.LifeFix = 5.0f; - emitter.LifeRnd = 1.0f; - - emitter.RotFix = 0; - emitter.RotRnd = 0; - - emitter.RotVelFix = 0; - emitter.RotVelRnd = 0; - - emitter.EmitPerSec = 1500; - - emitter.ColorRndStart = Color.FromArgb(100, 222, 222, 222); - emitter.ColorRndEnd = Color.FromArgb(50, 222, 222, 222); - - /* - - GSOScaleParticleEffector effector1 = new GSOScaleParticleEffector(); - effector1.SetScale(0.2f, 0.2f); - effector1.StartTime = 0; - effector1.EndTime = -1; // 负数表示整个粒子生命结束 - emitter.AddEffector(effector1); - */ - - // 将三个发射器添加到粒子对象中 - geoParticle.AddEmitter(emitter); - - geoParticle.Play(); - GSOFeature feature = new GSOFeature(); - - feature.Geometry = geoParticle; - - //globeControl1.Globe.MemoryLayer.AddFeature(feature); - globeControl1.Globe.FlyToFeature(feature); - - return feature; - } + } } diff --git a/FrmBufferAnalysis.cs b/FrmBufferAnalysis.cs index f711133..db8ca59 100644 --- a/FrmBufferAnalysis.cs +++ b/FrmBufferAnalysis.cs @@ -123,39 +123,6 @@ } } /// - /// 半径文本框的键盘按键按下事件处理 - /// - /// - /// - private void txtRadius_KeyPress(object sender, KeyPressEventArgs e) - { - TextBox text = sender as TextBox; - if ((e.KeyChar < 48 || e.KeyChar > 57) && (e.KeyChar != 8) && (int)e.KeyChar != 46) - { - e.Handled = true; - } - if ((int)e.KeyChar == 46) //小数点 - { - if (text.Text.Length <= 0) - e.Handled = true; //小数点不能在第一位 - else //处理不规则的小数点 - { - float f; - float oldf; - bool b1 = false, b2 = false; - b1 = float.TryParse(text.Text, out oldf); - b2 = float.TryParse(text.Text + e.KeyChar.ToString(), out f); - if (b2 == false) - { - if (b1 == true) - e.Handled = true; - else - e.Handled = false; - } - } - } - } - /// /// 窗体关闭事件处理 /// /// diff --git a/FrmBufferAnalysisBSQ.cs b/FrmBufferAnalysisBSQ.cs index 24a96ca..f54208f 100644 --- a/FrmBufferAnalysisBSQ.cs +++ b/FrmBufferAnalysisBSQ.cs @@ -137,35 +137,7 @@ } } - private void txtRadius_KeyPress(object sender, KeyPressEventArgs e) - { - TextBox text = sender as TextBox; - if ((e.KeyChar < 48 || e.KeyChar > 57) && (e.KeyChar != 8) && (int)e.KeyChar != 46) - { - e.Handled = true; - } - if ((int)e.KeyChar == 46) //小数点 - { - if (text.Text.Length <= 0) - e.Handled = true; //小数点不能在第一位 - else //处理不规则的小数点 - { - float f; - float oldf; - bool b1 = false, b2 = false; - b1 = float.TryParse(text.Text, out oldf); - b2 = float.TryParse(text.Text + e.KeyChar.ToString(), out f); - if (b2 == false) - { - if (b1 == true) - e.Handled = true; - else - e.Handled = false; - } - } - } - } - + private void FrmBufferAnalysis_FormClosing(object sender, FormClosingEventArgs e) { //Form1.y = 0; @@ -316,27 +288,6 @@ } } - private void FlyToMenu_Click(object sender, EventArgs e) - { - if (m_feature != null) - { - if (m_feature.Geometry != null && m_feature.Geometry.Type == EnumGeometryType.GeoPolyline3D) - { - GSOGeoPolyline3D line = m_feature.Geometry as GSOGeoPolyline3D; - double length = line.GetSpaceLength(true, 6378137); - GSOGeoPolyline3D lineLine = line.GetSegment(0, length / 2); - GSOPoint3d point3d = lineLine[lineLine.PartCount - 1][lineLine[lineLine.PartCount - 1].Count - 1]; - - globeControl1.Globe.FlyToPosition(point3d, EnumAltitudeMode.Absolute, 0, 45, 5); - } - else - { - globeControl1.Globe.FlyToFeature(m_feature, 0, 45, 3); - } - LightMenu_Click(sender, e); - } - } - private void LightMenu_Click(object sender, EventArgs e) { flashflag = "single"; diff --git a/FrmDataBaseOpt.cs b/FrmDataBaseOpt.cs index b0c4b5d..8d7b69d 100644 --- a/FrmDataBaseOpt.cs +++ b/FrmDataBaseOpt.cs @@ -362,6 +362,7 @@ dbCombor.Items.Add(dblist[i].title); } } + /* /// /// 从配置文件读取数据库参数配置 /// @@ -428,6 +429,8 @@ } } + * */ + /* /// /// 向配置文件写入连接数据库的参数配置 /// @@ -485,6 +488,7 @@ MessageBox.Show(exp.ToString()); } } + * */ /// /// /// diff --git a/FrmDatabaseParaSetting.cs b/FrmDatabaseParaSetting.cs index a6fea46..63b596b 100644 --- a/FrmDatabaseParaSetting.cs +++ b/FrmDatabaseParaSetting.cs @@ -152,6 +152,7 @@ this.DialogResult = DialogResult.OK; this.Close(); } + /* /// /// 从配置文件读取数据库连接参数配置 /// @@ -218,6 +219,8 @@ } } + * */ + /* /// /// 向配置文件写入数据库参数配置 /// @@ -276,7 +279,7 @@ MessageBox.Show(ex.ToString()); } } - + */ /// /// 取消按钮事件处理 /// diff --git a/FrmDatabaseParaSetting2.cs b/FrmDatabaseParaSetting2.cs index 932d05e..96a87d5 100644 --- a/FrmDatabaseParaSetting2.cs +++ b/FrmDatabaseParaSetting2.cs @@ -148,6 +148,7 @@ this.DialogResult = DialogResult.OK; this.Close(); } + /* /// /// 从配置文件读取数据库连接参数配置 /// @@ -214,6 +215,8 @@ } } + * */ + /* /// /// 向配置文件写入数据库参数配置 /// @@ -272,7 +275,7 @@ MessageBox.Show(exp.ToString()); } } - + */ /// /// 取消按钮事件处理 /// diff --git a/FrmDiameterQuery.cs b/FrmDiameterQuery.cs index 68c948b..9a5215b 100644 --- a/FrmDiameterQuery.cs +++ b/FrmDiameterQuery.cs @@ -77,18 +77,7 @@ isBetween = true; } } - /// - /// 键盘按键按下事件处理 - /// - /// - /// - private void textBoxX1_KeyPress(object sender, KeyPressEventArgs e) - { - if ((e.KeyChar < 48 || e.KeyChar > 57) && e.KeyChar != 8) - { - e.Handled = true;//屏蔽 - } - } + bool isBetween = false; /// diff --git a/FrmDocumentEdit.cs b/FrmDocumentEdit.cs index aab2d31..e78a7ff 100644 --- a/FrmDocumentEdit.cs +++ b/FrmDocumentEdit.cs @@ -256,121 +256,6 @@ } - // - /// 将本地文件上传到指定的服务器(HttpWebRequest方法) - /// - /// 文件上传到的服务器 - /// 要上传的本地文件(全路径) - /// 文件上传后的名称 - /// 上传进度条 - /// 成功返回1,失败返回0 - private int Upload_Request(string address, string fileNamePath, string saveName, ProgressBar progressBar) - { - int returnValue = 0; - // 要上传的文件 - FileStream fs = new FileStream(fileNamePath, FileMode.Open, FileAccess.Read); - BinaryReader r = new BinaryReader(fs); - //时间戳 - string strBoundary = "----------" + DateTime.Now.Ticks.ToString("x"); - byte[] boundaryBytes = Encoding.ASCII.GetBytes("/r/n--" + strBoundary + "/r/n"); - //请求头部信息 - StringBuilder sb = new StringBuilder(); - sb.Append("--"); - sb.Append(strBoundary); - sb.Append("\r\n"); - sb.Append("Content-Disposition: form-data; name=\""); - sb.Append("file"); - sb.Append("\"; filename=\""); - sb.Append(saveName); - sb.Append("\""); - sb.Append("\r\n"); - sb.Append("Content-Type: "); - sb.Append("application/octet-stream"); - sb.Append("\r\n"); - sb.Append("\r\n"); - string strPostHeader = sb.ToString(); - byte[] postHeaderBytes = Encoding.UTF8.GetBytes(strPostHeader); - // 根据uri创建HttpWebRequest对象 - HttpWebRequest httpReq = (HttpWebRequest)WebRequest.Create(new Uri(address)); - httpReq.Method = "POST"; - //对发送的数据不使用缓存 - httpReq.AllowWriteStreamBuffering = false; - //设置获得响应的超时时间(300秒) - httpReq.Timeout = 300000; - httpReq.ContentType = "multipart/form-data; boundary=" + strBoundary; - long length = fs.Length + postHeaderBytes.Length + boundaryBytes.Length; - long fileLength = fs.Length; - httpReq.ContentLength = length; - try - { - progressBar.Maximum = int.MaxValue; - progressBar.Minimum = 0; - progressBar.Value = 0; - //每次上传4k - int bufferLength = 4096; - byte[] buffer = new byte[bufferLength]; - //已上传的字节数 - long offset = 0; - //开始上传时间 - DateTime startTime = DateTime.Now; - int size = r.Read(buffer, 0, bufferLength); - Stream postStream = httpReq.GetRequestStream(); - //发送请求头部消息 - postStream.Write(postHeaderBytes, 0, postHeaderBytes.Length); - while (size > 0) - { - postStream.Write(buffer, 0, size); - offset += size; - progressBar.Value = (int)(offset * (int.MaxValue / length)); - TimeSpan span = DateTime.Now - startTime; - double second = span.TotalSeconds; - //lblTime.Text = "已用时:" + second.ToString("F2") + "秒"; - //if (second > 0.001) - //{ - // lblSpeed.Text = " 平均速度:" + (offset / 1024 / second).ToString("0.00") + "KB/秒"; - //} - //else - //{ - // lblSpeed.Text = " 正在连接…"; - //} - //lblState.Text = "已上传:" + (offset * 100.0 / length).ToString("F2") + "%"; - //lblSize.Text = (offset / 1048576.0).ToString("F2") + "M/" + (fileLength / 1048576.0).ToString("F2") + "M"; - Application.DoEvents(); - size = r.Read(buffer, 0, bufferLength); - } - //添加尾部的时间戳 - postStream.Write(boundaryBytes, 0, boundaryBytes.Length); - postStream.Close(); - //获取服务器端的响应 - WebResponse webRespon = httpReq.GetResponse(); - Stream s = webRespon.GetResponseStream(); - StreamReader sr = new StreamReader(s); - //读取服务器端返回的消息 - String sReturnString = sr.ReadLine(); - s.Close(); - sr.Close(); - if (sReturnString == "Success") - { - returnValue = 1; - } - else if (sReturnString == "Error") - { - returnValue = 0; - } - } - catch(Exception ex) - { - returnValue = 0; - string str = ex.ToString(); - } - finally - { - fs.Close(); - r.Close(); - } - return returnValue; - } - private void btn_file_Click(object sender, EventArgs e) { OpenFileDialog dlg = new OpenFileDialog(); diff --git a/FrmExportCADS.cs b/FrmExportCADS.cs index 98772ea..59629dd 100644 --- a/FrmExportCADS.cs +++ b/FrmExportCADS.cs @@ -108,65 +108,6 @@ MessageBox.Show("请选中要导出的图层!", "提示", MessageBoxButtons.OK, MessageBoxIcon.Warning); } } - private Boolean MerageToFile(GSOFeatures features, String strDestFile, String strProj4)//图层追加 - { - if (features == null) - { - return false; - } - Boolean bSuccess = false; - - string strDir = GSOUtility.GetFileDir(strDestFile); - string strLPRJFile = GSOUtility.ChangeExt(strDestFile, ".lprj"); - string strExt = GSOUtility.GetFileExt(strDestFile); - - // 如果投影文件存在,投影以投影文件为准 - if (File.Exists(strLPRJFile)) - { - // 如果是dxf,则这样处理 - if (strExt.ToLower() == ".dxf") - { - string strTempSrcFile = strDir + "srcFeatures_dxftmp" + strExt; - globeControl1.Globe.DataManager.SaveFeatureData(features, strTempSrcFile, strLPRJFile, 4); - bSuccess = GSOUtility.MergeTwoDXFFileFeatures(strDestFile, strTempSrcFile); - File.Delete(strTempSrcFile); - } - else - { - GSOFeatures srcFeatures = globeControl1.Globe.DataManager.ReadFeatureData(strDestFile); - int nCount = features.Length; - int i = 0; - for (i = 0; i < nCount; i++) - { - srcFeatures.Add(features[i]); - } - bSuccess = globeControl1.Globe.DataManager.SaveFeatureData(srcFeatures, strDestFile, strLPRJFile, 4); - } - } - else - { - // 如果是dxf,则这样处理 - if (strExt.ToLower() == ".dxf") - { - string strTempSrcFile = strDir + "srcFeatures_dxftmp" + strExt; - globeControl1.Globe.DataManager.SaveFeatureData(features, strTempSrcFile, strProj4, 0); - bSuccess = GSOUtility.MergeTwoDXFFileFeatures(strDestFile, strTempSrcFile); - File.Delete(strTempSrcFile); - } - else - { - GSOFeatures srcFeatures = globeControl1.Globe.DataManager.ReadFeatureData(strDestFile); - int nCount = features.Length; - int i = 0; - for (i = 0; i < nCount; i++) - { - srcFeatures.Add(features[i]); - } - bSuccess = globeControl1.Globe.DataManager.SaveFeatureData(srcFeatures, strDestFile, strProj4, 0); - } - } - return bSuccess; - } /// /// 关闭按钮事件处理 /// diff --git a/FrmHDMAnalysis3.cs b/FrmHDMAnalysis3.cs index 4f73af6..2ada735 100644 --- a/FrmHDMAnalysis3.cs +++ b/FrmHDMAnalysis3.cs @@ -436,29 +436,6 @@ } layerTemp.RemoveAllFeature(); } - private void Export(GSOPoint3d _pnt, double r) - { - GSOPoint3ds pnts = new GSOPoint3ds(); - GSOPoint3d pnt = new GSOPoint3d(); - pnt.X = _pnt.X; - pnt.Y = _pnt.Y; - pnt.Z = _pnt.Z; - pnts.Add(pnt); - pnt.X = _pnt.X; - pnt.Y = _pnt.Y - 0.0000000005; - pnt.Z = _pnt.Z; - pnts.Add(pnt); - GSOGeoPolyline3D line = new GSOGeoPolyline3D(); - line.AddPart(pnts); - GSOGeoPolygon3D polygon = line.CreateBuffer(r * 2, true, 5, true, false); - GSOPoint3ds points = polygon[0]; - GSOGeoPolyline3D newLine = new GSOGeoPolyline3D(); - newLine.AddPart(points); - newLine.AltitudeMode = EnumAltitudeMode.RelativeToGround; - GSOFeature newFeature = new GSOFeature(); - newFeature.Geometry = newLine; - globeControl1.Globe.MemoryLayer.AddFeature(newFeature); - } private void ExportCAD(double a, double b, double r) { diff --git a/FrmHotFuncStat.cs b/FrmHotFuncStat.cs index c980f34..2eb1476 100644 --- a/FrmHotFuncStat.cs +++ b/FrmHotFuncStat.cs @@ -421,13 +421,6 @@ } } - private void HFS_Pderive_Click(object sender, EventArgs e) - { - if (TV_Files.SelectedNode != null) - { - HFSClass.GuideEdit_form("G", TV_Files, int.Parse(((ToolStripMenuItem)sender).Tag.ToString())); - } - } private void 导入ToolStripMenuItem_Click(object sender, EventArgs e) { @@ -530,22 +523,8 @@ } } - private void 导出ToolStripMenuItem1_Click(object sender, EventArgs e) - { - 导出ToolStripMenuItem2_Click(sender, e); - } + - private void TV_HFSSrchRslt_AfterCollapse(object sender, TreeViewEventArgs e) - { - e.Node.ImageIndex = 0; - } - - private void TV_HFSSrchRslt_AfterExpand(object sender, TreeViewEventArgs e) - { - HFSClass.ADD_TreeNode(TV_Files, e.Node); - e.Node.ImageIndex = 1; - } - private void 导出ToolStripMenuItem1_Click_1(object sender, EventArgs e) { if ((TV_HFSSrchRslt.SelectedNode != null) && (TV_HFSSrchRslt.SelectedNode.Parent != null)) diff --git a/FrmLayerControl.cs b/FrmLayerControl.cs index e7917c3..28fa14d 100644 --- a/FrmLayerControl.cs +++ b/FrmLayerControl.cs @@ -312,26 +312,7 @@ layerManagerNode.Expand(); terrainManagerNode.Expand(); } - /// - /// 刷新节点树 - /// - private void RefreshDataTree() - { - layerTree2.Nodes[0].Nodes.Clear(); - Int32 nCount = globeControl2.Globe.Layers.Count; - Int32 i = 0; - for (i = 0; i < nCount; i++) - { - GSODataset dataSpace = globeControl2.Globe.Layers[i].Dataset; - TreeNode node = new TreeNode(); - node.Text = dataSpace.Name; - node.ImageIndex = 0; - node.SelectedImageIndex = 0; - node.Checked = true; - node.Tag = dataSpace; - layerTree2.Nodes[0].Nodes.Add(node); - } - } + /// /// 目标图层按钮事件处理 /// @@ -494,22 +475,8 @@ } } } - /// - /// 改变指定节点的选中状态 - /// - /// - /// - private void CheckTreeNode(TreeNode node, Boolean bChecked) - { - CheckChildTreeNode(node, bChecked); - // 对于kml图层,如果当前处理的节点是true,那么要把所有的祖宗节点置为true - // 只有所有节点都未false,那么这个节点才为false - // CheckFatherTreeNode(node, bChecked); - globeControl1.Globe.Refresh(); - globeControl2.Globe.Refresh(); - - } + private void CheckChildTreeNode(TreeNode node, Boolean bChecked) { if (node == null) @@ -696,59 +663,7 @@ //} //CheckControl(e); } - /// - /// 树节点选中方法 - /// - /// - private void CheckControl(TreeViewEventArgs e) - { - if (e.Action != TreeViewAction.Unknown) - { - if (e.Node != null && !Convert.IsDBNull(e.Node)) - { - CheckParentNode(e.Node); - if (e.Node.Nodes.Count > 0) - { - CheckAllChildNodes(e.Node, e.Node.Checked); - } - } - } - } - /// - /// 改变所有子节点的状态 - /// - /// - /// - private void CheckAllChildNodes(TreeNode pn, bool IsChecked) - { - foreach (TreeNode tn in pn.Nodes) - { - tn.Checked = IsChecked; - if (tn.Tag.ToString().Contains("|")) - { - string nodeTag = tn.Tag.ToString().Split('|')[1]; - GSOLayer layer = globeControl1.Globe.Layers.GetLayerByCaption(nodeTag); - if (layer != null) - { - layer.Visible = IsChecked; - globeControl1.Globe.Refresh(); - } - } - if (tn.Tag is GSOFeature) - { - if (tn.Nodes.Count == 0) - { - GSOFeature feat = tn.Tag as GSOFeature; - feat.Visible = IsChecked; - globeControl1.Globe.Refresh(); - } - } - if (tn.Nodes.Count > 0) - { - CheckAllChildNodes(tn, IsChecked); - } - } - } + /// /// 改变父节点的选中状态,此处为所有子节点不选中时才取消父节点选中,可以根据需要修改 /// diff --git a/FrmLogin.cs b/FrmLogin.cs index 320fdd5..2afe46e 100644 --- a/FrmLogin.cs +++ b/FrmLogin.cs @@ -59,70 +59,6 @@ textBoxPassWord.Clear(); } } - - /// - /// 验证端口号 - /// - /// - private bool ValiPort() - { - Ping p = new Ping();//创建Ping对象p - PingReply pr = p.Send(Utility.localicenseserverip);//向指定IP或者主机名的计算机发送ICMP协议的ping数据包 - if (pr.Status == IPStatus.Success)//如果ping成功 - { - try - { - TcpClient tcpc = new TcpClient(Utility.localicenseserverip, Utility.localicenseserverport);//对IP地址为"192.168.0.105"的计算机的1500端口提出连接申请 - tcpc.Close(); - return true; - } - catch (Exception ex) - { - MessageBox.Show("端口连接错误!" + ex.Message); - return false; - } - } - else - { - int times = 0;//重新连接次数; - int count = 2;//设置尝试次数 - while (times < count) - { - //Thread.Sleep(1000);//等待时间(方便测试的话,你可以改为1000) - pr = p.Send(Utility.localicenseserverip); - - if (pr.Status == IPStatus.Success) - { - try - { - TcpClient tcpc = new TcpClient(Utility.localicenseserverip, Utility.localicenseserverport);//对IP地址为"192.168.0.105"的计算机的1500端口提出连接申请 - tcpc.Close(); - return true; - } - catch (Exception ex) - { - MessageBox.Show("端口连接错误!" + ex.Message); - return false; - } - } - else - { - times++; - if (times < count) - { - continue; - } - else - { - MessageBox.Show("重新尝试连接失败"); - return false; - } - } - - } - return false; - } - } /// /// 验证用户名、密码 /// diff --git a/FrmMetadata.cs b/FrmMetadata.cs index 886f65a..0365372 100644 --- a/FrmMetadata.cs +++ b/FrmMetadata.cs @@ -27,11 +27,7 @@ InitializeComponent(); loadTreeView(layerTree); } - private void FrmMetadata_Load(object sender, EventArgs e) - { - //this.ntLblC.Text = "nn"; - // loadTreeView(layerTree); - } + private void loadTreeView(TreeView tv)//构建图层树 { try diff --git a/FrmMetadataStat.cs b/FrmMetadataStat.cs index 790658a..e7696c6 100644 --- a/FrmMetadataStat.cs +++ b/FrmMetadataStat.cs @@ -197,9 +197,5 @@ } } - private void buttonX1_Click(object sender, EventArgs e) - { - drawChart(); - } } } diff --git a/FrmPatrolerManager.cs b/FrmPatrolerManager.cs index 37f8ffd..9e66aeb 100644 --- a/FrmPatrolerManager.cs +++ b/FrmPatrolerManager.cs @@ -109,82 +109,8 @@ this.winGridViewPager1.AllToExport = table; } - /// - /// 编辑 - /// - /// - /// - private void winGridViewPager1_OnEditSelected(object sender, EventArgs e) - { - - DataGridView grid = sender as DataGridView; - if (grid != null && grid.SelectedRows.Count>0) - { - DataGridViewRow row = grid.SelectedRows[0]; - try - { - long dbid = long.Parse(row.Cells["编号"].Value.ToString()); - String name = row.Cells["姓名"].Value.ToString(); - String sex = row.Cells["性别"].Value.ToString(); - String age = row.Cells["年龄"].Value.ToString(); - string phone = row.Cells["电话"].Value.ToString(); - age = String.IsNullOrEmpty(age.ToString().Trim()) ? "1" : age.ToString().Trim(); - FrmPatrolerEdit frm = new FrmPatrolerEdit(dbid.ToString(), name, age, sex, phone); - frm.reloadGrid += new ReloadPatrolerGrid(LoadData); - frm.ShowDialog(); - winGridViewPager1.Refresh(); - } - catch (Exception ex) - { - MessageBox.Show("编辑失败:" + ex.ToString(), "错误", MessageBoxButtons.OK, MessageBoxIcon.Error); - } - } - else - { - MessageBox.Show("没有选择记录", "提示"); - } - - } - - /// - /// 删除 - /// - /// - /// - private void winGridViewPager1_OnDeleteSelected(object sender, EventArgs e) - { - DataGridView grid = sender as DataGridView; - if (grid != null && grid.SelectedRows.Count > 0) - { - DataGridViewRow row = grid.SelectedRows[0]; - long dbid = long.Parse(row.Cells["编号"].Value.ToString()); - try - { - string state = row.Cells["状态"].Value.ToString(); - if ("在线".Equals(state)) - { - if (MessageBox.Show("确定注销?", "确认", MessageBoxButtons.YesNo, MessageBoxIcon.Question) == DialogResult.Yes) - { - String sql = "update patroler t set t.accountstate='LEAVER' where t.dbid=" + dbid; - OracleUtils.ExecuteNonQuery(OracleUtils.ConnectionString, CommandType.Text, sql); - } - } - else { - MessageBox.Show("人员不在线,无法注销", "信息"); - } - } - catch (Exception ex) - { - MessageBox.Show("人员注销失败:" + ex.ToString(), "错误", MessageBoxButtons.OK, MessageBoxIcon.Error); - } - } - else - { - MessageBox.Show("没有选择记录", "提示"); - } - } - - + + private void LoadData() { int pageIndex = winGridViewPager1.PagerInfo.CurrenetPageIndex; diff --git a/FrmRoadHDM.cs b/FrmRoadHDM.cs index e765313..e871dd5 100644 --- a/FrmRoadHDM.cs +++ b/FrmRoadHDM.cs @@ -333,31 +333,6 @@ this.Cursor = Cursors.Default; } } - - private void Export(GSOPoint3d _pnt, double r) - { - GSOPoint3ds pnts = new GSOPoint3ds(); - GSOPoint3d pnt = new GSOPoint3d(); - pnt.X = _pnt.X; - pnt.Y = _pnt.Y; - pnt.Z = _pnt.Z; - pnts.Add(pnt); - pnt.X = _pnt.X; - pnt.Y = _pnt.Y - 0.0000000005; - pnt.Z = _pnt.Z; - pnts.Add(pnt); - GSOGeoPolyline3D line = new GSOGeoPolyline3D(); - line.AddPart(pnts); - GSOGeoPolygon3D polygon = line.CreateBuffer(r * 2, true, 5, true, false); - GSOPoint3ds points = polygon[0]; - GSOGeoPolyline3D newLine = new GSOGeoPolyline3D(); - newLine.AddPart(points); - newLine.AltitudeMode = EnumAltitudeMode.RelativeToGround; - GSOFeature newFeature = new GSOFeature(); - newFeature.Geometry = newLine; - globeControl1.Globe.MemoryLayer.AddFeature(newFeature); - } - private void ExportCAD(double a, double b, double r) { GSOPoint3ds pnts = new GSOPoint3ds(); diff --git a/FrmUserAdd.cs b/FrmUserAdd.cs index c612ab4..f826427 100644 --- a/FrmUserAdd.cs +++ b/FrmUserAdd.cs @@ -231,24 +231,6 @@ //cbxRegion.SelectedIndexChanged += new EventHandler(cbxRegion_SelectedIndexChanged); } } - /// - /// 下拉框选中项改变事件处理 - /// - /// - /// - private void cbxRegion_SelectedIndexChanged(object sender, EventArgs e) - { - string sql = ""; - //string sql = "select casic_role.\"name\" from casic_role join casic_regionrole on casic_role.\"id\"=casic_regionrole.\"rid\" where casic_regionrole.\"reid\"=" + region[cbxRegion.SelectedItem.ToString().Trim()]; - DataTable dt = OledbHelper.QueryTable(sql); - if (dt != null && dt.Rows.Count > 0) - { - comboBoxExRegionRole.Items.Clear(); - for (int i = 0; i < dt.Rows.Count; i++) - { - comboBoxExRegionRole.Items.Add(dt.Rows[i][0].ToString().Trim());//部门角色 - } - } - } + } } diff --git a/FrmUserManager.cs b/FrmUserManager.cs index 571f0f0..ae254bc 100644 --- a/FrmUserManager.cs +++ b/FrmUserManager.cs @@ -81,11 +81,6 @@ } } } - //创建新用户 - private void buttonX2_Click(object sender, EventArgs e) - { - FrmUserAdd frm = new FrmUserAdd(-1); - frm.ShowDialog(); - } + } } diff --git a/FrmValveStatistics.cs b/FrmValveStatistics.cs index 545d56c..dd76777 100644 --- a/FrmValveStatistics.cs +++ b/FrmValveStatistics.cs @@ -54,7 +54,7 @@ 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") + if (chaFamenStatis.Series["阀门"].Points[m]!=null&&chaFamenStatis.Series["阀门"].Points[m].YValues[0].ToString() != "0") { chaFamenStatis.Series["阀门"].Points[m].Label = chaFamenStatis.Series[0].Points[m].YValues[0].ToString(); } diff --git a/Frm_password_reset.cs b/Frm_password_reset.cs index 7b51039..b9e5dc3 100644 --- a/Frm_password_reset.cs +++ b/Frm_password_reset.cs @@ -41,6 +41,7 @@ } catch (Exception ex) { + LogHelper.WriteLog(typeof(Frm_password_reset), ex.Message); } } private void initCombox() diff --git a/FrmpipeDeepstatis.cs b/FrmpipeDeepstatis.cs index e156db4..1a84d6c 100644 --- a/FrmpipeDeepstatis.cs +++ b/FrmpipeDeepstatis.cs @@ -307,7 +307,7 @@ chart1.Series[j].Points.DataBindXY(dic1.Keys, dic1.Values); for (int m = 0; m < dic1.Values.Count; m++) { - if (chart1.Series[j].Points[m].YValues[0].ToString() != "0") + if (chart1.Series[j].Points[m]!=null&&chart1.Series[j].Points[m].YValues[0].ToString() != "0") { chart1.Series[j].Points[m].Label = chart1.Series[j].Points[m].YValues[0].ToString(); diff --git a/Cyberpipe.csproj b/Cyberpipe.csproj index 07a8c1a..e3cd12c 100644 --- a/Cyberpipe.csproj +++ b/Cyberpipe.csproj @@ -204,25 +204,6 @@ - - Form - - - F_GKT1数据输入输出.cs - - - Form - - - F_GKT1添加文件.cs - - - Form - - - F_GKT1添加项目.cs - - Form @@ -1068,18 +1049,6 @@ Frm_password_reset.cs - - Form - - - GKT.cs - - - Form - - - GKT1.cs - Form @@ -1258,12 +1227,6 @@ F_Projedit.cs - - Form - - - PED.cs - Form @@ -1331,16 +1294,6 @@ True Reference.map - - F_GKT1数据输入输出.cs - Designer - - - F_GKT1添加文件.cs - - - F_GKT1添加项目.cs - Form_EditTask.cs @@ -1836,12 +1789,6 @@ Frm_password_reset.cs - - GKT.cs - - - GKT1.cs - F_GKT数据输入输出.cs @@ -1934,9 +1881,6 @@ F_Projedit.cs - - PED.cs - F_数据输入输出.cs diff --git a/Cyberpipe.suo b/Cyberpipe.suo index 68ced4f..a1aecf8 100644 --- a/Cyberpipe.suo +++ b/Cyberpipe.suo Binary files differ diff --git a/EMS_Forms/Form_EditTask.cs b/EMS_Forms/Form_EditTask.cs index 718992f..f1d791f 100644 --- a/EMS_Forms/Form_EditTask.cs +++ b/EMS_Forms/Form_EditTask.cs @@ -119,7 +119,8 @@ String name = Convert.ToString(dr["USERNAME"]); comboBox_userName.Items.Add(name); - } + } + dr.Close(); comboBox_road.Items.Clear(); roadList = new List(); @@ -135,7 +136,7 @@ comboBox_road.Items.Add(name); } } - + dr1.Close(); conn.Close(); bool flag2 = false; @@ -185,7 +186,7 @@ catch (Exception ex) { - MessageBox.Show(ex.ToString()); + LogHelper.WriteLog(typeof(Form_EditTask), ex.Message); } } @@ -288,7 +289,7 @@ } catch (Exception ex) { - MessageBox.Show(ex.ToString()); + LogHelper.WriteLog(typeof(Form_EditTask), ex.Message); } } @@ -474,7 +475,7 @@ } catch (Exception ex) { - MessageBox.Show(ex.ToString()); + LogHelper.WriteLog(typeof(Form_EditTask), ex.Message); } this.Close(); @@ -495,6 +496,7 @@ { numList.Add(Convert.ToInt32(dr["DBID"])); } + dr.Close(); if (numList.Count == 0) { taskNumber = Convert.ToInt32(number) * 100; @@ -674,6 +676,7 @@ } } } + dr.Close(); conn.Close(); } diff --git a/EMS_Forms/Form_EventManager.cs b/EMS_Forms/Form_EventManager.cs index b18c45b..84807b2 100644 --- a/EMS_Forms/Form_EventManager.cs +++ b/EMS_Forms/Form_EventManager.cs @@ -64,6 +64,7 @@ comboBox_name.Items.Add(name); } + dr.Close(); conn.Close(); diff --git a/Forms/FrmMnModify.cs b/Forms/FrmMnModify.cs index 31cfc5f..d036360 100644 --- a/Forms/FrmMnModify.cs +++ b/Forms/FrmMnModify.cs @@ -68,15 +68,7 @@ questionGrid.Rows[idx].Cells[1].Value = sr.question; } } - /// 选中对象 - /// - /// - /// - /// - private void buttonX1_Click(object sender, EventArgs e) - { - globecontrol.Globe.Action = EnumAction3D.SelectObject; - } + /// /// 选中某一行 /// diff --git a/Forms/FrmPipelineModelDataBase.cs b/Forms/FrmPipelineModelDataBase.cs index 2acf0ca..7ce573f 100644 --- a/Forms/FrmPipelineModelDataBase.cs +++ b/Forms/FrmPipelineModelDataBase.cs @@ -35,19 +35,7 @@ ds = _ds; InitializeComponent(); } - /// - /// 单击选择shp格式文件 - /// - /// - /// - private void btnBrowseModel_Click(object sender, EventArgs e) - { - saveFileDialog1.Filter = "*.lgd|*.lgd"; - if (saveFileDialog1.ShowDialog() == DialogResult.OK) - { - txtModelLayer.Text = saveFileDialog1.FileName; - } - } + /// /// 窗体初始化事件处理 /// @@ -100,49 +88,6 @@ } } } - - private object convertFieldValue(string fieldname, object obj) - { - if (obj == null) - return null; - - try - { - string type = fields_types[fieldname].ToString(); - switch (type) - { - case "string": - return obj.ToString(); - case "int": - //return 101; - int intResult; - if (int.TryParse(obj.ToString(), out intResult)) - return intResult; - else - return null; - case "double": - //return 202.5; - double doubleResult; - if (double.TryParse(obj.ToString(), out doubleResult)) - return doubleResult; - else - return null; - case "date": - DateTime dtResult; - if (DateTime.TryParse(obj.ToString(), out dtResult)) - return dtResult; - else - return null; - } - return null; - } - catch (Exception ex) - { - MessageBox.Show(ex.ToString()); - return null; - } - } - public string lgdFilePath = ""; /// /// 选择管线颜色 @@ -610,33 +555,6 @@ { this.Close(); } - - private void cmbLayer_SelectedIndexChanged(object sender, EventArgs e) //选择图层 - { - GSOLayer layer = ctl.Globe.Layers.GetLayerByCaption(selectLayerName); - GSOFeatures features = layer.GetAllFeatures(); - if (features.Length == 0) - return; - - cmbFrom.Items.Clear(); - cmbTo.Items.Clear(); - cmbRadius.Items.Clear(); - cmbID.Items.Clear(); - for (int i = 0; i < features[0].GetFieldCount(); i++) - { - GeoScene.Data.GSOFieldDefn fielddef = (GeoScene.Data.GSOFieldDefn)(features[0].GetFieldDefn(i)); - - cmbFrom.Items.Add(fielddef.Name); - cmbTo.Items.Add(fielddef.Name); - cmbRadius.Items.Add(fielddef.Name); - cmbID.Items.Add(fielddef.Name); - } - cmbFrom.SelectedItem = "Deep1"; - cmbTo.SelectedItem = "Deep2"; - cmbRadius.SelectedItem = "Diameter"; - cmbID.SelectedItem = "Handle"; - } - private void buttonXLayerPath_Click(object sender, EventArgs e)//单击 选择shp格式的文件 { OpenFileDialog dlg = new OpenFileDialog(); diff --git a/Forms/FrmPipelineModelDataOneStep.cs b/Forms/FrmPipelineModelDataOneStep.cs index 18afda7..ec93b8a 100644 --- a/Forms/FrmPipelineModelDataOneStep.cs +++ b/Forms/FrmPipelineModelDataOneStep.cs @@ -38,19 +38,7 @@ layerTree = _layerTree; InitializeComponent(); } - /// - /// 单击选择shp格式文件 - /// - /// - /// - private void btnBrowseModel_Click(object sender, EventArgs e) - { - saveFileDialog1.Filter = "*.lgd|*.lgd"; - if (saveFileDialog1.ShowDialog() == DialogResult.OK) - { - txtModelLayer.Text = saveFileDialog1.FileName; - } - } + /// /// 窗体初始化事件处理 /// @@ -107,48 +95,7 @@ } } - private object convertFieldValue(string fieldname, object obj) - { - if (obj == null) - return null; - - try - { - string type = fields_types[fieldname].ToString(); - switch (type) - { - case "string": - return obj.ToString(); - case "int": - //return 101; - int intResult; - if (int.TryParse(obj.ToString(), out intResult)) - return intResult; - else - return null; - case "double": - //return 202.5; - double doubleResult; - if (double.TryParse(obj.ToString(), out doubleResult)) - return doubleResult; - else - return null; - case "date": - DateTime dtResult; - if (DateTime.TryParse(obj.ToString(), out dtResult)) - return dtResult; - else - return null; - } - return null; - } - catch (Exception ex) - { - MessageBox.Show(ex.ToString()); - return null; - } - } - + public string lgdFilePath = ""; /// /// 选择管线颜色 @@ -673,32 +620,6 @@ return featDs; } - private void cmbLayer_SelectedIndexChanged(object sender, EventArgs e) //选择图层 - { - GSOLayer layer = ctl.Globe.Layers.GetLayerByCaption(selectLayerName); - GSOFeatures features = layer.GetAllFeatures(); - if (features.Length == 0) - return; - - cmbFrom.Items.Clear(); - cmbTo.Items.Clear(); - cmbRadius.Items.Clear(); - cmbID.Items.Clear(); - for (int i = 0; i < features[0].GetFieldCount(); i++) - { - GeoScene.Data.GSOFieldDefn fielddef = (GeoScene.Data.GSOFieldDefn)(features[0].GetFieldDefn(i)); - - cmbFrom.Items.Add(fielddef.Name); - cmbTo.Items.Add(fielddef.Name); - cmbRadius.Items.Add(fielddef.Name); - cmbID.Items.Add(fielddef.Name); - } - cmbFrom.SelectedItem = "Deep1"; - cmbTo.SelectedItem = "Deep2"; - cmbRadius.SelectedItem = "Diameter"; - cmbID.SelectedItem = "Handle"; - } - private void buttonXLayerPath_Click(object sender, EventArgs e)//单击 选择shp格式的文件 { OpenFileDialog dlg = new OpenFileDialog(); @@ -949,38 +870,6 @@ } //txtLayername.Text = type + layername; } - /// - /// 连接数据库 - /// - /// - /// - private void buttonX1_Click(object sender, EventArgs e) - { - if (ds == null) - { - //没连的话,直接连接审核库; //审核库配置读配置文件 - string dbIp = Utility.sgdbip; - string database = Utility.sgdbname; - string user = Utility.sgdbuser; - string pass = Utility.sgdbpwd; - - if (!Utility.isNetworkConnectionSuccess(dbIp.Trim())) - { - MessageBox.Show("网络连接失败!", "提示"); - return; - } - - ds = ctl.Globe.DataManager.OpenOracleDataSource(dbIp + "/" + database, "", "", user, pass); - if (ds == null) - { - MessageBox.Show("数据库连接失败!", "提示", MessageBoxButtons.OK, MessageBoxIcon.Warning); - } - else - { - btnCreateModel.Enabled = true; - } - } - } private void btnClose_Click(object sender, EventArgs e) { diff --git a/Forms/FrmShRK.cs b/Forms/FrmShRK.cs index 0e2e722..f1d83cb 100644 --- a/Forms/FrmShRK.cs +++ b/Forms/FrmShRK.cs @@ -215,6 +215,7 @@ { sourcefeatds = sourcefeat as GSOFeatureDataset; } + if (sourcefeatds == null) return; sourcefeatds.Open(); GSOFeatures sourcefeatures = sourcefeatds.GetAllFeatures(); @@ -251,6 +252,7 @@ { desfeatds = desfeat as GSOFeatureDataset; } + if (desfeatds == null) return; desfeatds.Open(); //向新数据集写入字段 diff --git a/FrmAccessoriesSensor.cs b/FrmAccessoriesSensor.cs index 09fcdf1..2a7a80e 100644 --- a/FrmAccessoriesSensor.cs +++ b/FrmAccessoriesSensor.cs @@ -209,7 +209,7 @@ chart1.Series[0].Points.DataBindXY(dic.Keys, dic.Values); for (int m = 0; m < dic.Values.Count; m++) { - if (chart1.Series[0].Points[m].YValues[0].ToString() != "0") + if (chart1.Series[0].Points[m]!=null&&chart1.Series[0].Points[m].YValues[0].ToString() != "0") { chart1.Series[0].Points[m].Label = chart1.Series[0].Points[m].YValues[0].ToString(); } diff --git a/FrmAccessoriesgather.cs b/FrmAccessoriesgather.cs index 9e331e1..a475d9e 100644 --- a/FrmAccessoriesgather.cs +++ b/FrmAccessoriesgather.cs @@ -338,7 +338,7 @@ chart1.Series[0].Points.DataBindXY(dic.Keys, dic.Values); for (int m = 0; m < dic.Values.Count; m++) { - if (chart1.Series[0].Points[m].YValues[0].ToString() != "0") + if (chart1.Series[0].Points[m]!=null&&chart1.Series[0].Points[m].YValues[0].ToString() != "0") { chart1.Series[0].Points[m].Label = chart1.Series[0].Points[m].YValues[0].ToString(); } diff --git a/FrmAccessoryAnalysis.cs b/FrmAccessoryAnalysis.cs index 71d4579..44d4065 100644 --- a/FrmAccessoryAnalysis.cs +++ b/FrmAccessoryAnalysis.cs @@ -66,39 +66,6 @@ globeControl1.Refresh(); } /// - /// 键盘按键按下事件处理 - /// - /// - /// - private void txtRadius_KeyPress(object sender, KeyPressEventArgs e) - { - TextBox text = sender as TextBox; - if ((e.KeyChar < 48 || e.KeyChar > 57) && (e.KeyChar != 8) && (int)e.KeyChar != 46) - { - e.Handled = true; - } - if ((int)e.KeyChar == 46) //小数点 - { - if (text.Text.Length <= 0) - e.Handled = true; //小数点不能在第一位 - else //处理不规则的小数点 - { - float f; - float oldf; - bool b1 = false, b2 = false; - b1 = float.TryParse(text.Text, out oldf); - b2 = float.TryParse(text.Text + e.KeyChar.ToString(), out f); - if (b2 == false) - { - if (b1 == true) - e.Handled = true; - else - e.Handled = false; - } - } - } - } - /// /// 确定按钮事件处理 /// /// diff --git a/FrmAddValve.cs b/FrmAddValve.cs index 34d2fec..5f405b9 100644 --- a/FrmAddValve.cs +++ b/FrmAddValve.cs @@ -486,56 +486,6 @@ } } - - - - - - - - private void cmbLayer_SelectedIndexChanged(object sender, EventArgs e) - { - GSOLayer layer = globeControl1.Globe.Layers.GetLayerByCaption(selectLayerName); - GSOFeatures features = layer.GetAllFeatures(); - if (features.Length == 0) - return; - - combPath.Items.Clear(); - combZ.Items.Clear(); - combModelName.Items.Clear(); - - for (int i = 0; i < features[0].GetFieldCount(); i++) - { - GeoScene.Data.GSOFieldDefn fielddef = (GeoScene.Data.GSOFieldDefn)(features[0].GetFieldDefn(i)); - combPath.Items.Add(fielddef.Name); - combZ.Items.Add(fielddef.Name); - combModelName.Items.Add(fielddef.Name); - } - combModelName.SelectedItem = "编号"; - combPath.SelectedItem = "模型路径"; - if (combfile.SelectedIndex != -1) - { - - string layerCaption = combfile.SelectedItem.ToString().Trim(); - rukuLayer = globeControl1.Globe.Layers.GetLayerByCaption(layerCaption); - if (rukuLayer != null) - { - combPath.Items.Clear(); - combZ.Items.Clear(); - combModelName.Items.Clear(); - - } - for (int i = 0; i < features[0].GetFieldCount(); i++) - { - GeoScene.Data.GSOFieldDefn fielddef = (GeoScene.Data.GSOFieldDefn)(features[0].GetFieldDefn(i)); - combPath.Items.Add(fielddef.Name); - combZ.Items.Add(fielddef.Name); - combModelName.Items.Add(fielddef.Name); - } - combModelName.SelectedItem = "编号"; - combPath.SelectedItem = "模型路径"; - } - } /// /// 单击选择shp格式文件 /// diff --git a/FrmAddWellShp.cs b/FrmAddWellShp.cs index bb79ec0..a249725 100644 --- a/FrmAddWellShp.cs +++ b/FrmAddWellShp.cs @@ -478,32 +478,6 @@ } } } - - private void cmbLayer_SelectedIndexChanged(object sender, EventArgs e) - { - GSOLayer layer = globeControl1.Globe.Layers.GetLayerByCaption(selectLayerName); - GSOFeatures features = layer.GetAllFeatures(); - if (features.Length == 0) - return; - - combCode.Items.Clear(); - combDeep.Items.Clear(); - combModelName.Items.Clear(); - combAngle.Items.Clear(); - - for (int i = 0; i < features[0].GetFieldCount(); i++) - { - GeoScene.Data.GSOFieldDefn fielddef = (GeoScene.Data.GSOFieldDefn)(features[0].GetFieldDefn(i)); - combCode.Items.Add(fielddef.Name); - combDeep.Items.Add(fielddef.Name); - combModelName.Items.Add(fielddef.Name); - combAngle.Items.Add(fielddef.Name); - } - combCode.SelectedItem = "附属物编码"; - combDeep.SelectedItem = "井深"; - combModelName.SelectedItem = "编号"; - combAngle.SelectedItem = "符号角度"; - } /// /// 单击选择shp格式文件 /// diff --git a/FrmAddYuBiZiShp.cs b/FrmAddYuBiZiShp.cs index b312d51..332f037 100644 --- a/FrmAddYuBiZiShp.cs +++ b/FrmAddYuBiZiShp.cs @@ -383,80 +383,7 @@ } } - private void cmbLayer_SelectedIndexChanged(object sender, EventArgs e) - { - GSOLayer layer = globeControl1.Globe.Layers.GetLayerByCaption(selectLayerName); - GSOFeatures features = layer.GetAllFeatures(); - if (features.Length == 0) - return; - - combCode.Items.Clear(); - combDeep.Items.Clear(); - combModelName.Items.Clear(); - //comboLoad.Items.Clear(); - for (int i = 0; i < features[0].GetFieldCount(); i++) - { - GeoScene.Data.GSOFieldDefn fielddef = (GeoScene.Data.GSOFieldDefn)(features[0].GetFieldDefn(i)); - combCode.Items.Add(fielddef.Name); - combDeep.Items.Add(fielddef.Name); - combModelName.Items.Add(fielddef.Name); - //comboLoad.Items.Add(fielddef.Name); - } - combCode.SelectedItem = "附属物编码"; - combDeep.SelectedItem = "Z坐标"; - combModelName.SelectedItem = "编号"; - //comboLoad.SelectedItem = "模型路径"; - } - - private void buttonXLayerPath_Click(object sender, EventArgs e) - { - OpenFileDialog dlg = new OpenFileDialog(); - dlg.Filter = "*.shp|*.shp"; - dlg.Multiselect = false; - if (dlg.ShowDialog() == DialogResult.OK) - { - GSOLayer layer = globeControl1.Globe.Layers.Add(dlg.FileName); - string txtMessage = valiYBdata(layer); - if (txtMessage != "") - { - button3.Enabled = false; - //textBoxLayer.Text = ""; - combCode.Items.Clear(); - combDeep.Items.Clear(); - combModelName.Items.Clear(); - globeControl1.Globe.Layers.Remove(layer); - FrmValiDataShowErrorMessage showErrorMessage = new FrmValiDataShowErrorMessage(dlg.FileName, txtMessage); - showErrorMessage.ShowDialog(); - return; - } - else - { - button3.Enabled = true; - //textBoxLayer.Text = dlg.FileName; - selectLayerName = layer.Caption; - txtLayerName.Text = layer.Caption; - GSOFeatures features = layer.GetAllFeatures(); - if (features.Length == 0) - return; - - combCode.Items.Clear(); - combDeep.Items.Clear(); - combModelName.Items.Clear(); - for (int i = 0; i < features[0].GetFieldCount(); i++) - { - GeoScene.Data.GSOFieldDefn fielddef = (GeoScene.Data.GSOFieldDefn)(features[0].GetFieldDefn(i)); - combCode.Items.Add(fielddef.Name); - combDeep.Items.Add(fielddef.Name); - combModelName.Items.Add(fielddef.Name); - //comboLoad.Items.Add(fielddef.Name); - } - combCode.SelectedItem = "管点编码"; - combDeep.SelectedItem = "Z坐标"; - combModelName.SelectedItem = "编号"; - } - } - } - + private void FrmAddYuBiZiShp_FormClosing(object sender, FormClosingEventArgs e) { globeControl1.Globe.Refresh(); diff --git a/FrmAllPipelineStatis.cs b/FrmAllPipelineStatis.cs index 6421a26..a6eea29 100644 --- a/FrmAllPipelineStatis.cs +++ b/FrmAllPipelineStatis.cs @@ -84,7 +84,7 @@ chartAllAreaPipeline.Series["管线"].Points.DataBindXY(pipelineLengthAndType.Keys, pipelineLengthAndType.Values); for (int m = 0; m < pipelineLengthAndType.Values.Count; m++) { - if (chartAllAreaPipeline.Series["管线"].Points[m].YValues[0].ToString() != "0") + if (chartAllAreaPipeline.Series["管线"].Points[m]!=null&&chartAllAreaPipeline.Series["管线"].Points[m].YValues[0].ToString() != "0") { chartAllAreaPipeline.Series["管线"].Points[m].Label = chartAllAreaPipeline.Series[0].Points[m].YValues[0].ToString(); } @@ -94,7 +94,7 @@ } catch (Exception ex) { - //LogError.PublishError(ex); + LogHelper.WriteLog(typeof(FrmAllPipelineStatis), ex.Message); } } @@ -147,7 +147,7 @@ } DataTable dt = OledbHelper.QueryTable(sql); - if (dt != null && dt.Rows.Count > 0) + if (dt != null && dt.Rows.Count > 0 && chartAllAreaPipeline.Series["管线"].Points[indexHit]!=null) { dataGridViewX1.DataSource = dt; panel.Visible = true; diff --git a/FrmAllWorkWellStatis.cs b/FrmAllWorkWellStatis.cs index 6fec7af..6af8e4c 100644 --- a/FrmAllWorkWellStatis.cs +++ b/FrmAllWorkWellStatis.cs @@ -52,7 +52,7 @@ chartAllAreaPipeline.Series["井盖"].Points.DataBindXY(workWellLengthAndType.Keys, workWellLengthAndType.Values); for (int m = 0; m < workWellLengthAndType.Values.Count; m++) { - if (chartAllAreaPipeline.Series["井盖"].Points[m].YValues[0].ToString().Trim() != "0") + if (chartAllAreaPipeline.Series["井盖"].Points[m]!=null&&chartAllAreaPipeline.Series["井盖"].Points[m].YValues[0].ToString().Trim() != "0") { chartAllAreaPipeline.Series["井盖"].Points[m].Label = chartAllAreaPipeline.Series[0].Points[m].YValues[0].ToString(); } @@ -60,7 +60,7 @@ } catch (Exception ex) { - //LogError.PublishError(ex); + LogHelper.WriteLog(typeof(FrmAllWorkWellStatis), ex.Message); } } diff --git a/FrmBSQDuoBianXingStatis.cs b/FrmBSQDuoBianXingStatis.cs index e8b7d52..3e889b6 100644 --- a/FrmBSQDuoBianXingStatis.cs +++ b/FrmBSQDuoBianXingStatis.cs @@ -60,7 +60,7 @@ { for (int m = 0; m < bsq1.Values.Count; m++) { - if (chart1.Series["标识器"].Points[m].YValues[0].ToString() != "0") + if (chart1.Series["标识器"].Points[m]!=null&&chart1.Series["标识器"].Points[m].YValues[0].ToString() != "0") { count += Convert.ToInt16(chart1.Series[0].Points[m].YValues[0].ToString()); chart1.Series["标识器"].Points[m].Label = chart1.Series[0].Points[m].YValues[0].ToString(); diff --git a/FrmBSQDuoBianXingStreet.cs b/FrmBSQDuoBianXingStreet.cs index 2005ebb..1db5777 100644 --- a/FrmBSQDuoBianXingStreet.cs +++ b/FrmBSQDuoBianXingStreet.cs @@ -63,7 +63,7 @@ chartStatis.Series[0].Points.DataBindXY(bsq.Keys, bsq.Values); for (int m = 0; m < bsq.Values.Count; m++) { - if (chartStatis.Series[0].Points[m].YValues[0].ToString().Trim() != "0") + if (chartStatis.Series[0].Points[m]!=null&&chartStatis.Series[0].Points[m].YValues[0].ToString().Trim() != "0") { count += Convert.ToInt16(chartStatis.Series[0].Points[m].YValues[0].ToString()); chartStatis.Series[0].Points[m].Label = chartStatis.Series[0].Points[m].YValues[0].ToString(); diff --git a/FrmBSQStatis.cs b/FrmBSQStatis.cs index 390a55c..4aa0ee6 100644 --- a/FrmBSQStatis.cs +++ b/FrmBSQStatis.cs @@ -95,6 +95,8 @@ } } } + + dr.Close(); conn.Close(); for (int i = 0; i < typeLists.Count; i++) { @@ -123,7 +125,7 @@ chartStatis.Series[0].Points.DataBindXY(bsq.Keys, bsq.Values); for (int m = 0; m < bsq.Values.Count; m++) { - if (chartStatis.Series[0].Points[m].YValues[0].ToString().Trim() != "0") + if (chartStatis.Series[0].Points[m]!=null&&chartStatis.Series[0].Points[m].YValues[0].ToString().Trim() != "0") { //count += Convert.ToInt16(chartStatis.Series[0].Points[m].YValues[0].ToString()); chartStatis.Series[0].Points[m].Label = chartStatis.Series[0].Points[m].YValues[0].ToString(); diff --git a/FrmBSQStreet.cs b/FrmBSQStreet.cs index 9d88adb..7fbacad 100644 --- a/FrmBSQStreet.cs +++ b/FrmBSQStreet.cs @@ -44,7 +44,7 @@ chartStatis.Series[0].Points.DataBindXY(bsq.Keys, bsq.Values); for (int m = 0; m < bsq.Values.Count; m++) { - if (chartStatis.Series[0].Points[m].YValues[0].ToString().Trim() != "0") + if (chartStatis.Series[0].Points[m]!=null&&chartStatis.Series[0].Points[m].YValues[0].ToString().Trim() != "0") { count += Convert.ToInt16(chartStatis.Series[0].Points[m].YValues[0].ToString()); chartStatis.Series[0].Points[m].Label = chartStatis.Series[0].Points[m].YValues[0].ToString(); diff --git a/FrmBoosterValvers.cs b/FrmBoosterValvers.cs index 5061efc..df9b62b 100644 --- a/FrmBoosterValvers.cs +++ b/FrmBoosterValvers.cs @@ -236,199 +236,6 @@ count = 0; } } - /// - /// 添加火苗 - /// - /// - /// - /// - /// - private GSOFeature AddFire(double x,double y,double z) - { - // 烟火示例 - - string strResPath = Application.StartupPath + "/Resource"; - - // 烟火粒子示例,由三个发射器构成 - GSOGeoParticle geoParticle = new GSOGeoParticle(); - geoParticle.SetPosition(x, y, z); // 添加到这个经纬度位置 - geoParticle.AltitudeMode = EnumAltitudeMode.RelativeToGround; - - GSORingParticleEmitter emitter = new GSORingParticleEmitter(); - emitter.TexturePath = strResPath + "/ParticleImage/flare.png"; - - emitter.SetSizeFix(1, 1); - emitter.VelFix = 1; - emitter.VelRnd = 5; - - emitter.AngleXYFix = 0; - emitter.AngleXYRnd = 180; - - emitter.AngleXZFix = 90; - emitter.AngleXZRnd = 0; - - emitter.LifeFix = 0.5f; - emitter.LifeRnd = 0.0f; - - emitter.RotFix = 0; - emitter.RotRnd = 0; - - emitter.RotVelFix = 0; - emitter.RotVelRnd = 0; - - emitter.EmitPerSec = 100; - - // 采用线性插值生成粒子的初始颜色 - emitter.ColorRndStart = Color.White; - emitter.ColorRndEnd = Color.Red; - - - GSOColorParticleEffector effector2 = new GSOColorParticleEffector(); - effector2.SetColorChanged(0, -1, -1, 0); - effector2.StartTime = 0.0f; - effector2.EndTime = -1.0f; - emitter.AddEffector(effector2); - - // 将三个发射器添加到粒子对象中 - geoParticle.AddEmitter(emitter); - - geoParticle.Play(); - - GSOFeature feature = new GSOFeature(); - - feature.Geometry = geoParticle; - - globeControl1.Globe.MemoryLayer.AddFeature(feature); - - - return feature; - } - - /// - /// 添加喷泉 - /// - /// - private GSOFeature AddFountain() - { - string strResPath = Application.StartupPath + "/Resource"; - - GSOGeoParticle geoParticle = new GSOGeoParticle(); - geoParticle.SetPosition(116.314, 39.84, 0); // 添加到这个经纬度位置 - - GSOPointParticleEmitter emitter = new GSOPointParticleEmitter(); - emitter.TexturePath = strResPath + "/ParticleImage/test.png"; - - emitter.SetSizeFix(0.5f, 2); - emitter.VelFix = 10; - emitter.VelRnd = 2; - - emitter.GravityAcc = 9.8f; - emitter.AngleXYFix = 0; - emitter.AngleXYRnd = 180; - - emitter.AngleXZFix = 88; - emitter.AngleXZRnd = 2; - - //emitter.InnerRadius = 0; - // emitter.OuterRadius = 0.03f; - - emitter.LifeFix = 5.0f; - emitter.LifeRnd = 1.0f; - - emitter.RotFix = 0; - emitter.RotRnd = 0; - - emitter.RotVelFix = 0; - emitter.RotVelRnd = 0; - - emitter.EmitPerSec = 1000; - emitter.ColorRndStart = Color.FromArgb(33, 255, 255, 255); - emitter.ColorRndEnd = Color.FromArgb(11, 255, 255, 255); - emitter.IsLumAdded = false; - - // 将三个发射器添加到粒子对象中 - geoParticle.AddEmitter(emitter); - - geoParticle.Play(); - GSOFeature feature = new GSOFeature(); - - feature.Geometry = geoParticle; - - //globeControl1.Globe.MemoryLayer.AddFeature(feature); - globeControl1.Globe.FlyToFeature(feature); - - return feature; - } - - /// - /// 添加水柱 - /// - /// - private GSOFeature AddWaterLine() - { - string strResPath = Application.StartupPath + "/Resource"; - - GSOGeoParticle geoParticle = new GSOGeoParticle(); - geoParticle.SetPosition(116.308, 39.84, 0); // 添加到这个经纬度位置 - - GSOPointParticleEmitter emitter = new GSOPointParticleEmitter(); - - emitter.TexturePath = strResPath + "/ParticleImage/drop3.png"; - - geoParticle.TimerInterval = 1; - - emitter.SetSizeFix(2.0f, 2.0f); - - emitter.VelFix = 50; - emitter.VelRnd = 2; - - // emitter.IsLumAdded = false; - - emitter.GravityAcc = 9.8f; - emitter.AngleXYFix = 0; - emitter.AngleXYRnd = 2; - - emitter.AngleXZFix = 60; - emitter.AngleXZRnd = 2; - - //emitter.InnerRadius = 0; - // emitter.OuterRadius = 0.1f; - - emitter.LifeFix = 5.0f; - emitter.LifeRnd = 1.0f; - - emitter.RotFix = 0; - emitter.RotRnd = 0; - - emitter.RotVelFix = 0; - emitter.RotVelRnd = 0; - - emitter.EmitPerSec = 1500; - - emitter.ColorRndStart = Color.FromArgb(100, 222, 222, 222); - emitter.ColorRndEnd = Color.FromArgb(50, 222, 222, 222); - - /* - - GSOScaleParticleEffector effector1 = new GSOScaleParticleEffector(); - effector1.SetScale(0.2f, 0.2f); - effector1.StartTime = 0; - effector1.EndTime = -1; // 负数表示整个粒子生命结束 - emitter.AddEffector(effector1); - */ - - // 将三个发射器添加到粒子对象中 - geoParticle.AddEmitter(emitter); - - geoParticle.Play(); - GSOFeature feature = new GSOFeature(); - - feature.Geometry = geoParticle; - - //globeControl1.Globe.MemoryLayer.AddFeature(feature); - globeControl1.Globe.FlyToFeature(feature); - - return feature; - } + } } diff --git a/FrmBufferAnalysis.cs b/FrmBufferAnalysis.cs index f711133..db8ca59 100644 --- a/FrmBufferAnalysis.cs +++ b/FrmBufferAnalysis.cs @@ -123,39 +123,6 @@ } } /// - /// 半径文本框的键盘按键按下事件处理 - /// - /// - /// - private void txtRadius_KeyPress(object sender, KeyPressEventArgs e) - { - TextBox text = sender as TextBox; - if ((e.KeyChar < 48 || e.KeyChar > 57) && (e.KeyChar != 8) && (int)e.KeyChar != 46) - { - e.Handled = true; - } - if ((int)e.KeyChar == 46) //小数点 - { - if (text.Text.Length <= 0) - e.Handled = true; //小数点不能在第一位 - else //处理不规则的小数点 - { - float f; - float oldf; - bool b1 = false, b2 = false; - b1 = float.TryParse(text.Text, out oldf); - b2 = float.TryParse(text.Text + e.KeyChar.ToString(), out f); - if (b2 == false) - { - if (b1 == true) - e.Handled = true; - else - e.Handled = false; - } - } - } - } - /// /// 窗体关闭事件处理 /// /// diff --git a/FrmBufferAnalysisBSQ.cs b/FrmBufferAnalysisBSQ.cs index 24a96ca..f54208f 100644 --- a/FrmBufferAnalysisBSQ.cs +++ b/FrmBufferAnalysisBSQ.cs @@ -137,35 +137,7 @@ } } - private void txtRadius_KeyPress(object sender, KeyPressEventArgs e) - { - TextBox text = sender as TextBox; - if ((e.KeyChar < 48 || e.KeyChar > 57) && (e.KeyChar != 8) && (int)e.KeyChar != 46) - { - e.Handled = true; - } - if ((int)e.KeyChar == 46) //小数点 - { - if (text.Text.Length <= 0) - e.Handled = true; //小数点不能在第一位 - else //处理不规则的小数点 - { - float f; - float oldf; - bool b1 = false, b2 = false; - b1 = float.TryParse(text.Text, out oldf); - b2 = float.TryParse(text.Text + e.KeyChar.ToString(), out f); - if (b2 == false) - { - if (b1 == true) - e.Handled = true; - else - e.Handled = false; - } - } - } - } - + private void FrmBufferAnalysis_FormClosing(object sender, FormClosingEventArgs e) { //Form1.y = 0; @@ -316,27 +288,6 @@ } } - private void FlyToMenu_Click(object sender, EventArgs e) - { - if (m_feature != null) - { - if (m_feature.Geometry != null && m_feature.Geometry.Type == EnumGeometryType.GeoPolyline3D) - { - GSOGeoPolyline3D line = m_feature.Geometry as GSOGeoPolyline3D; - double length = line.GetSpaceLength(true, 6378137); - GSOGeoPolyline3D lineLine = line.GetSegment(0, length / 2); - GSOPoint3d point3d = lineLine[lineLine.PartCount - 1][lineLine[lineLine.PartCount - 1].Count - 1]; - - globeControl1.Globe.FlyToPosition(point3d, EnumAltitudeMode.Absolute, 0, 45, 5); - } - else - { - globeControl1.Globe.FlyToFeature(m_feature, 0, 45, 3); - } - LightMenu_Click(sender, e); - } - } - private void LightMenu_Click(object sender, EventArgs e) { flashflag = "single"; diff --git a/FrmDataBaseOpt.cs b/FrmDataBaseOpt.cs index b0c4b5d..8d7b69d 100644 --- a/FrmDataBaseOpt.cs +++ b/FrmDataBaseOpt.cs @@ -362,6 +362,7 @@ dbCombor.Items.Add(dblist[i].title); } } + /* /// /// 从配置文件读取数据库参数配置 /// @@ -428,6 +429,8 @@ } } + * */ + /* /// /// 向配置文件写入连接数据库的参数配置 /// @@ -485,6 +488,7 @@ MessageBox.Show(exp.ToString()); } } + * */ /// /// /// diff --git a/FrmDatabaseParaSetting.cs b/FrmDatabaseParaSetting.cs index a6fea46..63b596b 100644 --- a/FrmDatabaseParaSetting.cs +++ b/FrmDatabaseParaSetting.cs @@ -152,6 +152,7 @@ this.DialogResult = DialogResult.OK; this.Close(); } + /* /// /// 从配置文件读取数据库连接参数配置 /// @@ -218,6 +219,8 @@ } } + * */ + /* /// /// 向配置文件写入数据库参数配置 /// @@ -276,7 +279,7 @@ MessageBox.Show(ex.ToString()); } } - + */ /// /// 取消按钮事件处理 /// diff --git a/FrmDatabaseParaSetting2.cs b/FrmDatabaseParaSetting2.cs index 932d05e..96a87d5 100644 --- a/FrmDatabaseParaSetting2.cs +++ b/FrmDatabaseParaSetting2.cs @@ -148,6 +148,7 @@ this.DialogResult = DialogResult.OK; this.Close(); } + /* /// /// 从配置文件读取数据库连接参数配置 /// @@ -214,6 +215,8 @@ } } + * */ + /* /// /// 向配置文件写入数据库参数配置 /// @@ -272,7 +275,7 @@ MessageBox.Show(exp.ToString()); } } - + */ /// /// 取消按钮事件处理 /// diff --git a/FrmDiameterQuery.cs b/FrmDiameterQuery.cs index 68c948b..9a5215b 100644 --- a/FrmDiameterQuery.cs +++ b/FrmDiameterQuery.cs @@ -77,18 +77,7 @@ isBetween = true; } } - /// - /// 键盘按键按下事件处理 - /// - /// - /// - private void textBoxX1_KeyPress(object sender, KeyPressEventArgs e) - { - if ((e.KeyChar < 48 || e.KeyChar > 57) && e.KeyChar != 8) - { - e.Handled = true;//屏蔽 - } - } + bool isBetween = false; /// diff --git a/FrmDocumentEdit.cs b/FrmDocumentEdit.cs index aab2d31..e78a7ff 100644 --- a/FrmDocumentEdit.cs +++ b/FrmDocumentEdit.cs @@ -256,121 +256,6 @@ } - // - /// 将本地文件上传到指定的服务器(HttpWebRequest方法) - /// - /// 文件上传到的服务器 - /// 要上传的本地文件(全路径) - /// 文件上传后的名称 - /// 上传进度条 - /// 成功返回1,失败返回0 - private int Upload_Request(string address, string fileNamePath, string saveName, ProgressBar progressBar) - { - int returnValue = 0; - // 要上传的文件 - FileStream fs = new FileStream(fileNamePath, FileMode.Open, FileAccess.Read); - BinaryReader r = new BinaryReader(fs); - //时间戳 - string strBoundary = "----------" + DateTime.Now.Ticks.ToString("x"); - byte[] boundaryBytes = Encoding.ASCII.GetBytes("/r/n--" + strBoundary + "/r/n"); - //请求头部信息 - StringBuilder sb = new StringBuilder(); - sb.Append("--"); - sb.Append(strBoundary); - sb.Append("\r\n"); - sb.Append("Content-Disposition: form-data; name=\""); - sb.Append("file"); - sb.Append("\"; filename=\""); - sb.Append(saveName); - sb.Append("\""); - sb.Append("\r\n"); - sb.Append("Content-Type: "); - sb.Append("application/octet-stream"); - sb.Append("\r\n"); - sb.Append("\r\n"); - string strPostHeader = sb.ToString(); - byte[] postHeaderBytes = Encoding.UTF8.GetBytes(strPostHeader); - // 根据uri创建HttpWebRequest对象 - HttpWebRequest httpReq = (HttpWebRequest)WebRequest.Create(new Uri(address)); - httpReq.Method = "POST"; - //对发送的数据不使用缓存 - httpReq.AllowWriteStreamBuffering = false; - //设置获得响应的超时时间(300秒) - httpReq.Timeout = 300000; - httpReq.ContentType = "multipart/form-data; boundary=" + strBoundary; - long length = fs.Length + postHeaderBytes.Length + boundaryBytes.Length; - long fileLength = fs.Length; - httpReq.ContentLength = length; - try - { - progressBar.Maximum = int.MaxValue; - progressBar.Minimum = 0; - progressBar.Value = 0; - //每次上传4k - int bufferLength = 4096; - byte[] buffer = new byte[bufferLength]; - //已上传的字节数 - long offset = 0; - //开始上传时间 - DateTime startTime = DateTime.Now; - int size = r.Read(buffer, 0, bufferLength); - Stream postStream = httpReq.GetRequestStream(); - //发送请求头部消息 - postStream.Write(postHeaderBytes, 0, postHeaderBytes.Length); - while (size > 0) - { - postStream.Write(buffer, 0, size); - offset += size; - progressBar.Value = (int)(offset * (int.MaxValue / length)); - TimeSpan span = DateTime.Now - startTime; - double second = span.TotalSeconds; - //lblTime.Text = "已用时:" + second.ToString("F2") + "秒"; - //if (second > 0.001) - //{ - // lblSpeed.Text = " 平均速度:" + (offset / 1024 / second).ToString("0.00") + "KB/秒"; - //} - //else - //{ - // lblSpeed.Text = " 正在连接…"; - //} - //lblState.Text = "已上传:" + (offset * 100.0 / length).ToString("F2") + "%"; - //lblSize.Text = (offset / 1048576.0).ToString("F2") + "M/" + (fileLength / 1048576.0).ToString("F2") + "M"; - Application.DoEvents(); - size = r.Read(buffer, 0, bufferLength); - } - //添加尾部的时间戳 - postStream.Write(boundaryBytes, 0, boundaryBytes.Length); - postStream.Close(); - //获取服务器端的响应 - WebResponse webRespon = httpReq.GetResponse(); - Stream s = webRespon.GetResponseStream(); - StreamReader sr = new StreamReader(s); - //读取服务器端返回的消息 - String sReturnString = sr.ReadLine(); - s.Close(); - sr.Close(); - if (sReturnString == "Success") - { - returnValue = 1; - } - else if (sReturnString == "Error") - { - returnValue = 0; - } - } - catch(Exception ex) - { - returnValue = 0; - string str = ex.ToString(); - } - finally - { - fs.Close(); - r.Close(); - } - return returnValue; - } - private void btn_file_Click(object sender, EventArgs e) { OpenFileDialog dlg = new OpenFileDialog(); diff --git a/FrmExportCADS.cs b/FrmExportCADS.cs index 98772ea..59629dd 100644 --- a/FrmExportCADS.cs +++ b/FrmExportCADS.cs @@ -108,65 +108,6 @@ MessageBox.Show("请选中要导出的图层!", "提示", MessageBoxButtons.OK, MessageBoxIcon.Warning); } } - private Boolean MerageToFile(GSOFeatures features, String strDestFile, String strProj4)//图层追加 - { - if (features == null) - { - return false; - } - Boolean bSuccess = false; - - string strDir = GSOUtility.GetFileDir(strDestFile); - string strLPRJFile = GSOUtility.ChangeExt(strDestFile, ".lprj"); - string strExt = GSOUtility.GetFileExt(strDestFile); - - // 如果投影文件存在,投影以投影文件为准 - if (File.Exists(strLPRJFile)) - { - // 如果是dxf,则这样处理 - if (strExt.ToLower() == ".dxf") - { - string strTempSrcFile = strDir + "srcFeatures_dxftmp" + strExt; - globeControl1.Globe.DataManager.SaveFeatureData(features, strTempSrcFile, strLPRJFile, 4); - bSuccess = GSOUtility.MergeTwoDXFFileFeatures(strDestFile, strTempSrcFile); - File.Delete(strTempSrcFile); - } - else - { - GSOFeatures srcFeatures = globeControl1.Globe.DataManager.ReadFeatureData(strDestFile); - int nCount = features.Length; - int i = 0; - for (i = 0; i < nCount; i++) - { - srcFeatures.Add(features[i]); - } - bSuccess = globeControl1.Globe.DataManager.SaveFeatureData(srcFeatures, strDestFile, strLPRJFile, 4); - } - } - else - { - // 如果是dxf,则这样处理 - if (strExt.ToLower() == ".dxf") - { - string strTempSrcFile = strDir + "srcFeatures_dxftmp" + strExt; - globeControl1.Globe.DataManager.SaveFeatureData(features, strTempSrcFile, strProj4, 0); - bSuccess = GSOUtility.MergeTwoDXFFileFeatures(strDestFile, strTempSrcFile); - File.Delete(strTempSrcFile); - } - else - { - GSOFeatures srcFeatures = globeControl1.Globe.DataManager.ReadFeatureData(strDestFile); - int nCount = features.Length; - int i = 0; - for (i = 0; i < nCount; i++) - { - srcFeatures.Add(features[i]); - } - bSuccess = globeControl1.Globe.DataManager.SaveFeatureData(srcFeatures, strDestFile, strProj4, 0); - } - } - return bSuccess; - } /// /// 关闭按钮事件处理 /// diff --git a/FrmHDMAnalysis3.cs b/FrmHDMAnalysis3.cs index 4f73af6..2ada735 100644 --- a/FrmHDMAnalysis3.cs +++ b/FrmHDMAnalysis3.cs @@ -436,29 +436,6 @@ } layerTemp.RemoveAllFeature(); } - private void Export(GSOPoint3d _pnt, double r) - { - GSOPoint3ds pnts = new GSOPoint3ds(); - GSOPoint3d pnt = new GSOPoint3d(); - pnt.X = _pnt.X; - pnt.Y = _pnt.Y; - pnt.Z = _pnt.Z; - pnts.Add(pnt); - pnt.X = _pnt.X; - pnt.Y = _pnt.Y - 0.0000000005; - pnt.Z = _pnt.Z; - pnts.Add(pnt); - GSOGeoPolyline3D line = new GSOGeoPolyline3D(); - line.AddPart(pnts); - GSOGeoPolygon3D polygon = line.CreateBuffer(r * 2, true, 5, true, false); - GSOPoint3ds points = polygon[0]; - GSOGeoPolyline3D newLine = new GSOGeoPolyline3D(); - newLine.AddPart(points); - newLine.AltitudeMode = EnumAltitudeMode.RelativeToGround; - GSOFeature newFeature = new GSOFeature(); - newFeature.Geometry = newLine; - globeControl1.Globe.MemoryLayer.AddFeature(newFeature); - } private void ExportCAD(double a, double b, double r) { diff --git a/FrmHotFuncStat.cs b/FrmHotFuncStat.cs index c980f34..2eb1476 100644 --- a/FrmHotFuncStat.cs +++ b/FrmHotFuncStat.cs @@ -421,13 +421,6 @@ } } - private void HFS_Pderive_Click(object sender, EventArgs e) - { - if (TV_Files.SelectedNode != null) - { - HFSClass.GuideEdit_form("G", TV_Files, int.Parse(((ToolStripMenuItem)sender).Tag.ToString())); - } - } private void 导入ToolStripMenuItem_Click(object sender, EventArgs e) { @@ -530,22 +523,8 @@ } } - private void 导出ToolStripMenuItem1_Click(object sender, EventArgs e) - { - 导出ToolStripMenuItem2_Click(sender, e); - } + - private void TV_HFSSrchRslt_AfterCollapse(object sender, TreeViewEventArgs e) - { - e.Node.ImageIndex = 0; - } - - private void TV_HFSSrchRslt_AfterExpand(object sender, TreeViewEventArgs e) - { - HFSClass.ADD_TreeNode(TV_Files, e.Node); - e.Node.ImageIndex = 1; - } - private void 导出ToolStripMenuItem1_Click_1(object sender, EventArgs e) { if ((TV_HFSSrchRslt.SelectedNode != null) && (TV_HFSSrchRslt.SelectedNode.Parent != null)) diff --git a/FrmLayerControl.cs b/FrmLayerControl.cs index e7917c3..28fa14d 100644 --- a/FrmLayerControl.cs +++ b/FrmLayerControl.cs @@ -312,26 +312,7 @@ layerManagerNode.Expand(); terrainManagerNode.Expand(); } - /// - /// 刷新节点树 - /// - private void RefreshDataTree() - { - layerTree2.Nodes[0].Nodes.Clear(); - Int32 nCount = globeControl2.Globe.Layers.Count; - Int32 i = 0; - for (i = 0; i < nCount; i++) - { - GSODataset dataSpace = globeControl2.Globe.Layers[i].Dataset; - TreeNode node = new TreeNode(); - node.Text = dataSpace.Name; - node.ImageIndex = 0; - node.SelectedImageIndex = 0; - node.Checked = true; - node.Tag = dataSpace; - layerTree2.Nodes[0].Nodes.Add(node); - } - } + /// /// 目标图层按钮事件处理 /// @@ -494,22 +475,8 @@ } } } - /// - /// 改变指定节点的选中状态 - /// - /// - /// - private void CheckTreeNode(TreeNode node, Boolean bChecked) - { - CheckChildTreeNode(node, bChecked); - // 对于kml图层,如果当前处理的节点是true,那么要把所有的祖宗节点置为true - // 只有所有节点都未false,那么这个节点才为false - // CheckFatherTreeNode(node, bChecked); - globeControl1.Globe.Refresh(); - globeControl2.Globe.Refresh(); - - } + private void CheckChildTreeNode(TreeNode node, Boolean bChecked) { if (node == null) @@ -696,59 +663,7 @@ //} //CheckControl(e); } - /// - /// 树节点选中方法 - /// - /// - private void CheckControl(TreeViewEventArgs e) - { - if (e.Action != TreeViewAction.Unknown) - { - if (e.Node != null && !Convert.IsDBNull(e.Node)) - { - CheckParentNode(e.Node); - if (e.Node.Nodes.Count > 0) - { - CheckAllChildNodes(e.Node, e.Node.Checked); - } - } - } - } - /// - /// 改变所有子节点的状态 - /// - /// - /// - private void CheckAllChildNodes(TreeNode pn, bool IsChecked) - { - foreach (TreeNode tn in pn.Nodes) - { - tn.Checked = IsChecked; - if (tn.Tag.ToString().Contains("|")) - { - string nodeTag = tn.Tag.ToString().Split('|')[1]; - GSOLayer layer = globeControl1.Globe.Layers.GetLayerByCaption(nodeTag); - if (layer != null) - { - layer.Visible = IsChecked; - globeControl1.Globe.Refresh(); - } - } - if (tn.Tag is GSOFeature) - { - if (tn.Nodes.Count == 0) - { - GSOFeature feat = tn.Tag as GSOFeature; - feat.Visible = IsChecked; - globeControl1.Globe.Refresh(); - } - } - if (tn.Nodes.Count > 0) - { - CheckAllChildNodes(tn, IsChecked); - } - } - } + /// /// 改变父节点的选中状态,此处为所有子节点不选中时才取消父节点选中,可以根据需要修改 /// diff --git a/FrmLogin.cs b/FrmLogin.cs index 320fdd5..2afe46e 100644 --- a/FrmLogin.cs +++ b/FrmLogin.cs @@ -59,70 +59,6 @@ textBoxPassWord.Clear(); } } - - /// - /// 验证端口号 - /// - /// - private bool ValiPort() - { - Ping p = new Ping();//创建Ping对象p - PingReply pr = p.Send(Utility.localicenseserverip);//向指定IP或者主机名的计算机发送ICMP协议的ping数据包 - if (pr.Status == IPStatus.Success)//如果ping成功 - { - try - { - TcpClient tcpc = new TcpClient(Utility.localicenseserverip, Utility.localicenseserverport);//对IP地址为"192.168.0.105"的计算机的1500端口提出连接申请 - tcpc.Close(); - return true; - } - catch (Exception ex) - { - MessageBox.Show("端口连接错误!" + ex.Message); - return false; - } - } - else - { - int times = 0;//重新连接次数; - int count = 2;//设置尝试次数 - while (times < count) - { - //Thread.Sleep(1000);//等待时间(方便测试的话,你可以改为1000) - pr = p.Send(Utility.localicenseserverip); - - if (pr.Status == IPStatus.Success) - { - try - { - TcpClient tcpc = new TcpClient(Utility.localicenseserverip, Utility.localicenseserverport);//对IP地址为"192.168.0.105"的计算机的1500端口提出连接申请 - tcpc.Close(); - return true; - } - catch (Exception ex) - { - MessageBox.Show("端口连接错误!" + ex.Message); - return false; - } - } - else - { - times++; - if (times < count) - { - continue; - } - else - { - MessageBox.Show("重新尝试连接失败"); - return false; - } - } - - } - return false; - } - } /// /// 验证用户名、密码 /// diff --git a/FrmMetadata.cs b/FrmMetadata.cs index 886f65a..0365372 100644 --- a/FrmMetadata.cs +++ b/FrmMetadata.cs @@ -27,11 +27,7 @@ InitializeComponent(); loadTreeView(layerTree); } - private void FrmMetadata_Load(object sender, EventArgs e) - { - //this.ntLblC.Text = "nn"; - // loadTreeView(layerTree); - } + private void loadTreeView(TreeView tv)//构建图层树 { try diff --git a/FrmMetadataStat.cs b/FrmMetadataStat.cs index 790658a..e7696c6 100644 --- a/FrmMetadataStat.cs +++ b/FrmMetadataStat.cs @@ -197,9 +197,5 @@ } } - private void buttonX1_Click(object sender, EventArgs e) - { - drawChart(); - } } } diff --git a/FrmPatrolerManager.cs b/FrmPatrolerManager.cs index 37f8ffd..9e66aeb 100644 --- a/FrmPatrolerManager.cs +++ b/FrmPatrolerManager.cs @@ -109,82 +109,8 @@ this.winGridViewPager1.AllToExport = table; } - /// - /// 编辑 - /// - /// - /// - private void winGridViewPager1_OnEditSelected(object sender, EventArgs e) - { - - DataGridView grid = sender as DataGridView; - if (grid != null && grid.SelectedRows.Count>0) - { - DataGridViewRow row = grid.SelectedRows[0]; - try - { - long dbid = long.Parse(row.Cells["编号"].Value.ToString()); - String name = row.Cells["姓名"].Value.ToString(); - String sex = row.Cells["性别"].Value.ToString(); - String age = row.Cells["年龄"].Value.ToString(); - string phone = row.Cells["电话"].Value.ToString(); - age = String.IsNullOrEmpty(age.ToString().Trim()) ? "1" : age.ToString().Trim(); - FrmPatrolerEdit frm = new FrmPatrolerEdit(dbid.ToString(), name, age, sex, phone); - frm.reloadGrid += new ReloadPatrolerGrid(LoadData); - frm.ShowDialog(); - winGridViewPager1.Refresh(); - } - catch (Exception ex) - { - MessageBox.Show("编辑失败:" + ex.ToString(), "错误", MessageBoxButtons.OK, MessageBoxIcon.Error); - } - } - else - { - MessageBox.Show("没有选择记录", "提示"); - } - - } - - /// - /// 删除 - /// - /// - /// - private void winGridViewPager1_OnDeleteSelected(object sender, EventArgs e) - { - DataGridView grid = sender as DataGridView; - if (grid != null && grid.SelectedRows.Count > 0) - { - DataGridViewRow row = grid.SelectedRows[0]; - long dbid = long.Parse(row.Cells["编号"].Value.ToString()); - try - { - string state = row.Cells["状态"].Value.ToString(); - if ("在线".Equals(state)) - { - if (MessageBox.Show("确定注销?", "确认", MessageBoxButtons.YesNo, MessageBoxIcon.Question) == DialogResult.Yes) - { - String sql = "update patroler t set t.accountstate='LEAVER' where t.dbid=" + dbid; - OracleUtils.ExecuteNonQuery(OracleUtils.ConnectionString, CommandType.Text, sql); - } - } - else { - MessageBox.Show("人员不在线,无法注销", "信息"); - } - } - catch (Exception ex) - { - MessageBox.Show("人员注销失败:" + ex.ToString(), "错误", MessageBoxButtons.OK, MessageBoxIcon.Error); - } - } - else - { - MessageBox.Show("没有选择记录", "提示"); - } - } - - + + private void LoadData() { int pageIndex = winGridViewPager1.PagerInfo.CurrenetPageIndex; diff --git a/FrmRoadHDM.cs b/FrmRoadHDM.cs index e765313..e871dd5 100644 --- a/FrmRoadHDM.cs +++ b/FrmRoadHDM.cs @@ -333,31 +333,6 @@ this.Cursor = Cursors.Default; } } - - private void Export(GSOPoint3d _pnt, double r) - { - GSOPoint3ds pnts = new GSOPoint3ds(); - GSOPoint3d pnt = new GSOPoint3d(); - pnt.X = _pnt.X; - pnt.Y = _pnt.Y; - pnt.Z = _pnt.Z; - pnts.Add(pnt); - pnt.X = _pnt.X; - pnt.Y = _pnt.Y - 0.0000000005; - pnt.Z = _pnt.Z; - pnts.Add(pnt); - GSOGeoPolyline3D line = new GSOGeoPolyline3D(); - line.AddPart(pnts); - GSOGeoPolygon3D polygon = line.CreateBuffer(r * 2, true, 5, true, false); - GSOPoint3ds points = polygon[0]; - GSOGeoPolyline3D newLine = new GSOGeoPolyline3D(); - newLine.AddPart(points); - newLine.AltitudeMode = EnumAltitudeMode.RelativeToGround; - GSOFeature newFeature = new GSOFeature(); - newFeature.Geometry = newLine; - globeControl1.Globe.MemoryLayer.AddFeature(newFeature); - } - private void ExportCAD(double a, double b, double r) { GSOPoint3ds pnts = new GSOPoint3ds(); diff --git a/FrmUserAdd.cs b/FrmUserAdd.cs index c612ab4..f826427 100644 --- a/FrmUserAdd.cs +++ b/FrmUserAdd.cs @@ -231,24 +231,6 @@ //cbxRegion.SelectedIndexChanged += new EventHandler(cbxRegion_SelectedIndexChanged); } } - /// - /// 下拉框选中项改变事件处理 - /// - /// - /// - private void cbxRegion_SelectedIndexChanged(object sender, EventArgs e) - { - string sql = ""; - //string sql = "select casic_role.\"name\" from casic_role join casic_regionrole on casic_role.\"id\"=casic_regionrole.\"rid\" where casic_regionrole.\"reid\"=" + region[cbxRegion.SelectedItem.ToString().Trim()]; - DataTable dt = OledbHelper.QueryTable(sql); - if (dt != null && dt.Rows.Count > 0) - { - comboBoxExRegionRole.Items.Clear(); - for (int i = 0; i < dt.Rows.Count; i++) - { - comboBoxExRegionRole.Items.Add(dt.Rows[i][0].ToString().Trim());//部门角色 - } - } - } + } } diff --git a/FrmUserManager.cs b/FrmUserManager.cs index 571f0f0..ae254bc 100644 --- a/FrmUserManager.cs +++ b/FrmUserManager.cs @@ -81,11 +81,6 @@ } } } - //创建新用户 - private void buttonX2_Click(object sender, EventArgs e) - { - FrmUserAdd frm = new FrmUserAdd(-1); - frm.ShowDialog(); - } + } } diff --git a/FrmValveStatistics.cs b/FrmValveStatistics.cs index 545d56c..dd76777 100644 --- a/FrmValveStatistics.cs +++ b/FrmValveStatistics.cs @@ -54,7 +54,7 @@ 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") + if (chaFamenStatis.Series["阀门"].Points[m]!=null&&chaFamenStatis.Series["阀门"].Points[m].YValues[0].ToString() != "0") { chaFamenStatis.Series["阀门"].Points[m].Label = chaFamenStatis.Series[0].Points[m].YValues[0].ToString(); } diff --git a/Frm_password_reset.cs b/Frm_password_reset.cs index 7b51039..b9e5dc3 100644 --- a/Frm_password_reset.cs +++ b/Frm_password_reset.cs @@ -41,6 +41,7 @@ } catch (Exception ex) { + LogHelper.WriteLog(typeof(Frm_password_reset), ex.Message); } } private void initCombox() diff --git a/FrmpipeDeepstatis.cs b/FrmpipeDeepstatis.cs index e156db4..1a84d6c 100644 --- a/FrmpipeDeepstatis.cs +++ b/FrmpipeDeepstatis.cs @@ -307,7 +307,7 @@ chart1.Series[j].Points.DataBindXY(dic1.Keys, dic1.Values); for (int m = 0; m < dic1.Values.Count; m++) { - if (chart1.Series[j].Points[m].YValues[0].ToString() != "0") + if (chart1.Series[j].Points[m]!=null&&chart1.Series[j].Points[m].YValues[0].ToString() != "0") { chart1.Series[j].Points[m].Label = chart1.Series[j].Points[m].YValues[0].ToString(); diff --git a/FrmpipeDiametergather.cs b/FrmpipeDiametergather.cs index 30674de..057b09d 100644 --- a/FrmpipeDiametergather.cs +++ b/FrmpipeDiametergather.cs @@ -263,6 +263,7 @@ if (layer != null && layer is GSOFeatureLayer) { GSOFeatureLayer flayer = layer as GSOFeatureLayer; + if (layer == null) return; GSOFeatures features = flayer.GetAllFeatures(); if (features.Length > 0) { diff --git a/Cyberpipe.csproj b/Cyberpipe.csproj index 07a8c1a..e3cd12c 100644 --- a/Cyberpipe.csproj +++ b/Cyberpipe.csproj @@ -204,25 +204,6 @@ - - Form - - - F_GKT1数据输入输出.cs - - - Form - - - F_GKT1添加文件.cs - - - Form - - - F_GKT1添加项目.cs - - Form @@ -1068,18 +1049,6 @@ Frm_password_reset.cs - - Form - - - GKT.cs - - - Form - - - GKT1.cs - Form @@ -1258,12 +1227,6 @@ F_Projedit.cs - - Form - - - PED.cs - Form @@ -1331,16 +1294,6 @@ True Reference.map - - F_GKT1数据输入输出.cs - Designer - - - F_GKT1添加文件.cs - - - F_GKT1添加项目.cs - Form_EditTask.cs @@ -1836,12 +1789,6 @@ Frm_password_reset.cs - - GKT.cs - - - GKT1.cs - F_GKT数据输入输出.cs @@ -1934,9 +1881,6 @@ F_Projedit.cs - - PED.cs - F_数据输入输出.cs diff --git a/Cyberpipe.suo b/Cyberpipe.suo index 68ced4f..a1aecf8 100644 --- a/Cyberpipe.suo +++ b/Cyberpipe.suo Binary files differ diff --git a/EMS_Forms/Form_EditTask.cs b/EMS_Forms/Form_EditTask.cs index 718992f..f1d791f 100644 --- a/EMS_Forms/Form_EditTask.cs +++ b/EMS_Forms/Form_EditTask.cs @@ -119,7 +119,8 @@ String name = Convert.ToString(dr["USERNAME"]); comboBox_userName.Items.Add(name); - } + } + dr.Close(); comboBox_road.Items.Clear(); roadList = new List(); @@ -135,7 +136,7 @@ comboBox_road.Items.Add(name); } } - + dr1.Close(); conn.Close(); bool flag2 = false; @@ -185,7 +186,7 @@ catch (Exception ex) { - MessageBox.Show(ex.ToString()); + LogHelper.WriteLog(typeof(Form_EditTask), ex.Message); } } @@ -288,7 +289,7 @@ } catch (Exception ex) { - MessageBox.Show(ex.ToString()); + LogHelper.WriteLog(typeof(Form_EditTask), ex.Message); } } @@ -474,7 +475,7 @@ } catch (Exception ex) { - MessageBox.Show(ex.ToString()); + LogHelper.WriteLog(typeof(Form_EditTask), ex.Message); } this.Close(); @@ -495,6 +496,7 @@ { numList.Add(Convert.ToInt32(dr["DBID"])); } + dr.Close(); if (numList.Count == 0) { taskNumber = Convert.ToInt32(number) * 100; @@ -674,6 +676,7 @@ } } } + dr.Close(); conn.Close(); } diff --git a/EMS_Forms/Form_EventManager.cs b/EMS_Forms/Form_EventManager.cs index b18c45b..84807b2 100644 --- a/EMS_Forms/Form_EventManager.cs +++ b/EMS_Forms/Form_EventManager.cs @@ -64,6 +64,7 @@ comboBox_name.Items.Add(name); } + dr.Close(); conn.Close(); diff --git a/Forms/FrmMnModify.cs b/Forms/FrmMnModify.cs index 31cfc5f..d036360 100644 --- a/Forms/FrmMnModify.cs +++ b/Forms/FrmMnModify.cs @@ -68,15 +68,7 @@ questionGrid.Rows[idx].Cells[1].Value = sr.question; } } - /// 选中对象 - /// - /// - /// - /// - private void buttonX1_Click(object sender, EventArgs e) - { - globecontrol.Globe.Action = EnumAction3D.SelectObject; - } + /// /// 选中某一行 /// diff --git a/Forms/FrmPipelineModelDataBase.cs b/Forms/FrmPipelineModelDataBase.cs index 2acf0ca..7ce573f 100644 --- a/Forms/FrmPipelineModelDataBase.cs +++ b/Forms/FrmPipelineModelDataBase.cs @@ -35,19 +35,7 @@ ds = _ds; InitializeComponent(); } - /// - /// 单击选择shp格式文件 - /// - /// - /// - private void btnBrowseModel_Click(object sender, EventArgs e) - { - saveFileDialog1.Filter = "*.lgd|*.lgd"; - if (saveFileDialog1.ShowDialog() == DialogResult.OK) - { - txtModelLayer.Text = saveFileDialog1.FileName; - } - } + /// /// 窗体初始化事件处理 /// @@ -100,49 +88,6 @@ } } } - - private object convertFieldValue(string fieldname, object obj) - { - if (obj == null) - return null; - - try - { - string type = fields_types[fieldname].ToString(); - switch (type) - { - case "string": - return obj.ToString(); - case "int": - //return 101; - int intResult; - if (int.TryParse(obj.ToString(), out intResult)) - return intResult; - else - return null; - case "double": - //return 202.5; - double doubleResult; - if (double.TryParse(obj.ToString(), out doubleResult)) - return doubleResult; - else - return null; - case "date": - DateTime dtResult; - if (DateTime.TryParse(obj.ToString(), out dtResult)) - return dtResult; - else - return null; - } - return null; - } - catch (Exception ex) - { - MessageBox.Show(ex.ToString()); - return null; - } - } - public string lgdFilePath = ""; /// /// 选择管线颜色 @@ -610,33 +555,6 @@ { this.Close(); } - - private void cmbLayer_SelectedIndexChanged(object sender, EventArgs e) //选择图层 - { - GSOLayer layer = ctl.Globe.Layers.GetLayerByCaption(selectLayerName); - GSOFeatures features = layer.GetAllFeatures(); - if (features.Length == 0) - return; - - cmbFrom.Items.Clear(); - cmbTo.Items.Clear(); - cmbRadius.Items.Clear(); - cmbID.Items.Clear(); - for (int i = 0; i < features[0].GetFieldCount(); i++) - { - GeoScene.Data.GSOFieldDefn fielddef = (GeoScene.Data.GSOFieldDefn)(features[0].GetFieldDefn(i)); - - cmbFrom.Items.Add(fielddef.Name); - cmbTo.Items.Add(fielddef.Name); - cmbRadius.Items.Add(fielddef.Name); - cmbID.Items.Add(fielddef.Name); - } - cmbFrom.SelectedItem = "Deep1"; - cmbTo.SelectedItem = "Deep2"; - cmbRadius.SelectedItem = "Diameter"; - cmbID.SelectedItem = "Handle"; - } - private void buttonXLayerPath_Click(object sender, EventArgs e)//单击 选择shp格式的文件 { OpenFileDialog dlg = new OpenFileDialog(); diff --git a/Forms/FrmPipelineModelDataOneStep.cs b/Forms/FrmPipelineModelDataOneStep.cs index 18afda7..ec93b8a 100644 --- a/Forms/FrmPipelineModelDataOneStep.cs +++ b/Forms/FrmPipelineModelDataOneStep.cs @@ -38,19 +38,7 @@ layerTree = _layerTree; InitializeComponent(); } - /// - /// 单击选择shp格式文件 - /// - /// - /// - private void btnBrowseModel_Click(object sender, EventArgs e) - { - saveFileDialog1.Filter = "*.lgd|*.lgd"; - if (saveFileDialog1.ShowDialog() == DialogResult.OK) - { - txtModelLayer.Text = saveFileDialog1.FileName; - } - } + /// /// 窗体初始化事件处理 /// @@ -107,48 +95,7 @@ } } - private object convertFieldValue(string fieldname, object obj) - { - if (obj == null) - return null; - - try - { - string type = fields_types[fieldname].ToString(); - switch (type) - { - case "string": - return obj.ToString(); - case "int": - //return 101; - int intResult; - if (int.TryParse(obj.ToString(), out intResult)) - return intResult; - else - return null; - case "double": - //return 202.5; - double doubleResult; - if (double.TryParse(obj.ToString(), out doubleResult)) - return doubleResult; - else - return null; - case "date": - DateTime dtResult; - if (DateTime.TryParse(obj.ToString(), out dtResult)) - return dtResult; - else - return null; - } - return null; - } - catch (Exception ex) - { - MessageBox.Show(ex.ToString()); - return null; - } - } - + public string lgdFilePath = ""; /// /// 选择管线颜色 @@ -673,32 +620,6 @@ return featDs; } - private void cmbLayer_SelectedIndexChanged(object sender, EventArgs e) //选择图层 - { - GSOLayer layer = ctl.Globe.Layers.GetLayerByCaption(selectLayerName); - GSOFeatures features = layer.GetAllFeatures(); - if (features.Length == 0) - return; - - cmbFrom.Items.Clear(); - cmbTo.Items.Clear(); - cmbRadius.Items.Clear(); - cmbID.Items.Clear(); - for (int i = 0; i < features[0].GetFieldCount(); i++) - { - GeoScene.Data.GSOFieldDefn fielddef = (GeoScene.Data.GSOFieldDefn)(features[0].GetFieldDefn(i)); - - cmbFrom.Items.Add(fielddef.Name); - cmbTo.Items.Add(fielddef.Name); - cmbRadius.Items.Add(fielddef.Name); - cmbID.Items.Add(fielddef.Name); - } - cmbFrom.SelectedItem = "Deep1"; - cmbTo.SelectedItem = "Deep2"; - cmbRadius.SelectedItem = "Diameter"; - cmbID.SelectedItem = "Handle"; - } - private void buttonXLayerPath_Click(object sender, EventArgs e)//单击 选择shp格式的文件 { OpenFileDialog dlg = new OpenFileDialog(); @@ -949,38 +870,6 @@ } //txtLayername.Text = type + layername; } - /// - /// 连接数据库 - /// - /// - /// - private void buttonX1_Click(object sender, EventArgs e) - { - if (ds == null) - { - //没连的话,直接连接审核库; //审核库配置读配置文件 - string dbIp = Utility.sgdbip; - string database = Utility.sgdbname; - string user = Utility.sgdbuser; - string pass = Utility.sgdbpwd; - - if (!Utility.isNetworkConnectionSuccess(dbIp.Trim())) - { - MessageBox.Show("网络连接失败!", "提示"); - return; - } - - ds = ctl.Globe.DataManager.OpenOracleDataSource(dbIp + "/" + database, "", "", user, pass); - if (ds == null) - { - MessageBox.Show("数据库连接失败!", "提示", MessageBoxButtons.OK, MessageBoxIcon.Warning); - } - else - { - btnCreateModel.Enabled = true; - } - } - } private void btnClose_Click(object sender, EventArgs e) { diff --git a/Forms/FrmShRK.cs b/Forms/FrmShRK.cs index 0e2e722..f1d83cb 100644 --- a/Forms/FrmShRK.cs +++ b/Forms/FrmShRK.cs @@ -215,6 +215,7 @@ { sourcefeatds = sourcefeat as GSOFeatureDataset; } + if (sourcefeatds == null) return; sourcefeatds.Open(); GSOFeatures sourcefeatures = sourcefeatds.GetAllFeatures(); @@ -251,6 +252,7 @@ { desfeatds = desfeat as GSOFeatureDataset; } + if (desfeatds == null) return; desfeatds.Open(); //向新数据集写入字段 diff --git a/FrmAccessoriesSensor.cs b/FrmAccessoriesSensor.cs index 09fcdf1..2a7a80e 100644 --- a/FrmAccessoriesSensor.cs +++ b/FrmAccessoriesSensor.cs @@ -209,7 +209,7 @@ chart1.Series[0].Points.DataBindXY(dic.Keys, dic.Values); for (int m = 0; m < dic.Values.Count; m++) { - if (chart1.Series[0].Points[m].YValues[0].ToString() != "0") + if (chart1.Series[0].Points[m]!=null&&chart1.Series[0].Points[m].YValues[0].ToString() != "0") { chart1.Series[0].Points[m].Label = chart1.Series[0].Points[m].YValues[0].ToString(); } diff --git a/FrmAccessoriesgather.cs b/FrmAccessoriesgather.cs index 9e331e1..a475d9e 100644 --- a/FrmAccessoriesgather.cs +++ b/FrmAccessoriesgather.cs @@ -338,7 +338,7 @@ chart1.Series[0].Points.DataBindXY(dic.Keys, dic.Values); for (int m = 0; m < dic.Values.Count; m++) { - if (chart1.Series[0].Points[m].YValues[0].ToString() != "0") + if (chart1.Series[0].Points[m]!=null&&chart1.Series[0].Points[m].YValues[0].ToString() != "0") { chart1.Series[0].Points[m].Label = chart1.Series[0].Points[m].YValues[0].ToString(); } diff --git a/FrmAccessoryAnalysis.cs b/FrmAccessoryAnalysis.cs index 71d4579..44d4065 100644 --- a/FrmAccessoryAnalysis.cs +++ b/FrmAccessoryAnalysis.cs @@ -66,39 +66,6 @@ globeControl1.Refresh(); } /// - /// 键盘按键按下事件处理 - /// - /// - /// - private void txtRadius_KeyPress(object sender, KeyPressEventArgs e) - { - TextBox text = sender as TextBox; - if ((e.KeyChar < 48 || e.KeyChar > 57) && (e.KeyChar != 8) && (int)e.KeyChar != 46) - { - e.Handled = true; - } - if ((int)e.KeyChar == 46) //小数点 - { - if (text.Text.Length <= 0) - e.Handled = true; //小数点不能在第一位 - else //处理不规则的小数点 - { - float f; - float oldf; - bool b1 = false, b2 = false; - b1 = float.TryParse(text.Text, out oldf); - b2 = float.TryParse(text.Text + e.KeyChar.ToString(), out f); - if (b2 == false) - { - if (b1 == true) - e.Handled = true; - else - e.Handled = false; - } - } - } - } - /// /// 确定按钮事件处理 /// /// diff --git a/FrmAddValve.cs b/FrmAddValve.cs index 34d2fec..5f405b9 100644 --- a/FrmAddValve.cs +++ b/FrmAddValve.cs @@ -486,56 +486,6 @@ } } - - - - - - - - private void cmbLayer_SelectedIndexChanged(object sender, EventArgs e) - { - GSOLayer layer = globeControl1.Globe.Layers.GetLayerByCaption(selectLayerName); - GSOFeatures features = layer.GetAllFeatures(); - if (features.Length == 0) - return; - - combPath.Items.Clear(); - combZ.Items.Clear(); - combModelName.Items.Clear(); - - for (int i = 0; i < features[0].GetFieldCount(); i++) - { - GeoScene.Data.GSOFieldDefn fielddef = (GeoScene.Data.GSOFieldDefn)(features[0].GetFieldDefn(i)); - combPath.Items.Add(fielddef.Name); - combZ.Items.Add(fielddef.Name); - combModelName.Items.Add(fielddef.Name); - } - combModelName.SelectedItem = "编号"; - combPath.SelectedItem = "模型路径"; - if (combfile.SelectedIndex != -1) - { - - string layerCaption = combfile.SelectedItem.ToString().Trim(); - rukuLayer = globeControl1.Globe.Layers.GetLayerByCaption(layerCaption); - if (rukuLayer != null) - { - combPath.Items.Clear(); - combZ.Items.Clear(); - combModelName.Items.Clear(); - - } - for (int i = 0; i < features[0].GetFieldCount(); i++) - { - GeoScene.Data.GSOFieldDefn fielddef = (GeoScene.Data.GSOFieldDefn)(features[0].GetFieldDefn(i)); - combPath.Items.Add(fielddef.Name); - combZ.Items.Add(fielddef.Name); - combModelName.Items.Add(fielddef.Name); - } - combModelName.SelectedItem = "编号"; - combPath.SelectedItem = "模型路径"; - } - } /// /// 单击选择shp格式文件 /// diff --git a/FrmAddWellShp.cs b/FrmAddWellShp.cs index bb79ec0..a249725 100644 --- a/FrmAddWellShp.cs +++ b/FrmAddWellShp.cs @@ -478,32 +478,6 @@ } } } - - private void cmbLayer_SelectedIndexChanged(object sender, EventArgs e) - { - GSOLayer layer = globeControl1.Globe.Layers.GetLayerByCaption(selectLayerName); - GSOFeatures features = layer.GetAllFeatures(); - if (features.Length == 0) - return; - - combCode.Items.Clear(); - combDeep.Items.Clear(); - combModelName.Items.Clear(); - combAngle.Items.Clear(); - - for (int i = 0; i < features[0].GetFieldCount(); i++) - { - GeoScene.Data.GSOFieldDefn fielddef = (GeoScene.Data.GSOFieldDefn)(features[0].GetFieldDefn(i)); - combCode.Items.Add(fielddef.Name); - combDeep.Items.Add(fielddef.Name); - combModelName.Items.Add(fielddef.Name); - combAngle.Items.Add(fielddef.Name); - } - combCode.SelectedItem = "附属物编码"; - combDeep.SelectedItem = "井深"; - combModelName.SelectedItem = "编号"; - combAngle.SelectedItem = "符号角度"; - } /// /// 单击选择shp格式文件 /// diff --git a/FrmAddYuBiZiShp.cs b/FrmAddYuBiZiShp.cs index b312d51..332f037 100644 --- a/FrmAddYuBiZiShp.cs +++ b/FrmAddYuBiZiShp.cs @@ -383,80 +383,7 @@ } } - private void cmbLayer_SelectedIndexChanged(object sender, EventArgs e) - { - GSOLayer layer = globeControl1.Globe.Layers.GetLayerByCaption(selectLayerName); - GSOFeatures features = layer.GetAllFeatures(); - if (features.Length == 0) - return; - - combCode.Items.Clear(); - combDeep.Items.Clear(); - combModelName.Items.Clear(); - //comboLoad.Items.Clear(); - for (int i = 0; i < features[0].GetFieldCount(); i++) - { - GeoScene.Data.GSOFieldDefn fielddef = (GeoScene.Data.GSOFieldDefn)(features[0].GetFieldDefn(i)); - combCode.Items.Add(fielddef.Name); - combDeep.Items.Add(fielddef.Name); - combModelName.Items.Add(fielddef.Name); - //comboLoad.Items.Add(fielddef.Name); - } - combCode.SelectedItem = "附属物编码"; - combDeep.SelectedItem = "Z坐标"; - combModelName.SelectedItem = "编号"; - //comboLoad.SelectedItem = "模型路径"; - } - - private void buttonXLayerPath_Click(object sender, EventArgs e) - { - OpenFileDialog dlg = new OpenFileDialog(); - dlg.Filter = "*.shp|*.shp"; - dlg.Multiselect = false; - if (dlg.ShowDialog() == DialogResult.OK) - { - GSOLayer layer = globeControl1.Globe.Layers.Add(dlg.FileName); - string txtMessage = valiYBdata(layer); - if (txtMessage != "") - { - button3.Enabled = false; - //textBoxLayer.Text = ""; - combCode.Items.Clear(); - combDeep.Items.Clear(); - combModelName.Items.Clear(); - globeControl1.Globe.Layers.Remove(layer); - FrmValiDataShowErrorMessage showErrorMessage = new FrmValiDataShowErrorMessage(dlg.FileName, txtMessage); - showErrorMessage.ShowDialog(); - return; - } - else - { - button3.Enabled = true; - //textBoxLayer.Text = dlg.FileName; - selectLayerName = layer.Caption; - txtLayerName.Text = layer.Caption; - GSOFeatures features = layer.GetAllFeatures(); - if (features.Length == 0) - return; - - combCode.Items.Clear(); - combDeep.Items.Clear(); - combModelName.Items.Clear(); - for (int i = 0; i < features[0].GetFieldCount(); i++) - { - GeoScene.Data.GSOFieldDefn fielddef = (GeoScene.Data.GSOFieldDefn)(features[0].GetFieldDefn(i)); - combCode.Items.Add(fielddef.Name); - combDeep.Items.Add(fielddef.Name); - combModelName.Items.Add(fielddef.Name); - //comboLoad.Items.Add(fielddef.Name); - } - combCode.SelectedItem = "管点编码"; - combDeep.SelectedItem = "Z坐标"; - combModelName.SelectedItem = "编号"; - } - } - } - + private void FrmAddYuBiZiShp_FormClosing(object sender, FormClosingEventArgs e) { globeControl1.Globe.Refresh(); diff --git a/FrmAllPipelineStatis.cs b/FrmAllPipelineStatis.cs index 6421a26..a6eea29 100644 --- a/FrmAllPipelineStatis.cs +++ b/FrmAllPipelineStatis.cs @@ -84,7 +84,7 @@ chartAllAreaPipeline.Series["管线"].Points.DataBindXY(pipelineLengthAndType.Keys, pipelineLengthAndType.Values); for (int m = 0; m < pipelineLengthAndType.Values.Count; m++) { - if (chartAllAreaPipeline.Series["管线"].Points[m].YValues[0].ToString() != "0") + if (chartAllAreaPipeline.Series["管线"].Points[m]!=null&&chartAllAreaPipeline.Series["管线"].Points[m].YValues[0].ToString() != "0") { chartAllAreaPipeline.Series["管线"].Points[m].Label = chartAllAreaPipeline.Series[0].Points[m].YValues[0].ToString(); } @@ -94,7 +94,7 @@ } catch (Exception ex) { - //LogError.PublishError(ex); + LogHelper.WriteLog(typeof(FrmAllPipelineStatis), ex.Message); } } @@ -147,7 +147,7 @@ } DataTable dt = OledbHelper.QueryTable(sql); - if (dt != null && dt.Rows.Count > 0) + if (dt != null && dt.Rows.Count > 0 && chartAllAreaPipeline.Series["管线"].Points[indexHit]!=null) { dataGridViewX1.DataSource = dt; panel.Visible = true; diff --git a/FrmAllWorkWellStatis.cs b/FrmAllWorkWellStatis.cs index 6fec7af..6af8e4c 100644 --- a/FrmAllWorkWellStatis.cs +++ b/FrmAllWorkWellStatis.cs @@ -52,7 +52,7 @@ chartAllAreaPipeline.Series["井盖"].Points.DataBindXY(workWellLengthAndType.Keys, workWellLengthAndType.Values); for (int m = 0; m < workWellLengthAndType.Values.Count; m++) { - if (chartAllAreaPipeline.Series["井盖"].Points[m].YValues[0].ToString().Trim() != "0") + if (chartAllAreaPipeline.Series["井盖"].Points[m]!=null&&chartAllAreaPipeline.Series["井盖"].Points[m].YValues[0].ToString().Trim() != "0") { chartAllAreaPipeline.Series["井盖"].Points[m].Label = chartAllAreaPipeline.Series[0].Points[m].YValues[0].ToString(); } @@ -60,7 +60,7 @@ } catch (Exception ex) { - //LogError.PublishError(ex); + LogHelper.WriteLog(typeof(FrmAllWorkWellStatis), ex.Message); } } diff --git a/FrmBSQDuoBianXingStatis.cs b/FrmBSQDuoBianXingStatis.cs index e8b7d52..3e889b6 100644 --- a/FrmBSQDuoBianXingStatis.cs +++ b/FrmBSQDuoBianXingStatis.cs @@ -60,7 +60,7 @@ { for (int m = 0; m < bsq1.Values.Count; m++) { - if (chart1.Series["标识器"].Points[m].YValues[0].ToString() != "0") + if (chart1.Series["标识器"].Points[m]!=null&&chart1.Series["标识器"].Points[m].YValues[0].ToString() != "0") { count += Convert.ToInt16(chart1.Series[0].Points[m].YValues[0].ToString()); chart1.Series["标识器"].Points[m].Label = chart1.Series[0].Points[m].YValues[0].ToString(); diff --git a/FrmBSQDuoBianXingStreet.cs b/FrmBSQDuoBianXingStreet.cs index 2005ebb..1db5777 100644 --- a/FrmBSQDuoBianXingStreet.cs +++ b/FrmBSQDuoBianXingStreet.cs @@ -63,7 +63,7 @@ chartStatis.Series[0].Points.DataBindXY(bsq.Keys, bsq.Values); for (int m = 0; m < bsq.Values.Count; m++) { - if (chartStatis.Series[0].Points[m].YValues[0].ToString().Trim() != "0") + if (chartStatis.Series[0].Points[m]!=null&&chartStatis.Series[0].Points[m].YValues[0].ToString().Trim() != "0") { count += Convert.ToInt16(chartStatis.Series[0].Points[m].YValues[0].ToString()); chartStatis.Series[0].Points[m].Label = chartStatis.Series[0].Points[m].YValues[0].ToString(); diff --git a/FrmBSQStatis.cs b/FrmBSQStatis.cs index 390a55c..4aa0ee6 100644 --- a/FrmBSQStatis.cs +++ b/FrmBSQStatis.cs @@ -95,6 +95,8 @@ } } } + + dr.Close(); conn.Close(); for (int i = 0; i < typeLists.Count; i++) { @@ -123,7 +125,7 @@ chartStatis.Series[0].Points.DataBindXY(bsq.Keys, bsq.Values); for (int m = 0; m < bsq.Values.Count; m++) { - if (chartStatis.Series[0].Points[m].YValues[0].ToString().Trim() != "0") + if (chartStatis.Series[0].Points[m]!=null&&chartStatis.Series[0].Points[m].YValues[0].ToString().Trim() != "0") { //count += Convert.ToInt16(chartStatis.Series[0].Points[m].YValues[0].ToString()); chartStatis.Series[0].Points[m].Label = chartStatis.Series[0].Points[m].YValues[0].ToString(); diff --git a/FrmBSQStreet.cs b/FrmBSQStreet.cs index 9d88adb..7fbacad 100644 --- a/FrmBSQStreet.cs +++ b/FrmBSQStreet.cs @@ -44,7 +44,7 @@ chartStatis.Series[0].Points.DataBindXY(bsq.Keys, bsq.Values); for (int m = 0; m < bsq.Values.Count; m++) { - if (chartStatis.Series[0].Points[m].YValues[0].ToString().Trim() != "0") + if (chartStatis.Series[0].Points[m]!=null&&chartStatis.Series[0].Points[m].YValues[0].ToString().Trim() != "0") { count += Convert.ToInt16(chartStatis.Series[0].Points[m].YValues[0].ToString()); chartStatis.Series[0].Points[m].Label = chartStatis.Series[0].Points[m].YValues[0].ToString(); diff --git a/FrmBoosterValvers.cs b/FrmBoosterValvers.cs index 5061efc..df9b62b 100644 --- a/FrmBoosterValvers.cs +++ b/FrmBoosterValvers.cs @@ -236,199 +236,6 @@ count = 0; } } - /// - /// 添加火苗 - /// - /// - /// - /// - /// - private GSOFeature AddFire(double x,double y,double z) - { - // 烟火示例 - - string strResPath = Application.StartupPath + "/Resource"; - - // 烟火粒子示例,由三个发射器构成 - GSOGeoParticle geoParticle = new GSOGeoParticle(); - geoParticle.SetPosition(x, y, z); // 添加到这个经纬度位置 - geoParticle.AltitudeMode = EnumAltitudeMode.RelativeToGround; - - GSORingParticleEmitter emitter = new GSORingParticleEmitter(); - emitter.TexturePath = strResPath + "/ParticleImage/flare.png"; - - emitter.SetSizeFix(1, 1); - emitter.VelFix = 1; - emitter.VelRnd = 5; - - emitter.AngleXYFix = 0; - emitter.AngleXYRnd = 180; - - emitter.AngleXZFix = 90; - emitter.AngleXZRnd = 0; - - emitter.LifeFix = 0.5f; - emitter.LifeRnd = 0.0f; - - emitter.RotFix = 0; - emitter.RotRnd = 0; - - emitter.RotVelFix = 0; - emitter.RotVelRnd = 0; - - emitter.EmitPerSec = 100; - - // 采用线性插值生成粒子的初始颜色 - emitter.ColorRndStart = Color.White; - emitter.ColorRndEnd = Color.Red; - - - GSOColorParticleEffector effector2 = new GSOColorParticleEffector(); - effector2.SetColorChanged(0, -1, -1, 0); - effector2.StartTime = 0.0f; - effector2.EndTime = -1.0f; - emitter.AddEffector(effector2); - - // 将三个发射器添加到粒子对象中 - geoParticle.AddEmitter(emitter); - - geoParticle.Play(); - - GSOFeature feature = new GSOFeature(); - - feature.Geometry = geoParticle; - - globeControl1.Globe.MemoryLayer.AddFeature(feature); - - - return feature; - } - - /// - /// 添加喷泉 - /// - /// - private GSOFeature AddFountain() - { - string strResPath = Application.StartupPath + "/Resource"; - - GSOGeoParticle geoParticle = new GSOGeoParticle(); - geoParticle.SetPosition(116.314, 39.84, 0); // 添加到这个经纬度位置 - - GSOPointParticleEmitter emitter = new GSOPointParticleEmitter(); - emitter.TexturePath = strResPath + "/ParticleImage/test.png"; - - emitter.SetSizeFix(0.5f, 2); - emitter.VelFix = 10; - emitter.VelRnd = 2; - - emitter.GravityAcc = 9.8f; - emitter.AngleXYFix = 0; - emitter.AngleXYRnd = 180; - - emitter.AngleXZFix = 88; - emitter.AngleXZRnd = 2; - - //emitter.InnerRadius = 0; - // emitter.OuterRadius = 0.03f; - - emitter.LifeFix = 5.0f; - emitter.LifeRnd = 1.0f; - - emitter.RotFix = 0; - emitter.RotRnd = 0; - - emitter.RotVelFix = 0; - emitter.RotVelRnd = 0; - - emitter.EmitPerSec = 1000; - emitter.ColorRndStart = Color.FromArgb(33, 255, 255, 255); - emitter.ColorRndEnd = Color.FromArgb(11, 255, 255, 255); - emitter.IsLumAdded = false; - - // 将三个发射器添加到粒子对象中 - geoParticle.AddEmitter(emitter); - - geoParticle.Play(); - GSOFeature feature = new GSOFeature(); - - feature.Geometry = geoParticle; - - //globeControl1.Globe.MemoryLayer.AddFeature(feature); - globeControl1.Globe.FlyToFeature(feature); - - return feature; - } - - /// - /// 添加水柱 - /// - /// - private GSOFeature AddWaterLine() - { - string strResPath = Application.StartupPath + "/Resource"; - - GSOGeoParticle geoParticle = new GSOGeoParticle(); - geoParticle.SetPosition(116.308, 39.84, 0); // 添加到这个经纬度位置 - - GSOPointParticleEmitter emitter = new GSOPointParticleEmitter(); - - emitter.TexturePath = strResPath + "/ParticleImage/drop3.png"; - - geoParticle.TimerInterval = 1; - - emitter.SetSizeFix(2.0f, 2.0f); - - emitter.VelFix = 50; - emitter.VelRnd = 2; - - // emitter.IsLumAdded = false; - - emitter.GravityAcc = 9.8f; - emitter.AngleXYFix = 0; - emitter.AngleXYRnd = 2; - - emitter.AngleXZFix = 60; - emitter.AngleXZRnd = 2; - - //emitter.InnerRadius = 0; - // emitter.OuterRadius = 0.1f; - - emitter.LifeFix = 5.0f; - emitter.LifeRnd = 1.0f; - - emitter.RotFix = 0; - emitter.RotRnd = 0; - - emitter.RotVelFix = 0; - emitter.RotVelRnd = 0; - - emitter.EmitPerSec = 1500; - - emitter.ColorRndStart = Color.FromArgb(100, 222, 222, 222); - emitter.ColorRndEnd = Color.FromArgb(50, 222, 222, 222); - - /* - - GSOScaleParticleEffector effector1 = new GSOScaleParticleEffector(); - effector1.SetScale(0.2f, 0.2f); - effector1.StartTime = 0; - effector1.EndTime = -1; // 负数表示整个粒子生命结束 - emitter.AddEffector(effector1); - */ - - // 将三个发射器添加到粒子对象中 - geoParticle.AddEmitter(emitter); - - geoParticle.Play(); - GSOFeature feature = new GSOFeature(); - - feature.Geometry = geoParticle; - - //globeControl1.Globe.MemoryLayer.AddFeature(feature); - globeControl1.Globe.FlyToFeature(feature); - - return feature; - } + } } diff --git a/FrmBufferAnalysis.cs b/FrmBufferAnalysis.cs index f711133..db8ca59 100644 --- a/FrmBufferAnalysis.cs +++ b/FrmBufferAnalysis.cs @@ -123,39 +123,6 @@ } } /// - /// 半径文本框的键盘按键按下事件处理 - /// - /// - /// - private void txtRadius_KeyPress(object sender, KeyPressEventArgs e) - { - TextBox text = sender as TextBox; - if ((e.KeyChar < 48 || e.KeyChar > 57) && (e.KeyChar != 8) && (int)e.KeyChar != 46) - { - e.Handled = true; - } - if ((int)e.KeyChar == 46) //小数点 - { - if (text.Text.Length <= 0) - e.Handled = true; //小数点不能在第一位 - else //处理不规则的小数点 - { - float f; - float oldf; - bool b1 = false, b2 = false; - b1 = float.TryParse(text.Text, out oldf); - b2 = float.TryParse(text.Text + e.KeyChar.ToString(), out f); - if (b2 == false) - { - if (b1 == true) - e.Handled = true; - else - e.Handled = false; - } - } - } - } - /// /// 窗体关闭事件处理 /// /// diff --git a/FrmBufferAnalysisBSQ.cs b/FrmBufferAnalysisBSQ.cs index 24a96ca..f54208f 100644 --- a/FrmBufferAnalysisBSQ.cs +++ b/FrmBufferAnalysisBSQ.cs @@ -137,35 +137,7 @@ } } - private void txtRadius_KeyPress(object sender, KeyPressEventArgs e) - { - TextBox text = sender as TextBox; - if ((e.KeyChar < 48 || e.KeyChar > 57) && (e.KeyChar != 8) && (int)e.KeyChar != 46) - { - e.Handled = true; - } - if ((int)e.KeyChar == 46) //小数点 - { - if (text.Text.Length <= 0) - e.Handled = true; //小数点不能在第一位 - else //处理不规则的小数点 - { - float f; - float oldf; - bool b1 = false, b2 = false; - b1 = float.TryParse(text.Text, out oldf); - b2 = float.TryParse(text.Text + e.KeyChar.ToString(), out f); - if (b2 == false) - { - if (b1 == true) - e.Handled = true; - else - e.Handled = false; - } - } - } - } - + private void FrmBufferAnalysis_FormClosing(object sender, FormClosingEventArgs e) { //Form1.y = 0; @@ -316,27 +288,6 @@ } } - private void FlyToMenu_Click(object sender, EventArgs e) - { - if (m_feature != null) - { - if (m_feature.Geometry != null && m_feature.Geometry.Type == EnumGeometryType.GeoPolyline3D) - { - GSOGeoPolyline3D line = m_feature.Geometry as GSOGeoPolyline3D; - double length = line.GetSpaceLength(true, 6378137); - GSOGeoPolyline3D lineLine = line.GetSegment(0, length / 2); - GSOPoint3d point3d = lineLine[lineLine.PartCount - 1][lineLine[lineLine.PartCount - 1].Count - 1]; - - globeControl1.Globe.FlyToPosition(point3d, EnumAltitudeMode.Absolute, 0, 45, 5); - } - else - { - globeControl1.Globe.FlyToFeature(m_feature, 0, 45, 3); - } - LightMenu_Click(sender, e); - } - } - private void LightMenu_Click(object sender, EventArgs e) { flashflag = "single"; diff --git a/FrmDataBaseOpt.cs b/FrmDataBaseOpt.cs index b0c4b5d..8d7b69d 100644 --- a/FrmDataBaseOpt.cs +++ b/FrmDataBaseOpt.cs @@ -362,6 +362,7 @@ dbCombor.Items.Add(dblist[i].title); } } + /* /// /// 从配置文件读取数据库参数配置 /// @@ -428,6 +429,8 @@ } } + * */ + /* /// /// 向配置文件写入连接数据库的参数配置 /// @@ -485,6 +488,7 @@ MessageBox.Show(exp.ToString()); } } + * */ /// /// /// diff --git a/FrmDatabaseParaSetting.cs b/FrmDatabaseParaSetting.cs index a6fea46..63b596b 100644 --- a/FrmDatabaseParaSetting.cs +++ b/FrmDatabaseParaSetting.cs @@ -152,6 +152,7 @@ this.DialogResult = DialogResult.OK; this.Close(); } + /* /// /// 从配置文件读取数据库连接参数配置 /// @@ -218,6 +219,8 @@ } } + * */ + /* /// /// 向配置文件写入数据库参数配置 /// @@ -276,7 +279,7 @@ MessageBox.Show(ex.ToString()); } } - + */ /// /// 取消按钮事件处理 /// diff --git a/FrmDatabaseParaSetting2.cs b/FrmDatabaseParaSetting2.cs index 932d05e..96a87d5 100644 --- a/FrmDatabaseParaSetting2.cs +++ b/FrmDatabaseParaSetting2.cs @@ -148,6 +148,7 @@ this.DialogResult = DialogResult.OK; this.Close(); } + /* /// /// 从配置文件读取数据库连接参数配置 /// @@ -214,6 +215,8 @@ } } + * */ + /* /// /// 向配置文件写入数据库参数配置 /// @@ -272,7 +275,7 @@ MessageBox.Show(exp.ToString()); } } - + */ /// /// 取消按钮事件处理 /// diff --git a/FrmDiameterQuery.cs b/FrmDiameterQuery.cs index 68c948b..9a5215b 100644 --- a/FrmDiameterQuery.cs +++ b/FrmDiameterQuery.cs @@ -77,18 +77,7 @@ isBetween = true; } } - /// - /// 键盘按键按下事件处理 - /// - /// - /// - private void textBoxX1_KeyPress(object sender, KeyPressEventArgs e) - { - if ((e.KeyChar < 48 || e.KeyChar > 57) && e.KeyChar != 8) - { - e.Handled = true;//屏蔽 - } - } + bool isBetween = false; /// diff --git a/FrmDocumentEdit.cs b/FrmDocumentEdit.cs index aab2d31..e78a7ff 100644 --- a/FrmDocumentEdit.cs +++ b/FrmDocumentEdit.cs @@ -256,121 +256,6 @@ } - // - /// 将本地文件上传到指定的服务器(HttpWebRequest方法) - /// - /// 文件上传到的服务器 - /// 要上传的本地文件(全路径) - /// 文件上传后的名称 - /// 上传进度条 - /// 成功返回1,失败返回0 - private int Upload_Request(string address, string fileNamePath, string saveName, ProgressBar progressBar) - { - int returnValue = 0; - // 要上传的文件 - FileStream fs = new FileStream(fileNamePath, FileMode.Open, FileAccess.Read); - BinaryReader r = new BinaryReader(fs); - //时间戳 - string strBoundary = "----------" + DateTime.Now.Ticks.ToString("x"); - byte[] boundaryBytes = Encoding.ASCII.GetBytes("/r/n--" + strBoundary + "/r/n"); - //请求头部信息 - StringBuilder sb = new StringBuilder(); - sb.Append("--"); - sb.Append(strBoundary); - sb.Append("\r\n"); - sb.Append("Content-Disposition: form-data; name=\""); - sb.Append("file"); - sb.Append("\"; filename=\""); - sb.Append(saveName); - sb.Append("\""); - sb.Append("\r\n"); - sb.Append("Content-Type: "); - sb.Append("application/octet-stream"); - sb.Append("\r\n"); - sb.Append("\r\n"); - string strPostHeader = sb.ToString(); - byte[] postHeaderBytes = Encoding.UTF8.GetBytes(strPostHeader); - // 根据uri创建HttpWebRequest对象 - HttpWebRequest httpReq = (HttpWebRequest)WebRequest.Create(new Uri(address)); - httpReq.Method = "POST"; - //对发送的数据不使用缓存 - httpReq.AllowWriteStreamBuffering = false; - //设置获得响应的超时时间(300秒) - httpReq.Timeout = 300000; - httpReq.ContentType = "multipart/form-data; boundary=" + strBoundary; - long length = fs.Length + postHeaderBytes.Length + boundaryBytes.Length; - long fileLength = fs.Length; - httpReq.ContentLength = length; - try - { - progressBar.Maximum = int.MaxValue; - progressBar.Minimum = 0; - progressBar.Value = 0; - //每次上传4k - int bufferLength = 4096; - byte[] buffer = new byte[bufferLength]; - //已上传的字节数 - long offset = 0; - //开始上传时间 - DateTime startTime = DateTime.Now; - int size = r.Read(buffer, 0, bufferLength); - Stream postStream = httpReq.GetRequestStream(); - //发送请求头部消息 - postStream.Write(postHeaderBytes, 0, postHeaderBytes.Length); - while (size > 0) - { - postStream.Write(buffer, 0, size); - offset += size; - progressBar.Value = (int)(offset * (int.MaxValue / length)); - TimeSpan span = DateTime.Now - startTime; - double second = span.TotalSeconds; - //lblTime.Text = "已用时:" + second.ToString("F2") + "秒"; - //if (second > 0.001) - //{ - // lblSpeed.Text = " 平均速度:" + (offset / 1024 / second).ToString("0.00") + "KB/秒"; - //} - //else - //{ - // lblSpeed.Text = " 正在连接…"; - //} - //lblState.Text = "已上传:" + (offset * 100.0 / length).ToString("F2") + "%"; - //lblSize.Text = (offset / 1048576.0).ToString("F2") + "M/" + (fileLength / 1048576.0).ToString("F2") + "M"; - Application.DoEvents(); - size = r.Read(buffer, 0, bufferLength); - } - //添加尾部的时间戳 - postStream.Write(boundaryBytes, 0, boundaryBytes.Length); - postStream.Close(); - //获取服务器端的响应 - WebResponse webRespon = httpReq.GetResponse(); - Stream s = webRespon.GetResponseStream(); - StreamReader sr = new StreamReader(s); - //读取服务器端返回的消息 - String sReturnString = sr.ReadLine(); - s.Close(); - sr.Close(); - if (sReturnString == "Success") - { - returnValue = 1; - } - else if (sReturnString == "Error") - { - returnValue = 0; - } - } - catch(Exception ex) - { - returnValue = 0; - string str = ex.ToString(); - } - finally - { - fs.Close(); - r.Close(); - } - return returnValue; - } - private void btn_file_Click(object sender, EventArgs e) { OpenFileDialog dlg = new OpenFileDialog(); diff --git a/FrmExportCADS.cs b/FrmExportCADS.cs index 98772ea..59629dd 100644 --- a/FrmExportCADS.cs +++ b/FrmExportCADS.cs @@ -108,65 +108,6 @@ MessageBox.Show("请选中要导出的图层!", "提示", MessageBoxButtons.OK, MessageBoxIcon.Warning); } } - private Boolean MerageToFile(GSOFeatures features, String strDestFile, String strProj4)//图层追加 - { - if (features == null) - { - return false; - } - Boolean bSuccess = false; - - string strDir = GSOUtility.GetFileDir(strDestFile); - string strLPRJFile = GSOUtility.ChangeExt(strDestFile, ".lprj"); - string strExt = GSOUtility.GetFileExt(strDestFile); - - // 如果投影文件存在,投影以投影文件为准 - if (File.Exists(strLPRJFile)) - { - // 如果是dxf,则这样处理 - if (strExt.ToLower() == ".dxf") - { - string strTempSrcFile = strDir + "srcFeatures_dxftmp" + strExt; - globeControl1.Globe.DataManager.SaveFeatureData(features, strTempSrcFile, strLPRJFile, 4); - bSuccess = GSOUtility.MergeTwoDXFFileFeatures(strDestFile, strTempSrcFile); - File.Delete(strTempSrcFile); - } - else - { - GSOFeatures srcFeatures = globeControl1.Globe.DataManager.ReadFeatureData(strDestFile); - int nCount = features.Length; - int i = 0; - for (i = 0; i < nCount; i++) - { - srcFeatures.Add(features[i]); - } - bSuccess = globeControl1.Globe.DataManager.SaveFeatureData(srcFeatures, strDestFile, strLPRJFile, 4); - } - } - else - { - // 如果是dxf,则这样处理 - if (strExt.ToLower() == ".dxf") - { - string strTempSrcFile = strDir + "srcFeatures_dxftmp" + strExt; - globeControl1.Globe.DataManager.SaveFeatureData(features, strTempSrcFile, strProj4, 0); - bSuccess = GSOUtility.MergeTwoDXFFileFeatures(strDestFile, strTempSrcFile); - File.Delete(strTempSrcFile); - } - else - { - GSOFeatures srcFeatures = globeControl1.Globe.DataManager.ReadFeatureData(strDestFile); - int nCount = features.Length; - int i = 0; - for (i = 0; i < nCount; i++) - { - srcFeatures.Add(features[i]); - } - bSuccess = globeControl1.Globe.DataManager.SaveFeatureData(srcFeatures, strDestFile, strProj4, 0); - } - } - return bSuccess; - } /// /// 关闭按钮事件处理 /// diff --git a/FrmHDMAnalysis3.cs b/FrmHDMAnalysis3.cs index 4f73af6..2ada735 100644 --- a/FrmHDMAnalysis3.cs +++ b/FrmHDMAnalysis3.cs @@ -436,29 +436,6 @@ } layerTemp.RemoveAllFeature(); } - private void Export(GSOPoint3d _pnt, double r) - { - GSOPoint3ds pnts = new GSOPoint3ds(); - GSOPoint3d pnt = new GSOPoint3d(); - pnt.X = _pnt.X; - pnt.Y = _pnt.Y; - pnt.Z = _pnt.Z; - pnts.Add(pnt); - pnt.X = _pnt.X; - pnt.Y = _pnt.Y - 0.0000000005; - pnt.Z = _pnt.Z; - pnts.Add(pnt); - GSOGeoPolyline3D line = new GSOGeoPolyline3D(); - line.AddPart(pnts); - GSOGeoPolygon3D polygon = line.CreateBuffer(r * 2, true, 5, true, false); - GSOPoint3ds points = polygon[0]; - GSOGeoPolyline3D newLine = new GSOGeoPolyline3D(); - newLine.AddPart(points); - newLine.AltitudeMode = EnumAltitudeMode.RelativeToGround; - GSOFeature newFeature = new GSOFeature(); - newFeature.Geometry = newLine; - globeControl1.Globe.MemoryLayer.AddFeature(newFeature); - } private void ExportCAD(double a, double b, double r) { diff --git a/FrmHotFuncStat.cs b/FrmHotFuncStat.cs index c980f34..2eb1476 100644 --- a/FrmHotFuncStat.cs +++ b/FrmHotFuncStat.cs @@ -421,13 +421,6 @@ } } - private void HFS_Pderive_Click(object sender, EventArgs e) - { - if (TV_Files.SelectedNode != null) - { - HFSClass.GuideEdit_form("G", TV_Files, int.Parse(((ToolStripMenuItem)sender).Tag.ToString())); - } - } private void 导入ToolStripMenuItem_Click(object sender, EventArgs e) { @@ -530,22 +523,8 @@ } } - private void 导出ToolStripMenuItem1_Click(object sender, EventArgs e) - { - 导出ToolStripMenuItem2_Click(sender, e); - } + - private void TV_HFSSrchRslt_AfterCollapse(object sender, TreeViewEventArgs e) - { - e.Node.ImageIndex = 0; - } - - private void TV_HFSSrchRslt_AfterExpand(object sender, TreeViewEventArgs e) - { - HFSClass.ADD_TreeNode(TV_Files, e.Node); - e.Node.ImageIndex = 1; - } - private void 导出ToolStripMenuItem1_Click_1(object sender, EventArgs e) { if ((TV_HFSSrchRslt.SelectedNode != null) && (TV_HFSSrchRslt.SelectedNode.Parent != null)) diff --git a/FrmLayerControl.cs b/FrmLayerControl.cs index e7917c3..28fa14d 100644 --- a/FrmLayerControl.cs +++ b/FrmLayerControl.cs @@ -312,26 +312,7 @@ layerManagerNode.Expand(); terrainManagerNode.Expand(); } - /// - /// 刷新节点树 - /// - private void RefreshDataTree() - { - layerTree2.Nodes[0].Nodes.Clear(); - Int32 nCount = globeControl2.Globe.Layers.Count; - Int32 i = 0; - for (i = 0; i < nCount; i++) - { - GSODataset dataSpace = globeControl2.Globe.Layers[i].Dataset; - TreeNode node = new TreeNode(); - node.Text = dataSpace.Name; - node.ImageIndex = 0; - node.SelectedImageIndex = 0; - node.Checked = true; - node.Tag = dataSpace; - layerTree2.Nodes[0].Nodes.Add(node); - } - } + /// /// 目标图层按钮事件处理 /// @@ -494,22 +475,8 @@ } } } - /// - /// 改变指定节点的选中状态 - /// - /// - /// - private void CheckTreeNode(TreeNode node, Boolean bChecked) - { - CheckChildTreeNode(node, bChecked); - // 对于kml图层,如果当前处理的节点是true,那么要把所有的祖宗节点置为true - // 只有所有节点都未false,那么这个节点才为false - // CheckFatherTreeNode(node, bChecked); - globeControl1.Globe.Refresh(); - globeControl2.Globe.Refresh(); - - } + private void CheckChildTreeNode(TreeNode node, Boolean bChecked) { if (node == null) @@ -696,59 +663,7 @@ //} //CheckControl(e); } - /// - /// 树节点选中方法 - /// - /// - private void CheckControl(TreeViewEventArgs e) - { - if (e.Action != TreeViewAction.Unknown) - { - if (e.Node != null && !Convert.IsDBNull(e.Node)) - { - CheckParentNode(e.Node); - if (e.Node.Nodes.Count > 0) - { - CheckAllChildNodes(e.Node, e.Node.Checked); - } - } - } - } - /// - /// 改变所有子节点的状态 - /// - /// - /// - private void CheckAllChildNodes(TreeNode pn, bool IsChecked) - { - foreach (TreeNode tn in pn.Nodes) - { - tn.Checked = IsChecked; - if (tn.Tag.ToString().Contains("|")) - { - string nodeTag = tn.Tag.ToString().Split('|')[1]; - GSOLayer layer = globeControl1.Globe.Layers.GetLayerByCaption(nodeTag); - if (layer != null) - { - layer.Visible = IsChecked; - globeControl1.Globe.Refresh(); - } - } - if (tn.Tag is GSOFeature) - { - if (tn.Nodes.Count == 0) - { - GSOFeature feat = tn.Tag as GSOFeature; - feat.Visible = IsChecked; - globeControl1.Globe.Refresh(); - } - } - if (tn.Nodes.Count > 0) - { - CheckAllChildNodes(tn, IsChecked); - } - } - } + /// /// 改变父节点的选中状态,此处为所有子节点不选中时才取消父节点选中,可以根据需要修改 /// diff --git a/FrmLogin.cs b/FrmLogin.cs index 320fdd5..2afe46e 100644 --- a/FrmLogin.cs +++ b/FrmLogin.cs @@ -59,70 +59,6 @@ textBoxPassWord.Clear(); } } - - /// - /// 验证端口号 - /// - /// - private bool ValiPort() - { - Ping p = new Ping();//创建Ping对象p - PingReply pr = p.Send(Utility.localicenseserverip);//向指定IP或者主机名的计算机发送ICMP协议的ping数据包 - if (pr.Status == IPStatus.Success)//如果ping成功 - { - try - { - TcpClient tcpc = new TcpClient(Utility.localicenseserverip, Utility.localicenseserverport);//对IP地址为"192.168.0.105"的计算机的1500端口提出连接申请 - tcpc.Close(); - return true; - } - catch (Exception ex) - { - MessageBox.Show("端口连接错误!" + ex.Message); - return false; - } - } - else - { - int times = 0;//重新连接次数; - int count = 2;//设置尝试次数 - while (times < count) - { - //Thread.Sleep(1000);//等待时间(方便测试的话,你可以改为1000) - pr = p.Send(Utility.localicenseserverip); - - if (pr.Status == IPStatus.Success) - { - try - { - TcpClient tcpc = new TcpClient(Utility.localicenseserverip, Utility.localicenseserverport);//对IP地址为"192.168.0.105"的计算机的1500端口提出连接申请 - tcpc.Close(); - return true; - } - catch (Exception ex) - { - MessageBox.Show("端口连接错误!" + ex.Message); - return false; - } - } - else - { - times++; - if (times < count) - { - continue; - } - else - { - MessageBox.Show("重新尝试连接失败"); - return false; - } - } - - } - return false; - } - } /// /// 验证用户名、密码 /// diff --git a/FrmMetadata.cs b/FrmMetadata.cs index 886f65a..0365372 100644 --- a/FrmMetadata.cs +++ b/FrmMetadata.cs @@ -27,11 +27,7 @@ InitializeComponent(); loadTreeView(layerTree); } - private void FrmMetadata_Load(object sender, EventArgs e) - { - //this.ntLblC.Text = "nn"; - // loadTreeView(layerTree); - } + private void loadTreeView(TreeView tv)//构建图层树 { try diff --git a/FrmMetadataStat.cs b/FrmMetadataStat.cs index 790658a..e7696c6 100644 --- a/FrmMetadataStat.cs +++ b/FrmMetadataStat.cs @@ -197,9 +197,5 @@ } } - private void buttonX1_Click(object sender, EventArgs e) - { - drawChart(); - } } } diff --git a/FrmPatrolerManager.cs b/FrmPatrolerManager.cs index 37f8ffd..9e66aeb 100644 --- a/FrmPatrolerManager.cs +++ b/FrmPatrolerManager.cs @@ -109,82 +109,8 @@ this.winGridViewPager1.AllToExport = table; } - /// - /// 编辑 - /// - /// - /// - private void winGridViewPager1_OnEditSelected(object sender, EventArgs e) - { - - DataGridView grid = sender as DataGridView; - if (grid != null && grid.SelectedRows.Count>0) - { - DataGridViewRow row = grid.SelectedRows[0]; - try - { - long dbid = long.Parse(row.Cells["编号"].Value.ToString()); - String name = row.Cells["姓名"].Value.ToString(); - String sex = row.Cells["性别"].Value.ToString(); - String age = row.Cells["年龄"].Value.ToString(); - string phone = row.Cells["电话"].Value.ToString(); - age = String.IsNullOrEmpty(age.ToString().Trim()) ? "1" : age.ToString().Trim(); - FrmPatrolerEdit frm = new FrmPatrolerEdit(dbid.ToString(), name, age, sex, phone); - frm.reloadGrid += new ReloadPatrolerGrid(LoadData); - frm.ShowDialog(); - winGridViewPager1.Refresh(); - } - catch (Exception ex) - { - MessageBox.Show("编辑失败:" + ex.ToString(), "错误", MessageBoxButtons.OK, MessageBoxIcon.Error); - } - } - else - { - MessageBox.Show("没有选择记录", "提示"); - } - - } - - /// - /// 删除 - /// - /// - /// - private void winGridViewPager1_OnDeleteSelected(object sender, EventArgs e) - { - DataGridView grid = sender as DataGridView; - if (grid != null && grid.SelectedRows.Count > 0) - { - DataGridViewRow row = grid.SelectedRows[0]; - long dbid = long.Parse(row.Cells["编号"].Value.ToString()); - try - { - string state = row.Cells["状态"].Value.ToString(); - if ("在线".Equals(state)) - { - if (MessageBox.Show("确定注销?", "确认", MessageBoxButtons.YesNo, MessageBoxIcon.Question) == DialogResult.Yes) - { - String sql = "update patroler t set t.accountstate='LEAVER' where t.dbid=" + dbid; - OracleUtils.ExecuteNonQuery(OracleUtils.ConnectionString, CommandType.Text, sql); - } - } - else { - MessageBox.Show("人员不在线,无法注销", "信息"); - } - } - catch (Exception ex) - { - MessageBox.Show("人员注销失败:" + ex.ToString(), "错误", MessageBoxButtons.OK, MessageBoxIcon.Error); - } - } - else - { - MessageBox.Show("没有选择记录", "提示"); - } - } - - + + private void LoadData() { int pageIndex = winGridViewPager1.PagerInfo.CurrenetPageIndex; diff --git a/FrmRoadHDM.cs b/FrmRoadHDM.cs index e765313..e871dd5 100644 --- a/FrmRoadHDM.cs +++ b/FrmRoadHDM.cs @@ -333,31 +333,6 @@ this.Cursor = Cursors.Default; } } - - private void Export(GSOPoint3d _pnt, double r) - { - GSOPoint3ds pnts = new GSOPoint3ds(); - GSOPoint3d pnt = new GSOPoint3d(); - pnt.X = _pnt.X; - pnt.Y = _pnt.Y; - pnt.Z = _pnt.Z; - pnts.Add(pnt); - pnt.X = _pnt.X; - pnt.Y = _pnt.Y - 0.0000000005; - pnt.Z = _pnt.Z; - pnts.Add(pnt); - GSOGeoPolyline3D line = new GSOGeoPolyline3D(); - line.AddPart(pnts); - GSOGeoPolygon3D polygon = line.CreateBuffer(r * 2, true, 5, true, false); - GSOPoint3ds points = polygon[0]; - GSOGeoPolyline3D newLine = new GSOGeoPolyline3D(); - newLine.AddPart(points); - newLine.AltitudeMode = EnumAltitudeMode.RelativeToGround; - GSOFeature newFeature = new GSOFeature(); - newFeature.Geometry = newLine; - globeControl1.Globe.MemoryLayer.AddFeature(newFeature); - } - private void ExportCAD(double a, double b, double r) { GSOPoint3ds pnts = new GSOPoint3ds(); diff --git a/FrmUserAdd.cs b/FrmUserAdd.cs index c612ab4..f826427 100644 --- a/FrmUserAdd.cs +++ b/FrmUserAdd.cs @@ -231,24 +231,6 @@ //cbxRegion.SelectedIndexChanged += new EventHandler(cbxRegion_SelectedIndexChanged); } } - /// - /// 下拉框选中项改变事件处理 - /// - /// - /// - private void cbxRegion_SelectedIndexChanged(object sender, EventArgs e) - { - string sql = ""; - //string sql = "select casic_role.\"name\" from casic_role join casic_regionrole on casic_role.\"id\"=casic_regionrole.\"rid\" where casic_regionrole.\"reid\"=" + region[cbxRegion.SelectedItem.ToString().Trim()]; - DataTable dt = OledbHelper.QueryTable(sql); - if (dt != null && dt.Rows.Count > 0) - { - comboBoxExRegionRole.Items.Clear(); - for (int i = 0; i < dt.Rows.Count; i++) - { - comboBoxExRegionRole.Items.Add(dt.Rows[i][0].ToString().Trim());//部门角色 - } - } - } + } } diff --git a/FrmUserManager.cs b/FrmUserManager.cs index 571f0f0..ae254bc 100644 --- a/FrmUserManager.cs +++ b/FrmUserManager.cs @@ -81,11 +81,6 @@ } } } - //创建新用户 - private void buttonX2_Click(object sender, EventArgs e) - { - FrmUserAdd frm = new FrmUserAdd(-1); - frm.ShowDialog(); - } + } } diff --git a/FrmValveStatistics.cs b/FrmValveStatistics.cs index 545d56c..dd76777 100644 --- a/FrmValveStatistics.cs +++ b/FrmValveStatistics.cs @@ -54,7 +54,7 @@ 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") + if (chaFamenStatis.Series["阀门"].Points[m]!=null&&chaFamenStatis.Series["阀门"].Points[m].YValues[0].ToString() != "0") { chaFamenStatis.Series["阀门"].Points[m].Label = chaFamenStatis.Series[0].Points[m].YValues[0].ToString(); } diff --git a/Frm_password_reset.cs b/Frm_password_reset.cs index 7b51039..b9e5dc3 100644 --- a/Frm_password_reset.cs +++ b/Frm_password_reset.cs @@ -41,6 +41,7 @@ } catch (Exception ex) { + LogHelper.WriteLog(typeof(Frm_password_reset), ex.Message); } } private void initCombox() diff --git a/FrmpipeDeepstatis.cs b/FrmpipeDeepstatis.cs index e156db4..1a84d6c 100644 --- a/FrmpipeDeepstatis.cs +++ b/FrmpipeDeepstatis.cs @@ -307,7 +307,7 @@ chart1.Series[j].Points.DataBindXY(dic1.Keys, dic1.Values); for (int m = 0; m < dic1.Values.Count; m++) { - if (chart1.Series[j].Points[m].YValues[0].ToString() != "0") + if (chart1.Series[j].Points[m]!=null&&chart1.Series[j].Points[m].YValues[0].ToString() != "0") { chart1.Series[j].Points[m].Label = chart1.Series[j].Points[m].YValues[0].ToString(); diff --git a/FrmpipeDiametergather.cs b/FrmpipeDiametergather.cs index 30674de..057b09d 100644 --- a/FrmpipeDiametergather.cs +++ b/FrmpipeDiametergather.cs @@ -263,6 +263,7 @@ if (layer != null && layer is GSOFeatureLayer) { GSOFeatureLayer flayer = layer as GSOFeatureLayer; + if (layer == null) return; GSOFeatures features = flayer.GetAllFeatures(); if (features.Length > 0) { diff --git a/FrmpipeMaterialGather.cs b/FrmpipeMaterialGather.cs index c133ec3..398b884 100644 --- a/FrmpipeMaterialGather.cs +++ b/FrmpipeMaterialGather.cs @@ -280,6 +280,7 @@ if (layer != null && layer is GSOFeatureLayer) { GSOFeatureLayer flayer = layer as GSOFeatureLayer; + if (flayer == null) return; GSOFeatures features = flayer.GetAllFeatures(); if (features.Length > 0) { @@ -332,7 +333,7 @@ chart1.Series[j].Points.DataBindXY(dic1.Keys, dic1.Values); for (int m = 0; m < dic1.Values.Count; m++) { - if (chart1.Series[j].Points[m].YValues[0].ToString() != "0") + if (chart1.Series[j].Points[m]!=null&&chart1.Series[j].Points[m].YValues[0].ToString() != "0") { chart1.Series[j].Points[m].Label = chart1.Series[j].Points[m].YValues[0].ToString(); } diff --git a/Cyberpipe.csproj b/Cyberpipe.csproj index 07a8c1a..e3cd12c 100644 --- a/Cyberpipe.csproj +++ b/Cyberpipe.csproj @@ -204,25 +204,6 @@ - - Form - - - F_GKT1数据输入输出.cs - - - Form - - - F_GKT1添加文件.cs - - - Form - - - F_GKT1添加项目.cs - - Form @@ -1068,18 +1049,6 @@ Frm_password_reset.cs - - Form - - - GKT.cs - - - Form - - - GKT1.cs - Form @@ -1258,12 +1227,6 @@ F_Projedit.cs - - Form - - - PED.cs - Form @@ -1331,16 +1294,6 @@ True Reference.map - - F_GKT1数据输入输出.cs - Designer - - - F_GKT1添加文件.cs - - - F_GKT1添加项目.cs - Form_EditTask.cs @@ -1836,12 +1789,6 @@ Frm_password_reset.cs - - GKT.cs - - - GKT1.cs - F_GKT数据输入输出.cs @@ -1934,9 +1881,6 @@ F_Projedit.cs - - PED.cs - F_数据输入输出.cs diff --git a/Cyberpipe.suo b/Cyberpipe.suo index 68ced4f..a1aecf8 100644 --- a/Cyberpipe.suo +++ b/Cyberpipe.suo Binary files differ diff --git a/EMS_Forms/Form_EditTask.cs b/EMS_Forms/Form_EditTask.cs index 718992f..f1d791f 100644 --- a/EMS_Forms/Form_EditTask.cs +++ b/EMS_Forms/Form_EditTask.cs @@ -119,7 +119,8 @@ String name = Convert.ToString(dr["USERNAME"]); comboBox_userName.Items.Add(name); - } + } + dr.Close(); comboBox_road.Items.Clear(); roadList = new List(); @@ -135,7 +136,7 @@ comboBox_road.Items.Add(name); } } - + dr1.Close(); conn.Close(); bool flag2 = false; @@ -185,7 +186,7 @@ catch (Exception ex) { - MessageBox.Show(ex.ToString()); + LogHelper.WriteLog(typeof(Form_EditTask), ex.Message); } } @@ -288,7 +289,7 @@ } catch (Exception ex) { - MessageBox.Show(ex.ToString()); + LogHelper.WriteLog(typeof(Form_EditTask), ex.Message); } } @@ -474,7 +475,7 @@ } catch (Exception ex) { - MessageBox.Show(ex.ToString()); + LogHelper.WriteLog(typeof(Form_EditTask), ex.Message); } this.Close(); @@ -495,6 +496,7 @@ { numList.Add(Convert.ToInt32(dr["DBID"])); } + dr.Close(); if (numList.Count == 0) { taskNumber = Convert.ToInt32(number) * 100; @@ -674,6 +676,7 @@ } } } + dr.Close(); conn.Close(); } diff --git a/EMS_Forms/Form_EventManager.cs b/EMS_Forms/Form_EventManager.cs index b18c45b..84807b2 100644 --- a/EMS_Forms/Form_EventManager.cs +++ b/EMS_Forms/Form_EventManager.cs @@ -64,6 +64,7 @@ comboBox_name.Items.Add(name); } + dr.Close(); conn.Close(); diff --git a/Forms/FrmMnModify.cs b/Forms/FrmMnModify.cs index 31cfc5f..d036360 100644 --- a/Forms/FrmMnModify.cs +++ b/Forms/FrmMnModify.cs @@ -68,15 +68,7 @@ questionGrid.Rows[idx].Cells[1].Value = sr.question; } } - /// 选中对象 - /// - /// - /// - /// - private void buttonX1_Click(object sender, EventArgs e) - { - globecontrol.Globe.Action = EnumAction3D.SelectObject; - } + /// /// 选中某一行 /// diff --git a/Forms/FrmPipelineModelDataBase.cs b/Forms/FrmPipelineModelDataBase.cs index 2acf0ca..7ce573f 100644 --- a/Forms/FrmPipelineModelDataBase.cs +++ b/Forms/FrmPipelineModelDataBase.cs @@ -35,19 +35,7 @@ ds = _ds; InitializeComponent(); } - /// - /// 单击选择shp格式文件 - /// - /// - /// - private void btnBrowseModel_Click(object sender, EventArgs e) - { - saveFileDialog1.Filter = "*.lgd|*.lgd"; - if (saveFileDialog1.ShowDialog() == DialogResult.OK) - { - txtModelLayer.Text = saveFileDialog1.FileName; - } - } + /// /// 窗体初始化事件处理 /// @@ -100,49 +88,6 @@ } } } - - private object convertFieldValue(string fieldname, object obj) - { - if (obj == null) - return null; - - try - { - string type = fields_types[fieldname].ToString(); - switch (type) - { - case "string": - return obj.ToString(); - case "int": - //return 101; - int intResult; - if (int.TryParse(obj.ToString(), out intResult)) - return intResult; - else - return null; - case "double": - //return 202.5; - double doubleResult; - if (double.TryParse(obj.ToString(), out doubleResult)) - return doubleResult; - else - return null; - case "date": - DateTime dtResult; - if (DateTime.TryParse(obj.ToString(), out dtResult)) - return dtResult; - else - return null; - } - return null; - } - catch (Exception ex) - { - MessageBox.Show(ex.ToString()); - return null; - } - } - public string lgdFilePath = ""; /// /// 选择管线颜色 @@ -610,33 +555,6 @@ { this.Close(); } - - private void cmbLayer_SelectedIndexChanged(object sender, EventArgs e) //选择图层 - { - GSOLayer layer = ctl.Globe.Layers.GetLayerByCaption(selectLayerName); - GSOFeatures features = layer.GetAllFeatures(); - if (features.Length == 0) - return; - - cmbFrom.Items.Clear(); - cmbTo.Items.Clear(); - cmbRadius.Items.Clear(); - cmbID.Items.Clear(); - for (int i = 0; i < features[0].GetFieldCount(); i++) - { - GeoScene.Data.GSOFieldDefn fielddef = (GeoScene.Data.GSOFieldDefn)(features[0].GetFieldDefn(i)); - - cmbFrom.Items.Add(fielddef.Name); - cmbTo.Items.Add(fielddef.Name); - cmbRadius.Items.Add(fielddef.Name); - cmbID.Items.Add(fielddef.Name); - } - cmbFrom.SelectedItem = "Deep1"; - cmbTo.SelectedItem = "Deep2"; - cmbRadius.SelectedItem = "Diameter"; - cmbID.SelectedItem = "Handle"; - } - private void buttonXLayerPath_Click(object sender, EventArgs e)//单击 选择shp格式的文件 { OpenFileDialog dlg = new OpenFileDialog(); diff --git a/Forms/FrmPipelineModelDataOneStep.cs b/Forms/FrmPipelineModelDataOneStep.cs index 18afda7..ec93b8a 100644 --- a/Forms/FrmPipelineModelDataOneStep.cs +++ b/Forms/FrmPipelineModelDataOneStep.cs @@ -38,19 +38,7 @@ layerTree = _layerTree; InitializeComponent(); } - /// - /// 单击选择shp格式文件 - /// - /// - /// - private void btnBrowseModel_Click(object sender, EventArgs e) - { - saveFileDialog1.Filter = "*.lgd|*.lgd"; - if (saveFileDialog1.ShowDialog() == DialogResult.OK) - { - txtModelLayer.Text = saveFileDialog1.FileName; - } - } + /// /// 窗体初始化事件处理 /// @@ -107,48 +95,7 @@ } } - private object convertFieldValue(string fieldname, object obj) - { - if (obj == null) - return null; - - try - { - string type = fields_types[fieldname].ToString(); - switch (type) - { - case "string": - return obj.ToString(); - case "int": - //return 101; - int intResult; - if (int.TryParse(obj.ToString(), out intResult)) - return intResult; - else - return null; - case "double": - //return 202.5; - double doubleResult; - if (double.TryParse(obj.ToString(), out doubleResult)) - return doubleResult; - else - return null; - case "date": - DateTime dtResult; - if (DateTime.TryParse(obj.ToString(), out dtResult)) - return dtResult; - else - return null; - } - return null; - } - catch (Exception ex) - { - MessageBox.Show(ex.ToString()); - return null; - } - } - + public string lgdFilePath = ""; /// /// 选择管线颜色 @@ -673,32 +620,6 @@ return featDs; } - private void cmbLayer_SelectedIndexChanged(object sender, EventArgs e) //选择图层 - { - GSOLayer layer = ctl.Globe.Layers.GetLayerByCaption(selectLayerName); - GSOFeatures features = layer.GetAllFeatures(); - if (features.Length == 0) - return; - - cmbFrom.Items.Clear(); - cmbTo.Items.Clear(); - cmbRadius.Items.Clear(); - cmbID.Items.Clear(); - for (int i = 0; i < features[0].GetFieldCount(); i++) - { - GeoScene.Data.GSOFieldDefn fielddef = (GeoScene.Data.GSOFieldDefn)(features[0].GetFieldDefn(i)); - - cmbFrom.Items.Add(fielddef.Name); - cmbTo.Items.Add(fielddef.Name); - cmbRadius.Items.Add(fielddef.Name); - cmbID.Items.Add(fielddef.Name); - } - cmbFrom.SelectedItem = "Deep1"; - cmbTo.SelectedItem = "Deep2"; - cmbRadius.SelectedItem = "Diameter"; - cmbID.SelectedItem = "Handle"; - } - private void buttonXLayerPath_Click(object sender, EventArgs e)//单击 选择shp格式的文件 { OpenFileDialog dlg = new OpenFileDialog(); @@ -949,38 +870,6 @@ } //txtLayername.Text = type + layername; } - /// - /// 连接数据库 - /// - /// - /// - private void buttonX1_Click(object sender, EventArgs e) - { - if (ds == null) - { - //没连的话,直接连接审核库; //审核库配置读配置文件 - string dbIp = Utility.sgdbip; - string database = Utility.sgdbname; - string user = Utility.sgdbuser; - string pass = Utility.sgdbpwd; - - if (!Utility.isNetworkConnectionSuccess(dbIp.Trim())) - { - MessageBox.Show("网络连接失败!", "提示"); - return; - } - - ds = ctl.Globe.DataManager.OpenOracleDataSource(dbIp + "/" + database, "", "", user, pass); - if (ds == null) - { - MessageBox.Show("数据库连接失败!", "提示", MessageBoxButtons.OK, MessageBoxIcon.Warning); - } - else - { - btnCreateModel.Enabled = true; - } - } - } private void btnClose_Click(object sender, EventArgs e) { diff --git a/Forms/FrmShRK.cs b/Forms/FrmShRK.cs index 0e2e722..f1d83cb 100644 --- a/Forms/FrmShRK.cs +++ b/Forms/FrmShRK.cs @@ -215,6 +215,7 @@ { sourcefeatds = sourcefeat as GSOFeatureDataset; } + if (sourcefeatds == null) return; sourcefeatds.Open(); GSOFeatures sourcefeatures = sourcefeatds.GetAllFeatures(); @@ -251,6 +252,7 @@ { desfeatds = desfeat as GSOFeatureDataset; } + if (desfeatds == null) return; desfeatds.Open(); //向新数据集写入字段 diff --git a/FrmAccessoriesSensor.cs b/FrmAccessoriesSensor.cs index 09fcdf1..2a7a80e 100644 --- a/FrmAccessoriesSensor.cs +++ b/FrmAccessoriesSensor.cs @@ -209,7 +209,7 @@ chart1.Series[0].Points.DataBindXY(dic.Keys, dic.Values); for (int m = 0; m < dic.Values.Count; m++) { - if (chart1.Series[0].Points[m].YValues[0].ToString() != "0") + if (chart1.Series[0].Points[m]!=null&&chart1.Series[0].Points[m].YValues[0].ToString() != "0") { chart1.Series[0].Points[m].Label = chart1.Series[0].Points[m].YValues[0].ToString(); } diff --git a/FrmAccessoriesgather.cs b/FrmAccessoriesgather.cs index 9e331e1..a475d9e 100644 --- a/FrmAccessoriesgather.cs +++ b/FrmAccessoriesgather.cs @@ -338,7 +338,7 @@ chart1.Series[0].Points.DataBindXY(dic.Keys, dic.Values); for (int m = 0; m < dic.Values.Count; m++) { - if (chart1.Series[0].Points[m].YValues[0].ToString() != "0") + if (chart1.Series[0].Points[m]!=null&&chart1.Series[0].Points[m].YValues[0].ToString() != "0") { chart1.Series[0].Points[m].Label = chart1.Series[0].Points[m].YValues[0].ToString(); } diff --git a/FrmAccessoryAnalysis.cs b/FrmAccessoryAnalysis.cs index 71d4579..44d4065 100644 --- a/FrmAccessoryAnalysis.cs +++ b/FrmAccessoryAnalysis.cs @@ -66,39 +66,6 @@ globeControl1.Refresh(); } /// - /// 键盘按键按下事件处理 - /// - /// - /// - private void txtRadius_KeyPress(object sender, KeyPressEventArgs e) - { - TextBox text = sender as TextBox; - if ((e.KeyChar < 48 || e.KeyChar > 57) && (e.KeyChar != 8) && (int)e.KeyChar != 46) - { - e.Handled = true; - } - if ((int)e.KeyChar == 46) //小数点 - { - if (text.Text.Length <= 0) - e.Handled = true; //小数点不能在第一位 - else //处理不规则的小数点 - { - float f; - float oldf; - bool b1 = false, b2 = false; - b1 = float.TryParse(text.Text, out oldf); - b2 = float.TryParse(text.Text + e.KeyChar.ToString(), out f); - if (b2 == false) - { - if (b1 == true) - e.Handled = true; - else - e.Handled = false; - } - } - } - } - /// /// 确定按钮事件处理 /// /// diff --git a/FrmAddValve.cs b/FrmAddValve.cs index 34d2fec..5f405b9 100644 --- a/FrmAddValve.cs +++ b/FrmAddValve.cs @@ -486,56 +486,6 @@ } } - - - - - - - - private void cmbLayer_SelectedIndexChanged(object sender, EventArgs e) - { - GSOLayer layer = globeControl1.Globe.Layers.GetLayerByCaption(selectLayerName); - GSOFeatures features = layer.GetAllFeatures(); - if (features.Length == 0) - return; - - combPath.Items.Clear(); - combZ.Items.Clear(); - combModelName.Items.Clear(); - - for (int i = 0; i < features[0].GetFieldCount(); i++) - { - GeoScene.Data.GSOFieldDefn fielddef = (GeoScene.Data.GSOFieldDefn)(features[0].GetFieldDefn(i)); - combPath.Items.Add(fielddef.Name); - combZ.Items.Add(fielddef.Name); - combModelName.Items.Add(fielddef.Name); - } - combModelName.SelectedItem = "编号"; - combPath.SelectedItem = "模型路径"; - if (combfile.SelectedIndex != -1) - { - - string layerCaption = combfile.SelectedItem.ToString().Trim(); - rukuLayer = globeControl1.Globe.Layers.GetLayerByCaption(layerCaption); - if (rukuLayer != null) - { - combPath.Items.Clear(); - combZ.Items.Clear(); - combModelName.Items.Clear(); - - } - for (int i = 0; i < features[0].GetFieldCount(); i++) - { - GeoScene.Data.GSOFieldDefn fielddef = (GeoScene.Data.GSOFieldDefn)(features[0].GetFieldDefn(i)); - combPath.Items.Add(fielddef.Name); - combZ.Items.Add(fielddef.Name); - combModelName.Items.Add(fielddef.Name); - } - combModelName.SelectedItem = "编号"; - combPath.SelectedItem = "模型路径"; - } - } /// /// 单击选择shp格式文件 /// diff --git a/FrmAddWellShp.cs b/FrmAddWellShp.cs index bb79ec0..a249725 100644 --- a/FrmAddWellShp.cs +++ b/FrmAddWellShp.cs @@ -478,32 +478,6 @@ } } } - - private void cmbLayer_SelectedIndexChanged(object sender, EventArgs e) - { - GSOLayer layer = globeControl1.Globe.Layers.GetLayerByCaption(selectLayerName); - GSOFeatures features = layer.GetAllFeatures(); - if (features.Length == 0) - return; - - combCode.Items.Clear(); - combDeep.Items.Clear(); - combModelName.Items.Clear(); - combAngle.Items.Clear(); - - for (int i = 0; i < features[0].GetFieldCount(); i++) - { - GeoScene.Data.GSOFieldDefn fielddef = (GeoScene.Data.GSOFieldDefn)(features[0].GetFieldDefn(i)); - combCode.Items.Add(fielddef.Name); - combDeep.Items.Add(fielddef.Name); - combModelName.Items.Add(fielddef.Name); - combAngle.Items.Add(fielddef.Name); - } - combCode.SelectedItem = "附属物编码"; - combDeep.SelectedItem = "井深"; - combModelName.SelectedItem = "编号"; - combAngle.SelectedItem = "符号角度"; - } /// /// 单击选择shp格式文件 /// diff --git a/FrmAddYuBiZiShp.cs b/FrmAddYuBiZiShp.cs index b312d51..332f037 100644 --- a/FrmAddYuBiZiShp.cs +++ b/FrmAddYuBiZiShp.cs @@ -383,80 +383,7 @@ } } - private void cmbLayer_SelectedIndexChanged(object sender, EventArgs e) - { - GSOLayer layer = globeControl1.Globe.Layers.GetLayerByCaption(selectLayerName); - GSOFeatures features = layer.GetAllFeatures(); - if (features.Length == 0) - return; - - combCode.Items.Clear(); - combDeep.Items.Clear(); - combModelName.Items.Clear(); - //comboLoad.Items.Clear(); - for (int i = 0; i < features[0].GetFieldCount(); i++) - { - GeoScene.Data.GSOFieldDefn fielddef = (GeoScene.Data.GSOFieldDefn)(features[0].GetFieldDefn(i)); - combCode.Items.Add(fielddef.Name); - combDeep.Items.Add(fielddef.Name); - combModelName.Items.Add(fielddef.Name); - //comboLoad.Items.Add(fielddef.Name); - } - combCode.SelectedItem = "附属物编码"; - combDeep.SelectedItem = "Z坐标"; - combModelName.SelectedItem = "编号"; - //comboLoad.SelectedItem = "模型路径"; - } - - private void buttonXLayerPath_Click(object sender, EventArgs e) - { - OpenFileDialog dlg = new OpenFileDialog(); - dlg.Filter = "*.shp|*.shp"; - dlg.Multiselect = false; - if (dlg.ShowDialog() == DialogResult.OK) - { - GSOLayer layer = globeControl1.Globe.Layers.Add(dlg.FileName); - string txtMessage = valiYBdata(layer); - if (txtMessage != "") - { - button3.Enabled = false; - //textBoxLayer.Text = ""; - combCode.Items.Clear(); - combDeep.Items.Clear(); - combModelName.Items.Clear(); - globeControl1.Globe.Layers.Remove(layer); - FrmValiDataShowErrorMessage showErrorMessage = new FrmValiDataShowErrorMessage(dlg.FileName, txtMessage); - showErrorMessage.ShowDialog(); - return; - } - else - { - button3.Enabled = true; - //textBoxLayer.Text = dlg.FileName; - selectLayerName = layer.Caption; - txtLayerName.Text = layer.Caption; - GSOFeatures features = layer.GetAllFeatures(); - if (features.Length == 0) - return; - - combCode.Items.Clear(); - combDeep.Items.Clear(); - combModelName.Items.Clear(); - for (int i = 0; i < features[0].GetFieldCount(); i++) - { - GeoScene.Data.GSOFieldDefn fielddef = (GeoScene.Data.GSOFieldDefn)(features[0].GetFieldDefn(i)); - combCode.Items.Add(fielddef.Name); - combDeep.Items.Add(fielddef.Name); - combModelName.Items.Add(fielddef.Name); - //comboLoad.Items.Add(fielddef.Name); - } - combCode.SelectedItem = "管点编码"; - combDeep.SelectedItem = "Z坐标"; - combModelName.SelectedItem = "编号"; - } - } - } - + private void FrmAddYuBiZiShp_FormClosing(object sender, FormClosingEventArgs e) { globeControl1.Globe.Refresh(); diff --git a/FrmAllPipelineStatis.cs b/FrmAllPipelineStatis.cs index 6421a26..a6eea29 100644 --- a/FrmAllPipelineStatis.cs +++ b/FrmAllPipelineStatis.cs @@ -84,7 +84,7 @@ chartAllAreaPipeline.Series["管线"].Points.DataBindXY(pipelineLengthAndType.Keys, pipelineLengthAndType.Values); for (int m = 0; m < pipelineLengthAndType.Values.Count; m++) { - if (chartAllAreaPipeline.Series["管线"].Points[m].YValues[0].ToString() != "0") + if (chartAllAreaPipeline.Series["管线"].Points[m]!=null&&chartAllAreaPipeline.Series["管线"].Points[m].YValues[0].ToString() != "0") { chartAllAreaPipeline.Series["管线"].Points[m].Label = chartAllAreaPipeline.Series[0].Points[m].YValues[0].ToString(); } @@ -94,7 +94,7 @@ } catch (Exception ex) { - //LogError.PublishError(ex); + LogHelper.WriteLog(typeof(FrmAllPipelineStatis), ex.Message); } } @@ -147,7 +147,7 @@ } DataTable dt = OledbHelper.QueryTable(sql); - if (dt != null && dt.Rows.Count > 0) + if (dt != null && dt.Rows.Count > 0 && chartAllAreaPipeline.Series["管线"].Points[indexHit]!=null) { dataGridViewX1.DataSource = dt; panel.Visible = true; diff --git a/FrmAllWorkWellStatis.cs b/FrmAllWorkWellStatis.cs index 6fec7af..6af8e4c 100644 --- a/FrmAllWorkWellStatis.cs +++ b/FrmAllWorkWellStatis.cs @@ -52,7 +52,7 @@ chartAllAreaPipeline.Series["井盖"].Points.DataBindXY(workWellLengthAndType.Keys, workWellLengthAndType.Values); for (int m = 0; m < workWellLengthAndType.Values.Count; m++) { - if (chartAllAreaPipeline.Series["井盖"].Points[m].YValues[0].ToString().Trim() != "0") + if (chartAllAreaPipeline.Series["井盖"].Points[m]!=null&&chartAllAreaPipeline.Series["井盖"].Points[m].YValues[0].ToString().Trim() != "0") { chartAllAreaPipeline.Series["井盖"].Points[m].Label = chartAllAreaPipeline.Series[0].Points[m].YValues[0].ToString(); } @@ -60,7 +60,7 @@ } catch (Exception ex) { - //LogError.PublishError(ex); + LogHelper.WriteLog(typeof(FrmAllWorkWellStatis), ex.Message); } } diff --git a/FrmBSQDuoBianXingStatis.cs b/FrmBSQDuoBianXingStatis.cs index e8b7d52..3e889b6 100644 --- a/FrmBSQDuoBianXingStatis.cs +++ b/FrmBSQDuoBianXingStatis.cs @@ -60,7 +60,7 @@ { for (int m = 0; m < bsq1.Values.Count; m++) { - if (chart1.Series["标识器"].Points[m].YValues[0].ToString() != "0") + if (chart1.Series["标识器"].Points[m]!=null&&chart1.Series["标识器"].Points[m].YValues[0].ToString() != "0") { count += Convert.ToInt16(chart1.Series[0].Points[m].YValues[0].ToString()); chart1.Series["标识器"].Points[m].Label = chart1.Series[0].Points[m].YValues[0].ToString(); diff --git a/FrmBSQDuoBianXingStreet.cs b/FrmBSQDuoBianXingStreet.cs index 2005ebb..1db5777 100644 --- a/FrmBSQDuoBianXingStreet.cs +++ b/FrmBSQDuoBianXingStreet.cs @@ -63,7 +63,7 @@ chartStatis.Series[0].Points.DataBindXY(bsq.Keys, bsq.Values); for (int m = 0; m < bsq.Values.Count; m++) { - if (chartStatis.Series[0].Points[m].YValues[0].ToString().Trim() != "0") + if (chartStatis.Series[0].Points[m]!=null&&chartStatis.Series[0].Points[m].YValues[0].ToString().Trim() != "0") { count += Convert.ToInt16(chartStatis.Series[0].Points[m].YValues[0].ToString()); chartStatis.Series[0].Points[m].Label = chartStatis.Series[0].Points[m].YValues[0].ToString(); diff --git a/FrmBSQStatis.cs b/FrmBSQStatis.cs index 390a55c..4aa0ee6 100644 --- a/FrmBSQStatis.cs +++ b/FrmBSQStatis.cs @@ -95,6 +95,8 @@ } } } + + dr.Close(); conn.Close(); for (int i = 0; i < typeLists.Count; i++) { @@ -123,7 +125,7 @@ chartStatis.Series[0].Points.DataBindXY(bsq.Keys, bsq.Values); for (int m = 0; m < bsq.Values.Count; m++) { - if (chartStatis.Series[0].Points[m].YValues[0].ToString().Trim() != "0") + if (chartStatis.Series[0].Points[m]!=null&&chartStatis.Series[0].Points[m].YValues[0].ToString().Trim() != "0") { //count += Convert.ToInt16(chartStatis.Series[0].Points[m].YValues[0].ToString()); chartStatis.Series[0].Points[m].Label = chartStatis.Series[0].Points[m].YValues[0].ToString(); diff --git a/FrmBSQStreet.cs b/FrmBSQStreet.cs index 9d88adb..7fbacad 100644 --- a/FrmBSQStreet.cs +++ b/FrmBSQStreet.cs @@ -44,7 +44,7 @@ chartStatis.Series[0].Points.DataBindXY(bsq.Keys, bsq.Values); for (int m = 0; m < bsq.Values.Count; m++) { - if (chartStatis.Series[0].Points[m].YValues[0].ToString().Trim() != "0") + if (chartStatis.Series[0].Points[m]!=null&&chartStatis.Series[0].Points[m].YValues[0].ToString().Trim() != "0") { count += Convert.ToInt16(chartStatis.Series[0].Points[m].YValues[0].ToString()); chartStatis.Series[0].Points[m].Label = chartStatis.Series[0].Points[m].YValues[0].ToString(); diff --git a/FrmBoosterValvers.cs b/FrmBoosterValvers.cs index 5061efc..df9b62b 100644 --- a/FrmBoosterValvers.cs +++ b/FrmBoosterValvers.cs @@ -236,199 +236,6 @@ count = 0; } } - /// - /// 添加火苗 - /// - /// - /// - /// - /// - private GSOFeature AddFire(double x,double y,double z) - { - // 烟火示例 - - string strResPath = Application.StartupPath + "/Resource"; - - // 烟火粒子示例,由三个发射器构成 - GSOGeoParticle geoParticle = new GSOGeoParticle(); - geoParticle.SetPosition(x, y, z); // 添加到这个经纬度位置 - geoParticle.AltitudeMode = EnumAltitudeMode.RelativeToGround; - - GSORingParticleEmitter emitter = new GSORingParticleEmitter(); - emitter.TexturePath = strResPath + "/ParticleImage/flare.png"; - - emitter.SetSizeFix(1, 1); - emitter.VelFix = 1; - emitter.VelRnd = 5; - - emitter.AngleXYFix = 0; - emitter.AngleXYRnd = 180; - - emitter.AngleXZFix = 90; - emitter.AngleXZRnd = 0; - - emitter.LifeFix = 0.5f; - emitter.LifeRnd = 0.0f; - - emitter.RotFix = 0; - emitter.RotRnd = 0; - - emitter.RotVelFix = 0; - emitter.RotVelRnd = 0; - - emitter.EmitPerSec = 100; - - // 采用线性插值生成粒子的初始颜色 - emitter.ColorRndStart = Color.White; - emitter.ColorRndEnd = Color.Red; - - - GSOColorParticleEffector effector2 = new GSOColorParticleEffector(); - effector2.SetColorChanged(0, -1, -1, 0); - effector2.StartTime = 0.0f; - effector2.EndTime = -1.0f; - emitter.AddEffector(effector2); - - // 将三个发射器添加到粒子对象中 - geoParticle.AddEmitter(emitter); - - geoParticle.Play(); - - GSOFeature feature = new GSOFeature(); - - feature.Geometry = geoParticle; - - globeControl1.Globe.MemoryLayer.AddFeature(feature); - - - return feature; - } - - /// - /// 添加喷泉 - /// - /// - private GSOFeature AddFountain() - { - string strResPath = Application.StartupPath + "/Resource"; - - GSOGeoParticle geoParticle = new GSOGeoParticle(); - geoParticle.SetPosition(116.314, 39.84, 0); // 添加到这个经纬度位置 - - GSOPointParticleEmitter emitter = new GSOPointParticleEmitter(); - emitter.TexturePath = strResPath + "/ParticleImage/test.png"; - - emitter.SetSizeFix(0.5f, 2); - emitter.VelFix = 10; - emitter.VelRnd = 2; - - emitter.GravityAcc = 9.8f; - emitter.AngleXYFix = 0; - emitter.AngleXYRnd = 180; - - emitter.AngleXZFix = 88; - emitter.AngleXZRnd = 2; - - //emitter.InnerRadius = 0; - // emitter.OuterRadius = 0.03f; - - emitter.LifeFix = 5.0f; - emitter.LifeRnd = 1.0f; - - emitter.RotFix = 0; - emitter.RotRnd = 0; - - emitter.RotVelFix = 0; - emitter.RotVelRnd = 0; - - emitter.EmitPerSec = 1000; - emitter.ColorRndStart = Color.FromArgb(33, 255, 255, 255); - emitter.ColorRndEnd = Color.FromArgb(11, 255, 255, 255); - emitter.IsLumAdded = false; - - // 将三个发射器添加到粒子对象中 - geoParticle.AddEmitter(emitter); - - geoParticle.Play(); - GSOFeature feature = new GSOFeature(); - - feature.Geometry = geoParticle; - - //globeControl1.Globe.MemoryLayer.AddFeature(feature); - globeControl1.Globe.FlyToFeature(feature); - - return feature; - } - - /// - /// 添加水柱 - /// - /// - private GSOFeature AddWaterLine() - { - string strResPath = Application.StartupPath + "/Resource"; - - GSOGeoParticle geoParticle = new GSOGeoParticle(); - geoParticle.SetPosition(116.308, 39.84, 0); // 添加到这个经纬度位置 - - GSOPointParticleEmitter emitter = new GSOPointParticleEmitter(); - - emitter.TexturePath = strResPath + "/ParticleImage/drop3.png"; - - geoParticle.TimerInterval = 1; - - emitter.SetSizeFix(2.0f, 2.0f); - - emitter.VelFix = 50; - emitter.VelRnd = 2; - - // emitter.IsLumAdded = false; - - emitter.GravityAcc = 9.8f; - emitter.AngleXYFix = 0; - emitter.AngleXYRnd = 2; - - emitter.AngleXZFix = 60; - emitter.AngleXZRnd = 2; - - //emitter.InnerRadius = 0; - // emitter.OuterRadius = 0.1f; - - emitter.LifeFix = 5.0f; - emitter.LifeRnd = 1.0f; - - emitter.RotFix = 0; - emitter.RotRnd = 0; - - emitter.RotVelFix = 0; - emitter.RotVelRnd = 0; - - emitter.EmitPerSec = 1500; - - emitter.ColorRndStart = Color.FromArgb(100, 222, 222, 222); - emitter.ColorRndEnd = Color.FromArgb(50, 222, 222, 222); - - /* - - GSOScaleParticleEffector effector1 = new GSOScaleParticleEffector(); - effector1.SetScale(0.2f, 0.2f); - effector1.StartTime = 0; - effector1.EndTime = -1; // 负数表示整个粒子生命结束 - emitter.AddEffector(effector1); - */ - - // 将三个发射器添加到粒子对象中 - geoParticle.AddEmitter(emitter); - - geoParticle.Play(); - GSOFeature feature = new GSOFeature(); - - feature.Geometry = geoParticle; - - //globeControl1.Globe.MemoryLayer.AddFeature(feature); - globeControl1.Globe.FlyToFeature(feature); - - return feature; - } + } } diff --git a/FrmBufferAnalysis.cs b/FrmBufferAnalysis.cs index f711133..db8ca59 100644 --- a/FrmBufferAnalysis.cs +++ b/FrmBufferAnalysis.cs @@ -123,39 +123,6 @@ } } /// - /// 半径文本框的键盘按键按下事件处理 - /// - /// - /// - private void txtRadius_KeyPress(object sender, KeyPressEventArgs e) - { - TextBox text = sender as TextBox; - if ((e.KeyChar < 48 || e.KeyChar > 57) && (e.KeyChar != 8) && (int)e.KeyChar != 46) - { - e.Handled = true; - } - if ((int)e.KeyChar == 46) //小数点 - { - if (text.Text.Length <= 0) - e.Handled = true; //小数点不能在第一位 - else //处理不规则的小数点 - { - float f; - float oldf; - bool b1 = false, b2 = false; - b1 = float.TryParse(text.Text, out oldf); - b2 = float.TryParse(text.Text + e.KeyChar.ToString(), out f); - if (b2 == false) - { - if (b1 == true) - e.Handled = true; - else - e.Handled = false; - } - } - } - } - /// /// 窗体关闭事件处理 /// /// diff --git a/FrmBufferAnalysisBSQ.cs b/FrmBufferAnalysisBSQ.cs index 24a96ca..f54208f 100644 --- a/FrmBufferAnalysisBSQ.cs +++ b/FrmBufferAnalysisBSQ.cs @@ -137,35 +137,7 @@ } } - private void txtRadius_KeyPress(object sender, KeyPressEventArgs e) - { - TextBox text = sender as TextBox; - if ((e.KeyChar < 48 || e.KeyChar > 57) && (e.KeyChar != 8) && (int)e.KeyChar != 46) - { - e.Handled = true; - } - if ((int)e.KeyChar == 46) //小数点 - { - if (text.Text.Length <= 0) - e.Handled = true; //小数点不能在第一位 - else //处理不规则的小数点 - { - float f; - float oldf; - bool b1 = false, b2 = false; - b1 = float.TryParse(text.Text, out oldf); - b2 = float.TryParse(text.Text + e.KeyChar.ToString(), out f); - if (b2 == false) - { - if (b1 == true) - e.Handled = true; - else - e.Handled = false; - } - } - } - } - + private void FrmBufferAnalysis_FormClosing(object sender, FormClosingEventArgs e) { //Form1.y = 0; @@ -316,27 +288,6 @@ } } - private void FlyToMenu_Click(object sender, EventArgs e) - { - if (m_feature != null) - { - if (m_feature.Geometry != null && m_feature.Geometry.Type == EnumGeometryType.GeoPolyline3D) - { - GSOGeoPolyline3D line = m_feature.Geometry as GSOGeoPolyline3D; - double length = line.GetSpaceLength(true, 6378137); - GSOGeoPolyline3D lineLine = line.GetSegment(0, length / 2); - GSOPoint3d point3d = lineLine[lineLine.PartCount - 1][lineLine[lineLine.PartCount - 1].Count - 1]; - - globeControl1.Globe.FlyToPosition(point3d, EnumAltitudeMode.Absolute, 0, 45, 5); - } - else - { - globeControl1.Globe.FlyToFeature(m_feature, 0, 45, 3); - } - LightMenu_Click(sender, e); - } - } - private void LightMenu_Click(object sender, EventArgs e) { flashflag = "single"; diff --git a/FrmDataBaseOpt.cs b/FrmDataBaseOpt.cs index b0c4b5d..8d7b69d 100644 --- a/FrmDataBaseOpt.cs +++ b/FrmDataBaseOpt.cs @@ -362,6 +362,7 @@ dbCombor.Items.Add(dblist[i].title); } } + /* /// /// 从配置文件读取数据库参数配置 /// @@ -428,6 +429,8 @@ } } + * */ + /* /// /// 向配置文件写入连接数据库的参数配置 /// @@ -485,6 +488,7 @@ MessageBox.Show(exp.ToString()); } } + * */ /// /// /// diff --git a/FrmDatabaseParaSetting.cs b/FrmDatabaseParaSetting.cs index a6fea46..63b596b 100644 --- a/FrmDatabaseParaSetting.cs +++ b/FrmDatabaseParaSetting.cs @@ -152,6 +152,7 @@ this.DialogResult = DialogResult.OK; this.Close(); } + /* /// /// 从配置文件读取数据库连接参数配置 /// @@ -218,6 +219,8 @@ } } + * */ + /* /// /// 向配置文件写入数据库参数配置 /// @@ -276,7 +279,7 @@ MessageBox.Show(ex.ToString()); } } - + */ /// /// 取消按钮事件处理 /// diff --git a/FrmDatabaseParaSetting2.cs b/FrmDatabaseParaSetting2.cs index 932d05e..96a87d5 100644 --- a/FrmDatabaseParaSetting2.cs +++ b/FrmDatabaseParaSetting2.cs @@ -148,6 +148,7 @@ this.DialogResult = DialogResult.OK; this.Close(); } + /* /// /// 从配置文件读取数据库连接参数配置 /// @@ -214,6 +215,8 @@ } } + * */ + /* /// /// 向配置文件写入数据库参数配置 /// @@ -272,7 +275,7 @@ MessageBox.Show(exp.ToString()); } } - + */ /// /// 取消按钮事件处理 /// diff --git a/FrmDiameterQuery.cs b/FrmDiameterQuery.cs index 68c948b..9a5215b 100644 --- a/FrmDiameterQuery.cs +++ b/FrmDiameterQuery.cs @@ -77,18 +77,7 @@ isBetween = true; } } - /// - /// 键盘按键按下事件处理 - /// - /// - /// - private void textBoxX1_KeyPress(object sender, KeyPressEventArgs e) - { - if ((e.KeyChar < 48 || e.KeyChar > 57) && e.KeyChar != 8) - { - e.Handled = true;//屏蔽 - } - } + bool isBetween = false; /// diff --git a/FrmDocumentEdit.cs b/FrmDocumentEdit.cs index aab2d31..e78a7ff 100644 --- a/FrmDocumentEdit.cs +++ b/FrmDocumentEdit.cs @@ -256,121 +256,6 @@ } - // - /// 将本地文件上传到指定的服务器(HttpWebRequest方法) - /// - /// 文件上传到的服务器 - /// 要上传的本地文件(全路径) - /// 文件上传后的名称 - /// 上传进度条 - /// 成功返回1,失败返回0 - private int Upload_Request(string address, string fileNamePath, string saveName, ProgressBar progressBar) - { - int returnValue = 0; - // 要上传的文件 - FileStream fs = new FileStream(fileNamePath, FileMode.Open, FileAccess.Read); - BinaryReader r = new BinaryReader(fs); - //时间戳 - string strBoundary = "----------" + DateTime.Now.Ticks.ToString("x"); - byte[] boundaryBytes = Encoding.ASCII.GetBytes("/r/n--" + strBoundary + "/r/n"); - //请求头部信息 - StringBuilder sb = new StringBuilder(); - sb.Append("--"); - sb.Append(strBoundary); - sb.Append("\r\n"); - sb.Append("Content-Disposition: form-data; name=\""); - sb.Append("file"); - sb.Append("\"; filename=\""); - sb.Append(saveName); - sb.Append("\""); - sb.Append("\r\n"); - sb.Append("Content-Type: "); - sb.Append("application/octet-stream"); - sb.Append("\r\n"); - sb.Append("\r\n"); - string strPostHeader = sb.ToString(); - byte[] postHeaderBytes = Encoding.UTF8.GetBytes(strPostHeader); - // 根据uri创建HttpWebRequest对象 - HttpWebRequest httpReq = (HttpWebRequest)WebRequest.Create(new Uri(address)); - httpReq.Method = "POST"; - //对发送的数据不使用缓存 - httpReq.AllowWriteStreamBuffering = false; - //设置获得响应的超时时间(300秒) - httpReq.Timeout = 300000; - httpReq.ContentType = "multipart/form-data; boundary=" + strBoundary; - long length = fs.Length + postHeaderBytes.Length + boundaryBytes.Length; - long fileLength = fs.Length; - httpReq.ContentLength = length; - try - { - progressBar.Maximum = int.MaxValue; - progressBar.Minimum = 0; - progressBar.Value = 0; - //每次上传4k - int bufferLength = 4096; - byte[] buffer = new byte[bufferLength]; - //已上传的字节数 - long offset = 0; - //开始上传时间 - DateTime startTime = DateTime.Now; - int size = r.Read(buffer, 0, bufferLength); - Stream postStream = httpReq.GetRequestStream(); - //发送请求头部消息 - postStream.Write(postHeaderBytes, 0, postHeaderBytes.Length); - while (size > 0) - { - postStream.Write(buffer, 0, size); - offset += size; - progressBar.Value = (int)(offset * (int.MaxValue / length)); - TimeSpan span = DateTime.Now - startTime; - double second = span.TotalSeconds; - //lblTime.Text = "已用时:" + second.ToString("F2") + "秒"; - //if (second > 0.001) - //{ - // lblSpeed.Text = " 平均速度:" + (offset / 1024 / second).ToString("0.00") + "KB/秒"; - //} - //else - //{ - // lblSpeed.Text = " 正在连接…"; - //} - //lblState.Text = "已上传:" + (offset * 100.0 / length).ToString("F2") + "%"; - //lblSize.Text = (offset / 1048576.0).ToString("F2") + "M/" + (fileLength / 1048576.0).ToString("F2") + "M"; - Application.DoEvents(); - size = r.Read(buffer, 0, bufferLength); - } - //添加尾部的时间戳 - postStream.Write(boundaryBytes, 0, boundaryBytes.Length); - postStream.Close(); - //获取服务器端的响应 - WebResponse webRespon = httpReq.GetResponse(); - Stream s = webRespon.GetResponseStream(); - StreamReader sr = new StreamReader(s); - //读取服务器端返回的消息 - String sReturnString = sr.ReadLine(); - s.Close(); - sr.Close(); - if (sReturnString == "Success") - { - returnValue = 1; - } - else if (sReturnString == "Error") - { - returnValue = 0; - } - } - catch(Exception ex) - { - returnValue = 0; - string str = ex.ToString(); - } - finally - { - fs.Close(); - r.Close(); - } - return returnValue; - } - private void btn_file_Click(object sender, EventArgs e) { OpenFileDialog dlg = new OpenFileDialog(); diff --git a/FrmExportCADS.cs b/FrmExportCADS.cs index 98772ea..59629dd 100644 --- a/FrmExportCADS.cs +++ b/FrmExportCADS.cs @@ -108,65 +108,6 @@ MessageBox.Show("请选中要导出的图层!", "提示", MessageBoxButtons.OK, MessageBoxIcon.Warning); } } - private Boolean MerageToFile(GSOFeatures features, String strDestFile, String strProj4)//图层追加 - { - if (features == null) - { - return false; - } - Boolean bSuccess = false; - - string strDir = GSOUtility.GetFileDir(strDestFile); - string strLPRJFile = GSOUtility.ChangeExt(strDestFile, ".lprj"); - string strExt = GSOUtility.GetFileExt(strDestFile); - - // 如果投影文件存在,投影以投影文件为准 - if (File.Exists(strLPRJFile)) - { - // 如果是dxf,则这样处理 - if (strExt.ToLower() == ".dxf") - { - string strTempSrcFile = strDir + "srcFeatures_dxftmp" + strExt; - globeControl1.Globe.DataManager.SaveFeatureData(features, strTempSrcFile, strLPRJFile, 4); - bSuccess = GSOUtility.MergeTwoDXFFileFeatures(strDestFile, strTempSrcFile); - File.Delete(strTempSrcFile); - } - else - { - GSOFeatures srcFeatures = globeControl1.Globe.DataManager.ReadFeatureData(strDestFile); - int nCount = features.Length; - int i = 0; - for (i = 0; i < nCount; i++) - { - srcFeatures.Add(features[i]); - } - bSuccess = globeControl1.Globe.DataManager.SaveFeatureData(srcFeatures, strDestFile, strLPRJFile, 4); - } - } - else - { - // 如果是dxf,则这样处理 - if (strExt.ToLower() == ".dxf") - { - string strTempSrcFile = strDir + "srcFeatures_dxftmp" + strExt; - globeControl1.Globe.DataManager.SaveFeatureData(features, strTempSrcFile, strProj4, 0); - bSuccess = GSOUtility.MergeTwoDXFFileFeatures(strDestFile, strTempSrcFile); - File.Delete(strTempSrcFile); - } - else - { - GSOFeatures srcFeatures = globeControl1.Globe.DataManager.ReadFeatureData(strDestFile); - int nCount = features.Length; - int i = 0; - for (i = 0; i < nCount; i++) - { - srcFeatures.Add(features[i]); - } - bSuccess = globeControl1.Globe.DataManager.SaveFeatureData(srcFeatures, strDestFile, strProj4, 0); - } - } - return bSuccess; - } /// /// 关闭按钮事件处理 /// diff --git a/FrmHDMAnalysis3.cs b/FrmHDMAnalysis3.cs index 4f73af6..2ada735 100644 --- a/FrmHDMAnalysis3.cs +++ b/FrmHDMAnalysis3.cs @@ -436,29 +436,6 @@ } layerTemp.RemoveAllFeature(); } - private void Export(GSOPoint3d _pnt, double r) - { - GSOPoint3ds pnts = new GSOPoint3ds(); - GSOPoint3d pnt = new GSOPoint3d(); - pnt.X = _pnt.X; - pnt.Y = _pnt.Y; - pnt.Z = _pnt.Z; - pnts.Add(pnt); - pnt.X = _pnt.X; - pnt.Y = _pnt.Y - 0.0000000005; - pnt.Z = _pnt.Z; - pnts.Add(pnt); - GSOGeoPolyline3D line = new GSOGeoPolyline3D(); - line.AddPart(pnts); - GSOGeoPolygon3D polygon = line.CreateBuffer(r * 2, true, 5, true, false); - GSOPoint3ds points = polygon[0]; - GSOGeoPolyline3D newLine = new GSOGeoPolyline3D(); - newLine.AddPart(points); - newLine.AltitudeMode = EnumAltitudeMode.RelativeToGround; - GSOFeature newFeature = new GSOFeature(); - newFeature.Geometry = newLine; - globeControl1.Globe.MemoryLayer.AddFeature(newFeature); - } private void ExportCAD(double a, double b, double r) { diff --git a/FrmHotFuncStat.cs b/FrmHotFuncStat.cs index c980f34..2eb1476 100644 --- a/FrmHotFuncStat.cs +++ b/FrmHotFuncStat.cs @@ -421,13 +421,6 @@ } } - private void HFS_Pderive_Click(object sender, EventArgs e) - { - if (TV_Files.SelectedNode != null) - { - HFSClass.GuideEdit_form("G", TV_Files, int.Parse(((ToolStripMenuItem)sender).Tag.ToString())); - } - } private void 导入ToolStripMenuItem_Click(object sender, EventArgs e) { @@ -530,22 +523,8 @@ } } - private void 导出ToolStripMenuItem1_Click(object sender, EventArgs e) - { - 导出ToolStripMenuItem2_Click(sender, e); - } + - private void TV_HFSSrchRslt_AfterCollapse(object sender, TreeViewEventArgs e) - { - e.Node.ImageIndex = 0; - } - - private void TV_HFSSrchRslt_AfterExpand(object sender, TreeViewEventArgs e) - { - HFSClass.ADD_TreeNode(TV_Files, e.Node); - e.Node.ImageIndex = 1; - } - private void 导出ToolStripMenuItem1_Click_1(object sender, EventArgs e) { if ((TV_HFSSrchRslt.SelectedNode != null) && (TV_HFSSrchRslt.SelectedNode.Parent != null)) diff --git a/FrmLayerControl.cs b/FrmLayerControl.cs index e7917c3..28fa14d 100644 --- a/FrmLayerControl.cs +++ b/FrmLayerControl.cs @@ -312,26 +312,7 @@ layerManagerNode.Expand(); terrainManagerNode.Expand(); } - /// - /// 刷新节点树 - /// - private void RefreshDataTree() - { - layerTree2.Nodes[0].Nodes.Clear(); - Int32 nCount = globeControl2.Globe.Layers.Count; - Int32 i = 0; - for (i = 0; i < nCount; i++) - { - GSODataset dataSpace = globeControl2.Globe.Layers[i].Dataset; - TreeNode node = new TreeNode(); - node.Text = dataSpace.Name; - node.ImageIndex = 0; - node.SelectedImageIndex = 0; - node.Checked = true; - node.Tag = dataSpace; - layerTree2.Nodes[0].Nodes.Add(node); - } - } + /// /// 目标图层按钮事件处理 /// @@ -494,22 +475,8 @@ } } } - /// - /// 改变指定节点的选中状态 - /// - /// - /// - private void CheckTreeNode(TreeNode node, Boolean bChecked) - { - CheckChildTreeNode(node, bChecked); - // 对于kml图层,如果当前处理的节点是true,那么要把所有的祖宗节点置为true - // 只有所有节点都未false,那么这个节点才为false - // CheckFatherTreeNode(node, bChecked); - globeControl1.Globe.Refresh(); - globeControl2.Globe.Refresh(); - - } + private void CheckChildTreeNode(TreeNode node, Boolean bChecked) { if (node == null) @@ -696,59 +663,7 @@ //} //CheckControl(e); } - /// - /// 树节点选中方法 - /// - /// - private void CheckControl(TreeViewEventArgs e) - { - if (e.Action != TreeViewAction.Unknown) - { - if (e.Node != null && !Convert.IsDBNull(e.Node)) - { - CheckParentNode(e.Node); - if (e.Node.Nodes.Count > 0) - { - CheckAllChildNodes(e.Node, e.Node.Checked); - } - } - } - } - /// - /// 改变所有子节点的状态 - /// - /// - /// - private void CheckAllChildNodes(TreeNode pn, bool IsChecked) - { - foreach (TreeNode tn in pn.Nodes) - { - tn.Checked = IsChecked; - if (tn.Tag.ToString().Contains("|")) - { - string nodeTag = tn.Tag.ToString().Split('|')[1]; - GSOLayer layer = globeControl1.Globe.Layers.GetLayerByCaption(nodeTag); - if (layer != null) - { - layer.Visible = IsChecked; - globeControl1.Globe.Refresh(); - } - } - if (tn.Tag is GSOFeature) - { - if (tn.Nodes.Count == 0) - { - GSOFeature feat = tn.Tag as GSOFeature; - feat.Visible = IsChecked; - globeControl1.Globe.Refresh(); - } - } - if (tn.Nodes.Count > 0) - { - CheckAllChildNodes(tn, IsChecked); - } - } - } + /// /// 改变父节点的选中状态,此处为所有子节点不选中时才取消父节点选中,可以根据需要修改 /// diff --git a/FrmLogin.cs b/FrmLogin.cs index 320fdd5..2afe46e 100644 --- a/FrmLogin.cs +++ b/FrmLogin.cs @@ -59,70 +59,6 @@ textBoxPassWord.Clear(); } } - - /// - /// 验证端口号 - /// - /// - private bool ValiPort() - { - Ping p = new Ping();//创建Ping对象p - PingReply pr = p.Send(Utility.localicenseserverip);//向指定IP或者主机名的计算机发送ICMP协议的ping数据包 - if (pr.Status == IPStatus.Success)//如果ping成功 - { - try - { - TcpClient tcpc = new TcpClient(Utility.localicenseserverip, Utility.localicenseserverport);//对IP地址为"192.168.0.105"的计算机的1500端口提出连接申请 - tcpc.Close(); - return true; - } - catch (Exception ex) - { - MessageBox.Show("端口连接错误!" + ex.Message); - return false; - } - } - else - { - int times = 0;//重新连接次数; - int count = 2;//设置尝试次数 - while (times < count) - { - //Thread.Sleep(1000);//等待时间(方便测试的话,你可以改为1000) - pr = p.Send(Utility.localicenseserverip); - - if (pr.Status == IPStatus.Success) - { - try - { - TcpClient tcpc = new TcpClient(Utility.localicenseserverip, Utility.localicenseserverport);//对IP地址为"192.168.0.105"的计算机的1500端口提出连接申请 - tcpc.Close(); - return true; - } - catch (Exception ex) - { - MessageBox.Show("端口连接错误!" + ex.Message); - return false; - } - } - else - { - times++; - if (times < count) - { - continue; - } - else - { - MessageBox.Show("重新尝试连接失败"); - return false; - } - } - - } - return false; - } - } /// /// 验证用户名、密码 /// diff --git a/FrmMetadata.cs b/FrmMetadata.cs index 886f65a..0365372 100644 --- a/FrmMetadata.cs +++ b/FrmMetadata.cs @@ -27,11 +27,7 @@ InitializeComponent(); loadTreeView(layerTree); } - private void FrmMetadata_Load(object sender, EventArgs e) - { - //this.ntLblC.Text = "nn"; - // loadTreeView(layerTree); - } + private void loadTreeView(TreeView tv)//构建图层树 { try diff --git a/FrmMetadataStat.cs b/FrmMetadataStat.cs index 790658a..e7696c6 100644 --- a/FrmMetadataStat.cs +++ b/FrmMetadataStat.cs @@ -197,9 +197,5 @@ } } - private void buttonX1_Click(object sender, EventArgs e) - { - drawChart(); - } } } diff --git a/FrmPatrolerManager.cs b/FrmPatrolerManager.cs index 37f8ffd..9e66aeb 100644 --- a/FrmPatrolerManager.cs +++ b/FrmPatrolerManager.cs @@ -109,82 +109,8 @@ this.winGridViewPager1.AllToExport = table; } - /// - /// 编辑 - /// - /// - /// - private void winGridViewPager1_OnEditSelected(object sender, EventArgs e) - { - - DataGridView grid = sender as DataGridView; - if (grid != null && grid.SelectedRows.Count>0) - { - DataGridViewRow row = grid.SelectedRows[0]; - try - { - long dbid = long.Parse(row.Cells["编号"].Value.ToString()); - String name = row.Cells["姓名"].Value.ToString(); - String sex = row.Cells["性别"].Value.ToString(); - String age = row.Cells["年龄"].Value.ToString(); - string phone = row.Cells["电话"].Value.ToString(); - age = String.IsNullOrEmpty(age.ToString().Trim()) ? "1" : age.ToString().Trim(); - FrmPatrolerEdit frm = new FrmPatrolerEdit(dbid.ToString(), name, age, sex, phone); - frm.reloadGrid += new ReloadPatrolerGrid(LoadData); - frm.ShowDialog(); - winGridViewPager1.Refresh(); - } - catch (Exception ex) - { - MessageBox.Show("编辑失败:" + ex.ToString(), "错误", MessageBoxButtons.OK, MessageBoxIcon.Error); - } - } - else - { - MessageBox.Show("没有选择记录", "提示"); - } - - } - - /// - /// 删除 - /// - /// - /// - private void winGridViewPager1_OnDeleteSelected(object sender, EventArgs e) - { - DataGridView grid = sender as DataGridView; - if (grid != null && grid.SelectedRows.Count > 0) - { - DataGridViewRow row = grid.SelectedRows[0]; - long dbid = long.Parse(row.Cells["编号"].Value.ToString()); - try - { - string state = row.Cells["状态"].Value.ToString(); - if ("在线".Equals(state)) - { - if (MessageBox.Show("确定注销?", "确认", MessageBoxButtons.YesNo, MessageBoxIcon.Question) == DialogResult.Yes) - { - String sql = "update patroler t set t.accountstate='LEAVER' where t.dbid=" + dbid; - OracleUtils.ExecuteNonQuery(OracleUtils.ConnectionString, CommandType.Text, sql); - } - } - else { - MessageBox.Show("人员不在线,无法注销", "信息"); - } - } - catch (Exception ex) - { - MessageBox.Show("人员注销失败:" + ex.ToString(), "错误", MessageBoxButtons.OK, MessageBoxIcon.Error); - } - } - else - { - MessageBox.Show("没有选择记录", "提示"); - } - } - - + + private void LoadData() { int pageIndex = winGridViewPager1.PagerInfo.CurrenetPageIndex; diff --git a/FrmRoadHDM.cs b/FrmRoadHDM.cs index e765313..e871dd5 100644 --- a/FrmRoadHDM.cs +++ b/FrmRoadHDM.cs @@ -333,31 +333,6 @@ this.Cursor = Cursors.Default; } } - - private void Export(GSOPoint3d _pnt, double r) - { - GSOPoint3ds pnts = new GSOPoint3ds(); - GSOPoint3d pnt = new GSOPoint3d(); - pnt.X = _pnt.X; - pnt.Y = _pnt.Y; - pnt.Z = _pnt.Z; - pnts.Add(pnt); - pnt.X = _pnt.X; - pnt.Y = _pnt.Y - 0.0000000005; - pnt.Z = _pnt.Z; - pnts.Add(pnt); - GSOGeoPolyline3D line = new GSOGeoPolyline3D(); - line.AddPart(pnts); - GSOGeoPolygon3D polygon = line.CreateBuffer(r * 2, true, 5, true, false); - GSOPoint3ds points = polygon[0]; - GSOGeoPolyline3D newLine = new GSOGeoPolyline3D(); - newLine.AddPart(points); - newLine.AltitudeMode = EnumAltitudeMode.RelativeToGround; - GSOFeature newFeature = new GSOFeature(); - newFeature.Geometry = newLine; - globeControl1.Globe.MemoryLayer.AddFeature(newFeature); - } - private void ExportCAD(double a, double b, double r) { GSOPoint3ds pnts = new GSOPoint3ds(); diff --git a/FrmUserAdd.cs b/FrmUserAdd.cs index c612ab4..f826427 100644 --- a/FrmUserAdd.cs +++ b/FrmUserAdd.cs @@ -231,24 +231,6 @@ //cbxRegion.SelectedIndexChanged += new EventHandler(cbxRegion_SelectedIndexChanged); } } - /// - /// 下拉框选中项改变事件处理 - /// - /// - /// - private void cbxRegion_SelectedIndexChanged(object sender, EventArgs e) - { - string sql = ""; - //string sql = "select casic_role.\"name\" from casic_role join casic_regionrole on casic_role.\"id\"=casic_regionrole.\"rid\" where casic_regionrole.\"reid\"=" + region[cbxRegion.SelectedItem.ToString().Trim()]; - DataTable dt = OledbHelper.QueryTable(sql); - if (dt != null && dt.Rows.Count > 0) - { - comboBoxExRegionRole.Items.Clear(); - for (int i = 0; i < dt.Rows.Count; i++) - { - comboBoxExRegionRole.Items.Add(dt.Rows[i][0].ToString().Trim());//部门角色 - } - } - } + } } diff --git a/FrmUserManager.cs b/FrmUserManager.cs index 571f0f0..ae254bc 100644 --- a/FrmUserManager.cs +++ b/FrmUserManager.cs @@ -81,11 +81,6 @@ } } } - //创建新用户 - private void buttonX2_Click(object sender, EventArgs e) - { - FrmUserAdd frm = new FrmUserAdd(-1); - frm.ShowDialog(); - } + } } diff --git a/FrmValveStatistics.cs b/FrmValveStatistics.cs index 545d56c..dd76777 100644 --- a/FrmValveStatistics.cs +++ b/FrmValveStatistics.cs @@ -54,7 +54,7 @@ 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") + if (chaFamenStatis.Series["阀门"].Points[m]!=null&&chaFamenStatis.Series["阀门"].Points[m].YValues[0].ToString() != "0") { chaFamenStatis.Series["阀门"].Points[m].Label = chaFamenStatis.Series[0].Points[m].YValues[0].ToString(); } diff --git a/Frm_password_reset.cs b/Frm_password_reset.cs index 7b51039..b9e5dc3 100644 --- a/Frm_password_reset.cs +++ b/Frm_password_reset.cs @@ -41,6 +41,7 @@ } catch (Exception ex) { + LogHelper.WriteLog(typeof(Frm_password_reset), ex.Message); } } private void initCombox() diff --git a/FrmpipeDeepstatis.cs b/FrmpipeDeepstatis.cs index e156db4..1a84d6c 100644 --- a/FrmpipeDeepstatis.cs +++ b/FrmpipeDeepstatis.cs @@ -307,7 +307,7 @@ chart1.Series[j].Points.DataBindXY(dic1.Keys, dic1.Values); for (int m = 0; m < dic1.Values.Count; m++) { - if (chart1.Series[j].Points[m].YValues[0].ToString() != "0") + if (chart1.Series[j].Points[m]!=null&&chart1.Series[j].Points[m].YValues[0].ToString() != "0") { chart1.Series[j].Points[m].Label = chart1.Series[j].Points[m].YValues[0].ToString(); diff --git a/FrmpipeDiametergather.cs b/FrmpipeDiametergather.cs index 30674de..057b09d 100644 --- a/FrmpipeDiametergather.cs +++ b/FrmpipeDiametergather.cs @@ -263,6 +263,7 @@ if (layer != null && layer is GSOFeatureLayer) { GSOFeatureLayer flayer = layer as GSOFeatureLayer; + if (layer == null) return; GSOFeatures features = flayer.GetAllFeatures(); if (features.Length > 0) { diff --git a/FrmpipeMaterialGather.cs b/FrmpipeMaterialGather.cs index c133ec3..398b884 100644 --- a/FrmpipeMaterialGather.cs +++ b/FrmpipeMaterialGather.cs @@ -280,6 +280,7 @@ if (layer != null && layer is GSOFeatureLayer) { GSOFeatureLayer flayer = layer as GSOFeatureLayer; + if (flayer == null) return; GSOFeatures features = flayer.GetAllFeatures(); if (features.Length > 0) { @@ -332,7 +333,7 @@ chart1.Series[j].Points.DataBindXY(dic1.Keys, dic1.Values); for (int m = 0; m < dic1.Values.Count; m++) { - if (chart1.Series[j].Points[m].YValues[0].ToString() != "0") + if (chart1.Series[j].Points[m]!=null&&chart1.Series[j].Points[m].YValues[0].ToString() != "0") { chart1.Series[j].Points[m].Label = chart1.Series[j].Points[m].YValues[0].ToString(); } diff --git a/Frmpipediameterstatis.cs b/Frmpipediameterstatis.cs index c0ed80a..50f8170 100644 --- a/Frmpipediameterstatis.cs +++ b/Frmpipediameterstatis.cs @@ -286,6 +286,7 @@ chart1.Series.Add(layerCaption); GSOFeatureLayer flayer = layer as GSOFeatureLayer; + if (layer == null) return; GSOFeatures features = flayer.GetAllFeatures(); if (features.Length > 0) { diff --git a/Cyberpipe.csproj b/Cyberpipe.csproj index 07a8c1a..e3cd12c 100644 --- a/Cyberpipe.csproj +++ b/Cyberpipe.csproj @@ -204,25 +204,6 @@ - - Form - - - F_GKT1数据输入输出.cs - - - Form - - - F_GKT1添加文件.cs - - - Form - - - F_GKT1添加项目.cs - - Form @@ -1068,18 +1049,6 @@ Frm_password_reset.cs - - Form - - - GKT.cs - - - Form - - - GKT1.cs - Form @@ -1258,12 +1227,6 @@ F_Projedit.cs - - Form - - - PED.cs - Form @@ -1331,16 +1294,6 @@ True Reference.map - - F_GKT1数据输入输出.cs - Designer - - - F_GKT1添加文件.cs - - - F_GKT1添加项目.cs - Form_EditTask.cs @@ -1836,12 +1789,6 @@ Frm_password_reset.cs - - GKT.cs - - - GKT1.cs - F_GKT数据输入输出.cs @@ -1934,9 +1881,6 @@ F_Projedit.cs - - PED.cs - F_数据输入输出.cs diff --git a/Cyberpipe.suo b/Cyberpipe.suo index 68ced4f..a1aecf8 100644 --- a/Cyberpipe.suo +++ b/Cyberpipe.suo Binary files differ diff --git a/EMS_Forms/Form_EditTask.cs b/EMS_Forms/Form_EditTask.cs index 718992f..f1d791f 100644 --- a/EMS_Forms/Form_EditTask.cs +++ b/EMS_Forms/Form_EditTask.cs @@ -119,7 +119,8 @@ String name = Convert.ToString(dr["USERNAME"]); comboBox_userName.Items.Add(name); - } + } + dr.Close(); comboBox_road.Items.Clear(); roadList = new List(); @@ -135,7 +136,7 @@ comboBox_road.Items.Add(name); } } - + dr1.Close(); conn.Close(); bool flag2 = false; @@ -185,7 +186,7 @@ catch (Exception ex) { - MessageBox.Show(ex.ToString()); + LogHelper.WriteLog(typeof(Form_EditTask), ex.Message); } } @@ -288,7 +289,7 @@ } catch (Exception ex) { - MessageBox.Show(ex.ToString()); + LogHelper.WriteLog(typeof(Form_EditTask), ex.Message); } } @@ -474,7 +475,7 @@ } catch (Exception ex) { - MessageBox.Show(ex.ToString()); + LogHelper.WriteLog(typeof(Form_EditTask), ex.Message); } this.Close(); @@ -495,6 +496,7 @@ { numList.Add(Convert.ToInt32(dr["DBID"])); } + dr.Close(); if (numList.Count == 0) { taskNumber = Convert.ToInt32(number) * 100; @@ -674,6 +676,7 @@ } } } + dr.Close(); conn.Close(); } diff --git a/EMS_Forms/Form_EventManager.cs b/EMS_Forms/Form_EventManager.cs index b18c45b..84807b2 100644 --- a/EMS_Forms/Form_EventManager.cs +++ b/EMS_Forms/Form_EventManager.cs @@ -64,6 +64,7 @@ comboBox_name.Items.Add(name); } + dr.Close(); conn.Close(); diff --git a/Forms/FrmMnModify.cs b/Forms/FrmMnModify.cs index 31cfc5f..d036360 100644 --- a/Forms/FrmMnModify.cs +++ b/Forms/FrmMnModify.cs @@ -68,15 +68,7 @@ questionGrid.Rows[idx].Cells[1].Value = sr.question; } } - /// 选中对象 - /// - /// - /// - /// - private void buttonX1_Click(object sender, EventArgs e) - { - globecontrol.Globe.Action = EnumAction3D.SelectObject; - } + /// /// 选中某一行 /// diff --git a/Forms/FrmPipelineModelDataBase.cs b/Forms/FrmPipelineModelDataBase.cs index 2acf0ca..7ce573f 100644 --- a/Forms/FrmPipelineModelDataBase.cs +++ b/Forms/FrmPipelineModelDataBase.cs @@ -35,19 +35,7 @@ ds = _ds; InitializeComponent(); } - /// - /// 单击选择shp格式文件 - /// - /// - /// - private void btnBrowseModel_Click(object sender, EventArgs e) - { - saveFileDialog1.Filter = "*.lgd|*.lgd"; - if (saveFileDialog1.ShowDialog() == DialogResult.OK) - { - txtModelLayer.Text = saveFileDialog1.FileName; - } - } + /// /// 窗体初始化事件处理 /// @@ -100,49 +88,6 @@ } } } - - private object convertFieldValue(string fieldname, object obj) - { - if (obj == null) - return null; - - try - { - string type = fields_types[fieldname].ToString(); - switch (type) - { - case "string": - return obj.ToString(); - case "int": - //return 101; - int intResult; - if (int.TryParse(obj.ToString(), out intResult)) - return intResult; - else - return null; - case "double": - //return 202.5; - double doubleResult; - if (double.TryParse(obj.ToString(), out doubleResult)) - return doubleResult; - else - return null; - case "date": - DateTime dtResult; - if (DateTime.TryParse(obj.ToString(), out dtResult)) - return dtResult; - else - return null; - } - return null; - } - catch (Exception ex) - { - MessageBox.Show(ex.ToString()); - return null; - } - } - public string lgdFilePath = ""; /// /// 选择管线颜色 @@ -610,33 +555,6 @@ { this.Close(); } - - private void cmbLayer_SelectedIndexChanged(object sender, EventArgs e) //选择图层 - { - GSOLayer layer = ctl.Globe.Layers.GetLayerByCaption(selectLayerName); - GSOFeatures features = layer.GetAllFeatures(); - if (features.Length == 0) - return; - - cmbFrom.Items.Clear(); - cmbTo.Items.Clear(); - cmbRadius.Items.Clear(); - cmbID.Items.Clear(); - for (int i = 0; i < features[0].GetFieldCount(); i++) - { - GeoScene.Data.GSOFieldDefn fielddef = (GeoScene.Data.GSOFieldDefn)(features[0].GetFieldDefn(i)); - - cmbFrom.Items.Add(fielddef.Name); - cmbTo.Items.Add(fielddef.Name); - cmbRadius.Items.Add(fielddef.Name); - cmbID.Items.Add(fielddef.Name); - } - cmbFrom.SelectedItem = "Deep1"; - cmbTo.SelectedItem = "Deep2"; - cmbRadius.SelectedItem = "Diameter"; - cmbID.SelectedItem = "Handle"; - } - private void buttonXLayerPath_Click(object sender, EventArgs e)//单击 选择shp格式的文件 { OpenFileDialog dlg = new OpenFileDialog(); diff --git a/Forms/FrmPipelineModelDataOneStep.cs b/Forms/FrmPipelineModelDataOneStep.cs index 18afda7..ec93b8a 100644 --- a/Forms/FrmPipelineModelDataOneStep.cs +++ b/Forms/FrmPipelineModelDataOneStep.cs @@ -38,19 +38,7 @@ layerTree = _layerTree; InitializeComponent(); } - /// - /// 单击选择shp格式文件 - /// - /// - /// - private void btnBrowseModel_Click(object sender, EventArgs e) - { - saveFileDialog1.Filter = "*.lgd|*.lgd"; - if (saveFileDialog1.ShowDialog() == DialogResult.OK) - { - txtModelLayer.Text = saveFileDialog1.FileName; - } - } + /// /// 窗体初始化事件处理 /// @@ -107,48 +95,7 @@ } } - private object convertFieldValue(string fieldname, object obj) - { - if (obj == null) - return null; - - try - { - string type = fields_types[fieldname].ToString(); - switch (type) - { - case "string": - return obj.ToString(); - case "int": - //return 101; - int intResult; - if (int.TryParse(obj.ToString(), out intResult)) - return intResult; - else - return null; - case "double": - //return 202.5; - double doubleResult; - if (double.TryParse(obj.ToString(), out doubleResult)) - return doubleResult; - else - return null; - case "date": - DateTime dtResult; - if (DateTime.TryParse(obj.ToString(), out dtResult)) - return dtResult; - else - return null; - } - return null; - } - catch (Exception ex) - { - MessageBox.Show(ex.ToString()); - return null; - } - } - + public string lgdFilePath = ""; /// /// 选择管线颜色 @@ -673,32 +620,6 @@ return featDs; } - private void cmbLayer_SelectedIndexChanged(object sender, EventArgs e) //选择图层 - { - GSOLayer layer = ctl.Globe.Layers.GetLayerByCaption(selectLayerName); - GSOFeatures features = layer.GetAllFeatures(); - if (features.Length == 0) - return; - - cmbFrom.Items.Clear(); - cmbTo.Items.Clear(); - cmbRadius.Items.Clear(); - cmbID.Items.Clear(); - for (int i = 0; i < features[0].GetFieldCount(); i++) - { - GeoScene.Data.GSOFieldDefn fielddef = (GeoScene.Data.GSOFieldDefn)(features[0].GetFieldDefn(i)); - - cmbFrom.Items.Add(fielddef.Name); - cmbTo.Items.Add(fielddef.Name); - cmbRadius.Items.Add(fielddef.Name); - cmbID.Items.Add(fielddef.Name); - } - cmbFrom.SelectedItem = "Deep1"; - cmbTo.SelectedItem = "Deep2"; - cmbRadius.SelectedItem = "Diameter"; - cmbID.SelectedItem = "Handle"; - } - private void buttonXLayerPath_Click(object sender, EventArgs e)//单击 选择shp格式的文件 { OpenFileDialog dlg = new OpenFileDialog(); @@ -949,38 +870,6 @@ } //txtLayername.Text = type + layername; } - /// - /// 连接数据库 - /// - /// - /// - private void buttonX1_Click(object sender, EventArgs e) - { - if (ds == null) - { - //没连的话,直接连接审核库; //审核库配置读配置文件 - string dbIp = Utility.sgdbip; - string database = Utility.sgdbname; - string user = Utility.sgdbuser; - string pass = Utility.sgdbpwd; - - if (!Utility.isNetworkConnectionSuccess(dbIp.Trim())) - { - MessageBox.Show("网络连接失败!", "提示"); - return; - } - - ds = ctl.Globe.DataManager.OpenOracleDataSource(dbIp + "/" + database, "", "", user, pass); - if (ds == null) - { - MessageBox.Show("数据库连接失败!", "提示", MessageBoxButtons.OK, MessageBoxIcon.Warning); - } - else - { - btnCreateModel.Enabled = true; - } - } - } private void btnClose_Click(object sender, EventArgs e) { diff --git a/Forms/FrmShRK.cs b/Forms/FrmShRK.cs index 0e2e722..f1d83cb 100644 --- a/Forms/FrmShRK.cs +++ b/Forms/FrmShRK.cs @@ -215,6 +215,7 @@ { sourcefeatds = sourcefeat as GSOFeatureDataset; } + if (sourcefeatds == null) return; sourcefeatds.Open(); GSOFeatures sourcefeatures = sourcefeatds.GetAllFeatures(); @@ -251,6 +252,7 @@ { desfeatds = desfeat as GSOFeatureDataset; } + if (desfeatds == null) return; desfeatds.Open(); //向新数据集写入字段 diff --git a/FrmAccessoriesSensor.cs b/FrmAccessoriesSensor.cs index 09fcdf1..2a7a80e 100644 --- a/FrmAccessoriesSensor.cs +++ b/FrmAccessoriesSensor.cs @@ -209,7 +209,7 @@ chart1.Series[0].Points.DataBindXY(dic.Keys, dic.Values); for (int m = 0; m < dic.Values.Count; m++) { - if (chart1.Series[0].Points[m].YValues[0].ToString() != "0") + if (chart1.Series[0].Points[m]!=null&&chart1.Series[0].Points[m].YValues[0].ToString() != "0") { chart1.Series[0].Points[m].Label = chart1.Series[0].Points[m].YValues[0].ToString(); } diff --git a/FrmAccessoriesgather.cs b/FrmAccessoriesgather.cs index 9e331e1..a475d9e 100644 --- a/FrmAccessoriesgather.cs +++ b/FrmAccessoriesgather.cs @@ -338,7 +338,7 @@ chart1.Series[0].Points.DataBindXY(dic.Keys, dic.Values); for (int m = 0; m < dic.Values.Count; m++) { - if (chart1.Series[0].Points[m].YValues[0].ToString() != "0") + if (chart1.Series[0].Points[m]!=null&&chart1.Series[0].Points[m].YValues[0].ToString() != "0") { chart1.Series[0].Points[m].Label = chart1.Series[0].Points[m].YValues[0].ToString(); } diff --git a/FrmAccessoryAnalysis.cs b/FrmAccessoryAnalysis.cs index 71d4579..44d4065 100644 --- a/FrmAccessoryAnalysis.cs +++ b/FrmAccessoryAnalysis.cs @@ -66,39 +66,6 @@ globeControl1.Refresh(); } /// - /// 键盘按键按下事件处理 - /// - /// - /// - private void txtRadius_KeyPress(object sender, KeyPressEventArgs e) - { - TextBox text = sender as TextBox; - if ((e.KeyChar < 48 || e.KeyChar > 57) && (e.KeyChar != 8) && (int)e.KeyChar != 46) - { - e.Handled = true; - } - if ((int)e.KeyChar == 46) //小数点 - { - if (text.Text.Length <= 0) - e.Handled = true; //小数点不能在第一位 - else //处理不规则的小数点 - { - float f; - float oldf; - bool b1 = false, b2 = false; - b1 = float.TryParse(text.Text, out oldf); - b2 = float.TryParse(text.Text + e.KeyChar.ToString(), out f); - if (b2 == false) - { - if (b1 == true) - e.Handled = true; - else - e.Handled = false; - } - } - } - } - /// /// 确定按钮事件处理 /// /// diff --git a/FrmAddValve.cs b/FrmAddValve.cs index 34d2fec..5f405b9 100644 --- a/FrmAddValve.cs +++ b/FrmAddValve.cs @@ -486,56 +486,6 @@ } } - - - - - - - - private void cmbLayer_SelectedIndexChanged(object sender, EventArgs e) - { - GSOLayer layer = globeControl1.Globe.Layers.GetLayerByCaption(selectLayerName); - GSOFeatures features = layer.GetAllFeatures(); - if (features.Length == 0) - return; - - combPath.Items.Clear(); - combZ.Items.Clear(); - combModelName.Items.Clear(); - - for (int i = 0; i < features[0].GetFieldCount(); i++) - { - GeoScene.Data.GSOFieldDefn fielddef = (GeoScene.Data.GSOFieldDefn)(features[0].GetFieldDefn(i)); - combPath.Items.Add(fielddef.Name); - combZ.Items.Add(fielddef.Name); - combModelName.Items.Add(fielddef.Name); - } - combModelName.SelectedItem = "编号"; - combPath.SelectedItem = "模型路径"; - if (combfile.SelectedIndex != -1) - { - - string layerCaption = combfile.SelectedItem.ToString().Trim(); - rukuLayer = globeControl1.Globe.Layers.GetLayerByCaption(layerCaption); - if (rukuLayer != null) - { - combPath.Items.Clear(); - combZ.Items.Clear(); - combModelName.Items.Clear(); - - } - for (int i = 0; i < features[0].GetFieldCount(); i++) - { - GeoScene.Data.GSOFieldDefn fielddef = (GeoScene.Data.GSOFieldDefn)(features[0].GetFieldDefn(i)); - combPath.Items.Add(fielddef.Name); - combZ.Items.Add(fielddef.Name); - combModelName.Items.Add(fielddef.Name); - } - combModelName.SelectedItem = "编号"; - combPath.SelectedItem = "模型路径"; - } - } /// /// 单击选择shp格式文件 /// diff --git a/FrmAddWellShp.cs b/FrmAddWellShp.cs index bb79ec0..a249725 100644 --- a/FrmAddWellShp.cs +++ b/FrmAddWellShp.cs @@ -478,32 +478,6 @@ } } } - - private void cmbLayer_SelectedIndexChanged(object sender, EventArgs e) - { - GSOLayer layer = globeControl1.Globe.Layers.GetLayerByCaption(selectLayerName); - GSOFeatures features = layer.GetAllFeatures(); - if (features.Length == 0) - return; - - combCode.Items.Clear(); - combDeep.Items.Clear(); - combModelName.Items.Clear(); - combAngle.Items.Clear(); - - for (int i = 0; i < features[0].GetFieldCount(); i++) - { - GeoScene.Data.GSOFieldDefn fielddef = (GeoScene.Data.GSOFieldDefn)(features[0].GetFieldDefn(i)); - combCode.Items.Add(fielddef.Name); - combDeep.Items.Add(fielddef.Name); - combModelName.Items.Add(fielddef.Name); - combAngle.Items.Add(fielddef.Name); - } - combCode.SelectedItem = "附属物编码"; - combDeep.SelectedItem = "井深"; - combModelName.SelectedItem = "编号"; - combAngle.SelectedItem = "符号角度"; - } /// /// 单击选择shp格式文件 /// diff --git a/FrmAddYuBiZiShp.cs b/FrmAddYuBiZiShp.cs index b312d51..332f037 100644 --- a/FrmAddYuBiZiShp.cs +++ b/FrmAddYuBiZiShp.cs @@ -383,80 +383,7 @@ } } - private void cmbLayer_SelectedIndexChanged(object sender, EventArgs e) - { - GSOLayer layer = globeControl1.Globe.Layers.GetLayerByCaption(selectLayerName); - GSOFeatures features = layer.GetAllFeatures(); - if (features.Length == 0) - return; - - combCode.Items.Clear(); - combDeep.Items.Clear(); - combModelName.Items.Clear(); - //comboLoad.Items.Clear(); - for (int i = 0; i < features[0].GetFieldCount(); i++) - { - GeoScene.Data.GSOFieldDefn fielddef = (GeoScene.Data.GSOFieldDefn)(features[0].GetFieldDefn(i)); - combCode.Items.Add(fielddef.Name); - combDeep.Items.Add(fielddef.Name); - combModelName.Items.Add(fielddef.Name); - //comboLoad.Items.Add(fielddef.Name); - } - combCode.SelectedItem = "附属物编码"; - combDeep.SelectedItem = "Z坐标"; - combModelName.SelectedItem = "编号"; - //comboLoad.SelectedItem = "模型路径"; - } - - private void buttonXLayerPath_Click(object sender, EventArgs e) - { - OpenFileDialog dlg = new OpenFileDialog(); - dlg.Filter = "*.shp|*.shp"; - dlg.Multiselect = false; - if (dlg.ShowDialog() == DialogResult.OK) - { - GSOLayer layer = globeControl1.Globe.Layers.Add(dlg.FileName); - string txtMessage = valiYBdata(layer); - if (txtMessage != "") - { - button3.Enabled = false; - //textBoxLayer.Text = ""; - combCode.Items.Clear(); - combDeep.Items.Clear(); - combModelName.Items.Clear(); - globeControl1.Globe.Layers.Remove(layer); - FrmValiDataShowErrorMessage showErrorMessage = new FrmValiDataShowErrorMessage(dlg.FileName, txtMessage); - showErrorMessage.ShowDialog(); - return; - } - else - { - button3.Enabled = true; - //textBoxLayer.Text = dlg.FileName; - selectLayerName = layer.Caption; - txtLayerName.Text = layer.Caption; - GSOFeatures features = layer.GetAllFeatures(); - if (features.Length == 0) - return; - - combCode.Items.Clear(); - combDeep.Items.Clear(); - combModelName.Items.Clear(); - for (int i = 0; i < features[0].GetFieldCount(); i++) - { - GeoScene.Data.GSOFieldDefn fielddef = (GeoScene.Data.GSOFieldDefn)(features[0].GetFieldDefn(i)); - combCode.Items.Add(fielddef.Name); - combDeep.Items.Add(fielddef.Name); - combModelName.Items.Add(fielddef.Name); - //comboLoad.Items.Add(fielddef.Name); - } - combCode.SelectedItem = "管点编码"; - combDeep.SelectedItem = "Z坐标"; - combModelName.SelectedItem = "编号"; - } - } - } - + private void FrmAddYuBiZiShp_FormClosing(object sender, FormClosingEventArgs e) { globeControl1.Globe.Refresh(); diff --git a/FrmAllPipelineStatis.cs b/FrmAllPipelineStatis.cs index 6421a26..a6eea29 100644 --- a/FrmAllPipelineStatis.cs +++ b/FrmAllPipelineStatis.cs @@ -84,7 +84,7 @@ chartAllAreaPipeline.Series["管线"].Points.DataBindXY(pipelineLengthAndType.Keys, pipelineLengthAndType.Values); for (int m = 0; m < pipelineLengthAndType.Values.Count; m++) { - if (chartAllAreaPipeline.Series["管线"].Points[m].YValues[0].ToString() != "0") + if (chartAllAreaPipeline.Series["管线"].Points[m]!=null&&chartAllAreaPipeline.Series["管线"].Points[m].YValues[0].ToString() != "0") { chartAllAreaPipeline.Series["管线"].Points[m].Label = chartAllAreaPipeline.Series[0].Points[m].YValues[0].ToString(); } @@ -94,7 +94,7 @@ } catch (Exception ex) { - //LogError.PublishError(ex); + LogHelper.WriteLog(typeof(FrmAllPipelineStatis), ex.Message); } } @@ -147,7 +147,7 @@ } DataTable dt = OledbHelper.QueryTable(sql); - if (dt != null && dt.Rows.Count > 0) + if (dt != null && dt.Rows.Count > 0 && chartAllAreaPipeline.Series["管线"].Points[indexHit]!=null) { dataGridViewX1.DataSource = dt; panel.Visible = true; diff --git a/FrmAllWorkWellStatis.cs b/FrmAllWorkWellStatis.cs index 6fec7af..6af8e4c 100644 --- a/FrmAllWorkWellStatis.cs +++ b/FrmAllWorkWellStatis.cs @@ -52,7 +52,7 @@ chartAllAreaPipeline.Series["井盖"].Points.DataBindXY(workWellLengthAndType.Keys, workWellLengthAndType.Values); for (int m = 0; m < workWellLengthAndType.Values.Count; m++) { - if (chartAllAreaPipeline.Series["井盖"].Points[m].YValues[0].ToString().Trim() != "0") + if (chartAllAreaPipeline.Series["井盖"].Points[m]!=null&&chartAllAreaPipeline.Series["井盖"].Points[m].YValues[0].ToString().Trim() != "0") { chartAllAreaPipeline.Series["井盖"].Points[m].Label = chartAllAreaPipeline.Series[0].Points[m].YValues[0].ToString(); } @@ -60,7 +60,7 @@ } catch (Exception ex) { - //LogError.PublishError(ex); + LogHelper.WriteLog(typeof(FrmAllWorkWellStatis), ex.Message); } } diff --git a/FrmBSQDuoBianXingStatis.cs b/FrmBSQDuoBianXingStatis.cs index e8b7d52..3e889b6 100644 --- a/FrmBSQDuoBianXingStatis.cs +++ b/FrmBSQDuoBianXingStatis.cs @@ -60,7 +60,7 @@ { for (int m = 0; m < bsq1.Values.Count; m++) { - if (chart1.Series["标识器"].Points[m].YValues[0].ToString() != "0") + if (chart1.Series["标识器"].Points[m]!=null&&chart1.Series["标识器"].Points[m].YValues[0].ToString() != "0") { count += Convert.ToInt16(chart1.Series[0].Points[m].YValues[0].ToString()); chart1.Series["标识器"].Points[m].Label = chart1.Series[0].Points[m].YValues[0].ToString(); diff --git a/FrmBSQDuoBianXingStreet.cs b/FrmBSQDuoBianXingStreet.cs index 2005ebb..1db5777 100644 --- a/FrmBSQDuoBianXingStreet.cs +++ b/FrmBSQDuoBianXingStreet.cs @@ -63,7 +63,7 @@ chartStatis.Series[0].Points.DataBindXY(bsq.Keys, bsq.Values); for (int m = 0; m < bsq.Values.Count; m++) { - if (chartStatis.Series[0].Points[m].YValues[0].ToString().Trim() != "0") + if (chartStatis.Series[0].Points[m]!=null&&chartStatis.Series[0].Points[m].YValues[0].ToString().Trim() != "0") { count += Convert.ToInt16(chartStatis.Series[0].Points[m].YValues[0].ToString()); chartStatis.Series[0].Points[m].Label = chartStatis.Series[0].Points[m].YValues[0].ToString(); diff --git a/FrmBSQStatis.cs b/FrmBSQStatis.cs index 390a55c..4aa0ee6 100644 --- a/FrmBSQStatis.cs +++ b/FrmBSQStatis.cs @@ -95,6 +95,8 @@ } } } + + dr.Close(); conn.Close(); for (int i = 0; i < typeLists.Count; i++) { @@ -123,7 +125,7 @@ chartStatis.Series[0].Points.DataBindXY(bsq.Keys, bsq.Values); for (int m = 0; m < bsq.Values.Count; m++) { - if (chartStatis.Series[0].Points[m].YValues[0].ToString().Trim() != "0") + if (chartStatis.Series[0].Points[m]!=null&&chartStatis.Series[0].Points[m].YValues[0].ToString().Trim() != "0") { //count += Convert.ToInt16(chartStatis.Series[0].Points[m].YValues[0].ToString()); chartStatis.Series[0].Points[m].Label = chartStatis.Series[0].Points[m].YValues[0].ToString(); diff --git a/FrmBSQStreet.cs b/FrmBSQStreet.cs index 9d88adb..7fbacad 100644 --- a/FrmBSQStreet.cs +++ b/FrmBSQStreet.cs @@ -44,7 +44,7 @@ chartStatis.Series[0].Points.DataBindXY(bsq.Keys, bsq.Values); for (int m = 0; m < bsq.Values.Count; m++) { - if (chartStatis.Series[0].Points[m].YValues[0].ToString().Trim() != "0") + if (chartStatis.Series[0].Points[m]!=null&&chartStatis.Series[0].Points[m].YValues[0].ToString().Trim() != "0") { count += Convert.ToInt16(chartStatis.Series[0].Points[m].YValues[0].ToString()); chartStatis.Series[0].Points[m].Label = chartStatis.Series[0].Points[m].YValues[0].ToString(); diff --git a/FrmBoosterValvers.cs b/FrmBoosterValvers.cs index 5061efc..df9b62b 100644 --- a/FrmBoosterValvers.cs +++ b/FrmBoosterValvers.cs @@ -236,199 +236,6 @@ count = 0; } } - /// - /// 添加火苗 - /// - /// - /// - /// - /// - private GSOFeature AddFire(double x,double y,double z) - { - // 烟火示例 - - string strResPath = Application.StartupPath + "/Resource"; - - // 烟火粒子示例,由三个发射器构成 - GSOGeoParticle geoParticle = new GSOGeoParticle(); - geoParticle.SetPosition(x, y, z); // 添加到这个经纬度位置 - geoParticle.AltitudeMode = EnumAltitudeMode.RelativeToGround; - - GSORingParticleEmitter emitter = new GSORingParticleEmitter(); - emitter.TexturePath = strResPath + "/ParticleImage/flare.png"; - - emitter.SetSizeFix(1, 1); - emitter.VelFix = 1; - emitter.VelRnd = 5; - - emitter.AngleXYFix = 0; - emitter.AngleXYRnd = 180; - - emitter.AngleXZFix = 90; - emitter.AngleXZRnd = 0; - - emitter.LifeFix = 0.5f; - emitter.LifeRnd = 0.0f; - - emitter.RotFix = 0; - emitter.RotRnd = 0; - - emitter.RotVelFix = 0; - emitter.RotVelRnd = 0; - - emitter.EmitPerSec = 100; - - // 采用线性插值生成粒子的初始颜色 - emitter.ColorRndStart = Color.White; - emitter.ColorRndEnd = Color.Red; - - - GSOColorParticleEffector effector2 = new GSOColorParticleEffector(); - effector2.SetColorChanged(0, -1, -1, 0); - effector2.StartTime = 0.0f; - effector2.EndTime = -1.0f; - emitter.AddEffector(effector2); - - // 将三个发射器添加到粒子对象中 - geoParticle.AddEmitter(emitter); - - geoParticle.Play(); - - GSOFeature feature = new GSOFeature(); - - feature.Geometry = geoParticle; - - globeControl1.Globe.MemoryLayer.AddFeature(feature); - - - return feature; - } - - /// - /// 添加喷泉 - /// - /// - private GSOFeature AddFountain() - { - string strResPath = Application.StartupPath + "/Resource"; - - GSOGeoParticle geoParticle = new GSOGeoParticle(); - geoParticle.SetPosition(116.314, 39.84, 0); // 添加到这个经纬度位置 - - GSOPointParticleEmitter emitter = new GSOPointParticleEmitter(); - emitter.TexturePath = strResPath + "/ParticleImage/test.png"; - - emitter.SetSizeFix(0.5f, 2); - emitter.VelFix = 10; - emitter.VelRnd = 2; - - emitter.GravityAcc = 9.8f; - emitter.AngleXYFix = 0; - emitter.AngleXYRnd = 180; - - emitter.AngleXZFix = 88; - emitter.AngleXZRnd = 2; - - //emitter.InnerRadius = 0; - // emitter.OuterRadius = 0.03f; - - emitter.LifeFix = 5.0f; - emitter.LifeRnd = 1.0f; - - emitter.RotFix = 0; - emitter.RotRnd = 0; - - emitter.RotVelFix = 0; - emitter.RotVelRnd = 0; - - emitter.EmitPerSec = 1000; - emitter.ColorRndStart = Color.FromArgb(33, 255, 255, 255); - emitter.ColorRndEnd = Color.FromArgb(11, 255, 255, 255); - emitter.IsLumAdded = false; - - // 将三个发射器添加到粒子对象中 - geoParticle.AddEmitter(emitter); - - geoParticle.Play(); - GSOFeature feature = new GSOFeature(); - - feature.Geometry = geoParticle; - - //globeControl1.Globe.MemoryLayer.AddFeature(feature); - globeControl1.Globe.FlyToFeature(feature); - - return feature; - } - - /// - /// 添加水柱 - /// - /// - private GSOFeature AddWaterLine() - { - string strResPath = Application.StartupPath + "/Resource"; - - GSOGeoParticle geoParticle = new GSOGeoParticle(); - geoParticle.SetPosition(116.308, 39.84, 0); // 添加到这个经纬度位置 - - GSOPointParticleEmitter emitter = new GSOPointParticleEmitter(); - - emitter.TexturePath = strResPath + "/ParticleImage/drop3.png"; - - geoParticle.TimerInterval = 1; - - emitter.SetSizeFix(2.0f, 2.0f); - - emitter.VelFix = 50; - emitter.VelRnd = 2; - - // emitter.IsLumAdded = false; - - emitter.GravityAcc = 9.8f; - emitter.AngleXYFix = 0; - emitter.AngleXYRnd = 2; - - emitter.AngleXZFix = 60; - emitter.AngleXZRnd = 2; - - //emitter.InnerRadius = 0; - // emitter.OuterRadius = 0.1f; - - emitter.LifeFix = 5.0f; - emitter.LifeRnd = 1.0f; - - emitter.RotFix = 0; - emitter.RotRnd = 0; - - emitter.RotVelFix = 0; - emitter.RotVelRnd = 0; - - emitter.EmitPerSec = 1500; - - emitter.ColorRndStart = Color.FromArgb(100, 222, 222, 222); - emitter.ColorRndEnd = Color.FromArgb(50, 222, 222, 222); - - /* - - GSOScaleParticleEffector effector1 = new GSOScaleParticleEffector(); - effector1.SetScale(0.2f, 0.2f); - effector1.StartTime = 0; - effector1.EndTime = -1; // 负数表示整个粒子生命结束 - emitter.AddEffector(effector1); - */ - - // 将三个发射器添加到粒子对象中 - geoParticle.AddEmitter(emitter); - - geoParticle.Play(); - GSOFeature feature = new GSOFeature(); - - feature.Geometry = geoParticle; - - //globeControl1.Globe.MemoryLayer.AddFeature(feature); - globeControl1.Globe.FlyToFeature(feature); - - return feature; - } + } } diff --git a/FrmBufferAnalysis.cs b/FrmBufferAnalysis.cs index f711133..db8ca59 100644 --- a/FrmBufferAnalysis.cs +++ b/FrmBufferAnalysis.cs @@ -123,39 +123,6 @@ } } /// - /// 半径文本框的键盘按键按下事件处理 - /// - /// - /// - private void txtRadius_KeyPress(object sender, KeyPressEventArgs e) - { - TextBox text = sender as TextBox; - if ((e.KeyChar < 48 || e.KeyChar > 57) && (e.KeyChar != 8) && (int)e.KeyChar != 46) - { - e.Handled = true; - } - if ((int)e.KeyChar == 46) //小数点 - { - if (text.Text.Length <= 0) - e.Handled = true; //小数点不能在第一位 - else //处理不规则的小数点 - { - float f; - float oldf; - bool b1 = false, b2 = false; - b1 = float.TryParse(text.Text, out oldf); - b2 = float.TryParse(text.Text + e.KeyChar.ToString(), out f); - if (b2 == false) - { - if (b1 == true) - e.Handled = true; - else - e.Handled = false; - } - } - } - } - /// /// 窗体关闭事件处理 /// /// diff --git a/FrmBufferAnalysisBSQ.cs b/FrmBufferAnalysisBSQ.cs index 24a96ca..f54208f 100644 --- a/FrmBufferAnalysisBSQ.cs +++ b/FrmBufferAnalysisBSQ.cs @@ -137,35 +137,7 @@ } } - private void txtRadius_KeyPress(object sender, KeyPressEventArgs e) - { - TextBox text = sender as TextBox; - if ((e.KeyChar < 48 || e.KeyChar > 57) && (e.KeyChar != 8) && (int)e.KeyChar != 46) - { - e.Handled = true; - } - if ((int)e.KeyChar == 46) //小数点 - { - if (text.Text.Length <= 0) - e.Handled = true; //小数点不能在第一位 - else //处理不规则的小数点 - { - float f; - float oldf; - bool b1 = false, b2 = false; - b1 = float.TryParse(text.Text, out oldf); - b2 = float.TryParse(text.Text + e.KeyChar.ToString(), out f); - if (b2 == false) - { - if (b1 == true) - e.Handled = true; - else - e.Handled = false; - } - } - } - } - + private void FrmBufferAnalysis_FormClosing(object sender, FormClosingEventArgs e) { //Form1.y = 0; @@ -316,27 +288,6 @@ } } - private void FlyToMenu_Click(object sender, EventArgs e) - { - if (m_feature != null) - { - if (m_feature.Geometry != null && m_feature.Geometry.Type == EnumGeometryType.GeoPolyline3D) - { - GSOGeoPolyline3D line = m_feature.Geometry as GSOGeoPolyline3D; - double length = line.GetSpaceLength(true, 6378137); - GSOGeoPolyline3D lineLine = line.GetSegment(0, length / 2); - GSOPoint3d point3d = lineLine[lineLine.PartCount - 1][lineLine[lineLine.PartCount - 1].Count - 1]; - - globeControl1.Globe.FlyToPosition(point3d, EnumAltitudeMode.Absolute, 0, 45, 5); - } - else - { - globeControl1.Globe.FlyToFeature(m_feature, 0, 45, 3); - } - LightMenu_Click(sender, e); - } - } - private void LightMenu_Click(object sender, EventArgs e) { flashflag = "single"; diff --git a/FrmDataBaseOpt.cs b/FrmDataBaseOpt.cs index b0c4b5d..8d7b69d 100644 --- a/FrmDataBaseOpt.cs +++ b/FrmDataBaseOpt.cs @@ -362,6 +362,7 @@ dbCombor.Items.Add(dblist[i].title); } } + /* /// /// 从配置文件读取数据库参数配置 /// @@ -428,6 +429,8 @@ } } + * */ + /* /// /// 向配置文件写入连接数据库的参数配置 /// @@ -485,6 +488,7 @@ MessageBox.Show(exp.ToString()); } } + * */ /// /// /// diff --git a/FrmDatabaseParaSetting.cs b/FrmDatabaseParaSetting.cs index a6fea46..63b596b 100644 --- a/FrmDatabaseParaSetting.cs +++ b/FrmDatabaseParaSetting.cs @@ -152,6 +152,7 @@ this.DialogResult = DialogResult.OK; this.Close(); } + /* /// /// 从配置文件读取数据库连接参数配置 /// @@ -218,6 +219,8 @@ } } + * */ + /* /// /// 向配置文件写入数据库参数配置 /// @@ -276,7 +279,7 @@ MessageBox.Show(ex.ToString()); } } - + */ /// /// 取消按钮事件处理 /// diff --git a/FrmDatabaseParaSetting2.cs b/FrmDatabaseParaSetting2.cs index 932d05e..96a87d5 100644 --- a/FrmDatabaseParaSetting2.cs +++ b/FrmDatabaseParaSetting2.cs @@ -148,6 +148,7 @@ this.DialogResult = DialogResult.OK; this.Close(); } + /* /// /// 从配置文件读取数据库连接参数配置 /// @@ -214,6 +215,8 @@ } } + * */ + /* /// /// 向配置文件写入数据库参数配置 /// @@ -272,7 +275,7 @@ MessageBox.Show(exp.ToString()); } } - + */ /// /// 取消按钮事件处理 /// diff --git a/FrmDiameterQuery.cs b/FrmDiameterQuery.cs index 68c948b..9a5215b 100644 --- a/FrmDiameterQuery.cs +++ b/FrmDiameterQuery.cs @@ -77,18 +77,7 @@ isBetween = true; } } - /// - /// 键盘按键按下事件处理 - /// - /// - /// - private void textBoxX1_KeyPress(object sender, KeyPressEventArgs e) - { - if ((e.KeyChar < 48 || e.KeyChar > 57) && e.KeyChar != 8) - { - e.Handled = true;//屏蔽 - } - } + bool isBetween = false; /// diff --git a/FrmDocumentEdit.cs b/FrmDocumentEdit.cs index aab2d31..e78a7ff 100644 --- a/FrmDocumentEdit.cs +++ b/FrmDocumentEdit.cs @@ -256,121 +256,6 @@ } - // - /// 将本地文件上传到指定的服务器(HttpWebRequest方法) - /// - /// 文件上传到的服务器 - /// 要上传的本地文件(全路径) - /// 文件上传后的名称 - /// 上传进度条 - /// 成功返回1,失败返回0 - private int Upload_Request(string address, string fileNamePath, string saveName, ProgressBar progressBar) - { - int returnValue = 0; - // 要上传的文件 - FileStream fs = new FileStream(fileNamePath, FileMode.Open, FileAccess.Read); - BinaryReader r = new BinaryReader(fs); - //时间戳 - string strBoundary = "----------" + DateTime.Now.Ticks.ToString("x"); - byte[] boundaryBytes = Encoding.ASCII.GetBytes("/r/n--" + strBoundary + "/r/n"); - //请求头部信息 - StringBuilder sb = new StringBuilder(); - sb.Append("--"); - sb.Append(strBoundary); - sb.Append("\r\n"); - sb.Append("Content-Disposition: form-data; name=\""); - sb.Append("file"); - sb.Append("\"; filename=\""); - sb.Append(saveName); - sb.Append("\""); - sb.Append("\r\n"); - sb.Append("Content-Type: "); - sb.Append("application/octet-stream"); - sb.Append("\r\n"); - sb.Append("\r\n"); - string strPostHeader = sb.ToString(); - byte[] postHeaderBytes = Encoding.UTF8.GetBytes(strPostHeader); - // 根据uri创建HttpWebRequest对象 - HttpWebRequest httpReq = (HttpWebRequest)WebRequest.Create(new Uri(address)); - httpReq.Method = "POST"; - //对发送的数据不使用缓存 - httpReq.AllowWriteStreamBuffering = false; - //设置获得响应的超时时间(300秒) - httpReq.Timeout = 300000; - httpReq.ContentType = "multipart/form-data; boundary=" + strBoundary; - long length = fs.Length + postHeaderBytes.Length + boundaryBytes.Length; - long fileLength = fs.Length; - httpReq.ContentLength = length; - try - { - progressBar.Maximum = int.MaxValue; - progressBar.Minimum = 0; - progressBar.Value = 0; - //每次上传4k - int bufferLength = 4096; - byte[] buffer = new byte[bufferLength]; - //已上传的字节数 - long offset = 0; - //开始上传时间 - DateTime startTime = DateTime.Now; - int size = r.Read(buffer, 0, bufferLength); - Stream postStream = httpReq.GetRequestStream(); - //发送请求头部消息 - postStream.Write(postHeaderBytes, 0, postHeaderBytes.Length); - while (size > 0) - { - postStream.Write(buffer, 0, size); - offset += size; - progressBar.Value = (int)(offset * (int.MaxValue / length)); - TimeSpan span = DateTime.Now - startTime; - double second = span.TotalSeconds; - //lblTime.Text = "已用时:" + second.ToString("F2") + "秒"; - //if (second > 0.001) - //{ - // lblSpeed.Text = " 平均速度:" + (offset / 1024 / second).ToString("0.00") + "KB/秒"; - //} - //else - //{ - // lblSpeed.Text = " 正在连接…"; - //} - //lblState.Text = "已上传:" + (offset * 100.0 / length).ToString("F2") + "%"; - //lblSize.Text = (offset / 1048576.0).ToString("F2") + "M/" + (fileLength / 1048576.0).ToString("F2") + "M"; - Application.DoEvents(); - size = r.Read(buffer, 0, bufferLength); - } - //添加尾部的时间戳 - postStream.Write(boundaryBytes, 0, boundaryBytes.Length); - postStream.Close(); - //获取服务器端的响应 - WebResponse webRespon = httpReq.GetResponse(); - Stream s = webRespon.GetResponseStream(); - StreamReader sr = new StreamReader(s); - //读取服务器端返回的消息 - String sReturnString = sr.ReadLine(); - s.Close(); - sr.Close(); - if (sReturnString == "Success") - { - returnValue = 1; - } - else if (sReturnString == "Error") - { - returnValue = 0; - } - } - catch(Exception ex) - { - returnValue = 0; - string str = ex.ToString(); - } - finally - { - fs.Close(); - r.Close(); - } - return returnValue; - } - private void btn_file_Click(object sender, EventArgs e) { OpenFileDialog dlg = new OpenFileDialog(); diff --git a/FrmExportCADS.cs b/FrmExportCADS.cs index 98772ea..59629dd 100644 --- a/FrmExportCADS.cs +++ b/FrmExportCADS.cs @@ -108,65 +108,6 @@ MessageBox.Show("请选中要导出的图层!", "提示", MessageBoxButtons.OK, MessageBoxIcon.Warning); } } - private Boolean MerageToFile(GSOFeatures features, String strDestFile, String strProj4)//图层追加 - { - if (features == null) - { - return false; - } - Boolean bSuccess = false; - - string strDir = GSOUtility.GetFileDir(strDestFile); - string strLPRJFile = GSOUtility.ChangeExt(strDestFile, ".lprj"); - string strExt = GSOUtility.GetFileExt(strDestFile); - - // 如果投影文件存在,投影以投影文件为准 - if (File.Exists(strLPRJFile)) - { - // 如果是dxf,则这样处理 - if (strExt.ToLower() == ".dxf") - { - string strTempSrcFile = strDir + "srcFeatures_dxftmp" + strExt; - globeControl1.Globe.DataManager.SaveFeatureData(features, strTempSrcFile, strLPRJFile, 4); - bSuccess = GSOUtility.MergeTwoDXFFileFeatures(strDestFile, strTempSrcFile); - File.Delete(strTempSrcFile); - } - else - { - GSOFeatures srcFeatures = globeControl1.Globe.DataManager.ReadFeatureData(strDestFile); - int nCount = features.Length; - int i = 0; - for (i = 0; i < nCount; i++) - { - srcFeatures.Add(features[i]); - } - bSuccess = globeControl1.Globe.DataManager.SaveFeatureData(srcFeatures, strDestFile, strLPRJFile, 4); - } - } - else - { - // 如果是dxf,则这样处理 - if (strExt.ToLower() == ".dxf") - { - string strTempSrcFile = strDir + "srcFeatures_dxftmp" + strExt; - globeControl1.Globe.DataManager.SaveFeatureData(features, strTempSrcFile, strProj4, 0); - bSuccess = GSOUtility.MergeTwoDXFFileFeatures(strDestFile, strTempSrcFile); - File.Delete(strTempSrcFile); - } - else - { - GSOFeatures srcFeatures = globeControl1.Globe.DataManager.ReadFeatureData(strDestFile); - int nCount = features.Length; - int i = 0; - for (i = 0; i < nCount; i++) - { - srcFeatures.Add(features[i]); - } - bSuccess = globeControl1.Globe.DataManager.SaveFeatureData(srcFeatures, strDestFile, strProj4, 0); - } - } - return bSuccess; - } /// /// 关闭按钮事件处理 /// diff --git a/FrmHDMAnalysis3.cs b/FrmHDMAnalysis3.cs index 4f73af6..2ada735 100644 --- a/FrmHDMAnalysis3.cs +++ b/FrmHDMAnalysis3.cs @@ -436,29 +436,6 @@ } layerTemp.RemoveAllFeature(); } - private void Export(GSOPoint3d _pnt, double r) - { - GSOPoint3ds pnts = new GSOPoint3ds(); - GSOPoint3d pnt = new GSOPoint3d(); - pnt.X = _pnt.X; - pnt.Y = _pnt.Y; - pnt.Z = _pnt.Z; - pnts.Add(pnt); - pnt.X = _pnt.X; - pnt.Y = _pnt.Y - 0.0000000005; - pnt.Z = _pnt.Z; - pnts.Add(pnt); - GSOGeoPolyline3D line = new GSOGeoPolyline3D(); - line.AddPart(pnts); - GSOGeoPolygon3D polygon = line.CreateBuffer(r * 2, true, 5, true, false); - GSOPoint3ds points = polygon[0]; - GSOGeoPolyline3D newLine = new GSOGeoPolyline3D(); - newLine.AddPart(points); - newLine.AltitudeMode = EnumAltitudeMode.RelativeToGround; - GSOFeature newFeature = new GSOFeature(); - newFeature.Geometry = newLine; - globeControl1.Globe.MemoryLayer.AddFeature(newFeature); - } private void ExportCAD(double a, double b, double r) { diff --git a/FrmHotFuncStat.cs b/FrmHotFuncStat.cs index c980f34..2eb1476 100644 --- a/FrmHotFuncStat.cs +++ b/FrmHotFuncStat.cs @@ -421,13 +421,6 @@ } } - private void HFS_Pderive_Click(object sender, EventArgs e) - { - if (TV_Files.SelectedNode != null) - { - HFSClass.GuideEdit_form("G", TV_Files, int.Parse(((ToolStripMenuItem)sender).Tag.ToString())); - } - } private void 导入ToolStripMenuItem_Click(object sender, EventArgs e) { @@ -530,22 +523,8 @@ } } - private void 导出ToolStripMenuItem1_Click(object sender, EventArgs e) - { - 导出ToolStripMenuItem2_Click(sender, e); - } + - private void TV_HFSSrchRslt_AfterCollapse(object sender, TreeViewEventArgs e) - { - e.Node.ImageIndex = 0; - } - - private void TV_HFSSrchRslt_AfterExpand(object sender, TreeViewEventArgs e) - { - HFSClass.ADD_TreeNode(TV_Files, e.Node); - e.Node.ImageIndex = 1; - } - private void 导出ToolStripMenuItem1_Click_1(object sender, EventArgs e) { if ((TV_HFSSrchRslt.SelectedNode != null) && (TV_HFSSrchRslt.SelectedNode.Parent != null)) diff --git a/FrmLayerControl.cs b/FrmLayerControl.cs index e7917c3..28fa14d 100644 --- a/FrmLayerControl.cs +++ b/FrmLayerControl.cs @@ -312,26 +312,7 @@ layerManagerNode.Expand(); terrainManagerNode.Expand(); } - /// - /// 刷新节点树 - /// - private void RefreshDataTree() - { - layerTree2.Nodes[0].Nodes.Clear(); - Int32 nCount = globeControl2.Globe.Layers.Count; - Int32 i = 0; - for (i = 0; i < nCount; i++) - { - GSODataset dataSpace = globeControl2.Globe.Layers[i].Dataset; - TreeNode node = new TreeNode(); - node.Text = dataSpace.Name; - node.ImageIndex = 0; - node.SelectedImageIndex = 0; - node.Checked = true; - node.Tag = dataSpace; - layerTree2.Nodes[0].Nodes.Add(node); - } - } + /// /// 目标图层按钮事件处理 /// @@ -494,22 +475,8 @@ } } } - /// - /// 改变指定节点的选中状态 - /// - /// - /// - private void CheckTreeNode(TreeNode node, Boolean bChecked) - { - CheckChildTreeNode(node, bChecked); - // 对于kml图层,如果当前处理的节点是true,那么要把所有的祖宗节点置为true - // 只有所有节点都未false,那么这个节点才为false - // CheckFatherTreeNode(node, bChecked); - globeControl1.Globe.Refresh(); - globeControl2.Globe.Refresh(); - - } + private void CheckChildTreeNode(TreeNode node, Boolean bChecked) { if (node == null) @@ -696,59 +663,7 @@ //} //CheckControl(e); } - /// - /// 树节点选中方法 - /// - /// - private void CheckControl(TreeViewEventArgs e) - { - if (e.Action != TreeViewAction.Unknown) - { - if (e.Node != null && !Convert.IsDBNull(e.Node)) - { - CheckParentNode(e.Node); - if (e.Node.Nodes.Count > 0) - { - CheckAllChildNodes(e.Node, e.Node.Checked); - } - } - } - } - /// - /// 改变所有子节点的状态 - /// - /// - /// - private void CheckAllChildNodes(TreeNode pn, bool IsChecked) - { - foreach (TreeNode tn in pn.Nodes) - { - tn.Checked = IsChecked; - if (tn.Tag.ToString().Contains("|")) - { - string nodeTag = tn.Tag.ToString().Split('|')[1]; - GSOLayer layer = globeControl1.Globe.Layers.GetLayerByCaption(nodeTag); - if (layer != null) - { - layer.Visible = IsChecked; - globeControl1.Globe.Refresh(); - } - } - if (tn.Tag is GSOFeature) - { - if (tn.Nodes.Count == 0) - { - GSOFeature feat = tn.Tag as GSOFeature; - feat.Visible = IsChecked; - globeControl1.Globe.Refresh(); - } - } - if (tn.Nodes.Count > 0) - { - CheckAllChildNodes(tn, IsChecked); - } - } - } + /// /// 改变父节点的选中状态,此处为所有子节点不选中时才取消父节点选中,可以根据需要修改 /// diff --git a/FrmLogin.cs b/FrmLogin.cs index 320fdd5..2afe46e 100644 --- a/FrmLogin.cs +++ b/FrmLogin.cs @@ -59,70 +59,6 @@ textBoxPassWord.Clear(); } } - - /// - /// 验证端口号 - /// - /// - private bool ValiPort() - { - Ping p = new Ping();//创建Ping对象p - PingReply pr = p.Send(Utility.localicenseserverip);//向指定IP或者主机名的计算机发送ICMP协议的ping数据包 - if (pr.Status == IPStatus.Success)//如果ping成功 - { - try - { - TcpClient tcpc = new TcpClient(Utility.localicenseserverip, Utility.localicenseserverport);//对IP地址为"192.168.0.105"的计算机的1500端口提出连接申请 - tcpc.Close(); - return true; - } - catch (Exception ex) - { - MessageBox.Show("端口连接错误!" + ex.Message); - return false; - } - } - else - { - int times = 0;//重新连接次数; - int count = 2;//设置尝试次数 - while (times < count) - { - //Thread.Sleep(1000);//等待时间(方便测试的话,你可以改为1000) - pr = p.Send(Utility.localicenseserverip); - - if (pr.Status == IPStatus.Success) - { - try - { - TcpClient tcpc = new TcpClient(Utility.localicenseserverip, Utility.localicenseserverport);//对IP地址为"192.168.0.105"的计算机的1500端口提出连接申请 - tcpc.Close(); - return true; - } - catch (Exception ex) - { - MessageBox.Show("端口连接错误!" + ex.Message); - return false; - } - } - else - { - times++; - if (times < count) - { - continue; - } - else - { - MessageBox.Show("重新尝试连接失败"); - return false; - } - } - - } - return false; - } - } /// /// 验证用户名、密码 /// diff --git a/FrmMetadata.cs b/FrmMetadata.cs index 886f65a..0365372 100644 --- a/FrmMetadata.cs +++ b/FrmMetadata.cs @@ -27,11 +27,7 @@ InitializeComponent(); loadTreeView(layerTree); } - private void FrmMetadata_Load(object sender, EventArgs e) - { - //this.ntLblC.Text = "nn"; - // loadTreeView(layerTree); - } + private void loadTreeView(TreeView tv)//构建图层树 { try diff --git a/FrmMetadataStat.cs b/FrmMetadataStat.cs index 790658a..e7696c6 100644 --- a/FrmMetadataStat.cs +++ b/FrmMetadataStat.cs @@ -197,9 +197,5 @@ } } - private void buttonX1_Click(object sender, EventArgs e) - { - drawChart(); - } } } diff --git a/FrmPatrolerManager.cs b/FrmPatrolerManager.cs index 37f8ffd..9e66aeb 100644 --- a/FrmPatrolerManager.cs +++ b/FrmPatrolerManager.cs @@ -109,82 +109,8 @@ this.winGridViewPager1.AllToExport = table; } - /// - /// 编辑 - /// - /// - /// - private void winGridViewPager1_OnEditSelected(object sender, EventArgs e) - { - - DataGridView grid = sender as DataGridView; - if (grid != null && grid.SelectedRows.Count>0) - { - DataGridViewRow row = grid.SelectedRows[0]; - try - { - long dbid = long.Parse(row.Cells["编号"].Value.ToString()); - String name = row.Cells["姓名"].Value.ToString(); - String sex = row.Cells["性别"].Value.ToString(); - String age = row.Cells["年龄"].Value.ToString(); - string phone = row.Cells["电话"].Value.ToString(); - age = String.IsNullOrEmpty(age.ToString().Trim()) ? "1" : age.ToString().Trim(); - FrmPatrolerEdit frm = new FrmPatrolerEdit(dbid.ToString(), name, age, sex, phone); - frm.reloadGrid += new ReloadPatrolerGrid(LoadData); - frm.ShowDialog(); - winGridViewPager1.Refresh(); - } - catch (Exception ex) - { - MessageBox.Show("编辑失败:" + ex.ToString(), "错误", MessageBoxButtons.OK, MessageBoxIcon.Error); - } - } - else - { - MessageBox.Show("没有选择记录", "提示"); - } - - } - - /// - /// 删除 - /// - /// - /// - private void winGridViewPager1_OnDeleteSelected(object sender, EventArgs e) - { - DataGridView grid = sender as DataGridView; - if (grid != null && grid.SelectedRows.Count > 0) - { - DataGridViewRow row = grid.SelectedRows[0]; - long dbid = long.Parse(row.Cells["编号"].Value.ToString()); - try - { - string state = row.Cells["状态"].Value.ToString(); - if ("在线".Equals(state)) - { - if (MessageBox.Show("确定注销?", "确认", MessageBoxButtons.YesNo, MessageBoxIcon.Question) == DialogResult.Yes) - { - String sql = "update patroler t set t.accountstate='LEAVER' where t.dbid=" + dbid; - OracleUtils.ExecuteNonQuery(OracleUtils.ConnectionString, CommandType.Text, sql); - } - } - else { - MessageBox.Show("人员不在线,无法注销", "信息"); - } - } - catch (Exception ex) - { - MessageBox.Show("人员注销失败:" + ex.ToString(), "错误", MessageBoxButtons.OK, MessageBoxIcon.Error); - } - } - else - { - MessageBox.Show("没有选择记录", "提示"); - } - } - - + + private void LoadData() { int pageIndex = winGridViewPager1.PagerInfo.CurrenetPageIndex; diff --git a/FrmRoadHDM.cs b/FrmRoadHDM.cs index e765313..e871dd5 100644 --- a/FrmRoadHDM.cs +++ b/FrmRoadHDM.cs @@ -333,31 +333,6 @@ this.Cursor = Cursors.Default; } } - - private void Export(GSOPoint3d _pnt, double r) - { - GSOPoint3ds pnts = new GSOPoint3ds(); - GSOPoint3d pnt = new GSOPoint3d(); - pnt.X = _pnt.X; - pnt.Y = _pnt.Y; - pnt.Z = _pnt.Z; - pnts.Add(pnt); - pnt.X = _pnt.X; - pnt.Y = _pnt.Y - 0.0000000005; - pnt.Z = _pnt.Z; - pnts.Add(pnt); - GSOGeoPolyline3D line = new GSOGeoPolyline3D(); - line.AddPart(pnts); - GSOGeoPolygon3D polygon = line.CreateBuffer(r * 2, true, 5, true, false); - GSOPoint3ds points = polygon[0]; - GSOGeoPolyline3D newLine = new GSOGeoPolyline3D(); - newLine.AddPart(points); - newLine.AltitudeMode = EnumAltitudeMode.RelativeToGround; - GSOFeature newFeature = new GSOFeature(); - newFeature.Geometry = newLine; - globeControl1.Globe.MemoryLayer.AddFeature(newFeature); - } - private void ExportCAD(double a, double b, double r) { GSOPoint3ds pnts = new GSOPoint3ds(); diff --git a/FrmUserAdd.cs b/FrmUserAdd.cs index c612ab4..f826427 100644 --- a/FrmUserAdd.cs +++ b/FrmUserAdd.cs @@ -231,24 +231,6 @@ //cbxRegion.SelectedIndexChanged += new EventHandler(cbxRegion_SelectedIndexChanged); } } - /// - /// 下拉框选中项改变事件处理 - /// - /// - /// - private void cbxRegion_SelectedIndexChanged(object sender, EventArgs e) - { - string sql = ""; - //string sql = "select casic_role.\"name\" from casic_role join casic_regionrole on casic_role.\"id\"=casic_regionrole.\"rid\" where casic_regionrole.\"reid\"=" + region[cbxRegion.SelectedItem.ToString().Trim()]; - DataTable dt = OledbHelper.QueryTable(sql); - if (dt != null && dt.Rows.Count > 0) - { - comboBoxExRegionRole.Items.Clear(); - for (int i = 0; i < dt.Rows.Count; i++) - { - comboBoxExRegionRole.Items.Add(dt.Rows[i][0].ToString().Trim());//部门角色 - } - } - } + } } diff --git a/FrmUserManager.cs b/FrmUserManager.cs index 571f0f0..ae254bc 100644 --- a/FrmUserManager.cs +++ b/FrmUserManager.cs @@ -81,11 +81,6 @@ } } } - //创建新用户 - private void buttonX2_Click(object sender, EventArgs e) - { - FrmUserAdd frm = new FrmUserAdd(-1); - frm.ShowDialog(); - } + } } diff --git a/FrmValveStatistics.cs b/FrmValveStatistics.cs index 545d56c..dd76777 100644 --- a/FrmValveStatistics.cs +++ b/FrmValveStatistics.cs @@ -54,7 +54,7 @@ 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") + if (chaFamenStatis.Series["阀门"].Points[m]!=null&&chaFamenStatis.Series["阀门"].Points[m].YValues[0].ToString() != "0") { chaFamenStatis.Series["阀门"].Points[m].Label = chaFamenStatis.Series[0].Points[m].YValues[0].ToString(); } diff --git a/Frm_password_reset.cs b/Frm_password_reset.cs index 7b51039..b9e5dc3 100644 --- a/Frm_password_reset.cs +++ b/Frm_password_reset.cs @@ -41,6 +41,7 @@ } catch (Exception ex) { + LogHelper.WriteLog(typeof(Frm_password_reset), ex.Message); } } private void initCombox() diff --git a/FrmpipeDeepstatis.cs b/FrmpipeDeepstatis.cs index e156db4..1a84d6c 100644 --- a/FrmpipeDeepstatis.cs +++ b/FrmpipeDeepstatis.cs @@ -307,7 +307,7 @@ chart1.Series[j].Points.DataBindXY(dic1.Keys, dic1.Values); for (int m = 0; m < dic1.Values.Count; m++) { - if (chart1.Series[j].Points[m].YValues[0].ToString() != "0") + if (chart1.Series[j].Points[m]!=null&&chart1.Series[j].Points[m].YValues[0].ToString() != "0") { chart1.Series[j].Points[m].Label = chart1.Series[j].Points[m].YValues[0].ToString(); diff --git a/FrmpipeDiametergather.cs b/FrmpipeDiametergather.cs index 30674de..057b09d 100644 --- a/FrmpipeDiametergather.cs +++ b/FrmpipeDiametergather.cs @@ -263,6 +263,7 @@ if (layer != null && layer is GSOFeatureLayer) { GSOFeatureLayer flayer = layer as GSOFeatureLayer; + if (layer == null) return; GSOFeatures features = flayer.GetAllFeatures(); if (features.Length > 0) { diff --git a/FrmpipeMaterialGather.cs b/FrmpipeMaterialGather.cs index c133ec3..398b884 100644 --- a/FrmpipeMaterialGather.cs +++ b/FrmpipeMaterialGather.cs @@ -280,6 +280,7 @@ if (layer != null && layer is GSOFeatureLayer) { GSOFeatureLayer flayer = layer as GSOFeatureLayer; + if (flayer == null) return; GSOFeatures features = flayer.GetAllFeatures(); if (features.Length > 0) { @@ -332,7 +333,7 @@ chart1.Series[j].Points.DataBindXY(dic1.Keys, dic1.Values); for (int m = 0; m < dic1.Values.Count; m++) { - if (chart1.Series[j].Points[m].YValues[0].ToString() != "0") + if (chart1.Series[j].Points[m]!=null&&chart1.Series[j].Points[m].YValues[0].ToString() != "0") { chart1.Series[j].Points[m].Label = chart1.Series[j].Points[m].YValues[0].ToString(); } diff --git a/Frmpipediameterstatis.cs b/Frmpipediameterstatis.cs index c0ed80a..50f8170 100644 --- a/Frmpipediameterstatis.cs +++ b/Frmpipediameterstatis.cs @@ -286,6 +286,7 @@ chart1.Series.Add(layerCaption); GSOFeatureLayer flayer = layer as GSOFeatureLayer; + if (layer == null) return; GSOFeatures features = flayer.GetAllFeatures(); if (features.Length > 0) { diff --git "a/GKT_Forms/F_GKT\346\225\260\346\215\256\350\276\223\345\205\245\350\276\223\345\207\272.cs" "b/GKT_Forms/F_GKT\346\225\260\346\215\256\350\276\223\345\205\245\350\276\223\345\207\272.cs" index c7bffd5..4db7d5d 100644 --- "a/GKT_Forms/F_GKT\346\225\260\346\215\256\350\276\223\345\205\245\350\276\223\345\207\272.cs" +++ "b/GKT_Forms/F_GKT\346\225\260\346\215\256\350\276\223\345\205\245\350\276\223\345\207\272.cs" @@ -198,12 +198,7 @@ } DialogResult = DialogResult.OK;//将当前窗体的对话框返回值设为OK } - private void treeView1_NodeMouseClick(object sender, TreeNodeMouseClickEventArgs e) - { - dir_Ok = comboBox_Disk.Text + e.Node.FullPath; - //dir = comboBox_Disk.Text + e.Node.FullPath; - e.Node.SelectedImageIndex = e.Node.ImageIndex; - } + string tempstr = ""; private void button1_Click(object sender, EventArgs e) { diff --git a/Cyberpipe.csproj b/Cyberpipe.csproj index 07a8c1a..e3cd12c 100644 --- a/Cyberpipe.csproj +++ b/Cyberpipe.csproj @@ -204,25 +204,6 @@ - - Form - - - F_GKT1数据输入输出.cs - - - Form - - - F_GKT1添加文件.cs - - - Form - - - F_GKT1添加项目.cs - - Form @@ -1068,18 +1049,6 @@ Frm_password_reset.cs - - Form - - - GKT.cs - - - Form - - - GKT1.cs - Form @@ -1258,12 +1227,6 @@ F_Projedit.cs - - Form - - - PED.cs - Form @@ -1331,16 +1294,6 @@ True Reference.map - - F_GKT1数据输入输出.cs - Designer - - - F_GKT1添加文件.cs - - - F_GKT1添加项目.cs - Form_EditTask.cs @@ -1836,12 +1789,6 @@ Frm_password_reset.cs - - GKT.cs - - - GKT1.cs - F_GKT数据输入输出.cs @@ -1934,9 +1881,6 @@ F_Projedit.cs - - PED.cs - F_数据输入输出.cs diff --git a/Cyberpipe.suo b/Cyberpipe.suo index 68ced4f..a1aecf8 100644 --- a/Cyberpipe.suo +++ b/Cyberpipe.suo Binary files differ diff --git a/EMS_Forms/Form_EditTask.cs b/EMS_Forms/Form_EditTask.cs index 718992f..f1d791f 100644 --- a/EMS_Forms/Form_EditTask.cs +++ b/EMS_Forms/Form_EditTask.cs @@ -119,7 +119,8 @@ String name = Convert.ToString(dr["USERNAME"]); comboBox_userName.Items.Add(name); - } + } + dr.Close(); comboBox_road.Items.Clear(); roadList = new List(); @@ -135,7 +136,7 @@ comboBox_road.Items.Add(name); } } - + dr1.Close(); conn.Close(); bool flag2 = false; @@ -185,7 +186,7 @@ catch (Exception ex) { - MessageBox.Show(ex.ToString()); + LogHelper.WriteLog(typeof(Form_EditTask), ex.Message); } } @@ -288,7 +289,7 @@ } catch (Exception ex) { - MessageBox.Show(ex.ToString()); + LogHelper.WriteLog(typeof(Form_EditTask), ex.Message); } } @@ -474,7 +475,7 @@ } catch (Exception ex) { - MessageBox.Show(ex.ToString()); + LogHelper.WriteLog(typeof(Form_EditTask), ex.Message); } this.Close(); @@ -495,6 +496,7 @@ { numList.Add(Convert.ToInt32(dr["DBID"])); } + dr.Close(); if (numList.Count == 0) { taskNumber = Convert.ToInt32(number) * 100; @@ -674,6 +676,7 @@ } } } + dr.Close(); conn.Close(); } diff --git a/EMS_Forms/Form_EventManager.cs b/EMS_Forms/Form_EventManager.cs index b18c45b..84807b2 100644 --- a/EMS_Forms/Form_EventManager.cs +++ b/EMS_Forms/Form_EventManager.cs @@ -64,6 +64,7 @@ comboBox_name.Items.Add(name); } + dr.Close(); conn.Close(); diff --git a/Forms/FrmMnModify.cs b/Forms/FrmMnModify.cs index 31cfc5f..d036360 100644 --- a/Forms/FrmMnModify.cs +++ b/Forms/FrmMnModify.cs @@ -68,15 +68,7 @@ questionGrid.Rows[idx].Cells[1].Value = sr.question; } } - /// 选中对象 - /// - /// - /// - /// - private void buttonX1_Click(object sender, EventArgs e) - { - globecontrol.Globe.Action = EnumAction3D.SelectObject; - } + /// /// 选中某一行 /// diff --git a/Forms/FrmPipelineModelDataBase.cs b/Forms/FrmPipelineModelDataBase.cs index 2acf0ca..7ce573f 100644 --- a/Forms/FrmPipelineModelDataBase.cs +++ b/Forms/FrmPipelineModelDataBase.cs @@ -35,19 +35,7 @@ ds = _ds; InitializeComponent(); } - /// - /// 单击选择shp格式文件 - /// - /// - /// - private void btnBrowseModel_Click(object sender, EventArgs e) - { - saveFileDialog1.Filter = "*.lgd|*.lgd"; - if (saveFileDialog1.ShowDialog() == DialogResult.OK) - { - txtModelLayer.Text = saveFileDialog1.FileName; - } - } + /// /// 窗体初始化事件处理 /// @@ -100,49 +88,6 @@ } } } - - private object convertFieldValue(string fieldname, object obj) - { - if (obj == null) - return null; - - try - { - string type = fields_types[fieldname].ToString(); - switch (type) - { - case "string": - return obj.ToString(); - case "int": - //return 101; - int intResult; - if (int.TryParse(obj.ToString(), out intResult)) - return intResult; - else - return null; - case "double": - //return 202.5; - double doubleResult; - if (double.TryParse(obj.ToString(), out doubleResult)) - return doubleResult; - else - return null; - case "date": - DateTime dtResult; - if (DateTime.TryParse(obj.ToString(), out dtResult)) - return dtResult; - else - return null; - } - return null; - } - catch (Exception ex) - { - MessageBox.Show(ex.ToString()); - return null; - } - } - public string lgdFilePath = ""; /// /// 选择管线颜色 @@ -610,33 +555,6 @@ { this.Close(); } - - private void cmbLayer_SelectedIndexChanged(object sender, EventArgs e) //选择图层 - { - GSOLayer layer = ctl.Globe.Layers.GetLayerByCaption(selectLayerName); - GSOFeatures features = layer.GetAllFeatures(); - if (features.Length == 0) - return; - - cmbFrom.Items.Clear(); - cmbTo.Items.Clear(); - cmbRadius.Items.Clear(); - cmbID.Items.Clear(); - for (int i = 0; i < features[0].GetFieldCount(); i++) - { - GeoScene.Data.GSOFieldDefn fielddef = (GeoScene.Data.GSOFieldDefn)(features[0].GetFieldDefn(i)); - - cmbFrom.Items.Add(fielddef.Name); - cmbTo.Items.Add(fielddef.Name); - cmbRadius.Items.Add(fielddef.Name); - cmbID.Items.Add(fielddef.Name); - } - cmbFrom.SelectedItem = "Deep1"; - cmbTo.SelectedItem = "Deep2"; - cmbRadius.SelectedItem = "Diameter"; - cmbID.SelectedItem = "Handle"; - } - private void buttonXLayerPath_Click(object sender, EventArgs e)//单击 选择shp格式的文件 { OpenFileDialog dlg = new OpenFileDialog(); diff --git a/Forms/FrmPipelineModelDataOneStep.cs b/Forms/FrmPipelineModelDataOneStep.cs index 18afda7..ec93b8a 100644 --- a/Forms/FrmPipelineModelDataOneStep.cs +++ b/Forms/FrmPipelineModelDataOneStep.cs @@ -38,19 +38,7 @@ layerTree = _layerTree; InitializeComponent(); } - /// - /// 单击选择shp格式文件 - /// - /// - /// - private void btnBrowseModel_Click(object sender, EventArgs e) - { - saveFileDialog1.Filter = "*.lgd|*.lgd"; - if (saveFileDialog1.ShowDialog() == DialogResult.OK) - { - txtModelLayer.Text = saveFileDialog1.FileName; - } - } + /// /// 窗体初始化事件处理 /// @@ -107,48 +95,7 @@ } } - private object convertFieldValue(string fieldname, object obj) - { - if (obj == null) - return null; - - try - { - string type = fields_types[fieldname].ToString(); - switch (type) - { - case "string": - return obj.ToString(); - case "int": - //return 101; - int intResult; - if (int.TryParse(obj.ToString(), out intResult)) - return intResult; - else - return null; - case "double": - //return 202.5; - double doubleResult; - if (double.TryParse(obj.ToString(), out doubleResult)) - return doubleResult; - else - return null; - case "date": - DateTime dtResult; - if (DateTime.TryParse(obj.ToString(), out dtResult)) - return dtResult; - else - return null; - } - return null; - } - catch (Exception ex) - { - MessageBox.Show(ex.ToString()); - return null; - } - } - + public string lgdFilePath = ""; /// /// 选择管线颜色 @@ -673,32 +620,6 @@ return featDs; } - private void cmbLayer_SelectedIndexChanged(object sender, EventArgs e) //选择图层 - { - GSOLayer layer = ctl.Globe.Layers.GetLayerByCaption(selectLayerName); - GSOFeatures features = layer.GetAllFeatures(); - if (features.Length == 0) - return; - - cmbFrom.Items.Clear(); - cmbTo.Items.Clear(); - cmbRadius.Items.Clear(); - cmbID.Items.Clear(); - for (int i = 0; i < features[0].GetFieldCount(); i++) - { - GeoScene.Data.GSOFieldDefn fielddef = (GeoScene.Data.GSOFieldDefn)(features[0].GetFieldDefn(i)); - - cmbFrom.Items.Add(fielddef.Name); - cmbTo.Items.Add(fielddef.Name); - cmbRadius.Items.Add(fielddef.Name); - cmbID.Items.Add(fielddef.Name); - } - cmbFrom.SelectedItem = "Deep1"; - cmbTo.SelectedItem = "Deep2"; - cmbRadius.SelectedItem = "Diameter"; - cmbID.SelectedItem = "Handle"; - } - private void buttonXLayerPath_Click(object sender, EventArgs e)//单击 选择shp格式的文件 { OpenFileDialog dlg = new OpenFileDialog(); @@ -949,38 +870,6 @@ } //txtLayername.Text = type + layername; } - /// - /// 连接数据库 - /// - /// - /// - private void buttonX1_Click(object sender, EventArgs e) - { - if (ds == null) - { - //没连的话,直接连接审核库; //审核库配置读配置文件 - string dbIp = Utility.sgdbip; - string database = Utility.sgdbname; - string user = Utility.sgdbuser; - string pass = Utility.sgdbpwd; - - if (!Utility.isNetworkConnectionSuccess(dbIp.Trim())) - { - MessageBox.Show("网络连接失败!", "提示"); - return; - } - - ds = ctl.Globe.DataManager.OpenOracleDataSource(dbIp + "/" + database, "", "", user, pass); - if (ds == null) - { - MessageBox.Show("数据库连接失败!", "提示", MessageBoxButtons.OK, MessageBoxIcon.Warning); - } - else - { - btnCreateModel.Enabled = true; - } - } - } private void btnClose_Click(object sender, EventArgs e) { diff --git a/Forms/FrmShRK.cs b/Forms/FrmShRK.cs index 0e2e722..f1d83cb 100644 --- a/Forms/FrmShRK.cs +++ b/Forms/FrmShRK.cs @@ -215,6 +215,7 @@ { sourcefeatds = sourcefeat as GSOFeatureDataset; } + if (sourcefeatds == null) return; sourcefeatds.Open(); GSOFeatures sourcefeatures = sourcefeatds.GetAllFeatures(); @@ -251,6 +252,7 @@ { desfeatds = desfeat as GSOFeatureDataset; } + if (desfeatds == null) return; desfeatds.Open(); //向新数据集写入字段 diff --git a/FrmAccessoriesSensor.cs b/FrmAccessoriesSensor.cs index 09fcdf1..2a7a80e 100644 --- a/FrmAccessoriesSensor.cs +++ b/FrmAccessoriesSensor.cs @@ -209,7 +209,7 @@ chart1.Series[0].Points.DataBindXY(dic.Keys, dic.Values); for (int m = 0; m < dic.Values.Count; m++) { - if (chart1.Series[0].Points[m].YValues[0].ToString() != "0") + if (chart1.Series[0].Points[m]!=null&&chart1.Series[0].Points[m].YValues[0].ToString() != "0") { chart1.Series[0].Points[m].Label = chart1.Series[0].Points[m].YValues[0].ToString(); } diff --git a/FrmAccessoriesgather.cs b/FrmAccessoriesgather.cs index 9e331e1..a475d9e 100644 --- a/FrmAccessoriesgather.cs +++ b/FrmAccessoriesgather.cs @@ -338,7 +338,7 @@ chart1.Series[0].Points.DataBindXY(dic.Keys, dic.Values); for (int m = 0; m < dic.Values.Count; m++) { - if (chart1.Series[0].Points[m].YValues[0].ToString() != "0") + if (chart1.Series[0].Points[m]!=null&&chart1.Series[0].Points[m].YValues[0].ToString() != "0") { chart1.Series[0].Points[m].Label = chart1.Series[0].Points[m].YValues[0].ToString(); } diff --git a/FrmAccessoryAnalysis.cs b/FrmAccessoryAnalysis.cs index 71d4579..44d4065 100644 --- a/FrmAccessoryAnalysis.cs +++ b/FrmAccessoryAnalysis.cs @@ -66,39 +66,6 @@ globeControl1.Refresh(); } /// - /// 键盘按键按下事件处理 - /// - /// - /// - private void txtRadius_KeyPress(object sender, KeyPressEventArgs e) - { - TextBox text = sender as TextBox; - if ((e.KeyChar < 48 || e.KeyChar > 57) && (e.KeyChar != 8) && (int)e.KeyChar != 46) - { - e.Handled = true; - } - if ((int)e.KeyChar == 46) //小数点 - { - if (text.Text.Length <= 0) - e.Handled = true; //小数点不能在第一位 - else //处理不规则的小数点 - { - float f; - float oldf; - bool b1 = false, b2 = false; - b1 = float.TryParse(text.Text, out oldf); - b2 = float.TryParse(text.Text + e.KeyChar.ToString(), out f); - if (b2 == false) - { - if (b1 == true) - e.Handled = true; - else - e.Handled = false; - } - } - } - } - /// /// 确定按钮事件处理 /// /// diff --git a/FrmAddValve.cs b/FrmAddValve.cs index 34d2fec..5f405b9 100644 --- a/FrmAddValve.cs +++ b/FrmAddValve.cs @@ -486,56 +486,6 @@ } } - - - - - - - - private void cmbLayer_SelectedIndexChanged(object sender, EventArgs e) - { - GSOLayer layer = globeControl1.Globe.Layers.GetLayerByCaption(selectLayerName); - GSOFeatures features = layer.GetAllFeatures(); - if (features.Length == 0) - return; - - combPath.Items.Clear(); - combZ.Items.Clear(); - combModelName.Items.Clear(); - - for (int i = 0; i < features[0].GetFieldCount(); i++) - { - GeoScene.Data.GSOFieldDefn fielddef = (GeoScene.Data.GSOFieldDefn)(features[0].GetFieldDefn(i)); - combPath.Items.Add(fielddef.Name); - combZ.Items.Add(fielddef.Name); - combModelName.Items.Add(fielddef.Name); - } - combModelName.SelectedItem = "编号"; - combPath.SelectedItem = "模型路径"; - if (combfile.SelectedIndex != -1) - { - - string layerCaption = combfile.SelectedItem.ToString().Trim(); - rukuLayer = globeControl1.Globe.Layers.GetLayerByCaption(layerCaption); - if (rukuLayer != null) - { - combPath.Items.Clear(); - combZ.Items.Clear(); - combModelName.Items.Clear(); - - } - for (int i = 0; i < features[0].GetFieldCount(); i++) - { - GeoScene.Data.GSOFieldDefn fielddef = (GeoScene.Data.GSOFieldDefn)(features[0].GetFieldDefn(i)); - combPath.Items.Add(fielddef.Name); - combZ.Items.Add(fielddef.Name); - combModelName.Items.Add(fielddef.Name); - } - combModelName.SelectedItem = "编号"; - combPath.SelectedItem = "模型路径"; - } - } /// /// 单击选择shp格式文件 /// diff --git a/FrmAddWellShp.cs b/FrmAddWellShp.cs index bb79ec0..a249725 100644 --- a/FrmAddWellShp.cs +++ b/FrmAddWellShp.cs @@ -478,32 +478,6 @@ } } } - - private void cmbLayer_SelectedIndexChanged(object sender, EventArgs e) - { - GSOLayer layer = globeControl1.Globe.Layers.GetLayerByCaption(selectLayerName); - GSOFeatures features = layer.GetAllFeatures(); - if (features.Length == 0) - return; - - combCode.Items.Clear(); - combDeep.Items.Clear(); - combModelName.Items.Clear(); - combAngle.Items.Clear(); - - for (int i = 0; i < features[0].GetFieldCount(); i++) - { - GeoScene.Data.GSOFieldDefn fielddef = (GeoScene.Data.GSOFieldDefn)(features[0].GetFieldDefn(i)); - combCode.Items.Add(fielddef.Name); - combDeep.Items.Add(fielddef.Name); - combModelName.Items.Add(fielddef.Name); - combAngle.Items.Add(fielddef.Name); - } - combCode.SelectedItem = "附属物编码"; - combDeep.SelectedItem = "井深"; - combModelName.SelectedItem = "编号"; - combAngle.SelectedItem = "符号角度"; - } /// /// 单击选择shp格式文件 /// diff --git a/FrmAddYuBiZiShp.cs b/FrmAddYuBiZiShp.cs index b312d51..332f037 100644 --- a/FrmAddYuBiZiShp.cs +++ b/FrmAddYuBiZiShp.cs @@ -383,80 +383,7 @@ } } - private void cmbLayer_SelectedIndexChanged(object sender, EventArgs e) - { - GSOLayer layer = globeControl1.Globe.Layers.GetLayerByCaption(selectLayerName); - GSOFeatures features = layer.GetAllFeatures(); - if (features.Length == 0) - return; - - combCode.Items.Clear(); - combDeep.Items.Clear(); - combModelName.Items.Clear(); - //comboLoad.Items.Clear(); - for (int i = 0; i < features[0].GetFieldCount(); i++) - { - GeoScene.Data.GSOFieldDefn fielddef = (GeoScene.Data.GSOFieldDefn)(features[0].GetFieldDefn(i)); - combCode.Items.Add(fielddef.Name); - combDeep.Items.Add(fielddef.Name); - combModelName.Items.Add(fielddef.Name); - //comboLoad.Items.Add(fielddef.Name); - } - combCode.SelectedItem = "附属物编码"; - combDeep.SelectedItem = "Z坐标"; - combModelName.SelectedItem = "编号"; - //comboLoad.SelectedItem = "模型路径"; - } - - private void buttonXLayerPath_Click(object sender, EventArgs e) - { - OpenFileDialog dlg = new OpenFileDialog(); - dlg.Filter = "*.shp|*.shp"; - dlg.Multiselect = false; - if (dlg.ShowDialog() == DialogResult.OK) - { - GSOLayer layer = globeControl1.Globe.Layers.Add(dlg.FileName); - string txtMessage = valiYBdata(layer); - if (txtMessage != "") - { - button3.Enabled = false; - //textBoxLayer.Text = ""; - combCode.Items.Clear(); - combDeep.Items.Clear(); - combModelName.Items.Clear(); - globeControl1.Globe.Layers.Remove(layer); - FrmValiDataShowErrorMessage showErrorMessage = new FrmValiDataShowErrorMessage(dlg.FileName, txtMessage); - showErrorMessage.ShowDialog(); - return; - } - else - { - button3.Enabled = true; - //textBoxLayer.Text = dlg.FileName; - selectLayerName = layer.Caption; - txtLayerName.Text = layer.Caption; - GSOFeatures features = layer.GetAllFeatures(); - if (features.Length == 0) - return; - - combCode.Items.Clear(); - combDeep.Items.Clear(); - combModelName.Items.Clear(); - for (int i = 0; i < features[0].GetFieldCount(); i++) - { - GeoScene.Data.GSOFieldDefn fielddef = (GeoScene.Data.GSOFieldDefn)(features[0].GetFieldDefn(i)); - combCode.Items.Add(fielddef.Name); - combDeep.Items.Add(fielddef.Name); - combModelName.Items.Add(fielddef.Name); - //comboLoad.Items.Add(fielddef.Name); - } - combCode.SelectedItem = "管点编码"; - combDeep.SelectedItem = "Z坐标"; - combModelName.SelectedItem = "编号"; - } - } - } - + private void FrmAddYuBiZiShp_FormClosing(object sender, FormClosingEventArgs e) { globeControl1.Globe.Refresh(); diff --git a/FrmAllPipelineStatis.cs b/FrmAllPipelineStatis.cs index 6421a26..a6eea29 100644 --- a/FrmAllPipelineStatis.cs +++ b/FrmAllPipelineStatis.cs @@ -84,7 +84,7 @@ chartAllAreaPipeline.Series["管线"].Points.DataBindXY(pipelineLengthAndType.Keys, pipelineLengthAndType.Values); for (int m = 0; m < pipelineLengthAndType.Values.Count; m++) { - if (chartAllAreaPipeline.Series["管线"].Points[m].YValues[0].ToString() != "0") + if (chartAllAreaPipeline.Series["管线"].Points[m]!=null&&chartAllAreaPipeline.Series["管线"].Points[m].YValues[0].ToString() != "0") { chartAllAreaPipeline.Series["管线"].Points[m].Label = chartAllAreaPipeline.Series[0].Points[m].YValues[0].ToString(); } @@ -94,7 +94,7 @@ } catch (Exception ex) { - //LogError.PublishError(ex); + LogHelper.WriteLog(typeof(FrmAllPipelineStatis), ex.Message); } } @@ -147,7 +147,7 @@ } DataTable dt = OledbHelper.QueryTable(sql); - if (dt != null && dt.Rows.Count > 0) + if (dt != null && dt.Rows.Count > 0 && chartAllAreaPipeline.Series["管线"].Points[indexHit]!=null) { dataGridViewX1.DataSource = dt; panel.Visible = true; diff --git a/FrmAllWorkWellStatis.cs b/FrmAllWorkWellStatis.cs index 6fec7af..6af8e4c 100644 --- a/FrmAllWorkWellStatis.cs +++ b/FrmAllWorkWellStatis.cs @@ -52,7 +52,7 @@ chartAllAreaPipeline.Series["井盖"].Points.DataBindXY(workWellLengthAndType.Keys, workWellLengthAndType.Values); for (int m = 0; m < workWellLengthAndType.Values.Count; m++) { - if (chartAllAreaPipeline.Series["井盖"].Points[m].YValues[0].ToString().Trim() != "0") + if (chartAllAreaPipeline.Series["井盖"].Points[m]!=null&&chartAllAreaPipeline.Series["井盖"].Points[m].YValues[0].ToString().Trim() != "0") { chartAllAreaPipeline.Series["井盖"].Points[m].Label = chartAllAreaPipeline.Series[0].Points[m].YValues[0].ToString(); } @@ -60,7 +60,7 @@ } catch (Exception ex) { - //LogError.PublishError(ex); + LogHelper.WriteLog(typeof(FrmAllWorkWellStatis), ex.Message); } } diff --git a/FrmBSQDuoBianXingStatis.cs b/FrmBSQDuoBianXingStatis.cs index e8b7d52..3e889b6 100644 --- a/FrmBSQDuoBianXingStatis.cs +++ b/FrmBSQDuoBianXingStatis.cs @@ -60,7 +60,7 @@ { for (int m = 0; m < bsq1.Values.Count; m++) { - if (chart1.Series["标识器"].Points[m].YValues[0].ToString() != "0") + if (chart1.Series["标识器"].Points[m]!=null&&chart1.Series["标识器"].Points[m].YValues[0].ToString() != "0") { count += Convert.ToInt16(chart1.Series[0].Points[m].YValues[0].ToString()); chart1.Series["标识器"].Points[m].Label = chart1.Series[0].Points[m].YValues[0].ToString(); diff --git a/FrmBSQDuoBianXingStreet.cs b/FrmBSQDuoBianXingStreet.cs index 2005ebb..1db5777 100644 --- a/FrmBSQDuoBianXingStreet.cs +++ b/FrmBSQDuoBianXingStreet.cs @@ -63,7 +63,7 @@ chartStatis.Series[0].Points.DataBindXY(bsq.Keys, bsq.Values); for (int m = 0; m < bsq.Values.Count; m++) { - if (chartStatis.Series[0].Points[m].YValues[0].ToString().Trim() != "0") + if (chartStatis.Series[0].Points[m]!=null&&chartStatis.Series[0].Points[m].YValues[0].ToString().Trim() != "0") { count += Convert.ToInt16(chartStatis.Series[0].Points[m].YValues[0].ToString()); chartStatis.Series[0].Points[m].Label = chartStatis.Series[0].Points[m].YValues[0].ToString(); diff --git a/FrmBSQStatis.cs b/FrmBSQStatis.cs index 390a55c..4aa0ee6 100644 --- a/FrmBSQStatis.cs +++ b/FrmBSQStatis.cs @@ -95,6 +95,8 @@ } } } + + dr.Close(); conn.Close(); for (int i = 0; i < typeLists.Count; i++) { @@ -123,7 +125,7 @@ chartStatis.Series[0].Points.DataBindXY(bsq.Keys, bsq.Values); for (int m = 0; m < bsq.Values.Count; m++) { - if (chartStatis.Series[0].Points[m].YValues[0].ToString().Trim() != "0") + if (chartStatis.Series[0].Points[m]!=null&&chartStatis.Series[0].Points[m].YValues[0].ToString().Trim() != "0") { //count += Convert.ToInt16(chartStatis.Series[0].Points[m].YValues[0].ToString()); chartStatis.Series[0].Points[m].Label = chartStatis.Series[0].Points[m].YValues[0].ToString(); diff --git a/FrmBSQStreet.cs b/FrmBSQStreet.cs index 9d88adb..7fbacad 100644 --- a/FrmBSQStreet.cs +++ b/FrmBSQStreet.cs @@ -44,7 +44,7 @@ chartStatis.Series[0].Points.DataBindXY(bsq.Keys, bsq.Values); for (int m = 0; m < bsq.Values.Count; m++) { - if (chartStatis.Series[0].Points[m].YValues[0].ToString().Trim() != "0") + if (chartStatis.Series[0].Points[m]!=null&&chartStatis.Series[0].Points[m].YValues[0].ToString().Trim() != "0") { count += Convert.ToInt16(chartStatis.Series[0].Points[m].YValues[0].ToString()); chartStatis.Series[0].Points[m].Label = chartStatis.Series[0].Points[m].YValues[0].ToString(); diff --git a/FrmBoosterValvers.cs b/FrmBoosterValvers.cs index 5061efc..df9b62b 100644 --- a/FrmBoosterValvers.cs +++ b/FrmBoosterValvers.cs @@ -236,199 +236,6 @@ count = 0; } } - /// - /// 添加火苗 - /// - /// - /// - /// - /// - private GSOFeature AddFire(double x,double y,double z) - { - // 烟火示例 - - string strResPath = Application.StartupPath + "/Resource"; - - // 烟火粒子示例,由三个发射器构成 - GSOGeoParticle geoParticle = new GSOGeoParticle(); - geoParticle.SetPosition(x, y, z); // 添加到这个经纬度位置 - geoParticle.AltitudeMode = EnumAltitudeMode.RelativeToGround; - - GSORingParticleEmitter emitter = new GSORingParticleEmitter(); - emitter.TexturePath = strResPath + "/ParticleImage/flare.png"; - - emitter.SetSizeFix(1, 1); - emitter.VelFix = 1; - emitter.VelRnd = 5; - - emitter.AngleXYFix = 0; - emitter.AngleXYRnd = 180; - - emitter.AngleXZFix = 90; - emitter.AngleXZRnd = 0; - - emitter.LifeFix = 0.5f; - emitter.LifeRnd = 0.0f; - - emitter.RotFix = 0; - emitter.RotRnd = 0; - - emitter.RotVelFix = 0; - emitter.RotVelRnd = 0; - - emitter.EmitPerSec = 100; - - // 采用线性插值生成粒子的初始颜色 - emitter.ColorRndStart = Color.White; - emitter.ColorRndEnd = Color.Red; - - - GSOColorParticleEffector effector2 = new GSOColorParticleEffector(); - effector2.SetColorChanged(0, -1, -1, 0); - effector2.StartTime = 0.0f; - effector2.EndTime = -1.0f; - emitter.AddEffector(effector2); - - // 将三个发射器添加到粒子对象中 - geoParticle.AddEmitter(emitter); - - geoParticle.Play(); - - GSOFeature feature = new GSOFeature(); - - feature.Geometry = geoParticle; - - globeControl1.Globe.MemoryLayer.AddFeature(feature); - - - return feature; - } - - /// - /// 添加喷泉 - /// - /// - private GSOFeature AddFountain() - { - string strResPath = Application.StartupPath + "/Resource"; - - GSOGeoParticle geoParticle = new GSOGeoParticle(); - geoParticle.SetPosition(116.314, 39.84, 0); // 添加到这个经纬度位置 - - GSOPointParticleEmitter emitter = new GSOPointParticleEmitter(); - emitter.TexturePath = strResPath + "/ParticleImage/test.png"; - - emitter.SetSizeFix(0.5f, 2); - emitter.VelFix = 10; - emitter.VelRnd = 2; - - emitter.GravityAcc = 9.8f; - emitter.AngleXYFix = 0; - emitter.AngleXYRnd = 180; - - emitter.AngleXZFix = 88; - emitter.AngleXZRnd = 2; - - //emitter.InnerRadius = 0; - // emitter.OuterRadius = 0.03f; - - emitter.LifeFix = 5.0f; - emitter.LifeRnd = 1.0f; - - emitter.RotFix = 0; - emitter.RotRnd = 0; - - emitter.RotVelFix = 0; - emitter.RotVelRnd = 0; - - emitter.EmitPerSec = 1000; - emitter.ColorRndStart = Color.FromArgb(33, 255, 255, 255); - emitter.ColorRndEnd = Color.FromArgb(11, 255, 255, 255); - emitter.IsLumAdded = false; - - // 将三个发射器添加到粒子对象中 - geoParticle.AddEmitter(emitter); - - geoParticle.Play(); - GSOFeature feature = new GSOFeature(); - - feature.Geometry = geoParticle; - - //globeControl1.Globe.MemoryLayer.AddFeature(feature); - globeControl1.Globe.FlyToFeature(feature); - - return feature; - } - - /// - /// 添加水柱 - /// - /// - private GSOFeature AddWaterLine() - { - string strResPath = Application.StartupPath + "/Resource"; - - GSOGeoParticle geoParticle = new GSOGeoParticle(); - geoParticle.SetPosition(116.308, 39.84, 0); // 添加到这个经纬度位置 - - GSOPointParticleEmitter emitter = new GSOPointParticleEmitter(); - - emitter.TexturePath = strResPath + "/ParticleImage/drop3.png"; - - geoParticle.TimerInterval = 1; - - emitter.SetSizeFix(2.0f, 2.0f); - - emitter.VelFix = 50; - emitter.VelRnd = 2; - - // emitter.IsLumAdded = false; - - emitter.GravityAcc = 9.8f; - emitter.AngleXYFix = 0; - emitter.AngleXYRnd = 2; - - emitter.AngleXZFix = 60; - emitter.AngleXZRnd = 2; - - //emitter.InnerRadius = 0; - // emitter.OuterRadius = 0.1f; - - emitter.LifeFix = 5.0f; - emitter.LifeRnd = 1.0f; - - emitter.RotFix = 0; - emitter.RotRnd = 0; - - emitter.RotVelFix = 0; - emitter.RotVelRnd = 0; - - emitter.EmitPerSec = 1500; - - emitter.ColorRndStart = Color.FromArgb(100, 222, 222, 222); - emitter.ColorRndEnd = Color.FromArgb(50, 222, 222, 222); - - /* - - GSOScaleParticleEffector effector1 = new GSOScaleParticleEffector(); - effector1.SetScale(0.2f, 0.2f); - effector1.StartTime = 0; - effector1.EndTime = -1; // 负数表示整个粒子生命结束 - emitter.AddEffector(effector1); - */ - - // 将三个发射器添加到粒子对象中 - geoParticle.AddEmitter(emitter); - - geoParticle.Play(); - GSOFeature feature = new GSOFeature(); - - feature.Geometry = geoParticle; - - //globeControl1.Globe.MemoryLayer.AddFeature(feature); - globeControl1.Globe.FlyToFeature(feature); - - return feature; - } + } } diff --git a/FrmBufferAnalysis.cs b/FrmBufferAnalysis.cs index f711133..db8ca59 100644 --- a/FrmBufferAnalysis.cs +++ b/FrmBufferAnalysis.cs @@ -123,39 +123,6 @@ } } /// - /// 半径文本框的键盘按键按下事件处理 - /// - /// - /// - private void txtRadius_KeyPress(object sender, KeyPressEventArgs e) - { - TextBox text = sender as TextBox; - if ((e.KeyChar < 48 || e.KeyChar > 57) && (e.KeyChar != 8) && (int)e.KeyChar != 46) - { - e.Handled = true; - } - if ((int)e.KeyChar == 46) //小数点 - { - if (text.Text.Length <= 0) - e.Handled = true; //小数点不能在第一位 - else //处理不规则的小数点 - { - float f; - float oldf; - bool b1 = false, b2 = false; - b1 = float.TryParse(text.Text, out oldf); - b2 = float.TryParse(text.Text + e.KeyChar.ToString(), out f); - if (b2 == false) - { - if (b1 == true) - e.Handled = true; - else - e.Handled = false; - } - } - } - } - /// /// 窗体关闭事件处理 /// /// diff --git a/FrmBufferAnalysisBSQ.cs b/FrmBufferAnalysisBSQ.cs index 24a96ca..f54208f 100644 --- a/FrmBufferAnalysisBSQ.cs +++ b/FrmBufferAnalysisBSQ.cs @@ -137,35 +137,7 @@ } } - private void txtRadius_KeyPress(object sender, KeyPressEventArgs e) - { - TextBox text = sender as TextBox; - if ((e.KeyChar < 48 || e.KeyChar > 57) && (e.KeyChar != 8) && (int)e.KeyChar != 46) - { - e.Handled = true; - } - if ((int)e.KeyChar == 46) //小数点 - { - if (text.Text.Length <= 0) - e.Handled = true; //小数点不能在第一位 - else //处理不规则的小数点 - { - float f; - float oldf; - bool b1 = false, b2 = false; - b1 = float.TryParse(text.Text, out oldf); - b2 = float.TryParse(text.Text + e.KeyChar.ToString(), out f); - if (b2 == false) - { - if (b1 == true) - e.Handled = true; - else - e.Handled = false; - } - } - } - } - + private void FrmBufferAnalysis_FormClosing(object sender, FormClosingEventArgs e) { //Form1.y = 0; @@ -316,27 +288,6 @@ } } - private void FlyToMenu_Click(object sender, EventArgs e) - { - if (m_feature != null) - { - if (m_feature.Geometry != null && m_feature.Geometry.Type == EnumGeometryType.GeoPolyline3D) - { - GSOGeoPolyline3D line = m_feature.Geometry as GSOGeoPolyline3D; - double length = line.GetSpaceLength(true, 6378137); - GSOGeoPolyline3D lineLine = line.GetSegment(0, length / 2); - GSOPoint3d point3d = lineLine[lineLine.PartCount - 1][lineLine[lineLine.PartCount - 1].Count - 1]; - - globeControl1.Globe.FlyToPosition(point3d, EnumAltitudeMode.Absolute, 0, 45, 5); - } - else - { - globeControl1.Globe.FlyToFeature(m_feature, 0, 45, 3); - } - LightMenu_Click(sender, e); - } - } - private void LightMenu_Click(object sender, EventArgs e) { flashflag = "single"; diff --git a/FrmDataBaseOpt.cs b/FrmDataBaseOpt.cs index b0c4b5d..8d7b69d 100644 --- a/FrmDataBaseOpt.cs +++ b/FrmDataBaseOpt.cs @@ -362,6 +362,7 @@ dbCombor.Items.Add(dblist[i].title); } } + /* /// /// 从配置文件读取数据库参数配置 /// @@ -428,6 +429,8 @@ } } + * */ + /* /// /// 向配置文件写入连接数据库的参数配置 /// @@ -485,6 +488,7 @@ MessageBox.Show(exp.ToString()); } } + * */ /// /// /// diff --git a/FrmDatabaseParaSetting.cs b/FrmDatabaseParaSetting.cs index a6fea46..63b596b 100644 --- a/FrmDatabaseParaSetting.cs +++ b/FrmDatabaseParaSetting.cs @@ -152,6 +152,7 @@ this.DialogResult = DialogResult.OK; this.Close(); } + /* /// /// 从配置文件读取数据库连接参数配置 /// @@ -218,6 +219,8 @@ } } + * */ + /* /// /// 向配置文件写入数据库参数配置 /// @@ -276,7 +279,7 @@ MessageBox.Show(ex.ToString()); } } - + */ /// /// 取消按钮事件处理 /// diff --git a/FrmDatabaseParaSetting2.cs b/FrmDatabaseParaSetting2.cs index 932d05e..96a87d5 100644 --- a/FrmDatabaseParaSetting2.cs +++ b/FrmDatabaseParaSetting2.cs @@ -148,6 +148,7 @@ this.DialogResult = DialogResult.OK; this.Close(); } + /* /// /// 从配置文件读取数据库连接参数配置 /// @@ -214,6 +215,8 @@ } } + * */ + /* /// /// 向配置文件写入数据库参数配置 /// @@ -272,7 +275,7 @@ MessageBox.Show(exp.ToString()); } } - + */ /// /// 取消按钮事件处理 /// diff --git a/FrmDiameterQuery.cs b/FrmDiameterQuery.cs index 68c948b..9a5215b 100644 --- a/FrmDiameterQuery.cs +++ b/FrmDiameterQuery.cs @@ -77,18 +77,7 @@ isBetween = true; } } - /// - /// 键盘按键按下事件处理 - /// - /// - /// - private void textBoxX1_KeyPress(object sender, KeyPressEventArgs e) - { - if ((e.KeyChar < 48 || e.KeyChar > 57) && e.KeyChar != 8) - { - e.Handled = true;//屏蔽 - } - } + bool isBetween = false; /// diff --git a/FrmDocumentEdit.cs b/FrmDocumentEdit.cs index aab2d31..e78a7ff 100644 --- a/FrmDocumentEdit.cs +++ b/FrmDocumentEdit.cs @@ -256,121 +256,6 @@ } - // - /// 将本地文件上传到指定的服务器(HttpWebRequest方法) - /// - /// 文件上传到的服务器 - /// 要上传的本地文件(全路径) - /// 文件上传后的名称 - /// 上传进度条 - /// 成功返回1,失败返回0 - private int Upload_Request(string address, string fileNamePath, string saveName, ProgressBar progressBar) - { - int returnValue = 0; - // 要上传的文件 - FileStream fs = new FileStream(fileNamePath, FileMode.Open, FileAccess.Read); - BinaryReader r = new BinaryReader(fs); - //时间戳 - string strBoundary = "----------" + DateTime.Now.Ticks.ToString("x"); - byte[] boundaryBytes = Encoding.ASCII.GetBytes("/r/n--" + strBoundary + "/r/n"); - //请求头部信息 - StringBuilder sb = new StringBuilder(); - sb.Append("--"); - sb.Append(strBoundary); - sb.Append("\r\n"); - sb.Append("Content-Disposition: form-data; name=\""); - sb.Append("file"); - sb.Append("\"; filename=\""); - sb.Append(saveName); - sb.Append("\""); - sb.Append("\r\n"); - sb.Append("Content-Type: "); - sb.Append("application/octet-stream"); - sb.Append("\r\n"); - sb.Append("\r\n"); - string strPostHeader = sb.ToString(); - byte[] postHeaderBytes = Encoding.UTF8.GetBytes(strPostHeader); - // 根据uri创建HttpWebRequest对象 - HttpWebRequest httpReq = (HttpWebRequest)WebRequest.Create(new Uri(address)); - httpReq.Method = "POST"; - //对发送的数据不使用缓存 - httpReq.AllowWriteStreamBuffering = false; - //设置获得响应的超时时间(300秒) - httpReq.Timeout = 300000; - httpReq.ContentType = "multipart/form-data; boundary=" + strBoundary; - long length = fs.Length + postHeaderBytes.Length + boundaryBytes.Length; - long fileLength = fs.Length; - httpReq.ContentLength = length; - try - { - progressBar.Maximum = int.MaxValue; - progressBar.Minimum = 0; - progressBar.Value = 0; - //每次上传4k - int bufferLength = 4096; - byte[] buffer = new byte[bufferLength]; - //已上传的字节数 - long offset = 0; - //开始上传时间 - DateTime startTime = DateTime.Now; - int size = r.Read(buffer, 0, bufferLength); - Stream postStream = httpReq.GetRequestStream(); - //发送请求头部消息 - postStream.Write(postHeaderBytes, 0, postHeaderBytes.Length); - while (size > 0) - { - postStream.Write(buffer, 0, size); - offset += size; - progressBar.Value = (int)(offset * (int.MaxValue / length)); - TimeSpan span = DateTime.Now - startTime; - double second = span.TotalSeconds; - //lblTime.Text = "已用时:" + second.ToString("F2") + "秒"; - //if (second > 0.001) - //{ - // lblSpeed.Text = " 平均速度:" + (offset / 1024 / second).ToString("0.00") + "KB/秒"; - //} - //else - //{ - // lblSpeed.Text = " 正在连接…"; - //} - //lblState.Text = "已上传:" + (offset * 100.0 / length).ToString("F2") + "%"; - //lblSize.Text = (offset / 1048576.0).ToString("F2") + "M/" + (fileLength / 1048576.0).ToString("F2") + "M"; - Application.DoEvents(); - size = r.Read(buffer, 0, bufferLength); - } - //添加尾部的时间戳 - postStream.Write(boundaryBytes, 0, boundaryBytes.Length); - postStream.Close(); - //获取服务器端的响应 - WebResponse webRespon = httpReq.GetResponse(); - Stream s = webRespon.GetResponseStream(); - StreamReader sr = new StreamReader(s); - //读取服务器端返回的消息 - String sReturnString = sr.ReadLine(); - s.Close(); - sr.Close(); - if (sReturnString == "Success") - { - returnValue = 1; - } - else if (sReturnString == "Error") - { - returnValue = 0; - } - } - catch(Exception ex) - { - returnValue = 0; - string str = ex.ToString(); - } - finally - { - fs.Close(); - r.Close(); - } - return returnValue; - } - private void btn_file_Click(object sender, EventArgs e) { OpenFileDialog dlg = new OpenFileDialog(); diff --git a/FrmExportCADS.cs b/FrmExportCADS.cs index 98772ea..59629dd 100644 --- a/FrmExportCADS.cs +++ b/FrmExportCADS.cs @@ -108,65 +108,6 @@ MessageBox.Show("请选中要导出的图层!", "提示", MessageBoxButtons.OK, MessageBoxIcon.Warning); } } - private Boolean MerageToFile(GSOFeatures features, String strDestFile, String strProj4)//图层追加 - { - if (features == null) - { - return false; - } - Boolean bSuccess = false; - - string strDir = GSOUtility.GetFileDir(strDestFile); - string strLPRJFile = GSOUtility.ChangeExt(strDestFile, ".lprj"); - string strExt = GSOUtility.GetFileExt(strDestFile); - - // 如果投影文件存在,投影以投影文件为准 - if (File.Exists(strLPRJFile)) - { - // 如果是dxf,则这样处理 - if (strExt.ToLower() == ".dxf") - { - string strTempSrcFile = strDir + "srcFeatures_dxftmp" + strExt; - globeControl1.Globe.DataManager.SaveFeatureData(features, strTempSrcFile, strLPRJFile, 4); - bSuccess = GSOUtility.MergeTwoDXFFileFeatures(strDestFile, strTempSrcFile); - File.Delete(strTempSrcFile); - } - else - { - GSOFeatures srcFeatures = globeControl1.Globe.DataManager.ReadFeatureData(strDestFile); - int nCount = features.Length; - int i = 0; - for (i = 0; i < nCount; i++) - { - srcFeatures.Add(features[i]); - } - bSuccess = globeControl1.Globe.DataManager.SaveFeatureData(srcFeatures, strDestFile, strLPRJFile, 4); - } - } - else - { - // 如果是dxf,则这样处理 - if (strExt.ToLower() == ".dxf") - { - string strTempSrcFile = strDir + "srcFeatures_dxftmp" + strExt; - globeControl1.Globe.DataManager.SaveFeatureData(features, strTempSrcFile, strProj4, 0); - bSuccess = GSOUtility.MergeTwoDXFFileFeatures(strDestFile, strTempSrcFile); - File.Delete(strTempSrcFile); - } - else - { - GSOFeatures srcFeatures = globeControl1.Globe.DataManager.ReadFeatureData(strDestFile); - int nCount = features.Length; - int i = 0; - for (i = 0; i < nCount; i++) - { - srcFeatures.Add(features[i]); - } - bSuccess = globeControl1.Globe.DataManager.SaveFeatureData(srcFeatures, strDestFile, strProj4, 0); - } - } - return bSuccess; - } /// /// 关闭按钮事件处理 /// diff --git a/FrmHDMAnalysis3.cs b/FrmHDMAnalysis3.cs index 4f73af6..2ada735 100644 --- a/FrmHDMAnalysis3.cs +++ b/FrmHDMAnalysis3.cs @@ -436,29 +436,6 @@ } layerTemp.RemoveAllFeature(); } - private void Export(GSOPoint3d _pnt, double r) - { - GSOPoint3ds pnts = new GSOPoint3ds(); - GSOPoint3d pnt = new GSOPoint3d(); - pnt.X = _pnt.X; - pnt.Y = _pnt.Y; - pnt.Z = _pnt.Z; - pnts.Add(pnt); - pnt.X = _pnt.X; - pnt.Y = _pnt.Y - 0.0000000005; - pnt.Z = _pnt.Z; - pnts.Add(pnt); - GSOGeoPolyline3D line = new GSOGeoPolyline3D(); - line.AddPart(pnts); - GSOGeoPolygon3D polygon = line.CreateBuffer(r * 2, true, 5, true, false); - GSOPoint3ds points = polygon[0]; - GSOGeoPolyline3D newLine = new GSOGeoPolyline3D(); - newLine.AddPart(points); - newLine.AltitudeMode = EnumAltitudeMode.RelativeToGround; - GSOFeature newFeature = new GSOFeature(); - newFeature.Geometry = newLine; - globeControl1.Globe.MemoryLayer.AddFeature(newFeature); - } private void ExportCAD(double a, double b, double r) { diff --git a/FrmHotFuncStat.cs b/FrmHotFuncStat.cs index c980f34..2eb1476 100644 --- a/FrmHotFuncStat.cs +++ b/FrmHotFuncStat.cs @@ -421,13 +421,6 @@ } } - private void HFS_Pderive_Click(object sender, EventArgs e) - { - if (TV_Files.SelectedNode != null) - { - HFSClass.GuideEdit_form("G", TV_Files, int.Parse(((ToolStripMenuItem)sender).Tag.ToString())); - } - } private void 导入ToolStripMenuItem_Click(object sender, EventArgs e) { @@ -530,22 +523,8 @@ } } - private void 导出ToolStripMenuItem1_Click(object sender, EventArgs e) - { - 导出ToolStripMenuItem2_Click(sender, e); - } + - private void TV_HFSSrchRslt_AfterCollapse(object sender, TreeViewEventArgs e) - { - e.Node.ImageIndex = 0; - } - - private void TV_HFSSrchRslt_AfterExpand(object sender, TreeViewEventArgs e) - { - HFSClass.ADD_TreeNode(TV_Files, e.Node); - e.Node.ImageIndex = 1; - } - private void 导出ToolStripMenuItem1_Click_1(object sender, EventArgs e) { if ((TV_HFSSrchRslt.SelectedNode != null) && (TV_HFSSrchRslt.SelectedNode.Parent != null)) diff --git a/FrmLayerControl.cs b/FrmLayerControl.cs index e7917c3..28fa14d 100644 --- a/FrmLayerControl.cs +++ b/FrmLayerControl.cs @@ -312,26 +312,7 @@ layerManagerNode.Expand(); terrainManagerNode.Expand(); } - /// - /// 刷新节点树 - /// - private void RefreshDataTree() - { - layerTree2.Nodes[0].Nodes.Clear(); - Int32 nCount = globeControl2.Globe.Layers.Count; - Int32 i = 0; - for (i = 0; i < nCount; i++) - { - GSODataset dataSpace = globeControl2.Globe.Layers[i].Dataset; - TreeNode node = new TreeNode(); - node.Text = dataSpace.Name; - node.ImageIndex = 0; - node.SelectedImageIndex = 0; - node.Checked = true; - node.Tag = dataSpace; - layerTree2.Nodes[0].Nodes.Add(node); - } - } + /// /// 目标图层按钮事件处理 /// @@ -494,22 +475,8 @@ } } } - /// - /// 改变指定节点的选中状态 - /// - /// - /// - private void CheckTreeNode(TreeNode node, Boolean bChecked) - { - CheckChildTreeNode(node, bChecked); - // 对于kml图层,如果当前处理的节点是true,那么要把所有的祖宗节点置为true - // 只有所有节点都未false,那么这个节点才为false - // CheckFatherTreeNode(node, bChecked); - globeControl1.Globe.Refresh(); - globeControl2.Globe.Refresh(); - - } + private void CheckChildTreeNode(TreeNode node, Boolean bChecked) { if (node == null) @@ -696,59 +663,7 @@ //} //CheckControl(e); } - /// - /// 树节点选中方法 - /// - /// - private void CheckControl(TreeViewEventArgs e) - { - if (e.Action != TreeViewAction.Unknown) - { - if (e.Node != null && !Convert.IsDBNull(e.Node)) - { - CheckParentNode(e.Node); - if (e.Node.Nodes.Count > 0) - { - CheckAllChildNodes(e.Node, e.Node.Checked); - } - } - } - } - /// - /// 改变所有子节点的状态 - /// - /// - /// - private void CheckAllChildNodes(TreeNode pn, bool IsChecked) - { - foreach (TreeNode tn in pn.Nodes) - { - tn.Checked = IsChecked; - if (tn.Tag.ToString().Contains("|")) - { - string nodeTag = tn.Tag.ToString().Split('|')[1]; - GSOLayer layer = globeControl1.Globe.Layers.GetLayerByCaption(nodeTag); - if (layer != null) - { - layer.Visible = IsChecked; - globeControl1.Globe.Refresh(); - } - } - if (tn.Tag is GSOFeature) - { - if (tn.Nodes.Count == 0) - { - GSOFeature feat = tn.Tag as GSOFeature; - feat.Visible = IsChecked; - globeControl1.Globe.Refresh(); - } - } - if (tn.Nodes.Count > 0) - { - CheckAllChildNodes(tn, IsChecked); - } - } - } + /// /// 改变父节点的选中状态,此处为所有子节点不选中时才取消父节点选中,可以根据需要修改 /// diff --git a/FrmLogin.cs b/FrmLogin.cs index 320fdd5..2afe46e 100644 --- a/FrmLogin.cs +++ b/FrmLogin.cs @@ -59,70 +59,6 @@ textBoxPassWord.Clear(); } } - - /// - /// 验证端口号 - /// - /// - private bool ValiPort() - { - Ping p = new Ping();//创建Ping对象p - PingReply pr = p.Send(Utility.localicenseserverip);//向指定IP或者主机名的计算机发送ICMP协议的ping数据包 - if (pr.Status == IPStatus.Success)//如果ping成功 - { - try - { - TcpClient tcpc = new TcpClient(Utility.localicenseserverip, Utility.localicenseserverport);//对IP地址为"192.168.0.105"的计算机的1500端口提出连接申请 - tcpc.Close(); - return true; - } - catch (Exception ex) - { - MessageBox.Show("端口连接错误!" + ex.Message); - return false; - } - } - else - { - int times = 0;//重新连接次数; - int count = 2;//设置尝试次数 - while (times < count) - { - //Thread.Sleep(1000);//等待时间(方便测试的话,你可以改为1000) - pr = p.Send(Utility.localicenseserverip); - - if (pr.Status == IPStatus.Success) - { - try - { - TcpClient tcpc = new TcpClient(Utility.localicenseserverip, Utility.localicenseserverport);//对IP地址为"192.168.0.105"的计算机的1500端口提出连接申请 - tcpc.Close(); - return true; - } - catch (Exception ex) - { - MessageBox.Show("端口连接错误!" + ex.Message); - return false; - } - } - else - { - times++; - if (times < count) - { - continue; - } - else - { - MessageBox.Show("重新尝试连接失败"); - return false; - } - } - - } - return false; - } - } /// /// 验证用户名、密码 /// diff --git a/FrmMetadata.cs b/FrmMetadata.cs index 886f65a..0365372 100644 --- a/FrmMetadata.cs +++ b/FrmMetadata.cs @@ -27,11 +27,7 @@ InitializeComponent(); loadTreeView(layerTree); } - private void FrmMetadata_Load(object sender, EventArgs e) - { - //this.ntLblC.Text = "nn"; - // loadTreeView(layerTree); - } + private void loadTreeView(TreeView tv)//构建图层树 { try diff --git a/FrmMetadataStat.cs b/FrmMetadataStat.cs index 790658a..e7696c6 100644 --- a/FrmMetadataStat.cs +++ b/FrmMetadataStat.cs @@ -197,9 +197,5 @@ } } - private void buttonX1_Click(object sender, EventArgs e) - { - drawChart(); - } } } diff --git a/FrmPatrolerManager.cs b/FrmPatrolerManager.cs index 37f8ffd..9e66aeb 100644 --- a/FrmPatrolerManager.cs +++ b/FrmPatrolerManager.cs @@ -109,82 +109,8 @@ this.winGridViewPager1.AllToExport = table; } - /// - /// 编辑 - /// - /// - /// - private void winGridViewPager1_OnEditSelected(object sender, EventArgs e) - { - - DataGridView grid = sender as DataGridView; - if (grid != null && grid.SelectedRows.Count>0) - { - DataGridViewRow row = grid.SelectedRows[0]; - try - { - long dbid = long.Parse(row.Cells["编号"].Value.ToString()); - String name = row.Cells["姓名"].Value.ToString(); - String sex = row.Cells["性别"].Value.ToString(); - String age = row.Cells["年龄"].Value.ToString(); - string phone = row.Cells["电话"].Value.ToString(); - age = String.IsNullOrEmpty(age.ToString().Trim()) ? "1" : age.ToString().Trim(); - FrmPatrolerEdit frm = new FrmPatrolerEdit(dbid.ToString(), name, age, sex, phone); - frm.reloadGrid += new ReloadPatrolerGrid(LoadData); - frm.ShowDialog(); - winGridViewPager1.Refresh(); - } - catch (Exception ex) - { - MessageBox.Show("编辑失败:" + ex.ToString(), "错误", MessageBoxButtons.OK, MessageBoxIcon.Error); - } - } - else - { - MessageBox.Show("没有选择记录", "提示"); - } - - } - - /// - /// 删除 - /// - /// - /// - private void winGridViewPager1_OnDeleteSelected(object sender, EventArgs e) - { - DataGridView grid = sender as DataGridView; - if (grid != null && grid.SelectedRows.Count > 0) - { - DataGridViewRow row = grid.SelectedRows[0]; - long dbid = long.Parse(row.Cells["编号"].Value.ToString()); - try - { - string state = row.Cells["状态"].Value.ToString(); - if ("在线".Equals(state)) - { - if (MessageBox.Show("确定注销?", "确认", MessageBoxButtons.YesNo, MessageBoxIcon.Question) == DialogResult.Yes) - { - String sql = "update patroler t set t.accountstate='LEAVER' where t.dbid=" + dbid; - OracleUtils.ExecuteNonQuery(OracleUtils.ConnectionString, CommandType.Text, sql); - } - } - else { - MessageBox.Show("人员不在线,无法注销", "信息"); - } - } - catch (Exception ex) - { - MessageBox.Show("人员注销失败:" + ex.ToString(), "错误", MessageBoxButtons.OK, MessageBoxIcon.Error); - } - } - else - { - MessageBox.Show("没有选择记录", "提示"); - } - } - - + + private void LoadData() { int pageIndex = winGridViewPager1.PagerInfo.CurrenetPageIndex; diff --git a/FrmRoadHDM.cs b/FrmRoadHDM.cs index e765313..e871dd5 100644 --- a/FrmRoadHDM.cs +++ b/FrmRoadHDM.cs @@ -333,31 +333,6 @@ this.Cursor = Cursors.Default; } } - - private void Export(GSOPoint3d _pnt, double r) - { - GSOPoint3ds pnts = new GSOPoint3ds(); - GSOPoint3d pnt = new GSOPoint3d(); - pnt.X = _pnt.X; - pnt.Y = _pnt.Y; - pnt.Z = _pnt.Z; - pnts.Add(pnt); - pnt.X = _pnt.X; - pnt.Y = _pnt.Y - 0.0000000005; - pnt.Z = _pnt.Z; - pnts.Add(pnt); - GSOGeoPolyline3D line = new GSOGeoPolyline3D(); - line.AddPart(pnts); - GSOGeoPolygon3D polygon = line.CreateBuffer(r * 2, true, 5, true, false); - GSOPoint3ds points = polygon[0]; - GSOGeoPolyline3D newLine = new GSOGeoPolyline3D(); - newLine.AddPart(points); - newLine.AltitudeMode = EnumAltitudeMode.RelativeToGround; - GSOFeature newFeature = new GSOFeature(); - newFeature.Geometry = newLine; - globeControl1.Globe.MemoryLayer.AddFeature(newFeature); - } - private void ExportCAD(double a, double b, double r) { GSOPoint3ds pnts = new GSOPoint3ds(); diff --git a/FrmUserAdd.cs b/FrmUserAdd.cs index c612ab4..f826427 100644 --- a/FrmUserAdd.cs +++ b/FrmUserAdd.cs @@ -231,24 +231,6 @@ //cbxRegion.SelectedIndexChanged += new EventHandler(cbxRegion_SelectedIndexChanged); } } - /// - /// 下拉框选中项改变事件处理 - /// - /// - /// - private void cbxRegion_SelectedIndexChanged(object sender, EventArgs e) - { - string sql = ""; - //string sql = "select casic_role.\"name\" from casic_role join casic_regionrole on casic_role.\"id\"=casic_regionrole.\"rid\" where casic_regionrole.\"reid\"=" + region[cbxRegion.SelectedItem.ToString().Trim()]; - DataTable dt = OledbHelper.QueryTable(sql); - if (dt != null && dt.Rows.Count > 0) - { - comboBoxExRegionRole.Items.Clear(); - for (int i = 0; i < dt.Rows.Count; i++) - { - comboBoxExRegionRole.Items.Add(dt.Rows[i][0].ToString().Trim());//部门角色 - } - } - } + } } diff --git a/FrmUserManager.cs b/FrmUserManager.cs index 571f0f0..ae254bc 100644 --- a/FrmUserManager.cs +++ b/FrmUserManager.cs @@ -81,11 +81,6 @@ } } } - //创建新用户 - private void buttonX2_Click(object sender, EventArgs e) - { - FrmUserAdd frm = new FrmUserAdd(-1); - frm.ShowDialog(); - } + } } diff --git a/FrmValveStatistics.cs b/FrmValveStatistics.cs index 545d56c..dd76777 100644 --- a/FrmValveStatistics.cs +++ b/FrmValveStatistics.cs @@ -54,7 +54,7 @@ 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") + if (chaFamenStatis.Series["阀门"].Points[m]!=null&&chaFamenStatis.Series["阀门"].Points[m].YValues[0].ToString() != "0") { chaFamenStatis.Series["阀门"].Points[m].Label = chaFamenStatis.Series[0].Points[m].YValues[0].ToString(); } diff --git a/Frm_password_reset.cs b/Frm_password_reset.cs index 7b51039..b9e5dc3 100644 --- a/Frm_password_reset.cs +++ b/Frm_password_reset.cs @@ -41,6 +41,7 @@ } catch (Exception ex) { + LogHelper.WriteLog(typeof(Frm_password_reset), ex.Message); } } private void initCombox() diff --git a/FrmpipeDeepstatis.cs b/FrmpipeDeepstatis.cs index e156db4..1a84d6c 100644 --- a/FrmpipeDeepstatis.cs +++ b/FrmpipeDeepstatis.cs @@ -307,7 +307,7 @@ chart1.Series[j].Points.DataBindXY(dic1.Keys, dic1.Values); for (int m = 0; m < dic1.Values.Count; m++) { - if (chart1.Series[j].Points[m].YValues[0].ToString() != "0") + if (chart1.Series[j].Points[m]!=null&&chart1.Series[j].Points[m].YValues[0].ToString() != "0") { chart1.Series[j].Points[m].Label = chart1.Series[j].Points[m].YValues[0].ToString(); diff --git a/FrmpipeDiametergather.cs b/FrmpipeDiametergather.cs index 30674de..057b09d 100644 --- a/FrmpipeDiametergather.cs +++ b/FrmpipeDiametergather.cs @@ -263,6 +263,7 @@ if (layer != null && layer is GSOFeatureLayer) { GSOFeatureLayer flayer = layer as GSOFeatureLayer; + if (layer == null) return; GSOFeatures features = flayer.GetAllFeatures(); if (features.Length > 0) { diff --git a/FrmpipeMaterialGather.cs b/FrmpipeMaterialGather.cs index c133ec3..398b884 100644 --- a/FrmpipeMaterialGather.cs +++ b/FrmpipeMaterialGather.cs @@ -280,6 +280,7 @@ if (layer != null && layer is GSOFeatureLayer) { GSOFeatureLayer flayer = layer as GSOFeatureLayer; + if (flayer == null) return; GSOFeatures features = flayer.GetAllFeatures(); if (features.Length > 0) { @@ -332,7 +333,7 @@ chart1.Series[j].Points.DataBindXY(dic1.Keys, dic1.Values); for (int m = 0; m < dic1.Values.Count; m++) { - if (chart1.Series[j].Points[m].YValues[0].ToString() != "0") + if (chart1.Series[j].Points[m]!=null&&chart1.Series[j].Points[m].YValues[0].ToString() != "0") { chart1.Series[j].Points[m].Label = chart1.Series[j].Points[m].YValues[0].ToString(); } diff --git a/Frmpipediameterstatis.cs b/Frmpipediameterstatis.cs index c0ed80a..50f8170 100644 --- a/Frmpipediameterstatis.cs +++ b/Frmpipediameterstatis.cs @@ -286,6 +286,7 @@ chart1.Series.Add(layerCaption); GSOFeatureLayer flayer = layer as GSOFeatureLayer; + if (layer == null) return; GSOFeatures features = flayer.GetAllFeatures(); if (features.Length > 0) { diff --git "a/GKT_Forms/F_GKT\346\225\260\346\215\256\350\276\223\345\205\245\350\276\223\345\207\272.cs" "b/GKT_Forms/F_GKT\346\225\260\346\215\256\350\276\223\345\205\245\350\276\223\345\207\272.cs" index c7bffd5..4db7d5d 100644 --- "a/GKT_Forms/F_GKT\346\225\260\346\215\256\350\276\223\345\205\245\350\276\223\345\207\272.cs" +++ "b/GKT_Forms/F_GKT\346\225\260\346\215\256\350\276\223\345\205\245\350\276\223\345\207\272.cs" @@ -198,12 +198,7 @@ } DialogResult = DialogResult.OK;//将当前窗体的对话框返回值设为OK } - private void treeView1_NodeMouseClick(object sender, TreeNodeMouseClickEventArgs e) - { - dir_Ok = comboBox_Disk.Text + e.Node.FullPath; - //dir = comboBox_Disk.Text + e.Node.FullPath; - e.Node.SelectedImageIndex = e.Node.ImageIndex; - } + string tempstr = ""; private void button1_Click(object sender, EventArgs e) { diff --git a/HFS_Forms/Frm_HFSprojedits.cs b/HFS_Forms/Frm_HFSprojedits.cs index 96dd76f..3c232a1 100644 --- a/HFS_Forms/Frm_HFSprojedits.cs +++ b/HFS_Forms/Frm_HFSprojedits.cs @@ -126,16 +126,6 @@ Close(); } - - - private void TB_ProjName_KeyPress(object sender, KeyPressEventArgs e) - { - if (HFSAClass.Files_NameChar(e) == 0) - e.Handled = true; - if (e.KeyChar == '\r') - OK_Click(sender, e); - } - private void Frm_HFSProjedit_Load(object sender, EventArgs e) { @@ -175,10 +165,6 @@ } } - private void Cancel_Click(object sender, EventArgs e) - { - this.Close(); - } private void Cancel_Click_1(object sender, EventArgs e) { diff --git a/Cyberpipe.csproj b/Cyberpipe.csproj index 07a8c1a..e3cd12c 100644 --- a/Cyberpipe.csproj +++ b/Cyberpipe.csproj @@ -204,25 +204,6 @@ - - Form - - - F_GKT1数据输入输出.cs - - - Form - - - F_GKT1添加文件.cs - - - Form - - - F_GKT1添加项目.cs - - Form @@ -1068,18 +1049,6 @@ Frm_password_reset.cs - - Form - - - GKT.cs - - - Form - - - GKT1.cs - Form @@ -1258,12 +1227,6 @@ F_Projedit.cs - - Form - - - PED.cs - Form @@ -1331,16 +1294,6 @@ True Reference.map - - F_GKT1数据输入输出.cs - Designer - - - F_GKT1添加文件.cs - - - F_GKT1添加项目.cs - Form_EditTask.cs @@ -1836,12 +1789,6 @@ Frm_password_reset.cs - - GKT.cs - - - GKT1.cs - F_GKT数据输入输出.cs @@ -1934,9 +1881,6 @@ F_Projedit.cs - - PED.cs - F_数据输入输出.cs diff --git a/Cyberpipe.suo b/Cyberpipe.suo index 68ced4f..a1aecf8 100644 --- a/Cyberpipe.suo +++ b/Cyberpipe.suo Binary files differ diff --git a/EMS_Forms/Form_EditTask.cs b/EMS_Forms/Form_EditTask.cs index 718992f..f1d791f 100644 --- a/EMS_Forms/Form_EditTask.cs +++ b/EMS_Forms/Form_EditTask.cs @@ -119,7 +119,8 @@ String name = Convert.ToString(dr["USERNAME"]); comboBox_userName.Items.Add(name); - } + } + dr.Close(); comboBox_road.Items.Clear(); roadList = new List(); @@ -135,7 +136,7 @@ comboBox_road.Items.Add(name); } } - + dr1.Close(); conn.Close(); bool flag2 = false; @@ -185,7 +186,7 @@ catch (Exception ex) { - MessageBox.Show(ex.ToString()); + LogHelper.WriteLog(typeof(Form_EditTask), ex.Message); } } @@ -288,7 +289,7 @@ } catch (Exception ex) { - MessageBox.Show(ex.ToString()); + LogHelper.WriteLog(typeof(Form_EditTask), ex.Message); } } @@ -474,7 +475,7 @@ } catch (Exception ex) { - MessageBox.Show(ex.ToString()); + LogHelper.WriteLog(typeof(Form_EditTask), ex.Message); } this.Close(); @@ -495,6 +496,7 @@ { numList.Add(Convert.ToInt32(dr["DBID"])); } + dr.Close(); if (numList.Count == 0) { taskNumber = Convert.ToInt32(number) * 100; @@ -674,6 +676,7 @@ } } } + dr.Close(); conn.Close(); } diff --git a/EMS_Forms/Form_EventManager.cs b/EMS_Forms/Form_EventManager.cs index b18c45b..84807b2 100644 --- a/EMS_Forms/Form_EventManager.cs +++ b/EMS_Forms/Form_EventManager.cs @@ -64,6 +64,7 @@ comboBox_name.Items.Add(name); } + dr.Close(); conn.Close(); diff --git a/Forms/FrmMnModify.cs b/Forms/FrmMnModify.cs index 31cfc5f..d036360 100644 --- a/Forms/FrmMnModify.cs +++ b/Forms/FrmMnModify.cs @@ -68,15 +68,7 @@ questionGrid.Rows[idx].Cells[1].Value = sr.question; } } - /// 选中对象 - /// - /// - /// - /// - private void buttonX1_Click(object sender, EventArgs e) - { - globecontrol.Globe.Action = EnumAction3D.SelectObject; - } + /// /// 选中某一行 /// diff --git a/Forms/FrmPipelineModelDataBase.cs b/Forms/FrmPipelineModelDataBase.cs index 2acf0ca..7ce573f 100644 --- a/Forms/FrmPipelineModelDataBase.cs +++ b/Forms/FrmPipelineModelDataBase.cs @@ -35,19 +35,7 @@ ds = _ds; InitializeComponent(); } - /// - /// 单击选择shp格式文件 - /// - /// - /// - private void btnBrowseModel_Click(object sender, EventArgs e) - { - saveFileDialog1.Filter = "*.lgd|*.lgd"; - if (saveFileDialog1.ShowDialog() == DialogResult.OK) - { - txtModelLayer.Text = saveFileDialog1.FileName; - } - } + /// /// 窗体初始化事件处理 /// @@ -100,49 +88,6 @@ } } } - - private object convertFieldValue(string fieldname, object obj) - { - if (obj == null) - return null; - - try - { - string type = fields_types[fieldname].ToString(); - switch (type) - { - case "string": - return obj.ToString(); - case "int": - //return 101; - int intResult; - if (int.TryParse(obj.ToString(), out intResult)) - return intResult; - else - return null; - case "double": - //return 202.5; - double doubleResult; - if (double.TryParse(obj.ToString(), out doubleResult)) - return doubleResult; - else - return null; - case "date": - DateTime dtResult; - if (DateTime.TryParse(obj.ToString(), out dtResult)) - return dtResult; - else - return null; - } - return null; - } - catch (Exception ex) - { - MessageBox.Show(ex.ToString()); - return null; - } - } - public string lgdFilePath = ""; /// /// 选择管线颜色 @@ -610,33 +555,6 @@ { this.Close(); } - - private void cmbLayer_SelectedIndexChanged(object sender, EventArgs e) //选择图层 - { - GSOLayer layer = ctl.Globe.Layers.GetLayerByCaption(selectLayerName); - GSOFeatures features = layer.GetAllFeatures(); - if (features.Length == 0) - return; - - cmbFrom.Items.Clear(); - cmbTo.Items.Clear(); - cmbRadius.Items.Clear(); - cmbID.Items.Clear(); - for (int i = 0; i < features[0].GetFieldCount(); i++) - { - GeoScene.Data.GSOFieldDefn fielddef = (GeoScene.Data.GSOFieldDefn)(features[0].GetFieldDefn(i)); - - cmbFrom.Items.Add(fielddef.Name); - cmbTo.Items.Add(fielddef.Name); - cmbRadius.Items.Add(fielddef.Name); - cmbID.Items.Add(fielddef.Name); - } - cmbFrom.SelectedItem = "Deep1"; - cmbTo.SelectedItem = "Deep2"; - cmbRadius.SelectedItem = "Diameter"; - cmbID.SelectedItem = "Handle"; - } - private void buttonXLayerPath_Click(object sender, EventArgs e)//单击 选择shp格式的文件 { OpenFileDialog dlg = new OpenFileDialog(); diff --git a/Forms/FrmPipelineModelDataOneStep.cs b/Forms/FrmPipelineModelDataOneStep.cs index 18afda7..ec93b8a 100644 --- a/Forms/FrmPipelineModelDataOneStep.cs +++ b/Forms/FrmPipelineModelDataOneStep.cs @@ -38,19 +38,7 @@ layerTree = _layerTree; InitializeComponent(); } - /// - /// 单击选择shp格式文件 - /// - /// - /// - private void btnBrowseModel_Click(object sender, EventArgs e) - { - saveFileDialog1.Filter = "*.lgd|*.lgd"; - if (saveFileDialog1.ShowDialog() == DialogResult.OK) - { - txtModelLayer.Text = saveFileDialog1.FileName; - } - } + /// /// 窗体初始化事件处理 /// @@ -107,48 +95,7 @@ } } - private object convertFieldValue(string fieldname, object obj) - { - if (obj == null) - return null; - - try - { - string type = fields_types[fieldname].ToString(); - switch (type) - { - case "string": - return obj.ToString(); - case "int": - //return 101; - int intResult; - if (int.TryParse(obj.ToString(), out intResult)) - return intResult; - else - return null; - case "double": - //return 202.5; - double doubleResult; - if (double.TryParse(obj.ToString(), out doubleResult)) - return doubleResult; - else - return null; - case "date": - DateTime dtResult; - if (DateTime.TryParse(obj.ToString(), out dtResult)) - return dtResult; - else - return null; - } - return null; - } - catch (Exception ex) - { - MessageBox.Show(ex.ToString()); - return null; - } - } - + public string lgdFilePath = ""; /// /// 选择管线颜色 @@ -673,32 +620,6 @@ return featDs; } - private void cmbLayer_SelectedIndexChanged(object sender, EventArgs e) //选择图层 - { - GSOLayer layer = ctl.Globe.Layers.GetLayerByCaption(selectLayerName); - GSOFeatures features = layer.GetAllFeatures(); - if (features.Length == 0) - return; - - cmbFrom.Items.Clear(); - cmbTo.Items.Clear(); - cmbRadius.Items.Clear(); - cmbID.Items.Clear(); - for (int i = 0; i < features[0].GetFieldCount(); i++) - { - GeoScene.Data.GSOFieldDefn fielddef = (GeoScene.Data.GSOFieldDefn)(features[0].GetFieldDefn(i)); - - cmbFrom.Items.Add(fielddef.Name); - cmbTo.Items.Add(fielddef.Name); - cmbRadius.Items.Add(fielddef.Name); - cmbID.Items.Add(fielddef.Name); - } - cmbFrom.SelectedItem = "Deep1"; - cmbTo.SelectedItem = "Deep2"; - cmbRadius.SelectedItem = "Diameter"; - cmbID.SelectedItem = "Handle"; - } - private void buttonXLayerPath_Click(object sender, EventArgs e)//单击 选择shp格式的文件 { OpenFileDialog dlg = new OpenFileDialog(); @@ -949,38 +870,6 @@ } //txtLayername.Text = type + layername; } - /// - /// 连接数据库 - /// - /// - /// - private void buttonX1_Click(object sender, EventArgs e) - { - if (ds == null) - { - //没连的话,直接连接审核库; //审核库配置读配置文件 - string dbIp = Utility.sgdbip; - string database = Utility.sgdbname; - string user = Utility.sgdbuser; - string pass = Utility.sgdbpwd; - - if (!Utility.isNetworkConnectionSuccess(dbIp.Trim())) - { - MessageBox.Show("网络连接失败!", "提示"); - return; - } - - ds = ctl.Globe.DataManager.OpenOracleDataSource(dbIp + "/" + database, "", "", user, pass); - if (ds == null) - { - MessageBox.Show("数据库连接失败!", "提示", MessageBoxButtons.OK, MessageBoxIcon.Warning); - } - else - { - btnCreateModel.Enabled = true; - } - } - } private void btnClose_Click(object sender, EventArgs e) { diff --git a/Forms/FrmShRK.cs b/Forms/FrmShRK.cs index 0e2e722..f1d83cb 100644 --- a/Forms/FrmShRK.cs +++ b/Forms/FrmShRK.cs @@ -215,6 +215,7 @@ { sourcefeatds = sourcefeat as GSOFeatureDataset; } + if (sourcefeatds == null) return; sourcefeatds.Open(); GSOFeatures sourcefeatures = sourcefeatds.GetAllFeatures(); @@ -251,6 +252,7 @@ { desfeatds = desfeat as GSOFeatureDataset; } + if (desfeatds == null) return; desfeatds.Open(); //向新数据集写入字段 diff --git a/FrmAccessoriesSensor.cs b/FrmAccessoriesSensor.cs index 09fcdf1..2a7a80e 100644 --- a/FrmAccessoriesSensor.cs +++ b/FrmAccessoriesSensor.cs @@ -209,7 +209,7 @@ chart1.Series[0].Points.DataBindXY(dic.Keys, dic.Values); for (int m = 0; m < dic.Values.Count; m++) { - if (chart1.Series[0].Points[m].YValues[0].ToString() != "0") + if (chart1.Series[0].Points[m]!=null&&chart1.Series[0].Points[m].YValues[0].ToString() != "0") { chart1.Series[0].Points[m].Label = chart1.Series[0].Points[m].YValues[0].ToString(); } diff --git a/FrmAccessoriesgather.cs b/FrmAccessoriesgather.cs index 9e331e1..a475d9e 100644 --- a/FrmAccessoriesgather.cs +++ b/FrmAccessoriesgather.cs @@ -338,7 +338,7 @@ chart1.Series[0].Points.DataBindXY(dic.Keys, dic.Values); for (int m = 0; m < dic.Values.Count; m++) { - if (chart1.Series[0].Points[m].YValues[0].ToString() != "0") + if (chart1.Series[0].Points[m]!=null&&chart1.Series[0].Points[m].YValues[0].ToString() != "0") { chart1.Series[0].Points[m].Label = chart1.Series[0].Points[m].YValues[0].ToString(); } diff --git a/FrmAccessoryAnalysis.cs b/FrmAccessoryAnalysis.cs index 71d4579..44d4065 100644 --- a/FrmAccessoryAnalysis.cs +++ b/FrmAccessoryAnalysis.cs @@ -66,39 +66,6 @@ globeControl1.Refresh(); } /// - /// 键盘按键按下事件处理 - /// - /// - /// - private void txtRadius_KeyPress(object sender, KeyPressEventArgs e) - { - TextBox text = sender as TextBox; - if ((e.KeyChar < 48 || e.KeyChar > 57) && (e.KeyChar != 8) && (int)e.KeyChar != 46) - { - e.Handled = true; - } - if ((int)e.KeyChar == 46) //小数点 - { - if (text.Text.Length <= 0) - e.Handled = true; //小数点不能在第一位 - else //处理不规则的小数点 - { - float f; - float oldf; - bool b1 = false, b2 = false; - b1 = float.TryParse(text.Text, out oldf); - b2 = float.TryParse(text.Text + e.KeyChar.ToString(), out f); - if (b2 == false) - { - if (b1 == true) - e.Handled = true; - else - e.Handled = false; - } - } - } - } - /// /// 确定按钮事件处理 /// /// diff --git a/FrmAddValve.cs b/FrmAddValve.cs index 34d2fec..5f405b9 100644 --- a/FrmAddValve.cs +++ b/FrmAddValve.cs @@ -486,56 +486,6 @@ } } - - - - - - - - private void cmbLayer_SelectedIndexChanged(object sender, EventArgs e) - { - GSOLayer layer = globeControl1.Globe.Layers.GetLayerByCaption(selectLayerName); - GSOFeatures features = layer.GetAllFeatures(); - if (features.Length == 0) - return; - - combPath.Items.Clear(); - combZ.Items.Clear(); - combModelName.Items.Clear(); - - for (int i = 0; i < features[0].GetFieldCount(); i++) - { - GeoScene.Data.GSOFieldDefn fielddef = (GeoScene.Data.GSOFieldDefn)(features[0].GetFieldDefn(i)); - combPath.Items.Add(fielddef.Name); - combZ.Items.Add(fielddef.Name); - combModelName.Items.Add(fielddef.Name); - } - combModelName.SelectedItem = "编号"; - combPath.SelectedItem = "模型路径"; - if (combfile.SelectedIndex != -1) - { - - string layerCaption = combfile.SelectedItem.ToString().Trim(); - rukuLayer = globeControl1.Globe.Layers.GetLayerByCaption(layerCaption); - if (rukuLayer != null) - { - combPath.Items.Clear(); - combZ.Items.Clear(); - combModelName.Items.Clear(); - - } - for (int i = 0; i < features[0].GetFieldCount(); i++) - { - GeoScene.Data.GSOFieldDefn fielddef = (GeoScene.Data.GSOFieldDefn)(features[0].GetFieldDefn(i)); - combPath.Items.Add(fielddef.Name); - combZ.Items.Add(fielddef.Name); - combModelName.Items.Add(fielddef.Name); - } - combModelName.SelectedItem = "编号"; - combPath.SelectedItem = "模型路径"; - } - } /// /// 单击选择shp格式文件 /// diff --git a/FrmAddWellShp.cs b/FrmAddWellShp.cs index bb79ec0..a249725 100644 --- a/FrmAddWellShp.cs +++ b/FrmAddWellShp.cs @@ -478,32 +478,6 @@ } } } - - private void cmbLayer_SelectedIndexChanged(object sender, EventArgs e) - { - GSOLayer layer = globeControl1.Globe.Layers.GetLayerByCaption(selectLayerName); - GSOFeatures features = layer.GetAllFeatures(); - if (features.Length == 0) - return; - - combCode.Items.Clear(); - combDeep.Items.Clear(); - combModelName.Items.Clear(); - combAngle.Items.Clear(); - - for (int i = 0; i < features[0].GetFieldCount(); i++) - { - GeoScene.Data.GSOFieldDefn fielddef = (GeoScene.Data.GSOFieldDefn)(features[0].GetFieldDefn(i)); - combCode.Items.Add(fielddef.Name); - combDeep.Items.Add(fielddef.Name); - combModelName.Items.Add(fielddef.Name); - combAngle.Items.Add(fielddef.Name); - } - combCode.SelectedItem = "附属物编码"; - combDeep.SelectedItem = "井深"; - combModelName.SelectedItem = "编号"; - combAngle.SelectedItem = "符号角度"; - } /// /// 单击选择shp格式文件 /// diff --git a/FrmAddYuBiZiShp.cs b/FrmAddYuBiZiShp.cs index b312d51..332f037 100644 --- a/FrmAddYuBiZiShp.cs +++ b/FrmAddYuBiZiShp.cs @@ -383,80 +383,7 @@ } } - private void cmbLayer_SelectedIndexChanged(object sender, EventArgs e) - { - GSOLayer layer = globeControl1.Globe.Layers.GetLayerByCaption(selectLayerName); - GSOFeatures features = layer.GetAllFeatures(); - if (features.Length == 0) - return; - - combCode.Items.Clear(); - combDeep.Items.Clear(); - combModelName.Items.Clear(); - //comboLoad.Items.Clear(); - for (int i = 0; i < features[0].GetFieldCount(); i++) - { - GeoScene.Data.GSOFieldDefn fielddef = (GeoScene.Data.GSOFieldDefn)(features[0].GetFieldDefn(i)); - combCode.Items.Add(fielddef.Name); - combDeep.Items.Add(fielddef.Name); - combModelName.Items.Add(fielddef.Name); - //comboLoad.Items.Add(fielddef.Name); - } - combCode.SelectedItem = "附属物编码"; - combDeep.SelectedItem = "Z坐标"; - combModelName.SelectedItem = "编号"; - //comboLoad.SelectedItem = "模型路径"; - } - - private void buttonXLayerPath_Click(object sender, EventArgs e) - { - OpenFileDialog dlg = new OpenFileDialog(); - dlg.Filter = "*.shp|*.shp"; - dlg.Multiselect = false; - if (dlg.ShowDialog() == DialogResult.OK) - { - GSOLayer layer = globeControl1.Globe.Layers.Add(dlg.FileName); - string txtMessage = valiYBdata(layer); - if (txtMessage != "") - { - button3.Enabled = false; - //textBoxLayer.Text = ""; - combCode.Items.Clear(); - combDeep.Items.Clear(); - combModelName.Items.Clear(); - globeControl1.Globe.Layers.Remove(layer); - FrmValiDataShowErrorMessage showErrorMessage = new FrmValiDataShowErrorMessage(dlg.FileName, txtMessage); - showErrorMessage.ShowDialog(); - return; - } - else - { - button3.Enabled = true; - //textBoxLayer.Text = dlg.FileName; - selectLayerName = layer.Caption; - txtLayerName.Text = layer.Caption; - GSOFeatures features = layer.GetAllFeatures(); - if (features.Length == 0) - return; - - combCode.Items.Clear(); - combDeep.Items.Clear(); - combModelName.Items.Clear(); - for (int i = 0; i < features[0].GetFieldCount(); i++) - { - GeoScene.Data.GSOFieldDefn fielddef = (GeoScene.Data.GSOFieldDefn)(features[0].GetFieldDefn(i)); - combCode.Items.Add(fielddef.Name); - combDeep.Items.Add(fielddef.Name); - combModelName.Items.Add(fielddef.Name); - //comboLoad.Items.Add(fielddef.Name); - } - combCode.SelectedItem = "管点编码"; - combDeep.SelectedItem = "Z坐标"; - combModelName.SelectedItem = "编号"; - } - } - } - + private void FrmAddYuBiZiShp_FormClosing(object sender, FormClosingEventArgs e) { globeControl1.Globe.Refresh(); diff --git a/FrmAllPipelineStatis.cs b/FrmAllPipelineStatis.cs index 6421a26..a6eea29 100644 --- a/FrmAllPipelineStatis.cs +++ b/FrmAllPipelineStatis.cs @@ -84,7 +84,7 @@ chartAllAreaPipeline.Series["管线"].Points.DataBindXY(pipelineLengthAndType.Keys, pipelineLengthAndType.Values); for (int m = 0; m < pipelineLengthAndType.Values.Count; m++) { - if (chartAllAreaPipeline.Series["管线"].Points[m].YValues[0].ToString() != "0") + if (chartAllAreaPipeline.Series["管线"].Points[m]!=null&&chartAllAreaPipeline.Series["管线"].Points[m].YValues[0].ToString() != "0") { chartAllAreaPipeline.Series["管线"].Points[m].Label = chartAllAreaPipeline.Series[0].Points[m].YValues[0].ToString(); } @@ -94,7 +94,7 @@ } catch (Exception ex) { - //LogError.PublishError(ex); + LogHelper.WriteLog(typeof(FrmAllPipelineStatis), ex.Message); } } @@ -147,7 +147,7 @@ } DataTable dt = OledbHelper.QueryTable(sql); - if (dt != null && dt.Rows.Count > 0) + if (dt != null && dt.Rows.Count > 0 && chartAllAreaPipeline.Series["管线"].Points[indexHit]!=null) { dataGridViewX1.DataSource = dt; panel.Visible = true; diff --git a/FrmAllWorkWellStatis.cs b/FrmAllWorkWellStatis.cs index 6fec7af..6af8e4c 100644 --- a/FrmAllWorkWellStatis.cs +++ b/FrmAllWorkWellStatis.cs @@ -52,7 +52,7 @@ chartAllAreaPipeline.Series["井盖"].Points.DataBindXY(workWellLengthAndType.Keys, workWellLengthAndType.Values); for (int m = 0; m < workWellLengthAndType.Values.Count; m++) { - if (chartAllAreaPipeline.Series["井盖"].Points[m].YValues[0].ToString().Trim() != "0") + if (chartAllAreaPipeline.Series["井盖"].Points[m]!=null&&chartAllAreaPipeline.Series["井盖"].Points[m].YValues[0].ToString().Trim() != "0") { chartAllAreaPipeline.Series["井盖"].Points[m].Label = chartAllAreaPipeline.Series[0].Points[m].YValues[0].ToString(); } @@ -60,7 +60,7 @@ } catch (Exception ex) { - //LogError.PublishError(ex); + LogHelper.WriteLog(typeof(FrmAllWorkWellStatis), ex.Message); } } diff --git a/FrmBSQDuoBianXingStatis.cs b/FrmBSQDuoBianXingStatis.cs index e8b7d52..3e889b6 100644 --- a/FrmBSQDuoBianXingStatis.cs +++ b/FrmBSQDuoBianXingStatis.cs @@ -60,7 +60,7 @@ { for (int m = 0; m < bsq1.Values.Count; m++) { - if (chart1.Series["标识器"].Points[m].YValues[0].ToString() != "0") + if (chart1.Series["标识器"].Points[m]!=null&&chart1.Series["标识器"].Points[m].YValues[0].ToString() != "0") { count += Convert.ToInt16(chart1.Series[0].Points[m].YValues[0].ToString()); chart1.Series["标识器"].Points[m].Label = chart1.Series[0].Points[m].YValues[0].ToString(); diff --git a/FrmBSQDuoBianXingStreet.cs b/FrmBSQDuoBianXingStreet.cs index 2005ebb..1db5777 100644 --- a/FrmBSQDuoBianXingStreet.cs +++ b/FrmBSQDuoBianXingStreet.cs @@ -63,7 +63,7 @@ chartStatis.Series[0].Points.DataBindXY(bsq.Keys, bsq.Values); for (int m = 0; m < bsq.Values.Count; m++) { - if (chartStatis.Series[0].Points[m].YValues[0].ToString().Trim() != "0") + if (chartStatis.Series[0].Points[m]!=null&&chartStatis.Series[0].Points[m].YValues[0].ToString().Trim() != "0") { count += Convert.ToInt16(chartStatis.Series[0].Points[m].YValues[0].ToString()); chartStatis.Series[0].Points[m].Label = chartStatis.Series[0].Points[m].YValues[0].ToString(); diff --git a/FrmBSQStatis.cs b/FrmBSQStatis.cs index 390a55c..4aa0ee6 100644 --- a/FrmBSQStatis.cs +++ b/FrmBSQStatis.cs @@ -95,6 +95,8 @@ } } } + + dr.Close(); conn.Close(); for (int i = 0; i < typeLists.Count; i++) { @@ -123,7 +125,7 @@ chartStatis.Series[0].Points.DataBindXY(bsq.Keys, bsq.Values); for (int m = 0; m < bsq.Values.Count; m++) { - if (chartStatis.Series[0].Points[m].YValues[0].ToString().Trim() != "0") + if (chartStatis.Series[0].Points[m]!=null&&chartStatis.Series[0].Points[m].YValues[0].ToString().Trim() != "0") { //count += Convert.ToInt16(chartStatis.Series[0].Points[m].YValues[0].ToString()); chartStatis.Series[0].Points[m].Label = chartStatis.Series[0].Points[m].YValues[0].ToString(); diff --git a/FrmBSQStreet.cs b/FrmBSQStreet.cs index 9d88adb..7fbacad 100644 --- a/FrmBSQStreet.cs +++ b/FrmBSQStreet.cs @@ -44,7 +44,7 @@ chartStatis.Series[0].Points.DataBindXY(bsq.Keys, bsq.Values); for (int m = 0; m < bsq.Values.Count; m++) { - if (chartStatis.Series[0].Points[m].YValues[0].ToString().Trim() != "0") + if (chartStatis.Series[0].Points[m]!=null&&chartStatis.Series[0].Points[m].YValues[0].ToString().Trim() != "0") { count += Convert.ToInt16(chartStatis.Series[0].Points[m].YValues[0].ToString()); chartStatis.Series[0].Points[m].Label = chartStatis.Series[0].Points[m].YValues[0].ToString(); diff --git a/FrmBoosterValvers.cs b/FrmBoosterValvers.cs index 5061efc..df9b62b 100644 --- a/FrmBoosterValvers.cs +++ b/FrmBoosterValvers.cs @@ -236,199 +236,6 @@ count = 0; } } - /// - /// 添加火苗 - /// - /// - /// - /// - /// - private GSOFeature AddFire(double x,double y,double z) - { - // 烟火示例 - - string strResPath = Application.StartupPath + "/Resource"; - - // 烟火粒子示例,由三个发射器构成 - GSOGeoParticle geoParticle = new GSOGeoParticle(); - geoParticle.SetPosition(x, y, z); // 添加到这个经纬度位置 - geoParticle.AltitudeMode = EnumAltitudeMode.RelativeToGround; - - GSORingParticleEmitter emitter = new GSORingParticleEmitter(); - emitter.TexturePath = strResPath + "/ParticleImage/flare.png"; - - emitter.SetSizeFix(1, 1); - emitter.VelFix = 1; - emitter.VelRnd = 5; - - emitter.AngleXYFix = 0; - emitter.AngleXYRnd = 180; - - emitter.AngleXZFix = 90; - emitter.AngleXZRnd = 0; - - emitter.LifeFix = 0.5f; - emitter.LifeRnd = 0.0f; - - emitter.RotFix = 0; - emitter.RotRnd = 0; - - emitter.RotVelFix = 0; - emitter.RotVelRnd = 0; - - emitter.EmitPerSec = 100; - - // 采用线性插值生成粒子的初始颜色 - emitter.ColorRndStart = Color.White; - emitter.ColorRndEnd = Color.Red; - - - GSOColorParticleEffector effector2 = new GSOColorParticleEffector(); - effector2.SetColorChanged(0, -1, -1, 0); - effector2.StartTime = 0.0f; - effector2.EndTime = -1.0f; - emitter.AddEffector(effector2); - - // 将三个发射器添加到粒子对象中 - geoParticle.AddEmitter(emitter); - - geoParticle.Play(); - - GSOFeature feature = new GSOFeature(); - - feature.Geometry = geoParticle; - - globeControl1.Globe.MemoryLayer.AddFeature(feature); - - - return feature; - } - - /// - /// 添加喷泉 - /// - /// - private GSOFeature AddFountain() - { - string strResPath = Application.StartupPath + "/Resource"; - - GSOGeoParticle geoParticle = new GSOGeoParticle(); - geoParticle.SetPosition(116.314, 39.84, 0); // 添加到这个经纬度位置 - - GSOPointParticleEmitter emitter = new GSOPointParticleEmitter(); - emitter.TexturePath = strResPath + "/ParticleImage/test.png"; - - emitter.SetSizeFix(0.5f, 2); - emitter.VelFix = 10; - emitter.VelRnd = 2; - - emitter.GravityAcc = 9.8f; - emitter.AngleXYFix = 0; - emitter.AngleXYRnd = 180; - - emitter.AngleXZFix = 88; - emitter.AngleXZRnd = 2; - - //emitter.InnerRadius = 0; - // emitter.OuterRadius = 0.03f; - - emitter.LifeFix = 5.0f; - emitter.LifeRnd = 1.0f; - - emitter.RotFix = 0; - emitter.RotRnd = 0; - - emitter.RotVelFix = 0; - emitter.RotVelRnd = 0; - - emitter.EmitPerSec = 1000; - emitter.ColorRndStart = Color.FromArgb(33, 255, 255, 255); - emitter.ColorRndEnd = Color.FromArgb(11, 255, 255, 255); - emitter.IsLumAdded = false; - - // 将三个发射器添加到粒子对象中 - geoParticle.AddEmitter(emitter); - - geoParticle.Play(); - GSOFeature feature = new GSOFeature(); - - feature.Geometry = geoParticle; - - //globeControl1.Globe.MemoryLayer.AddFeature(feature); - globeControl1.Globe.FlyToFeature(feature); - - return feature; - } - - /// - /// 添加水柱 - /// - /// - private GSOFeature AddWaterLine() - { - string strResPath = Application.StartupPath + "/Resource"; - - GSOGeoParticle geoParticle = new GSOGeoParticle(); - geoParticle.SetPosition(116.308, 39.84, 0); // 添加到这个经纬度位置 - - GSOPointParticleEmitter emitter = new GSOPointParticleEmitter(); - - emitter.TexturePath = strResPath + "/ParticleImage/drop3.png"; - - geoParticle.TimerInterval = 1; - - emitter.SetSizeFix(2.0f, 2.0f); - - emitter.VelFix = 50; - emitter.VelRnd = 2; - - // emitter.IsLumAdded = false; - - emitter.GravityAcc = 9.8f; - emitter.AngleXYFix = 0; - emitter.AngleXYRnd = 2; - - emitter.AngleXZFix = 60; - emitter.AngleXZRnd = 2; - - //emitter.InnerRadius = 0; - // emitter.OuterRadius = 0.1f; - - emitter.LifeFix = 5.0f; - emitter.LifeRnd = 1.0f; - - emitter.RotFix = 0; - emitter.RotRnd = 0; - - emitter.RotVelFix = 0; - emitter.RotVelRnd = 0; - - emitter.EmitPerSec = 1500; - - emitter.ColorRndStart = Color.FromArgb(100, 222, 222, 222); - emitter.ColorRndEnd = Color.FromArgb(50, 222, 222, 222); - - /* - - GSOScaleParticleEffector effector1 = new GSOScaleParticleEffector(); - effector1.SetScale(0.2f, 0.2f); - effector1.StartTime = 0; - effector1.EndTime = -1; // 负数表示整个粒子生命结束 - emitter.AddEffector(effector1); - */ - - // 将三个发射器添加到粒子对象中 - geoParticle.AddEmitter(emitter); - - geoParticle.Play(); - GSOFeature feature = new GSOFeature(); - - feature.Geometry = geoParticle; - - //globeControl1.Globe.MemoryLayer.AddFeature(feature); - globeControl1.Globe.FlyToFeature(feature); - - return feature; - } + } } diff --git a/FrmBufferAnalysis.cs b/FrmBufferAnalysis.cs index f711133..db8ca59 100644 --- a/FrmBufferAnalysis.cs +++ b/FrmBufferAnalysis.cs @@ -123,39 +123,6 @@ } } /// - /// 半径文本框的键盘按键按下事件处理 - /// - /// - /// - private void txtRadius_KeyPress(object sender, KeyPressEventArgs e) - { - TextBox text = sender as TextBox; - if ((e.KeyChar < 48 || e.KeyChar > 57) && (e.KeyChar != 8) && (int)e.KeyChar != 46) - { - e.Handled = true; - } - if ((int)e.KeyChar == 46) //小数点 - { - if (text.Text.Length <= 0) - e.Handled = true; //小数点不能在第一位 - else //处理不规则的小数点 - { - float f; - float oldf; - bool b1 = false, b2 = false; - b1 = float.TryParse(text.Text, out oldf); - b2 = float.TryParse(text.Text + e.KeyChar.ToString(), out f); - if (b2 == false) - { - if (b1 == true) - e.Handled = true; - else - e.Handled = false; - } - } - } - } - /// /// 窗体关闭事件处理 /// /// diff --git a/FrmBufferAnalysisBSQ.cs b/FrmBufferAnalysisBSQ.cs index 24a96ca..f54208f 100644 --- a/FrmBufferAnalysisBSQ.cs +++ b/FrmBufferAnalysisBSQ.cs @@ -137,35 +137,7 @@ } } - private void txtRadius_KeyPress(object sender, KeyPressEventArgs e) - { - TextBox text = sender as TextBox; - if ((e.KeyChar < 48 || e.KeyChar > 57) && (e.KeyChar != 8) && (int)e.KeyChar != 46) - { - e.Handled = true; - } - if ((int)e.KeyChar == 46) //小数点 - { - if (text.Text.Length <= 0) - e.Handled = true; //小数点不能在第一位 - else //处理不规则的小数点 - { - float f; - float oldf; - bool b1 = false, b2 = false; - b1 = float.TryParse(text.Text, out oldf); - b2 = float.TryParse(text.Text + e.KeyChar.ToString(), out f); - if (b2 == false) - { - if (b1 == true) - e.Handled = true; - else - e.Handled = false; - } - } - } - } - + private void FrmBufferAnalysis_FormClosing(object sender, FormClosingEventArgs e) { //Form1.y = 0; @@ -316,27 +288,6 @@ } } - private void FlyToMenu_Click(object sender, EventArgs e) - { - if (m_feature != null) - { - if (m_feature.Geometry != null && m_feature.Geometry.Type == EnumGeometryType.GeoPolyline3D) - { - GSOGeoPolyline3D line = m_feature.Geometry as GSOGeoPolyline3D; - double length = line.GetSpaceLength(true, 6378137); - GSOGeoPolyline3D lineLine = line.GetSegment(0, length / 2); - GSOPoint3d point3d = lineLine[lineLine.PartCount - 1][lineLine[lineLine.PartCount - 1].Count - 1]; - - globeControl1.Globe.FlyToPosition(point3d, EnumAltitudeMode.Absolute, 0, 45, 5); - } - else - { - globeControl1.Globe.FlyToFeature(m_feature, 0, 45, 3); - } - LightMenu_Click(sender, e); - } - } - private void LightMenu_Click(object sender, EventArgs e) { flashflag = "single"; diff --git a/FrmDataBaseOpt.cs b/FrmDataBaseOpt.cs index b0c4b5d..8d7b69d 100644 --- a/FrmDataBaseOpt.cs +++ b/FrmDataBaseOpt.cs @@ -362,6 +362,7 @@ dbCombor.Items.Add(dblist[i].title); } } + /* /// /// 从配置文件读取数据库参数配置 /// @@ -428,6 +429,8 @@ } } + * */ + /* /// /// 向配置文件写入连接数据库的参数配置 /// @@ -485,6 +488,7 @@ MessageBox.Show(exp.ToString()); } } + * */ /// /// /// diff --git a/FrmDatabaseParaSetting.cs b/FrmDatabaseParaSetting.cs index a6fea46..63b596b 100644 --- a/FrmDatabaseParaSetting.cs +++ b/FrmDatabaseParaSetting.cs @@ -152,6 +152,7 @@ this.DialogResult = DialogResult.OK; this.Close(); } + /* /// /// 从配置文件读取数据库连接参数配置 /// @@ -218,6 +219,8 @@ } } + * */ + /* /// /// 向配置文件写入数据库参数配置 /// @@ -276,7 +279,7 @@ MessageBox.Show(ex.ToString()); } } - + */ /// /// 取消按钮事件处理 /// diff --git a/FrmDatabaseParaSetting2.cs b/FrmDatabaseParaSetting2.cs index 932d05e..96a87d5 100644 --- a/FrmDatabaseParaSetting2.cs +++ b/FrmDatabaseParaSetting2.cs @@ -148,6 +148,7 @@ this.DialogResult = DialogResult.OK; this.Close(); } + /* /// /// 从配置文件读取数据库连接参数配置 /// @@ -214,6 +215,8 @@ } } + * */ + /* /// /// 向配置文件写入数据库参数配置 /// @@ -272,7 +275,7 @@ MessageBox.Show(exp.ToString()); } } - + */ /// /// 取消按钮事件处理 /// diff --git a/FrmDiameterQuery.cs b/FrmDiameterQuery.cs index 68c948b..9a5215b 100644 --- a/FrmDiameterQuery.cs +++ b/FrmDiameterQuery.cs @@ -77,18 +77,7 @@ isBetween = true; } } - /// - /// 键盘按键按下事件处理 - /// - /// - /// - private void textBoxX1_KeyPress(object sender, KeyPressEventArgs e) - { - if ((e.KeyChar < 48 || e.KeyChar > 57) && e.KeyChar != 8) - { - e.Handled = true;//屏蔽 - } - } + bool isBetween = false; /// diff --git a/FrmDocumentEdit.cs b/FrmDocumentEdit.cs index aab2d31..e78a7ff 100644 --- a/FrmDocumentEdit.cs +++ b/FrmDocumentEdit.cs @@ -256,121 +256,6 @@ } - // - /// 将本地文件上传到指定的服务器(HttpWebRequest方法) - /// - /// 文件上传到的服务器 - /// 要上传的本地文件(全路径) - /// 文件上传后的名称 - /// 上传进度条 - /// 成功返回1,失败返回0 - private int Upload_Request(string address, string fileNamePath, string saveName, ProgressBar progressBar) - { - int returnValue = 0; - // 要上传的文件 - FileStream fs = new FileStream(fileNamePath, FileMode.Open, FileAccess.Read); - BinaryReader r = new BinaryReader(fs); - //时间戳 - string strBoundary = "----------" + DateTime.Now.Ticks.ToString("x"); - byte[] boundaryBytes = Encoding.ASCII.GetBytes("/r/n--" + strBoundary + "/r/n"); - //请求头部信息 - StringBuilder sb = new StringBuilder(); - sb.Append("--"); - sb.Append(strBoundary); - sb.Append("\r\n"); - sb.Append("Content-Disposition: form-data; name=\""); - sb.Append("file"); - sb.Append("\"; filename=\""); - sb.Append(saveName); - sb.Append("\""); - sb.Append("\r\n"); - sb.Append("Content-Type: "); - sb.Append("application/octet-stream"); - sb.Append("\r\n"); - sb.Append("\r\n"); - string strPostHeader = sb.ToString(); - byte[] postHeaderBytes = Encoding.UTF8.GetBytes(strPostHeader); - // 根据uri创建HttpWebRequest对象 - HttpWebRequest httpReq = (HttpWebRequest)WebRequest.Create(new Uri(address)); - httpReq.Method = "POST"; - //对发送的数据不使用缓存 - httpReq.AllowWriteStreamBuffering = false; - //设置获得响应的超时时间(300秒) - httpReq.Timeout = 300000; - httpReq.ContentType = "multipart/form-data; boundary=" + strBoundary; - long length = fs.Length + postHeaderBytes.Length + boundaryBytes.Length; - long fileLength = fs.Length; - httpReq.ContentLength = length; - try - { - progressBar.Maximum = int.MaxValue; - progressBar.Minimum = 0; - progressBar.Value = 0; - //每次上传4k - int bufferLength = 4096; - byte[] buffer = new byte[bufferLength]; - //已上传的字节数 - long offset = 0; - //开始上传时间 - DateTime startTime = DateTime.Now; - int size = r.Read(buffer, 0, bufferLength); - Stream postStream = httpReq.GetRequestStream(); - //发送请求头部消息 - postStream.Write(postHeaderBytes, 0, postHeaderBytes.Length); - while (size > 0) - { - postStream.Write(buffer, 0, size); - offset += size; - progressBar.Value = (int)(offset * (int.MaxValue / length)); - TimeSpan span = DateTime.Now - startTime; - double second = span.TotalSeconds; - //lblTime.Text = "已用时:" + second.ToString("F2") + "秒"; - //if (second > 0.001) - //{ - // lblSpeed.Text = " 平均速度:" + (offset / 1024 / second).ToString("0.00") + "KB/秒"; - //} - //else - //{ - // lblSpeed.Text = " 正在连接…"; - //} - //lblState.Text = "已上传:" + (offset * 100.0 / length).ToString("F2") + "%"; - //lblSize.Text = (offset / 1048576.0).ToString("F2") + "M/" + (fileLength / 1048576.0).ToString("F2") + "M"; - Application.DoEvents(); - size = r.Read(buffer, 0, bufferLength); - } - //添加尾部的时间戳 - postStream.Write(boundaryBytes, 0, boundaryBytes.Length); - postStream.Close(); - //获取服务器端的响应 - WebResponse webRespon = httpReq.GetResponse(); - Stream s = webRespon.GetResponseStream(); - StreamReader sr = new StreamReader(s); - //读取服务器端返回的消息 - String sReturnString = sr.ReadLine(); - s.Close(); - sr.Close(); - if (sReturnString == "Success") - { - returnValue = 1; - } - else if (sReturnString == "Error") - { - returnValue = 0; - } - } - catch(Exception ex) - { - returnValue = 0; - string str = ex.ToString(); - } - finally - { - fs.Close(); - r.Close(); - } - return returnValue; - } - private void btn_file_Click(object sender, EventArgs e) { OpenFileDialog dlg = new OpenFileDialog(); diff --git a/FrmExportCADS.cs b/FrmExportCADS.cs index 98772ea..59629dd 100644 --- a/FrmExportCADS.cs +++ b/FrmExportCADS.cs @@ -108,65 +108,6 @@ MessageBox.Show("请选中要导出的图层!", "提示", MessageBoxButtons.OK, MessageBoxIcon.Warning); } } - private Boolean MerageToFile(GSOFeatures features, String strDestFile, String strProj4)//图层追加 - { - if (features == null) - { - return false; - } - Boolean bSuccess = false; - - string strDir = GSOUtility.GetFileDir(strDestFile); - string strLPRJFile = GSOUtility.ChangeExt(strDestFile, ".lprj"); - string strExt = GSOUtility.GetFileExt(strDestFile); - - // 如果投影文件存在,投影以投影文件为准 - if (File.Exists(strLPRJFile)) - { - // 如果是dxf,则这样处理 - if (strExt.ToLower() == ".dxf") - { - string strTempSrcFile = strDir + "srcFeatures_dxftmp" + strExt; - globeControl1.Globe.DataManager.SaveFeatureData(features, strTempSrcFile, strLPRJFile, 4); - bSuccess = GSOUtility.MergeTwoDXFFileFeatures(strDestFile, strTempSrcFile); - File.Delete(strTempSrcFile); - } - else - { - GSOFeatures srcFeatures = globeControl1.Globe.DataManager.ReadFeatureData(strDestFile); - int nCount = features.Length; - int i = 0; - for (i = 0; i < nCount; i++) - { - srcFeatures.Add(features[i]); - } - bSuccess = globeControl1.Globe.DataManager.SaveFeatureData(srcFeatures, strDestFile, strLPRJFile, 4); - } - } - else - { - // 如果是dxf,则这样处理 - if (strExt.ToLower() == ".dxf") - { - string strTempSrcFile = strDir + "srcFeatures_dxftmp" + strExt; - globeControl1.Globe.DataManager.SaveFeatureData(features, strTempSrcFile, strProj4, 0); - bSuccess = GSOUtility.MergeTwoDXFFileFeatures(strDestFile, strTempSrcFile); - File.Delete(strTempSrcFile); - } - else - { - GSOFeatures srcFeatures = globeControl1.Globe.DataManager.ReadFeatureData(strDestFile); - int nCount = features.Length; - int i = 0; - for (i = 0; i < nCount; i++) - { - srcFeatures.Add(features[i]); - } - bSuccess = globeControl1.Globe.DataManager.SaveFeatureData(srcFeatures, strDestFile, strProj4, 0); - } - } - return bSuccess; - } /// /// 关闭按钮事件处理 /// diff --git a/FrmHDMAnalysis3.cs b/FrmHDMAnalysis3.cs index 4f73af6..2ada735 100644 --- a/FrmHDMAnalysis3.cs +++ b/FrmHDMAnalysis3.cs @@ -436,29 +436,6 @@ } layerTemp.RemoveAllFeature(); } - private void Export(GSOPoint3d _pnt, double r) - { - GSOPoint3ds pnts = new GSOPoint3ds(); - GSOPoint3d pnt = new GSOPoint3d(); - pnt.X = _pnt.X; - pnt.Y = _pnt.Y; - pnt.Z = _pnt.Z; - pnts.Add(pnt); - pnt.X = _pnt.X; - pnt.Y = _pnt.Y - 0.0000000005; - pnt.Z = _pnt.Z; - pnts.Add(pnt); - GSOGeoPolyline3D line = new GSOGeoPolyline3D(); - line.AddPart(pnts); - GSOGeoPolygon3D polygon = line.CreateBuffer(r * 2, true, 5, true, false); - GSOPoint3ds points = polygon[0]; - GSOGeoPolyline3D newLine = new GSOGeoPolyline3D(); - newLine.AddPart(points); - newLine.AltitudeMode = EnumAltitudeMode.RelativeToGround; - GSOFeature newFeature = new GSOFeature(); - newFeature.Geometry = newLine; - globeControl1.Globe.MemoryLayer.AddFeature(newFeature); - } private void ExportCAD(double a, double b, double r) { diff --git a/FrmHotFuncStat.cs b/FrmHotFuncStat.cs index c980f34..2eb1476 100644 --- a/FrmHotFuncStat.cs +++ b/FrmHotFuncStat.cs @@ -421,13 +421,6 @@ } } - private void HFS_Pderive_Click(object sender, EventArgs e) - { - if (TV_Files.SelectedNode != null) - { - HFSClass.GuideEdit_form("G", TV_Files, int.Parse(((ToolStripMenuItem)sender).Tag.ToString())); - } - } private void 导入ToolStripMenuItem_Click(object sender, EventArgs e) { @@ -530,22 +523,8 @@ } } - private void 导出ToolStripMenuItem1_Click(object sender, EventArgs e) - { - 导出ToolStripMenuItem2_Click(sender, e); - } + - private void TV_HFSSrchRslt_AfterCollapse(object sender, TreeViewEventArgs e) - { - e.Node.ImageIndex = 0; - } - - private void TV_HFSSrchRslt_AfterExpand(object sender, TreeViewEventArgs e) - { - HFSClass.ADD_TreeNode(TV_Files, e.Node); - e.Node.ImageIndex = 1; - } - private void 导出ToolStripMenuItem1_Click_1(object sender, EventArgs e) { if ((TV_HFSSrchRslt.SelectedNode != null) && (TV_HFSSrchRslt.SelectedNode.Parent != null)) diff --git a/FrmLayerControl.cs b/FrmLayerControl.cs index e7917c3..28fa14d 100644 --- a/FrmLayerControl.cs +++ b/FrmLayerControl.cs @@ -312,26 +312,7 @@ layerManagerNode.Expand(); terrainManagerNode.Expand(); } - /// - /// 刷新节点树 - /// - private void RefreshDataTree() - { - layerTree2.Nodes[0].Nodes.Clear(); - Int32 nCount = globeControl2.Globe.Layers.Count; - Int32 i = 0; - for (i = 0; i < nCount; i++) - { - GSODataset dataSpace = globeControl2.Globe.Layers[i].Dataset; - TreeNode node = new TreeNode(); - node.Text = dataSpace.Name; - node.ImageIndex = 0; - node.SelectedImageIndex = 0; - node.Checked = true; - node.Tag = dataSpace; - layerTree2.Nodes[0].Nodes.Add(node); - } - } + /// /// 目标图层按钮事件处理 /// @@ -494,22 +475,8 @@ } } } - /// - /// 改变指定节点的选中状态 - /// - /// - /// - private void CheckTreeNode(TreeNode node, Boolean bChecked) - { - CheckChildTreeNode(node, bChecked); - // 对于kml图层,如果当前处理的节点是true,那么要把所有的祖宗节点置为true - // 只有所有节点都未false,那么这个节点才为false - // CheckFatherTreeNode(node, bChecked); - globeControl1.Globe.Refresh(); - globeControl2.Globe.Refresh(); - - } + private void CheckChildTreeNode(TreeNode node, Boolean bChecked) { if (node == null) @@ -696,59 +663,7 @@ //} //CheckControl(e); } - /// - /// 树节点选中方法 - /// - /// - private void CheckControl(TreeViewEventArgs e) - { - if (e.Action != TreeViewAction.Unknown) - { - if (e.Node != null && !Convert.IsDBNull(e.Node)) - { - CheckParentNode(e.Node); - if (e.Node.Nodes.Count > 0) - { - CheckAllChildNodes(e.Node, e.Node.Checked); - } - } - } - } - /// - /// 改变所有子节点的状态 - /// - /// - /// - private void CheckAllChildNodes(TreeNode pn, bool IsChecked) - { - foreach (TreeNode tn in pn.Nodes) - { - tn.Checked = IsChecked; - if (tn.Tag.ToString().Contains("|")) - { - string nodeTag = tn.Tag.ToString().Split('|')[1]; - GSOLayer layer = globeControl1.Globe.Layers.GetLayerByCaption(nodeTag); - if (layer != null) - { - layer.Visible = IsChecked; - globeControl1.Globe.Refresh(); - } - } - if (tn.Tag is GSOFeature) - { - if (tn.Nodes.Count == 0) - { - GSOFeature feat = tn.Tag as GSOFeature; - feat.Visible = IsChecked; - globeControl1.Globe.Refresh(); - } - } - if (tn.Nodes.Count > 0) - { - CheckAllChildNodes(tn, IsChecked); - } - } - } + /// /// 改变父节点的选中状态,此处为所有子节点不选中时才取消父节点选中,可以根据需要修改 /// diff --git a/FrmLogin.cs b/FrmLogin.cs index 320fdd5..2afe46e 100644 --- a/FrmLogin.cs +++ b/FrmLogin.cs @@ -59,70 +59,6 @@ textBoxPassWord.Clear(); } } - - /// - /// 验证端口号 - /// - /// - private bool ValiPort() - { - Ping p = new Ping();//创建Ping对象p - PingReply pr = p.Send(Utility.localicenseserverip);//向指定IP或者主机名的计算机发送ICMP协议的ping数据包 - if (pr.Status == IPStatus.Success)//如果ping成功 - { - try - { - TcpClient tcpc = new TcpClient(Utility.localicenseserverip, Utility.localicenseserverport);//对IP地址为"192.168.0.105"的计算机的1500端口提出连接申请 - tcpc.Close(); - return true; - } - catch (Exception ex) - { - MessageBox.Show("端口连接错误!" + ex.Message); - return false; - } - } - else - { - int times = 0;//重新连接次数; - int count = 2;//设置尝试次数 - while (times < count) - { - //Thread.Sleep(1000);//等待时间(方便测试的话,你可以改为1000) - pr = p.Send(Utility.localicenseserverip); - - if (pr.Status == IPStatus.Success) - { - try - { - TcpClient tcpc = new TcpClient(Utility.localicenseserverip, Utility.localicenseserverport);//对IP地址为"192.168.0.105"的计算机的1500端口提出连接申请 - tcpc.Close(); - return true; - } - catch (Exception ex) - { - MessageBox.Show("端口连接错误!" + ex.Message); - return false; - } - } - else - { - times++; - if (times < count) - { - continue; - } - else - { - MessageBox.Show("重新尝试连接失败"); - return false; - } - } - - } - return false; - } - } /// /// 验证用户名、密码 /// diff --git a/FrmMetadata.cs b/FrmMetadata.cs index 886f65a..0365372 100644 --- a/FrmMetadata.cs +++ b/FrmMetadata.cs @@ -27,11 +27,7 @@ InitializeComponent(); loadTreeView(layerTree); } - private void FrmMetadata_Load(object sender, EventArgs e) - { - //this.ntLblC.Text = "nn"; - // loadTreeView(layerTree); - } + private void loadTreeView(TreeView tv)//构建图层树 { try diff --git a/FrmMetadataStat.cs b/FrmMetadataStat.cs index 790658a..e7696c6 100644 --- a/FrmMetadataStat.cs +++ b/FrmMetadataStat.cs @@ -197,9 +197,5 @@ } } - private void buttonX1_Click(object sender, EventArgs e) - { - drawChart(); - } } } diff --git a/FrmPatrolerManager.cs b/FrmPatrolerManager.cs index 37f8ffd..9e66aeb 100644 --- a/FrmPatrolerManager.cs +++ b/FrmPatrolerManager.cs @@ -109,82 +109,8 @@ this.winGridViewPager1.AllToExport = table; } - /// - /// 编辑 - /// - /// - /// - private void winGridViewPager1_OnEditSelected(object sender, EventArgs e) - { - - DataGridView grid = sender as DataGridView; - if (grid != null && grid.SelectedRows.Count>0) - { - DataGridViewRow row = grid.SelectedRows[0]; - try - { - long dbid = long.Parse(row.Cells["编号"].Value.ToString()); - String name = row.Cells["姓名"].Value.ToString(); - String sex = row.Cells["性别"].Value.ToString(); - String age = row.Cells["年龄"].Value.ToString(); - string phone = row.Cells["电话"].Value.ToString(); - age = String.IsNullOrEmpty(age.ToString().Trim()) ? "1" : age.ToString().Trim(); - FrmPatrolerEdit frm = new FrmPatrolerEdit(dbid.ToString(), name, age, sex, phone); - frm.reloadGrid += new ReloadPatrolerGrid(LoadData); - frm.ShowDialog(); - winGridViewPager1.Refresh(); - } - catch (Exception ex) - { - MessageBox.Show("编辑失败:" + ex.ToString(), "错误", MessageBoxButtons.OK, MessageBoxIcon.Error); - } - } - else - { - MessageBox.Show("没有选择记录", "提示"); - } - - } - - /// - /// 删除 - /// - /// - /// - private void winGridViewPager1_OnDeleteSelected(object sender, EventArgs e) - { - DataGridView grid = sender as DataGridView; - if (grid != null && grid.SelectedRows.Count > 0) - { - DataGridViewRow row = grid.SelectedRows[0]; - long dbid = long.Parse(row.Cells["编号"].Value.ToString()); - try - { - string state = row.Cells["状态"].Value.ToString(); - if ("在线".Equals(state)) - { - if (MessageBox.Show("确定注销?", "确认", MessageBoxButtons.YesNo, MessageBoxIcon.Question) == DialogResult.Yes) - { - String sql = "update patroler t set t.accountstate='LEAVER' where t.dbid=" + dbid; - OracleUtils.ExecuteNonQuery(OracleUtils.ConnectionString, CommandType.Text, sql); - } - } - else { - MessageBox.Show("人员不在线,无法注销", "信息"); - } - } - catch (Exception ex) - { - MessageBox.Show("人员注销失败:" + ex.ToString(), "错误", MessageBoxButtons.OK, MessageBoxIcon.Error); - } - } - else - { - MessageBox.Show("没有选择记录", "提示"); - } - } - - + + private void LoadData() { int pageIndex = winGridViewPager1.PagerInfo.CurrenetPageIndex; diff --git a/FrmRoadHDM.cs b/FrmRoadHDM.cs index e765313..e871dd5 100644 --- a/FrmRoadHDM.cs +++ b/FrmRoadHDM.cs @@ -333,31 +333,6 @@ this.Cursor = Cursors.Default; } } - - private void Export(GSOPoint3d _pnt, double r) - { - GSOPoint3ds pnts = new GSOPoint3ds(); - GSOPoint3d pnt = new GSOPoint3d(); - pnt.X = _pnt.X; - pnt.Y = _pnt.Y; - pnt.Z = _pnt.Z; - pnts.Add(pnt); - pnt.X = _pnt.X; - pnt.Y = _pnt.Y - 0.0000000005; - pnt.Z = _pnt.Z; - pnts.Add(pnt); - GSOGeoPolyline3D line = new GSOGeoPolyline3D(); - line.AddPart(pnts); - GSOGeoPolygon3D polygon = line.CreateBuffer(r * 2, true, 5, true, false); - GSOPoint3ds points = polygon[0]; - GSOGeoPolyline3D newLine = new GSOGeoPolyline3D(); - newLine.AddPart(points); - newLine.AltitudeMode = EnumAltitudeMode.RelativeToGround; - GSOFeature newFeature = new GSOFeature(); - newFeature.Geometry = newLine; - globeControl1.Globe.MemoryLayer.AddFeature(newFeature); - } - private void ExportCAD(double a, double b, double r) { GSOPoint3ds pnts = new GSOPoint3ds(); diff --git a/FrmUserAdd.cs b/FrmUserAdd.cs index c612ab4..f826427 100644 --- a/FrmUserAdd.cs +++ b/FrmUserAdd.cs @@ -231,24 +231,6 @@ //cbxRegion.SelectedIndexChanged += new EventHandler(cbxRegion_SelectedIndexChanged); } } - /// - /// 下拉框选中项改变事件处理 - /// - /// - /// - private void cbxRegion_SelectedIndexChanged(object sender, EventArgs e) - { - string sql = ""; - //string sql = "select casic_role.\"name\" from casic_role join casic_regionrole on casic_role.\"id\"=casic_regionrole.\"rid\" where casic_regionrole.\"reid\"=" + region[cbxRegion.SelectedItem.ToString().Trim()]; - DataTable dt = OledbHelper.QueryTable(sql); - if (dt != null && dt.Rows.Count > 0) - { - comboBoxExRegionRole.Items.Clear(); - for (int i = 0; i < dt.Rows.Count; i++) - { - comboBoxExRegionRole.Items.Add(dt.Rows[i][0].ToString().Trim());//部门角色 - } - } - } + } } diff --git a/FrmUserManager.cs b/FrmUserManager.cs index 571f0f0..ae254bc 100644 --- a/FrmUserManager.cs +++ b/FrmUserManager.cs @@ -81,11 +81,6 @@ } } } - //创建新用户 - private void buttonX2_Click(object sender, EventArgs e) - { - FrmUserAdd frm = new FrmUserAdd(-1); - frm.ShowDialog(); - } + } } diff --git a/FrmValveStatistics.cs b/FrmValveStatistics.cs index 545d56c..dd76777 100644 --- a/FrmValveStatistics.cs +++ b/FrmValveStatistics.cs @@ -54,7 +54,7 @@ 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") + if (chaFamenStatis.Series["阀门"].Points[m]!=null&&chaFamenStatis.Series["阀门"].Points[m].YValues[0].ToString() != "0") { chaFamenStatis.Series["阀门"].Points[m].Label = chaFamenStatis.Series[0].Points[m].YValues[0].ToString(); } diff --git a/Frm_password_reset.cs b/Frm_password_reset.cs index 7b51039..b9e5dc3 100644 --- a/Frm_password_reset.cs +++ b/Frm_password_reset.cs @@ -41,6 +41,7 @@ } catch (Exception ex) { + LogHelper.WriteLog(typeof(Frm_password_reset), ex.Message); } } private void initCombox() diff --git a/FrmpipeDeepstatis.cs b/FrmpipeDeepstatis.cs index e156db4..1a84d6c 100644 --- a/FrmpipeDeepstatis.cs +++ b/FrmpipeDeepstatis.cs @@ -307,7 +307,7 @@ chart1.Series[j].Points.DataBindXY(dic1.Keys, dic1.Values); for (int m = 0; m < dic1.Values.Count; m++) { - if (chart1.Series[j].Points[m].YValues[0].ToString() != "0") + if (chart1.Series[j].Points[m]!=null&&chart1.Series[j].Points[m].YValues[0].ToString() != "0") { chart1.Series[j].Points[m].Label = chart1.Series[j].Points[m].YValues[0].ToString(); diff --git a/FrmpipeDiametergather.cs b/FrmpipeDiametergather.cs index 30674de..057b09d 100644 --- a/FrmpipeDiametergather.cs +++ b/FrmpipeDiametergather.cs @@ -263,6 +263,7 @@ if (layer != null && layer is GSOFeatureLayer) { GSOFeatureLayer flayer = layer as GSOFeatureLayer; + if (layer == null) return; GSOFeatures features = flayer.GetAllFeatures(); if (features.Length > 0) { diff --git a/FrmpipeMaterialGather.cs b/FrmpipeMaterialGather.cs index c133ec3..398b884 100644 --- a/FrmpipeMaterialGather.cs +++ b/FrmpipeMaterialGather.cs @@ -280,6 +280,7 @@ if (layer != null && layer is GSOFeatureLayer) { GSOFeatureLayer flayer = layer as GSOFeatureLayer; + if (flayer == null) return; GSOFeatures features = flayer.GetAllFeatures(); if (features.Length > 0) { @@ -332,7 +333,7 @@ chart1.Series[j].Points.DataBindXY(dic1.Keys, dic1.Values); for (int m = 0; m < dic1.Values.Count; m++) { - if (chart1.Series[j].Points[m].YValues[0].ToString() != "0") + if (chart1.Series[j].Points[m]!=null&&chart1.Series[j].Points[m].YValues[0].ToString() != "0") { chart1.Series[j].Points[m].Label = chart1.Series[j].Points[m].YValues[0].ToString(); } diff --git a/Frmpipediameterstatis.cs b/Frmpipediameterstatis.cs index c0ed80a..50f8170 100644 --- a/Frmpipediameterstatis.cs +++ b/Frmpipediameterstatis.cs @@ -286,6 +286,7 @@ chart1.Series.Add(layerCaption); GSOFeatureLayer flayer = layer as GSOFeatureLayer; + if (layer == null) return; GSOFeatures features = flayer.GetAllFeatures(); if (features.Length > 0) { diff --git "a/GKT_Forms/F_GKT\346\225\260\346\215\256\350\276\223\345\205\245\350\276\223\345\207\272.cs" "b/GKT_Forms/F_GKT\346\225\260\346\215\256\350\276\223\345\205\245\350\276\223\345\207\272.cs" index c7bffd5..4db7d5d 100644 --- "a/GKT_Forms/F_GKT\346\225\260\346\215\256\350\276\223\345\205\245\350\276\223\345\207\272.cs" +++ "b/GKT_Forms/F_GKT\346\225\260\346\215\256\350\276\223\345\205\245\350\276\223\345\207\272.cs" @@ -198,12 +198,7 @@ } DialogResult = DialogResult.OK;//将当前窗体的对话框返回值设为OK } - private void treeView1_NodeMouseClick(object sender, TreeNodeMouseClickEventArgs e) - { - dir_Ok = comboBox_Disk.Text + e.Node.FullPath; - //dir = comboBox_Disk.Text + e.Node.FullPath; - e.Node.SelectedImageIndex = e.Node.ImageIndex; - } + string tempstr = ""; private void button1_Click(object sender, EventArgs e) { diff --git a/HFS_Forms/Frm_HFSprojedits.cs b/HFS_Forms/Frm_HFSprojedits.cs index 96dd76f..3c232a1 100644 --- a/HFS_Forms/Frm_HFSprojedits.cs +++ b/HFS_Forms/Frm_HFSprojedits.cs @@ -126,16 +126,6 @@ Close(); } - - - private void TB_ProjName_KeyPress(object sender, KeyPressEventArgs e) - { - if (HFSAClass.Files_NameChar(e) == 0) - e.Handled = true; - if (e.KeyChar == '\r') - OK_Click(sender, e); - } - private void Frm_HFSProjedit_Load(object sender, EventArgs e) { @@ -175,10 +165,6 @@ } } - private void Cancel_Click(object sender, EventArgs e) - { - this.Close(); - } private void Cancel_Click_1(object sender, EventArgs e) { diff --git a/MainFrm.cs b/MainFrm.cs index 2c305a0..ed2685b 100644 --- a/MainFrm.cs +++ b/MainFrm.cs @@ -617,7 +617,7 @@ } catch (Exception ex) { - + LogHelper.WriteLog(typeof(MainFrm), ex.Message); } } @@ -1768,7 +1768,7 @@ } catch (Exception ex) { - //LogError.PublishError(ex); + LogHelper.WriteLog(typeof(MainFrm), ex.Message); } } @@ -2026,6 +2026,7 @@ } catch (Exception ex) { + LogHelper.WriteLog(typeof(MainFrm), ex.Message); result = false; } finally @@ -2316,220 +2317,6 @@ string filename = Utility.filename; List g1layername = new List(); /// - /// 构建图层列表目录树 - /// - /// - private void loadTreeView(TreeView tv) - { - try - { - XmlDocument doc = new XmlDocument(); - doc.Load(filename); - XmlNodeList Params1 = doc.SelectNodes("/Params/layers"); - tv.ShowLines = false; - tv.CheckBoxes = true; - - foreach (XmlNode paramsNode in Params1) //layers - { - foreach (XmlNode layerNode in paramsNode) //layer - { - TreeNode nodelayer = new TreeNode(); - string layerName = layerNode.Attributes["label"].Value; - nodelayer.Text = layerName; - - if (layerNode.HasChildNodes != false) - { - tv.Nodes.Add(nodelayer); - foreach (XmlNode layerchildNode in layerNode) //layerchild - { - if (layerchildNode.Name == "layerchild") - { - TreeNode nodelayerchild = new TreeNode(); - string layerType = layerchildNode.Attributes["type"].Value; - string layerName1 = layerchildNode.Attributes["layer"].Value; - string layerchildName = layerchildNode.Attributes["label"].Value; - if (layerType == "locaserver") - { - if (layerchildNode.Attributes["isRoad"] != null) - { - roadLayerName = layerchildName; - } - dictionaryNetLayerNameAndCaption.Add(layerName1, layerchildName); - - nodelayerchild.Text = layerchildName; - nodelayerchild.Tag = layerType + "|" + layerchildName; - nodelayerchild.Checked = true; - nodelayer.Nodes.Add(nodelayerchild); - } - else - { - if (layerchildNode.Attributes["isPipeLine"] != null) - { - m_PipelineLayerNames.Add(layerchildName); - } - if (layerchildNode.Attributes["isWorkWell"] != null) - { - workwellLayerNames.Add(layerchildName); - } - if (layerchildNode.Attributes["isValve"] != null) - { - valueLayerNames.Add(layerchildName); - } - //if (layerchildNode.Attributes["isInstrument"] != null) - if (layerchildNode.Attributes["isAccess"] != null) - { - instrumenLayerNames.Add(layerchildName); - } - //if (layerchildNode.Attributes["isPipeFitting"] != null) - if (layerchildNode.Attributes["isCharacter"] != null) - { - pipefittingLayerNames.Add(layerchildName); - } - bool boollayer = AddLayers(layerName1, layerchildName); - nodelayerchild.Text = layerchildName; - nodelayerchild.Tag = layerType + "|" + layerchildName; - nodelayerchild.Checked = boollayer; - if (layerchildName.Contains("特征管点")) - { - nodelayerchild.Checked = false; - setLayerVisible(layerName1); - } - - nodelayer.Nodes.Add(nodelayerchild); - g1layername.Add(layerName1); - } - } - else if (layerchildNode.Name == "layertype") - { - TreeNode nodelayerchild = new TreeNode(); - string layerType = layerchildNode.Attributes["label"].Value; - nodelayerchild.Text = layerType; - nodelayerchild.Tag = layerType; - nodelayerchild.Checked = true; - nodelayer.Nodes.Add(nodelayerchild); - if (layerchildNode.HasChildNodes == true) - { - foreach (XmlNode childNodeLayer in layerchildNode) - { - if (childNodeLayer.HasChildNodes == true) - { - TreeNode nodelayerchild2 = new TreeNode(); - string layer = childNodeLayer.Attributes["label"].Value; - nodelayerchild2.Text = layer; - nodelayerchild2.Tag = layer; - nodelayerchild2.Checked = true; - nodelayerchild.Nodes.Add(nodelayerchild2); - foreach (XmlNode n in childNodeLayer) - { - TreeNode nodelayerchild1 = new TreeNode(); - string layerName1 = n.Attributes["layer"].Value; - string layerchildName = n.Attributes["label"].Value; - string layerType1 = n.Attributes["type"].Value; - if (n.Attributes["isPipeLine"] != null) - { - m_PipelineLayerNames.Add(layerchildName); - } - if (n.Attributes["isWorkWell"] != null) - { - workwellLayerNames.Add(layerchildName); - } - if (n.Attributes["isValve"] != null) - { - valueLayerNames.Add(layerchildName); - } - if (n.Attributes["isAccess"] != null) - //if (n.Attributes["isInstrument"] != null) - { - instrumenLayerNames.Add(layerchildName); - } - if (n.Attributes["isPipeFitting"] != null) - { - pipefittingLayerNames.Add(layerchildName); - } - bool boollayer = AddLayers(layerName1, layerchildName); - nodelayerchild1.Text = layerchildName; - nodelayerchild1.Tag = layerType1 + "|" + layerchildName; - nodelayerchild1.Checked = boollayer; - if (layerchildName.Contains("特征管点")) - { - nodelayerchild1.Checked = false; - setLayerVisible(layerName1); - } - - nodelayerchild2.Nodes.Add(nodelayerchild1); - - g1layername.Add(layerName1); - } - } - else - { - TreeNode nodelayerchild1 = new TreeNode(); - string layerName1 = childNodeLayer.Attributes["layer"].Value; - string layerchildName = childNodeLayer.Attributes["label"].Value; - string layerType1 = childNodeLayer.Attributes["type"].Value; - if (childNodeLayer.Attributes["isPipeLine"] != null) - { - m_PipelineLayerNames.Add(layerchildName); - } - if (childNodeLayer.Attributes["isWorkWell"] != null) - { - workwellLayerNames.Add(layerchildName); - } - if (childNodeLayer.Attributes["isValve"] != null) - { - valueLayerNames.Add(layerchildName); - } - if (childNodeLayer.Attributes["isAccess"] != null) - //if (childNodeLayer.Attributes["isInstrument"] != null) - { - instrumenLayerNames.Add(layerchildName); - } - if (childNodeLayer.Attributes["isPipeFitting"] != null) - { - pipefittingLayerNames.Add(layerchildName); - } - bool boollayer = AddLayers(layerName1, layerchildName); - nodelayerchild1.Text = layerchildName; - nodelayerchild1.Tag = layerType1 + "|" + layerchildName; - nodelayerchild1.Checked = boollayer; - if (layerchildName.Contains("特征管点")) - { - nodelayerchild1.Checked = false; - setLayerVisible(layerName1); - } - nodelayerchild.Nodes.Add(nodelayerchild1); - g1layername.Add(layerName1); - } - } - } - } - } - } - else - { - tv.Nodes.Add(nodelayer); - } - } - } - - foreach (TreeNode tn in tv.Nodes) - { - if (tn.Nodes.Count > 0) - { - foreach (TreeNode tnChild in tn.Nodes) - { - if (tnChild.Checked) - tn.Checked = true; - } - } - } - } - catch (Exception ex) - { - //LogError.PublishError(ex); - } - } - /// /// 获取目标图层 /// /// @@ -2629,21 +2416,11 @@ } catch (Exception ex) { - //LogError.PublishError(ex); + LogHelper.WriteLog(typeof(MainFrm), ex.Message); return false; } } /// - /// 菜单上的 三维导航 工具按钮 - /// - /// - /// - private void buttonItem86_Click(object sender, EventArgs e) - { - globeControl1.Globe.Action = EnumAction3D.ActionNull; - } - - /// /// 地上模式 菜单按钮 /// /// @@ -3026,67 +2803,11 @@ } Image printImage; - /// - /// 打印 菜单 - /// - /// - /// - private void buttonItem13_Click(object sender, EventArgs e) - { - Point pt1 = new Point(Convert.ToInt32(0), Convert.ToInt32(0)); - Point pt2 = new Point(Convert.ToInt32(panelEx5.Width), Convert.ToInt32(panelEx5.Height)); - int mapWidth = 0; - int mapHeight = 0; - Point pt = getUpperLeftPoint(pt1, pt2, out mapWidth, out mapHeight); - printImage = new Bitmap(Convert.ToInt32(panelEx5.Width), Convert.ToInt32(panelEx5.Height)); - Graphics g = Graphics.FromImage(printImage); - g.CopyFromScreen(pt, new Point(0, 0), new Size(Convert.ToInt32(panelEx5.Width), Convert.ToInt32(panelEx5.Height))); - - PrintDialog pd = new PrintDialog(); - try - { - if (pd.ShowDialog() == DialogResult.OK) //如果确认,将会覆盖所有的打印参数设置 - { - //打印预览 - PrintPreviewDialog ppd = new PrintPreviewDialog(); - ppd.Document = printDocument1; - if (DialogResult.OK == ppd.ShowDialog()) - { - printDocument1.Print(); //打印 - } - } - } - catch - { - printDocument1.PrintController.OnEndPrint(printDocument1, new System.Drawing.Printing.PrintEventArgs()); - } - } - + private void printDocument1_PrintPage(object sender, System.Drawing.Printing.PrintPageEventArgs e) { e.Graphics.DrawImage(printImage, 10, 10); } - - /// - /// 在窗体的底部状态栏上显示 综合管线条件查询结果 - /// - /// - /// - private void ToolStripText(string currentLayer, int dataCount) - { - if (dataCount != 0) - { - double featurelength = PipeLength(currentLayer, 0);// 统计管线的里程数 - - toolStripNumbers.Text = " 管线类型:" + currentLayer + " | 共有:" + Convert.ToString(dataCount - 1) + "条记录"; - toolStripFeatureLength.Text = " 管线里程:" + featurelength.ToString("0.00") + " 米"; - } - else - { - toolStripNumbers.Text = "管线类型: " + currentLayer + "| 共有:" + 0 + " 条记录 | "; - } - } - /// /// 统计管线的里程数 /// @@ -3402,26 +3123,6 @@ } /// - /// 绘制线 菜单 - /// - /// - /// - private void btnAddLine_Click(object sender, EventArgs e) - { - globeControl1.Globe.DestLayerFeatureAdd = globeControl1.Globe.MemoryLayer; - globeControl1.Globe.Action = EnumAction3D.DrawPolyline; - } - /// - /// 绘制面 菜单 - /// - /// - /// - private void btnAddPolygon_Click(object sender, EventArgs e) - { - globeControl1.Globe.DestLayerFeatureAdd = globeControl1.Globe.MemoryLayer; - globeControl1.Globe.Action = EnumAction3D.DrawPolygon; - } - /// /// 图层目录树 右键菜单中的 目标图层 菜单 /// /// @@ -3956,42 +3657,7 @@ // ClearUpDownTraceAnalysis(); //} - /// - /// 显示流向 功能 - /// - /// - /// - /// - private void Flow(object sender, string pipelineNameCN, bool bShow) - { - GSOFeatureLayer layer = globeControl1.Globe.Layers.GetLayerByCaption(pipelineNameCN) as GSOFeatureLayer; - GSOFeatures feats = layer.GetAllFeatures(); - for (int i = 0; i < feats.Length; i++) - { - GSOFeature feat = feats[i]; - GSOLineStyle3D lineStyle = feat.Geometry.Style as GSOLineStyle3D; - if (lineStyle != null) - { - if (lineStyle.ArrowStyle == null) - { - lineStyle.ArrowStyle = new GSOArrowStyle(); - lineStyle.ArrowStyle.BodyWidth = 2; - lineStyle.ArrowStyle.BodyLen = 6; - lineStyle.ArrowStyle.HeadWidth = 8; - lineStyle.ArrowStyle.HeadLen = 10; - lineStyle.ArrowStyle.OutlineVisible = true; - lineStyle.ArrowStyle.OutlineColor = Color.Red; - lineStyle.ArrowStyle.Speed = lineStyle.ArrowStyle.Speed / 2; - lineStyle.ArrowStyle.Play(); - } - lineStyle.ArrowVisible = bShow; - layerTree.SelectedNode = null; - } - } - globeControl1.Globe.Refresh(); - } - - + FrmCloseValves frm; /// /// 关阀分析 功能 @@ -4030,7 +3696,9 @@ curCAYNDataset.CloseValveAnalysis(lineFeature.ID, out arryResNodeID, out arryResValveID, false, true); } catch (Exception e) - { } + { + LogHelper.WriteLog(typeof(MainFrm), e.Message); + } string valveName = lineLayer.Caption; valveName = valveName.Substring(0, valveName.IndexOf("管线")); @@ -4106,7 +3774,7 @@ } catch (Exception e) { - + LogHelper.WriteLog(typeof(MainFrm), e.Message); } //目前只有燃气管线 有阀门 string valveName = lineLayer.Name; @@ -5457,7 +5125,7 @@ } catch (Exception ex) { - //MessageBox.Show(ex.ToString()); + LogHelper.WriteLog(typeof(MainFrm), ex.Message); } finally { @@ -5501,22 +5169,6 @@ } } - - /// - /// 清除所有坑 菜单 - /// - /// - /// - private void buttonItem3_Click(object sender, EventArgs e) - { - //日志记录 - LogManager.saveLog(Utility.userName, this.buttonItem3.Text); - - globeControl1.Globe.RemoveAllPits(); - } - - - ///// ///// 净距分析 菜单 ///// @@ -5554,42 +5206,8 @@ // ribbonBarTP.Visible = buttonItem34.Checked; // ribbonBarTP.Location = new Point(0, 0); //} - /// - /// 大气层 菜单 - /// - /// - /// - private void buttonItem17_Click_1(object sender, EventArgs e) - { - globeControl1.Globe.Atmosphere.Visible = !globeControl1.Globe.Atmosphere.Visible; - buttonItemSH1.Checked = globeControl1.Globe.Atmosphere.Visible; - globeControl1.Refresh(); - } - /// - /// 经纬网 菜单 - /// - /// - /// - private void buttonItem20_Click(object sender, EventArgs e) - { - globeControl1.Globe.LatLonGrid.Visible = !globeControl1.Globe.LatLonGrid.Visible; - buttonItemSH3.Checked = globeControl1.Globe.LatLonGrid.Visible; - globeControl1.Globe.Refresh(); - } - /// - /// 状态条 菜单 - /// - /// - /// - private void buttonItem21_Click_1(object sender, EventArgs e) - { - globeControl1.Globe.StatusBar.Visible = !globeControl1.Globe.StatusBar.Visible; - buttonItemSH4.Checked = globeControl1.Globe.StatusBar.Visible; - globeControl1.Globe.Refresh(); - } - - + /// /// 添加指定路径下的数据 功能 /// @@ -5680,43 +5298,7 @@ // } // return objRes; //} - /// - /// 刷新目录树 功能 - /// - private void RefreshDataTree() - { - layerTree.Nodes[0].Nodes.Clear(); - Int32 nCount = globeControl1.Globe.DataManager.DataSourceCount; - Int32 i = 0; - for (i = 0; i < nCount; i++) - { - GSODataSource dataSpace = globeControl1.Globe.DataManager[i]; - TreeNode node = new TreeNode(); - node.Text = dataSpace.Name; - node.ImageIndex = 0; - node.SelectedImageIndex = 0; - node.Checked = true; - node.Tag = dataSpace; - Int32 nDatasetCount = dataSpace.DatasetCount; - for (Int32 j = 0; j < nDatasetCount; j++) - { - GSODataset dataset = dataSpace[j]; - TreeNode subNode = new TreeNode(); - subNode.Text = dataset.Name; - subNode.ImageIndex = 0; - subNode.SelectedImageIndex = 0; - subNode.Checked = true; - subNode.Tag = dataset; - node.Nodes.Add(subNode); - } - layerTree.Nodes[0].Nodes.Add(node); - } - } - - - - - + /// /// 复合查询 菜单 @@ -5777,34 +5359,7 @@ return false; } - /// - /// 统计指定图层在指定范围内的所有feature对象 - /// - /// - /// - /// - private GSOFeatures Intersect_PointLayer(GSOGeoPolygon3D polygon, string pointLayerName) - { - GSOLayer layer = globeControl1.Globe.Layers.GetLayerByCaption(pointLayerName); - if (layer == null) - return null; - - GSOFeatureLayer flayer = layer as GSOFeatureLayer; - GSOFeatureDataset fdataset = flayer.Dataset as GSOFeatureDataset; - GSOFeatures feats; - if (polygon == null) - { - feats = flayer.GetAllFeatures(); - } - else - { - feats = flayer.FindFeaturesInPolygon(polygon, false); - } - - workWellLen.Add(pointLayerName, feats.Length); - return feats; - } - /// + /// /// 碰撞分析功能界面中 选择管线复选框 选中状态改变事件处理 /// /// @@ -5946,16 +5501,6 @@ MessageBox.Show("表格内容为空!", "提示"); } } - /// - /// 导出CAD 菜单 - /// - /// - /// - private void btnExportCAD_Click(object sender, EventArgs e) - { - FrmExportCADS frm = new FrmExportCADS(globeControl1, m_PipelineLayerNames); - frm.ShowDialog(); - } ///// ///// 区域分析 菜单 @@ -5987,16 +5532,6 @@ } } } - /// - /// 数据验证 菜单 - /// - /// - /// - private void buttonItem80_Click(object sender, EventArgs e) - { - FrmValiData frm = new FrmValiData(globeControl1); - frm.ShowDialog(); - } /// /// 根据指定图层创建图层节点并将节点添加到图层管理节点的子节点集合中 @@ -6018,56 +5553,7 @@ layerManagerNode.Expand(); } } - /// - /// 数据库备份 菜单 - /// - /// - /// - private void btnBackDatabase_Click(object sender, EventArgs e) - { - if (MessageBox.Show("是否确定要备份数据库文件", "信息", MessageBoxButtons.YesNo, MessageBoxIcon.Question) == DialogResult.Yes) - { - try - { - DateTime currentTime = DateTime.Now; - //string Dtime = currentTime.ToShortDateString().ToString("yyyy-MM-dd"); - string Dtime = currentTime.GetDateTimeFormats('D')[0].ToString(); - string Htime = DateTime.Now.ToString("HH时mm分ss秒").Trim(); - string fileName = Dtime + "(" + Htime + ")"; - string pathName = ""; - string sql = "select filename from master..sysdatabases where name='" + Utility.dbdatabase + "'"; - DataTable dt = OledbHelper.ExecuteDataTable(sql); - if (dt != null && dt.Rows.Count > 0) - { - pathName = dt.Rows[0][0].ToString().Trim(); - int count = pathName.LastIndexOf("\\") == -1 ? pathName.LastIndexOf("/") : pathName.LastIndexOf("\\"); - pathName = pathName.Substring(0, count); - } - pathName += "\\管网数据库" + fileName + ".bak"; - - OracleCommand cmdBK = new OracleCommand(); - cmdBK.CommandType = CommandType.Text; - cmdBK.Connection = connBackup; - cmdBK.CommandText = @"backup database " + Utility.dbdatabase + " to disk='" + pathName + "' with init"; - - connBackup.Open(); - cmdBK.ExecuteNonQuery(); - MessageBox.Show("数据库文件备份成功", "提示"); - } - catch (Exception ex) - { - MessageBox.Show(ex.ToString()); - } - finally - { - connBackup.Close(); - } - } - } - - - - + //GSOFeature emitterFeature; // 粒子要素 /// /// 添加火苗 功能 @@ -6598,361 +6084,15 @@ } } - - ///// - /// 添加用户仓库 菜单 - /// - /// - /// - private void buttonItem108_Click(object sender, EventArgs e) - { - FrmUserRepo frm = new FrmUserRepo(-1); - frm.ShowDialog(); - } - /// - /// 用户仓库管理 菜单 - /// - /// - /// - private void buttonItem111_Click(object sender, EventArgs e) - { - FrmUserRepoMgr frm = new FrmUserRepoMgr(); - frm.ShowDialog(); - } - /// - /// 添加分系统 菜单 - /// - /// - /// - private void buttonItem112_Click(object sender, EventArgs e) - { - //FrmAPP frm = new FrmAPP(-1); - //frm.ShowDialog(); - } - /// - /// 分系统管理 菜单 - /// - /// - /// - private void buttonItem113_Click(object sender, EventArgs e) - { - //FrmAPPMgr frm = new FrmAPPMgr(); - //frm.ShowDialog(); - } - /// - /// 添加操作 菜单 - /// - /// - /// - private void buttonItem114_Click(object sender, EventArgs e) - { - FrmOper frm = new FrmOper(-1); - frm.ShowDialog(); - } - /// - /// 操作管理 菜单 - /// - /// - /// - private void buttonItem115_Click(object sender, EventArgs e) - { - FrmOperMgr frm = new FrmOperMgr(); - frm.ShowDialog(); - } - /// - /// 添加资源 菜单 - /// - /// - /// - private void buttonItem116_Click(object sender, EventArgs e) - { - FrmRESC frm = new FrmRESC(-1); - frm.ShowDialog(); - } - /// - /// 资源管理 菜单 - /// - /// - /// - private void buttonItem117_Click(object sender, EventArgs e) - { - FrmRESCMgr frm = new FrmRESCMgr(); - frm.ShowDialog(); - } - /// - /// 添加权限 菜单 - /// - /// - /// - private void buttonItem118_Click(object sender, EventArgs e) - { - FrmPerm frm = new FrmPerm(-1); - frm.ShowDialog(); - } - /// - /// 权限管理 菜单 - /// - /// - /// - private void buttonItem119_Click(object sender, EventArgs e) - { - FrmPermMgr frm = new FrmPermMgr(); - frm.ShowDialog(); - } - /// - /// 添加访问控制 菜单 - /// - /// - /// - private void buttonItem120_Click(object sender, EventArgs e) - { - FrmAccess frm = new FrmAccess(-1); - frm.ShowDialog(); - } - /// - /// 访问控制管理 菜单 - /// - /// - /// - private void buttonItem121_Click(object sender, EventArgs e) - { - FrmAccessMgr frm = new FrmAccessMgr(); - frm.ShowDialog(); - } - /// - /// 部门类型管理 菜单 - /// - /// - /// - private void buttonItem122_Click(object sender, EventArgs e) - { - FrmRegionTypeMgr frm = new FrmRegionTypeMgr(); - frm.ShowDialog(); - } - /// - /// 用户信息管理 菜单 - /// - /// - /// - private void buttonItem128_Click_1(object sender, EventArgs e) - { - FrmUserManager frm = new FrmUserManager(); - frm.ShowDialog(); - } - /// - /// 添加角色 菜单 - /// - /// - /// - private void 添加角色_Click(object sender, EventArgs e) - { - FrmRole frm = new FrmRole(-1); - frm.ShowDialog(); - } - /// - /// 所有角色管理 菜单 - /// - /// - /// - private void 角色管理_Click(object sender, EventArgs e) - { - FrmRoleMgr frm = new FrmRoleMgr(); - frm.ShowDialog(); - } - - /// - /// 部门角色管理 菜单 - /// - /// - /// - private void buttonItem133_Click(object sender, EventArgs e) - { - FrmRegionRoleMgr frm = new FrmRegionRoleMgr(); - frm.ShowDialog(); - } - /// - /// 部门管理 菜单 - /// - /// - /// - private void buttonItem130_Click(object sender, EventArgs e) - { - FrmRegionMgr frm = new FrmRegionMgr(); - frm.ShowDialog(); - } - - /// - /// 日志管理 菜单 - /// - /// - /// - private void buttonItem135_Click(object sender, EventArgs e) - { - FrmLogManager frm = new FrmLogManager(); - frm.ShowDialog(); - } - /// - /// 传感器信息查询 菜单 - /// - /// - /// - private void buttonItem131_Click_1(object sender, EventArgs e) - { - GSOFeature selectedFeature = globeControl1.Globe.SelectedObject; - if (selectedFeature == null) - { - MessageBox.Show("请选择一个传感器对象!", "提示", MessageBoxButtons.OK, MessageBoxIcon.Information); - } - else - { - if (selectedFeature.Geometry != null && selectedFeature.Geometry.Type == EnumGeometryType.GeoModel) - { - GSOLayer layer = globeControl1.Globe.SelectedObjectLayer; - string tabelName = getTableName(layer.Caption); - string eqtID = selectedFeature.Description.Trim(); - if (tabelName != "" && eqtID != "") - { - string fields = getFields(tabelName); - if (fields != "") - { - string sql = "select " + fields + " from " + Utility.sensorDatabase + "." + tabelName + " where EqtID=" + eqtID + " order by RecordDate desc limit 1;"; - DataTable dt = MySqlHelper.queryDataTable(sql); - if (dt != null && dt.Rows.Count > 0) - { - FrmQueryMessage.ShowForm(this, dt, layer.Caption); - //queryMessage.Show(this); - } - else - { - MessageBox.Show("没有查询到相关信息!", "提示"); - } - } - else - { - MessageBox.Show("配置文件 \"sensorConfig.xml\" 有误!", "提示"); - } - } - else - { - MessageBox.Show("请选择一个传感器对象!", "提示"); - } - } - else - { - MessageBox.Show("请选择一个传感器对象!", "提示", MessageBoxButtons.OK, MessageBoxIcon.Information); - } - } - } - /// - /// 根据指定的图层的caption属性的值在配置文件中查找对应的数据库中的表的名称 - /// - /// 图层的caption属性的值 - /// 对应的数据库中的表的名称 - private string getTableName(string name) - { - string tabelName = ""; - if (Utility.sensorMarkerLayers != null) - { - for (int i = 0; i < Utility.sensorMarkerLayers.Count; i++) - { - MarkerLayer mLayer = Utility.sensorMarkerLayers[i]; - if (mLayer.layerName == name) - { - tabelName = mLayer.tableName; - break; - } - } - } - return tabelName; - } - /// - /// 根据数据库中的表的名称 查找对应的表中的字段名称的集合 - /// - /// 数据库中的表的名称 - /// 对应的表中的字段名称的集合 - private string getFields(string tabelName) - { - string fields = ""; - if (Utility.sensorMarkerLayers != null) - { - for (int i = 0; i < Utility.sensorMarkerLayers.Count; i++) - { - MarkerLayer mLayer = Utility.sensorMarkerLayers[i]; - if (mLayer.tableName.Trim() == tabelName.Trim()) - { - if (mLayer.fields != null) - { - foreach (string key in mLayer.fields.Keys) - { - string value = mLayer.fields[key]; - fields += tabelName.Trim() + "." + key + " as " + value + ","; - } - fields = fields.Remove(fields.Length - 1); - } - break; - } - } - } - return fields; - } - - /// - /// 历史曲线查询 菜单 - /// - /// - /// - private void buttonItem132_Click(object sender, EventArgs e) - { - GSOFeature selectedFeature = globeControl1.Globe.SelectedObject; - if (selectedFeature == null) - { - MessageBox.Show("请选择一个对象!", "提示", MessageBoxButtons.OK, MessageBoxIcon.Information); - } - else - { - if (selectedFeature.Geometry != null && selectedFeature.Geometry.Type == EnumGeometryType.GeoModel) - { - GSOLayer layer = globeControl1.Globe.SelectedObjectLayer; - string tabelName = getTableName(layer.Caption); - string eqtID = selectedFeature.Description; - if (tabelName != "" && eqtID != "") - { - FrmQueryHistory.ShowForm(this, tabelName, eqtID); - } - else - { - MessageBox.Show("请选择一个传感器对象!", "提示"); - } - } - else - { - MessageBox.Show("请选择一个传感器对象!", "提示", MessageBoxButtons.OK, MessageBoxIcon.Information); - } - } - } - + //定时检查传感器的状态 public System.Windows.Forms.Timer timerOfSensor = null; public int alarmValueLiuLiang = 0; public int alarmValueYaLi = 0; public int alarmValueYeTi = 0; public int alarmValueZaoSheng = 0; - /// - /// 传感器在线报警 菜单 - /// - /// - /// - private void buttonItem134_Click(object sender, EventArgs e) - { - if (timerOfSensor == null) - { - timerOfSensor = new System.Windows.Forms.Timer(); - timerOfSensor.Interval = 30000; - timerOfSensor.Tick += new EventHandler(timerOfSensor_Tick); - } - FrmQuerySensorAlarm.ShowForm(this); - } + /// /// 传感器报警 功能中的 定时器 的触发事件处理 /// @@ -7016,6 +6156,7 @@ } catch (Exception ex) { + LogHelper.WriteLog(typeof(MainFrm), ex.Message); continue; } } @@ -7025,145 +6166,7 @@ } } - - /// - /// 沿线运动 菜单 - /// - /// - /// - private void buttonItem138_Click(object sender, EventArgs e) - { - if (globeControl1.Globe.SelectedObject == null) - { - MessageBox.Show("请先选择一条线!", "提示", MessageBoxButtons.OK, MessageBoxIcon.Exclamation); - return; - } - - GSOFeature lineFeature = globeControl1.Globe.SelectedObject; - if (lineFeature.Geometry == null || lineFeature.Geometry.Type != EnumGeometryType.GeoPolyline3D) - { - MessageBox.Show("请先选择一条线!", "提示", MessageBoxButtons.OK, MessageBoxIcon.Exclamation); - return; - } - - OpenFileDialog dlg = new OpenFileDialog(); - dlg.Filter = "*.gcm;*.3ds|*.gcm;*.3ds|*.3ds|*.3ds|*.gcm|*.gcm"; - if (dlg.ShowDialog() == DialogResult.OK) - { - GSOGeoModel model = new GSOGeoModel(); - model.FilePath = dlg.FileName; - - GSOGeoDynamicRoute dynamicRoute = new GSOGeoDynamicRoute(); - dynamicRoute.ActorGeometry = model; - - GSORoute route = new GSORoute(); - GSOGeoPolyline3D geoline = (GSOGeoPolyline3D)lineFeature.Geometry; - for (int i = 0; i < geoline[0].Count; i++) - { - route.Add(geoline[0][i]); - } - route.CircleRoute = false; - route.Speed = 30; - route.RotateSpeed = 50; - route.AltitudeMode = geoline.AltitudeMode; - dynamicRoute.Route = route; - - GSOFeature feature = new GSOFeature(); - - dynamicRoute.Play(); - feature.Geometry = dynamicRoute; - - //GSOLabel gsoLabel = new GSOLabel(); - //gsoLabel.Text = "模型测试"; - //feature.Label = gsoLabel; - globeControl1.Globe.MinModelVisibleSize = 0; - - globeControl1.Globe.MemoryLayer.AddFeature(feature); - globeControl1.Globe.Refresh(); - } - } - /// - /// 回退 菜单 - /// - /// - /// - private void buttonItem99_Click(object sender, EventArgs e) - { - globeControl1.Globe.UnDoEdit(); - } - /// - /// 前进 菜单 - /// - /// - /// - private void buttonItem100_Click(object sender, EventArgs e) - { - globeControl1.Globe.ReDoEdit(); - } - /// - /// 水平净距 功能界面中的 标签内容改变事件处理 - /// - /// - /// - private void textBoxX4_TextChanged(object sender, EventArgs e) - { - string valueJingJu = textBoxX4.Text.Trim(); - if (valueJingJu != "") - { - double value = 0; - bool bl = double.TryParse(valueJingJu, out value); - if (bl) - { - labelX24.Text = "水平净距小于" + value.ToString() + "米的管线有:"; - } - } - } - /// - /// 垂直净距 功能界面中的 标签内容改变事件处理 - /// - /// - /// - private void textBoxX2_TextChanged(object sender, EventArgs e) - { - string valueJingJu = textBoxX2.Text.Trim(); - if (valueJingJu != "") - { - double value = 0; - bool bl = double.TryParse(valueJingJu, out value); - if (bl) - { - labelX23.Text = "垂直净距小于" + value.ToString() + "米的管线有:"; - } - } - } - /// - /// 覆土分析 功能界面中的 标签内容改变事件处理 - /// - /// - /// - private void textBoxX3_TextChanged(object sender, EventArgs e) - { - string valueJingJu = textBoxX3.Text.Trim(); - if (valueJingJu != "") - { - double value = 0; - bool bl = double.TryParse(valueJingJu, out value); - if (bl) - { - labelX17.Text = "覆土深度小于" + value.ToString() + "米的管线有:"; - } - } - } - - /// - /// 传感器分类查询 全区域 菜单 - /// - /// - /// - private void buttonItemSensor全区域查询_Click(object sender, EventArgs e) - { - FrmAccessoriesSensor.ShowForm(globeControl1, instrumenLayerNames, 0); - } + /// /// 传感器分类查询 绘制区域 菜单 /// @@ -7224,170 +6227,10 @@ layerTemp.RemoveAllFeature(); globeControl1.Refresh(); } - /// - /// 数字预处理 功能 - /// - /// - /// - private void 数字预处理buttonItem140_Click(object sender, EventArgs e) - { - FrmEditShapeFile frm = new FrmEditShapeFile(globeControl1); - frm.ShowDialog(this); - } - - - /// - /// 导出矢量 功能 将图层导出为kml和shp格式数据 - /// - /// - /// - private void 导出矢量buttonItem140_Click(object sender, EventArgs e) - { - /* - List m_PipelineLayerNames = new List();//线图层名称 - List workwellLayerNames = new List();//工井图层名称 - List valueLayerNames = new List();//阀门图层名称 - List instrumenLayerNames = new List();//附属物图层名称 - List pipefittingLayerNames = new List();//管件图层名称 - */ - List listVectorNames = new List(); - for (int i = 0; i < m_PipelineLayerNames.Count; i++) - { - if (m_PipelineLayerNames[i] == "移动" || m_PipelineLayerNames[i] == "联通" - || m_PipelineLayerNames[i] == "电信" || m_PipelineLayerNames[i] == "共通" - || m_PipelineLayerNames[i] == "有限电视" || m_PipelineLayerNames[i] == "交通信号" - || m_PipelineLayerNames[i] == "供电") - { - continue; - } - if (listVectorNames.Contains(m_PipelineLayerNames[i]) == false) - { - listVectorNames.Add(m_PipelineLayerNames[i]); - } - } - for (int i = 0; i < valueLayerNames.Count; i++) - { - if (listVectorNames.Contains(valueLayerNames[i]) == false) - { - listVectorNames.Add(valueLayerNames[i]); - } - } - for (int i = 0; i < workwellLayerNames.Count; i++) - { - if (listVectorNames.Contains(workwellLayerNames[i]) == false) - { - listVectorNames.Add(workwellLayerNames[i]); - } - } - for (int i = 0; i < instrumenLayerNames.Count; i++) - { - if (listVectorNames.Contains(instrumenLayerNames[i]) == false) - { - listVectorNames.Add(instrumenLayerNames[i]); - } - } - for (int i = 0; i < pipefittingLayerNames.Count; i++) - { - if (listVectorNames.Contains(pipefittingLayerNames[i]) == false) - { - listVectorNames.Add(pipefittingLayerNames[i]); - } - } - FrmExportVector frm = new FrmExportVector(globeControl1, listVectorNames); - frm.ShowDialog(); - } string citySevenLineType = ""; string cityServerLineName = ""; /// - /// 绘制城市七线 功能按钮 - /// - /// - /// - private void 绘制城市七线buttonItem140_Click(object sender, EventArgs e) - { - FrmCitySevenLineType frm = new FrmCitySevenLineType(); - if (frm.ShowDialog() == DialogResult.OK) - { - globeControl1.Globe.Action = EnumAction3D.DrawPolyline; - m_isDrawCitySevenLine = true; - m_isDrawTunnel = false; - m_AddPipeLine = false; - this.citySevenLineType = frm.citySevenLineType; - this.cityServerLineName = frm.citySevenLineName; - switch (frm.citySevenLineType) - { - case "城市红线": - GSOLayer layerRed = globeControl1.Globe.Layers.GetLayerByCaption(frm.citySevenLineType); - if (layerRed != null) - { - globeControl1.Globe.DestLayerFeatureAdd = layerRed; - layerRed.Editable = true; - } - break; - case "城市橙线": - GSOLayer layerOrange = globeControl1.Globe.Layers.GetLayerByCaption(frm.citySevenLineType); - if (layerOrange != null) - { - globeControl1.Globe.DestLayerFeatureAdd = layerOrange; - layerOrange.Editable = true; - } - break; - case "城市黄线": - GSOLayer layerYellow = globeControl1.Globe.Layers.GetLayerByCaption(frm.citySevenLineType); - if (layerYellow != null) - { - globeControl1.Globe.DestLayerFeatureAdd = layerYellow; - layerYellow.Editable = true; - } - break; - case "城市绿线": - GSOLayer layerGreen = globeControl1.Globe.Layers.GetLayerByCaption(frm.citySevenLineType); - if (layerGreen != null) - { - globeControl1.Globe.DestLayerFeatureAdd = layerGreen; - layerGreen.Editable = true; - } - break; - case "城市蓝线": - GSOLayer layerBlue = globeControl1.Globe.Layers.GetLayerByCaption(frm.citySevenLineType); - if (layerBlue != null) - { - globeControl1.Globe.DestLayerFeatureAdd = layerBlue; - layerBlue.Editable = true; - } - break; - case "城市紫线": - GSOLayer layerPurple = globeControl1.Globe.Layers.GetLayerByCaption(frm.citySevenLineType); - if (layerPurple != null) - { - globeControl1.Globe.DestLayerFeatureAdd = layerPurple; - layerPurple.Editable = true; - } - break; - case "城市黑线": - GSOLayer layerBlack = globeControl1.Globe.Layers.GetLayerByCaption(frm.citySevenLineType); - if (layerBlack != null) - { - globeControl1.Globe.DestLayerFeatureAdd = layerBlack; - layerBlack.Editable = true; - } - break; - } - } - } - /// - /// 七线审核 功能按钮 - /// - /// - /// - private void 七线审核buttonItem141_Click(object sender, EventArgs e) - { - FrmCityServerLineAnalysis frm = new FrmCityServerLineAnalysis(globeControl1, m_PipelineLayerNames); - frm.ShowDialog(this); - } - - /// /// 间距分析 开始分析按钮 分析绘制的七线和管线的距离是否符合标准 /// /// @@ -7666,25 +6509,6 @@ } } - - - /// - /// 管线自动缩进 菜单 - /// - /// - /// - private void 管线自动缩进buttonItem140_Click(object sender, EventArgs e) - { - FrmPipelineIndented frm = new FrmPipelineIndented(globeControl1, m_PipelineLayerNames, workwellLayerNames); - frm.ShowDialog(this); - } - - private void btnExportCADs_Click(object sender, EventArgs e) - { - - } - - /// /// 统计指定图层在指定范围内的所有feature对象 /// @@ -7755,8 +6579,6 @@ } - - //设置图层为隐藏 private void setLayerVisible(string layerName) { @@ -7765,27 +6587,7 @@ globeControl1.Globe.Refresh(); } - /// - /// 连接数据库 - /// - /// - /// - private void buttonItem129_Click(object sender, EventArgs e) - { - //保存日志 - LogManager.saveLog(Utility.userName, this.buttonItemSJGL4_1.Text); - - FrmDatabaseParaSetting2 frm = new FrmDatabaseParaSetting2(globeControl1); - if (frm.ShowDialog() == DialogResult.OK) - { - ds = FrmDatabaseParaSetting2.ds; - if (ds != null) - { - ds.IsCloseSaved = false; - } - } - } - + /// /// 清除渲染结果 /// @@ -7803,112 +6605,8 @@ layerTemp.RemoveAllFeature(); globeControl1.Refresh(); } - - /// - /// 绘制垂线 - /// - /// - /// - private void drawCLine(GSOPoint3d fpt, GSOPoint3d tpt) - { - GSOGeoPolyline3D pline = new GSOGeoPolyline3D(); - GSOPoint3ds pts = new GSOPoint3ds(); - pts.Add(fpt); - pts.Add(tpt); - pline.AddPart(pts); - - GSOGeoPoint3D fptg = new GSOGeoPoint3D(); - GSOGeoPoint3D tptg = new GSOGeoPoint3D(); - fptg.X = fpt.X; - fptg.Y = fpt.Y; - fptg.Z = 0; - tptg.X = tpt.X; - tptg.Y = tpt.Y; - tptg.Z = 0; - - GSOFeature gf = new GSOFeature(); - gf.Geometry = pline; - - globeControl1.Globe.MemoryLayer.AddFeature(gf); - - } - /// - /// 红线审核 - /// - /// - /// - private void buttonItem138_Click_2(object sender, EventArgs e) - { - - } - /// - /// 比较两个点是否是同一个点 - /// - /// - /// - /// - private bool comparePoint(GSOPoint3d pt1, GSOPoint3d pt2) - { - double x1 = 0; double y1 = 0; - double x2 = 0; double y2 = 0; - x1 = pt1.X; - y1 = pt1.Y; - x2 = pt2.X; - y2 = pt2.Y; - if ((x1 == x2) && (y1 == y2)) - { - return true; - } - return false; - } - /// - /// 获得点到线的垂线距离及垂点 - /// - /// - /// - /// - /// - private void comparePointLine(GSOPoint3d point, GSOGeoPolyline3D line, out double length, out GSOPoint3d pointChuiDian) - { - GSOPoint3d lineStartPoint = line[0][0]; - GSOPoint3d lineEndPoint = line[0][1]; - GSOGeoPolyline3D lineAB = new GSOGeoPolyline3D(); - GSOPoint3ds pointsAB = new GSOPoint3ds(); - pointsAB.Add(point); - pointsAB.Add(lineStartPoint); - lineAB.AddPart(pointsAB); - double lengthAB = lineAB.GetSpaceLength(false, 6378137.0); - double xieLvAB = getXieLu("", point.X, point.Y, lineStartPoint.X, lineStartPoint.Y); - double xieLvBC = getXieLu("", lineStartPoint.X, lineStartPoint.Y, lineEndPoint.X, lineEndPoint.Y); - - double tanABC = Math.Abs(xieLvAB - xieLvBC) / (1 + xieLvAB * xieLvBC); - double angle = Math.Atan(tanABC); - //if (angle > Math.PI / 2) //落在外边 - //{ - // length = 0; - //} - double lengthAD = lengthAB * Math.Sin(angle); - length = Math.Abs(lengthAD); - double lengthBD = lengthAB * Math.Cos(angle); - - GSOPoint2d point2dStart = Latlon_2_XYZ(lineStartPoint.X, lineStartPoint.Y); - double bBC = point2dStart.Y - xieLvBC * point2dStart.X; - GSOPoint2d point2dEnd = new GSOPoint2d(); - point2dEnd.X = point2dStart.X + 100; - point2dEnd.Y = point2dEnd.X * xieLvBC + bBC; - point2dEnd = XYZ_2_Latlon(point2dEnd.X, point2dEnd.Y); - - GSOPoint3d pointEnd = new GSOPoint3d(); - pointEnd.X = point2dEnd.X; - pointEnd.Y = point2dEnd.Y; - GSOGeoPolyline3D lineYanShen = new GSOGeoPolyline3D(); - GSOPoint3ds pointsYanShen = new GSOPoint3ds(); - pointsYanShen.Add(lineStartPoint); - pointsYanShen.Add(pointEnd); - lineYanShen.AddPart(pointsYanShen); - GSOGeoPolyline3D lineSegment = lineYanShen.GetSegment(0, lengthBD); - pointChuiDian = lineSegment[0][1]; - } + + /// /// 获得斜率 /// @@ -8044,255 +6742,6 @@ } /// - /// 获取与点相连的所有线以及线的点的集合 - /// - /// 选定的点所在的线 - /// 选定的点 - /// 面中不完全包含的除起点线之外所有的线 - /// 选定的点所在的点的集合 - /// 所有以选定线为起点的点的集合 - /// - private List getFeaturesPoints(GSOFeature featureSelect, GSOPoint3d lineStart, GSOFeatures selectFeatures, GSOPoint3ds ps, List listPS) - { - GSOFeatures fsStart = new GSOFeatures(); - for (int n = 0; n < selectFeatures.Length; n++) - { - if (featureSelect.ID == selectFeatures[n].ID) - { - continue; - } - GSOGeoPolyline3D newLine = selectFeatures[n].Geometry as GSOGeoPolyline3D; - if (newLine != null && newLine.PartCount > 0) - { - GSOPoint3d newLineStart = newLine[0][0]; - GSOPoint3d newLineEnd = newLine[0][newLine[0].Count - 1]; - if (lineStart.X == newLineEnd.X && lineStart.Y == newLineEnd.Y) - { - GSOPoint3ds psAdd = new GSOPoint3ds(); - for (int k = newLine[0].Count - 1; k >= 0; k--) - { - psAdd.Add(newLine[0][k]); - } - newLine[0] = psAdd; - fsStart.Add(selectFeatures[n]); - - } - else if (lineStart.X == newLineStart.X && lineStart.Y == newLineStart.Y) - { - fsStart.Add(selectFeatures[n]); - - } - } - } - if (fsStart.Length > 0) - { - for (int m = 0; m < fsStart.Length; m++) - { - GSOGeoPolyline3D lineFsStart = fsStart[m].Geometry as GSOGeoPolyline3D; - if (lineFsStart != null && lineFsStart.PartCount > 0) - { - GSOPoint3ds psAdd = ps.Clone(); - for (int k = 0; k < lineFsStart[0].Count; k++) - { - psAdd.Add(lineFsStart[0][k]); - } - listPS = getFeaturesPoints(fsStart[m], lineFsStart[0][lineFsStart[0].Count - 1], selectFeatures, psAdd, listPS); - } - } - } - else - { - listPS.Add(ps); - } - return listPS; - } - - /// - /// 获取切割面的线 - /// - /// 不完全包含在面中的所有线 - /// 完全包含在面中的所有线 - /// 线 - private GSOFeature getLineFromGSOFeatures(GSOFeatures features, GSOFeatures featuresTrue) - { - //1. 当线对象数组的长度为0时,返回空 - if (features.Length == 0) - { - return null; - } - //2. 当线对象数组的长度为1时,返回这条线 - if (features.Length == 1) - { - return features[0]; - } - //3. 当线对象数组的长度大于1时,计算所有线组成的最长线 - - //3.1 获取所有不完全包含在面中的对象selectFeatures - GSOFeatures selectFeatures = new GSOFeatures(); - for (int a = 0; a < features.Length; a++) - { - selectFeatures.Add(features[a].Clone()); - } - //3.2 删除features中完全包含在面中的线,获取和面的边界相交的线对象 - for (int a = 0; a < featuresTrue.Length; a++) - { - for (int b = 0; b < features.Length; b++) - { - if (featuresTrue[a].ID == features[b].ID) - { - features.Remove(b); - break; - } - } - } - //3.3 如果和面的边界相交的线的数量为0,返回空 - if (features.Length == 0) - { - return null; - } - //3.4 获取第一条和面的边界相交的线featureInOutPolygon - GSOFeature featureInOutPolygon = features[0]; - //3.5 从所有的线中删除featureInOutPolygon - for (int a = 0; a < selectFeatures.Length; a++) - { - if (selectFeatures[a].ID == featureInOutPolygon.ID) - { - selectFeatures.Remove(a); - break; - } - } - //listPS存储所有从featureInOutPolygon出发的点的集合 - List listPS = new List(); - //3.5 获取与featureInOutPolygon相连的线的集合 - GSOGeoPolyline3D line = featureInOutPolygon.Geometry as GSOGeoPolyline3D; - if (line != null && line.PartCount > 0) - { - GSOPoint3d lineStart = line[0][0]; - GSOPoint3d lineEnd = line[0][line[0].Count - 1]; - #region//获取和featureInOutPolygon的起点相连的线 - GSOFeatures fsStart = new GSOFeatures(); - for (int n = 0; n < selectFeatures.Length; n++) - { - GSOGeoPolyline3D newLine = selectFeatures[n].Geometry as GSOGeoPolyline3D; - if (newLine != null && newLine.PartCount > 0) - { - GSOPoint3d newLineStart = newLine[0][0]; - GSOPoint3d newLineEnd = newLine[0][newLine[0].Count - 1]; - if (lineStart.X == newLineEnd.X && lineStart.Y == newLineEnd.Y) - { - GSOPoint3ds psAdd = new GSOPoint3ds(); - for (int k = newLine[0].Count - 1; k >= 0; k--) - { - psAdd.Add(newLine[0][k]); - } - newLine[0] = psAdd; - fsStart.Add(selectFeatures[n]); - - } - else if (lineStart.X == newLineStart.X && lineStart.Y == newLineStart.Y) - { - fsStart.Add(selectFeatures[n]); - } - } - } - #endregion - - #region//获取和featureInOutPolygon的终点相连的线 - GSOFeatures fsEnd = new GSOFeatures(); - for (int n = 0; n < selectFeatures.Length; n++) - { - GSOGeoPolyline3D newLine = selectFeatures[n].Geometry as GSOGeoPolyline3D; - if (newLine != null && newLine.PartCount > 0) - { - GSOPoint3d newLineStart = newLine[0][0]; - GSOPoint3d newLineEnd = newLine[0][newLine[0].Count - 1]; - if (lineEnd.X == newLineStart.X && lineEnd.Y == newLineStart.Y) - { - fsEnd.Add(selectFeatures[n]); - - } - else if (lineEnd.X == newLineEnd.X && lineEnd.Y == newLineEnd.Y) - { - GSOPoint3ds psAdd = new GSOPoint3ds(); - for (int k = newLine[0].Count - 1; k >= 0; k--) - { - psAdd.Add(newLine[0][k]); - } - newLine[0] = psAdd; - fsEnd.Add(selectFeatures[n]); - - } - } - } - #endregion - - //3.6 将featureInOutPolygon的所有点和与之起点相连的线的所有点组成一个点的集合并添加到listPS中 - if (fsStart.Length > 0 && fsEnd.Length == 0) - { - for (int m = 0; m < fsStart.Length; m++) - { - GSOGeoPolyline3D lineFsStart = fsStart[m].Geometry as GSOGeoPolyline3D; - if (lineFsStart != null && lineFsStart.PartCount > 0) - { - GSOPoint3ds psAdd = new GSOPoint3ds(); - for (int k = line[0].Count - 1; k >= 0; k--) - { - psAdd.Add(line[0][k]); - } - for (int k = 0; k < lineFsStart[0].Count; k++) - { - psAdd.Add(lineFsStart[0][k]); - } - - listPS = getFeaturesPoints(fsStart[m], lineFsStart[0][lineFsStart[0].Count - 1], selectFeatures, psAdd, listPS); - - } - } - } - //3.6 将featureInOutPolygon的所有点和与之终点相连的线的所有点组成一个点的集合并添加到listPS中 - else if (fsStart.Length == 0 && fsEnd.Length > 0) - { - for (int n = 0; n < fsEnd.Length; n++) - { - GSOGeoPolyline3D lineFsEnd = fsEnd[n].Geometry as GSOGeoPolyline3D; - if (lineFsEnd != null && lineFsEnd.PartCount > 0) - { - GSOPoint3ds psAdd = new GSOPoint3ds(); - for (int k = 0; k < line[0].Count - 1; k++) - { - psAdd.Add(line[0][k]); - } - for (int k = 0; k < lineFsEnd[0].Count; k++) - { - psAdd.Add(lineFsEnd[0][k]); - } - //获取线fsEnd[n]的另一个端点相连的线并记录该线的点的集合 - listPS = getFeaturesPoints(fsEnd[n], lineFsEnd[0][lineFsEnd[0].Count - 1], selectFeatures, psAdd, listPS); - } - } - } - } - - //3.7 获取所有以featureInOutPolygon为起点的点的集合组成的线中的最长的线 - double maxLength = 0; - GSOFeature featureNew = new GSOFeature(); - for (int h = 0; h < listPS.Count; h++) - { - GSOGeoPolyline3D lineNew = new GSOGeoPolyline3D(); - lineNew.AddPart(listPS[h]); - GSOLabel label = new GSOLabel(); - label.Text = h.ToString(); - featureNew.Label = label; - double length = lineNew.GetSpaceLength(true, 6378137); - if (length > maxLength) - { - featureNew.Geometry = lineNew; - } - } - - return featureNew; - } - /// /// 更新最大最小状态 /// /// @@ -8340,219 +6789,6 @@ - private void buttonItem139_Click(object sender, EventArgs e) - { - - string filepath = ""; - //日志记录 - OpenFileDialog dlg = new OpenFileDialog(); - dlg.Filter = "矢量数据(*.shp)|*.shp|矢量数据(*.lgd)|*.lgd|全部支持格式(*.lgd,*.shp)|*.lgd;*.shp;"; - //dlg.Filter = "支持格式(*.lrp,*.tif,*.img,*.lrc,*.kml,*.lgd,*.shp,*.gft)|*.lrp;*.tif;*.img;*.lrc;*.kml;*.lgd;*.shp;*.gft|栅格数据(*.lrp)|*.lrp|栅格缓存(*.lrc)|*.lrc|KML数据(*.kml)|*.kml|矢量数据(*.lgd)|*.lgd|矢量缓存(*.gft)|*.gft|其它格式(*.*)|*.*||"; - dlg.Multiselect = true; - if (dlg.ShowDialog() == DialogResult.OK) - { - //自定义lprj文件名,从程序中复制一lprj文件。 - int bindex = dlg.FileName.Split('\\').Length; - string lastname = dlg.FileName.Split('\\')[bindex - 1]; - - for (int i = 0; i < dlg.FileNames.Length; i++) - { - string strDataPath = dlg.FileNames[i]; - filepath = strDataPath; - - GSOLayer layer = globeControl1.Globe.Layers.Add(strDataPath); - - } - - } - //放大到红线 - - - // globeControl1.Globe.Layers.MoveTo(0, globeControl1.Globe.Layers.Count - 1); - // globeControl1.Globe.Layers.MoveTo(0,4); - globeControl1.Refresh(); - - - } - /// - /// - /// - /// - /// - private void buttonItem142_Click(object sender, EventArgs e) - { - //获得红线polygon - //GSOLayer layerSevenLine = globeControl1.Globe.Layers.GetLayerByCaption(redlinelayername); - - GSOLayer layerSevenLine = globeControl1.Globe.Layers.Add("D:\\data\\歌林小镇shp\\test.shp"); - //获得红线结果列表 - ArrayList rrLists = new ArrayList(); - - //if (redlinelayername != "") - { - GSOFeatures fs = layerSevenLine.GetAllFeatures(); - int len = fs.Length; - - GSOGeoPolygon3D sevenPolygon = new GSOGeoPolygon3D(); - for (int k = 0; k < len; k++) - {//多根红线 - ///////生成红线区域/////// - GSOFeature featSevenLine = layerSevenLine.GetAt(k); - GSOGeoPolyline3D sevenLine = featSevenLine.Geometry as GSOGeoPolyline3D; - - List sevenParts = new List(); - for (int i = 0; i < sevenLine.PartCount; i++) - { - sevenParts.Add(sevenLine[i]); - } - for (int i = 0; i < sevenParts.Count; i++) - { - sevenPolygon.AddPart((GSOPoint3ds)sevenParts[i]); - } - /////拼出红线多边形over////// - - } - //GSOLayer layer = globeControl1.Globe.Layers.GetLayerByCaption("天然气管线"); - - GSOLayer layer = globeControl1.Globe.Layers.Add("C:\\Users\\nn-203\\Desktop\\xiaobai\\test.lgd"); - //线切割面定义,输出用 - GSOFeatures resFeats = new GSOFeatures(); - int resultstyle = 0; - //管线切割红线区域后,面积较小的区域 - GSOGeoPolygon3D restPoly = new GSOGeoPolygon3D(); - List inpts = new List(); - if (layer != null) - { - //红线区域 - GSOFeature sevenfeature = new GSOFeature(); - sevenfeature.Geometry = sevenPolygon; - - //获取不完全包含在面中的所有线 - GSOFeatures feats = layer.FindFeaturesInPolygon(sevenPolygon, false); - //获取完全包含在面中的所有线 - GSOFeatures featsTrue = layer.FindFeaturesInPolygon(sevenPolygon, true); - //获取面中所有对象组成的切割面的长线 - GSOFeature feature = new GSOFeature(); - - feature = getLineFromGSOFeatures(feats, featsTrue);//管线多个feature拼成一个feature - - //globeControl1.Globe.MemoryLayer.AddFeature(feature); - //globeControl1.Globe.MemoryLayer.AddFeature(sevenfeature); - if (feature != null) - { - //线切割面,输出 - //feature.HighLight = true; - GSODataEngineUtility.GSLineClipPolygon(feature, sevenfeature, out resFeats, out resultstyle); - } - else - { - MessageBox.Show("没有找到切割面的线对象!"); - } - ////////////////绘制分割后的多边形/////////////// - for (int a = 0; a < resFeats.Length; a++) - { - - GSOFeature gf = resFeats[1]; - globeControl1.Globe.MemoryLayer.AddFeature(gf); - - } - } - - - } - } - - private void buttonItem143_Click(object sender, EventArgs e) - { - //获得红线polygon - GSOLayer layerSevenLine = globeControl1.Globe.Layers.Add("d:\\lineAndPolygon.lgd"); - GSOLayer layerSevenLine2 = globeControl1.Globe.Layers.GetLayerByCaption("d:\\lineAndPolygon.lgd"); - //获得红线结果列表 - ArrayList rrLists = new ArrayList(); - - - // if (redlinelayername != "") - { - GSOFeatures fs = layerSevenLine.GetAllFeatures(); - int len = fs.Length; - - GSOGeoPolyline3D linetest = new GSOGeoPolyline3D(); - GSOGeoPolygon3D sevenPolygon = new GSOGeoPolygon3D(); - - GSOFeature linefeat = fs.FindByID(2); - //linefeat.Geometry = linetest; - GSOFeature polyfeat = fs.FindByID(1); - //polyfeat.Geometry = sevenPolygon; - - //线切割面定义,输出用 - GSOFeatures resFeats = new GSOFeatures(); - int resultstyle = 0; - GSODataEngineUtility.GSLineClipPolygon(linefeat, polyfeat, out resFeats, out resultstyle); - - ////////////////绘制分割后的多边形/////////////// - for (int a = 0; a < resFeats.Length; a++) - { - - GSOFeature gf = resFeats[0]; - globeControl1.Globe.MemoryLayer.AddFeature(gf); - - } - ////把红线切成一段段的线段,获得切前的红线点集 - List redpts = new List();//切前的红线点集合 - for (int i = 0; i < linetest.PartCount; i++) - { - GSOPoint3ds partP = linetest[i]; - for (int j = 0; j < partP.Count; j++) - { - redpts.Add(partP[j]); - } - } - - List redpts2 = new List();//切前的红线点集合 - for (int i = 0; i < sevenPolygon.PartCount; i++) - { - GSOPoint3ds partP = sevenPolygon[i]; - for (int j = 0; j < partP.Count; j++) - { - redpts2.Add(partP[j]); - } - } - } - } - /// - /// 增加用户手册下载连接 - /// - /// - /// - Cyberpipe.udfiles.UpDownFile UDF = new udfiles.UpDownFile(Utility.udserviceurl); - string dir_Ok = "C:\\Users\\nn-203\\Desktop"; - private void button1_Click(object sender, EventArgs e) - { - if (folderBrowserDialog1.ShowDialog() == DialogResult.OK) //打洙?开a文?件t夹D对?话°框ò - { - dir_Ok = folderBrowserDialog1.SelectedPath; //显?示?选?择?的?文?件t夹D路·径? - - //tempstr = folderBrowserDialog1.SelectedPath; //存?储洹?选?择?的?文?件t夹D路·径? - - } - - Cyberpipe.PED_logicfile.PED_Affair.Redact_D = Utility.uploadpath + "\\SFiles\\UserHbook\\说明.docx"; - if (File.Exists(dir_Ok + "\\" + Files_Name(Cyberpipe.PED_logicfile.PED_Affair.Redact_D, 1))) - { - if (MessageBox.Show("文件夹下有同名文件,是否替换?", "提示", MessageBoxButtons.YesNo, MessageBoxIcon.Information) == DialogResult.No) ; - - } - byte[] file = UDF.Down(Cyberpipe.PED_logicfile.PED_Affair.Redact_D); - FileStream pFileSream = new FileStream(dir_Ok + "\\说明.docx", FileMode.OpenOrCreate); - pFileSream.Write(file, 0, file.Length); - pFileSream.Close(); - if (File.Exists(dir_Ok + "\\" + Files_Name(Cyberpipe.PED_logicfile.PED_Affair.Redact_D, 1)) == true) - { - MessageBox.Show("文件导出成功!"); - } - //PEDAClass.Folder_Handle(dir_Ok + "\\" + PEDAClass.Files_Name(Cyberpipe.PED_logicfile.PED_Affair.Redact_D, 0), Cyberpipe.PED_logicfile.PED_Affair.Redact_D, "", 0); - - } /// /// 获取文件或文件夹的名称 /// @@ -8575,33 +6811,6 @@ return DF_Name; } - private void toolStripDropDownButton1_Click(object sender, EventArgs e) - { - if (folderBrowserDialog1.ShowDialog() == DialogResult.OK) //打洙?开a文?件t夹D对?话°框ò - { - dir_Ok = folderBrowserDialog1.SelectedPath; //显?示?选?择?的?文?件t夹D路·径? - - //tempstr = folderBrowserDialog1.SelectedPath; //存?储洹?选?择?的?文?件t夹D路·径? - - - Cyberpipe.PED_logicfile.PED_Affair.Redact_D = Utility.uploadpath + "\\SFiles\\UserHbook\\说明.docx"; - if (File.Exists(dir_Ok + "\\" + Files_Name(Cyberpipe.PED_logicfile.PED_Affair.Redact_D, 1))) - { - if (MessageBox.Show("文件夹下有同名文件,是否替换?", "提示", MessageBoxButtons.YesNo, MessageBoxIcon.Information) == DialogResult.No) ; - - } - byte[] file = UDF.Down(Cyberpipe.PED_logicfile.PED_Affair.Redact_D); - FileStream pFileSream = new FileStream(dir_Ok + "\\说明.docx", FileMode.OpenOrCreate); - pFileSream.Write(file, 0, file.Length); - pFileSream.Close(); - if (File.Exists(dir_Ok + "\\" + Files_Name(Cyberpipe.PED_logicfile.PED_Affair.Redact_D, 1)) == true) - { - MessageBox.Show("文件导出成功!"); - } - - } - } - /// /// 空间查询 /// @@ -9792,7 +8001,7 @@ GSOLayer resLayer = null; GSOFeature resFeature = null; globeControl1.Globe.GetSelectObject(0, out resFeature, out resLayer); - + if (resFeature == null) return; GSOGeoPolyline3D line1 = resFeature.Geometry as GSOGeoPolyline3D; if (line1 == null) { @@ -9876,7 +8085,7 @@ GSOLayer resLayer = null; GSOFeature resFeature = null; globeControl1.Globe.GetSelectObject(0, out resFeature, out resLayer); - + if (resFeature == null) return; GSOGeoPolyline3D line1 = resFeature.Geometry as GSOGeoPolyline3D; if (line1 == null) { @@ -9891,7 +8100,8 @@ } GSOFeatures feats = globeControl1.Globe.MemoryLayer.GetFeatureByName("粒子要素", true); - if (feats.Length > 0) + + if (feats!=null&&feats.Length > 0) globeControl1.Globe.MemoryLayer.RemoveFeatureByID(feats[0].ID); //if (emitterFeature != null) //{ @@ -11121,88 +9331,6 @@ } private int connectServerCount = 0; - - /// - /// 还原球到实测库 - /// - private void refreshGlobe1() - { - //添加实测库图层已有图层 - int servernum = 0; - //1.清除global1上 - for (int i = globeControl1.Globe.Layers.Count - 1; i >= 0; i--) - { - GSOLayer layer = globeControl1.Globe.Layers[i]; - if (!layer.Name.Contains("fttp:")) - { - layer.Dataset.Close();//清除内存 - globeControl1.Globe.Layers.Remove(layer); - } - else - { - servernum++; - } - } - - //globeControl1.Globe.ConnectServer(Utility.serverip, Utility.serverport, "", ""); //加载locaServer中的数据 - - //2.添加实测库图层 - string[] markerStrs = new string[9]; - markerStrs[0] = "标高标注"; - markerStrs[1] = "管径标注"; - markerStrs[2] = "埋深标注"; - markerStrs[3] = "坐标标注"; - markerStrs[4] = "坡度标注"; - markerStrs[5] = "属性标注"; - markerStrs[6] = "自定义标注"; - markerStrs[7] = "距离标注"; - markerStrs[8] = "扯旗标注"; - for (int i = 0; i < markerStrs.Length; i++) - { - if (File.Exists(Application.StartupPath + "\\标注管理\\" + markerStrs[i] + ".lgd")) - { - GSOLayer markerLayer = globeControl1.Globe.Layers.Add(Application.StartupPath + "\\标注管理\\" + markerStrs[i] + ".lgd"); - } - } - - for (int i = 0; i < g1layername.Count; i++) - { - string g1name = g1layername[i]; - GSODataset datasetg1 = Utility.dataSource.GetDatasetByName(g1name); - GSOLayer templayer = globeControl1.Globe.Layers.Add(datasetg1); - templayer.MaxVisibleAltitude = -1; - } - layerTemp = globeControl1.Globe.Layers.Add(Application.StartupPath + "\\tempLgdData.lgd"); - globeControl1.Globe.Layers.Add(Application.StartupPath + "/城市七线/城市红线.lgd"); - globeControl1.Globe.Layers.Add(Application.StartupPath + "/城市七线/城市橙线.lgd"); - globeControl1.Globe.Layers.Add(Application.StartupPath + "/城市七线/城市黄线.lgd"); - globeControl1.Globe.Layers.Add(Application.StartupPath + "/城市七线/城市绿线.lgd"); - globeControl1.Globe.Layers.Add(Application.StartupPath + "/城市七线/城市蓝线.lgd"); - globeControl1.Globe.Layers.Add(Application.StartupPath + "/城市七线/城市紫线.lgd"); - globeControl1.Globe.Layers.Add(Application.StartupPath + "/城市七线/城市黑线.lgd"); - globeControl1.Globe.Layers.Add(Application.StartupPath + "/隧道.lgd"); - - //移动server的数据图层 - for (int i = 0; i < servernum; i++) - { - globeControl1.Globe.Layers.MoveTo(globeControl1.Globe.Layers.Count - 1, 0); - } - - if (layerManagerNode.Nodes.Count > 0) - { - for (int i = layerManagerNode.Nodes.Count - 1; i >= 0; i--) - { - layerManagerNode.Nodes[i].Remove(); - - } - } - - - - globeControl1.Refresh(); - - } - /// /// 碰撞审查 /// @@ -11476,31 +9604,7 @@ // } //} #endregion - /// - /// 数据质量检查 - /// - /// - /// - private void buttonItemSJGL2_Click(object sender, EventArgs e) - { - //日志记录 - LogManager.saveLog(Utility.userName, this.buttonItemSJGL2.Text); - FrmValiData frm = new FrmValiData(globeControl1); - frm.ShowDialog(); - } - /// - /// 数据预处理 - /// - /// - /// - private void buttonItemSJGL3_Click(object sender, EventArgs e) - { - //保存日志 - LogManager.saveLog(Utility.userName, this.buttonItemSJGL3.Text); - FrmEditShapeFile frm = new FrmEditShapeFile(globeControl1); - frm.ShowDialog(this); - } /// /// 连接数据库 /// @@ -12251,60 +10355,6 @@ List lineStruct = new List(); GSOFeature featureSelected = null; - private void AddDatagridView(DataTable table) - { - - if (table != null && table.Rows.Count > 0) - { - dataGridViewX1.DataSource = table; - panelOfTable.Visible = true; - panelOfTable.Height = 200; - toolStripNumbers.Text = "红线审核结果"; - toolStripFeatureLength.Text = " 共有:" + table.Rows.Count + "条"; - } - else - { - - } - - } - - /// - /// 去除集合中重复的管线 - /// - /// - /// - /// - private GSOFeatures getFeaturesByFilter(GSOFeatures features, string fieldName) - { - if (features == null) - { - return null; - } - GSOFeatures featuresGet = new GSOFeatures(); - for (int i = 0; i < features.Length; i++) - { - GSOFeature featureFromFS = features[i]; - string fieldValueFromFS = featureFromFS.GetValue(fieldName).ToString().Trim(); - bool isHas = false; - for (int j = featuresGet.Length - 1; j >= 0; j--) - { - GSOFeature featureFromFSGet = featuresGet[j]; - string fieldValueFromFSGet = featureFromFSGet.GetValue(fieldName).ToString().Trim(); - if (fieldValueFromFS.Equals(fieldValueFromFSGet)) - { - isHas = true; - break; - } - } - if (isHas == false) - { - featuresGet.Add(featureFromFS.Clone()); - } - } - return featuresGet; - } - /// /// 数据管理导入文件 /// @@ -12440,138 +10490,7 @@ // //MessageBox.Show("系统运行错误:" + ex.ToString(), "错误", MessageBoxButtons.OK, MessageBoxIcon.Error); // } //} - - - /// - /// 标识器全区域统计 - /// - /// - /// - private void 标识器分类统计ToolStripMenuItem_Click(object sender, EventArgs e) - { - globeControl1.Globe.Action = EnumAction3D.ActionNull; - FrmBSQStatis bsqStatis = new FrmBSQStatis(); - bsqStatis.Show(this); - } - /// - /// 标识器绘制区域统计 - /// - /// - /// - private void 标识器分类统计ToolStripMenuItem1_Click(object sender, EventArgs e) - { - trackflag = "BSQDuoBianXiangStatis"; - globeControl1.Globe.Action = EnumAction3D.TrackPolygon; - } - - - #region 保存和加载审核库加载的图层 - private void saveLayerList(TreeNodeCollection treeNodeList) - { - string configPath = Application.StartupPath + "\\configLayerList.xml"; - try - { - XmlDocument doc = new XmlDocument(); - doc.Load(configPath); - XmlNode dbParams = doc.SelectSingleNode("Params/dbparams"); - XmlNode dbLayers = doc.SelectSingleNode("Params/dblayers"); - XmlNode layers = doc.SelectSingleNode("Params/layers"); - dbParams.RemoveAll(); - dbLayers.RemoveAll(); - layers.RemoveAll(); - - List listDS = new List(); - String shDatasourceName = Utility.sgdbip + "/" + Utility.sgdbname + "_" + Utility.sgdbuser; - bool flag = false; - - for (int i = 0; i < globeControl1.Globe.DataManager.DataSourceCount; i++) - { - GSODataSource ds = globeControl1.Globe.DataManager.GetDataSourceAt(i); - if (ds != null && ds.Type == EnumDataSourceType.SqlServer || ds.Type == EnumDataSourceType.Oracle) - { - if (ds.Name == shDatasourceName) - { - //防止因为多次连接同一个数据库 - if (flag == true) - { - break; - } - flag = true; - listDS.Add(ds); - GSODataSourceCnn conn = ds.GetConnectionInfo(); - - XmlElement dbparam = doc.CreateElement("shdbparam"); - XmlElement ip = doc.CreateElement("ship"); - ip.InnerText = conn.Server; - - XmlElement dbname = doc.CreateElement("shdbname"); - dbname.InnerText = conn.Database; - - XmlElement username = doc.CreateElement("shusername"); - username.InnerText = conn.User; - - XmlElement password = doc.CreateElement("shpassword"); - password.InnerText = conn.Password; - - XmlElement type = doc.CreateElement("shtype"); - if (ds.Type == EnumDataSourceType.SqlServer) - { - type.InnerText = "sqlserver"; - } - else - { - type.InnerText = "oracle"; - } - - dbparam.AppendChild(ip); - dbparam.AppendChild(dbname); - dbparam.AppendChild(username); - dbparam.AppendChild(password); - dbparam.AppendChild(type); - dbParams.AppendChild(dbparam); - } - - } - } - - for (int i = 0; i < treeNodeList.Count; i++) - { - GSOLayer layer = treeNodeList[i].Tag as GSOLayer; - if (Path.GetExtension(layer.Name) == "") - { - XmlElement dbLayer = doc.CreateElement("dblayer"); - XmlAttribute attri = doc.CreateAttribute("dbindex"); - for (int j = 0; j < listDS.Count; j++) - { - if (layer.Dataset.DataSource.Name == listDS[j].Name) - { - attri.Value = j.ToString(); - break; - } - } - dbLayer.Attributes.Append(attri); - dbLayer.InnerText = layer.Name; - - dbLayers.AppendChild(dbLayer); - } - else - { - XmlElement dbLayer = doc.CreateElement("layer"); - dbLayer.InnerText = layer.Name; - layers.AppendChild(dbLayer); - } - } - - doc.Save(configPath); - } - catch (Exception e) - { - - } - } - - #endregion - + private void buttonItem_TaskManager_Click(object sender, EventArgs e) { if (Form_TaksManager.IS_OPEN) diff --git a/Cyberpipe.csproj b/Cyberpipe.csproj index 07a8c1a..e3cd12c 100644 --- a/Cyberpipe.csproj +++ b/Cyberpipe.csproj @@ -204,25 +204,6 @@ - - Form - - - F_GKT1数据输入输出.cs - - - Form - - - F_GKT1添加文件.cs - - - Form - - - F_GKT1添加项目.cs - - Form @@ -1068,18 +1049,6 @@ Frm_password_reset.cs - - Form - - - GKT.cs - - - Form - - - GKT1.cs - Form @@ -1258,12 +1227,6 @@ F_Projedit.cs - - Form - - - PED.cs - Form @@ -1331,16 +1294,6 @@ True Reference.map - - F_GKT1数据输入输出.cs - Designer - - - F_GKT1添加文件.cs - - - F_GKT1添加项目.cs - Form_EditTask.cs @@ -1836,12 +1789,6 @@ Frm_password_reset.cs - - GKT.cs - - - GKT1.cs - F_GKT数据输入输出.cs @@ -1934,9 +1881,6 @@ F_Projedit.cs - - PED.cs - F_数据输入输出.cs diff --git a/Cyberpipe.suo b/Cyberpipe.suo index 68ced4f..a1aecf8 100644 --- a/Cyberpipe.suo +++ b/Cyberpipe.suo Binary files differ diff --git a/EMS_Forms/Form_EditTask.cs b/EMS_Forms/Form_EditTask.cs index 718992f..f1d791f 100644 --- a/EMS_Forms/Form_EditTask.cs +++ b/EMS_Forms/Form_EditTask.cs @@ -119,7 +119,8 @@ String name = Convert.ToString(dr["USERNAME"]); comboBox_userName.Items.Add(name); - } + } + dr.Close(); comboBox_road.Items.Clear(); roadList = new List(); @@ -135,7 +136,7 @@ comboBox_road.Items.Add(name); } } - + dr1.Close(); conn.Close(); bool flag2 = false; @@ -185,7 +186,7 @@ catch (Exception ex) { - MessageBox.Show(ex.ToString()); + LogHelper.WriteLog(typeof(Form_EditTask), ex.Message); } } @@ -288,7 +289,7 @@ } catch (Exception ex) { - MessageBox.Show(ex.ToString()); + LogHelper.WriteLog(typeof(Form_EditTask), ex.Message); } } @@ -474,7 +475,7 @@ } catch (Exception ex) { - MessageBox.Show(ex.ToString()); + LogHelper.WriteLog(typeof(Form_EditTask), ex.Message); } this.Close(); @@ -495,6 +496,7 @@ { numList.Add(Convert.ToInt32(dr["DBID"])); } + dr.Close(); if (numList.Count == 0) { taskNumber = Convert.ToInt32(number) * 100; @@ -674,6 +676,7 @@ } } } + dr.Close(); conn.Close(); } diff --git a/EMS_Forms/Form_EventManager.cs b/EMS_Forms/Form_EventManager.cs index b18c45b..84807b2 100644 --- a/EMS_Forms/Form_EventManager.cs +++ b/EMS_Forms/Form_EventManager.cs @@ -64,6 +64,7 @@ comboBox_name.Items.Add(name); } + dr.Close(); conn.Close(); diff --git a/Forms/FrmMnModify.cs b/Forms/FrmMnModify.cs index 31cfc5f..d036360 100644 --- a/Forms/FrmMnModify.cs +++ b/Forms/FrmMnModify.cs @@ -68,15 +68,7 @@ questionGrid.Rows[idx].Cells[1].Value = sr.question; } } - /// 选中对象 - /// - /// - /// - /// - private void buttonX1_Click(object sender, EventArgs e) - { - globecontrol.Globe.Action = EnumAction3D.SelectObject; - } + /// /// 选中某一行 /// diff --git a/Forms/FrmPipelineModelDataBase.cs b/Forms/FrmPipelineModelDataBase.cs index 2acf0ca..7ce573f 100644 --- a/Forms/FrmPipelineModelDataBase.cs +++ b/Forms/FrmPipelineModelDataBase.cs @@ -35,19 +35,7 @@ ds = _ds; InitializeComponent(); } - /// - /// 单击选择shp格式文件 - /// - /// - /// - private void btnBrowseModel_Click(object sender, EventArgs e) - { - saveFileDialog1.Filter = "*.lgd|*.lgd"; - if (saveFileDialog1.ShowDialog() == DialogResult.OK) - { - txtModelLayer.Text = saveFileDialog1.FileName; - } - } + /// /// 窗体初始化事件处理 /// @@ -100,49 +88,6 @@ } } } - - private object convertFieldValue(string fieldname, object obj) - { - if (obj == null) - return null; - - try - { - string type = fields_types[fieldname].ToString(); - switch (type) - { - case "string": - return obj.ToString(); - case "int": - //return 101; - int intResult; - if (int.TryParse(obj.ToString(), out intResult)) - return intResult; - else - return null; - case "double": - //return 202.5; - double doubleResult; - if (double.TryParse(obj.ToString(), out doubleResult)) - return doubleResult; - else - return null; - case "date": - DateTime dtResult; - if (DateTime.TryParse(obj.ToString(), out dtResult)) - return dtResult; - else - return null; - } - return null; - } - catch (Exception ex) - { - MessageBox.Show(ex.ToString()); - return null; - } - } - public string lgdFilePath = ""; /// /// 选择管线颜色 @@ -610,33 +555,6 @@ { this.Close(); } - - private void cmbLayer_SelectedIndexChanged(object sender, EventArgs e) //选择图层 - { - GSOLayer layer = ctl.Globe.Layers.GetLayerByCaption(selectLayerName); - GSOFeatures features = layer.GetAllFeatures(); - if (features.Length == 0) - return; - - cmbFrom.Items.Clear(); - cmbTo.Items.Clear(); - cmbRadius.Items.Clear(); - cmbID.Items.Clear(); - for (int i = 0; i < features[0].GetFieldCount(); i++) - { - GeoScene.Data.GSOFieldDefn fielddef = (GeoScene.Data.GSOFieldDefn)(features[0].GetFieldDefn(i)); - - cmbFrom.Items.Add(fielddef.Name); - cmbTo.Items.Add(fielddef.Name); - cmbRadius.Items.Add(fielddef.Name); - cmbID.Items.Add(fielddef.Name); - } - cmbFrom.SelectedItem = "Deep1"; - cmbTo.SelectedItem = "Deep2"; - cmbRadius.SelectedItem = "Diameter"; - cmbID.SelectedItem = "Handle"; - } - private void buttonXLayerPath_Click(object sender, EventArgs e)//单击 选择shp格式的文件 { OpenFileDialog dlg = new OpenFileDialog(); diff --git a/Forms/FrmPipelineModelDataOneStep.cs b/Forms/FrmPipelineModelDataOneStep.cs index 18afda7..ec93b8a 100644 --- a/Forms/FrmPipelineModelDataOneStep.cs +++ b/Forms/FrmPipelineModelDataOneStep.cs @@ -38,19 +38,7 @@ layerTree = _layerTree; InitializeComponent(); } - /// - /// 单击选择shp格式文件 - /// - /// - /// - private void btnBrowseModel_Click(object sender, EventArgs e) - { - saveFileDialog1.Filter = "*.lgd|*.lgd"; - if (saveFileDialog1.ShowDialog() == DialogResult.OK) - { - txtModelLayer.Text = saveFileDialog1.FileName; - } - } + /// /// 窗体初始化事件处理 /// @@ -107,48 +95,7 @@ } } - private object convertFieldValue(string fieldname, object obj) - { - if (obj == null) - return null; - - try - { - string type = fields_types[fieldname].ToString(); - switch (type) - { - case "string": - return obj.ToString(); - case "int": - //return 101; - int intResult; - if (int.TryParse(obj.ToString(), out intResult)) - return intResult; - else - return null; - case "double": - //return 202.5; - double doubleResult; - if (double.TryParse(obj.ToString(), out doubleResult)) - return doubleResult; - else - return null; - case "date": - DateTime dtResult; - if (DateTime.TryParse(obj.ToString(), out dtResult)) - return dtResult; - else - return null; - } - return null; - } - catch (Exception ex) - { - MessageBox.Show(ex.ToString()); - return null; - } - } - + public string lgdFilePath = ""; /// /// 选择管线颜色 @@ -673,32 +620,6 @@ return featDs; } - private void cmbLayer_SelectedIndexChanged(object sender, EventArgs e) //选择图层 - { - GSOLayer layer = ctl.Globe.Layers.GetLayerByCaption(selectLayerName); - GSOFeatures features = layer.GetAllFeatures(); - if (features.Length == 0) - return; - - cmbFrom.Items.Clear(); - cmbTo.Items.Clear(); - cmbRadius.Items.Clear(); - cmbID.Items.Clear(); - for (int i = 0; i < features[0].GetFieldCount(); i++) - { - GeoScene.Data.GSOFieldDefn fielddef = (GeoScene.Data.GSOFieldDefn)(features[0].GetFieldDefn(i)); - - cmbFrom.Items.Add(fielddef.Name); - cmbTo.Items.Add(fielddef.Name); - cmbRadius.Items.Add(fielddef.Name); - cmbID.Items.Add(fielddef.Name); - } - cmbFrom.SelectedItem = "Deep1"; - cmbTo.SelectedItem = "Deep2"; - cmbRadius.SelectedItem = "Diameter"; - cmbID.SelectedItem = "Handle"; - } - private void buttonXLayerPath_Click(object sender, EventArgs e)//单击 选择shp格式的文件 { OpenFileDialog dlg = new OpenFileDialog(); @@ -949,38 +870,6 @@ } //txtLayername.Text = type + layername; } - /// - /// 连接数据库 - /// - /// - /// - private void buttonX1_Click(object sender, EventArgs e) - { - if (ds == null) - { - //没连的话,直接连接审核库; //审核库配置读配置文件 - string dbIp = Utility.sgdbip; - string database = Utility.sgdbname; - string user = Utility.sgdbuser; - string pass = Utility.sgdbpwd; - - if (!Utility.isNetworkConnectionSuccess(dbIp.Trim())) - { - MessageBox.Show("网络连接失败!", "提示"); - return; - } - - ds = ctl.Globe.DataManager.OpenOracleDataSource(dbIp + "/" + database, "", "", user, pass); - if (ds == null) - { - MessageBox.Show("数据库连接失败!", "提示", MessageBoxButtons.OK, MessageBoxIcon.Warning); - } - else - { - btnCreateModel.Enabled = true; - } - } - } private void btnClose_Click(object sender, EventArgs e) { diff --git a/Forms/FrmShRK.cs b/Forms/FrmShRK.cs index 0e2e722..f1d83cb 100644 --- a/Forms/FrmShRK.cs +++ b/Forms/FrmShRK.cs @@ -215,6 +215,7 @@ { sourcefeatds = sourcefeat as GSOFeatureDataset; } + if (sourcefeatds == null) return; sourcefeatds.Open(); GSOFeatures sourcefeatures = sourcefeatds.GetAllFeatures(); @@ -251,6 +252,7 @@ { desfeatds = desfeat as GSOFeatureDataset; } + if (desfeatds == null) return; desfeatds.Open(); //向新数据集写入字段 diff --git a/FrmAccessoriesSensor.cs b/FrmAccessoriesSensor.cs index 09fcdf1..2a7a80e 100644 --- a/FrmAccessoriesSensor.cs +++ b/FrmAccessoriesSensor.cs @@ -209,7 +209,7 @@ chart1.Series[0].Points.DataBindXY(dic.Keys, dic.Values); for (int m = 0; m < dic.Values.Count; m++) { - if (chart1.Series[0].Points[m].YValues[0].ToString() != "0") + if (chart1.Series[0].Points[m]!=null&&chart1.Series[0].Points[m].YValues[0].ToString() != "0") { chart1.Series[0].Points[m].Label = chart1.Series[0].Points[m].YValues[0].ToString(); } diff --git a/FrmAccessoriesgather.cs b/FrmAccessoriesgather.cs index 9e331e1..a475d9e 100644 --- a/FrmAccessoriesgather.cs +++ b/FrmAccessoriesgather.cs @@ -338,7 +338,7 @@ chart1.Series[0].Points.DataBindXY(dic.Keys, dic.Values); for (int m = 0; m < dic.Values.Count; m++) { - if (chart1.Series[0].Points[m].YValues[0].ToString() != "0") + if (chart1.Series[0].Points[m]!=null&&chart1.Series[0].Points[m].YValues[0].ToString() != "0") { chart1.Series[0].Points[m].Label = chart1.Series[0].Points[m].YValues[0].ToString(); } diff --git a/FrmAccessoryAnalysis.cs b/FrmAccessoryAnalysis.cs index 71d4579..44d4065 100644 --- a/FrmAccessoryAnalysis.cs +++ b/FrmAccessoryAnalysis.cs @@ -66,39 +66,6 @@ globeControl1.Refresh(); } /// - /// 键盘按键按下事件处理 - /// - /// - /// - private void txtRadius_KeyPress(object sender, KeyPressEventArgs e) - { - TextBox text = sender as TextBox; - if ((e.KeyChar < 48 || e.KeyChar > 57) && (e.KeyChar != 8) && (int)e.KeyChar != 46) - { - e.Handled = true; - } - if ((int)e.KeyChar == 46) //小数点 - { - if (text.Text.Length <= 0) - e.Handled = true; //小数点不能在第一位 - else //处理不规则的小数点 - { - float f; - float oldf; - bool b1 = false, b2 = false; - b1 = float.TryParse(text.Text, out oldf); - b2 = float.TryParse(text.Text + e.KeyChar.ToString(), out f); - if (b2 == false) - { - if (b1 == true) - e.Handled = true; - else - e.Handled = false; - } - } - } - } - /// /// 确定按钮事件处理 /// /// diff --git a/FrmAddValve.cs b/FrmAddValve.cs index 34d2fec..5f405b9 100644 --- a/FrmAddValve.cs +++ b/FrmAddValve.cs @@ -486,56 +486,6 @@ } } - - - - - - - - private void cmbLayer_SelectedIndexChanged(object sender, EventArgs e) - { - GSOLayer layer = globeControl1.Globe.Layers.GetLayerByCaption(selectLayerName); - GSOFeatures features = layer.GetAllFeatures(); - if (features.Length == 0) - return; - - combPath.Items.Clear(); - combZ.Items.Clear(); - combModelName.Items.Clear(); - - for (int i = 0; i < features[0].GetFieldCount(); i++) - { - GeoScene.Data.GSOFieldDefn fielddef = (GeoScene.Data.GSOFieldDefn)(features[0].GetFieldDefn(i)); - combPath.Items.Add(fielddef.Name); - combZ.Items.Add(fielddef.Name); - combModelName.Items.Add(fielddef.Name); - } - combModelName.SelectedItem = "编号"; - combPath.SelectedItem = "模型路径"; - if (combfile.SelectedIndex != -1) - { - - string layerCaption = combfile.SelectedItem.ToString().Trim(); - rukuLayer = globeControl1.Globe.Layers.GetLayerByCaption(layerCaption); - if (rukuLayer != null) - { - combPath.Items.Clear(); - combZ.Items.Clear(); - combModelName.Items.Clear(); - - } - for (int i = 0; i < features[0].GetFieldCount(); i++) - { - GeoScene.Data.GSOFieldDefn fielddef = (GeoScene.Data.GSOFieldDefn)(features[0].GetFieldDefn(i)); - combPath.Items.Add(fielddef.Name); - combZ.Items.Add(fielddef.Name); - combModelName.Items.Add(fielddef.Name); - } - combModelName.SelectedItem = "编号"; - combPath.SelectedItem = "模型路径"; - } - } /// /// 单击选择shp格式文件 /// diff --git a/FrmAddWellShp.cs b/FrmAddWellShp.cs index bb79ec0..a249725 100644 --- a/FrmAddWellShp.cs +++ b/FrmAddWellShp.cs @@ -478,32 +478,6 @@ } } } - - private void cmbLayer_SelectedIndexChanged(object sender, EventArgs e) - { - GSOLayer layer = globeControl1.Globe.Layers.GetLayerByCaption(selectLayerName); - GSOFeatures features = layer.GetAllFeatures(); - if (features.Length == 0) - return; - - combCode.Items.Clear(); - combDeep.Items.Clear(); - combModelName.Items.Clear(); - combAngle.Items.Clear(); - - for (int i = 0; i < features[0].GetFieldCount(); i++) - { - GeoScene.Data.GSOFieldDefn fielddef = (GeoScene.Data.GSOFieldDefn)(features[0].GetFieldDefn(i)); - combCode.Items.Add(fielddef.Name); - combDeep.Items.Add(fielddef.Name); - combModelName.Items.Add(fielddef.Name); - combAngle.Items.Add(fielddef.Name); - } - combCode.SelectedItem = "附属物编码"; - combDeep.SelectedItem = "井深"; - combModelName.SelectedItem = "编号"; - combAngle.SelectedItem = "符号角度"; - } /// /// 单击选择shp格式文件 /// diff --git a/FrmAddYuBiZiShp.cs b/FrmAddYuBiZiShp.cs index b312d51..332f037 100644 --- a/FrmAddYuBiZiShp.cs +++ b/FrmAddYuBiZiShp.cs @@ -383,80 +383,7 @@ } } - private void cmbLayer_SelectedIndexChanged(object sender, EventArgs e) - { - GSOLayer layer = globeControl1.Globe.Layers.GetLayerByCaption(selectLayerName); - GSOFeatures features = layer.GetAllFeatures(); - if (features.Length == 0) - return; - - combCode.Items.Clear(); - combDeep.Items.Clear(); - combModelName.Items.Clear(); - //comboLoad.Items.Clear(); - for (int i = 0; i < features[0].GetFieldCount(); i++) - { - GeoScene.Data.GSOFieldDefn fielddef = (GeoScene.Data.GSOFieldDefn)(features[0].GetFieldDefn(i)); - combCode.Items.Add(fielddef.Name); - combDeep.Items.Add(fielddef.Name); - combModelName.Items.Add(fielddef.Name); - //comboLoad.Items.Add(fielddef.Name); - } - combCode.SelectedItem = "附属物编码"; - combDeep.SelectedItem = "Z坐标"; - combModelName.SelectedItem = "编号"; - //comboLoad.SelectedItem = "模型路径"; - } - - private void buttonXLayerPath_Click(object sender, EventArgs e) - { - OpenFileDialog dlg = new OpenFileDialog(); - dlg.Filter = "*.shp|*.shp"; - dlg.Multiselect = false; - if (dlg.ShowDialog() == DialogResult.OK) - { - GSOLayer layer = globeControl1.Globe.Layers.Add(dlg.FileName); - string txtMessage = valiYBdata(layer); - if (txtMessage != "") - { - button3.Enabled = false; - //textBoxLayer.Text = ""; - combCode.Items.Clear(); - combDeep.Items.Clear(); - combModelName.Items.Clear(); - globeControl1.Globe.Layers.Remove(layer); - FrmValiDataShowErrorMessage showErrorMessage = new FrmValiDataShowErrorMessage(dlg.FileName, txtMessage); - showErrorMessage.ShowDialog(); - return; - } - else - { - button3.Enabled = true; - //textBoxLayer.Text = dlg.FileName; - selectLayerName = layer.Caption; - txtLayerName.Text = layer.Caption; - GSOFeatures features = layer.GetAllFeatures(); - if (features.Length == 0) - return; - - combCode.Items.Clear(); - combDeep.Items.Clear(); - combModelName.Items.Clear(); - for (int i = 0; i < features[0].GetFieldCount(); i++) - { - GeoScene.Data.GSOFieldDefn fielddef = (GeoScene.Data.GSOFieldDefn)(features[0].GetFieldDefn(i)); - combCode.Items.Add(fielddef.Name); - combDeep.Items.Add(fielddef.Name); - combModelName.Items.Add(fielddef.Name); - //comboLoad.Items.Add(fielddef.Name); - } - combCode.SelectedItem = "管点编码"; - combDeep.SelectedItem = "Z坐标"; - combModelName.SelectedItem = "编号"; - } - } - } - + private void FrmAddYuBiZiShp_FormClosing(object sender, FormClosingEventArgs e) { globeControl1.Globe.Refresh(); diff --git a/FrmAllPipelineStatis.cs b/FrmAllPipelineStatis.cs index 6421a26..a6eea29 100644 --- a/FrmAllPipelineStatis.cs +++ b/FrmAllPipelineStatis.cs @@ -84,7 +84,7 @@ chartAllAreaPipeline.Series["管线"].Points.DataBindXY(pipelineLengthAndType.Keys, pipelineLengthAndType.Values); for (int m = 0; m < pipelineLengthAndType.Values.Count; m++) { - if (chartAllAreaPipeline.Series["管线"].Points[m].YValues[0].ToString() != "0") + if (chartAllAreaPipeline.Series["管线"].Points[m]!=null&&chartAllAreaPipeline.Series["管线"].Points[m].YValues[0].ToString() != "0") { chartAllAreaPipeline.Series["管线"].Points[m].Label = chartAllAreaPipeline.Series[0].Points[m].YValues[0].ToString(); } @@ -94,7 +94,7 @@ } catch (Exception ex) { - //LogError.PublishError(ex); + LogHelper.WriteLog(typeof(FrmAllPipelineStatis), ex.Message); } } @@ -147,7 +147,7 @@ } DataTable dt = OledbHelper.QueryTable(sql); - if (dt != null && dt.Rows.Count > 0) + if (dt != null && dt.Rows.Count > 0 && chartAllAreaPipeline.Series["管线"].Points[indexHit]!=null) { dataGridViewX1.DataSource = dt; panel.Visible = true; diff --git a/FrmAllWorkWellStatis.cs b/FrmAllWorkWellStatis.cs index 6fec7af..6af8e4c 100644 --- a/FrmAllWorkWellStatis.cs +++ b/FrmAllWorkWellStatis.cs @@ -52,7 +52,7 @@ chartAllAreaPipeline.Series["井盖"].Points.DataBindXY(workWellLengthAndType.Keys, workWellLengthAndType.Values); for (int m = 0; m < workWellLengthAndType.Values.Count; m++) { - if (chartAllAreaPipeline.Series["井盖"].Points[m].YValues[0].ToString().Trim() != "0") + if (chartAllAreaPipeline.Series["井盖"].Points[m]!=null&&chartAllAreaPipeline.Series["井盖"].Points[m].YValues[0].ToString().Trim() != "0") { chartAllAreaPipeline.Series["井盖"].Points[m].Label = chartAllAreaPipeline.Series[0].Points[m].YValues[0].ToString(); } @@ -60,7 +60,7 @@ } catch (Exception ex) { - //LogError.PublishError(ex); + LogHelper.WriteLog(typeof(FrmAllWorkWellStatis), ex.Message); } } diff --git a/FrmBSQDuoBianXingStatis.cs b/FrmBSQDuoBianXingStatis.cs index e8b7d52..3e889b6 100644 --- a/FrmBSQDuoBianXingStatis.cs +++ b/FrmBSQDuoBianXingStatis.cs @@ -60,7 +60,7 @@ { for (int m = 0; m < bsq1.Values.Count; m++) { - if (chart1.Series["标识器"].Points[m].YValues[0].ToString() != "0") + if (chart1.Series["标识器"].Points[m]!=null&&chart1.Series["标识器"].Points[m].YValues[0].ToString() != "0") { count += Convert.ToInt16(chart1.Series[0].Points[m].YValues[0].ToString()); chart1.Series["标识器"].Points[m].Label = chart1.Series[0].Points[m].YValues[0].ToString(); diff --git a/FrmBSQDuoBianXingStreet.cs b/FrmBSQDuoBianXingStreet.cs index 2005ebb..1db5777 100644 --- a/FrmBSQDuoBianXingStreet.cs +++ b/FrmBSQDuoBianXingStreet.cs @@ -63,7 +63,7 @@ chartStatis.Series[0].Points.DataBindXY(bsq.Keys, bsq.Values); for (int m = 0; m < bsq.Values.Count; m++) { - if (chartStatis.Series[0].Points[m].YValues[0].ToString().Trim() != "0") + if (chartStatis.Series[0].Points[m]!=null&&chartStatis.Series[0].Points[m].YValues[0].ToString().Trim() != "0") { count += Convert.ToInt16(chartStatis.Series[0].Points[m].YValues[0].ToString()); chartStatis.Series[0].Points[m].Label = chartStatis.Series[0].Points[m].YValues[0].ToString(); diff --git a/FrmBSQStatis.cs b/FrmBSQStatis.cs index 390a55c..4aa0ee6 100644 --- a/FrmBSQStatis.cs +++ b/FrmBSQStatis.cs @@ -95,6 +95,8 @@ } } } + + dr.Close(); conn.Close(); for (int i = 0; i < typeLists.Count; i++) { @@ -123,7 +125,7 @@ chartStatis.Series[0].Points.DataBindXY(bsq.Keys, bsq.Values); for (int m = 0; m < bsq.Values.Count; m++) { - if (chartStatis.Series[0].Points[m].YValues[0].ToString().Trim() != "0") + if (chartStatis.Series[0].Points[m]!=null&&chartStatis.Series[0].Points[m].YValues[0].ToString().Trim() != "0") { //count += Convert.ToInt16(chartStatis.Series[0].Points[m].YValues[0].ToString()); chartStatis.Series[0].Points[m].Label = chartStatis.Series[0].Points[m].YValues[0].ToString(); diff --git a/FrmBSQStreet.cs b/FrmBSQStreet.cs index 9d88adb..7fbacad 100644 --- a/FrmBSQStreet.cs +++ b/FrmBSQStreet.cs @@ -44,7 +44,7 @@ chartStatis.Series[0].Points.DataBindXY(bsq.Keys, bsq.Values); for (int m = 0; m < bsq.Values.Count; m++) { - if (chartStatis.Series[0].Points[m].YValues[0].ToString().Trim() != "0") + if (chartStatis.Series[0].Points[m]!=null&&chartStatis.Series[0].Points[m].YValues[0].ToString().Trim() != "0") { count += Convert.ToInt16(chartStatis.Series[0].Points[m].YValues[0].ToString()); chartStatis.Series[0].Points[m].Label = chartStatis.Series[0].Points[m].YValues[0].ToString(); diff --git a/FrmBoosterValvers.cs b/FrmBoosterValvers.cs index 5061efc..df9b62b 100644 --- a/FrmBoosterValvers.cs +++ b/FrmBoosterValvers.cs @@ -236,199 +236,6 @@ count = 0; } } - /// - /// 添加火苗 - /// - /// - /// - /// - /// - private GSOFeature AddFire(double x,double y,double z) - { - // 烟火示例 - - string strResPath = Application.StartupPath + "/Resource"; - - // 烟火粒子示例,由三个发射器构成 - GSOGeoParticle geoParticle = new GSOGeoParticle(); - geoParticle.SetPosition(x, y, z); // 添加到这个经纬度位置 - geoParticle.AltitudeMode = EnumAltitudeMode.RelativeToGround; - - GSORingParticleEmitter emitter = new GSORingParticleEmitter(); - emitter.TexturePath = strResPath + "/ParticleImage/flare.png"; - - emitter.SetSizeFix(1, 1); - emitter.VelFix = 1; - emitter.VelRnd = 5; - - emitter.AngleXYFix = 0; - emitter.AngleXYRnd = 180; - - emitter.AngleXZFix = 90; - emitter.AngleXZRnd = 0; - - emitter.LifeFix = 0.5f; - emitter.LifeRnd = 0.0f; - - emitter.RotFix = 0; - emitter.RotRnd = 0; - - emitter.RotVelFix = 0; - emitter.RotVelRnd = 0; - - emitter.EmitPerSec = 100; - - // 采用线性插值生成粒子的初始颜色 - emitter.ColorRndStart = Color.White; - emitter.ColorRndEnd = Color.Red; - - - GSOColorParticleEffector effector2 = new GSOColorParticleEffector(); - effector2.SetColorChanged(0, -1, -1, 0); - effector2.StartTime = 0.0f; - effector2.EndTime = -1.0f; - emitter.AddEffector(effector2); - - // 将三个发射器添加到粒子对象中 - geoParticle.AddEmitter(emitter); - - geoParticle.Play(); - - GSOFeature feature = new GSOFeature(); - - feature.Geometry = geoParticle; - - globeControl1.Globe.MemoryLayer.AddFeature(feature); - - - return feature; - } - - /// - /// 添加喷泉 - /// - /// - private GSOFeature AddFountain() - { - string strResPath = Application.StartupPath + "/Resource"; - - GSOGeoParticle geoParticle = new GSOGeoParticle(); - geoParticle.SetPosition(116.314, 39.84, 0); // 添加到这个经纬度位置 - - GSOPointParticleEmitter emitter = new GSOPointParticleEmitter(); - emitter.TexturePath = strResPath + "/ParticleImage/test.png"; - - emitter.SetSizeFix(0.5f, 2); - emitter.VelFix = 10; - emitter.VelRnd = 2; - - emitter.GravityAcc = 9.8f; - emitter.AngleXYFix = 0; - emitter.AngleXYRnd = 180; - - emitter.AngleXZFix = 88; - emitter.AngleXZRnd = 2; - - //emitter.InnerRadius = 0; - // emitter.OuterRadius = 0.03f; - - emitter.LifeFix = 5.0f; - emitter.LifeRnd = 1.0f; - - emitter.RotFix = 0; - emitter.RotRnd = 0; - - emitter.RotVelFix = 0; - emitter.RotVelRnd = 0; - - emitter.EmitPerSec = 1000; - emitter.ColorRndStart = Color.FromArgb(33, 255, 255, 255); - emitter.ColorRndEnd = Color.FromArgb(11, 255, 255, 255); - emitter.IsLumAdded = false; - - // 将三个发射器添加到粒子对象中 - geoParticle.AddEmitter(emitter); - - geoParticle.Play(); - GSOFeature feature = new GSOFeature(); - - feature.Geometry = geoParticle; - - //globeControl1.Globe.MemoryLayer.AddFeature(feature); - globeControl1.Globe.FlyToFeature(feature); - - return feature; - } - - /// - /// 添加水柱 - /// - /// - private GSOFeature AddWaterLine() - { - string strResPath = Application.StartupPath + "/Resource"; - - GSOGeoParticle geoParticle = new GSOGeoParticle(); - geoParticle.SetPosition(116.308, 39.84, 0); // 添加到这个经纬度位置 - - GSOPointParticleEmitter emitter = new GSOPointParticleEmitter(); - - emitter.TexturePath = strResPath + "/ParticleImage/drop3.png"; - - geoParticle.TimerInterval = 1; - - emitter.SetSizeFix(2.0f, 2.0f); - - emitter.VelFix = 50; - emitter.VelRnd = 2; - - // emitter.IsLumAdded = false; - - emitter.GravityAcc = 9.8f; - emitter.AngleXYFix = 0; - emitter.AngleXYRnd = 2; - - emitter.AngleXZFix = 60; - emitter.AngleXZRnd = 2; - - //emitter.InnerRadius = 0; - // emitter.OuterRadius = 0.1f; - - emitter.LifeFix = 5.0f; - emitter.LifeRnd = 1.0f; - - emitter.RotFix = 0; - emitter.RotRnd = 0; - - emitter.RotVelFix = 0; - emitter.RotVelRnd = 0; - - emitter.EmitPerSec = 1500; - - emitter.ColorRndStart = Color.FromArgb(100, 222, 222, 222); - emitter.ColorRndEnd = Color.FromArgb(50, 222, 222, 222); - - /* - - GSOScaleParticleEffector effector1 = new GSOScaleParticleEffector(); - effector1.SetScale(0.2f, 0.2f); - effector1.StartTime = 0; - effector1.EndTime = -1; // 负数表示整个粒子生命结束 - emitter.AddEffector(effector1); - */ - - // 将三个发射器添加到粒子对象中 - geoParticle.AddEmitter(emitter); - - geoParticle.Play(); - GSOFeature feature = new GSOFeature(); - - feature.Geometry = geoParticle; - - //globeControl1.Globe.MemoryLayer.AddFeature(feature); - globeControl1.Globe.FlyToFeature(feature); - - return feature; - } + } } diff --git a/FrmBufferAnalysis.cs b/FrmBufferAnalysis.cs index f711133..db8ca59 100644 --- a/FrmBufferAnalysis.cs +++ b/FrmBufferAnalysis.cs @@ -123,39 +123,6 @@ } } /// - /// 半径文本框的键盘按键按下事件处理 - /// - /// - /// - private void txtRadius_KeyPress(object sender, KeyPressEventArgs e) - { - TextBox text = sender as TextBox; - if ((e.KeyChar < 48 || e.KeyChar > 57) && (e.KeyChar != 8) && (int)e.KeyChar != 46) - { - e.Handled = true; - } - if ((int)e.KeyChar == 46) //小数点 - { - if (text.Text.Length <= 0) - e.Handled = true; //小数点不能在第一位 - else //处理不规则的小数点 - { - float f; - float oldf; - bool b1 = false, b2 = false; - b1 = float.TryParse(text.Text, out oldf); - b2 = float.TryParse(text.Text + e.KeyChar.ToString(), out f); - if (b2 == false) - { - if (b1 == true) - e.Handled = true; - else - e.Handled = false; - } - } - } - } - /// /// 窗体关闭事件处理 /// /// diff --git a/FrmBufferAnalysisBSQ.cs b/FrmBufferAnalysisBSQ.cs index 24a96ca..f54208f 100644 --- a/FrmBufferAnalysisBSQ.cs +++ b/FrmBufferAnalysisBSQ.cs @@ -137,35 +137,7 @@ } } - private void txtRadius_KeyPress(object sender, KeyPressEventArgs e) - { - TextBox text = sender as TextBox; - if ((e.KeyChar < 48 || e.KeyChar > 57) && (e.KeyChar != 8) && (int)e.KeyChar != 46) - { - e.Handled = true; - } - if ((int)e.KeyChar == 46) //小数点 - { - if (text.Text.Length <= 0) - e.Handled = true; //小数点不能在第一位 - else //处理不规则的小数点 - { - float f; - float oldf; - bool b1 = false, b2 = false; - b1 = float.TryParse(text.Text, out oldf); - b2 = float.TryParse(text.Text + e.KeyChar.ToString(), out f); - if (b2 == false) - { - if (b1 == true) - e.Handled = true; - else - e.Handled = false; - } - } - } - } - + private void FrmBufferAnalysis_FormClosing(object sender, FormClosingEventArgs e) { //Form1.y = 0; @@ -316,27 +288,6 @@ } } - private void FlyToMenu_Click(object sender, EventArgs e) - { - if (m_feature != null) - { - if (m_feature.Geometry != null && m_feature.Geometry.Type == EnumGeometryType.GeoPolyline3D) - { - GSOGeoPolyline3D line = m_feature.Geometry as GSOGeoPolyline3D; - double length = line.GetSpaceLength(true, 6378137); - GSOGeoPolyline3D lineLine = line.GetSegment(0, length / 2); - GSOPoint3d point3d = lineLine[lineLine.PartCount - 1][lineLine[lineLine.PartCount - 1].Count - 1]; - - globeControl1.Globe.FlyToPosition(point3d, EnumAltitudeMode.Absolute, 0, 45, 5); - } - else - { - globeControl1.Globe.FlyToFeature(m_feature, 0, 45, 3); - } - LightMenu_Click(sender, e); - } - } - private void LightMenu_Click(object sender, EventArgs e) { flashflag = "single"; diff --git a/FrmDataBaseOpt.cs b/FrmDataBaseOpt.cs index b0c4b5d..8d7b69d 100644 --- a/FrmDataBaseOpt.cs +++ b/FrmDataBaseOpt.cs @@ -362,6 +362,7 @@ dbCombor.Items.Add(dblist[i].title); } } + /* /// /// 从配置文件读取数据库参数配置 /// @@ -428,6 +429,8 @@ } } + * */ + /* /// /// 向配置文件写入连接数据库的参数配置 /// @@ -485,6 +488,7 @@ MessageBox.Show(exp.ToString()); } } + * */ /// /// /// diff --git a/FrmDatabaseParaSetting.cs b/FrmDatabaseParaSetting.cs index a6fea46..63b596b 100644 --- a/FrmDatabaseParaSetting.cs +++ b/FrmDatabaseParaSetting.cs @@ -152,6 +152,7 @@ this.DialogResult = DialogResult.OK; this.Close(); } + /* /// /// 从配置文件读取数据库连接参数配置 /// @@ -218,6 +219,8 @@ } } + * */ + /* /// /// 向配置文件写入数据库参数配置 /// @@ -276,7 +279,7 @@ MessageBox.Show(ex.ToString()); } } - + */ /// /// 取消按钮事件处理 /// diff --git a/FrmDatabaseParaSetting2.cs b/FrmDatabaseParaSetting2.cs index 932d05e..96a87d5 100644 --- a/FrmDatabaseParaSetting2.cs +++ b/FrmDatabaseParaSetting2.cs @@ -148,6 +148,7 @@ this.DialogResult = DialogResult.OK; this.Close(); } + /* /// /// 从配置文件读取数据库连接参数配置 /// @@ -214,6 +215,8 @@ } } + * */ + /* /// /// 向配置文件写入数据库参数配置 /// @@ -272,7 +275,7 @@ MessageBox.Show(exp.ToString()); } } - + */ /// /// 取消按钮事件处理 /// diff --git a/FrmDiameterQuery.cs b/FrmDiameterQuery.cs index 68c948b..9a5215b 100644 --- a/FrmDiameterQuery.cs +++ b/FrmDiameterQuery.cs @@ -77,18 +77,7 @@ isBetween = true; } } - /// - /// 键盘按键按下事件处理 - /// - /// - /// - private void textBoxX1_KeyPress(object sender, KeyPressEventArgs e) - { - if ((e.KeyChar < 48 || e.KeyChar > 57) && e.KeyChar != 8) - { - e.Handled = true;//屏蔽 - } - } + bool isBetween = false; /// diff --git a/FrmDocumentEdit.cs b/FrmDocumentEdit.cs index aab2d31..e78a7ff 100644 --- a/FrmDocumentEdit.cs +++ b/FrmDocumentEdit.cs @@ -256,121 +256,6 @@ } - // - /// 将本地文件上传到指定的服务器(HttpWebRequest方法) - /// - /// 文件上传到的服务器 - /// 要上传的本地文件(全路径) - /// 文件上传后的名称 - /// 上传进度条 - /// 成功返回1,失败返回0 - private int Upload_Request(string address, string fileNamePath, string saveName, ProgressBar progressBar) - { - int returnValue = 0; - // 要上传的文件 - FileStream fs = new FileStream(fileNamePath, FileMode.Open, FileAccess.Read); - BinaryReader r = new BinaryReader(fs); - //时间戳 - string strBoundary = "----------" + DateTime.Now.Ticks.ToString("x"); - byte[] boundaryBytes = Encoding.ASCII.GetBytes("/r/n--" + strBoundary + "/r/n"); - //请求头部信息 - StringBuilder sb = new StringBuilder(); - sb.Append("--"); - sb.Append(strBoundary); - sb.Append("\r\n"); - sb.Append("Content-Disposition: form-data; name=\""); - sb.Append("file"); - sb.Append("\"; filename=\""); - sb.Append(saveName); - sb.Append("\""); - sb.Append("\r\n"); - sb.Append("Content-Type: "); - sb.Append("application/octet-stream"); - sb.Append("\r\n"); - sb.Append("\r\n"); - string strPostHeader = sb.ToString(); - byte[] postHeaderBytes = Encoding.UTF8.GetBytes(strPostHeader); - // 根据uri创建HttpWebRequest对象 - HttpWebRequest httpReq = (HttpWebRequest)WebRequest.Create(new Uri(address)); - httpReq.Method = "POST"; - //对发送的数据不使用缓存 - httpReq.AllowWriteStreamBuffering = false; - //设置获得响应的超时时间(300秒) - httpReq.Timeout = 300000; - httpReq.ContentType = "multipart/form-data; boundary=" + strBoundary; - long length = fs.Length + postHeaderBytes.Length + boundaryBytes.Length; - long fileLength = fs.Length; - httpReq.ContentLength = length; - try - { - progressBar.Maximum = int.MaxValue; - progressBar.Minimum = 0; - progressBar.Value = 0; - //每次上传4k - int bufferLength = 4096; - byte[] buffer = new byte[bufferLength]; - //已上传的字节数 - long offset = 0; - //开始上传时间 - DateTime startTime = DateTime.Now; - int size = r.Read(buffer, 0, bufferLength); - Stream postStream = httpReq.GetRequestStream(); - //发送请求头部消息 - postStream.Write(postHeaderBytes, 0, postHeaderBytes.Length); - while (size > 0) - { - postStream.Write(buffer, 0, size); - offset += size; - progressBar.Value = (int)(offset * (int.MaxValue / length)); - TimeSpan span = DateTime.Now - startTime; - double second = span.TotalSeconds; - //lblTime.Text = "已用时:" + second.ToString("F2") + "秒"; - //if (second > 0.001) - //{ - // lblSpeed.Text = " 平均速度:" + (offset / 1024 / second).ToString("0.00") + "KB/秒"; - //} - //else - //{ - // lblSpeed.Text = " 正在连接…"; - //} - //lblState.Text = "已上传:" + (offset * 100.0 / length).ToString("F2") + "%"; - //lblSize.Text = (offset / 1048576.0).ToString("F2") + "M/" + (fileLength / 1048576.0).ToString("F2") + "M"; - Application.DoEvents(); - size = r.Read(buffer, 0, bufferLength); - } - //添加尾部的时间戳 - postStream.Write(boundaryBytes, 0, boundaryBytes.Length); - postStream.Close(); - //获取服务器端的响应 - WebResponse webRespon = httpReq.GetResponse(); - Stream s = webRespon.GetResponseStream(); - StreamReader sr = new StreamReader(s); - //读取服务器端返回的消息 - String sReturnString = sr.ReadLine(); - s.Close(); - sr.Close(); - if (sReturnString == "Success") - { - returnValue = 1; - } - else if (sReturnString == "Error") - { - returnValue = 0; - } - } - catch(Exception ex) - { - returnValue = 0; - string str = ex.ToString(); - } - finally - { - fs.Close(); - r.Close(); - } - return returnValue; - } - private void btn_file_Click(object sender, EventArgs e) { OpenFileDialog dlg = new OpenFileDialog(); diff --git a/FrmExportCADS.cs b/FrmExportCADS.cs index 98772ea..59629dd 100644 --- a/FrmExportCADS.cs +++ b/FrmExportCADS.cs @@ -108,65 +108,6 @@ MessageBox.Show("请选中要导出的图层!", "提示", MessageBoxButtons.OK, MessageBoxIcon.Warning); } } - private Boolean MerageToFile(GSOFeatures features, String strDestFile, String strProj4)//图层追加 - { - if (features == null) - { - return false; - } - Boolean bSuccess = false; - - string strDir = GSOUtility.GetFileDir(strDestFile); - string strLPRJFile = GSOUtility.ChangeExt(strDestFile, ".lprj"); - string strExt = GSOUtility.GetFileExt(strDestFile); - - // 如果投影文件存在,投影以投影文件为准 - if (File.Exists(strLPRJFile)) - { - // 如果是dxf,则这样处理 - if (strExt.ToLower() == ".dxf") - { - string strTempSrcFile = strDir + "srcFeatures_dxftmp" + strExt; - globeControl1.Globe.DataManager.SaveFeatureData(features, strTempSrcFile, strLPRJFile, 4); - bSuccess = GSOUtility.MergeTwoDXFFileFeatures(strDestFile, strTempSrcFile); - File.Delete(strTempSrcFile); - } - else - { - GSOFeatures srcFeatures = globeControl1.Globe.DataManager.ReadFeatureData(strDestFile); - int nCount = features.Length; - int i = 0; - for (i = 0; i < nCount; i++) - { - srcFeatures.Add(features[i]); - } - bSuccess = globeControl1.Globe.DataManager.SaveFeatureData(srcFeatures, strDestFile, strLPRJFile, 4); - } - } - else - { - // 如果是dxf,则这样处理 - if (strExt.ToLower() == ".dxf") - { - string strTempSrcFile = strDir + "srcFeatures_dxftmp" + strExt; - globeControl1.Globe.DataManager.SaveFeatureData(features, strTempSrcFile, strProj4, 0); - bSuccess = GSOUtility.MergeTwoDXFFileFeatures(strDestFile, strTempSrcFile); - File.Delete(strTempSrcFile); - } - else - { - GSOFeatures srcFeatures = globeControl1.Globe.DataManager.ReadFeatureData(strDestFile); - int nCount = features.Length; - int i = 0; - for (i = 0; i < nCount; i++) - { - srcFeatures.Add(features[i]); - } - bSuccess = globeControl1.Globe.DataManager.SaveFeatureData(srcFeatures, strDestFile, strProj4, 0); - } - } - return bSuccess; - } /// /// 关闭按钮事件处理 /// diff --git a/FrmHDMAnalysis3.cs b/FrmHDMAnalysis3.cs index 4f73af6..2ada735 100644 --- a/FrmHDMAnalysis3.cs +++ b/FrmHDMAnalysis3.cs @@ -436,29 +436,6 @@ } layerTemp.RemoveAllFeature(); } - private void Export(GSOPoint3d _pnt, double r) - { - GSOPoint3ds pnts = new GSOPoint3ds(); - GSOPoint3d pnt = new GSOPoint3d(); - pnt.X = _pnt.X; - pnt.Y = _pnt.Y; - pnt.Z = _pnt.Z; - pnts.Add(pnt); - pnt.X = _pnt.X; - pnt.Y = _pnt.Y - 0.0000000005; - pnt.Z = _pnt.Z; - pnts.Add(pnt); - GSOGeoPolyline3D line = new GSOGeoPolyline3D(); - line.AddPart(pnts); - GSOGeoPolygon3D polygon = line.CreateBuffer(r * 2, true, 5, true, false); - GSOPoint3ds points = polygon[0]; - GSOGeoPolyline3D newLine = new GSOGeoPolyline3D(); - newLine.AddPart(points); - newLine.AltitudeMode = EnumAltitudeMode.RelativeToGround; - GSOFeature newFeature = new GSOFeature(); - newFeature.Geometry = newLine; - globeControl1.Globe.MemoryLayer.AddFeature(newFeature); - } private void ExportCAD(double a, double b, double r) { diff --git a/FrmHotFuncStat.cs b/FrmHotFuncStat.cs index c980f34..2eb1476 100644 --- a/FrmHotFuncStat.cs +++ b/FrmHotFuncStat.cs @@ -421,13 +421,6 @@ } } - private void HFS_Pderive_Click(object sender, EventArgs e) - { - if (TV_Files.SelectedNode != null) - { - HFSClass.GuideEdit_form("G", TV_Files, int.Parse(((ToolStripMenuItem)sender).Tag.ToString())); - } - } private void 导入ToolStripMenuItem_Click(object sender, EventArgs e) { @@ -530,22 +523,8 @@ } } - private void 导出ToolStripMenuItem1_Click(object sender, EventArgs e) - { - 导出ToolStripMenuItem2_Click(sender, e); - } + - private void TV_HFSSrchRslt_AfterCollapse(object sender, TreeViewEventArgs e) - { - e.Node.ImageIndex = 0; - } - - private void TV_HFSSrchRslt_AfterExpand(object sender, TreeViewEventArgs e) - { - HFSClass.ADD_TreeNode(TV_Files, e.Node); - e.Node.ImageIndex = 1; - } - private void 导出ToolStripMenuItem1_Click_1(object sender, EventArgs e) { if ((TV_HFSSrchRslt.SelectedNode != null) && (TV_HFSSrchRslt.SelectedNode.Parent != null)) diff --git a/FrmLayerControl.cs b/FrmLayerControl.cs index e7917c3..28fa14d 100644 --- a/FrmLayerControl.cs +++ b/FrmLayerControl.cs @@ -312,26 +312,7 @@ layerManagerNode.Expand(); terrainManagerNode.Expand(); } - /// - /// 刷新节点树 - /// - private void RefreshDataTree() - { - layerTree2.Nodes[0].Nodes.Clear(); - Int32 nCount = globeControl2.Globe.Layers.Count; - Int32 i = 0; - for (i = 0; i < nCount; i++) - { - GSODataset dataSpace = globeControl2.Globe.Layers[i].Dataset; - TreeNode node = new TreeNode(); - node.Text = dataSpace.Name; - node.ImageIndex = 0; - node.SelectedImageIndex = 0; - node.Checked = true; - node.Tag = dataSpace; - layerTree2.Nodes[0].Nodes.Add(node); - } - } + /// /// 目标图层按钮事件处理 /// @@ -494,22 +475,8 @@ } } } - /// - /// 改变指定节点的选中状态 - /// - /// - /// - private void CheckTreeNode(TreeNode node, Boolean bChecked) - { - CheckChildTreeNode(node, bChecked); - // 对于kml图层,如果当前处理的节点是true,那么要把所有的祖宗节点置为true - // 只有所有节点都未false,那么这个节点才为false - // CheckFatherTreeNode(node, bChecked); - globeControl1.Globe.Refresh(); - globeControl2.Globe.Refresh(); - - } + private void CheckChildTreeNode(TreeNode node, Boolean bChecked) { if (node == null) @@ -696,59 +663,7 @@ //} //CheckControl(e); } - /// - /// 树节点选中方法 - /// - /// - private void CheckControl(TreeViewEventArgs e) - { - if (e.Action != TreeViewAction.Unknown) - { - if (e.Node != null && !Convert.IsDBNull(e.Node)) - { - CheckParentNode(e.Node); - if (e.Node.Nodes.Count > 0) - { - CheckAllChildNodes(e.Node, e.Node.Checked); - } - } - } - } - /// - /// 改变所有子节点的状态 - /// - /// - /// - private void CheckAllChildNodes(TreeNode pn, bool IsChecked) - { - foreach (TreeNode tn in pn.Nodes) - { - tn.Checked = IsChecked; - if (tn.Tag.ToString().Contains("|")) - { - string nodeTag = tn.Tag.ToString().Split('|')[1]; - GSOLayer layer = globeControl1.Globe.Layers.GetLayerByCaption(nodeTag); - if (layer != null) - { - layer.Visible = IsChecked; - globeControl1.Globe.Refresh(); - } - } - if (tn.Tag is GSOFeature) - { - if (tn.Nodes.Count == 0) - { - GSOFeature feat = tn.Tag as GSOFeature; - feat.Visible = IsChecked; - globeControl1.Globe.Refresh(); - } - } - if (tn.Nodes.Count > 0) - { - CheckAllChildNodes(tn, IsChecked); - } - } - } + /// /// 改变父节点的选中状态,此处为所有子节点不选中时才取消父节点选中,可以根据需要修改 /// diff --git a/FrmLogin.cs b/FrmLogin.cs index 320fdd5..2afe46e 100644 --- a/FrmLogin.cs +++ b/FrmLogin.cs @@ -59,70 +59,6 @@ textBoxPassWord.Clear(); } } - - /// - /// 验证端口号 - /// - /// - private bool ValiPort() - { - Ping p = new Ping();//创建Ping对象p - PingReply pr = p.Send(Utility.localicenseserverip);//向指定IP或者主机名的计算机发送ICMP协议的ping数据包 - if (pr.Status == IPStatus.Success)//如果ping成功 - { - try - { - TcpClient tcpc = new TcpClient(Utility.localicenseserverip, Utility.localicenseserverport);//对IP地址为"192.168.0.105"的计算机的1500端口提出连接申请 - tcpc.Close(); - return true; - } - catch (Exception ex) - { - MessageBox.Show("端口连接错误!" + ex.Message); - return false; - } - } - else - { - int times = 0;//重新连接次数; - int count = 2;//设置尝试次数 - while (times < count) - { - //Thread.Sleep(1000);//等待时间(方便测试的话,你可以改为1000) - pr = p.Send(Utility.localicenseserverip); - - if (pr.Status == IPStatus.Success) - { - try - { - TcpClient tcpc = new TcpClient(Utility.localicenseserverip, Utility.localicenseserverport);//对IP地址为"192.168.0.105"的计算机的1500端口提出连接申请 - tcpc.Close(); - return true; - } - catch (Exception ex) - { - MessageBox.Show("端口连接错误!" + ex.Message); - return false; - } - } - else - { - times++; - if (times < count) - { - continue; - } - else - { - MessageBox.Show("重新尝试连接失败"); - return false; - } - } - - } - return false; - } - } /// /// 验证用户名、密码 /// diff --git a/FrmMetadata.cs b/FrmMetadata.cs index 886f65a..0365372 100644 --- a/FrmMetadata.cs +++ b/FrmMetadata.cs @@ -27,11 +27,7 @@ InitializeComponent(); loadTreeView(layerTree); } - private void FrmMetadata_Load(object sender, EventArgs e) - { - //this.ntLblC.Text = "nn"; - // loadTreeView(layerTree); - } + private void loadTreeView(TreeView tv)//构建图层树 { try diff --git a/FrmMetadataStat.cs b/FrmMetadataStat.cs index 790658a..e7696c6 100644 --- a/FrmMetadataStat.cs +++ b/FrmMetadataStat.cs @@ -197,9 +197,5 @@ } } - private void buttonX1_Click(object sender, EventArgs e) - { - drawChart(); - } } } diff --git a/FrmPatrolerManager.cs b/FrmPatrolerManager.cs index 37f8ffd..9e66aeb 100644 --- a/FrmPatrolerManager.cs +++ b/FrmPatrolerManager.cs @@ -109,82 +109,8 @@ this.winGridViewPager1.AllToExport = table; } - /// - /// 编辑 - /// - /// - /// - private void winGridViewPager1_OnEditSelected(object sender, EventArgs e) - { - - DataGridView grid = sender as DataGridView; - if (grid != null && grid.SelectedRows.Count>0) - { - DataGridViewRow row = grid.SelectedRows[0]; - try - { - long dbid = long.Parse(row.Cells["编号"].Value.ToString()); - String name = row.Cells["姓名"].Value.ToString(); - String sex = row.Cells["性别"].Value.ToString(); - String age = row.Cells["年龄"].Value.ToString(); - string phone = row.Cells["电话"].Value.ToString(); - age = String.IsNullOrEmpty(age.ToString().Trim()) ? "1" : age.ToString().Trim(); - FrmPatrolerEdit frm = new FrmPatrolerEdit(dbid.ToString(), name, age, sex, phone); - frm.reloadGrid += new ReloadPatrolerGrid(LoadData); - frm.ShowDialog(); - winGridViewPager1.Refresh(); - } - catch (Exception ex) - { - MessageBox.Show("编辑失败:" + ex.ToString(), "错误", MessageBoxButtons.OK, MessageBoxIcon.Error); - } - } - else - { - MessageBox.Show("没有选择记录", "提示"); - } - - } - - /// - /// 删除 - /// - /// - /// - private void winGridViewPager1_OnDeleteSelected(object sender, EventArgs e) - { - DataGridView grid = sender as DataGridView; - if (grid != null && grid.SelectedRows.Count > 0) - { - DataGridViewRow row = grid.SelectedRows[0]; - long dbid = long.Parse(row.Cells["编号"].Value.ToString()); - try - { - string state = row.Cells["状态"].Value.ToString(); - if ("在线".Equals(state)) - { - if (MessageBox.Show("确定注销?", "确认", MessageBoxButtons.YesNo, MessageBoxIcon.Question) == DialogResult.Yes) - { - String sql = "update patroler t set t.accountstate='LEAVER' where t.dbid=" + dbid; - OracleUtils.ExecuteNonQuery(OracleUtils.ConnectionString, CommandType.Text, sql); - } - } - else { - MessageBox.Show("人员不在线,无法注销", "信息"); - } - } - catch (Exception ex) - { - MessageBox.Show("人员注销失败:" + ex.ToString(), "错误", MessageBoxButtons.OK, MessageBoxIcon.Error); - } - } - else - { - MessageBox.Show("没有选择记录", "提示"); - } - } - - + + private void LoadData() { int pageIndex = winGridViewPager1.PagerInfo.CurrenetPageIndex; diff --git a/FrmRoadHDM.cs b/FrmRoadHDM.cs index e765313..e871dd5 100644 --- a/FrmRoadHDM.cs +++ b/FrmRoadHDM.cs @@ -333,31 +333,6 @@ this.Cursor = Cursors.Default; } } - - private void Export(GSOPoint3d _pnt, double r) - { - GSOPoint3ds pnts = new GSOPoint3ds(); - GSOPoint3d pnt = new GSOPoint3d(); - pnt.X = _pnt.X; - pnt.Y = _pnt.Y; - pnt.Z = _pnt.Z; - pnts.Add(pnt); - pnt.X = _pnt.X; - pnt.Y = _pnt.Y - 0.0000000005; - pnt.Z = _pnt.Z; - pnts.Add(pnt); - GSOGeoPolyline3D line = new GSOGeoPolyline3D(); - line.AddPart(pnts); - GSOGeoPolygon3D polygon = line.CreateBuffer(r * 2, true, 5, true, false); - GSOPoint3ds points = polygon[0]; - GSOGeoPolyline3D newLine = new GSOGeoPolyline3D(); - newLine.AddPart(points); - newLine.AltitudeMode = EnumAltitudeMode.RelativeToGround; - GSOFeature newFeature = new GSOFeature(); - newFeature.Geometry = newLine; - globeControl1.Globe.MemoryLayer.AddFeature(newFeature); - } - private void ExportCAD(double a, double b, double r) { GSOPoint3ds pnts = new GSOPoint3ds(); diff --git a/FrmUserAdd.cs b/FrmUserAdd.cs index c612ab4..f826427 100644 --- a/FrmUserAdd.cs +++ b/FrmUserAdd.cs @@ -231,24 +231,6 @@ //cbxRegion.SelectedIndexChanged += new EventHandler(cbxRegion_SelectedIndexChanged); } } - /// - /// 下拉框选中项改变事件处理 - /// - /// - /// - private void cbxRegion_SelectedIndexChanged(object sender, EventArgs e) - { - string sql = ""; - //string sql = "select casic_role.\"name\" from casic_role join casic_regionrole on casic_role.\"id\"=casic_regionrole.\"rid\" where casic_regionrole.\"reid\"=" + region[cbxRegion.SelectedItem.ToString().Trim()]; - DataTable dt = OledbHelper.QueryTable(sql); - if (dt != null && dt.Rows.Count > 0) - { - comboBoxExRegionRole.Items.Clear(); - for (int i = 0; i < dt.Rows.Count; i++) - { - comboBoxExRegionRole.Items.Add(dt.Rows[i][0].ToString().Trim());//部门角色 - } - } - } + } } diff --git a/FrmUserManager.cs b/FrmUserManager.cs index 571f0f0..ae254bc 100644 --- a/FrmUserManager.cs +++ b/FrmUserManager.cs @@ -81,11 +81,6 @@ } } } - //创建新用户 - private void buttonX2_Click(object sender, EventArgs e) - { - FrmUserAdd frm = new FrmUserAdd(-1); - frm.ShowDialog(); - } + } } diff --git a/FrmValveStatistics.cs b/FrmValveStatistics.cs index 545d56c..dd76777 100644 --- a/FrmValveStatistics.cs +++ b/FrmValveStatistics.cs @@ -54,7 +54,7 @@ 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") + if (chaFamenStatis.Series["阀门"].Points[m]!=null&&chaFamenStatis.Series["阀门"].Points[m].YValues[0].ToString() != "0") { chaFamenStatis.Series["阀门"].Points[m].Label = chaFamenStatis.Series[0].Points[m].YValues[0].ToString(); } diff --git a/Frm_password_reset.cs b/Frm_password_reset.cs index 7b51039..b9e5dc3 100644 --- a/Frm_password_reset.cs +++ b/Frm_password_reset.cs @@ -41,6 +41,7 @@ } catch (Exception ex) { + LogHelper.WriteLog(typeof(Frm_password_reset), ex.Message); } } private void initCombox() diff --git a/FrmpipeDeepstatis.cs b/FrmpipeDeepstatis.cs index e156db4..1a84d6c 100644 --- a/FrmpipeDeepstatis.cs +++ b/FrmpipeDeepstatis.cs @@ -307,7 +307,7 @@ chart1.Series[j].Points.DataBindXY(dic1.Keys, dic1.Values); for (int m = 0; m < dic1.Values.Count; m++) { - if (chart1.Series[j].Points[m].YValues[0].ToString() != "0") + if (chart1.Series[j].Points[m]!=null&&chart1.Series[j].Points[m].YValues[0].ToString() != "0") { chart1.Series[j].Points[m].Label = chart1.Series[j].Points[m].YValues[0].ToString(); diff --git a/FrmpipeDiametergather.cs b/FrmpipeDiametergather.cs index 30674de..057b09d 100644 --- a/FrmpipeDiametergather.cs +++ b/FrmpipeDiametergather.cs @@ -263,6 +263,7 @@ if (layer != null && layer is GSOFeatureLayer) { GSOFeatureLayer flayer = layer as GSOFeatureLayer; + if (layer == null) return; GSOFeatures features = flayer.GetAllFeatures(); if (features.Length > 0) { diff --git a/FrmpipeMaterialGather.cs b/FrmpipeMaterialGather.cs index c133ec3..398b884 100644 --- a/FrmpipeMaterialGather.cs +++ b/FrmpipeMaterialGather.cs @@ -280,6 +280,7 @@ if (layer != null && layer is GSOFeatureLayer) { GSOFeatureLayer flayer = layer as GSOFeatureLayer; + if (flayer == null) return; GSOFeatures features = flayer.GetAllFeatures(); if (features.Length > 0) { @@ -332,7 +333,7 @@ chart1.Series[j].Points.DataBindXY(dic1.Keys, dic1.Values); for (int m = 0; m < dic1.Values.Count; m++) { - if (chart1.Series[j].Points[m].YValues[0].ToString() != "0") + if (chart1.Series[j].Points[m]!=null&&chart1.Series[j].Points[m].YValues[0].ToString() != "0") { chart1.Series[j].Points[m].Label = chart1.Series[j].Points[m].YValues[0].ToString(); } diff --git a/Frmpipediameterstatis.cs b/Frmpipediameterstatis.cs index c0ed80a..50f8170 100644 --- a/Frmpipediameterstatis.cs +++ b/Frmpipediameterstatis.cs @@ -286,6 +286,7 @@ chart1.Series.Add(layerCaption); GSOFeatureLayer flayer = layer as GSOFeatureLayer; + if (layer == null) return; GSOFeatures features = flayer.GetAllFeatures(); if (features.Length > 0) { diff --git "a/GKT_Forms/F_GKT\346\225\260\346\215\256\350\276\223\345\205\245\350\276\223\345\207\272.cs" "b/GKT_Forms/F_GKT\346\225\260\346\215\256\350\276\223\345\205\245\350\276\223\345\207\272.cs" index c7bffd5..4db7d5d 100644 --- "a/GKT_Forms/F_GKT\346\225\260\346\215\256\350\276\223\345\205\245\350\276\223\345\207\272.cs" +++ "b/GKT_Forms/F_GKT\346\225\260\346\215\256\350\276\223\345\205\245\350\276\223\345\207\272.cs" @@ -198,12 +198,7 @@ } DialogResult = DialogResult.OK;//将当前窗体的对话框返回值设为OK } - private void treeView1_NodeMouseClick(object sender, TreeNodeMouseClickEventArgs e) - { - dir_Ok = comboBox_Disk.Text + e.Node.FullPath; - //dir = comboBox_Disk.Text + e.Node.FullPath; - e.Node.SelectedImageIndex = e.Node.ImageIndex; - } + string tempstr = ""; private void button1_Click(object sender, EventArgs e) { diff --git a/HFS_Forms/Frm_HFSprojedits.cs b/HFS_Forms/Frm_HFSprojedits.cs index 96dd76f..3c232a1 100644 --- a/HFS_Forms/Frm_HFSprojedits.cs +++ b/HFS_Forms/Frm_HFSprojedits.cs @@ -126,16 +126,6 @@ Close(); } - - - private void TB_ProjName_KeyPress(object sender, KeyPressEventArgs e) - { - if (HFSAClass.Files_NameChar(e) == 0) - e.Handled = true; - if (e.KeyChar == '\r') - OK_Click(sender, e); - } - private void Frm_HFSProjedit_Load(object sender, EventArgs e) { @@ -175,10 +165,6 @@ } } - private void Cancel_Click(object sender, EventArgs e) - { - this.Close(); - } private void Cancel_Click_1(object sender, EventArgs e) { diff --git a/MainFrm.cs b/MainFrm.cs index 2c305a0..ed2685b 100644 --- a/MainFrm.cs +++ b/MainFrm.cs @@ -617,7 +617,7 @@ } catch (Exception ex) { - + LogHelper.WriteLog(typeof(MainFrm), ex.Message); } } @@ -1768,7 +1768,7 @@ } catch (Exception ex) { - //LogError.PublishError(ex); + LogHelper.WriteLog(typeof(MainFrm), ex.Message); } } @@ -2026,6 +2026,7 @@ } catch (Exception ex) { + LogHelper.WriteLog(typeof(MainFrm), ex.Message); result = false; } finally @@ -2316,220 +2317,6 @@ string filename = Utility.filename; List g1layername = new List(); /// - /// 构建图层列表目录树 - /// - /// - private void loadTreeView(TreeView tv) - { - try - { - XmlDocument doc = new XmlDocument(); - doc.Load(filename); - XmlNodeList Params1 = doc.SelectNodes("/Params/layers"); - tv.ShowLines = false; - tv.CheckBoxes = true; - - foreach (XmlNode paramsNode in Params1) //layers - { - foreach (XmlNode layerNode in paramsNode) //layer - { - TreeNode nodelayer = new TreeNode(); - string layerName = layerNode.Attributes["label"].Value; - nodelayer.Text = layerName; - - if (layerNode.HasChildNodes != false) - { - tv.Nodes.Add(nodelayer); - foreach (XmlNode layerchildNode in layerNode) //layerchild - { - if (layerchildNode.Name == "layerchild") - { - TreeNode nodelayerchild = new TreeNode(); - string layerType = layerchildNode.Attributes["type"].Value; - string layerName1 = layerchildNode.Attributes["layer"].Value; - string layerchildName = layerchildNode.Attributes["label"].Value; - if (layerType == "locaserver") - { - if (layerchildNode.Attributes["isRoad"] != null) - { - roadLayerName = layerchildName; - } - dictionaryNetLayerNameAndCaption.Add(layerName1, layerchildName); - - nodelayerchild.Text = layerchildName; - nodelayerchild.Tag = layerType + "|" + layerchildName; - nodelayerchild.Checked = true; - nodelayer.Nodes.Add(nodelayerchild); - } - else - { - if (layerchildNode.Attributes["isPipeLine"] != null) - { - m_PipelineLayerNames.Add(layerchildName); - } - if (layerchildNode.Attributes["isWorkWell"] != null) - { - workwellLayerNames.Add(layerchildName); - } - if (layerchildNode.Attributes["isValve"] != null) - { - valueLayerNames.Add(layerchildName); - } - //if (layerchildNode.Attributes["isInstrument"] != null) - if (layerchildNode.Attributes["isAccess"] != null) - { - instrumenLayerNames.Add(layerchildName); - } - //if (layerchildNode.Attributes["isPipeFitting"] != null) - if (layerchildNode.Attributes["isCharacter"] != null) - { - pipefittingLayerNames.Add(layerchildName); - } - bool boollayer = AddLayers(layerName1, layerchildName); - nodelayerchild.Text = layerchildName; - nodelayerchild.Tag = layerType + "|" + layerchildName; - nodelayerchild.Checked = boollayer; - if (layerchildName.Contains("特征管点")) - { - nodelayerchild.Checked = false; - setLayerVisible(layerName1); - } - - nodelayer.Nodes.Add(nodelayerchild); - g1layername.Add(layerName1); - } - } - else if (layerchildNode.Name == "layertype") - { - TreeNode nodelayerchild = new TreeNode(); - string layerType = layerchildNode.Attributes["label"].Value; - nodelayerchild.Text = layerType; - nodelayerchild.Tag = layerType; - nodelayerchild.Checked = true; - nodelayer.Nodes.Add(nodelayerchild); - if (layerchildNode.HasChildNodes == true) - { - foreach (XmlNode childNodeLayer in layerchildNode) - { - if (childNodeLayer.HasChildNodes == true) - { - TreeNode nodelayerchild2 = new TreeNode(); - string layer = childNodeLayer.Attributes["label"].Value; - nodelayerchild2.Text = layer; - nodelayerchild2.Tag = layer; - nodelayerchild2.Checked = true; - nodelayerchild.Nodes.Add(nodelayerchild2); - foreach (XmlNode n in childNodeLayer) - { - TreeNode nodelayerchild1 = new TreeNode(); - string layerName1 = n.Attributes["layer"].Value; - string layerchildName = n.Attributes["label"].Value; - string layerType1 = n.Attributes["type"].Value; - if (n.Attributes["isPipeLine"] != null) - { - m_PipelineLayerNames.Add(layerchildName); - } - if (n.Attributes["isWorkWell"] != null) - { - workwellLayerNames.Add(layerchildName); - } - if (n.Attributes["isValve"] != null) - { - valueLayerNames.Add(layerchildName); - } - if (n.Attributes["isAccess"] != null) - //if (n.Attributes["isInstrument"] != null) - { - instrumenLayerNames.Add(layerchildName); - } - if (n.Attributes["isPipeFitting"] != null) - { - pipefittingLayerNames.Add(layerchildName); - } - bool boollayer = AddLayers(layerName1, layerchildName); - nodelayerchild1.Text = layerchildName; - nodelayerchild1.Tag = layerType1 + "|" + layerchildName; - nodelayerchild1.Checked = boollayer; - if (layerchildName.Contains("特征管点")) - { - nodelayerchild1.Checked = false; - setLayerVisible(layerName1); - } - - nodelayerchild2.Nodes.Add(nodelayerchild1); - - g1layername.Add(layerName1); - } - } - else - { - TreeNode nodelayerchild1 = new TreeNode(); - string layerName1 = childNodeLayer.Attributes["layer"].Value; - string layerchildName = childNodeLayer.Attributes["label"].Value; - string layerType1 = childNodeLayer.Attributes["type"].Value; - if (childNodeLayer.Attributes["isPipeLine"] != null) - { - m_PipelineLayerNames.Add(layerchildName); - } - if (childNodeLayer.Attributes["isWorkWell"] != null) - { - workwellLayerNames.Add(layerchildName); - } - if (childNodeLayer.Attributes["isValve"] != null) - { - valueLayerNames.Add(layerchildName); - } - if (childNodeLayer.Attributes["isAccess"] != null) - //if (childNodeLayer.Attributes["isInstrument"] != null) - { - instrumenLayerNames.Add(layerchildName); - } - if (childNodeLayer.Attributes["isPipeFitting"] != null) - { - pipefittingLayerNames.Add(layerchildName); - } - bool boollayer = AddLayers(layerName1, layerchildName); - nodelayerchild1.Text = layerchildName; - nodelayerchild1.Tag = layerType1 + "|" + layerchildName; - nodelayerchild1.Checked = boollayer; - if (layerchildName.Contains("特征管点")) - { - nodelayerchild1.Checked = false; - setLayerVisible(layerName1); - } - nodelayerchild.Nodes.Add(nodelayerchild1); - g1layername.Add(layerName1); - } - } - } - } - } - } - else - { - tv.Nodes.Add(nodelayer); - } - } - } - - foreach (TreeNode tn in tv.Nodes) - { - if (tn.Nodes.Count > 0) - { - foreach (TreeNode tnChild in tn.Nodes) - { - if (tnChild.Checked) - tn.Checked = true; - } - } - } - } - catch (Exception ex) - { - //LogError.PublishError(ex); - } - } - /// /// 获取目标图层 /// /// @@ -2629,21 +2416,11 @@ } catch (Exception ex) { - //LogError.PublishError(ex); + LogHelper.WriteLog(typeof(MainFrm), ex.Message); return false; } } /// - /// 菜单上的 三维导航 工具按钮 - /// - /// - /// - private void buttonItem86_Click(object sender, EventArgs e) - { - globeControl1.Globe.Action = EnumAction3D.ActionNull; - } - - /// /// 地上模式 菜单按钮 /// /// @@ -3026,67 +2803,11 @@ } Image printImage; - /// - /// 打印 菜单 - /// - /// - /// - private void buttonItem13_Click(object sender, EventArgs e) - { - Point pt1 = new Point(Convert.ToInt32(0), Convert.ToInt32(0)); - Point pt2 = new Point(Convert.ToInt32(panelEx5.Width), Convert.ToInt32(panelEx5.Height)); - int mapWidth = 0; - int mapHeight = 0; - Point pt = getUpperLeftPoint(pt1, pt2, out mapWidth, out mapHeight); - printImage = new Bitmap(Convert.ToInt32(panelEx5.Width), Convert.ToInt32(panelEx5.Height)); - Graphics g = Graphics.FromImage(printImage); - g.CopyFromScreen(pt, new Point(0, 0), new Size(Convert.ToInt32(panelEx5.Width), Convert.ToInt32(panelEx5.Height))); - - PrintDialog pd = new PrintDialog(); - try - { - if (pd.ShowDialog() == DialogResult.OK) //如果确认,将会覆盖所有的打印参数设置 - { - //打印预览 - PrintPreviewDialog ppd = new PrintPreviewDialog(); - ppd.Document = printDocument1; - if (DialogResult.OK == ppd.ShowDialog()) - { - printDocument1.Print(); //打印 - } - } - } - catch - { - printDocument1.PrintController.OnEndPrint(printDocument1, new System.Drawing.Printing.PrintEventArgs()); - } - } - + private void printDocument1_PrintPage(object sender, System.Drawing.Printing.PrintPageEventArgs e) { e.Graphics.DrawImage(printImage, 10, 10); } - - /// - /// 在窗体的底部状态栏上显示 综合管线条件查询结果 - /// - /// - /// - private void ToolStripText(string currentLayer, int dataCount) - { - if (dataCount != 0) - { - double featurelength = PipeLength(currentLayer, 0);// 统计管线的里程数 - - toolStripNumbers.Text = " 管线类型:" + currentLayer + " | 共有:" + Convert.ToString(dataCount - 1) + "条记录"; - toolStripFeatureLength.Text = " 管线里程:" + featurelength.ToString("0.00") + " 米"; - } - else - { - toolStripNumbers.Text = "管线类型: " + currentLayer + "| 共有:" + 0 + " 条记录 | "; - } - } - /// /// 统计管线的里程数 /// @@ -3402,26 +3123,6 @@ } /// - /// 绘制线 菜单 - /// - /// - /// - private void btnAddLine_Click(object sender, EventArgs e) - { - globeControl1.Globe.DestLayerFeatureAdd = globeControl1.Globe.MemoryLayer; - globeControl1.Globe.Action = EnumAction3D.DrawPolyline; - } - /// - /// 绘制面 菜单 - /// - /// - /// - private void btnAddPolygon_Click(object sender, EventArgs e) - { - globeControl1.Globe.DestLayerFeatureAdd = globeControl1.Globe.MemoryLayer; - globeControl1.Globe.Action = EnumAction3D.DrawPolygon; - } - /// /// 图层目录树 右键菜单中的 目标图层 菜单 /// /// @@ -3956,42 +3657,7 @@ // ClearUpDownTraceAnalysis(); //} - /// - /// 显示流向 功能 - /// - /// - /// - /// - private void Flow(object sender, string pipelineNameCN, bool bShow) - { - GSOFeatureLayer layer = globeControl1.Globe.Layers.GetLayerByCaption(pipelineNameCN) as GSOFeatureLayer; - GSOFeatures feats = layer.GetAllFeatures(); - for (int i = 0; i < feats.Length; i++) - { - GSOFeature feat = feats[i]; - GSOLineStyle3D lineStyle = feat.Geometry.Style as GSOLineStyle3D; - if (lineStyle != null) - { - if (lineStyle.ArrowStyle == null) - { - lineStyle.ArrowStyle = new GSOArrowStyle(); - lineStyle.ArrowStyle.BodyWidth = 2; - lineStyle.ArrowStyle.BodyLen = 6; - lineStyle.ArrowStyle.HeadWidth = 8; - lineStyle.ArrowStyle.HeadLen = 10; - lineStyle.ArrowStyle.OutlineVisible = true; - lineStyle.ArrowStyle.OutlineColor = Color.Red; - lineStyle.ArrowStyle.Speed = lineStyle.ArrowStyle.Speed / 2; - lineStyle.ArrowStyle.Play(); - } - lineStyle.ArrowVisible = bShow; - layerTree.SelectedNode = null; - } - } - globeControl1.Globe.Refresh(); - } - - + FrmCloseValves frm; /// /// 关阀分析 功能 @@ -4030,7 +3696,9 @@ curCAYNDataset.CloseValveAnalysis(lineFeature.ID, out arryResNodeID, out arryResValveID, false, true); } catch (Exception e) - { } + { + LogHelper.WriteLog(typeof(MainFrm), e.Message); + } string valveName = lineLayer.Caption; valveName = valveName.Substring(0, valveName.IndexOf("管线")); @@ -4106,7 +3774,7 @@ } catch (Exception e) { - + LogHelper.WriteLog(typeof(MainFrm), e.Message); } //目前只有燃气管线 有阀门 string valveName = lineLayer.Name; @@ -5457,7 +5125,7 @@ } catch (Exception ex) { - //MessageBox.Show(ex.ToString()); + LogHelper.WriteLog(typeof(MainFrm), ex.Message); } finally { @@ -5501,22 +5169,6 @@ } } - - /// - /// 清除所有坑 菜单 - /// - /// - /// - private void buttonItem3_Click(object sender, EventArgs e) - { - //日志记录 - LogManager.saveLog(Utility.userName, this.buttonItem3.Text); - - globeControl1.Globe.RemoveAllPits(); - } - - - ///// ///// 净距分析 菜单 ///// @@ -5554,42 +5206,8 @@ // ribbonBarTP.Visible = buttonItem34.Checked; // ribbonBarTP.Location = new Point(0, 0); //} - /// - /// 大气层 菜单 - /// - /// - /// - private void buttonItem17_Click_1(object sender, EventArgs e) - { - globeControl1.Globe.Atmosphere.Visible = !globeControl1.Globe.Atmosphere.Visible; - buttonItemSH1.Checked = globeControl1.Globe.Atmosphere.Visible; - globeControl1.Refresh(); - } - /// - /// 经纬网 菜单 - /// - /// - /// - private void buttonItem20_Click(object sender, EventArgs e) - { - globeControl1.Globe.LatLonGrid.Visible = !globeControl1.Globe.LatLonGrid.Visible; - buttonItemSH3.Checked = globeControl1.Globe.LatLonGrid.Visible; - globeControl1.Globe.Refresh(); - } - /// - /// 状态条 菜单 - /// - /// - /// - private void buttonItem21_Click_1(object sender, EventArgs e) - { - globeControl1.Globe.StatusBar.Visible = !globeControl1.Globe.StatusBar.Visible; - buttonItemSH4.Checked = globeControl1.Globe.StatusBar.Visible; - globeControl1.Globe.Refresh(); - } - - + /// /// 添加指定路径下的数据 功能 /// @@ -5680,43 +5298,7 @@ // } // return objRes; //} - /// - /// 刷新目录树 功能 - /// - private void RefreshDataTree() - { - layerTree.Nodes[0].Nodes.Clear(); - Int32 nCount = globeControl1.Globe.DataManager.DataSourceCount; - Int32 i = 0; - for (i = 0; i < nCount; i++) - { - GSODataSource dataSpace = globeControl1.Globe.DataManager[i]; - TreeNode node = new TreeNode(); - node.Text = dataSpace.Name; - node.ImageIndex = 0; - node.SelectedImageIndex = 0; - node.Checked = true; - node.Tag = dataSpace; - Int32 nDatasetCount = dataSpace.DatasetCount; - for (Int32 j = 0; j < nDatasetCount; j++) - { - GSODataset dataset = dataSpace[j]; - TreeNode subNode = new TreeNode(); - subNode.Text = dataset.Name; - subNode.ImageIndex = 0; - subNode.SelectedImageIndex = 0; - subNode.Checked = true; - subNode.Tag = dataset; - node.Nodes.Add(subNode); - } - layerTree.Nodes[0].Nodes.Add(node); - } - } - - - - - + /// /// 复合查询 菜单 @@ -5777,34 +5359,7 @@ return false; } - /// - /// 统计指定图层在指定范围内的所有feature对象 - /// - /// - /// - /// - private GSOFeatures Intersect_PointLayer(GSOGeoPolygon3D polygon, string pointLayerName) - { - GSOLayer layer = globeControl1.Globe.Layers.GetLayerByCaption(pointLayerName); - if (layer == null) - return null; - - GSOFeatureLayer flayer = layer as GSOFeatureLayer; - GSOFeatureDataset fdataset = flayer.Dataset as GSOFeatureDataset; - GSOFeatures feats; - if (polygon == null) - { - feats = flayer.GetAllFeatures(); - } - else - { - feats = flayer.FindFeaturesInPolygon(polygon, false); - } - - workWellLen.Add(pointLayerName, feats.Length); - return feats; - } - /// + /// /// 碰撞分析功能界面中 选择管线复选框 选中状态改变事件处理 /// /// @@ -5946,16 +5501,6 @@ MessageBox.Show("表格内容为空!", "提示"); } } - /// - /// 导出CAD 菜单 - /// - /// - /// - private void btnExportCAD_Click(object sender, EventArgs e) - { - FrmExportCADS frm = new FrmExportCADS(globeControl1, m_PipelineLayerNames); - frm.ShowDialog(); - } ///// ///// 区域分析 菜单 @@ -5987,16 +5532,6 @@ } } } - /// - /// 数据验证 菜单 - /// - /// - /// - private void buttonItem80_Click(object sender, EventArgs e) - { - FrmValiData frm = new FrmValiData(globeControl1); - frm.ShowDialog(); - } /// /// 根据指定图层创建图层节点并将节点添加到图层管理节点的子节点集合中 @@ -6018,56 +5553,7 @@ layerManagerNode.Expand(); } } - /// - /// 数据库备份 菜单 - /// - /// - /// - private void btnBackDatabase_Click(object sender, EventArgs e) - { - if (MessageBox.Show("是否确定要备份数据库文件", "信息", MessageBoxButtons.YesNo, MessageBoxIcon.Question) == DialogResult.Yes) - { - try - { - DateTime currentTime = DateTime.Now; - //string Dtime = currentTime.ToShortDateString().ToString("yyyy-MM-dd"); - string Dtime = currentTime.GetDateTimeFormats('D')[0].ToString(); - string Htime = DateTime.Now.ToString("HH时mm分ss秒").Trim(); - string fileName = Dtime + "(" + Htime + ")"; - string pathName = ""; - string sql = "select filename from master..sysdatabases where name='" + Utility.dbdatabase + "'"; - DataTable dt = OledbHelper.ExecuteDataTable(sql); - if (dt != null && dt.Rows.Count > 0) - { - pathName = dt.Rows[0][0].ToString().Trim(); - int count = pathName.LastIndexOf("\\") == -1 ? pathName.LastIndexOf("/") : pathName.LastIndexOf("\\"); - pathName = pathName.Substring(0, count); - } - pathName += "\\管网数据库" + fileName + ".bak"; - - OracleCommand cmdBK = new OracleCommand(); - cmdBK.CommandType = CommandType.Text; - cmdBK.Connection = connBackup; - cmdBK.CommandText = @"backup database " + Utility.dbdatabase + " to disk='" + pathName + "' with init"; - - connBackup.Open(); - cmdBK.ExecuteNonQuery(); - MessageBox.Show("数据库文件备份成功", "提示"); - } - catch (Exception ex) - { - MessageBox.Show(ex.ToString()); - } - finally - { - connBackup.Close(); - } - } - } - - - - + //GSOFeature emitterFeature; // 粒子要素 /// /// 添加火苗 功能 @@ -6598,361 +6084,15 @@ } } - - ///// - /// 添加用户仓库 菜单 - /// - /// - /// - private void buttonItem108_Click(object sender, EventArgs e) - { - FrmUserRepo frm = new FrmUserRepo(-1); - frm.ShowDialog(); - } - /// - /// 用户仓库管理 菜单 - /// - /// - /// - private void buttonItem111_Click(object sender, EventArgs e) - { - FrmUserRepoMgr frm = new FrmUserRepoMgr(); - frm.ShowDialog(); - } - /// - /// 添加分系统 菜单 - /// - /// - /// - private void buttonItem112_Click(object sender, EventArgs e) - { - //FrmAPP frm = new FrmAPP(-1); - //frm.ShowDialog(); - } - /// - /// 分系统管理 菜单 - /// - /// - /// - private void buttonItem113_Click(object sender, EventArgs e) - { - //FrmAPPMgr frm = new FrmAPPMgr(); - //frm.ShowDialog(); - } - /// - /// 添加操作 菜单 - /// - /// - /// - private void buttonItem114_Click(object sender, EventArgs e) - { - FrmOper frm = new FrmOper(-1); - frm.ShowDialog(); - } - /// - /// 操作管理 菜单 - /// - /// - /// - private void buttonItem115_Click(object sender, EventArgs e) - { - FrmOperMgr frm = new FrmOperMgr(); - frm.ShowDialog(); - } - /// - /// 添加资源 菜单 - /// - /// - /// - private void buttonItem116_Click(object sender, EventArgs e) - { - FrmRESC frm = new FrmRESC(-1); - frm.ShowDialog(); - } - /// - /// 资源管理 菜单 - /// - /// - /// - private void buttonItem117_Click(object sender, EventArgs e) - { - FrmRESCMgr frm = new FrmRESCMgr(); - frm.ShowDialog(); - } - /// - /// 添加权限 菜单 - /// - /// - /// - private void buttonItem118_Click(object sender, EventArgs e) - { - FrmPerm frm = new FrmPerm(-1); - frm.ShowDialog(); - } - /// - /// 权限管理 菜单 - /// - /// - /// - private void buttonItem119_Click(object sender, EventArgs e) - { - FrmPermMgr frm = new FrmPermMgr(); - frm.ShowDialog(); - } - /// - /// 添加访问控制 菜单 - /// - /// - /// - private void buttonItem120_Click(object sender, EventArgs e) - { - FrmAccess frm = new FrmAccess(-1); - frm.ShowDialog(); - } - /// - /// 访问控制管理 菜单 - /// - /// - /// - private void buttonItem121_Click(object sender, EventArgs e) - { - FrmAccessMgr frm = new FrmAccessMgr(); - frm.ShowDialog(); - } - /// - /// 部门类型管理 菜单 - /// - /// - /// - private void buttonItem122_Click(object sender, EventArgs e) - { - FrmRegionTypeMgr frm = new FrmRegionTypeMgr(); - frm.ShowDialog(); - } - /// - /// 用户信息管理 菜单 - /// - /// - /// - private void buttonItem128_Click_1(object sender, EventArgs e) - { - FrmUserManager frm = new FrmUserManager(); - frm.ShowDialog(); - } - /// - /// 添加角色 菜单 - /// - /// - /// - private void 添加角色_Click(object sender, EventArgs e) - { - FrmRole frm = new FrmRole(-1); - frm.ShowDialog(); - } - /// - /// 所有角色管理 菜单 - /// - /// - /// - private void 角色管理_Click(object sender, EventArgs e) - { - FrmRoleMgr frm = new FrmRoleMgr(); - frm.ShowDialog(); - } - - /// - /// 部门角色管理 菜单 - /// - /// - /// - private void buttonItem133_Click(object sender, EventArgs e) - { - FrmRegionRoleMgr frm = new FrmRegionRoleMgr(); - frm.ShowDialog(); - } - /// - /// 部门管理 菜单 - /// - /// - /// - private void buttonItem130_Click(object sender, EventArgs e) - { - FrmRegionMgr frm = new FrmRegionMgr(); - frm.ShowDialog(); - } - - /// - /// 日志管理 菜单 - /// - /// - /// - private void buttonItem135_Click(object sender, EventArgs e) - { - FrmLogManager frm = new FrmLogManager(); - frm.ShowDialog(); - } - /// - /// 传感器信息查询 菜单 - /// - /// - /// - private void buttonItem131_Click_1(object sender, EventArgs e) - { - GSOFeature selectedFeature = globeControl1.Globe.SelectedObject; - if (selectedFeature == null) - { - MessageBox.Show("请选择一个传感器对象!", "提示", MessageBoxButtons.OK, MessageBoxIcon.Information); - } - else - { - if (selectedFeature.Geometry != null && selectedFeature.Geometry.Type == EnumGeometryType.GeoModel) - { - GSOLayer layer = globeControl1.Globe.SelectedObjectLayer; - string tabelName = getTableName(layer.Caption); - string eqtID = selectedFeature.Description.Trim(); - if (tabelName != "" && eqtID != "") - { - string fields = getFields(tabelName); - if (fields != "") - { - string sql = "select " + fields + " from " + Utility.sensorDatabase + "." + tabelName + " where EqtID=" + eqtID + " order by RecordDate desc limit 1;"; - DataTable dt = MySqlHelper.queryDataTable(sql); - if (dt != null && dt.Rows.Count > 0) - { - FrmQueryMessage.ShowForm(this, dt, layer.Caption); - //queryMessage.Show(this); - } - else - { - MessageBox.Show("没有查询到相关信息!", "提示"); - } - } - else - { - MessageBox.Show("配置文件 \"sensorConfig.xml\" 有误!", "提示"); - } - } - else - { - MessageBox.Show("请选择一个传感器对象!", "提示"); - } - } - else - { - MessageBox.Show("请选择一个传感器对象!", "提示", MessageBoxButtons.OK, MessageBoxIcon.Information); - } - } - } - /// - /// 根据指定的图层的caption属性的值在配置文件中查找对应的数据库中的表的名称 - /// - /// 图层的caption属性的值 - /// 对应的数据库中的表的名称 - private string getTableName(string name) - { - string tabelName = ""; - if (Utility.sensorMarkerLayers != null) - { - for (int i = 0; i < Utility.sensorMarkerLayers.Count; i++) - { - MarkerLayer mLayer = Utility.sensorMarkerLayers[i]; - if (mLayer.layerName == name) - { - tabelName = mLayer.tableName; - break; - } - } - } - return tabelName; - } - /// - /// 根据数据库中的表的名称 查找对应的表中的字段名称的集合 - /// - /// 数据库中的表的名称 - /// 对应的表中的字段名称的集合 - private string getFields(string tabelName) - { - string fields = ""; - if (Utility.sensorMarkerLayers != null) - { - for (int i = 0; i < Utility.sensorMarkerLayers.Count; i++) - { - MarkerLayer mLayer = Utility.sensorMarkerLayers[i]; - if (mLayer.tableName.Trim() == tabelName.Trim()) - { - if (mLayer.fields != null) - { - foreach (string key in mLayer.fields.Keys) - { - string value = mLayer.fields[key]; - fields += tabelName.Trim() + "." + key + " as " + value + ","; - } - fields = fields.Remove(fields.Length - 1); - } - break; - } - } - } - return fields; - } - - /// - /// 历史曲线查询 菜单 - /// - /// - /// - private void buttonItem132_Click(object sender, EventArgs e) - { - GSOFeature selectedFeature = globeControl1.Globe.SelectedObject; - if (selectedFeature == null) - { - MessageBox.Show("请选择一个对象!", "提示", MessageBoxButtons.OK, MessageBoxIcon.Information); - } - else - { - if (selectedFeature.Geometry != null && selectedFeature.Geometry.Type == EnumGeometryType.GeoModel) - { - GSOLayer layer = globeControl1.Globe.SelectedObjectLayer; - string tabelName = getTableName(layer.Caption); - string eqtID = selectedFeature.Description; - if (tabelName != "" && eqtID != "") - { - FrmQueryHistory.ShowForm(this, tabelName, eqtID); - } - else - { - MessageBox.Show("请选择一个传感器对象!", "提示"); - } - } - else - { - MessageBox.Show("请选择一个传感器对象!", "提示", MessageBoxButtons.OK, MessageBoxIcon.Information); - } - } - } - + //定时检查传感器的状态 public System.Windows.Forms.Timer timerOfSensor = null; public int alarmValueLiuLiang = 0; public int alarmValueYaLi = 0; public int alarmValueYeTi = 0; public int alarmValueZaoSheng = 0; - /// - /// 传感器在线报警 菜单 - /// - /// - /// - private void buttonItem134_Click(object sender, EventArgs e) - { - if (timerOfSensor == null) - { - timerOfSensor = new System.Windows.Forms.Timer(); - timerOfSensor.Interval = 30000; - timerOfSensor.Tick += new EventHandler(timerOfSensor_Tick); - } - FrmQuerySensorAlarm.ShowForm(this); - } + /// /// 传感器报警 功能中的 定时器 的触发事件处理 /// @@ -7016,6 +6156,7 @@ } catch (Exception ex) { + LogHelper.WriteLog(typeof(MainFrm), ex.Message); continue; } } @@ -7025,145 +6166,7 @@ } } - - /// - /// 沿线运动 菜单 - /// - /// - /// - private void buttonItem138_Click(object sender, EventArgs e) - { - if (globeControl1.Globe.SelectedObject == null) - { - MessageBox.Show("请先选择一条线!", "提示", MessageBoxButtons.OK, MessageBoxIcon.Exclamation); - return; - } - - GSOFeature lineFeature = globeControl1.Globe.SelectedObject; - if (lineFeature.Geometry == null || lineFeature.Geometry.Type != EnumGeometryType.GeoPolyline3D) - { - MessageBox.Show("请先选择一条线!", "提示", MessageBoxButtons.OK, MessageBoxIcon.Exclamation); - return; - } - - OpenFileDialog dlg = new OpenFileDialog(); - dlg.Filter = "*.gcm;*.3ds|*.gcm;*.3ds|*.3ds|*.3ds|*.gcm|*.gcm"; - if (dlg.ShowDialog() == DialogResult.OK) - { - GSOGeoModel model = new GSOGeoModel(); - model.FilePath = dlg.FileName; - - GSOGeoDynamicRoute dynamicRoute = new GSOGeoDynamicRoute(); - dynamicRoute.ActorGeometry = model; - - GSORoute route = new GSORoute(); - GSOGeoPolyline3D geoline = (GSOGeoPolyline3D)lineFeature.Geometry; - for (int i = 0; i < geoline[0].Count; i++) - { - route.Add(geoline[0][i]); - } - route.CircleRoute = false; - route.Speed = 30; - route.RotateSpeed = 50; - route.AltitudeMode = geoline.AltitudeMode; - dynamicRoute.Route = route; - - GSOFeature feature = new GSOFeature(); - - dynamicRoute.Play(); - feature.Geometry = dynamicRoute; - - //GSOLabel gsoLabel = new GSOLabel(); - //gsoLabel.Text = "模型测试"; - //feature.Label = gsoLabel; - globeControl1.Globe.MinModelVisibleSize = 0; - - globeControl1.Globe.MemoryLayer.AddFeature(feature); - globeControl1.Globe.Refresh(); - } - } - /// - /// 回退 菜单 - /// - /// - /// - private void buttonItem99_Click(object sender, EventArgs e) - { - globeControl1.Globe.UnDoEdit(); - } - /// - /// 前进 菜单 - /// - /// - /// - private void buttonItem100_Click(object sender, EventArgs e) - { - globeControl1.Globe.ReDoEdit(); - } - /// - /// 水平净距 功能界面中的 标签内容改变事件处理 - /// - /// - /// - private void textBoxX4_TextChanged(object sender, EventArgs e) - { - string valueJingJu = textBoxX4.Text.Trim(); - if (valueJingJu != "") - { - double value = 0; - bool bl = double.TryParse(valueJingJu, out value); - if (bl) - { - labelX24.Text = "水平净距小于" + value.ToString() + "米的管线有:"; - } - } - } - /// - /// 垂直净距 功能界面中的 标签内容改变事件处理 - /// - /// - /// - private void textBoxX2_TextChanged(object sender, EventArgs e) - { - string valueJingJu = textBoxX2.Text.Trim(); - if (valueJingJu != "") - { - double value = 0; - bool bl = double.TryParse(valueJingJu, out value); - if (bl) - { - labelX23.Text = "垂直净距小于" + value.ToString() + "米的管线有:"; - } - } - } - /// - /// 覆土分析 功能界面中的 标签内容改变事件处理 - /// - /// - /// - private void textBoxX3_TextChanged(object sender, EventArgs e) - { - string valueJingJu = textBoxX3.Text.Trim(); - if (valueJingJu != "") - { - double value = 0; - bool bl = double.TryParse(valueJingJu, out value); - if (bl) - { - labelX17.Text = "覆土深度小于" + value.ToString() + "米的管线有:"; - } - } - } - - /// - /// 传感器分类查询 全区域 菜单 - /// - /// - /// - private void buttonItemSensor全区域查询_Click(object sender, EventArgs e) - { - FrmAccessoriesSensor.ShowForm(globeControl1, instrumenLayerNames, 0); - } + /// /// 传感器分类查询 绘制区域 菜单 /// @@ -7224,170 +6227,10 @@ layerTemp.RemoveAllFeature(); globeControl1.Refresh(); } - /// - /// 数字预处理 功能 - /// - /// - /// - private void 数字预处理buttonItem140_Click(object sender, EventArgs e) - { - FrmEditShapeFile frm = new FrmEditShapeFile(globeControl1); - frm.ShowDialog(this); - } - - - /// - /// 导出矢量 功能 将图层导出为kml和shp格式数据 - /// - /// - /// - private void 导出矢量buttonItem140_Click(object sender, EventArgs e) - { - /* - List m_PipelineLayerNames = new List();//线图层名称 - List workwellLayerNames = new List();//工井图层名称 - List valueLayerNames = new List();//阀门图层名称 - List instrumenLayerNames = new List();//附属物图层名称 - List pipefittingLayerNames = new List();//管件图层名称 - */ - List listVectorNames = new List(); - for (int i = 0; i < m_PipelineLayerNames.Count; i++) - { - if (m_PipelineLayerNames[i] == "移动" || m_PipelineLayerNames[i] == "联通" - || m_PipelineLayerNames[i] == "电信" || m_PipelineLayerNames[i] == "共通" - || m_PipelineLayerNames[i] == "有限电视" || m_PipelineLayerNames[i] == "交通信号" - || m_PipelineLayerNames[i] == "供电") - { - continue; - } - if (listVectorNames.Contains(m_PipelineLayerNames[i]) == false) - { - listVectorNames.Add(m_PipelineLayerNames[i]); - } - } - for (int i = 0; i < valueLayerNames.Count; i++) - { - if (listVectorNames.Contains(valueLayerNames[i]) == false) - { - listVectorNames.Add(valueLayerNames[i]); - } - } - for (int i = 0; i < workwellLayerNames.Count; i++) - { - if (listVectorNames.Contains(workwellLayerNames[i]) == false) - { - listVectorNames.Add(workwellLayerNames[i]); - } - } - for (int i = 0; i < instrumenLayerNames.Count; i++) - { - if (listVectorNames.Contains(instrumenLayerNames[i]) == false) - { - listVectorNames.Add(instrumenLayerNames[i]); - } - } - for (int i = 0; i < pipefittingLayerNames.Count; i++) - { - if (listVectorNames.Contains(pipefittingLayerNames[i]) == false) - { - listVectorNames.Add(pipefittingLayerNames[i]); - } - } - FrmExportVector frm = new FrmExportVector(globeControl1, listVectorNames); - frm.ShowDialog(); - } string citySevenLineType = ""; string cityServerLineName = ""; /// - /// 绘制城市七线 功能按钮 - /// - /// - /// - private void 绘制城市七线buttonItem140_Click(object sender, EventArgs e) - { - FrmCitySevenLineType frm = new FrmCitySevenLineType(); - if (frm.ShowDialog() == DialogResult.OK) - { - globeControl1.Globe.Action = EnumAction3D.DrawPolyline; - m_isDrawCitySevenLine = true; - m_isDrawTunnel = false; - m_AddPipeLine = false; - this.citySevenLineType = frm.citySevenLineType; - this.cityServerLineName = frm.citySevenLineName; - switch (frm.citySevenLineType) - { - case "城市红线": - GSOLayer layerRed = globeControl1.Globe.Layers.GetLayerByCaption(frm.citySevenLineType); - if (layerRed != null) - { - globeControl1.Globe.DestLayerFeatureAdd = layerRed; - layerRed.Editable = true; - } - break; - case "城市橙线": - GSOLayer layerOrange = globeControl1.Globe.Layers.GetLayerByCaption(frm.citySevenLineType); - if (layerOrange != null) - { - globeControl1.Globe.DestLayerFeatureAdd = layerOrange; - layerOrange.Editable = true; - } - break; - case "城市黄线": - GSOLayer layerYellow = globeControl1.Globe.Layers.GetLayerByCaption(frm.citySevenLineType); - if (layerYellow != null) - { - globeControl1.Globe.DestLayerFeatureAdd = layerYellow; - layerYellow.Editable = true; - } - break; - case "城市绿线": - GSOLayer layerGreen = globeControl1.Globe.Layers.GetLayerByCaption(frm.citySevenLineType); - if (layerGreen != null) - { - globeControl1.Globe.DestLayerFeatureAdd = layerGreen; - layerGreen.Editable = true; - } - break; - case "城市蓝线": - GSOLayer layerBlue = globeControl1.Globe.Layers.GetLayerByCaption(frm.citySevenLineType); - if (layerBlue != null) - { - globeControl1.Globe.DestLayerFeatureAdd = layerBlue; - layerBlue.Editable = true; - } - break; - case "城市紫线": - GSOLayer layerPurple = globeControl1.Globe.Layers.GetLayerByCaption(frm.citySevenLineType); - if (layerPurple != null) - { - globeControl1.Globe.DestLayerFeatureAdd = layerPurple; - layerPurple.Editable = true; - } - break; - case "城市黑线": - GSOLayer layerBlack = globeControl1.Globe.Layers.GetLayerByCaption(frm.citySevenLineType); - if (layerBlack != null) - { - globeControl1.Globe.DestLayerFeatureAdd = layerBlack; - layerBlack.Editable = true; - } - break; - } - } - } - /// - /// 七线审核 功能按钮 - /// - /// - /// - private void 七线审核buttonItem141_Click(object sender, EventArgs e) - { - FrmCityServerLineAnalysis frm = new FrmCityServerLineAnalysis(globeControl1, m_PipelineLayerNames); - frm.ShowDialog(this); - } - - /// /// 间距分析 开始分析按钮 分析绘制的七线和管线的距离是否符合标准 /// /// @@ -7666,25 +6509,6 @@ } } - - - /// - /// 管线自动缩进 菜单 - /// - /// - /// - private void 管线自动缩进buttonItem140_Click(object sender, EventArgs e) - { - FrmPipelineIndented frm = new FrmPipelineIndented(globeControl1, m_PipelineLayerNames, workwellLayerNames); - frm.ShowDialog(this); - } - - private void btnExportCADs_Click(object sender, EventArgs e) - { - - } - - /// /// 统计指定图层在指定范围内的所有feature对象 /// @@ -7755,8 +6579,6 @@ } - - //设置图层为隐藏 private void setLayerVisible(string layerName) { @@ -7765,27 +6587,7 @@ globeControl1.Globe.Refresh(); } - /// - /// 连接数据库 - /// - /// - /// - private void buttonItem129_Click(object sender, EventArgs e) - { - //保存日志 - LogManager.saveLog(Utility.userName, this.buttonItemSJGL4_1.Text); - - FrmDatabaseParaSetting2 frm = new FrmDatabaseParaSetting2(globeControl1); - if (frm.ShowDialog() == DialogResult.OK) - { - ds = FrmDatabaseParaSetting2.ds; - if (ds != null) - { - ds.IsCloseSaved = false; - } - } - } - + /// /// 清除渲染结果 /// @@ -7803,112 +6605,8 @@ layerTemp.RemoveAllFeature(); globeControl1.Refresh(); } - - /// - /// 绘制垂线 - /// - /// - /// - private void drawCLine(GSOPoint3d fpt, GSOPoint3d tpt) - { - GSOGeoPolyline3D pline = new GSOGeoPolyline3D(); - GSOPoint3ds pts = new GSOPoint3ds(); - pts.Add(fpt); - pts.Add(tpt); - pline.AddPart(pts); - - GSOGeoPoint3D fptg = new GSOGeoPoint3D(); - GSOGeoPoint3D tptg = new GSOGeoPoint3D(); - fptg.X = fpt.X; - fptg.Y = fpt.Y; - fptg.Z = 0; - tptg.X = tpt.X; - tptg.Y = tpt.Y; - tptg.Z = 0; - - GSOFeature gf = new GSOFeature(); - gf.Geometry = pline; - - globeControl1.Globe.MemoryLayer.AddFeature(gf); - - } - /// - /// 红线审核 - /// - /// - /// - private void buttonItem138_Click_2(object sender, EventArgs e) - { - - } - /// - /// 比较两个点是否是同一个点 - /// - /// - /// - /// - private bool comparePoint(GSOPoint3d pt1, GSOPoint3d pt2) - { - double x1 = 0; double y1 = 0; - double x2 = 0; double y2 = 0; - x1 = pt1.X; - y1 = pt1.Y; - x2 = pt2.X; - y2 = pt2.Y; - if ((x1 == x2) && (y1 == y2)) - { - return true; - } - return false; - } - /// - /// 获得点到线的垂线距离及垂点 - /// - /// - /// - /// - /// - private void comparePointLine(GSOPoint3d point, GSOGeoPolyline3D line, out double length, out GSOPoint3d pointChuiDian) - { - GSOPoint3d lineStartPoint = line[0][0]; - GSOPoint3d lineEndPoint = line[0][1]; - GSOGeoPolyline3D lineAB = new GSOGeoPolyline3D(); - GSOPoint3ds pointsAB = new GSOPoint3ds(); - pointsAB.Add(point); - pointsAB.Add(lineStartPoint); - lineAB.AddPart(pointsAB); - double lengthAB = lineAB.GetSpaceLength(false, 6378137.0); - double xieLvAB = getXieLu("", point.X, point.Y, lineStartPoint.X, lineStartPoint.Y); - double xieLvBC = getXieLu("", lineStartPoint.X, lineStartPoint.Y, lineEndPoint.X, lineEndPoint.Y); - - double tanABC = Math.Abs(xieLvAB - xieLvBC) / (1 + xieLvAB * xieLvBC); - double angle = Math.Atan(tanABC); - //if (angle > Math.PI / 2) //落在外边 - //{ - // length = 0; - //} - double lengthAD = lengthAB * Math.Sin(angle); - length = Math.Abs(lengthAD); - double lengthBD = lengthAB * Math.Cos(angle); - - GSOPoint2d point2dStart = Latlon_2_XYZ(lineStartPoint.X, lineStartPoint.Y); - double bBC = point2dStart.Y - xieLvBC * point2dStart.X; - GSOPoint2d point2dEnd = new GSOPoint2d(); - point2dEnd.X = point2dStart.X + 100; - point2dEnd.Y = point2dEnd.X * xieLvBC + bBC; - point2dEnd = XYZ_2_Latlon(point2dEnd.X, point2dEnd.Y); - - GSOPoint3d pointEnd = new GSOPoint3d(); - pointEnd.X = point2dEnd.X; - pointEnd.Y = point2dEnd.Y; - GSOGeoPolyline3D lineYanShen = new GSOGeoPolyline3D(); - GSOPoint3ds pointsYanShen = new GSOPoint3ds(); - pointsYanShen.Add(lineStartPoint); - pointsYanShen.Add(pointEnd); - lineYanShen.AddPart(pointsYanShen); - GSOGeoPolyline3D lineSegment = lineYanShen.GetSegment(0, lengthBD); - pointChuiDian = lineSegment[0][1]; - } + + /// /// 获得斜率 /// @@ -8044,255 +6742,6 @@ } /// - /// 获取与点相连的所有线以及线的点的集合 - /// - /// 选定的点所在的线 - /// 选定的点 - /// 面中不完全包含的除起点线之外所有的线 - /// 选定的点所在的点的集合 - /// 所有以选定线为起点的点的集合 - /// - private List getFeaturesPoints(GSOFeature featureSelect, GSOPoint3d lineStart, GSOFeatures selectFeatures, GSOPoint3ds ps, List listPS) - { - GSOFeatures fsStart = new GSOFeatures(); - for (int n = 0; n < selectFeatures.Length; n++) - { - if (featureSelect.ID == selectFeatures[n].ID) - { - continue; - } - GSOGeoPolyline3D newLine = selectFeatures[n].Geometry as GSOGeoPolyline3D; - if (newLine != null && newLine.PartCount > 0) - { - GSOPoint3d newLineStart = newLine[0][0]; - GSOPoint3d newLineEnd = newLine[0][newLine[0].Count - 1]; - if (lineStart.X == newLineEnd.X && lineStart.Y == newLineEnd.Y) - { - GSOPoint3ds psAdd = new GSOPoint3ds(); - for (int k = newLine[0].Count - 1; k >= 0; k--) - { - psAdd.Add(newLine[0][k]); - } - newLine[0] = psAdd; - fsStart.Add(selectFeatures[n]); - - } - else if (lineStart.X == newLineStart.X && lineStart.Y == newLineStart.Y) - { - fsStart.Add(selectFeatures[n]); - - } - } - } - if (fsStart.Length > 0) - { - for (int m = 0; m < fsStart.Length; m++) - { - GSOGeoPolyline3D lineFsStart = fsStart[m].Geometry as GSOGeoPolyline3D; - if (lineFsStart != null && lineFsStart.PartCount > 0) - { - GSOPoint3ds psAdd = ps.Clone(); - for (int k = 0; k < lineFsStart[0].Count; k++) - { - psAdd.Add(lineFsStart[0][k]); - } - listPS = getFeaturesPoints(fsStart[m], lineFsStart[0][lineFsStart[0].Count - 1], selectFeatures, psAdd, listPS); - } - } - } - else - { - listPS.Add(ps); - } - return listPS; - } - - /// - /// 获取切割面的线 - /// - /// 不完全包含在面中的所有线 - /// 完全包含在面中的所有线 - /// 线 - private GSOFeature getLineFromGSOFeatures(GSOFeatures features, GSOFeatures featuresTrue) - { - //1. 当线对象数组的长度为0时,返回空 - if (features.Length == 0) - { - return null; - } - //2. 当线对象数组的长度为1时,返回这条线 - if (features.Length == 1) - { - return features[0]; - } - //3. 当线对象数组的长度大于1时,计算所有线组成的最长线 - - //3.1 获取所有不完全包含在面中的对象selectFeatures - GSOFeatures selectFeatures = new GSOFeatures(); - for (int a = 0; a < features.Length; a++) - { - selectFeatures.Add(features[a].Clone()); - } - //3.2 删除features中完全包含在面中的线,获取和面的边界相交的线对象 - for (int a = 0; a < featuresTrue.Length; a++) - { - for (int b = 0; b < features.Length; b++) - { - if (featuresTrue[a].ID == features[b].ID) - { - features.Remove(b); - break; - } - } - } - //3.3 如果和面的边界相交的线的数量为0,返回空 - if (features.Length == 0) - { - return null; - } - //3.4 获取第一条和面的边界相交的线featureInOutPolygon - GSOFeature featureInOutPolygon = features[0]; - //3.5 从所有的线中删除featureInOutPolygon - for (int a = 0; a < selectFeatures.Length; a++) - { - if (selectFeatures[a].ID == featureInOutPolygon.ID) - { - selectFeatures.Remove(a); - break; - } - } - //listPS存储所有从featureInOutPolygon出发的点的集合 - List listPS = new List(); - //3.5 获取与featureInOutPolygon相连的线的集合 - GSOGeoPolyline3D line = featureInOutPolygon.Geometry as GSOGeoPolyline3D; - if (line != null && line.PartCount > 0) - { - GSOPoint3d lineStart = line[0][0]; - GSOPoint3d lineEnd = line[0][line[0].Count - 1]; - #region//获取和featureInOutPolygon的起点相连的线 - GSOFeatures fsStart = new GSOFeatures(); - for (int n = 0; n < selectFeatures.Length; n++) - { - GSOGeoPolyline3D newLine = selectFeatures[n].Geometry as GSOGeoPolyline3D; - if (newLine != null && newLine.PartCount > 0) - { - GSOPoint3d newLineStart = newLine[0][0]; - GSOPoint3d newLineEnd = newLine[0][newLine[0].Count - 1]; - if (lineStart.X == newLineEnd.X && lineStart.Y == newLineEnd.Y) - { - GSOPoint3ds psAdd = new GSOPoint3ds(); - for (int k = newLine[0].Count - 1; k >= 0; k--) - { - psAdd.Add(newLine[0][k]); - } - newLine[0] = psAdd; - fsStart.Add(selectFeatures[n]); - - } - else if (lineStart.X == newLineStart.X && lineStart.Y == newLineStart.Y) - { - fsStart.Add(selectFeatures[n]); - } - } - } - #endregion - - #region//获取和featureInOutPolygon的终点相连的线 - GSOFeatures fsEnd = new GSOFeatures(); - for (int n = 0; n < selectFeatures.Length; n++) - { - GSOGeoPolyline3D newLine = selectFeatures[n].Geometry as GSOGeoPolyline3D; - if (newLine != null && newLine.PartCount > 0) - { - GSOPoint3d newLineStart = newLine[0][0]; - GSOPoint3d newLineEnd = newLine[0][newLine[0].Count - 1]; - if (lineEnd.X == newLineStart.X && lineEnd.Y == newLineStart.Y) - { - fsEnd.Add(selectFeatures[n]); - - } - else if (lineEnd.X == newLineEnd.X && lineEnd.Y == newLineEnd.Y) - { - GSOPoint3ds psAdd = new GSOPoint3ds(); - for (int k = newLine[0].Count - 1; k >= 0; k--) - { - psAdd.Add(newLine[0][k]); - } - newLine[0] = psAdd; - fsEnd.Add(selectFeatures[n]); - - } - } - } - #endregion - - //3.6 将featureInOutPolygon的所有点和与之起点相连的线的所有点组成一个点的集合并添加到listPS中 - if (fsStart.Length > 0 && fsEnd.Length == 0) - { - for (int m = 0; m < fsStart.Length; m++) - { - GSOGeoPolyline3D lineFsStart = fsStart[m].Geometry as GSOGeoPolyline3D; - if (lineFsStart != null && lineFsStart.PartCount > 0) - { - GSOPoint3ds psAdd = new GSOPoint3ds(); - for (int k = line[0].Count - 1; k >= 0; k--) - { - psAdd.Add(line[0][k]); - } - for (int k = 0; k < lineFsStart[0].Count; k++) - { - psAdd.Add(lineFsStart[0][k]); - } - - listPS = getFeaturesPoints(fsStart[m], lineFsStart[0][lineFsStart[0].Count - 1], selectFeatures, psAdd, listPS); - - } - } - } - //3.6 将featureInOutPolygon的所有点和与之终点相连的线的所有点组成一个点的集合并添加到listPS中 - else if (fsStart.Length == 0 && fsEnd.Length > 0) - { - for (int n = 0; n < fsEnd.Length; n++) - { - GSOGeoPolyline3D lineFsEnd = fsEnd[n].Geometry as GSOGeoPolyline3D; - if (lineFsEnd != null && lineFsEnd.PartCount > 0) - { - GSOPoint3ds psAdd = new GSOPoint3ds(); - for (int k = 0; k < line[0].Count - 1; k++) - { - psAdd.Add(line[0][k]); - } - for (int k = 0; k < lineFsEnd[0].Count; k++) - { - psAdd.Add(lineFsEnd[0][k]); - } - //获取线fsEnd[n]的另一个端点相连的线并记录该线的点的集合 - listPS = getFeaturesPoints(fsEnd[n], lineFsEnd[0][lineFsEnd[0].Count - 1], selectFeatures, psAdd, listPS); - } - } - } - } - - //3.7 获取所有以featureInOutPolygon为起点的点的集合组成的线中的最长的线 - double maxLength = 0; - GSOFeature featureNew = new GSOFeature(); - for (int h = 0; h < listPS.Count; h++) - { - GSOGeoPolyline3D lineNew = new GSOGeoPolyline3D(); - lineNew.AddPart(listPS[h]); - GSOLabel label = new GSOLabel(); - label.Text = h.ToString(); - featureNew.Label = label; - double length = lineNew.GetSpaceLength(true, 6378137); - if (length > maxLength) - { - featureNew.Geometry = lineNew; - } - } - - return featureNew; - } - /// /// 更新最大最小状态 /// /// @@ -8340,219 +6789,6 @@ - private void buttonItem139_Click(object sender, EventArgs e) - { - - string filepath = ""; - //日志记录 - OpenFileDialog dlg = new OpenFileDialog(); - dlg.Filter = "矢量数据(*.shp)|*.shp|矢量数据(*.lgd)|*.lgd|全部支持格式(*.lgd,*.shp)|*.lgd;*.shp;"; - //dlg.Filter = "支持格式(*.lrp,*.tif,*.img,*.lrc,*.kml,*.lgd,*.shp,*.gft)|*.lrp;*.tif;*.img;*.lrc;*.kml;*.lgd;*.shp;*.gft|栅格数据(*.lrp)|*.lrp|栅格缓存(*.lrc)|*.lrc|KML数据(*.kml)|*.kml|矢量数据(*.lgd)|*.lgd|矢量缓存(*.gft)|*.gft|其它格式(*.*)|*.*||"; - dlg.Multiselect = true; - if (dlg.ShowDialog() == DialogResult.OK) - { - //自定义lprj文件名,从程序中复制一lprj文件。 - int bindex = dlg.FileName.Split('\\').Length; - string lastname = dlg.FileName.Split('\\')[bindex - 1]; - - for (int i = 0; i < dlg.FileNames.Length; i++) - { - string strDataPath = dlg.FileNames[i]; - filepath = strDataPath; - - GSOLayer layer = globeControl1.Globe.Layers.Add(strDataPath); - - } - - } - //放大到红线 - - - // globeControl1.Globe.Layers.MoveTo(0, globeControl1.Globe.Layers.Count - 1); - // globeControl1.Globe.Layers.MoveTo(0,4); - globeControl1.Refresh(); - - - } - /// - /// - /// - /// - /// - private void buttonItem142_Click(object sender, EventArgs e) - { - //获得红线polygon - //GSOLayer layerSevenLine = globeControl1.Globe.Layers.GetLayerByCaption(redlinelayername); - - GSOLayer layerSevenLine = globeControl1.Globe.Layers.Add("D:\\data\\歌林小镇shp\\test.shp"); - //获得红线结果列表 - ArrayList rrLists = new ArrayList(); - - //if (redlinelayername != "") - { - GSOFeatures fs = layerSevenLine.GetAllFeatures(); - int len = fs.Length; - - GSOGeoPolygon3D sevenPolygon = new GSOGeoPolygon3D(); - for (int k = 0; k < len; k++) - {//多根红线 - ///////生成红线区域/////// - GSOFeature featSevenLine = layerSevenLine.GetAt(k); - GSOGeoPolyline3D sevenLine = featSevenLine.Geometry as GSOGeoPolyline3D; - - List sevenParts = new List(); - for (int i = 0; i < sevenLine.PartCount; i++) - { - sevenParts.Add(sevenLine[i]); - } - for (int i = 0; i < sevenParts.Count; i++) - { - sevenPolygon.AddPart((GSOPoint3ds)sevenParts[i]); - } - /////拼出红线多边形over////// - - } - //GSOLayer layer = globeControl1.Globe.Layers.GetLayerByCaption("天然气管线"); - - GSOLayer layer = globeControl1.Globe.Layers.Add("C:\\Users\\nn-203\\Desktop\\xiaobai\\test.lgd"); - //线切割面定义,输出用 - GSOFeatures resFeats = new GSOFeatures(); - int resultstyle = 0; - //管线切割红线区域后,面积较小的区域 - GSOGeoPolygon3D restPoly = new GSOGeoPolygon3D(); - List inpts = new List(); - if (layer != null) - { - //红线区域 - GSOFeature sevenfeature = new GSOFeature(); - sevenfeature.Geometry = sevenPolygon; - - //获取不完全包含在面中的所有线 - GSOFeatures feats = layer.FindFeaturesInPolygon(sevenPolygon, false); - //获取完全包含在面中的所有线 - GSOFeatures featsTrue = layer.FindFeaturesInPolygon(sevenPolygon, true); - //获取面中所有对象组成的切割面的长线 - GSOFeature feature = new GSOFeature(); - - feature = getLineFromGSOFeatures(feats, featsTrue);//管线多个feature拼成一个feature - - //globeControl1.Globe.MemoryLayer.AddFeature(feature); - //globeControl1.Globe.MemoryLayer.AddFeature(sevenfeature); - if (feature != null) - { - //线切割面,输出 - //feature.HighLight = true; - GSODataEngineUtility.GSLineClipPolygon(feature, sevenfeature, out resFeats, out resultstyle); - } - else - { - MessageBox.Show("没有找到切割面的线对象!"); - } - ////////////////绘制分割后的多边形/////////////// - for (int a = 0; a < resFeats.Length; a++) - { - - GSOFeature gf = resFeats[1]; - globeControl1.Globe.MemoryLayer.AddFeature(gf); - - } - } - - - } - } - - private void buttonItem143_Click(object sender, EventArgs e) - { - //获得红线polygon - GSOLayer layerSevenLine = globeControl1.Globe.Layers.Add("d:\\lineAndPolygon.lgd"); - GSOLayer layerSevenLine2 = globeControl1.Globe.Layers.GetLayerByCaption("d:\\lineAndPolygon.lgd"); - //获得红线结果列表 - ArrayList rrLists = new ArrayList(); - - - // if (redlinelayername != "") - { - GSOFeatures fs = layerSevenLine.GetAllFeatures(); - int len = fs.Length; - - GSOGeoPolyline3D linetest = new GSOGeoPolyline3D(); - GSOGeoPolygon3D sevenPolygon = new GSOGeoPolygon3D(); - - GSOFeature linefeat = fs.FindByID(2); - //linefeat.Geometry = linetest; - GSOFeature polyfeat = fs.FindByID(1); - //polyfeat.Geometry = sevenPolygon; - - //线切割面定义,输出用 - GSOFeatures resFeats = new GSOFeatures(); - int resultstyle = 0; - GSODataEngineUtility.GSLineClipPolygon(linefeat, polyfeat, out resFeats, out resultstyle); - - ////////////////绘制分割后的多边形/////////////// - for (int a = 0; a < resFeats.Length; a++) - { - - GSOFeature gf = resFeats[0]; - globeControl1.Globe.MemoryLayer.AddFeature(gf); - - } - ////把红线切成一段段的线段,获得切前的红线点集 - List redpts = new List();//切前的红线点集合 - for (int i = 0; i < linetest.PartCount; i++) - { - GSOPoint3ds partP = linetest[i]; - for (int j = 0; j < partP.Count; j++) - { - redpts.Add(partP[j]); - } - } - - List redpts2 = new List();//切前的红线点集合 - for (int i = 0; i < sevenPolygon.PartCount; i++) - { - GSOPoint3ds partP = sevenPolygon[i]; - for (int j = 0; j < partP.Count; j++) - { - redpts2.Add(partP[j]); - } - } - } - } - /// - /// 增加用户手册下载连接 - /// - /// - /// - Cyberpipe.udfiles.UpDownFile UDF = new udfiles.UpDownFile(Utility.udserviceurl); - string dir_Ok = "C:\\Users\\nn-203\\Desktop"; - private void button1_Click(object sender, EventArgs e) - { - if (folderBrowserDialog1.ShowDialog() == DialogResult.OK) //打洙?开a文?件t夹D对?话°框ò - { - dir_Ok = folderBrowserDialog1.SelectedPath; //显?示?选?择?的?文?件t夹D路·径? - - //tempstr = folderBrowserDialog1.SelectedPath; //存?储洹?选?择?的?文?件t夹D路·径? - - } - - Cyberpipe.PED_logicfile.PED_Affair.Redact_D = Utility.uploadpath + "\\SFiles\\UserHbook\\说明.docx"; - if (File.Exists(dir_Ok + "\\" + Files_Name(Cyberpipe.PED_logicfile.PED_Affair.Redact_D, 1))) - { - if (MessageBox.Show("文件夹下有同名文件,是否替换?", "提示", MessageBoxButtons.YesNo, MessageBoxIcon.Information) == DialogResult.No) ; - - } - byte[] file = UDF.Down(Cyberpipe.PED_logicfile.PED_Affair.Redact_D); - FileStream pFileSream = new FileStream(dir_Ok + "\\说明.docx", FileMode.OpenOrCreate); - pFileSream.Write(file, 0, file.Length); - pFileSream.Close(); - if (File.Exists(dir_Ok + "\\" + Files_Name(Cyberpipe.PED_logicfile.PED_Affair.Redact_D, 1)) == true) - { - MessageBox.Show("文件导出成功!"); - } - //PEDAClass.Folder_Handle(dir_Ok + "\\" + PEDAClass.Files_Name(Cyberpipe.PED_logicfile.PED_Affair.Redact_D, 0), Cyberpipe.PED_logicfile.PED_Affair.Redact_D, "", 0); - - } /// /// 获取文件或文件夹的名称 /// @@ -8575,33 +6811,6 @@ return DF_Name; } - private void toolStripDropDownButton1_Click(object sender, EventArgs e) - { - if (folderBrowserDialog1.ShowDialog() == DialogResult.OK) //打洙?开a文?件t夹D对?话°框ò - { - dir_Ok = folderBrowserDialog1.SelectedPath; //显?示?选?择?的?文?件t夹D路·径? - - //tempstr = folderBrowserDialog1.SelectedPath; //存?储洹?选?择?的?文?件t夹D路·径? - - - Cyberpipe.PED_logicfile.PED_Affair.Redact_D = Utility.uploadpath + "\\SFiles\\UserHbook\\说明.docx"; - if (File.Exists(dir_Ok + "\\" + Files_Name(Cyberpipe.PED_logicfile.PED_Affair.Redact_D, 1))) - { - if (MessageBox.Show("文件夹下有同名文件,是否替换?", "提示", MessageBoxButtons.YesNo, MessageBoxIcon.Information) == DialogResult.No) ; - - } - byte[] file = UDF.Down(Cyberpipe.PED_logicfile.PED_Affair.Redact_D); - FileStream pFileSream = new FileStream(dir_Ok + "\\说明.docx", FileMode.OpenOrCreate); - pFileSream.Write(file, 0, file.Length); - pFileSream.Close(); - if (File.Exists(dir_Ok + "\\" + Files_Name(Cyberpipe.PED_logicfile.PED_Affair.Redact_D, 1)) == true) - { - MessageBox.Show("文件导出成功!"); - } - - } - } - /// /// 空间查询 /// @@ -9792,7 +8001,7 @@ GSOLayer resLayer = null; GSOFeature resFeature = null; globeControl1.Globe.GetSelectObject(0, out resFeature, out resLayer); - + if (resFeature == null) return; GSOGeoPolyline3D line1 = resFeature.Geometry as GSOGeoPolyline3D; if (line1 == null) { @@ -9876,7 +8085,7 @@ GSOLayer resLayer = null; GSOFeature resFeature = null; globeControl1.Globe.GetSelectObject(0, out resFeature, out resLayer); - + if (resFeature == null) return; GSOGeoPolyline3D line1 = resFeature.Geometry as GSOGeoPolyline3D; if (line1 == null) { @@ -9891,7 +8100,8 @@ } GSOFeatures feats = globeControl1.Globe.MemoryLayer.GetFeatureByName("粒子要素", true); - if (feats.Length > 0) + + if (feats!=null&&feats.Length > 0) globeControl1.Globe.MemoryLayer.RemoveFeatureByID(feats[0].ID); //if (emitterFeature != null) //{ @@ -11121,88 +9331,6 @@ } private int connectServerCount = 0; - - /// - /// 还原球到实测库 - /// - private void refreshGlobe1() - { - //添加实测库图层已有图层 - int servernum = 0; - //1.清除global1上 - for (int i = globeControl1.Globe.Layers.Count - 1; i >= 0; i--) - { - GSOLayer layer = globeControl1.Globe.Layers[i]; - if (!layer.Name.Contains("fttp:")) - { - layer.Dataset.Close();//清除内存 - globeControl1.Globe.Layers.Remove(layer); - } - else - { - servernum++; - } - } - - //globeControl1.Globe.ConnectServer(Utility.serverip, Utility.serverport, "", ""); //加载locaServer中的数据 - - //2.添加实测库图层 - string[] markerStrs = new string[9]; - markerStrs[0] = "标高标注"; - markerStrs[1] = "管径标注"; - markerStrs[2] = "埋深标注"; - markerStrs[3] = "坐标标注"; - markerStrs[4] = "坡度标注"; - markerStrs[5] = "属性标注"; - markerStrs[6] = "自定义标注"; - markerStrs[7] = "距离标注"; - markerStrs[8] = "扯旗标注"; - for (int i = 0; i < markerStrs.Length; i++) - { - if (File.Exists(Application.StartupPath + "\\标注管理\\" + markerStrs[i] + ".lgd")) - { - GSOLayer markerLayer = globeControl1.Globe.Layers.Add(Application.StartupPath + "\\标注管理\\" + markerStrs[i] + ".lgd"); - } - } - - for (int i = 0; i < g1layername.Count; i++) - { - string g1name = g1layername[i]; - GSODataset datasetg1 = Utility.dataSource.GetDatasetByName(g1name); - GSOLayer templayer = globeControl1.Globe.Layers.Add(datasetg1); - templayer.MaxVisibleAltitude = -1; - } - layerTemp = globeControl1.Globe.Layers.Add(Application.StartupPath + "\\tempLgdData.lgd"); - globeControl1.Globe.Layers.Add(Application.StartupPath + "/城市七线/城市红线.lgd"); - globeControl1.Globe.Layers.Add(Application.StartupPath + "/城市七线/城市橙线.lgd"); - globeControl1.Globe.Layers.Add(Application.StartupPath + "/城市七线/城市黄线.lgd"); - globeControl1.Globe.Layers.Add(Application.StartupPath + "/城市七线/城市绿线.lgd"); - globeControl1.Globe.Layers.Add(Application.StartupPath + "/城市七线/城市蓝线.lgd"); - globeControl1.Globe.Layers.Add(Application.StartupPath + "/城市七线/城市紫线.lgd"); - globeControl1.Globe.Layers.Add(Application.StartupPath + "/城市七线/城市黑线.lgd"); - globeControl1.Globe.Layers.Add(Application.StartupPath + "/隧道.lgd"); - - //移动server的数据图层 - for (int i = 0; i < servernum; i++) - { - globeControl1.Globe.Layers.MoveTo(globeControl1.Globe.Layers.Count - 1, 0); - } - - if (layerManagerNode.Nodes.Count > 0) - { - for (int i = layerManagerNode.Nodes.Count - 1; i >= 0; i--) - { - layerManagerNode.Nodes[i].Remove(); - - } - } - - - - globeControl1.Refresh(); - - } - /// /// 碰撞审查 /// @@ -11476,31 +9604,7 @@ // } //} #endregion - /// - /// 数据质量检查 - /// - /// - /// - private void buttonItemSJGL2_Click(object sender, EventArgs e) - { - //日志记录 - LogManager.saveLog(Utility.userName, this.buttonItemSJGL2.Text); - FrmValiData frm = new FrmValiData(globeControl1); - frm.ShowDialog(); - } - /// - /// 数据预处理 - /// - /// - /// - private void buttonItemSJGL3_Click(object sender, EventArgs e) - { - //保存日志 - LogManager.saveLog(Utility.userName, this.buttonItemSJGL3.Text); - FrmEditShapeFile frm = new FrmEditShapeFile(globeControl1); - frm.ShowDialog(this); - } /// /// 连接数据库 /// @@ -12251,60 +10355,6 @@ List lineStruct = new List(); GSOFeature featureSelected = null; - private void AddDatagridView(DataTable table) - { - - if (table != null && table.Rows.Count > 0) - { - dataGridViewX1.DataSource = table; - panelOfTable.Visible = true; - panelOfTable.Height = 200; - toolStripNumbers.Text = "红线审核结果"; - toolStripFeatureLength.Text = " 共有:" + table.Rows.Count + "条"; - } - else - { - - } - - } - - /// - /// 去除集合中重复的管线 - /// - /// - /// - /// - private GSOFeatures getFeaturesByFilter(GSOFeatures features, string fieldName) - { - if (features == null) - { - return null; - } - GSOFeatures featuresGet = new GSOFeatures(); - for (int i = 0; i < features.Length; i++) - { - GSOFeature featureFromFS = features[i]; - string fieldValueFromFS = featureFromFS.GetValue(fieldName).ToString().Trim(); - bool isHas = false; - for (int j = featuresGet.Length - 1; j >= 0; j--) - { - GSOFeature featureFromFSGet = featuresGet[j]; - string fieldValueFromFSGet = featureFromFSGet.GetValue(fieldName).ToString().Trim(); - if (fieldValueFromFS.Equals(fieldValueFromFSGet)) - { - isHas = true; - break; - } - } - if (isHas == false) - { - featuresGet.Add(featureFromFS.Clone()); - } - } - return featuresGet; - } - /// /// 数据管理导入文件 /// @@ -12440,138 +10490,7 @@ // //MessageBox.Show("系统运行错误:" + ex.ToString(), "错误", MessageBoxButtons.OK, MessageBoxIcon.Error); // } //} - - - /// - /// 标识器全区域统计 - /// - /// - /// - private void 标识器分类统计ToolStripMenuItem_Click(object sender, EventArgs e) - { - globeControl1.Globe.Action = EnumAction3D.ActionNull; - FrmBSQStatis bsqStatis = new FrmBSQStatis(); - bsqStatis.Show(this); - } - /// - /// 标识器绘制区域统计 - /// - /// - /// - private void 标识器分类统计ToolStripMenuItem1_Click(object sender, EventArgs e) - { - trackflag = "BSQDuoBianXiangStatis"; - globeControl1.Globe.Action = EnumAction3D.TrackPolygon; - } - - - #region 保存和加载审核库加载的图层 - private void saveLayerList(TreeNodeCollection treeNodeList) - { - string configPath = Application.StartupPath + "\\configLayerList.xml"; - try - { - XmlDocument doc = new XmlDocument(); - doc.Load(configPath); - XmlNode dbParams = doc.SelectSingleNode("Params/dbparams"); - XmlNode dbLayers = doc.SelectSingleNode("Params/dblayers"); - XmlNode layers = doc.SelectSingleNode("Params/layers"); - dbParams.RemoveAll(); - dbLayers.RemoveAll(); - layers.RemoveAll(); - - List listDS = new List(); - String shDatasourceName = Utility.sgdbip + "/" + Utility.sgdbname + "_" + Utility.sgdbuser; - bool flag = false; - - for (int i = 0; i < globeControl1.Globe.DataManager.DataSourceCount; i++) - { - GSODataSource ds = globeControl1.Globe.DataManager.GetDataSourceAt(i); - if (ds != null && ds.Type == EnumDataSourceType.SqlServer || ds.Type == EnumDataSourceType.Oracle) - { - if (ds.Name == shDatasourceName) - { - //防止因为多次连接同一个数据库 - if (flag == true) - { - break; - } - flag = true; - listDS.Add(ds); - GSODataSourceCnn conn = ds.GetConnectionInfo(); - - XmlElement dbparam = doc.CreateElement("shdbparam"); - XmlElement ip = doc.CreateElement("ship"); - ip.InnerText = conn.Server; - - XmlElement dbname = doc.CreateElement("shdbname"); - dbname.InnerText = conn.Database; - - XmlElement username = doc.CreateElement("shusername"); - username.InnerText = conn.User; - - XmlElement password = doc.CreateElement("shpassword"); - password.InnerText = conn.Password; - - XmlElement type = doc.CreateElement("shtype"); - if (ds.Type == EnumDataSourceType.SqlServer) - { - type.InnerText = "sqlserver"; - } - else - { - type.InnerText = "oracle"; - } - - dbparam.AppendChild(ip); - dbparam.AppendChild(dbname); - dbparam.AppendChild(username); - dbparam.AppendChild(password); - dbparam.AppendChild(type); - dbParams.AppendChild(dbparam); - } - - } - } - - for (int i = 0; i < treeNodeList.Count; i++) - { - GSOLayer layer = treeNodeList[i].Tag as GSOLayer; - if (Path.GetExtension(layer.Name) == "") - { - XmlElement dbLayer = doc.CreateElement("dblayer"); - XmlAttribute attri = doc.CreateAttribute("dbindex"); - for (int j = 0; j < listDS.Count; j++) - { - if (layer.Dataset.DataSource.Name == listDS[j].Name) - { - attri.Value = j.ToString(); - break; - } - } - dbLayer.Attributes.Append(attri); - dbLayer.InnerText = layer.Name; - - dbLayers.AppendChild(dbLayer); - } - else - { - XmlElement dbLayer = doc.CreateElement("layer"); - dbLayer.InnerText = layer.Name; - layers.AppendChild(dbLayer); - } - } - - doc.Save(configPath); - } - catch (Exception e) - { - - } - } - - #endregion - + private void buttonItem_TaskManager_Click(object sender, EventArgs e) { if (Form_TaksManager.IS_OPEN) diff --git a/MainFrm.designer.cs b/MainFrm.designer.cs index 233ef8c..97b8299 100644 --- a/MainFrm.designer.cs +++ b/MainFrm.designer.cs @@ -82,6 +82,7 @@ this.sideBar1 = new DevComponents.DotNetBar.SideBar(); this.panelEx3 = new DevComponents.DotNetBar.PanelEx(); this.layerSensorTree = new System.Windows.Forms.TreeView(); + this.layerTree = new Cyberpipe.MyTreeView(); this.sideBarPanelItem3 = new DevComponents.DotNetBar.SideBarPanelItem(); this.controlContainerItem3 = new DevComponents.DotNetBar.ControlContainerItem(); this.sideBarPanelItem4 = new DevComponents.DotNetBar.SideBarPanelItem(); @@ -365,30 +366,26 @@ this.可编辑ToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); this.保存ToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); this.ribbonControl1 = new DevComponents.DotNetBar.RibbonControl(); - this.ribbonPanel1 = new DevComponents.DotNetBar.RibbonPanel(); - this.ribbonBar21 = new DevComponents.DotNetBar.RibbonBar(); - this.buttonItem87 = new DevComponents.DotNetBar.ButtonItem(); - this.buttonItem88 = new DevComponents.DotNetBar.ButtonItem(); - this.buttonItem27 = new DevComponents.DotNetBar.ButtonItem(); - this.buttonItem91 = new DevComponents.DotNetBar.ButtonItem(); - this.buttonItem1 = new DevComponents.DotNetBar.ButtonItem(); - this.btnlegendSet = new DevComponents.DotNetBar.ButtonItem(); - this.buttonItem89 = new DevComponents.DotNetBar.ButtonItem(); - this.ribbonPanel7 = new DevComponents.DotNetBar.RibbonPanel(); - this.ribbonBar5 = new DevComponents.DotNetBar.RibbonBar(); - this.btn_flag = new DevComponents.DotNetBar.ButtonItem(); - this.slider4ground = new DevComponents.DotNetBar.SliderItem(); - this.ribbonPanel2 = new DevComponents.DotNetBar.RibbonPanel(); - this.ribbonBar4 = new DevComponents.DotNetBar.RibbonBar(); - this.buttonItem_TaskManager = new DevComponents.DotNetBar.ButtonItem(); - this.buttonItem_OnlineTask = new DevComponents.DotNetBar.ButtonItem(); - this.buttonItem_Event = new DevComponents.DotNetBar.ButtonItem(); this.ribbonPanel3 = new DevComponents.DotNetBar.RibbonPanel(); this.ribbonBar3 = new DevComponents.DotNetBar.RibbonBar(); this.btn_device = new DevComponents.DotNetBar.ButtonItem(); this.btn_Person = new DevComponents.DotNetBar.ButtonItem(); this.btn_constructMap = new DevComponents.DotNetBar.ButtonItem(); this.buttonItem9 = new DevComponents.DotNetBar.ButtonItem(); + this.ribbonPanel2 = new DevComponents.DotNetBar.RibbonPanel(); + this.ribbonBar4 = new DevComponents.DotNetBar.RibbonBar(); + this.buttonItem_TaskManager = new DevComponents.DotNetBar.ButtonItem(); + this.buttonItem_OnlineTask = new DevComponents.DotNetBar.ButtonItem(); + this.buttonItem_Event = new DevComponents.DotNetBar.ButtonItem(); + this.ribbonPanel1 = new DevComponents.DotNetBar.RibbonPanel(); + this.ribbonBar21 = new DevComponents.DotNetBar.RibbonBar(); + this.buttonItem87 = new DevComponents.DotNetBar.ButtonItem(); + this.buttonItem88 = new DevComponents.DotNetBar.ButtonItem(); + this.buttonItem27 = new DevComponents.DotNetBar.ButtonItem(); + this.buttonItem1 = new DevComponents.DotNetBar.ButtonItem(); + this.buttonItem91 = new DevComponents.DotNetBar.ButtonItem(); + this.btnlegendSet = new DevComponents.DotNetBar.ButtonItem(); + this.buttonItem89 = new DevComponents.DotNetBar.ButtonItem(); this.ribbonPanel8 = new DevComponents.DotNetBar.RibbonPanel(); this.ribbonBar_UserInfo = new DevComponents.DotNetBar.RibbonBar(); this.btn_user_info = new DevComponents.DotNetBar.ButtonItem(); @@ -398,6 +395,10 @@ this.btn_user_role = new DevComponents.DotNetBar.ButtonItem(); this.btn_password_edit = new DevComponents.DotNetBar.ButtonItem(); this.btn_reset_password = new DevComponents.DotNetBar.ButtonItem(); + this.ribbonPanel7 = new DevComponents.DotNetBar.RibbonPanel(); + this.ribbonBar5 = new DevComponents.DotNetBar.RibbonBar(); + this.btn_flag = new DevComponents.DotNetBar.ButtonItem(); + this.slider4ground = new DevComponents.DotNetBar.SliderItem(); this.ribbonPanel15 = new DevComponents.DotNetBar.RibbonPanel(); this.ribbonBar20 = new DevComponents.DotNetBar.RibbonBar(); this.buttonItemSJGL = new DevComponents.DotNetBar.ButtonItem(); @@ -610,7 +611,6 @@ this.buttonItem84 = new DevComponents.DotNetBar.ButtonItem(); this.buttonItem75 = new DevComponents.DotNetBar.ButtonItem(); this.buttonItem76 = new DevComponents.DotNetBar.ButtonItem(); - this.layerTree = new Cyberpipe.MyTreeView(); this.statusStrip1.SuspendLayout(); this.sideBar1.SuspendLayout(); this.panelEx3.SuspendLayout(); @@ -647,11 +647,11 @@ this.contextMenuStrip3.SuspendLayout(); this.contextMenuStripDeleteLayerNode.SuspendLayout(); this.ribbonControl1.SuspendLayout(); - this.ribbonPanel1.SuspendLayout(); - this.ribbonPanel7.SuspendLayout(); - this.ribbonPanel2.SuspendLayout(); this.ribbonPanel3.SuspendLayout(); + this.ribbonPanel2.SuspendLayout(); + this.ribbonPanel1.SuspendLayout(); this.ribbonPanel8.SuspendLayout(); + this.ribbonPanel7.SuspendLayout(); this.ribbonPanel15.SuspendLayout(); ((System.ComponentModel.ISupportInitialize)(this.pictureBox1)).BeginInit(); this.SuspendLayout(); @@ -813,7 +813,6 @@ this.toolStripDropDownButton1.Size = new System.Drawing.Size(45, 21); this.toolStripDropDownButton1.Text = "帮助"; this.toolStripDropDownButton1.Visible = false; - this.toolStripDropDownButton1.Click += new System.EventHandler(this.toolStripDropDownButton1_Click); // // controlContainerItem1 // @@ -1047,6 +1046,16 @@ this.layerSensorTree.AfterCheck += new System.Windows.Forms.TreeViewEventHandler(this.layerMarkerTree_AfterCheck); this.layerSensorTree.NodeMouseClick += new System.Windows.Forms.TreeNodeMouseClickEventHandler(this.layerMarkerTree_NodeMouseClick); // + // layerTree + // + this.layerTree.CheckBoxes = true; + this.layerTree.ItemHeight = 18; + this.layerTree.Location = new System.Drawing.Point(30, 78); + this.layerTree.Name = "layerTree"; + this.layerTree.Size = new System.Drawing.Size(121, 97); + this.layerTree.TabIndex = 1; + this.layerTree.AfterCheck += new System.Windows.Forms.TreeViewEventHandler(this.layerTree_AfterCheck); + // // sideBarPanelItem3 // this.sideBarPanelItem3.FontBold = true; @@ -2966,28 +2975,28 @@ // 平移对象ToolStripMenuItem // this.平移对象ToolStripMenuItem.Name = "平移对象ToolStripMenuItem"; - this.平移对象ToolStripMenuItem.Size = new System.Drawing.Size(152, 22); + this.平移对象ToolStripMenuItem.Size = new System.Drawing.Size(124, 22); this.平移对象ToolStripMenuItem.Text = "平移对象"; this.平移对象ToolStripMenuItem.Click += new System.EventHandler(this.buttonItemBJ6_Click); // // 升降对象ToolStripMenuItem // this.升降对象ToolStripMenuItem.Name = "升降对象ToolStripMenuItem"; - this.升降对象ToolStripMenuItem.Size = new System.Drawing.Size(152, 22); + this.升降对象ToolStripMenuItem.Size = new System.Drawing.Size(124, 22); this.升降对象ToolStripMenuItem.Text = "升降对象"; this.升降对象ToolStripMenuItem.Click += new System.EventHandler(this.buttonItemBJ7_Click); // // 旋转对象ToolStripMenuItem // this.旋转对象ToolStripMenuItem.Name = "旋转对象ToolStripMenuItem"; - this.旋转对象ToolStripMenuItem.Size = new System.Drawing.Size(152, 22); + this.旋转对象ToolStripMenuItem.Size = new System.Drawing.Size(124, 22); this.旋转对象ToolStripMenuItem.Text = "旋转对象"; this.旋转对象ToolStripMenuItem.Click += new System.EventHandler(this.buttonItemBJ8_Click); // // 连接管段ToolStripMenuItem // this.连接管段ToolStripMenuItem.Name = "连接管段ToolStripMenuItem"; - this.连接管段ToolStripMenuItem.Size = new System.Drawing.Size(152, 22); + this.连接管段ToolStripMenuItem.Size = new System.Drawing.Size(124, 22); this.连接管段ToolStripMenuItem.Text = "连接管段"; this.连接管段ToolStripMenuItem.Click += new System.EventHandler(this.buttonItemBJ9_Click); // @@ -2997,34 +3006,34 @@ this.导出CADToolStripMenuItem, this.导出文件ToolStripMenuItem1}); this.导出文件ToolStripMenuItem.Name = "导出文件ToolStripMenuItem"; - this.导出文件ToolStripMenuItem.Size = new System.Drawing.Size(152, 22); + this.导出文件ToolStripMenuItem.Size = new System.Drawing.Size(124, 22); this.导出文件ToolStripMenuItem.Text = "导出矢量"; // // 导出CADToolStripMenuItem // this.导出CADToolStripMenuItem.Name = "导出CADToolStripMenuItem"; - this.导出CADToolStripMenuItem.Size = new System.Drawing.Size(152, 22); + this.导出CADToolStripMenuItem.Size = new System.Drawing.Size(125, 22); this.导出CADToolStripMenuItem.Text = "导出CAD"; this.导出CADToolStripMenuItem.Click += new System.EventHandler(this.buttonItemBJ10_1_Click); // // 导出文件ToolStripMenuItem1 // this.导出文件ToolStripMenuItem1.Name = "导出文件ToolStripMenuItem1"; - this.导出文件ToolStripMenuItem1.Size = new System.Drawing.Size(152, 22); + this.导出文件ToolStripMenuItem1.Size = new System.Drawing.Size(125, 22); this.导出文件ToolStripMenuItem1.Text = "导出文件"; this.导出文件ToolStripMenuItem1.Click += new System.EventHandler(this.buttonItemBJ10_2_Click); // // 前进ToolStripMenuItem // this.前进ToolStripMenuItem.Name = "前进ToolStripMenuItem"; - this.前进ToolStripMenuItem.Size = new System.Drawing.Size(152, 22); + this.前进ToolStripMenuItem.Size = new System.Drawing.Size(124, 22); this.前进ToolStripMenuItem.Text = "前进"; this.前进ToolStripMenuItem.Click += new System.EventHandler(this.buttonItemBJ12_Click); // // 删除模型ToolStripMenuItem // this.删除模型ToolStripMenuItem.Name = "删除模型ToolStripMenuItem"; - this.删除模型ToolStripMenuItem.Size = new System.Drawing.Size(152, 22); + this.删除模型ToolStripMenuItem.Size = new System.Drawing.Size(124, 22); this.删除模型ToolStripMenuItem.Text = "后退"; this.删除模型ToolStripMenuItem.Click += new System.EventHandler(this.buttonItemBJ11_Click); // @@ -4160,6 +4169,198 @@ this.ribbonControl1.Text = "ribbonControl1"; this.ribbonControl1.UseCustomizeDialog = false; // + // ribbonPanel3 + // + this.ribbonPanel3.ColorSchemeStyle = DevComponents.DotNetBar.eDotNetBarStyle.StyleManagerControlled; + this.ribbonPanel3.Controls.Add(this.ribbonBar3); + this.ribbonPanel3.Dock = System.Windows.Forms.DockStyle.Fill; + this.ribbonPanel3.Location = new System.Drawing.Point(0, 33); + this.ribbonPanel3.Name = "ribbonPanel3"; + this.ribbonPanel3.Padding = new System.Windows.Forms.Padding(3, 0, 3, 3); + this.ribbonPanel3.Size = new System.Drawing.Size(1328, 62); + // + // + // + this.ribbonPanel3.Style.Class = ""; + this.ribbonPanel3.Style.CornerType = DevComponents.DotNetBar.eCornerType.Square; + // + // + // + this.ribbonPanel3.StyleMouseDown.Class = ""; + this.ribbonPanel3.StyleMouseDown.CornerType = DevComponents.DotNetBar.eCornerType.Square; + // + // + // + this.ribbonPanel3.StyleMouseOver.Class = ""; + this.ribbonPanel3.StyleMouseOver.CornerType = DevComponents.DotNetBar.eCornerType.Square; + this.ribbonPanel3.TabIndex = 40; + // + // ribbonBar3 + // + this.ribbonBar3.AutoOverflowEnabled = true; + // + // + // + this.ribbonBar3.BackgroundMouseOverStyle.Class = ""; + this.ribbonBar3.BackgroundMouseOverStyle.CornerType = DevComponents.DotNetBar.eCornerType.Square; + // + // + // + this.ribbonBar3.BackgroundStyle.Class = ""; + this.ribbonBar3.BackgroundStyle.CornerType = DevComponents.DotNetBar.eCornerType.Square; + this.ribbonBar3.ContainerControlProcessDialogKey = true; + this.ribbonBar3.Dock = System.Windows.Forms.DockStyle.Left; + this.ribbonBar3.Items.AddRange(new DevComponents.DotNetBar.BaseItem[] { + this.btn_device, + this.btn_Person, + this.btn_constructMap, + this.buttonItem9}); + this.ribbonBar3.Location = new System.Drawing.Point(3, 0); + this.ribbonBar3.Name = "ribbonBar3"; + this.ribbonBar3.Size = new System.Drawing.Size(378, 59); + this.ribbonBar3.Style = DevComponents.DotNetBar.eDotNetBarStyle.StyleManagerControlled; + this.ribbonBar3.TabIndex = 0; + // + // + // + this.ribbonBar3.TitleStyle.Class = ""; + this.ribbonBar3.TitleStyle.CornerType = DevComponents.DotNetBar.eCornerType.Square; + // + // + // + this.ribbonBar3.TitleStyleMouseOver.Class = ""; + this.ribbonBar3.TitleStyleMouseOver.CornerType = DevComponents.DotNetBar.eCornerType.Square; + this.ribbonBar3.TitleVisible = false; + // + // btn_device + // + this.btn_device.ButtonStyle = DevComponents.DotNetBar.eButtonStyle.ImageAndText; + this.btn_device.Image = global::Cyberpipe.Properties.Resources._24X24__2__02; + this.btn_device.ImagePosition = DevComponents.DotNetBar.eImagePosition.Top; + this.btn_device.Name = "btn_device"; + this.btn_device.SubItemsExpandWidth = 14; + this.btn_device.Text = "探测仪管理"; + this.btn_device.Click += new System.EventHandler(this.btn_device_Click); + // + // btn_Person + // + this.btn_Person.ButtonStyle = DevComponents.DotNetBar.eButtonStyle.ImageAndText; + this.btn_Person.Image = global::Cyberpipe.Properties.Resources._24x24icon_05_hover1; + this.btn_Person.ImagePosition = DevComponents.DotNetBar.eImagePosition.Top; + this.btn_Person.Name = "btn_Person"; + this.btn_Person.SubItemsExpandWidth = 14; + this.btn_Person.Text = "定位人员维护"; + this.btn_Person.Click += new System.EventHandler(this.btn_Person_Click); + // + // btn_constructMap + // + this.btn_constructMap.Image = global::Cyberpipe.Properties.Resources._24x24icon_04_hover; + this.btn_constructMap.ImagePosition = DevComponents.DotNetBar.eImagePosition.Top; + this.btn_constructMap.Name = "btn_constructMap"; + this.btn_constructMap.SubItemsExpandWidth = 14; + this.btn_constructMap.Text = "导出施工图"; + this.btn_constructMap.Click += new System.EventHandler(this.btn_constructMap_Click); + // + // buttonItem9 + // + this.buttonItem9.Image = global::Cyberpipe.Properties.Resources._24x24icon__2__10; + this.buttonItem9.ImagePosition = DevComponents.DotNetBar.eImagePosition.Top; + this.buttonItem9.Name = "buttonItem9"; + this.buttonItem9.SubItemsExpandWidth = 14; + this.buttonItem9.Text = "文档管理"; + this.buttonItem9.Click += new System.EventHandler(this.buttonItem9_Click); + // + // ribbonPanel2 + // + this.ribbonPanel2.ColorSchemeStyle = DevComponents.DotNetBar.eDotNetBarStyle.StyleManagerControlled; + this.ribbonPanel2.Controls.Add(this.ribbonBar4); + this.ribbonPanel2.Dock = System.Windows.Forms.DockStyle.Fill; + this.ribbonPanel2.Location = new System.Drawing.Point(0, 0); + this.ribbonPanel2.Name = "ribbonPanel2"; + this.ribbonPanel2.Padding = new System.Windows.Forms.Padding(3, 0, 3, 3); + this.ribbonPanel2.Size = new System.Drawing.Size(1328, 95); + // + // + // + this.ribbonPanel2.Style.Class = ""; + this.ribbonPanel2.Style.CornerType = DevComponents.DotNetBar.eCornerType.Square; + // + // + // + this.ribbonPanel2.StyleMouseDown.Class = ""; + this.ribbonPanel2.StyleMouseDown.CornerType = DevComponents.DotNetBar.eCornerType.Square; + // + // + // + this.ribbonPanel2.StyleMouseOver.Class = ""; + this.ribbonPanel2.StyleMouseOver.CornerType = DevComponents.DotNetBar.eCornerType.Square; + this.ribbonPanel2.TabIndex = 39; + this.ribbonPanel2.Visible = false; + // + // ribbonBar4 + // + this.ribbonBar4.AutoOverflowEnabled = true; + // + // + // + this.ribbonBar4.BackgroundMouseOverStyle.Class = ""; + this.ribbonBar4.BackgroundMouseOverStyle.CornerType = DevComponents.DotNetBar.eCornerType.Square; + // + // + // + this.ribbonBar4.BackgroundStyle.Class = ""; + this.ribbonBar4.BackgroundStyle.CornerType = DevComponents.DotNetBar.eCornerType.Square; + this.ribbonBar4.ContainerControlProcessDialogKey = true; + this.ribbonBar4.Dock = System.Windows.Forms.DockStyle.Left; + this.ribbonBar4.Items.AddRange(new DevComponents.DotNetBar.BaseItem[] { + this.buttonItem_TaskManager, + this.buttonItem_OnlineTask, + this.buttonItem_Event}); + this.ribbonBar4.Location = new System.Drawing.Point(3, 0); + this.ribbonBar4.Name = "ribbonBar4"; + this.ribbonBar4.Size = new System.Drawing.Size(299, 92); + this.ribbonBar4.Style = DevComponents.DotNetBar.eDotNetBarStyle.StyleManagerControlled; + this.ribbonBar4.TabIndex = 0; + this.ribbonBar4.Text = "ribbonBar4"; + // + // + // + this.ribbonBar4.TitleStyle.Class = ""; + this.ribbonBar4.TitleStyle.CornerType = DevComponents.DotNetBar.eCornerType.Square; + // + // + // + this.ribbonBar4.TitleStyleMouseOver.Class = ""; + this.ribbonBar4.TitleStyleMouseOver.CornerType = DevComponents.DotNetBar.eCornerType.Square; + this.ribbonBar4.TitleVisible = false; + // + // buttonItem_TaskManager + // + this.buttonItem_TaskManager.Image = global::Cyberpipe.Properties.Resources._24x24icon__2__76; + this.buttonItem_TaskManager.ImagePosition = DevComponents.DotNetBar.eImagePosition.Top; + this.buttonItem_TaskManager.Name = "buttonItem_TaskManager"; + this.buttonItem_TaskManager.SubItemsExpandWidth = 14; + this.buttonItem_TaskManager.Text = "工单管理"; + this.buttonItem_TaskManager.Click += new System.EventHandler(this.buttonItem_TaskManager_Click); + // + // buttonItem_OnlineTask + // + this.buttonItem_OnlineTask.Image = global::Cyberpipe.Properties.Resources._24x24icon__2__69; + this.buttonItem_OnlineTask.ImagePosition = DevComponents.DotNetBar.eImagePosition.Top; + this.buttonItem_OnlineTask.Name = "buttonItem_OnlineTask"; + this.buttonItem_OnlineTask.SubItemsExpandWidth = 14; + this.buttonItem_OnlineTask.Text = "在线任务"; + this.buttonItem_OnlineTask.Click += new System.EventHandler(this.buttonItem_OnlineTask_Click); + // + // buttonItem_Event + // + this.buttonItem_Event.Image = global::Cyberpipe.Properties.Resources._24x24icon__2__72; + this.buttonItem_Event.ImagePosition = DevComponents.DotNetBar.eImagePosition.Top; + this.buttonItem_Event.Name = "buttonItem_Event"; + this.buttonItem_Event.SubItemsExpandWidth = 14; + this.buttonItem_Event.Text = "事件管理"; + this.buttonItem_Event.Click += new System.EventHandler(this.buttonItem_Event_Click); + // // ribbonPanel1 // this.ribbonPanel1.AutoSize = true; @@ -4262,6 +4463,15 @@ this.buttonItem27.Visible = false; this.buttonItem27.Click += new System.EventHandler(this.buttonItem27_Click); // + // buttonItem1 + // + this.buttonItem1.Image = global::Cyberpipe.Properties.Resources._24x24icon__2__94; + this.buttonItem1.ImagePosition = DevComponents.DotNetBar.eImagePosition.Top; + this.buttonItem1.Name = "buttonItem1"; + this.buttonItem1.SubItemsExpandWidth = 14; + this.buttonItem1.Text = "图层管理"; + this.buttonItem1.Click += new System.EventHandler(this.buttonItem1_Click); + // // buttonItem91 // this.buttonItem91.ForeColor = System.Drawing.Color.Black; @@ -4272,15 +4482,6 @@ this.buttonItem91.Text = "快速定位"; this.buttonItem91.Click += new System.EventHandler(this.buttonItem91_Click); // - // buttonItem1 - // - this.buttonItem1.Image = global::Cyberpipe.Properties.Resources._24x24icon__2__94; - this.buttonItem1.ImagePosition = DevComponents.DotNetBar.eImagePosition.Top; - this.buttonItem1.Name = "buttonItem1"; - this.buttonItem1.SubItemsExpandWidth = 14; - this.buttonItem1.Text = "图层管理"; - this.buttonItem1.Click += new System.EventHandler(this.buttonItem1_Click); - // // btnlegendSet // this.btnlegendSet.Image = global::Cyberpipe.Properties.Resources._24x24icon__2__93; @@ -4300,278 +4501,6 @@ this.buttonItem89.Visible = false; this.buttonItem89.Click += new System.EventHandler(this.buttonItem89_Click); // - // ribbonPanel7 - // - this.ribbonPanel7.ColorSchemeStyle = DevComponents.DotNetBar.eDotNetBarStyle.StyleManagerControlled; - this.ribbonPanel7.Controls.Add(this.ribbonBar5); - this.ribbonPanel7.Dock = System.Windows.Forms.DockStyle.Fill; - this.ribbonPanel7.Location = new System.Drawing.Point(0, 0); - this.ribbonPanel7.Name = "ribbonPanel7"; - this.ribbonPanel7.Padding = new System.Windows.Forms.Padding(3, 0, 3, 3); - this.ribbonPanel7.Size = new System.Drawing.Size(1328, 95); - // - // - // - this.ribbonPanel7.Style.Class = ""; - this.ribbonPanel7.Style.CornerType = DevComponents.DotNetBar.eCornerType.Square; - // - // - // - this.ribbonPanel7.StyleMouseDown.Class = ""; - this.ribbonPanel7.StyleMouseDown.CornerType = DevComponents.DotNetBar.eCornerType.Square; - // - // - // - this.ribbonPanel7.StyleMouseOver.Class = ""; - this.ribbonPanel7.StyleMouseOver.CornerType = DevComponents.DotNetBar.eCornerType.Square; - this.ribbonPanel7.TabIndex = 41; - this.ribbonPanel7.Visible = false; - // - // ribbonBar5 - // - this.ribbonBar5.AutoOverflowEnabled = true; - // - // - // - this.ribbonBar5.BackgroundMouseOverStyle.Class = ""; - this.ribbonBar5.BackgroundMouseOverStyle.CornerType = DevComponents.DotNetBar.eCornerType.Square; - // - // - // - this.ribbonBar5.BackgroundStyle.Class = ""; - this.ribbonBar5.BackgroundStyle.CornerType = DevComponents.DotNetBar.eCornerType.Square; - this.ribbonBar5.ContainerControlProcessDialogKey = true; - this.ribbonBar5.Dock = System.Windows.Forms.DockStyle.Left; - this.ribbonBar5.Items.AddRange(new DevComponents.DotNetBar.BaseItem[] { - this.btn_flag, - this.slider4ground}); - this.ribbonBar5.Location = new System.Drawing.Point(3, 0); - this.ribbonBar5.Name = "ribbonBar5"; - this.ribbonBar5.Size = new System.Drawing.Size(418, 92); - this.ribbonBar5.Style = DevComponents.DotNetBar.eDotNetBarStyle.StyleManagerControlled; - this.ribbonBar5.TabIndex = 0; - // - // - // - this.ribbonBar5.TitleStyle.Class = ""; - this.ribbonBar5.TitleStyle.CornerType = DevComponents.DotNetBar.eCornerType.Square; - // - // - // - this.ribbonBar5.TitleStyleMouseOver.Class = ""; - this.ribbonBar5.TitleStyleMouseOver.CornerType = DevComponents.DotNetBar.eCornerType.Square; - this.ribbonBar5.TitleVisible = false; - this.ribbonBar5.ItemClick += new System.EventHandler(this.ribbonBar5_ItemClick); - // - // btn_flag - // - this.btn_flag.Image = global::Cyberpipe.Properties.Resources._24x24icon_03_hover; - this.btn_flag.ImagePosition = DevComponents.DotNetBar.eImagePosition.Top; - this.btn_flag.Name = "btn_flag"; - this.btn_flag.SubItemsExpandWidth = 14; - this.btn_flag.Text = "标识器管理"; - this.btn_flag.Click += new System.EventHandler(this.btn_flag_Click); - // - // slider4ground - // - this.slider4ground.LabelPosition = DevComponents.DotNetBar.eSliderLabelPosition.Top; - this.slider4ground.Name = "slider4ground"; - this.slider4ground.Text = "地面透明度"; - this.slider4ground.Value = 0; - this.slider4ground.ValueChanged += new System.EventHandler(this.slider4ground_ValueChanged); - // - // ribbonPanel2 - // - this.ribbonPanel2.ColorSchemeStyle = DevComponents.DotNetBar.eDotNetBarStyle.StyleManagerControlled; - this.ribbonPanel2.Controls.Add(this.ribbonBar4); - this.ribbonPanel2.Dock = System.Windows.Forms.DockStyle.Fill; - this.ribbonPanel2.Location = new System.Drawing.Point(0, 0); - this.ribbonPanel2.Name = "ribbonPanel2"; - this.ribbonPanel2.Padding = new System.Windows.Forms.Padding(3, 0, 3, 3); - this.ribbonPanel2.Size = new System.Drawing.Size(1328, 95); - // - // - // - this.ribbonPanel2.Style.Class = ""; - this.ribbonPanel2.Style.CornerType = DevComponents.DotNetBar.eCornerType.Square; - // - // - // - this.ribbonPanel2.StyleMouseDown.Class = ""; - this.ribbonPanel2.StyleMouseDown.CornerType = DevComponents.DotNetBar.eCornerType.Square; - // - // - // - this.ribbonPanel2.StyleMouseOver.Class = ""; - this.ribbonPanel2.StyleMouseOver.CornerType = DevComponents.DotNetBar.eCornerType.Square; - this.ribbonPanel2.TabIndex = 39; - this.ribbonPanel2.Visible = false; - // - // ribbonBar4 - // - this.ribbonBar4.AutoOverflowEnabled = true; - // - // - // - this.ribbonBar4.BackgroundMouseOverStyle.Class = ""; - this.ribbonBar4.BackgroundMouseOverStyle.CornerType = DevComponents.DotNetBar.eCornerType.Square; - // - // - // - this.ribbonBar4.BackgroundStyle.Class = ""; - this.ribbonBar4.BackgroundStyle.CornerType = DevComponents.DotNetBar.eCornerType.Square; - this.ribbonBar4.ContainerControlProcessDialogKey = true; - this.ribbonBar4.Dock = System.Windows.Forms.DockStyle.Left; - this.ribbonBar4.Items.AddRange(new DevComponents.DotNetBar.BaseItem[] { - this.buttonItem_TaskManager, - this.buttonItem_OnlineTask, - this.buttonItem_Event}); - this.ribbonBar4.Location = new System.Drawing.Point(3, 0); - this.ribbonBar4.Name = "ribbonBar4"; - this.ribbonBar4.Size = new System.Drawing.Size(299, 92); - this.ribbonBar4.Style = DevComponents.DotNetBar.eDotNetBarStyle.StyleManagerControlled; - this.ribbonBar4.TabIndex = 0; - this.ribbonBar4.Text = "ribbonBar4"; - // - // - // - this.ribbonBar4.TitleStyle.Class = ""; - this.ribbonBar4.TitleStyle.CornerType = DevComponents.DotNetBar.eCornerType.Square; - // - // - // - this.ribbonBar4.TitleStyleMouseOver.Class = ""; - this.ribbonBar4.TitleStyleMouseOver.CornerType = DevComponents.DotNetBar.eCornerType.Square; - this.ribbonBar4.TitleVisible = false; - // - // buttonItem_TaskManager - // - this.buttonItem_TaskManager.Image = global::Cyberpipe.Properties.Resources._24x24icon__2__76; - this.buttonItem_TaskManager.ImagePosition = DevComponents.DotNetBar.eImagePosition.Top; - this.buttonItem_TaskManager.Name = "buttonItem_TaskManager"; - this.buttonItem_TaskManager.SubItemsExpandWidth = 14; - this.buttonItem_TaskManager.Text = "工单管理"; - this.buttonItem_TaskManager.Click += new System.EventHandler(this.buttonItem_TaskManager_Click); - // - // buttonItem_OnlineTask - // - this.buttonItem_OnlineTask.Image = global::Cyberpipe.Properties.Resources._24x24icon__2__69; - this.buttonItem_OnlineTask.ImagePosition = DevComponents.DotNetBar.eImagePosition.Top; - this.buttonItem_OnlineTask.Name = "buttonItem_OnlineTask"; - this.buttonItem_OnlineTask.SubItemsExpandWidth = 14; - this.buttonItem_OnlineTask.Text = "在线任务"; - this.buttonItem_OnlineTask.Click += new System.EventHandler(this.buttonItem_OnlineTask_Click); - // - // buttonItem_Event - // - this.buttonItem_Event.Image = global::Cyberpipe.Properties.Resources._24x24icon__2__72; - this.buttonItem_Event.ImagePosition = DevComponents.DotNetBar.eImagePosition.Top; - this.buttonItem_Event.Name = "buttonItem_Event"; - this.buttonItem_Event.SubItemsExpandWidth = 14; - this.buttonItem_Event.Text = "事件管理"; - this.buttonItem_Event.Click += new System.EventHandler(this.buttonItem_Event_Click); - // - // ribbonPanel3 - // - this.ribbonPanel3.ColorSchemeStyle = DevComponents.DotNetBar.eDotNetBarStyle.StyleManagerControlled; - this.ribbonPanel3.Controls.Add(this.ribbonBar3); - this.ribbonPanel3.Dock = System.Windows.Forms.DockStyle.Fill; - this.ribbonPanel3.Location = new System.Drawing.Point(0, 33); - this.ribbonPanel3.Name = "ribbonPanel3"; - this.ribbonPanel3.Padding = new System.Windows.Forms.Padding(3, 0, 3, 3); - this.ribbonPanel3.Size = new System.Drawing.Size(1328, 62); - // - // - // - this.ribbonPanel3.Style.Class = ""; - this.ribbonPanel3.Style.CornerType = DevComponents.DotNetBar.eCornerType.Square; - // - // - // - this.ribbonPanel3.StyleMouseDown.Class = ""; - this.ribbonPanel3.StyleMouseDown.CornerType = DevComponents.DotNetBar.eCornerType.Square; - // - // - // - this.ribbonPanel3.StyleMouseOver.Class = ""; - this.ribbonPanel3.StyleMouseOver.CornerType = DevComponents.DotNetBar.eCornerType.Square; - this.ribbonPanel3.TabIndex = 40; - // - // ribbonBar3 - // - this.ribbonBar3.AutoOverflowEnabled = true; - // - // - // - this.ribbonBar3.BackgroundMouseOverStyle.Class = ""; - this.ribbonBar3.BackgroundMouseOverStyle.CornerType = DevComponents.DotNetBar.eCornerType.Square; - // - // - // - this.ribbonBar3.BackgroundStyle.Class = ""; - this.ribbonBar3.BackgroundStyle.CornerType = DevComponents.DotNetBar.eCornerType.Square; - this.ribbonBar3.ContainerControlProcessDialogKey = true; - this.ribbonBar3.Dock = System.Windows.Forms.DockStyle.Left; - this.ribbonBar3.Items.AddRange(new DevComponents.DotNetBar.BaseItem[] { - this.btn_device, - this.btn_Person, - this.btn_constructMap, - this.buttonItem9}); - this.ribbonBar3.Location = new System.Drawing.Point(3, 0); - this.ribbonBar3.Name = "ribbonBar3"; - this.ribbonBar3.Size = new System.Drawing.Size(378, 59); - this.ribbonBar3.Style = DevComponents.DotNetBar.eDotNetBarStyle.StyleManagerControlled; - this.ribbonBar3.TabIndex = 0; - // - // - // - this.ribbonBar3.TitleStyle.Class = ""; - this.ribbonBar3.TitleStyle.CornerType = DevComponents.DotNetBar.eCornerType.Square; - // - // - // - this.ribbonBar3.TitleStyleMouseOver.Class = ""; - this.ribbonBar3.TitleStyleMouseOver.CornerType = DevComponents.DotNetBar.eCornerType.Square; - this.ribbonBar3.TitleVisible = false; - // - // btn_device - // - this.btn_device.ButtonStyle = DevComponents.DotNetBar.eButtonStyle.ImageAndText; - this.btn_device.Image = global::Cyberpipe.Properties.Resources._24X24__2__02; - this.btn_device.ImagePosition = DevComponents.DotNetBar.eImagePosition.Top; - this.btn_device.Name = "btn_device"; - this.btn_device.SubItemsExpandWidth = 14; - this.btn_device.Text = "探测仪管理"; - this.btn_device.Click += new System.EventHandler(this.btn_device_Click); - // - // btn_Person - // - this.btn_Person.ButtonStyle = DevComponents.DotNetBar.eButtonStyle.ImageAndText; - this.btn_Person.Image = global::Cyberpipe.Properties.Resources._24x24icon_05_hover1; - this.btn_Person.ImagePosition = DevComponents.DotNetBar.eImagePosition.Top; - this.btn_Person.Name = "btn_Person"; - this.btn_Person.SubItemsExpandWidth = 14; - this.btn_Person.Text = "定位人员维护"; - this.btn_Person.Click += new System.EventHandler(this.btn_Person_Click); - // - // btn_constructMap - // - this.btn_constructMap.Image = global::Cyberpipe.Properties.Resources._24x24icon_04_hover; - this.btn_constructMap.ImagePosition = DevComponents.DotNetBar.eImagePosition.Top; - this.btn_constructMap.Name = "btn_constructMap"; - this.btn_constructMap.SubItemsExpandWidth = 14; - this.btn_constructMap.Text = "导出施工图"; - this.btn_constructMap.Click += new System.EventHandler(this.btn_constructMap_Click); - // - // buttonItem9 - // - this.buttonItem9.Image = global::Cyberpipe.Properties.Resources._24x24icon__2__10; - this.buttonItem9.ImagePosition = DevComponents.DotNetBar.eImagePosition.Top; - this.buttonItem9.Name = "buttonItem9"; - this.buttonItem9.SubItemsExpandWidth = 14; - this.buttonItem9.Text = "文档管理"; - this.buttonItem9.Click += new System.EventHandler(this.buttonItem9_Click); - // // ribbonPanel8 // this.ribbonPanel8.ColorSchemeStyle = DevComponents.DotNetBar.eDotNetBarStyle.StyleManagerControlled; @@ -4696,6 +4625,86 @@ this.btn_reset_password.Text = "重置密码"; this.btn_reset_password.Click += new System.EventHandler(this.btn_reset_password_Click); // + // ribbonPanel7 + // + this.ribbonPanel7.ColorSchemeStyle = DevComponents.DotNetBar.eDotNetBarStyle.StyleManagerControlled; + this.ribbonPanel7.Controls.Add(this.ribbonBar5); + this.ribbonPanel7.Dock = System.Windows.Forms.DockStyle.Fill; + this.ribbonPanel7.Location = new System.Drawing.Point(0, 0); + this.ribbonPanel7.Name = "ribbonPanel7"; + this.ribbonPanel7.Padding = new System.Windows.Forms.Padding(3, 0, 3, 3); + this.ribbonPanel7.Size = new System.Drawing.Size(1328, 95); + // + // + // + this.ribbonPanel7.Style.Class = ""; + this.ribbonPanel7.Style.CornerType = DevComponents.DotNetBar.eCornerType.Square; + // + // + // + this.ribbonPanel7.StyleMouseDown.Class = ""; + this.ribbonPanel7.StyleMouseDown.CornerType = DevComponents.DotNetBar.eCornerType.Square; + // + // + // + this.ribbonPanel7.StyleMouseOver.Class = ""; + this.ribbonPanel7.StyleMouseOver.CornerType = DevComponents.DotNetBar.eCornerType.Square; + this.ribbonPanel7.TabIndex = 41; + this.ribbonPanel7.Visible = false; + // + // ribbonBar5 + // + this.ribbonBar5.AutoOverflowEnabled = true; + // + // + // + this.ribbonBar5.BackgroundMouseOverStyle.Class = ""; + this.ribbonBar5.BackgroundMouseOverStyle.CornerType = DevComponents.DotNetBar.eCornerType.Square; + // + // + // + this.ribbonBar5.BackgroundStyle.Class = ""; + this.ribbonBar5.BackgroundStyle.CornerType = DevComponents.DotNetBar.eCornerType.Square; + this.ribbonBar5.ContainerControlProcessDialogKey = true; + this.ribbonBar5.Dock = System.Windows.Forms.DockStyle.Left; + this.ribbonBar5.Items.AddRange(new DevComponents.DotNetBar.BaseItem[] { + this.btn_flag, + this.slider4ground}); + this.ribbonBar5.Location = new System.Drawing.Point(3, 0); + this.ribbonBar5.Name = "ribbonBar5"; + this.ribbonBar5.Size = new System.Drawing.Size(418, 92); + this.ribbonBar5.Style = DevComponents.DotNetBar.eDotNetBarStyle.StyleManagerControlled; + this.ribbonBar5.TabIndex = 0; + // + // + // + this.ribbonBar5.TitleStyle.Class = ""; + this.ribbonBar5.TitleStyle.CornerType = DevComponents.DotNetBar.eCornerType.Square; + // + // + // + this.ribbonBar5.TitleStyleMouseOver.Class = ""; + this.ribbonBar5.TitleStyleMouseOver.CornerType = DevComponents.DotNetBar.eCornerType.Square; + this.ribbonBar5.TitleVisible = false; + this.ribbonBar5.ItemClick += new System.EventHandler(this.ribbonBar5_ItemClick); + // + // btn_flag + // + this.btn_flag.Image = global::Cyberpipe.Properties.Resources._24x24icon_03_hover; + this.btn_flag.ImagePosition = DevComponents.DotNetBar.eImagePosition.Top; + this.btn_flag.Name = "btn_flag"; + this.btn_flag.SubItemsExpandWidth = 14; + this.btn_flag.Text = "标识器管理"; + this.btn_flag.Click += new System.EventHandler(this.btn_flag_Click); + // + // slider4ground + // + this.slider4ground.LabelPosition = DevComponents.DotNetBar.eSliderLabelPosition.Top; + this.slider4ground.Name = "slider4ground"; + this.slider4ground.Text = "地面透明度"; + this.slider4ground.Value = 0; + this.slider4ground.ValueChanged += new System.EventHandler(this.slider4ground_ValueChanged); + // // ribbonPanel15 // this.ribbonPanel15.ColorSchemeStyle = DevComponents.DotNetBar.eDotNetBarStyle.StyleManagerControlled; @@ -6393,16 +6402,6 @@ this.buttonItem76.SubItemsExpandWidth = 14; this.buttonItem76.Text = "坐标标注"; // - // layerTree - // - this.layerTree.CheckBoxes = true; - this.layerTree.ItemHeight = 18; - this.layerTree.Location = new System.Drawing.Point(30, 78); - this.layerTree.Name = "layerTree"; - this.layerTree.Size = new System.Drawing.Size(121, 97); - this.layerTree.TabIndex = 1; - this.layerTree.AfterCheck += new System.Windows.Forms.TreeViewEventHandler(this.layerTree_AfterCheck); - // // MainFrm // this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Inherit; @@ -6475,11 +6474,11 @@ this.contextMenuStripDeleteLayerNode.ResumeLayout(false); this.ribbonControl1.ResumeLayout(false); this.ribbonControl1.PerformLayout(); - this.ribbonPanel1.ResumeLayout(false); - this.ribbonPanel7.ResumeLayout(false); - this.ribbonPanel2.ResumeLayout(false); this.ribbonPanel3.ResumeLayout(false); + this.ribbonPanel2.ResumeLayout(false); + this.ribbonPanel1.ResumeLayout(false); this.ribbonPanel8.ResumeLayout(false); + this.ribbonPanel7.ResumeLayout(false); this.ribbonPanel15.ResumeLayout(false); ((System.ComponentModel.ISupportInitialize)(this.pictureBox1)).EndInit(); this.ResumeLayout(false); diff --git a/Cyberpipe.csproj b/Cyberpipe.csproj index 07a8c1a..e3cd12c 100644 --- a/Cyberpipe.csproj +++ b/Cyberpipe.csproj @@ -204,25 +204,6 @@ - - Form - - - F_GKT1数据输入输出.cs - - - Form - - - F_GKT1添加文件.cs - - - Form - - - F_GKT1添加项目.cs - - Form @@ -1068,18 +1049,6 @@ Frm_password_reset.cs - - Form - - - GKT.cs - - - Form - - - GKT1.cs - Form @@ -1258,12 +1227,6 @@ F_Projedit.cs - - Form - - - PED.cs - Form @@ -1331,16 +1294,6 @@ True Reference.map - - F_GKT1数据输入输出.cs - Designer - - - F_GKT1添加文件.cs - - - F_GKT1添加项目.cs - Form_EditTask.cs @@ -1836,12 +1789,6 @@ Frm_password_reset.cs - - GKT.cs - - - GKT1.cs - F_GKT数据输入输出.cs @@ -1934,9 +1881,6 @@ F_Projedit.cs - - PED.cs - F_数据输入输出.cs diff --git a/Cyberpipe.suo b/Cyberpipe.suo index 68ced4f..a1aecf8 100644 --- a/Cyberpipe.suo +++ b/Cyberpipe.suo Binary files differ diff --git a/EMS_Forms/Form_EditTask.cs b/EMS_Forms/Form_EditTask.cs index 718992f..f1d791f 100644 --- a/EMS_Forms/Form_EditTask.cs +++ b/EMS_Forms/Form_EditTask.cs @@ -119,7 +119,8 @@ String name = Convert.ToString(dr["USERNAME"]); comboBox_userName.Items.Add(name); - } + } + dr.Close(); comboBox_road.Items.Clear(); roadList = new List(); @@ -135,7 +136,7 @@ comboBox_road.Items.Add(name); } } - + dr1.Close(); conn.Close(); bool flag2 = false; @@ -185,7 +186,7 @@ catch (Exception ex) { - MessageBox.Show(ex.ToString()); + LogHelper.WriteLog(typeof(Form_EditTask), ex.Message); } } @@ -288,7 +289,7 @@ } catch (Exception ex) { - MessageBox.Show(ex.ToString()); + LogHelper.WriteLog(typeof(Form_EditTask), ex.Message); } } @@ -474,7 +475,7 @@ } catch (Exception ex) { - MessageBox.Show(ex.ToString()); + LogHelper.WriteLog(typeof(Form_EditTask), ex.Message); } this.Close(); @@ -495,6 +496,7 @@ { numList.Add(Convert.ToInt32(dr["DBID"])); } + dr.Close(); if (numList.Count == 0) { taskNumber = Convert.ToInt32(number) * 100; @@ -674,6 +676,7 @@ } } } + dr.Close(); conn.Close(); } diff --git a/EMS_Forms/Form_EventManager.cs b/EMS_Forms/Form_EventManager.cs index b18c45b..84807b2 100644 --- a/EMS_Forms/Form_EventManager.cs +++ b/EMS_Forms/Form_EventManager.cs @@ -64,6 +64,7 @@ comboBox_name.Items.Add(name); } + dr.Close(); conn.Close(); diff --git a/Forms/FrmMnModify.cs b/Forms/FrmMnModify.cs index 31cfc5f..d036360 100644 --- a/Forms/FrmMnModify.cs +++ b/Forms/FrmMnModify.cs @@ -68,15 +68,7 @@ questionGrid.Rows[idx].Cells[1].Value = sr.question; } } - /// 选中对象 - /// - /// - /// - /// - private void buttonX1_Click(object sender, EventArgs e) - { - globecontrol.Globe.Action = EnumAction3D.SelectObject; - } + /// /// 选中某一行 /// diff --git a/Forms/FrmPipelineModelDataBase.cs b/Forms/FrmPipelineModelDataBase.cs index 2acf0ca..7ce573f 100644 --- a/Forms/FrmPipelineModelDataBase.cs +++ b/Forms/FrmPipelineModelDataBase.cs @@ -35,19 +35,7 @@ ds = _ds; InitializeComponent(); } - /// - /// 单击选择shp格式文件 - /// - /// - /// - private void btnBrowseModel_Click(object sender, EventArgs e) - { - saveFileDialog1.Filter = "*.lgd|*.lgd"; - if (saveFileDialog1.ShowDialog() == DialogResult.OK) - { - txtModelLayer.Text = saveFileDialog1.FileName; - } - } + /// /// 窗体初始化事件处理 /// @@ -100,49 +88,6 @@ } } } - - private object convertFieldValue(string fieldname, object obj) - { - if (obj == null) - return null; - - try - { - string type = fields_types[fieldname].ToString(); - switch (type) - { - case "string": - return obj.ToString(); - case "int": - //return 101; - int intResult; - if (int.TryParse(obj.ToString(), out intResult)) - return intResult; - else - return null; - case "double": - //return 202.5; - double doubleResult; - if (double.TryParse(obj.ToString(), out doubleResult)) - return doubleResult; - else - return null; - case "date": - DateTime dtResult; - if (DateTime.TryParse(obj.ToString(), out dtResult)) - return dtResult; - else - return null; - } - return null; - } - catch (Exception ex) - { - MessageBox.Show(ex.ToString()); - return null; - } - } - public string lgdFilePath = ""; /// /// 选择管线颜色 @@ -610,33 +555,6 @@ { this.Close(); } - - private void cmbLayer_SelectedIndexChanged(object sender, EventArgs e) //选择图层 - { - GSOLayer layer = ctl.Globe.Layers.GetLayerByCaption(selectLayerName); - GSOFeatures features = layer.GetAllFeatures(); - if (features.Length == 0) - return; - - cmbFrom.Items.Clear(); - cmbTo.Items.Clear(); - cmbRadius.Items.Clear(); - cmbID.Items.Clear(); - for (int i = 0; i < features[0].GetFieldCount(); i++) - { - GeoScene.Data.GSOFieldDefn fielddef = (GeoScene.Data.GSOFieldDefn)(features[0].GetFieldDefn(i)); - - cmbFrom.Items.Add(fielddef.Name); - cmbTo.Items.Add(fielddef.Name); - cmbRadius.Items.Add(fielddef.Name); - cmbID.Items.Add(fielddef.Name); - } - cmbFrom.SelectedItem = "Deep1"; - cmbTo.SelectedItem = "Deep2"; - cmbRadius.SelectedItem = "Diameter"; - cmbID.SelectedItem = "Handle"; - } - private void buttonXLayerPath_Click(object sender, EventArgs e)//单击 选择shp格式的文件 { OpenFileDialog dlg = new OpenFileDialog(); diff --git a/Forms/FrmPipelineModelDataOneStep.cs b/Forms/FrmPipelineModelDataOneStep.cs index 18afda7..ec93b8a 100644 --- a/Forms/FrmPipelineModelDataOneStep.cs +++ b/Forms/FrmPipelineModelDataOneStep.cs @@ -38,19 +38,7 @@ layerTree = _layerTree; InitializeComponent(); } - /// - /// 单击选择shp格式文件 - /// - /// - /// - private void btnBrowseModel_Click(object sender, EventArgs e) - { - saveFileDialog1.Filter = "*.lgd|*.lgd"; - if (saveFileDialog1.ShowDialog() == DialogResult.OK) - { - txtModelLayer.Text = saveFileDialog1.FileName; - } - } + /// /// 窗体初始化事件处理 /// @@ -107,48 +95,7 @@ } } - private object convertFieldValue(string fieldname, object obj) - { - if (obj == null) - return null; - - try - { - string type = fields_types[fieldname].ToString(); - switch (type) - { - case "string": - return obj.ToString(); - case "int": - //return 101; - int intResult; - if (int.TryParse(obj.ToString(), out intResult)) - return intResult; - else - return null; - case "double": - //return 202.5; - double doubleResult; - if (double.TryParse(obj.ToString(), out doubleResult)) - return doubleResult; - else - return null; - case "date": - DateTime dtResult; - if (DateTime.TryParse(obj.ToString(), out dtResult)) - return dtResult; - else - return null; - } - return null; - } - catch (Exception ex) - { - MessageBox.Show(ex.ToString()); - return null; - } - } - + public string lgdFilePath = ""; /// /// 选择管线颜色 @@ -673,32 +620,6 @@ return featDs; } - private void cmbLayer_SelectedIndexChanged(object sender, EventArgs e) //选择图层 - { - GSOLayer layer = ctl.Globe.Layers.GetLayerByCaption(selectLayerName); - GSOFeatures features = layer.GetAllFeatures(); - if (features.Length == 0) - return; - - cmbFrom.Items.Clear(); - cmbTo.Items.Clear(); - cmbRadius.Items.Clear(); - cmbID.Items.Clear(); - for (int i = 0; i < features[0].GetFieldCount(); i++) - { - GeoScene.Data.GSOFieldDefn fielddef = (GeoScene.Data.GSOFieldDefn)(features[0].GetFieldDefn(i)); - - cmbFrom.Items.Add(fielddef.Name); - cmbTo.Items.Add(fielddef.Name); - cmbRadius.Items.Add(fielddef.Name); - cmbID.Items.Add(fielddef.Name); - } - cmbFrom.SelectedItem = "Deep1"; - cmbTo.SelectedItem = "Deep2"; - cmbRadius.SelectedItem = "Diameter"; - cmbID.SelectedItem = "Handle"; - } - private void buttonXLayerPath_Click(object sender, EventArgs e)//单击 选择shp格式的文件 { OpenFileDialog dlg = new OpenFileDialog(); @@ -949,38 +870,6 @@ } //txtLayername.Text = type + layername; } - /// - /// 连接数据库 - /// - /// - /// - private void buttonX1_Click(object sender, EventArgs e) - { - if (ds == null) - { - //没连的话,直接连接审核库; //审核库配置读配置文件 - string dbIp = Utility.sgdbip; - string database = Utility.sgdbname; - string user = Utility.sgdbuser; - string pass = Utility.sgdbpwd; - - if (!Utility.isNetworkConnectionSuccess(dbIp.Trim())) - { - MessageBox.Show("网络连接失败!", "提示"); - return; - } - - ds = ctl.Globe.DataManager.OpenOracleDataSource(dbIp + "/" + database, "", "", user, pass); - if (ds == null) - { - MessageBox.Show("数据库连接失败!", "提示", MessageBoxButtons.OK, MessageBoxIcon.Warning); - } - else - { - btnCreateModel.Enabled = true; - } - } - } private void btnClose_Click(object sender, EventArgs e) { diff --git a/Forms/FrmShRK.cs b/Forms/FrmShRK.cs index 0e2e722..f1d83cb 100644 --- a/Forms/FrmShRK.cs +++ b/Forms/FrmShRK.cs @@ -215,6 +215,7 @@ { sourcefeatds = sourcefeat as GSOFeatureDataset; } + if (sourcefeatds == null) return; sourcefeatds.Open(); GSOFeatures sourcefeatures = sourcefeatds.GetAllFeatures(); @@ -251,6 +252,7 @@ { desfeatds = desfeat as GSOFeatureDataset; } + if (desfeatds == null) return; desfeatds.Open(); //向新数据集写入字段 diff --git a/FrmAccessoriesSensor.cs b/FrmAccessoriesSensor.cs index 09fcdf1..2a7a80e 100644 --- a/FrmAccessoriesSensor.cs +++ b/FrmAccessoriesSensor.cs @@ -209,7 +209,7 @@ chart1.Series[0].Points.DataBindXY(dic.Keys, dic.Values); for (int m = 0; m < dic.Values.Count; m++) { - if (chart1.Series[0].Points[m].YValues[0].ToString() != "0") + if (chart1.Series[0].Points[m]!=null&&chart1.Series[0].Points[m].YValues[0].ToString() != "0") { chart1.Series[0].Points[m].Label = chart1.Series[0].Points[m].YValues[0].ToString(); } diff --git a/FrmAccessoriesgather.cs b/FrmAccessoriesgather.cs index 9e331e1..a475d9e 100644 --- a/FrmAccessoriesgather.cs +++ b/FrmAccessoriesgather.cs @@ -338,7 +338,7 @@ chart1.Series[0].Points.DataBindXY(dic.Keys, dic.Values); for (int m = 0; m < dic.Values.Count; m++) { - if (chart1.Series[0].Points[m].YValues[0].ToString() != "0") + if (chart1.Series[0].Points[m]!=null&&chart1.Series[0].Points[m].YValues[0].ToString() != "0") { chart1.Series[0].Points[m].Label = chart1.Series[0].Points[m].YValues[0].ToString(); } diff --git a/FrmAccessoryAnalysis.cs b/FrmAccessoryAnalysis.cs index 71d4579..44d4065 100644 --- a/FrmAccessoryAnalysis.cs +++ b/FrmAccessoryAnalysis.cs @@ -66,39 +66,6 @@ globeControl1.Refresh(); } /// - /// 键盘按键按下事件处理 - /// - /// - /// - private void txtRadius_KeyPress(object sender, KeyPressEventArgs e) - { - TextBox text = sender as TextBox; - if ((e.KeyChar < 48 || e.KeyChar > 57) && (e.KeyChar != 8) && (int)e.KeyChar != 46) - { - e.Handled = true; - } - if ((int)e.KeyChar == 46) //小数点 - { - if (text.Text.Length <= 0) - e.Handled = true; //小数点不能在第一位 - else //处理不规则的小数点 - { - float f; - float oldf; - bool b1 = false, b2 = false; - b1 = float.TryParse(text.Text, out oldf); - b2 = float.TryParse(text.Text + e.KeyChar.ToString(), out f); - if (b2 == false) - { - if (b1 == true) - e.Handled = true; - else - e.Handled = false; - } - } - } - } - /// /// 确定按钮事件处理 /// /// diff --git a/FrmAddValve.cs b/FrmAddValve.cs index 34d2fec..5f405b9 100644 --- a/FrmAddValve.cs +++ b/FrmAddValve.cs @@ -486,56 +486,6 @@ } } - - - - - - - - private void cmbLayer_SelectedIndexChanged(object sender, EventArgs e) - { - GSOLayer layer = globeControl1.Globe.Layers.GetLayerByCaption(selectLayerName); - GSOFeatures features = layer.GetAllFeatures(); - if (features.Length == 0) - return; - - combPath.Items.Clear(); - combZ.Items.Clear(); - combModelName.Items.Clear(); - - for (int i = 0; i < features[0].GetFieldCount(); i++) - { - GeoScene.Data.GSOFieldDefn fielddef = (GeoScene.Data.GSOFieldDefn)(features[0].GetFieldDefn(i)); - combPath.Items.Add(fielddef.Name); - combZ.Items.Add(fielddef.Name); - combModelName.Items.Add(fielddef.Name); - } - combModelName.SelectedItem = "编号"; - combPath.SelectedItem = "模型路径"; - if (combfile.SelectedIndex != -1) - { - - string layerCaption = combfile.SelectedItem.ToString().Trim(); - rukuLayer = globeControl1.Globe.Layers.GetLayerByCaption(layerCaption); - if (rukuLayer != null) - { - combPath.Items.Clear(); - combZ.Items.Clear(); - combModelName.Items.Clear(); - - } - for (int i = 0; i < features[0].GetFieldCount(); i++) - { - GeoScene.Data.GSOFieldDefn fielddef = (GeoScene.Data.GSOFieldDefn)(features[0].GetFieldDefn(i)); - combPath.Items.Add(fielddef.Name); - combZ.Items.Add(fielddef.Name); - combModelName.Items.Add(fielddef.Name); - } - combModelName.SelectedItem = "编号"; - combPath.SelectedItem = "模型路径"; - } - } /// /// 单击选择shp格式文件 /// diff --git a/FrmAddWellShp.cs b/FrmAddWellShp.cs index bb79ec0..a249725 100644 --- a/FrmAddWellShp.cs +++ b/FrmAddWellShp.cs @@ -478,32 +478,6 @@ } } } - - private void cmbLayer_SelectedIndexChanged(object sender, EventArgs e) - { - GSOLayer layer = globeControl1.Globe.Layers.GetLayerByCaption(selectLayerName); - GSOFeatures features = layer.GetAllFeatures(); - if (features.Length == 0) - return; - - combCode.Items.Clear(); - combDeep.Items.Clear(); - combModelName.Items.Clear(); - combAngle.Items.Clear(); - - for (int i = 0; i < features[0].GetFieldCount(); i++) - { - GeoScene.Data.GSOFieldDefn fielddef = (GeoScene.Data.GSOFieldDefn)(features[0].GetFieldDefn(i)); - combCode.Items.Add(fielddef.Name); - combDeep.Items.Add(fielddef.Name); - combModelName.Items.Add(fielddef.Name); - combAngle.Items.Add(fielddef.Name); - } - combCode.SelectedItem = "附属物编码"; - combDeep.SelectedItem = "井深"; - combModelName.SelectedItem = "编号"; - combAngle.SelectedItem = "符号角度"; - } /// /// 单击选择shp格式文件 /// diff --git a/FrmAddYuBiZiShp.cs b/FrmAddYuBiZiShp.cs index b312d51..332f037 100644 --- a/FrmAddYuBiZiShp.cs +++ b/FrmAddYuBiZiShp.cs @@ -383,80 +383,7 @@ } } - private void cmbLayer_SelectedIndexChanged(object sender, EventArgs e) - { - GSOLayer layer = globeControl1.Globe.Layers.GetLayerByCaption(selectLayerName); - GSOFeatures features = layer.GetAllFeatures(); - if (features.Length == 0) - return; - - combCode.Items.Clear(); - combDeep.Items.Clear(); - combModelName.Items.Clear(); - //comboLoad.Items.Clear(); - for (int i = 0; i < features[0].GetFieldCount(); i++) - { - GeoScene.Data.GSOFieldDefn fielddef = (GeoScene.Data.GSOFieldDefn)(features[0].GetFieldDefn(i)); - combCode.Items.Add(fielddef.Name); - combDeep.Items.Add(fielddef.Name); - combModelName.Items.Add(fielddef.Name); - //comboLoad.Items.Add(fielddef.Name); - } - combCode.SelectedItem = "附属物编码"; - combDeep.SelectedItem = "Z坐标"; - combModelName.SelectedItem = "编号"; - //comboLoad.SelectedItem = "模型路径"; - } - - private void buttonXLayerPath_Click(object sender, EventArgs e) - { - OpenFileDialog dlg = new OpenFileDialog(); - dlg.Filter = "*.shp|*.shp"; - dlg.Multiselect = false; - if (dlg.ShowDialog() == DialogResult.OK) - { - GSOLayer layer = globeControl1.Globe.Layers.Add(dlg.FileName); - string txtMessage = valiYBdata(layer); - if (txtMessage != "") - { - button3.Enabled = false; - //textBoxLayer.Text = ""; - combCode.Items.Clear(); - combDeep.Items.Clear(); - combModelName.Items.Clear(); - globeControl1.Globe.Layers.Remove(layer); - FrmValiDataShowErrorMessage showErrorMessage = new FrmValiDataShowErrorMessage(dlg.FileName, txtMessage); - showErrorMessage.ShowDialog(); - return; - } - else - { - button3.Enabled = true; - //textBoxLayer.Text = dlg.FileName; - selectLayerName = layer.Caption; - txtLayerName.Text = layer.Caption; - GSOFeatures features = layer.GetAllFeatures(); - if (features.Length == 0) - return; - - combCode.Items.Clear(); - combDeep.Items.Clear(); - combModelName.Items.Clear(); - for (int i = 0; i < features[0].GetFieldCount(); i++) - { - GeoScene.Data.GSOFieldDefn fielddef = (GeoScene.Data.GSOFieldDefn)(features[0].GetFieldDefn(i)); - combCode.Items.Add(fielddef.Name); - combDeep.Items.Add(fielddef.Name); - combModelName.Items.Add(fielddef.Name); - //comboLoad.Items.Add(fielddef.Name); - } - combCode.SelectedItem = "管点编码"; - combDeep.SelectedItem = "Z坐标"; - combModelName.SelectedItem = "编号"; - } - } - } - + private void FrmAddYuBiZiShp_FormClosing(object sender, FormClosingEventArgs e) { globeControl1.Globe.Refresh(); diff --git a/FrmAllPipelineStatis.cs b/FrmAllPipelineStatis.cs index 6421a26..a6eea29 100644 --- a/FrmAllPipelineStatis.cs +++ b/FrmAllPipelineStatis.cs @@ -84,7 +84,7 @@ chartAllAreaPipeline.Series["管线"].Points.DataBindXY(pipelineLengthAndType.Keys, pipelineLengthAndType.Values); for (int m = 0; m < pipelineLengthAndType.Values.Count; m++) { - if (chartAllAreaPipeline.Series["管线"].Points[m].YValues[0].ToString() != "0") + if (chartAllAreaPipeline.Series["管线"].Points[m]!=null&&chartAllAreaPipeline.Series["管线"].Points[m].YValues[0].ToString() != "0") { chartAllAreaPipeline.Series["管线"].Points[m].Label = chartAllAreaPipeline.Series[0].Points[m].YValues[0].ToString(); } @@ -94,7 +94,7 @@ } catch (Exception ex) { - //LogError.PublishError(ex); + LogHelper.WriteLog(typeof(FrmAllPipelineStatis), ex.Message); } } @@ -147,7 +147,7 @@ } DataTable dt = OledbHelper.QueryTable(sql); - if (dt != null && dt.Rows.Count > 0) + if (dt != null && dt.Rows.Count > 0 && chartAllAreaPipeline.Series["管线"].Points[indexHit]!=null) { dataGridViewX1.DataSource = dt; panel.Visible = true; diff --git a/FrmAllWorkWellStatis.cs b/FrmAllWorkWellStatis.cs index 6fec7af..6af8e4c 100644 --- a/FrmAllWorkWellStatis.cs +++ b/FrmAllWorkWellStatis.cs @@ -52,7 +52,7 @@ chartAllAreaPipeline.Series["井盖"].Points.DataBindXY(workWellLengthAndType.Keys, workWellLengthAndType.Values); for (int m = 0; m < workWellLengthAndType.Values.Count; m++) { - if (chartAllAreaPipeline.Series["井盖"].Points[m].YValues[0].ToString().Trim() != "0") + if (chartAllAreaPipeline.Series["井盖"].Points[m]!=null&&chartAllAreaPipeline.Series["井盖"].Points[m].YValues[0].ToString().Trim() != "0") { chartAllAreaPipeline.Series["井盖"].Points[m].Label = chartAllAreaPipeline.Series[0].Points[m].YValues[0].ToString(); } @@ -60,7 +60,7 @@ } catch (Exception ex) { - //LogError.PublishError(ex); + LogHelper.WriteLog(typeof(FrmAllWorkWellStatis), ex.Message); } } diff --git a/FrmBSQDuoBianXingStatis.cs b/FrmBSQDuoBianXingStatis.cs index e8b7d52..3e889b6 100644 --- a/FrmBSQDuoBianXingStatis.cs +++ b/FrmBSQDuoBianXingStatis.cs @@ -60,7 +60,7 @@ { for (int m = 0; m < bsq1.Values.Count; m++) { - if (chart1.Series["标识器"].Points[m].YValues[0].ToString() != "0") + if (chart1.Series["标识器"].Points[m]!=null&&chart1.Series["标识器"].Points[m].YValues[0].ToString() != "0") { count += Convert.ToInt16(chart1.Series[0].Points[m].YValues[0].ToString()); chart1.Series["标识器"].Points[m].Label = chart1.Series[0].Points[m].YValues[0].ToString(); diff --git a/FrmBSQDuoBianXingStreet.cs b/FrmBSQDuoBianXingStreet.cs index 2005ebb..1db5777 100644 --- a/FrmBSQDuoBianXingStreet.cs +++ b/FrmBSQDuoBianXingStreet.cs @@ -63,7 +63,7 @@ chartStatis.Series[0].Points.DataBindXY(bsq.Keys, bsq.Values); for (int m = 0; m < bsq.Values.Count; m++) { - if (chartStatis.Series[0].Points[m].YValues[0].ToString().Trim() != "0") + if (chartStatis.Series[0].Points[m]!=null&&chartStatis.Series[0].Points[m].YValues[0].ToString().Trim() != "0") { count += Convert.ToInt16(chartStatis.Series[0].Points[m].YValues[0].ToString()); chartStatis.Series[0].Points[m].Label = chartStatis.Series[0].Points[m].YValues[0].ToString(); diff --git a/FrmBSQStatis.cs b/FrmBSQStatis.cs index 390a55c..4aa0ee6 100644 --- a/FrmBSQStatis.cs +++ b/FrmBSQStatis.cs @@ -95,6 +95,8 @@ } } } + + dr.Close(); conn.Close(); for (int i = 0; i < typeLists.Count; i++) { @@ -123,7 +125,7 @@ chartStatis.Series[0].Points.DataBindXY(bsq.Keys, bsq.Values); for (int m = 0; m < bsq.Values.Count; m++) { - if (chartStatis.Series[0].Points[m].YValues[0].ToString().Trim() != "0") + if (chartStatis.Series[0].Points[m]!=null&&chartStatis.Series[0].Points[m].YValues[0].ToString().Trim() != "0") { //count += Convert.ToInt16(chartStatis.Series[0].Points[m].YValues[0].ToString()); chartStatis.Series[0].Points[m].Label = chartStatis.Series[0].Points[m].YValues[0].ToString(); diff --git a/FrmBSQStreet.cs b/FrmBSQStreet.cs index 9d88adb..7fbacad 100644 --- a/FrmBSQStreet.cs +++ b/FrmBSQStreet.cs @@ -44,7 +44,7 @@ chartStatis.Series[0].Points.DataBindXY(bsq.Keys, bsq.Values); for (int m = 0; m < bsq.Values.Count; m++) { - if (chartStatis.Series[0].Points[m].YValues[0].ToString().Trim() != "0") + if (chartStatis.Series[0].Points[m]!=null&&chartStatis.Series[0].Points[m].YValues[0].ToString().Trim() != "0") { count += Convert.ToInt16(chartStatis.Series[0].Points[m].YValues[0].ToString()); chartStatis.Series[0].Points[m].Label = chartStatis.Series[0].Points[m].YValues[0].ToString(); diff --git a/FrmBoosterValvers.cs b/FrmBoosterValvers.cs index 5061efc..df9b62b 100644 --- a/FrmBoosterValvers.cs +++ b/FrmBoosterValvers.cs @@ -236,199 +236,6 @@ count = 0; } } - /// - /// 添加火苗 - /// - /// - /// - /// - /// - private GSOFeature AddFire(double x,double y,double z) - { - // 烟火示例 - - string strResPath = Application.StartupPath + "/Resource"; - - // 烟火粒子示例,由三个发射器构成 - GSOGeoParticle geoParticle = new GSOGeoParticle(); - geoParticle.SetPosition(x, y, z); // 添加到这个经纬度位置 - geoParticle.AltitudeMode = EnumAltitudeMode.RelativeToGround; - - GSORingParticleEmitter emitter = new GSORingParticleEmitter(); - emitter.TexturePath = strResPath + "/ParticleImage/flare.png"; - - emitter.SetSizeFix(1, 1); - emitter.VelFix = 1; - emitter.VelRnd = 5; - - emitter.AngleXYFix = 0; - emitter.AngleXYRnd = 180; - - emitter.AngleXZFix = 90; - emitter.AngleXZRnd = 0; - - emitter.LifeFix = 0.5f; - emitter.LifeRnd = 0.0f; - - emitter.RotFix = 0; - emitter.RotRnd = 0; - - emitter.RotVelFix = 0; - emitter.RotVelRnd = 0; - - emitter.EmitPerSec = 100; - - // 采用线性插值生成粒子的初始颜色 - emitter.ColorRndStart = Color.White; - emitter.ColorRndEnd = Color.Red; - - - GSOColorParticleEffector effector2 = new GSOColorParticleEffector(); - effector2.SetColorChanged(0, -1, -1, 0); - effector2.StartTime = 0.0f; - effector2.EndTime = -1.0f; - emitter.AddEffector(effector2); - - // 将三个发射器添加到粒子对象中 - geoParticle.AddEmitter(emitter); - - geoParticle.Play(); - - GSOFeature feature = new GSOFeature(); - - feature.Geometry = geoParticle; - - globeControl1.Globe.MemoryLayer.AddFeature(feature); - - - return feature; - } - - /// - /// 添加喷泉 - /// - /// - private GSOFeature AddFountain() - { - string strResPath = Application.StartupPath + "/Resource"; - - GSOGeoParticle geoParticle = new GSOGeoParticle(); - geoParticle.SetPosition(116.314, 39.84, 0); // 添加到这个经纬度位置 - - GSOPointParticleEmitter emitter = new GSOPointParticleEmitter(); - emitter.TexturePath = strResPath + "/ParticleImage/test.png"; - - emitter.SetSizeFix(0.5f, 2); - emitter.VelFix = 10; - emitter.VelRnd = 2; - - emitter.GravityAcc = 9.8f; - emitter.AngleXYFix = 0; - emitter.AngleXYRnd = 180; - - emitter.AngleXZFix = 88; - emitter.AngleXZRnd = 2; - - //emitter.InnerRadius = 0; - // emitter.OuterRadius = 0.03f; - - emitter.LifeFix = 5.0f; - emitter.LifeRnd = 1.0f; - - emitter.RotFix = 0; - emitter.RotRnd = 0; - - emitter.RotVelFix = 0; - emitter.RotVelRnd = 0; - - emitter.EmitPerSec = 1000; - emitter.ColorRndStart = Color.FromArgb(33, 255, 255, 255); - emitter.ColorRndEnd = Color.FromArgb(11, 255, 255, 255); - emitter.IsLumAdded = false; - - // 将三个发射器添加到粒子对象中 - geoParticle.AddEmitter(emitter); - - geoParticle.Play(); - GSOFeature feature = new GSOFeature(); - - feature.Geometry = geoParticle; - - //globeControl1.Globe.MemoryLayer.AddFeature(feature); - globeControl1.Globe.FlyToFeature(feature); - - return feature; - } - - /// - /// 添加水柱 - /// - /// - private GSOFeature AddWaterLine() - { - string strResPath = Application.StartupPath + "/Resource"; - - GSOGeoParticle geoParticle = new GSOGeoParticle(); - geoParticle.SetPosition(116.308, 39.84, 0); // 添加到这个经纬度位置 - - GSOPointParticleEmitter emitter = new GSOPointParticleEmitter(); - - emitter.TexturePath = strResPath + "/ParticleImage/drop3.png"; - - geoParticle.TimerInterval = 1; - - emitter.SetSizeFix(2.0f, 2.0f); - - emitter.VelFix = 50; - emitter.VelRnd = 2; - - // emitter.IsLumAdded = false; - - emitter.GravityAcc = 9.8f; - emitter.AngleXYFix = 0; - emitter.AngleXYRnd = 2; - - emitter.AngleXZFix = 60; - emitter.AngleXZRnd = 2; - - //emitter.InnerRadius = 0; - // emitter.OuterRadius = 0.1f; - - emitter.LifeFix = 5.0f; - emitter.LifeRnd = 1.0f; - - emitter.RotFix = 0; - emitter.RotRnd = 0; - - emitter.RotVelFix = 0; - emitter.RotVelRnd = 0; - - emitter.EmitPerSec = 1500; - - emitter.ColorRndStart = Color.FromArgb(100, 222, 222, 222); - emitter.ColorRndEnd = Color.FromArgb(50, 222, 222, 222); - - /* - - GSOScaleParticleEffector effector1 = new GSOScaleParticleEffector(); - effector1.SetScale(0.2f, 0.2f); - effector1.StartTime = 0; - effector1.EndTime = -1; // 负数表示整个粒子生命结束 - emitter.AddEffector(effector1); - */ - - // 将三个发射器添加到粒子对象中 - geoParticle.AddEmitter(emitter); - - geoParticle.Play(); - GSOFeature feature = new GSOFeature(); - - feature.Geometry = geoParticle; - - //globeControl1.Globe.MemoryLayer.AddFeature(feature); - globeControl1.Globe.FlyToFeature(feature); - - return feature; - } + } } diff --git a/FrmBufferAnalysis.cs b/FrmBufferAnalysis.cs index f711133..db8ca59 100644 --- a/FrmBufferAnalysis.cs +++ b/FrmBufferAnalysis.cs @@ -123,39 +123,6 @@ } } /// - /// 半径文本框的键盘按键按下事件处理 - /// - /// - /// - private void txtRadius_KeyPress(object sender, KeyPressEventArgs e) - { - TextBox text = sender as TextBox; - if ((e.KeyChar < 48 || e.KeyChar > 57) && (e.KeyChar != 8) && (int)e.KeyChar != 46) - { - e.Handled = true; - } - if ((int)e.KeyChar == 46) //小数点 - { - if (text.Text.Length <= 0) - e.Handled = true; //小数点不能在第一位 - else //处理不规则的小数点 - { - float f; - float oldf; - bool b1 = false, b2 = false; - b1 = float.TryParse(text.Text, out oldf); - b2 = float.TryParse(text.Text + e.KeyChar.ToString(), out f); - if (b2 == false) - { - if (b1 == true) - e.Handled = true; - else - e.Handled = false; - } - } - } - } - /// /// 窗体关闭事件处理 /// /// diff --git a/FrmBufferAnalysisBSQ.cs b/FrmBufferAnalysisBSQ.cs index 24a96ca..f54208f 100644 --- a/FrmBufferAnalysisBSQ.cs +++ b/FrmBufferAnalysisBSQ.cs @@ -137,35 +137,7 @@ } } - private void txtRadius_KeyPress(object sender, KeyPressEventArgs e) - { - TextBox text = sender as TextBox; - if ((e.KeyChar < 48 || e.KeyChar > 57) && (e.KeyChar != 8) && (int)e.KeyChar != 46) - { - e.Handled = true; - } - if ((int)e.KeyChar == 46) //小数点 - { - if (text.Text.Length <= 0) - e.Handled = true; //小数点不能在第一位 - else //处理不规则的小数点 - { - float f; - float oldf; - bool b1 = false, b2 = false; - b1 = float.TryParse(text.Text, out oldf); - b2 = float.TryParse(text.Text + e.KeyChar.ToString(), out f); - if (b2 == false) - { - if (b1 == true) - e.Handled = true; - else - e.Handled = false; - } - } - } - } - + private void FrmBufferAnalysis_FormClosing(object sender, FormClosingEventArgs e) { //Form1.y = 0; @@ -316,27 +288,6 @@ } } - private void FlyToMenu_Click(object sender, EventArgs e) - { - if (m_feature != null) - { - if (m_feature.Geometry != null && m_feature.Geometry.Type == EnumGeometryType.GeoPolyline3D) - { - GSOGeoPolyline3D line = m_feature.Geometry as GSOGeoPolyline3D; - double length = line.GetSpaceLength(true, 6378137); - GSOGeoPolyline3D lineLine = line.GetSegment(0, length / 2); - GSOPoint3d point3d = lineLine[lineLine.PartCount - 1][lineLine[lineLine.PartCount - 1].Count - 1]; - - globeControl1.Globe.FlyToPosition(point3d, EnumAltitudeMode.Absolute, 0, 45, 5); - } - else - { - globeControl1.Globe.FlyToFeature(m_feature, 0, 45, 3); - } - LightMenu_Click(sender, e); - } - } - private void LightMenu_Click(object sender, EventArgs e) { flashflag = "single"; diff --git a/FrmDataBaseOpt.cs b/FrmDataBaseOpt.cs index b0c4b5d..8d7b69d 100644 --- a/FrmDataBaseOpt.cs +++ b/FrmDataBaseOpt.cs @@ -362,6 +362,7 @@ dbCombor.Items.Add(dblist[i].title); } } + /* /// /// 从配置文件读取数据库参数配置 /// @@ -428,6 +429,8 @@ } } + * */ + /* /// /// 向配置文件写入连接数据库的参数配置 /// @@ -485,6 +488,7 @@ MessageBox.Show(exp.ToString()); } } + * */ /// /// /// diff --git a/FrmDatabaseParaSetting.cs b/FrmDatabaseParaSetting.cs index a6fea46..63b596b 100644 --- a/FrmDatabaseParaSetting.cs +++ b/FrmDatabaseParaSetting.cs @@ -152,6 +152,7 @@ this.DialogResult = DialogResult.OK; this.Close(); } + /* /// /// 从配置文件读取数据库连接参数配置 /// @@ -218,6 +219,8 @@ } } + * */ + /* /// /// 向配置文件写入数据库参数配置 /// @@ -276,7 +279,7 @@ MessageBox.Show(ex.ToString()); } } - + */ /// /// 取消按钮事件处理 /// diff --git a/FrmDatabaseParaSetting2.cs b/FrmDatabaseParaSetting2.cs index 932d05e..96a87d5 100644 --- a/FrmDatabaseParaSetting2.cs +++ b/FrmDatabaseParaSetting2.cs @@ -148,6 +148,7 @@ this.DialogResult = DialogResult.OK; this.Close(); } + /* /// /// 从配置文件读取数据库连接参数配置 /// @@ -214,6 +215,8 @@ } } + * */ + /* /// /// 向配置文件写入数据库参数配置 /// @@ -272,7 +275,7 @@ MessageBox.Show(exp.ToString()); } } - + */ /// /// 取消按钮事件处理 /// diff --git a/FrmDiameterQuery.cs b/FrmDiameterQuery.cs index 68c948b..9a5215b 100644 --- a/FrmDiameterQuery.cs +++ b/FrmDiameterQuery.cs @@ -77,18 +77,7 @@ isBetween = true; } } - /// - /// 键盘按键按下事件处理 - /// - /// - /// - private void textBoxX1_KeyPress(object sender, KeyPressEventArgs e) - { - if ((e.KeyChar < 48 || e.KeyChar > 57) && e.KeyChar != 8) - { - e.Handled = true;//屏蔽 - } - } + bool isBetween = false; /// diff --git a/FrmDocumentEdit.cs b/FrmDocumentEdit.cs index aab2d31..e78a7ff 100644 --- a/FrmDocumentEdit.cs +++ b/FrmDocumentEdit.cs @@ -256,121 +256,6 @@ } - // - /// 将本地文件上传到指定的服务器(HttpWebRequest方法) - /// - /// 文件上传到的服务器 - /// 要上传的本地文件(全路径) - /// 文件上传后的名称 - /// 上传进度条 - /// 成功返回1,失败返回0 - private int Upload_Request(string address, string fileNamePath, string saveName, ProgressBar progressBar) - { - int returnValue = 0; - // 要上传的文件 - FileStream fs = new FileStream(fileNamePath, FileMode.Open, FileAccess.Read); - BinaryReader r = new BinaryReader(fs); - //时间戳 - string strBoundary = "----------" + DateTime.Now.Ticks.ToString("x"); - byte[] boundaryBytes = Encoding.ASCII.GetBytes("/r/n--" + strBoundary + "/r/n"); - //请求头部信息 - StringBuilder sb = new StringBuilder(); - sb.Append("--"); - sb.Append(strBoundary); - sb.Append("\r\n"); - sb.Append("Content-Disposition: form-data; name=\""); - sb.Append("file"); - sb.Append("\"; filename=\""); - sb.Append(saveName); - sb.Append("\""); - sb.Append("\r\n"); - sb.Append("Content-Type: "); - sb.Append("application/octet-stream"); - sb.Append("\r\n"); - sb.Append("\r\n"); - string strPostHeader = sb.ToString(); - byte[] postHeaderBytes = Encoding.UTF8.GetBytes(strPostHeader); - // 根据uri创建HttpWebRequest对象 - HttpWebRequest httpReq = (HttpWebRequest)WebRequest.Create(new Uri(address)); - httpReq.Method = "POST"; - //对发送的数据不使用缓存 - httpReq.AllowWriteStreamBuffering = false; - //设置获得响应的超时时间(300秒) - httpReq.Timeout = 300000; - httpReq.ContentType = "multipart/form-data; boundary=" + strBoundary; - long length = fs.Length + postHeaderBytes.Length + boundaryBytes.Length; - long fileLength = fs.Length; - httpReq.ContentLength = length; - try - { - progressBar.Maximum = int.MaxValue; - progressBar.Minimum = 0; - progressBar.Value = 0; - //每次上传4k - int bufferLength = 4096; - byte[] buffer = new byte[bufferLength]; - //已上传的字节数 - long offset = 0; - //开始上传时间 - DateTime startTime = DateTime.Now; - int size = r.Read(buffer, 0, bufferLength); - Stream postStream = httpReq.GetRequestStream(); - //发送请求头部消息 - postStream.Write(postHeaderBytes, 0, postHeaderBytes.Length); - while (size > 0) - { - postStream.Write(buffer, 0, size); - offset += size; - progressBar.Value = (int)(offset * (int.MaxValue / length)); - TimeSpan span = DateTime.Now - startTime; - double second = span.TotalSeconds; - //lblTime.Text = "已用时:" + second.ToString("F2") + "秒"; - //if (second > 0.001) - //{ - // lblSpeed.Text = " 平均速度:" + (offset / 1024 / second).ToString("0.00") + "KB/秒"; - //} - //else - //{ - // lblSpeed.Text = " 正在连接…"; - //} - //lblState.Text = "已上传:" + (offset * 100.0 / length).ToString("F2") + "%"; - //lblSize.Text = (offset / 1048576.0).ToString("F2") + "M/" + (fileLength / 1048576.0).ToString("F2") + "M"; - Application.DoEvents(); - size = r.Read(buffer, 0, bufferLength); - } - //添加尾部的时间戳 - postStream.Write(boundaryBytes, 0, boundaryBytes.Length); - postStream.Close(); - //获取服务器端的响应 - WebResponse webRespon = httpReq.GetResponse(); - Stream s = webRespon.GetResponseStream(); - StreamReader sr = new StreamReader(s); - //读取服务器端返回的消息 - String sReturnString = sr.ReadLine(); - s.Close(); - sr.Close(); - if (sReturnString == "Success") - { - returnValue = 1; - } - else if (sReturnString == "Error") - { - returnValue = 0; - } - } - catch(Exception ex) - { - returnValue = 0; - string str = ex.ToString(); - } - finally - { - fs.Close(); - r.Close(); - } - return returnValue; - } - private void btn_file_Click(object sender, EventArgs e) { OpenFileDialog dlg = new OpenFileDialog(); diff --git a/FrmExportCADS.cs b/FrmExportCADS.cs index 98772ea..59629dd 100644 --- a/FrmExportCADS.cs +++ b/FrmExportCADS.cs @@ -108,65 +108,6 @@ MessageBox.Show("请选中要导出的图层!", "提示", MessageBoxButtons.OK, MessageBoxIcon.Warning); } } - private Boolean MerageToFile(GSOFeatures features, String strDestFile, String strProj4)//图层追加 - { - if (features == null) - { - return false; - } - Boolean bSuccess = false; - - string strDir = GSOUtility.GetFileDir(strDestFile); - string strLPRJFile = GSOUtility.ChangeExt(strDestFile, ".lprj"); - string strExt = GSOUtility.GetFileExt(strDestFile); - - // 如果投影文件存在,投影以投影文件为准 - if (File.Exists(strLPRJFile)) - { - // 如果是dxf,则这样处理 - if (strExt.ToLower() == ".dxf") - { - string strTempSrcFile = strDir + "srcFeatures_dxftmp" + strExt; - globeControl1.Globe.DataManager.SaveFeatureData(features, strTempSrcFile, strLPRJFile, 4); - bSuccess = GSOUtility.MergeTwoDXFFileFeatures(strDestFile, strTempSrcFile); - File.Delete(strTempSrcFile); - } - else - { - GSOFeatures srcFeatures = globeControl1.Globe.DataManager.ReadFeatureData(strDestFile); - int nCount = features.Length; - int i = 0; - for (i = 0; i < nCount; i++) - { - srcFeatures.Add(features[i]); - } - bSuccess = globeControl1.Globe.DataManager.SaveFeatureData(srcFeatures, strDestFile, strLPRJFile, 4); - } - } - else - { - // 如果是dxf,则这样处理 - if (strExt.ToLower() == ".dxf") - { - string strTempSrcFile = strDir + "srcFeatures_dxftmp" + strExt; - globeControl1.Globe.DataManager.SaveFeatureData(features, strTempSrcFile, strProj4, 0); - bSuccess = GSOUtility.MergeTwoDXFFileFeatures(strDestFile, strTempSrcFile); - File.Delete(strTempSrcFile); - } - else - { - GSOFeatures srcFeatures = globeControl1.Globe.DataManager.ReadFeatureData(strDestFile); - int nCount = features.Length; - int i = 0; - for (i = 0; i < nCount; i++) - { - srcFeatures.Add(features[i]); - } - bSuccess = globeControl1.Globe.DataManager.SaveFeatureData(srcFeatures, strDestFile, strProj4, 0); - } - } - return bSuccess; - } /// /// 关闭按钮事件处理 /// diff --git a/FrmHDMAnalysis3.cs b/FrmHDMAnalysis3.cs index 4f73af6..2ada735 100644 --- a/FrmHDMAnalysis3.cs +++ b/FrmHDMAnalysis3.cs @@ -436,29 +436,6 @@ } layerTemp.RemoveAllFeature(); } - private void Export(GSOPoint3d _pnt, double r) - { - GSOPoint3ds pnts = new GSOPoint3ds(); - GSOPoint3d pnt = new GSOPoint3d(); - pnt.X = _pnt.X; - pnt.Y = _pnt.Y; - pnt.Z = _pnt.Z; - pnts.Add(pnt); - pnt.X = _pnt.X; - pnt.Y = _pnt.Y - 0.0000000005; - pnt.Z = _pnt.Z; - pnts.Add(pnt); - GSOGeoPolyline3D line = new GSOGeoPolyline3D(); - line.AddPart(pnts); - GSOGeoPolygon3D polygon = line.CreateBuffer(r * 2, true, 5, true, false); - GSOPoint3ds points = polygon[0]; - GSOGeoPolyline3D newLine = new GSOGeoPolyline3D(); - newLine.AddPart(points); - newLine.AltitudeMode = EnumAltitudeMode.RelativeToGround; - GSOFeature newFeature = new GSOFeature(); - newFeature.Geometry = newLine; - globeControl1.Globe.MemoryLayer.AddFeature(newFeature); - } private void ExportCAD(double a, double b, double r) { diff --git a/FrmHotFuncStat.cs b/FrmHotFuncStat.cs index c980f34..2eb1476 100644 --- a/FrmHotFuncStat.cs +++ b/FrmHotFuncStat.cs @@ -421,13 +421,6 @@ } } - private void HFS_Pderive_Click(object sender, EventArgs e) - { - if (TV_Files.SelectedNode != null) - { - HFSClass.GuideEdit_form("G", TV_Files, int.Parse(((ToolStripMenuItem)sender).Tag.ToString())); - } - } private void 导入ToolStripMenuItem_Click(object sender, EventArgs e) { @@ -530,22 +523,8 @@ } } - private void 导出ToolStripMenuItem1_Click(object sender, EventArgs e) - { - 导出ToolStripMenuItem2_Click(sender, e); - } + - private void TV_HFSSrchRslt_AfterCollapse(object sender, TreeViewEventArgs e) - { - e.Node.ImageIndex = 0; - } - - private void TV_HFSSrchRslt_AfterExpand(object sender, TreeViewEventArgs e) - { - HFSClass.ADD_TreeNode(TV_Files, e.Node); - e.Node.ImageIndex = 1; - } - private void 导出ToolStripMenuItem1_Click_1(object sender, EventArgs e) { if ((TV_HFSSrchRslt.SelectedNode != null) && (TV_HFSSrchRslt.SelectedNode.Parent != null)) diff --git a/FrmLayerControl.cs b/FrmLayerControl.cs index e7917c3..28fa14d 100644 --- a/FrmLayerControl.cs +++ b/FrmLayerControl.cs @@ -312,26 +312,7 @@ layerManagerNode.Expand(); terrainManagerNode.Expand(); } - /// - /// 刷新节点树 - /// - private void RefreshDataTree() - { - layerTree2.Nodes[0].Nodes.Clear(); - Int32 nCount = globeControl2.Globe.Layers.Count; - Int32 i = 0; - for (i = 0; i < nCount; i++) - { - GSODataset dataSpace = globeControl2.Globe.Layers[i].Dataset; - TreeNode node = new TreeNode(); - node.Text = dataSpace.Name; - node.ImageIndex = 0; - node.SelectedImageIndex = 0; - node.Checked = true; - node.Tag = dataSpace; - layerTree2.Nodes[0].Nodes.Add(node); - } - } + /// /// 目标图层按钮事件处理 /// @@ -494,22 +475,8 @@ } } } - /// - /// 改变指定节点的选中状态 - /// - /// - /// - private void CheckTreeNode(TreeNode node, Boolean bChecked) - { - CheckChildTreeNode(node, bChecked); - // 对于kml图层,如果当前处理的节点是true,那么要把所有的祖宗节点置为true - // 只有所有节点都未false,那么这个节点才为false - // CheckFatherTreeNode(node, bChecked); - globeControl1.Globe.Refresh(); - globeControl2.Globe.Refresh(); - - } + private void CheckChildTreeNode(TreeNode node, Boolean bChecked) { if (node == null) @@ -696,59 +663,7 @@ //} //CheckControl(e); } - /// - /// 树节点选中方法 - /// - /// - private void CheckControl(TreeViewEventArgs e) - { - if (e.Action != TreeViewAction.Unknown) - { - if (e.Node != null && !Convert.IsDBNull(e.Node)) - { - CheckParentNode(e.Node); - if (e.Node.Nodes.Count > 0) - { - CheckAllChildNodes(e.Node, e.Node.Checked); - } - } - } - } - /// - /// 改变所有子节点的状态 - /// - /// - /// - private void CheckAllChildNodes(TreeNode pn, bool IsChecked) - { - foreach (TreeNode tn in pn.Nodes) - { - tn.Checked = IsChecked; - if (tn.Tag.ToString().Contains("|")) - { - string nodeTag = tn.Tag.ToString().Split('|')[1]; - GSOLayer layer = globeControl1.Globe.Layers.GetLayerByCaption(nodeTag); - if (layer != null) - { - layer.Visible = IsChecked; - globeControl1.Globe.Refresh(); - } - } - if (tn.Tag is GSOFeature) - { - if (tn.Nodes.Count == 0) - { - GSOFeature feat = tn.Tag as GSOFeature; - feat.Visible = IsChecked; - globeControl1.Globe.Refresh(); - } - } - if (tn.Nodes.Count > 0) - { - CheckAllChildNodes(tn, IsChecked); - } - } - } + /// /// 改变父节点的选中状态,此处为所有子节点不选中时才取消父节点选中,可以根据需要修改 /// diff --git a/FrmLogin.cs b/FrmLogin.cs index 320fdd5..2afe46e 100644 --- a/FrmLogin.cs +++ b/FrmLogin.cs @@ -59,70 +59,6 @@ textBoxPassWord.Clear(); } } - - /// - /// 验证端口号 - /// - /// - private bool ValiPort() - { - Ping p = new Ping();//创建Ping对象p - PingReply pr = p.Send(Utility.localicenseserverip);//向指定IP或者主机名的计算机发送ICMP协议的ping数据包 - if (pr.Status == IPStatus.Success)//如果ping成功 - { - try - { - TcpClient tcpc = new TcpClient(Utility.localicenseserverip, Utility.localicenseserverport);//对IP地址为"192.168.0.105"的计算机的1500端口提出连接申请 - tcpc.Close(); - return true; - } - catch (Exception ex) - { - MessageBox.Show("端口连接错误!" + ex.Message); - return false; - } - } - else - { - int times = 0;//重新连接次数; - int count = 2;//设置尝试次数 - while (times < count) - { - //Thread.Sleep(1000);//等待时间(方便测试的话,你可以改为1000) - pr = p.Send(Utility.localicenseserverip); - - if (pr.Status == IPStatus.Success) - { - try - { - TcpClient tcpc = new TcpClient(Utility.localicenseserverip, Utility.localicenseserverport);//对IP地址为"192.168.0.105"的计算机的1500端口提出连接申请 - tcpc.Close(); - return true; - } - catch (Exception ex) - { - MessageBox.Show("端口连接错误!" + ex.Message); - return false; - } - } - else - { - times++; - if (times < count) - { - continue; - } - else - { - MessageBox.Show("重新尝试连接失败"); - return false; - } - } - - } - return false; - } - } /// /// 验证用户名、密码 /// diff --git a/FrmMetadata.cs b/FrmMetadata.cs index 886f65a..0365372 100644 --- a/FrmMetadata.cs +++ b/FrmMetadata.cs @@ -27,11 +27,7 @@ InitializeComponent(); loadTreeView(layerTree); } - private void FrmMetadata_Load(object sender, EventArgs e) - { - //this.ntLblC.Text = "nn"; - // loadTreeView(layerTree); - } + private void loadTreeView(TreeView tv)//构建图层树 { try diff --git a/FrmMetadataStat.cs b/FrmMetadataStat.cs index 790658a..e7696c6 100644 --- a/FrmMetadataStat.cs +++ b/FrmMetadataStat.cs @@ -197,9 +197,5 @@ } } - private void buttonX1_Click(object sender, EventArgs e) - { - drawChart(); - } } } diff --git a/FrmPatrolerManager.cs b/FrmPatrolerManager.cs index 37f8ffd..9e66aeb 100644 --- a/FrmPatrolerManager.cs +++ b/FrmPatrolerManager.cs @@ -109,82 +109,8 @@ this.winGridViewPager1.AllToExport = table; } - /// - /// 编辑 - /// - /// - /// - private void winGridViewPager1_OnEditSelected(object sender, EventArgs e) - { - - DataGridView grid = sender as DataGridView; - if (grid != null && grid.SelectedRows.Count>0) - { - DataGridViewRow row = grid.SelectedRows[0]; - try - { - long dbid = long.Parse(row.Cells["编号"].Value.ToString()); - String name = row.Cells["姓名"].Value.ToString(); - String sex = row.Cells["性别"].Value.ToString(); - String age = row.Cells["年龄"].Value.ToString(); - string phone = row.Cells["电话"].Value.ToString(); - age = String.IsNullOrEmpty(age.ToString().Trim()) ? "1" : age.ToString().Trim(); - FrmPatrolerEdit frm = new FrmPatrolerEdit(dbid.ToString(), name, age, sex, phone); - frm.reloadGrid += new ReloadPatrolerGrid(LoadData); - frm.ShowDialog(); - winGridViewPager1.Refresh(); - } - catch (Exception ex) - { - MessageBox.Show("编辑失败:" + ex.ToString(), "错误", MessageBoxButtons.OK, MessageBoxIcon.Error); - } - } - else - { - MessageBox.Show("没有选择记录", "提示"); - } - - } - - /// - /// 删除 - /// - /// - /// - private void winGridViewPager1_OnDeleteSelected(object sender, EventArgs e) - { - DataGridView grid = sender as DataGridView; - if (grid != null && grid.SelectedRows.Count > 0) - { - DataGridViewRow row = grid.SelectedRows[0]; - long dbid = long.Parse(row.Cells["编号"].Value.ToString()); - try - { - string state = row.Cells["状态"].Value.ToString(); - if ("在线".Equals(state)) - { - if (MessageBox.Show("确定注销?", "确认", MessageBoxButtons.YesNo, MessageBoxIcon.Question) == DialogResult.Yes) - { - String sql = "update patroler t set t.accountstate='LEAVER' where t.dbid=" + dbid; - OracleUtils.ExecuteNonQuery(OracleUtils.ConnectionString, CommandType.Text, sql); - } - } - else { - MessageBox.Show("人员不在线,无法注销", "信息"); - } - } - catch (Exception ex) - { - MessageBox.Show("人员注销失败:" + ex.ToString(), "错误", MessageBoxButtons.OK, MessageBoxIcon.Error); - } - } - else - { - MessageBox.Show("没有选择记录", "提示"); - } - } - - + + private void LoadData() { int pageIndex = winGridViewPager1.PagerInfo.CurrenetPageIndex; diff --git a/FrmRoadHDM.cs b/FrmRoadHDM.cs index e765313..e871dd5 100644 --- a/FrmRoadHDM.cs +++ b/FrmRoadHDM.cs @@ -333,31 +333,6 @@ this.Cursor = Cursors.Default; } } - - private void Export(GSOPoint3d _pnt, double r) - { - GSOPoint3ds pnts = new GSOPoint3ds(); - GSOPoint3d pnt = new GSOPoint3d(); - pnt.X = _pnt.X; - pnt.Y = _pnt.Y; - pnt.Z = _pnt.Z; - pnts.Add(pnt); - pnt.X = _pnt.X; - pnt.Y = _pnt.Y - 0.0000000005; - pnt.Z = _pnt.Z; - pnts.Add(pnt); - GSOGeoPolyline3D line = new GSOGeoPolyline3D(); - line.AddPart(pnts); - GSOGeoPolygon3D polygon = line.CreateBuffer(r * 2, true, 5, true, false); - GSOPoint3ds points = polygon[0]; - GSOGeoPolyline3D newLine = new GSOGeoPolyline3D(); - newLine.AddPart(points); - newLine.AltitudeMode = EnumAltitudeMode.RelativeToGround; - GSOFeature newFeature = new GSOFeature(); - newFeature.Geometry = newLine; - globeControl1.Globe.MemoryLayer.AddFeature(newFeature); - } - private void ExportCAD(double a, double b, double r) { GSOPoint3ds pnts = new GSOPoint3ds(); diff --git a/FrmUserAdd.cs b/FrmUserAdd.cs index c612ab4..f826427 100644 --- a/FrmUserAdd.cs +++ b/FrmUserAdd.cs @@ -231,24 +231,6 @@ //cbxRegion.SelectedIndexChanged += new EventHandler(cbxRegion_SelectedIndexChanged); } } - /// - /// 下拉框选中项改变事件处理 - /// - /// - /// - private void cbxRegion_SelectedIndexChanged(object sender, EventArgs e) - { - string sql = ""; - //string sql = "select casic_role.\"name\" from casic_role join casic_regionrole on casic_role.\"id\"=casic_regionrole.\"rid\" where casic_regionrole.\"reid\"=" + region[cbxRegion.SelectedItem.ToString().Trim()]; - DataTable dt = OledbHelper.QueryTable(sql); - if (dt != null && dt.Rows.Count > 0) - { - comboBoxExRegionRole.Items.Clear(); - for (int i = 0; i < dt.Rows.Count; i++) - { - comboBoxExRegionRole.Items.Add(dt.Rows[i][0].ToString().Trim());//部门角色 - } - } - } + } } diff --git a/FrmUserManager.cs b/FrmUserManager.cs index 571f0f0..ae254bc 100644 --- a/FrmUserManager.cs +++ b/FrmUserManager.cs @@ -81,11 +81,6 @@ } } } - //创建新用户 - private void buttonX2_Click(object sender, EventArgs e) - { - FrmUserAdd frm = new FrmUserAdd(-1); - frm.ShowDialog(); - } + } } diff --git a/FrmValveStatistics.cs b/FrmValveStatistics.cs index 545d56c..dd76777 100644 --- a/FrmValveStatistics.cs +++ b/FrmValveStatistics.cs @@ -54,7 +54,7 @@ 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") + if (chaFamenStatis.Series["阀门"].Points[m]!=null&&chaFamenStatis.Series["阀门"].Points[m].YValues[0].ToString() != "0") { chaFamenStatis.Series["阀门"].Points[m].Label = chaFamenStatis.Series[0].Points[m].YValues[0].ToString(); } diff --git a/Frm_password_reset.cs b/Frm_password_reset.cs index 7b51039..b9e5dc3 100644 --- a/Frm_password_reset.cs +++ b/Frm_password_reset.cs @@ -41,6 +41,7 @@ } catch (Exception ex) { + LogHelper.WriteLog(typeof(Frm_password_reset), ex.Message); } } private void initCombox() diff --git a/FrmpipeDeepstatis.cs b/FrmpipeDeepstatis.cs index e156db4..1a84d6c 100644 --- a/FrmpipeDeepstatis.cs +++ b/FrmpipeDeepstatis.cs @@ -307,7 +307,7 @@ chart1.Series[j].Points.DataBindXY(dic1.Keys, dic1.Values); for (int m = 0; m < dic1.Values.Count; m++) { - if (chart1.Series[j].Points[m].YValues[0].ToString() != "0") + if (chart1.Series[j].Points[m]!=null&&chart1.Series[j].Points[m].YValues[0].ToString() != "0") { chart1.Series[j].Points[m].Label = chart1.Series[j].Points[m].YValues[0].ToString(); diff --git a/FrmpipeDiametergather.cs b/FrmpipeDiametergather.cs index 30674de..057b09d 100644 --- a/FrmpipeDiametergather.cs +++ b/FrmpipeDiametergather.cs @@ -263,6 +263,7 @@ if (layer != null && layer is GSOFeatureLayer) { GSOFeatureLayer flayer = layer as GSOFeatureLayer; + if (layer == null) return; GSOFeatures features = flayer.GetAllFeatures(); if (features.Length > 0) { diff --git a/FrmpipeMaterialGather.cs b/FrmpipeMaterialGather.cs index c133ec3..398b884 100644 --- a/FrmpipeMaterialGather.cs +++ b/FrmpipeMaterialGather.cs @@ -280,6 +280,7 @@ if (layer != null && layer is GSOFeatureLayer) { GSOFeatureLayer flayer = layer as GSOFeatureLayer; + if (flayer == null) return; GSOFeatures features = flayer.GetAllFeatures(); if (features.Length > 0) { @@ -332,7 +333,7 @@ chart1.Series[j].Points.DataBindXY(dic1.Keys, dic1.Values); for (int m = 0; m < dic1.Values.Count; m++) { - if (chart1.Series[j].Points[m].YValues[0].ToString() != "0") + if (chart1.Series[j].Points[m]!=null&&chart1.Series[j].Points[m].YValues[0].ToString() != "0") { chart1.Series[j].Points[m].Label = chart1.Series[j].Points[m].YValues[0].ToString(); } diff --git a/Frmpipediameterstatis.cs b/Frmpipediameterstatis.cs index c0ed80a..50f8170 100644 --- a/Frmpipediameterstatis.cs +++ b/Frmpipediameterstatis.cs @@ -286,6 +286,7 @@ chart1.Series.Add(layerCaption); GSOFeatureLayer flayer = layer as GSOFeatureLayer; + if (layer == null) return; GSOFeatures features = flayer.GetAllFeatures(); if (features.Length > 0) { diff --git "a/GKT_Forms/F_GKT\346\225\260\346\215\256\350\276\223\345\205\245\350\276\223\345\207\272.cs" "b/GKT_Forms/F_GKT\346\225\260\346\215\256\350\276\223\345\205\245\350\276\223\345\207\272.cs" index c7bffd5..4db7d5d 100644 --- "a/GKT_Forms/F_GKT\346\225\260\346\215\256\350\276\223\345\205\245\350\276\223\345\207\272.cs" +++ "b/GKT_Forms/F_GKT\346\225\260\346\215\256\350\276\223\345\205\245\350\276\223\345\207\272.cs" @@ -198,12 +198,7 @@ } DialogResult = DialogResult.OK;//将当前窗体的对话框返回值设为OK } - private void treeView1_NodeMouseClick(object sender, TreeNodeMouseClickEventArgs e) - { - dir_Ok = comboBox_Disk.Text + e.Node.FullPath; - //dir = comboBox_Disk.Text + e.Node.FullPath; - e.Node.SelectedImageIndex = e.Node.ImageIndex; - } + string tempstr = ""; private void button1_Click(object sender, EventArgs e) { diff --git a/HFS_Forms/Frm_HFSprojedits.cs b/HFS_Forms/Frm_HFSprojedits.cs index 96dd76f..3c232a1 100644 --- a/HFS_Forms/Frm_HFSprojedits.cs +++ b/HFS_Forms/Frm_HFSprojedits.cs @@ -126,16 +126,6 @@ Close(); } - - - private void TB_ProjName_KeyPress(object sender, KeyPressEventArgs e) - { - if (HFSAClass.Files_NameChar(e) == 0) - e.Handled = true; - if (e.KeyChar == '\r') - OK_Click(sender, e); - } - private void Frm_HFSProjedit_Load(object sender, EventArgs e) { @@ -175,10 +165,6 @@ } } - private void Cancel_Click(object sender, EventArgs e) - { - this.Close(); - } private void Cancel_Click_1(object sender, EventArgs e) { diff --git a/MainFrm.cs b/MainFrm.cs index 2c305a0..ed2685b 100644 --- a/MainFrm.cs +++ b/MainFrm.cs @@ -617,7 +617,7 @@ } catch (Exception ex) { - + LogHelper.WriteLog(typeof(MainFrm), ex.Message); } } @@ -1768,7 +1768,7 @@ } catch (Exception ex) { - //LogError.PublishError(ex); + LogHelper.WriteLog(typeof(MainFrm), ex.Message); } } @@ -2026,6 +2026,7 @@ } catch (Exception ex) { + LogHelper.WriteLog(typeof(MainFrm), ex.Message); result = false; } finally @@ -2316,220 +2317,6 @@ string filename = Utility.filename; List g1layername = new List(); /// - /// 构建图层列表目录树 - /// - /// - private void loadTreeView(TreeView tv) - { - try - { - XmlDocument doc = new XmlDocument(); - doc.Load(filename); - XmlNodeList Params1 = doc.SelectNodes("/Params/layers"); - tv.ShowLines = false; - tv.CheckBoxes = true; - - foreach (XmlNode paramsNode in Params1) //layers - { - foreach (XmlNode layerNode in paramsNode) //layer - { - TreeNode nodelayer = new TreeNode(); - string layerName = layerNode.Attributes["label"].Value; - nodelayer.Text = layerName; - - if (layerNode.HasChildNodes != false) - { - tv.Nodes.Add(nodelayer); - foreach (XmlNode layerchildNode in layerNode) //layerchild - { - if (layerchildNode.Name == "layerchild") - { - TreeNode nodelayerchild = new TreeNode(); - string layerType = layerchildNode.Attributes["type"].Value; - string layerName1 = layerchildNode.Attributes["layer"].Value; - string layerchildName = layerchildNode.Attributes["label"].Value; - if (layerType == "locaserver") - { - if (layerchildNode.Attributes["isRoad"] != null) - { - roadLayerName = layerchildName; - } - dictionaryNetLayerNameAndCaption.Add(layerName1, layerchildName); - - nodelayerchild.Text = layerchildName; - nodelayerchild.Tag = layerType + "|" + layerchildName; - nodelayerchild.Checked = true; - nodelayer.Nodes.Add(nodelayerchild); - } - else - { - if (layerchildNode.Attributes["isPipeLine"] != null) - { - m_PipelineLayerNames.Add(layerchildName); - } - if (layerchildNode.Attributes["isWorkWell"] != null) - { - workwellLayerNames.Add(layerchildName); - } - if (layerchildNode.Attributes["isValve"] != null) - { - valueLayerNames.Add(layerchildName); - } - //if (layerchildNode.Attributes["isInstrument"] != null) - if (layerchildNode.Attributes["isAccess"] != null) - { - instrumenLayerNames.Add(layerchildName); - } - //if (layerchildNode.Attributes["isPipeFitting"] != null) - if (layerchildNode.Attributes["isCharacter"] != null) - { - pipefittingLayerNames.Add(layerchildName); - } - bool boollayer = AddLayers(layerName1, layerchildName); - nodelayerchild.Text = layerchildName; - nodelayerchild.Tag = layerType + "|" + layerchildName; - nodelayerchild.Checked = boollayer; - if (layerchildName.Contains("特征管点")) - { - nodelayerchild.Checked = false; - setLayerVisible(layerName1); - } - - nodelayer.Nodes.Add(nodelayerchild); - g1layername.Add(layerName1); - } - } - else if (layerchildNode.Name == "layertype") - { - TreeNode nodelayerchild = new TreeNode(); - string layerType = layerchildNode.Attributes["label"].Value; - nodelayerchild.Text = layerType; - nodelayerchild.Tag = layerType; - nodelayerchild.Checked = true; - nodelayer.Nodes.Add(nodelayerchild); - if (layerchildNode.HasChildNodes == true) - { - foreach (XmlNode childNodeLayer in layerchildNode) - { - if (childNodeLayer.HasChildNodes == true) - { - TreeNode nodelayerchild2 = new TreeNode(); - string layer = childNodeLayer.Attributes["label"].Value; - nodelayerchild2.Text = layer; - nodelayerchild2.Tag = layer; - nodelayerchild2.Checked = true; - nodelayerchild.Nodes.Add(nodelayerchild2); - foreach (XmlNode n in childNodeLayer) - { - TreeNode nodelayerchild1 = new TreeNode(); - string layerName1 = n.Attributes["layer"].Value; - string layerchildName = n.Attributes["label"].Value; - string layerType1 = n.Attributes["type"].Value; - if (n.Attributes["isPipeLine"] != null) - { - m_PipelineLayerNames.Add(layerchildName); - } - if (n.Attributes["isWorkWell"] != null) - { - workwellLayerNames.Add(layerchildName); - } - if (n.Attributes["isValve"] != null) - { - valueLayerNames.Add(layerchildName); - } - if (n.Attributes["isAccess"] != null) - //if (n.Attributes["isInstrument"] != null) - { - instrumenLayerNames.Add(layerchildName); - } - if (n.Attributes["isPipeFitting"] != null) - { - pipefittingLayerNames.Add(layerchildName); - } - bool boollayer = AddLayers(layerName1, layerchildName); - nodelayerchild1.Text = layerchildName; - nodelayerchild1.Tag = layerType1 + "|" + layerchildName; - nodelayerchild1.Checked = boollayer; - if (layerchildName.Contains("特征管点")) - { - nodelayerchild1.Checked = false; - setLayerVisible(layerName1); - } - - nodelayerchild2.Nodes.Add(nodelayerchild1); - - g1layername.Add(layerName1); - } - } - else - { - TreeNode nodelayerchild1 = new TreeNode(); - string layerName1 = childNodeLayer.Attributes["layer"].Value; - string layerchildName = childNodeLayer.Attributes["label"].Value; - string layerType1 = childNodeLayer.Attributes["type"].Value; - if (childNodeLayer.Attributes["isPipeLine"] != null) - { - m_PipelineLayerNames.Add(layerchildName); - } - if (childNodeLayer.Attributes["isWorkWell"] != null) - { - workwellLayerNames.Add(layerchildName); - } - if (childNodeLayer.Attributes["isValve"] != null) - { - valueLayerNames.Add(layerchildName); - } - if (childNodeLayer.Attributes["isAccess"] != null) - //if (childNodeLayer.Attributes["isInstrument"] != null) - { - instrumenLayerNames.Add(layerchildName); - } - if (childNodeLayer.Attributes["isPipeFitting"] != null) - { - pipefittingLayerNames.Add(layerchildName); - } - bool boollayer = AddLayers(layerName1, layerchildName); - nodelayerchild1.Text = layerchildName; - nodelayerchild1.Tag = layerType1 + "|" + layerchildName; - nodelayerchild1.Checked = boollayer; - if (layerchildName.Contains("特征管点")) - { - nodelayerchild1.Checked = false; - setLayerVisible(layerName1); - } - nodelayerchild.Nodes.Add(nodelayerchild1); - g1layername.Add(layerName1); - } - } - } - } - } - } - else - { - tv.Nodes.Add(nodelayer); - } - } - } - - foreach (TreeNode tn in tv.Nodes) - { - if (tn.Nodes.Count > 0) - { - foreach (TreeNode tnChild in tn.Nodes) - { - if (tnChild.Checked) - tn.Checked = true; - } - } - } - } - catch (Exception ex) - { - //LogError.PublishError(ex); - } - } - /// /// 获取目标图层 /// /// @@ -2629,21 +2416,11 @@ } catch (Exception ex) { - //LogError.PublishError(ex); + LogHelper.WriteLog(typeof(MainFrm), ex.Message); return false; } } /// - /// 菜单上的 三维导航 工具按钮 - /// - /// - /// - private void buttonItem86_Click(object sender, EventArgs e) - { - globeControl1.Globe.Action = EnumAction3D.ActionNull; - } - - /// /// 地上模式 菜单按钮 /// /// @@ -3026,67 +2803,11 @@ } Image printImage; - /// - /// 打印 菜单 - /// - /// - /// - private void buttonItem13_Click(object sender, EventArgs e) - { - Point pt1 = new Point(Convert.ToInt32(0), Convert.ToInt32(0)); - Point pt2 = new Point(Convert.ToInt32(panelEx5.Width), Convert.ToInt32(panelEx5.Height)); - int mapWidth = 0; - int mapHeight = 0; - Point pt = getUpperLeftPoint(pt1, pt2, out mapWidth, out mapHeight); - printImage = new Bitmap(Convert.ToInt32(panelEx5.Width), Convert.ToInt32(panelEx5.Height)); - Graphics g = Graphics.FromImage(printImage); - g.CopyFromScreen(pt, new Point(0, 0), new Size(Convert.ToInt32(panelEx5.Width), Convert.ToInt32(panelEx5.Height))); - - PrintDialog pd = new PrintDialog(); - try - { - if (pd.ShowDialog() == DialogResult.OK) //如果确认,将会覆盖所有的打印参数设置 - { - //打印预览 - PrintPreviewDialog ppd = new PrintPreviewDialog(); - ppd.Document = printDocument1; - if (DialogResult.OK == ppd.ShowDialog()) - { - printDocument1.Print(); //打印 - } - } - } - catch - { - printDocument1.PrintController.OnEndPrint(printDocument1, new System.Drawing.Printing.PrintEventArgs()); - } - } - + private void printDocument1_PrintPage(object sender, System.Drawing.Printing.PrintPageEventArgs e) { e.Graphics.DrawImage(printImage, 10, 10); } - - /// - /// 在窗体的底部状态栏上显示 综合管线条件查询结果 - /// - /// - /// - private void ToolStripText(string currentLayer, int dataCount) - { - if (dataCount != 0) - { - double featurelength = PipeLength(currentLayer, 0);// 统计管线的里程数 - - toolStripNumbers.Text = " 管线类型:" + currentLayer + " | 共有:" + Convert.ToString(dataCount - 1) + "条记录"; - toolStripFeatureLength.Text = " 管线里程:" + featurelength.ToString("0.00") + " 米"; - } - else - { - toolStripNumbers.Text = "管线类型: " + currentLayer + "| 共有:" + 0 + " 条记录 | "; - } - } - /// /// 统计管线的里程数 /// @@ -3402,26 +3123,6 @@ } /// - /// 绘制线 菜单 - /// - /// - /// - private void btnAddLine_Click(object sender, EventArgs e) - { - globeControl1.Globe.DestLayerFeatureAdd = globeControl1.Globe.MemoryLayer; - globeControl1.Globe.Action = EnumAction3D.DrawPolyline; - } - /// - /// 绘制面 菜单 - /// - /// - /// - private void btnAddPolygon_Click(object sender, EventArgs e) - { - globeControl1.Globe.DestLayerFeatureAdd = globeControl1.Globe.MemoryLayer; - globeControl1.Globe.Action = EnumAction3D.DrawPolygon; - } - /// /// 图层目录树 右键菜单中的 目标图层 菜单 /// /// @@ -3956,42 +3657,7 @@ // ClearUpDownTraceAnalysis(); //} - /// - /// 显示流向 功能 - /// - /// - /// - /// - private void Flow(object sender, string pipelineNameCN, bool bShow) - { - GSOFeatureLayer layer = globeControl1.Globe.Layers.GetLayerByCaption(pipelineNameCN) as GSOFeatureLayer; - GSOFeatures feats = layer.GetAllFeatures(); - for (int i = 0; i < feats.Length; i++) - { - GSOFeature feat = feats[i]; - GSOLineStyle3D lineStyle = feat.Geometry.Style as GSOLineStyle3D; - if (lineStyle != null) - { - if (lineStyle.ArrowStyle == null) - { - lineStyle.ArrowStyle = new GSOArrowStyle(); - lineStyle.ArrowStyle.BodyWidth = 2; - lineStyle.ArrowStyle.BodyLen = 6; - lineStyle.ArrowStyle.HeadWidth = 8; - lineStyle.ArrowStyle.HeadLen = 10; - lineStyle.ArrowStyle.OutlineVisible = true; - lineStyle.ArrowStyle.OutlineColor = Color.Red; - lineStyle.ArrowStyle.Speed = lineStyle.ArrowStyle.Speed / 2; - lineStyle.ArrowStyle.Play(); - } - lineStyle.ArrowVisible = bShow; - layerTree.SelectedNode = null; - } - } - globeControl1.Globe.Refresh(); - } - - + FrmCloseValves frm; /// /// 关阀分析 功能 @@ -4030,7 +3696,9 @@ curCAYNDataset.CloseValveAnalysis(lineFeature.ID, out arryResNodeID, out arryResValveID, false, true); } catch (Exception e) - { } + { + LogHelper.WriteLog(typeof(MainFrm), e.Message); + } string valveName = lineLayer.Caption; valveName = valveName.Substring(0, valveName.IndexOf("管线")); @@ -4106,7 +3774,7 @@ } catch (Exception e) { - + LogHelper.WriteLog(typeof(MainFrm), e.Message); } //目前只有燃气管线 有阀门 string valveName = lineLayer.Name; @@ -5457,7 +5125,7 @@ } catch (Exception ex) { - //MessageBox.Show(ex.ToString()); + LogHelper.WriteLog(typeof(MainFrm), ex.Message); } finally { @@ -5501,22 +5169,6 @@ } } - - /// - /// 清除所有坑 菜单 - /// - /// - /// - private void buttonItem3_Click(object sender, EventArgs e) - { - //日志记录 - LogManager.saveLog(Utility.userName, this.buttonItem3.Text); - - globeControl1.Globe.RemoveAllPits(); - } - - - ///// ///// 净距分析 菜单 ///// @@ -5554,42 +5206,8 @@ // ribbonBarTP.Visible = buttonItem34.Checked; // ribbonBarTP.Location = new Point(0, 0); //} - /// - /// 大气层 菜单 - /// - /// - /// - private void buttonItem17_Click_1(object sender, EventArgs e) - { - globeControl1.Globe.Atmosphere.Visible = !globeControl1.Globe.Atmosphere.Visible; - buttonItemSH1.Checked = globeControl1.Globe.Atmosphere.Visible; - globeControl1.Refresh(); - } - /// - /// 经纬网 菜单 - /// - /// - /// - private void buttonItem20_Click(object sender, EventArgs e) - { - globeControl1.Globe.LatLonGrid.Visible = !globeControl1.Globe.LatLonGrid.Visible; - buttonItemSH3.Checked = globeControl1.Globe.LatLonGrid.Visible; - globeControl1.Globe.Refresh(); - } - /// - /// 状态条 菜单 - /// - /// - /// - private void buttonItem21_Click_1(object sender, EventArgs e) - { - globeControl1.Globe.StatusBar.Visible = !globeControl1.Globe.StatusBar.Visible; - buttonItemSH4.Checked = globeControl1.Globe.StatusBar.Visible; - globeControl1.Globe.Refresh(); - } - - + /// /// 添加指定路径下的数据 功能 /// @@ -5680,43 +5298,7 @@ // } // return objRes; //} - /// - /// 刷新目录树 功能 - /// - private void RefreshDataTree() - { - layerTree.Nodes[0].Nodes.Clear(); - Int32 nCount = globeControl1.Globe.DataManager.DataSourceCount; - Int32 i = 0; - for (i = 0; i < nCount; i++) - { - GSODataSource dataSpace = globeControl1.Globe.DataManager[i]; - TreeNode node = new TreeNode(); - node.Text = dataSpace.Name; - node.ImageIndex = 0; - node.SelectedImageIndex = 0; - node.Checked = true; - node.Tag = dataSpace; - Int32 nDatasetCount = dataSpace.DatasetCount; - for (Int32 j = 0; j < nDatasetCount; j++) - { - GSODataset dataset = dataSpace[j]; - TreeNode subNode = new TreeNode(); - subNode.Text = dataset.Name; - subNode.ImageIndex = 0; - subNode.SelectedImageIndex = 0; - subNode.Checked = true; - subNode.Tag = dataset; - node.Nodes.Add(subNode); - } - layerTree.Nodes[0].Nodes.Add(node); - } - } - - - - - + /// /// 复合查询 菜单 @@ -5777,34 +5359,7 @@ return false; } - /// - /// 统计指定图层在指定范围内的所有feature对象 - /// - /// - /// - /// - private GSOFeatures Intersect_PointLayer(GSOGeoPolygon3D polygon, string pointLayerName) - { - GSOLayer layer = globeControl1.Globe.Layers.GetLayerByCaption(pointLayerName); - if (layer == null) - return null; - - GSOFeatureLayer flayer = layer as GSOFeatureLayer; - GSOFeatureDataset fdataset = flayer.Dataset as GSOFeatureDataset; - GSOFeatures feats; - if (polygon == null) - { - feats = flayer.GetAllFeatures(); - } - else - { - feats = flayer.FindFeaturesInPolygon(polygon, false); - } - - workWellLen.Add(pointLayerName, feats.Length); - return feats; - } - /// + /// /// 碰撞分析功能界面中 选择管线复选框 选中状态改变事件处理 /// /// @@ -5946,16 +5501,6 @@ MessageBox.Show("表格内容为空!", "提示"); } } - /// - /// 导出CAD 菜单 - /// - /// - /// - private void btnExportCAD_Click(object sender, EventArgs e) - { - FrmExportCADS frm = new FrmExportCADS(globeControl1, m_PipelineLayerNames); - frm.ShowDialog(); - } ///// ///// 区域分析 菜单 @@ -5987,16 +5532,6 @@ } } } - /// - /// 数据验证 菜单 - /// - /// - /// - private void buttonItem80_Click(object sender, EventArgs e) - { - FrmValiData frm = new FrmValiData(globeControl1); - frm.ShowDialog(); - } /// /// 根据指定图层创建图层节点并将节点添加到图层管理节点的子节点集合中 @@ -6018,56 +5553,7 @@ layerManagerNode.Expand(); } } - /// - /// 数据库备份 菜单 - /// - /// - /// - private void btnBackDatabase_Click(object sender, EventArgs e) - { - if (MessageBox.Show("是否确定要备份数据库文件", "信息", MessageBoxButtons.YesNo, MessageBoxIcon.Question) == DialogResult.Yes) - { - try - { - DateTime currentTime = DateTime.Now; - //string Dtime = currentTime.ToShortDateString().ToString("yyyy-MM-dd"); - string Dtime = currentTime.GetDateTimeFormats('D')[0].ToString(); - string Htime = DateTime.Now.ToString("HH时mm分ss秒").Trim(); - string fileName = Dtime + "(" + Htime + ")"; - string pathName = ""; - string sql = "select filename from master..sysdatabases where name='" + Utility.dbdatabase + "'"; - DataTable dt = OledbHelper.ExecuteDataTable(sql); - if (dt != null && dt.Rows.Count > 0) - { - pathName = dt.Rows[0][0].ToString().Trim(); - int count = pathName.LastIndexOf("\\") == -1 ? pathName.LastIndexOf("/") : pathName.LastIndexOf("\\"); - pathName = pathName.Substring(0, count); - } - pathName += "\\管网数据库" + fileName + ".bak"; - - OracleCommand cmdBK = new OracleCommand(); - cmdBK.CommandType = CommandType.Text; - cmdBK.Connection = connBackup; - cmdBK.CommandText = @"backup database " + Utility.dbdatabase + " to disk='" + pathName + "' with init"; - - connBackup.Open(); - cmdBK.ExecuteNonQuery(); - MessageBox.Show("数据库文件备份成功", "提示"); - } - catch (Exception ex) - { - MessageBox.Show(ex.ToString()); - } - finally - { - connBackup.Close(); - } - } - } - - - - + //GSOFeature emitterFeature; // 粒子要素 /// /// 添加火苗 功能 @@ -6598,361 +6084,15 @@ } } - - ///// - /// 添加用户仓库 菜单 - /// - /// - /// - private void buttonItem108_Click(object sender, EventArgs e) - { - FrmUserRepo frm = new FrmUserRepo(-1); - frm.ShowDialog(); - } - /// - /// 用户仓库管理 菜单 - /// - /// - /// - private void buttonItem111_Click(object sender, EventArgs e) - { - FrmUserRepoMgr frm = new FrmUserRepoMgr(); - frm.ShowDialog(); - } - /// - /// 添加分系统 菜单 - /// - /// - /// - private void buttonItem112_Click(object sender, EventArgs e) - { - //FrmAPP frm = new FrmAPP(-1); - //frm.ShowDialog(); - } - /// - /// 分系统管理 菜单 - /// - /// - /// - private void buttonItem113_Click(object sender, EventArgs e) - { - //FrmAPPMgr frm = new FrmAPPMgr(); - //frm.ShowDialog(); - } - /// - /// 添加操作 菜单 - /// - /// - /// - private void buttonItem114_Click(object sender, EventArgs e) - { - FrmOper frm = new FrmOper(-1); - frm.ShowDialog(); - } - /// - /// 操作管理 菜单 - /// - /// - /// - private void buttonItem115_Click(object sender, EventArgs e) - { - FrmOperMgr frm = new FrmOperMgr(); - frm.ShowDialog(); - } - /// - /// 添加资源 菜单 - /// - /// - /// - private void buttonItem116_Click(object sender, EventArgs e) - { - FrmRESC frm = new FrmRESC(-1); - frm.ShowDialog(); - } - /// - /// 资源管理 菜单 - /// - /// - /// - private void buttonItem117_Click(object sender, EventArgs e) - { - FrmRESCMgr frm = new FrmRESCMgr(); - frm.ShowDialog(); - } - /// - /// 添加权限 菜单 - /// - /// - /// - private void buttonItem118_Click(object sender, EventArgs e) - { - FrmPerm frm = new FrmPerm(-1); - frm.ShowDialog(); - } - /// - /// 权限管理 菜单 - /// - /// - /// - private void buttonItem119_Click(object sender, EventArgs e) - { - FrmPermMgr frm = new FrmPermMgr(); - frm.ShowDialog(); - } - /// - /// 添加访问控制 菜单 - /// - /// - /// - private void buttonItem120_Click(object sender, EventArgs e) - { - FrmAccess frm = new FrmAccess(-1); - frm.ShowDialog(); - } - /// - /// 访问控制管理 菜单 - /// - /// - /// - private void buttonItem121_Click(object sender, EventArgs e) - { - FrmAccessMgr frm = new FrmAccessMgr(); - frm.ShowDialog(); - } - /// - /// 部门类型管理 菜单 - /// - /// - /// - private void buttonItem122_Click(object sender, EventArgs e) - { - FrmRegionTypeMgr frm = new FrmRegionTypeMgr(); - frm.ShowDialog(); - } - /// - /// 用户信息管理 菜单 - /// - /// - /// - private void buttonItem128_Click_1(object sender, EventArgs e) - { - FrmUserManager frm = new FrmUserManager(); - frm.ShowDialog(); - } - /// - /// 添加角色 菜单 - /// - /// - /// - private void 添加角色_Click(object sender, EventArgs e) - { - FrmRole frm = new FrmRole(-1); - frm.ShowDialog(); - } - /// - /// 所有角色管理 菜单 - /// - /// - /// - private void 角色管理_Click(object sender, EventArgs e) - { - FrmRoleMgr frm = new FrmRoleMgr(); - frm.ShowDialog(); - } - - /// - /// 部门角色管理 菜单 - /// - /// - /// - private void buttonItem133_Click(object sender, EventArgs e) - { - FrmRegionRoleMgr frm = new FrmRegionRoleMgr(); - frm.ShowDialog(); - } - /// - /// 部门管理 菜单 - /// - /// - /// - private void buttonItem130_Click(object sender, EventArgs e) - { - FrmRegionMgr frm = new FrmRegionMgr(); - frm.ShowDialog(); - } - - /// - /// 日志管理 菜单 - /// - /// - /// - private void buttonItem135_Click(object sender, EventArgs e) - { - FrmLogManager frm = new FrmLogManager(); - frm.ShowDialog(); - } - /// - /// 传感器信息查询 菜单 - /// - /// - /// - private void buttonItem131_Click_1(object sender, EventArgs e) - { - GSOFeature selectedFeature = globeControl1.Globe.SelectedObject; - if (selectedFeature == null) - { - MessageBox.Show("请选择一个传感器对象!", "提示", MessageBoxButtons.OK, MessageBoxIcon.Information); - } - else - { - if (selectedFeature.Geometry != null && selectedFeature.Geometry.Type == EnumGeometryType.GeoModel) - { - GSOLayer layer = globeControl1.Globe.SelectedObjectLayer; - string tabelName = getTableName(layer.Caption); - string eqtID = selectedFeature.Description.Trim(); - if (tabelName != "" && eqtID != "") - { - string fields = getFields(tabelName); - if (fields != "") - { - string sql = "select " + fields + " from " + Utility.sensorDatabase + "." + tabelName + " where EqtID=" + eqtID + " order by RecordDate desc limit 1;"; - DataTable dt = MySqlHelper.queryDataTable(sql); - if (dt != null && dt.Rows.Count > 0) - { - FrmQueryMessage.ShowForm(this, dt, layer.Caption); - //queryMessage.Show(this); - } - else - { - MessageBox.Show("没有查询到相关信息!", "提示"); - } - } - else - { - MessageBox.Show("配置文件 \"sensorConfig.xml\" 有误!", "提示"); - } - } - else - { - MessageBox.Show("请选择一个传感器对象!", "提示"); - } - } - else - { - MessageBox.Show("请选择一个传感器对象!", "提示", MessageBoxButtons.OK, MessageBoxIcon.Information); - } - } - } - /// - /// 根据指定的图层的caption属性的值在配置文件中查找对应的数据库中的表的名称 - /// - /// 图层的caption属性的值 - /// 对应的数据库中的表的名称 - private string getTableName(string name) - { - string tabelName = ""; - if (Utility.sensorMarkerLayers != null) - { - for (int i = 0; i < Utility.sensorMarkerLayers.Count; i++) - { - MarkerLayer mLayer = Utility.sensorMarkerLayers[i]; - if (mLayer.layerName == name) - { - tabelName = mLayer.tableName; - break; - } - } - } - return tabelName; - } - /// - /// 根据数据库中的表的名称 查找对应的表中的字段名称的集合 - /// - /// 数据库中的表的名称 - /// 对应的表中的字段名称的集合 - private string getFields(string tabelName) - { - string fields = ""; - if (Utility.sensorMarkerLayers != null) - { - for (int i = 0; i < Utility.sensorMarkerLayers.Count; i++) - { - MarkerLayer mLayer = Utility.sensorMarkerLayers[i]; - if (mLayer.tableName.Trim() == tabelName.Trim()) - { - if (mLayer.fields != null) - { - foreach (string key in mLayer.fields.Keys) - { - string value = mLayer.fields[key]; - fields += tabelName.Trim() + "." + key + " as " + value + ","; - } - fields = fields.Remove(fields.Length - 1); - } - break; - } - } - } - return fields; - } - - /// - /// 历史曲线查询 菜单 - /// - /// - /// - private void buttonItem132_Click(object sender, EventArgs e) - { - GSOFeature selectedFeature = globeControl1.Globe.SelectedObject; - if (selectedFeature == null) - { - MessageBox.Show("请选择一个对象!", "提示", MessageBoxButtons.OK, MessageBoxIcon.Information); - } - else - { - if (selectedFeature.Geometry != null && selectedFeature.Geometry.Type == EnumGeometryType.GeoModel) - { - GSOLayer layer = globeControl1.Globe.SelectedObjectLayer; - string tabelName = getTableName(layer.Caption); - string eqtID = selectedFeature.Description; - if (tabelName != "" && eqtID != "") - { - FrmQueryHistory.ShowForm(this, tabelName, eqtID); - } - else - { - MessageBox.Show("请选择一个传感器对象!", "提示"); - } - } - else - { - MessageBox.Show("请选择一个传感器对象!", "提示", MessageBoxButtons.OK, MessageBoxIcon.Information); - } - } - } - + //定时检查传感器的状态 public System.Windows.Forms.Timer timerOfSensor = null; public int alarmValueLiuLiang = 0; public int alarmValueYaLi = 0; public int alarmValueYeTi = 0; public int alarmValueZaoSheng = 0; - /// - /// 传感器在线报警 菜单 - /// - /// - /// - private void buttonItem134_Click(object sender, EventArgs e) - { - if (timerOfSensor == null) - { - timerOfSensor = new System.Windows.Forms.Timer(); - timerOfSensor.Interval = 30000; - timerOfSensor.Tick += new EventHandler(timerOfSensor_Tick); - } - FrmQuerySensorAlarm.ShowForm(this); - } + /// /// 传感器报警 功能中的 定时器 的触发事件处理 /// @@ -7016,6 +6156,7 @@ } catch (Exception ex) { + LogHelper.WriteLog(typeof(MainFrm), ex.Message); continue; } } @@ -7025,145 +6166,7 @@ } } - - /// - /// 沿线运动 菜单 - /// - /// - /// - private void buttonItem138_Click(object sender, EventArgs e) - { - if (globeControl1.Globe.SelectedObject == null) - { - MessageBox.Show("请先选择一条线!", "提示", MessageBoxButtons.OK, MessageBoxIcon.Exclamation); - return; - } - - GSOFeature lineFeature = globeControl1.Globe.SelectedObject; - if (lineFeature.Geometry == null || lineFeature.Geometry.Type != EnumGeometryType.GeoPolyline3D) - { - MessageBox.Show("请先选择一条线!", "提示", MessageBoxButtons.OK, MessageBoxIcon.Exclamation); - return; - } - - OpenFileDialog dlg = new OpenFileDialog(); - dlg.Filter = "*.gcm;*.3ds|*.gcm;*.3ds|*.3ds|*.3ds|*.gcm|*.gcm"; - if (dlg.ShowDialog() == DialogResult.OK) - { - GSOGeoModel model = new GSOGeoModel(); - model.FilePath = dlg.FileName; - - GSOGeoDynamicRoute dynamicRoute = new GSOGeoDynamicRoute(); - dynamicRoute.ActorGeometry = model; - - GSORoute route = new GSORoute(); - GSOGeoPolyline3D geoline = (GSOGeoPolyline3D)lineFeature.Geometry; - for (int i = 0; i < geoline[0].Count; i++) - { - route.Add(geoline[0][i]); - } - route.CircleRoute = false; - route.Speed = 30; - route.RotateSpeed = 50; - route.AltitudeMode = geoline.AltitudeMode; - dynamicRoute.Route = route; - - GSOFeature feature = new GSOFeature(); - - dynamicRoute.Play(); - feature.Geometry = dynamicRoute; - - //GSOLabel gsoLabel = new GSOLabel(); - //gsoLabel.Text = "模型测试"; - //feature.Label = gsoLabel; - globeControl1.Globe.MinModelVisibleSize = 0; - - globeControl1.Globe.MemoryLayer.AddFeature(feature); - globeControl1.Globe.Refresh(); - } - } - /// - /// 回退 菜单 - /// - /// - /// - private void buttonItem99_Click(object sender, EventArgs e) - { - globeControl1.Globe.UnDoEdit(); - } - /// - /// 前进 菜单 - /// - /// - /// - private void buttonItem100_Click(object sender, EventArgs e) - { - globeControl1.Globe.ReDoEdit(); - } - /// - /// 水平净距 功能界面中的 标签内容改变事件处理 - /// - /// - /// - private void textBoxX4_TextChanged(object sender, EventArgs e) - { - string valueJingJu = textBoxX4.Text.Trim(); - if (valueJingJu != "") - { - double value = 0; - bool bl = double.TryParse(valueJingJu, out value); - if (bl) - { - labelX24.Text = "水平净距小于" + value.ToString() + "米的管线有:"; - } - } - } - /// - /// 垂直净距 功能界面中的 标签内容改变事件处理 - /// - /// - /// - private void textBoxX2_TextChanged(object sender, EventArgs e) - { - string valueJingJu = textBoxX2.Text.Trim(); - if (valueJingJu != "") - { - double value = 0; - bool bl = double.TryParse(valueJingJu, out value); - if (bl) - { - labelX23.Text = "垂直净距小于" + value.ToString() + "米的管线有:"; - } - } - } - /// - /// 覆土分析 功能界面中的 标签内容改变事件处理 - /// - /// - /// - private void textBoxX3_TextChanged(object sender, EventArgs e) - { - string valueJingJu = textBoxX3.Text.Trim(); - if (valueJingJu != "") - { - double value = 0; - bool bl = double.TryParse(valueJingJu, out value); - if (bl) - { - labelX17.Text = "覆土深度小于" + value.ToString() + "米的管线有:"; - } - } - } - - /// - /// 传感器分类查询 全区域 菜单 - /// - /// - /// - private void buttonItemSensor全区域查询_Click(object sender, EventArgs e) - { - FrmAccessoriesSensor.ShowForm(globeControl1, instrumenLayerNames, 0); - } + /// /// 传感器分类查询 绘制区域 菜单 /// @@ -7224,170 +6227,10 @@ layerTemp.RemoveAllFeature(); globeControl1.Refresh(); } - /// - /// 数字预处理 功能 - /// - /// - /// - private void 数字预处理buttonItem140_Click(object sender, EventArgs e) - { - FrmEditShapeFile frm = new FrmEditShapeFile(globeControl1); - frm.ShowDialog(this); - } - - - /// - /// 导出矢量 功能 将图层导出为kml和shp格式数据 - /// - /// - /// - private void 导出矢量buttonItem140_Click(object sender, EventArgs e) - { - /* - List m_PipelineLayerNames = new List();//线图层名称 - List workwellLayerNames = new List();//工井图层名称 - List valueLayerNames = new List();//阀门图层名称 - List instrumenLayerNames = new List();//附属物图层名称 - List pipefittingLayerNames = new List();//管件图层名称 - */ - List listVectorNames = new List(); - for (int i = 0; i < m_PipelineLayerNames.Count; i++) - { - if (m_PipelineLayerNames[i] == "移动" || m_PipelineLayerNames[i] == "联通" - || m_PipelineLayerNames[i] == "电信" || m_PipelineLayerNames[i] == "共通" - || m_PipelineLayerNames[i] == "有限电视" || m_PipelineLayerNames[i] == "交通信号" - || m_PipelineLayerNames[i] == "供电") - { - continue; - } - if (listVectorNames.Contains(m_PipelineLayerNames[i]) == false) - { - listVectorNames.Add(m_PipelineLayerNames[i]); - } - } - for (int i = 0; i < valueLayerNames.Count; i++) - { - if (listVectorNames.Contains(valueLayerNames[i]) == false) - { - listVectorNames.Add(valueLayerNames[i]); - } - } - for (int i = 0; i < workwellLayerNames.Count; i++) - { - if (listVectorNames.Contains(workwellLayerNames[i]) == false) - { - listVectorNames.Add(workwellLayerNames[i]); - } - } - for (int i = 0; i < instrumenLayerNames.Count; i++) - { - if (listVectorNames.Contains(instrumenLayerNames[i]) == false) - { - listVectorNames.Add(instrumenLayerNames[i]); - } - } - for (int i = 0; i < pipefittingLayerNames.Count; i++) - { - if (listVectorNames.Contains(pipefittingLayerNames[i]) == false) - { - listVectorNames.Add(pipefittingLayerNames[i]); - } - } - FrmExportVector frm = new FrmExportVector(globeControl1, listVectorNames); - frm.ShowDialog(); - } string citySevenLineType = ""; string cityServerLineName = ""; /// - /// 绘制城市七线 功能按钮 - /// - /// - /// - private void 绘制城市七线buttonItem140_Click(object sender, EventArgs e) - { - FrmCitySevenLineType frm = new FrmCitySevenLineType(); - if (frm.ShowDialog() == DialogResult.OK) - { - globeControl1.Globe.Action = EnumAction3D.DrawPolyline; - m_isDrawCitySevenLine = true; - m_isDrawTunnel = false; - m_AddPipeLine = false; - this.citySevenLineType = frm.citySevenLineType; - this.cityServerLineName = frm.citySevenLineName; - switch (frm.citySevenLineType) - { - case "城市红线": - GSOLayer layerRed = globeControl1.Globe.Layers.GetLayerByCaption(frm.citySevenLineType); - if (layerRed != null) - { - globeControl1.Globe.DestLayerFeatureAdd = layerRed; - layerRed.Editable = true; - } - break; - case "城市橙线": - GSOLayer layerOrange = globeControl1.Globe.Layers.GetLayerByCaption(frm.citySevenLineType); - if (layerOrange != null) - { - globeControl1.Globe.DestLayerFeatureAdd = layerOrange; - layerOrange.Editable = true; - } - break; - case "城市黄线": - GSOLayer layerYellow = globeControl1.Globe.Layers.GetLayerByCaption(frm.citySevenLineType); - if (layerYellow != null) - { - globeControl1.Globe.DestLayerFeatureAdd = layerYellow; - layerYellow.Editable = true; - } - break; - case "城市绿线": - GSOLayer layerGreen = globeControl1.Globe.Layers.GetLayerByCaption(frm.citySevenLineType); - if (layerGreen != null) - { - globeControl1.Globe.DestLayerFeatureAdd = layerGreen; - layerGreen.Editable = true; - } - break; - case "城市蓝线": - GSOLayer layerBlue = globeControl1.Globe.Layers.GetLayerByCaption(frm.citySevenLineType); - if (layerBlue != null) - { - globeControl1.Globe.DestLayerFeatureAdd = layerBlue; - layerBlue.Editable = true; - } - break; - case "城市紫线": - GSOLayer layerPurple = globeControl1.Globe.Layers.GetLayerByCaption(frm.citySevenLineType); - if (layerPurple != null) - { - globeControl1.Globe.DestLayerFeatureAdd = layerPurple; - layerPurple.Editable = true; - } - break; - case "城市黑线": - GSOLayer layerBlack = globeControl1.Globe.Layers.GetLayerByCaption(frm.citySevenLineType); - if (layerBlack != null) - { - globeControl1.Globe.DestLayerFeatureAdd = layerBlack; - layerBlack.Editable = true; - } - break; - } - } - } - /// - /// 七线审核 功能按钮 - /// - /// - /// - private void 七线审核buttonItem141_Click(object sender, EventArgs e) - { - FrmCityServerLineAnalysis frm = new FrmCityServerLineAnalysis(globeControl1, m_PipelineLayerNames); - frm.ShowDialog(this); - } - - /// /// 间距分析 开始分析按钮 分析绘制的七线和管线的距离是否符合标准 /// /// @@ -7666,25 +6509,6 @@ } } - - - /// - /// 管线自动缩进 菜单 - /// - /// - /// - private void 管线自动缩进buttonItem140_Click(object sender, EventArgs e) - { - FrmPipelineIndented frm = new FrmPipelineIndented(globeControl1, m_PipelineLayerNames, workwellLayerNames); - frm.ShowDialog(this); - } - - private void btnExportCADs_Click(object sender, EventArgs e) - { - - } - - /// /// 统计指定图层在指定范围内的所有feature对象 /// @@ -7755,8 +6579,6 @@ } - - //设置图层为隐藏 private void setLayerVisible(string layerName) { @@ -7765,27 +6587,7 @@ globeControl1.Globe.Refresh(); } - /// - /// 连接数据库 - /// - /// - /// - private void buttonItem129_Click(object sender, EventArgs e) - { - //保存日志 - LogManager.saveLog(Utility.userName, this.buttonItemSJGL4_1.Text); - - FrmDatabaseParaSetting2 frm = new FrmDatabaseParaSetting2(globeControl1); - if (frm.ShowDialog() == DialogResult.OK) - { - ds = FrmDatabaseParaSetting2.ds; - if (ds != null) - { - ds.IsCloseSaved = false; - } - } - } - + /// /// 清除渲染结果 /// @@ -7803,112 +6605,8 @@ layerTemp.RemoveAllFeature(); globeControl1.Refresh(); } - - /// - /// 绘制垂线 - /// - /// - /// - private void drawCLine(GSOPoint3d fpt, GSOPoint3d tpt) - { - GSOGeoPolyline3D pline = new GSOGeoPolyline3D(); - GSOPoint3ds pts = new GSOPoint3ds(); - pts.Add(fpt); - pts.Add(tpt); - pline.AddPart(pts); - - GSOGeoPoint3D fptg = new GSOGeoPoint3D(); - GSOGeoPoint3D tptg = new GSOGeoPoint3D(); - fptg.X = fpt.X; - fptg.Y = fpt.Y; - fptg.Z = 0; - tptg.X = tpt.X; - tptg.Y = tpt.Y; - tptg.Z = 0; - - GSOFeature gf = new GSOFeature(); - gf.Geometry = pline; - - globeControl1.Globe.MemoryLayer.AddFeature(gf); - - } - /// - /// 红线审核 - /// - /// - /// - private void buttonItem138_Click_2(object sender, EventArgs e) - { - - } - /// - /// 比较两个点是否是同一个点 - /// - /// - /// - /// - private bool comparePoint(GSOPoint3d pt1, GSOPoint3d pt2) - { - double x1 = 0; double y1 = 0; - double x2 = 0; double y2 = 0; - x1 = pt1.X; - y1 = pt1.Y; - x2 = pt2.X; - y2 = pt2.Y; - if ((x1 == x2) && (y1 == y2)) - { - return true; - } - return false; - } - /// - /// 获得点到线的垂线距离及垂点 - /// - /// - /// - /// - /// - private void comparePointLine(GSOPoint3d point, GSOGeoPolyline3D line, out double length, out GSOPoint3d pointChuiDian) - { - GSOPoint3d lineStartPoint = line[0][0]; - GSOPoint3d lineEndPoint = line[0][1]; - GSOGeoPolyline3D lineAB = new GSOGeoPolyline3D(); - GSOPoint3ds pointsAB = new GSOPoint3ds(); - pointsAB.Add(point); - pointsAB.Add(lineStartPoint); - lineAB.AddPart(pointsAB); - double lengthAB = lineAB.GetSpaceLength(false, 6378137.0); - double xieLvAB = getXieLu("", point.X, point.Y, lineStartPoint.X, lineStartPoint.Y); - double xieLvBC = getXieLu("", lineStartPoint.X, lineStartPoint.Y, lineEndPoint.X, lineEndPoint.Y); - - double tanABC = Math.Abs(xieLvAB - xieLvBC) / (1 + xieLvAB * xieLvBC); - double angle = Math.Atan(tanABC); - //if (angle > Math.PI / 2) //落在外边 - //{ - // length = 0; - //} - double lengthAD = lengthAB * Math.Sin(angle); - length = Math.Abs(lengthAD); - double lengthBD = lengthAB * Math.Cos(angle); - - GSOPoint2d point2dStart = Latlon_2_XYZ(lineStartPoint.X, lineStartPoint.Y); - double bBC = point2dStart.Y - xieLvBC * point2dStart.X; - GSOPoint2d point2dEnd = new GSOPoint2d(); - point2dEnd.X = point2dStart.X + 100; - point2dEnd.Y = point2dEnd.X * xieLvBC + bBC; - point2dEnd = XYZ_2_Latlon(point2dEnd.X, point2dEnd.Y); - - GSOPoint3d pointEnd = new GSOPoint3d(); - pointEnd.X = point2dEnd.X; - pointEnd.Y = point2dEnd.Y; - GSOGeoPolyline3D lineYanShen = new GSOGeoPolyline3D(); - GSOPoint3ds pointsYanShen = new GSOPoint3ds(); - pointsYanShen.Add(lineStartPoint); - pointsYanShen.Add(pointEnd); - lineYanShen.AddPart(pointsYanShen); - GSOGeoPolyline3D lineSegment = lineYanShen.GetSegment(0, lengthBD); - pointChuiDian = lineSegment[0][1]; - } + + /// /// 获得斜率 /// @@ -8044,255 +6742,6 @@ } /// - /// 获取与点相连的所有线以及线的点的集合 - /// - /// 选定的点所在的线 - /// 选定的点 - /// 面中不完全包含的除起点线之外所有的线 - /// 选定的点所在的点的集合 - /// 所有以选定线为起点的点的集合 - /// - private List getFeaturesPoints(GSOFeature featureSelect, GSOPoint3d lineStart, GSOFeatures selectFeatures, GSOPoint3ds ps, List listPS) - { - GSOFeatures fsStart = new GSOFeatures(); - for (int n = 0; n < selectFeatures.Length; n++) - { - if (featureSelect.ID == selectFeatures[n].ID) - { - continue; - } - GSOGeoPolyline3D newLine = selectFeatures[n].Geometry as GSOGeoPolyline3D; - if (newLine != null && newLine.PartCount > 0) - { - GSOPoint3d newLineStart = newLine[0][0]; - GSOPoint3d newLineEnd = newLine[0][newLine[0].Count - 1]; - if (lineStart.X == newLineEnd.X && lineStart.Y == newLineEnd.Y) - { - GSOPoint3ds psAdd = new GSOPoint3ds(); - for (int k = newLine[0].Count - 1; k >= 0; k--) - { - psAdd.Add(newLine[0][k]); - } - newLine[0] = psAdd; - fsStart.Add(selectFeatures[n]); - - } - else if (lineStart.X == newLineStart.X && lineStart.Y == newLineStart.Y) - { - fsStart.Add(selectFeatures[n]); - - } - } - } - if (fsStart.Length > 0) - { - for (int m = 0; m < fsStart.Length; m++) - { - GSOGeoPolyline3D lineFsStart = fsStart[m].Geometry as GSOGeoPolyline3D; - if (lineFsStart != null && lineFsStart.PartCount > 0) - { - GSOPoint3ds psAdd = ps.Clone(); - for (int k = 0; k < lineFsStart[0].Count; k++) - { - psAdd.Add(lineFsStart[0][k]); - } - listPS = getFeaturesPoints(fsStart[m], lineFsStart[0][lineFsStart[0].Count - 1], selectFeatures, psAdd, listPS); - } - } - } - else - { - listPS.Add(ps); - } - return listPS; - } - - /// - /// 获取切割面的线 - /// - /// 不完全包含在面中的所有线 - /// 完全包含在面中的所有线 - /// 线 - private GSOFeature getLineFromGSOFeatures(GSOFeatures features, GSOFeatures featuresTrue) - { - //1. 当线对象数组的长度为0时,返回空 - if (features.Length == 0) - { - return null; - } - //2. 当线对象数组的长度为1时,返回这条线 - if (features.Length == 1) - { - return features[0]; - } - //3. 当线对象数组的长度大于1时,计算所有线组成的最长线 - - //3.1 获取所有不完全包含在面中的对象selectFeatures - GSOFeatures selectFeatures = new GSOFeatures(); - for (int a = 0; a < features.Length; a++) - { - selectFeatures.Add(features[a].Clone()); - } - //3.2 删除features中完全包含在面中的线,获取和面的边界相交的线对象 - for (int a = 0; a < featuresTrue.Length; a++) - { - for (int b = 0; b < features.Length; b++) - { - if (featuresTrue[a].ID == features[b].ID) - { - features.Remove(b); - break; - } - } - } - //3.3 如果和面的边界相交的线的数量为0,返回空 - if (features.Length == 0) - { - return null; - } - //3.4 获取第一条和面的边界相交的线featureInOutPolygon - GSOFeature featureInOutPolygon = features[0]; - //3.5 从所有的线中删除featureInOutPolygon - for (int a = 0; a < selectFeatures.Length; a++) - { - if (selectFeatures[a].ID == featureInOutPolygon.ID) - { - selectFeatures.Remove(a); - break; - } - } - //listPS存储所有从featureInOutPolygon出发的点的集合 - List listPS = new List(); - //3.5 获取与featureInOutPolygon相连的线的集合 - GSOGeoPolyline3D line = featureInOutPolygon.Geometry as GSOGeoPolyline3D; - if (line != null && line.PartCount > 0) - { - GSOPoint3d lineStart = line[0][0]; - GSOPoint3d lineEnd = line[0][line[0].Count - 1]; - #region//获取和featureInOutPolygon的起点相连的线 - GSOFeatures fsStart = new GSOFeatures(); - for (int n = 0; n < selectFeatures.Length; n++) - { - GSOGeoPolyline3D newLine = selectFeatures[n].Geometry as GSOGeoPolyline3D; - if (newLine != null && newLine.PartCount > 0) - { - GSOPoint3d newLineStart = newLine[0][0]; - GSOPoint3d newLineEnd = newLine[0][newLine[0].Count - 1]; - if (lineStart.X == newLineEnd.X && lineStart.Y == newLineEnd.Y) - { - GSOPoint3ds psAdd = new GSOPoint3ds(); - for (int k = newLine[0].Count - 1; k >= 0; k--) - { - psAdd.Add(newLine[0][k]); - } - newLine[0] = psAdd; - fsStart.Add(selectFeatures[n]); - - } - else if (lineStart.X == newLineStart.X && lineStart.Y == newLineStart.Y) - { - fsStart.Add(selectFeatures[n]); - } - } - } - #endregion - - #region//获取和featureInOutPolygon的终点相连的线 - GSOFeatures fsEnd = new GSOFeatures(); - for (int n = 0; n < selectFeatures.Length; n++) - { - GSOGeoPolyline3D newLine = selectFeatures[n].Geometry as GSOGeoPolyline3D; - if (newLine != null && newLine.PartCount > 0) - { - GSOPoint3d newLineStart = newLine[0][0]; - GSOPoint3d newLineEnd = newLine[0][newLine[0].Count - 1]; - if (lineEnd.X == newLineStart.X && lineEnd.Y == newLineStart.Y) - { - fsEnd.Add(selectFeatures[n]); - - } - else if (lineEnd.X == newLineEnd.X && lineEnd.Y == newLineEnd.Y) - { - GSOPoint3ds psAdd = new GSOPoint3ds(); - for (int k = newLine[0].Count - 1; k >= 0; k--) - { - psAdd.Add(newLine[0][k]); - } - newLine[0] = psAdd; - fsEnd.Add(selectFeatures[n]); - - } - } - } - #endregion - - //3.6 将featureInOutPolygon的所有点和与之起点相连的线的所有点组成一个点的集合并添加到listPS中 - if (fsStart.Length > 0 && fsEnd.Length == 0) - { - for (int m = 0; m < fsStart.Length; m++) - { - GSOGeoPolyline3D lineFsStart = fsStart[m].Geometry as GSOGeoPolyline3D; - if (lineFsStart != null && lineFsStart.PartCount > 0) - { - GSOPoint3ds psAdd = new GSOPoint3ds(); - for (int k = line[0].Count - 1; k >= 0; k--) - { - psAdd.Add(line[0][k]); - } - for (int k = 0; k < lineFsStart[0].Count; k++) - { - psAdd.Add(lineFsStart[0][k]); - } - - listPS = getFeaturesPoints(fsStart[m], lineFsStart[0][lineFsStart[0].Count - 1], selectFeatures, psAdd, listPS); - - } - } - } - //3.6 将featureInOutPolygon的所有点和与之终点相连的线的所有点组成一个点的集合并添加到listPS中 - else if (fsStart.Length == 0 && fsEnd.Length > 0) - { - for (int n = 0; n < fsEnd.Length; n++) - { - GSOGeoPolyline3D lineFsEnd = fsEnd[n].Geometry as GSOGeoPolyline3D; - if (lineFsEnd != null && lineFsEnd.PartCount > 0) - { - GSOPoint3ds psAdd = new GSOPoint3ds(); - for (int k = 0; k < line[0].Count - 1; k++) - { - psAdd.Add(line[0][k]); - } - for (int k = 0; k < lineFsEnd[0].Count; k++) - { - psAdd.Add(lineFsEnd[0][k]); - } - //获取线fsEnd[n]的另一个端点相连的线并记录该线的点的集合 - listPS = getFeaturesPoints(fsEnd[n], lineFsEnd[0][lineFsEnd[0].Count - 1], selectFeatures, psAdd, listPS); - } - } - } - } - - //3.7 获取所有以featureInOutPolygon为起点的点的集合组成的线中的最长的线 - double maxLength = 0; - GSOFeature featureNew = new GSOFeature(); - for (int h = 0; h < listPS.Count; h++) - { - GSOGeoPolyline3D lineNew = new GSOGeoPolyline3D(); - lineNew.AddPart(listPS[h]); - GSOLabel label = new GSOLabel(); - label.Text = h.ToString(); - featureNew.Label = label; - double length = lineNew.GetSpaceLength(true, 6378137); - if (length > maxLength) - { - featureNew.Geometry = lineNew; - } - } - - return featureNew; - } - /// /// 更新最大最小状态 /// /// @@ -8340,219 +6789,6 @@ - private void buttonItem139_Click(object sender, EventArgs e) - { - - string filepath = ""; - //日志记录 - OpenFileDialog dlg = new OpenFileDialog(); - dlg.Filter = "矢量数据(*.shp)|*.shp|矢量数据(*.lgd)|*.lgd|全部支持格式(*.lgd,*.shp)|*.lgd;*.shp;"; - //dlg.Filter = "支持格式(*.lrp,*.tif,*.img,*.lrc,*.kml,*.lgd,*.shp,*.gft)|*.lrp;*.tif;*.img;*.lrc;*.kml;*.lgd;*.shp;*.gft|栅格数据(*.lrp)|*.lrp|栅格缓存(*.lrc)|*.lrc|KML数据(*.kml)|*.kml|矢量数据(*.lgd)|*.lgd|矢量缓存(*.gft)|*.gft|其它格式(*.*)|*.*||"; - dlg.Multiselect = true; - if (dlg.ShowDialog() == DialogResult.OK) - { - //自定义lprj文件名,从程序中复制一lprj文件。 - int bindex = dlg.FileName.Split('\\').Length; - string lastname = dlg.FileName.Split('\\')[bindex - 1]; - - for (int i = 0; i < dlg.FileNames.Length; i++) - { - string strDataPath = dlg.FileNames[i]; - filepath = strDataPath; - - GSOLayer layer = globeControl1.Globe.Layers.Add(strDataPath); - - } - - } - //放大到红线 - - - // globeControl1.Globe.Layers.MoveTo(0, globeControl1.Globe.Layers.Count - 1); - // globeControl1.Globe.Layers.MoveTo(0,4); - globeControl1.Refresh(); - - - } - /// - /// - /// - /// - /// - private void buttonItem142_Click(object sender, EventArgs e) - { - //获得红线polygon - //GSOLayer layerSevenLine = globeControl1.Globe.Layers.GetLayerByCaption(redlinelayername); - - GSOLayer layerSevenLine = globeControl1.Globe.Layers.Add("D:\\data\\歌林小镇shp\\test.shp"); - //获得红线结果列表 - ArrayList rrLists = new ArrayList(); - - //if (redlinelayername != "") - { - GSOFeatures fs = layerSevenLine.GetAllFeatures(); - int len = fs.Length; - - GSOGeoPolygon3D sevenPolygon = new GSOGeoPolygon3D(); - for (int k = 0; k < len; k++) - {//多根红线 - ///////生成红线区域/////// - GSOFeature featSevenLine = layerSevenLine.GetAt(k); - GSOGeoPolyline3D sevenLine = featSevenLine.Geometry as GSOGeoPolyline3D; - - List sevenParts = new List(); - for (int i = 0; i < sevenLine.PartCount; i++) - { - sevenParts.Add(sevenLine[i]); - } - for (int i = 0; i < sevenParts.Count; i++) - { - sevenPolygon.AddPart((GSOPoint3ds)sevenParts[i]); - } - /////拼出红线多边形over////// - - } - //GSOLayer layer = globeControl1.Globe.Layers.GetLayerByCaption("天然气管线"); - - GSOLayer layer = globeControl1.Globe.Layers.Add("C:\\Users\\nn-203\\Desktop\\xiaobai\\test.lgd"); - //线切割面定义,输出用 - GSOFeatures resFeats = new GSOFeatures(); - int resultstyle = 0; - //管线切割红线区域后,面积较小的区域 - GSOGeoPolygon3D restPoly = new GSOGeoPolygon3D(); - List inpts = new List(); - if (layer != null) - { - //红线区域 - GSOFeature sevenfeature = new GSOFeature(); - sevenfeature.Geometry = sevenPolygon; - - //获取不完全包含在面中的所有线 - GSOFeatures feats = layer.FindFeaturesInPolygon(sevenPolygon, false); - //获取完全包含在面中的所有线 - GSOFeatures featsTrue = layer.FindFeaturesInPolygon(sevenPolygon, true); - //获取面中所有对象组成的切割面的长线 - GSOFeature feature = new GSOFeature(); - - feature = getLineFromGSOFeatures(feats, featsTrue);//管线多个feature拼成一个feature - - //globeControl1.Globe.MemoryLayer.AddFeature(feature); - //globeControl1.Globe.MemoryLayer.AddFeature(sevenfeature); - if (feature != null) - { - //线切割面,输出 - //feature.HighLight = true; - GSODataEngineUtility.GSLineClipPolygon(feature, sevenfeature, out resFeats, out resultstyle); - } - else - { - MessageBox.Show("没有找到切割面的线对象!"); - } - ////////////////绘制分割后的多边形/////////////// - for (int a = 0; a < resFeats.Length; a++) - { - - GSOFeature gf = resFeats[1]; - globeControl1.Globe.MemoryLayer.AddFeature(gf); - - } - } - - - } - } - - private void buttonItem143_Click(object sender, EventArgs e) - { - //获得红线polygon - GSOLayer layerSevenLine = globeControl1.Globe.Layers.Add("d:\\lineAndPolygon.lgd"); - GSOLayer layerSevenLine2 = globeControl1.Globe.Layers.GetLayerByCaption("d:\\lineAndPolygon.lgd"); - //获得红线结果列表 - ArrayList rrLists = new ArrayList(); - - - // if (redlinelayername != "") - { - GSOFeatures fs = layerSevenLine.GetAllFeatures(); - int len = fs.Length; - - GSOGeoPolyline3D linetest = new GSOGeoPolyline3D(); - GSOGeoPolygon3D sevenPolygon = new GSOGeoPolygon3D(); - - GSOFeature linefeat = fs.FindByID(2); - //linefeat.Geometry = linetest; - GSOFeature polyfeat = fs.FindByID(1); - //polyfeat.Geometry = sevenPolygon; - - //线切割面定义,输出用 - GSOFeatures resFeats = new GSOFeatures(); - int resultstyle = 0; - GSODataEngineUtility.GSLineClipPolygon(linefeat, polyfeat, out resFeats, out resultstyle); - - ////////////////绘制分割后的多边形/////////////// - for (int a = 0; a < resFeats.Length; a++) - { - - GSOFeature gf = resFeats[0]; - globeControl1.Globe.MemoryLayer.AddFeature(gf); - - } - ////把红线切成一段段的线段,获得切前的红线点集 - List redpts = new List();//切前的红线点集合 - for (int i = 0; i < linetest.PartCount; i++) - { - GSOPoint3ds partP = linetest[i]; - for (int j = 0; j < partP.Count; j++) - { - redpts.Add(partP[j]); - } - } - - List redpts2 = new List();//切前的红线点集合 - for (int i = 0; i < sevenPolygon.PartCount; i++) - { - GSOPoint3ds partP = sevenPolygon[i]; - for (int j = 0; j < partP.Count; j++) - { - redpts2.Add(partP[j]); - } - } - } - } - /// - /// 增加用户手册下载连接 - /// - /// - /// - Cyberpipe.udfiles.UpDownFile UDF = new udfiles.UpDownFile(Utility.udserviceurl); - string dir_Ok = "C:\\Users\\nn-203\\Desktop"; - private void button1_Click(object sender, EventArgs e) - { - if (folderBrowserDialog1.ShowDialog() == DialogResult.OK) //打洙?开a文?件t夹D对?话°框ò - { - dir_Ok = folderBrowserDialog1.SelectedPath; //显?示?选?择?的?文?件t夹D路·径? - - //tempstr = folderBrowserDialog1.SelectedPath; //存?储洹?选?择?的?文?件t夹D路·径? - - } - - Cyberpipe.PED_logicfile.PED_Affair.Redact_D = Utility.uploadpath + "\\SFiles\\UserHbook\\说明.docx"; - if (File.Exists(dir_Ok + "\\" + Files_Name(Cyberpipe.PED_logicfile.PED_Affair.Redact_D, 1))) - { - if (MessageBox.Show("文件夹下有同名文件,是否替换?", "提示", MessageBoxButtons.YesNo, MessageBoxIcon.Information) == DialogResult.No) ; - - } - byte[] file = UDF.Down(Cyberpipe.PED_logicfile.PED_Affair.Redact_D); - FileStream pFileSream = new FileStream(dir_Ok + "\\说明.docx", FileMode.OpenOrCreate); - pFileSream.Write(file, 0, file.Length); - pFileSream.Close(); - if (File.Exists(dir_Ok + "\\" + Files_Name(Cyberpipe.PED_logicfile.PED_Affair.Redact_D, 1)) == true) - { - MessageBox.Show("文件导出成功!"); - } - //PEDAClass.Folder_Handle(dir_Ok + "\\" + PEDAClass.Files_Name(Cyberpipe.PED_logicfile.PED_Affair.Redact_D, 0), Cyberpipe.PED_logicfile.PED_Affair.Redact_D, "", 0); - - } /// /// 获取文件或文件夹的名称 /// @@ -8575,33 +6811,6 @@ return DF_Name; } - private void toolStripDropDownButton1_Click(object sender, EventArgs e) - { - if (folderBrowserDialog1.ShowDialog() == DialogResult.OK) //打洙?开a文?件t夹D对?话°框ò - { - dir_Ok = folderBrowserDialog1.SelectedPath; //显?示?选?择?的?文?件t夹D路·径? - - //tempstr = folderBrowserDialog1.SelectedPath; //存?储洹?选?择?的?文?件t夹D路·径? - - - Cyberpipe.PED_logicfile.PED_Affair.Redact_D = Utility.uploadpath + "\\SFiles\\UserHbook\\说明.docx"; - if (File.Exists(dir_Ok + "\\" + Files_Name(Cyberpipe.PED_logicfile.PED_Affair.Redact_D, 1))) - { - if (MessageBox.Show("文件夹下有同名文件,是否替换?", "提示", MessageBoxButtons.YesNo, MessageBoxIcon.Information) == DialogResult.No) ; - - } - byte[] file = UDF.Down(Cyberpipe.PED_logicfile.PED_Affair.Redact_D); - FileStream pFileSream = new FileStream(dir_Ok + "\\说明.docx", FileMode.OpenOrCreate); - pFileSream.Write(file, 0, file.Length); - pFileSream.Close(); - if (File.Exists(dir_Ok + "\\" + Files_Name(Cyberpipe.PED_logicfile.PED_Affair.Redact_D, 1)) == true) - { - MessageBox.Show("文件导出成功!"); - } - - } - } - /// /// 空间查询 /// @@ -9792,7 +8001,7 @@ GSOLayer resLayer = null; GSOFeature resFeature = null; globeControl1.Globe.GetSelectObject(0, out resFeature, out resLayer); - + if (resFeature == null) return; GSOGeoPolyline3D line1 = resFeature.Geometry as GSOGeoPolyline3D; if (line1 == null) { @@ -9876,7 +8085,7 @@ GSOLayer resLayer = null; GSOFeature resFeature = null; globeControl1.Globe.GetSelectObject(0, out resFeature, out resLayer); - + if (resFeature == null) return; GSOGeoPolyline3D line1 = resFeature.Geometry as GSOGeoPolyline3D; if (line1 == null) { @@ -9891,7 +8100,8 @@ } GSOFeatures feats = globeControl1.Globe.MemoryLayer.GetFeatureByName("粒子要素", true); - if (feats.Length > 0) + + if (feats!=null&&feats.Length > 0) globeControl1.Globe.MemoryLayer.RemoveFeatureByID(feats[0].ID); //if (emitterFeature != null) //{ @@ -11121,88 +9331,6 @@ } private int connectServerCount = 0; - - /// - /// 还原球到实测库 - /// - private void refreshGlobe1() - { - //添加实测库图层已有图层 - int servernum = 0; - //1.清除global1上 - for (int i = globeControl1.Globe.Layers.Count - 1; i >= 0; i--) - { - GSOLayer layer = globeControl1.Globe.Layers[i]; - if (!layer.Name.Contains("fttp:")) - { - layer.Dataset.Close();//清除内存 - globeControl1.Globe.Layers.Remove(layer); - } - else - { - servernum++; - } - } - - //globeControl1.Globe.ConnectServer(Utility.serverip, Utility.serverport, "", ""); //加载locaServer中的数据 - - //2.添加实测库图层 - string[] markerStrs = new string[9]; - markerStrs[0] = "标高标注"; - markerStrs[1] = "管径标注"; - markerStrs[2] = "埋深标注"; - markerStrs[3] = "坐标标注"; - markerStrs[4] = "坡度标注"; - markerStrs[5] = "属性标注"; - markerStrs[6] = "自定义标注"; - markerStrs[7] = "距离标注"; - markerStrs[8] = "扯旗标注"; - for (int i = 0; i < markerStrs.Length; i++) - { - if (File.Exists(Application.StartupPath + "\\标注管理\\" + markerStrs[i] + ".lgd")) - { - GSOLayer markerLayer = globeControl1.Globe.Layers.Add(Application.StartupPath + "\\标注管理\\" + markerStrs[i] + ".lgd"); - } - } - - for (int i = 0; i < g1layername.Count; i++) - { - string g1name = g1layername[i]; - GSODataset datasetg1 = Utility.dataSource.GetDatasetByName(g1name); - GSOLayer templayer = globeControl1.Globe.Layers.Add(datasetg1); - templayer.MaxVisibleAltitude = -1; - } - layerTemp = globeControl1.Globe.Layers.Add(Application.StartupPath + "\\tempLgdData.lgd"); - globeControl1.Globe.Layers.Add(Application.StartupPath + "/城市七线/城市红线.lgd"); - globeControl1.Globe.Layers.Add(Application.StartupPath + "/城市七线/城市橙线.lgd"); - globeControl1.Globe.Layers.Add(Application.StartupPath + "/城市七线/城市黄线.lgd"); - globeControl1.Globe.Layers.Add(Application.StartupPath + "/城市七线/城市绿线.lgd"); - globeControl1.Globe.Layers.Add(Application.StartupPath + "/城市七线/城市蓝线.lgd"); - globeControl1.Globe.Layers.Add(Application.StartupPath + "/城市七线/城市紫线.lgd"); - globeControl1.Globe.Layers.Add(Application.StartupPath + "/城市七线/城市黑线.lgd"); - globeControl1.Globe.Layers.Add(Application.StartupPath + "/隧道.lgd"); - - //移动server的数据图层 - for (int i = 0; i < servernum; i++) - { - globeControl1.Globe.Layers.MoveTo(globeControl1.Globe.Layers.Count - 1, 0); - } - - if (layerManagerNode.Nodes.Count > 0) - { - for (int i = layerManagerNode.Nodes.Count - 1; i >= 0; i--) - { - layerManagerNode.Nodes[i].Remove(); - - } - } - - - - globeControl1.Refresh(); - - } - /// /// 碰撞审查 /// @@ -11476,31 +9604,7 @@ // } //} #endregion - /// - /// 数据质量检查 - /// - /// - /// - private void buttonItemSJGL2_Click(object sender, EventArgs e) - { - //日志记录 - LogManager.saveLog(Utility.userName, this.buttonItemSJGL2.Text); - FrmValiData frm = new FrmValiData(globeControl1); - frm.ShowDialog(); - } - /// - /// 数据预处理 - /// - /// - /// - private void buttonItemSJGL3_Click(object sender, EventArgs e) - { - //保存日志 - LogManager.saveLog(Utility.userName, this.buttonItemSJGL3.Text); - FrmEditShapeFile frm = new FrmEditShapeFile(globeControl1); - frm.ShowDialog(this); - } /// /// 连接数据库 /// @@ -12251,60 +10355,6 @@ List lineStruct = new List(); GSOFeature featureSelected = null; - private void AddDatagridView(DataTable table) - { - - if (table != null && table.Rows.Count > 0) - { - dataGridViewX1.DataSource = table; - panelOfTable.Visible = true; - panelOfTable.Height = 200; - toolStripNumbers.Text = "红线审核结果"; - toolStripFeatureLength.Text = " 共有:" + table.Rows.Count + "条"; - } - else - { - - } - - } - - /// - /// 去除集合中重复的管线 - /// - /// - /// - /// - private GSOFeatures getFeaturesByFilter(GSOFeatures features, string fieldName) - { - if (features == null) - { - return null; - } - GSOFeatures featuresGet = new GSOFeatures(); - for (int i = 0; i < features.Length; i++) - { - GSOFeature featureFromFS = features[i]; - string fieldValueFromFS = featureFromFS.GetValue(fieldName).ToString().Trim(); - bool isHas = false; - for (int j = featuresGet.Length - 1; j >= 0; j--) - { - GSOFeature featureFromFSGet = featuresGet[j]; - string fieldValueFromFSGet = featureFromFSGet.GetValue(fieldName).ToString().Trim(); - if (fieldValueFromFS.Equals(fieldValueFromFSGet)) - { - isHas = true; - break; - } - } - if (isHas == false) - { - featuresGet.Add(featureFromFS.Clone()); - } - } - return featuresGet; - } - /// /// 数据管理导入文件 /// @@ -12440,138 +10490,7 @@ // //MessageBox.Show("系统运行错误:" + ex.ToString(), "错误", MessageBoxButtons.OK, MessageBoxIcon.Error); // } //} - - - /// - /// 标识器全区域统计 - /// - /// - /// - private void 标识器分类统计ToolStripMenuItem_Click(object sender, EventArgs e) - { - globeControl1.Globe.Action = EnumAction3D.ActionNull; - FrmBSQStatis bsqStatis = new FrmBSQStatis(); - bsqStatis.Show(this); - } - /// - /// 标识器绘制区域统计 - /// - /// - /// - private void 标识器分类统计ToolStripMenuItem1_Click(object sender, EventArgs e) - { - trackflag = "BSQDuoBianXiangStatis"; - globeControl1.Globe.Action = EnumAction3D.TrackPolygon; - } - - - #region 保存和加载审核库加载的图层 - private void saveLayerList(TreeNodeCollection treeNodeList) - { - string configPath = Application.StartupPath + "\\configLayerList.xml"; - try - { - XmlDocument doc = new XmlDocument(); - doc.Load(configPath); - XmlNode dbParams = doc.SelectSingleNode("Params/dbparams"); - XmlNode dbLayers = doc.SelectSingleNode("Params/dblayers"); - XmlNode layers = doc.SelectSingleNode("Params/layers"); - dbParams.RemoveAll(); - dbLayers.RemoveAll(); - layers.RemoveAll(); - - List listDS = new List(); - String shDatasourceName = Utility.sgdbip + "/" + Utility.sgdbname + "_" + Utility.sgdbuser; - bool flag = false; - - for (int i = 0; i < globeControl1.Globe.DataManager.DataSourceCount; i++) - { - GSODataSource ds = globeControl1.Globe.DataManager.GetDataSourceAt(i); - if (ds != null && ds.Type == EnumDataSourceType.SqlServer || ds.Type == EnumDataSourceType.Oracle) - { - if (ds.Name == shDatasourceName) - { - //防止因为多次连接同一个数据库 - if (flag == true) - { - break; - } - flag = true; - listDS.Add(ds); - GSODataSourceCnn conn = ds.GetConnectionInfo(); - - XmlElement dbparam = doc.CreateElement("shdbparam"); - XmlElement ip = doc.CreateElement("ship"); - ip.InnerText = conn.Server; - - XmlElement dbname = doc.CreateElement("shdbname"); - dbname.InnerText = conn.Database; - - XmlElement username = doc.CreateElement("shusername"); - username.InnerText = conn.User; - - XmlElement password = doc.CreateElement("shpassword"); - password.InnerText = conn.Password; - - XmlElement type = doc.CreateElement("shtype"); - if (ds.Type == EnumDataSourceType.SqlServer) - { - type.InnerText = "sqlserver"; - } - else - { - type.InnerText = "oracle"; - } - - dbparam.AppendChild(ip); - dbparam.AppendChild(dbname); - dbparam.AppendChild(username); - dbparam.AppendChild(password); - dbparam.AppendChild(type); - dbParams.AppendChild(dbparam); - } - - } - } - - for (int i = 0; i < treeNodeList.Count; i++) - { - GSOLayer layer = treeNodeList[i].Tag as GSOLayer; - if (Path.GetExtension(layer.Name) == "") - { - XmlElement dbLayer = doc.CreateElement("dblayer"); - XmlAttribute attri = doc.CreateAttribute("dbindex"); - for (int j = 0; j < listDS.Count; j++) - { - if (layer.Dataset.DataSource.Name == listDS[j].Name) - { - attri.Value = j.ToString(); - break; - } - } - dbLayer.Attributes.Append(attri); - dbLayer.InnerText = layer.Name; - - dbLayers.AppendChild(dbLayer); - } - else - { - XmlElement dbLayer = doc.CreateElement("layer"); - dbLayer.InnerText = layer.Name; - layers.AppendChild(dbLayer); - } - } - - doc.Save(configPath); - } - catch (Exception e) - { - - } - } - - #endregion - + private void buttonItem_TaskManager_Click(object sender, EventArgs e) { if (Form_TaksManager.IS_OPEN) diff --git a/MainFrm.designer.cs b/MainFrm.designer.cs index 233ef8c..97b8299 100644 --- a/MainFrm.designer.cs +++ b/MainFrm.designer.cs @@ -82,6 +82,7 @@ this.sideBar1 = new DevComponents.DotNetBar.SideBar(); this.panelEx3 = new DevComponents.DotNetBar.PanelEx(); this.layerSensorTree = new System.Windows.Forms.TreeView(); + this.layerTree = new Cyberpipe.MyTreeView(); this.sideBarPanelItem3 = new DevComponents.DotNetBar.SideBarPanelItem(); this.controlContainerItem3 = new DevComponents.DotNetBar.ControlContainerItem(); this.sideBarPanelItem4 = new DevComponents.DotNetBar.SideBarPanelItem(); @@ -365,30 +366,26 @@ this.可编辑ToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); this.保存ToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); this.ribbonControl1 = new DevComponents.DotNetBar.RibbonControl(); - this.ribbonPanel1 = new DevComponents.DotNetBar.RibbonPanel(); - this.ribbonBar21 = new DevComponents.DotNetBar.RibbonBar(); - this.buttonItem87 = new DevComponents.DotNetBar.ButtonItem(); - this.buttonItem88 = new DevComponents.DotNetBar.ButtonItem(); - this.buttonItem27 = new DevComponents.DotNetBar.ButtonItem(); - this.buttonItem91 = new DevComponents.DotNetBar.ButtonItem(); - this.buttonItem1 = new DevComponents.DotNetBar.ButtonItem(); - this.btnlegendSet = new DevComponents.DotNetBar.ButtonItem(); - this.buttonItem89 = new DevComponents.DotNetBar.ButtonItem(); - this.ribbonPanel7 = new DevComponents.DotNetBar.RibbonPanel(); - this.ribbonBar5 = new DevComponents.DotNetBar.RibbonBar(); - this.btn_flag = new DevComponents.DotNetBar.ButtonItem(); - this.slider4ground = new DevComponents.DotNetBar.SliderItem(); - this.ribbonPanel2 = new DevComponents.DotNetBar.RibbonPanel(); - this.ribbonBar4 = new DevComponents.DotNetBar.RibbonBar(); - this.buttonItem_TaskManager = new DevComponents.DotNetBar.ButtonItem(); - this.buttonItem_OnlineTask = new DevComponents.DotNetBar.ButtonItem(); - this.buttonItem_Event = new DevComponents.DotNetBar.ButtonItem(); this.ribbonPanel3 = new DevComponents.DotNetBar.RibbonPanel(); this.ribbonBar3 = new DevComponents.DotNetBar.RibbonBar(); this.btn_device = new DevComponents.DotNetBar.ButtonItem(); this.btn_Person = new DevComponents.DotNetBar.ButtonItem(); this.btn_constructMap = new DevComponents.DotNetBar.ButtonItem(); this.buttonItem9 = new DevComponents.DotNetBar.ButtonItem(); + this.ribbonPanel2 = new DevComponents.DotNetBar.RibbonPanel(); + this.ribbonBar4 = new DevComponents.DotNetBar.RibbonBar(); + this.buttonItem_TaskManager = new DevComponents.DotNetBar.ButtonItem(); + this.buttonItem_OnlineTask = new DevComponents.DotNetBar.ButtonItem(); + this.buttonItem_Event = new DevComponents.DotNetBar.ButtonItem(); + this.ribbonPanel1 = new DevComponents.DotNetBar.RibbonPanel(); + this.ribbonBar21 = new DevComponents.DotNetBar.RibbonBar(); + this.buttonItem87 = new DevComponents.DotNetBar.ButtonItem(); + this.buttonItem88 = new DevComponents.DotNetBar.ButtonItem(); + this.buttonItem27 = new DevComponents.DotNetBar.ButtonItem(); + this.buttonItem1 = new DevComponents.DotNetBar.ButtonItem(); + this.buttonItem91 = new DevComponents.DotNetBar.ButtonItem(); + this.btnlegendSet = new DevComponents.DotNetBar.ButtonItem(); + this.buttonItem89 = new DevComponents.DotNetBar.ButtonItem(); this.ribbonPanel8 = new DevComponents.DotNetBar.RibbonPanel(); this.ribbonBar_UserInfo = new DevComponents.DotNetBar.RibbonBar(); this.btn_user_info = new DevComponents.DotNetBar.ButtonItem(); @@ -398,6 +395,10 @@ this.btn_user_role = new DevComponents.DotNetBar.ButtonItem(); this.btn_password_edit = new DevComponents.DotNetBar.ButtonItem(); this.btn_reset_password = new DevComponents.DotNetBar.ButtonItem(); + this.ribbonPanel7 = new DevComponents.DotNetBar.RibbonPanel(); + this.ribbonBar5 = new DevComponents.DotNetBar.RibbonBar(); + this.btn_flag = new DevComponents.DotNetBar.ButtonItem(); + this.slider4ground = new DevComponents.DotNetBar.SliderItem(); this.ribbonPanel15 = new DevComponents.DotNetBar.RibbonPanel(); this.ribbonBar20 = new DevComponents.DotNetBar.RibbonBar(); this.buttonItemSJGL = new DevComponents.DotNetBar.ButtonItem(); @@ -610,7 +611,6 @@ this.buttonItem84 = new DevComponents.DotNetBar.ButtonItem(); this.buttonItem75 = new DevComponents.DotNetBar.ButtonItem(); this.buttonItem76 = new DevComponents.DotNetBar.ButtonItem(); - this.layerTree = new Cyberpipe.MyTreeView(); this.statusStrip1.SuspendLayout(); this.sideBar1.SuspendLayout(); this.panelEx3.SuspendLayout(); @@ -647,11 +647,11 @@ this.contextMenuStrip3.SuspendLayout(); this.contextMenuStripDeleteLayerNode.SuspendLayout(); this.ribbonControl1.SuspendLayout(); - this.ribbonPanel1.SuspendLayout(); - this.ribbonPanel7.SuspendLayout(); - this.ribbonPanel2.SuspendLayout(); this.ribbonPanel3.SuspendLayout(); + this.ribbonPanel2.SuspendLayout(); + this.ribbonPanel1.SuspendLayout(); this.ribbonPanel8.SuspendLayout(); + this.ribbonPanel7.SuspendLayout(); this.ribbonPanel15.SuspendLayout(); ((System.ComponentModel.ISupportInitialize)(this.pictureBox1)).BeginInit(); this.SuspendLayout(); @@ -813,7 +813,6 @@ this.toolStripDropDownButton1.Size = new System.Drawing.Size(45, 21); this.toolStripDropDownButton1.Text = "帮助"; this.toolStripDropDownButton1.Visible = false; - this.toolStripDropDownButton1.Click += new System.EventHandler(this.toolStripDropDownButton1_Click); // // controlContainerItem1 // @@ -1047,6 +1046,16 @@ this.layerSensorTree.AfterCheck += new System.Windows.Forms.TreeViewEventHandler(this.layerMarkerTree_AfterCheck); this.layerSensorTree.NodeMouseClick += new System.Windows.Forms.TreeNodeMouseClickEventHandler(this.layerMarkerTree_NodeMouseClick); // + // layerTree + // + this.layerTree.CheckBoxes = true; + this.layerTree.ItemHeight = 18; + this.layerTree.Location = new System.Drawing.Point(30, 78); + this.layerTree.Name = "layerTree"; + this.layerTree.Size = new System.Drawing.Size(121, 97); + this.layerTree.TabIndex = 1; + this.layerTree.AfterCheck += new System.Windows.Forms.TreeViewEventHandler(this.layerTree_AfterCheck); + // // sideBarPanelItem3 // this.sideBarPanelItem3.FontBold = true; @@ -2966,28 +2975,28 @@ // 平移对象ToolStripMenuItem // this.平移对象ToolStripMenuItem.Name = "平移对象ToolStripMenuItem"; - this.平移对象ToolStripMenuItem.Size = new System.Drawing.Size(152, 22); + this.平移对象ToolStripMenuItem.Size = new System.Drawing.Size(124, 22); this.平移对象ToolStripMenuItem.Text = "平移对象"; this.平移对象ToolStripMenuItem.Click += new System.EventHandler(this.buttonItemBJ6_Click); // // 升降对象ToolStripMenuItem // this.升降对象ToolStripMenuItem.Name = "升降对象ToolStripMenuItem"; - this.升降对象ToolStripMenuItem.Size = new System.Drawing.Size(152, 22); + this.升降对象ToolStripMenuItem.Size = new System.Drawing.Size(124, 22); this.升降对象ToolStripMenuItem.Text = "升降对象"; this.升降对象ToolStripMenuItem.Click += new System.EventHandler(this.buttonItemBJ7_Click); // // 旋转对象ToolStripMenuItem // this.旋转对象ToolStripMenuItem.Name = "旋转对象ToolStripMenuItem"; - this.旋转对象ToolStripMenuItem.Size = new System.Drawing.Size(152, 22); + this.旋转对象ToolStripMenuItem.Size = new System.Drawing.Size(124, 22); this.旋转对象ToolStripMenuItem.Text = "旋转对象"; this.旋转对象ToolStripMenuItem.Click += new System.EventHandler(this.buttonItemBJ8_Click); // // 连接管段ToolStripMenuItem // this.连接管段ToolStripMenuItem.Name = "连接管段ToolStripMenuItem"; - this.连接管段ToolStripMenuItem.Size = new System.Drawing.Size(152, 22); + this.连接管段ToolStripMenuItem.Size = new System.Drawing.Size(124, 22); this.连接管段ToolStripMenuItem.Text = "连接管段"; this.连接管段ToolStripMenuItem.Click += new System.EventHandler(this.buttonItemBJ9_Click); // @@ -2997,34 +3006,34 @@ this.导出CADToolStripMenuItem, this.导出文件ToolStripMenuItem1}); this.导出文件ToolStripMenuItem.Name = "导出文件ToolStripMenuItem"; - this.导出文件ToolStripMenuItem.Size = new System.Drawing.Size(152, 22); + this.导出文件ToolStripMenuItem.Size = new System.Drawing.Size(124, 22); this.导出文件ToolStripMenuItem.Text = "导出矢量"; // // 导出CADToolStripMenuItem // this.导出CADToolStripMenuItem.Name = "导出CADToolStripMenuItem"; - this.导出CADToolStripMenuItem.Size = new System.Drawing.Size(152, 22); + this.导出CADToolStripMenuItem.Size = new System.Drawing.Size(125, 22); this.导出CADToolStripMenuItem.Text = "导出CAD"; this.导出CADToolStripMenuItem.Click += new System.EventHandler(this.buttonItemBJ10_1_Click); // // 导出文件ToolStripMenuItem1 // this.导出文件ToolStripMenuItem1.Name = "导出文件ToolStripMenuItem1"; - this.导出文件ToolStripMenuItem1.Size = new System.Drawing.Size(152, 22); + this.导出文件ToolStripMenuItem1.Size = new System.Drawing.Size(125, 22); this.导出文件ToolStripMenuItem1.Text = "导出文件"; this.导出文件ToolStripMenuItem1.Click += new System.EventHandler(this.buttonItemBJ10_2_Click); // // 前进ToolStripMenuItem // this.前进ToolStripMenuItem.Name = "前进ToolStripMenuItem"; - this.前进ToolStripMenuItem.Size = new System.Drawing.Size(152, 22); + this.前进ToolStripMenuItem.Size = new System.Drawing.Size(124, 22); this.前进ToolStripMenuItem.Text = "前进"; this.前进ToolStripMenuItem.Click += new System.EventHandler(this.buttonItemBJ12_Click); // // 删除模型ToolStripMenuItem // this.删除模型ToolStripMenuItem.Name = "删除模型ToolStripMenuItem"; - this.删除模型ToolStripMenuItem.Size = new System.Drawing.Size(152, 22); + this.删除模型ToolStripMenuItem.Size = new System.Drawing.Size(124, 22); this.删除模型ToolStripMenuItem.Text = "后退"; this.删除模型ToolStripMenuItem.Click += new System.EventHandler(this.buttonItemBJ11_Click); // @@ -4160,6 +4169,198 @@ this.ribbonControl1.Text = "ribbonControl1"; this.ribbonControl1.UseCustomizeDialog = false; // + // ribbonPanel3 + // + this.ribbonPanel3.ColorSchemeStyle = DevComponents.DotNetBar.eDotNetBarStyle.StyleManagerControlled; + this.ribbonPanel3.Controls.Add(this.ribbonBar3); + this.ribbonPanel3.Dock = System.Windows.Forms.DockStyle.Fill; + this.ribbonPanel3.Location = new System.Drawing.Point(0, 33); + this.ribbonPanel3.Name = "ribbonPanel3"; + this.ribbonPanel3.Padding = new System.Windows.Forms.Padding(3, 0, 3, 3); + this.ribbonPanel3.Size = new System.Drawing.Size(1328, 62); + // + // + // + this.ribbonPanel3.Style.Class = ""; + this.ribbonPanel3.Style.CornerType = DevComponents.DotNetBar.eCornerType.Square; + // + // + // + this.ribbonPanel3.StyleMouseDown.Class = ""; + this.ribbonPanel3.StyleMouseDown.CornerType = DevComponents.DotNetBar.eCornerType.Square; + // + // + // + this.ribbonPanel3.StyleMouseOver.Class = ""; + this.ribbonPanel3.StyleMouseOver.CornerType = DevComponents.DotNetBar.eCornerType.Square; + this.ribbonPanel3.TabIndex = 40; + // + // ribbonBar3 + // + this.ribbonBar3.AutoOverflowEnabled = true; + // + // + // + this.ribbonBar3.BackgroundMouseOverStyle.Class = ""; + this.ribbonBar3.BackgroundMouseOverStyle.CornerType = DevComponents.DotNetBar.eCornerType.Square; + // + // + // + this.ribbonBar3.BackgroundStyle.Class = ""; + this.ribbonBar3.BackgroundStyle.CornerType = DevComponents.DotNetBar.eCornerType.Square; + this.ribbonBar3.ContainerControlProcessDialogKey = true; + this.ribbonBar3.Dock = System.Windows.Forms.DockStyle.Left; + this.ribbonBar3.Items.AddRange(new DevComponents.DotNetBar.BaseItem[] { + this.btn_device, + this.btn_Person, + this.btn_constructMap, + this.buttonItem9}); + this.ribbonBar3.Location = new System.Drawing.Point(3, 0); + this.ribbonBar3.Name = "ribbonBar3"; + this.ribbonBar3.Size = new System.Drawing.Size(378, 59); + this.ribbonBar3.Style = DevComponents.DotNetBar.eDotNetBarStyle.StyleManagerControlled; + this.ribbonBar3.TabIndex = 0; + // + // + // + this.ribbonBar3.TitleStyle.Class = ""; + this.ribbonBar3.TitleStyle.CornerType = DevComponents.DotNetBar.eCornerType.Square; + // + // + // + this.ribbonBar3.TitleStyleMouseOver.Class = ""; + this.ribbonBar3.TitleStyleMouseOver.CornerType = DevComponents.DotNetBar.eCornerType.Square; + this.ribbonBar3.TitleVisible = false; + // + // btn_device + // + this.btn_device.ButtonStyle = DevComponents.DotNetBar.eButtonStyle.ImageAndText; + this.btn_device.Image = global::Cyberpipe.Properties.Resources._24X24__2__02; + this.btn_device.ImagePosition = DevComponents.DotNetBar.eImagePosition.Top; + this.btn_device.Name = "btn_device"; + this.btn_device.SubItemsExpandWidth = 14; + this.btn_device.Text = "探测仪管理"; + this.btn_device.Click += new System.EventHandler(this.btn_device_Click); + // + // btn_Person + // + this.btn_Person.ButtonStyle = DevComponents.DotNetBar.eButtonStyle.ImageAndText; + this.btn_Person.Image = global::Cyberpipe.Properties.Resources._24x24icon_05_hover1; + this.btn_Person.ImagePosition = DevComponents.DotNetBar.eImagePosition.Top; + this.btn_Person.Name = "btn_Person"; + this.btn_Person.SubItemsExpandWidth = 14; + this.btn_Person.Text = "定位人员维护"; + this.btn_Person.Click += new System.EventHandler(this.btn_Person_Click); + // + // btn_constructMap + // + this.btn_constructMap.Image = global::Cyberpipe.Properties.Resources._24x24icon_04_hover; + this.btn_constructMap.ImagePosition = DevComponents.DotNetBar.eImagePosition.Top; + this.btn_constructMap.Name = "btn_constructMap"; + this.btn_constructMap.SubItemsExpandWidth = 14; + this.btn_constructMap.Text = "导出施工图"; + this.btn_constructMap.Click += new System.EventHandler(this.btn_constructMap_Click); + // + // buttonItem9 + // + this.buttonItem9.Image = global::Cyberpipe.Properties.Resources._24x24icon__2__10; + this.buttonItem9.ImagePosition = DevComponents.DotNetBar.eImagePosition.Top; + this.buttonItem9.Name = "buttonItem9"; + this.buttonItem9.SubItemsExpandWidth = 14; + this.buttonItem9.Text = "文档管理"; + this.buttonItem9.Click += new System.EventHandler(this.buttonItem9_Click); + // + // ribbonPanel2 + // + this.ribbonPanel2.ColorSchemeStyle = DevComponents.DotNetBar.eDotNetBarStyle.StyleManagerControlled; + this.ribbonPanel2.Controls.Add(this.ribbonBar4); + this.ribbonPanel2.Dock = System.Windows.Forms.DockStyle.Fill; + this.ribbonPanel2.Location = new System.Drawing.Point(0, 0); + this.ribbonPanel2.Name = "ribbonPanel2"; + this.ribbonPanel2.Padding = new System.Windows.Forms.Padding(3, 0, 3, 3); + this.ribbonPanel2.Size = new System.Drawing.Size(1328, 95); + // + // + // + this.ribbonPanel2.Style.Class = ""; + this.ribbonPanel2.Style.CornerType = DevComponents.DotNetBar.eCornerType.Square; + // + // + // + this.ribbonPanel2.StyleMouseDown.Class = ""; + this.ribbonPanel2.StyleMouseDown.CornerType = DevComponents.DotNetBar.eCornerType.Square; + // + // + // + this.ribbonPanel2.StyleMouseOver.Class = ""; + this.ribbonPanel2.StyleMouseOver.CornerType = DevComponents.DotNetBar.eCornerType.Square; + this.ribbonPanel2.TabIndex = 39; + this.ribbonPanel2.Visible = false; + // + // ribbonBar4 + // + this.ribbonBar4.AutoOverflowEnabled = true; + // + // + // + this.ribbonBar4.BackgroundMouseOverStyle.Class = ""; + this.ribbonBar4.BackgroundMouseOverStyle.CornerType = DevComponents.DotNetBar.eCornerType.Square; + // + // + // + this.ribbonBar4.BackgroundStyle.Class = ""; + this.ribbonBar4.BackgroundStyle.CornerType = DevComponents.DotNetBar.eCornerType.Square; + this.ribbonBar4.ContainerControlProcessDialogKey = true; + this.ribbonBar4.Dock = System.Windows.Forms.DockStyle.Left; + this.ribbonBar4.Items.AddRange(new DevComponents.DotNetBar.BaseItem[] { + this.buttonItem_TaskManager, + this.buttonItem_OnlineTask, + this.buttonItem_Event}); + this.ribbonBar4.Location = new System.Drawing.Point(3, 0); + this.ribbonBar4.Name = "ribbonBar4"; + this.ribbonBar4.Size = new System.Drawing.Size(299, 92); + this.ribbonBar4.Style = DevComponents.DotNetBar.eDotNetBarStyle.StyleManagerControlled; + this.ribbonBar4.TabIndex = 0; + this.ribbonBar4.Text = "ribbonBar4"; + // + // + // + this.ribbonBar4.TitleStyle.Class = ""; + this.ribbonBar4.TitleStyle.CornerType = DevComponents.DotNetBar.eCornerType.Square; + // + // + // + this.ribbonBar4.TitleStyleMouseOver.Class = ""; + this.ribbonBar4.TitleStyleMouseOver.CornerType = DevComponents.DotNetBar.eCornerType.Square; + this.ribbonBar4.TitleVisible = false; + // + // buttonItem_TaskManager + // + this.buttonItem_TaskManager.Image = global::Cyberpipe.Properties.Resources._24x24icon__2__76; + this.buttonItem_TaskManager.ImagePosition = DevComponents.DotNetBar.eImagePosition.Top; + this.buttonItem_TaskManager.Name = "buttonItem_TaskManager"; + this.buttonItem_TaskManager.SubItemsExpandWidth = 14; + this.buttonItem_TaskManager.Text = "工单管理"; + this.buttonItem_TaskManager.Click += new System.EventHandler(this.buttonItem_TaskManager_Click); + // + // buttonItem_OnlineTask + // + this.buttonItem_OnlineTask.Image = global::Cyberpipe.Properties.Resources._24x24icon__2__69; + this.buttonItem_OnlineTask.ImagePosition = DevComponents.DotNetBar.eImagePosition.Top; + this.buttonItem_OnlineTask.Name = "buttonItem_OnlineTask"; + this.buttonItem_OnlineTask.SubItemsExpandWidth = 14; + this.buttonItem_OnlineTask.Text = "在线任务"; + this.buttonItem_OnlineTask.Click += new System.EventHandler(this.buttonItem_OnlineTask_Click); + // + // buttonItem_Event + // + this.buttonItem_Event.Image = global::Cyberpipe.Properties.Resources._24x24icon__2__72; + this.buttonItem_Event.ImagePosition = DevComponents.DotNetBar.eImagePosition.Top; + this.buttonItem_Event.Name = "buttonItem_Event"; + this.buttonItem_Event.SubItemsExpandWidth = 14; + this.buttonItem_Event.Text = "事件管理"; + this.buttonItem_Event.Click += new System.EventHandler(this.buttonItem_Event_Click); + // // ribbonPanel1 // this.ribbonPanel1.AutoSize = true; @@ -4262,6 +4463,15 @@ this.buttonItem27.Visible = false; this.buttonItem27.Click += new System.EventHandler(this.buttonItem27_Click); // + // buttonItem1 + // + this.buttonItem1.Image = global::Cyberpipe.Properties.Resources._24x24icon__2__94; + this.buttonItem1.ImagePosition = DevComponents.DotNetBar.eImagePosition.Top; + this.buttonItem1.Name = "buttonItem1"; + this.buttonItem1.SubItemsExpandWidth = 14; + this.buttonItem1.Text = "图层管理"; + this.buttonItem1.Click += new System.EventHandler(this.buttonItem1_Click); + // // buttonItem91 // this.buttonItem91.ForeColor = System.Drawing.Color.Black; @@ -4272,15 +4482,6 @@ this.buttonItem91.Text = "快速定位"; this.buttonItem91.Click += new System.EventHandler(this.buttonItem91_Click); // - // buttonItem1 - // - this.buttonItem1.Image = global::Cyberpipe.Properties.Resources._24x24icon__2__94; - this.buttonItem1.ImagePosition = DevComponents.DotNetBar.eImagePosition.Top; - this.buttonItem1.Name = "buttonItem1"; - this.buttonItem1.SubItemsExpandWidth = 14; - this.buttonItem1.Text = "图层管理"; - this.buttonItem1.Click += new System.EventHandler(this.buttonItem1_Click); - // // btnlegendSet // this.btnlegendSet.Image = global::Cyberpipe.Properties.Resources._24x24icon__2__93; @@ -4300,278 +4501,6 @@ this.buttonItem89.Visible = false; this.buttonItem89.Click += new System.EventHandler(this.buttonItem89_Click); // - // ribbonPanel7 - // - this.ribbonPanel7.ColorSchemeStyle = DevComponents.DotNetBar.eDotNetBarStyle.StyleManagerControlled; - this.ribbonPanel7.Controls.Add(this.ribbonBar5); - this.ribbonPanel7.Dock = System.Windows.Forms.DockStyle.Fill; - this.ribbonPanel7.Location = new System.Drawing.Point(0, 0); - this.ribbonPanel7.Name = "ribbonPanel7"; - this.ribbonPanel7.Padding = new System.Windows.Forms.Padding(3, 0, 3, 3); - this.ribbonPanel7.Size = new System.Drawing.Size(1328, 95); - // - // - // - this.ribbonPanel7.Style.Class = ""; - this.ribbonPanel7.Style.CornerType = DevComponents.DotNetBar.eCornerType.Square; - // - // - // - this.ribbonPanel7.StyleMouseDown.Class = ""; - this.ribbonPanel7.StyleMouseDown.CornerType = DevComponents.DotNetBar.eCornerType.Square; - // - // - // - this.ribbonPanel7.StyleMouseOver.Class = ""; - this.ribbonPanel7.StyleMouseOver.CornerType = DevComponents.DotNetBar.eCornerType.Square; - this.ribbonPanel7.TabIndex = 41; - this.ribbonPanel7.Visible = false; - // - // ribbonBar5 - // - this.ribbonBar5.AutoOverflowEnabled = true; - // - // - // - this.ribbonBar5.BackgroundMouseOverStyle.Class = ""; - this.ribbonBar5.BackgroundMouseOverStyle.CornerType = DevComponents.DotNetBar.eCornerType.Square; - // - // - // - this.ribbonBar5.BackgroundStyle.Class = ""; - this.ribbonBar5.BackgroundStyle.CornerType = DevComponents.DotNetBar.eCornerType.Square; - this.ribbonBar5.ContainerControlProcessDialogKey = true; - this.ribbonBar5.Dock = System.Windows.Forms.DockStyle.Left; - this.ribbonBar5.Items.AddRange(new DevComponents.DotNetBar.BaseItem[] { - this.btn_flag, - this.slider4ground}); - this.ribbonBar5.Location = new System.Drawing.Point(3, 0); - this.ribbonBar5.Name = "ribbonBar5"; - this.ribbonBar5.Size = new System.Drawing.Size(418, 92); - this.ribbonBar5.Style = DevComponents.DotNetBar.eDotNetBarStyle.StyleManagerControlled; - this.ribbonBar5.TabIndex = 0; - // - // - // - this.ribbonBar5.TitleStyle.Class = ""; - this.ribbonBar5.TitleStyle.CornerType = DevComponents.DotNetBar.eCornerType.Square; - // - // - // - this.ribbonBar5.TitleStyleMouseOver.Class = ""; - this.ribbonBar5.TitleStyleMouseOver.CornerType = DevComponents.DotNetBar.eCornerType.Square; - this.ribbonBar5.TitleVisible = false; - this.ribbonBar5.ItemClick += new System.EventHandler(this.ribbonBar5_ItemClick); - // - // btn_flag - // - this.btn_flag.Image = global::Cyberpipe.Properties.Resources._24x24icon_03_hover; - this.btn_flag.ImagePosition = DevComponents.DotNetBar.eImagePosition.Top; - this.btn_flag.Name = "btn_flag"; - this.btn_flag.SubItemsExpandWidth = 14; - this.btn_flag.Text = "标识器管理"; - this.btn_flag.Click += new System.EventHandler(this.btn_flag_Click); - // - // slider4ground - // - this.slider4ground.LabelPosition = DevComponents.DotNetBar.eSliderLabelPosition.Top; - this.slider4ground.Name = "slider4ground"; - this.slider4ground.Text = "地面透明度"; - this.slider4ground.Value = 0; - this.slider4ground.ValueChanged += new System.EventHandler(this.slider4ground_ValueChanged); - // - // ribbonPanel2 - // - this.ribbonPanel2.ColorSchemeStyle = DevComponents.DotNetBar.eDotNetBarStyle.StyleManagerControlled; - this.ribbonPanel2.Controls.Add(this.ribbonBar4); - this.ribbonPanel2.Dock = System.Windows.Forms.DockStyle.Fill; - this.ribbonPanel2.Location = new System.Drawing.Point(0, 0); - this.ribbonPanel2.Name = "ribbonPanel2"; - this.ribbonPanel2.Padding = new System.Windows.Forms.Padding(3, 0, 3, 3); - this.ribbonPanel2.Size = new System.Drawing.Size(1328, 95); - // - // - // - this.ribbonPanel2.Style.Class = ""; - this.ribbonPanel2.Style.CornerType = DevComponents.DotNetBar.eCornerType.Square; - // - // - // - this.ribbonPanel2.StyleMouseDown.Class = ""; - this.ribbonPanel2.StyleMouseDown.CornerType = DevComponents.DotNetBar.eCornerType.Square; - // - // - // - this.ribbonPanel2.StyleMouseOver.Class = ""; - this.ribbonPanel2.StyleMouseOver.CornerType = DevComponents.DotNetBar.eCornerType.Square; - this.ribbonPanel2.TabIndex = 39; - this.ribbonPanel2.Visible = false; - // - // ribbonBar4 - // - this.ribbonBar4.AutoOverflowEnabled = true; - // - // - // - this.ribbonBar4.BackgroundMouseOverStyle.Class = ""; - this.ribbonBar4.BackgroundMouseOverStyle.CornerType = DevComponents.DotNetBar.eCornerType.Square; - // - // - // - this.ribbonBar4.BackgroundStyle.Class = ""; - this.ribbonBar4.BackgroundStyle.CornerType = DevComponents.DotNetBar.eCornerType.Square; - this.ribbonBar4.ContainerControlProcessDialogKey = true; - this.ribbonBar4.Dock = System.Windows.Forms.DockStyle.Left; - this.ribbonBar4.Items.AddRange(new DevComponents.DotNetBar.BaseItem[] { - this.buttonItem_TaskManager, - this.buttonItem_OnlineTask, - this.buttonItem_Event}); - this.ribbonBar4.Location = new System.Drawing.Point(3, 0); - this.ribbonBar4.Name = "ribbonBar4"; - this.ribbonBar4.Size = new System.Drawing.Size(299, 92); - this.ribbonBar4.Style = DevComponents.DotNetBar.eDotNetBarStyle.StyleManagerControlled; - this.ribbonBar4.TabIndex = 0; - this.ribbonBar4.Text = "ribbonBar4"; - // - // - // - this.ribbonBar4.TitleStyle.Class = ""; - this.ribbonBar4.TitleStyle.CornerType = DevComponents.DotNetBar.eCornerType.Square; - // - // - // - this.ribbonBar4.TitleStyleMouseOver.Class = ""; - this.ribbonBar4.TitleStyleMouseOver.CornerType = DevComponents.DotNetBar.eCornerType.Square; - this.ribbonBar4.TitleVisible = false; - // - // buttonItem_TaskManager - // - this.buttonItem_TaskManager.Image = global::Cyberpipe.Properties.Resources._24x24icon__2__76; - this.buttonItem_TaskManager.ImagePosition = DevComponents.DotNetBar.eImagePosition.Top; - this.buttonItem_TaskManager.Name = "buttonItem_TaskManager"; - this.buttonItem_TaskManager.SubItemsExpandWidth = 14; - this.buttonItem_TaskManager.Text = "工单管理"; - this.buttonItem_TaskManager.Click += new System.EventHandler(this.buttonItem_TaskManager_Click); - // - // buttonItem_OnlineTask - // - this.buttonItem_OnlineTask.Image = global::Cyberpipe.Properties.Resources._24x24icon__2__69; - this.buttonItem_OnlineTask.ImagePosition = DevComponents.DotNetBar.eImagePosition.Top; - this.buttonItem_OnlineTask.Name = "buttonItem_OnlineTask"; - this.buttonItem_OnlineTask.SubItemsExpandWidth = 14; - this.buttonItem_OnlineTask.Text = "在线任务"; - this.buttonItem_OnlineTask.Click += new System.EventHandler(this.buttonItem_OnlineTask_Click); - // - // buttonItem_Event - // - this.buttonItem_Event.Image = global::Cyberpipe.Properties.Resources._24x24icon__2__72; - this.buttonItem_Event.ImagePosition = DevComponents.DotNetBar.eImagePosition.Top; - this.buttonItem_Event.Name = "buttonItem_Event"; - this.buttonItem_Event.SubItemsExpandWidth = 14; - this.buttonItem_Event.Text = "事件管理"; - this.buttonItem_Event.Click += new System.EventHandler(this.buttonItem_Event_Click); - // - // ribbonPanel3 - // - this.ribbonPanel3.ColorSchemeStyle = DevComponents.DotNetBar.eDotNetBarStyle.StyleManagerControlled; - this.ribbonPanel3.Controls.Add(this.ribbonBar3); - this.ribbonPanel3.Dock = System.Windows.Forms.DockStyle.Fill; - this.ribbonPanel3.Location = new System.Drawing.Point(0, 33); - this.ribbonPanel3.Name = "ribbonPanel3"; - this.ribbonPanel3.Padding = new System.Windows.Forms.Padding(3, 0, 3, 3); - this.ribbonPanel3.Size = new System.Drawing.Size(1328, 62); - // - // - // - this.ribbonPanel3.Style.Class = ""; - this.ribbonPanel3.Style.CornerType = DevComponents.DotNetBar.eCornerType.Square; - // - // - // - this.ribbonPanel3.StyleMouseDown.Class = ""; - this.ribbonPanel3.StyleMouseDown.CornerType = DevComponents.DotNetBar.eCornerType.Square; - // - // - // - this.ribbonPanel3.StyleMouseOver.Class = ""; - this.ribbonPanel3.StyleMouseOver.CornerType = DevComponents.DotNetBar.eCornerType.Square; - this.ribbonPanel3.TabIndex = 40; - // - // ribbonBar3 - // - this.ribbonBar3.AutoOverflowEnabled = true; - // - // - // - this.ribbonBar3.BackgroundMouseOverStyle.Class = ""; - this.ribbonBar3.BackgroundMouseOverStyle.CornerType = DevComponents.DotNetBar.eCornerType.Square; - // - // - // - this.ribbonBar3.BackgroundStyle.Class = ""; - this.ribbonBar3.BackgroundStyle.CornerType = DevComponents.DotNetBar.eCornerType.Square; - this.ribbonBar3.ContainerControlProcessDialogKey = true; - this.ribbonBar3.Dock = System.Windows.Forms.DockStyle.Left; - this.ribbonBar3.Items.AddRange(new DevComponents.DotNetBar.BaseItem[] { - this.btn_device, - this.btn_Person, - this.btn_constructMap, - this.buttonItem9}); - this.ribbonBar3.Location = new System.Drawing.Point(3, 0); - this.ribbonBar3.Name = "ribbonBar3"; - this.ribbonBar3.Size = new System.Drawing.Size(378, 59); - this.ribbonBar3.Style = DevComponents.DotNetBar.eDotNetBarStyle.StyleManagerControlled; - this.ribbonBar3.TabIndex = 0; - // - // - // - this.ribbonBar3.TitleStyle.Class = ""; - this.ribbonBar3.TitleStyle.CornerType = DevComponents.DotNetBar.eCornerType.Square; - // - // - // - this.ribbonBar3.TitleStyleMouseOver.Class = ""; - this.ribbonBar3.TitleStyleMouseOver.CornerType = DevComponents.DotNetBar.eCornerType.Square; - this.ribbonBar3.TitleVisible = false; - // - // btn_device - // - this.btn_device.ButtonStyle = DevComponents.DotNetBar.eButtonStyle.ImageAndText; - this.btn_device.Image = global::Cyberpipe.Properties.Resources._24X24__2__02; - this.btn_device.ImagePosition = DevComponents.DotNetBar.eImagePosition.Top; - this.btn_device.Name = "btn_device"; - this.btn_device.SubItemsExpandWidth = 14; - this.btn_device.Text = "探测仪管理"; - this.btn_device.Click += new System.EventHandler(this.btn_device_Click); - // - // btn_Person - // - this.btn_Person.ButtonStyle = DevComponents.DotNetBar.eButtonStyle.ImageAndText; - this.btn_Person.Image = global::Cyberpipe.Properties.Resources._24x24icon_05_hover1; - this.btn_Person.ImagePosition = DevComponents.DotNetBar.eImagePosition.Top; - this.btn_Person.Name = "btn_Person"; - this.btn_Person.SubItemsExpandWidth = 14; - this.btn_Person.Text = "定位人员维护"; - this.btn_Person.Click += new System.EventHandler(this.btn_Person_Click); - // - // btn_constructMap - // - this.btn_constructMap.Image = global::Cyberpipe.Properties.Resources._24x24icon_04_hover; - this.btn_constructMap.ImagePosition = DevComponents.DotNetBar.eImagePosition.Top; - this.btn_constructMap.Name = "btn_constructMap"; - this.btn_constructMap.SubItemsExpandWidth = 14; - this.btn_constructMap.Text = "导出施工图"; - this.btn_constructMap.Click += new System.EventHandler(this.btn_constructMap_Click); - // - // buttonItem9 - // - this.buttonItem9.Image = global::Cyberpipe.Properties.Resources._24x24icon__2__10; - this.buttonItem9.ImagePosition = DevComponents.DotNetBar.eImagePosition.Top; - this.buttonItem9.Name = "buttonItem9"; - this.buttonItem9.SubItemsExpandWidth = 14; - this.buttonItem9.Text = "文档管理"; - this.buttonItem9.Click += new System.EventHandler(this.buttonItem9_Click); - // // ribbonPanel8 // this.ribbonPanel8.ColorSchemeStyle = DevComponents.DotNetBar.eDotNetBarStyle.StyleManagerControlled; @@ -4696,6 +4625,86 @@ this.btn_reset_password.Text = "重置密码"; this.btn_reset_password.Click += new System.EventHandler(this.btn_reset_password_Click); // + // ribbonPanel7 + // + this.ribbonPanel7.ColorSchemeStyle = DevComponents.DotNetBar.eDotNetBarStyle.StyleManagerControlled; + this.ribbonPanel7.Controls.Add(this.ribbonBar5); + this.ribbonPanel7.Dock = System.Windows.Forms.DockStyle.Fill; + this.ribbonPanel7.Location = new System.Drawing.Point(0, 0); + this.ribbonPanel7.Name = "ribbonPanel7"; + this.ribbonPanel7.Padding = new System.Windows.Forms.Padding(3, 0, 3, 3); + this.ribbonPanel7.Size = new System.Drawing.Size(1328, 95); + // + // + // + this.ribbonPanel7.Style.Class = ""; + this.ribbonPanel7.Style.CornerType = DevComponents.DotNetBar.eCornerType.Square; + // + // + // + this.ribbonPanel7.StyleMouseDown.Class = ""; + this.ribbonPanel7.StyleMouseDown.CornerType = DevComponents.DotNetBar.eCornerType.Square; + // + // + // + this.ribbonPanel7.StyleMouseOver.Class = ""; + this.ribbonPanel7.StyleMouseOver.CornerType = DevComponents.DotNetBar.eCornerType.Square; + this.ribbonPanel7.TabIndex = 41; + this.ribbonPanel7.Visible = false; + // + // ribbonBar5 + // + this.ribbonBar5.AutoOverflowEnabled = true; + // + // + // + this.ribbonBar5.BackgroundMouseOverStyle.Class = ""; + this.ribbonBar5.BackgroundMouseOverStyle.CornerType = DevComponents.DotNetBar.eCornerType.Square; + // + // + // + this.ribbonBar5.BackgroundStyle.Class = ""; + this.ribbonBar5.BackgroundStyle.CornerType = DevComponents.DotNetBar.eCornerType.Square; + this.ribbonBar5.ContainerControlProcessDialogKey = true; + this.ribbonBar5.Dock = System.Windows.Forms.DockStyle.Left; + this.ribbonBar5.Items.AddRange(new DevComponents.DotNetBar.BaseItem[] { + this.btn_flag, + this.slider4ground}); + this.ribbonBar5.Location = new System.Drawing.Point(3, 0); + this.ribbonBar5.Name = "ribbonBar5"; + this.ribbonBar5.Size = new System.Drawing.Size(418, 92); + this.ribbonBar5.Style = DevComponents.DotNetBar.eDotNetBarStyle.StyleManagerControlled; + this.ribbonBar5.TabIndex = 0; + // + // + // + this.ribbonBar5.TitleStyle.Class = ""; + this.ribbonBar5.TitleStyle.CornerType = DevComponents.DotNetBar.eCornerType.Square; + // + // + // + this.ribbonBar5.TitleStyleMouseOver.Class = ""; + this.ribbonBar5.TitleStyleMouseOver.CornerType = DevComponents.DotNetBar.eCornerType.Square; + this.ribbonBar5.TitleVisible = false; + this.ribbonBar5.ItemClick += new System.EventHandler(this.ribbonBar5_ItemClick); + // + // btn_flag + // + this.btn_flag.Image = global::Cyberpipe.Properties.Resources._24x24icon_03_hover; + this.btn_flag.ImagePosition = DevComponents.DotNetBar.eImagePosition.Top; + this.btn_flag.Name = "btn_flag"; + this.btn_flag.SubItemsExpandWidth = 14; + this.btn_flag.Text = "标识器管理"; + this.btn_flag.Click += new System.EventHandler(this.btn_flag_Click); + // + // slider4ground + // + this.slider4ground.LabelPosition = DevComponents.DotNetBar.eSliderLabelPosition.Top; + this.slider4ground.Name = "slider4ground"; + this.slider4ground.Text = "地面透明度"; + this.slider4ground.Value = 0; + this.slider4ground.ValueChanged += new System.EventHandler(this.slider4ground_ValueChanged); + // // ribbonPanel15 // this.ribbonPanel15.ColorSchemeStyle = DevComponents.DotNetBar.eDotNetBarStyle.StyleManagerControlled; @@ -6393,16 +6402,6 @@ this.buttonItem76.SubItemsExpandWidth = 14; this.buttonItem76.Text = "坐标标注"; // - // layerTree - // - this.layerTree.CheckBoxes = true; - this.layerTree.ItemHeight = 18; - this.layerTree.Location = new System.Drawing.Point(30, 78); - this.layerTree.Name = "layerTree"; - this.layerTree.Size = new System.Drawing.Size(121, 97); - this.layerTree.TabIndex = 1; - this.layerTree.AfterCheck += new System.Windows.Forms.TreeViewEventHandler(this.layerTree_AfterCheck); - // // MainFrm // this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Inherit; @@ -6475,11 +6474,11 @@ this.contextMenuStripDeleteLayerNode.ResumeLayout(false); this.ribbonControl1.ResumeLayout(false); this.ribbonControl1.PerformLayout(); - this.ribbonPanel1.ResumeLayout(false); - this.ribbonPanel7.ResumeLayout(false); - this.ribbonPanel2.ResumeLayout(false); this.ribbonPanel3.ResumeLayout(false); + this.ribbonPanel2.ResumeLayout(false); + this.ribbonPanel1.ResumeLayout(false); this.ribbonPanel8.ResumeLayout(false); + this.ribbonPanel7.ResumeLayout(false); this.ribbonPanel15.ResumeLayout(false); ((System.ComponentModel.ISupportInitialize)(this.pictureBox1)).EndInit(); this.ResumeLayout(false); diff --git a/NewFunction/FrmCreateTunnel.cs b/NewFunction/FrmCreateTunnel.cs index 282767c..338edff 100644 --- a/NewFunction/FrmCreateTunnel.cs +++ b/NewFunction/FrmCreateTunnel.cs @@ -142,35 +142,6 @@ } } - private void txtMS_KeyPress(object sender, KeyPressEventArgs e) - { - TextBox text = sender as TextBox; - if ((e.KeyChar < 48 || e.KeyChar > 57) && (e.KeyChar != 8) && (int)e.KeyChar != 46) - { - e.Handled = true; - } - if ((int)e.KeyChar == 46) //小数点 - { - if (text.Text.Length <= 0) - e.Handled = true; //小数点不能在第一位 - else //处理不规则的小数点 - { - float f; - float oldf; - bool b1 = false, b2 = false; - b1 = float.TryParse(text.Text, out oldf); - b2 = float.TryParse(text.Text + e.KeyChar.ToString(), out f); - if (b2 == false) - { - if (b1 == true) - e.Handled = true; - else - e.Handled = false; - } - } - } - } - private void FrmCreateTunnel_Load(object sender, EventArgs e) { if (comboBoxTunnelType.Items.Count > 0) diff --git a/Cyberpipe.csproj b/Cyberpipe.csproj index 07a8c1a..e3cd12c 100644 --- a/Cyberpipe.csproj +++ b/Cyberpipe.csproj @@ -204,25 +204,6 @@ - - Form - - - F_GKT1数据输入输出.cs - - - Form - - - F_GKT1添加文件.cs - - - Form - - - F_GKT1添加项目.cs - - Form @@ -1068,18 +1049,6 @@ Frm_password_reset.cs - - Form - - - GKT.cs - - - Form - - - GKT1.cs - Form @@ -1258,12 +1227,6 @@ F_Projedit.cs - - Form - - - PED.cs - Form @@ -1331,16 +1294,6 @@ True Reference.map - - F_GKT1数据输入输出.cs - Designer - - - F_GKT1添加文件.cs - - - F_GKT1添加项目.cs - Form_EditTask.cs @@ -1836,12 +1789,6 @@ Frm_password_reset.cs - - GKT.cs - - - GKT1.cs - F_GKT数据输入输出.cs @@ -1934,9 +1881,6 @@ F_Projedit.cs - - PED.cs - F_数据输入输出.cs diff --git a/Cyberpipe.suo b/Cyberpipe.suo index 68ced4f..a1aecf8 100644 --- a/Cyberpipe.suo +++ b/Cyberpipe.suo Binary files differ diff --git a/EMS_Forms/Form_EditTask.cs b/EMS_Forms/Form_EditTask.cs index 718992f..f1d791f 100644 --- a/EMS_Forms/Form_EditTask.cs +++ b/EMS_Forms/Form_EditTask.cs @@ -119,7 +119,8 @@ String name = Convert.ToString(dr["USERNAME"]); comboBox_userName.Items.Add(name); - } + } + dr.Close(); comboBox_road.Items.Clear(); roadList = new List(); @@ -135,7 +136,7 @@ comboBox_road.Items.Add(name); } } - + dr1.Close(); conn.Close(); bool flag2 = false; @@ -185,7 +186,7 @@ catch (Exception ex) { - MessageBox.Show(ex.ToString()); + LogHelper.WriteLog(typeof(Form_EditTask), ex.Message); } } @@ -288,7 +289,7 @@ } catch (Exception ex) { - MessageBox.Show(ex.ToString()); + LogHelper.WriteLog(typeof(Form_EditTask), ex.Message); } } @@ -474,7 +475,7 @@ } catch (Exception ex) { - MessageBox.Show(ex.ToString()); + LogHelper.WriteLog(typeof(Form_EditTask), ex.Message); } this.Close(); @@ -495,6 +496,7 @@ { numList.Add(Convert.ToInt32(dr["DBID"])); } + dr.Close(); if (numList.Count == 0) { taskNumber = Convert.ToInt32(number) * 100; @@ -674,6 +676,7 @@ } } } + dr.Close(); conn.Close(); } diff --git a/EMS_Forms/Form_EventManager.cs b/EMS_Forms/Form_EventManager.cs index b18c45b..84807b2 100644 --- a/EMS_Forms/Form_EventManager.cs +++ b/EMS_Forms/Form_EventManager.cs @@ -64,6 +64,7 @@ comboBox_name.Items.Add(name); } + dr.Close(); conn.Close(); diff --git a/Forms/FrmMnModify.cs b/Forms/FrmMnModify.cs index 31cfc5f..d036360 100644 --- a/Forms/FrmMnModify.cs +++ b/Forms/FrmMnModify.cs @@ -68,15 +68,7 @@ questionGrid.Rows[idx].Cells[1].Value = sr.question; } } - /// 选中对象 - /// - /// - /// - /// - private void buttonX1_Click(object sender, EventArgs e) - { - globecontrol.Globe.Action = EnumAction3D.SelectObject; - } + /// /// 选中某一行 /// diff --git a/Forms/FrmPipelineModelDataBase.cs b/Forms/FrmPipelineModelDataBase.cs index 2acf0ca..7ce573f 100644 --- a/Forms/FrmPipelineModelDataBase.cs +++ b/Forms/FrmPipelineModelDataBase.cs @@ -35,19 +35,7 @@ ds = _ds; InitializeComponent(); } - /// - /// 单击选择shp格式文件 - /// - /// - /// - private void btnBrowseModel_Click(object sender, EventArgs e) - { - saveFileDialog1.Filter = "*.lgd|*.lgd"; - if (saveFileDialog1.ShowDialog() == DialogResult.OK) - { - txtModelLayer.Text = saveFileDialog1.FileName; - } - } + /// /// 窗体初始化事件处理 /// @@ -100,49 +88,6 @@ } } } - - private object convertFieldValue(string fieldname, object obj) - { - if (obj == null) - return null; - - try - { - string type = fields_types[fieldname].ToString(); - switch (type) - { - case "string": - return obj.ToString(); - case "int": - //return 101; - int intResult; - if (int.TryParse(obj.ToString(), out intResult)) - return intResult; - else - return null; - case "double": - //return 202.5; - double doubleResult; - if (double.TryParse(obj.ToString(), out doubleResult)) - return doubleResult; - else - return null; - case "date": - DateTime dtResult; - if (DateTime.TryParse(obj.ToString(), out dtResult)) - return dtResult; - else - return null; - } - return null; - } - catch (Exception ex) - { - MessageBox.Show(ex.ToString()); - return null; - } - } - public string lgdFilePath = ""; /// /// 选择管线颜色 @@ -610,33 +555,6 @@ { this.Close(); } - - private void cmbLayer_SelectedIndexChanged(object sender, EventArgs e) //选择图层 - { - GSOLayer layer = ctl.Globe.Layers.GetLayerByCaption(selectLayerName); - GSOFeatures features = layer.GetAllFeatures(); - if (features.Length == 0) - return; - - cmbFrom.Items.Clear(); - cmbTo.Items.Clear(); - cmbRadius.Items.Clear(); - cmbID.Items.Clear(); - for (int i = 0; i < features[0].GetFieldCount(); i++) - { - GeoScene.Data.GSOFieldDefn fielddef = (GeoScene.Data.GSOFieldDefn)(features[0].GetFieldDefn(i)); - - cmbFrom.Items.Add(fielddef.Name); - cmbTo.Items.Add(fielddef.Name); - cmbRadius.Items.Add(fielddef.Name); - cmbID.Items.Add(fielddef.Name); - } - cmbFrom.SelectedItem = "Deep1"; - cmbTo.SelectedItem = "Deep2"; - cmbRadius.SelectedItem = "Diameter"; - cmbID.SelectedItem = "Handle"; - } - private void buttonXLayerPath_Click(object sender, EventArgs e)//单击 选择shp格式的文件 { OpenFileDialog dlg = new OpenFileDialog(); diff --git a/Forms/FrmPipelineModelDataOneStep.cs b/Forms/FrmPipelineModelDataOneStep.cs index 18afda7..ec93b8a 100644 --- a/Forms/FrmPipelineModelDataOneStep.cs +++ b/Forms/FrmPipelineModelDataOneStep.cs @@ -38,19 +38,7 @@ layerTree = _layerTree; InitializeComponent(); } - /// - /// 单击选择shp格式文件 - /// - /// - /// - private void btnBrowseModel_Click(object sender, EventArgs e) - { - saveFileDialog1.Filter = "*.lgd|*.lgd"; - if (saveFileDialog1.ShowDialog() == DialogResult.OK) - { - txtModelLayer.Text = saveFileDialog1.FileName; - } - } + /// /// 窗体初始化事件处理 /// @@ -107,48 +95,7 @@ } } - private object convertFieldValue(string fieldname, object obj) - { - if (obj == null) - return null; - - try - { - string type = fields_types[fieldname].ToString(); - switch (type) - { - case "string": - return obj.ToString(); - case "int": - //return 101; - int intResult; - if (int.TryParse(obj.ToString(), out intResult)) - return intResult; - else - return null; - case "double": - //return 202.5; - double doubleResult; - if (double.TryParse(obj.ToString(), out doubleResult)) - return doubleResult; - else - return null; - case "date": - DateTime dtResult; - if (DateTime.TryParse(obj.ToString(), out dtResult)) - return dtResult; - else - return null; - } - return null; - } - catch (Exception ex) - { - MessageBox.Show(ex.ToString()); - return null; - } - } - + public string lgdFilePath = ""; /// /// 选择管线颜色 @@ -673,32 +620,6 @@ return featDs; } - private void cmbLayer_SelectedIndexChanged(object sender, EventArgs e) //选择图层 - { - GSOLayer layer = ctl.Globe.Layers.GetLayerByCaption(selectLayerName); - GSOFeatures features = layer.GetAllFeatures(); - if (features.Length == 0) - return; - - cmbFrom.Items.Clear(); - cmbTo.Items.Clear(); - cmbRadius.Items.Clear(); - cmbID.Items.Clear(); - for (int i = 0; i < features[0].GetFieldCount(); i++) - { - GeoScene.Data.GSOFieldDefn fielddef = (GeoScene.Data.GSOFieldDefn)(features[0].GetFieldDefn(i)); - - cmbFrom.Items.Add(fielddef.Name); - cmbTo.Items.Add(fielddef.Name); - cmbRadius.Items.Add(fielddef.Name); - cmbID.Items.Add(fielddef.Name); - } - cmbFrom.SelectedItem = "Deep1"; - cmbTo.SelectedItem = "Deep2"; - cmbRadius.SelectedItem = "Diameter"; - cmbID.SelectedItem = "Handle"; - } - private void buttonXLayerPath_Click(object sender, EventArgs e)//单击 选择shp格式的文件 { OpenFileDialog dlg = new OpenFileDialog(); @@ -949,38 +870,6 @@ } //txtLayername.Text = type + layername; } - /// - /// 连接数据库 - /// - /// - /// - private void buttonX1_Click(object sender, EventArgs e) - { - if (ds == null) - { - //没连的话,直接连接审核库; //审核库配置读配置文件 - string dbIp = Utility.sgdbip; - string database = Utility.sgdbname; - string user = Utility.sgdbuser; - string pass = Utility.sgdbpwd; - - if (!Utility.isNetworkConnectionSuccess(dbIp.Trim())) - { - MessageBox.Show("网络连接失败!", "提示"); - return; - } - - ds = ctl.Globe.DataManager.OpenOracleDataSource(dbIp + "/" + database, "", "", user, pass); - if (ds == null) - { - MessageBox.Show("数据库连接失败!", "提示", MessageBoxButtons.OK, MessageBoxIcon.Warning); - } - else - { - btnCreateModel.Enabled = true; - } - } - } private void btnClose_Click(object sender, EventArgs e) { diff --git a/Forms/FrmShRK.cs b/Forms/FrmShRK.cs index 0e2e722..f1d83cb 100644 --- a/Forms/FrmShRK.cs +++ b/Forms/FrmShRK.cs @@ -215,6 +215,7 @@ { sourcefeatds = sourcefeat as GSOFeatureDataset; } + if (sourcefeatds == null) return; sourcefeatds.Open(); GSOFeatures sourcefeatures = sourcefeatds.GetAllFeatures(); @@ -251,6 +252,7 @@ { desfeatds = desfeat as GSOFeatureDataset; } + if (desfeatds == null) return; desfeatds.Open(); //向新数据集写入字段 diff --git a/FrmAccessoriesSensor.cs b/FrmAccessoriesSensor.cs index 09fcdf1..2a7a80e 100644 --- a/FrmAccessoriesSensor.cs +++ b/FrmAccessoriesSensor.cs @@ -209,7 +209,7 @@ chart1.Series[0].Points.DataBindXY(dic.Keys, dic.Values); for (int m = 0; m < dic.Values.Count; m++) { - if (chart1.Series[0].Points[m].YValues[0].ToString() != "0") + if (chart1.Series[0].Points[m]!=null&&chart1.Series[0].Points[m].YValues[0].ToString() != "0") { chart1.Series[0].Points[m].Label = chart1.Series[0].Points[m].YValues[0].ToString(); } diff --git a/FrmAccessoriesgather.cs b/FrmAccessoriesgather.cs index 9e331e1..a475d9e 100644 --- a/FrmAccessoriesgather.cs +++ b/FrmAccessoriesgather.cs @@ -338,7 +338,7 @@ chart1.Series[0].Points.DataBindXY(dic.Keys, dic.Values); for (int m = 0; m < dic.Values.Count; m++) { - if (chart1.Series[0].Points[m].YValues[0].ToString() != "0") + if (chart1.Series[0].Points[m]!=null&&chart1.Series[0].Points[m].YValues[0].ToString() != "0") { chart1.Series[0].Points[m].Label = chart1.Series[0].Points[m].YValues[0].ToString(); } diff --git a/FrmAccessoryAnalysis.cs b/FrmAccessoryAnalysis.cs index 71d4579..44d4065 100644 --- a/FrmAccessoryAnalysis.cs +++ b/FrmAccessoryAnalysis.cs @@ -66,39 +66,6 @@ globeControl1.Refresh(); } /// - /// 键盘按键按下事件处理 - /// - /// - /// - private void txtRadius_KeyPress(object sender, KeyPressEventArgs e) - { - TextBox text = sender as TextBox; - if ((e.KeyChar < 48 || e.KeyChar > 57) && (e.KeyChar != 8) && (int)e.KeyChar != 46) - { - e.Handled = true; - } - if ((int)e.KeyChar == 46) //小数点 - { - if (text.Text.Length <= 0) - e.Handled = true; //小数点不能在第一位 - else //处理不规则的小数点 - { - float f; - float oldf; - bool b1 = false, b2 = false; - b1 = float.TryParse(text.Text, out oldf); - b2 = float.TryParse(text.Text + e.KeyChar.ToString(), out f); - if (b2 == false) - { - if (b1 == true) - e.Handled = true; - else - e.Handled = false; - } - } - } - } - /// /// 确定按钮事件处理 /// /// diff --git a/FrmAddValve.cs b/FrmAddValve.cs index 34d2fec..5f405b9 100644 --- a/FrmAddValve.cs +++ b/FrmAddValve.cs @@ -486,56 +486,6 @@ } } - - - - - - - - private void cmbLayer_SelectedIndexChanged(object sender, EventArgs e) - { - GSOLayer layer = globeControl1.Globe.Layers.GetLayerByCaption(selectLayerName); - GSOFeatures features = layer.GetAllFeatures(); - if (features.Length == 0) - return; - - combPath.Items.Clear(); - combZ.Items.Clear(); - combModelName.Items.Clear(); - - for (int i = 0; i < features[0].GetFieldCount(); i++) - { - GeoScene.Data.GSOFieldDefn fielddef = (GeoScene.Data.GSOFieldDefn)(features[0].GetFieldDefn(i)); - combPath.Items.Add(fielddef.Name); - combZ.Items.Add(fielddef.Name); - combModelName.Items.Add(fielddef.Name); - } - combModelName.SelectedItem = "编号"; - combPath.SelectedItem = "模型路径"; - if (combfile.SelectedIndex != -1) - { - - string layerCaption = combfile.SelectedItem.ToString().Trim(); - rukuLayer = globeControl1.Globe.Layers.GetLayerByCaption(layerCaption); - if (rukuLayer != null) - { - combPath.Items.Clear(); - combZ.Items.Clear(); - combModelName.Items.Clear(); - - } - for (int i = 0; i < features[0].GetFieldCount(); i++) - { - GeoScene.Data.GSOFieldDefn fielddef = (GeoScene.Data.GSOFieldDefn)(features[0].GetFieldDefn(i)); - combPath.Items.Add(fielddef.Name); - combZ.Items.Add(fielddef.Name); - combModelName.Items.Add(fielddef.Name); - } - combModelName.SelectedItem = "编号"; - combPath.SelectedItem = "模型路径"; - } - } /// /// 单击选择shp格式文件 /// diff --git a/FrmAddWellShp.cs b/FrmAddWellShp.cs index bb79ec0..a249725 100644 --- a/FrmAddWellShp.cs +++ b/FrmAddWellShp.cs @@ -478,32 +478,6 @@ } } } - - private void cmbLayer_SelectedIndexChanged(object sender, EventArgs e) - { - GSOLayer layer = globeControl1.Globe.Layers.GetLayerByCaption(selectLayerName); - GSOFeatures features = layer.GetAllFeatures(); - if (features.Length == 0) - return; - - combCode.Items.Clear(); - combDeep.Items.Clear(); - combModelName.Items.Clear(); - combAngle.Items.Clear(); - - for (int i = 0; i < features[0].GetFieldCount(); i++) - { - GeoScene.Data.GSOFieldDefn fielddef = (GeoScene.Data.GSOFieldDefn)(features[0].GetFieldDefn(i)); - combCode.Items.Add(fielddef.Name); - combDeep.Items.Add(fielddef.Name); - combModelName.Items.Add(fielddef.Name); - combAngle.Items.Add(fielddef.Name); - } - combCode.SelectedItem = "附属物编码"; - combDeep.SelectedItem = "井深"; - combModelName.SelectedItem = "编号"; - combAngle.SelectedItem = "符号角度"; - } /// /// 单击选择shp格式文件 /// diff --git a/FrmAddYuBiZiShp.cs b/FrmAddYuBiZiShp.cs index b312d51..332f037 100644 --- a/FrmAddYuBiZiShp.cs +++ b/FrmAddYuBiZiShp.cs @@ -383,80 +383,7 @@ } } - private void cmbLayer_SelectedIndexChanged(object sender, EventArgs e) - { - GSOLayer layer = globeControl1.Globe.Layers.GetLayerByCaption(selectLayerName); - GSOFeatures features = layer.GetAllFeatures(); - if (features.Length == 0) - return; - - combCode.Items.Clear(); - combDeep.Items.Clear(); - combModelName.Items.Clear(); - //comboLoad.Items.Clear(); - for (int i = 0; i < features[0].GetFieldCount(); i++) - { - GeoScene.Data.GSOFieldDefn fielddef = (GeoScene.Data.GSOFieldDefn)(features[0].GetFieldDefn(i)); - combCode.Items.Add(fielddef.Name); - combDeep.Items.Add(fielddef.Name); - combModelName.Items.Add(fielddef.Name); - //comboLoad.Items.Add(fielddef.Name); - } - combCode.SelectedItem = "附属物编码"; - combDeep.SelectedItem = "Z坐标"; - combModelName.SelectedItem = "编号"; - //comboLoad.SelectedItem = "模型路径"; - } - - private void buttonXLayerPath_Click(object sender, EventArgs e) - { - OpenFileDialog dlg = new OpenFileDialog(); - dlg.Filter = "*.shp|*.shp"; - dlg.Multiselect = false; - if (dlg.ShowDialog() == DialogResult.OK) - { - GSOLayer layer = globeControl1.Globe.Layers.Add(dlg.FileName); - string txtMessage = valiYBdata(layer); - if (txtMessage != "") - { - button3.Enabled = false; - //textBoxLayer.Text = ""; - combCode.Items.Clear(); - combDeep.Items.Clear(); - combModelName.Items.Clear(); - globeControl1.Globe.Layers.Remove(layer); - FrmValiDataShowErrorMessage showErrorMessage = new FrmValiDataShowErrorMessage(dlg.FileName, txtMessage); - showErrorMessage.ShowDialog(); - return; - } - else - { - button3.Enabled = true; - //textBoxLayer.Text = dlg.FileName; - selectLayerName = layer.Caption; - txtLayerName.Text = layer.Caption; - GSOFeatures features = layer.GetAllFeatures(); - if (features.Length == 0) - return; - - combCode.Items.Clear(); - combDeep.Items.Clear(); - combModelName.Items.Clear(); - for (int i = 0; i < features[0].GetFieldCount(); i++) - { - GeoScene.Data.GSOFieldDefn fielddef = (GeoScene.Data.GSOFieldDefn)(features[0].GetFieldDefn(i)); - combCode.Items.Add(fielddef.Name); - combDeep.Items.Add(fielddef.Name); - combModelName.Items.Add(fielddef.Name); - //comboLoad.Items.Add(fielddef.Name); - } - combCode.SelectedItem = "管点编码"; - combDeep.SelectedItem = "Z坐标"; - combModelName.SelectedItem = "编号"; - } - } - } - + private void FrmAddYuBiZiShp_FormClosing(object sender, FormClosingEventArgs e) { globeControl1.Globe.Refresh(); diff --git a/FrmAllPipelineStatis.cs b/FrmAllPipelineStatis.cs index 6421a26..a6eea29 100644 --- a/FrmAllPipelineStatis.cs +++ b/FrmAllPipelineStatis.cs @@ -84,7 +84,7 @@ chartAllAreaPipeline.Series["管线"].Points.DataBindXY(pipelineLengthAndType.Keys, pipelineLengthAndType.Values); for (int m = 0; m < pipelineLengthAndType.Values.Count; m++) { - if (chartAllAreaPipeline.Series["管线"].Points[m].YValues[0].ToString() != "0") + if (chartAllAreaPipeline.Series["管线"].Points[m]!=null&&chartAllAreaPipeline.Series["管线"].Points[m].YValues[0].ToString() != "0") { chartAllAreaPipeline.Series["管线"].Points[m].Label = chartAllAreaPipeline.Series[0].Points[m].YValues[0].ToString(); } @@ -94,7 +94,7 @@ } catch (Exception ex) { - //LogError.PublishError(ex); + LogHelper.WriteLog(typeof(FrmAllPipelineStatis), ex.Message); } } @@ -147,7 +147,7 @@ } DataTable dt = OledbHelper.QueryTable(sql); - if (dt != null && dt.Rows.Count > 0) + if (dt != null && dt.Rows.Count > 0 && chartAllAreaPipeline.Series["管线"].Points[indexHit]!=null) { dataGridViewX1.DataSource = dt; panel.Visible = true; diff --git a/FrmAllWorkWellStatis.cs b/FrmAllWorkWellStatis.cs index 6fec7af..6af8e4c 100644 --- a/FrmAllWorkWellStatis.cs +++ b/FrmAllWorkWellStatis.cs @@ -52,7 +52,7 @@ chartAllAreaPipeline.Series["井盖"].Points.DataBindXY(workWellLengthAndType.Keys, workWellLengthAndType.Values); for (int m = 0; m < workWellLengthAndType.Values.Count; m++) { - if (chartAllAreaPipeline.Series["井盖"].Points[m].YValues[0].ToString().Trim() != "0") + if (chartAllAreaPipeline.Series["井盖"].Points[m]!=null&&chartAllAreaPipeline.Series["井盖"].Points[m].YValues[0].ToString().Trim() != "0") { chartAllAreaPipeline.Series["井盖"].Points[m].Label = chartAllAreaPipeline.Series[0].Points[m].YValues[0].ToString(); } @@ -60,7 +60,7 @@ } catch (Exception ex) { - //LogError.PublishError(ex); + LogHelper.WriteLog(typeof(FrmAllWorkWellStatis), ex.Message); } } diff --git a/FrmBSQDuoBianXingStatis.cs b/FrmBSQDuoBianXingStatis.cs index e8b7d52..3e889b6 100644 --- a/FrmBSQDuoBianXingStatis.cs +++ b/FrmBSQDuoBianXingStatis.cs @@ -60,7 +60,7 @@ { for (int m = 0; m < bsq1.Values.Count; m++) { - if (chart1.Series["标识器"].Points[m].YValues[0].ToString() != "0") + if (chart1.Series["标识器"].Points[m]!=null&&chart1.Series["标识器"].Points[m].YValues[0].ToString() != "0") { count += Convert.ToInt16(chart1.Series[0].Points[m].YValues[0].ToString()); chart1.Series["标识器"].Points[m].Label = chart1.Series[0].Points[m].YValues[0].ToString(); diff --git a/FrmBSQDuoBianXingStreet.cs b/FrmBSQDuoBianXingStreet.cs index 2005ebb..1db5777 100644 --- a/FrmBSQDuoBianXingStreet.cs +++ b/FrmBSQDuoBianXingStreet.cs @@ -63,7 +63,7 @@ chartStatis.Series[0].Points.DataBindXY(bsq.Keys, bsq.Values); for (int m = 0; m < bsq.Values.Count; m++) { - if (chartStatis.Series[0].Points[m].YValues[0].ToString().Trim() != "0") + if (chartStatis.Series[0].Points[m]!=null&&chartStatis.Series[0].Points[m].YValues[0].ToString().Trim() != "0") { count += Convert.ToInt16(chartStatis.Series[0].Points[m].YValues[0].ToString()); chartStatis.Series[0].Points[m].Label = chartStatis.Series[0].Points[m].YValues[0].ToString(); diff --git a/FrmBSQStatis.cs b/FrmBSQStatis.cs index 390a55c..4aa0ee6 100644 --- a/FrmBSQStatis.cs +++ b/FrmBSQStatis.cs @@ -95,6 +95,8 @@ } } } + + dr.Close(); conn.Close(); for (int i = 0; i < typeLists.Count; i++) { @@ -123,7 +125,7 @@ chartStatis.Series[0].Points.DataBindXY(bsq.Keys, bsq.Values); for (int m = 0; m < bsq.Values.Count; m++) { - if (chartStatis.Series[0].Points[m].YValues[0].ToString().Trim() != "0") + if (chartStatis.Series[0].Points[m]!=null&&chartStatis.Series[0].Points[m].YValues[0].ToString().Trim() != "0") { //count += Convert.ToInt16(chartStatis.Series[0].Points[m].YValues[0].ToString()); chartStatis.Series[0].Points[m].Label = chartStatis.Series[0].Points[m].YValues[0].ToString(); diff --git a/FrmBSQStreet.cs b/FrmBSQStreet.cs index 9d88adb..7fbacad 100644 --- a/FrmBSQStreet.cs +++ b/FrmBSQStreet.cs @@ -44,7 +44,7 @@ chartStatis.Series[0].Points.DataBindXY(bsq.Keys, bsq.Values); for (int m = 0; m < bsq.Values.Count; m++) { - if (chartStatis.Series[0].Points[m].YValues[0].ToString().Trim() != "0") + if (chartStatis.Series[0].Points[m]!=null&&chartStatis.Series[0].Points[m].YValues[0].ToString().Trim() != "0") { count += Convert.ToInt16(chartStatis.Series[0].Points[m].YValues[0].ToString()); chartStatis.Series[0].Points[m].Label = chartStatis.Series[0].Points[m].YValues[0].ToString(); diff --git a/FrmBoosterValvers.cs b/FrmBoosterValvers.cs index 5061efc..df9b62b 100644 --- a/FrmBoosterValvers.cs +++ b/FrmBoosterValvers.cs @@ -236,199 +236,6 @@ count = 0; } } - /// - /// 添加火苗 - /// - /// - /// - /// - /// - private GSOFeature AddFire(double x,double y,double z) - { - // 烟火示例 - - string strResPath = Application.StartupPath + "/Resource"; - - // 烟火粒子示例,由三个发射器构成 - GSOGeoParticle geoParticle = new GSOGeoParticle(); - geoParticle.SetPosition(x, y, z); // 添加到这个经纬度位置 - geoParticle.AltitudeMode = EnumAltitudeMode.RelativeToGround; - - GSORingParticleEmitter emitter = new GSORingParticleEmitter(); - emitter.TexturePath = strResPath + "/ParticleImage/flare.png"; - - emitter.SetSizeFix(1, 1); - emitter.VelFix = 1; - emitter.VelRnd = 5; - - emitter.AngleXYFix = 0; - emitter.AngleXYRnd = 180; - - emitter.AngleXZFix = 90; - emitter.AngleXZRnd = 0; - - emitter.LifeFix = 0.5f; - emitter.LifeRnd = 0.0f; - - emitter.RotFix = 0; - emitter.RotRnd = 0; - - emitter.RotVelFix = 0; - emitter.RotVelRnd = 0; - - emitter.EmitPerSec = 100; - - // 采用线性插值生成粒子的初始颜色 - emitter.ColorRndStart = Color.White; - emitter.ColorRndEnd = Color.Red; - - - GSOColorParticleEffector effector2 = new GSOColorParticleEffector(); - effector2.SetColorChanged(0, -1, -1, 0); - effector2.StartTime = 0.0f; - effector2.EndTime = -1.0f; - emitter.AddEffector(effector2); - - // 将三个发射器添加到粒子对象中 - geoParticle.AddEmitter(emitter); - - geoParticle.Play(); - - GSOFeature feature = new GSOFeature(); - - feature.Geometry = geoParticle; - - globeControl1.Globe.MemoryLayer.AddFeature(feature); - - - return feature; - } - - /// - /// 添加喷泉 - /// - /// - private GSOFeature AddFountain() - { - string strResPath = Application.StartupPath + "/Resource"; - - GSOGeoParticle geoParticle = new GSOGeoParticle(); - geoParticle.SetPosition(116.314, 39.84, 0); // 添加到这个经纬度位置 - - GSOPointParticleEmitter emitter = new GSOPointParticleEmitter(); - emitter.TexturePath = strResPath + "/ParticleImage/test.png"; - - emitter.SetSizeFix(0.5f, 2); - emitter.VelFix = 10; - emitter.VelRnd = 2; - - emitter.GravityAcc = 9.8f; - emitter.AngleXYFix = 0; - emitter.AngleXYRnd = 180; - - emitter.AngleXZFix = 88; - emitter.AngleXZRnd = 2; - - //emitter.InnerRadius = 0; - // emitter.OuterRadius = 0.03f; - - emitter.LifeFix = 5.0f; - emitter.LifeRnd = 1.0f; - - emitter.RotFix = 0; - emitter.RotRnd = 0; - - emitter.RotVelFix = 0; - emitter.RotVelRnd = 0; - - emitter.EmitPerSec = 1000; - emitter.ColorRndStart = Color.FromArgb(33, 255, 255, 255); - emitter.ColorRndEnd = Color.FromArgb(11, 255, 255, 255); - emitter.IsLumAdded = false; - - // 将三个发射器添加到粒子对象中 - geoParticle.AddEmitter(emitter); - - geoParticle.Play(); - GSOFeature feature = new GSOFeature(); - - feature.Geometry = geoParticle; - - //globeControl1.Globe.MemoryLayer.AddFeature(feature); - globeControl1.Globe.FlyToFeature(feature); - - return feature; - } - - /// - /// 添加水柱 - /// - /// - private GSOFeature AddWaterLine() - { - string strResPath = Application.StartupPath + "/Resource"; - - GSOGeoParticle geoParticle = new GSOGeoParticle(); - geoParticle.SetPosition(116.308, 39.84, 0); // 添加到这个经纬度位置 - - GSOPointParticleEmitter emitter = new GSOPointParticleEmitter(); - - emitter.TexturePath = strResPath + "/ParticleImage/drop3.png"; - - geoParticle.TimerInterval = 1; - - emitter.SetSizeFix(2.0f, 2.0f); - - emitter.VelFix = 50; - emitter.VelRnd = 2; - - // emitter.IsLumAdded = false; - - emitter.GravityAcc = 9.8f; - emitter.AngleXYFix = 0; - emitter.AngleXYRnd = 2; - - emitter.AngleXZFix = 60; - emitter.AngleXZRnd = 2; - - //emitter.InnerRadius = 0; - // emitter.OuterRadius = 0.1f; - - emitter.LifeFix = 5.0f; - emitter.LifeRnd = 1.0f; - - emitter.RotFix = 0; - emitter.RotRnd = 0; - - emitter.RotVelFix = 0; - emitter.RotVelRnd = 0; - - emitter.EmitPerSec = 1500; - - emitter.ColorRndStart = Color.FromArgb(100, 222, 222, 222); - emitter.ColorRndEnd = Color.FromArgb(50, 222, 222, 222); - - /* - - GSOScaleParticleEffector effector1 = new GSOScaleParticleEffector(); - effector1.SetScale(0.2f, 0.2f); - effector1.StartTime = 0; - effector1.EndTime = -1; // 负数表示整个粒子生命结束 - emitter.AddEffector(effector1); - */ - - // 将三个发射器添加到粒子对象中 - geoParticle.AddEmitter(emitter); - - geoParticle.Play(); - GSOFeature feature = new GSOFeature(); - - feature.Geometry = geoParticle; - - //globeControl1.Globe.MemoryLayer.AddFeature(feature); - globeControl1.Globe.FlyToFeature(feature); - - return feature; - } + } } diff --git a/FrmBufferAnalysis.cs b/FrmBufferAnalysis.cs index f711133..db8ca59 100644 --- a/FrmBufferAnalysis.cs +++ b/FrmBufferAnalysis.cs @@ -123,39 +123,6 @@ } } /// - /// 半径文本框的键盘按键按下事件处理 - /// - /// - /// - private void txtRadius_KeyPress(object sender, KeyPressEventArgs e) - { - TextBox text = sender as TextBox; - if ((e.KeyChar < 48 || e.KeyChar > 57) && (e.KeyChar != 8) && (int)e.KeyChar != 46) - { - e.Handled = true; - } - if ((int)e.KeyChar == 46) //小数点 - { - if (text.Text.Length <= 0) - e.Handled = true; //小数点不能在第一位 - else //处理不规则的小数点 - { - float f; - float oldf; - bool b1 = false, b2 = false; - b1 = float.TryParse(text.Text, out oldf); - b2 = float.TryParse(text.Text + e.KeyChar.ToString(), out f); - if (b2 == false) - { - if (b1 == true) - e.Handled = true; - else - e.Handled = false; - } - } - } - } - /// /// 窗体关闭事件处理 /// /// diff --git a/FrmBufferAnalysisBSQ.cs b/FrmBufferAnalysisBSQ.cs index 24a96ca..f54208f 100644 --- a/FrmBufferAnalysisBSQ.cs +++ b/FrmBufferAnalysisBSQ.cs @@ -137,35 +137,7 @@ } } - private void txtRadius_KeyPress(object sender, KeyPressEventArgs e) - { - TextBox text = sender as TextBox; - if ((e.KeyChar < 48 || e.KeyChar > 57) && (e.KeyChar != 8) && (int)e.KeyChar != 46) - { - e.Handled = true; - } - if ((int)e.KeyChar == 46) //小数点 - { - if (text.Text.Length <= 0) - e.Handled = true; //小数点不能在第一位 - else //处理不规则的小数点 - { - float f; - float oldf; - bool b1 = false, b2 = false; - b1 = float.TryParse(text.Text, out oldf); - b2 = float.TryParse(text.Text + e.KeyChar.ToString(), out f); - if (b2 == false) - { - if (b1 == true) - e.Handled = true; - else - e.Handled = false; - } - } - } - } - + private void FrmBufferAnalysis_FormClosing(object sender, FormClosingEventArgs e) { //Form1.y = 0; @@ -316,27 +288,6 @@ } } - private void FlyToMenu_Click(object sender, EventArgs e) - { - if (m_feature != null) - { - if (m_feature.Geometry != null && m_feature.Geometry.Type == EnumGeometryType.GeoPolyline3D) - { - GSOGeoPolyline3D line = m_feature.Geometry as GSOGeoPolyline3D; - double length = line.GetSpaceLength(true, 6378137); - GSOGeoPolyline3D lineLine = line.GetSegment(0, length / 2); - GSOPoint3d point3d = lineLine[lineLine.PartCount - 1][lineLine[lineLine.PartCount - 1].Count - 1]; - - globeControl1.Globe.FlyToPosition(point3d, EnumAltitudeMode.Absolute, 0, 45, 5); - } - else - { - globeControl1.Globe.FlyToFeature(m_feature, 0, 45, 3); - } - LightMenu_Click(sender, e); - } - } - private void LightMenu_Click(object sender, EventArgs e) { flashflag = "single"; diff --git a/FrmDataBaseOpt.cs b/FrmDataBaseOpt.cs index b0c4b5d..8d7b69d 100644 --- a/FrmDataBaseOpt.cs +++ b/FrmDataBaseOpt.cs @@ -362,6 +362,7 @@ dbCombor.Items.Add(dblist[i].title); } } + /* /// /// 从配置文件读取数据库参数配置 /// @@ -428,6 +429,8 @@ } } + * */ + /* /// /// 向配置文件写入连接数据库的参数配置 /// @@ -485,6 +488,7 @@ MessageBox.Show(exp.ToString()); } } + * */ /// /// /// diff --git a/FrmDatabaseParaSetting.cs b/FrmDatabaseParaSetting.cs index a6fea46..63b596b 100644 --- a/FrmDatabaseParaSetting.cs +++ b/FrmDatabaseParaSetting.cs @@ -152,6 +152,7 @@ this.DialogResult = DialogResult.OK; this.Close(); } + /* /// /// 从配置文件读取数据库连接参数配置 /// @@ -218,6 +219,8 @@ } } + * */ + /* /// /// 向配置文件写入数据库参数配置 /// @@ -276,7 +279,7 @@ MessageBox.Show(ex.ToString()); } } - + */ /// /// 取消按钮事件处理 /// diff --git a/FrmDatabaseParaSetting2.cs b/FrmDatabaseParaSetting2.cs index 932d05e..96a87d5 100644 --- a/FrmDatabaseParaSetting2.cs +++ b/FrmDatabaseParaSetting2.cs @@ -148,6 +148,7 @@ this.DialogResult = DialogResult.OK; this.Close(); } + /* /// /// 从配置文件读取数据库连接参数配置 /// @@ -214,6 +215,8 @@ } } + * */ + /* /// /// 向配置文件写入数据库参数配置 /// @@ -272,7 +275,7 @@ MessageBox.Show(exp.ToString()); } } - + */ /// /// 取消按钮事件处理 /// diff --git a/FrmDiameterQuery.cs b/FrmDiameterQuery.cs index 68c948b..9a5215b 100644 --- a/FrmDiameterQuery.cs +++ b/FrmDiameterQuery.cs @@ -77,18 +77,7 @@ isBetween = true; } } - /// - /// 键盘按键按下事件处理 - /// - /// - /// - private void textBoxX1_KeyPress(object sender, KeyPressEventArgs e) - { - if ((e.KeyChar < 48 || e.KeyChar > 57) && e.KeyChar != 8) - { - e.Handled = true;//屏蔽 - } - } + bool isBetween = false; /// diff --git a/FrmDocumentEdit.cs b/FrmDocumentEdit.cs index aab2d31..e78a7ff 100644 --- a/FrmDocumentEdit.cs +++ b/FrmDocumentEdit.cs @@ -256,121 +256,6 @@ } - // - /// 将本地文件上传到指定的服务器(HttpWebRequest方法) - /// - /// 文件上传到的服务器 - /// 要上传的本地文件(全路径) - /// 文件上传后的名称 - /// 上传进度条 - /// 成功返回1,失败返回0 - private int Upload_Request(string address, string fileNamePath, string saveName, ProgressBar progressBar) - { - int returnValue = 0; - // 要上传的文件 - FileStream fs = new FileStream(fileNamePath, FileMode.Open, FileAccess.Read); - BinaryReader r = new BinaryReader(fs); - //时间戳 - string strBoundary = "----------" + DateTime.Now.Ticks.ToString("x"); - byte[] boundaryBytes = Encoding.ASCII.GetBytes("/r/n--" + strBoundary + "/r/n"); - //请求头部信息 - StringBuilder sb = new StringBuilder(); - sb.Append("--"); - sb.Append(strBoundary); - sb.Append("\r\n"); - sb.Append("Content-Disposition: form-data; name=\""); - sb.Append("file"); - sb.Append("\"; filename=\""); - sb.Append(saveName); - sb.Append("\""); - sb.Append("\r\n"); - sb.Append("Content-Type: "); - sb.Append("application/octet-stream"); - sb.Append("\r\n"); - sb.Append("\r\n"); - string strPostHeader = sb.ToString(); - byte[] postHeaderBytes = Encoding.UTF8.GetBytes(strPostHeader); - // 根据uri创建HttpWebRequest对象 - HttpWebRequest httpReq = (HttpWebRequest)WebRequest.Create(new Uri(address)); - httpReq.Method = "POST"; - //对发送的数据不使用缓存 - httpReq.AllowWriteStreamBuffering = false; - //设置获得响应的超时时间(300秒) - httpReq.Timeout = 300000; - httpReq.ContentType = "multipart/form-data; boundary=" + strBoundary; - long length = fs.Length + postHeaderBytes.Length + boundaryBytes.Length; - long fileLength = fs.Length; - httpReq.ContentLength = length; - try - { - progressBar.Maximum = int.MaxValue; - progressBar.Minimum = 0; - progressBar.Value = 0; - //每次上传4k - int bufferLength = 4096; - byte[] buffer = new byte[bufferLength]; - //已上传的字节数 - long offset = 0; - //开始上传时间 - DateTime startTime = DateTime.Now; - int size = r.Read(buffer, 0, bufferLength); - Stream postStream = httpReq.GetRequestStream(); - //发送请求头部消息 - postStream.Write(postHeaderBytes, 0, postHeaderBytes.Length); - while (size > 0) - { - postStream.Write(buffer, 0, size); - offset += size; - progressBar.Value = (int)(offset * (int.MaxValue / length)); - TimeSpan span = DateTime.Now - startTime; - double second = span.TotalSeconds; - //lblTime.Text = "已用时:" + second.ToString("F2") + "秒"; - //if (second > 0.001) - //{ - // lblSpeed.Text = " 平均速度:" + (offset / 1024 / second).ToString("0.00") + "KB/秒"; - //} - //else - //{ - // lblSpeed.Text = " 正在连接…"; - //} - //lblState.Text = "已上传:" + (offset * 100.0 / length).ToString("F2") + "%"; - //lblSize.Text = (offset / 1048576.0).ToString("F2") + "M/" + (fileLength / 1048576.0).ToString("F2") + "M"; - Application.DoEvents(); - size = r.Read(buffer, 0, bufferLength); - } - //添加尾部的时间戳 - postStream.Write(boundaryBytes, 0, boundaryBytes.Length); - postStream.Close(); - //获取服务器端的响应 - WebResponse webRespon = httpReq.GetResponse(); - Stream s = webRespon.GetResponseStream(); - StreamReader sr = new StreamReader(s); - //读取服务器端返回的消息 - String sReturnString = sr.ReadLine(); - s.Close(); - sr.Close(); - if (sReturnString == "Success") - { - returnValue = 1; - } - else if (sReturnString == "Error") - { - returnValue = 0; - } - } - catch(Exception ex) - { - returnValue = 0; - string str = ex.ToString(); - } - finally - { - fs.Close(); - r.Close(); - } - return returnValue; - } - private void btn_file_Click(object sender, EventArgs e) { OpenFileDialog dlg = new OpenFileDialog(); diff --git a/FrmExportCADS.cs b/FrmExportCADS.cs index 98772ea..59629dd 100644 --- a/FrmExportCADS.cs +++ b/FrmExportCADS.cs @@ -108,65 +108,6 @@ MessageBox.Show("请选中要导出的图层!", "提示", MessageBoxButtons.OK, MessageBoxIcon.Warning); } } - private Boolean MerageToFile(GSOFeatures features, String strDestFile, String strProj4)//图层追加 - { - if (features == null) - { - return false; - } - Boolean bSuccess = false; - - string strDir = GSOUtility.GetFileDir(strDestFile); - string strLPRJFile = GSOUtility.ChangeExt(strDestFile, ".lprj"); - string strExt = GSOUtility.GetFileExt(strDestFile); - - // 如果投影文件存在,投影以投影文件为准 - if (File.Exists(strLPRJFile)) - { - // 如果是dxf,则这样处理 - if (strExt.ToLower() == ".dxf") - { - string strTempSrcFile = strDir + "srcFeatures_dxftmp" + strExt; - globeControl1.Globe.DataManager.SaveFeatureData(features, strTempSrcFile, strLPRJFile, 4); - bSuccess = GSOUtility.MergeTwoDXFFileFeatures(strDestFile, strTempSrcFile); - File.Delete(strTempSrcFile); - } - else - { - GSOFeatures srcFeatures = globeControl1.Globe.DataManager.ReadFeatureData(strDestFile); - int nCount = features.Length; - int i = 0; - for (i = 0; i < nCount; i++) - { - srcFeatures.Add(features[i]); - } - bSuccess = globeControl1.Globe.DataManager.SaveFeatureData(srcFeatures, strDestFile, strLPRJFile, 4); - } - } - else - { - // 如果是dxf,则这样处理 - if (strExt.ToLower() == ".dxf") - { - string strTempSrcFile = strDir + "srcFeatures_dxftmp" + strExt; - globeControl1.Globe.DataManager.SaveFeatureData(features, strTempSrcFile, strProj4, 0); - bSuccess = GSOUtility.MergeTwoDXFFileFeatures(strDestFile, strTempSrcFile); - File.Delete(strTempSrcFile); - } - else - { - GSOFeatures srcFeatures = globeControl1.Globe.DataManager.ReadFeatureData(strDestFile); - int nCount = features.Length; - int i = 0; - for (i = 0; i < nCount; i++) - { - srcFeatures.Add(features[i]); - } - bSuccess = globeControl1.Globe.DataManager.SaveFeatureData(srcFeatures, strDestFile, strProj4, 0); - } - } - return bSuccess; - } /// /// 关闭按钮事件处理 /// diff --git a/FrmHDMAnalysis3.cs b/FrmHDMAnalysis3.cs index 4f73af6..2ada735 100644 --- a/FrmHDMAnalysis3.cs +++ b/FrmHDMAnalysis3.cs @@ -436,29 +436,6 @@ } layerTemp.RemoveAllFeature(); } - private void Export(GSOPoint3d _pnt, double r) - { - GSOPoint3ds pnts = new GSOPoint3ds(); - GSOPoint3d pnt = new GSOPoint3d(); - pnt.X = _pnt.X; - pnt.Y = _pnt.Y; - pnt.Z = _pnt.Z; - pnts.Add(pnt); - pnt.X = _pnt.X; - pnt.Y = _pnt.Y - 0.0000000005; - pnt.Z = _pnt.Z; - pnts.Add(pnt); - GSOGeoPolyline3D line = new GSOGeoPolyline3D(); - line.AddPart(pnts); - GSOGeoPolygon3D polygon = line.CreateBuffer(r * 2, true, 5, true, false); - GSOPoint3ds points = polygon[0]; - GSOGeoPolyline3D newLine = new GSOGeoPolyline3D(); - newLine.AddPart(points); - newLine.AltitudeMode = EnumAltitudeMode.RelativeToGround; - GSOFeature newFeature = new GSOFeature(); - newFeature.Geometry = newLine; - globeControl1.Globe.MemoryLayer.AddFeature(newFeature); - } private void ExportCAD(double a, double b, double r) { diff --git a/FrmHotFuncStat.cs b/FrmHotFuncStat.cs index c980f34..2eb1476 100644 --- a/FrmHotFuncStat.cs +++ b/FrmHotFuncStat.cs @@ -421,13 +421,6 @@ } } - private void HFS_Pderive_Click(object sender, EventArgs e) - { - if (TV_Files.SelectedNode != null) - { - HFSClass.GuideEdit_form("G", TV_Files, int.Parse(((ToolStripMenuItem)sender).Tag.ToString())); - } - } private void 导入ToolStripMenuItem_Click(object sender, EventArgs e) { @@ -530,22 +523,8 @@ } } - private void 导出ToolStripMenuItem1_Click(object sender, EventArgs e) - { - 导出ToolStripMenuItem2_Click(sender, e); - } + - private void TV_HFSSrchRslt_AfterCollapse(object sender, TreeViewEventArgs e) - { - e.Node.ImageIndex = 0; - } - - private void TV_HFSSrchRslt_AfterExpand(object sender, TreeViewEventArgs e) - { - HFSClass.ADD_TreeNode(TV_Files, e.Node); - e.Node.ImageIndex = 1; - } - private void 导出ToolStripMenuItem1_Click_1(object sender, EventArgs e) { if ((TV_HFSSrchRslt.SelectedNode != null) && (TV_HFSSrchRslt.SelectedNode.Parent != null)) diff --git a/FrmLayerControl.cs b/FrmLayerControl.cs index e7917c3..28fa14d 100644 --- a/FrmLayerControl.cs +++ b/FrmLayerControl.cs @@ -312,26 +312,7 @@ layerManagerNode.Expand(); terrainManagerNode.Expand(); } - /// - /// 刷新节点树 - /// - private void RefreshDataTree() - { - layerTree2.Nodes[0].Nodes.Clear(); - Int32 nCount = globeControl2.Globe.Layers.Count; - Int32 i = 0; - for (i = 0; i < nCount; i++) - { - GSODataset dataSpace = globeControl2.Globe.Layers[i].Dataset; - TreeNode node = new TreeNode(); - node.Text = dataSpace.Name; - node.ImageIndex = 0; - node.SelectedImageIndex = 0; - node.Checked = true; - node.Tag = dataSpace; - layerTree2.Nodes[0].Nodes.Add(node); - } - } + /// /// 目标图层按钮事件处理 /// @@ -494,22 +475,8 @@ } } } - /// - /// 改变指定节点的选中状态 - /// - /// - /// - private void CheckTreeNode(TreeNode node, Boolean bChecked) - { - CheckChildTreeNode(node, bChecked); - // 对于kml图层,如果当前处理的节点是true,那么要把所有的祖宗节点置为true - // 只有所有节点都未false,那么这个节点才为false - // CheckFatherTreeNode(node, bChecked); - globeControl1.Globe.Refresh(); - globeControl2.Globe.Refresh(); - - } + private void CheckChildTreeNode(TreeNode node, Boolean bChecked) { if (node == null) @@ -696,59 +663,7 @@ //} //CheckControl(e); } - /// - /// 树节点选中方法 - /// - /// - private void CheckControl(TreeViewEventArgs e) - { - if (e.Action != TreeViewAction.Unknown) - { - if (e.Node != null && !Convert.IsDBNull(e.Node)) - { - CheckParentNode(e.Node); - if (e.Node.Nodes.Count > 0) - { - CheckAllChildNodes(e.Node, e.Node.Checked); - } - } - } - } - /// - /// 改变所有子节点的状态 - /// - /// - /// - private void CheckAllChildNodes(TreeNode pn, bool IsChecked) - { - foreach (TreeNode tn in pn.Nodes) - { - tn.Checked = IsChecked; - if (tn.Tag.ToString().Contains("|")) - { - string nodeTag = tn.Tag.ToString().Split('|')[1]; - GSOLayer layer = globeControl1.Globe.Layers.GetLayerByCaption(nodeTag); - if (layer != null) - { - layer.Visible = IsChecked; - globeControl1.Globe.Refresh(); - } - } - if (tn.Tag is GSOFeature) - { - if (tn.Nodes.Count == 0) - { - GSOFeature feat = tn.Tag as GSOFeature; - feat.Visible = IsChecked; - globeControl1.Globe.Refresh(); - } - } - if (tn.Nodes.Count > 0) - { - CheckAllChildNodes(tn, IsChecked); - } - } - } + /// /// 改变父节点的选中状态,此处为所有子节点不选中时才取消父节点选中,可以根据需要修改 /// diff --git a/FrmLogin.cs b/FrmLogin.cs index 320fdd5..2afe46e 100644 --- a/FrmLogin.cs +++ b/FrmLogin.cs @@ -59,70 +59,6 @@ textBoxPassWord.Clear(); } } - - /// - /// 验证端口号 - /// - /// - private bool ValiPort() - { - Ping p = new Ping();//创建Ping对象p - PingReply pr = p.Send(Utility.localicenseserverip);//向指定IP或者主机名的计算机发送ICMP协议的ping数据包 - if (pr.Status == IPStatus.Success)//如果ping成功 - { - try - { - TcpClient tcpc = new TcpClient(Utility.localicenseserverip, Utility.localicenseserverport);//对IP地址为"192.168.0.105"的计算机的1500端口提出连接申请 - tcpc.Close(); - return true; - } - catch (Exception ex) - { - MessageBox.Show("端口连接错误!" + ex.Message); - return false; - } - } - else - { - int times = 0;//重新连接次数; - int count = 2;//设置尝试次数 - while (times < count) - { - //Thread.Sleep(1000);//等待时间(方便测试的话,你可以改为1000) - pr = p.Send(Utility.localicenseserverip); - - if (pr.Status == IPStatus.Success) - { - try - { - TcpClient tcpc = new TcpClient(Utility.localicenseserverip, Utility.localicenseserverport);//对IP地址为"192.168.0.105"的计算机的1500端口提出连接申请 - tcpc.Close(); - return true; - } - catch (Exception ex) - { - MessageBox.Show("端口连接错误!" + ex.Message); - return false; - } - } - else - { - times++; - if (times < count) - { - continue; - } - else - { - MessageBox.Show("重新尝试连接失败"); - return false; - } - } - - } - return false; - } - } /// /// 验证用户名、密码 /// diff --git a/FrmMetadata.cs b/FrmMetadata.cs index 886f65a..0365372 100644 --- a/FrmMetadata.cs +++ b/FrmMetadata.cs @@ -27,11 +27,7 @@ InitializeComponent(); loadTreeView(layerTree); } - private void FrmMetadata_Load(object sender, EventArgs e) - { - //this.ntLblC.Text = "nn"; - // loadTreeView(layerTree); - } + private void loadTreeView(TreeView tv)//构建图层树 { try diff --git a/FrmMetadataStat.cs b/FrmMetadataStat.cs index 790658a..e7696c6 100644 --- a/FrmMetadataStat.cs +++ b/FrmMetadataStat.cs @@ -197,9 +197,5 @@ } } - private void buttonX1_Click(object sender, EventArgs e) - { - drawChart(); - } } } diff --git a/FrmPatrolerManager.cs b/FrmPatrolerManager.cs index 37f8ffd..9e66aeb 100644 --- a/FrmPatrolerManager.cs +++ b/FrmPatrolerManager.cs @@ -109,82 +109,8 @@ this.winGridViewPager1.AllToExport = table; } - /// - /// 编辑 - /// - /// - /// - private void winGridViewPager1_OnEditSelected(object sender, EventArgs e) - { - - DataGridView grid = sender as DataGridView; - if (grid != null && grid.SelectedRows.Count>0) - { - DataGridViewRow row = grid.SelectedRows[0]; - try - { - long dbid = long.Parse(row.Cells["编号"].Value.ToString()); - String name = row.Cells["姓名"].Value.ToString(); - String sex = row.Cells["性别"].Value.ToString(); - String age = row.Cells["年龄"].Value.ToString(); - string phone = row.Cells["电话"].Value.ToString(); - age = String.IsNullOrEmpty(age.ToString().Trim()) ? "1" : age.ToString().Trim(); - FrmPatrolerEdit frm = new FrmPatrolerEdit(dbid.ToString(), name, age, sex, phone); - frm.reloadGrid += new ReloadPatrolerGrid(LoadData); - frm.ShowDialog(); - winGridViewPager1.Refresh(); - } - catch (Exception ex) - { - MessageBox.Show("编辑失败:" + ex.ToString(), "错误", MessageBoxButtons.OK, MessageBoxIcon.Error); - } - } - else - { - MessageBox.Show("没有选择记录", "提示"); - } - - } - - /// - /// 删除 - /// - /// - /// - private void winGridViewPager1_OnDeleteSelected(object sender, EventArgs e) - { - DataGridView grid = sender as DataGridView; - if (grid != null && grid.SelectedRows.Count > 0) - { - DataGridViewRow row = grid.SelectedRows[0]; - long dbid = long.Parse(row.Cells["编号"].Value.ToString()); - try - { - string state = row.Cells["状态"].Value.ToString(); - if ("在线".Equals(state)) - { - if (MessageBox.Show("确定注销?", "确认", MessageBoxButtons.YesNo, MessageBoxIcon.Question) == DialogResult.Yes) - { - String sql = "update patroler t set t.accountstate='LEAVER' where t.dbid=" + dbid; - OracleUtils.ExecuteNonQuery(OracleUtils.ConnectionString, CommandType.Text, sql); - } - } - else { - MessageBox.Show("人员不在线,无法注销", "信息"); - } - } - catch (Exception ex) - { - MessageBox.Show("人员注销失败:" + ex.ToString(), "错误", MessageBoxButtons.OK, MessageBoxIcon.Error); - } - } - else - { - MessageBox.Show("没有选择记录", "提示"); - } - } - - + + private void LoadData() { int pageIndex = winGridViewPager1.PagerInfo.CurrenetPageIndex; diff --git a/FrmRoadHDM.cs b/FrmRoadHDM.cs index e765313..e871dd5 100644 --- a/FrmRoadHDM.cs +++ b/FrmRoadHDM.cs @@ -333,31 +333,6 @@ this.Cursor = Cursors.Default; } } - - private void Export(GSOPoint3d _pnt, double r) - { - GSOPoint3ds pnts = new GSOPoint3ds(); - GSOPoint3d pnt = new GSOPoint3d(); - pnt.X = _pnt.X; - pnt.Y = _pnt.Y; - pnt.Z = _pnt.Z; - pnts.Add(pnt); - pnt.X = _pnt.X; - pnt.Y = _pnt.Y - 0.0000000005; - pnt.Z = _pnt.Z; - pnts.Add(pnt); - GSOGeoPolyline3D line = new GSOGeoPolyline3D(); - line.AddPart(pnts); - GSOGeoPolygon3D polygon = line.CreateBuffer(r * 2, true, 5, true, false); - GSOPoint3ds points = polygon[0]; - GSOGeoPolyline3D newLine = new GSOGeoPolyline3D(); - newLine.AddPart(points); - newLine.AltitudeMode = EnumAltitudeMode.RelativeToGround; - GSOFeature newFeature = new GSOFeature(); - newFeature.Geometry = newLine; - globeControl1.Globe.MemoryLayer.AddFeature(newFeature); - } - private void ExportCAD(double a, double b, double r) { GSOPoint3ds pnts = new GSOPoint3ds(); diff --git a/FrmUserAdd.cs b/FrmUserAdd.cs index c612ab4..f826427 100644 --- a/FrmUserAdd.cs +++ b/FrmUserAdd.cs @@ -231,24 +231,6 @@ //cbxRegion.SelectedIndexChanged += new EventHandler(cbxRegion_SelectedIndexChanged); } } - /// - /// 下拉框选中项改变事件处理 - /// - /// - /// - private void cbxRegion_SelectedIndexChanged(object sender, EventArgs e) - { - string sql = ""; - //string sql = "select casic_role.\"name\" from casic_role join casic_regionrole on casic_role.\"id\"=casic_regionrole.\"rid\" where casic_regionrole.\"reid\"=" + region[cbxRegion.SelectedItem.ToString().Trim()]; - DataTable dt = OledbHelper.QueryTable(sql); - if (dt != null && dt.Rows.Count > 0) - { - comboBoxExRegionRole.Items.Clear(); - for (int i = 0; i < dt.Rows.Count; i++) - { - comboBoxExRegionRole.Items.Add(dt.Rows[i][0].ToString().Trim());//部门角色 - } - } - } + } } diff --git a/FrmUserManager.cs b/FrmUserManager.cs index 571f0f0..ae254bc 100644 --- a/FrmUserManager.cs +++ b/FrmUserManager.cs @@ -81,11 +81,6 @@ } } } - //创建新用户 - private void buttonX2_Click(object sender, EventArgs e) - { - FrmUserAdd frm = new FrmUserAdd(-1); - frm.ShowDialog(); - } + } } diff --git a/FrmValveStatistics.cs b/FrmValveStatistics.cs index 545d56c..dd76777 100644 --- a/FrmValveStatistics.cs +++ b/FrmValveStatistics.cs @@ -54,7 +54,7 @@ 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") + if (chaFamenStatis.Series["阀门"].Points[m]!=null&&chaFamenStatis.Series["阀门"].Points[m].YValues[0].ToString() != "0") { chaFamenStatis.Series["阀门"].Points[m].Label = chaFamenStatis.Series[0].Points[m].YValues[0].ToString(); } diff --git a/Frm_password_reset.cs b/Frm_password_reset.cs index 7b51039..b9e5dc3 100644 --- a/Frm_password_reset.cs +++ b/Frm_password_reset.cs @@ -41,6 +41,7 @@ } catch (Exception ex) { + LogHelper.WriteLog(typeof(Frm_password_reset), ex.Message); } } private void initCombox() diff --git a/FrmpipeDeepstatis.cs b/FrmpipeDeepstatis.cs index e156db4..1a84d6c 100644 --- a/FrmpipeDeepstatis.cs +++ b/FrmpipeDeepstatis.cs @@ -307,7 +307,7 @@ chart1.Series[j].Points.DataBindXY(dic1.Keys, dic1.Values); for (int m = 0; m < dic1.Values.Count; m++) { - if (chart1.Series[j].Points[m].YValues[0].ToString() != "0") + if (chart1.Series[j].Points[m]!=null&&chart1.Series[j].Points[m].YValues[0].ToString() != "0") { chart1.Series[j].Points[m].Label = chart1.Series[j].Points[m].YValues[0].ToString(); diff --git a/FrmpipeDiametergather.cs b/FrmpipeDiametergather.cs index 30674de..057b09d 100644 --- a/FrmpipeDiametergather.cs +++ b/FrmpipeDiametergather.cs @@ -263,6 +263,7 @@ if (layer != null && layer is GSOFeatureLayer) { GSOFeatureLayer flayer = layer as GSOFeatureLayer; + if (layer == null) return; GSOFeatures features = flayer.GetAllFeatures(); if (features.Length > 0) { diff --git a/FrmpipeMaterialGather.cs b/FrmpipeMaterialGather.cs index c133ec3..398b884 100644 --- a/FrmpipeMaterialGather.cs +++ b/FrmpipeMaterialGather.cs @@ -280,6 +280,7 @@ if (layer != null && layer is GSOFeatureLayer) { GSOFeatureLayer flayer = layer as GSOFeatureLayer; + if (flayer == null) return; GSOFeatures features = flayer.GetAllFeatures(); if (features.Length > 0) { @@ -332,7 +333,7 @@ chart1.Series[j].Points.DataBindXY(dic1.Keys, dic1.Values); for (int m = 0; m < dic1.Values.Count; m++) { - if (chart1.Series[j].Points[m].YValues[0].ToString() != "0") + if (chart1.Series[j].Points[m]!=null&&chart1.Series[j].Points[m].YValues[0].ToString() != "0") { chart1.Series[j].Points[m].Label = chart1.Series[j].Points[m].YValues[0].ToString(); } diff --git a/Frmpipediameterstatis.cs b/Frmpipediameterstatis.cs index c0ed80a..50f8170 100644 --- a/Frmpipediameterstatis.cs +++ b/Frmpipediameterstatis.cs @@ -286,6 +286,7 @@ chart1.Series.Add(layerCaption); GSOFeatureLayer flayer = layer as GSOFeatureLayer; + if (layer == null) return; GSOFeatures features = flayer.GetAllFeatures(); if (features.Length > 0) { diff --git "a/GKT_Forms/F_GKT\346\225\260\346\215\256\350\276\223\345\205\245\350\276\223\345\207\272.cs" "b/GKT_Forms/F_GKT\346\225\260\346\215\256\350\276\223\345\205\245\350\276\223\345\207\272.cs" index c7bffd5..4db7d5d 100644 --- "a/GKT_Forms/F_GKT\346\225\260\346\215\256\350\276\223\345\205\245\350\276\223\345\207\272.cs" +++ "b/GKT_Forms/F_GKT\346\225\260\346\215\256\350\276\223\345\205\245\350\276\223\345\207\272.cs" @@ -198,12 +198,7 @@ } DialogResult = DialogResult.OK;//将当前窗体的对话框返回值设为OK } - private void treeView1_NodeMouseClick(object sender, TreeNodeMouseClickEventArgs e) - { - dir_Ok = comboBox_Disk.Text + e.Node.FullPath; - //dir = comboBox_Disk.Text + e.Node.FullPath; - e.Node.SelectedImageIndex = e.Node.ImageIndex; - } + string tempstr = ""; private void button1_Click(object sender, EventArgs e) { diff --git a/HFS_Forms/Frm_HFSprojedits.cs b/HFS_Forms/Frm_HFSprojedits.cs index 96dd76f..3c232a1 100644 --- a/HFS_Forms/Frm_HFSprojedits.cs +++ b/HFS_Forms/Frm_HFSprojedits.cs @@ -126,16 +126,6 @@ Close(); } - - - private void TB_ProjName_KeyPress(object sender, KeyPressEventArgs e) - { - if (HFSAClass.Files_NameChar(e) == 0) - e.Handled = true; - if (e.KeyChar == '\r') - OK_Click(sender, e); - } - private void Frm_HFSProjedit_Load(object sender, EventArgs e) { @@ -175,10 +165,6 @@ } } - private void Cancel_Click(object sender, EventArgs e) - { - this.Close(); - } private void Cancel_Click_1(object sender, EventArgs e) { diff --git a/MainFrm.cs b/MainFrm.cs index 2c305a0..ed2685b 100644 --- a/MainFrm.cs +++ b/MainFrm.cs @@ -617,7 +617,7 @@ } catch (Exception ex) { - + LogHelper.WriteLog(typeof(MainFrm), ex.Message); } } @@ -1768,7 +1768,7 @@ } catch (Exception ex) { - //LogError.PublishError(ex); + LogHelper.WriteLog(typeof(MainFrm), ex.Message); } } @@ -2026,6 +2026,7 @@ } catch (Exception ex) { + LogHelper.WriteLog(typeof(MainFrm), ex.Message); result = false; } finally @@ -2316,220 +2317,6 @@ string filename = Utility.filename; List g1layername = new List(); /// - /// 构建图层列表目录树 - /// - /// - private void loadTreeView(TreeView tv) - { - try - { - XmlDocument doc = new XmlDocument(); - doc.Load(filename); - XmlNodeList Params1 = doc.SelectNodes("/Params/layers"); - tv.ShowLines = false; - tv.CheckBoxes = true; - - foreach (XmlNode paramsNode in Params1) //layers - { - foreach (XmlNode layerNode in paramsNode) //layer - { - TreeNode nodelayer = new TreeNode(); - string layerName = layerNode.Attributes["label"].Value; - nodelayer.Text = layerName; - - if (layerNode.HasChildNodes != false) - { - tv.Nodes.Add(nodelayer); - foreach (XmlNode layerchildNode in layerNode) //layerchild - { - if (layerchildNode.Name == "layerchild") - { - TreeNode nodelayerchild = new TreeNode(); - string layerType = layerchildNode.Attributes["type"].Value; - string layerName1 = layerchildNode.Attributes["layer"].Value; - string layerchildName = layerchildNode.Attributes["label"].Value; - if (layerType == "locaserver") - { - if (layerchildNode.Attributes["isRoad"] != null) - { - roadLayerName = layerchildName; - } - dictionaryNetLayerNameAndCaption.Add(layerName1, layerchildName); - - nodelayerchild.Text = layerchildName; - nodelayerchild.Tag = layerType + "|" + layerchildName; - nodelayerchild.Checked = true; - nodelayer.Nodes.Add(nodelayerchild); - } - else - { - if (layerchildNode.Attributes["isPipeLine"] != null) - { - m_PipelineLayerNames.Add(layerchildName); - } - if (layerchildNode.Attributes["isWorkWell"] != null) - { - workwellLayerNames.Add(layerchildName); - } - if (layerchildNode.Attributes["isValve"] != null) - { - valueLayerNames.Add(layerchildName); - } - //if (layerchildNode.Attributes["isInstrument"] != null) - if (layerchildNode.Attributes["isAccess"] != null) - { - instrumenLayerNames.Add(layerchildName); - } - //if (layerchildNode.Attributes["isPipeFitting"] != null) - if (layerchildNode.Attributes["isCharacter"] != null) - { - pipefittingLayerNames.Add(layerchildName); - } - bool boollayer = AddLayers(layerName1, layerchildName); - nodelayerchild.Text = layerchildName; - nodelayerchild.Tag = layerType + "|" + layerchildName; - nodelayerchild.Checked = boollayer; - if (layerchildName.Contains("特征管点")) - { - nodelayerchild.Checked = false; - setLayerVisible(layerName1); - } - - nodelayer.Nodes.Add(nodelayerchild); - g1layername.Add(layerName1); - } - } - else if (layerchildNode.Name == "layertype") - { - TreeNode nodelayerchild = new TreeNode(); - string layerType = layerchildNode.Attributes["label"].Value; - nodelayerchild.Text = layerType; - nodelayerchild.Tag = layerType; - nodelayerchild.Checked = true; - nodelayer.Nodes.Add(nodelayerchild); - if (layerchildNode.HasChildNodes == true) - { - foreach (XmlNode childNodeLayer in layerchildNode) - { - if (childNodeLayer.HasChildNodes == true) - { - TreeNode nodelayerchild2 = new TreeNode(); - string layer = childNodeLayer.Attributes["label"].Value; - nodelayerchild2.Text = layer; - nodelayerchild2.Tag = layer; - nodelayerchild2.Checked = true; - nodelayerchild.Nodes.Add(nodelayerchild2); - foreach (XmlNode n in childNodeLayer) - { - TreeNode nodelayerchild1 = new TreeNode(); - string layerName1 = n.Attributes["layer"].Value; - string layerchildName = n.Attributes["label"].Value; - string layerType1 = n.Attributes["type"].Value; - if (n.Attributes["isPipeLine"] != null) - { - m_PipelineLayerNames.Add(layerchildName); - } - if (n.Attributes["isWorkWell"] != null) - { - workwellLayerNames.Add(layerchildName); - } - if (n.Attributes["isValve"] != null) - { - valueLayerNames.Add(layerchildName); - } - if (n.Attributes["isAccess"] != null) - //if (n.Attributes["isInstrument"] != null) - { - instrumenLayerNames.Add(layerchildName); - } - if (n.Attributes["isPipeFitting"] != null) - { - pipefittingLayerNames.Add(layerchildName); - } - bool boollayer = AddLayers(layerName1, layerchildName); - nodelayerchild1.Text = layerchildName; - nodelayerchild1.Tag = layerType1 + "|" + layerchildName; - nodelayerchild1.Checked = boollayer; - if (layerchildName.Contains("特征管点")) - { - nodelayerchild1.Checked = false; - setLayerVisible(layerName1); - } - - nodelayerchild2.Nodes.Add(nodelayerchild1); - - g1layername.Add(layerName1); - } - } - else - { - TreeNode nodelayerchild1 = new TreeNode(); - string layerName1 = childNodeLayer.Attributes["layer"].Value; - string layerchildName = childNodeLayer.Attributes["label"].Value; - string layerType1 = childNodeLayer.Attributes["type"].Value; - if (childNodeLayer.Attributes["isPipeLine"] != null) - { - m_PipelineLayerNames.Add(layerchildName); - } - if (childNodeLayer.Attributes["isWorkWell"] != null) - { - workwellLayerNames.Add(layerchildName); - } - if (childNodeLayer.Attributes["isValve"] != null) - { - valueLayerNames.Add(layerchildName); - } - if (childNodeLayer.Attributes["isAccess"] != null) - //if (childNodeLayer.Attributes["isInstrument"] != null) - { - instrumenLayerNames.Add(layerchildName); - } - if (childNodeLayer.Attributes["isPipeFitting"] != null) - { - pipefittingLayerNames.Add(layerchildName); - } - bool boollayer = AddLayers(layerName1, layerchildName); - nodelayerchild1.Text = layerchildName; - nodelayerchild1.Tag = layerType1 + "|" + layerchildName; - nodelayerchild1.Checked = boollayer; - if (layerchildName.Contains("特征管点")) - { - nodelayerchild1.Checked = false; - setLayerVisible(layerName1); - } - nodelayerchild.Nodes.Add(nodelayerchild1); - g1layername.Add(layerName1); - } - } - } - } - } - } - else - { - tv.Nodes.Add(nodelayer); - } - } - } - - foreach (TreeNode tn in tv.Nodes) - { - if (tn.Nodes.Count > 0) - { - foreach (TreeNode tnChild in tn.Nodes) - { - if (tnChild.Checked) - tn.Checked = true; - } - } - } - } - catch (Exception ex) - { - //LogError.PublishError(ex); - } - } - /// /// 获取目标图层 /// /// @@ -2629,21 +2416,11 @@ } catch (Exception ex) { - //LogError.PublishError(ex); + LogHelper.WriteLog(typeof(MainFrm), ex.Message); return false; } } /// - /// 菜单上的 三维导航 工具按钮 - /// - /// - /// - private void buttonItem86_Click(object sender, EventArgs e) - { - globeControl1.Globe.Action = EnumAction3D.ActionNull; - } - - /// /// 地上模式 菜单按钮 /// /// @@ -3026,67 +2803,11 @@ } Image printImage; - /// - /// 打印 菜单 - /// - /// - /// - private void buttonItem13_Click(object sender, EventArgs e) - { - Point pt1 = new Point(Convert.ToInt32(0), Convert.ToInt32(0)); - Point pt2 = new Point(Convert.ToInt32(panelEx5.Width), Convert.ToInt32(panelEx5.Height)); - int mapWidth = 0; - int mapHeight = 0; - Point pt = getUpperLeftPoint(pt1, pt2, out mapWidth, out mapHeight); - printImage = new Bitmap(Convert.ToInt32(panelEx5.Width), Convert.ToInt32(panelEx5.Height)); - Graphics g = Graphics.FromImage(printImage); - g.CopyFromScreen(pt, new Point(0, 0), new Size(Convert.ToInt32(panelEx5.Width), Convert.ToInt32(panelEx5.Height))); - - PrintDialog pd = new PrintDialog(); - try - { - if (pd.ShowDialog() == DialogResult.OK) //如果确认,将会覆盖所有的打印参数设置 - { - //打印预览 - PrintPreviewDialog ppd = new PrintPreviewDialog(); - ppd.Document = printDocument1; - if (DialogResult.OK == ppd.ShowDialog()) - { - printDocument1.Print(); //打印 - } - } - } - catch - { - printDocument1.PrintController.OnEndPrint(printDocument1, new System.Drawing.Printing.PrintEventArgs()); - } - } - + private void printDocument1_PrintPage(object sender, System.Drawing.Printing.PrintPageEventArgs e) { e.Graphics.DrawImage(printImage, 10, 10); } - - /// - /// 在窗体的底部状态栏上显示 综合管线条件查询结果 - /// - /// - /// - private void ToolStripText(string currentLayer, int dataCount) - { - if (dataCount != 0) - { - double featurelength = PipeLength(currentLayer, 0);// 统计管线的里程数 - - toolStripNumbers.Text = " 管线类型:" + currentLayer + " | 共有:" + Convert.ToString(dataCount - 1) + "条记录"; - toolStripFeatureLength.Text = " 管线里程:" + featurelength.ToString("0.00") + " 米"; - } - else - { - toolStripNumbers.Text = "管线类型: " + currentLayer + "| 共有:" + 0 + " 条记录 | "; - } - } - /// /// 统计管线的里程数 /// @@ -3402,26 +3123,6 @@ } /// - /// 绘制线 菜单 - /// - /// - /// - private void btnAddLine_Click(object sender, EventArgs e) - { - globeControl1.Globe.DestLayerFeatureAdd = globeControl1.Globe.MemoryLayer; - globeControl1.Globe.Action = EnumAction3D.DrawPolyline; - } - /// - /// 绘制面 菜单 - /// - /// - /// - private void btnAddPolygon_Click(object sender, EventArgs e) - { - globeControl1.Globe.DestLayerFeatureAdd = globeControl1.Globe.MemoryLayer; - globeControl1.Globe.Action = EnumAction3D.DrawPolygon; - } - /// /// 图层目录树 右键菜单中的 目标图层 菜单 /// /// @@ -3956,42 +3657,7 @@ // ClearUpDownTraceAnalysis(); //} - /// - /// 显示流向 功能 - /// - /// - /// - /// - private void Flow(object sender, string pipelineNameCN, bool bShow) - { - GSOFeatureLayer layer = globeControl1.Globe.Layers.GetLayerByCaption(pipelineNameCN) as GSOFeatureLayer; - GSOFeatures feats = layer.GetAllFeatures(); - for (int i = 0; i < feats.Length; i++) - { - GSOFeature feat = feats[i]; - GSOLineStyle3D lineStyle = feat.Geometry.Style as GSOLineStyle3D; - if (lineStyle != null) - { - if (lineStyle.ArrowStyle == null) - { - lineStyle.ArrowStyle = new GSOArrowStyle(); - lineStyle.ArrowStyle.BodyWidth = 2; - lineStyle.ArrowStyle.BodyLen = 6; - lineStyle.ArrowStyle.HeadWidth = 8; - lineStyle.ArrowStyle.HeadLen = 10; - lineStyle.ArrowStyle.OutlineVisible = true; - lineStyle.ArrowStyle.OutlineColor = Color.Red; - lineStyle.ArrowStyle.Speed = lineStyle.ArrowStyle.Speed / 2; - lineStyle.ArrowStyle.Play(); - } - lineStyle.ArrowVisible = bShow; - layerTree.SelectedNode = null; - } - } - globeControl1.Globe.Refresh(); - } - - + FrmCloseValves frm; /// /// 关阀分析 功能 @@ -4030,7 +3696,9 @@ curCAYNDataset.CloseValveAnalysis(lineFeature.ID, out arryResNodeID, out arryResValveID, false, true); } catch (Exception e) - { } + { + LogHelper.WriteLog(typeof(MainFrm), e.Message); + } string valveName = lineLayer.Caption; valveName = valveName.Substring(0, valveName.IndexOf("管线")); @@ -4106,7 +3774,7 @@ } catch (Exception e) { - + LogHelper.WriteLog(typeof(MainFrm), e.Message); } //目前只有燃气管线 有阀门 string valveName = lineLayer.Name; @@ -5457,7 +5125,7 @@ } catch (Exception ex) { - //MessageBox.Show(ex.ToString()); + LogHelper.WriteLog(typeof(MainFrm), ex.Message); } finally { @@ -5501,22 +5169,6 @@ } } - - /// - /// 清除所有坑 菜单 - /// - /// - /// - private void buttonItem3_Click(object sender, EventArgs e) - { - //日志记录 - LogManager.saveLog(Utility.userName, this.buttonItem3.Text); - - globeControl1.Globe.RemoveAllPits(); - } - - - ///// ///// 净距分析 菜单 ///// @@ -5554,42 +5206,8 @@ // ribbonBarTP.Visible = buttonItem34.Checked; // ribbonBarTP.Location = new Point(0, 0); //} - /// - /// 大气层 菜单 - /// - /// - /// - private void buttonItem17_Click_1(object sender, EventArgs e) - { - globeControl1.Globe.Atmosphere.Visible = !globeControl1.Globe.Atmosphere.Visible; - buttonItemSH1.Checked = globeControl1.Globe.Atmosphere.Visible; - globeControl1.Refresh(); - } - /// - /// 经纬网 菜单 - /// - /// - /// - private void buttonItem20_Click(object sender, EventArgs e) - { - globeControl1.Globe.LatLonGrid.Visible = !globeControl1.Globe.LatLonGrid.Visible; - buttonItemSH3.Checked = globeControl1.Globe.LatLonGrid.Visible; - globeControl1.Globe.Refresh(); - } - /// - /// 状态条 菜单 - /// - /// - /// - private void buttonItem21_Click_1(object sender, EventArgs e) - { - globeControl1.Globe.StatusBar.Visible = !globeControl1.Globe.StatusBar.Visible; - buttonItemSH4.Checked = globeControl1.Globe.StatusBar.Visible; - globeControl1.Globe.Refresh(); - } - - + /// /// 添加指定路径下的数据 功能 /// @@ -5680,43 +5298,7 @@ // } // return objRes; //} - /// - /// 刷新目录树 功能 - /// - private void RefreshDataTree() - { - layerTree.Nodes[0].Nodes.Clear(); - Int32 nCount = globeControl1.Globe.DataManager.DataSourceCount; - Int32 i = 0; - for (i = 0; i < nCount; i++) - { - GSODataSource dataSpace = globeControl1.Globe.DataManager[i]; - TreeNode node = new TreeNode(); - node.Text = dataSpace.Name; - node.ImageIndex = 0; - node.SelectedImageIndex = 0; - node.Checked = true; - node.Tag = dataSpace; - Int32 nDatasetCount = dataSpace.DatasetCount; - for (Int32 j = 0; j < nDatasetCount; j++) - { - GSODataset dataset = dataSpace[j]; - TreeNode subNode = new TreeNode(); - subNode.Text = dataset.Name; - subNode.ImageIndex = 0; - subNode.SelectedImageIndex = 0; - subNode.Checked = true; - subNode.Tag = dataset; - node.Nodes.Add(subNode); - } - layerTree.Nodes[0].Nodes.Add(node); - } - } - - - - - + /// /// 复合查询 菜单 @@ -5777,34 +5359,7 @@ return false; } - /// - /// 统计指定图层在指定范围内的所有feature对象 - /// - /// - /// - /// - private GSOFeatures Intersect_PointLayer(GSOGeoPolygon3D polygon, string pointLayerName) - { - GSOLayer layer = globeControl1.Globe.Layers.GetLayerByCaption(pointLayerName); - if (layer == null) - return null; - - GSOFeatureLayer flayer = layer as GSOFeatureLayer; - GSOFeatureDataset fdataset = flayer.Dataset as GSOFeatureDataset; - GSOFeatures feats; - if (polygon == null) - { - feats = flayer.GetAllFeatures(); - } - else - { - feats = flayer.FindFeaturesInPolygon(polygon, false); - } - - workWellLen.Add(pointLayerName, feats.Length); - return feats; - } - /// + /// /// 碰撞分析功能界面中 选择管线复选框 选中状态改变事件处理 /// /// @@ -5946,16 +5501,6 @@ MessageBox.Show("表格内容为空!", "提示"); } } - /// - /// 导出CAD 菜单 - /// - /// - /// - private void btnExportCAD_Click(object sender, EventArgs e) - { - FrmExportCADS frm = new FrmExportCADS(globeControl1, m_PipelineLayerNames); - frm.ShowDialog(); - } ///// ///// 区域分析 菜单 @@ -5987,16 +5532,6 @@ } } } - /// - /// 数据验证 菜单 - /// - /// - /// - private void buttonItem80_Click(object sender, EventArgs e) - { - FrmValiData frm = new FrmValiData(globeControl1); - frm.ShowDialog(); - } /// /// 根据指定图层创建图层节点并将节点添加到图层管理节点的子节点集合中 @@ -6018,56 +5553,7 @@ layerManagerNode.Expand(); } } - /// - /// 数据库备份 菜单 - /// - /// - /// - private void btnBackDatabase_Click(object sender, EventArgs e) - { - if (MessageBox.Show("是否确定要备份数据库文件", "信息", MessageBoxButtons.YesNo, MessageBoxIcon.Question) == DialogResult.Yes) - { - try - { - DateTime currentTime = DateTime.Now; - //string Dtime = currentTime.ToShortDateString().ToString("yyyy-MM-dd"); - string Dtime = currentTime.GetDateTimeFormats('D')[0].ToString(); - string Htime = DateTime.Now.ToString("HH时mm分ss秒").Trim(); - string fileName = Dtime + "(" + Htime + ")"; - string pathName = ""; - string sql = "select filename from master..sysdatabases where name='" + Utility.dbdatabase + "'"; - DataTable dt = OledbHelper.ExecuteDataTable(sql); - if (dt != null && dt.Rows.Count > 0) - { - pathName = dt.Rows[0][0].ToString().Trim(); - int count = pathName.LastIndexOf("\\") == -1 ? pathName.LastIndexOf("/") : pathName.LastIndexOf("\\"); - pathName = pathName.Substring(0, count); - } - pathName += "\\管网数据库" + fileName + ".bak"; - - OracleCommand cmdBK = new OracleCommand(); - cmdBK.CommandType = CommandType.Text; - cmdBK.Connection = connBackup; - cmdBK.CommandText = @"backup database " + Utility.dbdatabase + " to disk='" + pathName + "' with init"; - - connBackup.Open(); - cmdBK.ExecuteNonQuery(); - MessageBox.Show("数据库文件备份成功", "提示"); - } - catch (Exception ex) - { - MessageBox.Show(ex.ToString()); - } - finally - { - connBackup.Close(); - } - } - } - - - - + //GSOFeature emitterFeature; // 粒子要素 /// /// 添加火苗 功能 @@ -6598,361 +6084,15 @@ } } - - ///// - /// 添加用户仓库 菜单 - /// - /// - /// - private void buttonItem108_Click(object sender, EventArgs e) - { - FrmUserRepo frm = new FrmUserRepo(-1); - frm.ShowDialog(); - } - /// - /// 用户仓库管理 菜单 - /// - /// - /// - private void buttonItem111_Click(object sender, EventArgs e) - { - FrmUserRepoMgr frm = new FrmUserRepoMgr(); - frm.ShowDialog(); - } - /// - /// 添加分系统 菜单 - /// - /// - /// - private void buttonItem112_Click(object sender, EventArgs e) - { - //FrmAPP frm = new FrmAPP(-1); - //frm.ShowDialog(); - } - /// - /// 分系统管理 菜单 - /// - /// - /// - private void buttonItem113_Click(object sender, EventArgs e) - { - //FrmAPPMgr frm = new FrmAPPMgr(); - //frm.ShowDialog(); - } - /// - /// 添加操作 菜单 - /// - /// - /// - private void buttonItem114_Click(object sender, EventArgs e) - { - FrmOper frm = new FrmOper(-1); - frm.ShowDialog(); - } - /// - /// 操作管理 菜单 - /// - /// - /// - private void buttonItem115_Click(object sender, EventArgs e) - { - FrmOperMgr frm = new FrmOperMgr(); - frm.ShowDialog(); - } - /// - /// 添加资源 菜单 - /// - /// - /// - private void buttonItem116_Click(object sender, EventArgs e) - { - FrmRESC frm = new FrmRESC(-1); - frm.ShowDialog(); - } - /// - /// 资源管理 菜单 - /// - /// - /// - private void buttonItem117_Click(object sender, EventArgs e) - { - FrmRESCMgr frm = new FrmRESCMgr(); - frm.ShowDialog(); - } - /// - /// 添加权限 菜单 - /// - /// - /// - private void buttonItem118_Click(object sender, EventArgs e) - { - FrmPerm frm = new FrmPerm(-1); - frm.ShowDialog(); - } - /// - /// 权限管理 菜单 - /// - /// - /// - private void buttonItem119_Click(object sender, EventArgs e) - { - FrmPermMgr frm = new FrmPermMgr(); - frm.ShowDialog(); - } - /// - /// 添加访问控制 菜单 - /// - /// - /// - private void buttonItem120_Click(object sender, EventArgs e) - { - FrmAccess frm = new FrmAccess(-1); - frm.ShowDialog(); - } - /// - /// 访问控制管理 菜单 - /// - /// - /// - private void buttonItem121_Click(object sender, EventArgs e) - { - FrmAccessMgr frm = new FrmAccessMgr(); - frm.ShowDialog(); - } - /// - /// 部门类型管理 菜单 - /// - /// - /// - private void buttonItem122_Click(object sender, EventArgs e) - { - FrmRegionTypeMgr frm = new FrmRegionTypeMgr(); - frm.ShowDialog(); - } - /// - /// 用户信息管理 菜单 - /// - /// - /// - private void buttonItem128_Click_1(object sender, EventArgs e) - { - FrmUserManager frm = new FrmUserManager(); - frm.ShowDialog(); - } - /// - /// 添加角色 菜单 - /// - /// - /// - private void 添加角色_Click(object sender, EventArgs e) - { - FrmRole frm = new FrmRole(-1); - frm.ShowDialog(); - } - /// - /// 所有角色管理 菜单 - /// - /// - /// - private void 角色管理_Click(object sender, EventArgs e) - { - FrmRoleMgr frm = new FrmRoleMgr(); - frm.ShowDialog(); - } - - /// - /// 部门角色管理 菜单 - /// - /// - /// - private void buttonItem133_Click(object sender, EventArgs e) - { - FrmRegionRoleMgr frm = new FrmRegionRoleMgr(); - frm.ShowDialog(); - } - /// - /// 部门管理 菜单 - /// - /// - /// - private void buttonItem130_Click(object sender, EventArgs e) - { - FrmRegionMgr frm = new FrmRegionMgr(); - frm.ShowDialog(); - } - - /// - /// 日志管理 菜单 - /// - /// - /// - private void buttonItem135_Click(object sender, EventArgs e) - { - FrmLogManager frm = new FrmLogManager(); - frm.ShowDialog(); - } - /// - /// 传感器信息查询 菜单 - /// - /// - /// - private void buttonItem131_Click_1(object sender, EventArgs e) - { - GSOFeature selectedFeature = globeControl1.Globe.SelectedObject; - if (selectedFeature == null) - { - MessageBox.Show("请选择一个传感器对象!", "提示", MessageBoxButtons.OK, MessageBoxIcon.Information); - } - else - { - if (selectedFeature.Geometry != null && selectedFeature.Geometry.Type == EnumGeometryType.GeoModel) - { - GSOLayer layer = globeControl1.Globe.SelectedObjectLayer; - string tabelName = getTableName(layer.Caption); - string eqtID = selectedFeature.Description.Trim(); - if (tabelName != "" && eqtID != "") - { - string fields = getFields(tabelName); - if (fields != "") - { - string sql = "select " + fields + " from " + Utility.sensorDatabase + "." + tabelName + " where EqtID=" + eqtID + " order by RecordDate desc limit 1;"; - DataTable dt = MySqlHelper.queryDataTable(sql); - if (dt != null && dt.Rows.Count > 0) - { - FrmQueryMessage.ShowForm(this, dt, layer.Caption); - //queryMessage.Show(this); - } - else - { - MessageBox.Show("没有查询到相关信息!", "提示"); - } - } - else - { - MessageBox.Show("配置文件 \"sensorConfig.xml\" 有误!", "提示"); - } - } - else - { - MessageBox.Show("请选择一个传感器对象!", "提示"); - } - } - else - { - MessageBox.Show("请选择一个传感器对象!", "提示", MessageBoxButtons.OK, MessageBoxIcon.Information); - } - } - } - /// - /// 根据指定的图层的caption属性的值在配置文件中查找对应的数据库中的表的名称 - /// - /// 图层的caption属性的值 - /// 对应的数据库中的表的名称 - private string getTableName(string name) - { - string tabelName = ""; - if (Utility.sensorMarkerLayers != null) - { - for (int i = 0; i < Utility.sensorMarkerLayers.Count; i++) - { - MarkerLayer mLayer = Utility.sensorMarkerLayers[i]; - if (mLayer.layerName == name) - { - tabelName = mLayer.tableName; - break; - } - } - } - return tabelName; - } - /// - /// 根据数据库中的表的名称 查找对应的表中的字段名称的集合 - /// - /// 数据库中的表的名称 - /// 对应的表中的字段名称的集合 - private string getFields(string tabelName) - { - string fields = ""; - if (Utility.sensorMarkerLayers != null) - { - for (int i = 0; i < Utility.sensorMarkerLayers.Count; i++) - { - MarkerLayer mLayer = Utility.sensorMarkerLayers[i]; - if (mLayer.tableName.Trim() == tabelName.Trim()) - { - if (mLayer.fields != null) - { - foreach (string key in mLayer.fields.Keys) - { - string value = mLayer.fields[key]; - fields += tabelName.Trim() + "." + key + " as " + value + ","; - } - fields = fields.Remove(fields.Length - 1); - } - break; - } - } - } - return fields; - } - - /// - /// 历史曲线查询 菜单 - /// - /// - /// - private void buttonItem132_Click(object sender, EventArgs e) - { - GSOFeature selectedFeature = globeControl1.Globe.SelectedObject; - if (selectedFeature == null) - { - MessageBox.Show("请选择一个对象!", "提示", MessageBoxButtons.OK, MessageBoxIcon.Information); - } - else - { - if (selectedFeature.Geometry != null && selectedFeature.Geometry.Type == EnumGeometryType.GeoModel) - { - GSOLayer layer = globeControl1.Globe.SelectedObjectLayer; - string tabelName = getTableName(layer.Caption); - string eqtID = selectedFeature.Description; - if (tabelName != "" && eqtID != "") - { - FrmQueryHistory.ShowForm(this, tabelName, eqtID); - } - else - { - MessageBox.Show("请选择一个传感器对象!", "提示"); - } - } - else - { - MessageBox.Show("请选择一个传感器对象!", "提示", MessageBoxButtons.OK, MessageBoxIcon.Information); - } - } - } - + //定时检查传感器的状态 public System.Windows.Forms.Timer timerOfSensor = null; public int alarmValueLiuLiang = 0; public int alarmValueYaLi = 0; public int alarmValueYeTi = 0; public int alarmValueZaoSheng = 0; - /// - /// 传感器在线报警 菜单 - /// - /// - /// - private void buttonItem134_Click(object sender, EventArgs e) - { - if (timerOfSensor == null) - { - timerOfSensor = new System.Windows.Forms.Timer(); - timerOfSensor.Interval = 30000; - timerOfSensor.Tick += new EventHandler(timerOfSensor_Tick); - } - FrmQuerySensorAlarm.ShowForm(this); - } + /// /// 传感器报警 功能中的 定时器 的触发事件处理 /// @@ -7016,6 +6156,7 @@ } catch (Exception ex) { + LogHelper.WriteLog(typeof(MainFrm), ex.Message); continue; } } @@ -7025,145 +6166,7 @@ } } - - /// - /// 沿线运动 菜单 - /// - /// - /// - private void buttonItem138_Click(object sender, EventArgs e) - { - if (globeControl1.Globe.SelectedObject == null) - { - MessageBox.Show("请先选择一条线!", "提示", MessageBoxButtons.OK, MessageBoxIcon.Exclamation); - return; - } - - GSOFeature lineFeature = globeControl1.Globe.SelectedObject; - if (lineFeature.Geometry == null || lineFeature.Geometry.Type != EnumGeometryType.GeoPolyline3D) - { - MessageBox.Show("请先选择一条线!", "提示", MessageBoxButtons.OK, MessageBoxIcon.Exclamation); - return; - } - - OpenFileDialog dlg = new OpenFileDialog(); - dlg.Filter = "*.gcm;*.3ds|*.gcm;*.3ds|*.3ds|*.3ds|*.gcm|*.gcm"; - if (dlg.ShowDialog() == DialogResult.OK) - { - GSOGeoModel model = new GSOGeoModel(); - model.FilePath = dlg.FileName; - - GSOGeoDynamicRoute dynamicRoute = new GSOGeoDynamicRoute(); - dynamicRoute.ActorGeometry = model; - - GSORoute route = new GSORoute(); - GSOGeoPolyline3D geoline = (GSOGeoPolyline3D)lineFeature.Geometry; - for (int i = 0; i < geoline[0].Count; i++) - { - route.Add(geoline[0][i]); - } - route.CircleRoute = false; - route.Speed = 30; - route.RotateSpeed = 50; - route.AltitudeMode = geoline.AltitudeMode; - dynamicRoute.Route = route; - - GSOFeature feature = new GSOFeature(); - - dynamicRoute.Play(); - feature.Geometry = dynamicRoute; - - //GSOLabel gsoLabel = new GSOLabel(); - //gsoLabel.Text = "模型测试"; - //feature.Label = gsoLabel; - globeControl1.Globe.MinModelVisibleSize = 0; - - globeControl1.Globe.MemoryLayer.AddFeature(feature); - globeControl1.Globe.Refresh(); - } - } - /// - /// 回退 菜单 - /// - /// - /// - private void buttonItem99_Click(object sender, EventArgs e) - { - globeControl1.Globe.UnDoEdit(); - } - /// - /// 前进 菜单 - /// - /// - /// - private void buttonItem100_Click(object sender, EventArgs e) - { - globeControl1.Globe.ReDoEdit(); - } - /// - /// 水平净距 功能界面中的 标签内容改变事件处理 - /// - /// - /// - private void textBoxX4_TextChanged(object sender, EventArgs e) - { - string valueJingJu = textBoxX4.Text.Trim(); - if (valueJingJu != "") - { - double value = 0; - bool bl = double.TryParse(valueJingJu, out value); - if (bl) - { - labelX24.Text = "水平净距小于" + value.ToString() + "米的管线有:"; - } - } - } - /// - /// 垂直净距 功能界面中的 标签内容改变事件处理 - /// - /// - /// - private void textBoxX2_TextChanged(object sender, EventArgs e) - { - string valueJingJu = textBoxX2.Text.Trim(); - if (valueJingJu != "") - { - double value = 0; - bool bl = double.TryParse(valueJingJu, out value); - if (bl) - { - labelX23.Text = "垂直净距小于" + value.ToString() + "米的管线有:"; - } - } - } - /// - /// 覆土分析 功能界面中的 标签内容改变事件处理 - /// - /// - /// - private void textBoxX3_TextChanged(object sender, EventArgs e) - { - string valueJingJu = textBoxX3.Text.Trim(); - if (valueJingJu != "") - { - double value = 0; - bool bl = double.TryParse(valueJingJu, out value); - if (bl) - { - labelX17.Text = "覆土深度小于" + value.ToString() + "米的管线有:"; - } - } - } - - /// - /// 传感器分类查询 全区域 菜单 - /// - /// - /// - private void buttonItemSensor全区域查询_Click(object sender, EventArgs e) - { - FrmAccessoriesSensor.ShowForm(globeControl1, instrumenLayerNames, 0); - } + /// /// 传感器分类查询 绘制区域 菜单 /// @@ -7224,170 +6227,10 @@ layerTemp.RemoveAllFeature(); globeControl1.Refresh(); } - /// - /// 数字预处理 功能 - /// - /// - /// - private void 数字预处理buttonItem140_Click(object sender, EventArgs e) - { - FrmEditShapeFile frm = new FrmEditShapeFile(globeControl1); - frm.ShowDialog(this); - } - - - /// - /// 导出矢量 功能 将图层导出为kml和shp格式数据 - /// - /// - /// - private void 导出矢量buttonItem140_Click(object sender, EventArgs e) - { - /* - List m_PipelineLayerNames = new List();//线图层名称 - List workwellLayerNames = new List();//工井图层名称 - List valueLayerNames = new List();//阀门图层名称 - List instrumenLayerNames = new List();//附属物图层名称 - List pipefittingLayerNames = new List();//管件图层名称 - */ - List listVectorNames = new List(); - for (int i = 0; i < m_PipelineLayerNames.Count; i++) - { - if (m_PipelineLayerNames[i] == "移动" || m_PipelineLayerNames[i] == "联通" - || m_PipelineLayerNames[i] == "电信" || m_PipelineLayerNames[i] == "共通" - || m_PipelineLayerNames[i] == "有限电视" || m_PipelineLayerNames[i] == "交通信号" - || m_PipelineLayerNames[i] == "供电") - { - continue; - } - if (listVectorNames.Contains(m_PipelineLayerNames[i]) == false) - { - listVectorNames.Add(m_PipelineLayerNames[i]); - } - } - for (int i = 0; i < valueLayerNames.Count; i++) - { - if (listVectorNames.Contains(valueLayerNames[i]) == false) - { - listVectorNames.Add(valueLayerNames[i]); - } - } - for (int i = 0; i < workwellLayerNames.Count; i++) - { - if (listVectorNames.Contains(workwellLayerNames[i]) == false) - { - listVectorNames.Add(workwellLayerNames[i]); - } - } - for (int i = 0; i < instrumenLayerNames.Count; i++) - { - if (listVectorNames.Contains(instrumenLayerNames[i]) == false) - { - listVectorNames.Add(instrumenLayerNames[i]); - } - } - for (int i = 0; i < pipefittingLayerNames.Count; i++) - { - if (listVectorNames.Contains(pipefittingLayerNames[i]) == false) - { - listVectorNames.Add(pipefittingLayerNames[i]); - } - } - FrmExportVector frm = new FrmExportVector(globeControl1, listVectorNames); - frm.ShowDialog(); - } string citySevenLineType = ""; string cityServerLineName = ""; /// - /// 绘制城市七线 功能按钮 - /// - /// - /// - private void 绘制城市七线buttonItem140_Click(object sender, EventArgs e) - { - FrmCitySevenLineType frm = new FrmCitySevenLineType(); - if (frm.ShowDialog() == DialogResult.OK) - { - globeControl1.Globe.Action = EnumAction3D.DrawPolyline; - m_isDrawCitySevenLine = true; - m_isDrawTunnel = false; - m_AddPipeLine = false; - this.citySevenLineType = frm.citySevenLineType; - this.cityServerLineName = frm.citySevenLineName; - switch (frm.citySevenLineType) - { - case "城市红线": - GSOLayer layerRed = globeControl1.Globe.Layers.GetLayerByCaption(frm.citySevenLineType); - if (layerRed != null) - { - globeControl1.Globe.DestLayerFeatureAdd = layerRed; - layerRed.Editable = true; - } - break; - case "城市橙线": - GSOLayer layerOrange = globeControl1.Globe.Layers.GetLayerByCaption(frm.citySevenLineType); - if (layerOrange != null) - { - globeControl1.Globe.DestLayerFeatureAdd = layerOrange; - layerOrange.Editable = true; - } - break; - case "城市黄线": - GSOLayer layerYellow = globeControl1.Globe.Layers.GetLayerByCaption(frm.citySevenLineType); - if (layerYellow != null) - { - globeControl1.Globe.DestLayerFeatureAdd = layerYellow; - layerYellow.Editable = true; - } - break; - case "城市绿线": - GSOLayer layerGreen = globeControl1.Globe.Layers.GetLayerByCaption(frm.citySevenLineType); - if (layerGreen != null) - { - globeControl1.Globe.DestLayerFeatureAdd = layerGreen; - layerGreen.Editable = true; - } - break; - case "城市蓝线": - GSOLayer layerBlue = globeControl1.Globe.Layers.GetLayerByCaption(frm.citySevenLineType); - if (layerBlue != null) - { - globeControl1.Globe.DestLayerFeatureAdd = layerBlue; - layerBlue.Editable = true; - } - break; - case "城市紫线": - GSOLayer layerPurple = globeControl1.Globe.Layers.GetLayerByCaption(frm.citySevenLineType); - if (layerPurple != null) - { - globeControl1.Globe.DestLayerFeatureAdd = layerPurple; - layerPurple.Editable = true; - } - break; - case "城市黑线": - GSOLayer layerBlack = globeControl1.Globe.Layers.GetLayerByCaption(frm.citySevenLineType); - if (layerBlack != null) - { - globeControl1.Globe.DestLayerFeatureAdd = layerBlack; - layerBlack.Editable = true; - } - break; - } - } - } - /// - /// 七线审核 功能按钮 - /// - /// - /// - private void 七线审核buttonItem141_Click(object sender, EventArgs e) - { - FrmCityServerLineAnalysis frm = new FrmCityServerLineAnalysis(globeControl1, m_PipelineLayerNames); - frm.ShowDialog(this); - } - - /// /// 间距分析 开始分析按钮 分析绘制的七线和管线的距离是否符合标准 /// /// @@ -7666,25 +6509,6 @@ } } - - - /// - /// 管线自动缩进 菜单 - /// - /// - /// - private void 管线自动缩进buttonItem140_Click(object sender, EventArgs e) - { - FrmPipelineIndented frm = new FrmPipelineIndented(globeControl1, m_PipelineLayerNames, workwellLayerNames); - frm.ShowDialog(this); - } - - private void btnExportCADs_Click(object sender, EventArgs e) - { - - } - - /// /// 统计指定图层在指定范围内的所有feature对象 /// @@ -7755,8 +6579,6 @@ } - - //设置图层为隐藏 private void setLayerVisible(string layerName) { @@ -7765,27 +6587,7 @@ globeControl1.Globe.Refresh(); } - /// - /// 连接数据库 - /// - /// - /// - private void buttonItem129_Click(object sender, EventArgs e) - { - //保存日志 - LogManager.saveLog(Utility.userName, this.buttonItemSJGL4_1.Text); - - FrmDatabaseParaSetting2 frm = new FrmDatabaseParaSetting2(globeControl1); - if (frm.ShowDialog() == DialogResult.OK) - { - ds = FrmDatabaseParaSetting2.ds; - if (ds != null) - { - ds.IsCloseSaved = false; - } - } - } - + /// /// 清除渲染结果 /// @@ -7803,112 +6605,8 @@ layerTemp.RemoveAllFeature(); globeControl1.Refresh(); } - - /// - /// 绘制垂线 - /// - /// - /// - private void drawCLine(GSOPoint3d fpt, GSOPoint3d tpt) - { - GSOGeoPolyline3D pline = new GSOGeoPolyline3D(); - GSOPoint3ds pts = new GSOPoint3ds(); - pts.Add(fpt); - pts.Add(tpt); - pline.AddPart(pts); - - GSOGeoPoint3D fptg = new GSOGeoPoint3D(); - GSOGeoPoint3D tptg = new GSOGeoPoint3D(); - fptg.X = fpt.X; - fptg.Y = fpt.Y; - fptg.Z = 0; - tptg.X = tpt.X; - tptg.Y = tpt.Y; - tptg.Z = 0; - - GSOFeature gf = new GSOFeature(); - gf.Geometry = pline; - - globeControl1.Globe.MemoryLayer.AddFeature(gf); - - } - /// - /// 红线审核 - /// - /// - /// - private void buttonItem138_Click_2(object sender, EventArgs e) - { - - } - /// - /// 比较两个点是否是同一个点 - /// - /// - /// - /// - private bool comparePoint(GSOPoint3d pt1, GSOPoint3d pt2) - { - double x1 = 0; double y1 = 0; - double x2 = 0; double y2 = 0; - x1 = pt1.X; - y1 = pt1.Y; - x2 = pt2.X; - y2 = pt2.Y; - if ((x1 == x2) && (y1 == y2)) - { - return true; - } - return false; - } - /// - /// 获得点到线的垂线距离及垂点 - /// - /// - /// - /// - /// - private void comparePointLine(GSOPoint3d point, GSOGeoPolyline3D line, out double length, out GSOPoint3d pointChuiDian) - { - GSOPoint3d lineStartPoint = line[0][0]; - GSOPoint3d lineEndPoint = line[0][1]; - GSOGeoPolyline3D lineAB = new GSOGeoPolyline3D(); - GSOPoint3ds pointsAB = new GSOPoint3ds(); - pointsAB.Add(point); - pointsAB.Add(lineStartPoint); - lineAB.AddPart(pointsAB); - double lengthAB = lineAB.GetSpaceLength(false, 6378137.0); - double xieLvAB = getXieLu("", point.X, point.Y, lineStartPoint.X, lineStartPoint.Y); - double xieLvBC = getXieLu("", lineStartPoint.X, lineStartPoint.Y, lineEndPoint.X, lineEndPoint.Y); - - double tanABC = Math.Abs(xieLvAB - xieLvBC) / (1 + xieLvAB * xieLvBC); - double angle = Math.Atan(tanABC); - //if (angle > Math.PI / 2) //落在外边 - //{ - // length = 0; - //} - double lengthAD = lengthAB * Math.Sin(angle); - length = Math.Abs(lengthAD); - double lengthBD = lengthAB * Math.Cos(angle); - - GSOPoint2d point2dStart = Latlon_2_XYZ(lineStartPoint.X, lineStartPoint.Y); - double bBC = point2dStart.Y - xieLvBC * point2dStart.X; - GSOPoint2d point2dEnd = new GSOPoint2d(); - point2dEnd.X = point2dStart.X + 100; - point2dEnd.Y = point2dEnd.X * xieLvBC + bBC; - point2dEnd = XYZ_2_Latlon(point2dEnd.X, point2dEnd.Y); - - GSOPoint3d pointEnd = new GSOPoint3d(); - pointEnd.X = point2dEnd.X; - pointEnd.Y = point2dEnd.Y; - GSOGeoPolyline3D lineYanShen = new GSOGeoPolyline3D(); - GSOPoint3ds pointsYanShen = new GSOPoint3ds(); - pointsYanShen.Add(lineStartPoint); - pointsYanShen.Add(pointEnd); - lineYanShen.AddPart(pointsYanShen); - GSOGeoPolyline3D lineSegment = lineYanShen.GetSegment(0, lengthBD); - pointChuiDian = lineSegment[0][1]; - } + + /// /// 获得斜率 /// @@ -8044,255 +6742,6 @@ } /// - /// 获取与点相连的所有线以及线的点的集合 - /// - /// 选定的点所在的线 - /// 选定的点 - /// 面中不完全包含的除起点线之外所有的线 - /// 选定的点所在的点的集合 - /// 所有以选定线为起点的点的集合 - /// - private List getFeaturesPoints(GSOFeature featureSelect, GSOPoint3d lineStart, GSOFeatures selectFeatures, GSOPoint3ds ps, List listPS) - { - GSOFeatures fsStart = new GSOFeatures(); - for (int n = 0; n < selectFeatures.Length; n++) - { - if (featureSelect.ID == selectFeatures[n].ID) - { - continue; - } - GSOGeoPolyline3D newLine = selectFeatures[n].Geometry as GSOGeoPolyline3D; - if (newLine != null && newLine.PartCount > 0) - { - GSOPoint3d newLineStart = newLine[0][0]; - GSOPoint3d newLineEnd = newLine[0][newLine[0].Count - 1]; - if (lineStart.X == newLineEnd.X && lineStart.Y == newLineEnd.Y) - { - GSOPoint3ds psAdd = new GSOPoint3ds(); - for (int k = newLine[0].Count - 1; k >= 0; k--) - { - psAdd.Add(newLine[0][k]); - } - newLine[0] = psAdd; - fsStart.Add(selectFeatures[n]); - - } - else if (lineStart.X == newLineStart.X && lineStart.Y == newLineStart.Y) - { - fsStart.Add(selectFeatures[n]); - - } - } - } - if (fsStart.Length > 0) - { - for (int m = 0; m < fsStart.Length; m++) - { - GSOGeoPolyline3D lineFsStart = fsStart[m].Geometry as GSOGeoPolyline3D; - if (lineFsStart != null && lineFsStart.PartCount > 0) - { - GSOPoint3ds psAdd = ps.Clone(); - for (int k = 0; k < lineFsStart[0].Count; k++) - { - psAdd.Add(lineFsStart[0][k]); - } - listPS = getFeaturesPoints(fsStart[m], lineFsStart[0][lineFsStart[0].Count - 1], selectFeatures, psAdd, listPS); - } - } - } - else - { - listPS.Add(ps); - } - return listPS; - } - - /// - /// 获取切割面的线 - /// - /// 不完全包含在面中的所有线 - /// 完全包含在面中的所有线 - /// 线 - private GSOFeature getLineFromGSOFeatures(GSOFeatures features, GSOFeatures featuresTrue) - { - //1. 当线对象数组的长度为0时,返回空 - if (features.Length == 0) - { - return null; - } - //2. 当线对象数组的长度为1时,返回这条线 - if (features.Length == 1) - { - return features[0]; - } - //3. 当线对象数组的长度大于1时,计算所有线组成的最长线 - - //3.1 获取所有不完全包含在面中的对象selectFeatures - GSOFeatures selectFeatures = new GSOFeatures(); - for (int a = 0; a < features.Length; a++) - { - selectFeatures.Add(features[a].Clone()); - } - //3.2 删除features中完全包含在面中的线,获取和面的边界相交的线对象 - for (int a = 0; a < featuresTrue.Length; a++) - { - for (int b = 0; b < features.Length; b++) - { - if (featuresTrue[a].ID == features[b].ID) - { - features.Remove(b); - break; - } - } - } - //3.3 如果和面的边界相交的线的数量为0,返回空 - if (features.Length == 0) - { - return null; - } - //3.4 获取第一条和面的边界相交的线featureInOutPolygon - GSOFeature featureInOutPolygon = features[0]; - //3.5 从所有的线中删除featureInOutPolygon - for (int a = 0; a < selectFeatures.Length; a++) - { - if (selectFeatures[a].ID == featureInOutPolygon.ID) - { - selectFeatures.Remove(a); - break; - } - } - //listPS存储所有从featureInOutPolygon出发的点的集合 - List listPS = new List(); - //3.5 获取与featureInOutPolygon相连的线的集合 - GSOGeoPolyline3D line = featureInOutPolygon.Geometry as GSOGeoPolyline3D; - if (line != null && line.PartCount > 0) - { - GSOPoint3d lineStart = line[0][0]; - GSOPoint3d lineEnd = line[0][line[0].Count - 1]; - #region//获取和featureInOutPolygon的起点相连的线 - GSOFeatures fsStart = new GSOFeatures(); - for (int n = 0; n < selectFeatures.Length; n++) - { - GSOGeoPolyline3D newLine = selectFeatures[n].Geometry as GSOGeoPolyline3D; - if (newLine != null && newLine.PartCount > 0) - { - GSOPoint3d newLineStart = newLine[0][0]; - GSOPoint3d newLineEnd = newLine[0][newLine[0].Count - 1]; - if (lineStart.X == newLineEnd.X && lineStart.Y == newLineEnd.Y) - { - GSOPoint3ds psAdd = new GSOPoint3ds(); - for (int k = newLine[0].Count - 1; k >= 0; k--) - { - psAdd.Add(newLine[0][k]); - } - newLine[0] = psAdd; - fsStart.Add(selectFeatures[n]); - - } - else if (lineStart.X == newLineStart.X && lineStart.Y == newLineStart.Y) - { - fsStart.Add(selectFeatures[n]); - } - } - } - #endregion - - #region//获取和featureInOutPolygon的终点相连的线 - GSOFeatures fsEnd = new GSOFeatures(); - for (int n = 0; n < selectFeatures.Length; n++) - { - GSOGeoPolyline3D newLine = selectFeatures[n].Geometry as GSOGeoPolyline3D; - if (newLine != null && newLine.PartCount > 0) - { - GSOPoint3d newLineStart = newLine[0][0]; - GSOPoint3d newLineEnd = newLine[0][newLine[0].Count - 1]; - if (lineEnd.X == newLineStart.X && lineEnd.Y == newLineStart.Y) - { - fsEnd.Add(selectFeatures[n]); - - } - else if (lineEnd.X == newLineEnd.X && lineEnd.Y == newLineEnd.Y) - { - GSOPoint3ds psAdd = new GSOPoint3ds(); - for (int k = newLine[0].Count - 1; k >= 0; k--) - { - psAdd.Add(newLine[0][k]); - } - newLine[0] = psAdd; - fsEnd.Add(selectFeatures[n]); - - } - } - } - #endregion - - //3.6 将featureInOutPolygon的所有点和与之起点相连的线的所有点组成一个点的集合并添加到listPS中 - if (fsStart.Length > 0 && fsEnd.Length == 0) - { - for (int m = 0; m < fsStart.Length; m++) - { - GSOGeoPolyline3D lineFsStart = fsStart[m].Geometry as GSOGeoPolyline3D; - if (lineFsStart != null && lineFsStart.PartCount > 0) - { - GSOPoint3ds psAdd = new GSOPoint3ds(); - for (int k = line[0].Count - 1; k >= 0; k--) - { - psAdd.Add(line[0][k]); - } - for (int k = 0; k < lineFsStart[0].Count; k++) - { - psAdd.Add(lineFsStart[0][k]); - } - - listPS = getFeaturesPoints(fsStart[m], lineFsStart[0][lineFsStart[0].Count - 1], selectFeatures, psAdd, listPS); - - } - } - } - //3.6 将featureInOutPolygon的所有点和与之终点相连的线的所有点组成一个点的集合并添加到listPS中 - else if (fsStart.Length == 0 && fsEnd.Length > 0) - { - for (int n = 0; n < fsEnd.Length; n++) - { - GSOGeoPolyline3D lineFsEnd = fsEnd[n].Geometry as GSOGeoPolyline3D; - if (lineFsEnd != null && lineFsEnd.PartCount > 0) - { - GSOPoint3ds psAdd = new GSOPoint3ds(); - for (int k = 0; k < line[0].Count - 1; k++) - { - psAdd.Add(line[0][k]); - } - for (int k = 0; k < lineFsEnd[0].Count; k++) - { - psAdd.Add(lineFsEnd[0][k]); - } - //获取线fsEnd[n]的另一个端点相连的线并记录该线的点的集合 - listPS = getFeaturesPoints(fsEnd[n], lineFsEnd[0][lineFsEnd[0].Count - 1], selectFeatures, psAdd, listPS); - } - } - } - } - - //3.7 获取所有以featureInOutPolygon为起点的点的集合组成的线中的最长的线 - double maxLength = 0; - GSOFeature featureNew = new GSOFeature(); - for (int h = 0; h < listPS.Count; h++) - { - GSOGeoPolyline3D lineNew = new GSOGeoPolyline3D(); - lineNew.AddPart(listPS[h]); - GSOLabel label = new GSOLabel(); - label.Text = h.ToString(); - featureNew.Label = label; - double length = lineNew.GetSpaceLength(true, 6378137); - if (length > maxLength) - { - featureNew.Geometry = lineNew; - } - } - - return featureNew; - } - /// /// 更新最大最小状态 /// /// @@ -8340,219 +6789,6 @@ - private void buttonItem139_Click(object sender, EventArgs e) - { - - string filepath = ""; - //日志记录 - OpenFileDialog dlg = new OpenFileDialog(); - dlg.Filter = "矢量数据(*.shp)|*.shp|矢量数据(*.lgd)|*.lgd|全部支持格式(*.lgd,*.shp)|*.lgd;*.shp;"; - //dlg.Filter = "支持格式(*.lrp,*.tif,*.img,*.lrc,*.kml,*.lgd,*.shp,*.gft)|*.lrp;*.tif;*.img;*.lrc;*.kml;*.lgd;*.shp;*.gft|栅格数据(*.lrp)|*.lrp|栅格缓存(*.lrc)|*.lrc|KML数据(*.kml)|*.kml|矢量数据(*.lgd)|*.lgd|矢量缓存(*.gft)|*.gft|其它格式(*.*)|*.*||"; - dlg.Multiselect = true; - if (dlg.ShowDialog() == DialogResult.OK) - { - //自定义lprj文件名,从程序中复制一lprj文件。 - int bindex = dlg.FileName.Split('\\').Length; - string lastname = dlg.FileName.Split('\\')[bindex - 1]; - - for (int i = 0; i < dlg.FileNames.Length; i++) - { - string strDataPath = dlg.FileNames[i]; - filepath = strDataPath; - - GSOLayer layer = globeControl1.Globe.Layers.Add(strDataPath); - - } - - } - //放大到红线 - - - // globeControl1.Globe.Layers.MoveTo(0, globeControl1.Globe.Layers.Count - 1); - // globeControl1.Globe.Layers.MoveTo(0,4); - globeControl1.Refresh(); - - - } - /// - /// - /// - /// - /// - private void buttonItem142_Click(object sender, EventArgs e) - { - //获得红线polygon - //GSOLayer layerSevenLine = globeControl1.Globe.Layers.GetLayerByCaption(redlinelayername); - - GSOLayer layerSevenLine = globeControl1.Globe.Layers.Add("D:\\data\\歌林小镇shp\\test.shp"); - //获得红线结果列表 - ArrayList rrLists = new ArrayList(); - - //if (redlinelayername != "") - { - GSOFeatures fs = layerSevenLine.GetAllFeatures(); - int len = fs.Length; - - GSOGeoPolygon3D sevenPolygon = new GSOGeoPolygon3D(); - for (int k = 0; k < len; k++) - {//多根红线 - ///////生成红线区域/////// - GSOFeature featSevenLine = layerSevenLine.GetAt(k); - GSOGeoPolyline3D sevenLine = featSevenLine.Geometry as GSOGeoPolyline3D; - - List sevenParts = new List(); - for (int i = 0; i < sevenLine.PartCount; i++) - { - sevenParts.Add(sevenLine[i]); - } - for (int i = 0; i < sevenParts.Count; i++) - { - sevenPolygon.AddPart((GSOPoint3ds)sevenParts[i]); - } - /////拼出红线多边形over////// - - } - //GSOLayer layer = globeControl1.Globe.Layers.GetLayerByCaption("天然气管线"); - - GSOLayer layer = globeControl1.Globe.Layers.Add("C:\\Users\\nn-203\\Desktop\\xiaobai\\test.lgd"); - //线切割面定义,输出用 - GSOFeatures resFeats = new GSOFeatures(); - int resultstyle = 0; - //管线切割红线区域后,面积较小的区域 - GSOGeoPolygon3D restPoly = new GSOGeoPolygon3D(); - List inpts = new List(); - if (layer != null) - { - //红线区域 - GSOFeature sevenfeature = new GSOFeature(); - sevenfeature.Geometry = sevenPolygon; - - //获取不完全包含在面中的所有线 - GSOFeatures feats = layer.FindFeaturesInPolygon(sevenPolygon, false); - //获取完全包含在面中的所有线 - GSOFeatures featsTrue = layer.FindFeaturesInPolygon(sevenPolygon, true); - //获取面中所有对象组成的切割面的长线 - GSOFeature feature = new GSOFeature(); - - feature = getLineFromGSOFeatures(feats, featsTrue);//管线多个feature拼成一个feature - - //globeControl1.Globe.MemoryLayer.AddFeature(feature); - //globeControl1.Globe.MemoryLayer.AddFeature(sevenfeature); - if (feature != null) - { - //线切割面,输出 - //feature.HighLight = true; - GSODataEngineUtility.GSLineClipPolygon(feature, sevenfeature, out resFeats, out resultstyle); - } - else - { - MessageBox.Show("没有找到切割面的线对象!"); - } - ////////////////绘制分割后的多边形/////////////// - for (int a = 0; a < resFeats.Length; a++) - { - - GSOFeature gf = resFeats[1]; - globeControl1.Globe.MemoryLayer.AddFeature(gf); - - } - } - - - } - } - - private void buttonItem143_Click(object sender, EventArgs e) - { - //获得红线polygon - GSOLayer layerSevenLine = globeControl1.Globe.Layers.Add("d:\\lineAndPolygon.lgd"); - GSOLayer layerSevenLine2 = globeControl1.Globe.Layers.GetLayerByCaption("d:\\lineAndPolygon.lgd"); - //获得红线结果列表 - ArrayList rrLists = new ArrayList(); - - - // if (redlinelayername != "") - { - GSOFeatures fs = layerSevenLine.GetAllFeatures(); - int len = fs.Length; - - GSOGeoPolyline3D linetest = new GSOGeoPolyline3D(); - GSOGeoPolygon3D sevenPolygon = new GSOGeoPolygon3D(); - - GSOFeature linefeat = fs.FindByID(2); - //linefeat.Geometry = linetest; - GSOFeature polyfeat = fs.FindByID(1); - //polyfeat.Geometry = sevenPolygon; - - //线切割面定义,输出用 - GSOFeatures resFeats = new GSOFeatures(); - int resultstyle = 0; - GSODataEngineUtility.GSLineClipPolygon(linefeat, polyfeat, out resFeats, out resultstyle); - - ////////////////绘制分割后的多边形/////////////// - for (int a = 0; a < resFeats.Length; a++) - { - - GSOFeature gf = resFeats[0]; - globeControl1.Globe.MemoryLayer.AddFeature(gf); - - } - ////把红线切成一段段的线段,获得切前的红线点集 - List redpts = new List();//切前的红线点集合 - for (int i = 0; i < linetest.PartCount; i++) - { - GSOPoint3ds partP = linetest[i]; - for (int j = 0; j < partP.Count; j++) - { - redpts.Add(partP[j]); - } - } - - List redpts2 = new List();//切前的红线点集合 - for (int i = 0; i < sevenPolygon.PartCount; i++) - { - GSOPoint3ds partP = sevenPolygon[i]; - for (int j = 0; j < partP.Count; j++) - { - redpts2.Add(partP[j]); - } - } - } - } - /// - /// 增加用户手册下载连接 - /// - /// - /// - Cyberpipe.udfiles.UpDownFile UDF = new udfiles.UpDownFile(Utility.udserviceurl); - string dir_Ok = "C:\\Users\\nn-203\\Desktop"; - private void button1_Click(object sender, EventArgs e) - { - if (folderBrowserDialog1.ShowDialog() == DialogResult.OK) //打洙?开a文?件t夹D对?话°框ò - { - dir_Ok = folderBrowserDialog1.SelectedPath; //显?示?选?择?的?文?件t夹D路·径? - - //tempstr = folderBrowserDialog1.SelectedPath; //存?储洹?选?择?的?文?件t夹D路·径? - - } - - Cyberpipe.PED_logicfile.PED_Affair.Redact_D = Utility.uploadpath + "\\SFiles\\UserHbook\\说明.docx"; - if (File.Exists(dir_Ok + "\\" + Files_Name(Cyberpipe.PED_logicfile.PED_Affair.Redact_D, 1))) - { - if (MessageBox.Show("文件夹下有同名文件,是否替换?", "提示", MessageBoxButtons.YesNo, MessageBoxIcon.Information) == DialogResult.No) ; - - } - byte[] file = UDF.Down(Cyberpipe.PED_logicfile.PED_Affair.Redact_D); - FileStream pFileSream = new FileStream(dir_Ok + "\\说明.docx", FileMode.OpenOrCreate); - pFileSream.Write(file, 0, file.Length); - pFileSream.Close(); - if (File.Exists(dir_Ok + "\\" + Files_Name(Cyberpipe.PED_logicfile.PED_Affair.Redact_D, 1)) == true) - { - MessageBox.Show("文件导出成功!"); - } - //PEDAClass.Folder_Handle(dir_Ok + "\\" + PEDAClass.Files_Name(Cyberpipe.PED_logicfile.PED_Affair.Redact_D, 0), Cyberpipe.PED_logicfile.PED_Affair.Redact_D, "", 0); - - } /// /// 获取文件或文件夹的名称 /// @@ -8575,33 +6811,6 @@ return DF_Name; } - private void toolStripDropDownButton1_Click(object sender, EventArgs e) - { - if (folderBrowserDialog1.ShowDialog() == DialogResult.OK) //打洙?开a文?件t夹D对?话°框ò - { - dir_Ok = folderBrowserDialog1.SelectedPath; //显?示?选?择?的?文?件t夹D路·径? - - //tempstr = folderBrowserDialog1.SelectedPath; //存?储洹?选?择?的?文?件t夹D路·径? - - - Cyberpipe.PED_logicfile.PED_Affair.Redact_D = Utility.uploadpath + "\\SFiles\\UserHbook\\说明.docx"; - if (File.Exists(dir_Ok + "\\" + Files_Name(Cyberpipe.PED_logicfile.PED_Affair.Redact_D, 1))) - { - if (MessageBox.Show("文件夹下有同名文件,是否替换?", "提示", MessageBoxButtons.YesNo, MessageBoxIcon.Information) == DialogResult.No) ; - - } - byte[] file = UDF.Down(Cyberpipe.PED_logicfile.PED_Affair.Redact_D); - FileStream pFileSream = new FileStream(dir_Ok + "\\说明.docx", FileMode.OpenOrCreate); - pFileSream.Write(file, 0, file.Length); - pFileSream.Close(); - if (File.Exists(dir_Ok + "\\" + Files_Name(Cyberpipe.PED_logicfile.PED_Affair.Redact_D, 1)) == true) - { - MessageBox.Show("文件导出成功!"); - } - - } - } - /// /// 空间查询 /// @@ -9792,7 +8001,7 @@ GSOLayer resLayer = null; GSOFeature resFeature = null; globeControl1.Globe.GetSelectObject(0, out resFeature, out resLayer); - + if (resFeature == null) return; GSOGeoPolyline3D line1 = resFeature.Geometry as GSOGeoPolyline3D; if (line1 == null) { @@ -9876,7 +8085,7 @@ GSOLayer resLayer = null; GSOFeature resFeature = null; globeControl1.Globe.GetSelectObject(0, out resFeature, out resLayer); - + if (resFeature == null) return; GSOGeoPolyline3D line1 = resFeature.Geometry as GSOGeoPolyline3D; if (line1 == null) { @@ -9891,7 +8100,8 @@ } GSOFeatures feats = globeControl1.Globe.MemoryLayer.GetFeatureByName("粒子要素", true); - if (feats.Length > 0) + + if (feats!=null&&feats.Length > 0) globeControl1.Globe.MemoryLayer.RemoveFeatureByID(feats[0].ID); //if (emitterFeature != null) //{ @@ -11121,88 +9331,6 @@ } private int connectServerCount = 0; - - /// - /// 还原球到实测库 - /// - private void refreshGlobe1() - { - //添加实测库图层已有图层 - int servernum = 0; - //1.清除global1上 - for (int i = globeControl1.Globe.Layers.Count - 1; i >= 0; i--) - { - GSOLayer layer = globeControl1.Globe.Layers[i]; - if (!layer.Name.Contains("fttp:")) - { - layer.Dataset.Close();//清除内存 - globeControl1.Globe.Layers.Remove(layer); - } - else - { - servernum++; - } - } - - //globeControl1.Globe.ConnectServer(Utility.serverip, Utility.serverport, "", ""); //加载locaServer中的数据 - - //2.添加实测库图层 - string[] markerStrs = new string[9]; - markerStrs[0] = "标高标注"; - markerStrs[1] = "管径标注"; - markerStrs[2] = "埋深标注"; - markerStrs[3] = "坐标标注"; - markerStrs[4] = "坡度标注"; - markerStrs[5] = "属性标注"; - markerStrs[6] = "自定义标注"; - markerStrs[7] = "距离标注"; - markerStrs[8] = "扯旗标注"; - for (int i = 0; i < markerStrs.Length; i++) - { - if (File.Exists(Application.StartupPath + "\\标注管理\\" + markerStrs[i] + ".lgd")) - { - GSOLayer markerLayer = globeControl1.Globe.Layers.Add(Application.StartupPath + "\\标注管理\\" + markerStrs[i] + ".lgd"); - } - } - - for (int i = 0; i < g1layername.Count; i++) - { - string g1name = g1layername[i]; - GSODataset datasetg1 = Utility.dataSource.GetDatasetByName(g1name); - GSOLayer templayer = globeControl1.Globe.Layers.Add(datasetg1); - templayer.MaxVisibleAltitude = -1; - } - layerTemp = globeControl1.Globe.Layers.Add(Application.StartupPath + "\\tempLgdData.lgd"); - globeControl1.Globe.Layers.Add(Application.StartupPath + "/城市七线/城市红线.lgd"); - globeControl1.Globe.Layers.Add(Application.StartupPath + "/城市七线/城市橙线.lgd"); - globeControl1.Globe.Layers.Add(Application.StartupPath + "/城市七线/城市黄线.lgd"); - globeControl1.Globe.Layers.Add(Application.StartupPath + "/城市七线/城市绿线.lgd"); - globeControl1.Globe.Layers.Add(Application.StartupPath + "/城市七线/城市蓝线.lgd"); - globeControl1.Globe.Layers.Add(Application.StartupPath + "/城市七线/城市紫线.lgd"); - globeControl1.Globe.Layers.Add(Application.StartupPath + "/城市七线/城市黑线.lgd"); - globeControl1.Globe.Layers.Add(Application.StartupPath + "/隧道.lgd"); - - //移动server的数据图层 - for (int i = 0; i < servernum; i++) - { - globeControl1.Globe.Layers.MoveTo(globeControl1.Globe.Layers.Count - 1, 0); - } - - if (layerManagerNode.Nodes.Count > 0) - { - for (int i = layerManagerNode.Nodes.Count - 1; i >= 0; i--) - { - layerManagerNode.Nodes[i].Remove(); - - } - } - - - - globeControl1.Refresh(); - - } - /// /// 碰撞审查 /// @@ -11476,31 +9604,7 @@ // } //} #endregion - /// - /// 数据质量检查 - /// - /// - /// - private void buttonItemSJGL2_Click(object sender, EventArgs e) - { - //日志记录 - LogManager.saveLog(Utility.userName, this.buttonItemSJGL2.Text); - FrmValiData frm = new FrmValiData(globeControl1); - frm.ShowDialog(); - } - /// - /// 数据预处理 - /// - /// - /// - private void buttonItemSJGL3_Click(object sender, EventArgs e) - { - //保存日志 - LogManager.saveLog(Utility.userName, this.buttonItemSJGL3.Text); - FrmEditShapeFile frm = new FrmEditShapeFile(globeControl1); - frm.ShowDialog(this); - } /// /// 连接数据库 /// @@ -12251,60 +10355,6 @@ List lineStruct = new List(); GSOFeature featureSelected = null; - private void AddDatagridView(DataTable table) - { - - if (table != null && table.Rows.Count > 0) - { - dataGridViewX1.DataSource = table; - panelOfTable.Visible = true; - panelOfTable.Height = 200; - toolStripNumbers.Text = "红线审核结果"; - toolStripFeatureLength.Text = " 共有:" + table.Rows.Count + "条"; - } - else - { - - } - - } - - /// - /// 去除集合中重复的管线 - /// - /// - /// - /// - private GSOFeatures getFeaturesByFilter(GSOFeatures features, string fieldName) - { - if (features == null) - { - return null; - } - GSOFeatures featuresGet = new GSOFeatures(); - for (int i = 0; i < features.Length; i++) - { - GSOFeature featureFromFS = features[i]; - string fieldValueFromFS = featureFromFS.GetValue(fieldName).ToString().Trim(); - bool isHas = false; - for (int j = featuresGet.Length - 1; j >= 0; j--) - { - GSOFeature featureFromFSGet = featuresGet[j]; - string fieldValueFromFSGet = featureFromFSGet.GetValue(fieldName).ToString().Trim(); - if (fieldValueFromFS.Equals(fieldValueFromFSGet)) - { - isHas = true; - break; - } - } - if (isHas == false) - { - featuresGet.Add(featureFromFS.Clone()); - } - } - return featuresGet; - } - /// /// 数据管理导入文件 /// @@ -12440,138 +10490,7 @@ // //MessageBox.Show("系统运行错误:" + ex.ToString(), "错误", MessageBoxButtons.OK, MessageBoxIcon.Error); // } //} - - - /// - /// 标识器全区域统计 - /// - /// - /// - private void 标识器分类统计ToolStripMenuItem_Click(object sender, EventArgs e) - { - globeControl1.Globe.Action = EnumAction3D.ActionNull; - FrmBSQStatis bsqStatis = new FrmBSQStatis(); - bsqStatis.Show(this); - } - /// - /// 标识器绘制区域统计 - /// - /// - /// - private void 标识器分类统计ToolStripMenuItem1_Click(object sender, EventArgs e) - { - trackflag = "BSQDuoBianXiangStatis"; - globeControl1.Globe.Action = EnumAction3D.TrackPolygon; - } - - - #region 保存和加载审核库加载的图层 - private void saveLayerList(TreeNodeCollection treeNodeList) - { - string configPath = Application.StartupPath + "\\configLayerList.xml"; - try - { - XmlDocument doc = new XmlDocument(); - doc.Load(configPath); - XmlNode dbParams = doc.SelectSingleNode("Params/dbparams"); - XmlNode dbLayers = doc.SelectSingleNode("Params/dblayers"); - XmlNode layers = doc.SelectSingleNode("Params/layers"); - dbParams.RemoveAll(); - dbLayers.RemoveAll(); - layers.RemoveAll(); - - List listDS = new List(); - String shDatasourceName = Utility.sgdbip + "/" + Utility.sgdbname + "_" + Utility.sgdbuser; - bool flag = false; - - for (int i = 0; i < globeControl1.Globe.DataManager.DataSourceCount; i++) - { - GSODataSource ds = globeControl1.Globe.DataManager.GetDataSourceAt(i); - if (ds != null && ds.Type == EnumDataSourceType.SqlServer || ds.Type == EnumDataSourceType.Oracle) - { - if (ds.Name == shDatasourceName) - { - //防止因为多次连接同一个数据库 - if (flag == true) - { - break; - } - flag = true; - listDS.Add(ds); - GSODataSourceCnn conn = ds.GetConnectionInfo(); - - XmlElement dbparam = doc.CreateElement("shdbparam"); - XmlElement ip = doc.CreateElement("ship"); - ip.InnerText = conn.Server; - - XmlElement dbname = doc.CreateElement("shdbname"); - dbname.InnerText = conn.Database; - - XmlElement username = doc.CreateElement("shusername"); - username.InnerText = conn.User; - - XmlElement password = doc.CreateElement("shpassword"); - password.InnerText = conn.Password; - - XmlElement type = doc.CreateElement("shtype"); - if (ds.Type == EnumDataSourceType.SqlServer) - { - type.InnerText = "sqlserver"; - } - else - { - type.InnerText = "oracle"; - } - - dbparam.AppendChild(ip); - dbparam.AppendChild(dbname); - dbparam.AppendChild(username); - dbparam.AppendChild(password); - dbparam.AppendChild(type); - dbParams.AppendChild(dbparam); - } - - } - } - - for (int i = 0; i < treeNodeList.Count; i++) - { - GSOLayer layer = treeNodeList[i].Tag as GSOLayer; - if (Path.GetExtension(layer.Name) == "") - { - XmlElement dbLayer = doc.CreateElement("dblayer"); - XmlAttribute attri = doc.CreateAttribute("dbindex"); - for (int j = 0; j < listDS.Count; j++) - { - if (layer.Dataset.DataSource.Name == listDS[j].Name) - { - attri.Value = j.ToString(); - break; - } - } - dbLayer.Attributes.Append(attri); - dbLayer.InnerText = layer.Name; - - dbLayers.AppendChild(dbLayer); - } - else - { - XmlElement dbLayer = doc.CreateElement("layer"); - dbLayer.InnerText = layer.Name; - layers.AppendChild(dbLayer); - } - } - - doc.Save(configPath); - } - catch (Exception e) - { - - } - } - - #endregion - + private void buttonItem_TaskManager_Click(object sender, EventArgs e) { if (Form_TaksManager.IS_OPEN) diff --git a/MainFrm.designer.cs b/MainFrm.designer.cs index 233ef8c..97b8299 100644 --- a/MainFrm.designer.cs +++ b/MainFrm.designer.cs @@ -82,6 +82,7 @@ this.sideBar1 = new DevComponents.DotNetBar.SideBar(); this.panelEx3 = new DevComponents.DotNetBar.PanelEx(); this.layerSensorTree = new System.Windows.Forms.TreeView(); + this.layerTree = new Cyberpipe.MyTreeView(); this.sideBarPanelItem3 = new DevComponents.DotNetBar.SideBarPanelItem(); this.controlContainerItem3 = new DevComponents.DotNetBar.ControlContainerItem(); this.sideBarPanelItem4 = new DevComponents.DotNetBar.SideBarPanelItem(); @@ -365,30 +366,26 @@ this.可编辑ToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); this.保存ToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); this.ribbonControl1 = new DevComponents.DotNetBar.RibbonControl(); - this.ribbonPanel1 = new DevComponents.DotNetBar.RibbonPanel(); - this.ribbonBar21 = new DevComponents.DotNetBar.RibbonBar(); - this.buttonItem87 = new DevComponents.DotNetBar.ButtonItem(); - this.buttonItem88 = new DevComponents.DotNetBar.ButtonItem(); - this.buttonItem27 = new DevComponents.DotNetBar.ButtonItem(); - this.buttonItem91 = new DevComponents.DotNetBar.ButtonItem(); - this.buttonItem1 = new DevComponents.DotNetBar.ButtonItem(); - this.btnlegendSet = new DevComponents.DotNetBar.ButtonItem(); - this.buttonItem89 = new DevComponents.DotNetBar.ButtonItem(); - this.ribbonPanel7 = new DevComponents.DotNetBar.RibbonPanel(); - this.ribbonBar5 = new DevComponents.DotNetBar.RibbonBar(); - this.btn_flag = new DevComponents.DotNetBar.ButtonItem(); - this.slider4ground = new DevComponents.DotNetBar.SliderItem(); - this.ribbonPanel2 = new DevComponents.DotNetBar.RibbonPanel(); - this.ribbonBar4 = new DevComponents.DotNetBar.RibbonBar(); - this.buttonItem_TaskManager = new DevComponents.DotNetBar.ButtonItem(); - this.buttonItem_OnlineTask = new DevComponents.DotNetBar.ButtonItem(); - this.buttonItem_Event = new DevComponents.DotNetBar.ButtonItem(); this.ribbonPanel3 = new DevComponents.DotNetBar.RibbonPanel(); this.ribbonBar3 = new DevComponents.DotNetBar.RibbonBar(); this.btn_device = new DevComponents.DotNetBar.ButtonItem(); this.btn_Person = new DevComponents.DotNetBar.ButtonItem(); this.btn_constructMap = new DevComponents.DotNetBar.ButtonItem(); this.buttonItem9 = new DevComponents.DotNetBar.ButtonItem(); + this.ribbonPanel2 = new DevComponents.DotNetBar.RibbonPanel(); + this.ribbonBar4 = new DevComponents.DotNetBar.RibbonBar(); + this.buttonItem_TaskManager = new DevComponents.DotNetBar.ButtonItem(); + this.buttonItem_OnlineTask = new DevComponents.DotNetBar.ButtonItem(); + this.buttonItem_Event = new DevComponents.DotNetBar.ButtonItem(); + this.ribbonPanel1 = new DevComponents.DotNetBar.RibbonPanel(); + this.ribbonBar21 = new DevComponents.DotNetBar.RibbonBar(); + this.buttonItem87 = new DevComponents.DotNetBar.ButtonItem(); + this.buttonItem88 = new DevComponents.DotNetBar.ButtonItem(); + this.buttonItem27 = new DevComponents.DotNetBar.ButtonItem(); + this.buttonItem1 = new DevComponents.DotNetBar.ButtonItem(); + this.buttonItem91 = new DevComponents.DotNetBar.ButtonItem(); + this.btnlegendSet = new DevComponents.DotNetBar.ButtonItem(); + this.buttonItem89 = new DevComponents.DotNetBar.ButtonItem(); this.ribbonPanel8 = new DevComponents.DotNetBar.RibbonPanel(); this.ribbonBar_UserInfo = new DevComponents.DotNetBar.RibbonBar(); this.btn_user_info = new DevComponents.DotNetBar.ButtonItem(); @@ -398,6 +395,10 @@ this.btn_user_role = new DevComponents.DotNetBar.ButtonItem(); this.btn_password_edit = new DevComponents.DotNetBar.ButtonItem(); this.btn_reset_password = new DevComponents.DotNetBar.ButtonItem(); + this.ribbonPanel7 = new DevComponents.DotNetBar.RibbonPanel(); + this.ribbonBar5 = new DevComponents.DotNetBar.RibbonBar(); + this.btn_flag = new DevComponents.DotNetBar.ButtonItem(); + this.slider4ground = new DevComponents.DotNetBar.SliderItem(); this.ribbonPanel15 = new DevComponents.DotNetBar.RibbonPanel(); this.ribbonBar20 = new DevComponents.DotNetBar.RibbonBar(); this.buttonItemSJGL = new DevComponents.DotNetBar.ButtonItem(); @@ -610,7 +611,6 @@ this.buttonItem84 = new DevComponents.DotNetBar.ButtonItem(); this.buttonItem75 = new DevComponents.DotNetBar.ButtonItem(); this.buttonItem76 = new DevComponents.DotNetBar.ButtonItem(); - this.layerTree = new Cyberpipe.MyTreeView(); this.statusStrip1.SuspendLayout(); this.sideBar1.SuspendLayout(); this.panelEx3.SuspendLayout(); @@ -647,11 +647,11 @@ this.contextMenuStrip3.SuspendLayout(); this.contextMenuStripDeleteLayerNode.SuspendLayout(); this.ribbonControl1.SuspendLayout(); - this.ribbonPanel1.SuspendLayout(); - this.ribbonPanel7.SuspendLayout(); - this.ribbonPanel2.SuspendLayout(); this.ribbonPanel3.SuspendLayout(); + this.ribbonPanel2.SuspendLayout(); + this.ribbonPanel1.SuspendLayout(); this.ribbonPanel8.SuspendLayout(); + this.ribbonPanel7.SuspendLayout(); this.ribbonPanel15.SuspendLayout(); ((System.ComponentModel.ISupportInitialize)(this.pictureBox1)).BeginInit(); this.SuspendLayout(); @@ -813,7 +813,6 @@ this.toolStripDropDownButton1.Size = new System.Drawing.Size(45, 21); this.toolStripDropDownButton1.Text = "帮助"; this.toolStripDropDownButton1.Visible = false; - this.toolStripDropDownButton1.Click += new System.EventHandler(this.toolStripDropDownButton1_Click); // // controlContainerItem1 // @@ -1047,6 +1046,16 @@ this.layerSensorTree.AfterCheck += new System.Windows.Forms.TreeViewEventHandler(this.layerMarkerTree_AfterCheck); this.layerSensorTree.NodeMouseClick += new System.Windows.Forms.TreeNodeMouseClickEventHandler(this.layerMarkerTree_NodeMouseClick); // + // layerTree + // + this.layerTree.CheckBoxes = true; + this.layerTree.ItemHeight = 18; + this.layerTree.Location = new System.Drawing.Point(30, 78); + this.layerTree.Name = "layerTree"; + this.layerTree.Size = new System.Drawing.Size(121, 97); + this.layerTree.TabIndex = 1; + this.layerTree.AfterCheck += new System.Windows.Forms.TreeViewEventHandler(this.layerTree_AfterCheck); + // // sideBarPanelItem3 // this.sideBarPanelItem3.FontBold = true; @@ -2966,28 +2975,28 @@ // 平移对象ToolStripMenuItem // this.平移对象ToolStripMenuItem.Name = "平移对象ToolStripMenuItem"; - this.平移对象ToolStripMenuItem.Size = new System.Drawing.Size(152, 22); + this.平移对象ToolStripMenuItem.Size = new System.Drawing.Size(124, 22); this.平移对象ToolStripMenuItem.Text = "平移对象"; this.平移对象ToolStripMenuItem.Click += new System.EventHandler(this.buttonItemBJ6_Click); // // 升降对象ToolStripMenuItem // this.升降对象ToolStripMenuItem.Name = "升降对象ToolStripMenuItem"; - this.升降对象ToolStripMenuItem.Size = new System.Drawing.Size(152, 22); + this.升降对象ToolStripMenuItem.Size = new System.Drawing.Size(124, 22); this.升降对象ToolStripMenuItem.Text = "升降对象"; this.升降对象ToolStripMenuItem.Click += new System.EventHandler(this.buttonItemBJ7_Click); // // 旋转对象ToolStripMenuItem // this.旋转对象ToolStripMenuItem.Name = "旋转对象ToolStripMenuItem"; - this.旋转对象ToolStripMenuItem.Size = new System.Drawing.Size(152, 22); + this.旋转对象ToolStripMenuItem.Size = new System.Drawing.Size(124, 22); this.旋转对象ToolStripMenuItem.Text = "旋转对象"; this.旋转对象ToolStripMenuItem.Click += new System.EventHandler(this.buttonItemBJ8_Click); // // 连接管段ToolStripMenuItem // this.连接管段ToolStripMenuItem.Name = "连接管段ToolStripMenuItem"; - this.连接管段ToolStripMenuItem.Size = new System.Drawing.Size(152, 22); + this.连接管段ToolStripMenuItem.Size = new System.Drawing.Size(124, 22); this.连接管段ToolStripMenuItem.Text = "连接管段"; this.连接管段ToolStripMenuItem.Click += new System.EventHandler(this.buttonItemBJ9_Click); // @@ -2997,34 +3006,34 @@ this.导出CADToolStripMenuItem, this.导出文件ToolStripMenuItem1}); this.导出文件ToolStripMenuItem.Name = "导出文件ToolStripMenuItem"; - this.导出文件ToolStripMenuItem.Size = new System.Drawing.Size(152, 22); + this.导出文件ToolStripMenuItem.Size = new System.Drawing.Size(124, 22); this.导出文件ToolStripMenuItem.Text = "导出矢量"; // // 导出CADToolStripMenuItem // this.导出CADToolStripMenuItem.Name = "导出CADToolStripMenuItem"; - this.导出CADToolStripMenuItem.Size = new System.Drawing.Size(152, 22); + this.导出CADToolStripMenuItem.Size = new System.Drawing.Size(125, 22); this.导出CADToolStripMenuItem.Text = "导出CAD"; this.导出CADToolStripMenuItem.Click += new System.EventHandler(this.buttonItemBJ10_1_Click); // // 导出文件ToolStripMenuItem1 // this.导出文件ToolStripMenuItem1.Name = "导出文件ToolStripMenuItem1"; - this.导出文件ToolStripMenuItem1.Size = new System.Drawing.Size(152, 22); + this.导出文件ToolStripMenuItem1.Size = new System.Drawing.Size(125, 22); this.导出文件ToolStripMenuItem1.Text = "导出文件"; this.导出文件ToolStripMenuItem1.Click += new System.EventHandler(this.buttonItemBJ10_2_Click); // // 前进ToolStripMenuItem // this.前进ToolStripMenuItem.Name = "前进ToolStripMenuItem"; - this.前进ToolStripMenuItem.Size = new System.Drawing.Size(152, 22); + this.前进ToolStripMenuItem.Size = new System.Drawing.Size(124, 22); this.前进ToolStripMenuItem.Text = "前进"; this.前进ToolStripMenuItem.Click += new System.EventHandler(this.buttonItemBJ12_Click); // // 删除模型ToolStripMenuItem // this.删除模型ToolStripMenuItem.Name = "删除模型ToolStripMenuItem"; - this.删除模型ToolStripMenuItem.Size = new System.Drawing.Size(152, 22); + this.删除模型ToolStripMenuItem.Size = new System.Drawing.Size(124, 22); this.删除模型ToolStripMenuItem.Text = "后退"; this.删除模型ToolStripMenuItem.Click += new System.EventHandler(this.buttonItemBJ11_Click); // @@ -4160,6 +4169,198 @@ this.ribbonControl1.Text = "ribbonControl1"; this.ribbonControl1.UseCustomizeDialog = false; // + // ribbonPanel3 + // + this.ribbonPanel3.ColorSchemeStyle = DevComponents.DotNetBar.eDotNetBarStyle.StyleManagerControlled; + this.ribbonPanel3.Controls.Add(this.ribbonBar3); + this.ribbonPanel3.Dock = System.Windows.Forms.DockStyle.Fill; + this.ribbonPanel3.Location = new System.Drawing.Point(0, 33); + this.ribbonPanel3.Name = "ribbonPanel3"; + this.ribbonPanel3.Padding = new System.Windows.Forms.Padding(3, 0, 3, 3); + this.ribbonPanel3.Size = new System.Drawing.Size(1328, 62); + // + // + // + this.ribbonPanel3.Style.Class = ""; + this.ribbonPanel3.Style.CornerType = DevComponents.DotNetBar.eCornerType.Square; + // + // + // + this.ribbonPanel3.StyleMouseDown.Class = ""; + this.ribbonPanel3.StyleMouseDown.CornerType = DevComponents.DotNetBar.eCornerType.Square; + // + // + // + this.ribbonPanel3.StyleMouseOver.Class = ""; + this.ribbonPanel3.StyleMouseOver.CornerType = DevComponents.DotNetBar.eCornerType.Square; + this.ribbonPanel3.TabIndex = 40; + // + // ribbonBar3 + // + this.ribbonBar3.AutoOverflowEnabled = true; + // + // + // + this.ribbonBar3.BackgroundMouseOverStyle.Class = ""; + this.ribbonBar3.BackgroundMouseOverStyle.CornerType = DevComponents.DotNetBar.eCornerType.Square; + // + // + // + this.ribbonBar3.BackgroundStyle.Class = ""; + this.ribbonBar3.BackgroundStyle.CornerType = DevComponents.DotNetBar.eCornerType.Square; + this.ribbonBar3.ContainerControlProcessDialogKey = true; + this.ribbonBar3.Dock = System.Windows.Forms.DockStyle.Left; + this.ribbonBar3.Items.AddRange(new DevComponents.DotNetBar.BaseItem[] { + this.btn_device, + this.btn_Person, + this.btn_constructMap, + this.buttonItem9}); + this.ribbonBar3.Location = new System.Drawing.Point(3, 0); + this.ribbonBar3.Name = "ribbonBar3"; + this.ribbonBar3.Size = new System.Drawing.Size(378, 59); + this.ribbonBar3.Style = DevComponents.DotNetBar.eDotNetBarStyle.StyleManagerControlled; + this.ribbonBar3.TabIndex = 0; + // + // + // + this.ribbonBar3.TitleStyle.Class = ""; + this.ribbonBar3.TitleStyle.CornerType = DevComponents.DotNetBar.eCornerType.Square; + // + // + // + this.ribbonBar3.TitleStyleMouseOver.Class = ""; + this.ribbonBar3.TitleStyleMouseOver.CornerType = DevComponents.DotNetBar.eCornerType.Square; + this.ribbonBar3.TitleVisible = false; + // + // btn_device + // + this.btn_device.ButtonStyle = DevComponents.DotNetBar.eButtonStyle.ImageAndText; + this.btn_device.Image = global::Cyberpipe.Properties.Resources._24X24__2__02; + this.btn_device.ImagePosition = DevComponents.DotNetBar.eImagePosition.Top; + this.btn_device.Name = "btn_device"; + this.btn_device.SubItemsExpandWidth = 14; + this.btn_device.Text = "探测仪管理"; + this.btn_device.Click += new System.EventHandler(this.btn_device_Click); + // + // btn_Person + // + this.btn_Person.ButtonStyle = DevComponents.DotNetBar.eButtonStyle.ImageAndText; + this.btn_Person.Image = global::Cyberpipe.Properties.Resources._24x24icon_05_hover1; + this.btn_Person.ImagePosition = DevComponents.DotNetBar.eImagePosition.Top; + this.btn_Person.Name = "btn_Person"; + this.btn_Person.SubItemsExpandWidth = 14; + this.btn_Person.Text = "定位人员维护"; + this.btn_Person.Click += new System.EventHandler(this.btn_Person_Click); + // + // btn_constructMap + // + this.btn_constructMap.Image = global::Cyberpipe.Properties.Resources._24x24icon_04_hover; + this.btn_constructMap.ImagePosition = DevComponents.DotNetBar.eImagePosition.Top; + this.btn_constructMap.Name = "btn_constructMap"; + this.btn_constructMap.SubItemsExpandWidth = 14; + this.btn_constructMap.Text = "导出施工图"; + this.btn_constructMap.Click += new System.EventHandler(this.btn_constructMap_Click); + // + // buttonItem9 + // + this.buttonItem9.Image = global::Cyberpipe.Properties.Resources._24x24icon__2__10; + this.buttonItem9.ImagePosition = DevComponents.DotNetBar.eImagePosition.Top; + this.buttonItem9.Name = "buttonItem9"; + this.buttonItem9.SubItemsExpandWidth = 14; + this.buttonItem9.Text = "文档管理"; + this.buttonItem9.Click += new System.EventHandler(this.buttonItem9_Click); + // + // ribbonPanel2 + // + this.ribbonPanel2.ColorSchemeStyle = DevComponents.DotNetBar.eDotNetBarStyle.StyleManagerControlled; + this.ribbonPanel2.Controls.Add(this.ribbonBar4); + this.ribbonPanel2.Dock = System.Windows.Forms.DockStyle.Fill; + this.ribbonPanel2.Location = new System.Drawing.Point(0, 0); + this.ribbonPanel2.Name = "ribbonPanel2"; + this.ribbonPanel2.Padding = new System.Windows.Forms.Padding(3, 0, 3, 3); + this.ribbonPanel2.Size = new System.Drawing.Size(1328, 95); + // + // + // + this.ribbonPanel2.Style.Class = ""; + this.ribbonPanel2.Style.CornerType = DevComponents.DotNetBar.eCornerType.Square; + // + // + // + this.ribbonPanel2.StyleMouseDown.Class = ""; + this.ribbonPanel2.StyleMouseDown.CornerType = DevComponents.DotNetBar.eCornerType.Square; + // + // + // + this.ribbonPanel2.StyleMouseOver.Class = ""; + this.ribbonPanel2.StyleMouseOver.CornerType = DevComponents.DotNetBar.eCornerType.Square; + this.ribbonPanel2.TabIndex = 39; + this.ribbonPanel2.Visible = false; + // + // ribbonBar4 + // + this.ribbonBar4.AutoOverflowEnabled = true; + // + // + // + this.ribbonBar4.BackgroundMouseOverStyle.Class = ""; + this.ribbonBar4.BackgroundMouseOverStyle.CornerType = DevComponents.DotNetBar.eCornerType.Square; + // + // + // + this.ribbonBar4.BackgroundStyle.Class = ""; + this.ribbonBar4.BackgroundStyle.CornerType = DevComponents.DotNetBar.eCornerType.Square; + this.ribbonBar4.ContainerControlProcessDialogKey = true; + this.ribbonBar4.Dock = System.Windows.Forms.DockStyle.Left; + this.ribbonBar4.Items.AddRange(new DevComponents.DotNetBar.BaseItem[] { + this.buttonItem_TaskManager, + this.buttonItem_OnlineTask, + this.buttonItem_Event}); + this.ribbonBar4.Location = new System.Drawing.Point(3, 0); + this.ribbonBar4.Name = "ribbonBar4"; + this.ribbonBar4.Size = new System.Drawing.Size(299, 92); + this.ribbonBar4.Style = DevComponents.DotNetBar.eDotNetBarStyle.StyleManagerControlled; + this.ribbonBar4.TabIndex = 0; + this.ribbonBar4.Text = "ribbonBar4"; + // + // + // + this.ribbonBar4.TitleStyle.Class = ""; + this.ribbonBar4.TitleStyle.CornerType = DevComponents.DotNetBar.eCornerType.Square; + // + // + // + this.ribbonBar4.TitleStyleMouseOver.Class = ""; + this.ribbonBar4.TitleStyleMouseOver.CornerType = DevComponents.DotNetBar.eCornerType.Square; + this.ribbonBar4.TitleVisible = false; + // + // buttonItem_TaskManager + // + this.buttonItem_TaskManager.Image = global::Cyberpipe.Properties.Resources._24x24icon__2__76; + this.buttonItem_TaskManager.ImagePosition = DevComponents.DotNetBar.eImagePosition.Top; + this.buttonItem_TaskManager.Name = "buttonItem_TaskManager"; + this.buttonItem_TaskManager.SubItemsExpandWidth = 14; + this.buttonItem_TaskManager.Text = "工单管理"; + this.buttonItem_TaskManager.Click += new System.EventHandler(this.buttonItem_TaskManager_Click); + // + // buttonItem_OnlineTask + // + this.buttonItem_OnlineTask.Image = global::Cyberpipe.Properties.Resources._24x24icon__2__69; + this.buttonItem_OnlineTask.ImagePosition = DevComponents.DotNetBar.eImagePosition.Top; + this.buttonItem_OnlineTask.Name = "buttonItem_OnlineTask"; + this.buttonItem_OnlineTask.SubItemsExpandWidth = 14; + this.buttonItem_OnlineTask.Text = "在线任务"; + this.buttonItem_OnlineTask.Click += new System.EventHandler(this.buttonItem_OnlineTask_Click); + // + // buttonItem_Event + // + this.buttonItem_Event.Image = global::Cyberpipe.Properties.Resources._24x24icon__2__72; + this.buttonItem_Event.ImagePosition = DevComponents.DotNetBar.eImagePosition.Top; + this.buttonItem_Event.Name = "buttonItem_Event"; + this.buttonItem_Event.SubItemsExpandWidth = 14; + this.buttonItem_Event.Text = "事件管理"; + this.buttonItem_Event.Click += new System.EventHandler(this.buttonItem_Event_Click); + // // ribbonPanel1 // this.ribbonPanel1.AutoSize = true; @@ -4262,6 +4463,15 @@ this.buttonItem27.Visible = false; this.buttonItem27.Click += new System.EventHandler(this.buttonItem27_Click); // + // buttonItem1 + // + this.buttonItem1.Image = global::Cyberpipe.Properties.Resources._24x24icon__2__94; + this.buttonItem1.ImagePosition = DevComponents.DotNetBar.eImagePosition.Top; + this.buttonItem1.Name = "buttonItem1"; + this.buttonItem1.SubItemsExpandWidth = 14; + this.buttonItem1.Text = "图层管理"; + this.buttonItem1.Click += new System.EventHandler(this.buttonItem1_Click); + // // buttonItem91 // this.buttonItem91.ForeColor = System.Drawing.Color.Black; @@ -4272,15 +4482,6 @@ this.buttonItem91.Text = "快速定位"; this.buttonItem91.Click += new System.EventHandler(this.buttonItem91_Click); // - // buttonItem1 - // - this.buttonItem1.Image = global::Cyberpipe.Properties.Resources._24x24icon__2__94; - this.buttonItem1.ImagePosition = DevComponents.DotNetBar.eImagePosition.Top; - this.buttonItem1.Name = "buttonItem1"; - this.buttonItem1.SubItemsExpandWidth = 14; - this.buttonItem1.Text = "图层管理"; - this.buttonItem1.Click += new System.EventHandler(this.buttonItem1_Click); - // // btnlegendSet // this.btnlegendSet.Image = global::Cyberpipe.Properties.Resources._24x24icon__2__93; @@ -4300,278 +4501,6 @@ this.buttonItem89.Visible = false; this.buttonItem89.Click += new System.EventHandler(this.buttonItem89_Click); // - // ribbonPanel7 - // - this.ribbonPanel7.ColorSchemeStyle = DevComponents.DotNetBar.eDotNetBarStyle.StyleManagerControlled; - this.ribbonPanel7.Controls.Add(this.ribbonBar5); - this.ribbonPanel7.Dock = System.Windows.Forms.DockStyle.Fill; - this.ribbonPanel7.Location = new System.Drawing.Point(0, 0); - this.ribbonPanel7.Name = "ribbonPanel7"; - this.ribbonPanel7.Padding = new System.Windows.Forms.Padding(3, 0, 3, 3); - this.ribbonPanel7.Size = new System.Drawing.Size(1328, 95); - // - // - // - this.ribbonPanel7.Style.Class = ""; - this.ribbonPanel7.Style.CornerType = DevComponents.DotNetBar.eCornerType.Square; - // - // - // - this.ribbonPanel7.StyleMouseDown.Class = ""; - this.ribbonPanel7.StyleMouseDown.CornerType = DevComponents.DotNetBar.eCornerType.Square; - // - // - // - this.ribbonPanel7.StyleMouseOver.Class = ""; - this.ribbonPanel7.StyleMouseOver.CornerType = DevComponents.DotNetBar.eCornerType.Square; - this.ribbonPanel7.TabIndex = 41; - this.ribbonPanel7.Visible = false; - // - // ribbonBar5 - // - this.ribbonBar5.AutoOverflowEnabled = true; - // - // - // - this.ribbonBar5.BackgroundMouseOverStyle.Class = ""; - this.ribbonBar5.BackgroundMouseOverStyle.CornerType = DevComponents.DotNetBar.eCornerType.Square; - // - // - // - this.ribbonBar5.BackgroundStyle.Class = ""; - this.ribbonBar5.BackgroundStyle.CornerType = DevComponents.DotNetBar.eCornerType.Square; - this.ribbonBar5.ContainerControlProcessDialogKey = true; - this.ribbonBar5.Dock = System.Windows.Forms.DockStyle.Left; - this.ribbonBar5.Items.AddRange(new DevComponents.DotNetBar.BaseItem[] { - this.btn_flag, - this.slider4ground}); - this.ribbonBar5.Location = new System.Drawing.Point(3, 0); - this.ribbonBar5.Name = "ribbonBar5"; - this.ribbonBar5.Size = new System.Drawing.Size(418, 92); - this.ribbonBar5.Style = DevComponents.DotNetBar.eDotNetBarStyle.StyleManagerControlled; - this.ribbonBar5.TabIndex = 0; - // - // - // - this.ribbonBar5.TitleStyle.Class = ""; - this.ribbonBar5.TitleStyle.CornerType = DevComponents.DotNetBar.eCornerType.Square; - // - // - // - this.ribbonBar5.TitleStyleMouseOver.Class = ""; - this.ribbonBar5.TitleStyleMouseOver.CornerType = DevComponents.DotNetBar.eCornerType.Square; - this.ribbonBar5.TitleVisible = false; - this.ribbonBar5.ItemClick += new System.EventHandler(this.ribbonBar5_ItemClick); - // - // btn_flag - // - this.btn_flag.Image = global::Cyberpipe.Properties.Resources._24x24icon_03_hover; - this.btn_flag.ImagePosition = DevComponents.DotNetBar.eImagePosition.Top; - this.btn_flag.Name = "btn_flag"; - this.btn_flag.SubItemsExpandWidth = 14; - this.btn_flag.Text = "标识器管理"; - this.btn_flag.Click += new System.EventHandler(this.btn_flag_Click); - // - // slider4ground - // - this.slider4ground.LabelPosition = DevComponents.DotNetBar.eSliderLabelPosition.Top; - this.slider4ground.Name = "slider4ground"; - this.slider4ground.Text = "地面透明度"; - this.slider4ground.Value = 0; - this.slider4ground.ValueChanged += new System.EventHandler(this.slider4ground_ValueChanged); - // - // ribbonPanel2 - // - this.ribbonPanel2.ColorSchemeStyle = DevComponents.DotNetBar.eDotNetBarStyle.StyleManagerControlled; - this.ribbonPanel2.Controls.Add(this.ribbonBar4); - this.ribbonPanel2.Dock = System.Windows.Forms.DockStyle.Fill; - this.ribbonPanel2.Location = new System.Drawing.Point(0, 0); - this.ribbonPanel2.Name = "ribbonPanel2"; - this.ribbonPanel2.Padding = new System.Windows.Forms.Padding(3, 0, 3, 3); - this.ribbonPanel2.Size = new System.Drawing.Size(1328, 95); - // - // - // - this.ribbonPanel2.Style.Class = ""; - this.ribbonPanel2.Style.CornerType = DevComponents.DotNetBar.eCornerType.Square; - // - // - // - this.ribbonPanel2.StyleMouseDown.Class = ""; - this.ribbonPanel2.StyleMouseDown.CornerType = DevComponents.DotNetBar.eCornerType.Square; - // - // - // - this.ribbonPanel2.StyleMouseOver.Class = ""; - this.ribbonPanel2.StyleMouseOver.CornerType = DevComponents.DotNetBar.eCornerType.Square; - this.ribbonPanel2.TabIndex = 39; - this.ribbonPanel2.Visible = false; - // - // ribbonBar4 - // - this.ribbonBar4.AutoOverflowEnabled = true; - // - // - // - this.ribbonBar4.BackgroundMouseOverStyle.Class = ""; - this.ribbonBar4.BackgroundMouseOverStyle.CornerType = DevComponents.DotNetBar.eCornerType.Square; - // - // - // - this.ribbonBar4.BackgroundStyle.Class = ""; - this.ribbonBar4.BackgroundStyle.CornerType = DevComponents.DotNetBar.eCornerType.Square; - this.ribbonBar4.ContainerControlProcessDialogKey = true; - this.ribbonBar4.Dock = System.Windows.Forms.DockStyle.Left; - this.ribbonBar4.Items.AddRange(new DevComponents.DotNetBar.BaseItem[] { - this.buttonItem_TaskManager, - this.buttonItem_OnlineTask, - this.buttonItem_Event}); - this.ribbonBar4.Location = new System.Drawing.Point(3, 0); - this.ribbonBar4.Name = "ribbonBar4"; - this.ribbonBar4.Size = new System.Drawing.Size(299, 92); - this.ribbonBar4.Style = DevComponents.DotNetBar.eDotNetBarStyle.StyleManagerControlled; - this.ribbonBar4.TabIndex = 0; - this.ribbonBar4.Text = "ribbonBar4"; - // - // - // - this.ribbonBar4.TitleStyle.Class = ""; - this.ribbonBar4.TitleStyle.CornerType = DevComponents.DotNetBar.eCornerType.Square; - // - // - // - this.ribbonBar4.TitleStyleMouseOver.Class = ""; - this.ribbonBar4.TitleStyleMouseOver.CornerType = DevComponents.DotNetBar.eCornerType.Square; - this.ribbonBar4.TitleVisible = false; - // - // buttonItem_TaskManager - // - this.buttonItem_TaskManager.Image = global::Cyberpipe.Properties.Resources._24x24icon__2__76; - this.buttonItem_TaskManager.ImagePosition = DevComponents.DotNetBar.eImagePosition.Top; - this.buttonItem_TaskManager.Name = "buttonItem_TaskManager"; - this.buttonItem_TaskManager.SubItemsExpandWidth = 14; - this.buttonItem_TaskManager.Text = "工单管理"; - this.buttonItem_TaskManager.Click += new System.EventHandler(this.buttonItem_TaskManager_Click); - // - // buttonItem_OnlineTask - // - this.buttonItem_OnlineTask.Image = global::Cyberpipe.Properties.Resources._24x24icon__2__69; - this.buttonItem_OnlineTask.ImagePosition = DevComponents.DotNetBar.eImagePosition.Top; - this.buttonItem_OnlineTask.Name = "buttonItem_OnlineTask"; - this.buttonItem_OnlineTask.SubItemsExpandWidth = 14; - this.buttonItem_OnlineTask.Text = "在线任务"; - this.buttonItem_OnlineTask.Click += new System.EventHandler(this.buttonItem_OnlineTask_Click); - // - // buttonItem_Event - // - this.buttonItem_Event.Image = global::Cyberpipe.Properties.Resources._24x24icon__2__72; - this.buttonItem_Event.ImagePosition = DevComponents.DotNetBar.eImagePosition.Top; - this.buttonItem_Event.Name = "buttonItem_Event"; - this.buttonItem_Event.SubItemsExpandWidth = 14; - this.buttonItem_Event.Text = "事件管理"; - this.buttonItem_Event.Click += new System.EventHandler(this.buttonItem_Event_Click); - // - // ribbonPanel3 - // - this.ribbonPanel3.ColorSchemeStyle = DevComponents.DotNetBar.eDotNetBarStyle.StyleManagerControlled; - this.ribbonPanel3.Controls.Add(this.ribbonBar3); - this.ribbonPanel3.Dock = System.Windows.Forms.DockStyle.Fill; - this.ribbonPanel3.Location = new System.Drawing.Point(0, 33); - this.ribbonPanel3.Name = "ribbonPanel3"; - this.ribbonPanel3.Padding = new System.Windows.Forms.Padding(3, 0, 3, 3); - this.ribbonPanel3.Size = new System.Drawing.Size(1328, 62); - // - // - // - this.ribbonPanel3.Style.Class = ""; - this.ribbonPanel3.Style.CornerType = DevComponents.DotNetBar.eCornerType.Square; - // - // - // - this.ribbonPanel3.StyleMouseDown.Class = ""; - this.ribbonPanel3.StyleMouseDown.CornerType = DevComponents.DotNetBar.eCornerType.Square; - // - // - // - this.ribbonPanel3.StyleMouseOver.Class = ""; - this.ribbonPanel3.StyleMouseOver.CornerType = DevComponents.DotNetBar.eCornerType.Square; - this.ribbonPanel3.TabIndex = 40; - // - // ribbonBar3 - // - this.ribbonBar3.AutoOverflowEnabled = true; - // - // - // - this.ribbonBar3.BackgroundMouseOverStyle.Class = ""; - this.ribbonBar3.BackgroundMouseOverStyle.CornerType = DevComponents.DotNetBar.eCornerType.Square; - // - // - // - this.ribbonBar3.BackgroundStyle.Class = ""; - this.ribbonBar3.BackgroundStyle.CornerType = DevComponents.DotNetBar.eCornerType.Square; - this.ribbonBar3.ContainerControlProcessDialogKey = true; - this.ribbonBar3.Dock = System.Windows.Forms.DockStyle.Left; - this.ribbonBar3.Items.AddRange(new DevComponents.DotNetBar.BaseItem[] { - this.btn_device, - this.btn_Person, - this.btn_constructMap, - this.buttonItem9}); - this.ribbonBar3.Location = new System.Drawing.Point(3, 0); - this.ribbonBar3.Name = "ribbonBar3"; - this.ribbonBar3.Size = new System.Drawing.Size(378, 59); - this.ribbonBar3.Style = DevComponents.DotNetBar.eDotNetBarStyle.StyleManagerControlled; - this.ribbonBar3.TabIndex = 0; - // - // - // - this.ribbonBar3.TitleStyle.Class = ""; - this.ribbonBar3.TitleStyle.CornerType = DevComponents.DotNetBar.eCornerType.Square; - // - // - // - this.ribbonBar3.TitleStyleMouseOver.Class = ""; - this.ribbonBar3.TitleStyleMouseOver.CornerType = DevComponents.DotNetBar.eCornerType.Square; - this.ribbonBar3.TitleVisible = false; - // - // btn_device - // - this.btn_device.ButtonStyle = DevComponents.DotNetBar.eButtonStyle.ImageAndText; - this.btn_device.Image = global::Cyberpipe.Properties.Resources._24X24__2__02; - this.btn_device.ImagePosition = DevComponents.DotNetBar.eImagePosition.Top; - this.btn_device.Name = "btn_device"; - this.btn_device.SubItemsExpandWidth = 14; - this.btn_device.Text = "探测仪管理"; - this.btn_device.Click += new System.EventHandler(this.btn_device_Click); - // - // btn_Person - // - this.btn_Person.ButtonStyle = DevComponents.DotNetBar.eButtonStyle.ImageAndText; - this.btn_Person.Image = global::Cyberpipe.Properties.Resources._24x24icon_05_hover1; - this.btn_Person.ImagePosition = DevComponents.DotNetBar.eImagePosition.Top; - this.btn_Person.Name = "btn_Person"; - this.btn_Person.SubItemsExpandWidth = 14; - this.btn_Person.Text = "定位人员维护"; - this.btn_Person.Click += new System.EventHandler(this.btn_Person_Click); - // - // btn_constructMap - // - this.btn_constructMap.Image = global::Cyberpipe.Properties.Resources._24x24icon_04_hover; - this.btn_constructMap.ImagePosition = DevComponents.DotNetBar.eImagePosition.Top; - this.btn_constructMap.Name = "btn_constructMap"; - this.btn_constructMap.SubItemsExpandWidth = 14; - this.btn_constructMap.Text = "导出施工图"; - this.btn_constructMap.Click += new System.EventHandler(this.btn_constructMap_Click); - // - // buttonItem9 - // - this.buttonItem9.Image = global::Cyberpipe.Properties.Resources._24x24icon__2__10; - this.buttonItem9.ImagePosition = DevComponents.DotNetBar.eImagePosition.Top; - this.buttonItem9.Name = "buttonItem9"; - this.buttonItem9.SubItemsExpandWidth = 14; - this.buttonItem9.Text = "文档管理"; - this.buttonItem9.Click += new System.EventHandler(this.buttonItem9_Click); - // // ribbonPanel8 // this.ribbonPanel8.ColorSchemeStyle = DevComponents.DotNetBar.eDotNetBarStyle.StyleManagerControlled; @@ -4696,6 +4625,86 @@ this.btn_reset_password.Text = "重置密码"; this.btn_reset_password.Click += new System.EventHandler(this.btn_reset_password_Click); // + // ribbonPanel7 + // + this.ribbonPanel7.ColorSchemeStyle = DevComponents.DotNetBar.eDotNetBarStyle.StyleManagerControlled; + this.ribbonPanel7.Controls.Add(this.ribbonBar5); + this.ribbonPanel7.Dock = System.Windows.Forms.DockStyle.Fill; + this.ribbonPanel7.Location = new System.Drawing.Point(0, 0); + this.ribbonPanel7.Name = "ribbonPanel7"; + this.ribbonPanel7.Padding = new System.Windows.Forms.Padding(3, 0, 3, 3); + this.ribbonPanel7.Size = new System.Drawing.Size(1328, 95); + // + // + // + this.ribbonPanel7.Style.Class = ""; + this.ribbonPanel7.Style.CornerType = DevComponents.DotNetBar.eCornerType.Square; + // + // + // + this.ribbonPanel7.StyleMouseDown.Class = ""; + this.ribbonPanel7.StyleMouseDown.CornerType = DevComponents.DotNetBar.eCornerType.Square; + // + // + // + this.ribbonPanel7.StyleMouseOver.Class = ""; + this.ribbonPanel7.StyleMouseOver.CornerType = DevComponents.DotNetBar.eCornerType.Square; + this.ribbonPanel7.TabIndex = 41; + this.ribbonPanel7.Visible = false; + // + // ribbonBar5 + // + this.ribbonBar5.AutoOverflowEnabled = true; + // + // + // + this.ribbonBar5.BackgroundMouseOverStyle.Class = ""; + this.ribbonBar5.BackgroundMouseOverStyle.CornerType = DevComponents.DotNetBar.eCornerType.Square; + // + // + // + this.ribbonBar5.BackgroundStyle.Class = ""; + this.ribbonBar5.BackgroundStyle.CornerType = DevComponents.DotNetBar.eCornerType.Square; + this.ribbonBar5.ContainerControlProcessDialogKey = true; + this.ribbonBar5.Dock = System.Windows.Forms.DockStyle.Left; + this.ribbonBar5.Items.AddRange(new DevComponents.DotNetBar.BaseItem[] { + this.btn_flag, + this.slider4ground}); + this.ribbonBar5.Location = new System.Drawing.Point(3, 0); + this.ribbonBar5.Name = "ribbonBar5"; + this.ribbonBar5.Size = new System.Drawing.Size(418, 92); + this.ribbonBar5.Style = DevComponents.DotNetBar.eDotNetBarStyle.StyleManagerControlled; + this.ribbonBar5.TabIndex = 0; + // + // + // + this.ribbonBar5.TitleStyle.Class = ""; + this.ribbonBar5.TitleStyle.CornerType = DevComponents.DotNetBar.eCornerType.Square; + // + // + // + this.ribbonBar5.TitleStyleMouseOver.Class = ""; + this.ribbonBar5.TitleStyleMouseOver.CornerType = DevComponents.DotNetBar.eCornerType.Square; + this.ribbonBar5.TitleVisible = false; + this.ribbonBar5.ItemClick += new System.EventHandler(this.ribbonBar5_ItemClick); + // + // btn_flag + // + this.btn_flag.Image = global::Cyberpipe.Properties.Resources._24x24icon_03_hover; + this.btn_flag.ImagePosition = DevComponents.DotNetBar.eImagePosition.Top; + this.btn_flag.Name = "btn_flag"; + this.btn_flag.SubItemsExpandWidth = 14; + this.btn_flag.Text = "标识器管理"; + this.btn_flag.Click += new System.EventHandler(this.btn_flag_Click); + // + // slider4ground + // + this.slider4ground.LabelPosition = DevComponents.DotNetBar.eSliderLabelPosition.Top; + this.slider4ground.Name = "slider4ground"; + this.slider4ground.Text = "地面透明度"; + this.slider4ground.Value = 0; + this.slider4ground.ValueChanged += new System.EventHandler(this.slider4ground_ValueChanged); + // // ribbonPanel15 // this.ribbonPanel15.ColorSchemeStyle = DevComponents.DotNetBar.eDotNetBarStyle.StyleManagerControlled; @@ -6393,16 +6402,6 @@ this.buttonItem76.SubItemsExpandWidth = 14; this.buttonItem76.Text = "坐标标注"; // - // layerTree - // - this.layerTree.CheckBoxes = true; - this.layerTree.ItemHeight = 18; - this.layerTree.Location = new System.Drawing.Point(30, 78); - this.layerTree.Name = "layerTree"; - this.layerTree.Size = new System.Drawing.Size(121, 97); - this.layerTree.TabIndex = 1; - this.layerTree.AfterCheck += new System.Windows.Forms.TreeViewEventHandler(this.layerTree_AfterCheck); - // // MainFrm // this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Inherit; @@ -6475,11 +6474,11 @@ this.contextMenuStripDeleteLayerNode.ResumeLayout(false); this.ribbonControl1.ResumeLayout(false); this.ribbonControl1.PerformLayout(); - this.ribbonPanel1.ResumeLayout(false); - this.ribbonPanel7.ResumeLayout(false); - this.ribbonPanel2.ResumeLayout(false); this.ribbonPanel3.ResumeLayout(false); + this.ribbonPanel2.ResumeLayout(false); + this.ribbonPanel1.ResumeLayout(false); this.ribbonPanel8.ResumeLayout(false); + this.ribbonPanel7.ResumeLayout(false); this.ribbonPanel15.ResumeLayout(false); ((System.ComponentModel.ISupportInitialize)(this.pictureBox1)).EndInit(); this.ResumeLayout(false); diff --git a/NewFunction/FrmCreateTunnel.cs b/NewFunction/FrmCreateTunnel.cs index 282767c..338edff 100644 --- a/NewFunction/FrmCreateTunnel.cs +++ b/NewFunction/FrmCreateTunnel.cs @@ -142,35 +142,6 @@ } } - private void txtMS_KeyPress(object sender, KeyPressEventArgs e) - { - TextBox text = sender as TextBox; - if ((e.KeyChar < 48 || e.KeyChar > 57) && (e.KeyChar != 8) && (int)e.KeyChar != 46) - { - e.Handled = true; - } - if ((int)e.KeyChar == 46) //小数点 - { - if (text.Text.Length <= 0) - e.Handled = true; //小数点不能在第一位 - else //处理不规则的小数点 - { - float f; - float oldf; - bool b1 = false, b2 = false; - b1 = float.TryParse(text.Text, out oldf); - b2 = float.TryParse(text.Text + e.KeyChar.ToString(), out f); - if (b2 == false) - { - if (b1 == true) - e.Handled = true; - else - e.Handled = false; - } - } - } - } - private void FrmCreateTunnel_Load(object sender, EventArgs e) { if (comboBoxTunnelType.Items.Count > 0) diff --git a/OracleHelper.cs b/OracleHelper.cs index 11eebe6..79cdf48 100644 --- a/OracleHelper.cs +++ b/OracleHelper.cs @@ -49,7 +49,7 @@ { conn.Close(); } - MessageBox.Show(ex.Message, "提示"); + LogHelper.WriteLog(typeof(OledbHelper), ex.Message); return null; } } @@ -67,7 +67,7 @@ } catch(Exception ex) { - // LogError.PublishError(ex); + LogHelper.WriteLog(typeof(OledbHelper), ex.Message); } finally { @@ -111,6 +111,7 @@ } catch (Exception ex) { + LogHelper.WriteLog(typeof(OledbHelper), ex.Message); return null; } } @@ -131,6 +132,7 @@ } catch(Exception ex) { + LogHelper.WriteLog(typeof(OledbHelper), ex.Message); rowCount = -1; } finally @@ -159,6 +161,7 @@ } catch(Exception ex) { + LogHelper.WriteLog(typeof(OledbHelper), ex.Message); num = -1; } finally @@ -190,6 +193,7 @@ } catch (Exception ex) { + LogHelper.WriteLog(typeof(OledbHelper), ex.Message); return null; } } @@ -210,7 +214,7 @@ oracleCmd.Dispose(); conn.Close(); //调用con_close()方法,关闭与数据库的连接 }catch(Exception ex){ - + LogHelper.WriteLog(typeof(OledbHelper), ex.Message); } finally { @@ -237,6 +241,7 @@ } catch (Exception ex) { + LogHelper.WriteLog(typeof(OledbHelper), ex.Message); rowCount = -1; } finally diff --git a/Cyberpipe.csproj b/Cyberpipe.csproj index 07a8c1a..e3cd12c 100644 --- a/Cyberpipe.csproj +++ b/Cyberpipe.csproj @@ -204,25 +204,6 @@ - - Form - - - F_GKT1数据输入输出.cs - - - Form - - - F_GKT1添加文件.cs - - - Form - - - F_GKT1添加项目.cs - - Form @@ -1068,18 +1049,6 @@ Frm_password_reset.cs - - Form - - - GKT.cs - - - Form - - - GKT1.cs - Form @@ -1258,12 +1227,6 @@ F_Projedit.cs - - Form - - - PED.cs - Form @@ -1331,16 +1294,6 @@ True Reference.map - - F_GKT1数据输入输出.cs - Designer - - - F_GKT1添加文件.cs - - - F_GKT1添加项目.cs - Form_EditTask.cs @@ -1836,12 +1789,6 @@ Frm_password_reset.cs - - GKT.cs - - - GKT1.cs - F_GKT数据输入输出.cs @@ -1934,9 +1881,6 @@ F_Projedit.cs - - PED.cs - F_数据输入输出.cs diff --git a/Cyberpipe.suo b/Cyberpipe.suo index 68ced4f..a1aecf8 100644 --- a/Cyberpipe.suo +++ b/Cyberpipe.suo Binary files differ diff --git a/EMS_Forms/Form_EditTask.cs b/EMS_Forms/Form_EditTask.cs index 718992f..f1d791f 100644 --- a/EMS_Forms/Form_EditTask.cs +++ b/EMS_Forms/Form_EditTask.cs @@ -119,7 +119,8 @@ String name = Convert.ToString(dr["USERNAME"]); comboBox_userName.Items.Add(name); - } + } + dr.Close(); comboBox_road.Items.Clear(); roadList = new List(); @@ -135,7 +136,7 @@ comboBox_road.Items.Add(name); } } - + dr1.Close(); conn.Close(); bool flag2 = false; @@ -185,7 +186,7 @@ catch (Exception ex) { - MessageBox.Show(ex.ToString()); + LogHelper.WriteLog(typeof(Form_EditTask), ex.Message); } } @@ -288,7 +289,7 @@ } catch (Exception ex) { - MessageBox.Show(ex.ToString()); + LogHelper.WriteLog(typeof(Form_EditTask), ex.Message); } } @@ -474,7 +475,7 @@ } catch (Exception ex) { - MessageBox.Show(ex.ToString()); + LogHelper.WriteLog(typeof(Form_EditTask), ex.Message); } this.Close(); @@ -495,6 +496,7 @@ { numList.Add(Convert.ToInt32(dr["DBID"])); } + dr.Close(); if (numList.Count == 0) { taskNumber = Convert.ToInt32(number) * 100; @@ -674,6 +676,7 @@ } } } + dr.Close(); conn.Close(); } diff --git a/EMS_Forms/Form_EventManager.cs b/EMS_Forms/Form_EventManager.cs index b18c45b..84807b2 100644 --- a/EMS_Forms/Form_EventManager.cs +++ b/EMS_Forms/Form_EventManager.cs @@ -64,6 +64,7 @@ comboBox_name.Items.Add(name); } + dr.Close(); conn.Close(); diff --git a/Forms/FrmMnModify.cs b/Forms/FrmMnModify.cs index 31cfc5f..d036360 100644 --- a/Forms/FrmMnModify.cs +++ b/Forms/FrmMnModify.cs @@ -68,15 +68,7 @@ questionGrid.Rows[idx].Cells[1].Value = sr.question; } } - /// 选中对象 - /// - /// - /// - /// - private void buttonX1_Click(object sender, EventArgs e) - { - globecontrol.Globe.Action = EnumAction3D.SelectObject; - } + /// /// 选中某一行 /// diff --git a/Forms/FrmPipelineModelDataBase.cs b/Forms/FrmPipelineModelDataBase.cs index 2acf0ca..7ce573f 100644 --- a/Forms/FrmPipelineModelDataBase.cs +++ b/Forms/FrmPipelineModelDataBase.cs @@ -35,19 +35,7 @@ ds = _ds; InitializeComponent(); } - /// - /// 单击选择shp格式文件 - /// - /// - /// - private void btnBrowseModel_Click(object sender, EventArgs e) - { - saveFileDialog1.Filter = "*.lgd|*.lgd"; - if (saveFileDialog1.ShowDialog() == DialogResult.OK) - { - txtModelLayer.Text = saveFileDialog1.FileName; - } - } + /// /// 窗体初始化事件处理 /// @@ -100,49 +88,6 @@ } } } - - private object convertFieldValue(string fieldname, object obj) - { - if (obj == null) - return null; - - try - { - string type = fields_types[fieldname].ToString(); - switch (type) - { - case "string": - return obj.ToString(); - case "int": - //return 101; - int intResult; - if (int.TryParse(obj.ToString(), out intResult)) - return intResult; - else - return null; - case "double": - //return 202.5; - double doubleResult; - if (double.TryParse(obj.ToString(), out doubleResult)) - return doubleResult; - else - return null; - case "date": - DateTime dtResult; - if (DateTime.TryParse(obj.ToString(), out dtResult)) - return dtResult; - else - return null; - } - return null; - } - catch (Exception ex) - { - MessageBox.Show(ex.ToString()); - return null; - } - } - public string lgdFilePath = ""; /// /// 选择管线颜色 @@ -610,33 +555,6 @@ { this.Close(); } - - private void cmbLayer_SelectedIndexChanged(object sender, EventArgs e) //选择图层 - { - GSOLayer layer = ctl.Globe.Layers.GetLayerByCaption(selectLayerName); - GSOFeatures features = layer.GetAllFeatures(); - if (features.Length == 0) - return; - - cmbFrom.Items.Clear(); - cmbTo.Items.Clear(); - cmbRadius.Items.Clear(); - cmbID.Items.Clear(); - for (int i = 0; i < features[0].GetFieldCount(); i++) - { - GeoScene.Data.GSOFieldDefn fielddef = (GeoScene.Data.GSOFieldDefn)(features[0].GetFieldDefn(i)); - - cmbFrom.Items.Add(fielddef.Name); - cmbTo.Items.Add(fielddef.Name); - cmbRadius.Items.Add(fielddef.Name); - cmbID.Items.Add(fielddef.Name); - } - cmbFrom.SelectedItem = "Deep1"; - cmbTo.SelectedItem = "Deep2"; - cmbRadius.SelectedItem = "Diameter"; - cmbID.SelectedItem = "Handle"; - } - private void buttonXLayerPath_Click(object sender, EventArgs e)//单击 选择shp格式的文件 { OpenFileDialog dlg = new OpenFileDialog(); diff --git a/Forms/FrmPipelineModelDataOneStep.cs b/Forms/FrmPipelineModelDataOneStep.cs index 18afda7..ec93b8a 100644 --- a/Forms/FrmPipelineModelDataOneStep.cs +++ b/Forms/FrmPipelineModelDataOneStep.cs @@ -38,19 +38,7 @@ layerTree = _layerTree; InitializeComponent(); } - /// - /// 单击选择shp格式文件 - /// - /// - /// - private void btnBrowseModel_Click(object sender, EventArgs e) - { - saveFileDialog1.Filter = "*.lgd|*.lgd"; - if (saveFileDialog1.ShowDialog() == DialogResult.OK) - { - txtModelLayer.Text = saveFileDialog1.FileName; - } - } + /// /// 窗体初始化事件处理 /// @@ -107,48 +95,7 @@ } } - private object convertFieldValue(string fieldname, object obj) - { - if (obj == null) - return null; - - try - { - string type = fields_types[fieldname].ToString(); - switch (type) - { - case "string": - return obj.ToString(); - case "int": - //return 101; - int intResult; - if (int.TryParse(obj.ToString(), out intResult)) - return intResult; - else - return null; - case "double": - //return 202.5; - double doubleResult; - if (double.TryParse(obj.ToString(), out doubleResult)) - return doubleResult; - else - return null; - case "date": - DateTime dtResult; - if (DateTime.TryParse(obj.ToString(), out dtResult)) - return dtResult; - else - return null; - } - return null; - } - catch (Exception ex) - { - MessageBox.Show(ex.ToString()); - return null; - } - } - + public string lgdFilePath = ""; /// /// 选择管线颜色 @@ -673,32 +620,6 @@ return featDs; } - private void cmbLayer_SelectedIndexChanged(object sender, EventArgs e) //选择图层 - { - GSOLayer layer = ctl.Globe.Layers.GetLayerByCaption(selectLayerName); - GSOFeatures features = layer.GetAllFeatures(); - if (features.Length == 0) - return; - - cmbFrom.Items.Clear(); - cmbTo.Items.Clear(); - cmbRadius.Items.Clear(); - cmbID.Items.Clear(); - for (int i = 0; i < features[0].GetFieldCount(); i++) - { - GeoScene.Data.GSOFieldDefn fielddef = (GeoScene.Data.GSOFieldDefn)(features[0].GetFieldDefn(i)); - - cmbFrom.Items.Add(fielddef.Name); - cmbTo.Items.Add(fielddef.Name); - cmbRadius.Items.Add(fielddef.Name); - cmbID.Items.Add(fielddef.Name); - } - cmbFrom.SelectedItem = "Deep1"; - cmbTo.SelectedItem = "Deep2"; - cmbRadius.SelectedItem = "Diameter"; - cmbID.SelectedItem = "Handle"; - } - private void buttonXLayerPath_Click(object sender, EventArgs e)//单击 选择shp格式的文件 { OpenFileDialog dlg = new OpenFileDialog(); @@ -949,38 +870,6 @@ } //txtLayername.Text = type + layername; } - /// - /// 连接数据库 - /// - /// - /// - private void buttonX1_Click(object sender, EventArgs e) - { - if (ds == null) - { - //没连的话,直接连接审核库; //审核库配置读配置文件 - string dbIp = Utility.sgdbip; - string database = Utility.sgdbname; - string user = Utility.sgdbuser; - string pass = Utility.sgdbpwd; - - if (!Utility.isNetworkConnectionSuccess(dbIp.Trim())) - { - MessageBox.Show("网络连接失败!", "提示"); - return; - } - - ds = ctl.Globe.DataManager.OpenOracleDataSource(dbIp + "/" + database, "", "", user, pass); - if (ds == null) - { - MessageBox.Show("数据库连接失败!", "提示", MessageBoxButtons.OK, MessageBoxIcon.Warning); - } - else - { - btnCreateModel.Enabled = true; - } - } - } private void btnClose_Click(object sender, EventArgs e) { diff --git a/Forms/FrmShRK.cs b/Forms/FrmShRK.cs index 0e2e722..f1d83cb 100644 --- a/Forms/FrmShRK.cs +++ b/Forms/FrmShRK.cs @@ -215,6 +215,7 @@ { sourcefeatds = sourcefeat as GSOFeatureDataset; } + if (sourcefeatds == null) return; sourcefeatds.Open(); GSOFeatures sourcefeatures = sourcefeatds.GetAllFeatures(); @@ -251,6 +252,7 @@ { desfeatds = desfeat as GSOFeatureDataset; } + if (desfeatds == null) return; desfeatds.Open(); //向新数据集写入字段 diff --git a/FrmAccessoriesSensor.cs b/FrmAccessoriesSensor.cs index 09fcdf1..2a7a80e 100644 --- a/FrmAccessoriesSensor.cs +++ b/FrmAccessoriesSensor.cs @@ -209,7 +209,7 @@ chart1.Series[0].Points.DataBindXY(dic.Keys, dic.Values); for (int m = 0; m < dic.Values.Count; m++) { - if (chart1.Series[0].Points[m].YValues[0].ToString() != "0") + if (chart1.Series[0].Points[m]!=null&&chart1.Series[0].Points[m].YValues[0].ToString() != "0") { chart1.Series[0].Points[m].Label = chart1.Series[0].Points[m].YValues[0].ToString(); } diff --git a/FrmAccessoriesgather.cs b/FrmAccessoriesgather.cs index 9e331e1..a475d9e 100644 --- a/FrmAccessoriesgather.cs +++ b/FrmAccessoriesgather.cs @@ -338,7 +338,7 @@ chart1.Series[0].Points.DataBindXY(dic.Keys, dic.Values); for (int m = 0; m < dic.Values.Count; m++) { - if (chart1.Series[0].Points[m].YValues[0].ToString() != "0") + if (chart1.Series[0].Points[m]!=null&&chart1.Series[0].Points[m].YValues[0].ToString() != "0") { chart1.Series[0].Points[m].Label = chart1.Series[0].Points[m].YValues[0].ToString(); } diff --git a/FrmAccessoryAnalysis.cs b/FrmAccessoryAnalysis.cs index 71d4579..44d4065 100644 --- a/FrmAccessoryAnalysis.cs +++ b/FrmAccessoryAnalysis.cs @@ -66,39 +66,6 @@ globeControl1.Refresh(); } /// - /// 键盘按键按下事件处理 - /// - /// - /// - private void txtRadius_KeyPress(object sender, KeyPressEventArgs e) - { - TextBox text = sender as TextBox; - if ((e.KeyChar < 48 || e.KeyChar > 57) && (e.KeyChar != 8) && (int)e.KeyChar != 46) - { - e.Handled = true; - } - if ((int)e.KeyChar == 46) //小数点 - { - if (text.Text.Length <= 0) - e.Handled = true; //小数点不能在第一位 - else //处理不规则的小数点 - { - float f; - float oldf; - bool b1 = false, b2 = false; - b1 = float.TryParse(text.Text, out oldf); - b2 = float.TryParse(text.Text + e.KeyChar.ToString(), out f); - if (b2 == false) - { - if (b1 == true) - e.Handled = true; - else - e.Handled = false; - } - } - } - } - /// /// 确定按钮事件处理 /// /// diff --git a/FrmAddValve.cs b/FrmAddValve.cs index 34d2fec..5f405b9 100644 --- a/FrmAddValve.cs +++ b/FrmAddValve.cs @@ -486,56 +486,6 @@ } } - - - - - - - - private void cmbLayer_SelectedIndexChanged(object sender, EventArgs e) - { - GSOLayer layer = globeControl1.Globe.Layers.GetLayerByCaption(selectLayerName); - GSOFeatures features = layer.GetAllFeatures(); - if (features.Length == 0) - return; - - combPath.Items.Clear(); - combZ.Items.Clear(); - combModelName.Items.Clear(); - - for (int i = 0; i < features[0].GetFieldCount(); i++) - { - GeoScene.Data.GSOFieldDefn fielddef = (GeoScene.Data.GSOFieldDefn)(features[0].GetFieldDefn(i)); - combPath.Items.Add(fielddef.Name); - combZ.Items.Add(fielddef.Name); - combModelName.Items.Add(fielddef.Name); - } - combModelName.SelectedItem = "编号"; - combPath.SelectedItem = "模型路径"; - if (combfile.SelectedIndex != -1) - { - - string layerCaption = combfile.SelectedItem.ToString().Trim(); - rukuLayer = globeControl1.Globe.Layers.GetLayerByCaption(layerCaption); - if (rukuLayer != null) - { - combPath.Items.Clear(); - combZ.Items.Clear(); - combModelName.Items.Clear(); - - } - for (int i = 0; i < features[0].GetFieldCount(); i++) - { - GeoScene.Data.GSOFieldDefn fielddef = (GeoScene.Data.GSOFieldDefn)(features[0].GetFieldDefn(i)); - combPath.Items.Add(fielddef.Name); - combZ.Items.Add(fielddef.Name); - combModelName.Items.Add(fielddef.Name); - } - combModelName.SelectedItem = "编号"; - combPath.SelectedItem = "模型路径"; - } - } /// /// 单击选择shp格式文件 /// diff --git a/FrmAddWellShp.cs b/FrmAddWellShp.cs index bb79ec0..a249725 100644 --- a/FrmAddWellShp.cs +++ b/FrmAddWellShp.cs @@ -478,32 +478,6 @@ } } } - - private void cmbLayer_SelectedIndexChanged(object sender, EventArgs e) - { - GSOLayer layer = globeControl1.Globe.Layers.GetLayerByCaption(selectLayerName); - GSOFeatures features = layer.GetAllFeatures(); - if (features.Length == 0) - return; - - combCode.Items.Clear(); - combDeep.Items.Clear(); - combModelName.Items.Clear(); - combAngle.Items.Clear(); - - for (int i = 0; i < features[0].GetFieldCount(); i++) - { - GeoScene.Data.GSOFieldDefn fielddef = (GeoScene.Data.GSOFieldDefn)(features[0].GetFieldDefn(i)); - combCode.Items.Add(fielddef.Name); - combDeep.Items.Add(fielddef.Name); - combModelName.Items.Add(fielddef.Name); - combAngle.Items.Add(fielddef.Name); - } - combCode.SelectedItem = "附属物编码"; - combDeep.SelectedItem = "井深"; - combModelName.SelectedItem = "编号"; - combAngle.SelectedItem = "符号角度"; - } /// /// 单击选择shp格式文件 /// diff --git a/FrmAddYuBiZiShp.cs b/FrmAddYuBiZiShp.cs index b312d51..332f037 100644 --- a/FrmAddYuBiZiShp.cs +++ b/FrmAddYuBiZiShp.cs @@ -383,80 +383,7 @@ } } - private void cmbLayer_SelectedIndexChanged(object sender, EventArgs e) - { - GSOLayer layer = globeControl1.Globe.Layers.GetLayerByCaption(selectLayerName); - GSOFeatures features = layer.GetAllFeatures(); - if (features.Length == 0) - return; - - combCode.Items.Clear(); - combDeep.Items.Clear(); - combModelName.Items.Clear(); - //comboLoad.Items.Clear(); - for (int i = 0; i < features[0].GetFieldCount(); i++) - { - GeoScene.Data.GSOFieldDefn fielddef = (GeoScene.Data.GSOFieldDefn)(features[0].GetFieldDefn(i)); - combCode.Items.Add(fielddef.Name); - combDeep.Items.Add(fielddef.Name); - combModelName.Items.Add(fielddef.Name); - //comboLoad.Items.Add(fielddef.Name); - } - combCode.SelectedItem = "附属物编码"; - combDeep.SelectedItem = "Z坐标"; - combModelName.SelectedItem = "编号"; - //comboLoad.SelectedItem = "模型路径"; - } - - private void buttonXLayerPath_Click(object sender, EventArgs e) - { - OpenFileDialog dlg = new OpenFileDialog(); - dlg.Filter = "*.shp|*.shp"; - dlg.Multiselect = false; - if (dlg.ShowDialog() == DialogResult.OK) - { - GSOLayer layer = globeControl1.Globe.Layers.Add(dlg.FileName); - string txtMessage = valiYBdata(layer); - if (txtMessage != "") - { - button3.Enabled = false; - //textBoxLayer.Text = ""; - combCode.Items.Clear(); - combDeep.Items.Clear(); - combModelName.Items.Clear(); - globeControl1.Globe.Layers.Remove(layer); - FrmValiDataShowErrorMessage showErrorMessage = new FrmValiDataShowErrorMessage(dlg.FileName, txtMessage); - showErrorMessage.ShowDialog(); - return; - } - else - { - button3.Enabled = true; - //textBoxLayer.Text = dlg.FileName; - selectLayerName = layer.Caption; - txtLayerName.Text = layer.Caption; - GSOFeatures features = layer.GetAllFeatures(); - if (features.Length == 0) - return; - - combCode.Items.Clear(); - combDeep.Items.Clear(); - combModelName.Items.Clear(); - for (int i = 0; i < features[0].GetFieldCount(); i++) - { - GeoScene.Data.GSOFieldDefn fielddef = (GeoScene.Data.GSOFieldDefn)(features[0].GetFieldDefn(i)); - combCode.Items.Add(fielddef.Name); - combDeep.Items.Add(fielddef.Name); - combModelName.Items.Add(fielddef.Name); - //comboLoad.Items.Add(fielddef.Name); - } - combCode.SelectedItem = "管点编码"; - combDeep.SelectedItem = "Z坐标"; - combModelName.SelectedItem = "编号"; - } - } - } - + private void FrmAddYuBiZiShp_FormClosing(object sender, FormClosingEventArgs e) { globeControl1.Globe.Refresh(); diff --git a/FrmAllPipelineStatis.cs b/FrmAllPipelineStatis.cs index 6421a26..a6eea29 100644 --- a/FrmAllPipelineStatis.cs +++ b/FrmAllPipelineStatis.cs @@ -84,7 +84,7 @@ chartAllAreaPipeline.Series["管线"].Points.DataBindXY(pipelineLengthAndType.Keys, pipelineLengthAndType.Values); for (int m = 0; m < pipelineLengthAndType.Values.Count; m++) { - if (chartAllAreaPipeline.Series["管线"].Points[m].YValues[0].ToString() != "0") + if (chartAllAreaPipeline.Series["管线"].Points[m]!=null&&chartAllAreaPipeline.Series["管线"].Points[m].YValues[0].ToString() != "0") { chartAllAreaPipeline.Series["管线"].Points[m].Label = chartAllAreaPipeline.Series[0].Points[m].YValues[0].ToString(); } @@ -94,7 +94,7 @@ } catch (Exception ex) { - //LogError.PublishError(ex); + LogHelper.WriteLog(typeof(FrmAllPipelineStatis), ex.Message); } } @@ -147,7 +147,7 @@ } DataTable dt = OledbHelper.QueryTable(sql); - if (dt != null && dt.Rows.Count > 0) + if (dt != null && dt.Rows.Count > 0 && chartAllAreaPipeline.Series["管线"].Points[indexHit]!=null) { dataGridViewX1.DataSource = dt; panel.Visible = true; diff --git a/FrmAllWorkWellStatis.cs b/FrmAllWorkWellStatis.cs index 6fec7af..6af8e4c 100644 --- a/FrmAllWorkWellStatis.cs +++ b/FrmAllWorkWellStatis.cs @@ -52,7 +52,7 @@ chartAllAreaPipeline.Series["井盖"].Points.DataBindXY(workWellLengthAndType.Keys, workWellLengthAndType.Values); for (int m = 0; m < workWellLengthAndType.Values.Count; m++) { - if (chartAllAreaPipeline.Series["井盖"].Points[m].YValues[0].ToString().Trim() != "0") + if (chartAllAreaPipeline.Series["井盖"].Points[m]!=null&&chartAllAreaPipeline.Series["井盖"].Points[m].YValues[0].ToString().Trim() != "0") { chartAllAreaPipeline.Series["井盖"].Points[m].Label = chartAllAreaPipeline.Series[0].Points[m].YValues[0].ToString(); } @@ -60,7 +60,7 @@ } catch (Exception ex) { - //LogError.PublishError(ex); + LogHelper.WriteLog(typeof(FrmAllWorkWellStatis), ex.Message); } } diff --git a/FrmBSQDuoBianXingStatis.cs b/FrmBSQDuoBianXingStatis.cs index e8b7d52..3e889b6 100644 --- a/FrmBSQDuoBianXingStatis.cs +++ b/FrmBSQDuoBianXingStatis.cs @@ -60,7 +60,7 @@ { for (int m = 0; m < bsq1.Values.Count; m++) { - if (chart1.Series["标识器"].Points[m].YValues[0].ToString() != "0") + if (chart1.Series["标识器"].Points[m]!=null&&chart1.Series["标识器"].Points[m].YValues[0].ToString() != "0") { count += Convert.ToInt16(chart1.Series[0].Points[m].YValues[0].ToString()); chart1.Series["标识器"].Points[m].Label = chart1.Series[0].Points[m].YValues[0].ToString(); diff --git a/FrmBSQDuoBianXingStreet.cs b/FrmBSQDuoBianXingStreet.cs index 2005ebb..1db5777 100644 --- a/FrmBSQDuoBianXingStreet.cs +++ b/FrmBSQDuoBianXingStreet.cs @@ -63,7 +63,7 @@ chartStatis.Series[0].Points.DataBindXY(bsq.Keys, bsq.Values); for (int m = 0; m < bsq.Values.Count; m++) { - if (chartStatis.Series[0].Points[m].YValues[0].ToString().Trim() != "0") + if (chartStatis.Series[0].Points[m]!=null&&chartStatis.Series[0].Points[m].YValues[0].ToString().Trim() != "0") { count += Convert.ToInt16(chartStatis.Series[0].Points[m].YValues[0].ToString()); chartStatis.Series[0].Points[m].Label = chartStatis.Series[0].Points[m].YValues[0].ToString(); diff --git a/FrmBSQStatis.cs b/FrmBSQStatis.cs index 390a55c..4aa0ee6 100644 --- a/FrmBSQStatis.cs +++ b/FrmBSQStatis.cs @@ -95,6 +95,8 @@ } } } + + dr.Close(); conn.Close(); for (int i = 0; i < typeLists.Count; i++) { @@ -123,7 +125,7 @@ chartStatis.Series[0].Points.DataBindXY(bsq.Keys, bsq.Values); for (int m = 0; m < bsq.Values.Count; m++) { - if (chartStatis.Series[0].Points[m].YValues[0].ToString().Trim() != "0") + if (chartStatis.Series[0].Points[m]!=null&&chartStatis.Series[0].Points[m].YValues[0].ToString().Trim() != "0") { //count += Convert.ToInt16(chartStatis.Series[0].Points[m].YValues[0].ToString()); chartStatis.Series[0].Points[m].Label = chartStatis.Series[0].Points[m].YValues[0].ToString(); diff --git a/FrmBSQStreet.cs b/FrmBSQStreet.cs index 9d88adb..7fbacad 100644 --- a/FrmBSQStreet.cs +++ b/FrmBSQStreet.cs @@ -44,7 +44,7 @@ chartStatis.Series[0].Points.DataBindXY(bsq.Keys, bsq.Values); for (int m = 0; m < bsq.Values.Count; m++) { - if (chartStatis.Series[0].Points[m].YValues[0].ToString().Trim() != "0") + if (chartStatis.Series[0].Points[m]!=null&&chartStatis.Series[0].Points[m].YValues[0].ToString().Trim() != "0") { count += Convert.ToInt16(chartStatis.Series[0].Points[m].YValues[0].ToString()); chartStatis.Series[0].Points[m].Label = chartStatis.Series[0].Points[m].YValues[0].ToString(); diff --git a/FrmBoosterValvers.cs b/FrmBoosterValvers.cs index 5061efc..df9b62b 100644 --- a/FrmBoosterValvers.cs +++ b/FrmBoosterValvers.cs @@ -236,199 +236,6 @@ count = 0; } } - /// - /// 添加火苗 - /// - /// - /// - /// - /// - private GSOFeature AddFire(double x,double y,double z) - { - // 烟火示例 - - string strResPath = Application.StartupPath + "/Resource"; - - // 烟火粒子示例,由三个发射器构成 - GSOGeoParticle geoParticle = new GSOGeoParticle(); - geoParticle.SetPosition(x, y, z); // 添加到这个经纬度位置 - geoParticle.AltitudeMode = EnumAltitudeMode.RelativeToGround; - - GSORingParticleEmitter emitter = new GSORingParticleEmitter(); - emitter.TexturePath = strResPath + "/ParticleImage/flare.png"; - - emitter.SetSizeFix(1, 1); - emitter.VelFix = 1; - emitter.VelRnd = 5; - - emitter.AngleXYFix = 0; - emitter.AngleXYRnd = 180; - - emitter.AngleXZFix = 90; - emitter.AngleXZRnd = 0; - - emitter.LifeFix = 0.5f; - emitter.LifeRnd = 0.0f; - - emitter.RotFix = 0; - emitter.RotRnd = 0; - - emitter.RotVelFix = 0; - emitter.RotVelRnd = 0; - - emitter.EmitPerSec = 100; - - // 采用线性插值生成粒子的初始颜色 - emitter.ColorRndStart = Color.White; - emitter.ColorRndEnd = Color.Red; - - - GSOColorParticleEffector effector2 = new GSOColorParticleEffector(); - effector2.SetColorChanged(0, -1, -1, 0); - effector2.StartTime = 0.0f; - effector2.EndTime = -1.0f; - emitter.AddEffector(effector2); - - // 将三个发射器添加到粒子对象中 - geoParticle.AddEmitter(emitter); - - geoParticle.Play(); - - GSOFeature feature = new GSOFeature(); - - feature.Geometry = geoParticle; - - globeControl1.Globe.MemoryLayer.AddFeature(feature); - - - return feature; - } - - /// - /// 添加喷泉 - /// - /// - private GSOFeature AddFountain() - { - string strResPath = Application.StartupPath + "/Resource"; - - GSOGeoParticle geoParticle = new GSOGeoParticle(); - geoParticle.SetPosition(116.314, 39.84, 0); // 添加到这个经纬度位置 - - GSOPointParticleEmitter emitter = new GSOPointParticleEmitter(); - emitter.TexturePath = strResPath + "/ParticleImage/test.png"; - - emitter.SetSizeFix(0.5f, 2); - emitter.VelFix = 10; - emitter.VelRnd = 2; - - emitter.GravityAcc = 9.8f; - emitter.AngleXYFix = 0; - emitter.AngleXYRnd = 180; - - emitter.AngleXZFix = 88; - emitter.AngleXZRnd = 2; - - //emitter.InnerRadius = 0; - // emitter.OuterRadius = 0.03f; - - emitter.LifeFix = 5.0f; - emitter.LifeRnd = 1.0f; - - emitter.RotFix = 0; - emitter.RotRnd = 0; - - emitter.RotVelFix = 0; - emitter.RotVelRnd = 0; - - emitter.EmitPerSec = 1000; - emitter.ColorRndStart = Color.FromArgb(33, 255, 255, 255); - emitter.ColorRndEnd = Color.FromArgb(11, 255, 255, 255); - emitter.IsLumAdded = false; - - // 将三个发射器添加到粒子对象中 - geoParticle.AddEmitter(emitter); - - geoParticle.Play(); - GSOFeature feature = new GSOFeature(); - - feature.Geometry = geoParticle; - - //globeControl1.Globe.MemoryLayer.AddFeature(feature); - globeControl1.Globe.FlyToFeature(feature); - - return feature; - } - - /// - /// 添加水柱 - /// - /// - private GSOFeature AddWaterLine() - { - string strResPath = Application.StartupPath + "/Resource"; - - GSOGeoParticle geoParticle = new GSOGeoParticle(); - geoParticle.SetPosition(116.308, 39.84, 0); // 添加到这个经纬度位置 - - GSOPointParticleEmitter emitter = new GSOPointParticleEmitter(); - - emitter.TexturePath = strResPath + "/ParticleImage/drop3.png"; - - geoParticle.TimerInterval = 1; - - emitter.SetSizeFix(2.0f, 2.0f); - - emitter.VelFix = 50; - emitter.VelRnd = 2; - - // emitter.IsLumAdded = false; - - emitter.GravityAcc = 9.8f; - emitter.AngleXYFix = 0; - emitter.AngleXYRnd = 2; - - emitter.AngleXZFix = 60; - emitter.AngleXZRnd = 2; - - //emitter.InnerRadius = 0; - // emitter.OuterRadius = 0.1f; - - emitter.LifeFix = 5.0f; - emitter.LifeRnd = 1.0f; - - emitter.RotFix = 0; - emitter.RotRnd = 0; - - emitter.RotVelFix = 0; - emitter.RotVelRnd = 0; - - emitter.EmitPerSec = 1500; - - emitter.ColorRndStart = Color.FromArgb(100, 222, 222, 222); - emitter.ColorRndEnd = Color.FromArgb(50, 222, 222, 222); - - /* - - GSOScaleParticleEffector effector1 = new GSOScaleParticleEffector(); - effector1.SetScale(0.2f, 0.2f); - effector1.StartTime = 0; - effector1.EndTime = -1; // 负数表示整个粒子生命结束 - emitter.AddEffector(effector1); - */ - - // 将三个发射器添加到粒子对象中 - geoParticle.AddEmitter(emitter); - - geoParticle.Play(); - GSOFeature feature = new GSOFeature(); - - feature.Geometry = geoParticle; - - //globeControl1.Globe.MemoryLayer.AddFeature(feature); - globeControl1.Globe.FlyToFeature(feature); - - return feature; - } + } } diff --git a/FrmBufferAnalysis.cs b/FrmBufferAnalysis.cs index f711133..db8ca59 100644 --- a/FrmBufferAnalysis.cs +++ b/FrmBufferAnalysis.cs @@ -123,39 +123,6 @@ } } /// - /// 半径文本框的键盘按键按下事件处理 - /// - /// - /// - private void txtRadius_KeyPress(object sender, KeyPressEventArgs e) - { - TextBox text = sender as TextBox; - if ((e.KeyChar < 48 || e.KeyChar > 57) && (e.KeyChar != 8) && (int)e.KeyChar != 46) - { - e.Handled = true; - } - if ((int)e.KeyChar == 46) //小数点 - { - if (text.Text.Length <= 0) - e.Handled = true; //小数点不能在第一位 - else //处理不规则的小数点 - { - float f; - float oldf; - bool b1 = false, b2 = false; - b1 = float.TryParse(text.Text, out oldf); - b2 = float.TryParse(text.Text + e.KeyChar.ToString(), out f); - if (b2 == false) - { - if (b1 == true) - e.Handled = true; - else - e.Handled = false; - } - } - } - } - /// /// 窗体关闭事件处理 /// /// diff --git a/FrmBufferAnalysisBSQ.cs b/FrmBufferAnalysisBSQ.cs index 24a96ca..f54208f 100644 --- a/FrmBufferAnalysisBSQ.cs +++ b/FrmBufferAnalysisBSQ.cs @@ -137,35 +137,7 @@ } } - private void txtRadius_KeyPress(object sender, KeyPressEventArgs e) - { - TextBox text = sender as TextBox; - if ((e.KeyChar < 48 || e.KeyChar > 57) && (e.KeyChar != 8) && (int)e.KeyChar != 46) - { - e.Handled = true; - } - if ((int)e.KeyChar == 46) //小数点 - { - if (text.Text.Length <= 0) - e.Handled = true; //小数点不能在第一位 - else //处理不规则的小数点 - { - float f; - float oldf; - bool b1 = false, b2 = false; - b1 = float.TryParse(text.Text, out oldf); - b2 = float.TryParse(text.Text + e.KeyChar.ToString(), out f); - if (b2 == false) - { - if (b1 == true) - e.Handled = true; - else - e.Handled = false; - } - } - } - } - + private void FrmBufferAnalysis_FormClosing(object sender, FormClosingEventArgs e) { //Form1.y = 0; @@ -316,27 +288,6 @@ } } - private void FlyToMenu_Click(object sender, EventArgs e) - { - if (m_feature != null) - { - if (m_feature.Geometry != null && m_feature.Geometry.Type == EnumGeometryType.GeoPolyline3D) - { - GSOGeoPolyline3D line = m_feature.Geometry as GSOGeoPolyline3D; - double length = line.GetSpaceLength(true, 6378137); - GSOGeoPolyline3D lineLine = line.GetSegment(0, length / 2); - GSOPoint3d point3d = lineLine[lineLine.PartCount - 1][lineLine[lineLine.PartCount - 1].Count - 1]; - - globeControl1.Globe.FlyToPosition(point3d, EnumAltitudeMode.Absolute, 0, 45, 5); - } - else - { - globeControl1.Globe.FlyToFeature(m_feature, 0, 45, 3); - } - LightMenu_Click(sender, e); - } - } - private void LightMenu_Click(object sender, EventArgs e) { flashflag = "single"; diff --git a/FrmDataBaseOpt.cs b/FrmDataBaseOpt.cs index b0c4b5d..8d7b69d 100644 --- a/FrmDataBaseOpt.cs +++ b/FrmDataBaseOpt.cs @@ -362,6 +362,7 @@ dbCombor.Items.Add(dblist[i].title); } } + /* /// /// 从配置文件读取数据库参数配置 /// @@ -428,6 +429,8 @@ } } + * */ + /* /// /// 向配置文件写入连接数据库的参数配置 /// @@ -485,6 +488,7 @@ MessageBox.Show(exp.ToString()); } } + * */ /// /// /// diff --git a/FrmDatabaseParaSetting.cs b/FrmDatabaseParaSetting.cs index a6fea46..63b596b 100644 --- a/FrmDatabaseParaSetting.cs +++ b/FrmDatabaseParaSetting.cs @@ -152,6 +152,7 @@ this.DialogResult = DialogResult.OK; this.Close(); } + /* /// /// 从配置文件读取数据库连接参数配置 /// @@ -218,6 +219,8 @@ } } + * */ + /* /// /// 向配置文件写入数据库参数配置 /// @@ -276,7 +279,7 @@ MessageBox.Show(ex.ToString()); } } - + */ /// /// 取消按钮事件处理 /// diff --git a/FrmDatabaseParaSetting2.cs b/FrmDatabaseParaSetting2.cs index 932d05e..96a87d5 100644 --- a/FrmDatabaseParaSetting2.cs +++ b/FrmDatabaseParaSetting2.cs @@ -148,6 +148,7 @@ this.DialogResult = DialogResult.OK; this.Close(); } + /* /// /// 从配置文件读取数据库连接参数配置 /// @@ -214,6 +215,8 @@ } } + * */ + /* /// /// 向配置文件写入数据库参数配置 /// @@ -272,7 +275,7 @@ MessageBox.Show(exp.ToString()); } } - + */ /// /// 取消按钮事件处理 /// diff --git a/FrmDiameterQuery.cs b/FrmDiameterQuery.cs index 68c948b..9a5215b 100644 --- a/FrmDiameterQuery.cs +++ b/FrmDiameterQuery.cs @@ -77,18 +77,7 @@ isBetween = true; } } - /// - /// 键盘按键按下事件处理 - /// - /// - /// - private void textBoxX1_KeyPress(object sender, KeyPressEventArgs e) - { - if ((e.KeyChar < 48 || e.KeyChar > 57) && e.KeyChar != 8) - { - e.Handled = true;//屏蔽 - } - } + bool isBetween = false; /// diff --git a/FrmDocumentEdit.cs b/FrmDocumentEdit.cs index aab2d31..e78a7ff 100644 --- a/FrmDocumentEdit.cs +++ b/FrmDocumentEdit.cs @@ -256,121 +256,6 @@ } - // - /// 将本地文件上传到指定的服务器(HttpWebRequest方法) - /// - /// 文件上传到的服务器 - /// 要上传的本地文件(全路径) - /// 文件上传后的名称 - /// 上传进度条 - /// 成功返回1,失败返回0 - private int Upload_Request(string address, string fileNamePath, string saveName, ProgressBar progressBar) - { - int returnValue = 0; - // 要上传的文件 - FileStream fs = new FileStream(fileNamePath, FileMode.Open, FileAccess.Read); - BinaryReader r = new BinaryReader(fs); - //时间戳 - string strBoundary = "----------" + DateTime.Now.Ticks.ToString("x"); - byte[] boundaryBytes = Encoding.ASCII.GetBytes("/r/n--" + strBoundary + "/r/n"); - //请求头部信息 - StringBuilder sb = new StringBuilder(); - sb.Append("--"); - sb.Append(strBoundary); - sb.Append("\r\n"); - sb.Append("Content-Disposition: form-data; name=\""); - sb.Append("file"); - sb.Append("\"; filename=\""); - sb.Append(saveName); - sb.Append("\""); - sb.Append("\r\n"); - sb.Append("Content-Type: "); - sb.Append("application/octet-stream"); - sb.Append("\r\n"); - sb.Append("\r\n"); - string strPostHeader = sb.ToString(); - byte[] postHeaderBytes = Encoding.UTF8.GetBytes(strPostHeader); - // 根据uri创建HttpWebRequest对象 - HttpWebRequest httpReq = (HttpWebRequest)WebRequest.Create(new Uri(address)); - httpReq.Method = "POST"; - //对发送的数据不使用缓存 - httpReq.AllowWriteStreamBuffering = false; - //设置获得响应的超时时间(300秒) - httpReq.Timeout = 300000; - httpReq.ContentType = "multipart/form-data; boundary=" + strBoundary; - long length = fs.Length + postHeaderBytes.Length + boundaryBytes.Length; - long fileLength = fs.Length; - httpReq.ContentLength = length; - try - { - progressBar.Maximum = int.MaxValue; - progressBar.Minimum = 0; - progressBar.Value = 0; - //每次上传4k - int bufferLength = 4096; - byte[] buffer = new byte[bufferLength]; - //已上传的字节数 - long offset = 0; - //开始上传时间 - DateTime startTime = DateTime.Now; - int size = r.Read(buffer, 0, bufferLength); - Stream postStream = httpReq.GetRequestStream(); - //发送请求头部消息 - postStream.Write(postHeaderBytes, 0, postHeaderBytes.Length); - while (size > 0) - { - postStream.Write(buffer, 0, size); - offset += size; - progressBar.Value = (int)(offset * (int.MaxValue / length)); - TimeSpan span = DateTime.Now - startTime; - double second = span.TotalSeconds; - //lblTime.Text = "已用时:" + second.ToString("F2") + "秒"; - //if (second > 0.001) - //{ - // lblSpeed.Text = " 平均速度:" + (offset / 1024 / second).ToString("0.00") + "KB/秒"; - //} - //else - //{ - // lblSpeed.Text = " 正在连接…"; - //} - //lblState.Text = "已上传:" + (offset * 100.0 / length).ToString("F2") + "%"; - //lblSize.Text = (offset / 1048576.0).ToString("F2") + "M/" + (fileLength / 1048576.0).ToString("F2") + "M"; - Application.DoEvents(); - size = r.Read(buffer, 0, bufferLength); - } - //添加尾部的时间戳 - postStream.Write(boundaryBytes, 0, boundaryBytes.Length); - postStream.Close(); - //获取服务器端的响应 - WebResponse webRespon = httpReq.GetResponse(); - Stream s = webRespon.GetResponseStream(); - StreamReader sr = new StreamReader(s); - //读取服务器端返回的消息 - String sReturnString = sr.ReadLine(); - s.Close(); - sr.Close(); - if (sReturnString == "Success") - { - returnValue = 1; - } - else if (sReturnString == "Error") - { - returnValue = 0; - } - } - catch(Exception ex) - { - returnValue = 0; - string str = ex.ToString(); - } - finally - { - fs.Close(); - r.Close(); - } - return returnValue; - } - private void btn_file_Click(object sender, EventArgs e) { OpenFileDialog dlg = new OpenFileDialog(); diff --git a/FrmExportCADS.cs b/FrmExportCADS.cs index 98772ea..59629dd 100644 --- a/FrmExportCADS.cs +++ b/FrmExportCADS.cs @@ -108,65 +108,6 @@ MessageBox.Show("请选中要导出的图层!", "提示", MessageBoxButtons.OK, MessageBoxIcon.Warning); } } - private Boolean MerageToFile(GSOFeatures features, String strDestFile, String strProj4)//图层追加 - { - if (features == null) - { - return false; - } - Boolean bSuccess = false; - - string strDir = GSOUtility.GetFileDir(strDestFile); - string strLPRJFile = GSOUtility.ChangeExt(strDestFile, ".lprj"); - string strExt = GSOUtility.GetFileExt(strDestFile); - - // 如果投影文件存在,投影以投影文件为准 - if (File.Exists(strLPRJFile)) - { - // 如果是dxf,则这样处理 - if (strExt.ToLower() == ".dxf") - { - string strTempSrcFile = strDir + "srcFeatures_dxftmp" + strExt; - globeControl1.Globe.DataManager.SaveFeatureData(features, strTempSrcFile, strLPRJFile, 4); - bSuccess = GSOUtility.MergeTwoDXFFileFeatures(strDestFile, strTempSrcFile); - File.Delete(strTempSrcFile); - } - else - { - GSOFeatures srcFeatures = globeControl1.Globe.DataManager.ReadFeatureData(strDestFile); - int nCount = features.Length; - int i = 0; - for (i = 0; i < nCount; i++) - { - srcFeatures.Add(features[i]); - } - bSuccess = globeControl1.Globe.DataManager.SaveFeatureData(srcFeatures, strDestFile, strLPRJFile, 4); - } - } - else - { - // 如果是dxf,则这样处理 - if (strExt.ToLower() == ".dxf") - { - string strTempSrcFile = strDir + "srcFeatures_dxftmp" + strExt; - globeControl1.Globe.DataManager.SaveFeatureData(features, strTempSrcFile, strProj4, 0); - bSuccess = GSOUtility.MergeTwoDXFFileFeatures(strDestFile, strTempSrcFile); - File.Delete(strTempSrcFile); - } - else - { - GSOFeatures srcFeatures = globeControl1.Globe.DataManager.ReadFeatureData(strDestFile); - int nCount = features.Length; - int i = 0; - for (i = 0; i < nCount; i++) - { - srcFeatures.Add(features[i]); - } - bSuccess = globeControl1.Globe.DataManager.SaveFeatureData(srcFeatures, strDestFile, strProj4, 0); - } - } - return bSuccess; - } /// /// 关闭按钮事件处理 /// diff --git a/FrmHDMAnalysis3.cs b/FrmHDMAnalysis3.cs index 4f73af6..2ada735 100644 --- a/FrmHDMAnalysis3.cs +++ b/FrmHDMAnalysis3.cs @@ -436,29 +436,6 @@ } layerTemp.RemoveAllFeature(); } - private void Export(GSOPoint3d _pnt, double r) - { - GSOPoint3ds pnts = new GSOPoint3ds(); - GSOPoint3d pnt = new GSOPoint3d(); - pnt.X = _pnt.X; - pnt.Y = _pnt.Y; - pnt.Z = _pnt.Z; - pnts.Add(pnt); - pnt.X = _pnt.X; - pnt.Y = _pnt.Y - 0.0000000005; - pnt.Z = _pnt.Z; - pnts.Add(pnt); - GSOGeoPolyline3D line = new GSOGeoPolyline3D(); - line.AddPart(pnts); - GSOGeoPolygon3D polygon = line.CreateBuffer(r * 2, true, 5, true, false); - GSOPoint3ds points = polygon[0]; - GSOGeoPolyline3D newLine = new GSOGeoPolyline3D(); - newLine.AddPart(points); - newLine.AltitudeMode = EnumAltitudeMode.RelativeToGround; - GSOFeature newFeature = new GSOFeature(); - newFeature.Geometry = newLine; - globeControl1.Globe.MemoryLayer.AddFeature(newFeature); - } private void ExportCAD(double a, double b, double r) { diff --git a/FrmHotFuncStat.cs b/FrmHotFuncStat.cs index c980f34..2eb1476 100644 --- a/FrmHotFuncStat.cs +++ b/FrmHotFuncStat.cs @@ -421,13 +421,6 @@ } } - private void HFS_Pderive_Click(object sender, EventArgs e) - { - if (TV_Files.SelectedNode != null) - { - HFSClass.GuideEdit_form("G", TV_Files, int.Parse(((ToolStripMenuItem)sender).Tag.ToString())); - } - } private void 导入ToolStripMenuItem_Click(object sender, EventArgs e) { @@ -530,22 +523,8 @@ } } - private void 导出ToolStripMenuItem1_Click(object sender, EventArgs e) - { - 导出ToolStripMenuItem2_Click(sender, e); - } + - private void TV_HFSSrchRslt_AfterCollapse(object sender, TreeViewEventArgs e) - { - e.Node.ImageIndex = 0; - } - - private void TV_HFSSrchRslt_AfterExpand(object sender, TreeViewEventArgs e) - { - HFSClass.ADD_TreeNode(TV_Files, e.Node); - e.Node.ImageIndex = 1; - } - private void 导出ToolStripMenuItem1_Click_1(object sender, EventArgs e) { if ((TV_HFSSrchRslt.SelectedNode != null) && (TV_HFSSrchRslt.SelectedNode.Parent != null)) diff --git a/FrmLayerControl.cs b/FrmLayerControl.cs index e7917c3..28fa14d 100644 --- a/FrmLayerControl.cs +++ b/FrmLayerControl.cs @@ -312,26 +312,7 @@ layerManagerNode.Expand(); terrainManagerNode.Expand(); } - /// - /// 刷新节点树 - /// - private void RefreshDataTree() - { - layerTree2.Nodes[0].Nodes.Clear(); - Int32 nCount = globeControl2.Globe.Layers.Count; - Int32 i = 0; - for (i = 0; i < nCount; i++) - { - GSODataset dataSpace = globeControl2.Globe.Layers[i].Dataset; - TreeNode node = new TreeNode(); - node.Text = dataSpace.Name; - node.ImageIndex = 0; - node.SelectedImageIndex = 0; - node.Checked = true; - node.Tag = dataSpace; - layerTree2.Nodes[0].Nodes.Add(node); - } - } + /// /// 目标图层按钮事件处理 /// @@ -494,22 +475,8 @@ } } } - /// - /// 改变指定节点的选中状态 - /// - /// - /// - private void CheckTreeNode(TreeNode node, Boolean bChecked) - { - CheckChildTreeNode(node, bChecked); - // 对于kml图层,如果当前处理的节点是true,那么要把所有的祖宗节点置为true - // 只有所有节点都未false,那么这个节点才为false - // CheckFatherTreeNode(node, bChecked); - globeControl1.Globe.Refresh(); - globeControl2.Globe.Refresh(); - - } + private void CheckChildTreeNode(TreeNode node, Boolean bChecked) { if (node == null) @@ -696,59 +663,7 @@ //} //CheckControl(e); } - /// - /// 树节点选中方法 - /// - /// - private void CheckControl(TreeViewEventArgs e) - { - if (e.Action != TreeViewAction.Unknown) - { - if (e.Node != null && !Convert.IsDBNull(e.Node)) - { - CheckParentNode(e.Node); - if (e.Node.Nodes.Count > 0) - { - CheckAllChildNodes(e.Node, e.Node.Checked); - } - } - } - } - /// - /// 改变所有子节点的状态 - /// - /// - /// - private void CheckAllChildNodes(TreeNode pn, bool IsChecked) - { - foreach (TreeNode tn in pn.Nodes) - { - tn.Checked = IsChecked; - if (tn.Tag.ToString().Contains("|")) - { - string nodeTag = tn.Tag.ToString().Split('|')[1]; - GSOLayer layer = globeControl1.Globe.Layers.GetLayerByCaption(nodeTag); - if (layer != null) - { - layer.Visible = IsChecked; - globeControl1.Globe.Refresh(); - } - } - if (tn.Tag is GSOFeature) - { - if (tn.Nodes.Count == 0) - { - GSOFeature feat = tn.Tag as GSOFeature; - feat.Visible = IsChecked; - globeControl1.Globe.Refresh(); - } - } - if (tn.Nodes.Count > 0) - { - CheckAllChildNodes(tn, IsChecked); - } - } - } + /// /// 改变父节点的选中状态,此处为所有子节点不选中时才取消父节点选中,可以根据需要修改 /// diff --git a/FrmLogin.cs b/FrmLogin.cs index 320fdd5..2afe46e 100644 --- a/FrmLogin.cs +++ b/FrmLogin.cs @@ -59,70 +59,6 @@ textBoxPassWord.Clear(); } } - - /// - /// 验证端口号 - /// - /// - private bool ValiPort() - { - Ping p = new Ping();//创建Ping对象p - PingReply pr = p.Send(Utility.localicenseserverip);//向指定IP或者主机名的计算机发送ICMP协议的ping数据包 - if (pr.Status == IPStatus.Success)//如果ping成功 - { - try - { - TcpClient tcpc = new TcpClient(Utility.localicenseserverip, Utility.localicenseserverport);//对IP地址为"192.168.0.105"的计算机的1500端口提出连接申请 - tcpc.Close(); - return true; - } - catch (Exception ex) - { - MessageBox.Show("端口连接错误!" + ex.Message); - return false; - } - } - else - { - int times = 0;//重新连接次数; - int count = 2;//设置尝试次数 - while (times < count) - { - //Thread.Sleep(1000);//等待时间(方便测试的话,你可以改为1000) - pr = p.Send(Utility.localicenseserverip); - - if (pr.Status == IPStatus.Success) - { - try - { - TcpClient tcpc = new TcpClient(Utility.localicenseserverip, Utility.localicenseserverport);//对IP地址为"192.168.0.105"的计算机的1500端口提出连接申请 - tcpc.Close(); - return true; - } - catch (Exception ex) - { - MessageBox.Show("端口连接错误!" + ex.Message); - return false; - } - } - else - { - times++; - if (times < count) - { - continue; - } - else - { - MessageBox.Show("重新尝试连接失败"); - return false; - } - } - - } - return false; - } - } /// /// 验证用户名、密码 /// diff --git a/FrmMetadata.cs b/FrmMetadata.cs index 886f65a..0365372 100644 --- a/FrmMetadata.cs +++ b/FrmMetadata.cs @@ -27,11 +27,7 @@ InitializeComponent(); loadTreeView(layerTree); } - private void FrmMetadata_Load(object sender, EventArgs e) - { - //this.ntLblC.Text = "nn"; - // loadTreeView(layerTree); - } + private void loadTreeView(TreeView tv)//构建图层树 { try diff --git a/FrmMetadataStat.cs b/FrmMetadataStat.cs index 790658a..e7696c6 100644 --- a/FrmMetadataStat.cs +++ b/FrmMetadataStat.cs @@ -197,9 +197,5 @@ } } - private void buttonX1_Click(object sender, EventArgs e) - { - drawChart(); - } } } diff --git a/FrmPatrolerManager.cs b/FrmPatrolerManager.cs index 37f8ffd..9e66aeb 100644 --- a/FrmPatrolerManager.cs +++ b/FrmPatrolerManager.cs @@ -109,82 +109,8 @@ this.winGridViewPager1.AllToExport = table; } - /// - /// 编辑 - /// - /// - /// - private void winGridViewPager1_OnEditSelected(object sender, EventArgs e) - { - - DataGridView grid = sender as DataGridView; - if (grid != null && grid.SelectedRows.Count>0) - { - DataGridViewRow row = grid.SelectedRows[0]; - try - { - long dbid = long.Parse(row.Cells["编号"].Value.ToString()); - String name = row.Cells["姓名"].Value.ToString(); - String sex = row.Cells["性别"].Value.ToString(); - String age = row.Cells["年龄"].Value.ToString(); - string phone = row.Cells["电话"].Value.ToString(); - age = String.IsNullOrEmpty(age.ToString().Trim()) ? "1" : age.ToString().Trim(); - FrmPatrolerEdit frm = new FrmPatrolerEdit(dbid.ToString(), name, age, sex, phone); - frm.reloadGrid += new ReloadPatrolerGrid(LoadData); - frm.ShowDialog(); - winGridViewPager1.Refresh(); - } - catch (Exception ex) - { - MessageBox.Show("编辑失败:" + ex.ToString(), "错误", MessageBoxButtons.OK, MessageBoxIcon.Error); - } - } - else - { - MessageBox.Show("没有选择记录", "提示"); - } - - } - - /// - /// 删除 - /// - /// - /// - private void winGridViewPager1_OnDeleteSelected(object sender, EventArgs e) - { - DataGridView grid = sender as DataGridView; - if (grid != null && grid.SelectedRows.Count > 0) - { - DataGridViewRow row = grid.SelectedRows[0]; - long dbid = long.Parse(row.Cells["编号"].Value.ToString()); - try - { - string state = row.Cells["状态"].Value.ToString(); - if ("在线".Equals(state)) - { - if (MessageBox.Show("确定注销?", "确认", MessageBoxButtons.YesNo, MessageBoxIcon.Question) == DialogResult.Yes) - { - String sql = "update patroler t set t.accountstate='LEAVER' where t.dbid=" + dbid; - OracleUtils.ExecuteNonQuery(OracleUtils.ConnectionString, CommandType.Text, sql); - } - } - else { - MessageBox.Show("人员不在线,无法注销", "信息"); - } - } - catch (Exception ex) - { - MessageBox.Show("人员注销失败:" + ex.ToString(), "错误", MessageBoxButtons.OK, MessageBoxIcon.Error); - } - } - else - { - MessageBox.Show("没有选择记录", "提示"); - } - } - - + + private void LoadData() { int pageIndex = winGridViewPager1.PagerInfo.CurrenetPageIndex; diff --git a/FrmRoadHDM.cs b/FrmRoadHDM.cs index e765313..e871dd5 100644 --- a/FrmRoadHDM.cs +++ b/FrmRoadHDM.cs @@ -333,31 +333,6 @@ this.Cursor = Cursors.Default; } } - - private void Export(GSOPoint3d _pnt, double r) - { - GSOPoint3ds pnts = new GSOPoint3ds(); - GSOPoint3d pnt = new GSOPoint3d(); - pnt.X = _pnt.X; - pnt.Y = _pnt.Y; - pnt.Z = _pnt.Z; - pnts.Add(pnt); - pnt.X = _pnt.X; - pnt.Y = _pnt.Y - 0.0000000005; - pnt.Z = _pnt.Z; - pnts.Add(pnt); - GSOGeoPolyline3D line = new GSOGeoPolyline3D(); - line.AddPart(pnts); - GSOGeoPolygon3D polygon = line.CreateBuffer(r * 2, true, 5, true, false); - GSOPoint3ds points = polygon[0]; - GSOGeoPolyline3D newLine = new GSOGeoPolyline3D(); - newLine.AddPart(points); - newLine.AltitudeMode = EnumAltitudeMode.RelativeToGround; - GSOFeature newFeature = new GSOFeature(); - newFeature.Geometry = newLine; - globeControl1.Globe.MemoryLayer.AddFeature(newFeature); - } - private void ExportCAD(double a, double b, double r) { GSOPoint3ds pnts = new GSOPoint3ds(); diff --git a/FrmUserAdd.cs b/FrmUserAdd.cs index c612ab4..f826427 100644 --- a/FrmUserAdd.cs +++ b/FrmUserAdd.cs @@ -231,24 +231,6 @@ //cbxRegion.SelectedIndexChanged += new EventHandler(cbxRegion_SelectedIndexChanged); } } - /// - /// 下拉框选中项改变事件处理 - /// - /// - /// - private void cbxRegion_SelectedIndexChanged(object sender, EventArgs e) - { - string sql = ""; - //string sql = "select casic_role.\"name\" from casic_role join casic_regionrole on casic_role.\"id\"=casic_regionrole.\"rid\" where casic_regionrole.\"reid\"=" + region[cbxRegion.SelectedItem.ToString().Trim()]; - DataTable dt = OledbHelper.QueryTable(sql); - if (dt != null && dt.Rows.Count > 0) - { - comboBoxExRegionRole.Items.Clear(); - for (int i = 0; i < dt.Rows.Count; i++) - { - comboBoxExRegionRole.Items.Add(dt.Rows[i][0].ToString().Trim());//部门角色 - } - } - } + } } diff --git a/FrmUserManager.cs b/FrmUserManager.cs index 571f0f0..ae254bc 100644 --- a/FrmUserManager.cs +++ b/FrmUserManager.cs @@ -81,11 +81,6 @@ } } } - //创建新用户 - private void buttonX2_Click(object sender, EventArgs e) - { - FrmUserAdd frm = new FrmUserAdd(-1); - frm.ShowDialog(); - } + } } diff --git a/FrmValveStatistics.cs b/FrmValveStatistics.cs index 545d56c..dd76777 100644 --- a/FrmValveStatistics.cs +++ b/FrmValveStatistics.cs @@ -54,7 +54,7 @@ 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") + if (chaFamenStatis.Series["阀门"].Points[m]!=null&&chaFamenStatis.Series["阀门"].Points[m].YValues[0].ToString() != "0") { chaFamenStatis.Series["阀门"].Points[m].Label = chaFamenStatis.Series[0].Points[m].YValues[0].ToString(); } diff --git a/Frm_password_reset.cs b/Frm_password_reset.cs index 7b51039..b9e5dc3 100644 --- a/Frm_password_reset.cs +++ b/Frm_password_reset.cs @@ -41,6 +41,7 @@ } catch (Exception ex) { + LogHelper.WriteLog(typeof(Frm_password_reset), ex.Message); } } private void initCombox() diff --git a/FrmpipeDeepstatis.cs b/FrmpipeDeepstatis.cs index e156db4..1a84d6c 100644 --- a/FrmpipeDeepstatis.cs +++ b/FrmpipeDeepstatis.cs @@ -307,7 +307,7 @@ chart1.Series[j].Points.DataBindXY(dic1.Keys, dic1.Values); for (int m = 0; m < dic1.Values.Count; m++) { - if (chart1.Series[j].Points[m].YValues[0].ToString() != "0") + if (chart1.Series[j].Points[m]!=null&&chart1.Series[j].Points[m].YValues[0].ToString() != "0") { chart1.Series[j].Points[m].Label = chart1.Series[j].Points[m].YValues[0].ToString(); diff --git a/FrmpipeDiametergather.cs b/FrmpipeDiametergather.cs index 30674de..057b09d 100644 --- a/FrmpipeDiametergather.cs +++ b/FrmpipeDiametergather.cs @@ -263,6 +263,7 @@ if (layer != null && layer is GSOFeatureLayer) { GSOFeatureLayer flayer = layer as GSOFeatureLayer; + if (layer == null) return; GSOFeatures features = flayer.GetAllFeatures(); if (features.Length > 0) { diff --git a/FrmpipeMaterialGather.cs b/FrmpipeMaterialGather.cs index c133ec3..398b884 100644 --- a/FrmpipeMaterialGather.cs +++ b/FrmpipeMaterialGather.cs @@ -280,6 +280,7 @@ if (layer != null && layer is GSOFeatureLayer) { GSOFeatureLayer flayer = layer as GSOFeatureLayer; + if (flayer == null) return; GSOFeatures features = flayer.GetAllFeatures(); if (features.Length > 0) { @@ -332,7 +333,7 @@ chart1.Series[j].Points.DataBindXY(dic1.Keys, dic1.Values); for (int m = 0; m < dic1.Values.Count; m++) { - if (chart1.Series[j].Points[m].YValues[0].ToString() != "0") + if (chart1.Series[j].Points[m]!=null&&chart1.Series[j].Points[m].YValues[0].ToString() != "0") { chart1.Series[j].Points[m].Label = chart1.Series[j].Points[m].YValues[0].ToString(); } diff --git a/Frmpipediameterstatis.cs b/Frmpipediameterstatis.cs index c0ed80a..50f8170 100644 --- a/Frmpipediameterstatis.cs +++ b/Frmpipediameterstatis.cs @@ -286,6 +286,7 @@ chart1.Series.Add(layerCaption); GSOFeatureLayer flayer = layer as GSOFeatureLayer; + if (layer == null) return; GSOFeatures features = flayer.GetAllFeatures(); if (features.Length > 0) { diff --git "a/GKT_Forms/F_GKT\346\225\260\346\215\256\350\276\223\345\205\245\350\276\223\345\207\272.cs" "b/GKT_Forms/F_GKT\346\225\260\346\215\256\350\276\223\345\205\245\350\276\223\345\207\272.cs" index c7bffd5..4db7d5d 100644 --- "a/GKT_Forms/F_GKT\346\225\260\346\215\256\350\276\223\345\205\245\350\276\223\345\207\272.cs" +++ "b/GKT_Forms/F_GKT\346\225\260\346\215\256\350\276\223\345\205\245\350\276\223\345\207\272.cs" @@ -198,12 +198,7 @@ } DialogResult = DialogResult.OK;//将当前窗体的对话框返回值设为OK } - private void treeView1_NodeMouseClick(object sender, TreeNodeMouseClickEventArgs e) - { - dir_Ok = comboBox_Disk.Text + e.Node.FullPath; - //dir = comboBox_Disk.Text + e.Node.FullPath; - e.Node.SelectedImageIndex = e.Node.ImageIndex; - } + string tempstr = ""; private void button1_Click(object sender, EventArgs e) { diff --git a/HFS_Forms/Frm_HFSprojedits.cs b/HFS_Forms/Frm_HFSprojedits.cs index 96dd76f..3c232a1 100644 --- a/HFS_Forms/Frm_HFSprojedits.cs +++ b/HFS_Forms/Frm_HFSprojedits.cs @@ -126,16 +126,6 @@ Close(); } - - - private void TB_ProjName_KeyPress(object sender, KeyPressEventArgs e) - { - if (HFSAClass.Files_NameChar(e) == 0) - e.Handled = true; - if (e.KeyChar == '\r') - OK_Click(sender, e); - } - private void Frm_HFSProjedit_Load(object sender, EventArgs e) { @@ -175,10 +165,6 @@ } } - private void Cancel_Click(object sender, EventArgs e) - { - this.Close(); - } private void Cancel_Click_1(object sender, EventArgs e) { diff --git a/MainFrm.cs b/MainFrm.cs index 2c305a0..ed2685b 100644 --- a/MainFrm.cs +++ b/MainFrm.cs @@ -617,7 +617,7 @@ } catch (Exception ex) { - + LogHelper.WriteLog(typeof(MainFrm), ex.Message); } } @@ -1768,7 +1768,7 @@ } catch (Exception ex) { - //LogError.PublishError(ex); + LogHelper.WriteLog(typeof(MainFrm), ex.Message); } } @@ -2026,6 +2026,7 @@ } catch (Exception ex) { + LogHelper.WriteLog(typeof(MainFrm), ex.Message); result = false; } finally @@ -2316,220 +2317,6 @@ string filename = Utility.filename; List g1layername = new List(); /// - /// 构建图层列表目录树 - /// - /// - private void loadTreeView(TreeView tv) - { - try - { - XmlDocument doc = new XmlDocument(); - doc.Load(filename); - XmlNodeList Params1 = doc.SelectNodes("/Params/layers"); - tv.ShowLines = false; - tv.CheckBoxes = true; - - foreach (XmlNode paramsNode in Params1) //layers - { - foreach (XmlNode layerNode in paramsNode) //layer - { - TreeNode nodelayer = new TreeNode(); - string layerName = layerNode.Attributes["label"].Value; - nodelayer.Text = layerName; - - if (layerNode.HasChildNodes != false) - { - tv.Nodes.Add(nodelayer); - foreach (XmlNode layerchildNode in layerNode) //layerchild - { - if (layerchildNode.Name == "layerchild") - { - TreeNode nodelayerchild = new TreeNode(); - string layerType = layerchildNode.Attributes["type"].Value; - string layerName1 = layerchildNode.Attributes["layer"].Value; - string layerchildName = layerchildNode.Attributes["label"].Value; - if (layerType == "locaserver") - { - if (layerchildNode.Attributes["isRoad"] != null) - { - roadLayerName = layerchildName; - } - dictionaryNetLayerNameAndCaption.Add(layerName1, layerchildName); - - nodelayerchild.Text = layerchildName; - nodelayerchild.Tag = layerType + "|" + layerchildName; - nodelayerchild.Checked = true; - nodelayer.Nodes.Add(nodelayerchild); - } - else - { - if (layerchildNode.Attributes["isPipeLine"] != null) - { - m_PipelineLayerNames.Add(layerchildName); - } - if (layerchildNode.Attributes["isWorkWell"] != null) - { - workwellLayerNames.Add(layerchildName); - } - if (layerchildNode.Attributes["isValve"] != null) - { - valueLayerNames.Add(layerchildName); - } - //if (layerchildNode.Attributes["isInstrument"] != null) - if (layerchildNode.Attributes["isAccess"] != null) - { - instrumenLayerNames.Add(layerchildName); - } - //if (layerchildNode.Attributes["isPipeFitting"] != null) - if (layerchildNode.Attributes["isCharacter"] != null) - { - pipefittingLayerNames.Add(layerchildName); - } - bool boollayer = AddLayers(layerName1, layerchildName); - nodelayerchild.Text = layerchildName; - nodelayerchild.Tag = layerType + "|" + layerchildName; - nodelayerchild.Checked = boollayer; - if (layerchildName.Contains("特征管点")) - { - nodelayerchild.Checked = false; - setLayerVisible(layerName1); - } - - nodelayer.Nodes.Add(nodelayerchild); - g1layername.Add(layerName1); - } - } - else if (layerchildNode.Name == "layertype") - { - TreeNode nodelayerchild = new TreeNode(); - string layerType = layerchildNode.Attributes["label"].Value; - nodelayerchild.Text = layerType; - nodelayerchild.Tag = layerType; - nodelayerchild.Checked = true; - nodelayer.Nodes.Add(nodelayerchild); - if (layerchildNode.HasChildNodes == true) - { - foreach (XmlNode childNodeLayer in layerchildNode) - { - if (childNodeLayer.HasChildNodes == true) - { - TreeNode nodelayerchild2 = new TreeNode(); - string layer = childNodeLayer.Attributes["label"].Value; - nodelayerchild2.Text = layer; - nodelayerchild2.Tag = layer; - nodelayerchild2.Checked = true; - nodelayerchild.Nodes.Add(nodelayerchild2); - foreach (XmlNode n in childNodeLayer) - { - TreeNode nodelayerchild1 = new TreeNode(); - string layerName1 = n.Attributes["layer"].Value; - string layerchildName = n.Attributes["label"].Value; - string layerType1 = n.Attributes["type"].Value; - if (n.Attributes["isPipeLine"] != null) - { - m_PipelineLayerNames.Add(layerchildName); - } - if (n.Attributes["isWorkWell"] != null) - { - workwellLayerNames.Add(layerchildName); - } - if (n.Attributes["isValve"] != null) - { - valueLayerNames.Add(layerchildName); - } - if (n.Attributes["isAccess"] != null) - //if (n.Attributes["isInstrument"] != null) - { - instrumenLayerNames.Add(layerchildName); - } - if (n.Attributes["isPipeFitting"] != null) - { - pipefittingLayerNames.Add(layerchildName); - } - bool boollayer = AddLayers(layerName1, layerchildName); - nodelayerchild1.Text = layerchildName; - nodelayerchild1.Tag = layerType1 + "|" + layerchildName; - nodelayerchild1.Checked = boollayer; - if (layerchildName.Contains("特征管点")) - { - nodelayerchild1.Checked = false; - setLayerVisible(layerName1); - } - - nodelayerchild2.Nodes.Add(nodelayerchild1); - - g1layername.Add(layerName1); - } - } - else - { - TreeNode nodelayerchild1 = new TreeNode(); - string layerName1 = childNodeLayer.Attributes["layer"].Value; - string layerchildName = childNodeLayer.Attributes["label"].Value; - string layerType1 = childNodeLayer.Attributes["type"].Value; - if (childNodeLayer.Attributes["isPipeLine"] != null) - { - m_PipelineLayerNames.Add(layerchildName); - } - if (childNodeLayer.Attributes["isWorkWell"] != null) - { - workwellLayerNames.Add(layerchildName); - } - if (childNodeLayer.Attributes["isValve"] != null) - { - valueLayerNames.Add(layerchildName); - } - if (childNodeLayer.Attributes["isAccess"] != null) - //if (childNodeLayer.Attributes["isInstrument"] != null) - { - instrumenLayerNames.Add(layerchildName); - } - if (childNodeLayer.Attributes["isPipeFitting"] != null) - { - pipefittingLayerNames.Add(layerchildName); - } - bool boollayer = AddLayers(layerName1, layerchildName); - nodelayerchild1.Text = layerchildName; - nodelayerchild1.Tag = layerType1 + "|" + layerchildName; - nodelayerchild1.Checked = boollayer; - if (layerchildName.Contains("特征管点")) - { - nodelayerchild1.Checked = false; - setLayerVisible(layerName1); - } - nodelayerchild.Nodes.Add(nodelayerchild1); - g1layername.Add(layerName1); - } - } - } - } - } - } - else - { - tv.Nodes.Add(nodelayer); - } - } - } - - foreach (TreeNode tn in tv.Nodes) - { - if (tn.Nodes.Count > 0) - { - foreach (TreeNode tnChild in tn.Nodes) - { - if (tnChild.Checked) - tn.Checked = true; - } - } - } - } - catch (Exception ex) - { - //LogError.PublishError(ex); - } - } - /// /// 获取目标图层 /// /// @@ -2629,21 +2416,11 @@ } catch (Exception ex) { - //LogError.PublishError(ex); + LogHelper.WriteLog(typeof(MainFrm), ex.Message); return false; } } /// - /// 菜单上的 三维导航 工具按钮 - /// - /// - /// - private void buttonItem86_Click(object sender, EventArgs e) - { - globeControl1.Globe.Action = EnumAction3D.ActionNull; - } - - /// /// 地上模式 菜单按钮 /// /// @@ -3026,67 +2803,11 @@ } Image printImage; - /// - /// 打印 菜单 - /// - /// - /// - private void buttonItem13_Click(object sender, EventArgs e) - { - Point pt1 = new Point(Convert.ToInt32(0), Convert.ToInt32(0)); - Point pt2 = new Point(Convert.ToInt32(panelEx5.Width), Convert.ToInt32(panelEx5.Height)); - int mapWidth = 0; - int mapHeight = 0; - Point pt = getUpperLeftPoint(pt1, pt2, out mapWidth, out mapHeight); - printImage = new Bitmap(Convert.ToInt32(panelEx5.Width), Convert.ToInt32(panelEx5.Height)); - Graphics g = Graphics.FromImage(printImage); - g.CopyFromScreen(pt, new Point(0, 0), new Size(Convert.ToInt32(panelEx5.Width), Convert.ToInt32(panelEx5.Height))); - - PrintDialog pd = new PrintDialog(); - try - { - if (pd.ShowDialog() == DialogResult.OK) //如果确认,将会覆盖所有的打印参数设置 - { - //打印预览 - PrintPreviewDialog ppd = new PrintPreviewDialog(); - ppd.Document = printDocument1; - if (DialogResult.OK == ppd.ShowDialog()) - { - printDocument1.Print(); //打印 - } - } - } - catch - { - printDocument1.PrintController.OnEndPrint(printDocument1, new System.Drawing.Printing.PrintEventArgs()); - } - } - + private void printDocument1_PrintPage(object sender, System.Drawing.Printing.PrintPageEventArgs e) { e.Graphics.DrawImage(printImage, 10, 10); } - - /// - /// 在窗体的底部状态栏上显示 综合管线条件查询结果 - /// - /// - /// - private void ToolStripText(string currentLayer, int dataCount) - { - if (dataCount != 0) - { - double featurelength = PipeLength(currentLayer, 0);// 统计管线的里程数 - - toolStripNumbers.Text = " 管线类型:" + currentLayer + " | 共有:" + Convert.ToString(dataCount - 1) + "条记录"; - toolStripFeatureLength.Text = " 管线里程:" + featurelength.ToString("0.00") + " 米"; - } - else - { - toolStripNumbers.Text = "管线类型: " + currentLayer + "| 共有:" + 0 + " 条记录 | "; - } - } - /// /// 统计管线的里程数 /// @@ -3402,26 +3123,6 @@ } /// - /// 绘制线 菜单 - /// - /// - /// - private void btnAddLine_Click(object sender, EventArgs e) - { - globeControl1.Globe.DestLayerFeatureAdd = globeControl1.Globe.MemoryLayer; - globeControl1.Globe.Action = EnumAction3D.DrawPolyline; - } - /// - /// 绘制面 菜单 - /// - /// - /// - private void btnAddPolygon_Click(object sender, EventArgs e) - { - globeControl1.Globe.DestLayerFeatureAdd = globeControl1.Globe.MemoryLayer; - globeControl1.Globe.Action = EnumAction3D.DrawPolygon; - } - /// /// 图层目录树 右键菜单中的 目标图层 菜单 /// /// @@ -3956,42 +3657,7 @@ // ClearUpDownTraceAnalysis(); //} - /// - /// 显示流向 功能 - /// - /// - /// - /// - private void Flow(object sender, string pipelineNameCN, bool bShow) - { - GSOFeatureLayer layer = globeControl1.Globe.Layers.GetLayerByCaption(pipelineNameCN) as GSOFeatureLayer; - GSOFeatures feats = layer.GetAllFeatures(); - for (int i = 0; i < feats.Length; i++) - { - GSOFeature feat = feats[i]; - GSOLineStyle3D lineStyle = feat.Geometry.Style as GSOLineStyle3D; - if (lineStyle != null) - { - if (lineStyle.ArrowStyle == null) - { - lineStyle.ArrowStyle = new GSOArrowStyle(); - lineStyle.ArrowStyle.BodyWidth = 2; - lineStyle.ArrowStyle.BodyLen = 6; - lineStyle.ArrowStyle.HeadWidth = 8; - lineStyle.ArrowStyle.HeadLen = 10; - lineStyle.ArrowStyle.OutlineVisible = true; - lineStyle.ArrowStyle.OutlineColor = Color.Red; - lineStyle.ArrowStyle.Speed = lineStyle.ArrowStyle.Speed / 2; - lineStyle.ArrowStyle.Play(); - } - lineStyle.ArrowVisible = bShow; - layerTree.SelectedNode = null; - } - } - globeControl1.Globe.Refresh(); - } - - + FrmCloseValves frm; /// /// 关阀分析 功能 @@ -4030,7 +3696,9 @@ curCAYNDataset.CloseValveAnalysis(lineFeature.ID, out arryResNodeID, out arryResValveID, false, true); } catch (Exception e) - { } + { + LogHelper.WriteLog(typeof(MainFrm), e.Message); + } string valveName = lineLayer.Caption; valveName = valveName.Substring(0, valveName.IndexOf("管线")); @@ -4106,7 +3774,7 @@ } catch (Exception e) { - + LogHelper.WriteLog(typeof(MainFrm), e.Message); } //目前只有燃气管线 有阀门 string valveName = lineLayer.Name; @@ -5457,7 +5125,7 @@ } catch (Exception ex) { - //MessageBox.Show(ex.ToString()); + LogHelper.WriteLog(typeof(MainFrm), ex.Message); } finally { @@ -5501,22 +5169,6 @@ } } - - /// - /// 清除所有坑 菜单 - /// - /// - /// - private void buttonItem3_Click(object sender, EventArgs e) - { - //日志记录 - LogManager.saveLog(Utility.userName, this.buttonItem3.Text); - - globeControl1.Globe.RemoveAllPits(); - } - - - ///// ///// 净距分析 菜单 ///// @@ -5554,42 +5206,8 @@ // ribbonBarTP.Visible = buttonItem34.Checked; // ribbonBarTP.Location = new Point(0, 0); //} - /// - /// 大气层 菜单 - /// - /// - /// - private void buttonItem17_Click_1(object sender, EventArgs e) - { - globeControl1.Globe.Atmosphere.Visible = !globeControl1.Globe.Atmosphere.Visible; - buttonItemSH1.Checked = globeControl1.Globe.Atmosphere.Visible; - globeControl1.Refresh(); - } - /// - /// 经纬网 菜单 - /// - /// - /// - private void buttonItem20_Click(object sender, EventArgs e) - { - globeControl1.Globe.LatLonGrid.Visible = !globeControl1.Globe.LatLonGrid.Visible; - buttonItemSH3.Checked = globeControl1.Globe.LatLonGrid.Visible; - globeControl1.Globe.Refresh(); - } - /// - /// 状态条 菜单 - /// - /// - /// - private void buttonItem21_Click_1(object sender, EventArgs e) - { - globeControl1.Globe.StatusBar.Visible = !globeControl1.Globe.StatusBar.Visible; - buttonItemSH4.Checked = globeControl1.Globe.StatusBar.Visible; - globeControl1.Globe.Refresh(); - } - - + /// /// 添加指定路径下的数据 功能 /// @@ -5680,43 +5298,7 @@ // } // return objRes; //} - /// - /// 刷新目录树 功能 - /// - private void RefreshDataTree() - { - layerTree.Nodes[0].Nodes.Clear(); - Int32 nCount = globeControl1.Globe.DataManager.DataSourceCount; - Int32 i = 0; - for (i = 0; i < nCount; i++) - { - GSODataSource dataSpace = globeControl1.Globe.DataManager[i]; - TreeNode node = new TreeNode(); - node.Text = dataSpace.Name; - node.ImageIndex = 0; - node.SelectedImageIndex = 0; - node.Checked = true; - node.Tag = dataSpace; - Int32 nDatasetCount = dataSpace.DatasetCount; - for (Int32 j = 0; j < nDatasetCount; j++) - { - GSODataset dataset = dataSpace[j]; - TreeNode subNode = new TreeNode(); - subNode.Text = dataset.Name; - subNode.ImageIndex = 0; - subNode.SelectedImageIndex = 0; - subNode.Checked = true; - subNode.Tag = dataset; - node.Nodes.Add(subNode); - } - layerTree.Nodes[0].Nodes.Add(node); - } - } - - - - - + /// /// 复合查询 菜单 @@ -5777,34 +5359,7 @@ return false; } - /// - /// 统计指定图层在指定范围内的所有feature对象 - /// - /// - /// - /// - private GSOFeatures Intersect_PointLayer(GSOGeoPolygon3D polygon, string pointLayerName) - { - GSOLayer layer = globeControl1.Globe.Layers.GetLayerByCaption(pointLayerName); - if (layer == null) - return null; - - GSOFeatureLayer flayer = layer as GSOFeatureLayer; - GSOFeatureDataset fdataset = flayer.Dataset as GSOFeatureDataset; - GSOFeatures feats; - if (polygon == null) - { - feats = flayer.GetAllFeatures(); - } - else - { - feats = flayer.FindFeaturesInPolygon(polygon, false); - } - - workWellLen.Add(pointLayerName, feats.Length); - return feats; - } - /// + /// /// 碰撞分析功能界面中 选择管线复选框 选中状态改变事件处理 /// /// @@ -5946,16 +5501,6 @@ MessageBox.Show("表格内容为空!", "提示"); } } - /// - /// 导出CAD 菜单 - /// - /// - /// - private void btnExportCAD_Click(object sender, EventArgs e) - { - FrmExportCADS frm = new FrmExportCADS(globeControl1, m_PipelineLayerNames); - frm.ShowDialog(); - } ///// ///// 区域分析 菜单 @@ -5987,16 +5532,6 @@ } } } - /// - /// 数据验证 菜单 - /// - /// - /// - private void buttonItem80_Click(object sender, EventArgs e) - { - FrmValiData frm = new FrmValiData(globeControl1); - frm.ShowDialog(); - } /// /// 根据指定图层创建图层节点并将节点添加到图层管理节点的子节点集合中 @@ -6018,56 +5553,7 @@ layerManagerNode.Expand(); } } - /// - /// 数据库备份 菜单 - /// - /// - /// - private void btnBackDatabase_Click(object sender, EventArgs e) - { - if (MessageBox.Show("是否确定要备份数据库文件", "信息", MessageBoxButtons.YesNo, MessageBoxIcon.Question) == DialogResult.Yes) - { - try - { - DateTime currentTime = DateTime.Now; - //string Dtime = currentTime.ToShortDateString().ToString("yyyy-MM-dd"); - string Dtime = currentTime.GetDateTimeFormats('D')[0].ToString(); - string Htime = DateTime.Now.ToString("HH时mm分ss秒").Trim(); - string fileName = Dtime + "(" + Htime + ")"; - string pathName = ""; - string sql = "select filename from master..sysdatabases where name='" + Utility.dbdatabase + "'"; - DataTable dt = OledbHelper.ExecuteDataTable(sql); - if (dt != null && dt.Rows.Count > 0) - { - pathName = dt.Rows[0][0].ToString().Trim(); - int count = pathName.LastIndexOf("\\") == -1 ? pathName.LastIndexOf("/") : pathName.LastIndexOf("\\"); - pathName = pathName.Substring(0, count); - } - pathName += "\\管网数据库" + fileName + ".bak"; - - OracleCommand cmdBK = new OracleCommand(); - cmdBK.CommandType = CommandType.Text; - cmdBK.Connection = connBackup; - cmdBK.CommandText = @"backup database " + Utility.dbdatabase + " to disk='" + pathName + "' with init"; - - connBackup.Open(); - cmdBK.ExecuteNonQuery(); - MessageBox.Show("数据库文件备份成功", "提示"); - } - catch (Exception ex) - { - MessageBox.Show(ex.ToString()); - } - finally - { - connBackup.Close(); - } - } - } - - - - + //GSOFeature emitterFeature; // 粒子要素 /// /// 添加火苗 功能 @@ -6598,361 +6084,15 @@ } } - - ///// - /// 添加用户仓库 菜单 - /// - /// - /// - private void buttonItem108_Click(object sender, EventArgs e) - { - FrmUserRepo frm = new FrmUserRepo(-1); - frm.ShowDialog(); - } - /// - /// 用户仓库管理 菜单 - /// - /// - /// - private void buttonItem111_Click(object sender, EventArgs e) - { - FrmUserRepoMgr frm = new FrmUserRepoMgr(); - frm.ShowDialog(); - } - /// - /// 添加分系统 菜单 - /// - /// - /// - private void buttonItem112_Click(object sender, EventArgs e) - { - //FrmAPP frm = new FrmAPP(-1); - //frm.ShowDialog(); - } - /// - /// 分系统管理 菜单 - /// - /// - /// - private void buttonItem113_Click(object sender, EventArgs e) - { - //FrmAPPMgr frm = new FrmAPPMgr(); - //frm.ShowDialog(); - } - /// - /// 添加操作 菜单 - /// - /// - /// - private void buttonItem114_Click(object sender, EventArgs e) - { - FrmOper frm = new FrmOper(-1); - frm.ShowDialog(); - } - /// - /// 操作管理 菜单 - /// - /// - /// - private void buttonItem115_Click(object sender, EventArgs e) - { - FrmOperMgr frm = new FrmOperMgr(); - frm.ShowDialog(); - } - /// - /// 添加资源 菜单 - /// - /// - /// - private void buttonItem116_Click(object sender, EventArgs e) - { - FrmRESC frm = new FrmRESC(-1); - frm.ShowDialog(); - } - /// - /// 资源管理 菜单 - /// - /// - /// - private void buttonItem117_Click(object sender, EventArgs e) - { - FrmRESCMgr frm = new FrmRESCMgr(); - frm.ShowDialog(); - } - /// - /// 添加权限 菜单 - /// - /// - /// - private void buttonItem118_Click(object sender, EventArgs e) - { - FrmPerm frm = new FrmPerm(-1); - frm.ShowDialog(); - } - /// - /// 权限管理 菜单 - /// - /// - /// - private void buttonItem119_Click(object sender, EventArgs e) - { - FrmPermMgr frm = new FrmPermMgr(); - frm.ShowDialog(); - } - /// - /// 添加访问控制 菜单 - /// - /// - /// - private void buttonItem120_Click(object sender, EventArgs e) - { - FrmAccess frm = new FrmAccess(-1); - frm.ShowDialog(); - } - /// - /// 访问控制管理 菜单 - /// - /// - /// - private void buttonItem121_Click(object sender, EventArgs e) - { - FrmAccessMgr frm = new FrmAccessMgr(); - frm.ShowDialog(); - } - /// - /// 部门类型管理 菜单 - /// - /// - /// - private void buttonItem122_Click(object sender, EventArgs e) - { - FrmRegionTypeMgr frm = new FrmRegionTypeMgr(); - frm.ShowDialog(); - } - /// - /// 用户信息管理 菜单 - /// - /// - /// - private void buttonItem128_Click_1(object sender, EventArgs e) - { - FrmUserManager frm = new FrmUserManager(); - frm.ShowDialog(); - } - /// - /// 添加角色 菜单 - /// - /// - /// - private void 添加角色_Click(object sender, EventArgs e) - { - FrmRole frm = new FrmRole(-1); - frm.ShowDialog(); - } - /// - /// 所有角色管理 菜单 - /// - /// - /// - private void 角色管理_Click(object sender, EventArgs e) - { - FrmRoleMgr frm = new FrmRoleMgr(); - frm.ShowDialog(); - } - - /// - /// 部门角色管理 菜单 - /// - /// - /// - private void buttonItem133_Click(object sender, EventArgs e) - { - FrmRegionRoleMgr frm = new FrmRegionRoleMgr(); - frm.ShowDialog(); - } - /// - /// 部门管理 菜单 - /// - /// - /// - private void buttonItem130_Click(object sender, EventArgs e) - { - FrmRegionMgr frm = new FrmRegionMgr(); - frm.ShowDialog(); - } - - /// - /// 日志管理 菜单 - /// - /// - /// - private void buttonItem135_Click(object sender, EventArgs e) - { - FrmLogManager frm = new FrmLogManager(); - frm.ShowDialog(); - } - /// - /// 传感器信息查询 菜单 - /// - /// - /// - private void buttonItem131_Click_1(object sender, EventArgs e) - { - GSOFeature selectedFeature = globeControl1.Globe.SelectedObject; - if (selectedFeature == null) - { - MessageBox.Show("请选择一个传感器对象!", "提示", MessageBoxButtons.OK, MessageBoxIcon.Information); - } - else - { - if (selectedFeature.Geometry != null && selectedFeature.Geometry.Type == EnumGeometryType.GeoModel) - { - GSOLayer layer = globeControl1.Globe.SelectedObjectLayer; - string tabelName = getTableName(layer.Caption); - string eqtID = selectedFeature.Description.Trim(); - if (tabelName != "" && eqtID != "") - { - string fields = getFields(tabelName); - if (fields != "") - { - string sql = "select " + fields + " from " + Utility.sensorDatabase + "." + tabelName + " where EqtID=" + eqtID + " order by RecordDate desc limit 1;"; - DataTable dt = MySqlHelper.queryDataTable(sql); - if (dt != null && dt.Rows.Count > 0) - { - FrmQueryMessage.ShowForm(this, dt, layer.Caption); - //queryMessage.Show(this); - } - else - { - MessageBox.Show("没有查询到相关信息!", "提示"); - } - } - else - { - MessageBox.Show("配置文件 \"sensorConfig.xml\" 有误!", "提示"); - } - } - else - { - MessageBox.Show("请选择一个传感器对象!", "提示"); - } - } - else - { - MessageBox.Show("请选择一个传感器对象!", "提示", MessageBoxButtons.OK, MessageBoxIcon.Information); - } - } - } - /// - /// 根据指定的图层的caption属性的值在配置文件中查找对应的数据库中的表的名称 - /// - /// 图层的caption属性的值 - /// 对应的数据库中的表的名称 - private string getTableName(string name) - { - string tabelName = ""; - if (Utility.sensorMarkerLayers != null) - { - for (int i = 0; i < Utility.sensorMarkerLayers.Count; i++) - { - MarkerLayer mLayer = Utility.sensorMarkerLayers[i]; - if (mLayer.layerName == name) - { - tabelName = mLayer.tableName; - break; - } - } - } - return tabelName; - } - /// - /// 根据数据库中的表的名称 查找对应的表中的字段名称的集合 - /// - /// 数据库中的表的名称 - /// 对应的表中的字段名称的集合 - private string getFields(string tabelName) - { - string fields = ""; - if (Utility.sensorMarkerLayers != null) - { - for (int i = 0; i < Utility.sensorMarkerLayers.Count; i++) - { - MarkerLayer mLayer = Utility.sensorMarkerLayers[i]; - if (mLayer.tableName.Trim() == tabelName.Trim()) - { - if (mLayer.fields != null) - { - foreach (string key in mLayer.fields.Keys) - { - string value = mLayer.fields[key]; - fields += tabelName.Trim() + "." + key + " as " + value + ","; - } - fields = fields.Remove(fields.Length - 1); - } - break; - } - } - } - return fields; - } - - /// - /// 历史曲线查询 菜单 - /// - /// - /// - private void buttonItem132_Click(object sender, EventArgs e) - { - GSOFeature selectedFeature = globeControl1.Globe.SelectedObject; - if (selectedFeature == null) - { - MessageBox.Show("请选择一个对象!", "提示", MessageBoxButtons.OK, MessageBoxIcon.Information); - } - else - { - if (selectedFeature.Geometry != null && selectedFeature.Geometry.Type == EnumGeometryType.GeoModel) - { - GSOLayer layer = globeControl1.Globe.SelectedObjectLayer; - string tabelName = getTableName(layer.Caption); - string eqtID = selectedFeature.Description; - if (tabelName != "" && eqtID != "") - { - FrmQueryHistory.ShowForm(this, tabelName, eqtID); - } - else - { - MessageBox.Show("请选择一个传感器对象!", "提示"); - } - } - else - { - MessageBox.Show("请选择一个传感器对象!", "提示", MessageBoxButtons.OK, MessageBoxIcon.Information); - } - } - } - + //定时检查传感器的状态 public System.Windows.Forms.Timer timerOfSensor = null; public int alarmValueLiuLiang = 0; public int alarmValueYaLi = 0; public int alarmValueYeTi = 0; public int alarmValueZaoSheng = 0; - /// - /// 传感器在线报警 菜单 - /// - /// - /// - private void buttonItem134_Click(object sender, EventArgs e) - { - if (timerOfSensor == null) - { - timerOfSensor = new System.Windows.Forms.Timer(); - timerOfSensor.Interval = 30000; - timerOfSensor.Tick += new EventHandler(timerOfSensor_Tick); - } - FrmQuerySensorAlarm.ShowForm(this); - } + /// /// 传感器报警 功能中的 定时器 的触发事件处理 /// @@ -7016,6 +6156,7 @@ } catch (Exception ex) { + LogHelper.WriteLog(typeof(MainFrm), ex.Message); continue; } } @@ -7025,145 +6166,7 @@ } } - - /// - /// 沿线运动 菜单 - /// - /// - /// - private void buttonItem138_Click(object sender, EventArgs e) - { - if (globeControl1.Globe.SelectedObject == null) - { - MessageBox.Show("请先选择一条线!", "提示", MessageBoxButtons.OK, MessageBoxIcon.Exclamation); - return; - } - - GSOFeature lineFeature = globeControl1.Globe.SelectedObject; - if (lineFeature.Geometry == null || lineFeature.Geometry.Type != EnumGeometryType.GeoPolyline3D) - { - MessageBox.Show("请先选择一条线!", "提示", MessageBoxButtons.OK, MessageBoxIcon.Exclamation); - return; - } - - OpenFileDialog dlg = new OpenFileDialog(); - dlg.Filter = "*.gcm;*.3ds|*.gcm;*.3ds|*.3ds|*.3ds|*.gcm|*.gcm"; - if (dlg.ShowDialog() == DialogResult.OK) - { - GSOGeoModel model = new GSOGeoModel(); - model.FilePath = dlg.FileName; - - GSOGeoDynamicRoute dynamicRoute = new GSOGeoDynamicRoute(); - dynamicRoute.ActorGeometry = model; - - GSORoute route = new GSORoute(); - GSOGeoPolyline3D geoline = (GSOGeoPolyline3D)lineFeature.Geometry; - for (int i = 0; i < geoline[0].Count; i++) - { - route.Add(geoline[0][i]); - } - route.CircleRoute = false; - route.Speed = 30; - route.RotateSpeed = 50; - route.AltitudeMode = geoline.AltitudeMode; - dynamicRoute.Route = route; - - GSOFeature feature = new GSOFeature(); - - dynamicRoute.Play(); - feature.Geometry = dynamicRoute; - - //GSOLabel gsoLabel = new GSOLabel(); - //gsoLabel.Text = "模型测试"; - //feature.Label = gsoLabel; - globeControl1.Globe.MinModelVisibleSize = 0; - - globeControl1.Globe.MemoryLayer.AddFeature(feature); - globeControl1.Globe.Refresh(); - } - } - /// - /// 回退 菜单 - /// - /// - /// - private void buttonItem99_Click(object sender, EventArgs e) - { - globeControl1.Globe.UnDoEdit(); - } - /// - /// 前进 菜单 - /// - /// - /// - private void buttonItem100_Click(object sender, EventArgs e) - { - globeControl1.Globe.ReDoEdit(); - } - /// - /// 水平净距 功能界面中的 标签内容改变事件处理 - /// - /// - /// - private void textBoxX4_TextChanged(object sender, EventArgs e) - { - string valueJingJu = textBoxX4.Text.Trim(); - if (valueJingJu != "") - { - double value = 0; - bool bl = double.TryParse(valueJingJu, out value); - if (bl) - { - labelX24.Text = "水平净距小于" + value.ToString() + "米的管线有:"; - } - } - } - /// - /// 垂直净距 功能界面中的 标签内容改变事件处理 - /// - /// - /// - private void textBoxX2_TextChanged(object sender, EventArgs e) - { - string valueJingJu = textBoxX2.Text.Trim(); - if (valueJingJu != "") - { - double value = 0; - bool bl = double.TryParse(valueJingJu, out value); - if (bl) - { - labelX23.Text = "垂直净距小于" + value.ToString() + "米的管线有:"; - } - } - } - /// - /// 覆土分析 功能界面中的 标签内容改变事件处理 - /// - /// - /// - private void textBoxX3_TextChanged(object sender, EventArgs e) - { - string valueJingJu = textBoxX3.Text.Trim(); - if (valueJingJu != "") - { - double value = 0; - bool bl = double.TryParse(valueJingJu, out value); - if (bl) - { - labelX17.Text = "覆土深度小于" + value.ToString() + "米的管线有:"; - } - } - } - - /// - /// 传感器分类查询 全区域 菜单 - /// - /// - /// - private void buttonItemSensor全区域查询_Click(object sender, EventArgs e) - { - FrmAccessoriesSensor.ShowForm(globeControl1, instrumenLayerNames, 0); - } + /// /// 传感器分类查询 绘制区域 菜单 /// @@ -7224,170 +6227,10 @@ layerTemp.RemoveAllFeature(); globeControl1.Refresh(); } - /// - /// 数字预处理 功能 - /// - /// - /// - private void 数字预处理buttonItem140_Click(object sender, EventArgs e) - { - FrmEditShapeFile frm = new FrmEditShapeFile(globeControl1); - frm.ShowDialog(this); - } - - - /// - /// 导出矢量 功能 将图层导出为kml和shp格式数据 - /// - /// - /// - private void 导出矢量buttonItem140_Click(object sender, EventArgs e) - { - /* - List m_PipelineLayerNames = new List();//线图层名称 - List workwellLayerNames = new List();//工井图层名称 - List valueLayerNames = new List();//阀门图层名称 - List instrumenLayerNames = new List();//附属物图层名称 - List pipefittingLayerNames = new List();//管件图层名称 - */ - List listVectorNames = new List(); - for (int i = 0; i < m_PipelineLayerNames.Count; i++) - { - if (m_PipelineLayerNames[i] == "移动" || m_PipelineLayerNames[i] == "联通" - || m_PipelineLayerNames[i] == "电信" || m_PipelineLayerNames[i] == "共通" - || m_PipelineLayerNames[i] == "有限电视" || m_PipelineLayerNames[i] == "交通信号" - || m_PipelineLayerNames[i] == "供电") - { - continue; - } - if (listVectorNames.Contains(m_PipelineLayerNames[i]) == false) - { - listVectorNames.Add(m_PipelineLayerNames[i]); - } - } - for (int i = 0; i < valueLayerNames.Count; i++) - { - if (listVectorNames.Contains(valueLayerNames[i]) == false) - { - listVectorNames.Add(valueLayerNames[i]); - } - } - for (int i = 0; i < workwellLayerNames.Count; i++) - { - if (listVectorNames.Contains(workwellLayerNames[i]) == false) - { - listVectorNames.Add(workwellLayerNames[i]); - } - } - for (int i = 0; i < instrumenLayerNames.Count; i++) - { - if (listVectorNames.Contains(instrumenLayerNames[i]) == false) - { - listVectorNames.Add(instrumenLayerNames[i]); - } - } - for (int i = 0; i < pipefittingLayerNames.Count; i++) - { - if (listVectorNames.Contains(pipefittingLayerNames[i]) == false) - { - listVectorNames.Add(pipefittingLayerNames[i]); - } - } - FrmExportVector frm = new FrmExportVector(globeControl1, listVectorNames); - frm.ShowDialog(); - } string citySevenLineType = ""; string cityServerLineName = ""; /// - /// 绘制城市七线 功能按钮 - /// - /// - /// - private void 绘制城市七线buttonItem140_Click(object sender, EventArgs e) - { - FrmCitySevenLineType frm = new FrmCitySevenLineType(); - if (frm.ShowDialog() == DialogResult.OK) - { - globeControl1.Globe.Action = EnumAction3D.DrawPolyline; - m_isDrawCitySevenLine = true; - m_isDrawTunnel = false; - m_AddPipeLine = false; - this.citySevenLineType = frm.citySevenLineType; - this.cityServerLineName = frm.citySevenLineName; - switch (frm.citySevenLineType) - { - case "城市红线": - GSOLayer layerRed = globeControl1.Globe.Layers.GetLayerByCaption(frm.citySevenLineType); - if (layerRed != null) - { - globeControl1.Globe.DestLayerFeatureAdd = layerRed; - layerRed.Editable = true; - } - break; - case "城市橙线": - GSOLayer layerOrange = globeControl1.Globe.Layers.GetLayerByCaption(frm.citySevenLineType); - if (layerOrange != null) - { - globeControl1.Globe.DestLayerFeatureAdd = layerOrange; - layerOrange.Editable = true; - } - break; - case "城市黄线": - GSOLayer layerYellow = globeControl1.Globe.Layers.GetLayerByCaption(frm.citySevenLineType); - if (layerYellow != null) - { - globeControl1.Globe.DestLayerFeatureAdd = layerYellow; - layerYellow.Editable = true; - } - break; - case "城市绿线": - GSOLayer layerGreen = globeControl1.Globe.Layers.GetLayerByCaption(frm.citySevenLineType); - if (layerGreen != null) - { - globeControl1.Globe.DestLayerFeatureAdd = layerGreen; - layerGreen.Editable = true; - } - break; - case "城市蓝线": - GSOLayer layerBlue = globeControl1.Globe.Layers.GetLayerByCaption(frm.citySevenLineType); - if (layerBlue != null) - { - globeControl1.Globe.DestLayerFeatureAdd = layerBlue; - layerBlue.Editable = true; - } - break; - case "城市紫线": - GSOLayer layerPurple = globeControl1.Globe.Layers.GetLayerByCaption(frm.citySevenLineType); - if (layerPurple != null) - { - globeControl1.Globe.DestLayerFeatureAdd = layerPurple; - layerPurple.Editable = true; - } - break; - case "城市黑线": - GSOLayer layerBlack = globeControl1.Globe.Layers.GetLayerByCaption(frm.citySevenLineType); - if (layerBlack != null) - { - globeControl1.Globe.DestLayerFeatureAdd = layerBlack; - layerBlack.Editable = true; - } - break; - } - } - } - /// - /// 七线审核 功能按钮 - /// - /// - /// - private void 七线审核buttonItem141_Click(object sender, EventArgs e) - { - FrmCityServerLineAnalysis frm = new FrmCityServerLineAnalysis(globeControl1, m_PipelineLayerNames); - frm.ShowDialog(this); - } - - /// /// 间距分析 开始分析按钮 分析绘制的七线和管线的距离是否符合标准 /// /// @@ -7666,25 +6509,6 @@ } } - - - /// - /// 管线自动缩进 菜单 - /// - /// - /// - private void 管线自动缩进buttonItem140_Click(object sender, EventArgs e) - { - FrmPipelineIndented frm = new FrmPipelineIndented(globeControl1, m_PipelineLayerNames, workwellLayerNames); - frm.ShowDialog(this); - } - - private void btnExportCADs_Click(object sender, EventArgs e) - { - - } - - /// /// 统计指定图层在指定范围内的所有feature对象 /// @@ -7755,8 +6579,6 @@ } - - //设置图层为隐藏 private void setLayerVisible(string layerName) { @@ -7765,27 +6587,7 @@ globeControl1.Globe.Refresh(); } - /// - /// 连接数据库 - /// - /// - /// - private void buttonItem129_Click(object sender, EventArgs e) - { - //保存日志 - LogManager.saveLog(Utility.userName, this.buttonItemSJGL4_1.Text); - - FrmDatabaseParaSetting2 frm = new FrmDatabaseParaSetting2(globeControl1); - if (frm.ShowDialog() == DialogResult.OK) - { - ds = FrmDatabaseParaSetting2.ds; - if (ds != null) - { - ds.IsCloseSaved = false; - } - } - } - + /// /// 清除渲染结果 /// @@ -7803,112 +6605,8 @@ layerTemp.RemoveAllFeature(); globeControl1.Refresh(); } - - /// - /// 绘制垂线 - /// - /// - /// - private void drawCLine(GSOPoint3d fpt, GSOPoint3d tpt) - { - GSOGeoPolyline3D pline = new GSOGeoPolyline3D(); - GSOPoint3ds pts = new GSOPoint3ds(); - pts.Add(fpt); - pts.Add(tpt); - pline.AddPart(pts); - - GSOGeoPoint3D fptg = new GSOGeoPoint3D(); - GSOGeoPoint3D tptg = new GSOGeoPoint3D(); - fptg.X = fpt.X; - fptg.Y = fpt.Y; - fptg.Z = 0; - tptg.X = tpt.X; - tptg.Y = tpt.Y; - tptg.Z = 0; - - GSOFeature gf = new GSOFeature(); - gf.Geometry = pline; - - globeControl1.Globe.MemoryLayer.AddFeature(gf); - - } - /// - /// 红线审核 - /// - /// - /// - private void buttonItem138_Click_2(object sender, EventArgs e) - { - - } - /// - /// 比较两个点是否是同一个点 - /// - /// - /// - /// - private bool comparePoint(GSOPoint3d pt1, GSOPoint3d pt2) - { - double x1 = 0; double y1 = 0; - double x2 = 0; double y2 = 0; - x1 = pt1.X; - y1 = pt1.Y; - x2 = pt2.X; - y2 = pt2.Y; - if ((x1 == x2) && (y1 == y2)) - { - return true; - } - return false; - } - /// - /// 获得点到线的垂线距离及垂点 - /// - /// - /// - /// - /// - private void comparePointLine(GSOPoint3d point, GSOGeoPolyline3D line, out double length, out GSOPoint3d pointChuiDian) - { - GSOPoint3d lineStartPoint = line[0][0]; - GSOPoint3d lineEndPoint = line[0][1]; - GSOGeoPolyline3D lineAB = new GSOGeoPolyline3D(); - GSOPoint3ds pointsAB = new GSOPoint3ds(); - pointsAB.Add(point); - pointsAB.Add(lineStartPoint); - lineAB.AddPart(pointsAB); - double lengthAB = lineAB.GetSpaceLength(false, 6378137.0); - double xieLvAB = getXieLu("", point.X, point.Y, lineStartPoint.X, lineStartPoint.Y); - double xieLvBC = getXieLu("", lineStartPoint.X, lineStartPoint.Y, lineEndPoint.X, lineEndPoint.Y); - - double tanABC = Math.Abs(xieLvAB - xieLvBC) / (1 + xieLvAB * xieLvBC); - double angle = Math.Atan(tanABC); - //if (angle > Math.PI / 2) //落在外边 - //{ - // length = 0; - //} - double lengthAD = lengthAB * Math.Sin(angle); - length = Math.Abs(lengthAD); - double lengthBD = lengthAB * Math.Cos(angle); - - GSOPoint2d point2dStart = Latlon_2_XYZ(lineStartPoint.X, lineStartPoint.Y); - double bBC = point2dStart.Y - xieLvBC * point2dStart.X; - GSOPoint2d point2dEnd = new GSOPoint2d(); - point2dEnd.X = point2dStart.X + 100; - point2dEnd.Y = point2dEnd.X * xieLvBC + bBC; - point2dEnd = XYZ_2_Latlon(point2dEnd.X, point2dEnd.Y); - - GSOPoint3d pointEnd = new GSOPoint3d(); - pointEnd.X = point2dEnd.X; - pointEnd.Y = point2dEnd.Y; - GSOGeoPolyline3D lineYanShen = new GSOGeoPolyline3D(); - GSOPoint3ds pointsYanShen = new GSOPoint3ds(); - pointsYanShen.Add(lineStartPoint); - pointsYanShen.Add(pointEnd); - lineYanShen.AddPart(pointsYanShen); - GSOGeoPolyline3D lineSegment = lineYanShen.GetSegment(0, lengthBD); - pointChuiDian = lineSegment[0][1]; - } + + /// /// 获得斜率 /// @@ -8044,255 +6742,6 @@ } /// - /// 获取与点相连的所有线以及线的点的集合 - /// - /// 选定的点所在的线 - /// 选定的点 - /// 面中不完全包含的除起点线之外所有的线 - /// 选定的点所在的点的集合 - /// 所有以选定线为起点的点的集合 - /// - private List getFeaturesPoints(GSOFeature featureSelect, GSOPoint3d lineStart, GSOFeatures selectFeatures, GSOPoint3ds ps, List listPS) - { - GSOFeatures fsStart = new GSOFeatures(); - for (int n = 0; n < selectFeatures.Length; n++) - { - if (featureSelect.ID == selectFeatures[n].ID) - { - continue; - } - GSOGeoPolyline3D newLine = selectFeatures[n].Geometry as GSOGeoPolyline3D; - if (newLine != null && newLine.PartCount > 0) - { - GSOPoint3d newLineStart = newLine[0][0]; - GSOPoint3d newLineEnd = newLine[0][newLine[0].Count - 1]; - if (lineStart.X == newLineEnd.X && lineStart.Y == newLineEnd.Y) - { - GSOPoint3ds psAdd = new GSOPoint3ds(); - for (int k = newLine[0].Count - 1; k >= 0; k--) - { - psAdd.Add(newLine[0][k]); - } - newLine[0] = psAdd; - fsStart.Add(selectFeatures[n]); - - } - else if (lineStart.X == newLineStart.X && lineStart.Y == newLineStart.Y) - { - fsStart.Add(selectFeatures[n]); - - } - } - } - if (fsStart.Length > 0) - { - for (int m = 0; m < fsStart.Length; m++) - { - GSOGeoPolyline3D lineFsStart = fsStart[m].Geometry as GSOGeoPolyline3D; - if (lineFsStart != null && lineFsStart.PartCount > 0) - { - GSOPoint3ds psAdd = ps.Clone(); - for (int k = 0; k < lineFsStart[0].Count; k++) - { - psAdd.Add(lineFsStart[0][k]); - } - listPS = getFeaturesPoints(fsStart[m], lineFsStart[0][lineFsStart[0].Count - 1], selectFeatures, psAdd, listPS); - } - } - } - else - { - listPS.Add(ps); - } - return listPS; - } - - /// - /// 获取切割面的线 - /// - /// 不完全包含在面中的所有线 - /// 完全包含在面中的所有线 - /// 线 - private GSOFeature getLineFromGSOFeatures(GSOFeatures features, GSOFeatures featuresTrue) - { - //1. 当线对象数组的长度为0时,返回空 - if (features.Length == 0) - { - return null; - } - //2. 当线对象数组的长度为1时,返回这条线 - if (features.Length == 1) - { - return features[0]; - } - //3. 当线对象数组的长度大于1时,计算所有线组成的最长线 - - //3.1 获取所有不完全包含在面中的对象selectFeatures - GSOFeatures selectFeatures = new GSOFeatures(); - for (int a = 0; a < features.Length; a++) - { - selectFeatures.Add(features[a].Clone()); - } - //3.2 删除features中完全包含在面中的线,获取和面的边界相交的线对象 - for (int a = 0; a < featuresTrue.Length; a++) - { - for (int b = 0; b < features.Length; b++) - { - if (featuresTrue[a].ID == features[b].ID) - { - features.Remove(b); - break; - } - } - } - //3.3 如果和面的边界相交的线的数量为0,返回空 - if (features.Length == 0) - { - return null; - } - //3.4 获取第一条和面的边界相交的线featureInOutPolygon - GSOFeature featureInOutPolygon = features[0]; - //3.5 从所有的线中删除featureInOutPolygon - for (int a = 0; a < selectFeatures.Length; a++) - { - if (selectFeatures[a].ID == featureInOutPolygon.ID) - { - selectFeatures.Remove(a); - break; - } - } - //listPS存储所有从featureInOutPolygon出发的点的集合 - List listPS = new List(); - //3.5 获取与featureInOutPolygon相连的线的集合 - GSOGeoPolyline3D line = featureInOutPolygon.Geometry as GSOGeoPolyline3D; - if (line != null && line.PartCount > 0) - { - GSOPoint3d lineStart = line[0][0]; - GSOPoint3d lineEnd = line[0][line[0].Count - 1]; - #region//获取和featureInOutPolygon的起点相连的线 - GSOFeatures fsStart = new GSOFeatures(); - for (int n = 0; n < selectFeatures.Length; n++) - { - GSOGeoPolyline3D newLine = selectFeatures[n].Geometry as GSOGeoPolyline3D; - if (newLine != null && newLine.PartCount > 0) - { - GSOPoint3d newLineStart = newLine[0][0]; - GSOPoint3d newLineEnd = newLine[0][newLine[0].Count - 1]; - if (lineStart.X == newLineEnd.X && lineStart.Y == newLineEnd.Y) - { - GSOPoint3ds psAdd = new GSOPoint3ds(); - for (int k = newLine[0].Count - 1; k >= 0; k--) - { - psAdd.Add(newLine[0][k]); - } - newLine[0] = psAdd; - fsStart.Add(selectFeatures[n]); - - } - else if (lineStart.X == newLineStart.X && lineStart.Y == newLineStart.Y) - { - fsStart.Add(selectFeatures[n]); - } - } - } - #endregion - - #region//获取和featureInOutPolygon的终点相连的线 - GSOFeatures fsEnd = new GSOFeatures(); - for (int n = 0; n < selectFeatures.Length; n++) - { - GSOGeoPolyline3D newLine = selectFeatures[n].Geometry as GSOGeoPolyline3D; - if (newLine != null && newLine.PartCount > 0) - { - GSOPoint3d newLineStart = newLine[0][0]; - GSOPoint3d newLineEnd = newLine[0][newLine[0].Count - 1]; - if (lineEnd.X == newLineStart.X && lineEnd.Y == newLineStart.Y) - { - fsEnd.Add(selectFeatures[n]); - - } - else if (lineEnd.X == newLineEnd.X && lineEnd.Y == newLineEnd.Y) - { - GSOPoint3ds psAdd = new GSOPoint3ds(); - for (int k = newLine[0].Count - 1; k >= 0; k--) - { - psAdd.Add(newLine[0][k]); - } - newLine[0] = psAdd; - fsEnd.Add(selectFeatures[n]); - - } - } - } - #endregion - - //3.6 将featureInOutPolygon的所有点和与之起点相连的线的所有点组成一个点的集合并添加到listPS中 - if (fsStart.Length > 0 && fsEnd.Length == 0) - { - for (int m = 0; m < fsStart.Length; m++) - { - GSOGeoPolyline3D lineFsStart = fsStart[m].Geometry as GSOGeoPolyline3D; - if (lineFsStart != null && lineFsStart.PartCount > 0) - { - GSOPoint3ds psAdd = new GSOPoint3ds(); - for (int k = line[0].Count - 1; k >= 0; k--) - { - psAdd.Add(line[0][k]); - } - for (int k = 0; k < lineFsStart[0].Count; k++) - { - psAdd.Add(lineFsStart[0][k]); - } - - listPS = getFeaturesPoints(fsStart[m], lineFsStart[0][lineFsStart[0].Count - 1], selectFeatures, psAdd, listPS); - - } - } - } - //3.6 将featureInOutPolygon的所有点和与之终点相连的线的所有点组成一个点的集合并添加到listPS中 - else if (fsStart.Length == 0 && fsEnd.Length > 0) - { - for (int n = 0; n < fsEnd.Length; n++) - { - GSOGeoPolyline3D lineFsEnd = fsEnd[n].Geometry as GSOGeoPolyline3D; - if (lineFsEnd != null && lineFsEnd.PartCount > 0) - { - GSOPoint3ds psAdd = new GSOPoint3ds(); - for (int k = 0; k < line[0].Count - 1; k++) - { - psAdd.Add(line[0][k]); - } - for (int k = 0; k < lineFsEnd[0].Count; k++) - { - psAdd.Add(lineFsEnd[0][k]); - } - //获取线fsEnd[n]的另一个端点相连的线并记录该线的点的集合 - listPS = getFeaturesPoints(fsEnd[n], lineFsEnd[0][lineFsEnd[0].Count - 1], selectFeatures, psAdd, listPS); - } - } - } - } - - //3.7 获取所有以featureInOutPolygon为起点的点的集合组成的线中的最长的线 - double maxLength = 0; - GSOFeature featureNew = new GSOFeature(); - for (int h = 0; h < listPS.Count; h++) - { - GSOGeoPolyline3D lineNew = new GSOGeoPolyline3D(); - lineNew.AddPart(listPS[h]); - GSOLabel label = new GSOLabel(); - label.Text = h.ToString(); - featureNew.Label = label; - double length = lineNew.GetSpaceLength(true, 6378137); - if (length > maxLength) - { - featureNew.Geometry = lineNew; - } - } - - return featureNew; - } - /// /// 更新最大最小状态 /// /// @@ -8340,219 +6789,6 @@ - private void buttonItem139_Click(object sender, EventArgs e) - { - - string filepath = ""; - //日志记录 - OpenFileDialog dlg = new OpenFileDialog(); - dlg.Filter = "矢量数据(*.shp)|*.shp|矢量数据(*.lgd)|*.lgd|全部支持格式(*.lgd,*.shp)|*.lgd;*.shp;"; - //dlg.Filter = "支持格式(*.lrp,*.tif,*.img,*.lrc,*.kml,*.lgd,*.shp,*.gft)|*.lrp;*.tif;*.img;*.lrc;*.kml;*.lgd;*.shp;*.gft|栅格数据(*.lrp)|*.lrp|栅格缓存(*.lrc)|*.lrc|KML数据(*.kml)|*.kml|矢量数据(*.lgd)|*.lgd|矢量缓存(*.gft)|*.gft|其它格式(*.*)|*.*||"; - dlg.Multiselect = true; - if (dlg.ShowDialog() == DialogResult.OK) - { - //自定义lprj文件名,从程序中复制一lprj文件。 - int bindex = dlg.FileName.Split('\\').Length; - string lastname = dlg.FileName.Split('\\')[bindex - 1]; - - for (int i = 0; i < dlg.FileNames.Length; i++) - { - string strDataPath = dlg.FileNames[i]; - filepath = strDataPath; - - GSOLayer layer = globeControl1.Globe.Layers.Add(strDataPath); - - } - - } - //放大到红线 - - - // globeControl1.Globe.Layers.MoveTo(0, globeControl1.Globe.Layers.Count - 1); - // globeControl1.Globe.Layers.MoveTo(0,4); - globeControl1.Refresh(); - - - } - /// - /// - /// - /// - /// - private void buttonItem142_Click(object sender, EventArgs e) - { - //获得红线polygon - //GSOLayer layerSevenLine = globeControl1.Globe.Layers.GetLayerByCaption(redlinelayername); - - GSOLayer layerSevenLine = globeControl1.Globe.Layers.Add("D:\\data\\歌林小镇shp\\test.shp"); - //获得红线结果列表 - ArrayList rrLists = new ArrayList(); - - //if (redlinelayername != "") - { - GSOFeatures fs = layerSevenLine.GetAllFeatures(); - int len = fs.Length; - - GSOGeoPolygon3D sevenPolygon = new GSOGeoPolygon3D(); - for (int k = 0; k < len; k++) - {//多根红线 - ///////生成红线区域/////// - GSOFeature featSevenLine = layerSevenLine.GetAt(k); - GSOGeoPolyline3D sevenLine = featSevenLine.Geometry as GSOGeoPolyline3D; - - List sevenParts = new List(); - for (int i = 0; i < sevenLine.PartCount; i++) - { - sevenParts.Add(sevenLine[i]); - } - for (int i = 0; i < sevenParts.Count; i++) - { - sevenPolygon.AddPart((GSOPoint3ds)sevenParts[i]); - } - /////拼出红线多边形over////// - - } - //GSOLayer layer = globeControl1.Globe.Layers.GetLayerByCaption("天然气管线"); - - GSOLayer layer = globeControl1.Globe.Layers.Add("C:\\Users\\nn-203\\Desktop\\xiaobai\\test.lgd"); - //线切割面定义,输出用 - GSOFeatures resFeats = new GSOFeatures(); - int resultstyle = 0; - //管线切割红线区域后,面积较小的区域 - GSOGeoPolygon3D restPoly = new GSOGeoPolygon3D(); - List inpts = new List(); - if (layer != null) - { - //红线区域 - GSOFeature sevenfeature = new GSOFeature(); - sevenfeature.Geometry = sevenPolygon; - - //获取不完全包含在面中的所有线 - GSOFeatures feats = layer.FindFeaturesInPolygon(sevenPolygon, false); - //获取完全包含在面中的所有线 - GSOFeatures featsTrue = layer.FindFeaturesInPolygon(sevenPolygon, true); - //获取面中所有对象组成的切割面的长线 - GSOFeature feature = new GSOFeature(); - - feature = getLineFromGSOFeatures(feats, featsTrue);//管线多个feature拼成一个feature - - //globeControl1.Globe.MemoryLayer.AddFeature(feature); - //globeControl1.Globe.MemoryLayer.AddFeature(sevenfeature); - if (feature != null) - { - //线切割面,输出 - //feature.HighLight = true; - GSODataEngineUtility.GSLineClipPolygon(feature, sevenfeature, out resFeats, out resultstyle); - } - else - { - MessageBox.Show("没有找到切割面的线对象!"); - } - ////////////////绘制分割后的多边形/////////////// - for (int a = 0; a < resFeats.Length; a++) - { - - GSOFeature gf = resFeats[1]; - globeControl1.Globe.MemoryLayer.AddFeature(gf); - - } - } - - - } - } - - private void buttonItem143_Click(object sender, EventArgs e) - { - //获得红线polygon - GSOLayer layerSevenLine = globeControl1.Globe.Layers.Add("d:\\lineAndPolygon.lgd"); - GSOLayer layerSevenLine2 = globeControl1.Globe.Layers.GetLayerByCaption("d:\\lineAndPolygon.lgd"); - //获得红线结果列表 - ArrayList rrLists = new ArrayList(); - - - // if (redlinelayername != "") - { - GSOFeatures fs = layerSevenLine.GetAllFeatures(); - int len = fs.Length; - - GSOGeoPolyline3D linetest = new GSOGeoPolyline3D(); - GSOGeoPolygon3D sevenPolygon = new GSOGeoPolygon3D(); - - GSOFeature linefeat = fs.FindByID(2); - //linefeat.Geometry = linetest; - GSOFeature polyfeat = fs.FindByID(1); - //polyfeat.Geometry = sevenPolygon; - - //线切割面定义,输出用 - GSOFeatures resFeats = new GSOFeatures(); - int resultstyle = 0; - GSODataEngineUtility.GSLineClipPolygon(linefeat, polyfeat, out resFeats, out resultstyle); - - ////////////////绘制分割后的多边形/////////////// - for (int a = 0; a < resFeats.Length; a++) - { - - GSOFeature gf = resFeats[0]; - globeControl1.Globe.MemoryLayer.AddFeature(gf); - - } - ////把红线切成一段段的线段,获得切前的红线点集 - List redpts = new List();//切前的红线点集合 - for (int i = 0; i < linetest.PartCount; i++) - { - GSOPoint3ds partP = linetest[i]; - for (int j = 0; j < partP.Count; j++) - { - redpts.Add(partP[j]); - } - } - - List redpts2 = new List();//切前的红线点集合 - for (int i = 0; i < sevenPolygon.PartCount; i++) - { - GSOPoint3ds partP = sevenPolygon[i]; - for (int j = 0; j < partP.Count; j++) - { - redpts2.Add(partP[j]); - } - } - } - } - /// - /// 增加用户手册下载连接 - /// - /// - /// - Cyberpipe.udfiles.UpDownFile UDF = new udfiles.UpDownFile(Utility.udserviceurl); - string dir_Ok = "C:\\Users\\nn-203\\Desktop"; - private void button1_Click(object sender, EventArgs e) - { - if (folderBrowserDialog1.ShowDialog() == DialogResult.OK) //打洙?开a文?件t夹D对?话°框ò - { - dir_Ok = folderBrowserDialog1.SelectedPath; //显?示?选?择?的?文?件t夹D路·径? - - //tempstr = folderBrowserDialog1.SelectedPath; //存?储洹?选?择?的?文?件t夹D路·径? - - } - - Cyberpipe.PED_logicfile.PED_Affair.Redact_D = Utility.uploadpath + "\\SFiles\\UserHbook\\说明.docx"; - if (File.Exists(dir_Ok + "\\" + Files_Name(Cyberpipe.PED_logicfile.PED_Affair.Redact_D, 1))) - { - if (MessageBox.Show("文件夹下有同名文件,是否替换?", "提示", MessageBoxButtons.YesNo, MessageBoxIcon.Information) == DialogResult.No) ; - - } - byte[] file = UDF.Down(Cyberpipe.PED_logicfile.PED_Affair.Redact_D); - FileStream pFileSream = new FileStream(dir_Ok + "\\说明.docx", FileMode.OpenOrCreate); - pFileSream.Write(file, 0, file.Length); - pFileSream.Close(); - if (File.Exists(dir_Ok + "\\" + Files_Name(Cyberpipe.PED_logicfile.PED_Affair.Redact_D, 1)) == true) - { - MessageBox.Show("文件导出成功!"); - } - //PEDAClass.Folder_Handle(dir_Ok + "\\" + PEDAClass.Files_Name(Cyberpipe.PED_logicfile.PED_Affair.Redact_D, 0), Cyberpipe.PED_logicfile.PED_Affair.Redact_D, "", 0); - - } /// /// 获取文件或文件夹的名称 /// @@ -8575,33 +6811,6 @@ return DF_Name; } - private void toolStripDropDownButton1_Click(object sender, EventArgs e) - { - if (folderBrowserDialog1.ShowDialog() == DialogResult.OK) //打洙?开a文?件t夹D对?话°框ò - { - dir_Ok = folderBrowserDialog1.SelectedPath; //显?示?选?择?的?文?件t夹D路·径? - - //tempstr = folderBrowserDialog1.SelectedPath; //存?储洹?选?择?的?文?件t夹D路·径? - - - Cyberpipe.PED_logicfile.PED_Affair.Redact_D = Utility.uploadpath + "\\SFiles\\UserHbook\\说明.docx"; - if (File.Exists(dir_Ok + "\\" + Files_Name(Cyberpipe.PED_logicfile.PED_Affair.Redact_D, 1))) - { - if (MessageBox.Show("文件夹下有同名文件,是否替换?", "提示", MessageBoxButtons.YesNo, MessageBoxIcon.Information) == DialogResult.No) ; - - } - byte[] file = UDF.Down(Cyberpipe.PED_logicfile.PED_Affair.Redact_D); - FileStream pFileSream = new FileStream(dir_Ok + "\\说明.docx", FileMode.OpenOrCreate); - pFileSream.Write(file, 0, file.Length); - pFileSream.Close(); - if (File.Exists(dir_Ok + "\\" + Files_Name(Cyberpipe.PED_logicfile.PED_Affair.Redact_D, 1)) == true) - { - MessageBox.Show("文件导出成功!"); - } - - } - } - /// /// 空间查询 /// @@ -9792,7 +8001,7 @@ GSOLayer resLayer = null; GSOFeature resFeature = null; globeControl1.Globe.GetSelectObject(0, out resFeature, out resLayer); - + if (resFeature == null) return; GSOGeoPolyline3D line1 = resFeature.Geometry as GSOGeoPolyline3D; if (line1 == null) { @@ -9876,7 +8085,7 @@ GSOLayer resLayer = null; GSOFeature resFeature = null; globeControl1.Globe.GetSelectObject(0, out resFeature, out resLayer); - + if (resFeature == null) return; GSOGeoPolyline3D line1 = resFeature.Geometry as GSOGeoPolyline3D; if (line1 == null) { @@ -9891,7 +8100,8 @@ } GSOFeatures feats = globeControl1.Globe.MemoryLayer.GetFeatureByName("粒子要素", true); - if (feats.Length > 0) + + if (feats!=null&&feats.Length > 0) globeControl1.Globe.MemoryLayer.RemoveFeatureByID(feats[0].ID); //if (emitterFeature != null) //{ @@ -11121,88 +9331,6 @@ } private int connectServerCount = 0; - - /// - /// 还原球到实测库 - /// - private void refreshGlobe1() - { - //添加实测库图层已有图层 - int servernum = 0; - //1.清除global1上 - for (int i = globeControl1.Globe.Layers.Count - 1; i >= 0; i--) - { - GSOLayer layer = globeControl1.Globe.Layers[i]; - if (!layer.Name.Contains("fttp:")) - { - layer.Dataset.Close();//清除内存 - globeControl1.Globe.Layers.Remove(layer); - } - else - { - servernum++; - } - } - - //globeControl1.Globe.ConnectServer(Utility.serverip, Utility.serverport, "", ""); //加载locaServer中的数据 - - //2.添加实测库图层 - string[] markerStrs = new string[9]; - markerStrs[0] = "标高标注"; - markerStrs[1] = "管径标注"; - markerStrs[2] = "埋深标注"; - markerStrs[3] = "坐标标注"; - markerStrs[4] = "坡度标注"; - markerStrs[5] = "属性标注"; - markerStrs[6] = "自定义标注"; - markerStrs[7] = "距离标注"; - markerStrs[8] = "扯旗标注"; - for (int i = 0; i < markerStrs.Length; i++) - { - if (File.Exists(Application.StartupPath + "\\标注管理\\" + markerStrs[i] + ".lgd")) - { - GSOLayer markerLayer = globeControl1.Globe.Layers.Add(Application.StartupPath + "\\标注管理\\" + markerStrs[i] + ".lgd"); - } - } - - for (int i = 0; i < g1layername.Count; i++) - { - string g1name = g1layername[i]; - GSODataset datasetg1 = Utility.dataSource.GetDatasetByName(g1name); - GSOLayer templayer = globeControl1.Globe.Layers.Add(datasetg1); - templayer.MaxVisibleAltitude = -1; - } - layerTemp = globeControl1.Globe.Layers.Add(Application.StartupPath + "\\tempLgdData.lgd"); - globeControl1.Globe.Layers.Add(Application.StartupPath + "/城市七线/城市红线.lgd"); - globeControl1.Globe.Layers.Add(Application.StartupPath + "/城市七线/城市橙线.lgd"); - globeControl1.Globe.Layers.Add(Application.StartupPath + "/城市七线/城市黄线.lgd"); - globeControl1.Globe.Layers.Add(Application.StartupPath + "/城市七线/城市绿线.lgd"); - globeControl1.Globe.Layers.Add(Application.StartupPath + "/城市七线/城市蓝线.lgd"); - globeControl1.Globe.Layers.Add(Application.StartupPath + "/城市七线/城市紫线.lgd"); - globeControl1.Globe.Layers.Add(Application.StartupPath + "/城市七线/城市黑线.lgd"); - globeControl1.Globe.Layers.Add(Application.StartupPath + "/隧道.lgd"); - - //移动server的数据图层 - for (int i = 0; i < servernum; i++) - { - globeControl1.Globe.Layers.MoveTo(globeControl1.Globe.Layers.Count - 1, 0); - } - - if (layerManagerNode.Nodes.Count > 0) - { - for (int i = layerManagerNode.Nodes.Count - 1; i >= 0; i--) - { - layerManagerNode.Nodes[i].Remove(); - - } - } - - - - globeControl1.Refresh(); - - } - /// /// 碰撞审查 /// @@ -11476,31 +9604,7 @@ // } //} #endregion - /// - /// 数据质量检查 - /// - /// - /// - private void buttonItemSJGL2_Click(object sender, EventArgs e) - { - //日志记录 - LogManager.saveLog(Utility.userName, this.buttonItemSJGL2.Text); - FrmValiData frm = new FrmValiData(globeControl1); - frm.ShowDialog(); - } - /// - /// 数据预处理 - /// - /// - /// - private void buttonItemSJGL3_Click(object sender, EventArgs e) - { - //保存日志 - LogManager.saveLog(Utility.userName, this.buttonItemSJGL3.Text); - FrmEditShapeFile frm = new FrmEditShapeFile(globeControl1); - frm.ShowDialog(this); - } /// /// 连接数据库 /// @@ -12251,60 +10355,6 @@ List lineStruct = new List(); GSOFeature featureSelected = null; - private void AddDatagridView(DataTable table) - { - - if (table != null && table.Rows.Count > 0) - { - dataGridViewX1.DataSource = table; - panelOfTable.Visible = true; - panelOfTable.Height = 200; - toolStripNumbers.Text = "红线审核结果"; - toolStripFeatureLength.Text = " 共有:" + table.Rows.Count + "条"; - } - else - { - - } - - } - - /// - /// 去除集合中重复的管线 - /// - /// - /// - /// - private GSOFeatures getFeaturesByFilter(GSOFeatures features, string fieldName) - { - if (features == null) - { - return null; - } - GSOFeatures featuresGet = new GSOFeatures(); - for (int i = 0; i < features.Length; i++) - { - GSOFeature featureFromFS = features[i]; - string fieldValueFromFS = featureFromFS.GetValue(fieldName).ToString().Trim(); - bool isHas = false; - for (int j = featuresGet.Length - 1; j >= 0; j--) - { - GSOFeature featureFromFSGet = featuresGet[j]; - string fieldValueFromFSGet = featureFromFSGet.GetValue(fieldName).ToString().Trim(); - if (fieldValueFromFS.Equals(fieldValueFromFSGet)) - { - isHas = true; - break; - } - } - if (isHas == false) - { - featuresGet.Add(featureFromFS.Clone()); - } - } - return featuresGet; - } - /// /// 数据管理导入文件 /// @@ -12440,138 +10490,7 @@ // //MessageBox.Show("系统运行错误:" + ex.ToString(), "错误", MessageBoxButtons.OK, MessageBoxIcon.Error); // } //} - - - /// - /// 标识器全区域统计 - /// - /// - /// - private void 标识器分类统计ToolStripMenuItem_Click(object sender, EventArgs e) - { - globeControl1.Globe.Action = EnumAction3D.ActionNull; - FrmBSQStatis bsqStatis = new FrmBSQStatis(); - bsqStatis.Show(this); - } - /// - /// 标识器绘制区域统计 - /// - /// - /// - private void 标识器分类统计ToolStripMenuItem1_Click(object sender, EventArgs e) - { - trackflag = "BSQDuoBianXiangStatis"; - globeControl1.Globe.Action = EnumAction3D.TrackPolygon; - } - - - #region 保存和加载审核库加载的图层 - private void saveLayerList(TreeNodeCollection treeNodeList) - { - string configPath = Application.StartupPath + "\\configLayerList.xml"; - try - { - XmlDocument doc = new XmlDocument(); - doc.Load(configPath); - XmlNode dbParams = doc.SelectSingleNode("Params/dbparams"); - XmlNode dbLayers = doc.SelectSingleNode("Params/dblayers"); - XmlNode layers = doc.SelectSingleNode("Params/layers"); - dbParams.RemoveAll(); - dbLayers.RemoveAll(); - layers.RemoveAll(); - - List listDS = new List(); - String shDatasourceName = Utility.sgdbip + "/" + Utility.sgdbname + "_" + Utility.sgdbuser; - bool flag = false; - - for (int i = 0; i < globeControl1.Globe.DataManager.DataSourceCount; i++) - { - GSODataSource ds = globeControl1.Globe.DataManager.GetDataSourceAt(i); - if (ds != null && ds.Type == EnumDataSourceType.SqlServer || ds.Type == EnumDataSourceType.Oracle) - { - if (ds.Name == shDatasourceName) - { - //防止因为多次连接同一个数据库 - if (flag == true) - { - break; - } - flag = true; - listDS.Add(ds); - GSODataSourceCnn conn = ds.GetConnectionInfo(); - - XmlElement dbparam = doc.CreateElement("shdbparam"); - XmlElement ip = doc.CreateElement("ship"); - ip.InnerText = conn.Server; - - XmlElement dbname = doc.CreateElement("shdbname"); - dbname.InnerText = conn.Database; - - XmlElement username = doc.CreateElement("shusername"); - username.InnerText = conn.User; - - XmlElement password = doc.CreateElement("shpassword"); - password.InnerText = conn.Password; - - XmlElement type = doc.CreateElement("shtype"); - if (ds.Type == EnumDataSourceType.SqlServer) - { - type.InnerText = "sqlserver"; - } - else - { - type.InnerText = "oracle"; - } - - dbparam.AppendChild(ip); - dbparam.AppendChild(dbname); - dbparam.AppendChild(username); - dbparam.AppendChild(password); - dbparam.AppendChild(type); - dbParams.AppendChild(dbparam); - } - - } - } - - for (int i = 0; i < treeNodeList.Count; i++) - { - GSOLayer layer = treeNodeList[i].Tag as GSOLayer; - if (Path.GetExtension(layer.Name) == "") - { - XmlElement dbLayer = doc.CreateElement("dblayer"); - XmlAttribute attri = doc.CreateAttribute("dbindex"); - for (int j = 0; j < listDS.Count; j++) - { - if (layer.Dataset.DataSource.Name == listDS[j].Name) - { - attri.Value = j.ToString(); - break; - } - } - dbLayer.Attributes.Append(attri); - dbLayer.InnerText = layer.Name; - - dbLayers.AppendChild(dbLayer); - } - else - { - XmlElement dbLayer = doc.CreateElement("layer"); - dbLayer.InnerText = layer.Name; - layers.AppendChild(dbLayer); - } - } - - doc.Save(configPath); - } - catch (Exception e) - { - - } - } - - #endregion - + private void buttonItem_TaskManager_Click(object sender, EventArgs e) { if (Form_TaksManager.IS_OPEN) diff --git a/MainFrm.designer.cs b/MainFrm.designer.cs index 233ef8c..97b8299 100644 --- a/MainFrm.designer.cs +++ b/MainFrm.designer.cs @@ -82,6 +82,7 @@ this.sideBar1 = new DevComponents.DotNetBar.SideBar(); this.panelEx3 = new DevComponents.DotNetBar.PanelEx(); this.layerSensorTree = new System.Windows.Forms.TreeView(); + this.layerTree = new Cyberpipe.MyTreeView(); this.sideBarPanelItem3 = new DevComponents.DotNetBar.SideBarPanelItem(); this.controlContainerItem3 = new DevComponents.DotNetBar.ControlContainerItem(); this.sideBarPanelItem4 = new DevComponents.DotNetBar.SideBarPanelItem(); @@ -365,30 +366,26 @@ this.可编辑ToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); this.保存ToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); this.ribbonControl1 = new DevComponents.DotNetBar.RibbonControl(); - this.ribbonPanel1 = new DevComponents.DotNetBar.RibbonPanel(); - this.ribbonBar21 = new DevComponents.DotNetBar.RibbonBar(); - this.buttonItem87 = new DevComponents.DotNetBar.ButtonItem(); - this.buttonItem88 = new DevComponents.DotNetBar.ButtonItem(); - this.buttonItem27 = new DevComponents.DotNetBar.ButtonItem(); - this.buttonItem91 = new DevComponents.DotNetBar.ButtonItem(); - this.buttonItem1 = new DevComponents.DotNetBar.ButtonItem(); - this.btnlegendSet = new DevComponents.DotNetBar.ButtonItem(); - this.buttonItem89 = new DevComponents.DotNetBar.ButtonItem(); - this.ribbonPanel7 = new DevComponents.DotNetBar.RibbonPanel(); - this.ribbonBar5 = new DevComponents.DotNetBar.RibbonBar(); - this.btn_flag = new DevComponents.DotNetBar.ButtonItem(); - this.slider4ground = new DevComponents.DotNetBar.SliderItem(); - this.ribbonPanel2 = new DevComponents.DotNetBar.RibbonPanel(); - this.ribbonBar4 = new DevComponents.DotNetBar.RibbonBar(); - this.buttonItem_TaskManager = new DevComponents.DotNetBar.ButtonItem(); - this.buttonItem_OnlineTask = new DevComponents.DotNetBar.ButtonItem(); - this.buttonItem_Event = new DevComponents.DotNetBar.ButtonItem(); this.ribbonPanel3 = new DevComponents.DotNetBar.RibbonPanel(); this.ribbonBar3 = new DevComponents.DotNetBar.RibbonBar(); this.btn_device = new DevComponents.DotNetBar.ButtonItem(); this.btn_Person = new DevComponents.DotNetBar.ButtonItem(); this.btn_constructMap = new DevComponents.DotNetBar.ButtonItem(); this.buttonItem9 = new DevComponents.DotNetBar.ButtonItem(); + this.ribbonPanel2 = new DevComponents.DotNetBar.RibbonPanel(); + this.ribbonBar4 = new DevComponents.DotNetBar.RibbonBar(); + this.buttonItem_TaskManager = new DevComponents.DotNetBar.ButtonItem(); + this.buttonItem_OnlineTask = new DevComponents.DotNetBar.ButtonItem(); + this.buttonItem_Event = new DevComponents.DotNetBar.ButtonItem(); + this.ribbonPanel1 = new DevComponents.DotNetBar.RibbonPanel(); + this.ribbonBar21 = new DevComponents.DotNetBar.RibbonBar(); + this.buttonItem87 = new DevComponents.DotNetBar.ButtonItem(); + this.buttonItem88 = new DevComponents.DotNetBar.ButtonItem(); + this.buttonItem27 = new DevComponents.DotNetBar.ButtonItem(); + this.buttonItem1 = new DevComponents.DotNetBar.ButtonItem(); + this.buttonItem91 = new DevComponents.DotNetBar.ButtonItem(); + this.btnlegendSet = new DevComponents.DotNetBar.ButtonItem(); + this.buttonItem89 = new DevComponents.DotNetBar.ButtonItem(); this.ribbonPanel8 = new DevComponents.DotNetBar.RibbonPanel(); this.ribbonBar_UserInfo = new DevComponents.DotNetBar.RibbonBar(); this.btn_user_info = new DevComponents.DotNetBar.ButtonItem(); @@ -398,6 +395,10 @@ this.btn_user_role = new DevComponents.DotNetBar.ButtonItem(); this.btn_password_edit = new DevComponents.DotNetBar.ButtonItem(); this.btn_reset_password = new DevComponents.DotNetBar.ButtonItem(); + this.ribbonPanel7 = new DevComponents.DotNetBar.RibbonPanel(); + this.ribbonBar5 = new DevComponents.DotNetBar.RibbonBar(); + this.btn_flag = new DevComponents.DotNetBar.ButtonItem(); + this.slider4ground = new DevComponents.DotNetBar.SliderItem(); this.ribbonPanel15 = new DevComponents.DotNetBar.RibbonPanel(); this.ribbonBar20 = new DevComponents.DotNetBar.RibbonBar(); this.buttonItemSJGL = new DevComponents.DotNetBar.ButtonItem(); @@ -610,7 +611,6 @@ this.buttonItem84 = new DevComponents.DotNetBar.ButtonItem(); this.buttonItem75 = new DevComponents.DotNetBar.ButtonItem(); this.buttonItem76 = new DevComponents.DotNetBar.ButtonItem(); - this.layerTree = new Cyberpipe.MyTreeView(); this.statusStrip1.SuspendLayout(); this.sideBar1.SuspendLayout(); this.panelEx3.SuspendLayout(); @@ -647,11 +647,11 @@ this.contextMenuStrip3.SuspendLayout(); this.contextMenuStripDeleteLayerNode.SuspendLayout(); this.ribbonControl1.SuspendLayout(); - this.ribbonPanel1.SuspendLayout(); - this.ribbonPanel7.SuspendLayout(); - this.ribbonPanel2.SuspendLayout(); this.ribbonPanel3.SuspendLayout(); + this.ribbonPanel2.SuspendLayout(); + this.ribbonPanel1.SuspendLayout(); this.ribbonPanel8.SuspendLayout(); + this.ribbonPanel7.SuspendLayout(); this.ribbonPanel15.SuspendLayout(); ((System.ComponentModel.ISupportInitialize)(this.pictureBox1)).BeginInit(); this.SuspendLayout(); @@ -813,7 +813,6 @@ this.toolStripDropDownButton1.Size = new System.Drawing.Size(45, 21); this.toolStripDropDownButton1.Text = "帮助"; this.toolStripDropDownButton1.Visible = false; - this.toolStripDropDownButton1.Click += new System.EventHandler(this.toolStripDropDownButton1_Click); // // controlContainerItem1 // @@ -1047,6 +1046,16 @@ this.layerSensorTree.AfterCheck += new System.Windows.Forms.TreeViewEventHandler(this.layerMarkerTree_AfterCheck); this.layerSensorTree.NodeMouseClick += new System.Windows.Forms.TreeNodeMouseClickEventHandler(this.layerMarkerTree_NodeMouseClick); // + // layerTree + // + this.layerTree.CheckBoxes = true; + this.layerTree.ItemHeight = 18; + this.layerTree.Location = new System.Drawing.Point(30, 78); + this.layerTree.Name = "layerTree"; + this.layerTree.Size = new System.Drawing.Size(121, 97); + this.layerTree.TabIndex = 1; + this.layerTree.AfterCheck += new System.Windows.Forms.TreeViewEventHandler(this.layerTree_AfterCheck); + // // sideBarPanelItem3 // this.sideBarPanelItem3.FontBold = true; @@ -2966,28 +2975,28 @@ // 平移对象ToolStripMenuItem // this.平移对象ToolStripMenuItem.Name = "平移对象ToolStripMenuItem"; - this.平移对象ToolStripMenuItem.Size = new System.Drawing.Size(152, 22); + this.平移对象ToolStripMenuItem.Size = new System.Drawing.Size(124, 22); this.平移对象ToolStripMenuItem.Text = "平移对象"; this.平移对象ToolStripMenuItem.Click += new System.EventHandler(this.buttonItemBJ6_Click); // // 升降对象ToolStripMenuItem // this.升降对象ToolStripMenuItem.Name = "升降对象ToolStripMenuItem"; - this.升降对象ToolStripMenuItem.Size = new System.Drawing.Size(152, 22); + this.升降对象ToolStripMenuItem.Size = new System.Drawing.Size(124, 22); this.升降对象ToolStripMenuItem.Text = "升降对象"; this.升降对象ToolStripMenuItem.Click += new System.EventHandler(this.buttonItemBJ7_Click); // // 旋转对象ToolStripMenuItem // this.旋转对象ToolStripMenuItem.Name = "旋转对象ToolStripMenuItem"; - this.旋转对象ToolStripMenuItem.Size = new System.Drawing.Size(152, 22); + this.旋转对象ToolStripMenuItem.Size = new System.Drawing.Size(124, 22); this.旋转对象ToolStripMenuItem.Text = "旋转对象"; this.旋转对象ToolStripMenuItem.Click += new System.EventHandler(this.buttonItemBJ8_Click); // // 连接管段ToolStripMenuItem // this.连接管段ToolStripMenuItem.Name = "连接管段ToolStripMenuItem"; - this.连接管段ToolStripMenuItem.Size = new System.Drawing.Size(152, 22); + this.连接管段ToolStripMenuItem.Size = new System.Drawing.Size(124, 22); this.连接管段ToolStripMenuItem.Text = "连接管段"; this.连接管段ToolStripMenuItem.Click += new System.EventHandler(this.buttonItemBJ9_Click); // @@ -2997,34 +3006,34 @@ this.导出CADToolStripMenuItem, this.导出文件ToolStripMenuItem1}); this.导出文件ToolStripMenuItem.Name = "导出文件ToolStripMenuItem"; - this.导出文件ToolStripMenuItem.Size = new System.Drawing.Size(152, 22); + this.导出文件ToolStripMenuItem.Size = new System.Drawing.Size(124, 22); this.导出文件ToolStripMenuItem.Text = "导出矢量"; // // 导出CADToolStripMenuItem // this.导出CADToolStripMenuItem.Name = "导出CADToolStripMenuItem"; - this.导出CADToolStripMenuItem.Size = new System.Drawing.Size(152, 22); + this.导出CADToolStripMenuItem.Size = new System.Drawing.Size(125, 22); this.导出CADToolStripMenuItem.Text = "导出CAD"; this.导出CADToolStripMenuItem.Click += new System.EventHandler(this.buttonItemBJ10_1_Click); // // 导出文件ToolStripMenuItem1 // this.导出文件ToolStripMenuItem1.Name = "导出文件ToolStripMenuItem1"; - this.导出文件ToolStripMenuItem1.Size = new System.Drawing.Size(152, 22); + this.导出文件ToolStripMenuItem1.Size = new System.Drawing.Size(125, 22); this.导出文件ToolStripMenuItem1.Text = "导出文件"; this.导出文件ToolStripMenuItem1.Click += new System.EventHandler(this.buttonItemBJ10_2_Click); // // 前进ToolStripMenuItem // this.前进ToolStripMenuItem.Name = "前进ToolStripMenuItem"; - this.前进ToolStripMenuItem.Size = new System.Drawing.Size(152, 22); + this.前进ToolStripMenuItem.Size = new System.Drawing.Size(124, 22); this.前进ToolStripMenuItem.Text = "前进"; this.前进ToolStripMenuItem.Click += new System.EventHandler(this.buttonItemBJ12_Click); // // 删除模型ToolStripMenuItem // this.删除模型ToolStripMenuItem.Name = "删除模型ToolStripMenuItem"; - this.删除模型ToolStripMenuItem.Size = new System.Drawing.Size(152, 22); + this.删除模型ToolStripMenuItem.Size = new System.Drawing.Size(124, 22); this.删除模型ToolStripMenuItem.Text = "后退"; this.删除模型ToolStripMenuItem.Click += new System.EventHandler(this.buttonItemBJ11_Click); // @@ -4160,6 +4169,198 @@ this.ribbonControl1.Text = "ribbonControl1"; this.ribbonControl1.UseCustomizeDialog = false; // + // ribbonPanel3 + // + this.ribbonPanel3.ColorSchemeStyle = DevComponents.DotNetBar.eDotNetBarStyle.StyleManagerControlled; + this.ribbonPanel3.Controls.Add(this.ribbonBar3); + this.ribbonPanel3.Dock = System.Windows.Forms.DockStyle.Fill; + this.ribbonPanel3.Location = new System.Drawing.Point(0, 33); + this.ribbonPanel3.Name = "ribbonPanel3"; + this.ribbonPanel3.Padding = new System.Windows.Forms.Padding(3, 0, 3, 3); + this.ribbonPanel3.Size = new System.Drawing.Size(1328, 62); + // + // + // + this.ribbonPanel3.Style.Class = ""; + this.ribbonPanel3.Style.CornerType = DevComponents.DotNetBar.eCornerType.Square; + // + // + // + this.ribbonPanel3.StyleMouseDown.Class = ""; + this.ribbonPanel3.StyleMouseDown.CornerType = DevComponents.DotNetBar.eCornerType.Square; + // + // + // + this.ribbonPanel3.StyleMouseOver.Class = ""; + this.ribbonPanel3.StyleMouseOver.CornerType = DevComponents.DotNetBar.eCornerType.Square; + this.ribbonPanel3.TabIndex = 40; + // + // ribbonBar3 + // + this.ribbonBar3.AutoOverflowEnabled = true; + // + // + // + this.ribbonBar3.BackgroundMouseOverStyle.Class = ""; + this.ribbonBar3.BackgroundMouseOverStyle.CornerType = DevComponents.DotNetBar.eCornerType.Square; + // + // + // + this.ribbonBar3.BackgroundStyle.Class = ""; + this.ribbonBar3.BackgroundStyle.CornerType = DevComponents.DotNetBar.eCornerType.Square; + this.ribbonBar3.ContainerControlProcessDialogKey = true; + this.ribbonBar3.Dock = System.Windows.Forms.DockStyle.Left; + this.ribbonBar3.Items.AddRange(new DevComponents.DotNetBar.BaseItem[] { + this.btn_device, + this.btn_Person, + this.btn_constructMap, + this.buttonItem9}); + this.ribbonBar3.Location = new System.Drawing.Point(3, 0); + this.ribbonBar3.Name = "ribbonBar3"; + this.ribbonBar3.Size = new System.Drawing.Size(378, 59); + this.ribbonBar3.Style = DevComponents.DotNetBar.eDotNetBarStyle.StyleManagerControlled; + this.ribbonBar3.TabIndex = 0; + // + // + // + this.ribbonBar3.TitleStyle.Class = ""; + this.ribbonBar3.TitleStyle.CornerType = DevComponents.DotNetBar.eCornerType.Square; + // + // + // + this.ribbonBar3.TitleStyleMouseOver.Class = ""; + this.ribbonBar3.TitleStyleMouseOver.CornerType = DevComponents.DotNetBar.eCornerType.Square; + this.ribbonBar3.TitleVisible = false; + // + // btn_device + // + this.btn_device.ButtonStyle = DevComponents.DotNetBar.eButtonStyle.ImageAndText; + this.btn_device.Image = global::Cyberpipe.Properties.Resources._24X24__2__02; + this.btn_device.ImagePosition = DevComponents.DotNetBar.eImagePosition.Top; + this.btn_device.Name = "btn_device"; + this.btn_device.SubItemsExpandWidth = 14; + this.btn_device.Text = "探测仪管理"; + this.btn_device.Click += new System.EventHandler(this.btn_device_Click); + // + // btn_Person + // + this.btn_Person.ButtonStyle = DevComponents.DotNetBar.eButtonStyle.ImageAndText; + this.btn_Person.Image = global::Cyberpipe.Properties.Resources._24x24icon_05_hover1; + this.btn_Person.ImagePosition = DevComponents.DotNetBar.eImagePosition.Top; + this.btn_Person.Name = "btn_Person"; + this.btn_Person.SubItemsExpandWidth = 14; + this.btn_Person.Text = "定位人员维护"; + this.btn_Person.Click += new System.EventHandler(this.btn_Person_Click); + // + // btn_constructMap + // + this.btn_constructMap.Image = global::Cyberpipe.Properties.Resources._24x24icon_04_hover; + this.btn_constructMap.ImagePosition = DevComponents.DotNetBar.eImagePosition.Top; + this.btn_constructMap.Name = "btn_constructMap"; + this.btn_constructMap.SubItemsExpandWidth = 14; + this.btn_constructMap.Text = "导出施工图"; + this.btn_constructMap.Click += new System.EventHandler(this.btn_constructMap_Click); + // + // buttonItem9 + // + this.buttonItem9.Image = global::Cyberpipe.Properties.Resources._24x24icon__2__10; + this.buttonItem9.ImagePosition = DevComponents.DotNetBar.eImagePosition.Top; + this.buttonItem9.Name = "buttonItem9"; + this.buttonItem9.SubItemsExpandWidth = 14; + this.buttonItem9.Text = "文档管理"; + this.buttonItem9.Click += new System.EventHandler(this.buttonItem9_Click); + // + // ribbonPanel2 + // + this.ribbonPanel2.ColorSchemeStyle = DevComponents.DotNetBar.eDotNetBarStyle.StyleManagerControlled; + this.ribbonPanel2.Controls.Add(this.ribbonBar4); + this.ribbonPanel2.Dock = System.Windows.Forms.DockStyle.Fill; + this.ribbonPanel2.Location = new System.Drawing.Point(0, 0); + this.ribbonPanel2.Name = "ribbonPanel2"; + this.ribbonPanel2.Padding = new System.Windows.Forms.Padding(3, 0, 3, 3); + this.ribbonPanel2.Size = new System.Drawing.Size(1328, 95); + // + // + // + this.ribbonPanel2.Style.Class = ""; + this.ribbonPanel2.Style.CornerType = DevComponents.DotNetBar.eCornerType.Square; + // + // + // + this.ribbonPanel2.StyleMouseDown.Class = ""; + this.ribbonPanel2.StyleMouseDown.CornerType = DevComponents.DotNetBar.eCornerType.Square; + // + // + // + this.ribbonPanel2.StyleMouseOver.Class = ""; + this.ribbonPanel2.StyleMouseOver.CornerType = DevComponents.DotNetBar.eCornerType.Square; + this.ribbonPanel2.TabIndex = 39; + this.ribbonPanel2.Visible = false; + // + // ribbonBar4 + // + this.ribbonBar4.AutoOverflowEnabled = true; + // + // + // + this.ribbonBar4.BackgroundMouseOverStyle.Class = ""; + this.ribbonBar4.BackgroundMouseOverStyle.CornerType = DevComponents.DotNetBar.eCornerType.Square; + // + // + // + this.ribbonBar4.BackgroundStyle.Class = ""; + this.ribbonBar4.BackgroundStyle.CornerType = DevComponents.DotNetBar.eCornerType.Square; + this.ribbonBar4.ContainerControlProcessDialogKey = true; + this.ribbonBar4.Dock = System.Windows.Forms.DockStyle.Left; + this.ribbonBar4.Items.AddRange(new DevComponents.DotNetBar.BaseItem[] { + this.buttonItem_TaskManager, + this.buttonItem_OnlineTask, + this.buttonItem_Event}); + this.ribbonBar4.Location = new System.Drawing.Point(3, 0); + this.ribbonBar4.Name = "ribbonBar4"; + this.ribbonBar4.Size = new System.Drawing.Size(299, 92); + this.ribbonBar4.Style = DevComponents.DotNetBar.eDotNetBarStyle.StyleManagerControlled; + this.ribbonBar4.TabIndex = 0; + this.ribbonBar4.Text = "ribbonBar4"; + // + // + // + this.ribbonBar4.TitleStyle.Class = ""; + this.ribbonBar4.TitleStyle.CornerType = DevComponents.DotNetBar.eCornerType.Square; + // + // + // + this.ribbonBar4.TitleStyleMouseOver.Class = ""; + this.ribbonBar4.TitleStyleMouseOver.CornerType = DevComponents.DotNetBar.eCornerType.Square; + this.ribbonBar4.TitleVisible = false; + // + // buttonItem_TaskManager + // + this.buttonItem_TaskManager.Image = global::Cyberpipe.Properties.Resources._24x24icon__2__76; + this.buttonItem_TaskManager.ImagePosition = DevComponents.DotNetBar.eImagePosition.Top; + this.buttonItem_TaskManager.Name = "buttonItem_TaskManager"; + this.buttonItem_TaskManager.SubItemsExpandWidth = 14; + this.buttonItem_TaskManager.Text = "工单管理"; + this.buttonItem_TaskManager.Click += new System.EventHandler(this.buttonItem_TaskManager_Click); + // + // buttonItem_OnlineTask + // + this.buttonItem_OnlineTask.Image = global::Cyberpipe.Properties.Resources._24x24icon__2__69; + this.buttonItem_OnlineTask.ImagePosition = DevComponents.DotNetBar.eImagePosition.Top; + this.buttonItem_OnlineTask.Name = "buttonItem_OnlineTask"; + this.buttonItem_OnlineTask.SubItemsExpandWidth = 14; + this.buttonItem_OnlineTask.Text = "在线任务"; + this.buttonItem_OnlineTask.Click += new System.EventHandler(this.buttonItem_OnlineTask_Click); + // + // buttonItem_Event + // + this.buttonItem_Event.Image = global::Cyberpipe.Properties.Resources._24x24icon__2__72; + this.buttonItem_Event.ImagePosition = DevComponents.DotNetBar.eImagePosition.Top; + this.buttonItem_Event.Name = "buttonItem_Event"; + this.buttonItem_Event.SubItemsExpandWidth = 14; + this.buttonItem_Event.Text = "事件管理"; + this.buttonItem_Event.Click += new System.EventHandler(this.buttonItem_Event_Click); + // // ribbonPanel1 // this.ribbonPanel1.AutoSize = true; @@ -4262,6 +4463,15 @@ this.buttonItem27.Visible = false; this.buttonItem27.Click += new System.EventHandler(this.buttonItem27_Click); // + // buttonItem1 + // + this.buttonItem1.Image = global::Cyberpipe.Properties.Resources._24x24icon__2__94; + this.buttonItem1.ImagePosition = DevComponents.DotNetBar.eImagePosition.Top; + this.buttonItem1.Name = "buttonItem1"; + this.buttonItem1.SubItemsExpandWidth = 14; + this.buttonItem1.Text = "图层管理"; + this.buttonItem1.Click += new System.EventHandler(this.buttonItem1_Click); + // // buttonItem91 // this.buttonItem91.ForeColor = System.Drawing.Color.Black; @@ -4272,15 +4482,6 @@ this.buttonItem91.Text = "快速定位"; this.buttonItem91.Click += new System.EventHandler(this.buttonItem91_Click); // - // buttonItem1 - // - this.buttonItem1.Image = global::Cyberpipe.Properties.Resources._24x24icon__2__94; - this.buttonItem1.ImagePosition = DevComponents.DotNetBar.eImagePosition.Top; - this.buttonItem1.Name = "buttonItem1"; - this.buttonItem1.SubItemsExpandWidth = 14; - this.buttonItem1.Text = "图层管理"; - this.buttonItem1.Click += new System.EventHandler(this.buttonItem1_Click); - // // btnlegendSet // this.btnlegendSet.Image = global::Cyberpipe.Properties.Resources._24x24icon__2__93; @@ -4300,278 +4501,6 @@ this.buttonItem89.Visible = false; this.buttonItem89.Click += new System.EventHandler(this.buttonItem89_Click); // - // ribbonPanel7 - // - this.ribbonPanel7.ColorSchemeStyle = DevComponents.DotNetBar.eDotNetBarStyle.StyleManagerControlled; - this.ribbonPanel7.Controls.Add(this.ribbonBar5); - this.ribbonPanel7.Dock = System.Windows.Forms.DockStyle.Fill; - this.ribbonPanel7.Location = new System.Drawing.Point(0, 0); - this.ribbonPanel7.Name = "ribbonPanel7"; - this.ribbonPanel7.Padding = new System.Windows.Forms.Padding(3, 0, 3, 3); - this.ribbonPanel7.Size = new System.Drawing.Size(1328, 95); - // - // - // - this.ribbonPanel7.Style.Class = ""; - this.ribbonPanel7.Style.CornerType = DevComponents.DotNetBar.eCornerType.Square; - // - // - // - this.ribbonPanel7.StyleMouseDown.Class = ""; - this.ribbonPanel7.StyleMouseDown.CornerType = DevComponents.DotNetBar.eCornerType.Square; - // - // - // - this.ribbonPanel7.StyleMouseOver.Class = ""; - this.ribbonPanel7.StyleMouseOver.CornerType = DevComponents.DotNetBar.eCornerType.Square; - this.ribbonPanel7.TabIndex = 41; - this.ribbonPanel7.Visible = false; - // - // ribbonBar5 - // - this.ribbonBar5.AutoOverflowEnabled = true; - // - // - // - this.ribbonBar5.BackgroundMouseOverStyle.Class = ""; - this.ribbonBar5.BackgroundMouseOverStyle.CornerType = DevComponents.DotNetBar.eCornerType.Square; - // - // - // - this.ribbonBar5.BackgroundStyle.Class = ""; - this.ribbonBar5.BackgroundStyle.CornerType = DevComponents.DotNetBar.eCornerType.Square; - this.ribbonBar5.ContainerControlProcessDialogKey = true; - this.ribbonBar5.Dock = System.Windows.Forms.DockStyle.Left; - this.ribbonBar5.Items.AddRange(new DevComponents.DotNetBar.BaseItem[] { - this.btn_flag, - this.slider4ground}); - this.ribbonBar5.Location = new System.Drawing.Point(3, 0); - this.ribbonBar5.Name = "ribbonBar5"; - this.ribbonBar5.Size = new System.Drawing.Size(418, 92); - this.ribbonBar5.Style = DevComponents.DotNetBar.eDotNetBarStyle.StyleManagerControlled; - this.ribbonBar5.TabIndex = 0; - // - // - // - this.ribbonBar5.TitleStyle.Class = ""; - this.ribbonBar5.TitleStyle.CornerType = DevComponents.DotNetBar.eCornerType.Square; - // - // - // - this.ribbonBar5.TitleStyleMouseOver.Class = ""; - this.ribbonBar5.TitleStyleMouseOver.CornerType = DevComponents.DotNetBar.eCornerType.Square; - this.ribbonBar5.TitleVisible = false; - this.ribbonBar5.ItemClick += new System.EventHandler(this.ribbonBar5_ItemClick); - // - // btn_flag - // - this.btn_flag.Image = global::Cyberpipe.Properties.Resources._24x24icon_03_hover; - this.btn_flag.ImagePosition = DevComponents.DotNetBar.eImagePosition.Top; - this.btn_flag.Name = "btn_flag"; - this.btn_flag.SubItemsExpandWidth = 14; - this.btn_flag.Text = "标识器管理"; - this.btn_flag.Click += new System.EventHandler(this.btn_flag_Click); - // - // slider4ground - // - this.slider4ground.LabelPosition = DevComponents.DotNetBar.eSliderLabelPosition.Top; - this.slider4ground.Name = "slider4ground"; - this.slider4ground.Text = "地面透明度"; - this.slider4ground.Value = 0; - this.slider4ground.ValueChanged += new System.EventHandler(this.slider4ground_ValueChanged); - // - // ribbonPanel2 - // - this.ribbonPanel2.ColorSchemeStyle = DevComponents.DotNetBar.eDotNetBarStyle.StyleManagerControlled; - this.ribbonPanel2.Controls.Add(this.ribbonBar4); - this.ribbonPanel2.Dock = System.Windows.Forms.DockStyle.Fill; - this.ribbonPanel2.Location = new System.Drawing.Point(0, 0); - this.ribbonPanel2.Name = "ribbonPanel2"; - this.ribbonPanel2.Padding = new System.Windows.Forms.Padding(3, 0, 3, 3); - this.ribbonPanel2.Size = new System.Drawing.Size(1328, 95); - // - // - // - this.ribbonPanel2.Style.Class = ""; - this.ribbonPanel2.Style.CornerType = DevComponents.DotNetBar.eCornerType.Square; - // - // - // - this.ribbonPanel2.StyleMouseDown.Class = ""; - this.ribbonPanel2.StyleMouseDown.CornerType = DevComponents.DotNetBar.eCornerType.Square; - // - // - // - this.ribbonPanel2.StyleMouseOver.Class = ""; - this.ribbonPanel2.StyleMouseOver.CornerType = DevComponents.DotNetBar.eCornerType.Square; - this.ribbonPanel2.TabIndex = 39; - this.ribbonPanel2.Visible = false; - // - // ribbonBar4 - // - this.ribbonBar4.AutoOverflowEnabled = true; - // - // - // - this.ribbonBar4.BackgroundMouseOverStyle.Class = ""; - this.ribbonBar4.BackgroundMouseOverStyle.CornerType = DevComponents.DotNetBar.eCornerType.Square; - // - // - // - this.ribbonBar4.BackgroundStyle.Class = ""; - this.ribbonBar4.BackgroundStyle.CornerType = DevComponents.DotNetBar.eCornerType.Square; - this.ribbonBar4.ContainerControlProcessDialogKey = true; - this.ribbonBar4.Dock = System.Windows.Forms.DockStyle.Left; - this.ribbonBar4.Items.AddRange(new DevComponents.DotNetBar.BaseItem[] { - this.buttonItem_TaskManager, - this.buttonItem_OnlineTask, - this.buttonItem_Event}); - this.ribbonBar4.Location = new System.Drawing.Point(3, 0); - this.ribbonBar4.Name = "ribbonBar4"; - this.ribbonBar4.Size = new System.Drawing.Size(299, 92); - this.ribbonBar4.Style = DevComponents.DotNetBar.eDotNetBarStyle.StyleManagerControlled; - this.ribbonBar4.TabIndex = 0; - this.ribbonBar4.Text = "ribbonBar4"; - // - // - // - this.ribbonBar4.TitleStyle.Class = ""; - this.ribbonBar4.TitleStyle.CornerType = DevComponents.DotNetBar.eCornerType.Square; - // - // - // - this.ribbonBar4.TitleStyleMouseOver.Class = ""; - this.ribbonBar4.TitleStyleMouseOver.CornerType = DevComponents.DotNetBar.eCornerType.Square; - this.ribbonBar4.TitleVisible = false; - // - // buttonItem_TaskManager - // - this.buttonItem_TaskManager.Image = global::Cyberpipe.Properties.Resources._24x24icon__2__76; - this.buttonItem_TaskManager.ImagePosition = DevComponents.DotNetBar.eImagePosition.Top; - this.buttonItem_TaskManager.Name = "buttonItem_TaskManager"; - this.buttonItem_TaskManager.SubItemsExpandWidth = 14; - this.buttonItem_TaskManager.Text = "工单管理"; - this.buttonItem_TaskManager.Click += new System.EventHandler(this.buttonItem_TaskManager_Click); - // - // buttonItem_OnlineTask - // - this.buttonItem_OnlineTask.Image = global::Cyberpipe.Properties.Resources._24x24icon__2__69; - this.buttonItem_OnlineTask.ImagePosition = DevComponents.DotNetBar.eImagePosition.Top; - this.buttonItem_OnlineTask.Name = "buttonItem_OnlineTask"; - this.buttonItem_OnlineTask.SubItemsExpandWidth = 14; - this.buttonItem_OnlineTask.Text = "在线任务"; - this.buttonItem_OnlineTask.Click += new System.EventHandler(this.buttonItem_OnlineTask_Click); - // - // buttonItem_Event - // - this.buttonItem_Event.Image = global::Cyberpipe.Properties.Resources._24x24icon__2__72; - this.buttonItem_Event.ImagePosition = DevComponents.DotNetBar.eImagePosition.Top; - this.buttonItem_Event.Name = "buttonItem_Event"; - this.buttonItem_Event.SubItemsExpandWidth = 14; - this.buttonItem_Event.Text = "事件管理"; - this.buttonItem_Event.Click += new System.EventHandler(this.buttonItem_Event_Click); - // - // ribbonPanel3 - // - this.ribbonPanel3.ColorSchemeStyle = DevComponents.DotNetBar.eDotNetBarStyle.StyleManagerControlled; - this.ribbonPanel3.Controls.Add(this.ribbonBar3); - this.ribbonPanel3.Dock = System.Windows.Forms.DockStyle.Fill; - this.ribbonPanel3.Location = new System.Drawing.Point(0, 33); - this.ribbonPanel3.Name = "ribbonPanel3"; - this.ribbonPanel3.Padding = new System.Windows.Forms.Padding(3, 0, 3, 3); - this.ribbonPanel3.Size = new System.Drawing.Size(1328, 62); - // - // - // - this.ribbonPanel3.Style.Class = ""; - this.ribbonPanel3.Style.CornerType = DevComponents.DotNetBar.eCornerType.Square; - // - // - // - this.ribbonPanel3.StyleMouseDown.Class = ""; - this.ribbonPanel3.StyleMouseDown.CornerType = DevComponents.DotNetBar.eCornerType.Square; - // - // - // - this.ribbonPanel3.StyleMouseOver.Class = ""; - this.ribbonPanel3.StyleMouseOver.CornerType = DevComponents.DotNetBar.eCornerType.Square; - this.ribbonPanel3.TabIndex = 40; - // - // ribbonBar3 - // - this.ribbonBar3.AutoOverflowEnabled = true; - // - // - // - this.ribbonBar3.BackgroundMouseOverStyle.Class = ""; - this.ribbonBar3.BackgroundMouseOverStyle.CornerType = DevComponents.DotNetBar.eCornerType.Square; - // - // - // - this.ribbonBar3.BackgroundStyle.Class = ""; - this.ribbonBar3.BackgroundStyle.CornerType = DevComponents.DotNetBar.eCornerType.Square; - this.ribbonBar3.ContainerControlProcessDialogKey = true; - this.ribbonBar3.Dock = System.Windows.Forms.DockStyle.Left; - this.ribbonBar3.Items.AddRange(new DevComponents.DotNetBar.BaseItem[] { - this.btn_device, - this.btn_Person, - this.btn_constructMap, - this.buttonItem9}); - this.ribbonBar3.Location = new System.Drawing.Point(3, 0); - this.ribbonBar3.Name = "ribbonBar3"; - this.ribbonBar3.Size = new System.Drawing.Size(378, 59); - this.ribbonBar3.Style = DevComponents.DotNetBar.eDotNetBarStyle.StyleManagerControlled; - this.ribbonBar3.TabIndex = 0; - // - // - // - this.ribbonBar3.TitleStyle.Class = ""; - this.ribbonBar3.TitleStyle.CornerType = DevComponents.DotNetBar.eCornerType.Square; - // - // - // - this.ribbonBar3.TitleStyleMouseOver.Class = ""; - this.ribbonBar3.TitleStyleMouseOver.CornerType = DevComponents.DotNetBar.eCornerType.Square; - this.ribbonBar3.TitleVisible = false; - // - // btn_device - // - this.btn_device.ButtonStyle = DevComponents.DotNetBar.eButtonStyle.ImageAndText; - this.btn_device.Image = global::Cyberpipe.Properties.Resources._24X24__2__02; - this.btn_device.ImagePosition = DevComponents.DotNetBar.eImagePosition.Top; - this.btn_device.Name = "btn_device"; - this.btn_device.SubItemsExpandWidth = 14; - this.btn_device.Text = "探测仪管理"; - this.btn_device.Click += new System.EventHandler(this.btn_device_Click); - // - // btn_Person - // - this.btn_Person.ButtonStyle = DevComponents.DotNetBar.eButtonStyle.ImageAndText; - this.btn_Person.Image = global::Cyberpipe.Properties.Resources._24x24icon_05_hover1; - this.btn_Person.ImagePosition = DevComponents.DotNetBar.eImagePosition.Top; - this.btn_Person.Name = "btn_Person"; - this.btn_Person.SubItemsExpandWidth = 14; - this.btn_Person.Text = "定位人员维护"; - this.btn_Person.Click += new System.EventHandler(this.btn_Person_Click); - // - // btn_constructMap - // - this.btn_constructMap.Image = global::Cyberpipe.Properties.Resources._24x24icon_04_hover; - this.btn_constructMap.ImagePosition = DevComponents.DotNetBar.eImagePosition.Top; - this.btn_constructMap.Name = "btn_constructMap"; - this.btn_constructMap.SubItemsExpandWidth = 14; - this.btn_constructMap.Text = "导出施工图"; - this.btn_constructMap.Click += new System.EventHandler(this.btn_constructMap_Click); - // - // buttonItem9 - // - this.buttonItem9.Image = global::Cyberpipe.Properties.Resources._24x24icon__2__10; - this.buttonItem9.ImagePosition = DevComponents.DotNetBar.eImagePosition.Top; - this.buttonItem9.Name = "buttonItem9"; - this.buttonItem9.SubItemsExpandWidth = 14; - this.buttonItem9.Text = "文档管理"; - this.buttonItem9.Click += new System.EventHandler(this.buttonItem9_Click); - // // ribbonPanel8 // this.ribbonPanel8.ColorSchemeStyle = DevComponents.DotNetBar.eDotNetBarStyle.StyleManagerControlled; @@ -4696,6 +4625,86 @@ this.btn_reset_password.Text = "重置密码"; this.btn_reset_password.Click += new System.EventHandler(this.btn_reset_password_Click); // + // ribbonPanel7 + // + this.ribbonPanel7.ColorSchemeStyle = DevComponents.DotNetBar.eDotNetBarStyle.StyleManagerControlled; + this.ribbonPanel7.Controls.Add(this.ribbonBar5); + this.ribbonPanel7.Dock = System.Windows.Forms.DockStyle.Fill; + this.ribbonPanel7.Location = new System.Drawing.Point(0, 0); + this.ribbonPanel7.Name = "ribbonPanel7"; + this.ribbonPanel7.Padding = new System.Windows.Forms.Padding(3, 0, 3, 3); + this.ribbonPanel7.Size = new System.Drawing.Size(1328, 95); + // + // + // + this.ribbonPanel7.Style.Class = ""; + this.ribbonPanel7.Style.CornerType = DevComponents.DotNetBar.eCornerType.Square; + // + // + // + this.ribbonPanel7.StyleMouseDown.Class = ""; + this.ribbonPanel7.StyleMouseDown.CornerType = DevComponents.DotNetBar.eCornerType.Square; + // + // + // + this.ribbonPanel7.StyleMouseOver.Class = ""; + this.ribbonPanel7.StyleMouseOver.CornerType = DevComponents.DotNetBar.eCornerType.Square; + this.ribbonPanel7.TabIndex = 41; + this.ribbonPanel7.Visible = false; + // + // ribbonBar5 + // + this.ribbonBar5.AutoOverflowEnabled = true; + // + // + // + this.ribbonBar5.BackgroundMouseOverStyle.Class = ""; + this.ribbonBar5.BackgroundMouseOverStyle.CornerType = DevComponents.DotNetBar.eCornerType.Square; + // + // + // + this.ribbonBar5.BackgroundStyle.Class = ""; + this.ribbonBar5.BackgroundStyle.CornerType = DevComponents.DotNetBar.eCornerType.Square; + this.ribbonBar5.ContainerControlProcessDialogKey = true; + this.ribbonBar5.Dock = System.Windows.Forms.DockStyle.Left; + this.ribbonBar5.Items.AddRange(new DevComponents.DotNetBar.BaseItem[] { + this.btn_flag, + this.slider4ground}); + this.ribbonBar5.Location = new System.Drawing.Point(3, 0); + this.ribbonBar5.Name = "ribbonBar5"; + this.ribbonBar5.Size = new System.Drawing.Size(418, 92); + this.ribbonBar5.Style = DevComponents.DotNetBar.eDotNetBarStyle.StyleManagerControlled; + this.ribbonBar5.TabIndex = 0; + // + // + // + this.ribbonBar5.TitleStyle.Class = ""; + this.ribbonBar5.TitleStyle.CornerType = DevComponents.DotNetBar.eCornerType.Square; + // + // + // + this.ribbonBar5.TitleStyleMouseOver.Class = ""; + this.ribbonBar5.TitleStyleMouseOver.CornerType = DevComponents.DotNetBar.eCornerType.Square; + this.ribbonBar5.TitleVisible = false; + this.ribbonBar5.ItemClick += new System.EventHandler(this.ribbonBar5_ItemClick); + // + // btn_flag + // + this.btn_flag.Image = global::Cyberpipe.Properties.Resources._24x24icon_03_hover; + this.btn_flag.ImagePosition = DevComponents.DotNetBar.eImagePosition.Top; + this.btn_flag.Name = "btn_flag"; + this.btn_flag.SubItemsExpandWidth = 14; + this.btn_flag.Text = "标识器管理"; + this.btn_flag.Click += new System.EventHandler(this.btn_flag_Click); + // + // slider4ground + // + this.slider4ground.LabelPosition = DevComponents.DotNetBar.eSliderLabelPosition.Top; + this.slider4ground.Name = "slider4ground"; + this.slider4ground.Text = "地面透明度"; + this.slider4ground.Value = 0; + this.slider4ground.ValueChanged += new System.EventHandler(this.slider4ground_ValueChanged); + // // ribbonPanel15 // this.ribbonPanel15.ColorSchemeStyle = DevComponents.DotNetBar.eDotNetBarStyle.StyleManagerControlled; @@ -6393,16 +6402,6 @@ this.buttonItem76.SubItemsExpandWidth = 14; this.buttonItem76.Text = "坐标标注"; // - // layerTree - // - this.layerTree.CheckBoxes = true; - this.layerTree.ItemHeight = 18; - this.layerTree.Location = new System.Drawing.Point(30, 78); - this.layerTree.Name = "layerTree"; - this.layerTree.Size = new System.Drawing.Size(121, 97); - this.layerTree.TabIndex = 1; - this.layerTree.AfterCheck += new System.Windows.Forms.TreeViewEventHandler(this.layerTree_AfterCheck); - // // MainFrm // this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Inherit; @@ -6475,11 +6474,11 @@ this.contextMenuStripDeleteLayerNode.ResumeLayout(false); this.ribbonControl1.ResumeLayout(false); this.ribbonControl1.PerformLayout(); - this.ribbonPanel1.ResumeLayout(false); - this.ribbonPanel7.ResumeLayout(false); - this.ribbonPanel2.ResumeLayout(false); this.ribbonPanel3.ResumeLayout(false); + this.ribbonPanel2.ResumeLayout(false); + this.ribbonPanel1.ResumeLayout(false); this.ribbonPanel8.ResumeLayout(false); + this.ribbonPanel7.ResumeLayout(false); this.ribbonPanel15.ResumeLayout(false); ((System.ComponentModel.ISupportInitialize)(this.pictureBox1)).EndInit(); this.ResumeLayout(false); diff --git a/NewFunction/FrmCreateTunnel.cs b/NewFunction/FrmCreateTunnel.cs index 282767c..338edff 100644 --- a/NewFunction/FrmCreateTunnel.cs +++ b/NewFunction/FrmCreateTunnel.cs @@ -142,35 +142,6 @@ } } - private void txtMS_KeyPress(object sender, KeyPressEventArgs e) - { - TextBox text = sender as TextBox; - if ((e.KeyChar < 48 || e.KeyChar > 57) && (e.KeyChar != 8) && (int)e.KeyChar != 46) - { - e.Handled = true; - } - if ((int)e.KeyChar == 46) //小数点 - { - if (text.Text.Length <= 0) - e.Handled = true; //小数点不能在第一位 - else //处理不规则的小数点 - { - float f; - float oldf; - bool b1 = false, b2 = false; - b1 = float.TryParse(text.Text, out oldf); - b2 = float.TryParse(text.Text + e.KeyChar.ToString(), out f); - if (b2 == false) - { - if (b1 == true) - e.Handled = true; - else - e.Handled = false; - } - } - } - } - private void FrmCreateTunnel_Load(object sender, EventArgs e) { if (comboBoxTunnelType.Items.Count > 0) diff --git a/OracleHelper.cs b/OracleHelper.cs index 11eebe6..79cdf48 100644 --- a/OracleHelper.cs +++ b/OracleHelper.cs @@ -49,7 +49,7 @@ { conn.Close(); } - MessageBox.Show(ex.Message, "提示"); + LogHelper.WriteLog(typeof(OledbHelper), ex.Message); return null; } } @@ -67,7 +67,7 @@ } catch(Exception ex) { - // LogError.PublishError(ex); + LogHelper.WriteLog(typeof(OledbHelper), ex.Message); } finally { @@ -111,6 +111,7 @@ } catch (Exception ex) { + LogHelper.WriteLog(typeof(OledbHelper), ex.Message); return null; } } @@ -131,6 +132,7 @@ } catch(Exception ex) { + LogHelper.WriteLog(typeof(OledbHelper), ex.Message); rowCount = -1; } finally @@ -159,6 +161,7 @@ } catch(Exception ex) { + LogHelper.WriteLog(typeof(OledbHelper), ex.Message); num = -1; } finally @@ -190,6 +193,7 @@ } catch (Exception ex) { + LogHelper.WriteLog(typeof(OledbHelper), ex.Message); return null; } } @@ -210,7 +214,7 @@ oracleCmd.Dispose(); conn.Close(); //调用con_close()方法,关闭与数据库的连接 }catch(Exception ex){ - + LogHelper.WriteLog(typeof(OledbHelper), ex.Message); } finally { @@ -237,6 +241,7 @@ } catch (Exception ex) { + LogHelper.WriteLog(typeof(OledbHelper), ex.Message); rowCount = -1; } finally diff --git a/OracleUtils.cs b/OracleUtils.cs index 29b5374..c1aadda 100644 --- a/OracleUtils.cs +++ b/OracleUtils.cs @@ -741,7 +741,6 @@ } catch { - //if we fail to return the SqlDatReader, we need to close the connection ourselves cn.Close(); throw; } diff --git a/Cyberpipe.csproj b/Cyberpipe.csproj index 07a8c1a..e3cd12c 100644 --- a/Cyberpipe.csproj +++ b/Cyberpipe.csproj @@ -204,25 +204,6 @@ - - Form - - - F_GKT1数据输入输出.cs - - - Form - - - F_GKT1添加文件.cs - - - Form - - - F_GKT1添加项目.cs - - Form @@ -1068,18 +1049,6 @@ Frm_password_reset.cs - - Form - - - GKT.cs - - - Form - - - GKT1.cs - Form @@ -1258,12 +1227,6 @@ F_Projedit.cs - - Form - - - PED.cs - Form @@ -1331,16 +1294,6 @@ True Reference.map - - F_GKT1数据输入输出.cs - Designer - - - F_GKT1添加文件.cs - - - F_GKT1添加项目.cs - Form_EditTask.cs @@ -1836,12 +1789,6 @@ Frm_password_reset.cs - - GKT.cs - - - GKT1.cs - F_GKT数据输入输出.cs @@ -1934,9 +1881,6 @@ F_Projedit.cs - - PED.cs - F_数据输入输出.cs diff --git a/Cyberpipe.suo b/Cyberpipe.suo index 68ced4f..a1aecf8 100644 --- a/Cyberpipe.suo +++ b/Cyberpipe.suo Binary files differ diff --git a/EMS_Forms/Form_EditTask.cs b/EMS_Forms/Form_EditTask.cs index 718992f..f1d791f 100644 --- a/EMS_Forms/Form_EditTask.cs +++ b/EMS_Forms/Form_EditTask.cs @@ -119,7 +119,8 @@ String name = Convert.ToString(dr["USERNAME"]); comboBox_userName.Items.Add(name); - } + } + dr.Close(); comboBox_road.Items.Clear(); roadList = new List(); @@ -135,7 +136,7 @@ comboBox_road.Items.Add(name); } } - + dr1.Close(); conn.Close(); bool flag2 = false; @@ -185,7 +186,7 @@ catch (Exception ex) { - MessageBox.Show(ex.ToString()); + LogHelper.WriteLog(typeof(Form_EditTask), ex.Message); } } @@ -288,7 +289,7 @@ } catch (Exception ex) { - MessageBox.Show(ex.ToString()); + LogHelper.WriteLog(typeof(Form_EditTask), ex.Message); } } @@ -474,7 +475,7 @@ } catch (Exception ex) { - MessageBox.Show(ex.ToString()); + LogHelper.WriteLog(typeof(Form_EditTask), ex.Message); } this.Close(); @@ -495,6 +496,7 @@ { numList.Add(Convert.ToInt32(dr["DBID"])); } + dr.Close(); if (numList.Count == 0) { taskNumber = Convert.ToInt32(number) * 100; @@ -674,6 +676,7 @@ } } } + dr.Close(); conn.Close(); } diff --git a/EMS_Forms/Form_EventManager.cs b/EMS_Forms/Form_EventManager.cs index b18c45b..84807b2 100644 --- a/EMS_Forms/Form_EventManager.cs +++ b/EMS_Forms/Form_EventManager.cs @@ -64,6 +64,7 @@ comboBox_name.Items.Add(name); } + dr.Close(); conn.Close(); diff --git a/Forms/FrmMnModify.cs b/Forms/FrmMnModify.cs index 31cfc5f..d036360 100644 --- a/Forms/FrmMnModify.cs +++ b/Forms/FrmMnModify.cs @@ -68,15 +68,7 @@ questionGrid.Rows[idx].Cells[1].Value = sr.question; } } - /// 选中对象 - /// - /// - /// - /// - private void buttonX1_Click(object sender, EventArgs e) - { - globecontrol.Globe.Action = EnumAction3D.SelectObject; - } + /// /// 选中某一行 /// diff --git a/Forms/FrmPipelineModelDataBase.cs b/Forms/FrmPipelineModelDataBase.cs index 2acf0ca..7ce573f 100644 --- a/Forms/FrmPipelineModelDataBase.cs +++ b/Forms/FrmPipelineModelDataBase.cs @@ -35,19 +35,7 @@ ds = _ds; InitializeComponent(); } - /// - /// 单击选择shp格式文件 - /// - /// - /// - private void btnBrowseModel_Click(object sender, EventArgs e) - { - saveFileDialog1.Filter = "*.lgd|*.lgd"; - if (saveFileDialog1.ShowDialog() == DialogResult.OK) - { - txtModelLayer.Text = saveFileDialog1.FileName; - } - } + /// /// 窗体初始化事件处理 /// @@ -100,49 +88,6 @@ } } } - - private object convertFieldValue(string fieldname, object obj) - { - if (obj == null) - return null; - - try - { - string type = fields_types[fieldname].ToString(); - switch (type) - { - case "string": - return obj.ToString(); - case "int": - //return 101; - int intResult; - if (int.TryParse(obj.ToString(), out intResult)) - return intResult; - else - return null; - case "double": - //return 202.5; - double doubleResult; - if (double.TryParse(obj.ToString(), out doubleResult)) - return doubleResult; - else - return null; - case "date": - DateTime dtResult; - if (DateTime.TryParse(obj.ToString(), out dtResult)) - return dtResult; - else - return null; - } - return null; - } - catch (Exception ex) - { - MessageBox.Show(ex.ToString()); - return null; - } - } - public string lgdFilePath = ""; /// /// 选择管线颜色 @@ -610,33 +555,6 @@ { this.Close(); } - - private void cmbLayer_SelectedIndexChanged(object sender, EventArgs e) //选择图层 - { - GSOLayer layer = ctl.Globe.Layers.GetLayerByCaption(selectLayerName); - GSOFeatures features = layer.GetAllFeatures(); - if (features.Length == 0) - return; - - cmbFrom.Items.Clear(); - cmbTo.Items.Clear(); - cmbRadius.Items.Clear(); - cmbID.Items.Clear(); - for (int i = 0; i < features[0].GetFieldCount(); i++) - { - GeoScene.Data.GSOFieldDefn fielddef = (GeoScene.Data.GSOFieldDefn)(features[0].GetFieldDefn(i)); - - cmbFrom.Items.Add(fielddef.Name); - cmbTo.Items.Add(fielddef.Name); - cmbRadius.Items.Add(fielddef.Name); - cmbID.Items.Add(fielddef.Name); - } - cmbFrom.SelectedItem = "Deep1"; - cmbTo.SelectedItem = "Deep2"; - cmbRadius.SelectedItem = "Diameter"; - cmbID.SelectedItem = "Handle"; - } - private void buttonXLayerPath_Click(object sender, EventArgs e)//单击 选择shp格式的文件 { OpenFileDialog dlg = new OpenFileDialog(); diff --git a/Forms/FrmPipelineModelDataOneStep.cs b/Forms/FrmPipelineModelDataOneStep.cs index 18afda7..ec93b8a 100644 --- a/Forms/FrmPipelineModelDataOneStep.cs +++ b/Forms/FrmPipelineModelDataOneStep.cs @@ -38,19 +38,7 @@ layerTree = _layerTree; InitializeComponent(); } - /// - /// 单击选择shp格式文件 - /// - /// - /// - private void btnBrowseModel_Click(object sender, EventArgs e) - { - saveFileDialog1.Filter = "*.lgd|*.lgd"; - if (saveFileDialog1.ShowDialog() == DialogResult.OK) - { - txtModelLayer.Text = saveFileDialog1.FileName; - } - } + /// /// 窗体初始化事件处理 /// @@ -107,48 +95,7 @@ } } - private object convertFieldValue(string fieldname, object obj) - { - if (obj == null) - return null; - - try - { - string type = fields_types[fieldname].ToString(); - switch (type) - { - case "string": - return obj.ToString(); - case "int": - //return 101; - int intResult; - if (int.TryParse(obj.ToString(), out intResult)) - return intResult; - else - return null; - case "double": - //return 202.5; - double doubleResult; - if (double.TryParse(obj.ToString(), out doubleResult)) - return doubleResult; - else - return null; - case "date": - DateTime dtResult; - if (DateTime.TryParse(obj.ToString(), out dtResult)) - return dtResult; - else - return null; - } - return null; - } - catch (Exception ex) - { - MessageBox.Show(ex.ToString()); - return null; - } - } - + public string lgdFilePath = ""; /// /// 选择管线颜色 @@ -673,32 +620,6 @@ return featDs; } - private void cmbLayer_SelectedIndexChanged(object sender, EventArgs e) //选择图层 - { - GSOLayer layer = ctl.Globe.Layers.GetLayerByCaption(selectLayerName); - GSOFeatures features = layer.GetAllFeatures(); - if (features.Length == 0) - return; - - cmbFrom.Items.Clear(); - cmbTo.Items.Clear(); - cmbRadius.Items.Clear(); - cmbID.Items.Clear(); - for (int i = 0; i < features[0].GetFieldCount(); i++) - { - GeoScene.Data.GSOFieldDefn fielddef = (GeoScene.Data.GSOFieldDefn)(features[0].GetFieldDefn(i)); - - cmbFrom.Items.Add(fielddef.Name); - cmbTo.Items.Add(fielddef.Name); - cmbRadius.Items.Add(fielddef.Name); - cmbID.Items.Add(fielddef.Name); - } - cmbFrom.SelectedItem = "Deep1"; - cmbTo.SelectedItem = "Deep2"; - cmbRadius.SelectedItem = "Diameter"; - cmbID.SelectedItem = "Handle"; - } - private void buttonXLayerPath_Click(object sender, EventArgs e)//单击 选择shp格式的文件 { OpenFileDialog dlg = new OpenFileDialog(); @@ -949,38 +870,6 @@ } //txtLayername.Text = type + layername; } - /// - /// 连接数据库 - /// - /// - /// - private void buttonX1_Click(object sender, EventArgs e) - { - if (ds == null) - { - //没连的话,直接连接审核库; //审核库配置读配置文件 - string dbIp = Utility.sgdbip; - string database = Utility.sgdbname; - string user = Utility.sgdbuser; - string pass = Utility.sgdbpwd; - - if (!Utility.isNetworkConnectionSuccess(dbIp.Trim())) - { - MessageBox.Show("网络连接失败!", "提示"); - return; - } - - ds = ctl.Globe.DataManager.OpenOracleDataSource(dbIp + "/" + database, "", "", user, pass); - if (ds == null) - { - MessageBox.Show("数据库连接失败!", "提示", MessageBoxButtons.OK, MessageBoxIcon.Warning); - } - else - { - btnCreateModel.Enabled = true; - } - } - } private void btnClose_Click(object sender, EventArgs e) { diff --git a/Forms/FrmShRK.cs b/Forms/FrmShRK.cs index 0e2e722..f1d83cb 100644 --- a/Forms/FrmShRK.cs +++ b/Forms/FrmShRK.cs @@ -215,6 +215,7 @@ { sourcefeatds = sourcefeat as GSOFeatureDataset; } + if (sourcefeatds == null) return; sourcefeatds.Open(); GSOFeatures sourcefeatures = sourcefeatds.GetAllFeatures(); @@ -251,6 +252,7 @@ { desfeatds = desfeat as GSOFeatureDataset; } + if (desfeatds == null) return; desfeatds.Open(); //向新数据集写入字段 diff --git a/FrmAccessoriesSensor.cs b/FrmAccessoriesSensor.cs index 09fcdf1..2a7a80e 100644 --- a/FrmAccessoriesSensor.cs +++ b/FrmAccessoriesSensor.cs @@ -209,7 +209,7 @@ chart1.Series[0].Points.DataBindXY(dic.Keys, dic.Values); for (int m = 0; m < dic.Values.Count; m++) { - if (chart1.Series[0].Points[m].YValues[0].ToString() != "0") + if (chart1.Series[0].Points[m]!=null&&chart1.Series[0].Points[m].YValues[0].ToString() != "0") { chart1.Series[0].Points[m].Label = chart1.Series[0].Points[m].YValues[0].ToString(); } diff --git a/FrmAccessoriesgather.cs b/FrmAccessoriesgather.cs index 9e331e1..a475d9e 100644 --- a/FrmAccessoriesgather.cs +++ b/FrmAccessoriesgather.cs @@ -338,7 +338,7 @@ chart1.Series[0].Points.DataBindXY(dic.Keys, dic.Values); for (int m = 0; m < dic.Values.Count; m++) { - if (chart1.Series[0].Points[m].YValues[0].ToString() != "0") + if (chart1.Series[0].Points[m]!=null&&chart1.Series[0].Points[m].YValues[0].ToString() != "0") { chart1.Series[0].Points[m].Label = chart1.Series[0].Points[m].YValues[0].ToString(); } diff --git a/FrmAccessoryAnalysis.cs b/FrmAccessoryAnalysis.cs index 71d4579..44d4065 100644 --- a/FrmAccessoryAnalysis.cs +++ b/FrmAccessoryAnalysis.cs @@ -66,39 +66,6 @@ globeControl1.Refresh(); } /// - /// 键盘按键按下事件处理 - /// - /// - /// - private void txtRadius_KeyPress(object sender, KeyPressEventArgs e) - { - TextBox text = sender as TextBox; - if ((e.KeyChar < 48 || e.KeyChar > 57) && (e.KeyChar != 8) && (int)e.KeyChar != 46) - { - e.Handled = true; - } - if ((int)e.KeyChar == 46) //小数点 - { - if (text.Text.Length <= 0) - e.Handled = true; //小数点不能在第一位 - else //处理不规则的小数点 - { - float f; - float oldf; - bool b1 = false, b2 = false; - b1 = float.TryParse(text.Text, out oldf); - b2 = float.TryParse(text.Text + e.KeyChar.ToString(), out f); - if (b2 == false) - { - if (b1 == true) - e.Handled = true; - else - e.Handled = false; - } - } - } - } - /// /// 确定按钮事件处理 /// /// diff --git a/FrmAddValve.cs b/FrmAddValve.cs index 34d2fec..5f405b9 100644 --- a/FrmAddValve.cs +++ b/FrmAddValve.cs @@ -486,56 +486,6 @@ } } - - - - - - - - private void cmbLayer_SelectedIndexChanged(object sender, EventArgs e) - { - GSOLayer layer = globeControl1.Globe.Layers.GetLayerByCaption(selectLayerName); - GSOFeatures features = layer.GetAllFeatures(); - if (features.Length == 0) - return; - - combPath.Items.Clear(); - combZ.Items.Clear(); - combModelName.Items.Clear(); - - for (int i = 0; i < features[0].GetFieldCount(); i++) - { - GeoScene.Data.GSOFieldDefn fielddef = (GeoScene.Data.GSOFieldDefn)(features[0].GetFieldDefn(i)); - combPath.Items.Add(fielddef.Name); - combZ.Items.Add(fielddef.Name); - combModelName.Items.Add(fielddef.Name); - } - combModelName.SelectedItem = "编号"; - combPath.SelectedItem = "模型路径"; - if (combfile.SelectedIndex != -1) - { - - string layerCaption = combfile.SelectedItem.ToString().Trim(); - rukuLayer = globeControl1.Globe.Layers.GetLayerByCaption(layerCaption); - if (rukuLayer != null) - { - combPath.Items.Clear(); - combZ.Items.Clear(); - combModelName.Items.Clear(); - - } - for (int i = 0; i < features[0].GetFieldCount(); i++) - { - GeoScene.Data.GSOFieldDefn fielddef = (GeoScene.Data.GSOFieldDefn)(features[0].GetFieldDefn(i)); - combPath.Items.Add(fielddef.Name); - combZ.Items.Add(fielddef.Name); - combModelName.Items.Add(fielddef.Name); - } - combModelName.SelectedItem = "编号"; - combPath.SelectedItem = "模型路径"; - } - } /// /// 单击选择shp格式文件 /// diff --git a/FrmAddWellShp.cs b/FrmAddWellShp.cs index bb79ec0..a249725 100644 --- a/FrmAddWellShp.cs +++ b/FrmAddWellShp.cs @@ -478,32 +478,6 @@ } } } - - private void cmbLayer_SelectedIndexChanged(object sender, EventArgs e) - { - GSOLayer layer = globeControl1.Globe.Layers.GetLayerByCaption(selectLayerName); - GSOFeatures features = layer.GetAllFeatures(); - if (features.Length == 0) - return; - - combCode.Items.Clear(); - combDeep.Items.Clear(); - combModelName.Items.Clear(); - combAngle.Items.Clear(); - - for (int i = 0; i < features[0].GetFieldCount(); i++) - { - GeoScene.Data.GSOFieldDefn fielddef = (GeoScene.Data.GSOFieldDefn)(features[0].GetFieldDefn(i)); - combCode.Items.Add(fielddef.Name); - combDeep.Items.Add(fielddef.Name); - combModelName.Items.Add(fielddef.Name); - combAngle.Items.Add(fielddef.Name); - } - combCode.SelectedItem = "附属物编码"; - combDeep.SelectedItem = "井深"; - combModelName.SelectedItem = "编号"; - combAngle.SelectedItem = "符号角度"; - } /// /// 单击选择shp格式文件 /// diff --git a/FrmAddYuBiZiShp.cs b/FrmAddYuBiZiShp.cs index b312d51..332f037 100644 --- a/FrmAddYuBiZiShp.cs +++ b/FrmAddYuBiZiShp.cs @@ -383,80 +383,7 @@ } } - private void cmbLayer_SelectedIndexChanged(object sender, EventArgs e) - { - GSOLayer layer = globeControl1.Globe.Layers.GetLayerByCaption(selectLayerName); - GSOFeatures features = layer.GetAllFeatures(); - if (features.Length == 0) - return; - - combCode.Items.Clear(); - combDeep.Items.Clear(); - combModelName.Items.Clear(); - //comboLoad.Items.Clear(); - for (int i = 0; i < features[0].GetFieldCount(); i++) - { - GeoScene.Data.GSOFieldDefn fielddef = (GeoScene.Data.GSOFieldDefn)(features[0].GetFieldDefn(i)); - combCode.Items.Add(fielddef.Name); - combDeep.Items.Add(fielddef.Name); - combModelName.Items.Add(fielddef.Name); - //comboLoad.Items.Add(fielddef.Name); - } - combCode.SelectedItem = "附属物编码"; - combDeep.SelectedItem = "Z坐标"; - combModelName.SelectedItem = "编号"; - //comboLoad.SelectedItem = "模型路径"; - } - - private void buttonXLayerPath_Click(object sender, EventArgs e) - { - OpenFileDialog dlg = new OpenFileDialog(); - dlg.Filter = "*.shp|*.shp"; - dlg.Multiselect = false; - if (dlg.ShowDialog() == DialogResult.OK) - { - GSOLayer layer = globeControl1.Globe.Layers.Add(dlg.FileName); - string txtMessage = valiYBdata(layer); - if (txtMessage != "") - { - button3.Enabled = false; - //textBoxLayer.Text = ""; - combCode.Items.Clear(); - combDeep.Items.Clear(); - combModelName.Items.Clear(); - globeControl1.Globe.Layers.Remove(layer); - FrmValiDataShowErrorMessage showErrorMessage = new FrmValiDataShowErrorMessage(dlg.FileName, txtMessage); - showErrorMessage.ShowDialog(); - return; - } - else - { - button3.Enabled = true; - //textBoxLayer.Text = dlg.FileName; - selectLayerName = layer.Caption; - txtLayerName.Text = layer.Caption; - GSOFeatures features = layer.GetAllFeatures(); - if (features.Length == 0) - return; - - combCode.Items.Clear(); - combDeep.Items.Clear(); - combModelName.Items.Clear(); - for (int i = 0; i < features[0].GetFieldCount(); i++) - { - GeoScene.Data.GSOFieldDefn fielddef = (GeoScene.Data.GSOFieldDefn)(features[0].GetFieldDefn(i)); - combCode.Items.Add(fielddef.Name); - combDeep.Items.Add(fielddef.Name); - combModelName.Items.Add(fielddef.Name); - //comboLoad.Items.Add(fielddef.Name); - } - combCode.SelectedItem = "管点编码"; - combDeep.SelectedItem = "Z坐标"; - combModelName.SelectedItem = "编号"; - } - } - } - + private void FrmAddYuBiZiShp_FormClosing(object sender, FormClosingEventArgs e) { globeControl1.Globe.Refresh(); diff --git a/FrmAllPipelineStatis.cs b/FrmAllPipelineStatis.cs index 6421a26..a6eea29 100644 --- a/FrmAllPipelineStatis.cs +++ b/FrmAllPipelineStatis.cs @@ -84,7 +84,7 @@ chartAllAreaPipeline.Series["管线"].Points.DataBindXY(pipelineLengthAndType.Keys, pipelineLengthAndType.Values); for (int m = 0; m < pipelineLengthAndType.Values.Count; m++) { - if (chartAllAreaPipeline.Series["管线"].Points[m].YValues[0].ToString() != "0") + if (chartAllAreaPipeline.Series["管线"].Points[m]!=null&&chartAllAreaPipeline.Series["管线"].Points[m].YValues[0].ToString() != "0") { chartAllAreaPipeline.Series["管线"].Points[m].Label = chartAllAreaPipeline.Series[0].Points[m].YValues[0].ToString(); } @@ -94,7 +94,7 @@ } catch (Exception ex) { - //LogError.PublishError(ex); + LogHelper.WriteLog(typeof(FrmAllPipelineStatis), ex.Message); } } @@ -147,7 +147,7 @@ } DataTable dt = OledbHelper.QueryTable(sql); - if (dt != null && dt.Rows.Count > 0) + if (dt != null && dt.Rows.Count > 0 && chartAllAreaPipeline.Series["管线"].Points[indexHit]!=null) { dataGridViewX1.DataSource = dt; panel.Visible = true; diff --git a/FrmAllWorkWellStatis.cs b/FrmAllWorkWellStatis.cs index 6fec7af..6af8e4c 100644 --- a/FrmAllWorkWellStatis.cs +++ b/FrmAllWorkWellStatis.cs @@ -52,7 +52,7 @@ chartAllAreaPipeline.Series["井盖"].Points.DataBindXY(workWellLengthAndType.Keys, workWellLengthAndType.Values); for (int m = 0; m < workWellLengthAndType.Values.Count; m++) { - if (chartAllAreaPipeline.Series["井盖"].Points[m].YValues[0].ToString().Trim() != "0") + if (chartAllAreaPipeline.Series["井盖"].Points[m]!=null&&chartAllAreaPipeline.Series["井盖"].Points[m].YValues[0].ToString().Trim() != "0") { chartAllAreaPipeline.Series["井盖"].Points[m].Label = chartAllAreaPipeline.Series[0].Points[m].YValues[0].ToString(); } @@ -60,7 +60,7 @@ } catch (Exception ex) { - //LogError.PublishError(ex); + LogHelper.WriteLog(typeof(FrmAllWorkWellStatis), ex.Message); } } diff --git a/FrmBSQDuoBianXingStatis.cs b/FrmBSQDuoBianXingStatis.cs index e8b7d52..3e889b6 100644 --- a/FrmBSQDuoBianXingStatis.cs +++ b/FrmBSQDuoBianXingStatis.cs @@ -60,7 +60,7 @@ { for (int m = 0; m < bsq1.Values.Count; m++) { - if (chart1.Series["标识器"].Points[m].YValues[0].ToString() != "0") + if (chart1.Series["标识器"].Points[m]!=null&&chart1.Series["标识器"].Points[m].YValues[0].ToString() != "0") { count += Convert.ToInt16(chart1.Series[0].Points[m].YValues[0].ToString()); chart1.Series["标识器"].Points[m].Label = chart1.Series[0].Points[m].YValues[0].ToString(); diff --git a/FrmBSQDuoBianXingStreet.cs b/FrmBSQDuoBianXingStreet.cs index 2005ebb..1db5777 100644 --- a/FrmBSQDuoBianXingStreet.cs +++ b/FrmBSQDuoBianXingStreet.cs @@ -63,7 +63,7 @@ chartStatis.Series[0].Points.DataBindXY(bsq.Keys, bsq.Values); for (int m = 0; m < bsq.Values.Count; m++) { - if (chartStatis.Series[0].Points[m].YValues[0].ToString().Trim() != "0") + if (chartStatis.Series[0].Points[m]!=null&&chartStatis.Series[0].Points[m].YValues[0].ToString().Trim() != "0") { count += Convert.ToInt16(chartStatis.Series[0].Points[m].YValues[0].ToString()); chartStatis.Series[0].Points[m].Label = chartStatis.Series[0].Points[m].YValues[0].ToString(); diff --git a/FrmBSQStatis.cs b/FrmBSQStatis.cs index 390a55c..4aa0ee6 100644 --- a/FrmBSQStatis.cs +++ b/FrmBSQStatis.cs @@ -95,6 +95,8 @@ } } } + + dr.Close(); conn.Close(); for (int i = 0; i < typeLists.Count; i++) { @@ -123,7 +125,7 @@ chartStatis.Series[0].Points.DataBindXY(bsq.Keys, bsq.Values); for (int m = 0; m < bsq.Values.Count; m++) { - if (chartStatis.Series[0].Points[m].YValues[0].ToString().Trim() != "0") + if (chartStatis.Series[0].Points[m]!=null&&chartStatis.Series[0].Points[m].YValues[0].ToString().Trim() != "0") { //count += Convert.ToInt16(chartStatis.Series[0].Points[m].YValues[0].ToString()); chartStatis.Series[0].Points[m].Label = chartStatis.Series[0].Points[m].YValues[0].ToString(); diff --git a/FrmBSQStreet.cs b/FrmBSQStreet.cs index 9d88adb..7fbacad 100644 --- a/FrmBSQStreet.cs +++ b/FrmBSQStreet.cs @@ -44,7 +44,7 @@ chartStatis.Series[0].Points.DataBindXY(bsq.Keys, bsq.Values); for (int m = 0; m < bsq.Values.Count; m++) { - if (chartStatis.Series[0].Points[m].YValues[0].ToString().Trim() != "0") + if (chartStatis.Series[0].Points[m]!=null&&chartStatis.Series[0].Points[m].YValues[0].ToString().Trim() != "0") { count += Convert.ToInt16(chartStatis.Series[0].Points[m].YValues[0].ToString()); chartStatis.Series[0].Points[m].Label = chartStatis.Series[0].Points[m].YValues[0].ToString(); diff --git a/FrmBoosterValvers.cs b/FrmBoosterValvers.cs index 5061efc..df9b62b 100644 --- a/FrmBoosterValvers.cs +++ b/FrmBoosterValvers.cs @@ -236,199 +236,6 @@ count = 0; } } - /// - /// 添加火苗 - /// - /// - /// - /// - /// - private GSOFeature AddFire(double x,double y,double z) - { - // 烟火示例 - - string strResPath = Application.StartupPath + "/Resource"; - - // 烟火粒子示例,由三个发射器构成 - GSOGeoParticle geoParticle = new GSOGeoParticle(); - geoParticle.SetPosition(x, y, z); // 添加到这个经纬度位置 - geoParticle.AltitudeMode = EnumAltitudeMode.RelativeToGround; - - GSORingParticleEmitter emitter = new GSORingParticleEmitter(); - emitter.TexturePath = strResPath + "/ParticleImage/flare.png"; - - emitter.SetSizeFix(1, 1); - emitter.VelFix = 1; - emitter.VelRnd = 5; - - emitter.AngleXYFix = 0; - emitter.AngleXYRnd = 180; - - emitter.AngleXZFix = 90; - emitter.AngleXZRnd = 0; - - emitter.LifeFix = 0.5f; - emitter.LifeRnd = 0.0f; - - emitter.RotFix = 0; - emitter.RotRnd = 0; - - emitter.RotVelFix = 0; - emitter.RotVelRnd = 0; - - emitter.EmitPerSec = 100; - - // 采用线性插值生成粒子的初始颜色 - emitter.ColorRndStart = Color.White; - emitter.ColorRndEnd = Color.Red; - - - GSOColorParticleEffector effector2 = new GSOColorParticleEffector(); - effector2.SetColorChanged(0, -1, -1, 0); - effector2.StartTime = 0.0f; - effector2.EndTime = -1.0f; - emitter.AddEffector(effector2); - - // 将三个发射器添加到粒子对象中 - geoParticle.AddEmitter(emitter); - - geoParticle.Play(); - - GSOFeature feature = new GSOFeature(); - - feature.Geometry = geoParticle; - - globeControl1.Globe.MemoryLayer.AddFeature(feature); - - - return feature; - } - - /// - /// 添加喷泉 - /// - /// - private GSOFeature AddFountain() - { - string strResPath = Application.StartupPath + "/Resource"; - - GSOGeoParticle geoParticle = new GSOGeoParticle(); - geoParticle.SetPosition(116.314, 39.84, 0); // 添加到这个经纬度位置 - - GSOPointParticleEmitter emitter = new GSOPointParticleEmitter(); - emitter.TexturePath = strResPath + "/ParticleImage/test.png"; - - emitter.SetSizeFix(0.5f, 2); - emitter.VelFix = 10; - emitter.VelRnd = 2; - - emitter.GravityAcc = 9.8f; - emitter.AngleXYFix = 0; - emitter.AngleXYRnd = 180; - - emitter.AngleXZFix = 88; - emitter.AngleXZRnd = 2; - - //emitter.InnerRadius = 0; - // emitter.OuterRadius = 0.03f; - - emitter.LifeFix = 5.0f; - emitter.LifeRnd = 1.0f; - - emitter.RotFix = 0; - emitter.RotRnd = 0; - - emitter.RotVelFix = 0; - emitter.RotVelRnd = 0; - - emitter.EmitPerSec = 1000; - emitter.ColorRndStart = Color.FromArgb(33, 255, 255, 255); - emitter.ColorRndEnd = Color.FromArgb(11, 255, 255, 255); - emitter.IsLumAdded = false; - - // 将三个发射器添加到粒子对象中 - geoParticle.AddEmitter(emitter); - - geoParticle.Play(); - GSOFeature feature = new GSOFeature(); - - feature.Geometry = geoParticle; - - //globeControl1.Globe.MemoryLayer.AddFeature(feature); - globeControl1.Globe.FlyToFeature(feature); - - return feature; - } - - /// - /// 添加水柱 - /// - /// - private GSOFeature AddWaterLine() - { - string strResPath = Application.StartupPath + "/Resource"; - - GSOGeoParticle geoParticle = new GSOGeoParticle(); - geoParticle.SetPosition(116.308, 39.84, 0); // 添加到这个经纬度位置 - - GSOPointParticleEmitter emitter = new GSOPointParticleEmitter(); - - emitter.TexturePath = strResPath + "/ParticleImage/drop3.png"; - - geoParticle.TimerInterval = 1; - - emitter.SetSizeFix(2.0f, 2.0f); - - emitter.VelFix = 50; - emitter.VelRnd = 2; - - // emitter.IsLumAdded = false; - - emitter.GravityAcc = 9.8f; - emitter.AngleXYFix = 0; - emitter.AngleXYRnd = 2; - - emitter.AngleXZFix = 60; - emitter.AngleXZRnd = 2; - - //emitter.InnerRadius = 0; - // emitter.OuterRadius = 0.1f; - - emitter.LifeFix = 5.0f; - emitter.LifeRnd = 1.0f; - - emitter.RotFix = 0; - emitter.RotRnd = 0; - - emitter.RotVelFix = 0; - emitter.RotVelRnd = 0; - - emitter.EmitPerSec = 1500; - - emitter.ColorRndStart = Color.FromArgb(100, 222, 222, 222); - emitter.ColorRndEnd = Color.FromArgb(50, 222, 222, 222); - - /* - - GSOScaleParticleEffector effector1 = new GSOScaleParticleEffector(); - effector1.SetScale(0.2f, 0.2f); - effector1.StartTime = 0; - effector1.EndTime = -1; // 负数表示整个粒子生命结束 - emitter.AddEffector(effector1); - */ - - // 将三个发射器添加到粒子对象中 - geoParticle.AddEmitter(emitter); - - geoParticle.Play(); - GSOFeature feature = new GSOFeature(); - - feature.Geometry = geoParticle; - - //globeControl1.Globe.MemoryLayer.AddFeature(feature); - globeControl1.Globe.FlyToFeature(feature); - - return feature; - } + } } diff --git a/FrmBufferAnalysis.cs b/FrmBufferAnalysis.cs index f711133..db8ca59 100644 --- a/FrmBufferAnalysis.cs +++ b/FrmBufferAnalysis.cs @@ -123,39 +123,6 @@ } } /// - /// 半径文本框的键盘按键按下事件处理 - /// - /// - /// - private void txtRadius_KeyPress(object sender, KeyPressEventArgs e) - { - TextBox text = sender as TextBox; - if ((e.KeyChar < 48 || e.KeyChar > 57) && (e.KeyChar != 8) && (int)e.KeyChar != 46) - { - e.Handled = true; - } - if ((int)e.KeyChar == 46) //小数点 - { - if (text.Text.Length <= 0) - e.Handled = true; //小数点不能在第一位 - else //处理不规则的小数点 - { - float f; - float oldf; - bool b1 = false, b2 = false; - b1 = float.TryParse(text.Text, out oldf); - b2 = float.TryParse(text.Text + e.KeyChar.ToString(), out f); - if (b2 == false) - { - if (b1 == true) - e.Handled = true; - else - e.Handled = false; - } - } - } - } - /// /// 窗体关闭事件处理 /// /// diff --git a/FrmBufferAnalysisBSQ.cs b/FrmBufferAnalysisBSQ.cs index 24a96ca..f54208f 100644 --- a/FrmBufferAnalysisBSQ.cs +++ b/FrmBufferAnalysisBSQ.cs @@ -137,35 +137,7 @@ } } - private void txtRadius_KeyPress(object sender, KeyPressEventArgs e) - { - TextBox text = sender as TextBox; - if ((e.KeyChar < 48 || e.KeyChar > 57) && (e.KeyChar != 8) && (int)e.KeyChar != 46) - { - e.Handled = true; - } - if ((int)e.KeyChar == 46) //小数点 - { - if (text.Text.Length <= 0) - e.Handled = true; //小数点不能在第一位 - else //处理不规则的小数点 - { - float f; - float oldf; - bool b1 = false, b2 = false; - b1 = float.TryParse(text.Text, out oldf); - b2 = float.TryParse(text.Text + e.KeyChar.ToString(), out f); - if (b2 == false) - { - if (b1 == true) - e.Handled = true; - else - e.Handled = false; - } - } - } - } - + private void FrmBufferAnalysis_FormClosing(object sender, FormClosingEventArgs e) { //Form1.y = 0; @@ -316,27 +288,6 @@ } } - private void FlyToMenu_Click(object sender, EventArgs e) - { - if (m_feature != null) - { - if (m_feature.Geometry != null && m_feature.Geometry.Type == EnumGeometryType.GeoPolyline3D) - { - GSOGeoPolyline3D line = m_feature.Geometry as GSOGeoPolyline3D; - double length = line.GetSpaceLength(true, 6378137); - GSOGeoPolyline3D lineLine = line.GetSegment(0, length / 2); - GSOPoint3d point3d = lineLine[lineLine.PartCount - 1][lineLine[lineLine.PartCount - 1].Count - 1]; - - globeControl1.Globe.FlyToPosition(point3d, EnumAltitudeMode.Absolute, 0, 45, 5); - } - else - { - globeControl1.Globe.FlyToFeature(m_feature, 0, 45, 3); - } - LightMenu_Click(sender, e); - } - } - private void LightMenu_Click(object sender, EventArgs e) { flashflag = "single"; diff --git a/FrmDataBaseOpt.cs b/FrmDataBaseOpt.cs index b0c4b5d..8d7b69d 100644 --- a/FrmDataBaseOpt.cs +++ b/FrmDataBaseOpt.cs @@ -362,6 +362,7 @@ dbCombor.Items.Add(dblist[i].title); } } + /* /// /// 从配置文件读取数据库参数配置 /// @@ -428,6 +429,8 @@ } } + * */ + /* /// /// 向配置文件写入连接数据库的参数配置 /// @@ -485,6 +488,7 @@ MessageBox.Show(exp.ToString()); } } + * */ /// /// /// diff --git a/FrmDatabaseParaSetting.cs b/FrmDatabaseParaSetting.cs index a6fea46..63b596b 100644 --- a/FrmDatabaseParaSetting.cs +++ b/FrmDatabaseParaSetting.cs @@ -152,6 +152,7 @@ this.DialogResult = DialogResult.OK; this.Close(); } + /* /// /// 从配置文件读取数据库连接参数配置 /// @@ -218,6 +219,8 @@ } } + * */ + /* /// /// 向配置文件写入数据库参数配置 /// @@ -276,7 +279,7 @@ MessageBox.Show(ex.ToString()); } } - + */ /// /// 取消按钮事件处理 /// diff --git a/FrmDatabaseParaSetting2.cs b/FrmDatabaseParaSetting2.cs index 932d05e..96a87d5 100644 --- a/FrmDatabaseParaSetting2.cs +++ b/FrmDatabaseParaSetting2.cs @@ -148,6 +148,7 @@ this.DialogResult = DialogResult.OK; this.Close(); } + /* /// /// 从配置文件读取数据库连接参数配置 /// @@ -214,6 +215,8 @@ } } + * */ + /* /// /// 向配置文件写入数据库参数配置 /// @@ -272,7 +275,7 @@ MessageBox.Show(exp.ToString()); } } - + */ /// /// 取消按钮事件处理 /// diff --git a/FrmDiameterQuery.cs b/FrmDiameterQuery.cs index 68c948b..9a5215b 100644 --- a/FrmDiameterQuery.cs +++ b/FrmDiameterQuery.cs @@ -77,18 +77,7 @@ isBetween = true; } } - /// - /// 键盘按键按下事件处理 - /// - /// - /// - private void textBoxX1_KeyPress(object sender, KeyPressEventArgs e) - { - if ((e.KeyChar < 48 || e.KeyChar > 57) && e.KeyChar != 8) - { - e.Handled = true;//屏蔽 - } - } + bool isBetween = false; /// diff --git a/FrmDocumentEdit.cs b/FrmDocumentEdit.cs index aab2d31..e78a7ff 100644 --- a/FrmDocumentEdit.cs +++ b/FrmDocumentEdit.cs @@ -256,121 +256,6 @@ } - // - /// 将本地文件上传到指定的服务器(HttpWebRequest方法) - /// - /// 文件上传到的服务器 - /// 要上传的本地文件(全路径) - /// 文件上传后的名称 - /// 上传进度条 - /// 成功返回1,失败返回0 - private int Upload_Request(string address, string fileNamePath, string saveName, ProgressBar progressBar) - { - int returnValue = 0; - // 要上传的文件 - FileStream fs = new FileStream(fileNamePath, FileMode.Open, FileAccess.Read); - BinaryReader r = new BinaryReader(fs); - //时间戳 - string strBoundary = "----------" + DateTime.Now.Ticks.ToString("x"); - byte[] boundaryBytes = Encoding.ASCII.GetBytes("/r/n--" + strBoundary + "/r/n"); - //请求头部信息 - StringBuilder sb = new StringBuilder(); - sb.Append("--"); - sb.Append(strBoundary); - sb.Append("\r\n"); - sb.Append("Content-Disposition: form-data; name=\""); - sb.Append("file"); - sb.Append("\"; filename=\""); - sb.Append(saveName); - sb.Append("\""); - sb.Append("\r\n"); - sb.Append("Content-Type: "); - sb.Append("application/octet-stream"); - sb.Append("\r\n"); - sb.Append("\r\n"); - string strPostHeader = sb.ToString(); - byte[] postHeaderBytes = Encoding.UTF8.GetBytes(strPostHeader); - // 根据uri创建HttpWebRequest对象 - HttpWebRequest httpReq = (HttpWebRequest)WebRequest.Create(new Uri(address)); - httpReq.Method = "POST"; - //对发送的数据不使用缓存 - httpReq.AllowWriteStreamBuffering = false; - //设置获得响应的超时时间(300秒) - httpReq.Timeout = 300000; - httpReq.ContentType = "multipart/form-data; boundary=" + strBoundary; - long length = fs.Length + postHeaderBytes.Length + boundaryBytes.Length; - long fileLength = fs.Length; - httpReq.ContentLength = length; - try - { - progressBar.Maximum = int.MaxValue; - progressBar.Minimum = 0; - progressBar.Value = 0; - //每次上传4k - int bufferLength = 4096; - byte[] buffer = new byte[bufferLength]; - //已上传的字节数 - long offset = 0; - //开始上传时间 - DateTime startTime = DateTime.Now; - int size = r.Read(buffer, 0, bufferLength); - Stream postStream = httpReq.GetRequestStream(); - //发送请求头部消息 - postStream.Write(postHeaderBytes, 0, postHeaderBytes.Length); - while (size > 0) - { - postStream.Write(buffer, 0, size); - offset += size; - progressBar.Value = (int)(offset * (int.MaxValue / length)); - TimeSpan span = DateTime.Now - startTime; - double second = span.TotalSeconds; - //lblTime.Text = "已用时:" + second.ToString("F2") + "秒"; - //if (second > 0.001) - //{ - // lblSpeed.Text = " 平均速度:" + (offset / 1024 / second).ToString("0.00") + "KB/秒"; - //} - //else - //{ - // lblSpeed.Text = " 正在连接…"; - //} - //lblState.Text = "已上传:" + (offset * 100.0 / length).ToString("F2") + "%"; - //lblSize.Text = (offset / 1048576.0).ToString("F2") + "M/" + (fileLength / 1048576.0).ToString("F2") + "M"; - Application.DoEvents(); - size = r.Read(buffer, 0, bufferLength); - } - //添加尾部的时间戳 - postStream.Write(boundaryBytes, 0, boundaryBytes.Length); - postStream.Close(); - //获取服务器端的响应 - WebResponse webRespon = httpReq.GetResponse(); - Stream s = webRespon.GetResponseStream(); - StreamReader sr = new StreamReader(s); - //读取服务器端返回的消息 - String sReturnString = sr.ReadLine(); - s.Close(); - sr.Close(); - if (sReturnString == "Success") - { - returnValue = 1; - } - else if (sReturnString == "Error") - { - returnValue = 0; - } - } - catch(Exception ex) - { - returnValue = 0; - string str = ex.ToString(); - } - finally - { - fs.Close(); - r.Close(); - } - return returnValue; - } - private void btn_file_Click(object sender, EventArgs e) { OpenFileDialog dlg = new OpenFileDialog(); diff --git a/FrmExportCADS.cs b/FrmExportCADS.cs index 98772ea..59629dd 100644 --- a/FrmExportCADS.cs +++ b/FrmExportCADS.cs @@ -108,65 +108,6 @@ MessageBox.Show("请选中要导出的图层!", "提示", MessageBoxButtons.OK, MessageBoxIcon.Warning); } } - private Boolean MerageToFile(GSOFeatures features, String strDestFile, String strProj4)//图层追加 - { - if (features == null) - { - return false; - } - Boolean bSuccess = false; - - string strDir = GSOUtility.GetFileDir(strDestFile); - string strLPRJFile = GSOUtility.ChangeExt(strDestFile, ".lprj"); - string strExt = GSOUtility.GetFileExt(strDestFile); - - // 如果投影文件存在,投影以投影文件为准 - if (File.Exists(strLPRJFile)) - { - // 如果是dxf,则这样处理 - if (strExt.ToLower() == ".dxf") - { - string strTempSrcFile = strDir + "srcFeatures_dxftmp" + strExt; - globeControl1.Globe.DataManager.SaveFeatureData(features, strTempSrcFile, strLPRJFile, 4); - bSuccess = GSOUtility.MergeTwoDXFFileFeatures(strDestFile, strTempSrcFile); - File.Delete(strTempSrcFile); - } - else - { - GSOFeatures srcFeatures = globeControl1.Globe.DataManager.ReadFeatureData(strDestFile); - int nCount = features.Length; - int i = 0; - for (i = 0; i < nCount; i++) - { - srcFeatures.Add(features[i]); - } - bSuccess = globeControl1.Globe.DataManager.SaveFeatureData(srcFeatures, strDestFile, strLPRJFile, 4); - } - } - else - { - // 如果是dxf,则这样处理 - if (strExt.ToLower() == ".dxf") - { - string strTempSrcFile = strDir + "srcFeatures_dxftmp" + strExt; - globeControl1.Globe.DataManager.SaveFeatureData(features, strTempSrcFile, strProj4, 0); - bSuccess = GSOUtility.MergeTwoDXFFileFeatures(strDestFile, strTempSrcFile); - File.Delete(strTempSrcFile); - } - else - { - GSOFeatures srcFeatures = globeControl1.Globe.DataManager.ReadFeatureData(strDestFile); - int nCount = features.Length; - int i = 0; - for (i = 0; i < nCount; i++) - { - srcFeatures.Add(features[i]); - } - bSuccess = globeControl1.Globe.DataManager.SaveFeatureData(srcFeatures, strDestFile, strProj4, 0); - } - } - return bSuccess; - } /// /// 关闭按钮事件处理 /// diff --git a/FrmHDMAnalysis3.cs b/FrmHDMAnalysis3.cs index 4f73af6..2ada735 100644 --- a/FrmHDMAnalysis3.cs +++ b/FrmHDMAnalysis3.cs @@ -436,29 +436,6 @@ } layerTemp.RemoveAllFeature(); } - private void Export(GSOPoint3d _pnt, double r) - { - GSOPoint3ds pnts = new GSOPoint3ds(); - GSOPoint3d pnt = new GSOPoint3d(); - pnt.X = _pnt.X; - pnt.Y = _pnt.Y; - pnt.Z = _pnt.Z; - pnts.Add(pnt); - pnt.X = _pnt.X; - pnt.Y = _pnt.Y - 0.0000000005; - pnt.Z = _pnt.Z; - pnts.Add(pnt); - GSOGeoPolyline3D line = new GSOGeoPolyline3D(); - line.AddPart(pnts); - GSOGeoPolygon3D polygon = line.CreateBuffer(r * 2, true, 5, true, false); - GSOPoint3ds points = polygon[0]; - GSOGeoPolyline3D newLine = new GSOGeoPolyline3D(); - newLine.AddPart(points); - newLine.AltitudeMode = EnumAltitudeMode.RelativeToGround; - GSOFeature newFeature = new GSOFeature(); - newFeature.Geometry = newLine; - globeControl1.Globe.MemoryLayer.AddFeature(newFeature); - } private void ExportCAD(double a, double b, double r) { diff --git a/FrmHotFuncStat.cs b/FrmHotFuncStat.cs index c980f34..2eb1476 100644 --- a/FrmHotFuncStat.cs +++ b/FrmHotFuncStat.cs @@ -421,13 +421,6 @@ } } - private void HFS_Pderive_Click(object sender, EventArgs e) - { - if (TV_Files.SelectedNode != null) - { - HFSClass.GuideEdit_form("G", TV_Files, int.Parse(((ToolStripMenuItem)sender).Tag.ToString())); - } - } private void 导入ToolStripMenuItem_Click(object sender, EventArgs e) { @@ -530,22 +523,8 @@ } } - private void 导出ToolStripMenuItem1_Click(object sender, EventArgs e) - { - 导出ToolStripMenuItem2_Click(sender, e); - } + - private void TV_HFSSrchRslt_AfterCollapse(object sender, TreeViewEventArgs e) - { - e.Node.ImageIndex = 0; - } - - private void TV_HFSSrchRslt_AfterExpand(object sender, TreeViewEventArgs e) - { - HFSClass.ADD_TreeNode(TV_Files, e.Node); - e.Node.ImageIndex = 1; - } - private void 导出ToolStripMenuItem1_Click_1(object sender, EventArgs e) { if ((TV_HFSSrchRslt.SelectedNode != null) && (TV_HFSSrchRslt.SelectedNode.Parent != null)) diff --git a/FrmLayerControl.cs b/FrmLayerControl.cs index e7917c3..28fa14d 100644 --- a/FrmLayerControl.cs +++ b/FrmLayerControl.cs @@ -312,26 +312,7 @@ layerManagerNode.Expand(); terrainManagerNode.Expand(); } - /// - /// 刷新节点树 - /// - private void RefreshDataTree() - { - layerTree2.Nodes[0].Nodes.Clear(); - Int32 nCount = globeControl2.Globe.Layers.Count; - Int32 i = 0; - for (i = 0; i < nCount; i++) - { - GSODataset dataSpace = globeControl2.Globe.Layers[i].Dataset; - TreeNode node = new TreeNode(); - node.Text = dataSpace.Name; - node.ImageIndex = 0; - node.SelectedImageIndex = 0; - node.Checked = true; - node.Tag = dataSpace; - layerTree2.Nodes[0].Nodes.Add(node); - } - } + /// /// 目标图层按钮事件处理 /// @@ -494,22 +475,8 @@ } } } - /// - /// 改变指定节点的选中状态 - /// - /// - /// - private void CheckTreeNode(TreeNode node, Boolean bChecked) - { - CheckChildTreeNode(node, bChecked); - // 对于kml图层,如果当前处理的节点是true,那么要把所有的祖宗节点置为true - // 只有所有节点都未false,那么这个节点才为false - // CheckFatherTreeNode(node, bChecked); - globeControl1.Globe.Refresh(); - globeControl2.Globe.Refresh(); - - } + private void CheckChildTreeNode(TreeNode node, Boolean bChecked) { if (node == null) @@ -696,59 +663,7 @@ //} //CheckControl(e); } - /// - /// 树节点选中方法 - /// - /// - private void CheckControl(TreeViewEventArgs e) - { - if (e.Action != TreeViewAction.Unknown) - { - if (e.Node != null && !Convert.IsDBNull(e.Node)) - { - CheckParentNode(e.Node); - if (e.Node.Nodes.Count > 0) - { - CheckAllChildNodes(e.Node, e.Node.Checked); - } - } - } - } - /// - /// 改变所有子节点的状态 - /// - /// - /// - private void CheckAllChildNodes(TreeNode pn, bool IsChecked) - { - foreach (TreeNode tn in pn.Nodes) - { - tn.Checked = IsChecked; - if (tn.Tag.ToString().Contains("|")) - { - string nodeTag = tn.Tag.ToString().Split('|')[1]; - GSOLayer layer = globeControl1.Globe.Layers.GetLayerByCaption(nodeTag); - if (layer != null) - { - layer.Visible = IsChecked; - globeControl1.Globe.Refresh(); - } - } - if (tn.Tag is GSOFeature) - { - if (tn.Nodes.Count == 0) - { - GSOFeature feat = tn.Tag as GSOFeature; - feat.Visible = IsChecked; - globeControl1.Globe.Refresh(); - } - } - if (tn.Nodes.Count > 0) - { - CheckAllChildNodes(tn, IsChecked); - } - } - } + /// /// 改变父节点的选中状态,此处为所有子节点不选中时才取消父节点选中,可以根据需要修改 /// diff --git a/FrmLogin.cs b/FrmLogin.cs index 320fdd5..2afe46e 100644 --- a/FrmLogin.cs +++ b/FrmLogin.cs @@ -59,70 +59,6 @@ textBoxPassWord.Clear(); } } - - /// - /// 验证端口号 - /// - /// - private bool ValiPort() - { - Ping p = new Ping();//创建Ping对象p - PingReply pr = p.Send(Utility.localicenseserverip);//向指定IP或者主机名的计算机发送ICMP协议的ping数据包 - if (pr.Status == IPStatus.Success)//如果ping成功 - { - try - { - TcpClient tcpc = new TcpClient(Utility.localicenseserverip, Utility.localicenseserverport);//对IP地址为"192.168.0.105"的计算机的1500端口提出连接申请 - tcpc.Close(); - return true; - } - catch (Exception ex) - { - MessageBox.Show("端口连接错误!" + ex.Message); - return false; - } - } - else - { - int times = 0;//重新连接次数; - int count = 2;//设置尝试次数 - while (times < count) - { - //Thread.Sleep(1000);//等待时间(方便测试的话,你可以改为1000) - pr = p.Send(Utility.localicenseserverip); - - if (pr.Status == IPStatus.Success) - { - try - { - TcpClient tcpc = new TcpClient(Utility.localicenseserverip, Utility.localicenseserverport);//对IP地址为"192.168.0.105"的计算机的1500端口提出连接申请 - tcpc.Close(); - return true; - } - catch (Exception ex) - { - MessageBox.Show("端口连接错误!" + ex.Message); - return false; - } - } - else - { - times++; - if (times < count) - { - continue; - } - else - { - MessageBox.Show("重新尝试连接失败"); - return false; - } - } - - } - return false; - } - } /// /// 验证用户名、密码 /// diff --git a/FrmMetadata.cs b/FrmMetadata.cs index 886f65a..0365372 100644 --- a/FrmMetadata.cs +++ b/FrmMetadata.cs @@ -27,11 +27,7 @@ InitializeComponent(); loadTreeView(layerTree); } - private void FrmMetadata_Load(object sender, EventArgs e) - { - //this.ntLblC.Text = "nn"; - // loadTreeView(layerTree); - } + private void loadTreeView(TreeView tv)//构建图层树 { try diff --git a/FrmMetadataStat.cs b/FrmMetadataStat.cs index 790658a..e7696c6 100644 --- a/FrmMetadataStat.cs +++ b/FrmMetadataStat.cs @@ -197,9 +197,5 @@ } } - private void buttonX1_Click(object sender, EventArgs e) - { - drawChart(); - } } } diff --git a/FrmPatrolerManager.cs b/FrmPatrolerManager.cs index 37f8ffd..9e66aeb 100644 --- a/FrmPatrolerManager.cs +++ b/FrmPatrolerManager.cs @@ -109,82 +109,8 @@ this.winGridViewPager1.AllToExport = table; } - /// - /// 编辑 - /// - /// - /// - private void winGridViewPager1_OnEditSelected(object sender, EventArgs e) - { - - DataGridView grid = sender as DataGridView; - if (grid != null && grid.SelectedRows.Count>0) - { - DataGridViewRow row = grid.SelectedRows[0]; - try - { - long dbid = long.Parse(row.Cells["编号"].Value.ToString()); - String name = row.Cells["姓名"].Value.ToString(); - String sex = row.Cells["性别"].Value.ToString(); - String age = row.Cells["年龄"].Value.ToString(); - string phone = row.Cells["电话"].Value.ToString(); - age = String.IsNullOrEmpty(age.ToString().Trim()) ? "1" : age.ToString().Trim(); - FrmPatrolerEdit frm = new FrmPatrolerEdit(dbid.ToString(), name, age, sex, phone); - frm.reloadGrid += new ReloadPatrolerGrid(LoadData); - frm.ShowDialog(); - winGridViewPager1.Refresh(); - } - catch (Exception ex) - { - MessageBox.Show("编辑失败:" + ex.ToString(), "错误", MessageBoxButtons.OK, MessageBoxIcon.Error); - } - } - else - { - MessageBox.Show("没有选择记录", "提示"); - } - - } - - /// - /// 删除 - /// - /// - /// - private void winGridViewPager1_OnDeleteSelected(object sender, EventArgs e) - { - DataGridView grid = sender as DataGridView; - if (grid != null && grid.SelectedRows.Count > 0) - { - DataGridViewRow row = grid.SelectedRows[0]; - long dbid = long.Parse(row.Cells["编号"].Value.ToString()); - try - { - string state = row.Cells["状态"].Value.ToString(); - if ("在线".Equals(state)) - { - if (MessageBox.Show("确定注销?", "确认", MessageBoxButtons.YesNo, MessageBoxIcon.Question) == DialogResult.Yes) - { - String sql = "update patroler t set t.accountstate='LEAVER' where t.dbid=" + dbid; - OracleUtils.ExecuteNonQuery(OracleUtils.ConnectionString, CommandType.Text, sql); - } - } - else { - MessageBox.Show("人员不在线,无法注销", "信息"); - } - } - catch (Exception ex) - { - MessageBox.Show("人员注销失败:" + ex.ToString(), "错误", MessageBoxButtons.OK, MessageBoxIcon.Error); - } - } - else - { - MessageBox.Show("没有选择记录", "提示"); - } - } - - + + private void LoadData() { int pageIndex = winGridViewPager1.PagerInfo.CurrenetPageIndex; diff --git a/FrmRoadHDM.cs b/FrmRoadHDM.cs index e765313..e871dd5 100644 --- a/FrmRoadHDM.cs +++ b/FrmRoadHDM.cs @@ -333,31 +333,6 @@ this.Cursor = Cursors.Default; } } - - private void Export(GSOPoint3d _pnt, double r) - { - GSOPoint3ds pnts = new GSOPoint3ds(); - GSOPoint3d pnt = new GSOPoint3d(); - pnt.X = _pnt.X; - pnt.Y = _pnt.Y; - pnt.Z = _pnt.Z; - pnts.Add(pnt); - pnt.X = _pnt.X; - pnt.Y = _pnt.Y - 0.0000000005; - pnt.Z = _pnt.Z; - pnts.Add(pnt); - GSOGeoPolyline3D line = new GSOGeoPolyline3D(); - line.AddPart(pnts); - GSOGeoPolygon3D polygon = line.CreateBuffer(r * 2, true, 5, true, false); - GSOPoint3ds points = polygon[0]; - GSOGeoPolyline3D newLine = new GSOGeoPolyline3D(); - newLine.AddPart(points); - newLine.AltitudeMode = EnumAltitudeMode.RelativeToGround; - GSOFeature newFeature = new GSOFeature(); - newFeature.Geometry = newLine; - globeControl1.Globe.MemoryLayer.AddFeature(newFeature); - } - private void ExportCAD(double a, double b, double r) { GSOPoint3ds pnts = new GSOPoint3ds(); diff --git a/FrmUserAdd.cs b/FrmUserAdd.cs index c612ab4..f826427 100644 --- a/FrmUserAdd.cs +++ b/FrmUserAdd.cs @@ -231,24 +231,6 @@ //cbxRegion.SelectedIndexChanged += new EventHandler(cbxRegion_SelectedIndexChanged); } } - /// - /// 下拉框选中项改变事件处理 - /// - /// - /// - private void cbxRegion_SelectedIndexChanged(object sender, EventArgs e) - { - string sql = ""; - //string sql = "select casic_role.\"name\" from casic_role join casic_regionrole on casic_role.\"id\"=casic_regionrole.\"rid\" where casic_regionrole.\"reid\"=" + region[cbxRegion.SelectedItem.ToString().Trim()]; - DataTable dt = OledbHelper.QueryTable(sql); - if (dt != null && dt.Rows.Count > 0) - { - comboBoxExRegionRole.Items.Clear(); - for (int i = 0; i < dt.Rows.Count; i++) - { - comboBoxExRegionRole.Items.Add(dt.Rows[i][0].ToString().Trim());//部门角色 - } - } - } + } } diff --git a/FrmUserManager.cs b/FrmUserManager.cs index 571f0f0..ae254bc 100644 --- a/FrmUserManager.cs +++ b/FrmUserManager.cs @@ -81,11 +81,6 @@ } } } - //创建新用户 - private void buttonX2_Click(object sender, EventArgs e) - { - FrmUserAdd frm = new FrmUserAdd(-1); - frm.ShowDialog(); - } + } } diff --git a/FrmValveStatistics.cs b/FrmValveStatistics.cs index 545d56c..dd76777 100644 --- a/FrmValveStatistics.cs +++ b/FrmValveStatistics.cs @@ -54,7 +54,7 @@ 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") + if (chaFamenStatis.Series["阀门"].Points[m]!=null&&chaFamenStatis.Series["阀门"].Points[m].YValues[0].ToString() != "0") { chaFamenStatis.Series["阀门"].Points[m].Label = chaFamenStatis.Series[0].Points[m].YValues[0].ToString(); } diff --git a/Frm_password_reset.cs b/Frm_password_reset.cs index 7b51039..b9e5dc3 100644 --- a/Frm_password_reset.cs +++ b/Frm_password_reset.cs @@ -41,6 +41,7 @@ } catch (Exception ex) { + LogHelper.WriteLog(typeof(Frm_password_reset), ex.Message); } } private void initCombox() diff --git a/FrmpipeDeepstatis.cs b/FrmpipeDeepstatis.cs index e156db4..1a84d6c 100644 --- a/FrmpipeDeepstatis.cs +++ b/FrmpipeDeepstatis.cs @@ -307,7 +307,7 @@ chart1.Series[j].Points.DataBindXY(dic1.Keys, dic1.Values); for (int m = 0; m < dic1.Values.Count; m++) { - if (chart1.Series[j].Points[m].YValues[0].ToString() != "0") + if (chart1.Series[j].Points[m]!=null&&chart1.Series[j].Points[m].YValues[0].ToString() != "0") { chart1.Series[j].Points[m].Label = chart1.Series[j].Points[m].YValues[0].ToString(); diff --git a/FrmpipeDiametergather.cs b/FrmpipeDiametergather.cs index 30674de..057b09d 100644 --- a/FrmpipeDiametergather.cs +++ b/FrmpipeDiametergather.cs @@ -263,6 +263,7 @@ if (layer != null && layer is GSOFeatureLayer) { GSOFeatureLayer flayer = layer as GSOFeatureLayer; + if (layer == null) return; GSOFeatures features = flayer.GetAllFeatures(); if (features.Length > 0) { diff --git a/FrmpipeMaterialGather.cs b/FrmpipeMaterialGather.cs index c133ec3..398b884 100644 --- a/FrmpipeMaterialGather.cs +++ b/FrmpipeMaterialGather.cs @@ -280,6 +280,7 @@ if (layer != null && layer is GSOFeatureLayer) { GSOFeatureLayer flayer = layer as GSOFeatureLayer; + if (flayer == null) return; GSOFeatures features = flayer.GetAllFeatures(); if (features.Length > 0) { @@ -332,7 +333,7 @@ chart1.Series[j].Points.DataBindXY(dic1.Keys, dic1.Values); for (int m = 0; m < dic1.Values.Count; m++) { - if (chart1.Series[j].Points[m].YValues[0].ToString() != "0") + if (chart1.Series[j].Points[m]!=null&&chart1.Series[j].Points[m].YValues[0].ToString() != "0") { chart1.Series[j].Points[m].Label = chart1.Series[j].Points[m].YValues[0].ToString(); } diff --git a/Frmpipediameterstatis.cs b/Frmpipediameterstatis.cs index c0ed80a..50f8170 100644 --- a/Frmpipediameterstatis.cs +++ b/Frmpipediameterstatis.cs @@ -286,6 +286,7 @@ chart1.Series.Add(layerCaption); GSOFeatureLayer flayer = layer as GSOFeatureLayer; + if (layer == null) return; GSOFeatures features = flayer.GetAllFeatures(); if (features.Length > 0) { diff --git "a/GKT_Forms/F_GKT\346\225\260\346\215\256\350\276\223\345\205\245\350\276\223\345\207\272.cs" "b/GKT_Forms/F_GKT\346\225\260\346\215\256\350\276\223\345\205\245\350\276\223\345\207\272.cs" index c7bffd5..4db7d5d 100644 --- "a/GKT_Forms/F_GKT\346\225\260\346\215\256\350\276\223\345\205\245\350\276\223\345\207\272.cs" +++ "b/GKT_Forms/F_GKT\346\225\260\346\215\256\350\276\223\345\205\245\350\276\223\345\207\272.cs" @@ -198,12 +198,7 @@ } DialogResult = DialogResult.OK;//将当前窗体的对话框返回值设为OK } - private void treeView1_NodeMouseClick(object sender, TreeNodeMouseClickEventArgs e) - { - dir_Ok = comboBox_Disk.Text + e.Node.FullPath; - //dir = comboBox_Disk.Text + e.Node.FullPath; - e.Node.SelectedImageIndex = e.Node.ImageIndex; - } + string tempstr = ""; private void button1_Click(object sender, EventArgs e) { diff --git a/HFS_Forms/Frm_HFSprojedits.cs b/HFS_Forms/Frm_HFSprojedits.cs index 96dd76f..3c232a1 100644 --- a/HFS_Forms/Frm_HFSprojedits.cs +++ b/HFS_Forms/Frm_HFSprojedits.cs @@ -126,16 +126,6 @@ Close(); } - - - private void TB_ProjName_KeyPress(object sender, KeyPressEventArgs e) - { - if (HFSAClass.Files_NameChar(e) == 0) - e.Handled = true; - if (e.KeyChar == '\r') - OK_Click(sender, e); - } - private void Frm_HFSProjedit_Load(object sender, EventArgs e) { @@ -175,10 +165,6 @@ } } - private void Cancel_Click(object sender, EventArgs e) - { - this.Close(); - } private void Cancel_Click_1(object sender, EventArgs e) { diff --git a/MainFrm.cs b/MainFrm.cs index 2c305a0..ed2685b 100644 --- a/MainFrm.cs +++ b/MainFrm.cs @@ -617,7 +617,7 @@ } catch (Exception ex) { - + LogHelper.WriteLog(typeof(MainFrm), ex.Message); } } @@ -1768,7 +1768,7 @@ } catch (Exception ex) { - //LogError.PublishError(ex); + LogHelper.WriteLog(typeof(MainFrm), ex.Message); } } @@ -2026,6 +2026,7 @@ } catch (Exception ex) { + LogHelper.WriteLog(typeof(MainFrm), ex.Message); result = false; } finally @@ -2316,220 +2317,6 @@ string filename = Utility.filename; List g1layername = new List(); /// - /// 构建图层列表目录树 - /// - /// - private void loadTreeView(TreeView tv) - { - try - { - XmlDocument doc = new XmlDocument(); - doc.Load(filename); - XmlNodeList Params1 = doc.SelectNodes("/Params/layers"); - tv.ShowLines = false; - tv.CheckBoxes = true; - - foreach (XmlNode paramsNode in Params1) //layers - { - foreach (XmlNode layerNode in paramsNode) //layer - { - TreeNode nodelayer = new TreeNode(); - string layerName = layerNode.Attributes["label"].Value; - nodelayer.Text = layerName; - - if (layerNode.HasChildNodes != false) - { - tv.Nodes.Add(nodelayer); - foreach (XmlNode layerchildNode in layerNode) //layerchild - { - if (layerchildNode.Name == "layerchild") - { - TreeNode nodelayerchild = new TreeNode(); - string layerType = layerchildNode.Attributes["type"].Value; - string layerName1 = layerchildNode.Attributes["layer"].Value; - string layerchildName = layerchildNode.Attributes["label"].Value; - if (layerType == "locaserver") - { - if (layerchildNode.Attributes["isRoad"] != null) - { - roadLayerName = layerchildName; - } - dictionaryNetLayerNameAndCaption.Add(layerName1, layerchildName); - - nodelayerchild.Text = layerchildName; - nodelayerchild.Tag = layerType + "|" + layerchildName; - nodelayerchild.Checked = true; - nodelayer.Nodes.Add(nodelayerchild); - } - else - { - if (layerchildNode.Attributes["isPipeLine"] != null) - { - m_PipelineLayerNames.Add(layerchildName); - } - if (layerchildNode.Attributes["isWorkWell"] != null) - { - workwellLayerNames.Add(layerchildName); - } - if (layerchildNode.Attributes["isValve"] != null) - { - valueLayerNames.Add(layerchildName); - } - //if (layerchildNode.Attributes["isInstrument"] != null) - if (layerchildNode.Attributes["isAccess"] != null) - { - instrumenLayerNames.Add(layerchildName); - } - //if (layerchildNode.Attributes["isPipeFitting"] != null) - if (layerchildNode.Attributes["isCharacter"] != null) - { - pipefittingLayerNames.Add(layerchildName); - } - bool boollayer = AddLayers(layerName1, layerchildName); - nodelayerchild.Text = layerchildName; - nodelayerchild.Tag = layerType + "|" + layerchildName; - nodelayerchild.Checked = boollayer; - if (layerchildName.Contains("特征管点")) - { - nodelayerchild.Checked = false; - setLayerVisible(layerName1); - } - - nodelayer.Nodes.Add(nodelayerchild); - g1layername.Add(layerName1); - } - } - else if (layerchildNode.Name == "layertype") - { - TreeNode nodelayerchild = new TreeNode(); - string layerType = layerchildNode.Attributes["label"].Value; - nodelayerchild.Text = layerType; - nodelayerchild.Tag = layerType; - nodelayerchild.Checked = true; - nodelayer.Nodes.Add(nodelayerchild); - if (layerchildNode.HasChildNodes == true) - { - foreach (XmlNode childNodeLayer in layerchildNode) - { - if (childNodeLayer.HasChildNodes == true) - { - TreeNode nodelayerchild2 = new TreeNode(); - string layer = childNodeLayer.Attributes["label"].Value; - nodelayerchild2.Text = layer; - nodelayerchild2.Tag = layer; - nodelayerchild2.Checked = true; - nodelayerchild.Nodes.Add(nodelayerchild2); - foreach (XmlNode n in childNodeLayer) - { - TreeNode nodelayerchild1 = new TreeNode(); - string layerName1 = n.Attributes["layer"].Value; - string layerchildName = n.Attributes["label"].Value; - string layerType1 = n.Attributes["type"].Value; - if (n.Attributes["isPipeLine"] != null) - { - m_PipelineLayerNames.Add(layerchildName); - } - if (n.Attributes["isWorkWell"] != null) - { - workwellLayerNames.Add(layerchildName); - } - if (n.Attributes["isValve"] != null) - { - valueLayerNames.Add(layerchildName); - } - if (n.Attributes["isAccess"] != null) - //if (n.Attributes["isInstrument"] != null) - { - instrumenLayerNames.Add(layerchildName); - } - if (n.Attributes["isPipeFitting"] != null) - { - pipefittingLayerNames.Add(layerchildName); - } - bool boollayer = AddLayers(layerName1, layerchildName); - nodelayerchild1.Text = layerchildName; - nodelayerchild1.Tag = layerType1 + "|" + layerchildName; - nodelayerchild1.Checked = boollayer; - if (layerchildName.Contains("特征管点")) - { - nodelayerchild1.Checked = false; - setLayerVisible(layerName1); - } - - nodelayerchild2.Nodes.Add(nodelayerchild1); - - g1layername.Add(layerName1); - } - } - else - { - TreeNode nodelayerchild1 = new TreeNode(); - string layerName1 = childNodeLayer.Attributes["layer"].Value; - string layerchildName = childNodeLayer.Attributes["label"].Value; - string layerType1 = childNodeLayer.Attributes["type"].Value; - if (childNodeLayer.Attributes["isPipeLine"] != null) - { - m_PipelineLayerNames.Add(layerchildName); - } - if (childNodeLayer.Attributes["isWorkWell"] != null) - { - workwellLayerNames.Add(layerchildName); - } - if (childNodeLayer.Attributes["isValve"] != null) - { - valueLayerNames.Add(layerchildName); - } - if (childNodeLayer.Attributes["isAccess"] != null) - //if (childNodeLayer.Attributes["isInstrument"] != null) - { - instrumenLayerNames.Add(layerchildName); - } - if (childNodeLayer.Attributes["isPipeFitting"] != null) - { - pipefittingLayerNames.Add(layerchildName); - } - bool boollayer = AddLayers(layerName1, layerchildName); - nodelayerchild1.Text = layerchildName; - nodelayerchild1.Tag = layerType1 + "|" + layerchildName; - nodelayerchild1.Checked = boollayer; - if (layerchildName.Contains("特征管点")) - { - nodelayerchild1.Checked = false; - setLayerVisible(layerName1); - } - nodelayerchild.Nodes.Add(nodelayerchild1); - g1layername.Add(layerName1); - } - } - } - } - } - } - else - { - tv.Nodes.Add(nodelayer); - } - } - } - - foreach (TreeNode tn in tv.Nodes) - { - if (tn.Nodes.Count > 0) - { - foreach (TreeNode tnChild in tn.Nodes) - { - if (tnChild.Checked) - tn.Checked = true; - } - } - } - } - catch (Exception ex) - { - //LogError.PublishError(ex); - } - } - /// /// 获取目标图层 /// /// @@ -2629,21 +2416,11 @@ } catch (Exception ex) { - //LogError.PublishError(ex); + LogHelper.WriteLog(typeof(MainFrm), ex.Message); return false; } } /// - /// 菜单上的 三维导航 工具按钮 - /// - /// - /// - private void buttonItem86_Click(object sender, EventArgs e) - { - globeControl1.Globe.Action = EnumAction3D.ActionNull; - } - - /// /// 地上模式 菜单按钮 /// /// @@ -3026,67 +2803,11 @@ } Image printImage; - /// - /// 打印 菜单 - /// - /// - /// - private void buttonItem13_Click(object sender, EventArgs e) - { - Point pt1 = new Point(Convert.ToInt32(0), Convert.ToInt32(0)); - Point pt2 = new Point(Convert.ToInt32(panelEx5.Width), Convert.ToInt32(panelEx5.Height)); - int mapWidth = 0; - int mapHeight = 0; - Point pt = getUpperLeftPoint(pt1, pt2, out mapWidth, out mapHeight); - printImage = new Bitmap(Convert.ToInt32(panelEx5.Width), Convert.ToInt32(panelEx5.Height)); - Graphics g = Graphics.FromImage(printImage); - g.CopyFromScreen(pt, new Point(0, 0), new Size(Convert.ToInt32(panelEx5.Width), Convert.ToInt32(panelEx5.Height))); - - PrintDialog pd = new PrintDialog(); - try - { - if (pd.ShowDialog() == DialogResult.OK) //如果确认,将会覆盖所有的打印参数设置 - { - //打印预览 - PrintPreviewDialog ppd = new PrintPreviewDialog(); - ppd.Document = printDocument1; - if (DialogResult.OK == ppd.ShowDialog()) - { - printDocument1.Print(); //打印 - } - } - } - catch - { - printDocument1.PrintController.OnEndPrint(printDocument1, new System.Drawing.Printing.PrintEventArgs()); - } - } - + private void printDocument1_PrintPage(object sender, System.Drawing.Printing.PrintPageEventArgs e) { e.Graphics.DrawImage(printImage, 10, 10); } - - /// - /// 在窗体的底部状态栏上显示 综合管线条件查询结果 - /// - /// - /// - private void ToolStripText(string currentLayer, int dataCount) - { - if (dataCount != 0) - { - double featurelength = PipeLength(currentLayer, 0);// 统计管线的里程数 - - toolStripNumbers.Text = " 管线类型:" + currentLayer + " | 共有:" + Convert.ToString(dataCount - 1) + "条记录"; - toolStripFeatureLength.Text = " 管线里程:" + featurelength.ToString("0.00") + " 米"; - } - else - { - toolStripNumbers.Text = "管线类型: " + currentLayer + "| 共有:" + 0 + " 条记录 | "; - } - } - /// /// 统计管线的里程数 /// @@ -3402,26 +3123,6 @@ } /// - /// 绘制线 菜单 - /// - /// - /// - private void btnAddLine_Click(object sender, EventArgs e) - { - globeControl1.Globe.DestLayerFeatureAdd = globeControl1.Globe.MemoryLayer; - globeControl1.Globe.Action = EnumAction3D.DrawPolyline; - } - /// - /// 绘制面 菜单 - /// - /// - /// - private void btnAddPolygon_Click(object sender, EventArgs e) - { - globeControl1.Globe.DestLayerFeatureAdd = globeControl1.Globe.MemoryLayer; - globeControl1.Globe.Action = EnumAction3D.DrawPolygon; - } - /// /// 图层目录树 右键菜单中的 目标图层 菜单 /// /// @@ -3956,42 +3657,7 @@ // ClearUpDownTraceAnalysis(); //} - /// - /// 显示流向 功能 - /// - /// - /// - /// - private void Flow(object sender, string pipelineNameCN, bool bShow) - { - GSOFeatureLayer layer = globeControl1.Globe.Layers.GetLayerByCaption(pipelineNameCN) as GSOFeatureLayer; - GSOFeatures feats = layer.GetAllFeatures(); - for (int i = 0; i < feats.Length; i++) - { - GSOFeature feat = feats[i]; - GSOLineStyle3D lineStyle = feat.Geometry.Style as GSOLineStyle3D; - if (lineStyle != null) - { - if (lineStyle.ArrowStyle == null) - { - lineStyle.ArrowStyle = new GSOArrowStyle(); - lineStyle.ArrowStyle.BodyWidth = 2; - lineStyle.ArrowStyle.BodyLen = 6; - lineStyle.ArrowStyle.HeadWidth = 8; - lineStyle.ArrowStyle.HeadLen = 10; - lineStyle.ArrowStyle.OutlineVisible = true; - lineStyle.ArrowStyle.OutlineColor = Color.Red; - lineStyle.ArrowStyle.Speed = lineStyle.ArrowStyle.Speed / 2; - lineStyle.ArrowStyle.Play(); - } - lineStyle.ArrowVisible = bShow; - layerTree.SelectedNode = null; - } - } - globeControl1.Globe.Refresh(); - } - - + FrmCloseValves frm; /// /// 关阀分析 功能 @@ -4030,7 +3696,9 @@ curCAYNDataset.CloseValveAnalysis(lineFeature.ID, out arryResNodeID, out arryResValveID, false, true); } catch (Exception e) - { } + { + LogHelper.WriteLog(typeof(MainFrm), e.Message); + } string valveName = lineLayer.Caption; valveName = valveName.Substring(0, valveName.IndexOf("管线")); @@ -4106,7 +3774,7 @@ } catch (Exception e) { - + LogHelper.WriteLog(typeof(MainFrm), e.Message); } //目前只有燃气管线 有阀门 string valveName = lineLayer.Name; @@ -5457,7 +5125,7 @@ } catch (Exception ex) { - //MessageBox.Show(ex.ToString()); + LogHelper.WriteLog(typeof(MainFrm), ex.Message); } finally { @@ -5501,22 +5169,6 @@ } } - - /// - /// 清除所有坑 菜单 - /// - /// - /// - private void buttonItem3_Click(object sender, EventArgs e) - { - //日志记录 - LogManager.saveLog(Utility.userName, this.buttonItem3.Text); - - globeControl1.Globe.RemoveAllPits(); - } - - - ///// ///// 净距分析 菜单 ///// @@ -5554,42 +5206,8 @@ // ribbonBarTP.Visible = buttonItem34.Checked; // ribbonBarTP.Location = new Point(0, 0); //} - /// - /// 大气层 菜单 - /// - /// - /// - private void buttonItem17_Click_1(object sender, EventArgs e) - { - globeControl1.Globe.Atmosphere.Visible = !globeControl1.Globe.Atmosphere.Visible; - buttonItemSH1.Checked = globeControl1.Globe.Atmosphere.Visible; - globeControl1.Refresh(); - } - /// - /// 经纬网 菜单 - /// - /// - /// - private void buttonItem20_Click(object sender, EventArgs e) - { - globeControl1.Globe.LatLonGrid.Visible = !globeControl1.Globe.LatLonGrid.Visible; - buttonItemSH3.Checked = globeControl1.Globe.LatLonGrid.Visible; - globeControl1.Globe.Refresh(); - } - /// - /// 状态条 菜单 - /// - /// - /// - private void buttonItem21_Click_1(object sender, EventArgs e) - { - globeControl1.Globe.StatusBar.Visible = !globeControl1.Globe.StatusBar.Visible; - buttonItemSH4.Checked = globeControl1.Globe.StatusBar.Visible; - globeControl1.Globe.Refresh(); - } - - + /// /// 添加指定路径下的数据 功能 /// @@ -5680,43 +5298,7 @@ // } // return objRes; //} - /// - /// 刷新目录树 功能 - /// - private void RefreshDataTree() - { - layerTree.Nodes[0].Nodes.Clear(); - Int32 nCount = globeControl1.Globe.DataManager.DataSourceCount; - Int32 i = 0; - for (i = 0; i < nCount; i++) - { - GSODataSource dataSpace = globeControl1.Globe.DataManager[i]; - TreeNode node = new TreeNode(); - node.Text = dataSpace.Name; - node.ImageIndex = 0; - node.SelectedImageIndex = 0; - node.Checked = true; - node.Tag = dataSpace; - Int32 nDatasetCount = dataSpace.DatasetCount; - for (Int32 j = 0; j < nDatasetCount; j++) - { - GSODataset dataset = dataSpace[j]; - TreeNode subNode = new TreeNode(); - subNode.Text = dataset.Name; - subNode.ImageIndex = 0; - subNode.SelectedImageIndex = 0; - subNode.Checked = true; - subNode.Tag = dataset; - node.Nodes.Add(subNode); - } - layerTree.Nodes[0].Nodes.Add(node); - } - } - - - - - + /// /// 复合查询 菜单 @@ -5777,34 +5359,7 @@ return false; } - /// - /// 统计指定图层在指定范围内的所有feature对象 - /// - /// - /// - /// - private GSOFeatures Intersect_PointLayer(GSOGeoPolygon3D polygon, string pointLayerName) - { - GSOLayer layer = globeControl1.Globe.Layers.GetLayerByCaption(pointLayerName); - if (layer == null) - return null; - - GSOFeatureLayer flayer = layer as GSOFeatureLayer; - GSOFeatureDataset fdataset = flayer.Dataset as GSOFeatureDataset; - GSOFeatures feats; - if (polygon == null) - { - feats = flayer.GetAllFeatures(); - } - else - { - feats = flayer.FindFeaturesInPolygon(polygon, false); - } - - workWellLen.Add(pointLayerName, feats.Length); - return feats; - } - /// + /// /// 碰撞分析功能界面中 选择管线复选框 选中状态改变事件处理 /// /// @@ -5946,16 +5501,6 @@ MessageBox.Show("表格内容为空!", "提示"); } } - /// - /// 导出CAD 菜单 - /// - /// - /// - private void btnExportCAD_Click(object sender, EventArgs e) - { - FrmExportCADS frm = new FrmExportCADS(globeControl1, m_PipelineLayerNames); - frm.ShowDialog(); - } ///// ///// 区域分析 菜单 @@ -5987,16 +5532,6 @@ } } } - /// - /// 数据验证 菜单 - /// - /// - /// - private void buttonItem80_Click(object sender, EventArgs e) - { - FrmValiData frm = new FrmValiData(globeControl1); - frm.ShowDialog(); - } /// /// 根据指定图层创建图层节点并将节点添加到图层管理节点的子节点集合中 @@ -6018,56 +5553,7 @@ layerManagerNode.Expand(); } } - /// - /// 数据库备份 菜单 - /// - /// - /// - private void btnBackDatabase_Click(object sender, EventArgs e) - { - if (MessageBox.Show("是否确定要备份数据库文件", "信息", MessageBoxButtons.YesNo, MessageBoxIcon.Question) == DialogResult.Yes) - { - try - { - DateTime currentTime = DateTime.Now; - //string Dtime = currentTime.ToShortDateString().ToString("yyyy-MM-dd"); - string Dtime = currentTime.GetDateTimeFormats('D')[0].ToString(); - string Htime = DateTime.Now.ToString("HH时mm分ss秒").Trim(); - string fileName = Dtime + "(" + Htime + ")"; - string pathName = ""; - string sql = "select filename from master..sysdatabases where name='" + Utility.dbdatabase + "'"; - DataTable dt = OledbHelper.ExecuteDataTable(sql); - if (dt != null && dt.Rows.Count > 0) - { - pathName = dt.Rows[0][0].ToString().Trim(); - int count = pathName.LastIndexOf("\\") == -1 ? pathName.LastIndexOf("/") : pathName.LastIndexOf("\\"); - pathName = pathName.Substring(0, count); - } - pathName += "\\管网数据库" + fileName + ".bak"; - - OracleCommand cmdBK = new OracleCommand(); - cmdBK.CommandType = CommandType.Text; - cmdBK.Connection = connBackup; - cmdBK.CommandText = @"backup database " + Utility.dbdatabase + " to disk='" + pathName + "' with init"; - - connBackup.Open(); - cmdBK.ExecuteNonQuery(); - MessageBox.Show("数据库文件备份成功", "提示"); - } - catch (Exception ex) - { - MessageBox.Show(ex.ToString()); - } - finally - { - connBackup.Close(); - } - } - } - - - - + //GSOFeature emitterFeature; // 粒子要素 /// /// 添加火苗 功能 @@ -6598,361 +6084,15 @@ } } - - ///// - /// 添加用户仓库 菜单 - /// - /// - /// - private void buttonItem108_Click(object sender, EventArgs e) - { - FrmUserRepo frm = new FrmUserRepo(-1); - frm.ShowDialog(); - } - /// - /// 用户仓库管理 菜单 - /// - /// - /// - private void buttonItem111_Click(object sender, EventArgs e) - { - FrmUserRepoMgr frm = new FrmUserRepoMgr(); - frm.ShowDialog(); - } - /// - /// 添加分系统 菜单 - /// - /// - /// - private void buttonItem112_Click(object sender, EventArgs e) - { - //FrmAPP frm = new FrmAPP(-1); - //frm.ShowDialog(); - } - /// - /// 分系统管理 菜单 - /// - /// - /// - private void buttonItem113_Click(object sender, EventArgs e) - { - //FrmAPPMgr frm = new FrmAPPMgr(); - //frm.ShowDialog(); - } - /// - /// 添加操作 菜单 - /// - /// - /// - private void buttonItem114_Click(object sender, EventArgs e) - { - FrmOper frm = new FrmOper(-1); - frm.ShowDialog(); - } - /// - /// 操作管理 菜单 - /// - /// - /// - private void buttonItem115_Click(object sender, EventArgs e) - { - FrmOperMgr frm = new FrmOperMgr(); - frm.ShowDialog(); - } - /// - /// 添加资源 菜单 - /// - /// - /// - private void buttonItem116_Click(object sender, EventArgs e) - { - FrmRESC frm = new FrmRESC(-1); - frm.ShowDialog(); - } - /// - /// 资源管理 菜单 - /// - /// - /// - private void buttonItem117_Click(object sender, EventArgs e) - { - FrmRESCMgr frm = new FrmRESCMgr(); - frm.ShowDialog(); - } - /// - /// 添加权限 菜单 - /// - /// - /// - private void buttonItem118_Click(object sender, EventArgs e) - { - FrmPerm frm = new FrmPerm(-1); - frm.ShowDialog(); - } - /// - /// 权限管理 菜单 - /// - /// - /// - private void buttonItem119_Click(object sender, EventArgs e) - { - FrmPermMgr frm = new FrmPermMgr(); - frm.ShowDialog(); - } - /// - /// 添加访问控制 菜单 - /// - /// - /// - private void buttonItem120_Click(object sender, EventArgs e) - { - FrmAccess frm = new FrmAccess(-1); - frm.ShowDialog(); - } - /// - /// 访问控制管理 菜单 - /// - /// - /// - private void buttonItem121_Click(object sender, EventArgs e) - { - FrmAccessMgr frm = new FrmAccessMgr(); - frm.ShowDialog(); - } - /// - /// 部门类型管理 菜单 - /// - /// - /// - private void buttonItem122_Click(object sender, EventArgs e) - { - FrmRegionTypeMgr frm = new FrmRegionTypeMgr(); - frm.ShowDialog(); - } - /// - /// 用户信息管理 菜单 - /// - /// - /// - private void buttonItem128_Click_1(object sender, EventArgs e) - { - FrmUserManager frm = new FrmUserManager(); - frm.ShowDialog(); - } - /// - /// 添加角色 菜单 - /// - /// - /// - private void 添加角色_Click(object sender, EventArgs e) - { - FrmRole frm = new FrmRole(-1); - frm.ShowDialog(); - } - /// - /// 所有角色管理 菜单 - /// - /// - /// - private void 角色管理_Click(object sender, EventArgs e) - { - FrmRoleMgr frm = new FrmRoleMgr(); - frm.ShowDialog(); - } - - /// - /// 部门角色管理 菜单 - /// - /// - /// - private void buttonItem133_Click(object sender, EventArgs e) - { - FrmRegionRoleMgr frm = new FrmRegionRoleMgr(); - frm.ShowDialog(); - } - /// - /// 部门管理 菜单 - /// - /// - /// - private void buttonItem130_Click(object sender, EventArgs e) - { - FrmRegionMgr frm = new FrmRegionMgr(); - frm.ShowDialog(); - } - - /// - /// 日志管理 菜单 - /// - /// - /// - private void buttonItem135_Click(object sender, EventArgs e) - { - FrmLogManager frm = new FrmLogManager(); - frm.ShowDialog(); - } - /// - /// 传感器信息查询 菜单 - /// - /// - /// - private void buttonItem131_Click_1(object sender, EventArgs e) - { - GSOFeature selectedFeature = globeControl1.Globe.SelectedObject; - if (selectedFeature == null) - { - MessageBox.Show("请选择一个传感器对象!", "提示", MessageBoxButtons.OK, MessageBoxIcon.Information); - } - else - { - if (selectedFeature.Geometry != null && selectedFeature.Geometry.Type == EnumGeometryType.GeoModel) - { - GSOLayer layer = globeControl1.Globe.SelectedObjectLayer; - string tabelName = getTableName(layer.Caption); - string eqtID = selectedFeature.Description.Trim(); - if (tabelName != "" && eqtID != "") - { - string fields = getFields(tabelName); - if (fields != "") - { - string sql = "select " + fields + " from " + Utility.sensorDatabase + "." + tabelName + " where EqtID=" + eqtID + " order by RecordDate desc limit 1;"; - DataTable dt = MySqlHelper.queryDataTable(sql); - if (dt != null && dt.Rows.Count > 0) - { - FrmQueryMessage.ShowForm(this, dt, layer.Caption); - //queryMessage.Show(this); - } - else - { - MessageBox.Show("没有查询到相关信息!", "提示"); - } - } - else - { - MessageBox.Show("配置文件 \"sensorConfig.xml\" 有误!", "提示"); - } - } - else - { - MessageBox.Show("请选择一个传感器对象!", "提示"); - } - } - else - { - MessageBox.Show("请选择一个传感器对象!", "提示", MessageBoxButtons.OK, MessageBoxIcon.Information); - } - } - } - /// - /// 根据指定的图层的caption属性的值在配置文件中查找对应的数据库中的表的名称 - /// - /// 图层的caption属性的值 - /// 对应的数据库中的表的名称 - private string getTableName(string name) - { - string tabelName = ""; - if (Utility.sensorMarkerLayers != null) - { - for (int i = 0; i < Utility.sensorMarkerLayers.Count; i++) - { - MarkerLayer mLayer = Utility.sensorMarkerLayers[i]; - if (mLayer.layerName == name) - { - tabelName = mLayer.tableName; - break; - } - } - } - return tabelName; - } - /// - /// 根据数据库中的表的名称 查找对应的表中的字段名称的集合 - /// - /// 数据库中的表的名称 - /// 对应的表中的字段名称的集合 - private string getFields(string tabelName) - { - string fields = ""; - if (Utility.sensorMarkerLayers != null) - { - for (int i = 0; i < Utility.sensorMarkerLayers.Count; i++) - { - MarkerLayer mLayer = Utility.sensorMarkerLayers[i]; - if (mLayer.tableName.Trim() == tabelName.Trim()) - { - if (mLayer.fields != null) - { - foreach (string key in mLayer.fields.Keys) - { - string value = mLayer.fields[key]; - fields += tabelName.Trim() + "." + key + " as " + value + ","; - } - fields = fields.Remove(fields.Length - 1); - } - break; - } - } - } - return fields; - } - - /// - /// 历史曲线查询 菜单 - /// - /// - /// - private void buttonItem132_Click(object sender, EventArgs e) - { - GSOFeature selectedFeature = globeControl1.Globe.SelectedObject; - if (selectedFeature == null) - { - MessageBox.Show("请选择一个对象!", "提示", MessageBoxButtons.OK, MessageBoxIcon.Information); - } - else - { - if (selectedFeature.Geometry != null && selectedFeature.Geometry.Type == EnumGeometryType.GeoModel) - { - GSOLayer layer = globeControl1.Globe.SelectedObjectLayer; - string tabelName = getTableName(layer.Caption); - string eqtID = selectedFeature.Description; - if (tabelName != "" && eqtID != "") - { - FrmQueryHistory.ShowForm(this, tabelName, eqtID); - } - else - { - MessageBox.Show("请选择一个传感器对象!", "提示"); - } - } - else - { - MessageBox.Show("请选择一个传感器对象!", "提示", MessageBoxButtons.OK, MessageBoxIcon.Information); - } - } - } - + //定时检查传感器的状态 public System.Windows.Forms.Timer timerOfSensor = null; public int alarmValueLiuLiang = 0; public int alarmValueYaLi = 0; public int alarmValueYeTi = 0; public int alarmValueZaoSheng = 0; - /// - /// 传感器在线报警 菜单 - /// - /// - /// - private void buttonItem134_Click(object sender, EventArgs e) - { - if (timerOfSensor == null) - { - timerOfSensor = new System.Windows.Forms.Timer(); - timerOfSensor.Interval = 30000; - timerOfSensor.Tick += new EventHandler(timerOfSensor_Tick); - } - FrmQuerySensorAlarm.ShowForm(this); - } + /// /// 传感器报警 功能中的 定时器 的触发事件处理 /// @@ -7016,6 +6156,7 @@ } catch (Exception ex) { + LogHelper.WriteLog(typeof(MainFrm), ex.Message); continue; } } @@ -7025,145 +6166,7 @@ } } - - /// - /// 沿线运动 菜单 - /// - /// - /// - private void buttonItem138_Click(object sender, EventArgs e) - { - if (globeControl1.Globe.SelectedObject == null) - { - MessageBox.Show("请先选择一条线!", "提示", MessageBoxButtons.OK, MessageBoxIcon.Exclamation); - return; - } - - GSOFeature lineFeature = globeControl1.Globe.SelectedObject; - if (lineFeature.Geometry == null || lineFeature.Geometry.Type != EnumGeometryType.GeoPolyline3D) - { - MessageBox.Show("请先选择一条线!", "提示", MessageBoxButtons.OK, MessageBoxIcon.Exclamation); - return; - } - - OpenFileDialog dlg = new OpenFileDialog(); - dlg.Filter = "*.gcm;*.3ds|*.gcm;*.3ds|*.3ds|*.3ds|*.gcm|*.gcm"; - if (dlg.ShowDialog() == DialogResult.OK) - { - GSOGeoModel model = new GSOGeoModel(); - model.FilePath = dlg.FileName; - - GSOGeoDynamicRoute dynamicRoute = new GSOGeoDynamicRoute(); - dynamicRoute.ActorGeometry = model; - - GSORoute route = new GSORoute(); - GSOGeoPolyline3D geoline = (GSOGeoPolyline3D)lineFeature.Geometry; - for (int i = 0; i < geoline[0].Count; i++) - { - route.Add(geoline[0][i]); - } - route.CircleRoute = false; - route.Speed = 30; - route.RotateSpeed = 50; - route.AltitudeMode = geoline.AltitudeMode; - dynamicRoute.Route = route; - - GSOFeature feature = new GSOFeature(); - - dynamicRoute.Play(); - feature.Geometry = dynamicRoute; - - //GSOLabel gsoLabel = new GSOLabel(); - //gsoLabel.Text = "模型测试"; - //feature.Label = gsoLabel; - globeControl1.Globe.MinModelVisibleSize = 0; - - globeControl1.Globe.MemoryLayer.AddFeature(feature); - globeControl1.Globe.Refresh(); - } - } - /// - /// 回退 菜单 - /// - /// - /// - private void buttonItem99_Click(object sender, EventArgs e) - { - globeControl1.Globe.UnDoEdit(); - } - /// - /// 前进 菜单 - /// - /// - /// - private void buttonItem100_Click(object sender, EventArgs e) - { - globeControl1.Globe.ReDoEdit(); - } - /// - /// 水平净距 功能界面中的 标签内容改变事件处理 - /// - /// - /// - private void textBoxX4_TextChanged(object sender, EventArgs e) - { - string valueJingJu = textBoxX4.Text.Trim(); - if (valueJingJu != "") - { - double value = 0; - bool bl = double.TryParse(valueJingJu, out value); - if (bl) - { - labelX24.Text = "水平净距小于" + value.ToString() + "米的管线有:"; - } - } - } - /// - /// 垂直净距 功能界面中的 标签内容改变事件处理 - /// - /// - /// - private void textBoxX2_TextChanged(object sender, EventArgs e) - { - string valueJingJu = textBoxX2.Text.Trim(); - if (valueJingJu != "") - { - double value = 0; - bool bl = double.TryParse(valueJingJu, out value); - if (bl) - { - labelX23.Text = "垂直净距小于" + value.ToString() + "米的管线有:"; - } - } - } - /// - /// 覆土分析 功能界面中的 标签内容改变事件处理 - /// - /// - /// - private void textBoxX3_TextChanged(object sender, EventArgs e) - { - string valueJingJu = textBoxX3.Text.Trim(); - if (valueJingJu != "") - { - double value = 0; - bool bl = double.TryParse(valueJingJu, out value); - if (bl) - { - labelX17.Text = "覆土深度小于" + value.ToString() + "米的管线有:"; - } - } - } - - /// - /// 传感器分类查询 全区域 菜单 - /// - /// - /// - private void buttonItemSensor全区域查询_Click(object sender, EventArgs e) - { - FrmAccessoriesSensor.ShowForm(globeControl1, instrumenLayerNames, 0); - } + /// /// 传感器分类查询 绘制区域 菜单 /// @@ -7224,170 +6227,10 @@ layerTemp.RemoveAllFeature(); globeControl1.Refresh(); } - /// - /// 数字预处理 功能 - /// - /// - /// - private void 数字预处理buttonItem140_Click(object sender, EventArgs e) - { - FrmEditShapeFile frm = new FrmEditShapeFile(globeControl1); - frm.ShowDialog(this); - } - - - /// - /// 导出矢量 功能 将图层导出为kml和shp格式数据 - /// - /// - /// - private void 导出矢量buttonItem140_Click(object sender, EventArgs e) - { - /* - List m_PipelineLayerNames = new List();//线图层名称 - List workwellLayerNames = new List();//工井图层名称 - List valueLayerNames = new List();//阀门图层名称 - List instrumenLayerNames = new List();//附属物图层名称 - List pipefittingLayerNames = new List();//管件图层名称 - */ - List listVectorNames = new List(); - for (int i = 0; i < m_PipelineLayerNames.Count; i++) - { - if (m_PipelineLayerNames[i] == "移动" || m_PipelineLayerNames[i] == "联通" - || m_PipelineLayerNames[i] == "电信" || m_PipelineLayerNames[i] == "共通" - || m_PipelineLayerNames[i] == "有限电视" || m_PipelineLayerNames[i] == "交通信号" - || m_PipelineLayerNames[i] == "供电") - { - continue; - } - if (listVectorNames.Contains(m_PipelineLayerNames[i]) == false) - { - listVectorNames.Add(m_PipelineLayerNames[i]); - } - } - for (int i = 0; i < valueLayerNames.Count; i++) - { - if (listVectorNames.Contains(valueLayerNames[i]) == false) - { - listVectorNames.Add(valueLayerNames[i]); - } - } - for (int i = 0; i < workwellLayerNames.Count; i++) - { - if (listVectorNames.Contains(workwellLayerNames[i]) == false) - { - listVectorNames.Add(workwellLayerNames[i]); - } - } - for (int i = 0; i < instrumenLayerNames.Count; i++) - { - if (listVectorNames.Contains(instrumenLayerNames[i]) == false) - { - listVectorNames.Add(instrumenLayerNames[i]); - } - } - for (int i = 0; i < pipefittingLayerNames.Count; i++) - { - if (listVectorNames.Contains(pipefittingLayerNames[i]) == false) - { - listVectorNames.Add(pipefittingLayerNames[i]); - } - } - FrmExportVector frm = new FrmExportVector(globeControl1, listVectorNames); - frm.ShowDialog(); - } string citySevenLineType = ""; string cityServerLineName = ""; /// - /// 绘制城市七线 功能按钮 - /// - /// - /// - private void 绘制城市七线buttonItem140_Click(object sender, EventArgs e) - { - FrmCitySevenLineType frm = new FrmCitySevenLineType(); - if (frm.ShowDialog() == DialogResult.OK) - { - globeControl1.Globe.Action = EnumAction3D.DrawPolyline; - m_isDrawCitySevenLine = true; - m_isDrawTunnel = false; - m_AddPipeLine = false; - this.citySevenLineType = frm.citySevenLineType; - this.cityServerLineName = frm.citySevenLineName; - switch (frm.citySevenLineType) - { - case "城市红线": - GSOLayer layerRed = globeControl1.Globe.Layers.GetLayerByCaption(frm.citySevenLineType); - if (layerRed != null) - { - globeControl1.Globe.DestLayerFeatureAdd = layerRed; - layerRed.Editable = true; - } - break; - case "城市橙线": - GSOLayer layerOrange = globeControl1.Globe.Layers.GetLayerByCaption(frm.citySevenLineType); - if (layerOrange != null) - { - globeControl1.Globe.DestLayerFeatureAdd = layerOrange; - layerOrange.Editable = true; - } - break; - case "城市黄线": - GSOLayer layerYellow = globeControl1.Globe.Layers.GetLayerByCaption(frm.citySevenLineType); - if (layerYellow != null) - { - globeControl1.Globe.DestLayerFeatureAdd = layerYellow; - layerYellow.Editable = true; - } - break; - case "城市绿线": - GSOLayer layerGreen = globeControl1.Globe.Layers.GetLayerByCaption(frm.citySevenLineType); - if (layerGreen != null) - { - globeControl1.Globe.DestLayerFeatureAdd = layerGreen; - layerGreen.Editable = true; - } - break; - case "城市蓝线": - GSOLayer layerBlue = globeControl1.Globe.Layers.GetLayerByCaption(frm.citySevenLineType); - if (layerBlue != null) - { - globeControl1.Globe.DestLayerFeatureAdd = layerBlue; - layerBlue.Editable = true; - } - break; - case "城市紫线": - GSOLayer layerPurple = globeControl1.Globe.Layers.GetLayerByCaption(frm.citySevenLineType); - if (layerPurple != null) - { - globeControl1.Globe.DestLayerFeatureAdd = layerPurple; - layerPurple.Editable = true; - } - break; - case "城市黑线": - GSOLayer layerBlack = globeControl1.Globe.Layers.GetLayerByCaption(frm.citySevenLineType); - if (layerBlack != null) - { - globeControl1.Globe.DestLayerFeatureAdd = layerBlack; - layerBlack.Editable = true; - } - break; - } - } - } - /// - /// 七线审核 功能按钮 - /// - /// - /// - private void 七线审核buttonItem141_Click(object sender, EventArgs e) - { - FrmCityServerLineAnalysis frm = new FrmCityServerLineAnalysis(globeControl1, m_PipelineLayerNames); - frm.ShowDialog(this); - } - - /// /// 间距分析 开始分析按钮 分析绘制的七线和管线的距离是否符合标准 /// /// @@ -7666,25 +6509,6 @@ } } - - - /// - /// 管线自动缩进 菜单 - /// - /// - /// - private void 管线自动缩进buttonItem140_Click(object sender, EventArgs e) - { - FrmPipelineIndented frm = new FrmPipelineIndented(globeControl1, m_PipelineLayerNames, workwellLayerNames); - frm.ShowDialog(this); - } - - private void btnExportCADs_Click(object sender, EventArgs e) - { - - } - - /// /// 统计指定图层在指定范围内的所有feature对象 /// @@ -7755,8 +6579,6 @@ } - - //设置图层为隐藏 private void setLayerVisible(string layerName) { @@ -7765,27 +6587,7 @@ globeControl1.Globe.Refresh(); } - /// - /// 连接数据库 - /// - /// - /// - private void buttonItem129_Click(object sender, EventArgs e) - { - //保存日志 - LogManager.saveLog(Utility.userName, this.buttonItemSJGL4_1.Text); - - FrmDatabaseParaSetting2 frm = new FrmDatabaseParaSetting2(globeControl1); - if (frm.ShowDialog() == DialogResult.OK) - { - ds = FrmDatabaseParaSetting2.ds; - if (ds != null) - { - ds.IsCloseSaved = false; - } - } - } - + /// /// 清除渲染结果 /// @@ -7803,112 +6605,8 @@ layerTemp.RemoveAllFeature(); globeControl1.Refresh(); } - - /// - /// 绘制垂线 - /// - /// - /// - private void drawCLine(GSOPoint3d fpt, GSOPoint3d tpt) - { - GSOGeoPolyline3D pline = new GSOGeoPolyline3D(); - GSOPoint3ds pts = new GSOPoint3ds(); - pts.Add(fpt); - pts.Add(tpt); - pline.AddPart(pts); - - GSOGeoPoint3D fptg = new GSOGeoPoint3D(); - GSOGeoPoint3D tptg = new GSOGeoPoint3D(); - fptg.X = fpt.X; - fptg.Y = fpt.Y; - fptg.Z = 0; - tptg.X = tpt.X; - tptg.Y = tpt.Y; - tptg.Z = 0; - - GSOFeature gf = new GSOFeature(); - gf.Geometry = pline; - - globeControl1.Globe.MemoryLayer.AddFeature(gf); - - } - /// - /// 红线审核 - /// - /// - /// - private void buttonItem138_Click_2(object sender, EventArgs e) - { - - } - /// - /// 比较两个点是否是同一个点 - /// - /// - /// - /// - private bool comparePoint(GSOPoint3d pt1, GSOPoint3d pt2) - { - double x1 = 0; double y1 = 0; - double x2 = 0; double y2 = 0; - x1 = pt1.X; - y1 = pt1.Y; - x2 = pt2.X; - y2 = pt2.Y; - if ((x1 == x2) && (y1 == y2)) - { - return true; - } - return false; - } - /// - /// 获得点到线的垂线距离及垂点 - /// - /// - /// - /// - /// - private void comparePointLine(GSOPoint3d point, GSOGeoPolyline3D line, out double length, out GSOPoint3d pointChuiDian) - { - GSOPoint3d lineStartPoint = line[0][0]; - GSOPoint3d lineEndPoint = line[0][1]; - GSOGeoPolyline3D lineAB = new GSOGeoPolyline3D(); - GSOPoint3ds pointsAB = new GSOPoint3ds(); - pointsAB.Add(point); - pointsAB.Add(lineStartPoint); - lineAB.AddPart(pointsAB); - double lengthAB = lineAB.GetSpaceLength(false, 6378137.0); - double xieLvAB = getXieLu("", point.X, point.Y, lineStartPoint.X, lineStartPoint.Y); - double xieLvBC = getXieLu("", lineStartPoint.X, lineStartPoint.Y, lineEndPoint.X, lineEndPoint.Y); - - double tanABC = Math.Abs(xieLvAB - xieLvBC) / (1 + xieLvAB * xieLvBC); - double angle = Math.Atan(tanABC); - //if (angle > Math.PI / 2) //落在外边 - //{ - // length = 0; - //} - double lengthAD = lengthAB * Math.Sin(angle); - length = Math.Abs(lengthAD); - double lengthBD = lengthAB * Math.Cos(angle); - - GSOPoint2d point2dStart = Latlon_2_XYZ(lineStartPoint.X, lineStartPoint.Y); - double bBC = point2dStart.Y - xieLvBC * point2dStart.X; - GSOPoint2d point2dEnd = new GSOPoint2d(); - point2dEnd.X = point2dStart.X + 100; - point2dEnd.Y = point2dEnd.X * xieLvBC + bBC; - point2dEnd = XYZ_2_Latlon(point2dEnd.X, point2dEnd.Y); - - GSOPoint3d pointEnd = new GSOPoint3d(); - pointEnd.X = point2dEnd.X; - pointEnd.Y = point2dEnd.Y; - GSOGeoPolyline3D lineYanShen = new GSOGeoPolyline3D(); - GSOPoint3ds pointsYanShen = new GSOPoint3ds(); - pointsYanShen.Add(lineStartPoint); - pointsYanShen.Add(pointEnd); - lineYanShen.AddPart(pointsYanShen); - GSOGeoPolyline3D lineSegment = lineYanShen.GetSegment(0, lengthBD); - pointChuiDian = lineSegment[0][1]; - } + + /// /// 获得斜率 /// @@ -8044,255 +6742,6 @@ } /// - /// 获取与点相连的所有线以及线的点的集合 - /// - /// 选定的点所在的线 - /// 选定的点 - /// 面中不完全包含的除起点线之外所有的线 - /// 选定的点所在的点的集合 - /// 所有以选定线为起点的点的集合 - /// - private List getFeaturesPoints(GSOFeature featureSelect, GSOPoint3d lineStart, GSOFeatures selectFeatures, GSOPoint3ds ps, List listPS) - { - GSOFeatures fsStart = new GSOFeatures(); - for (int n = 0; n < selectFeatures.Length; n++) - { - if (featureSelect.ID == selectFeatures[n].ID) - { - continue; - } - GSOGeoPolyline3D newLine = selectFeatures[n].Geometry as GSOGeoPolyline3D; - if (newLine != null && newLine.PartCount > 0) - { - GSOPoint3d newLineStart = newLine[0][0]; - GSOPoint3d newLineEnd = newLine[0][newLine[0].Count - 1]; - if (lineStart.X == newLineEnd.X && lineStart.Y == newLineEnd.Y) - { - GSOPoint3ds psAdd = new GSOPoint3ds(); - for (int k = newLine[0].Count - 1; k >= 0; k--) - { - psAdd.Add(newLine[0][k]); - } - newLine[0] = psAdd; - fsStart.Add(selectFeatures[n]); - - } - else if (lineStart.X == newLineStart.X && lineStart.Y == newLineStart.Y) - { - fsStart.Add(selectFeatures[n]); - - } - } - } - if (fsStart.Length > 0) - { - for (int m = 0; m < fsStart.Length; m++) - { - GSOGeoPolyline3D lineFsStart = fsStart[m].Geometry as GSOGeoPolyline3D; - if (lineFsStart != null && lineFsStart.PartCount > 0) - { - GSOPoint3ds psAdd = ps.Clone(); - for (int k = 0; k < lineFsStart[0].Count; k++) - { - psAdd.Add(lineFsStart[0][k]); - } - listPS = getFeaturesPoints(fsStart[m], lineFsStart[0][lineFsStart[0].Count - 1], selectFeatures, psAdd, listPS); - } - } - } - else - { - listPS.Add(ps); - } - return listPS; - } - - /// - /// 获取切割面的线 - /// - /// 不完全包含在面中的所有线 - /// 完全包含在面中的所有线 - /// 线 - private GSOFeature getLineFromGSOFeatures(GSOFeatures features, GSOFeatures featuresTrue) - { - //1. 当线对象数组的长度为0时,返回空 - if (features.Length == 0) - { - return null; - } - //2. 当线对象数组的长度为1时,返回这条线 - if (features.Length == 1) - { - return features[0]; - } - //3. 当线对象数组的长度大于1时,计算所有线组成的最长线 - - //3.1 获取所有不完全包含在面中的对象selectFeatures - GSOFeatures selectFeatures = new GSOFeatures(); - for (int a = 0; a < features.Length; a++) - { - selectFeatures.Add(features[a].Clone()); - } - //3.2 删除features中完全包含在面中的线,获取和面的边界相交的线对象 - for (int a = 0; a < featuresTrue.Length; a++) - { - for (int b = 0; b < features.Length; b++) - { - if (featuresTrue[a].ID == features[b].ID) - { - features.Remove(b); - break; - } - } - } - //3.3 如果和面的边界相交的线的数量为0,返回空 - if (features.Length == 0) - { - return null; - } - //3.4 获取第一条和面的边界相交的线featureInOutPolygon - GSOFeature featureInOutPolygon = features[0]; - //3.5 从所有的线中删除featureInOutPolygon - for (int a = 0; a < selectFeatures.Length; a++) - { - if (selectFeatures[a].ID == featureInOutPolygon.ID) - { - selectFeatures.Remove(a); - break; - } - } - //listPS存储所有从featureInOutPolygon出发的点的集合 - List listPS = new List(); - //3.5 获取与featureInOutPolygon相连的线的集合 - GSOGeoPolyline3D line = featureInOutPolygon.Geometry as GSOGeoPolyline3D; - if (line != null && line.PartCount > 0) - { - GSOPoint3d lineStart = line[0][0]; - GSOPoint3d lineEnd = line[0][line[0].Count - 1]; - #region//获取和featureInOutPolygon的起点相连的线 - GSOFeatures fsStart = new GSOFeatures(); - for (int n = 0; n < selectFeatures.Length; n++) - { - GSOGeoPolyline3D newLine = selectFeatures[n].Geometry as GSOGeoPolyline3D; - if (newLine != null && newLine.PartCount > 0) - { - GSOPoint3d newLineStart = newLine[0][0]; - GSOPoint3d newLineEnd = newLine[0][newLine[0].Count - 1]; - if (lineStart.X == newLineEnd.X && lineStart.Y == newLineEnd.Y) - { - GSOPoint3ds psAdd = new GSOPoint3ds(); - for (int k = newLine[0].Count - 1; k >= 0; k--) - { - psAdd.Add(newLine[0][k]); - } - newLine[0] = psAdd; - fsStart.Add(selectFeatures[n]); - - } - else if (lineStart.X == newLineStart.X && lineStart.Y == newLineStart.Y) - { - fsStart.Add(selectFeatures[n]); - } - } - } - #endregion - - #region//获取和featureInOutPolygon的终点相连的线 - GSOFeatures fsEnd = new GSOFeatures(); - for (int n = 0; n < selectFeatures.Length; n++) - { - GSOGeoPolyline3D newLine = selectFeatures[n].Geometry as GSOGeoPolyline3D; - if (newLine != null && newLine.PartCount > 0) - { - GSOPoint3d newLineStart = newLine[0][0]; - GSOPoint3d newLineEnd = newLine[0][newLine[0].Count - 1]; - if (lineEnd.X == newLineStart.X && lineEnd.Y == newLineStart.Y) - { - fsEnd.Add(selectFeatures[n]); - - } - else if (lineEnd.X == newLineEnd.X && lineEnd.Y == newLineEnd.Y) - { - GSOPoint3ds psAdd = new GSOPoint3ds(); - for (int k = newLine[0].Count - 1; k >= 0; k--) - { - psAdd.Add(newLine[0][k]); - } - newLine[0] = psAdd; - fsEnd.Add(selectFeatures[n]); - - } - } - } - #endregion - - //3.6 将featureInOutPolygon的所有点和与之起点相连的线的所有点组成一个点的集合并添加到listPS中 - if (fsStart.Length > 0 && fsEnd.Length == 0) - { - for (int m = 0; m < fsStart.Length; m++) - { - GSOGeoPolyline3D lineFsStart = fsStart[m].Geometry as GSOGeoPolyline3D; - if (lineFsStart != null && lineFsStart.PartCount > 0) - { - GSOPoint3ds psAdd = new GSOPoint3ds(); - for (int k = line[0].Count - 1; k >= 0; k--) - { - psAdd.Add(line[0][k]); - } - for (int k = 0; k < lineFsStart[0].Count; k++) - { - psAdd.Add(lineFsStart[0][k]); - } - - listPS = getFeaturesPoints(fsStart[m], lineFsStart[0][lineFsStart[0].Count - 1], selectFeatures, psAdd, listPS); - - } - } - } - //3.6 将featureInOutPolygon的所有点和与之终点相连的线的所有点组成一个点的集合并添加到listPS中 - else if (fsStart.Length == 0 && fsEnd.Length > 0) - { - for (int n = 0; n < fsEnd.Length; n++) - { - GSOGeoPolyline3D lineFsEnd = fsEnd[n].Geometry as GSOGeoPolyline3D; - if (lineFsEnd != null && lineFsEnd.PartCount > 0) - { - GSOPoint3ds psAdd = new GSOPoint3ds(); - for (int k = 0; k < line[0].Count - 1; k++) - { - psAdd.Add(line[0][k]); - } - for (int k = 0; k < lineFsEnd[0].Count; k++) - { - psAdd.Add(lineFsEnd[0][k]); - } - //获取线fsEnd[n]的另一个端点相连的线并记录该线的点的集合 - listPS = getFeaturesPoints(fsEnd[n], lineFsEnd[0][lineFsEnd[0].Count - 1], selectFeatures, psAdd, listPS); - } - } - } - } - - //3.7 获取所有以featureInOutPolygon为起点的点的集合组成的线中的最长的线 - double maxLength = 0; - GSOFeature featureNew = new GSOFeature(); - for (int h = 0; h < listPS.Count; h++) - { - GSOGeoPolyline3D lineNew = new GSOGeoPolyline3D(); - lineNew.AddPart(listPS[h]); - GSOLabel label = new GSOLabel(); - label.Text = h.ToString(); - featureNew.Label = label; - double length = lineNew.GetSpaceLength(true, 6378137); - if (length > maxLength) - { - featureNew.Geometry = lineNew; - } - } - - return featureNew; - } - /// /// 更新最大最小状态 /// /// @@ -8340,219 +6789,6 @@ - private void buttonItem139_Click(object sender, EventArgs e) - { - - string filepath = ""; - //日志记录 - OpenFileDialog dlg = new OpenFileDialog(); - dlg.Filter = "矢量数据(*.shp)|*.shp|矢量数据(*.lgd)|*.lgd|全部支持格式(*.lgd,*.shp)|*.lgd;*.shp;"; - //dlg.Filter = "支持格式(*.lrp,*.tif,*.img,*.lrc,*.kml,*.lgd,*.shp,*.gft)|*.lrp;*.tif;*.img;*.lrc;*.kml;*.lgd;*.shp;*.gft|栅格数据(*.lrp)|*.lrp|栅格缓存(*.lrc)|*.lrc|KML数据(*.kml)|*.kml|矢量数据(*.lgd)|*.lgd|矢量缓存(*.gft)|*.gft|其它格式(*.*)|*.*||"; - dlg.Multiselect = true; - if (dlg.ShowDialog() == DialogResult.OK) - { - //自定义lprj文件名,从程序中复制一lprj文件。 - int bindex = dlg.FileName.Split('\\').Length; - string lastname = dlg.FileName.Split('\\')[bindex - 1]; - - for (int i = 0; i < dlg.FileNames.Length; i++) - { - string strDataPath = dlg.FileNames[i]; - filepath = strDataPath; - - GSOLayer layer = globeControl1.Globe.Layers.Add(strDataPath); - - } - - } - //放大到红线 - - - // globeControl1.Globe.Layers.MoveTo(0, globeControl1.Globe.Layers.Count - 1); - // globeControl1.Globe.Layers.MoveTo(0,4); - globeControl1.Refresh(); - - - } - /// - /// - /// - /// - /// - private void buttonItem142_Click(object sender, EventArgs e) - { - //获得红线polygon - //GSOLayer layerSevenLine = globeControl1.Globe.Layers.GetLayerByCaption(redlinelayername); - - GSOLayer layerSevenLine = globeControl1.Globe.Layers.Add("D:\\data\\歌林小镇shp\\test.shp"); - //获得红线结果列表 - ArrayList rrLists = new ArrayList(); - - //if (redlinelayername != "") - { - GSOFeatures fs = layerSevenLine.GetAllFeatures(); - int len = fs.Length; - - GSOGeoPolygon3D sevenPolygon = new GSOGeoPolygon3D(); - for (int k = 0; k < len; k++) - {//多根红线 - ///////生成红线区域/////// - GSOFeature featSevenLine = layerSevenLine.GetAt(k); - GSOGeoPolyline3D sevenLine = featSevenLine.Geometry as GSOGeoPolyline3D; - - List sevenParts = new List(); - for (int i = 0; i < sevenLine.PartCount; i++) - { - sevenParts.Add(sevenLine[i]); - } - for (int i = 0; i < sevenParts.Count; i++) - { - sevenPolygon.AddPart((GSOPoint3ds)sevenParts[i]); - } - /////拼出红线多边形over////// - - } - //GSOLayer layer = globeControl1.Globe.Layers.GetLayerByCaption("天然气管线"); - - GSOLayer layer = globeControl1.Globe.Layers.Add("C:\\Users\\nn-203\\Desktop\\xiaobai\\test.lgd"); - //线切割面定义,输出用 - GSOFeatures resFeats = new GSOFeatures(); - int resultstyle = 0; - //管线切割红线区域后,面积较小的区域 - GSOGeoPolygon3D restPoly = new GSOGeoPolygon3D(); - List inpts = new List(); - if (layer != null) - { - //红线区域 - GSOFeature sevenfeature = new GSOFeature(); - sevenfeature.Geometry = sevenPolygon; - - //获取不完全包含在面中的所有线 - GSOFeatures feats = layer.FindFeaturesInPolygon(sevenPolygon, false); - //获取完全包含在面中的所有线 - GSOFeatures featsTrue = layer.FindFeaturesInPolygon(sevenPolygon, true); - //获取面中所有对象组成的切割面的长线 - GSOFeature feature = new GSOFeature(); - - feature = getLineFromGSOFeatures(feats, featsTrue);//管线多个feature拼成一个feature - - //globeControl1.Globe.MemoryLayer.AddFeature(feature); - //globeControl1.Globe.MemoryLayer.AddFeature(sevenfeature); - if (feature != null) - { - //线切割面,输出 - //feature.HighLight = true; - GSODataEngineUtility.GSLineClipPolygon(feature, sevenfeature, out resFeats, out resultstyle); - } - else - { - MessageBox.Show("没有找到切割面的线对象!"); - } - ////////////////绘制分割后的多边形/////////////// - for (int a = 0; a < resFeats.Length; a++) - { - - GSOFeature gf = resFeats[1]; - globeControl1.Globe.MemoryLayer.AddFeature(gf); - - } - } - - - } - } - - private void buttonItem143_Click(object sender, EventArgs e) - { - //获得红线polygon - GSOLayer layerSevenLine = globeControl1.Globe.Layers.Add("d:\\lineAndPolygon.lgd"); - GSOLayer layerSevenLine2 = globeControl1.Globe.Layers.GetLayerByCaption("d:\\lineAndPolygon.lgd"); - //获得红线结果列表 - ArrayList rrLists = new ArrayList(); - - - // if (redlinelayername != "") - { - GSOFeatures fs = layerSevenLine.GetAllFeatures(); - int len = fs.Length; - - GSOGeoPolyline3D linetest = new GSOGeoPolyline3D(); - GSOGeoPolygon3D sevenPolygon = new GSOGeoPolygon3D(); - - GSOFeature linefeat = fs.FindByID(2); - //linefeat.Geometry = linetest; - GSOFeature polyfeat = fs.FindByID(1); - //polyfeat.Geometry = sevenPolygon; - - //线切割面定义,输出用 - GSOFeatures resFeats = new GSOFeatures(); - int resultstyle = 0; - GSODataEngineUtility.GSLineClipPolygon(linefeat, polyfeat, out resFeats, out resultstyle); - - ////////////////绘制分割后的多边形/////////////// - for (int a = 0; a < resFeats.Length; a++) - { - - GSOFeature gf = resFeats[0]; - globeControl1.Globe.MemoryLayer.AddFeature(gf); - - } - ////把红线切成一段段的线段,获得切前的红线点集 - List redpts = new List();//切前的红线点集合 - for (int i = 0; i < linetest.PartCount; i++) - { - GSOPoint3ds partP = linetest[i]; - for (int j = 0; j < partP.Count; j++) - { - redpts.Add(partP[j]); - } - } - - List redpts2 = new List();//切前的红线点集合 - for (int i = 0; i < sevenPolygon.PartCount; i++) - { - GSOPoint3ds partP = sevenPolygon[i]; - for (int j = 0; j < partP.Count; j++) - { - redpts2.Add(partP[j]); - } - } - } - } - /// - /// 增加用户手册下载连接 - /// - /// - /// - Cyberpipe.udfiles.UpDownFile UDF = new udfiles.UpDownFile(Utility.udserviceurl); - string dir_Ok = "C:\\Users\\nn-203\\Desktop"; - private void button1_Click(object sender, EventArgs e) - { - if (folderBrowserDialog1.ShowDialog() == DialogResult.OK) //打洙?开a文?件t夹D对?话°框ò - { - dir_Ok = folderBrowserDialog1.SelectedPath; //显?示?选?择?的?文?件t夹D路·径? - - //tempstr = folderBrowserDialog1.SelectedPath; //存?储洹?选?择?的?文?件t夹D路·径? - - } - - Cyberpipe.PED_logicfile.PED_Affair.Redact_D = Utility.uploadpath + "\\SFiles\\UserHbook\\说明.docx"; - if (File.Exists(dir_Ok + "\\" + Files_Name(Cyberpipe.PED_logicfile.PED_Affair.Redact_D, 1))) - { - if (MessageBox.Show("文件夹下有同名文件,是否替换?", "提示", MessageBoxButtons.YesNo, MessageBoxIcon.Information) == DialogResult.No) ; - - } - byte[] file = UDF.Down(Cyberpipe.PED_logicfile.PED_Affair.Redact_D); - FileStream pFileSream = new FileStream(dir_Ok + "\\说明.docx", FileMode.OpenOrCreate); - pFileSream.Write(file, 0, file.Length); - pFileSream.Close(); - if (File.Exists(dir_Ok + "\\" + Files_Name(Cyberpipe.PED_logicfile.PED_Affair.Redact_D, 1)) == true) - { - MessageBox.Show("文件导出成功!"); - } - //PEDAClass.Folder_Handle(dir_Ok + "\\" + PEDAClass.Files_Name(Cyberpipe.PED_logicfile.PED_Affair.Redact_D, 0), Cyberpipe.PED_logicfile.PED_Affair.Redact_D, "", 0); - - } /// /// 获取文件或文件夹的名称 /// @@ -8575,33 +6811,6 @@ return DF_Name; } - private void toolStripDropDownButton1_Click(object sender, EventArgs e) - { - if (folderBrowserDialog1.ShowDialog() == DialogResult.OK) //打洙?开a文?件t夹D对?话°框ò - { - dir_Ok = folderBrowserDialog1.SelectedPath; //显?示?选?择?的?文?件t夹D路·径? - - //tempstr = folderBrowserDialog1.SelectedPath; //存?储洹?选?择?的?文?件t夹D路·径? - - - Cyberpipe.PED_logicfile.PED_Affair.Redact_D = Utility.uploadpath + "\\SFiles\\UserHbook\\说明.docx"; - if (File.Exists(dir_Ok + "\\" + Files_Name(Cyberpipe.PED_logicfile.PED_Affair.Redact_D, 1))) - { - if (MessageBox.Show("文件夹下有同名文件,是否替换?", "提示", MessageBoxButtons.YesNo, MessageBoxIcon.Information) == DialogResult.No) ; - - } - byte[] file = UDF.Down(Cyberpipe.PED_logicfile.PED_Affair.Redact_D); - FileStream pFileSream = new FileStream(dir_Ok + "\\说明.docx", FileMode.OpenOrCreate); - pFileSream.Write(file, 0, file.Length); - pFileSream.Close(); - if (File.Exists(dir_Ok + "\\" + Files_Name(Cyberpipe.PED_logicfile.PED_Affair.Redact_D, 1)) == true) - { - MessageBox.Show("文件导出成功!"); - } - - } - } - /// /// 空间查询 /// @@ -9792,7 +8001,7 @@ GSOLayer resLayer = null; GSOFeature resFeature = null; globeControl1.Globe.GetSelectObject(0, out resFeature, out resLayer); - + if (resFeature == null) return; GSOGeoPolyline3D line1 = resFeature.Geometry as GSOGeoPolyline3D; if (line1 == null) { @@ -9876,7 +8085,7 @@ GSOLayer resLayer = null; GSOFeature resFeature = null; globeControl1.Globe.GetSelectObject(0, out resFeature, out resLayer); - + if (resFeature == null) return; GSOGeoPolyline3D line1 = resFeature.Geometry as GSOGeoPolyline3D; if (line1 == null) { @@ -9891,7 +8100,8 @@ } GSOFeatures feats = globeControl1.Globe.MemoryLayer.GetFeatureByName("粒子要素", true); - if (feats.Length > 0) + + if (feats!=null&&feats.Length > 0) globeControl1.Globe.MemoryLayer.RemoveFeatureByID(feats[0].ID); //if (emitterFeature != null) //{ @@ -11121,88 +9331,6 @@ } private int connectServerCount = 0; - - /// - /// 还原球到实测库 - /// - private void refreshGlobe1() - { - //添加实测库图层已有图层 - int servernum = 0; - //1.清除global1上 - for (int i = globeControl1.Globe.Layers.Count - 1; i >= 0; i--) - { - GSOLayer layer = globeControl1.Globe.Layers[i]; - if (!layer.Name.Contains("fttp:")) - { - layer.Dataset.Close();//清除内存 - globeControl1.Globe.Layers.Remove(layer); - } - else - { - servernum++; - } - } - - //globeControl1.Globe.ConnectServer(Utility.serverip, Utility.serverport, "", ""); //加载locaServer中的数据 - - //2.添加实测库图层 - string[] markerStrs = new string[9]; - markerStrs[0] = "标高标注"; - markerStrs[1] = "管径标注"; - markerStrs[2] = "埋深标注"; - markerStrs[3] = "坐标标注"; - markerStrs[4] = "坡度标注"; - markerStrs[5] = "属性标注"; - markerStrs[6] = "自定义标注"; - markerStrs[7] = "距离标注"; - markerStrs[8] = "扯旗标注"; - for (int i = 0; i < markerStrs.Length; i++) - { - if (File.Exists(Application.StartupPath + "\\标注管理\\" + markerStrs[i] + ".lgd")) - { - GSOLayer markerLayer = globeControl1.Globe.Layers.Add(Application.StartupPath + "\\标注管理\\" + markerStrs[i] + ".lgd"); - } - } - - for (int i = 0; i < g1layername.Count; i++) - { - string g1name = g1layername[i]; - GSODataset datasetg1 = Utility.dataSource.GetDatasetByName(g1name); - GSOLayer templayer = globeControl1.Globe.Layers.Add(datasetg1); - templayer.MaxVisibleAltitude = -1; - } - layerTemp = globeControl1.Globe.Layers.Add(Application.StartupPath + "\\tempLgdData.lgd"); - globeControl1.Globe.Layers.Add(Application.StartupPath + "/城市七线/城市红线.lgd"); - globeControl1.Globe.Layers.Add(Application.StartupPath + "/城市七线/城市橙线.lgd"); - globeControl1.Globe.Layers.Add(Application.StartupPath + "/城市七线/城市黄线.lgd"); - globeControl1.Globe.Layers.Add(Application.StartupPath + "/城市七线/城市绿线.lgd"); - globeControl1.Globe.Layers.Add(Application.StartupPath + "/城市七线/城市蓝线.lgd"); - globeControl1.Globe.Layers.Add(Application.StartupPath + "/城市七线/城市紫线.lgd"); - globeControl1.Globe.Layers.Add(Application.StartupPath + "/城市七线/城市黑线.lgd"); - globeControl1.Globe.Layers.Add(Application.StartupPath + "/隧道.lgd"); - - //移动server的数据图层 - for (int i = 0; i < servernum; i++) - { - globeControl1.Globe.Layers.MoveTo(globeControl1.Globe.Layers.Count - 1, 0); - } - - if (layerManagerNode.Nodes.Count > 0) - { - for (int i = layerManagerNode.Nodes.Count - 1; i >= 0; i--) - { - layerManagerNode.Nodes[i].Remove(); - - } - } - - - - globeControl1.Refresh(); - - } - /// /// 碰撞审查 /// @@ -11476,31 +9604,7 @@ // } //} #endregion - /// - /// 数据质量检查 - /// - /// - /// - private void buttonItemSJGL2_Click(object sender, EventArgs e) - { - //日志记录 - LogManager.saveLog(Utility.userName, this.buttonItemSJGL2.Text); - FrmValiData frm = new FrmValiData(globeControl1); - frm.ShowDialog(); - } - /// - /// 数据预处理 - /// - /// - /// - private void buttonItemSJGL3_Click(object sender, EventArgs e) - { - //保存日志 - LogManager.saveLog(Utility.userName, this.buttonItemSJGL3.Text); - FrmEditShapeFile frm = new FrmEditShapeFile(globeControl1); - frm.ShowDialog(this); - } /// /// 连接数据库 /// @@ -12251,60 +10355,6 @@ List lineStruct = new List(); GSOFeature featureSelected = null; - private void AddDatagridView(DataTable table) - { - - if (table != null && table.Rows.Count > 0) - { - dataGridViewX1.DataSource = table; - panelOfTable.Visible = true; - panelOfTable.Height = 200; - toolStripNumbers.Text = "红线审核结果"; - toolStripFeatureLength.Text = " 共有:" + table.Rows.Count + "条"; - } - else - { - - } - - } - - /// - /// 去除集合中重复的管线 - /// - /// - /// - /// - private GSOFeatures getFeaturesByFilter(GSOFeatures features, string fieldName) - { - if (features == null) - { - return null; - } - GSOFeatures featuresGet = new GSOFeatures(); - for (int i = 0; i < features.Length; i++) - { - GSOFeature featureFromFS = features[i]; - string fieldValueFromFS = featureFromFS.GetValue(fieldName).ToString().Trim(); - bool isHas = false; - for (int j = featuresGet.Length - 1; j >= 0; j--) - { - GSOFeature featureFromFSGet = featuresGet[j]; - string fieldValueFromFSGet = featureFromFSGet.GetValue(fieldName).ToString().Trim(); - if (fieldValueFromFS.Equals(fieldValueFromFSGet)) - { - isHas = true; - break; - } - } - if (isHas == false) - { - featuresGet.Add(featureFromFS.Clone()); - } - } - return featuresGet; - } - /// /// 数据管理导入文件 /// @@ -12440,138 +10490,7 @@ // //MessageBox.Show("系统运行错误:" + ex.ToString(), "错误", MessageBoxButtons.OK, MessageBoxIcon.Error); // } //} - - - /// - /// 标识器全区域统计 - /// - /// - /// - private void 标识器分类统计ToolStripMenuItem_Click(object sender, EventArgs e) - { - globeControl1.Globe.Action = EnumAction3D.ActionNull; - FrmBSQStatis bsqStatis = new FrmBSQStatis(); - bsqStatis.Show(this); - } - /// - /// 标识器绘制区域统计 - /// - /// - /// - private void 标识器分类统计ToolStripMenuItem1_Click(object sender, EventArgs e) - { - trackflag = "BSQDuoBianXiangStatis"; - globeControl1.Globe.Action = EnumAction3D.TrackPolygon; - } - - - #region 保存和加载审核库加载的图层 - private void saveLayerList(TreeNodeCollection treeNodeList) - { - string configPath = Application.StartupPath + "\\configLayerList.xml"; - try - { - XmlDocument doc = new XmlDocument(); - doc.Load(configPath); - XmlNode dbParams = doc.SelectSingleNode("Params/dbparams"); - XmlNode dbLayers = doc.SelectSingleNode("Params/dblayers"); - XmlNode layers = doc.SelectSingleNode("Params/layers"); - dbParams.RemoveAll(); - dbLayers.RemoveAll(); - layers.RemoveAll(); - - List listDS = new List(); - String shDatasourceName = Utility.sgdbip + "/" + Utility.sgdbname + "_" + Utility.sgdbuser; - bool flag = false; - - for (int i = 0; i < globeControl1.Globe.DataManager.DataSourceCount; i++) - { - GSODataSource ds = globeControl1.Globe.DataManager.GetDataSourceAt(i); - if (ds != null && ds.Type == EnumDataSourceType.SqlServer || ds.Type == EnumDataSourceType.Oracle) - { - if (ds.Name == shDatasourceName) - { - //防止因为多次连接同一个数据库 - if (flag == true) - { - break; - } - flag = true; - listDS.Add(ds); - GSODataSourceCnn conn = ds.GetConnectionInfo(); - - XmlElement dbparam = doc.CreateElement("shdbparam"); - XmlElement ip = doc.CreateElement("ship"); - ip.InnerText = conn.Server; - - XmlElement dbname = doc.CreateElement("shdbname"); - dbname.InnerText = conn.Database; - - XmlElement username = doc.CreateElement("shusername"); - username.InnerText = conn.User; - - XmlElement password = doc.CreateElement("shpassword"); - password.InnerText = conn.Password; - - XmlElement type = doc.CreateElement("shtype"); - if (ds.Type == EnumDataSourceType.SqlServer) - { - type.InnerText = "sqlserver"; - } - else - { - type.InnerText = "oracle"; - } - - dbparam.AppendChild(ip); - dbparam.AppendChild(dbname); - dbparam.AppendChild(username); - dbparam.AppendChild(password); - dbparam.AppendChild(type); - dbParams.AppendChild(dbparam); - } - - } - } - - for (int i = 0; i < treeNodeList.Count; i++) - { - GSOLayer layer = treeNodeList[i].Tag as GSOLayer; - if (Path.GetExtension(layer.Name) == "") - { - XmlElement dbLayer = doc.CreateElement("dblayer"); - XmlAttribute attri = doc.CreateAttribute("dbindex"); - for (int j = 0; j < listDS.Count; j++) - { - if (layer.Dataset.DataSource.Name == listDS[j].Name) - { - attri.Value = j.ToString(); - break; - } - } - dbLayer.Attributes.Append(attri); - dbLayer.InnerText = layer.Name; - - dbLayers.AppendChild(dbLayer); - } - else - { - XmlElement dbLayer = doc.CreateElement("layer"); - dbLayer.InnerText = layer.Name; - layers.AppendChild(dbLayer); - } - } - - doc.Save(configPath); - } - catch (Exception e) - { - - } - } - - #endregion - + private void buttonItem_TaskManager_Click(object sender, EventArgs e) { if (Form_TaksManager.IS_OPEN) diff --git a/MainFrm.designer.cs b/MainFrm.designer.cs index 233ef8c..97b8299 100644 --- a/MainFrm.designer.cs +++ b/MainFrm.designer.cs @@ -82,6 +82,7 @@ this.sideBar1 = new DevComponents.DotNetBar.SideBar(); this.panelEx3 = new DevComponents.DotNetBar.PanelEx(); this.layerSensorTree = new System.Windows.Forms.TreeView(); + this.layerTree = new Cyberpipe.MyTreeView(); this.sideBarPanelItem3 = new DevComponents.DotNetBar.SideBarPanelItem(); this.controlContainerItem3 = new DevComponents.DotNetBar.ControlContainerItem(); this.sideBarPanelItem4 = new DevComponents.DotNetBar.SideBarPanelItem(); @@ -365,30 +366,26 @@ this.可编辑ToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); this.保存ToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); this.ribbonControl1 = new DevComponents.DotNetBar.RibbonControl(); - this.ribbonPanel1 = new DevComponents.DotNetBar.RibbonPanel(); - this.ribbonBar21 = new DevComponents.DotNetBar.RibbonBar(); - this.buttonItem87 = new DevComponents.DotNetBar.ButtonItem(); - this.buttonItem88 = new DevComponents.DotNetBar.ButtonItem(); - this.buttonItem27 = new DevComponents.DotNetBar.ButtonItem(); - this.buttonItem91 = new DevComponents.DotNetBar.ButtonItem(); - this.buttonItem1 = new DevComponents.DotNetBar.ButtonItem(); - this.btnlegendSet = new DevComponents.DotNetBar.ButtonItem(); - this.buttonItem89 = new DevComponents.DotNetBar.ButtonItem(); - this.ribbonPanel7 = new DevComponents.DotNetBar.RibbonPanel(); - this.ribbonBar5 = new DevComponents.DotNetBar.RibbonBar(); - this.btn_flag = new DevComponents.DotNetBar.ButtonItem(); - this.slider4ground = new DevComponents.DotNetBar.SliderItem(); - this.ribbonPanel2 = new DevComponents.DotNetBar.RibbonPanel(); - this.ribbonBar4 = new DevComponents.DotNetBar.RibbonBar(); - this.buttonItem_TaskManager = new DevComponents.DotNetBar.ButtonItem(); - this.buttonItem_OnlineTask = new DevComponents.DotNetBar.ButtonItem(); - this.buttonItem_Event = new DevComponents.DotNetBar.ButtonItem(); this.ribbonPanel3 = new DevComponents.DotNetBar.RibbonPanel(); this.ribbonBar3 = new DevComponents.DotNetBar.RibbonBar(); this.btn_device = new DevComponents.DotNetBar.ButtonItem(); this.btn_Person = new DevComponents.DotNetBar.ButtonItem(); this.btn_constructMap = new DevComponents.DotNetBar.ButtonItem(); this.buttonItem9 = new DevComponents.DotNetBar.ButtonItem(); + this.ribbonPanel2 = new DevComponents.DotNetBar.RibbonPanel(); + this.ribbonBar4 = new DevComponents.DotNetBar.RibbonBar(); + this.buttonItem_TaskManager = new DevComponents.DotNetBar.ButtonItem(); + this.buttonItem_OnlineTask = new DevComponents.DotNetBar.ButtonItem(); + this.buttonItem_Event = new DevComponents.DotNetBar.ButtonItem(); + this.ribbonPanel1 = new DevComponents.DotNetBar.RibbonPanel(); + this.ribbonBar21 = new DevComponents.DotNetBar.RibbonBar(); + this.buttonItem87 = new DevComponents.DotNetBar.ButtonItem(); + this.buttonItem88 = new DevComponents.DotNetBar.ButtonItem(); + this.buttonItem27 = new DevComponents.DotNetBar.ButtonItem(); + this.buttonItem1 = new DevComponents.DotNetBar.ButtonItem(); + this.buttonItem91 = new DevComponents.DotNetBar.ButtonItem(); + this.btnlegendSet = new DevComponents.DotNetBar.ButtonItem(); + this.buttonItem89 = new DevComponents.DotNetBar.ButtonItem(); this.ribbonPanel8 = new DevComponents.DotNetBar.RibbonPanel(); this.ribbonBar_UserInfo = new DevComponents.DotNetBar.RibbonBar(); this.btn_user_info = new DevComponents.DotNetBar.ButtonItem(); @@ -398,6 +395,10 @@ this.btn_user_role = new DevComponents.DotNetBar.ButtonItem(); this.btn_password_edit = new DevComponents.DotNetBar.ButtonItem(); this.btn_reset_password = new DevComponents.DotNetBar.ButtonItem(); + this.ribbonPanel7 = new DevComponents.DotNetBar.RibbonPanel(); + this.ribbonBar5 = new DevComponents.DotNetBar.RibbonBar(); + this.btn_flag = new DevComponents.DotNetBar.ButtonItem(); + this.slider4ground = new DevComponents.DotNetBar.SliderItem(); this.ribbonPanel15 = new DevComponents.DotNetBar.RibbonPanel(); this.ribbonBar20 = new DevComponents.DotNetBar.RibbonBar(); this.buttonItemSJGL = new DevComponents.DotNetBar.ButtonItem(); @@ -610,7 +611,6 @@ this.buttonItem84 = new DevComponents.DotNetBar.ButtonItem(); this.buttonItem75 = new DevComponents.DotNetBar.ButtonItem(); this.buttonItem76 = new DevComponents.DotNetBar.ButtonItem(); - this.layerTree = new Cyberpipe.MyTreeView(); this.statusStrip1.SuspendLayout(); this.sideBar1.SuspendLayout(); this.panelEx3.SuspendLayout(); @@ -647,11 +647,11 @@ this.contextMenuStrip3.SuspendLayout(); this.contextMenuStripDeleteLayerNode.SuspendLayout(); this.ribbonControl1.SuspendLayout(); - this.ribbonPanel1.SuspendLayout(); - this.ribbonPanel7.SuspendLayout(); - this.ribbonPanel2.SuspendLayout(); this.ribbonPanel3.SuspendLayout(); + this.ribbonPanel2.SuspendLayout(); + this.ribbonPanel1.SuspendLayout(); this.ribbonPanel8.SuspendLayout(); + this.ribbonPanel7.SuspendLayout(); this.ribbonPanel15.SuspendLayout(); ((System.ComponentModel.ISupportInitialize)(this.pictureBox1)).BeginInit(); this.SuspendLayout(); @@ -813,7 +813,6 @@ this.toolStripDropDownButton1.Size = new System.Drawing.Size(45, 21); this.toolStripDropDownButton1.Text = "帮助"; this.toolStripDropDownButton1.Visible = false; - this.toolStripDropDownButton1.Click += new System.EventHandler(this.toolStripDropDownButton1_Click); // // controlContainerItem1 // @@ -1047,6 +1046,16 @@ this.layerSensorTree.AfterCheck += new System.Windows.Forms.TreeViewEventHandler(this.layerMarkerTree_AfterCheck); this.layerSensorTree.NodeMouseClick += new System.Windows.Forms.TreeNodeMouseClickEventHandler(this.layerMarkerTree_NodeMouseClick); // + // layerTree + // + this.layerTree.CheckBoxes = true; + this.layerTree.ItemHeight = 18; + this.layerTree.Location = new System.Drawing.Point(30, 78); + this.layerTree.Name = "layerTree"; + this.layerTree.Size = new System.Drawing.Size(121, 97); + this.layerTree.TabIndex = 1; + this.layerTree.AfterCheck += new System.Windows.Forms.TreeViewEventHandler(this.layerTree_AfterCheck); + // // sideBarPanelItem3 // this.sideBarPanelItem3.FontBold = true; @@ -2966,28 +2975,28 @@ // 平移对象ToolStripMenuItem // this.平移对象ToolStripMenuItem.Name = "平移对象ToolStripMenuItem"; - this.平移对象ToolStripMenuItem.Size = new System.Drawing.Size(152, 22); + this.平移对象ToolStripMenuItem.Size = new System.Drawing.Size(124, 22); this.平移对象ToolStripMenuItem.Text = "平移对象"; this.平移对象ToolStripMenuItem.Click += new System.EventHandler(this.buttonItemBJ6_Click); // // 升降对象ToolStripMenuItem // this.升降对象ToolStripMenuItem.Name = "升降对象ToolStripMenuItem"; - this.升降对象ToolStripMenuItem.Size = new System.Drawing.Size(152, 22); + this.升降对象ToolStripMenuItem.Size = new System.Drawing.Size(124, 22); this.升降对象ToolStripMenuItem.Text = "升降对象"; this.升降对象ToolStripMenuItem.Click += new System.EventHandler(this.buttonItemBJ7_Click); // // 旋转对象ToolStripMenuItem // this.旋转对象ToolStripMenuItem.Name = "旋转对象ToolStripMenuItem"; - this.旋转对象ToolStripMenuItem.Size = new System.Drawing.Size(152, 22); + this.旋转对象ToolStripMenuItem.Size = new System.Drawing.Size(124, 22); this.旋转对象ToolStripMenuItem.Text = "旋转对象"; this.旋转对象ToolStripMenuItem.Click += new System.EventHandler(this.buttonItemBJ8_Click); // // 连接管段ToolStripMenuItem // this.连接管段ToolStripMenuItem.Name = "连接管段ToolStripMenuItem"; - this.连接管段ToolStripMenuItem.Size = new System.Drawing.Size(152, 22); + this.连接管段ToolStripMenuItem.Size = new System.Drawing.Size(124, 22); this.连接管段ToolStripMenuItem.Text = "连接管段"; this.连接管段ToolStripMenuItem.Click += new System.EventHandler(this.buttonItemBJ9_Click); // @@ -2997,34 +3006,34 @@ this.导出CADToolStripMenuItem, this.导出文件ToolStripMenuItem1}); this.导出文件ToolStripMenuItem.Name = "导出文件ToolStripMenuItem"; - this.导出文件ToolStripMenuItem.Size = new System.Drawing.Size(152, 22); + this.导出文件ToolStripMenuItem.Size = new System.Drawing.Size(124, 22); this.导出文件ToolStripMenuItem.Text = "导出矢量"; // // 导出CADToolStripMenuItem // this.导出CADToolStripMenuItem.Name = "导出CADToolStripMenuItem"; - this.导出CADToolStripMenuItem.Size = new System.Drawing.Size(152, 22); + this.导出CADToolStripMenuItem.Size = new System.Drawing.Size(125, 22); this.导出CADToolStripMenuItem.Text = "导出CAD"; this.导出CADToolStripMenuItem.Click += new System.EventHandler(this.buttonItemBJ10_1_Click); // // 导出文件ToolStripMenuItem1 // this.导出文件ToolStripMenuItem1.Name = "导出文件ToolStripMenuItem1"; - this.导出文件ToolStripMenuItem1.Size = new System.Drawing.Size(152, 22); + this.导出文件ToolStripMenuItem1.Size = new System.Drawing.Size(125, 22); this.导出文件ToolStripMenuItem1.Text = "导出文件"; this.导出文件ToolStripMenuItem1.Click += new System.EventHandler(this.buttonItemBJ10_2_Click); // // 前进ToolStripMenuItem // this.前进ToolStripMenuItem.Name = "前进ToolStripMenuItem"; - this.前进ToolStripMenuItem.Size = new System.Drawing.Size(152, 22); + this.前进ToolStripMenuItem.Size = new System.Drawing.Size(124, 22); this.前进ToolStripMenuItem.Text = "前进"; this.前进ToolStripMenuItem.Click += new System.EventHandler(this.buttonItemBJ12_Click); // // 删除模型ToolStripMenuItem // this.删除模型ToolStripMenuItem.Name = "删除模型ToolStripMenuItem"; - this.删除模型ToolStripMenuItem.Size = new System.Drawing.Size(152, 22); + this.删除模型ToolStripMenuItem.Size = new System.Drawing.Size(124, 22); this.删除模型ToolStripMenuItem.Text = "后退"; this.删除模型ToolStripMenuItem.Click += new System.EventHandler(this.buttonItemBJ11_Click); // @@ -4160,6 +4169,198 @@ this.ribbonControl1.Text = "ribbonControl1"; this.ribbonControl1.UseCustomizeDialog = false; // + // ribbonPanel3 + // + this.ribbonPanel3.ColorSchemeStyle = DevComponents.DotNetBar.eDotNetBarStyle.StyleManagerControlled; + this.ribbonPanel3.Controls.Add(this.ribbonBar3); + this.ribbonPanel3.Dock = System.Windows.Forms.DockStyle.Fill; + this.ribbonPanel3.Location = new System.Drawing.Point(0, 33); + this.ribbonPanel3.Name = "ribbonPanel3"; + this.ribbonPanel3.Padding = new System.Windows.Forms.Padding(3, 0, 3, 3); + this.ribbonPanel3.Size = new System.Drawing.Size(1328, 62); + // + // + // + this.ribbonPanel3.Style.Class = ""; + this.ribbonPanel3.Style.CornerType = DevComponents.DotNetBar.eCornerType.Square; + // + // + // + this.ribbonPanel3.StyleMouseDown.Class = ""; + this.ribbonPanel3.StyleMouseDown.CornerType = DevComponents.DotNetBar.eCornerType.Square; + // + // + // + this.ribbonPanel3.StyleMouseOver.Class = ""; + this.ribbonPanel3.StyleMouseOver.CornerType = DevComponents.DotNetBar.eCornerType.Square; + this.ribbonPanel3.TabIndex = 40; + // + // ribbonBar3 + // + this.ribbonBar3.AutoOverflowEnabled = true; + // + // + // + this.ribbonBar3.BackgroundMouseOverStyle.Class = ""; + this.ribbonBar3.BackgroundMouseOverStyle.CornerType = DevComponents.DotNetBar.eCornerType.Square; + // + // + // + this.ribbonBar3.BackgroundStyle.Class = ""; + this.ribbonBar3.BackgroundStyle.CornerType = DevComponents.DotNetBar.eCornerType.Square; + this.ribbonBar3.ContainerControlProcessDialogKey = true; + this.ribbonBar3.Dock = System.Windows.Forms.DockStyle.Left; + this.ribbonBar3.Items.AddRange(new DevComponents.DotNetBar.BaseItem[] { + this.btn_device, + this.btn_Person, + this.btn_constructMap, + this.buttonItem9}); + this.ribbonBar3.Location = new System.Drawing.Point(3, 0); + this.ribbonBar3.Name = "ribbonBar3"; + this.ribbonBar3.Size = new System.Drawing.Size(378, 59); + this.ribbonBar3.Style = DevComponents.DotNetBar.eDotNetBarStyle.StyleManagerControlled; + this.ribbonBar3.TabIndex = 0; + // + // + // + this.ribbonBar3.TitleStyle.Class = ""; + this.ribbonBar3.TitleStyle.CornerType = DevComponents.DotNetBar.eCornerType.Square; + // + // + // + this.ribbonBar3.TitleStyleMouseOver.Class = ""; + this.ribbonBar3.TitleStyleMouseOver.CornerType = DevComponents.DotNetBar.eCornerType.Square; + this.ribbonBar3.TitleVisible = false; + // + // btn_device + // + this.btn_device.ButtonStyle = DevComponents.DotNetBar.eButtonStyle.ImageAndText; + this.btn_device.Image = global::Cyberpipe.Properties.Resources._24X24__2__02; + this.btn_device.ImagePosition = DevComponents.DotNetBar.eImagePosition.Top; + this.btn_device.Name = "btn_device"; + this.btn_device.SubItemsExpandWidth = 14; + this.btn_device.Text = "探测仪管理"; + this.btn_device.Click += new System.EventHandler(this.btn_device_Click); + // + // btn_Person + // + this.btn_Person.ButtonStyle = DevComponents.DotNetBar.eButtonStyle.ImageAndText; + this.btn_Person.Image = global::Cyberpipe.Properties.Resources._24x24icon_05_hover1; + this.btn_Person.ImagePosition = DevComponents.DotNetBar.eImagePosition.Top; + this.btn_Person.Name = "btn_Person"; + this.btn_Person.SubItemsExpandWidth = 14; + this.btn_Person.Text = "定位人员维护"; + this.btn_Person.Click += new System.EventHandler(this.btn_Person_Click); + // + // btn_constructMap + // + this.btn_constructMap.Image = global::Cyberpipe.Properties.Resources._24x24icon_04_hover; + this.btn_constructMap.ImagePosition = DevComponents.DotNetBar.eImagePosition.Top; + this.btn_constructMap.Name = "btn_constructMap"; + this.btn_constructMap.SubItemsExpandWidth = 14; + this.btn_constructMap.Text = "导出施工图"; + this.btn_constructMap.Click += new System.EventHandler(this.btn_constructMap_Click); + // + // buttonItem9 + // + this.buttonItem9.Image = global::Cyberpipe.Properties.Resources._24x24icon__2__10; + this.buttonItem9.ImagePosition = DevComponents.DotNetBar.eImagePosition.Top; + this.buttonItem9.Name = "buttonItem9"; + this.buttonItem9.SubItemsExpandWidth = 14; + this.buttonItem9.Text = "文档管理"; + this.buttonItem9.Click += new System.EventHandler(this.buttonItem9_Click); + // + // ribbonPanel2 + // + this.ribbonPanel2.ColorSchemeStyle = DevComponents.DotNetBar.eDotNetBarStyle.StyleManagerControlled; + this.ribbonPanel2.Controls.Add(this.ribbonBar4); + this.ribbonPanel2.Dock = System.Windows.Forms.DockStyle.Fill; + this.ribbonPanel2.Location = new System.Drawing.Point(0, 0); + this.ribbonPanel2.Name = "ribbonPanel2"; + this.ribbonPanel2.Padding = new System.Windows.Forms.Padding(3, 0, 3, 3); + this.ribbonPanel2.Size = new System.Drawing.Size(1328, 95); + // + // + // + this.ribbonPanel2.Style.Class = ""; + this.ribbonPanel2.Style.CornerType = DevComponents.DotNetBar.eCornerType.Square; + // + // + // + this.ribbonPanel2.StyleMouseDown.Class = ""; + this.ribbonPanel2.StyleMouseDown.CornerType = DevComponents.DotNetBar.eCornerType.Square; + // + // + // + this.ribbonPanel2.StyleMouseOver.Class = ""; + this.ribbonPanel2.StyleMouseOver.CornerType = DevComponents.DotNetBar.eCornerType.Square; + this.ribbonPanel2.TabIndex = 39; + this.ribbonPanel2.Visible = false; + // + // ribbonBar4 + // + this.ribbonBar4.AutoOverflowEnabled = true; + // + // + // + this.ribbonBar4.BackgroundMouseOverStyle.Class = ""; + this.ribbonBar4.BackgroundMouseOverStyle.CornerType = DevComponents.DotNetBar.eCornerType.Square; + // + // + // + this.ribbonBar4.BackgroundStyle.Class = ""; + this.ribbonBar4.BackgroundStyle.CornerType = DevComponents.DotNetBar.eCornerType.Square; + this.ribbonBar4.ContainerControlProcessDialogKey = true; + this.ribbonBar4.Dock = System.Windows.Forms.DockStyle.Left; + this.ribbonBar4.Items.AddRange(new DevComponents.DotNetBar.BaseItem[] { + this.buttonItem_TaskManager, + this.buttonItem_OnlineTask, + this.buttonItem_Event}); + this.ribbonBar4.Location = new System.Drawing.Point(3, 0); + this.ribbonBar4.Name = "ribbonBar4"; + this.ribbonBar4.Size = new System.Drawing.Size(299, 92); + this.ribbonBar4.Style = DevComponents.DotNetBar.eDotNetBarStyle.StyleManagerControlled; + this.ribbonBar4.TabIndex = 0; + this.ribbonBar4.Text = "ribbonBar4"; + // + // + // + this.ribbonBar4.TitleStyle.Class = ""; + this.ribbonBar4.TitleStyle.CornerType = DevComponents.DotNetBar.eCornerType.Square; + // + // + // + this.ribbonBar4.TitleStyleMouseOver.Class = ""; + this.ribbonBar4.TitleStyleMouseOver.CornerType = DevComponents.DotNetBar.eCornerType.Square; + this.ribbonBar4.TitleVisible = false; + // + // buttonItem_TaskManager + // + this.buttonItem_TaskManager.Image = global::Cyberpipe.Properties.Resources._24x24icon__2__76; + this.buttonItem_TaskManager.ImagePosition = DevComponents.DotNetBar.eImagePosition.Top; + this.buttonItem_TaskManager.Name = "buttonItem_TaskManager"; + this.buttonItem_TaskManager.SubItemsExpandWidth = 14; + this.buttonItem_TaskManager.Text = "工单管理"; + this.buttonItem_TaskManager.Click += new System.EventHandler(this.buttonItem_TaskManager_Click); + // + // buttonItem_OnlineTask + // + this.buttonItem_OnlineTask.Image = global::Cyberpipe.Properties.Resources._24x24icon__2__69; + this.buttonItem_OnlineTask.ImagePosition = DevComponents.DotNetBar.eImagePosition.Top; + this.buttonItem_OnlineTask.Name = "buttonItem_OnlineTask"; + this.buttonItem_OnlineTask.SubItemsExpandWidth = 14; + this.buttonItem_OnlineTask.Text = "在线任务"; + this.buttonItem_OnlineTask.Click += new System.EventHandler(this.buttonItem_OnlineTask_Click); + // + // buttonItem_Event + // + this.buttonItem_Event.Image = global::Cyberpipe.Properties.Resources._24x24icon__2__72; + this.buttonItem_Event.ImagePosition = DevComponents.DotNetBar.eImagePosition.Top; + this.buttonItem_Event.Name = "buttonItem_Event"; + this.buttonItem_Event.SubItemsExpandWidth = 14; + this.buttonItem_Event.Text = "事件管理"; + this.buttonItem_Event.Click += new System.EventHandler(this.buttonItem_Event_Click); + // // ribbonPanel1 // this.ribbonPanel1.AutoSize = true; @@ -4262,6 +4463,15 @@ this.buttonItem27.Visible = false; this.buttonItem27.Click += new System.EventHandler(this.buttonItem27_Click); // + // buttonItem1 + // + this.buttonItem1.Image = global::Cyberpipe.Properties.Resources._24x24icon__2__94; + this.buttonItem1.ImagePosition = DevComponents.DotNetBar.eImagePosition.Top; + this.buttonItem1.Name = "buttonItem1"; + this.buttonItem1.SubItemsExpandWidth = 14; + this.buttonItem1.Text = "图层管理"; + this.buttonItem1.Click += new System.EventHandler(this.buttonItem1_Click); + // // buttonItem91 // this.buttonItem91.ForeColor = System.Drawing.Color.Black; @@ -4272,15 +4482,6 @@ this.buttonItem91.Text = "快速定位"; this.buttonItem91.Click += new System.EventHandler(this.buttonItem91_Click); // - // buttonItem1 - // - this.buttonItem1.Image = global::Cyberpipe.Properties.Resources._24x24icon__2__94; - this.buttonItem1.ImagePosition = DevComponents.DotNetBar.eImagePosition.Top; - this.buttonItem1.Name = "buttonItem1"; - this.buttonItem1.SubItemsExpandWidth = 14; - this.buttonItem1.Text = "图层管理"; - this.buttonItem1.Click += new System.EventHandler(this.buttonItem1_Click); - // // btnlegendSet // this.btnlegendSet.Image = global::Cyberpipe.Properties.Resources._24x24icon__2__93; @@ -4300,278 +4501,6 @@ this.buttonItem89.Visible = false; this.buttonItem89.Click += new System.EventHandler(this.buttonItem89_Click); // - // ribbonPanel7 - // - this.ribbonPanel7.ColorSchemeStyle = DevComponents.DotNetBar.eDotNetBarStyle.StyleManagerControlled; - this.ribbonPanel7.Controls.Add(this.ribbonBar5); - this.ribbonPanel7.Dock = System.Windows.Forms.DockStyle.Fill; - this.ribbonPanel7.Location = new System.Drawing.Point(0, 0); - this.ribbonPanel7.Name = "ribbonPanel7"; - this.ribbonPanel7.Padding = new System.Windows.Forms.Padding(3, 0, 3, 3); - this.ribbonPanel7.Size = new System.Drawing.Size(1328, 95); - // - // - // - this.ribbonPanel7.Style.Class = ""; - this.ribbonPanel7.Style.CornerType = DevComponents.DotNetBar.eCornerType.Square; - // - // - // - this.ribbonPanel7.StyleMouseDown.Class = ""; - this.ribbonPanel7.StyleMouseDown.CornerType = DevComponents.DotNetBar.eCornerType.Square; - // - // - // - this.ribbonPanel7.StyleMouseOver.Class = ""; - this.ribbonPanel7.StyleMouseOver.CornerType = DevComponents.DotNetBar.eCornerType.Square; - this.ribbonPanel7.TabIndex = 41; - this.ribbonPanel7.Visible = false; - // - // ribbonBar5 - // - this.ribbonBar5.AutoOverflowEnabled = true; - // - // - // - this.ribbonBar5.BackgroundMouseOverStyle.Class = ""; - this.ribbonBar5.BackgroundMouseOverStyle.CornerType = DevComponents.DotNetBar.eCornerType.Square; - // - // - // - this.ribbonBar5.BackgroundStyle.Class = ""; - this.ribbonBar5.BackgroundStyle.CornerType = DevComponents.DotNetBar.eCornerType.Square; - this.ribbonBar5.ContainerControlProcessDialogKey = true; - this.ribbonBar5.Dock = System.Windows.Forms.DockStyle.Left; - this.ribbonBar5.Items.AddRange(new DevComponents.DotNetBar.BaseItem[] { - this.btn_flag, - this.slider4ground}); - this.ribbonBar5.Location = new System.Drawing.Point(3, 0); - this.ribbonBar5.Name = "ribbonBar5"; - this.ribbonBar5.Size = new System.Drawing.Size(418, 92); - this.ribbonBar5.Style = DevComponents.DotNetBar.eDotNetBarStyle.StyleManagerControlled; - this.ribbonBar5.TabIndex = 0; - // - // - // - this.ribbonBar5.TitleStyle.Class = ""; - this.ribbonBar5.TitleStyle.CornerType = DevComponents.DotNetBar.eCornerType.Square; - // - // - // - this.ribbonBar5.TitleStyleMouseOver.Class = ""; - this.ribbonBar5.TitleStyleMouseOver.CornerType = DevComponents.DotNetBar.eCornerType.Square; - this.ribbonBar5.TitleVisible = false; - this.ribbonBar5.ItemClick += new System.EventHandler(this.ribbonBar5_ItemClick); - // - // btn_flag - // - this.btn_flag.Image = global::Cyberpipe.Properties.Resources._24x24icon_03_hover; - this.btn_flag.ImagePosition = DevComponents.DotNetBar.eImagePosition.Top; - this.btn_flag.Name = "btn_flag"; - this.btn_flag.SubItemsExpandWidth = 14; - this.btn_flag.Text = "标识器管理"; - this.btn_flag.Click += new System.EventHandler(this.btn_flag_Click); - // - // slider4ground - // - this.slider4ground.LabelPosition = DevComponents.DotNetBar.eSliderLabelPosition.Top; - this.slider4ground.Name = "slider4ground"; - this.slider4ground.Text = "地面透明度"; - this.slider4ground.Value = 0; - this.slider4ground.ValueChanged += new System.EventHandler(this.slider4ground_ValueChanged); - // - // ribbonPanel2 - // - this.ribbonPanel2.ColorSchemeStyle = DevComponents.DotNetBar.eDotNetBarStyle.StyleManagerControlled; - this.ribbonPanel2.Controls.Add(this.ribbonBar4); - this.ribbonPanel2.Dock = System.Windows.Forms.DockStyle.Fill; - this.ribbonPanel2.Location = new System.Drawing.Point(0, 0); - this.ribbonPanel2.Name = "ribbonPanel2"; - this.ribbonPanel2.Padding = new System.Windows.Forms.Padding(3, 0, 3, 3); - this.ribbonPanel2.Size = new System.Drawing.Size(1328, 95); - // - // - // - this.ribbonPanel2.Style.Class = ""; - this.ribbonPanel2.Style.CornerType = DevComponents.DotNetBar.eCornerType.Square; - // - // - // - this.ribbonPanel2.StyleMouseDown.Class = ""; - this.ribbonPanel2.StyleMouseDown.CornerType = DevComponents.DotNetBar.eCornerType.Square; - // - // - // - this.ribbonPanel2.StyleMouseOver.Class = ""; - this.ribbonPanel2.StyleMouseOver.CornerType = DevComponents.DotNetBar.eCornerType.Square; - this.ribbonPanel2.TabIndex = 39; - this.ribbonPanel2.Visible = false; - // - // ribbonBar4 - // - this.ribbonBar4.AutoOverflowEnabled = true; - // - // - // - this.ribbonBar4.BackgroundMouseOverStyle.Class = ""; - this.ribbonBar4.BackgroundMouseOverStyle.CornerType = DevComponents.DotNetBar.eCornerType.Square; - // - // - // - this.ribbonBar4.BackgroundStyle.Class = ""; - this.ribbonBar4.BackgroundStyle.CornerType = DevComponents.DotNetBar.eCornerType.Square; - this.ribbonBar4.ContainerControlProcessDialogKey = true; - this.ribbonBar4.Dock = System.Windows.Forms.DockStyle.Left; - this.ribbonBar4.Items.AddRange(new DevComponents.DotNetBar.BaseItem[] { - this.buttonItem_TaskManager, - this.buttonItem_OnlineTask, - this.buttonItem_Event}); - this.ribbonBar4.Location = new System.Drawing.Point(3, 0); - this.ribbonBar4.Name = "ribbonBar4"; - this.ribbonBar4.Size = new System.Drawing.Size(299, 92); - this.ribbonBar4.Style = DevComponents.DotNetBar.eDotNetBarStyle.StyleManagerControlled; - this.ribbonBar4.TabIndex = 0; - this.ribbonBar4.Text = "ribbonBar4"; - // - // - // - this.ribbonBar4.TitleStyle.Class = ""; - this.ribbonBar4.TitleStyle.CornerType = DevComponents.DotNetBar.eCornerType.Square; - // - // - // - this.ribbonBar4.TitleStyleMouseOver.Class = ""; - this.ribbonBar4.TitleStyleMouseOver.CornerType = DevComponents.DotNetBar.eCornerType.Square; - this.ribbonBar4.TitleVisible = false; - // - // buttonItem_TaskManager - // - this.buttonItem_TaskManager.Image = global::Cyberpipe.Properties.Resources._24x24icon__2__76; - this.buttonItem_TaskManager.ImagePosition = DevComponents.DotNetBar.eImagePosition.Top; - this.buttonItem_TaskManager.Name = "buttonItem_TaskManager"; - this.buttonItem_TaskManager.SubItemsExpandWidth = 14; - this.buttonItem_TaskManager.Text = "工单管理"; - this.buttonItem_TaskManager.Click += new System.EventHandler(this.buttonItem_TaskManager_Click); - // - // buttonItem_OnlineTask - // - this.buttonItem_OnlineTask.Image = global::Cyberpipe.Properties.Resources._24x24icon__2__69; - this.buttonItem_OnlineTask.ImagePosition = DevComponents.DotNetBar.eImagePosition.Top; - this.buttonItem_OnlineTask.Name = "buttonItem_OnlineTask"; - this.buttonItem_OnlineTask.SubItemsExpandWidth = 14; - this.buttonItem_OnlineTask.Text = "在线任务"; - this.buttonItem_OnlineTask.Click += new System.EventHandler(this.buttonItem_OnlineTask_Click); - // - // buttonItem_Event - // - this.buttonItem_Event.Image = global::Cyberpipe.Properties.Resources._24x24icon__2__72; - this.buttonItem_Event.ImagePosition = DevComponents.DotNetBar.eImagePosition.Top; - this.buttonItem_Event.Name = "buttonItem_Event"; - this.buttonItem_Event.SubItemsExpandWidth = 14; - this.buttonItem_Event.Text = "事件管理"; - this.buttonItem_Event.Click += new System.EventHandler(this.buttonItem_Event_Click); - // - // ribbonPanel3 - // - this.ribbonPanel3.ColorSchemeStyle = DevComponents.DotNetBar.eDotNetBarStyle.StyleManagerControlled; - this.ribbonPanel3.Controls.Add(this.ribbonBar3); - this.ribbonPanel3.Dock = System.Windows.Forms.DockStyle.Fill; - this.ribbonPanel3.Location = new System.Drawing.Point(0, 33); - this.ribbonPanel3.Name = "ribbonPanel3"; - this.ribbonPanel3.Padding = new System.Windows.Forms.Padding(3, 0, 3, 3); - this.ribbonPanel3.Size = new System.Drawing.Size(1328, 62); - // - // - // - this.ribbonPanel3.Style.Class = ""; - this.ribbonPanel3.Style.CornerType = DevComponents.DotNetBar.eCornerType.Square; - // - // - // - this.ribbonPanel3.StyleMouseDown.Class = ""; - this.ribbonPanel3.StyleMouseDown.CornerType = DevComponents.DotNetBar.eCornerType.Square; - // - // - // - this.ribbonPanel3.StyleMouseOver.Class = ""; - this.ribbonPanel3.StyleMouseOver.CornerType = DevComponents.DotNetBar.eCornerType.Square; - this.ribbonPanel3.TabIndex = 40; - // - // ribbonBar3 - // - this.ribbonBar3.AutoOverflowEnabled = true; - // - // - // - this.ribbonBar3.BackgroundMouseOverStyle.Class = ""; - this.ribbonBar3.BackgroundMouseOverStyle.CornerType = DevComponents.DotNetBar.eCornerType.Square; - // - // - // - this.ribbonBar3.BackgroundStyle.Class = ""; - this.ribbonBar3.BackgroundStyle.CornerType = DevComponents.DotNetBar.eCornerType.Square; - this.ribbonBar3.ContainerControlProcessDialogKey = true; - this.ribbonBar3.Dock = System.Windows.Forms.DockStyle.Left; - this.ribbonBar3.Items.AddRange(new DevComponents.DotNetBar.BaseItem[] { - this.btn_device, - this.btn_Person, - this.btn_constructMap, - this.buttonItem9}); - this.ribbonBar3.Location = new System.Drawing.Point(3, 0); - this.ribbonBar3.Name = "ribbonBar3"; - this.ribbonBar3.Size = new System.Drawing.Size(378, 59); - this.ribbonBar3.Style = DevComponents.DotNetBar.eDotNetBarStyle.StyleManagerControlled; - this.ribbonBar3.TabIndex = 0; - // - // - // - this.ribbonBar3.TitleStyle.Class = ""; - this.ribbonBar3.TitleStyle.CornerType = DevComponents.DotNetBar.eCornerType.Square; - // - // - // - this.ribbonBar3.TitleStyleMouseOver.Class = ""; - this.ribbonBar3.TitleStyleMouseOver.CornerType = DevComponents.DotNetBar.eCornerType.Square; - this.ribbonBar3.TitleVisible = false; - // - // btn_device - // - this.btn_device.ButtonStyle = DevComponents.DotNetBar.eButtonStyle.ImageAndText; - this.btn_device.Image = global::Cyberpipe.Properties.Resources._24X24__2__02; - this.btn_device.ImagePosition = DevComponents.DotNetBar.eImagePosition.Top; - this.btn_device.Name = "btn_device"; - this.btn_device.SubItemsExpandWidth = 14; - this.btn_device.Text = "探测仪管理"; - this.btn_device.Click += new System.EventHandler(this.btn_device_Click); - // - // btn_Person - // - this.btn_Person.ButtonStyle = DevComponents.DotNetBar.eButtonStyle.ImageAndText; - this.btn_Person.Image = global::Cyberpipe.Properties.Resources._24x24icon_05_hover1; - this.btn_Person.ImagePosition = DevComponents.DotNetBar.eImagePosition.Top; - this.btn_Person.Name = "btn_Person"; - this.btn_Person.SubItemsExpandWidth = 14; - this.btn_Person.Text = "定位人员维护"; - this.btn_Person.Click += new System.EventHandler(this.btn_Person_Click); - // - // btn_constructMap - // - this.btn_constructMap.Image = global::Cyberpipe.Properties.Resources._24x24icon_04_hover; - this.btn_constructMap.ImagePosition = DevComponents.DotNetBar.eImagePosition.Top; - this.btn_constructMap.Name = "btn_constructMap"; - this.btn_constructMap.SubItemsExpandWidth = 14; - this.btn_constructMap.Text = "导出施工图"; - this.btn_constructMap.Click += new System.EventHandler(this.btn_constructMap_Click); - // - // buttonItem9 - // - this.buttonItem9.Image = global::Cyberpipe.Properties.Resources._24x24icon__2__10; - this.buttonItem9.ImagePosition = DevComponents.DotNetBar.eImagePosition.Top; - this.buttonItem9.Name = "buttonItem9"; - this.buttonItem9.SubItemsExpandWidth = 14; - this.buttonItem9.Text = "文档管理"; - this.buttonItem9.Click += new System.EventHandler(this.buttonItem9_Click); - // // ribbonPanel8 // this.ribbonPanel8.ColorSchemeStyle = DevComponents.DotNetBar.eDotNetBarStyle.StyleManagerControlled; @@ -4696,6 +4625,86 @@ this.btn_reset_password.Text = "重置密码"; this.btn_reset_password.Click += new System.EventHandler(this.btn_reset_password_Click); // + // ribbonPanel7 + // + this.ribbonPanel7.ColorSchemeStyle = DevComponents.DotNetBar.eDotNetBarStyle.StyleManagerControlled; + this.ribbonPanel7.Controls.Add(this.ribbonBar5); + this.ribbonPanel7.Dock = System.Windows.Forms.DockStyle.Fill; + this.ribbonPanel7.Location = new System.Drawing.Point(0, 0); + this.ribbonPanel7.Name = "ribbonPanel7"; + this.ribbonPanel7.Padding = new System.Windows.Forms.Padding(3, 0, 3, 3); + this.ribbonPanel7.Size = new System.Drawing.Size(1328, 95); + // + // + // + this.ribbonPanel7.Style.Class = ""; + this.ribbonPanel7.Style.CornerType = DevComponents.DotNetBar.eCornerType.Square; + // + // + // + this.ribbonPanel7.StyleMouseDown.Class = ""; + this.ribbonPanel7.StyleMouseDown.CornerType = DevComponents.DotNetBar.eCornerType.Square; + // + // + // + this.ribbonPanel7.StyleMouseOver.Class = ""; + this.ribbonPanel7.StyleMouseOver.CornerType = DevComponents.DotNetBar.eCornerType.Square; + this.ribbonPanel7.TabIndex = 41; + this.ribbonPanel7.Visible = false; + // + // ribbonBar5 + // + this.ribbonBar5.AutoOverflowEnabled = true; + // + // + // + this.ribbonBar5.BackgroundMouseOverStyle.Class = ""; + this.ribbonBar5.BackgroundMouseOverStyle.CornerType = DevComponents.DotNetBar.eCornerType.Square; + // + // + // + this.ribbonBar5.BackgroundStyle.Class = ""; + this.ribbonBar5.BackgroundStyle.CornerType = DevComponents.DotNetBar.eCornerType.Square; + this.ribbonBar5.ContainerControlProcessDialogKey = true; + this.ribbonBar5.Dock = System.Windows.Forms.DockStyle.Left; + this.ribbonBar5.Items.AddRange(new DevComponents.DotNetBar.BaseItem[] { + this.btn_flag, + this.slider4ground}); + this.ribbonBar5.Location = new System.Drawing.Point(3, 0); + this.ribbonBar5.Name = "ribbonBar5"; + this.ribbonBar5.Size = new System.Drawing.Size(418, 92); + this.ribbonBar5.Style = DevComponents.DotNetBar.eDotNetBarStyle.StyleManagerControlled; + this.ribbonBar5.TabIndex = 0; + // + // + // + this.ribbonBar5.TitleStyle.Class = ""; + this.ribbonBar5.TitleStyle.CornerType = DevComponents.DotNetBar.eCornerType.Square; + // + // + // + this.ribbonBar5.TitleStyleMouseOver.Class = ""; + this.ribbonBar5.TitleStyleMouseOver.CornerType = DevComponents.DotNetBar.eCornerType.Square; + this.ribbonBar5.TitleVisible = false; + this.ribbonBar5.ItemClick += new System.EventHandler(this.ribbonBar5_ItemClick); + // + // btn_flag + // + this.btn_flag.Image = global::Cyberpipe.Properties.Resources._24x24icon_03_hover; + this.btn_flag.ImagePosition = DevComponents.DotNetBar.eImagePosition.Top; + this.btn_flag.Name = "btn_flag"; + this.btn_flag.SubItemsExpandWidth = 14; + this.btn_flag.Text = "标识器管理"; + this.btn_flag.Click += new System.EventHandler(this.btn_flag_Click); + // + // slider4ground + // + this.slider4ground.LabelPosition = DevComponents.DotNetBar.eSliderLabelPosition.Top; + this.slider4ground.Name = "slider4ground"; + this.slider4ground.Text = "地面透明度"; + this.slider4ground.Value = 0; + this.slider4ground.ValueChanged += new System.EventHandler(this.slider4ground_ValueChanged); + // // ribbonPanel15 // this.ribbonPanel15.ColorSchemeStyle = DevComponents.DotNetBar.eDotNetBarStyle.StyleManagerControlled; @@ -6393,16 +6402,6 @@ this.buttonItem76.SubItemsExpandWidth = 14; this.buttonItem76.Text = "坐标标注"; // - // layerTree - // - this.layerTree.CheckBoxes = true; - this.layerTree.ItemHeight = 18; - this.layerTree.Location = new System.Drawing.Point(30, 78); - this.layerTree.Name = "layerTree"; - this.layerTree.Size = new System.Drawing.Size(121, 97); - this.layerTree.TabIndex = 1; - this.layerTree.AfterCheck += new System.Windows.Forms.TreeViewEventHandler(this.layerTree_AfterCheck); - // // MainFrm // this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Inherit; @@ -6475,11 +6474,11 @@ this.contextMenuStripDeleteLayerNode.ResumeLayout(false); this.ribbonControl1.ResumeLayout(false); this.ribbonControl1.PerformLayout(); - this.ribbonPanel1.ResumeLayout(false); - this.ribbonPanel7.ResumeLayout(false); - this.ribbonPanel2.ResumeLayout(false); this.ribbonPanel3.ResumeLayout(false); + this.ribbonPanel2.ResumeLayout(false); + this.ribbonPanel1.ResumeLayout(false); this.ribbonPanel8.ResumeLayout(false); + this.ribbonPanel7.ResumeLayout(false); this.ribbonPanel15.ResumeLayout(false); ((System.ComponentModel.ISupportInitialize)(this.pictureBox1)).EndInit(); this.ResumeLayout(false); diff --git a/NewFunction/FrmCreateTunnel.cs b/NewFunction/FrmCreateTunnel.cs index 282767c..338edff 100644 --- a/NewFunction/FrmCreateTunnel.cs +++ b/NewFunction/FrmCreateTunnel.cs @@ -142,35 +142,6 @@ } } - private void txtMS_KeyPress(object sender, KeyPressEventArgs e) - { - TextBox text = sender as TextBox; - if ((e.KeyChar < 48 || e.KeyChar > 57) && (e.KeyChar != 8) && (int)e.KeyChar != 46) - { - e.Handled = true; - } - if ((int)e.KeyChar == 46) //小数点 - { - if (text.Text.Length <= 0) - e.Handled = true; //小数点不能在第一位 - else //处理不规则的小数点 - { - float f; - float oldf; - bool b1 = false, b2 = false; - b1 = float.TryParse(text.Text, out oldf); - b2 = float.TryParse(text.Text + e.KeyChar.ToString(), out f); - if (b2 == false) - { - if (b1 == true) - e.Handled = true; - else - e.Handled = false; - } - } - } - } - private void FrmCreateTunnel_Load(object sender, EventArgs e) { if (comboBoxTunnelType.Items.Count > 0) diff --git a/OracleHelper.cs b/OracleHelper.cs index 11eebe6..79cdf48 100644 --- a/OracleHelper.cs +++ b/OracleHelper.cs @@ -49,7 +49,7 @@ { conn.Close(); } - MessageBox.Show(ex.Message, "提示"); + LogHelper.WriteLog(typeof(OledbHelper), ex.Message); return null; } } @@ -67,7 +67,7 @@ } catch(Exception ex) { - // LogError.PublishError(ex); + LogHelper.WriteLog(typeof(OledbHelper), ex.Message); } finally { @@ -111,6 +111,7 @@ } catch (Exception ex) { + LogHelper.WriteLog(typeof(OledbHelper), ex.Message); return null; } } @@ -131,6 +132,7 @@ } catch(Exception ex) { + LogHelper.WriteLog(typeof(OledbHelper), ex.Message); rowCount = -1; } finally @@ -159,6 +161,7 @@ } catch(Exception ex) { + LogHelper.WriteLog(typeof(OledbHelper), ex.Message); num = -1; } finally @@ -190,6 +193,7 @@ } catch (Exception ex) { + LogHelper.WriteLog(typeof(OledbHelper), ex.Message); return null; } } @@ -210,7 +214,7 @@ oracleCmd.Dispose(); conn.Close(); //调用con_close()方法,关闭与数据库的连接 }catch(Exception ex){ - + LogHelper.WriteLog(typeof(OledbHelper), ex.Message); } finally { @@ -237,6 +241,7 @@ } catch (Exception ex) { + LogHelper.WriteLog(typeof(OledbHelper), ex.Message); rowCount = -1; } finally diff --git a/OracleUtils.cs b/OracleUtils.cs index 29b5374..c1aadda 100644 --- a/OracleUtils.cs +++ b/OracleUtils.cs @@ -741,7 +741,6 @@ } catch { - //if we fail to return the SqlDatReader, we need to close the connection ourselves cn.Close(); throw; } diff --git a/PAS.cs b/PAS.cs index 972de2d..fcda1dd 100644 --- a/PAS.cs +++ b/PAS.cs @@ -93,15 +93,7 @@ } - private void TSM_Pderive_Click(object sender, EventArgs e) - { - PASAClass.Table_name(operation); - if (TV_Files.SelectedNode != null) - { - PASAClass.GuideEdit_form("G", TV_Files, int.Parse(((ToolStripMenuItem)sender).Tag.ToString())); - } - } - + private void TSM_Fenter_Click(object sender, EventArgs e) { if (TV_Files.SelectedNode != null) @@ -110,16 +102,6 @@ } } - private void TSM_Frename_Click(object sender, EventArgs e) - { - TSM_Fenter_Click(sender, e); - } - - private void TSM_Fdelete_Click(object sender, EventArgs e) - { - TSM_Fenter_Click(sender, e); - } - private void TSM_Fderive_Click(object sender, EventArgs e) { if (TV_Files.SelectedNode != null) @@ -128,25 +110,6 @@ } } - private void TSM_Fprint_Click(object sender, EventArgs e) - { - if (TV_Files.SelectedNode != null) - { - PASAClass.Print(int.Parse(TV_Files.SelectedNode.Tag.ToString()), TV_Files.SelectedNode.Text, PD_PASPrtFile, PD_PASPrtDoc); - - } - } - - private void TSM_PASPgSt_Click(object sender, EventArgs e) - { - PSD_PASSetPage.ShowDialog(); - } - - private void TSM_PASPreV_Click(object sender, EventArgs e) - { - PPD_PASPreV.ShowDialog(); - } - private void TV_Files_AfterCollapse(object sender, TreeViewEventArgs e) { e.Node.ImageIndex = 0; @@ -250,14 +213,6 @@ } } - private void 导出ToolStripMenuItem_Click(object sender, EventArgs e) - { - PASAClass.Table_name(operation); - if (TV_Files.SelectedNode != null) - { - PASAClass.GuideEdit_form("G", TV_Files, int.Parse(((ToolStripMenuItem)sender).Tag.ToString())); - } - } private void 导入ToolStripMenuItem_Click(object sender, EventArgs e) { diff --git a/Cyberpipe.csproj b/Cyberpipe.csproj index 07a8c1a..e3cd12c 100644 --- a/Cyberpipe.csproj +++ b/Cyberpipe.csproj @@ -204,25 +204,6 @@ - - Form - - - F_GKT1数据输入输出.cs - - - Form - - - F_GKT1添加文件.cs - - - Form - - - F_GKT1添加项目.cs - - Form @@ -1068,18 +1049,6 @@ Frm_password_reset.cs - - Form - - - GKT.cs - - - Form - - - GKT1.cs - Form @@ -1258,12 +1227,6 @@ F_Projedit.cs - - Form - - - PED.cs - Form @@ -1331,16 +1294,6 @@ True Reference.map - - F_GKT1数据输入输出.cs - Designer - - - F_GKT1添加文件.cs - - - F_GKT1添加项目.cs - Form_EditTask.cs @@ -1836,12 +1789,6 @@ Frm_password_reset.cs - - GKT.cs - - - GKT1.cs - F_GKT数据输入输出.cs @@ -1934,9 +1881,6 @@ F_Projedit.cs - - PED.cs - F_数据输入输出.cs diff --git a/Cyberpipe.suo b/Cyberpipe.suo index 68ced4f..a1aecf8 100644 --- a/Cyberpipe.suo +++ b/Cyberpipe.suo Binary files differ diff --git a/EMS_Forms/Form_EditTask.cs b/EMS_Forms/Form_EditTask.cs index 718992f..f1d791f 100644 --- a/EMS_Forms/Form_EditTask.cs +++ b/EMS_Forms/Form_EditTask.cs @@ -119,7 +119,8 @@ String name = Convert.ToString(dr["USERNAME"]); comboBox_userName.Items.Add(name); - } + } + dr.Close(); comboBox_road.Items.Clear(); roadList = new List(); @@ -135,7 +136,7 @@ comboBox_road.Items.Add(name); } } - + dr1.Close(); conn.Close(); bool flag2 = false; @@ -185,7 +186,7 @@ catch (Exception ex) { - MessageBox.Show(ex.ToString()); + LogHelper.WriteLog(typeof(Form_EditTask), ex.Message); } } @@ -288,7 +289,7 @@ } catch (Exception ex) { - MessageBox.Show(ex.ToString()); + LogHelper.WriteLog(typeof(Form_EditTask), ex.Message); } } @@ -474,7 +475,7 @@ } catch (Exception ex) { - MessageBox.Show(ex.ToString()); + LogHelper.WriteLog(typeof(Form_EditTask), ex.Message); } this.Close(); @@ -495,6 +496,7 @@ { numList.Add(Convert.ToInt32(dr["DBID"])); } + dr.Close(); if (numList.Count == 0) { taskNumber = Convert.ToInt32(number) * 100; @@ -674,6 +676,7 @@ } } } + dr.Close(); conn.Close(); } diff --git a/EMS_Forms/Form_EventManager.cs b/EMS_Forms/Form_EventManager.cs index b18c45b..84807b2 100644 --- a/EMS_Forms/Form_EventManager.cs +++ b/EMS_Forms/Form_EventManager.cs @@ -64,6 +64,7 @@ comboBox_name.Items.Add(name); } + dr.Close(); conn.Close(); diff --git a/Forms/FrmMnModify.cs b/Forms/FrmMnModify.cs index 31cfc5f..d036360 100644 --- a/Forms/FrmMnModify.cs +++ b/Forms/FrmMnModify.cs @@ -68,15 +68,7 @@ questionGrid.Rows[idx].Cells[1].Value = sr.question; } } - /// 选中对象 - /// - /// - /// - /// - private void buttonX1_Click(object sender, EventArgs e) - { - globecontrol.Globe.Action = EnumAction3D.SelectObject; - } + /// /// 选中某一行 /// diff --git a/Forms/FrmPipelineModelDataBase.cs b/Forms/FrmPipelineModelDataBase.cs index 2acf0ca..7ce573f 100644 --- a/Forms/FrmPipelineModelDataBase.cs +++ b/Forms/FrmPipelineModelDataBase.cs @@ -35,19 +35,7 @@ ds = _ds; InitializeComponent(); } - /// - /// 单击选择shp格式文件 - /// - /// - /// - private void btnBrowseModel_Click(object sender, EventArgs e) - { - saveFileDialog1.Filter = "*.lgd|*.lgd"; - if (saveFileDialog1.ShowDialog() == DialogResult.OK) - { - txtModelLayer.Text = saveFileDialog1.FileName; - } - } + /// /// 窗体初始化事件处理 /// @@ -100,49 +88,6 @@ } } } - - private object convertFieldValue(string fieldname, object obj) - { - if (obj == null) - return null; - - try - { - string type = fields_types[fieldname].ToString(); - switch (type) - { - case "string": - return obj.ToString(); - case "int": - //return 101; - int intResult; - if (int.TryParse(obj.ToString(), out intResult)) - return intResult; - else - return null; - case "double": - //return 202.5; - double doubleResult; - if (double.TryParse(obj.ToString(), out doubleResult)) - return doubleResult; - else - return null; - case "date": - DateTime dtResult; - if (DateTime.TryParse(obj.ToString(), out dtResult)) - return dtResult; - else - return null; - } - return null; - } - catch (Exception ex) - { - MessageBox.Show(ex.ToString()); - return null; - } - } - public string lgdFilePath = ""; /// /// 选择管线颜色 @@ -610,33 +555,6 @@ { this.Close(); } - - private void cmbLayer_SelectedIndexChanged(object sender, EventArgs e) //选择图层 - { - GSOLayer layer = ctl.Globe.Layers.GetLayerByCaption(selectLayerName); - GSOFeatures features = layer.GetAllFeatures(); - if (features.Length == 0) - return; - - cmbFrom.Items.Clear(); - cmbTo.Items.Clear(); - cmbRadius.Items.Clear(); - cmbID.Items.Clear(); - for (int i = 0; i < features[0].GetFieldCount(); i++) - { - GeoScene.Data.GSOFieldDefn fielddef = (GeoScene.Data.GSOFieldDefn)(features[0].GetFieldDefn(i)); - - cmbFrom.Items.Add(fielddef.Name); - cmbTo.Items.Add(fielddef.Name); - cmbRadius.Items.Add(fielddef.Name); - cmbID.Items.Add(fielddef.Name); - } - cmbFrom.SelectedItem = "Deep1"; - cmbTo.SelectedItem = "Deep2"; - cmbRadius.SelectedItem = "Diameter"; - cmbID.SelectedItem = "Handle"; - } - private void buttonXLayerPath_Click(object sender, EventArgs e)//单击 选择shp格式的文件 { OpenFileDialog dlg = new OpenFileDialog(); diff --git a/Forms/FrmPipelineModelDataOneStep.cs b/Forms/FrmPipelineModelDataOneStep.cs index 18afda7..ec93b8a 100644 --- a/Forms/FrmPipelineModelDataOneStep.cs +++ b/Forms/FrmPipelineModelDataOneStep.cs @@ -38,19 +38,7 @@ layerTree = _layerTree; InitializeComponent(); } - /// - /// 单击选择shp格式文件 - /// - /// - /// - private void btnBrowseModel_Click(object sender, EventArgs e) - { - saveFileDialog1.Filter = "*.lgd|*.lgd"; - if (saveFileDialog1.ShowDialog() == DialogResult.OK) - { - txtModelLayer.Text = saveFileDialog1.FileName; - } - } + /// /// 窗体初始化事件处理 /// @@ -107,48 +95,7 @@ } } - private object convertFieldValue(string fieldname, object obj) - { - if (obj == null) - return null; - - try - { - string type = fields_types[fieldname].ToString(); - switch (type) - { - case "string": - return obj.ToString(); - case "int": - //return 101; - int intResult; - if (int.TryParse(obj.ToString(), out intResult)) - return intResult; - else - return null; - case "double": - //return 202.5; - double doubleResult; - if (double.TryParse(obj.ToString(), out doubleResult)) - return doubleResult; - else - return null; - case "date": - DateTime dtResult; - if (DateTime.TryParse(obj.ToString(), out dtResult)) - return dtResult; - else - return null; - } - return null; - } - catch (Exception ex) - { - MessageBox.Show(ex.ToString()); - return null; - } - } - + public string lgdFilePath = ""; /// /// 选择管线颜色 @@ -673,32 +620,6 @@ return featDs; } - private void cmbLayer_SelectedIndexChanged(object sender, EventArgs e) //选择图层 - { - GSOLayer layer = ctl.Globe.Layers.GetLayerByCaption(selectLayerName); - GSOFeatures features = layer.GetAllFeatures(); - if (features.Length == 0) - return; - - cmbFrom.Items.Clear(); - cmbTo.Items.Clear(); - cmbRadius.Items.Clear(); - cmbID.Items.Clear(); - for (int i = 0; i < features[0].GetFieldCount(); i++) - { - GeoScene.Data.GSOFieldDefn fielddef = (GeoScene.Data.GSOFieldDefn)(features[0].GetFieldDefn(i)); - - cmbFrom.Items.Add(fielddef.Name); - cmbTo.Items.Add(fielddef.Name); - cmbRadius.Items.Add(fielddef.Name); - cmbID.Items.Add(fielddef.Name); - } - cmbFrom.SelectedItem = "Deep1"; - cmbTo.SelectedItem = "Deep2"; - cmbRadius.SelectedItem = "Diameter"; - cmbID.SelectedItem = "Handle"; - } - private void buttonXLayerPath_Click(object sender, EventArgs e)//单击 选择shp格式的文件 { OpenFileDialog dlg = new OpenFileDialog(); @@ -949,38 +870,6 @@ } //txtLayername.Text = type + layername; } - /// - /// 连接数据库 - /// - /// - /// - private void buttonX1_Click(object sender, EventArgs e) - { - if (ds == null) - { - //没连的话,直接连接审核库; //审核库配置读配置文件 - string dbIp = Utility.sgdbip; - string database = Utility.sgdbname; - string user = Utility.sgdbuser; - string pass = Utility.sgdbpwd; - - if (!Utility.isNetworkConnectionSuccess(dbIp.Trim())) - { - MessageBox.Show("网络连接失败!", "提示"); - return; - } - - ds = ctl.Globe.DataManager.OpenOracleDataSource(dbIp + "/" + database, "", "", user, pass); - if (ds == null) - { - MessageBox.Show("数据库连接失败!", "提示", MessageBoxButtons.OK, MessageBoxIcon.Warning); - } - else - { - btnCreateModel.Enabled = true; - } - } - } private void btnClose_Click(object sender, EventArgs e) { diff --git a/Forms/FrmShRK.cs b/Forms/FrmShRK.cs index 0e2e722..f1d83cb 100644 --- a/Forms/FrmShRK.cs +++ b/Forms/FrmShRK.cs @@ -215,6 +215,7 @@ { sourcefeatds = sourcefeat as GSOFeatureDataset; } + if (sourcefeatds == null) return; sourcefeatds.Open(); GSOFeatures sourcefeatures = sourcefeatds.GetAllFeatures(); @@ -251,6 +252,7 @@ { desfeatds = desfeat as GSOFeatureDataset; } + if (desfeatds == null) return; desfeatds.Open(); //向新数据集写入字段 diff --git a/FrmAccessoriesSensor.cs b/FrmAccessoriesSensor.cs index 09fcdf1..2a7a80e 100644 --- a/FrmAccessoriesSensor.cs +++ b/FrmAccessoriesSensor.cs @@ -209,7 +209,7 @@ chart1.Series[0].Points.DataBindXY(dic.Keys, dic.Values); for (int m = 0; m < dic.Values.Count; m++) { - if (chart1.Series[0].Points[m].YValues[0].ToString() != "0") + if (chart1.Series[0].Points[m]!=null&&chart1.Series[0].Points[m].YValues[0].ToString() != "0") { chart1.Series[0].Points[m].Label = chart1.Series[0].Points[m].YValues[0].ToString(); } diff --git a/FrmAccessoriesgather.cs b/FrmAccessoriesgather.cs index 9e331e1..a475d9e 100644 --- a/FrmAccessoriesgather.cs +++ b/FrmAccessoriesgather.cs @@ -338,7 +338,7 @@ chart1.Series[0].Points.DataBindXY(dic.Keys, dic.Values); for (int m = 0; m < dic.Values.Count; m++) { - if (chart1.Series[0].Points[m].YValues[0].ToString() != "0") + if (chart1.Series[0].Points[m]!=null&&chart1.Series[0].Points[m].YValues[0].ToString() != "0") { chart1.Series[0].Points[m].Label = chart1.Series[0].Points[m].YValues[0].ToString(); } diff --git a/FrmAccessoryAnalysis.cs b/FrmAccessoryAnalysis.cs index 71d4579..44d4065 100644 --- a/FrmAccessoryAnalysis.cs +++ b/FrmAccessoryAnalysis.cs @@ -66,39 +66,6 @@ globeControl1.Refresh(); } /// - /// 键盘按键按下事件处理 - /// - /// - /// - private void txtRadius_KeyPress(object sender, KeyPressEventArgs e) - { - TextBox text = sender as TextBox; - if ((e.KeyChar < 48 || e.KeyChar > 57) && (e.KeyChar != 8) && (int)e.KeyChar != 46) - { - e.Handled = true; - } - if ((int)e.KeyChar == 46) //小数点 - { - if (text.Text.Length <= 0) - e.Handled = true; //小数点不能在第一位 - else //处理不规则的小数点 - { - float f; - float oldf; - bool b1 = false, b2 = false; - b1 = float.TryParse(text.Text, out oldf); - b2 = float.TryParse(text.Text + e.KeyChar.ToString(), out f); - if (b2 == false) - { - if (b1 == true) - e.Handled = true; - else - e.Handled = false; - } - } - } - } - /// /// 确定按钮事件处理 /// /// diff --git a/FrmAddValve.cs b/FrmAddValve.cs index 34d2fec..5f405b9 100644 --- a/FrmAddValve.cs +++ b/FrmAddValve.cs @@ -486,56 +486,6 @@ } } - - - - - - - - private void cmbLayer_SelectedIndexChanged(object sender, EventArgs e) - { - GSOLayer layer = globeControl1.Globe.Layers.GetLayerByCaption(selectLayerName); - GSOFeatures features = layer.GetAllFeatures(); - if (features.Length == 0) - return; - - combPath.Items.Clear(); - combZ.Items.Clear(); - combModelName.Items.Clear(); - - for (int i = 0; i < features[0].GetFieldCount(); i++) - { - GeoScene.Data.GSOFieldDefn fielddef = (GeoScene.Data.GSOFieldDefn)(features[0].GetFieldDefn(i)); - combPath.Items.Add(fielddef.Name); - combZ.Items.Add(fielddef.Name); - combModelName.Items.Add(fielddef.Name); - } - combModelName.SelectedItem = "编号"; - combPath.SelectedItem = "模型路径"; - if (combfile.SelectedIndex != -1) - { - - string layerCaption = combfile.SelectedItem.ToString().Trim(); - rukuLayer = globeControl1.Globe.Layers.GetLayerByCaption(layerCaption); - if (rukuLayer != null) - { - combPath.Items.Clear(); - combZ.Items.Clear(); - combModelName.Items.Clear(); - - } - for (int i = 0; i < features[0].GetFieldCount(); i++) - { - GeoScene.Data.GSOFieldDefn fielddef = (GeoScene.Data.GSOFieldDefn)(features[0].GetFieldDefn(i)); - combPath.Items.Add(fielddef.Name); - combZ.Items.Add(fielddef.Name); - combModelName.Items.Add(fielddef.Name); - } - combModelName.SelectedItem = "编号"; - combPath.SelectedItem = "模型路径"; - } - } /// /// 单击选择shp格式文件 /// diff --git a/FrmAddWellShp.cs b/FrmAddWellShp.cs index bb79ec0..a249725 100644 --- a/FrmAddWellShp.cs +++ b/FrmAddWellShp.cs @@ -478,32 +478,6 @@ } } } - - private void cmbLayer_SelectedIndexChanged(object sender, EventArgs e) - { - GSOLayer layer = globeControl1.Globe.Layers.GetLayerByCaption(selectLayerName); - GSOFeatures features = layer.GetAllFeatures(); - if (features.Length == 0) - return; - - combCode.Items.Clear(); - combDeep.Items.Clear(); - combModelName.Items.Clear(); - combAngle.Items.Clear(); - - for (int i = 0; i < features[0].GetFieldCount(); i++) - { - GeoScene.Data.GSOFieldDefn fielddef = (GeoScene.Data.GSOFieldDefn)(features[0].GetFieldDefn(i)); - combCode.Items.Add(fielddef.Name); - combDeep.Items.Add(fielddef.Name); - combModelName.Items.Add(fielddef.Name); - combAngle.Items.Add(fielddef.Name); - } - combCode.SelectedItem = "附属物编码"; - combDeep.SelectedItem = "井深"; - combModelName.SelectedItem = "编号"; - combAngle.SelectedItem = "符号角度"; - } /// /// 单击选择shp格式文件 /// diff --git a/FrmAddYuBiZiShp.cs b/FrmAddYuBiZiShp.cs index b312d51..332f037 100644 --- a/FrmAddYuBiZiShp.cs +++ b/FrmAddYuBiZiShp.cs @@ -383,80 +383,7 @@ } } - private void cmbLayer_SelectedIndexChanged(object sender, EventArgs e) - { - GSOLayer layer = globeControl1.Globe.Layers.GetLayerByCaption(selectLayerName); - GSOFeatures features = layer.GetAllFeatures(); - if (features.Length == 0) - return; - - combCode.Items.Clear(); - combDeep.Items.Clear(); - combModelName.Items.Clear(); - //comboLoad.Items.Clear(); - for (int i = 0; i < features[0].GetFieldCount(); i++) - { - GeoScene.Data.GSOFieldDefn fielddef = (GeoScene.Data.GSOFieldDefn)(features[0].GetFieldDefn(i)); - combCode.Items.Add(fielddef.Name); - combDeep.Items.Add(fielddef.Name); - combModelName.Items.Add(fielddef.Name); - //comboLoad.Items.Add(fielddef.Name); - } - combCode.SelectedItem = "附属物编码"; - combDeep.SelectedItem = "Z坐标"; - combModelName.SelectedItem = "编号"; - //comboLoad.SelectedItem = "模型路径"; - } - - private void buttonXLayerPath_Click(object sender, EventArgs e) - { - OpenFileDialog dlg = new OpenFileDialog(); - dlg.Filter = "*.shp|*.shp"; - dlg.Multiselect = false; - if (dlg.ShowDialog() == DialogResult.OK) - { - GSOLayer layer = globeControl1.Globe.Layers.Add(dlg.FileName); - string txtMessage = valiYBdata(layer); - if (txtMessage != "") - { - button3.Enabled = false; - //textBoxLayer.Text = ""; - combCode.Items.Clear(); - combDeep.Items.Clear(); - combModelName.Items.Clear(); - globeControl1.Globe.Layers.Remove(layer); - FrmValiDataShowErrorMessage showErrorMessage = new FrmValiDataShowErrorMessage(dlg.FileName, txtMessage); - showErrorMessage.ShowDialog(); - return; - } - else - { - button3.Enabled = true; - //textBoxLayer.Text = dlg.FileName; - selectLayerName = layer.Caption; - txtLayerName.Text = layer.Caption; - GSOFeatures features = layer.GetAllFeatures(); - if (features.Length == 0) - return; - - combCode.Items.Clear(); - combDeep.Items.Clear(); - combModelName.Items.Clear(); - for (int i = 0; i < features[0].GetFieldCount(); i++) - { - GeoScene.Data.GSOFieldDefn fielddef = (GeoScene.Data.GSOFieldDefn)(features[0].GetFieldDefn(i)); - combCode.Items.Add(fielddef.Name); - combDeep.Items.Add(fielddef.Name); - combModelName.Items.Add(fielddef.Name); - //comboLoad.Items.Add(fielddef.Name); - } - combCode.SelectedItem = "管点编码"; - combDeep.SelectedItem = "Z坐标"; - combModelName.SelectedItem = "编号"; - } - } - } - + private void FrmAddYuBiZiShp_FormClosing(object sender, FormClosingEventArgs e) { globeControl1.Globe.Refresh(); diff --git a/FrmAllPipelineStatis.cs b/FrmAllPipelineStatis.cs index 6421a26..a6eea29 100644 --- a/FrmAllPipelineStatis.cs +++ b/FrmAllPipelineStatis.cs @@ -84,7 +84,7 @@ chartAllAreaPipeline.Series["管线"].Points.DataBindXY(pipelineLengthAndType.Keys, pipelineLengthAndType.Values); for (int m = 0; m < pipelineLengthAndType.Values.Count; m++) { - if (chartAllAreaPipeline.Series["管线"].Points[m].YValues[0].ToString() != "0") + if (chartAllAreaPipeline.Series["管线"].Points[m]!=null&&chartAllAreaPipeline.Series["管线"].Points[m].YValues[0].ToString() != "0") { chartAllAreaPipeline.Series["管线"].Points[m].Label = chartAllAreaPipeline.Series[0].Points[m].YValues[0].ToString(); } @@ -94,7 +94,7 @@ } catch (Exception ex) { - //LogError.PublishError(ex); + LogHelper.WriteLog(typeof(FrmAllPipelineStatis), ex.Message); } } @@ -147,7 +147,7 @@ } DataTable dt = OledbHelper.QueryTable(sql); - if (dt != null && dt.Rows.Count > 0) + if (dt != null && dt.Rows.Count > 0 && chartAllAreaPipeline.Series["管线"].Points[indexHit]!=null) { dataGridViewX1.DataSource = dt; panel.Visible = true; diff --git a/FrmAllWorkWellStatis.cs b/FrmAllWorkWellStatis.cs index 6fec7af..6af8e4c 100644 --- a/FrmAllWorkWellStatis.cs +++ b/FrmAllWorkWellStatis.cs @@ -52,7 +52,7 @@ chartAllAreaPipeline.Series["井盖"].Points.DataBindXY(workWellLengthAndType.Keys, workWellLengthAndType.Values); for (int m = 0; m < workWellLengthAndType.Values.Count; m++) { - if (chartAllAreaPipeline.Series["井盖"].Points[m].YValues[0].ToString().Trim() != "0") + if (chartAllAreaPipeline.Series["井盖"].Points[m]!=null&&chartAllAreaPipeline.Series["井盖"].Points[m].YValues[0].ToString().Trim() != "0") { chartAllAreaPipeline.Series["井盖"].Points[m].Label = chartAllAreaPipeline.Series[0].Points[m].YValues[0].ToString(); } @@ -60,7 +60,7 @@ } catch (Exception ex) { - //LogError.PublishError(ex); + LogHelper.WriteLog(typeof(FrmAllWorkWellStatis), ex.Message); } } diff --git a/FrmBSQDuoBianXingStatis.cs b/FrmBSQDuoBianXingStatis.cs index e8b7d52..3e889b6 100644 --- a/FrmBSQDuoBianXingStatis.cs +++ b/FrmBSQDuoBianXingStatis.cs @@ -60,7 +60,7 @@ { for (int m = 0; m < bsq1.Values.Count; m++) { - if (chart1.Series["标识器"].Points[m].YValues[0].ToString() != "0") + if (chart1.Series["标识器"].Points[m]!=null&&chart1.Series["标识器"].Points[m].YValues[0].ToString() != "0") { count += Convert.ToInt16(chart1.Series[0].Points[m].YValues[0].ToString()); chart1.Series["标识器"].Points[m].Label = chart1.Series[0].Points[m].YValues[0].ToString(); diff --git a/FrmBSQDuoBianXingStreet.cs b/FrmBSQDuoBianXingStreet.cs index 2005ebb..1db5777 100644 --- a/FrmBSQDuoBianXingStreet.cs +++ b/FrmBSQDuoBianXingStreet.cs @@ -63,7 +63,7 @@ chartStatis.Series[0].Points.DataBindXY(bsq.Keys, bsq.Values); for (int m = 0; m < bsq.Values.Count; m++) { - if (chartStatis.Series[0].Points[m].YValues[0].ToString().Trim() != "0") + if (chartStatis.Series[0].Points[m]!=null&&chartStatis.Series[0].Points[m].YValues[0].ToString().Trim() != "0") { count += Convert.ToInt16(chartStatis.Series[0].Points[m].YValues[0].ToString()); chartStatis.Series[0].Points[m].Label = chartStatis.Series[0].Points[m].YValues[0].ToString(); diff --git a/FrmBSQStatis.cs b/FrmBSQStatis.cs index 390a55c..4aa0ee6 100644 --- a/FrmBSQStatis.cs +++ b/FrmBSQStatis.cs @@ -95,6 +95,8 @@ } } } + + dr.Close(); conn.Close(); for (int i = 0; i < typeLists.Count; i++) { @@ -123,7 +125,7 @@ chartStatis.Series[0].Points.DataBindXY(bsq.Keys, bsq.Values); for (int m = 0; m < bsq.Values.Count; m++) { - if (chartStatis.Series[0].Points[m].YValues[0].ToString().Trim() != "0") + if (chartStatis.Series[0].Points[m]!=null&&chartStatis.Series[0].Points[m].YValues[0].ToString().Trim() != "0") { //count += Convert.ToInt16(chartStatis.Series[0].Points[m].YValues[0].ToString()); chartStatis.Series[0].Points[m].Label = chartStatis.Series[0].Points[m].YValues[0].ToString(); diff --git a/FrmBSQStreet.cs b/FrmBSQStreet.cs index 9d88adb..7fbacad 100644 --- a/FrmBSQStreet.cs +++ b/FrmBSQStreet.cs @@ -44,7 +44,7 @@ chartStatis.Series[0].Points.DataBindXY(bsq.Keys, bsq.Values); for (int m = 0; m < bsq.Values.Count; m++) { - if (chartStatis.Series[0].Points[m].YValues[0].ToString().Trim() != "0") + if (chartStatis.Series[0].Points[m]!=null&&chartStatis.Series[0].Points[m].YValues[0].ToString().Trim() != "0") { count += Convert.ToInt16(chartStatis.Series[0].Points[m].YValues[0].ToString()); chartStatis.Series[0].Points[m].Label = chartStatis.Series[0].Points[m].YValues[0].ToString(); diff --git a/FrmBoosterValvers.cs b/FrmBoosterValvers.cs index 5061efc..df9b62b 100644 --- a/FrmBoosterValvers.cs +++ b/FrmBoosterValvers.cs @@ -236,199 +236,6 @@ count = 0; } } - /// - /// 添加火苗 - /// - /// - /// - /// - /// - private GSOFeature AddFire(double x,double y,double z) - { - // 烟火示例 - - string strResPath = Application.StartupPath + "/Resource"; - - // 烟火粒子示例,由三个发射器构成 - GSOGeoParticle geoParticle = new GSOGeoParticle(); - geoParticle.SetPosition(x, y, z); // 添加到这个经纬度位置 - geoParticle.AltitudeMode = EnumAltitudeMode.RelativeToGround; - - GSORingParticleEmitter emitter = new GSORingParticleEmitter(); - emitter.TexturePath = strResPath + "/ParticleImage/flare.png"; - - emitter.SetSizeFix(1, 1); - emitter.VelFix = 1; - emitter.VelRnd = 5; - - emitter.AngleXYFix = 0; - emitter.AngleXYRnd = 180; - - emitter.AngleXZFix = 90; - emitter.AngleXZRnd = 0; - - emitter.LifeFix = 0.5f; - emitter.LifeRnd = 0.0f; - - emitter.RotFix = 0; - emitter.RotRnd = 0; - - emitter.RotVelFix = 0; - emitter.RotVelRnd = 0; - - emitter.EmitPerSec = 100; - - // 采用线性插值生成粒子的初始颜色 - emitter.ColorRndStart = Color.White; - emitter.ColorRndEnd = Color.Red; - - - GSOColorParticleEffector effector2 = new GSOColorParticleEffector(); - effector2.SetColorChanged(0, -1, -1, 0); - effector2.StartTime = 0.0f; - effector2.EndTime = -1.0f; - emitter.AddEffector(effector2); - - // 将三个发射器添加到粒子对象中 - geoParticle.AddEmitter(emitter); - - geoParticle.Play(); - - GSOFeature feature = new GSOFeature(); - - feature.Geometry = geoParticle; - - globeControl1.Globe.MemoryLayer.AddFeature(feature); - - - return feature; - } - - /// - /// 添加喷泉 - /// - /// - private GSOFeature AddFountain() - { - string strResPath = Application.StartupPath + "/Resource"; - - GSOGeoParticle geoParticle = new GSOGeoParticle(); - geoParticle.SetPosition(116.314, 39.84, 0); // 添加到这个经纬度位置 - - GSOPointParticleEmitter emitter = new GSOPointParticleEmitter(); - emitter.TexturePath = strResPath + "/ParticleImage/test.png"; - - emitter.SetSizeFix(0.5f, 2); - emitter.VelFix = 10; - emitter.VelRnd = 2; - - emitter.GravityAcc = 9.8f; - emitter.AngleXYFix = 0; - emitter.AngleXYRnd = 180; - - emitter.AngleXZFix = 88; - emitter.AngleXZRnd = 2; - - //emitter.InnerRadius = 0; - // emitter.OuterRadius = 0.03f; - - emitter.LifeFix = 5.0f; - emitter.LifeRnd = 1.0f; - - emitter.RotFix = 0; - emitter.RotRnd = 0; - - emitter.RotVelFix = 0; - emitter.RotVelRnd = 0; - - emitter.EmitPerSec = 1000; - emitter.ColorRndStart = Color.FromArgb(33, 255, 255, 255); - emitter.ColorRndEnd = Color.FromArgb(11, 255, 255, 255); - emitter.IsLumAdded = false; - - // 将三个发射器添加到粒子对象中 - geoParticle.AddEmitter(emitter); - - geoParticle.Play(); - GSOFeature feature = new GSOFeature(); - - feature.Geometry = geoParticle; - - //globeControl1.Globe.MemoryLayer.AddFeature(feature); - globeControl1.Globe.FlyToFeature(feature); - - return feature; - } - - /// - /// 添加水柱 - /// - /// - private GSOFeature AddWaterLine() - { - string strResPath = Application.StartupPath + "/Resource"; - - GSOGeoParticle geoParticle = new GSOGeoParticle(); - geoParticle.SetPosition(116.308, 39.84, 0); // 添加到这个经纬度位置 - - GSOPointParticleEmitter emitter = new GSOPointParticleEmitter(); - - emitter.TexturePath = strResPath + "/ParticleImage/drop3.png"; - - geoParticle.TimerInterval = 1; - - emitter.SetSizeFix(2.0f, 2.0f); - - emitter.VelFix = 50; - emitter.VelRnd = 2; - - // emitter.IsLumAdded = false; - - emitter.GravityAcc = 9.8f; - emitter.AngleXYFix = 0; - emitter.AngleXYRnd = 2; - - emitter.AngleXZFix = 60; - emitter.AngleXZRnd = 2; - - //emitter.InnerRadius = 0; - // emitter.OuterRadius = 0.1f; - - emitter.LifeFix = 5.0f; - emitter.LifeRnd = 1.0f; - - emitter.RotFix = 0; - emitter.RotRnd = 0; - - emitter.RotVelFix = 0; - emitter.RotVelRnd = 0; - - emitter.EmitPerSec = 1500; - - emitter.ColorRndStart = Color.FromArgb(100, 222, 222, 222); - emitter.ColorRndEnd = Color.FromArgb(50, 222, 222, 222); - - /* - - GSOScaleParticleEffector effector1 = new GSOScaleParticleEffector(); - effector1.SetScale(0.2f, 0.2f); - effector1.StartTime = 0; - effector1.EndTime = -1; // 负数表示整个粒子生命结束 - emitter.AddEffector(effector1); - */ - - // 将三个发射器添加到粒子对象中 - geoParticle.AddEmitter(emitter); - - geoParticle.Play(); - GSOFeature feature = new GSOFeature(); - - feature.Geometry = geoParticle; - - //globeControl1.Globe.MemoryLayer.AddFeature(feature); - globeControl1.Globe.FlyToFeature(feature); - - return feature; - } + } } diff --git a/FrmBufferAnalysis.cs b/FrmBufferAnalysis.cs index f711133..db8ca59 100644 --- a/FrmBufferAnalysis.cs +++ b/FrmBufferAnalysis.cs @@ -123,39 +123,6 @@ } } /// - /// 半径文本框的键盘按键按下事件处理 - /// - /// - /// - private void txtRadius_KeyPress(object sender, KeyPressEventArgs e) - { - TextBox text = sender as TextBox; - if ((e.KeyChar < 48 || e.KeyChar > 57) && (e.KeyChar != 8) && (int)e.KeyChar != 46) - { - e.Handled = true; - } - if ((int)e.KeyChar == 46) //小数点 - { - if (text.Text.Length <= 0) - e.Handled = true; //小数点不能在第一位 - else //处理不规则的小数点 - { - float f; - float oldf; - bool b1 = false, b2 = false; - b1 = float.TryParse(text.Text, out oldf); - b2 = float.TryParse(text.Text + e.KeyChar.ToString(), out f); - if (b2 == false) - { - if (b1 == true) - e.Handled = true; - else - e.Handled = false; - } - } - } - } - /// /// 窗体关闭事件处理 /// /// diff --git a/FrmBufferAnalysisBSQ.cs b/FrmBufferAnalysisBSQ.cs index 24a96ca..f54208f 100644 --- a/FrmBufferAnalysisBSQ.cs +++ b/FrmBufferAnalysisBSQ.cs @@ -137,35 +137,7 @@ } } - private void txtRadius_KeyPress(object sender, KeyPressEventArgs e) - { - TextBox text = sender as TextBox; - if ((e.KeyChar < 48 || e.KeyChar > 57) && (e.KeyChar != 8) && (int)e.KeyChar != 46) - { - e.Handled = true; - } - if ((int)e.KeyChar == 46) //小数点 - { - if (text.Text.Length <= 0) - e.Handled = true; //小数点不能在第一位 - else //处理不规则的小数点 - { - float f; - float oldf; - bool b1 = false, b2 = false; - b1 = float.TryParse(text.Text, out oldf); - b2 = float.TryParse(text.Text + e.KeyChar.ToString(), out f); - if (b2 == false) - { - if (b1 == true) - e.Handled = true; - else - e.Handled = false; - } - } - } - } - + private void FrmBufferAnalysis_FormClosing(object sender, FormClosingEventArgs e) { //Form1.y = 0; @@ -316,27 +288,6 @@ } } - private void FlyToMenu_Click(object sender, EventArgs e) - { - if (m_feature != null) - { - if (m_feature.Geometry != null && m_feature.Geometry.Type == EnumGeometryType.GeoPolyline3D) - { - GSOGeoPolyline3D line = m_feature.Geometry as GSOGeoPolyline3D; - double length = line.GetSpaceLength(true, 6378137); - GSOGeoPolyline3D lineLine = line.GetSegment(0, length / 2); - GSOPoint3d point3d = lineLine[lineLine.PartCount - 1][lineLine[lineLine.PartCount - 1].Count - 1]; - - globeControl1.Globe.FlyToPosition(point3d, EnumAltitudeMode.Absolute, 0, 45, 5); - } - else - { - globeControl1.Globe.FlyToFeature(m_feature, 0, 45, 3); - } - LightMenu_Click(sender, e); - } - } - private void LightMenu_Click(object sender, EventArgs e) { flashflag = "single"; diff --git a/FrmDataBaseOpt.cs b/FrmDataBaseOpt.cs index b0c4b5d..8d7b69d 100644 --- a/FrmDataBaseOpt.cs +++ b/FrmDataBaseOpt.cs @@ -362,6 +362,7 @@ dbCombor.Items.Add(dblist[i].title); } } + /* /// /// 从配置文件读取数据库参数配置 /// @@ -428,6 +429,8 @@ } } + * */ + /* /// /// 向配置文件写入连接数据库的参数配置 /// @@ -485,6 +488,7 @@ MessageBox.Show(exp.ToString()); } } + * */ /// /// /// diff --git a/FrmDatabaseParaSetting.cs b/FrmDatabaseParaSetting.cs index a6fea46..63b596b 100644 --- a/FrmDatabaseParaSetting.cs +++ b/FrmDatabaseParaSetting.cs @@ -152,6 +152,7 @@ this.DialogResult = DialogResult.OK; this.Close(); } + /* /// /// 从配置文件读取数据库连接参数配置 /// @@ -218,6 +219,8 @@ } } + * */ + /* /// /// 向配置文件写入数据库参数配置 /// @@ -276,7 +279,7 @@ MessageBox.Show(ex.ToString()); } } - + */ /// /// 取消按钮事件处理 /// diff --git a/FrmDatabaseParaSetting2.cs b/FrmDatabaseParaSetting2.cs index 932d05e..96a87d5 100644 --- a/FrmDatabaseParaSetting2.cs +++ b/FrmDatabaseParaSetting2.cs @@ -148,6 +148,7 @@ this.DialogResult = DialogResult.OK; this.Close(); } + /* /// /// 从配置文件读取数据库连接参数配置 /// @@ -214,6 +215,8 @@ } } + * */ + /* /// /// 向配置文件写入数据库参数配置 /// @@ -272,7 +275,7 @@ MessageBox.Show(exp.ToString()); } } - + */ /// /// 取消按钮事件处理 /// diff --git a/FrmDiameterQuery.cs b/FrmDiameterQuery.cs index 68c948b..9a5215b 100644 --- a/FrmDiameterQuery.cs +++ b/FrmDiameterQuery.cs @@ -77,18 +77,7 @@ isBetween = true; } } - /// - /// 键盘按键按下事件处理 - /// - /// - /// - private void textBoxX1_KeyPress(object sender, KeyPressEventArgs e) - { - if ((e.KeyChar < 48 || e.KeyChar > 57) && e.KeyChar != 8) - { - e.Handled = true;//屏蔽 - } - } + bool isBetween = false; /// diff --git a/FrmDocumentEdit.cs b/FrmDocumentEdit.cs index aab2d31..e78a7ff 100644 --- a/FrmDocumentEdit.cs +++ b/FrmDocumentEdit.cs @@ -256,121 +256,6 @@ } - // - /// 将本地文件上传到指定的服务器(HttpWebRequest方法) - /// - /// 文件上传到的服务器 - /// 要上传的本地文件(全路径) - /// 文件上传后的名称 - /// 上传进度条 - /// 成功返回1,失败返回0 - private int Upload_Request(string address, string fileNamePath, string saveName, ProgressBar progressBar) - { - int returnValue = 0; - // 要上传的文件 - FileStream fs = new FileStream(fileNamePath, FileMode.Open, FileAccess.Read); - BinaryReader r = new BinaryReader(fs); - //时间戳 - string strBoundary = "----------" + DateTime.Now.Ticks.ToString("x"); - byte[] boundaryBytes = Encoding.ASCII.GetBytes("/r/n--" + strBoundary + "/r/n"); - //请求头部信息 - StringBuilder sb = new StringBuilder(); - sb.Append("--"); - sb.Append(strBoundary); - sb.Append("\r\n"); - sb.Append("Content-Disposition: form-data; name=\""); - sb.Append("file"); - sb.Append("\"; filename=\""); - sb.Append(saveName); - sb.Append("\""); - sb.Append("\r\n"); - sb.Append("Content-Type: "); - sb.Append("application/octet-stream"); - sb.Append("\r\n"); - sb.Append("\r\n"); - string strPostHeader = sb.ToString(); - byte[] postHeaderBytes = Encoding.UTF8.GetBytes(strPostHeader); - // 根据uri创建HttpWebRequest对象 - HttpWebRequest httpReq = (HttpWebRequest)WebRequest.Create(new Uri(address)); - httpReq.Method = "POST"; - //对发送的数据不使用缓存 - httpReq.AllowWriteStreamBuffering = false; - //设置获得响应的超时时间(300秒) - httpReq.Timeout = 300000; - httpReq.ContentType = "multipart/form-data; boundary=" + strBoundary; - long length = fs.Length + postHeaderBytes.Length + boundaryBytes.Length; - long fileLength = fs.Length; - httpReq.ContentLength = length; - try - { - progressBar.Maximum = int.MaxValue; - progressBar.Minimum = 0; - progressBar.Value = 0; - //每次上传4k - int bufferLength = 4096; - byte[] buffer = new byte[bufferLength]; - //已上传的字节数 - long offset = 0; - //开始上传时间 - DateTime startTime = DateTime.Now; - int size = r.Read(buffer, 0, bufferLength); - Stream postStream = httpReq.GetRequestStream(); - //发送请求头部消息 - postStream.Write(postHeaderBytes, 0, postHeaderBytes.Length); - while (size > 0) - { - postStream.Write(buffer, 0, size); - offset += size; - progressBar.Value = (int)(offset * (int.MaxValue / length)); - TimeSpan span = DateTime.Now - startTime; - double second = span.TotalSeconds; - //lblTime.Text = "已用时:" + second.ToString("F2") + "秒"; - //if (second > 0.001) - //{ - // lblSpeed.Text = " 平均速度:" + (offset / 1024 / second).ToString("0.00") + "KB/秒"; - //} - //else - //{ - // lblSpeed.Text = " 正在连接…"; - //} - //lblState.Text = "已上传:" + (offset * 100.0 / length).ToString("F2") + "%"; - //lblSize.Text = (offset / 1048576.0).ToString("F2") + "M/" + (fileLength / 1048576.0).ToString("F2") + "M"; - Application.DoEvents(); - size = r.Read(buffer, 0, bufferLength); - } - //添加尾部的时间戳 - postStream.Write(boundaryBytes, 0, boundaryBytes.Length); - postStream.Close(); - //获取服务器端的响应 - WebResponse webRespon = httpReq.GetResponse(); - Stream s = webRespon.GetResponseStream(); - StreamReader sr = new StreamReader(s); - //读取服务器端返回的消息 - String sReturnString = sr.ReadLine(); - s.Close(); - sr.Close(); - if (sReturnString == "Success") - { - returnValue = 1; - } - else if (sReturnString == "Error") - { - returnValue = 0; - } - } - catch(Exception ex) - { - returnValue = 0; - string str = ex.ToString(); - } - finally - { - fs.Close(); - r.Close(); - } - return returnValue; - } - private void btn_file_Click(object sender, EventArgs e) { OpenFileDialog dlg = new OpenFileDialog(); diff --git a/FrmExportCADS.cs b/FrmExportCADS.cs index 98772ea..59629dd 100644 --- a/FrmExportCADS.cs +++ b/FrmExportCADS.cs @@ -108,65 +108,6 @@ MessageBox.Show("请选中要导出的图层!", "提示", MessageBoxButtons.OK, MessageBoxIcon.Warning); } } - private Boolean MerageToFile(GSOFeatures features, String strDestFile, String strProj4)//图层追加 - { - if (features == null) - { - return false; - } - Boolean bSuccess = false; - - string strDir = GSOUtility.GetFileDir(strDestFile); - string strLPRJFile = GSOUtility.ChangeExt(strDestFile, ".lprj"); - string strExt = GSOUtility.GetFileExt(strDestFile); - - // 如果投影文件存在,投影以投影文件为准 - if (File.Exists(strLPRJFile)) - { - // 如果是dxf,则这样处理 - if (strExt.ToLower() == ".dxf") - { - string strTempSrcFile = strDir + "srcFeatures_dxftmp" + strExt; - globeControl1.Globe.DataManager.SaveFeatureData(features, strTempSrcFile, strLPRJFile, 4); - bSuccess = GSOUtility.MergeTwoDXFFileFeatures(strDestFile, strTempSrcFile); - File.Delete(strTempSrcFile); - } - else - { - GSOFeatures srcFeatures = globeControl1.Globe.DataManager.ReadFeatureData(strDestFile); - int nCount = features.Length; - int i = 0; - for (i = 0; i < nCount; i++) - { - srcFeatures.Add(features[i]); - } - bSuccess = globeControl1.Globe.DataManager.SaveFeatureData(srcFeatures, strDestFile, strLPRJFile, 4); - } - } - else - { - // 如果是dxf,则这样处理 - if (strExt.ToLower() == ".dxf") - { - string strTempSrcFile = strDir + "srcFeatures_dxftmp" + strExt; - globeControl1.Globe.DataManager.SaveFeatureData(features, strTempSrcFile, strProj4, 0); - bSuccess = GSOUtility.MergeTwoDXFFileFeatures(strDestFile, strTempSrcFile); - File.Delete(strTempSrcFile); - } - else - { - GSOFeatures srcFeatures = globeControl1.Globe.DataManager.ReadFeatureData(strDestFile); - int nCount = features.Length; - int i = 0; - for (i = 0; i < nCount; i++) - { - srcFeatures.Add(features[i]); - } - bSuccess = globeControl1.Globe.DataManager.SaveFeatureData(srcFeatures, strDestFile, strProj4, 0); - } - } - return bSuccess; - } /// /// 关闭按钮事件处理 /// diff --git a/FrmHDMAnalysis3.cs b/FrmHDMAnalysis3.cs index 4f73af6..2ada735 100644 --- a/FrmHDMAnalysis3.cs +++ b/FrmHDMAnalysis3.cs @@ -436,29 +436,6 @@ } layerTemp.RemoveAllFeature(); } - private void Export(GSOPoint3d _pnt, double r) - { - GSOPoint3ds pnts = new GSOPoint3ds(); - GSOPoint3d pnt = new GSOPoint3d(); - pnt.X = _pnt.X; - pnt.Y = _pnt.Y; - pnt.Z = _pnt.Z; - pnts.Add(pnt); - pnt.X = _pnt.X; - pnt.Y = _pnt.Y - 0.0000000005; - pnt.Z = _pnt.Z; - pnts.Add(pnt); - GSOGeoPolyline3D line = new GSOGeoPolyline3D(); - line.AddPart(pnts); - GSOGeoPolygon3D polygon = line.CreateBuffer(r * 2, true, 5, true, false); - GSOPoint3ds points = polygon[0]; - GSOGeoPolyline3D newLine = new GSOGeoPolyline3D(); - newLine.AddPart(points); - newLine.AltitudeMode = EnumAltitudeMode.RelativeToGround; - GSOFeature newFeature = new GSOFeature(); - newFeature.Geometry = newLine; - globeControl1.Globe.MemoryLayer.AddFeature(newFeature); - } private void ExportCAD(double a, double b, double r) { diff --git a/FrmHotFuncStat.cs b/FrmHotFuncStat.cs index c980f34..2eb1476 100644 --- a/FrmHotFuncStat.cs +++ b/FrmHotFuncStat.cs @@ -421,13 +421,6 @@ } } - private void HFS_Pderive_Click(object sender, EventArgs e) - { - if (TV_Files.SelectedNode != null) - { - HFSClass.GuideEdit_form("G", TV_Files, int.Parse(((ToolStripMenuItem)sender).Tag.ToString())); - } - } private void 导入ToolStripMenuItem_Click(object sender, EventArgs e) { @@ -530,22 +523,8 @@ } } - private void 导出ToolStripMenuItem1_Click(object sender, EventArgs e) - { - 导出ToolStripMenuItem2_Click(sender, e); - } + - private void TV_HFSSrchRslt_AfterCollapse(object sender, TreeViewEventArgs e) - { - e.Node.ImageIndex = 0; - } - - private void TV_HFSSrchRslt_AfterExpand(object sender, TreeViewEventArgs e) - { - HFSClass.ADD_TreeNode(TV_Files, e.Node); - e.Node.ImageIndex = 1; - } - private void 导出ToolStripMenuItem1_Click_1(object sender, EventArgs e) { if ((TV_HFSSrchRslt.SelectedNode != null) && (TV_HFSSrchRslt.SelectedNode.Parent != null)) diff --git a/FrmLayerControl.cs b/FrmLayerControl.cs index e7917c3..28fa14d 100644 --- a/FrmLayerControl.cs +++ b/FrmLayerControl.cs @@ -312,26 +312,7 @@ layerManagerNode.Expand(); terrainManagerNode.Expand(); } - /// - /// 刷新节点树 - /// - private void RefreshDataTree() - { - layerTree2.Nodes[0].Nodes.Clear(); - Int32 nCount = globeControl2.Globe.Layers.Count; - Int32 i = 0; - for (i = 0; i < nCount; i++) - { - GSODataset dataSpace = globeControl2.Globe.Layers[i].Dataset; - TreeNode node = new TreeNode(); - node.Text = dataSpace.Name; - node.ImageIndex = 0; - node.SelectedImageIndex = 0; - node.Checked = true; - node.Tag = dataSpace; - layerTree2.Nodes[0].Nodes.Add(node); - } - } + /// /// 目标图层按钮事件处理 /// @@ -494,22 +475,8 @@ } } } - /// - /// 改变指定节点的选中状态 - /// - /// - /// - private void CheckTreeNode(TreeNode node, Boolean bChecked) - { - CheckChildTreeNode(node, bChecked); - // 对于kml图层,如果当前处理的节点是true,那么要把所有的祖宗节点置为true - // 只有所有节点都未false,那么这个节点才为false - // CheckFatherTreeNode(node, bChecked); - globeControl1.Globe.Refresh(); - globeControl2.Globe.Refresh(); - - } + private void CheckChildTreeNode(TreeNode node, Boolean bChecked) { if (node == null) @@ -696,59 +663,7 @@ //} //CheckControl(e); } - /// - /// 树节点选中方法 - /// - /// - private void CheckControl(TreeViewEventArgs e) - { - if (e.Action != TreeViewAction.Unknown) - { - if (e.Node != null && !Convert.IsDBNull(e.Node)) - { - CheckParentNode(e.Node); - if (e.Node.Nodes.Count > 0) - { - CheckAllChildNodes(e.Node, e.Node.Checked); - } - } - } - } - /// - /// 改变所有子节点的状态 - /// - /// - /// - private void CheckAllChildNodes(TreeNode pn, bool IsChecked) - { - foreach (TreeNode tn in pn.Nodes) - { - tn.Checked = IsChecked; - if (tn.Tag.ToString().Contains("|")) - { - string nodeTag = tn.Tag.ToString().Split('|')[1]; - GSOLayer layer = globeControl1.Globe.Layers.GetLayerByCaption(nodeTag); - if (layer != null) - { - layer.Visible = IsChecked; - globeControl1.Globe.Refresh(); - } - } - if (tn.Tag is GSOFeature) - { - if (tn.Nodes.Count == 0) - { - GSOFeature feat = tn.Tag as GSOFeature; - feat.Visible = IsChecked; - globeControl1.Globe.Refresh(); - } - } - if (tn.Nodes.Count > 0) - { - CheckAllChildNodes(tn, IsChecked); - } - } - } + /// /// 改变父节点的选中状态,此处为所有子节点不选中时才取消父节点选中,可以根据需要修改 /// diff --git a/FrmLogin.cs b/FrmLogin.cs index 320fdd5..2afe46e 100644 --- a/FrmLogin.cs +++ b/FrmLogin.cs @@ -59,70 +59,6 @@ textBoxPassWord.Clear(); } } - - /// - /// 验证端口号 - /// - /// - private bool ValiPort() - { - Ping p = new Ping();//创建Ping对象p - PingReply pr = p.Send(Utility.localicenseserverip);//向指定IP或者主机名的计算机发送ICMP协议的ping数据包 - if (pr.Status == IPStatus.Success)//如果ping成功 - { - try - { - TcpClient tcpc = new TcpClient(Utility.localicenseserverip, Utility.localicenseserverport);//对IP地址为"192.168.0.105"的计算机的1500端口提出连接申请 - tcpc.Close(); - return true; - } - catch (Exception ex) - { - MessageBox.Show("端口连接错误!" + ex.Message); - return false; - } - } - else - { - int times = 0;//重新连接次数; - int count = 2;//设置尝试次数 - while (times < count) - { - //Thread.Sleep(1000);//等待时间(方便测试的话,你可以改为1000) - pr = p.Send(Utility.localicenseserverip); - - if (pr.Status == IPStatus.Success) - { - try - { - TcpClient tcpc = new TcpClient(Utility.localicenseserverip, Utility.localicenseserverport);//对IP地址为"192.168.0.105"的计算机的1500端口提出连接申请 - tcpc.Close(); - return true; - } - catch (Exception ex) - { - MessageBox.Show("端口连接错误!" + ex.Message); - return false; - } - } - else - { - times++; - if (times < count) - { - continue; - } - else - { - MessageBox.Show("重新尝试连接失败"); - return false; - } - } - - } - return false; - } - } /// /// 验证用户名、密码 /// diff --git a/FrmMetadata.cs b/FrmMetadata.cs index 886f65a..0365372 100644 --- a/FrmMetadata.cs +++ b/FrmMetadata.cs @@ -27,11 +27,7 @@ InitializeComponent(); loadTreeView(layerTree); } - private void FrmMetadata_Load(object sender, EventArgs e) - { - //this.ntLblC.Text = "nn"; - // loadTreeView(layerTree); - } + private void loadTreeView(TreeView tv)//构建图层树 { try diff --git a/FrmMetadataStat.cs b/FrmMetadataStat.cs index 790658a..e7696c6 100644 --- a/FrmMetadataStat.cs +++ b/FrmMetadataStat.cs @@ -197,9 +197,5 @@ } } - private void buttonX1_Click(object sender, EventArgs e) - { - drawChart(); - } } } diff --git a/FrmPatrolerManager.cs b/FrmPatrolerManager.cs index 37f8ffd..9e66aeb 100644 --- a/FrmPatrolerManager.cs +++ b/FrmPatrolerManager.cs @@ -109,82 +109,8 @@ this.winGridViewPager1.AllToExport = table; } - /// - /// 编辑 - /// - /// - /// - private void winGridViewPager1_OnEditSelected(object sender, EventArgs e) - { - - DataGridView grid = sender as DataGridView; - if (grid != null && grid.SelectedRows.Count>0) - { - DataGridViewRow row = grid.SelectedRows[0]; - try - { - long dbid = long.Parse(row.Cells["编号"].Value.ToString()); - String name = row.Cells["姓名"].Value.ToString(); - String sex = row.Cells["性别"].Value.ToString(); - String age = row.Cells["年龄"].Value.ToString(); - string phone = row.Cells["电话"].Value.ToString(); - age = String.IsNullOrEmpty(age.ToString().Trim()) ? "1" : age.ToString().Trim(); - FrmPatrolerEdit frm = new FrmPatrolerEdit(dbid.ToString(), name, age, sex, phone); - frm.reloadGrid += new ReloadPatrolerGrid(LoadData); - frm.ShowDialog(); - winGridViewPager1.Refresh(); - } - catch (Exception ex) - { - MessageBox.Show("编辑失败:" + ex.ToString(), "错误", MessageBoxButtons.OK, MessageBoxIcon.Error); - } - } - else - { - MessageBox.Show("没有选择记录", "提示"); - } - - } - - /// - /// 删除 - /// - /// - /// - private void winGridViewPager1_OnDeleteSelected(object sender, EventArgs e) - { - DataGridView grid = sender as DataGridView; - if (grid != null && grid.SelectedRows.Count > 0) - { - DataGridViewRow row = grid.SelectedRows[0]; - long dbid = long.Parse(row.Cells["编号"].Value.ToString()); - try - { - string state = row.Cells["状态"].Value.ToString(); - if ("在线".Equals(state)) - { - if (MessageBox.Show("确定注销?", "确认", MessageBoxButtons.YesNo, MessageBoxIcon.Question) == DialogResult.Yes) - { - String sql = "update patroler t set t.accountstate='LEAVER' where t.dbid=" + dbid; - OracleUtils.ExecuteNonQuery(OracleUtils.ConnectionString, CommandType.Text, sql); - } - } - else { - MessageBox.Show("人员不在线,无法注销", "信息"); - } - } - catch (Exception ex) - { - MessageBox.Show("人员注销失败:" + ex.ToString(), "错误", MessageBoxButtons.OK, MessageBoxIcon.Error); - } - } - else - { - MessageBox.Show("没有选择记录", "提示"); - } - } - - + + private void LoadData() { int pageIndex = winGridViewPager1.PagerInfo.CurrenetPageIndex; diff --git a/FrmRoadHDM.cs b/FrmRoadHDM.cs index e765313..e871dd5 100644 --- a/FrmRoadHDM.cs +++ b/FrmRoadHDM.cs @@ -333,31 +333,6 @@ this.Cursor = Cursors.Default; } } - - private void Export(GSOPoint3d _pnt, double r) - { - GSOPoint3ds pnts = new GSOPoint3ds(); - GSOPoint3d pnt = new GSOPoint3d(); - pnt.X = _pnt.X; - pnt.Y = _pnt.Y; - pnt.Z = _pnt.Z; - pnts.Add(pnt); - pnt.X = _pnt.X; - pnt.Y = _pnt.Y - 0.0000000005; - pnt.Z = _pnt.Z; - pnts.Add(pnt); - GSOGeoPolyline3D line = new GSOGeoPolyline3D(); - line.AddPart(pnts); - GSOGeoPolygon3D polygon = line.CreateBuffer(r * 2, true, 5, true, false); - GSOPoint3ds points = polygon[0]; - GSOGeoPolyline3D newLine = new GSOGeoPolyline3D(); - newLine.AddPart(points); - newLine.AltitudeMode = EnumAltitudeMode.RelativeToGround; - GSOFeature newFeature = new GSOFeature(); - newFeature.Geometry = newLine; - globeControl1.Globe.MemoryLayer.AddFeature(newFeature); - } - private void ExportCAD(double a, double b, double r) { GSOPoint3ds pnts = new GSOPoint3ds(); diff --git a/FrmUserAdd.cs b/FrmUserAdd.cs index c612ab4..f826427 100644 --- a/FrmUserAdd.cs +++ b/FrmUserAdd.cs @@ -231,24 +231,6 @@ //cbxRegion.SelectedIndexChanged += new EventHandler(cbxRegion_SelectedIndexChanged); } } - /// - /// 下拉框选中项改变事件处理 - /// - /// - /// - private void cbxRegion_SelectedIndexChanged(object sender, EventArgs e) - { - string sql = ""; - //string sql = "select casic_role.\"name\" from casic_role join casic_regionrole on casic_role.\"id\"=casic_regionrole.\"rid\" where casic_regionrole.\"reid\"=" + region[cbxRegion.SelectedItem.ToString().Trim()]; - DataTable dt = OledbHelper.QueryTable(sql); - if (dt != null && dt.Rows.Count > 0) - { - comboBoxExRegionRole.Items.Clear(); - for (int i = 0; i < dt.Rows.Count; i++) - { - comboBoxExRegionRole.Items.Add(dt.Rows[i][0].ToString().Trim());//部门角色 - } - } - } + } } diff --git a/FrmUserManager.cs b/FrmUserManager.cs index 571f0f0..ae254bc 100644 --- a/FrmUserManager.cs +++ b/FrmUserManager.cs @@ -81,11 +81,6 @@ } } } - //创建新用户 - private void buttonX2_Click(object sender, EventArgs e) - { - FrmUserAdd frm = new FrmUserAdd(-1); - frm.ShowDialog(); - } + } } diff --git a/FrmValveStatistics.cs b/FrmValveStatistics.cs index 545d56c..dd76777 100644 --- a/FrmValveStatistics.cs +++ b/FrmValveStatistics.cs @@ -54,7 +54,7 @@ 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") + if (chaFamenStatis.Series["阀门"].Points[m]!=null&&chaFamenStatis.Series["阀门"].Points[m].YValues[0].ToString() != "0") { chaFamenStatis.Series["阀门"].Points[m].Label = chaFamenStatis.Series[0].Points[m].YValues[0].ToString(); } diff --git a/Frm_password_reset.cs b/Frm_password_reset.cs index 7b51039..b9e5dc3 100644 --- a/Frm_password_reset.cs +++ b/Frm_password_reset.cs @@ -41,6 +41,7 @@ } catch (Exception ex) { + LogHelper.WriteLog(typeof(Frm_password_reset), ex.Message); } } private void initCombox() diff --git a/FrmpipeDeepstatis.cs b/FrmpipeDeepstatis.cs index e156db4..1a84d6c 100644 --- a/FrmpipeDeepstatis.cs +++ b/FrmpipeDeepstatis.cs @@ -307,7 +307,7 @@ chart1.Series[j].Points.DataBindXY(dic1.Keys, dic1.Values); for (int m = 0; m < dic1.Values.Count; m++) { - if (chart1.Series[j].Points[m].YValues[0].ToString() != "0") + if (chart1.Series[j].Points[m]!=null&&chart1.Series[j].Points[m].YValues[0].ToString() != "0") { chart1.Series[j].Points[m].Label = chart1.Series[j].Points[m].YValues[0].ToString(); diff --git a/FrmpipeDiametergather.cs b/FrmpipeDiametergather.cs index 30674de..057b09d 100644 --- a/FrmpipeDiametergather.cs +++ b/FrmpipeDiametergather.cs @@ -263,6 +263,7 @@ if (layer != null && layer is GSOFeatureLayer) { GSOFeatureLayer flayer = layer as GSOFeatureLayer; + if (layer == null) return; GSOFeatures features = flayer.GetAllFeatures(); if (features.Length > 0) { diff --git a/FrmpipeMaterialGather.cs b/FrmpipeMaterialGather.cs index c133ec3..398b884 100644 --- a/FrmpipeMaterialGather.cs +++ b/FrmpipeMaterialGather.cs @@ -280,6 +280,7 @@ if (layer != null && layer is GSOFeatureLayer) { GSOFeatureLayer flayer = layer as GSOFeatureLayer; + if (flayer == null) return; GSOFeatures features = flayer.GetAllFeatures(); if (features.Length > 0) { @@ -332,7 +333,7 @@ chart1.Series[j].Points.DataBindXY(dic1.Keys, dic1.Values); for (int m = 0; m < dic1.Values.Count; m++) { - if (chart1.Series[j].Points[m].YValues[0].ToString() != "0") + if (chart1.Series[j].Points[m]!=null&&chart1.Series[j].Points[m].YValues[0].ToString() != "0") { chart1.Series[j].Points[m].Label = chart1.Series[j].Points[m].YValues[0].ToString(); } diff --git a/Frmpipediameterstatis.cs b/Frmpipediameterstatis.cs index c0ed80a..50f8170 100644 --- a/Frmpipediameterstatis.cs +++ b/Frmpipediameterstatis.cs @@ -286,6 +286,7 @@ chart1.Series.Add(layerCaption); GSOFeatureLayer flayer = layer as GSOFeatureLayer; + if (layer == null) return; GSOFeatures features = flayer.GetAllFeatures(); if (features.Length > 0) { diff --git "a/GKT_Forms/F_GKT\346\225\260\346\215\256\350\276\223\345\205\245\350\276\223\345\207\272.cs" "b/GKT_Forms/F_GKT\346\225\260\346\215\256\350\276\223\345\205\245\350\276\223\345\207\272.cs" index c7bffd5..4db7d5d 100644 --- "a/GKT_Forms/F_GKT\346\225\260\346\215\256\350\276\223\345\205\245\350\276\223\345\207\272.cs" +++ "b/GKT_Forms/F_GKT\346\225\260\346\215\256\350\276\223\345\205\245\350\276\223\345\207\272.cs" @@ -198,12 +198,7 @@ } DialogResult = DialogResult.OK;//将当前窗体的对话框返回值设为OK } - private void treeView1_NodeMouseClick(object sender, TreeNodeMouseClickEventArgs e) - { - dir_Ok = comboBox_Disk.Text + e.Node.FullPath; - //dir = comboBox_Disk.Text + e.Node.FullPath; - e.Node.SelectedImageIndex = e.Node.ImageIndex; - } + string tempstr = ""; private void button1_Click(object sender, EventArgs e) { diff --git a/HFS_Forms/Frm_HFSprojedits.cs b/HFS_Forms/Frm_HFSprojedits.cs index 96dd76f..3c232a1 100644 --- a/HFS_Forms/Frm_HFSprojedits.cs +++ b/HFS_Forms/Frm_HFSprojedits.cs @@ -126,16 +126,6 @@ Close(); } - - - private void TB_ProjName_KeyPress(object sender, KeyPressEventArgs e) - { - if (HFSAClass.Files_NameChar(e) == 0) - e.Handled = true; - if (e.KeyChar == '\r') - OK_Click(sender, e); - } - private void Frm_HFSProjedit_Load(object sender, EventArgs e) { @@ -175,10 +165,6 @@ } } - private void Cancel_Click(object sender, EventArgs e) - { - this.Close(); - } private void Cancel_Click_1(object sender, EventArgs e) { diff --git a/MainFrm.cs b/MainFrm.cs index 2c305a0..ed2685b 100644 --- a/MainFrm.cs +++ b/MainFrm.cs @@ -617,7 +617,7 @@ } catch (Exception ex) { - + LogHelper.WriteLog(typeof(MainFrm), ex.Message); } } @@ -1768,7 +1768,7 @@ } catch (Exception ex) { - //LogError.PublishError(ex); + LogHelper.WriteLog(typeof(MainFrm), ex.Message); } } @@ -2026,6 +2026,7 @@ } catch (Exception ex) { + LogHelper.WriteLog(typeof(MainFrm), ex.Message); result = false; } finally @@ -2316,220 +2317,6 @@ string filename = Utility.filename; List g1layername = new List(); /// - /// 构建图层列表目录树 - /// - /// - private void loadTreeView(TreeView tv) - { - try - { - XmlDocument doc = new XmlDocument(); - doc.Load(filename); - XmlNodeList Params1 = doc.SelectNodes("/Params/layers"); - tv.ShowLines = false; - tv.CheckBoxes = true; - - foreach (XmlNode paramsNode in Params1) //layers - { - foreach (XmlNode layerNode in paramsNode) //layer - { - TreeNode nodelayer = new TreeNode(); - string layerName = layerNode.Attributes["label"].Value; - nodelayer.Text = layerName; - - if (layerNode.HasChildNodes != false) - { - tv.Nodes.Add(nodelayer); - foreach (XmlNode layerchildNode in layerNode) //layerchild - { - if (layerchildNode.Name == "layerchild") - { - TreeNode nodelayerchild = new TreeNode(); - string layerType = layerchildNode.Attributes["type"].Value; - string layerName1 = layerchildNode.Attributes["layer"].Value; - string layerchildName = layerchildNode.Attributes["label"].Value; - if (layerType == "locaserver") - { - if (layerchildNode.Attributes["isRoad"] != null) - { - roadLayerName = layerchildName; - } - dictionaryNetLayerNameAndCaption.Add(layerName1, layerchildName); - - nodelayerchild.Text = layerchildName; - nodelayerchild.Tag = layerType + "|" + layerchildName; - nodelayerchild.Checked = true; - nodelayer.Nodes.Add(nodelayerchild); - } - else - { - if (layerchildNode.Attributes["isPipeLine"] != null) - { - m_PipelineLayerNames.Add(layerchildName); - } - if (layerchildNode.Attributes["isWorkWell"] != null) - { - workwellLayerNames.Add(layerchildName); - } - if (layerchildNode.Attributes["isValve"] != null) - { - valueLayerNames.Add(layerchildName); - } - //if (layerchildNode.Attributes["isInstrument"] != null) - if (layerchildNode.Attributes["isAccess"] != null) - { - instrumenLayerNames.Add(layerchildName); - } - //if (layerchildNode.Attributes["isPipeFitting"] != null) - if (layerchildNode.Attributes["isCharacter"] != null) - { - pipefittingLayerNames.Add(layerchildName); - } - bool boollayer = AddLayers(layerName1, layerchildName); - nodelayerchild.Text = layerchildName; - nodelayerchild.Tag = layerType + "|" + layerchildName; - nodelayerchild.Checked = boollayer; - if (layerchildName.Contains("特征管点")) - { - nodelayerchild.Checked = false; - setLayerVisible(layerName1); - } - - nodelayer.Nodes.Add(nodelayerchild); - g1layername.Add(layerName1); - } - } - else if (layerchildNode.Name == "layertype") - { - TreeNode nodelayerchild = new TreeNode(); - string layerType = layerchildNode.Attributes["label"].Value; - nodelayerchild.Text = layerType; - nodelayerchild.Tag = layerType; - nodelayerchild.Checked = true; - nodelayer.Nodes.Add(nodelayerchild); - if (layerchildNode.HasChildNodes == true) - { - foreach (XmlNode childNodeLayer in layerchildNode) - { - if (childNodeLayer.HasChildNodes == true) - { - TreeNode nodelayerchild2 = new TreeNode(); - string layer = childNodeLayer.Attributes["label"].Value; - nodelayerchild2.Text = layer; - nodelayerchild2.Tag = layer; - nodelayerchild2.Checked = true; - nodelayerchild.Nodes.Add(nodelayerchild2); - foreach (XmlNode n in childNodeLayer) - { - TreeNode nodelayerchild1 = new TreeNode(); - string layerName1 = n.Attributes["layer"].Value; - string layerchildName = n.Attributes["label"].Value; - string layerType1 = n.Attributes["type"].Value; - if (n.Attributes["isPipeLine"] != null) - { - m_PipelineLayerNames.Add(layerchildName); - } - if (n.Attributes["isWorkWell"] != null) - { - workwellLayerNames.Add(layerchildName); - } - if (n.Attributes["isValve"] != null) - { - valueLayerNames.Add(layerchildName); - } - if (n.Attributes["isAccess"] != null) - //if (n.Attributes["isInstrument"] != null) - { - instrumenLayerNames.Add(layerchildName); - } - if (n.Attributes["isPipeFitting"] != null) - { - pipefittingLayerNames.Add(layerchildName); - } - bool boollayer = AddLayers(layerName1, layerchildName); - nodelayerchild1.Text = layerchildName; - nodelayerchild1.Tag = layerType1 + "|" + layerchildName; - nodelayerchild1.Checked = boollayer; - if (layerchildName.Contains("特征管点")) - { - nodelayerchild1.Checked = false; - setLayerVisible(layerName1); - } - - nodelayerchild2.Nodes.Add(nodelayerchild1); - - g1layername.Add(layerName1); - } - } - else - { - TreeNode nodelayerchild1 = new TreeNode(); - string layerName1 = childNodeLayer.Attributes["layer"].Value; - string layerchildName = childNodeLayer.Attributes["label"].Value; - string layerType1 = childNodeLayer.Attributes["type"].Value; - if (childNodeLayer.Attributes["isPipeLine"] != null) - { - m_PipelineLayerNames.Add(layerchildName); - } - if (childNodeLayer.Attributes["isWorkWell"] != null) - { - workwellLayerNames.Add(layerchildName); - } - if (childNodeLayer.Attributes["isValve"] != null) - { - valueLayerNames.Add(layerchildName); - } - if (childNodeLayer.Attributes["isAccess"] != null) - //if (childNodeLayer.Attributes["isInstrument"] != null) - { - instrumenLayerNames.Add(layerchildName); - } - if (childNodeLayer.Attributes["isPipeFitting"] != null) - { - pipefittingLayerNames.Add(layerchildName); - } - bool boollayer = AddLayers(layerName1, layerchildName); - nodelayerchild1.Text = layerchildName; - nodelayerchild1.Tag = layerType1 + "|" + layerchildName; - nodelayerchild1.Checked = boollayer; - if (layerchildName.Contains("特征管点")) - { - nodelayerchild1.Checked = false; - setLayerVisible(layerName1); - } - nodelayerchild.Nodes.Add(nodelayerchild1); - g1layername.Add(layerName1); - } - } - } - } - } - } - else - { - tv.Nodes.Add(nodelayer); - } - } - } - - foreach (TreeNode tn in tv.Nodes) - { - if (tn.Nodes.Count > 0) - { - foreach (TreeNode tnChild in tn.Nodes) - { - if (tnChild.Checked) - tn.Checked = true; - } - } - } - } - catch (Exception ex) - { - //LogError.PublishError(ex); - } - } - /// /// 获取目标图层 /// /// @@ -2629,21 +2416,11 @@ } catch (Exception ex) { - //LogError.PublishError(ex); + LogHelper.WriteLog(typeof(MainFrm), ex.Message); return false; } } /// - /// 菜单上的 三维导航 工具按钮 - /// - /// - /// - private void buttonItem86_Click(object sender, EventArgs e) - { - globeControl1.Globe.Action = EnumAction3D.ActionNull; - } - - /// /// 地上模式 菜单按钮 /// /// @@ -3026,67 +2803,11 @@ } Image printImage; - /// - /// 打印 菜单 - /// - /// - /// - private void buttonItem13_Click(object sender, EventArgs e) - { - Point pt1 = new Point(Convert.ToInt32(0), Convert.ToInt32(0)); - Point pt2 = new Point(Convert.ToInt32(panelEx5.Width), Convert.ToInt32(panelEx5.Height)); - int mapWidth = 0; - int mapHeight = 0; - Point pt = getUpperLeftPoint(pt1, pt2, out mapWidth, out mapHeight); - printImage = new Bitmap(Convert.ToInt32(panelEx5.Width), Convert.ToInt32(panelEx5.Height)); - Graphics g = Graphics.FromImage(printImage); - g.CopyFromScreen(pt, new Point(0, 0), new Size(Convert.ToInt32(panelEx5.Width), Convert.ToInt32(panelEx5.Height))); - - PrintDialog pd = new PrintDialog(); - try - { - if (pd.ShowDialog() == DialogResult.OK) //如果确认,将会覆盖所有的打印参数设置 - { - //打印预览 - PrintPreviewDialog ppd = new PrintPreviewDialog(); - ppd.Document = printDocument1; - if (DialogResult.OK == ppd.ShowDialog()) - { - printDocument1.Print(); //打印 - } - } - } - catch - { - printDocument1.PrintController.OnEndPrint(printDocument1, new System.Drawing.Printing.PrintEventArgs()); - } - } - + private void printDocument1_PrintPage(object sender, System.Drawing.Printing.PrintPageEventArgs e) { e.Graphics.DrawImage(printImage, 10, 10); } - - /// - /// 在窗体的底部状态栏上显示 综合管线条件查询结果 - /// - /// - /// - private void ToolStripText(string currentLayer, int dataCount) - { - if (dataCount != 0) - { - double featurelength = PipeLength(currentLayer, 0);// 统计管线的里程数 - - toolStripNumbers.Text = " 管线类型:" + currentLayer + " | 共有:" + Convert.ToString(dataCount - 1) + "条记录"; - toolStripFeatureLength.Text = " 管线里程:" + featurelength.ToString("0.00") + " 米"; - } - else - { - toolStripNumbers.Text = "管线类型: " + currentLayer + "| 共有:" + 0 + " 条记录 | "; - } - } - /// /// 统计管线的里程数 /// @@ -3402,26 +3123,6 @@ } /// - /// 绘制线 菜单 - /// - /// - /// - private void btnAddLine_Click(object sender, EventArgs e) - { - globeControl1.Globe.DestLayerFeatureAdd = globeControl1.Globe.MemoryLayer; - globeControl1.Globe.Action = EnumAction3D.DrawPolyline; - } - /// - /// 绘制面 菜单 - /// - /// - /// - private void btnAddPolygon_Click(object sender, EventArgs e) - { - globeControl1.Globe.DestLayerFeatureAdd = globeControl1.Globe.MemoryLayer; - globeControl1.Globe.Action = EnumAction3D.DrawPolygon; - } - /// /// 图层目录树 右键菜单中的 目标图层 菜单 /// /// @@ -3956,42 +3657,7 @@ // ClearUpDownTraceAnalysis(); //} - /// - /// 显示流向 功能 - /// - /// - /// - /// - private void Flow(object sender, string pipelineNameCN, bool bShow) - { - GSOFeatureLayer layer = globeControl1.Globe.Layers.GetLayerByCaption(pipelineNameCN) as GSOFeatureLayer; - GSOFeatures feats = layer.GetAllFeatures(); - for (int i = 0; i < feats.Length; i++) - { - GSOFeature feat = feats[i]; - GSOLineStyle3D lineStyle = feat.Geometry.Style as GSOLineStyle3D; - if (lineStyle != null) - { - if (lineStyle.ArrowStyle == null) - { - lineStyle.ArrowStyle = new GSOArrowStyle(); - lineStyle.ArrowStyle.BodyWidth = 2; - lineStyle.ArrowStyle.BodyLen = 6; - lineStyle.ArrowStyle.HeadWidth = 8; - lineStyle.ArrowStyle.HeadLen = 10; - lineStyle.ArrowStyle.OutlineVisible = true; - lineStyle.ArrowStyle.OutlineColor = Color.Red; - lineStyle.ArrowStyle.Speed = lineStyle.ArrowStyle.Speed / 2; - lineStyle.ArrowStyle.Play(); - } - lineStyle.ArrowVisible = bShow; - layerTree.SelectedNode = null; - } - } - globeControl1.Globe.Refresh(); - } - - + FrmCloseValves frm; /// /// 关阀分析 功能 @@ -4030,7 +3696,9 @@ curCAYNDataset.CloseValveAnalysis(lineFeature.ID, out arryResNodeID, out arryResValveID, false, true); } catch (Exception e) - { } + { + LogHelper.WriteLog(typeof(MainFrm), e.Message); + } string valveName = lineLayer.Caption; valveName = valveName.Substring(0, valveName.IndexOf("管线")); @@ -4106,7 +3774,7 @@ } catch (Exception e) { - + LogHelper.WriteLog(typeof(MainFrm), e.Message); } //目前只有燃气管线 有阀门 string valveName = lineLayer.Name; @@ -5457,7 +5125,7 @@ } catch (Exception ex) { - //MessageBox.Show(ex.ToString()); + LogHelper.WriteLog(typeof(MainFrm), ex.Message); } finally { @@ -5501,22 +5169,6 @@ } } - - /// - /// 清除所有坑 菜单 - /// - /// - /// - private void buttonItem3_Click(object sender, EventArgs e) - { - //日志记录 - LogManager.saveLog(Utility.userName, this.buttonItem3.Text); - - globeControl1.Globe.RemoveAllPits(); - } - - - ///// ///// 净距分析 菜单 ///// @@ -5554,42 +5206,8 @@ // ribbonBarTP.Visible = buttonItem34.Checked; // ribbonBarTP.Location = new Point(0, 0); //} - /// - /// 大气层 菜单 - /// - /// - /// - private void buttonItem17_Click_1(object sender, EventArgs e) - { - globeControl1.Globe.Atmosphere.Visible = !globeControl1.Globe.Atmosphere.Visible; - buttonItemSH1.Checked = globeControl1.Globe.Atmosphere.Visible; - globeControl1.Refresh(); - } - /// - /// 经纬网 菜单 - /// - /// - /// - private void buttonItem20_Click(object sender, EventArgs e) - { - globeControl1.Globe.LatLonGrid.Visible = !globeControl1.Globe.LatLonGrid.Visible; - buttonItemSH3.Checked = globeControl1.Globe.LatLonGrid.Visible; - globeControl1.Globe.Refresh(); - } - /// - /// 状态条 菜单 - /// - /// - /// - private void buttonItem21_Click_1(object sender, EventArgs e) - { - globeControl1.Globe.StatusBar.Visible = !globeControl1.Globe.StatusBar.Visible; - buttonItemSH4.Checked = globeControl1.Globe.StatusBar.Visible; - globeControl1.Globe.Refresh(); - } - - + /// /// 添加指定路径下的数据 功能 /// @@ -5680,43 +5298,7 @@ // } // return objRes; //} - /// - /// 刷新目录树 功能 - /// - private void RefreshDataTree() - { - layerTree.Nodes[0].Nodes.Clear(); - Int32 nCount = globeControl1.Globe.DataManager.DataSourceCount; - Int32 i = 0; - for (i = 0; i < nCount; i++) - { - GSODataSource dataSpace = globeControl1.Globe.DataManager[i]; - TreeNode node = new TreeNode(); - node.Text = dataSpace.Name; - node.ImageIndex = 0; - node.SelectedImageIndex = 0; - node.Checked = true; - node.Tag = dataSpace; - Int32 nDatasetCount = dataSpace.DatasetCount; - for (Int32 j = 0; j < nDatasetCount; j++) - { - GSODataset dataset = dataSpace[j]; - TreeNode subNode = new TreeNode(); - subNode.Text = dataset.Name; - subNode.ImageIndex = 0; - subNode.SelectedImageIndex = 0; - subNode.Checked = true; - subNode.Tag = dataset; - node.Nodes.Add(subNode); - } - layerTree.Nodes[0].Nodes.Add(node); - } - } - - - - - + /// /// 复合查询 菜单 @@ -5777,34 +5359,7 @@ return false; } - /// - /// 统计指定图层在指定范围内的所有feature对象 - /// - /// - /// - /// - private GSOFeatures Intersect_PointLayer(GSOGeoPolygon3D polygon, string pointLayerName) - { - GSOLayer layer = globeControl1.Globe.Layers.GetLayerByCaption(pointLayerName); - if (layer == null) - return null; - - GSOFeatureLayer flayer = layer as GSOFeatureLayer; - GSOFeatureDataset fdataset = flayer.Dataset as GSOFeatureDataset; - GSOFeatures feats; - if (polygon == null) - { - feats = flayer.GetAllFeatures(); - } - else - { - feats = flayer.FindFeaturesInPolygon(polygon, false); - } - - workWellLen.Add(pointLayerName, feats.Length); - return feats; - } - /// + /// /// 碰撞分析功能界面中 选择管线复选框 选中状态改变事件处理 /// /// @@ -5946,16 +5501,6 @@ MessageBox.Show("表格内容为空!", "提示"); } } - /// - /// 导出CAD 菜单 - /// - /// - /// - private void btnExportCAD_Click(object sender, EventArgs e) - { - FrmExportCADS frm = new FrmExportCADS(globeControl1, m_PipelineLayerNames); - frm.ShowDialog(); - } ///// ///// 区域分析 菜单 @@ -5987,16 +5532,6 @@ } } } - /// - /// 数据验证 菜单 - /// - /// - /// - private void buttonItem80_Click(object sender, EventArgs e) - { - FrmValiData frm = new FrmValiData(globeControl1); - frm.ShowDialog(); - } /// /// 根据指定图层创建图层节点并将节点添加到图层管理节点的子节点集合中 @@ -6018,56 +5553,7 @@ layerManagerNode.Expand(); } } - /// - /// 数据库备份 菜单 - /// - /// - /// - private void btnBackDatabase_Click(object sender, EventArgs e) - { - if (MessageBox.Show("是否确定要备份数据库文件", "信息", MessageBoxButtons.YesNo, MessageBoxIcon.Question) == DialogResult.Yes) - { - try - { - DateTime currentTime = DateTime.Now; - //string Dtime = currentTime.ToShortDateString().ToString("yyyy-MM-dd"); - string Dtime = currentTime.GetDateTimeFormats('D')[0].ToString(); - string Htime = DateTime.Now.ToString("HH时mm分ss秒").Trim(); - string fileName = Dtime + "(" + Htime + ")"; - string pathName = ""; - string sql = "select filename from master..sysdatabases where name='" + Utility.dbdatabase + "'"; - DataTable dt = OledbHelper.ExecuteDataTable(sql); - if (dt != null && dt.Rows.Count > 0) - { - pathName = dt.Rows[0][0].ToString().Trim(); - int count = pathName.LastIndexOf("\\") == -1 ? pathName.LastIndexOf("/") : pathName.LastIndexOf("\\"); - pathName = pathName.Substring(0, count); - } - pathName += "\\管网数据库" + fileName + ".bak"; - - OracleCommand cmdBK = new OracleCommand(); - cmdBK.CommandType = CommandType.Text; - cmdBK.Connection = connBackup; - cmdBK.CommandText = @"backup database " + Utility.dbdatabase + " to disk='" + pathName + "' with init"; - - connBackup.Open(); - cmdBK.ExecuteNonQuery(); - MessageBox.Show("数据库文件备份成功", "提示"); - } - catch (Exception ex) - { - MessageBox.Show(ex.ToString()); - } - finally - { - connBackup.Close(); - } - } - } - - - - + //GSOFeature emitterFeature; // 粒子要素 /// /// 添加火苗 功能 @@ -6598,361 +6084,15 @@ } } - - ///// - /// 添加用户仓库 菜单 - /// - /// - /// - private void buttonItem108_Click(object sender, EventArgs e) - { - FrmUserRepo frm = new FrmUserRepo(-1); - frm.ShowDialog(); - } - /// - /// 用户仓库管理 菜单 - /// - /// - /// - private void buttonItem111_Click(object sender, EventArgs e) - { - FrmUserRepoMgr frm = new FrmUserRepoMgr(); - frm.ShowDialog(); - } - /// - /// 添加分系统 菜单 - /// - /// - /// - private void buttonItem112_Click(object sender, EventArgs e) - { - //FrmAPP frm = new FrmAPP(-1); - //frm.ShowDialog(); - } - /// - /// 分系统管理 菜单 - /// - /// - /// - private void buttonItem113_Click(object sender, EventArgs e) - { - //FrmAPPMgr frm = new FrmAPPMgr(); - //frm.ShowDialog(); - } - /// - /// 添加操作 菜单 - /// - /// - /// - private void buttonItem114_Click(object sender, EventArgs e) - { - FrmOper frm = new FrmOper(-1); - frm.ShowDialog(); - } - /// - /// 操作管理 菜单 - /// - /// - /// - private void buttonItem115_Click(object sender, EventArgs e) - { - FrmOperMgr frm = new FrmOperMgr(); - frm.ShowDialog(); - } - /// - /// 添加资源 菜单 - /// - /// - /// - private void buttonItem116_Click(object sender, EventArgs e) - { - FrmRESC frm = new FrmRESC(-1); - frm.ShowDialog(); - } - /// - /// 资源管理 菜单 - /// - /// - /// - private void buttonItem117_Click(object sender, EventArgs e) - { - FrmRESCMgr frm = new FrmRESCMgr(); - frm.ShowDialog(); - } - /// - /// 添加权限 菜单 - /// - /// - /// - private void buttonItem118_Click(object sender, EventArgs e) - { - FrmPerm frm = new FrmPerm(-1); - frm.ShowDialog(); - } - /// - /// 权限管理 菜单 - /// - /// - /// - private void buttonItem119_Click(object sender, EventArgs e) - { - FrmPermMgr frm = new FrmPermMgr(); - frm.ShowDialog(); - } - /// - /// 添加访问控制 菜单 - /// - /// - /// - private void buttonItem120_Click(object sender, EventArgs e) - { - FrmAccess frm = new FrmAccess(-1); - frm.ShowDialog(); - } - /// - /// 访问控制管理 菜单 - /// - /// - /// - private void buttonItem121_Click(object sender, EventArgs e) - { - FrmAccessMgr frm = new FrmAccessMgr(); - frm.ShowDialog(); - } - /// - /// 部门类型管理 菜单 - /// - /// - /// - private void buttonItem122_Click(object sender, EventArgs e) - { - FrmRegionTypeMgr frm = new FrmRegionTypeMgr(); - frm.ShowDialog(); - } - /// - /// 用户信息管理 菜单 - /// - /// - /// - private void buttonItem128_Click_1(object sender, EventArgs e) - { - FrmUserManager frm = new FrmUserManager(); - frm.ShowDialog(); - } - /// - /// 添加角色 菜单 - /// - /// - /// - private void 添加角色_Click(object sender, EventArgs e) - { - FrmRole frm = new FrmRole(-1); - frm.ShowDialog(); - } - /// - /// 所有角色管理 菜单 - /// - /// - /// - private void 角色管理_Click(object sender, EventArgs e) - { - FrmRoleMgr frm = new FrmRoleMgr(); - frm.ShowDialog(); - } - - /// - /// 部门角色管理 菜单 - /// - /// - /// - private void buttonItem133_Click(object sender, EventArgs e) - { - FrmRegionRoleMgr frm = new FrmRegionRoleMgr(); - frm.ShowDialog(); - } - /// - /// 部门管理 菜单 - /// - /// - /// - private void buttonItem130_Click(object sender, EventArgs e) - { - FrmRegionMgr frm = new FrmRegionMgr(); - frm.ShowDialog(); - } - - /// - /// 日志管理 菜单 - /// - /// - /// - private void buttonItem135_Click(object sender, EventArgs e) - { - FrmLogManager frm = new FrmLogManager(); - frm.ShowDialog(); - } - /// - /// 传感器信息查询 菜单 - /// - /// - /// - private void buttonItem131_Click_1(object sender, EventArgs e) - { - GSOFeature selectedFeature = globeControl1.Globe.SelectedObject; - if (selectedFeature == null) - { - MessageBox.Show("请选择一个传感器对象!", "提示", MessageBoxButtons.OK, MessageBoxIcon.Information); - } - else - { - if (selectedFeature.Geometry != null && selectedFeature.Geometry.Type == EnumGeometryType.GeoModel) - { - GSOLayer layer = globeControl1.Globe.SelectedObjectLayer; - string tabelName = getTableName(layer.Caption); - string eqtID = selectedFeature.Description.Trim(); - if (tabelName != "" && eqtID != "") - { - string fields = getFields(tabelName); - if (fields != "") - { - string sql = "select " + fields + " from " + Utility.sensorDatabase + "." + tabelName + " where EqtID=" + eqtID + " order by RecordDate desc limit 1;"; - DataTable dt = MySqlHelper.queryDataTable(sql); - if (dt != null && dt.Rows.Count > 0) - { - FrmQueryMessage.ShowForm(this, dt, layer.Caption); - //queryMessage.Show(this); - } - else - { - MessageBox.Show("没有查询到相关信息!", "提示"); - } - } - else - { - MessageBox.Show("配置文件 \"sensorConfig.xml\" 有误!", "提示"); - } - } - else - { - MessageBox.Show("请选择一个传感器对象!", "提示"); - } - } - else - { - MessageBox.Show("请选择一个传感器对象!", "提示", MessageBoxButtons.OK, MessageBoxIcon.Information); - } - } - } - /// - /// 根据指定的图层的caption属性的值在配置文件中查找对应的数据库中的表的名称 - /// - /// 图层的caption属性的值 - /// 对应的数据库中的表的名称 - private string getTableName(string name) - { - string tabelName = ""; - if (Utility.sensorMarkerLayers != null) - { - for (int i = 0; i < Utility.sensorMarkerLayers.Count; i++) - { - MarkerLayer mLayer = Utility.sensorMarkerLayers[i]; - if (mLayer.layerName == name) - { - tabelName = mLayer.tableName; - break; - } - } - } - return tabelName; - } - /// - /// 根据数据库中的表的名称 查找对应的表中的字段名称的集合 - /// - /// 数据库中的表的名称 - /// 对应的表中的字段名称的集合 - private string getFields(string tabelName) - { - string fields = ""; - if (Utility.sensorMarkerLayers != null) - { - for (int i = 0; i < Utility.sensorMarkerLayers.Count; i++) - { - MarkerLayer mLayer = Utility.sensorMarkerLayers[i]; - if (mLayer.tableName.Trim() == tabelName.Trim()) - { - if (mLayer.fields != null) - { - foreach (string key in mLayer.fields.Keys) - { - string value = mLayer.fields[key]; - fields += tabelName.Trim() + "." + key + " as " + value + ","; - } - fields = fields.Remove(fields.Length - 1); - } - break; - } - } - } - return fields; - } - - /// - /// 历史曲线查询 菜单 - /// - /// - /// - private void buttonItem132_Click(object sender, EventArgs e) - { - GSOFeature selectedFeature = globeControl1.Globe.SelectedObject; - if (selectedFeature == null) - { - MessageBox.Show("请选择一个对象!", "提示", MessageBoxButtons.OK, MessageBoxIcon.Information); - } - else - { - if (selectedFeature.Geometry != null && selectedFeature.Geometry.Type == EnumGeometryType.GeoModel) - { - GSOLayer layer = globeControl1.Globe.SelectedObjectLayer; - string tabelName = getTableName(layer.Caption); - string eqtID = selectedFeature.Description; - if (tabelName != "" && eqtID != "") - { - FrmQueryHistory.ShowForm(this, tabelName, eqtID); - } - else - { - MessageBox.Show("请选择一个传感器对象!", "提示"); - } - } - else - { - MessageBox.Show("请选择一个传感器对象!", "提示", MessageBoxButtons.OK, MessageBoxIcon.Information); - } - } - } - + //定时检查传感器的状态 public System.Windows.Forms.Timer timerOfSensor = null; public int alarmValueLiuLiang = 0; public int alarmValueYaLi = 0; public int alarmValueYeTi = 0; public int alarmValueZaoSheng = 0; - /// - /// 传感器在线报警 菜单 - /// - /// - /// - private void buttonItem134_Click(object sender, EventArgs e) - { - if (timerOfSensor == null) - { - timerOfSensor = new System.Windows.Forms.Timer(); - timerOfSensor.Interval = 30000; - timerOfSensor.Tick += new EventHandler(timerOfSensor_Tick); - } - FrmQuerySensorAlarm.ShowForm(this); - } + /// /// 传感器报警 功能中的 定时器 的触发事件处理 /// @@ -7016,6 +6156,7 @@ } catch (Exception ex) { + LogHelper.WriteLog(typeof(MainFrm), ex.Message); continue; } } @@ -7025,145 +6166,7 @@ } } - - /// - /// 沿线运动 菜单 - /// - /// - /// - private void buttonItem138_Click(object sender, EventArgs e) - { - if (globeControl1.Globe.SelectedObject == null) - { - MessageBox.Show("请先选择一条线!", "提示", MessageBoxButtons.OK, MessageBoxIcon.Exclamation); - return; - } - - GSOFeature lineFeature = globeControl1.Globe.SelectedObject; - if (lineFeature.Geometry == null || lineFeature.Geometry.Type != EnumGeometryType.GeoPolyline3D) - { - MessageBox.Show("请先选择一条线!", "提示", MessageBoxButtons.OK, MessageBoxIcon.Exclamation); - return; - } - - OpenFileDialog dlg = new OpenFileDialog(); - dlg.Filter = "*.gcm;*.3ds|*.gcm;*.3ds|*.3ds|*.3ds|*.gcm|*.gcm"; - if (dlg.ShowDialog() == DialogResult.OK) - { - GSOGeoModel model = new GSOGeoModel(); - model.FilePath = dlg.FileName; - - GSOGeoDynamicRoute dynamicRoute = new GSOGeoDynamicRoute(); - dynamicRoute.ActorGeometry = model; - - GSORoute route = new GSORoute(); - GSOGeoPolyline3D geoline = (GSOGeoPolyline3D)lineFeature.Geometry; - for (int i = 0; i < geoline[0].Count; i++) - { - route.Add(geoline[0][i]); - } - route.CircleRoute = false; - route.Speed = 30; - route.RotateSpeed = 50; - route.AltitudeMode = geoline.AltitudeMode; - dynamicRoute.Route = route; - - GSOFeature feature = new GSOFeature(); - - dynamicRoute.Play(); - feature.Geometry = dynamicRoute; - - //GSOLabel gsoLabel = new GSOLabel(); - //gsoLabel.Text = "模型测试"; - //feature.Label = gsoLabel; - globeControl1.Globe.MinModelVisibleSize = 0; - - globeControl1.Globe.MemoryLayer.AddFeature(feature); - globeControl1.Globe.Refresh(); - } - } - /// - /// 回退 菜单 - /// - /// - /// - private void buttonItem99_Click(object sender, EventArgs e) - { - globeControl1.Globe.UnDoEdit(); - } - /// - /// 前进 菜单 - /// - /// - /// - private void buttonItem100_Click(object sender, EventArgs e) - { - globeControl1.Globe.ReDoEdit(); - } - /// - /// 水平净距 功能界面中的 标签内容改变事件处理 - /// - /// - /// - private void textBoxX4_TextChanged(object sender, EventArgs e) - { - string valueJingJu = textBoxX4.Text.Trim(); - if (valueJingJu != "") - { - double value = 0; - bool bl = double.TryParse(valueJingJu, out value); - if (bl) - { - labelX24.Text = "水平净距小于" + value.ToString() + "米的管线有:"; - } - } - } - /// - /// 垂直净距 功能界面中的 标签内容改变事件处理 - /// - /// - /// - private void textBoxX2_TextChanged(object sender, EventArgs e) - { - string valueJingJu = textBoxX2.Text.Trim(); - if (valueJingJu != "") - { - double value = 0; - bool bl = double.TryParse(valueJingJu, out value); - if (bl) - { - labelX23.Text = "垂直净距小于" + value.ToString() + "米的管线有:"; - } - } - } - /// - /// 覆土分析 功能界面中的 标签内容改变事件处理 - /// - /// - /// - private void textBoxX3_TextChanged(object sender, EventArgs e) - { - string valueJingJu = textBoxX3.Text.Trim(); - if (valueJingJu != "") - { - double value = 0; - bool bl = double.TryParse(valueJingJu, out value); - if (bl) - { - labelX17.Text = "覆土深度小于" + value.ToString() + "米的管线有:"; - } - } - } - - /// - /// 传感器分类查询 全区域 菜单 - /// - /// - /// - private void buttonItemSensor全区域查询_Click(object sender, EventArgs e) - { - FrmAccessoriesSensor.ShowForm(globeControl1, instrumenLayerNames, 0); - } + /// /// 传感器分类查询 绘制区域 菜单 /// @@ -7224,170 +6227,10 @@ layerTemp.RemoveAllFeature(); globeControl1.Refresh(); } - /// - /// 数字预处理 功能 - /// - /// - /// - private void 数字预处理buttonItem140_Click(object sender, EventArgs e) - { - FrmEditShapeFile frm = new FrmEditShapeFile(globeControl1); - frm.ShowDialog(this); - } - - - /// - /// 导出矢量 功能 将图层导出为kml和shp格式数据 - /// - /// - /// - private void 导出矢量buttonItem140_Click(object sender, EventArgs e) - { - /* - List m_PipelineLayerNames = new List();//线图层名称 - List workwellLayerNames = new List();//工井图层名称 - List valueLayerNames = new List();//阀门图层名称 - List instrumenLayerNames = new List();//附属物图层名称 - List pipefittingLayerNames = new List();//管件图层名称 - */ - List listVectorNames = new List(); - for (int i = 0; i < m_PipelineLayerNames.Count; i++) - { - if (m_PipelineLayerNames[i] == "移动" || m_PipelineLayerNames[i] == "联通" - || m_PipelineLayerNames[i] == "电信" || m_PipelineLayerNames[i] == "共通" - || m_PipelineLayerNames[i] == "有限电视" || m_PipelineLayerNames[i] == "交通信号" - || m_PipelineLayerNames[i] == "供电") - { - continue; - } - if (listVectorNames.Contains(m_PipelineLayerNames[i]) == false) - { - listVectorNames.Add(m_PipelineLayerNames[i]); - } - } - for (int i = 0; i < valueLayerNames.Count; i++) - { - if (listVectorNames.Contains(valueLayerNames[i]) == false) - { - listVectorNames.Add(valueLayerNames[i]); - } - } - for (int i = 0; i < workwellLayerNames.Count; i++) - { - if (listVectorNames.Contains(workwellLayerNames[i]) == false) - { - listVectorNames.Add(workwellLayerNames[i]); - } - } - for (int i = 0; i < instrumenLayerNames.Count; i++) - { - if (listVectorNames.Contains(instrumenLayerNames[i]) == false) - { - listVectorNames.Add(instrumenLayerNames[i]); - } - } - for (int i = 0; i < pipefittingLayerNames.Count; i++) - { - if (listVectorNames.Contains(pipefittingLayerNames[i]) == false) - { - listVectorNames.Add(pipefittingLayerNames[i]); - } - } - FrmExportVector frm = new FrmExportVector(globeControl1, listVectorNames); - frm.ShowDialog(); - } string citySevenLineType = ""; string cityServerLineName = ""; /// - /// 绘制城市七线 功能按钮 - /// - /// - /// - private void 绘制城市七线buttonItem140_Click(object sender, EventArgs e) - { - FrmCitySevenLineType frm = new FrmCitySevenLineType(); - if (frm.ShowDialog() == DialogResult.OK) - { - globeControl1.Globe.Action = EnumAction3D.DrawPolyline; - m_isDrawCitySevenLine = true; - m_isDrawTunnel = false; - m_AddPipeLine = false; - this.citySevenLineType = frm.citySevenLineType; - this.cityServerLineName = frm.citySevenLineName; - switch (frm.citySevenLineType) - { - case "城市红线": - GSOLayer layerRed = globeControl1.Globe.Layers.GetLayerByCaption(frm.citySevenLineType); - if (layerRed != null) - { - globeControl1.Globe.DestLayerFeatureAdd = layerRed; - layerRed.Editable = true; - } - break; - case "城市橙线": - GSOLayer layerOrange = globeControl1.Globe.Layers.GetLayerByCaption(frm.citySevenLineType); - if (layerOrange != null) - { - globeControl1.Globe.DestLayerFeatureAdd = layerOrange; - layerOrange.Editable = true; - } - break; - case "城市黄线": - GSOLayer layerYellow = globeControl1.Globe.Layers.GetLayerByCaption(frm.citySevenLineType); - if (layerYellow != null) - { - globeControl1.Globe.DestLayerFeatureAdd = layerYellow; - layerYellow.Editable = true; - } - break; - case "城市绿线": - GSOLayer layerGreen = globeControl1.Globe.Layers.GetLayerByCaption(frm.citySevenLineType); - if (layerGreen != null) - { - globeControl1.Globe.DestLayerFeatureAdd = layerGreen; - layerGreen.Editable = true; - } - break; - case "城市蓝线": - GSOLayer layerBlue = globeControl1.Globe.Layers.GetLayerByCaption(frm.citySevenLineType); - if (layerBlue != null) - { - globeControl1.Globe.DestLayerFeatureAdd = layerBlue; - layerBlue.Editable = true; - } - break; - case "城市紫线": - GSOLayer layerPurple = globeControl1.Globe.Layers.GetLayerByCaption(frm.citySevenLineType); - if (layerPurple != null) - { - globeControl1.Globe.DestLayerFeatureAdd = layerPurple; - layerPurple.Editable = true; - } - break; - case "城市黑线": - GSOLayer layerBlack = globeControl1.Globe.Layers.GetLayerByCaption(frm.citySevenLineType); - if (layerBlack != null) - { - globeControl1.Globe.DestLayerFeatureAdd = layerBlack; - layerBlack.Editable = true; - } - break; - } - } - } - /// - /// 七线审核 功能按钮 - /// - /// - /// - private void 七线审核buttonItem141_Click(object sender, EventArgs e) - { - FrmCityServerLineAnalysis frm = new FrmCityServerLineAnalysis(globeControl1, m_PipelineLayerNames); - frm.ShowDialog(this); - } - - /// /// 间距分析 开始分析按钮 分析绘制的七线和管线的距离是否符合标准 /// /// @@ -7666,25 +6509,6 @@ } } - - - /// - /// 管线自动缩进 菜单 - /// - /// - /// - private void 管线自动缩进buttonItem140_Click(object sender, EventArgs e) - { - FrmPipelineIndented frm = new FrmPipelineIndented(globeControl1, m_PipelineLayerNames, workwellLayerNames); - frm.ShowDialog(this); - } - - private void btnExportCADs_Click(object sender, EventArgs e) - { - - } - - /// /// 统计指定图层在指定范围内的所有feature对象 /// @@ -7755,8 +6579,6 @@ } - - //设置图层为隐藏 private void setLayerVisible(string layerName) { @@ -7765,27 +6587,7 @@ globeControl1.Globe.Refresh(); } - /// - /// 连接数据库 - /// - /// - /// - private void buttonItem129_Click(object sender, EventArgs e) - { - //保存日志 - LogManager.saveLog(Utility.userName, this.buttonItemSJGL4_1.Text); - - FrmDatabaseParaSetting2 frm = new FrmDatabaseParaSetting2(globeControl1); - if (frm.ShowDialog() == DialogResult.OK) - { - ds = FrmDatabaseParaSetting2.ds; - if (ds != null) - { - ds.IsCloseSaved = false; - } - } - } - + /// /// 清除渲染结果 /// @@ -7803,112 +6605,8 @@ layerTemp.RemoveAllFeature(); globeControl1.Refresh(); } - - /// - /// 绘制垂线 - /// - /// - /// - private void drawCLine(GSOPoint3d fpt, GSOPoint3d tpt) - { - GSOGeoPolyline3D pline = new GSOGeoPolyline3D(); - GSOPoint3ds pts = new GSOPoint3ds(); - pts.Add(fpt); - pts.Add(tpt); - pline.AddPart(pts); - - GSOGeoPoint3D fptg = new GSOGeoPoint3D(); - GSOGeoPoint3D tptg = new GSOGeoPoint3D(); - fptg.X = fpt.X; - fptg.Y = fpt.Y; - fptg.Z = 0; - tptg.X = tpt.X; - tptg.Y = tpt.Y; - tptg.Z = 0; - - GSOFeature gf = new GSOFeature(); - gf.Geometry = pline; - - globeControl1.Globe.MemoryLayer.AddFeature(gf); - - } - /// - /// 红线审核 - /// - /// - /// - private void buttonItem138_Click_2(object sender, EventArgs e) - { - - } - /// - /// 比较两个点是否是同一个点 - /// - /// - /// - /// - private bool comparePoint(GSOPoint3d pt1, GSOPoint3d pt2) - { - double x1 = 0; double y1 = 0; - double x2 = 0; double y2 = 0; - x1 = pt1.X; - y1 = pt1.Y; - x2 = pt2.X; - y2 = pt2.Y; - if ((x1 == x2) && (y1 == y2)) - { - return true; - } - return false; - } - /// - /// 获得点到线的垂线距离及垂点 - /// - /// - /// - /// - /// - private void comparePointLine(GSOPoint3d point, GSOGeoPolyline3D line, out double length, out GSOPoint3d pointChuiDian) - { - GSOPoint3d lineStartPoint = line[0][0]; - GSOPoint3d lineEndPoint = line[0][1]; - GSOGeoPolyline3D lineAB = new GSOGeoPolyline3D(); - GSOPoint3ds pointsAB = new GSOPoint3ds(); - pointsAB.Add(point); - pointsAB.Add(lineStartPoint); - lineAB.AddPart(pointsAB); - double lengthAB = lineAB.GetSpaceLength(false, 6378137.0); - double xieLvAB = getXieLu("", point.X, point.Y, lineStartPoint.X, lineStartPoint.Y); - double xieLvBC = getXieLu("", lineStartPoint.X, lineStartPoint.Y, lineEndPoint.X, lineEndPoint.Y); - - double tanABC = Math.Abs(xieLvAB - xieLvBC) / (1 + xieLvAB * xieLvBC); - double angle = Math.Atan(tanABC); - //if (angle > Math.PI / 2) //落在外边 - //{ - // length = 0; - //} - double lengthAD = lengthAB * Math.Sin(angle); - length = Math.Abs(lengthAD); - double lengthBD = lengthAB * Math.Cos(angle); - - GSOPoint2d point2dStart = Latlon_2_XYZ(lineStartPoint.X, lineStartPoint.Y); - double bBC = point2dStart.Y - xieLvBC * point2dStart.X; - GSOPoint2d point2dEnd = new GSOPoint2d(); - point2dEnd.X = point2dStart.X + 100; - point2dEnd.Y = point2dEnd.X * xieLvBC + bBC; - point2dEnd = XYZ_2_Latlon(point2dEnd.X, point2dEnd.Y); - - GSOPoint3d pointEnd = new GSOPoint3d(); - pointEnd.X = point2dEnd.X; - pointEnd.Y = point2dEnd.Y; - GSOGeoPolyline3D lineYanShen = new GSOGeoPolyline3D(); - GSOPoint3ds pointsYanShen = new GSOPoint3ds(); - pointsYanShen.Add(lineStartPoint); - pointsYanShen.Add(pointEnd); - lineYanShen.AddPart(pointsYanShen); - GSOGeoPolyline3D lineSegment = lineYanShen.GetSegment(0, lengthBD); - pointChuiDian = lineSegment[0][1]; - } + + /// /// 获得斜率 /// @@ -8044,255 +6742,6 @@ } /// - /// 获取与点相连的所有线以及线的点的集合 - /// - /// 选定的点所在的线 - /// 选定的点 - /// 面中不完全包含的除起点线之外所有的线 - /// 选定的点所在的点的集合 - /// 所有以选定线为起点的点的集合 - /// - private List getFeaturesPoints(GSOFeature featureSelect, GSOPoint3d lineStart, GSOFeatures selectFeatures, GSOPoint3ds ps, List listPS) - { - GSOFeatures fsStart = new GSOFeatures(); - for (int n = 0; n < selectFeatures.Length; n++) - { - if (featureSelect.ID == selectFeatures[n].ID) - { - continue; - } - GSOGeoPolyline3D newLine = selectFeatures[n].Geometry as GSOGeoPolyline3D; - if (newLine != null && newLine.PartCount > 0) - { - GSOPoint3d newLineStart = newLine[0][0]; - GSOPoint3d newLineEnd = newLine[0][newLine[0].Count - 1]; - if (lineStart.X == newLineEnd.X && lineStart.Y == newLineEnd.Y) - { - GSOPoint3ds psAdd = new GSOPoint3ds(); - for (int k = newLine[0].Count - 1; k >= 0; k--) - { - psAdd.Add(newLine[0][k]); - } - newLine[0] = psAdd; - fsStart.Add(selectFeatures[n]); - - } - else if (lineStart.X == newLineStart.X && lineStart.Y == newLineStart.Y) - { - fsStart.Add(selectFeatures[n]); - - } - } - } - if (fsStart.Length > 0) - { - for (int m = 0; m < fsStart.Length; m++) - { - GSOGeoPolyline3D lineFsStart = fsStart[m].Geometry as GSOGeoPolyline3D; - if (lineFsStart != null && lineFsStart.PartCount > 0) - { - GSOPoint3ds psAdd = ps.Clone(); - for (int k = 0; k < lineFsStart[0].Count; k++) - { - psAdd.Add(lineFsStart[0][k]); - } - listPS = getFeaturesPoints(fsStart[m], lineFsStart[0][lineFsStart[0].Count - 1], selectFeatures, psAdd, listPS); - } - } - } - else - { - listPS.Add(ps); - } - return listPS; - } - - /// - /// 获取切割面的线 - /// - /// 不完全包含在面中的所有线 - /// 完全包含在面中的所有线 - /// 线 - private GSOFeature getLineFromGSOFeatures(GSOFeatures features, GSOFeatures featuresTrue) - { - //1. 当线对象数组的长度为0时,返回空 - if (features.Length == 0) - { - return null; - } - //2. 当线对象数组的长度为1时,返回这条线 - if (features.Length == 1) - { - return features[0]; - } - //3. 当线对象数组的长度大于1时,计算所有线组成的最长线 - - //3.1 获取所有不完全包含在面中的对象selectFeatures - GSOFeatures selectFeatures = new GSOFeatures(); - for (int a = 0; a < features.Length; a++) - { - selectFeatures.Add(features[a].Clone()); - } - //3.2 删除features中完全包含在面中的线,获取和面的边界相交的线对象 - for (int a = 0; a < featuresTrue.Length; a++) - { - for (int b = 0; b < features.Length; b++) - { - if (featuresTrue[a].ID == features[b].ID) - { - features.Remove(b); - break; - } - } - } - //3.3 如果和面的边界相交的线的数量为0,返回空 - if (features.Length == 0) - { - return null; - } - //3.4 获取第一条和面的边界相交的线featureInOutPolygon - GSOFeature featureInOutPolygon = features[0]; - //3.5 从所有的线中删除featureInOutPolygon - for (int a = 0; a < selectFeatures.Length; a++) - { - if (selectFeatures[a].ID == featureInOutPolygon.ID) - { - selectFeatures.Remove(a); - break; - } - } - //listPS存储所有从featureInOutPolygon出发的点的集合 - List listPS = new List(); - //3.5 获取与featureInOutPolygon相连的线的集合 - GSOGeoPolyline3D line = featureInOutPolygon.Geometry as GSOGeoPolyline3D; - if (line != null && line.PartCount > 0) - { - GSOPoint3d lineStart = line[0][0]; - GSOPoint3d lineEnd = line[0][line[0].Count - 1]; - #region//获取和featureInOutPolygon的起点相连的线 - GSOFeatures fsStart = new GSOFeatures(); - for (int n = 0; n < selectFeatures.Length; n++) - { - GSOGeoPolyline3D newLine = selectFeatures[n].Geometry as GSOGeoPolyline3D; - if (newLine != null && newLine.PartCount > 0) - { - GSOPoint3d newLineStart = newLine[0][0]; - GSOPoint3d newLineEnd = newLine[0][newLine[0].Count - 1]; - if (lineStart.X == newLineEnd.X && lineStart.Y == newLineEnd.Y) - { - GSOPoint3ds psAdd = new GSOPoint3ds(); - for (int k = newLine[0].Count - 1; k >= 0; k--) - { - psAdd.Add(newLine[0][k]); - } - newLine[0] = psAdd; - fsStart.Add(selectFeatures[n]); - - } - else if (lineStart.X == newLineStart.X && lineStart.Y == newLineStart.Y) - { - fsStart.Add(selectFeatures[n]); - } - } - } - #endregion - - #region//获取和featureInOutPolygon的终点相连的线 - GSOFeatures fsEnd = new GSOFeatures(); - for (int n = 0; n < selectFeatures.Length; n++) - { - GSOGeoPolyline3D newLine = selectFeatures[n].Geometry as GSOGeoPolyline3D; - if (newLine != null && newLine.PartCount > 0) - { - GSOPoint3d newLineStart = newLine[0][0]; - GSOPoint3d newLineEnd = newLine[0][newLine[0].Count - 1]; - if (lineEnd.X == newLineStart.X && lineEnd.Y == newLineStart.Y) - { - fsEnd.Add(selectFeatures[n]); - - } - else if (lineEnd.X == newLineEnd.X && lineEnd.Y == newLineEnd.Y) - { - GSOPoint3ds psAdd = new GSOPoint3ds(); - for (int k = newLine[0].Count - 1; k >= 0; k--) - { - psAdd.Add(newLine[0][k]); - } - newLine[0] = psAdd; - fsEnd.Add(selectFeatures[n]); - - } - } - } - #endregion - - //3.6 将featureInOutPolygon的所有点和与之起点相连的线的所有点组成一个点的集合并添加到listPS中 - if (fsStart.Length > 0 && fsEnd.Length == 0) - { - for (int m = 0; m < fsStart.Length; m++) - { - GSOGeoPolyline3D lineFsStart = fsStart[m].Geometry as GSOGeoPolyline3D; - if (lineFsStart != null && lineFsStart.PartCount > 0) - { - GSOPoint3ds psAdd = new GSOPoint3ds(); - for (int k = line[0].Count - 1; k >= 0; k--) - { - psAdd.Add(line[0][k]); - } - for (int k = 0; k < lineFsStart[0].Count; k++) - { - psAdd.Add(lineFsStart[0][k]); - } - - listPS = getFeaturesPoints(fsStart[m], lineFsStart[0][lineFsStart[0].Count - 1], selectFeatures, psAdd, listPS); - - } - } - } - //3.6 将featureInOutPolygon的所有点和与之终点相连的线的所有点组成一个点的集合并添加到listPS中 - else if (fsStart.Length == 0 && fsEnd.Length > 0) - { - for (int n = 0; n < fsEnd.Length; n++) - { - GSOGeoPolyline3D lineFsEnd = fsEnd[n].Geometry as GSOGeoPolyline3D; - if (lineFsEnd != null && lineFsEnd.PartCount > 0) - { - GSOPoint3ds psAdd = new GSOPoint3ds(); - for (int k = 0; k < line[0].Count - 1; k++) - { - psAdd.Add(line[0][k]); - } - for (int k = 0; k < lineFsEnd[0].Count; k++) - { - psAdd.Add(lineFsEnd[0][k]); - } - //获取线fsEnd[n]的另一个端点相连的线并记录该线的点的集合 - listPS = getFeaturesPoints(fsEnd[n], lineFsEnd[0][lineFsEnd[0].Count - 1], selectFeatures, psAdd, listPS); - } - } - } - } - - //3.7 获取所有以featureInOutPolygon为起点的点的集合组成的线中的最长的线 - double maxLength = 0; - GSOFeature featureNew = new GSOFeature(); - for (int h = 0; h < listPS.Count; h++) - { - GSOGeoPolyline3D lineNew = new GSOGeoPolyline3D(); - lineNew.AddPart(listPS[h]); - GSOLabel label = new GSOLabel(); - label.Text = h.ToString(); - featureNew.Label = label; - double length = lineNew.GetSpaceLength(true, 6378137); - if (length > maxLength) - { - featureNew.Geometry = lineNew; - } - } - - return featureNew; - } - /// /// 更新最大最小状态 /// /// @@ -8340,219 +6789,6 @@ - private void buttonItem139_Click(object sender, EventArgs e) - { - - string filepath = ""; - //日志记录 - OpenFileDialog dlg = new OpenFileDialog(); - dlg.Filter = "矢量数据(*.shp)|*.shp|矢量数据(*.lgd)|*.lgd|全部支持格式(*.lgd,*.shp)|*.lgd;*.shp;"; - //dlg.Filter = "支持格式(*.lrp,*.tif,*.img,*.lrc,*.kml,*.lgd,*.shp,*.gft)|*.lrp;*.tif;*.img;*.lrc;*.kml;*.lgd;*.shp;*.gft|栅格数据(*.lrp)|*.lrp|栅格缓存(*.lrc)|*.lrc|KML数据(*.kml)|*.kml|矢量数据(*.lgd)|*.lgd|矢量缓存(*.gft)|*.gft|其它格式(*.*)|*.*||"; - dlg.Multiselect = true; - if (dlg.ShowDialog() == DialogResult.OK) - { - //自定义lprj文件名,从程序中复制一lprj文件。 - int bindex = dlg.FileName.Split('\\').Length; - string lastname = dlg.FileName.Split('\\')[bindex - 1]; - - for (int i = 0; i < dlg.FileNames.Length; i++) - { - string strDataPath = dlg.FileNames[i]; - filepath = strDataPath; - - GSOLayer layer = globeControl1.Globe.Layers.Add(strDataPath); - - } - - } - //放大到红线 - - - // globeControl1.Globe.Layers.MoveTo(0, globeControl1.Globe.Layers.Count - 1); - // globeControl1.Globe.Layers.MoveTo(0,4); - globeControl1.Refresh(); - - - } - /// - /// - /// - /// - /// - private void buttonItem142_Click(object sender, EventArgs e) - { - //获得红线polygon - //GSOLayer layerSevenLine = globeControl1.Globe.Layers.GetLayerByCaption(redlinelayername); - - GSOLayer layerSevenLine = globeControl1.Globe.Layers.Add("D:\\data\\歌林小镇shp\\test.shp"); - //获得红线结果列表 - ArrayList rrLists = new ArrayList(); - - //if (redlinelayername != "") - { - GSOFeatures fs = layerSevenLine.GetAllFeatures(); - int len = fs.Length; - - GSOGeoPolygon3D sevenPolygon = new GSOGeoPolygon3D(); - for (int k = 0; k < len; k++) - {//多根红线 - ///////生成红线区域/////// - GSOFeature featSevenLine = layerSevenLine.GetAt(k); - GSOGeoPolyline3D sevenLine = featSevenLine.Geometry as GSOGeoPolyline3D; - - List sevenParts = new List(); - for (int i = 0; i < sevenLine.PartCount; i++) - { - sevenParts.Add(sevenLine[i]); - } - for (int i = 0; i < sevenParts.Count; i++) - { - sevenPolygon.AddPart((GSOPoint3ds)sevenParts[i]); - } - /////拼出红线多边形over////// - - } - //GSOLayer layer = globeControl1.Globe.Layers.GetLayerByCaption("天然气管线"); - - GSOLayer layer = globeControl1.Globe.Layers.Add("C:\\Users\\nn-203\\Desktop\\xiaobai\\test.lgd"); - //线切割面定义,输出用 - GSOFeatures resFeats = new GSOFeatures(); - int resultstyle = 0; - //管线切割红线区域后,面积较小的区域 - GSOGeoPolygon3D restPoly = new GSOGeoPolygon3D(); - List inpts = new List(); - if (layer != null) - { - //红线区域 - GSOFeature sevenfeature = new GSOFeature(); - sevenfeature.Geometry = sevenPolygon; - - //获取不完全包含在面中的所有线 - GSOFeatures feats = layer.FindFeaturesInPolygon(sevenPolygon, false); - //获取完全包含在面中的所有线 - GSOFeatures featsTrue = layer.FindFeaturesInPolygon(sevenPolygon, true); - //获取面中所有对象组成的切割面的长线 - GSOFeature feature = new GSOFeature(); - - feature = getLineFromGSOFeatures(feats, featsTrue);//管线多个feature拼成一个feature - - //globeControl1.Globe.MemoryLayer.AddFeature(feature); - //globeControl1.Globe.MemoryLayer.AddFeature(sevenfeature); - if (feature != null) - { - //线切割面,输出 - //feature.HighLight = true; - GSODataEngineUtility.GSLineClipPolygon(feature, sevenfeature, out resFeats, out resultstyle); - } - else - { - MessageBox.Show("没有找到切割面的线对象!"); - } - ////////////////绘制分割后的多边形/////////////// - for (int a = 0; a < resFeats.Length; a++) - { - - GSOFeature gf = resFeats[1]; - globeControl1.Globe.MemoryLayer.AddFeature(gf); - - } - } - - - } - } - - private void buttonItem143_Click(object sender, EventArgs e) - { - //获得红线polygon - GSOLayer layerSevenLine = globeControl1.Globe.Layers.Add("d:\\lineAndPolygon.lgd"); - GSOLayer layerSevenLine2 = globeControl1.Globe.Layers.GetLayerByCaption("d:\\lineAndPolygon.lgd"); - //获得红线结果列表 - ArrayList rrLists = new ArrayList(); - - - // if (redlinelayername != "") - { - GSOFeatures fs = layerSevenLine.GetAllFeatures(); - int len = fs.Length; - - GSOGeoPolyline3D linetest = new GSOGeoPolyline3D(); - GSOGeoPolygon3D sevenPolygon = new GSOGeoPolygon3D(); - - GSOFeature linefeat = fs.FindByID(2); - //linefeat.Geometry = linetest; - GSOFeature polyfeat = fs.FindByID(1); - //polyfeat.Geometry = sevenPolygon; - - //线切割面定义,输出用 - GSOFeatures resFeats = new GSOFeatures(); - int resultstyle = 0; - GSODataEngineUtility.GSLineClipPolygon(linefeat, polyfeat, out resFeats, out resultstyle); - - ////////////////绘制分割后的多边形/////////////// - for (int a = 0; a < resFeats.Length; a++) - { - - GSOFeature gf = resFeats[0]; - globeControl1.Globe.MemoryLayer.AddFeature(gf); - - } - ////把红线切成一段段的线段,获得切前的红线点集 - List redpts = new List();//切前的红线点集合 - for (int i = 0; i < linetest.PartCount; i++) - { - GSOPoint3ds partP = linetest[i]; - for (int j = 0; j < partP.Count; j++) - { - redpts.Add(partP[j]); - } - } - - List redpts2 = new List();//切前的红线点集合 - for (int i = 0; i < sevenPolygon.PartCount; i++) - { - GSOPoint3ds partP = sevenPolygon[i]; - for (int j = 0; j < partP.Count; j++) - { - redpts2.Add(partP[j]); - } - } - } - } - /// - /// 增加用户手册下载连接 - /// - /// - /// - Cyberpipe.udfiles.UpDownFile UDF = new udfiles.UpDownFile(Utility.udserviceurl); - string dir_Ok = "C:\\Users\\nn-203\\Desktop"; - private void button1_Click(object sender, EventArgs e) - { - if (folderBrowserDialog1.ShowDialog() == DialogResult.OK) //打洙?开a文?件t夹D对?话°框ò - { - dir_Ok = folderBrowserDialog1.SelectedPath; //显?示?选?择?的?文?件t夹D路·径? - - //tempstr = folderBrowserDialog1.SelectedPath; //存?储洹?选?择?的?文?件t夹D路·径? - - } - - Cyberpipe.PED_logicfile.PED_Affair.Redact_D = Utility.uploadpath + "\\SFiles\\UserHbook\\说明.docx"; - if (File.Exists(dir_Ok + "\\" + Files_Name(Cyberpipe.PED_logicfile.PED_Affair.Redact_D, 1))) - { - if (MessageBox.Show("文件夹下有同名文件,是否替换?", "提示", MessageBoxButtons.YesNo, MessageBoxIcon.Information) == DialogResult.No) ; - - } - byte[] file = UDF.Down(Cyberpipe.PED_logicfile.PED_Affair.Redact_D); - FileStream pFileSream = new FileStream(dir_Ok + "\\说明.docx", FileMode.OpenOrCreate); - pFileSream.Write(file, 0, file.Length); - pFileSream.Close(); - if (File.Exists(dir_Ok + "\\" + Files_Name(Cyberpipe.PED_logicfile.PED_Affair.Redact_D, 1)) == true) - { - MessageBox.Show("文件导出成功!"); - } - //PEDAClass.Folder_Handle(dir_Ok + "\\" + PEDAClass.Files_Name(Cyberpipe.PED_logicfile.PED_Affair.Redact_D, 0), Cyberpipe.PED_logicfile.PED_Affair.Redact_D, "", 0); - - } /// /// 获取文件或文件夹的名称 /// @@ -8575,33 +6811,6 @@ return DF_Name; } - private void toolStripDropDownButton1_Click(object sender, EventArgs e) - { - if (folderBrowserDialog1.ShowDialog() == DialogResult.OK) //打洙?开a文?件t夹D对?话°框ò - { - dir_Ok = folderBrowserDialog1.SelectedPath; //显?示?选?择?的?文?件t夹D路·径? - - //tempstr = folderBrowserDialog1.SelectedPath; //存?储洹?选?择?的?文?件t夹D路·径? - - - Cyberpipe.PED_logicfile.PED_Affair.Redact_D = Utility.uploadpath + "\\SFiles\\UserHbook\\说明.docx"; - if (File.Exists(dir_Ok + "\\" + Files_Name(Cyberpipe.PED_logicfile.PED_Affair.Redact_D, 1))) - { - if (MessageBox.Show("文件夹下有同名文件,是否替换?", "提示", MessageBoxButtons.YesNo, MessageBoxIcon.Information) == DialogResult.No) ; - - } - byte[] file = UDF.Down(Cyberpipe.PED_logicfile.PED_Affair.Redact_D); - FileStream pFileSream = new FileStream(dir_Ok + "\\说明.docx", FileMode.OpenOrCreate); - pFileSream.Write(file, 0, file.Length); - pFileSream.Close(); - if (File.Exists(dir_Ok + "\\" + Files_Name(Cyberpipe.PED_logicfile.PED_Affair.Redact_D, 1)) == true) - { - MessageBox.Show("文件导出成功!"); - } - - } - } - /// /// 空间查询 /// @@ -9792,7 +8001,7 @@ GSOLayer resLayer = null; GSOFeature resFeature = null; globeControl1.Globe.GetSelectObject(0, out resFeature, out resLayer); - + if (resFeature == null) return; GSOGeoPolyline3D line1 = resFeature.Geometry as GSOGeoPolyline3D; if (line1 == null) { @@ -9876,7 +8085,7 @@ GSOLayer resLayer = null; GSOFeature resFeature = null; globeControl1.Globe.GetSelectObject(0, out resFeature, out resLayer); - + if (resFeature == null) return; GSOGeoPolyline3D line1 = resFeature.Geometry as GSOGeoPolyline3D; if (line1 == null) { @@ -9891,7 +8100,8 @@ } GSOFeatures feats = globeControl1.Globe.MemoryLayer.GetFeatureByName("粒子要素", true); - if (feats.Length > 0) + + if (feats!=null&&feats.Length > 0) globeControl1.Globe.MemoryLayer.RemoveFeatureByID(feats[0].ID); //if (emitterFeature != null) //{ @@ -11121,88 +9331,6 @@ } private int connectServerCount = 0; - - /// - /// 还原球到实测库 - /// - private void refreshGlobe1() - { - //添加实测库图层已有图层 - int servernum = 0; - //1.清除global1上 - for (int i = globeControl1.Globe.Layers.Count - 1; i >= 0; i--) - { - GSOLayer layer = globeControl1.Globe.Layers[i]; - if (!layer.Name.Contains("fttp:")) - { - layer.Dataset.Close();//清除内存 - globeControl1.Globe.Layers.Remove(layer); - } - else - { - servernum++; - } - } - - //globeControl1.Globe.ConnectServer(Utility.serverip, Utility.serverport, "", ""); //加载locaServer中的数据 - - //2.添加实测库图层 - string[] markerStrs = new string[9]; - markerStrs[0] = "标高标注"; - markerStrs[1] = "管径标注"; - markerStrs[2] = "埋深标注"; - markerStrs[3] = "坐标标注"; - markerStrs[4] = "坡度标注"; - markerStrs[5] = "属性标注"; - markerStrs[6] = "自定义标注"; - markerStrs[7] = "距离标注"; - markerStrs[8] = "扯旗标注"; - for (int i = 0; i < markerStrs.Length; i++) - { - if (File.Exists(Application.StartupPath + "\\标注管理\\" + markerStrs[i] + ".lgd")) - { - GSOLayer markerLayer = globeControl1.Globe.Layers.Add(Application.StartupPath + "\\标注管理\\" + markerStrs[i] + ".lgd"); - } - } - - for (int i = 0; i < g1layername.Count; i++) - { - string g1name = g1layername[i]; - GSODataset datasetg1 = Utility.dataSource.GetDatasetByName(g1name); - GSOLayer templayer = globeControl1.Globe.Layers.Add(datasetg1); - templayer.MaxVisibleAltitude = -1; - } - layerTemp = globeControl1.Globe.Layers.Add(Application.StartupPath + "\\tempLgdData.lgd"); - globeControl1.Globe.Layers.Add(Application.StartupPath + "/城市七线/城市红线.lgd"); - globeControl1.Globe.Layers.Add(Application.StartupPath + "/城市七线/城市橙线.lgd"); - globeControl1.Globe.Layers.Add(Application.StartupPath + "/城市七线/城市黄线.lgd"); - globeControl1.Globe.Layers.Add(Application.StartupPath + "/城市七线/城市绿线.lgd"); - globeControl1.Globe.Layers.Add(Application.StartupPath + "/城市七线/城市蓝线.lgd"); - globeControl1.Globe.Layers.Add(Application.StartupPath + "/城市七线/城市紫线.lgd"); - globeControl1.Globe.Layers.Add(Application.StartupPath + "/城市七线/城市黑线.lgd"); - globeControl1.Globe.Layers.Add(Application.StartupPath + "/隧道.lgd"); - - //移动server的数据图层 - for (int i = 0; i < servernum; i++) - { - globeControl1.Globe.Layers.MoveTo(globeControl1.Globe.Layers.Count - 1, 0); - } - - if (layerManagerNode.Nodes.Count > 0) - { - for (int i = layerManagerNode.Nodes.Count - 1; i >= 0; i--) - { - layerManagerNode.Nodes[i].Remove(); - - } - } - - - - globeControl1.Refresh(); - - } - /// /// 碰撞审查 /// @@ -11476,31 +9604,7 @@ // } //} #endregion - /// - /// 数据质量检查 - /// - /// - /// - private void buttonItemSJGL2_Click(object sender, EventArgs e) - { - //日志记录 - LogManager.saveLog(Utility.userName, this.buttonItemSJGL2.Text); - FrmValiData frm = new FrmValiData(globeControl1); - frm.ShowDialog(); - } - /// - /// 数据预处理 - /// - /// - /// - private void buttonItemSJGL3_Click(object sender, EventArgs e) - { - //保存日志 - LogManager.saveLog(Utility.userName, this.buttonItemSJGL3.Text); - FrmEditShapeFile frm = new FrmEditShapeFile(globeControl1); - frm.ShowDialog(this); - } /// /// 连接数据库 /// @@ -12251,60 +10355,6 @@ List lineStruct = new List(); GSOFeature featureSelected = null; - private void AddDatagridView(DataTable table) - { - - if (table != null && table.Rows.Count > 0) - { - dataGridViewX1.DataSource = table; - panelOfTable.Visible = true; - panelOfTable.Height = 200; - toolStripNumbers.Text = "红线审核结果"; - toolStripFeatureLength.Text = " 共有:" + table.Rows.Count + "条"; - } - else - { - - } - - } - - /// - /// 去除集合中重复的管线 - /// - /// - /// - /// - private GSOFeatures getFeaturesByFilter(GSOFeatures features, string fieldName) - { - if (features == null) - { - return null; - } - GSOFeatures featuresGet = new GSOFeatures(); - for (int i = 0; i < features.Length; i++) - { - GSOFeature featureFromFS = features[i]; - string fieldValueFromFS = featureFromFS.GetValue(fieldName).ToString().Trim(); - bool isHas = false; - for (int j = featuresGet.Length - 1; j >= 0; j--) - { - GSOFeature featureFromFSGet = featuresGet[j]; - string fieldValueFromFSGet = featureFromFSGet.GetValue(fieldName).ToString().Trim(); - if (fieldValueFromFS.Equals(fieldValueFromFSGet)) - { - isHas = true; - break; - } - } - if (isHas == false) - { - featuresGet.Add(featureFromFS.Clone()); - } - } - return featuresGet; - } - /// /// 数据管理导入文件 /// @@ -12440,138 +10490,7 @@ // //MessageBox.Show("系统运行错误:" + ex.ToString(), "错误", MessageBoxButtons.OK, MessageBoxIcon.Error); // } //} - - - /// - /// 标识器全区域统计 - /// - /// - /// - private void 标识器分类统计ToolStripMenuItem_Click(object sender, EventArgs e) - { - globeControl1.Globe.Action = EnumAction3D.ActionNull; - FrmBSQStatis bsqStatis = new FrmBSQStatis(); - bsqStatis.Show(this); - } - /// - /// 标识器绘制区域统计 - /// - /// - /// - private void 标识器分类统计ToolStripMenuItem1_Click(object sender, EventArgs e) - { - trackflag = "BSQDuoBianXiangStatis"; - globeControl1.Globe.Action = EnumAction3D.TrackPolygon; - } - - - #region 保存和加载审核库加载的图层 - private void saveLayerList(TreeNodeCollection treeNodeList) - { - string configPath = Application.StartupPath + "\\configLayerList.xml"; - try - { - XmlDocument doc = new XmlDocument(); - doc.Load(configPath); - XmlNode dbParams = doc.SelectSingleNode("Params/dbparams"); - XmlNode dbLayers = doc.SelectSingleNode("Params/dblayers"); - XmlNode layers = doc.SelectSingleNode("Params/layers"); - dbParams.RemoveAll(); - dbLayers.RemoveAll(); - layers.RemoveAll(); - - List listDS = new List(); - String shDatasourceName = Utility.sgdbip + "/" + Utility.sgdbname + "_" + Utility.sgdbuser; - bool flag = false; - - for (int i = 0; i < globeControl1.Globe.DataManager.DataSourceCount; i++) - { - GSODataSource ds = globeControl1.Globe.DataManager.GetDataSourceAt(i); - if (ds != null && ds.Type == EnumDataSourceType.SqlServer || ds.Type == EnumDataSourceType.Oracle) - { - if (ds.Name == shDatasourceName) - { - //防止因为多次连接同一个数据库 - if (flag == true) - { - break; - } - flag = true; - listDS.Add(ds); - GSODataSourceCnn conn = ds.GetConnectionInfo(); - - XmlElement dbparam = doc.CreateElement("shdbparam"); - XmlElement ip = doc.CreateElement("ship"); - ip.InnerText = conn.Server; - - XmlElement dbname = doc.CreateElement("shdbname"); - dbname.InnerText = conn.Database; - - XmlElement username = doc.CreateElement("shusername"); - username.InnerText = conn.User; - - XmlElement password = doc.CreateElement("shpassword"); - password.InnerText = conn.Password; - - XmlElement type = doc.CreateElement("shtype"); - if (ds.Type == EnumDataSourceType.SqlServer) - { - type.InnerText = "sqlserver"; - } - else - { - type.InnerText = "oracle"; - } - - dbparam.AppendChild(ip); - dbparam.AppendChild(dbname); - dbparam.AppendChild(username); - dbparam.AppendChild(password); - dbparam.AppendChild(type); - dbParams.AppendChild(dbparam); - } - - } - } - - for (int i = 0; i < treeNodeList.Count; i++) - { - GSOLayer layer = treeNodeList[i].Tag as GSOLayer; - if (Path.GetExtension(layer.Name) == "") - { - XmlElement dbLayer = doc.CreateElement("dblayer"); - XmlAttribute attri = doc.CreateAttribute("dbindex"); - for (int j = 0; j < listDS.Count; j++) - { - if (layer.Dataset.DataSource.Name == listDS[j].Name) - { - attri.Value = j.ToString(); - break; - } - } - dbLayer.Attributes.Append(attri); - dbLayer.InnerText = layer.Name; - - dbLayers.AppendChild(dbLayer); - } - else - { - XmlElement dbLayer = doc.CreateElement("layer"); - dbLayer.InnerText = layer.Name; - layers.AppendChild(dbLayer); - } - } - - doc.Save(configPath); - } - catch (Exception e) - { - - } - } - - #endregion - + private void buttonItem_TaskManager_Click(object sender, EventArgs e) { if (Form_TaksManager.IS_OPEN) diff --git a/MainFrm.designer.cs b/MainFrm.designer.cs index 233ef8c..97b8299 100644 --- a/MainFrm.designer.cs +++ b/MainFrm.designer.cs @@ -82,6 +82,7 @@ this.sideBar1 = new DevComponents.DotNetBar.SideBar(); this.panelEx3 = new DevComponents.DotNetBar.PanelEx(); this.layerSensorTree = new System.Windows.Forms.TreeView(); + this.layerTree = new Cyberpipe.MyTreeView(); this.sideBarPanelItem3 = new DevComponents.DotNetBar.SideBarPanelItem(); this.controlContainerItem3 = new DevComponents.DotNetBar.ControlContainerItem(); this.sideBarPanelItem4 = new DevComponents.DotNetBar.SideBarPanelItem(); @@ -365,30 +366,26 @@ this.可编辑ToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); this.保存ToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); this.ribbonControl1 = new DevComponents.DotNetBar.RibbonControl(); - this.ribbonPanel1 = new DevComponents.DotNetBar.RibbonPanel(); - this.ribbonBar21 = new DevComponents.DotNetBar.RibbonBar(); - this.buttonItem87 = new DevComponents.DotNetBar.ButtonItem(); - this.buttonItem88 = new DevComponents.DotNetBar.ButtonItem(); - this.buttonItem27 = new DevComponents.DotNetBar.ButtonItem(); - this.buttonItem91 = new DevComponents.DotNetBar.ButtonItem(); - this.buttonItem1 = new DevComponents.DotNetBar.ButtonItem(); - this.btnlegendSet = new DevComponents.DotNetBar.ButtonItem(); - this.buttonItem89 = new DevComponents.DotNetBar.ButtonItem(); - this.ribbonPanel7 = new DevComponents.DotNetBar.RibbonPanel(); - this.ribbonBar5 = new DevComponents.DotNetBar.RibbonBar(); - this.btn_flag = new DevComponents.DotNetBar.ButtonItem(); - this.slider4ground = new DevComponents.DotNetBar.SliderItem(); - this.ribbonPanel2 = new DevComponents.DotNetBar.RibbonPanel(); - this.ribbonBar4 = new DevComponents.DotNetBar.RibbonBar(); - this.buttonItem_TaskManager = new DevComponents.DotNetBar.ButtonItem(); - this.buttonItem_OnlineTask = new DevComponents.DotNetBar.ButtonItem(); - this.buttonItem_Event = new DevComponents.DotNetBar.ButtonItem(); this.ribbonPanel3 = new DevComponents.DotNetBar.RibbonPanel(); this.ribbonBar3 = new DevComponents.DotNetBar.RibbonBar(); this.btn_device = new DevComponents.DotNetBar.ButtonItem(); this.btn_Person = new DevComponents.DotNetBar.ButtonItem(); this.btn_constructMap = new DevComponents.DotNetBar.ButtonItem(); this.buttonItem9 = new DevComponents.DotNetBar.ButtonItem(); + this.ribbonPanel2 = new DevComponents.DotNetBar.RibbonPanel(); + this.ribbonBar4 = new DevComponents.DotNetBar.RibbonBar(); + this.buttonItem_TaskManager = new DevComponents.DotNetBar.ButtonItem(); + this.buttonItem_OnlineTask = new DevComponents.DotNetBar.ButtonItem(); + this.buttonItem_Event = new DevComponents.DotNetBar.ButtonItem(); + this.ribbonPanel1 = new DevComponents.DotNetBar.RibbonPanel(); + this.ribbonBar21 = new DevComponents.DotNetBar.RibbonBar(); + this.buttonItem87 = new DevComponents.DotNetBar.ButtonItem(); + this.buttonItem88 = new DevComponents.DotNetBar.ButtonItem(); + this.buttonItem27 = new DevComponents.DotNetBar.ButtonItem(); + this.buttonItem1 = new DevComponents.DotNetBar.ButtonItem(); + this.buttonItem91 = new DevComponents.DotNetBar.ButtonItem(); + this.btnlegendSet = new DevComponents.DotNetBar.ButtonItem(); + this.buttonItem89 = new DevComponents.DotNetBar.ButtonItem(); this.ribbonPanel8 = new DevComponents.DotNetBar.RibbonPanel(); this.ribbonBar_UserInfo = new DevComponents.DotNetBar.RibbonBar(); this.btn_user_info = new DevComponents.DotNetBar.ButtonItem(); @@ -398,6 +395,10 @@ this.btn_user_role = new DevComponents.DotNetBar.ButtonItem(); this.btn_password_edit = new DevComponents.DotNetBar.ButtonItem(); this.btn_reset_password = new DevComponents.DotNetBar.ButtonItem(); + this.ribbonPanel7 = new DevComponents.DotNetBar.RibbonPanel(); + this.ribbonBar5 = new DevComponents.DotNetBar.RibbonBar(); + this.btn_flag = new DevComponents.DotNetBar.ButtonItem(); + this.slider4ground = new DevComponents.DotNetBar.SliderItem(); this.ribbonPanel15 = new DevComponents.DotNetBar.RibbonPanel(); this.ribbonBar20 = new DevComponents.DotNetBar.RibbonBar(); this.buttonItemSJGL = new DevComponents.DotNetBar.ButtonItem(); @@ -610,7 +611,6 @@ this.buttonItem84 = new DevComponents.DotNetBar.ButtonItem(); this.buttonItem75 = new DevComponents.DotNetBar.ButtonItem(); this.buttonItem76 = new DevComponents.DotNetBar.ButtonItem(); - this.layerTree = new Cyberpipe.MyTreeView(); this.statusStrip1.SuspendLayout(); this.sideBar1.SuspendLayout(); this.panelEx3.SuspendLayout(); @@ -647,11 +647,11 @@ this.contextMenuStrip3.SuspendLayout(); this.contextMenuStripDeleteLayerNode.SuspendLayout(); this.ribbonControl1.SuspendLayout(); - this.ribbonPanel1.SuspendLayout(); - this.ribbonPanel7.SuspendLayout(); - this.ribbonPanel2.SuspendLayout(); this.ribbonPanel3.SuspendLayout(); + this.ribbonPanel2.SuspendLayout(); + this.ribbonPanel1.SuspendLayout(); this.ribbonPanel8.SuspendLayout(); + this.ribbonPanel7.SuspendLayout(); this.ribbonPanel15.SuspendLayout(); ((System.ComponentModel.ISupportInitialize)(this.pictureBox1)).BeginInit(); this.SuspendLayout(); @@ -813,7 +813,6 @@ this.toolStripDropDownButton1.Size = new System.Drawing.Size(45, 21); this.toolStripDropDownButton1.Text = "帮助"; this.toolStripDropDownButton1.Visible = false; - this.toolStripDropDownButton1.Click += new System.EventHandler(this.toolStripDropDownButton1_Click); // // controlContainerItem1 // @@ -1047,6 +1046,16 @@ this.layerSensorTree.AfterCheck += new System.Windows.Forms.TreeViewEventHandler(this.layerMarkerTree_AfterCheck); this.layerSensorTree.NodeMouseClick += new System.Windows.Forms.TreeNodeMouseClickEventHandler(this.layerMarkerTree_NodeMouseClick); // + // layerTree + // + this.layerTree.CheckBoxes = true; + this.layerTree.ItemHeight = 18; + this.layerTree.Location = new System.Drawing.Point(30, 78); + this.layerTree.Name = "layerTree"; + this.layerTree.Size = new System.Drawing.Size(121, 97); + this.layerTree.TabIndex = 1; + this.layerTree.AfterCheck += new System.Windows.Forms.TreeViewEventHandler(this.layerTree_AfterCheck); + // // sideBarPanelItem3 // this.sideBarPanelItem3.FontBold = true; @@ -2966,28 +2975,28 @@ // 平移对象ToolStripMenuItem // this.平移对象ToolStripMenuItem.Name = "平移对象ToolStripMenuItem"; - this.平移对象ToolStripMenuItem.Size = new System.Drawing.Size(152, 22); + this.平移对象ToolStripMenuItem.Size = new System.Drawing.Size(124, 22); this.平移对象ToolStripMenuItem.Text = "平移对象"; this.平移对象ToolStripMenuItem.Click += new System.EventHandler(this.buttonItemBJ6_Click); // // 升降对象ToolStripMenuItem // this.升降对象ToolStripMenuItem.Name = "升降对象ToolStripMenuItem"; - this.升降对象ToolStripMenuItem.Size = new System.Drawing.Size(152, 22); + this.升降对象ToolStripMenuItem.Size = new System.Drawing.Size(124, 22); this.升降对象ToolStripMenuItem.Text = "升降对象"; this.升降对象ToolStripMenuItem.Click += new System.EventHandler(this.buttonItemBJ7_Click); // // 旋转对象ToolStripMenuItem // this.旋转对象ToolStripMenuItem.Name = "旋转对象ToolStripMenuItem"; - this.旋转对象ToolStripMenuItem.Size = new System.Drawing.Size(152, 22); + this.旋转对象ToolStripMenuItem.Size = new System.Drawing.Size(124, 22); this.旋转对象ToolStripMenuItem.Text = "旋转对象"; this.旋转对象ToolStripMenuItem.Click += new System.EventHandler(this.buttonItemBJ8_Click); // // 连接管段ToolStripMenuItem // this.连接管段ToolStripMenuItem.Name = "连接管段ToolStripMenuItem"; - this.连接管段ToolStripMenuItem.Size = new System.Drawing.Size(152, 22); + this.连接管段ToolStripMenuItem.Size = new System.Drawing.Size(124, 22); this.连接管段ToolStripMenuItem.Text = "连接管段"; this.连接管段ToolStripMenuItem.Click += new System.EventHandler(this.buttonItemBJ9_Click); // @@ -2997,34 +3006,34 @@ this.导出CADToolStripMenuItem, this.导出文件ToolStripMenuItem1}); this.导出文件ToolStripMenuItem.Name = "导出文件ToolStripMenuItem"; - this.导出文件ToolStripMenuItem.Size = new System.Drawing.Size(152, 22); + this.导出文件ToolStripMenuItem.Size = new System.Drawing.Size(124, 22); this.导出文件ToolStripMenuItem.Text = "导出矢量"; // // 导出CADToolStripMenuItem // this.导出CADToolStripMenuItem.Name = "导出CADToolStripMenuItem"; - this.导出CADToolStripMenuItem.Size = new System.Drawing.Size(152, 22); + this.导出CADToolStripMenuItem.Size = new System.Drawing.Size(125, 22); this.导出CADToolStripMenuItem.Text = "导出CAD"; this.导出CADToolStripMenuItem.Click += new System.EventHandler(this.buttonItemBJ10_1_Click); // // 导出文件ToolStripMenuItem1 // this.导出文件ToolStripMenuItem1.Name = "导出文件ToolStripMenuItem1"; - this.导出文件ToolStripMenuItem1.Size = new System.Drawing.Size(152, 22); + this.导出文件ToolStripMenuItem1.Size = new System.Drawing.Size(125, 22); this.导出文件ToolStripMenuItem1.Text = "导出文件"; this.导出文件ToolStripMenuItem1.Click += new System.EventHandler(this.buttonItemBJ10_2_Click); // // 前进ToolStripMenuItem // this.前进ToolStripMenuItem.Name = "前进ToolStripMenuItem"; - this.前进ToolStripMenuItem.Size = new System.Drawing.Size(152, 22); + this.前进ToolStripMenuItem.Size = new System.Drawing.Size(124, 22); this.前进ToolStripMenuItem.Text = "前进"; this.前进ToolStripMenuItem.Click += new System.EventHandler(this.buttonItemBJ12_Click); // // 删除模型ToolStripMenuItem // this.删除模型ToolStripMenuItem.Name = "删除模型ToolStripMenuItem"; - this.删除模型ToolStripMenuItem.Size = new System.Drawing.Size(152, 22); + this.删除模型ToolStripMenuItem.Size = new System.Drawing.Size(124, 22); this.删除模型ToolStripMenuItem.Text = "后退"; this.删除模型ToolStripMenuItem.Click += new System.EventHandler(this.buttonItemBJ11_Click); // @@ -4160,6 +4169,198 @@ this.ribbonControl1.Text = "ribbonControl1"; this.ribbonControl1.UseCustomizeDialog = false; // + // ribbonPanel3 + // + this.ribbonPanel3.ColorSchemeStyle = DevComponents.DotNetBar.eDotNetBarStyle.StyleManagerControlled; + this.ribbonPanel3.Controls.Add(this.ribbonBar3); + this.ribbonPanel3.Dock = System.Windows.Forms.DockStyle.Fill; + this.ribbonPanel3.Location = new System.Drawing.Point(0, 33); + this.ribbonPanel3.Name = "ribbonPanel3"; + this.ribbonPanel3.Padding = new System.Windows.Forms.Padding(3, 0, 3, 3); + this.ribbonPanel3.Size = new System.Drawing.Size(1328, 62); + // + // + // + this.ribbonPanel3.Style.Class = ""; + this.ribbonPanel3.Style.CornerType = DevComponents.DotNetBar.eCornerType.Square; + // + // + // + this.ribbonPanel3.StyleMouseDown.Class = ""; + this.ribbonPanel3.StyleMouseDown.CornerType = DevComponents.DotNetBar.eCornerType.Square; + // + // + // + this.ribbonPanel3.StyleMouseOver.Class = ""; + this.ribbonPanel3.StyleMouseOver.CornerType = DevComponents.DotNetBar.eCornerType.Square; + this.ribbonPanel3.TabIndex = 40; + // + // ribbonBar3 + // + this.ribbonBar3.AutoOverflowEnabled = true; + // + // + // + this.ribbonBar3.BackgroundMouseOverStyle.Class = ""; + this.ribbonBar3.BackgroundMouseOverStyle.CornerType = DevComponents.DotNetBar.eCornerType.Square; + // + // + // + this.ribbonBar3.BackgroundStyle.Class = ""; + this.ribbonBar3.BackgroundStyle.CornerType = DevComponents.DotNetBar.eCornerType.Square; + this.ribbonBar3.ContainerControlProcessDialogKey = true; + this.ribbonBar3.Dock = System.Windows.Forms.DockStyle.Left; + this.ribbonBar3.Items.AddRange(new DevComponents.DotNetBar.BaseItem[] { + this.btn_device, + this.btn_Person, + this.btn_constructMap, + this.buttonItem9}); + this.ribbonBar3.Location = new System.Drawing.Point(3, 0); + this.ribbonBar3.Name = "ribbonBar3"; + this.ribbonBar3.Size = new System.Drawing.Size(378, 59); + this.ribbonBar3.Style = DevComponents.DotNetBar.eDotNetBarStyle.StyleManagerControlled; + this.ribbonBar3.TabIndex = 0; + // + // + // + this.ribbonBar3.TitleStyle.Class = ""; + this.ribbonBar3.TitleStyle.CornerType = DevComponents.DotNetBar.eCornerType.Square; + // + // + // + this.ribbonBar3.TitleStyleMouseOver.Class = ""; + this.ribbonBar3.TitleStyleMouseOver.CornerType = DevComponents.DotNetBar.eCornerType.Square; + this.ribbonBar3.TitleVisible = false; + // + // btn_device + // + this.btn_device.ButtonStyle = DevComponents.DotNetBar.eButtonStyle.ImageAndText; + this.btn_device.Image = global::Cyberpipe.Properties.Resources._24X24__2__02; + this.btn_device.ImagePosition = DevComponents.DotNetBar.eImagePosition.Top; + this.btn_device.Name = "btn_device"; + this.btn_device.SubItemsExpandWidth = 14; + this.btn_device.Text = "探测仪管理"; + this.btn_device.Click += new System.EventHandler(this.btn_device_Click); + // + // btn_Person + // + this.btn_Person.ButtonStyle = DevComponents.DotNetBar.eButtonStyle.ImageAndText; + this.btn_Person.Image = global::Cyberpipe.Properties.Resources._24x24icon_05_hover1; + this.btn_Person.ImagePosition = DevComponents.DotNetBar.eImagePosition.Top; + this.btn_Person.Name = "btn_Person"; + this.btn_Person.SubItemsExpandWidth = 14; + this.btn_Person.Text = "定位人员维护"; + this.btn_Person.Click += new System.EventHandler(this.btn_Person_Click); + // + // btn_constructMap + // + this.btn_constructMap.Image = global::Cyberpipe.Properties.Resources._24x24icon_04_hover; + this.btn_constructMap.ImagePosition = DevComponents.DotNetBar.eImagePosition.Top; + this.btn_constructMap.Name = "btn_constructMap"; + this.btn_constructMap.SubItemsExpandWidth = 14; + this.btn_constructMap.Text = "导出施工图"; + this.btn_constructMap.Click += new System.EventHandler(this.btn_constructMap_Click); + // + // buttonItem9 + // + this.buttonItem9.Image = global::Cyberpipe.Properties.Resources._24x24icon__2__10; + this.buttonItem9.ImagePosition = DevComponents.DotNetBar.eImagePosition.Top; + this.buttonItem9.Name = "buttonItem9"; + this.buttonItem9.SubItemsExpandWidth = 14; + this.buttonItem9.Text = "文档管理"; + this.buttonItem9.Click += new System.EventHandler(this.buttonItem9_Click); + // + // ribbonPanel2 + // + this.ribbonPanel2.ColorSchemeStyle = DevComponents.DotNetBar.eDotNetBarStyle.StyleManagerControlled; + this.ribbonPanel2.Controls.Add(this.ribbonBar4); + this.ribbonPanel2.Dock = System.Windows.Forms.DockStyle.Fill; + this.ribbonPanel2.Location = new System.Drawing.Point(0, 0); + this.ribbonPanel2.Name = "ribbonPanel2"; + this.ribbonPanel2.Padding = new System.Windows.Forms.Padding(3, 0, 3, 3); + this.ribbonPanel2.Size = new System.Drawing.Size(1328, 95); + // + // + // + this.ribbonPanel2.Style.Class = ""; + this.ribbonPanel2.Style.CornerType = DevComponents.DotNetBar.eCornerType.Square; + // + // + // + this.ribbonPanel2.StyleMouseDown.Class = ""; + this.ribbonPanel2.StyleMouseDown.CornerType = DevComponents.DotNetBar.eCornerType.Square; + // + // + // + this.ribbonPanel2.StyleMouseOver.Class = ""; + this.ribbonPanel2.StyleMouseOver.CornerType = DevComponents.DotNetBar.eCornerType.Square; + this.ribbonPanel2.TabIndex = 39; + this.ribbonPanel2.Visible = false; + // + // ribbonBar4 + // + this.ribbonBar4.AutoOverflowEnabled = true; + // + // + // + this.ribbonBar4.BackgroundMouseOverStyle.Class = ""; + this.ribbonBar4.BackgroundMouseOverStyle.CornerType = DevComponents.DotNetBar.eCornerType.Square; + // + // + // + this.ribbonBar4.BackgroundStyle.Class = ""; + this.ribbonBar4.BackgroundStyle.CornerType = DevComponents.DotNetBar.eCornerType.Square; + this.ribbonBar4.ContainerControlProcessDialogKey = true; + this.ribbonBar4.Dock = System.Windows.Forms.DockStyle.Left; + this.ribbonBar4.Items.AddRange(new DevComponents.DotNetBar.BaseItem[] { + this.buttonItem_TaskManager, + this.buttonItem_OnlineTask, + this.buttonItem_Event}); + this.ribbonBar4.Location = new System.Drawing.Point(3, 0); + this.ribbonBar4.Name = "ribbonBar4"; + this.ribbonBar4.Size = new System.Drawing.Size(299, 92); + this.ribbonBar4.Style = DevComponents.DotNetBar.eDotNetBarStyle.StyleManagerControlled; + this.ribbonBar4.TabIndex = 0; + this.ribbonBar4.Text = "ribbonBar4"; + // + // + // + this.ribbonBar4.TitleStyle.Class = ""; + this.ribbonBar4.TitleStyle.CornerType = DevComponents.DotNetBar.eCornerType.Square; + // + // + // + this.ribbonBar4.TitleStyleMouseOver.Class = ""; + this.ribbonBar4.TitleStyleMouseOver.CornerType = DevComponents.DotNetBar.eCornerType.Square; + this.ribbonBar4.TitleVisible = false; + // + // buttonItem_TaskManager + // + this.buttonItem_TaskManager.Image = global::Cyberpipe.Properties.Resources._24x24icon__2__76; + this.buttonItem_TaskManager.ImagePosition = DevComponents.DotNetBar.eImagePosition.Top; + this.buttonItem_TaskManager.Name = "buttonItem_TaskManager"; + this.buttonItem_TaskManager.SubItemsExpandWidth = 14; + this.buttonItem_TaskManager.Text = "工单管理"; + this.buttonItem_TaskManager.Click += new System.EventHandler(this.buttonItem_TaskManager_Click); + // + // buttonItem_OnlineTask + // + this.buttonItem_OnlineTask.Image = global::Cyberpipe.Properties.Resources._24x24icon__2__69; + this.buttonItem_OnlineTask.ImagePosition = DevComponents.DotNetBar.eImagePosition.Top; + this.buttonItem_OnlineTask.Name = "buttonItem_OnlineTask"; + this.buttonItem_OnlineTask.SubItemsExpandWidth = 14; + this.buttonItem_OnlineTask.Text = "在线任务"; + this.buttonItem_OnlineTask.Click += new System.EventHandler(this.buttonItem_OnlineTask_Click); + // + // buttonItem_Event + // + this.buttonItem_Event.Image = global::Cyberpipe.Properties.Resources._24x24icon__2__72; + this.buttonItem_Event.ImagePosition = DevComponents.DotNetBar.eImagePosition.Top; + this.buttonItem_Event.Name = "buttonItem_Event"; + this.buttonItem_Event.SubItemsExpandWidth = 14; + this.buttonItem_Event.Text = "事件管理"; + this.buttonItem_Event.Click += new System.EventHandler(this.buttonItem_Event_Click); + // // ribbonPanel1 // this.ribbonPanel1.AutoSize = true; @@ -4262,6 +4463,15 @@ this.buttonItem27.Visible = false; this.buttonItem27.Click += new System.EventHandler(this.buttonItem27_Click); // + // buttonItem1 + // + this.buttonItem1.Image = global::Cyberpipe.Properties.Resources._24x24icon__2__94; + this.buttonItem1.ImagePosition = DevComponents.DotNetBar.eImagePosition.Top; + this.buttonItem1.Name = "buttonItem1"; + this.buttonItem1.SubItemsExpandWidth = 14; + this.buttonItem1.Text = "图层管理"; + this.buttonItem1.Click += new System.EventHandler(this.buttonItem1_Click); + // // buttonItem91 // this.buttonItem91.ForeColor = System.Drawing.Color.Black; @@ -4272,15 +4482,6 @@ this.buttonItem91.Text = "快速定位"; this.buttonItem91.Click += new System.EventHandler(this.buttonItem91_Click); // - // buttonItem1 - // - this.buttonItem1.Image = global::Cyberpipe.Properties.Resources._24x24icon__2__94; - this.buttonItem1.ImagePosition = DevComponents.DotNetBar.eImagePosition.Top; - this.buttonItem1.Name = "buttonItem1"; - this.buttonItem1.SubItemsExpandWidth = 14; - this.buttonItem1.Text = "图层管理"; - this.buttonItem1.Click += new System.EventHandler(this.buttonItem1_Click); - // // btnlegendSet // this.btnlegendSet.Image = global::Cyberpipe.Properties.Resources._24x24icon__2__93; @@ -4300,278 +4501,6 @@ this.buttonItem89.Visible = false; this.buttonItem89.Click += new System.EventHandler(this.buttonItem89_Click); // - // ribbonPanel7 - // - this.ribbonPanel7.ColorSchemeStyle = DevComponents.DotNetBar.eDotNetBarStyle.StyleManagerControlled; - this.ribbonPanel7.Controls.Add(this.ribbonBar5); - this.ribbonPanel7.Dock = System.Windows.Forms.DockStyle.Fill; - this.ribbonPanel7.Location = new System.Drawing.Point(0, 0); - this.ribbonPanel7.Name = "ribbonPanel7"; - this.ribbonPanel7.Padding = new System.Windows.Forms.Padding(3, 0, 3, 3); - this.ribbonPanel7.Size = new System.Drawing.Size(1328, 95); - // - // - // - this.ribbonPanel7.Style.Class = ""; - this.ribbonPanel7.Style.CornerType = DevComponents.DotNetBar.eCornerType.Square; - // - // - // - this.ribbonPanel7.StyleMouseDown.Class = ""; - this.ribbonPanel7.StyleMouseDown.CornerType = DevComponents.DotNetBar.eCornerType.Square; - // - // - // - this.ribbonPanel7.StyleMouseOver.Class = ""; - this.ribbonPanel7.StyleMouseOver.CornerType = DevComponents.DotNetBar.eCornerType.Square; - this.ribbonPanel7.TabIndex = 41; - this.ribbonPanel7.Visible = false; - // - // ribbonBar5 - // - this.ribbonBar5.AutoOverflowEnabled = true; - // - // - // - this.ribbonBar5.BackgroundMouseOverStyle.Class = ""; - this.ribbonBar5.BackgroundMouseOverStyle.CornerType = DevComponents.DotNetBar.eCornerType.Square; - // - // - // - this.ribbonBar5.BackgroundStyle.Class = ""; - this.ribbonBar5.BackgroundStyle.CornerType = DevComponents.DotNetBar.eCornerType.Square; - this.ribbonBar5.ContainerControlProcessDialogKey = true; - this.ribbonBar5.Dock = System.Windows.Forms.DockStyle.Left; - this.ribbonBar5.Items.AddRange(new DevComponents.DotNetBar.BaseItem[] { - this.btn_flag, - this.slider4ground}); - this.ribbonBar5.Location = new System.Drawing.Point(3, 0); - this.ribbonBar5.Name = "ribbonBar5"; - this.ribbonBar5.Size = new System.Drawing.Size(418, 92); - this.ribbonBar5.Style = DevComponents.DotNetBar.eDotNetBarStyle.StyleManagerControlled; - this.ribbonBar5.TabIndex = 0; - // - // - // - this.ribbonBar5.TitleStyle.Class = ""; - this.ribbonBar5.TitleStyle.CornerType = DevComponents.DotNetBar.eCornerType.Square; - // - // - // - this.ribbonBar5.TitleStyleMouseOver.Class = ""; - this.ribbonBar5.TitleStyleMouseOver.CornerType = DevComponents.DotNetBar.eCornerType.Square; - this.ribbonBar5.TitleVisible = false; - this.ribbonBar5.ItemClick += new System.EventHandler(this.ribbonBar5_ItemClick); - // - // btn_flag - // - this.btn_flag.Image = global::Cyberpipe.Properties.Resources._24x24icon_03_hover; - this.btn_flag.ImagePosition = DevComponents.DotNetBar.eImagePosition.Top; - this.btn_flag.Name = "btn_flag"; - this.btn_flag.SubItemsExpandWidth = 14; - this.btn_flag.Text = "标识器管理"; - this.btn_flag.Click += new System.EventHandler(this.btn_flag_Click); - // - // slider4ground - // - this.slider4ground.LabelPosition = DevComponents.DotNetBar.eSliderLabelPosition.Top; - this.slider4ground.Name = "slider4ground"; - this.slider4ground.Text = "地面透明度"; - this.slider4ground.Value = 0; - this.slider4ground.ValueChanged += new System.EventHandler(this.slider4ground_ValueChanged); - // - // ribbonPanel2 - // - this.ribbonPanel2.ColorSchemeStyle = DevComponents.DotNetBar.eDotNetBarStyle.StyleManagerControlled; - this.ribbonPanel2.Controls.Add(this.ribbonBar4); - this.ribbonPanel2.Dock = System.Windows.Forms.DockStyle.Fill; - this.ribbonPanel2.Location = new System.Drawing.Point(0, 0); - this.ribbonPanel2.Name = "ribbonPanel2"; - this.ribbonPanel2.Padding = new System.Windows.Forms.Padding(3, 0, 3, 3); - this.ribbonPanel2.Size = new System.Drawing.Size(1328, 95); - // - // - // - this.ribbonPanel2.Style.Class = ""; - this.ribbonPanel2.Style.CornerType = DevComponents.DotNetBar.eCornerType.Square; - // - // - // - this.ribbonPanel2.StyleMouseDown.Class = ""; - this.ribbonPanel2.StyleMouseDown.CornerType = DevComponents.DotNetBar.eCornerType.Square; - // - // - // - this.ribbonPanel2.StyleMouseOver.Class = ""; - this.ribbonPanel2.StyleMouseOver.CornerType = DevComponents.DotNetBar.eCornerType.Square; - this.ribbonPanel2.TabIndex = 39; - this.ribbonPanel2.Visible = false; - // - // ribbonBar4 - // - this.ribbonBar4.AutoOverflowEnabled = true; - // - // - // - this.ribbonBar4.BackgroundMouseOverStyle.Class = ""; - this.ribbonBar4.BackgroundMouseOverStyle.CornerType = DevComponents.DotNetBar.eCornerType.Square; - // - // - // - this.ribbonBar4.BackgroundStyle.Class = ""; - this.ribbonBar4.BackgroundStyle.CornerType = DevComponents.DotNetBar.eCornerType.Square; - this.ribbonBar4.ContainerControlProcessDialogKey = true; - this.ribbonBar4.Dock = System.Windows.Forms.DockStyle.Left; - this.ribbonBar4.Items.AddRange(new DevComponents.DotNetBar.BaseItem[] { - this.buttonItem_TaskManager, - this.buttonItem_OnlineTask, - this.buttonItem_Event}); - this.ribbonBar4.Location = new System.Drawing.Point(3, 0); - this.ribbonBar4.Name = "ribbonBar4"; - this.ribbonBar4.Size = new System.Drawing.Size(299, 92); - this.ribbonBar4.Style = DevComponents.DotNetBar.eDotNetBarStyle.StyleManagerControlled; - this.ribbonBar4.TabIndex = 0; - this.ribbonBar4.Text = "ribbonBar4"; - // - // - // - this.ribbonBar4.TitleStyle.Class = ""; - this.ribbonBar4.TitleStyle.CornerType = DevComponents.DotNetBar.eCornerType.Square; - // - // - // - this.ribbonBar4.TitleStyleMouseOver.Class = ""; - this.ribbonBar4.TitleStyleMouseOver.CornerType = DevComponents.DotNetBar.eCornerType.Square; - this.ribbonBar4.TitleVisible = false; - // - // buttonItem_TaskManager - // - this.buttonItem_TaskManager.Image = global::Cyberpipe.Properties.Resources._24x24icon__2__76; - this.buttonItem_TaskManager.ImagePosition = DevComponents.DotNetBar.eImagePosition.Top; - this.buttonItem_TaskManager.Name = "buttonItem_TaskManager"; - this.buttonItem_TaskManager.SubItemsExpandWidth = 14; - this.buttonItem_TaskManager.Text = "工单管理"; - this.buttonItem_TaskManager.Click += new System.EventHandler(this.buttonItem_TaskManager_Click); - // - // buttonItem_OnlineTask - // - this.buttonItem_OnlineTask.Image = global::Cyberpipe.Properties.Resources._24x24icon__2__69; - this.buttonItem_OnlineTask.ImagePosition = DevComponents.DotNetBar.eImagePosition.Top; - this.buttonItem_OnlineTask.Name = "buttonItem_OnlineTask"; - this.buttonItem_OnlineTask.SubItemsExpandWidth = 14; - this.buttonItem_OnlineTask.Text = "在线任务"; - this.buttonItem_OnlineTask.Click += new System.EventHandler(this.buttonItem_OnlineTask_Click); - // - // buttonItem_Event - // - this.buttonItem_Event.Image = global::Cyberpipe.Properties.Resources._24x24icon__2__72; - this.buttonItem_Event.ImagePosition = DevComponents.DotNetBar.eImagePosition.Top; - this.buttonItem_Event.Name = "buttonItem_Event"; - this.buttonItem_Event.SubItemsExpandWidth = 14; - this.buttonItem_Event.Text = "事件管理"; - this.buttonItem_Event.Click += new System.EventHandler(this.buttonItem_Event_Click); - // - // ribbonPanel3 - // - this.ribbonPanel3.ColorSchemeStyle = DevComponents.DotNetBar.eDotNetBarStyle.StyleManagerControlled; - this.ribbonPanel3.Controls.Add(this.ribbonBar3); - this.ribbonPanel3.Dock = System.Windows.Forms.DockStyle.Fill; - this.ribbonPanel3.Location = new System.Drawing.Point(0, 33); - this.ribbonPanel3.Name = "ribbonPanel3"; - this.ribbonPanel3.Padding = new System.Windows.Forms.Padding(3, 0, 3, 3); - this.ribbonPanel3.Size = new System.Drawing.Size(1328, 62); - // - // - // - this.ribbonPanel3.Style.Class = ""; - this.ribbonPanel3.Style.CornerType = DevComponents.DotNetBar.eCornerType.Square; - // - // - // - this.ribbonPanel3.StyleMouseDown.Class = ""; - this.ribbonPanel3.StyleMouseDown.CornerType = DevComponents.DotNetBar.eCornerType.Square; - // - // - // - this.ribbonPanel3.StyleMouseOver.Class = ""; - this.ribbonPanel3.StyleMouseOver.CornerType = DevComponents.DotNetBar.eCornerType.Square; - this.ribbonPanel3.TabIndex = 40; - // - // ribbonBar3 - // - this.ribbonBar3.AutoOverflowEnabled = true; - // - // - // - this.ribbonBar3.BackgroundMouseOverStyle.Class = ""; - this.ribbonBar3.BackgroundMouseOverStyle.CornerType = DevComponents.DotNetBar.eCornerType.Square; - // - // - // - this.ribbonBar3.BackgroundStyle.Class = ""; - this.ribbonBar3.BackgroundStyle.CornerType = DevComponents.DotNetBar.eCornerType.Square; - this.ribbonBar3.ContainerControlProcessDialogKey = true; - this.ribbonBar3.Dock = System.Windows.Forms.DockStyle.Left; - this.ribbonBar3.Items.AddRange(new DevComponents.DotNetBar.BaseItem[] { - this.btn_device, - this.btn_Person, - this.btn_constructMap, - this.buttonItem9}); - this.ribbonBar3.Location = new System.Drawing.Point(3, 0); - this.ribbonBar3.Name = "ribbonBar3"; - this.ribbonBar3.Size = new System.Drawing.Size(378, 59); - this.ribbonBar3.Style = DevComponents.DotNetBar.eDotNetBarStyle.StyleManagerControlled; - this.ribbonBar3.TabIndex = 0; - // - // - // - this.ribbonBar3.TitleStyle.Class = ""; - this.ribbonBar3.TitleStyle.CornerType = DevComponents.DotNetBar.eCornerType.Square; - // - // - // - this.ribbonBar3.TitleStyleMouseOver.Class = ""; - this.ribbonBar3.TitleStyleMouseOver.CornerType = DevComponents.DotNetBar.eCornerType.Square; - this.ribbonBar3.TitleVisible = false; - // - // btn_device - // - this.btn_device.ButtonStyle = DevComponents.DotNetBar.eButtonStyle.ImageAndText; - this.btn_device.Image = global::Cyberpipe.Properties.Resources._24X24__2__02; - this.btn_device.ImagePosition = DevComponents.DotNetBar.eImagePosition.Top; - this.btn_device.Name = "btn_device"; - this.btn_device.SubItemsExpandWidth = 14; - this.btn_device.Text = "探测仪管理"; - this.btn_device.Click += new System.EventHandler(this.btn_device_Click); - // - // btn_Person - // - this.btn_Person.ButtonStyle = DevComponents.DotNetBar.eButtonStyle.ImageAndText; - this.btn_Person.Image = global::Cyberpipe.Properties.Resources._24x24icon_05_hover1; - this.btn_Person.ImagePosition = DevComponents.DotNetBar.eImagePosition.Top; - this.btn_Person.Name = "btn_Person"; - this.btn_Person.SubItemsExpandWidth = 14; - this.btn_Person.Text = "定位人员维护"; - this.btn_Person.Click += new System.EventHandler(this.btn_Person_Click); - // - // btn_constructMap - // - this.btn_constructMap.Image = global::Cyberpipe.Properties.Resources._24x24icon_04_hover; - this.btn_constructMap.ImagePosition = DevComponents.DotNetBar.eImagePosition.Top; - this.btn_constructMap.Name = "btn_constructMap"; - this.btn_constructMap.SubItemsExpandWidth = 14; - this.btn_constructMap.Text = "导出施工图"; - this.btn_constructMap.Click += new System.EventHandler(this.btn_constructMap_Click); - // - // buttonItem9 - // - this.buttonItem9.Image = global::Cyberpipe.Properties.Resources._24x24icon__2__10; - this.buttonItem9.ImagePosition = DevComponents.DotNetBar.eImagePosition.Top; - this.buttonItem9.Name = "buttonItem9"; - this.buttonItem9.SubItemsExpandWidth = 14; - this.buttonItem9.Text = "文档管理"; - this.buttonItem9.Click += new System.EventHandler(this.buttonItem9_Click); - // // ribbonPanel8 // this.ribbonPanel8.ColorSchemeStyle = DevComponents.DotNetBar.eDotNetBarStyle.StyleManagerControlled; @@ -4696,6 +4625,86 @@ this.btn_reset_password.Text = "重置密码"; this.btn_reset_password.Click += new System.EventHandler(this.btn_reset_password_Click); // + // ribbonPanel7 + // + this.ribbonPanel7.ColorSchemeStyle = DevComponents.DotNetBar.eDotNetBarStyle.StyleManagerControlled; + this.ribbonPanel7.Controls.Add(this.ribbonBar5); + this.ribbonPanel7.Dock = System.Windows.Forms.DockStyle.Fill; + this.ribbonPanel7.Location = new System.Drawing.Point(0, 0); + this.ribbonPanel7.Name = "ribbonPanel7"; + this.ribbonPanel7.Padding = new System.Windows.Forms.Padding(3, 0, 3, 3); + this.ribbonPanel7.Size = new System.Drawing.Size(1328, 95); + // + // + // + this.ribbonPanel7.Style.Class = ""; + this.ribbonPanel7.Style.CornerType = DevComponents.DotNetBar.eCornerType.Square; + // + // + // + this.ribbonPanel7.StyleMouseDown.Class = ""; + this.ribbonPanel7.StyleMouseDown.CornerType = DevComponents.DotNetBar.eCornerType.Square; + // + // + // + this.ribbonPanel7.StyleMouseOver.Class = ""; + this.ribbonPanel7.StyleMouseOver.CornerType = DevComponents.DotNetBar.eCornerType.Square; + this.ribbonPanel7.TabIndex = 41; + this.ribbonPanel7.Visible = false; + // + // ribbonBar5 + // + this.ribbonBar5.AutoOverflowEnabled = true; + // + // + // + this.ribbonBar5.BackgroundMouseOverStyle.Class = ""; + this.ribbonBar5.BackgroundMouseOverStyle.CornerType = DevComponents.DotNetBar.eCornerType.Square; + // + // + // + this.ribbonBar5.BackgroundStyle.Class = ""; + this.ribbonBar5.BackgroundStyle.CornerType = DevComponents.DotNetBar.eCornerType.Square; + this.ribbonBar5.ContainerControlProcessDialogKey = true; + this.ribbonBar5.Dock = System.Windows.Forms.DockStyle.Left; + this.ribbonBar5.Items.AddRange(new DevComponents.DotNetBar.BaseItem[] { + this.btn_flag, + this.slider4ground}); + this.ribbonBar5.Location = new System.Drawing.Point(3, 0); + this.ribbonBar5.Name = "ribbonBar5"; + this.ribbonBar5.Size = new System.Drawing.Size(418, 92); + this.ribbonBar5.Style = DevComponents.DotNetBar.eDotNetBarStyle.StyleManagerControlled; + this.ribbonBar5.TabIndex = 0; + // + // + // + this.ribbonBar5.TitleStyle.Class = ""; + this.ribbonBar5.TitleStyle.CornerType = DevComponents.DotNetBar.eCornerType.Square; + // + // + // + this.ribbonBar5.TitleStyleMouseOver.Class = ""; + this.ribbonBar5.TitleStyleMouseOver.CornerType = DevComponents.DotNetBar.eCornerType.Square; + this.ribbonBar5.TitleVisible = false; + this.ribbonBar5.ItemClick += new System.EventHandler(this.ribbonBar5_ItemClick); + // + // btn_flag + // + this.btn_flag.Image = global::Cyberpipe.Properties.Resources._24x24icon_03_hover; + this.btn_flag.ImagePosition = DevComponents.DotNetBar.eImagePosition.Top; + this.btn_flag.Name = "btn_flag"; + this.btn_flag.SubItemsExpandWidth = 14; + this.btn_flag.Text = "标识器管理"; + this.btn_flag.Click += new System.EventHandler(this.btn_flag_Click); + // + // slider4ground + // + this.slider4ground.LabelPosition = DevComponents.DotNetBar.eSliderLabelPosition.Top; + this.slider4ground.Name = "slider4ground"; + this.slider4ground.Text = "地面透明度"; + this.slider4ground.Value = 0; + this.slider4ground.ValueChanged += new System.EventHandler(this.slider4ground_ValueChanged); + // // ribbonPanel15 // this.ribbonPanel15.ColorSchemeStyle = DevComponents.DotNetBar.eDotNetBarStyle.StyleManagerControlled; @@ -6393,16 +6402,6 @@ this.buttonItem76.SubItemsExpandWidth = 14; this.buttonItem76.Text = "坐标标注"; // - // layerTree - // - this.layerTree.CheckBoxes = true; - this.layerTree.ItemHeight = 18; - this.layerTree.Location = new System.Drawing.Point(30, 78); - this.layerTree.Name = "layerTree"; - this.layerTree.Size = new System.Drawing.Size(121, 97); - this.layerTree.TabIndex = 1; - this.layerTree.AfterCheck += new System.Windows.Forms.TreeViewEventHandler(this.layerTree_AfterCheck); - // // MainFrm // this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Inherit; @@ -6475,11 +6474,11 @@ this.contextMenuStripDeleteLayerNode.ResumeLayout(false); this.ribbonControl1.ResumeLayout(false); this.ribbonControl1.PerformLayout(); - this.ribbonPanel1.ResumeLayout(false); - this.ribbonPanel7.ResumeLayout(false); - this.ribbonPanel2.ResumeLayout(false); this.ribbonPanel3.ResumeLayout(false); + this.ribbonPanel2.ResumeLayout(false); + this.ribbonPanel1.ResumeLayout(false); this.ribbonPanel8.ResumeLayout(false); + this.ribbonPanel7.ResumeLayout(false); this.ribbonPanel15.ResumeLayout(false); ((System.ComponentModel.ISupportInitialize)(this.pictureBox1)).EndInit(); this.ResumeLayout(false); diff --git a/NewFunction/FrmCreateTunnel.cs b/NewFunction/FrmCreateTunnel.cs index 282767c..338edff 100644 --- a/NewFunction/FrmCreateTunnel.cs +++ b/NewFunction/FrmCreateTunnel.cs @@ -142,35 +142,6 @@ } } - private void txtMS_KeyPress(object sender, KeyPressEventArgs e) - { - TextBox text = sender as TextBox; - if ((e.KeyChar < 48 || e.KeyChar > 57) && (e.KeyChar != 8) && (int)e.KeyChar != 46) - { - e.Handled = true; - } - if ((int)e.KeyChar == 46) //小数点 - { - if (text.Text.Length <= 0) - e.Handled = true; //小数点不能在第一位 - else //处理不规则的小数点 - { - float f; - float oldf; - bool b1 = false, b2 = false; - b1 = float.TryParse(text.Text, out oldf); - b2 = float.TryParse(text.Text + e.KeyChar.ToString(), out f); - if (b2 == false) - { - if (b1 == true) - e.Handled = true; - else - e.Handled = false; - } - } - } - } - private void FrmCreateTunnel_Load(object sender, EventArgs e) { if (comboBoxTunnelType.Items.Count > 0) diff --git a/OracleHelper.cs b/OracleHelper.cs index 11eebe6..79cdf48 100644 --- a/OracleHelper.cs +++ b/OracleHelper.cs @@ -49,7 +49,7 @@ { conn.Close(); } - MessageBox.Show(ex.Message, "提示"); + LogHelper.WriteLog(typeof(OledbHelper), ex.Message); return null; } } @@ -67,7 +67,7 @@ } catch(Exception ex) { - // LogError.PublishError(ex); + LogHelper.WriteLog(typeof(OledbHelper), ex.Message); } finally { @@ -111,6 +111,7 @@ } catch (Exception ex) { + LogHelper.WriteLog(typeof(OledbHelper), ex.Message); return null; } } @@ -131,6 +132,7 @@ } catch(Exception ex) { + LogHelper.WriteLog(typeof(OledbHelper), ex.Message); rowCount = -1; } finally @@ -159,6 +161,7 @@ } catch(Exception ex) { + LogHelper.WriteLog(typeof(OledbHelper), ex.Message); num = -1; } finally @@ -190,6 +193,7 @@ } catch (Exception ex) { + LogHelper.WriteLog(typeof(OledbHelper), ex.Message); return null; } } @@ -210,7 +214,7 @@ oracleCmd.Dispose(); conn.Close(); //调用con_close()方法,关闭与数据库的连接 }catch(Exception ex){ - + LogHelper.WriteLog(typeof(OledbHelper), ex.Message); } finally { @@ -237,6 +241,7 @@ } catch (Exception ex) { + LogHelper.WriteLog(typeof(OledbHelper), ex.Message); rowCount = -1; } finally diff --git a/OracleUtils.cs b/OracleUtils.cs index 29b5374..c1aadda 100644 --- a/OracleUtils.cs +++ b/OracleUtils.cs @@ -741,7 +741,6 @@ } catch { - //if we fail to return the SqlDatReader, we need to close the connection ourselves cn.Close(); throw; } diff --git a/PAS.cs b/PAS.cs index 972de2d..fcda1dd 100644 --- a/PAS.cs +++ b/PAS.cs @@ -93,15 +93,7 @@ } - private void TSM_Pderive_Click(object sender, EventArgs e) - { - PASAClass.Table_name(operation); - if (TV_Files.SelectedNode != null) - { - PASAClass.GuideEdit_form("G", TV_Files, int.Parse(((ToolStripMenuItem)sender).Tag.ToString())); - } - } - + private void TSM_Fenter_Click(object sender, EventArgs e) { if (TV_Files.SelectedNode != null) @@ -110,16 +102,6 @@ } } - private void TSM_Frename_Click(object sender, EventArgs e) - { - TSM_Fenter_Click(sender, e); - } - - private void TSM_Fdelete_Click(object sender, EventArgs e) - { - TSM_Fenter_Click(sender, e); - } - private void TSM_Fderive_Click(object sender, EventArgs e) { if (TV_Files.SelectedNode != null) @@ -128,25 +110,6 @@ } } - private void TSM_Fprint_Click(object sender, EventArgs e) - { - if (TV_Files.SelectedNode != null) - { - PASAClass.Print(int.Parse(TV_Files.SelectedNode.Tag.ToString()), TV_Files.SelectedNode.Text, PD_PASPrtFile, PD_PASPrtDoc); - - } - } - - private void TSM_PASPgSt_Click(object sender, EventArgs e) - { - PSD_PASSetPage.ShowDialog(); - } - - private void TSM_PASPreV_Click(object sender, EventArgs e) - { - PPD_PASPreV.ShowDialog(); - } - private void TV_Files_AfterCollapse(object sender, TreeViewEventArgs e) { e.Node.ImageIndex = 0; @@ -250,14 +213,6 @@ } } - private void 导出ToolStripMenuItem_Click(object sender, EventArgs e) - { - PASAClass.Table_name(operation); - if (TV_Files.SelectedNode != null) - { - PASAClass.GuideEdit_form("G", TV_Files, int.Parse(((ToolStripMenuItem)sender).Tag.ToString())); - } - } private void 导入ToolStripMenuItem_Click(object sender, EventArgs e) { diff --git a/PAS_Forms/F_PASInout.cs b/PAS_Forms/F_PASInout.cs index 373a4e6..974f987 100644 --- a/PAS_Forms/F_PASInout.cs +++ b/PAS_Forms/F_PASInout.cs @@ -71,11 +71,6 @@ } - private void Cancel_Click(object sender, EventArgs e) - { - this.Close(); - } - private void OK_Click(object sender, EventArgs e) { if (textBox1.Text == "") diff --git a/Cyberpipe.csproj b/Cyberpipe.csproj index 07a8c1a..e3cd12c 100644 --- a/Cyberpipe.csproj +++ b/Cyberpipe.csproj @@ -204,25 +204,6 @@ - - Form - - - F_GKT1数据输入输出.cs - - - Form - - - F_GKT1添加文件.cs - - - Form - - - F_GKT1添加项目.cs - - Form @@ -1068,18 +1049,6 @@ Frm_password_reset.cs - - Form - - - GKT.cs - - - Form - - - GKT1.cs - Form @@ -1258,12 +1227,6 @@ F_Projedit.cs - - Form - - - PED.cs - Form @@ -1331,16 +1294,6 @@ True Reference.map - - F_GKT1数据输入输出.cs - Designer - - - F_GKT1添加文件.cs - - - F_GKT1添加项目.cs - Form_EditTask.cs @@ -1836,12 +1789,6 @@ Frm_password_reset.cs - - GKT.cs - - - GKT1.cs - F_GKT数据输入输出.cs @@ -1934,9 +1881,6 @@ F_Projedit.cs - - PED.cs - F_数据输入输出.cs diff --git a/Cyberpipe.suo b/Cyberpipe.suo index 68ced4f..a1aecf8 100644 --- a/Cyberpipe.suo +++ b/Cyberpipe.suo Binary files differ diff --git a/EMS_Forms/Form_EditTask.cs b/EMS_Forms/Form_EditTask.cs index 718992f..f1d791f 100644 --- a/EMS_Forms/Form_EditTask.cs +++ b/EMS_Forms/Form_EditTask.cs @@ -119,7 +119,8 @@ String name = Convert.ToString(dr["USERNAME"]); comboBox_userName.Items.Add(name); - } + } + dr.Close(); comboBox_road.Items.Clear(); roadList = new List(); @@ -135,7 +136,7 @@ comboBox_road.Items.Add(name); } } - + dr1.Close(); conn.Close(); bool flag2 = false; @@ -185,7 +186,7 @@ catch (Exception ex) { - MessageBox.Show(ex.ToString()); + LogHelper.WriteLog(typeof(Form_EditTask), ex.Message); } } @@ -288,7 +289,7 @@ } catch (Exception ex) { - MessageBox.Show(ex.ToString()); + LogHelper.WriteLog(typeof(Form_EditTask), ex.Message); } } @@ -474,7 +475,7 @@ } catch (Exception ex) { - MessageBox.Show(ex.ToString()); + LogHelper.WriteLog(typeof(Form_EditTask), ex.Message); } this.Close(); @@ -495,6 +496,7 @@ { numList.Add(Convert.ToInt32(dr["DBID"])); } + dr.Close(); if (numList.Count == 0) { taskNumber = Convert.ToInt32(number) * 100; @@ -674,6 +676,7 @@ } } } + dr.Close(); conn.Close(); } diff --git a/EMS_Forms/Form_EventManager.cs b/EMS_Forms/Form_EventManager.cs index b18c45b..84807b2 100644 --- a/EMS_Forms/Form_EventManager.cs +++ b/EMS_Forms/Form_EventManager.cs @@ -64,6 +64,7 @@ comboBox_name.Items.Add(name); } + dr.Close(); conn.Close(); diff --git a/Forms/FrmMnModify.cs b/Forms/FrmMnModify.cs index 31cfc5f..d036360 100644 --- a/Forms/FrmMnModify.cs +++ b/Forms/FrmMnModify.cs @@ -68,15 +68,7 @@ questionGrid.Rows[idx].Cells[1].Value = sr.question; } } - /// 选中对象 - /// - /// - /// - /// - private void buttonX1_Click(object sender, EventArgs e) - { - globecontrol.Globe.Action = EnumAction3D.SelectObject; - } + /// /// 选中某一行 /// diff --git a/Forms/FrmPipelineModelDataBase.cs b/Forms/FrmPipelineModelDataBase.cs index 2acf0ca..7ce573f 100644 --- a/Forms/FrmPipelineModelDataBase.cs +++ b/Forms/FrmPipelineModelDataBase.cs @@ -35,19 +35,7 @@ ds = _ds; InitializeComponent(); } - /// - /// 单击选择shp格式文件 - /// - /// - /// - private void btnBrowseModel_Click(object sender, EventArgs e) - { - saveFileDialog1.Filter = "*.lgd|*.lgd"; - if (saveFileDialog1.ShowDialog() == DialogResult.OK) - { - txtModelLayer.Text = saveFileDialog1.FileName; - } - } + /// /// 窗体初始化事件处理 /// @@ -100,49 +88,6 @@ } } } - - private object convertFieldValue(string fieldname, object obj) - { - if (obj == null) - return null; - - try - { - string type = fields_types[fieldname].ToString(); - switch (type) - { - case "string": - return obj.ToString(); - case "int": - //return 101; - int intResult; - if (int.TryParse(obj.ToString(), out intResult)) - return intResult; - else - return null; - case "double": - //return 202.5; - double doubleResult; - if (double.TryParse(obj.ToString(), out doubleResult)) - return doubleResult; - else - return null; - case "date": - DateTime dtResult; - if (DateTime.TryParse(obj.ToString(), out dtResult)) - return dtResult; - else - return null; - } - return null; - } - catch (Exception ex) - { - MessageBox.Show(ex.ToString()); - return null; - } - } - public string lgdFilePath = ""; /// /// 选择管线颜色 @@ -610,33 +555,6 @@ { this.Close(); } - - private void cmbLayer_SelectedIndexChanged(object sender, EventArgs e) //选择图层 - { - GSOLayer layer = ctl.Globe.Layers.GetLayerByCaption(selectLayerName); - GSOFeatures features = layer.GetAllFeatures(); - if (features.Length == 0) - return; - - cmbFrom.Items.Clear(); - cmbTo.Items.Clear(); - cmbRadius.Items.Clear(); - cmbID.Items.Clear(); - for (int i = 0; i < features[0].GetFieldCount(); i++) - { - GeoScene.Data.GSOFieldDefn fielddef = (GeoScene.Data.GSOFieldDefn)(features[0].GetFieldDefn(i)); - - cmbFrom.Items.Add(fielddef.Name); - cmbTo.Items.Add(fielddef.Name); - cmbRadius.Items.Add(fielddef.Name); - cmbID.Items.Add(fielddef.Name); - } - cmbFrom.SelectedItem = "Deep1"; - cmbTo.SelectedItem = "Deep2"; - cmbRadius.SelectedItem = "Diameter"; - cmbID.SelectedItem = "Handle"; - } - private void buttonXLayerPath_Click(object sender, EventArgs e)//单击 选择shp格式的文件 { OpenFileDialog dlg = new OpenFileDialog(); diff --git a/Forms/FrmPipelineModelDataOneStep.cs b/Forms/FrmPipelineModelDataOneStep.cs index 18afda7..ec93b8a 100644 --- a/Forms/FrmPipelineModelDataOneStep.cs +++ b/Forms/FrmPipelineModelDataOneStep.cs @@ -38,19 +38,7 @@ layerTree = _layerTree; InitializeComponent(); } - /// - /// 单击选择shp格式文件 - /// - /// - /// - private void btnBrowseModel_Click(object sender, EventArgs e) - { - saveFileDialog1.Filter = "*.lgd|*.lgd"; - if (saveFileDialog1.ShowDialog() == DialogResult.OK) - { - txtModelLayer.Text = saveFileDialog1.FileName; - } - } + /// /// 窗体初始化事件处理 /// @@ -107,48 +95,7 @@ } } - private object convertFieldValue(string fieldname, object obj) - { - if (obj == null) - return null; - - try - { - string type = fields_types[fieldname].ToString(); - switch (type) - { - case "string": - return obj.ToString(); - case "int": - //return 101; - int intResult; - if (int.TryParse(obj.ToString(), out intResult)) - return intResult; - else - return null; - case "double": - //return 202.5; - double doubleResult; - if (double.TryParse(obj.ToString(), out doubleResult)) - return doubleResult; - else - return null; - case "date": - DateTime dtResult; - if (DateTime.TryParse(obj.ToString(), out dtResult)) - return dtResult; - else - return null; - } - return null; - } - catch (Exception ex) - { - MessageBox.Show(ex.ToString()); - return null; - } - } - + public string lgdFilePath = ""; /// /// 选择管线颜色 @@ -673,32 +620,6 @@ return featDs; } - private void cmbLayer_SelectedIndexChanged(object sender, EventArgs e) //选择图层 - { - GSOLayer layer = ctl.Globe.Layers.GetLayerByCaption(selectLayerName); - GSOFeatures features = layer.GetAllFeatures(); - if (features.Length == 0) - return; - - cmbFrom.Items.Clear(); - cmbTo.Items.Clear(); - cmbRadius.Items.Clear(); - cmbID.Items.Clear(); - for (int i = 0; i < features[0].GetFieldCount(); i++) - { - GeoScene.Data.GSOFieldDefn fielddef = (GeoScene.Data.GSOFieldDefn)(features[0].GetFieldDefn(i)); - - cmbFrom.Items.Add(fielddef.Name); - cmbTo.Items.Add(fielddef.Name); - cmbRadius.Items.Add(fielddef.Name); - cmbID.Items.Add(fielddef.Name); - } - cmbFrom.SelectedItem = "Deep1"; - cmbTo.SelectedItem = "Deep2"; - cmbRadius.SelectedItem = "Diameter"; - cmbID.SelectedItem = "Handle"; - } - private void buttonXLayerPath_Click(object sender, EventArgs e)//单击 选择shp格式的文件 { OpenFileDialog dlg = new OpenFileDialog(); @@ -949,38 +870,6 @@ } //txtLayername.Text = type + layername; } - /// - /// 连接数据库 - /// - /// - /// - private void buttonX1_Click(object sender, EventArgs e) - { - if (ds == null) - { - //没连的话,直接连接审核库; //审核库配置读配置文件 - string dbIp = Utility.sgdbip; - string database = Utility.sgdbname; - string user = Utility.sgdbuser; - string pass = Utility.sgdbpwd; - - if (!Utility.isNetworkConnectionSuccess(dbIp.Trim())) - { - MessageBox.Show("网络连接失败!", "提示"); - return; - } - - ds = ctl.Globe.DataManager.OpenOracleDataSource(dbIp + "/" + database, "", "", user, pass); - if (ds == null) - { - MessageBox.Show("数据库连接失败!", "提示", MessageBoxButtons.OK, MessageBoxIcon.Warning); - } - else - { - btnCreateModel.Enabled = true; - } - } - } private void btnClose_Click(object sender, EventArgs e) { diff --git a/Forms/FrmShRK.cs b/Forms/FrmShRK.cs index 0e2e722..f1d83cb 100644 --- a/Forms/FrmShRK.cs +++ b/Forms/FrmShRK.cs @@ -215,6 +215,7 @@ { sourcefeatds = sourcefeat as GSOFeatureDataset; } + if (sourcefeatds == null) return; sourcefeatds.Open(); GSOFeatures sourcefeatures = sourcefeatds.GetAllFeatures(); @@ -251,6 +252,7 @@ { desfeatds = desfeat as GSOFeatureDataset; } + if (desfeatds == null) return; desfeatds.Open(); //向新数据集写入字段 diff --git a/FrmAccessoriesSensor.cs b/FrmAccessoriesSensor.cs index 09fcdf1..2a7a80e 100644 --- a/FrmAccessoriesSensor.cs +++ b/FrmAccessoriesSensor.cs @@ -209,7 +209,7 @@ chart1.Series[0].Points.DataBindXY(dic.Keys, dic.Values); for (int m = 0; m < dic.Values.Count; m++) { - if (chart1.Series[0].Points[m].YValues[0].ToString() != "0") + if (chart1.Series[0].Points[m]!=null&&chart1.Series[0].Points[m].YValues[0].ToString() != "0") { chart1.Series[0].Points[m].Label = chart1.Series[0].Points[m].YValues[0].ToString(); } diff --git a/FrmAccessoriesgather.cs b/FrmAccessoriesgather.cs index 9e331e1..a475d9e 100644 --- a/FrmAccessoriesgather.cs +++ b/FrmAccessoriesgather.cs @@ -338,7 +338,7 @@ chart1.Series[0].Points.DataBindXY(dic.Keys, dic.Values); for (int m = 0; m < dic.Values.Count; m++) { - if (chart1.Series[0].Points[m].YValues[0].ToString() != "0") + if (chart1.Series[0].Points[m]!=null&&chart1.Series[0].Points[m].YValues[0].ToString() != "0") { chart1.Series[0].Points[m].Label = chart1.Series[0].Points[m].YValues[0].ToString(); } diff --git a/FrmAccessoryAnalysis.cs b/FrmAccessoryAnalysis.cs index 71d4579..44d4065 100644 --- a/FrmAccessoryAnalysis.cs +++ b/FrmAccessoryAnalysis.cs @@ -66,39 +66,6 @@ globeControl1.Refresh(); } /// - /// 键盘按键按下事件处理 - /// - /// - /// - private void txtRadius_KeyPress(object sender, KeyPressEventArgs e) - { - TextBox text = sender as TextBox; - if ((e.KeyChar < 48 || e.KeyChar > 57) && (e.KeyChar != 8) && (int)e.KeyChar != 46) - { - e.Handled = true; - } - if ((int)e.KeyChar == 46) //小数点 - { - if (text.Text.Length <= 0) - e.Handled = true; //小数点不能在第一位 - else //处理不规则的小数点 - { - float f; - float oldf; - bool b1 = false, b2 = false; - b1 = float.TryParse(text.Text, out oldf); - b2 = float.TryParse(text.Text + e.KeyChar.ToString(), out f); - if (b2 == false) - { - if (b1 == true) - e.Handled = true; - else - e.Handled = false; - } - } - } - } - /// /// 确定按钮事件处理 /// /// diff --git a/FrmAddValve.cs b/FrmAddValve.cs index 34d2fec..5f405b9 100644 --- a/FrmAddValve.cs +++ b/FrmAddValve.cs @@ -486,56 +486,6 @@ } } - - - - - - - - private void cmbLayer_SelectedIndexChanged(object sender, EventArgs e) - { - GSOLayer layer = globeControl1.Globe.Layers.GetLayerByCaption(selectLayerName); - GSOFeatures features = layer.GetAllFeatures(); - if (features.Length == 0) - return; - - combPath.Items.Clear(); - combZ.Items.Clear(); - combModelName.Items.Clear(); - - for (int i = 0; i < features[0].GetFieldCount(); i++) - { - GeoScene.Data.GSOFieldDefn fielddef = (GeoScene.Data.GSOFieldDefn)(features[0].GetFieldDefn(i)); - combPath.Items.Add(fielddef.Name); - combZ.Items.Add(fielddef.Name); - combModelName.Items.Add(fielddef.Name); - } - combModelName.SelectedItem = "编号"; - combPath.SelectedItem = "模型路径"; - if (combfile.SelectedIndex != -1) - { - - string layerCaption = combfile.SelectedItem.ToString().Trim(); - rukuLayer = globeControl1.Globe.Layers.GetLayerByCaption(layerCaption); - if (rukuLayer != null) - { - combPath.Items.Clear(); - combZ.Items.Clear(); - combModelName.Items.Clear(); - - } - for (int i = 0; i < features[0].GetFieldCount(); i++) - { - GeoScene.Data.GSOFieldDefn fielddef = (GeoScene.Data.GSOFieldDefn)(features[0].GetFieldDefn(i)); - combPath.Items.Add(fielddef.Name); - combZ.Items.Add(fielddef.Name); - combModelName.Items.Add(fielddef.Name); - } - combModelName.SelectedItem = "编号"; - combPath.SelectedItem = "模型路径"; - } - } /// /// 单击选择shp格式文件 /// diff --git a/FrmAddWellShp.cs b/FrmAddWellShp.cs index bb79ec0..a249725 100644 --- a/FrmAddWellShp.cs +++ b/FrmAddWellShp.cs @@ -478,32 +478,6 @@ } } } - - private void cmbLayer_SelectedIndexChanged(object sender, EventArgs e) - { - GSOLayer layer = globeControl1.Globe.Layers.GetLayerByCaption(selectLayerName); - GSOFeatures features = layer.GetAllFeatures(); - if (features.Length == 0) - return; - - combCode.Items.Clear(); - combDeep.Items.Clear(); - combModelName.Items.Clear(); - combAngle.Items.Clear(); - - for (int i = 0; i < features[0].GetFieldCount(); i++) - { - GeoScene.Data.GSOFieldDefn fielddef = (GeoScene.Data.GSOFieldDefn)(features[0].GetFieldDefn(i)); - combCode.Items.Add(fielddef.Name); - combDeep.Items.Add(fielddef.Name); - combModelName.Items.Add(fielddef.Name); - combAngle.Items.Add(fielddef.Name); - } - combCode.SelectedItem = "附属物编码"; - combDeep.SelectedItem = "井深"; - combModelName.SelectedItem = "编号"; - combAngle.SelectedItem = "符号角度"; - } /// /// 单击选择shp格式文件 /// diff --git a/FrmAddYuBiZiShp.cs b/FrmAddYuBiZiShp.cs index b312d51..332f037 100644 --- a/FrmAddYuBiZiShp.cs +++ b/FrmAddYuBiZiShp.cs @@ -383,80 +383,7 @@ } } - private void cmbLayer_SelectedIndexChanged(object sender, EventArgs e) - { - GSOLayer layer = globeControl1.Globe.Layers.GetLayerByCaption(selectLayerName); - GSOFeatures features = layer.GetAllFeatures(); - if (features.Length == 0) - return; - - combCode.Items.Clear(); - combDeep.Items.Clear(); - combModelName.Items.Clear(); - //comboLoad.Items.Clear(); - for (int i = 0; i < features[0].GetFieldCount(); i++) - { - GeoScene.Data.GSOFieldDefn fielddef = (GeoScene.Data.GSOFieldDefn)(features[0].GetFieldDefn(i)); - combCode.Items.Add(fielddef.Name); - combDeep.Items.Add(fielddef.Name); - combModelName.Items.Add(fielddef.Name); - //comboLoad.Items.Add(fielddef.Name); - } - combCode.SelectedItem = "附属物编码"; - combDeep.SelectedItem = "Z坐标"; - combModelName.SelectedItem = "编号"; - //comboLoad.SelectedItem = "模型路径"; - } - - private void buttonXLayerPath_Click(object sender, EventArgs e) - { - OpenFileDialog dlg = new OpenFileDialog(); - dlg.Filter = "*.shp|*.shp"; - dlg.Multiselect = false; - if (dlg.ShowDialog() == DialogResult.OK) - { - GSOLayer layer = globeControl1.Globe.Layers.Add(dlg.FileName); - string txtMessage = valiYBdata(layer); - if (txtMessage != "") - { - button3.Enabled = false; - //textBoxLayer.Text = ""; - combCode.Items.Clear(); - combDeep.Items.Clear(); - combModelName.Items.Clear(); - globeControl1.Globe.Layers.Remove(layer); - FrmValiDataShowErrorMessage showErrorMessage = new FrmValiDataShowErrorMessage(dlg.FileName, txtMessage); - showErrorMessage.ShowDialog(); - return; - } - else - { - button3.Enabled = true; - //textBoxLayer.Text = dlg.FileName; - selectLayerName = layer.Caption; - txtLayerName.Text = layer.Caption; - GSOFeatures features = layer.GetAllFeatures(); - if (features.Length == 0) - return; - - combCode.Items.Clear(); - combDeep.Items.Clear(); - combModelName.Items.Clear(); - for (int i = 0; i < features[0].GetFieldCount(); i++) - { - GeoScene.Data.GSOFieldDefn fielddef = (GeoScene.Data.GSOFieldDefn)(features[0].GetFieldDefn(i)); - combCode.Items.Add(fielddef.Name); - combDeep.Items.Add(fielddef.Name); - combModelName.Items.Add(fielddef.Name); - //comboLoad.Items.Add(fielddef.Name); - } - combCode.SelectedItem = "管点编码"; - combDeep.SelectedItem = "Z坐标"; - combModelName.SelectedItem = "编号"; - } - } - } - + private void FrmAddYuBiZiShp_FormClosing(object sender, FormClosingEventArgs e) { globeControl1.Globe.Refresh(); diff --git a/FrmAllPipelineStatis.cs b/FrmAllPipelineStatis.cs index 6421a26..a6eea29 100644 --- a/FrmAllPipelineStatis.cs +++ b/FrmAllPipelineStatis.cs @@ -84,7 +84,7 @@ chartAllAreaPipeline.Series["管线"].Points.DataBindXY(pipelineLengthAndType.Keys, pipelineLengthAndType.Values); for (int m = 0; m < pipelineLengthAndType.Values.Count; m++) { - if (chartAllAreaPipeline.Series["管线"].Points[m].YValues[0].ToString() != "0") + if (chartAllAreaPipeline.Series["管线"].Points[m]!=null&&chartAllAreaPipeline.Series["管线"].Points[m].YValues[0].ToString() != "0") { chartAllAreaPipeline.Series["管线"].Points[m].Label = chartAllAreaPipeline.Series[0].Points[m].YValues[0].ToString(); } @@ -94,7 +94,7 @@ } catch (Exception ex) { - //LogError.PublishError(ex); + LogHelper.WriteLog(typeof(FrmAllPipelineStatis), ex.Message); } } @@ -147,7 +147,7 @@ } DataTable dt = OledbHelper.QueryTable(sql); - if (dt != null && dt.Rows.Count > 0) + if (dt != null && dt.Rows.Count > 0 && chartAllAreaPipeline.Series["管线"].Points[indexHit]!=null) { dataGridViewX1.DataSource = dt; panel.Visible = true; diff --git a/FrmAllWorkWellStatis.cs b/FrmAllWorkWellStatis.cs index 6fec7af..6af8e4c 100644 --- a/FrmAllWorkWellStatis.cs +++ b/FrmAllWorkWellStatis.cs @@ -52,7 +52,7 @@ chartAllAreaPipeline.Series["井盖"].Points.DataBindXY(workWellLengthAndType.Keys, workWellLengthAndType.Values); for (int m = 0; m < workWellLengthAndType.Values.Count; m++) { - if (chartAllAreaPipeline.Series["井盖"].Points[m].YValues[0].ToString().Trim() != "0") + if (chartAllAreaPipeline.Series["井盖"].Points[m]!=null&&chartAllAreaPipeline.Series["井盖"].Points[m].YValues[0].ToString().Trim() != "0") { chartAllAreaPipeline.Series["井盖"].Points[m].Label = chartAllAreaPipeline.Series[0].Points[m].YValues[0].ToString(); } @@ -60,7 +60,7 @@ } catch (Exception ex) { - //LogError.PublishError(ex); + LogHelper.WriteLog(typeof(FrmAllWorkWellStatis), ex.Message); } } diff --git a/FrmBSQDuoBianXingStatis.cs b/FrmBSQDuoBianXingStatis.cs index e8b7d52..3e889b6 100644 --- a/FrmBSQDuoBianXingStatis.cs +++ b/FrmBSQDuoBianXingStatis.cs @@ -60,7 +60,7 @@ { for (int m = 0; m < bsq1.Values.Count; m++) { - if (chart1.Series["标识器"].Points[m].YValues[0].ToString() != "0") + if (chart1.Series["标识器"].Points[m]!=null&&chart1.Series["标识器"].Points[m].YValues[0].ToString() != "0") { count += Convert.ToInt16(chart1.Series[0].Points[m].YValues[0].ToString()); chart1.Series["标识器"].Points[m].Label = chart1.Series[0].Points[m].YValues[0].ToString(); diff --git a/FrmBSQDuoBianXingStreet.cs b/FrmBSQDuoBianXingStreet.cs index 2005ebb..1db5777 100644 --- a/FrmBSQDuoBianXingStreet.cs +++ b/FrmBSQDuoBianXingStreet.cs @@ -63,7 +63,7 @@ chartStatis.Series[0].Points.DataBindXY(bsq.Keys, bsq.Values); for (int m = 0; m < bsq.Values.Count; m++) { - if (chartStatis.Series[0].Points[m].YValues[0].ToString().Trim() != "0") + if (chartStatis.Series[0].Points[m]!=null&&chartStatis.Series[0].Points[m].YValues[0].ToString().Trim() != "0") { count += Convert.ToInt16(chartStatis.Series[0].Points[m].YValues[0].ToString()); chartStatis.Series[0].Points[m].Label = chartStatis.Series[0].Points[m].YValues[0].ToString(); diff --git a/FrmBSQStatis.cs b/FrmBSQStatis.cs index 390a55c..4aa0ee6 100644 --- a/FrmBSQStatis.cs +++ b/FrmBSQStatis.cs @@ -95,6 +95,8 @@ } } } + + dr.Close(); conn.Close(); for (int i = 0; i < typeLists.Count; i++) { @@ -123,7 +125,7 @@ chartStatis.Series[0].Points.DataBindXY(bsq.Keys, bsq.Values); for (int m = 0; m < bsq.Values.Count; m++) { - if (chartStatis.Series[0].Points[m].YValues[0].ToString().Trim() != "0") + if (chartStatis.Series[0].Points[m]!=null&&chartStatis.Series[0].Points[m].YValues[0].ToString().Trim() != "0") { //count += Convert.ToInt16(chartStatis.Series[0].Points[m].YValues[0].ToString()); chartStatis.Series[0].Points[m].Label = chartStatis.Series[0].Points[m].YValues[0].ToString(); diff --git a/FrmBSQStreet.cs b/FrmBSQStreet.cs index 9d88adb..7fbacad 100644 --- a/FrmBSQStreet.cs +++ b/FrmBSQStreet.cs @@ -44,7 +44,7 @@ chartStatis.Series[0].Points.DataBindXY(bsq.Keys, bsq.Values); for (int m = 0; m < bsq.Values.Count; m++) { - if (chartStatis.Series[0].Points[m].YValues[0].ToString().Trim() != "0") + if (chartStatis.Series[0].Points[m]!=null&&chartStatis.Series[0].Points[m].YValues[0].ToString().Trim() != "0") { count += Convert.ToInt16(chartStatis.Series[0].Points[m].YValues[0].ToString()); chartStatis.Series[0].Points[m].Label = chartStatis.Series[0].Points[m].YValues[0].ToString(); diff --git a/FrmBoosterValvers.cs b/FrmBoosterValvers.cs index 5061efc..df9b62b 100644 --- a/FrmBoosterValvers.cs +++ b/FrmBoosterValvers.cs @@ -236,199 +236,6 @@ count = 0; } } - /// - /// 添加火苗 - /// - /// - /// - /// - /// - private GSOFeature AddFire(double x,double y,double z) - { - // 烟火示例 - - string strResPath = Application.StartupPath + "/Resource"; - - // 烟火粒子示例,由三个发射器构成 - GSOGeoParticle geoParticle = new GSOGeoParticle(); - geoParticle.SetPosition(x, y, z); // 添加到这个经纬度位置 - geoParticle.AltitudeMode = EnumAltitudeMode.RelativeToGround; - - GSORingParticleEmitter emitter = new GSORingParticleEmitter(); - emitter.TexturePath = strResPath + "/ParticleImage/flare.png"; - - emitter.SetSizeFix(1, 1); - emitter.VelFix = 1; - emitter.VelRnd = 5; - - emitter.AngleXYFix = 0; - emitter.AngleXYRnd = 180; - - emitter.AngleXZFix = 90; - emitter.AngleXZRnd = 0; - - emitter.LifeFix = 0.5f; - emitter.LifeRnd = 0.0f; - - emitter.RotFix = 0; - emitter.RotRnd = 0; - - emitter.RotVelFix = 0; - emitter.RotVelRnd = 0; - - emitter.EmitPerSec = 100; - - // 采用线性插值生成粒子的初始颜色 - emitter.ColorRndStart = Color.White; - emitter.ColorRndEnd = Color.Red; - - - GSOColorParticleEffector effector2 = new GSOColorParticleEffector(); - effector2.SetColorChanged(0, -1, -1, 0); - effector2.StartTime = 0.0f; - effector2.EndTime = -1.0f; - emitter.AddEffector(effector2); - - // 将三个发射器添加到粒子对象中 - geoParticle.AddEmitter(emitter); - - geoParticle.Play(); - - GSOFeature feature = new GSOFeature(); - - feature.Geometry = geoParticle; - - globeControl1.Globe.MemoryLayer.AddFeature(feature); - - - return feature; - } - - /// - /// 添加喷泉 - /// - /// - private GSOFeature AddFountain() - { - string strResPath = Application.StartupPath + "/Resource"; - - GSOGeoParticle geoParticle = new GSOGeoParticle(); - geoParticle.SetPosition(116.314, 39.84, 0); // 添加到这个经纬度位置 - - GSOPointParticleEmitter emitter = new GSOPointParticleEmitter(); - emitter.TexturePath = strResPath + "/ParticleImage/test.png"; - - emitter.SetSizeFix(0.5f, 2); - emitter.VelFix = 10; - emitter.VelRnd = 2; - - emitter.GravityAcc = 9.8f; - emitter.AngleXYFix = 0; - emitter.AngleXYRnd = 180; - - emitter.AngleXZFix = 88; - emitter.AngleXZRnd = 2; - - //emitter.InnerRadius = 0; - // emitter.OuterRadius = 0.03f; - - emitter.LifeFix = 5.0f; - emitter.LifeRnd = 1.0f; - - emitter.RotFix = 0; - emitter.RotRnd = 0; - - emitter.RotVelFix = 0; - emitter.RotVelRnd = 0; - - emitter.EmitPerSec = 1000; - emitter.ColorRndStart = Color.FromArgb(33, 255, 255, 255); - emitter.ColorRndEnd = Color.FromArgb(11, 255, 255, 255); - emitter.IsLumAdded = false; - - // 将三个发射器添加到粒子对象中 - geoParticle.AddEmitter(emitter); - - geoParticle.Play(); - GSOFeature feature = new GSOFeature(); - - feature.Geometry = geoParticle; - - //globeControl1.Globe.MemoryLayer.AddFeature(feature); - globeControl1.Globe.FlyToFeature(feature); - - return feature; - } - - /// - /// 添加水柱 - /// - /// - private GSOFeature AddWaterLine() - { - string strResPath = Application.StartupPath + "/Resource"; - - GSOGeoParticle geoParticle = new GSOGeoParticle(); - geoParticle.SetPosition(116.308, 39.84, 0); // 添加到这个经纬度位置 - - GSOPointParticleEmitter emitter = new GSOPointParticleEmitter(); - - emitter.TexturePath = strResPath + "/ParticleImage/drop3.png"; - - geoParticle.TimerInterval = 1; - - emitter.SetSizeFix(2.0f, 2.0f); - - emitter.VelFix = 50; - emitter.VelRnd = 2; - - // emitter.IsLumAdded = false; - - emitter.GravityAcc = 9.8f; - emitter.AngleXYFix = 0; - emitter.AngleXYRnd = 2; - - emitter.AngleXZFix = 60; - emitter.AngleXZRnd = 2; - - //emitter.InnerRadius = 0; - // emitter.OuterRadius = 0.1f; - - emitter.LifeFix = 5.0f; - emitter.LifeRnd = 1.0f; - - emitter.RotFix = 0; - emitter.RotRnd = 0; - - emitter.RotVelFix = 0; - emitter.RotVelRnd = 0; - - emitter.EmitPerSec = 1500; - - emitter.ColorRndStart = Color.FromArgb(100, 222, 222, 222); - emitter.ColorRndEnd = Color.FromArgb(50, 222, 222, 222); - - /* - - GSOScaleParticleEffector effector1 = new GSOScaleParticleEffector(); - effector1.SetScale(0.2f, 0.2f); - effector1.StartTime = 0; - effector1.EndTime = -1; // 负数表示整个粒子生命结束 - emitter.AddEffector(effector1); - */ - - // 将三个发射器添加到粒子对象中 - geoParticle.AddEmitter(emitter); - - geoParticle.Play(); - GSOFeature feature = new GSOFeature(); - - feature.Geometry = geoParticle; - - //globeControl1.Globe.MemoryLayer.AddFeature(feature); - globeControl1.Globe.FlyToFeature(feature); - - return feature; - } + } } diff --git a/FrmBufferAnalysis.cs b/FrmBufferAnalysis.cs index f711133..db8ca59 100644 --- a/FrmBufferAnalysis.cs +++ b/FrmBufferAnalysis.cs @@ -123,39 +123,6 @@ } } /// - /// 半径文本框的键盘按键按下事件处理 - /// - /// - /// - private void txtRadius_KeyPress(object sender, KeyPressEventArgs e) - { - TextBox text = sender as TextBox; - if ((e.KeyChar < 48 || e.KeyChar > 57) && (e.KeyChar != 8) && (int)e.KeyChar != 46) - { - e.Handled = true; - } - if ((int)e.KeyChar == 46) //小数点 - { - if (text.Text.Length <= 0) - e.Handled = true; //小数点不能在第一位 - else //处理不规则的小数点 - { - float f; - float oldf; - bool b1 = false, b2 = false; - b1 = float.TryParse(text.Text, out oldf); - b2 = float.TryParse(text.Text + e.KeyChar.ToString(), out f); - if (b2 == false) - { - if (b1 == true) - e.Handled = true; - else - e.Handled = false; - } - } - } - } - /// /// 窗体关闭事件处理 /// /// diff --git a/FrmBufferAnalysisBSQ.cs b/FrmBufferAnalysisBSQ.cs index 24a96ca..f54208f 100644 --- a/FrmBufferAnalysisBSQ.cs +++ b/FrmBufferAnalysisBSQ.cs @@ -137,35 +137,7 @@ } } - private void txtRadius_KeyPress(object sender, KeyPressEventArgs e) - { - TextBox text = sender as TextBox; - if ((e.KeyChar < 48 || e.KeyChar > 57) && (e.KeyChar != 8) && (int)e.KeyChar != 46) - { - e.Handled = true; - } - if ((int)e.KeyChar == 46) //小数点 - { - if (text.Text.Length <= 0) - e.Handled = true; //小数点不能在第一位 - else //处理不规则的小数点 - { - float f; - float oldf; - bool b1 = false, b2 = false; - b1 = float.TryParse(text.Text, out oldf); - b2 = float.TryParse(text.Text + e.KeyChar.ToString(), out f); - if (b2 == false) - { - if (b1 == true) - e.Handled = true; - else - e.Handled = false; - } - } - } - } - + private void FrmBufferAnalysis_FormClosing(object sender, FormClosingEventArgs e) { //Form1.y = 0; @@ -316,27 +288,6 @@ } } - private void FlyToMenu_Click(object sender, EventArgs e) - { - if (m_feature != null) - { - if (m_feature.Geometry != null && m_feature.Geometry.Type == EnumGeometryType.GeoPolyline3D) - { - GSOGeoPolyline3D line = m_feature.Geometry as GSOGeoPolyline3D; - double length = line.GetSpaceLength(true, 6378137); - GSOGeoPolyline3D lineLine = line.GetSegment(0, length / 2); - GSOPoint3d point3d = lineLine[lineLine.PartCount - 1][lineLine[lineLine.PartCount - 1].Count - 1]; - - globeControl1.Globe.FlyToPosition(point3d, EnumAltitudeMode.Absolute, 0, 45, 5); - } - else - { - globeControl1.Globe.FlyToFeature(m_feature, 0, 45, 3); - } - LightMenu_Click(sender, e); - } - } - private void LightMenu_Click(object sender, EventArgs e) { flashflag = "single"; diff --git a/FrmDataBaseOpt.cs b/FrmDataBaseOpt.cs index b0c4b5d..8d7b69d 100644 --- a/FrmDataBaseOpt.cs +++ b/FrmDataBaseOpt.cs @@ -362,6 +362,7 @@ dbCombor.Items.Add(dblist[i].title); } } + /* /// /// 从配置文件读取数据库参数配置 /// @@ -428,6 +429,8 @@ } } + * */ + /* /// /// 向配置文件写入连接数据库的参数配置 /// @@ -485,6 +488,7 @@ MessageBox.Show(exp.ToString()); } } + * */ /// /// /// diff --git a/FrmDatabaseParaSetting.cs b/FrmDatabaseParaSetting.cs index a6fea46..63b596b 100644 --- a/FrmDatabaseParaSetting.cs +++ b/FrmDatabaseParaSetting.cs @@ -152,6 +152,7 @@ this.DialogResult = DialogResult.OK; this.Close(); } + /* /// /// 从配置文件读取数据库连接参数配置 /// @@ -218,6 +219,8 @@ } } + * */ + /* /// /// 向配置文件写入数据库参数配置 /// @@ -276,7 +279,7 @@ MessageBox.Show(ex.ToString()); } } - + */ /// /// 取消按钮事件处理 /// diff --git a/FrmDatabaseParaSetting2.cs b/FrmDatabaseParaSetting2.cs index 932d05e..96a87d5 100644 --- a/FrmDatabaseParaSetting2.cs +++ b/FrmDatabaseParaSetting2.cs @@ -148,6 +148,7 @@ this.DialogResult = DialogResult.OK; this.Close(); } + /* /// /// 从配置文件读取数据库连接参数配置 /// @@ -214,6 +215,8 @@ } } + * */ + /* /// /// 向配置文件写入数据库参数配置 /// @@ -272,7 +275,7 @@ MessageBox.Show(exp.ToString()); } } - + */ /// /// 取消按钮事件处理 /// diff --git a/FrmDiameterQuery.cs b/FrmDiameterQuery.cs index 68c948b..9a5215b 100644 --- a/FrmDiameterQuery.cs +++ b/FrmDiameterQuery.cs @@ -77,18 +77,7 @@ isBetween = true; } } - /// - /// 键盘按键按下事件处理 - /// - /// - /// - private void textBoxX1_KeyPress(object sender, KeyPressEventArgs e) - { - if ((e.KeyChar < 48 || e.KeyChar > 57) && e.KeyChar != 8) - { - e.Handled = true;//屏蔽 - } - } + bool isBetween = false; /// diff --git a/FrmDocumentEdit.cs b/FrmDocumentEdit.cs index aab2d31..e78a7ff 100644 --- a/FrmDocumentEdit.cs +++ b/FrmDocumentEdit.cs @@ -256,121 +256,6 @@ } - // - /// 将本地文件上传到指定的服务器(HttpWebRequest方法) - /// - /// 文件上传到的服务器 - /// 要上传的本地文件(全路径) - /// 文件上传后的名称 - /// 上传进度条 - /// 成功返回1,失败返回0 - private int Upload_Request(string address, string fileNamePath, string saveName, ProgressBar progressBar) - { - int returnValue = 0; - // 要上传的文件 - FileStream fs = new FileStream(fileNamePath, FileMode.Open, FileAccess.Read); - BinaryReader r = new BinaryReader(fs); - //时间戳 - string strBoundary = "----------" + DateTime.Now.Ticks.ToString("x"); - byte[] boundaryBytes = Encoding.ASCII.GetBytes("/r/n--" + strBoundary + "/r/n"); - //请求头部信息 - StringBuilder sb = new StringBuilder(); - sb.Append("--"); - sb.Append(strBoundary); - sb.Append("\r\n"); - sb.Append("Content-Disposition: form-data; name=\""); - sb.Append("file"); - sb.Append("\"; filename=\""); - sb.Append(saveName); - sb.Append("\""); - sb.Append("\r\n"); - sb.Append("Content-Type: "); - sb.Append("application/octet-stream"); - sb.Append("\r\n"); - sb.Append("\r\n"); - string strPostHeader = sb.ToString(); - byte[] postHeaderBytes = Encoding.UTF8.GetBytes(strPostHeader); - // 根据uri创建HttpWebRequest对象 - HttpWebRequest httpReq = (HttpWebRequest)WebRequest.Create(new Uri(address)); - httpReq.Method = "POST"; - //对发送的数据不使用缓存 - httpReq.AllowWriteStreamBuffering = false; - //设置获得响应的超时时间(300秒) - httpReq.Timeout = 300000; - httpReq.ContentType = "multipart/form-data; boundary=" + strBoundary; - long length = fs.Length + postHeaderBytes.Length + boundaryBytes.Length; - long fileLength = fs.Length; - httpReq.ContentLength = length; - try - { - progressBar.Maximum = int.MaxValue; - progressBar.Minimum = 0; - progressBar.Value = 0; - //每次上传4k - int bufferLength = 4096; - byte[] buffer = new byte[bufferLength]; - //已上传的字节数 - long offset = 0; - //开始上传时间 - DateTime startTime = DateTime.Now; - int size = r.Read(buffer, 0, bufferLength); - Stream postStream = httpReq.GetRequestStream(); - //发送请求头部消息 - postStream.Write(postHeaderBytes, 0, postHeaderBytes.Length); - while (size > 0) - { - postStream.Write(buffer, 0, size); - offset += size; - progressBar.Value = (int)(offset * (int.MaxValue / length)); - TimeSpan span = DateTime.Now - startTime; - double second = span.TotalSeconds; - //lblTime.Text = "已用时:" + second.ToString("F2") + "秒"; - //if (second > 0.001) - //{ - // lblSpeed.Text = " 平均速度:" + (offset / 1024 / second).ToString("0.00") + "KB/秒"; - //} - //else - //{ - // lblSpeed.Text = " 正在连接…"; - //} - //lblState.Text = "已上传:" + (offset * 100.0 / length).ToString("F2") + "%"; - //lblSize.Text = (offset / 1048576.0).ToString("F2") + "M/" + (fileLength / 1048576.0).ToString("F2") + "M"; - Application.DoEvents(); - size = r.Read(buffer, 0, bufferLength); - } - //添加尾部的时间戳 - postStream.Write(boundaryBytes, 0, boundaryBytes.Length); - postStream.Close(); - //获取服务器端的响应 - WebResponse webRespon = httpReq.GetResponse(); - Stream s = webRespon.GetResponseStream(); - StreamReader sr = new StreamReader(s); - //读取服务器端返回的消息 - String sReturnString = sr.ReadLine(); - s.Close(); - sr.Close(); - if (sReturnString == "Success") - { - returnValue = 1; - } - else if (sReturnString == "Error") - { - returnValue = 0; - } - } - catch(Exception ex) - { - returnValue = 0; - string str = ex.ToString(); - } - finally - { - fs.Close(); - r.Close(); - } - return returnValue; - } - private void btn_file_Click(object sender, EventArgs e) { OpenFileDialog dlg = new OpenFileDialog(); diff --git a/FrmExportCADS.cs b/FrmExportCADS.cs index 98772ea..59629dd 100644 --- a/FrmExportCADS.cs +++ b/FrmExportCADS.cs @@ -108,65 +108,6 @@ MessageBox.Show("请选中要导出的图层!", "提示", MessageBoxButtons.OK, MessageBoxIcon.Warning); } } - private Boolean MerageToFile(GSOFeatures features, String strDestFile, String strProj4)//图层追加 - { - if (features == null) - { - return false; - } - Boolean bSuccess = false; - - string strDir = GSOUtility.GetFileDir(strDestFile); - string strLPRJFile = GSOUtility.ChangeExt(strDestFile, ".lprj"); - string strExt = GSOUtility.GetFileExt(strDestFile); - - // 如果投影文件存在,投影以投影文件为准 - if (File.Exists(strLPRJFile)) - { - // 如果是dxf,则这样处理 - if (strExt.ToLower() == ".dxf") - { - string strTempSrcFile = strDir + "srcFeatures_dxftmp" + strExt; - globeControl1.Globe.DataManager.SaveFeatureData(features, strTempSrcFile, strLPRJFile, 4); - bSuccess = GSOUtility.MergeTwoDXFFileFeatures(strDestFile, strTempSrcFile); - File.Delete(strTempSrcFile); - } - else - { - GSOFeatures srcFeatures = globeControl1.Globe.DataManager.ReadFeatureData(strDestFile); - int nCount = features.Length; - int i = 0; - for (i = 0; i < nCount; i++) - { - srcFeatures.Add(features[i]); - } - bSuccess = globeControl1.Globe.DataManager.SaveFeatureData(srcFeatures, strDestFile, strLPRJFile, 4); - } - } - else - { - // 如果是dxf,则这样处理 - if (strExt.ToLower() == ".dxf") - { - string strTempSrcFile = strDir + "srcFeatures_dxftmp" + strExt; - globeControl1.Globe.DataManager.SaveFeatureData(features, strTempSrcFile, strProj4, 0); - bSuccess = GSOUtility.MergeTwoDXFFileFeatures(strDestFile, strTempSrcFile); - File.Delete(strTempSrcFile); - } - else - { - GSOFeatures srcFeatures = globeControl1.Globe.DataManager.ReadFeatureData(strDestFile); - int nCount = features.Length; - int i = 0; - for (i = 0; i < nCount; i++) - { - srcFeatures.Add(features[i]); - } - bSuccess = globeControl1.Globe.DataManager.SaveFeatureData(srcFeatures, strDestFile, strProj4, 0); - } - } - return bSuccess; - } /// /// 关闭按钮事件处理 /// diff --git a/FrmHDMAnalysis3.cs b/FrmHDMAnalysis3.cs index 4f73af6..2ada735 100644 --- a/FrmHDMAnalysis3.cs +++ b/FrmHDMAnalysis3.cs @@ -436,29 +436,6 @@ } layerTemp.RemoveAllFeature(); } - private void Export(GSOPoint3d _pnt, double r) - { - GSOPoint3ds pnts = new GSOPoint3ds(); - GSOPoint3d pnt = new GSOPoint3d(); - pnt.X = _pnt.X; - pnt.Y = _pnt.Y; - pnt.Z = _pnt.Z; - pnts.Add(pnt); - pnt.X = _pnt.X; - pnt.Y = _pnt.Y - 0.0000000005; - pnt.Z = _pnt.Z; - pnts.Add(pnt); - GSOGeoPolyline3D line = new GSOGeoPolyline3D(); - line.AddPart(pnts); - GSOGeoPolygon3D polygon = line.CreateBuffer(r * 2, true, 5, true, false); - GSOPoint3ds points = polygon[0]; - GSOGeoPolyline3D newLine = new GSOGeoPolyline3D(); - newLine.AddPart(points); - newLine.AltitudeMode = EnumAltitudeMode.RelativeToGround; - GSOFeature newFeature = new GSOFeature(); - newFeature.Geometry = newLine; - globeControl1.Globe.MemoryLayer.AddFeature(newFeature); - } private void ExportCAD(double a, double b, double r) { diff --git a/FrmHotFuncStat.cs b/FrmHotFuncStat.cs index c980f34..2eb1476 100644 --- a/FrmHotFuncStat.cs +++ b/FrmHotFuncStat.cs @@ -421,13 +421,6 @@ } } - private void HFS_Pderive_Click(object sender, EventArgs e) - { - if (TV_Files.SelectedNode != null) - { - HFSClass.GuideEdit_form("G", TV_Files, int.Parse(((ToolStripMenuItem)sender).Tag.ToString())); - } - } private void 导入ToolStripMenuItem_Click(object sender, EventArgs e) { @@ -530,22 +523,8 @@ } } - private void 导出ToolStripMenuItem1_Click(object sender, EventArgs e) - { - 导出ToolStripMenuItem2_Click(sender, e); - } + - private void TV_HFSSrchRslt_AfterCollapse(object sender, TreeViewEventArgs e) - { - e.Node.ImageIndex = 0; - } - - private void TV_HFSSrchRslt_AfterExpand(object sender, TreeViewEventArgs e) - { - HFSClass.ADD_TreeNode(TV_Files, e.Node); - e.Node.ImageIndex = 1; - } - private void 导出ToolStripMenuItem1_Click_1(object sender, EventArgs e) { if ((TV_HFSSrchRslt.SelectedNode != null) && (TV_HFSSrchRslt.SelectedNode.Parent != null)) diff --git a/FrmLayerControl.cs b/FrmLayerControl.cs index e7917c3..28fa14d 100644 --- a/FrmLayerControl.cs +++ b/FrmLayerControl.cs @@ -312,26 +312,7 @@ layerManagerNode.Expand(); terrainManagerNode.Expand(); } - /// - /// 刷新节点树 - /// - private void RefreshDataTree() - { - layerTree2.Nodes[0].Nodes.Clear(); - Int32 nCount = globeControl2.Globe.Layers.Count; - Int32 i = 0; - for (i = 0; i < nCount; i++) - { - GSODataset dataSpace = globeControl2.Globe.Layers[i].Dataset; - TreeNode node = new TreeNode(); - node.Text = dataSpace.Name; - node.ImageIndex = 0; - node.SelectedImageIndex = 0; - node.Checked = true; - node.Tag = dataSpace; - layerTree2.Nodes[0].Nodes.Add(node); - } - } + /// /// 目标图层按钮事件处理 /// @@ -494,22 +475,8 @@ } } } - /// - /// 改变指定节点的选中状态 - /// - /// - /// - private void CheckTreeNode(TreeNode node, Boolean bChecked) - { - CheckChildTreeNode(node, bChecked); - // 对于kml图层,如果当前处理的节点是true,那么要把所有的祖宗节点置为true - // 只有所有节点都未false,那么这个节点才为false - // CheckFatherTreeNode(node, bChecked); - globeControl1.Globe.Refresh(); - globeControl2.Globe.Refresh(); - - } + private void CheckChildTreeNode(TreeNode node, Boolean bChecked) { if (node == null) @@ -696,59 +663,7 @@ //} //CheckControl(e); } - /// - /// 树节点选中方法 - /// - /// - private void CheckControl(TreeViewEventArgs e) - { - if (e.Action != TreeViewAction.Unknown) - { - if (e.Node != null && !Convert.IsDBNull(e.Node)) - { - CheckParentNode(e.Node); - if (e.Node.Nodes.Count > 0) - { - CheckAllChildNodes(e.Node, e.Node.Checked); - } - } - } - } - /// - /// 改变所有子节点的状态 - /// - /// - /// - private void CheckAllChildNodes(TreeNode pn, bool IsChecked) - { - foreach (TreeNode tn in pn.Nodes) - { - tn.Checked = IsChecked; - if (tn.Tag.ToString().Contains("|")) - { - string nodeTag = tn.Tag.ToString().Split('|')[1]; - GSOLayer layer = globeControl1.Globe.Layers.GetLayerByCaption(nodeTag); - if (layer != null) - { - layer.Visible = IsChecked; - globeControl1.Globe.Refresh(); - } - } - if (tn.Tag is GSOFeature) - { - if (tn.Nodes.Count == 0) - { - GSOFeature feat = tn.Tag as GSOFeature; - feat.Visible = IsChecked; - globeControl1.Globe.Refresh(); - } - } - if (tn.Nodes.Count > 0) - { - CheckAllChildNodes(tn, IsChecked); - } - } - } + /// /// 改变父节点的选中状态,此处为所有子节点不选中时才取消父节点选中,可以根据需要修改 /// diff --git a/FrmLogin.cs b/FrmLogin.cs index 320fdd5..2afe46e 100644 --- a/FrmLogin.cs +++ b/FrmLogin.cs @@ -59,70 +59,6 @@ textBoxPassWord.Clear(); } } - - /// - /// 验证端口号 - /// - /// - private bool ValiPort() - { - Ping p = new Ping();//创建Ping对象p - PingReply pr = p.Send(Utility.localicenseserverip);//向指定IP或者主机名的计算机发送ICMP协议的ping数据包 - if (pr.Status == IPStatus.Success)//如果ping成功 - { - try - { - TcpClient tcpc = new TcpClient(Utility.localicenseserverip, Utility.localicenseserverport);//对IP地址为"192.168.0.105"的计算机的1500端口提出连接申请 - tcpc.Close(); - return true; - } - catch (Exception ex) - { - MessageBox.Show("端口连接错误!" + ex.Message); - return false; - } - } - else - { - int times = 0;//重新连接次数; - int count = 2;//设置尝试次数 - while (times < count) - { - //Thread.Sleep(1000);//等待时间(方便测试的话,你可以改为1000) - pr = p.Send(Utility.localicenseserverip); - - if (pr.Status == IPStatus.Success) - { - try - { - TcpClient tcpc = new TcpClient(Utility.localicenseserverip, Utility.localicenseserverport);//对IP地址为"192.168.0.105"的计算机的1500端口提出连接申请 - tcpc.Close(); - return true; - } - catch (Exception ex) - { - MessageBox.Show("端口连接错误!" + ex.Message); - return false; - } - } - else - { - times++; - if (times < count) - { - continue; - } - else - { - MessageBox.Show("重新尝试连接失败"); - return false; - } - } - - } - return false; - } - } /// /// 验证用户名、密码 /// diff --git a/FrmMetadata.cs b/FrmMetadata.cs index 886f65a..0365372 100644 --- a/FrmMetadata.cs +++ b/FrmMetadata.cs @@ -27,11 +27,7 @@ InitializeComponent(); loadTreeView(layerTree); } - private void FrmMetadata_Load(object sender, EventArgs e) - { - //this.ntLblC.Text = "nn"; - // loadTreeView(layerTree); - } + private void loadTreeView(TreeView tv)//构建图层树 { try diff --git a/FrmMetadataStat.cs b/FrmMetadataStat.cs index 790658a..e7696c6 100644 --- a/FrmMetadataStat.cs +++ b/FrmMetadataStat.cs @@ -197,9 +197,5 @@ } } - private void buttonX1_Click(object sender, EventArgs e) - { - drawChart(); - } } } diff --git a/FrmPatrolerManager.cs b/FrmPatrolerManager.cs index 37f8ffd..9e66aeb 100644 --- a/FrmPatrolerManager.cs +++ b/FrmPatrolerManager.cs @@ -109,82 +109,8 @@ this.winGridViewPager1.AllToExport = table; } - /// - /// 编辑 - /// - /// - /// - private void winGridViewPager1_OnEditSelected(object sender, EventArgs e) - { - - DataGridView grid = sender as DataGridView; - if (grid != null && grid.SelectedRows.Count>0) - { - DataGridViewRow row = grid.SelectedRows[0]; - try - { - long dbid = long.Parse(row.Cells["编号"].Value.ToString()); - String name = row.Cells["姓名"].Value.ToString(); - String sex = row.Cells["性别"].Value.ToString(); - String age = row.Cells["年龄"].Value.ToString(); - string phone = row.Cells["电话"].Value.ToString(); - age = String.IsNullOrEmpty(age.ToString().Trim()) ? "1" : age.ToString().Trim(); - FrmPatrolerEdit frm = new FrmPatrolerEdit(dbid.ToString(), name, age, sex, phone); - frm.reloadGrid += new ReloadPatrolerGrid(LoadData); - frm.ShowDialog(); - winGridViewPager1.Refresh(); - } - catch (Exception ex) - { - MessageBox.Show("编辑失败:" + ex.ToString(), "错误", MessageBoxButtons.OK, MessageBoxIcon.Error); - } - } - else - { - MessageBox.Show("没有选择记录", "提示"); - } - - } - - /// - /// 删除 - /// - /// - /// - private void winGridViewPager1_OnDeleteSelected(object sender, EventArgs e) - { - DataGridView grid = sender as DataGridView; - if (grid != null && grid.SelectedRows.Count > 0) - { - DataGridViewRow row = grid.SelectedRows[0]; - long dbid = long.Parse(row.Cells["编号"].Value.ToString()); - try - { - string state = row.Cells["状态"].Value.ToString(); - if ("在线".Equals(state)) - { - if (MessageBox.Show("确定注销?", "确认", MessageBoxButtons.YesNo, MessageBoxIcon.Question) == DialogResult.Yes) - { - String sql = "update patroler t set t.accountstate='LEAVER' where t.dbid=" + dbid; - OracleUtils.ExecuteNonQuery(OracleUtils.ConnectionString, CommandType.Text, sql); - } - } - else { - MessageBox.Show("人员不在线,无法注销", "信息"); - } - } - catch (Exception ex) - { - MessageBox.Show("人员注销失败:" + ex.ToString(), "错误", MessageBoxButtons.OK, MessageBoxIcon.Error); - } - } - else - { - MessageBox.Show("没有选择记录", "提示"); - } - } - - + + private void LoadData() { int pageIndex = winGridViewPager1.PagerInfo.CurrenetPageIndex; diff --git a/FrmRoadHDM.cs b/FrmRoadHDM.cs index e765313..e871dd5 100644 --- a/FrmRoadHDM.cs +++ b/FrmRoadHDM.cs @@ -333,31 +333,6 @@ this.Cursor = Cursors.Default; } } - - private void Export(GSOPoint3d _pnt, double r) - { - GSOPoint3ds pnts = new GSOPoint3ds(); - GSOPoint3d pnt = new GSOPoint3d(); - pnt.X = _pnt.X; - pnt.Y = _pnt.Y; - pnt.Z = _pnt.Z; - pnts.Add(pnt); - pnt.X = _pnt.X; - pnt.Y = _pnt.Y - 0.0000000005; - pnt.Z = _pnt.Z; - pnts.Add(pnt); - GSOGeoPolyline3D line = new GSOGeoPolyline3D(); - line.AddPart(pnts); - GSOGeoPolygon3D polygon = line.CreateBuffer(r * 2, true, 5, true, false); - GSOPoint3ds points = polygon[0]; - GSOGeoPolyline3D newLine = new GSOGeoPolyline3D(); - newLine.AddPart(points); - newLine.AltitudeMode = EnumAltitudeMode.RelativeToGround; - GSOFeature newFeature = new GSOFeature(); - newFeature.Geometry = newLine; - globeControl1.Globe.MemoryLayer.AddFeature(newFeature); - } - private void ExportCAD(double a, double b, double r) { GSOPoint3ds pnts = new GSOPoint3ds(); diff --git a/FrmUserAdd.cs b/FrmUserAdd.cs index c612ab4..f826427 100644 --- a/FrmUserAdd.cs +++ b/FrmUserAdd.cs @@ -231,24 +231,6 @@ //cbxRegion.SelectedIndexChanged += new EventHandler(cbxRegion_SelectedIndexChanged); } } - /// - /// 下拉框选中项改变事件处理 - /// - /// - /// - private void cbxRegion_SelectedIndexChanged(object sender, EventArgs e) - { - string sql = ""; - //string sql = "select casic_role.\"name\" from casic_role join casic_regionrole on casic_role.\"id\"=casic_regionrole.\"rid\" where casic_regionrole.\"reid\"=" + region[cbxRegion.SelectedItem.ToString().Trim()]; - DataTable dt = OledbHelper.QueryTable(sql); - if (dt != null && dt.Rows.Count > 0) - { - comboBoxExRegionRole.Items.Clear(); - for (int i = 0; i < dt.Rows.Count; i++) - { - comboBoxExRegionRole.Items.Add(dt.Rows[i][0].ToString().Trim());//部门角色 - } - } - } + } } diff --git a/FrmUserManager.cs b/FrmUserManager.cs index 571f0f0..ae254bc 100644 --- a/FrmUserManager.cs +++ b/FrmUserManager.cs @@ -81,11 +81,6 @@ } } } - //创建新用户 - private void buttonX2_Click(object sender, EventArgs e) - { - FrmUserAdd frm = new FrmUserAdd(-1); - frm.ShowDialog(); - } + } } diff --git a/FrmValveStatistics.cs b/FrmValveStatistics.cs index 545d56c..dd76777 100644 --- a/FrmValveStatistics.cs +++ b/FrmValveStatistics.cs @@ -54,7 +54,7 @@ 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") + if (chaFamenStatis.Series["阀门"].Points[m]!=null&&chaFamenStatis.Series["阀门"].Points[m].YValues[0].ToString() != "0") { chaFamenStatis.Series["阀门"].Points[m].Label = chaFamenStatis.Series[0].Points[m].YValues[0].ToString(); } diff --git a/Frm_password_reset.cs b/Frm_password_reset.cs index 7b51039..b9e5dc3 100644 --- a/Frm_password_reset.cs +++ b/Frm_password_reset.cs @@ -41,6 +41,7 @@ } catch (Exception ex) { + LogHelper.WriteLog(typeof(Frm_password_reset), ex.Message); } } private void initCombox() diff --git a/FrmpipeDeepstatis.cs b/FrmpipeDeepstatis.cs index e156db4..1a84d6c 100644 --- a/FrmpipeDeepstatis.cs +++ b/FrmpipeDeepstatis.cs @@ -307,7 +307,7 @@ chart1.Series[j].Points.DataBindXY(dic1.Keys, dic1.Values); for (int m = 0; m < dic1.Values.Count; m++) { - if (chart1.Series[j].Points[m].YValues[0].ToString() != "0") + if (chart1.Series[j].Points[m]!=null&&chart1.Series[j].Points[m].YValues[0].ToString() != "0") { chart1.Series[j].Points[m].Label = chart1.Series[j].Points[m].YValues[0].ToString(); diff --git a/FrmpipeDiametergather.cs b/FrmpipeDiametergather.cs index 30674de..057b09d 100644 --- a/FrmpipeDiametergather.cs +++ b/FrmpipeDiametergather.cs @@ -263,6 +263,7 @@ if (layer != null && layer is GSOFeatureLayer) { GSOFeatureLayer flayer = layer as GSOFeatureLayer; + if (layer == null) return; GSOFeatures features = flayer.GetAllFeatures(); if (features.Length > 0) { diff --git a/FrmpipeMaterialGather.cs b/FrmpipeMaterialGather.cs index c133ec3..398b884 100644 --- a/FrmpipeMaterialGather.cs +++ b/FrmpipeMaterialGather.cs @@ -280,6 +280,7 @@ if (layer != null && layer is GSOFeatureLayer) { GSOFeatureLayer flayer = layer as GSOFeatureLayer; + if (flayer == null) return; GSOFeatures features = flayer.GetAllFeatures(); if (features.Length > 0) { @@ -332,7 +333,7 @@ chart1.Series[j].Points.DataBindXY(dic1.Keys, dic1.Values); for (int m = 0; m < dic1.Values.Count; m++) { - if (chart1.Series[j].Points[m].YValues[0].ToString() != "0") + if (chart1.Series[j].Points[m]!=null&&chart1.Series[j].Points[m].YValues[0].ToString() != "0") { chart1.Series[j].Points[m].Label = chart1.Series[j].Points[m].YValues[0].ToString(); } diff --git a/Frmpipediameterstatis.cs b/Frmpipediameterstatis.cs index c0ed80a..50f8170 100644 --- a/Frmpipediameterstatis.cs +++ b/Frmpipediameterstatis.cs @@ -286,6 +286,7 @@ chart1.Series.Add(layerCaption); GSOFeatureLayer flayer = layer as GSOFeatureLayer; + if (layer == null) return; GSOFeatures features = flayer.GetAllFeatures(); if (features.Length > 0) { diff --git "a/GKT_Forms/F_GKT\346\225\260\346\215\256\350\276\223\345\205\245\350\276\223\345\207\272.cs" "b/GKT_Forms/F_GKT\346\225\260\346\215\256\350\276\223\345\205\245\350\276\223\345\207\272.cs" index c7bffd5..4db7d5d 100644 --- "a/GKT_Forms/F_GKT\346\225\260\346\215\256\350\276\223\345\205\245\350\276\223\345\207\272.cs" +++ "b/GKT_Forms/F_GKT\346\225\260\346\215\256\350\276\223\345\205\245\350\276\223\345\207\272.cs" @@ -198,12 +198,7 @@ } DialogResult = DialogResult.OK;//将当前窗体的对话框返回值设为OK } - private void treeView1_NodeMouseClick(object sender, TreeNodeMouseClickEventArgs e) - { - dir_Ok = comboBox_Disk.Text + e.Node.FullPath; - //dir = comboBox_Disk.Text + e.Node.FullPath; - e.Node.SelectedImageIndex = e.Node.ImageIndex; - } + string tempstr = ""; private void button1_Click(object sender, EventArgs e) { diff --git a/HFS_Forms/Frm_HFSprojedits.cs b/HFS_Forms/Frm_HFSprojedits.cs index 96dd76f..3c232a1 100644 --- a/HFS_Forms/Frm_HFSprojedits.cs +++ b/HFS_Forms/Frm_HFSprojedits.cs @@ -126,16 +126,6 @@ Close(); } - - - private void TB_ProjName_KeyPress(object sender, KeyPressEventArgs e) - { - if (HFSAClass.Files_NameChar(e) == 0) - e.Handled = true; - if (e.KeyChar == '\r') - OK_Click(sender, e); - } - private void Frm_HFSProjedit_Load(object sender, EventArgs e) { @@ -175,10 +165,6 @@ } } - private void Cancel_Click(object sender, EventArgs e) - { - this.Close(); - } private void Cancel_Click_1(object sender, EventArgs e) { diff --git a/MainFrm.cs b/MainFrm.cs index 2c305a0..ed2685b 100644 --- a/MainFrm.cs +++ b/MainFrm.cs @@ -617,7 +617,7 @@ } catch (Exception ex) { - + LogHelper.WriteLog(typeof(MainFrm), ex.Message); } } @@ -1768,7 +1768,7 @@ } catch (Exception ex) { - //LogError.PublishError(ex); + LogHelper.WriteLog(typeof(MainFrm), ex.Message); } } @@ -2026,6 +2026,7 @@ } catch (Exception ex) { + LogHelper.WriteLog(typeof(MainFrm), ex.Message); result = false; } finally @@ -2316,220 +2317,6 @@ string filename = Utility.filename; List g1layername = new List(); /// - /// 构建图层列表目录树 - /// - /// - private void loadTreeView(TreeView tv) - { - try - { - XmlDocument doc = new XmlDocument(); - doc.Load(filename); - XmlNodeList Params1 = doc.SelectNodes("/Params/layers"); - tv.ShowLines = false; - tv.CheckBoxes = true; - - foreach (XmlNode paramsNode in Params1) //layers - { - foreach (XmlNode layerNode in paramsNode) //layer - { - TreeNode nodelayer = new TreeNode(); - string layerName = layerNode.Attributes["label"].Value; - nodelayer.Text = layerName; - - if (layerNode.HasChildNodes != false) - { - tv.Nodes.Add(nodelayer); - foreach (XmlNode layerchildNode in layerNode) //layerchild - { - if (layerchildNode.Name == "layerchild") - { - TreeNode nodelayerchild = new TreeNode(); - string layerType = layerchildNode.Attributes["type"].Value; - string layerName1 = layerchildNode.Attributes["layer"].Value; - string layerchildName = layerchildNode.Attributes["label"].Value; - if (layerType == "locaserver") - { - if (layerchildNode.Attributes["isRoad"] != null) - { - roadLayerName = layerchildName; - } - dictionaryNetLayerNameAndCaption.Add(layerName1, layerchildName); - - nodelayerchild.Text = layerchildName; - nodelayerchild.Tag = layerType + "|" + layerchildName; - nodelayerchild.Checked = true; - nodelayer.Nodes.Add(nodelayerchild); - } - else - { - if (layerchildNode.Attributes["isPipeLine"] != null) - { - m_PipelineLayerNames.Add(layerchildName); - } - if (layerchildNode.Attributes["isWorkWell"] != null) - { - workwellLayerNames.Add(layerchildName); - } - if (layerchildNode.Attributes["isValve"] != null) - { - valueLayerNames.Add(layerchildName); - } - //if (layerchildNode.Attributes["isInstrument"] != null) - if (layerchildNode.Attributes["isAccess"] != null) - { - instrumenLayerNames.Add(layerchildName); - } - //if (layerchildNode.Attributes["isPipeFitting"] != null) - if (layerchildNode.Attributes["isCharacter"] != null) - { - pipefittingLayerNames.Add(layerchildName); - } - bool boollayer = AddLayers(layerName1, layerchildName); - nodelayerchild.Text = layerchildName; - nodelayerchild.Tag = layerType + "|" + layerchildName; - nodelayerchild.Checked = boollayer; - if (layerchildName.Contains("特征管点")) - { - nodelayerchild.Checked = false; - setLayerVisible(layerName1); - } - - nodelayer.Nodes.Add(nodelayerchild); - g1layername.Add(layerName1); - } - } - else if (layerchildNode.Name == "layertype") - { - TreeNode nodelayerchild = new TreeNode(); - string layerType = layerchildNode.Attributes["label"].Value; - nodelayerchild.Text = layerType; - nodelayerchild.Tag = layerType; - nodelayerchild.Checked = true; - nodelayer.Nodes.Add(nodelayerchild); - if (layerchildNode.HasChildNodes == true) - { - foreach (XmlNode childNodeLayer in layerchildNode) - { - if (childNodeLayer.HasChildNodes == true) - { - TreeNode nodelayerchild2 = new TreeNode(); - string layer = childNodeLayer.Attributes["label"].Value; - nodelayerchild2.Text = layer; - nodelayerchild2.Tag = layer; - nodelayerchild2.Checked = true; - nodelayerchild.Nodes.Add(nodelayerchild2); - foreach (XmlNode n in childNodeLayer) - { - TreeNode nodelayerchild1 = new TreeNode(); - string layerName1 = n.Attributes["layer"].Value; - string layerchildName = n.Attributes["label"].Value; - string layerType1 = n.Attributes["type"].Value; - if (n.Attributes["isPipeLine"] != null) - { - m_PipelineLayerNames.Add(layerchildName); - } - if (n.Attributes["isWorkWell"] != null) - { - workwellLayerNames.Add(layerchildName); - } - if (n.Attributes["isValve"] != null) - { - valueLayerNames.Add(layerchildName); - } - if (n.Attributes["isAccess"] != null) - //if (n.Attributes["isInstrument"] != null) - { - instrumenLayerNames.Add(layerchildName); - } - if (n.Attributes["isPipeFitting"] != null) - { - pipefittingLayerNames.Add(layerchildName); - } - bool boollayer = AddLayers(layerName1, layerchildName); - nodelayerchild1.Text = layerchildName; - nodelayerchild1.Tag = layerType1 + "|" + layerchildName; - nodelayerchild1.Checked = boollayer; - if (layerchildName.Contains("特征管点")) - { - nodelayerchild1.Checked = false; - setLayerVisible(layerName1); - } - - nodelayerchild2.Nodes.Add(nodelayerchild1); - - g1layername.Add(layerName1); - } - } - else - { - TreeNode nodelayerchild1 = new TreeNode(); - string layerName1 = childNodeLayer.Attributes["layer"].Value; - string layerchildName = childNodeLayer.Attributes["label"].Value; - string layerType1 = childNodeLayer.Attributes["type"].Value; - if (childNodeLayer.Attributes["isPipeLine"] != null) - { - m_PipelineLayerNames.Add(layerchildName); - } - if (childNodeLayer.Attributes["isWorkWell"] != null) - { - workwellLayerNames.Add(layerchildName); - } - if (childNodeLayer.Attributes["isValve"] != null) - { - valueLayerNames.Add(layerchildName); - } - if (childNodeLayer.Attributes["isAccess"] != null) - //if (childNodeLayer.Attributes["isInstrument"] != null) - { - instrumenLayerNames.Add(layerchildName); - } - if (childNodeLayer.Attributes["isPipeFitting"] != null) - { - pipefittingLayerNames.Add(layerchildName); - } - bool boollayer = AddLayers(layerName1, layerchildName); - nodelayerchild1.Text = layerchildName; - nodelayerchild1.Tag = layerType1 + "|" + layerchildName; - nodelayerchild1.Checked = boollayer; - if (layerchildName.Contains("特征管点")) - { - nodelayerchild1.Checked = false; - setLayerVisible(layerName1); - } - nodelayerchild.Nodes.Add(nodelayerchild1); - g1layername.Add(layerName1); - } - } - } - } - } - } - else - { - tv.Nodes.Add(nodelayer); - } - } - } - - foreach (TreeNode tn in tv.Nodes) - { - if (tn.Nodes.Count > 0) - { - foreach (TreeNode tnChild in tn.Nodes) - { - if (tnChild.Checked) - tn.Checked = true; - } - } - } - } - catch (Exception ex) - { - //LogError.PublishError(ex); - } - } - /// /// 获取目标图层 /// /// @@ -2629,21 +2416,11 @@ } catch (Exception ex) { - //LogError.PublishError(ex); + LogHelper.WriteLog(typeof(MainFrm), ex.Message); return false; } } /// - /// 菜单上的 三维导航 工具按钮 - /// - /// - /// - private void buttonItem86_Click(object sender, EventArgs e) - { - globeControl1.Globe.Action = EnumAction3D.ActionNull; - } - - /// /// 地上模式 菜单按钮 /// /// @@ -3026,67 +2803,11 @@ } Image printImage; - /// - /// 打印 菜单 - /// - /// - /// - private void buttonItem13_Click(object sender, EventArgs e) - { - Point pt1 = new Point(Convert.ToInt32(0), Convert.ToInt32(0)); - Point pt2 = new Point(Convert.ToInt32(panelEx5.Width), Convert.ToInt32(panelEx5.Height)); - int mapWidth = 0; - int mapHeight = 0; - Point pt = getUpperLeftPoint(pt1, pt2, out mapWidth, out mapHeight); - printImage = new Bitmap(Convert.ToInt32(panelEx5.Width), Convert.ToInt32(panelEx5.Height)); - Graphics g = Graphics.FromImage(printImage); - g.CopyFromScreen(pt, new Point(0, 0), new Size(Convert.ToInt32(panelEx5.Width), Convert.ToInt32(panelEx5.Height))); - - PrintDialog pd = new PrintDialog(); - try - { - if (pd.ShowDialog() == DialogResult.OK) //如果确认,将会覆盖所有的打印参数设置 - { - //打印预览 - PrintPreviewDialog ppd = new PrintPreviewDialog(); - ppd.Document = printDocument1; - if (DialogResult.OK == ppd.ShowDialog()) - { - printDocument1.Print(); //打印 - } - } - } - catch - { - printDocument1.PrintController.OnEndPrint(printDocument1, new System.Drawing.Printing.PrintEventArgs()); - } - } - + private void printDocument1_PrintPage(object sender, System.Drawing.Printing.PrintPageEventArgs e) { e.Graphics.DrawImage(printImage, 10, 10); } - - /// - /// 在窗体的底部状态栏上显示 综合管线条件查询结果 - /// - /// - /// - private void ToolStripText(string currentLayer, int dataCount) - { - if (dataCount != 0) - { - double featurelength = PipeLength(currentLayer, 0);// 统计管线的里程数 - - toolStripNumbers.Text = " 管线类型:" + currentLayer + " | 共有:" + Convert.ToString(dataCount - 1) + "条记录"; - toolStripFeatureLength.Text = " 管线里程:" + featurelength.ToString("0.00") + " 米"; - } - else - { - toolStripNumbers.Text = "管线类型: " + currentLayer + "| 共有:" + 0 + " 条记录 | "; - } - } - /// /// 统计管线的里程数 /// @@ -3402,26 +3123,6 @@ } /// - /// 绘制线 菜单 - /// - /// - /// - private void btnAddLine_Click(object sender, EventArgs e) - { - globeControl1.Globe.DestLayerFeatureAdd = globeControl1.Globe.MemoryLayer; - globeControl1.Globe.Action = EnumAction3D.DrawPolyline; - } - /// - /// 绘制面 菜单 - /// - /// - /// - private void btnAddPolygon_Click(object sender, EventArgs e) - { - globeControl1.Globe.DestLayerFeatureAdd = globeControl1.Globe.MemoryLayer; - globeControl1.Globe.Action = EnumAction3D.DrawPolygon; - } - /// /// 图层目录树 右键菜单中的 目标图层 菜单 /// /// @@ -3956,42 +3657,7 @@ // ClearUpDownTraceAnalysis(); //} - /// - /// 显示流向 功能 - /// - /// - /// - /// - private void Flow(object sender, string pipelineNameCN, bool bShow) - { - GSOFeatureLayer layer = globeControl1.Globe.Layers.GetLayerByCaption(pipelineNameCN) as GSOFeatureLayer; - GSOFeatures feats = layer.GetAllFeatures(); - for (int i = 0; i < feats.Length; i++) - { - GSOFeature feat = feats[i]; - GSOLineStyle3D lineStyle = feat.Geometry.Style as GSOLineStyle3D; - if (lineStyle != null) - { - if (lineStyle.ArrowStyle == null) - { - lineStyle.ArrowStyle = new GSOArrowStyle(); - lineStyle.ArrowStyle.BodyWidth = 2; - lineStyle.ArrowStyle.BodyLen = 6; - lineStyle.ArrowStyle.HeadWidth = 8; - lineStyle.ArrowStyle.HeadLen = 10; - lineStyle.ArrowStyle.OutlineVisible = true; - lineStyle.ArrowStyle.OutlineColor = Color.Red; - lineStyle.ArrowStyle.Speed = lineStyle.ArrowStyle.Speed / 2; - lineStyle.ArrowStyle.Play(); - } - lineStyle.ArrowVisible = bShow; - layerTree.SelectedNode = null; - } - } - globeControl1.Globe.Refresh(); - } - - + FrmCloseValves frm; /// /// 关阀分析 功能 @@ -4030,7 +3696,9 @@ curCAYNDataset.CloseValveAnalysis(lineFeature.ID, out arryResNodeID, out arryResValveID, false, true); } catch (Exception e) - { } + { + LogHelper.WriteLog(typeof(MainFrm), e.Message); + } string valveName = lineLayer.Caption; valveName = valveName.Substring(0, valveName.IndexOf("管线")); @@ -4106,7 +3774,7 @@ } catch (Exception e) { - + LogHelper.WriteLog(typeof(MainFrm), e.Message); } //目前只有燃气管线 有阀门 string valveName = lineLayer.Name; @@ -5457,7 +5125,7 @@ } catch (Exception ex) { - //MessageBox.Show(ex.ToString()); + LogHelper.WriteLog(typeof(MainFrm), ex.Message); } finally { @@ -5501,22 +5169,6 @@ } } - - /// - /// 清除所有坑 菜单 - /// - /// - /// - private void buttonItem3_Click(object sender, EventArgs e) - { - //日志记录 - LogManager.saveLog(Utility.userName, this.buttonItem3.Text); - - globeControl1.Globe.RemoveAllPits(); - } - - - ///// ///// 净距分析 菜单 ///// @@ -5554,42 +5206,8 @@ // ribbonBarTP.Visible = buttonItem34.Checked; // ribbonBarTP.Location = new Point(0, 0); //} - /// - /// 大气层 菜单 - /// - /// - /// - private void buttonItem17_Click_1(object sender, EventArgs e) - { - globeControl1.Globe.Atmosphere.Visible = !globeControl1.Globe.Atmosphere.Visible; - buttonItemSH1.Checked = globeControl1.Globe.Atmosphere.Visible; - globeControl1.Refresh(); - } - /// - /// 经纬网 菜单 - /// - /// - /// - private void buttonItem20_Click(object sender, EventArgs e) - { - globeControl1.Globe.LatLonGrid.Visible = !globeControl1.Globe.LatLonGrid.Visible; - buttonItemSH3.Checked = globeControl1.Globe.LatLonGrid.Visible; - globeControl1.Globe.Refresh(); - } - /// - /// 状态条 菜单 - /// - /// - /// - private void buttonItem21_Click_1(object sender, EventArgs e) - { - globeControl1.Globe.StatusBar.Visible = !globeControl1.Globe.StatusBar.Visible; - buttonItemSH4.Checked = globeControl1.Globe.StatusBar.Visible; - globeControl1.Globe.Refresh(); - } - - + /// /// 添加指定路径下的数据 功能 /// @@ -5680,43 +5298,7 @@ // } // return objRes; //} - /// - /// 刷新目录树 功能 - /// - private void RefreshDataTree() - { - layerTree.Nodes[0].Nodes.Clear(); - Int32 nCount = globeControl1.Globe.DataManager.DataSourceCount; - Int32 i = 0; - for (i = 0; i < nCount; i++) - { - GSODataSource dataSpace = globeControl1.Globe.DataManager[i]; - TreeNode node = new TreeNode(); - node.Text = dataSpace.Name; - node.ImageIndex = 0; - node.SelectedImageIndex = 0; - node.Checked = true; - node.Tag = dataSpace; - Int32 nDatasetCount = dataSpace.DatasetCount; - for (Int32 j = 0; j < nDatasetCount; j++) - { - GSODataset dataset = dataSpace[j]; - TreeNode subNode = new TreeNode(); - subNode.Text = dataset.Name; - subNode.ImageIndex = 0; - subNode.SelectedImageIndex = 0; - subNode.Checked = true; - subNode.Tag = dataset; - node.Nodes.Add(subNode); - } - layerTree.Nodes[0].Nodes.Add(node); - } - } - - - - - + /// /// 复合查询 菜单 @@ -5777,34 +5359,7 @@ return false; } - /// - /// 统计指定图层在指定范围内的所有feature对象 - /// - /// - /// - /// - private GSOFeatures Intersect_PointLayer(GSOGeoPolygon3D polygon, string pointLayerName) - { - GSOLayer layer = globeControl1.Globe.Layers.GetLayerByCaption(pointLayerName); - if (layer == null) - return null; - - GSOFeatureLayer flayer = layer as GSOFeatureLayer; - GSOFeatureDataset fdataset = flayer.Dataset as GSOFeatureDataset; - GSOFeatures feats; - if (polygon == null) - { - feats = flayer.GetAllFeatures(); - } - else - { - feats = flayer.FindFeaturesInPolygon(polygon, false); - } - - workWellLen.Add(pointLayerName, feats.Length); - return feats; - } - /// + /// /// 碰撞分析功能界面中 选择管线复选框 选中状态改变事件处理 /// /// @@ -5946,16 +5501,6 @@ MessageBox.Show("表格内容为空!", "提示"); } } - /// - /// 导出CAD 菜单 - /// - /// - /// - private void btnExportCAD_Click(object sender, EventArgs e) - { - FrmExportCADS frm = new FrmExportCADS(globeControl1, m_PipelineLayerNames); - frm.ShowDialog(); - } ///// ///// 区域分析 菜单 @@ -5987,16 +5532,6 @@ } } } - /// - /// 数据验证 菜单 - /// - /// - /// - private void buttonItem80_Click(object sender, EventArgs e) - { - FrmValiData frm = new FrmValiData(globeControl1); - frm.ShowDialog(); - } /// /// 根据指定图层创建图层节点并将节点添加到图层管理节点的子节点集合中 @@ -6018,56 +5553,7 @@ layerManagerNode.Expand(); } } - /// - /// 数据库备份 菜单 - /// - /// - /// - private void btnBackDatabase_Click(object sender, EventArgs e) - { - if (MessageBox.Show("是否确定要备份数据库文件", "信息", MessageBoxButtons.YesNo, MessageBoxIcon.Question) == DialogResult.Yes) - { - try - { - DateTime currentTime = DateTime.Now; - //string Dtime = currentTime.ToShortDateString().ToString("yyyy-MM-dd"); - string Dtime = currentTime.GetDateTimeFormats('D')[0].ToString(); - string Htime = DateTime.Now.ToString("HH时mm分ss秒").Trim(); - string fileName = Dtime + "(" + Htime + ")"; - string pathName = ""; - string sql = "select filename from master..sysdatabases where name='" + Utility.dbdatabase + "'"; - DataTable dt = OledbHelper.ExecuteDataTable(sql); - if (dt != null && dt.Rows.Count > 0) - { - pathName = dt.Rows[0][0].ToString().Trim(); - int count = pathName.LastIndexOf("\\") == -1 ? pathName.LastIndexOf("/") : pathName.LastIndexOf("\\"); - pathName = pathName.Substring(0, count); - } - pathName += "\\管网数据库" + fileName + ".bak"; - - OracleCommand cmdBK = new OracleCommand(); - cmdBK.CommandType = CommandType.Text; - cmdBK.Connection = connBackup; - cmdBK.CommandText = @"backup database " + Utility.dbdatabase + " to disk='" + pathName + "' with init"; - - connBackup.Open(); - cmdBK.ExecuteNonQuery(); - MessageBox.Show("数据库文件备份成功", "提示"); - } - catch (Exception ex) - { - MessageBox.Show(ex.ToString()); - } - finally - { - connBackup.Close(); - } - } - } - - - - + //GSOFeature emitterFeature; // 粒子要素 /// /// 添加火苗 功能 @@ -6598,361 +6084,15 @@ } } - - ///// - /// 添加用户仓库 菜单 - /// - /// - /// - private void buttonItem108_Click(object sender, EventArgs e) - { - FrmUserRepo frm = new FrmUserRepo(-1); - frm.ShowDialog(); - } - /// - /// 用户仓库管理 菜单 - /// - /// - /// - private void buttonItem111_Click(object sender, EventArgs e) - { - FrmUserRepoMgr frm = new FrmUserRepoMgr(); - frm.ShowDialog(); - } - /// - /// 添加分系统 菜单 - /// - /// - /// - private void buttonItem112_Click(object sender, EventArgs e) - { - //FrmAPP frm = new FrmAPP(-1); - //frm.ShowDialog(); - } - /// - /// 分系统管理 菜单 - /// - /// - /// - private void buttonItem113_Click(object sender, EventArgs e) - { - //FrmAPPMgr frm = new FrmAPPMgr(); - //frm.ShowDialog(); - } - /// - /// 添加操作 菜单 - /// - /// - /// - private void buttonItem114_Click(object sender, EventArgs e) - { - FrmOper frm = new FrmOper(-1); - frm.ShowDialog(); - } - /// - /// 操作管理 菜单 - /// - /// - /// - private void buttonItem115_Click(object sender, EventArgs e) - { - FrmOperMgr frm = new FrmOperMgr(); - frm.ShowDialog(); - } - /// - /// 添加资源 菜单 - /// - /// - /// - private void buttonItem116_Click(object sender, EventArgs e) - { - FrmRESC frm = new FrmRESC(-1); - frm.ShowDialog(); - } - /// - /// 资源管理 菜单 - /// - /// - /// - private void buttonItem117_Click(object sender, EventArgs e) - { - FrmRESCMgr frm = new FrmRESCMgr(); - frm.ShowDialog(); - } - /// - /// 添加权限 菜单 - /// - /// - /// - private void buttonItem118_Click(object sender, EventArgs e) - { - FrmPerm frm = new FrmPerm(-1); - frm.ShowDialog(); - } - /// - /// 权限管理 菜单 - /// - /// - /// - private void buttonItem119_Click(object sender, EventArgs e) - { - FrmPermMgr frm = new FrmPermMgr(); - frm.ShowDialog(); - } - /// - /// 添加访问控制 菜单 - /// - /// - /// - private void buttonItem120_Click(object sender, EventArgs e) - { - FrmAccess frm = new FrmAccess(-1); - frm.ShowDialog(); - } - /// - /// 访问控制管理 菜单 - /// - /// - /// - private void buttonItem121_Click(object sender, EventArgs e) - { - FrmAccessMgr frm = new FrmAccessMgr(); - frm.ShowDialog(); - } - /// - /// 部门类型管理 菜单 - /// - /// - /// - private void buttonItem122_Click(object sender, EventArgs e) - { - FrmRegionTypeMgr frm = new FrmRegionTypeMgr(); - frm.ShowDialog(); - } - /// - /// 用户信息管理 菜单 - /// - /// - /// - private void buttonItem128_Click_1(object sender, EventArgs e) - { - FrmUserManager frm = new FrmUserManager(); - frm.ShowDialog(); - } - /// - /// 添加角色 菜单 - /// - /// - /// - private void 添加角色_Click(object sender, EventArgs e) - { - FrmRole frm = new FrmRole(-1); - frm.ShowDialog(); - } - /// - /// 所有角色管理 菜单 - /// - /// - /// - private void 角色管理_Click(object sender, EventArgs e) - { - FrmRoleMgr frm = new FrmRoleMgr(); - frm.ShowDialog(); - } - - /// - /// 部门角色管理 菜单 - /// - /// - /// - private void buttonItem133_Click(object sender, EventArgs e) - { - FrmRegionRoleMgr frm = new FrmRegionRoleMgr(); - frm.ShowDialog(); - } - /// - /// 部门管理 菜单 - /// - /// - /// - private void buttonItem130_Click(object sender, EventArgs e) - { - FrmRegionMgr frm = new FrmRegionMgr(); - frm.ShowDialog(); - } - - /// - /// 日志管理 菜单 - /// - /// - /// - private void buttonItem135_Click(object sender, EventArgs e) - { - FrmLogManager frm = new FrmLogManager(); - frm.ShowDialog(); - } - /// - /// 传感器信息查询 菜单 - /// - /// - /// - private void buttonItem131_Click_1(object sender, EventArgs e) - { - GSOFeature selectedFeature = globeControl1.Globe.SelectedObject; - if (selectedFeature == null) - { - MessageBox.Show("请选择一个传感器对象!", "提示", MessageBoxButtons.OK, MessageBoxIcon.Information); - } - else - { - if (selectedFeature.Geometry != null && selectedFeature.Geometry.Type == EnumGeometryType.GeoModel) - { - GSOLayer layer = globeControl1.Globe.SelectedObjectLayer; - string tabelName = getTableName(layer.Caption); - string eqtID = selectedFeature.Description.Trim(); - if (tabelName != "" && eqtID != "") - { - string fields = getFields(tabelName); - if (fields != "") - { - string sql = "select " + fields + " from " + Utility.sensorDatabase + "." + tabelName + " where EqtID=" + eqtID + " order by RecordDate desc limit 1;"; - DataTable dt = MySqlHelper.queryDataTable(sql); - if (dt != null && dt.Rows.Count > 0) - { - FrmQueryMessage.ShowForm(this, dt, layer.Caption); - //queryMessage.Show(this); - } - else - { - MessageBox.Show("没有查询到相关信息!", "提示"); - } - } - else - { - MessageBox.Show("配置文件 \"sensorConfig.xml\" 有误!", "提示"); - } - } - else - { - MessageBox.Show("请选择一个传感器对象!", "提示"); - } - } - else - { - MessageBox.Show("请选择一个传感器对象!", "提示", MessageBoxButtons.OK, MessageBoxIcon.Information); - } - } - } - /// - /// 根据指定的图层的caption属性的值在配置文件中查找对应的数据库中的表的名称 - /// - /// 图层的caption属性的值 - /// 对应的数据库中的表的名称 - private string getTableName(string name) - { - string tabelName = ""; - if (Utility.sensorMarkerLayers != null) - { - for (int i = 0; i < Utility.sensorMarkerLayers.Count; i++) - { - MarkerLayer mLayer = Utility.sensorMarkerLayers[i]; - if (mLayer.layerName == name) - { - tabelName = mLayer.tableName; - break; - } - } - } - return tabelName; - } - /// - /// 根据数据库中的表的名称 查找对应的表中的字段名称的集合 - /// - /// 数据库中的表的名称 - /// 对应的表中的字段名称的集合 - private string getFields(string tabelName) - { - string fields = ""; - if (Utility.sensorMarkerLayers != null) - { - for (int i = 0; i < Utility.sensorMarkerLayers.Count; i++) - { - MarkerLayer mLayer = Utility.sensorMarkerLayers[i]; - if (mLayer.tableName.Trim() == tabelName.Trim()) - { - if (mLayer.fields != null) - { - foreach (string key in mLayer.fields.Keys) - { - string value = mLayer.fields[key]; - fields += tabelName.Trim() + "." + key + " as " + value + ","; - } - fields = fields.Remove(fields.Length - 1); - } - break; - } - } - } - return fields; - } - - /// - /// 历史曲线查询 菜单 - /// - /// - /// - private void buttonItem132_Click(object sender, EventArgs e) - { - GSOFeature selectedFeature = globeControl1.Globe.SelectedObject; - if (selectedFeature == null) - { - MessageBox.Show("请选择一个对象!", "提示", MessageBoxButtons.OK, MessageBoxIcon.Information); - } - else - { - if (selectedFeature.Geometry != null && selectedFeature.Geometry.Type == EnumGeometryType.GeoModel) - { - GSOLayer layer = globeControl1.Globe.SelectedObjectLayer; - string tabelName = getTableName(layer.Caption); - string eqtID = selectedFeature.Description; - if (tabelName != "" && eqtID != "") - { - FrmQueryHistory.ShowForm(this, tabelName, eqtID); - } - else - { - MessageBox.Show("请选择一个传感器对象!", "提示"); - } - } - else - { - MessageBox.Show("请选择一个传感器对象!", "提示", MessageBoxButtons.OK, MessageBoxIcon.Information); - } - } - } - + //定时检查传感器的状态 public System.Windows.Forms.Timer timerOfSensor = null; public int alarmValueLiuLiang = 0; public int alarmValueYaLi = 0; public int alarmValueYeTi = 0; public int alarmValueZaoSheng = 0; - /// - /// 传感器在线报警 菜单 - /// - /// - /// - private void buttonItem134_Click(object sender, EventArgs e) - { - if (timerOfSensor == null) - { - timerOfSensor = new System.Windows.Forms.Timer(); - timerOfSensor.Interval = 30000; - timerOfSensor.Tick += new EventHandler(timerOfSensor_Tick); - } - FrmQuerySensorAlarm.ShowForm(this); - } + /// /// 传感器报警 功能中的 定时器 的触发事件处理 /// @@ -7016,6 +6156,7 @@ } catch (Exception ex) { + LogHelper.WriteLog(typeof(MainFrm), ex.Message); continue; } } @@ -7025,145 +6166,7 @@ } } - - /// - /// 沿线运动 菜单 - /// - /// - /// - private void buttonItem138_Click(object sender, EventArgs e) - { - if (globeControl1.Globe.SelectedObject == null) - { - MessageBox.Show("请先选择一条线!", "提示", MessageBoxButtons.OK, MessageBoxIcon.Exclamation); - return; - } - - GSOFeature lineFeature = globeControl1.Globe.SelectedObject; - if (lineFeature.Geometry == null || lineFeature.Geometry.Type != EnumGeometryType.GeoPolyline3D) - { - MessageBox.Show("请先选择一条线!", "提示", MessageBoxButtons.OK, MessageBoxIcon.Exclamation); - return; - } - - OpenFileDialog dlg = new OpenFileDialog(); - dlg.Filter = "*.gcm;*.3ds|*.gcm;*.3ds|*.3ds|*.3ds|*.gcm|*.gcm"; - if (dlg.ShowDialog() == DialogResult.OK) - { - GSOGeoModel model = new GSOGeoModel(); - model.FilePath = dlg.FileName; - - GSOGeoDynamicRoute dynamicRoute = new GSOGeoDynamicRoute(); - dynamicRoute.ActorGeometry = model; - - GSORoute route = new GSORoute(); - GSOGeoPolyline3D geoline = (GSOGeoPolyline3D)lineFeature.Geometry; - for (int i = 0; i < geoline[0].Count; i++) - { - route.Add(geoline[0][i]); - } - route.CircleRoute = false; - route.Speed = 30; - route.RotateSpeed = 50; - route.AltitudeMode = geoline.AltitudeMode; - dynamicRoute.Route = route; - - GSOFeature feature = new GSOFeature(); - - dynamicRoute.Play(); - feature.Geometry = dynamicRoute; - - //GSOLabel gsoLabel = new GSOLabel(); - //gsoLabel.Text = "模型测试"; - //feature.Label = gsoLabel; - globeControl1.Globe.MinModelVisibleSize = 0; - - globeControl1.Globe.MemoryLayer.AddFeature(feature); - globeControl1.Globe.Refresh(); - } - } - /// - /// 回退 菜单 - /// - /// - /// - private void buttonItem99_Click(object sender, EventArgs e) - { - globeControl1.Globe.UnDoEdit(); - } - /// - /// 前进 菜单 - /// - /// - /// - private void buttonItem100_Click(object sender, EventArgs e) - { - globeControl1.Globe.ReDoEdit(); - } - /// - /// 水平净距 功能界面中的 标签内容改变事件处理 - /// - /// - /// - private void textBoxX4_TextChanged(object sender, EventArgs e) - { - string valueJingJu = textBoxX4.Text.Trim(); - if (valueJingJu != "") - { - double value = 0; - bool bl = double.TryParse(valueJingJu, out value); - if (bl) - { - labelX24.Text = "水平净距小于" + value.ToString() + "米的管线有:"; - } - } - } - /// - /// 垂直净距 功能界面中的 标签内容改变事件处理 - /// - /// - /// - private void textBoxX2_TextChanged(object sender, EventArgs e) - { - string valueJingJu = textBoxX2.Text.Trim(); - if (valueJingJu != "") - { - double value = 0; - bool bl = double.TryParse(valueJingJu, out value); - if (bl) - { - labelX23.Text = "垂直净距小于" + value.ToString() + "米的管线有:"; - } - } - } - /// - /// 覆土分析 功能界面中的 标签内容改变事件处理 - /// - /// - /// - private void textBoxX3_TextChanged(object sender, EventArgs e) - { - string valueJingJu = textBoxX3.Text.Trim(); - if (valueJingJu != "") - { - double value = 0; - bool bl = double.TryParse(valueJingJu, out value); - if (bl) - { - labelX17.Text = "覆土深度小于" + value.ToString() + "米的管线有:"; - } - } - } - - /// - /// 传感器分类查询 全区域 菜单 - /// - /// - /// - private void buttonItemSensor全区域查询_Click(object sender, EventArgs e) - { - FrmAccessoriesSensor.ShowForm(globeControl1, instrumenLayerNames, 0); - } + /// /// 传感器分类查询 绘制区域 菜单 /// @@ -7224,170 +6227,10 @@ layerTemp.RemoveAllFeature(); globeControl1.Refresh(); } - /// - /// 数字预处理 功能 - /// - /// - /// - private void 数字预处理buttonItem140_Click(object sender, EventArgs e) - { - FrmEditShapeFile frm = new FrmEditShapeFile(globeControl1); - frm.ShowDialog(this); - } - - - /// - /// 导出矢量 功能 将图层导出为kml和shp格式数据 - /// - /// - /// - private void 导出矢量buttonItem140_Click(object sender, EventArgs e) - { - /* - List m_PipelineLayerNames = new List();//线图层名称 - List workwellLayerNames = new List();//工井图层名称 - List valueLayerNames = new List();//阀门图层名称 - List instrumenLayerNames = new List();//附属物图层名称 - List pipefittingLayerNames = new List();//管件图层名称 - */ - List listVectorNames = new List(); - for (int i = 0; i < m_PipelineLayerNames.Count; i++) - { - if (m_PipelineLayerNames[i] == "移动" || m_PipelineLayerNames[i] == "联通" - || m_PipelineLayerNames[i] == "电信" || m_PipelineLayerNames[i] == "共通" - || m_PipelineLayerNames[i] == "有限电视" || m_PipelineLayerNames[i] == "交通信号" - || m_PipelineLayerNames[i] == "供电") - { - continue; - } - if (listVectorNames.Contains(m_PipelineLayerNames[i]) == false) - { - listVectorNames.Add(m_PipelineLayerNames[i]); - } - } - for (int i = 0; i < valueLayerNames.Count; i++) - { - if (listVectorNames.Contains(valueLayerNames[i]) == false) - { - listVectorNames.Add(valueLayerNames[i]); - } - } - for (int i = 0; i < workwellLayerNames.Count; i++) - { - if (listVectorNames.Contains(workwellLayerNames[i]) == false) - { - listVectorNames.Add(workwellLayerNames[i]); - } - } - for (int i = 0; i < instrumenLayerNames.Count; i++) - { - if (listVectorNames.Contains(instrumenLayerNames[i]) == false) - { - listVectorNames.Add(instrumenLayerNames[i]); - } - } - for (int i = 0; i < pipefittingLayerNames.Count; i++) - { - if (listVectorNames.Contains(pipefittingLayerNames[i]) == false) - { - listVectorNames.Add(pipefittingLayerNames[i]); - } - } - FrmExportVector frm = new FrmExportVector(globeControl1, listVectorNames); - frm.ShowDialog(); - } string citySevenLineType = ""; string cityServerLineName = ""; /// - /// 绘制城市七线 功能按钮 - /// - /// - /// - private void 绘制城市七线buttonItem140_Click(object sender, EventArgs e) - { - FrmCitySevenLineType frm = new FrmCitySevenLineType(); - if (frm.ShowDialog() == DialogResult.OK) - { - globeControl1.Globe.Action = EnumAction3D.DrawPolyline; - m_isDrawCitySevenLine = true; - m_isDrawTunnel = false; - m_AddPipeLine = false; - this.citySevenLineType = frm.citySevenLineType; - this.cityServerLineName = frm.citySevenLineName; - switch (frm.citySevenLineType) - { - case "城市红线": - GSOLayer layerRed = globeControl1.Globe.Layers.GetLayerByCaption(frm.citySevenLineType); - if (layerRed != null) - { - globeControl1.Globe.DestLayerFeatureAdd = layerRed; - layerRed.Editable = true; - } - break; - case "城市橙线": - GSOLayer layerOrange = globeControl1.Globe.Layers.GetLayerByCaption(frm.citySevenLineType); - if (layerOrange != null) - { - globeControl1.Globe.DestLayerFeatureAdd = layerOrange; - layerOrange.Editable = true; - } - break; - case "城市黄线": - GSOLayer layerYellow = globeControl1.Globe.Layers.GetLayerByCaption(frm.citySevenLineType); - if (layerYellow != null) - { - globeControl1.Globe.DestLayerFeatureAdd = layerYellow; - layerYellow.Editable = true; - } - break; - case "城市绿线": - GSOLayer layerGreen = globeControl1.Globe.Layers.GetLayerByCaption(frm.citySevenLineType); - if (layerGreen != null) - { - globeControl1.Globe.DestLayerFeatureAdd = layerGreen; - layerGreen.Editable = true; - } - break; - case "城市蓝线": - GSOLayer layerBlue = globeControl1.Globe.Layers.GetLayerByCaption(frm.citySevenLineType); - if (layerBlue != null) - { - globeControl1.Globe.DestLayerFeatureAdd = layerBlue; - layerBlue.Editable = true; - } - break; - case "城市紫线": - GSOLayer layerPurple = globeControl1.Globe.Layers.GetLayerByCaption(frm.citySevenLineType); - if (layerPurple != null) - { - globeControl1.Globe.DestLayerFeatureAdd = layerPurple; - layerPurple.Editable = true; - } - break; - case "城市黑线": - GSOLayer layerBlack = globeControl1.Globe.Layers.GetLayerByCaption(frm.citySevenLineType); - if (layerBlack != null) - { - globeControl1.Globe.DestLayerFeatureAdd = layerBlack; - layerBlack.Editable = true; - } - break; - } - } - } - /// - /// 七线审核 功能按钮 - /// - /// - /// - private void 七线审核buttonItem141_Click(object sender, EventArgs e) - { - FrmCityServerLineAnalysis frm = new FrmCityServerLineAnalysis(globeControl1, m_PipelineLayerNames); - frm.ShowDialog(this); - } - - /// /// 间距分析 开始分析按钮 分析绘制的七线和管线的距离是否符合标准 /// /// @@ -7666,25 +6509,6 @@ } } - - - /// - /// 管线自动缩进 菜单 - /// - /// - /// - private void 管线自动缩进buttonItem140_Click(object sender, EventArgs e) - { - FrmPipelineIndented frm = new FrmPipelineIndented(globeControl1, m_PipelineLayerNames, workwellLayerNames); - frm.ShowDialog(this); - } - - private void btnExportCADs_Click(object sender, EventArgs e) - { - - } - - /// /// 统计指定图层在指定范围内的所有feature对象 /// @@ -7755,8 +6579,6 @@ } - - //设置图层为隐藏 private void setLayerVisible(string layerName) { @@ -7765,27 +6587,7 @@ globeControl1.Globe.Refresh(); } - /// - /// 连接数据库 - /// - /// - /// - private void buttonItem129_Click(object sender, EventArgs e) - { - //保存日志 - LogManager.saveLog(Utility.userName, this.buttonItemSJGL4_1.Text); - - FrmDatabaseParaSetting2 frm = new FrmDatabaseParaSetting2(globeControl1); - if (frm.ShowDialog() == DialogResult.OK) - { - ds = FrmDatabaseParaSetting2.ds; - if (ds != null) - { - ds.IsCloseSaved = false; - } - } - } - + /// /// 清除渲染结果 /// @@ -7803,112 +6605,8 @@ layerTemp.RemoveAllFeature(); globeControl1.Refresh(); } - - /// - /// 绘制垂线 - /// - /// - /// - private void drawCLine(GSOPoint3d fpt, GSOPoint3d tpt) - { - GSOGeoPolyline3D pline = new GSOGeoPolyline3D(); - GSOPoint3ds pts = new GSOPoint3ds(); - pts.Add(fpt); - pts.Add(tpt); - pline.AddPart(pts); - - GSOGeoPoint3D fptg = new GSOGeoPoint3D(); - GSOGeoPoint3D tptg = new GSOGeoPoint3D(); - fptg.X = fpt.X; - fptg.Y = fpt.Y; - fptg.Z = 0; - tptg.X = tpt.X; - tptg.Y = tpt.Y; - tptg.Z = 0; - - GSOFeature gf = new GSOFeature(); - gf.Geometry = pline; - - globeControl1.Globe.MemoryLayer.AddFeature(gf); - - } - /// - /// 红线审核 - /// - /// - /// - private void buttonItem138_Click_2(object sender, EventArgs e) - { - - } - /// - /// 比较两个点是否是同一个点 - /// - /// - /// - /// - private bool comparePoint(GSOPoint3d pt1, GSOPoint3d pt2) - { - double x1 = 0; double y1 = 0; - double x2 = 0; double y2 = 0; - x1 = pt1.X; - y1 = pt1.Y; - x2 = pt2.X; - y2 = pt2.Y; - if ((x1 == x2) && (y1 == y2)) - { - return true; - } - return false; - } - /// - /// 获得点到线的垂线距离及垂点 - /// - /// - /// - /// - /// - private void comparePointLine(GSOPoint3d point, GSOGeoPolyline3D line, out double length, out GSOPoint3d pointChuiDian) - { - GSOPoint3d lineStartPoint = line[0][0]; - GSOPoint3d lineEndPoint = line[0][1]; - GSOGeoPolyline3D lineAB = new GSOGeoPolyline3D(); - GSOPoint3ds pointsAB = new GSOPoint3ds(); - pointsAB.Add(point); - pointsAB.Add(lineStartPoint); - lineAB.AddPart(pointsAB); - double lengthAB = lineAB.GetSpaceLength(false, 6378137.0); - double xieLvAB = getXieLu("", point.X, point.Y, lineStartPoint.X, lineStartPoint.Y); - double xieLvBC = getXieLu("", lineStartPoint.X, lineStartPoint.Y, lineEndPoint.X, lineEndPoint.Y); - - double tanABC = Math.Abs(xieLvAB - xieLvBC) / (1 + xieLvAB * xieLvBC); - double angle = Math.Atan(tanABC); - //if (angle > Math.PI / 2) //落在外边 - //{ - // length = 0; - //} - double lengthAD = lengthAB * Math.Sin(angle); - length = Math.Abs(lengthAD); - double lengthBD = lengthAB * Math.Cos(angle); - - GSOPoint2d point2dStart = Latlon_2_XYZ(lineStartPoint.X, lineStartPoint.Y); - double bBC = point2dStart.Y - xieLvBC * point2dStart.X; - GSOPoint2d point2dEnd = new GSOPoint2d(); - point2dEnd.X = point2dStart.X + 100; - point2dEnd.Y = point2dEnd.X * xieLvBC + bBC; - point2dEnd = XYZ_2_Latlon(point2dEnd.X, point2dEnd.Y); - - GSOPoint3d pointEnd = new GSOPoint3d(); - pointEnd.X = point2dEnd.X; - pointEnd.Y = point2dEnd.Y; - GSOGeoPolyline3D lineYanShen = new GSOGeoPolyline3D(); - GSOPoint3ds pointsYanShen = new GSOPoint3ds(); - pointsYanShen.Add(lineStartPoint); - pointsYanShen.Add(pointEnd); - lineYanShen.AddPart(pointsYanShen); - GSOGeoPolyline3D lineSegment = lineYanShen.GetSegment(0, lengthBD); - pointChuiDian = lineSegment[0][1]; - } + + /// /// 获得斜率 /// @@ -8044,255 +6742,6 @@ } /// - /// 获取与点相连的所有线以及线的点的集合 - /// - /// 选定的点所在的线 - /// 选定的点 - /// 面中不完全包含的除起点线之外所有的线 - /// 选定的点所在的点的集合 - /// 所有以选定线为起点的点的集合 - /// - private List getFeaturesPoints(GSOFeature featureSelect, GSOPoint3d lineStart, GSOFeatures selectFeatures, GSOPoint3ds ps, List listPS) - { - GSOFeatures fsStart = new GSOFeatures(); - for (int n = 0; n < selectFeatures.Length; n++) - { - if (featureSelect.ID == selectFeatures[n].ID) - { - continue; - } - GSOGeoPolyline3D newLine = selectFeatures[n].Geometry as GSOGeoPolyline3D; - if (newLine != null && newLine.PartCount > 0) - { - GSOPoint3d newLineStart = newLine[0][0]; - GSOPoint3d newLineEnd = newLine[0][newLine[0].Count - 1]; - if (lineStart.X == newLineEnd.X && lineStart.Y == newLineEnd.Y) - { - GSOPoint3ds psAdd = new GSOPoint3ds(); - for (int k = newLine[0].Count - 1; k >= 0; k--) - { - psAdd.Add(newLine[0][k]); - } - newLine[0] = psAdd; - fsStart.Add(selectFeatures[n]); - - } - else if (lineStart.X == newLineStart.X && lineStart.Y == newLineStart.Y) - { - fsStart.Add(selectFeatures[n]); - - } - } - } - if (fsStart.Length > 0) - { - for (int m = 0; m < fsStart.Length; m++) - { - GSOGeoPolyline3D lineFsStart = fsStart[m].Geometry as GSOGeoPolyline3D; - if (lineFsStart != null && lineFsStart.PartCount > 0) - { - GSOPoint3ds psAdd = ps.Clone(); - for (int k = 0; k < lineFsStart[0].Count; k++) - { - psAdd.Add(lineFsStart[0][k]); - } - listPS = getFeaturesPoints(fsStart[m], lineFsStart[0][lineFsStart[0].Count - 1], selectFeatures, psAdd, listPS); - } - } - } - else - { - listPS.Add(ps); - } - return listPS; - } - - /// - /// 获取切割面的线 - /// - /// 不完全包含在面中的所有线 - /// 完全包含在面中的所有线 - /// 线 - private GSOFeature getLineFromGSOFeatures(GSOFeatures features, GSOFeatures featuresTrue) - { - //1. 当线对象数组的长度为0时,返回空 - if (features.Length == 0) - { - return null; - } - //2. 当线对象数组的长度为1时,返回这条线 - if (features.Length == 1) - { - return features[0]; - } - //3. 当线对象数组的长度大于1时,计算所有线组成的最长线 - - //3.1 获取所有不完全包含在面中的对象selectFeatures - GSOFeatures selectFeatures = new GSOFeatures(); - for (int a = 0; a < features.Length; a++) - { - selectFeatures.Add(features[a].Clone()); - } - //3.2 删除features中完全包含在面中的线,获取和面的边界相交的线对象 - for (int a = 0; a < featuresTrue.Length; a++) - { - for (int b = 0; b < features.Length; b++) - { - if (featuresTrue[a].ID == features[b].ID) - { - features.Remove(b); - break; - } - } - } - //3.3 如果和面的边界相交的线的数量为0,返回空 - if (features.Length == 0) - { - return null; - } - //3.4 获取第一条和面的边界相交的线featureInOutPolygon - GSOFeature featureInOutPolygon = features[0]; - //3.5 从所有的线中删除featureInOutPolygon - for (int a = 0; a < selectFeatures.Length; a++) - { - if (selectFeatures[a].ID == featureInOutPolygon.ID) - { - selectFeatures.Remove(a); - break; - } - } - //listPS存储所有从featureInOutPolygon出发的点的集合 - List listPS = new List(); - //3.5 获取与featureInOutPolygon相连的线的集合 - GSOGeoPolyline3D line = featureInOutPolygon.Geometry as GSOGeoPolyline3D; - if (line != null && line.PartCount > 0) - { - GSOPoint3d lineStart = line[0][0]; - GSOPoint3d lineEnd = line[0][line[0].Count - 1]; - #region//获取和featureInOutPolygon的起点相连的线 - GSOFeatures fsStart = new GSOFeatures(); - for (int n = 0; n < selectFeatures.Length; n++) - { - GSOGeoPolyline3D newLine = selectFeatures[n].Geometry as GSOGeoPolyline3D; - if (newLine != null && newLine.PartCount > 0) - { - GSOPoint3d newLineStart = newLine[0][0]; - GSOPoint3d newLineEnd = newLine[0][newLine[0].Count - 1]; - if (lineStart.X == newLineEnd.X && lineStart.Y == newLineEnd.Y) - { - GSOPoint3ds psAdd = new GSOPoint3ds(); - for (int k = newLine[0].Count - 1; k >= 0; k--) - { - psAdd.Add(newLine[0][k]); - } - newLine[0] = psAdd; - fsStart.Add(selectFeatures[n]); - - } - else if (lineStart.X == newLineStart.X && lineStart.Y == newLineStart.Y) - { - fsStart.Add(selectFeatures[n]); - } - } - } - #endregion - - #region//获取和featureInOutPolygon的终点相连的线 - GSOFeatures fsEnd = new GSOFeatures(); - for (int n = 0; n < selectFeatures.Length; n++) - { - GSOGeoPolyline3D newLine = selectFeatures[n].Geometry as GSOGeoPolyline3D; - if (newLine != null && newLine.PartCount > 0) - { - GSOPoint3d newLineStart = newLine[0][0]; - GSOPoint3d newLineEnd = newLine[0][newLine[0].Count - 1]; - if (lineEnd.X == newLineStart.X && lineEnd.Y == newLineStart.Y) - { - fsEnd.Add(selectFeatures[n]); - - } - else if (lineEnd.X == newLineEnd.X && lineEnd.Y == newLineEnd.Y) - { - GSOPoint3ds psAdd = new GSOPoint3ds(); - for (int k = newLine[0].Count - 1; k >= 0; k--) - { - psAdd.Add(newLine[0][k]); - } - newLine[0] = psAdd; - fsEnd.Add(selectFeatures[n]); - - } - } - } - #endregion - - //3.6 将featureInOutPolygon的所有点和与之起点相连的线的所有点组成一个点的集合并添加到listPS中 - if (fsStart.Length > 0 && fsEnd.Length == 0) - { - for (int m = 0; m < fsStart.Length; m++) - { - GSOGeoPolyline3D lineFsStart = fsStart[m].Geometry as GSOGeoPolyline3D; - if (lineFsStart != null && lineFsStart.PartCount > 0) - { - GSOPoint3ds psAdd = new GSOPoint3ds(); - for (int k = line[0].Count - 1; k >= 0; k--) - { - psAdd.Add(line[0][k]); - } - for (int k = 0; k < lineFsStart[0].Count; k++) - { - psAdd.Add(lineFsStart[0][k]); - } - - listPS = getFeaturesPoints(fsStart[m], lineFsStart[0][lineFsStart[0].Count - 1], selectFeatures, psAdd, listPS); - - } - } - } - //3.6 将featureInOutPolygon的所有点和与之终点相连的线的所有点组成一个点的集合并添加到listPS中 - else if (fsStart.Length == 0 && fsEnd.Length > 0) - { - for (int n = 0; n < fsEnd.Length; n++) - { - GSOGeoPolyline3D lineFsEnd = fsEnd[n].Geometry as GSOGeoPolyline3D; - if (lineFsEnd != null && lineFsEnd.PartCount > 0) - { - GSOPoint3ds psAdd = new GSOPoint3ds(); - for (int k = 0; k < line[0].Count - 1; k++) - { - psAdd.Add(line[0][k]); - } - for (int k = 0; k < lineFsEnd[0].Count; k++) - { - psAdd.Add(lineFsEnd[0][k]); - } - //获取线fsEnd[n]的另一个端点相连的线并记录该线的点的集合 - listPS = getFeaturesPoints(fsEnd[n], lineFsEnd[0][lineFsEnd[0].Count - 1], selectFeatures, psAdd, listPS); - } - } - } - } - - //3.7 获取所有以featureInOutPolygon为起点的点的集合组成的线中的最长的线 - double maxLength = 0; - GSOFeature featureNew = new GSOFeature(); - for (int h = 0; h < listPS.Count; h++) - { - GSOGeoPolyline3D lineNew = new GSOGeoPolyline3D(); - lineNew.AddPart(listPS[h]); - GSOLabel label = new GSOLabel(); - label.Text = h.ToString(); - featureNew.Label = label; - double length = lineNew.GetSpaceLength(true, 6378137); - if (length > maxLength) - { - featureNew.Geometry = lineNew; - } - } - - return featureNew; - } - /// /// 更新最大最小状态 /// /// @@ -8340,219 +6789,6 @@ - private void buttonItem139_Click(object sender, EventArgs e) - { - - string filepath = ""; - //日志记录 - OpenFileDialog dlg = new OpenFileDialog(); - dlg.Filter = "矢量数据(*.shp)|*.shp|矢量数据(*.lgd)|*.lgd|全部支持格式(*.lgd,*.shp)|*.lgd;*.shp;"; - //dlg.Filter = "支持格式(*.lrp,*.tif,*.img,*.lrc,*.kml,*.lgd,*.shp,*.gft)|*.lrp;*.tif;*.img;*.lrc;*.kml;*.lgd;*.shp;*.gft|栅格数据(*.lrp)|*.lrp|栅格缓存(*.lrc)|*.lrc|KML数据(*.kml)|*.kml|矢量数据(*.lgd)|*.lgd|矢量缓存(*.gft)|*.gft|其它格式(*.*)|*.*||"; - dlg.Multiselect = true; - if (dlg.ShowDialog() == DialogResult.OK) - { - //自定义lprj文件名,从程序中复制一lprj文件。 - int bindex = dlg.FileName.Split('\\').Length; - string lastname = dlg.FileName.Split('\\')[bindex - 1]; - - for (int i = 0; i < dlg.FileNames.Length; i++) - { - string strDataPath = dlg.FileNames[i]; - filepath = strDataPath; - - GSOLayer layer = globeControl1.Globe.Layers.Add(strDataPath); - - } - - } - //放大到红线 - - - // globeControl1.Globe.Layers.MoveTo(0, globeControl1.Globe.Layers.Count - 1); - // globeControl1.Globe.Layers.MoveTo(0,4); - globeControl1.Refresh(); - - - } - /// - /// - /// - /// - /// - private void buttonItem142_Click(object sender, EventArgs e) - { - //获得红线polygon - //GSOLayer layerSevenLine = globeControl1.Globe.Layers.GetLayerByCaption(redlinelayername); - - GSOLayer layerSevenLine = globeControl1.Globe.Layers.Add("D:\\data\\歌林小镇shp\\test.shp"); - //获得红线结果列表 - ArrayList rrLists = new ArrayList(); - - //if (redlinelayername != "") - { - GSOFeatures fs = layerSevenLine.GetAllFeatures(); - int len = fs.Length; - - GSOGeoPolygon3D sevenPolygon = new GSOGeoPolygon3D(); - for (int k = 0; k < len; k++) - {//多根红线 - ///////生成红线区域/////// - GSOFeature featSevenLine = layerSevenLine.GetAt(k); - GSOGeoPolyline3D sevenLine = featSevenLine.Geometry as GSOGeoPolyline3D; - - List sevenParts = new List(); - for (int i = 0; i < sevenLine.PartCount; i++) - { - sevenParts.Add(sevenLine[i]); - } - for (int i = 0; i < sevenParts.Count; i++) - { - sevenPolygon.AddPart((GSOPoint3ds)sevenParts[i]); - } - /////拼出红线多边形over////// - - } - //GSOLayer layer = globeControl1.Globe.Layers.GetLayerByCaption("天然气管线"); - - GSOLayer layer = globeControl1.Globe.Layers.Add("C:\\Users\\nn-203\\Desktop\\xiaobai\\test.lgd"); - //线切割面定义,输出用 - GSOFeatures resFeats = new GSOFeatures(); - int resultstyle = 0; - //管线切割红线区域后,面积较小的区域 - GSOGeoPolygon3D restPoly = new GSOGeoPolygon3D(); - List inpts = new List(); - if (layer != null) - { - //红线区域 - GSOFeature sevenfeature = new GSOFeature(); - sevenfeature.Geometry = sevenPolygon; - - //获取不完全包含在面中的所有线 - GSOFeatures feats = layer.FindFeaturesInPolygon(sevenPolygon, false); - //获取完全包含在面中的所有线 - GSOFeatures featsTrue = layer.FindFeaturesInPolygon(sevenPolygon, true); - //获取面中所有对象组成的切割面的长线 - GSOFeature feature = new GSOFeature(); - - feature = getLineFromGSOFeatures(feats, featsTrue);//管线多个feature拼成一个feature - - //globeControl1.Globe.MemoryLayer.AddFeature(feature); - //globeControl1.Globe.MemoryLayer.AddFeature(sevenfeature); - if (feature != null) - { - //线切割面,输出 - //feature.HighLight = true; - GSODataEngineUtility.GSLineClipPolygon(feature, sevenfeature, out resFeats, out resultstyle); - } - else - { - MessageBox.Show("没有找到切割面的线对象!"); - } - ////////////////绘制分割后的多边形/////////////// - for (int a = 0; a < resFeats.Length; a++) - { - - GSOFeature gf = resFeats[1]; - globeControl1.Globe.MemoryLayer.AddFeature(gf); - - } - } - - - } - } - - private void buttonItem143_Click(object sender, EventArgs e) - { - //获得红线polygon - GSOLayer layerSevenLine = globeControl1.Globe.Layers.Add("d:\\lineAndPolygon.lgd"); - GSOLayer layerSevenLine2 = globeControl1.Globe.Layers.GetLayerByCaption("d:\\lineAndPolygon.lgd"); - //获得红线结果列表 - ArrayList rrLists = new ArrayList(); - - - // if (redlinelayername != "") - { - GSOFeatures fs = layerSevenLine.GetAllFeatures(); - int len = fs.Length; - - GSOGeoPolyline3D linetest = new GSOGeoPolyline3D(); - GSOGeoPolygon3D sevenPolygon = new GSOGeoPolygon3D(); - - GSOFeature linefeat = fs.FindByID(2); - //linefeat.Geometry = linetest; - GSOFeature polyfeat = fs.FindByID(1); - //polyfeat.Geometry = sevenPolygon; - - //线切割面定义,输出用 - GSOFeatures resFeats = new GSOFeatures(); - int resultstyle = 0; - GSODataEngineUtility.GSLineClipPolygon(linefeat, polyfeat, out resFeats, out resultstyle); - - ////////////////绘制分割后的多边形/////////////// - for (int a = 0; a < resFeats.Length; a++) - { - - GSOFeature gf = resFeats[0]; - globeControl1.Globe.MemoryLayer.AddFeature(gf); - - } - ////把红线切成一段段的线段,获得切前的红线点集 - List redpts = new List();//切前的红线点集合 - for (int i = 0; i < linetest.PartCount; i++) - { - GSOPoint3ds partP = linetest[i]; - for (int j = 0; j < partP.Count; j++) - { - redpts.Add(partP[j]); - } - } - - List redpts2 = new List();//切前的红线点集合 - for (int i = 0; i < sevenPolygon.PartCount; i++) - { - GSOPoint3ds partP = sevenPolygon[i]; - for (int j = 0; j < partP.Count; j++) - { - redpts2.Add(partP[j]); - } - } - } - } - /// - /// 增加用户手册下载连接 - /// - /// - /// - Cyberpipe.udfiles.UpDownFile UDF = new udfiles.UpDownFile(Utility.udserviceurl); - string dir_Ok = "C:\\Users\\nn-203\\Desktop"; - private void button1_Click(object sender, EventArgs e) - { - if (folderBrowserDialog1.ShowDialog() == DialogResult.OK) //打洙?开a文?件t夹D对?话°框ò - { - dir_Ok = folderBrowserDialog1.SelectedPath; //显?示?选?择?的?文?件t夹D路·径? - - //tempstr = folderBrowserDialog1.SelectedPath; //存?储洹?选?择?的?文?件t夹D路·径? - - } - - Cyberpipe.PED_logicfile.PED_Affair.Redact_D = Utility.uploadpath + "\\SFiles\\UserHbook\\说明.docx"; - if (File.Exists(dir_Ok + "\\" + Files_Name(Cyberpipe.PED_logicfile.PED_Affair.Redact_D, 1))) - { - if (MessageBox.Show("文件夹下有同名文件,是否替换?", "提示", MessageBoxButtons.YesNo, MessageBoxIcon.Information) == DialogResult.No) ; - - } - byte[] file = UDF.Down(Cyberpipe.PED_logicfile.PED_Affair.Redact_D); - FileStream pFileSream = new FileStream(dir_Ok + "\\说明.docx", FileMode.OpenOrCreate); - pFileSream.Write(file, 0, file.Length); - pFileSream.Close(); - if (File.Exists(dir_Ok + "\\" + Files_Name(Cyberpipe.PED_logicfile.PED_Affair.Redact_D, 1)) == true) - { - MessageBox.Show("文件导出成功!"); - } - //PEDAClass.Folder_Handle(dir_Ok + "\\" + PEDAClass.Files_Name(Cyberpipe.PED_logicfile.PED_Affair.Redact_D, 0), Cyberpipe.PED_logicfile.PED_Affair.Redact_D, "", 0); - - } /// /// 获取文件或文件夹的名称 /// @@ -8575,33 +6811,6 @@ return DF_Name; } - private void toolStripDropDownButton1_Click(object sender, EventArgs e) - { - if (folderBrowserDialog1.ShowDialog() == DialogResult.OK) //打洙?开a文?件t夹D对?话°框ò - { - dir_Ok = folderBrowserDialog1.SelectedPath; //显?示?选?择?的?文?件t夹D路·径? - - //tempstr = folderBrowserDialog1.SelectedPath; //存?储洹?选?择?的?文?件t夹D路·径? - - - Cyberpipe.PED_logicfile.PED_Affair.Redact_D = Utility.uploadpath + "\\SFiles\\UserHbook\\说明.docx"; - if (File.Exists(dir_Ok + "\\" + Files_Name(Cyberpipe.PED_logicfile.PED_Affair.Redact_D, 1))) - { - if (MessageBox.Show("文件夹下有同名文件,是否替换?", "提示", MessageBoxButtons.YesNo, MessageBoxIcon.Information) == DialogResult.No) ; - - } - byte[] file = UDF.Down(Cyberpipe.PED_logicfile.PED_Affair.Redact_D); - FileStream pFileSream = new FileStream(dir_Ok + "\\说明.docx", FileMode.OpenOrCreate); - pFileSream.Write(file, 0, file.Length); - pFileSream.Close(); - if (File.Exists(dir_Ok + "\\" + Files_Name(Cyberpipe.PED_logicfile.PED_Affair.Redact_D, 1)) == true) - { - MessageBox.Show("文件导出成功!"); - } - - } - } - /// /// 空间查询 /// @@ -9792,7 +8001,7 @@ GSOLayer resLayer = null; GSOFeature resFeature = null; globeControl1.Globe.GetSelectObject(0, out resFeature, out resLayer); - + if (resFeature == null) return; GSOGeoPolyline3D line1 = resFeature.Geometry as GSOGeoPolyline3D; if (line1 == null) { @@ -9876,7 +8085,7 @@ GSOLayer resLayer = null; GSOFeature resFeature = null; globeControl1.Globe.GetSelectObject(0, out resFeature, out resLayer); - + if (resFeature == null) return; GSOGeoPolyline3D line1 = resFeature.Geometry as GSOGeoPolyline3D; if (line1 == null) { @@ -9891,7 +8100,8 @@ } GSOFeatures feats = globeControl1.Globe.MemoryLayer.GetFeatureByName("粒子要素", true); - if (feats.Length > 0) + + if (feats!=null&&feats.Length > 0) globeControl1.Globe.MemoryLayer.RemoveFeatureByID(feats[0].ID); //if (emitterFeature != null) //{ @@ -11121,88 +9331,6 @@ } private int connectServerCount = 0; - - /// - /// 还原球到实测库 - /// - private void refreshGlobe1() - { - //添加实测库图层已有图层 - int servernum = 0; - //1.清除global1上 - for (int i = globeControl1.Globe.Layers.Count - 1; i >= 0; i--) - { - GSOLayer layer = globeControl1.Globe.Layers[i]; - if (!layer.Name.Contains("fttp:")) - { - layer.Dataset.Close();//清除内存 - globeControl1.Globe.Layers.Remove(layer); - } - else - { - servernum++; - } - } - - //globeControl1.Globe.ConnectServer(Utility.serverip, Utility.serverport, "", ""); //加载locaServer中的数据 - - //2.添加实测库图层 - string[] markerStrs = new string[9]; - markerStrs[0] = "标高标注"; - markerStrs[1] = "管径标注"; - markerStrs[2] = "埋深标注"; - markerStrs[3] = "坐标标注"; - markerStrs[4] = "坡度标注"; - markerStrs[5] = "属性标注"; - markerStrs[6] = "自定义标注"; - markerStrs[7] = "距离标注"; - markerStrs[8] = "扯旗标注"; - for (int i = 0; i < markerStrs.Length; i++) - { - if (File.Exists(Application.StartupPath + "\\标注管理\\" + markerStrs[i] + ".lgd")) - { - GSOLayer markerLayer = globeControl1.Globe.Layers.Add(Application.StartupPath + "\\标注管理\\" + markerStrs[i] + ".lgd"); - } - } - - for (int i = 0; i < g1layername.Count; i++) - { - string g1name = g1layername[i]; - GSODataset datasetg1 = Utility.dataSource.GetDatasetByName(g1name); - GSOLayer templayer = globeControl1.Globe.Layers.Add(datasetg1); - templayer.MaxVisibleAltitude = -1; - } - layerTemp = globeControl1.Globe.Layers.Add(Application.StartupPath + "\\tempLgdData.lgd"); - globeControl1.Globe.Layers.Add(Application.StartupPath + "/城市七线/城市红线.lgd"); - globeControl1.Globe.Layers.Add(Application.StartupPath + "/城市七线/城市橙线.lgd"); - globeControl1.Globe.Layers.Add(Application.StartupPath + "/城市七线/城市黄线.lgd"); - globeControl1.Globe.Layers.Add(Application.StartupPath + "/城市七线/城市绿线.lgd"); - globeControl1.Globe.Layers.Add(Application.StartupPath + "/城市七线/城市蓝线.lgd"); - globeControl1.Globe.Layers.Add(Application.StartupPath + "/城市七线/城市紫线.lgd"); - globeControl1.Globe.Layers.Add(Application.StartupPath + "/城市七线/城市黑线.lgd"); - globeControl1.Globe.Layers.Add(Application.StartupPath + "/隧道.lgd"); - - //移动server的数据图层 - for (int i = 0; i < servernum; i++) - { - globeControl1.Globe.Layers.MoveTo(globeControl1.Globe.Layers.Count - 1, 0); - } - - if (layerManagerNode.Nodes.Count > 0) - { - for (int i = layerManagerNode.Nodes.Count - 1; i >= 0; i--) - { - layerManagerNode.Nodes[i].Remove(); - - } - } - - - - globeControl1.Refresh(); - - } - /// /// 碰撞审查 /// @@ -11476,31 +9604,7 @@ // } //} #endregion - /// - /// 数据质量检查 - /// - /// - /// - private void buttonItemSJGL2_Click(object sender, EventArgs e) - { - //日志记录 - LogManager.saveLog(Utility.userName, this.buttonItemSJGL2.Text); - FrmValiData frm = new FrmValiData(globeControl1); - frm.ShowDialog(); - } - /// - /// 数据预处理 - /// - /// - /// - private void buttonItemSJGL3_Click(object sender, EventArgs e) - { - //保存日志 - LogManager.saveLog(Utility.userName, this.buttonItemSJGL3.Text); - FrmEditShapeFile frm = new FrmEditShapeFile(globeControl1); - frm.ShowDialog(this); - } /// /// 连接数据库 /// @@ -12251,60 +10355,6 @@ List lineStruct = new List(); GSOFeature featureSelected = null; - private void AddDatagridView(DataTable table) - { - - if (table != null && table.Rows.Count > 0) - { - dataGridViewX1.DataSource = table; - panelOfTable.Visible = true; - panelOfTable.Height = 200; - toolStripNumbers.Text = "红线审核结果"; - toolStripFeatureLength.Text = " 共有:" + table.Rows.Count + "条"; - } - else - { - - } - - } - - /// - /// 去除集合中重复的管线 - /// - /// - /// - /// - private GSOFeatures getFeaturesByFilter(GSOFeatures features, string fieldName) - { - if (features == null) - { - return null; - } - GSOFeatures featuresGet = new GSOFeatures(); - for (int i = 0; i < features.Length; i++) - { - GSOFeature featureFromFS = features[i]; - string fieldValueFromFS = featureFromFS.GetValue(fieldName).ToString().Trim(); - bool isHas = false; - for (int j = featuresGet.Length - 1; j >= 0; j--) - { - GSOFeature featureFromFSGet = featuresGet[j]; - string fieldValueFromFSGet = featureFromFSGet.GetValue(fieldName).ToString().Trim(); - if (fieldValueFromFS.Equals(fieldValueFromFSGet)) - { - isHas = true; - break; - } - } - if (isHas == false) - { - featuresGet.Add(featureFromFS.Clone()); - } - } - return featuresGet; - } - /// /// 数据管理导入文件 /// @@ -12440,138 +10490,7 @@ // //MessageBox.Show("系统运行错误:" + ex.ToString(), "错误", MessageBoxButtons.OK, MessageBoxIcon.Error); // } //} - - - /// - /// 标识器全区域统计 - /// - /// - /// - private void 标识器分类统计ToolStripMenuItem_Click(object sender, EventArgs e) - { - globeControl1.Globe.Action = EnumAction3D.ActionNull; - FrmBSQStatis bsqStatis = new FrmBSQStatis(); - bsqStatis.Show(this); - } - /// - /// 标识器绘制区域统计 - /// - /// - /// - private void 标识器分类统计ToolStripMenuItem1_Click(object sender, EventArgs e) - { - trackflag = "BSQDuoBianXiangStatis"; - globeControl1.Globe.Action = EnumAction3D.TrackPolygon; - } - - - #region 保存和加载审核库加载的图层 - private void saveLayerList(TreeNodeCollection treeNodeList) - { - string configPath = Application.StartupPath + "\\configLayerList.xml"; - try - { - XmlDocument doc = new XmlDocument(); - doc.Load(configPath); - XmlNode dbParams = doc.SelectSingleNode("Params/dbparams"); - XmlNode dbLayers = doc.SelectSingleNode("Params/dblayers"); - XmlNode layers = doc.SelectSingleNode("Params/layers"); - dbParams.RemoveAll(); - dbLayers.RemoveAll(); - layers.RemoveAll(); - - List listDS = new List(); - String shDatasourceName = Utility.sgdbip + "/" + Utility.sgdbname + "_" + Utility.sgdbuser; - bool flag = false; - - for (int i = 0; i < globeControl1.Globe.DataManager.DataSourceCount; i++) - { - GSODataSource ds = globeControl1.Globe.DataManager.GetDataSourceAt(i); - if (ds != null && ds.Type == EnumDataSourceType.SqlServer || ds.Type == EnumDataSourceType.Oracle) - { - if (ds.Name == shDatasourceName) - { - //防止因为多次连接同一个数据库 - if (flag == true) - { - break; - } - flag = true; - listDS.Add(ds); - GSODataSourceCnn conn = ds.GetConnectionInfo(); - - XmlElement dbparam = doc.CreateElement("shdbparam"); - XmlElement ip = doc.CreateElement("ship"); - ip.InnerText = conn.Server; - - XmlElement dbname = doc.CreateElement("shdbname"); - dbname.InnerText = conn.Database; - - XmlElement username = doc.CreateElement("shusername"); - username.InnerText = conn.User; - - XmlElement password = doc.CreateElement("shpassword"); - password.InnerText = conn.Password; - - XmlElement type = doc.CreateElement("shtype"); - if (ds.Type == EnumDataSourceType.SqlServer) - { - type.InnerText = "sqlserver"; - } - else - { - type.InnerText = "oracle"; - } - - dbparam.AppendChild(ip); - dbparam.AppendChild(dbname); - dbparam.AppendChild(username); - dbparam.AppendChild(password); - dbparam.AppendChild(type); - dbParams.AppendChild(dbparam); - } - - } - } - - for (int i = 0; i < treeNodeList.Count; i++) - { - GSOLayer layer = treeNodeList[i].Tag as GSOLayer; - if (Path.GetExtension(layer.Name) == "") - { - XmlElement dbLayer = doc.CreateElement("dblayer"); - XmlAttribute attri = doc.CreateAttribute("dbindex"); - for (int j = 0; j < listDS.Count; j++) - { - if (layer.Dataset.DataSource.Name == listDS[j].Name) - { - attri.Value = j.ToString(); - break; - } - } - dbLayer.Attributes.Append(attri); - dbLayer.InnerText = layer.Name; - - dbLayers.AppendChild(dbLayer); - } - else - { - XmlElement dbLayer = doc.CreateElement("layer"); - dbLayer.InnerText = layer.Name; - layers.AppendChild(dbLayer); - } - } - - doc.Save(configPath); - } - catch (Exception e) - { - - } - } - - #endregion - + private void buttonItem_TaskManager_Click(object sender, EventArgs e) { if (Form_TaksManager.IS_OPEN) diff --git a/MainFrm.designer.cs b/MainFrm.designer.cs index 233ef8c..97b8299 100644 --- a/MainFrm.designer.cs +++ b/MainFrm.designer.cs @@ -82,6 +82,7 @@ this.sideBar1 = new DevComponents.DotNetBar.SideBar(); this.panelEx3 = new DevComponents.DotNetBar.PanelEx(); this.layerSensorTree = new System.Windows.Forms.TreeView(); + this.layerTree = new Cyberpipe.MyTreeView(); this.sideBarPanelItem3 = new DevComponents.DotNetBar.SideBarPanelItem(); this.controlContainerItem3 = new DevComponents.DotNetBar.ControlContainerItem(); this.sideBarPanelItem4 = new DevComponents.DotNetBar.SideBarPanelItem(); @@ -365,30 +366,26 @@ this.可编辑ToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); this.保存ToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); this.ribbonControl1 = new DevComponents.DotNetBar.RibbonControl(); - this.ribbonPanel1 = new DevComponents.DotNetBar.RibbonPanel(); - this.ribbonBar21 = new DevComponents.DotNetBar.RibbonBar(); - this.buttonItem87 = new DevComponents.DotNetBar.ButtonItem(); - this.buttonItem88 = new DevComponents.DotNetBar.ButtonItem(); - this.buttonItem27 = new DevComponents.DotNetBar.ButtonItem(); - this.buttonItem91 = new DevComponents.DotNetBar.ButtonItem(); - this.buttonItem1 = new DevComponents.DotNetBar.ButtonItem(); - this.btnlegendSet = new DevComponents.DotNetBar.ButtonItem(); - this.buttonItem89 = new DevComponents.DotNetBar.ButtonItem(); - this.ribbonPanel7 = new DevComponents.DotNetBar.RibbonPanel(); - this.ribbonBar5 = new DevComponents.DotNetBar.RibbonBar(); - this.btn_flag = new DevComponents.DotNetBar.ButtonItem(); - this.slider4ground = new DevComponents.DotNetBar.SliderItem(); - this.ribbonPanel2 = new DevComponents.DotNetBar.RibbonPanel(); - this.ribbonBar4 = new DevComponents.DotNetBar.RibbonBar(); - this.buttonItem_TaskManager = new DevComponents.DotNetBar.ButtonItem(); - this.buttonItem_OnlineTask = new DevComponents.DotNetBar.ButtonItem(); - this.buttonItem_Event = new DevComponents.DotNetBar.ButtonItem(); this.ribbonPanel3 = new DevComponents.DotNetBar.RibbonPanel(); this.ribbonBar3 = new DevComponents.DotNetBar.RibbonBar(); this.btn_device = new DevComponents.DotNetBar.ButtonItem(); this.btn_Person = new DevComponents.DotNetBar.ButtonItem(); this.btn_constructMap = new DevComponents.DotNetBar.ButtonItem(); this.buttonItem9 = new DevComponents.DotNetBar.ButtonItem(); + this.ribbonPanel2 = new DevComponents.DotNetBar.RibbonPanel(); + this.ribbonBar4 = new DevComponents.DotNetBar.RibbonBar(); + this.buttonItem_TaskManager = new DevComponents.DotNetBar.ButtonItem(); + this.buttonItem_OnlineTask = new DevComponents.DotNetBar.ButtonItem(); + this.buttonItem_Event = new DevComponents.DotNetBar.ButtonItem(); + this.ribbonPanel1 = new DevComponents.DotNetBar.RibbonPanel(); + this.ribbonBar21 = new DevComponents.DotNetBar.RibbonBar(); + this.buttonItem87 = new DevComponents.DotNetBar.ButtonItem(); + this.buttonItem88 = new DevComponents.DotNetBar.ButtonItem(); + this.buttonItem27 = new DevComponents.DotNetBar.ButtonItem(); + this.buttonItem1 = new DevComponents.DotNetBar.ButtonItem(); + this.buttonItem91 = new DevComponents.DotNetBar.ButtonItem(); + this.btnlegendSet = new DevComponents.DotNetBar.ButtonItem(); + this.buttonItem89 = new DevComponents.DotNetBar.ButtonItem(); this.ribbonPanel8 = new DevComponents.DotNetBar.RibbonPanel(); this.ribbonBar_UserInfo = new DevComponents.DotNetBar.RibbonBar(); this.btn_user_info = new DevComponents.DotNetBar.ButtonItem(); @@ -398,6 +395,10 @@ this.btn_user_role = new DevComponents.DotNetBar.ButtonItem(); this.btn_password_edit = new DevComponents.DotNetBar.ButtonItem(); this.btn_reset_password = new DevComponents.DotNetBar.ButtonItem(); + this.ribbonPanel7 = new DevComponents.DotNetBar.RibbonPanel(); + this.ribbonBar5 = new DevComponents.DotNetBar.RibbonBar(); + this.btn_flag = new DevComponents.DotNetBar.ButtonItem(); + this.slider4ground = new DevComponents.DotNetBar.SliderItem(); this.ribbonPanel15 = new DevComponents.DotNetBar.RibbonPanel(); this.ribbonBar20 = new DevComponents.DotNetBar.RibbonBar(); this.buttonItemSJGL = new DevComponents.DotNetBar.ButtonItem(); @@ -610,7 +611,6 @@ this.buttonItem84 = new DevComponents.DotNetBar.ButtonItem(); this.buttonItem75 = new DevComponents.DotNetBar.ButtonItem(); this.buttonItem76 = new DevComponents.DotNetBar.ButtonItem(); - this.layerTree = new Cyberpipe.MyTreeView(); this.statusStrip1.SuspendLayout(); this.sideBar1.SuspendLayout(); this.panelEx3.SuspendLayout(); @@ -647,11 +647,11 @@ this.contextMenuStrip3.SuspendLayout(); this.contextMenuStripDeleteLayerNode.SuspendLayout(); this.ribbonControl1.SuspendLayout(); - this.ribbonPanel1.SuspendLayout(); - this.ribbonPanel7.SuspendLayout(); - this.ribbonPanel2.SuspendLayout(); this.ribbonPanel3.SuspendLayout(); + this.ribbonPanel2.SuspendLayout(); + this.ribbonPanel1.SuspendLayout(); this.ribbonPanel8.SuspendLayout(); + this.ribbonPanel7.SuspendLayout(); this.ribbonPanel15.SuspendLayout(); ((System.ComponentModel.ISupportInitialize)(this.pictureBox1)).BeginInit(); this.SuspendLayout(); @@ -813,7 +813,6 @@ this.toolStripDropDownButton1.Size = new System.Drawing.Size(45, 21); this.toolStripDropDownButton1.Text = "帮助"; this.toolStripDropDownButton1.Visible = false; - this.toolStripDropDownButton1.Click += new System.EventHandler(this.toolStripDropDownButton1_Click); // // controlContainerItem1 // @@ -1047,6 +1046,16 @@ this.layerSensorTree.AfterCheck += new System.Windows.Forms.TreeViewEventHandler(this.layerMarkerTree_AfterCheck); this.layerSensorTree.NodeMouseClick += new System.Windows.Forms.TreeNodeMouseClickEventHandler(this.layerMarkerTree_NodeMouseClick); // + // layerTree + // + this.layerTree.CheckBoxes = true; + this.layerTree.ItemHeight = 18; + this.layerTree.Location = new System.Drawing.Point(30, 78); + this.layerTree.Name = "layerTree"; + this.layerTree.Size = new System.Drawing.Size(121, 97); + this.layerTree.TabIndex = 1; + this.layerTree.AfterCheck += new System.Windows.Forms.TreeViewEventHandler(this.layerTree_AfterCheck); + // // sideBarPanelItem3 // this.sideBarPanelItem3.FontBold = true; @@ -2966,28 +2975,28 @@ // 平移对象ToolStripMenuItem // this.平移对象ToolStripMenuItem.Name = "平移对象ToolStripMenuItem"; - this.平移对象ToolStripMenuItem.Size = new System.Drawing.Size(152, 22); + this.平移对象ToolStripMenuItem.Size = new System.Drawing.Size(124, 22); this.平移对象ToolStripMenuItem.Text = "平移对象"; this.平移对象ToolStripMenuItem.Click += new System.EventHandler(this.buttonItemBJ6_Click); // // 升降对象ToolStripMenuItem // this.升降对象ToolStripMenuItem.Name = "升降对象ToolStripMenuItem"; - this.升降对象ToolStripMenuItem.Size = new System.Drawing.Size(152, 22); + this.升降对象ToolStripMenuItem.Size = new System.Drawing.Size(124, 22); this.升降对象ToolStripMenuItem.Text = "升降对象"; this.升降对象ToolStripMenuItem.Click += new System.EventHandler(this.buttonItemBJ7_Click); // // 旋转对象ToolStripMenuItem // this.旋转对象ToolStripMenuItem.Name = "旋转对象ToolStripMenuItem"; - this.旋转对象ToolStripMenuItem.Size = new System.Drawing.Size(152, 22); + this.旋转对象ToolStripMenuItem.Size = new System.Drawing.Size(124, 22); this.旋转对象ToolStripMenuItem.Text = "旋转对象"; this.旋转对象ToolStripMenuItem.Click += new System.EventHandler(this.buttonItemBJ8_Click); // // 连接管段ToolStripMenuItem // this.连接管段ToolStripMenuItem.Name = "连接管段ToolStripMenuItem"; - this.连接管段ToolStripMenuItem.Size = new System.Drawing.Size(152, 22); + this.连接管段ToolStripMenuItem.Size = new System.Drawing.Size(124, 22); this.连接管段ToolStripMenuItem.Text = "连接管段"; this.连接管段ToolStripMenuItem.Click += new System.EventHandler(this.buttonItemBJ9_Click); // @@ -2997,34 +3006,34 @@ this.导出CADToolStripMenuItem, this.导出文件ToolStripMenuItem1}); this.导出文件ToolStripMenuItem.Name = "导出文件ToolStripMenuItem"; - this.导出文件ToolStripMenuItem.Size = new System.Drawing.Size(152, 22); + this.导出文件ToolStripMenuItem.Size = new System.Drawing.Size(124, 22); this.导出文件ToolStripMenuItem.Text = "导出矢量"; // // 导出CADToolStripMenuItem // this.导出CADToolStripMenuItem.Name = "导出CADToolStripMenuItem"; - this.导出CADToolStripMenuItem.Size = new System.Drawing.Size(152, 22); + this.导出CADToolStripMenuItem.Size = new System.Drawing.Size(125, 22); this.导出CADToolStripMenuItem.Text = "导出CAD"; this.导出CADToolStripMenuItem.Click += new System.EventHandler(this.buttonItemBJ10_1_Click); // // 导出文件ToolStripMenuItem1 // this.导出文件ToolStripMenuItem1.Name = "导出文件ToolStripMenuItem1"; - this.导出文件ToolStripMenuItem1.Size = new System.Drawing.Size(152, 22); + this.导出文件ToolStripMenuItem1.Size = new System.Drawing.Size(125, 22); this.导出文件ToolStripMenuItem1.Text = "导出文件"; this.导出文件ToolStripMenuItem1.Click += new System.EventHandler(this.buttonItemBJ10_2_Click); // // 前进ToolStripMenuItem // this.前进ToolStripMenuItem.Name = "前进ToolStripMenuItem"; - this.前进ToolStripMenuItem.Size = new System.Drawing.Size(152, 22); + this.前进ToolStripMenuItem.Size = new System.Drawing.Size(124, 22); this.前进ToolStripMenuItem.Text = "前进"; this.前进ToolStripMenuItem.Click += new System.EventHandler(this.buttonItemBJ12_Click); // // 删除模型ToolStripMenuItem // this.删除模型ToolStripMenuItem.Name = "删除模型ToolStripMenuItem"; - this.删除模型ToolStripMenuItem.Size = new System.Drawing.Size(152, 22); + this.删除模型ToolStripMenuItem.Size = new System.Drawing.Size(124, 22); this.删除模型ToolStripMenuItem.Text = "后退"; this.删除模型ToolStripMenuItem.Click += new System.EventHandler(this.buttonItemBJ11_Click); // @@ -4160,6 +4169,198 @@ this.ribbonControl1.Text = "ribbonControl1"; this.ribbonControl1.UseCustomizeDialog = false; // + // ribbonPanel3 + // + this.ribbonPanel3.ColorSchemeStyle = DevComponents.DotNetBar.eDotNetBarStyle.StyleManagerControlled; + this.ribbonPanel3.Controls.Add(this.ribbonBar3); + this.ribbonPanel3.Dock = System.Windows.Forms.DockStyle.Fill; + this.ribbonPanel3.Location = new System.Drawing.Point(0, 33); + this.ribbonPanel3.Name = "ribbonPanel3"; + this.ribbonPanel3.Padding = new System.Windows.Forms.Padding(3, 0, 3, 3); + this.ribbonPanel3.Size = new System.Drawing.Size(1328, 62); + // + // + // + this.ribbonPanel3.Style.Class = ""; + this.ribbonPanel3.Style.CornerType = DevComponents.DotNetBar.eCornerType.Square; + // + // + // + this.ribbonPanel3.StyleMouseDown.Class = ""; + this.ribbonPanel3.StyleMouseDown.CornerType = DevComponents.DotNetBar.eCornerType.Square; + // + // + // + this.ribbonPanel3.StyleMouseOver.Class = ""; + this.ribbonPanel3.StyleMouseOver.CornerType = DevComponents.DotNetBar.eCornerType.Square; + this.ribbonPanel3.TabIndex = 40; + // + // ribbonBar3 + // + this.ribbonBar3.AutoOverflowEnabled = true; + // + // + // + this.ribbonBar3.BackgroundMouseOverStyle.Class = ""; + this.ribbonBar3.BackgroundMouseOverStyle.CornerType = DevComponents.DotNetBar.eCornerType.Square; + // + // + // + this.ribbonBar3.BackgroundStyle.Class = ""; + this.ribbonBar3.BackgroundStyle.CornerType = DevComponents.DotNetBar.eCornerType.Square; + this.ribbonBar3.ContainerControlProcessDialogKey = true; + this.ribbonBar3.Dock = System.Windows.Forms.DockStyle.Left; + this.ribbonBar3.Items.AddRange(new DevComponents.DotNetBar.BaseItem[] { + this.btn_device, + this.btn_Person, + this.btn_constructMap, + this.buttonItem9}); + this.ribbonBar3.Location = new System.Drawing.Point(3, 0); + this.ribbonBar3.Name = "ribbonBar3"; + this.ribbonBar3.Size = new System.Drawing.Size(378, 59); + this.ribbonBar3.Style = DevComponents.DotNetBar.eDotNetBarStyle.StyleManagerControlled; + this.ribbonBar3.TabIndex = 0; + // + // + // + this.ribbonBar3.TitleStyle.Class = ""; + this.ribbonBar3.TitleStyle.CornerType = DevComponents.DotNetBar.eCornerType.Square; + // + // + // + this.ribbonBar3.TitleStyleMouseOver.Class = ""; + this.ribbonBar3.TitleStyleMouseOver.CornerType = DevComponents.DotNetBar.eCornerType.Square; + this.ribbonBar3.TitleVisible = false; + // + // btn_device + // + this.btn_device.ButtonStyle = DevComponents.DotNetBar.eButtonStyle.ImageAndText; + this.btn_device.Image = global::Cyberpipe.Properties.Resources._24X24__2__02; + this.btn_device.ImagePosition = DevComponents.DotNetBar.eImagePosition.Top; + this.btn_device.Name = "btn_device"; + this.btn_device.SubItemsExpandWidth = 14; + this.btn_device.Text = "探测仪管理"; + this.btn_device.Click += new System.EventHandler(this.btn_device_Click); + // + // btn_Person + // + this.btn_Person.ButtonStyle = DevComponents.DotNetBar.eButtonStyle.ImageAndText; + this.btn_Person.Image = global::Cyberpipe.Properties.Resources._24x24icon_05_hover1; + this.btn_Person.ImagePosition = DevComponents.DotNetBar.eImagePosition.Top; + this.btn_Person.Name = "btn_Person"; + this.btn_Person.SubItemsExpandWidth = 14; + this.btn_Person.Text = "定位人员维护"; + this.btn_Person.Click += new System.EventHandler(this.btn_Person_Click); + // + // btn_constructMap + // + this.btn_constructMap.Image = global::Cyberpipe.Properties.Resources._24x24icon_04_hover; + this.btn_constructMap.ImagePosition = DevComponents.DotNetBar.eImagePosition.Top; + this.btn_constructMap.Name = "btn_constructMap"; + this.btn_constructMap.SubItemsExpandWidth = 14; + this.btn_constructMap.Text = "导出施工图"; + this.btn_constructMap.Click += new System.EventHandler(this.btn_constructMap_Click); + // + // buttonItem9 + // + this.buttonItem9.Image = global::Cyberpipe.Properties.Resources._24x24icon__2__10; + this.buttonItem9.ImagePosition = DevComponents.DotNetBar.eImagePosition.Top; + this.buttonItem9.Name = "buttonItem9"; + this.buttonItem9.SubItemsExpandWidth = 14; + this.buttonItem9.Text = "文档管理"; + this.buttonItem9.Click += new System.EventHandler(this.buttonItem9_Click); + // + // ribbonPanel2 + // + this.ribbonPanel2.ColorSchemeStyle = DevComponents.DotNetBar.eDotNetBarStyle.StyleManagerControlled; + this.ribbonPanel2.Controls.Add(this.ribbonBar4); + this.ribbonPanel2.Dock = System.Windows.Forms.DockStyle.Fill; + this.ribbonPanel2.Location = new System.Drawing.Point(0, 0); + this.ribbonPanel2.Name = "ribbonPanel2"; + this.ribbonPanel2.Padding = new System.Windows.Forms.Padding(3, 0, 3, 3); + this.ribbonPanel2.Size = new System.Drawing.Size(1328, 95); + // + // + // + this.ribbonPanel2.Style.Class = ""; + this.ribbonPanel2.Style.CornerType = DevComponents.DotNetBar.eCornerType.Square; + // + // + // + this.ribbonPanel2.StyleMouseDown.Class = ""; + this.ribbonPanel2.StyleMouseDown.CornerType = DevComponents.DotNetBar.eCornerType.Square; + // + // + // + this.ribbonPanel2.StyleMouseOver.Class = ""; + this.ribbonPanel2.StyleMouseOver.CornerType = DevComponents.DotNetBar.eCornerType.Square; + this.ribbonPanel2.TabIndex = 39; + this.ribbonPanel2.Visible = false; + // + // ribbonBar4 + // + this.ribbonBar4.AutoOverflowEnabled = true; + // + // + // + this.ribbonBar4.BackgroundMouseOverStyle.Class = ""; + this.ribbonBar4.BackgroundMouseOverStyle.CornerType = DevComponents.DotNetBar.eCornerType.Square; + // + // + // + this.ribbonBar4.BackgroundStyle.Class = ""; + this.ribbonBar4.BackgroundStyle.CornerType = DevComponents.DotNetBar.eCornerType.Square; + this.ribbonBar4.ContainerControlProcessDialogKey = true; + this.ribbonBar4.Dock = System.Windows.Forms.DockStyle.Left; + this.ribbonBar4.Items.AddRange(new DevComponents.DotNetBar.BaseItem[] { + this.buttonItem_TaskManager, + this.buttonItem_OnlineTask, + this.buttonItem_Event}); + this.ribbonBar4.Location = new System.Drawing.Point(3, 0); + this.ribbonBar4.Name = "ribbonBar4"; + this.ribbonBar4.Size = new System.Drawing.Size(299, 92); + this.ribbonBar4.Style = DevComponents.DotNetBar.eDotNetBarStyle.StyleManagerControlled; + this.ribbonBar4.TabIndex = 0; + this.ribbonBar4.Text = "ribbonBar4"; + // + // + // + this.ribbonBar4.TitleStyle.Class = ""; + this.ribbonBar4.TitleStyle.CornerType = DevComponents.DotNetBar.eCornerType.Square; + // + // + // + this.ribbonBar4.TitleStyleMouseOver.Class = ""; + this.ribbonBar4.TitleStyleMouseOver.CornerType = DevComponents.DotNetBar.eCornerType.Square; + this.ribbonBar4.TitleVisible = false; + // + // buttonItem_TaskManager + // + this.buttonItem_TaskManager.Image = global::Cyberpipe.Properties.Resources._24x24icon__2__76; + this.buttonItem_TaskManager.ImagePosition = DevComponents.DotNetBar.eImagePosition.Top; + this.buttonItem_TaskManager.Name = "buttonItem_TaskManager"; + this.buttonItem_TaskManager.SubItemsExpandWidth = 14; + this.buttonItem_TaskManager.Text = "工单管理"; + this.buttonItem_TaskManager.Click += new System.EventHandler(this.buttonItem_TaskManager_Click); + // + // buttonItem_OnlineTask + // + this.buttonItem_OnlineTask.Image = global::Cyberpipe.Properties.Resources._24x24icon__2__69; + this.buttonItem_OnlineTask.ImagePosition = DevComponents.DotNetBar.eImagePosition.Top; + this.buttonItem_OnlineTask.Name = "buttonItem_OnlineTask"; + this.buttonItem_OnlineTask.SubItemsExpandWidth = 14; + this.buttonItem_OnlineTask.Text = "在线任务"; + this.buttonItem_OnlineTask.Click += new System.EventHandler(this.buttonItem_OnlineTask_Click); + // + // buttonItem_Event + // + this.buttonItem_Event.Image = global::Cyberpipe.Properties.Resources._24x24icon__2__72; + this.buttonItem_Event.ImagePosition = DevComponents.DotNetBar.eImagePosition.Top; + this.buttonItem_Event.Name = "buttonItem_Event"; + this.buttonItem_Event.SubItemsExpandWidth = 14; + this.buttonItem_Event.Text = "事件管理"; + this.buttonItem_Event.Click += new System.EventHandler(this.buttonItem_Event_Click); + // // ribbonPanel1 // this.ribbonPanel1.AutoSize = true; @@ -4262,6 +4463,15 @@ this.buttonItem27.Visible = false; this.buttonItem27.Click += new System.EventHandler(this.buttonItem27_Click); // + // buttonItem1 + // + this.buttonItem1.Image = global::Cyberpipe.Properties.Resources._24x24icon__2__94; + this.buttonItem1.ImagePosition = DevComponents.DotNetBar.eImagePosition.Top; + this.buttonItem1.Name = "buttonItem1"; + this.buttonItem1.SubItemsExpandWidth = 14; + this.buttonItem1.Text = "图层管理"; + this.buttonItem1.Click += new System.EventHandler(this.buttonItem1_Click); + // // buttonItem91 // this.buttonItem91.ForeColor = System.Drawing.Color.Black; @@ -4272,15 +4482,6 @@ this.buttonItem91.Text = "快速定位"; this.buttonItem91.Click += new System.EventHandler(this.buttonItem91_Click); // - // buttonItem1 - // - this.buttonItem1.Image = global::Cyberpipe.Properties.Resources._24x24icon__2__94; - this.buttonItem1.ImagePosition = DevComponents.DotNetBar.eImagePosition.Top; - this.buttonItem1.Name = "buttonItem1"; - this.buttonItem1.SubItemsExpandWidth = 14; - this.buttonItem1.Text = "图层管理"; - this.buttonItem1.Click += new System.EventHandler(this.buttonItem1_Click); - // // btnlegendSet // this.btnlegendSet.Image = global::Cyberpipe.Properties.Resources._24x24icon__2__93; @@ -4300,278 +4501,6 @@ this.buttonItem89.Visible = false; this.buttonItem89.Click += new System.EventHandler(this.buttonItem89_Click); // - // ribbonPanel7 - // - this.ribbonPanel7.ColorSchemeStyle = DevComponents.DotNetBar.eDotNetBarStyle.StyleManagerControlled; - this.ribbonPanel7.Controls.Add(this.ribbonBar5); - this.ribbonPanel7.Dock = System.Windows.Forms.DockStyle.Fill; - this.ribbonPanel7.Location = new System.Drawing.Point(0, 0); - this.ribbonPanel7.Name = "ribbonPanel7"; - this.ribbonPanel7.Padding = new System.Windows.Forms.Padding(3, 0, 3, 3); - this.ribbonPanel7.Size = new System.Drawing.Size(1328, 95); - // - // - // - this.ribbonPanel7.Style.Class = ""; - this.ribbonPanel7.Style.CornerType = DevComponents.DotNetBar.eCornerType.Square; - // - // - // - this.ribbonPanel7.StyleMouseDown.Class = ""; - this.ribbonPanel7.StyleMouseDown.CornerType = DevComponents.DotNetBar.eCornerType.Square; - // - // - // - this.ribbonPanel7.StyleMouseOver.Class = ""; - this.ribbonPanel7.StyleMouseOver.CornerType = DevComponents.DotNetBar.eCornerType.Square; - this.ribbonPanel7.TabIndex = 41; - this.ribbonPanel7.Visible = false; - // - // ribbonBar5 - // - this.ribbonBar5.AutoOverflowEnabled = true; - // - // - // - this.ribbonBar5.BackgroundMouseOverStyle.Class = ""; - this.ribbonBar5.BackgroundMouseOverStyle.CornerType = DevComponents.DotNetBar.eCornerType.Square; - // - // - // - this.ribbonBar5.BackgroundStyle.Class = ""; - this.ribbonBar5.BackgroundStyle.CornerType = DevComponents.DotNetBar.eCornerType.Square; - this.ribbonBar5.ContainerControlProcessDialogKey = true; - this.ribbonBar5.Dock = System.Windows.Forms.DockStyle.Left; - this.ribbonBar5.Items.AddRange(new DevComponents.DotNetBar.BaseItem[] { - this.btn_flag, - this.slider4ground}); - this.ribbonBar5.Location = new System.Drawing.Point(3, 0); - this.ribbonBar5.Name = "ribbonBar5"; - this.ribbonBar5.Size = new System.Drawing.Size(418, 92); - this.ribbonBar5.Style = DevComponents.DotNetBar.eDotNetBarStyle.StyleManagerControlled; - this.ribbonBar5.TabIndex = 0; - // - // - // - this.ribbonBar5.TitleStyle.Class = ""; - this.ribbonBar5.TitleStyle.CornerType = DevComponents.DotNetBar.eCornerType.Square; - // - // - // - this.ribbonBar5.TitleStyleMouseOver.Class = ""; - this.ribbonBar5.TitleStyleMouseOver.CornerType = DevComponents.DotNetBar.eCornerType.Square; - this.ribbonBar5.TitleVisible = false; - this.ribbonBar5.ItemClick += new System.EventHandler(this.ribbonBar5_ItemClick); - // - // btn_flag - // - this.btn_flag.Image = global::Cyberpipe.Properties.Resources._24x24icon_03_hover; - this.btn_flag.ImagePosition = DevComponents.DotNetBar.eImagePosition.Top; - this.btn_flag.Name = "btn_flag"; - this.btn_flag.SubItemsExpandWidth = 14; - this.btn_flag.Text = "标识器管理"; - this.btn_flag.Click += new System.EventHandler(this.btn_flag_Click); - // - // slider4ground - // - this.slider4ground.LabelPosition = DevComponents.DotNetBar.eSliderLabelPosition.Top; - this.slider4ground.Name = "slider4ground"; - this.slider4ground.Text = "地面透明度"; - this.slider4ground.Value = 0; - this.slider4ground.ValueChanged += new System.EventHandler(this.slider4ground_ValueChanged); - // - // ribbonPanel2 - // - this.ribbonPanel2.ColorSchemeStyle = DevComponents.DotNetBar.eDotNetBarStyle.StyleManagerControlled; - this.ribbonPanel2.Controls.Add(this.ribbonBar4); - this.ribbonPanel2.Dock = System.Windows.Forms.DockStyle.Fill; - this.ribbonPanel2.Location = new System.Drawing.Point(0, 0); - this.ribbonPanel2.Name = "ribbonPanel2"; - this.ribbonPanel2.Padding = new System.Windows.Forms.Padding(3, 0, 3, 3); - this.ribbonPanel2.Size = new System.Drawing.Size(1328, 95); - // - // - // - this.ribbonPanel2.Style.Class = ""; - this.ribbonPanel2.Style.CornerType = DevComponents.DotNetBar.eCornerType.Square; - // - // - // - this.ribbonPanel2.StyleMouseDown.Class = ""; - this.ribbonPanel2.StyleMouseDown.CornerType = DevComponents.DotNetBar.eCornerType.Square; - // - // - // - this.ribbonPanel2.StyleMouseOver.Class = ""; - this.ribbonPanel2.StyleMouseOver.CornerType = DevComponents.DotNetBar.eCornerType.Square; - this.ribbonPanel2.TabIndex = 39; - this.ribbonPanel2.Visible = false; - // - // ribbonBar4 - // - this.ribbonBar4.AutoOverflowEnabled = true; - // - // - // - this.ribbonBar4.BackgroundMouseOverStyle.Class = ""; - this.ribbonBar4.BackgroundMouseOverStyle.CornerType = DevComponents.DotNetBar.eCornerType.Square; - // - // - // - this.ribbonBar4.BackgroundStyle.Class = ""; - this.ribbonBar4.BackgroundStyle.CornerType = DevComponents.DotNetBar.eCornerType.Square; - this.ribbonBar4.ContainerControlProcessDialogKey = true; - this.ribbonBar4.Dock = System.Windows.Forms.DockStyle.Left; - this.ribbonBar4.Items.AddRange(new DevComponents.DotNetBar.BaseItem[] { - this.buttonItem_TaskManager, - this.buttonItem_OnlineTask, - this.buttonItem_Event}); - this.ribbonBar4.Location = new System.Drawing.Point(3, 0); - this.ribbonBar4.Name = "ribbonBar4"; - this.ribbonBar4.Size = new System.Drawing.Size(299, 92); - this.ribbonBar4.Style = DevComponents.DotNetBar.eDotNetBarStyle.StyleManagerControlled; - this.ribbonBar4.TabIndex = 0; - this.ribbonBar4.Text = "ribbonBar4"; - // - // - // - this.ribbonBar4.TitleStyle.Class = ""; - this.ribbonBar4.TitleStyle.CornerType = DevComponents.DotNetBar.eCornerType.Square; - // - // - // - this.ribbonBar4.TitleStyleMouseOver.Class = ""; - this.ribbonBar4.TitleStyleMouseOver.CornerType = DevComponents.DotNetBar.eCornerType.Square; - this.ribbonBar4.TitleVisible = false; - // - // buttonItem_TaskManager - // - this.buttonItem_TaskManager.Image = global::Cyberpipe.Properties.Resources._24x24icon__2__76; - this.buttonItem_TaskManager.ImagePosition = DevComponents.DotNetBar.eImagePosition.Top; - this.buttonItem_TaskManager.Name = "buttonItem_TaskManager"; - this.buttonItem_TaskManager.SubItemsExpandWidth = 14; - this.buttonItem_TaskManager.Text = "工单管理"; - this.buttonItem_TaskManager.Click += new System.EventHandler(this.buttonItem_TaskManager_Click); - // - // buttonItem_OnlineTask - // - this.buttonItem_OnlineTask.Image = global::Cyberpipe.Properties.Resources._24x24icon__2__69; - this.buttonItem_OnlineTask.ImagePosition = DevComponents.DotNetBar.eImagePosition.Top; - this.buttonItem_OnlineTask.Name = "buttonItem_OnlineTask"; - this.buttonItem_OnlineTask.SubItemsExpandWidth = 14; - this.buttonItem_OnlineTask.Text = "在线任务"; - this.buttonItem_OnlineTask.Click += new System.EventHandler(this.buttonItem_OnlineTask_Click); - // - // buttonItem_Event - // - this.buttonItem_Event.Image = global::Cyberpipe.Properties.Resources._24x24icon__2__72; - this.buttonItem_Event.ImagePosition = DevComponents.DotNetBar.eImagePosition.Top; - this.buttonItem_Event.Name = "buttonItem_Event"; - this.buttonItem_Event.SubItemsExpandWidth = 14; - this.buttonItem_Event.Text = "事件管理"; - this.buttonItem_Event.Click += new System.EventHandler(this.buttonItem_Event_Click); - // - // ribbonPanel3 - // - this.ribbonPanel3.ColorSchemeStyle = DevComponents.DotNetBar.eDotNetBarStyle.StyleManagerControlled; - this.ribbonPanel3.Controls.Add(this.ribbonBar3); - this.ribbonPanel3.Dock = System.Windows.Forms.DockStyle.Fill; - this.ribbonPanel3.Location = new System.Drawing.Point(0, 33); - this.ribbonPanel3.Name = "ribbonPanel3"; - this.ribbonPanel3.Padding = new System.Windows.Forms.Padding(3, 0, 3, 3); - this.ribbonPanel3.Size = new System.Drawing.Size(1328, 62); - // - // - // - this.ribbonPanel3.Style.Class = ""; - this.ribbonPanel3.Style.CornerType = DevComponents.DotNetBar.eCornerType.Square; - // - // - // - this.ribbonPanel3.StyleMouseDown.Class = ""; - this.ribbonPanel3.StyleMouseDown.CornerType = DevComponents.DotNetBar.eCornerType.Square; - // - // - // - this.ribbonPanel3.StyleMouseOver.Class = ""; - this.ribbonPanel3.StyleMouseOver.CornerType = DevComponents.DotNetBar.eCornerType.Square; - this.ribbonPanel3.TabIndex = 40; - // - // ribbonBar3 - // - this.ribbonBar3.AutoOverflowEnabled = true; - // - // - // - this.ribbonBar3.BackgroundMouseOverStyle.Class = ""; - this.ribbonBar3.BackgroundMouseOverStyle.CornerType = DevComponents.DotNetBar.eCornerType.Square; - // - // - // - this.ribbonBar3.BackgroundStyle.Class = ""; - this.ribbonBar3.BackgroundStyle.CornerType = DevComponents.DotNetBar.eCornerType.Square; - this.ribbonBar3.ContainerControlProcessDialogKey = true; - this.ribbonBar3.Dock = System.Windows.Forms.DockStyle.Left; - this.ribbonBar3.Items.AddRange(new DevComponents.DotNetBar.BaseItem[] { - this.btn_device, - this.btn_Person, - this.btn_constructMap, - this.buttonItem9}); - this.ribbonBar3.Location = new System.Drawing.Point(3, 0); - this.ribbonBar3.Name = "ribbonBar3"; - this.ribbonBar3.Size = new System.Drawing.Size(378, 59); - this.ribbonBar3.Style = DevComponents.DotNetBar.eDotNetBarStyle.StyleManagerControlled; - this.ribbonBar3.TabIndex = 0; - // - // - // - this.ribbonBar3.TitleStyle.Class = ""; - this.ribbonBar3.TitleStyle.CornerType = DevComponents.DotNetBar.eCornerType.Square; - // - // - // - this.ribbonBar3.TitleStyleMouseOver.Class = ""; - this.ribbonBar3.TitleStyleMouseOver.CornerType = DevComponents.DotNetBar.eCornerType.Square; - this.ribbonBar3.TitleVisible = false; - // - // btn_device - // - this.btn_device.ButtonStyle = DevComponents.DotNetBar.eButtonStyle.ImageAndText; - this.btn_device.Image = global::Cyberpipe.Properties.Resources._24X24__2__02; - this.btn_device.ImagePosition = DevComponents.DotNetBar.eImagePosition.Top; - this.btn_device.Name = "btn_device"; - this.btn_device.SubItemsExpandWidth = 14; - this.btn_device.Text = "探测仪管理"; - this.btn_device.Click += new System.EventHandler(this.btn_device_Click); - // - // btn_Person - // - this.btn_Person.ButtonStyle = DevComponents.DotNetBar.eButtonStyle.ImageAndText; - this.btn_Person.Image = global::Cyberpipe.Properties.Resources._24x24icon_05_hover1; - this.btn_Person.ImagePosition = DevComponents.DotNetBar.eImagePosition.Top; - this.btn_Person.Name = "btn_Person"; - this.btn_Person.SubItemsExpandWidth = 14; - this.btn_Person.Text = "定位人员维护"; - this.btn_Person.Click += new System.EventHandler(this.btn_Person_Click); - // - // btn_constructMap - // - this.btn_constructMap.Image = global::Cyberpipe.Properties.Resources._24x24icon_04_hover; - this.btn_constructMap.ImagePosition = DevComponents.DotNetBar.eImagePosition.Top; - this.btn_constructMap.Name = "btn_constructMap"; - this.btn_constructMap.SubItemsExpandWidth = 14; - this.btn_constructMap.Text = "导出施工图"; - this.btn_constructMap.Click += new System.EventHandler(this.btn_constructMap_Click); - // - // buttonItem9 - // - this.buttonItem9.Image = global::Cyberpipe.Properties.Resources._24x24icon__2__10; - this.buttonItem9.ImagePosition = DevComponents.DotNetBar.eImagePosition.Top; - this.buttonItem9.Name = "buttonItem9"; - this.buttonItem9.SubItemsExpandWidth = 14; - this.buttonItem9.Text = "文档管理"; - this.buttonItem9.Click += new System.EventHandler(this.buttonItem9_Click); - // // ribbonPanel8 // this.ribbonPanel8.ColorSchemeStyle = DevComponents.DotNetBar.eDotNetBarStyle.StyleManagerControlled; @@ -4696,6 +4625,86 @@ this.btn_reset_password.Text = "重置密码"; this.btn_reset_password.Click += new System.EventHandler(this.btn_reset_password_Click); // + // ribbonPanel7 + // + this.ribbonPanel7.ColorSchemeStyle = DevComponents.DotNetBar.eDotNetBarStyle.StyleManagerControlled; + this.ribbonPanel7.Controls.Add(this.ribbonBar5); + this.ribbonPanel7.Dock = System.Windows.Forms.DockStyle.Fill; + this.ribbonPanel7.Location = new System.Drawing.Point(0, 0); + this.ribbonPanel7.Name = "ribbonPanel7"; + this.ribbonPanel7.Padding = new System.Windows.Forms.Padding(3, 0, 3, 3); + this.ribbonPanel7.Size = new System.Drawing.Size(1328, 95); + // + // + // + this.ribbonPanel7.Style.Class = ""; + this.ribbonPanel7.Style.CornerType = DevComponents.DotNetBar.eCornerType.Square; + // + // + // + this.ribbonPanel7.StyleMouseDown.Class = ""; + this.ribbonPanel7.StyleMouseDown.CornerType = DevComponents.DotNetBar.eCornerType.Square; + // + // + // + this.ribbonPanel7.StyleMouseOver.Class = ""; + this.ribbonPanel7.StyleMouseOver.CornerType = DevComponents.DotNetBar.eCornerType.Square; + this.ribbonPanel7.TabIndex = 41; + this.ribbonPanel7.Visible = false; + // + // ribbonBar5 + // + this.ribbonBar5.AutoOverflowEnabled = true; + // + // + // + this.ribbonBar5.BackgroundMouseOverStyle.Class = ""; + this.ribbonBar5.BackgroundMouseOverStyle.CornerType = DevComponents.DotNetBar.eCornerType.Square; + // + // + // + this.ribbonBar5.BackgroundStyle.Class = ""; + this.ribbonBar5.BackgroundStyle.CornerType = DevComponents.DotNetBar.eCornerType.Square; + this.ribbonBar5.ContainerControlProcessDialogKey = true; + this.ribbonBar5.Dock = System.Windows.Forms.DockStyle.Left; + this.ribbonBar5.Items.AddRange(new DevComponents.DotNetBar.BaseItem[] { + this.btn_flag, + this.slider4ground}); + this.ribbonBar5.Location = new System.Drawing.Point(3, 0); + this.ribbonBar5.Name = "ribbonBar5"; + this.ribbonBar5.Size = new System.Drawing.Size(418, 92); + this.ribbonBar5.Style = DevComponents.DotNetBar.eDotNetBarStyle.StyleManagerControlled; + this.ribbonBar5.TabIndex = 0; + // + // + // + this.ribbonBar5.TitleStyle.Class = ""; + this.ribbonBar5.TitleStyle.CornerType = DevComponents.DotNetBar.eCornerType.Square; + // + // + // + this.ribbonBar5.TitleStyleMouseOver.Class = ""; + this.ribbonBar5.TitleStyleMouseOver.CornerType = DevComponents.DotNetBar.eCornerType.Square; + this.ribbonBar5.TitleVisible = false; + this.ribbonBar5.ItemClick += new System.EventHandler(this.ribbonBar5_ItemClick); + // + // btn_flag + // + this.btn_flag.Image = global::Cyberpipe.Properties.Resources._24x24icon_03_hover; + this.btn_flag.ImagePosition = DevComponents.DotNetBar.eImagePosition.Top; + this.btn_flag.Name = "btn_flag"; + this.btn_flag.SubItemsExpandWidth = 14; + this.btn_flag.Text = "标识器管理"; + this.btn_flag.Click += new System.EventHandler(this.btn_flag_Click); + // + // slider4ground + // + this.slider4ground.LabelPosition = DevComponents.DotNetBar.eSliderLabelPosition.Top; + this.slider4ground.Name = "slider4ground"; + this.slider4ground.Text = "地面透明度"; + this.slider4ground.Value = 0; + this.slider4ground.ValueChanged += new System.EventHandler(this.slider4ground_ValueChanged); + // // ribbonPanel15 // this.ribbonPanel15.ColorSchemeStyle = DevComponents.DotNetBar.eDotNetBarStyle.StyleManagerControlled; @@ -6393,16 +6402,6 @@ this.buttonItem76.SubItemsExpandWidth = 14; this.buttonItem76.Text = "坐标标注"; // - // layerTree - // - this.layerTree.CheckBoxes = true; - this.layerTree.ItemHeight = 18; - this.layerTree.Location = new System.Drawing.Point(30, 78); - this.layerTree.Name = "layerTree"; - this.layerTree.Size = new System.Drawing.Size(121, 97); - this.layerTree.TabIndex = 1; - this.layerTree.AfterCheck += new System.Windows.Forms.TreeViewEventHandler(this.layerTree_AfterCheck); - // // MainFrm // this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Inherit; @@ -6475,11 +6474,11 @@ this.contextMenuStripDeleteLayerNode.ResumeLayout(false); this.ribbonControl1.ResumeLayout(false); this.ribbonControl1.PerformLayout(); - this.ribbonPanel1.ResumeLayout(false); - this.ribbonPanel7.ResumeLayout(false); - this.ribbonPanel2.ResumeLayout(false); this.ribbonPanel3.ResumeLayout(false); + this.ribbonPanel2.ResumeLayout(false); + this.ribbonPanel1.ResumeLayout(false); this.ribbonPanel8.ResumeLayout(false); + this.ribbonPanel7.ResumeLayout(false); this.ribbonPanel15.ResumeLayout(false); ((System.ComponentModel.ISupportInitialize)(this.pictureBox1)).EndInit(); this.ResumeLayout(false); diff --git a/NewFunction/FrmCreateTunnel.cs b/NewFunction/FrmCreateTunnel.cs index 282767c..338edff 100644 --- a/NewFunction/FrmCreateTunnel.cs +++ b/NewFunction/FrmCreateTunnel.cs @@ -142,35 +142,6 @@ } } - private void txtMS_KeyPress(object sender, KeyPressEventArgs e) - { - TextBox text = sender as TextBox; - if ((e.KeyChar < 48 || e.KeyChar > 57) && (e.KeyChar != 8) && (int)e.KeyChar != 46) - { - e.Handled = true; - } - if ((int)e.KeyChar == 46) //小数点 - { - if (text.Text.Length <= 0) - e.Handled = true; //小数点不能在第一位 - else //处理不规则的小数点 - { - float f; - float oldf; - bool b1 = false, b2 = false; - b1 = float.TryParse(text.Text, out oldf); - b2 = float.TryParse(text.Text + e.KeyChar.ToString(), out f); - if (b2 == false) - { - if (b1 == true) - e.Handled = true; - else - e.Handled = false; - } - } - } - } - private void FrmCreateTunnel_Load(object sender, EventArgs e) { if (comboBoxTunnelType.Items.Count > 0) diff --git a/OracleHelper.cs b/OracleHelper.cs index 11eebe6..79cdf48 100644 --- a/OracleHelper.cs +++ b/OracleHelper.cs @@ -49,7 +49,7 @@ { conn.Close(); } - MessageBox.Show(ex.Message, "提示"); + LogHelper.WriteLog(typeof(OledbHelper), ex.Message); return null; } } @@ -67,7 +67,7 @@ } catch(Exception ex) { - // LogError.PublishError(ex); + LogHelper.WriteLog(typeof(OledbHelper), ex.Message); } finally { @@ -111,6 +111,7 @@ } catch (Exception ex) { + LogHelper.WriteLog(typeof(OledbHelper), ex.Message); return null; } } @@ -131,6 +132,7 @@ } catch(Exception ex) { + LogHelper.WriteLog(typeof(OledbHelper), ex.Message); rowCount = -1; } finally @@ -159,6 +161,7 @@ } catch(Exception ex) { + LogHelper.WriteLog(typeof(OledbHelper), ex.Message); num = -1; } finally @@ -190,6 +193,7 @@ } catch (Exception ex) { + LogHelper.WriteLog(typeof(OledbHelper), ex.Message); return null; } } @@ -210,7 +214,7 @@ oracleCmd.Dispose(); conn.Close(); //调用con_close()方法,关闭与数据库的连接 }catch(Exception ex){ - + LogHelper.WriteLog(typeof(OledbHelper), ex.Message); } finally { @@ -237,6 +241,7 @@ } catch (Exception ex) { + LogHelper.WriteLog(typeof(OledbHelper), ex.Message); rowCount = -1; } finally diff --git a/OracleUtils.cs b/OracleUtils.cs index 29b5374..c1aadda 100644 --- a/OracleUtils.cs +++ b/OracleUtils.cs @@ -741,7 +741,6 @@ } catch { - //if we fail to return the SqlDatReader, we need to close the connection ourselves cn.Close(); throw; } diff --git a/PAS.cs b/PAS.cs index 972de2d..fcda1dd 100644 --- a/PAS.cs +++ b/PAS.cs @@ -93,15 +93,7 @@ } - private void TSM_Pderive_Click(object sender, EventArgs e) - { - PASAClass.Table_name(operation); - if (TV_Files.SelectedNode != null) - { - PASAClass.GuideEdit_form("G", TV_Files, int.Parse(((ToolStripMenuItem)sender).Tag.ToString())); - } - } - + private void TSM_Fenter_Click(object sender, EventArgs e) { if (TV_Files.SelectedNode != null) @@ -110,16 +102,6 @@ } } - private void TSM_Frename_Click(object sender, EventArgs e) - { - TSM_Fenter_Click(sender, e); - } - - private void TSM_Fdelete_Click(object sender, EventArgs e) - { - TSM_Fenter_Click(sender, e); - } - private void TSM_Fderive_Click(object sender, EventArgs e) { if (TV_Files.SelectedNode != null) @@ -128,25 +110,6 @@ } } - private void TSM_Fprint_Click(object sender, EventArgs e) - { - if (TV_Files.SelectedNode != null) - { - PASAClass.Print(int.Parse(TV_Files.SelectedNode.Tag.ToString()), TV_Files.SelectedNode.Text, PD_PASPrtFile, PD_PASPrtDoc); - - } - } - - private void TSM_PASPgSt_Click(object sender, EventArgs e) - { - PSD_PASSetPage.ShowDialog(); - } - - private void TSM_PASPreV_Click(object sender, EventArgs e) - { - PPD_PASPreV.ShowDialog(); - } - private void TV_Files_AfterCollapse(object sender, TreeViewEventArgs e) { e.Node.ImageIndex = 0; @@ -250,14 +213,6 @@ } } - private void 导出ToolStripMenuItem_Click(object sender, EventArgs e) - { - PASAClass.Table_name(operation); - if (TV_Files.SelectedNode != null) - { - PASAClass.GuideEdit_form("G", TV_Files, int.Parse(((ToolStripMenuItem)sender).Tag.ToString())); - } - } private void 导入ToolStripMenuItem_Click(object sender, EventArgs e) { diff --git a/PAS_Forms/F_PASInout.cs b/PAS_Forms/F_PASInout.cs index 373a4e6..974f987 100644 --- a/PAS_Forms/F_PASInout.cs +++ b/PAS_Forms/F_PASInout.cs @@ -71,11 +71,6 @@ } - private void Cancel_Click(object sender, EventArgs e) - { - this.Close(); - } - private void OK_Click(object sender, EventArgs e) { if (textBox1.Text == "") diff --git a/PATM.cs b/PATM.cs index edecd1e..9b6c51d 100644 --- a/PATM.cs +++ b/PATM.cs @@ -26,12 +26,6 @@ public string operation = ""; #endregion - - - - - - private void TSM_Pnew_Click(object sender, EventArgs e) { if (LV_proj.Visible) @@ -94,15 +88,6 @@ } - private void TSM_Pderive_Click(object sender, EventArgs e) - { - PATMAClass.Table_name(operation); - if (TV_files.SelectedNode != null) - { - PATMAClass.GuideEdit_form("G", TV_files, int.Parse(((ToolStripMenuItem)sender).Tag.ToString())); - } - } - private void TSM_Fenter_Click(object sender, EventArgs e) { if (TV_files.SelectedNode != null) @@ -163,35 +148,6 @@ //PATMAClass.Show_AllFile(int.Parse(e.Node.Tag.ToString()), e.Node.Text, LV_PATMallfiles, PB_Display, 2);//此处为显示图片操作 } - private void TSM_Frename_Click(object sender, EventArgs e) - { - TSM_Fenter_Click(sender, e); - } - - private void TSM_Fdelete_Click(object sender, EventArgs e) - { - TSM_Fenter_Click(sender, e); - } - - private void TSM_Fderive_Click(object sender, EventArgs e) - { - if (TV_files.SelectedNode != null) - { - PATMAClass.GuideEdit_form("G", TV_files, int.Parse(((ToolStripMenuItem)sender).Tag.ToString())); - } - } - - private void TSM_Fprint_Click(object sender, EventArgs e) - { - if (TV_files.SelectedNode != null) - { - PATMAClass.Print(int.Parse(TV_files.SelectedNode.Tag.ToString()), TV_files.SelectedNode.Text, PD_PATMPrtFile, PD_PATMPrtDoc); - - } - } - - - private void BT_PATMSch_Click(object sender, EventArgs e) { //LV_PATMallfiles.Dock = DockStyle.Fill;//使ListView控件最大化 @@ -210,32 +166,6 @@ } - private void TSM_PATMPreV_Click(object sender, EventArgs e) - { - PPD_PATMPreV.ShowDialog(); - } - - private void TSM_PATMPgSt_Click(object sender, EventArgs e) - { - PSD_PATMSetPage.ShowDialog(); - } - - private void LV_PATMSrchRslt_MouseClick(object sender, MouseEventArgs e) - { - - if (LV_proj.SelectedItems != null) - { - //int i = 1; - // PATMAClass.Show_AllFile(int.Parse(LV_PATMSrchRslt.FocusedItem.Tag.ToString()), LV_PATMSrchRslt.FocusedItem.Text, LV_PATMallfiles,PB_Display, 0); - - } - } - - private void LV_PATMSrchRslt_MouseDoubleClick(object sender, MouseEventArgs e) - { - //PATMAClass.Show_AllFile(int.Parse(LV_PATMSrchRslt.FocusedItem.Tag.ToString()), LV_PATMSrchRslt.FocusedItem.Text, LV_PATMallfiles, PB_Display, 2); - } - private void 新建ToolStripMenuItem_Click(object sender, EventArgs e) { if ((TV_files.SelectedNode != null)&&(TV_files.SelectedNode.Parent==null)) @@ -288,17 +218,6 @@ } } - private void 打印预览toolStripMenuItem_Click(object sender, EventArgs e) - { - - PPD_PATMPreV.ShowDialog(); - } - - private void 打印设置toolStripMenuItem_Click(object sender, EventArgs e) - { - PSD_PATMSetPage.ShowDialog(); - } - private void TV_PATMSrchRslt_NodeMouseClick(object sender, TreeNodeMouseClickEventArgs e) { if (e.Button == MouseButtons.Right) diff --git a/Cyberpipe.csproj b/Cyberpipe.csproj index 07a8c1a..e3cd12c 100644 --- a/Cyberpipe.csproj +++ b/Cyberpipe.csproj @@ -204,25 +204,6 @@ - - Form - - - F_GKT1数据输入输出.cs - - - Form - - - F_GKT1添加文件.cs - - - Form - - - F_GKT1添加项目.cs - - Form @@ -1068,18 +1049,6 @@ Frm_password_reset.cs - - Form - - - GKT.cs - - - Form - - - GKT1.cs - Form @@ -1258,12 +1227,6 @@ F_Projedit.cs - - Form - - - PED.cs - Form @@ -1331,16 +1294,6 @@ True Reference.map - - F_GKT1数据输入输出.cs - Designer - - - F_GKT1添加文件.cs - - - F_GKT1添加项目.cs - Form_EditTask.cs @@ -1836,12 +1789,6 @@ Frm_password_reset.cs - - GKT.cs - - - GKT1.cs - F_GKT数据输入输出.cs @@ -1934,9 +1881,6 @@ F_Projedit.cs - - PED.cs - F_数据输入输出.cs diff --git a/Cyberpipe.suo b/Cyberpipe.suo index 68ced4f..a1aecf8 100644 --- a/Cyberpipe.suo +++ b/Cyberpipe.suo Binary files differ diff --git a/EMS_Forms/Form_EditTask.cs b/EMS_Forms/Form_EditTask.cs index 718992f..f1d791f 100644 --- a/EMS_Forms/Form_EditTask.cs +++ b/EMS_Forms/Form_EditTask.cs @@ -119,7 +119,8 @@ String name = Convert.ToString(dr["USERNAME"]); comboBox_userName.Items.Add(name); - } + } + dr.Close(); comboBox_road.Items.Clear(); roadList = new List(); @@ -135,7 +136,7 @@ comboBox_road.Items.Add(name); } } - + dr1.Close(); conn.Close(); bool flag2 = false; @@ -185,7 +186,7 @@ catch (Exception ex) { - MessageBox.Show(ex.ToString()); + LogHelper.WriteLog(typeof(Form_EditTask), ex.Message); } } @@ -288,7 +289,7 @@ } catch (Exception ex) { - MessageBox.Show(ex.ToString()); + LogHelper.WriteLog(typeof(Form_EditTask), ex.Message); } } @@ -474,7 +475,7 @@ } catch (Exception ex) { - MessageBox.Show(ex.ToString()); + LogHelper.WriteLog(typeof(Form_EditTask), ex.Message); } this.Close(); @@ -495,6 +496,7 @@ { numList.Add(Convert.ToInt32(dr["DBID"])); } + dr.Close(); if (numList.Count == 0) { taskNumber = Convert.ToInt32(number) * 100; @@ -674,6 +676,7 @@ } } } + dr.Close(); conn.Close(); } diff --git a/EMS_Forms/Form_EventManager.cs b/EMS_Forms/Form_EventManager.cs index b18c45b..84807b2 100644 --- a/EMS_Forms/Form_EventManager.cs +++ b/EMS_Forms/Form_EventManager.cs @@ -64,6 +64,7 @@ comboBox_name.Items.Add(name); } + dr.Close(); conn.Close(); diff --git a/Forms/FrmMnModify.cs b/Forms/FrmMnModify.cs index 31cfc5f..d036360 100644 --- a/Forms/FrmMnModify.cs +++ b/Forms/FrmMnModify.cs @@ -68,15 +68,7 @@ questionGrid.Rows[idx].Cells[1].Value = sr.question; } } - /// 选中对象 - /// - /// - /// - /// - private void buttonX1_Click(object sender, EventArgs e) - { - globecontrol.Globe.Action = EnumAction3D.SelectObject; - } + /// /// 选中某一行 /// diff --git a/Forms/FrmPipelineModelDataBase.cs b/Forms/FrmPipelineModelDataBase.cs index 2acf0ca..7ce573f 100644 --- a/Forms/FrmPipelineModelDataBase.cs +++ b/Forms/FrmPipelineModelDataBase.cs @@ -35,19 +35,7 @@ ds = _ds; InitializeComponent(); } - /// - /// 单击选择shp格式文件 - /// - /// - /// - private void btnBrowseModel_Click(object sender, EventArgs e) - { - saveFileDialog1.Filter = "*.lgd|*.lgd"; - if (saveFileDialog1.ShowDialog() == DialogResult.OK) - { - txtModelLayer.Text = saveFileDialog1.FileName; - } - } + /// /// 窗体初始化事件处理 /// @@ -100,49 +88,6 @@ } } } - - private object convertFieldValue(string fieldname, object obj) - { - if (obj == null) - return null; - - try - { - string type = fields_types[fieldname].ToString(); - switch (type) - { - case "string": - return obj.ToString(); - case "int": - //return 101; - int intResult; - if (int.TryParse(obj.ToString(), out intResult)) - return intResult; - else - return null; - case "double": - //return 202.5; - double doubleResult; - if (double.TryParse(obj.ToString(), out doubleResult)) - return doubleResult; - else - return null; - case "date": - DateTime dtResult; - if (DateTime.TryParse(obj.ToString(), out dtResult)) - return dtResult; - else - return null; - } - return null; - } - catch (Exception ex) - { - MessageBox.Show(ex.ToString()); - return null; - } - } - public string lgdFilePath = ""; /// /// 选择管线颜色 @@ -610,33 +555,6 @@ { this.Close(); } - - private void cmbLayer_SelectedIndexChanged(object sender, EventArgs e) //选择图层 - { - GSOLayer layer = ctl.Globe.Layers.GetLayerByCaption(selectLayerName); - GSOFeatures features = layer.GetAllFeatures(); - if (features.Length == 0) - return; - - cmbFrom.Items.Clear(); - cmbTo.Items.Clear(); - cmbRadius.Items.Clear(); - cmbID.Items.Clear(); - for (int i = 0; i < features[0].GetFieldCount(); i++) - { - GeoScene.Data.GSOFieldDefn fielddef = (GeoScene.Data.GSOFieldDefn)(features[0].GetFieldDefn(i)); - - cmbFrom.Items.Add(fielddef.Name); - cmbTo.Items.Add(fielddef.Name); - cmbRadius.Items.Add(fielddef.Name); - cmbID.Items.Add(fielddef.Name); - } - cmbFrom.SelectedItem = "Deep1"; - cmbTo.SelectedItem = "Deep2"; - cmbRadius.SelectedItem = "Diameter"; - cmbID.SelectedItem = "Handle"; - } - private void buttonXLayerPath_Click(object sender, EventArgs e)//单击 选择shp格式的文件 { OpenFileDialog dlg = new OpenFileDialog(); diff --git a/Forms/FrmPipelineModelDataOneStep.cs b/Forms/FrmPipelineModelDataOneStep.cs index 18afda7..ec93b8a 100644 --- a/Forms/FrmPipelineModelDataOneStep.cs +++ b/Forms/FrmPipelineModelDataOneStep.cs @@ -38,19 +38,7 @@ layerTree = _layerTree; InitializeComponent(); } - /// - /// 单击选择shp格式文件 - /// - /// - /// - private void btnBrowseModel_Click(object sender, EventArgs e) - { - saveFileDialog1.Filter = "*.lgd|*.lgd"; - if (saveFileDialog1.ShowDialog() == DialogResult.OK) - { - txtModelLayer.Text = saveFileDialog1.FileName; - } - } + /// /// 窗体初始化事件处理 /// @@ -107,48 +95,7 @@ } } - private object convertFieldValue(string fieldname, object obj) - { - if (obj == null) - return null; - - try - { - string type = fields_types[fieldname].ToString(); - switch (type) - { - case "string": - return obj.ToString(); - case "int": - //return 101; - int intResult; - if (int.TryParse(obj.ToString(), out intResult)) - return intResult; - else - return null; - case "double": - //return 202.5; - double doubleResult; - if (double.TryParse(obj.ToString(), out doubleResult)) - return doubleResult; - else - return null; - case "date": - DateTime dtResult; - if (DateTime.TryParse(obj.ToString(), out dtResult)) - return dtResult; - else - return null; - } - return null; - } - catch (Exception ex) - { - MessageBox.Show(ex.ToString()); - return null; - } - } - + public string lgdFilePath = ""; /// /// 选择管线颜色 @@ -673,32 +620,6 @@ return featDs; } - private void cmbLayer_SelectedIndexChanged(object sender, EventArgs e) //选择图层 - { - GSOLayer layer = ctl.Globe.Layers.GetLayerByCaption(selectLayerName); - GSOFeatures features = layer.GetAllFeatures(); - if (features.Length == 0) - return; - - cmbFrom.Items.Clear(); - cmbTo.Items.Clear(); - cmbRadius.Items.Clear(); - cmbID.Items.Clear(); - for (int i = 0; i < features[0].GetFieldCount(); i++) - { - GeoScene.Data.GSOFieldDefn fielddef = (GeoScene.Data.GSOFieldDefn)(features[0].GetFieldDefn(i)); - - cmbFrom.Items.Add(fielddef.Name); - cmbTo.Items.Add(fielddef.Name); - cmbRadius.Items.Add(fielddef.Name); - cmbID.Items.Add(fielddef.Name); - } - cmbFrom.SelectedItem = "Deep1"; - cmbTo.SelectedItem = "Deep2"; - cmbRadius.SelectedItem = "Diameter"; - cmbID.SelectedItem = "Handle"; - } - private void buttonXLayerPath_Click(object sender, EventArgs e)//单击 选择shp格式的文件 { OpenFileDialog dlg = new OpenFileDialog(); @@ -949,38 +870,6 @@ } //txtLayername.Text = type + layername; } - /// - /// 连接数据库 - /// - /// - /// - private void buttonX1_Click(object sender, EventArgs e) - { - if (ds == null) - { - //没连的话,直接连接审核库; //审核库配置读配置文件 - string dbIp = Utility.sgdbip; - string database = Utility.sgdbname; - string user = Utility.sgdbuser; - string pass = Utility.sgdbpwd; - - if (!Utility.isNetworkConnectionSuccess(dbIp.Trim())) - { - MessageBox.Show("网络连接失败!", "提示"); - return; - } - - ds = ctl.Globe.DataManager.OpenOracleDataSource(dbIp + "/" + database, "", "", user, pass); - if (ds == null) - { - MessageBox.Show("数据库连接失败!", "提示", MessageBoxButtons.OK, MessageBoxIcon.Warning); - } - else - { - btnCreateModel.Enabled = true; - } - } - } private void btnClose_Click(object sender, EventArgs e) { diff --git a/Forms/FrmShRK.cs b/Forms/FrmShRK.cs index 0e2e722..f1d83cb 100644 --- a/Forms/FrmShRK.cs +++ b/Forms/FrmShRK.cs @@ -215,6 +215,7 @@ { sourcefeatds = sourcefeat as GSOFeatureDataset; } + if (sourcefeatds == null) return; sourcefeatds.Open(); GSOFeatures sourcefeatures = sourcefeatds.GetAllFeatures(); @@ -251,6 +252,7 @@ { desfeatds = desfeat as GSOFeatureDataset; } + if (desfeatds == null) return; desfeatds.Open(); //向新数据集写入字段 diff --git a/FrmAccessoriesSensor.cs b/FrmAccessoriesSensor.cs index 09fcdf1..2a7a80e 100644 --- a/FrmAccessoriesSensor.cs +++ b/FrmAccessoriesSensor.cs @@ -209,7 +209,7 @@ chart1.Series[0].Points.DataBindXY(dic.Keys, dic.Values); for (int m = 0; m < dic.Values.Count; m++) { - if (chart1.Series[0].Points[m].YValues[0].ToString() != "0") + if (chart1.Series[0].Points[m]!=null&&chart1.Series[0].Points[m].YValues[0].ToString() != "0") { chart1.Series[0].Points[m].Label = chart1.Series[0].Points[m].YValues[0].ToString(); } diff --git a/FrmAccessoriesgather.cs b/FrmAccessoriesgather.cs index 9e331e1..a475d9e 100644 --- a/FrmAccessoriesgather.cs +++ b/FrmAccessoriesgather.cs @@ -338,7 +338,7 @@ chart1.Series[0].Points.DataBindXY(dic.Keys, dic.Values); for (int m = 0; m < dic.Values.Count; m++) { - if (chart1.Series[0].Points[m].YValues[0].ToString() != "0") + if (chart1.Series[0].Points[m]!=null&&chart1.Series[0].Points[m].YValues[0].ToString() != "0") { chart1.Series[0].Points[m].Label = chart1.Series[0].Points[m].YValues[0].ToString(); } diff --git a/FrmAccessoryAnalysis.cs b/FrmAccessoryAnalysis.cs index 71d4579..44d4065 100644 --- a/FrmAccessoryAnalysis.cs +++ b/FrmAccessoryAnalysis.cs @@ -66,39 +66,6 @@ globeControl1.Refresh(); } /// - /// 键盘按键按下事件处理 - /// - /// - /// - private void txtRadius_KeyPress(object sender, KeyPressEventArgs e) - { - TextBox text = sender as TextBox; - if ((e.KeyChar < 48 || e.KeyChar > 57) && (e.KeyChar != 8) && (int)e.KeyChar != 46) - { - e.Handled = true; - } - if ((int)e.KeyChar == 46) //小数点 - { - if (text.Text.Length <= 0) - e.Handled = true; //小数点不能在第一位 - else //处理不规则的小数点 - { - float f; - float oldf; - bool b1 = false, b2 = false; - b1 = float.TryParse(text.Text, out oldf); - b2 = float.TryParse(text.Text + e.KeyChar.ToString(), out f); - if (b2 == false) - { - if (b1 == true) - e.Handled = true; - else - e.Handled = false; - } - } - } - } - /// /// 确定按钮事件处理 /// /// diff --git a/FrmAddValve.cs b/FrmAddValve.cs index 34d2fec..5f405b9 100644 --- a/FrmAddValve.cs +++ b/FrmAddValve.cs @@ -486,56 +486,6 @@ } } - - - - - - - - private void cmbLayer_SelectedIndexChanged(object sender, EventArgs e) - { - GSOLayer layer = globeControl1.Globe.Layers.GetLayerByCaption(selectLayerName); - GSOFeatures features = layer.GetAllFeatures(); - if (features.Length == 0) - return; - - combPath.Items.Clear(); - combZ.Items.Clear(); - combModelName.Items.Clear(); - - for (int i = 0; i < features[0].GetFieldCount(); i++) - { - GeoScene.Data.GSOFieldDefn fielddef = (GeoScene.Data.GSOFieldDefn)(features[0].GetFieldDefn(i)); - combPath.Items.Add(fielddef.Name); - combZ.Items.Add(fielddef.Name); - combModelName.Items.Add(fielddef.Name); - } - combModelName.SelectedItem = "编号"; - combPath.SelectedItem = "模型路径"; - if (combfile.SelectedIndex != -1) - { - - string layerCaption = combfile.SelectedItem.ToString().Trim(); - rukuLayer = globeControl1.Globe.Layers.GetLayerByCaption(layerCaption); - if (rukuLayer != null) - { - combPath.Items.Clear(); - combZ.Items.Clear(); - combModelName.Items.Clear(); - - } - for (int i = 0; i < features[0].GetFieldCount(); i++) - { - GeoScene.Data.GSOFieldDefn fielddef = (GeoScene.Data.GSOFieldDefn)(features[0].GetFieldDefn(i)); - combPath.Items.Add(fielddef.Name); - combZ.Items.Add(fielddef.Name); - combModelName.Items.Add(fielddef.Name); - } - combModelName.SelectedItem = "编号"; - combPath.SelectedItem = "模型路径"; - } - } /// /// 单击选择shp格式文件 /// diff --git a/FrmAddWellShp.cs b/FrmAddWellShp.cs index bb79ec0..a249725 100644 --- a/FrmAddWellShp.cs +++ b/FrmAddWellShp.cs @@ -478,32 +478,6 @@ } } } - - private void cmbLayer_SelectedIndexChanged(object sender, EventArgs e) - { - GSOLayer layer = globeControl1.Globe.Layers.GetLayerByCaption(selectLayerName); - GSOFeatures features = layer.GetAllFeatures(); - if (features.Length == 0) - return; - - combCode.Items.Clear(); - combDeep.Items.Clear(); - combModelName.Items.Clear(); - combAngle.Items.Clear(); - - for (int i = 0; i < features[0].GetFieldCount(); i++) - { - GeoScene.Data.GSOFieldDefn fielddef = (GeoScene.Data.GSOFieldDefn)(features[0].GetFieldDefn(i)); - combCode.Items.Add(fielddef.Name); - combDeep.Items.Add(fielddef.Name); - combModelName.Items.Add(fielddef.Name); - combAngle.Items.Add(fielddef.Name); - } - combCode.SelectedItem = "附属物编码"; - combDeep.SelectedItem = "井深"; - combModelName.SelectedItem = "编号"; - combAngle.SelectedItem = "符号角度"; - } /// /// 单击选择shp格式文件 /// diff --git a/FrmAddYuBiZiShp.cs b/FrmAddYuBiZiShp.cs index b312d51..332f037 100644 --- a/FrmAddYuBiZiShp.cs +++ b/FrmAddYuBiZiShp.cs @@ -383,80 +383,7 @@ } } - private void cmbLayer_SelectedIndexChanged(object sender, EventArgs e) - { - GSOLayer layer = globeControl1.Globe.Layers.GetLayerByCaption(selectLayerName); - GSOFeatures features = layer.GetAllFeatures(); - if (features.Length == 0) - return; - - combCode.Items.Clear(); - combDeep.Items.Clear(); - combModelName.Items.Clear(); - //comboLoad.Items.Clear(); - for (int i = 0; i < features[0].GetFieldCount(); i++) - { - GeoScene.Data.GSOFieldDefn fielddef = (GeoScene.Data.GSOFieldDefn)(features[0].GetFieldDefn(i)); - combCode.Items.Add(fielddef.Name); - combDeep.Items.Add(fielddef.Name); - combModelName.Items.Add(fielddef.Name); - //comboLoad.Items.Add(fielddef.Name); - } - combCode.SelectedItem = "附属物编码"; - combDeep.SelectedItem = "Z坐标"; - combModelName.SelectedItem = "编号"; - //comboLoad.SelectedItem = "模型路径"; - } - - private void buttonXLayerPath_Click(object sender, EventArgs e) - { - OpenFileDialog dlg = new OpenFileDialog(); - dlg.Filter = "*.shp|*.shp"; - dlg.Multiselect = false; - if (dlg.ShowDialog() == DialogResult.OK) - { - GSOLayer layer = globeControl1.Globe.Layers.Add(dlg.FileName); - string txtMessage = valiYBdata(layer); - if (txtMessage != "") - { - button3.Enabled = false; - //textBoxLayer.Text = ""; - combCode.Items.Clear(); - combDeep.Items.Clear(); - combModelName.Items.Clear(); - globeControl1.Globe.Layers.Remove(layer); - FrmValiDataShowErrorMessage showErrorMessage = new FrmValiDataShowErrorMessage(dlg.FileName, txtMessage); - showErrorMessage.ShowDialog(); - return; - } - else - { - button3.Enabled = true; - //textBoxLayer.Text = dlg.FileName; - selectLayerName = layer.Caption; - txtLayerName.Text = layer.Caption; - GSOFeatures features = layer.GetAllFeatures(); - if (features.Length == 0) - return; - - combCode.Items.Clear(); - combDeep.Items.Clear(); - combModelName.Items.Clear(); - for (int i = 0; i < features[0].GetFieldCount(); i++) - { - GeoScene.Data.GSOFieldDefn fielddef = (GeoScene.Data.GSOFieldDefn)(features[0].GetFieldDefn(i)); - combCode.Items.Add(fielddef.Name); - combDeep.Items.Add(fielddef.Name); - combModelName.Items.Add(fielddef.Name); - //comboLoad.Items.Add(fielddef.Name); - } - combCode.SelectedItem = "管点编码"; - combDeep.SelectedItem = "Z坐标"; - combModelName.SelectedItem = "编号"; - } - } - } - + private void FrmAddYuBiZiShp_FormClosing(object sender, FormClosingEventArgs e) { globeControl1.Globe.Refresh(); diff --git a/FrmAllPipelineStatis.cs b/FrmAllPipelineStatis.cs index 6421a26..a6eea29 100644 --- a/FrmAllPipelineStatis.cs +++ b/FrmAllPipelineStatis.cs @@ -84,7 +84,7 @@ chartAllAreaPipeline.Series["管线"].Points.DataBindXY(pipelineLengthAndType.Keys, pipelineLengthAndType.Values); for (int m = 0; m < pipelineLengthAndType.Values.Count; m++) { - if (chartAllAreaPipeline.Series["管线"].Points[m].YValues[0].ToString() != "0") + if (chartAllAreaPipeline.Series["管线"].Points[m]!=null&&chartAllAreaPipeline.Series["管线"].Points[m].YValues[0].ToString() != "0") { chartAllAreaPipeline.Series["管线"].Points[m].Label = chartAllAreaPipeline.Series[0].Points[m].YValues[0].ToString(); } @@ -94,7 +94,7 @@ } catch (Exception ex) { - //LogError.PublishError(ex); + LogHelper.WriteLog(typeof(FrmAllPipelineStatis), ex.Message); } } @@ -147,7 +147,7 @@ } DataTable dt = OledbHelper.QueryTable(sql); - if (dt != null && dt.Rows.Count > 0) + if (dt != null && dt.Rows.Count > 0 && chartAllAreaPipeline.Series["管线"].Points[indexHit]!=null) { dataGridViewX1.DataSource = dt; panel.Visible = true; diff --git a/FrmAllWorkWellStatis.cs b/FrmAllWorkWellStatis.cs index 6fec7af..6af8e4c 100644 --- a/FrmAllWorkWellStatis.cs +++ b/FrmAllWorkWellStatis.cs @@ -52,7 +52,7 @@ chartAllAreaPipeline.Series["井盖"].Points.DataBindXY(workWellLengthAndType.Keys, workWellLengthAndType.Values); for (int m = 0; m < workWellLengthAndType.Values.Count; m++) { - if (chartAllAreaPipeline.Series["井盖"].Points[m].YValues[0].ToString().Trim() != "0") + if (chartAllAreaPipeline.Series["井盖"].Points[m]!=null&&chartAllAreaPipeline.Series["井盖"].Points[m].YValues[0].ToString().Trim() != "0") { chartAllAreaPipeline.Series["井盖"].Points[m].Label = chartAllAreaPipeline.Series[0].Points[m].YValues[0].ToString(); } @@ -60,7 +60,7 @@ } catch (Exception ex) { - //LogError.PublishError(ex); + LogHelper.WriteLog(typeof(FrmAllWorkWellStatis), ex.Message); } } diff --git a/FrmBSQDuoBianXingStatis.cs b/FrmBSQDuoBianXingStatis.cs index e8b7d52..3e889b6 100644 --- a/FrmBSQDuoBianXingStatis.cs +++ b/FrmBSQDuoBianXingStatis.cs @@ -60,7 +60,7 @@ { for (int m = 0; m < bsq1.Values.Count; m++) { - if (chart1.Series["标识器"].Points[m].YValues[0].ToString() != "0") + if (chart1.Series["标识器"].Points[m]!=null&&chart1.Series["标识器"].Points[m].YValues[0].ToString() != "0") { count += Convert.ToInt16(chart1.Series[0].Points[m].YValues[0].ToString()); chart1.Series["标识器"].Points[m].Label = chart1.Series[0].Points[m].YValues[0].ToString(); diff --git a/FrmBSQDuoBianXingStreet.cs b/FrmBSQDuoBianXingStreet.cs index 2005ebb..1db5777 100644 --- a/FrmBSQDuoBianXingStreet.cs +++ b/FrmBSQDuoBianXingStreet.cs @@ -63,7 +63,7 @@ chartStatis.Series[0].Points.DataBindXY(bsq.Keys, bsq.Values); for (int m = 0; m < bsq.Values.Count; m++) { - if (chartStatis.Series[0].Points[m].YValues[0].ToString().Trim() != "0") + if (chartStatis.Series[0].Points[m]!=null&&chartStatis.Series[0].Points[m].YValues[0].ToString().Trim() != "0") { count += Convert.ToInt16(chartStatis.Series[0].Points[m].YValues[0].ToString()); chartStatis.Series[0].Points[m].Label = chartStatis.Series[0].Points[m].YValues[0].ToString(); diff --git a/FrmBSQStatis.cs b/FrmBSQStatis.cs index 390a55c..4aa0ee6 100644 --- a/FrmBSQStatis.cs +++ b/FrmBSQStatis.cs @@ -95,6 +95,8 @@ } } } + + dr.Close(); conn.Close(); for (int i = 0; i < typeLists.Count; i++) { @@ -123,7 +125,7 @@ chartStatis.Series[0].Points.DataBindXY(bsq.Keys, bsq.Values); for (int m = 0; m < bsq.Values.Count; m++) { - if (chartStatis.Series[0].Points[m].YValues[0].ToString().Trim() != "0") + if (chartStatis.Series[0].Points[m]!=null&&chartStatis.Series[0].Points[m].YValues[0].ToString().Trim() != "0") { //count += Convert.ToInt16(chartStatis.Series[0].Points[m].YValues[0].ToString()); chartStatis.Series[0].Points[m].Label = chartStatis.Series[0].Points[m].YValues[0].ToString(); diff --git a/FrmBSQStreet.cs b/FrmBSQStreet.cs index 9d88adb..7fbacad 100644 --- a/FrmBSQStreet.cs +++ b/FrmBSQStreet.cs @@ -44,7 +44,7 @@ chartStatis.Series[0].Points.DataBindXY(bsq.Keys, bsq.Values); for (int m = 0; m < bsq.Values.Count; m++) { - if (chartStatis.Series[0].Points[m].YValues[0].ToString().Trim() != "0") + if (chartStatis.Series[0].Points[m]!=null&&chartStatis.Series[0].Points[m].YValues[0].ToString().Trim() != "0") { count += Convert.ToInt16(chartStatis.Series[0].Points[m].YValues[0].ToString()); chartStatis.Series[0].Points[m].Label = chartStatis.Series[0].Points[m].YValues[0].ToString(); diff --git a/FrmBoosterValvers.cs b/FrmBoosterValvers.cs index 5061efc..df9b62b 100644 --- a/FrmBoosterValvers.cs +++ b/FrmBoosterValvers.cs @@ -236,199 +236,6 @@ count = 0; } } - /// - /// 添加火苗 - /// - /// - /// - /// - /// - private GSOFeature AddFire(double x,double y,double z) - { - // 烟火示例 - - string strResPath = Application.StartupPath + "/Resource"; - - // 烟火粒子示例,由三个发射器构成 - GSOGeoParticle geoParticle = new GSOGeoParticle(); - geoParticle.SetPosition(x, y, z); // 添加到这个经纬度位置 - geoParticle.AltitudeMode = EnumAltitudeMode.RelativeToGround; - - GSORingParticleEmitter emitter = new GSORingParticleEmitter(); - emitter.TexturePath = strResPath + "/ParticleImage/flare.png"; - - emitter.SetSizeFix(1, 1); - emitter.VelFix = 1; - emitter.VelRnd = 5; - - emitter.AngleXYFix = 0; - emitter.AngleXYRnd = 180; - - emitter.AngleXZFix = 90; - emitter.AngleXZRnd = 0; - - emitter.LifeFix = 0.5f; - emitter.LifeRnd = 0.0f; - - emitter.RotFix = 0; - emitter.RotRnd = 0; - - emitter.RotVelFix = 0; - emitter.RotVelRnd = 0; - - emitter.EmitPerSec = 100; - - // 采用线性插值生成粒子的初始颜色 - emitter.ColorRndStart = Color.White; - emitter.ColorRndEnd = Color.Red; - - - GSOColorParticleEffector effector2 = new GSOColorParticleEffector(); - effector2.SetColorChanged(0, -1, -1, 0); - effector2.StartTime = 0.0f; - effector2.EndTime = -1.0f; - emitter.AddEffector(effector2); - - // 将三个发射器添加到粒子对象中 - geoParticle.AddEmitter(emitter); - - geoParticle.Play(); - - GSOFeature feature = new GSOFeature(); - - feature.Geometry = geoParticle; - - globeControl1.Globe.MemoryLayer.AddFeature(feature); - - - return feature; - } - - /// - /// 添加喷泉 - /// - /// - private GSOFeature AddFountain() - { - string strResPath = Application.StartupPath + "/Resource"; - - GSOGeoParticle geoParticle = new GSOGeoParticle(); - geoParticle.SetPosition(116.314, 39.84, 0); // 添加到这个经纬度位置 - - GSOPointParticleEmitter emitter = new GSOPointParticleEmitter(); - emitter.TexturePath = strResPath + "/ParticleImage/test.png"; - - emitter.SetSizeFix(0.5f, 2); - emitter.VelFix = 10; - emitter.VelRnd = 2; - - emitter.GravityAcc = 9.8f; - emitter.AngleXYFix = 0; - emitter.AngleXYRnd = 180; - - emitter.AngleXZFix = 88; - emitter.AngleXZRnd = 2; - - //emitter.InnerRadius = 0; - // emitter.OuterRadius = 0.03f; - - emitter.LifeFix = 5.0f; - emitter.LifeRnd = 1.0f; - - emitter.RotFix = 0; - emitter.RotRnd = 0; - - emitter.RotVelFix = 0; - emitter.RotVelRnd = 0; - - emitter.EmitPerSec = 1000; - emitter.ColorRndStart = Color.FromArgb(33, 255, 255, 255); - emitter.ColorRndEnd = Color.FromArgb(11, 255, 255, 255); - emitter.IsLumAdded = false; - - // 将三个发射器添加到粒子对象中 - geoParticle.AddEmitter(emitter); - - geoParticle.Play(); - GSOFeature feature = new GSOFeature(); - - feature.Geometry = geoParticle; - - //globeControl1.Globe.MemoryLayer.AddFeature(feature); - globeControl1.Globe.FlyToFeature(feature); - - return feature; - } - - /// - /// 添加水柱 - /// - /// - private GSOFeature AddWaterLine() - { - string strResPath = Application.StartupPath + "/Resource"; - - GSOGeoParticle geoParticle = new GSOGeoParticle(); - geoParticle.SetPosition(116.308, 39.84, 0); // 添加到这个经纬度位置 - - GSOPointParticleEmitter emitter = new GSOPointParticleEmitter(); - - emitter.TexturePath = strResPath + "/ParticleImage/drop3.png"; - - geoParticle.TimerInterval = 1; - - emitter.SetSizeFix(2.0f, 2.0f); - - emitter.VelFix = 50; - emitter.VelRnd = 2; - - // emitter.IsLumAdded = false; - - emitter.GravityAcc = 9.8f; - emitter.AngleXYFix = 0; - emitter.AngleXYRnd = 2; - - emitter.AngleXZFix = 60; - emitter.AngleXZRnd = 2; - - //emitter.InnerRadius = 0; - // emitter.OuterRadius = 0.1f; - - emitter.LifeFix = 5.0f; - emitter.LifeRnd = 1.0f; - - emitter.RotFix = 0; - emitter.RotRnd = 0; - - emitter.RotVelFix = 0; - emitter.RotVelRnd = 0; - - emitter.EmitPerSec = 1500; - - emitter.ColorRndStart = Color.FromArgb(100, 222, 222, 222); - emitter.ColorRndEnd = Color.FromArgb(50, 222, 222, 222); - - /* - - GSOScaleParticleEffector effector1 = new GSOScaleParticleEffector(); - effector1.SetScale(0.2f, 0.2f); - effector1.StartTime = 0; - effector1.EndTime = -1; // 负数表示整个粒子生命结束 - emitter.AddEffector(effector1); - */ - - // 将三个发射器添加到粒子对象中 - geoParticle.AddEmitter(emitter); - - geoParticle.Play(); - GSOFeature feature = new GSOFeature(); - - feature.Geometry = geoParticle; - - //globeControl1.Globe.MemoryLayer.AddFeature(feature); - globeControl1.Globe.FlyToFeature(feature); - - return feature; - } + } } diff --git a/FrmBufferAnalysis.cs b/FrmBufferAnalysis.cs index f711133..db8ca59 100644 --- a/FrmBufferAnalysis.cs +++ b/FrmBufferAnalysis.cs @@ -123,39 +123,6 @@ } } /// - /// 半径文本框的键盘按键按下事件处理 - /// - /// - /// - private void txtRadius_KeyPress(object sender, KeyPressEventArgs e) - { - TextBox text = sender as TextBox; - if ((e.KeyChar < 48 || e.KeyChar > 57) && (e.KeyChar != 8) && (int)e.KeyChar != 46) - { - e.Handled = true; - } - if ((int)e.KeyChar == 46) //小数点 - { - if (text.Text.Length <= 0) - e.Handled = true; //小数点不能在第一位 - else //处理不规则的小数点 - { - float f; - float oldf; - bool b1 = false, b2 = false; - b1 = float.TryParse(text.Text, out oldf); - b2 = float.TryParse(text.Text + e.KeyChar.ToString(), out f); - if (b2 == false) - { - if (b1 == true) - e.Handled = true; - else - e.Handled = false; - } - } - } - } - /// /// 窗体关闭事件处理 /// /// diff --git a/FrmBufferAnalysisBSQ.cs b/FrmBufferAnalysisBSQ.cs index 24a96ca..f54208f 100644 --- a/FrmBufferAnalysisBSQ.cs +++ b/FrmBufferAnalysisBSQ.cs @@ -137,35 +137,7 @@ } } - private void txtRadius_KeyPress(object sender, KeyPressEventArgs e) - { - TextBox text = sender as TextBox; - if ((e.KeyChar < 48 || e.KeyChar > 57) && (e.KeyChar != 8) && (int)e.KeyChar != 46) - { - e.Handled = true; - } - if ((int)e.KeyChar == 46) //小数点 - { - if (text.Text.Length <= 0) - e.Handled = true; //小数点不能在第一位 - else //处理不规则的小数点 - { - float f; - float oldf; - bool b1 = false, b2 = false; - b1 = float.TryParse(text.Text, out oldf); - b2 = float.TryParse(text.Text + e.KeyChar.ToString(), out f); - if (b2 == false) - { - if (b1 == true) - e.Handled = true; - else - e.Handled = false; - } - } - } - } - + private void FrmBufferAnalysis_FormClosing(object sender, FormClosingEventArgs e) { //Form1.y = 0; @@ -316,27 +288,6 @@ } } - private void FlyToMenu_Click(object sender, EventArgs e) - { - if (m_feature != null) - { - if (m_feature.Geometry != null && m_feature.Geometry.Type == EnumGeometryType.GeoPolyline3D) - { - GSOGeoPolyline3D line = m_feature.Geometry as GSOGeoPolyline3D; - double length = line.GetSpaceLength(true, 6378137); - GSOGeoPolyline3D lineLine = line.GetSegment(0, length / 2); - GSOPoint3d point3d = lineLine[lineLine.PartCount - 1][lineLine[lineLine.PartCount - 1].Count - 1]; - - globeControl1.Globe.FlyToPosition(point3d, EnumAltitudeMode.Absolute, 0, 45, 5); - } - else - { - globeControl1.Globe.FlyToFeature(m_feature, 0, 45, 3); - } - LightMenu_Click(sender, e); - } - } - private void LightMenu_Click(object sender, EventArgs e) { flashflag = "single"; diff --git a/FrmDataBaseOpt.cs b/FrmDataBaseOpt.cs index b0c4b5d..8d7b69d 100644 --- a/FrmDataBaseOpt.cs +++ b/FrmDataBaseOpt.cs @@ -362,6 +362,7 @@ dbCombor.Items.Add(dblist[i].title); } } + /* /// /// 从配置文件读取数据库参数配置 /// @@ -428,6 +429,8 @@ } } + * */ + /* /// /// 向配置文件写入连接数据库的参数配置 /// @@ -485,6 +488,7 @@ MessageBox.Show(exp.ToString()); } } + * */ /// /// /// diff --git a/FrmDatabaseParaSetting.cs b/FrmDatabaseParaSetting.cs index a6fea46..63b596b 100644 --- a/FrmDatabaseParaSetting.cs +++ b/FrmDatabaseParaSetting.cs @@ -152,6 +152,7 @@ this.DialogResult = DialogResult.OK; this.Close(); } + /* /// /// 从配置文件读取数据库连接参数配置 /// @@ -218,6 +219,8 @@ } } + * */ + /* /// /// 向配置文件写入数据库参数配置 /// @@ -276,7 +279,7 @@ MessageBox.Show(ex.ToString()); } } - + */ /// /// 取消按钮事件处理 /// diff --git a/FrmDatabaseParaSetting2.cs b/FrmDatabaseParaSetting2.cs index 932d05e..96a87d5 100644 --- a/FrmDatabaseParaSetting2.cs +++ b/FrmDatabaseParaSetting2.cs @@ -148,6 +148,7 @@ this.DialogResult = DialogResult.OK; this.Close(); } + /* /// /// 从配置文件读取数据库连接参数配置 /// @@ -214,6 +215,8 @@ } } + * */ + /* /// /// 向配置文件写入数据库参数配置 /// @@ -272,7 +275,7 @@ MessageBox.Show(exp.ToString()); } } - + */ /// /// 取消按钮事件处理 /// diff --git a/FrmDiameterQuery.cs b/FrmDiameterQuery.cs index 68c948b..9a5215b 100644 --- a/FrmDiameterQuery.cs +++ b/FrmDiameterQuery.cs @@ -77,18 +77,7 @@ isBetween = true; } } - /// - /// 键盘按键按下事件处理 - /// - /// - /// - private void textBoxX1_KeyPress(object sender, KeyPressEventArgs e) - { - if ((e.KeyChar < 48 || e.KeyChar > 57) && e.KeyChar != 8) - { - e.Handled = true;//屏蔽 - } - } + bool isBetween = false; /// diff --git a/FrmDocumentEdit.cs b/FrmDocumentEdit.cs index aab2d31..e78a7ff 100644 --- a/FrmDocumentEdit.cs +++ b/FrmDocumentEdit.cs @@ -256,121 +256,6 @@ } - // - /// 将本地文件上传到指定的服务器(HttpWebRequest方法) - /// - /// 文件上传到的服务器 - /// 要上传的本地文件(全路径) - /// 文件上传后的名称 - /// 上传进度条 - /// 成功返回1,失败返回0 - private int Upload_Request(string address, string fileNamePath, string saveName, ProgressBar progressBar) - { - int returnValue = 0; - // 要上传的文件 - FileStream fs = new FileStream(fileNamePath, FileMode.Open, FileAccess.Read); - BinaryReader r = new BinaryReader(fs); - //时间戳 - string strBoundary = "----------" + DateTime.Now.Ticks.ToString("x"); - byte[] boundaryBytes = Encoding.ASCII.GetBytes("/r/n--" + strBoundary + "/r/n"); - //请求头部信息 - StringBuilder sb = new StringBuilder(); - sb.Append("--"); - sb.Append(strBoundary); - sb.Append("\r\n"); - sb.Append("Content-Disposition: form-data; name=\""); - sb.Append("file"); - sb.Append("\"; filename=\""); - sb.Append(saveName); - sb.Append("\""); - sb.Append("\r\n"); - sb.Append("Content-Type: "); - sb.Append("application/octet-stream"); - sb.Append("\r\n"); - sb.Append("\r\n"); - string strPostHeader = sb.ToString(); - byte[] postHeaderBytes = Encoding.UTF8.GetBytes(strPostHeader); - // 根据uri创建HttpWebRequest对象 - HttpWebRequest httpReq = (HttpWebRequest)WebRequest.Create(new Uri(address)); - httpReq.Method = "POST"; - //对发送的数据不使用缓存 - httpReq.AllowWriteStreamBuffering = false; - //设置获得响应的超时时间(300秒) - httpReq.Timeout = 300000; - httpReq.ContentType = "multipart/form-data; boundary=" + strBoundary; - long length = fs.Length + postHeaderBytes.Length + boundaryBytes.Length; - long fileLength = fs.Length; - httpReq.ContentLength = length; - try - { - progressBar.Maximum = int.MaxValue; - progressBar.Minimum = 0; - progressBar.Value = 0; - //每次上传4k - int bufferLength = 4096; - byte[] buffer = new byte[bufferLength]; - //已上传的字节数 - long offset = 0; - //开始上传时间 - DateTime startTime = DateTime.Now; - int size = r.Read(buffer, 0, bufferLength); - Stream postStream = httpReq.GetRequestStream(); - //发送请求头部消息 - postStream.Write(postHeaderBytes, 0, postHeaderBytes.Length); - while (size > 0) - { - postStream.Write(buffer, 0, size); - offset += size; - progressBar.Value = (int)(offset * (int.MaxValue / length)); - TimeSpan span = DateTime.Now - startTime; - double second = span.TotalSeconds; - //lblTime.Text = "已用时:" + second.ToString("F2") + "秒"; - //if (second > 0.001) - //{ - // lblSpeed.Text = " 平均速度:" + (offset / 1024 / second).ToString("0.00") + "KB/秒"; - //} - //else - //{ - // lblSpeed.Text = " 正在连接…"; - //} - //lblState.Text = "已上传:" + (offset * 100.0 / length).ToString("F2") + "%"; - //lblSize.Text = (offset / 1048576.0).ToString("F2") + "M/" + (fileLength / 1048576.0).ToString("F2") + "M"; - Application.DoEvents(); - size = r.Read(buffer, 0, bufferLength); - } - //添加尾部的时间戳 - postStream.Write(boundaryBytes, 0, boundaryBytes.Length); - postStream.Close(); - //获取服务器端的响应 - WebResponse webRespon = httpReq.GetResponse(); - Stream s = webRespon.GetResponseStream(); - StreamReader sr = new StreamReader(s); - //读取服务器端返回的消息 - String sReturnString = sr.ReadLine(); - s.Close(); - sr.Close(); - if (sReturnString == "Success") - { - returnValue = 1; - } - else if (sReturnString == "Error") - { - returnValue = 0; - } - } - catch(Exception ex) - { - returnValue = 0; - string str = ex.ToString(); - } - finally - { - fs.Close(); - r.Close(); - } - return returnValue; - } - private void btn_file_Click(object sender, EventArgs e) { OpenFileDialog dlg = new OpenFileDialog(); diff --git a/FrmExportCADS.cs b/FrmExportCADS.cs index 98772ea..59629dd 100644 --- a/FrmExportCADS.cs +++ b/FrmExportCADS.cs @@ -108,65 +108,6 @@ MessageBox.Show("请选中要导出的图层!", "提示", MessageBoxButtons.OK, MessageBoxIcon.Warning); } } - private Boolean MerageToFile(GSOFeatures features, String strDestFile, String strProj4)//图层追加 - { - if (features == null) - { - return false; - } - Boolean bSuccess = false; - - string strDir = GSOUtility.GetFileDir(strDestFile); - string strLPRJFile = GSOUtility.ChangeExt(strDestFile, ".lprj"); - string strExt = GSOUtility.GetFileExt(strDestFile); - - // 如果投影文件存在,投影以投影文件为准 - if (File.Exists(strLPRJFile)) - { - // 如果是dxf,则这样处理 - if (strExt.ToLower() == ".dxf") - { - string strTempSrcFile = strDir + "srcFeatures_dxftmp" + strExt; - globeControl1.Globe.DataManager.SaveFeatureData(features, strTempSrcFile, strLPRJFile, 4); - bSuccess = GSOUtility.MergeTwoDXFFileFeatures(strDestFile, strTempSrcFile); - File.Delete(strTempSrcFile); - } - else - { - GSOFeatures srcFeatures = globeControl1.Globe.DataManager.ReadFeatureData(strDestFile); - int nCount = features.Length; - int i = 0; - for (i = 0; i < nCount; i++) - { - srcFeatures.Add(features[i]); - } - bSuccess = globeControl1.Globe.DataManager.SaveFeatureData(srcFeatures, strDestFile, strLPRJFile, 4); - } - } - else - { - // 如果是dxf,则这样处理 - if (strExt.ToLower() == ".dxf") - { - string strTempSrcFile = strDir + "srcFeatures_dxftmp" + strExt; - globeControl1.Globe.DataManager.SaveFeatureData(features, strTempSrcFile, strProj4, 0); - bSuccess = GSOUtility.MergeTwoDXFFileFeatures(strDestFile, strTempSrcFile); - File.Delete(strTempSrcFile); - } - else - { - GSOFeatures srcFeatures = globeControl1.Globe.DataManager.ReadFeatureData(strDestFile); - int nCount = features.Length; - int i = 0; - for (i = 0; i < nCount; i++) - { - srcFeatures.Add(features[i]); - } - bSuccess = globeControl1.Globe.DataManager.SaveFeatureData(srcFeatures, strDestFile, strProj4, 0); - } - } - return bSuccess; - } /// /// 关闭按钮事件处理 /// diff --git a/FrmHDMAnalysis3.cs b/FrmHDMAnalysis3.cs index 4f73af6..2ada735 100644 --- a/FrmHDMAnalysis3.cs +++ b/FrmHDMAnalysis3.cs @@ -436,29 +436,6 @@ } layerTemp.RemoveAllFeature(); } - private void Export(GSOPoint3d _pnt, double r) - { - GSOPoint3ds pnts = new GSOPoint3ds(); - GSOPoint3d pnt = new GSOPoint3d(); - pnt.X = _pnt.X; - pnt.Y = _pnt.Y; - pnt.Z = _pnt.Z; - pnts.Add(pnt); - pnt.X = _pnt.X; - pnt.Y = _pnt.Y - 0.0000000005; - pnt.Z = _pnt.Z; - pnts.Add(pnt); - GSOGeoPolyline3D line = new GSOGeoPolyline3D(); - line.AddPart(pnts); - GSOGeoPolygon3D polygon = line.CreateBuffer(r * 2, true, 5, true, false); - GSOPoint3ds points = polygon[0]; - GSOGeoPolyline3D newLine = new GSOGeoPolyline3D(); - newLine.AddPart(points); - newLine.AltitudeMode = EnumAltitudeMode.RelativeToGround; - GSOFeature newFeature = new GSOFeature(); - newFeature.Geometry = newLine; - globeControl1.Globe.MemoryLayer.AddFeature(newFeature); - } private void ExportCAD(double a, double b, double r) { diff --git a/FrmHotFuncStat.cs b/FrmHotFuncStat.cs index c980f34..2eb1476 100644 --- a/FrmHotFuncStat.cs +++ b/FrmHotFuncStat.cs @@ -421,13 +421,6 @@ } } - private void HFS_Pderive_Click(object sender, EventArgs e) - { - if (TV_Files.SelectedNode != null) - { - HFSClass.GuideEdit_form("G", TV_Files, int.Parse(((ToolStripMenuItem)sender).Tag.ToString())); - } - } private void 导入ToolStripMenuItem_Click(object sender, EventArgs e) { @@ -530,22 +523,8 @@ } } - private void 导出ToolStripMenuItem1_Click(object sender, EventArgs e) - { - 导出ToolStripMenuItem2_Click(sender, e); - } + - private void TV_HFSSrchRslt_AfterCollapse(object sender, TreeViewEventArgs e) - { - e.Node.ImageIndex = 0; - } - - private void TV_HFSSrchRslt_AfterExpand(object sender, TreeViewEventArgs e) - { - HFSClass.ADD_TreeNode(TV_Files, e.Node); - e.Node.ImageIndex = 1; - } - private void 导出ToolStripMenuItem1_Click_1(object sender, EventArgs e) { if ((TV_HFSSrchRslt.SelectedNode != null) && (TV_HFSSrchRslt.SelectedNode.Parent != null)) diff --git a/FrmLayerControl.cs b/FrmLayerControl.cs index e7917c3..28fa14d 100644 --- a/FrmLayerControl.cs +++ b/FrmLayerControl.cs @@ -312,26 +312,7 @@ layerManagerNode.Expand(); terrainManagerNode.Expand(); } - /// - /// 刷新节点树 - /// - private void RefreshDataTree() - { - layerTree2.Nodes[0].Nodes.Clear(); - Int32 nCount = globeControl2.Globe.Layers.Count; - Int32 i = 0; - for (i = 0; i < nCount; i++) - { - GSODataset dataSpace = globeControl2.Globe.Layers[i].Dataset; - TreeNode node = new TreeNode(); - node.Text = dataSpace.Name; - node.ImageIndex = 0; - node.SelectedImageIndex = 0; - node.Checked = true; - node.Tag = dataSpace; - layerTree2.Nodes[0].Nodes.Add(node); - } - } + /// /// 目标图层按钮事件处理 /// @@ -494,22 +475,8 @@ } } } - /// - /// 改变指定节点的选中状态 - /// - /// - /// - private void CheckTreeNode(TreeNode node, Boolean bChecked) - { - CheckChildTreeNode(node, bChecked); - // 对于kml图层,如果当前处理的节点是true,那么要把所有的祖宗节点置为true - // 只有所有节点都未false,那么这个节点才为false - // CheckFatherTreeNode(node, bChecked); - globeControl1.Globe.Refresh(); - globeControl2.Globe.Refresh(); - - } + private void CheckChildTreeNode(TreeNode node, Boolean bChecked) { if (node == null) @@ -696,59 +663,7 @@ //} //CheckControl(e); } - /// - /// 树节点选中方法 - /// - /// - private void CheckControl(TreeViewEventArgs e) - { - if (e.Action != TreeViewAction.Unknown) - { - if (e.Node != null && !Convert.IsDBNull(e.Node)) - { - CheckParentNode(e.Node); - if (e.Node.Nodes.Count > 0) - { - CheckAllChildNodes(e.Node, e.Node.Checked); - } - } - } - } - /// - /// 改变所有子节点的状态 - /// - /// - /// - private void CheckAllChildNodes(TreeNode pn, bool IsChecked) - { - foreach (TreeNode tn in pn.Nodes) - { - tn.Checked = IsChecked; - if (tn.Tag.ToString().Contains("|")) - { - string nodeTag = tn.Tag.ToString().Split('|')[1]; - GSOLayer layer = globeControl1.Globe.Layers.GetLayerByCaption(nodeTag); - if (layer != null) - { - layer.Visible = IsChecked; - globeControl1.Globe.Refresh(); - } - } - if (tn.Tag is GSOFeature) - { - if (tn.Nodes.Count == 0) - { - GSOFeature feat = tn.Tag as GSOFeature; - feat.Visible = IsChecked; - globeControl1.Globe.Refresh(); - } - } - if (tn.Nodes.Count > 0) - { - CheckAllChildNodes(tn, IsChecked); - } - } - } + /// /// 改变父节点的选中状态,此处为所有子节点不选中时才取消父节点选中,可以根据需要修改 /// diff --git a/FrmLogin.cs b/FrmLogin.cs index 320fdd5..2afe46e 100644 --- a/FrmLogin.cs +++ b/FrmLogin.cs @@ -59,70 +59,6 @@ textBoxPassWord.Clear(); } } - - /// - /// 验证端口号 - /// - /// - private bool ValiPort() - { - Ping p = new Ping();//创建Ping对象p - PingReply pr = p.Send(Utility.localicenseserverip);//向指定IP或者主机名的计算机发送ICMP协议的ping数据包 - if (pr.Status == IPStatus.Success)//如果ping成功 - { - try - { - TcpClient tcpc = new TcpClient(Utility.localicenseserverip, Utility.localicenseserverport);//对IP地址为"192.168.0.105"的计算机的1500端口提出连接申请 - tcpc.Close(); - return true; - } - catch (Exception ex) - { - MessageBox.Show("端口连接错误!" + ex.Message); - return false; - } - } - else - { - int times = 0;//重新连接次数; - int count = 2;//设置尝试次数 - while (times < count) - { - //Thread.Sleep(1000);//等待时间(方便测试的话,你可以改为1000) - pr = p.Send(Utility.localicenseserverip); - - if (pr.Status == IPStatus.Success) - { - try - { - TcpClient tcpc = new TcpClient(Utility.localicenseserverip, Utility.localicenseserverport);//对IP地址为"192.168.0.105"的计算机的1500端口提出连接申请 - tcpc.Close(); - return true; - } - catch (Exception ex) - { - MessageBox.Show("端口连接错误!" + ex.Message); - return false; - } - } - else - { - times++; - if (times < count) - { - continue; - } - else - { - MessageBox.Show("重新尝试连接失败"); - return false; - } - } - - } - return false; - } - } /// /// 验证用户名、密码 /// diff --git a/FrmMetadata.cs b/FrmMetadata.cs index 886f65a..0365372 100644 --- a/FrmMetadata.cs +++ b/FrmMetadata.cs @@ -27,11 +27,7 @@ InitializeComponent(); loadTreeView(layerTree); } - private void FrmMetadata_Load(object sender, EventArgs e) - { - //this.ntLblC.Text = "nn"; - // loadTreeView(layerTree); - } + private void loadTreeView(TreeView tv)//构建图层树 { try diff --git a/FrmMetadataStat.cs b/FrmMetadataStat.cs index 790658a..e7696c6 100644 --- a/FrmMetadataStat.cs +++ b/FrmMetadataStat.cs @@ -197,9 +197,5 @@ } } - private void buttonX1_Click(object sender, EventArgs e) - { - drawChart(); - } } } diff --git a/FrmPatrolerManager.cs b/FrmPatrolerManager.cs index 37f8ffd..9e66aeb 100644 --- a/FrmPatrolerManager.cs +++ b/FrmPatrolerManager.cs @@ -109,82 +109,8 @@ this.winGridViewPager1.AllToExport = table; } - /// - /// 编辑 - /// - /// - /// - private void winGridViewPager1_OnEditSelected(object sender, EventArgs e) - { - - DataGridView grid = sender as DataGridView; - if (grid != null && grid.SelectedRows.Count>0) - { - DataGridViewRow row = grid.SelectedRows[0]; - try - { - long dbid = long.Parse(row.Cells["编号"].Value.ToString()); - String name = row.Cells["姓名"].Value.ToString(); - String sex = row.Cells["性别"].Value.ToString(); - String age = row.Cells["年龄"].Value.ToString(); - string phone = row.Cells["电话"].Value.ToString(); - age = String.IsNullOrEmpty(age.ToString().Trim()) ? "1" : age.ToString().Trim(); - FrmPatrolerEdit frm = new FrmPatrolerEdit(dbid.ToString(), name, age, sex, phone); - frm.reloadGrid += new ReloadPatrolerGrid(LoadData); - frm.ShowDialog(); - winGridViewPager1.Refresh(); - } - catch (Exception ex) - { - MessageBox.Show("编辑失败:" + ex.ToString(), "错误", MessageBoxButtons.OK, MessageBoxIcon.Error); - } - } - else - { - MessageBox.Show("没有选择记录", "提示"); - } - - } - - /// - /// 删除 - /// - /// - /// - private void winGridViewPager1_OnDeleteSelected(object sender, EventArgs e) - { - DataGridView grid = sender as DataGridView; - if (grid != null && grid.SelectedRows.Count > 0) - { - DataGridViewRow row = grid.SelectedRows[0]; - long dbid = long.Parse(row.Cells["编号"].Value.ToString()); - try - { - string state = row.Cells["状态"].Value.ToString(); - if ("在线".Equals(state)) - { - if (MessageBox.Show("确定注销?", "确认", MessageBoxButtons.YesNo, MessageBoxIcon.Question) == DialogResult.Yes) - { - String sql = "update patroler t set t.accountstate='LEAVER' where t.dbid=" + dbid; - OracleUtils.ExecuteNonQuery(OracleUtils.ConnectionString, CommandType.Text, sql); - } - } - else { - MessageBox.Show("人员不在线,无法注销", "信息"); - } - } - catch (Exception ex) - { - MessageBox.Show("人员注销失败:" + ex.ToString(), "错误", MessageBoxButtons.OK, MessageBoxIcon.Error); - } - } - else - { - MessageBox.Show("没有选择记录", "提示"); - } - } - - + + private void LoadData() { int pageIndex = winGridViewPager1.PagerInfo.CurrenetPageIndex; diff --git a/FrmRoadHDM.cs b/FrmRoadHDM.cs index e765313..e871dd5 100644 --- a/FrmRoadHDM.cs +++ b/FrmRoadHDM.cs @@ -333,31 +333,6 @@ this.Cursor = Cursors.Default; } } - - private void Export(GSOPoint3d _pnt, double r) - { - GSOPoint3ds pnts = new GSOPoint3ds(); - GSOPoint3d pnt = new GSOPoint3d(); - pnt.X = _pnt.X; - pnt.Y = _pnt.Y; - pnt.Z = _pnt.Z; - pnts.Add(pnt); - pnt.X = _pnt.X; - pnt.Y = _pnt.Y - 0.0000000005; - pnt.Z = _pnt.Z; - pnts.Add(pnt); - GSOGeoPolyline3D line = new GSOGeoPolyline3D(); - line.AddPart(pnts); - GSOGeoPolygon3D polygon = line.CreateBuffer(r * 2, true, 5, true, false); - GSOPoint3ds points = polygon[0]; - GSOGeoPolyline3D newLine = new GSOGeoPolyline3D(); - newLine.AddPart(points); - newLine.AltitudeMode = EnumAltitudeMode.RelativeToGround; - GSOFeature newFeature = new GSOFeature(); - newFeature.Geometry = newLine; - globeControl1.Globe.MemoryLayer.AddFeature(newFeature); - } - private void ExportCAD(double a, double b, double r) { GSOPoint3ds pnts = new GSOPoint3ds(); diff --git a/FrmUserAdd.cs b/FrmUserAdd.cs index c612ab4..f826427 100644 --- a/FrmUserAdd.cs +++ b/FrmUserAdd.cs @@ -231,24 +231,6 @@ //cbxRegion.SelectedIndexChanged += new EventHandler(cbxRegion_SelectedIndexChanged); } } - /// - /// 下拉框选中项改变事件处理 - /// - /// - /// - private void cbxRegion_SelectedIndexChanged(object sender, EventArgs e) - { - string sql = ""; - //string sql = "select casic_role.\"name\" from casic_role join casic_regionrole on casic_role.\"id\"=casic_regionrole.\"rid\" where casic_regionrole.\"reid\"=" + region[cbxRegion.SelectedItem.ToString().Trim()]; - DataTable dt = OledbHelper.QueryTable(sql); - if (dt != null && dt.Rows.Count > 0) - { - comboBoxExRegionRole.Items.Clear(); - for (int i = 0; i < dt.Rows.Count; i++) - { - comboBoxExRegionRole.Items.Add(dt.Rows[i][0].ToString().Trim());//部门角色 - } - } - } + } } diff --git a/FrmUserManager.cs b/FrmUserManager.cs index 571f0f0..ae254bc 100644 --- a/FrmUserManager.cs +++ b/FrmUserManager.cs @@ -81,11 +81,6 @@ } } } - //创建新用户 - private void buttonX2_Click(object sender, EventArgs e) - { - FrmUserAdd frm = new FrmUserAdd(-1); - frm.ShowDialog(); - } + } } diff --git a/FrmValveStatistics.cs b/FrmValveStatistics.cs index 545d56c..dd76777 100644 --- a/FrmValveStatistics.cs +++ b/FrmValveStatistics.cs @@ -54,7 +54,7 @@ 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") + if (chaFamenStatis.Series["阀门"].Points[m]!=null&&chaFamenStatis.Series["阀门"].Points[m].YValues[0].ToString() != "0") { chaFamenStatis.Series["阀门"].Points[m].Label = chaFamenStatis.Series[0].Points[m].YValues[0].ToString(); } diff --git a/Frm_password_reset.cs b/Frm_password_reset.cs index 7b51039..b9e5dc3 100644 --- a/Frm_password_reset.cs +++ b/Frm_password_reset.cs @@ -41,6 +41,7 @@ } catch (Exception ex) { + LogHelper.WriteLog(typeof(Frm_password_reset), ex.Message); } } private void initCombox() diff --git a/FrmpipeDeepstatis.cs b/FrmpipeDeepstatis.cs index e156db4..1a84d6c 100644 --- a/FrmpipeDeepstatis.cs +++ b/FrmpipeDeepstatis.cs @@ -307,7 +307,7 @@ chart1.Series[j].Points.DataBindXY(dic1.Keys, dic1.Values); for (int m = 0; m < dic1.Values.Count; m++) { - if (chart1.Series[j].Points[m].YValues[0].ToString() != "0") + if (chart1.Series[j].Points[m]!=null&&chart1.Series[j].Points[m].YValues[0].ToString() != "0") { chart1.Series[j].Points[m].Label = chart1.Series[j].Points[m].YValues[0].ToString(); diff --git a/FrmpipeDiametergather.cs b/FrmpipeDiametergather.cs index 30674de..057b09d 100644 --- a/FrmpipeDiametergather.cs +++ b/FrmpipeDiametergather.cs @@ -263,6 +263,7 @@ if (layer != null && layer is GSOFeatureLayer) { GSOFeatureLayer flayer = layer as GSOFeatureLayer; + if (layer == null) return; GSOFeatures features = flayer.GetAllFeatures(); if (features.Length > 0) { diff --git a/FrmpipeMaterialGather.cs b/FrmpipeMaterialGather.cs index c133ec3..398b884 100644 --- a/FrmpipeMaterialGather.cs +++ b/FrmpipeMaterialGather.cs @@ -280,6 +280,7 @@ if (layer != null && layer is GSOFeatureLayer) { GSOFeatureLayer flayer = layer as GSOFeatureLayer; + if (flayer == null) return; GSOFeatures features = flayer.GetAllFeatures(); if (features.Length > 0) { @@ -332,7 +333,7 @@ chart1.Series[j].Points.DataBindXY(dic1.Keys, dic1.Values); for (int m = 0; m < dic1.Values.Count; m++) { - if (chart1.Series[j].Points[m].YValues[0].ToString() != "0") + if (chart1.Series[j].Points[m]!=null&&chart1.Series[j].Points[m].YValues[0].ToString() != "0") { chart1.Series[j].Points[m].Label = chart1.Series[j].Points[m].YValues[0].ToString(); } diff --git a/Frmpipediameterstatis.cs b/Frmpipediameterstatis.cs index c0ed80a..50f8170 100644 --- a/Frmpipediameterstatis.cs +++ b/Frmpipediameterstatis.cs @@ -286,6 +286,7 @@ chart1.Series.Add(layerCaption); GSOFeatureLayer flayer = layer as GSOFeatureLayer; + if (layer == null) return; GSOFeatures features = flayer.GetAllFeatures(); if (features.Length > 0) { diff --git "a/GKT_Forms/F_GKT\346\225\260\346\215\256\350\276\223\345\205\245\350\276\223\345\207\272.cs" "b/GKT_Forms/F_GKT\346\225\260\346\215\256\350\276\223\345\205\245\350\276\223\345\207\272.cs" index c7bffd5..4db7d5d 100644 --- "a/GKT_Forms/F_GKT\346\225\260\346\215\256\350\276\223\345\205\245\350\276\223\345\207\272.cs" +++ "b/GKT_Forms/F_GKT\346\225\260\346\215\256\350\276\223\345\205\245\350\276\223\345\207\272.cs" @@ -198,12 +198,7 @@ } DialogResult = DialogResult.OK;//将当前窗体的对话框返回值设为OK } - private void treeView1_NodeMouseClick(object sender, TreeNodeMouseClickEventArgs e) - { - dir_Ok = comboBox_Disk.Text + e.Node.FullPath; - //dir = comboBox_Disk.Text + e.Node.FullPath; - e.Node.SelectedImageIndex = e.Node.ImageIndex; - } + string tempstr = ""; private void button1_Click(object sender, EventArgs e) { diff --git a/HFS_Forms/Frm_HFSprojedits.cs b/HFS_Forms/Frm_HFSprojedits.cs index 96dd76f..3c232a1 100644 --- a/HFS_Forms/Frm_HFSprojedits.cs +++ b/HFS_Forms/Frm_HFSprojedits.cs @@ -126,16 +126,6 @@ Close(); } - - - private void TB_ProjName_KeyPress(object sender, KeyPressEventArgs e) - { - if (HFSAClass.Files_NameChar(e) == 0) - e.Handled = true; - if (e.KeyChar == '\r') - OK_Click(sender, e); - } - private void Frm_HFSProjedit_Load(object sender, EventArgs e) { @@ -175,10 +165,6 @@ } } - private void Cancel_Click(object sender, EventArgs e) - { - this.Close(); - } private void Cancel_Click_1(object sender, EventArgs e) { diff --git a/MainFrm.cs b/MainFrm.cs index 2c305a0..ed2685b 100644 --- a/MainFrm.cs +++ b/MainFrm.cs @@ -617,7 +617,7 @@ } catch (Exception ex) { - + LogHelper.WriteLog(typeof(MainFrm), ex.Message); } } @@ -1768,7 +1768,7 @@ } catch (Exception ex) { - //LogError.PublishError(ex); + LogHelper.WriteLog(typeof(MainFrm), ex.Message); } } @@ -2026,6 +2026,7 @@ } catch (Exception ex) { + LogHelper.WriteLog(typeof(MainFrm), ex.Message); result = false; } finally @@ -2316,220 +2317,6 @@ string filename = Utility.filename; List g1layername = new List(); /// - /// 构建图层列表目录树 - /// - /// - private void loadTreeView(TreeView tv) - { - try - { - XmlDocument doc = new XmlDocument(); - doc.Load(filename); - XmlNodeList Params1 = doc.SelectNodes("/Params/layers"); - tv.ShowLines = false; - tv.CheckBoxes = true; - - foreach (XmlNode paramsNode in Params1) //layers - { - foreach (XmlNode layerNode in paramsNode) //layer - { - TreeNode nodelayer = new TreeNode(); - string layerName = layerNode.Attributes["label"].Value; - nodelayer.Text = layerName; - - if (layerNode.HasChildNodes != false) - { - tv.Nodes.Add(nodelayer); - foreach (XmlNode layerchildNode in layerNode) //layerchild - { - if (layerchildNode.Name == "layerchild") - { - TreeNode nodelayerchild = new TreeNode(); - string layerType = layerchildNode.Attributes["type"].Value; - string layerName1 = layerchildNode.Attributes["layer"].Value; - string layerchildName = layerchildNode.Attributes["label"].Value; - if (layerType == "locaserver") - { - if (layerchildNode.Attributes["isRoad"] != null) - { - roadLayerName = layerchildName; - } - dictionaryNetLayerNameAndCaption.Add(layerName1, layerchildName); - - nodelayerchild.Text = layerchildName; - nodelayerchild.Tag = layerType + "|" + layerchildName; - nodelayerchild.Checked = true; - nodelayer.Nodes.Add(nodelayerchild); - } - else - { - if (layerchildNode.Attributes["isPipeLine"] != null) - { - m_PipelineLayerNames.Add(layerchildName); - } - if (layerchildNode.Attributes["isWorkWell"] != null) - { - workwellLayerNames.Add(layerchildName); - } - if (layerchildNode.Attributes["isValve"] != null) - { - valueLayerNames.Add(layerchildName); - } - //if (layerchildNode.Attributes["isInstrument"] != null) - if (layerchildNode.Attributes["isAccess"] != null) - { - instrumenLayerNames.Add(layerchildName); - } - //if (layerchildNode.Attributes["isPipeFitting"] != null) - if (layerchildNode.Attributes["isCharacter"] != null) - { - pipefittingLayerNames.Add(layerchildName); - } - bool boollayer = AddLayers(layerName1, layerchildName); - nodelayerchild.Text = layerchildName; - nodelayerchild.Tag = layerType + "|" + layerchildName; - nodelayerchild.Checked = boollayer; - if (layerchildName.Contains("特征管点")) - { - nodelayerchild.Checked = false; - setLayerVisible(layerName1); - } - - nodelayer.Nodes.Add(nodelayerchild); - g1layername.Add(layerName1); - } - } - else if (layerchildNode.Name == "layertype") - { - TreeNode nodelayerchild = new TreeNode(); - string layerType = layerchildNode.Attributes["label"].Value; - nodelayerchild.Text = layerType; - nodelayerchild.Tag = layerType; - nodelayerchild.Checked = true; - nodelayer.Nodes.Add(nodelayerchild); - if (layerchildNode.HasChildNodes == true) - { - foreach (XmlNode childNodeLayer in layerchildNode) - { - if (childNodeLayer.HasChildNodes == true) - { - TreeNode nodelayerchild2 = new TreeNode(); - string layer = childNodeLayer.Attributes["label"].Value; - nodelayerchild2.Text = layer; - nodelayerchild2.Tag = layer; - nodelayerchild2.Checked = true; - nodelayerchild.Nodes.Add(nodelayerchild2); - foreach (XmlNode n in childNodeLayer) - { - TreeNode nodelayerchild1 = new TreeNode(); - string layerName1 = n.Attributes["layer"].Value; - string layerchildName = n.Attributes["label"].Value; - string layerType1 = n.Attributes["type"].Value; - if (n.Attributes["isPipeLine"] != null) - { - m_PipelineLayerNames.Add(layerchildName); - } - if (n.Attributes["isWorkWell"] != null) - { - workwellLayerNames.Add(layerchildName); - } - if (n.Attributes["isValve"] != null) - { - valueLayerNames.Add(layerchildName); - } - if (n.Attributes["isAccess"] != null) - //if (n.Attributes["isInstrument"] != null) - { - instrumenLayerNames.Add(layerchildName); - } - if (n.Attributes["isPipeFitting"] != null) - { - pipefittingLayerNames.Add(layerchildName); - } - bool boollayer = AddLayers(layerName1, layerchildName); - nodelayerchild1.Text = layerchildName; - nodelayerchild1.Tag = layerType1 + "|" + layerchildName; - nodelayerchild1.Checked = boollayer; - if (layerchildName.Contains("特征管点")) - { - nodelayerchild1.Checked = false; - setLayerVisible(layerName1); - } - - nodelayerchild2.Nodes.Add(nodelayerchild1); - - g1layername.Add(layerName1); - } - } - else - { - TreeNode nodelayerchild1 = new TreeNode(); - string layerName1 = childNodeLayer.Attributes["layer"].Value; - string layerchildName = childNodeLayer.Attributes["label"].Value; - string layerType1 = childNodeLayer.Attributes["type"].Value; - if (childNodeLayer.Attributes["isPipeLine"] != null) - { - m_PipelineLayerNames.Add(layerchildName); - } - if (childNodeLayer.Attributes["isWorkWell"] != null) - { - workwellLayerNames.Add(layerchildName); - } - if (childNodeLayer.Attributes["isValve"] != null) - { - valueLayerNames.Add(layerchildName); - } - if (childNodeLayer.Attributes["isAccess"] != null) - //if (childNodeLayer.Attributes["isInstrument"] != null) - { - instrumenLayerNames.Add(layerchildName); - } - if (childNodeLayer.Attributes["isPipeFitting"] != null) - { - pipefittingLayerNames.Add(layerchildName); - } - bool boollayer = AddLayers(layerName1, layerchildName); - nodelayerchild1.Text = layerchildName; - nodelayerchild1.Tag = layerType1 + "|" + layerchildName; - nodelayerchild1.Checked = boollayer; - if (layerchildName.Contains("特征管点")) - { - nodelayerchild1.Checked = false; - setLayerVisible(layerName1); - } - nodelayerchild.Nodes.Add(nodelayerchild1); - g1layername.Add(layerName1); - } - } - } - } - } - } - else - { - tv.Nodes.Add(nodelayer); - } - } - } - - foreach (TreeNode tn in tv.Nodes) - { - if (tn.Nodes.Count > 0) - { - foreach (TreeNode tnChild in tn.Nodes) - { - if (tnChild.Checked) - tn.Checked = true; - } - } - } - } - catch (Exception ex) - { - //LogError.PublishError(ex); - } - } - /// /// 获取目标图层 /// /// @@ -2629,21 +2416,11 @@ } catch (Exception ex) { - //LogError.PublishError(ex); + LogHelper.WriteLog(typeof(MainFrm), ex.Message); return false; } } /// - /// 菜单上的 三维导航 工具按钮 - /// - /// - /// - private void buttonItem86_Click(object sender, EventArgs e) - { - globeControl1.Globe.Action = EnumAction3D.ActionNull; - } - - /// /// 地上模式 菜单按钮 /// /// @@ -3026,67 +2803,11 @@ } Image printImage; - /// - /// 打印 菜单 - /// - /// - /// - private void buttonItem13_Click(object sender, EventArgs e) - { - Point pt1 = new Point(Convert.ToInt32(0), Convert.ToInt32(0)); - Point pt2 = new Point(Convert.ToInt32(panelEx5.Width), Convert.ToInt32(panelEx5.Height)); - int mapWidth = 0; - int mapHeight = 0; - Point pt = getUpperLeftPoint(pt1, pt2, out mapWidth, out mapHeight); - printImage = new Bitmap(Convert.ToInt32(panelEx5.Width), Convert.ToInt32(panelEx5.Height)); - Graphics g = Graphics.FromImage(printImage); - g.CopyFromScreen(pt, new Point(0, 0), new Size(Convert.ToInt32(panelEx5.Width), Convert.ToInt32(panelEx5.Height))); - - PrintDialog pd = new PrintDialog(); - try - { - if (pd.ShowDialog() == DialogResult.OK) //如果确认,将会覆盖所有的打印参数设置 - { - //打印预览 - PrintPreviewDialog ppd = new PrintPreviewDialog(); - ppd.Document = printDocument1; - if (DialogResult.OK == ppd.ShowDialog()) - { - printDocument1.Print(); //打印 - } - } - } - catch - { - printDocument1.PrintController.OnEndPrint(printDocument1, new System.Drawing.Printing.PrintEventArgs()); - } - } - + private void printDocument1_PrintPage(object sender, System.Drawing.Printing.PrintPageEventArgs e) { e.Graphics.DrawImage(printImage, 10, 10); } - - /// - /// 在窗体的底部状态栏上显示 综合管线条件查询结果 - /// - /// - /// - private void ToolStripText(string currentLayer, int dataCount) - { - if (dataCount != 0) - { - double featurelength = PipeLength(currentLayer, 0);// 统计管线的里程数 - - toolStripNumbers.Text = " 管线类型:" + currentLayer + " | 共有:" + Convert.ToString(dataCount - 1) + "条记录"; - toolStripFeatureLength.Text = " 管线里程:" + featurelength.ToString("0.00") + " 米"; - } - else - { - toolStripNumbers.Text = "管线类型: " + currentLayer + "| 共有:" + 0 + " 条记录 | "; - } - } - /// /// 统计管线的里程数 /// @@ -3402,26 +3123,6 @@ } /// - /// 绘制线 菜单 - /// - /// - /// - private void btnAddLine_Click(object sender, EventArgs e) - { - globeControl1.Globe.DestLayerFeatureAdd = globeControl1.Globe.MemoryLayer; - globeControl1.Globe.Action = EnumAction3D.DrawPolyline; - } - /// - /// 绘制面 菜单 - /// - /// - /// - private void btnAddPolygon_Click(object sender, EventArgs e) - { - globeControl1.Globe.DestLayerFeatureAdd = globeControl1.Globe.MemoryLayer; - globeControl1.Globe.Action = EnumAction3D.DrawPolygon; - } - /// /// 图层目录树 右键菜单中的 目标图层 菜单 /// /// @@ -3956,42 +3657,7 @@ // ClearUpDownTraceAnalysis(); //} - /// - /// 显示流向 功能 - /// - /// - /// - /// - private void Flow(object sender, string pipelineNameCN, bool bShow) - { - GSOFeatureLayer layer = globeControl1.Globe.Layers.GetLayerByCaption(pipelineNameCN) as GSOFeatureLayer; - GSOFeatures feats = layer.GetAllFeatures(); - for (int i = 0; i < feats.Length; i++) - { - GSOFeature feat = feats[i]; - GSOLineStyle3D lineStyle = feat.Geometry.Style as GSOLineStyle3D; - if (lineStyle != null) - { - if (lineStyle.ArrowStyle == null) - { - lineStyle.ArrowStyle = new GSOArrowStyle(); - lineStyle.ArrowStyle.BodyWidth = 2; - lineStyle.ArrowStyle.BodyLen = 6; - lineStyle.ArrowStyle.HeadWidth = 8; - lineStyle.ArrowStyle.HeadLen = 10; - lineStyle.ArrowStyle.OutlineVisible = true; - lineStyle.ArrowStyle.OutlineColor = Color.Red; - lineStyle.ArrowStyle.Speed = lineStyle.ArrowStyle.Speed / 2; - lineStyle.ArrowStyle.Play(); - } - lineStyle.ArrowVisible = bShow; - layerTree.SelectedNode = null; - } - } - globeControl1.Globe.Refresh(); - } - - + FrmCloseValves frm; /// /// 关阀分析 功能 @@ -4030,7 +3696,9 @@ curCAYNDataset.CloseValveAnalysis(lineFeature.ID, out arryResNodeID, out arryResValveID, false, true); } catch (Exception e) - { } + { + LogHelper.WriteLog(typeof(MainFrm), e.Message); + } string valveName = lineLayer.Caption; valveName = valveName.Substring(0, valveName.IndexOf("管线")); @@ -4106,7 +3774,7 @@ } catch (Exception e) { - + LogHelper.WriteLog(typeof(MainFrm), e.Message); } //目前只有燃气管线 有阀门 string valveName = lineLayer.Name; @@ -5457,7 +5125,7 @@ } catch (Exception ex) { - //MessageBox.Show(ex.ToString()); + LogHelper.WriteLog(typeof(MainFrm), ex.Message); } finally { @@ -5501,22 +5169,6 @@ } } - - /// - /// 清除所有坑 菜单 - /// - /// - /// - private void buttonItem3_Click(object sender, EventArgs e) - { - //日志记录 - LogManager.saveLog(Utility.userName, this.buttonItem3.Text); - - globeControl1.Globe.RemoveAllPits(); - } - - - ///// ///// 净距分析 菜单 ///// @@ -5554,42 +5206,8 @@ // ribbonBarTP.Visible = buttonItem34.Checked; // ribbonBarTP.Location = new Point(0, 0); //} - /// - /// 大气层 菜单 - /// - /// - /// - private void buttonItem17_Click_1(object sender, EventArgs e) - { - globeControl1.Globe.Atmosphere.Visible = !globeControl1.Globe.Atmosphere.Visible; - buttonItemSH1.Checked = globeControl1.Globe.Atmosphere.Visible; - globeControl1.Refresh(); - } - /// - /// 经纬网 菜单 - /// - /// - /// - private void buttonItem20_Click(object sender, EventArgs e) - { - globeControl1.Globe.LatLonGrid.Visible = !globeControl1.Globe.LatLonGrid.Visible; - buttonItemSH3.Checked = globeControl1.Globe.LatLonGrid.Visible; - globeControl1.Globe.Refresh(); - } - /// - /// 状态条 菜单 - /// - /// - /// - private void buttonItem21_Click_1(object sender, EventArgs e) - { - globeControl1.Globe.StatusBar.Visible = !globeControl1.Globe.StatusBar.Visible; - buttonItemSH4.Checked = globeControl1.Globe.StatusBar.Visible; - globeControl1.Globe.Refresh(); - } - - + /// /// 添加指定路径下的数据 功能 /// @@ -5680,43 +5298,7 @@ // } // return objRes; //} - /// - /// 刷新目录树 功能 - /// - private void RefreshDataTree() - { - layerTree.Nodes[0].Nodes.Clear(); - Int32 nCount = globeControl1.Globe.DataManager.DataSourceCount; - Int32 i = 0; - for (i = 0; i < nCount; i++) - { - GSODataSource dataSpace = globeControl1.Globe.DataManager[i]; - TreeNode node = new TreeNode(); - node.Text = dataSpace.Name; - node.ImageIndex = 0; - node.SelectedImageIndex = 0; - node.Checked = true; - node.Tag = dataSpace; - Int32 nDatasetCount = dataSpace.DatasetCount; - for (Int32 j = 0; j < nDatasetCount; j++) - { - GSODataset dataset = dataSpace[j]; - TreeNode subNode = new TreeNode(); - subNode.Text = dataset.Name; - subNode.ImageIndex = 0; - subNode.SelectedImageIndex = 0; - subNode.Checked = true; - subNode.Tag = dataset; - node.Nodes.Add(subNode); - } - layerTree.Nodes[0].Nodes.Add(node); - } - } - - - - - + /// /// 复合查询 菜单 @@ -5777,34 +5359,7 @@ return false; } - /// - /// 统计指定图层在指定范围内的所有feature对象 - /// - /// - /// - /// - private GSOFeatures Intersect_PointLayer(GSOGeoPolygon3D polygon, string pointLayerName) - { - GSOLayer layer = globeControl1.Globe.Layers.GetLayerByCaption(pointLayerName); - if (layer == null) - return null; - - GSOFeatureLayer flayer = layer as GSOFeatureLayer; - GSOFeatureDataset fdataset = flayer.Dataset as GSOFeatureDataset; - GSOFeatures feats; - if (polygon == null) - { - feats = flayer.GetAllFeatures(); - } - else - { - feats = flayer.FindFeaturesInPolygon(polygon, false); - } - - workWellLen.Add(pointLayerName, feats.Length); - return feats; - } - /// + /// /// 碰撞分析功能界面中 选择管线复选框 选中状态改变事件处理 /// /// @@ -5946,16 +5501,6 @@ MessageBox.Show("表格内容为空!", "提示"); } } - /// - /// 导出CAD 菜单 - /// - /// - /// - private void btnExportCAD_Click(object sender, EventArgs e) - { - FrmExportCADS frm = new FrmExportCADS(globeControl1, m_PipelineLayerNames); - frm.ShowDialog(); - } ///// ///// 区域分析 菜单 @@ -5987,16 +5532,6 @@ } } } - /// - /// 数据验证 菜单 - /// - /// - /// - private void buttonItem80_Click(object sender, EventArgs e) - { - FrmValiData frm = new FrmValiData(globeControl1); - frm.ShowDialog(); - } /// /// 根据指定图层创建图层节点并将节点添加到图层管理节点的子节点集合中 @@ -6018,56 +5553,7 @@ layerManagerNode.Expand(); } } - /// - /// 数据库备份 菜单 - /// - /// - /// - private void btnBackDatabase_Click(object sender, EventArgs e) - { - if (MessageBox.Show("是否确定要备份数据库文件", "信息", MessageBoxButtons.YesNo, MessageBoxIcon.Question) == DialogResult.Yes) - { - try - { - DateTime currentTime = DateTime.Now; - //string Dtime = currentTime.ToShortDateString().ToString("yyyy-MM-dd"); - string Dtime = currentTime.GetDateTimeFormats('D')[0].ToString(); - string Htime = DateTime.Now.ToString("HH时mm分ss秒").Trim(); - string fileName = Dtime + "(" + Htime + ")"; - string pathName = ""; - string sql = "select filename from master..sysdatabases where name='" + Utility.dbdatabase + "'"; - DataTable dt = OledbHelper.ExecuteDataTable(sql); - if (dt != null && dt.Rows.Count > 0) - { - pathName = dt.Rows[0][0].ToString().Trim(); - int count = pathName.LastIndexOf("\\") == -1 ? pathName.LastIndexOf("/") : pathName.LastIndexOf("\\"); - pathName = pathName.Substring(0, count); - } - pathName += "\\管网数据库" + fileName + ".bak"; - - OracleCommand cmdBK = new OracleCommand(); - cmdBK.CommandType = CommandType.Text; - cmdBK.Connection = connBackup; - cmdBK.CommandText = @"backup database " + Utility.dbdatabase + " to disk='" + pathName + "' with init"; - - connBackup.Open(); - cmdBK.ExecuteNonQuery(); - MessageBox.Show("数据库文件备份成功", "提示"); - } - catch (Exception ex) - { - MessageBox.Show(ex.ToString()); - } - finally - { - connBackup.Close(); - } - } - } - - - - + //GSOFeature emitterFeature; // 粒子要素 /// /// 添加火苗 功能 @@ -6598,361 +6084,15 @@ } } - - ///// - /// 添加用户仓库 菜单 - /// - /// - /// - private void buttonItem108_Click(object sender, EventArgs e) - { - FrmUserRepo frm = new FrmUserRepo(-1); - frm.ShowDialog(); - } - /// - /// 用户仓库管理 菜单 - /// - /// - /// - private void buttonItem111_Click(object sender, EventArgs e) - { - FrmUserRepoMgr frm = new FrmUserRepoMgr(); - frm.ShowDialog(); - } - /// - /// 添加分系统 菜单 - /// - /// - /// - private void buttonItem112_Click(object sender, EventArgs e) - { - //FrmAPP frm = new FrmAPP(-1); - //frm.ShowDialog(); - } - /// - /// 分系统管理 菜单 - /// - /// - /// - private void buttonItem113_Click(object sender, EventArgs e) - { - //FrmAPPMgr frm = new FrmAPPMgr(); - //frm.ShowDialog(); - } - /// - /// 添加操作 菜单 - /// - /// - /// - private void buttonItem114_Click(object sender, EventArgs e) - { - FrmOper frm = new FrmOper(-1); - frm.ShowDialog(); - } - /// - /// 操作管理 菜单 - /// - /// - /// - private void buttonItem115_Click(object sender, EventArgs e) - { - FrmOperMgr frm = new FrmOperMgr(); - frm.ShowDialog(); - } - /// - /// 添加资源 菜单 - /// - /// - /// - private void buttonItem116_Click(object sender, EventArgs e) - { - FrmRESC frm = new FrmRESC(-1); - frm.ShowDialog(); - } - /// - /// 资源管理 菜单 - /// - /// - /// - private void buttonItem117_Click(object sender, EventArgs e) - { - FrmRESCMgr frm = new FrmRESCMgr(); - frm.ShowDialog(); - } - /// - /// 添加权限 菜单 - /// - /// - /// - private void buttonItem118_Click(object sender, EventArgs e) - { - FrmPerm frm = new FrmPerm(-1); - frm.ShowDialog(); - } - /// - /// 权限管理 菜单 - /// - /// - /// - private void buttonItem119_Click(object sender, EventArgs e) - { - FrmPermMgr frm = new FrmPermMgr(); - frm.ShowDialog(); - } - /// - /// 添加访问控制 菜单 - /// - /// - /// - private void buttonItem120_Click(object sender, EventArgs e) - { - FrmAccess frm = new FrmAccess(-1); - frm.ShowDialog(); - } - /// - /// 访问控制管理 菜单 - /// - /// - /// - private void buttonItem121_Click(object sender, EventArgs e) - { - FrmAccessMgr frm = new FrmAccessMgr(); - frm.ShowDialog(); - } - /// - /// 部门类型管理 菜单 - /// - /// - /// - private void buttonItem122_Click(object sender, EventArgs e) - { - FrmRegionTypeMgr frm = new FrmRegionTypeMgr(); - frm.ShowDialog(); - } - /// - /// 用户信息管理 菜单 - /// - /// - /// - private void buttonItem128_Click_1(object sender, EventArgs e) - { - FrmUserManager frm = new FrmUserManager(); - frm.ShowDialog(); - } - /// - /// 添加角色 菜单 - /// - /// - /// - private void 添加角色_Click(object sender, EventArgs e) - { - FrmRole frm = new FrmRole(-1); - frm.ShowDialog(); - } - /// - /// 所有角色管理 菜单 - /// - /// - /// - private void 角色管理_Click(object sender, EventArgs e) - { - FrmRoleMgr frm = new FrmRoleMgr(); - frm.ShowDialog(); - } - - /// - /// 部门角色管理 菜单 - /// - /// - /// - private void buttonItem133_Click(object sender, EventArgs e) - { - FrmRegionRoleMgr frm = new FrmRegionRoleMgr(); - frm.ShowDialog(); - } - /// - /// 部门管理 菜单 - /// - /// - /// - private void buttonItem130_Click(object sender, EventArgs e) - { - FrmRegionMgr frm = new FrmRegionMgr(); - frm.ShowDialog(); - } - - /// - /// 日志管理 菜单 - /// - /// - /// - private void buttonItem135_Click(object sender, EventArgs e) - { - FrmLogManager frm = new FrmLogManager(); - frm.ShowDialog(); - } - /// - /// 传感器信息查询 菜单 - /// - /// - /// - private void buttonItem131_Click_1(object sender, EventArgs e) - { - GSOFeature selectedFeature = globeControl1.Globe.SelectedObject; - if (selectedFeature == null) - { - MessageBox.Show("请选择一个传感器对象!", "提示", MessageBoxButtons.OK, MessageBoxIcon.Information); - } - else - { - if (selectedFeature.Geometry != null && selectedFeature.Geometry.Type == EnumGeometryType.GeoModel) - { - GSOLayer layer = globeControl1.Globe.SelectedObjectLayer; - string tabelName = getTableName(layer.Caption); - string eqtID = selectedFeature.Description.Trim(); - if (tabelName != "" && eqtID != "") - { - string fields = getFields(tabelName); - if (fields != "") - { - string sql = "select " + fields + " from " + Utility.sensorDatabase + "." + tabelName + " where EqtID=" + eqtID + " order by RecordDate desc limit 1;"; - DataTable dt = MySqlHelper.queryDataTable(sql); - if (dt != null && dt.Rows.Count > 0) - { - FrmQueryMessage.ShowForm(this, dt, layer.Caption); - //queryMessage.Show(this); - } - else - { - MessageBox.Show("没有查询到相关信息!", "提示"); - } - } - else - { - MessageBox.Show("配置文件 \"sensorConfig.xml\" 有误!", "提示"); - } - } - else - { - MessageBox.Show("请选择一个传感器对象!", "提示"); - } - } - else - { - MessageBox.Show("请选择一个传感器对象!", "提示", MessageBoxButtons.OK, MessageBoxIcon.Information); - } - } - } - /// - /// 根据指定的图层的caption属性的值在配置文件中查找对应的数据库中的表的名称 - /// - /// 图层的caption属性的值 - /// 对应的数据库中的表的名称 - private string getTableName(string name) - { - string tabelName = ""; - if (Utility.sensorMarkerLayers != null) - { - for (int i = 0; i < Utility.sensorMarkerLayers.Count; i++) - { - MarkerLayer mLayer = Utility.sensorMarkerLayers[i]; - if (mLayer.layerName == name) - { - tabelName = mLayer.tableName; - break; - } - } - } - return tabelName; - } - /// - /// 根据数据库中的表的名称 查找对应的表中的字段名称的集合 - /// - /// 数据库中的表的名称 - /// 对应的表中的字段名称的集合 - private string getFields(string tabelName) - { - string fields = ""; - if (Utility.sensorMarkerLayers != null) - { - for (int i = 0; i < Utility.sensorMarkerLayers.Count; i++) - { - MarkerLayer mLayer = Utility.sensorMarkerLayers[i]; - if (mLayer.tableName.Trim() == tabelName.Trim()) - { - if (mLayer.fields != null) - { - foreach (string key in mLayer.fields.Keys) - { - string value = mLayer.fields[key]; - fields += tabelName.Trim() + "." + key + " as " + value + ","; - } - fields = fields.Remove(fields.Length - 1); - } - break; - } - } - } - return fields; - } - - /// - /// 历史曲线查询 菜单 - /// - /// - /// - private void buttonItem132_Click(object sender, EventArgs e) - { - GSOFeature selectedFeature = globeControl1.Globe.SelectedObject; - if (selectedFeature == null) - { - MessageBox.Show("请选择一个对象!", "提示", MessageBoxButtons.OK, MessageBoxIcon.Information); - } - else - { - if (selectedFeature.Geometry != null && selectedFeature.Geometry.Type == EnumGeometryType.GeoModel) - { - GSOLayer layer = globeControl1.Globe.SelectedObjectLayer; - string tabelName = getTableName(layer.Caption); - string eqtID = selectedFeature.Description; - if (tabelName != "" && eqtID != "") - { - FrmQueryHistory.ShowForm(this, tabelName, eqtID); - } - else - { - MessageBox.Show("请选择一个传感器对象!", "提示"); - } - } - else - { - MessageBox.Show("请选择一个传感器对象!", "提示", MessageBoxButtons.OK, MessageBoxIcon.Information); - } - } - } - + //定时检查传感器的状态 public System.Windows.Forms.Timer timerOfSensor = null; public int alarmValueLiuLiang = 0; public int alarmValueYaLi = 0; public int alarmValueYeTi = 0; public int alarmValueZaoSheng = 0; - /// - /// 传感器在线报警 菜单 - /// - /// - /// - private void buttonItem134_Click(object sender, EventArgs e) - { - if (timerOfSensor == null) - { - timerOfSensor = new System.Windows.Forms.Timer(); - timerOfSensor.Interval = 30000; - timerOfSensor.Tick += new EventHandler(timerOfSensor_Tick); - } - FrmQuerySensorAlarm.ShowForm(this); - } + /// /// 传感器报警 功能中的 定时器 的触发事件处理 /// @@ -7016,6 +6156,7 @@ } catch (Exception ex) { + LogHelper.WriteLog(typeof(MainFrm), ex.Message); continue; } } @@ -7025,145 +6166,7 @@ } } - - /// - /// 沿线运动 菜单 - /// - /// - /// - private void buttonItem138_Click(object sender, EventArgs e) - { - if (globeControl1.Globe.SelectedObject == null) - { - MessageBox.Show("请先选择一条线!", "提示", MessageBoxButtons.OK, MessageBoxIcon.Exclamation); - return; - } - - GSOFeature lineFeature = globeControl1.Globe.SelectedObject; - if (lineFeature.Geometry == null || lineFeature.Geometry.Type != EnumGeometryType.GeoPolyline3D) - { - MessageBox.Show("请先选择一条线!", "提示", MessageBoxButtons.OK, MessageBoxIcon.Exclamation); - return; - } - - OpenFileDialog dlg = new OpenFileDialog(); - dlg.Filter = "*.gcm;*.3ds|*.gcm;*.3ds|*.3ds|*.3ds|*.gcm|*.gcm"; - if (dlg.ShowDialog() == DialogResult.OK) - { - GSOGeoModel model = new GSOGeoModel(); - model.FilePath = dlg.FileName; - - GSOGeoDynamicRoute dynamicRoute = new GSOGeoDynamicRoute(); - dynamicRoute.ActorGeometry = model; - - GSORoute route = new GSORoute(); - GSOGeoPolyline3D geoline = (GSOGeoPolyline3D)lineFeature.Geometry; - for (int i = 0; i < geoline[0].Count; i++) - { - route.Add(geoline[0][i]); - } - route.CircleRoute = false; - route.Speed = 30; - route.RotateSpeed = 50; - route.AltitudeMode = geoline.AltitudeMode; - dynamicRoute.Route = route; - - GSOFeature feature = new GSOFeature(); - - dynamicRoute.Play(); - feature.Geometry = dynamicRoute; - - //GSOLabel gsoLabel = new GSOLabel(); - //gsoLabel.Text = "模型测试"; - //feature.Label = gsoLabel; - globeControl1.Globe.MinModelVisibleSize = 0; - - globeControl1.Globe.MemoryLayer.AddFeature(feature); - globeControl1.Globe.Refresh(); - } - } - /// - /// 回退 菜单 - /// - /// - /// - private void buttonItem99_Click(object sender, EventArgs e) - { - globeControl1.Globe.UnDoEdit(); - } - /// - /// 前进 菜单 - /// - /// - /// - private void buttonItem100_Click(object sender, EventArgs e) - { - globeControl1.Globe.ReDoEdit(); - } - /// - /// 水平净距 功能界面中的 标签内容改变事件处理 - /// - /// - /// - private void textBoxX4_TextChanged(object sender, EventArgs e) - { - string valueJingJu = textBoxX4.Text.Trim(); - if (valueJingJu != "") - { - double value = 0; - bool bl = double.TryParse(valueJingJu, out value); - if (bl) - { - labelX24.Text = "水平净距小于" + value.ToString() + "米的管线有:"; - } - } - } - /// - /// 垂直净距 功能界面中的 标签内容改变事件处理 - /// - /// - /// - private void textBoxX2_TextChanged(object sender, EventArgs e) - { - string valueJingJu = textBoxX2.Text.Trim(); - if (valueJingJu != "") - { - double value = 0; - bool bl = double.TryParse(valueJingJu, out value); - if (bl) - { - labelX23.Text = "垂直净距小于" + value.ToString() + "米的管线有:"; - } - } - } - /// - /// 覆土分析 功能界面中的 标签内容改变事件处理 - /// - /// - /// - private void textBoxX3_TextChanged(object sender, EventArgs e) - { - string valueJingJu = textBoxX3.Text.Trim(); - if (valueJingJu != "") - { - double value = 0; - bool bl = double.TryParse(valueJingJu, out value); - if (bl) - { - labelX17.Text = "覆土深度小于" + value.ToString() + "米的管线有:"; - } - } - } - - /// - /// 传感器分类查询 全区域 菜单 - /// - /// - /// - private void buttonItemSensor全区域查询_Click(object sender, EventArgs e) - { - FrmAccessoriesSensor.ShowForm(globeControl1, instrumenLayerNames, 0); - } + /// /// 传感器分类查询 绘制区域 菜单 /// @@ -7224,170 +6227,10 @@ layerTemp.RemoveAllFeature(); globeControl1.Refresh(); } - /// - /// 数字预处理 功能 - /// - /// - /// - private void 数字预处理buttonItem140_Click(object sender, EventArgs e) - { - FrmEditShapeFile frm = new FrmEditShapeFile(globeControl1); - frm.ShowDialog(this); - } - - - /// - /// 导出矢量 功能 将图层导出为kml和shp格式数据 - /// - /// - /// - private void 导出矢量buttonItem140_Click(object sender, EventArgs e) - { - /* - List m_PipelineLayerNames = new List();//线图层名称 - List workwellLayerNames = new List();//工井图层名称 - List valueLayerNames = new List();//阀门图层名称 - List instrumenLayerNames = new List();//附属物图层名称 - List pipefittingLayerNames = new List();//管件图层名称 - */ - List listVectorNames = new List(); - for (int i = 0; i < m_PipelineLayerNames.Count; i++) - { - if (m_PipelineLayerNames[i] == "移动" || m_PipelineLayerNames[i] == "联通" - || m_PipelineLayerNames[i] == "电信" || m_PipelineLayerNames[i] == "共通" - || m_PipelineLayerNames[i] == "有限电视" || m_PipelineLayerNames[i] == "交通信号" - || m_PipelineLayerNames[i] == "供电") - { - continue; - } - if (listVectorNames.Contains(m_PipelineLayerNames[i]) == false) - { - listVectorNames.Add(m_PipelineLayerNames[i]); - } - } - for (int i = 0; i < valueLayerNames.Count; i++) - { - if (listVectorNames.Contains(valueLayerNames[i]) == false) - { - listVectorNames.Add(valueLayerNames[i]); - } - } - for (int i = 0; i < workwellLayerNames.Count; i++) - { - if (listVectorNames.Contains(workwellLayerNames[i]) == false) - { - listVectorNames.Add(workwellLayerNames[i]); - } - } - for (int i = 0; i < instrumenLayerNames.Count; i++) - { - if (listVectorNames.Contains(instrumenLayerNames[i]) == false) - { - listVectorNames.Add(instrumenLayerNames[i]); - } - } - for (int i = 0; i < pipefittingLayerNames.Count; i++) - { - if (listVectorNames.Contains(pipefittingLayerNames[i]) == false) - { - listVectorNames.Add(pipefittingLayerNames[i]); - } - } - FrmExportVector frm = new FrmExportVector(globeControl1, listVectorNames); - frm.ShowDialog(); - } string citySevenLineType = ""; string cityServerLineName = ""; /// - /// 绘制城市七线 功能按钮 - /// - /// - /// - private void 绘制城市七线buttonItem140_Click(object sender, EventArgs e) - { - FrmCitySevenLineType frm = new FrmCitySevenLineType(); - if (frm.ShowDialog() == DialogResult.OK) - { - globeControl1.Globe.Action = EnumAction3D.DrawPolyline; - m_isDrawCitySevenLine = true; - m_isDrawTunnel = false; - m_AddPipeLine = false; - this.citySevenLineType = frm.citySevenLineType; - this.cityServerLineName = frm.citySevenLineName; - switch (frm.citySevenLineType) - { - case "城市红线": - GSOLayer layerRed = globeControl1.Globe.Layers.GetLayerByCaption(frm.citySevenLineType); - if (layerRed != null) - { - globeControl1.Globe.DestLayerFeatureAdd = layerRed; - layerRed.Editable = true; - } - break; - case "城市橙线": - GSOLayer layerOrange = globeControl1.Globe.Layers.GetLayerByCaption(frm.citySevenLineType); - if (layerOrange != null) - { - globeControl1.Globe.DestLayerFeatureAdd = layerOrange; - layerOrange.Editable = true; - } - break; - case "城市黄线": - GSOLayer layerYellow = globeControl1.Globe.Layers.GetLayerByCaption(frm.citySevenLineType); - if (layerYellow != null) - { - globeControl1.Globe.DestLayerFeatureAdd = layerYellow; - layerYellow.Editable = true; - } - break; - case "城市绿线": - GSOLayer layerGreen = globeControl1.Globe.Layers.GetLayerByCaption(frm.citySevenLineType); - if (layerGreen != null) - { - globeControl1.Globe.DestLayerFeatureAdd = layerGreen; - layerGreen.Editable = true; - } - break; - case "城市蓝线": - GSOLayer layerBlue = globeControl1.Globe.Layers.GetLayerByCaption(frm.citySevenLineType); - if (layerBlue != null) - { - globeControl1.Globe.DestLayerFeatureAdd = layerBlue; - layerBlue.Editable = true; - } - break; - case "城市紫线": - GSOLayer layerPurple = globeControl1.Globe.Layers.GetLayerByCaption(frm.citySevenLineType); - if (layerPurple != null) - { - globeControl1.Globe.DestLayerFeatureAdd = layerPurple; - layerPurple.Editable = true; - } - break; - case "城市黑线": - GSOLayer layerBlack = globeControl1.Globe.Layers.GetLayerByCaption(frm.citySevenLineType); - if (layerBlack != null) - { - globeControl1.Globe.DestLayerFeatureAdd = layerBlack; - layerBlack.Editable = true; - } - break; - } - } - } - /// - /// 七线审核 功能按钮 - /// - /// - /// - private void 七线审核buttonItem141_Click(object sender, EventArgs e) - { - FrmCityServerLineAnalysis frm = new FrmCityServerLineAnalysis(globeControl1, m_PipelineLayerNames); - frm.ShowDialog(this); - } - - /// /// 间距分析 开始分析按钮 分析绘制的七线和管线的距离是否符合标准 /// /// @@ -7666,25 +6509,6 @@ } } - - - /// - /// 管线自动缩进 菜单 - /// - /// - /// - private void 管线自动缩进buttonItem140_Click(object sender, EventArgs e) - { - FrmPipelineIndented frm = new FrmPipelineIndented(globeControl1, m_PipelineLayerNames, workwellLayerNames); - frm.ShowDialog(this); - } - - private void btnExportCADs_Click(object sender, EventArgs e) - { - - } - - /// /// 统计指定图层在指定范围内的所有feature对象 /// @@ -7755,8 +6579,6 @@ } - - //设置图层为隐藏 private void setLayerVisible(string layerName) { @@ -7765,27 +6587,7 @@ globeControl1.Globe.Refresh(); } - /// - /// 连接数据库 - /// - /// - /// - private void buttonItem129_Click(object sender, EventArgs e) - { - //保存日志 - LogManager.saveLog(Utility.userName, this.buttonItemSJGL4_1.Text); - - FrmDatabaseParaSetting2 frm = new FrmDatabaseParaSetting2(globeControl1); - if (frm.ShowDialog() == DialogResult.OK) - { - ds = FrmDatabaseParaSetting2.ds; - if (ds != null) - { - ds.IsCloseSaved = false; - } - } - } - + /// /// 清除渲染结果 /// @@ -7803,112 +6605,8 @@ layerTemp.RemoveAllFeature(); globeControl1.Refresh(); } - - /// - /// 绘制垂线 - /// - /// - /// - private void drawCLine(GSOPoint3d fpt, GSOPoint3d tpt) - { - GSOGeoPolyline3D pline = new GSOGeoPolyline3D(); - GSOPoint3ds pts = new GSOPoint3ds(); - pts.Add(fpt); - pts.Add(tpt); - pline.AddPart(pts); - - GSOGeoPoint3D fptg = new GSOGeoPoint3D(); - GSOGeoPoint3D tptg = new GSOGeoPoint3D(); - fptg.X = fpt.X; - fptg.Y = fpt.Y; - fptg.Z = 0; - tptg.X = tpt.X; - tptg.Y = tpt.Y; - tptg.Z = 0; - - GSOFeature gf = new GSOFeature(); - gf.Geometry = pline; - - globeControl1.Globe.MemoryLayer.AddFeature(gf); - - } - /// - /// 红线审核 - /// - /// - /// - private void buttonItem138_Click_2(object sender, EventArgs e) - { - - } - /// - /// 比较两个点是否是同一个点 - /// - /// - /// - /// - private bool comparePoint(GSOPoint3d pt1, GSOPoint3d pt2) - { - double x1 = 0; double y1 = 0; - double x2 = 0; double y2 = 0; - x1 = pt1.X; - y1 = pt1.Y; - x2 = pt2.X; - y2 = pt2.Y; - if ((x1 == x2) && (y1 == y2)) - { - return true; - } - return false; - } - /// - /// 获得点到线的垂线距离及垂点 - /// - /// - /// - /// - /// - private void comparePointLine(GSOPoint3d point, GSOGeoPolyline3D line, out double length, out GSOPoint3d pointChuiDian) - { - GSOPoint3d lineStartPoint = line[0][0]; - GSOPoint3d lineEndPoint = line[0][1]; - GSOGeoPolyline3D lineAB = new GSOGeoPolyline3D(); - GSOPoint3ds pointsAB = new GSOPoint3ds(); - pointsAB.Add(point); - pointsAB.Add(lineStartPoint); - lineAB.AddPart(pointsAB); - double lengthAB = lineAB.GetSpaceLength(false, 6378137.0); - double xieLvAB = getXieLu("", point.X, point.Y, lineStartPoint.X, lineStartPoint.Y); - double xieLvBC = getXieLu("", lineStartPoint.X, lineStartPoint.Y, lineEndPoint.X, lineEndPoint.Y); - - double tanABC = Math.Abs(xieLvAB - xieLvBC) / (1 + xieLvAB * xieLvBC); - double angle = Math.Atan(tanABC); - //if (angle > Math.PI / 2) //落在外边 - //{ - // length = 0; - //} - double lengthAD = lengthAB * Math.Sin(angle); - length = Math.Abs(lengthAD); - double lengthBD = lengthAB * Math.Cos(angle); - - GSOPoint2d point2dStart = Latlon_2_XYZ(lineStartPoint.X, lineStartPoint.Y); - double bBC = point2dStart.Y - xieLvBC * point2dStart.X; - GSOPoint2d point2dEnd = new GSOPoint2d(); - point2dEnd.X = point2dStart.X + 100; - point2dEnd.Y = point2dEnd.X * xieLvBC + bBC; - point2dEnd = XYZ_2_Latlon(point2dEnd.X, point2dEnd.Y); - - GSOPoint3d pointEnd = new GSOPoint3d(); - pointEnd.X = point2dEnd.X; - pointEnd.Y = point2dEnd.Y; - GSOGeoPolyline3D lineYanShen = new GSOGeoPolyline3D(); - GSOPoint3ds pointsYanShen = new GSOPoint3ds(); - pointsYanShen.Add(lineStartPoint); - pointsYanShen.Add(pointEnd); - lineYanShen.AddPart(pointsYanShen); - GSOGeoPolyline3D lineSegment = lineYanShen.GetSegment(0, lengthBD); - pointChuiDian = lineSegment[0][1]; - } + + /// /// 获得斜率 /// @@ -8044,255 +6742,6 @@ } /// - /// 获取与点相连的所有线以及线的点的集合 - /// - /// 选定的点所在的线 - /// 选定的点 - /// 面中不完全包含的除起点线之外所有的线 - /// 选定的点所在的点的集合 - /// 所有以选定线为起点的点的集合 - /// - private List getFeaturesPoints(GSOFeature featureSelect, GSOPoint3d lineStart, GSOFeatures selectFeatures, GSOPoint3ds ps, List listPS) - { - GSOFeatures fsStart = new GSOFeatures(); - for (int n = 0; n < selectFeatures.Length; n++) - { - if (featureSelect.ID == selectFeatures[n].ID) - { - continue; - } - GSOGeoPolyline3D newLine = selectFeatures[n].Geometry as GSOGeoPolyline3D; - if (newLine != null && newLine.PartCount > 0) - { - GSOPoint3d newLineStart = newLine[0][0]; - GSOPoint3d newLineEnd = newLine[0][newLine[0].Count - 1]; - if (lineStart.X == newLineEnd.X && lineStart.Y == newLineEnd.Y) - { - GSOPoint3ds psAdd = new GSOPoint3ds(); - for (int k = newLine[0].Count - 1; k >= 0; k--) - { - psAdd.Add(newLine[0][k]); - } - newLine[0] = psAdd; - fsStart.Add(selectFeatures[n]); - - } - else if (lineStart.X == newLineStart.X && lineStart.Y == newLineStart.Y) - { - fsStart.Add(selectFeatures[n]); - - } - } - } - if (fsStart.Length > 0) - { - for (int m = 0; m < fsStart.Length; m++) - { - GSOGeoPolyline3D lineFsStart = fsStart[m].Geometry as GSOGeoPolyline3D; - if (lineFsStart != null && lineFsStart.PartCount > 0) - { - GSOPoint3ds psAdd = ps.Clone(); - for (int k = 0; k < lineFsStart[0].Count; k++) - { - psAdd.Add(lineFsStart[0][k]); - } - listPS = getFeaturesPoints(fsStart[m], lineFsStart[0][lineFsStart[0].Count - 1], selectFeatures, psAdd, listPS); - } - } - } - else - { - listPS.Add(ps); - } - return listPS; - } - - /// - /// 获取切割面的线 - /// - /// 不完全包含在面中的所有线 - /// 完全包含在面中的所有线 - /// 线 - private GSOFeature getLineFromGSOFeatures(GSOFeatures features, GSOFeatures featuresTrue) - { - //1. 当线对象数组的长度为0时,返回空 - if (features.Length == 0) - { - return null; - } - //2. 当线对象数组的长度为1时,返回这条线 - if (features.Length == 1) - { - return features[0]; - } - //3. 当线对象数组的长度大于1时,计算所有线组成的最长线 - - //3.1 获取所有不完全包含在面中的对象selectFeatures - GSOFeatures selectFeatures = new GSOFeatures(); - for (int a = 0; a < features.Length; a++) - { - selectFeatures.Add(features[a].Clone()); - } - //3.2 删除features中完全包含在面中的线,获取和面的边界相交的线对象 - for (int a = 0; a < featuresTrue.Length; a++) - { - for (int b = 0; b < features.Length; b++) - { - if (featuresTrue[a].ID == features[b].ID) - { - features.Remove(b); - break; - } - } - } - //3.3 如果和面的边界相交的线的数量为0,返回空 - if (features.Length == 0) - { - return null; - } - //3.4 获取第一条和面的边界相交的线featureInOutPolygon - GSOFeature featureInOutPolygon = features[0]; - //3.5 从所有的线中删除featureInOutPolygon - for (int a = 0; a < selectFeatures.Length; a++) - { - if (selectFeatures[a].ID == featureInOutPolygon.ID) - { - selectFeatures.Remove(a); - break; - } - } - //listPS存储所有从featureInOutPolygon出发的点的集合 - List listPS = new List(); - //3.5 获取与featureInOutPolygon相连的线的集合 - GSOGeoPolyline3D line = featureInOutPolygon.Geometry as GSOGeoPolyline3D; - if (line != null && line.PartCount > 0) - { - GSOPoint3d lineStart = line[0][0]; - GSOPoint3d lineEnd = line[0][line[0].Count - 1]; - #region//获取和featureInOutPolygon的起点相连的线 - GSOFeatures fsStart = new GSOFeatures(); - for (int n = 0; n < selectFeatures.Length; n++) - { - GSOGeoPolyline3D newLine = selectFeatures[n].Geometry as GSOGeoPolyline3D; - if (newLine != null && newLine.PartCount > 0) - { - GSOPoint3d newLineStart = newLine[0][0]; - GSOPoint3d newLineEnd = newLine[0][newLine[0].Count - 1]; - if (lineStart.X == newLineEnd.X && lineStart.Y == newLineEnd.Y) - { - GSOPoint3ds psAdd = new GSOPoint3ds(); - for (int k = newLine[0].Count - 1; k >= 0; k--) - { - psAdd.Add(newLine[0][k]); - } - newLine[0] = psAdd; - fsStart.Add(selectFeatures[n]); - - } - else if (lineStart.X == newLineStart.X && lineStart.Y == newLineStart.Y) - { - fsStart.Add(selectFeatures[n]); - } - } - } - #endregion - - #region//获取和featureInOutPolygon的终点相连的线 - GSOFeatures fsEnd = new GSOFeatures(); - for (int n = 0; n < selectFeatures.Length; n++) - { - GSOGeoPolyline3D newLine = selectFeatures[n].Geometry as GSOGeoPolyline3D; - if (newLine != null && newLine.PartCount > 0) - { - GSOPoint3d newLineStart = newLine[0][0]; - GSOPoint3d newLineEnd = newLine[0][newLine[0].Count - 1]; - if (lineEnd.X == newLineStart.X && lineEnd.Y == newLineStart.Y) - { - fsEnd.Add(selectFeatures[n]); - - } - else if (lineEnd.X == newLineEnd.X && lineEnd.Y == newLineEnd.Y) - { - GSOPoint3ds psAdd = new GSOPoint3ds(); - for (int k = newLine[0].Count - 1; k >= 0; k--) - { - psAdd.Add(newLine[0][k]); - } - newLine[0] = psAdd; - fsEnd.Add(selectFeatures[n]); - - } - } - } - #endregion - - //3.6 将featureInOutPolygon的所有点和与之起点相连的线的所有点组成一个点的集合并添加到listPS中 - if (fsStart.Length > 0 && fsEnd.Length == 0) - { - for (int m = 0; m < fsStart.Length; m++) - { - GSOGeoPolyline3D lineFsStart = fsStart[m].Geometry as GSOGeoPolyline3D; - if (lineFsStart != null && lineFsStart.PartCount > 0) - { - GSOPoint3ds psAdd = new GSOPoint3ds(); - for (int k = line[0].Count - 1; k >= 0; k--) - { - psAdd.Add(line[0][k]); - } - for (int k = 0; k < lineFsStart[0].Count; k++) - { - psAdd.Add(lineFsStart[0][k]); - } - - listPS = getFeaturesPoints(fsStart[m], lineFsStart[0][lineFsStart[0].Count - 1], selectFeatures, psAdd, listPS); - - } - } - } - //3.6 将featureInOutPolygon的所有点和与之终点相连的线的所有点组成一个点的集合并添加到listPS中 - else if (fsStart.Length == 0 && fsEnd.Length > 0) - { - for (int n = 0; n < fsEnd.Length; n++) - { - GSOGeoPolyline3D lineFsEnd = fsEnd[n].Geometry as GSOGeoPolyline3D; - if (lineFsEnd != null && lineFsEnd.PartCount > 0) - { - GSOPoint3ds psAdd = new GSOPoint3ds(); - for (int k = 0; k < line[0].Count - 1; k++) - { - psAdd.Add(line[0][k]); - } - for (int k = 0; k < lineFsEnd[0].Count; k++) - { - psAdd.Add(lineFsEnd[0][k]); - } - //获取线fsEnd[n]的另一个端点相连的线并记录该线的点的集合 - listPS = getFeaturesPoints(fsEnd[n], lineFsEnd[0][lineFsEnd[0].Count - 1], selectFeatures, psAdd, listPS); - } - } - } - } - - //3.7 获取所有以featureInOutPolygon为起点的点的集合组成的线中的最长的线 - double maxLength = 0; - GSOFeature featureNew = new GSOFeature(); - for (int h = 0; h < listPS.Count; h++) - { - GSOGeoPolyline3D lineNew = new GSOGeoPolyline3D(); - lineNew.AddPart(listPS[h]); - GSOLabel label = new GSOLabel(); - label.Text = h.ToString(); - featureNew.Label = label; - double length = lineNew.GetSpaceLength(true, 6378137); - if (length > maxLength) - { - featureNew.Geometry = lineNew; - } - } - - return featureNew; - } - /// /// 更新最大最小状态 /// /// @@ -8340,219 +6789,6 @@ - private void buttonItem139_Click(object sender, EventArgs e) - { - - string filepath = ""; - //日志记录 - OpenFileDialog dlg = new OpenFileDialog(); - dlg.Filter = "矢量数据(*.shp)|*.shp|矢量数据(*.lgd)|*.lgd|全部支持格式(*.lgd,*.shp)|*.lgd;*.shp;"; - //dlg.Filter = "支持格式(*.lrp,*.tif,*.img,*.lrc,*.kml,*.lgd,*.shp,*.gft)|*.lrp;*.tif;*.img;*.lrc;*.kml;*.lgd;*.shp;*.gft|栅格数据(*.lrp)|*.lrp|栅格缓存(*.lrc)|*.lrc|KML数据(*.kml)|*.kml|矢量数据(*.lgd)|*.lgd|矢量缓存(*.gft)|*.gft|其它格式(*.*)|*.*||"; - dlg.Multiselect = true; - if (dlg.ShowDialog() == DialogResult.OK) - { - //自定义lprj文件名,从程序中复制一lprj文件。 - int bindex = dlg.FileName.Split('\\').Length; - string lastname = dlg.FileName.Split('\\')[bindex - 1]; - - for (int i = 0; i < dlg.FileNames.Length; i++) - { - string strDataPath = dlg.FileNames[i]; - filepath = strDataPath; - - GSOLayer layer = globeControl1.Globe.Layers.Add(strDataPath); - - } - - } - //放大到红线 - - - // globeControl1.Globe.Layers.MoveTo(0, globeControl1.Globe.Layers.Count - 1); - // globeControl1.Globe.Layers.MoveTo(0,4); - globeControl1.Refresh(); - - - } - /// - /// - /// - /// - /// - private void buttonItem142_Click(object sender, EventArgs e) - { - //获得红线polygon - //GSOLayer layerSevenLine = globeControl1.Globe.Layers.GetLayerByCaption(redlinelayername); - - GSOLayer layerSevenLine = globeControl1.Globe.Layers.Add("D:\\data\\歌林小镇shp\\test.shp"); - //获得红线结果列表 - ArrayList rrLists = new ArrayList(); - - //if (redlinelayername != "") - { - GSOFeatures fs = layerSevenLine.GetAllFeatures(); - int len = fs.Length; - - GSOGeoPolygon3D sevenPolygon = new GSOGeoPolygon3D(); - for (int k = 0; k < len; k++) - {//多根红线 - ///////生成红线区域/////// - GSOFeature featSevenLine = layerSevenLine.GetAt(k); - GSOGeoPolyline3D sevenLine = featSevenLine.Geometry as GSOGeoPolyline3D; - - List sevenParts = new List(); - for (int i = 0; i < sevenLine.PartCount; i++) - { - sevenParts.Add(sevenLine[i]); - } - for (int i = 0; i < sevenParts.Count; i++) - { - sevenPolygon.AddPart((GSOPoint3ds)sevenParts[i]); - } - /////拼出红线多边形over////// - - } - //GSOLayer layer = globeControl1.Globe.Layers.GetLayerByCaption("天然气管线"); - - GSOLayer layer = globeControl1.Globe.Layers.Add("C:\\Users\\nn-203\\Desktop\\xiaobai\\test.lgd"); - //线切割面定义,输出用 - GSOFeatures resFeats = new GSOFeatures(); - int resultstyle = 0; - //管线切割红线区域后,面积较小的区域 - GSOGeoPolygon3D restPoly = new GSOGeoPolygon3D(); - List inpts = new List(); - if (layer != null) - { - //红线区域 - GSOFeature sevenfeature = new GSOFeature(); - sevenfeature.Geometry = sevenPolygon; - - //获取不完全包含在面中的所有线 - GSOFeatures feats = layer.FindFeaturesInPolygon(sevenPolygon, false); - //获取完全包含在面中的所有线 - GSOFeatures featsTrue = layer.FindFeaturesInPolygon(sevenPolygon, true); - //获取面中所有对象组成的切割面的长线 - GSOFeature feature = new GSOFeature(); - - feature = getLineFromGSOFeatures(feats, featsTrue);//管线多个feature拼成一个feature - - //globeControl1.Globe.MemoryLayer.AddFeature(feature); - //globeControl1.Globe.MemoryLayer.AddFeature(sevenfeature); - if (feature != null) - { - //线切割面,输出 - //feature.HighLight = true; - GSODataEngineUtility.GSLineClipPolygon(feature, sevenfeature, out resFeats, out resultstyle); - } - else - { - MessageBox.Show("没有找到切割面的线对象!"); - } - ////////////////绘制分割后的多边形/////////////// - for (int a = 0; a < resFeats.Length; a++) - { - - GSOFeature gf = resFeats[1]; - globeControl1.Globe.MemoryLayer.AddFeature(gf); - - } - } - - - } - } - - private void buttonItem143_Click(object sender, EventArgs e) - { - //获得红线polygon - GSOLayer layerSevenLine = globeControl1.Globe.Layers.Add("d:\\lineAndPolygon.lgd"); - GSOLayer layerSevenLine2 = globeControl1.Globe.Layers.GetLayerByCaption("d:\\lineAndPolygon.lgd"); - //获得红线结果列表 - ArrayList rrLists = new ArrayList(); - - - // if (redlinelayername != "") - { - GSOFeatures fs = layerSevenLine.GetAllFeatures(); - int len = fs.Length; - - GSOGeoPolyline3D linetest = new GSOGeoPolyline3D(); - GSOGeoPolygon3D sevenPolygon = new GSOGeoPolygon3D(); - - GSOFeature linefeat = fs.FindByID(2); - //linefeat.Geometry = linetest; - GSOFeature polyfeat = fs.FindByID(1); - //polyfeat.Geometry = sevenPolygon; - - //线切割面定义,输出用 - GSOFeatures resFeats = new GSOFeatures(); - int resultstyle = 0; - GSODataEngineUtility.GSLineClipPolygon(linefeat, polyfeat, out resFeats, out resultstyle); - - ////////////////绘制分割后的多边形/////////////// - for (int a = 0; a < resFeats.Length; a++) - { - - GSOFeature gf = resFeats[0]; - globeControl1.Globe.MemoryLayer.AddFeature(gf); - - } - ////把红线切成一段段的线段,获得切前的红线点集 - List redpts = new List();//切前的红线点集合 - for (int i = 0; i < linetest.PartCount; i++) - { - GSOPoint3ds partP = linetest[i]; - for (int j = 0; j < partP.Count; j++) - { - redpts.Add(partP[j]); - } - } - - List redpts2 = new List();//切前的红线点集合 - for (int i = 0; i < sevenPolygon.PartCount; i++) - { - GSOPoint3ds partP = sevenPolygon[i]; - for (int j = 0; j < partP.Count; j++) - { - redpts2.Add(partP[j]); - } - } - } - } - /// - /// 增加用户手册下载连接 - /// - /// - /// - Cyberpipe.udfiles.UpDownFile UDF = new udfiles.UpDownFile(Utility.udserviceurl); - string dir_Ok = "C:\\Users\\nn-203\\Desktop"; - private void button1_Click(object sender, EventArgs e) - { - if (folderBrowserDialog1.ShowDialog() == DialogResult.OK) //打洙?开a文?件t夹D对?话°框ò - { - dir_Ok = folderBrowserDialog1.SelectedPath; //显?示?选?择?的?文?件t夹D路·径? - - //tempstr = folderBrowserDialog1.SelectedPath; //存?储洹?选?择?的?文?件t夹D路·径? - - } - - Cyberpipe.PED_logicfile.PED_Affair.Redact_D = Utility.uploadpath + "\\SFiles\\UserHbook\\说明.docx"; - if (File.Exists(dir_Ok + "\\" + Files_Name(Cyberpipe.PED_logicfile.PED_Affair.Redact_D, 1))) - { - if (MessageBox.Show("文件夹下有同名文件,是否替换?", "提示", MessageBoxButtons.YesNo, MessageBoxIcon.Information) == DialogResult.No) ; - - } - byte[] file = UDF.Down(Cyberpipe.PED_logicfile.PED_Affair.Redact_D); - FileStream pFileSream = new FileStream(dir_Ok + "\\说明.docx", FileMode.OpenOrCreate); - pFileSream.Write(file, 0, file.Length); - pFileSream.Close(); - if (File.Exists(dir_Ok + "\\" + Files_Name(Cyberpipe.PED_logicfile.PED_Affair.Redact_D, 1)) == true) - { - MessageBox.Show("文件导出成功!"); - } - //PEDAClass.Folder_Handle(dir_Ok + "\\" + PEDAClass.Files_Name(Cyberpipe.PED_logicfile.PED_Affair.Redact_D, 0), Cyberpipe.PED_logicfile.PED_Affair.Redact_D, "", 0); - - } /// /// 获取文件或文件夹的名称 /// @@ -8575,33 +6811,6 @@ return DF_Name; } - private void toolStripDropDownButton1_Click(object sender, EventArgs e) - { - if (folderBrowserDialog1.ShowDialog() == DialogResult.OK) //打洙?开a文?件t夹D对?话°框ò - { - dir_Ok = folderBrowserDialog1.SelectedPath; //显?示?选?择?的?文?件t夹D路·径? - - //tempstr = folderBrowserDialog1.SelectedPath; //存?储洹?选?择?的?文?件t夹D路·径? - - - Cyberpipe.PED_logicfile.PED_Affair.Redact_D = Utility.uploadpath + "\\SFiles\\UserHbook\\说明.docx"; - if (File.Exists(dir_Ok + "\\" + Files_Name(Cyberpipe.PED_logicfile.PED_Affair.Redact_D, 1))) - { - if (MessageBox.Show("文件夹下有同名文件,是否替换?", "提示", MessageBoxButtons.YesNo, MessageBoxIcon.Information) == DialogResult.No) ; - - } - byte[] file = UDF.Down(Cyberpipe.PED_logicfile.PED_Affair.Redact_D); - FileStream pFileSream = new FileStream(dir_Ok + "\\说明.docx", FileMode.OpenOrCreate); - pFileSream.Write(file, 0, file.Length); - pFileSream.Close(); - if (File.Exists(dir_Ok + "\\" + Files_Name(Cyberpipe.PED_logicfile.PED_Affair.Redact_D, 1)) == true) - { - MessageBox.Show("文件导出成功!"); - } - - } - } - /// /// 空间查询 /// @@ -9792,7 +8001,7 @@ GSOLayer resLayer = null; GSOFeature resFeature = null; globeControl1.Globe.GetSelectObject(0, out resFeature, out resLayer); - + if (resFeature == null) return; GSOGeoPolyline3D line1 = resFeature.Geometry as GSOGeoPolyline3D; if (line1 == null) { @@ -9876,7 +8085,7 @@ GSOLayer resLayer = null; GSOFeature resFeature = null; globeControl1.Globe.GetSelectObject(0, out resFeature, out resLayer); - + if (resFeature == null) return; GSOGeoPolyline3D line1 = resFeature.Geometry as GSOGeoPolyline3D; if (line1 == null) { @@ -9891,7 +8100,8 @@ } GSOFeatures feats = globeControl1.Globe.MemoryLayer.GetFeatureByName("粒子要素", true); - if (feats.Length > 0) + + if (feats!=null&&feats.Length > 0) globeControl1.Globe.MemoryLayer.RemoveFeatureByID(feats[0].ID); //if (emitterFeature != null) //{ @@ -11121,88 +9331,6 @@ } private int connectServerCount = 0; - - /// - /// 还原球到实测库 - /// - private void refreshGlobe1() - { - //添加实测库图层已有图层 - int servernum = 0; - //1.清除global1上 - for (int i = globeControl1.Globe.Layers.Count - 1; i >= 0; i--) - { - GSOLayer layer = globeControl1.Globe.Layers[i]; - if (!layer.Name.Contains("fttp:")) - { - layer.Dataset.Close();//清除内存 - globeControl1.Globe.Layers.Remove(layer); - } - else - { - servernum++; - } - } - - //globeControl1.Globe.ConnectServer(Utility.serverip, Utility.serverport, "", ""); //加载locaServer中的数据 - - //2.添加实测库图层 - string[] markerStrs = new string[9]; - markerStrs[0] = "标高标注"; - markerStrs[1] = "管径标注"; - markerStrs[2] = "埋深标注"; - markerStrs[3] = "坐标标注"; - markerStrs[4] = "坡度标注"; - markerStrs[5] = "属性标注"; - markerStrs[6] = "自定义标注"; - markerStrs[7] = "距离标注"; - markerStrs[8] = "扯旗标注"; - for (int i = 0; i < markerStrs.Length; i++) - { - if (File.Exists(Application.StartupPath + "\\标注管理\\" + markerStrs[i] + ".lgd")) - { - GSOLayer markerLayer = globeControl1.Globe.Layers.Add(Application.StartupPath + "\\标注管理\\" + markerStrs[i] + ".lgd"); - } - } - - for (int i = 0; i < g1layername.Count; i++) - { - string g1name = g1layername[i]; - GSODataset datasetg1 = Utility.dataSource.GetDatasetByName(g1name); - GSOLayer templayer = globeControl1.Globe.Layers.Add(datasetg1); - templayer.MaxVisibleAltitude = -1; - } - layerTemp = globeControl1.Globe.Layers.Add(Application.StartupPath + "\\tempLgdData.lgd"); - globeControl1.Globe.Layers.Add(Application.StartupPath + "/城市七线/城市红线.lgd"); - globeControl1.Globe.Layers.Add(Application.StartupPath + "/城市七线/城市橙线.lgd"); - globeControl1.Globe.Layers.Add(Application.StartupPath + "/城市七线/城市黄线.lgd"); - globeControl1.Globe.Layers.Add(Application.StartupPath + "/城市七线/城市绿线.lgd"); - globeControl1.Globe.Layers.Add(Application.StartupPath + "/城市七线/城市蓝线.lgd"); - globeControl1.Globe.Layers.Add(Application.StartupPath + "/城市七线/城市紫线.lgd"); - globeControl1.Globe.Layers.Add(Application.StartupPath + "/城市七线/城市黑线.lgd"); - globeControl1.Globe.Layers.Add(Application.StartupPath + "/隧道.lgd"); - - //移动server的数据图层 - for (int i = 0; i < servernum; i++) - { - globeControl1.Globe.Layers.MoveTo(globeControl1.Globe.Layers.Count - 1, 0); - } - - if (layerManagerNode.Nodes.Count > 0) - { - for (int i = layerManagerNode.Nodes.Count - 1; i >= 0; i--) - { - layerManagerNode.Nodes[i].Remove(); - - } - } - - - - globeControl1.Refresh(); - - } - /// /// 碰撞审查 /// @@ -11476,31 +9604,7 @@ // } //} #endregion - /// - /// 数据质量检查 - /// - /// - /// - private void buttonItemSJGL2_Click(object sender, EventArgs e) - { - //日志记录 - LogManager.saveLog(Utility.userName, this.buttonItemSJGL2.Text); - FrmValiData frm = new FrmValiData(globeControl1); - frm.ShowDialog(); - } - /// - /// 数据预处理 - /// - /// - /// - private void buttonItemSJGL3_Click(object sender, EventArgs e) - { - //保存日志 - LogManager.saveLog(Utility.userName, this.buttonItemSJGL3.Text); - FrmEditShapeFile frm = new FrmEditShapeFile(globeControl1); - frm.ShowDialog(this); - } /// /// 连接数据库 /// @@ -12251,60 +10355,6 @@ List lineStruct = new List(); GSOFeature featureSelected = null; - private void AddDatagridView(DataTable table) - { - - if (table != null && table.Rows.Count > 0) - { - dataGridViewX1.DataSource = table; - panelOfTable.Visible = true; - panelOfTable.Height = 200; - toolStripNumbers.Text = "红线审核结果"; - toolStripFeatureLength.Text = " 共有:" + table.Rows.Count + "条"; - } - else - { - - } - - } - - /// - /// 去除集合中重复的管线 - /// - /// - /// - /// - private GSOFeatures getFeaturesByFilter(GSOFeatures features, string fieldName) - { - if (features == null) - { - return null; - } - GSOFeatures featuresGet = new GSOFeatures(); - for (int i = 0; i < features.Length; i++) - { - GSOFeature featureFromFS = features[i]; - string fieldValueFromFS = featureFromFS.GetValue(fieldName).ToString().Trim(); - bool isHas = false; - for (int j = featuresGet.Length - 1; j >= 0; j--) - { - GSOFeature featureFromFSGet = featuresGet[j]; - string fieldValueFromFSGet = featureFromFSGet.GetValue(fieldName).ToString().Trim(); - if (fieldValueFromFS.Equals(fieldValueFromFSGet)) - { - isHas = true; - break; - } - } - if (isHas == false) - { - featuresGet.Add(featureFromFS.Clone()); - } - } - return featuresGet; - } - /// /// 数据管理导入文件 /// @@ -12440,138 +10490,7 @@ // //MessageBox.Show("系统运行错误:" + ex.ToString(), "错误", MessageBoxButtons.OK, MessageBoxIcon.Error); // } //} - - - /// - /// 标识器全区域统计 - /// - /// - /// - private void 标识器分类统计ToolStripMenuItem_Click(object sender, EventArgs e) - { - globeControl1.Globe.Action = EnumAction3D.ActionNull; - FrmBSQStatis bsqStatis = new FrmBSQStatis(); - bsqStatis.Show(this); - } - /// - /// 标识器绘制区域统计 - /// - /// - /// - private void 标识器分类统计ToolStripMenuItem1_Click(object sender, EventArgs e) - { - trackflag = "BSQDuoBianXiangStatis"; - globeControl1.Globe.Action = EnumAction3D.TrackPolygon; - } - - - #region 保存和加载审核库加载的图层 - private void saveLayerList(TreeNodeCollection treeNodeList) - { - string configPath = Application.StartupPath + "\\configLayerList.xml"; - try - { - XmlDocument doc = new XmlDocument(); - doc.Load(configPath); - XmlNode dbParams = doc.SelectSingleNode("Params/dbparams"); - XmlNode dbLayers = doc.SelectSingleNode("Params/dblayers"); - XmlNode layers = doc.SelectSingleNode("Params/layers"); - dbParams.RemoveAll(); - dbLayers.RemoveAll(); - layers.RemoveAll(); - - List listDS = new List(); - String shDatasourceName = Utility.sgdbip + "/" + Utility.sgdbname + "_" + Utility.sgdbuser; - bool flag = false; - - for (int i = 0; i < globeControl1.Globe.DataManager.DataSourceCount; i++) - { - GSODataSource ds = globeControl1.Globe.DataManager.GetDataSourceAt(i); - if (ds != null && ds.Type == EnumDataSourceType.SqlServer || ds.Type == EnumDataSourceType.Oracle) - { - if (ds.Name == shDatasourceName) - { - //防止因为多次连接同一个数据库 - if (flag == true) - { - break; - } - flag = true; - listDS.Add(ds); - GSODataSourceCnn conn = ds.GetConnectionInfo(); - - XmlElement dbparam = doc.CreateElement("shdbparam"); - XmlElement ip = doc.CreateElement("ship"); - ip.InnerText = conn.Server; - - XmlElement dbname = doc.CreateElement("shdbname"); - dbname.InnerText = conn.Database; - - XmlElement username = doc.CreateElement("shusername"); - username.InnerText = conn.User; - - XmlElement password = doc.CreateElement("shpassword"); - password.InnerText = conn.Password; - - XmlElement type = doc.CreateElement("shtype"); - if (ds.Type == EnumDataSourceType.SqlServer) - { - type.InnerText = "sqlserver"; - } - else - { - type.InnerText = "oracle"; - } - - dbparam.AppendChild(ip); - dbparam.AppendChild(dbname); - dbparam.AppendChild(username); - dbparam.AppendChild(password); - dbparam.AppendChild(type); - dbParams.AppendChild(dbparam); - } - - } - } - - for (int i = 0; i < treeNodeList.Count; i++) - { - GSOLayer layer = treeNodeList[i].Tag as GSOLayer; - if (Path.GetExtension(layer.Name) == "") - { - XmlElement dbLayer = doc.CreateElement("dblayer"); - XmlAttribute attri = doc.CreateAttribute("dbindex"); - for (int j = 0; j < listDS.Count; j++) - { - if (layer.Dataset.DataSource.Name == listDS[j].Name) - { - attri.Value = j.ToString(); - break; - } - } - dbLayer.Attributes.Append(attri); - dbLayer.InnerText = layer.Name; - - dbLayers.AppendChild(dbLayer); - } - else - { - XmlElement dbLayer = doc.CreateElement("layer"); - dbLayer.InnerText = layer.Name; - layers.AppendChild(dbLayer); - } - } - - doc.Save(configPath); - } - catch (Exception e) - { - - } - } - - #endregion - + private void buttonItem_TaskManager_Click(object sender, EventArgs e) { if (Form_TaksManager.IS_OPEN) diff --git a/MainFrm.designer.cs b/MainFrm.designer.cs index 233ef8c..97b8299 100644 --- a/MainFrm.designer.cs +++ b/MainFrm.designer.cs @@ -82,6 +82,7 @@ this.sideBar1 = new DevComponents.DotNetBar.SideBar(); this.panelEx3 = new DevComponents.DotNetBar.PanelEx(); this.layerSensorTree = new System.Windows.Forms.TreeView(); + this.layerTree = new Cyberpipe.MyTreeView(); this.sideBarPanelItem3 = new DevComponents.DotNetBar.SideBarPanelItem(); this.controlContainerItem3 = new DevComponents.DotNetBar.ControlContainerItem(); this.sideBarPanelItem4 = new DevComponents.DotNetBar.SideBarPanelItem(); @@ -365,30 +366,26 @@ this.可编辑ToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); this.保存ToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); this.ribbonControl1 = new DevComponents.DotNetBar.RibbonControl(); - this.ribbonPanel1 = new DevComponents.DotNetBar.RibbonPanel(); - this.ribbonBar21 = new DevComponents.DotNetBar.RibbonBar(); - this.buttonItem87 = new DevComponents.DotNetBar.ButtonItem(); - this.buttonItem88 = new DevComponents.DotNetBar.ButtonItem(); - this.buttonItem27 = new DevComponents.DotNetBar.ButtonItem(); - this.buttonItem91 = new DevComponents.DotNetBar.ButtonItem(); - this.buttonItem1 = new DevComponents.DotNetBar.ButtonItem(); - this.btnlegendSet = new DevComponents.DotNetBar.ButtonItem(); - this.buttonItem89 = new DevComponents.DotNetBar.ButtonItem(); - this.ribbonPanel7 = new DevComponents.DotNetBar.RibbonPanel(); - this.ribbonBar5 = new DevComponents.DotNetBar.RibbonBar(); - this.btn_flag = new DevComponents.DotNetBar.ButtonItem(); - this.slider4ground = new DevComponents.DotNetBar.SliderItem(); - this.ribbonPanel2 = new DevComponents.DotNetBar.RibbonPanel(); - this.ribbonBar4 = new DevComponents.DotNetBar.RibbonBar(); - this.buttonItem_TaskManager = new DevComponents.DotNetBar.ButtonItem(); - this.buttonItem_OnlineTask = new DevComponents.DotNetBar.ButtonItem(); - this.buttonItem_Event = new DevComponents.DotNetBar.ButtonItem(); this.ribbonPanel3 = new DevComponents.DotNetBar.RibbonPanel(); this.ribbonBar3 = new DevComponents.DotNetBar.RibbonBar(); this.btn_device = new DevComponents.DotNetBar.ButtonItem(); this.btn_Person = new DevComponents.DotNetBar.ButtonItem(); this.btn_constructMap = new DevComponents.DotNetBar.ButtonItem(); this.buttonItem9 = new DevComponents.DotNetBar.ButtonItem(); + this.ribbonPanel2 = new DevComponents.DotNetBar.RibbonPanel(); + this.ribbonBar4 = new DevComponents.DotNetBar.RibbonBar(); + this.buttonItem_TaskManager = new DevComponents.DotNetBar.ButtonItem(); + this.buttonItem_OnlineTask = new DevComponents.DotNetBar.ButtonItem(); + this.buttonItem_Event = new DevComponents.DotNetBar.ButtonItem(); + this.ribbonPanel1 = new DevComponents.DotNetBar.RibbonPanel(); + this.ribbonBar21 = new DevComponents.DotNetBar.RibbonBar(); + this.buttonItem87 = new DevComponents.DotNetBar.ButtonItem(); + this.buttonItem88 = new DevComponents.DotNetBar.ButtonItem(); + this.buttonItem27 = new DevComponents.DotNetBar.ButtonItem(); + this.buttonItem1 = new DevComponents.DotNetBar.ButtonItem(); + this.buttonItem91 = new DevComponents.DotNetBar.ButtonItem(); + this.btnlegendSet = new DevComponents.DotNetBar.ButtonItem(); + this.buttonItem89 = new DevComponents.DotNetBar.ButtonItem(); this.ribbonPanel8 = new DevComponents.DotNetBar.RibbonPanel(); this.ribbonBar_UserInfo = new DevComponents.DotNetBar.RibbonBar(); this.btn_user_info = new DevComponents.DotNetBar.ButtonItem(); @@ -398,6 +395,10 @@ this.btn_user_role = new DevComponents.DotNetBar.ButtonItem(); this.btn_password_edit = new DevComponents.DotNetBar.ButtonItem(); this.btn_reset_password = new DevComponents.DotNetBar.ButtonItem(); + this.ribbonPanel7 = new DevComponents.DotNetBar.RibbonPanel(); + this.ribbonBar5 = new DevComponents.DotNetBar.RibbonBar(); + this.btn_flag = new DevComponents.DotNetBar.ButtonItem(); + this.slider4ground = new DevComponents.DotNetBar.SliderItem(); this.ribbonPanel15 = new DevComponents.DotNetBar.RibbonPanel(); this.ribbonBar20 = new DevComponents.DotNetBar.RibbonBar(); this.buttonItemSJGL = new DevComponents.DotNetBar.ButtonItem(); @@ -610,7 +611,6 @@ this.buttonItem84 = new DevComponents.DotNetBar.ButtonItem(); this.buttonItem75 = new DevComponents.DotNetBar.ButtonItem(); this.buttonItem76 = new DevComponents.DotNetBar.ButtonItem(); - this.layerTree = new Cyberpipe.MyTreeView(); this.statusStrip1.SuspendLayout(); this.sideBar1.SuspendLayout(); this.panelEx3.SuspendLayout(); @@ -647,11 +647,11 @@ this.contextMenuStrip3.SuspendLayout(); this.contextMenuStripDeleteLayerNode.SuspendLayout(); this.ribbonControl1.SuspendLayout(); - this.ribbonPanel1.SuspendLayout(); - this.ribbonPanel7.SuspendLayout(); - this.ribbonPanel2.SuspendLayout(); this.ribbonPanel3.SuspendLayout(); + this.ribbonPanel2.SuspendLayout(); + this.ribbonPanel1.SuspendLayout(); this.ribbonPanel8.SuspendLayout(); + this.ribbonPanel7.SuspendLayout(); this.ribbonPanel15.SuspendLayout(); ((System.ComponentModel.ISupportInitialize)(this.pictureBox1)).BeginInit(); this.SuspendLayout(); @@ -813,7 +813,6 @@ this.toolStripDropDownButton1.Size = new System.Drawing.Size(45, 21); this.toolStripDropDownButton1.Text = "帮助"; this.toolStripDropDownButton1.Visible = false; - this.toolStripDropDownButton1.Click += new System.EventHandler(this.toolStripDropDownButton1_Click); // // controlContainerItem1 // @@ -1047,6 +1046,16 @@ this.layerSensorTree.AfterCheck += new System.Windows.Forms.TreeViewEventHandler(this.layerMarkerTree_AfterCheck); this.layerSensorTree.NodeMouseClick += new System.Windows.Forms.TreeNodeMouseClickEventHandler(this.layerMarkerTree_NodeMouseClick); // + // layerTree + // + this.layerTree.CheckBoxes = true; + this.layerTree.ItemHeight = 18; + this.layerTree.Location = new System.Drawing.Point(30, 78); + this.layerTree.Name = "layerTree"; + this.layerTree.Size = new System.Drawing.Size(121, 97); + this.layerTree.TabIndex = 1; + this.layerTree.AfterCheck += new System.Windows.Forms.TreeViewEventHandler(this.layerTree_AfterCheck); + // // sideBarPanelItem3 // this.sideBarPanelItem3.FontBold = true; @@ -2966,28 +2975,28 @@ // 平移对象ToolStripMenuItem // this.平移对象ToolStripMenuItem.Name = "平移对象ToolStripMenuItem"; - this.平移对象ToolStripMenuItem.Size = new System.Drawing.Size(152, 22); + this.平移对象ToolStripMenuItem.Size = new System.Drawing.Size(124, 22); this.平移对象ToolStripMenuItem.Text = "平移对象"; this.平移对象ToolStripMenuItem.Click += new System.EventHandler(this.buttonItemBJ6_Click); // // 升降对象ToolStripMenuItem // this.升降对象ToolStripMenuItem.Name = "升降对象ToolStripMenuItem"; - this.升降对象ToolStripMenuItem.Size = new System.Drawing.Size(152, 22); + this.升降对象ToolStripMenuItem.Size = new System.Drawing.Size(124, 22); this.升降对象ToolStripMenuItem.Text = "升降对象"; this.升降对象ToolStripMenuItem.Click += new System.EventHandler(this.buttonItemBJ7_Click); // // 旋转对象ToolStripMenuItem // this.旋转对象ToolStripMenuItem.Name = "旋转对象ToolStripMenuItem"; - this.旋转对象ToolStripMenuItem.Size = new System.Drawing.Size(152, 22); + this.旋转对象ToolStripMenuItem.Size = new System.Drawing.Size(124, 22); this.旋转对象ToolStripMenuItem.Text = "旋转对象"; this.旋转对象ToolStripMenuItem.Click += new System.EventHandler(this.buttonItemBJ8_Click); // // 连接管段ToolStripMenuItem // this.连接管段ToolStripMenuItem.Name = "连接管段ToolStripMenuItem"; - this.连接管段ToolStripMenuItem.Size = new System.Drawing.Size(152, 22); + this.连接管段ToolStripMenuItem.Size = new System.Drawing.Size(124, 22); this.连接管段ToolStripMenuItem.Text = "连接管段"; this.连接管段ToolStripMenuItem.Click += new System.EventHandler(this.buttonItemBJ9_Click); // @@ -2997,34 +3006,34 @@ this.导出CADToolStripMenuItem, this.导出文件ToolStripMenuItem1}); this.导出文件ToolStripMenuItem.Name = "导出文件ToolStripMenuItem"; - this.导出文件ToolStripMenuItem.Size = new System.Drawing.Size(152, 22); + this.导出文件ToolStripMenuItem.Size = new System.Drawing.Size(124, 22); this.导出文件ToolStripMenuItem.Text = "导出矢量"; // // 导出CADToolStripMenuItem // this.导出CADToolStripMenuItem.Name = "导出CADToolStripMenuItem"; - this.导出CADToolStripMenuItem.Size = new System.Drawing.Size(152, 22); + this.导出CADToolStripMenuItem.Size = new System.Drawing.Size(125, 22); this.导出CADToolStripMenuItem.Text = "导出CAD"; this.导出CADToolStripMenuItem.Click += new System.EventHandler(this.buttonItemBJ10_1_Click); // // 导出文件ToolStripMenuItem1 // this.导出文件ToolStripMenuItem1.Name = "导出文件ToolStripMenuItem1"; - this.导出文件ToolStripMenuItem1.Size = new System.Drawing.Size(152, 22); + this.导出文件ToolStripMenuItem1.Size = new System.Drawing.Size(125, 22); this.导出文件ToolStripMenuItem1.Text = "导出文件"; this.导出文件ToolStripMenuItem1.Click += new System.EventHandler(this.buttonItemBJ10_2_Click); // // 前进ToolStripMenuItem // this.前进ToolStripMenuItem.Name = "前进ToolStripMenuItem"; - this.前进ToolStripMenuItem.Size = new System.Drawing.Size(152, 22); + this.前进ToolStripMenuItem.Size = new System.Drawing.Size(124, 22); this.前进ToolStripMenuItem.Text = "前进"; this.前进ToolStripMenuItem.Click += new System.EventHandler(this.buttonItemBJ12_Click); // // 删除模型ToolStripMenuItem // this.删除模型ToolStripMenuItem.Name = "删除模型ToolStripMenuItem"; - this.删除模型ToolStripMenuItem.Size = new System.Drawing.Size(152, 22); + this.删除模型ToolStripMenuItem.Size = new System.Drawing.Size(124, 22); this.删除模型ToolStripMenuItem.Text = "后退"; this.删除模型ToolStripMenuItem.Click += new System.EventHandler(this.buttonItemBJ11_Click); // @@ -4160,6 +4169,198 @@ this.ribbonControl1.Text = "ribbonControl1"; this.ribbonControl1.UseCustomizeDialog = false; // + // ribbonPanel3 + // + this.ribbonPanel3.ColorSchemeStyle = DevComponents.DotNetBar.eDotNetBarStyle.StyleManagerControlled; + this.ribbonPanel3.Controls.Add(this.ribbonBar3); + this.ribbonPanel3.Dock = System.Windows.Forms.DockStyle.Fill; + this.ribbonPanel3.Location = new System.Drawing.Point(0, 33); + this.ribbonPanel3.Name = "ribbonPanel3"; + this.ribbonPanel3.Padding = new System.Windows.Forms.Padding(3, 0, 3, 3); + this.ribbonPanel3.Size = new System.Drawing.Size(1328, 62); + // + // + // + this.ribbonPanel3.Style.Class = ""; + this.ribbonPanel3.Style.CornerType = DevComponents.DotNetBar.eCornerType.Square; + // + // + // + this.ribbonPanel3.StyleMouseDown.Class = ""; + this.ribbonPanel3.StyleMouseDown.CornerType = DevComponents.DotNetBar.eCornerType.Square; + // + // + // + this.ribbonPanel3.StyleMouseOver.Class = ""; + this.ribbonPanel3.StyleMouseOver.CornerType = DevComponents.DotNetBar.eCornerType.Square; + this.ribbonPanel3.TabIndex = 40; + // + // ribbonBar3 + // + this.ribbonBar3.AutoOverflowEnabled = true; + // + // + // + this.ribbonBar3.BackgroundMouseOverStyle.Class = ""; + this.ribbonBar3.BackgroundMouseOverStyle.CornerType = DevComponents.DotNetBar.eCornerType.Square; + // + // + // + this.ribbonBar3.BackgroundStyle.Class = ""; + this.ribbonBar3.BackgroundStyle.CornerType = DevComponents.DotNetBar.eCornerType.Square; + this.ribbonBar3.ContainerControlProcessDialogKey = true; + this.ribbonBar3.Dock = System.Windows.Forms.DockStyle.Left; + this.ribbonBar3.Items.AddRange(new DevComponents.DotNetBar.BaseItem[] { + this.btn_device, + this.btn_Person, + this.btn_constructMap, + this.buttonItem9}); + this.ribbonBar3.Location = new System.Drawing.Point(3, 0); + this.ribbonBar3.Name = "ribbonBar3"; + this.ribbonBar3.Size = new System.Drawing.Size(378, 59); + this.ribbonBar3.Style = DevComponents.DotNetBar.eDotNetBarStyle.StyleManagerControlled; + this.ribbonBar3.TabIndex = 0; + // + // + // + this.ribbonBar3.TitleStyle.Class = ""; + this.ribbonBar3.TitleStyle.CornerType = DevComponents.DotNetBar.eCornerType.Square; + // + // + // + this.ribbonBar3.TitleStyleMouseOver.Class = ""; + this.ribbonBar3.TitleStyleMouseOver.CornerType = DevComponents.DotNetBar.eCornerType.Square; + this.ribbonBar3.TitleVisible = false; + // + // btn_device + // + this.btn_device.ButtonStyle = DevComponents.DotNetBar.eButtonStyle.ImageAndText; + this.btn_device.Image = global::Cyberpipe.Properties.Resources._24X24__2__02; + this.btn_device.ImagePosition = DevComponents.DotNetBar.eImagePosition.Top; + this.btn_device.Name = "btn_device"; + this.btn_device.SubItemsExpandWidth = 14; + this.btn_device.Text = "探测仪管理"; + this.btn_device.Click += new System.EventHandler(this.btn_device_Click); + // + // btn_Person + // + this.btn_Person.ButtonStyle = DevComponents.DotNetBar.eButtonStyle.ImageAndText; + this.btn_Person.Image = global::Cyberpipe.Properties.Resources._24x24icon_05_hover1; + this.btn_Person.ImagePosition = DevComponents.DotNetBar.eImagePosition.Top; + this.btn_Person.Name = "btn_Person"; + this.btn_Person.SubItemsExpandWidth = 14; + this.btn_Person.Text = "定位人员维护"; + this.btn_Person.Click += new System.EventHandler(this.btn_Person_Click); + // + // btn_constructMap + // + this.btn_constructMap.Image = global::Cyberpipe.Properties.Resources._24x24icon_04_hover; + this.btn_constructMap.ImagePosition = DevComponents.DotNetBar.eImagePosition.Top; + this.btn_constructMap.Name = "btn_constructMap"; + this.btn_constructMap.SubItemsExpandWidth = 14; + this.btn_constructMap.Text = "导出施工图"; + this.btn_constructMap.Click += new System.EventHandler(this.btn_constructMap_Click); + // + // buttonItem9 + // + this.buttonItem9.Image = global::Cyberpipe.Properties.Resources._24x24icon__2__10; + this.buttonItem9.ImagePosition = DevComponents.DotNetBar.eImagePosition.Top; + this.buttonItem9.Name = "buttonItem9"; + this.buttonItem9.SubItemsExpandWidth = 14; + this.buttonItem9.Text = "文档管理"; + this.buttonItem9.Click += new System.EventHandler(this.buttonItem9_Click); + // + // ribbonPanel2 + // + this.ribbonPanel2.ColorSchemeStyle = DevComponents.DotNetBar.eDotNetBarStyle.StyleManagerControlled; + this.ribbonPanel2.Controls.Add(this.ribbonBar4); + this.ribbonPanel2.Dock = System.Windows.Forms.DockStyle.Fill; + this.ribbonPanel2.Location = new System.Drawing.Point(0, 0); + this.ribbonPanel2.Name = "ribbonPanel2"; + this.ribbonPanel2.Padding = new System.Windows.Forms.Padding(3, 0, 3, 3); + this.ribbonPanel2.Size = new System.Drawing.Size(1328, 95); + // + // + // + this.ribbonPanel2.Style.Class = ""; + this.ribbonPanel2.Style.CornerType = DevComponents.DotNetBar.eCornerType.Square; + // + // + // + this.ribbonPanel2.StyleMouseDown.Class = ""; + this.ribbonPanel2.StyleMouseDown.CornerType = DevComponents.DotNetBar.eCornerType.Square; + // + // + // + this.ribbonPanel2.StyleMouseOver.Class = ""; + this.ribbonPanel2.StyleMouseOver.CornerType = DevComponents.DotNetBar.eCornerType.Square; + this.ribbonPanel2.TabIndex = 39; + this.ribbonPanel2.Visible = false; + // + // ribbonBar4 + // + this.ribbonBar4.AutoOverflowEnabled = true; + // + // + // + this.ribbonBar4.BackgroundMouseOverStyle.Class = ""; + this.ribbonBar4.BackgroundMouseOverStyle.CornerType = DevComponents.DotNetBar.eCornerType.Square; + // + // + // + this.ribbonBar4.BackgroundStyle.Class = ""; + this.ribbonBar4.BackgroundStyle.CornerType = DevComponents.DotNetBar.eCornerType.Square; + this.ribbonBar4.ContainerControlProcessDialogKey = true; + this.ribbonBar4.Dock = System.Windows.Forms.DockStyle.Left; + this.ribbonBar4.Items.AddRange(new DevComponents.DotNetBar.BaseItem[] { + this.buttonItem_TaskManager, + this.buttonItem_OnlineTask, + this.buttonItem_Event}); + this.ribbonBar4.Location = new System.Drawing.Point(3, 0); + this.ribbonBar4.Name = "ribbonBar4"; + this.ribbonBar4.Size = new System.Drawing.Size(299, 92); + this.ribbonBar4.Style = DevComponents.DotNetBar.eDotNetBarStyle.StyleManagerControlled; + this.ribbonBar4.TabIndex = 0; + this.ribbonBar4.Text = "ribbonBar4"; + // + // + // + this.ribbonBar4.TitleStyle.Class = ""; + this.ribbonBar4.TitleStyle.CornerType = DevComponents.DotNetBar.eCornerType.Square; + // + // + // + this.ribbonBar4.TitleStyleMouseOver.Class = ""; + this.ribbonBar4.TitleStyleMouseOver.CornerType = DevComponents.DotNetBar.eCornerType.Square; + this.ribbonBar4.TitleVisible = false; + // + // buttonItem_TaskManager + // + this.buttonItem_TaskManager.Image = global::Cyberpipe.Properties.Resources._24x24icon__2__76; + this.buttonItem_TaskManager.ImagePosition = DevComponents.DotNetBar.eImagePosition.Top; + this.buttonItem_TaskManager.Name = "buttonItem_TaskManager"; + this.buttonItem_TaskManager.SubItemsExpandWidth = 14; + this.buttonItem_TaskManager.Text = "工单管理"; + this.buttonItem_TaskManager.Click += new System.EventHandler(this.buttonItem_TaskManager_Click); + // + // buttonItem_OnlineTask + // + this.buttonItem_OnlineTask.Image = global::Cyberpipe.Properties.Resources._24x24icon__2__69; + this.buttonItem_OnlineTask.ImagePosition = DevComponents.DotNetBar.eImagePosition.Top; + this.buttonItem_OnlineTask.Name = "buttonItem_OnlineTask"; + this.buttonItem_OnlineTask.SubItemsExpandWidth = 14; + this.buttonItem_OnlineTask.Text = "在线任务"; + this.buttonItem_OnlineTask.Click += new System.EventHandler(this.buttonItem_OnlineTask_Click); + // + // buttonItem_Event + // + this.buttonItem_Event.Image = global::Cyberpipe.Properties.Resources._24x24icon__2__72; + this.buttonItem_Event.ImagePosition = DevComponents.DotNetBar.eImagePosition.Top; + this.buttonItem_Event.Name = "buttonItem_Event"; + this.buttonItem_Event.SubItemsExpandWidth = 14; + this.buttonItem_Event.Text = "事件管理"; + this.buttonItem_Event.Click += new System.EventHandler(this.buttonItem_Event_Click); + // // ribbonPanel1 // this.ribbonPanel1.AutoSize = true; @@ -4262,6 +4463,15 @@ this.buttonItem27.Visible = false; this.buttonItem27.Click += new System.EventHandler(this.buttonItem27_Click); // + // buttonItem1 + // + this.buttonItem1.Image = global::Cyberpipe.Properties.Resources._24x24icon__2__94; + this.buttonItem1.ImagePosition = DevComponents.DotNetBar.eImagePosition.Top; + this.buttonItem1.Name = "buttonItem1"; + this.buttonItem1.SubItemsExpandWidth = 14; + this.buttonItem1.Text = "图层管理"; + this.buttonItem1.Click += new System.EventHandler(this.buttonItem1_Click); + // // buttonItem91 // this.buttonItem91.ForeColor = System.Drawing.Color.Black; @@ -4272,15 +4482,6 @@ this.buttonItem91.Text = "快速定位"; this.buttonItem91.Click += new System.EventHandler(this.buttonItem91_Click); // - // buttonItem1 - // - this.buttonItem1.Image = global::Cyberpipe.Properties.Resources._24x24icon__2__94; - this.buttonItem1.ImagePosition = DevComponents.DotNetBar.eImagePosition.Top; - this.buttonItem1.Name = "buttonItem1"; - this.buttonItem1.SubItemsExpandWidth = 14; - this.buttonItem1.Text = "图层管理"; - this.buttonItem1.Click += new System.EventHandler(this.buttonItem1_Click); - // // btnlegendSet // this.btnlegendSet.Image = global::Cyberpipe.Properties.Resources._24x24icon__2__93; @@ -4300,278 +4501,6 @@ this.buttonItem89.Visible = false; this.buttonItem89.Click += new System.EventHandler(this.buttonItem89_Click); // - // ribbonPanel7 - // - this.ribbonPanel7.ColorSchemeStyle = DevComponents.DotNetBar.eDotNetBarStyle.StyleManagerControlled; - this.ribbonPanel7.Controls.Add(this.ribbonBar5); - this.ribbonPanel7.Dock = System.Windows.Forms.DockStyle.Fill; - this.ribbonPanel7.Location = new System.Drawing.Point(0, 0); - this.ribbonPanel7.Name = "ribbonPanel7"; - this.ribbonPanel7.Padding = new System.Windows.Forms.Padding(3, 0, 3, 3); - this.ribbonPanel7.Size = new System.Drawing.Size(1328, 95); - // - // - // - this.ribbonPanel7.Style.Class = ""; - this.ribbonPanel7.Style.CornerType = DevComponents.DotNetBar.eCornerType.Square; - // - // - // - this.ribbonPanel7.StyleMouseDown.Class = ""; - this.ribbonPanel7.StyleMouseDown.CornerType = DevComponents.DotNetBar.eCornerType.Square; - // - // - // - this.ribbonPanel7.StyleMouseOver.Class = ""; - this.ribbonPanel7.StyleMouseOver.CornerType = DevComponents.DotNetBar.eCornerType.Square; - this.ribbonPanel7.TabIndex = 41; - this.ribbonPanel7.Visible = false; - // - // ribbonBar5 - // - this.ribbonBar5.AutoOverflowEnabled = true; - // - // - // - this.ribbonBar5.BackgroundMouseOverStyle.Class = ""; - this.ribbonBar5.BackgroundMouseOverStyle.CornerType = DevComponents.DotNetBar.eCornerType.Square; - // - // - // - this.ribbonBar5.BackgroundStyle.Class = ""; - this.ribbonBar5.BackgroundStyle.CornerType = DevComponents.DotNetBar.eCornerType.Square; - this.ribbonBar5.ContainerControlProcessDialogKey = true; - this.ribbonBar5.Dock = System.Windows.Forms.DockStyle.Left; - this.ribbonBar5.Items.AddRange(new DevComponents.DotNetBar.BaseItem[] { - this.btn_flag, - this.slider4ground}); - this.ribbonBar5.Location = new System.Drawing.Point(3, 0); - this.ribbonBar5.Name = "ribbonBar5"; - this.ribbonBar5.Size = new System.Drawing.Size(418, 92); - this.ribbonBar5.Style = DevComponents.DotNetBar.eDotNetBarStyle.StyleManagerControlled; - this.ribbonBar5.TabIndex = 0; - // - // - // - this.ribbonBar5.TitleStyle.Class = ""; - this.ribbonBar5.TitleStyle.CornerType = DevComponents.DotNetBar.eCornerType.Square; - // - // - // - this.ribbonBar5.TitleStyleMouseOver.Class = ""; - this.ribbonBar5.TitleStyleMouseOver.CornerType = DevComponents.DotNetBar.eCornerType.Square; - this.ribbonBar5.TitleVisible = false; - this.ribbonBar5.ItemClick += new System.EventHandler(this.ribbonBar5_ItemClick); - // - // btn_flag - // - this.btn_flag.Image = global::Cyberpipe.Properties.Resources._24x24icon_03_hover; - this.btn_flag.ImagePosition = DevComponents.DotNetBar.eImagePosition.Top; - this.btn_flag.Name = "btn_flag"; - this.btn_flag.SubItemsExpandWidth = 14; - this.btn_flag.Text = "标识器管理"; - this.btn_flag.Click += new System.EventHandler(this.btn_flag_Click); - // - // slider4ground - // - this.slider4ground.LabelPosition = DevComponents.DotNetBar.eSliderLabelPosition.Top; - this.slider4ground.Name = "slider4ground"; - this.slider4ground.Text = "地面透明度"; - this.slider4ground.Value = 0; - this.slider4ground.ValueChanged += new System.EventHandler(this.slider4ground_ValueChanged); - // - // ribbonPanel2 - // - this.ribbonPanel2.ColorSchemeStyle = DevComponents.DotNetBar.eDotNetBarStyle.StyleManagerControlled; - this.ribbonPanel2.Controls.Add(this.ribbonBar4); - this.ribbonPanel2.Dock = System.Windows.Forms.DockStyle.Fill; - this.ribbonPanel2.Location = new System.Drawing.Point(0, 0); - this.ribbonPanel2.Name = "ribbonPanel2"; - this.ribbonPanel2.Padding = new System.Windows.Forms.Padding(3, 0, 3, 3); - this.ribbonPanel2.Size = new System.Drawing.Size(1328, 95); - // - // - // - this.ribbonPanel2.Style.Class = ""; - this.ribbonPanel2.Style.CornerType = DevComponents.DotNetBar.eCornerType.Square; - // - // - // - this.ribbonPanel2.StyleMouseDown.Class = ""; - this.ribbonPanel2.StyleMouseDown.CornerType = DevComponents.DotNetBar.eCornerType.Square; - // - // - // - this.ribbonPanel2.StyleMouseOver.Class = ""; - this.ribbonPanel2.StyleMouseOver.CornerType = DevComponents.DotNetBar.eCornerType.Square; - this.ribbonPanel2.TabIndex = 39; - this.ribbonPanel2.Visible = false; - // - // ribbonBar4 - // - this.ribbonBar4.AutoOverflowEnabled = true; - // - // - // - this.ribbonBar4.BackgroundMouseOverStyle.Class = ""; - this.ribbonBar4.BackgroundMouseOverStyle.CornerType = DevComponents.DotNetBar.eCornerType.Square; - // - // - // - this.ribbonBar4.BackgroundStyle.Class = ""; - this.ribbonBar4.BackgroundStyle.CornerType = DevComponents.DotNetBar.eCornerType.Square; - this.ribbonBar4.ContainerControlProcessDialogKey = true; - this.ribbonBar4.Dock = System.Windows.Forms.DockStyle.Left; - this.ribbonBar4.Items.AddRange(new DevComponents.DotNetBar.BaseItem[] { - this.buttonItem_TaskManager, - this.buttonItem_OnlineTask, - this.buttonItem_Event}); - this.ribbonBar4.Location = new System.Drawing.Point(3, 0); - this.ribbonBar4.Name = "ribbonBar4"; - this.ribbonBar4.Size = new System.Drawing.Size(299, 92); - this.ribbonBar4.Style = DevComponents.DotNetBar.eDotNetBarStyle.StyleManagerControlled; - this.ribbonBar4.TabIndex = 0; - this.ribbonBar4.Text = "ribbonBar4"; - // - // - // - this.ribbonBar4.TitleStyle.Class = ""; - this.ribbonBar4.TitleStyle.CornerType = DevComponents.DotNetBar.eCornerType.Square; - // - // - // - this.ribbonBar4.TitleStyleMouseOver.Class = ""; - this.ribbonBar4.TitleStyleMouseOver.CornerType = DevComponents.DotNetBar.eCornerType.Square; - this.ribbonBar4.TitleVisible = false; - // - // buttonItem_TaskManager - // - this.buttonItem_TaskManager.Image = global::Cyberpipe.Properties.Resources._24x24icon__2__76; - this.buttonItem_TaskManager.ImagePosition = DevComponents.DotNetBar.eImagePosition.Top; - this.buttonItem_TaskManager.Name = "buttonItem_TaskManager"; - this.buttonItem_TaskManager.SubItemsExpandWidth = 14; - this.buttonItem_TaskManager.Text = "工单管理"; - this.buttonItem_TaskManager.Click += new System.EventHandler(this.buttonItem_TaskManager_Click); - // - // buttonItem_OnlineTask - // - this.buttonItem_OnlineTask.Image = global::Cyberpipe.Properties.Resources._24x24icon__2__69; - this.buttonItem_OnlineTask.ImagePosition = DevComponents.DotNetBar.eImagePosition.Top; - this.buttonItem_OnlineTask.Name = "buttonItem_OnlineTask"; - this.buttonItem_OnlineTask.SubItemsExpandWidth = 14; - this.buttonItem_OnlineTask.Text = "在线任务"; - this.buttonItem_OnlineTask.Click += new System.EventHandler(this.buttonItem_OnlineTask_Click); - // - // buttonItem_Event - // - this.buttonItem_Event.Image = global::Cyberpipe.Properties.Resources._24x24icon__2__72; - this.buttonItem_Event.ImagePosition = DevComponents.DotNetBar.eImagePosition.Top; - this.buttonItem_Event.Name = "buttonItem_Event"; - this.buttonItem_Event.SubItemsExpandWidth = 14; - this.buttonItem_Event.Text = "事件管理"; - this.buttonItem_Event.Click += new System.EventHandler(this.buttonItem_Event_Click); - // - // ribbonPanel3 - // - this.ribbonPanel3.ColorSchemeStyle = DevComponents.DotNetBar.eDotNetBarStyle.StyleManagerControlled; - this.ribbonPanel3.Controls.Add(this.ribbonBar3); - this.ribbonPanel3.Dock = System.Windows.Forms.DockStyle.Fill; - this.ribbonPanel3.Location = new System.Drawing.Point(0, 33); - this.ribbonPanel3.Name = "ribbonPanel3"; - this.ribbonPanel3.Padding = new System.Windows.Forms.Padding(3, 0, 3, 3); - this.ribbonPanel3.Size = new System.Drawing.Size(1328, 62); - // - // - // - this.ribbonPanel3.Style.Class = ""; - this.ribbonPanel3.Style.CornerType = DevComponents.DotNetBar.eCornerType.Square; - // - // - // - this.ribbonPanel3.StyleMouseDown.Class = ""; - this.ribbonPanel3.StyleMouseDown.CornerType = DevComponents.DotNetBar.eCornerType.Square; - // - // - // - this.ribbonPanel3.StyleMouseOver.Class = ""; - this.ribbonPanel3.StyleMouseOver.CornerType = DevComponents.DotNetBar.eCornerType.Square; - this.ribbonPanel3.TabIndex = 40; - // - // ribbonBar3 - // - this.ribbonBar3.AutoOverflowEnabled = true; - // - // - // - this.ribbonBar3.BackgroundMouseOverStyle.Class = ""; - this.ribbonBar3.BackgroundMouseOverStyle.CornerType = DevComponents.DotNetBar.eCornerType.Square; - // - // - // - this.ribbonBar3.BackgroundStyle.Class = ""; - this.ribbonBar3.BackgroundStyle.CornerType = DevComponents.DotNetBar.eCornerType.Square; - this.ribbonBar3.ContainerControlProcessDialogKey = true; - this.ribbonBar3.Dock = System.Windows.Forms.DockStyle.Left; - this.ribbonBar3.Items.AddRange(new DevComponents.DotNetBar.BaseItem[] { - this.btn_device, - this.btn_Person, - this.btn_constructMap, - this.buttonItem9}); - this.ribbonBar3.Location = new System.Drawing.Point(3, 0); - this.ribbonBar3.Name = "ribbonBar3"; - this.ribbonBar3.Size = new System.Drawing.Size(378, 59); - this.ribbonBar3.Style = DevComponents.DotNetBar.eDotNetBarStyle.StyleManagerControlled; - this.ribbonBar3.TabIndex = 0; - // - // - // - this.ribbonBar3.TitleStyle.Class = ""; - this.ribbonBar3.TitleStyle.CornerType = DevComponents.DotNetBar.eCornerType.Square; - // - // - // - this.ribbonBar3.TitleStyleMouseOver.Class = ""; - this.ribbonBar3.TitleStyleMouseOver.CornerType = DevComponents.DotNetBar.eCornerType.Square; - this.ribbonBar3.TitleVisible = false; - // - // btn_device - // - this.btn_device.ButtonStyle = DevComponents.DotNetBar.eButtonStyle.ImageAndText; - this.btn_device.Image = global::Cyberpipe.Properties.Resources._24X24__2__02; - this.btn_device.ImagePosition = DevComponents.DotNetBar.eImagePosition.Top; - this.btn_device.Name = "btn_device"; - this.btn_device.SubItemsExpandWidth = 14; - this.btn_device.Text = "探测仪管理"; - this.btn_device.Click += new System.EventHandler(this.btn_device_Click); - // - // btn_Person - // - this.btn_Person.ButtonStyle = DevComponents.DotNetBar.eButtonStyle.ImageAndText; - this.btn_Person.Image = global::Cyberpipe.Properties.Resources._24x24icon_05_hover1; - this.btn_Person.ImagePosition = DevComponents.DotNetBar.eImagePosition.Top; - this.btn_Person.Name = "btn_Person"; - this.btn_Person.SubItemsExpandWidth = 14; - this.btn_Person.Text = "定位人员维护"; - this.btn_Person.Click += new System.EventHandler(this.btn_Person_Click); - // - // btn_constructMap - // - this.btn_constructMap.Image = global::Cyberpipe.Properties.Resources._24x24icon_04_hover; - this.btn_constructMap.ImagePosition = DevComponents.DotNetBar.eImagePosition.Top; - this.btn_constructMap.Name = "btn_constructMap"; - this.btn_constructMap.SubItemsExpandWidth = 14; - this.btn_constructMap.Text = "导出施工图"; - this.btn_constructMap.Click += new System.EventHandler(this.btn_constructMap_Click); - // - // buttonItem9 - // - this.buttonItem9.Image = global::Cyberpipe.Properties.Resources._24x24icon__2__10; - this.buttonItem9.ImagePosition = DevComponents.DotNetBar.eImagePosition.Top; - this.buttonItem9.Name = "buttonItem9"; - this.buttonItem9.SubItemsExpandWidth = 14; - this.buttonItem9.Text = "文档管理"; - this.buttonItem9.Click += new System.EventHandler(this.buttonItem9_Click); - // // ribbonPanel8 // this.ribbonPanel8.ColorSchemeStyle = DevComponents.DotNetBar.eDotNetBarStyle.StyleManagerControlled; @@ -4696,6 +4625,86 @@ this.btn_reset_password.Text = "重置密码"; this.btn_reset_password.Click += new System.EventHandler(this.btn_reset_password_Click); // + // ribbonPanel7 + // + this.ribbonPanel7.ColorSchemeStyle = DevComponents.DotNetBar.eDotNetBarStyle.StyleManagerControlled; + this.ribbonPanel7.Controls.Add(this.ribbonBar5); + this.ribbonPanel7.Dock = System.Windows.Forms.DockStyle.Fill; + this.ribbonPanel7.Location = new System.Drawing.Point(0, 0); + this.ribbonPanel7.Name = "ribbonPanel7"; + this.ribbonPanel7.Padding = new System.Windows.Forms.Padding(3, 0, 3, 3); + this.ribbonPanel7.Size = new System.Drawing.Size(1328, 95); + // + // + // + this.ribbonPanel7.Style.Class = ""; + this.ribbonPanel7.Style.CornerType = DevComponents.DotNetBar.eCornerType.Square; + // + // + // + this.ribbonPanel7.StyleMouseDown.Class = ""; + this.ribbonPanel7.StyleMouseDown.CornerType = DevComponents.DotNetBar.eCornerType.Square; + // + // + // + this.ribbonPanel7.StyleMouseOver.Class = ""; + this.ribbonPanel7.StyleMouseOver.CornerType = DevComponents.DotNetBar.eCornerType.Square; + this.ribbonPanel7.TabIndex = 41; + this.ribbonPanel7.Visible = false; + // + // ribbonBar5 + // + this.ribbonBar5.AutoOverflowEnabled = true; + // + // + // + this.ribbonBar5.BackgroundMouseOverStyle.Class = ""; + this.ribbonBar5.BackgroundMouseOverStyle.CornerType = DevComponents.DotNetBar.eCornerType.Square; + // + // + // + this.ribbonBar5.BackgroundStyle.Class = ""; + this.ribbonBar5.BackgroundStyle.CornerType = DevComponents.DotNetBar.eCornerType.Square; + this.ribbonBar5.ContainerControlProcessDialogKey = true; + this.ribbonBar5.Dock = System.Windows.Forms.DockStyle.Left; + this.ribbonBar5.Items.AddRange(new DevComponents.DotNetBar.BaseItem[] { + this.btn_flag, + this.slider4ground}); + this.ribbonBar5.Location = new System.Drawing.Point(3, 0); + this.ribbonBar5.Name = "ribbonBar5"; + this.ribbonBar5.Size = new System.Drawing.Size(418, 92); + this.ribbonBar5.Style = DevComponents.DotNetBar.eDotNetBarStyle.StyleManagerControlled; + this.ribbonBar5.TabIndex = 0; + // + // + // + this.ribbonBar5.TitleStyle.Class = ""; + this.ribbonBar5.TitleStyle.CornerType = DevComponents.DotNetBar.eCornerType.Square; + // + // + // + this.ribbonBar5.TitleStyleMouseOver.Class = ""; + this.ribbonBar5.TitleStyleMouseOver.CornerType = DevComponents.DotNetBar.eCornerType.Square; + this.ribbonBar5.TitleVisible = false; + this.ribbonBar5.ItemClick += new System.EventHandler(this.ribbonBar5_ItemClick); + // + // btn_flag + // + this.btn_flag.Image = global::Cyberpipe.Properties.Resources._24x24icon_03_hover; + this.btn_flag.ImagePosition = DevComponents.DotNetBar.eImagePosition.Top; + this.btn_flag.Name = "btn_flag"; + this.btn_flag.SubItemsExpandWidth = 14; + this.btn_flag.Text = "标识器管理"; + this.btn_flag.Click += new System.EventHandler(this.btn_flag_Click); + // + // slider4ground + // + this.slider4ground.LabelPosition = DevComponents.DotNetBar.eSliderLabelPosition.Top; + this.slider4ground.Name = "slider4ground"; + this.slider4ground.Text = "地面透明度"; + this.slider4ground.Value = 0; + this.slider4ground.ValueChanged += new System.EventHandler(this.slider4ground_ValueChanged); + // // ribbonPanel15 // this.ribbonPanel15.ColorSchemeStyle = DevComponents.DotNetBar.eDotNetBarStyle.StyleManagerControlled; @@ -6393,16 +6402,6 @@ this.buttonItem76.SubItemsExpandWidth = 14; this.buttonItem76.Text = "坐标标注"; // - // layerTree - // - this.layerTree.CheckBoxes = true; - this.layerTree.ItemHeight = 18; - this.layerTree.Location = new System.Drawing.Point(30, 78); - this.layerTree.Name = "layerTree"; - this.layerTree.Size = new System.Drawing.Size(121, 97); - this.layerTree.TabIndex = 1; - this.layerTree.AfterCheck += new System.Windows.Forms.TreeViewEventHandler(this.layerTree_AfterCheck); - // // MainFrm // this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Inherit; @@ -6475,11 +6474,11 @@ this.contextMenuStripDeleteLayerNode.ResumeLayout(false); this.ribbonControl1.ResumeLayout(false); this.ribbonControl1.PerformLayout(); - this.ribbonPanel1.ResumeLayout(false); - this.ribbonPanel7.ResumeLayout(false); - this.ribbonPanel2.ResumeLayout(false); this.ribbonPanel3.ResumeLayout(false); + this.ribbonPanel2.ResumeLayout(false); + this.ribbonPanel1.ResumeLayout(false); this.ribbonPanel8.ResumeLayout(false); + this.ribbonPanel7.ResumeLayout(false); this.ribbonPanel15.ResumeLayout(false); ((System.ComponentModel.ISupportInitialize)(this.pictureBox1)).EndInit(); this.ResumeLayout(false); diff --git a/NewFunction/FrmCreateTunnel.cs b/NewFunction/FrmCreateTunnel.cs index 282767c..338edff 100644 --- a/NewFunction/FrmCreateTunnel.cs +++ b/NewFunction/FrmCreateTunnel.cs @@ -142,35 +142,6 @@ } } - private void txtMS_KeyPress(object sender, KeyPressEventArgs e) - { - TextBox text = sender as TextBox; - if ((e.KeyChar < 48 || e.KeyChar > 57) && (e.KeyChar != 8) && (int)e.KeyChar != 46) - { - e.Handled = true; - } - if ((int)e.KeyChar == 46) //小数点 - { - if (text.Text.Length <= 0) - e.Handled = true; //小数点不能在第一位 - else //处理不规则的小数点 - { - float f; - float oldf; - bool b1 = false, b2 = false; - b1 = float.TryParse(text.Text, out oldf); - b2 = float.TryParse(text.Text + e.KeyChar.ToString(), out f); - if (b2 == false) - { - if (b1 == true) - e.Handled = true; - else - e.Handled = false; - } - } - } - } - private void FrmCreateTunnel_Load(object sender, EventArgs e) { if (comboBoxTunnelType.Items.Count > 0) diff --git a/OracleHelper.cs b/OracleHelper.cs index 11eebe6..79cdf48 100644 --- a/OracleHelper.cs +++ b/OracleHelper.cs @@ -49,7 +49,7 @@ { conn.Close(); } - MessageBox.Show(ex.Message, "提示"); + LogHelper.WriteLog(typeof(OledbHelper), ex.Message); return null; } } @@ -67,7 +67,7 @@ } catch(Exception ex) { - // LogError.PublishError(ex); + LogHelper.WriteLog(typeof(OledbHelper), ex.Message); } finally { @@ -111,6 +111,7 @@ } catch (Exception ex) { + LogHelper.WriteLog(typeof(OledbHelper), ex.Message); return null; } } @@ -131,6 +132,7 @@ } catch(Exception ex) { + LogHelper.WriteLog(typeof(OledbHelper), ex.Message); rowCount = -1; } finally @@ -159,6 +161,7 @@ } catch(Exception ex) { + LogHelper.WriteLog(typeof(OledbHelper), ex.Message); num = -1; } finally @@ -190,6 +193,7 @@ } catch (Exception ex) { + LogHelper.WriteLog(typeof(OledbHelper), ex.Message); return null; } } @@ -210,7 +214,7 @@ oracleCmd.Dispose(); conn.Close(); //调用con_close()方法,关闭与数据库的连接 }catch(Exception ex){ - + LogHelper.WriteLog(typeof(OledbHelper), ex.Message); } finally { @@ -237,6 +241,7 @@ } catch (Exception ex) { + LogHelper.WriteLog(typeof(OledbHelper), ex.Message); rowCount = -1; } finally diff --git a/OracleUtils.cs b/OracleUtils.cs index 29b5374..c1aadda 100644 --- a/OracleUtils.cs +++ b/OracleUtils.cs @@ -741,7 +741,6 @@ } catch { - //if we fail to return the SqlDatReader, we need to close the connection ourselves cn.Close(); throw; } diff --git a/PAS.cs b/PAS.cs index 972de2d..fcda1dd 100644 --- a/PAS.cs +++ b/PAS.cs @@ -93,15 +93,7 @@ } - private void TSM_Pderive_Click(object sender, EventArgs e) - { - PASAClass.Table_name(operation); - if (TV_Files.SelectedNode != null) - { - PASAClass.GuideEdit_form("G", TV_Files, int.Parse(((ToolStripMenuItem)sender).Tag.ToString())); - } - } - + private void TSM_Fenter_Click(object sender, EventArgs e) { if (TV_Files.SelectedNode != null) @@ -110,16 +102,6 @@ } } - private void TSM_Frename_Click(object sender, EventArgs e) - { - TSM_Fenter_Click(sender, e); - } - - private void TSM_Fdelete_Click(object sender, EventArgs e) - { - TSM_Fenter_Click(sender, e); - } - private void TSM_Fderive_Click(object sender, EventArgs e) { if (TV_Files.SelectedNode != null) @@ -128,25 +110,6 @@ } } - private void TSM_Fprint_Click(object sender, EventArgs e) - { - if (TV_Files.SelectedNode != null) - { - PASAClass.Print(int.Parse(TV_Files.SelectedNode.Tag.ToString()), TV_Files.SelectedNode.Text, PD_PASPrtFile, PD_PASPrtDoc); - - } - } - - private void TSM_PASPgSt_Click(object sender, EventArgs e) - { - PSD_PASSetPage.ShowDialog(); - } - - private void TSM_PASPreV_Click(object sender, EventArgs e) - { - PPD_PASPreV.ShowDialog(); - } - private void TV_Files_AfterCollapse(object sender, TreeViewEventArgs e) { e.Node.ImageIndex = 0; @@ -250,14 +213,6 @@ } } - private void 导出ToolStripMenuItem_Click(object sender, EventArgs e) - { - PASAClass.Table_name(operation); - if (TV_Files.SelectedNode != null) - { - PASAClass.GuideEdit_form("G", TV_Files, int.Parse(((ToolStripMenuItem)sender).Tag.ToString())); - } - } private void 导入ToolStripMenuItem_Click(object sender, EventArgs e) { diff --git a/PAS_Forms/F_PASInout.cs b/PAS_Forms/F_PASInout.cs index 373a4e6..974f987 100644 --- a/PAS_Forms/F_PASInout.cs +++ b/PAS_Forms/F_PASInout.cs @@ -71,11 +71,6 @@ } - private void Cancel_Click(object sender, EventArgs e) - { - this.Close(); - } - private void OK_Click(object sender, EventArgs e) { if (textBox1.Text == "") diff --git a/PATM.cs b/PATM.cs index edecd1e..9b6c51d 100644 --- a/PATM.cs +++ b/PATM.cs @@ -26,12 +26,6 @@ public string operation = ""; #endregion - - - - - - private void TSM_Pnew_Click(object sender, EventArgs e) { if (LV_proj.Visible) @@ -94,15 +88,6 @@ } - private void TSM_Pderive_Click(object sender, EventArgs e) - { - PATMAClass.Table_name(operation); - if (TV_files.SelectedNode != null) - { - PATMAClass.GuideEdit_form("G", TV_files, int.Parse(((ToolStripMenuItem)sender).Tag.ToString())); - } - } - private void TSM_Fenter_Click(object sender, EventArgs e) { if (TV_files.SelectedNode != null) @@ -163,35 +148,6 @@ //PATMAClass.Show_AllFile(int.Parse(e.Node.Tag.ToString()), e.Node.Text, LV_PATMallfiles, PB_Display, 2);//此处为显示图片操作 } - private void TSM_Frename_Click(object sender, EventArgs e) - { - TSM_Fenter_Click(sender, e); - } - - private void TSM_Fdelete_Click(object sender, EventArgs e) - { - TSM_Fenter_Click(sender, e); - } - - private void TSM_Fderive_Click(object sender, EventArgs e) - { - if (TV_files.SelectedNode != null) - { - PATMAClass.GuideEdit_form("G", TV_files, int.Parse(((ToolStripMenuItem)sender).Tag.ToString())); - } - } - - private void TSM_Fprint_Click(object sender, EventArgs e) - { - if (TV_files.SelectedNode != null) - { - PATMAClass.Print(int.Parse(TV_files.SelectedNode.Tag.ToString()), TV_files.SelectedNode.Text, PD_PATMPrtFile, PD_PATMPrtDoc); - - } - } - - - private void BT_PATMSch_Click(object sender, EventArgs e) { //LV_PATMallfiles.Dock = DockStyle.Fill;//使ListView控件最大化 @@ -210,32 +166,6 @@ } - private void TSM_PATMPreV_Click(object sender, EventArgs e) - { - PPD_PATMPreV.ShowDialog(); - } - - private void TSM_PATMPgSt_Click(object sender, EventArgs e) - { - PSD_PATMSetPage.ShowDialog(); - } - - private void LV_PATMSrchRslt_MouseClick(object sender, MouseEventArgs e) - { - - if (LV_proj.SelectedItems != null) - { - //int i = 1; - // PATMAClass.Show_AllFile(int.Parse(LV_PATMSrchRslt.FocusedItem.Tag.ToString()), LV_PATMSrchRslt.FocusedItem.Text, LV_PATMallfiles,PB_Display, 0); - - } - } - - private void LV_PATMSrchRslt_MouseDoubleClick(object sender, MouseEventArgs e) - { - //PATMAClass.Show_AllFile(int.Parse(LV_PATMSrchRslt.FocusedItem.Tag.ToString()), LV_PATMSrchRslt.FocusedItem.Text, LV_PATMallfiles, PB_Display, 2); - } - private void 新建ToolStripMenuItem_Click(object sender, EventArgs e) { if ((TV_files.SelectedNode != null)&&(TV_files.SelectedNode.Parent==null)) @@ -288,17 +218,6 @@ } } - private void 打印预览toolStripMenuItem_Click(object sender, EventArgs e) - { - - PPD_PATMPreV.ShowDialog(); - } - - private void 打印设置toolStripMenuItem_Click(object sender, EventArgs e) - { - PSD_PATMSetPage.ShowDialog(); - } - private void TV_PATMSrchRslt_NodeMouseClick(object sender, TreeNodeMouseClickEventArgs e) { if (e.Button == MouseButtons.Right) diff --git a/PATM_Forms/F_PATMTitle.cs b/PATM_Forms/F_PATMTitle.cs index 7380dd8..5d1fe8c 100644 --- a/PATM_Forms/F_PATMTitle.cs +++ b/PATM_Forms/F_PATMTitle.cs @@ -148,19 +148,6 @@ return 0; } - //判断是否为已有工程 - private bool checkProject(string projectname) { - string sql = "select * from "+this.tablename+" where "+tablename+".NODENAME = '"+projectname - +"'"; - DataTable table = OledbHelper.QueryTable(sql); - if (table.Rows.Count > 0) - { - return true; - } - else { - return false; - } - } private void buttonX2_Click(object sender, EventArgs e) { diff --git a/Cyberpipe.csproj b/Cyberpipe.csproj index 07a8c1a..e3cd12c 100644 --- a/Cyberpipe.csproj +++ b/Cyberpipe.csproj @@ -204,25 +204,6 @@ - - Form - - - F_GKT1数据输入输出.cs - - - Form - - - F_GKT1添加文件.cs - - - Form - - - F_GKT1添加项目.cs - - Form @@ -1068,18 +1049,6 @@ Frm_password_reset.cs - - Form - - - GKT.cs - - - Form - - - GKT1.cs - Form @@ -1258,12 +1227,6 @@ F_Projedit.cs - - Form - - - PED.cs - Form @@ -1331,16 +1294,6 @@ True Reference.map - - F_GKT1数据输入输出.cs - Designer - - - F_GKT1添加文件.cs - - - F_GKT1添加项目.cs - Form_EditTask.cs @@ -1836,12 +1789,6 @@ Frm_password_reset.cs - - GKT.cs - - - GKT1.cs - F_GKT数据输入输出.cs @@ -1934,9 +1881,6 @@ F_Projedit.cs - - PED.cs - F_数据输入输出.cs diff --git a/Cyberpipe.suo b/Cyberpipe.suo index 68ced4f..a1aecf8 100644 --- a/Cyberpipe.suo +++ b/Cyberpipe.suo Binary files differ diff --git a/EMS_Forms/Form_EditTask.cs b/EMS_Forms/Form_EditTask.cs index 718992f..f1d791f 100644 --- a/EMS_Forms/Form_EditTask.cs +++ b/EMS_Forms/Form_EditTask.cs @@ -119,7 +119,8 @@ String name = Convert.ToString(dr["USERNAME"]); comboBox_userName.Items.Add(name); - } + } + dr.Close(); comboBox_road.Items.Clear(); roadList = new List(); @@ -135,7 +136,7 @@ comboBox_road.Items.Add(name); } } - + dr1.Close(); conn.Close(); bool flag2 = false; @@ -185,7 +186,7 @@ catch (Exception ex) { - MessageBox.Show(ex.ToString()); + LogHelper.WriteLog(typeof(Form_EditTask), ex.Message); } } @@ -288,7 +289,7 @@ } catch (Exception ex) { - MessageBox.Show(ex.ToString()); + LogHelper.WriteLog(typeof(Form_EditTask), ex.Message); } } @@ -474,7 +475,7 @@ } catch (Exception ex) { - MessageBox.Show(ex.ToString()); + LogHelper.WriteLog(typeof(Form_EditTask), ex.Message); } this.Close(); @@ -495,6 +496,7 @@ { numList.Add(Convert.ToInt32(dr["DBID"])); } + dr.Close(); if (numList.Count == 0) { taskNumber = Convert.ToInt32(number) * 100; @@ -674,6 +676,7 @@ } } } + dr.Close(); conn.Close(); } diff --git a/EMS_Forms/Form_EventManager.cs b/EMS_Forms/Form_EventManager.cs index b18c45b..84807b2 100644 --- a/EMS_Forms/Form_EventManager.cs +++ b/EMS_Forms/Form_EventManager.cs @@ -64,6 +64,7 @@ comboBox_name.Items.Add(name); } + dr.Close(); conn.Close(); diff --git a/Forms/FrmMnModify.cs b/Forms/FrmMnModify.cs index 31cfc5f..d036360 100644 --- a/Forms/FrmMnModify.cs +++ b/Forms/FrmMnModify.cs @@ -68,15 +68,7 @@ questionGrid.Rows[idx].Cells[1].Value = sr.question; } } - /// 选中对象 - /// - /// - /// - /// - private void buttonX1_Click(object sender, EventArgs e) - { - globecontrol.Globe.Action = EnumAction3D.SelectObject; - } + /// /// 选中某一行 /// diff --git a/Forms/FrmPipelineModelDataBase.cs b/Forms/FrmPipelineModelDataBase.cs index 2acf0ca..7ce573f 100644 --- a/Forms/FrmPipelineModelDataBase.cs +++ b/Forms/FrmPipelineModelDataBase.cs @@ -35,19 +35,7 @@ ds = _ds; InitializeComponent(); } - /// - /// 单击选择shp格式文件 - /// - /// - /// - private void btnBrowseModel_Click(object sender, EventArgs e) - { - saveFileDialog1.Filter = "*.lgd|*.lgd"; - if (saveFileDialog1.ShowDialog() == DialogResult.OK) - { - txtModelLayer.Text = saveFileDialog1.FileName; - } - } + /// /// 窗体初始化事件处理 /// @@ -100,49 +88,6 @@ } } } - - private object convertFieldValue(string fieldname, object obj) - { - if (obj == null) - return null; - - try - { - string type = fields_types[fieldname].ToString(); - switch (type) - { - case "string": - return obj.ToString(); - case "int": - //return 101; - int intResult; - if (int.TryParse(obj.ToString(), out intResult)) - return intResult; - else - return null; - case "double": - //return 202.5; - double doubleResult; - if (double.TryParse(obj.ToString(), out doubleResult)) - return doubleResult; - else - return null; - case "date": - DateTime dtResult; - if (DateTime.TryParse(obj.ToString(), out dtResult)) - return dtResult; - else - return null; - } - return null; - } - catch (Exception ex) - { - MessageBox.Show(ex.ToString()); - return null; - } - } - public string lgdFilePath = ""; /// /// 选择管线颜色 @@ -610,33 +555,6 @@ { this.Close(); } - - private void cmbLayer_SelectedIndexChanged(object sender, EventArgs e) //选择图层 - { - GSOLayer layer = ctl.Globe.Layers.GetLayerByCaption(selectLayerName); - GSOFeatures features = layer.GetAllFeatures(); - if (features.Length == 0) - return; - - cmbFrom.Items.Clear(); - cmbTo.Items.Clear(); - cmbRadius.Items.Clear(); - cmbID.Items.Clear(); - for (int i = 0; i < features[0].GetFieldCount(); i++) - { - GeoScene.Data.GSOFieldDefn fielddef = (GeoScene.Data.GSOFieldDefn)(features[0].GetFieldDefn(i)); - - cmbFrom.Items.Add(fielddef.Name); - cmbTo.Items.Add(fielddef.Name); - cmbRadius.Items.Add(fielddef.Name); - cmbID.Items.Add(fielddef.Name); - } - cmbFrom.SelectedItem = "Deep1"; - cmbTo.SelectedItem = "Deep2"; - cmbRadius.SelectedItem = "Diameter"; - cmbID.SelectedItem = "Handle"; - } - private void buttonXLayerPath_Click(object sender, EventArgs e)//单击 选择shp格式的文件 { OpenFileDialog dlg = new OpenFileDialog(); diff --git a/Forms/FrmPipelineModelDataOneStep.cs b/Forms/FrmPipelineModelDataOneStep.cs index 18afda7..ec93b8a 100644 --- a/Forms/FrmPipelineModelDataOneStep.cs +++ b/Forms/FrmPipelineModelDataOneStep.cs @@ -38,19 +38,7 @@ layerTree = _layerTree; InitializeComponent(); } - /// - /// 单击选择shp格式文件 - /// - /// - /// - private void btnBrowseModel_Click(object sender, EventArgs e) - { - saveFileDialog1.Filter = "*.lgd|*.lgd"; - if (saveFileDialog1.ShowDialog() == DialogResult.OK) - { - txtModelLayer.Text = saveFileDialog1.FileName; - } - } + /// /// 窗体初始化事件处理 /// @@ -107,48 +95,7 @@ } } - private object convertFieldValue(string fieldname, object obj) - { - if (obj == null) - return null; - - try - { - string type = fields_types[fieldname].ToString(); - switch (type) - { - case "string": - return obj.ToString(); - case "int": - //return 101; - int intResult; - if (int.TryParse(obj.ToString(), out intResult)) - return intResult; - else - return null; - case "double": - //return 202.5; - double doubleResult; - if (double.TryParse(obj.ToString(), out doubleResult)) - return doubleResult; - else - return null; - case "date": - DateTime dtResult; - if (DateTime.TryParse(obj.ToString(), out dtResult)) - return dtResult; - else - return null; - } - return null; - } - catch (Exception ex) - { - MessageBox.Show(ex.ToString()); - return null; - } - } - + public string lgdFilePath = ""; /// /// 选择管线颜色 @@ -673,32 +620,6 @@ return featDs; } - private void cmbLayer_SelectedIndexChanged(object sender, EventArgs e) //选择图层 - { - GSOLayer layer = ctl.Globe.Layers.GetLayerByCaption(selectLayerName); - GSOFeatures features = layer.GetAllFeatures(); - if (features.Length == 0) - return; - - cmbFrom.Items.Clear(); - cmbTo.Items.Clear(); - cmbRadius.Items.Clear(); - cmbID.Items.Clear(); - for (int i = 0; i < features[0].GetFieldCount(); i++) - { - GeoScene.Data.GSOFieldDefn fielddef = (GeoScene.Data.GSOFieldDefn)(features[0].GetFieldDefn(i)); - - cmbFrom.Items.Add(fielddef.Name); - cmbTo.Items.Add(fielddef.Name); - cmbRadius.Items.Add(fielddef.Name); - cmbID.Items.Add(fielddef.Name); - } - cmbFrom.SelectedItem = "Deep1"; - cmbTo.SelectedItem = "Deep2"; - cmbRadius.SelectedItem = "Diameter"; - cmbID.SelectedItem = "Handle"; - } - private void buttonXLayerPath_Click(object sender, EventArgs e)//单击 选择shp格式的文件 { OpenFileDialog dlg = new OpenFileDialog(); @@ -949,38 +870,6 @@ } //txtLayername.Text = type + layername; } - /// - /// 连接数据库 - /// - /// - /// - private void buttonX1_Click(object sender, EventArgs e) - { - if (ds == null) - { - //没连的话,直接连接审核库; //审核库配置读配置文件 - string dbIp = Utility.sgdbip; - string database = Utility.sgdbname; - string user = Utility.sgdbuser; - string pass = Utility.sgdbpwd; - - if (!Utility.isNetworkConnectionSuccess(dbIp.Trim())) - { - MessageBox.Show("网络连接失败!", "提示"); - return; - } - - ds = ctl.Globe.DataManager.OpenOracleDataSource(dbIp + "/" + database, "", "", user, pass); - if (ds == null) - { - MessageBox.Show("数据库连接失败!", "提示", MessageBoxButtons.OK, MessageBoxIcon.Warning); - } - else - { - btnCreateModel.Enabled = true; - } - } - } private void btnClose_Click(object sender, EventArgs e) { diff --git a/Forms/FrmShRK.cs b/Forms/FrmShRK.cs index 0e2e722..f1d83cb 100644 --- a/Forms/FrmShRK.cs +++ b/Forms/FrmShRK.cs @@ -215,6 +215,7 @@ { sourcefeatds = sourcefeat as GSOFeatureDataset; } + if (sourcefeatds == null) return; sourcefeatds.Open(); GSOFeatures sourcefeatures = sourcefeatds.GetAllFeatures(); @@ -251,6 +252,7 @@ { desfeatds = desfeat as GSOFeatureDataset; } + if (desfeatds == null) return; desfeatds.Open(); //向新数据集写入字段 diff --git a/FrmAccessoriesSensor.cs b/FrmAccessoriesSensor.cs index 09fcdf1..2a7a80e 100644 --- a/FrmAccessoriesSensor.cs +++ b/FrmAccessoriesSensor.cs @@ -209,7 +209,7 @@ chart1.Series[0].Points.DataBindXY(dic.Keys, dic.Values); for (int m = 0; m < dic.Values.Count; m++) { - if (chart1.Series[0].Points[m].YValues[0].ToString() != "0") + if (chart1.Series[0].Points[m]!=null&&chart1.Series[0].Points[m].YValues[0].ToString() != "0") { chart1.Series[0].Points[m].Label = chart1.Series[0].Points[m].YValues[0].ToString(); } diff --git a/FrmAccessoriesgather.cs b/FrmAccessoriesgather.cs index 9e331e1..a475d9e 100644 --- a/FrmAccessoriesgather.cs +++ b/FrmAccessoriesgather.cs @@ -338,7 +338,7 @@ chart1.Series[0].Points.DataBindXY(dic.Keys, dic.Values); for (int m = 0; m < dic.Values.Count; m++) { - if (chart1.Series[0].Points[m].YValues[0].ToString() != "0") + if (chart1.Series[0].Points[m]!=null&&chart1.Series[0].Points[m].YValues[0].ToString() != "0") { chart1.Series[0].Points[m].Label = chart1.Series[0].Points[m].YValues[0].ToString(); } diff --git a/FrmAccessoryAnalysis.cs b/FrmAccessoryAnalysis.cs index 71d4579..44d4065 100644 --- a/FrmAccessoryAnalysis.cs +++ b/FrmAccessoryAnalysis.cs @@ -66,39 +66,6 @@ globeControl1.Refresh(); } /// - /// 键盘按键按下事件处理 - /// - /// - /// - private void txtRadius_KeyPress(object sender, KeyPressEventArgs e) - { - TextBox text = sender as TextBox; - if ((e.KeyChar < 48 || e.KeyChar > 57) && (e.KeyChar != 8) && (int)e.KeyChar != 46) - { - e.Handled = true; - } - if ((int)e.KeyChar == 46) //小数点 - { - if (text.Text.Length <= 0) - e.Handled = true; //小数点不能在第一位 - else //处理不规则的小数点 - { - float f; - float oldf; - bool b1 = false, b2 = false; - b1 = float.TryParse(text.Text, out oldf); - b2 = float.TryParse(text.Text + e.KeyChar.ToString(), out f); - if (b2 == false) - { - if (b1 == true) - e.Handled = true; - else - e.Handled = false; - } - } - } - } - /// /// 确定按钮事件处理 /// /// diff --git a/FrmAddValve.cs b/FrmAddValve.cs index 34d2fec..5f405b9 100644 --- a/FrmAddValve.cs +++ b/FrmAddValve.cs @@ -486,56 +486,6 @@ } } - - - - - - - - private void cmbLayer_SelectedIndexChanged(object sender, EventArgs e) - { - GSOLayer layer = globeControl1.Globe.Layers.GetLayerByCaption(selectLayerName); - GSOFeatures features = layer.GetAllFeatures(); - if (features.Length == 0) - return; - - combPath.Items.Clear(); - combZ.Items.Clear(); - combModelName.Items.Clear(); - - for (int i = 0; i < features[0].GetFieldCount(); i++) - { - GeoScene.Data.GSOFieldDefn fielddef = (GeoScene.Data.GSOFieldDefn)(features[0].GetFieldDefn(i)); - combPath.Items.Add(fielddef.Name); - combZ.Items.Add(fielddef.Name); - combModelName.Items.Add(fielddef.Name); - } - combModelName.SelectedItem = "编号"; - combPath.SelectedItem = "模型路径"; - if (combfile.SelectedIndex != -1) - { - - string layerCaption = combfile.SelectedItem.ToString().Trim(); - rukuLayer = globeControl1.Globe.Layers.GetLayerByCaption(layerCaption); - if (rukuLayer != null) - { - combPath.Items.Clear(); - combZ.Items.Clear(); - combModelName.Items.Clear(); - - } - for (int i = 0; i < features[0].GetFieldCount(); i++) - { - GeoScene.Data.GSOFieldDefn fielddef = (GeoScene.Data.GSOFieldDefn)(features[0].GetFieldDefn(i)); - combPath.Items.Add(fielddef.Name); - combZ.Items.Add(fielddef.Name); - combModelName.Items.Add(fielddef.Name); - } - combModelName.SelectedItem = "编号"; - combPath.SelectedItem = "模型路径"; - } - } /// /// 单击选择shp格式文件 /// diff --git a/FrmAddWellShp.cs b/FrmAddWellShp.cs index bb79ec0..a249725 100644 --- a/FrmAddWellShp.cs +++ b/FrmAddWellShp.cs @@ -478,32 +478,6 @@ } } } - - private void cmbLayer_SelectedIndexChanged(object sender, EventArgs e) - { - GSOLayer layer = globeControl1.Globe.Layers.GetLayerByCaption(selectLayerName); - GSOFeatures features = layer.GetAllFeatures(); - if (features.Length == 0) - return; - - combCode.Items.Clear(); - combDeep.Items.Clear(); - combModelName.Items.Clear(); - combAngle.Items.Clear(); - - for (int i = 0; i < features[0].GetFieldCount(); i++) - { - GeoScene.Data.GSOFieldDefn fielddef = (GeoScene.Data.GSOFieldDefn)(features[0].GetFieldDefn(i)); - combCode.Items.Add(fielddef.Name); - combDeep.Items.Add(fielddef.Name); - combModelName.Items.Add(fielddef.Name); - combAngle.Items.Add(fielddef.Name); - } - combCode.SelectedItem = "附属物编码"; - combDeep.SelectedItem = "井深"; - combModelName.SelectedItem = "编号"; - combAngle.SelectedItem = "符号角度"; - } /// /// 单击选择shp格式文件 /// diff --git a/FrmAddYuBiZiShp.cs b/FrmAddYuBiZiShp.cs index b312d51..332f037 100644 --- a/FrmAddYuBiZiShp.cs +++ b/FrmAddYuBiZiShp.cs @@ -383,80 +383,7 @@ } } - private void cmbLayer_SelectedIndexChanged(object sender, EventArgs e) - { - GSOLayer layer = globeControl1.Globe.Layers.GetLayerByCaption(selectLayerName); - GSOFeatures features = layer.GetAllFeatures(); - if (features.Length == 0) - return; - - combCode.Items.Clear(); - combDeep.Items.Clear(); - combModelName.Items.Clear(); - //comboLoad.Items.Clear(); - for (int i = 0; i < features[0].GetFieldCount(); i++) - { - GeoScene.Data.GSOFieldDefn fielddef = (GeoScene.Data.GSOFieldDefn)(features[0].GetFieldDefn(i)); - combCode.Items.Add(fielddef.Name); - combDeep.Items.Add(fielddef.Name); - combModelName.Items.Add(fielddef.Name); - //comboLoad.Items.Add(fielddef.Name); - } - combCode.SelectedItem = "附属物编码"; - combDeep.SelectedItem = "Z坐标"; - combModelName.SelectedItem = "编号"; - //comboLoad.SelectedItem = "模型路径"; - } - - private void buttonXLayerPath_Click(object sender, EventArgs e) - { - OpenFileDialog dlg = new OpenFileDialog(); - dlg.Filter = "*.shp|*.shp"; - dlg.Multiselect = false; - if (dlg.ShowDialog() == DialogResult.OK) - { - GSOLayer layer = globeControl1.Globe.Layers.Add(dlg.FileName); - string txtMessage = valiYBdata(layer); - if (txtMessage != "") - { - button3.Enabled = false; - //textBoxLayer.Text = ""; - combCode.Items.Clear(); - combDeep.Items.Clear(); - combModelName.Items.Clear(); - globeControl1.Globe.Layers.Remove(layer); - FrmValiDataShowErrorMessage showErrorMessage = new FrmValiDataShowErrorMessage(dlg.FileName, txtMessage); - showErrorMessage.ShowDialog(); - return; - } - else - { - button3.Enabled = true; - //textBoxLayer.Text = dlg.FileName; - selectLayerName = layer.Caption; - txtLayerName.Text = layer.Caption; - GSOFeatures features = layer.GetAllFeatures(); - if (features.Length == 0) - return; - - combCode.Items.Clear(); - combDeep.Items.Clear(); - combModelName.Items.Clear(); - for (int i = 0; i < features[0].GetFieldCount(); i++) - { - GeoScene.Data.GSOFieldDefn fielddef = (GeoScene.Data.GSOFieldDefn)(features[0].GetFieldDefn(i)); - combCode.Items.Add(fielddef.Name); - combDeep.Items.Add(fielddef.Name); - combModelName.Items.Add(fielddef.Name); - //comboLoad.Items.Add(fielddef.Name); - } - combCode.SelectedItem = "管点编码"; - combDeep.SelectedItem = "Z坐标"; - combModelName.SelectedItem = "编号"; - } - } - } - + private void FrmAddYuBiZiShp_FormClosing(object sender, FormClosingEventArgs e) { globeControl1.Globe.Refresh(); diff --git a/FrmAllPipelineStatis.cs b/FrmAllPipelineStatis.cs index 6421a26..a6eea29 100644 --- a/FrmAllPipelineStatis.cs +++ b/FrmAllPipelineStatis.cs @@ -84,7 +84,7 @@ chartAllAreaPipeline.Series["管线"].Points.DataBindXY(pipelineLengthAndType.Keys, pipelineLengthAndType.Values); for (int m = 0; m < pipelineLengthAndType.Values.Count; m++) { - if (chartAllAreaPipeline.Series["管线"].Points[m].YValues[0].ToString() != "0") + if (chartAllAreaPipeline.Series["管线"].Points[m]!=null&&chartAllAreaPipeline.Series["管线"].Points[m].YValues[0].ToString() != "0") { chartAllAreaPipeline.Series["管线"].Points[m].Label = chartAllAreaPipeline.Series[0].Points[m].YValues[0].ToString(); } @@ -94,7 +94,7 @@ } catch (Exception ex) { - //LogError.PublishError(ex); + LogHelper.WriteLog(typeof(FrmAllPipelineStatis), ex.Message); } } @@ -147,7 +147,7 @@ } DataTable dt = OledbHelper.QueryTable(sql); - if (dt != null && dt.Rows.Count > 0) + if (dt != null && dt.Rows.Count > 0 && chartAllAreaPipeline.Series["管线"].Points[indexHit]!=null) { dataGridViewX1.DataSource = dt; panel.Visible = true; diff --git a/FrmAllWorkWellStatis.cs b/FrmAllWorkWellStatis.cs index 6fec7af..6af8e4c 100644 --- a/FrmAllWorkWellStatis.cs +++ b/FrmAllWorkWellStatis.cs @@ -52,7 +52,7 @@ chartAllAreaPipeline.Series["井盖"].Points.DataBindXY(workWellLengthAndType.Keys, workWellLengthAndType.Values); for (int m = 0; m < workWellLengthAndType.Values.Count; m++) { - if (chartAllAreaPipeline.Series["井盖"].Points[m].YValues[0].ToString().Trim() != "0") + if (chartAllAreaPipeline.Series["井盖"].Points[m]!=null&&chartAllAreaPipeline.Series["井盖"].Points[m].YValues[0].ToString().Trim() != "0") { chartAllAreaPipeline.Series["井盖"].Points[m].Label = chartAllAreaPipeline.Series[0].Points[m].YValues[0].ToString(); } @@ -60,7 +60,7 @@ } catch (Exception ex) { - //LogError.PublishError(ex); + LogHelper.WriteLog(typeof(FrmAllWorkWellStatis), ex.Message); } } diff --git a/FrmBSQDuoBianXingStatis.cs b/FrmBSQDuoBianXingStatis.cs index e8b7d52..3e889b6 100644 --- a/FrmBSQDuoBianXingStatis.cs +++ b/FrmBSQDuoBianXingStatis.cs @@ -60,7 +60,7 @@ { for (int m = 0; m < bsq1.Values.Count; m++) { - if (chart1.Series["标识器"].Points[m].YValues[0].ToString() != "0") + if (chart1.Series["标识器"].Points[m]!=null&&chart1.Series["标识器"].Points[m].YValues[0].ToString() != "0") { count += Convert.ToInt16(chart1.Series[0].Points[m].YValues[0].ToString()); chart1.Series["标识器"].Points[m].Label = chart1.Series[0].Points[m].YValues[0].ToString(); diff --git a/FrmBSQDuoBianXingStreet.cs b/FrmBSQDuoBianXingStreet.cs index 2005ebb..1db5777 100644 --- a/FrmBSQDuoBianXingStreet.cs +++ b/FrmBSQDuoBianXingStreet.cs @@ -63,7 +63,7 @@ chartStatis.Series[0].Points.DataBindXY(bsq.Keys, bsq.Values); for (int m = 0; m < bsq.Values.Count; m++) { - if (chartStatis.Series[0].Points[m].YValues[0].ToString().Trim() != "0") + if (chartStatis.Series[0].Points[m]!=null&&chartStatis.Series[0].Points[m].YValues[0].ToString().Trim() != "0") { count += Convert.ToInt16(chartStatis.Series[0].Points[m].YValues[0].ToString()); chartStatis.Series[0].Points[m].Label = chartStatis.Series[0].Points[m].YValues[0].ToString(); diff --git a/FrmBSQStatis.cs b/FrmBSQStatis.cs index 390a55c..4aa0ee6 100644 --- a/FrmBSQStatis.cs +++ b/FrmBSQStatis.cs @@ -95,6 +95,8 @@ } } } + + dr.Close(); conn.Close(); for (int i = 0; i < typeLists.Count; i++) { @@ -123,7 +125,7 @@ chartStatis.Series[0].Points.DataBindXY(bsq.Keys, bsq.Values); for (int m = 0; m < bsq.Values.Count; m++) { - if (chartStatis.Series[0].Points[m].YValues[0].ToString().Trim() != "0") + if (chartStatis.Series[0].Points[m]!=null&&chartStatis.Series[0].Points[m].YValues[0].ToString().Trim() != "0") { //count += Convert.ToInt16(chartStatis.Series[0].Points[m].YValues[0].ToString()); chartStatis.Series[0].Points[m].Label = chartStatis.Series[0].Points[m].YValues[0].ToString(); diff --git a/FrmBSQStreet.cs b/FrmBSQStreet.cs index 9d88adb..7fbacad 100644 --- a/FrmBSQStreet.cs +++ b/FrmBSQStreet.cs @@ -44,7 +44,7 @@ chartStatis.Series[0].Points.DataBindXY(bsq.Keys, bsq.Values); for (int m = 0; m < bsq.Values.Count; m++) { - if (chartStatis.Series[0].Points[m].YValues[0].ToString().Trim() != "0") + if (chartStatis.Series[0].Points[m]!=null&&chartStatis.Series[0].Points[m].YValues[0].ToString().Trim() != "0") { count += Convert.ToInt16(chartStatis.Series[0].Points[m].YValues[0].ToString()); chartStatis.Series[0].Points[m].Label = chartStatis.Series[0].Points[m].YValues[0].ToString(); diff --git a/FrmBoosterValvers.cs b/FrmBoosterValvers.cs index 5061efc..df9b62b 100644 --- a/FrmBoosterValvers.cs +++ b/FrmBoosterValvers.cs @@ -236,199 +236,6 @@ count = 0; } } - /// - /// 添加火苗 - /// - /// - /// - /// - /// - private GSOFeature AddFire(double x,double y,double z) - { - // 烟火示例 - - string strResPath = Application.StartupPath + "/Resource"; - - // 烟火粒子示例,由三个发射器构成 - GSOGeoParticle geoParticle = new GSOGeoParticle(); - geoParticle.SetPosition(x, y, z); // 添加到这个经纬度位置 - geoParticle.AltitudeMode = EnumAltitudeMode.RelativeToGround; - - GSORingParticleEmitter emitter = new GSORingParticleEmitter(); - emitter.TexturePath = strResPath + "/ParticleImage/flare.png"; - - emitter.SetSizeFix(1, 1); - emitter.VelFix = 1; - emitter.VelRnd = 5; - - emitter.AngleXYFix = 0; - emitter.AngleXYRnd = 180; - - emitter.AngleXZFix = 90; - emitter.AngleXZRnd = 0; - - emitter.LifeFix = 0.5f; - emitter.LifeRnd = 0.0f; - - emitter.RotFix = 0; - emitter.RotRnd = 0; - - emitter.RotVelFix = 0; - emitter.RotVelRnd = 0; - - emitter.EmitPerSec = 100; - - // 采用线性插值生成粒子的初始颜色 - emitter.ColorRndStart = Color.White; - emitter.ColorRndEnd = Color.Red; - - - GSOColorParticleEffector effector2 = new GSOColorParticleEffector(); - effector2.SetColorChanged(0, -1, -1, 0); - effector2.StartTime = 0.0f; - effector2.EndTime = -1.0f; - emitter.AddEffector(effector2); - - // 将三个发射器添加到粒子对象中 - geoParticle.AddEmitter(emitter); - - geoParticle.Play(); - - GSOFeature feature = new GSOFeature(); - - feature.Geometry = geoParticle; - - globeControl1.Globe.MemoryLayer.AddFeature(feature); - - - return feature; - } - - /// - /// 添加喷泉 - /// - /// - private GSOFeature AddFountain() - { - string strResPath = Application.StartupPath + "/Resource"; - - GSOGeoParticle geoParticle = new GSOGeoParticle(); - geoParticle.SetPosition(116.314, 39.84, 0); // 添加到这个经纬度位置 - - GSOPointParticleEmitter emitter = new GSOPointParticleEmitter(); - emitter.TexturePath = strResPath + "/ParticleImage/test.png"; - - emitter.SetSizeFix(0.5f, 2); - emitter.VelFix = 10; - emitter.VelRnd = 2; - - emitter.GravityAcc = 9.8f; - emitter.AngleXYFix = 0; - emitter.AngleXYRnd = 180; - - emitter.AngleXZFix = 88; - emitter.AngleXZRnd = 2; - - //emitter.InnerRadius = 0; - // emitter.OuterRadius = 0.03f; - - emitter.LifeFix = 5.0f; - emitter.LifeRnd = 1.0f; - - emitter.RotFix = 0; - emitter.RotRnd = 0; - - emitter.RotVelFix = 0; - emitter.RotVelRnd = 0; - - emitter.EmitPerSec = 1000; - emitter.ColorRndStart = Color.FromArgb(33, 255, 255, 255); - emitter.ColorRndEnd = Color.FromArgb(11, 255, 255, 255); - emitter.IsLumAdded = false; - - // 将三个发射器添加到粒子对象中 - geoParticle.AddEmitter(emitter); - - geoParticle.Play(); - GSOFeature feature = new GSOFeature(); - - feature.Geometry = geoParticle; - - //globeControl1.Globe.MemoryLayer.AddFeature(feature); - globeControl1.Globe.FlyToFeature(feature); - - return feature; - } - - /// - /// 添加水柱 - /// - /// - private GSOFeature AddWaterLine() - { - string strResPath = Application.StartupPath + "/Resource"; - - GSOGeoParticle geoParticle = new GSOGeoParticle(); - geoParticle.SetPosition(116.308, 39.84, 0); // 添加到这个经纬度位置 - - GSOPointParticleEmitter emitter = new GSOPointParticleEmitter(); - - emitter.TexturePath = strResPath + "/ParticleImage/drop3.png"; - - geoParticle.TimerInterval = 1; - - emitter.SetSizeFix(2.0f, 2.0f); - - emitter.VelFix = 50; - emitter.VelRnd = 2; - - // emitter.IsLumAdded = false; - - emitter.GravityAcc = 9.8f; - emitter.AngleXYFix = 0; - emitter.AngleXYRnd = 2; - - emitter.AngleXZFix = 60; - emitter.AngleXZRnd = 2; - - //emitter.InnerRadius = 0; - // emitter.OuterRadius = 0.1f; - - emitter.LifeFix = 5.0f; - emitter.LifeRnd = 1.0f; - - emitter.RotFix = 0; - emitter.RotRnd = 0; - - emitter.RotVelFix = 0; - emitter.RotVelRnd = 0; - - emitter.EmitPerSec = 1500; - - emitter.ColorRndStart = Color.FromArgb(100, 222, 222, 222); - emitter.ColorRndEnd = Color.FromArgb(50, 222, 222, 222); - - /* - - GSOScaleParticleEffector effector1 = new GSOScaleParticleEffector(); - effector1.SetScale(0.2f, 0.2f); - effector1.StartTime = 0; - effector1.EndTime = -1; // 负数表示整个粒子生命结束 - emitter.AddEffector(effector1); - */ - - // 将三个发射器添加到粒子对象中 - geoParticle.AddEmitter(emitter); - - geoParticle.Play(); - GSOFeature feature = new GSOFeature(); - - feature.Geometry = geoParticle; - - //globeControl1.Globe.MemoryLayer.AddFeature(feature); - globeControl1.Globe.FlyToFeature(feature); - - return feature; - } + } } diff --git a/FrmBufferAnalysis.cs b/FrmBufferAnalysis.cs index f711133..db8ca59 100644 --- a/FrmBufferAnalysis.cs +++ b/FrmBufferAnalysis.cs @@ -123,39 +123,6 @@ } } /// - /// 半径文本框的键盘按键按下事件处理 - /// - /// - /// - private void txtRadius_KeyPress(object sender, KeyPressEventArgs e) - { - TextBox text = sender as TextBox; - if ((e.KeyChar < 48 || e.KeyChar > 57) && (e.KeyChar != 8) && (int)e.KeyChar != 46) - { - e.Handled = true; - } - if ((int)e.KeyChar == 46) //小数点 - { - if (text.Text.Length <= 0) - e.Handled = true; //小数点不能在第一位 - else //处理不规则的小数点 - { - float f; - float oldf; - bool b1 = false, b2 = false; - b1 = float.TryParse(text.Text, out oldf); - b2 = float.TryParse(text.Text + e.KeyChar.ToString(), out f); - if (b2 == false) - { - if (b1 == true) - e.Handled = true; - else - e.Handled = false; - } - } - } - } - /// /// 窗体关闭事件处理 /// /// diff --git a/FrmBufferAnalysisBSQ.cs b/FrmBufferAnalysisBSQ.cs index 24a96ca..f54208f 100644 --- a/FrmBufferAnalysisBSQ.cs +++ b/FrmBufferAnalysisBSQ.cs @@ -137,35 +137,7 @@ } } - private void txtRadius_KeyPress(object sender, KeyPressEventArgs e) - { - TextBox text = sender as TextBox; - if ((e.KeyChar < 48 || e.KeyChar > 57) && (e.KeyChar != 8) && (int)e.KeyChar != 46) - { - e.Handled = true; - } - if ((int)e.KeyChar == 46) //小数点 - { - if (text.Text.Length <= 0) - e.Handled = true; //小数点不能在第一位 - else //处理不规则的小数点 - { - float f; - float oldf; - bool b1 = false, b2 = false; - b1 = float.TryParse(text.Text, out oldf); - b2 = float.TryParse(text.Text + e.KeyChar.ToString(), out f); - if (b2 == false) - { - if (b1 == true) - e.Handled = true; - else - e.Handled = false; - } - } - } - } - + private void FrmBufferAnalysis_FormClosing(object sender, FormClosingEventArgs e) { //Form1.y = 0; @@ -316,27 +288,6 @@ } } - private void FlyToMenu_Click(object sender, EventArgs e) - { - if (m_feature != null) - { - if (m_feature.Geometry != null && m_feature.Geometry.Type == EnumGeometryType.GeoPolyline3D) - { - GSOGeoPolyline3D line = m_feature.Geometry as GSOGeoPolyline3D; - double length = line.GetSpaceLength(true, 6378137); - GSOGeoPolyline3D lineLine = line.GetSegment(0, length / 2); - GSOPoint3d point3d = lineLine[lineLine.PartCount - 1][lineLine[lineLine.PartCount - 1].Count - 1]; - - globeControl1.Globe.FlyToPosition(point3d, EnumAltitudeMode.Absolute, 0, 45, 5); - } - else - { - globeControl1.Globe.FlyToFeature(m_feature, 0, 45, 3); - } - LightMenu_Click(sender, e); - } - } - private void LightMenu_Click(object sender, EventArgs e) { flashflag = "single"; diff --git a/FrmDataBaseOpt.cs b/FrmDataBaseOpt.cs index b0c4b5d..8d7b69d 100644 --- a/FrmDataBaseOpt.cs +++ b/FrmDataBaseOpt.cs @@ -362,6 +362,7 @@ dbCombor.Items.Add(dblist[i].title); } } + /* /// /// 从配置文件读取数据库参数配置 /// @@ -428,6 +429,8 @@ } } + * */ + /* /// /// 向配置文件写入连接数据库的参数配置 /// @@ -485,6 +488,7 @@ MessageBox.Show(exp.ToString()); } } + * */ /// /// /// diff --git a/FrmDatabaseParaSetting.cs b/FrmDatabaseParaSetting.cs index a6fea46..63b596b 100644 --- a/FrmDatabaseParaSetting.cs +++ b/FrmDatabaseParaSetting.cs @@ -152,6 +152,7 @@ this.DialogResult = DialogResult.OK; this.Close(); } + /* /// /// 从配置文件读取数据库连接参数配置 /// @@ -218,6 +219,8 @@ } } + * */ + /* /// /// 向配置文件写入数据库参数配置 /// @@ -276,7 +279,7 @@ MessageBox.Show(ex.ToString()); } } - + */ /// /// 取消按钮事件处理 /// diff --git a/FrmDatabaseParaSetting2.cs b/FrmDatabaseParaSetting2.cs index 932d05e..96a87d5 100644 --- a/FrmDatabaseParaSetting2.cs +++ b/FrmDatabaseParaSetting2.cs @@ -148,6 +148,7 @@ this.DialogResult = DialogResult.OK; this.Close(); } + /* /// /// 从配置文件读取数据库连接参数配置 /// @@ -214,6 +215,8 @@ } } + * */ + /* /// /// 向配置文件写入数据库参数配置 /// @@ -272,7 +275,7 @@ MessageBox.Show(exp.ToString()); } } - + */ /// /// 取消按钮事件处理 /// diff --git a/FrmDiameterQuery.cs b/FrmDiameterQuery.cs index 68c948b..9a5215b 100644 --- a/FrmDiameterQuery.cs +++ b/FrmDiameterQuery.cs @@ -77,18 +77,7 @@ isBetween = true; } } - /// - /// 键盘按键按下事件处理 - /// - /// - /// - private void textBoxX1_KeyPress(object sender, KeyPressEventArgs e) - { - if ((e.KeyChar < 48 || e.KeyChar > 57) && e.KeyChar != 8) - { - e.Handled = true;//屏蔽 - } - } + bool isBetween = false; /// diff --git a/FrmDocumentEdit.cs b/FrmDocumentEdit.cs index aab2d31..e78a7ff 100644 --- a/FrmDocumentEdit.cs +++ b/FrmDocumentEdit.cs @@ -256,121 +256,6 @@ } - // - /// 将本地文件上传到指定的服务器(HttpWebRequest方法) - /// - /// 文件上传到的服务器 - /// 要上传的本地文件(全路径) - /// 文件上传后的名称 - /// 上传进度条 - /// 成功返回1,失败返回0 - private int Upload_Request(string address, string fileNamePath, string saveName, ProgressBar progressBar) - { - int returnValue = 0; - // 要上传的文件 - FileStream fs = new FileStream(fileNamePath, FileMode.Open, FileAccess.Read); - BinaryReader r = new BinaryReader(fs); - //时间戳 - string strBoundary = "----------" + DateTime.Now.Ticks.ToString("x"); - byte[] boundaryBytes = Encoding.ASCII.GetBytes("/r/n--" + strBoundary + "/r/n"); - //请求头部信息 - StringBuilder sb = new StringBuilder(); - sb.Append("--"); - sb.Append(strBoundary); - sb.Append("\r\n"); - sb.Append("Content-Disposition: form-data; name=\""); - sb.Append("file"); - sb.Append("\"; filename=\""); - sb.Append(saveName); - sb.Append("\""); - sb.Append("\r\n"); - sb.Append("Content-Type: "); - sb.Append("application/octet-stream"); - sb.Append("\r\n"); - sb.Append("\r\n"); - string strPostHeader = sb.ToString(); - byte[] postHeaderBytes = Encoding.UTF8.GetBytes(strPostHeader); - // 根据uri创建HttpWebRequest对象 - HttpWebRequest httpReq = (HttpWebRequest)WebRequest.Create(new Uri(address)); - httpReq.Method = "POST"; - //对发送的数据不使用缓存 - httpReq.AllowWriteStreamBuffering = false; - //设置获得响应的超时时间(300秒) - httpReq.Timeout = 300000; - httpReq.ContentType = "multipart/form-data; boundary=" + strBoundary; - long length = fs.Length + postHeaderBytes.Length + boundaryBytes.Length; - long fileLength = fs.Length; - httpReq.ContentLength = length; - try - { - progressBar.Maximum = int.MaxValue; - progressBar.Minimum = 0; - progressBar.Value = 0; - //每次上传4k - int bufferLength = 4096; - byte[] buffer = new byte[bufferLength]; - //已上传的字节数 - long offset = 0; - //开始上传时间 - DateTime startTime = DateTime.Now; - int size = r.Read(buffer, 0, bufferLength); - Stream postStream = httpReq.GetRequestStream(); - //发送请求头部消息 - postStream.Write(postHeaderBytes, 0, postHeaderBytes.Length); - while (size > 0) - { - postStream.Write(buffer, 0, size); - offset += size; - progressBar.Value = (int)(offset * (int.MaxValue / length)); - TimeSpan span = DateTime.Now - startTime; - double second = span.TotalSeconds; - //lblTime.Text = "已用时:" + second.ToString("F2") + "秒"; - //if (second > 0.001) - //{ - // lblSpeed.Text = " 平均速度:" + (offset / 1024 / second).ToString("0.00") + "KB/秒"; - //} - //else - //{ - // lblSpeed.Text = " 正在连接…"; - //} - //lblState.Text = "已上传:" + (offset * 100.0 / length).ToString("F2") + "%"; - //lblSize.Text = (offset / 1048576.0).ToString("F2") + "M/" + (fileLength / 1048576.0).ToString("F2") + "M"; - Application.DoEvents(); - size = r.Read(buffer, 0, bufferLength); - } - //添加尾部的时间戳 - postStream.Write(boundaryBytes, 0, boundaryBytes.Length); - postStream.Close(); - //获取服务器端的响应 - WebResponse webRespon = httpReq.GetResponse(); - Stream s = webRespon.GetResponseStream(); - StreamReader sr = new StreamReader(s); - //读取服务器端返回的消息 - String sReturnString = sr.ReadLine(); - s.Close(); - sr.Close(); - if (sReturnString == "Success") - { - returnValue = 1; - } - else if (sReturnString == "Error") - { - returnValue = 0; - } - } - catch(Exception ex) - { - returnValue = 0; - string str = ex.ToString(); - } - finally - { - fs.Close(); - r.Close(); - } - return returnValue; - } - private void btn_file_Click(object sender, EventArgs e) { OpenFileDialog dlg = new OpenFileDialog(); diff --git a/FrmExportCADS.cs b/FrmExportCADS.cs index 98772ea..59629dd 100644 --- a/FrmExportCADS.cs +++ b/FrmExportCADS.cs @@ -108,65 +108,6 @@ MessageBox.Show("请选中要导出的图层!", "提示", MessageBoxButtons.OK, MessageBoxIcon.Warning); } } - private Boolean MerageToFile(GSOFeatures features, String strDestFile, String strProj4)//图层追加 - { - if (features == null) - { - return false; - } - Boolean bSuccess = false; - - string strDir = GSOUtility.GetFileDir(strDestFile); - string strLPRJFile = GSOUtility.ChangeExt(strDestFile, ".lprj"); - string strExt = GSOUtility.GetFileExt(strDestFile); - - // 如果投影文件存在,投影以投影文件为准 - if (File.Exists(strLPRJFile)) - { - // 如果是dxf,则这样处理 - if (strExt.ToLower() == ".dxf") - { - string strTempSrcFile = strDir + "srcFeatures_dxftmp" + strExt; - globeControl1.Globe.DataManager.SaveFeatureData(features, strTempSrcFile, strLPRJFile, 4); - bSuccess = GSOUtility.MergeTwoDXFFileFeatures(strDestFile, strTempSrcFile); - File.Delete(strTempSrcFile); - } - else - { - GSOFeatures srcFeatures = globeControl1.Globe.DataManager.ReadFeatureData(strDestFile); - int nCount = features.Length; - int i = 0; - for (i = 0; i < nCount; i++) - { - srcFeatures.Add(features[i]); - } - bSuccess = globeControl1.Globe.DataManager.SaveFeatureData(srcFeatures, strDestFile, strLPRJFile, 4); - } - } - else - { - // 如果是dxf,则这样处理 - if (strExt.ToLower() == ".dxf") - { - string strTempSrcFile = strDir + "srcFeatures_dxftmp" + strExt; - globeControl1.Globe.DataManager.SaveFeatureData(features, strTempSrcFile, strProj4, 0); - bSuccess = GSOUtility.MergeTwoDXFFileFeatures(strDestFile, strTempSrcFile); - File.Delete(strTempSrcFile); - } - else - { - GSOFeatures srcFeatures = globeControl1.Globe.DataManager.ReadFeatureData(strDestFile); - int nCount = features.Length; - int i = 0; - for (i = 0; i < nCount; i++) - { - srcFeatures.Add(features[i]); - } - bSuccess = globeControl1.Globe.DataManager.SaveFeatureData(srcFeatures, strDestFile, strProj4, 0); - } - } - return bSuccess; - } /// /// 关闭按钮事件处理 /// diff --git a/FrmHDMAnalysis3.cs b/FrmHDMAnalysis3.cs index 4f73af6..2ada735 100644 --- a/FrmHDMAnalysis3.cs +++ b/FrmHDMAnalysis3.cs @@ -436,29 +436,6 @@ } layerTemp.RemoveAllFeature(); } - private void Export(GSOPoint3d _pnt, double r) - { - GSOPoint3ds pnts = new GSOPoint3ds(); - GSOPoint3d pnt = new GSOPoint3d(); - pnt.X = _pnt.X; - pnt.Y = _pnt.Y; - pnt.Z = _pnt.Z; - pnts.Add(pnt); - pnt.X = _pnt.X; - pnt.Y = _pnt.Y - 0.0000000005; - pnt.Z = _pnt.Z; - pnts.Add(pnt); - GSOGeoPolyline3D line = new GSOGeoPolyline3D(); - line.AddPart(pnts); - GSOGeoPolygon3D polygon = line.CreateBuffer(r * 2, true, 5, true, false); - GSOPoint3ds points = polygon[0]; - GSOGeoPolyline3D newLine = new GSOGeoPolyline3D(); - newLine.AddPart(points); - newLine.AltitudeMode = EnumAltitudeMode.RelativeToGround; - GSOFeature newFeature = new GSOFeature(); - newFeature.Geometry = newLine; - globeControl1.Globe.MemoryLayer.AddFeature(newFeature); - } private void ExportCAD(double a, double b, double r) { diff --git a/FrmHotFuncStat.cs b/FrmHotFuncStat.cs index c980f34..2eb1476 100644 --- a/FrmHotFuncStat.cs +++ b/FrmHotFuncStat.cs @@ -421,13 +421,6 @@ } } - private void HFS_Pderive_Click(object sender, EventArgs e) - { - if (TV_Files.SelectedNode != null) - { - HFSClass.GuideEdit_form("G", TV_Files, int.Parse(((ToolStripMenuItem)sender).Tag.ToString())); - } - } private void 导入ToolStripMenuItem_Click(object sender, EventArgs e) { @@ -530,22 +523,8 @@ } } - private void 导出ToolStripMenuItem1_Click(object sender, EventArgs e) - { - 导出ToolStripMenuItem2_Click(sender, e); - } + - private void TV_HFSSrchRslt_AfterCollapse(object sender, TreeViewEventArgs e) - { - e.Node.ImageIndex = 0; - } - - private void TV_HFSSrchRslt_AfterExpand(object sender, TreeViewEventArgs e) - { - HFSClass.ADD_TreeNode(TV_Files, e.Node); - e.Node.ImageIndex = 1; - } - private void 导出ToolStripMenuItem1_Click_1(object sender, EventArgs e) { if ((TV_HFSSrchRslt.SelectedNode != null) && (TV_HFSSrchRslt.SelectedNode.Parent != null)) diff --git a/FrmLayerControl.cs b/FrmLayerControl.cs index e7917c3..28fa14d 100644 --- a/FrmLayerControl.cs +++ b/FrmLayerControl.cs @@ -312,26 +312,7 @@ layerManagerNode.Expand(); terrainManagerNode.Expand(); } - /// - /// 刷新节点树 - /// - private void RefreshDataTree() - { - layerTree2.Nodes[0].Nodes.Clear(); - Int32 nCount = globeControl2.Globe.Layers.Count; - Int32 i = 0; - for (i = 0; i < nCount; i++) - { - GSODataset dataSpace = globeControl2.Globe.Layers[i].Dataset; - TreeNode node = new TreeNode(); - node.Text = dataSpace.Name; - node.ImageIndex = 0; - node.SelectedImageIndex = 0; - node.Checked = true; - node.Tag = dataSpace; - layerTree2.Nodes[0].Nodes.Add(node); - } - } + /// /// 目标图层按钮事件处理 /// @@ -494,22 +475,8 @@ } } } - /// - /// 改变指定节点的选中状态 - /// - /// - /// - private void CheckTreeNode(TreeNode node, Boolean bChecked) - { - CheckChildTreeNode(node, bChecked); - // 对于kml图层,如果当前处理的节点是true,那么要把所有的祖宗节点置为true - // 只有所有节点都未false,那么这个节点才为false - // CheckFatherTreeNode(node, bChecked); - globeControl1.Globe.Refresh(); - globeControl2.Globe.Refresh(); - - } + private void CheckChildTreeNode(TreeNode node, Boolean bChecked) { if (node == null) @@ -696,59 +663,7 @@ //} //CheckControl(e); } - /// - /// 树节点选中方法 - /// - /// - private void CheckControl(TreeViewEventArgs e) - { - if (e.Action != TreeViewAction.Unknown) - { - if (e.Node != null && !Convert.IsDBNull(e.Node)) - { - CheckParentNode(e.Node); - if (e.Node.Nodes.Count > 0) - { - CheckAllChildNodes(e.Node, e.Node.Checked); - } - } - } - } - /// - /// 改变所有子节点的状态 - /// - /// - /// - private void CheckAllChildNodes(TreeNode pn, bool IsChecked) - { - foreach (TreeNode tn in pn.Nodes) - { - tn.Checked = IsChecked; - if (tn.Tag.ToString().Contains("|")) - { - string nodeTag = tn.Tag.ToString().Split('|')[1]; - GSOLayer layer = globeControl1.Globe.Layers.GetLayerByCaption(nodeTag); - if (layer != null) - { - layer.Visible = IsChecked; - globeControl1.Globe.Refresh(); - } - } - if (tn.Tag is GSOFeature) - { - if (tn.Nodes.Count == 0) - { - GSOFeature feat = tn.Tag as GSOFeature; - feat.Visible = IsChecked; - globeControl1.Globe.Refresh(); - } - } - if (tn.Nodes.Count > 0) - { - CheckAllChildNodes(tn, IsChecked); - } - } - } + /// /// 改变父节点的选中状态,此处为所有子节点不选中时才取消父节点选中,可以根据需要修改 /// diff --git a/FrmLogin.cs b/FrmLogin.cs index 320fdd5..2afe46e 100644 --- a/FrmLogin.cs +++ b/FrmLogin.cs @@ -59,70 +59,6 @@ textBoxPassWord.Clear(); } } - - /// - /// 验证端口号 - /// - /// - private bool ValiPort() - { - Ping p = new Ping();//创建Ping对象p - PingReply pr = p.Send(Utility.localicenseserverip);//向指定IP或者主机名的计算机发送ICMP协议的ping数据包 - if (pr.Status == IPStatus.Success)//如果ping成功 - { - try - { - TcpClient tcpc = new TcpClient(Utility.localicenseserverip, Utility.localicenseserverport);//对IP地址为"192.168.0.105"的计算机的1500端口提出连接申请 - tcpc.Close(); - return true; - } - catch (Exception ex) - { - MessageBox.Show("端口连接错误!" + ex.Message); - return false; - } - } - else - { - int times = 0;//重新连接次数; - int count = 2;//设置尝试次数 - while (times < count) - { - //Thread.Sleep(1000);//等待时间(方便测试的话,你可以改为1000) - pr = p.Send(Utility.localicenseserverip); - - if (pr.Status == IPStatus.Success) - { - try - { - TcpClient tcpc = new TcpClient(Utility.localicenseserverip, Utility.localicenseserverport);//对IP地址为"192.168.0.105"的计算机的1500端口提出连接申请 - tcpc.Close(); - return true; - } - catch (Exception ex) - { - MessageBox.Show("端口连接错误!" + ex.Message); - return false; - } - } - else - { - times++; - if (times < count) - { - continue; - } - else - { - MessageBox.Show("重新尝试连接失败"); - return false; - } - } - - } - return false; - } - } /// /// 验证用户名、密码 /// diff --git a/FrmMetadata.cs b/FrmMetadata.cs index 886f65a..0365372 100644 --- a/FrmMetadata.cs +++ b/FrmMetadata.cs @@ -27,11 +27,7 @@ InitializeComponent(); loadTreeView(layerTree); } - private void FrmMetadata_Load(object sender, EventArgs e) - { - //this.ntLblC.Text = "nn"; - // loadTreeView(layerTree); - } + private void loadTreeView(TreeView tv)//构建图层树 { try diff --git a/FrmMetadataStat.cs b/FrmMetadataStat.cs index 790658a..e7696c6 100644 --- a/FrmMetadataStat.cs +++ b/FrmMetadataStat.cs @@ -197,9 +197,5 @@ } } - private void buttonX1_Click(object sender, EventArgs e) - { - drawChart(); - } } } diff --git a/FrmPatrolerManager.cs b/FrmPatrolerManager.cs index 37f8ffd..9e66aeb 100644 --- a/FrmPatrolerManager.cs +++ b/FrmPatrolerManager.cs @@ -109,82 +109,8 @@ this.winGridViewPager1.AllToExport = table; } - /// - /// 编辑 - /// - /// - /// - private void winGridViewPager1_OnEditSelected(object sender, EventArgs e) - { - - DataGridView grid = sender as DataGridView; - if (grid != null && grid.SelectedRows.Count>0) - { - DataGridViewRow row = grid.SelectedRows[0]; - try - { - long dbid = long.Parse(row.Cells["编号"].Value.ToString()); - String name = row.Cells["姓名"].Value.ToString(); - String sex = row.Cells["性别"].Value.ToString(); - String age = row.Cells["年龄"].Value.ToString(); - string phone = row.Cells["电话"].Value.ToString(); - age = String.IsNullOrEmpty(age.ToString().Trim()) ? "1" : age.ToString().Trim(); - FrmPatrolerEdit frm = new FrmPatrolerEdit(dbid.ToString(), name, age, sex, phone); - frm.reloadGrid += new ReloadPatrolerGrid(LoadData); - frm.ShowDialog(); - winGridViewPager1.Refresh(); - } - catch (Exception ex) - { - MessageBox.Show("编辑失败:" + ex.ToString(), "错误", MessageBoxButtons.OK, MessageBoxIcon.Error); - } - } - else - { - MessageBox.Show("没有选择记录", "提示"); - } - - } - - /// - /// 删除 - /// - /// - /// - private void winGridViewPager1_OnDeleteSelected(object sender, EventArgs e) - { - DataGridView grid = sender as DataGridView; - if (grid != null && grid.SelectedRows.Count > 0) - { - DataGridViewRow row = grid.SelectedRows[0]; - long dbid = long.Parse(row.Cells["编号"].Value.ToString()); - try - { - string state = row.Cells["状态"].Value.ToString(); - if ("在线".Equals(state)) - { - if (MessageBox.Show("确定注销?", "确认", MessageBoxButtons.YesNo, MessageBoxIcon.Question) == DialogResult.Yes) - { - String sql = "update patroler t set t.accountstate='LEAVER' where t.dbid=" + dbid; - OracleUtils.ExecuteNonQuery(OracleUtils.ConnectionString, CommandType.Text, sql); - } - } - else { - MessageBox.Show("人员不在线,无法注销", "信息"); - } - } - catch (Exception ex) - { - MessageBox.Show("人员注销失败:" + ex.ToString(), "错误", MessageBoxButtons.OK, MessageBoxIcon.Error); - } - } - else - { - MessageBox.Show("没有选择记录", "提示"); - } - } - - + + private void LoadData() { int pageIndex = winGridViewPager1.PagerInfo.CurrenetPageIndex; diff --git a/FrmRoadHDM.cs b/FrmRoadHDM.cs index e765313..e871dd5 100644 --- a/FrmRoadHDM.cs +++ b/FrmRoadHDM.cs @@ -333,31 +333,6 @@ this.Cursor = Cursors.Default; } } - - private void Export(GSOPoint3d _pnt, double r) - { - GSOPoint3ds pnts = new GSOPoint3ds(); - GSOPoint3d pnt = new GSOPoint3d(); - pnt.X = _pnt.X; - pnt.Y = _pnt.Y; - pnt.Z = _pnt.Z; - pnts.Add(pnt); - pnt.X = _pnt.X; - pnt.Y = _pnt.Y - 0.0000000005; - pnt.Z = _pnt.Z; - pnts.Add(pnt); - GSOGeoPolyline3D line = new GSOGeoPolyline3D(); - line.AddPart(pnts); - GSOGeoPolygon3D polygon = line.CreateBuffer(r * 2, true, 5, true, false); - GSOPoint3ds points = polygon[0]; - GSOGeoPolyline3D newLine = new GSOGeoPolyline3D(); - newLine.AddPart(points); - newLine.AltitudeMode = EnumAltitudeMode.RelativeToGround; - GSOFeature newFeature = new GSOFeature(); - newFeature.Geometry = newLine; - globeControl1.Globe.MemoryLayer.AddFeature(newFeature); - } - private void ExportCAD(double a, double b, double r) { GSOPoint3ds pnts = new GSOPoint3ds(); diff --git a/FrmUserAdd.cs b/FrmUserAdd.cs index c612ab4..f826427 100644 --- a/FrmUserAdd.cs +++ b/FrmUserAdd.cs @@ -231,24 +231,6 @@ //cbxRegion.SelectedIndexChanged += new EventHandler(cbxRegion_SelectedIndexChanged); } } - /// - /// 下拉框选中项改变事件处理 - /// - /// - /// - private void cbxRegion_SelectedIndexChanged(object sender, EventArgs e) - { - string sql = ""; - //string sql = "select casic_role.\"name\" from casic_role join casic_regionrole on casic_role.\"id\"=casic_regionrole.\"rid\" where casic_regionrole.\"reid\"=" + region[cbxRegion.SelectedItem.ToString().Trim()]; - DataTable dt = OledbHelper.QueryTable(sql); - if (dt != null && dt.Rows.Count > 0) - { - comboBoxExRegionRole.Items.Clear(); - for (int i = 0; i < dt.Rows.Count; i++) - { - comboBoxExRegionRole.Items.Add(dt.Rows[i][0].ToString().Trim());//部门角色 - } - } - } + } } diff --git a/FrmUserManager.cs b/FrmUserManager.cs index 571f0f0..ae254bc 100644 --- a/FrmUserManager.cs +++ b/FrmUserManager.cs @@ -81,11 +81,6 @@ } } } - //创建新用户 - private void buttonX2_Click(object sender, EventArgs e) - { - FrmUserAdd frm = new FrmUserAdd(-1); - frm.ShowDialog(); - } + } } diff --git a/FrmValveStatistics.cs b/FrmValveStatistics.cs index 545d56c..dd76777 100644 --- a/FrmValveStatistics.cs +++ b/FrmValveStatistics.cs @@ -54,7 +54,7 @@ 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") + if (chaFamenStatis.Series["阀门"].Points[m]!=null&&chaFamenStatis.Series["阀门"].Points[m].YValues[0].ToString() != "0") { chaFamenStatis.Series["阀门"].Points[m].Label = chaFamenStatis.Series[0].Points[m].YValues[0].ToString(); } diff --git a/Frm_password_reset.cs b/Frm_password_reset.cs index 7b51039..b9e5dc3 100644 --- a/Frm_password_reset.cs +++ b/Frm_password_reset.cs @@ -41,6 +41,7 @@ } catch (Exception ex) { + LogHelper.WriteLog(typeof(Frm_password_reset), ex.Message); } } private void initCombox() diff --git a/FrmpipeDeepstatis.cs b/FrmpipeDeepstatis.cs index e156db4..1a84d6c 100644 --- a/FrmpipeDeepstatis.cs +++ b/FrmpipeDeepstatis.cs @@ -307,7 +307,7 @@ chart1.Series[j].Points.DataBindXY(dic1.Keys, dic1.Values); for (int m = 0; m < dic1.Values.Count; m++) { - if (chart1.Series[j].Points[m].YValues[0].ToString() != "0") + if (chart1.Series[j].Points[m]!=null&&chart1.Series[j].Points[m].YValues[0].ToString() != "0") { chart1.Series[j].Points[m].Label = chart1.Series[j].Points[m].YValues[0].ToString(); diff --git a/FrmpipeDiametergather.cs b/FrmpipeDiametergather.cs index 30674de..057b09d 100644 --- a/FrmpipeDiametergather.cs +++ b/FrmpipeDiametergather.cs @@ -263,6 +263,7 @@ if (layer != null && layer is GSOFeatureLayer) { GSOFeatureLayer flayer = layer as GSOFeatureLayer; + if (layer == null) return; GSOFeatures features = flayer.GetAllFeatures(); if (features.Length > 0) { diff --git a/FrmpipeMaterialGather.cs b/FrmpipeMaterialGather.cs index c133ec3..398b884 100644 --- a/FrmpipeMaterialGather.cs +++ b/FrmpipeMaterialGather.cs @@ -280,6 +280,7 @@ if (layer != null && layer is GSOFeatureLayer) { GSOFeatureLayer flayer = layer as GSOFeatureLayer; + if (flayer == null) return; GSOFeatures features = flayer.GetAllFeatures(); if (features.Length > 0) { @@ -332,7 +333,7 @@ chart1.Series[j].Points.DataBindXY(dic1.Keys, dic1.Values); for (int m = 0; m < dic1.Values.Count; m++) { - if (chart1.Series[j].Points[m].YValues[0].ToString() != "0") + if (chart1.Series[j].Points[m]!=null&&chart1.Series[j].Points[m].YValues[0].ToString() != "0") { chart1.Series[j].Points[m].Label = chart1.Series[j].Points[m].YValues[0].ToString(); } diff --git a/Frmpipediameterstatis.cs b/Frmpipediameterstatis.cs index c0ed80a..50f8170 100644 --- a/Frmpipediameterstatis.cs +++ b/Frmpipediameterstatis.cs @@ -286,6 +286,7 @@ chart1.Series.Add(layerCaption); GSOFeatureLayer flayer = layer as GSOFeatureLayer; + if (layer == null) return; GSOFeatures features = flayer.GetAllFeatures(); if (features.Length > 0) { diff --git "a/GKT_Forms/F_GKT\346\225\260\346\215\256\350\276\223\345\205\245\350\276\223\345\207\272.cs" "b/GKT_Forms/F_GKT\346\225\260\346\215\256\350\276\223\345\205\245\350\276\223\345\207\272.cs" index c7bffd5..4db7d5d 100644 --- "a/GKT_Forms/F_GKT\346\225\260\346\215\256\350\276\223\345\205\245\350\276\223\345\207\272.cs" +++ "b/GKT_Forms/F_GKT\346\225\260\346\215\256\350\276\223\345\205\245\350\276\223\345\207\272.cs" @@ -198,12 +198,7 @@ } DialogResult = DialogResult.OK;//将当前窗体的对话框返回值设为OK } - private void treeView1_NodeMouseClick(object sender, TreeNodeMouseClickEventArgs e) - { - dir_Ok = comboBox_Disk.Text + e.Node.FullPath; - //dir = comboBox_Disk.Text + e.Node.FullPath; - e.Node.SelectedImageIndex = e.Node.ImageIndex; - } + string tempstr = ""; private void button1_Click(object sender, EventArgs e) { diff --git a/HFS_Forms/Frm_HFSprojedits.cs b/HFS_Forms/Frm_HFSprojedits.cs index 96dd76f..3c232a1 100644 --- a/HFS_Forms/Frm_HFSprojedits.cs +++ b/HFS_Forms/Frm_HFSprojedits.cs @@ -126,16 +126,6 @@ Close(); } - - - private void TB_ProjName_KeyPress(object sender, KeyPressEventArgs e) - { - if (HFSAClass.Files_NameChar(e) == 0) - e.Handled = true; - if (e.KeyChar == '\r') - OK_Click(sender, e); - } - private void Frm_HFSProjedit_Load(object sender, EventArgs e) { @@ -175,10 +165,6 @@ } } - private void Cancel_Click(object sender, EventArgs e) - { - this.Close(); - } private void Cancel_Click_1(object sender, EventArgs e) { diff --git a/MainFrm.cs b/MainFrm.cs index 2c305a0..ed2685b 100644 --- a/MainFrm.cs +++ b/MainFrm.cs @@ -617,7 +617,7 @@ } catch (Exception ex) { - + LogHelper.WriteLog(typeof(MainFrm), ex.Message); } } @@ -1768,7 +1768,7 @@ } catch (Exception ex) { - //LogError.PublishError(ex); + LogHelper.WriteLog(typeof(MainFrm), ex.Message); } } @@ -2026,6 +2026,7 @@ } catch (Exception ex) { + LogHelper.WriteLog(typeof(MainFrm), ex.Message); result = false; } finally @@ -2316,220 +2317,6 @@ string filename = Utility.filename; List g1layername = new List(); /// - /// 构建图层列表目录树 - /// - /// - private void loadTreeView(TreeView tv) - { - try - { - XmlDocument doc = new XmlDocument(); - doc.Load(filename); - XmlNodeList Params1 = doc.SelectNodes("/Params/layers"); - tv.ShowLines = false; - tv.CheckBoxes = true; - - foreach (XmlNode paramsNode in Params1) //layers - { - foreach (XmlNode layerNode in paramsNode) //layer - { - TreeNode nodelayer = new TreeNode(); - string layerName = layerNode.Attributes["label"].Value; - nodelayer.Text = layerName; - - if (layerNode.HasChildNodes != false) - { - tv.Nodes.Add(nodelayer); - foreach (XmlNode layerchildNode in layerNode) //layerchild - { - if (layerchildNode.Name == "layerchild") - { - TreeNode nodelayerchild = new TreeNode(); - string layerType = layerchildNode.Attributes["type"].Value; - string layerName1 = layerchildNode.Attributes["layer"].Value; - string layerchildName = layerchildNode.Attributes["label"].Value; - if (layerType == "locaserver") - { - if (layerchildNode.Attributes["isRoad"] != null) - { - roadLayerName = layerchildName; - } - dictionaryNetLayerNameAndCaption.Add(layerName1, layerchildName); - - nodelayerchild.Text = layerchildName; - nodelayerchild.Tag = layerType + "|" + layerchildName; - nodelayerchild.Checked = true; - nodelayer.Nodes.Add(nodelayerchild); - } - else - { - if (layerchildNode.Attributes["isPipeLine"] != null) - { - m_PipelineLayerNames.Add(layerchildName); - } - if (layerchildNode.Attributes["isWorkWell"] != null) - { - workwellLayerNames.Add(layerchildName); - } - if (layerchildNode.Attributes["isValve"] != null) - { - valueLayerNames.Add(layerchildName); - } - //if (layerchildNode.Attributes["isInstrument"] != null) - if (layerchildNode.Attributes["isAccess"] != null) - { - instrumenLayerNames.Add(layerchildName); - } - //if (layerchildNode.Attributes["isPipeFitting"] != null) - if (layerchildNode.Attributes["isCharacter"] != null) - { - pipefittingLayerNames.Add(layerchildName); - } - bool boollayer = AddLayers(layerName1, layerchildName); - nodelayerchild.Text = layerchildName; - nodelayerchild.Tag = layerType + "|" + layerchildName; - nodelayerchild.Checked = boollayer; - if (layerchildName.Contains("特征管点")) - { - nodelayerchild.Checked = false; - setLayerVisible(layerName1); - } - - nodelayer.Nodes.Add(nodelayerchild); - g1layername.Add(layerName1); - } - } - else if (layerchildNode.Name == "layertype") - { - TreeNode nodelayerchild = new TreeNode(); - string layerType = layerchildNode.Attributes["label"].Value; - nodelayerchild.Text = layerType; - nodelayerchild.Tag = layerType; - nodelayerchild.Checked = true; - nodelayer.Nodes.Add(nodelayerchild); - if (layerchildNode.HasChildNodes == true) - { - foreach (XmlNode childNodeLayer in layerchildNode) - { - if (childNodeLayer.HasChildNodes == true) - { - TreeNode nodelayerchild2 = new TreeNode(); - string layer = childNodeLayer.Attributes["label"].Value; - nodelayerchild2.Text = layer; - nodelayerchild2.Tag = layer; - nodelayerchild2.Checked = true; - nodelayerchild.Nodes.Add(nodelayerchild2); - foreach (XmlNode n in childNodeLayer) - { - TreeNode nodelayerchild1 = new TreeNode(); - string layerName1 = n.Attributes["layer"].Value; - string layerchildName = n.Attributes["label"].Value; - string layerType1 = n.Attributes["type"].Value; - if (n.Attributes["isPipeLine"] != null) - { - m_PipelineLayerNames.Add(layerchildName); - } - if (n.Attributes["isWorkWell"] != null) - { - workwellLayerNames.Add(layerchildName); - } - if (n.Attributes["isValve"] != null) - { - valueLayerNames.Add(layerchildName); - } - if (n.Attributes["isAccess"] != null) - //if (n.Attributes["isInstrument"] != null) - { - instrumenLayerNames.Add(layerchildName); - } - if (n.Attributes["isPipeFitting"] != null) - { - pipefittingLayerNames.Add(layerchildName); - } - bool boollayer = AddLayers(layerName1, layerchildName); - nodelayerchild1.Text = layerchildName; - nodelayerchild1.Tag = layerType1 + "|" + layerchildName; - nodelayerchild1.Checked = boollayer; - if (layerchildName.Contains("特征管点")) - { - nodelayerchild1.Checked = false; - setLayerVisible(layerName1); - } - - nodelayerchild2.Nodes.Add(nodelayerchild1); - - g1layername.Add(layerName1); - } - } - else - { - TreeNode nodelayerchild1 = new TreeNode(); - string layerName1 = childNodeLayer.Attributes["layer"].Value; - string layerchildName = childNodeLayer.Attributes["label"].Value; - string layerType1 = childNodeLayer.Attributes["type"].Value; - if (childNodeLayer.Attributes["isPipeLine"] != null) - { - m_PipelineLayerNames.Add(layerchildName); - } - if (childNodeLayer.Attributes["isWorkWell"] != null) - { - workwellLayerNames.Add(layerchildName); - } - if (childNodeLayer.Attributes["isValve"] != null) - { - valueLayerNames.Add(layerchildName); - } - if (childNodeLayer.Attributes["isAccess"] != null) - //if (childNodeLayer.Attributes["isInstrument"] != null) - { - instrumenLayerNames.Add(layerchildName); - } - if (childNodeLayer.Attributes["isPipeFitting"] != null) - { - pipefittingLayerNames.Add(layerchildName); - } - bool boollayer = AddLayers(layerName1, layerchildName); - nodelayerchild1.Text = layerchildName; - nodelayerchild1.Tag = layerType1 + "|" + layerchildName; - nodelayerchild1.Checked = boollayer; - if (layerchildName.Contains("特征管点")) - { - nodelayerchild1.Checked = false; - setLayerVisible(layerName1); - } - nodelayerchild.Nodes.Add(nodelayerchild1); - g1layername.Add(layerName1); - } - } - } - } - } - } - else - { - tv.Nodes.Add(nodelayer); - } - } - } - - foreach (TreeNode tn in tv.Nodes) - { - if (tn.Nodes.Count > 0) - { - foreach (TreeNode tnChild in tn.Nodes) - { - if (tnChild.Checked) - tn.Checked = true; - } - } - } - } - catch (Exception ex) - { - //LogError.PublishError(ex); - } - } - /// /// 获取目标图层 /// /// @@ -2629,21 +2416,11 @@ } catch (Exception ex) { - //LogError.PublishError(ex); + LogHelper.WriteLog(typeof(MainFrm), ex.Message); return false; } } /// - /// 菜单上的 三维导航 工具按钮 - /// - /// - /// - private void buttonItem86_Click(object sender, EventArgs e) - { - globeControl1.Globe.Action = EnumAction3D.ActionNull; - } - - /// /// 地上模式 菜单按钮 /// /// @@ -3026,67 +2803,11 @@ } Image printImage; - /// - /// 打印 菜单 - /// - /// - /// - private void buttonItem13_Click(object sender, EventArgs e) - { - Point pt1 = new Point(Convert.ToInt32(0), Convert.ToInt32(0)); - Point pt2 = new Point(Convert.ToInt32(panelEx5.Width), Convert.ToInt32(panelEx5.Height)); - int mapWidth = 0; - int mapHeight = 0; - Point pt = getUpperLeftPoint(pt1, pt2, out mapWidth, out mapHeight); - printImage = new Bitmap(Convert.ToInt32(panelEx5.Width), Convert.ToInt32(panelEx5.Height)); - Graphics g = Graphics.FromImage(printImage); - g.CopyFromScreen(pt, new Point(0, 0), new Size(Convert.ToInt32(panelEx5.Width), Convert.ToInt32(panelEx5.Height))); - - PrintDialog pd = new PrintDialog(); - try - { - if (pd.ShowDialog() == DialogResult.OK) //如果确认,将会覆盖所有的打印参数设置 - { - //打印预览 - PrintPreviewDialog ppd = new PrintPreviewDialog(); - ppd.Document = printDocument1; - if (DialogResult.OK == ppd.ShowDialog()) - { - printDocument1.Print(); //打印 - } - } - } - catch - { - printDocument1.PrintController.OnEndPrint(printDocument1, new System.Drawing.Printing.PrintEventArgs()); - } - } - + private void printDocument1_PrintPage(object sender, System.Drawing.Printing.PrintPageEventArgs e) { e.Graphics.DrawImage(printImage, 10, 10); } - - /// - /// 在窗体的底部状态栏上显示 综合管线条件查询结果 - /// - /// - /// - private void ToolStripText(string currentLayer, int dataCount) - { - if (dataCount != 0) - { - double featurelength = PipeLength(currentLayer, 0);// 统计管线的里程数 - - toolStripNumbers.Text = " 管线类型:" + currentLayer + " | 共有:" + Convert.ToString(dataCount - 1) + "条记录"; - toolStripFeatureLength.Text = " 管线里程:" + featurelength.ToString("0.00") + " 米"; - } - else - { - toolStripNumbers.Text = "管线类型: " + currentLayer + "| 共有:" + 0 + " 条记录 | "; - } - } - /// /// 统计管线的里程数 /// @@ -3402,26 +3123,6 @@ } /// - /// 绘制线 菜单 - /// - /// - /// - private void btnAddLine_Click(object sender, EventArgs e) - { - globeControl1.Globe.DestLayerFeatureAdd = globeControl1.Globe.MemoryLayer; - globeControl1.Globe.Action = EnumAction3D.DrawPolyline; - } - /// - /// 绘制面 菜单 - /// - /// - /// - private void btnAddPolygon_Click(object sender, EventArgs e) - { - globeControl1.Globe.DestLayerFeatureAdd = globeControl1.Globe.MemoryLayer; - globeControl1.Globe.Action = EnumAction3D.DrawPolygon; - } - /// /// 图层目录树 右键菜单中的 目标图层 菜单 /// /// @@ -3956,42 +3657,7 @@ // ClearUpDownTraceAnalysis(); //} - /// - /// 显示流向 功能 - /// - /// - /// - /// - private void Flow(object sender, string pipelineNameCN, bool bShow) - { - GSOFeatureLayer layer = globeControl1.Globe.Layers.GetLayerByCaption(pipelineNameCN) as GSOFeatureLayer; - GSOFeatures feats = layer.GetAllFeatures(); - for (int i = 0; i < feats.Length; i++) - { - GSOFeature feat = feats[i]; - GSOLineStyle3D lineStyle = feat.Geometry.Style as GSOLineStyle3D; - if (lineStyle != null) - { - if (lineStyle.ArrowStyle == null) - { - lineStyle.ArrowStyle = new GSOArrowStyle(); - lineStyle.ArrowStyle.BodyWidth = 2; - lineStyle.ArrowStyle.BodyLen = 6; - lineStyle.ArrowStyle.HeadWidth = 8; - lineStyle.ArrowStyle.HeadLen = 10; - lineStyle.ArrowStyle.OutlineVisible = true; - lineStyle.ArrowStyle.OutlineColor = Color.Red; - lineStyle.ArrowStyle.Speed = lineStyle.ArrowStyle.Speed / 2; - lineStyle.ArrowStyle.Play(); - } - lineStyle.ArrowVisible = bShow; - layerTree.SelectedNode = null; - } - } - globeControl1.Globe.Refresh(); - } - - + FrmCloseValves frm; /// /// 关阀分析 功能 @@ -4030,7 +3696,9 @@ curCAYNDataset.CloseValveAnalysis(lineFeature.ID, out arryResNodeID, out arryResValveID, false, true); } catch (Exception e) - { } + { + LogHelper.WriteLog(typeof(MainFrm), e.Message); + } string valveName = lineLayer.Caption; valveName = valveName.Substring(0, valveName.IndexOf("管线")); @@ -4106,7 +3774,7 @@ } catch (Exception e) { - + LogHelper.WriteLog(typeof(MainFrm), e.Message); } //目前只有燃气管线 有阀门 string valveName = lineLayer.Name; @@ -5457,7 +5125,7 @@ } catch (Exception ex) { - //MessageBox.Show(ex.ToString()); + LogHelper.WriteLog(typeof(MainFrm), ex.Message); } finally { @@ -5501,22 +5169,6 @@ } } - - /// - /// 清除所有坑 菜单 - /// - /// - /// - private void buttonItem3_Click(object sender, EventArgs e) - { - //日志记录 - LogManager.saveLog(Utility.userName, this.buttonItem3.Text); - - globeControl1.Globe.RemoveAllPits(); - } - - - ///// ///// 净距分析 菜单 ///// @@ -5554,42 +5206,8 @@ // ribbonBarTP.Visible = buttonItem34.Checked; // ribbonBarTP.Location = new Point(0, 0); //} - /// - /// 大气层 菜单 - /// - /// - /// - private void buttonItem17_Click_1(object sender, EventArgs e) - { - globeControl1.Globe.Atmosphere.Visible = !globeControl1.Globe.Atmosphere.Visible; - buttonItemSH1.Checked = globeControl1.Globe.Atmosphere.Visible; - globeControl1.Refresh(); - } - /// - /// 经纬网 菜单 - /// - /// - /// - private void buttonItem20_Click(object sender, EventArgs e) - { - globeControl1.Globe.LatLonGrid.Visible = !globeControl1.Globe.LatLonGrid.Visible; - buttonItemSH3.Checked = globeControl1.Globe.LatLonGrid.Visible; - globeControl1.Globe.Refresh(); - } - /// - /// 状态条 菜单 - /// - /// - /// - private void buttonItem21_Click_1(object sender, EventArgs e) - { - globeControl1.Globe.StatusBar.Visible = !globeControl1.Globe.StatusBar.Visible; - buttonItemSH4.Checked = globeControl1.Globe.StatusBar.Visible; - globeControl1.Globe.Refresh(); - } - - + /// /// 添加指定路径下的数据 功能 /// @@ -5680,43 +5298,7 @@ // } // return objRes; //} - /// - /// 刷新目录树 功能 - /// - private void RefreshDataTree() - { - layerTree.Nodes[0].Nodes.Clear(); - Int32 nCount = globeControl1.Globe.DataManager.DataSourceCount; - Int32 i = 0; - for (i = 0; i < nCount; i++) - { - GSODataSource dataSpace = globeControl1.Globe.DataManager[i]; - TreeNode node = new TreeNode(); - node.Text = dataSpace.Name; - node.ImageIndex = 0; - node.SelectedImageIndex = 0; - node.Checked = true; - node.Tag = dataSpace; - Int32 nDatasetCount = dataSpace.DatasetCount; - for (Int32 j = 0; j < nDatasetCount; j++) - { - GSODataset dataset = dataSpace[j]; - TreeNode subNode = new TreeNode(); - subNode.Text = dataset.Name; - subNode.ImageIndex = 0; - subNode.SelectedImageIndex = 0; - subNode.Checked = true; - subNode.Tag = dataset; - node.Nodes.Add(subNode); - } - layerTree.Nodes[0].Nodes.Add(node); - } - } - - - - - + /// /// 复合查询 菜单 @@ -5777,34 +5359,7 @@ return false; } - /// - /// 统计指定图层在指定范围内的所有feature对象 - /// - /// - /// - /// - private GSOFeatures Intersect_PointLayer(GSOGeoPolygon3D polygon, string pointLayerName) - { - GSOLayer layer = globeControl1.Globe.Layers.GetLayerByCaption(pointLayerName); - if (layer == null) - return null; - - GSOFeatureLayer flayer = layer as GSOFeatureLayer; - GSOFeatureDataset fdataset = flayer.Dataset as GSOFeatureDataset; - GSOFeatures feats; - if (polygon == null) - { - feats = flayer.GetAllFeatures(); - } - else - { - feats = flayer.FindFeaturesInPolygon(polygon, false); - } - - workWellLen.Add(pointLayerName, feats.Length); - return feats; - } - /// + /// /// 碰撞分析功能界面中 选择管线复选框 选中状态改变事件处理 /// /// @@ -5946,16 +5501,6 @@ MessageBox.Show("表格内容为空!", "提示"); } } - /// - /// 导出CAD 菜单 - /// - /// - /// - private void btnExportCAD_Click(object sender, EventArgs e) - { - FrmExportCADS frm = new FrmExportCADS(globeControl1, m_PipelineLayerNames); - frm.ShowDialog(); - } ///// ///// 区域分析 菜单 @@ -5987,16 +5532,6 @@ } } } - /// - /// 数据验证 菜单 - /// - /// - /// - private void buttonItem80_Click(object sender, EventArgs e) - { - FrmValiData frm = new FrmValiData(globeControl1); - frm.ShowDialog(); - } /// /// 根据指定图层创建图层节点并将节点添加到图层管理节点的子节点集合中 @@ -6018,56 +5553,7 @@ layerManagerNode.Expand(); } } - /// - /// 数据库备份 菜单 - /// - /// - /// - private void btnBackDatabase_Click(object sender, EventArgs e) - { - if (MessageBox.Show("是否确定要备份数据库文件", "信息", MessageBoxButtons.YesNo, MessageBoxIcon.Question) == DialogResult.Yes) - { - try - { - DateTime currentTime = DateTime.Now; - //string Dtime = currentTime.ToShortDateString().ToString("yyyy-MM-dd"); - string Dtime = currentTime.GetDateTimeFormats('D')[0].ToString(); - string Htime = DateTime.Now.ToString("HH时mm分ss秒").Trim(); - string fileName = Dtime + "(" + Htime + ")"; - string pathName = ""; - string sql = "select filename from master..sysdatabases where name='" + Utility.dbdatabase + "'"; - DataTable dt = OledbHelper.ExecuteDataTable(sql); - if (dt != null && dt.Rows.Count > 0) - { - pathName = dt.Rows[0][0].ToString().Trim(); - int count = pathName.LastIndexOf("\\") == -1 ? pathName.LastIndexOf("/") : pathName.LastIndexOf("\\"); - pathName = pathName.Substring(0, count); - } - pathName += "\\管网数据库" + fileName + ".bak"; - - OracleCommand cmdBK = new OracleCommand(); - cmdBK.CommandType = CommandType.Text; - cmdBK.Connection = connBackup; - cmdBK.CommandText = @"backup database " + Utility.dbdatabase + " to disk='" + pathName + "' with init"; - - connBackup.Open(); - cmdBK.ExecuteNonQuery(); - MessageBox.Show("数据库文件备份成功", "提示"); - } - catch (Exception ex) - { - MessageBox.Show(ex.ToString()); - } - finally - { - connBackup.Close(); - } - } - } - - - - + //GSOFeature emitterFeature; // 粒子要素 /// /// 添加火苗 功能 @@ -6598,361 +6084,15 @@ } } - - ///// - /// 添加用户仓库 菜单 - /// - /// - /// - private void buttonItem108_Click(object sender, EventArgs e) - { - FrmUserRepo frm = new FrmUserRepo(-1); - frm.ShowDialog(); - } - /// - /// 用户仓库管理 菜单 - /// - /// - /// - private void buttonItem111_Click(object sender, EventArgs e) - { - FrmUserRepoMgr frm = new FrmUserRepoMgr(); - frm.ShowDialog(); - } - /// - /// 添加分系统 菜单 - /// - /// - /// - private void buttonItem112_Click(object sender, EventArgs e) - { - //FrmAPP frm = new FrmAPP(-1); - //frm.ShowDialog(); - } - /// - /// 分系统管理 菜单 - /// - /// - /// - private void buttonItem113_Click(object sender, EventArgs e) - { - //FrmAPPMgr frm = new FrmAPPMgr(); - //frm.ShowDialog(); - } - /// - /// 添加操作 菜单 - /// - /// - /// - private void buttonItem114_Click(object sender, EventArgs e) - { - FrmOper frm = new FrmOper(-1); - frm.ShowDialog(); - } - /// - /// 操作管理 菜单 - /// - /// - /// - private void buttonItem115_Click(object sender, EventArgs e) - { - FrmOperMgr frm = new FrmOperMgr(); - frm.ShowDialog(); - } - /// - /// 添加资源 菜单 - /// - /// - /// - private void buttonItem116_Click(object sender, EventArgs e) - { - FrmRESC frm = new FrmRESC(-1); - frm.ShowDialog(); - } - /// - /// 资源管理 菜单 - /// - /// - /// - private void buttonItem117_Click(object sender, EventArgs e) - { - FrmRESCMgr frm = new FrmRESCMgr(); - frm.ShowDialog(); - } - /// - /// 添加权限 菜单 - /// - /// - /// - private void buttonItem118_Click(object sender, EventArgs e) - { - FrmPerm frm = new FrmPerm(-1); - frm.ShowDialog(); - } - /// - /// 权限管理 菜单 - /// - /// - /// - private void buttonItem119_Click(object sender, EventArgs e) - { - FrmPermMgr frm = new FrmPermMgr(); - frm.ShowDialog(); - } - /// - /// 添加访问控制 菜单 - /// - /// - /// - private void buttonItem120_Click(object sender, EventArgs e) - { - FrmAccess frm = new FrmAccess(-1); - frm.ShowDialog(); - } - /// - /// 访问控制管理 菜单 - /// - /// - /// - private void buttonItem121_Click(object sender, EventArgs e) - { - FrmAccessMgr frm = new FrmAccessMgr(); - frm.ShowDialog(); - } - /// - /// 部门类型管理 菜单 - /// - /// - /// - private void buttonItem122_Click(object sender, EventArgs e) - { - FrmRegionTypeMgr frm = new FrmRegionTypeMgr(); - frm.ShowDialog(); - } - /// - /// 用户信息管理 菜单 - /// - /// - /// - private void buttonItem128_Click_1(object sender, EventArgs e) - { - FrmUserManager frm = new FrmUserManager(); - frm.ShowDialog(); - } - /// - /// 添加角色 菜单 - /// - /// - /// - private void 添加角色_Click(object sender, EventArgs e) - { - FrmRole frm = new FrmRole(-1); - frm.ShowDialog(); - } - /// - /// 所有角色管理 菜单 - /// - /// - /// - private void 角色管理_Click(object sender, EventArgs e) - { - FrmRoleMgr frm = new FrmRoleMgr(); - frm.ShowDialog(); - } - - /// - /// 部门角色管理 菜单 - /// - /// - /// - private void buttonItem133_Click(object sender, EventArgs e) - { - FrmRegionRoleMgr frm = new FrmRegionRoleMgr(); - frm.ShowDialog(); - } - /// - /// 部门管理 菜单 - /// - /// - /// - private void buttonItem130_Click(object sender, EventArgs e) - { - FrmRegionMgr frm = new FrmRegionMgr(); - frm.ShowDialog(); - } - - /// - /// 日志管理 菜单 - /// - /// - /// - private void buttonItem135_Click(object sender, EventArgs e) - { - FrmLogManager frm = new FrmLogManager(); - frm.ShowDialog(); - } - /// - /// 传感器信息查询 菜单 - /// - /// - /// - private void buttonItem131_Click_1(object sender, EventArgs e) - { - GSOFeature selectedFeature = globeControl1.Globe.SelectedObject; - if (selectedFeature == null) - { - MessageBox.Show("请选择一个传感器对象!", "提示", MessageBoxButtons.OK, MessageBoxIcon.Information); - } - else - { - if (selectedFeature.Geometry != null && selectedFeature.Geometry.Type == EnumGeometryType.GeoModel) - { - GSOLayer layer = globeControl1.Globe.SelectedObjectLayer; - string tabelName = getTableName(layer.Caption); - string eqtID = selectedFeature.Description.Trim(); - if (tabelName != "" && eqtID != "") - { - string fields = getFields(tabelName); - if (fields != "") - { - string sql = "select " + fields + " from " + Utility.sensorDatabase + "." + tabelName + " where EqtID=" + eqtID + " order by RecordDate desc limit 1;"; - DataTable dt = MySqlHelper.queryDataTable(sql); - if (dt != null && dt.Rows.Count > 0) - { - FrmQueryMessage.ShowForm(this, dt, layer.Caption); - //queryMessage.Show(this); - } - else - { - MessageBox.Show("没有查询到相关信息!", "提示"); - } - } - else - { - MessageBox.Show("配置文件 \"sensorConfig.xml\" 有误!", "提示"); - } - } - else - { - MessageBox.Show("请选择一个传感器对象!", "提示"); - } - } - else - { - MessageBox.Show("请选择一个传感器对象!", "提示", MessageBoxButtons.OK, MessageBoxIcon.Information); - } - } - } - /// - /// 根据指定的图层的caption属性的值在配置文件中查找对应的数据库中的表的名称 - /// - /// 图层的caption属性的值 - /// 对应的数据库中的表的名称 - private string getTableName(string name) - { - string tabelName = ""; - if (Utility.sensorMarkerLayers != null) - { - for (int i = 0; i < Utility.sensorMarkerLayers.Count; i++) - { - MarkerLayer mLayer = Utility.sensorMarkerLayers[i]; - if (mLayer.layerName == name) - { - tabelName = mLayer.tableName; - break; - } - } - } - return tabelName; - } - /// - /// 根据数据库中的表的名称 查找对应的表中的字段名称的集合 - /// - /// 数据库中的表的名称 - /// 对应的表中的字段名称的集合 - private string getFields(string tabelName) - { - string fields = ""; - if (Utility.sensorMarkerLayers != null) - { - for (int i = 0; i < Utility.sensorMarkerLayers.Count; i++) - { - MarkerLayer mLayer = Utility.sensorMarkerLayers[i]; - if (mLayer.tableName.Trim() == tabelName.Trim()) - { - if (mLayer.fields != null) - { - foreach (string key in mLayer.fields.Keys) - { - string value = mLayer.fields[key]; - fields += tabelName.Trim() + "." + key + " as " + value + ","; - } - fields = fields.Remove(fields.Length - 1); - } - break; - } - } - } - return fields; - } - - /// - /// 历史曲线查询 菜单 - /// - /// - /// - private void buttonItem132_Click(object sender, EventArgs e) - { - GSOFeature selectedFeature = globeControl1.Globe.SelectedObject; - if (selectedFeature == null) - { - MessageBox.Show("请选择一个对象!", "提示", MessageBoxButtons.OK, MessageBoxIcon.Information); - } - else - { - if (selectedFeature.Geometry != null && selectedFeature.Geometry.Type == EnumGeometryType.GeoModel) - { - GSOLayer layer = globeControl1.Globe.SelectedObjectLayer; - string tabelName = getTableName(layer.Caption); - string eqtID = selectedFeature.Description; - if (tabelName != "" && eqtID != "") - { - FrmQueryHistory.ShowForm(this, tabelName, eqtID); - } - else - { - MessageBox.Show("请选择一个传感器对象!", "提示"); - } - } - else - { - MessageBox.Show("请选择一个传感器对象!", "提示", MessageBoxButtons.OK, MessageBoxIcon.Information); - } - } - } - + //定时检查传感器的状态 public System.Windows.Forms.Timer timerOfSensor = null; public int alarmValueLiuLiang = 0; public int alarmValueYaLi = 0; public int alarmValueYeTi = 0; public int alarmValueZaoSheng = 0; - /// - /// 传感器在线报警 菜单 - /// - /// - /// - private void buttonItem134_Click(object sender, EventArgs e) - { - if (timerOfSensor == null) - { - timerOfSensor = new System.Windows.Forms.Timer(); - timerOfSensor.Interval = 30000; - timerOfSensor.Tick += new EventHandler(timerOfSensor_Tick); - } - FrmQuerySensorAlarm.ShowForm(this); - } + /// /// 传感器报警 功能中的 定时器 的触发事件处理 /// @@ -7016,6 +6156,7 @@ } catch (Exception ex) { + LogHelper.WriteLog(typeof(MainFrm), ex.Message); continue; } } @@ -7025,145 +6166,7 @@ } } - - /// - /// 沿线运动 菜单 - /// - /// - /// - private void buttonItem138_Click(object sender, EventArgs e) - { - if (globeControl1.Globe.SelectedObject == null) - { - MessageBox.Show("请先选择一条线!", "提示", MessageBoxButtons.OK, MessageBoxIcon.Exclamation); - return; - } - - GSOFeature lineFeature = globeControl1.Globe.SelectedObject; - if (lineFeature.Geometry == null || lineFeature.Geometry.Type != EnumGeometryType.GeoPolyline3D) - { - MessageBox.Show("请先选择一条线!", "提示", MessageBoxButtons.OK, MessageBoxIcon.Exclamation); - return; - } - - OpenFileDialog dlg = new OpenFileDialog(); - dlg.Filter = "*.gcm;*.3ds|*.gcm;*.3ds|*.3ds|*.3ds|*.gcm|*.gcm"; - if (dlg.ShowDialog() == DialogResult.OK) - { - GSOGeoModel model = new GSOGeoModel(); - model.FilePath = dlg.FileName; - - GSOGeoDynamicRoute dynamicRoute = new GSOGeoDynamicRoute(); - dynamicRoute.ActorGeometry = model; - - GSORoute route = new GSORoute(); - GSOGeoPolyline3D geoline = (GSOGeoPolyline3D)lineFeature.Geometry; - for (int i = 0; i < geoline[0].Count; i++) - { - route.Add(geoline[0][i]); - } - route.CircleRoute = false; - route.Speed = 30; - route.RotateSpeed = 50; - route.AltitudeMode = geoline.AltitudeMode; - dynamicRoute.Route = route; - - GSOFeature feature = new GSOFeature(); - - dynamicRoute.Play(); - feature.Geometry = dynamicRoute; - - //GSOLabel gsoLabel = new GSOLabel(); - //gsoLabel.Text = "模型测试"; - //feature.Label = gsoLabel; - globeControl1.Globe.MinModelVisibleSize = 0; - - globeControl1.Globe.MemoryLayer.AddFeature(feature); - globeControl1.Globe.Refresh(); - } - } - /// - /// 回退 菜单 - /// - /// - /// - private void buttonItem99_Click(object sender, EventArgs e) - { - globeControl1.Globe.UnDoEdit(); - } - /// - /// 前进 菜单 - /// - /// - /// - private void buttonItem100_Click(object sender, EventArgs e) - { - globeControl1.Globe.ReDoEdit(); - } - /// - /// 水平净距 功能界面中的 标签内容改变事件处理 - /// - /// - /// - private void textBoxX4_TextChanged(object sender, EventArgs e) - { - string valueJingJu = textBoxX4.Text.Trim(); - if (valueJingJu != "") - { - double value = 0; - bool bl = double.TryParse(valueJingJu, out value); - if (bl) - { - labelX24.Text = "水平净距小于" + value.ToString() + "米的管线有:"; - } - } - } - /// - /// 垂直净距 功能界面中的 标签内容改变事件处理 - /// - /// - /// - private void textBoxX2_TextChanged(object sender, EventArgs e) - { - string valueJingJu = textBoxX2.Text.Trim(); - if (valueJingJu != "") - { - double value = 0; - bool bl = double.TryParse(valueJingJu, out value); - if (bl) - { - labelX23.Text = "垂直净距小于" + value.ToString() + "米的管线有:"; - } - } - } - /// - /// 覆土分析 功能界面中的 标签内容改变事件处理 - /// - /// - /// - private void textBoxX3_TextChanged(object sender, EventArgs e) - { - string valueJingJu = textBoxX3.Text.Trim(); - if (valueJingJu != "") - { - double value = 0; - bool bl = double.TryParse(valueJingJu, out value); - if (bl) - { - labelX17.Text = "覆土深度小于" + value.ToString() + "米的管线有:"; - } - } - } - - /// - /// 传感器分类查询 全区域 菜单 - /// - /// - /// - private void buttonItemSensor全区域查询_Click(object sender, EventArgs e) - { - FrmAccessoriesSensor.ShowForm(globeControl1, instrumenLayerNames, 0); - } + /// /// 传感器分类查询 绘制区域 菜单 /// @@ -7224,170 +6227,10 @@ layerTemp.RemoveAllFeature(); globeControl1.Refresh(); } - /// - /// 数字预处理 功能 - /// - /// - /// - private void 数字预处理buttonItem140_Click(object sender, EventArgs e) - { - FrmEditShapeFile frm = new FrmEditShapeFile(globeControl1); - frm.ShowDialog(this); - } - - - /// - /// 导出矢量 功能 将图层导出为kml和shp格式数据 - /// - /// - /// - private void 导出矢量buttonItem140_Click(object sender, EventArgs e) - { - /* - List m_PipelineLayerNames = new List();//线图层名称 - List workwellLayerNames = new List();//工井图层名称 - List valueLayerNames = new List();//阀门图层名称 - List instrumenLayerNames = new List();//附属物图层名称 - List pipefittingLayerNames = new List();//管件图层名称 - */ - List listVectorNames = new List(); - for (int i = 0; i < m_PipelineLayerNames.Count; i++) - { - if (m_PipelineLayerNames[i] == "移动" || m_PipelineLayerNames[i] == "联通" - || m_PipelineLayerNames[i] == "电信" || m_PipelineLayerNames[i] == "共通" - || m_PipelineLayerNames[i] == "有限电视" || m_PipelineLayerNames[i] == "交通信号" - || m_PipelineLayerNames[i] == "供电") - { - continue; - } - if (listVectorNames.Contains(m_PipelineLayerNames[i]) == false) - { - listVectorNames.Add(m_PipelineLayerNames[i]); - } - } - for (int i = 0; i < valueLayerNames.Count; i++) - { - if (listVectorNames.Contains(valueLayerNames[i]) == false) - { - listVectorNames.Add(valueLayerNames[i]); - } - } - for (int i = 0; i < workwellLayerNames.Count; i++) - { - if (listVectorNames.Contains(workwellLayerNames[i]) == false) - { - listVectorNames.Add(workwellLayerNames[i]); - } - } - for (int i = 0; i < instrumenLayerNames.Count; i++) - { - if (listVectorNames.Contains(instrumenLayerNames[i]) == false) - { - listVectorNames.Add(instrumenLayerNames[i]); - } - } - for (int i = 0; i < pipefittingLayerNames.Count; i++) - { - if (listVectorNames.Contains(pipefittingLayerNames[i]) == false) - { - listVectorNames.Add(pipefittingLayerNames[i]); - } - } - FrmExportVector frm = new FrmExportVector(globeControl1, listVectorNames); - frm.ShowDialog(); - } string citySevenLineType = ""; string cityServerLineName = ""; /// - /// 绘制城市七线 功能按钮 - /// - /// - /// - private void 绘制城市七线buttonItem140_Click(object sender, EventArgs e) - { - FrmCitySevenLineType frm = new FrmCitySevenLineType(); - if (frm.ShowDialog() == DialogResult.OK) - { - globeControl1.Globe.Action = EnumAction3D.DrawPolyline; - m_isDrawCitySevenLine = true; - m_isDrawTunnel = false; - m_AddPipeLine = false; - this.citySevenLineType = frm.citySevenLineType; - this.cityServerLineName = frm.citySevenLineName; - switch (frm.citySevenLineType) - { - case "城市红线": - GSOLayer layerRed = globeControl1.Globe.Layers.GetLayerByCaption(frm.citySevenLineType); - if (layerRed != null) - { - globeControl1.Globe.DestLayerFeatureAdd = layerRed; - layerRed.Editable = true; - } - break; - case "城市橙线": - GSOLayer layerOrange = globeControl1.Globe.Layers.GetLayerByCaption(frm.citySevenLineType); - if (layerOrange != null) - { - globeControl1.Globe.DestLayerFeatureAdd = layerOrange; - layerOrange.Editable = true; - } - break; - case "城市黄线": - GSOLayer layerYellow = globeControl1.Globe.Layers.GetLayerByCaption(frm.citySevenLineType); - if (layerYellow != null) - { - globeControl1.Globe.DestLayerFeatureAdd = layerYellow; - layerYellow.Editable = true; - } - break; - case "城市绿线": - GSOLayer layerGreen = globeControl1.Globe.Layers.GetLayerByCaption(frm.citySevenLineType); - if (layerGreen != null) - { - globeControl1.Globe.DestLayerFeatureAdd = layerGreen; - layerGreen.Editable = true; - } - break; - case "城市蓝线": - GSOLayer layerBlue = globeControl1.Globe.Layers.GetLayerByCaption(frm.citySevenLineType); - if (layerBlue != null) - { - globeControl1.Globe.DestLayerFeatureAdd = layerBlue; - layerBlue.Editable = true; - } - break; - case "城市紫线": - GSOLayer layerPurple = globeControl1.Globe.Layers.GetLayerByCaption(frm.citySevenLineType); - if (layerPurple != null) - { - globeControl1.Globe.DestLayerFeatureAdd = layerPurple; - layerPurple.Editable = true; - } - break; - case "城市黑线": - GSOLayer layerBlack = globeControl1.Globe.Layers.GetLayerByCaption(frm.citySevenLineType); - if (layerBlack != null) - { - globeControl1.Globe.DestLayerFeatureAdd = layerBlack; - layerBlack.Editable = true; - } - break; - } - } - } - /// - /// 七线审核 功能按钮 - /// - /// - /// - private void 七线审核buttonItem141_Click(object sender, EventArgs e) - { - FrmCityServerLineAnalysis frm = new FrmCityServerLineAnalysis(globeControl1, m_PipelineLayerNames); - frm.ShowDialog(this); - } - - /// /// 间距分析 开始分析按钮 分析绘制的七线和管线的距离是否符合标准 /// /// @@ -7666,25 +6509,6 @@ } } - - - /// - /// 管线自动缩进 菜单 - /// - /// - /// - private void 管线自动缩进buttonItem140_Click(object sender, EventArgs e) - { - FrmPipelineIndented frm = new FrmPipelineIndented(globeControl1, m_PipelineLayerNames, workwellLayerNames); - frm.ShowDialog(this); - } - - private void btnExportCADs_Click(object sender, EventArgs e) - { - - } - - /// /// 统计指定图层在指定范围内的所有feature对象 /// @@ -7755,8 +6579,6 @@ } - - //设置图层为隐藏 private void setLayerVisible(string layerName) { @@ -7765,27 +6587,7 @@ globeControl1.Globe.Refresh(); } - /// - /// 连接数据库 - /// - /// - /// - private void buttonItem129_Click(object sender, EventArgs e) - { - //保存日志 - LogManager.saveLog(Utility.userName, this.buttonItemSJGL4_1.Text); - - FrmDatabaseParaSetting2 frm = new FrmDatabaseParaSetting2(globeControl1); - if (frm.ShowDialog() == DialogResult.OK) - { - ds = FrmDatabaseParaSetting2.ds; - if (ds != null) - { - ds.IsCloseSaved = false; - } - } - } - + /// /// 清除渲染结果 /// @@ -7803,112 +6605,8 @@ layerTemp.RemoveAllFeature(); globeControl1.Refresh(); } - - /// - /// 绘制垂线 - /// - /// - /// - private void drawCLine(GSOPoint3d fpt, GSOPoint3d tpt) - { - GSOGeoPolyline3D pline = new GSOGeoPolyline3D(); - GSOPoint3ds pts = new GSOPoint3ds(); - pts.Add(fpt); - pts.Add(tpt); - pline.AddPart(pts); - - GSOGeoPoint3D fptg = new GSOGeoPoint3D(); - GSOGeoPoint3D tptg = new GSOGeoPoint3D(); - fptg.X = fpt.X; - fptg.Y = fpt.Y; - fptg.Z = 0; - tptg.X = tpt.X; - tptg.Y = tpt.Y; - tptg.Z = 0; - - GSOFeature gf = new GSOFeature(); - gf.Geometry = pline; - - globeControl1.Globe.MemoryLayer.AddFeature(gf); - - } - /// - /// 红线审核 - /// - /// - /// - private void buttonItem138_Click_2(object sender, EventArgs e) - { - - } - /// - /// 比较两个点是否是同一个点 - /// - /// - /// - /// - private bool comparePoint(GSOPoint3d pt1, GSOPoint3d pt2) - { - double x1 = 0; double y1 = 0; - double x2 = 0; double y2 = 0; - x1 = pt1.X; - y1 = pt1.Y; - x2 = pt2.X; - y2 = pt2.Y; - if ((x1 == x2) && (y1 == y2)) - { - return true; - } - return false; - } - /// - /// 获得点到线的垂线距离及垂点 - /// - /// - /// - /// - /// - private void comparePointLine(GSOPoint3d point, GSOGeoPolyline3D line, out double length, out GSOPoint3d pointChuiDian) - { - GSOPoint3d lineStartPoint = line[0][0]; - GSOPoint3d lineEndPoint = line[0][1]; - GSOGeoPolyline3D lineAB = new GSOGeoPolyline3D(); - GSOPoint3ds pointsAB = new GSOPoint3ds(); - pointsAB.Add(point); - pointsAB.Add(lineStartPoint); - lineAB.AddPart(pointsAB); - double lengthAB = lineAB.GetSpaceLength(false, 6378137.0); - double xieLvAB = getXieLu("", point.X, point.Y, lineStartPoint.X, lineStartPoint.Y); - double xieLvBC = getXieLu("", lineStartPoint.X, lineStartPoint.Y, lineEndPoint.X, lineEndPoint.Y); - - double tanABC = Math.Abs(xieLvAB - xieLvBC) / (1 + xieLvAB * xieLvBC); - double angle = Math.Atan(tanABC); - //if (angle > Math.PI / 2) //落在外边 - //{ - // length = 0; - //} - double lengthAD = lengthAB * Math.Sin(angle); - length = Math.Abs(lengthAD); - double lengthBD = lengthAB * Math.Cos(angle); - - GSOPoint2d point2dStart = Latlon_2_XYZ(lineStartPoint.X, lineStartPoint.Y); - double bBC = point2dStart.Y - xieLvBC * point2dStart.X; - GSOPoint2d point2dEnd = new GSOPoint2d(); - point2dEnd.X = point2dStart.X + 100; - point2dEnd.Y = point2dEnd.X * xieLvBC + bBC; - point2dEnd = XYZ_2_Latlon(point2dEnd.X, point2dEnd.Y); - - GSOPoint3d pointEnd = new GSOPoint3d(); - pointEnd.X = point2dEnd.X; - pointEnd.Y = point2dEnd.Y; - GSOGeoPolyline3D lineYanShen = new GSOGeoPolyline3D(); - GSOPoint3ds pointsYanShen = new GSOPoint3ds(); - pointsYanShen.Add(lineStartPoint); - pointsYanShen.Add(pointEnd); - lineYanShen.AddPart(pointsYanShen); - GSOGeoPolyline3D lineSegment = lineYanShen.GetSegment(0, lengthBD); - pointChuiDian = lineSegment[0][1]; - } + + /// /// 获得斜率 /// @@ -8044,255 +6742,6 @@ } /// - /// 获取与点相连的所有线以及线的点的集合 - /// - /// 选定的点所在的线 - /// 选定的点 - /// 面中不完全包含的除起点线之外所有的线 - /// 选定的点所在的点的集合 - /// 所有以选定线为起点的点的集合 - /// - private List getFeaturesPoints(GSOFeature featureSelect, GSOPoint3d lineStart, GSOFeatures selectFeatures, GSOPoint3ds ps, List listPS) - { - GSOFeatures fsStart = new GSOFeatures(); - for (int n = 0; n < selectFeatures.Length; n++) - { - if (featureSelect.ID == selectFeatures[n].ID) - { - continue; - } - GSOGeoPolyline3D newLine = selectFeatures[n].Geometry as GSOGeoPolyline3D; - if (newLine != null && newLine.PartCount > 0) - { - GSOPoint3d newLineStart = newLine[0][0]; - GSOPoint3d newLineEnd = newLine[0][newLine[0].Count - 1]; - if (lineStart.X == newLineEnd.X && lineStart.Y == newLineEnd.Y) - { - GSOPoint3ds psAdd = new GSOPoint3ds(); - for (int k = newLine[0].Count - 1; k >= 0; k--) - { - psAdd.Add(newLine[0][k]); - } - newLine[0] = psAdd; - fsStart.Add(selectFeatures[n]); - - } - else if (lineStart.X == newLineStart.X && lineStart.Y == newLineStart.Y) - { - fsStart.Add(selectFeatures[n]); - - } - } - } - if (fsStart.Length > 0) - { - for (int m = 0; m < fsStart.Length; m++) - { - GSOGeoPolyline3D lineFsStart = fsStart[m].Geometry as GSOGeoPolyline3D; - if (lineFsStart != null && lineFsStart.PartCount > 0) - { - GSOPoint3ds psAdd = ps.Clone(); - for (int k = 0; k < lineFsStart[0].Count; k++) - { - psAdd.Add(lineFsStart[0][k]); - } - listPS = getFeaturesPoints(fsStart[m], lineFsStart[0][lineFsStart[0].Count - 1], selectFeatures, psAdd, listPS); - } - } - } - else - { - listPS.Add(ps); - } - return listPS; - } - - /// - /// 获取切割面的线 - /// - /// 不完全包含在面中的所有线 - /// 完全包含在面中的所有线 - /// 线 - private GSOFeature getLineFromGSOFeatures(GSOFeatures features, GSOFeatures featuresTrue) - { - //1. 当线对象数组的长度为0时,返回空 - if (features.Length == 0) - { - return null; - } - //2. 当线对象数组的长度为1时,返回这条线 - if (features.Length == 1) - { - return features[0]; - } - //3. 当线对象数组的长度大于1时,计算所有线组成的最长线 - - //3.1 获取所有不完全包含在面中的对象selectFeatures - GSOFeatures selectFeatures = new GSOFeatures(); - for (int a = 0; a < features.Length; a++) - { - selectFeatures.Add(features[a].Clone()); - } - //3.2 删除features中完全包含在面中的线,获取和面的边界相交的线对象 - for (int a = 0; a < featuresTrue.Length; a++) - { - for (int b = 0; b < features.Length; b++) - { - if (featuresTrue[a].ID == features[b].ID) - { - features.Remove(b); - break; - } - } - } - //3.3 如果和面的边界相交的线的数量为0,返回空 - if (features.Length == 0) - { - return null; - } - //3.4 获取第一条和面的边界相交的线featureInOutPolygon - GSOFeature featureInOutPolygon = features[0]; - //3.5 从所有的线中删除featureInOutPolygon - for (int a = 0; a < selectFeatures.Length; a++) - { - if (selectFeatures[a].ID == featureInOutPolygon.ID) - { - selectFeatures.Remove(a); - break; - } - } - //listPS存储所有从featureInOutPolygon出发的点的集合 - List listPS = new List(); - //3.5 获取与featureInOutPolygon相连的线的集合 - GSOGeoPolyline3D line = featureInOutPolygon.Geometry as GSOGeoPolyline3D; - if (line != null && line.PartCount > 0) - { - GSOPoint3d lineStart = line[0][0]; - GSOPoint3d lineEnd = line[0][line[0].Count - 1]; - #region//获取和featureInOutPolygon的起点相连的线 - GSOFeatures fsStart = new GSOFeatures(); - for (int n = 0; n < selectFeatures.Length; n++) - { - GSOGeoPolyline3D newLine = selectFeatures[n].Geometry as GSOGeoPolyline3D; - if (newLine != null && newLine.PartCount > 0) - { - GSOPoint3d newLineStart = newLine[0][0]; - GSOPoint3d newLineEnd = newLine[0][newLine[0].Count - 1]; - if (lineStart.X == newLineEnd.X && lineStart.Y == newLineEnd.Y) - { - GSOPoint3ds psAdd = new GSOPoint3ds(); - for (int k = newLine[0].Count - 1; k >= 0; k--) - { - psAdd.Add(newLine[0][k]); - } - newLine[0] = psAdd; - fsStart.Add(selectFeatures[n]); - - } - else if (lineStart.X == newLineStart.X && lineStart.Y == newLineStart.Y) - { - fsStart.Add(selectFeatures[n]); - } - } - } - #endregion - - #region//获取和featureInOutPolygon的终点相连的线 - GSOFeatures fsEnd = new GSOFeatures(); - for (int n = 0; n < selectFeatures.Length; n++) - { - GSOGeoPolyline3D newLine = selectFeatures[n].Geometry as GSOGeoPolyline3D; - if (newLine != null && newLine.PartCount > 0) - { - GSOPoint3d newLineStart = newLine[0][0]; - GSOPoint3d newLineEnd = newLine[0][newLine[0].Count - 1]; - if (lineEnd.X == newLineStart.X && lineEnd.Y == newLineStart.Y) - { - fsEnd.Add(selectFeatures[n]); - - } - else if (lineEnd.X == newLineEnd.X && lineEnd.Y == newLineEnd.Y) - { - GSOPoint3ds psAdd = new GSOPoint3ds(); - for (int k = newLine[0].Count - 1; k >= 0; k--) - { - psAdd.Add(newLine[0][k]); - } - newLine[0] = psAdd; - fsEnd.Add(selectFeatures[n]); - - } - } - } - #endregion - - //3.6 将featureInOutPolygon的所有点和与之起点相连的线的所有点组成一个点的集合并添加到listPS中 - if (fsStart.Length > 0 && fsEnd.Length == 0) - { - for (int m = 0; m < fsStart.Length; m++) - { - GSOGeoPolyline3D lineFsStart = fsStart[m].Geometry as GSOGeoPolyline3D; - if (lineFsStart != null && lineFsStart.PartCount > 0) - { - GSOPoint3ds psAdd = new GSOPoint3ds(); - for (int k = line[0].Count - 1; k >= 0; k--) - { - psAdd.Add(line[0][k]); - } - for (int k = 0; k < lineFsStart[0].Count; k++) - { - psAdd.Add(lineFsStart[0][k]); - } - - listPS = getFeaturesPoints(fsStart[m], lineFsStart[0][lineFsStart[0].Count - 1], selectFeatures, psAdd, listPS); - - } - } - } - //3.6 将featureInOutPolygon的所有点和与之终点相连的线的所有点组成一个点的集合并添加到listPS中 - else if (fsStart.Length == 0 && fsEnd.Length > 0) - { - for (int n = 0; n < fsEnd.Length; n++) - { - GSOGeoPolyline3D lineFsEnd = fsEnd[n].Geometry as GSOGeoPolyline3D; - if (lineFsEnd != null && lineFsEnd.PartCount > 0) - { - GSOPoint3ds psAdd = new GSOPoint3ds(); - for (int k = 0; k < line[0].Count - 1; k++) - { - psAdd.Add(line[0][k]); - } - for (int k = 0; k < lineFsEnd[0].Count; k++) - { - psAdd.Add(lineFsEnd[0][k]); - } - //获取线fsEnd[n]的另一个端点相连的线并记录该线的点的集合 - listPS = getFeaturesPoints(fsEnd[n], lineFsEnd[0][lineFsEnd[0].Count - 1], selectFeatures, psAdd, listPS); - } - } - } - } - - //3.7 获取所有以featureInOutPolygon为起点的点的集合组成的线中的最长的线 - double maxLength = 0; - GSOFeature featureNew = new GSOFeature(); - for (int h = 0; h < listPS.Count; h++) - { - GSOGeoPolyline3D lineNew = new GSOGeoPolyline3D(); - lineNew.AddPart(listPS[h]); - GSOLabel label = new GSOLabel(); - label.Text = h.ToString(); - featureNew.Label = label; - double length = lineNew.GetSpaceLength(true, 6378137); - if (length > maxLength) - { - featureNew.Geometry = lineNew; - } - } - - return featureNew; - } - /// /// 更新最大最小状态 /// /// @@ -8340,219 +6789,6 @@ - private void buttonItem139_Click(object sender, EventArgs e) - { - - string filepath = ""; - //日志记录 - OpenFileDialog dlg = new OpenFileDialog(); - dlg.Filter = "矢量数据(*.shp)|*.shp|矢量数据(*.lgd)|*.lgd|全部支持格式(*.lgd,*.shp)|*.lgd;*.shp;"; - //dlg.Filter = "支持格式(*.lrp,*.tif,*.img,*.lrc,*.kml,*.lgd,*.shp,*.gft)|*.lrp;*.tif;*.img;*.lrc;*.kml;*.lgd;*.shp;*.gft|栅格数据(*.lrp)|*.lrp|栅格缓存(*.lrc)|*.lrc|KML数据(*.kml)|*.kml|矢量数据(*.lgd)|*.lgd|矢量缓存(*.gft)|*.gft|其它格式(*.*)|*.*||"; - dlg.Multiselect = true; - if (dlg.ShowDialog() == DialogResult.OK) - { - //自定义lprj文件名,从程序中复制一lprj文件。 - int bindex = dlg.FileName.Split('\\').Length; - string lastname = dlg.FileName.Split('\\')[bindex - 1]; - - for (int i = 0; i < dlg.FileNames.Length; i++) - { - string strDataPath = dlg.FileNames[i]; - filepath = strDataPath; - - GSOLayer layer = globeControl1.Globe.Layers.Add(strDataPath); - - } - - } - //放大到红线 - - - // globeControl1.Globe.Layers.MoveTo(0, globeControl1.Globe.Layers.Count - 1); - // globeControl1.Globe.Layers.MoveTo(0,4); - globeControl1.Refresh(); - - - } - /// - /// - /// - /// - /// - private void buttonItem142_Click(object sender, EventArgs e) - { - //获得红线polygon - //GSOLayer layerSevenLine = globeControl1.Globe.Layers.GetLayerByCaption(redlinelayername); - - GSOLayer layerSevenLine = globeControl1.Globe.Layers.Add("D:\\data\\歌林小镇shp\\test.shp"); - //获得红线结果列表 - ArrayList rrLists = new ArrayList(); - - //if (redlinelayername != "") - { - GSOFeatures fs = layerSevenLine.GetAllFeatures(); - int len = fs.Length; - - GSOGeoPolygon3D sevenPolygon = new GSOGeoPolygon3D(); - for (int k = 0; k < len; k++) - {//多根红线 - ///////生成红线区域/////// - GSOFeature featSevenLine = layerSevenLine.GetAt(k); - GSOGeoPolyline3D sevenLine = featSevenLine.Geometry as GSOGeoPolyline3D; - - List sevenParts = new List(); - for (int i = 0; i < sevenLine.PartCount; i++) - { - sevenParts.Add(sevenLine[i]); - } - for (int i = 0; i < sevenParts.Count; i++) - { - sevenPolygon.AddPart((GSOPoint3ds)sevenParts[i]); - } - /////拼出红线多边形over////// - - } - //GSOLayer layer = globeControl1.Globe.Layers.GetLayerByCaption("天然气管线"); - - GSOLayer layer = globeControl1.Globe.Layers.Add("C:\\Users\\nn-203\\Desktop\\xiaobai\\test.lgd"); - //线切割面定义,输出用 - GSOFeatures resFeats = new GSOFeatures(); - int resultstyle = 0; - //管线切割红线区域后,面积较小的区域 - GSOGeoPolygon3D restPoly = new GSOGeoPolygon3D(); - List inpts = new List(); - if (layer != null) - { - //红线区域 - GSOFeature sevenfeature = new GSOFeature(); - sevenfeature.Geometry = sevenPolygon; - - //获取不完全包含在面中的所有线 - GSOFeatures feats = layer.FindFeaturesInPolygon(sevenPolygon, false); - //获取完全包含在面中的所有线 - GSOFeatures featsTrue = layer.FindFeaturesInPolygon(sevenPolygon, true); - //获取面中所有对象组成的切割面的长线 - GSOFeature feature = new GSOFeature(); - - feature = getLineFromGSOFeatures(feats, featsTrue);//管线多个feature拼成一个feature - - //globeControl1.Globe.MemoryLayer.AddFeature(feature); - //globeControl1.Globe.MemoryLayer.AddFeature(sevenfeature); - if (feature != null) - { - //线切割面,输出 - //feature.HighLight = true; - GSODataEngineUtility.GSLineClipPolygon(feature, sevenfeature, out resFeats, out resultstyle); - } - else - { - MessageBox.Show("没有找到切割面的线对象!"); - } - ////////////////绘制分割后的多边形/////////////// - for (int a = 0; a < resFeats.Length; a++) - { - - GSOFeature gf = resFeats[1]; - globeControl1.Globe.MemoryLayer.AddFeature(gf); - - } - } - - - } - } - - private void buttonItem143_Click(object sender, EventArgs e) - { - //获得红线polygon - GSOLayer layerSevenLine = globeControl1.Globe.Layers.Add("d:\\lineAndPolygon.lgd"); - GSOLayer layerSevenLine2 = globeControl1.Globe.Layers.GetLayerByCaption("d:\\lineAndPolygon.lgd"); - //获得红线结果列表 - ArrayList rrLists = new ArrayList(); - - - // if (redlinelayername != "") - { - GSOFeatures fs = layerSevenLine.GetAllFeatures(); - int len = fs.Length; - - GSOGeoPolyline3D linetest = new GSOGeoPolyline3D(); - GSOGeoPolygon3D sevenPolygon = new GSOGeoPolygon3D(); - - GSOFeature linefeat = fs.FindByID(2); - //linefeat.Geometry = linetest; - GSOFeature polyfeat = fs.FindByID(1); - //polyfeat.Geometry = sevenPolygon; - - //线切割面定义,输出用 - GSOFeatures resFeats = new GSOFeatures(); - int resultstyle = 0; - GSODataEngineUtility.GSLineClipPolygon(linefeat, polyfeat, out resFeats, out resultstyle); - - ////////////////绘制分割后的多边形/////////////// - for (int a = 0; a < resFeats.Length; a++) - { - - GSOFeature gf = resFeats[0]; - globeControl1.Globe.MemoryLayer.AddFeature(gf); - - } - ////把红线切成一段段的线段,获得切前的红线点集 - List redpts = new List();//切前的红线点集合 - for (int i = 0; i < linetest.PartCount; i++) - { - GSOPoint3ds partP = linetest[i]; - for (int j = 0; j < partP.Count; j++) - { - redpts.Add(partP[j]); - } - } - - List redpts2 = new List();//切前的红线点集合 - for (int i = 0; i < sevenPolygon.PartCount; i++) - { - GSOPoint3ds partP = sevenPolygon[i]; - for (int j = 0; j < partP.Count; j++) - { - redpts2.Add(partP[j]); - } - } - } - } - /// - /// 增加用户手册下载连接 - /// - /// - /// - Cyberpipe.udfiles.UpDownFile UDF = new udfiles.UpDownFile(Utility.udserviceurl); - string dir_Ok = "C:\\Users\\nn-203\\Desktop"; - private void button1_Click(object sender, EventArgs e) - { - if (folderBrowserDialog1.ShowDialog() == DialogResult.OK) //打洙?开a文?件t夹D对?话°框ò - { - dir_Ok = folderBrowserDialog1.SelectedPath; //显?示?选?择?的?文?件t夹D路·径? - - //tempstr = folderBrowserDialog1.SelectedPath; //存?储洹?选?择?的?文?件t夹D路·径? - - } - - Cyberpipe.PED_logicfile.PED_Affair.Redact_D = Utility.uploadpath + "\\SFiles\\UserHbook\\说明.docx"; - if (File.Exists(dir_Ok + "\\" + Files_Name(Cyberpipe.PED_logicfile.PED_Affair.Redact_D, 1))) - { - if (MessageBox.Show("文件夹下有同名文件,是否替换?", "提示", MessageBoxButtons.YesNo, MessageBoxIcon.Information) == DialogResult.No) ; - - } - byte[] file = UDF.Down(Cyberpipe.PED_logicfile.PED_Affair.Redact_D); - FileStream pFileSream = new FileStream(dir_Ok + "\\说明.docx", FileMode.OpenOrCreate); - pFileSream.Write(file, 0, file.Length); - pFileSream.Close(); - if (File.Exists(dir_Ok + "\\" + Files_Name(Cyberpipe.PED_logicfile.PED_Affair.Redact_D, 1)) == true) - { - MessageBox.Show("文件导出成功!"); - } - //PEDAClass.Folder_Handle(dir_Ok + "\\" + PEDAClass.Files_Name(Cyberpipe.PED_logicfile.PED_Affair.Redact_D, 0), Cyberpipe.PED_logicfile.PED_Affair.Redact_D, "", 0); - - } /// /// 获取文件或文件夹的名称 /// @@ -8575,33 +6811,6 @@ return DF_Name; } - private void toolStripDropDownButton1_Click(object sender, EventArgs e) - { - if (folderBrowserDialog1.ShowDialog() == DialogResult.OK) //打洙?开a文?件t夹D对?话°框ò - { - dir_Ok = folderBrowserDialog1.SelectedPath; //显?示?选?择?的?文?件t夹D路·径? - - //tempstr = folderBrowserDialog1.SelectedPath; //存?储洹?选?择?的?文?件t夹D路·径? - - - Cyberpipe.PED_logicfile.PED_Affair.Redact_D = Utility.uploadpath + "\\SFiles\\UserHbook\\说明.docx"; - if (File.Exists(dir_Ok + "\\" + Files_Name(Cyberpipe.PED_logicfile.PED_Affair.Redact_D, 1))) - { - if (MessageBox.Show("文件夹下有同名文件,是否替换?", "提示", MessageBoxButtons.YesNo, MessageBoxIcon.Information) == DialogResult.No) ; - - } - byte[] file = UDF.Down(Cyberpipe.PED_logicfile.PED_Affair.Redact_D); - FileStream pFileSream = new FileStream(dir_Ok + "\\说明.docx", FileMode.OpenOrCreate); - pFileSream.Write(file, 0, file.Length); - pFileSream.Close(); - if (File.Exists(dir_Ok + "\\" + Files_Name(Cyberpipe.PED_logicfile.PED_Affair.Redact_D, 1)) == true) - { - MessageBox.Show("文件导出成功!"); - } - - } - } - /// /// 空间查询 /// @@ -9792,7 +8001,7 @@ GSOLayer resLayer = null; GSOFeature resFeature = null; globeControl1.Globe.GetSelectObject(0, out resFeature, out resLayer); - + if (resFeature == null) return; GSOGeoPolyline3D line1 = resFeature.Geometry as GSOGeoPolyline3D; if (line1 == null) { @@ -9876,7 +8085,7 @@ GSOLayer resLayer = null; GSOFeature resFeature = null; globeControl1.Globe.GetSelectObject(0, out resFeature, out resLayer); - + if (resFeature == null) return; GSOGeoPolyline3D line1 = resFeature.Geometry as GSOGeoPolyline3D; if (line1 == null) { @@ -9891,7 +8100,8 @@ } GSOFeatures feats = globeControl1.Globe.MemoryLayer.GetFeatureByName("粒子要素", true); - if (feats.Length > 0) + + if (feats!=null&&feats.Length > 0) globeControl1.Globe.MemoryLayer.RemoveFeatureByID(feats[0].ID); //if (emitterFeature != null) //{ @@ -11121,88 +9331,6 @@ } private int connectServerCount = 0; - - /// - /// 还原球到实测库 - /// - private void refreshGlobe1() - { - //添加实测库图层已有图层 - int servernum = 0; - //1.清除global1上 - for (int i = globeControl1.Globe.Layers.Count - 1; i >= 0; i--) - { - GSOLayer layer = globeControl1.Globe.Layers[i]; - if (!layer.Name.Contains("fttp:")) - { - layer.Dataset.Close();//清除内存 - globeControl1.Globe.Layers.Remove(layer); - } - else - { - servernum++; - } - } - - //globeControl1.Globe.ConnectServer(Utility.serverip, Utility.serverport, "", ""); //加载locaServer中的数据 - - //2.添加实测库图层 - string[] markerStrs = new string[9]; - markerStrs[0] = "标高标注"; - markerStrs[1] = "管径标注"; - markerStrs[2] = "埋深标注"; - markerStrs[3] = "坐标标注"; - markerStrs[4] = "坡度标注"; - markerStrs[5] = "属性标注"; - markerStrs[6] = "自定义标注"; - markerStrs[7] = "距离标注"; - markerStrs[8] = "扯旗标注"; - for (int i = 0; i < markerStrs.Length; i++) - { - if (File.Exists(Application.StartupPath + "\\标注管理\\" + markerStrs[i] + ".lgd")) - { - GSOLayer markerLayer = globeControl1.Globe.Layers.Add(Application.StartupPath + "\\标注管理\\" + markerStrs[i] + ".lgd"); - } - } - - for (int i = 0; i < g1layername.Count; i++) - { - string g1name = g1layername[i]; - GSODataset datasetg1 = Utility.dataSource.GetDatasetByName(g1name); - GSOLayer templayer = globeControl1.Globe.Layers.Add(datasetg1); - templayer.MaxVisibleAltitude = -1; - } - layerTemp = globeControl1.Globe.Layers.Add(Application.StartupPath + "\\tempLgdData.lgd"); - globeControl1.Globe.Layers.Add(Application.StartupPath + "/城市七线/城市红线.lgd"); - globeControl1.Globe.Layers.Add(Application.StartupPath + "/城市七线/城市橙线.lgd"); - globeControl1.Globe.Layers.Add(Application.StartupPath + "/城市七线/城市黄线.lgd"); - globeControl1.Globe.Layers.Add(Application.StartupPath + "/城市七线/城市绿线.lgd"); - globeControl1.Globe.Layers.Add(Application.StartupPath + "/城市七线/城市蓝线.lgd"); - globeControl1.Globe.Layers.Add(Application.StartupPath + "/城市七线/城市紫线.lgd"); - globeControl1.Globe.Layers.Add(Application.StartupPath + "/城市七线/城市黑线.lgd"); - globeControl1.Globe.Layers.Add(Application.StartupPath + "/隧道.lgd"); - - //移动server的数据图层 - for (int i = 0; i < servernum; i++) - { - globeControl1.Globe.Layers.MoveTo(globeControl1.Globe.Layers.Count - 1, 0); - } - - if (layerManagerNode.Nodes.Count > 0) - { - for (int i = layerManagerNode.Nodes.Count - 1; i >= 0; i--) - { - layerManagerNode.Nodes[i].Remove(); - - } - } - - - - globeControl1.Refresh(); - - } - /// /// 碰撞审查 /// @@ -11476,31 +9604,7 @@ // } //} #endregion - /// - /// 数据质量检查 - /// - /// - /// - private void buttonItemSJGL2_Click(object sender, EventArgs e) - { - //日志记录 - LogManager.saveLog(Utility.userName, this.buttonItemSJGL2.Text); - FrmValiData frm = new FrmValiData(globeControl1); - frm.ShowDialog(); - } - /// - /// 数据预处理 - /// - /// - /// - private void buttonItemSJGL3_Click(object sender, EventArgs e) - { - //保存日志 - LogManager.saveLog(Utility.userName, this.buttonItemSJGL3.Text); - FrmEditShapeFile frm = new FrmEditShapeFile(globeControl1); - frm.ShowDialog(this); - } /// /// 连接数据库 /// @@ -12251,60 +10355,6 @@ List lineStruct = new List(); GSOFeature featureSelected = null; - private void AddDatagridView(DataTable table) - { - - if (table != null && table.Rows.Count > 0) - { - dataGridViewX1.DataSource = table; - panelOfTable.Visible = true; - panelOfTable.Height = 200; - toolStripNumbers.Text = "红线审核结果"; - toolStripFeatureLength.Text = " 共有:" + table.Rows.Count + "条"; - } - else - { - - } - - } - - /// - /// 去除集合中重复的管线 - /// - /// - /// - /// - private GSOFeatures getFeaturesByFilter(GSOFeatures features, string fieldName) - { - if (features == null) - { - return null; - } - GSOFeatures featuresGet = new GSOFeatures(); - for (int i = 0; i < features.Length; i++) - { - GSOFeature featureFromFS = features[i]; - string fieldValueFromFS = featureFromFS.GetValue(fieldName).ToString().Trim(); - bool isHas = false; - for (int j = featuresGet.Length - 1; j >= 0; j--) - { - GSOFeature featureFromFSGet = featuresGet[j]; - string fieldValueFromFSGet = featureFromFSGet.GetValue(fieldName).ToString().Trim(); - if (fieldValueFromFS.Equals(fieldValueFromFSGet)) - { - isHas = true; - break; - } - } - if (isHas == false) - { - featuresGet.Add(featureFromFS.Clone()); - } - } - return featuresGet; - } - /// /// 数据管理导入文件 /// @@ -12440,138 +10490,7 @@ // //MessageBox.Show("系统运行错误:" + ex.ToString(), "错误", MessageBoxButtons.OK, MessageBoxIcon.Error); // } //} - - - /// - /// 标识器全区域统计 - /// - /// - /// - private void 标识器分类统计ToolStripMenuItem_Click(object sender, EventArgs e) - { - globeControl1.Globe.Action = EnumAction3D.ActionNull; - FrmBSQStatis bsqStatis = new FrmBSQStatis(); - bsqStatis.Show(this); - } - /// - /// 标识器绘制区域统计 - /// - /// - /// - private void 标识器分类统计ToolStripMenuItem1_Click(object sender, EventArgs e) - { - trackflag = "BSQDuoBianXiangStatis"; - globeControl1.Globe.Action = EnumAction3D.TrackPolygon; - } - - - #region 保存和加载审核库加载的图层 - private void saveLayerList(TreeNodeCollection treeNodeList) - { - string configPath = Application.StartupPath + "\\configLayerList.xml"; - try - { - XmlDocument doc = new XmlDocument(); - doc.Load(configPath); - XmlNode dbParams = doc.SelectSingleNode("Params/dbparams"); - XmlNode dbLayers = doc.SelectSingleNode("Params/dblayers"); - XmlNode layers = doc.SelectSingleNode("Params/layers"); - dbParams.RemoveAll(); - dbLayers.RemoveAll(); - layers.RemoveAll(); - - List listDS = new List(); - String shDatasourceName = Utility.sgdbip + "/" + Utility.sgdbname + "_" + Utility.sgdbuser; - bool flag = false; - - for (int i = 0; i < globeControl1.Globe.DataManager.DataSourceCount; i++) - { - GSODataSource ds = globeControl1.Globe.DataManager.GetDataSourceAt(i); - if (ds != null && ds.Type == EnumDataSourceType.SqlServer || ds.Type == EnumDataSourceType.Oracle) - { - if (ds.Name == shDatasourceName) - { - //防止因为多次连接同一个数据库 - if (flag == true) - { - break; - } - flag = true; - listDS.Add(ds); - GSODataSourceCnn conn = ds.GetConnectionInfo(); - - XmlElement dbparam = doc.CreateElement("shdbparam"); - XmlElement ip = doc.CreateElement("ship"); - ip.InnerText = conn.Server; - - XmlElement dbname = doc.CreateElement("shdbname"); - dbname.InnerText = conn.Database; - - XmlElement username = doc.CreateElement("shusername"); - username.InnerText = conn.User; - - XmlElement password = doc.CreateElement("shpassword"); - password.InnerText = conn.Password; - - XmlElement type = doc.CreateElement("shtype"); - if (ds.Type == EnumDataSourceType.SqlServer) - { - type.InnerText = "sqlserver"; - } - else - { - type.InnerText = "oracle"; - } - - dbparam.AppendChild(ip); - dbparam.AppendChild(dbname); - dbparam.AppendChild(username); - dbparam.AppendChild(password); - dbparam.AppendChild(type); - dbParams.AppendChild(dbparam); - } - - } - } - - for (int i = 0; i < treeNodeList.Count; i++) - { - GSOLayer layer = treeNodeList[i].Tag as GSOLayer; - if (Path.GetExtension(layer.Name) == "") - { - XmlElement dbLayer = doc.CreateElement("dblayer"); - XmlAttribute attri = doc.CreateAttribute("dbindex"); - for (int j = 0; j < listDS.Count; j++) - { - if (layer.Dataset.DataSource.Name == listDS[j].Name) - { - attri.Value = j.ToString(); - break; - } - } - dbLayer.Attributes.Append(attri); - dbLayer.InnerText = layer.Name; - - dbLayers.AppendChild(dbLayer); - } - else - { - XmlElement dbLayer = doc.CreateElement("layer"); - dbLayer.InnerText = layer.Name; - layers.AppendChild(dbLayer); - } - } - - doc.Save(configPath); - } - catch (Exception e) - { - - } - } - - #endregion - + private void buttonItem_TaskManager_Click(object sender, EventArgs e) { if (Form_TaksManager.IS_OPEN) diff --git a/MainFrm.designer.cs b/MainFrm.designer.cs index 233ef8c..97b8299 100644 --- a/MainFrm.designer.cs +++ b/MainFrm.designer.cs @@ -82,6 +82,7 @@ this.sideBar1 = new DevComponents.DotNetBar.SideBar(); this.panelEx3 = new DevComponents.DotNetBar.PanelEx(); this.layerSensorTree = new System.Windows.Forms.TreeView(); + this.layerTree = new Cyberpipe.MyTreeView(); this.sideBarPanelItem3 = new DevComponents.DotNetBar.SideBarPanelItem(); this.controlContainerItem3 = new DevComponents.DotNetBar.ControlContainerItem(); this.sideBarPanelItem4 = new DevComponents.DotNetBar.SideBarPanelItem(); @@ -365,30 +366,26 @@ this.可编辑ToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); this.保存ToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); this.ribbonControl1 = new DevComponents.DotNetBar.RibbonControl(); - this.ribbonPanel1 = new DevComponents.DotNetBar.RibbonPanel(); - this.ribbonBar21 = new DevComponents.DotNetBar.RibbonBar(); - this.buttonItem87 = new DevComponents.DotNetBar.ButtonItem(); - this.buttonItem88 = new DevComponents.DotNetBar.ButtonItem(); - this.buttonItem27 = new DevComponents.DotNetBar.ButtonItem(); - this.buttonItem91 = new DevComponents.DotNetBar.ButtonItem(); - this.buttonItem1 = new DevComponents.DotNetBar.ButtonItem(); - this.btnlegendSet = new DevComponents.DotNetBar.ButtonItem(); - this.buttonItem89 = new DevComponents.DotNetBar.ButtonItem(); - this.ribbonPanel7 = new DevComponents.DotNetBar.RibbonPanel(); - this.ribbonBar5 = new DevComponents.DotNetBar.RibbonBar(); - this.btn_flag = new DevComponents.DotNetBar.ButtonItem(); - this.slider4ground = new DevComponents.DotNetBar.SliderItem(); - this.ribbonPanel2 = new DevComponents.DotNetBar.RibbonPanel(); - this.ribbonBar4 = new DevComponents.DotNetBar.RibbonBar(); - this.buttonItem_TaskManager = new DevComponents.DotNetBar.ButtonItem(); - this.buttonItem_OnlineTask = new DevComponents.DotNetBar.ButtonItem(); - this.buttonItem_Event = new DevComponents.DotNetBar.ButtonItem(); this.ribbonPanel3 = new DevComponents.DotNetBar.RibbonPanel(); this.ribbonBar3 = new DevComponents.DotNetBar.RibbonBar(); this.btn_device = new DevComponents.DotNetBar.ButtonItem(); this.btn_Person = new DevComponents.DotNetBar.ButtonItem(); this.btn_constructMap = new DevComponents.DotNetBar.ButtonItem(); this.buttonItem9 = new DevComponents.DotNetBar.ButtonItem(); + this.ribbonPanel2 = new DevComponents.DotNetBar.RibbonPanel(); + this.ribbonBar4 = new DevComponents.DotNetBar.RibbonBar(); + this.buttonItem_TaskManager = new DevComponents.DotNetBar.ButtonItem(); + this.buttonItem_OnlineTask = new DevComponents.DotNetBar.ButtonItem(); + this.buttonItem_Event = new DevComponents.DotNetBar.ButtonItem(); + this.ribbonPanel1 = new DevComponents.DotNetBar.RibbonPanel(); + this.ribbonBar21 = new DevComponents.DotNetBar.RibbonBar(); + this.buttonItem87 = new DevComponents.DotNetBar.ButtonItem(); + this.buttonItem88 = new DevComponents.DotNetBar.ButtonItem(); + this.buttonItem27 = new DevComponents.DotNetBar.ButtonItem(); + this.buttonItem1 = new DevComponents.DotNetBar.ButtonItem(); + this.buttonItem91 = new DevComponents.DotNetBar.ButtonItem(); + this.btnlegendSet = new DevComponents.DotNetBar.ButtonItem(); + this.buttonItem89 = new DevComponents.DotNetBar.ButtonItem(); this.ribbonPanel8 = new DevComponents.DotNetBar.RibbonPanel(); this.ribbonBar_UserInfo = new DevComponents.DotNetBar.RibbonBar(); this.btn_user_info = new DevComponents.DotNetBar.ButtonItem(); @@ -398,6 +395,10 @@ this.btn_user_role = new DevComponents.DotNetBar.ButtonItem(); this.btn_password_edit = new DevComponents.DotNetBar.ButtonItem(); this.btn_reset_password = new DevComponents.DotNetBar.ButtonItem(); + this.ribbonPanel7 = new DevComponents.DotNetBar.RibbonPanel(); + this.ribbonBar5 = new DevComponents.DotNetBar.RibbonBar(); + this.btn_flag = new DevComponents.DotNetBar.ButtonItem(); + this.slider4ground = new DevComponents.DotNetBar.SliderItem(); this.ribbonPanel15 = new DevComponents.DotNetBar.RibbonPanel(); this.ribbonBar20 = new DevComponents.DotNetBar.RibbonBar(); this.buttonItemSJGL = new DevComponents.DotNetBar.ButtonItem(); @@ -610,7 +611,6 @@ this.buttonItem84 = new DevComponents.DotNetBar.ButtonItem(); this.buttonItem75 = new DevComponents.DotNetBar.ButtonItem(); this.buttonItem76 = new DevComponents.DotNetBar.ButtonItem(); - this.layerTree = new Cyberpipe.MyTreeView(); this.statusStrip1.SuspendLayout(); this.sideBar1.SuspendLayout(); this.panelEx3.SuspendLayout(); @@ -647,11 +647,11 @@ this.contextMenuStrip3.SuspendLayout(); this.contextMenuStripDeleteLayerNode.SuspendLayout(); this.ribbonControl1.SuspendLayout(); - this.ribbonPanel1.SuspendLayout(); - this.ribbonPanel7.SuspendLayout(); - this.ribbonPanel2.SuspendLayout(); this.ribbonPanel3.SuspendLayout(); + this.ribbonPanel2.SuspendLayout(); + this.ribbonPanel1.SuspendLayout(); this.ribbonPanel8.SuspendLayout(); + this.ribbonPanel7.SuspendLayout(); this.ribbonPanel15.SuspendLayout(); ((System.ComponentModel.ISupportInitialize)(this.pictureBox1)).BeginInit(); this.SuspendLayout(); @@ -813,7 +813,6 @@ this.toolStripDropDownButton1.Size = new System.Drawing.Size(45, 21); this.toolStripDropDownButton1.Text = "帮助"; this.toolStripDropDownButton1.Visible = false; - this.toolStripDropDownButton1.Click += new System.EventHandler(this.toolStripDropDownButton1_Click); // // controlContainerItem1 // @@ -1047,6 +1046,16 @@ this.layerSensorTree.AfterCheck += new System.Windows.Forms.TreeViewEventHandler(this.layerMarkerTree_AfterCheck); this.layerSensorTree.NodeMouseClick += new System.Windows.Forms.TreeNodeMouseClickEventHandler(this.layerMarkerTree_NodeMouseClick); // + // layerTree + // + this.layerTree.CheckBoxes = true; + this.layerTree.ItemHeight = 18; + this.layerTree.Location = new System.Drawing.Point(30, 78); + this.layerTree.Name = "layerTree"; + this.layerTree.Size = new System.Drawing.Size(121, 97); + this.layerTree.TabIndex = 1; + this.layerTree.AfterCheck += new System.Windows.Forms.TreeViewEventHandler(this.layerTree_AfterCheck); + // // sideBarPanelItem3 // this.sideBarPanelItem3.FontBold = true; @@ -2966,28 +2975,28 @@ // 平移对象ToolStripMenuItem // this.平移对象ToolStripMenuItem.Name = "平移对象ToolStripMenuItem"; - this.平移对象ToolStripMenuItem.Size = new System.Drawing.Size(152, 22); + this.平移对象ToolStripMenuItem.Size = new System.Drawing.Size(124, 22); this.平移对象ToolStripMenuItem.Text = "平移对象"; this.平移对象ToolStripMenuItem.Click += new System.EventHandler(this.buttonItemBJ6_Click); // // 升降对象ToolStripMenuItem // this.升降对象ToolStripMenuItem.Name = "升降对象ToolStripMenuItem"; - this.升降对象ToolStripMenuItem.Size = new System.Drawing.Size(152, 22); + this.升降对象ToolStripMenuItem.Size = new System.Drawing.Size(124, 22); this.升降对象ToolStripMenuItem.Text = "升降对象"; this.升降对象ToolStripMenuItem.Click += new System.EventHandler(this.buttonItemBJ7_Click); // // 旋转对象ToolStripMenuItem // this.旋转对象ToolStripMenuItem.Name = "旋转对象ToolStripMenuItem"; - this.旋转对象ToolStripMenuItem.Size = new System.Drawing.Size(152, 22); + this.旋转对象ToolStripMenuItem.Size = new System.Drawing.Size(124, 22); this.旋转对象ToolStripMenuItem.Text = "旋转对象"; this.旋转对象ToolStripMenuItem.Click += new System.EventHandler(this.buttonItemBJ8_Click); // // 连接管段ToolStripMenuItem // this.连接管段ToolStripMenuItem.Name = "连接管段ToolStripMenuItem"; - this.连接管段ToolStripMenuItem.Size = new System.Drawing.Size(152, 22); + this.连接管段ToolStripMenuItem.Size = new System.Drawing.Size(124, 22); this.连接管段ToolStripMenuItem.Text = "连接管段"; this.连接管段ToolStripMenuItem.Click += new System.EventHandler(this.buttonItemBJ9_Click); // @@ -2997,34 +3006,34 @@ this.导出CADToolStripMenuItem, this.导出文件ToolStripMenuItem1}); this.导出文件ToolStripMenuItem.Name = "导出文件ToolStripMenuItem"; - this.导出文件ToolStripMenuItem.Size = new System.Drawing.Size(152, 22); + this.导出文件ToolStripMenuItem.Size = new System.Drawing.Size(124, 22); this.导出文件ToolStripMenuItem.Text = "导出矢量"; // // 导出CADToolStripMenuItem // this.导出CADToolStripMenuItem.Name = "导出CADToolStripMenuItem"; - this.导出CADToolStripMenuItem.Size = new System.Drawing.Size(152, 22); + this.导出CADToolStripMenuItem.Size = new System.Drawing.Size(125, 22); this.导出CADToolStripMenuItem.Text = "导出CAD"; this.导出CADToolStripMenuItem.Click += new System.EventHandler(this.buttonItemBJ10_1_Click); // // 导出文件ToolStripMenuItem1 // this.导出文件ToolStripMenuItem1.Name = "导出文件ToolStripMenuItem1"; - this.导出文件ToolStripMenuItem1.Size = new System.Drawing.Size(152, 22); + this.导出文件ToolStripMenuItem1.Size = new System.Drawing.Size(125, 22); this.导出文件ToolStripMenuItem1.Text = "导出文件"; this.导出文件ToolStripMenuItem1.Click += new System.EventHandler(this.buttonItemBJ10_2_Click); // // 前进ToolStripMenuItem // this.前进ToolStripMenuItem.Name = "前进ToolStripMenuItem"; - this.前进ToolStripMenuItem.Size = new System.Drawing.Size(152, 22); + this.前进ToolStripMenuItem.Size = new System.Drawing.Size(124, 22); this.前进ToolStripMenuItem.Text = "前进"; this.前进ToolStripMenuItem.Click += new System.EventHandler(this.buttonItemBJ12_Click); // // 删除模型ToolStripMenuItem // this.删除模型ToolStripMenuItem.Name = "删除模型ToolStripMenuItem"; - this.删除模型ToolStripMenuItem.Size = new System.Drawing.Size(152, 22); + this.删除模型ToolStripMenuItem.Size = new System.Drawing.Size(124, 22); this.删除模型ToolStripMenuItem.Text = "后退"; this.删除模型ToolStripMenuItem.Click += new System.EventHandler(this.buttonItemBJ11_Click); // @@ -4160,6 +4169,198 @@ this.ribbonControl1.Text = "ribbonControl1"; this.ribbonControl1.UseCustomizeDialog = false; // + // ribbonPanel3 + // + this.ribbonPanel3.ColorSchemeStyle = DevComponents.DotNetBar.eDotNetBarStyle.StyleManagerControlled; + this.ribbonPanel3.Controls.Add(this.ribbonBar3); + this.ribbonPanel3.Dock = System.Windows.Forms.DockStyle.Fill; + this.ribbonPanel3.Location = new System.Drawing.Point(0, 33); + this.ribbonPanel3.Name = "ribbonPanel3"; + this.ribbonPanel3.Padding = new System.Windows.Forms.Padding(3, 0, 3, 3); + this.ribbonPanel3.Size = new System.Drawing.Size(1328, 62); + // + // + // + this.ribbonPanel3.Style.Class = ""; + this.ribbonPanel3.Style.CornerType = DevComponents.DotNetBar.eCornerType.Square; + // + // + // + this.ribbonPanel3.StyleMouseDown.Class = ""; + this.ribbonPanel3.StyleMouseDown.CornerType = DevComponents.DotNetBar.eCornerType.Square; + // + // + // + this.ribbonPanel3.StyleMouseOver.Class = ""; + this.ribbonPanel3.StyleMouseOver.CornerType = DevComponents.DotNetBar.eCornerType.Square; + this.ribbonPanel3.TabIndex = 40; + // + // ribbonBar3 + // + this.ribbonBar3.AutoOverflowEnabled = true; + // + // + // + this.ribbonBar3.BackgroundMouseOverStyle.Class = ""; + this.ribbonBar3.BackgroundMouseOverStyle.CornerType = DevComponents.DotNetBar.eCornerType.Square; + // + // + // + this.ribbonBar3.BackgroundStyle.Class = ""; + this.ribbonBar3.BackgroundStyle.CornerType = DevComponents.DotNetBar.eCornerType.Square; + this.ribbonBar3.ContainerControlProcessDialogKey = true; + this.ribbonBar3.Dock = System.Windows.Forms.DockStyle.Left; + this.ribbonBar3.Items.AddRange(new DevComponents.DotNetBar.BaseItem[] { + this.btn_device, + this.btn_Person, + this.btn_constructMap, + this.buttonItem9}); + this.ribbonBar3.Location = new System.Drawing.Point(3, 0); + this.ribbonBar3.Name = "ribbonBar3"; + this.ribbonBar3.Size = new System.Drawing.Size(378, 59); + this.ribbonBar3.Style = DevComponents.DotNetBar.eDotNetBarStyle.StyleManagerControlled; + this.ribbonBar3.TabIndex = 0; + // + // + // + this.ribbonBar3.TitleStyle.Class = ""; + this.ribbonBar3.TitleStyle.CornerType = DevComponents.DotNetBar.eCornerType.Square; + // + // + // + this.ribbonBar3.TitleStyleMouseOver.Class = ""; + this.ribbonBar3.TitleStyleMouseOver.CornerType = DevComponents.DotNetBar.eCornerType.Square; + this.ribbonBar3.TitleVisible = false; + // + // btn_device + // + this.btn_device.ButtonStyle = DevComponents.DotNetBar.eButtonStyle.ImageAndText; + this.btn_device.Image = global::Cyberpipe.Properties.Resources._24X24__2__02; + this.btn_device.ImagePosition = DevComponents.DotNetBar.eImagePosition.Top; + this.btn_device.Name = "btn_device"; + this.btn_device.SubItemsExpandWidth = 14; + this.btn_device.Text = "探测仪管理"; + this.btn_device.Click += new System.EventHandler(this.btn_device_Click); + // + // btn_Person + // + this.btn_Person.ButtonStyle = DevComponents.DotNetBar.eButtonStyle.ImageAndText; + this.btn_Person.Image = global::Cyberpipe.Properties.Resources._24x24icon_05_hover1; + this.btn_Person.ImagePosition = DevComponents.DotNetBar.eImagePosition.Top; + this.btn_Person.Name = "btn_Person"; + this.btn_Person.SubItemsExpandWidth = 14; + this.btn_Person.Text = "定位人员维护"; + this.btn_Person.Click += new System.EventHandler(this.btn_Person_Click); + // + // btn_constructMap + // + this.btn_constructMap.Image = global::Cyberpipe.Properties.Resources._24x24icon_04_hover; + this.btn_constructMap.ImagePosition = DevComponents.DotNetBar.eImagePosition.Top; + this.btn_constructMap.Name = "btn_constructMap"; + this.btn_constructMap.SubItemsExpandWidth = 14; + this.btn_constructMap.Text = "导出施工图"; + this.btn_constructMap.Click += new System.EventHandler(this.btn_constructMap_Click); + // + // buttonItem9 + // + this.buttonItem9.Image = global::Cyberpipe.Properties.Resources._24x24icon__2__10; + this.buttonItem9.ImagePosition = DevComponents.DotNetBar.eImagePosition.Top; + this.buttonItem9.Name = "buttonItem9"; + this.buttonItem9.SubItemsExpandWidth = 14; + this.buttonItem9.Text = "文档管理"; + this.buttonItem9.Click += new System.EventHandler(this.buttonItem9_Click); + // + // ribbonPanel2 + // + this.ribbonPanel2.ColorSchemeStyle = DevComponents.DotNetBar.eDotNetBarStyle.StyleManagerControlled; + this.ribbonPanel2.Controls.Add(this.ribbonBar4); + this.ribbonPanel2.Dock = System.Windows.Forms.DockStyle.Fill; + this.ribbonPanel2.Location = new System.Drawing.Point(0, 0); + this.ribbonPanel2.Name = "ribbonPanel2"; + this.ribbonPanel2.Padding = new System.Windows.Forms.Padding(3, 0, 3, 3); + this.ribbonPanel2.Size = new System.Drawing.Size(1328, 95); + // + // + // + this.ribbonPanel2.Style.Class = ""; + this.ribbonPanel2.Style.CornerType = DevComponents.DotNetBar.eCornerType.Square; + // + // + // + this.ribbonPanel2.StyleMouseDown.Class = ""; + this.ribbonPanel2.StyleMouseDown.CornerType = DevComponents.DotNetBar.eCornerType.Square; + // + // + // + this.ribbonPanel2.StyleMouseOver.Class = ""; + this.ribbonPanel2.StyleMouseOver.CornerType = DevComponents.DotNetBar.eCornerType.Square; + this.ribbonPanel2.TabIndex = 39; + this.ribbonPanel2.Visible = false; + // + // ribbonBar4 + // + this.ribbonBar4.AutoOverflowEnabled = true; + // + // + // + this.ribbonBar4.BackgroundMouseOverStyle.Class = ""; + this.ribbonBar4.BackgroundMouseOverStyle.CornerType = DevComponents.DotNetBar.eCornerType.Square; + // + // + // + this.ribbonBar4.BackgroundStyle.Class = ""; + this.ribbonBar4.BackgroundStyle.CornerType = DevComponents.DotNetBar.eCornerType.Square; + this.ribbonBar4.ContainerControlProcessDialogKey = true; + this.ribbonBar4.Dock = System.Windows.Forms.DockStyle.Left; + this.ribbonBar4.Items.AddRange(new DevComponents.DotNetBar.BaseItem[] { + this.buttonItem_TaskManager, + this.buttonItem_OnlineTask, + this.buttonItem_Event}); + this.ribbonBar4.Location = new System.Drawing.Point(3, 0); + this.ribbonBar4.Name = "ribbonBar4"; + this.ribbonBar4.Size = new System.Drawing.Size(299, 92); + this.ribbonBar4.Style = DevComponents.DotNetBar.eDotNetBarStyle.StyleManagerControlled; + this.ribbonBar4.TabIndex = 0; + this.ribbonBar4.Text = "ribbonBar4"; + // + // + // + this.ribbonBar4.TitleStyle.Class = ""; + this.ribbonBar4.TitleStyle.CornerType = DevComponents.DotNetBar.eCornerType.Square; + // + // + // + this.ribbonBar4.TitleStyleMouseOver.Class = ""; + this.ribbonBar4.TitleStyleMouseOver.CornerType = DevComponents.DotNetBar.eCornerType.Square; + this.ribbonBar4.TitleVisible = false; + // + // buttonItem_TaskManager + // + this.buttonItem_TaskManager.Image = global::Cyberpipe.Properties.Resources._24x24icon__2__76; + this.buttonItem_TaskManager.ImagePosition = DevComponents.DotNetBar.eImagePosition.Top; + this.buttonItem_TaskManager.Name = "buttonItem_TaskManager"; + this.buttonItem_TaskManager.SubItemsExpandWidth = 14; + this.buttonItem_TaskManager.Text = "工单管理"; + this.buttonItem_TaskManager.Click += new System.EventHandler(this.buttonItem_TaskManager_Click); + // + // buttonItem_OnlineTask + // + this.buttonItem_OnlineTask.Image = global::Cyberpipe.Properties.Resources._24x24icon__2__69; + this.buttonItem_OnlineTask.ImagePosition = DevComponents.DotNetBar.eImagePosition.Top; + this.buttonItem_OnlineTask.Name = "buttonItem_OnlineTask"; + this.buttonItem_OnlineTask.SubItemsExpandWidth = 14; + this.buttonItem_OnlineTask.Text = "在线任务"; + this.buttonItem_OnlineTask.Click += new System.EventHandler(this.buttonItem_OnlineTask_Click); + // + // buttonItem_Event + // + this.buttonItem_Event.Image = global::Cyberpipe.Properties.Resources._24x24icon__2__72; + this.buttonItem_Event.ImagePosition = DevComponents.DotNetBar.eImagePosition.Top; + this.buttonItem_Event.Name = "buttonItem_Event"; + this.buttonItem_Event.SubItemsExpandWidth = 14; + this.buttonItem_Event.Text = "事件管理"; + this.buttonItem_Event.Click += new System.EventHandler(this.buttonItem_Event_Click); + // // ribbonPanel1 // this.ribbonPanel1.AutoSize = true; @@ -4262,6 +4463,15 @@ this.buttonItem27.Visible = false; this.buttonItem27.Click += new System.EventHandler(this.buttonItem27_Click); // + // buttonItem1 + // + this.buttonItem1.Image = global::Cyberpipe.Properties.Resources._24x24icon__2__94; + this.buttonItem1.ImagePosition = DevComponents.DotNetBar.eImagePosition.Top; + this.buttonItem1.Name = "buttonItem1"; + this.buttonItem1.SubItemsExpandWidth = 14; + this.buttonItem1.Text = "图层管理"; + this.buttonItem1.Click += new System.EventHandler(this.buttonItem1_Click); + // // buttonItem91 // this.buttonItem91.ForeColor = System.Drawing.Color.Black; @@ -4272,15 +4482,6 @@ this.buttonItem91.Text = "快速定位"; this.buttonItem91.Click += new System.EventHandler(this.buttonItem91_Click); // - // buttonItem1 - // - this.buttonItem1.Image = global::Cyberpipe.Properties.Resources._24x24icon__2__94; - this.buttonItem1.ImagePosition = DevComponents.DotNetBar.eImagePosition.Top; - this.buttonItem1.Name = "buttonItem1"; - this.buttonItem1.SubItemsExpandWidth = 14; - this.buttonItem1.Text = "图层管理"; - this.buttonItem1.Click += new System.EventHandler(this.buttonItem1_Click); - // // btnlegendSet // this.btnlegendSet.Image = global::Cyberpipe.Properties.Resources._24x24icon__2__93; @@ -4300,278 +4501,6 @@ this.buttonItem89.Visible = false; this.buttonItem89.Click += new System.EventHandler(this.buttonItem89_Click); // - // ribbonPanel7 - // - this.ribbonPanel7.ColorSchemeStyle = DevComponents.DotNetBar.eDotNetBarStyle.StyleManagerControlled; - this.ribbonPanel7.Controls.Add(this.ribbonBar5); - this.ribbonPanel7.Dock = System.Windows.Forms.DockStyle.Fill; - this.ribbonPanel7.Location = new System.Drawing.Point(0, 0); - this.ribbonPanel7.Name = "ribbonPanel7"; - this.ribbonPanel7.Padding = new System.Windows.Forms.Padding(3, 0, 3, 3); - this.ribbonPanel7.Size = new System.Drawing.Size(1328, 95); - // - // - // - this.ribbonPanel7.Style.Class = ""; - this.ribbonPanel7.Style.CornerType = DevComponents.DotNetBar.eCornerType.Square; - // - // - // - this.ribbonPanel7.StyleMouseDown.Class = ""; - this.ribbonPanel7.StyleMouseDown.CornerType = DevComponents.DotNetBar.eCornerType.Square; - // - // - // - this.ribbonPanel7.StyleMouseOver.Class = ""; - this.ribbonPanel7.StyleMouseOver.CornerType = DevComponents.DotNetBar.eCornerType.Square; - this.ribbonPanel7.TabIndex = 41; - this.ribbonPanel7.Visible = false; - // - // ribbonBar5 - // - this.ribbonBar5.AutoOverflowEnabled = true; - // - // - // - this.ribbonBar5.BackgroundMouseOverStyle.Class = ""; - this.ribbonBar5.BackgroundMouseOverStyle.CornerType = DevComponents.DotNetBar.eCornerType.Square; - // - // - // - this.ribbonBar5.BackgroundStyle.Class = ""; - this.ribbonBar5.BackgroundStyle.CornerType = DevComponents.DotNetBar.eCornerType.Square; - this.ribbonBar5.ContainerControlProcessDialogKey = true; - this.ribbonBar5.Dock = System.Windows.Forms.DockStyle.Left; - this.ribbonBar5.Items.AddRange(new DevComponents.DotNetBar.BaseItem[] { - this.btn_flag, - this.slider4ground}); - this.ribbonBar5.Location = new System.Drawing.Point(3, 0); - this.ribbonBar5.Name = "ribbonBar5"; - this.ribbonBar5.Size = new System.Drawing.Size(418, 92); - this.ribbonBar5.Style = DevComponents.DotNetBar.eDotNetBarStyle.StyleManagerControlled; - this.ribbonBar5.TabIndex = 0; - // - // - // - this.ribbonBar5.TitleStyle.Class = ""; - this.ribbonBar5.TitleStyle.CornerType = DevComponents.DotNetBar.eCornerType.Square; - // - // - // - this.ribbonBar5.TitleStyleMouseOver.Class = ""; - this.ribbonBar5.TitleStyleMouseOver.CornerType = DevComponents.DotNetBar.eCornerType.Square; - this.ribbonBar5.TitleVisible = false; - this.ribbonBar5.ItemClick += new System.EventHandler(this.ribbonBar5_ItemClick); - // - // btn_flag - // - this.btn_flag.Image = global::Cyberpipe.Properties.Resources._24x24icon_03_hover; - this.btn_flag.ImagePosition = DevComponents.DotNetBar.eImagePosition.Top; - this.btn_flag.Name = "btn_flag"; - this.btn_flag.SubItemsExpandWidth = 14; - this.btn_flag.Text = "标识器管理"; - this.btn_flag.Click += new System.EventHandler(this.btn_flag_Click); - // - // slider4ground - // - this.slider4ground.LabelPosition = DevComponents.DotNetBar.eSliderLabelPosition.Top; - this.slider4ground.Name = "slider4ground"; - this.slider4ground.Text = "地面透明度"; - this.slider4ground.Value = 0; - this.slider4ground.ValueChanged += new System.EventHandler(this.slider4ground_ValueChanged); - // - // ribbonPanel2 - // - this.ribbonPanel2.ColorSchemeStyle = DevComponents.DotNetBar.eDotNetBarStyle.StyleManagerControlled; - this.ribbonPanel2.Controls.Add(this.ribbonBar4); - this.ribbonPanel2.Dock = System.Windows.Forms.DockStyle.Fill; - this.ribbonPanel2.Location = new System.Drawing.Point(0, 0); - this.ribbonPanel2.Name = "ribbonPanel2"; - this.ribbonPanel2.Padding = new System.Windows.Forms.Padding(3, 0, 3, 3); - this.ribbonPanel2.Size = new System.Drawing.Size(1328, 95); - // - // - // - this.ribbonPanel2.Style.Class = ""; - this.ribbonPanel2.Style.CornerType = DevComponents.DotNetBar.eCornerType.Square; - // - // - // - this.ribbonPanel2.StyleMouseDown.Class = ""; - this.ribbonPanel2.StyleMouseDown.CornerType = DevComponents.DotNetBar.eCornerType.Square; - // - // - // - this.ribbonPanel2.StyleMouseOver.Class = ""; - this.ribbonPanel2.StyleMouseOver.CornerType = DevComponents.DotNetBar.eCornerType.Square; - this.ribbonPanel2.TabIndex = 39; - this.ribbonPanel2.Visible = false; - // - // ribbonBar4 - // - this.ribbonBar4.AutoOverflowEnabled = true; - // - // - // - this.ribbonBar4.BackgroundMouseOverStyle.Class = ""; - this.ribbonBar4.BackgroundMouseOverStyle.CornerType = DevComponents.DotNetBar.eCornerType.Square; - // - // - // - this.ribbonBar4.BackgroundStyle.Class = ""; - this.ribbonBar4.BackgroundStyle.CornerType = DevComponents.DotNetBar.eCornerType.Square; - this.ribbonBar4.ContainerControlProcessDialogKey = true; - this.ribbonBar4.Dock = System.Windows.Forms.DockStyle.Left; - this.ribbonBar4.Items.AddRange(new DevComponents.DotNetBar.BaseItem[] { - this.buttonItem_TaskManager, - this.buttonItem_OnlineTask, - this.buttonItem_Event}); - this.ribbonBar4.Location = new System.Drawing.Point(3, 0); - this.ribbonBar4.Name = "ribbonBar4"; - this.ribbonBar4.Size = new System.Drawing.Size(299, 92); - this.ribbonBar4.Style = DevComponents.DotNetBar.eDotNetBarStyle.StyleManagerControlled; - this.ribbonBar4.TabIndex = 0; - this.ribbonBar4.Text = "ribbonBar4"; - // - // - // - this.ribbonBar4.TitleStyle.Class = ""; - this.ribbonBar4.TitleStyle.CornerType = DevComponents.DotNetBar.eCornerType.Square; - // - // - // - this.ribbonBar4.TitleStyleMouseOver.Class = ""; - this.ribbonBar4.TitleStyleMouseOver.CornerType = DevComponents.DotNetBar.eCornerType.Square; - this.ribbonBar4.TitleVisible = false; - // - // buttonItem_TaskManager - // - this.buttonItem_TaskManager.Image = global::Cyberpipe.Properties.Resources._24x24icon__2__76; - this.buttonItem_TaskManager.ImagePosition = DevComponents.DotNetBar.eImagePosition.Top; - this.buttonItem_TaskManager.Name = "buttonItem_TaskManager"; - this.buttonItem_TaskManager.SubItemsExpandWidth = 14; - this.buttonItem_TaskManager.Text = "工单管理"; - this.buttonItem_TaskManager.Click += new System.EventHandler(this.buttonItem_TaskManager_Click); - // - // buttonItem_OnlineTask - // - this.buttonItem_OnlineTask.Image = global::Cyberpipe.Properties.Resources._24x24icon__2__69; - this.buttonItem_OnlineTask.ImagePosition = DevComponents.DotNetBar.eImagePosition.Top; - this.buttonItem_OnlineTask.Name = "buttonItem_OnlineTask"; - this.buttonItem_OnlineTask.SubItemsExpandWidth = 14; - this.buttonItem_OnlineTask.Text = "在线任务"; - this.buttonItem_OnlineTask.Click += new System.EventHandler(this.buttonItem_OnlineTask_Click); - // - // buttonItem_Event - // - this.buttonItem_Event.Image = global::Cyberpipe.Properties.Resources._24x24icon__2__72; - this.buttonItem_Event.ImagePosition = DevComponents.DotNetBar.eImagePosition.Top; - this.buttonItem_Event.Name = "buttonItem_Event"; - this.buttonItem_Event.SubItemsExpandWidth = 14; - this.buttonItem_Event.Text = "事件管理"; - this.buttonItem_Event.Click += new System.EventHandler(this.buttonItem_Event_Click); - // - // ribbonPanel3 - // - this.ribbonPanel3.ColorSchemeStyle = DevComponents.DotNetBar.eDotNetBarStyle.StyleManagerControlled; - this.ribbonPanel3.Controls.Add(this.ribbonBar3); - this.ribbonPanel3.Dock = System.Windows.Forms.DockStyle.Fill; - this.ribbonPanel3.Location = new System.Drawing.Point(0, 33); - this.ribbonPanel3.Name = "ribbonPanel3"; - this.ribbonPanel3.Padding = new System.Windows.Forms.Padding(3, 0, 3, 3); - this.ribbonPanel3.Size = new System.Drawing.Size(1328, 62); - // - // - // - this.ribbonPanel3.Style.Class = ""; - this.ribbonPanel3.Style.CornerType = DevComponents.DotNetBar.eCornerType.Square; - // - // - // - this.ribbonPanel3.StyleMouseDown.Class = ""; - this.ribbonPanel3.StyleMouseDown.CornerType = DevComponents.DotNetBar.eCornerType.Square; - // - // - // - this.ribbonPanel3.StyleMouseOver.Class = ""; - this.ribbonPanel3.StyleMouseOver.CornerType = DevComponents.DotNetBar.eCornerType.Square; - this.ribbonPanel3.TabIndex = 40; - // - // ribbonBar3 - // - this.ribbonBar3.AutoOverflowEnabled = true; - // - // - // - this.ribbonBar3.BackgroundMouseOverStyle.Class = ""; - this.ribbonBar3.BackgroundMouseOverStyle.CornerType = DevComponents.DotNetBar.eCornerType.Square; - // - // - // - this.ribbonBar3.BackgroundStyle.Class = ""; - this.ribbonBar3.BackgroundStyle.CornerType = DevComponents.DotNetBar.eCornerType.Square; - this.ribbonBar3.ContainerControlProcessDialogKey = true; - this.ribbonBar3.Dock = System.Windows.Forms.DockStyle.Left; - this.ribbonBar3.Items.AddRange(new DevComponents.DotNetBar.BaseItem[] { - this.btn_device, - this.btn_Person, - this.btn_constructMap, - this.buttonItem9}); - this.ribbonBar3.Location = new System.Drawing.Point(3, 0); - this.ribbonBar3.Name = "ribbonBar3"; - this.ribbonBar3.Size = new System.Drawing.Size(378, 59); - this.ribbonBar3.Style = DevComponents.DotNetBar.eDotNetBarStyle.StyleManagerControlled; - this.ribbonBar3.TabIndex = 0; - // - // - // - this.ribbonBar3.TitleStyle.Class = ""; - this.ribbonBar3.TitleStyle.CornerType = DevComponents.DotNetBar.eCornerType.Square; - // - // - // - this.ribbonBar3.TitleStyleMouseOver.Class = ""; - this.ribbonBar3.TitleStyleMouseOver.CornerType = DevComponents.DotNetBar.eCornerType.Square; - this.ribbonBar3.TitleVisible = false; - // - // btn_device - // - this.btn_device.ButtonStyle = DevComponents.DotNetBar.eButtonStyle.ImageAndText; - this.btn_device.Image = global::Cyberpipe.Properties.Resources._24X24__2__02; - this.btn_device.ImagePosition = DevComponents.DotNetBar.eImagePosition.Top; - this.btn_device.Name = "btn_device"; - this.btn_device.SubItemsExpandWidth = 14; - this.btn_device.Text = "探测仪管理"; - this.btn_device.Click += new System.EventHandler(this.btn_device_Click); - // - // btn_Person - // - this.btn_Person.ButtonStyle = DevComponents.DotNetBar.eButtonStyle.ImageAndText; - this.btn_Person.Image = global::Cyberpipe.Properties.Resources._24x24icon_05_hover1; - this.btn_Person.ImagePosition = DevComponents.DotNetBar.eImagePosition.Top; - this.btn_Person.Name = "btn_Person"; - this.btn_Person.SubItemsExpandWidth = 14; - this.btn_Person.Text = "定位人员维护"; - this.btn_Person.Click += new System.EventHandler(this.btn_Person_Click); - // - // btn_constructMap - // - this.btn_constructMap.Image = global::Cyberpipe.Properties.Resources._24x24icon_04_hover; - this.btn_constructMap.ImagePosition = DevComponents.DotNetBar.eImagePosition.Top; - this.btn_constructMap.Name = "btn_constructMap"; - this.btn_constructMap.SubItemsExpandWidth = 14; - this.btn_constructMap.Text = "导出施工图"; - this.btn_constructMap.Click += new System.EventHandler(this.btn_constructMap_Click); - // - // buttonItem9 - // - this.buttonItem9.Image = global::Cyberpipe.Properties.Resources._24x24icon__2__10; - this.buttonItem9.ImagePosition = DevComponents.DotNetBar.eImagePosition.Top; - this.buttonItem9.Name = "buttonItem9"; - this.buttonItem9.SubItemsExpandWidth = 14; - this.buttonItem9.Text = "文档管理"; - this.buttonItem9.Click += new System.EventHandler(this.buttonItem9_Click); - // // ribbonPanel8 // this.ribbonPanel8.ColorSchemeStyle = DevComponents.DotNetBar.eDotNetBarStyle.StyleManagerControlled; @@ -4696,6 +4625,86 @@ this.btn_reset_password.Text = "重置密码"; this.btn_reset_password.Click += new System.EventHandler(this.btn_reset_password_Click); // + // ribbonPanel7 + // + this.ribbonPanel7.ColorSchemeStyle = DevComponents.DotNetBar.eDotNetBarStyle.StyleManagerControlled; + this.ribbonPanel7.Controls.Add(this.ribbonBar5); + this.ribbonPanel7.Dock = System.Windows.Forms.DockStyle.Fill; + this.ribbonPanel7.Location = new System.Drawing.Point(0, 0); + this.ribbonPanel7.Name = "ribbonPanel7"; + this.ribbonPanel7.Padding = new System.Windows.Forms.Padding(3, 0, 3, 3); + this.ribbonPanel7.Size = new System.Drawing.Size(1328, 95); + // + // + // + this.ribbonPanel7.Style.Class = ""; + this.ribbonPanel7.Style.CornerType = DevComponents.DotNetBar.eCornerType.Square; + // + // + // + this.ribbonPanel7.StyleMouseDown.Class = ""; + this.ribbonPanel7.StyleMouseDown.CornerType = DevComponents.DotNetBar.eCornerType.Square; + // + // + // + this.ribbonPanel7.StyleMouseOver.Class = ""; + this.ribbonPanel7.StyleMouseOver.CornerType = DevComponents.DotNetBar.eCornerType.Square; + this.ribbonPanel7.TabIndex = 41; + this.ribbonPanel7.Visible = false; + // + // ribbonBar5 + // + this.ribbonBar5.AutoOverflowEnabled = true; + // + // + // + this.ribbonBar5.BackgroundMouseOverStyle.Class = ""; + this.ribbonBar5.BackgroundMouseOverStyle.CornerType = DevComponents.DotNetBar.eCornerType.Square; + // + // + // + this.ribbonBar5.BackgroundStyle.Class = ""; + this.ribbonBar5.BackgroundStyle.CornerType = DevComponents.DotNetBar.eCornerType.Square; + this.ribbonBar5.ContainerControlProcessDialogKey = true; + this.ribbonBar5.Dock = System.Windows.Forms.DockStyle.Left; + this.ribbonBar5.Items.AddRange(new DevComponents.DotNetBar.BaseItem[] { + this.btn_flag, + this.slider4ground}); + this.ribbonBar5.Location = new System.Drawing.Point(3, 0); + this.ribbonBar5.Name = "ribbonBar5"; + this.ribbonBar5.Size = new System.Drawing.Size(418, 92); + this.ribbonBar5.Style = DevComponents.DotNetBar.eDotNetBarStyle.StyleManagerControlled; + this.ribbonBar5.TabIndex = 0; + // + // + // + this.ribbonBar5.TitleStyle.Class = ""; + this.ribbonBar5.TitleStyle.CornerType = DevComponents.DotNetBar.eCornerType.Square; + // + // + // + this.ribbonBar5.TitleStyleMouseOver.Class = ""; + this.ribbonBar5.TitleStyleMouseOver.CornerType = DevComponents.DotNetBar.eCornerType.Square; + this.ribbonBar5.TitleVisible = false; + this.ribbonBar5.ItemClick += new System.EventHandler(this.ribbonBar5_ItemClick); + // + // btn_flag + // + this.btn_flag.Image = global::Cyberpipe.Properties.Resources._24x24icon_03_hover; + this.btn_flag.ImagePosition = DevComponents.DotNetBar.eImagePosition.Top; + this.btn_flag.Name = "btn_flag"; + this.btn_flag.SubItemsExpandWidth = 14; + this.btn_flag.Text = "标识器管理"; + this.btn_flag.Click += new System.EventHandler(this.btn_flag_Click); + // + // slider4ground + // + this.slider4ground.LabelPosition = DevComponents.DotNetBar.eSliderLabelPosition.Top; + this.slider4ground.Name = "slider4ground"; + this.slider4ground.Text = "地面透明度"; + this.slider4ground.Value = 0; + this.slider4ground.ValueChanged += new System.EventHandler(this.slider4ground_ValueChanged); + // // ribbonPanel15 // this.ribbonPanel15.ColorSchemeStyle = DevComponents.DotNetBar.eDotNetBarStyle.StyleManagerControlled; @@ -6393,16 +6402,6 @@ this.buttonItem76.SubItemsExpandWidth = 14; this.buttonItem76.Text = "坐标标注"; // - // layerTree - // - this.layerTree.CheckBoxes = true; - this.layerTree.ItemHeight = 18; - this.layerTree.Location = new System.Drawing.Point(30, 78); - this.layerTree.Name = "layerTree"; - this.layerTree.Size = new System.Drawing.Size(121, 97); - this.layerTree.TabIndex = 1; - this.layerTree.AfterCheck += new System.Windows.Forms.TreeViewEventHandler(this.layerTree_AfterCheck); - // // MainFrm // this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Inherit; @@ -6475,11 +6474,11 @@ this.contextMenuStripDeleteLayerNode.ResumeLayout(false); this.ribbonControl1.ResumeLayout(false); this.ribbonControl1.PerformLayout(); - this.ribbonPanel1.ResumeLayout(false); - this.ribbonPanel7.ResumeLayout(false); - this.ribbonPanel2.ResumeLayout(false); this.ribbonPanel3.ResumeLayout(false); + this.ribbonPanel2.ResumeLayout(false); + this.ribbonPanel1.ResumeLayout(false); this.ribbonPanel8.ResumeLayout(false); + this.ribbonPanel7.ResumeLayout(false); this.ribbonPanel15.ResumeLayout(false); ((System.ComponentModel.ISupportInitialize)(this.pictureBox1)).EndInit(); this.ResumeLayout(false); diff --git a/NewFunction/FrmCreateTunnel.cs b/NewFunction/FrmCreateTunnel.cs index 282767c..338edff 100644 --- a/NewFunction/FrmCreateTunnel.cs +++ b/NewFunction/FrmCreateTunnel.cs @@ -142,35 +142,6 @@ } } - private void txtMS_KeyPress(object sender, KeyPressEventArgs e) - { - TextBox text = sender as TextBox; - if ((e.KeyChar < 48 || e.KeyChar > 57) && (e.KeyChar != 8) && (int)e.KeyChar != 46) - { - e.Handled = true; - } - if ((int)e.KeyChar == 46) //小数点 - { - if (text.Text.Length <= 0) - e.Handled = true; //小数点不能在第一位 - else //处理不规则的小数点 - { - float f; - float oldf; - bool b1 = false, b2 = false; - b1 = float.TryParse(text.Text, out oldf); - b2 = float.TryParse(text.Text + e.KeyChar.ToString(), out f); - if (b2 == false) - { - if (b1 == true) - e.Handled = true; - else - e.Handled = false; - } - } - } - } - private void FrmCreateTunnel_Load(object sender, EventArgs e) { if (comboBoxTunnelType.Items.Count > 0) diff --git a/OracleHelper.cs b/OracleHelper.cs index 11eebe6..79cdf48 100644 --- a/OracleHelper.cs +++ b/OracleHelper.cs @@ -49,7 +49,7 @@ { conn.Close(); } - MessageBox.Show(ex.Message, "提示"); + LogHelper.WriteLog(typeof(OledbHelper), ex.Message); return null; } } @@ -67,7 +67,7 @@ } catch(Exception ex) { - // LogError.PublishError(ex); + LogHelper.WriteLog(typeof(OledbHelper), ex.Message); } finally { @@ -111,6 +111,7 @@ } catch (Exception ex) { + LogHelper.WriteLog(typeof(OledbHelper), ex.Message); return null; } } @@ -131,6 +132,7 @@ } catch(Exception ex) { + LogHelper.WriteLog(typeof(OledbHelper), ex.Message); rowCount = -1; } finally @@ -159,6 +161,7 @@ } catch(Exception ex) { + LogHelper.WriteLog(typeof(OledbHelper), ex.Message); num = -1; } finally @@ -190,6 +193,7 @@ } catch (Exception ex) { + LogHelper.WriteLog(typeof(OledbHelper), ex.Message); return null; } } @@ -210,7 +214,7 @@ oracleCmd.Dispose(); conn.Close(); //调用con_close()方法,关闭与数据库的连接 }catch(Exception ex){ - + LogHelper.WriteLog(typeof(OledbHelper), ex.Message); } finally { @@ -237,6 +241,7 @@ } catch (Exception ex) { + LogHelper.WriteLog(typeof(OledbHelper), ex.Message); rowCount = -1; } finally diff --git a/OracleUtils.cs b/OracleUtils.cs index 29b5374..c1aadda 100644 --- a/OracleUtils.cs +++ b/OracleUtils.cs @@ -741,7 +741,6 @@ } catch { - //if we fail to return the SqlDatReader, we need to close the connection ourselves cn.Close(); throw; } diff --git a/PAS.cs b/PAS.cs index 972de2d..fcda1dd 100644 --- a/PAS.cs +++ b/PAS.cs @@ -93,15 +93,7 @@ } - private void TSM_Pderive_Click(object sender, EventArgs e) - { - PASAClass.Table_name(operation); - if (TV_Files.SelectedNode != null) - { - PASAClass.GuideEdit_form("G", TV_Files, int.Parse(((ToolStripMenuItem)sender).Tag.ToString())); - } - } - + private void TSM_Fenter_Click(object sender, EventArgs e) { if (TV_Files.SelectedNode != null) @@ -110,16 +102,6 @@ } } - private void TSM_Frename_Click(object sender, EventArgs e) - { - TSM_Fenter_Click(sender, e); - } - - private void TSM_Fdelete_Click(object sender, EventArgs e) - { - TSM_Fenter_Click(sender, e); - } - private void TSM_Fderive_Click(object sender, EventArgs e) { if (TV_Files.SelectedNode != null) @@ -128,25 +110,6 @@ } } - private void TSM_Fprint_Click(object sender, EventArgs e) - { - if (TV_Files.SelectedNode != null) - { - PASAClass.Print(int.Parse(TV_Files.SelectedNode.Tag.ToString()), TV_Files.SelectedNode.Text, PD_PASPrtFile, PD_PASPrtDoc); - - } - } - - private void TSM_PASPgSt_Click(object sender, EventArgs e) - { - PSD_PASSetPage.ShowDialog(); - } - - private void TSM_PASPreV_Click(object sender, EventArgs e) - { - PPD_PASPreV.ShowDialog(); - } - private void TV_Files_AfterCollapse(object sender, TreeViewEventArgs e) { e.Node.ImageIndex = 0; @@ -250,14 +213,6 @@ } } - private void 导出ToolStripMenuItem_Click(object sender, EventArgs e) - { - PASAClass.Table_name(operation); - if (TV_Files.SelectedNode != null) - { - PASAClass.GuideEdit_form("G", TV_Files, int.Parse(((ToolStripMenuItem)sender).Tag.ToString())); - } - } private void 导入ToolStripMenuItem_Click(object sender, EventArgs e) { diff --git a/PAS_Forms/F_PASInout.cs b/PAS_Forms/F_PASInout.cs index 373a4e6..974f987 100644 --- a/PAS_Forms/F_PASInout.cs +++ b/PAS_Forms/F_PASInout.cs @@ -71,11 +71,6 @@ } - private void Cancel_Click(object sender, EventArgs e) - { - this.Close(); - } - private void OK_Click(object sender, EventArgs e) { if (textBox1.Text == "") diff --git a/PATM.cs b/PATM.cs index edecd1e..9b6c51d 100644 --- a/PATM.cs +++ b/PATM.cs @@ -26,12 +26,6 @@ public string operation = ""; #endregion - - - - - - private void TSM_Pnew_Click(object sender, EventArgs e) { if (LV_proj.Visible) @@ -94,15 +88,6 @@ } - private void TSM_Pderive_Click(object sender, EventArgs e) - { - PATMAClass.Table_name(operation); - if (TV_files.SelectedNode != null) - { - PATMAClass.GuideEdit_form("G", TV_files, int.Parse(((ToolStripMenuItem)sender).Tag.ToString())); - } - } - private void TSM_Fenter_Click(object sender, EventArgs e) { if (TV_files.SelectedNode != null) @@ -163,35 +148,6 @@ //PATMAClass.Show_AllFile(int.Parse(e.Node.Tag.ToString()), e.Node.Text, LV_PATMallfiles, PB_Display, 2);//此处为显示图片操作 } - private void TSM_Frename_Click(object sender, EventArgs e) - { - TSM_Fenter_Click(sender, e); - } - - private void TSM_Fdelete_Click(object sender, EventArgs e) - { - TSM_Fenter_Click(sender, e); - } - - private void TSM_Fderive_Click(object sender, EventArgs e) - { - if (TV_files.SelectedNode != null) - { - PATMAClass.GuideEdit_form("G", TV_files, int.Parse(((ToolStripMenuItem)sender).Tag.ToString())); - } - } - - private void TSM_Fprint_Click(object sender, EventArgs e) - { - if (TV_files.SelectedNode != null) - { - PATMAClass.Print(int.Parse(TV_files.SelectedNode.Tag.ToString()), TV_files.SelectedNode.Text, PD_PATMPrtFile, PD_PATMPrtDoc); - - } - } - - - private void BT_PATMSch_Click(object sender, EventArgs e) { //LV_PATMallfiles.Dock = DockStyle.Fill;//使ListView控件最大化 @@ -210,32 +166,6 @@ } - private void TSM_PATMPreV_Click(object sender, EventArgs e) - { - PPD_PATMPreV.ShowDialog(); - } - - private void TSM_PATMPgSt_Click(object sender, EventArgs e) - { - PSD_PATMSetPage.ShowDialog(); - } - - private void LV_PATMSrchRslt_MouseClick(object sender, MouseEventArgs e) - { - - if (LV_proj.SelectedItems != null) - { - //int i = 1; - // PATMAClass.Show_AllFile(int.Parse(LV_PATMSrchRslt.FocusedItem.Tag.ToString()), LV_PATMSrchRslt.FocusedItem.Text, LV_PATMallfiles,PB_Display, 0); - - } - } - - private void LV_PATMSrchRslt_MouseDoubleClick(object sender, MouseEventArgs e) - { - //PATMAClass.Show_AllFile(int.Parse(LV_PATMSrchRslt.FocusedItem.Tag.ToString()), LV_PATMSrchRslt.FocusedItem.Text, LV_PATMallfiles, PB_Display, 2); - } - private void 新建ToolStripMenuItem_Click(object sender, EventArgs e) { if ((TV_files.SelectedNode != null)&&(TV_files.SelectedNode.Parent==null)) @@ -288,17 +218,6 @@ } } - private void 打印预览toolStripMenuItem_Click(object sender, EventArgs e) - { - - PPD_PATMPreV.ShowDialog(); - } - - private void 打印设置toolStripMenuItem_Click(object sender, EventArgs e) - { - PSD_PATMSetPage.ShowDialog(); - } - private void TV_PATMSrchRslt_NodeMouseClick(object sender, TreeNodeMouseClickEventArgs e) { if (e.Button == MouseButtons.Right) diff --git a/PATM_Forms/F_PATMTitle.cs b/PATM_Forms/F_PATMTitle.cs index 7380dd8..5d1fe8c 100644 --- a/PATM_Forms/F_PATMTitle.cs +++ b/PATM_Forms/F_PATMTitle.cs @@ -148,19 +148,6 @@ return 0; } - //判断是否为已有工程 - private bool checkProject(string projectname) { - string sql = "select * from "+this.tablename+" where "+tablename+".NODENAME = '"+projectname - +"'"; - DataTable table = OledbHelper.QueryTable(sql); - if (table.Rows.Count > 0) - { - return true; - } - else { - return false; - } - } private void buttonX2_Click(object sender, EventArgs e) { diff --git a/PATM_Forms/F_PATMinout.cs b/PATM_Forms/F_PATMinout.cs index e404e7b..16b51de 100644 --- a/PATM_Forms/F_PATMinout.cs +++ b/PATM_Forms/F_PATMinout.cs @@ -174,12 +174,6 @@ { this.Close(); } - - private void TV_PATMinout_AfterCollapse(object sender, TreeViewEventArgs e) - { - e.Node.ImageIndex = 0; - } - //private void TV_PATMinout_NodeMouseDoubleClick(object sender, TreeNodeMouseClickEventArgs e) diff --git a/Cyberpipe.csproj b/Cyberpipe.csproj index 07a8c1a..e3cd12c 100644 --- a/Cyberpipe.csproj +++ b/Cyberpipe.csproj @@ -204,25 +204,6 @@ - - Form - - - F_GKT1数据输入输出.cs - - - Form - - - F_GKT1添加文件.cs - - - Form - - - F_GKT1添加项目.cs - - Form @@ -1068,18 +1049,6 @@ Frm_password_reset.cs - - Form - - - GKT.cs - - - Form - - - GKT1.cs - Form @@ -1258,12 +1227,6 @@ F_Projedit.cs - - Form - - - PED.cs - Form @@ -1331,16 +1294,6 @@ True Reference.map - - F_GKT1数据输入输出.cs - Designer - - - F_GKT1添加文件.cs - - - F_GKT1添加项目.cs - Form_EditTask.cs @@ -1836,12 +1789,6 @@ Frm_password_reset.cs - - GKT.cs - - - GKT1.cs - F_GKT数据输入输出.cs @@ -1934,9 +1881,6 @@ F_Projedit.cs - - PED.cs - F_数据输入输出.cs diff --git a/Cyberpipe.suo b/Cyberpipe.suo index 68ced4f..a1aecf8 100644 --- a/Cyberpipe.suo +++ b/Cyberpipe.suo Binary files differ diff --git a/EMS_Forms/Form_EditTask.cs b/EMS_Forms/Form_EditTask.cs index 718992f..f1d791f 100644 --- a/EMS_Forms/Form_EditTask.cs +++ b/EMS_Forms/Form_EditTask.cs @@ -119,7 +119,8 @@ String name = Convert.ToString(dr["USERNAME"]); comboBox_userName.Items.Add(name); - } + } + dr.Close(); comboBox_road.Items.Clear(); roadList = new List(); @@ -135,7 +136,7 @@ comboBox_road.Items.Add(name); } } - + dr1.Close(); conn.Close(); bool flag2 = false; @@ -185,7 +186,7 @@ catch (Exception ex) { - MessageBox.Show(ex.ToString()); + LogHelper.WriteLog(typeof(Form_EditTask), ex.Message); } } @@ -288,7 +289,7 @@ } catch (Exception ex) { - MessageBox.Show(ex.ToString()); + LogHelper.WriteLog(typeof(Form_EditTask), ex.Message); } } @@ -474,7 +475,7 @@ } catch (Exception ex) { - MessageBox.Show(ex.ToString()); + LogHelper.WriteLog(typeof(Form_EditTask), ex.Message); } this.Close(); @@ -495,6 +496,7 @@ { numList.Add(Convert.ToInt32(dr["DBID"])); } + dr.Close(); if (numList.Count == 0) { taskNumber = Convert.ToInt32(number) * 100; @@ -674,6 +676,7 @@ } } } + dr.Close(); conn.Close(); } diff --git a/EMS_Forms/Form_EventManager.cs b/EMS_Forms/Form_EventManager.cs index b18c45b..84807b2 100644 --- a/EMS_Forms/Form_EventManager.cs +++ b/EMS_Forms/Form_EventManager.cs @@ -64,6 +64,7 @@ comboBox_name.Items.Add(name); } + dr.Close(); conn.Close(); diff --git a/Forms/FrmMnModify.cs b/Forms/FrmMnModify.cs index 31cfc5f..d036360 100644 --- a/Forms/FrmMnModify.cs +++ b/Forms/FrmMnModify.cs @@ -68,15 +68,7 @@ questionGrid.Rows[idx].Cells[1].Value = sr.question; } } - /// 选中对象 - /// - /// - /// - /// - private void buttonX1_Click(object sender, EventArgs e) - { - globecontrol.Globe.Action = EnumAction3D.SelectObject; - } + /// /// 选中某一行 /// diff --git a/Forms/FrmPipelineModelDataBase.cs b/Forms/FrmPipelineModelDataBase.cs index 2acf0ca..7ce573f 100644 --- a/Forms/FrmPipelineModelDataBase.cs +++ b/Forms/FrmPipelineModelDataBase.cs @@ -35,19 +35,7 @@ ds = _ds; InitializeComponent(); } - /// - /// 单击选择shp格式文件 - /// - /// - /// - private void btnBrowseModel_Click(object sender, EventArgs e) - { - saveFileDialog1.Filter = "*.lgd|*.lgd"; - if (saveFileDialog1.ShowDialog() == DialogResult.OK) - { - txtModelLayer.Text = saveFileDialog1.FileName; - } - } + /// /// 窗体初始化事件处理 /// @@ -100,49 +88,6 @@ } } } - - private object convertFieldValue(string fieldname, object obj) - { - if (obj == null) - return null; - - try - { - string type = fields_types[fieldname].ToString(); - switch (type) - { - case "string": - return obj.ToString(); - case "int": - //return 101; - int intResult; - if (int.TryParse(obj.ToString(), out intResult)) - return intResult; - else - return null; - case "double": - //return 202.5; - double doubleResult; - if (double.TryParse(obj.ToString(), out doubleResult)) - return doubleResult; - else - return null; - case "date": - DateTime dtResult; - if (DateTime.TryParse(obj.ToString(), out dtResult)) - return dtResult; - else - return null; - } - return null; - } - catch (Exception ex) - { - MessageBox.Show(ex.ToString()); - return null; - } - } - public string lgdFilePath = ""; /// /// 选择管线颜色 @@ -610,33 +555,6 @@ { this.Close(); } - - private void cmbLayer_SelectedIndexChanged(object sender, EventArgs e) //选择图层 - { - GSOLayer layer = ctl.Globe.Layers.GetLayerByCaption(selectLayerName); - GSOFeatures features = layer.GetAllFeatures(); - if (features.Length == 0) - return; - - cmbFrom.Items.Clear(); - cmbTo.Items.Clear(); - cmbRadius.Items.Clear(); - cmbID.Items.Clear(); - for (int i = 0; i < features[0].GetFieldCount(); i++) - { - GeoScene.Data.GSOFieldDefn fielddef = (GeoScene.Data.GSOFieldDefn)(features[0].GetFieldDefn(i)); - - cmbFrom.Items.Add(fielddef.Name); - cmbTo.Items.Add(fielddef.Name); - cmbRadius.Items.Add(fielddef.Name); - cmbID.Items.Add(fielddef.Name); - } - cmbFrom.SelectedItem = "Deep1"; - cmbTo.SelectedItem = "Deep2"; - cmbRadius.SelectedItem = "Diameter"; - cmbID.SelectedItem = "Handle"; - } - private void buttonXLayerPath_Click(object sender, EventArgs e)//单击 选择shp格式的文件 { OpenFileDialog dlg = new OpenFileDialog(); diff --git a/Forms/FrmPipelineModelDataOneStep.cs b/Forms/FrmPipelineModelDataOneStep.cs index 18afda7..ec93b8a 100644 --- a/Forms/FrmPipelineModelDataOneStep.cs +++ b/Forms/FrmPipelineModelDataOneStep.cs @@ -38,19 +38,7 @@ layerTree = _layerTree; InitializeComponent(); } - /// - /// 单击选择shp格式文件 - /// - /// - /// - private void btnBrowseModel_Click(object sender, EventArgs e) - { - saveFileDialog1.Filter = "*.lgd|*.lgd"; - if (saveFileDialog1.ShowDialog() == DialogResult.OK) - { - txtModelLayer.Text = saveFileDialog1.FileName; - } - } + /// /// 窗体初始化事件处理 /// @@ -107,48 +95,7 @@ } } - private object convertFieldValue(string fieldname, object obj) - { - if (obj == null) - return null; - - try - { - string type = fields_types[fieldname].ToString(); - switch (type) - { - case "string": - return obj.ToString(); - case "int": - //return 101; - int intResult; - if (int.TryParse(obj.ToString(), out intResult)) - return intResult; - else - return null; - case "double": - //return 202.5; - double doubleResult; - if (double.TryParse(obj.ToString(), out doubleResult)) - return doubleResult; - else - return null; - case "date": - DateTime dtResult; - if (DateTime.TryParse(obj.ToString(), out dtResult)) - return dtResult; - else - return null; - } - return null; - } - catch (Exception ex) - { - MessageBox.Show(ex.ToString()); - return null; - } - } - + public string lgdFilePath = ""; /// /// 选择管线颜色 @@ -673,32 +620,6 @@ return featDs; } - private void cmbLayer_SelectedIndexChanged(object sender, EventArgs e) //选择图层 - { - GSOLayer layer = ctl.Globe.Layers.GetLayerByCaption(selectLayerName); - GSOFeatures features = layer.GetAllFeatures(); - if (features.Length == 0) - return; - - cmbFrom.Items.Clear(); - cmbTo.Items.Clear(); - cmbRadius.Items.Clear(); - cmbID.Items.Clear(); - for (int i = 0; i < features[0].GetFieldCount(); i++) - { - GeoScene.Data.GSOFieldDefn fielddef = (GeoScene.Data.GSOFieldDefn)(features[0].GetFieldDefn(i)); - - cmbFrom.Items.Add(fielddef.Name); - cmbTo.Items.Add(fielddef.Name); - cmbRadius.Items.Add(fielddef.Name); - cmbID.Items.Add(fielddef.Name); - } - cmbFrom.SelectedItem = "Deep1"; - cmbTo.SelectedItem = "Deep2"; - cmbRadius.SelectedItem = "Diameter"; - cmbID.SelectedItem = "Handle"; - } - private void buttonXLayerPath_Click(object sender, EventArgs e)//单击 选择shp格式的文件 { OpenFileDialog dlg = new OpenFileDialog(); @@ -949,38 +870,6 @@ } //txtLayername.Text = type + layername; } - /// - /// 连接数据库 - /// - /// - /// - private void buttonX1_Click(object sender, EventArgs e) - { - if (ds == null) - { - //没连的话,直接连接审核库; //审核库配置读配置文件 - string dbIp = Utility.sgdbip; - string database = Utility.sgdbname; - string user = Utility.sgdbuser; - string pass = Utility.sgdbpwd; - - if (!Utility.isNetworkConnectionSuccess(dbIp.Trim())) - { - MessageBox.Show("网络连接失败!", "提示"); - return; - } - - ds = ctl.Globe.DataManager.OpenOracleDataSource(dbIp + "/" + database, "", "", user, pass); - if (ds == null) - { - MessageBox.Show("数据库连接失败!", "提示", MessageBoxButtons.OK, MessageBoxIcon.Warning); - } - else - { - btnCreateModel.Enabled = true; - } - } - } private void btnClose_Click(object sender, EventArgs e) { diff --git a/Forms/FrmShRK.cs b/Forms/FrmShRK.cs index 0e2e722..f1d83cb 100644 --- a/Forms/FrmShRK.cs +++ b/Forms/FrmShRK.cs @@ -215,6 +215,7 @@ { sourcefeatds = sourcefeat as GSOFeatureDataset; } + if (sourcefeatds == null) return; sourcefeatds.Open(); GSOFeatures sourcefeatures = sourcefeatds.GetAllFeatures(); @@ -251,6 +252,7 @@ { desfeatds = desfeat as GSOFeatureDataset; } + if (desfeatds == null) return; desfeatds.Open(); //向新数据集写入字段 diff --git a/FrmAccessoriesSensor.cs b/FrmAccessoriesSensor.cs index 09fcdf1..2a7a80e 100644 --- a/FrmAccessoriesSensor.cs +++ b/FrmAccessoriesSensor.cs @@ -209,7 +209,7 @@ chart1.Series[0].Points.DataBindXY(dic.Keys, dic.Values); for (int m = 0; m < dic.Values.Count; m++) { - if (chart1.Series[0].Points[m].YValues[0].ToString() != "0") + if (chart1.Series[0].Points[m]!=null&&chart1.Series[0].Points[m].YValues[0].ToString() != "0") { chart1.Series[0].Points[m].Label = chart1.Series[0].Points[m].YValues[0].ToString(); } diff --git a/FrmAccessoriesgather.cs b/FrmAccessoriesgather.cs index 9e331e1..a475d9e 100644 --- a/FrmAccessoriesgather.cs +++ b/FrmAccessoriesgather.cs @@ -338,7 +338,7 @@ chart1.Series[0].Points.DataBindXY(dic.Keys, dic.Values); for (int m = 0; m < dic.Values.Count; m++) { - if (chart1.Series[0].Points[m].YValues[0].ToString() != "0") + if (chart1.Series[0].Points[m]!=null&&chart1.Series[0].Points[m].YValues[0].ToString() != "0") { chart1.Series[0].Points[m].Label = chart1.Series[0].Points[m].YValues[0].ToString(); } diff --git a/FrmAccessoryAnalysis.cs b/FrmAccessoryAnalysis.cs index 71d4579..44d4065 100644 --- a/FrmAccessoryAnalysis.cs +++ b/FrmAccessoryAnalysis.cs @@ -66,39 +66,6 @@ globeControl1.Refresh(); } /// - /// 键盘按键按下事件处理 - /// - /// - /// - private void txtRadius_KeyPress(object sender, KeyPressEventArgs e) - { - TextBox text = sender as TextBox; - if ((e.KeyChar < 48 || e.KeyChar > 57) && (e.KeyChar != 8) && (int)e.KeyChar != 46) - { - e.Handled = true; - } - if ((int)e.KeyChar == 46) //小数点 - { - if (text.Text.Length <= 0) - e.Handled = true; //小数点不能在第一位 - else //处理不规则的小数点 - { - float f; - float oldf; - bool b1 = false, b2 = false; - b1 = float.TryParse(text.Text, out oldf); - b2 = float.TryParse(text.Text + e.KeyChar.ToString(), out f); - if (b2 == false) - { - if (b1 == true) - e.Handled = true; - else - e.Handled = false; - } - } - } - } - /// /// 确定按钮事件处理 /// /// diff --git a/FrmAddValve.cs b/FrmAddValve.cs index 34d2fec..5f405b9 100644 --- a/FrmAddValve.cs +++ b/FrmAddValve.cs @@ -486,56 +486,6 @@ } } - - - - - - - - private void cmbLayer_SelectedIndexChanged(object sender, EventArgs e) - { - GSOLayer layer = globeControl1.Globe.Layers.GetLayerByCaption(selectLayerName); - GSOFeatures features = layer.GetAllFeatures(); - if (features.Length == 0) - return; - - combPath.Items.Clear(); - combZ.Items.Clear(); - combModelName.Items.Clear(); - - for (int i = 0; i < features[0].GetFieldCount(); i++) - { - GeoScene.Data.GSOFieldDefn fielddef = (GeoScene.Data.GSOFieldDefn)(features[0].GetFieldDefn(i)); - combPath.Items.Add(fielddef.Name); - combZ.Items.Add(fielddef.Name); - combModelName.Items.Add(fielddef.Name); - } - combModelName.SelectedItem = "编号"; - combPath.SelectedItem = "模型路径"; - if (combfile.SelectedIndex != -1) - { - - string layerCaption = combfile.SelectedItem.ToString().Trim(); - rukuLayer = globeControl1.Globe.Layers.GetLayerByCaption(layerCaption); - if (rukuLayer != null) - { - combPath.Items.Clear(); - combZ.Items.Clear(); - combModelName.Items.Clear(); - - } - for (int i = 0; i < features[0].GetFieldCount(); i++) - { - GeoScene.Data.GSOFieldDefn fielddef = (GeoScene.Data.GSOFieldDefn)(features[0].GetFieldDefn(i)); - combPath.Items.Add(fielddef.Name); - combZ.Items.Add(fielddef.Name); - combModelName.Items.Add(fielddef.Name); - } - combModelName.SelectedItem = "编号"; - combPath.SelectedItem = "模型路径"; - } - } /// /// 单击选择shp格式文件 /// diff --git a/FrmAddWellShp.cs b/FrmAddWellShp.cs index bb79ec0..a249725 100644 --- a/FrmAddWellShp.cs +++ b/FrmAddWellShp.cs @@ -478,32 +478,6 @@ } } } - - private void cmbLayer_SelectedIndexChanged(object sender, EventArgs e) - { - GSOLayer layer = globeControl1.Globe.Layers.GetLayerByCaption(selectLayerName); - GSOFeatures features = layer.GetAllFeatures(); - if (features.Length == 0) - return; - - combCode.Items.Clear(); - combDeep.Items.Clear(); - combModelName.Items.Clear(); - combAngle.Items.Clear(); - - for (int i = 0; i < features[0].GetFieldCount(); i++) - { - GeoScene.Data.GSOFieldDefn fielddef = (GeoScene.Data.GSOFieldDefn)(features[0].GetFieldDefn(i)); - combCode.Items.Add(fielddef.Name); - combDeep.Items.Add(fielddef.Name); - combModelName.Items.Add(fielddef.Name); - combAngle.Items.Add(fielddef.Name); - } - combCode.SelectedItem = "附属物编码"; - combDeep.SelectedItem = "井深"; - combModelName.SelectedItem = "编号"; - combAngle.SelectedItem = "符号角度"; - } /// /// 单击选择shp格式文件 /// diff --git a/FrmAddYuBiZiShp.cs b/FrmAddYuBiZiShp.cs index b312d51..332f037 100644 --- a/FrmAddYuBiZiShp.cs +++ b/FrmAddYuBiZiShp.cs @@ -383,80 +383,7 @@ } } - private void cmbLayer_SelectedIndexChanged(object sender, EventArgs e) - { - GSOLayer layer = globeControl1.Globe.Layers.GetLayerByCaption(selectLayerName); - GSOFeatures features = layer.GetAllFeatures(); - if (features.Length == 0) - return; - - combCode.Items.Clear(); - combDeep.Items.Clear(); - combModelName.Items.Clear(); - //comboLoad.Items.Clear(); - for (int i = 0; i < features[0].GetFieldCount(); i++) - { - GeoScene.Data.GSOFieldDefn fielddef = (GeoScene.Data.GSOFieldDefn)(features[0].GetFieldDefn(i)); - combCode.Items.Add(fielddef.Name); - combDeep.Items.Add(fielddef.Name); - combModelName.Items.Add(fielddef.Name); - //comboLoad.Items.Add(fielddef.Name); - } - combCode.SelectedItem = "附属物编码"; - combDeep.SelectedItem = "Z坐标"; - combModelName.SelectedItem = "编号"; - //comboLoad.SelectedItem = "模型路径"; - } - - private void buttonXLayerPath_Click(object sender, EventArgs e) - { - OpenFileDialog dlg = new OpenFileDialog(); - dlg.Filter = "*.shp|*.shp"; - dlg.Multiselect = false; - if (dlg.ShowDialog() == DialogResult.OK) - { - GSOLayer layer = globeControl1.Globe.Layers.Add(dlg.FileName); - string txtMessage = valiYBdata(layer); - if (txtMessage != "") - { - button3.Enabled = false; - //textBoxLayer.Text = ""; - combCode.Items.Clear(); - combDeep.Items.Clear(); - combModelName.Items.Clear(); - globeControl1.Globe.Layers.Remove(layer); - FrmValiDataShowErrorMessage showErrorMessage = new FrmValiDataShowErrorMessage(dlg.FileName, txtMessage); - showErrorMessage.ShowDialog(); - return; - } - else - { - button3.Enabled = true; - //textBoxLayer.Text = dlg.FileName; - selectLayerName = layer.Caption; - txtLayerName.Text = layer.Caption; - GSOFeatures features = layer.GetAllFeatures(); - if (features.Length == 0) - return; - - combCode.Items.Clear(); - combDeep.Items.Clear(); - combModelName.Items.Clear(); - for (int i = 0; i < features[0].GetFieldCount(); i++) - { - GeoScene.Data.GSOFieldDefn fielddef = (GeoScene.Data.GSOFieldDefn)(features[0].GetFieldDefn(i)); - combCode.Items.Add(fielddef.Name); - combDeep.Items.Add(fielddef.Name); - combModelName.Items.Add(fielddef.Name); - //comboLoad.Items.Add(fielddef.Name); - } - combCode.SelectedItem = "管点编码"; - combDeep.SelectedItem = "Z坐标"; - combModelName.SelectedItem = "编号"; - } - } - } - + private void FrmAddYuBiZiShp_FormClosing(object sender, FormClosingEventArgs e) { globeControl1.Globe.Refresh(); diff --git a/FrmAllPipelineStatis.cs b/FrmAllPipelineStatis.cs index 6421a26..a6eea29 100644 --- a/FrmAllPipelineStatis.cs +++ b/FrmAllPipelineStatis.cs @@ -84,7 +84,7 @@ chartAllAreaPipeline.Series["管线"].Points.DataBindXY(pipelineLengthAndType.Keys, pipelineLengthAndType.Values); for (int m = 0; m < pipelineLengthAndType.Values.Count; m++) { - if (chartAllAreaPipeline.Series["管线"].Points[m].YValues[0].ToString() != "0") + if (chartAllAreaPipeline.Series["管线"].Points[m]!=null&&chartAllAreaPipeline.Series["管线"].Points[m].YValues[0].ToString() != "0") { chartAllAreaPipeline.Series["管线"].Points[m].Label = chartAllAreaPipeline.Series[0].Points[m].YValues[0].ToString(); } @@ -94,7 +94,7 @@ } catch (Exception ex) { - //LogError.PublishError(ex); + LogHelper.WriteLog(typeof(FrmAllPipelineStatis), ex.Message); } } @@ -147,7 +147,7 @@ } DataTable dt = OledbHelper.QueryTable(sql); - if (dt != null && dt.Rows.Count > 0) + if (dt != null && dt.Rows.Count > 0 && chartAllAreaPipeline.Series["管线"].Points[indexHit]!=null) { dataGridViewX1.DataSource = dt; panel.Visible = true; diff --git a/FrmAllWorkWellStatis.cs b/FrmAllWorkWellStatis.cs index 6fec7af..6af8e4c 100644 --- a/FrmAllWorkWellStatis.cs +++ b/FrmAllWorkWellStatis.cs @@ -52,7 +52,7 @@ chartAllAreaPipeline.Series["井盖"].Points.DataBindXY(workWellLengthAndType.Keys, workWellLengthAndType.Values); for (int m = 0; m < workWellLengthAndType.Values.Count; m++) { - if (chartAllAreaPipeline.Series["井盖"].Points[m].YValues[0].ToString().Trim() != "0") + if (chartAllAreaPipeline.Series["井盖"].Points[m]!=null&&chartAllAreaPipeline.Series["井盖"].Points[m].YValues[0].ToString().Trim() != "0") { chartAllAreaPipeline.Series["井盖"].Points[m].Label = chartAllAreaPipeline.Series[0].Points[m].YValues[0].ToString(); } @@ -60,7 +60,7 @@ } catch (Exception ex) { - //LogError.PublishError(ex); + LogHelper.WriteLog(typeof(FrmAllWorkWellStatis), ex.Message); } } diff --git a/FrmBSQDuoBianXingStatis.cs b/FrmBSQDuoBianXingStatis.cs index e8b7d52..3e889b6 100644 --- a/FrmBSQDuoBianXingStatis.cs +++ b/FrmBSQDuoBianXingStatis.cs @@ -60,7 +60,7 @@ { for (int m = 0; m < bsq1.Values.Count; m++) { - if (chart1.Series["标识器"].Points[m].YValues[0].ToString() != "0") + if (chart1.Series["标识器"].Points[m]!=null&&chart1.Series["标识器"].Points[m].YValues[0].ToString() != "0") { count += Convert.ToInt16(chart1.Series[0].Points[m].YValues[0].ToString()); chart1.Series["标识器"].Points[m].Label = chart1.Series[0].Points[m].YValues[0].ToString(); diff --git a/FrmBSQDuoBianXingStreet.cs b/FrmBSQDuoBianXingStreet.cs index 2005ebb..1db5777 100644 --- a/FrmBSQDuoBianXingStreet.cs +++ b/FrmBSQDuoBianXingStreet.cs @@ -63,7 +63,7 @@ chartStatis.Series[0].Points.DataBindXY(bsq.Keys, bsq.Values); for (int m = 0; m < bsq.Values.Count; m++) { - if (chartStatis.Series[0].Points[m].YValues[0].ToString().Trim() != "0") + if (chartStatis.Series[0].Points[m]!=null&&chartStatis.Series[0].Points[m].YValues[0].ToString().Trim() != "0") { count += Convert.ToInt16(chartStatis.Series[0].Points[m].YValues[0].ToString()); chartStatis.Series[0].Points[m].Label = chartStatis.Series[0].Points[m].YValues[0].ToString(); diff --git a/FrmBSQStatis.cs b/FrmBSQStatis.cs index 390a55c..4aa0ee6 100644 --- a/FrmBSQStatis.cs +++ b/FrmBSQStatis.cs @@ -95,6 +95,8 @@ } } } + + dr.Close(); conn.Close(); for (int i = 0; i < typeLists.Count; i++) { @@ -123,7 +125,7 @@ chartStatis.Series[0].Points.DataBindXY(bsq.Keys, bsq.Values); for (int m = 0; m < bsq.Values.Count; m++) { - if (chartStatis.Series[0].Points[m].YValues[0].ToString().Trim() != "0") + if (chartStatis.Series[0].Points[m]!=null&&chartStatis.Series[0].Points[m].YValues[0].ToString().Trim() != "0") { //count += Convert.ToInt16(chartStatis.Series[0].Points[m].YValues[0].ToString()); chartStatis.Series[0].Points[m].Label = chartStatis.Series[0].Points[m].YValues[0].ToString(); diff --git a/FrmBSQStreet.cs b/FrmBSQStreet.cs index 9d88adb..7fbacad 100644 --- a/FrmBSQStreet.cs +++ b/FrmBSQStreet.cs @@ -44,7 +44,7 @@ chartStatis.Series[0].Points.DataBindXY(bsq.Keys, bsq.Values); for (int m = 0; m < bsq.Values.Count; m++) { - if (chartStatis.Series[0].Points[m].YValues[0].ToString().Trim() != "0") + if (chartStatis.Series[0].Points[m]!=null&&chartStatis.Series[0].Points[m].YValues[0].ToString().Trim() != "0") { count += Convert.ToInt16(chartStatis.Series[0].Points[m].YValues[0].ToString()); chartStatis.Series[0].Points[m].Label = chartStatis.Series[0].Points[m].YValues[0].ToString(); diff --git a/FrmBoosterValvers.cs b/FrmBoosterValvers.cs index 5061efc..df9b62b 100644 --- a/FrmBoosterValvers.cs +++ b/FrmBoosterValvers.cs @@ -236,199 +236,6 @@ count = 0; } } - /// - /// 添加火苗 - /// - /// - /// - /// - /// - private GSOFeature AddFire(double x,double y,double z) - { - // 烟火示例 - - string strResPath = Application.StartupPath + "/Resource"; - - // 烟火粒子示例,由三个发射器构成 - GSOGeoParticle geoParticle = new GSOGeoParticle(); - geoParticle.SetPosition(x, y, z); // 添加到这个经纬度位置 - geoParticle.AltitudeMode = EnumAltitudeMode.RelativeToGround; - - GSORingParticleEmitter emitter = new GSORingParticleEmitter(); - emitter.TexturePath = strResPath + "/ParticleImage/flare.png"; - - emitter.SetSizeFix(1, 1); - emitter.VelFix = 1; - emitter.VelRnd = 5; - - emitter.AngleXYFix = 0; - emitter.AngleXYRnd = 180; - - emitter.AngleXZFix = 90; - emitter.AngleXZRnd = 0; - - emitter.LifeFix = 0.5f; - emitter.LifeRnd = 0.0f; - - emitter.RotFix = 0; - emitter.RotRnd = 0; - - emitter.RotVelFix = 0; - emitter.RotVelRnd = 0; - - emitter.EmitPerSec = 100; - - // 采用线性插值生成粒子的初始颜色 - emitter.ColorRndStart = Color.White; - emitter.ColorRndEnd = Color.Red; - - - GSOColorParticleEffector effector2 = new GSOColorParticleEffector(); - effector2.SetColorChanged(0, -1, -1, 0); - effector2.StartTime = 0.0f; - effector2.EndTime = -1.0f; - emitter.AddEffector(effector2); - - // 将三个发射器添加到粒子对象中 - geoParticle.AddEmitter(emitter); - - geoParticle.Play(); - - GSOFeature feature = new GSOFeature(); - - feature.Geometry = geoParticle; - - globeControl1.Globe.MemoryLayer.AddFeature(feature); - - - return feature; - } - - /// - /// 添加喷泉 - /// - /// - private GSOFeature AddFountain() - { - string strResPath = Application.StartupPath + "/Resource"; - - GSOGeoParticle geoParticle = new GSOGeoParticle(); - geoParticle.SetPosition(116.314, 39.84, 0); // 添加到这个经纬度位置 - - GSOPointParticleEmitter emitter = new GSOPointParticleEmitter(); - emitter.TexturePath = strResPath + "/ParticleImage/test.png"; - - emitter.SetSizeFix(0.5f, 2); - emitter.VelFix = 10; - emitter.VelRnd = 2; - - emitter.GravityAcc = 9.8f; - emitter.AngleXYFix = 0; - emitter.AngleXYRnd = 180; - - emitter.AngleXZFix = 88; - emitter.AngleXZRnd = 2; - - //emitter.InnerRadius = 0; - // emitter.OuterRadius = 0.03f; - - emitter.LifeFix = 5.0f; - emitter.LifeRnd = 1.0f; - - emitter.RotFix = 0; - emitter.RotRnd = 0; - - emitter.RotVelFix = 0; - emitter.RotVelRnd = 0; - - emitter.EmitPerSec = 1000; - emitter.ColorRndStart = Color.FromArgb(33, 255, 255, 255); - emitter.ColorRndEnd = Color.FromArgb(11, 255, 255, 255); - emitter.IsLumAdded = false; - - // 将三个发射器添加到粒子对象中 - geoParticle.AddEmitter(emitter); - - geoParticle.Play(); - GSOFeature feature = new GSOFeature(); - - feature.Geometry = geoParticle; - - //globeControl1.Globe.MemoryLayer.AddFeature(feature); - globeControl1.Globe.FlyToFeature(feature); - - return feature; - } - - /// - /// 添加水柱 - /// - /// - private GSOFeature AddWaterLine() - { - string strResPath = Application.StartupPath + "/Resource"; - - GSOGeoParticle geoParticle = new GSOGeoParticle(); - geoParticle.SetPosition(116.308, 39.84, 0); // 添加到这个经纬度位置 - - GSOPointParticleEmitter emitter = new GSOPointParticleEmitter(); - - emitter.TexturePath = strResPath + "/ParticleImage/drop3.png"; - - geoParticle.TimerInterval = 1; - - emitter.SetSizeFix(2.0f, 2.0f); - - emitter.VelFix = 50; - emitter.VelRnd = 2; - - // emitter.IsLumAdded = false; - - emitter.GravityAcc = 9.8f; - emitter.AngleXYFix = 0; - emitter.AngleXYRnd = 2; - - emitter.AngleXZFix = 60; - emitter.AngleXZRnd = 2; - - //emitter.InnerRadius = 0; - // emitter.OuterRadius = 0.1f; - - emitter.LifeFix = 5.0f; - emitter.LifeRnd = 1.0f; - - emitter.RotFix = 0; - emitter.RotRnd = 0; - - emitter.RotVelFix = 0; - emitter.RotVelRnd = 0; - - emitter.EmitPerSec = 1500; - - emitter.ColorRndStart = Color.FromArgb(100, 222, 222, 222); - emitter.ColorRndEnd = Color.FromArgb(50, 222, 222, 222); - - /* - - GSOScaleParticleEffector effector1 = new GSOScaleParticleEffector(); - effector1.SetScale(0.2f, 0.2f); - effector1.StartTime = 0; - effector1.EndTime = -1; // 负数表示整个粒子生命结束 - emitter.AddEffector(effector1); - */ - - // 将三个发射器添加到粒子对象中 - geoParticle.AddEmitter(emitter); - - geoParticle.Play(); - GSOFeature feature = new GSOFeature(); - - feature.Geometry = geoParticle; - - //globeControl1.Globe.MemoryLayer.AddFeature(feature); - globeControl1.Globe.FlyToFeature(feature); - - return feature; - } + } } diff --git a/FrmBufferAnalysis.cs b/FrmBufferAnalysis.cs index f711133..db8ca59 100644 --- a/FrmBufferAnalysis.cs +++ b/FrmBufferAnalysis.cs @@ -123,39 +123,6 @@ } } /// - /// 半径文本框的键盘按键按下事件处理 - /// - /// - /// - private void txtRadius_KeyPress(object sender, KeyPressEventArgs e) - { - TextBox text = sender as TextBox; - if ((e.KeyChar < 48 || e.KeyChar > 57) && (e.KeyChar != 8) && (int)e.KeyChar != 46) - { - e.Handled = true; - } - if ((int)e.KeyChar == 46) //小数点 - { - if (text.Text.Length <= 0) - e.Handled = true; //小数点不能在第一位 - else //处理不规则的小数点 - { - float f; - float oldf; - bool b1 = false, b2 = false; - b1 = float.TryParse(text.Text, out oldf); - b2 = float.TryParse(text.Text + e.KeyChar.ToString(), out f); - if (b2 == false) - { - if (b1 == true) - e.Handled = true; - else - e.Handled = false; - } - } - } - } - /// /// 窗体关闭事件处理 /// /// diff --git a/FrmBufferAnalysisBSQ.cs b/FrmBufferAnalysisBSQ.cs index 24a96ca..f54208f 100644 --- a/FrmBufferAnalysisBSQ.cs +++ b/FrmBufferAnalysisBSQ.cs @@ -137,35 +137,7 @@ } } - private void txtRadius_KeyPress(object sender, KeyPressEventArgs e) - { - TextBox text = sender as TextBox; - if ((e.KeyChar < 48 || e.KeyChar > 57) && (e.KeyChar != 8) && (int)e.KeyChar != 46) - { - e.Handled = true; - } - if ((int)e.KeyChar == 46) //小数点 - { - if (text.Text.Length <= 0) - e.Handled = true; //小数点不能在第一位 - else //处理不规则的小数点 - { - float f; - float oldf; - bool b1 = false, b2 = false; - b1 = float.TryParse(text.Text, out oldf); - b2 = float.TryParse(text.Text + e.KeyChar.ToString(), out f); - if (b2 == false) - { - if (b1 == true) - e.Handled = true; - else - e.Handled = false; - } - } - } - } - + private void FrmBufferAnalysis_FormClosing(object sender, FormClosingEventArgs e) { //Form1.y = 0; @@ -316,27 +288,6 @@ } } - private void FlyToMenu_Click(object sender, EventArgs e) - { - if (m_feature != null) - { - if (m_feature.Geometry != null && m_feature.Geometry.Type == EnumGeometryType.GeoPolyline3D) - { - GSOGeoPolyline3D line = m_feature.Geometry as GSOGeoPolyline3D; - double length = line.GetSpaceLength(true, 6378137); - GSOGeoPolyline3D lineLine = line.GetSegment(0, length / 2); - GSOPoint3d point3d = lineLine[lineLine.PartCount - 1][lineLine[lineLine.PartCount - 1].Count - 1]; - - globeControl1.Globe.FlyToPosition(point3d, EnumAltitudeMode.Absolute, 0, 45, 5); - } - else - { - globeControl1.Globe.FlyToFeature(m_feature, 0, 45, 3); - } - LightMenu_Click(sender, e); - } - } - private void LightMenu_Click(object sender, EventArgs e) { flashflag = "single"; diff --git a/FrmDataBaseOpt.cs b/FrmDataBaseOpt.cs index b0c4b5d..8d7b69d 100644 --- a/FrmDataBaseOpt.cs +++ b/FrmDataBaseOpt.cs @@ -362,6 +362,7 @@ dbCombor.Items.Add(dblist[i].title); } } + /* /// /// 从配置文件读取数据库参数配置 /// @@ -428,6 +429,8 @@ } } + * */ + /* /// /// 向配置文件写入连接数据库的参数配置 /// @@ -485,6 +488,7 @@ MessageBox.Show(exp.ToString()); } } + * */ /// /// /// diff --git a/FrmDatabaseParaSetting.cs b/FrmDatabaseParaSetting.cs index a6fea46..63b596b 100644 --- a/FrmDatabaseParaSetting.cs +++ b/FrmDatabaseParaSetting.cs @@ -152,6 +152,7 @@ this.DialogResult = DialogResult.OK; this.Close(); } + /* /// /// 从配置文件读取数据库连接参数配置 /// @@ -218,6 +219,8 @@ } } + * */ + /* /// /// 向配置文件写入数据库参数配置 /// @@ -276,7 +279,7 @@ MessageBox.Show(ex.ToString()); } } - + */ /// /// 取消按钮事件处理 /// diff --git a/FrmDatabaseParaSetting2.cs b/FrmDatabaseParaSetting2.cs index 932d05e..96a87d5 100644 --- a/FrmDatabaseParaSetting2.cs +++ b/FrmDatabaseParaSetting2.cs @@ -148,6 +148,7 @@ this.DialogResult = DialogResult.OK; this.Close(); } + /* /// /// 从配置文件读取数据库连接参数配置 /// @@ -214,6 +215,8 @@ } } + * */ + /* /// /// 向配置文件写入数据库参数配置 /// @@ -272,7 +275,7 @@ MessageBox.Show(exp.ToString()); } } - + */ /// /// 取消按钮事件处理 /// diff --git a/FrmDiameterQuery.cs b/FrmDiameterQuery.cs index 68c948b..9a5215b 100644 --- a/FrmDiameterQuery.cs +++ b/FrmDiameterQuery.cs @@ -77,18 +77,7 @@ isBetween = true; } } - /// - /// 键盘按键按下事件处理 - /// - /// - /// - private void textBoxX1_KeyPress(object sender, KeyPressEventArgs e) - { - if ((e.KeyChar < 48 || e.KeyChar > 57) && e.KeyChar != 8) - { - e.Handled = true;//屏蔽 - } - } + bool isBetween = false; /// diff --git a/FrmDocumentEdit.cs b/FrmDocumentEdit.cs index aab2d31..e78a7ff 100644 --- a/FrmDocumentEdit.cs +++ b/FrmDocumentEdit.cs @@ -256,121 +256,6 @@ } - // - /// 将本地文件上传到指定的服务器(HttpWebRequest方法) - /// - /// 文件上传到的服务器 - /// 要上传的本地文件(全路径) - /// 文件上传后的名称 - /// 上传进度条 - /// 成功返回1,失败返回0 - private int Upload_Request(string address, string fileNamePath, string saveName, ProgressBar progressBar) - { - int returnValue = 0; - // 要上传的文件 - FileStream fs = new FileStream(fileNamePath, FileMode.Open, FileAccess.Read); - BinaryReader r = new BinaryReader(fs); - //时间戳 - string strBoundary = "----------" + DateTime.Now.Ticks.ToString("x"); - byte[] boundaryBytes = Encoding.ASCII.GetBytes("/r/n--" + strBoundary + "/r/n"); - //请求头部信息 - StringBuilder sb = new StringBuilder(); - sb.Append("--"); - sb.Append(strBoundary); - sb.Append("\r\n"); - sb.Append("Content-Disposition: form-data; name=\""); - sb.Append("file"); - sb.Append("\"; filename=\""); - sb.Append(saveName); - sb.Append("\""); - sb.Append("\r\n"); - sb.Append("Content-Type: "); - sb.Append("application/octet-stream"); - sb.Append("\r\n"); - sb.Append("\r\n"); - string strPostHeader = sb.ToString(); - byte[] postHeaderBytes = Encoding.UTF8.GetBytes(strPostHeader); - // 根据uri创建HttpWebRequest对象 - HttpWebRequest httpReq = (HttpWebRequest)WebRequest.Create(new Uri(address)); - httpReq.Method = "POST"; - //对发送的数据不使用缓存 - httpReq.AllowWriteStreamBuffering = false; - //设置获得响应的超时时间(300秒) - httpReq.Timeout = 300000; - httpReq.ContentType = "multipart/form-data; boundary=" + strBoundary; - long length = fs.Length + postHeaderBytes.Length + boundaryBytes.Length; - long fileLength = fs.Length; - httpReq.ContentLength = length; - try - { - progressBar.Maximum = int.MaxValue; - progressBar.Minimum = 0; - progressBar.Value = 0; - //每次上传4k - int bufferLength = 4096; - byte[] buffer = new byte[bufferLength]; - //已上传的字节数 - long offset = 0; - //开始上传时间 - DateTime startTime = DateTime.Now; - int size = r.Read(buffer, 0, bufferLength); - Stream postStream = httpReq.GetRequestStream(); - //发送请求头部消息 - postStream.Write(postHeaderBytes, 0, postHeaderBytes.Length); - while (size > 0) - { - postStream.Write(buffer, 0, size); - offset += size; - progressBar.Value = (int)(offset * (int.MaxValue / length)); - TimeSpan span = DateTime.Now - startTime; - double second = span.TotalSeconds; - //lblTime.Text = "已用时:" + second.ToString("F2") + "秒"; - //if (second > 0.001) - //{ - // lblSpeed.Text = " 平均速度:" + (offset / 1024 / second).ToString("0.00") + "KB/秒"; - //} - //else - //{ - // lblSpeed.Text = " 正在连接…"; - //} - //lblState.Text = "已上传:" + (offset * 100.0 / length).ToString("F2") + "%"; - //lblSize.Text = (offset / 1048576.0).ToString("F2") + "M/" + (fileLength / 1048576.0).ToString("F2") + "M"; - Application.DoEvents(); - size = r.Read(buffer, 0, bufferLength); - } - //添加尾部的时间戳 - postStream.Write(boundaryBytes, 0, boundaryBytes.Length); - postStream.Close(); - //获取服务器端的响应 - WebResponse webRespon = httpReq.GetResponse(); - Stream s = webRespon.GetResponseStream(); - StreamReader sr = new StreamReader(s); - //读取服务器端返回的消息 - String sReturnString = sr.ReadLine(); - s.Close(); - sr.Close(); - if (sReturnString == "Success") - { - returnValue = 1; - } - else if (sReturnString == "Error") - { - returnValue = 0; - } - } - catch(Exception ex) - { - returnValue = 0; - string str = ex.ToString(); - } - finally - { - fs.Close(); - r.Close(); - } - return returnValue; - } - private void btn_file_Click(object sender, EventArgs e) { OpenFileDialog dlg = new OpenFileDialog(); diff --git a/FrmExportCADS.cs b/FrmExportCADS.cs index 98772ea..59629dd 100644 --- a/FrmExportCADS.cs +++ b/FrmExportCADS.cs @@ -108,65 +108,6 @@ MessageBox.Show("请选中要导出的图层!", "提示", MessageBoxButtons.OK, MessageBoxIcon.Warning); } } - private Boolean MerageToFile(GSOFeatures features, String strDestFile, String strProj4)//图层追加 - { - if (features == null) - { - return false; - } - Boolean bSuccess = false; - - string strDir = GSOUtility.GetFileDir(strDestFile); - string strLPRJFile = GSOUtility.ChangeExt(strDestFile, ".lprj"); - string strExt = GSOUtility.GetFileExt(strDestFile); - - // 如果投影文件存在,投影以投影文件为准 - if (File.Exists(strLPRJFile)) - { - // 如果是dxf,则这样处理 - if (strExt.ToLower() == ".dxf") - { - string strTempSrcFile = strDir + "srcFeatures_dxftmp" + strExt; - globeControl1.Globe.DataManager.SaveFeatureData(features, strTempSrcFile, strLPRJFile, 4); - bSuccess = GSOUtility.MergeTwoDXFFileFeatures(strDestFile, strTempSrcFile); - File.Delete(strTempSrcFile); - } - else - { - GSOFeatures srcFeatures = globeControl1.Globe.DataManager.ReadFeatureData(strDestFile); - int nCount = features.Length; - int i = 0; - for (i = 0; i < nCount; i++) - { - srcFeatures.Add(features[i]); - } - bSuccess = globeControl1.Globe.DataManager.SaveFeatureData(srcFeatures, strDestFile, strLPRJFile, 4); - } - } - else - { - // 如果是dxf,则这样处理 - if (strExt.ToLower() == ".dxf") - { - string strTempSrcFile = strDir + "srcFeatures_dxftmp" + strExt; - globeControl1.Globe.DataManager.SaveFeatureData(features, strTempSrcFile, strProj4, 0); - bSuccess = GSOUtility.MergeTwoDXFFileFeatures(strDestFile, strTempSrcFile); - File.Delete(strTempSrcFile); - } - else - { - GSOFeatures srcFeatures = globeControl1.Globe.DataManager.ReadFeatureData(strDestFile); - int nCount = features.Length; - int i = 0; - for (i = 0; i < nCount; i++) - { - srcFeatures.Add(features[i]); - } - bSuccess = globeControl1.Globe.DataManager.SaveFeatureData(srcFeatures, strDestFile, strProj4, 0); - } - } - return bSuccess; - } /// /// 关闭按钮事件处理 /// diff --git a/FrmHDMAnalysis3.cs b/FrmHDMAnalysis3.cs index 4f73af6..2ada735 100644 --- a/FrmHDMAnalysis3.cs +++ b/FrmHDMAnalysis3.cs @@ -436,29 +436,6 @@ } layerTemp.RemoveAllFeature(); } - private void Export(GSOPoint3d _pnt, double r) - { - GSOPoint3ds pnts = new GSOPoint3ds(); - GSOPoint3d pnt = new GSOPoint3d(); - pnt.X = _pnt.X; - pnt.Y = _pnt.Y; - pnt.Z = _pnt.Z; - pnts.Add(pnt); - pnt.X = _pnt.X; - pnt.Y = _pnt.Y - 0.0000000005; - pnt.Z = _pnt.Z; - pnts.Add(pnt); - GSOGeoPolyline3D line = new GSOGeoPolyline3D(); - line.AddPart(pnts); - GSOGeoPolygon3D polygon = line.CreateBuffer(r * 2, true, 5, true, false); - GSOPoint3ds points = polygon[0]; - GSOGeoPolyline3D newLine = new GSOGeoPolyline3D(); - newLine.AddPart(points); - newLine.AltitudeMode = EnumAltitudeMode.RelativeToGround; - GSOFeature newFeature = new GSOFeature(); - newFeature.Geometry = newLine; - globeControl1.Globe.MemoryLayer.AddFeature(newFeature); - } private void ExportCAD(double a, double b, double r) { diff --git a/FrmHotFuncStat.cs b/FrmHotFuncStat.cs index c980f34..2eb1476 100644 --- a/FrmHotFuncStat.cs +++ b/FrmHotFuncStat.cs @@ -421,13 +421,6 @@ } } - private void HFS_Pderive_Click(object sender, EventArgs e) - { - if (TV_Files.SelectedNode != null) - { - HFSClass.GuideEdit_form("G", TV_Files, int.Parse(((ToolStripMenuItem)sender).Tag.ToString())); - } - } private void 导入ToolStripMenuItem_Click(object sender, EventArgs e) { @@ -530,22 +523,8 @@ } } - private void 导出ToolStripMenuItem1_Click(object sender, EventArgs e) - { - 导出ToolStripMenuItem2_Click(sender, e); - } + - private void TV_HFSSrchRslt_AfterCollapse(object sender, TreeViewEventArgs e) - { - e.Node.ImageIndex = 0; - } - - private void TV_HFSSrchRslt_AfterExpand(object sender, TreeViewEventArgs e) - { - HFSClass.ADD_TreeNode(TV_Files, e.Node); - e.Node.ImageIndex = 1; - } - private void 导出ToolStripMenuItem1_Click_1(object sender, EventArgs e) { if ((TV_HFSSrchRslt.SelectedNode != null) && (TV_HFSSrchRslt.SelectedNode.Parent != null)) diff --git a/FrmLayerControl.cs b/FrmLayerControl.cs index e7917c3..28fa14d 100644 --- a/FrmLayerControl.cs +++ b/FrmLayerControl.cs @@ -312,26 +312,7 @@ layerManagerNode.Expand(); terrainManagerNode.Expand(); } - /// - /// 刷新节点树 - /// - private void RefreshDataTree() - { - layerTree2.Nodes[0].Nodes.Clear(); - Int32 nCount = globeControl2.Globe.Layers.Count; - Int32 i = 0; - for (i = 0; i < nCount; i++) - { - GSODataset dataSpace = globeControl2.Globe.Layers[i].Dataset; - TreeNode node = new TreeNode(); - node.Text = dataSpace.Name; - node.ImageIndex = 0; - node.SelectedImageIndex = 0; - node.Checked = true; - node.Tag = dataSpace; - layerTree2.Nodes[0].Nodes.Add(node); - } - } + /// /// 目标图层按钮事件处理 /// @@ -494,22 +475,8 @@ } } } - /// - /// 改变指定节点的选中状态 - /// - /// - /// - private void CheckTreeNode(TreeNode node, Boolean bChecked) - { - CheckChildTreeNode(node, bChecked); - // 对于kml图层,如果当前处理的节点是true,那么要把所有的祖宗节点置为true - // 只有所有节点都未false,那么这个节点才为false - // CheckFatherTreeNode(node, bChecked); - globeControl1.Globe.Refresh(); - globeControl2.Globe.Refresh(); - - } + private void CheckChildTreeNode(TreeNode node, Boolean bChecked) { if (node == null) @@ -696,59 +663,7 @@ //} //CheckControl(e); } - /// - /// 树节点选中方法 - /// - /// - private void CheckControl(TreeViewEventArgs e) - { - if (e.Action != TreeViewAction.Unknown) - { - if (e.Node != null && !Convert.IsDBNull(e.Node)) - { - CheckParentNode(e.Node); - if (e.Node.Nodes.Count > 0) - { - CheckAllChildNodes(e.Node, e.Node.Checked); - } - } - } - } - /// - /// 改变所有子节点的状态 - /// - /// - /// - private void CheckAllChildNodes(TreeNode pn, bool IsChecked) - { - foreach (TreeNode tn in pn.Nodes) - { - tn.Checked = IsChecked; - if (tn.Tag.ToString().Contains("|")) - { - string nodeTag = tn.Tag.ToString().Split('|')[1]; - GSOLayer layer = globeControl1.Globe.Layers.GetLayerByCaption(nodeTag); - if (layer != null) - { - layer.Visible = IsChecked; - globeControl1.Globe.Refresh(); - } - } - if (tn.Tag is GSOFeature) - { - if (tn.Nodes.Count == 0) - { - GSOFeature feat = tn.Tag as GSOFeature; - feat.Visible = IsChecked; - globeControl1.Globe.Refresh(); - } - } - if (tn.Nodes.Count > 0) - { - CheckAllChildNodes(tn, IsChecked); - } - } - } + /// /// 改变父节点的选中状态,此处为所有子节点不选中时才取消父节点选中,可以根据需要修改 /// diff --git a/FrmLogin.cs b/FrmLogin.cs index 320fdd5..2afe46e 100644 --- a/FrmLogin.cs +++ b/FrmLogin.cs @@ -59,70 +59,6 @@ textBoxPassWord.Clear(); } } - - /// - /// 验证端口号 - /// - /// - private bool ValiPort() - { - Ping p = new Ping();//创建Ping对象p - PingReply pr = p.Send(Utility.localicenseserverip);//向指定IP或者主机名的计算机发送ICMP协议的ping数据包 - if (pr.Status == IPStatus.Success)//如果ping成功 - { - try - { - TcpClient tcpc = new TcpClient(Utility.localicenseserverip, Utility.localicenseserverport);//对IP地址为"192.168.0.105"的计算机的1500端口提出连接申请 - tcpc.Close(); - return true; - } - catch (Exception ex) - { - MessageBox.Show("端口连接错误!" + ex.Message); - return false; - } - } - else - { - int times = 0;//重新连接次数; - int count = 2;//设置尝试次数 - while (times < count) - { - //Thread.Sleep(1000);//等待时间(方便测试的话,你可以改为1000) - pr = p.Send(Utility.localicenseserverip); - - if (pr.Status == IPStatus.Success) - { - try - { - TcpClient tcpc = new TcpClient(Utility.localicenseserverip, Utility.localicenseserverport);//对IP地址为"192.168.0.105"的计算机的1500端口提出连接申请 - tcpc.Close(); - return true; - } - catch (Exception ex) - { - MessageBox.Show("端口连接错误!" + ex.Message); - return false; - } - } - else - { - times++; - if (times < count) - { - continue; - } - else - { - MessageBox.Show("重新尝试连接失败"); - return false; - } - } - - } - return false; - } - } /// /// 验证用户名、密码 /// diff --git a/FrmMetadata.cs b/FrmMetadata.cs index 886f65a..0365372 100644 --- a/FrmMetadata.cs +++ b/FrmMetadata.cs @@ -27,11 +27,7 @@ InitializeComponent(); loadTreeView(layerTree); } - private void FrmMetadata_Load(object sender, EventArgs e) - { - //this.ntLblC.Text = "nn"; - // loadTreeView(layerTree); - } + private void loadTreeView(TreeView tv)//构建图层树 { try diff --git a/FrmMetadataStat.cs b/FrmMetadataStat.cs index 790658a..e7696c6 100644 --- a/FrmMetadataStat.cs +++ b/FrmMetadataStat.cs @@ -197,9 +197,5 @@ } } - private void buttonX1_Click(object sender, EventArgs e) - { - drawChart(); - } } } diff --git a/FrmPatrolerManager.cs b/FrmPatrolerManager.cs index 37f8ffd..9e66aeb 100644 --- a/FrmPatrolerManager.cs +++ b/FrmPatrolerManager.cs @@ -109,82 +109,8 @@ this.winGridViewPager1.AllToExport = table; } - /// - /// 编辑 - /// - /// - /// - private void winGridViewPager1_OnEditSelected(object sender, EventArgs e) - { - - DataGridView grid = sender as DataGridView; - if (grid != null && grid.SelectedRows.Count>0) - { - DataGridViewRow row = grid.SelectedRows[0]; - try - { - long dbid = long.Parse(row.Cells["编号"].Value.ToString()); - String name = row.Cells["姓名"].Value.ToString(); - String sex = row.Cells["性别"].Value.ToString(); - String age = row.Cells["年龄"].Value.ToString(); - string phone = row.Cells["电话"].Value.ToString(); - age = String.IsNullOrEmpty(age.ToString().Trim()) ? "1" : age.ToString().Trim(); - FrmPatrolerEdit frm = new FrmPatrolerEdit(dbid.ToString(), name, age, sex, phone); - frm.reloadGrid += new ReloadPatrolerGrid(LoadData); - frm.ShowDialog(); - winGridViewPager1.Refresh(); - } - catch (Exception ex) - { - MessageBox.Show("编辑失败:" + ex.ToString(), "错误", MessageBoxButtons.OK, MessageBoxIcon.Error); - } - } - else - { - MessageBox.Show("没有选择记录", "提示"); - } - - } - - /// - /// 删除 - /// - /// - /// - private void winGridViewPager1_OnDeleteSelected(object sender, EventArgs e) - { - DataGridView grid = sender as DataGridView; - if (grid != null && grid.SelectedRows.Count > 0) - { - DataGridViewRow row = grid.SelectedRows[0]; - long dbid = long.Parse(row.Cells["编号"].Value.ToString()); - try - { - string state = row.Cells["状态"].Value.ToString(); - if ("在线".Equals(state)) - { - if (MessageBox.Show("确定注销?", "确认", MessageBoxButtons.YesNo, MessageBoxIcon.Question) == DialogResult.Yes) - { - String sql = "update patroler t set t.accountstate='LEAVER' where t.dbid=" + dbid; - OracleUtils.ExecuteNonQuery(OracleUtils.ConnectionString, CommandType.Text, sql); - } - } - else { - MessageBox.Show("人员不在线,无法注销", "信息"); - } - } - catch (Exception ex) - { - MessageBox.Show("人员注销失败:" + ex.ToString(), "错误", MessageBoxButtons.OK, MessageBoxIcon.Error); - } - } - else - { - MessageBox.Show("没有选择记录", "提示"); - } - } - - + + private void LoadData() { int pageIndex = winGridViewPager1.PagerInfo.CurrenetPageIndex; diff --git a/FrmRoadHDM.cs b/FrmRoadHDM.cs index e765313..e871dd5 100644 --- a/FrmRoadHDM.cs +++ b/FrmRoadHDM.cs @@ -333,31 +333,6 @@ this.Cursor = Cursors.Default; } } - - private void Export(GSOPoint3d _pnt, double r) - { - GSOPoint3ds pnts = new GSOPoint3ds(); - GSOPoint3d pnt = new GSOPoint3d(); - pnt.X = _pnt.X; - pnt.Y = _pnt.Y; - pnt.Z = _pnt.Z; - pnts.Add(pnt); - pnt.X = _pnt.X; - pnt.Y = _pnt.Y - 0.0000000005; - pnt.Z = _pnt.Z; - pnts.Add(pnt); - GSOGeoPolyline3D line = new GSOGeoPolyline3D(); - line.AddPart(pnts); - GSOGeoPolygon3D polygon = line.CreateBuffer(r * 2, true, 5, true, false); - GSOPoint3ds points = polygon[0]; - GSOGeoPolyline3D newLine = new GSOGeoPolyline3D(); - newLine.AddPart(points); - newLine.AltitudeMode = EnumAltitudeMode.RelativeToGround; - GSOFeature newFeature = new GSOFeature(); - newFeature.Geometry = newLine; - globeControl1.Globe.MemoryLayer.AddFeature(newFeature); - } - private void ExportCAD(double a, double b, double r) { GSOPoint3ds pnts = new GSOPoint3ds(); diff --git a/FrmUserAdd.cs b/FrmUserAdd.cs index c612ab4..f826427 100644 --- a/FrmUserAdd.cs +++ b/FrmUserAdd.cs @@ -231,24 +231,6 @@ //cbxRegion.SelectedIndexChanged += new EventHandler(cbxRegion_SelectedIndexChanged); } } - /// - /// 下拉框选中项改变事件处理 - /// - /// - /// - private void cbxRegion_SelectedIndexChanged(object sender, EventArgs e) - { - string sql = ""; - //string sql = "select casic_role.\"name\" from casic_role join casic_regionrole on casic_role.\"id\"=casic_regionrole.\"rid\" where casic_regionrole.\"reid\"=" + region[cbxRegion.SelectedItem.ToString().Trim()]; - DataTable dt = OledbHelper.QueryTable(sql); - if (dt != null && dt.Rows.Count > 0) - { - comboBoxExRegionRole.Items.Clear(); - for (int i = 0; i < dt.Rows.Count; i++) - { - comboBoxExRegionRole.Items.Add(dt.Rows[i][0].ToString().Trim());//部门角色 - } - } - } + } } diff --git a/FrmUserManager.cs b/FrmUserManager.cs index 571f0f0..ae254bc 100644 --- a/FrmUserManager.cs +++ b/FrmUserManager.cs @@ -81,11 +81,6 @@ } } } - //创建新用户 - private void buttonX2_Click(object sender, EventArgs e) - { - FrmUserAdd frm = new FrmUserAdd(-1); - frm.ShowDialog(); - } + } } diff --git a/FrmValveStatistics.cs b/FrmValveStatistics.cs index 545d56c..dd76777 100644 --- a/FrmValveStatistics.cs +++ b/FrmValveStatistics.cs @@ -54,7 +54,7 @@ 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") + if (chaFamenStatis.Series["阀门"].Points[m]!=null&&chaFamenStatis.Series["阀门"].Points[m].YValues[0].ToString() != "0") { chaFamenStatis.Series["阀门"].Points[m].Label = chaFamenStatis.Series[0].Points[m].YValues[0].ToString(); } diff --git a/Frm_password_reset.cs b/Frm_password_reset.cs index 7b51039..b9e5dc3 100644 --- a/Frm_password_reset.cs +++ b/Frm_password_reset.cs @@ -41,6 +41,7 @@ } catch (Exception ex) { + LogHelper.WriteLog(typeof(Frm_password_reset), ex.Message); } } private void initCombox() diff --git a/FrmpipeDeepstatis.cs b/FrmpipeDeepstatis.cs index e156db4..1a84d6c 100644 --- a/FrmpipeDeepstatis.cs +++ b/FrmpipeDeepstatis.cs @@ -307,7 +307,7 @@ chart1.Series[j].Points.DataBindXY(dic1.Keys, dic1.Values); for (int m = 0; m < dic1.Values.Count; m++) { - if (chart1.Series[j].Points[m].YValues[0].ToString() != "0") + if (chart1.Series[j].Points[m]!=null&&chart1.Series[j].Points[m].YValues[0].ToString() != "0") { chart1.Series[j].Points[m].Label = chart1.Series[j].Points[m].YValues[0].ToString(); diff --git a/FrmpipeDiametergather.cs b/FrmpipeDiametergather.cs index 30674de..057b09d 100644 --- a/FrmpipeDiametergather.cs +++ b/FrmpipeDiametergather.cs @@ -263,6 +263,7 @@ if (layer != null && layer is GSOFeatureLayer) { GSOFeatureLayer flayer = layer as GSOFeatureLayer; + if (layer == null) return; GSOFeatures features = flayer.GetAllFeatures(); if (features.Length > 0) { diff --git a/FrmpipeMaterialGather.cs b/FrmpipeMaterialGather.cs index c133ec3..398b884 100644 --- a/FrmpipeMaterialGather.cs +++ b/FrmpipeMaterialGather.cs @@ -280,6 +280,7 @@ if (layer != null && layer is GSOFeatureLayer) { GSOFeatureLayer flayer = layer as GSOFeatureLayer; + if (flayer == null) return; GSOFeatures features = flayer.GetAllFeatures(); if (features.Length > 0) { @@ -332,7 +333,7 @@ chart1.Series[j].Points.DataBindXY(dic1.Keys, dic1.Values); for (int m = 0; m < dic1.Values.Count; m++) { - if (chart1.Series[j].Points[m].YValues[0].ToString() != "0") + if (chart1.Series[j].Points[m]!=null&&chart1.Series[j].Points[m].YValues[0].ToString() != "0") { chart1.Series[j].Points[m].Label = chart1.Series[j].Points[m].YValues[0].ToString(); } diff --git a/Frmpipediameterstatis.cs b/Frmpipediameterstatis.cs index c0ed80a..50f8170 100644 --- a/Frmpipediameterstatis.cs +++ b/Frmpipediameterstatis.cs @@ -286,6 +286,7 @@ chart1.Series.Add(layerCaption); GSOFeatureLayer flayer = layer as GSOFeatureLayer; + if (layer == null) return; GSOFeatures features = flayer.GetAllFeatures(); if (features.Length > 0) { diff --git "a/GKT_Forms/F_GKT\346\225\260\346\215\256\350\276\223\345\205\245\350\276\223\345\207\272.cs" "b/GKT_Forms/F_GKT\346\225\260\346\215\256\350\276\223\345\205\245\350\276\223\345\207\272.cs" index c7bffd5..4db7d5d 100644 --- "a/GKT_Forms/F_GKT\346\225\260\346\215\256\350\276\223\345\205\245\350\276\223\345\207\272.cs" +++ "b/GKT_Forms/F_GKT\346\225\260\346\215\256\350\276\223\345\205\245\350\276\223\345\207\272.cs" @@ -198,12 +198,7 @@ } DialogResult = DialogResult.OK;//将当前窗体的对话框返回值设为OK } - private void treeView1_NodeMouseClick(object sender, TreeNodeMouseClickEventArgs e) - { - dir_Ok = comboBox_Disk.Text + e.Node.FullPath; - //dir = comboBox_Disk.Text + e.Node.FullPath; - e.Node.SelectedImageIndex = e.Node.ImageIndex; - } + string tempstr = ""; private void button1_Click(object sender, EventArgs e) { diff --git a/HFS_Forms/Frm_HFSprojedits.cs b/HFS_Forms/Frm_HFSprojedits.cs index 96dd76f..3c232a1 100644 --- a/HFS_Forms/Frm_HFSprojedits.cs +++ b/HFS_Forms/Frm_HFSprojedits.cs @@ -126,16 +126,6 @@ Close(); } - - - private void TB_ProjName_KeyPress(object sender, KeyPressEventArgs e) - { - if (HFSAClass.Files_NameChar(e) == 0) - e.Handled = true; - if (e.KeyChar == '\r') - OK_Click(sender, e); - } - private void Frm_HFSProjedit_Load(object sender, EventArgs e) { @@ -175,10 +165,6 @@ } } - private void Cancel_Click(object sender, EventArgs e) - { - this.Close(); - } private void Cancel_Click_1(object sender, EventArgs e) { diff --git a/MainFrm.cs b/MainFrm.cs index 2c305a0..ed2685b 100644 --- a/MainFrm.cs +++ b/MainFrm.cs @@ -617,7 +617,7 @@ } catch (Exception ex) { - + LogHelper.WriteLog(typeof(MainFrm), ex.Message); } } @@ -1768,7 +1768,7 @@ } catch (Exception ex) { - //LogError.PublishError(ex); + LogHelper.WriteLog(typeof(MainFrm), ex.Message); } } @@ -2026,6 +2026,7 @@ } catch (Exception ex) { + LogHelper.WriteLog(typeof(MainFrm), ex.Message); result = false; } finally @@ -2316,220 +2317,6 @@ string filename = Utility.filename; List g1layername = new List(); /// - /// 构建图层列表目录树 - /// - /// - private void loadTreeView(TreeView tv) - { - try - { - XmlDocument doc = new XmlDocument(); - doc.Load(filename); - XmlNodeList Params1 = doc.SelectNodes("/Params/layers"); - tv.ShowLines = false; - tv.CheckBoxes = true; - - foreach (XmlNode paramsNode in Params1) //layers - { - foreach (XmlNode layerNode in paramsNode) //layer - { - TreeNode nodelayer = new TreeNode(); - string layerName = layerNode.Attributes["label"].Value; - nodelayer.Text = layerName; - - if (layerNode.HasChildNodes != false) - { - tv.Nodes.Add(nodelayer); - foreach (XmlNode layerchildNode in layerNode) //layerchild - { - if (layerchildNode.Name == "layerchild") - { - TreeNode nodelayerchild = new TreeNode(); - string layerType = layerchildNode.Attributes["type"].Value; - string layerName1 = layerchildNode.Attributes["layer"].Value; - string layerchildName = layerchildNode.Attributes["label"].Value; - if (layerType == "locaserver") - { - if (layerchildNode.Attributes["isRoad"] != null) - { - roadLayerName = layerchildName; - } - dictionaryNetLayerNameAndCaption.Add(layerName1, layerchildName); - - nodelayerchild.Text = layerchildName; - nodelayerchild.Tag = layerType + "|" + layerchildName; - nodelayerchild.Checked = true; - nodelayer.Nodes.Add(nodelayerchild); - } - else - { - if (layerchildNode.Attributes["isPipeLine"] != null) - { - m_PipelineLayerNames.Add(layerchildName); - } - if (layerchildNode.Attributes["isWorkWell"] != null) - { - workwellLayerNames.Add(layerchildName); - } - if (layerchildNode.Attributes["isValve"] != null) - { - valueLayerNames.Add(layerchildName); - } - //if (layerchildNode.Attributes["isInstrument"] != null) - if (layerchildNode.Attributes["isAccess"] != null) - { - instrumenLayerNames.Add(layerchildName); - } - //if (layerchildNode.Attributes["isPipeFitting"] != null) - if (layerchildNode.Attributes["isCharacter"] != null) - { - pipefittingLayerNames.Add(layerchildName); - } - bool boollayer = AddLayers(layerName1, layerchildName); - nodelayerchild.Text = layerchildName; - nodelayerchild.Tag = layerType + "|" + layerchildName; - nodelayerchild.Checked = boollayer; - if (layerchildName.Contains("特征管点")) - { - nodelayerchild.Checked = false; - setLayerVisible(layerName1); - } - - nodelayer.Nodes.Add(nodelayerchild); - g1layername.Add(layerName1); - } - } - else if (layerchildNode.Name == "layertype") - { - TreeNode nodelayerchild = new TreeNode(); - string layerType = layerchildNode.Attributes["label"].Value; - nodelayerchild.Text = layerType; - nodelayerchild.Tag = layerType; - nodelayerchild.Checked = true; - nodelayer.Nodes.Add(nodelayerchild); - if (layerchildNode.HasChildNodes == true) - { - foreach (XmlNode childNodeLayer in layerchildNode) - { - if (childNodeLayer.HasChildNodes == true) - { - TreeNode nodelayerchild2 = new TreeNode(); - string layer = childNodeLayer.Attributes["label"].Value; - nodelayerchild2.Text = layer; - nodelayerchild2.Tag = layer; - nodelayerchild2.Checked = true; - nodelayerchild.Nodes.Add(nodelayerchild2); - foreach (XmlNode n in childNodeLayer) - { - TreeNode nodelayerchild1 = new TreeNode(); - string layerName1 = n.Attributes["layer"].Value; - string layerchildName = n.Attributes["label"].Value; - string layerType1 = n.Attributes["type"].Value; - if (n.Attributes["isPipeLine"] != null) - { - m_PipelineLayerNames.Add(layerchildName); - } - if (n.Attributes["isWorkWell"] != null) - { - workwellLayerNames.Add(layerchildName); - } - if (n.Attributes["isValve"] != null) - { - valueLayerNames.Add(layerchildName); - } - if (n.Attributes["isAccess"] != null) - //if (n.Attributes["isInstrument"] != null) - { - instrumenLayerNames.Add(layerchildName); - } - if (n.Attributes["isPipeFitting"] != null) - { - pipefittingLayerNames.Add(layerchildName); - } - bool boollayer = AddLayers(layerName1, layerchildName); - nodelayerchild1.Text = layerchildName; - nodelayerchild1.Tag = layerType1 + "|" + layerchildName; - nodelayerchild1.Checked = boollayer; - if (layerchildName.Contains("特征管点")) - { - nodelayerchild1.Checked = false; - setLayerVisible(layerName1); - } - - nodelayerchild2.Nodes.Add(nodelayerchild1); - - g1layername.Add(layerName1); - } - } - else - { - TreeNode nodelayerchild1 = new TreeNode(); - string layerName1 = childNodeLayer.Attributes["layer"].Value; - string layerchildName = childNodeLayer.Attributes["label"].Value; - string layerType1 = childNodeLayer.Attributes["type"].Value; - if (childNodeLayer.Attributes["isPipeLine"] != null) - { - m_PipelineLayerNames.Add(layerchildName); - } - if (childNodeLayer.Attributes["isWorkWell"] != null) - { - workwellLayerNames.Add(layerchildName); - } - if (childNodeLayer.Attributes["isValve"] != null) - { - valueLayerNames.Add(layerchildName); - } - if (childNodeLayer.Attributes["isAccess"] != null) - //if (childNodeLayer.Attributes["isInstrument"] != null) - { - instrumenLayerNames.Add(layerchildName); - } - if (childNodeLayer.Attributes["isPipeFitting"] != null) - { - pipefittingLayerNames.Add(layerchildName); - } - bool boollayer = AddLayers(layerName1, layerchildName); - nodelayerchild1.Text = layerchildName; - nodelayerchild1.Tag = layerType1 + "|" + layerchildName; - nodelayerchild1.Checked = boollayer; - if (layerchildName.Contains("特征管点")) - { - nodelayerchild1.Checked = false; - setLayerVisible(layerName1); - } - nodelayerchild.Nodes.Add(nodelayerchild1); - g1layername.Add(layerName1); - } - } - } - } - } - } - else - { - tv.Nodes.Add(nodelayer); - } - } - } - - foreach (TreeNode tn in tv.Nodes) - { - if (tn.Nodes.Count > 0) - { - foreach (TreeNode tnChild in tn.Nodes) - { - if (tnChild.Checked) - tn.Checked = true; - } - } - } - } - catch (Exception ex) - { - //LogError.PublishError(ex); - } - } - /// /// 获取目标图层 /// /// @@ -2629,21 +2416,11 @@ } catch (Exception ex) { - //LogError.PublishError(ex); + LogHelper.WriteLog(typeof(MainFrm), ex.Message); return false; } } /// - /// 菜单上的 三维导航 工具按钮 - /// - /// - /// - private void buttonItem86_Click(object sender, EventArgs e) - { - globeControl1.Globe.Action = EnumAction3D.ActionNull; - } - - /// /// 地上模式 菜单按钮 /// /// @@ -3026,67 +2803,11 @@ } Image printImage; - /// - /// 打印 菜单 - /// - /// - /// - private void buttonItem13_Click(object sender, EventArgs e) - { - Point pt1 = new Point(Convert.ToInt32(0), Convert.ToInt32(0)); - Point pt2 = new Point(Convert.ToInt32(panelEx5.Width), Convert.ToInt32(panelEx5.Height)); - int mapWidth = 0; - int mapHeight = 0; - Point pt = getUpperLeftPoint(pt1, pt2, out mapWidth, out mapHeight); - printImage = new Bitmap(Convert.ToInt32(panelEx5.Width), Convert.ToInt32(panelEx5.Height)); - Graphics g = Graphics.FromImage(printImage); - g.CopyFromScreen(pt, new Point(0, 0), new Size(Convert.ToInt32(panelEx5.Width), Convert.ToInt32(panelEx5.Height))); - - PrintDialog pd = new PrintDialog(); - try - { - if (pd.ShowDialog() == DialogResult.OK) //如果确认,将会覆盖所有的打印参数设置 - { - //打印预览 - PrintPreviewDialog ppd = new PrintPreviewDialog(); - ppd.Document = printDocument1; - if (DialogResult.OK == ppd.ShowDialog()) - { - printDocument1.Print(); //打印 - } - } - } - catch - { - printDocument1.PrintController.OnEndPrint(printDocument1, new System.Drawing.Printing.PrintEventArgs()); - } - } - + private void printDocument1_PrintPage(object sender, System.Drawing.Printing.PrintPageEventArgs e) { e.Graphics.DrawImage(printImage, 10, 10); } - - /// - /// 在窗体的底部状态栏上显示 综合管线条件查询结果 - /// - /// - /// - private void ToolStripText(string currentLayer, int dataCount) - { - if (dataCount != 0) - { - double featurelength = PipeLength(currentLayer, 0);// 统计管线的里程数 - - toolStripNumbers.Text = " 管线类型:" + currentLayer + " | 共有:" + Convert.ToString(dataCount - 1) + "条记录"; - toolStripFeatureLength.Text = " 管线里程:" + featurelength.ToString("0.00") + " 米"; - } - else - { - toolStripNumbers.Text = "管线类型: " + currentLayer + "| 共有:" + 0 + " 条记录 | "; - } - } - /// /// 统计管线的里程数 /// @@ -3402,26 +3123,6 @@ } /// - /// 绘制线 菜单 - /// - /// - /// - private void btnAddLine_Click(object sender, EventArgs e) - { - globeControl1.Globe.DestLayerFeatureAdd = globeControl1.Globe.MemoryLayer; - globeControl1.Globe.Action = EnumAction3D.DrawPolyline; - } - /// - /// 绘制面 菜单 - /// - /// - /// - private void btnAddPolygon_Click(object sender, EventArgs e) - { - globeControl1.Globe.DestLayerFeatureAdd = globeControl1.Globe.MemoryLayer; - globeControl1.Globe.Action = EnumAction3D.DrawPolygon; - } - /// /// 图层目录树 右键菜单中的 目标图层 菜单 /// /// @@ -3956,42 +3657,7 @@ // ClearUpDownTraceAnalysis(); //} - /// - /// 显示流向 功能 - /// - /// - /// - /// - private void Flow(object sender, string pipelineNameCN, bool bShow) - { - GSOFeatureLayer layer = globeControl1.Globe.Layers.GetLayerByCaption(pipelineNameCN) as GSOFeatureLayer; - GSOFeatures feats = layer.GetAllFeatures(); - for (int i = 0; i < feats.Length; i++) - { - GSOFeature feat = feats[i]; - GSOLineStyle3D lineStyle = feat.Geometry.Style as GSOLineStyle3D; - if (lineStyle != null) - { - if (lineStyle.ArrowStyle == null) - { - lineStyle.ArrowStyle = new GSOArrowStyle(); - lineStyle.ArrowStyle.BodyWidth = 2; - lineStyle.ArrowStyle.BodyLen = 6; - lineStyle.ArrowStyle.HeadWidth = 8; - lineStyle.ArrowStyle.HeadLen = 10; - lineStyle.ArrowStyle.OutlineVisible = true; - lineStyle.ArrowStyle.OutlineColor = Color.Red; - lineStyle.ArrowStyle.Speed = lineStyle.ArrowStyle.Speed / 2; - lineStyle.ArrowStyle.Play(); - } - lineStyle.ArrowVisible = bShow; - layerTree.SelectedNode = null; - } - } - globeControl1.Globe.Refresh(); - } - - + FrmCloseValves frm; /// /// 关阀分析 功能 @@ -4030,7 +3696,9 @@ curCAYNDataset.CloseValveAnalysis(lineFeature.ID, out arryResNodeID, out arryResValveID, false, true); } catch (Exception e) - { } + { + LogHelper.WriteLog(typeof(MainFrm), e.Message); + } string valveName = lineLayer.Caption; valveName = valveName.Substring(0, valveName.IndexOf("管线")); @@ -4106,7 +3774,7 @@ } catch (Exception e) { - + LogHelper.WriteLog(typeof(MainFrm), e.Message); } //目前只有燃气管线 有阀门 string valveName = lineLayer.Name; @@ -5457,7 +5125,7 @@ } catch (Exception ex) { - //MessageBox.Show(ex.ToString()); + LogHelper.WriteLog(typeof(MainFrm), ex.Message); } finally { @@ -5501,22 +5169,6 @@ } } - - /// - /// 清除所有坑 菜单 - /// - /// - /// - private void buttonItem3_Click(object sender, EventArgs e) - { - //日志记录 - LogManager.saveLog(Utility.userName, this.buttonItem3.Text); - - globeControl1.Globe.RemoveAllPits(); - } - - - ///// ///// 净距分析 菜单 ///// @@ -5554,42 +5206,8 @@ // ribbonBarTP.Visible = buttonItem34.Checked; // ribbonBarTP.Location = new Point(0, 0); //} - /// - /// 大气层 菜单 - /// - /// - /// - private void buttonItem17_Click_1(object sender, EventArgs e) - { - globeControl1.Globe.Atmosphere.Visible = !globeControl1.Globe.Atmosphere.Visible; - buttonItemSH1.Checked = globeControl1.Globe.Atmosphere.Visible; - globeControl1.Refresh(); - } - /// - /// 经纬网 菜单 - /// - /// - /// - private void buttonItem20_Click(object sender, EventArgs e) - { - globeControl1.Globe.LatLonGrid.Visible = !globeControl1.Globe.LatLonGrid.Visible; - buttonItemSH3.Checked = globeControl1.Globe.LatLonGrid.Visible; - globeControl1.Globe.Refresh(); - } - /// - /// 状态条 菜单 - /// - /// - /// - private void buttonItem21_Click_1(object sender, EventArgs e) - { - globeControl1.Globe.StatusBar.Visible = !globeControl1.Globe.StatusBar.Visible; - buttonItemSH4.Checked = globeControl1.Globe.StatusBar.Visible; - globeControl1.Globe.Refresh(); - } - - + /// /// 添加指定路径下的数据 功能 /// @@ -5680,43 +5298,7 @@ // } // return objRes; //} - /// - /// 刷新目录树 功能 - /// - private void RefreshDataTree() - { - layerTree.Nodes[0].Nodes.Clear(); - Int32 nCount = globeControl1.Globe.DataManager.DataSourceCount; - Int32 i = 0; - for (i = 0; i < nCount; i++) - { - GSODataSource dataSpace = globeControl1.Globe.DataManager[i]; - TreeNode node = new TreeNode(); - node.Text = dataSpace.Name; - node.ImageIndex = 0; - node.SelectedImageIndex = 0; - node.Checked = true; - node.Tag = dataSpace; - Int32 nDatasetCount = dataSpace.DatasetCount; - for (Int32 j = 0; j < nDatasetCount; j++) - { - GSODataset dataset = dataSpace[j]; - TreeNode subNode = new TreeNode(); - subNode.Text = dataset.Name; - subNode.ImageIndex = 0; - subNode.SelectedImageIndex = 0; - subNode.Checked = true; - subNode.Tag = dataset; - node.Nodes.Add(subNode); - } - layerTree.Nodes[0].Nodes.Add(node); - } - } - - - - - + /// /// 复合查询 菜单 @@ -5777,34 +5359,7 @@ return false; } - /// - /// 统计指定图层在指定范围内的所有feature对象 - /// - /// - /// - /// - private GSOFeatures Intersect_PointLayer(GSOGeoPolygon3D polygon, string pointLayerName) - { - GSOLayer layer = globeControl1.Globe.Layers.GetLayerByCaption(pointLayerName); - if (layer == null) - return null; - - GSOFeatureLayer flayer = layer as GSOFeatureLayer; - GSOFeatureDataset fdataset = flayer.Dataset as GSOFeatureDataset; - GSOFeatures feats; - if (polygon == null) - { - feats = flayer.GetAllFeatures(); - } - else - { - feats = flayer.FindFeaturesInPolygon(polygon, false); - } - - workWellLen.Add(pointLayerName, feats.Length); - return feats; - } - /// + /// /// 碰撞分析功能界面中 选择管线复选框 选中状态改变事件处理 /// /// @@ -5946,16 +5501,6 @@ MessageBox.Show("表格内容为空!", "提示"); } } - /// - /// 导出CAD 菜单 - /// - /// - /// - private void btnExportCAD_Click(object sender, EventArgs e) - { - FrmExportCADS frm = new FrmExportCADS(globeControl1, m_PipelineLayerNames); - frm.ShowDialog(); - } ///// ///// 区域分析 菜单 @@ -5987,16 +5532,6 @@ } } } - /// - /// 数据验证 菜单 - /// - /// - /// - private void buttonItem80_Click(object sender, EventArgs e) - { - FrmValiData frm = new FrmValiData(globeControl1); - frm.ShowDialog(); - } /// /// 根据指定图层创建图层节点并将节点添加到图层管理节点的子节点集合中 @@ -6018,56 +5553,7 @@ layerManagerNode.Expand(); } } - /// - /// 数据库备份 菜单 - /// - /// - /// - private void btnBackDatabase_Click(object sender, EventArgs e) - { - if (MessageBox.Show("是否确定要备份数据库文件", "信息", MessageBoxButtons.YesNo, MessageBoxIcon.Question) == DialogResult.Yes) - { - try - { - DateTime currentTime = DateTime.Now; - //string Dtime = currentTime.ToShortDateString().ToString("yyyy-MM-dd"); - string Dtime = currentTime.GetDateTimeFormats('D')[0].ToString(); - string Htime = DateTime.Now.ToString("HH时mm分ss秒").Trim(); - string fileName = Dtime + "(" + Htime + ")"; - string pathName = ""; - string sql = "select filename from master..sysdatabases where name='" + Utility.dbdatabase + "'"; - DataTable dt = OledbHelper.ExecuteDataTable(sql); - if (dt != null && dt.Rows.Count > 0) - { - pathName = dt.Rows[0][0].ToString().Trim(); - int count = pathName.LastIndexOf("\\") == -1 ? pathName.LastIndexOf("/") : pathName.LastIndexOf("\\"); - pathName = pathName.Substring(0, count); - } - pathName += "\\管网数据库" + fileName + ".bak"; - - OracleCommand cmdBK = new OracleCommand(); - cmdBK.CommandType = CommandType.Text; - cmdBK.Connection = connBackup; - cmdBK.CommandText = @"backup database " + Utility.dbdatabase + " to disk='" + pathName + "' with init"; - - connBackup.Open(); - cmdBK.ExecuteNonQuery(); - MessageBox.Show("数据库文件备份成功", "提示"); - } - catch (Exception ex) - { - MessageBox.Show(ex.ToString()); - } - finally - { - connBackup.Close(); - } - } - } - - - - + //GSOFeature emitterFeature; // 粒子要素 /// /// 添加火苗 功能 @@ -6598,361 +6084,15 @@ } } - - ///// - /// 添加用户仓库 菜单 - /// - /// - /// - private void buttonItem108_Click(object sender, EventArgs e) - { - FrmUserRepo frm = new FrmUserRepo(-1); - frm.ShowDialog(); - } - /// - /// 用户仓库管理 菜单 - /// - /// - /// - private void buttonItem111_Click(object sender, EventArgs e) - { - FrmUserRepoMgr frm = new FrmUserRepoMgr(); - frm.ShowDialog(); - } - /// - /// 添加分系统 菜单 - /// - /// - /// - private void buttonItem112_Click(object sender, EventArgs e) - { - //FrmAPP frm = new FrmAPP(-1); - //frm.ShowDialog(); - } - /// - /// 分系统管理 菜单 - /// - /// - /// - private void buttonItem113_Click(object sender, EventArgs e) - { - //FrmAPPMgr frm = new FrmAPPMgr(); - //frm.ShowDialog(); - } - /// - /// 添加操作 菜单 - /// - /// - /// - private void buttonItem114_Click(object sender, EventArgs e) - { - FrmOper frm = new FrmOper(-1); - frm.ShowDialog(); - } - /// - /// 操作管理 菜单 - /// - /// - /// - private void buttonItem115_Click(object sender, EventArgs e) - { - FrmOperMgr frm = new FrmOperMgr(); - frm.ShowDialog(); - } - /// - /// 添加资源 菜单 - /// - /// - /// - private void buttonItem116_Click(object sender, EventArgs e) - { - FrmRESC frm = new FrmRESC(-1); - frm.ShowDialog(); - } - /// - /// 资源管理 菜单 - /// - /// - /// - private void buttonItem117_Click(object sender, EventArgs e) - { - FrmRESCMgr frm = new FrmRESCMgr(); - frm.ShowDialog(); - } - /// - /// 添加权限 菜单 - /// - /// - /// - private void buttonItem118_Click(object sender, EventArgs e) - { - FrmPerm frm = new FrmPerm(-1); - frm.ShowDialog(); - } - /// - /// 权限管理 菜单 - /// - /// - /// - private void buttonItem119_Click(object sender, EventArgs e) - { - FrmPermMgr frm = new FrmPermMgr(); - frm.ShowDialog(); - } - /// - /// 添加访问控制 菜单 - /// - /// - /// - private void buttonItem120_Click(object sender, EventArgs e) - { - FrmAccess frm = new FrmAccess(-1); - frm.ShowDialog(); - } - /// - /// 访问控制管理 菜单 - /// - /// - /// - private void buttonItem121_Click(object sender, EventArgs e) - { - FrmAccessMgr frm = new FrmAccessMgr(); - frm.ShowDialog(); - } - /// - /// 部门类型管理 菜单 - /// - /// - /// - private void buttonItem122_Click(object sender, EventArgs e) - { - FrmRegionTypeMgr frm = new FrmRegionTypeMgr(); - frm.ShowDialog(); - } - /// - /// 用户信息管理 菜单 - /// - /// - /// - private void buttonItem128_Click_1(object sender, EventArgs e) - { - FrmUserManager frm = new FrmUserManager(); - frm.ShowDialog(); - } - /// - /// 添加角色 菜单 - /// - /// - /// - private void 添加角色_Click(object sender, EventArgs e) - { - FrmRole frm = new FrmRole(-1); - frm.ShowDialog(); - } - /// - /// 所有角色管理 菜单 - /// - /// - /// - private void 角色管理_Click(object sender, EventArgs e) - { - FrmRoleMgr frm = new FrmRoleMgr(); - frm.ShowDialog(); - } - - /// - /// 部门角色管理 菜单 - /// - /// - /// - private void buttonItem133_Click(object sender, EventArgs e) - { - FrmRegionRoleMgr frm = new FrmRegionRoleMgr(); - frm.ShowDialog(); - } - /// - /// 部门管理 菜单 - /// - /// - /// - private void buttonItem130_Click(object sender, EventArgs e) - { - FrmRegionMgr frm = new FrmRegionMgr(); - frm.ShowDialog(); - } - - /// - /// 日志管理 菜单 - /// - /// - /// - private void buttonItem135_Click(object sender, EventArgs e) - { - FrmLogManager frm = new FrmLogManager(); - frm.ShowDialog(); - } - /// - /// 传感器信息查询 菜单 - /// - /// - /// - private void buttonItem131_Click_1(object sender, EventArgs e) - { - GSOFeature selectedFeature = globeControl1.Globe.SelectedObject; - if (selectedFeature == null) - { - MessageBox.Show("请选择一个传感器对象!", "提示", MessageBoxButtons.OK, MessageBoxIcon.Information); - } - else - { - if (selectedFeature.Geometry != null && selectedFeature.Geometry.Type == EnumGeometryType.GeoModel) - { - GSOLayer layer = globeControl1.Globe.SelectedObjectLayer; - string tabelName = getTableName(layer.Caption); - string eqtID = selectedFeature.Description.Trim(); - if (tabelName != "" && eqtID != "") - { - string fields = getFields(tabelName); - if (fields != "") - { - string sql = "select " + fields + " from " + Utility.sensorDatabase + "." + tabelName + " where EqtID=" + eqtID + " order by RecordDate desc limit 1;"; - DataTable dt = MySqlHelper.queryDataTable(sql); - if (dt != null && dt.Rows.Count > 0) - { - FrmQueryMessage.ShowForm(this, dt, layer.Caption); - //queryMessage.Show(this); - } - else - { - MessageBox.Show("没有查询到相关信息!", "提示"); - } - } - else - { - MessageBox.Show("配置文件 \"sensorConfig.xml\" 有误!", "提示"); - } - } - else - { - MessageBox.Show("请选择一个传感器对象!", "提示"); - } - } - else - { - MessageBox.Show("请选择一个传感器对象!", "提示", MessageBoxButtons.OK, MessageBoxIcon.Information); - } - } - } - /// - /// 根据指定的图层的caption属性的值在配置文件中查找对应的数据库中的表的名称 - /// - /// 图层的caption属性的值 - /// 对应的数据库中的表的名称 - private string getTableName(string name) - { - string tabelName = ""; - if (Utility.sensorMarkerLayers != null) - { - for (int i = 0; i < Utility.sensorMarkerLayers.Count; i++) - { - MarkerLayer mLayer = Utility.sensorMarkerLayers[i]; - if (mLayer.layerName == name) - { - tabelName = mLayer.tableName; - break; - } - } - } - return tabelName; - } - /// - /// 根据数据库中的表的名称 查找对应的表中的字段名称的集合 - /// - /// 数据库中的表的名称 - /// 对应的表中的字段名称的集合 - private string getFields(string tabelName) - { - string fields = ""; - if (Utility.sensorMarkerLayers != null) - { - for (int i = 0; i < Utility.sensorMarkerLayers.Count; i++) - { - MarkerLayer mLayer = Utility.sensorMarkerLayers[i]; - if (mLayer.tableName.Trim() == tabelName.Trim()) - { - if (mLayer.fields != null) - { - foreach (string key in mLayer.fields.Keys) - { - string value = mLayer.fields[key]; - fields += tabelName.Trim() + "." + key + " as " + value + ","; - } - fields = fields.Remove(fields.Length - 1); - } - break; - } - } - } - return fields; - } - - /// - /// 历史曲线查询 菜单 - /// - /// - /// - private void buttonItem132_Click(object sender, EventArgs e) - { - GSOFeature selectedFeature = globeControl1.Globe.SelectedObject; - if (selectedFeature == null) - { - MessageBox.Show("请选择一个对象!", "提示", MessageBoxButtons.OK, MessageBoxIcon.Information); - } - else - { - if (selectedFeature.Geometry != null && selectedFeature.Geometry.Type == EnumGeometryType.GeoModel) - { - GSOLayer layer = globeControl1.Globe.SelectedObjectLayer; - string tabelName = getTableName(layer.Caption); - string eqtID = selectedFeature.Description; - if (tabelName != "" && eqtID != "") - { - FrmQueryHistory.ShowForm(this, tabelName, eqtID); - } - else - { - MessageBox.Show("请选择一个传感器对象!", "提示"); - } - } - else - { - MessageBox.Show("请选择一个传感器对象!", "提示", MessageBoxButtons.OK, MessageBoxIcon.Information); - } - } - } - + //定时检查传感器的状态 public System.Windows.Forms.Timer timerOfSensor = null; public int alarmValueLiuLiang = 0; public int alarmValueYaLi = 0; public int alarmValueYeTi = 0; public int alarmValueZaoSheng = 0; - /// - /// 传感器在线报警 菜单 - /// - /// - /// - private void buttonItem134_Click(object sender, EventArgs e) - { - if (timerOfSensor == null) - { - timerOfSensor = new System.Windows.Forms.Timer(); - timerOfSensor.Interval = 30000; - timerOfSensor.Tick += new EventHandler(timerOfSensor_Tick); - } - FrmQuerySensorAlarm.ShowForm(this); - } + /// /// 传感器报警 功能中的 定时器 的触发事件处理 /// @@ -7016,6 +6156,7 @@ } catch (Exception ex) { + LogHelper.WriteLog(typeof(MainFrm), ex.Message); continue; } } @@ -7025,145 +6166,7 @@ } } - - /// - /// 沿线运动 菜单 - /// - /// - /// - private void buttonItem138_Click(object sender, EventArgs e) - { - if (globeControl1.Globe.SelectedObject == null) - { - MessageBox.Show("请先选择一条线!", "提示", MessageBoxButtons.OK, MessageBoxIcon.Exclamation); - return; - } - - GSOFeature lineFeature = globeControl1.Globe.SelectedObject; - if (lineFeature.Geometry == null || lineFeature.Geometry.Type != EnumGeometryType.GeoPolyline3D) - { - MessageBox.Show("请先选择一条线!", "提示", MessageBoxButtons.OK, MessageBoxIcon.Exclamation); - return; - } - - OpenFileDialog dlg = new OpenFileDialog(); - dlg.Filter = "*.gcm;*.3ds|*.gcm;*.3ds|*.3ds|*.3ds|*.gcm|*.gcm"; - if (dlg.ShowDialog() == DialogResult.OK) - { - GSOGeoModel model = new GSOGeoModel(); - model.FilePath = dlg.FileName; - - GSOGeoDynamicRoute dynamicRoute = new GSOGeoDynamicRoute(); - dynamicRoute.ActorGeometry = model; - - GSORoute route = new GSORoute(); - GSOGeoPolyline3D geoline = (GSOGeoPolyline3D)lineFeature.Geometry; - for (int i = 0; i < geoline[0].Count; i++) - { - route.Add(geoline[0][i]); - } - route.CircleRoute = false; - route.Speed = 30; - route.RotateSpeed = 50; - route.AltitudeMode = geoline.AltitudeMode; - dynamicRoute.Route = route; - - GSOFeature feature = new GSOFeature(); - - dynamicRoute.Play(); - feature.Geometry = dynamicRoute; - - //GSOLabel gsoLabel = new GSOLabel(); - //gsoLabel.Text = "模型测试"; - //feature.Label = gsoLabel; - globeControl1.Globe.MinModelVisibleSize = 0; - - globeControl1.Globe.MemoryLayer.AddFeature(feature); - globeControl1.Globe.Refresh(); - } - } - /// - /// 回退 菜单 - /// - /// - /// - private void buttonItem99_Click(object sender, EventArgs e) - { - globeControl1.Globe.UnDoEdit(); - } - /// - /// 前进 菜单 - /// - /// - /// - private void buttonItem100_Click(object sender, EventArgs e) - { - globeControl1.Globe.ReDoEdit(); - } - /// - /// 水平净距 功能界面中的 标签内容改变事件处理 - /// - /// - /// - private void textBoxX4_TextChanged(object sender, EventArgs e) - { - string valueJingJu = textBoxX4.Text.Trim(); - if (valueJingJu != "") - { - double value = 0; - bool bl = double.TryParse(valueJingJu, out value); - if (bl) - { - labelX24.Text = "水平净距小于" + value.ToString() + "米的管线有:"; - } - } - } - /// - /// 垂直净距 功能界面中的 标签内容改变事件处理 - /// - /// - /// - private void textBoxX2_TextChanged(object sender, EventArgs e) - { - string valueJingJu = textBoxX2.Text.Trim(); - if (valueJingJu != "") - { - double value = 0; - bool bl = double.TryParse(valueJingJu, out value); - if (bl) - { - labelX23.Text = "垂直净距小于" + value.ToString() + "米的管线有:"; - } - } - } - /// - /// 覆土分析 功能界面中的 标签内容改变事件处理 - /// - /// - /// - private void textBoxX3_TextChanged(object sender, EventArgs e) - { - string valueJingJu = textBoxX3.Text.Trim(); - if (valueJingJu != "") - { - double value = 0; - bool bl = double.TryParse(valueJingJu, out value); - if (bl) - { - labelX17.Text = "覆土深度小于" + value.ToString() + "米的管线有:"; - } - } - } - - /// - /// 传感器分类查询 全区域 菜单 - /// - /// - /// - private void buttonItemSensor全区域查询_Click(object sender, EventArgs e) - { - FrmAccessoriesSensor.ShowForm(globeControl1, instrumenLayerNames, 0); - } + /// /// 传感器分类查询 绘制区域 菜单 /// @@ -7224,170 +6227,10 @@ layerTemp.RemoveAllFeature(); globeControl1.Refresh(); } - /// - /// 数字预处理 功能 - /// - /// - /// - private void 数字预处理buttonItem140_Click(object sender, EventArgs e) - { - FrmEditShapeFile frm = new FrmEditShapeFile(globeControl1); - frm.ShowDialog(this); - } - - - /// - /// 导出矢量 功能 将图层导出为kml和shp格式数据 - /// - /// - /// - private void 导出矢量buttonItem140_Click(object sender, EventArgs e) - { - /* - List m_PipelineLayerNames = new List();//线图层名称 - List workwellLayerNames = new List();//工井图层名称 - List valueLayerNames = new List();//阀门图层名称 - List instrumenLayerNames = new List();//附属物图层名称 - List pipefittingLayerNames = new List();//管件图层名称 - */ - List listVectorNames = new List(); - for (int i = 0; i < m_PipelineLayerNames.Count; i++) - { - if (m_PipelineLayerNames[i] == "移动" || m_PipelineLayerNames[i] == "联通" - || m_PipelineLayerNames[i] == "电信" || m_PipelineLayerNames[i] == "共通" - || m_PipelineLayerNames[i] == "有限电视" || m_PipelineLayerNames[i] == "交通信号" - || m_PipelineLayerNames[i] == "供电") - { - continue; - } - if (listVectorNames.Contains(m_PipelineLayerNames[i]) == false) - { - listVectorNames.Add(m_PipelineLayerNames[i]); - } - } - for (int i = 0; i < valueLayerNames.Count; i++) - { - if (listVectorNames.Contains(valueLayerNames[i]) == false) - { - listVectorNames.Add(valueLayerNames[i]); - } - } - for (int i = 0; i < workwellLayerNames.Count; i++) - { - if (listVectorNames.Contains(workwellLayerNames[i]) == false) - { - listVectorNames.Add(workwellLayerNames[i]); - } - } - for (int i = 0; i < instrumenLayerNames.Count; i++) - { - if (listVectorNames.Contains(instrumenLayerNames[i]) == false) - { - listVectorNames.Add(instrumenLayerNames[i]); - } - } - for (int i = 0; i < pipefittingLayerNames.Count; i++) - { - if (listVectorNames.Contains(pipefittingLayerNames[i]) == false) - { - listVectorNames.Add(pipefittingLayerNames[i]); - } - } - FrmExportVector frm = new FrmExportVector(globeControl1, listVectorNames); - frm.ShowDialog(); - } string citySevenLineType = ""; string cityServerLineName = ""; /// - /// 绘制城市七线 功能按钮 - /// - /// - /// - private void 绘制城市七线buttonItem140_Click(object sender, EventArgs e) - { - FrmCitySevenLineType frm = new FrmCitySevenLineType(); - if (frm.ShowDialog() == DialogResult.OK) - { - globeControl1.Globe.Action = EnumAction3D.DrawPolyline; - m_isDrawCitySevenLine = true; - m_isDrawTunnel = false; - m_AddPipeLine = false; - this.citySevenLineType = frm.citySevenLineType; - this.cityServerLineName = frm.citySevenLineName; - switch (frm.citySevenLineType) - { - case "城市红线": - GSOLayer layerRed = globeControl1.Globe.Layers.GetLayerByCaption(frm.citySevenLineType); - if (layerRed != null) - { - globeControl1.Globe.DestLayerFeatureAdd = layerRed; - layerRed.Editable = true; - } - break; - case "城市橙线": - GSOLayer layerOrange = globeControl1.Globe.Layers.GetLayerByCaption(frm.citySevenLineType); - if (layerOrange != null) - { - globeControl1.Globe.DestLayerFeatureAdd = layerOrange; - layerOrange.Editable = true; - } - break; - case "城市黄线": - GSOLayer layerYellow = globeControl1.Globe.Layers.GetLayerByCaption(frm.citySevenLineType); - if (layerYellow != null) - { - globeControl1.Globe.DestLayerFeatureAdd = layerYellow; - layerYellow.Editable = true; - } - break; - case "城市绿线": - GSOLayer layerGreen = globeControl1.Globe.Layers.GetLayerByCaption(frm.citySevenLineType); - if (layerGreen != null) - { - globeControl1.Globe.DestLayerFeatureAdd = layerGreen; - layerGreen.Editable = true; - } - break; - case "城市蓝线": - GSOLayer layerBlue = globeControl1.Globe.Layers.GetLayerByCaption(frm.citySevenLineType); - if (layerBlue != null) - { - globeControl1.Globe.DestLayerFeatureAdd = layerBlue; - layerBlue.Editable = true; - } - break; - case "城市紫线": - GSOLayer layerPurple = globeControl1.Globe.Layers.GetLayerByCaption(frm.citySevenLineType); - if (layerPurple != null) - { - globeControl1.Globe.DestLayerFeatureAdd = layerPurple; - layerPurple.Editable = true; - } - break; - case "城市黑线": - GSOLayer layerBlack = globeControl1.Globe.Layers.GetLayerByCaption(frm.citySevenLineType); - if (layerBlack != null) - { - globeControl1.Globe.DestLayerFeatureAdd = layerBlack; - layerBlack.Editable = true; - } - break; - } - } - } - /// - /// 七线审核 功能按钮 - /// - /// - /// - private void 七线审核buttonItem141_Click(object sender, EventArgs e) - { - FrmCityServerLineAnalysis frm = new FrmCityServerLineAnalysis(globeControl1, m_PipelineLayerNames); - frm.ShowDialog(this); - } - - /// /// 间距分析 开始分析按钮 分析绘制的七线和管线的距离是否符合标准 /// /// @@ -7666,25 +6509,6 @@ } } - - - /// - /// 管线自动缩进 菜单 - /// - /// - /// - private void 管线自动缩进buttonItem140_Click(object sender, EventArgs e) - { - FrmPipelineIndented frm = new FrmPipelineIndented(globeControl1, m_PipelineLayerNames, workwellLayerNames); - frm.ShowDialog(this); - } - - private void btnExportCADs_Click(object sender, EventArgs e) - { - - } - - /// /// 统计指定图层在指定范围内的所有feature对象 /// @@ -7755,8 +6579,6 @@ } - - //设置图层为隐藏 private void setLayerVisible(string layerName) { @@ -7765,27 +6587,7 @@ globeControl1.Globe.Refresh(); } - /// - /// 连接数据库 - /// - /// - /// - private void buttonItem129_Click(object sender, EventArgs e) - { - //保存日志 - LogManager.saveLog(Utility.userName, this.buttonItemSJGL4_1.Text); - - FrmDatabaseParaSetting2 frm = new FrmDatabaseParaSetting2(globeControl1); - if (frm.ShowDialog() == DialogResult.OK) - { - ds = FrmDatabaseParaSetting2.ds; - if (ds != null) - { - ds.IsCloseSaved = false; - } - } - } - + /// /// 清除渲染结果 /// @@ -7803,112 +6605,8 @@ layerTemp.RemoveAllFeature(); globeControl1.Refresh(); } - - /// - /// 绘制垂线 - /// - /// - /// - private void drawCLine(GSOPoint3d fpt, GSOPoint3d tpt) - { - GSOGeoPolyline3D pline = new GSOGeoPolyline3D(); - GSOPoint3ds pts = new GSOPoint3ds(); - pts.Add(fpt); - pts.Add(tpt); - pline.AddPart(pts); - - GSOGeoPoint3D fptg = new GSOGeoPoint3D(); - GSOGeoPoint3D tptg = new GSOGeoPoint3D(); - fptg.X = fpt.X; - fptg.Y = fpt.Y; - fptg.Z = 0; - tptg.X = tpt.X; - tptg.Y = tpt.Y; - tptg.Z = 0; - - GSOFeature gf = new GSOFeature(); - gf.Geometry = pline; - - globeControl1.Globe.MemoryLayer.AddFeature(gf); - - } - /// - /// 红线审核 - /// - /// - /// - private void buttonItem138_Click_2(object sender, EventArgs e) - { - - } - /// - /// 比较两个点是否是同一个点 - /// - /// - /// - /// - private bool comparePoint(GSOPoint3d pt1, GSOPoint3d pt2) - { - double x1 = 0; double y1 = 0; - double x2 = 0; double y2 = 0; - x1 = pt1.X; - y1 = pt1.Y; - x2 = pt2.X; - y2 = pt2.Y; - if ((x1 == x2) && (y1 == y2)) - { - return true; - } - return false; - } - /// - /// 获得点到线的垂线距离及垂点 - /// - /// - /// - /// - /// - private void comparePointLine(GSOPoint3d point, GSOGeoPolyline3D line, out double length, out GSOPoint3d pointChuiDian) - { - GSOPoint3d lineStartPoint = line[0][0]; - GSOPoint3d lineEndPoint = line[0][1]; - GSOGeoPolyline3D lineAB = new GSOGeoPolyline3D(); - GSOPoint3ds pointsAB = new GSOPoint3ds(); - pointsAB.Add(point); - pointsAB.Add(lineStartPoint); - lineAB.AddPart(pointsAB); - double lengthAB = lineAB.GetSpaceLength(false, 6378137.0); - double xieLvAB = getXieLu("", point.X, point.Y, lineStartPoint.X, lineStartPoint.Y); - double xieLvBC = getXieLu("", lineStartPoint.X, lineStartPoint.Y, lineEndPoint.X, lineEndPoint.Y); - - double tanABC = Math.Abs(xieLvAB - xieLvBC) / (1 + xieLvAB * xieLvBC); - double angle = Math.Atan(tanABC); - //if (angle > Math.PI / 2) //落在外边 - //{ - // length = 0; - //} - double lengthAD = lengthAB * Math.Sin(angle); - length = Math.Abs(lengthAD); - double lengthBD = lengthAB * Math.Cos(angle); - - GSOPoint2d point2dStart = Latlon_2_XYZ(lineStartPoint.X, lineStartPoint.Y); - double bBC = point2dStart.Y - xieLvBC * point2dStart.X; - GSOPoint2d point2dEnd = new GSOPoint2d(); - point2dEnd.X = point2dStart.X + 100; - point2dEnd.Y = point2dEnd.X * xieLvBC + bBC; - point2dEnd = XYZ_2_Latlon(point2dEnd.X, point2dEnd.Y); - - GSOPoint3d pointEnd = new GSOPoint3d(); - pointEnd.X = point2dEnd.X; - pointEnd.Y = point2dEnd.Y; - GSOGeoPolyline3D lineYanShen = new GSOGeoPolyline3D(); - GSOPoint3ds pointsYanShen = new GSOPoint3ds(); - pointsYanShen.Add(lineStartPoint); - pointsYanShen.Add(pointEnd); - lineYanShen.AddPart(pointsYanShen); - GSOGeoPolyline3D lineSegment = lineYanShen.GetSegment(0, lengthBD); - pointChuiDian = lineSegment[0][1]; - } + + /// /// 获得斜率 /// @@ -8044,255 +6742,6 @@ } /// - /// 获取与点相连的所有线以及线的点的集合 - /// - /// 选定的点所在的线 - /// 选定的点 - /// 面中不完全包含的除起点线之外所有的线 - /// 选定的点所在的点的集合 - /// 所有以选定线为起点的点的集合 - /// - private List getFeaturesPoints(GSOFeature featureSelect, GSOPoint3d lineStart, GSOFeatures selectFeatures, GSOPoint3ds ps, List listPS) - { - GSOFeatures fsStart = new GSOFeatures(); - for (int n = 0; n < selectFeatures.Length; n++) - { - if (featureSelect.ID == selectFeatures[n].ID) - { - continue; - } - GSOGeoPolyline3D newLine = selectFeatures[n].Geometry as GSOGeoPolyline3D; - if (newLine != null && newLine.PartCount > 0) - { - GSOPoint3d newLineStart = newLine[0][0]; - GSOPoint3d newLineEnd = newLine[0][newLine[0].Count - 1]; - if (lineStart.X == newLineEnd.X && lineStart.Y == newLineEnd.Y) - { - GSOPoint3ds psAdd = new GSOPoint3ds(); - for (int k = newLine[0].Count - 1; k >= 0; k--) - { - psAdd.Add(newLine[0][k]); - } - newLine[0] = psAdd; - fsStart.Add(selectFeatures[n]); - - } - else if (lineStart.X == newLineStart.X && lineStart.Y == newLineStart.Y) - { - fsStart.Add(selectFeatures[n]); - - } - } - } - if (fsStart.Length > 0) - { - for (int m = 0; m < fsStart.Length; m++) - { - GSOGeoPolyline3D lineFsStart = fsStart[m].Geometry as GSOGeoPolyline3D; - if (lineFsStart != null && lineFsStart.PartCount > 0) - { - GSOPoint3ds psAdd = ps.Clone(); - for (int k = 0; k < lineFsStart[0].Count; k++) - { - psAdd.Add(lineFsStart[0][k]); - } - listPS = getFeaturesPoints(fsStart[m], lineFsStart[0][lineFsStart[0].Count - 1], selectFeatures, psAdd, listPS); - } - } - } - else - { - listPS.Add(ps); - } - return listPS; - } - - /// - /// 获取切割面的线 - /// - /// 不完全包含在面中的所有线 - /// 完全包含在面中的所有线 - /// 线 - private GSOFeature getLineFromGSOFeatures(GSOFeatures features, GSOFeatures featuresTrue) - { - //1. 当线对象数组的长度为0时,返回空 - if (features.Length == 0) - { - return null; - } - //2. 当线对象数组的长度为1时,返回这条线 - if (features.Length == 1) - { - return features[0]; - } - //3. 当线对象数组的长度大于1时,计算所有线组成的最长线 - - //3.1 获取所有不完全包含在面中的对象selectFeatures - GSOFeatures selectFeatures = new GSOFeatures(); - for (int a = 0; a < features.Length; a++) - { - selectFeatures.Add(features[a].Clone()); - } - //3.2 删除features中完全包含在面中的线,获取和面的边界相交的线对象 - for (int a = 0; a < featuresTrue.Length; a++) - { - for (int b = 0; b < features.Length; b++) - { - if (featuresTrue[a].ID == features[b].ID) - { - features.Remove(b); - break; - } - } - } - //3.3 如果和面的边界相交的线的数量为0,返回空 - if (features.Length == 0) - { - return null; - } - //3.4 获取第一条和面的边界相交的线featureInOutPolygon - GSOFeature featureInOutPolygon = features[0]; - //3.5 从所有的线中删除featureInOutPolygon - for (int a = 0; a < selectFeatures.Length; a++) - { - if (selectFeatures[a].ID == featureInOutPolygon.ID) - { - selectFeatures.Remove(a); - break; - } - } - //listPS存储所有从featureInOutPolygon出发的点的集合 - List listPS = new List(); - //3.5 获取与featureInOutPolygon相连的线的集合 - GSOGeoPolyline3D line = featureInOutPolygon.Geometry as GSOGeoPolyline3D; - if (line != null && line.PartCount > 0) - { - GSOPoint3d lineStart = line[0][0]; - GSOPoint3d lineEnd = line[0][line[0].Count - 1]; - #region//获取和featureInOutPolygon的起点相连的线 - GSOFeatures fsStart = new GSOFeatures(); - for (int n = 0; n < selectFeatures.Length; n++) - { - GSOGeoPolyline3D newLine = selectFeatures[n].Geometry as GSOGeoPolyline3D; - if (newLine != null && newLine.PartCount > 0) - { - GSOPoint3d newLineStart = newLine[0][0]; - GSOPoint3d newLineEnd = newLine[0][newLine[0].Count - 1]; - if (lineStart.X == newLineEnd.X && lineStart.Y == newLineEnd.Y) - { - GSOPoint3ds psAdd = new GSOPoint3ds(); - for (int k = newLine[0].Count - 1; k >= 0; k--) - { - psAdd.Add(newLine[0][k]); - } - newLine[0] = psAdd; - fsStart.Add(selectFeatures[n]); - - } - else if (lineStart.X == newLineStart.X && lineStart.Y == newLineStart.Y) - { - fsStart.Add(selectFeatures[n]); - } - } - } - #endregion - - #region//获取和featureInOutPolygon的终点相连的线 - GSOFeatures fsEnd = new GSOFeatures(); - for (int n = 0; n < selectFeatures.Length; n++) - { - GSOGeoPolyline3D newLine = selectFeatures[n].Geometry as GSOGeoPolyline3D; - if (newLine != null && newLine.PartCount > 0) - { - GSOPoint3d newLineStart = newLine[0][0]; - GSOPoint3d newLineEnd = newLine[0][newLine[0].Count - 1]; - if (lineEnd.X == newLineStart.X && lineEnd.Y == newLineStart.Y) - { - fsEnd.Add(selectFeatures[n]); - - } - else if (lineEnd.X == newLineEnd.X && lineEnd.Y == newLineEnd.Y) - { - GSOPoint3ds psAdd = new GSOPoint3ds(); - for (int k = newLine[0].Count - 1; k >= 0; k--) - { - psAdd.Add(newLine[0][k]); - } - newLine[0] = psAdd; - fsEnd.Add(selectFeatures[n]); - - } - } - } - #endregion - - //3.6 将featureInOutPolygon的所有点和与之起点相连的线的所有点组成一个点的集合并添加到listPS中 - if (fsStart.Length > 0 && fsEnd.Length == 0) - { - for (int m = 0; m < fsStart.Length; m++) - { - GSOGeoPolyline3D lineFsStart = fsStart[m].Geometry as GSOGeoPolyline3D; - if (lineFsStart != null && lineFsStart.PartCount > 0) - { - GSOPoint3ds psAdd = new GSOPoint3ds(); - for (int k = line[0].Count - 1; k >= 0; k--) - { - psAdd.Add(line[0][k]); - } - for (int k = 0; k < lineFsStart[0].Count; k++) - { - psAdd.Add(lineFsStart[0][k]); - } - - listPS = getFeaturesPoints(fsStart[m], lineFsStart[0][lineFsStart[0].Count - 1], selectFeatures, psAdd, listPS); - - } - } - } - //3.6 将featureInOutPolygon的所有点和与之终点相连的线的所有点组成一个点的集合并添加到listPS中 - else if (fsStart.Length == 0 && fsEnd.Length > 0) - { - for (int n = 0; n < fsEnd.Length; n++) - { - GSOGeoPolyline3D lineFsEnd = fsEnd[n].Geometry as GSOGeoPolyline3D; - if (lineFsEnd != null && lineFsEnd.PartCount > 0) - { - GSOPoint3ds psAdd = new GSOPoint3ds(); - for (int k = 0; k < line[0].Count - 1; k++) - { - psAdd.Add(line[0][k]); - } - for (int k = 0; k < lineFsEnd[0].Count; k++) - { - psAdd.Add(lineFsEnd[0][k]); - } - //获取线fsEnd[n]的另一个端点相连的线并记录该线的点的集合 - listPS = getFeaturesPoints(fsEnd[n], lineFsEnd[0][lineFsEnd[0].Count - 1], selectFeatures, psAdd, listPS); - } - } - } - } - - //3.7 获取所有以featureInOutPolygon为起点的点的集合组成的线中的最长的线 - double maxLength = 0; - GSOFeature featureNew = new GSOFeature(); - for (int h = 0; h < listPS.Count; h++) - { - GSOGeoPolyline3D lineNew = new GSOGeoPolyline3D(); - lineNew.AddPart(listPS[h]); - GSOLabel label = new GSOLabel(); - label.Text = h.ToString(); - featureNew.Label = label; - double length = lineNew.GetSpaceLength(true, 6378137); - if (length > maxLength) - { - featureNew.Geometry = lineNew; - } - } - - return featureNew; - } - /// /// 更新最大最小状态 /// /// @@ -8340,219 +6789,6 @@ - private void buttonItem139_Click(object sender, EventArgs e) - { - - string filepath = ""; - //日志记录 - OpenFileDialog dlg = new OpenFileDialog(); - dlg.Filter = "矢量数据(*.shp)|*.shp|矢量数据(*.lgd)|*.lgd|全部支持格式(*.lgd,*.shp)|*.lgd;*.shp;"; - //dlg.Filter = "支持格式(*.lrp,*.tif,*.img,*.lrc,*.kml,*.lgd,*.shp,*.gft)|*.lrp;*.tif;*.img;*.lrc;*.kml;*.lgd;*.shp;*.gft|栅格数据(*.lrp)|*.lrp|栅格缓存(*.lrc)|*.lrc|KML数据(*.kml)|*.kml|矢量数据(*.lgd)|*.lgd|矢量缓存(*.gft)|*.gft|其它格式(*.*)|*.*||"; - dlg.Multiselect = true; - if (dlg.ShowDialog() == DialogResult.OK) - { - //自定义lprj文件名,从程序中复制一lprj文件。 - int bindex = dlg.FileName.Split('\\').Length; - string lastname = dlg.FileName.Split('\\')[bindex - 1]; - - for (int i = 0; i < dlg.FileNames.Length; i++) - { - string strDataPath = dlg.FileNames[i]; - filepath = strDataPath; - - GSOLayer layer = globeControl1.Globe.Layers.Add(strDataPath); - - } - - } - //放大到红线 - - - // globeControl1.Globe.Layers.MoveTo(0, globeControl1.Globe.Layers.Count - 1); - // globeControl1.Globe.Layers.MoveTo(0,4); - globeControl1.Refresh(); - - - } - /// - /// - /// - /// - /// - private void buttonItem142_Click(object sender, EventArgs e) - { - //获得红线polygon - //GSOLayer layerSevenLine = globeControl1.Globe.Layers.GetLayerByCaption(redlinelayername); - - GSOLayer layerSevenLine = globeControl1.Globe.Layers.Add("D:\\data\\歌林小镇shp\\test.shp"); - //获得红线结果列表 - ArrayList rrLists = new ArrayList(); - - //if (redlinelayername != "") - { - GSOFeatures fs = layerSevenLine.GetAllFeatures(); - int len = fs.Length; - - GSOGeoPolygon3D sevenPolygon = new GSOGeoPolygon3D(); - for (int k = 0; k < len; k++) - {//多根红线 - ///////生成红线区域/////// - GSOFeature featSevenLine = layerSevenLine.GetAt(k); - GSOGeoPolyline3D sevenLine = featSevenLine.Geometry as GSOGeoPolyline3D; - - List sevenParts = new List(); - for (int i = 0; i < sevenLine.PartCount; i++) - { - sevenParts.Add(sevenLine[i]); - } - for (int i = 0; i < sevenParts.Count; i++) - { - sevenPolygon.AddPart((GSOPoint3ds)sevenParts[i]); - } - /////拼出红线多边形over////// - - } - //GSOLayer layer = globeControl1.Globe.Layers.GetLayerByCaption("天然气管线"); - - GSOLayer layer = globeControl1.Globe.Layers.Add("C:\\Users\\nn-203\\Desktop\\xiaobai\\test.lgd"); - //线切割面定义,输出用 - GSOFeatures resFeats = new GSOFeatures(); - int resultstyle = 0; - //管线切割红线区域后,面积较小的区域 - GSOGeoPolygon3D restPoly = new GSOGeoPolygon3D(); - List inpts = new List(); - if (layer != null) - { - //红线区域 - GSOFeature sevenfeature = new GSOFeature(); - sevenfeature.Geometry = sevenPolygon; - - //获取不完全包含在面中的所有线 - GSOFeatures feats = layer.FindFeaturesInPolygon(sevenPolygon, false); - //获取完全包含在面中的所有线 - GSOFeatures featsTrue = layer.FindFeaturesInPolygon(sevenPolygon, true); - //获取面中所有对象组成的切割面的长线 - GSOFeature feature = new GSOFeature(); - - feature = getLineFromGSOFeatures(feats, featsTrue);//管线多个feature拼成一个feature - - //globeControl1.Globe.MemoryLayer.AddFeature(feature); - //globeControl1.Globe.MemoryLayer.AddFeature(sevenfeature); - if (feature != null) - { - //线切割面,输出 - //feature.HighLight = true; - GSODataEngineUtility.GSLineClipPolygon(feature, sevenfeature, out resFeats, out resultstyle); - } - else - { - MessageBox.Show("没有找到切割面的线对象!"); - } - ////////////////绘制分割后的多边形/////////////// - for (int a = 0; a < resFeats.Length; a++) - { - - GSOFeature gf = resFeats[1]; - globeControl1.Globe.MemoryLayer.AddFeature(gf); - - } - } - - - } - } - - private void buttonItem143_Click(object sender, EventArgs e) - { - //获得红线polygon - GSOLayer layerSevenLine = globeControl1.Globe.Layers.Add("d:\\lineAndPolygon.lgd"); - GSOLayer layerSevenLine2 = globeControl1.Globe.Layers.GetLayerByCaption("d:\\lineAndPolygon.lgd"); - //获得红线结果列表 - ArrayList rrLists = new ArrayList(); - - - // if (redlinelayername != "") - { - GSOFeatures fs = layerSevenLine.GetAllFeatures(); - int len = fs.Length; - - GSOGeoPolyline3D linetest = new GSOGeoPolyline3D(); - GSOGeoPolygon3D sevenPolygon = new GSOGeoPolygon3D(); - - GSOFeature linefeat = fs.FindByID(2); - //linefeat.Geometry = linetest; - GSOFeature polyfeat = fs.FindByID(1); - //polyfeat.Geometry = sevenPolygon; - - //线切割面定义,输出用 - GSOFeatures resFeats = new GSOFeatures(); - int resultstyle = 0; - GSODataEngineUtility.GSLineClipPolygon(linefeat, polyfeat, out resFeats, out resultstyle); - - ////////////////绘制分割后的多边形/////////////// - for (int a = 0; a < resFeats.Length; a++) - { - - GSOFeature gf = resFeats[0]; - globeControl1.Globe.MemoryLayer.AddFeature(gf); - - } - ////把红线切成一段段的线段,获得切前的红线点集 - List redpts = new List();//切前的红线点集合 - for (int i = 0; i < linetest.PartCount; i++) - { - GSOPoint3ds partP = linetest[i]; - for (int j = 0; j < partP.Count; j++) - { - redpts.Add(partP[j]); - } - } - - List redpts2 = new List();//切前的红线点集合 - for (int i = 0; i < sevenPolygon.PartCount; i++) - { - GSOPoint3ds partP = sevenPolygon[i]; - for (int j = 0; j < partP.Count; j++) - { - redpts2.Add(partP[j]); - } - } - } - } - /// - /// 增加用户手册下载连接 - /// - /// - /// - Cyberpipe.udfiles.UpDownFile UDF = new udfiles.UpDownFile(Utility.udserviceurl); - string dir_Ok = "C:\\Users\\nn-203\\Desktop"; - private void button1_Click(object sender, EventArgs e) - { - if (folderBrowserDialog1.ShowDialog() == DialogResult.OK) //打洙?开a文?件t夹D对?话°框ò - { - dir_Ok = folderBrowserDialog1.SelectedPath; //显?示?选?择?的?文?件t夹D路·径? - - //tempstr = folderBrowserDialog1.SelectedPath; //存?储洹?选?择?的?文?件t夹D路·径? - - } - - Cyberpipe.PED_logicfile.PED_Affair.Redact_D = Utility.uploadpath + "\\SFiles\\UserHbook\\说明.docx"; - if (File.Exists(dir_Ok + "\\" + Files_Name(Cyberpipe.PED_logicfile.PED_Affair.Redact_D, 1))) - { - if (MessageBox.Show("文件夹下有同名文件,是否替换?", "提示", MessageBoxButtons.YesNo, MessageBoxIcon.Information) == DialogResult.No) ; - - } - byte[] file = UDF.Down(Cyberpipe.PED_logicfile.PED_Affair.Redact_D); - FileStream pFileSream = new FileStream(dir_Ok + "\\说明.docx", FileMode.OpenOrCreate); - pFileSream.Write(file, 0, file.Length); - pFileSream.Close(); - if (File.Exists(dir_Ok + "\\" + Files_Name(Cyberpipe.PED_logicfile.PED_Affair.Redact_D, 1)) == true) - { - MessageBox.Show("文件导出成功!"); - } - //PEDAClass.Folder_Handle(dir_Ok + "\\" + PEDAClass.Files_Name(Cyberpipe.PED_logicfile.PED_Affair.Redact_D, 0), Cyberpipe.PED_logicfile.PED_Affair.Redact_D, "", 0); - - } /// /// 获取文件或文件夹的名称 /// @@ -8575,33 +6811,6 @@ return DF_Name; } - private void toolStripDropDownButton1_Click(object sender, EventArgs e) - { - if (folderBrowserDialog1.ShowDialog() == DialogResult.OK) //打洙?开a文?件t夹D对?话°框ò - { - dir_Ok = folderBrowserDialog1.SelectedPath; //显?示?选?择?的?文?件t夹D路·径? - - //tempstr = folderBrowserDialog1.SelectedPath; //存?储洹?选?择?的?文?件t夹D路·径? - - - Cyberpipe.PED_logicfile.PED_Affair.Redact_D = Utility.uploadpath + "\\SFiles\\UserHbook\\说明.docx"; - if (File.Exists(dir_Ok + "\\" + Files_Name(Cyberpipe.PED_logicfile.PED_Affair.Redact_D, 1))) - { - if (MessageBox.Show("文件夹下有同名文件,是否替换?", "提示", MessageBoxButtons.YesNo, MessageBoxIcon.Information) == DialogResult.No) ; - - } - byte[] file = UDF.Down(Cyberpipe.PED_logicfile.PED_Affair.Redact_D); - FileStream pFileSream = new FileStream(dir_Ok + "\\说明.docx", FileMode.OpenOrCreate); - pFileSream.Write(file, 0, file.Length); - pFileSream.Close(); - if (File.Exists(dir_Ok + "\\" + Files_Name(Cyberpipe.PED_logicfile.PED_Affair.Redact_D, 1)) == true) - { - MessageBox.Show("文件导出成功!"); - } - - } - } - /// /// 空间查询 /// @@ -9792,7 +8001,7 @@ GSOLayer resLayer = null; GSOFeature resFeature = null; globeControl1.Globe.GetSelectObject(0, out resFeature, out resLayer); - + if (resFeature == null) return; GSOGeoPolyline3D line1 = resFeature.Geometry as GSOGeoPolyline3D; if (line1 == null) { @@ -9876,7 +8085,7 @@ GSOLayer resLayer = null; GSOFeature resFeature = null; globeControl1.Globe.GetSelectObject(0, out resFeature, out resLayer); - + if (resFeature == null) return; GSOGeoPolyline3D line1 = resFeature.Geometry as GSOGeoPolyline3D; if (line1 == null) { @@ -9891,7 +8100,8 @@ } GSOFeatures feats = globeControl1.Globe.MemoryLayer.GetFeatureByName("粒子要素", true); - if (feats.Length > 0) + + if (feats!=null&&feats.Length > 0) globeControl1.Globe.MemoryLayer.RemoveFeatureByID(feats[0].ID); //if (emitterFeature != null) //{ @@ -11121,88 +9331,6 @@ } private int connectServerCount = 0; - - /// - /// 还原球到实测库 - /// - private void refreshGlobe1() - { - //添加实测库图层已有图层 - int servernum = 0; - //1.清除global1上 - for (int i = globeControl1.Globe.Layers.Count - 1; i >= 0; i--) - { - GSOLayer layer = globeControl1.Globe.Layers[i]; - if (!layer.Name.Contains("fttp:")) - { - layer.Dataset.Close();//清除内存 - globeControl1.Globe.Layers.Remove(layer); - } - else - { - servernum++; - } - } - - //globeControl1.Globe.ConnectServer(Utility.serverip, Utility.serverport, "", ""); //加载locaServer中的数据 - - //2.添加实测库图层 - string[] markerStrs = new string[9]; - markerStrs[0] = "标高标注"; - markerStrs[1] = "管径标注"; - markerStrs[2] = "埋深标注"; - markerStrs[3] = "坐标标注"; - markerStrs[4] = "坡度标注"; - markerStrs[5] = "属性标注"; - markerStrs[6] = "自定义标注"; - markerStrs[7] = "距离标注"; - markerStrs[8] = "扯旗标注"; - for (int i = 0; i < markerStrs.Length; i++) - { - if (File.Exists(Application.StartupPath + "\\标注管理\\" + markerStrs[i] + ".lgd")) - { - GSOLayer markerLayer = globeControl1.Globe.Layers.Add(Application.StartupPath + "\\标注管理\\" + markerStrs[i] + ".lgd"); - } - } - - for (int i = 0; i < g1layername.Count; i++) - { - string g1name = g1layername[i]; - GSODataset datasetg1 = Utility.dataSource.GetDatasetByName(g1name); - GSOLayer templayer = globeControl1.Globe.Layers.Add(datasetg1); - templayer.MaxVisibleAltitude = -1; - } - layerTemp = globeControl1.Globe.Layers.Add(Application.StartupPath + "\\tempLgdData.lgd"); - globeControl1.Globe.Layers.Add(Application.StartupPath + "/城市七线/城市红线.lgd"); - globeControl1.Globe.Layers.Add(Application.StartupPath + "/城市七线/城市橙线.lgd"); - globeControl1.Globe.Layers.Add(Application.StartupPath + "/城市七线/城市黄线.lgd"); - globeControl1.Globe.Layers.Add(Application.StartupPath + "/城市七线/城市绿线.lgd"); - globeControl1.Globe.Layers.Add(Application.StartupPath + "/城市七线/城市蓝线.lgd"); - globeControl1.Globe.Layers.Add(Application.StartupPath + "/城市七线/城市紫线.lgd"); - globeControl1.Globe.Layers.Add(Application.StartupPath + "/城市七线/城市黑线.lgd"); - globeControl1.Globe.Layers.Add(Application.StartupPath + "/隧道.lgd"); - - //移动server的数据图层 - for (int i = 0; i < servernum; i++) - { - globeControl1.Globe.Layers.MoveTo(globeControl1.Globe.Layers.Count - 1, 0); - } - - if (layerManagerNode.Nodes.Count > 0) - { - for (int i = layerManagerNode.Nodes.Count - 1; i >= 0; i--) - { - layerManagerNode.Nodes[i].Remove(); - - } - } - - - - globeControl1.Refresh(); - - } - /// /// 碰撞审查 /// @@ -11476,31 +9604,7 @@ // } //} #endregion - /// - /// 数据质量检查 - /// - /// - /// - private void buttonItemSJGL2_Click(object sender, EventArgs e) - { - //日志记录 - LogManager.saveLog(Utility.userName, this.buttonItemSJGL2.Text); - FrmValiData frm = new FrmValiData(globeControl1); - frm.ShowDialog(); - } - /// - /// 数据预处理 - /// - /// - /// - private void buttonItemSJGL3_Click(object sender, EventArgs e) - { - //保存日志 - LogManager.saveLog(Utility.userName, this.buttonItemSJGL3.Text); - FrmEditShapeFile frm = new FrmEditShapeFile(globeControl1); - frm.ShowDialog(this); - } /// /// 连接数据库 /// @@ -12251,60 +10355,6 @@ List lineStruct = new List(); GSOFeature featureSelected = null; - private void AddDatagridView(DataTable table) - { - - if (table != null && table.Rows.Count > 0) - { - dataGridViewX1.DataSource = table; - panelOfTable.Visible = true; - panelOfTable.Height = 200; - toolStripNumbers.Text = "红线审核结果"; - toolStripFeatureLength.Text = " 共有:" + table.Rows.Count + "条"; - } - else - { - - } - - } - - /// - /// 去除集合中重复的管线 - /// - /// - /// - /// - private GSOFeatures getFeaturesByFilter(GSOFeatures features, string fieldName) - { - if (features == null) - { - return null; - } - GSOFeatures featuresGet = new GSOFeatures(); - for (int i = 0; i < features.Length; i++) - { - GSOFeature featureFromFS = features[i]; - string fieldValueFromFS = featureFromFS.GetValue(fieldName).ToString().Trim(); - bool isHas = false; - for (int j = featuresGet.Length - 1; j >= 0; j--) - { - GSOFeature featureFromFSGet = featuresGet[j]; - string fieldValueFromFSGet = featureFromFSGet.GetValue(fieldName).ToString().Trim(); - if (fieldValueFromFS.Equals(fieldValueFromFSGet)) - { - isHas = true; - break; - } - } - if (isHas == false) - { - featuresGet.Add(featureFromFS.Clone()); - } - } - return featuresGet; - } - /// /// 数据管理导入文件 /// @@ -12440,138 +10490,7 @@ // //MessageBox.Show("系统运行错误:" + ex.ToString(), "错误", MessageBoxButtons.OK, MessageBoxIcon.Error); // } //} - - - /// - /// 标识器全区域统计 - /// - /// - /// - private void 标识器分类统计ToolStripMenuItem_Click(object sender, EventArgs e) - { - globeControl1.Globe.Action = EnumAction3D.ActionNull; - FrmBSQStatis bsqStatis = new FrmBSQStatis(); - bsqStatis.Show(this); - } - /// - /// 标识器绘制区域统计 - /// - /// - /// - private void 标识器分类统计ToolStripMenuItem1_Click(object sender, EventArgs e) - { - trackflag = "BSQDuoBianXiangStatis"; - globeControl1.Globe.Action = EnumAction3D.TrackPolygon; - } - - - #region 保存和加载审核库加载的图层 - private void saveLayerList(TreeNodeCollection treeNodeList) - { - string configPath = Application.StartupPath + "\\configLayerList.xml"; - try - { - XmlDocument doc = new XmlDocument(); - doc.Load(configPath); - XmlNode dbParams = doc.SelectSingleNode("Params/dbparams"); - XmlNode dbLayers = doc.SelectSingleNode("Params/dblayers"); - XmlNode layers = doc.SelectSingleNode("Params/layers"); - dbParams.RemoveAll(); - dbLayers.RemoveAll(); - layers.RemoveAll(); - - List listDS = new List(); - String shDatasourceName = Utility.sgdbip + "/" + Utility.sgdbname + "_" + Utility.sgdbuser; - bool flag = false; - - for (int i = 0; i < globeControl1.Globe.DataManager.DataSourceCount; i++) - { - GSODataSource ds = globeControl1.Globe.DataManager.GetDataSourceAt(i); - if (ds != null && ds.Type == EnumDataSourceType.SqlServer || ds.Type == EnumDataSourceType.Oracle) - { - if (ds.Name == shDatasourceName) - { - //防止因为多次连接同一个数据库 - if (flag == true) - { - break; - } - flag = true; - listDS.Add(ds); - GSODataSourceCnn conn = ds.GetConnectionInfo(); - - XmlElement dbparam = doc.CreateElement("shdbparam"); - XmlElement ip = doc.CreateElement("ship"); - ip.InnerText = conn.Server; - - XmlElement dbname = doc.CreateElement("shdbname"); - dbname.InnerText = conn.Database; - - XmlElement username = doc.CreateElement("shusername"); - username.InnerText = conn.User; - - XmlElement password = doc.CreateElement("shpassword"); - password.InnerText = conn.Password; - - XmlElement type = doc.CreateElement("shtype"); - if (ds.Type == EnumDataSourceType.SqlServer) - { - type.InnerText = "sqlserver"; - } - else - { - type.InnerText = "oracle"; - } - - dbparam.AppendChild(ip); - dbparam.AppendChild(dbname); - dbparam.AppendChild(username); - dbparam.AppendChild(password); - dbparam.AppendChild(type); - dbParams.AppendChild(dbparam); - } - - } - } - - for (int i = 0; i < treeNodeList.Count; i++) - { - GSOLayer layer = treeNodeList[i].Tag as GSOLayer; - if (Path.GetExtension(layer.Name) == "") - { - XmlElement dbLayer = doc.CreateElement("dblayer"); - XmlAttribute attri = doc.CreateAttribute("dbindex"); - for (int j = 0; j < listDS.Count; j++) - { - if (layer.Dataset.DataSource.Name == listDS[j].Name) - { - attri.Value = j.ToString(); - break; - } - } - dbLayer.Attributes.Append(attri); - dbLayer.InnerText = layer.Name; - - dbLayers.AppendChild(dbLayer); - } - else - { - XmlElement dbLayer = doc.CreateElement("layer"); - dbLayer.InnerText = layer.Name; - layers.AppendChild(dbLayer); - } - } - - doc.Save(configPath); - } - catch (Exception e) - { - - } - } - - #endregion - + private void buttonItem_TaskManager_Click(object sender, EventArgs e) { if (Form_TaksManager.IS_OPEN) diff --git a/MainFrm.designer.cs b/MainFrm.designer.cs index 233ef8c..97b8299 100644 --- a/MainFrm.designer.cs +++ b/MainFrm.designer.cs @@ -82,6 +82,7 @@ this.sideBar1 = new DevComponents.DotNetBar.SideBar(); this.panelEx3 = new DevComponents.DotNetBar.PanelEx(); this.layerSensorTree = new System.Windows.Forms.TreeView(); + this.layerTree = new Cyberpipe.MyTreeView(); this.sideBarPanelItem3 = new DevComponents.DotNetBar.SideBarPanelItem(); this.controlContainerItem3 = new DevComponents.DotNetBar.ControlContainerItem(); this.sideBarPanelItem4 = new DevComponents.DotNetBar.SideBarPanelItem(); @@ -365,30 +366,26 @@ this.可编辑ToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); this.保存ToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); this.ribbonControl1 = new DevComponents.DotNetBar.RibbonControl(); - this.ribbonPanel1 = new DevComponents.DotNetBar.RibbonPanel(); - this.ribbonBar21 = new DevComponents.DotNetBar.RibbonBar(); - this.buttonItem87 = new DevComponents.DotNetBar.ButtonItem(); - this.buttonItem88 = new DevComponents.DotNetBar.ButtonItem(); - this.buttonItem27 = new DevComponents.DotNetBar.ButtonItem(); - this.buttonItem91 = new DevComponents.DotNetBar.ButtonItem(); - this.buttonItem1 = new DevComponents.DotNetBar.ButtonItem(); - this.btnlegendSet = new DevComponents.DotNetBar.ButtonItem(); - this.buttonItem89 = new DevComponents.DotNetBar.ButtonItem(); - this.ribbonPanel7 = new DevComponents.DotNetBar.RibbonPanel(); - this.ribbonBar5 = new DevComponents.DotNetBar.RibbonBar(); - this.btn_flag = new DevComponents.DotNetBar.ButtonItem(); - this.slider4ground = new DevComponents.DotNetBar.SliderItem(); - this.ribbonPanel2 = new DevComponents.DotNetBar.RibbonPanel(); - this.ribbonBar4 = new DevComponents.DotNetBar.RibbonBar(); - this.buttonItem_TaskManager = new DevComponents.DotNetBar.ButtonItem(); - this.buttonItem_OnlineTask = new DevComponents.DotNetBar.ButtonItem(); - this.buttonItem_Event = new DevComponents.DotNetBar.ButtonItem(); this.ribbonPanel3 = new DevComponents.DotNetBar.RibbonPanel(); this.ribbonBar3 = new DevComponents.DotNetBar.RibbonBar(); this.btn_device = new DevComponents.DotNetBar.ButtonItem(); this.btn_Person = new DevComponents.DotNetBar.ButtonItem(); this.btn_constructMap = new DevComponents.DotNetBar.ButtonItem(); this.buttonItem9 = new DevComponents.DotNetBar.ButtonItem(); + this.ribbonPanel2 = new DevComponents.DotNetBar.RibbonPanel(); + this.ribbonBar4 = new DevComponents.DotNetBar.RibbonBar(); + this.buttonItem_TaskManager = new DevComponents.DotNetBar.ButtonItem(); + this.buttonItem_OnlineTask = new DevComponents.DotNetBar.ButtonItem(); + this.buttonItem_Event = new DevComponents.DotNetBar.ButtonItem(); + this.ribbonPanel1 = new DevComponents.DotNetBar.RibbonPanel(); + this.ribbonBar21 = new DevComponents.DotNetBar.RibbonBar(); + this.buttonItem87 = new DevComponents.DotNetBar.ButtonItem(); + this.buttonItem88 = new DevComponents.DotNetBar.ButtonItem(); + this.buttonItem27 = new DevComponents.DotNetBar.ButtonItem(); + this.buttonItem1 = new DevComponents.DotNetBar.ButtonItem(); + this.buttonItem91 = new DevComponents.DotNetBar.ButtonItem(); + this.btnlegendSet = new DevComponents.DotNetBar.ButtonItem(); + this.buttonItem89 = new DevComponents.DotNetBar.ButtonItem(); this.ribbonPanel8 = new DevComponents.DotNetBar.RibbonPanel(); this.ribbonBar_UserInfo = new DevComponents.DotNetBar.RibbonBar(); this.btn_user_info = new DevComponents.DotNetBar.ButtonItem(); @@ -398,6 +395,10 @@ this.btn_user_role = new DevComponents.DotNetBar.ButtonItem(); this.btn_password_edit = new DevComponents.DotNetBar.ButtonItem(); this.btn_reset_password = new DevComponents.DotNetBar.ButtonItem(); + this.ribbonPanel7 = new DevComponents.DotNetBar.RibbonPanel(); + this.ribbonBar5 = new DevComponents.DotNetBar.RibbonBar(); + this.btn_flag = new DevComponents.DotNetBar.ButtonItem(); + this.slider4ground = new DevComponents.DotNetBar.SliderItem(); this.ribbonPanel15 = new DevComponents.DotNetBar.RibbonPanel(); this.ribbonBar20 = new DevComponents.DotNetBar.RibbonBar(); this.buttonItemSJGL = new DevComponents.DotNetBar.ButtonItem(); @@ -610,7 +611,6 @@ this.buttonItem84 = new DevComponents.DotNetBar.ButtonItem(); this.buttonItem75 = new DevComponents.DotNetBar.ButtonItem(); this.buttonItem76 = new DevComponents.DotNetBar.ButtonItem(); - this.layerTree = new Cyberpipe.MyTreeView(); this.statusStrip1.SuspendLayout(); this.sideBar1.SuspendLayout(); this.panelEx3.SuspendLayout(); @@ -647,11 +647,11 @@ this.contextMenuStrip3.SuspendLayout(); this.contextMenuStripDeleteLayerNode.SuspendLayout(); this.ribbonControl1.SuspendLayout(); - this.ribbonPanel1.SuspendLayout(); - this.ribbonPanel7.SuspendLayout(); - this.ribbonPanel2.SuspendLayout(); this.ribbonPanel3.SuspendLayout(); + this.ribbonPanel2.SuspendLayout(); + this.ribbonPanel1.SuspendLayout(); this.ribbonPanel8.SuspendLayout(); + this.ribbonPanel7.SuspendLayout(); this.ribbonPanel15.SuspendLayout(); ((System.ComponentModel.ISupportInitialize)(this.pictureBox1)).BeginInit(); this.SuspendLayout(); @@ -813,7 +813,6 @@ this.toolStripDropDownButton1.Size = new System.Drawing.Size(45, 21); this.toolStripDropDownButton1.Text = "帮助"; this.toolStripDropDownButton1.Visible = false; - this.toolStripDropDownButton1.Click += new System.EventHandler(this.toolStripDropDownButton1_Click); // // controlContainerItem1 // @@ -1047,6 +1046,16 @@ this.layerSensorTree.AfterCheck += new System.Windows.Forms.TreeViewEventHandler(this.layerMarkerTree_AfterCheck); this.layerSensorTree.NodeMouseClick += new System.Windows.Forms.TreeNodeMouseClickEventHandler(this.layerMarkerTree_NodeMouseClick); // + // layerTree + // + this.layerTree.CheckBoxes = true; + this.layerTree.ItemHeight = 18; + this.layerTree.Location = new System.Drawing.Point(30, 78); + this.layerTree.Name = "layerTree"; + this.layerTree.Size = new System.Drawing.Size(121, 97); + this.layerTree.TabIndex = 1; + this.layerTree.AfterCheck += new System.Windows.Forms.TreeViewEventHandler(this.layerTree_AfterCheck); + // // sideBarPanelItem3 // this.sideBarPanelItem3.FontBold = true; @@ -2966,28 +2975,28 @@ // 平移对象ToolStripMenuItem // this.平移对象ToolStripMenuItem.Name = "平移对象ToolStripMenuItem"; - this.平移对象ToolStripMenuItem.Size = new System.Drawing.Size(152, 22); + this.平移对象ToolStripMenuItem.Size = new System.Drawing.Size(124, 22); this.平移对象ToolStripMenuItem.Text = "平移对象"; this.平移对象ToolStripMenuItem.Click += new System.EventHandler(this.buttonItemBJ6_Click); // // 升降对象ToolStripMenuItem // this.升降对象ToolStripMenuItem.Name = "升降对象ToolStripMenuItem"; - this.升降对象ToolStripMenuItem.Size = new System.Drawing.Size(152, 22); + this.升降对象ToolStripMenuItem.Size = new System.Drawing.Size(124, 22); this.升降对象ToolStripMenuItem.Text = "升降对象"; this.升降对象ToolStripMenuItem.Click += new System.EventHandler(this.buttonItemBJ7_Click); // // 旋转对象ToolStripMenuItem // this.旋转对象ToolStripMenuItem.Name = "旋转对象ToolStripMenuItem"; - this.旋转对象ToolStripMenuItem.Size = new System.Drawing.Size(152, 22); + this.旋转对象ToolStripMenuItem.Size = new System.Drawing.Size(124, 22); this.旋转对象ToolStripMenuItem.Text = "旋转对象"; this.旋转对象ToolStripMenuItem.Click += new System.EventHandler(this.buttonItemBJ8_Click); // // 连接管段ToolStripMenuItem // this.连接管段ToolStripMenuItem.Name = "连接管段ToolStripMenuItem"; - this.连接管段ToolStripMenuItem.Size = new System.Drawing.Size(152, 22); + this.连接管段ToolStripMenuItem.Size = new System.Drawing.Size(124, 22); this.连接管段ToolStripMenuItem.Text = "连接管段"; this.连接管段ToolStripMenuItem.Click += new System.EventHandler(this.buttonItemBJ9_Click); // @@ -2997,34 +3006,34 @@ this.导出CADToolStripMenuItem, this.导出文件ToolStripMenuItem1}); this.导出文件ToolStripMenuItem.Name = "导出文件ToolStripMenuItem"; - this.导出文件ToolStripMenuItem.Size = new System.Drawing.Size(152, 22); + this.导出文件ToolStripMenuItem.Size = new System.Drawing.Size(124, 22); this.导出文件ToolStripMenuItem.Text = "导出矢量"; // // 导出CADToolStripMenuItem // this.导出CADToolStripMenuItem.Name = "导出CADToolStripMenuItem"; - this.导出CADToolStripMenuItem.Size = new System.Drawing.Size(152, 22); + this.导出CADToolStripMenuItem.Size = new System.Drawing.Size(125, 22); this.导出CADToolStripMenuItem.Text = "导出CAD"; this.导出CADToolStripMenuItem.Click += new System.EventHandler(this.buttonItemBJ10_1_Click); // // 导出文件ToolStripMenuItem1 // this.导出文件ToolStripMenuItem1.Name = "导出文件ToolStripMenuItem1"; - this.导出文件ToolStripMenuItem1.Size = new System.Drawing.Size(152, 22); + this.导出文件ToolStripMenuItem1.Size = new System.Drawing.Size(125, 22); this.导出文件ToolStripMenuItem1.Text = "导出文件"; this.导出文件ToolStripMenuItem1.Click += new System.EventHandler(this.buttonItemBJ10_2_Click); // // 前进ToolStripMenuItem // this.前进ToolStripMenuItem.Name = "前进ToolStripMenuItem"; - this.前进ToolStripMenuItem.Size = new System.Drawing.Size(152, 22); + this.前进ToolStripMenuItem.Size = new System.Drawing.Size(124, 22); this.前进ToolStripMenuItem.Text = "前进"; this.前进ToolStripMenuItem.Click += new System.EventHandler(this.buttonItemBJ12_Click); // // 删除模型ToolStripMenuItem // this.删除模型ToolStripMenuItem.Name = "删除模型ToolStripMenuItem"; - this.删除模型ToolStripMenuItem.Size = new System.Drawing.Size(152, 22); + this.删除模型ToolStripMenuItem.Size = new System.Drawing.Size(124, 22); this.删除模型ToolStripMenuItem.Text = "后退"; this.删除模型ToolStripMenuItem.Click += new System.EventHandler(this.buttonItemBJ11_Click); // @@ -4160,6 +4169,198 @@ this.ribbonControl1.Text = "ribbonControl1"; this.ribbonControl1.UseCustomizeDialog = false; // + // ribbonPanel3 + // + this.ribbonPanel3.ColorSchemeStyle = DevComponents.DotNetBar.eDotNetBarStyle.StyleManagerControlled; + this.ribbonPanel3.Controls.Add(this.ribbonBar3); + this.ribbonPanel3.Dock = System.Windows.Forms.DockStyle.Fill; + this.ribbonPanel3.Location = new System.Drawing.Point(0, 33); + this.ribbonPanel3.Name = "ribbonPanel3"; + this.ribbonPanel3.Padding = new System.Windows.Forms.Padding(3, 0, 3, 3); + this.ribbonPanel3.Size = new System.Drawing.Size(1328, 62); + // + // + // + this.ribbonPanel3.Style.Class = ""; + this.ribbonPanel3.Style.CornerType = DevComponents.DotNetBar.eCornerType.Square; + // + // + // + this.ribbonPanel3.StyleMouseDown.Class = ""; + this.ribbonPanel3.StyleMouseDown.CornerType = DevComponents.DotNetBar.eCornerType.Square; + // + // + // + this.ribbonPanel3.StyleMouseOver.Class = ""; + this.ribbonPanel3.StyleMouseOver.CornerType = DevComponents.DotNetBar.eCornerType.Square; + this.ribbonPanel3.TabIndex = 40; + // + // ribbonBar3 + // + this.ribbonBar3.AutoOverflowEnabled = true; + // + // + // + this.ribbonBar3.BackgroundMouseOverStyle.Class = ""; + this.ribbonBar3.BackgroundMouseOverStyle.CornerType = DevComponents.DotNetBar.eCornerType.Square; + // + // + // + this.ribbonBar3.BackgroundStyle.Class = ""; + this.ribbonBar3.BackgroundStyle.CornerType = DevComponents.DotNetBar.eCornerType.Square; + this.ribbonBar3.ContainerControlProcessDialogKey = true; + this.ribbonBar3.Dock = System.Windows.Forms.DockStyle.Left; + this.ribbonBar3.Items.AddRange(new DevComponents.DotNetBar.BaseItem[] { + this.btn_device, + this.btn_Person, + this.btn_constructMap, + this.buttonItem9}); + this.ribbonBar3.Location = new System.Drawing.Point(3, 0); + this.ribbonBar3.Name = "ribbonBar3"; + this.ribbonBar3.Size = new System.Drawing.Size(378, 59); + this.ribbonBar3.Style = DevComponents.DotNetBar.eDotNetBarStyle.StyleManagerControlled; + this.ribbonBar3.TabIndex = 0; + // + // + // + this.ribbonBar3.TitleStyle.Class = ""; + this.ribbonBar3.TitleStyle.CornerType = DevComponents.DotNetBar.eCornerType.Square; + // + // + // + this.ribbonBar3.TitleStyleMouseOver.Class = ""; + this.ribbonBar3.TitleStyleMouseOver.CornerType = DevComponents.DotNetBar.eCornerType.Square; + this.ribbonBar3.TitleVisible = false; + // + // btn_device + // + this.btn_device.ButtonStyle = DevComponents.DotNetBar.eButtonStyle.ImageAndText; + this.btn_device.Image = global::Cyberpipe.Properties.Resources._24X24__2__02; + this.btn_device.ImagePosition = DevComponents.DotNetBar.eImagePosition.Top; + this.btn_device.Name = "btn_device"; + this.btn_device.SubItemsExpandWidth = 14; + this.btn_device.Text = "探测仪管理"; + this.btn_device.Click += new System.EventHandler(this.btn_device_Click); + // + // btn_Person + // + this.btn_Person.ButtonStyle = DevComponents.DotNetBar.eButtonStyle.ImageAndText; + this.btn_Person.Image = global::Cyberpipe.Properties.Resources._24x24icon_05_hover1; + this.btn_Person.ImagePosition = DevComponents.DotNetBar.eImagePosition.Top; + this.btn_Person.Name = "btn_Person"; + this.btn_Person.SubItemsExpandWidth = 14; + this.btn_Person.Text = "定位人员维护"; + this.btn_Person.Click += new System.EventHandler(this.btn_Person_Click); + // + // btn_constructMap + // + this.btn_constructMap.Image = global::Cyberpipe.Properties.Resources._24x24icon_04_hover; + this.btn_constructMap.ImagePosition = DevComponents.DotNetBar.eImagePosition.Top; + this.btn_constructMap.Name = "btn_constructMap"; + this.btn_constructMap.SubItemsExpandWidth = 14; + this.btn_constructMap.Text = "导出施工图"; + this.btn_constructMap.Click += new System.EventHandler(this.btn_constructMap_Click); + // + // buttonItem9 + // + this.buttonItem9.Image = global::Cyberpipe.Properties.Resources._24x24icon__2__10; + this.buttonItem9.ImagePosition = DevComponents.DotNetBar.eImagePosition.Top; + this.buttonItem9.Name = "buttonItem9"; + this.buttonItem9.SubItemsExpandWidth = 14; + this.buttonItem9.Text = "文档管理"; + this.buttonItem9.Click += new System.EventHandler(this.buttonItem9_Click); + // + // ribbonPanel2 + // + this.ribbonPanel2.ColorSchemeStyle = DevComponents.DotNetBar.eDotNetBarStyle.StyleManagerControlled; + this.ribbonPanel2.Controls.Add(this.ribbonBar4); + this.ribbonPanel2.Dock = System.Windows.Forms.DockStyle.Fill; + this.ribbonPanel2.Location = new System.Drawing.Point(0, 0); + this.ribbonPanel2.Name = "ribbonPanel2"; + this.ribbonPanel2.Padding = new System.Windows.Forms.Padding(3, 0, 3, 3); + this.ribbonPanel2.Size = new System.Drawing.Size(1328, 95); + // + // + // + this.ribbonPanel2.Style.Class = ""; + this.ribbonPanel2.Style.CornerType = DevComponents.DotNetBar.eCornerType.Square; + // + // + // + this.ribbonPanel2.StyleMouseDown.Class = ""; + this.ribbonPanel2.StyleMouseDown.CornerType = DevComponents.DotNetBar.eCornerType.Square; + // + // + // + this.ribbonPanel2.StyleMouseOver.Class = ""; + this.ribbonPanel2.StyleMouseOver.CornerType = DevComponents.DotNetBar.eCornerType.Square; + this.ribbonPanel2.TabIndex = 39; + this.ribbonPanel2.Visible = false; + // + // ribbonBar4 + // + this.ribbonBar4.AutoOverflowEnabled = true; + // + // + // + this.ribbonBar4.BackgroundMouseOverStyle.Class = ""; + this.ribbonBar4.BackgroundMouseOverStyle.CornerType = DevComponents.DotNetBar.eCornerType.Square; + // + // + // + this.ribbonBar4.BackgroundStyle.Class = ""; + this.ribbonBar4.BackgroundStyle.CornerType = DevComponents.DotNetBar.eCornerType.Square; + this.ribbonBar4.ContainerControlProcessDialogKey = true; + this.ribbonBar4.Dock = System.Windows.Forms.DockStyle.Left; + this.ribbonBar4.Items.AddRange(new DevComponents.DotNetBar.BaseItem[] { + this.buttonItem_TaskManager, + this.buttonItem_OnlineTask, + this.buttonItem_Event}); + this.ribbonBar4.Location = new System.Drawing.Point(3, 0); + this.ribbonBar4.Name = "ribbonBar4"; + this.ribbonBar4.Size = new System.Drawing.Size(299, 92); + this.ribbonBar4.Style = DevComponents.DotNetBar.eDotNetBarStyle.StyleManagerControlled; + this.ribbonBar4.TabIndex = 0; + this.ribbonBar4.Text = "ribbonBar4"; + // + // + // + this.ribbonBar4.TitleStyle.Class = ""; + this.ribbonBar4.TitleStyle.CornerType = DevComponents.DotNetBar.eCornerType.Square; + // + // + // + this.ribbonBar4.TitleStyleMouseOver.Class = ""; + this.ribbonBar4.TitleStyleMouseOver.CornerType = DevComponents.DotNetBar.eCornerType.Square; + this.ribbonBar4.TitleVisible = false; + // + // buttonItem_TaskManager + // + this.buttonItem_TaskManager.Image = global::Cyberpipe.Properties.Resources._24x24icon__2__76; + this.buttonItem_TaskManager.ImagePosition = DevComponents.DotNetBar.eImagePosition.Top; + this.buttonItem_TaskManager.Name = "buttonItem_TaskManager"; + this.buttonItem_TaskManager.SubItemsExpandWidth = 14; + this.buttonItem_TaskManager.Text = "工单管理"; + this.buttonItem_TaskManager.Click += new System.EventHandler(this.buttonItem_TaskManager_Click); + // + // buttonItem_OnlineTask + // + this.buttonItem_OnlineTask.Image = global::Cyberpipe.Properties.Resources._24x24icon__2__69; + this.buttonItem_OnlineTask.ImagePosition = DevComponents.DotNetBar.eImagePosition.Top; + this.buttonItem_OnlineTask.Name = "buttonItem_OnlineTask"; + this.buttonItem_OnlineTask.SubItemsExpandWidth = 14; + this.buttonItem_OnlineTask.Text = "在线任务"; + this.buttonItem_OnlineTask.Click += new System.EventHandler(this.buttonItem_OnlineTask_Click); + // + // buttonItem_Event + // + this.buttonItem_Event.Image = global::Cyberpipe.Properties.Resources._24x24icon__2__72; + this.buttonItem_Event.ImagePosition = DevComponents.DotNetBar.eImagePosition.Top; + this.buttonItem_Event.Name = "buttonItem_Event"; + this.buttonItem_Event.SubItemsExpandWidth = 14; + this.buttonItem_Event.Text = "事件管理"; + this.buttonItem_Event.Click += new System.EventHandler(this.buttonItem_Event_Click); + // // ribbonPanel1 // this.ribbonPanel1.AutoSize = true; @@ -4262,6 +4463,15 @@ this.buttonItem27.Visible = false; this.buttonItem27.Click += new System.EventHandler(this.buttonItem27_Click); // + // buttonItem1 + // + this.buttonItem1.Image = global::Cyberpipe.Properties.Resources._24x24icon__2__94; + this.buttonItem1.ImagePosition = DevComponents.DotNetBar.eImagePosition.Top; + this.buttonItem1.Name = "buttonItem1"; + this.buttonItem1.SubItemsExpandWidth = 14; + this.buttonItem1.Text = "图层管理"; + this.buttonItem1.Click += new System.EventHandler(this.buttonItem1_Click); + // // buttonItem91 // this.buttonItem91.ForeColor = System.Drawing.Color.Black; @@ -4272,15 +4482,6 @@ this.buttonItem91.Text = "快速定位"; this.buttonItem91.Click += new System.EventHandler(this.buttonItem91_Click); // - // buttonItem1 - // - this.buttonItem1.Image = global::Cyberpipe.Properties.Resources._24x24icon__2__94; - this.buttonItem1.ImagePosition = DevComponents.DotNetBar.eImagePosition.Top; - this.buttonItem1.Name = "buttonItem1"; - this.buttonItem1.SubItemsExpandWidth = 14; - this.buttonItem1.Text = "图层管理"; - this.buttonItem1.Click += new System.EventHandler(this.buttonItem1_Click); - // // btnlegendSet // this.btnlegendSet.Image = global::Cyberpipe.Properties.Resources._24x24icon__2__93; @@ -4300,278 +4501,6 @@ this.buttonItem89.Visible = false; this.buttonItem89.Click += new System.EventHandler(this.buttonItem89_Click); // - // ribbonPanel7 - // - this.ribbonPanel7.ColorSchemeStyle = DevComponents.DotNetBar.eDotNetBarStyle.StyleManagerControlled; - this.ribbonPanel7.Controls.Add(this.ribbonBar5); - this.ribbonPanel7.Dock = System.Windows.Forms.DockStyle.Fill; - this.ribbonPanel7.Location = new System.Drawing.Point(0, 0); - this.ribbonPanel7.Name = "ribbonPanel7"; - this.ribbonPanel7.Padding = new System.Windows.Forms.Padding(3, 0, 3, 3); - this.ribbonPanel7.Size = new System.Drawing.Size(1328, 95); - // - // - // - this.ribbonPanel7.Style.Class = ""; - this.ribbonPanel7.Style.CornerType = DevComponents.DotNetBar.eCornerType.Square; - // - // - // - this.ribbonPanel7.StyleMouseDown.Class = ""; - this.ribbonPanel7.StyleMouseDown.CornerType = DevComponents.DotNetBar.eCornerType.Square; - // - // - // - this.ribbonPanel7.StyleMouseOver.Class = ""; - this.ribbonPanel7.StyleMouseOver.CornerType = DevComponents.DotNetBar.eCornerType.Square; - this.ribbonPanel7.TabIndex = 41; - this.ribbonPanel7.Visible = false; - // - // ribbonBar5 - // - this.ribbonBar5.AutoOverflowEnabled = true; - // - // - // - this.ribbonBar5.BackgroundMouseOverStyle.Class = ""; - this.ribbonBar5.BackgroundMouseOverStyle.CornerType = DevComponents.DotNetBar.eCornerType.Square; - // - // - // - this.ribbonBar5.BackgroundStyle.Class = ""; - this.ribbonBar5.BackgroundStyle.CornerType = DevComponents.DotNetBar.eCornerType.Square; - this.ribbonBar5.ContainerControlProcessDialogKey = true; - this.ribbonBar5.Dock = System.Windows.Forms.DockStyle.Left; - this.ribbonBar5.Items.AddRange(new DevComponents.DotNetBar.BaseItem[] { - this.btn_flag, - this.slider4ground}); - this.ribbonBar5.Location = new System.Drawing.Point(3, 0); - this.ribbonBar5.Name = "ribbonBar5"; - this.ribbonBar5.Size = new System.Drawing.Size(418, 92); - this.ribbonBar5.Style = DevComponents.DotNetBar.eDotNetBarStyle.StyleManagerControlled; - this.ribbonBar5.TabIndex = 0; - // - // - // - this.ribbonBar5.TitleStyle.Class = ""; - this.ribbonBar5.TitleStyle.CornerType = DevComponents.DotNetBar.eCornerType.Square; - // - // - // - this.ribbonBar5.TitleStyleMouseOver.Class = ""; - this.ribbonBar5.TitleStyleMouseOver.CornerType = DevComponents.DotNetBar.eCornerType.Square; - this.ribbonBar5.TitleVisible = false; - this.ribbonBar5.ItemClick += new System.EventHandler(this.ribbonBar5_ItemClick); - // - // btn_flag - // - this.btn_flag.Image = global::Cyberpipe.Properties.Resources._24x24icon_03_hover; - this.btn_flag.ImagePosition = DevComponents.DotNetBar.eImagePosition.Top; - this.btn_flag.Name = "btn_flag"; - this.btn_flag.SubItemsExpandWidth = 14; - this.btn_flag.Text = "标识器管理"; - this.btn_flag.Click += new System.EventHandler(this.btn_flag_Click); - // - // slider4ground - // - this.slider4ground.LabelPosition = DevComponents.DotNetBar.eSliderLabelPosition.Top; - this.slider4ground.Name = "slider4ground"; - this.slider4ground.Text = "地面透明度"; - this.slider4ground.Value = 0; - this.slider4ground.ValueChanged += new System.EventHandler(this.slider4ground_ValueChanged); - // - // ribbonPanel2 - // - this.ribbonPanel2.ColorSchemeStyle = DevComponents.DotNetBar.eDotNetBarStyle.StyleManagerControlled; - this.ribbonPanel2.Controls.Add(this.ribbonBar4); - this.ribbonPanel2.Dock = System.Windows.Forms.DockStyle.Fill; - this.ribbonPanel2.Location = new System.Drawing.Point(0, 0); - this.ribbonPanel2.Name = "ribbonPanel2"; - this.ribbonPanel2.Padding = new System.Windows.Forms.Padding(3, 0, 3, 3); - this.ribbonPanel2.Size = new System.Drawing.Size(1328, 95); - // - // - // - this.ribbonPanel2.Style.Class = ""; - this.ribbonPanel2.Style.CornerType = DevComponents.DotNetBar.eCornerType.Square; - // - // - // - this.ribbonPanel2.StyleMouseDown.Class = ""; - this.ribbonPanel2.StyleMouseDown.CornerType = DevComponents.DotNetBar.eCornerType.Square; - // - // - // - this.ribbonPanel2.StyleMouseOver.Class = ""; - this.ribbonPanel2.StyleMouseOver.CornerType = DevComponents.DotNetBar.eCornerType.Square; - this.ribbonPanel2.TabIndex = 39; - this.ribbonPanel2.Visible = false; - // - // ribbonBar4 - // - this.ribbonBar4.AutoOverflowEnabled = true; - // - // - // - this.ribbonBar4.BackgroundMouseOverStyle.Class = ""; - this.ribbonBar4.BackgroundMouseOverStyle.CornerType = DevComponents.DotNetBar.eCornerType.Square; - // - // - // - this.ribbonBar4.BackgroundStyle.Class = ""; - this.ribbonBar4.BackgroundStyle.CornerType = DevComponents.DotNetBar.eCornerType.Square; - this.ribbonBar4.ContainerControlProcessDialogKey = true; - this.ribbonBar4.Dock = System.Windows.Forms.DockStyle.Left; - this.ribbonBar4.Items.AddRange(new DevComponents.DotNetBar.BaseItem[] { - this.buttonItem_TaskManager, - this.buttonItem_OnlineTask, - this.buttonItem_Event}); - this.ribbonBar4.Location = new System.Drawing.Point(3, 0); - this.ribbonBar4.Name = "ribbonBar4"; - this.ribbonBar4.Size = new System.Drawing.Size(299, 92); - this.ribbonBar4.Style = DevComponents.DotNetBar.eDotNetBarStyle.StyleManagerControlled; - this.ribbonBar4.TabIndex = 0; - this.ribbonBar4.Text = "ribbonBar4"; - // - // - // - this.ribbonBar4.TitleStyle.Class = ""; - this.ribbonBar4.TitleStyle.CornerType = DevComponents.DotNetBar.eCornerType.Square; - // - // - // - this.ribbonBar4.TitleStyleMouseOver.Class = ""; - this.ribbonBar4.TitleStyleMouseOver.CornerType = DevComponents.DotNetBar.eCornerType.Square; - this.ribbonBar4.TitleVisible = false; - // - // buttonItem_TaskManager - // - this.buttonItem_TaskManager.Image = global::Cyberpipe.Properties.Resources._24x24icon__2__76; - this.buttonItem_TaskManager.ImagePosition = DevComponents.DotNetBar.eImagePosition.Top; - this.buttonItem_TaskManager.Name = "buttonItem_TaskManager"; - this.buttonItem_TaskManager.SubItemsExpandWidth = 14; - this.buttonItem_TaskManager.Text = "工单管理"; - this.buttonItem_TaskManager.Click += new System.EventHandler(this.buttonItem_TaskManager_Click); - // - // buttonItem_OnlineTask - // - this.buttonItem_OnlineTask.Image = global::Cyberpipe.Properties.Resources._24x24icon__2__69; - this.buttonItem_OnlineTask.ImagePosition = DevComponents.DotNetBar.eImagePosition.Top; - this.buttonItem_OnlineTask.Name = "buttonItem_OnlineTask"; - this.buttonItem_OnlineTask.SubItemsExpandWidth = 14; - this.buttonItem_OnlineTask.Text = "在线任务"; - this.buttonItem_OnlineTask.Click += new System.EventHandler(this.buttonItem_OnlineTask_Click); - // - // buttonItem_Event - // - this.buttonItem_Event.Image = global::Cyberpipe.Properties.Resources._24x24icon__2__72; - this.buttonItem_Event.ImagePosition = DevComponents.DotNetBar.eImagePosition.Top; - this.buttonItem_Event.Name = "buttonItem_Event"; - this.buttonItem_Event.SubItemsExpandWidth = 14; - this.buttonItem_Event.Text = "事件管理"; - this.buttonItem_Event.Click += new System.EventHandler(this.buttonItem_Event_Click); - // - // ribbonPanel3 - // - this.ribbonPanel3.ColorSchemeStyle = DevComponents.DotNetBar.eDotNetBarStyle.StyleManagerControlled; - this.ribbonPanel3.Controls.Add(this.ribbonBar3); - this.ribbonPanel3.Dock = System.Windows.Forms.DockStyle.Fill; - this.ribbonPanel3.Location = new System.Drawing.Point(0, 33); - this.ribbonPanel3.Name = "ribbonPanel3"; - this.ribbonPanel3.Padding = new System.Windows.Forms.Padding(3, 0, 3, 3); - this.ribbonPanel3.Size = new System.Drawing.Size(1328, 62); - // - // - // - this.ribbonPanel3.Style.Class = ""; - this.ribbonPanel3.Style.CornerType = DevComponents.DotNetBar.eCornerType.Square; - // - // - // - this.ribbonPanel3.StyleMouseDown.Class = ""; - this.ribbonPanel3.StyleMouseDown.CornerType = DevComponents.DotNetBar.eCornerType.Square; - // - // - // - this.ribbonPanel3.StyleMouseOver.Class = ""; - this.ribbonPanel3.StyleMouseOver.CornerType = DevComponents.DotNetBar.eCornerType.Square; - this.ribbonPanel3.TabIndex = 40; - // - // ribbonBar3 - // - this.ribbonBar3.AutoOverflowEnabled = true; - // - // - // - this.ribbonBar3.BackgroundMouseOverStyle.Class = ""; - this.ribbonBar3.BackgroundMouseOverStyle.CornerType = DevComponents.DotNetBar.eCornerType.Square; - // - // - // - this.ribbonBar3.BackgroundStyle.Class = ""; - this.ribbonBar3.BackgroundStyle.CornerType = DevComponents.DotNetBar.eCornerType.Square; - this.ribbonBar3.ContainerControlProcessDialogKey = true; - this.ribbonBar3.Dock = System.Windows.Forms.DockStyle.Left; - this.ribbonBar3.Items.AddRange(new DevComponents.DotNetBar.BaseItem[] { - this.btn_device, - this.btn_Person, - this.btn_constructMap, - this.buttonItem9}); - this.ribbonBar3.Location = new System.Drawing.Point(3, 0); - this.ribbonBar3.Name = "ribbonBar3"; - this.ribbonBar3.Size = new System.Drawing.Size(378, 59); - this.ribbonBar3.Style = DevComponents.DotNetBar.eDotNetBarStyle.StyleManagerControlled; - this.ribbonBar3.TabIndex = 0; - // - // - // - this.ribbonBar3.TitleStyle.Class = ""; - this.ribbonBar3.TitleStyle.CornerType = DevComponents.DotNetBar.eCornerType.Square; - // - // - // - this.ribbonBar3.TitleStyleMouseOver.Class = ""; - this.ribbonBar3.TitleStyleMouseOver.CornerType = DevComponents.DotNetBar.eCornerType.Square; - this.ribbonBar3.TitleVisible = false; - // - // btn_device - // - this.btn_device.ButtonStyle = DevComponents.DotNetBar.eButtonStyle.ImageAndText; - this.btn_device.Image = global::Cyberpipe.Properties.Resources._24X24__2__02; - this.btn_device.ImagePosition = DevComponents.DotNetBar.eImagePosition.Top; - this.btn_device.Name = "btn_device"; - this.btn_device.SubItemsExpandWidth = 14; - this.btn_device.Text = "探测仪管理"; - this.btn_device.Click += new System.EventHandler(this.btn_device_Click); - // - // btn_Person - // - this.btn_Person.ButtonStyle = DevComponents.DotNetBar.eButtonStyle.ImageAndText; - this.btn_Person.Image = global::Cyberpipe.Properties.Resources._24x24icon_05_hover1; - this.btn_Person.ImagePosition = DevComponents.DotNetBar.eImagePosition.Top; - this.btn_Person.Name = "btn_Person"; - this.btn_Person.SubItemsExpandWidth = 14; - this.btn_Person.Text = "定位人员维护"; - this.btn_Person.Click += new System.EventHandler(this.btn_Person_Click); - // - // btn_constructMap - // - this.btn_constructMap.Image = global::Cyberpipe.Properties.Resources._24x24icon_04_hover; - this.btn_constructMap.ImagePosition = DevComponents.DotNetBar.eImagePosition.Top; - this.btn_constructMap.Name = "btn_constructMap"; - this.btn_constructMap.SubItemsExpandWidth = 14; - this.btn_constructMap.Text = "导出施工图"; - this.btn_constructMap.Click += new System.EventHandler(this.btn_constructMap_Click); - // - // buttonItem9 - // - this.buttonItem9.Image = global::Cyberpipe.Properties.Resources._24x24icon__2__10; - this.buttonItem9.ImagePosition = DevComponents.DotNetBar.eImagePosition.Top; - this.buttonItem9.Name = "buttonItem9"; - this.buttonItem9.SubItemsExpandWidth = 14; - this.buttonItem9.Text = "文档管理"; - this.buttonItem9.Click += new System.EventHandler(this.buttonItem9_Click); - // // ribbonPanel8 // this.ribbonPanel8.ColorSchemeStyle = DevComponents.DotNetBar.eDotNetBarStyle.StyleManagerControlled; @@ -4696,6 +4625,86 @@ this.btn_reset_password.Text = "重置密码"; this.btn_reset_password.Click += new System.EventHandler(this.btn_reset_password_Click); // + // ribbonPanel7 + // + this.ribbonPanel7.ColorSchemeStyle = DevComponents.DotNetBar.eDotNetBarStyle.StyleManagerControlled; + this.ribbonPanel7.Controls.Add(this.ribbonBar5); + this.ribbonPanel7.Dock = System.Windows.Forms.DockStyle.Fill; + this.ribbonPanel7.Location = new System.Drawing.Point(0, 0); + this.ribbonPanel7.Name = "ribbonPanel7"; + this.ribbonPanel7.Padding = new System.Windows.Forms.Padding(3, 0, 3, 3); + this.ribbonPanel7.Size = new System.Drawing.Size(1328, 95); + // + // + // + this.ribbonPanel7.Style.Class = ""; + this.ribbonPanel7.Style.CornerType = DevComponents.DotNetBar.eCornerType.Square; + // + // + // + this.ribbonPanel7.StyleMouseDown.Class = ""; + this.ribbonPanel7.StyleMouseDown.CornerType = DevComponents.DotNetBar.eCornerType.Square; + // + // + // + this.ribbonPanel7.StyleMouseOver.Class = ""; + this.ribbonPanel7.StyleMouseOver.CornerType = DevComponents.DotNetBar.eCornerType.Square; + this.ribbonPanel7.TabIndex = 41; + this.ribbonPanel7.Visible = false; + // + // ribbonBar5 + // + this.ribbonBar5.AutoOverflowEnabled = true; + // + // + // + this.ribbonBar5.BackgroundMouseOverStyle.Class = ""; + this.ribbonBar5.BackgroundMouseOverStyle.CornerType = DevComponents.DotNetBar.eCornerType.Square; + // + // + // + this.ribbonBar5.BackgroundStyle.Class = ""; + this.ribbonBar5.BackgroundStyle.CornerType = DevComponents.DotNetBar.eCornerType.Square; + this.ribbonBar5.ContainerControlProcessDialogKey = true; + this.ribbonBar5.Dock = System.Windows.Forms.DockStyle.Left; + this.ribbonBar5.Items.AddRange(new DevComponents.DotNetBar.BaseItem[] { + this.btn_flag, + this.slider4ground}); + this.ribbonBar5.Location = new System.Drawing.Point(3, 0); + this.ribbonBar5.Name = "ribbonBar5"; + this.ribbonBar5.Size = new System.Drawing.Size(418, 92); + this.ribbonBar5.Style = DevComponents.DotNetBar.eDotNetBarStyle.StyleManagerControlled; + this.ribbonBar5.TabIndex = 0; + // + // + // + this.ribbonBar5.TitleStyle.Class = ""; + this.ribbonBar5.TitleStyle.CornerType = DevComponents.DotNetBar.eCornerType.Square; + // + // + // + this.ribbonBar5.TitleStyleMouseOver.Class = ""; + this.ribbonBar5.TitleStyleMouseOver.CornerType = DevComponents.DotNetBar.eCornerType.Square; + this.ribbonBar5.TitleVisible = false; + this.ribbonBar5.ItemClick += new System.EventHandler(this.ribbonBar5_ItemClick); + // + // btn_flag + // + this.btn_flag.Image = global::Cyberpipe.Properties.Resources._24x24icon_03_hover; + this.btn_flag.ImagePosition = DevComponents.DotNetBar.eImagePosition.Top; + this.btn_flag.Name = "btn_flag"; + this.btn_flag.SubItemsExpandWidth = 14; + this.btn_flag.Text = "标识器管理"; + this.btn_flag.Click += new System.EventHandler(this.btn_flag_Click); + // + // slider4ground + // + this.slider4ground.LabelPosition = DevComponents.DotNetBar.eSliderLabelPosition.Top; + this.slider4ground.Name = "slider4ground"; + this.slider4ground.Text = "地面透明度"; + this.slider4ground.Value = 0; + this.slider4ground.ValueChanged += new System.EventHandler(this.slider4ground_ValueChanged); + // // ribbonPanel15 // this.ribbonPanel15.ColorSchemeStyle = DevComponents.DotNetBar.eDotNetBarStyle.StyleManagerControlled; @@ -6393,16 +6402,6 @@ this.buttonItem76.SubItemsExpandWidth = 14; this.buttonItem76.Text = "坐标标注"; // - // layerTree - // - this.layerTree.CheckBoxes = true; - this.layerTree.ItemHeight = 18; - this.layerTree.Location = new System.Drawing.Point(30, 78); - this.layerTree.Name = "layerTree"; - this.layerTree.Size = new System.Drawing.Size(121, 97); - this.layerTree.TabIndex = 1; - this.layerTree.AfterCheck += new System.Windows.Forms.TreeViewEventHandler(this.layerTree_AfterCheck); - // // MainFrm // this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Inherit; @@ -6475,11 +6474,11 @@ this.contextMenuStripDeleteLayerNode.ResumeLayout(false); this.ribbonControl1.ResumeLayout(false); this.ribbonControl1.PerformLayout(); - this.ribbonPanel1.ResumeLayout(false); - this.ribbonPanel7.ResumeLayout(false); - this.ribbonPanel2.ResumeLayout(false); this.ribbonPanel3.ResumeLayout(false); + this.ribbonPanel2.ResumeLayout(false); + this.ribbonPanel1.ResumeLayout(false); this.ribbonPanel8.ResumeLayout(false); + this.ribbonPanel7.ResumeLayout(false); this.ribbonPanel15.ResumeLayout(false); ((System.ComponentModel.ISupportInitialize)(this.pictureBox1)).EndInit(); this.ResumeLayout(false); diff --git a/NewFunction/FrmCreateTunnel.cs b/NewFunction/FrmCreateTunnel.cs index 282767c..338edff 100644 --- a/NewFunction/FrmCreateTunnel.cs +++ b/NewFunction/FrmCreateTunnel.cs @@ -142,35 +142,6 @@ } } - private void txtMS_KeyPress(object sender, KeyPressEventArgs e) - { - TextBox text = sender as TextBox; - if ((e.KeyChar < 48 || e.KeyChar > 57) && (e.KeyChar != 8) && (int)e.KeyChar != 46) - { - e.Handled = true; - } - if ((int)e.KeyChar == 46) //小数点 - { - if (text.Text.Length <= 0) - e.Handled = true; //小数点不能在第一位 - else //处理不规则的小数点 - { - float f; - float oldf; - bool b1 = false, b2 = false; - b1 = float.TryParse(text.Text, out oldf); - b2 = float.TryParse(text.Text + e.KeyChar.ToString(), out f); - if (b2 == false) - { - if (b1 == true) - e.Handled = true; - else - e.Handled = false; - } - } - } - } - private void FrmCreateTunnel_Load(object sender, EventArgs e) { if (comboBoxTunnelType.Items.Count > 0) diff --git a/OracleHelper.cs b/OracleHelper.cs index 11eebe6..79cdf48 100644 --- a/OracleHelper.cs +++ b/OracleHelper.cs @@ -49,7 +49,7 @@ { conn.Close(); } - MessageBox.Show(ex.Message, "提示"); + LogHelper.WriteLog(typeof(OledbHelper), ex.Message); return null; } } @@ -67,7 +67,7 @@ } catch(Exception ex) { - // LogError.PublishError(ex); + LogHelper.WriteLog(typeof(OledbHelper), ex.Message); } finally { @@ -111,6 +111,7 @@ } catch (Exception ex) { + LogHelper.WriteLog(typeof(OledbHelper), ex.Message); return null; } } @@ -131,6 +132,7 @@ } catch(Exception ex) { + LogHelper.WriteLog(typeof(OledbHelper), ex.Message); rowCount = -1; } finally @@ -159,6 +161,7 @@ } catch(Exception ex) { + LogHelper.WriteLog(typeof(OledbHelper), ex.Message); num = -1; } finally @@ -190,6 +193,7 @@ } catch (Exception ex) { + LogHelper.WriteLog(typeof(OledbHelper), ex.Message); return null; } } @@ -210,7 +214,7 @@ oracleCmd.Dispose(); conn.Close(); //调用con_close()方法,关闭与数据库的连接 }catch(Exception ex){ - + LogHelper.WriteLog(typeof(OledbHelper), ex.Message); } finally { @@ -237,6 +241,7 @@ } catch (Exception ex) { + LogHelper.WriteLog(typeof(OledbHelper), ex.Message); rowCount = -1; } finally diff --git a/OracleUtils.cs b/OracleUtils.cs index 29b5374..c1aadda 100644 --- a/OracleUtils.cs +++ b/OracleUtils.cs @@ -741,7 +741,6 @@ } catch { - //if we fail to return the SqlDatReader, we need to close the connection ourselves cn.Close(); throw; } diff --git a/PAS.cs b/PAS.cs index 972de2d..fcda1dd 100644 --- a/PAS.cs +++ b/PAS.cs @@ -93,15 +93,7 @@ } - private void TSM_Pderive_Click(object sender, EventArgs e) - { - PASAClass.Table_name(operation); - if (TV_Files.SelectedNode != null) - { - PASAClass.GuideEdit_form("G", TV_Files, int.Parse(((ToolStripMenuItem)sender).Tag.ToString())); - } - } - + private void TSM_Fenter_Click(object sender, EventArgs e) { if (TV_Files.SelectedNode != null) @@ -110,16 +102,6 @@ } } - private void TSM_Frename_Click(object sender, EventArgs e) - { - TSM_Fenter_Click(sender, e); - } - - private void TSM_Fdelete_Click(object sender, EventArgs e) - { - TSM_Fenter_Click(sender, e); - } - private void TSM_Fderive_Click(object sender, EventArgs e) { if (TV_Files.SelectedNode != null) @@ -128,25 +110,6 @@ } } - private void TSM_Fprint_Click(object sender, EventArgs e) - { - if (TV_Files.SelectedNode != null) - { - PASAClass.Print(int.Parse(TV_Files.SelectedNode.Tag.ToString()), TV_Files.SelectedNode.Text, PD_PASPrtFile, PD_PASPrtDoc); - - } - } - - private void TSM_PASPgSt_Click(object sender, EventArgs e) - { - PSD_PASSetPage.ShowDialog(); - } - - private void TSM_PASPreV_Click(object sender, EventArgs e) - { - PPD_PASPreV.ShowDialog(); - } - private void TV_Files_AfterCollapse(object sender, TreeViewEventArgs e) { e.Node.ImageIndex = 0; @@ -250,14 +213,6 @@ } } - private void 导出ToolStripMenuItem_Click(object sender, EventArgs e) - { - PASAClass.Table_name(operation); - if (TV_Files.SelectedNode != null) - { - PASAClass.GuideEdit_form("G", TV_Files, int.Parse(((ToolStripMenuItem)sender).Tag.ToString())); - } - } private void 导入ToolStripMenuItem_Click(object sender, EventArgs e) { diff --git a/PAS_Forms/F_PASInout.cs b/PAS_Forms/F_PASInout.cs index 373a4e6..974f987 100644 --- a/PAS_Forms/F_PASInout.cs +++ b/PAS_Forms/F_PASInout.cs @@ -71,11 +71,6 @@ } - private void Cancel_Click(object sender, EventArgs e) - { - this.Close(); - } - private void OK_Click(object sender, EventArgs e) { if (textBox1.Text == "") diff --git a/PATM.cs b/PATM.cs index edecd1e..9b6c51d 100644 --- a/PATM.cs +++ b/PATM.cs @@ -26,12 +26,6 @@ public string operation = ""; #endregion - - - - - - private void TSM_Pnew_Click(object sender, EventArgs e) { if (LV_proj.Visible) @@ -94,15 +88,6 @@ } - private void TSM_Pderive_Click(object sender, EventArgs e) - { - PATMAClass.Table_name(operation); - if (TV_files.SelectedNode != null) - { - PATMAClass.GuideEdit_form("G", TV_files, int.Parse(((ToolStripMenuItem)sender).Tag.ToString())); - } - } - private void TSM_Fenter_Click(object sender, EventArgs e) { if (TV_files.SelectedNode != null) @@ -163,35 +148,6 @@ //PATMAClass.Show_AllFile(int.Parse(e.Node.Tag.ToString()), e.Node.Text, LV_PATMallfiles, PB_Display, 2);//此处为显示图片操作 } - private void TSM_Frename_Click(object sender, EventArgs e) - { - TSM_Fenter_Click(sender, e); - } - - private void TSM_Fdelete_Click(object sender, EventArgs e) - { - TSM_Fenter_Click(sender, e); - } - - private void TSM_Fderive_Click(object sender, EventArgs e) - { - if (TV_files.SelectedNode != null) - { - PATMAClass.GuideEdit_form("G", TV_files, int.Parse(((ToolStripMenuItem)sender).Tag.ToString())); - } - } - - private void TSM_Fprint_Click(object sender, EventArgs e) - { - if (TV_files.SelectedNode != null) - { - PATMAClass.Print(int.Parse(TV_files.SelectedNode.Tag.ToString()), TV_files.SelectedNode.Text, PD_PATMPrtFile, PD_PATMPrtDoc); - - } - } - - - private void BT_PATMSch_Click(object sender, EventArgs e) { //LV_PATMallfiles.Dock = DockStyle.Fill;//使ListView控件最大化 @@ -210,32 +166,6 @@ } - private void TSM_PATMPreV_Click(object sender, EventArgs e) - { - PPD_PATMPreV.ShowDialog(); - } - - private void TSM_PATMPgSt_Click(object sender, EventArgs e) - { - PSD_PATMSetPage.ShowDialog(); - } - - private void LV_PATMSrchRslt_MouseClick(object sender, MouseEventArgs e) - { - - if (LV_proj.SelectedItems != null) - { - //int i = 1; - // PATMAClass.Show_AllFile(int.Parse(LV_PATMSrchRslt.FocusedItem.Tag.ToString()), LV_PATMSrchRslt.FocusedItem.Text, LV_PATMallfiles,PB_Display, 0); - - } - } - - private void LV_PATMSrchRslt_MouseDoubleClick(object sender, MouseEventArgs e) - { - //PATMAClass.Show_AllFile(int.Parse(LV_PATMSrchRslt.FocusedItem.Tag.ToString()), LV_PATMSrchRslt.FocusedItem.Text, LV_PATMallfiles, PB_Display, 2); - } - private void 新建ToolStripMenuItem_Click(object sender, EventArgs e) { if ((TV_files.SelectedNode != null)&&(TV_files.SelectedNode.Parent==null)) @@ -288,17 +218,6 @@ } } - private void 打印预览toolStripMenuItem_Click(object sender, EventArgs e) - { - - PPD_PATMPreV.ShowDialog(); - } - - private void 打印设置toolStripMenuItem_Click(object sender, EventArgs e) - { - PSD_PATMSetPage.ShowDialog(); - } - private void TV_PATMSrchRslt_NodeMouseClick(object sender, TreeNodeMouseClickEventArgs e) { if (e.Button == MouseButtons.Right) diff --git a/PATM_Forms/F_PATMTitle.cs b/PATM_Forms/F_PATMTitle.cs index 7380dd8..5d1fe8c 100644 --- a/PATM_Forms/F_PATMTitle.cs +++ b/PATM_Forms/F_PATMTitle.cs @@ -148,19 +148,6 @@ return 0; } - //判断是否为已有工程 - private bool checkProject(string projectname) { - string sql = "select * from "+this.tablename+" where "+tablename+".NODENAME = '"+projectname - +"'"; - DataTable table = OledbHelper.QueryTable(sql); - if (table.Rows.Count > 0) - { - return true; - } - else { - return false; - } - } private void buttonX2_Click(object sender, EventArgs e) { diff --git a/PATM_Forms/F_PATMinout.cs b/PATM_Forms/F_PATMinout.cs index e404e7b..16b51de 100644 --- a/PATM_Forms/F_PATMinout.cs +++ b/PATM_Forms/F_PATMinout.cs @@ -174,12 +174,6 @@ { this.Close(); } - - private void TV_PATMinout_AfterCollapse(object sender, TreeViewEventArgs e) - { - e.Node.ImageIndex = 0; - } - //private void TV_PATMinout_NodeMouseDoubleClick(object sender, TreeNodeMouseClickEventArgs e) diff --git "a/PED_Forms/F_\346\225\260\346\215\256\350\276\223\345\205\245\350\276\223\345\207\272.cs" "b/PED_Forms/F_\346\225\260\346\215\256\350\276\223\345\205\245\350\276\223\345\207\272.cs" index 0f76b8c..4de8b4d 100644 --- "a/PED_Forms/F_\346\225\260\346\215\256\350\276\223\345\205\245\350\276\223\345\207\272.cs" +++ "b/PED_Forms/F_\346\225\260\346\215\256\350\276\223\345\205\245\350\276\223\345\207\272.cs" @@ -188,12 +188,7 @@ } DialogResult = DialogResult.OK;//将当前窗体的对话框返回值设为OK } - private void treeView1_NodeMouseClick(object sender, TreeNodeMouseClickEventArgs e) - { - - //dir = comboBox_Disk.Text + e.Node.FullPath; - e.Node.SelectedImageIndex = e.Node.ImageIndex; - } + private void button1_Click(object sender, EventArgs e) { diff --git a/Cyberpipe.csproj b/Cyberpipe.csproj index 07a8c1a..e3cd12c 100644 --- a/Cyberpipe.csproj +++ b/Cyberpipe.csproj @@ -204,25 +204,6 @@ - - Form - - - F_GKT1数据输入输出.cs - - - Form - - - F_GKT1添加文件.cs - - - Form - - - F_GKT1添加项目.cs - - Form @@ -1068,18 +1049,6 @@ Frm_password_reset.cs - - Form - - - GKT.cs - - - Form - - - GKT1.cs - Form @@ -1258,12 +1227,6 @@ F_Projedit.cs - - Form - - - PED.cs - Form @@ -1331,16 +1294,6 @@ True Reference.map - - F_GKT1数据输入输出.cs - Designer - - - F_GKT1添加文件.cs - - - F_GKT1添加项目.cs - Form_EditTask.cs @@ -1836,12 +1789,6 @@ Frm_password_reset.cs - - GKT.cs - - - GKT1.cs - F_GKT数据输入输出.cs @@ -1934,9 +1881,6 @@ F_Projedit.cs - - PED.cs - F_数据输入输出.cs diff --git a/Cyberpipe.suo b/Cyberpipe.suo index 68ced4f..a1aecf8 100644 --- a/Cyberpipe.suo +++ b/Cyberpipe.suo Binary files differ diff --git a/EMS_Forms/Form_EditTask.cs b/EMS_Forms/Form_EditTask.cs index 718992f..f1d791f 100644 --- a/EMS_Forms/Form_EditTask.cs +++ b/EMS_Forms/Form_EditTask.cs @@ -119,7 +119,8 @@ String name = Convert.ToString(dr["USERNAME"]); comboBox_userName.Items.Add(name); - } + } + dr.Close(); comboBox_road.Items.Clear(); roadList = new List(); @@ -135,7 +136,7 @@ comboBox_road.Items.Add(name); } } - + dr1.Close(); conn.Close(); bool flag2 = false; @@ -185,7 +186,7 @@ catch (Exception ex) { - MessageBox.Show(ex.ToString()); + LogHelper.WriteLog(typeof(Form_EditTask), ex.Message); } } @@ -288,7 +289,7 @@ } catch (Exception ex) { - MessageBox.Show(ex.ToString()); + LogHelper.WriteLog(typeof(Form_EditTask), ex.Message); } } @@ -474,7 +475,7 @@ } catch (Exception ex) { - MessageBox.Show(ex.ToString()); + LogHelper.WriteLog(typeof(Form_EditTask), ex.Message); } this.Close(); @@ -495,6 +496,7 @@ { numList.Add(Convert.ToInt32(dr["DBID"])); } + dr.Close(); if (numList.Count == 0) { taskNumber = Convert.ToInt32(number) * 100; @@ -674,6 +676,7 @@ } } } + dr.Close(); conn.Close(); } diff --git a/EMS_Forms/Form_EventManager.cs b/EMS_Forms/Form_EventManager.cs index b18c45b..84807b2 100644 --- a/EMS_Forms/Form_EventManager.cs +++ b/EMS_Forms/Form_EventManager.cs @@ -64,6 +64,7 @@ comboBox_name.Items.Add(name); } + dr.Close(); conn.Close(); diff --git a/Forms/FrmMnModify.cs b/Forms/FrmMnModify.cs index 31cfc5f..d036360 100644 --- a/Forms/FrmMnModify.cs +++ b/Forms/FrmMnModify.cs @@ -68,15 +68,7 @@ questionGrid.Rows[idx].Cells[1].Value = sr.question; } } - /// 选中对象 - /// - /// - /// - /// - private void buttonX1_Click(object sender, EventArgs e) - { - globecontrol.Globe.Action = EnumAction3D.SelectObject; - } + /// /// 选中某一行 /// diff --git a/Forms/FrmPipelineModelDataBase.cs b/Forms/FrmPipelineModelDataBase.cs index 2acf0ca..7ce573f 100644 --- a/Forms/FrmPipelineModelDataBase.cs +++ b/Forms/FrmPipelineModelDataBase.cs @@ -35,19 +35,7 @@ ds = _ds; InitializeComponent(); } - /// - /// 单击选择shp格式文件 - /// - /// - /// - private void btnBrowseModel_Click(object sender, EventArgs e) - { - saveFileDialog1.Filter = "*.lgd|*.lgd"; - if (saveFileDialog1.ShowDialog() == DialogResult.OK) - { - txtModelLayer.Text = saveFileDialog1.FileName; - } - } + /// /// 窗体初始化事件处理 /// @@ -100,49 +88,6 @@ } } } - - private object convertFieldValue(string fieldname, object obj) - { - if (obj == null) - return null; - - try - { - string type = fields_types[fieldname].ToString(); - switch (type) - { - case "string": - return obj.ToString(); - case "int": - //return 101; - int intResult; - if (int.TryParse(obj.ToString(), out intResult)) - return intResult; - else - return null; - case "double": - //return 202.5; - double doubleResult; - if (double.TryParse(obj.ToString(), out doubleResult)) - return doubleResult; - else - return null; - case "date": - DateTime dtResult; - if (DateTime.TryParse(obj.ToString(), out dtResult)) - return dtResult; - else - return null; - } - return null; - } - catch (Exception ex) - { - MessageBox.Show(ex.ToString()); - return null; - } - } - public string lgdFilePath = ""; /// /// 选择管线颜色 @@ -610,33 +555,6 @@ { this.Close(); } - - private void cmbLayer_SelectedIndexChanged(object sender, EventArgs e) //选择图层 - { - GSOLayer layer = ctl.Globe.Layers.GetLayerByCaption(selectLayerName); - GSOFeatures features = layer.GetAllFeatures(); - if (features.Length == 0) - return; - - cmbFrom.Items.Clear(); - cmbTo.Items.Clear(); - cmbRadius.Items.Clear(); - cmbID.Items.Clear(); - for (int i = 0; i < features[0].GetFieldCount(); i++) - { - GeoScene.Data.GSOFieldDefn fielddef = (GeoScene.Data.GSOFieldDefn)(features[0].GetFieldDefn(i)); - - cmbFrom.Items.Add(fielddef.Name); - cmbTo.Items.Add(fielddef.Name); - cmbRadius.Items.Add(fielddef.Name); - cmbID.Items.Add(fielddef.Name); - } - cmbFrom.SelectedItem = "Deep1"; - cmbTo.SelectedItem = "Deep2"; - cmbRadius.SelectedItem = "Diameter"; - cmbID.SelectedItem = "Handle"; - } - private void buttonXLayerPath_Click(object sender, EventArgs e)//单击 选择shp格式的文件 { OpenFileDialog dlg = new OpenFileDialog(); diff --git a/Forms/FrmPipelineModelDataOneStep.cs b/Forms/FrmPipelineModelDataOneStep.cs index 18afda7..ec93b8a 100644 --- a/Forms/FrmPipelineModelDataOneStep.cs +++ b/Forms/FrmPipelineModelDataOneStep.cs @@ -38,19 +38,7 @@ layerTree = _layerTree; InitializeComponent(); } - /// - /// 单击选择shp格式文件 - /// - /// - /// - private void btnBrowseModel_Click(object sender, EventArgs e) - { - saveFileDialog1.Filter = "*.lgd|*.lgd"; - if (saveFileDialog1.ShowDialog() == DialogResult.OK) - { - txtModelLayer.Text = saveFileDialog1.FileName; - } - } + /// /// 窗体初始化事件处理 /// @@ -107,48 +95,7 @@ } } - private object convertFieldValue(string fieldname, object obj) - { - if (obj == null) - return null; - - try - { - string type = fields_types[fieldname].ToString(); - switch (type) - { - case "string": - return obj.ToString(); - case "int": - //return 101; - int intResult; - if (int.TryParse(obj.ToString(), out intResult)) - return intResult; - else - return null; - case "double": - //return 202.5; - double doubleResult; - if (double.TryParse(obj.ToString(), out doubleResult)) - return doubleResult; - else - return null; - case "date": - DateTime dtResult; - if (DateTime.TryParse(obj.ToString(), out dtResult)) - return dtResult; - else - return null; - } - return null; - } - catch (Exception ex) - { - MessageBox.Show(ex.ToString()); - return null; - } - } - + public string lgdFilePath = ""; /// /// 选择管线颜色 @@ -673,32 +620,6 @@ return featDs; } - private void cmbLayer_SelectedIndexChanged(object sender, EventArgs e) //选择图层 - { - GSOLayer layer = ctl.Globe.Layers.GetLayerByCaption(selectLayerName); - GSOFeatures features = layer.GetAllFeatures(); - if (features.Length == 0) - return; - - cmbFrom.Items.Clear(); - cmbTo.Items.Clear(); - cmbRadius.Items.Clear(); - cmbID.Items.Clear(); - for (int i = 0; i < features[0].GetFieldCount(); i++) - { - GeoScene.Data.GSOFieldDefn fielddef = (GeoScene.Data.GSOFieldDefn)(features[0].GetFieldDefn(i)); - - cmbFrom.Items.Add(fielddef.Name); - cmbTo.Items.Add(fielddef.Name); - cmbRadius.Items.Add(fielddef.Name); - cmbID.Items.Add(fielddef.Name); - } - cmbFrom.SelectedItem = "Deep1"; - cmbTo.SelectedItem = "Deep2"; - cmbRadius.SelectedItem = "Diameter"; - cmbID.SelectedItem = "Handle"; - } - private void buttonXLayerPath_Click(object sender, EventArgs e)//单击 选择shp格式的文件 { OpenFileDialog dlg = new OpenFileDialog(); @@ -949,38 +870,6 @@ } //txtLayername.Text = type + layername; } - /// - /// 连接数据库 - /// - /// - /// - private void buttonX1_Click(object sender, EventArgs e) - { - if (ds == null) - { - //没连的话,直接连接审核库; //审核库配置读配置文件 - string dbIp = Utility.sgdbip; - string database = Utility.sgdbname; - string user = Utility.sgdbuser; - string pass = Utility.sgdbpwd; - - if (!Utility.isNetworkConnectionSuccess(dbIp.Trim())) - { - MessageBox.Show("网络连接失败!", "提示"); - return; - } - - ds = ctl.Globe.DataManager.OpenOracleDataSource(dbIp + "/" + database, "", "", user, pass); - if (ds == null) - { - MessageBox.Show("数据库连接失败!", "提示", MessageBoxButtons.OK, MessageBoxIcon.Warning); - } - else - { - btnCreateModel.Enabled = true; - } - } - } private void btnClose_Click(object sender, EventArgs e) { diff --git a/Forms/FrmShRK.cs b/Forms/FrmShRK.cs index 0e2e722..f1d83cb 100644 --- a/Forms/FrmShRK.cs +++ b/Forms/FrmShRK.cs @@ -215,6 +215,7 @@ { sourcefeatds = sourcefeat as GSOFeatureDataset; } + if (sourcefeatds == null) return; sourcefeatds.Open(); GSOFeatures sourcefeatures = sourcefeatds.GetAllFeatures(); @@ -251,6 +252,7 @@ { desfeatds = desfeat as GSOFeatureDataset; } + if (desfeatds == null) return; desfeatds.Open(); //向新数据集写入字段 diff --git a/FrmAccessoriesSensor.cs b/FrmAccessoriesSensor.cs index 09fcdf1..2a7a80e 100644 --- a/FrmAccessoriesSensor.cs +++ b/FrmAccessoriesSensor.cs @@ -209,7 +209,7 @@ chart1.Series[0].Points.DataBindXY(dic.Keys, dic.Values); for (int m = 0; m < dic.Values.Count; m++) { - if (chart1.Series[0].Points[m].YValues[0].ToString() != "0") + if (chart1.Series[0].Points[m]!=null&&chart1.Series[0].Points[m].YValues[0].ToString() != "0") { chart1.Series[0].Points[m].Label = chart1.Series[0].Points[m].YValues[0].ToString(); } diff --git a/FrmAccessoriesgather.cs b/FrmAccessoriesgather.cs index 9e331e1..a475d9e 100644 --- a/FrmAccessoriesgather.cs +++ b/FrmAccessoriesgather.cs @@ -338,7 +338,7 @@ chart1.Series[0].Points.DataBindXY(dic.Keys, dic.Values); for (int m = 0; m < dic.Values.Count; m++) { - if (chart1.Series[0].Points[m].YValues[0].ToString() != "0") + if (chart1.Series[0].Points[m]!=null&&chart1.Series[0].Points[m].YValues[0].ToString() != "0") { chart1.Series[0].Points[m].Label = chart1.Series[0].Points[m].YValues[0].ToString(); } diff --git a/FrmAccessoryAnalysis.cs b/FrmAccessoryAnalysis.cs index 71d4579..44d4065 100644 --- a/FrmAccessoryAnalysis.cs +++ b/FrmAccessoryAnalysis.cs @@ -66,39 +66,6 @@ globeControl1.Refresh(); } /// - /// 键盘按键按下事件处理 - /// - /// - /// - private void txtRadius_KeyPress(object sender, KeyPressEventArgs e) - { - TextBox text = sender as TextBox; - if ((e.KeyChar < 48 || e.KeyChar > 57) && (e.KeyChar != 8) && (int)e.KeyChar != 46) - { - e.Handled = true; - } - if ((int)e.KeyChar == 46) //小数点 - { - if (text.Text.Length <= 0) - e.Handled = true; //小数点不能在第一位 - else //处理不规则的小数点 - { - float f; - float oldf; - bool b1 = false, b2 = false; - b1 = float.TryParse(text.Text, out oldf); - b2 = float.TryParse(text.Text + e.KeyChar.ToString(), out f); - if (b2 == false) - { - if (b1 == true) - e.Handled = true; - else - e.Handled = false; - } - } - } - } - /// /// 确定按钮事件处理 /// /// diff --git a/FrmAddValve.cs b/FrmAddValve.cs index 34d2fec..5f405b9 100644 --- a/FrmAddValve.cs +++ b/FrmAddValve.cs @@ -486,56 +486,6 @@ } } - - - - - - - - private void cmbLayer_SelectedIndexChanged(object sender, EventArgs e) - { - GSOLayer layer = globeControl1.Globe.Layers.GetLayerByCaption(selectLayerName); - GSOFeatures features = layer.GetAllFeatures(); - if (features.Length == 0) - return; - - combPath.Items.Clear(); - combZ.Items.Clear(); - combModelName.Items.Clear(); - - for (int i = 0; i < features[0].GetFieldCount(); i++) - { - GeoScene.Data.GSOFieldDefn fielddef = (GeoScene.Data.GSOFieldDefn)(features[0].GetFieldDefn(i)); - combPath.Items.Add(fielddef.Name); - combZ.Items.Add(fielddef.Name); - combModelName.Items.Add(fielddef.Name); - } - combModelName.SelectedItem = "编号"; - combPath.SelectedItem = "模型路径"; - if (combfile.SelectedIndex != -1) - { - - string layerCaption = combfile.SelectedItem.ToString().Trim(); - rukuLayer = globeControl1.Globe.Layers.GetLayerByCaption(layerCaption); - if (rukuLayer != null) - { - combPath.Items.Clear(); - combZ.Items.Clear(); - combModelName.Items.Clear(); - - } - for (int i = 0; i < features[0].GetFieldCount(); i++) - { - GeoScene.Data.GSOFieldDefn fielddef = (GeoScene.Data.GSOFieldDefn)(features[0].GetFieldDefn(i)); - combPath.Items.Add(fielddef.Name); - combZ.Items.Add(fielddef.Name); - combModelName.Items.Add(fielddef.Name); - } - combModelName.SelectedItem = "编号"; - combPath.SelectedItem = "模型路径"; - } - } /// /// 单击选择shp格式文件 /// diff --git a/FrmAddWellShp.cs b/FrmAddWellShp.cs index bb79ec0..a249725 100644 --- a/FrmAddWellShp.cs +++ b/FrmAddWellShp.cs @@ -478,32 +478,6 @@ } } } - - private void cmbLayer_SelectedIndexChanged(object sender, EventArgs e) - { - GSOLayer layer = globeControl1.Globe.Layers.GetLayerByCaption(selectLayerName); - GSOFeatures features = layer.GetAllFeatures(); - if (features.Length == 0) - return; - - combCode.Items.Clear(); - combDeep.Items.Clear(); - combModelName.Items.Clear(); - combAngle.Items.Clear(); - - for (int i = 0; i < features[0].GetFieldCount(); i++) - { - GeoScene.Data.GSOFieldDefn fielddef = (GeoScene.Data.GSOFieldDefn)(features[0].GetFieldDefn(i)); - combCode.Items.Add(fielddef.Name); - combDeep.Items.Add(fielddef.Name); - combModelName.Items.Add(fielddef.Name); - combAngle.Items.Add(fielddef.Name); - } - combCode.SelectedItem = "附属物编码"; - combDeep.SelectedItem = "井深"; - combModelName.SelectedItem = "编号"; - combAngle.SelectedItem = "符号角度"; - } /// /// 单击选择shp格式文件 /// diff --git a/FrmAddYuBiZiShp.cs b/FrmAddYuBiZiShp.cs index b312d51..332f037 100644 --- a/FrmAddYuBiZiShp.cs +++ b/FrmAddYuBiZiShp.cs @@ -383,80 +383,7 @@ } } - private void cmbLayer_SelectedIndexChanged(object sender, EventArgs e) - { - GSOLayer layer = globeControl1.Globe.Layers.GetLayerByCaption(selectLayerName); - GSOFeatures features = layer.GetAllFeatures(); - if (features.Length == 0) - return; - - combCode.Items.Clear(); - combDeep.Items.Clear(); - combModelName.Items.Clear(); - //comboLoad.Items.Clear(); - for (int i = 0; i < features[0].GetFieldCount(); i++) - { - GeoScene.Data.GSOFieldDefn fielddef = (GeoScene.Data.GSOFieldDefn)(features[0].GetFieldDefn(i)); - combCode.Items.Add(fielddef.Name); - combDeep.Items.Add(fielddef.Name); - combModelName.Items.Add(fielddef.Name); - //comboLoad.Items.Add(fielddef.Name); - } - combCode.SelectedItem = "附属物编码"; - combDeep.SelectedItem = "Z坐标"; - combModelName.SelectedItem = "编号"; - //comboLoad.SelectedItem = "模型路径"; - } - - private void buttonXLayerPath_Click(object sender, EventArgs e) - { - OpenFileDialog dlg = new OpenFileDialog(); - dlg.Filter = "*.shp|*.shp"; - dlg.Multiselect = false; - if (dlg.ShowDialog() == DialogResult.OK) - { - GSOLayer layer = globeControl1.Globe.Layers.Add(dlg.FileName); - string txtMessage = valiYBdata(layer); - if (txtMessage != "") - { - button3.Enabled = false; - //textBoxLayer.Text = ""; - combCode.Items.Clear(); - combDeep.Items.Clear(); - combModelName.Items.Clear(); - globeControl1.Globe.Layers.Remove(layer); - FrmValiDataShowErrorMessage showErrorMessage = new FrmValiDataShowErrorMessage(dlg.FileName, txtMessage); - showErrorMessage.ShowDialog(); - return; - } - else - { - button3.Enabled = true; - //textBoxLayer.Text = dlg.FileName; - selectLayerName = layer.Caption; - txtLayerName.Text = layer.Caption; - GSOFeatures features = layer.GetAllFeatures(); - if (features.Length == 0) - return; - - combCode.Items.Clear(); - combDeep.Items.Clear(); - combModelName.Items.Clear(); - for (int i = 0; i < features[0].GetFieldCount(); i++) - { - GeoScene.Data.GSOFieldDefn fielddef = (GeoScene.Data.GSOFieldDefn)(features[0].GetFieldDefn(i)); - combCode.Items.Add(fielddef.Name); - combDeep.Items.Add(fielddef.Name); - combModelName.Items.Add(fielddef.Name); - //comboLoad.Items.Add(fielddef.Name); - } - combCode.SelectedItem = "管点编码"; - combDeep.SelectedItem = "Z坐标"; - combModelName.SelectedItem = "编号"; - } - } - } - + private void FrmAddYuBiZiShp_FormClosing(object sender, FormClosingEventArgs e) { globeControl1.Globe.Refresh(); diff --git a/FrmAllPipelineStatis.cs b/FrmAllPipelineStatis.cs index 6421a26..a6eea29 100644 --- a/FrmAllPipelineStatis.cs +++ b/FrmAllPipelineStatis.cs @@ -84,7 +84,7 @@ chartAllAreaPipeline.Series["管线"].Points.DataBindXY(pipelineLengthAndType.Keys, pipelineLengthAndType.Values); for (int m = 0; m < pipelineLengthAndType.Values.Count; m++) { - if (chartAllAreaPipeline.Series["管线"].Points[m].YValues[0].ToString() != "0") + if (chartAllAreaPipeline.Series["管线"].Points[m]!=null&&chartAllAreaPipeline.Series["管线"].Points[m].YValues[0].ToString() != "0") { chartAllAreaPipeline.Series["管线"].Points[m].Label = chartAllAreaPipeline.Series[0].Points[m].YValues[0].ToString(); } @@ -94,7 +94,7 @@ } catch (Exception ex) { - //LogError.PublishError(ex); + LogHelper.WriteLog(typeof(FrmAllPipelineStatis), ex.Message); } } @@ -147,7 +147,7 @@ } DataTable dt = OledbHelper.QueryTable(sql); - if (dt != null && dt.Rows.Count > 0) + if (dt != null && dt.Rows.Count > 0 && chartAllAreaPipeline.Series["管线"].Points[indexHit]!=null) { dataGridViewX1.DataSource = dt; panel.Visible = true; diff --git a/FrmAllWorkWellStatis.cs b/FrmAllWorkWellStatis.cs index 6fec7af..6af8e4c 100644 --- a/FrmAllWorkWellStatis.cs +++ b/FrmAllWorkWellStatis.cs @@ -52,7 +52,7 @@ chartAllAreaPipeline.Series["井盖"].Points.DataBindXY(workWellLengthAndType.Keys, workWellLengthAndType.Values); for (int m = 0; m < workWellLengthAndType.Values.Count; m++) { - if (chartAllAreaPipeline.Series["井盖"].Points[m].YValues[0].ToString().Trim() != "0") + if (chartAllAreaPipeline.Series["井盖"].Points[m]!=null&&chartAllAreaPipeline.Series["井盖"].Points[m].YValues[0].ToString().Trim() != "0") { chartAllAreaPipeline.Series["井盖"].Points[m].Label = chartAllAreaPipeline.Series[0].Points[m].YValues[0].ToString(); } @@ -60,7 +60,7 @@ } catch (Exception ex) { - //LogError.PublishError(ex); + LogHelper.WriteLog(typeof(FrmAllWorkWellStatis), ex.Message); } } diff --git a/FrmBSQDuoBianXingStatis.cs b/FrmBSQDuoBianXingStatis.cs index e8b7d52..3e889b6 100644 --- a/FrmBSQDuoBianXingStatis.cs +++ b/FrmBSQDuoBianXingStatis.cs @@ -60,7 +60,7 @@ { for (int m = 0; m < bsq1.Values.Count; m++) { - if (chart1.Series["标识器"].Points[m].YValues[0].ToString() != "0") + if (chart1.Series["标识器"].Points[m]!=null&&chart1.Series["标识器"].Points[m].YValues[0].ToString() != "0") { count += Convert.ToInt16(chart1.Series[0].Points[m].YValues[0].ToString()); chart1.Series["标识器"].Points[m].Label = chart1.Series[0].Points[m].YValues[0].ToString(); diff --git a/FrmBSQDuoBianXingStreet.cs b/FrmBSQDuoBianXingStreet.cs index 2005ebb..1db5777 100644 --- a/FrmBSQDuoBianXingStreet.cs +++ b/FrmBSQDuoBianXingStreet.cs @@ -63,7 +63,7 @@ chartStatis.Series[0].Points.DataBindXY(bsq.Keys, bsq.Values); for (int m = 0; m < bsq.Values.Count; m++) { - if (chartStatis.Series[0].Points[m].YValues[0].ToString().Trim() != "0") + if (chartStatis.Series[0].Points[m]!=null&&chartStatis.Series[0].Points[m].YValues[0].ToString().Trim() != "0") { count += Convert.ToInt16(chartStatis.Series[0].Points[m].YValues[0].ToString()); chartStatis.Series[0].Points[m].Label = chartStatis.Series[0].Points[m].YValues[0].ToString(); diff --git a/FrmBSQStatis.cs b/FrmBSQStatis.cs index 390a55c..4aa0ee6 100644 --- a/FrmBSQStatis.cs +++ b/FrmBSQStatis.cs @@ -95,6 +95,8 @@ } } } + + dr.Close(); conn.Close(); for (int i = 0; i < typeLists.Count; i++) { @@ -123,7 +125,7 @@ chartStatis.Series[0].Points.DataBindXY(bsq.Keys, bsq.Values); for (int m = 0; m < bsq.Values.Count; m++) { - if (chartStatis.Series[0].Points[m].YValues[0].ToString().Trim() != "0") + if (chartStatis.Series[0].Points[m]!=null&&chartStatis.Series[0].Points[m].YValues[0].ToString().Trim() != "0") { //count += Convert.ToInt16(chartStatis.Series[0].Points[m].YValues[0].ToString()); chartStatis.Series[0].Points[m].Label = chartStatis.Series[0].Points[m].YValues[0].ToString(); diff --git a/FrmBSQStreet.cs b/FrmBSQStreet.cs index 9d88adb..7fbacad 100644 --- a/FrmBSQStreet.cs +++ b/FrmBSQStreet.cs @@ -44,7 +44,7 @@ chartStatis.Series[0].Points.DataBindXY(bsq.Keys, bsq.Values); for (int m = 0; m < bsq.Values.Count; m++) { - if (chartStatis.Series[0].Points[m].YValues[0].ToString().Trim() != "0") + if (chartStatis.Series[0].Points[m]!=null&&chartStatis.Series[0].Points[m].YValues[0].ToString().Trim() != "0") { count += Convert.ToInt16(chartStatis.Series[0].Points[m].YValues[0].ToString()); chartStatis.Series[0].Points[m].Label = chartStatis.Series[0].Points[m].YValues[0].ToString(); diff --git a/FrmBoosterValvers.cs b/FrmBoosterValvers.cs index 5061efc..df9b62b 100644 --- a/FrmBoosterValvers.cs +++ b/FrmBoosterValvers.cs @@ -236,199 +236,6 @@ count = 0; } } - /// - /// 添加火苗 - /// - /// - /// - /// - /// - private GSOFeature AddFire(double x,double y,double z) - { - // 烟火示例 - - string strResPath = Application.StartupPath + "/Resource"; - - // 烟火粒子示例,由三个发射器构成 - GSOGeoParticle geoParticle = new GSOGeoParticle(); - geoParticle.SetPosition(x, y, z); // 添加到这个经纬度位置 - geoParticle.AltitudeMode = EnumAltitudeMode.RelativeToGround; - - GSORingParticleEmitter emitter = new GSORingParticleEmitter(); - emitter.TexturePath = strResPath + "/ParticleImage/flare.png"; - - emitter.SetSizeFix(1, 1); - emitter.VelFix = 1; - emitter.VelRnd = 5; - - emitter.AngleXYFix = 0; - emitter.AngleXYRnd = 180; - - emitter.AngleXZFix = 90; - emitter.AngleXZRnd = 0; - - emitter.LifeFix = 0.5f; - emitter.LifeRnd = 0.0f; - - emitter.RotFix = 0; - emitter.RotRnd = 0; - - emitter.RotVelFix = 0; - emitter.RotVelRnd = 0; - - emitter.EmitPerSec = 100; - - // 采用线性插值生成粒子的初始颜色 - emitter.ColorRndStart = Color.White; - emitter.ColorRndEnd = Color.Red; - - - GSOColorParticleEffector effector2 = new GSOColorParticleEffector(); - effector2.SetColorChanged(0, -1, -1, 0); - effector2.StartTime = 0.0f; - effector2.EndTime = -1.0f; - emitter.AddEffector(effector2); - - // 将三个发射器添加到粒子对象中 - geoParticle.AddEmitter(emitter); - - geoParticle.Play(); - - GSOFeature feature = new GSOFeature(); - - feature.Geometry = geoParticle; - - globeControl1.Globe.MemoryLayer.AddFeature(feature); - - - return feature; - } - - /// - /// 添加喷泉 - /// - /// - private GSOFeature AddFountain() - { - string strResPath = Application.StartupPath + "/Resource"; - - GSOGeoParticle geoParticle = new GSOGeoParticle(); - geoParticle.SetPosition(116.314, 39.84, 0); // 添加到这个经纬度位置 - - GSOPointParticleEmitter emitter = new GSOPointParticleEmitter(); - emitter.TexturePath = strResPath + "/ParticleImage/test.png"; - - emitter.SetSizeFix(0.5f, 2); - emitter.VelFix = 10; - emitter.VelRnd = 2; - - emitter.GravityAcc = 9.8f; - emitter.AngleXYFix = 0; - emitter.AngleXYRnd = 180; - - emitter.AngleXZFix = 88; - emitter.AngleXZRnd = 2; - - //emitter.InnerRadius = 0; - // emitter.OuterRadius = 0.03f; - - emitter.LifeFix = 5.0f; - emitter.LifeRnd = 1.0f; - - emitter.RotFix = 0; - emitter.RotRnd = 0; - - emitter.RotVelFix = 0; - emitter.RotVelRnd = 0; - - emitter.EmitPerSec = 1000; - emitter.ColorRndStart = Color.FromArgb(33, 255, 255, 255); - emitter.ColorRndEnd = Color.FromArgb(11, 255, 255, 255); - emitter.IsLumAdded = false; - - // 将三个发射器添加到粒子对象中 - geoParticle.AddEmitter(emitter); - - geoParticle.Play(); - GSOFeature feature = new GSOFeature(); - - feature.Geometry = geoParticle; - - //globeControl1.Globe.MemoryLayer.AddFeature(feature); - globeControl1.Globe.FlyToFeature(feature); - - return feature; - } - - /// - /// 添加水柱 - /// - /// - private GSOFeature AddWaterLine() - { - string strResPath = Application.StartupPath + "/Resource"; - - GSOGeoParticle geoParticle = new GSOGeoParticle(); - geoParticle.SetPosition(116.308, 39.84, 0); // 添加到这个经纬度位置 - - GSOPointParticleEmitter emitter = new GSOPointParticleEmitter(); - - emitter.TexturePath = strResPath + "/ParticleImage/drop3.png"; - - geoParticle.TimerInterval = 1; - - emitter.SetSizeFix(2.0f, 2.0f); - - emitter.VelFix = 50; - emitter.VelRnd = 2; - - // emitter.IsLumAdded = false; - - emitter.GravityAcc = 9.8f; - emitter.AngleXYFix = 0; - emitter.AngleXYRnd = 2; - - emitter.AngleXZFix = 60; - emitter.AngleXZRnd = 2; - - //emitter.InnerRadius = 0; - // emitter.OuterRadius = 0.1f; - - emitter.LifeFix = 5.0f; - emitter.LifeRnd = 1.0f; - - emitter.RotFix = 0; - emitter.RotRnd = 0; - - emitter.RotVelFix = 0; - emitter.RotVelRnd = 0; - - emitter.EmitPerSec = 1500; - - emitter.ColorRndStart = Color.FromArgb(100, 222, 222, 222); - emitter.ColorRndEnd = Color.FromArgb(50, 222, 222, 222); - - /* - - GSOScaleParticleEffector effector1 = new GSOScaleParticleEffector(); - effector1.SetScale(0.2f, 0.2f); - effector1.StartTime = 0; - effector1.EndTime = -1; // 负数表示整个粒子生命结束 - emitter.AddEffector(effector1); - */ - - // 将三个发射器添加到粒子对象中 - geoParticle.AddEmitter(emitter); - - geoParticle.Play(); - GSOFeature feature = new GSOFeature(); - - feature.Geometry = geoParticle; - - //globeControl1.Globe.MemoryLayer.AddFeature(feature); - globeControl1.Globe.FlyToFeature(feature); - - return feature; - } + } } diff --git a/FrmBufferAnalysis.cs b/FrmBufferAnalysis.cs index f711133..db8ca59 100644 --- a/FrmBufferAnalysis.cs +++ b/FrmBufferAnalysis.cs @@ -123,39 +123,6 @@ } } /// - /// 半径文本框的键盘按键按下事件处理 - /// - /// - /// - private void txtRadius_KeyPress(object sender, KeyPressEventArgs e) - { - TextBox text = sender as TextBox; - if ((e.KeyChar < 48 || e.KeyChar > 57) && (e.KeyChar != 8) && (int)e.KeyChar != 46) - { - e.Handled = true; - } - if ((int)e.KeyChar == 46) //小数点 - { - if (text.Text.Length <= 0) - e.Handled = true; //小数点不能在第一位 - else //处理不规则的小数点 - { - float f; - float oldf; - bool b1 = false, b2 = false; - b1 = float.TryParse(text.Text, out oldf); - b2 = float.TryParse(text.Text + e.KeyChar.ToString(), out f); - if (b2 == false) - { - if (b1 == true) - e.Handled = true; - else - e.Handled = false; - } - } - } - } - /// /// 窗体关闭事件处理 /// /// diff --git a/FrmBufferAnalysisBSQ.cs b/FrmBufferAnalysisBSQ.cs index 24a96ca..f54208f 100644 --- a/FrmBufferAnalysisBSQ.cs +++ b/FrmBufferAnalysisBSQ.cs @@ -137,35 +137,7 @@ } } - private void txtRadius_KeyPress(object sender, KeyPressEventArgs e) - { - TextBox text = sender as TextBox; - if ((e.KeyChar < 48 || e.KeyChar > 57) && (e.KeyChar != 8) && (int)e.KeyChar != 46) - { - e.Handled = true; - } - if ((int)e.KeyChar == 46) //小数点 - { - if (text.Text.Length <= 0) - e.Handled = true; //小数点不能在第一位 - else //处理不规则的小数点 - { - float f; - float oldf; - bool b1 = false, b2 = false; - b1 = float.TryParse(text.Text, out oldf); - b2 = float.TryParse(text.Text + e.KeyChar.ToString(), out f); - if (b2 == false) - { - if (b1 == true) - e.Handled = true; - else - e.Handled = false; - } - } - } - } - + private void FrmBufferAnalysis_FormClosing(object sender, FormClosingEventArgs e) { //Form1.y = 0; @@ -316,27 +288,6 @@ } } - private void FlyToMenu_Click(object sender, EventArgs e) - { - if (m_feature != null) - { - if (m_feature.Geometry != null && m_feature.Geometry.Type == EnumGeometryType.GeoPolyline3D) - { - GSOGeoPolyline3D line = m_feature.Geometry as GSOGeoPolyline3D; - double length = line.GetSpaceLength(true, 6378137); - GSOGeoPolyline3D lineLine = line.GetSegment(0, length / 2); - GSOPoint3d point3d = lineLine[lineLine.PartCount - 1][lineLine[lineLine.PartCount - 1].Count - 1]; - - globeControl1.Globe.FlyToPosition(point3d, EnumAltitudeMode.Absolute, 0, 45, 5); - } - else - { - globeControl1.Globe.FlyToFeature(m_feature, 0, 45, 3); - } - LightMenu_Click(sender, e); - } - } - private void LightMenu_Click(object sender, EventArgs e) { flashflag = "single"; diff --git a/FrmDataBaseOpt.cs b/FrmDataBaseOpt.cs index b0c4b5d..8d7b69d 100644 --- a/FrmDataBaseOpt.cs +++ b/FrmDataBaseOpt.cs @@ -362,6 +362,7 @@ dbCombor.Items.Add(dblist[i].title); } } + /* /// /// 从配置文件读取数据库参数配置 /// @@ -428,6 +429,8 @@ } } + * */ + /* /// /// 向配置文件写入连接数据库的参数配置 /// @@ -485,6 +488,7 @@ MessageBox.Show(exp.ToString()); } } + * */ /// /// /// diff --git a/FrmDatabaseParaSetting.cs b/FrmDatabaseParaSetting.cs index a6fea46..63b596b 100644 --- a/FrmDatabaseParaSetting.cs +++ b/FrmDatabaseParaSetting.cs @@ -152,6 +152,7 @@ this.DialogResult = DialogResult.OK; this.Close(); } + /* /// /// 从配置文件读取数据库连接参数配置 /// @@ -218,6 +219,8 @@ } } + * */ + /* /// /// 向配置文件写入数据库参数配置 /// @@ -276,7 +279,7 @@ MessageBox.Show(ex.ToString()); } } - + */ /// /// 取消按钮事件处理 /// diff --git a/FrmDatabaseParaSetting2.cs b/FrmDatabaseParaSetting2.cs index 932d05e..96a87d5 100644 --- a/FrmDatabaseParaSetting2.cs +++ b/FrmDatabaseParaSetting2.cs @@ -148,6 +148,7 @@ this.DialogResult = DialogResult.OK; this.Close(); } + /* /// /// 从配置文件读取数据库连接参数配置 /// @@ -214,6 +215,8 @@ } } + * */ + /* /// /// 向配置文件写入数据库参数配置 /// @@ -272,7 +275,7 @@ MessageBox.Show(exp.ToString()); } } - + */ /// /// 取消按钮事件处理 /// diff --git a/FrmDiameterQuery.cs b/FrmDiameterQuery.cs index 68c948b..9a5215b 100644 --- a/FrmDiameterQuery.cs +++ b/FrmDiameterQuery.cs @@ -77,18 +77,7 @@ isBetween = true; } } - /// - /// 键盘按键按下事件处理 - /// - /// - /// - private void textBoxX1_KeyPress(object sender, KeyPressEventArgs e) - { - if ((e.KeyChar < 48 || e.KeyChar > 57) && e.KeyChar != 8) - { - e.Handled = true;//屏蔽 - } - } + bool isBetween = false; /// diff --git a/FrmDocumentEdit.cs b/FrmDocumentEdit.cs index aab2d31..e78a7ff 100644 --- a/FrmDocumentEdit.cs +++ b/FrmDocumentEdit.cs @@ -256,121 +256,6 @@ } - // - /// 将本地文件上传到指定的服务器(HttpWebRequest方法) - /// - /// 文件上传到的服务器 - /// 要上传的本地文件(全路径) - /// 文件上传后的名称 - /// 上传进度条 - /// 成功返回1,失败返回0 - private int Upload_Request(string address, string fileNamePath, string saveName, ProgressBar progressBar) - { - int returnValue = 0; - // 要上传的文件 - FileStream fs = new FileStream(fileNamePath, FileMode.Open, FileAccess.Read); - BinaryReader r = new BinaryReader(fs); - //时间戳 - string strBoundary = "----------" + DateTime.Now.Ticks.ToString("x"); - byte[] boundaryBytes = Encoding.ASCII.GetBytes("/r/n--" + strBoundary + "/r/n"); - //请求头部信息 - StringBuilder sb = new StringBuilder(); - sb.Append("--"); - sb.Append(strBoundary); - sb.Append("\r\n"); - sb.Append("Content-Disposition: form-data; name=\""); - sb.Append("file"); - sb.Append("\"; filename=\""); - sb.Append(saveName); - sb.Append("\""); - sb.Append("\r\n"); - sb.Append("Content-Type: "); - sb.Append("application/octet-stream"); - sb.Append("\r\n"); - sb.Append("\r\n"); - string strPostHeader = sb.ToString(); - byte[] postHeaderBytes = Encoding.UTF8.GetBytes(strPostHeader); - // 根据uri创建HttpWebRequest对象 - HttpWebRequest httpReq = (HttpWebRequest)WebRequest.Create(new Uri(address)); - httpReq.Method = "POST"; - //对发送的数据不使用缓存 - httpReq.AllowWriteStreamBuffering = false; - //设置获得响应的超时时间(300秒) - httpReq.Timeout = 300000; - httpReq.ContentType = "multipart/form-data; boundary=" + strBoundary; - long length = fs.Length + postHeaderBytes.Length + boundaryBytes.Length; - long fileLength = fs.Length; - httpReq.ContentLength = length; - try - { - progressBar.Maximum = int.MaxValue; - progressBar.Minimum = 0; - progressBar.Value = 0; - //每次上传4k - int bufferLength = 4096; - byte[] buffer = new byte[bufferLength]; - //已上传的字节数 - long offset = 0; - //开始上传时间 - DateTime startTime = DateTime.Now; - int size = r.Read(buffer, 0, bufferLength); - Stream postStream = httpReq.GetRequestStream(); - //发送请求头部消息 - postStream.Write(postHeaderBytes, 0, postHeaderBytes.Length); - while (size > 0) - { - postStream.Write(buffer, 0, size); - offset += size; - progressBar.Value = (int)(offset * (int.MaxValue / length)); - TimeSpan span = DateTime.Now - startTime; - double second = span.TotalSeconds; - //lblTime.Text = "已用时:" + second.ToString("F2") + "秒"; - //if (second > 0.001) - //{ - // lblSpeed.Text = " 平均速度:" + (offset / 1024 / second).ToString("0.00") + "KB/秒"; - //} - //else - //{ - // lblSpeed.Text = " 正在连接…"; - //} - //lblState.Text = "已上传:" + (offset * 100.0 / length).ToString("F2") + "%"; - //lblSize.Text = (offset / 1048576.0).ToString("F2") + "M/" + (fileLength / 1048576.0).ToString("F2") + "M"; - Application.DoEvents(); - size = r.Read(buffer, 0, bufferLength); - } - //添加尾部的时间戳 - postStream.Write(boundaryBytes, 0, boundaryBytes.Length); - postStream.Close(); - //获取服务器端的响应 - WebResponse webRespon = httpReq.GetResponse(); - Stream s = webRespon.GetResponseStream(); - StreamReader sr = new StreamReader(s); - //读取服务器端返回的消息 - String sReturnString = sr.ReadLine(); - s.Close(); - sr.Close(); - if (sReturnString == "Success") - { - returnValue = 1; - } - else if (sReturnString == "Error") - { - returnValue = 0; - } - } - catch(Exception ex) - { - returnValue = 0; - string str = ex.ToString(); - } - finally - { - fs.Close(); - r.Close(); - } - return returnValue; - } - private void btn_file_Click(object sender, EventArgs e) { OpenFileDialog dlg = new OpenFileDialog(); diff --git a/FrmExportCADS.cs b/FrmExportCADS.cs index 98772ea..59629dd 100644 --- a/FrmExportCADS.cs +++ b/FrmExportCADS.cs @@ -108,65 +108,6 @@ MessageBox.Show("请选中要导出的图层!", "提示", MessageBoxButtons.OK, MessageBoxIcon.Warning); } } - private Boolean MerageToFile(GSOFeatures features, String strDestFile, String strProj4)//图层追加 - { - if (features == null) - { - return false; - } - Boolean bSuccess = false; - - string strDir = GSOUtility.GetFileDir(strDestFile); - string strLPRJFile = GSOUtility.ChangeExt(strDestFile, ".lprj"); - string strExt = GSOUtility.GetFileExt(strDestFile); - - // 如果投影文件存在,投影以投影文件为准 - if (File.Exists(strLPRJFile)) - { - // 如果是dxf,则这样处理 - if (strExt.ToLower() == ".dxf") - { - string strTempSrcFile = strDir + "srcFeatures_dxftmp" + strExt; - globeControl1.Globe.DataManager.SaveFeatureData(features, strTempSrcFile, strLPRJFile, 4); - bSuccess = GSOUtility.MergeTwoDXFFileFeatures(strDestFile, strTempSrcFile); - File.Delete(strTempSrcFile); - } - else - { - GSOFeatures srcFeatures = globeControl1.Globe.DataManager.ReadFeatureData(strDestFile); - int nCount = features.Length; - int i = 0; - for (i = 0; i < nCount; i++) - { - srcFeatures.Add(features[i]); - } - bSuccess = globeControl1.Globe.DataManager.SaveFeatureData(srcFeatures, strDestFile, strLPRJFile, 4); - } - } - else - { - // 如果是dxf,则这样处理 - if (strExt.ToLower() == ".dxf") - { - string strTempSrcFile = strDir + "srcFeatures_dxftmp" + strExt; - globeControl1.Globe.DataManager.SaveFeatureData(features, strTempSrcFile, strProj4, 0); - bSuccess = GSOUtility.MergeTwoDXFFileFeatures(strDestFile, strTempSrcFile); - File.Delete(strTempSrcFile); - } - else - { - GSOFeatures srcFeatures = globeControl1.Globe.DataManager.ReadFeatureData(strDestFile); - int nCount = features.Length; - int i = 0; - for (i = 0; i < nCount; i++) - { - srcFeatures.Add(features[i]); - } - bSuccess = globeControl1.Globe.DataManager.SaveFeatureData(srcFeatures, strDestFile, strProj4, 0); - } - } - return bSuccess; - } /// /// 关闭按钮事件处理 /// diff --git a/FrmHDMAnalysis3.cs b/FrmHDMAnalysis3.cs index 4f73af6..2ada735 100644 --- a/FrmHDMAnalysis3.cs +++ b/FrmHDMAnalysis3.cs @@ -436,29 +436,6 @@ } layerTemp.RemoveAllFeature(); } - private void Export(GSOPoint3d _pnt, double r) - { - GSOPoint3ds pnts = new GSOPoint3ds(); - GSOPoint3d pnt = new GSOPoint3d(); - pnt.X = _pnt.X; - pnt.Y = _pnt.Y; - pnt.Z = _pnt.Z; - pnts.Add(pnt); - pnt.X = _pnt.X; - pnt.Y = _pnt.Y - 0.0000000005; - pnt.Z = _pnt.Z; - pnts.Add(pnt); - GSOGeoPolyline3D line = new GSOGeoPolyline3D(); - line.AddPart(pnts); - GSOGeoPolygon3D polygon = line.CreateBuffer(r * 2, true, 5, true, false); - GSOPoint3ds points = polygon[0]; - GSOGeoPolyline3D newLine = new GSOGeoPolyline3D(); - newLine.AddPart(points); - newLine.AltitudeMode = EnumAltitudeMode.RelativeToGround; - GSOFeature newFeature = new GSOFeature(); - newFeature.Geometry = newLine; - globeControl1.Globe.MemoryLayer.AddFeature(newFeature); - } private void ExportCAD(double a, double b, double r) { diff --git a/FrmHotFuncStat.cs b/FrmHotFuncStat.cs index c980f34..2eb1476 100644 --- a/FrmHotFuncStat.cs +++ b/FrmHotFuncStat.cs @@ -421,13 +421,6 @@ } } - private void HFS_Pderive_Click(object sender, EventArgs e) - { - if (TV_Files.SelectedNode != null) - { - HFSClass.GuideEdit_form("G", TV_Files, int.Parse(((ToolStripMenuItem)sender).Tag.ToString())); - } - } private void 导入ToolStripMenuItem_Click(object sender, EventArgs e) { @@ -530,22 +523,8 @@ } } - private void 导出ToolStripMenuItem1_Click(object sender, EventArgs e) - { - 导出ToolStripMenuItem2_Click(sender, e); - } + - private void TV_HFSSrchRslt_AfterCollapse(object sender, TreeViewEventArgs e) - { - e.Node.ImageIndex = 0; - } - - private void TV_HFSSrchRslt_AfterExpand(object sender, TreeViewEventArgs e) - { - HFSClass.ADD_TreeNode(TV_Files, e.Node); - e.Node.ImageIndex = 1; - } - private void 导出ToolStripMenuItem1_Click_1(object sender, EventArgs e) { if ((TV_HFSSrchRslt.SelectedNode != null) && (TV_HFSSrchRslt.SelectedNode.Parent != null)) diff --git a/FrmLayerControl.cs b/FrmLayerControl.cs index e7917c3..28fa14d 100644 --- a/FrmLayerControl.cs +++ b/FrmLayerControl.cs @@ -312,26 +312,7 @@ layerManagerNode.Expand(); terrainManagerNode.Expand(); } - /// - /// 刷新节点树 - /// - private void RefreshDataTree() - { - layerTree2.Nodes[0].Nodes.Clear(); - Int32 nCount = globeControl2.Globe.Layers.Count; - Int32 i = 0; - for (i = 0; i < nCount; i++) - { - GSODataset dataSpace = globeControl2.Globe.Layers[i].Dataset; - TreeNode node = new TreeNode(); - node.Text = dataSpace.Name; - node.ImageIndex = 0; - node.SelectedImageIndex = 0; - node.Checked = true; - node.Tag = dataSpace; - layerTree2.Nodes[0].Nodes.Add(node); - } - } + /// /// 目标图层按钮事件处理 /// @@ -494,22 +475,8 @@ } } } - /// - /// 改变指定节点的选中状态 - /// - /// - /// - private void CheckTreeNode(TreeNode node, Boolean bChecked) - { - CheckChildTreeNode(node, bChecked); - // 对于kml图层,如果当前处理的节点是true,那么要把所有的祖宗节点置为true - // 只有所有节点都未false,那么这个节点才为false - // CheckFatherTreeNode(node, bChecked); - globeControl1.Globe.Refresh(); - globeControl2.Globe.Refresh(); - - } + private void CheckChildTreeNode(TreeNode node, Boolean bChecked) { if (node == null) @@ -696,59 +663,7 @@ //} //CheckControl(e); } - /// - /// 树节点选中方法 - /// - /// - private void CheckControl(TreeViewEventArgs e) - { - if (e.Action != TreeViewAction.Unknown) - { - if (e.Node != null && !Convert.IsDBNull(e.Node)) - { - CheckParentNode(e.Node); - if (e.Node.Nodes.Count > 0) - { - CheckAllChildNodes(e.Node, e.Node.Checked); - } - } - } - } - /// - /// 改变所有子节点的状态 - /// - /// - /// - private void CheckAllChildNodes(TreeNode pn, bool IsChecked) - { - foreach (TreeNode tn in pn.Nodes) - { - tn.Checked = IsChecked; - if (tn.Tag.ToString().Contains("|")) - { - string nodeTag = tn.Tag.ToString().Split('|')[1]; - GSOLayer layer = globeControl1.Globe.Layers.GetLayerByCaption(nodeTag); - if (layer != null) - { - layer.Visible = IsChecked; - globeControl1.Globe.Refresh(); - } - } - if (tn.Tag is GSOFeature) - { - if (tn.Nodes.Count == 0) - { - GSOFeature feat = tn.Tag as GSOFeature; - feat.Visible = IsChecked; - globeControl1.Globe.Refresh(); - } - } - if (tn.Nodes.Count > 0) - { - CheckAllChildNodes(tn, IsChecked); - } - } - } + /// /// 改变父节点的选中状态,此处为所有子节点不选中时才取消父节点选中,可以根据需要修改 /// diff --git a/FrmLogin.cs b/FrmLogin.cs index 320fdd5..2afe46e 100644 --- a/FrmLogin.cs +++ b/FrmLogin.cs @@ -59,70 +59,6 @@ textBoxPassWord.Clear(); } } - - /// - /// 验证端口号 - /// - /// - private bool ValiPort() - { - Ping p = new Ping();//创建Ping对象p - PingReply pr = p.Send(Utility.localicenseserverip);//向指定IP或者主机名的计算机发送ICMP协议的ping数据包 - if (pr.Status == IPStatus.Success)//如果ping成功 - { - try - { - TcpClient tcpc = new TcpClient(Utility.localicenseserverip, Utility.localicenseserverport);//对IP地址为"192.168.0.105"的计算机的1500端口提出连接申请 - tcpc.Close(); - return true; - } - catch (Exception ex) - { - MessageBox.Show("端口连接错误!" + ex.Message); - return false; - } - } - else - { - int times = 0;//重新连接次数; - int count = 2;//设置尝试次数 - while (times < count) - { - //Thread.Sleep(1000);//等待时间(方便测试的话,你可以改为1000) - pr = p.Send(Utility.localicenseserverip); - - if (pr.Status == IPStatus.Success) - { - try - { - TcpClient tcpc = new TcpClient(Utility.localicenseserverip, Utility.localicenseserverport);//对IP地址为"192.168.0.105"的计算机的1500端口提出连接申请 - tcpc.Close(); - return true; - } - catch (Exception ex) - { - MessageBox.Show("端口连接错误!" + ex.Message); - return false; - } - } - else - { - times++; - if (times < count) - { - continue; - } - else - { - MessageBox.Show("重新尝试连接失败"); - return false; - } - } - - } - return false; - } - } /// /// 验证用户名、密码 /// diff --git a/FrmMetadata.cs b/FrmMetadata.cs index 886f65a..0365372 100644 --- a/FrmMetadata.cs +++ b/FrmMetadata.cs @@ -27,11 +27,7 @@ InitializeComponent(); loadTreeView(layerTree); } - private void FrmMetadata_Load(object sender, EventArgs e) - { - //this.ntLblC.Text = "nn"; - // loadTreeView(layerTree); - } + private void loadTreeView(TreeView tv)//构建图层树 { try diff --git a/FrmMetadataStat.cs b/FrmMetadataStat.cs index 790658a..e7696c6 100644 --- a/FrmMetadataStat.cs +++ b/FrmMetadataStat.cs @@ -197,9 +197,5 @@ } } - private void buttonX1_Click(object sender, EventArgs e) - { - drawChart(); - } } } diff --git a/FrmPatrolerManager.cs b/FrmPatrolerManager.cs index 37f8ffd..9e66aeb 100644 --- a/FrmPatrolerManager.cs +++ b/FrmPatrolerManager.cs @@ -109,82 +109,8 @@ this.winGridViewPager1.AllToExport = table; } - /// - /// 编辑 - /// - /// - /// - private void winGridViewPager1_OnEditSelected(object sender, EventArgs e) - { - - DataGridView grid = sender as DataGridView; - if (grid != null && grid.SelectedRows.Count>0) - { - DataGridViewRow row = grid.SelectedRows[0]; - try - { - long dbid = long.Parse(row.Cells["编号"].Value.ToString()); - String name = row.Cells["姓名"].Value.ToString(); - String sex = row.Cells["性别"].Value.ToString(); - String age = row.Cells["年龄"].Value.ToString(); - string phone = row.Cells["电话"].Value.ToString(); - age = String.IsNullOrEmpty(age.ToString().Trim()) ? "1" : age.ToString().Trim(); - FrmPatrolerEdit frm = new FrmPatrolerEdit(dbid.ToString(), name, age, sex, phone); - frm.reloadGrid += new ReloadPatrolerGrid(LoadData); - frm.ShowDialog(); - winGridViewPager1.Refresh(); - } - catch (Exception ex) - { - MessageBox.Show("编辑失败:" + ex.ToString(), "错误", MessageBoxButtons.OK, MessageBoxIcon.Error); - } - } - else - { - MessageBox.Show("没有选择记录", "提示"); - } - - } - - /// - /// 删除 - /// - /// - /// - private void winGridViewPager1_OnDeleteSelected(object sender, EventArgs e) - { - DataGridView grid = sender as DataGridView; - if (grid != null && grid.SelectedRows.Count > 0) - { - DataGridViewRow row = grid.SelectedRows[0]; - long dbid = long.Parse(row.Cells["编号"].Value.ToString()); - try - { - string state = row.Cells["状态"].Value.ToString(); - if ("在线".Equals(state)) - { - if (MessageBox.Show("确定注销?", "确认", MessageBoxButtons.YesNo, MessageBoxIcon.Question) == DialogResult.Yes) - { - String sql = "update patroler t set t.accountstate='LEAVER' where t.dbid=" + dbid; - OracleUtils.ExecuteNonQuery(OracleUtils.ConnectionString, CommandType.Text, sql); - } - } - else { - MessageBox.Show("人员不在线,无法注销", "信息"); - } - } - catch (Exception ex) - { - MessageBox.Show("人员注销失败:" + ex.ToString(), "错误", MessageBoxButtons.OK, MessageBoxIcon.Error); - } - } - else - { - MessageBox.Show("没有选择记录", "提示"); - } - } - - + + private void LoadData() { int pageIndex = winGridViewPager1.PagerInfo.CurrenetPageIndex; diff --git a/FrmRoadHDM.cs b/FrmRoadHDM.cs index e765313..e871dd5 100644 --- a/FrmRoadHDM.cs +++ b/FrmRoadHDM.cs @@ -333,31 +333,6 @@ this.Cursor = Cursors.Default; } } - - private void Export(GSOPoint3d _pnt, double r) - { - GSOPoint3ds pnts = new GSOPoint3ds(); - GSOPoint3d pnt = new GSOPoint3d(); - pnt.X = _pnt.X; - pnt.Y = _pnt.Y; - pnt.Z = _pnt.Z; - pnts.Add(pnt); - pnt.X = _pnt.X; - pnt.Y = _pnt.Y - 0.0000000005; - pnt.Z = _pnt.Z; - pnts.Add(pnt); - GSOGeoPolyline3D line = new GSOGeoPolyline3D(); - line.AddPart(pnts); - GSOGeoPolygon3D polygon = line.CreateBuffer(r * 2, true, 5, true, false); - GSOPoint3ds points = polygon[0]; - GSOGeoPolyline3D newLine = new GSOGeoPolyline3D(); - newLine.AddPart(points); - newLine.AltitudeMode = EnumAltitudeMode.RelativeToGround; - GSOFeature newFeature = new GSOFeature(); - newFeature.Geometry = newLine; - globeControl1.Globe.MemoryLayer.AddFeature(newFeature); - } - private void ExportCAD(double a, double b, double r) { GSOPoint3ds pnts = new GSOPoint3ds(); diff --git a/FrmUserAdd.cs b/FrmUserAdd.cs index c612ab4..f826427 100644 --- a/FrmUserAdd.cs +++ b/FrmUserAdd.cs @@ -231,24 +231,6 @@ //cbxRegion.SelectedIndexChanged += new EventHandler(cbxRegion_SelectedIndexChanged); } } - /// - /// 下拉框选中项改变事件处理 - /// - /// - /// - private void cbxRegion_SelectedIndexChanged(object sender, EventArgs e) - { - string sql = ""; - //string sql = "select casic_role.\"name\" from casic_role join casic_regionrole on casic_role.\"id\"=casic_regionrole.\"rid\" where casic_regionrole.\"reid\"=" + region[cbxRegion.SelectedItem.ToString().Trim()]; - DataTable dt = OledbHelper.QueryTable(sql); - if (dt != null && dt.Rows.Count > 0) - { - comboBoxExRegionRole.Items.Clear(); - for (int i = 0; i < dt.Rows.Count; i++) - { - comboBoxExRegionRole.Items.Add(dt.Rows[i][0].ToString().Trim());//部门角色 - } - } - } + } } diff --git a/FrmUserManager.cs b/FrmUserManager.cs index 571f0f0..ae254bc 100644 --- a/FrmUserManager.cs +++ b/FrmUserManager.cs @@ -81,11 +81,6 @@ } } } - //创建新用户 - private void buttonX2_Click(object sender, EventArgs e) - { - FrmUserAdd frm = new FrmUserAdd(-1); - frm.ShowDialog(); - } + } } diff --git a/FrmValveStatistics.cs b/FrmValveStatistics.cs index 545d56c..dd76777 100644 --- a/FrmValveStatistics.cs +++ b/FrmValveStatistics.cs @@ -54,7 +54,7 @@ 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") + if (chaFamenStatis.Series["阀门"].Points[m]!=null&&chaFamenStatis.Series["阀门"].Points[m].YValues[0].ToString() != "0") { chaFamenStatis.Series["阀门"].Points[m].Label = chaFamenStatis.Series[0].Points[m].YValues[0].ToString(); } diff --git a/Frm_password_reset.cs b/Frm_password_reset.cs index 7b51039..b9e5dc3 100644 --- a/Frm_password_reset.cs +++ b/Frm_password_reset.cs @@ -41,6 +41,7 @@ } catch (Exception ex) { + LogHelper.WriteLog(typeof(Frm_password_reset), ex.Message); } } private void initCombox() diff --git a/FrmpipeDeepstatis.cs b/FrmpipeDeepstatis.cs index e156db4..1a84d6c 100644 --- a/FrmpipeDeepstatis.cs +++ b/FrmpipeDeepstatis.cs @@ -307,7 +307,7 @@ chart1.Series[j].Points.DataBindXY(dic1.Keys, dic1.Values); for (int m = 0; m < dic1.Values.Count; m++) { - if (chart1.Series[j].Points[m].YValues[0].ToString() != "0") + if (chart1.Series[j].Points[m]!=null&&chart1.Series[j].Points[m].YValues[0].ToString() != "0") { chart1.Series[j].Points[m].Label = chart1.Series[j].Points[m].YValues[0].ToString(); diff --git a/FrmpipeDiametergather.cs b/FrmpipeDiametergather.cs index 30674de..057b09d 100644 --- a/FrmpipeDiametergather.cs +++ b/FrmpipeDiametergather.cs @@ -263,6 +263,7 @@ if (layer != null && layer is GSOFeatureLayer) { GSOFeatureLayer flayer = layer as GSOFeatureLayer; + if (layer == null) return; GSOFeatures features = flayer.GetAllFeatures(); if (features.Length > 0) { diff --git a/FrmpipeMaterialGather.cs b/FrmpipeMaterialGather.cs index c133ec3..398b884 100644 --- a/FrmpipeMaterialGather.cs +++ b/FrmpipeMaterialGather.cs @@ -280,6 +280,7 @@ if (layer != null && layer is GSOFeatureLayer) { GSOFeatureLayer flayer = layer as GSOFeatureLayer; + if (flayer == null) return; GSOFeatures features = flayer.GetAllFeatures(); if (features.Length > 0) { @@ -332,7 +333,7 @@ chart1.Series[j].Points.DataBindXY(dic1.Keys, dic1.Values); for (int m = 0; m < dic1.Values.Count; m++) { - if (chart1.Series[j].Points[m].YValues[0].ToString() != "0") + if (chart1.Series[j].Points[m]!=null&&chart1.Series[j].Points[m].YValues[0].ToString() != "0") { chart1.Series[j].Points[m].Label = chart1.Series[j].Points[m].YValues[0].ToString(); } diff --git a/Frmpipediameterstatis.cs b/Frmpipediameterstatis.cs index c0ed80a..50f8170 100644 --- a/Frmpipediameterstatis.cs +++ b/Frmpipediameterstatis.cs @@ -286,6 +286,7 @@ chart1.Series.Add(layerCaption); GSOFeatureLayer flayer = layer as GSOFeatureLayer; + if (layer == null) return; GSOFeatures features = flayer.GetAllFeatures(); if (features.Length > 0) { diff --git "a/GKT_Forms/F_GKT\346\225\260\346\215\256\350\276\223\345\205\245\350\276\223\345\207\272.cs" "b/GKT_Forms/F_GKT\346\225\260\346\215\256\350\276\223\345\205\245\350\276\223\345\207\272.cs" index c7bffd5..4db7d5d 100644 --- "a/GKT_Forms/F_GKT\346\225\260\346\215\256\350\276\223\345\205\245\350\276\223\345\207\272.cs" +++ "b/GKT_Forms/F_GKT\346\225\260\346\215\256\350\276\223\345\205\245\350\276\223\345\207\272.cs" @@ -198,12 +198,7 @@ } DialogResult = DialogResult.OK;//将当前窗体的对话框返回值设为OK } - private void treeView1_NodeMouseClick(object sender, TreeNodeMouseClickEventArgs e) - { - dir_Ok = comboBox_Disk.Text + e.Node.FullPath; - //dir = comboBox_Disk.Text + e.Node.FullPath; - e.Node.SelectedImageIndex = e.Node.ImageIndex; - } + string tempstr = ""; private void button1_Click(object sender, EventArgs e) { diff --git a/HFS_Forms/Frm_HFSprojedits.cs b/HFS_Forms/Frm_HFSprojedits.cs index 96dd76f..3c232a1 100644 --- a/HFS_Forms/Frm_HFSprojedits.cs +++ b/HFS_Forms/Frm_HFSprojedits.cs @@ -126,16 +126,6 @@ Close(); } - - - private void TB_ProjName_KeyPress(object sender, KeyPressEventArgs e) - { - if (HFSAClass.Files_NameChar(e) == 0) - e.Handled = true; - if (e.KeyChar == '\r') - OK_Click(sender, e); - } - private void Frm_HFSProjedit_Load(object sender, EventArgs e) { @@ -175,10 +165,6 @@ } } - private void Cancel_Click(object sender, EventArgs e) - { - this.Close(); - } private void Cancel_Click_1(object sender, EventArgs e) { diff --git a/MainFrm.cs b/MainFrm.cs index 2c305a0..ed2685b 100644 --- a/MainFrm.cs +++ b/MainFrm.cs @@ -617,7 +617,7 @@ } catch (Exception ex) { - + LogHelper.WriteLog(typeof(MainFrm), ex.Message); } } @@ -1768,7 +1768,7 @@ } catch (Exception ex) { - //LogError.PublishError(ex); + LogHelper.WriteLog(typeof(MainFrm), ex.Message); } } @@ -2026,6 +2026,7 @@ } catch (Exception ex) { + LogHelper.WriteLog(typeof(MainFrm), ex.Message); result = false; } finally @@ -2316,220 +2317,6 @@ string filename = Utility.filename; List g1layername = new List(); /// - /// 构建图层列表目录树 - /// - /// - private void loadTreeView(TreeView tv) - { - try - { - XmlDocument doc = new XmlDocument(); - doc.Load(filename); - XmlNodeList Params1 = doc.SelectNodes("/Params/layers"); - tv.ShowLines = false; - tv.CheckBoxes = true; - - foreach (XmlNode paramsNode in Params1) //layers - { - foreach (XmlNode layerNode in paramsNode) //layer - { - TreeNode nodelayer = new TreeNode(); - string layerName = layerNode.Attributes["label"].Value; - nodelayer.Text = layerName; - - if (layerNode.HasChildNodes != false) - { - tv.Nodes.Add(nodelayer); - foreach (XmlNode layerchildNode in layerNode) //layerchild - { - if (layerchildNode.Name == "layerchild") - { - TreeNode nodelayerchild = new TreeNode(); - string layerType = layerchildNode.Attributes["type"].Value; - string layerName1 = layerchildNode.Attributes["layer"].Value; - string layerchildName = layerchildNode.Attributes["label"].Value; - if (layerType == "locaserver") - { - if (layerchildNode.Attributes["isRoad"] != null) - { - roadLayerName = layerchildName; - } - dictionaryNetLayerNameAndCaption.Add(layerName1, layerchildName); - - nodelayerchild.Text = layerchildName; - nodelayerchild.Tag = layerType + "|" + layerchildName; - nodelayerchild.Checked = true; - nodelayer.Nodes.Add(nodelayerchild); - } - else - { - if (layerchildNode.Attributes["isPipeLine"] != null) - { - m_PipelineLayerNames.Add(layerchildName); - } - if (layerchildNode.Attributes["isWorkWell"] != null) - { - workwellLayerNames.Add(layerchildName); - } - if (layerchildNode.Attributes["isValve"] != null) - { - valueLayerNames.Add(layerchildName); - } - //if (layerchildNode.Attributes["isInstrument"] != null) - if (layerchildNode.Attributes["isAccess"] != null) - { - instrumenLayerNames.Add(layerchildName); - } - //if (layerchildNode.Attributes["isPipeFitting"] != null) - if (layerchildNode.Attributes["isCharacter"] != null) - { - pipefittingLayerNames.Add(layerchildName); - } - bool boollayer = AddLayers(layerName1, layerchildName); - nodelayerchild.Text = layerchildName; - nodelayerchild.Tag = layerType + "|" + layerchildName; - nodelayerchild.Checked = boollayer; - if (layerchildName.Contains("特征管点")) - { - nodelayerchild.Checked = false; - setLayerVisible(layerName1); - } - - nodelayer.Nodes.Add(nodelayerchild); - g1layername.Add(layerName1); - } - } - else if (layerchildNode.Name == "layertype") - { - TreeNode nodelayerchild = new TreeNode(); - string layerType = layerchildNode.Attributes["label"].Value; - nodelayerchild.Text = layerType; - nodelayerchild.Tag = layerType; - nodelayerchild.Checked = true; - nodelayer.Nodes.Add(nodelayerchild); - if (layerchildNode.HasChildNodes == true) - { - foreach (XmlNode childNodeLayer in layerchildNode) - { - if (childNodeLayer.HasChildNodes == true) - { - TreeNode nodelayerchild2 = new TreeNode(); - string layer = childNodeLayer.Attributes["label"].Value; - nodelayerchild2.Text = layer; - nodelayerchild2.Tag = layer; - nodelayerchild2.Checked = true; - nodelayerchild.Nodes.Add(nodelayerchild2); - foreach (XmlNode n in childNodeLayer) - { - TreeNode nodelayerchild1 = new TreeNode(); - string layerName1 = n.Attributes["layer"].Value; - string layerchildName = n.Attributes["label"].Value; - string layerType1 = n.Attributes["type"].Value; - if (n.Attributes["isPipeLine"] != null) - { - m_PipelineLayerNames.Add(layerchildName); - } - if (n.Attributes["isWorkWell"] != null) - { - workwellLayerNames.Add(layerchildName); - } - if (n.Attributes["isValve"] != null) - { - valueLayerNames.Add(layerchildName); - } - if (n.Attributes["isAccess"] != null) - //if (n.Attributes["isInstrument"] != null) - { - instrumenLayerNames.Add(layerchildName); - } - if (n.Attributes["isPipeFitting"] != null) - { - pipefittingLayerNames.Add(layerchildName); - } - bool boollayer = AddLayers(layerName1, layerchildName); - nodelayerchild1.Text = layerchildName; - nodelayerchild1.Tag = layerType1 + "|" + layerchildName; - nodelayerchild1.Checked = boollayer; - if (layerchildName.Contains("特征管点")) - { - nodelayerchild1.Checked = false; - setLayerVisible(layerName1); - } - - nodelayerchild2.Nodes.Add(nodelayerchild1); - - g1layername.Add(layerName1); - } - } - else - { - TreeNode nodelayerchild1 = new TreeNode(); - string layerName1 = childNodeLayer.Attributes["layer"].Value; - string layerchildName = childNodeLayer.Attributes["label"].Value; - string layerType1 = childNodeLayer.Attributes["type"].Value; - if (childNodeLayer.Attributes["isPipeLine"] != null) - { - m_PipelineLayerNames.Add(layerchildName); - } - if (childNodeLayer.Attributes["isWorkWell"] != null) - { - workwellLayerNames.Add(layerchildName); - } - if (childNodeLayer.Attributes["isValve"] != null) - { - valueLayerNames.Add(layerchildName); - } - if (childNodeLayer.Attributes["isAccess"] != null) - //if (childNodeLayer.Attributes["isInstrument"] != null) - { - instrumenLayerNames.Add(layerchildName); - } - if (childNodeLayer.Attributes["isPipeFitting"] != null) - { - pipefittingLayerNames.Add(layerchildName); - } - bool boollayer = AddLayers(layerName1, layerchildName); - nodelayerchild1.Text = layerchildName; - nodelayerchild1.Tag = layerType1 + "|" + layerchildName; - nodelayerchild1.Checked = boollayer; - if (layerchildName.Contains("特征管点")) - { - nodelayerchild1.Checked = false; - setLayerVisible(layerName1); - } - nodelayerchild.Nodes.Add(nodelayerchild1); - g1layername.Add(layerName1); - } - } - } - } - } - } - else - { - tv.Nodes.Add(nodelayer); - } - } - } - - foreach (TreeNode tn in tv.Nodes) - { - if (tn.Nodes.Count > 0) - { - foreach (TreeNode tnChild in tn.Nodes) - { - if (tnChild.Checked) - tn.Checked = true; - } - } - } - } - catch (Exception ex) - { - //LogError.PublishError(ex); - } - } - /// /// 获取目标图层 /// /// @@ -2629,21 +2416,11 @@ } catch (Exception ex) { - //LogError.PublishError(ex); + LogHelper.WriteLog(typeof(MainFrm), ex.Message); return false; } } /// - /// 菜单上的 三维导航 工具按钮 - /// - /// - /// - private void buttonItem86_Click(object sender, EventArgs e) - { - globeControl1.Globe.Action = EnumAction3D.ActionNull; - } - - /// /// 地上模式 菜单按钮 /// /// @@ -3026,67 +2803,11 @@ } Image printImage; - /// - /// 打印 菜单 - /// - /// - /// - private void buttonItem13_Click(object sender, EventArgs e) - { - Point pt1 = new Point(Convert.ToInt32(0), Convert.ToInt32(0)); - Point pt2 = new Point(Convert.ToInt32(panelEx5.Width), Convert.ToInt32(panelEx5.Height)); - int mapWidth = 0; - int mapHeight = 0; - Point pt = getUpperLeftPoint(pt1, pt2, out mapWidth, out mapHeight); - printImage = new Bitmap(Convert.ToInt32(panelEx5.Width), Convert.ToInt32(panelEx5.Height)); - Graphics g = Graphics.FromImage(printImage); - g.CopyFromScreen(pt, new Point(0, 0), new Size(Convert.ToInt32(panelEx5.Width), Convert.ToInt32(panelEx5.Height))); - - PrintDialog pd = new PrintDialog(); - try - { - if (pd.ShowDialog() == DialogResult.OK) //如果确认,将会覆盖所有的打印参数设置 - { - //打印预览 - PrintPreviewDialog ppd = new PrintPreviewDialog(); - ppd.Document = printDocument1; - if (DialogResult.OK == ppd.ShowDialog()) - { - printDocument1.Print(); //打印 - } - } - } - catch - { - printDocument1.PrintController.OnEndPrint(printDocument1, new System.Drawing.Printing.PrintEventArgs()); - } - } - + private void printDocument1_PrintPage(object sender, System.Drawing.Printing.PrintPageEventArgs e) { e.Graphics.DrawImage(printImage, 10, 10); } - - /// - /// 在窗体的底部状态栏上显示 综合管线条件查询结果 - /// - /// - /// - private void ToolStripText(string currentLayer, int dataCount) - { - if (dataCount != 0) - { - double featurelength = PipeLength(currentLayer, 0);// 统计管线的里程数 - - toolStripNumbers.Text = " 管线类型:" + currentLayer + " | 共有:" + Convert.ToString(dataCount - 1) + "条记录"; - toolStripFeatureLength.Text = " 管线里程:" + featurelength.ToString("0.00") + " 米"; - } - else - { - toolStripNumbers.Text = "管线类型: " + currentLayer + "| 共有:" + 0 + " 条记录 | "; - } - } - /// /// 统计管线的里程数 /// @@ -3402,26 +3123,6 @@ } /// - /// 绘制线 菜单 - /// - /// - /// - private void btnAddLine_Click(object sender, EventArgs e) - { - globeControl1.Globe.DestLayerFeatureAdd = globeControl1.Globe.MemoryLayer; - globeControl1.Globe.Action = EnumAction3D.DrawPolyline; - } - /// - /// 绘制面 菜单 - /// - /// - /// - private void btnAddPolygon_Click(object sender, EventArgs e) - { - globeControl1.Globe.DestLayerFeatureAdd = globeControl1.Globe.MemoryLayer; - globeControl1.Globe.Action = EnumAction3D.DrawPolygon; - } - /// /// 图层目录树 右键菜单中的 目标图层 菜单 /// /// @@ -3956,42 +3657,7 @@ // ClearUpDownTraceAnalysis(); //} - /// - /// 显示流向 功能 - /// - /// - /// - /// - private void Flow(object sender, string pipelineNameCN, bool bShow) - { - GSOFeatureLayer layer = globeControl1.Globe.Layers.GetLayerByCaption(pipelineNameCN) as GSOFeatureLayer; - GSOFeatures feats = layer.GetAllFeatures(); - for (int i = 0; i < feats.Length; i++) - { - GSOFeature feat = feats[i]; - GSOLineStyle3D lineStyle = feat.Geometry.Style as GSOLineStyle3D; - if (lineStyle != null) - { - if (lineStyle.ArrowStyle == null) - { - lineStyle.ArrowStyle = new GSOArrowStyle(); - lineStyle.ArrowStyle.BodyWidth = 2; - lineStyle.ArrowStyle.BodyLen = 6; - lineStyle.ArrowStyle.HeadWidth = 8; - lineStyle.ArrowStyle.HeadLen = 10; - lineStyle.ArrowStyle.OutlineVisible = true; - lineStyle.ArrowStyle.OutlineColor = Color.Red; - lineStyle.ArrowStyle.Speed = lineStyle.ArrowStyle.Speed / 2; - lineStyle.ArrowStyle.Play(); - } - lineStyle.ArrowVisible = bShow; - layerTree.SelectedNode = null; - } - } - globeControl1.Globe.Refresh(); - } - - + FrmCloseValves frm; /// /// 关阀分析 功能 @@ -4030,7 +3696,9 @@ curCAYNDataset.CloseValveAnalysis(lineFeature.ID, out arryResNodeID, out arryResValveID, false, true); } catch (Exception e) - { } + { + LogHelper.WriteLog(typeof(MainFrm), e.Message); + } string valveName = lineLayer.Caption; valveName = valveName.Substring(0, valveName.IndexOf("管线")); @@ -4106,7 +3774,7 @@ } catch (Exception e) { - + LogHelper.WriteLog(typeof(MainFrm), e.Message); } //目前只有燃气管线 有阀门 string valveName = lineLayer.Name; @@ -5457,7 +5125,7 @@ } catch (Exception ex) { - //MessageBox.Show(ex.ToString()); + LogHelper.WriteLog(typeof(MainFrm), ex.Message); } finally { @@ -5501,22 +5169,6 @@ } } - - /// - /// 清除所有坑 菜单 - /// - /// - /// - private void buttonItem3_Click(object sender, EventArgs e) - { - //日志记录 - LogManager.saveLog(Utility.userName, this.buttonItem3.Text); - - globeControl1.Globe.RemoveAllPits(); - } - - - ///// ///// 净距分析 菜单 ///// @@ -5554,42 +5206,8 @@ // ribbonBarTP.Visible = buttonItem34.Checked; // ribbonBarTP.Location = new Point(0, 0); //} - /// - /// 大气层 菜单 - /// - /// - /// - private void buttonItem17_Click_1(object sender, EventArgs e) - { - globeControl1.Globe.Atmosphere.Visible = !globeControl1.Globe.Atmosphere.Visible; - buttonItemSH1.Checked = globeControl1.Globe.Atmosphere.Visible; - globeControl1.Refresh(); - } - /// - /// 经纬网 菜单 - /// - /// - /// - private void buttonItem20_Click(object sender, EventArgs e) - { - globeControl1.Globe.LatLonGrid.Visible = !globeControl1.Globe.LatLonGrid.Visible; - buttonItemSH3.Checked = globeControl1.Globe.LatLonGrid.Visible; - globeControl1.Globe.Refresh(); - } - /// - /// 状态条 菜单 - /// - /// - /// - private void buttonItem21_Click_1(object sender, EventArgs e) - { - globeControl1.Globe.StatusBar.Visible = !globeControl1.Globe.StatusBar.Visible; - buttonItemSH4.Checked = globeControl1.Globe.StatusBar.Visible; - globeControl1.Globe.Refresh(); - } - - + /// /// 添加指定路径下的数据 功能 /// @@ -5680,43 +5298,7 @@ // } // return objRes; //} - /// - /// 刷新目录树 功能 - /// - private void RefreshDataTree() - { - layerTree.Nodes[0].Nodes.Clear(); - Int32 nCount = globeControl1.Globe.DataManager.DataSourceCount; - Int32 i = 0; - for (i = 0; i < nCount; i++) - { - GSODataSource dataSpace = globeControl1.Globe.DataManager[i]; - TreeNode node = new TreeNode(); - node.Text = dataSpace.Name; - node.ImageIndex = 0; - node.SelectedImageIndex = 0; - node.Checked = true; - node.Tag = dataSpace; - Int32 nDatasetCount = dataSpace.DatasetCount; - for (Int32 j = 0; j < nDatasetCount; j++) - { - GSODataset dataset = dataSpace[j]; - TreeNode subNode = new TreeNode(); - subNode.Text = dataset.Name; - subNode.ImageIndex = 0; - subNode.SelectedImageIndex = 0; - subNode.Checked = true; - subNode.Tag = dataset; - node.Nodes.Add(subNode); - } - layerTree.Nodes[0].Nodes.Add(node); - } - } - - - - - + /// /// 复合查询 菜单 @@ -5777,34 +5359,7 @@ return false; } - /// - /// 统计指定图层在指定范围内的所有feature对象 - /// - /// - /// - /// - private GSOFeatures Intersect_PointLayer(GSOGeoPolygon3D polygon, string pointLayerName) - { - GSOLayer layer = globeControl1.Globe.Layers.GetLayerByCaption(pointLayerName); - if (layer == null) - return null; - - GSOFeatureLayer flayer = layer as GSOFeatureLayer; - GSOFeatureDataset fdataset = flayer.Dataset as GSOFeatureDataset; - GSOFeatures feats; - if (polygon == null) - { - feats = flayer.GetAllFeatures(); - } - else - { - feats = flayer.FindFeaturesInPolygon(polygon, false); - } - - workWellLen.Add(pointLayerName, feats.Length); - return feats; - } - /// + /// /// 碰撞分析功能界面中 选择管线复选框 选中状态改变事件处理 /// /// @@ -5946,16 +5501,6 @@ MessageBox.Show("表格内容为空!", "提示"); } } - /// - /// 导出CAD 菜单 - /// - /// - /// - private void btnExportCAD_Click(object sender, EventArgs e) - { - FrmExportCADS frm = new FrmExportCADS(globeControl1, m_PipelineLayerNames); - frm.ShowDialog(); - } ///// ///// 区域分析 菜单 @@ -5987,16 +5532,6 @@ } } } - /// - /// 数据验证 菜单 - /// - /// - /// - private void buttonItem80_Click(object sender, EventArgs e) - { - FrmValiData frm = new FrmValiData(globeControl1); - frm.ShowDialog(); - } /// /// 根据指定图层创建图层节点并将节点添加到图层管理节点的子节点集合中 @@ -6018,56 +5553,7 @@ layerManagerNode.Expand(); } } - /// - /// 数据库备份 菜单 - /// - /// - /// - private void btnBackDatabase_Click(object sender, EventArgs e) - { - if (MessageBox.Show("是否确定要备份数据库文件", "信息", MessageBoxButtons.YesNo, MessageBoxIcon.Question) == DialogResult.Yes) - { - try - { - DateTime currentTime = DateTime.Now; - //string Dtime = currentTime.ToShortDateString().ToString("yyyy-MM-dd"); - string Dtime = currentTime.GetDateTimeFormats('D')[0].ToString(); - string Htime = DateTime.Now.ToString("HH时mm分ss秒").Trim(); - string fileName = Dtime + "(" + Htime + ")"; - string pathName = ""; - string sql = "select filename from master..sysdatabases where name='" + Utility.dbdatabase + "'"; - DataTable dt = OledbHelper.ExecuteDataTable(sql); - if (dt != null && dt.Rows.Count > 0) - { - pathName = dt.Rows[0][0].ToString().Trim(); - int count = pathName.LastIndexOf("\\") == -1 ? pathName.LastIndexOf("/") : pathName.LastIndexOf("\\"); - pathName = pathName.Substring(0, count); - } - pathName += "\\管网数据库" + fileName + ".bak"; - - OracleCommand cmdBK = new OracleCommand(); - cmdBK.CommandType = CommandType.Text; - cmdBK.Connection = connBackup; - cmdBK.CommandText = @"backup database " + Utility.dbdatabase + " to disk='" + pathName + "' with init"; - - connBackup.Open(); - cmdBK.ExecuteNonQuery(); - MessageBox.Show("数据库文件备份成功", "提示"); - } - catch (Exception ex) - { - MessageBox.Show(ex.ToString()); - } - finally - { - connBackup.Close(); - } - } - } - - - - + //GSOFeature emitterFeature; // 粒子要素 /// /// 添加火苗 功能 @@ -6598,361 +6084,15 @@ } } - - ///// - /// 添加用户仓库 菜单 - /// - /// - /// - private void buttonItem108_Click(object sender, EventArgs e) - { - FrmUserRepo frm = new FrmUserRepo(-1); - frm.ShowDialog(); - } - /// - /// 用户仓库管理 菜单 - /// - /// - /// - private void buttonItem111_Click(object sender, EventArgs e) - { - FrmUserRepoMgr frm = new FrmUserRepoMgr(); - frm.ShowDialog(); - } - /// - /// 添加分系统 菜单 - /// - /// - /// - private void buttonItem112_Click(object sender, EventArgs e) - { - //FrmAPP frm = new FrmAPP(-1); - //frm.ShowDialog(); - } - /// - /// 分系统管理 菜单 - /// - /// - /// - private void buttonItem113_Click(object sender, EventArgs e) - { - //FrmAPPMgr frm = new FrmAPPMgr(); - //frm.ShowDialog(); - } - /// - /// 添加操作 菜单 - /// - /// - /// - private void buttonItem114_Click(object sender, EventArgs e) - { - FrmOper frm = new FrmOper(-1); - frm.ShowDialog(); - } - /// - /// 操作管理 菜单 - /// - /// - /// - private void buttonItem115_Click(object sender, EventArgs e) - { - FrmOperMgr frm = new FrmOperMgr(); - frm.ShowDialog(); - } - /// - /// 添加资源 菜单 - /// - /// - /// - private void buttonItem116_Click(object sender, EventArgs e) - { - FrmRESC frm = new FrmRESC(-1); - frm.ShowDialog(); - } - /// - /// 资源管理 菜单 - /// - /// - /// - private void buttonItem117_Click(object sender, EventArgs e) - { - FrmRESCMgr frm = new FrmRESCMgr(); - frm.ShowDialog(); - } - /// - /// 添加权限 菜单 - /// - /// - /// - private void buttonItem118_Click(object sender, EventArgs e) - { - FrmPerm frm = new FrmPerm(-1); - frm.ShowDialog(); - } - /// - /// 权限管理 菜单 - /// - /// - /// - private void buttonItem119_Click(object sender, EventArgs e) - { - FrmPermMgr frm = new FrmPermMgr(); - frm.ShowDialog(); - } - /// - /// 添加访问控制 菜单 - /// - /// - /// - private void buttonItem120_Click(object sender, EventArgs e) - { - FrmAccess frm = new FrmAccess(-1); - frm.ShowDialog(); - } - /// - /// 访问控制管理 菜单 - /// - /// - /// - private void buttonItem121_Click(object sender, EventArgs e) - { - FrmAccessMgr frm = new FrmAccessMgr(); - frm.ShowDialog(); - } - /// - /// 部门类型管理 菜单 - /// - /// - /// - private void buttonItem122_Click(object sender, EventArgs e) - { - FrmRegionTypeMgr frm = new FrmRegionTypeMgr(); - frm.ShowDialog(); - } - /// - /// 用户信息管理 菜单 - /// - /// - /// - private void buttonItem128_Click_1(object sender, EventArgs e) - { - FrmUserManager frm = new FrmUserManager(); - frm.ShowDialog(); - } - /// - /// 添加角色 菜单 - /// - /// - /// - private void 添加角色_Click(object sender, EventArgs e) - { - FrmRole frm = new FrmRole(-1); - frm.ShowDialog(); - } - /// - /// 所有角色管理 菜单 - /// - /// - /// - private void 角色管理_Click(object sender, EventArgs e) - { - FrmRoleMgr frm = new FrmRoleMgr(); - frm.ShowDialog(); - } - - /// - /// 部门角色管理 菜单 - /// - /// - /// - private void buttonItem133_Click(object sender, EventArgs e) - { - FrmRegionRoleMgr frm = new FrmRegionRoleMgr(); - frm.ShowDialog(); - } - /// - /// 部门管理 菜单 - /// - /// - /// - private void buttonItem130_Click(object sender, EventArgs e) - { - FrmRegionMgr frm = new FrmRegionMgr(); - frm.ShowDialog(); - } - - /// - /// 日志管理 菜单 - /// - /// - /// - private void buttonItem135_Click(object sender, EventArgs e) - { - FrmLogManager frm = new FrmLogManager(); - frm.ShowDialog(); - } - /// - /// 传感器信息查询 菜单 - /// - /// - /// - private void buttonItem131_Click_1(object sender, EventArgs e) - { - GSOFeature selectedFeature = globeControl1.Globe.SelectedObject; - if (selectedFeature == null) - { - MessageBox.Show("请选择一个传感器对象!", "提示", MessageBoxButtons.OK, MessageBoxIcon.Information); - } - else - { - if (selectedFeature.Geometry != null && selectedFeature.Geometry.Type == EnumGeometryType.GeoModel) - { - GSOLayer layer = globeControl1.Globe.SelectedObjectLayer; - string tabelName = getTableName(layer.Caption); - string eqtID = selectedFeature.Description.Trim(); - if (tabelName != "" && eqtID != "") - { - string fields = getFields(tabelName); - if (fields != "") - { - string sql = "select " + fields + " from " + Utility.sensorDatabase + "." + tabelName + " where EqtID=" + eqtID + " order by RecordDate desc limit 1;"; - DataTable dt = MySqlHelper.queryDataTable(sql); - if (dt != null && dt.Rows.Count > 0) - { - FrmQueryMessage.ShowForm(this, dt, layer.Caption); - //queryMessage.Show(this); - } - else - { - MessageBox.Show("没有查询到相关信息!", "提示"); - } - } - else - { - MessageBox.Show("配置文件 \"sensorConfig.xml\" 有误!", "提示"); - } - } - else - { - MessageBox.Show("请选择一个传感器对象!", "提示"); - } - } - else - { - MessageBox.Show("请选择一个传感器对象!", "提示", MessageBoxButtons.OK, MessageBoxIcon.Information); - } - } - } - /// - /// 根据指定的图层的caption属性的值在配置文件中查找对应的数据库中的表的名称 - /// - /// 图层的caption属性的值 - /// 对应的数据库中的表的名称 - private string getTableName(string name) - { - string tabelName = ""; - if (Utility.sensorMarkerLayers != null) - { - for (int i = 0; i < Utility.sensorMarkerLayers.Count; i++) - { - MarkerLayer mLayer = Utility.sensorMarkerLayers[i]; - if (mLayer.layerName == name) - { - tabelName = mLayer.tableName; - break; - } - } - } - return tabelName; - } - /// - /// 根据数据库中的表的名称 查找对应的表中的字段名称的集合 - /// - /// 数据库中的表的名称 - /// 对应的表中的字段名称的集合 - private string getFields(string tabelName) - { - string fields = ""; - if (Utility.sensorMarkerLayers != null) - { - for (int i = 0; i < Utility.sensorMarkerLayers.Count; i++) - { - MarkerLayer mLayer = Utility.sensorMarkerLayers[i]; - if (mLayer.tableName.Trim() == tabelName.Trim()) - { - if (mLayer.fields != null) - { - foreach (string key in mLayer.fields.Keys) - { - string value = mLayer.fields[key]; - fields += tabelName.Trim() + "." + key + " as " + value + ","; - } - fields = fields.Remove(fields.Length - 1); - } - break; - } - } - } - return fields; - } - - /// - /// 历史曲线查询 菜单 - /// - /// - /// - private void buttonItem132_Click(object sender, EventArgs e) - { - GSOFeature selectedFeature = globeControl1.Globe.SelectedObject; - if (selectedFeature == null) - { - MessageBox.Show("请选择一个对象!", "提示", MessageBoxButtons.OK, MessageBoxIcon.Information); - } - else - { - if (selectedFeature.Geometry != null && selectedFeature.Geometry.Type == EnumGeometryType.GeoModel) - { - GSOLayer layer = globeControl1.Globe.SelectedObjectLayer; - string tabelName = getTableName(layer.Caption); - string eqtID = selectedFeature.Description; - if (tabelName != "" && eqtID != "") - { - FrmQueryHistory.ShowForm(this, tabelName, eqtID); - } - else - { - MessageBox.Show("请选择一个传感器对象!", "提示"); - } - } - else - { - MessageBox.Show("请选择一个传感器对象!", "提示", MessageBoxButtons.OK, MessageBoxIcon.Information); - } - } - } - + //定时检查传感器的状态 public System.Windows.Forms.Timer timerOfSensor = null; public int alarmValueLiuLiang = 0; public int alarmValueYaLi = 0; public int alarmValueYeTi = 0; public int alarmValueZaoSheng = 0; - /// - /// 传感器在线报警 菜单 - /// - /// - /// - private void buttonItem134_Click(object sender, EventArgs e) - { - if (timerOfSensor == null) - { - timerOfSensor = new System.Windows.Forms.Timer(); - timerOfSensor.Interval = 30000; - timerOfSensor.Tick += new EventHandler(timerOfSensor_Tick); - } - FrmQuerySensorAlarm.ShowForm(this); - } + /// /// 传感器报警 功能中的 定时器 的触发事件处理 /// @@ -7016,6 +6156,7 @@ } catch (Exception ex) { + LogHelper.WriteLog(typeof(MainFrm), ex.Message); continue; } } @@ -7025,145 +6166,7 @@ } } - - /// - /// 沿线运动 菜单 - /// - /// - /// - private void buttonItem138_Click(object sender, EventArgs e) - { - if (globeControl1.Globe.SelectedObject == null) - { - MessageBox.Show("请先选择一条线!", "提示", MessageBoxButtons.OK, MessageBoxIcon.Exclamation); - return; - } - - GSOFeature lineFeature = globeControl1.Globe.SelectedObject; - if (lineFeature.Geometry == null || lineFeature.Geometry.Type != EnumGeometryType.GeoPolyline3D) - { - MessageBox.Show("请先选择一条线!", "提示", MessageBoxButtons.OK, MessageBoxIcon.Exclamation); - return; - } - - OpenFileDialog dlg = new OpenFileDialog(); - dlg.Filter = "*.gcm;*.3ds|*.gcm;*.3ds|*.3ds|*.3ds|*.gcm|*.gcm"; - if (dlg.ShowDialog() == DialogResult.OK) - { - GSOGeoModel model = new GSOGeoModel(); - model.FilePath = dlg.FileName; - - GSOGeoDynamicRoute dynamicRoute = new GSOGeoDynamicRoute(); - dynamicRoute.ActorGeometry = model; - - GSORoute route = new GSORoute(); - GSOGeoPolyline3D geoline = (GSOGeoPolyline3D)lineFeature.Geometry; - for (int i = 0; i < geoline[0].Count; i++) - { - route.Add(geoline[0][i]); - } - route.CircleRoute = false; - route.Speed = 30; - route.RotateSpeed = 50; - route.AltitudeMode = geoline.AltitudeMode; - dynamicRoute.Route = route; - - GSOFeature feature = new GSOFeature(); - - dynamicRoute.Play(); - feature.Geometry = dynamicRoute; - - //GSOLabel gsoLabel = new GSOLabel(); - //gsoLabel.Text = "模型测试"; - //feature.Label = gsoLabel; - globeControl1.Globe.MinModelVisibleSize = 0; - - globeControl1.Globe.MemoryLayer.AddFeature(feature); - globeControl1.Globe.Refresh(); - } - } - /// - /// 回退 菜单 - /// - /// - /// - private void buttonItem99_Click(object sender, EventArgs e) - { - globeControl1.Globe.UnDoEdit(); - } - /// - /// 前进 菜单 - /// - /// - /// - private void buttonItem100_Click(object sender, EventArgs e) - { - globeControl1.Globe.ReDoEdit(); - } - /// - /// 水平净距 功能界面中的 标签内容改变事件处理 - /// - /// - /// - private void textBoxX4_TextChanged(object sender, EventArgs e) - { - string valueJingJu = textBoxX4.Text.Trim(); - if (valueJingJu != "") - { - double value = 0; - bool bl = double.TryParse(valueJingJu, out value); - if (bl) - { - labelX24.Text = "水平净距小于" + value.ToString() + "米的管线有:"; - } - } - } - /// - /// 垂直净距 功能界面中的 标签内容改变事件处理 - /// - /// - /// - private void textBoxX2_TextChanged(object sender, EventArgs e) - { - string valueJingJu = textBoxX2.Text.Trim(); - if (valueJingJu != "") - { - double value = 0; - bool bl = double.TryParse(valueJingJu, out value); - if (bl) - { - labelX23.Text = "垂直净距小于" + value.ToString() + "米的管线有:"; - } - } - } - /// - /// 覆土分析 功能界面中的 标签内容改变事件处理 - /// - /// - /// - private void textBoxX3_TextChanged(object sender, EventArgs e) - { - string valueJingJu = textBoxX3.Text.Trim(); - if (valueJingJu != "") - { - double value = 0; - bool bl = double.TryParse(valueJingJu, out value); - if (bl) - { - labelX17.Text = "覆土深度小于" + value.ToString() + "米的管线有:"; - } - } - } - - /// - /// 传感器分类查询 全区域 菜单 - /// - /// - /// - private void buttonItemSensor全区域查询_Click(object sender, EventArgs e) - { - FrmAccessoriesSensor.ShowForm(globeControl1, instrumenLayerNames, 0); - } + /// /// 传感器分类查询 绘制区域 菜单 /// @@ -7224,170 +6227,10 @@ layerTemp.RemoveAllFeature(); globeControl1.Refresh(); } - /// - /// 数字预处理 功能 - /// - /// - /// - private void 数字预处理buttonItem140_Click(object sender, EventArgs e) - { - FrmEditShapeFile frm = new FrmEditShapeFile(globeControl1); - frm.ShowDialog(this); - } - - - /// - /// 导出矢量 功能 将图层导出为kml和shp格式数据 - /// - /// - /// - private void 导出矢量buttonItem140_Click(object sender, EventArgs e) - { - /* - List m_PipelineLayerNames = new List();//线图层名称 - List workwellLayerNames = new List();//工井图层名称 - List valueLayerNames = new List();//阀门图层名称 - List instrumenLayerNames = new List();//附属物图层名称 - List pipefittingLayerNames = new List();//管件图层名称 - */ - List listVectorNames = new List(); - for (int i = 0; i < m_PipelineLayerNames.Count; i++) - { - if (m_PipelineLayerNames[i] == "移动" || m_PipelineLayerNames[i] == "联通" - || m_PipelineLayerNames[i] == "电信" || m_PipelineLayerNames[i] == "共通" - || m_PipelineLayerNames[i] == "有限电视" || m_PipelineLayerNames[i] == "交通信号" - || m_PipelineLayerNames[i] == "供电") - { - continue; - } - if (listVectorNames.Contains(m_PipelineLayerNames[i]) == false) - { - listVectorNames.Add(m_PipelineLayerNames[i]); - } - } - for (int i = 0; i < valueLayerNames.Count; i++) - { - if (listVectorNames.Contains(valueLayerNames[i]) == false) - { - listVectorNames.Add(valueLayerNames[i]); - } - } - for (int i = 0; i < workwellLayerNames.Count; i++) - { - if (listVectorNames.Contains(workwellLayerNames[i]) == false) - { - listVectorNames.Add(workwellLayerNames[i]); - } - } - for (int i = 0; i < instrumenLayerNames.Count; i++) - { - if (listVectorNames.Contains(instrumenLayerNames[i]) == false) - { - listVectorNames.Add(instrumenLayerNames[i]); - } - } - for (int i = 0; i < pipefittingLayerNames.Count; i++) - { - if (listVectorNames.Contains(pipefittingLayerNames[i]) == false) - { - listVectorNames.Add(pipefittingLayerNames[i]); - } - } - FrmExportVector frm = new FrmExportVector(globeControl1, listVectorNames); - frm.ShowDialog(); - } string citySevenLineType = ""; string cityServerLineName = ""; /// - /// 绘制城市七线 功能按钮 - /// - /// - /// - private void 绘制城市七线buttonItem140_Click(object sender, EventArgs e) - { - FrmCitySevenLineType frm = new FrmCitySevenLineType(); - if (frm.ShowDialog() == DialogResult.OK) - { - globeControl1.Globe.Action = EnumAction3D.DrawPolyline; - m_isDrawCitySevenLine = true; - m_isDrawTunnel = false; - m_AddPipeLine = false; - this.citySevenLineType = frm.citySevenLineType; - this.cityServerLineName = frm.citySevenLineName; - switch (frm.citySevenLineType) - { - case "城市红线": - GSOLayer layerRed = globeControl1.Globe.Layers.GetLayerByCaption(frm.citySevenLineType); - if (layerRed != null) - { - globeControl1.Globe.DestLayerFeatureAdd = layerRed; - layerRed.Editable = true; - } - break; - case "城市橙线": - GSOLayer layerOrange = globeControl1.Globe.Layers.GetLayerByCaption(frm.citySevenLineType); - if (layerOrange != null) - { - globeControl1.Globe.DestLayerFeatureAdd = layerOrange; - layerOrange.Editable = true; - } - break; - case "城市黄线": - GSOLayer layerYellow = globeControl1.Globe.Layers.GetLayerByCaption(frm.citySevenLineType); - if (layerYellow != null) - { - globeControl1.Globe.DestLayerFeatureAdd = layerYellow; - layerYellow.Editable = true; - } - break; - case "城市绿线": - GSOLayer layerGreen = globeControl1.Globe.Layers.GetLayerByCaption(frm.citySevenLineType); - if (layerGreen != null) - { - globeControl1.Globe.DestLayerFeatureAdd = layerGreen; - layerGreen.Editable = true; - } - break; - case "城市蓝线": - GSOLayer layerBlue = globeControl1.Globe.Layers.GetLayerByCaption(frm.citySevenLineType); - if (layerBlue != null) - { - globeControl1.Globe.DestLayerFeatureAdd = layerBlue; - layerBlue.Editable = true; - } - break; - case "城市紫线": - GSOLayer layerPurple = globeControl1.Globe.Layers.GetLayerByCaption(frm.citySevenLineType); - if (layerPurple != null) - { - globeControl1.Globe.DestLayerFeatureAdd = layerPurple; - layerPurple.Editable = true; - } - break; - case "城市黑线": - GSOLayer layerBlack = globeControl1.Globe.Layers.GetLayerByCaption(frm.citySevenLineType); - if (layerBlack != null) - { - globeControl1.Globe.DestLayerFeatureAdd = layerBlack; - layerBlack.Editable = true; - } - break; - } - } - } - /// - /// 七线审核 功能按钮 - /// - /// - /// - private void 七线审核buttonItem141_Click(object sender, EventArgs e) - { - FrmCityServerLineAnalysis frm = new FrmCityServerLineAnalysis(globeControl1, m_PipelineLayerNames); - frm.ShowDialog(this); - } - - /// /// 间距分析 开始分析按钮 分析绘制的七线和管线的距离是否符合标准 /// /// @@ -7666,25 +6509,6 @@ } } - - - /// - /// 管线自动缩进 菜单 - /// - /// - /// - private void 管线自动缩进buttonItem140_Click(object sender, EventArgs e) - { - FrmPipelineIndented frm = new FrmPipelineIndented(globeControl1, m_PipelineLayerNames, workwellLayerNames); - frm.ShowDialog(this); - } - - private void btnExportCADs_Click(object sender, EventArgs e) - { - - } - - /// /// 统计指定图层在指定范围内的所有feature对象 /// @@ -7755,8 +6579,6 @@ } - - //设置图层为隐藏 private void setLayerVisible(string layerName) { @@ -7765,27 +6587,7 @@ globeControl1.Globe.Refresh(); } - /// - /// 连接数据库 - /// - /// - /// - private void buttonItem129_Click(object sender, EventArgs e) - { - //保存日志 - LogManager.saveLog(Utility.userName, this.buttonItemSJGL4_1.Text); - - FrmDatabaseParaSetting2 frm = new FrmDatabaseParaSetting2(globeControl1); - if (frm.ShowDialog() == DialogResult.OK) - { - ds = FrmDatabaseParaSetting2.ds; - if (ds != null) - { - ds.IsCloseSaved = false; - } - } - } - + /// /// 清除渲染结果 /// @@ -7803,112 +6605,8 @@ layerTemp.RemoveAllFeature(); globeControl1.Refresh(); } - - /// - /// 绘制垂线 - /// - /// - /// - private void drawCLine(GSOPoint3d fpt, GSOPoint3d tpt) - { - GSOGeoPolyline3D pline = new GSOGeoPolyline3D(); - GSOPoint3ds pts = new GSOPoint3ds(); - pts.Add(fpt); - pts.Add(tpt); - pline.AddPart(pts); - - GSOGeoPoint3D fptg = new GSOGeoPoint3D(); - GSOGeoPoint3D tptg = new GSOGeoPoint3D(); - fptg.X = fpt.X; - fptg.Y = fpt.Y; - fptg.Z = 0; - tptg.X = tpt.X; - tptg.Y = tpt.Y; - tptg.Z = 0; - - GSOFeature gf = new GSOFeature(); - gf.Geometry = pline; - - globeControl1.Globe.MemoryLayer.AddFeature(gf); - - } - /// - /// 红线审核 - /// - /// - /// - private void buttonItem138_Click_2(object sender, EventArgs e) - { - - } - /// - /// 比较两个点是否是同一个点 - /// - /// - /// - /// - private bool comparePoint(GSOPoint3d pt1, GSOPoint3d pt2) - { - double x1 = 0; double y1 = 0; - double x2 = 0; double y2 = 0; - x1 = pt1.X; - y1 = pt1.Y; - x2 = pt2.X; - y2 = pt2.Y; - if ((x1 == x2) && (y1 == y2)) - { - return true; - } - return false; - } - /// - /// 获得点到线的垂线距离及垂点 - /// - /// - /// - /// - /// - private void comparePointLine(GSOPoint3d point, GSOGeoPolyline3D line, out double length, out GSOPoint3d pointChuiDian) - { - GSOPoint3d lineStartPoint = line[0][0]; - GSOPoint3d lineEndPoint = line[0][1]; - GSOGeoPolyline3D lineAB = new GSOGeoPolyline3D(); - GSOPoint3ds pointsAB = new GSOPoint3ds(); - pointsAB.Add(point); - pointsAB.Add(lineStartPoint); - lineAB.AddPart(pointsAB); - double lengthAB = lineAB.GetSpaceLength(false, 6378137.0); - double xieLvAB = getXieLu("", point.X, point.Y, lineStartPoint.X, lineStartPoint.Y); - double xieLvBC = getXieLu("", lineStartPoint.X, lineStartPoint.Y, lineEndPoint.X, lineEndPoint.Y); - - double tanABC = Math.Abs(xieLvAB - xieLvBC) / (1 + xieLvAB * xieLvBC); - double angle = Math.Atan(tanABC); - //if (angle > Math.PI / 2) //落在外边 - //{ - // length = 0; - //} - double lengthAD = lengthAB * Math.Sin(angle); - length = Math.Abs(lengthAD); - double lengthBD = lengthAB * Math.Cos(angle); - - GSOPoint2d point2dStart = Latlon_2_XYZ(lineStartPoint.X, lineStartPoint.Y); - double bBC = point2dStart.Y - xieLvBC * point2dStart.X; - GSOPoint2d point2dEnd = new GSOPoint2d(); - point2dEnd.X = point2dStart.X + 100; - point2dEnd.Y = point2dEnd.X * xieLvBC + bBC; - point2dEnd = XYZ_2_Latlon(point2dEnd.X, point2dEnd.Y); - - GSOPoint3d pointEnd = new GSOPoint3d(); - pointEnd.X = point2dEnd.X; - pointEnd.Y = point2dEnd.Y; - GSOGeoPolyline3D lineYanShen = new GSOGeoPolyline3D(); - GSOPoint3ds pointsYanShen = new GSOPoint3ds(); - pointsYanShen.Add(lineStartPoint); - pointsYanShen.Add(pointEnd); - lineYanShen.AddPart(pointsYanShen); - GSOGeoPolyline3D lineSegment = lineYanShen.GetSegment(0, lengthBD); - pointChuiDian = lineSegment[0][1]; - } + + /// /// 获得斜率 /// @@ -8044,255 +6742,6 @@ } /// - /// 获取与点相连的所有线以及线的点的集合 - /// - /// 选定的点所在的线 - /// 选定的点 - /// 面中不完全包含的除起点线之外所有的线 - /// 选定的点所在的点的集合 - /// 所有以选定线为起点的点的集合 - /// - private List getFeaturesPoints(GSOFeature featureSelect, GSOPoint3d lineStart, GSOFeatures selectFeatures, GSOPoint3ds ps, List listPS) - { - GSOFeatures fsStart = new GSOFeatures(); - for (int n = 0; n < selectFeatures.Length; n++) - { - if (featureSelect.ID == selectFeatures[n].ID) - { - continue; - } - GSOGeoPolyline3D newLine = selectFeatures[n].Geometry as GSOGeoPolyline3D; - if (newLine != null && newLine.PartCount > 0) - { - GSOPoint3d newLineStart = newLine[0][0]; - GSOPoint3d newLineEnd = newLine[0][newLine[0].Count - 1]; - if (lineStart.X == newLineEnd.X && lineStart.Y == newLineEnd.Y) - { - GSOPoint3ds psAdd = new GSOPoint3ds(); - for (int k = newLine[0].Count - 1; k >= 0; k--) - { - psAdd.Add(newLine[0][k]); - } - newLine[0] = psAdd; - fsStart.Add(selectFeatures[n]); - - } - else if (lineStart.X == newLineStart.X && lineStart.Y == newLineStart.Y) - { - fsStart.Add(selectFeatures[n]); - - } - } - } - if (fsStart.Length > 0) - { - for (int m = 0; m < fsStart.Length; m++) - { - GSOGeoPolyline3D lineFsStart = fsStart[m].Geometry as GSOGeoPolyline3D; - if (lineFsStart != null && lineFsStart.PartCount > 0) - { - GSOPoint3ds psAdd = ps.Clone(); - for (int k = 0; k < lineFsStart[0].Count; k++) - { - psAdd.Add(lineFsStart[0][k]); - } - listPS = getFeaturesPoints(fsStart[m], lineFsStart[0][lineFsStart[0].Count - 1], selectFeatures, psAdd, listPS); - } - } - } - else - { - listPS.Add(ps); - } - return listPS; - } - - /// - /// 获取切割面的线 - /// - /// 不完全包含在面中的所有线 - /// 完全包含在面中的所有线 - /// 线 - private GSOFeature getLineFromGSOFeatures(GSOFeatures features, GSOFeatures featuresTrue) - { - //1. 当线对象数组的长度为0时,返回空 - if (features.Length == 0) - { - return null; - } - //2. 当线对象数组的长度为1时,返回这条线 - if (features.Length == 1) - { - return features[0]; - } - //3. 当线对象数组的长度大于1时,计算所有线组成的最长线 - - //3.1 获取所有不完全包含在面中的对象selectFeatures - GSOFeatures selectFeatures = new GSOFeatures(); - for (int a = 0; a < features.Length; a++) - { - selectFeatures.Add(features[a].Clone()); - } - //3.2 删除features中完全包含在面中的线,获取和面的边界相交的线对象 - for (int a = 0; a < featuresTrue.Length; a++) - { - for (int b = 0; b < features.Length; b++) - { - if (featuresTrue[a].ID == features[b].ID) - { - features.Remove(b); - break; - } - } - } - //3.3 如果和面的边界相交的线的数量为0,返回空 - if (features.Length == 0) - { - return null; - } - //3.4 获取第一条和面的边界相交的线featureInOutPolygon - GSOFeature featureInOutPolygon = features[0]; - //3.5 从所有的线中删除featureInOutPolygon - for (int a = 0; a < selectFeatures.Length; a++) - { - if (selectFeatures[a].ID == featureInOutPolygon.ID) - { - selectFeatures.Remove(a); - break; - } - } - //listPS存储所有从featureInOutPolygon出发的点的集合 - List listPS = new List(); - //3.5 获取与featureInOutPolygon相连的线的集合 - GSOGeoPolyline3D line = featureInOutPolygon.Geometry as GSOGeoPolyline3D; - if (line != null && line.PartCount > 0) - { - GSOPoint3d lineStart = line[0][0]; - GSOPoint3d lineEnd = line[0][line[0].Count - 1]; - #region//获取和featureInOutPolygon的起点相连的线 - GSOFeatures fsStart = new GSOFeatures(); - for (int n = 0; n < selectFeatures.Length; n++) - { - GSOGeoPolyline3D newLine = selectFeatures[n].Geometry as GSOGeoPolyline3D; - if (newLine != null && newLine.PartCount > 0) - { - GSOPoint3d newLineStart = newLine[0][0]; - GSOPoint3d newLineEnd = newLine[0][newLine[0].Count - 1]; - if (lineStart.X == newLineEnd.X && lineStart.Y == newLineEnd.Y) - { - GSOPoint3ds psAdd = new GSOPoint3ds(); - for (int k = newLine[0].Count - 1; k >= 0; k--) - { - psAdd.Add(newLine[0][k]); - } - newLine[0] = psAdd; - fsStart.Add(selectFeatures[n]); - - } - else if (lineStart.X == newLineStart.X && lineStart.Y == newLineStart.Y) - { - fsStart.Add(selectFeatures[n]); - } - } - } - #endregion - - #region//获取和featureInOutPolygon的终点相连的线 - GSOFeatures fsEnd = new GSOFeatures(); - for (int n = 0; n < selectFeatures.Length; n++) - { - GSOGeoPolyline3D newLine = selectFeatures[n].Geometry as GSOGeoPolyline3D; - if (newLine != null && newLine.PartCount > 0) - { - GSOPoint3d newLineStart = newLine[0][0]; - GSOPoint3d newLineEnd = newLine[0][newLine[0].Count - 1]; - if (lineEnd.X == newLineStart.X && lineEnd.Y == newLineStart.Y) - { - fsEnd.Add(selectFeatures[n]); - - } - else if (lineEnd.X == newLineEnd.X && lineEnd.Y == newLineEnd.Y) - { - GSOPoint3ds psAdd = new GSOPoint3ds(); - for (int k = newLine[0].Count - 1; k >= 0; k--) - { - psAdd.Add(newLine[0][k]); - } - newLine[0] = psAdd; - fsEnd.Add(selectFeatures[n]); - - } - } - } - #endregion - - //3.6 将featureInOutPolygon的所有点和与之起点相连的线的所有点组成一个点的集合并添加到listPS中 - if (fsStart.Length > 0 && fsEnd.Length == 0) - { - for (int m = 0; m < fsStart.Length; m++) - { - GSOGeoPolyline3D lineFsStart = fsStart[m].Geometry as GSOGeoPolyline3D; - if (lineFsStart != null && lineFsStart.PartCount > 0) - { - GSOPoint3ds psAdd = new GSOPoint3ds(); - for (int k = line[0].Count - 1; k >= 0; k--) - { - psAdd.Add(line[0][k]); - } - for (int k = 0; k < lineFsStart[0].Count; k++) - { - psAdd.Add(lineFsStart[0][k]); - } - - listPS = getFeaturesPoints(fsStart[m], lineFsStart[0][lineFsStart[0].Count - 1], selectFeatures, psAdd, listPS); - - } - } - } - //3.6 将featureInOutPolygon的所有点和与之终点相连的线的所有点组成一个点的集合并添加到listPS中 - else if (fsStart.Length == 0 && fsEnd.Length > 0) - { - for (int n = 0; n < fsEnd.Length; n++) - { - GSOGeoPolyline3D lineFsEnd = fsEnd[n].Geometry as GSOGeoPolyline3D; - if (lineFsEnd != null && lineFsEnd.PartCount > 0) - { - GSOPoint3ds psAdd = new GSOPoint3ds(); - for (int k = 0; k < line[0].Count - 1; k++) - { - psAdd.Add(line[0][k]); - } - for (int k = 0; k < lineFsEnd[0].Count; k++) - { - psAdd.Add(lineFsEnd[0][k]); - } - //获取线fsEnd[n]的另一个端点相连的线并记录该线的点的集合 - listPS = getFeaturesPoints(fsEnd[n], lineFsEnd[0][lineFsEnd[0].Count - 1], selectFeatures, psAdd, listPS); - } - } - } - } - - //3.7 获取所有以featureInOutPolygon为起点的点的集合组成的线中的最长的线 - double maxLength = 0; - GSOFeature featureNew = new GSOFeature(); - for (int h = 0; h < listPS.Count; h++) - { - GSOGeoPolyline3D lineNew = new GSOGeoPolyline3D(); - lineNew.AddPart(listPS[h]); - GSOLabel label = new GSOLabel(); - label.Text = h.ToString(); - featureNew.Label = label; - double length = lineNew.GetSpaceLength(true, 6378137); - if (length > maxLength) - { - featureNew.Geometry = lineNew; - } - } - - return featureNew; - } - /// /// 更新最大最小状态 /// /// @@ -8340,219 +6789,6 @@ - private void buttonItem139_Click(object sender, EventArgs e) - { - - string filepath = ""; - //日志记录 - OpenFileDialog dlg = new OpenFileDialog(); - dlg.Filter = "矢量数据(*.shp)|*.shp|矢量数据(*.lgd)|*.lgd|全部支持格式(*.lgd,*.shp)|*.lgd;*.shp;"; - //dlg.Filter = "支持格式(*.lrp,*.tif,*.img,*.lrc,*.kml,*.lgd,*.shp,*.gft)|*.lrp;*.tif;*.img;*.lrc;*.kml;*.lgd;*.shp;*.gft|栅格数据(*.lrp)|*.lrp|栅格缓存(*.lrc)|*.lrc|KML数据(*.kml)|*.kml|矢量数据(*.lgd)|*.lgd|矢量缓存(*.gft)|*.gft|其它格式(*.*)|*.*||"; - dlg.Multiselect = true; - if (dlg.ShowDialog() == DialogResult.OK) - { - //自定义lprj文件名,从程序中复制一lprj文件。 - int bindex = dlg.FileName.Split('\\').Length; - string lastname = dlg.FileName.Split('\\')[bindex - 1]; - - for (int i = 0; i < dlg.FileNames.Length; i++) - { - string strDataPath = dlg.FileNames[i]; - filepath = strDataPath; - - GSOLayer layer = globeControl1.Globe.Layers.Add(strDataPath); - - } - - } - //放大到红线 - - - // globeControl1.Globe.Layers.MoveTo(0, globeControl1.Globe.Layers.Count - 1); - // globeControl1.Globe.Layers.MoveTo(0,4); - globeControl1.Refresh(); - - - } - /// - /// - /// - /// - /// - private void buttonItem142_Click(object sender, EventArgs e) - { - //获得红线polygon - //GSOLayer layerSevenLine = globeControl1.Globe.Layers.GetLayerByCaption(redlinelayername); - - GSOLayer layerSevenLine = globeControl1.Globe.Layers.Add("D:\\data\\歌林小镇shp\\test.shp"); - //获得红线结果列表 - ArrayList rrLists = new ArrayList(); - - //if (redlinelayername != "") - { - GSOFeatures fs = layerSevenLine.GetAllFeatures(); - int len = fs.Length; - - GSOGeoPolygon3D sevenPolygon = new GSOGeoPolygon3D(); - for (int k = 0; k < len; k++) - {//多根红线 - ///////生成红线区域/////// - GSOFeature featSevenLine = layerSevenLine.GetAt(k); - GSOGeoPolyline3D sevenLine = featSevenLine.Geometry as GSOGeoPolyline3D; - - List sevenParts = new List(); - for (int i = 0; i < sevenLine.PartCount; i++) - { - sevenParts.Add(sevenLine[i]); - } - for (int i = 0; i < sevenParts.Count; i++) - { - sevenPolygon.AddPart((GSOPoint3ds)sevenParts[i]); - } - /////拼出红线多边形over////// - - } - //GSOLayer layer = globeControl1.Globe.Layers.GetLayerByCaption("天然气管线"); - - GSOLayer layer = globeControl1.Globe.Layers.Add("C:\\Users\\nn-203\\Desktop\\xiaobai\\test.lgd"); - //线切割面定义,输出用 - GSOFeatures resFeats = new GSOFeatures(); - int resultstyle = 0; - //管线切割红线区域后,面积较小的区域 - GSOGeoPolygon3D restPoly = new GSOGeoPolygon3D(); - List inpts = new List(); - if (layer != null) - { - //红线区域 - GSOFeature sevenfeature = new GSOFeature(); - sevenfeature.Geometry = sevenPolygon; - - //获取不完全包含在面中的所有线 - GSOFeatures feats = layer.FindFeaturesInPolygon(sevenPolygon, false); - //获取完全包含在面中的所有线 - GSOFeatures featsTrue = layer.FindFeaturesInPolygon(sevenPolygon, true); - //获取面中所有对象组成的切割面的长线 - GSOFeature feature = new GSOFeature(); - - feature = getLineFromGSOFeatures(feats, featsTrue);//管线多个feature拼成一个feature - - //globeControl1.Globe.MemoryLayer.AddFeature(feature); - //globeControl1.Globe.MemoryLayer.AddFeature(sevenfeature); - if (feature != null) - { - //线切割面,输出 - //feature.HighLight = true; - GSODataEngineUtility.GSLineClipPolygon(feature, sevenfeature, out resFeats, out resultstyle); - } - else - { - MessageBox.Show("没有找到切割面的线对象!"); - } - ////////////////绘制分割后的多边形/////////////// - for (int a = 0; a < resFeats.Length; a++) - { - - GSOFeature gf = resFeats[1]; - globeControl1.Globe.MemoryLayer.AddFeature(gf); - - } - } - - - } - } - - private void buttonItem143_Click(object sender, EventArgs e) - { - //获得红线polygon - GSOLayer layerSevenLine = globeControl1.Globe.Layers.Add("d:\\lineAndPolygon.lgd"); - GSOLayer layerSevenLine2 = globeControl1.Globe.Layers.GetLayerByCaption("d:\\lineAndPolygon.lgd"); - //获得红线结果列表 - ArrayList rrLists = new ArrayList(); - - - // if (redlinelayername != "") - { - GSOFeatures fs = layerSevenLine.GetAllFeatures(); - int len = fs.Length; - - GSOGeoPolyline3D linetest = new GSOGeoPolyline3D(); - GSOGeoPolygon3D sevenPolygon = new GSOGeoPolygon3D(); - - GSOFeature linefeat = fs.FindByID(2); - //linefeat.Geometry = linetest; - GSOFeature polyfeat = fs.FindByID(1); - //polyfeat.Geometry = sevenPolygon; - - //线切割面定义,输出用 - GSOFeatures resFeats = new GSOFeatures(); - int resultstyle = 0; - GSODataEngineUtility.GSLineClipPolygon(linefeat, polyfeat, out resFeats, out resultstyle); - - ////////////////绘制分割后的多边形/////////////// - for (int a = 0; a < resFeats.Length; a++) - { - - GSOFeature gf = resFeats[0]; - globeControl1.Globe.MemoryLayer.AddFeature(gf); - - } - ////把红线切成一段段的线段,获得切前的红线点集 - List redpts = new List();//切前的红线点集合 - for (int i = 0; i < linetest.PartCount; i++) - { - GSOPoint3ds partP = linetest[i]; - for (int j = 0; j < partP.Count; j++) - { - redpts.Add(partP[j]); - } - } - - List redpts2 = new List();//切前的红线点集合 - for (int i = 0; i < sevenPolygon.PartCount; i++) - { - GSOPoint3ds partP = sevenPolygon[i]; - for (int j = 0; j < partP.Count; j++) - { - redpts2.Add(partP[j]); - } - } - } - } - /// - /// 增加用户手册下载连接 - /// - /// - /// - Cyberpipe.udfiles.UpDownFile UDF = new udfiles.UpDownFile(Utility.udserviceurl); - string dir_Ok = "C:\\Users\\nn-203\\Desktop"; - private void button1_Click(object sender, EventArgs e) - { - if (folderBrowserDialog1.ShowDialog() == DialogResult.OK) //打洙?开a文?件t夹D对?话°框ò - { - dir_Ok = folderBrowserDialog1.SelectedPath; //显?示?选?择?的?文?件t夹D路·径? - - //tempstr = folderBrowserDialog1.SelectedPath; //存?储洹?选?择?的?文?件t夹D路·径? - - } - - Cyberpipe.PED_logicfile.PED_Affair.Redact_D = Utility.uploadpath + "\\SFiles\\UserHbook\\说明.docx"; - if (File.Exists(dir_Ok + "\\" + Files_Name(Cyberpipe.PED_logicfile.PED_Affair.Redact_D, 1))) - { - if (MessageBox.Show("文件夹下有同名文件,是否替换?", "提示", MessageBoxButtons.YesNo, MessageBoxIcon.Information) == DialogResult.No) ; - - } - byte[] file = UDF.Down(Cyberpipe.PED_logicfile.PED_Affair.Redact_D); - FileStream pFileSream = new FileStream(dir_Ok + "\\说明.docx", FileMode.OpenOrCreate); - pFileSream.Write(file, 0, file.Length); - pFileSream.Close(); - if (File.Exists(dir_Ok + "\\" + Files_Name(Cyberpipe.PED_logicfile.PED_Affair.Redact_D, 1)) == true) - { - MessageBox.Show("文件导出成功!"); - } - //PEDAClass.Folder_Handle(dir_Ok + "\\" + PEDAClass.Files_Name(Cyberpipe.PED_logicfile.PED_Affair.Redact_D, 0), Cyberpipe.PED_logicfile.PED_Affair.Redact_D, "", 0); - - } /// /// 获取文件或文件夹的名称 /// @@ -8575,33 +6811,6 @@ return DF_Name; } - private void toolStripDropDownButton1_Click(object sender, EventArgs e) - { - if (folderBrowserDialog1.ShowDialog() == DialogResult.OK) //打洙?开a文?件t夹D对?话°框ò - { - dir_Ok = folderBrowserDialog1.SelectedPath; //显?示?选?择?的?文?件t夹D路·径? - - //tempstr = folderBrowserDialog1.SelectedPath; //存?储洹?选?择?的?文?件t夹D路·径? - - - Cyberpipe.PED_logicfile.PED_Affair.Redact_D = Utility.uploadpath + "\\SFiles\\UserHbook\\说明.docx"; - if (File.Exists(dir_Ok + "\\" + Files_Name(Cyberpipe.PED_logicfile.PED_Affair.Redact_D, 1))) - { - if (MessageBox.Show("文件夹下有同名文件,是否替换?", "提示", MessageBoxButtons.YesNo, MessageBoxIcon.Information) == DialogResult.No) ; - - } - byte[] file = UDF.Down(Cyberpipe.PED_logicfile.PED_Affair.Redact_D); - FileStream pFileSream = new FileStream(dir_Ok + "\\说明.docx", FileMode.OpenOrCreate); - pFileSream.Write(file, 0, file.Length); - pFileSream.Close(); - if (File.Exists(dir_Ok + "\\" + Files_Name(Cyberpipe.PED_logicfile.PED_Affair.Redact_D, 1)) == true) - { - MessageBox.Show("文件导出成功!"); - } - - } - } - /// /// 空间查询 /// @@ -9792,7 +8001,7 @@ GSOLayer resLayer = null; GSOFeature resFeature = null; globeControl1.Globe.GetSelectObject(0, out resFeature, out resLayer); - + if (resFeature == null) return; GSOGeoPolyline3D line1 = resFeature.Geometry as GSOGeoPolyline3D; if (line1 == null) { @@ -9876,7 +8085,7 @@ GSOLayer resLayer = null; GSOFeature resFeature = null; globeControl1.Globe.GetSelectObject(0, out resFeature, out resLayer); - + if (resFeature == null) return; GSOGeoPolyline3D line1 = resFeature.Geometry as GSOGeoPolyline3D; if (line1 == null) { @@ -9891,7 +8100,8 @@ } GSOFeatures feats = globeControl1.Globe.MemoryLayer.GetFeatureByName("粒子要素", true); - if (feats.Length > 0) + + if (feats!=null&&feats.Length > 0) globeControl1.Globe.MemoryLayer.RemoveFeatureByID(feats[0].ID); //if (emitterFeature != null) //{ @@ -11121,88 +9331,6 @@ } private int connectServerCount = 0; - - /// - /// 还原球到实测库 - /// - private void refreshGlobe1() - { - //添加实测库图层已有图层 - int servernum = 0; - //1.清除global1上 - for (int i = globeControl1.Globe.Layers.Count - 1; i >= 0; i--) - { - GSOLayer layer = globeControl1.Globe.Layers[i]; - if (!layer.Name.Contains("fttp:")) - { - layer.Dataset.Close();//清除内存 - globeControl1.Globe.Layers.Remove(layer); - } - else - { - servernum++; - } - } - - //globeControl1.Globe.ConnectServer(Utility.serverip, Utility.serverport, "", ""); //加载locaServer中的数据 - - //2.添加实测库图层 - string[] markerStrs = new string[9]; - markerStrs[0] = "标高标注"; - markerStrs[1] = "管径标注"; - markerStrs[2] = "埋深标注"; - markerStrs[3] = "坐标标注"; - markerStrs[4] = "坡度标注"; - markerStrs[5] = "属性标注"; - markerStrs[6] = "自定义标注"; - markerStrs[7] = "距离标注"; - markerStrs[8] = "扯旗标注"; - for (int i = 0; i < markerStrs.Length; i++) - { - if (File.Exists(Application.StartupPath + "\\标注管理\\" + markerStrs[i] + ".lgd")) - { - GSOLayer markerLayer = globeControl1.Globe.Layers.Add(Application.StartupPath + "\\标注管理\\" + markerStrs[i] + ".lgd"); - } - } - - for (int i = 0; i < g1layername.Count; i++) - { - string g1name = g1layername[i]; - GSODataset datasetg1 = Utility.dataSource.GetDatasetByName(g1name); - GSOLayer templayer = globeControl1.Globe.Layers.Add(datasetg1); - templayer.MaxVisibleAltitude = -1; - } - layerTemp = globeControl1.Globe.Layers.Add(Application.StartupPath + "\\tempLgdData.lgd"); - globeControl1.Globe.Layers.Add(Application.StartupPath + "/城市七线/城市红线.lgd"); - globeControl1.Globe.Layers.Add(Application.StartupPath + "/城市七线/城市橙线.lgd"); - globeControl1.Globe.Layers.Add(Application.StartupPath + "/城市七线/城市黄线.lgd"); - globeControl1.Globe.Layers.Add(Application.StartupPath + "/城市七线/城市绿线.lgd"); - globeControl1.Globe.Layers.Add(Application.StartupPath + "/城市七线/城市蓝线.lgd"); - globeControl1.Globe.Layers.Add(Application.StartupPath + "/城市七线/城市紫线.lgd"); - globeControl1.Globe.Layers.Add(Application.StartupPath + "/城市七线/城市黑线.lgd"); - globeControl1.Globe.Layers.Add(Application.StartupPath + "/隧道.lgd"); - - //移动server的数据图层 - for (int i = 0; i < servernum; i++) - { - globeControl1.Globe.Layers.MoveTo(globeControl1.Globe.Layers.Count - 1, 0); - } - - if (layerManagerNode.Nodes.Count > 0) - { - for (int i = layerManagerNode.Nodes.Count - 1; i >= 0; i--) - { - layerManagerNode.Nodes[i].Remove(); - - } - } - - - - globeControl1.Refresh(); - - } - /// /// 碰撞审查 /// @@ -11476,31 +9604,7 @@ // } //} #endregion - /// - /// 数据质量检查 - /// - /// - /// - private void buttonItemSJGL2_Click(object sender, EventArgs e) - { - //日志记录 - LogManager.saveLog(Utility.userName, this.buttonItemSJGL2.Text); - FrmValiData frm = new FrmValiData(globeControl1); - frm.ShowDialog(); - } - /// - /// 数据预处理 - /// - /// - /// - private void buttonItemSJGL3_Click(object sender, EventArgs e) - { - //保存日志 - LogManager.saveLog(Utility.userName, this.buttonItemSJGL3.Text); - FrmEditShapeFile frm = new FrmEditShapeFile(globeControl1); - frm.ShowDialog(this); - } /// /// 连接数据库 /// @@ -12251,60 +10355,6 @@ List lineStruct = new List(); GSOFeature featureSelected = null; - private void AddDatagridView(DataTable table) - { - - if (table != null && table.Rows.Count > 0) - { - dataGridViewX1.DataSource = table; - panelOfTable.Visible = true; - panelOfTable.Height = 200; - toolStripNumbers.Text = "红线审核结果"; - toolStripFeatureLength.Text = " 共有:" + table.Rows.Count + "条"; - } - else - { - - } - - } - - /// - /// 去除集合中重复的管线 - /// - /// - /// - /// - private GSOFeatures getFeaturesByFilter(GSOFeatures features, string fieldName) - { - if (features == null) - { - return null; - } - GSOFeatures featuresGet = new GSOFeatures(); - for (int i = 0; i < features.Length; i++) - { - GSOFeature featureFromFS = features[i]; - string fieldValueFromFS = featureFromFS.GetValue(fieldName).ToString().Trim(); - bool isHas = false; - for (int j = featuresGet.Length - 1; j >= 0; j--) - { - GSOFeature featureFromFSGet = featuresGet[j]; - string fieldValueFromFSGet = featureFromFSGet.GetValue(fieldName).ToString().Trim(); - if (fieldValueFromFS.Equals(fieldValueFromFSGet)) - { - isHas = true; - break; - } - } - if (isHas == false) - { - featuresGet.Add(featureFromFS.Clone()); - } - } - return featuresGet; - } - /// /// 数据管理导入文件 /// @@ -12440,138 +10490,7 @@ // //MessageBox.Show("系统运行错误:" + ex.ToString(), "错误", MessageBoxButtons.OK, MessageBoxIcon.Error); // } //} - - - /// - /// 标识器全区域统计 - /// - /// - /// - private void 标识器分类统计ToolStripMenuItem_Click(object sender, EventArgs e) - { - globeControl1.Globe.Action = EnumAction3D.ActionNull; - FrmBSQStatis bsqStatis = new FrmBSQStatis(); - bsqStatis.Show(this); - } - /// - /// 标识器绘制区域统计 - /// - /// - /// - private void 标识器分类统计ToolStripMenuItem1_Click(object sender, EventArgs e) - { - trackflag = "BSQDuoBianXiangStatis"; - globeControl1.Globe.Action = EnumAction3D.TrackPolygon; - } - - - #region 保存和加载审核库加载的图层 - private void saveLayerList(TreeNodeCollection treeNodeList) - { - string configPath = Application.StartupPath + "\\configLayerList.xml"; - try - { - XmlDocument doc = new XmlDocument(); - doc.Load(configPath); - XmlNode dbParams = doc.SelectSingleNode("Params/dbparams"); - XmlNode dbLayers = doc.SelectSingleNode("Params/dblayers"); - XmlNode layers = doc.SelectSingleNode("Params/layers"); - dbParams.RemoveAll(); - dbLayers.RemoveAll(); - layers.RemoveAll(); - - List listDS = new List(); - String shDatasourceName = Utility.sgdbip + "/" + Utility.sgdbname + "_" + Utility.sgdbuser; - bool flag = false; - - for (int i = 0; i < globeControl1.Globe.DataManager.DataSourceCount; i++) - { - GSODataSource ds = globeControl1.Globe.DataManager.GetDataSourceAt(i); - if (ds != null && ds.Type == EnumDataSourceType.SqlServer || ds.Type == EnumDataSourceType.Oracle) - { - if (ds.Name == shDatasourceName) - { - //防止因为多次连接同一个数据库 - if (flag == true) - { - break; - } - flag = true; - listDS.Add(ds); - GSODataSourceCnn conn = ds.GetConnectionInfo(); - - XmlElement dbparam = doc.CreateElement("shdbparam"); - XmlElement ip = doc.CreateElement("ship"); - ip.InnerText = conn.Server; - - XmlElement dbname = doc.CreateElement("shdbname"); - dbname.InnerText = conn.Database; - - XmlElement username = doc.CreateElement("shusername"); - username.InnerText = conn.User; - - XmlElement password = doc.CreateElement("shpassword"); - password.InnerText = conn.Password; - - XmlElement type = doc.CreateElement("shtype"); - if (ds.Type == EnumDataSourceType.SqlServer) - { - type.InnerText = "sqlserver"; - } - else - { - type.InnerText = "oracle"; - } - - dbparam.AppendChild(ip); - dbparam.AppendChild(dbname); - dbparam.AppendChild(username); - dbparam.AppendChild(password); - dbparam.AppendChild(type); - dbParams.AppendChild(dbparam); - } - - } - } - - for (int i = 0; i < treeNodeList.Count; i++) - { - GSOLayer layer = treeNodeList[i].Tag as GSOLayer; - if (Path.GetExtension(layer.Name) == "") - { - XmlElement dbLayer = doc.CreateElement("dblayer"); - XmlAttribute attri = doc.CreateAttribute("dbindex"); - for (int j = 0; j < listDS.Count; j++) - { - if (layer.Dataset.DataSource.Name == listDS[j].Name) - { - attri.Value = j.ToString(); - break; - } - } - dbLayer.Attributes.Append(attri); - dbLayer.InnerText = layer.Name; - - dbLayers.AppendChild(dbLayer); - } - else - { - XmlElement dbLayer = doc.CreateElement("layer"); - dbLayer.InnerText = layer.Name; - layers.AppendChild(dbLayer); - } - } - - doc.Save(configPath); - } - catch (Exception e) - { - - } - } - - #endregion - + private void buttonItem_TaskManager_Click(object sender, EventArgs e) { if (Form_TaksManager.IS_OPEN) diff --git a/MainFrm.designer.cs b/MainFrm.designer.cs index 233ef8c..97b8299 100644 --- a/MainFrm.designer.cs +++ b/MainFrm.designer.cs @@ -82,6 +82,7 @@ this.sideBar1 = new DevComponents.DotNetBar.SideBar(); this.panelEx3 = new DevComponents.DotNetBar.PanelEx(); this.layerSensorTree = new System.Windows.Forms.TreeView(); + this.layerTree = new Cyberpipe.MyTreeView(); this.sideBarPanelItem3 = new DevComponents.DotNetBar.SideBarPanelItem(); this.controlContainerItem3 = new DevComponents.DotNetBar.ControlContainerItem(); this.sideBarPanelItem4 = new DevComponents.DotNetBar.SideBarPanelItem(); @@ -365,30 +366,26 @@ this.可编辑ToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); this.保存ToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); this.ribbonControl1 = new DevComponents.DotNetBar.RibbonControl(); - this.ribbonPanel1 = new DevComponents.DotNetBar.RibbonPanel(); - this.ribbonBar21 = new DevComponents.DotNetBar.RibbonBar(); - this.buttonItem87 = new DevComponents.DotNetBar.ButtonItem(); - this.buttonItem88 = new DevComponents.DotNetBar.ButtonItem(); - this.buttonItem27 = new DevComponents.DotNetBar.ButtonItem(); - this.buttonItem91 = new DevComponents.DotNetBar.ButtonItem(); - this.buttonItem1 = new DevComponents.DotNetBar.ButtonItem(); - this.btnlegendSet = new DevComponents.DotNetBar.ButtonItem(); - this.buttonItem89 = new DevComponents.DotNetBar.ButtonItem(); - this.ribbonPanel7 = new DevComponents.DotNetBar.RibbonPanel(); - this.ribbonBar5 = new DevComponents.DotNetBar.RibbonBar(); - this.btn_flag = new DevComponents.DotNetBar.ButtonItem(); - this.slider4ground = new DevComponents.DotNetBar.SliderItem(); - this.ribbonPanel2 = new DevComponents.DotNetBar.RibbonPanel(); - this.ribbonBar4 = new DevComponents.DotNetBar.RibbonBar(); - this.buttonItem_TaskManager = new DevComponents.DotNetBar.ButtonItem(); - this.buttonItem_OnlineTask = new DevComponents.DotNetBar.ButtonItem(); - this.buttonItem_Event = new DevComponents.DotNetBar.ButtonItem(); this.ribbonPanel3 = new DevComponents.DotNetBar.RibbonPanel(); this.ribbonBar3 = new DevComponents.DotNetBar.RibbonBar(); this.btn_device = new DevComponents.DotNetBar.ButtonItem(); this.btn_Person = new DevComponents.DotNetBar.ButtonItem(); this.btn_constructMap = new DevComponents.DotNetBar.ButtonItem(); this.buttonItem9 = new DevComponents.DotNetBar.ButtonItem(); + this.ribbonPanel2 = new DevComponents.DotNetBar.RibbonPanel(); + this.ribbonBar4 = new DevComponents.DotNetBar.RibbonBar(); + this.buttonItem_TaskManager = new DevComponents.DotNetBar.ButtonItem(); + this.buttonItem_OnlineTask = new DevComponents.DotNetBar.ButtonItem(); + this.buttonItem_Event = new DevComponents.DotNetBar.ButtonItem(); + this.ribbonPanel1 = new DevComponents.DotNetBar.RibbonPanel(); + this.ribbonBar21 = new DevComponents.DotNetBar.RibbonBar(); + this.buttonItem87 = new DevComponents.DotNetBar.ButtonItem(); + this.buttonItem88 = new DevComponents.DotNetBar.ButtonItem(); + this.buttonItem27 = new DevComponents.DotNetBar.ButtonItem(); + this.buttonItem1 = new DevComponents.DotNetBar.ButtonItem(); + this.buttonItem91 = new DevComponents.DotNetBar.ButtonItem(); + this.btnlegendSet = new DevComponents.DotNetBar.ButtonItem(); + this.buttonItem89 = new DevComponents.DotNetBar.ButtonItem(); this.ribbonPanel8 = new DevComponents.DotNetBar.RibbonPanel(); this.ribbonBar_UserInfo = new DevComponents.DotNetBar.RibbonBar(); this.btn_user_info = new DevComponents.DotNetBar.ButtonItem(); @@ -398,6 +395,10 @@ this.btn_user_role = new DevComponents.DotNetBar.ButtonItem(); this.btn_password_edit = new DevComponents.DotNetBar.ButtonItem(); this.btn_reset_password = new DevComponents.DotNetBar.ButtonItem(); + this.ribbonPanel7 = new DevComponents.DotNetBar.RibbonPanel(); + this.ribbonBar5 = new DevComponents.DotNetBar.RibbonBar(); + this.btn_flag = new DevComponents.DotNetBar.ButtonItem(); + this.slider4ground = new DevComponents.DotNetBar.SliderItem(); this.ribbonPanel15 = new DevComponents.DotNetBar.RibbonPanel(); this.ribbonBar20 = new DevComponents.DotNetBar.RibbonBar(); this.buttonItemSJGL = new DevComponents.DotNetBar.ButtonItem(); @@ -610,7 +611,6 @@ this.buttonItem84 = new DevComponents.DotNetBar.ButtonItem(); this.buttonItem75 = new DevComponents.DotNetBar.ButtonItem(); this.buttonItem76 = new DevComponents.DotNetBar.ButtonItem(); - this.layerTree = new Cyberpipe.MyTreeView(); this.statusStrip1.SuspendLayout(); this.sideBar1.SuspendLayout(); this.panelEx3.SuspendLayout(); @@ -647,11 +647,11 @@ this.contextMenuStrip3.SuspendLayout(); this.contextMenuStripDeleteLayerNode.SuspendLayout(); this.ribbonControl1.SuspendLayout(); - this.ribbonPanel1.SuspendLayout(); - this.ribbonPanel7.SuspendLayout(); - this.ribbonPanel2.SuspendLayout(); this.ribbonPanel3.SuspendLayout(); + this.ribbonPanel2.SuspendLayout(); + this.ribbonPanel1.SuspendLayout(); this.ribbonPanel8.SuspendLayout(); + this.ribbonPanel7.SuspendLayout(); this.ribbonPanel15.SuspendLayout(); ((System.ComponentModel.ISupportInitialize)(this.pictureBox1)).BeginInit(); this.SuspendLayout(); @@ -813,7 +813,6 @@ this.toolStripDropDownButton1.Size = new System.Drawing.Size(45, 21); this.toolStripDropDownButton1.Text = "帮助"; this.toolStripDropDownButton1.Visible = false; - this.toolStripDropDownButton1.Click += new System.EventHandler(this.toolStripDropDownButton1_Click); // // controlContainerItem1 // @@ -1047,6 +1046,16 @@ this.layerSensorTree.AfterCheck += new System.Windows.Forms.TreeViewEventHandler(this.layerMarkerTree_AfterCheck); this.layerSensorTree.NodeMouseClick += new System.Windows.Forms.TreeNodeMouseClickEventHandler(this.layerMarkerTree_NodeMouseClick); // + // layerTree + // + this.layerTree.CheckBoxes = true; + this.layerTree.ItemHeight = 18; + this.layerTree.Location = new System.Drawing.Point(30, 78); + this.layerTree.Name = "layerTree"; + this.layerTree.Size = new System.Drawing.Size(121, 97); + this.layerTree.TabIndex = 1; + this.layerTree.AfterCheck += new System.Windows.Forms.TreeViewEventHandler(this.layerTree_AfterCheck); + // // sideBarPanelItem3 // this.sideBarPanelItem3.FontBold = true; @@ -2966,28 +2975,28 @@ // 平移对象ToolStripMenuItem // this.平移对象ToolStripMenuItem.Name = "平移对象ToolStripMenuItem"; - this.平移对象ToolStripMenuItem.Size = new System.Drawing.Size(152, 22); + this.平移对象ToolStripMenuItem.Size = new System.Drawing.Size(124, 22); this.平移对象ToolStripMenuItem.Text = "平移对象"; this.平移对象ToolStripMenuItem.Click += new System.EventHandler(this.buttonItemBJ6_Click); // // 升降对象ToolStripMenuItem // this.升降对象ToolStripMenuItem.Name = "升降对象ToolStripMenuItem"; - this.升降对象ToolStripMenuItem.Size = new System.Drawing.Size(152, 22); + this.升降对象ToolStripMenuItem.Size = new System.Drawing.Size(124, 22); this.升降对象ToolStripMenuItem.Text = "升降对象"; this.升降对象ToolStripMenuItem.Click += new System.EventHandler(this.buttonItemBJ7_Click); // // 旋转对象ToolStripMenuItem // this.旋转对象ToolStripMenuItem.Name = "旋转对象ToolStripMenuItem"; - this.旋转对象ToolStripMenuItem.Size = new System.Drawing.Size(152, 22); + this.旋转对象ToolStripMenuItem.Size = new System.Drawing.Size(124, 22); this.旋转对象ToolStripMenuItem.Text = "旋转对象"; this.旋转对象ToolStripMenuItem.Click += new System.EventHandler(this.buttonItemBJ8_Click); // // 连接管段ToolStripMenuItem // this.连接管段ToolStripMenuItem.Name = "连接管段ToolStripMenuItem"; - this.连接管段ToolStripMenuItem.Size = new System.Drawing.Size(152, 22); + this.连接管段ToolStripMenuItem.Size = new System.Drawing.Size(124, 22); this.连接管段ToolStripMenuItem.Text = "连接管段"; this.连接管段ToolStripMenuItem.Click += new System.EventHandler(this.buttonItemBJ9_Click); // @@ -2997,34 +3006,34 @@ this.导出CADToolStripMenuItem, this.导出文件ToolStripMenuItem1}); this.导出文件ToolStripMenuItem.Name = "导出文件ToolStripMenuItem"; - this.导出文件ToolStripMenuItem.Size = new System.Drawing.Size(152, 22); + this.导出文件ToolStripMenuItem.Size = new System.Drawing.Size(124, 22); this.导出文件ToolStripMenuItem.Text = "导出矢量"; // // 导出CADToolStripMenuItem // this.导出CADToolStripMenuItem.Name = "导出CADToolStripMenuItem"; - this.导出CADToolStripMenuItem.Size = new System.Drawing.Size(152, 22); + this.导出CADToolStripMenuItem.Size = new System.Drawing.Size(125, 22); this.导出CADToolStripMenuItem.Text = "导出CAD"; this.导出CADToolStripMenuItem.Click += new System.EventHandler(this.buttonItemBJ10_1_Click); // // 导出文件ToolStripMenuItem1 // this.导出文件ToolStripMenuItem1.Name = "导出文件ToolStripMenuItem1"; - this.导出文件ToolStripMenuItem1.Size = new System.Drawing.Size(152, 22); + this.导出文件ToolStripMenuItem1.Size = new System.Drawing.Size(125, 22); this.导出文件ToolStripMenuItem1.Text = "导出文件"; this.导出文件ToolStripMenuItem1.Click += new System.EventHandler(this.buttonItemBJ10_2_Click); // // 前进ToolStripMenuItem // this.前进ToolStripMenuItem.Name = "前进ToolStripMenuItem"; - this.前进ToolStripMenuItem.Size = new System.Drawing.Size(152, 22); + this.前进ToolStripMenuItem.Size = new System.Drawing.Size(124, 22); this.前进ToolStripMenuItem.Text = "前进"; this.前进ToolStripMenuItem.Click += new System.EventHandler(this.buttonItemBJ12_Click); // // 删除模型ToolStripMenuItem // this.删除模型ToolStripMenuItem.Name = "删除模型ToolStripMenuItem"; - this.删除模型ToolStripMenuItem.Size = new System.Drawing.Size(152, 22); + this.删除模型ToolStripMenuItem.Size = new System.Drawing.Size(124, 22); this.删除模型ToolStripMenuItem.Text = "后退"; this.删除模型ToolStripMenuItem.Click += new System.EventHandler(this.buttonItemBJ11_Click); // @@ -4160,6 +4169,198 @@ this.ribbonControl1.Text = "ribbonControl1"; this.ribbonControl1.UseCustomizeDialog = false; // + // ribbonPanel3 + // + this.ribbonPanel3.ColorSchemeStyle = DevComponents.DotNetBar.eDotNetBarStyle.StyleManagerControlled; + this.ribbonPanel3.Controls.Add(this.ribbonBar3); + this.ribbonPanel3.Dock = System.Windows.Forms.DockStyle.Fill; + this.ribbonPanel3.Location = new System.Drawing.Point(0, 33); + this.ribbonPanel3.Name = "ribbonPanel3"; + this.ribbonPanel3.Padding = new System.Windows.Forms.Padding(3, 0, 3, 3); + this.ribbonPanel3.Size = new System.Drawing.Size(1328, 62); + // + // + // + this.ribbonPanel3.Style.Class = ""; + this.ribbonPanel3.Style.CornerType = DevComponents.DotNetBar.eCornerType.Square; + // + // + // + this.ribbonPanel3.StyleMouseDown.Class = ""; + this.ribbonPanel3.StyleMouseDown.CornerType = DevComponents.DotNetBar.eCornerType.Square; + // + // + // + this.ribbonPanel3.StyleMouseOver.Class = ""; + this.ribbonPanel3.StyleMouseOver.CornerType = DevComponents.DotNetBar.eCornerType.Square; + this.ribbonPanel3.TabIndex = 40; + // + // ribbonBar3 + // + this.ribbonBar3.AutoOverflowEnabled = true; + // + // + // + this.ribbonBar3.BackgroundMouseOverStyle.Class = ""; + this.ribbonBar3.BackgroundMouseOverStyle.CornerType = DevComponents.DotNetBar.eCornerType.Square; + // + // + // + this.ribbonBar3.BackgroundStyle.Class = ""; + this.ribbonBar3.BackgroundStyle.CornerType = DevComponents.DotNetBar.eCornerType.Square; + this.ribbonBar3.ContainerControlProcessDialogKey = true; + this.ribbonBar3.Dock = System.Windows.Forms.DockStyle.Left; + this.ribbonBar3.Items.AddRange(new DevComponents.DotNetBar.BaseItem[] { + this.btn_device, + this.btn_Person, + this.btn_constructMap, + this.buttonItem9}); + this.ribbonBar3.Location = new System.Drawing.Point(3, 0); + this.ribbonBar3.Name = "ribbonBar3"; + this.ribbonBar3.Size = new System.Drawing.Size(378, 59); + this.ribbonBar3.Style = DevComponents.DotNetBar.eDotNetBarStyle.StyleManagerControlled; + this.ribbonBar3.TabIndex = 0; + // + // + // + this.ribbonBar3.TitleStyle.Class = ""; + this.ribbonBar3.TitleStyle.CornerType = DevComponents.DotNetBar.eCornerType.Square; + // + // + // + this.ribbonBar3.TitleStyleMouseOver.Class = ""; + this.ribbonBar3.TitleStyleMouseOver.CornerType = DevComponents.DotNetBar.eCornerType.Square; + this.ribbonBar3.TitleVisible = false; + // + // btn_device + // + this.btn_device.ButtonStyle = DevComponents.DotNetBar.eButtonStyle.ImageAndText; + this.btn_device.Image = global::Cyberpipe.Properties.Resources._24X24__2__02; + this.btn_device.ImagePosition = DevComponents.DotNetBar.eImagePosition.Top; + this.btn_device.Name = "btn_device"; + this.btn_device.SubItemsExpandWidth = 14; + this.btn_device.Text = "探测仪管理"; + this.btn_device.Click += new System.EventHandler(this.btn_device_Click); + // + // btn_Person + // + this.btn_Person.ButtonStyle = DevComponents.DotNetBar.eButtonStyle.ImageAndText; + this.btn_Person.Image = global::Cyberpipe.Properties.Resources._24x24icon_05_hover1; + this.btn_Person.ImagePosition = DevComponents.DotNetBar.eImagePosition.Top; + this.btn_Person.Name = "btn_Person"; + this.btn_Person.SubItemsExpandWidth = 14; + this.btn_Person.Text = "定位人员维护"; + this.btn_Person.Click += new System.EventHandler(this.btn_Person_Click); + // + // btn_constructMap + // + this.btn_constructMap.Image = global::Cyberpipe.Properties.Resources._24x24icon_04_hover; + this.btn_constructMap.ImagePosition = DevComponents.DotNetBar.eImagePosition.Top; + this.btn_constructMap.Name = "btn_constructMap"; + this.btn_constructMap.SubItemsExpandWidth = 14; + this.btn_constructMap.Text = "导出施工图"; + this.btn_constructMap.Click += new System.EventHandler(this.btn_constructMap_Click); + // + // buttonItem9 + // + this.buttonItem9.Image = global::Cyberpipe.Properties.Resources._24x24icon__2__10; + this.buttonItem9.ImagePosition = DevComponents.DotNetBar.eImagePosition.Top; + this.buttonItem9.Name = "buttonItem9"; + this.buttonItem9.SubItemsExpandWidth = 14; + this.buttonItem9.Text = "文档管理"; + this.buttonItem9.Click += new System.EventHandler(this.buttonItem9_Click); + // + // ribbonPanel2 + // + this.ribbonPanel2.ColorSchemeStyle = DevComponents.DotNetBar.eDotNetBarStyle.StyleManagerControlled; + this.ribbonPanel2.Controls.Add(this.ribbonBar4); + this.ribbonPanel2.Dock = System.Windows.Forms.DockStyle.Fill; + this.ribbonPanel2.Location = new System.Drawing.Point(0, 0); + this.ribbonPanel2.Name = "ribbonPanel2"; + this.ribbonPanel2.Padding = new System.Windows.Forms.Padding(3, 0, 3, 3); + this.ribbonPanel2.Size = new System.Drawing.Size(1328, 95); + // + // + // + this.ribbonPanel2.Style.Class = ""; + this.ribbonPanel2.Style.CornerType = DevComponents.DotNetBar.eCornerType.Square; + // + // + // + this.ribbonPanel2.StyleMouseDown.Class = ""; + this.ribbonPanel2.StyleMouseDown.CornerType = DevComponents.DotNetBar.eCornerType.Square; + // + // + // + this.ribbonPanel2.StyleMouseOver.Class = ""; + this.ribbonPanel2.StyleMouseOver.CornerType = DevComponents.DotNetBar.eCornerType.Square; + this.ribbonPanel2.TabIndex = 39; + this.ribbonPanel2.Visible = false; + // + // ribbonBar4 + // + this.ribbonBar4.AutoOverflowEnabled = true; + // + // + // + this.ribbonBar4.BackgroundMouseOverStyle.Class = ""; + this.ribbonBar4.BackgroundMouseOverStyle.CornerType = DevComponents.DotNetBar.eCornerType.Square; + // + // + // + this.ribbonBar4.BackgroundStyle.Class = ""; + this.ribbonBar4.BackgroundStyle.CornerType = DevComponents.DotNetBar.eCornerType.Square; + this.ribbonBar4.ContainerControlProcessDialogKey = true; + this.ribbonBar4.Dock = System.Windows.Forms.DockStyle.Left; + this.ribbonBar4.Items.AddRange(new DevComponents.DotNetBar.BaseItem[] { + this.buttonItem_TaskManager, + this.buttonItem_OnlineTask, + this.buttonItem_Event}); + this.ribbonBar4.Location = new System.Drawing.Point(3, 0); + this.ribbonBar4.Name = "ribbonBar4"; + this.ribbonBar4.Size = new System.Drawing.Size(299, 92); + this.ribbonBar4.Style = DevComponents.DotNetBar.eDotNetBarStyle.StyleManagerControlled; + this.ribbonBar4.TabIndex = 0; + this.ribbonBar4.Text = "ribbonBar4"; + // + // + // + this.ribbonBar4.TitleStyle.Class = ""; + this.ribbonBar4.TitleStyle.CornerType = DevComponents.DotNetBar.eCornerType.Square; + // + // + // + this.ribbonBar4.TitleStyleMouseOver.Class = ""; + this.ribbonBar4.TitleStyleMouseOver.CornerType = DevComponents.DotNetBar.eCornerType.Square; + this.ribbonBar4.TitleVisible = false; + // + // buttonItem_TaskManager + // + this.buttonItem_TaskManager.Image = global::Cyberpipe.Properties.Resources._24x24icon__2__76; + this.buttonItem_TaskManager.ImagePosition = DevComponents.DotNetBar.eImagePosition.Top; + this.buttonItem_TaskManager.Name = "buttonItem_TaskManager"; + this.buttonItem_TaskManager.SubItemsExpandWidth = 14; + this.buttonItem_TaskManager.Text = "工单管理"; + this.buttonItem_TaskManager.Click += new System.EventHandler(this.buttonItem_TaskManager_Click); + // + // buttonItem_OnlineTask + // + this.buttonItem_OnlineTask.Image = global::Cyberpipe.Properties.Resources._24x24icon__2__69; + this.buttonItem_OnlineTask.ImagePosition = DevComponents.DotNetBar.eImagePosition.Top; + this.buttonItem_OnlineTask.Name = "buttonItem_OnlineTask"; + this.buttonItem_OnlineTask.SubItemsExpandWidth = 14; + this.buttonItem_OnlineTask.Text = "在线任务"; + this.buttonItem_OnlineTask.Click += new System.EventHandler(this.buttonItem_OnlineTask_Click); + // + // buttonItem_Event + // + this.buttonItem_Event.Image = global::Cyberpipe.Properties.Resources._24x24icon__2__72; + this.buttonItem_Event.ImagePosition = DevComponents.DotNetBar.eImagePosition.Top; + this.buttonItem_Event.Name = "buttonItem_Event"; + this.buttonItem_Event.SubItemsExpandWidth = 14; + this.buttonItem_Event.Text = "事件管理"; + this.buttonItem_Event.Click += new System.EventHandler(this.buttonItem_Event_Click); + // // ribbonPanel1 // this.ribbonPanel1.AutoSize = true; @@ -4262,6 +4463,15 @@ this.buttonItem27.Visible = false; this.buttonItem27.Click += new System.EventHandler(this.buttonItem27_Click); // + // buttonItem1 + // + this.buttonItem1.Image = global::Cyberpipe.Properties.Resources._24x24icon__2__94; + this.buttonItem1.ImagePosition = DevComponents.DotNetBar.eImagePosition.Top; + this.buttonItem1.Name = "buttonItem1"; + this.buttonItem1.SubItemsExpandWidth = 14; + this.buttonItem1.Text = "图层管理"; + this.buttonItem1.Click += new System.EventHandler(this.buttonItem1_Click); + // // buttonItem91 // this.buttonItem91.ForeColor = System.Drawing.Color.Black; @@ -4272,15 +4482,6 @@ this.buttonItem91.Text = "快速定位"; this.buttonItem91.Click += new System.EventHandler(this.buttonItem91_Click); // - // buttonItem1 - // - this.buttonItem1.Image = global::Cyberpipe.Properties.Resources._24x24icon__2__94; - this.buttonItem1.ImagePosition = DevComponents.DotNetBar.eImagePosition.Top; - this.buttonItem1.Name = "buttonItem1"; - this.buttonItem1.SubItemsExpandWidth = 14; - this.buttonItem1.Text = "图层管理"; - this.buttonItem1.Click += new System.EventHandler(this.buttonItem1_Click); - // // btnlegendSet // this.btnlegendSet.Image = global::Cyberpipe.Properties.Resources._24x24icon__2__93; @@ -4300,278 +4501,6 @@ this.buttonItem89.Visible = false; this.buttonItem89.Click += new System.EventHandler(this.buttonItem89_Click); // - // ribbonPanel7 - // - this.ribbonPanel7.ColorSchemeStyle = DevComponents.DotNetBar.eDotNetBarStyle.StyleManagerControlled; - this.ribbonPanel7.Controls.Add(this.ribbonBar5); - this.ribbonPanel7.Dock = System.Windows.Forms.DockStyle.Fill; - this.ribbonPanel7.Location = new System.Drawing.Point(0, 0); - this.ribbonPanel7.Name = "ribbonPanel7"; - this.ribbonPanel7.Padding = new System.Windows.Forms.Padding(3, 0, 3, 3); - this.ribbonPanel7.Size = new System.Drawing.Size(1328, 95); - // - // - // - this.ribbonPanel7.Style.Class = ""; - this.ribbonPanel7.Style.CornerType = DevComponents.DotNetBar.eCornerType.Square; - // - // - // - this.ribbonPanel7.StyleMouseDown.Class = ""; - this.ribbonPanel7.StyleMouseDown.CornerType = DevComponents.DotNetBar.eCornerType.Square; - // - // - // - this.ribbonPanel7.StyleMouseOver.Class = ""; - this.ribbonPanel7.StyleMouseOver.CornerType = DevComponents.DotNetBar.eCornerType.Square; - this.ribbonPanel7.TabIndex = 41; - this.ribbonPanel7.Visible = false; - // - // ribbonBar5 - // - this.ribbonBar5.AutoOverflowEnabled = true; - // - // - // - this.ribbonBar5.BackgroundMouseOverStyle.Class = ""; - this.ribbonBar5.BackgroundMouseOverStyle.CornerType = DevComponents.DotNetBar.eCornerType.Square; - // - // - // - this.ribbonBar5.BackgroundStyle.Class = ""; - this.ribbonBar5.BackgroundStyle.CornerType = DevComponents.DotNetBar.eCornerType.Square; - this.ribbonBar5.ContainerControlProcessDialogKey = true; - this.ribbonBar5.Dock = System.Windows.Forms.DockStyle.Left; - this.ribbonBar5.Items.AddRange(new DevComponents.DotNetBar.BaseItem[] { - this.btn_flag, - this.slider4ground}); - this.ribbonBar5.Location = new System.Drawing.Point(3, 0); - this.ribbonBar5.Name = "ribbonBar5"; - this.ribbonBar5.Size = new System.Drawing.Size(418, 92); - this.ribbonBar5.Style = DevComponents.DotNetBar.eDotNetBarStyle.StyleManagerControlled; - this.ribbonBar5.TabIndex = 0; - // - // - // - this.ribbonBar5.TitleStyle.Class = ""; - this.ribbonBar5.TitleStyle.CornerType = DevComponents.DotNetBar.eCornerType.Square; - // - // - // - this.ribbonBar5.TitleStyleMouseOver.Class = ""; - this.ribbonBar5.TitleStyleMouseOver.CornerType = DevComponents.DotNetBar.eCornerType.Square; - this.ribbonBar5.TitleVisible = false; - this.ribbonBar5.ItemClick += new System.EventHandler(this.ribbonBar5_ItemClick); - // - // btn_flag - // - this.btn_flag.Image = global::Cyberpipe.Properties.Resources._24x24icon_03_hover; - this.btn_flag.ImagePosition = DevComponents.DotNetBar.eImagePosition.Top; - this.btn_flag.Name = "btn_flag"; - this.btn_flag.SubItemsExpandWidth = 14; - this.btn_flag.Text = "标识器管理"; - this.btn_flag.Click += new System.EventHandler(this.btn_flag_Click); - // - // slider4ground - // - this.slider4ground.LabelPosition = DevComponents.DotNetBar.eSliderLabelPosition.Top; - this.slider4ground.Name = "slider4ground"; - this.slider4ground.Text = "地面透明度"; - this.slider4ground.Value = 0; - this.slider4ground.ValueChanged += new System.EventHandler(this.slider4ground_ValueChanged); - // - // ribbonPanel2 - // - this.ribbonPanel2.ColorSchemeStyle = DevComponents.DotNetBar.eDotNetBarStyle.StyleManagerControlled; - this.ribbonPanel2.Controls.Add(this.ribbonBar4); - this.ribbonPanel2.Dock = System.Windows.Forms.DockStyle.Fill; - this.ribbonPanel2.Location = new System.Drawing.Point(0, 0); - this.ribbonPanel2.Name = "ribbonPanel2"; - this.ribbonPanel2.Padding = new System.Windows.Forms.Padding(3, 0, 3, 3); - this.ribbonPanel2.Size = new System.Drawing.Size(1328, 95); - // - // - // - this.ribbonPanel2.Style.Class = ""; - this.ribbonPanel2.Style.CornerType = DevComponents.DotNetBar.eCornerType.Square; - // - // - // - this.ribbonPanel2.StyleMouseDown.Class = ""; - this.ribbonPanel2.StyleMouseDown.CornerType = DevComponents.DotNetBar.eCornerType.Square; - // - // - // - this.ribbonPanel2.StyleMouseOver.Class = ""; - this.ribbonPanel2.StyleMouseOver.CornerType = DevComponents.DotNetBar.eCornerType.Square; - this.ribbonPanel2.TabIndex = 39; - this.ribbonPanel2.Visible = false; - // - // ribbonBar4 - // - this.ribbonBar4.AutoOverflowEnabled = true; - // - // - // - this.ribbonBar4.BackgroundMouseOverStyle.Class = ""; - this.ribbonBar4.BackgroundMouseOverStyle.CornerType = DevComponents.DotNetBar.eCornerType.Square; - // - // - // - this.ribbonBar4.BackgroundStyle.Class = ""; - this.ribbonBar4.BackgroundStyle.CornerType = DevComponents.DotNetBar.eCornerType.Square; - this.ribbonBar4.ContainerControlProcessDialogKey = true; - this.ribbonBar4.Dock = System.Windows.Forms.DockStyle.Left; - this.ribbonBar4.Items.AddRange(new DevComponents.DotNetBar.BaseItem[] { - this.buttonItem_TaskManager, - this.buttonItem_OnlineTask, - this.buttonItem_Event}); - this.ribbonBar4.Location = new System.Drawing.Point(3, 0); - this.ribbonBar4.Name = "ribbonBar4"; - this.ribbonBar4.Size = new System.Drawing.Size(299, 92); - this.ribbonBar4.Style = DevComponents.DotNetBar.eDotNetBarStyle.StyleManagerControlled; - this.ribbonBar4.TabIndex = 0; - this.ribbonBar4.Text = "ribbonBar4"; - // - // - // - this.ribbonBar4.TitleStyle.Class = ""; - this.ribbonBar4.TitleStyle.CornerType = DevComponents.DotNetBar.eCornerType.Square; - // - // - // - this.ribbonBar4.TitleStyleMouseOver.Class = ""; - this.ribbonBar4.TitleStyleMouseOver.CornerType = DevComponents.DotNetBar.eCornerType.Square; - this.ribbonBar4.TitleVisible = false; - // - // buttonItem_TaskManager - // - this.buttonItem_TaskManager.Image = global::Cyberpipe.Properties.Resources._24x24icon__2__76; - this.buttonItem_TaskManager.ImagePosition = DevComponents.DotNetBar.eImagePosition.Top; - this.buttonItem_TaskManager.Name = "buttonItem_TaskManager"; - this.buttonItem_TaskManager.SubItemsExpandWidth = 14; - this.buttonItem_TaskManager.Text = "工单管理"; - this.buttonItem_TaskManager.Click += new System.EventHandler(this.buttonItem_TaskManager_Click); - // - // buttonItem_OnlineTask - // - this.buttonItem_OnlineTask.Image = global::Cyberpipe.Properties.Resources._24x24icon__2__69; - this.buttonItem_OnlineTask.ImagePosition = DevComponents.DotNetBar.eImagePosition.Top; - this.buttonItem_OnlineTask.Name = "buttonItem_OnlineTask"; - this.buttonItem_OnlineTask.SubItemsExpandWidth = 14; - this.buttonItem_OnlineTask.Text = "在线任务"; - this.buttonItem_OnlineTask.Click += new System.EventHandler(this.buttonItem_OnlineTask_Click); - // - // buttonItem_Event - // - this.buttonItem_Event.Image = global::Cyberpipe.Properties.Resources._24x24icon__2__72; - this.buttonItem_Event.ImagePosition = DevComponents.DotNetBar.eImagePosition.Top; - this.buttonItem_Event.Name = "buttonItem_Event"; - this.buttonItem_Event.SubItemsExpandWidth = 14; - this.buttonItem_Event.Text = "事件管理"; - this.buttonItem_Event.Click += new System.EventHandler(this.buttonItem_Event_Click); - // - // ribbonPanel3 - // - this.ribbonPanel3.ColorSchemeStyle = DevComponents.DotNetBar.eDotNetBarStyle.StyleManagerControlled; - this.ribbonPanel3.Controls.Add(this.ribbonBar3); - this.ribbonPanel3.Dock = System.Windows.Forms.DockStyle.Fill; - this.ribbonPanel3.Location = new System.Drawing.Point(0, 33); - this.ribbonPanel3.Name = "ribbonPanel3"; - this.ribbonPanel3.Padding = new System.Windows.Forms.Padding(3, 0, 3, 3); - this.ribbonPanel3.Size = new System.Drawing.Size(1328, 62); - // - // - // - this.ribbonPanel3.Style.Class = ""; - this.ribbonPanel3.Style.CornerType = DevComponents.DotNetBar.eCornerType.Square; - // - // - // - this.ribbonPanel3.StyleMouseDown.Class = ""; - this.ribbonPanel3.StyleMouseDown.CornerType = DevComponents.DotNetBar.eCornerType.Square; - // - // - // - this.ribbonPanel3.StyleMouseOver.Class = ""; - this.ribbonPanel3.StyleMouseOver.CornerType = DevComponents.DotNetBar.eCornerType.Square; - this.ribbonPanel3.TabIndex = 40; - // - // ribbonBar3 - // - this.ribbonBar3.AutoOverflowEnabled = true; - // - // - // - this.ribbonBar3.BackgroundMouseOverStyle.Class = ""; - this.ribbonBar3.BackgroundMouseOverStyle.CornerType = DevComponents.DotNetBar.eCornerType.Square; - // - // - // - this.ribbonBar3.BackgroundStyle.Class = ""; - this.ribbonBar3.BackgroundStyle.CornerType = DevComponents.DotNetBar.eCornerType.Square; - this.ribbonBar3.ContainerControlProcessDialogKey = true; - this.ribbonBar3.Dock = System.Windows.Forms.DockStyle.Left; - this.ribbonBar3.Items.AddRange(new DevComponents.DotNetBar.BaseItem[] { - this.btn_device, - this.btn_Person, - this.btn_constructMap, - this.buttonItem9}); - this.ribbonBar3.Location = new System.Drawing.Point(3, 0); - this.ribbonBar3.Name = "ribbonBar3"; - this.ribbonBar3.Size = new System.Drawing.Size(378, 59); - this.ribbonBar3.Style = DevComponents.DotNetBar.eDotNetBarStyle.StyleManagerControlled; - this.ribbonBar3.TabIndex = 0; - // - // - // - this.ribbonBar3.TitleStyle.Class = ""; - this.ribbonBar3.TitleStyle.CornerType = DevComponents.DotNetBar.eCornerType.Square; - // - // - // - this.ribbonBar3.TitleStyleMouseOver.Class = ""; - this.ribbonBar3.TitleStyleMouseOver.CornerType = DevComponents.DotNetBar.eCornerType.Square; - this.ribbonBar3.TitleVisible = false; - // - // btn_device - // - this.btn_device.ButtonStyle = DevComponents.DotNetBar.eButtonStyle.ImageAndText; - this.btn_device.Image = global::Cyberpipe.Properties.Resources._24X24__2__02; - this.btn_device.ImagePosition = DevComponents.DotNetBar.eImagePosition.Top; - this.btn_device.Name = "btn_device"; - this.btn_device.SubItemsExpandWidth = 14; - this.btn_device.Text = "探测仪管理"; - this.btn_device.Click += new System.EventHandler(this.btn_device_Click); - // - // btn_Person - // - this.btn_Person.ButtonStyle = DevComponents.DotNetBar.eButtonStyle.ImageAndText; - this.btn_Person.Image = global::Cyberpipe.Properties.Resources._24x24icon_05_hover1; - this.btn_Person.ImagePosition = DevComponents.DotNetBar.eImagePosition.Top; - this.btn_Person.Name = "btn_Person"; - this.btn_Person.SubItemsExpandWidth = 14; - this.btn_Person.Text = "定位人员维护"; - this.btn_Person.Click += new System.EventHandler(this.btn_Person_Click); - // - // btn_constructMap - // - this.btn_constructMap.Image = global::Cyberpipe.Properties.Resources._24x24icon_04_hover; - this.btn_constructMap.ImagePosition = DevComponents.DotNetBar.eImagePosition.Top; - this.btn_constructMap.Name = "btn_constructMap"; - this.btn_constructMap.SubItemsExpandWidth = 14; - this.btn_constructMap.Text = "导出施工图"; - this.btn_constructMap.Click += new System.EventHandler(this.btn_constructMap_Click); - // - // buttonItem9 - // - this.buttonItem9.Image = global::Cyberpipe.Properties.Resources._24x24icon__2__10; - this.buttonItem9.ImagePosition = DevComponents.DotNetBar.eImagePosition.Top; - this.buttonItem9.Name = "buttonItem9"; - this.buttonItem9.SubItemsExpandWidth = 14; - this.buttonItem9.Text = "文档管理"; - this.buttonItem9.Click += new System.EventHandler(this.buttonItem9_Click); - // // ribbonPanel8 // this.ribbonPanel8.ColorSchemeStyle = DevComponents.DotNetBar.eDotNetBarStyle.StyleManagerControlled; @@ -4696,6 +4625,86 @@ this.btn_reset_password.Text = "重置密码"; this.btn_reset_password.Click += new System.EventHandler(this.btn_reset_password_Click); // + // ribbonPanel7 + // + this.ribbonPanel7.ColorSchemeStyle = DevComponents.DotNetBar.eDotNetBarStyle.StyleManagerControlled; + this.ribbonPanel7.Controls.Add(this.ribbonBar5); + this.ribbonPanel7.Dock = System.Windows.Forms.DockStyle.Fill; + this.ribbonPanel7.Location = new System.Drawing.Point(0, 0); + this.ribbonPanel7.Name = "ribbonPanel7"; + this.ribbonPanel7.Padding = new System.Windows.Forms.Padding(3, 0, 3, 3); + this.ribbonPanel7.Size = new System.Drawing.Size(1328, 95); + // + // + // + this.ribbonPanel7.Style.Class = ""; + this.ribbonPanel7.Style.CornerType = DevComponents.DotNetBar.eCornerType.Square; + // + // + // + this.ribbonPanel7.StyleMouseDown.Class = ""; + this.ribbonPanel7.StyleMouseDown.CornerType = DevComponents.DotNetBar.eCornerType.Square; + // + // + // + this.ribbonPanel7.StyleMouseOver.Class = ""; + this.ribbonPanel7.StyleMouseOver.CornerType = DevComponents.DotNetBar.eCornerType.Square; + this.ribbonPanel7.TabIndex = 41; + this.ribbonPanel7.Visible = false; + // + // ribbonBar5 + // + this.ribbonBar5.AutoOverflowEnabled = true; + // + // + // + this.ribbonBar5.BackgroundMouseOverStyle.Class = ""; + this.ribbonBar5.BackgroundMouseOverStyle.CornerType = DevComponents.DotNetBar.eCornerType.Square; + // + // + // + this.ribbonBar5.BackgroundStyle.Class = ""; + this.ribbonBar5.BackgroundStyle.CornerType = DevComponents.DotNetBar.eCornerType.Square; + this.ribbonBar5.ContainerControlProcessDialogKey = true; + this.ribbonBar5.Dock = System.Windows.Forms.DockStyle.Left; + this.ribbonBar5.Items.AddRange(new DevComponents.DotNetBar.BaseItem[] { + this.btn_flag, + this.slider4ground}); + this.ribbonBar5.Location = new System.Drawing.Point(3, 0); + this.ribbonBar5.Name = "ribbonBar5"; + this.ribbonBar5.Size = new System.Drawing.Size(418, 92); + this.ribbonBar5.Style = DevComponents.DotNetBar.eDotNetBarStyle.StyleManagerControlled; + this.ribbonBar5.TabIndex = 0; + // + // + // + this.ribbonBar5.TitleStyle.Class = ""; + this.ribbonBar5.TitleStyle.CornerType = DevComponents.DotNetBar.eCornerType.Square; + // + // + // + this.ribbonBar5.TitleStyleMouseOver.Class = ""; + this.ribbonBar5.TitleStyleMouseOver.CornerType = DevComponents.DotNetBar.eCornerType.Square; + this.ribbonBar5.TitleVisible = false; + this.ribbonBar5.ItemClick += new System.EventHandler(this.ribbonBar5_ItemClick); + // + // btn_flag + // + this.btn_flag.Image = global::Cyberpipe.Properties.Resources._24x24icon_03_hover; + this.btn_flag.ImagePosition = DevComponents.DotNetBar.eImagePosition.Top; + this.btn_flag.Name = "btn_flag"; + this.btn_flag.SubItemsExpandWidth = 14; + this.btn_flag.Text = "标识器管理"; + this.btn_flag.Click += new System.EventHandler(this.btn_flag_Click); + // + // slider4ground + // + this.slider4ground.LabelPosition = DevComponents.DotNetBar.eSliderLabelPosition.Top; + this.slider4ground.Name = "slider4ground"; + this.slider4ground.Text = "地面透明度"; + this.slider4ground.Value = 0; + this.slider4ground.ValueChanged += new System.EventHandler(this.slider4ground_ValueChanged); + // // ribbonPanel15 // this.ribbonPanel15.ColorSchemeStyle = DevComponents.DotNetBar.eDotNetBarStyle.StyleManagerControlled; @@ -6393,16 +6402,6 @@ this.buttonItem76.SubItemsExpandWidth = 14; this.buttonItem76.Text = "坐标标注"; // - // layerTree - // - this.layerTree.CheckBoxes = true; - this.layerTree.ItemHeight = 18; - this.layerTree.Location = new System.Drawing.Point(30, 78); - this.layerTree.Name = "layerTree"; - this.layerTree.Size = new System.Drawing.Size(121, 97); - this.layerTree.TabIndex = 1; - this.layerTree.AfterCheck += new System.Windows.Forms.TreeViewEventHandler(this.layerTree_AfterCheck); - // // MainFrm // this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Inherit; @@ -6475,11 +6474,11 @@ this.contextMenuStripDeleteLayerNode.ResumeLayout(false); this.ribbonControl1.ResumeLayout(false); this.ribbonControl1.PerformLayout(); - this.ribbonPanel1.ResumeLayout(false); - this.ribbonPanel7.ResumeLayout(false); - this.ribbonPanel2.ResumeLayout(false); this.ribbonPanel3.ResumeLayout(false); + this.ribbonPanel2.ResumeLayout(false); + this.ribbonPanel1.ResumeLayout(false); this.ribbonPanel8.ResumeLayout(false); + this.ribbonPanel7.ResumeLayout(false); this.ribbonPanel15.ResumeLayout(false); ((System.ComponentModel.ISupportInitialize)(this.pictureBox1)).EndInit(); this.ResumeLayout(false); diff --git a/NewFunction/FrmCreateTunnel.cs b/NewFunction/FrmCreateTunnel.cs index 282767c..338edff 100644 --- a/NewFunction/FrmCreateTunnel.cs +++ b/NewFunction/FrmCreateTunnel.cs @@ -142,35 +142,6 @@ } } - private void txtMS_KeyPress(object sender, KeyPressEventArgs e) - { - TextBox text = sender as TextBox; - if ((e.KeyChar < 48 || e.KeyChar > 57) && (e.KeyChar != 8) && (int)e.KeyChar != 46) - { - e.Handled = true; - } - if ((int)e.KeyChar == 46) //小数点 - { - if (text.Text.Length <= 0) - e.Handled = true; //小数点不能在第一位 - else //处理不规则的小数点 - { - float f; - float oldf; - bool b1 = false, b2 = false; - b1 = float.TryParse(text.Text, out oldf); - b2 = float.TryParse(text.Text + e.KeyChar.ToString(), out f); - if (b2 == false) - { - if (b1 == true) - e.Handled = true; - else - e.Handled = false; - } - } - } - } - private void FrmCreateTunnel_Load(object sender, EventArgs e) { if (comboBoxTunnelType.Items.Count > 0) diff --git a/OracleHelper.cs b/OracleHelper.cs index 11eebe6..79cdf48 100644 --- a/OracleHelper.cs +++ b/OracleHelper.cs @@ -49,7 +49,7 @@ { conn.Close(); } - MessageBox.Show(ex.Message, "提示"); + LogHelper.WriteLog(typeof(OledbHelper), ex.Message); return null; } } @@ -67,7 +67,7 @@ } catch(Exception ex) { - // LogError.PublishError(ex); + LogHelper.WriteLog(typeof(OledbHelper), ex.Message); } finally { @@ -111,6 +111,7 @@ } catch (Exception ex) { + LogHelper.WriteLog(typeof(OledbHelper), ex.Message); return null; } } @@ -131,6 +132,7 @@ } catch(Exception ex) { + LogHelper.WriteLog(typeof(OledbHelper), ex.Message); rowCount = -1; } finally @@ -159,6 +161,7 @@ } catch(Exception ex) { + LogHelper.WriteLog(typeof(OledbHelper), ex.Message); num = -1; } finally @@ -190,6 +193,7 @@ } catch (Exception ex) { + LogHelper.WriteLog(typeof(OledbHelper), ex.Message); return null; } } @@ -210,7 +214,7 @@ oracleCmd.Dispose(); conn.Close(); //调用con_close()方法,关闭与数据库的连接 }catch(Exception ex){ - + LogHelper.WriteLog(typeof(OledbHelper), ex.Message); } finally { @@ -237,6 +241,7 @@ } catch (Exception ex) { + LogHelper.WriteLog(typeof(OledbHelper), ex.Message); rowCount = -1; } finally diff --git a/OracleUtils.cs b/OracleUtils.cs index 29b5374..c1aadda 100644 --- a/OracleUtils.cs +++ b/OracleUtils.cs @@ -741,7 +741,6 @@ } catch { - //if we fail to return the SqlDatReader, we need to close the connection ourselves cn.Close(); throw; } diff --git a/PAS.cs b/PAS.cs index 972de2d..fcda1dd 100644 --- a/PAS.cs +++ b/PAS.cs @@ -93,15 +93,7 @@ } - private void TSM_Pderive_Click(object sender, EventArgs e) - { - PASAClass.Table_name(operation); - if (TV_Files.SelectedNode != null) - { - PASAClass.GuideEdit_form("G", TV_Files, int.Parse(((ToolStripMenuItem)sender).Tag.ToString())); - } - } - + private void TSM_Fenter_Click(object sender, EventArgs e) { if (TV_Files.SelectedNode != null) @@ -110,16 +102,6 @@ } } - private void TSM_Frename_Click(object sender, EventArgs e) - { - TSM_Fenter_Click(sender, e); - } - - private void TSM_Fdelete_Click(object sender, EventArgs e) - { - TSM_Fenter_Click(sender, e); - } - private void TSM_Fderive_Click(object sender, EventArgs e) { if (TV_Files.SelectedNode != null) @@ -128,25 +110,6 @@ } } - private void TSM_Fprint_Click(object sender, EventArgs e) - { - if (TV_Files.SelectedNode != null) - { - PASAClass.Print(int.Parse(TV_Files.SelectedNode.Tag.ToString()), TV_Files.SelectedNode.Text, PD_PASPrtFile, PD_PASPrtDoc); - - } - } - - private void TSM_PASPgSt_Click(object sender, EventArgs e) - { - PSD_PASSetPage.ShowDialog(); - } - - private void TSM_PASPreV_Click(object sender, EventArgs e) - { - PPD_PASPreV.ShowDialog(); - } - private void TV_Files_AfterCollapse(object sender, TreeViewEventArgs e) { e.Node.ImageIndex = 0; @@ -250,14 +213,6 @@ } } - private void 导出ToolStripMenuItem_Click(object sender, EventArgs e) - { - PASAClass.Table_name(operation); - if (TV_Files.SelectedNode != null) - { - PASAClass.GuideEdit_form("G", TV_Files, int.Parse(((ToolStripMenuItem)sender).Tag.ToString())); - } - } private void 导入ToolStripMenuItem_Click(object sender, EventArgs e) { diff --git a/PAS_Forms/F_PASInout.cs b/PAS_Forms/F_PASInout.cs index 373a4e6..974f987 100644 --- a/PAS_Forms/F_PASInout.cs +++ b/PAS_Forms/F_PASInout.cs @@ -71,11 +71,6 @@ } - private void Cancel_Click(object sender, EventArgs e) - { - this.Close(); - } - private void OK_Click(object sender, EventArgs e) { if (textBox1.Text == "") diff --git a/PATM.cs b/PATM.cs index edecd1e..9b6c51d 100644 --- a/PATM.cs +++ b/PATM.cs @@ -26,12 +26,6 @@ public string operation = ""; #endregion - - - - - - private void TSM_Pnew_Click(object sender, EventArgs e) { if (LV_proj.Visible) @@ -94,15 +88,6 @@ } - private void TSM_Pderive_Click(object sender, EventArgs e) - { - PATMAClass.Table_name(operation); - if (TV_files.SelectedNode != null) - { - PATMAClass.GuideEdit_form("G", TV_files, int.Parse(((ToolStripMenuItem)sender).Tag.ToString())); - } - } - private void TSM_Fenter_Click(object sender, EventArgs e) { if (TV_files.SelectedNode != null) @@ -163,35 +148,6 @@ //PATMAClass.Show_AllFile(int.Parse(e.Node.Tag.ToString()), e.Node.Text, LV_PATMallfiles, PB_Display, 2);//此处为显示图片操作 } - private void TSM_Frename_Click(object sender, EventArgs e) - { - TSM_Fenter_Click(sender, e); - } - - private void TSM_Fdelete_Click(object sender, EventArgs e) - { - TSM_Fenter_Click(sender, e); - } - - private void TSM_Fderive_Click(object sender, EventArgs e) - { - if (TV_files.SelectedNode != null) - { - PATMAClass.GuideEdit_form("G", TV_files, int.Parse(((ToolStripMenuItem)sender).Tag.ToString())); - } - } - - private void TSM_Fprint_Click(object sender, EventArgs e) - { - if (TV_files.SelectedNode != null) - { - PATMAClass.Print(int.Parse(TV_files.SelectedNode.Tag.ToString()), TV_files.SelectedNode.Text, PD_PATMPrtFile, PD_PATMPrtDoc); - - } - } - - - private void BT_PATMSch_Click(object sender, EventArgs e) { //LV_PATMallfiles.Dock = DockStyle.Fill;//使ListView控件最大化 @@ -210,32 +166,6 @@ } - private void TSM_PATMPreV_Click(object sender, EventArgs e) - { - PPD_PATMPreV.ShowDialog(); - } - - private void TSM_PATMPgSt_Click(object sender, EventArgs e) - { - PSD_PATMSetPage.ShowDialog(); - } - - private void LV_PATMSrchRslt_MouseClick(object sender, MouseEventArgs e) - { - - if (LV_proj.SelectedItems != null) - { - //int i = 1; - // PATMAClass.Show_AllFile(int.Parse(LV_PATMSrchRslt.FocusedItem.Tag.ToString()), LV_PATMSrchRslt.FocusedItem.Text, LV_PATMallfiles,PB_Display, 0); - - } - } - - private void LV_PATMSrchRslt_MouseDoubleClick(object sender, MouseEventArgs e) - { - //PATMAClass.Show_AllFile(int.Parse(LV_PATMSrchRslt.FocusedItem.Tag.ToString()), LV_PATMSrchRslt.FocusedItem.Text, LV_PATMallfiles, PB_Display, 2); - } - private void 新建ToolStripMenuItem_Click(object sender, EventArgs e) { if ((TV_files.SelectedNode != null)&&(TV_files.SelectedNode.Parent==null)) @@ -288,17 +218,6 @@ } } - private void 打印预览toolStripMenuItem_Click(object sender, EventArgs e) - { - - PPD_PATMPreV.ShowDialog(); - } - - private void 打印设置toolStripMenuItem_Click(object sender, EventArgs e) - { - PSD_PATMSetPage.ShowDialog(); - } - private void TV_PATMSrchRslt_NodeMouseClick(object sender, TreeNodeMouseClickEventArgs e) { if (e.Button == MouseButtons.Right) diff --git a/PATM_Forms/F_PATMTitle.cs b/PATM_Forms/F_PATMTitle.cs index 7380dd8..5d1fe8c 100644 --- a/PATM_Forms/F_PATMTitle.cs +++ b/PATM_Forms/F_PATMTitle.cs @@ -148,19 +148,6 @@ return 0; } - //判断是否为已有工程 - private bool checkProject(string projectname) { - string sql = "select * from "+this.tablename+" where "+tablename+".NODENAME = '"+projectname - +"'"; - DataTable table = OledbHelper.QueryTable(sql); - if (table.Rows.Count > 0) - { - return true; - } - else { - return false; - } - } private void buttonX2_Click(object sender, EventArgs e) { diff --git a/PATM_Forms/F_PATMinout.cs b/PATM_Forms/F_PATMinout.cs index e404e7b..16b51de 100644 --- a/PATM_Forms/F_PATMinout.cs +++ b/PATM_Forms/F_PATMinout.cs @@ -174,12 +174,6 @@ { this.Close(); } - - private void TV_PATMinout_AfterCollapse(object sender, TreeViewEventArgs e) - { - e.Node.ImageIndex = 0; - } - //private void TV_PATMinout_NodeMouseDoubleClick(object sender, TreeNodeMouseClickEventArgs e) diff --git "a/PED_Forms/F_\346\225\260\346\215\256\350\276\223\345\205\245\350\276\223\345\207\272.cs" "b/PED_Forms/F_\346\225\260\346\215\256\350\276\223\345\205\245\350\276\223\345\207\272.cs" index 0f76b8c..4de8b4d 100644 --- "a/PED_Forms/F_\346\225\260\346\215\256\350\276\223\345\205\245\350\276\223\345\207\272.cs" +++ "b/PED_Forms/F_\346\225\260\346\215\256\350\276\223\345\205\245\350\276\223\345\207\272.cs" @@ -188,12 +188,7 @@ } DialogResult = DialogResult.OK;//将当前窗体的对话框返回值设为OK } - private void treeView1_NodeMouseClick(object sender, TreeNodeMouseClickEventArgs e) - { - - //dir = comboBox_Disk.Text + e.Node.FullPath; - e.Node.SelectedImageIndex = e.Node.ImageIndex; - } + private void button1_Click(object sender, EventArgs e) { diff --git a/Program.cs b/Program.cs index 1ff0987..0e480f2 100644 --- a/Program.cs +++ b/Program.cs @@ -105,22 +105,6 @@ File.Copy(localPath_config, filePath_config, true); } - private static void createFolder(String folerName) - { - if (!Directory.Exists(folerName)) - { - Directory.CreateDirectory(folerName); - } - } - - private static void delOldVersion(String fileName) - { - if (System.IO.File.Exists(fileName)) - { - File.Delete(fileName); - } - } - //获取新版本程序的路径 private static string getProgramUrl(string fileName, string nodeName) { diff --git a/Cyberpipe.csproj b/Cyberpipe.csproj index 07a8c1a..e3cd12c 100644 --- a/Cyberpipe.csproj +++ b/Cyberpipe.csproj @@ -204,25 +204,6 @@ - - Form - - - F_GKT1数据输入输出.cs - - - Form - - - F_GKT1添加文件.cs - - - Form - - - F_GKT1添加项目.cs - - Form @@ -1068,18 +1049,6 @@ Frm_password_reset.cs - - Form - - - GKT.cs - - - Form - - - GKT1.cs - Form @@ -1258,12 +1227,6 @@ F_Projedit.cs - - Form - - - PED.cs - Form @@ -1331,16 +1294,6 @@ True Reference.map - - F_GKT1数据输入输出.cs - Designer - - - F_GKT1添加文件.cs - - - F_GKT1添加项目.cs - Form_EditTask.cs @@ -1836,12 +1789,6 @@ Frm_password_reset.cs - - GKT.cs - - - GKT1.cs - F_GKT数据输入输出.cs @@ -1934,9 +1881,6 @@ F_Projedit.cs - - PED.cs - F_数据输入输出.cs diff --git a/Cyberpipe.suo b/Cyberpipe.suo index 68ced4f..a1aecf8 100644 --- a/Cyberpipe.suo +++ b/Cyberpipe.suo Binary files differ diff --git a/EMS_Forms/Form_EditTask.cs b/EMS_Forms/Form_EditTask.cs index 718992f..f1d791f 100644 --- a/EMS_Forms/Form_EditTask.cs +++ b/EMS_Forms/Form_EditTask.cs @@ -119,7 +119,8 @@ String name = Convert.ToString(dr["USERNAME"]); comboBox_userName.Items.Add(name); - } + } + dr.Close(); comboBox_road.Items.Clear(); roadList = new List(); @@ -135,7 +136,7 @@ comboBox_road.Items.Add(name); } } - + dr1.Close(); conn.Close(); bool flag2 = false; @@ -185,7 +186,7 @@ catch (Exception ex) { - MessageBox.Show(ex.ToString()); + LogHelper.WriteLog(typeof(Form_EditTask), ex.Message); } } @@ -288,7 +289,7 @@ } catch (Exception ex) { - MessageBox.Show(ex.ToString()); + LogHelper.WriteLog(typeof(Form_EditTask), ex.Message); } } @@ -474,7 +475,7 @@ } catch (Exception ex) { - MessageBox.Show(ex.ToString()); + LogHelper.WriteLog(typeof(Form_EditTask), ex.Message); } this.Close(); @@ -495,6 +496,7 @@ { numList.Add(Convert.ToInt32(dr["DBID"])); } + dr.Close(); if (numList.Count == 0) { taskNumber = Convert.ToInt32(number) * 100; @@ -674,6 +676,7 @@ } } } + dr.Close(); conn.Close(); } diff --git a/EMS_Forms/Form_EventManager.cs b/EMS_Forms/Form_EventManager.cs index b18c45b..84807b2 100644 --- a/EMS_Forms/Form_EventManager.cs +++ b/EMS_Forms/Form_EventManager.cs @@ -64,6 +64,7 @@ comboBox_name.Items.Add(name); } + dr.Close(); conn.Close(); diff --git a/Forms/FrmMnModify.cs b/Forms/FrmMnModify.cs index 31cfc5f..d036360 100644 --- a/Forms/FrmMnModify.cs +++ b/Forms/FrmMnModify.cs @@ -68,15 +68,7 @@ questionGrid.Rows[idx].Cells[1].Value = sr.question; } } - /// 选中对象 - /// - /// - /// - /// - private void buttonX1_Click(object sender, EventArgs e) - { - globecontrol.Globe.Action = EnumAction3D.SelectObject; - } + /// /// 选中某一行 /// diff --git a/Forms/FrmPipelineModelDataBase.cs b/Forms/FrmPipelineModelDataBase.cs index 2acf0ca..7ce573f 100644 --- a/Forms/FrmPipelineModelDataBase.cs +++ b/Forms/FrmPipelineModelDataBase.cs @@ -35,19 +35,7 @@ ds = _ds; InitializeComponent(); } - /// - /// 单击选择shp格式文件 - /// - /// - /// - private void btnBrowseModel_Click(object sender, EventArgs e) - { - saveFileDialog1.Filter = "*.lgd|*.lgd"; - if (saveFileDialog1.ShowDialog() == DialogResult.OK) - { - txtModelLayer.Text = saveFileDialog1.FileName; - } - } + /// /// 窗体初始化事件处理 /// @@ -100,49 +88,6 @@ } } } - - private object convertFieldValue(string fieldname, object obj) - { - if (obj == null) - return null; - - try - { - string type = fields_types[fieldname].ToString(); - switch (type) - { - case "string": - return obj.ToString(); - case "int": - //return 101; - int intResult; - if (int.TryParse(obj.ToString(), out intResult)) - return intResult; - else - return null; - case "double": - //return 202.5; - double doubleResult; - if (double.TryParse(obj.ToString(), out doubleResult)) - return doubleResult; - else - return null; - case "date": - DateTime dtResult; - if (DateTime.TryParse(obj.ToString(), out dtResult)) - return dtResult; - else - return null; - } - return null; - } - catch (Exception ex) - { - MessageBox.Show(ex.ToString()); - return null; - } - } - public string lgdFilePath = ""; /// /// 选择管线颜色 @@ -610,33 +555,6 @@ { this.Close(); } - - private void cmbLayer_SelectedIndexChanged(object sender, EventArgs e) //选择图层 - { - GSOLayer layer = ctl.Globe.Layers.GetLayerByCaption(selectLayerName); - GSOFeatures features = layer.GetAllFeatures(); - if (features.Length == 0) - return; - - cmbFrom.Items.Clear(); - cmbTo.Items.Clear(); - cmbRadius.Items.Clear(); - cmbID.Items.Clear(); - for (int i = 0; i < features[0].GetFieldCount(); i++) - { - GeoScene.Data.GSOFieldDefn fielddef = (GeoScene.Data.GSOFieldDefn)(features[0].GetFieldDefn(i)); - - cmbFrom.Items.Add(fielddef.Name); - cmbTo.Items.Add(fielddef.Name); - cmbRadius.Items.Add(fielddef.Name); - cmbID.Items.Add(fielddef.Name); - } - cmbFrom.SelectedItem = "Deep1"; - cmbTo.SelectedItem = "Deep2"; - cmbRadius.SelectedItem = "Diameter"; - cmbID.SelectedItem = "Handle"; - } - private void buttonXLayerPath_Click(object sender, EventArgs e)//单击 选择shp格式的文件 { OpenFileDialog dlg = new OpenFileDialog(); diff --git a/Forms/FrmPipelineModelDataOneStep.cs b/Forms/FrmPipelineModelDataOneStep.cs index 18afda7..ec93b8a 100644 --- a/Forms/FrmPipelineModelDataOneStep.cs +++ b/Forms/FrmPipelineModelDataOneStep.cs @@ -38,19 +38,7 @@ layerTree = _layerTree; InitializeComponent(); } - /// - /// 单击选择shp格式文件 - /// - /// - /// - private void btnBrowseModel_Click(object sender, EventArgs e) - { - saveFileDialog1.Filter = "*.lgd|*.lgd"; - if (saveFileDialog1.ShowDialog() == DialogResult.OK) - { - txtModelLayer.Text = saveFileDialog1.FileName; - } - } + /// /// 窗体初始化事件处理 /// @@ -107,48 +95,7 @@ } } - private object convertFieldValue(string fieldname, object obj) - { - if (obj == null) - return null; - - try - { - string type = fields_types[fieldname].ToString(); - switch (type) - { - case "string": - return obj.ToString(); - case "int": - //return 101; - int intResult; - if (int.TryParse(obj.ToString(), out intResult)) - return intResult; - else - return null; - case "double": - //return 202.5; - double doubleResult; - if (double.TryParse(obj.ToString(), out doubleResult)) - return doubleResult; - else - return null; - case "date": - DateTime dtResult; - if (DateTime.TryParse(obj.ToString(), out dtResult)) - return dtResult; - else - return null; - } - return null; - } - catch (Exception ex) - { - MessageBox.Show(ex.ToString()); - return null; - } - } - + public string lgdFilePath = ""; /// /// 选择管线颜色 @@ -673,32 +620,6 @@ return featDs; } - private void cmbLayer_SelectedIndexChanged(object sender, EventArgs e) //选择图层 - { - GSOLayer layer = ctl.Globe.Layers.GetLayerByCaption(selectLayerName); - GSOFeatures features = layer.GetAllFeatures(); - if (features.Length == 0) - return; - - cmbFrom.Items.Clear(); - cmbTo.Items.Clear(); - cmbRadius.Items.Clear(); - cmbID.Items.Clear(); - for (int i = 0; i < features[0].GetFieldCount(); i++) - { - GeoScene.Data.GSOFieldDefn fielddef = (GeoScene.Data.GSOFieldDefn)(features[0].GetFieldDefn(i)); - - cmbFrom.Items.Add(fielddef.Name); - cmbTo.Items.Add(fielddef.Name); - cmbRadius.Items.Add(fielddef.Name); - cmbID.Items.Add(fielddef.Name); - } - cmbFrom.SelectedItem = "Deep1"; - cmbTo.SelectedItem = "Deep2"; - cmbRadius.SelectedItem = "Diameter"; - cmbID.SelectedItem = "Handle"; - } - private void buttonXLayerPath_Click(object sender, EventArgs e)//单击 选择shp格式的文件 { OpenFileDialog dlg = new OpenFileDialog(); @@ -949,38 +870,6 @@ } //txtLayername.Text = type + layername; } - /// - /// 连接数据库 - /// - /// - /// - private void buttonX1_Click(object sender, EventArgs e) - { - if (ds == null) - { - //没连的话,直接连接审核库; //审核库配置读配置文件 - string dbIp = Utility.sgdbip; - string database = Utility.sgdbname; - string user = Utility.sgdbuser; - string pass = Utility.sgdbpwd; - - if (!Utility.isNetworkConnectionSuccess(dbIp.Trim())) - { - MessageBox.Show("网络连接失败!", "提示"); - return; - } - - ds = ctl.Globe.DataManager.OpenOracleDataSource(dbIp + "/" + database, "", "", user, pass); - if (ds == null) - { - MessageBox.Show("数据库连接失败!", "提示", MessageBoxButtons.OK, MessageBoxIcon.Warning); - } - else - { - btnCreateModel.Enabled = true; - } - } - } private void btnClose_Click(object sender, EventArgs e) { diff --git a/Forms/FrmShRK.cs b/Forms/FrmShRK.cs index 0e2e722..f1d83cb 100644 --- a/Forms/FrmShRK.cs +++ b/Forms/FrmShRK.cs @@ -215,6 +215,7 @@ { sourcefeatds = sourcefeat as GSOFeatureDataset; } + if (sourcefeatds == null) return; sourcefeatds.Open(); GSOFeatures sourcefeatures = sourcefeatds.GetAllFeatures(); @@ -251,6 +252,7 @@ { desfeatds = desfeat as GSOFeatureDataset; } + if (desfeatds == null) return; desfeatds.Open(); //向新数据集写入字段 diff --git a/FrmAccessoriesSensor.cs b/FrmAccessoriesSensor.cs index 09fcdf1..2a7a80e 100644 --- a/FrmAccessoriesSensor.cs +++ b/FrmAccessoriesSensor.cs @@ -209,7 +209,7 @@ chart1.Series[0].Points.DataBindXY(dic.Keys, dic.Values); for (int m = 0; m < dic.Values.Count; m++) { - if (chart1.Series[0].Points[m].YValues[0].ToString() != "0") + if (chart1.Series[0].Points[m]!=null&&chart1.Series[0].Points[m].YValues[0].ToString() != "0") { chart1.Series[0].Points[m].Label = chart1.Series[0].Points[m].YValues[0].ToString(); } diff --git a/FrmAccessoriesgather.cs b/FrmAccessoriesgather.cs index 9e331e1..a475d9e 100644 --- a/FrmAccessoriesgather.cs +++ b/FrmAccessoriesgather.cs @@ -338,7 +338,7 @@ chart1.Series[0].Points.DataBindXY(dic.Keys, dic.Values); for (int m = 0; m < dic.Values.Count; m++) { - if (chart1.Series[0].Points[m].YValues[0].ToString() != "0") + if (chart1.Series[0].Points[m]!=null&&chart1.Series[0].Points[m].YValues[0].ToString() != "0") { chart1.Series[0].Points[m].Label = chart1.Series[0].Points[m].YValues[0].ToString(); } diff --git a/FrmAccessoryAnalysis.cs b/FrmAccessoryAnalysis.cs index 71d4579..44d4065 100644 --- a/FrmAccessoryAnalysis.cs +++ b/FrmAccessoryAnalysis.cs @@ -66,39 +66,6 @@ globeControl1.Refresh(); } /// - /// 键盘按键按下事件处理 - /// - /// - /// - private void txtRadius_KeyPress(object sender, KeyPressEventArgs e) - { - TextBox text = sender as TextBox; - if ((e.KeyChar < 48 || e.KeyChar > 57) && (e.KeyChar != 8) && (int)e.KeyChar != 46) - { - e.Handled = true; - } - if ((int)e.KeyChar == 46) //小数点 - { - if (text.Text.Length <= 0) - e.Handled = true; //小数点不能在第一位 - else //处理不规则的小数点 - { - float f; - float oldf; - bool b1 = false, b2 = false; - b1 = float.TryParse(text.Text, out oldf); - b2 = float.TryParse(text.Text + e.KeyChar.ToString(), out f); - if (b2 == false) - { - if (b1 == true) - e.Handled = true; - else - e.Handled = false; - } - } - } - } - /// /// 确定按钮事件处理 /// /// diff --git a/FrmAddValve.cs b/FrmAddValve.cs index 34d2fec..5f405b9 100644 --- a/FrmAddValve.cs +++ b/FrmAddValve.cs @@ -486,56 +486,6 @@ } } - - - - - - - - private void cmbLayer_SelectedIndexChanged(object sender, EventArgs e) - { - GSOLayer layer = globeControl1.Globe.Layers.GetLayerByCaption(selectLayerName); - GSOFeatures features = layer.GetAllFeatures(); - if (features.Length == 0) - return; - - combPath.Items.Clear(); - combZ.Items.Clear(); - combModelName.Items.Clear(); - - for (int i = 0; i < features[0].GetFieldCount(); i++) - { - GeoScene.Data.GSOFieldDefn fielddef = (GeoScene.Data.GSOFieldDefn)(features[0].GetFieldDefn(i)); - combPath.Items.Add(fielddef.Name); - combZ.Items.Add(fielddef.Name); - combModelName.Items.Add(fielddef.Name); - } - combModelName.SelectedItem = "编号"; - combPath.SelectedItem = "模型路径"; - if (combfile.SelectedIndex != -1) - { - - string layerCaption = combfile.SelectedItem.ToString().Trim(); - rukuLayer = globeControl1.Globe.Layers.GetLayerByCaption(layerCaption); - if (rukuLayer != null) - { - combPath.Items.Clear(); - combZ.Items.Clear(); - combModelName.Items.Clear(); - - } - for (int i = 0; i < features[0].GetFieldCount(); i++) - { - GeoScene.Data.GSOFieldDefn fielddef = (GeoScene.Data.GSOFieldDefn)(features[0].GetFieldDefn(i)); - combPath.Items.Add(fielddef.Name); - combZ.Items.Add(fielddef.Name); - combModelName.Items.Add(fielddef.Name); - } - combModelName.SelectedItem = "编号"; - combPath.SelectedItem = "模型路径"; - } - } /// /// 单击选择shp格式文件 /// diff --git a/FrmAddWellShp.cs b/FrmAddWellShp.cs index bb79ec0..a249725 100644 --- a/FrmAddWellShp.cs +++ b/FrmAddWellShp.cs @@ -478,32 +478,6 @@ } } } - - private void cmbLayer_SelectedIndexChanged(object sender, EventArgs e) - { - GSOLayer layer = globeControl1.Globe.Layers.GetLayerByCaption(selectLayerName); - GSOFeatures features = layer.GetAllFeatures(); - if (features.Length == 0) - return; - - combCode.Items.Clear(); - combDeep.Items.Clear(); - combModelName.Items.Clear(); - combAngle.Items.Clear(); - - for (int i = 0; i < features[0].GetFieldCount(); i++) - { - GeoScene.Data.GSOFieldDefn fielddef = (GeoScene.Data.GSOFieldDefn)(features[0].GetFieldDefn(i)); - combCode.Items.Add(fielddef.Name); - combDeep.Items.Add(fielddef.Name); - combModelName.Items.Add(fielddef.Name); - combAngle.Items.Add(fielddef.Name); - } - combCode.SelectedItem = "附属物编码"; - combDeep.SelectedItem = "井深"; - combModelName.SelectedItem = "编号"; - combAngle.SelectedItem = "符号角度"; - } /// /// 单击选择shp格式文件 /// diff --git a/FrmAddYuBiZiShp.cs b/FrmAddYuBiZiShp.cs index b312d51..332f037 100644 --- a/FrmAddYuBiZiShp.cs +++ b/FrmAddYuBiZiShp.cs @@ -383,80 +383,7 @@ } } - private void cmbLayer_SelectedIndexChanged(object sender, EventArgs e) - { - GSOLayer layer = globeControl1.Globe.Layers.GetLayerByCaption(selectLayerName); - GSOFeatures features = layer.GetAllFeatures(); - if (features.Length == 0) - return; - - combCode.Items.Clear(); - combDeep.Items.Clear(); - combModelName.Items.Clear(); - //comboLoad.Items.Clear(); - for (int i = 0; i < features[0].GetFieldCount(); i++) - { - GeoScene.Data.GSOFieldDefn fielddef = (GeoScene.Data.GSOFieldDefn)(features[0].GetFieldDefn(i)); - combCode.Items.Add(fielddef.Name); - combDeep.Items.Add(fielddef.Name); - combModelName.Items.Add(fielddef.Name); - //comboLoad.Items.Add(fielddef.Name); - } - combCode.SelectedItem = "附属物编码"; - combDeep.SelectedItem = "Z坐标"; - combModelName.SelectedItem = "编号"; - //comboLoad.SelectedItem = "模型路径"; - } - - private void buttonXLayerPath_Click(object sender, EventArgs e) - { - OpenFileDialog dlg = new OpenFileDialog(); - dlg.Filter = "*.shp|*.shp"; - dlg.Multiselect = false; - if (dlg.ShowDialog() == DialogResult.OK) - { - GSOLayer layer = globeControl1.Globe.Layers.Add(dlg.FileName); - string txtMessage = valiYBdata(layer); - if (txtMessage != "") - { - button3.Enabled = false; - //textBoxLayer.Text = ""; - combCode.Items.Clear(); - combDeep.Items.Clear(); - combModelName.Items.Clear(); - globeControl1.Globe.Layers.Remove(layer); - FrmValiDataShowErrorMessage showErrorMessage = new FrmValiDataShowErrorMessage(dlg.FileName, txtMessage); - showErrorMessage.ShowDialog(); - return; - } - else - { - button3.Enabled = true; - //textBoxLayer.Text = dlg.FileName; - selectLayerName = layer.Caption; - txtLayerName.Text = layer.Caption; - GSOFeatures features = layer.GetAllFeatures(); - if (features.Length == 0) - return; - - combCode.Items.Clear(); - combDeep.Items.Clear(); - combModelName.Items.Clear(); - for (int i = 0; i < features[0].GetFieldCount(); i++) - { - GeoScene.Data.GSOFieldDefn fielddef = (GeoScene.Data.GSOFieldDefn)(features[0].GetFieldDefn(i)); - combCode.Items.Add(fielddef.Name); - combDeep.Items.Add(fielddef.Name); - combModelName.Items.Add(fielddef.Name); - //comboLoad.Items.Add(fielddef.Name); - } - combCode.SelectedItem = "管点编码"; - combDeep.SelectedItem = "Z坐标"; - combModelName.SelectedItem = "编号"; - } - } - } - + private void FrmAddYuBiZiShp_FormClosing(object sender, FormClosingEventArgs e) { globeControl1.Globe.Refresh(); diff --git a/FrmAllPipelineStatis.cs b/FrmAllPipelineStatis.cs index 6421a26..a6eea29 100644 --- a/FrmAllPipelineStatis.cs +++ b/FrmAllPipelineStatis.cs @@ -84,7 +84,7 @@ chartAllAreaPipeline.Series["管线"].Points.DataBindXY(pipelineLengthAndType.Keys, pipelineLengthAndType.Values); for (int m = 0; m < pipelineLengthAndType.Values.Count; m++) { - if (chartAllAreaPipeline.Series["管线"].Points[m].YValues[0].ToString() != "0") + if (chartAllAreaPipeline.Series["管线"].Points[m]!=null&&chartAllAreaPipeline.Series["管线"].Points[m].YValues[0].ToString() != "0") { chartAllAreaPipeline.Series["管线"].Points[m].Label = chartAllAreaPipeline.Series[0].Points[m].YValues[0].ToString(); } @@ -94,7 +94,7 @@ } catch (Exception ex) { - //LogError.PublishError(ex); + LogHelper.WriteLog(typeof(FrmAllPipelineStatis), ex.Message); } } @@ -147,7 +147,7 @@ } DataTable dt = OledbHelper.QueryTable(sql); - if (dt != null && dt.Rows.Count > 0) + if (dt != null && dt.Rows.Count > 0 && chartAllAreaPipeline.Series["管线"].Points[indexHit]!=null) { dataGridViewX1.DataSource = dt; panel.Visible = true; diff --git a/FrmAllWorkWellStatis.cs b/FrmAllWorkWellStatis.cs index 6fec7af..6af8e4c 100644 --- a/FrmAllWorkWellStatis.cs +++ b/FrmAllWorkWellStatis.cs @@ -52,7 +52,7 @@ chartAllAreaPipeline.Series["井盖"].Points.DataBindXY(workWellLengthAndType.Keys, workWellLengthAndType.Values); for (int m = 0; m < workWellLengthAndType.Values.Count; m++) { - if (chartAllAreaPipeline.Series["井盖"].Points[m].YValues[0].ToString().Trim() != "0") + if (chartAllAreaPipeline.Series["井盖"].Points[m]!=null&&chartAllAreaPipeline.Series["井盖"].Points[m].YValues[0].ToString().Trim() != "0") { chartAllAreaPipeline.Series["井盖"].Points[m].Label = chartAllAreaPipeline.Series[0].Points[m].YValues[0].ToString(); } @@ -60,7 +60,7 @@ } catch (Exception ex) { - //LogError.PublishError(ex); + LogHelper.WriteLog(typeof(FrmAllWorkWellStatis), ex.Message); } } diff --git a/FrmBSQDuoBianXingStatis.cs b/FrmBSQDuoBianXingStatis.cs index e8b7d52..3e889b6 100644 --- a/FrmBSQDuoBianXingStatis.cs +++ b/FrmBSQDuoBianXingStatis.cs @@ -60,7 +60,7 @@ { for (int m = 0; m < bsq1.Values.Count; m++) { - if (chart1.Series["标识器"].Points[m].YValues[0].ToString() != "0") + if (chart1.Series["标识器"].Points[m]!=null&&chart1.Series["标识器"].Points[m].YValues[0].ToString() != "0") { count += Convert.ToInt16(chart1.Series[0].Points[m].YValues[0].ToString()); chart1.Series["标识器"].Points[m].Label = chart1.Series[0].Points[m].YValues[0].ToString(); diff --git a/FrmBSQDuoBianXingStreet.cs b/FrmBSQDuoBianXingStreet.cs index 2005ebb..1db5777 100644 --- a/FrmBSQDuoBianXingStreet.cs +++ b/FrmBSQDuoBianXingStreet.cs @@ -63,7 +63,7 @@ chartStatis.Series[0].Points.DataBindXY(bsq.Keys, bsq.Values); for (int m = 0; m < bsq.Values.Count; m++) { - if (chartStatis.Series[0].Points[m].YValues[0].ToString().Trim() != "0") + if (chartStatis.Series[0].Points[m]!=null&&chartStatis.Series[0].Points[m].YValues[0].ToString().Trim() != "0") { count += Convert.ToInt16(chartStatis.Series[0].Points[m].YValues[0].ToString()); chartStatis.Series[0].Points[m].Label = chartStatis.Series[0].Points[m].YValues[0].ToString(); diff --git a/FrmBSQStatis.cs b/FrmBSQStatis.cs index 390a55c..4aa0ee6 100644 --- a/FrmBSQStatis.cs +++ b/FrmBSQStatis.cs @@ -95,6 +95,8 @@ } } } + + dr.Close(); conn.Close(); for (int i = 0; i < typeLists.Count; i++) { @@ -123,7 +125,7 @@ chartStatis.Series[0].Points.DataBindXY(bsq.Keys, bsq.Values); for (int m = 0; m < bsq.Values.Count; m++) { - if (chartStatis.Series[0].Points[m].YValues[0].ToString().Trim() != "0") + if (chartStatis.Series[0].Points[m]!=null&&chartStatis.Series[0].Points[m].YValues[0].ToString().Trim() != "0") { //count += Convert.ToInt16(chartStatis.Series[0].Points[m].YValues[0].ToString()); chartStatis.Series[0].Points[m].Label = chartStatis.Series[0].Points[m].YValues[0].ToString(); diff --git a/FrmBSQStreet.cs b/FrmBSQStreet.cs index 9d88adb..7fbacad 100644 --- a/FrmBSQStreet.cs +++ b/FrmBSQStreet.cs @@ -44,7 +44,7 @@ chartStatis.Series[0].Points.DataBindXY(bsq.Keys, bsq.Values); for (int m = 0; m < bsq.Values.Count; m++) { - if (chartStatis.Series[0].Points[m].YValues[0].ToString().Trim() != "0") + if (chartStatis.Series[0].Points[m]!=null&&chartStatis.Series[0].Points[m].YValues[0].ToString().Trim() != "0") { count += Convert.ToInt16(chartStatis.Series[0].Points[m].YValues[0].ToString()); chartStatis.Series[0].Points[m].Label = chartStatis.Series[0].Points[m].YValues[0].ToString(); diff --git a/FrmBoosterValvers.cs b/FrmBoosterValvers.cs index 5061efc..df9b62b 100644 --- a/FrmBoosterValvers.cs +++ b/FrmBoosterValvers.cs @@ -236,199 +236,6 @@ count = 0; } } - /// - /// 添加火苗 - /// - /// - /// - /// - /// - private GSOFeature AddFire(double x,double y,double z) - { - // 烟火示例 - - string strResPath = Application.StartupPath + "/Resource"; - - // 烟火粒子示例,由三个发射器构成 - GSOGeoParticle geoParticle = new GSOGeoParticle(); - geoParticle.SetPosition(x, y, z); // 添加到这个经纬度位置 - geoParticle.AltitudeMode = EnumAltitudeMode.RelativeToGround; - - GSORingParticleEmitter emitter = new GSORingParticleEmitter(); - emitter.TexturePath = strResPath + "/ParticleImage/flare.png"; - - emitter.SetSizeFix(1, 1); - emitter.VelFix = 1; - emitter.VelRnd = 5; - - emitter.AngleXYFix = 0; - emitter.AngleXYRnd = 180; - - emitter.AngleXZFix = 90; - emitter.AngleXZRnd = 0; - - emitter.LifeFix = 0.5f; - emitter.LifeRnd = 0.0f; - - emitter.RotFix = 0; - emitter.RotRnd = 0; - - emitter.RotVelFix = 0; - emitter.RotVelRnd = 0; - - emitter.EmitPerSec = 100; - - // 采用线性插值生成粒子的初始颜色 - emitter.ColorRndStart = Color.White; - emitter.ColorRndEnd = Color.Red; - - - GSOColorParticleEffector effector2 = new GSOColorParticleEffector(); - effector2.SetColorChanged(0, -1, -1, 0); - effector2.StartTime = 0.0f; - effector2.EndTime = -1.0f; - emitter.AddEffector(effector2); - - // 将三个发射器添加到粒子对象中 - geoParticle.AddEmitter(emitter); - - geoParticle.Play(); - - GSOFeature feature = new GSOFeature(); - - feature.Geometry = geoParticle; - - globeControl1.Globe.MemoryLayer.AddFeature(feature); - - - return feature; - } - - /// - /// 添加喷泉 - /// - /// - private GSOFeature AddFountain() - { - string strResPath = Application.StartupPath + "/Resource"; - - GSOGeoParticle geoParticle = new GSOGeoParticle(); - geoParticle.SetPosition(116.314, 39.84, 0); // 添加到这个经纬度位置 - - GSOPointParticleEmitter emitter = new GSOPointParticleEmitter(); - emitter.TexturePath = strResPath + "/ParticleImage/test.png"; - - emitter.SetSizeFix(0.5f, 2); - emitter.VelFix = 10; - emitter.VelRnd = 2; - - emitter.GravityAcc = 9.8f; - emitter.AngleXYFix = 0; - emitter.AngleXYRnd = 180; - - emitter.AngleXZFix = 88; - emitter.AngleXZRnd = 2; - - //emitter.InnerRadius = 0; - // emitter.OuterRadius = 0.03f; - - emitter.LifeFix = 5.0f; - emitter.LifeRnd = 1.0f; - - emitter.RotFix = 0; - emitter.RotRnd = 0; - - emitter.RotVelFix = 0; - emitter.RotVelRnd = 0; - - emitter.EmitPerSec = 1000; - emitter.ColorRndStart = Color.FromArgb(33, 255, 255, 255); - emitter.ColorRndEnd = Color.FromArgb(11, 255, 255, 255); - emitter.IsLumAdded = false; - - // 将三个发射器添加到粒子对象中 - geoParticle.AddEmitter(emitter); - - geoParticle.Play(); - GSOFeature feature = new GSOFeature(); - - feature.Geometry = geoParticle; - - //globeControl1.Globe.MemoryLayer.AddFeature(feature); - globeControl1.Globe.FlyToFeature(feature); - - return feature; - } - - /// - /// 添加水柱 - /// - /// - private GSOFeature AddWaterLine() - { - string strResPath = Application.StartupPath + "/Resource"; - - GSOGeoParticle geoParticle = new GSOGeoParticle(); - geoParticle.SetPosition(116.308, 39.84, 0); // 添加到这个经纬度位置 - - GSOPointParticleEmitter emitter = new GSOPointParticleEmitter(); - - emitter.TexturePath = strResPath + "/ParticleImage/drop3.png"; - - geoParticle.TimerInterval = 1; - - emitter.SetSizeFix(2.0f, 2.0f); - - emitter.VelFix = 50; - emitter.VelRnd = 2; - - // emitter.IsLumAdded = false; - - emitter.GravityAcc = 9.8f; - emitter.AngleXYFix = 0; - emitter.AngleXYRnd = 2; - - emitter.AngleXZFix = 60; - emitter.AngleXZRnd = 2; - - //emitter.InnerRadius = 0; - // emitter.OuterRadius = 0.1f; - - emitter.LifeFix = 5.0f; - emitter.LifeRnd = 1.0f; - - emitter.RotFix = 0; - emitter.RotRnd = 0; - - emitter.RotVelFix = 0; - emitter.RotVelRnd = 0; - - emitter.EmitPerSec = 1500; - - emitter.ColorRndStart = Color.FromArgb(100, 222, 222, 222); - emitter.ColorRndEnd = Color.FromArgb(50, 222, 222, 222); - - /* - - GSOScaleParticleEffector effector1 = new GSOScaleParticleEffector(); - effector1.SetScale(0.2f, 0.2f); - effector1.StartTime = 0; - effector1.EndTime = -1; // 负数表示整个粒子生命结束 - emitter.AddEffector(effector1); - */ - - // 将三个发射器添加到粒子对象中 - geoParticle.AddEmitter(emitter); - - geoParticle.Play(); - GSOFeature feature = new GSOFeature(); - - feature.Geometry = geoParticle; - - //globeControl1.Globe.MemoryLayer.AddFeature(feature); - globeControl1.Globe.FlyToFeature(feature); - - return feature; - } + } } diff --git a/FrmBufferAnalysis.cs b/FrmBufferAnalysis.cs index f711133..db8ca59 100644 --- a/FrmBufferAnalysis.cs +++ b/FrmBufferAnalysis.cs @@ -123,39 +123,6 @@ } } /// - /// 半径文本框的键盘按键按下事件处理 - /// - /// - /// - private void txtRadius_KeyPress(object sender, KeyPressEventArgs e) - { - TextBox text = sender as TextBox; - if ((e.KeyChar < 48 || e.KeyChar > 57) && (e.KeyChar != 8) && (int)e.KeyChar != 46) - { - e.Handled = true; - } - if ((int)e.KeyChar == 46) //小数点 - { - if (text.Text.Length <= 0) - e.Handled = true; //小数点不能在第一位 - else //处理不规则的小数点 - { - float f; - float oldf; - bool b1 = false, b2 = false; - b1 = float.TryParse(text.Text, out oldf); - b2 = float.TryParse(text.Text + e.KeyChar.ToString(), out f); - if (b2 == false) - { - if (b1 == true) - e.Handled = true; - else - e.Handled = false; - } - } - } - } - /// /// 窗体关闭事件处理 /// /// diff --git a/FrmBufferAnalysisBSQ.cs b/FrmBufferAnalysisBSQ.cs index 24a96ca..f54208f 100644 --- a/FrmBufferAnalysisBSQ.cs +++ b/FrmBufferAnalysisBSQ.cs @@ -137,35 +137,7 @@ } } - private void txtRadius_KeyPress(object sender, KeyPressEventArgs e) - { - TextBox text = sender as TextBox; - if ((e.KeyChar < 48 || e.KeyChar > 57) && (e.KeyChar != 8) && (int)e.KeyChar != 46) - { - e.Handled = true; - } - if ((int)e.KeyChar == 46) //小数点 - { - if (text.Text.Length <= 0) - e.Handled = true; //小数点不能在第一位 - else //处理不规则的小数点 - { - float f; - float oldf; - bool b1 = false, b2 = false; - b1 = float.TryParse(text.Text, out oldf); - b2 = float.TryParse(text.Text + e.KeyChar.ToString(), out f); - if (b2 == false) - { - if (b1 == true) - e.Handled = true; - else - e.Handled = false; - } - } - } - } - + private void FrmBufferAnalysis_FormClosing(object sender, FormClosingEventArgs e) { //Form1.y = 0; @@ -316,27 +288,6 @@ } } - private void FlyToMenu_Click(object sender, EventArgs e) - { - if (m_feature != null) - { - if (m_feature.Geometry != null && m_feature.Geometry.Type == EnumGeometryType.GeoPolyline3D) - { - GSOGeoPolyline3D line = m_feature.Geometry as GSOGeoPolyline3D; - double length = line.GetSpaceLength(true, 6378137); - GSOGeoPolyline3D lineLine = line.GetSegment(0, length / 2); - GSOPoint3d point3d = lineLine[lineLine.PartCount - 1][lineLine[lineLine.PartCount - 1].Count - 1]; - - globeControl1.Globe.FlyToPosition(point3d, EnumAltitudeMode.Absolute, 0, 45, 5); - } - else - { - globeControl1.Globe.FlyToFeature(m_feature, 0, 45, 3); - } - LightMenu_Click(sender, e); - } - } - private void LightMenu_Click(object sender, EventArgs e) { flashflag = "single"; diff --git a/FrmDataBaseOpt.cs b/FrmDataBaseOpt.cs index b0c4b5d..8d7b69d 100644 --- a/FrmDataBaseOpt.cs +++ b/FrmDataBaseOpt.cs @@ -362,6 +362,7 @@ dbCombor.Items.Add(dblist[i].title); } } + /* /// /// 从配置文件读取数据库参数配置 /// @@ -428,6 +429,8 @@ } } + * */ + /* /// /// 向配置文件写入连接数据库的参数配置 /// @@ -485,6 +488,7 @@ MessageBox.Show(exp.ToString()); } } + * */ /// /// /// diff --git a/FrmDatabaseParaSetting.cs b/FrmDatabaseParaSetting.cs index a6fea46..63b596b 100644 --- a/FrmDatabaseParaSetting.cs +++ b/FrmDatabaseParaSetting.cs @@ -152,6 +152,7 @@ this.DialogResult = DialogResult.OK; this.Close(); } + /* /// /// 从配置文件读取数据库连接参数配置 /// @@ -218,6 +219,8 @@ } } + * */ + /* /// /// 向配置文件写入数据库参数配置 /// @@ -276,7 +279,7 @@ MessageBox.Show(ex.ToString()); } } - + */ /// /// 取消按钮事件处理 /// diff --git a/FrmDatabaseParaSetting2.cs b/FrmDatabaseParaSetting2.cs index 932d05e..96a87d5 100644 --- a/FrmDatabaseParaSetting2.cs +++ b/FrmDatabaseParaSetting2.cs @@ -148,6 +148,7 @@ this.DialogResult = DialogResult.OK; this.Close(); } + /* /// /// 从配置文件读取数据库连接参数配置 /// @@ -214,6 +215,8 @@ } } + * */ + /* /// /// 向配置文件写入数据库参数配置 /// @@ -272,7 +275,7 @@ MessageBox.Show(exp.ToString()); } } - + */ /// /// 取消按钮事件处理 /// diff --git a/FrmDiameterQuery.cs b/FrmDiameterQuery.cs index 68c948b..9a5215b 100644 --- a/FrmDiameterQuery.cs +++ b/FrmDiameterQuery.cs @@ -77,18 +77,7 @@ isBetween = true; } } - /// - /// 键盘按键按下事件处理 - /// - /// - /// - private void textBoxX1_KeyPress(object sender, KeyPressEventArgs e) - { - if ((e.KeyChar < 48 || e.KeyChar > 57) && e.KeyChar != 8) - { - e.Handled = true;//屏蔽 - } - } + bool isBetween = false; /// diff --git a/FrmDocumentEdit.cs b/FrmDocumentEdit.cs index aab2d31..e78a7ff 100644 --- a/FrmDocumentEdit.cs +++ b/FrmDocumentEdit.cs @@ -256,121 +256,6 @@ } - // - /// 将本地文件上传到指定的服务器(HttpWebRequest方法) - /// - /// 文件上传到的服务器 - /// 要上传的本地文件(全路径) - /// 文件上传后的名称 - /// 上传进度条 - /// 成功返回1,失败返回0 - private int Upload_Request(string address, string fileNamePath, string saveName, ProgressBar progressBar) - { - int returnValue = 0; - // 要上传的文件 - FileStream fs = new FileStream(fileNamePath, FileMode.Open, FileAccess.Read); - BinaryReader r = new BinaryReader(fs); - //时间戳 - string strBoundary = "----------" + DateTime.Now.Ticks.ToString("x"); - byte[] boundaryBytes = Encoding.ASCII.GetBytes("/r/n--" + strBoundary + "/r/n"); - //请求头部信息 - StringBuilder sb = new StringBuilder(); - sb.Append("--"); - sb.Append(strBoundary); - sb.Append("\r\n"); - sb.Append("Content-Disposition: form-data; name=\""); - sb.Append("file"); - sb.Append("\"; filename=\""); - sb.Append(saveName); - sb.Append("\""); - sb.Append("\r\n"); - sb.Append("Content-Type: "); - sb.Append("application/octet-stream"); - sb.Append("\r\n"); - sb.Append("\r\n"); - string strPostHeader = sb.ToString(); - byte[] postHeaderBytes = Encoding.UTF8.GetBytes(strPostHeader); - // 根据uri创建HttpWebRequest对象 - HttpWebRequest httpReq = (HttpWebRequest)WebRequest.Create(new Uri(address)); - httpReq.Method = "POST"; - //对发送的数据不使用缓存 - httpReq.AllowWriteStreamBuffering = false; - //设置获得响应的超时时间(300秒) - httpReq.Timeout = 300000; - httpReq.ContentType = "multipart/form-data; boundary=" + strBoundary; - long length = fs.Length + postHeaderBytes.Length + boundaryBytes.Length; - long fileLength = fs.Length; - httpReq.ContentLength = length; - try - { - progressBar.Maximum = int.MaxValue; - progressBar.Minimum = 0; - progressBar.Value = 0; - //每次上传4k - int bufferLength = 4096; - byte[] buffer = new byte[bufferLength]; - //已上传的字节数 - long offset = 0; - //开始上传时间 - DateTime startTime = DateTime.Now; - int size = r.Read(buffer, 0, bufferLength); - Stream postStream = httpReq.GetRequestStream(); - //发送请求头部消息 - postStream.Write(postHeaderBytes, 0, postHeaderBytes.Length); - while (size > 0) - { - postStream.Write(buffer, 0, size); - offset += size; - progressBar.Value = (int)(offset * (int.MaxValue / length)); - TimeSpan span = DateTime.Now - startTime; - double second = span.TotalSeconds; - //lblTime.Text = "已用时:" + second.ToString("F2") + "秒"; - //if (second > 0.001) - //{ - // lblSpeed.Text = " 平均速度:" + (offset / 1024 / second).ToString("0.00") + "KB/秒"; - //} - //else - //{ - // lblSpeed.Text = " 正在连接…"; - //} - //lblState.Text = "已上传:" + (offset * 100.0 / length).ToString("F2") + "%"; - //lblSize.Text = (offset / 1048576.0).ToString("F2") + "M/" + (fileLength / 1048576.0).ToString("F2") + "M"; - Application.DoEvents(); - size = r.Read(buffer, 0, bufferLength); - } - //添加尾部的时间戳 - postStream.Write(boundaryBytes, 0, boundaryBytes.Length); - postStream.Close(); - //获取服务器端的响应 - WebResponse webRespon = httpReq.GetResponse(); - Stream s = webRespon.GetResponseStream(); - StreamReader sr = new StreamReader(s); - //读取服务器端返回的消息 - String sReturnString = sr.ReadLine(); - s.Close(); - sr.Close(); - if (sReturnString == "Success") - { - returnValue = 1; - } - else if (sReturnString == "Error") - { - returnValue = 0; - } - } - catch(Exception ex) - { - returnValue = 0; - string str = ex.ToString(); - } - finally - { - fs.Close(); - r.Close(); - } - return returnValue; - } - private void btn_file_Click(object sender, EventArgs e) { OpenFileDialog dlg = new OpenFileDialog(); diff --git a/FrmExportCADS.cs b/FrmExportCADS.cs index 98772ea..59629dd 100644 --- a/FrmExportCADS.cs +++ b/FrmExportCADS.cs @@ -108,65 +108,6 @@ MessageBox.Show("请选中要导出的图层!", "提示", MessageBoxButtons.OK, MessageBoxIcon.Warning); } } - private Boolean MerageToFile(GSOFeatures features, String strDestFile, String strProj4)//图层追加 - { - if (features == null) - { - return false; - } - Boolean bSuccess = false; - - string strDir = GSOUtility.GetFileDir(strDestFile); - string strLPRJFile = GSOUtility.ChangeExt(strDestFile, ".lprj"); - string strExt = GSOUtility.GetFileExt(strDestFile); - - // 如果投影文件存在,投影以投影文件为准 - if (File.Exists(strLPRJFile)) - { - // 如果是dxf,则这样处理 - if (strExt.ToLower() == ".dxf") - { - string strTempSrcFile = strDir + "srcFeatures_dxftmp" + strExt; - globeControl1.Globe.DataManager.SaveFeatureData(features, strTempSrcFile, strLPRJFile, 4); - bSuccess = GSOUtility.MergeTwoDXFFileFeatures(strDestFile, strTempSrcFile); - File.Delete(strTempSrcFile); - } - else - { - GSOFeatures srcFeatures = globeControl1.Globe.DataManager.ReadFeatureData(strDestFile); - int nCount = features.Length; - int i = 0; - for (i = 0; i < nCount; i++) - { - srcFeatures.Add(features[i]); - } - bSuccess = globeControl1.Globe.DataManager.SaveFeatureData(srcFeatures, strDestFile, strLPRJFile, 4); - } - } - else - { - // 如果是dxf,则这样处理 - if (strExt.ToLower() == ".dxf") - { - string strTempSrcFile = strDir + "srcFeatures_dxftmp" + strExt; - globeControl1.Globe.DataManager.SaveFeatureData(features, strTempSrcFile, strProj4, 0); - bSuccess = GSOUtility.MergeTwoDXFFileFeatures(strDestFile, strTempSrcFile); - File.Delete(strTempSrcFile); - } - else - { - GSOFeatures srcFeatures = globeControl1.Globe.DataManager.ReadFeatureData(strDestFile); - int nCount = features.Length; - int i = 0; - for (i = 0; i < nCount; i++) - { - srcFeatures.Add(features[i]); - } - bSuccess = globeControl1.Globe.DataManager.SaveFeatureData(srcFeatures, strDestFile, strProj4, 0); - } - } - return bSuccess; - } /// /// 关闭按钮事件处理 /// diff --git a/FrmHDMAnalysis3.cs b/FrmHDMAnalysis3.cs index 4f73af6..2ada735 100644 --- a/FrmHDMAnalysis3.cs +++ b/FrmHDMAnalysis3.cs @@ -436,29 +436,6 @@ } layerTemp.RemoveAllFeature(); } - private void Export(GSOPoint3d _pnt, double r) - { - GSOPoint3ds pnts = new GSOPoint3ds(); - GSOPoint3d pnt = new GSOPoint3d(); - pnt.X = _pnt.X; - pnt.Y = _pnt.Y; - pnt.Z = _pnt.Z; - pnts.Add(pnt); - pnt.X = _pnt.X; - pnt.Y = _pnt.Y - 0.0000000005; - pnt.Z = _pnt.Z; - pnts.Add(pnt); - GSOGeoPolyline3D line = new GSOGeoPolyline3D(); - line.AddPart(pnts); - GSOGeoPolygon3D polygon = line.CreateBuffer(r * 2, true, 5, true, false); - GSOPoint3ds points = polygon[0]; - GSOGeoPolyline3D newLine = new GSOGeoPolyline3D(); - newLine.AddPart(points); - newLine.AltitudeMode = EnumAltitudeMode.RelativeToGround; - GSOFeature newFeature = new GSOFeature(); - newFeature.Geometry = newLine; - globeControl1.Globe.MemoryLayer.AddFeature(newFeature); - } private void ExportCAD(double a, double b, double r) { diff --git a/FrmHotFuncStat.cs b/FrmHotFuncStat.cs index c980f34..2eb1476 100644 --- a/FrmHotFuncStat.cs +++ b/FrmHotFuncStat.cs @@ -421,13 +421,6 @@ } } - private void HFS_Pderive_Click(object sender, EventArgs e) - { - if (TV_Files.SelectedNode != null) - { - HFSClass.GuideEdit_form("G", TV_Files, int.Parse(((ToolStripMenuItem)sender).Tag.ToString())); - } - } private void 导入ToolStripMenuItem_Click(object sender, EventArgs e) { @@ -530,22 +523,8 @@ } } - private void 导出ToolStripMenuItem1_Click(object sender, EventArgs e) - { - 导出ToolStripMenuItem2_Click(sender, e); - } + - private void TV_HFSSrchRslt_AfterCollapse(object sender, TreeViewEventArgs e) - { - e.Node.ImageIndex = 0; - } - - private void TV_HFSSrchRslt_AfterExpand(object sender, TreeViewEventArgs e) - { - HFSClass.ADD_TreeNode(TV_Files, e.Node); - e.Node.ImageIndex = 1; - } - private void 导出ToolStripMenuItem1_Click_1(object sender, EventArgs e) { if ((TV_HFSSrchRslt.SelectedNode != null) && (TV_HFSSrchRslt.SelectedNode.Parent != null)) diff --git a/FrmLayerControl.cs b/FrmLayerControl.cs index e7917c3..28fa14d 100644 --- a/FrmLayerControl.cs +++ b/FrmLayerControl.cs @@ -312,26 +312,7 @@ layerManagerNode.Expand(); terrainManagerNode.Expand(); } - /// - /// 刷新节点树 - /// - private void RefreshDataTree() - { - layerTree2.Nodes[0].Nodes.Clear(); - Int32 nCount = globeControl2.Globe.Layers.Count; - Int32 i = 0; - for (i = 0; i < nCount; i++) - { - GSODataset dataSpace = globeControl2.Globe.Layers[i].Dataset; - TreeNode node = new TreeNode(); - node.Text = dataSpace.Name; - node.ImageIndex = 0; - node.SelectedImageIndex = 0; - node.Checked = true; - node.Tag = dataSpace; - layerTree2.Nodes[0].Nodes.Add(node); - } - } + /// /// 目标图层按钮事件处理 /// @@ -494,22 +475,8 @@ } } } - /// - /// 改变指定节点的选中状态 - /// - /// - /// - private void CheckTreeNode(TreeNode node, Boolean bChecked) - { - CheckChildTreeNode(node, bChecked); - // 对于kml图层,如果当前处理的节点是true,那么要把所有的祖宗节点置为true - // 只有所有节点都未false,那么这个节点才为false - // CheckFatherTreeNode(node, bChecked); - globeControl1.Globe.Refresh(); - globeControl2.Globe.Refresh(); - - } + private void CheckChildTreeNode(TreeNode node, Boolean bChecked) { if (node == null) @@ -696,59 +663,7 @@ //} //CheckControl(e); } - /// - /// 树节点选中方法 - /// - /// - private void CheckControl(TreeViewEventArgs e) - { - if (e.Action != TreeViewAction.Unknown) - { - if (e.Node != null && !Convert.IsDBNull(e.Node)) - { - CheckParentNode(e.Node); - if (e.Node.Nodes.Count > 0) - { - CheckAllChildNodes(e.Node, e.Node.Checked); - } - } - } - } - /// - /// 改变所有子节点的状态 - /// - /// - /// - private void CheckAllChildNodes(TreeNode pn, bool IsChecked) - { - foreach (TreeNode tn in pn.Nodes) - { - tn.Checked = IsChecked; - if (tn.Tag.ToString().Contains("|")) - { - string nodeTag = tn.Tag.ToString().Split('|')[1]; - GSOLayer layer = globeControl1.Globe.Layers.GetLayerByCaption(nodeTag); - if (layer != null) - { - layer.Visible = IsChecked; - globeControl1.Globe.Refresh(); - } - } - if (tn.Tag is GSOFeature) - { - if (tn.Nodes.Count == 0) - { - GSOFeature feat = tn.Tag as GSOFeature; - feat.Visible = IsChecked; - globeControl1.Globe.Refresh(); - } - } - if (tn.Nodes.Count > 0) - { - CheckAllChildNodes(tn, IsChecked); - } - } - } + /// /// 改变父节点的选中状态,此处为所有子节点不选中时才取消父节点选中,可以根据需要修改 /// diff --git a/FrmLogin.cs b/FrmLogin.cs index 320fdd5..2afe46e 100644 --- a/FrmLogin.cs +++ b/FrmLogin.cs @@ -59,70 +59,6 @@ textBoxPassWord.Clear(); } } - - /// - /// 验证端口号 - /// - /// - private bool ValiPort() - { - Ping p = new Ping();//创建Ping对象p - PingReply pr = p.Send(Utility.localicenseserverip);//向指定IP或者主机名的计算机发送ICMP协议的ping数据包 - if (pr.Status == IPStatus.Success)//如果ping成功 - { - try - { - TcpClient tcpc = new TcpClient(Utility.localicenseserverip, Utility.localicenseserverport);//对IP地址为"192.168.0.105"的计算机的1500端口提出连接申请 - tcpc.Close(); - return true; - } - catch (Exception ex) - { - MessageBox.Show("端口连接错误!" + ex.Message); - return false; - } - } - else - { - int times = 0;//重新连接次数; - int count = 2;//设置尝试次数 - while (times < count) - { - //Thread.Sleep(1000);//等待时间(方便测试的话,你可以改为1000) - pr = p.Send(Utility.localicenseserverip); - - if (pr.Status == IPStatus.Success) - { - try - { - TcpClient tcpc = new TcpClient(Utility.localicenseserverip, Utility.localicenseserverport);//对IP地址为"192.168.0.105"的计算机的1500端口提出连接申请 - tcpc.Close(); - return true; - } - catch (Exception ex) - { - MessageBox.Show("端口连接错误!" + ex.Message); - return false; - } - } - else - { - times++; - if (times < count) - { - continue; - } - else - { - MessageBox.Show("重新尝试连接失败"); - return false; - } - } - - } - return false; - } - } /// /// 验证用户名、密码 /// diff --git a/FrmMetadata.cs b/FrmMetadata.cs index 886f65a..0365372 100644 --- a/FrmMetadata.cs +++ b/FrmMetadata.cs @@ -27,11 +27,7 @@ InitializeComponent(); loadTreeView(layerTree); } - private void FrmMetadata_Load(object sender, EventArgs e) - { - //this.ntLblC.Text = "nn"; - // loadTreeView(layerTree); - } + private void loadTreeView(TreeView tv)//构建图层树 { try diff --git a/FrmMetadataStat.cs b/FrmMetadataStat.cs index 790658a..e7696c6 100644 --- a/FrmMetadataStat.cs +++ b/FrmMetadataStat.cs @@ -197,9 +197,5 @@ } } - private void buttonX1_Click(object sender, EventArgs e) - { - drawChart(); - } } } diff --git a/FrmPatrolerManager.cs b/FrmPatrolerManager.cs index 37f8ffd..9e66aeb 100644 --- a/FrmPatrolerManager.cs +++ b/FrmPatrolerManager.cs @@ -109,82 +109,8 @@ this.winGridViewPager1.AllToExport = table; } - /// - /// 编辑 - /// - /// - /// - private void winGridViewPager1_OnEditSelected(object sender, EventArgs e) - { - - DataGridView grid = sender as DataGridView; - if (grid != null && grid.SelectedRows.Count>0) - { - DataGridViewRow row = grid.SelectedRows[0]; - try - { - long dbid = long.Parse(row.Cells["编号"].Value.ToString()); - String name = row.Cells["姓名"].Value.ToString(); - String sex = row.Cells["性别"].Value.ToString(); - String age = row.Cells["年龄"].Value.ToString(); - string phone = row.Cells["电话"].Value.ToString(); - age = String.IsNullOrEmpty(age.ToString().Trim()) ? "1" : age.ToString().Trim(); - FrmPatrolerEdit frm = new FrmPatrolerEdit(dbid.ToString(), name, age, sex, phone); - frm.reloadGrid += new ReloadPatrolerGrid(LoadData); - frm.ShowDialog(); - winGridViewPager1.Refresh(); - } - catch (Exception ex) - { - MessageBox.Show("编辑失败:" + ex.ToString(), "错误", MessageBoxButtons.OK, MessageBoxIcon.Error); - } - } - else - { - MessageBox.Show("没有选择记录", "提示"); - } - - } - - /// - /// 删除 - /// - /// - /// - private void winGridViewPager1_OnDeleteSelected(object sender, EventArgs e) - { - DataGridView grid = sender as DataGridView; - if (grid != null && grid.SelectedRows.Count > 0) - { - DataGridViewRow row = grid.SelectedRows[0]; - long dbid = long.Parse(row.Cells["编号"].Value.ToString()); - try - { - string state = row.Cells["状态"].Value.ToString(); - if ("在线".Equals(state)) - { - if (MessageBox.Show("确定注销?", "确认", MessageBoxButtons.YesNo, MessageBoxIcon.Question) == DialogResult.Yes) - { - String sql = "update patroler t set t.accountstate='LEAVER' where t.dbid=" + dbid; - OracleUtils.ExecuteNonQuery(OracleUtils.ConnectionString, CommandType.Text, sql); - } - } - else { - MessageBox.Show("人员不在线,无法注销", "信息"); - } - } - catch (Exception ex) - { - MessageBox.Show("人员注销失败:" + ex.ToString(), "错误", MessageBoxButtons.OK, MessageBoxIcon.Error); - } - } - else - { - MessageBox.Show("没有选择记录", "提示"); - } - } - - + + private void LoadData() { int pageIndex = winGridViewPager1.PagerInfo.CurrenetPageIndex; diff --git a/FrmRoadHDM.cs b/FrmRoadHDM.cs index e765313..e871dd5 100644 --- a/FrmRoadHDM.cs +++ b/FrmRoadHDM.cs @@ -333,31 +333,6 @@ this.Cursor = Cursors.Default; } } - - private void Export(GSOPoint3d _pnt, double r) - { - GSOPoint3ds pnts = new GSOPoint3ds(); - GSOPoint3d pnt = new GSOPoint3d(); - pnt.X = _pnt.X; - pnt.Y = _pnt.Y; - pnt.Z = _pnt.Z; - pnts.Add(pnt); - pnt.X = _pnt.X; - pnt.Y = _pnt.Y - 0.0000000005; - pnt.Z = _pnt.Z; - pnts.Add(pnt); - GSOGeoPolyline3D line = new GSOGeoPolyline3D(); - line.AddPart(pnts); - GSOGeoPolygon3D polygon = line.CreateBuffer(r * 2, true, 5, true, false); - GSOPoint3ds points = polygon[0]; - GSOGeoPolyline3D newLine = new GSOGeoPolyline3D(); - newLine.AddPart(points); - newLine.AltitudeMode = EnumAltitudeMode.RelativeToGround; - GSOFeature newFeature = new GSOFeature(); - newFeature.Geometry = newLine; - globeControl1.Globe.MemoryLayer.AddFeature(newFeature); - } - private void ExportCAD(double a, double b, double r) { GSOPoint3ds pnts = new GSOPoint3ds(); diff --git a/FrmUserAdd.cs b/FrmUserAdd.cs index c612ab4..f826427 100644 --- a/FrmUserAdd.cs +++ b/FrmUserAdd.cs @@ -231,24 +231,6 @@ //cbxRegion.SelectedIndexChanged += new EventHandler(cbxRegion_SelectedIndexChanged); } } - /// - /// 下拉框选中项改变事件处理 - /// - /// - /// - private void cbxRegion_SelectedIndexChanged(object sender, EventArgs e) - { - string sql = ""; - //string sql = "select casic_role.\"name\" from casic_role join casic_regionrole on casic_role.\"id\"=casic_regionrole.\"rid\" where casic_regionrole.\"reid\"=" + region[cbxRegion.SelectedItem.ToString().Trim()]; - DataTable dt = OledbHelper.QueryTable(sql); - if (dt != null && dt.Rows.Count > 0) - { - comboBoxExRegionRole.Items.Clear(); - for (int i = 0; i < dt.Rows.Count; i++) - { - comboBoxExRegionRole.Items.Add(dt.Rows[i][0].ToString().Trim());//部门角色 - } - } - } + } } diff --git a/FrmUserManager.cs b/FrmUserManager.cs index 571f0f0..ae254bc 100644 --- a/FrmUserManager.cs +++ b/FrmUserManager.cs @@ -81,11 +81,6 @@ } } } - //创建新用户 - private void buttonX2_Click(object sender, EventArgs e) - { - FrmUserAdd frm = new FrmUserAdd(-1); - frm.ShowDialog(); - } + } } diff --git a/FrmValveStatistics.cs b/FrmValveStatistics.cs index 545d56c..dd76777 100644 --- a/FrmValveStatistics.cs +++ b/FrmValveStatistics.cs @@ -54,7 +54,7 @@ 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") + if (chaFamenStatis.Series["阀门"].Points[m]!=null&&chaFamenStatis.Series["阀门"].Points[m].YValues[0].ToString() != "0") { chaFamenStatis.Series["阀门"].Points[m].Label = chaFamenStatis.Series[0].Points[m].YValues[0].ToString(); } diff --git a/Frm_password_reset.cs b/Frm_password_reset.cs index 7b51039..b9e5dc3 100644 --- a/Frm_password_reset.cs +++ b/Frm_password_reset.cs @@ -41,6 +41,7 @@ } catch (Exception ex) { + LogHelper.WriteLog(typeof(Frm_password_reset), ex.Message); } } private void initCombox() diff --git a/FrmpipeDeepstatis.cs b/FrmpipeDeepstatis.cs index e156db4..1a84d6c 100644 --- a/FrmpipeDeepstatis.cs +++ b/FrmpipeDeepstatis.cs @@ -307,7 +307,7 @@ chart1.Series[j].Points.DataBindXY(dic1.Keys, dic1.Values); for (int m = 0; m < dic1.Values.Count; m++) { - if (chart1.Series[j].Points[m].YValues[0].ToString() != "0") + if (chart1.Series[j].Points[m]!=null&&chart1.Series[j].Points[m].YValues[0].ToString() != "0") { chart1.Series[j].Points[m].Label = chart1.Series[j].Points[m].YValues[0].ToString(); diff --git a/FrmpipeDiametergather.cs b/FrmpipeDiametergather.cs index 30674de..057b09d 100644 --- a/FrmpipeDiametergather.cs +++ b/FrmpipeDiametergather.cs @@ -263,6 +263,7 @@ if (layer != null && layer is GSOFeatureLayer) { GSOFeatureLayer flayer = layer as GSOFeatureLayer; + if (layer == null) return; GSOFeatures features = flayer.GetAllFeatures(); if (features.Length > 0) { diff --git a/FrmpipeMaterialGather.cs b/FrmpipeMaterialGather.cs index c133ec3..398b884 100644 --- a/FrmpipeMaterialGather.cs +++ b/FrmpipeMaterialGather.cs @@ -280,6 +280,7 @@ if (layer != null && layer is GSOFeatureLayer) { GSOFeatureLayer flayer = layer as GSOFeatureLayer; + if (flayer == null) return; GSOFeatures features = flayer.GetAllFeatures(); if (features.Length > 0) { @@ -332,7 +333,7 @@ chart1.Series[j].Points.DataBindXY(dic1.Keys, dic1.Values); for (int m = 0; m < dic1.Values.Count; m++) { - if (chart1.Series[j].Points[m].YValues[0].ToString() != "0") + if (chart1.Series[j].Points[m]!=null&&chart1.Series[j].Points[m].YValues[0].ToString() != "0") { chart1.Series[j].Points[m].Label = chart1.Series[j].Points[m].YValues[0].ToString(); } diff --git a/Frmpipediameterstatis.cs b/Frmpipediameterstatis.cs index c0ed80a..50f8170 100644 --- a/Frmpipediameterstatis.cs +++ b/Frmpipediameterstatis.cs @@ -286,6 +286,7 @@ chart1.Series.Add(layerCaption); GSOFeatureLayer flayer = layer as GSOFeatureLayer; + if (layer == null) return; GSOFeatures features = flayer.GetAllFeatures(); if (features.Length > 0) { diff --git "a/GKT_Forms/F_GKT\346\225\260\346\215\256\350\276\223\345\205\245\350\276\223\345\207\272.cs" "b/GKT_Forms/F_GKT\346\225\260\346\215\256\350\276\223\345\205\245\350\276\223\345\207\272.cs" index c7bffd5..4db7d5d 100644 --- "a/GKT_Forms/F_GKT\346\225\260\346\215\256\350\276\223\345\205\245\350\276\223\345\207\272.cs" +++ "b/GKT_Forms/F_GKT\346\225\260\346\215\256\350\276\223\345\205\245\350\276\223\345\207\272.cs" @@ -198,12 +198,7 @@ } DialogResult = DialogResult.OK;//将当前窗体的对话框返回值设为OK } - private void treeView1_NodeMouseClick(object sender, TreeNodeMouseClickEventArgs e) - { - dir_Ok = comboBox_Disk.Text + e.Node.FullPath; - //dir = comboBox_Disk.Text + e.Node.FullPath; - e.Node.SelectedImageIndex = e.Node.ImageIndex; - } + string tempstr = ""; private void button1_Click(object sender, EventArgs e) { diff --git a/HFS_Forms/Frm_HFSprojedits.cs b/HFS_Forms/Frm_HFSprojedits.cs index 96dd76f..3c232a1 100644 --- a/HFS_Forms/Frm_HFSprojedits.cs +++ b/HFS_Forms/Frm_HFSprojedits.cs @@ -126,16 +126,6 @@ Close(); } - - - private void TB_ProjName_KeyPress(object sender, KeyPressEventArgs e) - { - if (HFSAClass.Files_NameChar(e) == 0) - e.Handled = true; - if (e.KeyChar == '\r') - OK_Click(sender, e); - } - private void Frm_HFSProjedit_Load(object sender, EventArgs e) { @@ -175,10 +165,6 @@ } } - private void Cancel_Click(object sender, EventArgs e) - { - this.Close(); - } private void Cancel_Click_1(object sender, EventArgs e) { diff --git a/MainFrm.cs b/MainFrm.cs index 2c305a0..ed2685b 100644 --- a/MainFrm.cs +++ b/MainFrm.cs @@ -617,7 +617,7 @@ } catch (Exception ex) { - + LogHelper.WriteLog(typeof(MainFrm), ex.Message); } } @@ -1768,7 +1768,7 @@ } catch (Exception ex) { - //LogError.PublishError(ex); + LogHelper.WriteLog(typeof(MainFrm), ex.Message); } } @@ -2026,6 +2026,7 @@ } catch (Exception ex) { + LogHelper.WriteLog(typeof(MainFrm), ex.Message); result = false; } finally @@ -2316,220 +2317,6 @@ string filename = Utility.filename; List g1layername = new List(); /// - /// 构建图层列表目录树 - /// - /// - private void loadTreeView(TreeView tv) - { - try - { - XmlDocument doc = new XmlDocument(); - doc.Load(filename); - XmlNodeList Params1 = doc.SelectNodes("/Params/layers"); - tv.ShowLines = false; - tv.CheckBoxes = true; - - foreach (XmlNode paramsNode in Params1) //layers - { - foreach (XmlNode layerNode in paramsNode) //layer - { - TreeNode nodelayer = new TreeNode(); - string layerName = layerNode.Attributes["label"].Value; - nodelayer.Text = layerName; - - if (layerNode.HasChildNodes != false) - { - tv.Nodes.Add(nodelayer); - foreach (XmlNode layerchildNode in layerNode) //layerchild - { - if (layerchildNode.Name == "layerchild") - { - TreeNode nodelayerchild = new TreeNode(); - string layerType = layerchildNode.Attributes["type"].Value; - string layerName1 = layerchildNode.Attributes["layer"].Value; - string layerchildName = layerchildNode.Attributes["label"].Value; - if (layerType == "locaserver") - { - if (layerchildNode.Attributes["isRoad"] != null) - { - roadLayerName = layerchildName; - } - dictionaryNetLayerNameAndCaption.Add(layerName1, layerchildName); - - nodelayerchild.Text = layerchildName; - nodelayerchild.Tag = layerType + "|" + layerchildName; - nodelayerchild.Checked = true; - nodelayer.Nodes.Add(nodelayerchild); - } - else - { - if (layerchildNode.Attributes["isPipeLine"] != null) - { - m_PipelineLayerNames.Add(layerchildName); - } - if (layerchildNode.Attributes["isWorkWell"] != null) - { - workwellLayerNames.Add(layerchildName); - } - if (layerchildNode.Attributes["isValve"] != null) - { - valueLayerNames.Add(layerchildName); - } - //if (layerchildNode.Attributes["isInstrument"] != null) - if (layerchildNode.Attributes["isAccess"] != null) - { - instrumenLayerNames.Add(layerchildName); - } - //if (layerchildNode.Attributes["isPipeFitting"] != null) - if (layerchildNode.Attributes["isCharacter"] != null) - { - pipefittingLayerNames.Add(layerchildName); - } - bool boollayer = AddLayers(layerName1, layerchildName); - nodelayerchild.Text = layerchildName; - nodelayerchild.Tag = layerType + "|" + layerchildName; - nodelayerchild.Checked = boollayer; - if (layerchildName.Contains("特征管点")) - { - nodelayerchild.Checked = false; - setLayerVisible(layerName1); - } - - nodelayer.Nodes.Add(nodelayerchild); - g1layername.Add(layerName1); - } - } - else if (layerchildNode.Name == "layertype") - { - TreeNode nodelayerchild = new TreeNode(); - string layerType = layerchildNode.Attributes["label"].Value; - nodelayerchild.Text = layerType; - nodelayerchild.Tag = layerType; - nodelayerchild.Checked = true; - nodelayer.Nodes.Add(nodelayerchild); - if (layerchildNode.HasChildNodes == true) - { - foreach (XmlNode childNodeLayer in layerchildNode) - { - if (childNodeLayer.HasChildNodes == true) - { - TreeNode nodelayerchild2 = new TreeNode(); - string layer = childNodeLayer.Attributes["label"].Value; - nodelayerchild2.Text = layer; - nodelayerchild2.Tag = layer; - nodelayerchild2.Checked = true; - nodelayerchild.Nodes.Add(nodelayerchild2); - foreach (XmlNode n in childNodeLayer) - { - TreeNode nodelayerchild1 = new TreeNode(); - string layerName1 = n.Attributes["layer"].Value; - string layerchildName = n.Attributes["label"].Value; - string layerType1 = n.Attributes["type"].Value; - if (n.Attributes["isPipeLine"] != null) - { - m_PipelineLayerNames.Add(layerchildName); - } - if (n.Attributes["isWorkWell"] != null) - { - workwellLayerNames.Add(layerchildName); - } - if (n.Attributes["isValve"] != null) - { - valueLayerNames.Add(layerchildName); - } - if (n.Attributes["isAccess"] != null) - //if (n.Attributes["isInstrument"] != null) - { - instrumenLayerNames.Add(layerchildName); - } - if (n.Attributes["isPipeFitting"] != null) - { - pipefittingLayerNames.Add(layerchildName); - } - bool boollayer = AddLayers(layerName1, layerchildName); - nodelayerchild1.Text = layerchildName; - nodelayerchild1.Tag = layerType1 + "|" + layerchildName; - nodelayerchild1.Checked = boollayer; - if (layerchildName.Contains("特征管点")) - { - nodelayerchild1.Checked = false; - setLayerVisible(layerName1); - } - - nodelayerchild2.Nodes.Add(nodelayerchild1); - - g1layername.Add(layerName1); - } - } - else - { - TreeNode nodelayerchild1 = new TreeNode(); - string layerName1 = childNodeLayer.Attributes["layer"].Value; - string layerchildName = childNodeLayer.Attributes["label"].Value; - string layerType1 = childNodeLayer.Attributes["type"].Value; - if (childNodeLayer.Attributes["isPipeLine"] != null) - { - m_PipelineLayerNames.Add(layerchildName); - } - if (childNodeLayer.Attributes["isWorkWell"] != null) - { - workwellLayerNames.Add(layerchildName); - } - if (childNodeLayer.Attributes["isValve"] != null) - { - valueLayerNames.Add(layerchildName); - } - if (childNodeLayer.Attributes["isAccess"] != null) - //if (childNodeLayer.Attributes["isInstrument"] != null) - { - instrumenLayerNames.Add(layerchildName); - } - if (childNodeLayer.Attributes["isPipeFitting"] != null) - { - pipefittingLayerNames.Add(layerchildName); - } - bool boollayer = AddLayers(layerName1, layerchildName); - nodelayerchild1.Text = layerchildName; - nodelayerchild1.Tag = layerType1 + "|" + layerchildName; - nodelayerchild1.Checked = boollayer; - if (layerchildName.Contains("特征管点")) - { - nodelayerchild1.Checked = false; - setLayerVisible(layerName1); - } - nodelayerchild.Nodes.Add(nodelayerchild1); - g1layername.Add(layerName1); - } - } - } - } - } - } - else - { - tv.Nodes.Add(nodelayer); - } - } - } - - foreach (TreeNode tn in tv.Nodes) - { - if (tn.Nodes.Count > 0) - { - foreach (TreeNode tnChild in tn.Nodes) - { - if (tnChild.Checked) - tn.Checked = true; - } - } - } - } - catch (Exception ex) - { - //LogError.PublishError(ex); - } - } - /// /// 获取目标图层 /// /// @@ -2629,21 +2416,11 @@ } catch (Exception ex) { - //LogError.PublishError(ex); + LogHelper.WriteLog(typeof(MainFrm), ex.Message); return false; } } /// - /// 菜单上的 三维导航 工具按钮 - /// - /// - /// - private void buttonItem86_Click(object sender, EventArgs e) - { - globeControl1.Globe.Action = EnumAction3D.ActionNull; - } - - /// /// 地上模式 菜单按钮 /// /// @@ -3026,67 +2803,11 @@ } Image printImage; - /// - /// 打印 菜单 - /// - /// - /// - private void buttonItem13_Click(object sender, EventArgs e) - { - Point pt1 = new Point(Convert.ToInt32(0), Convert.ToInt32(0)); - Point pt2 = new Point(Convert.ToInt32(panelEx5.Width), Convert.ToInt32(panelEx5.Height)); - int mapWidth = 0; - int mapHeight = 0; - Point pt = getUpperLeftPoint(pt1, pt2, out mapWidth, out mapHeight); - printImage = new Bitmap(Convert.ToInt32(panelEx5.Width), Convert.ToInt32(panelEx5.Height)); - Graphics g = Graphics.FromImage(printImage); - g.CopyFromScreen(pt, new Point(0, 0), new Size(Convert.ToInt32(panelEx5.Width), Convert.ToInt32(panelEx5.Height))); - - PrintDialog pd = new PrintDialog(); - try - { - if (pd.ShowDialog() == DialogResult.OK) //如果确认,将会覆盖所有的打印参数设置 - { - //打印预览 - PrintPreviewDialog ppd = new PrintPreviewDialog(); - ppd.Document = printDocument1; - if (DialogResult.OK == ppd.ShowDialog()) - { - printDocument1.Print(); //打印 - } - } - } - catch - { - printDocument1.PrintController.OnEndPrint(printDocument1, new System.Drawing.Printing.PrintEventArgs()); - } - } - + private void printDocument1_PrintPage(object sender, System.Drawing.Printing.PrintPageEventArgs e) { e.Graphics.DrawImage(printImage, 10, 10); } - - /// - /// 在窗体的底部状态栏上显示 综合管线条件查询结果 - /// - /// - /// - private void ToolStripText(string currentLayer, int dataCount) - { - if (dataCount != 0) - { - double featurelength = PipeLength(currentLayer, 0);// 统计管线的里程数 - - toolStripNumbers.Text = " 管线类型:" + currentLayer + " | 共有:" + Convert.ToString(dataCount - 1) + "条记录"; - toolStripFeatureLength.Text = " 管线里程:" + featurelength.ToString("0.00") + " 米"; - } - else - { - toolStripNumbers.Text = "管线类型: " + currentLayer + "| 共有:" + 0 + " 条记录 | "; - } - } - /// /// 统计管线的里程数 /// @@ -3402,26 +3123,6 @@ } /// - /// 绘制线 菜单 - /// - /// - /// - private void btnAddLine_Click(object sender, EventArgs e) - { - globeControl1.Globe.DestLayerFeatureAdd = globeControl1.Globe.MemoryLayer; - globeControl1.Globe.Action = EnumAction3D.DrawPolyline; - } - /// - /// 绘制面 菜单 - /// - /// - /// - private void btnAddPolygon_Click(object sender, EventArgs e) - { - globeControl1.Globe.DestLayerFeatureAdd = globeControl1.Globe.MemoryLayer; - globeControl1.Globe.Action = EnumAction3D.DrawPolygon; - } - /// /// 图层目录树 右键菜单中的 目标图层 菜单 /// /// @@ -3956,42 +3657,7 @@ // ClearUpDownTraceAnalysis(); //} - /// - /// 显示流向 功能 - /// - /// - /// - /// - private void Flow(object sender, string pipelineNameCN, bool bShow) - { - GSOFeatureLayer layer = globeControl1.Globe.Layers.GetLayerByCaption(pipelineNameCN) as GSOFeatureLayer; - GSOFeatures feats = layer.GetAllFeatures(); - for (int i = 0; i < feats.Length; i++) - { - GSOFeature feat = feats[i]; - GSOLineStyle3D lineStyle = feat.Geometry.Style as GSOLineStyle3D; - if (lineStyle != null) - { - if (lineStyle.ArrowStyle == null) - { - lineStyle.ArrowStyle = new GSOArrowStyle(); - lineStyle.ArrowStyle.BodyWidth = 2; - lineStyle.ArrowStyle.BodyLen = 6; - lineStyle.ArrowStyle.HeadWidth = 8; - lineStyle.ArrowStyle.HeadLen = 10; - lineStyle.ArrowStyle.OutlineVisible = true; - lineStyle.ArrowStyle.OutlineColor = Color.Red; - lineStyle.ArrowStyle.Speed = lineStyle.ArrowStyle.Speed / 2; - lineStyle.ArrowStyle.Play(); - } - lineStyle.ArrowVisible = bShow; - layerTree.SelectedNode = null; - } - } - globeControl1.Globe.Refresh(); - } - - + FrmCloseValves frm; /// /// 关阀分析 功能 @@ -4030,7 +3696,9 @@ curCAYNDataset.CloseValveAnalysis(lineFeature.ID, out arryResNodeID, out arryResValveID, false, true); } catch (Exception e) - { } + { + LogHelper.WriteLog(typeof(MainFrm), e.Message); + } string valveName = lineLayer.Caption; valveName = valveName.Substring(0, valveName.IndexOf("管线")); @@ -4106,7 +3774,7 @@ } catch (Exception e) { - + LogHelper.WriteLog(typeof(MainFrm), e.Message); } //目前只有燃气管线 有阀门 string valveName = lineLayer.Name; @@ -5457,7 +5125,7 @@ } catch (Exception ex) { - //MessageBox.Show(ex.ToString()); + LogHelper.WriteLog(typeof(MainFrm), ex.Message); } finally { @@ -5501,22 +5169,6 @@ } } - - /// - /// 清除所有坑 菜单 - /// - /// - /// - private void buttonItem3_Click(object sender, EventArgs e) - { - //日志记录 - LogManager.saveLog(Utility.userName, this.buttonItem3.Text); - - globeControl1.Globe.RemoveAllPits(); - } - - - ///// ///// 净距分析 菜单 ///// @@ -5554,42 +5206,8 @@ // ribbonBarTP.Visible = buttonItem34.Checked; // ribbonBarTP.Location = new Point(0, 0); //} - /// - /// 大气层 菜单 - /// - /// - /// - private void buttonItem17_Click_1(object sender, EventArgs e) - { - globeControl1.Globe.Atmosphere.Visible = !globeControl1.Globe.Atmosphere.Visible; - buttonItemSH1.Checked = globeControl1.Globe.Atmosphere.Visible; - globeControl1.Refresh(); - } - /// - /// 经纬网 菜单 - /// - /// - /// - private void buttonItem20_Click(object sender, EventArgs e) - { - globeControl1.Globe.LatLonGrid.Visible = !globeControl1.Globe.LatLonGrid.Visible; - buttonItemSH3.Checked = globeControl1.Globe.LatLonGrid.Visible; - globeControl1.Globe.Refresh(); - } - /// - /// 状态条 菜单 - /// - /// - /// - private void buttonItem21_Click_1(object sender, EventArgs e) - { - globeControl1.Globe.StatusBar.Visible = !globeControl1.Globe.StatusBar.Visible; - buttonItemSH4.Checked = globeControl1.Globe.StatusBar.Visible; - globeControl1.Globe.Refresh(); - } - - + /// /// 添加指定路径下的数据 功能 /// @@ -5680,43 +5298,7 @@ // } // return objRes; //} - /// - /// 刷新目录树 功能 - /// - private void RefreshDataTree() - { - layerTree.Nodes[0].Nodes.Clear(); - Int32 nCount = globeControl1.Globe.DataManager.DataSourceCount; - Int32 i = 0; - for (i = 0; i < nCount; i++) - { - GSODataSource dataSpace = globeControl1.Globe.DataManager[i]; - TreeNode node = new TreeNode(); - node.Text = dataSpace.Name; - node.ImageIndex = 0; - node.SelectedImageIndex = 0; - node.Checked = true; - node.Tag = dataSpace; - Int32 nDatasetCount = dataSpace.DatasetCount; - for (Int32 j = 0; j < nDatasetCount; j++) - { - GSODataset dataset = dataSpace[j]; - TreeNode subNode = new TreeNode(); - subNode.Text = dataset.Name; - subNode.ImageIndex = 0; - subNode.SelectedImageIndex = 0; - subNode.Checked = true; - subNode.Tag = dataset; - node.Nodes.Add(subNode); - } - layerTree.Nodes[0].Nodes.Add(node); - } - } - - - - - + /// /// 复合查询 菜单 @@ -5777,34 +5359,7 @@ return false; } - /// - /// 统计指定图层在指定范围内的所有feature对象 - /// - /// - /// - /// - private GSOFeatures Intersect_PointLayer(GSOGeoPolygon3D polygon, string pointLayerName) - { - GSOLayer layer = globeControl1.Globe.Layers.GetLayerByCaption(pointLayerName); - if (layer == null) - return null; - - GSOFeatureLayer flayer = layer as GSOFeatureLayer; - GSOFeatureDataset fdataset = flayer.Dataset as GSOFeatureDataset; - GSOFeatures feats; - if (polygon == null) - { - feats = flayer.GetAllFeatures(); - } - else - { - feats = flayer.FindFeaturesInPolygon(polygon, false); - } - - workWellLen.Add(pointLayerName, feats.Length); - return feats; - } - /// + /// /// 碰撞分析功能界面中 选择管线复选框 选中状态改变事件处理 /// /// @@ -5946,16 +5501,6 @@ MessageBox.Show("表格内容为空!", "提示"); } } - /// - /// 导出CAD 菜单 - /// - /// - /// - private void btnExportCAD_Click(object sender, EventArgs e) - { - FrmExportCADS frm = new FrmExportCADS(globeControl1, m_PipelineLayerNames); - frm.ShowDialog(); - } ///// ///// 区域分析 菜单 @@ -5987,16 +5532,6 @@ } } } - /// - /// 数据验证 菜单 - /// - /// - /// - private void buttonItem80_Click(object sender, EventArgs e) - { - FrmValiData frm = new FrmValiData(globeControl1); - frm.ShowDialog(); - } /// /// 根据指定图层创建图层节点并将节点添加到图层管理节点的子节点集合中 @@ -6018,56 +5553,7 @@ layerManagerNode.Expand(); } } - /// - /// 数据库备份 菜单 - /// - /// - /// - private void btnBackDatabase_Click(object sender, EventArgs e) - { - if (MessageBox.Show("是否确定要备份数据库文件", "信息", MessageBoxButtons.YesNo, MessageBoxIcon.Question) == DialogResult.Yes) - { - try - { - DateTime currentTime = DateTime.Now; - //string Dtime = currentTime.ToShortDateString().ToString("yyyy-MM-dd"); - string Dtime = currentTime.GetDateTimeFormats('D')[0].ToString(); - string Htime = DateTime.Now.ToString("HH时mm分ss秒").Trim(); - string fileName = Dtime + "(" + Htime + ")"; - string pathName = ""; - string sql = "select filename from master..sysdatabases where name='" + Utility.dbdatabase + "'"; - DataTable dt = OledbHelper.ExecuteDataTable(sql); - if (dt != null && dt.Rows.Count > 0) - { - pathName = dt.Rows[0][0].ToString().Trim(); - int count = pathName.LastIndexOf("\\") == -1 ? pathName.LastIndexOf("/") : pathName.LastIndexOf("\\"); - pathName = pathName.Substring(0, count); - } - pathName += "\\管网数据库" + fileName + ".bak"; - - OracleCommand cmdBK = new OracleCommand(); - cmdBK.CommandType = CommandType.Text; - cmdBK.Connection = connBackup; - cmdBK.CommandText = @"backup database " + Utility.dbdatabase + " to disk='" + pathName + "' with init"; - - connBackup.Open(); - cmdBK.ExecuteNonQuery(); - MessageBox.Show("数据库文件备份成功", "提示"); - } - catch (Exception ex) - { - MessageBox.Show(ex.ToString()); - } - finally - { - connBackup.Close(); - } - } - } - - - - + //GSOFeature emitterFeature; // 粒子要素 /// /// 添加火苗 功能 @@ -6598,361 +6084,15 @@ } } - - ///// - /// 添加用户仓库 菜单 - /// - /// - /// - private void buttonItem108_Click(object sender, EventArgs e) - { - FrmUserRepo frm = new FrmUserRepo(-1); - frm.ShowDialog(); - } - /// - /// 用户仓库管理 菜单 - /// - /// - /// - private void buttonItem111_Click(object sender, EventArgs e) - { - FrmUserRepoMgr frm = new FrmUserRepoMgr(); - frm.ShowDialog(); - } - /// - /// 添加分系统 菜单 - /// - /// - /// - private void buttonItem112_Click(object sender, EventArgs e) - { - //FrmAPP frm = new FrmAPP(-1); - //frm.ShowDialog(); - } - /// - /// 分系统管理 菜单 - /// - /// - /// - private void buttonItem113_Click(object sender, EventArgs e) - { - //FrmAPPMgr frm = new FrmAPPMgr(); - //frm.ShowDialog(); - } - /// - /// 添加操作 菜单 - /// - /// - /// - private void buttonItem114_Click(object sender, EventArgs e) - { - FrmOper frm = new FrmOper(-1); - frm.ShowDialog(); - } - /// - /// 操作管理 菜单 - /// - /// - /// - private void buttonItem115_Click(object sender, EventArgs e) - { - FrmOperMgr frm = new FrmOperMgr(); - frm.ShowDialog(); - } - /// - /// 添加资源 菜单 - /// - /// - /// - private void buttonItem116_Click(object sender, EventArgs e) - { - FrmRESC frm = new FrmRESC(-1); - frm.ShowDialog(); - } - /// - /// 资源管理 菜单 - /// - /// - /// - private void buttonItem117_Click(object sender, EventArgs e) - { - FrmRESCMgr frm = new FrmRESCMgr(); - frm.ShowDialog(); - } - /// - /// 添加权限 菜单 - /// - /// - /// - private void buttonItem118_Click(object sender, EventArgs e) - { - FrmPerm frm = new FrmPerm(-1); - frm.ShowDialog(); - } - /// - /// 权限管理 菜单 - /// - /// - /// - private void buttonItem119_Click(object sender, EventArgs e) - { - FrmPermMgr frm = new FrmPermMgr(); - frm.ShowDialog(); - } - /// - /// 添加访问控制 菜单 - /// - /// - /// - private void buttonItem120_Click(object sender, EventArgs e) - { - FrmAccess frm = new FrmAccess(-1); - frm.ShowDialog(); - } - /// - /// 访问控制管理 菜单 - /// - /// - /// - private void buttonItem121_Click(object sender, EventArgs e) - { - FrmAccessMgr frm = new FrmAccessMgr(); - frm.ShowDialog(); - } - /// - /// 部门类型管理 菜单 - /// - /// - /// - private void buttonItem122_Click(object sender, EventArgs e) - { - FrmRegionTypeMgr frm = new FrmRegionTypeMgr(); - frm.ShowDialog(); - } - /// - /// 用户信息管理 菜单 - /// - /// - /// - private void buttonItem128_Click_1(object sender, EventArgs e) - { - FrmUserManager frm = new FrmUserManager(); - frm.ShowDialog(); - } - /// - /// 添加角色 菜单 - /// - /// - /// - private void 添加角色_Click(object sender, EventArgs e) - { - FrmRole frm = new FrmRole(-1); - frm.ShowDialog(); - } - /// - /// 所有角色管理 菜单 - /// - /// - /// - private void 角色管理_Click(object sender, EventArgs e) - { - FrmRoleMgr frm = new FrmRoleMgr(); - frm.ShowDialog(); - } - - /// - /// 部门角色管理 菜单 - /// - /// - /// - private void buttonItem133_Click(object sender, EventArgs e) - { - FrmRegionRoleMgr frm = new FrmRegionRoleMgr(); - frm.ShowDialog(); - } - /// - /// 部门管理 菜单 - /// - /// - /// - private void buttonItem130_Click(object sender, EventArgs e) - { - FrmRegionMgr frm = new FrmRegionMgr(); - frm.ShowDialog(); - } - - /// - /// 日志管理 菜单 - /// - /// - /// - private void buttonItem135_Click(object sender, EventArgs e) - { - FrmLogManager frm = new FrmLogManager(); - frm.ShowDialog(); - } - /// - /// 传感器信息查询 菜单 - /// - /// - /// - private void buttonItem131_Click_1(object sender, EventArgs e) - { - GSOFeature selectedFeature = globeControl1.Globe.SelectedObject; - if (selectedFeature == null) - { - MessageBox.Show("请选择一个传感器对象!", "提示", MessageBoxButtons.OK, MessageBoxIcon.Information); - } - else - { - if (selectedFeature.Geometry != null && selectedFeature.Geometry.Type == EnumGeometryType.GeoModel) - { - GSOLayer layer = globeControl1.Globe.SelectedObjectLayer; - string tabelName = getTableName(layer.Caption); - string eqtID = selectedFeature.Description.Trim(); - if (tabelName != "" && eqtID != "") - { - string fields = getFields(tabelName); - if (fields != "") - { - string sql = "select " + fields + " from " + Utility.sensorDatabase + "." + tabelName + " where EqtID=" + eqtID + " order by RecordDate desc limit 1;"; - DataTable dt = MySqlHelper.queryDataTable(sql); - if (dt != null && dt.Rows.Count > 0) - { - FrmQueryMessage.ShowForm(this, dt, layer.Caption); - //queryMessage.Show(this); - } - else - { - MessageBox.Show("没有查询到相关信息!", "提示"); - } - } - else - { - MessageBox.Show("配置文件 \"sensorConfig.xml\" 有误!", "提示"); - } - } - else - { - MessageBox.Show("请选择一个传感器对象!", "提示"); - } - } - else - { - MessageBox.Show("请选择一个传感器对象!", "提示", MessageBoxButtons.OK, MessageBoxIcon.Information); - } - } - } - /// - /// 根据指定的图层的caption属性的值在配置文件中查找对应的数据库中的表的名称 - /// - /// 图层的caption属性的值 - /// 对应的数据库中的表的名称 - private string getTableName(string name) - { - string tabelName = ""; - if (Utility.sensorMarkerLayers != null) - { - for (int i = 0; i < Utility.sensorMarkerLayers.Count; i++) - { - MarkerLayer mLayer = Utility.sensorMarkerLayers[i]; - if (mLayer.layerName == name) - { - tabelName = mLayer.tableName; - break; - } - } - } - return tabelName; - } - /// - /// 根据数据库中的表的名称 查找对应的表中的字段名称的集合 - /// - /// 数据库中的表的名称 - /// 对应的表中的字段名称的集合 - private string getFields(string tabelName) - { - string fields = ""; - if (Utility.sensorMarkerLayers != null) - { - for (int i = 0; i < Utility.sensorMarkerLayers.Count; i++) - { - MarkerLayer mLayer = Utility.sensorMarkerLayers[i]; - if (mLayer.tableName.Trim() == tabelName.Trim()) - { - if (mLayer.fields != null) - { - foreach (string key in mLayer.fields.Keys) - { - string value = mLayer.fields[key]; - fields += tabelName.Trim() + "." + key + " as " + value + ","; - } - fields = fields.Remove(fields.Length - 1); - } - break; - } - } - } - return fields; - } - - /// - /// 历史曲线查询 菜单 - /// - /// - /// - private void buttonItem132_Click(object sender, EventArgs e) - { - GSOFeature selectedFeature = globeControl1.Globe.SelectedObject; - if (selectedFeature == null) - { - MessageBox.Show("请选择一个对象!", "提示", MessageBoxButtons.OK, MessageBoxIcon.Information); - } - else - { - if (selectedFeature.Geometry != null && selectedFeature.Geometry.Type == EnumGeometryType.GeoModel) - { - GSOLayer layer = globeControl1.Globe.SelectedObjectLayer; - string tabelName = getTableName(layer.Caption); - string eqtID = selectedFeature.Description; - if (tabelName != "" && eqtID != "") - { - FrmQueryHistory.ShowForm(this, tabelName, eqtID); - } - else - { - MessageBox.Show("请选择一个传感器对象!", "提示"); - } - } - else - { - MessageBox.Show("请选择一个传感器对象!", "提示", MessageBoxButtons.OK, MessageBoxIcon.Information); - } - } - } - + //定时检查传感器的状态 public System.Windows.Forms.Timer timerOfSensor = null; public int alarmValueLiuLiang = 0; public int alarmValueYaLi = 0; public int alarmValueYeTi = 0; public int alarmValueZaoSheng = 0; - /// - /// 传感器在线报警 菜单 - /// - /// - /// - private void buttonItem134_Click(object sender, EventArgs e) - { - if (timerOfSensor == null) - { - timerOfSensor = new System.Windows.Forms.Timer(); - timerOfSensor.Interval = 30000; - timerOfSensor.Tick += new EventHandler(timerOfSensor_Tick); - } - FrmQuerySensorAlarm.ShowForm(this); - } + /// /// 传感器报警 功能中的 定时器 的触发事件处理 /// @@ -7016,6 +6156,7 @@ } catch (Exception ex) { + LogHelper.WriteLog(typeof(MainFrm), ex.Message); continue; } } @@ -7025,145 +6166,7 @@ } } - - /// - /// 沿线运动 菜单 - /// - /// - /// - private void buttonItem138_Click(object sender, EventArgs e) - { - if (globeControl1.Globe.SelectedObject == null) - { - MessageBox.Show("请先选择一条线!", "提示", MessageBoxButtons.OK, MessageBoxIcon.Exclamation); - return; - } - - GSOFeature lineFeature = globeControl1.Globe.SelectedObject; - if (lineFeature.Geometry == null || lineFeature.Geometry.Type != EnumGeometryType.GeoPolyline3D) - { - MessageBox.Show("请先选择一条线!", "提示", MessageBoxButtons.OK, MessageBoxIcon.Exclamation); - return; - } - - OpenFileDialog dlg = new OpenFileDialog(); - dlg.Filter = "*.gcm;*.3ds|*.gcm;*.3ds|*.3ds|*.3ds|*.gcm|*.gcm"; - if (dlg.ShowDialog() == DialogResult.OK) - { - GSOGeoModel model = new GSOGeoModel(); - model.FilePath = dlg.FileName; - - GSOGeoDynamicRoute dynamicRoute = new GSOGeoDynamicRoute(); - dynamicRoute.ActorGeometry = model; - - GSORoute route = new GSORoute(); - GSOGeoPolyline3D geoline = (GSOGeoPolyline3D)lineFeature.Geometry; - for (int i = 0; i < geoline[0].Count; i++) - { - route.Add(geoline[0][i]); - } - route.CircleRoute = false; - route.Speed = 30; - route.RotateSpeed = 50; - route.AltitudeMode = geoline.AltitudeMode; - dynamicRoute.Route = route; - - GSOFeature feature = new GSOFeature(); - - dynamicRoute.Play(); - feature.Geometry = dynamicRoute; - - //GSOLabel gsoLabel = new GSOLabel(); - //gsoLabel.Text = "模型测试"; - //feature.Label = gsoLabel; - globeControl1.Globe.MinModelVisibleSize = 0; - - globeControl1.Globe.MemoryLayer.AddFeature(feature); - globeControl1.Globe.Refresh(); - } - } - /// - /// 回退 菜单 - /// - /// - /// - private void buttonItem99_Click(object sender, EventArgs e) - { - globeControl1.Globe.UnDoEdit(); - } - /// - /// 前进 菜单 - /// - /// - /// - private void buttonItem100_Click(object sender, EventArgs e) - { - globeControl1.Globe.ReDoEdit(); - } - /// - /// 水平净距 功能界面中的 标签内容改变事件处理 - /// - /// - /// - private void textBoxX4_TextChanged(object sender, EventArgs e) - { - string valueJingJu = textBoxX4.Text.Trim(); - if (valueJingJu != "") - { - double value = 0; - bool bl = double.TryParse(valueJingJu, out value); - if (bl) - { - labelX24.Text = "水平净距小于" + value.ToString() + "米的管线有:"; - } - } - } - /// - /// 垂直净距 功能界面中的 标签内容改变事件处理 - /// - /// - /// - private void textBoxX2_TextChanged(object sender, EventArgs e) - { - string valueJingJu = textBoxX2.Text.Trim(); - if (valueJingJu != "") - { - double value = 0; - bool bl = double.TryParse(valueJingJu, out value); - if (bl) - { - labelX23.Text = "垂直净距小于" + value.ToString() + "米的管线有:"; - } - } - } - /// - /// 覆土分析 功能界面中的 标签内容改变事件处理 - /// - /// - /// - private void textBoxX3_TextChanged(object sender, EventArgs e) - { - string valueJingJu = textBoxX3.Text.Trim(); - if (valueJingJu != "") - { - double value = 0; - bool bl = double.TryParse(valueJingJu, out value); - if (bl) - { - labelX17.Text = "覆土深度小于" + value.ToString() + "米的管线有:"; - } - } - } - - /// - /// 传感器分类查询 全区域 菜单 - /// - /// - /// - private void buttonItemSensor全区域查询_Click(object sender, EventArgs e) - { - FrmAccessoriesSensor.ShowForm(globeControl1, instrumenLayerNames, 0); - } + /// /// 传感器分类查询 绘制区域 菜单 /// @@ -7224,170 +6227,10 @@ layerTemp.RemoveAllFeature(); globeControl1.Refresh(); } - /// - /// 数字预处理 功能 - /// - /// - /// - private void 数字预处理buttonItem140_Click(object sender, EventArgs e) - { - FrmEditShapeFile frm = new FrmEditShapeFile(globeControl1); - frm.ShowDialog(this); - } - - - /// - /// 导出矢量 功能 将图层导出为kml和shp格式数据 - /// - /// - /// - private void 导出矢量buttonItem140_Click(object sender, EventArgs e) - { - /* - List m_PipelineLayerNames = new List();//线图层名称 - List workwellLayerNames = new List();//工井图层名称 - List valueLayerNames = new List();//阀门图层名称 - List instrumenLayerNames = new List();//附属物图层名称 - List pipefittingLayerNames = new List();//管件图层名称 - */ - List listVectorNames = new List(); - for (int i = 0; i < m_PipelineLayerNames.Count; i++) - { - if (m_PipelineLayerNames[i] == "移动" || m_PipelineLayerNames[i] == "联通" - || m_PipelineLayerNames[i] == "电信" || m_PipelineLayerNames[i] == "共通" - || m_PipelineLayerNames[i] == "有限电视" || m_PipelineLayerNames[i] == "交通信号" - || m_PipelineLayerNames[i] == "供电") - { - continue; - } - if (listVectorNames.Contains(m_PipelineLayerNames[i]) == false) - { - listVectorNames.Add(m_PipelineLayerNames[i]); - } - } - for (int i = 0; i < valueLayerNames.Count; i++) - { - if (listVectorNames.Contains(valueLayerNames[i]) == false) - { - listVectorNames.Add(valueLayerNames[i]); - } - } - for (int i = 0; i < workwellLayerNames.Count; i++) - { - if (listVectorNames.Contains(workwellLayerNames[i]) == false) - { - listVectorNames.Add(workwellLayerNames[i]); - } - } - for (int i = 0; i < instrumenLayerNames.Count; i++) - { - if (listVectorNames.Contains(instrumenLayerNames[i]) == false) - { - listVectorNames.Add(instrumenLayerNames[i]); - } - } - for (int i = 0; i < pipefittingLayerNames.Count; i++) - { - if (listVectorNames.Contains(pipefittingLayerNames[i]) == false) - { - listVectorNames.Add(pipefittingLayerNames[i]); - } - } - FrmExportVector frm = new FrmExportVector(globeControl1, listVectorNames); - frm.ShowDialog(); - } string citySevenLineType = ""; string cityServerLineName = ""; /// - /// 绘制城市七线 功能按钮 - /// - /// - /// - private void 绘制城市七线buttonItem140_Click(object sender, EventArgs e) - { - FrmCitySevenLineType frm = new FrmCitySevenLineType(); - if (frm.ShowDialog() == DialogResult.OK) - { - globeControl1.Globe.Action = EnumAction3D.DrawPolyline; - m_isDrawCitySevenLine = true; - m_isDrawTunnel = false; - m_AddPipeLine = false; - this.citySevenLineType = frm.citySevenLineType; - this.cityServerLineName = frm.citySevenLineName; - switch (frm.citySevenLineType) - { - case "城市红线": - GSOLayer layerRed = globeControl1.Globe.Layers.GetLayerByCaption(frm.citySevenLineType); - if (layerRed != null) - { - globeControl1.Globe.DestLayerFeatureAdd = layerRed; - layerRed.Editable = true; - } - break; - case "城市橙线": - GSOLayer layerOrange = globeControl1.Globe.Layers.GetLayerByCaption(frm.citySevenLineType); - if (layerOrange != null) - { - globeControl1.Globe.DestLayerFeatureAdd = layerOrange; - layerOrange.Editable = true; - } - break; - case "城市黄线": - GSOLayer layerYellow = globeControl1.Globe.Layers.GetLayerByCaption(frm.citySevenLineType); - if (layerYellow != null) - { - globeControl1.Globe.DestLayerFeatureAdd = layerYellow; - layerYellow.Editable = true; - } - break; - case "城市绿线": - GSOLayer layerGreen = globeControl1.Globe.Layers.GetLayerByCaption(frm.citySevenLineType); - if (layerGreen != null) - { - globeControl1.Globe.DestLayerFeatureAdd = layerGreen; - layerGreen.Editable = true; - } - break; - case "城市蓝线": - GSOLayer layerBlue = globeControl1.Globe.Layers.GetLayerByCaption(frm.citySevenLineType); - if (layerBlue != null) - { - globeControl1.Globe.DestLayerFeatureAdd = layerBlue; - layerBlue.Editable = true; - } - break; - case "城市紫线": - GSOLayer layerPurple = globeControl1.Globe.Layers.GetLayerByCaption(frm.citySevenLineType); - if (layerPurple != null) - { - globeControl1.Globe.DestLayerFeatureAdd = layerPurple; - layerPurple.Editable = true; - } - break; - case "城市黑线": - GSOLayer layerBlack = globeControl1.Globe.Layers.GetLayerByCaption(frm.citySevenLineType); - if (layerBlack != null) - { - globeControl1.Globe.DestLayerFeatureAdd = layerBlack; - layerBlack.Editable = true; - } - break; - } - } - } - /// - /// 七线审核 功能按钮 - /// - /// - /// - private void 七线审核buttonItem141_Click(object sender, EventArgs e) - { - FrmCityServerLineAnalysis frm = new FrmCityServerLineAnalysis(globeControl1, m_PipelineLayerNames); - frm.ShowDialog(this); - } - - /// /// 间距分析 开始分析按钮 分析绘制的七线和管线的距离是否符合标准 /// /// @@ -7666,25 +6509,6 @@ } } - - - /// - /// 管线自动缩进 菜单 - /// - /// - /// - private void 管线自动缩进buttonItem140_Click(object sender, EventArgs e) - { - FrmPipelineIndented frm = new FrmPipelineIndented(globeControl1, m_PipelineLayerNames, workwellLayerNames); - frm.ShowDialog(this); - } - - private void btnExportCADs_Click(object sender, EventArgs e) - { - - } - - /// /// 统计指定图层在指定范围内的所有feature对象 /// @@ -7755,8 +6579,6 @@ } - - //设置图层为隐藏 private void setLayerVisible(string layerName) { @@ -7765,27 +6587,7 @@ globeControl1.Globe.Refresh(); } - /// - /// 连接数据库 - /// - /// - /// - private void buttonItem129_Click(object sender, EventArgs e) - { - //保存日志 - LogManager.saveLog(Utility.userName, this.buttonItemSJGL4_1.Text); - - FrmDatabaseParaSetting2 frm = new FrmDatabaseParaSetting2(globeControl1); - if (frm.ShowDialog() == DialogResult.OK) - { - ds = FrmDatabaseParaSetting2.ds; - if (ds != null) - { - ds.IsCloseSaved = false; - } - } - } - + /// /// 清除渲染结果 /// @@ -7803,112 +6605,8 @@ layerTemp.RemoveAllFeature(); globeControl1.Refresh(); } - - /// - /// 绘制垂线 - /// - /// - /// - private void drawCLine(GSOPoint3d fpt, GSOPoint3d tpt) - { - GSOGeoPolyline3D pline = new GSOGeoPolyline3D(); - GSOPoint3ds pts = new GSOPoint3ds(); - pts.Add(fpt); - pts.Add(tpt); - pline.AddPart(pts); - - GSOGeoPoint3D fptg = new GSOGeoPoint3D(); - GSOGeoPoint3D tptg = new GSOGeoPoint3D(); - fptg.X = fpt.X; - fptg.Y = fpt.Y; - fptg.Z = 0; - tptg.X = tpt.X; - tptg.Y = tpt.Y; - tptg.Z = 0; - - GSOFeature gf = new GSOFeature(); - gf.Geometry = pline; - - globeControl1.Globe.MemoryLayer.AddFeature(gf); - - } - /// - /// 红线审核 - /// - /// - /// - private void buttonItem138_Click_2(object sender, EventArgs e) - { - - } - /// - /// 比较两个点是否是同一个点 - /// - /// - /// - /// - private bool comparePoint(GSOPoint3d pt1, GSOPoint3d pt2) - { - double x1 = 0; double y1 = 0; - double x2 = 0; double y2 = 0; - x1 = pt1.X; - y1 = pt1.Y; - x2 = pt2.X; - y2 = pt2.Y; - if ((x1 == x2) && (y1 == y2)) - { - return true; - } - return false; - } - /// - /// 获得点到线的垂线距离及垂点 - /// - /// - /// - /// - /// - private void comparePointLine(GSOPoint3d point, GSOGeoPolyline3D line, out double length, out GSOPoint3d pointChuiDian) - { - GSOPoint3d lineStartPoint = line[0][0]; - GSOPoint3d lineEndPoint = line[0][1]; - GSOGeoPolyline3D lineAB = new GSOGeoPolyline3D(); - GSOPoint3ds pointsAB = new GSOPoint3ds(); - pointsAB.Add(point); - pointsAB.Add(lineStartPoint); - lineAB.AddPart(pointsAB); - double lengthAB = lineAB.GetSpaceLength(false, 6378137.0); - double xieLvAB = getXieLu("", point.X, point.Y, lineStartPoint.X, lineStartPoint.Y); - double xieLvBC = getXieLu("", lineStartPoint.X, lineStartPoint.Y, lineEndPoint.X, lineEndPoint.Y); - - double tanABC = Math.Abs(xieLvAB - xieLvBC) / (1 + xieLvAB * xieLvBC); - double angle = Math.Atan(tanABC); - //if (angle > Math.PI / 2) //落在外边 - //{ - // length = 0; - //} - double lengthAD = lengthAB * Math.Sin(angle); - length = Math.Abs(lengthAD); - double lengthBD = lengthAB * Math.Cos(angle); - - GSOPoint2d point2dStart = Latlon_2_XYZ(lineStartPoint.X, lineStartPoint.Y); - double bBC = point2dStart.Y - xieLvBC * point2dStart.X; - GSOPoint2d point2dEnd = new GSOPoint2d(); - point2dEnd.X = point2dStart.X + 100; - point2dEnd.Y = point2dEnd.X * xieLvBC + bBC; - point2dEnd = XYZ_2_Latlon(point2dEnd.X, point2dEnd.Y); - - GSOPoint3d pointEnd = new GSOPoint3d(); - pointEnd.X = point2dEnd.X; - pointEnd.Y = point2dEnd.Y; - GSOGeoPolyline3D lineYanShen = new GSOGeoPolyline3D(); - GSOPoint3ds pointsYanShen = new GSOPoint3ds(); - pointsYanShen.Add(lineStartPoint); - pointsYanShen.Add(pointEnd); - lineYanShen.AddPart(pointsYanShen); - GSOGeoPolyline3D lineSegment = lineYanShen.GetSegment(0, lengthBD); - pointChuiDian = lineSegment[0][1]; - } + + /// /// 获得斜率 /// @@ -8044,255 +6742,6 @@ } /// - /// 获取与点相连的所有线以及线的点的集合 - /// - /// 选定的点所在的线 - /// 选定的点 - /// 面中不完全包含的除起点线之外所有的线 - /// 选定的点所在的点的集合 - /// 所有以选定线为起点的点的集合 - /// - private List getFeaturesPoints(GSOFeature featureSelect, GSOPoint3d lineStart, GSOFeatures selectFeatures, GSOPoint3ds ps, List listPS) - { - GSOFeatures fsStart = new GSOFeatures(); - for (int n = 0; n < selectFeatures.Length; n++) - { - if (featureSelect.ID == selectFeatures[n].ID) - { - continue; - } - GSOGeoPolyline3D newLine = selectFeatures[n].Geometry as GSOGeoPolyline3D; - if (newLine != null && newLine.PartCount > 0) - { - GSOPoint3d newLineStart = newLine[0][0]; - GSOPoint3d newLineEnd = newLine[0][newLine[0].Count - 1]; - if (lineStart.X == newLineEnd.X && lineStart.Y == newLineEnd.Y) - { - GSOPoint3ds psAdd = new GSOPoint3ds(); - for (int k = newLine[0].Count - 1; k >= 0; k--) - { - psAdd.Add(newLine[0][k]); - } - newLine[0] = psAdd; - fsStart.Add(selectFeatures[n]); - - } - else if (lineStart.X == newLineStart.X && lineStart.Y == newLineStart.Y) - { - fsStart.Add(selectFeatures[n]); - - } - } - } - if (fsStart.Length > 0) - { - for (int m = 0; m < fsStart.Length; m++) - { - GSOGeoPolyline3D lineFsStart = fsStart[m].Geometry as GSOGeoPolyline3D; - if (lineFsStart != null && lineFsStart.PartCount > 0) - { - GSOPoint3ds psAdd = ps.Clone(); - for (int k = 0; k < lineFsStart[0].Count; k++) - { - psAdd.Add(lineFsStart[0][k]); - } - listPS = getFeaturesPoints(fsStart[m], lineFsStart[0][lineFsStart[0].Count - 1], selectFeatures, psAdd, listPS); - } - } - } - else - { - listPS.Add(ps); - } - return listPS; - } - - /// - /// 获取切割面的线 - /// - /// 不完全包含在面中的所有线 - /// 完全包含在面中的所有线 - /// 线 - private GSOFeature getLineFromGSOFeatures(GSOFeatures features, GSOFeatures featuresTrue) - { - //1. 当线对象数组的长度为0时,返回空 - if (features.Length == 0) - { - return null; - } - //2. 当线对象数组的长度为1时,返回这条线 - if (features.Length == 1) - { - return features[0]; - } - //3. 当线对象数组的长度大于1时,计算所有线组成的最长线 - - //3.1 获取所有不完全包含在面中的对象selectFeatures - GSOFeatures selectFeatures = new GSOFeatures(); - for (int a = 0; a < features.Length; a++) - { - selectFeatures.Add(features[a].Clone()); - } - //3.2 删除features中完全包含在面中的线,获取和面的边界相交的线对象 - for (int a = 0; a < featuresTrue.Length; a++) - { - for (int b = 0; b < features.Length; b++) - { - if (featuresTrue[a].ID == features[b].ID) - { - features.Remove(b); - break; - } - } - } - //3.3 如果和面的边界相交的线的数量为0,返回空 - if (features.Length == 0) - { - return null; - } - //3.4 获取第一条和面的边界相交的线featureInOutPolygon - GSOFeature featureInOutPolygon = features[0]; - //3.5 从所有的线中删除featureInOutPolygon - for (int a = 0; a < selectFeatures.Length; a++) - { - if (selectFeatures[a].ID == featureInOutPolygon.ID) - { - selectFeatures.Remove(a); - break; - } - } - //listPS存储所有从featureInOutPolygon出发的点的集合 - List listPS = new List(); - //3.5 获取与featureInOutPolygon相连的线的集合 - GSOGeoPolyline3D line = featureInOutPolygon.Geometry as GSOGeoPolyline3D; - if (line != null && line.PartCount > 0) - { - GSOPoint3d lineStart = line[0][0]; - GSOPoint3d lineEnd = line[0][line[0].Count - 1]; - #region//获取和featureInOutPolygon的起点相连的线 - GSOFeatures fsStart = new GSOFeatures(); - for (int n = 0; n < selectFeatures.Length; n++) - { - GSOGeoPolyline3D newLine = selectFeatures[n].Geometry as GSOGeoPolyline3D; - if (newLine != null && newLine.PartCount > 0) - { - GSOPoint3d newLineStart = newLine[0][0]; - GSOPoint3d newLineEnd = newLine[0][newLine[0].Count - 1]; - if (lineStart.X == newLineEnd.X && lineStart.Y == newLineEnd.Y) - { - GSOPoint3ds psAdd = new GSOPoint3ds(); - for (int k = newLine[0].Count - 1; k >= 0; k--) - { - psAdd.Add(newLine[0][k]); - } - newLine[0] = psAdd; - fsStart.Add(selectFeatures[n]); - - } - else if (lineStart.X == newLineStart.X && lineStart.Y == newLineStart.Y) - { - fsStart.Add(selectFeatures[n]); - } - } - } - #endregion - - #region//获取和featureInOutPolygon的终点相连的线 - GSOFeatures fsEnd = new GSOFeatures(); - for (int n = 0; n < selectFeatures.Length; n++) - { - GSOGeoPolyline3D newLine = selectFeatures[n].Geometry as GSOGeoPolyline3D; - if (newLine != null && newLine.PartCount > 0) - { - GSOPoint3d newLineStart = newLine[0][0]; - GSOPoint3d newLineEnd = newLine[0][newLine[0].Count - 1]; - if (lineEnd.X == newLineStart.X && lineEnd.Y == newLineStart.Y) - { - fsEnd.Add(selectFeatures[n]); - - } - else if (lineEnd.X == newLineEnd.X && lineEnd.Y == newLineEnd.Y) - { - GSOPoint3ds psAdd = new GSOPoint3ds(); - for (int k = newLine[0].Count - 1; k >= 0; k--) - { - psAdd.Add(newLine[0][k]); - } - newLine[0] = psAdd; - fsEnd.Add(selectFeatures[n]); - - } - } - } - #endregion - - //3.6 将featureInOutPolygon的所有点和与之起点相连的线的所有点组成一个点的集合并添加到listPS中 - if (fsStart.Length > 0 && fsEnd.Length == 0) - { - for (int m = 0; m < fsStart.Length; m++) - { - GSOGeoPolyline3D lineFsStart = fsStart[m].Geometry as GSOGeoPolyline3D; - if (lineFsStart != null && lineFsStart.PartCount > 0) - { - GSOPoint3ds psAdd = new GSOPoint3ds(); - for (int k = line[0].Count - 1; k >= 0; k--) - { - psAdd.Add(line[0][k]); - } - for (int k = 0; k < lineFsStart[0].Count; k++) - { - psAdd.Add(lineFsStart[0][k]); - } - - listPS = getFeaturesPoints(fsStart[m], lineFsStart[0][lineFsStart[0].Count - 1], selectFeatures, psAdd, listPS); - - } - } - } - //3.6 将featureInOutPolygon的所有点和与之终点相连的线的所有点组成一个点的集合并添加到listPS中 - else if (fsStart.Length == 0 && fsEnd.Length > 0) - { - for (int n = 0; n < fsEnd.Length; n++) - { - GSOGeoPolyline3D lineFsEnd = fsEnd[n].Geometry as GSOGeoPolyline3D; - if (lineFsEnd != null && lineFsEnd.PartCount > 0) - { - GSOPoint3ds psAdd = new GSOPoint3ds(); - for (int k = 0; k < line[0].Count - 1; k++) - { - psAdd.Add(line[0][k]); - } - for (int k = 0; k < lineFsEnd[0].Count; k++) - { - psAdd.Add(lineFsEnd[0][k]); - } - //获取线fsEnd[n]的另一个端点相连的线并记录该线的点的集合 - listPS = getFeaturesPoints(fsEnd[n], lineFsEnd[0][lineFsEnd[0].Count - 1], selectFeatures, psAdd, listPS); - } - } - } - } - - //3.7 获取所有以featureInOutPolygon为起点的点的集合组成的线中的最长的线 - double maxLength = 0; - GSOFeature featureNew = new GSOFeature(); - for (int h = 0; h < listPS.Count; h++) - { - GSOGeoPolyline3D lineNew = new GSOGeoPolyline3D(); - lineNew.AddPart(listPS[h]); - GSOLabel label = new GSOLabel(); - label.Text = h.ToString(); - featureNew.Label = label; - double length = lineNew.GetSpaceLength(true, 6378137); - if (length > maxLength) - { - featureNew.Geometry = lineNew; - } - } - - return featureNew; - } - /// /// 更新最大最小状态 /// /// @@ -8340,219 +6789,6 @@ - private void buttonItem139_Click(object sender, EventArgs e) - { - - string filepath = ""; - //日志记录 - OpenFileDialog dlg = new OpenFileDialog(); - dlg.Filter = "矢量数据(*.shp)|*.shp|矢量数据(*.lgd)|*.lgd|全部支持格式(*.lgd,*.shp)|*.lgd;*.shp;"; - //dlg.Filter = "支持格式(*.lrp,*.tif,*.img,*.lrc,*.kml,*.lgd,*.shp,*.gft)|*.lrp;*.tif;*.img;*.lrc;*.kml;*.lgd;*.shp;*.gft|栅格数据(*.lrp)|*.lrp|栅格缓存(*.lrc)|*.lrc|KML数据(*.kml)|*.kml|矢量数据(*.lgd)|*.lgd|矢量缓存(*.gft)|*.gft|其它格式(*.*)|*.*||"; - dlg.Multiselect = true; - if (dlg.ShowDialog() == DialogResult.OK) - { - //自定义lprj文件名,从程序中复制一lprj文件。 - int bindex = dlg.FileName.Split('\\').Length; - string lastname = dlg.FileName.Split('\\')[bindex - 1]; - - for (int i = 0; i < dlg.FileNames.Length; i++) - { - string strDataPath = dlg.FileNames[i]; - filepath = strDataPath; - - GSOLayer layer = globeControl1.Globe.Layers.Add(strDataPath); - - } - - } - //放大到红线 - - - // globeControl1.Globe.Layers.MoveTo(0, globeControl1.Globe.Layers.Count - 1); - // globeControl1.Globe.Layers.MoveTo(0,4); - globeControl1.Refresh(); - - - } - /// - /// - /// - /// - /// - private void buttonItem142_Click(object sender, EventArgs e) - { - //获得红线polygon - //GSOLayer layerSevenLine = globeControl1.Globe.Layers.GetLayerByCaption(redlinelayername); - - GSOLayer layerSevenLine = globeControl1.Globe.Layers.Add("D:\\data\\歌林小镇shp\\test.shp"); - //获得红线结果列表 - ArrayList rrLists = new ArrayList(); - - //if (redlinelayername != "") - { - GSOFeatures fs = layerSevenLine.GetAllFeatures(); - int len = fs.Length; - - GSOGeoPolygon3D sevenPolygon = new GSOGeoPolygon3D(); - for (int k = 0; k < len; k++) - {//多根红线 - ///////生成红线区域/////// - GSOFeature featSevenLine = layerSevenLine.GetAt(k); - GSOGeoPolyline3D sevenLine = featSevenLine.Geometry as GSOGeoPolyline3D; - - List sevenParts = new List(); - for (int i = 0; i < sevenLine.PartCount; i++) - { - sevenParts.Add(sevenLine[i]); - } - for (int i = 0; i < sevenParts.Count; i++) - { - sevenPolygon.AddPart((GSOPoint3ds)sevenParts[i]); - } - /////拼出红线多边形over////// - - } - //GSOLayer layer = globeControl1.Globe.Layers.GetLayerByCaption("天然气管线"); - - GSOLayer layer = globeControl1.Globe.Layers.Add("C:\\Users\\nn-203\\Desktop\\xiaobai\\test.lgd"); - //线切割面定义,输出用 - GSOFeatures resFeats = new GSOFeatures(); - int resultstyle = 0; - //管线切割红线区域后,面积较小的区域 - GSOGeoPolygon3D restPoly = new GSOGeoPolygon3D(); - List inpts = new List(); - if (layer != null) - { - //红线区域 - GSOFeature sevenfeature = new GSOFeature(); - sevenfeature.Geometry = sevenPolygon; - - //获取不完全包含在面中的所有线 - GSOFeatures feats = layer.FindFeaturesInPolygon(sevenPolygon, false); - //获取完全包含在面中的所有线 - GSOFeatures featsTrue = layer.FindFeaturesInPolygon(sevenPolygon, true); - //获取面中所有对象组成的切割面的长线 - GSOFeature feature = new GSOFeature(); - - feature = getLineFromGSOFeatures(feats, featsTrue);//管线多个feature拼成一个feature - - //globeControl1.Globe.MemoryLayer.AddFeature(feature); - //globeControl1.Globe.MemoryLayer.AddFeature(sevenfeature); - if (feature != null) - { - //线切割面,输出 - //feature.HighLight = true; - GSODataEngineUtility.GSLineClipPolygon(feature, sevenfeature, out resFeats, out resultstyle); - } - else - { - MessageBox.Show("没有找到切割面的线对象!"); - } - ////////////////绘制分割后的多边形/////////////// - for (int a = 0; a < resFeats.Length; a++) - { - - GSOFeature gf = resFeats[1]; - globeControl1.Globe.MemoryLayer.AddFeature(gf); - - } - } - - - } - } - - private void buttonItem143_Click(object sender, EventArgs e) - { - //获得红线polygon - GSOLayer layerSevenLine = globeControl1.Globe.Layers.Add("d:\\lineAndPolygon.lgd"); - GSOLayer layerSevenLine2 = globeControl1.Globe.Layers.GetLayerByCaption("d:\\lineAndPolygon.lgd"); - //获得红线结果列表 - ArrayList rrLists = new ArrayList(); - - - // if (redlinelayername != "") - { - GSOFeatures fs = layerSevenLine.GetAllFeatures(); - int len = fs.Length; - - GSOGeoPolyline3D linetest = new GSOGeoPolyline3D(); - GSOGeoPolygon3D sevenPolygon = new GSOGeoPolygon3D(); - - GSOFeature linefeat = fs.FindByID(2); - //linefeat.Geometry = linetest; - GSOFeature polyfeat = fs.FindByID(1); - //polyfeat.Geometry = sevenPolygon; - - //线切割面定义,输出用 - GSOFeatures resFeats = new GSOFeatures(); - int resultstyle = 0; - GSODataEngineUtility.GSLineClipPolygon(linefeat, polyfeat, out resFeats, out resultstyle); - - ////////////////绘制分割后的多边形/////////////// - for (int a = 0; a < resFeats.Length; a++) - { - - GSOFeature gf = resFeats[0]; - globeControl1.Globe.MemoryLayer.AddFeature(gf); - - } - ////把红线切成一段段的线段,获得切前的红线点集 - List redpts = new List();//切前的红线点集合 - for (int i = 0; i < linetest.PartCount; i++) - { - GSOPoint3ds partP = linetest[i]; - for (int j = 0; j < partP.Count; j++) - { - redpts.Add(partP[j]); - } - } - - List redpts2 = new List();//切前的红线点集合 - for (int i = 0; i < sevenPolygon.PartCount; i++) - { - GSOPoint3ds partP = sevenPolygon[i]; - for (int j = 0; j < partP.Count; j++) - { - redpts2.Add(partP[j]); - } - } - } - } - /// - /// 增加用户手册下载连接 - /// - /// - /// - Cyberpipe.udfiles.UpDownFile UDF = new udfiles.UpDownFile(Utility.udserviceurl); - string dir_Ok = "C:\\Users\\nn-203\\Desktop"; - private void button1_Click(object sender, EventArgs e) - { - if (folderBrowserDialog1.ShowDialog() == DialogResult.OK) //打洙?开a文?件t夹D对?话°框ò - { - dir_Ok = folderBrowserDialog1.SelectedPath; //显?示?选?择?的?文?件t夹D路·径? - - //tempstr = folderBrowserDialog1.SelectedPath; //存?储洹?选?择?的?文?件t夹D路·径? - - } - - Cyberpipe.PED_logicfile.PED_Affair.Redact_D = Utility.uploadpath + "\\SFiles\\UserHbook\\说明.docx"; - if (File.Exists(dir_Ok + "\\" + Files_Name(Cyberpipe.PED_logicfile.PED_Affair.Redact_D, 1))) - { - if (MessageBox.Show("文件夹下有同名文件,是否替换?", "提示", MessageBoxButtons.YesNo, MessageBoxIcon.Information) == DialogResult.No) ; - - } - byte[] file = UDF.Down(Cyberpipe.PED_logicfile.PED_Affair.Redact_D); - FileStream pFileSream = new FileStream(dir_Ok + "\\说明.docx", FileMode.OpenOrCreate); - pFileSream.Write(file, 0, file.Length); - pFileSream.Close(); - if (File.Exists(dir_Ok + "\\" + Files_Name(Cyberpipe.PED_logicfile.PED_Affair.Redact_D, 1)) == true) - { - MessageBox.Show("文件导出成功!"); - } - //PEDAClass.Folder_Handle(dir_Ok + "\\" + PEDAClass.Files_Name(Cyberpipe.PED_logicfile.PED_Affair.Redact_D, 0), Cyberpipe.PED_logicfile.PED_Affair.Redact_D, "", 0); - - } /// /// 获取文件或文件夹的名称 /// @@ -8575,33 +6811,6 @@ return DF_Name; } - private void toolStripDropDownButton1_Click(object sender, EventArgs e) - { - if (folderBrowserDialog1.ShowDialog() == DialogResult.OK) //打洙?开a文?件t夹D对?话°框ò - { - dir_Ok = folderBrowserDialog1.SelectedPath; //显?示?选?择?的?文?件t夹D路·径? - - //tempstr = folderBrowserDialog1.SelectedPath; //存?储洹?选?择?的?文?件t夹D路·径? - - - Cyberpipe.PED_logicfile.PED_Affair.Redact_D = Utility.uploadpath + "\\SFiles\\UserHbook\\说明.docx"; - if (File.Exists(dir_Ok + "\\" + Files_Name(Cyberpipe.PED_logicfile.PED_Affair.Redact_D, 1))) - { - if (MessageBox.Show("文件夹下有同名文件,是否替换?", "提示", MessageBoxButtons.YesNo, MessageBoxIcon.Information) == DialogResult.No) ; - - } - byte[] file = UDF.Down(Cyberpipe.PED_logicfile.PED_Affair.Redact_D); - FileStream pFileSream = new FileStream(dir_Ok + "\\说明.docx", FileMode.OpenOrCreate); - pFileSream.Write(file, 0, file.Length); - pFileSream.Close(); - if (File.Exists(dir_Ok + "\\" + Files_Name(Cyberpipe.PED_logicfile.PED_Affair.Redact_D, 1)) == true) - { - MessageBox.Show("文件导出成功!"); - } - - } - } - /// /// 空间查询 /// @@ -9792,7 +8001,7 @@ GSOLayer resLayer = null; GSOFeature resFeature = null; globeControl1.Globe.GetSelectObject(0, out resFeature, out resLayer); - + if (resFeature == null) return; GSOGeoPolyline3D line1 = resFeature.Geometry as GSOGeoPolyline3D; if (line1 == null) { @@ -9876,7 +8085,7 @@ GSOLayer resLayer = null; GSOFeature resFeature = null; globeControl1.Globe.GetSelectObject(0, out resFeature, out resLayer); - + if (resFeature == null) return; GSOGeoPolyline3D line1 = resFeature.Geometry as GSOGeoPolyline3D; if (line1 == null) { @@ -9891,7 +8100,8 @@ } GSOFeatures feats = globeControl1.Globe.MemoryLayer.GetFeatureByName("粒子要素", true); - if (feats.Length > 0) + + if (feats!=null&&feats.Length > 0) globeControl1.Globe.MemoryLayer.RemoveFeatureByID(feats[0].ID); //if (emitterFeature != null) //{ @@ -11121,88 +9331,6 @@ } private int connectServerCount = 0; - - /// - /// 还原球到实测库 - /// - private void refreshGlobe1() - { - //添加实测库图层已有图层 - int servernum = 0; - //1.清除global1上 - for (int i = globeControl1.Globe.Layers.Count - 1; i >= 0; i--) - { - GSOLayer layer = globeControl1.Globe.Layers[i]; - if (!layer.Name.Contains("fttp:")) - { - layer.Dataset.Close();//清除内存 - globeControl1.Globe.Layers.Remove(layer); - } - else - { - servernum++; - } - } - - //globeControl1.Globe.ConnectServer(Utility.serverip, Utility.serverport, "", ""); //加载locaServer中的数据 - - //2.添加实测库图层 - string[] markerStrs = new string[9]; - markerStrs[0] = "标高标注"; - markerStrs[1] = "管径标注"; - markerStrs[2] = "埋深标注"; - markerStrs[3] = "坐标标注"; - markerStrs[4] = "坡度标注"; - markerStrs[5] = "属性标注"; - markerStrs[6] = "自定义标注"; - markerStrs[7] = "距离标注"; - markerStrs[8] = "扯旗标注"; - for (int i = 0; i < markerStrs.Length; i++) - { - if (File.Exists(Application.StartupPath + "\\标注管理\\" + markerStrs[i] + ".lgd")) - { - GSOLayer markerLayer = globeControl1.Globe.Layers.Add(Application.StartupPath + "\\标注管理\\" + markerStrs[i] + ".lgd"); - } - } - - for (int i = 0; i < g1layername.Count; i++) - { - string g1name = g1layername[i]; - GSODataset datasetg1 = Utility.dataSource.GetDatasetByName(g1name); - GSOLayer templayer = globeControl1.Globe.Layers.Add(datasetg1); - templayer.MaxVisibleAltitude = -1; - } - layerTemp = globeControl1.Globe.Layers.Add(Application.StartupPath + "\\tempLgdData.lgd"); - globeControl1.Globe.Layers.Add(Application.StartupPath + "/城市七线/城市红线.lgd"); - globeControl1.Globe.Layers.Add(Application.StartupPath + "/城市七线/城市橙线.lgd"); - globeControl1.Globe.Layers.Add(Application.StartupPath + "/城市七线/城市黄线.lgd"); - globeControl1.Globe.Layers.Add(Application.StartupPath + "/城市七线/城市绿线.lgd"); - globeControl1.Globe.Layers.Add(Application.StartupPath + "/城市七线/城市蓝线.lgd"); - globeControl1.Globe.Layers.Add(Application.StartupPath + "/城市七线/城市紫线.lgd"); - globeControl1.Globe.Layers.Add(Application.StartupPath + "/城市七线/城市黑线.lgd"); - globeControl1.Globe.Layers.Add(Application.StartupPath + "/隧道.lgd"); - - //移动server的数据图层 - for (int i = 0; i < servernum; i++) - { - globeControl1.Globe.Layers.MoveTo(globeControl1.Globe.Layers.Count - 1, 0); - } - - if (layerManagerNode.Nodes.Count > 0) - { - for (int i = layerManagerNode.Nodes.Count - 1; i >= 0; i--) - { - layerManagerNode.Nodes[i].Remove(); - - } - } - - - - globeControl1.Refresh(); - - } - /// /// 碰撞审查 /// @@ -11476,31 +9604,7 @@ // } //} #endregion - /// - /// 数据质量检查 - /// - /// - /// - private void buttonItemSJGL2_Click(object sender, EventArgs e) - { - //日志记录 - LogManager.saveLog(Utility.userName, this.buttonItemSJGL2.Text); - FrmValiData frm = new FrmValiData(globeControl1); - frm.ShowDialog(); - } - /// - /// 数据预处理 - /// - /// - /// - private void buttonItemSJGL3_Click(object sender, EventArgs e) - { - //保存日志 - LogManager.saveLog(Utility.userName, this.buttonItemSJGL3.Text); - FrmEditShapeFile frm = new FrmEditShapeFile(globeControl1); - frm.ShowDialog(this); - } /// /// 连接数据库 /// @@ -12251,60 +10355,6 @@ List lineStruct = new List(); GSOFeature featureSelected = null; - private void AddDatagridView(DataTable table) - { - - if (table != null && table.Rows.Count > 0) - { - dataGridViewX1.DataSource = table; - panelOfTable.Visible = true; - panelOfTable.Height = 200; - toolStripNumbers.Text = "红线审核结果"; - toolStripFeatureLength.Text = " 共有:" + table.Rows.Count + "条"; - } - else - { - - } - - } - - /// - /// 去除集合中重复的管线 - /// - /// - /// - /// - private GSOFeatures getFeaturesByFilter(GSOFeatures features, string fieldName) - { - if (features == null) - { - return null; - } - GSOFeatures featuresGet = new GSOFeatures(); - for (int i = 0; i < features.Length; i++) - { - GSOFeature featureFromFS = features[i]; - string fieldValueFromFS = featureFromFS.GetValue(fieldName).ToString().Trim(); - bool isHas = false; - for (int j = featuresGet.Length - 1; j >= 0; j--) - { - GSOFeature featureFromFSGet = featuresGet[j]; - string fieldValueFromFSGet = featureFromFSGet.GetValue(fieldName).ToString().Trim(); - if (fieldValueFromFS.Equals(fieldValueFromFSGet)) - { - isHas = true; - break; - } - } - if (isHas == false) - { - featuresGet.Add(featureFromFS.Clone()); - } - } - return featuresGet; - } - /// /// 数据管理导入文件 /// @@ -12440,138 +10490,7 @@ // //MessageBox.Show("系统运行错误:" + ex.ToString(), "错误", MessageBoxButtons.OK, MessageBoxIcon.Error); // } //} - - - /// - /// 标识器全区域统计 - /// - /// - /// - private void 标识器分类统计ToolStripMenuItem_Click(object sender, EventArgs e) - { - globeControl1.Globe.Action = EnumAction3D.ActionNull; - FrmBSQStatis bsqStatis = new FrmBSQStatis(); - bsqStatis.Show(this); - } - /// - /// 标识器绘制区域统计 - /// - /// - /// - private void 标识器分类统计ToolStripMenuItem1_Click(object sender, EventArgs e) - { - trackflag = "BSQDuoBianXiangStatis"; - globeControl1.Globe.Action = EnumAction3D.TrackPolygon; - } - - - #region 保存和加载审核库加载的图层 - private void saveLayerList(TreeNodeCollection treeNodeList) - { - string configPath = Application.StartupPath + "\\configLayerList.xml"; - try - { - XmlDocument doc = new XmlDocument(); - doc.Load(configPath); - XmlNode dbParams = doc.SelectSingleNode("Params/dbparams"); - XmlNode dbLayers = doc.SelectSingleNode("Params/dblayers"); - XmlNode layers = doc.SelectSingleNode("Params/layers"); - dbParams.RemoveAll(); - dbLayers.RemoveAll(); - layers.RemoveAll(); - - List listDS = new List(); - String shDatasourceName = Utility.sgdbip + "/" + Utility.sgdbname + "_" + Utility.sgdbuser; - bool flag = false; - - for (int i = 0; i < globeControl1.Globe.DataManager.DataSourceCount; i++) - { - GSODataSource ds = globeControl1.Globe.DataManager.GetDataSourceAt(i); - if (ds != null && ds.Type == EnumDataSourceType.SqlServer || ds.Type == EnumDataSourceType.Oracle) - { - if (ds.Name == shDatasourceName) - { - //防止因为多次连接同一个数据库 - if (flag == true) - { - break; - } - flag = true; - listDS.Add(ds); - GSODataSourceCnn conn = ds.GetConnectionInfo(); - - XmlElement dbparam = doc.CreateElement("shdbparam"); - XmlElement ip = doc.CreateElement("ship"); - ip.InnerText = conn.Server; - - XmlElement dbname = doc.CreateElement("shdbname"); - dbname.InnerText = conn.Database; - - XmlElement username = doc.CreateElement("shusername"); - username.InnerText = conn.User; - - XmlElement password = doc.CreateElement("shpassword"); - password.InnerText = conn.Password; - - XmlElement type = doc.CreateElement("shtype"); - if (ds.Type == EnumDataSourceType.SqlServer) - { - type.InnerText = "sqlserver"; - } - else - { - type.InnerText = "oracle"; - } - - dbparam.AppendChild(ip); - dbparam.AppendChild(dbname); - dbparam.AppendChild(username); - dbparam.AppendChild(password); - dbparam.AppendChild(type); - dbParams.AppendChild(dbparam); - } - - } - } - - for (int i = 0; i < treeNodeList.Count; i++) - { - GSOLayer layer = treeNodeList[i].Tag as GSOLayer; - if (Path.GetExtension(layer.Name) == "") - { - XmlElement dbLayer = doc.CreateElement("dblayer"); - XmlAttribute attri = doc.CreateAttribute("dbindex"); - for (int j = 0; j < listDS.Count; j++) - { - if (layer.Dataset.DataSource.Name == listDS[j].Name) - { - attri.Value = j.ToString(); - break; - } - } - dbLayer.Attributes.Append(attri); - dbLayer.InnerText = layer.Name; - - dbLayers.AppendChild(dbLayer); - } - else - { - XmlElement dbLayer = doc.CreateElement("layer"); - dbLayer.InnerText = layer.Name; - layers.AppendChild(dbLayer); - } - } - - doc.Save(configPath); - } - catch (Exception e) - { - - } - } - - #endregion - + private void buttonItem_TaskManager_Click(object sender, EventArgs e) { if (Form_TaksManager.IS_OPEN) diff --git a/MainFrm.designer.cs b/MainFrm.designer.cs index 233ef8c..97b8299 100644 --- a/MainFrm.designer.cs +++ b/MainFrm.designer.cs @@ -82,6 +82,7 @@ this.sideBar1 = new DevComponents.DotNetBar.SideBar(); this.panelEx3 = new DevComponents.DotNetBar.PanelEx(); this.layerSensorTree = new System.Windows.Forms.TreeView(); + this.layerTree = new Cyberpipe.MyTreeView(); this.sideBarPanelItem3 = new DevComponents.DotNetBar.SideBarPanelItem(); this.controlContainerItem3 = new DevComponents.DotNetBar.ControlContainerItem(); this.sideBarPanelItem4 = new DevComponents.DotNetBar.SideBarPanelItem(); @@ -365,30 +366,26 @@ this.可编辑ToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); this.保存ToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); this.ribbonControl1 = new DevComponents.DotNetBar.RibbonControl(); - this.ribbonPanel1 = new DevComponents.DotNetBar.RibbonPanel(); - this.ribbonBar21 = new DevComponents.DotNetBar.RibbonBar(); - this.buttonItem87 = new DevComponents.DotNetBar.ButtonItem(); - this.buttonItem88 = new DevComponents.DotNetBar.ButtonItem(); - this.buttonItem27 = new DevComponents.DotNetBar.ButtonItem(); - this.buttonItem91 = new DevComponents.DotNetBar.ButtonItem(); - this.buttonItem1 = new DevComponents.DotNetBar.ButtonItem(); - this.btnlegendSet = new DevComponents.DotNetBar.ButtonItem(); - this.buttonItem89 = new DevComponents.DotNetBar.ButtonItem(); - this.ribbonPanel7 = new DevComponents.DotNetBar.RibbonPanel(); - this.ribbonBar5 = new DevComponents.DotNetBar.RibbonBar(); - this.btn_flag = new DevComponents.DotNetBar.ButtonItem(); - this.slider4ground = new DevComponents.DotNetBar.SliderItem(); - this.ribbonPanel2 = new DevComponents.DotNetBar.RibbonPanel(); - this.ribbonBar4 = new DevComponents.DotNetBar.RibbonBar(); - this.buttonItem_TaskManager = new DevComponents.DotNetBar.ButtonItem(); - this.buttonItem_OnlineTask = new DevComponents.DotNetBar.ButtonItem(); - this.buttonItem_Event = new DevComponents.DotNetBar.ButtonItem(); this.ribbonPanel3 = new DevComponents.DotNetBar.RibbonPanel(); this.ribbonBar3 = new DevComponents.DotNetBar.RibbonBar(); this.btn_device = new DevComponents.DotNetBar.ButtonItem(); this.btn_Person = new DevComponents.DotNetBar.ButtonItem(); this.btn_constructMap = new DevComponents.DotNetBar.ButtonItem(); this.buttonItem9 = new DevComponents.DotNetBar.ButtonItem(); + this.ribbonPanel2 = new DevComponents.DotNetBar.RibbonPanel(); + this.ribbonBar4 = new DevComponents.DotNetBar.RibbonBar(); + this.buttonItem_TaskManager = new DevComponents.DotNetBar.ButtonItem(); + this.buttonItem_OnlineTask = new DevComponents.DotNetBar.ButtonItem(); + this.buttonItem_Event = new DevComponents.DotNetBar.ButtonItem(); + this.ribbonPanel1 = new DevComponents.DotNetBar.RibbonPanel(); + this.ribbonBar21 = new DevComponents.DotNetBar.RibbonBar(); + this.buttonItem87 = new DevComponents.DotNetBar.ButtonItem(); + this.buttonItem88 = new DevComponents.DotNetBar.ButtonItem(); + this.buttonItem27 = new DevComponents.DotNetBar.ButtonItem(); + this.buttonItem1 = new DevComponents.DotNetBar.ButtonItem(); + this.buttonItem91 = new DevComponents.DotNetBar.ButtonItem(); + this.btnlegendSet = new DevComponents.DotNetBar.ButtonItem(); + this.buttonItem89 = new DevComponents.DotNetBar.ButtonItem(); this.ribbonPanel8 = new DevComponents.DotNetBar.RibbonPanel(); this.ribbonBar_UserInfo = new DevComponents.DotNetBar.RibbonBar(); this.btn_user_info = new DevComponents.DotNetBar.ButtonItem(); @@ -398,6 +395,10 @@ this.btn_user_role = new DevComponents.DotNetBar.ButtonItem(); this.btn_password_edit = new DevComponents.DotNetBar.ButtonItem(); this.btn_reset_password = new DevComponents.DotNetBar.ButtonItem(); + this.ribbonPanel7 = new DevComponents.DotNetBar.RibbonPanel(); + this.ribbonBar5 = new DevComponents.DotNetBar.RibbonBar(); + this.btn_flag = new DevComponents.DotNetBar.ButtonItem(); + this.slider4ground = new DevComponents.DotNetBar.SliderItem(); this.ribbonPanel15 = new DevComponents.DotNetBar.RibbonPanel(); this.ribbonBar20 = new DevComponents.DotNetBar.RibbonBar(); this.buttonItemSJGL = new DevComponents.DotNetBar.ButtonItem(); @@ -610,7 +611,6 @@ this.buttonItem84 = new DevComponents.DotNetBar.ButtonItem(); this.buttonItem75 = new DevComponents.DotNetBar.ButtonItem(); this.buttonItem76 = new DevComponents.DotNetBar.ButtonItem(); - this.layerTree = new Cyberpipe.MyTreeView(); this.statusStrip1.SuspendLayout(); this.sideBar1.SuspendLayout(); this.panelEx3.SuspendLayout(); @@ -647,11 +647,11 @@ this.contextMenuStrip3.SuspendLayout(); this.contextMenuStripDeleteLayerNode.SuspendLayout(); this.ribbonControl1.SuspendLayout(); - this.ribbonPanel1.SuspendLayout(); - this.ribbonPanel7.SuspendLayout(); - this.ribbonPanel2.SuspendLayout(); this.ribbonPanel3.SuspendLayout(); + this.ribbonPanel2.SuspendLayout(); + this.ribbonPanel1.SuspendLayout(); this.ribbonPanel8.SuspendLayout(); + this.ribbonPanel7.SuspendLayout(); this.ribbonPanel15.SuspendLayout(); ((System.ComponentModel.ISupportInitialize)(this.pictureBox1)).BeginInit(); this.SuspendLayout(); @@ -813,7 +813,6 @@ this.toolStripDropDownButton1.Size = new System.Drawing.Size(45, 21); this.toolStripDropDownButton1.Text = "帮助"; this.toolStripDropDownButton1.Visible = false; - this.toolStripDropDownButton1.Click += new System.EventHandler(this.toolStripDropDownButton1_Click); // // controlContainerItem1 // @@ -1047,6 +1046,16 @@ this.layerSensorTree.AfterCheck += new System.Windows.Forms.TreeViewEventHandler(this.layerMarkerTree_AfterCheck); this.layerSensorTree.NodeMouseClick += new System.Windows.Forms.TreeNodeMouseClickEventHandler(this.layerMarkerTree_NodeMouseClick); // + // layerTree + // + this.layerTree.CheckBoxes = true; + this.layerTree.ItemHeight = 18; + this.layerTree.Location = new System.Drawing.Point(30, 78); + this.layerTree.Name = "layerTree"; + this.layerTree.Size = new System.Drawing.Size(121, 97); + this.layerTree.TabIndex = 1; + this.layerTree.AfterCheck += new System.Windows.Forms.TreeViewEventHandler(this.layerTree_AfterCheck); + // // sideBarPanelItem3 // this.sideBarPanelItem3.FontBold = true; @@ -2966,28 +2975,28 @@ // 平移对象ToolStripMenuItem // this.平移对象ToolStripMenuItem.Name = "平移对象ToolStripMenuItem"; - this.平移对象ToolStripMenuItem.Size = new System.Drawing.Size(152, 22); + this.平移对象ToolStripMenuItem.Size = new System.Drawing.Size(124, 22); this.平移对象ToolStripMenuItem.Text = "平移对象"; this.平移对象ToolStripMenuItem.Click += new System.EventHandler(this.buttonItemBJ6_Click); // // 升降对象ToolStripMenuItem // this.升降对象ToolStripMenuItem.Name = "升降对象ToolStripMenuItem"; - this.升降对象ToolStripMenuItem.Size = new System.Drawing.Size(152, 22); + this.升降对象ToolStripMenuItem.Size = new System.Drawing.Size(124, 22); this.升降对象ToolStripMenuItem.Text = "升降对象"; this.升降对象ToolStripMenuItem.Click += new System.EventHandler(this.buttonItemBJ7_Click); // // 旋转对象ToolStripMenuItem // this.旋转对象ToolStripMenuItem.Name = "旋转对象ToolStripMenuItem"; - this.旋转对象ToolStripMenuItem.Size = new System.Drawing.Size(152, 22); + this.旋转对象ToolStripMenuItem.Size = new System.Drawing.Size(124, 22); this.旋转对象ToolStripMenuItem.Text = "旋转对象"; this.旋转对象ToolStripMenuItem.Click += new System.EventHandler(this.buttonItemBJ8_Click); // // 连接管段ToolStripMenuItem // this.连接管段ToolStripMenuItem.Name = "连接管段ToolStripMenuItem"; - this.连接管段ToolStripMenuItem.Size = new System.Drawing.Size(152, 22); + this.连接管段ToolStripMenuItem.Size = new System.Drawing.Size(124, 22); this.连接管段ToolStripMenuItem.Text = "连接管段"; this.连接管段ToolStripMenuItem.Click += new System.EventHandler(this.buttonItemBJ9_Click); // @@ -2997,34 +3006,34 @@ this.导出CADToolStripMenuItem, this.导出文件ToolStripMenuItem1}); this.导出文件ToolStripMenuItem.Name = "导出文件ToolStripMenuItem"; - this.导出文件ToolStripMenuItem.Size = new System.Drawing.Size(152, 22); + this.导出文件ToolStripMenuItem.Size = new System.Drawing.Size(124, 22); this.导出文件ToolStripMenuItem.Text = "导出矢量"; // // 导出CADToolStripMenuItem // this.导出CADToolStripMenuItem.Name = "导出CADToolStripMenuItem"; - this.导出CADToolStripMenuItem.Size = new System.Drawing.Size(152, 22); + this.导出CADToolStripMenuItem.Size = new System.Drawing.Size(125, 22); this.导出CADToolStripMenuItem.Text = "导出CAD"; this.导出CADToolStripMenuItem.Click += new System.EventHandler(this.buttonItemBJ10_1_Click); // // 导出文件ToolStripMenuItem1 // this.导出文件ToolStripMenuItem1.Name = "导出文件ToolStripMenuItem1"; - this.导出文件ToolStripMenuItem1.Size = new System.Drawing.Size(152, 22); + this.导出文件ToolStripMenuItem1.Size = new System.Drawing.Size(125, 22); this.导出文件ToolStripMenuItem1.Text = "导出文件"; this.导出文件ToolStripMenuItem1.Click += new System.EventHandler(this.buttonItemBJ10_2_Click); // // 前进ToolStripMenuItem // this.前进ToolStripMenuItem.Name = "前进ToolStripMenuItem"; - this.前进ToolStripMenuItem.Size = new System.Drawing.Size(152, 22); + this.前进ToolStripMenuItem.Size = new System.Drawing.Size(124, 22); this.前进ToolStripMenuItem.Text = "前进"; this.前进ToolStripMenuItem.Click += new System.EventHandler(this.buttonItemBJ12_Click); // // 删除模型ToolStripMenuItem // this.删除模型ToolStripMenuItem.Name = "删除模型ToolStripMenuItem"; - this.删除模型ToolStripMenuItem.Size = new System.Drawing.Size(152, 22); + this.删除模型ToolStripMenuItem.Size = new System.Drawing.Size(124, 22); this.删除模型ToolStripMenuItem.Text = "后退"; this.删除模型ToolStripMenuItem.Click += new System.EventHandler(this.buttonItemBJ11_Click); // @@ -4160,6 +4169,198 @@ this.ribbonControl1.Text = "ribbonControl1"; this.ribbonControl1.UseCustomizeDialog = false; // + // ribbonPanel3 + // + this.ribbonPanel3.ColorSchemeStyle = DevComponents.DotNetBar.eDotNetBarStyle.StyleManagerControlled; + this.ribbonPanel3.Controls.Add(this.ribbonBar3); + this.ribbonPanel3.Dock = System.Windows.Forms.DockStyle.Fill; + this.ribbonPanel3.Location = new System.Drawing.Point(0, 33); + this.ribbonPanel3.Name = "ribbonPanel3"; + this.ribbonPanel3.Padding = new System.Windows.Forms.Padding(3, 0, 3, 3); + this.ribbonPanel3.Size = new System.Drawing.Size(1328, 62); + // + // + // + this.ribbonPanel3.Style.Class = ""; + this.ribbonPanel3.Style.CornerType = DevComponents.DotNetBar.eCornerType.Square; + // + // + // + this.ribbonPanel3.StyleMouseDown.Class = ""; + this.ribbonPanel3.StyleMouseDown.CornerType = DevComponents.DotNetBar.eCornerType.Square; + // + // + // + this.ribbonPanel3.StyleMouseOver.Class = ""; + this.ribbonPanel3.StyleMouseOver.CornerType = DevComponents.DotNetBar.eCornerType.Square; + this.ribbonPanel3.TabIndex = 40; + // + // ribbonBar3 + // + this.ribbonBar3.AutoOverflowEnabled = true; + // + // + // + this.ribbonBar3.BackgroundMouseOverStyle.Class = ""; + this.ribbonBar3.BackgroundMouseOverStyle.CornerType = DevComponents.DotNetBar.eCornerType.Square; + // + // + // + this.ribbonBar3.BackgroundStyle.Class = ""; + this.ribbonBar3.BackgroundStyle.CornerType = DevComponents.DotNetBar.eCornerType.Square; + this.ribbonBar3.ContainerControlProcessDialogKey = true; + this.ribbonBar3.Dock = System.Windows.Forms.DockStyle.Left; + this.ribbonBar3.Items.AddRange(new DevComponents.DotNetBar.BaseItem[] { + this.btn_device, + this.btn_Person, + this.btn_constructMap, + this.buttonItem9}); + this.ribbonBar3.Location = new System.Drawing.Point(3, 0); + this.ribbonBar3.Name = "ribbonBar3"; + this.ribbonBar3.Size = new System.Drawing.Size(378, 59); + this.ribbonBar3.Style = DevComponents.DotNetBar.eDotNetBarStyle.StyleManagerControlled; + this.ribbonBar3.TabIndex = 0; + // + // + // + this.ribbonBar3.TitleStyle.Class = ""; + this.ribbonBar3.TitleStyle.CornerType = DevComponents.DotNetBar.eCornerType.Square; + // + // + // + this.ribbonBar3.TitleStyleMouseOver.Class = ""; + this.ribbonBar3.TitleStyleMouseOver.CornerType = DevComponents.DotNetBar.eCornerType.Square; + this.ribbonBar3.TitleVisible = false; + // + // btn_device + // + this.btn_device.ButtonStyle = DevComponents.DotNetBar.eButtonStyle.ImageAndText; + this.btn_device.Image = global::Cyberpipe.Properties.Resources._24X24__2__02; + this.btn_device.ImagePosition = DevComponents.DotNetBar.eImagePosition.Top; + this.btn_device.Name = "btn_device"; + this.btn_device.SubItemsExpandWidth = 14; + this.btn_device.Text = "探测仪管理"; + this.btn_device.Click += new System.EventHandler(this.btn_device_Click); + // + // btn_Person + // + this.btn_Person.ButtonStyle = DevComponents.DotNetBar.eButtonStyle.ImageAndText; + this.btn_Person.Image = global::Cyberpipe.Properties.Resources._24x24icon_05_hover1; + this.btn_Person.ImagePosition = DevComponents.DotNetBar.eImagePosition.Top; + this.btn_Person.Name = "btn_Person"; + this.btn_Person.SubItemsExpandWidth = 14; + this.btn_Person.Text = "定位人员维护"; + this.btn_Person.Click += new System.EventHandler(this.btn_Person_Click); + // + // btn_constructMap + // + this.btn_constructMap.Image = global::Cyberpipe.Properties.Resources._24x24icon_04_hover; + this.btn_constructMap.ImagePosition = DevComponents.DotNetBar.eImagePosition.Top; + this.btn_constructMap.Name = "btn_constructMap"; + this.btn_constructMap.SubItemsExpandWidth = 14; + this.btn_constructMap.Text = "导出施工图"; + this.btn_constructMap.Click += new System.EventHandler(this.btn_constructMap_Click); + // + // buttonItem9 + // + this.buttonItem9.Image = global::Cyberpipe.Properties.Resources._24x24icon__2__10; + this.buttonItem9.ImagePosition = DevComponents.DotNetBar.eImagePosition.Top; + this.buttonItem9.Name = "buttonItem9"; + this.buttonItem9.SubItemsExpandWidth = 14; + this.buttonItem9.Text = "文档管理"; + this.buttonItem9.Click += new System.EventHandler(this.buttonItem9_Click); + // + // ribbonPanel2 + // + this.ribbonPanel2.ColorSchemeStyle = DevComponents.DotNetBar.eDotNetBarStyle.StyleManagerControlled; + this.ribbonPanel2.Controls.Add(this.ribbonBar4); + this.ribbonPanel2.Dock = System.Windows.Forms.DockStyle.Fill; + this.ribbonPanel2.Location = new System.Drawing.Point(0, 0); + this.ribbonPanel2.Name = "ribbonPanel2"; + this.ribbonPanel2.Padding = new System.Windows.Forms.Padding(3, 0, 3, 3); + this.ribbonPanel2.Size = new System.Drawing.Size(1328, 95); + // + // + // + this.ribbonPanel2.Style.Class = ""; + this.ribbonPanel2.Style.CornerType = DevComponents.DotNetBar.eCornerType.Square; + // + // + // + this.ribbonPanel2.StyleMouseDown.Class = ""; + this.ribbonPanel2.StyleMouseDown.CornerType = DevComponents.DotNetBar.eCornerType.Square; + // + // + // + this.ribbonPanel2.StyleMouseOver.Class = ""; + this.ribbonPanel2.StyleMouseOver.CornerType = DevComponents.DotNetBar.eCornerType.Square; + this.ribbonPanel2.TabIndex = 39; + this.ribbonPanel2.Visible = false; + // + // ribbonBar4 + // + this.ribbonBar4.AutoOverflowEnabled = true; + // + // + // + this.ribbonBar4.BackgroundMouseOverStyle.Class = ""; + this.ribbonBar4.BackgroundMouseOverStyle.CornerType = DevComponents.DotNetBar.eCornerType.Square; + // + // + // + this.ribbonBar4.BackgroundStyle.Class = ""; + this.ribbonBar4.BackgroundStyle.CornerType = DevComponents.DotNetBar.eCornerType.Square; + this.ribbonBar4.ContainerControlProcessDialogKey = true; + this.ribbonBar4.Dock = System.Windows.Forms.DockStyle.Left; + this.ribbonBar4.Items.AddRange(new DevComponents.DotNetBar.BaseItem[] { + this.buttonItem_TaskManager, + this.buttonItem_OnlineTask, + this.buttonItem_Event}); + this.ribbonBar4.Location = new System.Drawing.Point(3, 0); + this.ribbonBar4.Name = "ribbonBar4"; + this.ribbonBar4.Size = new System.Drawing.Size(299, 92); + this.ribbonBar4.Style = DevComponents.DotNetBar.eDotNetBarStyle.StyleManagerControlled; + this.ribbonBar4.TabIndex = 0; + this.ribbonBar4.Text = "ribbonBar4"; + // + // + // + this.ribbonBar4.TitleStyle.Class = ""; + this.ribbonBar4.TitleStyle.CornerType = DevComponents.DotNetBar.eCornerType.Square; + // + // + // + this.ribbonBar4.TitleStyleMouseOver.Class = ""; + this.ribbonBar4.TitleStyleMouseOver.CornerType = DevComponents.DotNetBar.eCornerType.Square; + this.ribbonBar4.TitleVisible = false; + // + // buttonItem_TaskManager + // + this.buttonItem_TaskManager.Image = global::Cyberpipe.Properties.Resources._24x24icon__2__76; + this.buttonItem_TaskManager.ImagePosition = DevComponents.DotNetBar.eImagePosition.Top; + this.buttonItem_TaskManager.Name = "buttonItem_TaskManager"; + this.buttonItem_TaskManager.SubItemsExpandWidth = 14; + this.buttonItem_TaskManager.Text = "工单管理"; + this.buttonItem_TaskManager.Click += new System.EventHandler(this.buttonItem_TaskManager_Click); + // + // buttonItem_OnlineTask + // + this.buttonItem_OnlineTask.Image = global::Cyberpipe.Properties.Resources._24x24icon__2__69; + this.buttonItem_OnlineTask.ImagePosition = DevComponents.DotNetBar.eImagePosition.Top; + this.buttonItem_OnlineTask.Name = "buttonItem_OnlineTask"; + this.buttonItem_OnlineTask.SubItemsExpandWidth = 14; + this.buttonItem_OnlineTask.Text = "在线任务"; + this.buttonItem_OnlineTask.Click += new System.EventHandler(this.buttonItem_OnlineTask_Click); + // + // buttonItem_Event + // + this.buttonItem_Event.Image = global::Cyberpipe.Properties.Resources._24x24icon__2__72; + this.buttonItem_Event.ImagePosition = DevComponents.DotNetBar.eImagePosition.Top; + this.buttonItem_Event.Name = "buttonItem_Event"; + this.buttonItem_Event.SubItemsExpandWidth = 14; + this.buttonItem_Event.Text = "事件管理"; + this.buttonItem_Event.Click += new System.EventHandler(this.buttonItem_Event_Click); + // // ribbonPanel1 // this.ribbonPanel1.AutoSize = true; @@ -4262,6 +4463,15 @@ this.buttonItem27.Visible = false; this.buttonItem27.Click += new System.EventHandler(this.buttonItem27_Click); // + // buttonItem1 + // + this.buttonItem1.Image = global::Cyberpipe.Properties.Resources._24x24icon__2__94; + this.buttonItem1.ImagePosition = DevComponents.DotNetBar.eImagePosition.Top; + this.buttonItem1.Name = "buttonItem1"; + this.buttonItem1.SubItemsExpandWidth = 14; + this.buttonItem1.Text = "图层管理"; + this.buttonItem1.Click += new System.EventHandler(this.buttonItem1_Click); + // // buttonItem91 // this.buttonItem91.ForeColor = System.Drawing.Color.Black; @@ -4272,15 +4482,6 @@ this.buttonItem91.Text = "快速定位"; this.buttonItem91.Click += new System.EventHandler(this.buttonItem91_Click); // - // buttonItem1 - // - this.buttonItem1.Image = global::Cyberpipe.Properties.Resources._24x24icon__2__94; - this.buttonItem1.ImagePosition = DevComponents.DotNetBar.eImagePosition.Top; - this.buttonItem1.Name = "buttonItem1"; - this.buttonItem1.SubItemsExpandWidth = 14; - this.buttonItem1.Text = "图层管理"; - this.buttonItem1.Click += new System.EventHandler(this.buttonItem1_Click); - // // btnlegendSet // this.btnlegendSet.Image = global::Cyberpipe.Properties.Resources._24x24icon__2__93; @@ -4300,278 +4501,6 @@ this.buttonItem89.Visible = false; this.buttonItem89.Click += new System.EventHandler(this.buttonItem89_Click); // - // ribbonPanel7 - // - this.ribbonPanel7.ColorSchemeStyle = DevComponents.DotNetBar.eDotNetBarStyle.StyleManagerControlled; - this.ribbonPanel7.Controls.Add(this.ribbonBar5); - this.ribbonPanel7.Dock = System.Windows.Forms.DockStyle.Fill; - this.ribbonPanel7.Location = new System.Drawing.Point(0, 0); - this.ribbonPanel7.Name = "ribbonPanel7"; - this.ribbonPanel7.Padding = new System.Windows.Forms.Padding(3, 0, 3, 3); - this.ribbonPanel7.Size = new System.Drawing.Size(1328, 95); - // - // - // - this.ribbonPanel7.Style.Class = ""; - this.ribbonPanel7.Style.CornerType = DevComponents.DotNetBar.eCornerType.Square; - // - // - // - this.ribbonPanel7.StyleMouseDown.Class = ""; - this.ribbonPanel7.StyleMouseDown.CornerType = DevComponents.DotNetBar.eCornerType.Square; - // - // - // - this.ribbonPanel7.StyleMouseOver.Class = ""; - this.ribbonPanel7.StyleMouseOver.CornerType = DevComponents.DotNetBar.eCornerType.Square; - this.ribbonPanel7.TabIndex = 41; - this.ribbonPanel7.Visible = false; - // - // ribbonBar5 - // - this.ribbonBar5.AutoOverflowEnabled = true; - // - // - // - this.ribbonBar5.BackgroundMouseOverStyle.Class = ""; - this.ribbonBar5.BackgroundMouseOverStyle.CornerType = DevComponents.DotNetBar.eCornerType.Square; - // - // - // - this.ribbonBar5.BackgroundStyle.Class = ""; - this.ribbonBar5.BackgroundStyle.CornerType = DevComponents.DotNetBar.eCornerType.Square; - this.ribbonBar5.ContainerControlProcessDialogKey = true; - this.ribbonBar5.Dock = System.Windows.Forms.DockStyle.Left; - this.ribbonBar5.Items.AddRange(new DevComponents.DotNetBar.BaseItem[] { - this.btn_flag, - this.slider4ground}); - this.ribbonBar5.Location = new System.Drawing.Point(3, 0); - this.ribbonBar5.Name = "ribbonBar5"; - this.ribbonBar5.Size = new System.Drawing.Size(418, 92); - this.ribbonBar5.Style = DevComponents.DotNetBar.eDotNetBarStyle.StyleManagerControlled; - this.ribbonBar5.TabIndex = 0; - // - // - // - this.ribbonBar5.TitleStyle.Class = ""; - this.ribbonBar5.TitleStyle.CornerType = DevComponents.DotNetBar.eCornerType.Square; - // - // - // - this.ribbonBar5.TitleStyleMouseOver.Class = ""; - this.ribbonBar5.TitleStyleMouseOver.CornerType = DevComponents.DotNetBar.eCornerType.Square; - this.ribbonBar5.TitleVisible = false; - this.ribbonBar5.ItemClick += new System.EventHandler(this.ribbonBar5_ItemClick); - // - // btn_flag - // - this.btn_flag.Image = global::Cyberpipe.Properties.Resources._24x24icon_03_hover; - this.btn_flag.ImagePosition = DevComponents.DotNetBar.eImagePosition.Top; - this.btn_flag.Name = "btn_flag"; - this.btn_flag.SubItemsExpandWidth = 14; - this.btn_flag.Text = "标识器管理"; - this.btn_flag.Click += new System.EventHandler(this.btn_flag_Click); - // - // slider4ground - // - this.slider4ground.LabelPosition = DevComponents.DotNetBar.eSliderLabelPosition.Top; - this.slider4ground.Name = "slider4ground"; - this.slider4ground.Text = "地面透明度"; - this.slider4ground.Value = 0; - this.slider4ground.ValueChanged += new System.EventHandler(this.slider4ground_ValueChanged); - // - // ribbonPanel2 - // - this.ribbonPanel2.ColorSchemeStyle = DevComponents.DotNetBar.eDotNetBarStyle.StyleManagerControlled; - this.ribbonPanel2.Controls.Add(this.ribbonBar4); - this.ribbonPanel2.Dock = System.Windows.Forms.DockStyle.Fill; - this.ribbonPanel2.Location = new System.Drawing.Point(0, 0); - this.ribbonPanel2.Name = "ribbonPanel2"; - this.ribbonPanel2.Padding = new System.Windows.Forms.Padding(3, 0, 3, 3); - this.ribbonPanel2.Size = new System.Drawing.Size(1328, 95); - // - // - // - this.ribbonPanel2.Style.Class = ""; - this.ribbonPanel2.Style.CornerType = DevComponents.DotNetBar.eCornerType.Square; - // - // - // - this.ribbonPanel2.StyleMouseDown.Class = ""; - this.ribbonPanel2.StyleMouseDown.CornerType = DevComponents.DotNetBar.eCornerType.Square; - // - // - // - this.ribbonPanel2.StyleMouseOver.Class = ""; - this.ribbonPanel2.StyleMouseOver.CornerType = DevComponents.DotNetBar.eCornerType.Square; - this.ribbonPanel2.TabIndex = 39; - this.ribbonPanel2.Visible = false; - // - // ribbonBar4 - // - this.ribbonBar4.AutoOverflowEnabled = true; - // - // - // - this.ribbonBar4.BackgroundMouseOverStyle.Class = ""; - this.ribbonBar4.BackgroundMouseOverStyle.CornerType = DevComponents.DotNetBar.eCornerType.Square; - // - // - // - this.ribbonBar4.BackgroundStyle.Class = ""; - this.ribbonBar4.BackgroundStyle.CornerType = DevComponents.DotNetBar.eCornerType.Square; - this.ribbonBar4.ContainerControlProcessDialogKey = true; - this.ribbonBar4.Dock = System.Windows.Forms.DockStyle.Left; - this.ribbonBar4.Items.AddRange(new DevComponents.DotNetBar.BaseItem[] { - this.buttonItem_TaskManager, - this.buttonItem_OnlineTask, - this.buttonItem_Event}); - this.ribbonBar4.Location = new System.Drawing.Point(3, 0); - this.ribbonBar4.Name = "ribbonBar4"; - this.ribbonBar4.Size = new System.Drawing.Size(299, 92); - this.ribbonBar4.Style = DevComponents.DotNetBar.eDotNetBarStyle.StyleManagerControlled; - this.ribbonBar4.TabIndex = 0; - this.ribbonBar4.Text = "ribbonBar4"; - // - // - // - this.ribbonBar4.TitleStyle.Class = ""; - this.ribbonBar4.TitleStyle.CornerType = DevComponents.DotNetBar.eCornerType.Square; - // - // - // - this.ribbonBar4.TitleStyleMouseOver.Class = ""; - this.ribbonBar4.TitleStyleMouseOver.CornerType = DevComponents.DotNetBar.eCornerType.Square; - this.ribbonBar4.TitleVisible = false; - // - // buttonItem_TaskManager - // - this.buttonItem_TaskManager.Image = global::Cyberpipe.Properties.Resources._24x24icon__2__76; - this.buttonItem_TaskManager.ImagePosition = DevComponents.DotNetBar.eImagePosition.Top; - this.buttonItem_TaskManager.Name = "buttonItem_TaskManager"; - this.buttonItem_TaskManager.SubItemsExpandWidth = 14; - this.buttonItem_TaskManager.Text = "工单管理"; - this.buttonItem_TaskManager.Click += new System.EventHandler(this.buttonItem_TaskManager_Click); - // - // buttonItem_OnlineTask - // - this.buttonItem_OnlineTask.Image = global::Cyberpipe.Properties.Resources._24x24icon__2__69; - this.buttonItem_OnlineTask.ImagePosition = DevComponents.DotNetBar.eImagePosition.Top; - this.buttonItem_OnlineTask.Name = "buttonItem_OnlineTask"; - this.buttonItem_OnlineTask.SubItemsExpandWidth = 14; - this.buttonItem_OnlineTask.Text = "在线任务"; - this.buttonItem_OnlineTask.Click += new System.EventHandler(this.buttonItem_OnlineTask_Click); - // - // buttonItem_Event - // - this.buttonItem_Event.Image = global::Cyberpipe.Properties.Resources._24x24icon__2__72; - this.buttonItem_Event.ImagePosition = DevComponents.DotNetBar.eImagePosition.Top; - this.buttonItem_Event.Name = "buttonItem_Event"; - this.buttonItem_Event.SubItemsExpandWidth = 14; - this.buttonItem_Event.Text = "事件管理"; - this.buttonItem_Event.Click += new System.EventHandler(this.buttonItem_Event_Click); - // - // ribbonPanel3 - // - this.ribbonPanel3.ColorSchemeStyle = DevComponents.DotNetBar.eDotNetBarStyle.StyleManagerControlled; - this.ribbonPanel3.Controls.Add(this.ribbonBar3); - this.ribbonPanel3.Dock = System.Windows.Forms.DockStyle.Fill; - this.ribbonPanel3.Location = new System.Drawing.Point(0, 33); - this.ribbonPanel3.Name = "ribbonPanel3"; - this.ribbonPanel3.Padding = new System.Windows.Forms.Padding(3, 0, 3, 3); - this.ribbonPanel3.Size = new System.Drawing.Size(1328, 62); - // - // - // - this.ribbonPanel3.Style.Class = ""; - this.ribbonPanel3.Style.CornerType = DevComponents.DotNetBar.eCornerType.Square; - // - // - // - this.ribbonPanel3.StyleMouseDown.Class = ""; - this.ribbonPanel3.StyleMouseDown.CornerType = DevComponents.DotNetBar.eCornerType.Square; - // - // - // - this.ribbonPanel3.StyleMouseOver.Class = ""; - this.ribbonPanel3.StyleMouseOver.CornerType = DevComponents.DotNetBar.eCornerType.Square; - this.ribbonPanel3.TabIndex = 40; - // - // ribbonBar3 - // - this.ribbonBar3.AutoOverflowEnabled = true; - // - // - // - this.ribbonBar3.BackgroundMouseOverStyle.Class = ""; - this.ribbonBar3.BackgroundMouseOverStyle.CornerType = DevComponents.DotNetBar.eCornerType.Square; - // - // - // - this.ribbonBar3.BackgroundStyle.Class = ""; - this.ribbonBar3.BackgroundStyle.CornerType = DevComponents.DotNetBar.eCornerType.Square; - this.ribbonBar3.ContainerControlProcessDialogKey = true; - this.ribbonBar3.Dock = System.Windows.Forms.DockStyle.Left; - this.ribbonBar3.Items.AddRange(new DevComponents.DotNetBar.BaseItem[] { - this.btn_device, - this.btn_Person, - this.btn_constructMap, - this.buttonItem9}); - this.ribbonBar3.Location = new System.Drawing.Point(3, 0); - this.ribbonBar3.Name = "ribbonBar3"; - this.ribbonBar3.Size = new System.Drawing.Size(378, 59); - this.ribbonBar3.Style = DevComponents.DotNetBar.eDotNetBarStyle.StyleManagerControlled; - this.ribbonBar3.TabIndex = 0; - // - // - // - this.ribbonBar3.TitleStyle.Class = ""; - this.ribbonBar3.TitleStyle.CornerType = DevComponents.DotNetBar.eCornerType.Square; - // - // - // - this.ribbonBar3.TitleStyleMouseOver.Class = ""; - this.ribbonBar3.TitleStyleMouseOver.CornerType = DevComponents.DotNetBar.eCornerType.Square; - this.ribbonBar3.TitleVisible = false; - // - // btn_device - // - this.btn_device.ButtonStyle = DevComponents.DotNetBar.eButtonStyle.ImageAndText; - this.btn_device.Image = global::Cyberpipe.Properties.Resources._24X24__2__02; - this.btn_device.ImagePosition = DevComponents.DotNetBar.eImagePosition.Top; - this.btn_device.Name = "btn_device"; - this.btn_device.SubItemsExpandWidth = 14; - this.btn_device.Text = "探测仪管理"; - this.btn_device.Click += new System.EventHandler(this.btn_device_Click); - // - // btn_Person - // - this.btn_Person.ButtonStyle = DevComponents.DotNetBar.eButtonStyle.ImageAndText; - this.btn_Person.Image = global::Cyberpipe.Properties.Resources._24x24icon_05_hover1; - this.btn_Person.ImagePosition = DevComponents.DotNetBar.eImagePosition.Top; - this.btn_Person.Name = "btn_Person"; - this.btn_Person.SubItemsExpandWidth = 14; - this.btn_Person.Text = "定位人员维护"; - this.btn_Person.Click += new System.EventHandler(this.btn_Person_Click); - // - // btn_constructMap - // - this.btn_constructMap.Image = global::Cyberpipe.Properties.Resources._24x24icon_04_hover; - this.btn_constructMap.ImagePosition = DevComponents.DotNetBar.eImagePosition.Top; - this.btn_constructMap.Name = "btn_constructMap"; - this.btn_constructMap.SubItemsExpandWidth = 14; - this.btn_constructMap.Text = "导出施工图"; - this.btn_constructMap.Click += new System.EventHandler(this.btn_constructMap_Click); - // - // buttonItem9 - // - this.buttonItem9.Image = global::Cyberpipe.Properties.Resources._24x24icon__2__10; - this.buttonItem9.ImagePosition = DevComponents.DotNetBar.eImagePosition.Top; - this.buttonItem9.Name = "buttonItem9"; - this.buttonItem9.SubItemsExpandWidth = 14; - this.buttonItem9.Text = "文档管理"; - this.buttonItem9.Click += new System.EventHandler(this.buttonItem9_Click); - // // ribbonPanel8 // this.ribbonPanel8.ColorSchemeStyle = DevComponents.DotNetBar.eDotNetBarStyle.StyleManagerControlled; @@ -4696,6 +4625,86 @@ this.btn_reset_password.Text = "重置密码"; this.btn_reset_password.Click += new System.EventHandler(this.btn_reset_password_Click); // + // ribbonPanel7 + // + this.ribbonPanel7.ColorSchemeStyle = DevComponents.DotNetBar.eDotNetBarStyle.StyleManagerControlled; + this.ribbonPanel7.Controls.Add(this.ribbonBar5); + this.ribbonPanel7.Dock = System.Windows.Forms.DockStyle.Fill; + this.ribbonPanel7.Location = new System.Drawing.Point(0, 0); + this.ribbonPanel7.Name = "ribbonPanel7"; + this.ribbonPanel7.Padding = new System.Windows.Forms.Padding(3, 0, 3, 3); + this.ribbonPanel7.Size = new System.Drawing.Size(1328, 95); + // + // + // + this.ribbonPanel7.Style.Class = ""; + this.ribbonPanel7.Style.CornerType = DevComponents.DotNetBar.eCornerType.Square; + // + // + // + this.ribbonPanel7.StyleMouseDown.Class = ""; + this.ribbonPanel7.StyleMouseDown.CornerType = DevComponents.DotNetBar.eCornerType.Square; + // + // + // + this.ribbonPanel7.StyleMouseOver.Class = ""; + this.ribbonPanel7.StyleMouseOver.CornerType = DevComponents.DotNetBar.eCornerType.Square; + this.ribbonPanel7.TabIndex = 41; + this.ribbonPanel7.Visible = false; + // + // ribbonBar5 + // + this.ribbonBar5.AutoOverflowEnabled = true; + // + // + // + this.ribbonBar5.BackgroundMouseOverStyle.Class = ""; + this.ribbonBar5.BackgroundMouseOverStyle.CornerType = DevComponents.DotNetBar.eCornerType.Square; + // + // + // + this.ribbonBar5.BackgroundStyle.Class = ""; + this.ribbonBar5.BackgroundStyle.CornerType = DevComponents.DotNetBar.eCornerType.Square; + this.ribbonBar5.ContainerControlProcessDialogKey = true; + this.ribbonBar5.Dock = System.Windows.Forms.DockStyle.Left; + this.ribbonBar5.Items.AddRange(new DevComponents.DotNetBar.BaseItem[] { + this.btn_flag, + this.slider4ground}); + this.ribbonBar5.Location = new System.Drawing.Point(3, 0); + this.ribbonBar5.Name = "ribbonBar5"; + this.ribbonBar5.Size = new System.Drawing.Size(418, 92); + this.ribbonBar5.Style = DevComponents.DotNetBar.eDotNetBarStyle.StyleManagerControlled; + this.ribbonBar5.TabIndex = 0; + // + // + // + this.ribbonBar5.TitleStyle.Class = ""; + this.ribbonBar5.TitleStyle.CornerType = DevComponents.DotNetBar.eCornerType.Square; + // + // + // + this.ribbonBar5.TitleStyleMouseOver.Class = ""; + this.ribbonBar5.TitleStyleMouseOver.CornerType = DevComponents.DotNetBar.eCornerType.Square; + this.ribbonBar5.TitleVisible = false; + this.ribbonBar5.ItemClick += new System.EventHandler(this.ribbonBar5_ItemClick); + // + // btn_flag + // + this.btn_flag.Image = global::Cyberpipe.Properties.Resources._24x24icon_03_hover; + this.btn_flag.ImagePosition = DevComponents.DotNetBar.eImagePosition.Top; + this.btn_flag.Name = "btn_flag"; + this.btn_flag.SubItemsExpandWidth = 14; + this.btn_flag.Text = "标识器管理"; + this.btn_flag.Click += new System.EventHandler(this.btn_flag_Click); + // + // slider4ground + // + this.slider4ground.LabelPosition = DevComponents.DotNetBar.eSliderLabelPosition.Top; + this.slider4ground.Name = "slider4ground"; + this.slider4ground.Text = "地面透明度"; + this.slider4ground.Value = 0; + this.slider4ground.ValueChanged += new System.EventHandler(this.slider4ground_ValueChanged); + // // ribbonPanel15 // this.ribbonPanel15.ColorSchemeStyle = DevComponents.DotNetBar.eDotNetBarStyle.StyleManagerControlled; @@ -6393,16 +6402,6 @@ this.buttonItem76.SubItemsExpandWidth = 14; this.buttonItem76.Text = "坐标标注"; // - // layerTree - // - this.layerTree.CheckBoxes = true; - this.layerTree.ItemHeight = 18; - this.layerTree.Location = new System.Drawing.Point(30, 78); - this.layerTree.Name = "layerTree"; - this.layerTree.Size = new System.Drawing.Size(121, 97); - this.layerTree.TabIndex = 1; - this.layerTree.AfterCheck += new System.Windows.Forms.TreeViewEventHandler(this.layerTree_AfterCheck); - // // MainFrm // this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Inherit; @@ -6475,11 +6474,11 @@ this.contextMenuStripDeleteLayerNode.ResumeLayout(false); this.ribbonControl1.ResumeLayout(false); this.ribbonControl1.PerformLayout(); - this.ribbonPanel1.ResumeLayout(false); - this.ribbonPanel7.ResumeLayout(false); - this.ribbonPanel2.ResumeLayout(false); this.ribbonPanel3.ResumeLayout(false); + this.ribbonPanel2.ResumeLayout(false); + this.ribbonPanel1.ResumeLayout(false); this.ribbonPanel8.ResumeLayout(false); + this.ribbonPanel7.ResumeLayout(false); this.ribbonPanel15.ResumeLayout(false); ((System.ComponentModel.ISupportInitialize)(this.pictureBox1)).EndInit(); this.ResumeLayout(false); diff --git a/NewFunction/FrmCreateTunnel.cs b/NewFunction/FrmCreateTunnel.cs index 282767c..338edff 100644 --- a/NewFunction/FrmCreateTunnel.cs +++ b/NewFunction/FrmCreateTunnel.cs @@ -142,35 +142,6 @@ } } - private void txtMS_KeyPress(object sender, KeyPressEventArgs e) - { - TextBox text = sender as TextBox; - if ((e.KeyChar < 48 || e.KeyChar > 57) && (e.KeyChar != 8) && (int)e.KeyChar != 46) - { - e.Handled = true; - } - if ((int)e.KeyChar == 46) //小数点 - { - if (text.Text.Length <= 0) - e.Handled = true; //小数点不能在第一位 - else //处理不规则的小数点 - { - float f; - float oldf; - bool b1 = false, b2 = false; - b1 = float.TryParse(text.Text, out oldf); - b2 = float.TryParse(text.Text + e.KeyChar.ToString(), out f); - if (b2 == false) - { - if (b1 == true) - e.Handled = true; - else - e.Handled = false; - } - } - } - } - private void FrmCreateTunnel_Load(object sender, EventArgs e) { if (comboBoxTunnelType.Items.Count > 0) diff --git a/OracleHelper.cs b/OracleHelper.cs index 11eebe6..79cdf48 100644 --- a/OracleHelper.cs +++ b/OracleHelper.cs @@ -49,7 +49,7 @@ { conn.Close(); } - MessageBox.Show(ex.Message, "提示"); + LogHelper.WriteLog(typeof(OledbHelper), ex.Message); return null; } } @@ -67,7 +67,7 @@ } catch(Exception ex) { - // LogError.PublishError(ex); + LogHelper.WriteLog(typeof(OledbHelper), ex.Message); } finally { @@ -111,6 +111,7 @@ } catch (Exception ex) { + LogHelper.WriteLog(typeof(OledbHelper), ex.Message); return null; } } @@ -131,6 +132,7 @@ } catch(Exception ex) { + LogHelper.WriteLog(typeof(OledbHelper), ex.Message); rowCount = -1; } finally @@ -159,6 +161,7 @@ } catch(Exception ex) { + LogHelper.WriteLog(typeof(OledbHelper), ex.Message); num = -1; } finally @@ -190,6 +193,7 @@ } catch (Exception ex) { + LogHelper.WriteLog(typeof(OledbHelper), ex.Message); return null; } } @@ -210,7 +214,7 @@ oracleCmd.Dispose(); conn.Close(); //调用con_close()方法,关闭与数据库的连接 }catch(Exception ex){ - + LogHelper.WriteLog(typeof(OledbHelper), ex.Message); } finally { @@ -237,6 +241,7 @@ } catch (Exception ex) { + LogHelper.WriteLog(typeof(OledbHelper), ex.Message); rowCount = -1; } finally diff --git a/OracleUtils.cs b/OracleUtils.cs index 29b5374..c1aadda 100644 --- a/OracleUtils.cs +++ b/OracleUtils.cs @@ -741,7 +741,6 @@ } catch { - //if we fail to return the SqlDatReader, we need to close the connection ourselves cn.Close(); throw; } diff --git a/PAS.cs b/PAS.cs index 972de2d..fcda1dd 100644 --- a/PAS.cs +++ b/PAS.cs @@ -93,15 +93,7 @@ } - private void TSM_Pderive_Click(object sender, EventArgs e) - { - PASAClass.Table_name(operation); - if (TV_Files.SelectedNode != null) - { - PASAClass.GuideEdit_form("G", TV_Files, int.Parse(((ToolStripMenuItem)sender).Tag.ToString())); - } - } - + private void TSM_Fenter_Click(object sender, EventArgs e) { if (TV_Files.SelectedNode != null) @@ -110,16 +102,6 @@ } } - private void TSM_Frename_Click(object sender, EventArgs e) - { - TSM_Fenter_Click(sender, e); - } - - private void TSM_Fdelete_Click(object sender, EventArgs e) - { - TSM_Fenter_Click(sender, e); - } - private void TSM_Fderive_Click(object sender, EventArgs e) { if (TV_Files.SelectedNode != null) @@ -128,25 +110,6 @@ } } - private void TSM_Fprint_Click(object sender, EventArgs e) - { - if (TV_Files.SelectedNode != null) - { - PASAClass.Print(int.Parse(TV_Files.SelectedNode.Tag.ToString()), TV_Files.SelectedNode.Text, PD_PASPrtFile, PD_PASPrtDoc); - - } - } - - private void TSM_PASPgSt_Click(object sender, EventArgs e) - { - PSD_PASSetPage.ShowDialog(); - } - - private void TSM_PASPreV_Click(object sender, EventArgs e) - { - PPD_PASPreV.ShowDialog(); - } - private void TV_Files_AfterCollapse(object sender, TreeViewEventArgs e) { e.Node.ImageIndex = 0; @@ -250,14 +213,6 @@ } } - private void 导出ToolStripMenuItem_Click(object sender, EventArgs e) - { - PASAClass.Table_name(operation); - if (TV_Files.SelectedNode != null) - { - PASAClass.GuideEdit_form("G", TV_Files, int.Parse(((ToolStripMenuItem)sender).Tag.ToString())); - } - } private void 导入ToolStripMenuItem_Click(object sender, EventArgs e) { diff --git a/PAS_Forms/F_PASInout.cs b/PAS_Forms/F_PASInout.cs index 373a4e6..974f987 100644 --- a/PAS_Forms/F_PASInout.cs +++ b/PAS_Forms/F_PASInout.cs @@ -71,11 +71,6 @@ } - private void Cancel_Click(object sender, EventArgs e) - { - this.Close(); - } - private void OK_Click(object sender, EventArgs e) { if (textBox1.Text == "") diff --git a/PATM.cs b/PATM.cs index edecd1e..9b6c51d 100644 --- a/PATM.cs +++ b/PATM.cs @@ -26,12 +26,6 @@ public string operation = ""; #endregion - - - - - - private void TSM_Pnew_Click(object sender, EventArgs e) { if (LV_proj.Visible) @@ -94,15 +88,6 @@ } - private void TSM_Pderive_Click(object sender, EventArgs e) - { - PATMAClass.Table_name(operation); - if (TV_files.SelectedNode != null) - { - PATMAClass.GuideEdit_form("G", TV_files, int.Parse(((ToolStripMenuItem)sender).Tag.ToString())); - } - } - private void TSM_Fenter_Click(object sender, EventArgs e) { if (TV_files.SelectedNode != null) @@ -163,35 +148,6 @@ //PATMAClass.Show_AllFile(int.Parse(e.Node.Tag.ToString()), e.Node.Text, LV_PATMallfiles, PB_Display, 2);//此处为显示图片操作 } - private void TSM_Frename_Click(object sender, EventArgs e) - { - TSM_Fenter_Click(sender, e); - } - - private void TSM_Fdelete_Click(object sender, EventArgs e) - { - TSM_Fenter_Click(sender, e); - } - - private void TSM_Fderive_Click(object sender, EventArgs e) - { - if (TV_files.SelectedNode != null) - { - PATMAClass.GuideEdit_form("G", TV_files, int.Parse(((ToolStripMenuItem)sender).Tag.ToString())); - } - } - - private void TSM_Fprint_Click(object sender, EventArgs e) - { - if (TV_files.SelectedNode != null) - { - PATMAClass.Print(int.Parse(TV_files.SelectedNode.Tag.ToString()), TV_files.SelectedNode.Text, PD_PATMPrtFile, PD_PATMPrtDoc); - - } - } - - - private void BT_PATMSch_Click(object sender, EventArgs e) { //LV_PATMallfiles.Dock = DockStyle.Fill;//使ListView控件最大化 @@ -210,32 +166,6 @@ } - private void TSM_PATMPreV_Click(object sender, EventArgs e) - { - PPD_PATMPreV.ShowDialog(); - } - - private void TSM_PATMPgSt_Click(object sender, EventArgs e) - { - PSD_PATMSetPage.ShowDialog(); - } - - private void LV_PATMSrchRslt_MouseClick(object sender, MouseEventArgs e) - { - - if (LV_proj.SelectedItems != null) - { - //int i = 1; - // PATMAClass.Show_AllFile(int.Parse(LV_PATMSrchRslt.FocusedItem.Tag.ToString()), LV_PATMSrchRslt.FocusedItem.Text, LV_PATMallfiles,PB_Display, 0); - - } - } - - private void LV_PATMSrchRslt_MouseDoubleClick(object sender, MouseEventArgs e) - { - //PATMAClass.Show_AllFile(int.Parse(LV_PATMSrchRslt.FocusedItem.Tag.ToString()), LV_PATMSrchRslt.FocusedItem.Text, LV_PATMallfiles, PB_Display, 2); - } - private void 新建ToolStripMenuItem_Click(object sender, EventArgs e) { if ((TV_files.SelectedNode != null)&&(TV_files.SelectedNode.Parent==null)) @@ -288,17 +218,6 @@ } } - private void 打印预览toolStripMenuItem_Click(object sender, EventArgs e) - { - - PPD_PATMPreV.ShowDialog(); - } - - private void 打印设置toolStripMenuItem_Click(object sender, EventArgs e) - { - PSD_PATMSetPage.ShowDialog(); - } - private void TV_PATMSrchRslt_NodeMouseClick(object sender, TreeNodeMouseClickEventArgs e) { if (e.Button == MouseButtons.Right) diff --git a/PATM_Forms/F_PATMTitle.cs b/PATM_Forms/F_PATMTitle.cs index 7380dd8..5d1fe8c 100644 --- a/PATM_Forms/F_PATMTitle.cs +++ b/PATM_Forms/F_PATMTitle.cs @@ -148,19 +148,6 @@ return 0; } - //判断是否为已有工程 - private bool checkProject(string projectname) { - string sql = "select * from "+this.tablename+" where "+tablename+".NODENAME = '"+projectname - +"'"; - DataTable table = OledbHelper.QueryTable(sql); - if (table.Rows.Count > 0) - { - return true; - } - else { - return false; - } - } private void buttonX2_Click(object sender, EventArgs e) { diff --git a/PATM_Forms/F_PATMinout.cs b/PATM_Forms/F_PATMinout.cs index e404e7b..16b51de 100644 --- a/PATM_Forms/F_PATMinout.cs +++ b/PATM_Forms/F_PATMinout.cs @@ -174,12 +174,6 @@ { this.Close(); } - - private void TV_PATMinout_AfterCollapse(object sender, TreeViewEventArgs e) - { - e.Node.ImageIndex = 0; - } - //private void TV_PATMinout_NodeMouseDoubleClick(object sender, TreeNodeMouseClickEventArgs e) diff --git "a/PED_Forms/F_\346\225\260\346\215\256\350\276\223\345\205\245\350\276\223\345\207\272.cs" "b/PED_Forms/F_\346\225\260\346\215\256\350\276\223\345\205\245\350\276\223\345\207\272.cs" index 0f76b8c..4de8b4d 100644 --- "a/PED_Forms/F_\346\225\260\346\215\256\350\276\223\345\205\245\350\276\223\345\207\272.cs" +++ "b/PED_Forms/F_\346\225\260\346\215\256\350\276\223\345\205\245\350\276\223\345\207\272.cs" @@ -188,12 +188,7 @@ } DialogResult = DialogResult.OK;//将当前窗体的对话框返回值设为OK } - private void treeView1_NodeMouseClick(object sender, TreeNodeMouseClickEventArgs e) - { - - //dir = comboBox_Disk.Text + e.Node.FullPath; - e.Node.SelectedImageIndex = e.Node.ImageIndex; - } + private void button1_Click(object sender, EventArgs e) { diff --git a/Program.cs b/Program.cs index 1ff0987..0e480f2 100644 --- a/Program.cs +++ b/Program.cs @@ -105,22 +105,6 @@ File.Copy(localPath_config, filePath_config, true); } - private static void createFolder(String folerName) - { - if (!Directory.Exists(folerName)) - { - Directory.CreateDirectory(folerName); - } - } - - private static void delOldVersion(String fileName) - { - if (System.IO.File.Exists(fileName)) - { - File.Delete(fileName); - } - } - //获取新版本程序的路径 private static string getProgramUrl(string fileName, string nodeName) { diff --git "a/SFiles_Forms/F_SFiles\346\225\260\346\215\256\350\276\223\345\205\245\350\276\223\345\207\272.cs" "b/SFiles_Forms/F_SFiles\346\225\260\346\215\256\350\276\223\345\205\245\350\276\223\345\207\272.cs" index 6f36e10..493895d 100644 --- "a/SFiles_Forms/F_SFiles\346\225\260\346\215\256\350\276\223\345\205\245\350\276\223\345\207\272.cs" +++ "b/SFiles_Forms/F_SFiles\346\225\260\346\215\256\350\276\223\345\205\245\350\276\223\345\207\272.cs" @@ -188,12 +188,6 @@ } DialogResult = DialogResult.OK;//将当前窗体的对话框返回值设为OK } - private void treeView1_NodeMouseClick(object sender, TreeNodeMouseClickEventArgs e) - { - - //dir = comboBox_Disk.Text + e.Node.FullPath; - e.Node.SelectedImageIndex = e.Node.ImageIndex; - } private void button1_Click(object sender, EventArgs e) { diff --git a/Cyberpipe.csproj b/Cyberpipe.csproj index 07a8c1a..e3cd12c 100644 --- a/Cyberpipe.csproj +++ b/Cyberpipe.csproj @@ -204,25 +204,6 @@ - - Form - - - F_GKT1数据输入输出.cs - - - Form - - - F_GKT1添加文件.cs - - - Form - - - F_GKT1添加项目.cs - - Form @@ -1068,18 +1049,6 @@ Frm_password_reset.cs - - Form - - - GKT.cs - - - Form - - - GKT1.cs - Form @@ -1258,12 +1227,6 @@ F_Projedit.cs - - Form - - - PED.cs - Form @@ -1331,16 +1294,6 @@ True Reference.map - - F_GKT1数据输入输出.cs - Designer - - - F_GKT1添加文件.cs - - - F_GKT1添加项目.cs - Form_EditTask.cs @@ -1836,12 +1789,6 @@ Frm_password_reset.cs - - GKT.cs - - - GKT1.cs - F_GKT数据输入输出.cs @@ -1934,9 +1881,6 @@ F_Projedit.cs - - PED.cs - F_数据输入输出.cs diff --git a/Cyberpipe.suo b/Cyberpipe.suo index 68ced4f..a1aecf8 100644 --- a/Cyberpipe.suo +++ b/Cyberpipe.suo Binary files differ diff --git a/EMS_Forms/Form_EditTask.cs b/EMS_Forms/Form_EditTask.cs index 718992f..f1d791f 100644 --- a/EMS_Forms/Form_EditTask.cs +++ b/EMS_Forms/Form_EditTask.cs @@ -119,7 +119,8 @@ String name = Convert.ToString(dr["USERNAME"]); comboBox_userName.Items.Add(name); - } + } + dr.Close(); comboBox_road.Items.Clear(); roadList = new List(); @@ -135,7 +136,7 @@ comboBox_road.Items.Add(name); } } - + dr1.Close(); conn.Close(); bool flag2 = false; @@ -185,7 +186,7 @@ catch (Exception ex) { - MessageBox.Show(ex.ToString()); + LogHelper.WriteLog(typeof(Form_EditTask), ex.Message); } } @@ -288,7 +289,7 @@ } catch (Exception ex) { - MessageBox.Show(ex.ToString()); + LogHelper.WriteLog(typeof(Form_EditTask), ex.Message); } } @@ -474,7 +475,7 @@ } catch (Exception ex) { - MessageBox.Show(ex.ToString()); + LogHelper.WriteLog(typeof(Form_EditTask), ex.Message); } this.Close(); @@ -495,6 +496,7 @@ { numList.Add(Convert.ToInt32(dr["DBID"])); } + dr.Close(); if (numList.Count == 0) { taskNumber = Convert.ToInt32(number) * 100; @@ -674,6 +676,7 @@ } } } + dr.Close(); conn.Close(); } diff --git a/EMS_Forms/Form_EventManager.cs b/EMS_Forms/Form_EventManager.cs index b18c45b..84807b2 100644 --- a/EMS_Forms/Form_EventManager.cs +++ b/EMS_Forms/Form_EventManager.cs @@ -64,6 +64,7 @@ comboBox_name.Items.Add(name); } + dr.Close(); conn.Close(); diff --git a/Forms/FrmMnModify.cs b/Forms/FrmMnModify.cs index 31cfc5f..d036360 100644 --- a/Forms/FrmMnModify.cs +++ b/Forms/FrmMnModify.cs @@ -68,15 +68,7 @@ questionGrid.Rows[idx].Cells[1].Value = sr.question; } } - /// 选中对象 - /// - /// - /// - /// - private void buttonX1_Click(object sender, EventArgs e) - { - globecontrol.Globe.Action = EnumAction3D.SelectObject; - } + /// /// 选中某一行 /// diff --git a/Forms/FrmPipelineModelDataBase.cs b/Forms/FrmPipelineModelDataBase.cs index 2acf0ca..7ce573f 100644 --- a/Forms/FrmPipelineModelDataBase.cs +++ b/Forms/FrmPipelineModelDataBase.cs @@ -35,19 +35,7 @@ ds = _ds; InitializeComponent(); } - /// - /// 单击选择shp格式文件 - /// - /// - /// - private void btnBrowseModel_Click(object sender, EventArgs e) - { - saveFileDialog1.Filter = "*.lgd|*.lgd"; - if (saveFileDialog1.ShowDialog() == DialogResult.OK) - { - txtModelLayer.Text = saveFileDialog1.FileName; - } - } + /// /// 窗体初始化事件处理 /// @@ -100,49 +88,6 @@ } } } - - private object convertFieldValue(string fieldname, object obj) - { - if (obj == null) - return null; - - try - { - string type = fields_types[fieldname].ToString(); - switch (type) - { - case "string": - return obj.ToString(); - case "int": - //return 101; - int intResult; - if (int.TryParse(obj.ToString(), out intResult)) - return intResult; - else - return null; - case "double": - //return 202.5; - double doubleResult; - if (double.TryParse(obj.ToString(), out doubleResult)) - return doubleResult; - else - return null; - case "date": - DateTime dtResult; - if (DateTime.TryParse(obj.ToString(), out dtResult)) - return dtResult; - else - return null; - } - return null; - } - catch (Exception ex) - { - MessageBox.Show(ex.ToString()); - return null; - } - } - public string lgdFilePath = ""; /// /// 选择管线颜色 @@ -610,33 +555,6 @@ { this.Close(); } - - private void cmbLayer_SelectedIndexChanged(object sender, EventArgs e) //选择图层 - { - GSOLayer layer = ctl.Globe.Layers.GetLayerByCaption(selectLayerName); - GSOFeatures features = layer.GetAllFeatures(); - if (features.Length == 0) - return; - - cmbFrom.Items.Clear(); - cmbTo.Items.Clear(); - cmbRadius.Items.Clear(); - cmbID.Items.Clear(); - for (int i = 0; i < features[0].GetFieldCount(); i++) - { - GeoScene.Data.GSOFieldDefn fielddef = (GeoScene.Data.GSOFieldDefn)(features[0].GetFieldDefn(i)); - - cmbFrom.Items.Add(fielddef.Name); - cmbTo.Items.Add(fielddef.Name); - cmbRadius.Items.Add(fielddef.Name); - cmbID.Items.Add(fielddef.Name); - } - cmbFrom.SelectedItem = "Deep1"; - cmbTo.SelectedItem = "Deep2"; - cmbRadius.SelectedItem = "Diameter"; - cmbID.SelectedItem = "Handle"; - } - private void buttonXLayerPath_Click(object sender, EventArgs e)//单击 选择shp格式的文件 { OpenFileDialog dlg = new OpenFileDialog(); diff --git a/Forms/FrmPipelineModelDataOneStep.cs b/Forms/FrmPipelineModelDataOneStep.cs index 18afda7..ec93b8a 100644 --- a/Forms/FrmPipelineModelDataOneStep.cs +++ b/Forms/FrmPipelineModelDataOneStep.cs @@ -38,19 +38,7 @@ layerTree = _layerTree; InitializeComponent(); } - /// - /// 单击选择shp格式文件 - /// - /// - /// - private void btnBrowseModel_Click(object sender, EventArgs e) - { - saveFileDialog1.Filter = "*.lgd|*.lgd"; - if (saveFileDialog1.ShowDialog() == DialogResult.OK) - { - txtModelLayer.Text = saveFileDialog1.FileName; - } - } + /// /// 窗体初始化事件处理 /// @@ -107,48 +95,7 @@ } } - private object convertFieldValue(string fieldname, object obj) - { - if (obj == null) - return null; - - try - { - string type = fields_types[fieldname].ToString(); - switch (type) - { - case "string": - return obj.ToString(); - case "int": - //return 101; - int intResult; - if (int.TryParse(obj.ToString(), out intResult)) - return intResult; - else - return null; - case "double": - //return 202.5; - double doubleResult; - if (double.TryParse(obj.ToString(), out doubleResult)) - return doubleResult; - else - return null; - case "date": - DateTime dtResult; - if (DateTime.TryParse(obj.ToString(), out dtResult)) - return dtResult; - else - return null; - } - return null; - } - catch (Exception ex) - { - MessageBox.Show(ex.ToString()); - return null; - } - } - + public string lgdFilePath = ""; /// /// 选择管线颜色 @@ -673,32 +620,6 @@ return featDs; } - private void cmbLayer_SelectedIndexChanged(object sender, EventArgs e) //选择图层 - { - GSOLayer layer = ctl.Globe.Layers.GetLayerByCaption(selectLayerName); - GSOFeatures features = layer.GetAllFeatures(); - if (features.Length == 0) - return; - - cmbFrom.Items.Clear(); - cmbTo.Items.Clear(); - cmbRadius.Items.Clear(); - cmbID.Items.Clear(); - for (int i = 0; i < features[0].GetFieldCount(); i++) - { - GeoScene.Data.GSOFieldDefn fielddef = (GeoScene.Data.GSOFieldDefn)(features[0].GetFieldDefn(i)); - - cmbFrom.Items.Add(fielddef.Name); - cmbTo.Items.Add(fielddef.Name); - cmbRadius.Items.Add(fielddef.Name); - cmbID.Items.Add(fielddef.Name); - } - cmbFrom.SelectedItem = "Deep1"; - cmbTo.SelectedItem = "Deep2"; - cmbRadius.SelectedItem = "Diameter"; - cmbID.SelectedItem = "Handle"; - } - private void buttonXLayerPath_Click(object sender, EventArgs e)//单击 选择shp格式的文件 { OpenFileDialog dlg = new OpenFileDialog(); @@ -949,38 +870,6 @@ } //txtLayername.Text = type + layername; } - /// - /// 连接数据库 - /// - /// - /// - private void buttonX1_Click(object sender, EventArgs e) - { - if (ds == null) - { - //没连的话,直接连接审核库; //审核库配置读配置文件 - string dbIp = Utility.sgdbip; - string database = Utility.sgdbname; - string user = Utility.sgdbuser; - string pass = Utility.sgdbpwd; - - if (!Utility.isNetworkConnectionSuccess(dbIp.Trim())) - { - MessageBox.Show("网络连接失败!", "提示"); - return; - } - - ds = ctl.Globe.DataManager.OpenOracleDataSource(dbIp + "/" + database, "", "", user, pass); - if (ds == null) - { - MessageBox.Show("数据库连接失败!", "提示", MessageBoxButtons.OK, MessageBoxIcon.Warning); - } - else - { - btnCreateModel.Enabled = true; - } - } - } private void btnClose_Click(object sender, EventArgs e) { diff --git a/Forms/FrmShRK.cs b/Forms/FrmShRK.cs index 0e2e722..f1d83cb 100644 --- a/Forms/FrmShRK.cs +++ b/Forms/FrmShRK.cs @@ -215,6 +215,7 @@ { sourcefeatds = sourcefeat as GSOFeatureDataset; } + if (sourcefeatds == null) return; sourcefeatds.Open(); GSOFeatures sourcefeatures = sourcefeatds.GetAllFeatures(); @@ -251,6 +252,7 @@ { desfeatds = desfeat as GSOFeatureDataset; } + if (desfeatds == null) return; desfeatds.Open(); //向新数据集写入字段 diff --git a/FrmAccessoriesSensor.cs b/FrmAccessoriesSensor.cs index 09fcdf1..2a7a80e 100644 --- a/FrmAccessoriesSensor.cs +++ b/FrmAccessoriesSensor.cs @@ -209,7 +209,7 @@ chart1.Series[0].Points.DataBindXY(dic.Keys, dic.Values); for (int m = 0; m < dic.Values.Count; m++) { - if (chart1.Series[0].Points[m].YValues[0].ToString() != "0") + if (chart1.Series[0].Points[m]!=null&&chart1.Series[0].Points[m].YValues[0].ToString() != "0") { chart1.Series[0].Points[m].Label = chart1.Series[0].Points[m].YValues[0].ToString(); } diff --git a/FrmAccessoriesgather.cs b/FrmAccessoriesgather.cs index 9e331e1..a475d9e 100644 --- a/FrmAccessoriesgather.cs +++ b/FrmAccessoriesgather.cs @@ -338,7 +338,7 @@ chart1.Series[0].Points.DataBindXY(dic.Keys, dic.Values); for (int m = 0; m < dic.Values.Count; m++) { - if (chart1.Series[0].Points[m].YValues[0].ToString() != "0") + if (chart1.Series[0].Points[m]!=null&&chart1.Series[0].Points[m].YValues[0].ToString() != "0") { chart1.Series[0].Points[m].Label = chart1.Series[0].Points[m].YValues[0].ToString(); } diff --git a/FrmAccessoryAnalysis.cs b/FrmAccessoryAnalysis.cs index 71d4579..44d4065 100644 --- a/FrmAccessoryAnalysis.cs +++ b/FrmAccessoryAnalysis.cs @@ -66,39 +66,6 @@ globeControl1.Refresh(); } /// - /// 键盘按键按下事件处理 - /// - /// - /// - private void txtRadius_KeyPress(object sender, KeyPressEventArgs e) - { - TextBox text = sender as TextBox; - if ((e.KeyChar < 48 || e.KeyChar > 57) && (e.KeyChar != 8) && (int)e.KeyChar != 46) - { - e.Handled = true; - } - if ((int)e.KeyChar == 46) //小数点 - { - if (text.Text.Length <= 0) - e.Handled = true; //小数点不能在第一位 - else //处理不规则的小数点 - { - float f; - float oldf; - bool b1 = false, b2 = false; - b1 = float.TryParse(text.Text, out oldf); - b2 = float.TryParse(text.Text + e.KeyChar.ToString(), out f); - if (b2 == false) - { - if (b1 == true) - e.Handled = true; - else - e.Handled = false; - } - } - } - } - /// /// 确定按钮事件处理 /// /// diff --git a/FrmAddValve.cs b/FrmAddValve.cs index 34d2fec..5f405b9 100644 --- a/FrmAddValve.cs +++ b/FrmAddValve.cs @@ -486,56 +486,6 @@ } } - - - - - - - - private void cmbLayer_SelectedIndexChanged(object sender, EventArgs e) - { - GSOLayer layer = globeControl1.Globe.Layers.GetLayerByCaption(selectLayerName); - GSOFeatures features = layer.GetAllFeatures(); - if (features.Length == 0) - return; - - combPath.Items.Clear(); - combZ.Items.Clear(); - combModelName.Items.Clear(); - - for (int i = 0; i < features[0].GetFieldCount(); i++) - { - GeoScene.Data.GSOFieldDefn fielddef = (GeoScene.Data.GSOFieldDefn)(features[0].GetFieldDefn(i)); - combPath.Items.Add(fielddef.Name); - combZ.Items.Add(fielddef.Name); - combModelName.Items.Add(fielddef.Name); - } - combModelName.SelectedItem = "编号"; - combPath.SelectedItem = "模型路径"; - if (combfile.SelectedIndex != -1) - { - - string layerCaption = combfile.SelectedItem.ToString().Trim(); - rukuLayer = globeControl1.Globe.Layers.GetLayerByCaption(layerCaption); - if (rukuLayer != null) - { - combPath.Items.Clear(); - combZ.Items.Clear(); - combModelName.Items.Clear(); - - } - for (int i = 0; i < features[0].GetFieldCount(); i++) - { - GeoScene.Data.GSOFieldDefn fielddef = (GeoScene.Data.GSOFieldDefn)(features[0].GetFieldDefn(i)); - combPath.Items.Add(fielddef.Name); - combZ.Items.Add(fielddef.Name); - combModelName.Items.Add(fielddef.Name); - } - combModelName.SelectedItem = "编号"; - combPath.SelectedItem = "模型路径"; - } - } /// /// 单击选择shp格式文件 /// diff --git a/FrmAddWellShp.cs b/FrmAddWellShp.cs index bb79ec0..a249725 100644 --- a/FrmAddWellShp.cs +++ b/FrmAddWellShp.cs @@ -478,32 +478,6 @@ } } } - - private void cmbLayer_SelectedIndexChanged(object sender, EventArgs e) - { - GSOLayer layer = globeControl1.Globe.Layers.GetLayerByCaption(selectLayerName); - GSOFeatures features = layer.GetAllFeatures(); - if (features.Length == 0) - return; - - combCode.Items.Clear(); - combDeep.Items.Clear(); - combModelName.Items.Clear(); - combAngle.Items.Clear(); - - for (int i = 0; i < features[0].GetFieldCount(); i++) - { - GeoScene.Data.GSOFieldDefn fielddef = (GeoScene.Data.GSOFieldDefn)(features[0].GetFieldDefn(i)); - combCode.Items.Add(fielddef.Name); - combDeep.Items.Add(fielddef.Name); - combModelName.Items.Add(fielddef.Name); - combAngle.Items.Add(fielddef.Name); - } - combCode.SelectedItem = "附属物编码"; - combDeep.SelectedItem = "井深"; - combModelName.SelectedItem = "编号"; - combAngle.SelectedItem = "符号角度"; - } /// /// 单击选择shp格式文件 /// diff --git a/FrmAddYuBiZiShp.cs b/FrmAddYuBiZiShp.cs index b312d51..332f037 100644 --- a/FrmAddYuBiZiShp.cs +++ b/FrmAddYuBiZiShp.cs @@ -383,80 +383,7 @@ } } - private void cmbLayer_SelectedIndexChanged(object sender, EventArgs e) - { - GSOLayer layer = globeControl1.Globe.Layers.GetLayerByCaption(selectLayerName); - GSOFeatures features = layer.GetAllFeatures(); - if (features.Length == 0) - return; - - combCode.Items.Clear(); - combDeep.Items.Clear(); - combModelName.Items.Clear(); - //comboLoad.Items.Clear(); - for (int i = 0; i < features[0].GetFieldCount(); i++) - { - GeoScene.Data.GSOFieldDefn fielddef = (GeoScene.Data.GSOFieldDefn)(features[0].GetFieldDefn(i)); - combCode.Items.Add(fielddef.Name); - combDeep.Items.Add(fielddef.Name); - combModelName.Items.Add(fielddef.Name); - //comboLoad.Items.Add(fielddef.Name); - } - combCode.SelectedItem = "附属物编码"; - combDeep.SelectedItem = "Z坐标"; - combModelName.SelectedItem = "编号"; - //comboLoad.SelectedItem = "模型路径"; - } - - private void buttonXLayerPath_Click(object sender, EventArgs e) - { - OpenFileDialog dlg = new OpenFileDialog(); - dlg.Filter = "*.shp|*.shp"; - dlg.Multiselect = false; - if (dlg.ShowDialog() == DialogResult.OK) - { - GSOLayer layer = globeControl1.Globe.Layers.Add(dlg.FileName); - string txtMessage = valiYBdata(layer); - if (txtMessage != "") - { - button3.Enabled = false; - //textBoxLayer.Text = ""; - combCode.Items.Clear(); - combDeep.Items.Clear(); - combModelName.Items.Clear(); - globeControl1.Globe.Layers.Remove(layer); - FrmValiDataShowErrorMessage showErrorMessage = new FrmValiDataShowErrorMessage(dlg.FileName, txtMessage); - showErrorMessage.ShowDialog(); - return; - } - else - { - button3.Enabled = true; - //textBoxLayer.Text = dlg.FileName; - selectLayerName = layer.Caption; - txtLayerName.Text = layer.Caption; - GSOFeatures features = layer.GetAllFeatures(); - if (features.Length == 0) - return; - - combCode.Items.Clear(); - combDeep.Items.Clear(); - combModelName.Items.Clear(); - for (int i = 0; i < features[0].GetFieldCount(); i++) - { - GeoScene.Data.GSOFieldDefn fielddef = (GeoScene.Data.GSOFieldDefn)(features[0].GetFieldDefn(i)); - combCode.Items.Add(fielddef.Name); - combDeep.Items.Add(fielddef.Name); - combModelName.Items.Add(fielddef.Name); - //comboLoad.Items.Add(fielddef.Name); - } - combCode.SelectedItem = "管点编码"; - combDeep.SelectedItem = "Z坐标"; - combModelName.SelectedItem = "编号"; - } - } - } - + private void FrmAddYuBiZiShp_FormClosing(object sender, FormClosingEventArgs e) { globeControl1.Globe.Refresh(); diff --git a/FrmAllPipelineStatis.cs b/FrmAllPipelineStatis.cs index 6421a26..a6eea29 100644 --- a/FrmAllPipelineStatis.cs +++ b/FrmAllPipelineStatis.cs @@ -84,7 +84,7 @@ chartAllAreaPipeline.Series["管线"].Points.DataBindXY(pipelineLengthAndType.Keys, pipelineLengthAndType.Values); for (int m = 0; m < pipelineLengthAndType.Values.Count; m++) { - if (chartAllAreaPipeline.Series["管线"].Points[m].YValues[0].ToString() != "0") + if (chartAllAreaPipeline.Series["管线"].Points[m]!=null&&chartAllAreaPipeline.Series["管线"].Points[m].YValues[0].ToString() != "0") { chartAllAreaPipeline.Series["管线"].Points[m].Label = chartAllAreaPipeline.Series[0].Points[m].YValues[0].ToString(); } @@ -94,7 +94,7 @@ } catch (Exception ex) { - //LogError.PublishError(ex); + LogHelper.WriteLog(typeof(FrmAllPipelineStatis), ex.Message); } } @@ -147,7 +147,7 @@ } DataTable dt = OledbHelper.QueryTable(sql); - if (dt != null && dt.Rows.Count > 0) + if (dt != null && dt.Rows.Count > 0 && chartAllAreaPipeline.Series["管线"].Points[indexHit]!=null) { dataGridViewX1.DataSource = dt; panel.Visible = true; diff --git a/FrmAllWorkWellStatis.cs b/FrmAllWorkWellStatis.cs index 6fec7af..6af8e4c 100644 --- a/FrmAllWorkWellStatis.cs +++ b/FrmAllWorkWellStatis.cs @@ -52,7 +52,7 @@ chartAllAreaPipeline.Series["井盖"].Points.DataBindXY(workWellLengthAndType.Keys, workWellLengthAndType.Values); for (int m = 0; m < workWellLengthAndType.Values.Count; m++) { - if (chartAllAreaPipeline.Series["井盖"].Points[m].YValues[0].ToString().Trim() != "0") + if (chartAllAreaPipeline.Series["井盖"].Points[m]!=null&&chartAllAreaPipeline.Series["井盖"].Points[m].YValues[0].ToString().Trim() != "0") { chartAllAreaPipeline.Series["井盖"].Points[m].Label = chartAllAreaPipeline.Series[0].Points[m].YValues[0].ToString(); } @@ -60,7 +60,7 @@ } catch (Exception ex) { - //LogError.PublishError(ex); + LogHelper.WriteLog(typeof(FrmAllWorkWellStatis), ex.Message); } } diff --git a/FrmBSQDuoBianXingStatis.cs b/FrmBSQDuoBianXingStatis.cs index e8b7d52..3e889b6 100644 --- a/FrmBSQDuoBianXingStatis.cs +++ b/FrmBSQDuoBianXingStatis.cs @@ -60,7 +60,7 @@ { for (int m = 0; m < bsq1.Values.Count; m++) { - if (chart1.Series["标识器"].Points[m].YValues[0].ToString() != "0") + if (chart1.Series["标识器"].Points[m]!=null&&chart1.Series["标识器"].Points[m].YValues[0].ToString() != "0") { count += Convert.ToInt16(chart1.Series[0].Points[m].YValues[0].ToString()); chart1.Series["标识器"].Points[m].Label = chart1.Series[0].Points[m].YValues[0].ToString(); diff --git a/FrmBSQDuoBianXingStreet.cs b/FrmBSQDuoBianXingStreet.cs index 2005ebb..1db5777 100644 --- a/FrmBSQDuoBianXingStreet.cs +++ b/FrmBSQDuoBianXingStreet.cs @@ -63,7 +63,7 @@ chartStatis.Series[0].Points.DataBindXY(bsq.Keys, bsq.Values); for (int m = 0; m < bsq.Values.Count; m++) { - if (chartStatis.Series[0].Points[m].YValues[0].ToString().Trim() != "0") + if (chartStatis.Series[0].Points[m]!=null&&chartStatis.Series[0].Points[m].YValues[0].ToString().Trim() != "0") { count += Convert.ToInt16(chartStatis.Series[0].Points[m].YValues[0].ToString()); chartStatis.Series[0].Points[m].Label = chartStatis.Series[0].Points[m].YValues[0].ToString(); diff --git a/FrmBSQStatis.cs b/FrmBSQStatis.cs index 390a55c..4aa0ee6 100644 --- a/FrmBSQStatis.cs +++ b/FrmBSQStatis.cs @@ -95,6 +95,8 @@ } } } + + dr.Close(); conn.Close(); for (int i = 0; i < typeLists.Count; i++) { @@ -123,7 +125,7 @@ chartStatis.Series[0].Points.DataBindXY(bsq.Keys, bsq.Values); for (int m = 0; m < bsq.Values.Count; m++) { - if (chartStatis.Series[0].Points[m].YValues[0].ToString().Trim() != "0") + if (chartStatis.Series[0].Points[m]!=null&&chartStatis.Series[0].Points[m].YValues[0].ToString().Trim() != "0") { //count += Convert.ToInt16(chartStatis.Series[0].Points[m].YValues[0].ToString()); chartStatis.Series[0].Points[m].Label = chartStatis.Series[0].Points[m].YValues[0].ToString(); diff --git a/FrmBSQStreet.cs b/FrmBSQStreet.cs index 9d88adb..7fbacad 100644 --- a/FrmBSQStreet.cs +++ b/FrmBSQStreet.cs @@ -44,7 +44,7 @@ chartStatis.Series[0].Points.DataBindXY(bsq.Keys, bsq.Values); for (int m = 0; m < bsq.Values.Count; m++) { - if (chartStatis.Series[0].Points[m].YValues[0].ToString().Trim() != "0") + if (chartStatis.Series[0].Points[m]!=null&&chartStatis.Series[0].Points[m].YValues[0].ToString().Trim() != "0") { count += Convert.ToInt16(chartStatis.Series[0].Points[m].YValues[0].ToString()); chartStatis.Series[0].Points[m].Label = chartStatis.Series[0].Points[m].YValues[0].ToString(); diff --git a/FrmBoosterValvers.cs b/FrmBoosterValvers.cs index 5061efc..df9b62b 100644 --- a/FrmBoosterValvers.cs +++ b/FrmBoosterValvers.cs @@ -236,199 +236,6 @@ count = 0; } } - /// - /// 添加火苗 - /// - /// - /// - /// - /// - private GSOFeature AddFire(double x,double y,double z) - { - // 烟火示例 - - string strResPath = Application.StartupPath + "/Resource"; - - // 烟火粒子示例,由三个发射器构成 - GSOGeoParticle geoParticle = new GSOGeoParticle(); - geoParticle.SetPosition(x, y, z); // 添加到这个经纬度位置 - geoParticle.AltitudeMode = EnumAltitudeMode.RelativeToGround; - - GSORingParticleEmitter emitter = new GSORingParticleEmitter(); - emitter.TexturePath = strResPath + "/ParticleImage/flare.png"; - - emitter.SetSizeFix(1, 1); - emitter.VelFix = 1; - emitter.VelRnd = 5; - - emitter.AngleXYFix = 0; - emitter.AngleXYRnd = 180; - - emitter.AngleXZFix = 90; - emitter.AngleXZRnd = 0; - - emitter.LifeFix = 0.5f; - emitter.LifeRnd = 0.0f; - - emitter.RotFix = 0; - emitter.RotRnd = 0; - - emitter.RotVelFix = 0; - emitter.RotVelRnd = 0; - - emitter.EmitPerSec = 100; - - // 采用线性插值生成粒子的初始颜色 - emitter.ColorRndStart = Color.White; - emitter.ColorRndEnd = Color.Red; - - - GSOColorParticleEffector effector2 = new GSOColorParticleEffector(); - effector2.SetColorChanged(0, -1, -1, 0); - effector2.StartTime = 0.0f; - effector2.EndTime = -1.0f; - emitter.AddEffector(effector2); - - // 将三个发射器添加到粒子对象中 - geoParticle.AddEmitter(emitter); - - geoParticle.Play(); - - GSOFeature feature = new GSOFeature(); - - feature.Geometry = geoParticle; - - globeControl1.Globe.MemoryLayer.AddFeature(feature); - - - return feature; - } - - /// - /// 添加喷泉 - /// - /// - private GSOFeature AddFountain() - { - string strResPath = Application.StartupPath + "/Resource"; - - GSOGeoParticle geoParticle = new GSOGeoParticle(); - geoParticle.SetPosition(116.314, 39.84, 0); // 添加到这个经纬度位置 - - GSOPointParticleEmitter emitter = new GSOPointParticleEmitter(); - emitter.TexturePath = strResPath + "/ParticleImage/test.png"; - - emitter.SetSizeFix(0.5f, 2); - emitter.VelFix = 10; - emitter.VelRnd = 2; - - emitter.GravityAcc = 9.8f; - emitter.AngleXYFix = 0; - emitter.AngleXYRnd = 180; - - emitter.AngleXZFix = 88; - emitter.AngleXZRnd = 2; - - //emitter.InnerRadius = 0; - // emitter.OuterRadius = 0.03f; - - emitter.LifeFix = 5.0f; - emitter.LifeRnd = 1.0f; - - emitter.RotFix = 0; - emitter.RotRnd = 0; - - emitter.RotVelFix = 0; - emitter.RotVelRnd = 0; - - emitter.EmitPerSec = 1000; - emitter.ColorRndStart = Color.FromArgb(33, 255, 255, 255); - emitter.ColorRndEnd = Color.FromArgb(11, 255, 255, 255); - emitter.IsLumAdded = false; - - // 将三个发射器添加到粒子对象中 - geoParticle.AddEmitter(emitter); - - geoParticle.Play(); - GSOFeature feature = new GSOFeature(); - - feature.Geometry = geoParticle; - - //globeControl1.Globe.MemoryLayer.AddFeature(feature); - globeControl1.Globe.FlyToFeature(feature); - - return feature; - } - - /// - /// 添加水柱 - /// - /// - private GSOFeature AddWaterLine() - { - string strResPath = Application.StartupPath + "/Resource"; - - GSOGeoParticle geoParticle = new GSOGeoParticle(); - geoParticle.SetPosition(116.308, 39.84, 0); // 添加到这个经纬度位置 - - GSOPointParticleEmitter emitter = new GSOPointParticleEmitter(); - - emitter.TexturePath = strResPath + "/ParticleImage/drop3.png"; - - geoParticle.TimerInterval = 1; - - emitter.SetSizeFix(2.0f, 2.0f); - - emitter.VelFix = 50; - emitter.VelRnd = 2; - - // emitter.IsLumAdded = false; - - emitter.GravityAcc = 9.8f; - emitter.AngleXYFix = 0; - emitter.AngleXYRnd = 2; - - emitter.AngleXZFix = 60; - emitter.AngleXZRnd = 2; - - //emitter.InnerRadius = 0; - // emitter.OuterRadius = 0.1f; - - emitter.LifeFix = 5.0f; - emitter.LifeRnd = 1.0f; - - emitter.RotFix = 0; - emitter.RotRnd = 0; - - emitter.RotVelFix = 0; - emitter.RotVelRnd = 0; - - emitter.EmitPerSec = 1500; - - emitter.ColorRndStart = Color.FromArgb(100, 222, 222, 222); - emitter.ColorRndEnd = Color.FromArgb(50, 222, 222, 222); - - /* - - GSOScaleParticleEffector effector1 = new GSOScaleParticleEffector(); - effector1.SetScale(0.2f, 0.2f); - effector1.StartTime = 0; - effector1.EndTime = -1; // 负数表示整个粒子生命结束 - emitter.AddEffector(effector1); - */ - - // 将三个发射器添加到粒子对象中 - geoParticle.AddEmitter(emitter); - - geoParticle.Play(); - GSOFeature feature = new GSOFeature(); - - feature.Geometry = geoParticle; - - //globeControl1.Globe.MemoryLayer.AddFeature(feature); - globeControl1.Globe.FlyToFeature(feature); - - return feature; - } + } } diff --git a/FrmBufferAnalysis.cs b/FrmBufferAnalysis.cs index f711133..db8ca59 100644 --- a/FrmBufferAnalysis.cs +++ b/FrmBufferAnalysis.cs @@ -123,39 +123,6 @@ } } /// - /// 半径文本框的键盘按键按下事件处理 - /// - /// - /// - private void txtRadius_KeyPress(object sender, KeyPressEventArgs e) - { - TextBox text = sender as TextBox; - if ((e.KeyChar < 48 || e.KeyChar > 57) && (e.KeyChar != 8) && (int)e.KeyChar != 46) - { - e.Handled = true; - } - if ((int)e.KeyChar == 46) //小数点 - { - if (text.Text.Length <= 0) - e.Handled = true; //小数点不能在第一位 - else //处理不规则的小数点 - { - float f; - float oldf; - bool b1 = false, b2 = false; - b1 = float.TryParse(text.Text, out oldf); - b2 = float.TryParse(text.Text + e.KeyChar.ToString(), out f); - if (b2 == false) - { - if (b1 == true) - e.Handled = true; - else - e.Handled = false; - } - } - } - } - /// /// 窗体关闭事件处理 /// /// diff --git a/FrmBufferAnalysisBSQ.cs b/FrmBufferAnalysisBSQ.cs index 24a96ca..f54208f 100644 --- a/FrmBufferAnalysisBSQ.cs +++ b/FrmBufferAnalysisBSQ.cs @@ -137,35 +137,7 @@ } } - private void txtRadius_KeyPress(object sender, KeyPressEventArgs e) - { - TextBox text = sender as TextBox; - if ((e.KeyChar < 48 || e.KeyChar > 57) && (e.KeyChar != 8) && (int)e.KeyChar != 46) - { - e.Handled = true; - } - if ((int)e.KeyChar == 46) //小数点 - { - if (text.Text.Length <= 0) - e.Handled = true; //小数点不能在第一位 - else //处理不规则的小数点 - { - float f; - float oldf; - bool b1 = false, b2 = false; - b1 = float.TryParse(text.Text, out oldf); - b2 = float.TryParse(text.Text + e.KeyChar.ToString(), out f); - if (b2 == false) - { - if (b1 == true) - e.Handled = true; - else - e.Handled = false; - } - } - } - } - + private void FrmBufferAnalysis_FormClosing(object sender, FormClosingEventArgs e) { //Form1.y = 0; @@ -316,27 +288,6 @@ } } - private void FlyToMenu_Click(object sender, EventArgs e) - { - if (m_feature != null) - { - if (m_feature.Geometry != null && m_feature.Geometry.Type == EnumGeometryType.GeoPolyline3D) - { - GSOGeoPolyline3D line = m_feature.Geometry as GSOGeoPolyline3D; - double length = line.GetSpaceLength(true, 6378137); - GSOGeoPolyline3D lineLine = line.GetSegment(0, length / 2); - GSOPoint3d point3d = lineLine[lineLine.PartCount - 1][lineLine[lineLine.PartCount - 1].Count - 1]; - - globeControl1.Globe.FlyToPosition(point3d, EnumAltitudeMode.Absolute, 0, 45, 5); - } - else - { - globeControl1.Globe.FlyToFeature(m_feature, 0, 45, 3); - } - LightMenu_Click(sender, e); - } - } - private void LightMenu_Click(object sender, EventArgs e) { flashflag = "single"; diff --git a/FrmDataBaseOpt.cs b/FrmDataBaseOpt.cs index b0c4b5d..8d7b69d 100644 --- a/FrmDataBaseOpt.cs +++ b/FrmDataBaseOpt.cs @@ -362,6 +362,7 @@ dbCombor.Items.Add(dblist[i].title); } } + /* /// /// 从配置文件读取数据库参数配置 /// @@ -428,6 +429,8 @@ } } + * */ + /* /// /// 向配置文件写入连接数据库的参数配置 /// @@ -485,6 +488,7 @@ MessageBox.Show(exp.ToString()); } } + * */ /// /// /// diff --git a/FrmDatabaseParaSetting.cs b/FrmDatabaseParaSetting.cs index a6fea46..63b596b 100644 --- a/FrmDatabaseParaSetting.cs +++ b/FrmDatabaseParaSetting.cs @@ -152,6 +152,7 @@ this.DialogResult = DialogResult.OK; this.Close(); } + /* /// /// 从配置文件读取数据库连接参数配置 /// @@ -218,6 +219,8 @@ } } + * */ + /* /// /// 向配置文件写入数据库参数配置 /// @@ -276,7 +279,7 @@ MessageBox.Show(ex.ToString()); } } - + */ /// /// 取消按钮事件处理 /// diff --git a/FrmDatabaseParaSetting2.cs b/FrmDatabaseParaSetting2.cs index 932d05e..96a87d5 100644 --- a/FrmDatabaseParaSetting2.cs +++ b/FrmDatabaseParaSetting2.cs @@ -148,6 +148,7 @@ this.DialogResult = DialogResult.OK; this.Close(); } + /* /// /// 从配置文件读取数据库连接参数配置 /// @@ -214,6 +215,8 @@ } } + * */ + /* /// /// 向配置文件写入数据库参数配置 /// @@ -272,7 +275,7 @@ MessageBox.Show(exp.ToString()); } } - + */ /// /// 取消按钮事件处理 /// diff --git a/FrmDiameterQuery.cs b/FrmDiameterQuery.cs index 68c948b..9a5215b 100644 --- a/FrmDiameterQuery.cs +++ b/FrmDiameterQuery.cs @@ -77,18 +77,7 @@ isBetween = true; } } - /// - /// 键盘按键按下事件处理 - /// - /// - /// - private void textBoxX1_KeyPress(object sender, KeyPressEventArgs e) - { - if ((e.KeyChar < 48 || e.KeyChar > 57) && e.KeyChar != 8) - { - e.Handled = true;//屏蔽 - } - } + bool isBetween = false; /// diff --git a/FrmDocumentEdit.cs b/FrmDocumentEdit.cs index aab2d31..e78a7ff 100644 --- a/FrmDocumentEdit.cs +++ b/FrmDocumentEdit.cs @@ -256,121 +256,6 @@ } - // - /// 将本地文件上传到指定的服务器(HttpWebRequest方法) - /// - /// 文件上传到的服务器 - /// 要上传的本地文件(全路径) - /// 文件上传后的名称 - /// 上传进度条 - /// 成功返回1,失败返回0 - private int Upload_Request(string address, string fileNamePath, string saveName, ProgressBar progressBar) - { - int returnValue = 0; - // 要上传的文件 - FileStream fs = new FileStream(fileNamePath, FileMode.Open, FileAccess.Read); - BinaryReader r = new BinaryReader(fs); - //时间戳 - string strBoundary = "----------" + DateTime.Now.Ticks.ToString("x"); - byte[] boundaryBytes = Encoding.ASCII.GetBytes("/r/n--" + strBoundary + "/r/n"); - //请求头部信息 - StringBuilder sb = new StringBuilder(); - sb.Append("--"); - sb.Append(strBoundary); - sb.Append("\r\n"); - sb.Append("Content-Disposition: form-data; name=\""); - sb.Append("file"); - sb.Append("\"; filename=\""); - sb.Append(saveName); - sb.Append("\""); - sb.Append("\r\n"); - sb.Append("Content-Type: "); - sb.Append("application/octet-stream"); - sb.Append("\r\n"); - sb.Append("\r\n"); - string strPostHeader = sb.ToString(); - byte[] postHeaderBytes = Encoding.UTF8.GetBytes(strPostHeader); - // 根据uri创建HttpWebRequest对象 - HttpWebRequest httpReq = (HttpWebRequest)WebRequest.Create(new Uri(address)); - httpReq.Method = "POST"; - //对发送的数据不使用缓存 - httpReq.AllowWriteStreamBuffering = false; - //设置获得响应的超时时间(300秒) - httpReq.Timeout = 300000; - httpReq.ContentType = "multipart/form-data; boundary=" + strBoundary; - long length = fs.Length + postHeaderBytes.Length + boundaryBytes.Length; - long fileLength = fs.Length; - httpReq.ContentLength = length; - try - { - progressBar.Maximum = int.MaxValue; - progressBar.Minimum = 0; - progressBar.Value = 0; - //每次上传4k - int bufferLength = 4096; - byte[] buffer = new byte[bufferLength]; - //已上传的字节数 - long offset = 0; - //开始上传时间 - DateTime startTime = DateTime.Now; - int size = r.Read(buffer, 0, bufferLength); - Stream postStream = httpReq.GetRequestStream(); - //发送请求头部消息 - postStream.Write(postHeaderBytes, 0, postHeaderBytes.Length); - while (size > 0) - { - postStream.Write(buffer, 0, size); - offset += size; - progressBar.Value = (int)(offset * (int.MaxValue / length)); - TimeSpan span = DateTime.Now - startTime; - double second = span.TotalSeconds; - //lblTime.Text = "已用时:" + second.ToString("F2") + "秒"; - //if (second > 0.001) - //{ - // lblSpeed.Text = " 平均速度:" + (offset / 1024 / second).ToString("0.00") + "KB/秒"; - //} - //else - //{ - // lblSpeed.Text = " 正在连接…"; - //} - //lblState.Text = "已上传:" + (offset * 100.0 / length).ToString("F2") + "%"; - //lblSize.Text = (offset / 1048576.0).ToString("F2") + "M/" + (fileLength / 1048576.0).ToString("F2") + "M"; - Application.DoEvents(); - size = r.Read(buffer, 0, bufferLength); - } - //添加尾部的时间戳 - postStream.Write(boundaryBytes, 0, boundaryBytes.Length); - postStream.Close(); - //获取服务器端的响应 - WebResponse webRespon = httpReq.GetResponse(); - Stream s = webRespon.GetResponseStream(); - StreamReader sr = new StreamReader(s); - //读取服务器端返回的消息 - String sReturnString = sr.ReadLine(); - s.Close(); - sr.Close(); - if (sReturnString == "Success") - { - returnValue = 1; - } - else if (sReturnString == "Error") - { - returnValue = 0; - } - } - catch(Exception ex) - { - returnValue = 0; - string str = ex.ToString(); - } - finally - { - fs.Close(); - r.Close(); - } - return returnValue; - } - private void btn_file_Click(object sender, EventArgs e) { OpenFileDialog dlg = new OpenFileDialog(); diff --git a/FrmExportCADS.cs b/FrmExportCADS.cs index 98772ea..59629dd 100644 --- a/FrmExportCADS.cs +++ b/FrmExportCADS.cs @@ -108,65 +108,6 @@ MessageBox.Show("请选中要导出的图层!", "提示", MessageBoxButtons.OK, MessageBoxIcon.Warning); } } - private Boolean MerageToFile(GSOFeatures features, String strDestFile, String strProj4)//图层追加 - { - if (features == null) - { - return false; - } - Boolean bSuccess = false; - - string strDir = GSOUtility.GetFileDir(strDestFile); - string strLPRJFile = GSOUtility.ChangeExt(strDestFile, ".lprj"); - string strExt = GSOUtility.GetFileExt(strDestFile); - - // 如果投影文件存在,投影以投影文件为准 - if (File.Exists(strLPRJFile)) - { - // 如果是dxf,则这样处理 - if (strExt.ToLower() == ".dxf") - { - string strTempSrcFile = strDir + "srcFeatures_dxftmp" + strExt; - globeControl1.Globe.DataManager.SaveFeatureData(features, strTempSrcFile, strLPRJFile, 4); - bSuccess = GSOUtility.MergeTwoDXFFileFeatures(strDestFile, strTempSrcFile); - File.Delete(strTempSrcFile); - } - else - { - GSOFeatures srcFeatures = globeControl1.Globe.DataManager.ReadFeatureData(strDestFile); - int nCount = features.Length; - int i = 0; - for (i = 0; i < nCount; i++) - { - srcFeatures.Add(features[i]); - } - bSuccess = globeControl1.Globe.DataManager.SaveFeatureData(srcFeatures, strDestFile, strLPRJFile, 4); - } - } - else - { - // 如果是dxf,则这样处理 - if (strExt.ToLower() == ".dxf") - { - string strTempSrcFile = strDir + "srcFeatures_dxftmp" + strExt; - globeControl1.Globe.DataManager.SaveFeatureData(features, strTempSrcFile, strProj4, 0); - bSuccess = GSOUtility.MergeTwoDXFFileFeatures(strDestFile, strTempSrcFile); - File.Delete(strTempSrcFile); - } - else - { - GSOFeatures srcFeatures = globeControl1.Globe.DataManager.ReadFeatureData(strDestFile); - int nCount = features.Length; - int i = 0; - for (i = 0; i < nCount; i++) - { - srcFeatures.Add(features[i]); - } - bSuccess = globeControl1.Globe.DataManager.SaveFeatureData(srcFeatures, strDestFile, strProj4, 0); - } - } - return bSuccess; - } /// /// 关闭按钮事件处理 /// diff --git a/FrmHDMAnalysis3.cs b/FrmHDMAnalysis3.cs index 4f73af6..2ada735 100644 --- a/FrmHDMAnalysis3.cs +++ b/FrmHDMAnalysis3.cs @@ -436,29 +436,6 @@ } layerTemp.RemoveAllFeature(); } - private void Export(GSOPoint3d _pnt, double r) - { - GSOPoint3ds pnts = new GSOPoint3ds(); - GSOPoint3d pnt = new GSOPoint3d(); - pnt.X = _pnt.X; - pnt.Y = _pnt.Y; - pnt.Z = _pnt.Z; - pnts.Add(pnt); - pnt.X = _pnt.X; - pnt.Y = _pnt.Y - 0.0000000005; - pnt.Z = _pnt.Z; - pnts.Add(pnt); - GSOGeoPolyline3D line = new GSOGeoPolyline3D(); - line.AddPart(pnts); - GSOGeoPolygon3D polygon = line.CreateBuffer(r * 2, true, 5, true, false); - GSOPoint3ds points = polygon[0]; - GSOGeoPolyline3D newLine = new GSOGeoPolyline3D(); - newLine.AddPart(points); - newLine.AltitudeMode = EnumAltitudeMode.RelativeToGround; - GSOFeature newFeature = new GSOFeature(); - newFeature.Geometry = newLine; - globeControl1.Globe.MemoryLayer.AddFeature(newFeature); - } private void ExportCAD(double a, double b, double r) { diff --git a/FrmHotFuncStat.cs b/FrmHotFuncStat.cs index c980f34..2eb1476 100644 --- a/FrmHotFuncStat.cs +++ b/FrmHotFuncStat.cs @@ -421,13 +421,6 @@ } } - private void HFS_Pderive_Click(object sender, EventArgs e) - { - if (TV_Files.SelectedNode != null) - { - HFSClass.GuideEdit_form("G", TV_Files, int.Parse(((ToolStripMenuItem)sender).Tag.ToString())); - } - } private void 导入ToolStripMenuItem_Click(object sender, EventArgs e) { @@ -530,22 +523,8 @@ } } - private void 导出ToolStripMenuItem1_Click(object sender, EventArgs e) - { - 导出ToolStripMenuItem2_Click(sender, e); - } + - private void TV_HFSSrchRslt_AfterCollapse(object sender, TreeViewEventArgs e) - { - e.Node.ImageIndex = 0; - } - - private void TV_HFSSrchRslt_AfterExpand(object sender, TreeViewEventArgs e) - { - HFSClass.ADD_TreeNode(TV_Files, e.Node); - e.Node.ImageIndex = 1; - } - private void 导出ToolStripMenuItem1_Click_1(object sender, EventArgs e) { if ((TV_HFSSrchRslt.SelectedNode != null) && (TV_HFSSrchRslt.SelectedNode.Parent != null)) diff --git a/FrmLayerControl.cs b/FrmLayerControl.cs index e7917c3..28fa14d 100644 --- a/FrmLayerControl.cs +++ b/FrmLayerControl.cs @@ -312,26 +312,7 @@ layerManagerNode.Expand(); terrainManagerNode.Expand(); } - /// - /// 刷新节点树 - /// - private void RefreshDataTree() - { - layerTree2.Nodes[0].Nodes.Clear(); - Int32 nCount = globeControl2.Globe.Layers.Count; - Int32 i = 0; - for (i = 0; i < nCount; i++) - { - GSODataset dataSpace = globeControl2.Globe.Layers[i].Dataset; - TreeNode node = new TreeNode(); - node.Text = dataSpace.Name; - node.ImageIndex = 0; - node.SelectedImageIndex = 0; - node.Checked = true; - node.Tag = dataSpace; - layerTree2.Nodes[0].Nodes.Add(node); - } - } + /// /// 目标图层按钮事件处理 /// @@ -494,22 +475,8 @@ } } } - /// - /// 改变指定节点的选中状态 - /// - /// - /// - private void CheckTreeNode(TreeNode node, Boolean bChecked) - { - CheckChildTreeNode(node, bChecked); - // 对于kml图层,如果当前处理的节点是true,那么要把所有的祖宗节点置为true - // 只有所有节点都未false,那么这个节点才为false - // CheckFatherTreeNode(node, bChecked); - globeControl1.Globe.Refresh(); - globeControl2.Globe.Refresh(); - - } + private void CheckChildTreeNode(TreeNode node, Boolean bChecked) { if (node == null) @@ -696,59 +663,7 @@ //} //CheckControl(e); } - /// - /// 树节点选中方法 - /// - /// - private void CheckControl(TreeViewEventArgs e) - { - if (e.Action != TreeViewAction.Unknown) - { - if (e.Node != null && !Convert.IsDBNull(e.Node)) - { - CheckParentNode(e.Node); - if (e.Node.Nodes.Count > 0) - { - CheckAllChildNodes(e.Node, e.Node.Checked); - } - } - } - } - /// - /// 改变所有子节点的状态 - /// - /// - /// - private void CheckAllChildNodes(TreeNode pn, bool IsChecked) - { - foreach (TreeNode tn in pn.Nodes) - { - tn.Checked = IsChecked; - if (tn.Tag.ToString().Contains("|")) - { - string nodeTag = tn.Tag.ToString().Split('|')[1]; - GSOLayer layer = globeControl1.Globe.Layers.GetLayerByCaption(nodeTag); - if (layer != null) - { - layer.Visible = IsChecked; - globeControl1.Globe.Refresh(); - } - } - if (tn.Tag is GSOFeature) - { - if (tn.Nodes.Count == 0) - { - GSOFeature feat = tn.Tag as GSOFeature; - feat.Visible = IsChecked; - globeControl1.Globe.Refresh(); - } - } - if (tn.Nodes.Count > 0) - { - CheckAllChildNodes(tn, IsChecked); - } - } - } + /// /// 改变父节点的选中状态,此处为所有子节点不选中时才取消父节点选中,可以根据需要修改 /// diff --git a/FrmLogin.cs b/FrmLogin.cs index 320fdd5..2afe46e 100644 --- a/FrmLogin.cs +++ b/FrmLogin.cs @@ -59,70 +59,6 @@ textBoxPassWord.Clear(); } } - - /// - /// 验证端口号 - /// - /// - private bool ValiPort() - { - Ping p = new Ping();//创建Ping对象p - PingReply pr = p.Send(Utility.localicenseserverip);//向指定IP或者主机名的计算机发送ICMP协议的ping数据包 - if (pr.Status == IPStatus.Success)//如果ping成功 - { - try - { - TcpClient tcpc = new TcpClient(Utility.localicenseserverip, Utility.localicenseserverport);//对IP地址为"192.168.0.105"的计算机的1500端口提出连接申请 - tcpc.Close(); - return true; - } - catch (Exception ex) - { - MessageBox.Show("端口连接错误!" + ex.Message); - return false; - } - } - else - { - int times = 0;//重新连接次数; - int count = 2;//设置尝试次数 - while (times < count) - { - //Thread.Sleep(1000);//等待时间(方便测试的话,你可以改为1000) - pr = p.Send(Utility.localicenseserverip); - - if (pr.Status == IPStatus.Success) - { - try - { - TcpClient tcpc = new TcpClient(Utility.localicenseserverip, Utility.localicenseserverport);//对IP地址为"192.168.0.105"的计算机的1500端口提出连接申请 - tcpc.Close(); - return true; - } - catch (Exception ex) - { - MessageBox.Show("端口连接错误!" + ex.Message); - return false; - } - } - else - { - times++; - if (times < count) - { - continue; - } - else - { - MessageBox.Show("重新尝试连接失败"); - return false; - } - } - - } - return false; - } - } /// /// 验证用户名、密码 /// diff --git a/FrmMetadata.cs b/FrmMetadata.cs index 886f65a..0365372 100644 --- a/FrmMetadata.cs +++ b/FrmMetadata.cs @@ -27,11 +27,7 @@ InitializeComponent(); loadTreeView(layerTree); } - private void FrmMetadata_Load(object sender, EventArgs e) - { - //this.ntLblC.Text = "nn"; - // loadTreeView(layerTree); - } + private void loadTreeView(TreeView tv)//构建图层树 { try diff --git a/FrmMetadataStat.cs b/FrmMetadataStat.cs index 790658a..e7696c6 100644 --- a/FrmMetadataStat.cs +++ b/FrmMetadataStat.cs @@ -197,9 +197,5 @@ } } - private void buttonX1_Click(object sender, EventArgs e) - { - drawChart(); - } } } diff --git a/FrmPatrolerManager.cs b/FrmPatrolerManager.cs index 37f8ffd..9e66aeb 100644 --- a/FrmPatrolerManager.cs +++ b/FrmPatrolerManager.cs @@ -109,82 +109,8 @@ this.winGridViewPager1.AllToExport = table; } - /// - /// 编辑 - /// - /// - /// - private void winGridViewPager1_OnEditSelected(object sender, EventArgs e) - { - - DataGridView grid = sender as DataGridView; - if (grid != null && grid.SelectedRows.Count>0) - { - DataGridViewRow row = grid.SelectedRows[0]; - try - { - long dbid = long.Parse(row.Cells["编号"].Value.ToString()); - String name = row.Cells["姓名"].Value.ToString(); - String sex = row.Cells["性别"].Value.ToString(); - String age = row.Cells["年龄"].Value.ToString(); - string phone = row.Cells["电话"].Value.ToString(); - age = String.IsNullOrEmpty(age.ToString().Trim()) ? "1" : age.ToString().Trim(); - FrmPatrolerEdit frm = new FrmPatrolerEdit(dbid.ToString(), name, age, sex, phone); - frm.reloadGrid += new ReloadPatrolerGrid(LoadData); - frm.ShowDialog(); - winGridViewPager1.Refresh(); - } - catch (Exception ex) - { - MessageBox.Show("编辑失败:" + ex.ToString(), "错误", MessageBoxButtons.OK, MessageBoxIcon.Error); - } - } - else - { - MessageBox.Show("没有选择记录", "提示"); - } - - } - - /// - /// 删除 - /// - /// - /// - private void winGridViewPager1_OnDeleteSelected(object sender, EventArgs e) - { - DataGridView grid = sender as DataGridView; - if (grid != null && grid.SelectedRows.Count > 0) - { - DataGridViewRow row = grid.SelectedRows[0]; - long dbid = long.Parse(row.Cells["编号"].Value.ToString()); - try - { - string state = row.Cells["状态"].Value.ToString(); - if ("在线".Equals(state)) - { - if (MessageBox.Show("确定注销?", "确认", MessageBoxButtons.YesNo, MessageBoxIcon.Question) == DialogResult.Yes) - { - String sql = "update patroler t set t.accountstate='LEAVER' where t.dbid=" + dbid; - OracleUtils.ExecuteNonQuery(OracleUtils.ConnectionString, CommandType.Text, sql); - } - } - else { - MessageBox.Show("人员不在线,无法注销", "信息"); - } - } - catch (Exception ex) - { - MessageBox.Show("人员注销失败:" + ex.ToString(), "错误", MessageBoxButtons.OK, MessageBoxIcon.Error); - } - } - else - { - MessageBox.Show("没有选择记录", "提示"); - } - } - - + + private void LoadData() { int pageIndex = winGridViewPager1.PagerInfo.CurrenetPageIndex; diff --git a/FrmRoadHDM.cs b/FrmRoadHDM.cs index e765313..e871dd5 100644 --- a/FrmRoadHDM.cs +++ b/FrmRoadHDM.cs @@ -333,31 +333,6 @@ this.Cursor = Cursors.Default; } } - - private void Export(GSOPoint3d _pnt, double r) - { - GSOPoint3ds pnts = new GSOPoint3ds(); - GSOPoint3d pnt = new GSOPoint3d(); - pnt.X = _pnt.X; - pnt.Y = _pnt.Y; - pnt.Z = _pnt.Z; - pnts.Add(pnt); - pnt.X = _pnt.X; - pnt.Y = _pnt.Y - 0.0000000005; - pnt.Z = _pnt.Z; - pnts.Add(pnt); - GSOGeoPolyline3D line = new GSOGeoPolyline3D(); - line.AddPart(pnts); - GSOGeoPolygon3D polygon = line.CreateBuffer(r * 2, true, 5, true, false); - GSOPoint3ds points = polygon[0]; - GSOGeoPolyline3D newLine = new GSOGeoPolyline3D(); - newLine.AddPart(points); - newLine.AltitudeMode = EnumAltitudeMode.RelativeToGround; - GSOFeature newFeature = new GSOFeature(); - newFeature.Geometry = newLine; - globeControl1.Globe.MemoryLayer.AddFeature(newFeature); - } - private void ExportCAD(double a, double b, double r) { GSOPoint3ds pnts = new GSOPoint3ds(); diff --git a/FrmUserAdd.cs b/FrmUserAdd.cs index c612ab4..f826427 100644 --- a/FrmUserAdd.cs +++ b/FrmUserAdd.cs @@ -231,24 +231,6 @@ //cbxRegion.SelectedIndexChanged += new EventHandler(cbxRegion_SelectedIndexChanged); } } - /// - /// 下拉框选中项改变事件处理 - /// - /// - /// - private void cbxRegion_SelectedIndexChanged(object sender, EventArgs e) - { - string sql = ""; - //string sql = "select casic_role.\"name\" from casic_role join casic_regionrole on casic_role.\"id\"=casic_regionrole.\"rid\" where casic_regionrole.\"reid\"=" + region[cbxRegion.SelectedItem.ToString().Trim()]; - DataTable dt = OledbHelper.QueryTable(sql); - if (dt != null && dt.Rows.Count > 0) - { - comboBoxExRegionRole.Items.Clear(); - for (int i = 0; i < dt.Rows.Count; i++) - { - comboBoxExRegionRole.Items.Add(dt.Rows[i][0].ToString().Trim());//部门角色 - } - } - } + } } diff --git a/FrmUserManager.cs b/FrmUserManager.cs index 571f0f0..ae254bc 100644 --- a/FrmUserManager.cs +++ b/FrmUserManager.cs @@ -81,11 +81,6 @@ } } } - //创建新用户 - private void buttonX2_Click(object sender, EventArgs e) - { - FrmUserAdd frm = new FrmUserAdd(-1); - frm.ShowDialog(); - } + } } diff --git a/FrmValveStatistics.cs b/FrmValveStatistics.cs index 545d56c..dd76777 100644 --- a/FrmValveStatistics.cs +++ b/FrmValveStatistics.cs @@ -54,7 +54,7 @@ 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") + if (chaFamenStatis.Series["阀门"].Points[m]!=null&&chaFamenStatis.Series["阀门"].Points[m].YValues[0].ToString() != "0") { chaFamenStatis.Series["阀门"].Points[m].Label = chaFamenStatis.Series[0].Points[m].YValues[0].ToString(); } diff --git a/Frm_password_reset.cs b/Frm_password_reset.cs index 7b51039..b9e5dc3 100644 --- a/Frm_password_reset.cs +++ b/Frm_password_reset.cs @@ -41,6 +41,7 @@ } catch (Exception ex) { + LogHelper.WriteLog(typeof(Frm_password_reset), ex.Message); } } private void initCombox() diff --git a/FrmpipeDeepstatis.cs b/FrmpipeDeepstatis.cs index e156db4..1a84d6c 100644 --- a/FrmpipeDeepstatis.cs +++ b/FrmpipeDeepstatis.cs @@ -307,7 +307,7 @@ chart1.Series[j].Points.DataBindXY(dic1.Keys, dic1.Values); for (int m = 0; m < dic1.Values.Count; m++) { - if (chart1.Series[j].Points[m].YValues[0].ToString() != "0") + if (chart1.Series[j].Points[m]!=null&&chart1.Series[j].Points[m].YValues[0].ToString() != "0") { chart1.Series[j].Points[m].Label = chart1.Series[j].Points[m].YValues[0].ToString(); diff --git a/FrmpipeDiametergather.cs b/FrmpipeDiametergather.cs index 30674de..057b09d 100644 --- a/FrmpipeDiametergather.cs +++ b/FrmpipeDiametergather.cs @@ -263,6 +263,7 @@ if (layer != null && layer is GSOFeatureLayer) { GSOFeatureLayer flayer = layer as GSOFeatureLayer; + if (layer == null) return; GSOFeatures features = flayer.GetAllFeatures(); if (features.Length > 0) { diff --git a/FrmpipeMaterialGather.cs b/FrmpipeMaterialGather.cs index c133ec3..398b884 100644 --- a/FrmpipeMaterialGather.cs +++ b/FrmpipeMaterialGather.cs @@ -280,6 +280,7 @@ if (layer != null && layer is GSOFeatureLayer) { GSOFeatureLayer flayer = layer as GSOFeatureLayer; + if (flayer == null) return; GSOFeatures features = flayer.GetAllFeatures(); if (features.Length > 0) { @@ -332,7 +333,7 @@ chart1.Series[j].Points.DataBindXY(dic1.Keys, dic1.Values); for (int m = 0; m < dic1.Values.Count; m++) { - if (chart1.Series[j].Points[m].YValues[0].ToString() != "0") + if (chart1.Series[j].Points[m]!=null&&chart1.Series[j].Points[m].YValues[0].ToString() != "0") { chart1.Series[j].Points[m].Label = chart1.Series[j].Points[m].YValues[0].ToString(); } diff --git a/Frmpipediameterstatis.cs b/Frmpipediameterstatis.cs index c0ed80a..50f8170 100644 --- a/Frmpipediameterstatis.cs +++ b/Frmpipediameterstatis.cs @@ -286,6 +286,7 @@ chart1.Series.Add(layerCaption); GSOFeatureLayer flayer = layer as GSOFeatureLayer; + if (layer == null) return; GSOFeatures features = flayer.GetAllFeatures(); if (features.Length > 0) { diff --git "a/GKT_Forms/F_GKT\346\225\260\346\215\256\350\276\223\345\205\245\350\276\223\345\207\272.cs" "b/GKT_Forms/F_GKT\346\225\260\346\215\256\350\276\223\345\205\245\350\276\223\345\207\272.cs" index c7bffd5..4db7d5d 100644 --- "a/GKT_Forms/F_GKT\346\225\260\346\215\256\350\276\223\345\205\245\350\276\223\345\207\272.cs" +++ "b/GKT_Forms/F_GKT\346\225\260\346\215\256\350\276\223\345\205\245\350\276\223\345\207\272.cs" @@ -198,12 +198,7 @@ } DialogResult = DialogResult.OK;//将当前窗体的对话框返回值设为OK } - private void treeView1_NodeMouseClick(object sender, TreeNodeMouseClickEventArgs e) - { - dir_Ok = comboBox_Disk.Text + e.Node.FullPath; - //dir = comboBox_Disk.Text + e.Node.FullPath; - e.Node.SelectedImageIndex = e.Node.ImageIndex; - } + string tempstr = ""; private void button1_Click(object sender, EventArgs e) { diff --git a/HFS_Forms/Frm_HFSprojedits.cs b/HFS_Forms/Frm_HFSprojedits.cs index 96dd76f..3c232a1 100644 --- a/HFS_Forms/Frm_HFSprojedits.cs +++ b/HFS_Forms/Frm_HFSprojedits.cs @@ -126,16 +126,6 @@ Close(); } - - - private void TB_ProjName_KeyPress(object sender, KeyPressEventArgs e) - { - if (HFSAClass.Files_NameChar(e) == 0) - e.Handled = true; - if (e.KeyChar == '\r') - OK_Click(sender, e); - } - private void Frm_HFSProjedit_Load(object sender, EventArgs e) { @@ -175,10 +165,6 @@ } } - private void Cancel_Click(object sender, EventArgs e) - { - this.Close(); - } private void Cancel_Click_1(object sender, EventArgs e) { diff --git a/MainFrm.cs b/MainFrm.cs index 2c305a0..ed2685b 100644 --- a/MainFrm.cs +++ b/MainFrm.cs @@ -617,7 +617,7 @@ } catch (Exception ex) { - + LogHelper.WriteLog(typeof(MainFrm), ex.Message); } } @@ -1768,7 +1768,7 @@ } catch (Exception ex) { - //LogError.PublishError(ex); + LogHelper.WriteLog(typeof(MainFrm), ex.Message); } } @@ -2026,6 +2026,7 @@ } catch (Exception ex) { + LogHelper.WriteLog(typeof(MainFrm), ex.Message); result = false; } finally @@ -2316,220 +2317,6 @@ string filename = Utility.filename; List g1layername = new List(); /// - /// 构建图层列表目录树 - /// - /// - private void loadTreeView(TreeView tv) - { - try - { - XmlDocument doc = new XmlDocument(); - doc.Load(filename); - XmlNodeList Params1 = doc.SelectNodes("/Params/layers"); - tv.ShowLines = false; - tv.CheckBoxes = true; - - foreach (XmlNode paramsNode in Params1) //layers - { - foreach (XmlNode layerNode in paramsNode) //layer - { - TreeNode nodelayer = new TreeNode(); - string layerName = layerNode.Attributes["label"].Value; - nodelayer.Text = layerName; - - if (layerNode.HasChildNodes != false) - { - tv.Nodes.Add(nodelayer); - foreach (XmlNode layerchildNode in layerNode) //layerchild - { - if (layerchildNode.Name == "layerchild") - { - TreeNode nodelayerchild = new TreeNode(); - string layerType = layerchildNode.Attributes["type"].Value; - string layerName1 = layerchildNode.Attributes["layer"].Value; - string layerchildName = layerchildNode.Attributes["label"].Value; - if (layerType == "locaserver") - { - if (layerchildNode.Attributes["isRoad"] != null) - { - roadLayerName = layerchildName; - } - dictionaryNetLayerNameAndCaption.Add(layerName1, layerchildName); - - nodelayerchild.Text = layerchildName; - nodelayerchild.Tag = layerType + "|" + layerchildName; - nodelayerchild.Checked = true; - nodelayer.Nodes.Add(nodelayerchild); - } - else - { - if (layerchildNode.Attributes["isPipeLine"] != null) - { - m_PipelineLayerNames.Add(layerchildName); - } - if (layerchildNode.Attributes["isWorkWell"] != null) - { - workwellLayerNames.Add(layerchildName); - } - if (layerchildNode.Attributes["isValve"] != null) - { - valueLayerNames.Add(layerchildName); - } - //if (layerchildNode.Attributes["isInstrument"] != null) - if (layerchildNode.Attributes["isAccess"] != null) - { - instrumenLayerNames.Add(layerchildName); - } - //if (layerchildNode.Attributes["isPipeFitting"] != null) - if (layerchildNode.Attributes["isCharacter"] != null) - { - pipefittingLayerNames.Add(layerchildName); - } - bool boollayer = AddLayers(layerName1, layerchildName); - nodelayerchild.Text = layerchildName; - nodelayerchild.Tag = layerType + "|" + layerchildName; - nodelayerchild.Checked = boollayer; - if (layerchildName.Contains("特征管点")) - { - nodelayerchild.Checked = false; - setLayerVisible(layerName1); - } - - nodelayer.Nodes.Add(nodelayerchild); - g1layername.Add(layerName1); - } - } - else if (layerchildNode.Name == "layertype") - { - TreeNode nodelayerchild = new TreeNode(); - string layerType = layerchildNode.Attributes["label"].Value; - nodelayerchild.Text = layerType; - nodelayerchild.Tag = layerType; - nodelayerchild.Checked = true; - nodelayer.Nodes.Add(nodelayerchild); - if (layerchildNode.HasChildNodes == true) - { - foreach (XmlNode childNodeLayer in layerchildNode) - { - if (childNodeLayer.HasChildNodes == true) - { - TreeNode nodelayerchild2 = new TreeNode(); - string layer = childNodeLayer.Attributes["label"].Value; - nodelayerchild2.Text = layer; - nodelayerchild2.Tag = layer; - nodelayerchild2.Checked = true; - nodelayerchild.Nodes.Add(nodelayerchild2); - foreach (XmlNode n in childNodeLayer) - { - TreeNode nodelayerchild1 = new TreeNode(); - string layerName1 = n.Attributes["layer"].Value; - string layerchildName = n.Attributes["label"].Value; - string layerType1 = n.Attributes["type"].Value; - if (n.Attributes["isPipeLine"] != null) - { - m_PipelineLayerNames.Add(layerchildName); - } - if (n.Attributes["isWorkWell"] != null) - { - workwellLayerNames.Add(layerchildName); - } - if (n.Attributes["isValve"] != null) - { - valueLayerNames.Add(layerchildName); - } - if (n.Attributes["isAccess"] != null) - //if (n.Attributes["isInstrument"] != null) - { - instrumenLayerNames.Add(layerchildName); - } - if (n.Attributes["isPipeFitting"] != null) - { - pipefittingLayerNames.Add(layerchildName); - } - bool boollayer = AddLayers(layerName1, layerchildName); - nodelayerchild1.Text = layerchildName; - nodelayerchild1.Tag = layerType1 + "|" + layerchildName; - nodelayerchild1.Checked = boollayer; - if (layerchildName.Contains("特征管点")) - { - nodelayerchild1.Checked = false; - setLayerVisible(layerName1); - } - - nodelayerchild2.Nodes.Add(nodelayerchild1); - - g1layername.Add(layerName1); - } - } - else - { - TreeNode nodelayerchild1 = new TreeNode(); - string layerName1 = childNodeLayer.Attributes["layer"].Value; - string layerchildName = childNodeLayer.Attributes["label"].Value; - string layerType1 = childNodeLayer.Attributes["type"].Value; - if (childNodeLayer.Attributes["isPipeLine"] != null) - { - m_PipelineLayerNames.Add(layerchildName); - } - if (childNodeLayer.Attributes["isWorkWell"] != null) - { - workwellLayerNames.Add(layerchildName); - } - if (childNodeLayer.Attributes["isValve"] != null) - { - valueLayerNames.Add(layerchildName); - } - if (childNodeLayer.Attributes["isAccess"] != null) - //if (childNodeLayer.Attributes["isInstrument"] != null) - { - instrumenLayerNames.Add(layerchildName); - } - if (childNodeLayer.Attributes["isPipeFitting"] != null) - { - pipefittingLayerNames.Add(layerchildName); - } - bool boollayer = AddLayers(layerName1, layerchildName); - nodelayerchild1.Text = layerchildName; - nodelayerchild1.Tag = layerType1 + "|" + layerchildName; - nodelayerchild1.Checked = boollayer; - if (layerchildName.Contains("特征管点")) - { - nodelayerchild1.Checked = false; - setLayerVisible(layerName1); - } - nodelayerchild.Nodes.Add(nodelayerchild1); - g1layername.Add(layerName1); - } - } - } - } - } - } - else - { - tv.Nodes.Add(nodelayer); - } - } - } - - foreach (TreeNode tn in tv.Nodes) - { - if (tn.Nodes.Count > 0) - { - foreach (TreeNode tnChild in tn.Nodes) - { - if (tnChild.Checked) - tn.Checked = true; - } - } - } - } - catch (Exception ex) - { - //LogError.PublishError(ex); - } - } - /// /// 获取目标图层 /// /// @@ -2629,21 +2416,11 @@ } catch (Exception ex) { - //LogError.PublishError(ex); + LogHelper.WriteLog(typeof(MainFrm), ex.Message); return false; } } /// - /// 菜单上的 三维导航 工具按钮 - /// - /// - /// - private void buttonItem86_Click(object sender, EventArgs e) - { - globeControl1.Globe.Action = EnumAction3D.ActionNull; - } - - /// /// 地上模式 菜单按钮 /// /// @@ -3026,67 +2803,11 @@ } Image printImage; - /// - /// 打印 菜单 - /// - /// - /// - private void buttonItem13_Click(object sender, EventArgs e) - { - Point pt1 = new Point(Convert.ToInt32(0), Convert.ToInt32(0)); - Point pt2 = new Point(Convert.ToInt32(panelEx5.Width), Convert.ToInt32(panelEx5.Height)); - int mapWidth = 0; - int mapHeight = 0; - Point pt = getUpperLeftPoint(pt1, pt2, out mapWidth, out mapHeight); - printImage = new Bitmap(Convert.ToInt32(panelEx5.Width), Convert.ToInt32(panelEx5.Height)); - Graphics g = Graphics.FromImage(printImage); - g.CopyFromScreen(pt, new Point(0, 0), new Size(Convert.ToInt32(panelEx5.Width), Convert.ToInt32(panelEx5.Height))); - - PrintDialog pd = new PrintDialog(); - try - { - if (pd.ShowDialog() == DialogResult.OK) //如果确认,将会覆盖所有的打印参数设置 - { - //打印预览 - PrintPreviewDialog ppd = new PrintPreviewDialog(); - ppd.Document = printDocument1; - if (DialogResult.OK == ppd.ShowDialog()) - { - printDocument1.Print(); //打印 - } - } - } - catch - { - printDocument1.PrintController.OnEndPrint(printDocument1, new System.Drawing.Printing.PrintEventArgs()); - } - } - + private void printDocument1_PrintPage(object sender, System.Drawing.Printing.PrintPageEventArgs e) { e.Graphics.DrawImage(printImage, 10, 10); } - - /// - /// 在窗体的底部状态栏上显示 综合管线条件查询结果 - /// - /// - /// - private void ToolStripText(string currentLayer, int dataCount) - { - if (dataCount != 0) - { - double featurelength = PipeLength(currentLayer, 0);// 统计管线的里程数 - - toolStripNumbers.Text = " 管线类型:" + currentLayer + " | 共有:" + Convert.ToString(dataCount - 1) + "条记录"; - toolStripFeatureLength.Text = " 管线里程:" + featurelength.ToString("0.00") + " 米"; - } - else - { - toolStripNumbers.Text = "管线类型: " + currentLayer + "| 共有:" + 0 + " 条记录 | "; - } - } - /// /// 统计管线的里程数 /// @@ -3402,26 +3123,6 @@ } /// - /// 绘制线 菜单 - /// - /// - /// - private void btnAddLine_Click(object sender, EventArgs e) - { - globeControl1.Globe.DestLayerFeatureAdd = globeControl1.Globe.MemoryLayer; - globeControl1.Globe.Action = EnumAction3D.DrawPolyline; - } - /// - /// 绘制面 菜单 - /// - /// - /// - private void btnAddPolygon_Click(object sender, EventArgs e) - { - globeControl1.Globe.DestLayerFeatureAdd = globeControl1.Globe.MemoryLayer; - globeControl1.Globe.Action = EnumAction3D.DrawPolygon; - } - /// /// 图层目录树 右键菜单中的 目标图层 菜单 /// /// @@ -3956,42 +3657,7 @@ // ClearUpDownTraceAnalysis(); //} - /// - /// 显示流向 功能 - /// - /// - /// - /// - private void Flow(object sender, string pipelineNameCN, bool bShow) - { - GSOFeatureLayer layer = globeControl1.Globe.Layers.GetLayerByCaption(pipelineNameCN) as GSOFeatureLayer; - GSOFeatures feats = layer.GetAllFeatures(); - for (int i = 0; i < feats.Length; i++) - { - GSOFeature feat = feats[i]; - GSOLineStyle3D lineStyle = feat.Geometry.Style as GSOLineStyle3D; - if (lineStyle != null) - { - if (lineStyle.ArrowStyle == null) - { - lineStyle.ArrowStyle = new GSOArrowStyle(); - lineStyle.ArrowStyle.BodyWidth = 2; - lineStyle.ArrowStyle.BodyLen = 6; - lineStyle.ArrowStyle.HeadWidth = 8; - lineStyle.ArrowStyle.HeadLen = 10; - lineStyle.ArrowStyle.OutlineVisible = true; - lineStyle.ArrowStyle.OutlineColor = Color.Red; - lineStyle.ArrowStyle.Speed = lineStyle.ArrowStyle.Speed / 2; - lineStyle.ArrowStyle.Play(); - } - lineStyle.ArrowVisible = bShow; - layerTree.SelectedNode = null; - } - } - globeControl1.Globe.Refresh(); - } - - + FrmCloseValves frm; /// /// 关阀分析 功能 @@ -4030,7 +3696,9 @@ curCAYNDataset.CloseValveAnalysis(lineFeature.ID, out arryResNodeID, out arryResValveID, false, true); } catch (Exception e) - { } + { + LogHelper.WriteLog(typeof(MainFrm), e.Message); + } string valveName = lineLayer.Caption; valveName = valveName.Substring(0, valveName.IndexOf("管线")); @@ -4106,7 +3774,7 @@ } catch (Exception e) { - + LogHelper.WriteLog(typeof(MainFrm), e.Message); } //目前只有燃气管线 有阀门 string valveName = lineLayer.Name; @@ -5457,7 +5125,7 @@ } catch (Exception ex) { - //MessageBox.Show(ex.ToString()); + LogHelper.WriteLog(typeof(MainFrm), ex.Message); } finally { @@ -5501,22 +5169,6 @@ } } - - /// - /// 清除所有坑 菜单 - /// - /// - /// - private void buttonItem3_Click(object sender, EventArgs e) - { - //日志记录 - LogManager.saveLog(Utility.userName, this.buttonItem3.Text); - - globeControl1.Globe.RemoveAllPits(); - } - - - ///// ///// 净距分析 菜单 ///// @@ -5554,42 +5206,8 @@ // ribbonBarTP.Visible = buttonItem34.Checked; // ribbonBarTP.Location = new Point(0, 0); //} - /// - /// 大气层 菜单 - /// - /// - /// - private void buttonItem17_Click_1(object sender, EventArgs e) - { - globeControl1.Globe.Atmosphere.Visible = !globeControl1.Globe.Atmosphere.Visible; - buttonItemSH1.Checked = globeControl1.Globe.Atmosphere.Visible; - globeControl1.Refresh(); - } - /// - /// 经纬网 菜单 - /// - /// - /// - private void buttonItem20_Click(object sender, EventArgs e) - { - globeControl1.Globe.LatLonGrid.Visible = !globeControl1.Globe.LatLonGrid.Visible; - buttonItemSH3.Checked = globeControl1.Globe.LatLonGrid.Visible; - globeControl1.Globe.Refresh(); - } - /// - /// 状态条 菜单 - /// - /// - /// - private void buttonItem21_Click_1(object sender, EventArgs e) - { - globeControl1.Globe.StatusBar.Visible = !globeControl1.Globe.StatusBar.Visible; - buttonItemSH4.Checked = globeControl1.Globe.StatusBar.Visible; - globeControl1.Globe.Refresh(); - } - - + /// /// 添加指定路径下的数据 功能 /// @@ -5680,43 +5298,7 @@ // } // return objRes; //} - /// - /// 刷新目录树 功能 - /// - private void RefreshDataTree() - { - layerTree.Nodes[0].Nodes.Clear(); - Int32 nCount = globeControl1.Globe.DataManager.DataSourceCount; - Int32 i = 0; - for (i = 0; i < nCount; i++) - { - GSODataSource dataSpace = globeControl1.Globe.DataManager[i]; - TreeNode node = new TreeNode(); - node.Text = dataSpace.Name; - node.ImageIndex = 0; - node.SelectedImageIndex = 0; - node.Checked = true; - node.Tag = dataSpace; - Int32 nDatasetCount = dataSpace.DatasetCount; - for (Int32 j = 0; j < nDatasetCount; j++) - { - GSODataset dataset = dataSpace[j]; - TreeNode subNode = new TreeNode(); - subNode.Text = dataset.Name; - subNode.ImageIndex = 0; - subNode.SelectedImageIndex = 0; - subNode.Checked = true; - subNode.Tag = dataset; - node.Nodes.Add(subNode); - } - layerTree.Nodes[0].Nodes.Add(node); - } - } - - - - - + /// /// 复合查询 菜单 @@ -5777,34 +5359,7 @@ return false; } - /// - /// 统计指定图层在指定范围内的所有feature对象 - /// - /// - /// - /// - private GSOFeatures Intersect_PointLayer(GSOGeoPolygon3D polygon, string pointLayerName) - { - GSOLayer layer = globeControl1.Globe.Layers.GetLayerByCaption(pointLayerName); - if (layer == null) - return null; - - GSOFeatureLayer flayer = layer as GSOFeatureLayer; - GSOFeatureDataset fdataset = flayer.Dataset as GSOFeatureDataset; - GSOFeatures feats; - if (polygon == null) - { - feats = flayer.GetAllFeatures(); - } - else - { - feats = flayer.FindFeaturesInPolygon(polygon, false); - } - - workWellLen.Add(pointLayerName, feats.Length); - return feats; - } - /// + /// /// 碰撞分析功能界面中 选择管线复选框 选中状态改变事件处理 /// /// @@ -5946,16 +5501,6 @@ MessageBox.Show("表格内容为空!", "提示"); } } - /// - /// 导出CAD 菜单 - /// - /// - /// - private void btnExportCAD_Click(object sender, EventArgs e) - { - FrmExportCADS frm = new FrmExportCADS(globeControl1, m_PipelineLayerNames); - frm.ShowDialog(); - } ///// ///// 区域分析 菜单 @@ -5987,16 +5532,6 @@ } } } - /// - /// 数据验证 菜单 - /// - /// - /// - private void buttonItem80_Click(object sender, EventArgs e) - { - FrmValiData frm = new FrmValiData(globeControl1); - frm.ShowDialog(); - } /// /// 根据指定图层创建图层节点并将节点添加到图层管理节点的子节点集合中 @@ -6018,56 +5553,7 @@ layerManagerNode.Expand(); } } - /// - /// 数据库备份 菜单 - /// - /// - /// - private void btnBackDatabase_Click(object sender, EventArgs e) - { - if (MessageBox.Show("是否确定要备份数据库文件", "信息", MessageBoxButtons.YesNo, MessageBoxIcon.Question) == DialogResult.Yes) - { - try - { - DateTime currentTime = DateTime.Now; - //string Dtime = currentTime.ToShortDateString().ToString("yyyy-MM-dd"); - string Dtime = currentTime.GetDateTimeFormats('D')[0].ToString(); - string Htime = DateTime.Now.ToString("HH时mm分ss秒").Trim(); - string fileName = Dtime + "(" + Htime + ")"; - string pathName = ""; - string sql = "select filename from master..sysdatabases where name='" + Utility.dbdatabase + "'"; - DataTable dt = OledbHelper.ExecuteDataTable(sql); - if (dt != null && dt.Rows.Count > 0) - { - pathName = dt.Rows[0][0].ToString().Trim(); - int count = pathName.LastIndexOf("\\") == -1 ? pathName.LastIndexOf("/") : pathName.LastIndexOf("\\"); - pathName = pathName.Substring(0, count); - } - pathName += "\\管网数据库" + fileName + ".bak"; - - OracleCommand cmdBK = new OracleCommand(); - cmdBK.CommandType = CommandType.Text; - cmdBK.Connection = connBackup; - cmdBK.CommandText = @"backup database " + Utility.dbdatabase + " to disk='" + pathName + "' with init"; - - connBackup.Open(); - cmdBK.ExecuteNonQuery(); - MessageBox.Show("数据库文件备份成功", "提示"); - } - catch (Exception ex) - { - MessageBox.Show(ex.ToString()); - } - finally - { - connBackup.Close(); - } - } - } - - - - + //GSOFeature emitterFeature; // 粒子要素 /// /// 添加火苗 功能 @@ -6598,361 +6084,15 @@ } } - - ///// - /// 添加用户仓库 菜单 - /// - /// - /// - private void buttonItem108_Click(object sender, EventArgs e) - { - FrmUserRepo frm = new FrmUserRepo(-1); - frm.ShowDialog(); - } - /// - /// 用户仓库管理 菜单 - /// - /// - /// - private void buttonItem111_Click(object sender, EventArgs e) - { - FrmUserRepoMgr frm = new FrmUserRepoMgr(); - frm.ShowDialog(); - } - /// - /// 添加分系统 菜单 - /// - /// - /// - private void buttonItem112_Click(object sender, EventArgs e) - { - //FrmAPP frm = new FrmAPP(-1); - //frm.ShowDialog(); - } - /// - /// 分系统管理 菜单 - /// - /// - /// - private void buttonItem113_Click(object sender, EventArgs e) - { - //FrmAPPMgr frm = new FrmAPPMgr(); - //frm.ShowDialog(); - } - /// - /// 添加操作 菜单 - /// - /// - /// - private void buttonItem114_Click(object sender, EventArgs e) - { - FrmOper frm = new FrmOper(-1); - frm.ShowDialog(); - } - /// - /// 操作管理 菜单 - /// - /// - /// - private void buttonItem115_Click(object sender, EventArgs e) - { - FrmOperMgr frm = new FrmOperMgr(); - frm.ShowDialog(); - } - /// - /// 添加资源 菜单 - /// - /// - /// - private void buttonItem116_Click(object sender, EventArgs e) - { - FrmRESC frm = new FrmRESC(-1); - frm.ShowDialog(); - } - /// - /// 资源管理 菜单 - /// - /// - /// - private void buttonItem117_Click(object sender, EventArgs e) - { - FrmRESCMgr frm = new FrmRESCMgr(); - frm.ShowDialog(); - } - /// - /// 添加权限 菜单 - /// - /// - /// - private void buttonItem118_Click(object sender, EventArgs e) - { - FrmPerm frm = new FrmPerm(-1); - frm.ShowDialog(); - } - /// - /// 权限管理 菜单 - /// - /// - /// - private void buttonItem119_Click(object sender, EventArgs e) - { - FrmPermMgr frm = new FrmPermMgr(); - frm.ShowDialog(); - } - /// - /// 添加访问控制 菜单 - /// - /// - /// - private void buttonItem120_Click(object sender, EventArgs e) - { - FrmAccess frm = new FrmAccess(-1); - frm.ShowDialog(); - } - /// - /// 访问控制管理 菜单 - /// - /// - /// - private void buttonItem121_Click(object sender, EventArgs e) - { - FrmAccessMgr frm = new FrmAccessMgr(); - frm.ShowDialog(); - } - /// - /// 部门类型管理 菜单 - /// - /// - /// - private void buttonItem122_Click(object sender, EventArgs e) - { - FrmRegionTypeMgr frm = new FrmRegionTypeMgr(); - frm.ShowDialog(); - } - /// - /// 用户信息管理 菜单 - /// - /// - /// - private void buttonItem128_Click_1(object sender, EventArgs e) - { - FrmUserManager frm = new FrmUserManager(); - frm.ShowDialog(); - } - /// - /// 添加角色 菜单 - /// - /// - /// - private void 添加角色_Click(object sender, EventArgs e) - { - FrmRole frm = new FrmRole(-1); - frm.ShowDialog(); - } - /// - /// 所有角色管理 菜单 - /// - /// - /// - private void 角色管理_Click(object sender, EventArgs e) - { - FrmRoleMgr frm = new FrmRoleMgr(); - frm.ShowDialog(); - } - - /// - /// 部门角色管理 菜单 - /// - /// - /// - private void buttonItem133_Click(object sender, EventArgs e) - { - FrmRegionRoleMgr frm = new FrmRegionRoleMgr(); - frm.ShowDialog(); - } - /// - /// 部门管理 菜单 - /// - /// - /// - private void buttonItem130_Click(object sender, EventArgs e) - { - FrmRegionMgr frm = new FrmRegionMgr(); - frm.ShowDialog(); - } - - /// - /// 日志管理 菜单 - /// - /// - /// - private void buttonItem135_Click(object sender, EventArgs e) - { - FrmLogManager frm = new FrmLogManager(); - frm.ShowDialog(); - } - /// - /// 传感器信息查询 菜单 - /// - /// - /// - private void buttonItem131_Click_1(object sender, EventArgs e) - { - GSOFeature selectedFeature = globeControl1.Globe.SelectedObject; - if (selectedFeature == null) - { - MessageBox.Show("请选择一个传感器对象!", "提示", MessageBoxButtons.OK, MessageBoxIcon.Information); - } - else - { - if (selectedFeature.Geometry != null && selectedFeature.Geometry.Type == EnumGeometryType.GeoModel) - { - GSOLayer layer = globeControl1.Globe.SelectedObjectLayer; - string tabelName = getTableName(layer.Caption); - string eqtID = selectedFeature.Description.Trim(); - if (tabelName != "" && eqtID != "") - { - string fields = getFields(tabelName); - if (fields != "") - { - string sql = "select " + fields + " from " + Utility.sensorDatabase + "." + tabelName + " where EqtID=" + eqtID + " order by RecordDate desc limit 1;"; - DataTable dt = MySqlHelper.queryDataTable(sql); - if (dt != null && dt.Rows.Count > 0) - { - FrmQueryMessage.ShowForm(this, dt, layer.Caption); - //queryMessage.Show(this); - } - else - { - MessageBox.Show("没有查询到相关信息!", "提示"); - } - } - else - { - MessageBox.Show("配置文件 \"sensorConfig.xml\" 有误!", "提示"); - } - } - else - { - MessageBox.Show("请选择一个传感器对象!", "提示"); - } - } - else - { - MessageBox.Show("请选择一个传感器对象!", "提示", MessageBoxButtons.OK, MessageBoxIcon.Information); - } - } - } - /// - /// 根据指定的图层的caption属性的值在配置文件中查找对应的数据库中的表的名称 - /// - /// 图层的caption属性的值 - /// 对应的数据库中的表的名称 - private string getTableName(string name) - { - string tabelName = ""; - if (Utility.sensorMarkerLayers != null) - { - for (int i = 0; i < Utility.sensorMarkerLayers.Count; i++) - { - MarkerLayer mLayer = Utility.sensorMarkerLayers[i]; - if (mLayer.layerName == name) - { - tabelName = mLayer.tableName; - break; - } - } - } - return tabelName; - } - /// - /// 根据数据库中的表的名称 查找对应的表中的字段名称的集合 - /// - /// 数据库中的表的名称 - /// 对应的表中的字段名称的集合 - private string getFields(string tabelName) - { - string fields = ""; - if (Utility.sensorMarkerLayers != null) - { - for (int i = 0; i < Utility.sensorMarkerLayers.Count; i++) - { - MarkerLayer mLayer = Utility.sensorMarkerLayers[i]; - if (mLayer.tableName.Trim() == tabelName.Trim()) - { - if (mLayer.fields != null) - { - foreach (string key in mLayer.fields.Keys) - { - string value = mLayer.fields[key]; - fields += tabelName.Trim() + "." + key + " as " + value + ","; - } - fields = fields.Remove(fields.Length - 1); - } - break; - } - } - } - return fields; - } - - /// - /// 历史曲线查询 菜单 - /// - /// - /// - private void buttonItem132_Click(object sender, EventArgs e) - { - GSOFeature selectedFeature = globeControl1.Globe.SelectedObject; - if (selectedFeature == null) - { - MessageBox.Show("请选择一个对象!", "提示", MessageBoxButtons.OK, MessageBoxIcon.Information); - } - else - { - if (selectedFeature.Geometry != null && selectedFeature.Geometry.Type == EnumGeometryType.GeoModel) - { - GSOLayer layer = globeControl1.Globe.SelectedObjectLayer; - string tabelName = getTableName(layer.Caption); - string eqtID = selectedFeature.Description; - if (tabelName != "" && eqtID != "") - { - FrmQueryHistory.ShowForm(this, tabelName, eqtID); - } - else - { - MessageBox.Show("请选择一个传感器对象!", "提示"); - } - } - else - { - MessageBox.Show("请选择一个传感器对象!", "提示", MessageBoxButtons.OK, MessageBoxIcon.Information); - } - } - } - + //定时检查传感器的状态 public System.Windows.Forms.Timer timerOfSensor = null; public int alarmValueLiuLiang = 0; public int alarmValueYaLi = 0; public int alarmValueYeTi = 0; public int alarmValueZaoSheng = 0; - /// - /// 传感器在线报警 菜单 - /// - /// - /// - private void buttonItem134_Click(object sender, EventArgs e) - { - if (timerOfSensor == null) - { - timerOfSensor = new System.Windows.Forms.Timer(); - timerOfSensor.Interval = 30000; - timerOfSensor.Tick += new EventHandler(timerOfSensor_Tick); - } - FrmQuerySensorAlarm.ShowForm(this); - } + /// /// 传感器报警 功能中的 定时器 的触发事件处理 /// @@ -7016,6 +6156,7 @@ } catch (Exception ex) { + LogHelper.WriteLog(typeof(MainFrm), ex.Message); continue; } } @@ -7025,145 +6166,7 @@ } } - - /// - /// 沿线运动 菜单 - /// - /// - /// - private void buttonItem138_Click(object sender, EventArgs e) - { - if (globeControl1.Globe.SelectedObject == null) - { - MessageBox.Show("请先选择一条线!", "提示", MessageBoxButtons.OK, MessageBoxIcon.Exclamation); - return; - } - - GSOFeature lineFeature = globeControl1.Globe.SelectedObject; - if (lineFeature.Geometry == null || lineFeature.Geometry.Type != EnumGeometryType.GeoPolyline3D) - { - MessageBox.Show("请先选择一条线!", "提示", MessageBoxButtons.OK, MessageBoxIcon.Exclamation); - return; - } - - OpenFileDialog dlg = new OpenFileDialog(); - dlg.Filter = "*.gcm;*.3ds|*.gcm;*.3ds|*.3ds|*.3ds|*.gcm|*.gcm"; - if (dlg.ShowDialog() == DialogResult.OK) - { - GSOGeoModel model = new GSOGeoModel(); - model.FilePath = dlg.FileName; - - GSOGeoDynamicRoute dynamicRoute = new GSOGeoDynamicRoute(); - dynamicRoute.ActorGeometry = model; - - GSORoute route = new GSORoute(); - GSOGeoPolyline3D geoline = (GSOGeoPolyline3D)lineFeature.Geometry; - for (int i = 0; i < geoline[0].Count; i++) - { - route.Add(geoline[0][i]); - } - route.CircleRoute = false; - route.Speed = 30; - route.RotateSpeed = 50; - route.AltitudeMode = geoline.AltitudeMode; - dynamicRoute.Route = route; - - GSOFeature feature = new GSOFeature(); - - dynamicRoute.Play(); - feature.Geometry = dynamicRoute; - - //GSOLabel gsoLabel = new GSOLabel(); - //gsoLabel.Text = "模型测试"; - //feature.Label = gsoLabel; - globeControl1.Globe.MinModelVisibleSize = 0; - - globeControl1.Globe.MemoryLayer.AddFeature(feature); - globeControl1.Globe.Refresh(); - } - } - /// - /// 回退 菜单 - /// - /// - /// - private void buttonItem99_Click(object sender, EventArgs e) - { - globeControl1.Globe.UnDoEdit(); - } - /// - /// 前进 菜单 - /// - /// - /// - private void buttonItem100_Click(object sender, EventArgs e) - { - globeControl1.Globe.ReDoEdit(); - } - /// - /// 水平净距 功能界面中的 标签内容改变事件处理 - /// - /// - /// - private void textBoxX4_TextChanged(object sender, EventArgs e) - { - string valueJingJu = textBoxX4.Text.Trim(); - if (valueJingJu != "") - { - double value = 0; - bool bl = double.TryParse(valueJingJu, out value); - if (bl) - { - labelX24.Text = "水平净距小于" + value.ToString() + "米的管线有:"; - } - } - } - /// - /// 垂直净距 功能界面中的 标签内容改变事件处理 - /// - /// - /// - private void textBoxX2_TextChanged(object sender, EventArgs e) - { - string valueJingJu = textBoxX2.Text.Trim(); - if (valueJingJu != "") - { - double value = 0; - bool bl = double.TryParse(valueJingJu, out value); - if (bl) - { - labelX23.Text = "垂直净距小于" + value.ToString() + "米的管线有:"; - } - } - } - /// - /// 覆土分析 功能界面中的 标签内容改变事件处理 - /// - /// - /// - private void textBoxX3_TextChanged(object sender, EventArgs e) - { - string valueJingJu = textBoxX3.Text.Trim(); - if (valueJingJu != "") - { - double value = 0; - bool bl = double.TryParse(valueJingJu, out value); - if (bl) - { - labelX17.Text = "覆土深度小于" + value.ToString() + "米的管线有:"; - } - } - } - - /// - /// 传感器分类查询 全区域 菜单 - /// - /// - /// - private void buttonItemSensor全区域查询_Click(object sender, EventArgs e) - { - FrmAccessoriesSensor.ShowForm(globeControl1, instrumenLayerNames, 0); - } + /// /// 传感器分类查询 绘制区域 菜单 /// @@ -7224,170 +6227,10 @@ layerTemp.RemoveAllFeature(); globeControl1.Refresh(); } - /// - /// 数字预处理 功能 - /// - /// - /// - private void 数字预处理buttonItem140_Click(object sender, EventArgs e) - { - FrmEditShapeFile frm = new FrmEditShapeFile(globeControl1); - frm.ShowDialog(this); - } - - - /// - /// 导出矢量 功能 将图层导出为kml和shp格式数据 - /// - /// - /// - private void 导出矢量buttonItem140_Click(object sender, EventArgs e) - { - /* - List m_PipelineLayerNames = new List();//线图层名称 - List workwellLayerNames = new List();//工井图层名称 - List valueLayerNames = new List();//阀门图层名称 - List instrumenLayerNames = new List();//附属物图层名称 - List pipefittingLayerNames = new List();//管件图层名称 - */ - List listVectorNames = new List(); - for (int i = 0; i < m_PipelineLayerNames.Count; i++) - { - if (m_PipelineLayerNames[i] == "移动" || m_PipelineLayerNames[i] == "联通" - || m_PipelineLayerNames[i] == "电信" || m_PipelineLayerNames[i] == "共通" - || m_PipelineLayerNames[i] == "有限电视" || m_PipelineLayerNames[i] == "交通信号" - || m_PipelineLayerNames[i] == "供电") - { - continue; - } - if (listVectorNames.Contains(m_PipelineLayerNames[i]) == false) - { - listVectorNames.Add(m_PipelineLayerNames[i]); - } - } - for (int i = 0; i < valueLayerNames.Count; i++) - { - if (listVectorNames.Contains(valueLayerNames[i]) == false) - { - listVectorNames.Add(valueLayerNames[i]); - } - } - for (int i = 0; i < workwellLayerNames.Count; i++) - { - if (listVectorNames.Contains(workwellLayerNames[i]) == false) - { - listVectorNames.Add(workwellLayerNames[i]); - } - } - for (int i = 0; i < instrumenLayerNames.Count; i++) - { - if (listVectorNames.Contains(instrumenLayerNames[i]) == false) - { - listVectorNames.Add(instrumenLayerNames[i]); - } - } - for (int i = 0; i < pipefittingLayerNames.Count; i++) - { - if (listVectorNames.Contains(pipefittingLayerNames[i]) == false) - { - listVectorNames.Add(pipefittingLayerNames[i]); - } - } - FrmExportVector frm = new FrmExportVector(globeControl1, listVectorNames); - frm.ShowDialog(); - } string citySevenLineType = ""; string cityServerLineName = ""; /// - /// 绘制城市七线 功能按钮 - /// - /// - /// - private void 绘制城市七线buttonItem140_Click(object sender, EventArgs e) - { - FrmCitySevenLineType frm = new FrmCitySevenLineType(); - if (frm.ShowDialog() == DialogResult.OK) - { - globeControl1.Globe.Action = EnumAction3D.DrawPolyline; - m_isDrawCitySevenLine = true; - m_isDrawTunnel = false; - m_AddPipeLine = false; - this.citySevenLineType = frm.citySevenLineType; - this.cityServerLineName = frm.citySevenLineName; - switch (frm.citySevenLineType) - { - case "城市红线": - GSOLayer layerRed = globeControl1.Globe.Layers.GetLayerByCaption(frm.citySevenLineType); - if (layerRed != null) - { - globeControl1.Globe.DestLayerFeatureAdd = layerRed; - layerRed.Editable = true; - } - break; - case "城市橙线": - GSOLayer layerOrange = globeControl1.Globe.Layers.GetLayerByCaption(frm.citySevenLineType); - if (layerOrange != null) - { - globeControl1.Globe.DestLayerFeatureAdd = layerOrange; - layerOrange.Editable = true; - } - break; - case "城市黄线": - GSOLayer layerYellow = globeControl1.Globe.Layers.GetLayerByCaption(frm.citySevenLineType); - if (layerYellow != null) - { - globeControl1.Globe.DestLayerFeatureAdd = layerYellow; - layerYellow.Editable = true; - } - break; - case "城市绿线": - GSOLayer layerGreen = globeControl1.Globe.Layers.GetLayerByCaption(frm.citySevenLineType); - if (layerGreen != null) - { - globeControl1.Globe.DestLayerFeatureAdd = layerGreen; - layerGreen.Editable = true; - } - break; - case "城市蓝线": - GSOLayer layerBlue = globeControl1.Globe.Layers.GetLayerByCaption(frm.citySevenLineType); - if (layerBlue != null) - { - globeControl1.Globe.DestLayerFeatureAdd = layerBlue; - layerBlue.Editable = true; - } - break; - case "城市紫线": - GSOLayer layerPurple = globeControl1.Globe.Layers.GetLayerByCaption(frm.citySevenLineType); - if (layerPurple != null) - { - globeControl1.Globe.DestLayerFeatureAdd = layerPurple; - layerPurple.Editable = true; - } - break; - case "城市黑线": - GSOLayer layerBlack = globeControl1.Globe.Layers.GetLayerByCaption(frm.citySevenLineType); - if (layerBlack != null) - { - globeControl1.Globe.DestLayerFeatureAdd = layerBlack; - layerBlack.Editable = true; - } - break; - } - } - } - /// - /// 七线审核 功能按钮 - /// - /// - /// - private void 七线审核buttonItem141_Click(object sender, EventArgs e) - { - FrmCityServerLineAnalysis frm = new FrmCityServerLineAnalysis(globeControl1, m_PipelineLayerNames); - frm.ShowDialog(this); - } - - /// /// 间距分析 开始分析按钮 分析绘制的七线和管线的距离是否符合标准 /// /// @@ -7666,25 +6509,6 @@ } } - - - /// - /// 管线自动缩进 菜单 - /// - /// - /// - private void 管线自动缩进buttonItem140_Click(object sender, EventArgs e) - { - FrmPipelineIndented frm = new FrmPipelineIndented(globeControl1, m_PipelineLayerNames, workwellLayerNames); - frm.ShowDialog(this); - } - - private void btnExportCADs_Click(object sender, EventArgs e) - { - - } - - /// /// 统计指定图层在指定范围内的所有feature对象 /// @@ -7755,8 +6579,6 @@ } - - //设置图层为隐藏 private void setLayerVisible(string layerName) { @@ -7765,27 +6587,7 @@ globeControl1.Globe.Refresh(); } - /// - /// 连接数据库 - /// - /// - /// - private void buttonItem129_Click(object sender, EventArgs e) - { - //保存日志 - LogManager.saveLog(Utility.userName, this.buttonItemSJGL4_1.Text); - - FrmDatabaseParaSetting2 frm = new FrmDatabaseParaSetting2(globeControl1); - if (frm.ShowDialog() == DialogResult.OK) - { - ds = FrmDatabaseParaSetting2.ds; - if (ds != null) - { - ds.IsCloseSaved = false; - } - } - } - + /// /// 清除渲染结果 /// @@ -7803,112 +6605,8 @@ layerTemp.RemoveAllFeature(); globeControl1.Refresh(); } - - /// - /// 绘制垂线 - /// - /// - /// - private void drawCLine(GSOPoint3d fpt, GSOPoint3d tpt) - { - GSOGeoPolyline3D pline = new GSOGeoPolyline3D(); - GSOPoint3ds pts = new GSOPoint3ds(); - pts.Add(fpt); - pts.Add(tpt); - pline.AddPart(pts); - - GSOGeoPoint3D fptg = new GSOGeoPoint3D(); - GSOGeoPoint3D tptg = new GSOGeoPoint3D(); - fptg.X = fpt.X; - fptg.Y = fpt.Y; - fptg.Z = 0; - tptg.X = tpt.X; - tptg.Y = tpt.Y; - tptg.Z = 0; - - GSOFeature gf = new GSOFeature(); - gf.Geometry = pline; - - globeControl1.Globe.MemoryLayer.AddFeature(gf); - - } - /// - /// 红线审核 - /// - /// - /// - private void buttonItem138_Click_2(object sender, EventArgs e) - { - - } - /// - /// 比较两个点是否是同一个点 - /// - /// - /// - /// - private bool comparePoint(GSOPoint3d pt1, GSOPoint3d pt2) - { - double x1 = 0; double y1 = 0; - double x2 = 0; double y2 = 0; - x1 = pt1.X; - y1 = pt1.Y; - x2 = pt2.X; - y2 = pt2.Y; - if ((x1 == x2) && (y1 == y2)) - { - return true; - } - return false; - } - /// - /// 获得点到线的垂线距离及垂点 - /// - /// - /// - /// - /// - private void comparePointLine(GSOPoint3d point, GSOGeoPolyline3D line, out double length, out GSOPoint3d pointChuiDian) - { - GSOPoint3d lineStartPoint = line[0][0]; - GSOPoint3d lineEndPoint = line[0][1]; - GSOGeoPolyline3D lineAB = new GSOGeoPolyline3D(); - GSOPoint3ds pointsAB = new GSOPoint3ds(); - pointsAB.Add(point); - pointsAB.Add(lineStartPoint); - lineAB.AddPart(pointsAB); - double lengthAB = lineAB.GetSpaceLength(false, 6378137.0); - double xieLvAB = getXieLu("", point.X, point.Y, lineStartPoint.X, lineStartPoint.Y); - double xieLvBC = getXieLu("", lineStartPoint.X, lineStartPoint.Y, lineEndPoint.X, lineEndPoint.Y); - - double tanABC = Math.Abs(xieLvAB - xieLvBC) / (1 + xieLvAB * xieLvBC); - double angle = Math.Atan(tanABC); - //if (angle > Math.PI / 2) //落在外边 - //{ - // length = 0; - //} - double lengthAD = lengthAB * Math.Sin(angle); - length = Math.Abs(lengthAD); - double lengthBD = lengthAB * Math.Cos(angle); - - GSOPoint2d point2dStart = Latlon_2_XYZ(lineStartPoint.X, lineStartPoint.Y); - double bBC = point2dStart.Y - xieLvBC * point2dStart.X; - GSOPoint2d point2dEnd = new GSOPoint2d(); - point2dEnd.X = point2dStart.X + 100; - point2dEnd.Y = point2dEnd.X * xieLvBC + bBC; - point2dEnd = XYZ_2_Latlon(point2dEnd.X, point2dEnd.Y); - - GSOPoint3d pointEnd = new GSOPoint3d(); - pointEnd.X = point2dEnd.X; - pointEnd.Y = point2dEnd.Y; - GSOGeoPolyline3D lineYanShen = new GSOGeoPolyline3D(); - GSOPoint3ds pointsYanShen = new GSOPoint3ds(); - pointsYanShen.Add(lineStartPoint); - pointsYanShen.Add(pointEnd); - lineYanShen.AddPart(pointsYanShen); - GSOGeoPolyline3D lineSegment = lineYanShen.GetSegment(0, lengthBD); - pointChuiDian = lineSegment[0][1]; - } + + /// /// 获得斜率 /// @@ -8044,255 +6742,6 @@ } /// - /// 获取与点相连的所有线以及线的点的集合 - /// - /// 选定的点所在的线 - /// 选定的点 - /// 面中不完全包含的除起点线之外所有的线 - /// 选定的点所在的点的集合 - /// 所有以选定线为起点的点的集合 - /// - private List getFeaturesPoints(GSOFeature featureSelect, GSOPoint3d lineStart, GSOFeatures selectFeatures, GSOPoint3ds ps, List listPS) - { - GSOFeatures fsStart = new GSOFeatures(); - for (int n = 0; n < selectFeatures.Length; n++) - { - if (featureSelect.ID == selectFeatures[n].ID) - { - continue; - } - GSOGeoPolyline3D newLine = selectFeatures[n].Geometry as GSOGeoPolyline3D; - if (newLine != null && newLine.PartCount > 0) - { - GSOPoint3d newLineStart = newLine[0][0]; - GSOPoint3d newLineEnd = newLine[0][newLine[0].Count - 1]; - if (lineStart.X == newLineEnd.X && lineStart.Y == newLineEnd.Y) - { - GSOPoint3ds psAdd = new GSOPoint3ds(); - for (int k = newLine[0].Count - 1; k >= 0; k--) - { - psAdd.Add(newLine[0][k]); - } - newLine[0] = psAdd; - fsStart.Add(selectFeatures[n]); - - } - else if (lineStart.X == newLineStart.X && lineStart.Y == newLineStart.Y) - { - fsStart.Add(selectFeatures[n]); - - } - } - } - if (fsStart.Length > 0) - { - for (int m = 0; m < fsStart.Length; m++) - { - GSOGeoPolyline3D lineFsStart = fsStart[m].Geometry as GSOGeoPolyline3D; - if (lineFsStart != null && lineFsStart.PartCount > 0) - { - GSOPoint3ds psAdd = ps.Clone(); - for (int k = 0; k < lineFsStart[0].Count; k++) - { - psAdd.Add(lineFsStart[0][k]); - } - listPS = getFeaturesPoints(fsStart[m], lineFsStart[0][lineFsStart[0].Count - 1], selectFeatures, psAdd, listPS); - } - } - } - else - { - listPS.Add(ps); - } - return listPS; - } - - /// - /// 获取切割面的线 - /// - /// 不完全包含在面中的所有线 - /// 完全包含在面中的所有线 - /// 线 - private GSOFeature getLineFromGSOFeatures(GSOFeatures features, GSOFeatures featuresTrue) - { - //1. 当线对象数组的长度为0时,返回空 - if (features.Length == 0) - { - return null; - } - //2. 当线对象数组的长度为1时,返回这条线 - if (features.Length == 1) - { - return features[0]; - } - //3. 当线对象数组的长度大于1时,计算所有线组成的最长线 - - //3.1 获取所有不完全包含在面中的对象selectFeatures - GSOFeatures selectFeatures = new GSOFeatures(); - for (int a = 0; a < features.Length; a++) - { - selectFeatures.Add(features[a].Clone()); - } - //3.2 删除features中完全包含在面中的线,获取和面的边界相交的线对象 - for (int a = 0; a < featuresTrue.Length; a++) - { - for (int b = 0; b < features.Length; b++) - { - if (featuresTrue[a].ID == features[b].ID) - { - features.Remove(b); - break; - } - } - } - //3.3 如果和面的边界相交的线的数量为0,返回空 - if (features.Length == 0) - { - return null; - } - //3.4 获取第一条和面的边界相交的线featureInOutPolygon - GSOFeature featureInOutPolygon = features[0]; - //3.5 从所有的线中删除featureInOutPolygon - for (int a = 0; a < selectFeatures.Length; a++) - { - if (selectFeatures[a].ID == featureInOutPolygon.ID) - { - selectFeatures.Remove(a); - break; - } - } - //listPS存储所有从featureInOutPolygon出发的点的集合 - List listPS = new List(); - //3.5 获取与featureInOutPolygon相连的线的集合 - GSOGeoPolyline3D line = featureInOutPolygon.Geometry as GSOGeoPolyline3D; - if (line != null && line.PartCount > 0) - { - GSOPoint3d lineStart = line[0][0]; - GSOPoint3d lineEnd = line[0][line[0].Count - 1]; - #region//获取和featureInOutPolygon的起点相连的线 - GSOFeatures fsStart = new GSOFeatures(); - for (int n = 0; n < selectFeatures.Length; n++) - { - GSOGeoPolyline3D newLine = selectFeatures[n].Geometry as GSOGeoPolyline3D; - if (newLine != null && newLine.PartCount > 0) - { - GSOPoint3d newLineStart = newLine[0][0]; - GSOPoint3d newLineEnd = newLine[0][newLine[0].Count - 1]; - if (lineStart.X == newLineEnd.X && lineStart.Y == newLineEnd.Y) - { - GSOPoint3ds psAdd = new GSOPoint3ds(); - for (int k = newLine[0].Count - 1; k >= 0; k--) - { - psAdd.Add(newLine[0][k]); - } - newLine[0] = psAdd; - fsStart.Add(selectFeatures[n]); - - } - else if (lineStart.X == newLineStart.X && lineStart.Y == newLineStart.Y) - { - fsStart.Add(selectFeatures[n]); - } - } - } - #endregion - - #region//获取和featureInOutPolygon的终点相连的线 - GSOFeatures fsEnd = new GSOFeatures(); - for (int n = 0; n < selectFeatures.Length; n++) - { - GSOGeoPolyline3D newLine = selectFeatures[n].Geometry as GSOGeoPolyline3D; - if (newLine != null && newLine.PartCount > 0) - { - GSOPoint3d newLineStart = newLine[0][0]; - GSOPoint3d newLineEnd = newLine[0][newLine[0].Count - 1]; - if (lineEnd.X == newLineStart.X && lineEnd.Y == newLineStart.Y) - { - fsEnd.Add(selectFeatures[n]); - - } - else if (lineEnd.X == newLineEnd.X && lineEnd.Y == newLineEnd.Y) - { - GSOPoint3ds psAdd = new GSOPoint3ds(); - for (int k = newLine[0].Count - 1; k >= 0; k--) - { - psAdd.Add(newLine[0][k]); - } - newLine[0] = psAdd; - fsEnd.Add(selectFeatures[n]); - - } - } - } - #endregion - - //3.6 将featureInOutPolygon的所有点和与之起点相连的线的所有点组成一个点的集合并添加到listPS中 - if (fsStart.Length > 0 && fsEnd.Length == 0) - { - for (int m = 0; m < fsStart.Length; m++) - { - GSOGeoPolyline3D lineFsStart = fsStart[m].Geometry as GSOGeoPolyline3D; - if (lineFsStart != null && lineFsStart.PartCount > 0) - { - GSOPoint3ds psAdd = new GSOPoint3ds(); - for (int k = line[0].Count - 1; k >= 0; k--) - { - psAdd.Add(line[0][k]); - } - for (int k = 0; k < lineFsStart[0].Count; k++) - { - psAdd.Add(lineFsStart[0][k]); - } - - listPS = getFeaturesPoints(fsStart[m], lineFsStart[0][lineFsStart[0].Count - 1], selectFeatures, psAdd, listPS); - - } - } - } - //3.6 将featureInOutPolygon的所有点和与之终点相连的线的所有点组成一个点的集合并添加到listPS中 - else if (fsStart.Length == 0 && fsEnd.Length > 0) - { - for (int n = 0; n < fsEnd.Length; n++) - { - GSOGeoPolyline3D lineFsEnd = fsEnd[n].Geometry as GSOGeoPolyline3D; - if (lineFsEnd != null && lineFsEnd.PartCount > 0) - { - GSOPoint3ds psAdd = new GSOPoint3ds(); - for (int k = 0; k < line[0].Count - 1; k++) - { - psAdd.Add(line[0][k]); - } - for (int k = 0; k < lineFsEnd[0].Count; k++) - { - psAdd.Add(lineFsEnd[0][k]); - } - //获取线fsEnd[n]的另一个端点相连的线并记录该线的点的集合 - listPS = getFeaturesPoints(fsEnd[n], lineFsEnd[0][lineFsEnd[0].Count - 1], selectFeatures, psAdd, listPS); - } - } - } - } - - //3.7 获取所有以featureInOutPolygon为起点的点的集合组成的线中的最长的线 - double maxLength = 0; - GSOFeature featureNew = new GSOFeature(); - for (int h = 0; h < listPS.Count; h++) - { - GSOGeoPolyline3D lineNew = new GSOGeoPolyline3D(); - lineNew.AddPart(listPS[h]); - GSOLabel label = new GSOLabel(); - label.Text = h.ToString(); - featureNew.Label = label; - double length = lineNew.GetSpaceLength(true, 6378137); - if (length > maxLength) - { - featureNew.Geometry = lineNew; - } - } - - return featureNew; - } - /// /// 更新最大最小状态 /// /// @@ -8340,219 +6789,6 @@ - private void buttonItem139_Click(object sender, EventArgs e) - { - - string filepath = ""; - //日志记录 - OpenFileDialog dlg = new OpenFileDialog(); - dlg.Filter = "矢量数据(*.shp)|*.shp|矢量数据(*.lgd)|*.lgd|全部支持格式(*.lgd,*.shp)|*.lgd;*.shp;"; - //dlg.Filter = "支持格式(*.lrp,*.tif,*.img,*.lrc,*.kml,*.lgd,*.shp,*.gft)|*.lrp;*.tif;*.img;*.lrc;*.kml;*.lgd;*.shp;*.gft|栅格数据(*.lrp)|*.lrp|栅格缓存(*.lrc)|*.lrc|KML数据(*.kml)|*.kml|矢量数据(*.lgd)|*.lgd|矢量缓存(*.gft)|*.gft|其它格式(*.*)|*.*||"; - dlg.Multiselect = true; - if (dlg.ShowDialog() == DialogResult.OK) - { - //自定义lprj文件名,从程序中复制一lprj文件。 - int bindex = dlg.FileName.Split('\\').Length; - string lastname = dlg.FileName.Split('\\')[bindex - 1]; - - for (int i = 0; i < dlg.FileNames.Length; i++) - { - string strDataPath = dlg.FileNames[i]; - filepath = strDataPath; - - GSOLayer layer = globeControl1.Globe.Layers.Add(strDataPath); - - } - - } - //放大到红线 - - - // globeControl1.Globe.Layers.MoveTo(0, globeControl1.Globe.Layers.Count - 1); - // globeControl1.Globe.Layers.MoveTo(0,4); - globeControl1.Refresh(); - - - } - /// - /// - /// - /// - /// - private void buttonItem142_Click(object sender, EventArgs e) - { - //获得红线polygon - //GSOLayer layerSevenLine = globeControl1.Globe.Layers.GetLayerByCaption(redlinelayername); - - GSOLayer layerSevenLine = globeControl1.Globe.Layers.Add("D:\\data\\歌林小镇shp\\test.shp"); - //获得红线结果列表 - ArrayList rrLists = new ArrayList(); - - //if (redlinelayername != "") - { - GSOFeatures fs = layerSevenLine.GetAllFeatures(); - int len = fs.Length; - - GSOGeoPolygon3D sevenPolygon = new GSOGeoPolygon3D(); - for (int k = 0; k < len; k++) - {//多根红线 - ///////生成红线区域/////// - GSOFeature featSevenLine = layerSevenLine.GetAt(k); - GSOGeoPolyline3D sevenLine = featSevenLine.Geometry as GSOGeoPolyline3D; - - List sevenParts = new List(); - for (int i = 0; i < sevenLine.PartCount; i++) - { - sevenParts.Add(sevenLine[i]); - } - for (int i = 0; i < sevenParts.Count; i++) - { - sevenPolygon.AddPart((GSOPoint3ds)sevenParts[i]); - } - /////拼出红线多边形over////// - - } - //GSOLayer layer = globeControl1.Globe.Layers.GetLayerByCaption("天然气管线"); - - GSOLayer layer = globeControl1.Globe.Layers.Add("C:\\Users\\nn-203\\Desktop\\xiaobai\\test.lgd"); - //线切割面定义,输出用 - GSOFeatures resFeats = new GSOFeatures(); - int resultstyle = 0; - //管线切割红线区域后,面积较小的区域 - GSOGeoPolygon3D restPoly = new GSOGeoPolygon3D(); - List inpts = new List(); - if (layer != null) - { - //红线区域 - GSOFeature sevenfeature = new GSOFeature(); - sevenfeature.Geometry = sevenPolygon; - - //获取不完全包含在面中的所有线 - GSOFeatures feats = layer.FindFeaturesInPolygon(sevenPolygon, false); - //获取完全包含在面中的所有线 - GSOFeatures featsTrue = layer.FindFeaturesInPolygon(sevenPolygon, true); - //获取面中所有对象组成的切割面的长线 - GSOFeature feature = new GSOFeature(); - - feature = getLineFromGSOFeatures(feats, featsTrue);//管线多个feature拼成一个feature - - //globeControl1.Globe.MemoryLayer.AddFeature(feature); - //globeControl1.Globe.MemoryLayer.AddFeature(sevenfeature); - if (feature != null) - { - //线切割面,输出 - //feature.HighLight = true; - GSODataEngineUtility.GSLineClipPolygon(feature, sevenfeature, out resFeats, out resultstyle); - } - else - { - MessageBox.Show("没有找到切割面的线对象!"); - } - ////////////////绘制分割后的多边形/////////////// - for (int a = 0; a < resFeats.Length; a++) - { - - GSOFeature gf = resFeats[1]; - globeControl1.Globe.MemoryLayer.AddFeature(gf); - - } - } - - - } - } - - private void buttonItem143_Click(object sender, EventArgs e) - { - //获得红线polygon - GSOLayer layerSevenLine = globeControl1.Globe.Layers.Add("d:\\lineAndPolygon.lgd"); - GSOLayer layerSevenLine2 = globeControl1.Globe.Layers.GetLayerByCaption("d:\\lineAndPolygon.lgd"); - //获得红线结果列表 - ArrayList rrLists = new ArrayList(); - - - // if (redlinelayername != "") - { - GSOFeatures fs = layerSevenLine.GetAllFeatures(); - int len = fs.Length; - - GSOGeoPolyline3D linetest = new GSOGeoPolyline3D(); - GSOGeoPolygon3D sevenPolygon = new GSOGeoPolygon3D(); - - GSOFeature linefeat = fs.FindByID(2); - //linefeat.Geometry = linetest; - GSOFeature polyfeat = fs.FindByID(1); - //polyfeat.Geometry = sevenPolygon; - - //线切割面定义,输出用 - GSOFeatures resFeats = new GSOFeatures(); - int resultstyle = 0; - GSODataEngineUtility.GSLineClipPolygon(linefeat, polyfeat, out resFeats, out resultstyle); - - ////////////////绘制分割后的多边形/////////////// - for (int a = 0; a < resFeats.Length; a++) - { - - GSOFeature gf = resFeats[0]; - globeControl1.Globe.MemoryLayer.AddFeature(gf); - - } - ////把红线切成一段段的线段,获得切前的红线点集 - List redpts = new List();//切前的红线点集合 - for (int i = 0; i < linetest.PartCount; i++) - { - GSOPoint3ds partP = linetest[i]; - for (int j = 0; j < partP.Count; j++) - { - redpts.Add(partP[j]); - } - } - - List redpts2 = new List();//切前的红线点集合 - for (int i = 0; i < sevenPolygon.PartCount; i++) - { - GSOPoint3ds partP = sevenPolygon[i]; - for (int j = 0; j < partP.Count; j++) - { - redpts2.Add(partP[j]); - } - } - } - } - /// - /// 增加用户手册下载连接 - /// - /// - /// - Cyberpipe.udfiles.UpDownFile UDF = new udfiles.UpDownFile(Utility.udserviceurl); - string dir_Ok = "C:\\Users\\nn-203\\Desktop"; - private void button1_Click(object sender, EventArgs e) - { - if (folderBrowserDialog1.ShowDialog() == DialogResult.OK) //打洙?开a文?件t夹D对?话°框ò - { - dir_Ok = folderBrowserDialog1.SelectedPath; //显?示?选?择?的?文?件t夹D路·径? - - //tempstr = folderBrowserDialog1.SelectedPath; //存?储洹?选?择?的?文?件t夹D路·径? - - } - - Cyberpipe.PED_logicfile.PED_Affair.Redact_D = Utility.uploadpath + "\\SFiles\\UserHbook\\说明.docx"; - if (File.Exists(dir_Ok + "\\" + Files_Name(Cyberpipe.PED_logicfile.PED_Affair.Redact_D, 1))) - { - if (MessageBox.Show("文件夹下有同名文件,是否替换?", "提示", MessageBoxButtons.YesNo, MessageBoxIcon.Information) == DialogResult.No) ; - - } - byte[] file = UDF.Down(Cyberpipe.PED_logicfile.PED_Affair.Redact_D); - FileStream pFileSream = new FileStream(dir_Ok + "\\说明.docx", FileMode.OpenOrCreate); - pFileSream.Write(file, 0, file.Length); - pFileSream.Close(); - if (File.Exists(dir_Ok + "\\" + Files_Name(Cyberpipe.PED_logicfile.PED_Affair.Redact_D, 1)) == true) - { - MessageBox.Show("文件导出成功!"); - } - //PEDAClass.Folder_Handle(dir_Ok + "\\" + PEDAClass.Files_Name(Cyberpipe.PED_logicfile.PED_Affair.Redact_D, 0), Cyberpipe.PED_logicfile.PED_Affair.Redact_D, "", 0); - - } /// /// 获取文件或文件夹的名称 /// @@ -8575,33 +6811,6 @@ return DF_Name; } - private void toolStripDropDownButton1_Click(object sender, EventArgs e) - { - if (folderBrowserDialog1.ShowDialog() == DialogResult.OK) //打洙?开a文?件t夹D对?话°框ò - { - dir_Ok = folderBrowserDialog1.SelectedPath; //显?示?选?择?的?文?件t夹D路·径? - - //tempstr = folderBrowserDialog1.SelectedPath; //存?储洹?选?择?的?文?件t夹D路·径? - - - Cyberpipe.PED_logicfile.PED_Affair.Redact_D = Utility.uploadpath + "\\SFiles\\UserHbook\\说明.docx"; - if (File.Exists(dir_Ok + "\\" + Files_Name(Cyberpipe.PED_logicfile.PED_Affair.Redact_D, 1))) - { - if (MessageBox.Show("文件夹下有同名文件,是否替换?", "提示", MessageBoxButtons.YesNo, MessageBoxIcon.Information) == DialogResult.No) ; - - } - byte[] file = UDF.Down(Cyberpipe.PED_logicfile.PED_Affair.Redact_D); - FileStream pFileSream = new FileStream(dir_Ok + "\\说明.docx", FileMode.OpenOrCreate); - pFileSream.Write(file, 0, file.Length); - pFileSream.Close(); - if (File.Exists(dir_Ok + "\\" + Files_Name(Cyberpipe.PED_logicfile.PED_Affair.Redact_D, 1)) == true) - { - MessageBox.Show("文件导出成功!"); - } - - } - } - /// /// 空间查询 /// @@ -9792,7 +8001,7 @@ GSOLayer resLayer = null; GSOFeature resFeature = null; globeControl1.Globe.GetSelectObject(0, out resFeature, out resLayer); - + if (resFeature == null) return; GSOGeoPolyline3D line1 = resFeature.Geometry as GSOGeoPolyline3D; if (line1 == null) { @@ -9876,7 +8085,7 @@ GSOLayer resLayer = null; GSOFeature resFeature = null; globeControl1.Globe.GetSelectObject(0, out resFeature, out resLayer); - + if (resFeature == null) return; GSOGeoPolyline3D line1 = resFeature.Geometry as GSOGeoPolyline3D; if (line1 == null) { @@ -9891,7 +8100,8 @@ } GSOFeatures feats = globeControl1.Globe.MemoryLayer.GetFeatureByName("粒子要素", true); - if (feats.Length > 0) + + if (feats!=null&&feats.Length > 0) globeControl1.Globe.MemoryLayer.RemoveFeatureByID(feats[0].ID); //if (emitterFeature != null) //{ @@ -11121,88 +9331,6 @@ } private int connectServerCount = 0; - - /// - /// 还原球到实测库 - /// - private void refreshGlobe1() - { - //添加实测库图层已有图层 - int servernum = 0; - //1.清除global1上 - for (int i = globeControl1.Globe.Layers.Count - 1; i >= 0; i--) - { - GSOLayer layer = globeControl1.Globe.Layers[i]; - if (!layer.Name.Contains("fttp:")) - { - layer.Dataset.Close();//清除内存 - globeControl1.Globe.Layers.Remove(layer); - } - else - { - servernum++; - } - } - - //globeControl1.Globe.ConnectServer(Utility.serverip, Utility.serverport, "", ""); //加载locaServer中的数据 - - //2.添加实测库图层 - string[] markerStrs = new string[9]; - markerStrs[0] = "标高标注"; - markerStrs[1] = "管径标注"; - markerStrs[2] = "埋深标注"; - markerStrs[3] = "坐标标注"; - markerStrs[4] = "坡度标注"; - markerStrs[5] = "属性标注"; - markerStrs[6] = "自定义标注"; - markerStrs[7] = "距离标注"; - markerStrs[8] = "扯旗标注"; - for (int i = 0; i < markerStrs.Length; i++) - { - if (File.Exists(Application.StartupPath + "\\标注管理\\" + markerStrs[i] + ".lgd")) - { - GSOLayer markerLayer = globeControl1.Globe.Layers.Add(Application.StartupPath + "\\标注管理\\" + markerStrs[i] + ".lgd"); - } - } - - for (int i = 0; i < g1layername.Count; i++) - { - string g1name = g1layername[i]; - GSODataset datasetg1 = Utility.dataSource.GetDatasetByName(g1name); - GSOLayer templayer = globeControl1.Globe.Layers.Add(datasetg1); - templayer.MaxVisibleAltitude = -1; - } - layerTemp = globeControl1.Globe.Layers.Add(Application.StartupPath + "\\tempLgdData.lgd"); - globeControl1.Globe.Layers.Add(Application.StartupPath + "/城市七线/城市红线.lgd"); - globeControl1.Globe.Layers.Add(Application.StartupPath + "/城市七线/城市橙线.lgd"); - globeControl1.Globe.Layers.Add(Application.StartupPath + "/城市七线/城市黄线.lgd"); - globeControl1.Globe.Layers.Add(Application.StartupPath + "/城市七线/城市绿线.lgd"); - globeControl1.Globe.Layers.Add(Application.StartupPath + "/城市七线/城市蓝线.lgd"); - globeControl1.Globe.Layers.Add(Application.StartupPath + "/城市七线/城市紫线.lgd"); - globeControl1.Globe.Layers.Add(Application.StartupPath + "/城市七线/城市黑线.lgd"); - globeControl1.Globe.Layers.Add(Application.StartupPath + "/隧道.lgd"); - - //移动server的数据图层 - for (int i = 0; i < servernum; i++) - { - globeControl1.Globe.Layers.MoveTo(globeControl1.Globe.Layers.Count - 1, 0); - } - - if (layerManagerNode.Nodes.Count > 0) - { - for (int i = layerManagerNode.Nodes.Count - 1; i >= 0; i--) - { - layerManagerNode.Nodes[i].Remove(); - - } - } - - - - globeControl1.Refresh(); - - } - /// /// 碰撞审查 /// @@ -11476,31 +9604,7 @@ // } //} #endregion - /// - /// 数据质量检查 - /// - /// - /// - private void buttonItemSJGL2_Click(object sender, EventArgs e) - { - //日志记录 - LogManager.saveLog(Utility.userName, this.buttonItemSJGL2.Text); - FrmValiData frm = new FrmValiData(globeControl1); - frm.ShowDialog(); - } - /// - /// 数据预处理 - /// - /// - /// - private void buttonItemSJGL3_Click(object sender, EventArgs e) - { - //保存日志 - LogManager.saveLog(Utility.userName, this.buttonItemSJGL3.Text); - FrmEditShapeFile frm = new FrmEditShapeFile(globeControl1); - frm.ShowDialog(this); - } /// /// 连接数据库 /// @@ -12251,60 +10355,6 @@ List lineStruct = new List(); GSOFeature featureSelected = null; - private void AddDatagridView(DataTable table) - { - - if (table != null && table.Rows.Count > 0) - { - dataGridViewX1.DataSource = table; - panelOfTable.Visible = true; - panelOfTable.Height = 200; - toolStripNumbers.Text = "红线审核结果"; - toolStripFeatureLength.Text = " 共有:" + table.Rows.Count + "条"; - } - else - { - - } - - } - - /// - /// 去除集合中重复的管线 - /// - /// - /// - /// - private GSOFeatures getFeaturesByFilter(GSOFeatures features, string fieldName) - { - if (features == null) - { - return null; - } - GSOFeatures featuresGet = new GSOFeatures(); - for (int i = 0; i < features.Length; i++) - { - GSOFeature featureFromFS = features[i]; - string fieldValueFromFS = featureFromFS.GetValue(fieldName).ToString().Trim(); - bool isHas = false; - for (int j = featuresGet.Length - 1; j >= 0; j--) - { - GSOFeature featureFromFSGet = featuresGet[j]; - string fieldValueFromFSGet = featureFromFSGet.GetValue(fieldName).ToString().Trim(); - if (fieldValueFromFS.Equals(fieldValueFromFSGet)) - { - isHas = true; - break; - } - } - if (isHas == false) - { - featuresGet.Add(featureFromFS.Clone()); - } - } - return featuresGet; - } - /// /// 数据管理导入文件 /// @@ -12440,138 +10490,7 @@ // //MessageBox.Show("系统运行错误:" + ex.ToString(), "错误", MessageBoxButtons.OK, MessageBoxIcon.Error); // } //} - - - /// - /// 标识器全区域统计 - /// - /// - /// - private void 标识器分类统计ToolStripMenuItem_Click(object sender, EventArgs e) - { - globeControl1.Globe.Action = EnumAction3D.ActionNull; - FrmBSQStatis bsqStatis = new FrmBSQStatis(); - bsqStatis.Show(this); - } - /// - /// 标识器绘制区域统计 - /// - /// - /// - private void 标识器分类统计ToolStripMenuItem1_Click(object sender, EventArgs e) - { - trackflag = "BSQDuoBianXiangStatis"; - globeControl1.Globe.Action = EnumAction3D.TrackPolygon; - } - - - #region 保存和加载审核库加载的图层 - private void saveLayerList(TreeNodeCollection treeNodeList) - { - string configPath = Application.StartupPath + "\\configLayerList.xml"; - try - { - XmlDocument doc = new XmlDocument(); - doc.Load(configPath); - XmlNode dbParams = doc.SelectSingleNode("Params/dbparams"); - XmlNode dbLayers = doc.SelectSingleNode("Params/dblayers"); - XmlNode layers = doc.SelectSingleNode("Params/layers"); - dbParams.RemoveAll(); - dbLayers.RemoveAll(); - layers.RemoveAll(); - - List listDS = new List(); - String shDatasourceName = Utility.sgdbip + "/" + Utility.sgdbname + "_" + Utility.sgdbuser; - bool flag = false; - - for (int i = 0; i < globeControl1.Globe.DataManager.DataSourceCount; i++) - { - GSODataSource ds = globeControl1.Globe.DataManager.GetDataSourceAt(i); - if (ds != null && ds.Type == EnumDataSourceType.SqlServer || ds.Type == EnumDataSourceType.Oracle) - { - if (ds.Name == shDatasourceName) - { - //防止因为多次连接同一个数据库 - if (flag == true) - { - break; - } - flag = true; - listDS.Add(ds); - GSODataSourceCnn conn = ds.GetConnectionInfo(); - - XmlElement dbparam = doc.CreateElement("shdbparam"); - XmlElement ip = doc.CreateElement("ship"); - ip.InnerText = conn.Server; - - XmlElement dbname = doc.CreateElement("shdbname"); - dbname.InnerText = conn.Database; - - XmlElement username = doc.CreateElement("shusername"); - username.InnerText = conn.User; - - XmlElement password = doc.CreateElement("shpassword"); - password.InnerText = conn.Password; - - XmlElement type = doc.CreateElement("shtype"); - if (ds.Type == EnumDataSourceType.SqlServer) - { - type.InnerText = "sqlserver"; - } - else - { - type.InnerText = "oracle"; - } - - dbparam.AppendChild(ip); - dbparam.AppendChild(dbname); - dbparam.AppendChild(username); - dbparam.AppendChild(password); - dbparam.AppendChild(type); - dbParams.AppendChild(dbparam); - } - - } - } - - for (int i = 0; i < treeNodeList.Count; i++) - { - GSOLayer layer = treeNodeList[i].Tag as GSOLayer; - if (Path.GetExtension(layer.Name) == "") - { - XmlElement dbLayer = doc.CreateElement("dblayer"); - XmlAttribute attri = doc.CreateAttribute("dbindex"); - for (int j = 0; j < listDS.Count; j++) - { - if (layer.Dataset.DataSource.Name == listDS[j].Name) - { - attri.Value = j.ToString(); - break; - } - } - dbLayer.Attributes.Append(attri); - dbLayer.InnerText = layer.Name; - - dbLayers.AppendChild(dbLayer); - } - else - { - XmlElement dbLayer = doc.CreateElement("layer"); - dbLayer.InnerText = layer.Name; - layers.AppendChild(dbLayer); - } - } - - doc.Save(configPath); - } - catch (Exception e) - { - - } - } - - #endregion - + private void buttonItem_TaskManager_Click(object sender, EventArgs e) { if (Form_TaksManager.IS_OPEN) diff --git a/MainFrm.designer.cs b/MainFrm.designer.cs index 233ef8c..97b8299 100644 --- a/MainFrm.designer.cs +++ b/MainFrm.designer.cs @@ -82,6 +82,7 @@ this.sideBar1 = new DevComponents.DotNetBar.SideBar(); this.panelEx3 = new DevComponents.DotNetBar.PanelEx(); this.layerSensorTree = new System.Windows.Forms.TreeView(); + this.layerTree = new Cyberpipe.MyTreeView(); this.sideBarPanelItem3 = new DevComponents.DotNetBar.SideBarPanelItem(); this.controlContainerItem3 = new DevComponents.DotNetBar.ControlContainerItem(); this.sideBarPanelItem4 = new DevComponents.DotNetBar.SideBarPanelItem(); @@ -365,30 +366,26 @@ this.可编辑ToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); this.保存ToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); this.ribbonControl1 = new DevComponents.DotNetBar.RibbonControl(); - this.ribbonPanel1 = new DevComponents.DotNetBar.RibbonPanel(); - this.ribbonBar21 = new DevComponents.DotNetBar.RibbonBar(); - this.buttonItem87 = new DevComponents.DotNetBar.ButtonItem(); - this.buttonItem88 = new DevComponents.DotNetBar.ButtonItem(); - this.buttonItem27 = new DevComponents.DotNetBar.ButtonItem(); - this.buttonItem91 = new DevComponents.DotNetBar.ButtonItem(); - this.buttonItem1 = new DevComponents.DotNetBar.ButtonItem(); - this.btnlegendSet = new DevComponents.DotNetBar.ButtonItem(); - this.buttonItem89 = new DevComponents.DotNetBar.ButtonItem(); - this.ribbonPanel7 = new DevComponents.DotNetBar.RibbonPanel(); - this.ribbonBar5 = new DevComponents.DotNetBar.RibbonBar(); - this.btn_flag = new DevComponents.DotNetBar.ButtonItem(); - this.slider4ground = new DevComponents.DotNetBar.SliderItem(); - this.ribbonPanel2 = new DevComponents.DotNetBar.RibbonPanel(); - this.ribbonBar4 = new DevComponents.DotNetBar.RibbonBar(); - this.buttonItem_TaskManager = new DevComponents.DotNetBar.ButtonItem(); - this.buttonItem_OnlineTask = new DevComponents.DotNetBar.ButtonItem(); - this.buttonItem_Event = new DevComponents.DotNetBar.ButtonItem(); this.ribbonPanel3 = new DevComponents.DotNetBar.RibbonPanel(); this.ribbonBar3 = new DevComponents.DotNetBar.RibbonBar(); this.btn_device = new DevComponents.DotNetBar.ButtonItem(); this.btn_Person = new DevComponents.DotNetBar.ButtonItem(); this.btn_constructMap = new DevComponents.DotNetBar.ButtonItem(); this.buttonItem9 = new DevComponents.DotNetBar.ButtonItem(); + this.ribbonPanel2 = new DevComponents.DotNetBar.RibbonPanel(); + this.ribbonBar4 = new DevComponents.DotNetBar.RibbonBar(); + this.buttonItem_TaskManager = new DevComponents.DotNetBar.ButtonItem(); + this.buttonItem_OnlineTask = new DevComponents.DotNetBar.ButtonItem(); + this.buttonItem_Event = new DevComponents.DotNetBar.ButtonItem(); + this.ribbonPanel1 = new DevComponents.DotNetBar.RibbonPanel(); + this.ribbonBar21 = new DevComponents.DotNetBar.RibbonBar(); + this.buttonItem87 = new DevComponents.DotNetBar.ButtonItem(); + this.buttonItem88 = new DevComponents.DotNetBar.ButtonItem(); + this.buttonItem27 = new DevComponents.DotNetBar.ButtonItem(); + this.buttonItem1 = new DevComponents.DotNetBar.ButtonItem(); + this.buttonItem91 = new DevComponents.DotNetBar.ButtonItem(); + this.btnlegendSet = new DevComponents.DotNetBar.ButtonItem(); + this.buttonItem89 = new DevComponents.DotNetBar.ButtonItem(); this.ribbonPanel8 = new DevComponents.DotNetBar.RibbonPanel(); this.ribbonBar_UserInfo = new DevComponents.DotNetBar.RibbonBar(); this.btn_user_info = new DevComponents.DotNetBar.ButtonItem(); @@ -398,6 +395,10 @@ this.btn_user_role = new DevComponents.DotNetBar.ButtonItem(); this.btn_password_edit = new DevComponents.DotNetBar.ButtonItem(); this.btn_reset_password = new DevComponents.DotNetBar.ButtonItem(); + this.ribbonPanel7 = new DevComponents.DotNetBar.RibbonPanel(); + this.ribbonBar5 = new DevComponents.DotNetBar.RibbonBar(); + this.btn_flag = new DevComponents.DotNetBar.ButtonItem(); + this.slider4ground = new DevComponents.DotNetBar.SliderItem(); this.ribbonPanel15 = new DevComponents.DotNetBar.RibbonPanel(); this.ribbonBar20 = new DevComponents.DotNetBar.RibbonBar(); this.buttonItemSJGL = new DevComponents.DotNetBar.ButtonItem(); @@ -610,7 +611,6 @@ this.buttonItem84 = new DevComponents.DotNetBar.ButtonItem(); this.buttonItem75 = new DevComponents.DotNetBar.ButtonItem(); this.buttonItem76 = new DevComponents.DotNetBar.ButtonItem(); - this.layerTree = new Cyberpipe.MyTreeView(); this.statusStrip1.SuspendLayout(); this.sideBar1.SuspendLayout(); this.panelEx3.SuspendLayout(); @@ -647,11 +647,11 @@ this.contextMenuStrip3.SuspendLayout(); this.contextMenuStripDeleteLayerNode.SuspendLayout(); this.ribbonControl1.SuspendLayout(); - this.ribbonPanel1.SuspendLayout(); - this.ribbonPanel7.SuspendLayout(); - this.ribbonPanel2.SuspendLayout(); this.ribbonPanel3.SuspendLayout(); + this.ribbonPanel2.SuspendLayout(); + this.ribbonPanel1.SuspendLayout(); this.ribbonPanel8.SuspendLayout(); + this.ribbonPanel7.SuspendLayout(); this.ribbonPanel15.SuspendLayout(); ((System.ComponentModel.ISupportInitialize)(this.pictureBox1)).BeginInit(); this.SuspendLayout(); @@ -813,7 +813,6 @@ this.toolStripDropDownButton1.Size = new System.Drawing.Size(45, 21); this.toolStripDropDownButton1.Text = "帮助"; this.toolStripDropDownButton1.Visible = false; - this.toolStripDropDownButton1.Click += new System.EventHandler(this.toolStripDropDownButton1_Click); // // controlContainerItem1 // @@ -1047,6 +1046,16 @@ this.layerSensorTree.AfterCheck += new System.Windows.Forms.TreeViewEventHandler(this.layerMarkerTree_AfterCheck); this.layerSensorTree.NodeMouseClick += new System.Windows.Forms.TreeNodeMouseClickEventHandler(this.layerMarkerTree_NodeMouseClick); // + // layerTree + // + this.layerTree.CheckBoxes = true; + this.layerTree.ItemHeight = 18; + this.layerTree.Location = new System.Drawing.Point(30, 78); + this.layerTree.Name = "layerTree"; + this.layerTree.Size = new System.Drawing.Size(121, 97); + this.layerTree.TabIndex = 1; + this.layerTree.AfterCheck += new System.Windows.Forms.TreeViewEventHandler(this.layerTree_AfterCheck); + // // sideBarPanelItem3 // this.sideBarPanelItem3.FontBold = true; @@ -2966,28 +2975,28 @@ // 平移对象ToolStripMenuItem // this.平移对象ToolStripMenuItem.Name = "平移对象ToolStripMenuItem"; - this.平移对象ToolStripMenuItem.Size = new System.Drawing.Size(152, 22); + this.平移对象ToolStripMenuItem.Size = new System.Drawing.Size(124, 22); this.平移对象ToolStripMenuItem.Text = "平移对象"; this.平移对象ToolStripMenuItem.Click += new System.EventHandler(this.buttonItemBJ6_Click); // // 升降对象ToolStripMenuItem // this.升降对象ToolStripMenuItem.Name = "升降对象ToolStripMenuItem"; - this.升降对象ToolStripMenuItem.Size = new System.Drawing.Size(152, 22); + this.升降对象ToolStripMenuItem.Size = new System.Drawing.Size(124, 22); this.升降对象ToolStripMenuItem.Text = "升降对象"; this.升降对象ToolStripMenuItem.Click += new System.EventHandler(this.buttonItemBJ7_Click); // // 旋转对象ToolStripMenuItem // this.旋转对象ToolStripMenuItem.Name = "旋转对象ToolStripMenuItem"; - this.旋转对象ToolStripMenuItem.Size = new System.Drawing.Size(152, 22); + this.旋转对象ToolStripMenuItem.Size = new System.Drawing.Size(124, 22); this.旋转对象ToolStripMenuItem.Text = "旋转对象"; this.旋转对象ToolStripMenuItem.Click += new System.EventHandler(this.buttonItemBJ8_Click); // // 连接管段ToolStripMenuItem // this.连接管段ToolStripMenuItem.Name = "连接管段ToolStripMenuItem"; - this.连接管段ToolStripMenuItem.Size = new System.Drawing.Size(152, 22); + this.连接管段ToolStripMenuItem.Size = new System.Drawing.Size(124, 22); this.连接管段ToolStripMenuItem.Text = "连接管段"; this.连接管段ToolStripMenuItem.Click += new System.EventHandler(this.buttonItemBJ9_Click); // @@ -2997,34 +3006,34 @@ this.导出CADToolStripMenuItem, this.导出文件ToolStripMenuItem1}); this.导出文件ToolStripMenuItem.Name = "导出文件ToolStripMenuItem"; - this.导出文件ToolStripMenuItem.Size = new System.Drawing.Size(152, 22); + this.导出文件ToolStripMenuItem.Size = new System.Drawing.Size(124, 22); this.导出文件ToolStripMenuItem.Text = "导出矢量"; // // 导出CADToolStripMenuItem // this.导出CADToolStripMenuItem.Name = "导出CADToolStripMenuItem"; - this.导出CADToolStripMenuItem.Size = new System.Drawing.Size(152, 22); + this.导出CADToolStripMenuItem.Size = new System.Drawing.Size(125, 22); this.导出CADToolStripMenuItem.Text = "导出CAD"; this.导出CADToolStripMenuItem.Click += new System.EventHandler(this.buttonItemBJ10_1_Click); // // 导出文件ToolStripMenuItem1 // this.导出文件ToolStripMenuItem1.Name = "导出文件ToolStripMenuItem1"; - this.导出文件ToolStripMenuItem1.Size = new System.Drawing.Size(152, 22); + this.导出文件ToolStripMenuItem1.Size = new System.Drawing.Size(125, 22); this.导出文件ToolStripMenuItem1.Text = "导出文件"; this.导出文件ToolStripMenuItem1.Click += new System.EventHandler(this.buttonItemBJ10_2_Click); // // 前进ToolStripMenuItem // this.前进ToolStripMenuItem.Name = "前进ToolStripMenuItem"; - this.前进ToolStripMenuItem.Size = new System.Drawing.Size(152, 22); + this.前进ToolStripMenuItem.Size = new System.Drawing.Size(124, 22); this.前进ToolStripMenuItem.Text = "前进"; this.前进ToolStripMenuItem.Click += new System.EventHandler(this.buttonItemBJ12_Click); // // 删除模型ToolStripMenuItem // this.删除模型ToolStripMenuItem.Name = "删除模型ToolStripMenuItem"; - this.删除模型ToolStripMenuItem.Size = new System.Drawing.Size(152, 22); + this.删除模型ToolStripMenuItem.Size = new System.Drawing.Size(124, 22); this.删除模型ToolStripMenuItem.Text = "后退"; this.删除模型ToolStripMenuItem.Click += new System.EventHandler(this.buttonItemBJ11_Click); // @@ -4160,6 +4169,198 @@ this.ribbonControl1.Text = "ribbonControl1"; this.ribbonControl1.UseCustomizeDialog = false; // + // ribbonPanel3 + // + this.ribbonPanel3.ColorSchemeStyle = DevComponents.DotNetBar.eDotNetBarStyle.StyleManagerControlled; + this.ribbonPanel3.Controls.Add(this.ribbonBar3); + this.ribbonPanel3.Dock = System.Windows.Forms.DockStyle.Fill; + this.ribbonPanel3.Location = new System.Drawing.Point(0, 33); + this.ribbonPanel3.Name = "ribbonPanel3"; + this.ribbonPanel3.Padding = new System.Windows.Forms.Padding(3, 0, 3, 3); + this.ribbonPanel3.Size = new System.Drawing.Size(1328, 62); + // + // + // + this.ribbonPanel3.Style.Class = ""; + this.ribbonPanel3.Style.CornerType = DevComponents.DotNetBar.eCornerType.Square; + // + // + // + this.ribbonPanel3.StyleMouseDown.Class = ""; + this.ribbonPanel3.StyleMouseDown.CornerType = DevComponents.DotNetBar.eCornerType.Square; + // + // + // + this.ribbonPanel3.StyleMouseOver.Class = ""; + this.ribbonPanel3.StyleMouseOver.CornerType = DevComponents.DotNetBar.eCornerType.Square; + this.ribbonPanel3.TabIndex = 40; + // + // ribbonBar3 + // + this.ribbonBar3.AutoOverflowEnabled = true; + // + // + // + this.ribbonBar3.BackgroundMouseOverStyle.Class = ""; + this.ribbonBar3.BackgroundMouseOverStyle.CornerType = DevComponents.DotNetBar.eCornerType.Square; + // + // + // + this.ribbonBar3.BackgroundStyle.Class = ""; + this.ribbonBar3.BackgroundStyle.CornerType = DevComponents.DotNetBar.eCornerType.Square; + this.ribbonBar3.ContainerControlProcessDialogKey = true; + this.ribbonBar3.Dock = System.Windows.Forms.DockStyle.Left; + this.ribbonBar3.Items.AddRange(new DevComponents.DotNetBar.BaseItem[] { + this.btn_device, + this.btn_Person, + this.btn_constructMap, + this.buttonItem9}); + this.ribbonBar3.Location = new System.Drawing.Point(3, 0); + this.ribbonBar3.Name = "ribbonBar3"; + this.ribbonBar3.Size = new System.Drawing.Size(378, 59); + this.ribbonBar3.Style = DevComponents.DotNetBar.eDotNetBarStyle.StyleManagerControlled; + this.ribbonBar3.TabIndex = 0; + // + // + // + this.ribbonBar3.TitleStyle.Class = ""; + this.ribbonBar3.TitleStyle.CornerType = DevComponents.DotNetBar.eCornerType.Square; + // + // + // + this.ribbonBar3.TitleStyleMouseOver.Class = ""; + this.ribbonBar3.TitleStyleMouseOver.CornerType = DevComponents.DotNetBar.eCornerType.Square; + this.ribbonBar3.TitleVisible = false; + // + // btn_device + // + this.btn_device.ButtonStyle = DevComponents.DotNetBar.eButtonStyle.ImageAndText; + this.btn_device.Image = global::Cyberpipe.Properties.Resources._24X24__2__02; + this.btn_device.ImagePosition = DevComponents.DotNetBar.eImagePosition.Top; + this.btn_device.Name = "btn_device"; + this.btn_device.SubItemsExpandWidth = 14; + this.btn_device.Text = "探测仪管理"; + this.btn_device.Click += new System.EventHandler(this.btn_device_Click); + // + // btn_Person + // + this.btn_Person.ButtonStyle = DevComponents.DotNetBar.eButtonStyle.ImageAndText; + this.btn_Person.Image = global::Cyberpipe.Properties.Resources._24x24icon_05_hover1; + this.btn_Person.ImagePosition = DevComponents.DotNetBar.eImagePosition.Top; + this.btn_Person.Name = "btn_Person"; + this.btn_Person.SubItemsExpandWidth = 14; + this.btn_Person.Text = "定位人员维护"; + this.btn_Person.Click += new System.EventHandler(this.btn_Person_Click); + // + // btn_constructMap + // + this.btn_constructMap.Image = global::Cyberpipe.Properties.Resources._24x24icon_04_hover; + this.btn_constructMap.ImagePosition = DevComponents.DotNetBar.eImagePosition.Top; + this.btn_constructMap.Name = "btn_constructMap"; + this.btn_constructMap.SubItemsExpandWidth = 14; + this.btn_constructMap.Text = "导出施工图"; + this.btn_constructMap.Click += new System.EventHandler(this.btn_constructMap_Click); + // + // buttonItem9 + // + this.buttonItem9.Image = global::Cyberpipe.Properties.Resources._24x24icon__2__10; + this.buttonItem9.ImagePosition = DevComponents.DotNetBar.eImagePosition.Top; + this.buttonItem9.Name = "buttonItem9"; + this.buttonItem9.SubItemsExpandWidth = 14; + this.buttonItem9.Text = "文档管理"; + this.buttonItem9.Click += new System.EventHandler(this.buttonItem9_Click); + // + // ribbonPanel2 + // + this.ribbonPanel2.ColorSchemeStyle = DevComponents.DotNetBar.eDotNetBarStyle.StyleManagerControlled; + this.ribbonPanel2.Controls.Add(this.ribbonBar4); + this.ribbonPanel2.Dock = System.Windows.Forms.DockStyle.Fill; + this.ribbonPanel2.Location = new System.Drawing.Point(0, 0); + this.ribbonPanel2.Name = "ribbonPanel2"; + this.ribbonPanel2.Padding = new System.Windows.Forms.Padding(3, 0, 3, 3); + this.ribbonPanel2.Size = new System.Drawing.Size(1328, 95); + // + // + // + this.ribbonPanel2.Style.Class = ""; + this.ribbonPanel2.Style.CornerType = DevComponents.DotNetBar.eCornerType.Square; + // + // + // + this.ribbonPanel2.StyleMouseDown.Class = ""; + this.ribbonPanel2.StyleMouseDown.CornerType = DevComponents.DotNetBar.eCornerType.Square; + // + // + // + this.ribbonPanel2.StyleMouseOver.Class = ""; + this.ribbonPanel2.StyleMouseOver.CornerType = DevComponents.DotNetBar.eCornerType.Square; + this.ribbonPanel2.TabIndex = 39; + this.ribbonPanel2.Visible = false; + // + // ribbonBar4 + // + this.ribbonBar4.AutoOverflowEnabled = true; + // + // + // + this.ribbonBar4.BackgroundMouseOverStyle.Class = ""; + this.ribbonBar4.BackgroundMouseOverStyle.CornerType = DevComponents.DotNetBar.eCornerType.Square; + // + // + // + this.ribbonBar4.BackgroundStyle.Class = ""; + this.ribbonBar4.BackgroundStyle.CornerType = DevComponents.DotNetBar.eCornerType.Square; + this.ribbonBar4.ContainerControlProcessDialogKey = true; + this.ribbonBar4.Dock = System.Windows.Forms.DockStyle.Left; + this.ribbonBar4.Items.AddRange(new DevComponents.DotNetBar.BaseItem[] { + this.buttonItem_TaskManager, + this.buttonItem_OnlineTask, + this.buttonItem_Event}); + this.ribbonBar4.Location = new System.Drawing.Point(3, 0); + this.ribbonBar4.Name = "ribbonBar4"; + this.ribbonBar4.Size = new System.Drawing.Size(299, 92); + this.ribbonBar4.Style = DevComponents.DotNetBar.eDotNetBarStyle.StyleManagerControlled; + this.ribbonBar4.TabIndex = 0; + this.ribbonBar4.Text = "ribbonBar4"; + // + // + // + this.ribbonBar4.TitleStyle.Class = ""; + this.ribbonBar4.TitleStyle.CornerType = DevComponents.DotNetBar.eCornerType.Square; + // + // + // + this.ribbonBar4.TitleStyleMouseOver.Class = ""; + this.ribbonBar4.TitleStyleMouseOver.CornerType = DevComponents.DotNetBar.eCornerType.Square; + this.ribbonBar4.TitleVisible = false; + // + // buttonItem_TaskManager + // + this.buttonItem_TaskManager.Image = global::Cyberpipe.Properties.Resources._24x24icon__2__76; + this.buttonItem_TaskManager.ImagePosition = DevComponents.DotNetBar.eImagePosition.Top; + this.buttonItem_TaskManager.Name = "buttonItem_TaskManager"; + this.buttonItem_TaskManager.SubItemsExpandWidth = 14; + this.buttonItem_TaskManager.Text = "工单管理"; + this.buttonItem_TaskManager.Click += new System.EventHandler(this.buttonItem_TaskManager_Click); + // + // buttonItem_OnlineTask + // + this.buttonItem_OnlineTask.Image = global::Cyberpipe.Properties.Resources._24x24icon__2__69; + this.buttonItem_OnlineTask.ImagePosition = DevComponents.DotNetBar.eImagePosition.Top; + this.buttonItem_OnlineTask.Name = "buttonItem_OnlineTask"; + this.buttonItem_OnlineTask.SubItemsExpandWidth = 14; + this.buttonItem_OnlineTask.Text = "在线任务"; + this.buttonItem_OnlineTask.Click += new System.EventHandler(this.buttonItem_OnlineTask_Click); + // + // buttonItem_Event + // + this.buttonItem_Event.Image = global::Cyberpipe.Properties.Resources._24x24icon__2__72; + this.buttonItem_Event.ImagePosition = DevComponents.DotNetBar.eImagePosition.Top; + this.buttonItem_Event.Name = "buttonItem_Event"; + this.buttonItem_Event.SubItemsExpandWidth = 14; + this.buttonItem_Event.Text = "事件管理"; + this.buttonItem_Event.Click += new System.EventHandler(this.buttonItem_Event_Click); + // // ribbonPanel1 // this.ribbonPanel1.AutoSize = true; @@ -4262,6 +4463,15 @@ this.buttonItem27.Visible = false; this.buttonItem27.Click += new System.EventHandler(this.buttonItem27_Click); // + // buttonItem1 + // + this.buttonItem1.Image = global::Cyberpipe.Properties.Resources._24x24icon__2__94; + this.buttonItem1.ImagePosition = DevComponents.DotNetBar.eImagePosition.Top; + this.buttonItem1.Name = "buttonItem1"; + this.buttonItem1.SubItemsExpandWidth = 14; + this.buttonItem1.Text = "图层管理"; + this.buttonItem1.Click += new System.EventHandler(this.buttonItem1_Click); + // // buttonItem91 // this.buttonItem91.ForeColor = System.Drawing.Color.Black; @@ -4272,15 +4482,6 @@ this.buttonItem91.Text = "快速定位"; this.buttonItem91.Click += new System.EventHandler(this.buttonItem91_Click); // - // buttonItem1 - // - this.buttonItem1.Image = global::Cyberpipe.Properties.Resources._24x24icon__2__94; - this.buttonItem1.ImagePosition = DevComponents.DotNetBar.eImagePosition.Top; - this.buttonItem1.Name = "buttonItem1"; - this.buttonItem1.SubItemsExpandWidth = 14; - this.buttonItem1.Text = "图层管理"; - this.buttonItem1.Click += new System.EventHandler(this.buttonItem1_Click); - // // btnlegendSet // this.btnlegendSet.Image = global::Cyberpipe.Properties.Resources._24x24icon__2__93; @@ -4300,278 +4501,6 @@ this.buttonItem89.Visible = false; this.buttonItem89.Click += new System.EventHandler(this.buttonItem89_Click); // - // ribbonPanel7 - // - this.ribbonPanel7.ColorSchemeStyle = DevComponents.DotNetBar.eDotNetBarStyle.StyleManagerControlled; - this.ribbonPanel7.Controls.Add(this.ribbonBar5); - this.ribbonPanel7.Dock = System.Windows.Forms.DockStyle.Fill; - this.ribbonPanel7.Location = new System.Drawing.Point(0, 0); - this.ribbonPanel7.Name = "ribbonPanel7"; - this.ribbonPanel7.Padding = new System.Windows.Forms.Padding(3, 0, 3, 3); - this.ribbonPanel7.Size = new System.Drawing.Size(1328, 95); - // - // - // - this.ribbonPanel7.Style.Class = ""; - this.ribbonPanel7.Style.CornerType = DevComponents.DotNetBar.eCornerType.Square; - // - // - // - this.ribbonPanel7.StyleMouseDown.Class = ""; - this.ribbonPanel7.StyleMouseDown.CornerType = DevComponents.DotNetBar.eCornerType.Square; - // - // - // - this.ribbonPanel7.StyleMouseOver.Class = ""; - this.ribbonPanel7.StyleMouseOver.CornerType = DevComponents.DotNetBar.eCornerType.Square; - this.ribbonPanel7.TabIndex = 41; - this.ribbonPanel7.Visible = false; - // - // ribbonBar5 - // - this.ribbonBar5.AutoOverflowEnabled = true; - // - // - // - this.ribbonBar5.BackgroundMouseOverStyle.Class = ""; - this.ribbonBar5.BackgroundMouseOverStyle.CornerType = DevComponents.DotNetBar.eCornerType.Square; - // - // - // - this.ribbonBar5.BackgroundStyle.Class = ""; - this.ribbonBar5.BackgroundStyle.CornerType = DevComponents.DotNetBar.eCornerType.Square; - this.ribbonBar5.ContainerControlProcessDialogKey = true; - this.ribbonBar5.Dock = System.Windows.Forms.DockStyle.Left; - this.ribbonBar5.Items.AddRange(new DevComponents.DotNetBar.BaseItem[] { - this.btn_flag, - this.slider4ground}); - this.ribbonBar5.Location = new System.Drawing.Point(3, 0); - this.ribbonBar5.Name = "ribbonBar5"; - this.ribbonBar5.Size = new System.Drawing.Size(418, 92); - this.ribbonBar5.Style = DevComponents.DotNetBar.eDotNetBarStyle.StyleManagerControlled; - this.ribbonBar5.TabIndex = 0; - // - // - // - this.ribbonBar5.TitleStyle.Class = ""; - this.ribbonBar5.TitleStyle.CornerType = DevComponents.DotNetBar.eCornerType.Square; - // - // - // - this.ribbonBar5.TitleStyleMouseOver.Class = ""; - this.ribbonBar5.TitleStyleMouseOver.CornerType = DevComponents.DotNetBar.eCornerType.Square; - this.ribbonBar5.TitleVisible = false; - this.ribbonBar5.ItemClick += new System.EventHandler(this.ribbonBar5_ItemClick); - // - // btn_flag - // - this.btn_flag.Image = global::Cyberpipe.Properties.Resources._24x24icon_03_hover; - this.btn_flag.ImagePosition = DevComponents.DotNetBar.eImagePosition.Top; - this.btn_flag.Name = "btn_flag"; - this.btn_flag.SubItemsExpandWidth = 14; - this.btn_flag.Text = "标识器管理"; - this.btn_flag.Click += new System.EventHandler(this.btn_flag_Click); - // - // slider4ground - // - this.slider4ground.LabelPosition = DevComponents.DotNetBar.eSliderLabelPosition.Top; - this.slider4ground.Name = "slider4ground"; - this.slider4ground.Text = "地面透明度"; - this.slider4ground.Value = 0; - this.slider4ground.ValueChanged += new System.EventHandler(this.slider4ground_ValueChanged); - // - // ribbonPanel2 - // - this.ribbonPanel2.ColorSchemeStyle = DevComponents.DotNetBar.eDotNetBarStyle.StyleManagerControlled; - this.ribbonPanel2.Controls.Add(this.ribbonBar4); - this.ribbonPanel2.Dock = System.Windows.Forms.DockStyle.Fill; - this.ribbonPanel2.Location = new System.Drawing.Point(0, 0); - this.ribbonPanel2.Name = "ribbonPanel2"; - this.ribbonPanel2.Padding = new System.Windows.Forms.Padding(3, 0, 3, 3); - this.ribbonPanel2.Size = new System.Drawing.Size(1328, 95); - // - // - // - this.ribbonPanel2.Style.Class = ""; - this.ribbonPanel2.Style.CornerType = DevComponents.DotNetBar.eCornerType.Square; - // - // - // - this.ribbonPanel2.StyleMouseDown.Class = ""; - this.ribbonPanel2.StyleMouseDown.CornerType = DevComponents.DotNetBar.eCornerType.Square; - // - // - // - this.ribbonPanel2.StyleMouseOver.Class = ""; - this.ribbonPanel2.StyleMouseOver.CornerType = DevComponents.DotNetBar.eCornerType.Square; - this.ribbonPanel2.TabIndex = 39; - this.ribbonPanel2.Visible = false; - // - // ribbonBar4 - // - this.ribbonBar4.AutoOverflowEnabled = true; - // - // - // - this.ribbonBar4.BackgroundMouseOverStyle.Class = ""; - this.ribbonBar4.BackgroundMouseOverStyle.CornerType = DevComponents.DotNetBar.eCornerType.Square; - // - // - // - this.ribbonBar4.BackgroundStyle.Class = ""; - this.ribbonBar4.BackgroundStyle.CornerType = DevComponents.DotNetBar.eCornerType.Square; - this.ribbonBar4.ContainerControlProcessDialogKey = true; - this.ribbonBar4.Dock = System.Windows.Forms.DockStyle.Left; - this.ribbonBar4.Items.AddRange(new DevComponents.DotNetBar.BaseItem[] { - this.buttonItem_TaskManager, - this.buttonItem_OnlineTask, - this.buttonItem_Event}); - this.ribbonBar4.Location = new System.Drawing.Point(3, 0); - this.ribbonBar4.Name = "ribbonBar4"; - this.ribbonBar4.Size = new System.Drawing.Size(299, 92); - this.ribbonBar4.Style = DevComponents.DotNetBar.eDotNetBarStyle.StyleManagerControlled; - this.ribbonBar4.TabIndex = 0; - this.ribbonBar4.Text = "ribbonBar4"; - // - // - // - this.ribbonBar4.TitleStyle.Class = ""; - this.ribbonBar4.TitleStyle.CornerType = DevComponents.DotNetBar.eCornerType.Square; - // - // - // - this.ribbonBar4.TitleStyleMouseOver.Class = ""; - this.ribbonBar4.TitleStyleMouseOver.CornerType = DevComponents.DotNetBar.eCornerType.Square; - this.ribbonBar4.TitleVisible = false; - // - // buttonItem_TaskManager - // - this.buttonItem_TaskManager.Image = global::Cyberpipe.Properties.Resources._24x24icon__2__76; - this.buttonItem_TaskManager.ImagePosition = DevComponents.DotNetBar.eImagePosition.Top; - this.buttonItem_TaskManager.Name = "buttonItem_TaskManager"; - this.buttonItem_TaskManager.SubItemsExpandWidth = 14; - this.buttonItem_TaskManager.Text = "工单管理"; - this.buttonItem_TaskManager.Click += new System.EventHandler(this.buttonItem_TaskManager_Click); - // - // buttonItem_OnlineTask - // - this.buttonItem_OnlineTask.Image = global::Cyberpipe.Properties.Resources._24x24icon__2__69; - this.buttonItem_OnlineTask.ImagePosition = DevComponents.DotNetBar.eImagePosition.Top; - this.buttonItem_OnlineTask.Name = "buttonItem_OnlineTask"; - this.buttonItem_OnlineTask.SubItemsExpandWidth = 14; - this.buttonItem_OnlineTask.Text = "在线任务"; - this.buttonItem_OnlineTask.Click += new System.EventHandler(this.buttonItem_OnlineTask_Click); - // - // buttonItem_Event - // - this.buttonItem_Event.Image = global::Cyberpipe.Properties.Resources._24x24icon__2__72; - this.buttonItem_Event.ImagePosition = DevComponents.DotNetBar.eImagePosition.Top; - this.buttonItem_Event.Name = "buttonItem_Event"; - this.buttonItem_Event.SubItemsExpandWidth = 14; - this.buttonItem_Event.Text = "事件管理"; - this.buttonItem_Event.Click += new System.EventHandler(this.buttonItem_Event_Click); - // - // ribbonPanel3 - // - this.ribbonPanel3.ColorSchemeStyle = DevComponents.DotNetBar.eDotNetBarStyle.StyleManagerControlled; - this.ribbonPanel3.Controls.Add(this.ribbonBar3); - this.ribbonPanel3.Dock = System.Windows.Forms.DockStyle.Fill; - this.ribbonPanel3.Location = new System.Drawing.Point(0, 33); - this.ribbonPanel3.Name = "ribbonPanel3"; - this.ribbonPanel3.Padding = new System.Windows.Forms.Padding(3, 0, 3, 3); - this.ribbonPanel3.Size = new System.Drawing.Size(1328, 62); - // - // - // - this.ribbonPanel3.Style.Class = ""; - this.ribbonPanel3.Style.CornerType = DevComponents.DotNetBar.eCornerType.Square; - // - // - // - this.ribbonPanel3.StyleMouseDown.Class = ""; - this.ribbonPanel3.StyleMouseDown.CornerType = DevComponents.DotNetBar.eCornerType.Square; - // - // - // - this.ribbonPanel3.StyleMouseOver.Class = ""; - this.ribbonPanel3.StyleMouseOver.CornerType = DevComponents.DotNetBar.eCornerType.Square; - this.ribbonPanel3.TabIndex = 40; - // - // ribbonBar3 - // - this.ribbonBar3.AutoOverflowEnabled = true; - // - // - // - this.ribbonBar3.BackgroundMouseOverStyle.Class = ""; - this.ribbonBar3.BackgroundMouseOverStyle.CornerType = DevComponents.DotNetBar.eCornerType.Square; - // - // - // - this.ribbonBar3.BackgroundStyle.Class = ""; - this.ribbonBar3.BackgroundStyle.CornerType = DevComponents.DotNetBar.eCornerType.Square; - this.ribbonBar3.ContainerControlProcessDialogKey = true; - this.ribbonBar3.Dock = System.Windows.Forms.DockStyle.Left; - this.ribbonBar3.Items.AddRange(new DevComponents.DotNetBar.BaseItem[] { - this.btn_device, - this.btn_Person, - this.btn_constructMap, - this.buttonItem9}); - this.ribbonBar3.Location = new System.Drawing.Point(3, 0); - this.ribbonBar3.Name = "ribbonBar3"; - this.ribbonBar3.Size = new System.Drawing.Size(378, 59); - this.ribbonBar3.Style = DevComponents.DotNetBar.eDotNetBarStyle.StyleManagerControlled; - this.ribbonBar3.TabIndex = 0; - // - // - // - this.ribbonBar3.TitleStyle.Class = ""; - this.ribbonBar3.TitleStyle.CornerType = DevComponents.DotNetBar.eCornerType.Square; - // - // - // - this.ribbonBar3.TitleStyleMouseOver.Class = ""; - this.ribbonBar3.TitleStyleMouseOver.CornerType = DevComponents.DotNetBar.eCornerType.Square; - this.ribbonBar3.TitleVisible = false; - // - // btn_device - // - this.btn_device.ButtonStyle = DevComponents.DotNetBar.eButtonStyle.ImageAndText; - this.btn_device.Image = global::Cyberpipe.Properties.Resources._24X24__2__02; - this.btn_device.ImagePosition = DevComponents.DotNetBar.eImagePosition.Top; - this.btn_device.Name = "btn_device"; - this.btn_device.SubItemsExpandWidth = 14; - this.btn_device.Text = "探测仪管理"; - this.btn_device.Click += new System.EventHandler(this.btn_device_Click); - // - // btn_Person - // - this.btn_Person.ButtonStyle = DevComponents.DotNetBar.eButtonStyle.ImageAndText; - this.btn_Person.Image = global::Cyberpipe.Properties.Resources._24x24icon_05_hover1; - this.btn_Person.ImagePosition = DevComponents.DotNetBar.eImagePosition.Top; - this.btn_Person.Name = "btn_Person"; - this.btn_Person.SubItemsExpandWidth = 14; - this.btn_Person.Text = "定位人员维护"; - this.btn_Person.Click += new System.EventHandler(this.btn_Person_Click); - // - // btn_constructMap - // - this.btn_constructMap.Image = global::Cyberpipe.Properties.Resources._24x24icon_04_hover; - this.btn_constructMap.ImagePosition = DevComponents.DotNetBar.eImagePosition.Top; - this.btn_constructMap.Name = "btn_constructMap"; - this.btn_constructMap.SubItemsExpandWidth = 14; - this.btn_constructMap.Text = "导出施工图"; - this.btn_constructMap.Click += new System.EventHandler(this.btn_constructMap_Click); - // - // buttonItem9 - // - this.buttonItem9.Image = global::Cyberpipe.Properties.Resources._24x24icon__2__10; - this.buttonItem9.ImagePosition = DevComponents.DotNetBar.eImagePosition.Top; - this.buttonItem9.Name = "buttonItem9"; - this.buttonItem9.SubItemsExpandWidth = 14; - this.buttonItem9.Text = "文档管理"; - this.buttonItem9.Click += new System.EventHandler(this.buttonItem9_Click); - // // ribbonPanel8 // this.ribbonPanel8.ColorSchemeStyle = DevComponents.DotNetBar.eDotNetBarStyle.StyleManagerControlled; @@ -4696,6 +4625,86 @@ this.btn_reset_password.Text = "重置密码"; this.btn_reset_password.Click += new System.EventHandler(this.btn_reset_password_Click); // + // ribbonPanel7 + // + this.ribbonPanel7.ColorSchemeStyle = DevComponents.DotNetBar.eDotNetBarStyle.StyleManagerControlled; + this.ribbonPanel7.Controls.Add(this.ribbonBar5); + this.ribbonPanel7.Dock = System.Windows.Forms.DockStyle.Fill; + this.ribbonPanel7.Location = new System.Drawing.Point(0, 0); + this.ribbonPanel7.Name = "ribbonPanel7"; + this.ribbonPanel7.Padding = new System.Windows.Forms.Padding(3, 0, 3, 3); + this.ribbonPanel7.Size = new System.Drawing.Size(1328, 95); + // + // + // + this.ribbonPanel7.Style.Class = ""; + this.ribbonPanel7.Style.CornerType = DevComponents.DotNetBar.eCornerType.Square; + // + // + // + this.ribbonPanel7.StyleMouseDown.Class = ""; + this.ribbonPanel7.StyleMouseDown.CornerType = DevComponents.DotNetBar.eCornerType.Square; + // + // + // + this.ribbonPanel7.StyleMouseOver.Class = ""; + this.ribbonPanel7.StyleMouseOver.CornerType = DevComponents.DotNetBar.eCornerType.Square; + this.ribbonPanel7.TabIndex = 41; + this.ribbonPanel7.Visible = false; + // + // ribbonBar5 + // + this.ribbonBar5.AutoOverflowEnabled = true; + // + // + // + this.ribbonBar5.BackgroundMouseOverStyle.Class = ""; + this.ribbonBar5.BackgroundMouseOverStyle.CornerType = DevComponents.DotNetBar.eCornerType.Square; + // + // + // + this.ribbonBar5.BackgroundStyle.Class = ""; + this.ribbonBar5.BackgroundStyle.CornerType = DevComponents.DotNetBar.eCornerType.Square; + this.ribbonBar5.ContainerControlProcessDialogKey = true; + this.ribbonBar5.Dock = System.Windows.Forms.DockStyle.Left; + this.ribbonBar5.Items.AddRange(new DevComponents.DotNetBar.BaseItem[] { + this.btn_flag, + this.slider4ground}); + this.ribbonBar5.Location = new System.Drawing.Point(3, 0); + this.ribbonBar5.Name = "ribbonBar5"; + this.ribbonBar5.Size = new System.Drawing.Size(418, 92); + this.ribbonBar5.Style = DevComponents.DotNetBar.eDotNetBarStyle.StyleManagerControlled; + this.ribbonBar5.TabIndex = 0; + // + // + // + this.ribbonBar5.TitleStyle.Class = ""; + this.ribbonBar5.TitleStyle.CornerType = DevComponents.DotNetBar.eCornerType.Square; + // + // + // + this.ribbonBar5.TitleStyleMouseOver.Class = ""; + this.ribbonBar5.TitleStyleMouseOver.CornerType = DevComponents.DotNetBar.eCornerType.Square; + this.ribbonBar5.TitleVisible = false; + this.ribbonBar5.ItemClick += new System.EventHandler(this.ribbonBar5_ItemClick); + // + // btn_flag + // + this.btn_flag.Image = global::Cyberpipe.Properties.Resources._24x24icon_03_hover; + this.btn_flag.ImagePosition = DevComponents.DotNetBar.eImagePosition.Top; + this.btn_flag.Name = "btn_flag"; + this.btn_flag.SubItemsExpandWidth = 14; + this.btn_flag.Text = "标识器管理"; + this.btn_flag.Click += new System.EventHandler(this.btn_flag_Click); + // + // slider4ground + // + this.slider4ground.LabelPosition = DevComponents.DotNetBar.eSliderLabelPosition.Top; + this.slider4ground.Name = "slider4ground"; + this.slider4ground.Text = "地面透明度"; + this.slider4ground.Value = 0; + this.slider4ground.ValueChanged += new System.EventHandler(this.slider4ground_ValueChanged); + // // ribbonPanel15 // this.ribbonPanel15.ColorSchemeStyle = DevComponents.DotNetBar.eDotNetBarStyle.StyleManagerControlled; @@ -6393,16 +6402,6 @@ this.buttonItem76.SubItemsExpandWidth = 14; this.buttonItem76.Text = "坐标标注"; // - // layerTree - // - this.layerTree.CheckBoxes = true; - this.layerTree.ItemHeight = 18; - this.layerTree.Location = new System.Drawing.Point(30, 78); - this.layerTree.Name = "layerTree"; - this.layerTree.Size = new System.Drawing.Size(121, 97); - this.layerTree.TabIndex = 1; - this.layerTree.AfterCheck += new System.Windows.Forms.TreeViewEventHandler(this.layerTree_AfterCheck); - // // MainFrm // this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Inherit; @@ -6475,11 +6474,11 @@ this.contextMenuStripDeleteLayerNode.ResumeLayout(false); this.ribbonControl1.ResumeLayout(false); this.ribbonControl1.PerformLayout(); - this.ribbonPanel1.ResumeLayout(false); - this.ribbonPanel7.ResumeLayout(false); - this.ribbonPanel2.ResumeLayout(false); this.ribbonPanel3.ResumeLayout(false); + this.ribbonPanel2.ResumeLayout(false); + this.ribbonPanel1.ResumeLayout(false); this.ribbonPanel8.ResumeLayout(false); + this.ribbonPanel7.ResumeLayout(false); this.ribbonPanel15.ResumeLayout(false); ((System.ComponentModel.ISupportInitialize)(this.pictureBox1)).EndInit(); this.ResumeLayout(false); diff --git a/NewFunction/FrmCreateTunnel.cs b/NewFunction/FrmCreateTunnel.cs index 282767c..338edff 100644 --- a/NewFunction/FrmCreateTunnel.cs +++ b/NewFunction/FrmCreateTunnel.cs @@ -142,35 +142,6 @@ } } - private void txtMS_KeyPress(object sender, KeyPressEventArgs e) - { - TextBox text = sender as TextBox; - if ((e.KeyChar < 48 || e.KeyChar > 57) && (e.KeyChar != 8) && (int)e.KeyChar != 46) - { - e.Handled = true; - } - if ((int)e.KeyChar == 46) //小数点 - { - if (text.Text.Length <= 0) - e.Handled = true; //小数点不能在第一位 - else //处理不规则的小数点 - { - float f; - float oldf; - bool b1 = false, b2 = false; - b1 = float.TryParse(text.Text, out oldf); - b2 = float.TryParse(text.Text + e.KeyChar.ToString(), out f); - if (b2 == false) - { - if (b1 == true) - e.Handled = true; - else - e.Handled = false; - } - } - } - } - private void FrmCreateTunnel_Load(object sender, EventArgs e) { if (comboBoxTunnelType.Items.Count > 0) diff --git a/OracleHelper.cs b/OracleHelper.cs index 11eebe6..79cdf48 100644 --- a/OracleHelper.cs +++ b/OracleHelper.cs @@ -49,7 +49,7 @@ { conn.Close(); } - MessageBox.Show(ex.Message, "提示"); + LogHelper.WriteLog(typeof(OledbHelper), ex.Message); return null; } } @@ -67,7 +67,7 @@ } catch(Exception ex) { - // LogError.PublishError(ex); + LogHelper.WriteLog(typeof(OledbHelper), ex.Message); } finally { @@ -111,6 +111,7 @@ } catch (Exception ex) { + LogHelper.WriteLog(typeof(OledbHelper), ex.Message); return null; } } @@ -131,6 +132,7 @@ } catch(Exception ex) { + LogHelper.WriteLog(typeof(OledbHelper), ex.Message); rowCount = -1; } finally @@ -159,6 +161,7 @@ } catch(Exception ex) { + LogHelper.WriteLog(typeof(OledbHelper), ex.Message); num = -1; } finally @@ -190,6 +193,7 @@ } catch (Exception ex) { + LogHelper.WriteLog(typeof(OledbHelper), ex.Message); return null; } } @@ -210,7 +214,7 @@ oracleCmd.Dispose(); conn.Close(); //调用con_close()方法,关闭与数据库的连接 }catch(Exception ex){ - + LogHelper.WriteLog(typeof(OledbHelper), ex.Message); } finally { @@ -237,6 +241,7 @@ } catch (Exception ex) { + LogHelper.WriteLog(typeof(OledbHelper), ex.Message); rowCount = -1; } finally diff --git a/OracleUtils.cs b/OracleUtils.cs index 29b5374..c1aadda 100644 --- a/OracleUtils.cs +++ b/OracleUtils.cs @@ -741,7 +741,6 @@ } catch { - //if we fail to return the SqlDatReader, we need to close the connection ourselves cn.Close(); throw; } diff --git a/PAS.cs b/PAS.cs index 972de2d..fcda1dd 100644 --- a/PAS.cs +++ b/PAS.cs @@ -93,15 +93,7 @@ } - private void TSM_Pderive_Click(object sender, EventArgs e) - { - PASAClass.Table_name(operation); - if (TV_Files.SelectedNode != null) - { - PASAClass.GuideEdit_form("G", TV_Files, int.Parse(((ToolStripMenuItem)sender).Tag.ToString())); - } - } - + private void TSM_Fenter_Click(object sender, EventArgs e) { if (TV_Files.SelectedNode != null) @@ -110,16 +102,6 @@ } } - private void TSM_Frename_Click(object sender, EventArgs e) - { - TSM_Fenter_Click(sender, e); - } - - private void TSM_Fdelete_Click(object sender, EventArgs e) - { - TSM_Fenter_Click(sender, e); - } - private void TSM_Fderive_Click(object sender, EventArgs e) { if (TV_Files.SelectedNode != null) @@ -128,25 +110,6 @@ } } - private void TSM_Fprint_Click(object sender, EventArgs e) - { - if (TV_Files.SelectedNode != null) - { - PASAClass.Print(int.Parse(TV_Files.SelectedNode.Tag.ToString()), TV_Files.SelectedNode.Text, PD_PASPrtFile, PD_PASPrtDoc); - - } - } - - private void TSM_PASPgSt_Click(object sender, EventArgs e) - { - PSD_PASSetPage.ShowDialog(); - } - - private void TSM_PASPreV_Click(object sender, EventArgs e) - { - PPD_PASPreV.ShowDialog(); - } - private void TV_Files_AfterCollapse(object sender, TreeViewEventArgs e) { e.Node.ImageIndex = 0; @@ -250,14 +213,6 @@ } } - private void 导出ToolStripMenuItem_Click(object sender, EventArgs e) - { - PASAClass.Table_name(operation); - if (TV_Files.SelectedNode != null) - { - PASAClass.GuideEdit_form("G", TV_Files, int.Parse(((ToolStripMenuItem)sender).Tag.ToString())); - } - } private void 导入ToolStripMenuItem_Click(object sender, EventArgs e) { diff --git a/PAS_Forms/F_PASInout.cs b/PAS_Forms/F_PASInout.cs index 373a4e6..974f987 100644 --- a/PAS_Forms/F_PASInout.cs +++ b/PAS_Forms/F_PASInout.cs @@ -71,11 +71,6 @@ } - private void Cancel_Click(object sender, EventArgs e) - { - this.Close(); - } - private void OK_Click(object sender, EventArgs e) { if (textBox1.Text == "") diff --git a/PATM.cs b/PATM.cs index edecd1e..9b6c51d 100644 --- a/PATM.cs +++ b/PATM.cs @@ -26,12 +26,6 @@ public string operation = ""; #endregion - - - - - - private void TSM_Pnew_Click(object sender, EventArgs e) { if (LV_proj.Visible) @@ -94,15 +88,6 @@ } - private void TSM_Pderive_Click(object sender, EventArgs e) - { - PATMAClass.Table_name(operation); - if (TV_files.SelectedNode != null) - { - PATMAClass.GuideEdit_form("G", TV_files, int.Parse(((ToolStripMenuItem)sender).Tag.ToString())); - } - } - private void TSM_Fenter_Click(object sender, EventArgs e) { if (TV_files.SelectedNode != null) @@ -163,35 +148,6 @@ //PATMAClass.Show_AllFile(int.Parse(e.Node.Tag.ToString()), e.Node.Text, LV_PATMallfiles, PB_Display, 2);//此处为显示图片操作 } - private void TSM_Frename_Click(object sender, EventArgs e) - { - TSM_Fenter_Click(sender, e); - } - - private void TSM_Fdelete_Click(object sender, EventArgs e) - { - TSM_Fenter_Click(sender, e); - } - - private void TSM_Fderive_Click(object sender, EventArgs e) - { - if (TV_files.SelectedNode != null) - { - PATMAClass.GuideEdit_form("G", TV_files, int.Parse(((ToolStripMenuItem)sender).Tag.ToString())); - } - } - - private void TSM_Fprint_Click(object sender, EventArgs e) - { - if (TV_files.SelectedNode != null) - { - PATMAClass.Print(int.Parse(TV_files.SelectedNode.Tag.ToString()), TV_files.SelectedNode.Text, PD_PATMPrtFile, PD_PATMPrtDoc); - - } - } - - - private void BT_PATMSch_Click(object sender, EventArgs e) { //LV_PATMallfiles.Dock = DockStyle.Fill;//使ListView控件最大化 @@ -210,32 +166,6 @@ } - private void TSM_PATMPreV_Click(object sender, EventArgs e) - { - PPD_PATMPreV.ShowDialog(); - } - - private void TSM_PATMPgSt_Click(object sender, EventArgs e) - { - PSD_PATMSetPage.ShowDialog(); - } - - private void LV_PATMSrchRslt_MouseClick(object sender, MouseEventArgs e) - { - - if (LV_proj.SelectedItems != null) - { - //int i = 1; - // PATMAClass.Show_AllFile(int.Parse(LV_PATMSrchRslt.FocusedItem.Tag.ToString()), LV_PATMSrchRslt.FocusedItem.Text, LV_PATMallfiles,PB_Display, 0); - - } - } - - private void LV_PATMSrchRslt_MouseDoubleClick(object sender, MouseEventArgs e) - { - //PATMAClass.Show_AllFile(int.Parse(LV_PATMSrchRslt.FocusedItem.Tag.ToString()), LV_PATMSrchRslt.FocusedItem.Text, LV_PATMallfiles, PB_Display, 2); - } - private void 新建ToolStripMenuItem_Click(object sender, EventArgs e) { if ((TV_files.SelectedNode != null)&&(TV_files.SelectedNode.Parent==null)) @@ -288,17 +218,6 @@ } } - private void 打印预览toolStripMenuItem_Click(object sender, EventArgs e) - { - - PPD_PATMPreV.ShowDialog(); - } - - private void 打印设置toolStripMenuItem_Click(object sender, EventArgs e) - { - PSD_PATMSetPage.ShowDialog(); - } - private void TV_PATMSrchRslt_NodeMouseClick(object sender, TreeNodeMouseClickEventArgs e) { if (e.Button == MouseButtons.Right) diff --git a/PATM_Forms/F_PATMTitle.cs b/PATM_Forms/F_PATMTitle.cs index 7380dd8..5d1fe8c 100644 --- a/PATM_Forms/F_PATMTitle.cs +++ b/PATM_Forms/F_PATMTitle.cs @@ -148,19 +148,6 @@ return 0; } - //判断是否为已有工程 - private bool checkProject(string projectname) { - string sql = "select * from "+this.tablename+" where "+tablename+".NODENAME = '"+projectname - +"'"; - DataTable table = OledbHelper.QueryTable(sql); - if (table.Rows.Count > 0) - { - return true; - } - else { - return false; - } - } private void buttonX2_Click(object sender, EventArgs e) { diff --git a/PATM_Forms/F_PATMinout.cs b/PATM_Forms/F_PATMinout.cs index e404e7b..16b51de 100644 --- a/PATM_Forms/F_PATMinout.cs +++ b/PATM_Forms/F_PATMinout.cs @@ -174,12 +174,6 @@ { this.Close(); } - - private void TV_PATMinout_AfterCollapse(object sender, TreeViewEventArgs e) - { - e.Node.ImageIndex = 0; - } - //private void TV_PATMinout_NodeMouseDoubleClick(object sender, TreeNodeMouseClickEventArgs e) diff --git "a/PED_Forms/F_\346\225\260\346\215\256\350\276\223\345\205\245\350\276\223\345\207\272.cs" "b/PED_Forms/F_\346\225\260\346\215\256\350\276\223\345\205\245\350\276\223\345\207\272.cs" index 0f76b8c..4de8b4d 100644 --- "a/PED_Forms/F_\346\225\260\346\215\256\350\276\223\345\205\245\350\276\223\345\207\272.cs" +++ "b/PED_Forms/F_\346\225\260\346\215\256\350\276\223\345\205\245\350\276\223\345\207\272.cs" @@ -188,12 +188,7 @@ } DialogResult = DialogResult.OK;//将当前窗体的对话框返回值设为OK } - private void treeView1_NodeMouseClick(object sender, TreeNodeMouseClickEventArgs e) - { - - //dir = comboBox_Disk.Text + e.Node.FullPath; - e.Node.SelectedImageIndex = e.Node.ImageIndex; - } + private void button1_Click(object sender, EventArgs e) { diff --git a/Program.cs b/Program.cs index 1ff0987..0e480f2 100644 --- a/Program.cs +++ b/Program.cs @@ -105,22 +105,6 @@ File.Copy(localPath_config, filePath_config, true); } - private static void createFolder(String folerName) - { - if (!Directory.Exists(folerName)) - { - Directory.CreateDirectory(folerName); - } - } - - private static void delOldVersion(String fileName) - { - if (System.IO.File.Exists(fileName)) - { - File.Delete(fileName); - } - } - //获取新版本程序的路径 private static string getProgramUrl(string fileName, string nodeName) { diff --git "a/SFiles_Forms/F_SFiles\346\225\260\346\215\256\350\276\223\345\205\245\350\276\223\345\207\272.cs" "b/SFiles_Forms/F_SFiles\346\225\260\346\215\256\350\276\223\345\205\245\350\276\223\345\207\272.cs" index 6f36e10..493895d 100644 --- "a/SFiles_Forms/F_SFiles\346\225\260\346\215\256\350\276\223\345\205\245\350\276\223\345\207\272.cs" +++ "b/SFiles_Forms/F_SFiles\346\225\260\346\215\256\350\276\223\345\205\245\350\276\223\345\207\272.cs" @@ -188,12 +188,6 @@ } DialogResult = DialogResult.OK;//将当前窗体的对话框返回值设为OK } - private void treeView1_NodeMouseClick(object sender, TreeNodeMouseClickEventArgs e) - { - - //dir = comboBox_Disk.Text + e.Node.FullPath; - e.Node.SelectedImageIndex = e.Node.ImageIndex; - } private void button1_Click(object sender, EventArgs e) { diff --git a/SysRescInfoManager.cs b/SysRescInfoManager.cs index 5b3038a..067b90b 100644 --- a/SysRescInfoManager.cs +++ b/SysRescInfoManager.cs @@ -214,15 +214,6 @@ winGridViewPager1.DataSource = table.DefaultView; } - private void LoadData(int pageIndex) - { - string sqlData = GetSql(pageIndex); - initlizeDatagrid(); - DataTable table = OracleUtils.ExecuteDataset(OracleUtils.ConnectionString, CommandType.Text, sqlData).Tables[0]; - winGridViewPager1.DataSource = table.DefaultView; - winGridViewPager1.Refresh(); - } - private string GetSql() { string sqlCount = "select count(*) from casic_userresctest where sysname='EMS'"; diff --git a/Cyberpipe.csproj b/Cyberpipe.csproj index 07a8c1a..e3cd12c 100644 --- a/Cyberpipe.csproj +++ b/Cyberpipe.csproj @@ -204,25 +204,6 @@ - - Form - - - F_GKT1数据输入输出.cs - - - Form - - - F_GKT1添加文件.cs - - - Form - - - F_GKT1添加项目.cs - - Form @@ -1068,18 +1049,6 @@ Frm_password_reset.cs - - Form - - - GKT.cs - - - Form - - - GKT1.cs - Form @@ -1258,12 +1227,6 @@ F_Projedit.cs - - Form - - - PED.cs - Form @@ -1331,16 +1294,6 @@ True Reference.map - - F_GKT1数据输入输出.cs - Designer - - - F_GKT1添加文件.cs - - - F_GKT1添加项目.cs - Form_EditTask.cs @@ -1836,12 +1789,6 @@ Frm_password_reset.cs - - GKT.cs - - - GKT1.cs - F_GKT数据输入输出.cs @@ -1934,9 +1881,6 @@ F_Projedit.cs - - PED.cs - F_数据输入输出.cs diff --git a/Cyberpipe.suo b/Cyberpipe.suo index 68ced4f..a1aecf8 100644 --- a/Cyberpipe.suo +++ b/Cyberpipe.suo Binary files differ diff --git a/EMS_Forms/Form_EditTask.cs b/EMS_Forms/Form_EditTask.cs index 718992f..f1d791f 100644 --- a/EMS_Forms/Form_EditTask.cs +++ b/EMS_Forms/Form_EditTask.cs @@ -119,7 +119,8 @@ String name = Convert.ToString(dr["USERNAME"]); comboBox_userName.Items.Add(name); - } + } + dr.Close(); comboBox_road.Items.Clear(); roadList = new List(); @@ -135,7 +136,7 @@ comboBox_road.Items.Add(name); } } - + dr1.Close(); conn.Close(); bool flag2 = false; @@ -185,7 +186,7 @@ catch (Exception ex) { - MessageBox.Show(ex.ToString()); + LogHelper.WriteLog(typeof(Form_EditTask), ex.Message); } } @@ -288,7 +289,7 @@ } catch (Exception ex) { - MessageBox.Show(ex.ToString()); + LogHelper.WriteLog(typeof(Form_EditTask), ex.Message); } } @@ -474,7 +475,7 @@ } catch (Exception ex) { - MessageBox.Show(ex.ToString()); + LogHelper.WriteLog(typeof(Form_EditTask), ex.Message); } this.Close(); @@ -495,6 +496,7 @@ { numList.Add(Convert.ToInt32(dr["DBID"])); } + dr.Close(); if (numList.Count == 0) { taskNumber = Convert.ToInt32(number) * 100; @@ -674,6 +676,7 @@ } } } + dr.Close(); conn.Close(); } diff --git a/EMS_Forms/Form_EventManager.cs b/EMS_Forms/Form_EventManager.cs index b18c45b..84807b2 100644 --- a/EMS_Forms/Form_EventManager.cs +++ b/EMS_Forms/Form_EventManager.cs @@ -64,6 +64,7 @@ comboBox_name.Items.Add(name); } + dr.Close(); conn.Close(); diff --git a/Forms/FrmMnModify.cs b/Forms/FrmMnModify.cs index 31cfc5f..d036360 100644 --- a/Forms/FrmMnModify.cs +++ b/Forms/FrmMnModify.cs @@ -68,15 +68,7 @@ questionGrid.Rows[idx].Cells[1].Value = sr.question; } } - /// 选中对象 - /// - /// - /// - /// - private void buttonX1_Click(object sender, EventArgs e) - { - globecontrol.Globe.Action = EnumAction3D.SelectObject; - } + /// /// 选中某一行 /// diff --git a/Forms/FrmPipelineModelDataBase.cs b/Forms/FrmPipelineModelDataBase.cs index 2acf0ca..7ce573f 100644 --- a/Forms/FrmPipelineModelDataBase.cs +++ b/Forms/FrmPipelineModelDataBase.cs @@ -35,19 +35,7 @@ ds = _ds; InitializeComponent(); } - /// - /// 单击选择shp格式文件 - /// - /// - /// - private void btnBrowseModel_Click(object sender, EventArgs e) - { - saveFileDialog1.Filter = "*.lgd|*.lgd"; - if (saveFileDialog1.ShowDialog() == DialogResult.OK) - { - txtModelLayer.Text = saveFileDialog1.FileName; - } - } + /// /// 窗体初始化事件处理 /// @@ -100,49 +88,6 @@ } } } - - private object convertFieldValue(string fieldname, object obj) - { - if (obj == null) - return null; - - try - { - string type = fields_types[fieldname].ToString(); - switch (type) - { - case "string": - return obj.ToString(); - case "int": - //return 101; - int intResult; - if (int.TryParse(obj.ToString(), out intResult)) - return intResult; - else - return null; - case "double": - //return 202.5; - double doubleResult; - if (double.TryParse(obj.ToString(), out doubleResult)) - return doubleResult; - else - return null; - case "date": - DateTime dtResult; - if (DateTime.TryParse(obj.ToString(), out dtResult)) - return dtResult; - else - return null; - } - return null; - } - catch (Exception ex) - { - MessageBox.Show(ex.ToString()); - return null; - } - } - public string lgdFilePath = ""; /// /// 选择管线颜色 @@ -610,33 +555,6 @@ { this.Close(); } - - private void cmbLayer_SelectedIndexChanged(object sender, EventArgs e) //选择图层 - { - GSOLayer layer = ctl.Globe.Layers.GetLayerByCaption(selectLayerName); - GSOFeatures features = layer.GetAllFeatures(); - if (features.Length == 0) - return; - - cmbFrom.Items.Clear(); - cmbTo.Items.Clear(); - cmbRadius.Items.Clear(); - cmbID.Items.Clear(); - for (int i = 0; i < features[0].GetFieldCount(); i++) - { - GeoScene.Data.GSOFieldDefn fielddef = (GeoScene.Data.GSOFieldDefn)(features[0].GetFieldDefn(i)); - - cmbFrom.Items.Add(fielddef.Name); - cmbTo.Items.Add(fielddef.Name); - cmbRadius.Items.Add(fielddef.Name); - cmbID.Items.Add(fielddef.Name); - } - cmbFrom.SelectedItem = "Deep1"; - cmbTo.SelectedItem = "Deep2"; - cmbRadius.SelectedItem = "Diameter"; - cmbID.SelectedItem = "Handle"; - } - private void buttonXLayerPath_Click(object sender, EventArgs e)//单击 选择shp格式的文件 { OpenFileDialog dlg = new OpenFileDialog(); diff --git a/Forms/FrmPipelineModelDataOneStep.cs b/Forms/FrmPipelineModelDataOneStep.cs index 18afda7..ec93b8a 100644 --- a/Forms/FrmPipelineModelDataOneStep.cs +++ b/Forms/FrmPipelineModelDataOneStep.cs @@ -38,19 +38,7 @@ layerTree = _layerTree; InitializeComponent(); } - /// - /// 单击选择shp格式文件 - /// - /// - /// - private void btnBrowseModel_Click(object sender, EventArgs e) - { - saveFileDialog1.Filter = "*.lgd|*.lgd"; - if (saveFileDialog1.ShowDialog() == DialogResult.OK) - { - txtModelLayer.Text = saveFileDialog1.FileName; - } - } + /// /// 窗体初始化事件处理 /// @@ -107,48 +95,7 @@ } } - private object convertFieldValue(string fieldname, object obj) - { - if (obj == null) - return null; - - try - { - string type = fields_types[fieldname].ToString(); - switch (type) - { - case "string": - return obj.ToString(); - case "int": - //return 101; - int intResult; - if (int.TryParse(obj.ToString(), out intResult)) - return intResult; - else - return null; - case "double": - //return 202.5; - double doubleResult; - if (double.TryParse(obj.ToString(), out doubleResult)) - return doubleResult; - else - return null; - case "date": - DateTime dtResult; - if (DateTime.TryParse(obj.ToString(), out dtResult)) - return dtResult; - else - return null; - } - return null; - } - catch (Exception ex) - { - MessageBox.Show(ex.ToString()); - return null; - } - } - + public string lgdFilePath = ""; /// /// 选择管线颜色 @@ -673,32 +620,6 @@ return featDs; } - private void cmbLayer_SelectedIndexChanged(object sender, EventArgs e) //选择图层 - { - GSOLayer layer = ctl.Globe.Layers.GetLayerByCaption(selectLayerName); - GSOFeatures features = layer.GetAllFeatures(); - if (features.Length == 0) - return; - - cmbFrom.Items.Clear(); - cmbTo.Items.Clear(); - cmbRadius.Items.Clear(); - cmbID.Items.Clear(); - for (int i = 0; i < features[0].GetFieldCount(); i++) - { - GeoScene.Data.GSOFieldDefn fielddef = (GeoScene.Data.GSOFieldDefn)(features[0].GetFieldDefn(i)); - - cmbFrom.Items.Add(fielddef.Name); - cmbTo.Items.Add(fielddef.Name); - cmbRadius.Items.Add(fielddef.Name); - cmbID.Items.Add(fielddef.Name); - } - cmbFrom.SelectedItem = "Deep1"; - cmbTo.SelectedItem = "Deep2"; - cmbRadius.SelectedItem = "Diameter"; - cmbID.SelectedItem = "Handle"; - } - private void buttonXLayerPath_Click(object sender, EventArgs e)//单击 选择shp格式的文件 { OpenFileDialog dlg = new OpenFileDialog(); @@ -949,38 +870,6 @@ } //txtLayername.Text = type + layername; } - /// - /// 连接数据库 - /// - /// - /// - private void buttonX1_Click(object sender, EventArgs e) - { - if (ds == null) - { - //没连的话,直接连接审核库; //审核库配置读配置文件 - string dbIp = Utility.sgdbip; - string database = Utility.sgdbname; - string user = Utility.sgdbuser; - string pass = Utility.sgdbpwd; - - if (!Utility.isNetworkConnectionSuccess(dbIp.Trim())) - { - MessageBox.Show("网络连接失败!", "提示"); - return; - } - - ds = ctl.Globe.DataManager.OpenOracleDataSource(dbIp + "/" + database, "", "", user, pass); - if (ds == null) - { - MessageBox.Show("数据库连接失败!", "提示", MessageBoxButtons.OK, MessageBoxIcon.Warning); - } - else - { - btnCreateModel.Enabled = true; - } - } - } private void btnClose_Click(object sender, EventArgs e) { diff --git a/Forms/FrmShRK.cs b/Forms/FrmShRK.cs index 0e2e722..f1d83cb 100644 --- a/Forms/FrmShRK.cs +++ b/Forms/FrmShRK.cs @@ -215,6 +215,7 @@ { sourcefeatds = sourcefeat as GSOFeatureDataset; } + if (sourcefeatds == null) return; sourcefeatds.Open(); GSOFeatures sourcefeatures = sourcefeatds.GetAllFeatures(); @@ -251,6 +252,7 @@ { desfeatds = desfeat as GSOFeatureDataset; } + if (desfeatds == null) return; desfeatds.Open(); //向新数据集写入字段 diff --git a/FrmAccessoriesSensor.cs b/FrmAccessoriesSensor.cs index 09fcdf1..2a7a80e 100644 --- a/FrmAccessoriesSensor.cs +++ b/FrmAccessoriesSensor.cs @@ -209,7 +209,7 @@ chart1.Series[0].Points.DataBindXY(dic.Keys, dic.Values); for (int m = 0; m < dic.Values.Count; m++) { - if (chart1.Series[0].Points[m].YValues[0].ToString() != "0") + if (chart1.Series[0].Points[m]!=null&&chart1.Series[0].Points[m].YValues[0].ToString() != "0") { chart1.Series[0].Points[m].Label = chart1.Series[0].Points[m].YValues[0].ToString(); } diff --git a/FrmAccessoriesgather.cs b/FrmAccessoriesgather.cs index 9e331e1..a475d9e 100644 --- a/FrmAccessoriesgather.cs +++ b/FrmAccessoriesgather.cs @@ -338,7 +338,7 @@ chart1.Series[0].Points.DataBindXY(dic.Keys, dic.Values); for (int m = 0; m < dic.Values.Count; m++) { - if (chart1.Series[0].Points[m].YValues[0].ToString() != "0") + if (chart1.Series[0].Points[m]!=null&&chart1.Series[0].Points[m].YValues[0].ToString() != "0") { chart1.Series[0].Points[m].Label = chart1.Series[0].Points[m].YValues[0].ToString(); } diff --git a/FrmAccessoryAnalysis.cs b/FrmAccessoryAnalysis.cs index 71d4579..44d4065 100644 --- a/FrmAccessoryAnalysis.cs +++ b/FrmAccessoryAnalysis.cs @@ -66,39 +66,6 @@ globeControl1.Refresh(); } /// - /// 键盘按键按下事件处理 - /// - /// - /// - private void txtRadius_KeyPress(object sender, KeyPressEventArgs e) - { - TextBox text = sender as TextBox; - if ((e.KeyChar < 48 || e.KeyChar > 57) && (e.KeyChar != 8) && (int)e.KeyChar != 46) - { - e.Handled = true; - } - if ((int)e.KeyChar == 46) //小数点 - { - if (text.Text.Length <= 0) - e.Handled = true; //小数点不能在第一位 - else //处理不规则的小数点 - { - float f; - float oldf; - bool b1 = false, b2 = false; - b1 = float.TryParse(text.Text, out oldf); - b2 = float.TryParse(text.Text + e.KeyChar.ToString(), out f); - if (b2 == false) - { - if (b1 == true) - e.Handled = true; - else - e.Handled = false; - } - } - } - } - /// /// 确定按钮事件处理 /// /// diff --git a/FrmAddValve.cs b/FrmAddValve.cs index 34d2fec..5f405b9 100644 --- a/FrmAddValve.cs +++ b/FrmAddValve.cs @@ -486,56 +486,6 @@ } } - - - - - - - - private void cmbLayer_SelectedIndexChanged(object sender, EventArgs e) - { - GSOLayer layer = globeControl1.Globe.Layers.GetLayerByCaption(selectLayerName); - GSOFeatures features = layer.GetAllFeatures(); - if (features.Length == 0) - return; - - combPath.Items.Clear(); - combZ.Items.Clear(); - combModelName.Items.Clear(); - - for (int i = 0; i < features[0].GetFieldCount(); i++) - { - GeoScene.Data.GSOFieldDefn fielddef = (GeoScene.Data.GSOFieldDefn)(features[0].GetFieldDefn(i)); - combPath.Items.Add(fielddef.Name); - combZ.Items.Add(fielddef.Name); - combModelName.Items.Add(fielddef.Name); - } - combModelName.SelectedItem = "编号"; - combPath.SelectedItem = "模型路径"; - if (combfile.SelectedIndex != -1) - { - - string layerCaption = combfile.SelectedItem.ToString().Trim(); - rukuLayer = globeControl1.Globe.Layers.GetLayerByCaption(layerCaption); - if (rukuLayer != null) - { - combPath.Items.Clear(); - combZ.Items.Clear(); - combModelName.Items.Clear(); - - } - for (int i = 0; i < features[0].GetFieldCount(); i++) - { - GeoScene.Data.GSOFieldDefn fielddef = (GeoScene.Data.GSOFieldDefn)(features[0].GetFieldDefn(i)); - combPath.Items.Add(fielddef.Name); - combZ.Items.Add(fielddef.Name); - combModelName.Items.Add(fielddef.Name); - } - combModelName.SelectedItem = "编号"; - combPath.SelectedItem = "模型路径"; - } - } /// /// 单击选择shp格式文件 /// diff --git a/FrmAddWellShp.cs b/FrmAddWellShp.cs index bb79ec0..a249725 100644 --- a/FrmAddWellShp.cs +++ b/FrmAddWellShp.cs @@ -478,32 +478,6 @@ } } } - - private void cmbLayer_SelectedIndexChanged(object sender, EventArgs e) - { - GSOLayer layer = globeControl1.Globe.Layers.GetLayerByCaption(selectLayerName); - GSOFeatures features = layer.GetAllFeatures(); - if (features.Length == 0) - return; - - combCode.Items.Clear(); - combDeep.Items.Clear(); - combModelName.Items.Clear(); - combAngle.Items.Clear(); - - for (int i = 0; i < features[0].GetFieldCount(); i++) - { - GeoScene.Data.GSOFieldDefn fielddef = (GeoScene.Data.GSOFieldDefn)(features[0].GetFieldDefn(i)); - combCode.Items.Add(fielddef.Name); - combDeep.Items.Add(fielddef.Name); - combModelName.Items.Add(fielddef.Name); - combAngle.Items.Add(fielddef.Name); - } - combCode.SelectedItem = "附属物编码"; - combDeep.SelectedItem = "井深"; - combModelName.SelectedItem = "编号"; - combAngle.SelectedItem = "符号角度"; - } /// /// 单击选择shp格式文件 /// diff --git a/FrmAddYuBiZiShp.cs b/FrmAddYuBiZiShp.cs index b312d51..332f037 100644 --- a/FrmAddYuBiZiShp.cs +++ b/FrmAddYuBiZiShp.cs @@ -383,80 +383,7 @@ } } - private void cmbLayer_SelectedIndexChanged(object sender, EventArgs e) - { - GSOLayer layer = globeControl1.Globe.Layers.GetLayerByCaption(selectLayerName); - GSOFeatures features = layer.GetAllFeatures(); - if (features.Length == 0) - return; - - combCode.Items.Clear(); - combDeep.Items.Clear(); - combModelName.Items.Clear(); - //comboLoad.Items.Clear(); - for (int i = 0; i < features[0].GetFieldCount(); i++) - { - GeoScene.Data.GSOFieldDefn fielddef = (GeoScene.Data.GSOFieldDefn)(features[0].GetFieldDefn(i)); - combCode.Items.Add(fielddef.Name); - combDeep.Items.Add(fielddef.Name); - combModelName.Items.Add(fielddef.Name); - //comboLoad.Items.Add(fielddef.Name); - } - combCode.SelectedItem = "附属物编码"; - combDeep.SelectedItem = "Z坐标"; - combModelName.SelectedItem = "编号"; - //comboLoad.SelectedItem = "模型路径"; - } - - private void buttonXLayerPath_Click(object sender, EventArgs e) - { - OpenFileDialog dlg = new OpenFileDialog(); - dlg.Filter = "*.shp|*.shp"; - dlg.Multiselect = false; - if (dlg.ShowDialog() == DialogResult.OK) - { - GSOLayer layer = globeControl1.Globe.Layers.Add(dlg.FileName); - string txtMessage = valiYBdata(layer); - if (txtMessage != "") - { - button3.Enabled = false; - //textBoxLayer.Text = ""; - combCode.Items.Clear(); - combDeep.Items.Clear(); - combModelName.Items.Clear(); - globeControl1.Globe.Layers.Remove(layer); - FrmValiDataShowErrorMessage showErrorMessage = new FrmValiDataShowErrorMessage(dlg.FileName, txtMessage); - showErrorMessage.ShowDialog(); - return; - } - else - { - button3.Enabled = true; - //textBoxLayer.Text = dlg.FileName; - selectLayerName = layer.Caption; - txtLayerName.Text = layer.Caption; - GSOFeatures features = layer.GetAllFeatures(); - if (features.Length == 0) - return; - - combCode.Items.Clear(); - combDeep.Items.Clear(); - combModelName.Items.Clear(); - for (int i = 0; i < features[0].GetFieldCount(); i++) - { - GeoScene.Data.GSOFieldDefn fielddef = (GeoScene.Data.GSOFieldDefn)(features[0].GetFieldDefn(i)); - combCode.Items.Add(fielddef.Name); - combDeep.Items.Add(fielddef.Name); - combModelName.Items.Add(fielddef.Name); - //comboLoad.Items.Add(fielddef.Name); - } - combCode.SelectedItem = "管点编码"; - combDeep.SelectedItem = "Z坐标"; - combModelName.SelectedItem = "编号"; - } - } - } - + private void FrmAddYuBiZiShp_FormClosing(object sender, FormClosingEventArgs e) { globeControl1.Globe.Refresh(); diff --git a/FrmAllPipelineStatis.cs b/FrmAllPipelineStatis.cs index 6421a26..a6eea29 100644 --- a/FrmAllPipelineStatis.cs +++ b/FrmAllPipelineStatis.cs @@ -84,7 +84,7 @@ chartAllAreaPipeline.Series["管线"].Points.DataBindXY(pipelineLengthAndType.Keys, pipelineLengthAndType.Values); for (int m = 0; m < pipelineLengthAndType.Values.Count; m++) { - if (chartAllAreaPipeline.Series["管线"].Points[m].YValues[0].ToString() != "0") + if (chartAllAreaPipeline.Series["管线"].Points[m]!=null&&chartAllAreaPipeline.Series["管线"].Points[m].YValues[0].ToString() != "0") { chartAllAreaPipeline.Series["管线"].Points[m].Label = chartAllAreaPipeline.Series[0].Points[m].YValues[0].ToString(); } @@ -94,7 +94,7 @@ } catch (Exception ex) { - //LogError.PublishError(ex); + LogHelper.WriteLog(typeof(FrmAllPipelineStatis), ex.Message); } } @@ -147,7 +147,7 @@ } DataTable dt = OledbHelper.QueryTable(sql); - if (dt != null && dt.Rows.Count > 0) + if (dt != null && dt.Rows.Count > 0 && chartAllAreaPipeline.Series["管线"].Points[indexHit]!=null) { dataGridViewX1.DataSource = dt; panel.Visible = true; diff --git a/FrmAllWorkWellStatis.cs b/FrmAllWorkWellStatis.cs index 6fec7af..6af8e4c 100644 --- a/FrmAllWorkWellStatis.cs +++ b/FrmAllWorkWellStatis.cs @@ -52,7 +52,7 @@ chartAllAreaPipeline.Series["井盖"].Points.DataBindXY(workWellLengthAndType.Keys, workWellLengthAndType.Values); for (int m = 0; m < workWellLengthAndType.Values.Count; m++) { - if (chartAllAreaPipeline.Series["井盖"].Points[m].YValues[0].ToString().Trim() != "0") + if (chartAllAreaPipeline.Series["井盖"].Points[m]!=null&&chartAllAreaPipeline.Series["井盖"].Points[m].YValues[0].ToString().Trim() != "0") { chartAllAreaPipeline.Series["井盖"].Points[m].Label = chartAllAreaPipeline.Series[0].Points[m].YValues[0].ToString(); } @@ -60,7 +60,7 @@ } catch (Exception ex) { - //LogError.PublishError(ex); + LogHelper.WriteLog(typeof(FrmAllWorkWellStatis), ex.Message); } } diff --git a/FrmBSQDuoBianXingStatis.cs b/FrmBSQDuoBianXingStatis.cs index e8b7d52..3e889b6 100644 --- a/FrmBSQDuoBianXingStatis.cs +++ b/FrmBSQDuoBianXingStatis.cs @@ -60,7 +60,7 @@ { for (int m = 0; m < bsq1.Values.Count; m++) { - if (chart1.Series["标识器"].Points[m].YValues[0].ToString() != "0") + if (chart1.Series["标识器"].Points[m]!=null&&chart1.Series["标识器"].Points[m].YValues[0].ToString() != "0") { count += Convert.ToInt16(chart1.Series[0].Points[m].YValues[0].ToString()); chart1.Series["标识器"].Points[m].Label = chart1.Series[0].Points[m].YValues[0].ToString(); diff --git a/FrmBSQDuoBianXingStreet.cs b/FrmBSQDuoBianXingStreet.cs index 2005ebb..1db5777 100644 --- a/FrmBSQDuoBianXingStreet.cs +++ b/FrmBSQDuoBianXingStreet.cs @@ -63,7 +63,7 @@ chartStatis.Series[0].Points.DataBindXY(bsq.Keys, bsq.Values); for (int m = 0; m < bsq.Values.Count; m++) { - if (chartStatis.Series[0].Points[m].YValues[0].ToString().Trim() != "0") + if (chartStatis.Series[0].Points[m]!=null&&chartStatis.Series[0].Points[m].YValues[0].ToString().Trim() != "0") { count += Convert.ToInt16(chartStatis.Series[0].Points[m].YValues[0].ToString()); chartStatis.Series[0].Points[m].Label = chartStatis.Series[0].Points[m].YValues[0].ToString(); diff --git a/FrmBSQStatis.cs b/FrmBSQStatis.cs index 390a55c..4aa0ee6 100644 --- a/FrmBSQStatis.cs +++ b/FrmBSQStatis.cs @@ -95,6 +95,8 @@ } } } + + dr.Close(); conn.Close(); for (int i = 0; i < typeLists.Count; i++) { @@ -123,7 +125,7 @@ chartStatis.Series[0].Points.DataBindXY(bsq.Keys, bsq.Values); for (int m = 0; m < bsq.Values.Count; m++) { - if (chartStatis.Series[0].Points[m].YValues[0].ToString().Trim() != "0") + if (chartStatis.Series[0].Points[m]!=null&&chartStatis.Series[0].Points[m].YValues[0].ToString().Trim() != "0") { //count += Convert.ToInt16(chartStatis.Series[0].Points[m].YValues[0].ToString()); chartStatis.Series[0].Points[m].Label = chartStatis.Series[0].Points[m].YValues[0].ToString(); diff --git a/FrmBSQStreet.cs b/FrmBSQStreet.cs index 9d88adb..7fbacad 100644 --- a/FrmBSQStreet.cs +++ b/FrmBSQStreet.cs @@ -44,7 +44,7 @@ chartStatis.Series[0].Points.DataBindXY(bsq.Keys, bsq.Values); for (int m = 0; m < bsq.Values.Count; m++) { - if (chartStatis.Series[0].Points[m].YValues[0].ToString().Trim() != "0") + if (chartStatis.Series[0].Points[m]!=null&&chartStatis.Series[0].Points[m].YValues[0].ToString().Trim() != "0") { count += Convert.ToInt16(chartStatis.Series[0].Points[m].YValues[0].ToString()); chartStatis.Series[0].Points[m].Label = chartStatis.Series[0].Points[m].YValues[0].ToString(); diff --git a/FrmBoosterValvers.cs b/FrmBoosterValvers.cs index 5061efc..df9b62b 100644 --- a/FrmBoosterValvers.cs +++ b/FrmBoosterValvers.cs @@ -236,199 +236,6 @@ count = 0; } } - /// - /// 添加火苗 - /// - /// - /// - /// - /// - private GSOFeature AddFire(double x,double y,double z) - { - // 烟火示例 - - string strResPath = Application.StartupPath + "/Resource"; - - // 烟火粒子示例,由三个发射器构成 - GSOGeoParticle geoParticle = new GSOGeoParticle(); - geoParticle.SetPosition(x, y, z); // 添加到这个经纬度位置 - geoParticle.AltitudeMode = EnumAltitudeMode.RelativeToGround; - - GSORingParticleEmitter emitter = new GSORingParticleEmitter(); - emitter.TexturePath = strResPath + "/ParticleImage/flare.png"; - - emitter.SetSizeFix(1, 1); - emitter.VelFix = 1; - emitter.VelRnd = 5; - - emitter.AngleXYFix = 0; - emitter.AngleXYRnd = 180; - - emitter.AngleXZFix = 90; - emitter.AngleXZRnd = 0; - - emitter.LifeFix = 0.5f; - emitter.LifeRnd = 0.0f; - - emitter.RotFix = 0; - emitter.RotRnd = 0; - - emitter.RotVelFix = 0; - emitter.RotVelRnd = 0; - - emitter.EmitPerSec = 100; - - // 采用线性插值生成粒子的初始颜色 - emitter.ColorRndStart = Color.White; - emitter.ColorRndEnd = Color.Red; - - - GSOColorParticleEffector effector2 = new GSOColorParticleEffector(); - effector2.SetColorChanged(0, -1, -1, 0); - effector2.StartTime = 0.0f; - effector2.EndTime = -1.0f; - emitter.AddEffector(effector2); - - // 将三个发射器添加到粒子对象中 - geoParticle.AddEmitter(emitter); - - geoParticle.Play(); - - GSOFeature feature = new GSOFeature(); - - feature.Geometry = geoParticle; - - globeControl1.Globe.MemoryLayer.AddFeature(feature); - - - return feature; - } - - /// - /// 添加喷泉 - /// - /// - private GSOFeature AddFountain() - { - string strResPath = Application.StartupPath + "/Resource"; - - GSOGeoParticle geoParticle = new GSOGeoParticle(); - geoParticle.SetPosition(116.314, 39.84, 0); // 添加到这个经纬度位置 - - GSOPointParticleEmitter emitter = new GSOPointParticleEmitter(); - emitter.TexturePath = strResPath + "/ParticleImage/test.png"; - - emitter.SetSizeFix(0.5f, 2); - emitter.VelFix = 10; - emitter.VelRnd = 2; - - emitter.GravityAcc = 9.8f; - emitter.AngleXYFix = 0; - emitter.AngleXYRnd = 180; - - emitter.AngleXZFix = 88; - emitter.AngleXZRnd = 2; - - //emitter.InnerRadius = 0; - // emitter.OuterRadius = 0.03f; - - emitter.LifeFix = 5.0f; - emitter.LifeRnd = 1.0f; - - emitter.RotFix = 0; - emitter.RotRnd = 0; - - emitter.RotVelFix = 0; - emitter.RotVelRnd = 0; - - emitter.EmitPerSec = 1000; - emitter.ColorRndStart = Color.FromArgb(33, 255, 255, 255); - emitter.ColorRndEnd = Color.FromArgb(11, 255, 255, 255); - emitter.IsLumAdded = false; - - // 将三个发射器添加到粒子对象中 - geoParticle.AddEmitter(emitter); - - geoParticle.Play(); - GSOFeature feature = new GSOFeature(); - - feature.Geometry = geoParticle; - - //globeControl1.Globe.MemoryLayer.AddFeature(feature); - globeControl1.Globe.FlyToFeature(feature); - - return feature; - } - - /// - /// 添加水柱 - /// - /// - private GSOFeature AddWaterLine() - { - string strResPath = Application.StartupPath + "/Resource"; - - GSOGeoParticle geoParticle = new GSOGeoParticle(); - geoParticle.SetPosition(116.308, 39.84, 0); // 添加到这个经纬度位置 - - GSOPointParticleEmitter emitter = new GSOPointParticleEmitter(); - - emitter.TexturePath = strResPath + "/ParticleImage/drop3.png"; - - geoParticle.TimerInterval = 1; - - emitter.SetSizeFix(2.0f, 2.0f); - - emitter.VelFix = 50; - emitter.VelRnd = 2; - - // emitter.IsLumAdded = false; - - emitter.GravityAcc = 9.8f; - emitter.AngleXYFix = 0; - emitter.AngleXYRnd = 2; - - emitter.AngleXZFix = 60; - emitter.AngleXZRnd = 2; - - //emitter.InnerRadius = 0; - // emitter.OuterRadius = 0.1f; - - emitter.LifeFix = 5.0f; - emitter.LifeRnd = 1.0f; - - emitter.RotFix = 0; - emitter.RotRnd = 0; - - emitter.RotVelFix = 0; - emitter.RotVelRnd = 0; - - emitter.EmitPerSec = 1500; - - emitter.ColorRndStart = Color.FromArgb(100, 222, 222, 222); - emitter.ColorRndEnd = Color.FromArgb(50, 222, 222, 222); - - /* - - GSOScaleParticleEffector effector1 = new GSOScaleParticleEffector(); - effector1.SetScale(0.2f, 0.2f); - effector1.StartTime = 0; - effector1.EndTime = -1; // 负数表示整个粒子生命结束 - emitter.AddEffector(effector1); - */ - - // 将三个发射器添加到粒子对象中 - geoParticle.AddEmitter(emitter); - - geoParticle.Play(); - GSOFeature feature = new GSOFeature(); - - feature.Geometry = geoParticle; - - //globeControl1.Globe.MemoryLayer.AddFeature(feature); - globeControl1.Globe.FlyToFeature(feature); - - return feature; - } + } } diff --git a/FrmBufferAnalysis.cs b/FrmBufferAnalysis.cs index f711133..db8ca59 100644 --- a/FrmBufferAnalysis.cs +++ b/FrmBufferAnalysis.cs @@ -123,39 +123,6 @@ } } /// - /// 半径文本框的键盘按键按下事件处理 - /// - /// - /// - private void txtRadius_KeyPress(object sender, KeyPressEventArgs e) - { - TextBox text = sender as TextBox; - if ((e.KeyChar < 48 || e.KeyChar > 57) && (e.KeyChar != 8) && (int)e.KeyChar != 46) - { - e.Handled = true; - } - if ((int)e.KeyChar == 46) //小数点 - { - if (text.Text.Length <= 0) - e.Handled = true; //小数点不能在第一位 - else //处理不规则的小数点 - { - float f; - float oldf; - bool b1 = false, b2 = false; - b1 = float.TryParse(text.Text, out oldf); - b2 = float.TryParse(text.Text + e.KeyChar.ToString(), out f); - if (b2 == false) - { - if (b1 == true) - e.Handled = true; - else - e.Handled = false; - } - } - } - } - /// /// 窗体关闭事件处理 /// /// diff --git a/FrmBufferAnalysisBSQ.cs b/FrmBufferAnalysisBSQ.cs index 24a96ca..f54208f 100644 --- a/FrmBufferAnalysisBSQ.cs +++ b/FrmBufferAnalysisBSQ.cs @@ -137,35 +137,7 @@ } } - private void txtRadius_KeyPress(object sender, KeyPressEventArgs e) - { - TextBox text = sender as TextBox; - if ((e.KeyChar < 48 || e.KeyChar > 57) && (e.KeyChar != 8) && (int)e.KeyChar != 46) - { - e.Handled = true; - } - if ((int)e.KeyChar == 46) //小数点 - { - if (text.Text.Length <= 0) - e.Handled = true; //小数点不能在第一位 - else //处理不规则的小数点 - { - float f; - float oldf; - bool b1 = false, b2 = false; - b1 = float.TryParse(text.Text, out oldf); - b2 = float.TryParse(text.Text + e.KeyChar.ToString(), out f); - if (b2 == false) - { - if (b1 == true) - e.Handled = true; - else - e.Handled = false; - } - } - } - } - + private void FrmBufferAnalysis_FormClosing(object sender, FormClosingEventArgs e) { //Form1.y = 0; @@ -316,27 +288,6 @@ } } - private void FlyToMenu_Click(object sender, EventArgs e) - { - if (m_feature != null) - { - if (m_feature.Geometry != null && m_feature.Geometry.Type == EnumGeometryType.GeoPolyline3D) - { - GSOGeoPolyline3D line = m_feature.Geometry as GSOGeoPolyline3D; - double length = line.GetSpaceLength(true, 6378137); - GSOGeoPolyline3D lineLine = line.GetSegment(0, length / 2); - GSOPoint3d point3d = lineLine[lineLine.PartCount - 1][lineLine[lineLine.PartCount - 1].Count - 1]; - - globeControl1.Globe.FlyToPosition(point3d, EnumAltitudeMode.Absolute, 0, 45, 5); - } - else - { - globeControl1.Globe.FlyToFeature(m_feature, 0, 45, 3); - } - LightMenu_Click(sender, e); - } - } - private void LightMenu_Click(object sender, EventArgs e) { flashflag = "single"; diff --git a/FrmDataBaseOpt.cs b/FrmDataBaseOpt.cs index b0c4b5d..8d7b69d 100644 --- a/FrmDataBaseOpt.cs +++ b/FrmDataBaseOpt.cs @@ -362,6 +362,7 @@ dbCombor.Items.Add(dblist[i].title); } } + /* /// /// 从配置文件读取数据库参数配置 /// @@ -428,6 +429,8 @@ } } + * */ + /* /// /// 向配置文件写入连接数据库的参数配置 /// @@ -485,6 +488,7 @@ MessageBox.Show(exp.ToString()); } } + * */ /// /// /// diff --git a/FrmDatabaseParaSetting.cs b/FrmDatabaseParaSetting.cs index a6fea46..63b596b 100644 --- a/FrmDatabaseParaSetting.cs +++ b/FrmDatabaseParaSetting.cs @@ -152,6 +152,7 @@ this.DialogResult = DialogResult.OK; this.Close(); } + /* /// /// 从配置文件读取数据库连接参数配置 /// @@ -218,6 +219,8 @@ } } + * */ + /* /// /// 向配置文件写入数据库参数配置 /// @@ -276,7 +279,7 @@ MessageBox.Show(ex.ToString()); } } - + */ /// /// 取消按钮事件处理 /// diff --git a/FrmDatabaseParaSetting2.cs b/FrmDatabaseParaSetting2.cs index 932d05e..96a87d5 100644 --- a/FrmDatabaseParaSetting2.cs +++ b/FrmDatabaseParaSetting2.cs @@ -148,6 +148,7 @@ this.DialogResult = DialogResult.OK; this.Close(); } + /* /// /// 从配置文件读取数据库连接参数配置 /// @@ -214,6 +215,8 @@ } } + * */ + /* /// /// 向配置文件写入数据库参数配置 /// @@ -272,7 +275,7 @@ MessageBox.Show(exp.ToString()); } } - + */ /// /// 取消按钮事件处理 /// diff --git a/FrmDiameterQuery.cs b/FrmDiameterQuery.cs index 68c948b..9a5215b 100644 --- a/FrmDiameterQuery.cs +++ b/FrmDiameterQuery.cs @@ -77,18 +77,7 @@ isBetween = true; } } - /// - /// 键盘按键按下事件处理 - /// - /// - /// - private void textBoxX1_KeyPress(object sender, KeyPressEventArgs e) - { - if ((e.KeyChar < 48 || e.KeyChar > 57) && e.KeyChar != 8) - { - e.Handled = true;//屏蔽 - } - } + bool isBetween = false; /// diff --git a/FrmDocumentEdit.cs b/FrmDocumentEdit.cs index aab2d31..e78a7ff 100644 --- a/FrmDocumentEdit.cs +++ b/FrmDocumentEdit.cs @@ -256,121 +256,6 @@ } - // - /// 将本地文件上传到指定的服务器(HttpWebRequest方法) - /// - /// 文件上传到的服务器 - /// 要上传的本地文件(全路径) - /// 文件上传后的名称 - /// 上传进度条 - /// 成功返回1,失败返回0 - private int Upload_Request(string address, string fileNamePath, string saveName, ProgressBar progressBar) - { - int returnValue = 0; - // 要上传的文件 - FileStream fs = new FileStream(fileNamePath, FileMode.Open, FileAccess.Read); - BinaryReader r = new BinaryReader(fs); - //时间戳 - string strBoundary = "----------" + DateTime.Now.Ticks.ToString("x"); - byte[] boundaryBytes = Encoding.ASCII.GetBytes("/r/n--" + strBoundary + "/r/n"); - //请求头部信息 - StringBuilder sb = new StringBuilder(); - sb.Append("--"); - sb.Append(strBoundary); - sb.Append("\r\n"); - sb.Append("Content-Disposition: form-data; name=\""); - sb.Append("file"); - sb.Append("\"; filename=\""); - sb.Append(saveName); - sb.Append("\""); - sb.Append("\r\n"); - sb.Append("Content-Type: "); - sb.Append("application/octet-stream"); - sb.Append("\r\n"); - sb.Append("\r\n"); - string strPostHeader = sb.ToString(); - byte[] postHeaderBytes = Encoding.UTF8.GetBytes(strPostHeader); - // 根据uri创建HttpWebRequest对象 - HttpWebRequest httpReq = (HttpWebRequest)WebRequest.Create(new Uri(address)); - httpReq.Method = "POST"; - //对发送的数据不使用缓存 - httpReq.AllowWriteStreamBuffering = false; - //设置获得响应的超时时间(300秒) - httpReq.Timeout = 300000; - httpReq.ContentType = "multipart/form-data; boundary=" + strBoundary; - long length = fs.Length + postHeaderBytes.Length + boundaryBytes.Length; - long fileLength = fs.Length; - httpReq.ContentLength = length; - try - { - progressBar.Maximum = int.MaxValue; - progressBar.Minimum = 0; - progressBar.Value = 0; - //每次上传4k - int bufferLength = 4096; - byte[] buffer = new byte[bufferLength]; - //已上传的字节数 - long offset = 0; - //开始上传时间 - DateTime startTime = DateTime.Now; - int size = r.Read(buffer, 0, bufferLength); - Stream postStream = httpReq.GetRequestStream(); - //发送请求头部消息 - postStream.Write(postHeaderBytes, 0, postHeaderBytes.Length); - while (size > 0) - { - postStream.Write(buffer, 0, size); - offset += size; - progressBar.Value = (int)(offset * (int.MaxValue / length)); - TimeSpan span = DateTime.Now - startTime; - double second = span.TotalSeconds; - //lblTime.Text = "已用时:" + second.ToString("F2") + "秒"; - //if (second > 0.001) - //{ - // lblSpeed.Text = " 平均速度:" + (offset / 1024 / second).ToString("0.00") + "KB/秒"; - //} - //else - //{ - // lblSpeed.Text = " 正在连接…"; - //} - //lblState.Text = "已上传:" + (offset * 100.0 / length).ToString("F2") + "%"; - //lblSize.Text = (offset / 1048576.0).ToString("F2") + "M/" + (fileLength / 1048576.0).ToString("F2") + "M"; - Application.DoEvents(); - size = r.Read(buffer, 0, bufferLength); - } - //添加尾部的时间戳 - postStream.Write(boundaryBytes, 0, boundaryBytes.Length); - postStream.Close(); - //获取服务器端的响应 - WebResponse webRespon = httpReq.GetResponse(); - Stream s = webRespon.GetResponseStream(); - StreamReader sr = new StreamReader(s); - //读取服务器端返回的消息 - String sReturnString = sr.ReadLine(); - s.Close(); - sr.Close(); - if (sReturnString == "Success") - { - returnValue = 1; - } - else if (sReturnString == "Error") - { - returnValue = 0; - } - } - catch(Exception ex) - { - returnValue = 0; - string str = ex.ToString(); - } - finally - { - fs.Close(); - r.Close(); - } - return returnValue; - } - private void btn_file_Click(object sender, EventArgs e) { OpenFileDialog dlg = new OpenFileDialog(); diff --git a/FrmExportCADS.cs b/FrmExportCADS.cs index 98772ea..59629dd 100644 --- a/FrmExportCADS.cs +++ b/FrmExportCADS.cs @@ -108,65 +108,6 @@ MessageBox.Show("请选中要导出的图层!", "提示", MessageBoxButtons.OK, MessageBoxIcon.Warning); } } - private Boolean MerageToFile(GSOFeatures features, String strDestFile, String strProj4)//图层追加 - { - if (features == null) - { - return false; - } - Boolean bSuccess = false; - - string strDir = GSOUtility.GetFileDir(strDestFile); - string strLPRJFile = GSOUtility.ChangeExt(strDestFile, ".lprj"); - string strExt = GSOUtility.GetFileExt(strDestFile); - - // 如果投影文件存在,投影以投影文件为准 - if (File.Exists(strLPRJFile)) - { - // 如果是dxf,则这样处理 - if (strExt.ToLower() == ".dxf") - { - string strTempSrcFile = strDir + "srcFeatures_dxftmp" + strExt; - globeControl1.Globe.DataManager.SaveFeatureData(features, strTempSrcFile, strLPRJFile, 4); - bSuccess = GSOUtility.MergeTwoDXFFileFeatures(strDestFile, strTempSrcFile); - File.Delete(strTempSrcFile); - } - else - { - GSOFeatures srcFeatures = globeControl1.Globe.DataManager.ReadFeatureData(strDestFile); - int nCount = features.Length; - int i = 0; - for (i = 0; i < nCount; i++) - { - srcFeatures.Add(features[i]); - } - bSuccess = globeControl1.Globe.DataManager.SaveFeatureData(srcFeatures, strDestFile, strLPRJFile, 4); - } - } - else - { - // 如果是dxf,则这样处理 - if (strExt.ToLower() == ".dxf") - { - string strTempSrcFile = strDir + "srcFeatures_dxftmp" + strExt; - globeControl1.Globe.DataManager.SaveFeatureData(features, strTempSrcFile, strProj4, 0); - bSuccess = GSOUtility.MergeTwoDXFFileFeatures(strDestFile, strTempSrcFile); - File.Delete(strTempSrcFile); - } - else - { - GSOFeatures srcFeatures = globeControl1.Globe.DataManager.ReadFeatureData(strDestFile); - int nCount = features.Length; - int i = 0; - for (i = 0; i < nCount; i++) - { - srcFeatures.Add(features[i]); - } - bSuccess = globeControl1.Globe.DataManager.SaveFeatureData(srcFeatures, strDestFile, strProj4, 0); - } - } - return bSuccess; - } /// /// 关闭按钮事件处理 /// diff --git a/FrmHDMAnalysis3.cs b/FrmHDMAnalysis3.cs index 4f73af6..2ada735 100644 --- a/FrmHDMAnalysis3.cs +++ b/FrmHDMAnalysis3.cs @@ -436,29 +436,6 @@ } layerTemp.RemoveAllFeature(); } - private void Export(GSOPoint3d _pnt, double r) - { - GSOPoint3ds pnts = new GSOPoint3ds(); - GSOPoint3d pnt = new GSOPoint3d(); - pnt.X = _pnt.X; - pnt.Y = _pnt.Y; - pnt.Z = _pnt.Z; - pnts.Add(pnt); - pnt.X = _pnt.X; - pnt.Y = _pnt.Y - 0.0000000005; - pnt.Z = _pnt.Z; - pnts.Add(pnt); - GSOGeoPolyline3D line = new GSOGeoPolyline3D(); - line.AddPart(pnts); - GSOGeoPolygon3D polygon = line.CreateBuffer(r * 2, true, 5, true, false); - GSOPoint3ds points = polygon[0]; - GSOGeoPolyline3D newLine = new GSOGeoPolyline3D(); - newLine.AddPart(points); - newLine.AltitudeMode = EnumAltitudeMode.RelativeToGround; - GSOFeature newFeature = new GSOFeature(); - newFeature.Geometry = newLine; - globeControl1.Globe.MemoryLayer.AddFeature(newFeature); - } private void ExportCAD(double a, double b, double r) { diff --git a/FrmHotFuncStat.cs b/FrmHotFuncStat.cs index c980f34..2eb1476 100644 --- a/FrmHotFuncStat.cs +++ b/FrmHotFuncStat.cs @@ -421,13 +421,6 @@ } } - private void HFS_Pderive_Click(object sender, EventArgs e) - { - if (TV_Files.SelectedNode != null) - { - HFSClass.GuideEdit_form("G", TV_Files, int.Parse(((ToolStripMenuItem)sender).Tag.ToString())); - } - } private void 导入ToolStripMenuItem_Click(object sender, EventArgs e) { @@ -530,22 +523,8 @@ } } - private void 导出ToolStripMenuItem1_Click(object sender, EventArgs e) - { - 导出ToolStripMenuItem2_Click(sender, e); - } + - private void TV_HFSSrchRslt_AfterCollapse(object sender, TreeViewEventArgs e) - { - e.Node.ImageIndex = 0; - } - - private void TV_HFSSrchRslt_AfterExpand(object sender, TreeViewEventArgs e) - { - HFSClass.ADD_TreeNode(TV_Files, e.Node); - e.Node.ImageIndex = 1; - } - private void 导出ToolStripMenuItem1_Click_1(object sender, EventArgs e) { if ((TV_HFSSrchRslt.SelectedNode != null) && (TV_HFSSrchRslt.SelectedNode.Parent != null)) diff --git a/FrmLayerControl.cs b/FrmLayerControl.cs index e7917c3..28fa14d 100644 --- a/FrmLayerControl.cs +++ b/FrmLayerControl.cs @@ -312,26 +312,7 @@ layerManagerNode.Expand(); terrainManagerNode.Expand(); } - /// - /// 刷新节点树 - /// - private void RefreshDataTree() - { - layerTree2.Nodes[0].Nodes.Clear(); - Int32 nCount = globeControl2.Globe.Layers.Count; - Int32 i = 0; - for (i = 0; i < nCount; i++) - { - GSODataset dataSpace = globeControl2.Globe.Layers[i].Dataset; - TreeNode node = new TreeNode(); - node.Text = dataSpace.Name; - node.ImageIndex = 0; - node.SelectedImageIndex = 0; - node.Checked = true; - node.Tag = dataSpace; - layerTree2.Nodes[0].Nodes.Add(node); - } - } + /// /// 目标图层按钮事件处理 /// @@ -494,22 +475,8 @@ } } } - /// - /// 改变指定节点的选中状态 - /// - /// - /// - private void CheckTreeNode(TreeNode node, Boolean bChecked) - { - CheckChildTreeNode(node, bChecked); - // 对于kml图层,如果当前处理的节点是true,那么要把所有的祖宗节点置为true - // 只有所有节点都未false,那么这个节点才为false - // CheckFatherTreeNode(node, bChecked); - globeControl1.Globe.Refresh(); - globeControl2.Globe.Refresh(); - - } + private void CheckChildTreeNode(TreeNode node, Boolean bChecked) { if (node == null) @@ -696,59 +663,7 @@ //} //CheckControl(e); } - /// - /// 树节点选中方法 - /// - /// - private void CheckControl(TreeViewEventArgs e) - { - if (e.Action != TreeViewAction.Unknown) - { - if (e.Node != null && !Convert.IsDBNull(e.Node)) - { - CheckParentNode(e.Node); - if (e.Node.Nodes.Count > 0) - { - CheckAllChildNodes(e.Node, e.Node.Checked); - } - } - } - } - /// - /// 改变所有子节点的状态 - /// - /// - /// - private void CheckAllChildNodes(TreeNode pn, bool IsChecked) - { - foreach (TreeNode tn in pn.Nodes) - { - tn.Checked = IsChecked; - if (tn.Tag.ToString().Contains("|")) - { - string nodeTag = tn.Tag.ToString().Split('|')[1]; - GSOLayer layer = globeControl1.Globe.Layers.GetLayerByCaption(nodeTag); - if (layer != null) - { - layer.Visible = IsChecked; - globeControl1.Globe.Refresh(); - } - } - if (tn.Tag is GSOFeature) - { - if (tn.Nodes.Count == 0) - { - GSOFeature feat = tn.Tag as GSOFeature; - feat.Visible = IsChecked; - globeControl1.Globe.Refresh(); - } - } - if (tn.Nodes.Count > 0) - { - CheckAllChildNodes(tn, IsChecked); - } - } - } + /// /// 改变父节点的选中状态,此处为所有子节点不选中时才取消父节点选中,可以根据需要修改 /// diff --git a/FrmLogin.cs b/FrmLogin.cs index 320fdd5..2afe46e 100644 --- a/FrmLogin.cs +++ b/FrmLogin.cs @@ -59,70 +59,6 @@ textBoxPassWord.Clear(); } } - - /// - /// 验证端口号 - /// - /// - private bool ValiPort() - { - Ping p = new Ping();//创建Ping对象p - PingReply pr = p.Send(Utility.localicenseserverip);//向指定IP或者主机名的计算机发送ICMP协议的ping数据包 - if (pr.Status == IPStatus.Success)//如果ping成功 - { - try - { - TcpClient tcpc = new TcpClient(Utility.localicenseserverip, Utility.localicenseserverport);//对IP地址为"192.168.0.105"的计算机的1500端口提出连接申请 - tcpc.Close(); - return true; - } - catch (Exception ex) - { - MessageBox.Show("端口连接错误!" + ex.Message); - return false; - } - } - else - { - int times = 0;//重新连接次数; - int count = 2;//设置尝试次数 - while (times < count) - { - //Thread.Sleep(1000);//等待时间(方便测试的话,你可以改为1000) - pr = p.Send(Utility.localicenseserverip); - - if (pr.Status == IPStatus.Success) - { - try - { - TcpClient tcpc = new TcpClient(Utility.localicenseserverip, Utility.localicenseserverport);//对IP地址为"192.168.0.105"的计算机的1500端口提出连接申请 - tcpc.Close(); - return true; - } - catch (Exception ex) - { - MessageBox.Show("端口连接错误!" + ex.Message); - return false; - } - } - else - { - times++; - if (times < count) - { - continue; - } - else - { - MessageBox.Show("重新尝试连接失败"); - return false; - } - } - - } - return false; - } - } /// /// 验证用户名、密码 /// diff --git a/FrmMetadata.cs b/FrmMetadata.cs index 886f65a..0365372 100644 --- a/FrmMetadata.cs +++ b/FrmMetadata.cs @@ -27,11 +27,7 @@ InitializeComponent(); loadTreeView(layerTree); } - private void FrmMetadata_Load(object sender, EventArgs e) - { - //this.ntLblC.Text = "nn"; - // loadTreeView(layerTree); - } + private void loadTreeView(TreeView tv)//构建图层树 { try diff --git a/FrmMetadataStat.cs b/FrmMetadataStat.cs index 790658a..e7696c6 100644 --- a/FrmMetadataStat.cs +++ b/FrmMetadataStat.cs @@ -197,9 +197,5 @@ } } - private void buttonX1_Click(object sender, EventArgs e) - { - drawChart(); - } } } diff --git a/FrmPatrolerManager.cs b/FrmPatrolerManager.cs index 37f8ffd..9e66aeb 100644 --- a/FrmPatrolerManager.cs +++ b/FrmPatrolerManager.cs @@ -109,82 +109,8 @@ this.winGridViewPager1.AllToExport = table; } - /// - /// 编辑 - /// - /// - /// - private void winGridViewPager1_OnEditSelected(object sender, EventArgs e) - { - - DataGridView grid = sender as DataGridView; - if (grid != null && grid.SelectedRows.Count>0) - { - DataGridViewRow row = grid.SelectedRows[0]; - try - { - long dbid = long.Parse(row.Cells["编号"].Value.ToString()); - String name = row.Cells["姓名"].Value.ToString(); - String sex = row.Cells["性别"].Value.ToString(); - String age = row.Cells["年龄"].Value.ToString(); - string phone = row.Cells["电话"].Value.ToString(); - age = String.IsNullOrEmpty(age.ToString().Trim()) ? "1" : age.ToString().Trim(); - FrmPatrolerEdit frm = new FrmPatrolerEdit(dbid.ToString(), name, age, sex, phone); - frm.reloadGrid += new ReloadPatrolerGrid(LoadData); - frm.ShowDialog(); - winGridViewPager1.Refresh(); - } - catch (Exception ex) - { - MessageBox.Show("编辑失败:" + ex.ToString(), "错误", MessageBoxButtons.OK, MessageBoxIcon.Error); - } - } - else - { - MessageBox.Show("没有选择记录", "提示"); - } - - } - - /// - /// 删除 - /// - /// - /// - private void winGridViewPager1_OnDeleteSelected(object sender, EventArgs e) - { - DataGridView grid = sender as DataGridView; - if (grid != null && grid.SelectedRows.Count > 0) - { - DataGridViewRow row = grid.SelectedRows[0]; - long dbid = long.Parse(row.Cells["编号"].Value.ToString()); - try - { - string state = row.Cells["状态"].Value.ToString(); - if ("在线".Equals(state)) - { - if (MessageBox.Show("确定注销?", "确认", MessageBoxButtons.YesNo, MessageBoxIcon.Question) == DialogResult.Yes) - { - String sql = "update patroler t set t.accountstate='LEAVER' where t.dbid=" + dbid; - OracleUtils.ExecuteNonQuery(OracleUtils.ConnectionString, CommandType.Text, sql); - } - } - else { - MessageBox.Show("人员不在线,无法注销", "信息"); - } - } - catch (Exception ex) - { - MessageBox.Show("人员注销失败:" + ex.ToString(), "错误", MessageBoxButtons.OK, MessageBoxIcon.Error); - } - } - else - { - MessageBox.Show("没有选择记录", "提示"); - } - } - - + + private void LoadData() { int pageIndex = winGridViewPager1.PagerInfo.CurrenetPageIndex; diff --git a/FrmRoadHDM.cs b/FrmRoadHDM.cs index e765313..e871dd5 100644 --- a/FrmRoadHDM.cs +++ b/FrmRoadHDM.cs @@ -333,31 +333,6 @@ this.Cursor = Cursors.Default; } } - - private void Export(GSOPoint3d _pnt, double r) - { - GSOPoint3ds pnts = new GSOPoint3ds(); - GSOPoint3d pnt = new GSOPoint3d(); - pnt.X = _pnt.X; - pnt.Y = _pnt.Y; - pnt.Z = _pnt.Z; - pnts.Add(pnt); - pnt.X = _pnt.X; - pnt.Y = _pnt.Y - 0.0000000005; - pnt.Z = _pnt.Z; - pnts.Add(pnt); - GSOGeoPolyline3D line = new GSOGeoPolyline3D(); - line.AddPart(pnts); - GSOGeoPolygon3D polygon = line.CreateBuffer(r * 2, true, 5, true, false); - GSOPoint3ds points = polygon[0]; - GSOGeoPolyline3D newLine = new GSOGeoPolyline3D(); - newLine.AddPart(points); - newLine.AltitudeMode = EnumAltitudeMode.RelativeToGround; - GSOFeature newFeature = new GSOFeature(); - newFeature.Geometry = newLine; - globeControl1.Globe.MemoryLayer.AddFeature(newFeature); - } - private void ExportCAD(double a, double b, double r) { GSOPoint3ds pnts = new GSOPoint3ds(); diff --git a/FrmUserAdd.cs b/FrmUserAdd.cs index c612ab4..f826427 100644 --- a/FrmUserAdd.cs +++ b/FrmUserAdd.cs @@ -231,24 +231,6 @@ //cbxRegion.SelectedIndexChanged += new EventHandler(cbxRegion_SelectedIndexChanged); } } - /// - /// 下拉框选中项改变事件处理 - /// - /// - /// - private void cbxRegion_SelectedIndexChanged(object sender, EventArgs e) - { - string sql = ""; - //string sql = "select casic_role.\"name\" from casic_role join casic_regionrole on casic_role.\"id\"=casic_regionrole.\"rid\" where casic_regionrole.\"reid\"=" + region[cbxRegion.SelectedItem.ToString().Trim()]; - DataTable dt = OledbHelper.QueryTable(sql); - if (dt != null && dt.Rows.Count > 0) - { - comboBoxExRegionRole.Items.Clear(); - for (int i = 0; i < dt.Rows.Count; i++) - { - comboBoxExRegionRole.Items.Add(dt.Rows[i][0].ToString().Trim());//部门角色 - } - } - } + } } diff --git a/FrmUserManager.cs b/FrmUserManager.cs index 571f0f0..ae254bc 100644 --- a/FrmUserManager.cs +++ b/FrmUserManager.cs @@ -81,11 +81,6 @@ } } } - //创建新用户 - private void buttonX2_Click(object sender, EventArgs e) - { - FrmUserAdd frm = new FrmUserAdd(-1); - frm.ShowDialog(); - } + } } diff --git a/FrmValveStatistics.cs b/FrmValveStatistics.cs index 545d56c..dd76777 100644 --- a/FrmValveStatistics.cs +++ b/FrmValveStatistics.cs @@ -54,7 +54,7 @@ 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") + if (chaFamenStatis.Series["阀门"].Points[m]!=null&&chaFamenStatis.Series["阀门"].Points[m].YValues[0].ToString() != "0") { chaFamenStatis.Series["阀门"].Points[m].Label = chaFamenStatis.Series[0].Points[m].YValues[0].ToString(); } diff --git a/Frm_password_reset.cs b/Frm_password_reset.cs index 7b51039..b9e5dc3 100644 --- a/Frm_password_reset.cs +++ b/Frm_password_reset.cs @@ -41,6 +41,7 @@ } catch (Exception ex) { + LogHelper.WriteLog(typeof(Frm_password_reset), ex.Message); } } private void initCombox() diff --git a/FrmpipeDeepstatis.cs b/FrmpipeDeepstatis.cs index e156db4..1a84d6c 100644 --- a/FrmpipeDeepstatis.cs +++ b/FrmpipeDeepstatis.cs @@ -307,7 +307,7 @@ chart1.Series[j].Points.DataBindXY(dic1.Keys, dic1.Values); for (int m = 0; m < dic1.Values.Count; m++) { - if (chart1.Series[j].Points[m].YValues[0].ToString() != "0") + if (chart1.Series[j].Points[m]!=null&&chart1.Series[j].Points[m].YValues[0].ToString() != "0") { chart1.Series[j].Points[m].Label = chart1.Series[j].Points[m].YValues[0].ToString(); diff --git a/FrmpipeDiametergather.cs b/FrmpipeDiametergather.cs index 30674de..057b09d 100644 --- a/FrmpipeDiametergather.cs +++ b/FrmpipeDiametergather.cs @@ -263,6 +263,7 @@ if (layer != null && layer is GSOFeatureLayer) { GSOFeatureLayer flayer = layer as GSOFeatureLayer; + if (layer == null) return; GSOFeatures features = flayer.GetAllFeatures(); if (features.Length > 0) { diff --git a/FrmpipeMaterialGather.cs b/FrmpipeMaterialGather.cs index c133ec3..398b884 100644 --- a/FrmpipeMaterialGather.cs +++ b/FrmpipeMaterialGather.cs @@ -280,6 +280,7 @@ if (layer != null && layer is GSOFeatureLayer) { GSOFeatureLayer flayer = layer as GSOFeatureLayer; + if (flayer == null) return; GSOFeatures features = flayer.GetAllFeatures(); if (features.Length > 0) { @@ -332,7 +333,7 @@ chart1.Series[j].Points.DataBindXY(dic1.Keys, dic1.Values); for (int m = 0; m < dic1.Values.Count; m++) { - if (chart1.Series[j].Points[m].YValues[0].ToString() != "0") + if (chart1.Series[j].Points[m]!=null&&chart1.Series[j].Points[m].YValues[0].ToString() != "0") { chart1.Series[j].Points[m].Label = chart1.Series[j].Points[m].YValues[0].ToString(); } diff --git a/Frmpipediameterstatis.cs b/Frmpipediameterstatis.cs index c0ed80a..50f8170 100644 --- a/Frmpipediameterstatis.cs +++ b/Frmpipediameterstatis.cs @@ -286,6 +286,7 @@ chart1.Series.Add(layerCaption); GSOFeatureLayer flayer = layer as GSOFeatureLayer; + if (layer == null) return; GSOFeatures features = flayer.GetAllFeatures(); if (features.Length > 0) { diff --git "a/GKT_Forms/F_GKT\346\225\260\346\215\256\350\276\223\345\205\245\350\276\223\345\207\272.cs" "b/GKT_Forms/F_GKT\346\225\260\346\215\256\350\276\223\345\205\245\350\276\223\345\207\272.cs" index c7bffd5..4db7d5d 100644 --- "a/GKT_Forms/F_GKT\346\225\260\346\215\256\350\276\223\345\205\245\350\276\223\345\207\272.cs" +++ "b/GKT_Forms/F_GKT\346\225\260\346\215\256\350\276\223\345\205\245\350\276\223\345\207\272.cs" @@ -198,12 +198,7 @@ } DialogResult = DialogResult.OK;//将当前窗体的对话框返回值设为OK } - private void treeView1_NodeMouseClick(object sender, TreeNodeMouseClickEventArgs e) - { - dir_Ok = comboBox_Disk.Text + e.Node.FullPath; - //dir = comboBox_Disk.Text + e.Node.FullPath; - e.Node.SelectedImageIndex = e.Node.ImageIndex; - } + string tempstr = ""; private void button1_Click(object sender, EventArgs e) { diff --git a/HFS_Forms/Frm_HFSprojedits.cs b/HFS_Forms/Frm_HFSprojedits.cs index 96dd76f..3c232a1 100644 --- a/HFS_Forms/Frm_HFSprojedits.cs +++ b/HFS_Forms/Frm_HFSprojedits.cs @@ -126,16 +126,6 @@ Close(); } - - - private void TB_ProjName_KeyPress(object sender, KeyPressEventArgs e) - { - if (HFSAClass.Files_NameChar(e) == 0) - e.Handled = true; - if (e.KeyChar == '\r') - OK_Click(sender, e); - } - private void Frm_HFSProjedit_Load(object sender, EventArgs e) { @@ -175,10 +165,6 @@ } } - private void Cancel_Click(object sender, EventArgs e) - { - this.Close(); - } private void Cancel_Click_1(object sender, EventArgs e) { diff --git a/MainFrm.cs b/MainFrm.cs index 2c305a0..ed2685b 100644 --- a/MainFrm.cs +++ b/MainFrm.cs @@ -617,7 +617,7 @@ } catch (Exception ex) { - + LogHelper.WriteLog(typeof(MainFrm), ex.Message); } } @@ -1768,7 +1768,7 @@ } catch (Exception ex) { - //LogError.PublishError(ex); + LogHelper.WriteLog(typeof(MainFrm), ex.Message); } } @@ -2026,6 +2026,7 @@ } catch (Exception ex) { + LogHelper.WriteLog(typeof(MainFrm), ex.Message); result = false; } finally @@ -2316,220 +2317,6 @@ string filename = Utility.filename; List g1layername = new List(); /// - /// 构建图层列表目录树 - /// - /// - private void loadTreeView(TreeView tv) - { - try - { - XmlDocument doc = new XmlDocument(); - doc.Load(filename); - XmlNodeList Params1 = doc.SelectNodes("/Params/layers"); - tv.ShowLines = false; - tv.CheckBoxes = true; - - foreach (XmlNode paramsNode in Params1) //layers - { - foreach (XmlNode layerNode in paramsNode) //layer - { - TreeNode nodelayer = new TreeNode(); - string layerName = layerNode.Attributes["label"].Value; - nodelayer.Text = layerName; - - if (layerNode.HasChildNodes != false) - { - tv.Nodes.Add(nodelayer); - foreach (XmlNode layerchildNode in layerNode) //layerchild - { - if (layerchildNode.Name == "layerchild") - { - TreeNode nodelayerchild = new TreeNode(); - string layerType = layerchildNode.Attributes["type"].Value; - string layerName1 = layerchildNode.Attributes["layer"].Value; - string layerchildName = layerchildNode.Attributes["label"].Value; - if (layerType == "locaserver") - { - if (layerchildNode.Attributes["isRoad"] != null) - { - roadLayerName = layerchildName; - } - dictionaryNetLayerNameAndCaption.Add(layerName1, layerchildName); - - nodelayerchild.Text = layerchildName; - nodelayerchild.Tag = layerType + "|" + layerchildName; - nodelayerchild.Checked = true; - nodelayer.Nodes.Add(nodelayerchild); - } - else - { - if (layerchildNode.Attributes["isPipeLine"] != null) - { - m_PipelineLayerNames.Add(layerchildName); - } - if (layerchildNode.Attributes["isWorkWell"] != null) - { - workwellLayerNames.Add(layerchildName); - } - if (layerchildNode.Attributes["isValve"] != null) - { - valueLayerNames.Add(layerchildName); - } - //if (layerchildNode.Attributes["isInstrument"] != null) - if (layerchildNode.Attributes["isAccess"] != null) - { - instrumenLayerNames.Add(layerchildName); - } - //if (layerchildNode.Attributes["isPipeFitting"] != null) - if (layerchildNode.Attributes["isCharacter"] != null) - { - pipefittingLayerNames.Add(layerchildName); - } - bool boollayer = AddLayers(layerName1, layerchildName); - nodelayerchild.Text = layerchildName; - nodelayerchild.Tag = layerType + "|" + layerchildName; - nodelayerchild.Checked = boollayer; - if (layerchildName.Contains("特征管点")) - { - nodelayerchild.Checked = false; - setLayerVisible(layerName1); - } - - nodelayer.Nodes.Add(nodelayerchild); - g1layername.Add(layerName1); - } - } - else if (layerchildNode.Name == "layertype") - { - TreeNode nodelayerchild = new TreeNode(); - string layerType = layerchildNode.Attributes["label"].Value; - nodelayerchild.Text = layerType; - nodelayerchild.Tag = layerType; - nodelayerchild.Checked = true; - nodelayer.Nodes.Add(nodelayerchild); - if (layerchildNode.HasChildNodes == true) - { - foreach (XmlNode childNodeLayer in layerchildNode) - { - if (childNodeLayer.HasChildNodes == true) - { - TreeNode nodelayerchild2 = new TreeNode(); - string layer = childNodeLayer.Attributes["label"].Value; - nodelayerchild2.Text = layer; - nodelayerchild2.Tag = layer; - nodelayerchild2.Checked = true; - nodelayerchild.Nodes.Add(nodelayerchild2); - foreach (XmlNode n in childNodeLayer) - { - TreeNode nodelayerchild1 = new TreeNode(); - string layerName1 = n.Attributes["layer"].Value; - string layerchildName = n.Attributes["label"].Value; - string layerType1 = n.Attributes["type"].Value; - if (n.Attributes["isPipeLine"] != null) - { - m_PipelineLayerNames.Add(layerchildName); - } - if (n.Attributes["isWorkWell"] != null) - { - workwellLayerNames.Add(layerchildName); - } - if (n.Attributes["isValve"] != null) - { - valueLayerNames.Add(layerchildName); - } - if (n.Attributes["isAccess"] != null) - //if (n.Attributes["isInstrument"] != null) - { - instrumenLayerNames.Add(layerchildName); - } - if (n.Attributes["isPipeFitting"] != null) - { - pipefittingLayerNames.Add(layerchildName); - } - bool boollayer = AddLayers(layerName1, layerchildName); - nodelayerchild1.Text = layerchildName; - nodelayerchild1.Tag = layerType1 + "|" + layerchildName; - nodelayerchild1.Checked = boollayer; - if (layerchildName.Contains("特征管点")) - { - nodelayerchild1.Checked = false; - setLayerVisible(layerName1); - } - - nodelayerchild2.Nodes.Add(nodelayerchild1); - - g1layername.Add(layerName1); - } - } - else - { - TreeNode nodelayerchild1 = new TreeNode(); - string layerName1 = childNodeLayer.Attributes["layer"].Value; - string layerchildName = childNodeLayer.Attributes["label"].Value; - string layerType1 = childNodeLayer.Attributes["type"].Value; - if (childNodeLayer.Attributes["isPipeLine"] != null) - { - m_PipelineLayerNames.Add(layerchildName); - } - if (childNodeLayer.Attributes["isWorkWell"] != null) - { - workwellLayerNames.Add(layerchildName); - } - if (childNodeLayer.Attributes["isValve"] != null) - { - valueLayerNames.Add(layerchildName); - } - if (childNodeLayer.Attributes["isAccess"] != null) - //if (childNodeLayer.Attributes["isInstrument"] != null) - { - instrumenLayerNames.Add(layerchildName); - } - if (childNodeLayer.Attributes["isPipeFitting"] != null) - { - pipefittingLayerNames.Add(layerchildName); - } - bool boollayer = AddLayers(layerName1, layerchildName); - nodelayerchild1.Text = layerchildName; - nodelayerchild1.Tag = layerType1 + "|" + layerchildName; - nodelayerchild1.Checked = boollayer; - if (layerchildName.Contains("特征管点")) - { - nodelayerchild1.Checked = false; - setLayerVisible(layerName1); - } - nodelayerchild.Nodes.Add(nodelayerchild1); - g1layername.Add(layerName1); - } - } - } - } - } - } - else - { - tv.Nodes.Add(nodelayer); - } - } - } - - foreach (TreeNode tn in tv.Nodes) - { - if (tn.Nodes.Count > 0) - { - foreach (TreeNode tnChild in tn.Nodes) - { - if (tnChild.Checked) - tn.Checked = true; - } - } - } - } - catch (Exception ex) - { - //LogError.PublishError(ex); - } - } - /// /// 获取目标图层 /// /// @@ -2629,21 +2416,11 @@ } catch (Exception ex) { - //LogError.PublishError(ex); + LogHelper.WriteLog(typeof(MainFrm), ex.Message); return false; } } /// - /// 菜单上的 三维导航 工具按钮 - /// - /// - /// - private void buttonItem86_Click(object sender, EventArgs e) - { - globeControl1.Globe.Action = EnumAction3D.ActionNull; - } - - /// /// 地上模式 菜单按钮 /// /// @@ -3026,67 +2803,11 @@ } Image printImage; - /// - /// 打印 菜单 - /// - /// - /// - private void buttonItem13_Click(object sender, EventArgs e) - { - Point pt1 = new Point(Convert.ToInt32(0), Convert.ToInt32(0)); - Point pt2 = new Point(Convert.ToInt32(panelEx5.Width), Convert.ToInt32(panelEx5.Height)); - int mapWidth = 0; - int mapHeight = 0; - Point pt = getUpperLeftPoint(pt1, pt2, out mapWidth, out mapHeight); - printImage = new Bitmap(Convert.ToInt32(panelEx5.Width), Convert.ToInt32(panelEx5.Height)); - Graphics g = Graphics.FromImage(printImage); - g.CopyFromScreen(pt, new Point(0, 0), new Size(Convert.ToInt32(panelEx5.Width), Convert.ToInt32(panelEx5.Height))); - - PrintDialog pd = new PrintDialog(); - try - { - if (pd.ShowDialog() == DialogResult.OK) //如果确认,将会覆盖所有的打印参数设置 - { - //打印预览 - PrintPreviewDialog ppd = new PrintPreviewDialog(); - ppd.Document = printDocument1; - if (DialogResult.OK == ppd.ShowDialog()) - { - printDocument1.Print(); //打印 - } - } - } - catch - { - printDocument1.PrintController.OnEndPrint(printDocument1, new System.Drawing.Printing.PrintEventArgs()); - } - } - + private void printDocument1_PrintPage(object sender, System.Drawing.Printing.PrintPageEventArgs e) { e.Graphics.DrawImage(printImage, 10, 10); } - - /// - /// 在窗体的底部状态栏上显示 综合管线条件查询结果 - /// - /// - /// - private void ToolStripText(string currentLayer, int dataCount) - { - if (dataCount != 0) - { - double featurelength = PipeLength(currentLayer, 0);// 统计管线的里程数 - - toolStripNumbers.Text = " 管线类型:" + currentLayer + " | 共有:" + Convert.ToString(dataCount - 1) + "条记录"; - toolStripFeatureLength.Text = " 管线里程:" + featurelength.ToString("0.00") + " 米"; - } - else - { - toolStripNumbers.Text = "管线类型: " + currentLayer + "| 共有:" + 0 + " 条记录 | "; - } - } - /// /// 统计管线的里程数 /// @@ -3402,26 +3123,6 @@ } /// - /// 绘制线 菜单 - /// - /// - /// - private void btnAddLine_Click(object sender, EventArgs e) - { - globeControl1.Globe.DestLayerFeatureAdd = globeControl1.Globe.MemoryLayer; - globeControl1.Globe.Action = EnumAction3D.DrawPolyline; - } - /// - /// 绘制面 菜单 - /// - /// - /// - private void btnAddPolygon_Click(object sender, EventArgs e) - { - globeControl1.Globe.DestLayerFeatureAdd = globeControl1.Globe.MemoryLayer; - globeControl1.Globe.Action = EnumAction3D.DrawPolygon; - } - /// /// 图层目录树 右键菜单中的 目标图层 菜单 /// /// @@ -3956,42 +3657,7 @@ // ClearUpDownTraceAnalysis(); //} - /// - /// 显示流向 功能 - /// - /// - /// - /// - private void Flow(object sender, string pipelineNameCN, bool bShow) - { - GSOFeatureLayer layer = globeControl1.Globe.Layers.GetLayerByCaption(pipelineNameCN) as GSOFeatureLayer; - GSOFeatures feats = layer.GetAllFeatures(); - for (int i = 0; i < feats.Length; i++) - { - GSOFeature feat = feats[i]; - GSOLineStyle3D lineStyle = feat.Geometry.Style as GSOLineStyle3D; - if (lineStyle != null) - { - if (lineStyle.ArrowStyle == null) - { - lineStyle.ArrowStyle = new GSOArrowStyle(); - lineStyle.ArrowStyle.BodyWidth = 2; - lineStyle.ArrowStyle.BodyLen = 6; - lineStyle.ArrowStyle.HeadWidth = 8; - lineStyle.ArrowStyle.HeadLen = 10; - lineStyle.ArrowStyle.OutlineVisible = true; - lineStyle.ArrowStyle.OutlineColor = Color.Red; - lineStyle.ArrowStyle.Speed = lineStyle.ArrowStyle.Speed / 2; - lineStyle.ArrowStyle.Play(); - } - lineStyle.ArrowVisible = bShow; - layerTree.SelectedNode = null; - } - } - globeControl1.Globe.Refresh(); - } - - + FrmCloseValves frm; /// /// 关阀分析 功能 @@ -4030,7 +3696,9 @@ curCAYNDataset.CloseValveAnalysis(lineFeature.ID, out arryResNodeID, out arryResValveID, false, true); } catch (Exception e) - { } + { + LogHelper.WriteLog(typeof(MainFrm), e.Message); + } string valveName = lineLayer.Caption; valveName = valveName.Substring(0, valveName.IndexOf("管线")); @@ -4106,7 +3774,7 @@ } catch (Exception e) { - + LogHelper.WriteLog(typeof(MainFrm), e.Message); } //目前只有燃气管线 有阀门 string valveName = lineLayer.Name; @@ -5457,7 +5125,7 @@ } catch (Exception ex) { - //MessageBox.Show(ex.ToString()); + LogHelper.WriteLog(typeof(MainFrm), ex.Message); } finally { @@ -5501,22 +5169,6 @@ } } - - /// - /// 清除所有坑 菜单 - /// - /// - /// - private void buttonItem3_Click(object sender, EventArgs e) - { - //日志记录 - LogManager.saveLog(Utility.userName, this.buttonItem3.Text); - - globeControl1.Globe.RemoveAllPits(); - } - - - ///// ///// 净距分析 菜单 ///// @@ -5554,42 +5206,8 @@ // ribbonBarTP.Visible = buttonItem34.Checked; // ribbonBarTP.Location = new Point(0, 0); //} - /// - /// 大气层 菜单 - /// - /// - /// - private void buttonItem17_Click_1(object sender, EventArgs e) - { - globeControl1.Globe.Atmosphere.Visible = !globeControl1.Globe.Atmosphere.Visible; - buttonItemSH1.Checked = globeControl1.Globe.Atmosphere.Visible; - globeControl1.Refresh(); - } - /// - /// 经纬网 菜单 - /// - /// - /// - private void buttonItem20_Click(object sender, EventArgs e) - { - globeControl1.Globe.LatLonGrid.Visible = !globeControl1.Globe.LatLonGrid.Visible; - buttonItemSH3.Checked = globeControl1.Globe.LatLonGrid.Visible; - globeControl1.Globe.Refresh(); - } - /// - /// 状态条 菜单 - /// - /// - /// - private void buttonItem21_Click_1(object sender, EventArgs e) - { - globeControl1.Globe.StatusBar.Visible = !globeControl1.Globe.StatusBar.Visible; - buttonItemSH4.Checked = globeControl1.Globe.StatusBar.Visible; - globeControl1.Globe.Refresh(); - } - - + /// /// 添加指定路径下的数据 功能 /// @@ -5680,43 +5298,7 @@ // } // return objRes; //} - /// - /// 刷新目录树 功能 - /// - private void RefreshDataTree() - { - layerTree.Nodes[0].Nodes.Clear(); - Int32 nCount = globeControl1.Globe.DataManager.DataSourceCount; - Int32 i = 0; - for (i = 0; i < nCount; i++) - { - GSODataSource dataSpace = globeControl1.Globe.DataManager[i]; - TreeNode node = new TreeNode(); - node.Text = dataSpace.Name; - node.ImageIndex = 0; - node.SelectedImageIndex = 0; - node.Checked = true; - node.Tag = dataSpace; - Int32 nDatasetCount = dataSpace.DatasetCount; - for (Int32 j = 0; j < nDatasetCount; j++) - { - GSODataset dataset = dataSpace[j]; - TreeNode subNode = new TreeNode(); - subNode.Text = dataset.Name; - subNode.ImageIndex = 0; - subNode.SelectedImageIndex = 0; - subNode.Checked = true; - subNode.Tag = dataset; - node.Nodes.Add(subNode); - } - layerTree.Nodes[0].Nodes.Add(node); - } - } - - - - - + /// /// 复合查询 菜单 @@ -5777,34 +5359,7 @@ return false; } - /// - /// 统计指定图层在指定范围内的所有feature对象 - /// - /// - /// - /// - private GSOFeatures Intersect_PointLayer(GSOGeoPolygon3D polygon, string pointLayerName) - { - GSOLayer layer = globeControl1.Globe.Layers.GetLayerByCaption(pointLayerName); - if (layer == null) - return null; - - GSOFeatureLayer flayer = layer as GSOFeatureLayer; - GSOFeatureDataset fdataset = flayer.Dataset as GSOFeatureDataset; - GSOFeatures feats; - if (polygon == null) - { - feats = flayer.GetAllFeatures(); - } - else - { - feats = flayer.FindFeaturesInPolygon(polygon, false); - } - - workWellLen.Add(pointLayerName, feats.Length); - return feats; - } - /// + /// /// 碰撞分析功能界面中 选择管线复选框 选中状态改变事件处理 /// /// @@ -5946,16 +5501,6 @@ MessageBox.Show("表格内容为空!", "提示"); } } - /// - /// 导出CAD 菜单 - /// - /// - /// - private void btnExportCAD_Click(object sender, EventArgs e) - { - FrmExportCADS frm = new FrmExportCADS(globeControl1, m_PipelineLayerNames); - frm.ShowDialog(); - } ///// ///// 区域分析 菜单 @@ -5987,16 +5532,6 @@ } } } - /// - /// 数据验证 菜单 - /// - /// - /// - private void buttonItem80_Click(object sender, EventArgs e) - { - FrmValiData frm = new FrmValiData(globeControl1); - frm.ShowDialog(); - } /// /// 根据指定图层创建图层节点并将节点添加到图层管理节点的子节点集合中 @@ -6018,56 +5553,7 @@ layerManagerNode.Expand(); } } - /// - /// 数据库备份 菜单 - /// - /// - /// - private void btnBackDatabase_Click(object sender, EventArgs e) - { - if (MessageBox.Show("是否确定要备份数据库文件", "信息", MessageBoxButtons.YesNo, MessageBoxIcon.Question) == DialogResult.Yes) - { - try - { - DateTime currentTime = DateTime.Now; - //string Dtime = currentTime.ToShortDateString().ToString("yyyy-MM-dd"); - string Dtime = currentTime.GetDateTimeFormats('D')[0].ToString(); - string Htime = DateTime.Now.ToString("HH时mm分ss秒").Trim(); - string fileName = Dtime + "(" + Htime + ")"; - string pathName = ""; - string sql = "select filename from master..sysdatabases where name='" + Utility.dbdatabase + "'"; - DataTable dt = OledbHelper.ExecuteDataTable(sql); - if (dt != null && dt.Rows.Count > 0) - { - pathName = dt.Rows[0][0].ToString().Trim(); - int count = pathName.LastIndexOf("\\") == -1 ? pathName.LastIndexOf("/") : pathName.LastIndexOf("\\"); - pathName = pathName.Substring(0, count); - } - pathName += "\\管网数据库" + fileName + ".bak"; - - OracleCommand cmdBK = new OracleCommand(); - cmdBK.CommandType = CommandType.Text; - cmdBK.Connection = connBackup; - cmdBK.CommandText = @"backup database " + Utility.dbdatabase + " to disk='" + pathName + "' with init"; - - connBackup.Open(); - cmdBK.ExecuteNonQuery(); - MessageBox.Show("数据库文件备份成功", "提示"); - } - catch (Exception ex) - { - MessageBox.Show(ex.ToString()); - } - finally - { - connBackup.Close(); - } - } - } - - - - + //GSOFeature emitterFeature; // 粒子要素 /// /// 添加火苗 功能 @@ -6598,361 +6084,15 @@ } } - - ///// - /// 添加用户仓库 菜单 - /// - /// - /// - private void buttonItem108_Click(object sender, EventArgs e) - { - FrmUserRepo frm = new FrmUserRepo(-1); - frm.ShowDialog(); - } - /// - /// 用户仓库管理 菜单 - /// - /// - /// - private void buttonItem111_Click(object sender, EventArgs e) - { - FrmUserRepoMgr frm = new FrmUserRepoMgr(); - frm.ShowDialog(); - } - /// - /// 添加分系统 菜单 - /// - /// - /// - private void buttonItem112_Click(object sender, EventArgs e) - { - //FrmAPP frm = new FrmAPP(-1); - //frm.ShowDialog(); - } - /// - /// 分系统管理 菜单 - /// - /// - /// - private void buttonItem113_Click(object sender, EventArgs e) - { - //FrmAPPMgr frm = new FrmAPPMgr(); - //frm.ShowDialog(); - } - /// - /// 添加操作 菜单 - /// - /// - /// - private void buttonItem114_Click(object sender, EventArgs e) - { - FrmOper frm = new FrmOper(-1); - frm.ShowDialog(); - } - /// - /// 操作管理 菜单 - /// - /// - /// - private void buttonItem115_Click(object sender, EventArgs e) - { - FrmOperMgr frm = new FrmOperMgr(); - frm.ShowDialog(); - } - /// - /// 添加资源 菜单 - /// - /// - /// - private void buttonItem116_Click(object sender, EventArgs e) - { - FrmRESC frm = new FrmRESC(-1); - frm.ShowDialog(); - } - /// - /// 资源管理 菜单 - /// - /// - /// - private void buttonItem117_Click(object sender, EventArgs e) - { - FrmRESCMgr frm = new FrmRESCMgr(); - frm.ShowDialog(); - } - /// - /// 添加权限 菜单 - /// - /// - /// - private void buttonItem118_Click(object sender, EventArgs e) - { - FrmPerm frm = new FrmPerm(-1); - frm.ShowDialog(); - } - /// - /// 权限管理 菜单 - /// - /// - /// - private void buttonItem119_Click(object sender, EventArgs e) - { - FrmPermMgr frm = new FrmPermMgr(); - frm.ShowDialog(); - } - /// - /// 添加访问控制 菜单 - /// - /// - /// - private void buttonItem120_Click(object sender, EventArgs e) - { - FrmAccess frm = new FrmAccess(-1); - frm.ShowDialog(); - } - /// - /// 访问控制管理 菜单 - /// - /// - /// - private void buttonItem121_Click(object sender, EventArgs e) - { - FrmAccessMgr frm = new FrmAccessMgr(); - frm.ShowDialog(); - } - /// - /// 部门类型管理 菜单 - /// - /// - /// - private void buttonItem122_Click(object sender, EventArgs e) - { - FrmRegionTypeMgr frm = new FrmRegionTypeMgr(); - frm.ShowDialog(); - } - /// - /// 用户信息管理 菜单 - /// - /// - /// - private void buttonItem128_Click_1(object sender, EventArgs e) - { - FrmUserManager frm = new FrmUserManager(); - frm.ShowDialog(); - } - /// - /// 添加角色 菜单 - /// - /// - /// - private void 添加角色_Click(object sender, EventArgs e) - { - FrmRole frm = new FrmRole(-1); - frm.ShowDialog(); - } - /// - /// 所有角色管理 菜单 - /// - /// - /// - private void 角色管理_Click(object sender, EventArgs e) - { - FrmRoleMgr frm = new FrmRoleMgr(); - frm.ShowDialog(); - } - - /// - /// 部门角色管理 菜单 - /// - /// - /// - private void buttonItem133_Click(object sender, EventArgs e) - { - FrmRegionRoleMgr frm = new FrmRegionRoleMgr(); - frm.ShowDialog(); - } - /// - /// 部门管理 菜单 - /// - /// - /// - private void buttonItem130_Click(object sender, EventArgs e) - { - FrmRegionMgr frm = new FrmRegionMgr(); - frm.ShowDialog(); - } - - /// - /// 日志管理 菜单 - /// - /// - /// - private void buttonItem135_Click(object sender, EventArgs e) - { - FrmLogManager frm = new FrmLogManager(); - frm.ShowDialog(); - } - /// - /// 传感器信息查询 菜单 - /// - /// - /// - private void buttonItem131_Click_1(object sender, EventArgs e) - { - GSOFeature selectedFeature = globeControl1.Globe.SelectedObject; - if (selectedFeature == null) - { - MessageBox.Show("请选择一个传感器对象!", "提示", MessageBoxButtons.OK, MessageBoxIcon.Information); - } - else - { - if (selectedFeature.Geometry != null && selectedFeature.Geometry.Type == EnumGeometryType.GeoModel) - { - GSOLayer layer = globeControl1.Globe.SelectedObjectLayer; - string tabelName = getTableName(layer.Caption); - string eqtID = selectedFeature.Description.Trim(); - if (tabelName != "" && eqtID != "") - { - string fields = getFields(tabelName); - if (fields != "") - { - string sql = "select " + fields + " from " + Utility.sensorDatabase + "." + tabelName + " where EqtID=" + eqtID + " order by RecordDate desc limit 1;"; - DataTable dt = MySqlHelper.queryDataTable(sql); - if (dt != null && dt.Rows.Count > 0) - { - FrmQueryMessage.ShowForm(this, dt, layer.Caption); - //queryMessage.Show(this); - } - else - { - MessageBox.Show("没有查询到相关信息!", "提示"); - } - } - else - { - MessageBox.Show("配置文件 \"sensorConfig.xml\" 有误!", "提示"); - } - } - else - { - MessageBox.Show("请选择一个传感器对象!", "提示"); - } - } - else - { - MessageBox.Show("请选择一个传感器对象!", "提示", MessageBoxButtons.OK, MessageBoxIcon.Information); - } - } - } - /// - /// 根据指定的图层的caption属性的值在配置文件中查找对应的数据库中的表的名称 - /// - /// 图层的caption属性的值 - /// 对应的数据库中的表的名称 - private string getTableName(string name) - { - string tabelName = ""; - if (Utility.sensorMarkerLayers != null) - { - for (int i = 0; i < Utility.sensorMarkerLayers.Count; i++) - { - MarkerLayer mLayer = Utility.sensorMarkerLayers[i]; - if (mLayer.layerName == name) - { - tabelName = mLayer.tableName; - break; - } - } - } - return tabelName; - } - /// - /// 根据数据库中的表的名称 查找对应的表中的字段名称的集合 - /// - /// 数据库中的表的名称 - /// 对应的表中的字段名称的集合 - private string getFields(string tabelName) - { - string fields = ""; - if (Utility.sensorMarkerLayers != null) - { - for (int i = 0; i < Utility.sensorMarkerLayers.Count; i++) - { - MarkerLayer mLayer = Utility.sensorMarkerLayers[i]; - if (mLayer.tableName.Trim() == tabelName.Trim()) - { - if (mLayer.fields != null) - { - foreach (string key in mLayer.fields.Keys) - { - string value = mLayer.fields[key]; - fields += tabelName.Trim() + "." + key + " as " + value + ","; - } - fields = fields.Remove(fields.Length - 1); - } - break; - } - } - } - return fields; - } - - /// - /// 历史曲线查询 菜单 - /// - /// - /// - private void buttonItem132_Click(object sender, EventArgs e) - { - GSOFeature selectedFeature = globeControl1.Globe.SelectedObject; - if (selectedFeature == null) - { - MessageBox.Show("请选择一个对象!", "提示", MessageBoxButtons.OK, MessageBoxIcon.Information); - } - else - { - if (selectedFeature.Geometry != null && selectedFeature.Geometry.Type == EnumGeometryType.GeoModel) - { - GSOLayer layer = globeControl1.Globe.SelectedObjectLayer; - string tabelName = getTableName(layer.Caption); - string eqtID = selectedFeature.Description; - if (tabelName != "" && eqtID != "") - { - FrmQueryHistory.ShowForm(this, tabelName, eqtID); - } - else - { - MessageBox.Show("请选择一个传感器对象!", "提示"); - } - } - else - { - MessageBox.Show("请选择一个传感器对象!", "提示", MessageBoxButtons.OK, MessageBoxIcon.Information); - } - } - } - + //定时检查传感器的状态 public System.Windows.Forms.Timer timerOfSensor = null; public int alarmValueLiuLiang = 0; public int alarmValueYaLi = 0; public int alarmValueYeTi = 0; public int alarmValueZaoSheng = 0; - /// - /// 传感器在线报警 菜单 - /// - /// - /// - private void buttonItem134_Click(object sender, EventArgs e) - { - if (timerOfSensor == null) - { - timerOfSensor = new System.Windows.Forms.Timer(); - timerOfSensor.Interval = 30000; - timerOfSensor.Tick += new EventHandler(timerOfSensor_Tick); - } - FrmQuerySensorAlarm.ShowForm(this); - } + /// /// 传感器报警 功能中的 定时器 的触发事件处理 /// @@ -7016,6 +6156,7 @@ } catch (Exception ex) { + LogHelper.WriteLog(typeof(MainFrm), ex.Message); continue; } } @@ -7025,145 +6166,7 @@ } } - - /// - /// 沿线运动 菜单 - /// - /// - /// - private void buttonItem138_Click(object sender, EventArgs e) - { - if (globeControl1.Globe.SelectedObject == null) - { - MessageBox.Show("请先选择一条线!", "提示", MessageBoxButtons.OK, MessageBoxIcon.Exclamation); - return; - } - - GSOFeature lineFeature = globeControl1.Globe.SelectedObject; - if (lineFeature.Geometry == null || lineFeature.Geometry.Type != EnumGeometryType.GeoPolyline3D) - { - MessageBox.Show("请先选择一条线!", "提示", MessageBoxButtons.OK, MessageBoxIcon.Exclamation); - return; - } - - OpenFileDialog dlg = new OpenFileDialog(); - dlg.Filter = "*.gcm;*.3ds|*.gcm;*.3ds|*.3ds|*.3ds|*.gcm|*.gcm"; - if (dlg.ShowDialog() == DialogResult.OK) - { - GSOGeoModel model = new GSOGeoModel(); - model.FilePath = dlg.FileName; - - GSOGeoDynamicRoute dynamicRoute = new GSOGeoDynamicRoute(); - dynamicRoute.ActorGeometry = model; - - GSORoute route = new GSORoute(); - GSOGeoPolyline3D geoline = (GSOGeoPolyline3D)lineFeature.Geometry; - for (int i = 0; i < geoline[0].Count; i++) - { - route.Add(geoline[0][i]); - } - route.CircleRoute = false; - route.Speed = 30; - route.RotateSpeed = 50; - route.AltitudeMode = geoline.AltitudeMode; - dynamicRoute.Route = route; - - GSOFeature feature = new GSOFeature(); - - dynamicRoute.Play(); - feature.Geometry = dynamicRoute; - - //GSOLabel gsoLabel = new GSOLabel(); - //gsoLabel.Text = "模型测试"; - //feature.Label = gsoLabel; - globeControl1.Globe.MinModelVisibleSize = 0; - - globeControl1.Globe.MemoryLayer.AddFeature(feature); - globeControl1.Globe.Refresh(); - } - } - /// - /// 回退 菜单 - /// - /// - /// - private void buttonItem99_Click(object sender, EventArgs e) - { - globeControl1.Globe.UnDoEdit(); - } - /// - /// 前进 菜单 - /// - /// - /// - private void buttonItem100_Click(object sender, EventArgs e) - { - globeControl1.Globe.ReDoEdit(); - } - /// - /// 水平净距 功能界面中的 标签内容改变事件处理 - /// - /// - /// - private void textBoxX4_TextChanged(object sender, EventArgs e) - { - string valueJingJu = textBoxX4.Text.Trim(); - if (valueJingJu != "") - { - double value = 0; - bool bl = double.TryParse(valueJingJu, out value); - if (bl) - { - labelX24.Text = "水平净距小于" + value.ToString() + "米的管线有:"; - } - } - } - /// - /// 垂直净距 功能界面中的 标签内容改变事件处理 - /// - /// - /// - private void textBoxX2_TextChanged(object sender, EventArgs e) - { - string valueJingJu = textBoxX2.Text.Trim(); - if (valueJingJu != "") - { - double value = 0; - bool bl = double.TryParse(valueJingJu, out value); - if (bl) - { - labelX23.Text = "垂直净距小于" + value.ToString() + "米的管线有:"; - } - } - } - /// - /// 覆土分析 功能界面中的 标签内容改变事件处理 - /// - /// - /// - private void textBoxX3_TextChanged(object sender, EventArgs e) - { - string valueJingJu = textBoxX3.Text.Trim(); - if (valueJingJu != "") - { - double value = 0; - bool bl = double.TryParse(valueJingJu, out value); - if (bl) - { - labelX17.Text = "覆土深度小于" + value.ToString() + "米的管线有:"; - } - } - } - - /// - /// 传感器分类查询 全区域 菜单 - /// - /// - /// - private void buttonItemSensor全区域查询_Click(object sender, EventArgs e) - { - FrmAccessoriesSensor.ShowForm(globeControl1, instrumenLayerNames, 0); - } + /// /// 传感器分类查询 绘制区域 菜单 /// @@ -7224,170 +6227,10 @@ layerTemp.RemoveAllFeature(); globeControl1.Refresh(); } - /// - /// 数字预处理 功能 - /// - /// - /// - private void 数字预处理buttonItem140_Click(object sender, EventArgs e) - { - FrmEditShapeFile frm = new FrmEditShapeFile(globeControl1); - frm.ShowDialog(this); - } - - - /// - /// 导出矢量 功能 将图层导出为kml和shp格式数据 - /// - /// - /// - private void 导出矢量buttonItem140_Click(object sender, EventArgs e) - { - /* - List m_PipelineLayerNames = new List();//线图层名称 - List workwellLayerNames = new List();//工井图层名称 - List valueLayerNames = new List();//阀门图层名称 - List instrumenLayerNames = new List();//附属物图层名称 - List pipefittingLayerNames = new List();//管件图层名称 - */ - List listVectorNames = new List(); - for (int i = 0; i < m_PipelineLayerNames.Count; i++) - { - if (m_PipelineLayerNames[i] == "移动" || m_PipelineLayerNames[i] == "联通" - || m_PipelineLayerNames[i] == "电信" || m_PipelineLayerNames[i] == "共通" - || m_PipelineLayerNames[i] == "有限电视" || m_PipelineLayerNames[i] == "交通信号" - || m_PipelineLayerNames[i] == "供电") - { - continue; - } - if (listVectorNames.Contains(m_PipelineLayerNames[i]) == false) - { - listVectorNames.Add(m_PipelineLayerNames[i]); - } - } - for (int i = 0; i < valueLayerNames.Count; i++) - { - if (listVectorNames.Contains(valueLayerNames[i]) == false) - { - listVectorNames.Add(valueLayerNames[i]); - } - } - for (int i = 0; i < workwellLayerNames.Count; i++) - { - if (listVectorNames.Contains(workwellLayerNames[i]) == false) - { - listVectorNames.Add(workwellLayerNames[i]); - } - } - for (int i = 0; i < instrumenLayerNames.Count; i++) - { - if (listVectorNames.Contains(instrumenLayerNames[i]) == false) - { - listVectorNames.Add(instrumenLayerNames[i]); - } - } - for (int i = 0; i < pipefittingLayerNames.Count; i++) - { - if (listVectorNames.Contains(pipefittingLayerNames[i]) == false) - { - listVectorNames.Add(pipefittingLayerNames[i]); - } - } - FrmExportVector frm = new FrmExportVector(globeControl1, listVectorNames); - frm.ShowDialog(); - } string citySevenLineType = ""; string cityServerLineName = ""; /// - /// 绘制城市七线 功能按钮 - /// - /// - /// - private void 绘制城市七线buttonItem140_Click(object sender, EventArgs e) - { - FrmCitySevenLineType frm = new FrmCitySevenLineType(); - if (frm.ShowDialog() == DialogResult.OK) - { - globeControl1.Globe.Action = EnumAction3D.DrawPolyline; - m_isDrawCitySevenLine = true; - m_isDrawTunnel = false; - m_AddPipeLine = false; - this.citySevenLineType = frm.citySevenLineType; - this.cityServerLineName = frm.citySevenLineName; - switch (frm.citySevenLineType) - { - case "城市红线": - GSOLayer layerRed = globeControl1.Globe.Layers.GetLayerByCaption(frm.citySevenLineType); - if (layerRed != null) - { - globeControl1.Globe.DestLayerFeatureAdd = layerRed; - layerRed.Editable = true; - } - break; - case "城市橙线": - GSOLayer layerOrange = globeControl1.Globe.Layers.GetLayerByCaption(frm.citySevenLineType); - if (layerOrange != null) - { - globeControl1.Globe.DestLayerFeatureAdd = layerOrange; - layerOrange.Editable = true; - } - break; - case "城市黄线": - GSOLayer layerYellow = globeControl1.Globe.Layers.GetLayerByCaption(frm.citySevenLineType); - if (layerYellow != null) - { - globeControl1.Globe.DestLayerFeatureAdd = layerYellow; - layerYellow.Editable = true; - } - break; - case "城市绿线": - GSOLayer layerGreen = globeControl1.Globe.Layers.GetLayerByCaption(frm.citySevenLineType); - if (layerGreen != null) - { - globeControl1.Globe.DestLayerFeatureAdd = layerGreen; - layerGreen.Editable = true; - } - break; - case "城市蓝线": - GSOLayer layerBlue = globeControl1.Globe.Layers.GetLayerByCaption(frm.citySevenLineType); - if (layerBlue != null) - { - globeControl1.Globe.DestLayerFeatureAdd = layerBlue; - layerBlue.Editable = true; - } - break; - case "城市紫线": - GSOLayer layerPurple = globeControl1.Globe.Layers.GetLayerByCaption(frm.citySevenLineType); - if (layerPurple != null) - { - globeControl1.Globe.DestLayerFeatureAdd = layerPurple; - layerPurple.Editable = true; - } - break; - case "城市黑线": - GSOLayer layerBlack = globeControl1.Globe.Layers.GetLayerByCaption(frm.citySevenLineType); - if (layerBlack != null) - { - globeControl1.Globe.DestLayerFeatureAdd = layerBlack; - layerBlack.Editable = true; - } - break; - } - } - } - /// - /// 七线审核 功能按钮 - /// - /// - /// - private void 七线审核buttonItem141_Click(object sender, EventArgs e) - { - FrmCityServerLineAnalysis frm = new FrmCityServerLineAnalysis(globeControl1, m_PipelineLayerNames); - frm.ShowDialog(this); - } - - /// /// 间距分析 开始分析按钮 分析绘制的七线和管线的距离是否符合标准 /// /// @@ -7666,25 +6509,6 @@ } } - - - /// - /// 管线自动缩进 菜单 - /// - /// - /// - private void 管线自动缩进buttonItem140_Click(object sender, EventArgs e) - { - FrmPipelineIndented frm = new FrmPipelineIndented(globeControl1, m_PipelineLayerNames, workwellLayerNames); - frm.ShowDialog(this); - } - - private void btnExportCADs_Click(object sender, EventArgs e) - { - - } - - /// /// 统计指定图层在指定范围内的所有feature对象 /// @@ -7755,8 +6579,6 @@ } - - //设置图层为隐藏 private void setLayerVisible(string layerName) { @@ -7765,27 +6587,7 @@ globeControl1.Globe.Refresh(); } - /// - /// 连接数据库 - /// - /// - /// - private void buttonItem129_Click(object sender, EventArgs e) - { - //保存日志 - LogManager.saveLog(Utility.userName, this.buttonItemSJGL4_1.Text); - - FrmDatabaseParaSetting2 frm = new FrmDatabaseParaSetting2(globeControl1); - if (frm.ShowDialog() == DialogResult.OK) - { - ds = FrmDatabaseParaSetting2.ds; - if (ds != null) - { - ds.IsCloseSaved = false; - } - } - } - + /// /// 清除渲染结果 /// @@ -7803,112 +6605,8 @@ layerTemp.RemoveAllFeature(); globeControl1.Refresh(); } - - /// - /// 绘制垂线 - /// - /// - /// - private void drawCLine(GSOPoint3d fpt, GSOPoint3d tpt) - { - GSOGeoPolyline3D pline = new GSOGeoPolyline3D(); - GSOPoint3ds pts = new GSOPoint3ds(); - pts.Add(fpt); - pts.Add(tpt); - pline.AddPart(pts); - - GSOGeoPoint3D fptg = new GSOGeoPoint3D(); - GSOGeoPoint3D tptg = new GSOGeoPoint3D(); - fptg.X = fpt.X; - fptg.Y = fpt.Y; - fptg.Z = 0; - tptg.X = tpt.X; - tptg.Y = tpt.Y; - tptg.Z = 0; - - GSOFeature gf = new GSOFeature(); - gf.Geometry = pline; - - globeControl1.Globe.MemoryLayer.AddFeature(gf); - - } - /// - /// 红线审核 - /// - /// - /// - private void buttonItem138_Click_2(object sender, EventArgs e) - { - - } - /// - /// 比较两个点是否是同一个点 - /// - /// - /// - /// - private bool comparePoint(GSOPoint3d pt1, GSOPoint3d pt2) - { - double x1 = 0; double y1 = 0; - double x2 = 0; double y2 = 0; - x1 = pt1.X; - y1 = pt1.Y; - x2 = pt2.X; - y2 = pt2.Y; - if ((x1 == x2) && (y1 == y2)) - { - return true; - } - return false; - } - /// - /// 获得点到线的垂线距离及垂点 - /// - /// - /// - /// - /// - private void comparePointLine(GSOPoint3d point, GSOGeoPolyline3D line, out double length, out GSOPoint3d pointChuiDian) - { - GSOPoint3d lineStartPoint = line[0][0]; - GSOPoint3d lineEndPoint = line[0][1]; - GSOGeoPolyline3D lineAB = new GSOGeoPolyline3D(); - GSOPoint3ds pointsAB = new GSOPoint3ds(); - pointsAB.Add(point); - pointsAB.Add(lineStartPoint); - lineAB.AddPart(pointsAB); - double lengthAB = lineAB.GetSpaceLength(false, 6378137.0); - double xieLvAB = getXieLu("", point.X, point.Y, lineStartPoint.X, lineStartPoint.Y); - double xieLvBC = getXieLu("", lineStartPoint.X, lineStartPoint.Y, lineEndPoint.X, lineEndPoint.Y); - - double tanABC = Math.Abs(xieLvAB - xieLvBC) / (1 + xieLvAB * xieLvBC); - double angle = Math.Atan(tanABC); - //if (angle > Math.PI / 2) //落在外边 - //{ - // length = 0; - //} - double lengthAD = lengthAB * Math.Sin(angle); - length = Math.Abs(lengthAD); - double lengthBD = lengthAB * Math.Cos(angle); - - GSOPoint2d point2dStart = Latlon_2_XYZ(lineStartPoint.X, lineStartPoint.Y); - double bBC = point2dStart.Y - xieLvBC * point2dStart.X; - GSOPoint2d point2dEnd = new GSOPoint2d(); - point2dEnd.X = point2dStart.X + 100; - point2dEnd.Y = point2dEnd.X * xieLvBC + bBC; - point2dEnd = XYZ_2_Latlon(point2dEnd.X, point2dEnd.Y); - - GSOPoint3d pointEnd = new GSOPoint3d(); - pointEnd.X = point2dEnd.X; - pointEnd.Y = point2dEnd.Y; - GSOGeoPolyline3D lineYanShen = new GSOGeoPolyline3D(); - GSOPoint3ds pointsYanShen = new GSOPoint3ds(); - pointsYanShen.Add(lineStartPoint); - pointsYanShen.Add(pointEnd); - lineYanShen.AddPart(pointsYanShen); - GSOGeoPolyline3D lineSegment = lineYanShen.GetSegment(0, lengthBD); - pointChuiDian = lineSegment[0][1]; - } + + /// /// 获得斜率 /// @@ -8044,255 +6742,6 @@ } /// - /// 获取与点相连的所有线以及线的点的集合 - /// - /// 选定的点所在的线 - /// 选定的点 - /// 面中不完全包含的除起点线之外所有的线 - /// 选定的点所在的点的集合 - /// 所有以选定线为起点的点的集合 - /// - private List getFeaturesPoints(GSOFeature featureSelect, GSOPoint3d lineStart, GSOFeatures selectFeatures, GSOPoint3ds ps, List listPS) - { - GSOFeatures fsStart = new GSOFeatures(); - for (int n = 0; n < selectFeatures.Length; n++) - { - if (featureSelect.ID == selectFeatures[n].ID) - { - continue; - } - GSOGeoPolyline3D newLine = selectFeatures[n].Geometry as GSOGeoPolyline3D; - if (newLine != null && newLine.PartCount > 0) - { - GSOPoint3d newLineStart = newLine[0][0]; - GSOPoint3d newLineEnd = newLine[0][newLine[0].Count - 1]; - if (lineStart.X == newLineEnd.X && lineStart.Y == newLineEnd.Y) - { - GSOPoint3ds psAdd = new GSOPoint3ds(); - for (int k = newLine[0].Count - 1; k >= 0; k--) - { - psAdd.Add(newLine[0][k]); - } - newLine[0] = psAdd; - fsStart.Add(selectFeatures[n]); - - } - else if (lineStart.X == newLineStart.X && lineStart.Y == newLineStart.Y) - { - fsStart.Add(selectFeatures[n]); - - } - } - } - if (fsStart.Length > 0) - { - for (int m = 0; m < fsStart.Length; m++) - { - GSOGeoPolyline3D lineFsStart = fsStart[m].Geometry as GSOGeoPolyline3D; - if (lineFsStart != null && lineFsStart.PartCount > 0) - { - GSOPoint3ds psAdd = ps.Clone(); - for (int k = 0; k < lineFsStart[0].Count; k++) - { - psAdd.Add(lineFsStart[0][k]); - } - listPS = getFeaturesPoints(fsStart[m], lineFsStart[0][lineFsStart[0].Count - 1], selectFeatures, psAdd, listPS); - } - } - } - else - { - listPS.Add(ps); - } - return listPS; - } - - /// - /// 获取切割面的线 - /// - /// 不完全包含在面中的所有线 - /// 完全包含在面中的所有线 - /// 线 - private GSOFeature getLineFromGSOFeatures(GSOFeatures features, GSOFeatures featuresTrue) - { - //1. 当线对象数组的长度为0时,返回空 - if (features.Length == 0) - { - return null; - } - //2. 当线对象数组的长度为1时,返回这条线 - if (features.Length == 1) - { - return features[0]; - } - //3. 当线对象数组的长度大于1时,计算所有线组成的最长线 - - //3.1 获取所有不完全包含在面中的对象selectFeatures - GSOFeatures selectFeatures = new GSOFeatures(); - for (int a = 0; a < features.Length; a++) - { - selectFeatures.Add(features[a].Clone()); - } - //3.2 删除features中完全包含在面中的线,获取和面的边界相交的线对象 - for (int a = 0; a < featuresTrue.Length; a++) - { - for (int b = 0; b < features.Length; b++) - { - if (featuresTrue[a].ID == features[b].ID) - { - features.Remove(b); - break; - } - } - } - //3.3 如果和面的边界相交的线的数量为0,返回空 - if (features.Length == 0) - { - return null; - } - //3.4 获取第一条和面的边界相交的线featureInOutPolygon - GSOFeature featureInOutPolygon = features[0]; - //3.5 从所有的线中删除featureInOutPolygon - for (int a = 0; a < selectFeatures.Length; a++) - { - if (selectFeatures[a].ID == featureInOutPolygon.ID) - { - selectFeatures.Remove(a); - break; - } - } - //listPS存储所有从featureInOutPolygon出发的点的集合 - List listPS = new List(); - //3.5 获取与featureInOutPolygon相连的线的集合 - GSOGeoPolyline3D line = featureInOutPolygon.Geometry as GSOGeoPolyline3D; - if (line != null && line.PartCount > 0) - { - GSOPoint3d lineStart = line[0][0]; - GSOPoint3d lineEnd = line[0][line[0].Count - 1]; - #region//获取和featureInOutPolygon的起点相连的线 - GSOFeatures fsStart = new GSOFeatures(); - for (int n = 0; n < selectFeatures.Length; n++) - { - GSOGeoPolyline3D newLine = selectFeatures[n].Geometry as GSOGeoPolyline3D; - if (newLine != null && newLine.PartCount > 0) - { - GSOPoint3d newLineStart = newLine[0][0]; - GSOPoint3d newLineEnd = newLine[0][newLine[0].Count - 1]; - if (lineStart.X == newLineEnd.X && lineStart.Y == newLineEnd.Y) - { - GSOPoint3ds psAdd = new GSOPoint3ds(); - for (int k = newLine[0].Count - 1; k >= 0; k--) - { - psAdd.Add(newLine[0][k]); - } - newLine[0] = psAdd; - fsStart.Add(selectFeatures[n]); - - } - else if (lineStart.X == newLineStart.X && lineStart.Y == newLineStart.Y) - { - fsStart.Add(selectFeatures[n]); - } - } - } - #endregion - - #region//获取和featureInOutPolygon的终点相连的线 - GSOFeatures fsEnd = new GSOFeatures(); - for (int n = 0; n < selectFeatures.Length; n++) - { - GSOGeoPolyline3D newLine = selectFeatures[n].Geometry as GSOGeoPolyline3D; - if (newLine != null && newLine.PartCount > 0) - { - GSOPoint3d newLineStart = newLine[0][0]; - GSOPoint3d newLineEnd = newLine[0][newLine[0].Count - 1]; - if (lineEnd.X == newLineStart.X && lineEnd.Y == newLineStart.Y) - { - fsEnd.Add(selectFeatures[n]); - - } - else if (lineEnd.X == newLineEnd.X && lineEnd.Y == newLineEnd.Y) - { - GSOPoint3ds psAdd = new GSOPoint3ds(); - for (int k = newLine[0].Count - 1; k >= 0; k--) - { - psAdd.Add(newLine[0][k]); - } - newLine[0] = psAdd; - fsEnd.Add(selectFeatures[n]); - - } - } - } - #endregion - - //3.6 将featureInOutPolygon的所有点和与之起点相连的线的所有点组成一个点的集合并添加到listPS中 - if (fsStart.Length > 0 && fsEnd.Length == 0) - { - for (int m = 0; m < fsStart.Length; m++) - { - GSOGeoPolyline3D lineFsStart = fsStart[m].Geometry as GSOGeoPolyline3D; - if (lineFsStart != null && lineFsStart.PartCount > 0) - { - GSOPoint3ds psAdd = new GSOPoint3ds(); - for (int k = line[0].Count - 1; k >= 0; k--) - { - psAdd.Add(line[0][k]); - } - for (int k = 0; k < lineFsStart[0].Count; k++) - { - psAdd.Add(lineFsStart[0][k]); - } - - listPS = getFeaturesPoints(fsStart[m], lineFsStart[0][lineFsStart[0].Count - 1], selectFeatures, psAdd, listPS); - - } - } - } - //3.6 将featureInOutPolygon的所有点和与之终点相连的线的所有点组成一个点的集合并添加到listPS中 - else if (fsStart.Length == 0 && fsEnd.Length > 0) - { - for (int n = 0; n < fsEnd.Length; n++) - { - GSOGeoPolyline3D lineFsEnd = fsEnd[n].Geometry as GSOGeoPolyline3D; - if (lineFsEnd != null && lineFsEnd.PartCount > 0) - { - GSOPoint3ds psAdd = new GSOPoint3ds(); - for (int k = 0; k < line[0].Count - 1; k++) - { - psAdd.Add(line[0][k]); - } - for (int k = 0; k < lineFsEnd[0].Count; k++) - { - psAdd.Add(lineFsEnd[0][k]); - } - //获取线fsEnd[n]的另一个端点相连的线并记录该线的点的集合 - listPS = getFeaturesPoints(fsEnd[n], lineFsEnd[0][lineFsEnd[0].Count - 1], selectFeatures, psAdd, listPS); - } - } - } - } - - //3.7 获取所有以featureInOutPolygon为起点的点的集合组成的线中的最长的线 - double maxLength = 0; - GSOFeature featureNew = new GSOFeature(); - for (int h = 0; h < listPS.Count; h++) - { - GSOGeoPolyline3D lineNew = new GSOGeoPolyline3D(); - lineNew.AddPart(listPS[h]); - GSOLabel label = new GSOLabel(); - label.Text = h.ToString(); - featureNew.Label = label; - double length = lineNew.GetSpaceLength(true, 6378137); - if (length > maxLength) - { - featureNew.Geometry = lineNew; - } - } - - return featureNew; - } - /// /// 更新最大最小状态 /// /// @@ -8340,219 +6789,6 @@ - private void buttonItem139_Click(object sender, EventArgs e) - { - - string filepath = ""; - //日志记录 - OpenFileDialog dlg = new OpenFileDialog(); - dlg.Filter = "矢量数据(*.shp)|*.shp|矢量数据(*.lgd)|*.lgd|全部支持格式(*.lgd,*.shp)|*.lgd;*.shp;"; - //dlg.Filter = "支持格式(*.lrp,*.tif,*.img,*.lrc,*.kml,*.lgd,*.shp,*.gft)|*.lrp;*.tif;*.img;*.lrc;*.kml;*.lgd;*.shp;*.gft|栅格数据(*.lrp)|*.lrp|栅格缓存(*.lrc)|*.lrc|KML数据(*.kml)|*.kml|矢量数据(*.lgd)|*.lgd|矢量缓存(*.gft)|*.gft|其它格式(*.*)|*.*||"; - dlg.Multiselect = true; - if (dlg.ShowDialog() == DialogResult.OK) - { - //自定义lprj文件名,从程序中复制一lprj文件。 - int bindex = dlg.FileName.Split('\\').Length; - string lastname = dlg.FileName.Split('\\')[bindex - 1]; - - for (int i = 0; i < dlg.FileNames.Length; i++) - { - string strDataPath = dlg.FileNames[i]; - filepath = strDataPath; - - GSOLayer layer = globeControl1.Globe.Layers.Add(strDataPath); - - } - - } - //放大到红线 - - - // globeControl1.Globe.Layers.MoveTo(0, globeControl1.Globe.Layers.Count - 1); - // globeControl1.Globe.Layers.MoveTo(0,4); - globeControl1.Refresh(); - - - } - /// - /// - /// - /// - /// - private void buttonItem142_Click(object sender, EventArgs e) - { - //获得红线polygon - //GSOLayer layerSevenLine = globeControl1.Globe.Layers.GetLayerByCaption(redlinelayername); - - GSOLayer layerSevenLine = globeControl1.Globe.Layers.Add("D:\\data\\歌林小镇shp\\test.shp"); - //获得红线结果列表 - ArrayList rrLists = new ArrayList(); - - //if (redlinelayername != "") - { - GSOFeatures fs = layerSevenLine.GetAllFeatures(); - int len = fs.Length; - - GSOGeoPolygon3D sevenPolygon = new GSOGeoPolygon3D(); - for (int k = 0; k < len; k++) - {//多根红线 - ///////生成红线区域/////// - GSOFeature featSevenLine = layerSevenLine.GetAt(k); - GSOGeoPolyline3D sevenLine = featSevenLine.Geometry as GSOGeoPolyline3D; - - List sevenParts = new List(); - for (int i = 0; i < sevenLine.PartCount; i++) - { - sevenParts.Add(sevenLine[i]); - } - for (int i = 0; i < sevenParts.Count; i++) - { - sevenPolygon.AddPart((GSOPoint3ds)sevenParts[i]); - } - /////拼出红线多边形over////// - - } - //GSOLayer layer = globeControl1.Globe.Layers.GetLayerByCaption("天然气管线"); - - GSOLayer layer = globeControl1.Globe.Layers.Add("C:\\Users\\nn-203\\Desktop\\xiaobai\\test.lgd"); - //线切割面定义,输出用 - GSOFeatures resFeats = new GSOFeatures(); - int resultstyle = 0; - //管线切割红线区域后,面积较小的区域 - GSOGeoPolygon3D restPoly = new GSOGeoPolygon3D(); - List inpts = new List(); - if (layer != null) - { - //红线区域 - GSOFeature sevenfeature = new GSOFeature(); - sevenfeature.Geometry = sevenPolygon; - - //获取不完全包含在面中的所有线 - GSOFeatures feats = layer.FindFeaturesInPolygon(sevenPolygon, false); - //获取完全包含在面中的所有线 - GSOFeatures featsTrue = layer.FindFeaturesInPolygon(sevenPolygon, true); - //获取面中所有对象组成的切割面的长线 - GSOFeature feature = new GSOFeature(); - - feature = getLineFromGSOFeatures(feats, featsTrue);//管线多个feature拼成一个feature - - //globeControl1.Globe.MemoryLayer.AddFeature(feature); - //globeControl1.Globe.MemoryLayer.AddFeature(sevenfeature); - if (feature != null) - { - //线切割面,输出 - //feature.HighLight = true; - GSODataEngineUtility.GSLineClipPolygon(feature, sevenfeature, out resFeats, out resultstyle); - } - else - { - MessageBox.Show("没有找到切割面的线对象!"); - } - ////////////////绘制分割后的多边形/////////////// - for (int a = 0; a < resFeats.Length; a++) - { - - GSOFeature gf = resFeats[1]; - globeControl1.Globe.MemoryLayer.AddFeature(gf); - - } - } - - - } - } - - private void buttonItem143_Click(object sender, EventArgs e) - { - //获得红线polygon - GSOLayer layerSevenLine = globeControl1.Globe.Layers.Add("d:\\lineAndPolygon.lgd"); - GSOLayer layerSevenLine2 = globeControl1.Globe.Layers.GetLayerByCaption("d:\\lineAndPolygon.lgd"); - //获得红线结果列表 - ArrayList rrLists = new ArrayList(); - - - // if (redlinelayername != "") - { - GSOFeatures fs = layerSevenLine.GetAllFeatures(); - int len = fs.Length; - - GSOGeoPolyline3D linetest = new GSOGeoPolyline3D(); - GSOGeoPolygon3D sevenPolygon = new GSOGeoPolygon3D(); - - GSOFeature linefeat = fs.FindByID(2); - //linefeat.Geometry = linetest; - GSOFeature polyfeat = fs.FindByID(1); - //polyfeat.Geometry = sevenPolygon; - - //线切割面定义,输出用 - GSOFeatures resFeats = new GSOFeatures(); - int resultstyle = 0; - GSODataEngineUtility.GSLineClipPolygon(linefeat, polyfeat, out resFeats, out resultstyle); - - ////////////////绘制分割后的多边形/////////////// - for (int a = 0; a < resFeats.Length; a++) - { - - GSOFeature gf = resFeats[0]; - globeControl1.Globe.MemoryLayer.AddFeature(gf); - - } - ////把红线切成一段段的线段,获得切前的红线点集 - List redpts = new List();//切前的红线点集合 - for (int i = 0; i < linetest.PartCount; i++) - { - GSOPoint3ds partP = linetest[i]; - for (int j = 0; j < partP.Count; j++) - { - redpts.Add(partP[j]); - } - } - - List redpts2 = new List();//切前的红线点集合 - for (int i = 0; i < sevenPolygon.PartCount; i++) - { - GSOPoint3ds partP = sevenPolygon[i]; - for (int j = 0; j < partP.Count; j++) - { - redpts2.Add(partP[j]); - } - } - } - } - /// - /// 增加用户手册下载连接 - /// - /// - /// - Cyberpipe.udfiles.UpDownFile UDF = new udfiles.UpDownFile(Utility.udserviceurl); - string dir_Ok = "C:\\Users\\nn-203\\Desktop"; - private void button1_Click(object sender, EventArgs e) - { - if (folderBrowserDialog1.ShowDialog() == DialogResult.OK) //打洙?开a文?件t夹D对?话°框ò - { - dir_Ok = folderBrowserDialog1.SelectedPath; //显?示?选?择?的?文?件t夹D路·径? - - //tempstr = folderBrowserDialog1.SelectedPath; //存?储洹?选?择?的?文?件t夹D路·径? - - } - - Cyberpipe.PED_logicfile.PED_Affair.Redact_D = Utility.uploadpath + "\\SFiles\\UserHbook\\说明.docx"; - if (File.Exists(dir_Ok + "\\" + Files_Name(Cyberpipe.PED_logicfile.PED_Affair.Redact_D, 1))) - { - if (MessageBox.Show("文件夹下有同名文件,是否替换?", "提示", MessageBoxButtons.YesNo, MessageBoxIcon.Information) == DialogResult.No) ; - - } - byte[] file = UDF.Down(Cyberpipe.PED_logicfile.PED_Affair.Redact_D); - FileStream pFileSream = new FileStream(dir_Ok + "\\说明.docx", FileMode.OpenOrCreate); - pFileSream.Write(file, 0, file.Length); - pFileSream.Close(); - if (File.Exists(dir_Ok + "\\" + Files_Name(Cyberpipe.PED_logicfile.PED_Affair.Redact_D, 1)) == true) - { - MessageBox.Show("文件导出成功!"); - } - //PEDAClass.Folder_Handle(dir_Ok + "\\" + PEDAClass.Files_Name(Cyberpipe.PED_logicfile.PED_Affair.Redact_D, 0), Cyberpipe.PED_logicfile.PED_Affair.Redact_D, "", 0); - - } /// /// 获取文件或文件夹的名称 /// @@ -8575,33 +6811,6 @@ return DF_Name; } - private void toolStripDropDownButton1_Click(object sender, EventArgs e) - { - if (folderBrowserDialog1.ShowDialog() == DialogResult.OK) //打洙?开a文?件t夹D对?话°框ò - { - dir_Ok = folderBrowserDialog1.SelectedPath; //显?示?选?择?的?文?件t夹D路·径? - - //tempstr = folderBrowserDialog1.SelectedPath; //存?储洹?选?择?的?文?件t夹D路·径? - - - Cyberpipe.PED_logicfile.PED_Affair.Redact_D = Utility.uploadpath + "\\SFiles\\UserHbook\\说明.docx"; - if (File.Exists(dir_Ok + "\\" + Files_Name(Cyberpipe.PED_logicfile.PED_Affair.Redact_D, 1))) - { - if (MessageBox.Show("文件夹下有同名文件,是否替换?", "提示", MessageBoxButtons.YesNo, MessageBoxIcon.Information) == DialogResult.No) ; - - } - byte[] file = UDF.Down(Cyberpipe.PED_logicfile.PED_Affair.Redact_D); - FileStream pFileSream = new FileStream(dir_Ok + "\\说明.docx", FileMode.OpenOrCreate); - pFileSream.Write(file, 0, file.Length); - pFileSream.Close(); - if (File.Exists(dir_Ok + "\\" + Files_Name(Cyberpipe.PED_logicfile.PED_Affair.Redact_D, 1)) == true) - { - MessageBox.Show("文件导出成功!"); - } - - } - } - /// /// 空间查询 /// @@ -9792,7 +8001,7 @@ GSOLayer resLayer = null; GSOFeature resFeature = null; globeControl1.Globe.GetSelectObject(0, out resFeature, out resLayer); - + if (resFeature == null) return; GSOGeoPolyline3D line1 = resFeature.Geometry as GSOGeoPolyline3D; if (line1 == null) { @@ -9876,7 +8085,7 @@ GSOLayer resLayer = null; GSOFeature resFeature = null; globeControl1.Globe.GetSelectObject(0, out resFeature, out resLayer); - + if (resFeature == null) return; GSOGeoPolyline3D line1 = resFeature.Geometry as GSOGeoPolyline3D; if (line1 == null) { @@ -9891,7 +8100,8 @@ } GSOFeatures feats = globeControl1.Globe.MemoryLayer.GetFeatureByName("粒子要素", true); - if (feats.Length > 0) + + if (feats!=null&&feats.Length > 0) globeControl1.Globe.MemoryLayer.RemoveFeatureByID(feats[0].ID); //if (emitterFeature != null) //{ @@ -11121,88 +9331,6 @@ } private int connectServerCount = 0; - - /// - /// 还原球到实测库 - /// - private void refreshGlobe1() - { - //添加实测库图层已有图层 - int servernum = 0; - //1.清除global1上 - for (int i = globeControl1.Globe.Layers.Count - 1; i >= 0; i--) - { - GSOLayer layer = globeControl1.Globe.Layers[i]; - if (!layer.Name.Contains("fttp:")) - { - layer.Dataset.Close();//清除内存 - globeControl1.Globe.Layers.Remove(layer); - } - else - { - servernum++; - } - } - - //globeControl1.Globe.ConnectServer(Utility.serverip, Utility.serverport, "", ""); //加载locaServer中的数据 - - //2.添加实测库图层 - string[] markerStrs = new string[9]; - markerStrs[0] = "标高标注"; - markerStrs[1] = "管径标注"; - markerStrs[2] = "埋深标注"; - markerStrs[3] = "坐标标注"; - markerStrs[4] = "坡度标注"; - markerStrs[5] = "属性标注"; - markerStrs[6] = "自定义标注"; - markerStrs[7] = "距离标注"; - markerStrs[8] = "扯旗标注"; - for (int i = 0; i < markerStrs.Length; i++) - { - if (File.Exists(Application.StartupPath + "\\标注管理\\" + markerStrs[i] + ".lgd")) - { - GSOLayer markerLayer = globeControl1.Globe.Layers.Add(Application.StartupPath + "\\标注管理\\" + markerStrs[i] + ".lgd"); - } - } - - for (int i = 0; i < g1layername.Count; i++) - { - string g1name = g1layername[i]; - GSODataset datasetg1 = Utility.dataSource.GetDatasetByName(g1name); - GSOLayer templayer = globeControl1.Globe.Layers.Add(datasetg1); - templayer.MaxVisibleAltitude = -1; - } - layerTemp = globeControl1.Globe.Layers.Add(Application.StartupPath + "\\tempLgdData.lgd"); - globeControl1.Globe.Layers.Add(Application.StartupPath + "/城市七线/城市红线.lgd"); - globeControl1.Globe.Layers.Add(Application.StartupPath + "/城市七线/城市橙线.lgd"); - globeControl1.Globe.Layers.Add(Application.StartupPath + "/城市七线/城市黄线.lgd"); - globeControl1.Globe.Layers.Add(Application.StartupPath + "/城市七线/城市绿线.lgd"); - globeControl1.Globe.Layers.Add(Application.StartupPath + "/城市七线/城市蓝线.lgd"); - globeControl1.Globe.Layers.Add(Application.StartupPath + "/城市七线/城市紫线.lgd"); - globeControl1.Globe.Layers.Add(Application.StartupPath + "/城市七线/城市黑线.lgd"); - globeControl1.Globe.Layers.Add(Application.StartupPath + "/隧道.lgd"); - - //移动server的数据图层 - for (int i = 0; i < servernum; i++) - { - globeControl1.Globe.Layers.MoveTo(globeControl1.Globe.Layers.Count - 1, 0); - } - - if (layerManagerNode.Nodes.Count > 0) - { - for (int i = layerManagerNode.Nodes.Count - 1; i >= 0; i--) - { - layerManagerNode.Nodes[i].Remove(); - - } - } - - - - globeControl1.Refresh(); - - } - /// /// 碰撞审查 /// @@ -11476,31 +9604,7 @@ // } //} #endregion - /// - /// 数据质量检查 - /// - /// - /// - private void buttonItemSJGL2_Click(object sender, EventArgs e) - { - //日志记录 - LogManager.saveLog(Utility.userName, this.buttonItemSJGL2.Text); - FrmValiData frm = new FrmValiData(globeControl1); - frm.ShowDialog(); - } - /// - /// 数据预处理 - /// - /// - /// - private void buttonItemSJGL3_Click(object sender, EventArgs e) - { - //保存日志 - LogManager.saveLog(Utility.userName, this.buttonItemSJGL3.Text); - FrmEditShapeFile frm = new FrmEditShapeFile(globeControl1); - frm.ShowDialog(this); - } /// /// 连接数据库 /// @@ -12251,60 +10355,6 @@ List lineStruct = new List(); GSOFeature featureSelected = null; - private void AddDatagridView(DataTable table) - { - - if (table != null && table.Rows.Count > 0) - { - dataGridViewX1.DataSource = table; - panelOfTable.Visible = true; - panelOfTable.Height = 200; - toolStripNumbers.Text = "红线审核结果"; - toolStripFeatureLength.Text = " 共有:" + table.Rows.Count + "条"; - } - else - { - - } - - } - - /// - /// 去除集合中重复的管线 - /// - /// - /// - /// - private GSOFeatures getFeaturesByFilter(GSOFeatures features, string fieldName) - { - if (features == null) - { - return null; - } - GSOFeatures featuresGet = new GSOFeatures(); - for (int i = 0; i < features.Length; i++) - { - GSOFeature featureFromFS = features[i]; - string fieldValueFromFS = featureFromFS.GetValue(fieldName).ToString().Trim(); - bool isHas = false; - for (int j = featuresGet.Length - 1; j >= 0; j--) - { - GSOFeature featureFromFSGet = featuresGet[j]; - string fieldValueFromFSGet = featureFromFSGet.GetValue(fieldName).ToString().Trim(); - if (fieldValueFromFS.Equals(fieldValueFromFSGet)) - { - isHas = true; - break; - } - } - if (isHas == false) - { - featuresGet.Add(featureFromFS.Clone()); - } - } - return featuresGet; - } - /// /// 数据管理导入文件 /// @@ -12440,138 +10490,7 @@ // //MessageBox.Show("系统运行错误:" + ex.ToString(), "错误", MessageBoxButtons.OK, MessageBoxIcon.Error); // } //} - - - /// - /// 标识器全区域统计 - /// - /// - /// - private void 标识器分类统计ToolStripMenuItem_Click(object sender, EventArgs e) - { - globeControl1.Globe.Action = EnumAction3D.ActionNull; - FrmBSQStatis bsqStatis = new FrmBSQStatis(); - bsqStatis.Show(this); - } - /// - /// 标识器绘制区域统计 - /// - /// - /// - private void 标识器分类统计ToolStripMenuItem1_Click(object sender, EventArgs e) - { - trackflag = "BSQDuoBianXiangStatis"; - globeControl1.Globe.Action = EnumAction3D.TrackPolygon; - } - - - #region 保存和加载审核库加载的图层 - private void saveLayerList(TreeNodeCollection treeNodeList) - { - string configPath = Application.StartupPath + "\\configLayerList.xml"; - try - { - XmlDocument doc = new XmlDocument(); - doc.Load(configPath); - XmlNode dbParams = doc.SelectSingleNode("Params/dbparams"); - XmlNode dbLayers = doc.SelectSingleNode("Params/dblayers"); - XmlNode layers = doc.SelectSingleNode("Params/layers"); - dbParams.RemoveAll(); - dbLayers.RemoveAll(); - layers.RemoveAll(); - - List listDS = new List(); - String shDatasourceName = Utility.sgdbip + "/" + Utility.sgdbname + "_" + Utility.sgdbuser; - bool flag = false; - - for (int i = 0; i < globeControl1.Globe.DataManager.DataSourceCount; i++) - { - GSODataSource ds = globeControl1.Globe.DataManager.GetDataSourceAt(i); - if (ds != null && ds.Type == EnumDataSourceType.SqlServer || ds.Type == EnumDataSourceType.Oracle) - { - if (ds.Name == shDatasourceName) - { - //防止因为多次连接同一个数据库 - if (flag == true) - { - break; - } - flag = true; - listDS.Add(ds); - GSODataSourceCnn conn = ds.GetConnectionInfo(); - - XmlElement dbparam = doc.CreateElement("shdbparam"); - XmlElement ip = doc.CreateElement("ship"); - ip.InnerText = conn.Server; - - XmlElement dbname = doc.CreateElement("shdbname"); - dbname.InnerText = conn.Database; - - XmlElement username = doc.CreateElement("shusername"); - username.InnerText = conn.User; - - XmlElement password = doc.CreateElement("shpassword"); - password.InnerText = conn.Password; - - XmlElement type = doc.CreateElement("shtype"); - if (ds.Type == EnumDataSourceType.SqlServer) - { - type.InnerText = "sqlserver"; - } - else - { - type.InnerText = "oracle"; - } - - dbparam.AppendChild(ip); - dbparam.AppendChild(dbname); - dbparam.AppendChild(username); - dbparam.AppendChild(password); - dbparam.AppendChild(type); - dbParams.AppendChild(dbparam); - } - - } - } - - for (int i = 0; i < treeNodeList.Count; i++) - { - GSOLayer layer = treeNodeList[i].Tag as GSOLayer; - if (Path.GetExtension(layer.Name) == "") - { - XmlElement dbLayer = doc.CreateElement("dblayer"); - XmlAttribute attri = doc.CreateAttribute("dbindex"); - for (int j = 0; j < listDS.Count; j++) - { - if (layer.Dataset.DataSource.Name == listDS[j].Name) - { - attri.Value = j.ToString(); - break; - } - } - dbLayer.Attributes.Append(attri); - dbLayer.InnerText = layer.Name; - - dbLayers.AppendChild(dbLayer); - } - else - { - XmlElement dbLayer = doc.CreateElement("layer"); - dbLayer.InnerText = layer.Name; - layers.AppendChild(dbLayer); - } - } - - doc.Save(configPath); - } - catch (Exception e) - { - - } - } - - #endregion - + private void buttonItem_TaskManager_Click(object sender, EventArgs e) { if (Form_TaksManager.IS_OPEN) diff --git a/MainFrm.designer.cs b/MainFrm.designer.cs index 233ef8c..97b8299 100644 --- a/MainFrm.designer.cs +++ b/MainFrm.designer.cs @@ -82,6 +82,7 @@ this.sideBar1 = new DevComponents.DotNetBar.SideBar(); this.panelEx3 = new DevComponents.DotNetBar.PanelEx(); this.layerSensorTree = new System.Windows.Forms.TreeView(); + this.layerTree = new Cyberpipe.MyTreeView(); this.sideBarPanelItem3 = new DevComponents.DotNetBar.SideBarPanelItem(); this.controlContainerItem3 = new DevComponents.DotNetBar.ControlContainerItem(); this.sideBarPanelItem4 = new DevComponents.DotNetBar.SideBarPanelItem(); @@ -365,30 +366,26 @@ this.可编辑ToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); this.保存ToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); this.ribbonControl1 = new DevComponents.DotNetBar.RibbonControl(); - this.ribbonPanel1 = new DevComponents.DotNetBar.RibbonPanel(); - this.ribbonBar21 = new DevComponents.DotNetBar.RibbonBar(); - this.buttonItem87 = new DevComponents.DotNetBar.ButtonItem(); - this.buttonItem88 = new DevComponents.DotNetBar.ButtonItem(); - this.buttonItem27 = new DevComponents.DotNetBar.ButtonItem(); - this.buttonItem91 = new DevComponents.DotNetBar.ButtonItem(); - this.buttonItem1 = new DevComponents.DotNetBar.ButtonItem(); - this.btnlegendSet = new DevComponents.DotNetBar.ButtonItem(); - this.buttonItem89 = new DevComponents.DotNetBar.ButtonItem(); - this.ribbonPanel7 = new DevComponents.DotNetBar.RibbonPanel(); - this.ribbonBar5 = new DevComponents.DotNetBar.RibbonBar(); - this.btn_flag = new DevComponents.DotNetBar.ButtonItem(); - this.slider4ground = new DevComponents.DotNetBar.SliderItem(); - this.ribbonPanel2 = new DevComponents.DotNetBar.RibbonPanel(); - this.ribbonBar4 = new DevComponents.DotNetBar.RibbonBar(); - this.buttonItem_TaskManager = new DevComponents.DotNetBar.ButtonItem(); - this.buttonItem_OnlineTask = new DevComponents.DotNetBar.ButtonItem(); - this.buttonItem_Event = new DevComponents.DotNetBar.ButtonItem(); this.ribbonPanel3 = new DevComponents.DotNetBar.RibbonPanel(); this.ribbonBar3 = new DevComponents.DotNetBar.RibbonBar(); this.btn_device = new DevComponents.DotNetBar.ButtonItem(); this.btn_Person = new DevComponents.DotNetBar.ButtonItem(); this.btn_constructMap = new DevComponents.DotNetBar.ButtonItem(); this.buttonItem9 = new DevComponents.DotNetBar.ButtonItem(); + this.ribbonPanel2 = new DevComponents.DotNetBar.RibbonPanel(); + this.ribbonBar4 = new DevComponents.DotNetBar.RibbonBar(); + this.buttonItem_TaskManager = new DevComponents.DotNetBar.ButtonItem(); + this.buttonItem_OnlineTask = new DevComponents.DotNetBar.ButtonItem(); + this.buttonItem_Event = new DevComponents.DotNetBar.ButtonItem(); + this.ribbonPanel1 = new DevComponents.DotNetBar.RibbonPanel(); + this.ribbonBar21 = new DevComponents.DotNetBar.RibbonBar(); + this.buttonItem87 = new DevComponents.DotNetBar.ButtonItem(); + this.buttonItem88 = new DevComponents.DotNetBar.ButtonItem(); + this.buttonItem27 = new DevComponents.DotNetBar.ButtonItem(); + this.buttonItem1 = new DevComponents.DotNetBar.ButtonItem(); + this.buttonItem91 = new DevComponents.DotNetBar.ButtonItem(); + this.btnlegendSet = new DevComponents.DotNetBar.ButtonItem(); + this.buttonItem89 = new DevComponents.DotNetBar.ButtonItem(); this.ribbonPanel8 = new DevComponents.DotNetBar.RibbonPanel(); this.ribbonBar_UserInfo = new DevComponents.DotNetBar.RibbonBar(); this.btn_user_info = new DevComponents.DotNetBar.ButtonItem(); @@ -398,6 +395,10 @@ this.btn_user_role = new DevComponents.DotNetBar.ButtonItem(); this.btn_password_edit = new DevComponents.DotNetBar.ButtonItem(); this.btn_reset_password = new DevComponents.DotNetBar.ButtonItem(); + this.ribbonPanel7 = new DevComponents.DotNetBar.RibbonPanel(); + this.ribbonBar5 = new DevComponents.DotNetBar.RibbonBar(); + this.btn_flag = new DevComponents.DotNetBar.ButtonItem(); + this.slider4ground = new DevComponents.DotNetBar.SliderItem(); this.ribbonPanel15 = new DevComponents.DotNetBar.RibbonPanel(); this.ribbonBar20 = new DevComponents.DotNetBar.RibbonBar(); this.buttonItemSJGL = new DevComponents.DotNetBar.ButtonItem(); @@ -610,7 +611,6 @@ this.buttonItem84 = new DevComponents.DotNetBar.ButtonItem(); this.buttonItem75 = new DevComponents.DotNetBar.ButtonItem(); this.buttonItem76 = new DevComponents.DotNetBar.ButtonItem(); - this.layerTree = new Cyberpipe.MyTreeView(); this.statusStrip1.SuspendLayout(); this.sideBar1.SuspendLayout(); this.panelEx3.SuspendLayout(); @@ -647,11 +647,11 @@ this.contextMenuStrip3.SuspendLayout(); this.contextMenuStripDeleteLayerNode.SuspendLayout(); this.ribbonControl1.SuspendLayout(); - this.ribbonPanel1.SuspendLayout(); - this.ribbonPanel7.SuspendLayout(); - this.ribbonPanel2.SuspendLayout(); this.ribbonPanel3.SuspendLayout(); + this.ribbonPanel2.SuspendLayout(); + this.ribbonPanel1.SuspendLayout(); this.ribbonPanel8.SuspendLayout(); + this.ribbonPanel7.SuspendLayout(); this.ribbonPanel15.SuspendLayout(); ((System.ComponentModel.ISupportInitialize)(this.pictureBox1)).BeginInit(); this.SuspendLayout(); @@ -813,7 +813,6 @@ this.toolStripDropDownButton1.Size = new System.Drawing.Size(45, 21); this.toolStripDropDownButton1.Text = "帮助"; this.toolStripDropDownButton1.Visible = false; - this.toolStripDropDownButton1.Click += new System.EventHandler(this.toolStripDropDownButton1_Click); // // controlContainerItem1 // @@ -1047,6 +1046,16 @@ this.layerSensorTree.AfterCheck += new System.Windows.Forms.TreeViewEventHandler(this.layerMarkerTree_AfterCheck); this.layerSensorTree.NodeMouseClick += new System.Windows.Forms.TreeNodeMouseClickEventHandler(this.layerMarkerTree_NodeMouseClick); // + // layerTree + // + this.layerTree.CheckBoxes = true; + this.layerTree.ItemHeight = 18; + this.layerTree.Location = new System.Drawing.Point(30, 78); + this.layerTree.Name = "layerTree"; + this.layerTree.Size = new System.Drawing.Size(121, 97); + this.layerTree.TabIndex = 1; + this.layerTree.AfterCheck += new System.Windows.Forms.TreeViewEventHandler(this.layerTree_AfterCheck); + // // sideBarPanelItem3 // this.sideBarPanelItem3.FontBold = true; @@ -2966,28 +2975,28 @@ // 平移对象ToolStripMenuItem // this.平移对象ToolStripMenuItem.Name = "平移对象ToolStripMenuItem"; - this.平移对象ToolStripMenuItem.Size = new System.Drawing.Size(152, 22); + this.平移对象ToolStripMenuItem.Size = new System.Drawing.Size(124, 22); this.平移对象ToolStripMenuItem.Text = "平移对象"; this.平移对象ToolStripMenuItem.Click += new System.EventHandler(this.buttonItemBJ6_Click); // // 升降对象ToolStripMenuItem // this.升降对象ToolStripMenuItem.Name = "升降对象ToolStripMenuItem"; - this.升降对象ToolStripMenuItem.Size = new System.Drawing.Size(152, 22); + this.升降对象ToolStripMenuItem.Size = new System.Drawing.Size(124, 22); this.升降对象ToolStripMenuItem.Text = "升降对象"; this.升降对象ToolStripMenuItem.Click += new System.EventHandler(this.buttonItemBJ7_Click); // // 旋转对象ToolStripMenuItem // this.旋转对象ToolStripMenuItem.Name = "旋转对象ToolStripMenuItem"; - this.旋转对象ToolStripMenuItem.Size = new System.Drawing.Size(152, 22); + this.旋转对象ToolStripMenuItem.Size = new System.Drawing.Size(124, 22); this.旋转对象ToolStripMenuItem.Text = "旋转对象"; this.旋转对象ToolStripMenuItem.Click += new System.EventHandler(this.buttonItemBJ8_Click); // // 连接管段ToolStripMenuItem // this.连接管段ToolStripMenuItem.Name = "连接管段ToolStripMenuItem"; - this.连接管段ToolStripMenuItem.Size = new System.Drawing.Size(152, 22); + this.连接管段ToolStripMenuItem.Size = new System.Drawing.Size(124, 22); this.连接管段ToolStripMenuItem.Text = "连接管段"; this.连接管段ToolStripMenuItem.Click += new System.EventHandler(this.buttonItemBJ9_Click); // @@ -2997,34 +3006,34 @@ this.导出CADToolStripMenuItem, this.导出文件ToolStripMenuItem1}); this.导出文件ToolStripMenuItem.Name = "导出文件ToolStripMenuItem"; - this.导出文件ToolStripMenuItem.Size = new System.Drawing.Size(152, 22); + this.导出文件ToolStripMenuItem.Size = new System.Drawing.Size(124, 22); this.导出文件ToolStripMenuItem.Text = "导出矢量"; // // 导出CADToolStripMenuItem // this.导出CADToolStripMenuItem.Name = "导出CADToolStripMenuItem"; - this.导出CADToolStripMenuItem.Size = new System.Drawing.Size(152, 22); + this.导出CADToolStripMenuItem.Size = new System.Drawing.Size(125, 22); this.导出CADToolStripMenuItem.Text = "导出CAD"; this.导出CADToolStripMenuItem.Click += new System.EventHandler(this.buttonItemBJ10_1_Click); // // 导出文件ToolStripMenuItem1 // this.导出文件ToolStripMenuItem1.Name = "导出文件ToolStripMenuItem1"; - this.导出文件ToolStripMenuItem1.Size = new System.Drawing.Size(152, 22); + this.导出文件ToolStripMenuItem1.Size = new System.Drawing.Size(125, 22); this.导出文件ToolStripMenuItem1.Text = "导出文件"; this.导出文件ToolStripMenuItem1.Click += new System.EventHandler(this.buttonItemBJ10_2_Click); // // 前进ToolStripMenuItem // this.前进ToolStripMenuItem.Name = "前进ToolStripMenuItem"; - this.前进ToolStripMenuItem.Size = new System.Drawing.Size(152, 22); + this.前进ToolStripMenuItem.Size = new System.Drawing.Size(124, 22); this.前进ToolStripMenuItem.Text = "前进"; this.前进ToolStripMenuItem.Click += new System.EventHandler(this.buttonItemBJ12_Click); // // 删除模型ToolStripMenuItem // this.删除模型ToolStripMenuItem.Name = "删除模型ToolStripMenuItem"; - this.删除模型ToolStripMenuItem.Size = new System.Drawing.Size(152, 22); + this.删除模型ToolStripMenuItem.Size = new System.Drawing.Size(124, 22); this.删除模型ToolStripMenuItem.Text = "后退"; this.删除模型ToolStripMenuItem.Click += new System.EventHandler(this.buttonItemBJ11_Click); // @@ -4160,6 +4169,198 @@ this.ribbonControl1.Text = "ribbonControl1"; this.ribbonControl1.UseCustomizeDialog = false; // + // ribbonPanel3 + // + this.ribbonPanel3.ColorSchemeStyle = DevComponents.DotNetBar.eDotNetBarStyle.StyleManagerControlled; + this.ribbonPanel3.Controls.Add(this.ribbonBar3); + this.ribbonPanel3.Dock = System.Windows.Forms.DockStyle.Fill; + this.ribbonPanel3.Location = new System.Drawing.Point(0, 33); + this.ribbonPanel3.Name = "ribbonPanel3"; + this.ribbonPanel3.Padding = new System.Windows.Forms.Padding(3, 0, 3, 3); + this.ribbonPanel3.Size = new System.Drawing.Size(1328, 62); + // + // + // + this.ribbonPanel3.Style.Class = ""; + this.ribbonPanel3.Style.CornerType = DevComponents.DotNetBar.eCornerType.Square; + // + // + // + this.ribbonPanel3.StyleMouseDown.Class = ""; + this.ribbonPanel3.StyleMouseDown.CornerType = DevComponents.DotNetBar.eCornerType.Square; + // + // + // + this.ribbonPanel3.StyleMouseOver.Class = ""; + this.ribbonPanel3.StyleMouseOver.CornerType = DevComponents.DotNetBar.eCornerType.Square; + this.ribbonPanel3.TabIndex = 40; + // + // ribbonBar3 + // + this.ribbonBar3.AutoOverflowEnabled = true; + // + // + // + this.ribbonBar3.BackgroundMouseOverStyle.Class = ""; + this.ribbonBar3.BackgroundMouseOverStyle.CornerType = DevComponents.DotNetBar.eCornerType.Square; + // + // + // + this.ribbonBar3.BackgroundStyle.Class = ""; + this.ribbonBar3.BackgroundStyle.CornerType = DevComponents.DotNetBar.eCornerType.Square; + this.ribbonBar3.ContainerControlProcessDialogKey = true; + this.ribbonBar3.Dock = System.Windows.Forms.DockStyle.Left; + this.ribbonBar3.Items.AddRange(new DevComponents.DotNetBar.BaseItem[] { + this.btn_device, + this.btn_Person, + this.btn_constructMap, + this.buttonItem9}); + this.ribbonBar3.Location = new System.Drawing.Point(3, 0); + this.ribbonBar3.Name = "ribbonBar3"; + this.ribbonBar3.Size = new System.Drawing.Size(378, 59); + this.ribbonBar3.Style = DevComponents.DotNetBar.eDotNetBarStyle.StyleManagerControlled; + this.ribbonBar3.TabIndex = 0; + // + // + // + this.ribbonBar3.TitleStyle.Class = ""; + this.ribbonBar3.TitleStyle.CornerType = DevComponents.DotNetBar.eCornerType.Square; + // + // + // + this.ribbonBar3.TitleStyleMouseOver.Class = ""; + this.ribbonBar3.TitleStyleMouseOver.CornerType = DevComponents.DotNetBar.eCornerType.Square; + this.ribbonBar3.TitleVisible = false; + // + // btn_device + // + this.btn_device.ButtonStyle = DevComponents.DotNetBar.eButtonStyle.ImageAndText; + this.btn_device.Image = global::Cyberpipe.Properties.Resources._24X24__2__02; + this.btn_device.ImagePosition = DevComponents.DotNetBar.eImagePosition.Top; + this.btn_device.Name = "btn_device"; + this.btn_device.SubItemsExpandWidth = 14; + this.btn_device.Text = "探测仪管理"; + this.btn_device.Click += new System.EventHandler(this.btn_device_Click); + // + // btn_Person + // + this.btn_Person.ButtonStyle = DevComponents.DotNetBar.eButtonStyle.ImageAndText; + this.btn_Person.Image = global::Cyberpipe.Properties.Resources._24x24icon_05_hover1; + this.btn_Person.ImagePosition = DevComponents.DotNetBar.eImagePosition.Top; + this.btn_Person.Name = "btn_Person"; + this.btn_Person.SubItemsExpandWidth = 14; + this.btn_Person.Text = "定位人员维护"; + this.btn_Person.Click += new System.EventHandler(this.btn_Person_Click); + // + // btn_constructMap + // + this.btn_constructMap.Image = global::Cyberpipe.Properties.Resources._24x24icon_04_hover; + this.btn_constructMap.ImagePosition = DevComponents.DotNetBar.eImagePosition.Top; + this.btn_constructMap.Name = "btn_constructMap"; + this.btn_constructMap.SubItemsExpandWidth = 14; + this.btn_constructMap.Text = "导出施工图"; + this.btn_constructMap.Click += new System.EventHandler(this.btn_constructMap_Click); + // + // buttonItem9 + // + this.buttonItem9.Image = global::Cyberpipe.Properties.Resources._24x24icon__2__10; + this.buttonItem9.ImagePosition = DevComponents.DotNetBar.eImagePosition.Top; + this.buttonItem9.Name = "buttonItem9"; + this.buttonItem9.SubItemsExpandWidth = 14; + this.buttonItem9.Text = "文档管理"; + this.buttonItem9.Click += new System.EventHandler(this.buttonItem9_Click); + // + // ribbonPanel2 + // + this.ribbonPanel2.ColorSchemeStyle = DevComponents.DotNetBar.eDotNetBarStyle.StyleManagerControlled; + this.ribbonPanel2.Controls.Add(this.ribbonBar4); + this.ribbonPanel2.Dock = System.Windows.Forms.DockStyle.Fill; + this.ribbonPanel2.Location = new System.Drawing.Point(0, 0); + this.ribbonPanel2.Name = "ribbonPanel2"; + this.ribbonPanel2.Padding = new System.Windows.Forms.Padding(3, 0, 3, 3); + this.ribbonPanel2.Size = new System.Drawing.Size(1328, 95); + // + // + // + this.ribbonPanel2.Style.Class = ""; + this.ribbonPanel2.Style.CornerType = DevComponents.DotNetBar.eCornerType.Square; + // + // + // + this.ribbonPanel2.StyleMouseDown.Class = ""; + this.ribbonPanel2.StyleMouseDown.CornerType = DevComponents.DotNetBar.eCornerType.Square; + // + // + // + this.ribbonPanel2.StyleMouseOver.Class = ""; + this.ribbonPanel2.StyleMouseOver.CornerType = DevComponents.DotNetBar.eCornerType.Square; + this.ribbonPanel2.TabIndex = 39; + this.ribbonPanel2.Visible = false; + // + // ribbonBar4 + // + this.ribbonBar4.AutoOverflowEnabled = true; + // + // + // + this.ribbonBar4.BackgroundMouseOverStyle.Class = ""; + this.ribbonBar4.BackgroundMouseOverStyle.CornerType = DevComponents.DotNetBar.eCornerType.Square; + // + // + // + this.ribbonBar4.BackgroundStyle.Class = ""; + this.ribbonBar4.BackgroundStyle.CornerType = DevComponents.DotNetBar.eCornerType.Square; + this.ribbonBar4.ContainerControlProcessDialogKey = true; + this.ribbonBar4.Dock = System.Windows.Forms.DockStyle.Left; + this.ribbonBar4.Items.AddRange(new DevComponents.DotNetBar.BaseItem[] { + this.buttonItem_TaskManager, + this.buttonItem_OnlineTask, + this.buttonItem_Event}); + this.ribbonBar4.Location = new System.Drawing.Point(3, 0); + this.ribbonBar4.Name = "ribbonBar4"; + this.ribbonBar4.Size = new System.Drawing.Size(299, 92); + this.ribbonBar4.Style = DevComponents.DotNetBar.eDotNetBarStyle.StyleManagerControlled; + this.ribbonBar4.TabIndex = 0; + this.ribbonBar4.Text = "ribbonBar4"; + // + // + // + this.ribbonBar4.TitleStyle.Class = ""; + this.ribbonBar4.TitleStyle.CornerType = DevComponents.DotNetBar.eCornerType.Square; + // + // + // + this.ribbonBar4.TitleStyleMouseOver.Class = ""; + this.ribbonBar4.TitleStyleMouseOver.CornerType = DevComponents.DotNetBar.eCornerType.Square; + this.ribbonBar4.TitleVisible = false; + // + // buttonItem_TaskManager + // + this.buttonItem_TaskManager.Image = global::Cyberpipe.Properties.Resources._24x24icon__2__76; + this.buttonItem_TaskManager.ImagePosition = DevComponents.DotNetBar.eImagePosition.Top; + this.buttonItem_TaskManager.Name = "buttonItem_TaskManager"; + this.buttonItem_TaskManager.SubItemsExpandWidth = 14; + this.buttonItem_TaskManager.Text = "工单管理"; + this.buttonItem_TaskManager.Click += new System.EventHandler(this.buttonItem_TaskManager_Click); + // + // buttonItem_OnlineTask + // + this.buttonItem_OnlineTask.Image = global::Cyberpipe.Properties.Resources._24x24icon__2__69; + this.buttonItem_OnlineTask.ImagePosition = DevComponents.DotNetBar.eImagePosition.Top; + this.buttonItem_OnlineTask.Name = "buttonItem_OnlineTask"; + this.buttonItem_OnlineTask.SubItemsExpandWidth = 14; + this.buttonItem_OnlineTask.Text = "在线任务"; + this.buttonItem_OnlineTask.Click += new System.EventHandler(this.buttonItem_OnlineTask_Click); + // + // buttonItem_Event + // + this.buttonItem_Event.Image = global::Cyberpipe.Properties.Resources._24x24icon__2__72; + this.buttonItem_Event.ImagePosition = DevComponents.DotNetBar.eImagePosition.Top; + this.buttonItem_Event.Name = "buttonItem_Event"; + this.buttonItem_Event.SubItemsExpandWidth = 14; + this.buttonItem_Event.Text = "事件管理"; + this.buttonItem_Event.Click += new System.EventHandler(this.buttonItem_Event_Click); + // // ribbonPanel1 // this.ribbonPanel1.AutoSize = true; @@ -4262,6 +4463,15 @@ this.buttonItem27.Visible = false; this.buttonItem27.Click += new System.EventHandler(this.buttonItem27_Click); // + // buttonItem1 + // + this.buttonItem1.Image = global::Cyberpipe.Properties.Resources._24x24icon__2__94; + this.buttonItem1.ImagePosition = DevComponents.DotNetBar.eImagePosition.Top; + this.buttonItem1.Name = "buttonItem1"; + this.buttonItem1.SubItemsExpandWidth = 14; + this.buttonItem1.Text = "图层管理"; + this.buttonItem1.Click += new System.EventHandler(this.buttonItem1_Click); + // // buttonItem91 // this.buttonItem91.ForeColor = System.Drawing.Color.Black; @@ -4272,15 +4482,6 @@ this.buttonItem91.Text = "快速定位"; this.buttonItem91.Click += new System.EventHandler(this.buttonItem91_Click); // - // buttonItem1 - // - this.buttonItem1.Image = global::Cyberpipe.Properties.Resources._24x24icon__2__94; - this.buttonItem1.ImagePosition = DevComponents.DotNetBar.eImagePosition.Top; - this.buttonItem1.Name = "buttonItem1"; - this.buttonItem1.SubItemsExpandWidth = 14; - this.buttonItem1.Text = "图层管理"; - this.buttonItem1.Click += new System.EventHandler(this.buttonItem1_Click); - // // btnlegendSet // this.btnlegendSet.Image = global::Cyberpipe.Properties.Resources._24x24icon__2__93; @@ -4300,278 +4501,6 @@ this.buttonItem89.Visible = false; this.buttonItem89.Click += new System.EventHandler(this.buttonItem89_Click); // - // ribbonPanel7 - // - this.ribbonPanel7.ColorSchemeStyle = DevComponents.DotNetBar.eDotNetBarStyle.StyleManagerControlled; - this.ribbonPanel7.Controls.Add(this.ribbonBar5); - this.ribbonPanel7.Dock = System.Windows.Forms.DockStyle.Fill; - this.ribbonPanel7.Location = new System.Drawing.Point(0, 0); - this.ribbonPanel7.Name = "ribbonPanel7"; - this.ribbonPanel7.Padding = new System.Windows.Forms.Padding(3, 0, 3, 3); - this.ribbonPanel7.Size = new System.Drawing.Size(1328, 95); - // - // - // - this.ribbonPanel7.Style.Class = ""; - this.ribbonPanel7.Style.CornerType = DevComponents.DotNetBar.eCornerType.Square; - // - // - // - this.ribbonPanel7.StyleMouseDown.Class = ""; - this.ribbonPanel7.StyleMouseDown.CornerType = DevComponents.DotNetBar.eCornerType.Square; - // - // - // - this.ribbonPanel7.StyleMouseOver.Class = ""; - this.ribbonPanel7.StyleMouseOver.CornerType = DevComponents.DotNetBar.eCornerType.Square; - this.ribbonPanel7.TabIndex = 41; - this.ribbonPanel7.Visible = false; - // - // ribbonBar5 - // - this.ribbonBar5.AutoOverflowEnabled = true; - // - // - // - this.ribbonBar5.BackgroundMouseOverStyle.Class = ""; - this.ribbonBar5.BackgroundMouseOverStyle.CornerType = DevComponents.DotNetBar.eCornerType.Square; - // - // - // - this.ribbonBar5.BackgroundStyle.Class = ""; - this.ribbonBar5.BackgroundStyle.CornerType = DevComponents.DotNetBar.eCornerType.Square; - this.ribbonBar5.ContainerControlProcessDialogKey = true; - this.ribbonBar5.Dock = System.Windows.Forms.DockStyle.Left; - this.ribbonBar5.Items.AddRange(new DevComponents.DotNetBar.BaseItem[] { - this.btn_flag, - this.slider4ground}); - this.ribbonBar5.Location = new System.Drawing.Point(3, 0); - this.ribbonBar5.Name = "ribbonBar5"; - this.ribbonBar5.Size = new System.Drawing.Size(418, 92); - this.ribbonBar5.Style = DevComponents.DotNetBar.eDotNetBarStyle.StyleManagerControlled; - this.ribbonBar5.TabIndex = 0; - // - // - // - this.ribbonBar5.TitleStyle.Class = ""; - this.ribbonBar5.TitleStyle.CornerType = DevComponents.DotNetBar.eCornerType.Square; - // - // - // - this.ribbonBar5.TitleStyleMouseOver.Class = ""; - this.ribbonBar5.TitleStyleMouseOver.CornerType = DevComponents.DotNetBar.eCornerType.Square; - this.ribbonBar5.TitleVisible = false; - this.ribbonBar5.ItemClick += new System.EventHandler(this.ribbonBar5_ItemClick); - // - // btn_flag - // - this.btn_flag.Image = global::Cyberpipe.Properties.Resources._24x24icon_03_hover; - this.btn_flag.ImagePosition = DevComponents.DotNetBar.eImagePosition.Top; - this.btn_flag.Name = "btn_flag"; - this.btn_flag.SubItemsExpandWidth = 14; - this.btn_flag.Text = "标识器管理"; - this.btn_flag.Click += new System.EventHandler(this.btn_flag_Click); - // - // slider4ground - // - this.slider4ground.LabelPosition = DevComponents.DotNetBar.eSliderLabelPosition.Top; - this.slider4ground.Name = "slider4ground"; - this.slider4ground.Text = "地面透明度"; - this.slider4ground.Value = 0; - this.slider4ground.ValueChanged += new System.EventHandler(this.slider4ground_ValueChanged); - // - // ribbonPanel2 - // - this.ribbonPanel2.ColorSchemeStyle = DevComponents.DotNetBar.eDotNetBarStyle.StyleManagerControlled; - this.ribbonPanel2.Controls.Add(this.ribbonBar4); - this.ribbonPanel2.Dock = System.Windows.Forms.DockStyle.Fill; - this.ribbonPanel2.Location = new System.Drawing.Point(0, 0); - this.ribbonPanel2.Name = "ribbonPanel2"; - this.ribbonPanel2.Padding = new System.Windows.Forms.Padding(3, 0, 3, 3); - this.ribbonPanel2.Size = new System.Drawing.Size(1328, 95); - // - // - // - this.ribbonPanel2.Style.Class = ""; - this.ribbonPanel2.Style.CornerType = DevComponents.DotNetBar.eCornerType.Square; - // - // - // - this.ribbonPanel2.StyleMouseDown.Class = ""; - this.ribbonPanel2.StyleMouseDown.CornerType = DevComponents.DotNetBar.eCornerType.Square; - // - // - // - this.ribbonPanel2.StyleMouseOver.Class = ""; - this.ribbonPanel2.StyleMouseOver.CornerType = DevComponents.DotNetBar.eCornerType.Square; - this.ribbonPanel2.TabIndex = 39; - this.ribbonPanel2.Visible = false; - // - // ribbonBar4 - // - this.ribbonBar4.AutoOverflowEnabled = true; - // - // - // - this.ribbonBar4.BackgroundMouseOverStyle.Class = ""; - this.ribbonBar4.BackgroundMouseOverStyle.CornerType = DevComponents.DotNetBar.eCornerType.Square; - // - // - // - this.ribbonBar4.BackgroundStyle.Class = ""; - this.ribbonBar4.BackgroundStyle.CornerType = DevComponents.DotNetBar.eCornerType.Square; - this.ribbonBar4.ContainerControlProcessDialogKey = true; - this.ribbonBar4.Dock = System.Windows.Forms.DockStyle.Left; - this.ribbonBar4.Items.AddRange(new DevComponents.DotNetBar.BaseItem[] { - this.buttonItem_TaskManager, - this.buttonItem_OnlineTask, - this.buttonItem_Event}); - this.ribbonBar4.Location = new System.Drawing.Point(3, 0); - this.ribbonBar4.Name = "ribbonBar4"; - this.ribbonBar4.Size = new System.Drawing.Size(299, 92); - this.ribbonBar4.Style = DevComponents.DotNetBar.eDotNetBarStyle.StyleManagerControlled; - this.ribbonBar4.TabIndex = 0; - this.ribbonBar4.Text = "ribbonBar4"; - // - // - // - this.ribbonBar4.TitleStyle.Class = ""; - this.ribbonBar4.TitleStyle.CornerType = DevComponents.DotNetBar.eCornerType.Square; - // - // - // - this.ribbonBar4.TitleStyleMouseOver.Class = ""; - this.ribbonBar4.TitleStyleMouseOver.CornerType = DevComponents.DotNetBar.eCornerType.Square; - this.ribbonBar4.TitleVisible = false; - // - // buttonItem_TaskManager - // - this.buttonItem_TaskManager.Image = global::Cyberpipe.Properties.Resources._24x24icon__2__76; - this.buttonItem_TaskManager.ImagePosition = DevComponents.DotNetBar.eImagePosition.Top; - this.buttonItem_TaskManager.Name = "buttonItem_TaskManager"; - this.buttonItem_TaskManager.SubItemsExpandWidth = 14; - this.buttonItem_TaskManager.Text = "工单管理"; - this.buttonItem_TaskManager.Click += new System.EventHandler(this.buttonItem_TaskManager_Click); - // - // buttonItem_OnlineTask - // - this.buttonItem_OnlineTask.Image = global::Cyberpipe.Properties.Resources._24x24icon__2__69; - this.buttonItem_OnlineTask.ImagePosition = DevComponents.DotNetBar.eImagePosition.Top; - this.buttonItem_OnlineTask.Name = "buttonItem_OnlineTask"; - this.buttonItem_OnlineTask.SubItemsExpandWidth = 14; - this.buttonItem_OnlineTask.Text = "在线任务"; - this.buttonItem_OnlineTask.Click += new System.EventHandler(this.buttonItem_OnlineTask_Click); - // - // buttonItem_Event - // - this.buttonItem_Event.Image = global::Cyberpipe.Properties.Resources._24x24icon__2__72; - this.buttonItem_Event.ImagePosition = DevComponents.DotNetBar.eImagePosition.Top; - this.buttonItem_Event.Name = "buttonItem_Event"; - this.buttonItem_Event.SubItemsExpandWidth = 14; - this.buttonItem_Event.Text = "事件管理"; - this.buttonItem_Event.Click += new System.EventHandler(this.buttonItem_Event_Click); - // - // ribbonPanel3 - // - this.ribbonPanel3.ColorSchemeStyle = DevComponents.DotNetBar.eDotNetBarStyle.StyleManagerControlled; - this.ribbonPanel3.Controls.Add(this.ribbonBar3); - this.ribbonPanel3.Dock = System.Windows.Forms.DockStyle.Fill; - this.ribbonPanel3.Location = new System.Drawing.Point(0, 33); - this.ribbonPanel3.Name = "ribbonPanel3"; - this.ribbonPanel3.Padding = new System.Windows.Forms.Padding(3, 0, 3, 3); - this.ribbonPanel3.Size = new System.Drawing.Size(1328, 62); - // - // - // - this.ribbonPanel3.Style.Class = ""; - this.ribbonPanel3.Style.CornerType = DevComponents.DotNetBar.eCornerType.Square; - // - // - // - this.ribbonPanel3.StyleMouseDown.Class = ""; - this.ribbonPanel3.StyleMouseDown.CornerType = DevComponents.DotNetBar.eCornerType.Square; - // - // - // - this.ribbonPanel3.StyleMouseOver.Class = ""; - this.ribbonPanel3.StyleMouseOver.CornerType = DevComponents.DotNetBar.eCornerType.Square; - this.ribbonPanel3.TabIndex = 40; - // - // ribbonBar3 - // - this.ribbonBar3.AutoOverflowEnabled = true; - // - // - // - this.ribbonBar3.BackgroundMouseOverStyle.Class = ""; - this.ribbonBar3.BackgroundMouseOverStyle.CornerType = DevComponents.DotNetBar.eCornerType.Square; - // - // - // - this.ribbonBar3.BackgroundStyle.Class = ""; - this.ribbonBar3.BackgroundStyle.CornerType = DevComponents.DotNetBar.eCornerType.Square; - this.ribbonBar3.ContainerControlProcessDialogKey = true; - this.ribbonBar3.Dock = System.Windows.Forms.DockStyle.Left; - this.ribbonBar3.Items.AddRange(new DevComponents.DotNetBar.BaseItem[] { - this.btn_device, - this.btn_Person, - this.btn_constructMap, - this.buttonItem9}); - this.ribbonBar3.Location = new System.Drawing.Point(3, 0); - this.ribbonBar3.Name = "ribbonBar3"; - this.ribbonBar3.Size = new System.Drawing.Size(378, 59); - this.ribbonBar3.Style = DevComponents.DotNetBar.eDotNetBarStyle.StyleManagerControlled; - this.ribbonBar3.TabIndex = 0; - // - // - // - this.ribbonBar3.TitleStyle.Class = ""; - this.ribbonBar3.TitleStyle.CornerType = DevComponents.DotNetBar.eCornerType.Square; - // - // - // - this.ribbonBar3.TitleStyleMouseOver.Class = ""; - this.ribbonBar3.TitleStyleMouseOver.CornerType = DevComponents.DotNetBar.eCornerType.Square; - this.ribbonBar3.TitleVisible = false; - // - // btn_device - // - this.btn_device.ButtonStyle = DevComponents.DotNetBar.eButtonStyle.ImageAndText; - this.btn_device.Image = global::Cyberpipe.Properties.Resources._24X24__2__02; - this.btn_device.ImagePosition = DevComponents.DotNetBar.eImagePosition.Top; - this.btn_device.Name = "btn_device"; - this.btn_device.SubItemsExpandWidth = 14; - this.btn_device.Text = "探测仪管理"; - this.btn_device.Click += new System.EventHandler(this.btn_device_Click); - // - // btn_Person - // - this.btn_Person.ButtonStyle = DevComponents.DotNetBar.eButtonStyle.ImageAndText; - this.btn_Person.Image = global::Cyberpipe.Properties.Resources._24x24icon_05_hover1; - this.btn_Person.ImagePosition = DevComponents.DotNetBar.eImagePosition.Top; - this.btn_Person.Name = "btn_Person"; - this.btn_Person.SubItemsExpandWidth = 14; - this.btn_Person.Text = "定位人员维护"; - this.btn_Person.Click += new System.EventHandler(this.btn_Person_Click); - // - // btn_constructMap - // - this.btn_constructMap.Image = global::Cyberpipe.Properties.Resources._24x24icon_04_hover; - this.btn_constructMap.ImagePosition = DevComponents.DotNetBar.eImagePosition.Top; - this.btn_constructMap.Name = "btn_constructMap"; - this.btn_constructMap.SubItemsExpandWidth = 14; - this.btn_constructMap.Text = "导出施工图"; - this.btn_constructMap.Click += new System.EventHandler(this.btn_constructMap_Click); - // - // buttonItem9 - // - this.buttonItem9.Image = global::Cyberpipe.Properties.Resources._24x24icon__2__10; - this.buttonItem9.ImagePosition = DevComponents.DotNetBar.eImagePosition.Top; - this.buttonItem9.Name = "buttonItem9"; - this.buttonItem9.SubItemsExpandWidth = 14; - this.buttonItem9.Text = "文档管理"; - this.buttonItem9.Click += new System.EventHandler(this.buttonItem9_Click); - // // ribbonPanel8 // this.ribbonPanel8.ColorSchemeStyle = DevComponents.DotNetBar.eDotNetBarStyle.StyleManagerControlled; @@ -4696,6 +4625,86 @@ this.btn_reset_password.Text = "重置密码"; this.btn_reset_password.Click += new System.EventHandler(this.btn_reset_password_Click); // + // ribbonPanel7 + // + this.ribbonPanel7.ColorSchemeStyle = DevComponents.DotNetBar.eDotNetBarStyle.StyleManagerControlled; + this.ribbonPanel7.Controls.Add(this.ribbonBar5); + this.ribbonPanel7.Dock = System.Windows.Forms.DockStyle.Fill; + this.ribbonPanel7.Location = new System.Drawing.Point(0, 0); + this.ribbonPanel7.Name = "ribbonPanel7"; + this.ribbonPanel7.Padding = new System.Windows.Forms.Padding(3, 0, 3, 3); + this.ribbonPanel7.Size = new System.Drawing.Size(1328, 95); + // + // + // + this.ribbonPanel7.Style.Class = ""; + this.ribbonPanel7.Style.CornerType = DevComponents.DotNetBar.eCornerType.Square; + // + // + // + this.ribbonPanel7.StyleMouseDown.Class = ""; + this.ribbonPanel7.StyleMouseDown.CornerType = DevComponents.DotNetBar.eCornerType.Square; + // + // + // + this.ribbonPanel7.StyleMouseOver.Class = ""; + this.ribbonPanel7.StyleMouseOver.CornerType = DevComponents.DotNetBar.eCornerType.Square; + this.ribbonPanel7.TabIndex = 41; + this.ribbonPanel7.Visible = false; + // + // ribbonBar5 + // + this.ribbonBar5.AutoOverflowEnabled = true; + // + // + // + this.ribbonBar5.BackgroundMouseOverStyle.Class = ""; + this.ribbonBar5.BackgroundMouseOverStyle.CornerType = DevComponents.DotNetBar.eCornerType.Square; + // + // + // + this.ribbonBar5.BackgroundStyle.Class = ""; + this.ribbonBar5.BackgroundStyle.CornerType = DevComponents.DotNetBar.eCornerType.Square; + this.ribbonBar5.ContainerControlProcessDialogKey = true; + this.ribbonBar5.Dock = System.Windows.Forms.DockStyle.Left; + this.ribbonBar5.Items.AddRange(new DevComponents.DotNetBar.BaseItem[] { + this.btn_flag, + this.slider4ground}); + this.ribbonBar5.Location = new System.Drawing.Point(3, 0); + this.ribbonBar5.Name = "ribbonBar5"; + this.ribbonBar5.Size = new System.Drawing.Size(418, 92); + this.ribbonBar5.Style = DevComponents.DotNetBar.eDotNetBarStyle.StyleManagerControlled; + this.ribbonBar5.TabIndex = 0; + // + // + // + this.ribbonBar5.TitleStyle.Class = ""; + this.ribbonBar5.TitleStyle.CornerType = DevComponents.DotNetBar.eCornerType.Square; + // + // + // + this.ribbonBar5.TitleStyleMouseOver.Class = ""; + this.ribbonBar5.TitleStyleMouseOver.CornerType = DevComponents.DotNetBar.eCornerType.Square; + this.ribbonBar5.TitleVisible = false; + this.ribbonBar5.ItemClick += new System.EventHandler(this.ribbonBar5_ItemClick); + // + // btn_flag + // + this.btn_flag.Image = global::Cyberpipe.Properties.Resources._24x24icon_03_hover; + this.btn_flag.ImagePosition = DevComponents.DotNetBar.eImagePosition.Top; + this.btn_flag.Name = "btn_flag"; + this.btn_flag.SubItemsExpandWidth = 14; + this.btn_flag.Text = "标识器管理"; + this.btn_flag.Click += new System.EventHandler(this.btn_flag_Click); + // + // slider4ground + // + this.slider4ground.LabelPosition = DevComponents.DotNetBar.eSliderLabelPosition.Top; + this.slider4ground.Name = "slider4ground"; + this.slider4ground.Text = "地面透明度"; + this.slider4ground.Value = 0; + this.slider4ground.ValueChanged += new System.EventHandler(this.slider4ground_ValueChanged); + // // ribbonPanel15 // this.ribbonPanel15.ColorSchemeStyle = DevComponents.DotNetBar.eDotNetBarStyle.StyleManagerControlled; @@ -6393,16 +6402,6 @@ this.buttonItem76.SubItemsExpandWidth = 14; this.buttonItem76.Text = "坐标标注"; // - // layerTree - // - this.layerTree.CheckBoxes = true; - this.layerTree.ItemHeight = 18; - this.layerTree.Location = new System.Drawing.Point(30, 78); - this.layerTree.Name = "layerTree"; - this.layerTree.Size = new System.Drawing.Size(121, 97); - this.layerTree.TabIndex = 1; - this.layerTree.AfterCheck += new System.Windows.Forms.TreeViewEventHandler(this.layerTree_AfterCheck); - // // MainFrm // this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Inherit; @@ -6475,11 +6474,11 @@ this.contextMenuStripDeleteLayerNode.ResumeLayout(false); this.ribbonControl1.ResumeLayout(false); this.ribbonControl1.PerformLayout(); - this.ribbonPanel1.ResumeLayout(false); - this.ribbonPanel7.ResumeLayout(false); - this.ribbonPanel2.ResumeLayout(false); this.ribbonPanel3.ResumeLayout(false); + this.ribbonPanel2.ResumeLayout(false); + this.ribbonPanel1.ResumeLayout(false); this.ribbonPanel8.ResumeLayout(false); + this.ribbonPanel7.ResumeLayout(false); this.ribbonPanel15.ResumeLayout(false); ((System.ComponentModel.ISupportInitialize)(this.pictureBox1)).EndInit(); this.ResumeLayout(false); diff --git a/NewFunction/FrmCreateTunnel.cs b/NewFunction/FrmCreateTunnel.cs index 282767c..338edff 100644 --- a/NewFunction/FrmCreateTunnel.cs +++ b/NewFunction/FrmCreateTunnel.cs @@ -142,35 +142,6 @@ } } - private void txtMS_KeyPress(object sender, KeyPressEventArgs e) - { - TextBox text = sender as TextBox; - if ((e.KeyChar < 48 || e.KeyChar > 57) && (e.KeyChar != 8) && (int)e.KeyChar != 46) - { - e.Handled = true; - } - if ((int)e.KeyChar == 46) //小数点 - { - if (text.Text.Length <= 0) - e.Handled = true; //小数点不能在第一位 - else //处理不规则的小数点 - { - float f; - float oldf; - bool b1 = false, b2 = false; - b1 = float.TryParse(text.Text, out oldf); - b2 = float.TryParse(text.Text + e.KeyChar.ToString(), out f); - if (b2 == false) - { - if (b1 == true) - e.Handled = true; - else - e.Handled = false; - } - } - } - } - private void FrmCreateTunnel_Load(object sender, EventArgs e) { if (comboBoxTunnelType.Items.Count > 0) diff --git a/OracleHelper.cs b/OracleHelper.cs index 11eebe6..79cdf48 100644 --- a/OracleHelper.cs +++ b/OracleHelper.cs @@ -49,7 +49,7 @@ { conn.Close(); } - MessageBox.Show(ex.Message, "提示"); + LogHelper.WriteLog(typeof(OledbHelper), ex.Message); return null; } } @@ -67,7 +67,7 @@ } catch(Exception ex) { - // LogError.PublishError(ex); + LogHelper.WriteLog(typeof(OledbHelper), ex.Message); } finally { @@ -111,6 +111,7 @@ } catch (Exception ex) { + LogHelper.WriteLog(typeof(OledbHelper), ex.Message); return null; } } @@ -131,6 +132,7 @@ } catch(Exception ex) { + LogHelper.WriteLog(typeof(OledbHelper), ex.Message); rowCount = -1; } finally @@ -159,6 +161,7 @@ } catch(Exception ex) { + LogHelper.WriteLog(typeof(OledbHelper), ex.Message); num = -1; } finally @@ -190,6 +193,7 @@ } catch (Exception ex) { + LogHelper.WriteLog(typeof(OledbHelper), ex.Message); return null; } } @@ -210,7 +214,7 @@ oracleCmd.Dispose(); conn.Close(); //调用con_close()方法,关闭与数据库的连接 }catch(Exception ex){ - + LogHelper.WriteLog(typeof(OledbHelper), ex.Message); } finally { @@ -237,6 +241,7 @@ } catch (Exception ex) { + LogHelper.WriteLog(typeof(OledbHelper), ex.Message); rowCount = -1; } finally diff --git a/OracleUtils.cs b/OracleUtils.cs index 29b5374..c1aadda 100644 --- a/OracleUtils.cs +++ b/OracleUtils.cs @@ -741,7 +741,6 @@ } catch { - //if we fail to return the SqlDatReader, we need to close the connection ourselves cn.Close(); throw; } diff --git a/PAS.cs b/PAS.cs index 972de2d..fcda1dd 100644 --- a/PAS.cs +++ b/PAS.cs @@ -93,15 +93,7 @@ } - private void TSM_Pderive_Click(object sender, EventArgs e) - { - PASAClass.Table_name(operation); - if (TV_Files.SelectedNode != null) - { - PASAClass.GuideEdit_form("G", TV_Files, int.Parse(((ToolStripMenuItem)sender).Tag.ToString())); - } - } - + private void TSM_Fenter_Click(object sender, EventArgs e) { if (TV_Files.SelectedNode != null) @@ -110,16 +102,6 @@ } } - private void TSM_Frename_Click(object sender, EventArgs e) - { - TSM_Fenter_Click(sender, e); - } - - private void TSM_Fdelete_Click(object sender, EventArgs e) - { - TSM_Fenter_Click(sender, e); - } - private void TSM_Fderive_Click(object sender, EventArgs e) { if (TV_Files.SelectedNode != null) @@ -128,25 +110,6 @@ } } - private void TSM_Fprint_Click(object sender, EventArgs e) - { - if (TV_Files.SelectedNode != null) - { - PASAClass.Print(int.Parse(TV_Files.SelectedNode.Tag.ToString()), TV_Files.SelectedNode.Text, PD_PASPrtFile, PD_PASPrtDoc); - - } - } - - private void TSM_PASPgSt_Click(object sender, EventArgs e) - { - PSD_PASSetPage.ShowDialog(); - } - - private void TSM_PASPreV_Click(object sender, EventArgs e) - { - PPD_PASPreV.ShowDialog(); - } - private void TV_Files_AfterCollapse(object sender, TreeViewEventArgs e) { e.Node.ImageIndex = 0; @@ -250,14 +213,6 @@ } } - private void 导出ToolStripMenuItem_Click(object sender, EventArgs e) - { - PASAClass.Table_name(operation); - if (TV_Files.SelectedNode != null) - { - PASAClass.GuideEdit_form("G", TV_Files, int.Parse(((ToolStripMenuItem)sender).Tag.ToString())); - } - } private void 导入ToolStripMenuItem_Click(object sender, EventArgs e) { diff --git a/PAS_Forms/F_PASInout.cs b/PAS_Forms/F_PASInout.cs index 373a4e6..974f987 100644 --- a/PAS_Forms/F_PASInout.cs +++ b/PAS_Forms/F_PASInout.cs @@ -71,11 +71,6 @@ } - private void Cancel_Click(object sender, EventArgs e) - { - this.Close(); - } - private void OK_Click(object sender, EventArgs e) { if (textBox1.Text == "") diff --git a/PATM.cs b/PATM.cs index edecd1e..9b6c51d 100644 --- a/PATM.cs +++ b/PATM.cs @@ -26,12 +26,6 @@ public string operation = ""; #endregion - - - - - - private void TSM_Pnew_Click(object sender, EventArgs e) { if (LV_proj.Visible) @@ -94,15 +88,6 @@ } - private void TSM_Pderive_Click(object sender, EventArgs e) - { - PATMAClass.Table_name(operation); - if (TV_files.SelectedNode != null) - { - PATMAClass.GuideEdit_form("G", TV_files, int.Parse(((ToolStripMenuItem)sender).Tag.ToString())); - } - } - private void TSM_Fenter_Click(object sender, EventArgs e) { if (TV_files.SelectedNode != null) @@ -163,35 +148,6 @@ //PATMAClass.Show_AllFile(int.Parse(e.Node.Tag.ToString()), e.Node.Text, LV_PATMallfiles, PB_Display, 2);//此处为显示图片操作 } - private void TSM_Frename_Click(object sender, EventArgs e) - { - TSM_Fenter_Click(sender, e); - } - - private void TSM_Fdelete_Click(object sender, EventArgs e) - { - TSM_Fenter_Click(sender, e); - } - - private void TSM_Fderive_Click(object sender, EventArgs e) - { - if (TV_files.SelectedNode != null) - { - PATMAClass.GuideEdit_form("G", TV_files, int.Parse(((ToolStripMenuItem)sender).Tag.ToString())); - } - } - - private void TSM_Fprint_Click(object sender, EventArgs e) - { - if (TV_files.SelectedNode != null) - { - PATMAClass.Print(int.Parse(TV_files.SelectedNode.Tag.ToString()), TV_files.SelectedNode.Text, PD_PATMPrtFile, PD_PATMPrtDoc); - - } - } - - - private void BT_PATMSch_Click(object sender, EventArgs e) { //LV_PATMallfiles.Dock = DockStyle.Fill;//使ListView控件最大化 @@ -210,32 +166,6 @@ } - private void TSM_PATMPreV_Click(object sender, EventArgs e) - { - PPD_PATMPreV.ShowDialog(); - } - - private void TSM_PATMPgSt_Click(object sender, EventArgs e) - { - PSD_PATMSetPage.ShowDialog(); - } - - private void LV_PATMSrchRslt_MouseClick(object sender, MouseEventArgs e) - { - - if (LV_proj.SelectedItems != null) - { - //int i = 1; - // PATMAClass.Show_AllFile(int.Parse(LV_PATMSrchRslt.FocusedItem.Tag.ToString()), LV_PATMSrchRslt.FocusedItem.Text, LV_PATMallfiles,PB_Display, 0); - - } - } - - private void LV_PATMSrchRslt_MouseDoubleClick(object sender, MouseEventArgs e) - { - //PATMAClass.Show_AllFile(int.Parse(LV_PATMSrchRslt.FocusedItem.Tag.ToString()), LV_PATMSrchRslt.FocusedItem.Text, LV_PATMallfiles, PB_Display, 2); - } - private void 新建ToolStripMenuItem_Click(object sender, EventArgs e) { if ((TV_files.SelectedNode != null)&&(TV_files.SelectedNode.Parent==null)) @@ -288,17 +218,6 @@ } } - private void 打印预览toolStripMenuItem_Click(object sender, EventArgs e) - { - - PPD_PATMPreV.ShowDialog(); - } - - private void 打印设置toolStripMenuItem_Click(object sender, EventArgs e) - { - PSD_PATMSetPage.ShowDialog(); - } - private void TV_PATMSrchRslt_NodeMouseClick(object sender, TreeNodeMouseClickEventArgs e) { if (e.Button == MouseButtons.Right) diff --git a/PATM_Forms/F_PATMTitle.cs b/PATM_Forms/F_PATMTitle.cs index 7380dd8..5d1fe8c 100644 --- a/PATM_Forms/F_PATMTitle.cs +++ b/PATM_Forms/F_PATMTitle.cs @@ -148,19 +148,6 @@ return 0; } - //判断是否为已有工程 - private bool checkProject(string projectname) { - string sql = "select * from "+this.tablename+" where "+tablename+".NODENAME = '"+projectname - +"'"; - DataTable table = OledbHelper.QueryTable(sql); - if (table.Rows.Count > 0) - { - return true; - } - else { - return false; - } - } private void buttonX2_Click(object sender, EventArgs e) { diff --git a/PATM_Forms/F_PATMinout.cs b/PATM_Forms/F_PATMinout.cs index e404e7b..16b51de 100644 --- a/PATM_Forms/F_PATMinout.cs +++ b/PATM_Forms/F_PATMinout.cs @@ -174,12 +174,6 @@ { this.Close(); } - - private void TV_PATMinout_AfterCollapse(object sender, TreeViewEventArgs e) - { - e.Node.ImageIndex = 0; - } - //private void TV_PATMinout_NodeMouseDoubleClick(object sender, TreeNodeMouseClickEventArgs e) diff --git "a/PED_Forms/F_\346\225\260\346\215\256\350\276\223\345\205\245\350\276\223\345\207\272.cs" "b/PED_Forms/F_\346\225\260\346\215\256\350\276\223\345\205\245\350\276\223\345\207\272.cs" index 0f76b8c..4de8b4d 100644 --- "a/PED_Forms/F_\346\225\260\346\215\256\350\276\223\345\205\245\350\276\223\345\207\272.cs" +++ "b/PED_Forms/F_\346\225\260\346\215\256\350\276\223\345\205\245\350\276\223\345\207\272.cs" @@ -188,12 +188,7 @@ } DialogResult = DialogResult.OK;//将当前窗体的对话框返回值设为OK } - private void treeView1_NodeMouseClick(object sender, TreeNodeMouseClickEventArgs e) - { - - //dir = comboBox_Disk.Text + e.Node.FullPath; - e.Node.SelectedImageIndex = e.Node.ImageIndex; - } + private void button1_Click(object sender, EventArgs e) { diff --git a/Program.cs b/Program.cs index 1ff0987..0e480f2 100644 --- a/Program.cs +++ b/Program.cs @@ -105,22 +105,6 @@ File.Copy(localPath_config, filePath_config, true); } - private static void createFolder(String folerName) - { - if (!Directory.Exists(folerName)) - { - Directory.CreateDirectory(folerName); - } - } - - private static void delOldVersion(String fileName) - { - if (System.IO.File.Exists(fileName)) - { - File.Delete(fileName); - } - } - //获取新版本程序的路径 private static string getProgramUrl(string fileName, string nodeName) { diff --git "a/SFiles_Forms/F_SFiles\346\225\260\346\215\256\350\276\223\345\205\245\350\276\223\345\207\272.cs" "b/SFiles_Forms/F_SFiles\346\225\260\346\215\256\350\276\223\345\205\245\350\276\223\345\207\272.cs" index 6f36e10..493895d 100644 --- "a/SFiles_Forms/F_SFiles\346\225\260\346\215\256\350\276\223\345\205\245\350\276\223\345\207\272.cs" +++ "b/SFiles_Forms/F_SFiles\346\225\260\346\215\256\350\276\223\345\205\245\350\276\223\345\207\272.cs" @@ -188,12 +188,6 @@ } DialogResult = DialogResult.OK;//将当前窗体的对话框返回值设为OK } - private void treeView1_NodeMouseClick(object sender, TreeNodeMouseClickEventArgs e) - { - - //dir = comboBox_Disk.Text + e.Node.FullPath; - e.Node.SelectedImageIndex = e.Node.ImageIndex; - } private void button1_Click(object sender, EventArgs e) { diff --git a/SysRescInfoManager.cs b/SysRescInfoManager.cs index 5b3038a..067b90b 100644 --- a/SysRescInfoManager.cs +++ b/SysRescInfoManager.cs @@ -214,15 +214,6 @@ winGridViewPager1.DataSource = table.DefaultView; } - private void LoadData(int pageIndex) - { - string sqlData = GetSql(pageIndex); - initlizeDatagrid(); - DataTable table = OracleUtils.ExecuteDataset(OracleUtils.ConnectionString, CommandType.Text, sqlData).Tables[0]; - winGridViewPager1.DataSource = table.DefaultView; - winGridViewPager1.Refresh(); - } - private string GetSql() { string sqlCount = "select count(*) from casic_userresctest where sysname='EMS'"; diff --git a/Utility.cs b/Utility.cs index 0e929aa..4da961f 100644 --- a/Utility.cs +++ b/Utility.cs @@ -382,7 +382,7 @@ } catch (Exception ex) { - //LogError.PublishError(ex); + LogHelper.WriteLog(typeof(Utility), ex.Message); } finally { @@ -443,7 +443,7 @@ } catch (Exception ex) { - //LogError.PublishError(ex); + LogHelper.WriteLog(typeof(Utility), ex.Message); } finally { @@ -483,7 +483,7 @@ } catch (Exception ex) { - //LogError.PublishError(ex); + LogHelper.WriteLog(typeof(Utility), ex.Message); } finally { @@ -526,8 +526,8 @@ } catch (Exception ex) { - - //LogError.PublishError(ex); + + LogHelper.WriteLog(typeof(Utility), ex.Message); } //finally //{ @@ -565,7 +565,7 @@ } catch (Exception ex) { - //LogError.PublishError(ex); + LogHelper.WriteLog(typeof(Utility), ex.Message); } finally { @@ -600,7 +600,7 @@ } catch (Exception ex) { - //LogError.PublishError(ex); + LogHelper.WriteLog(typeof(Utility), ex.Message); } finally { @@ -639,7 +639,7 @@ } catch (Exception ex) { - //LogError.PublishError(ex); + LogHelper.WriteLog(typeof(Utility),ex.Message); } finally { diff --git a/Cyberpipe.csproj b/Cyberpipe.csproj index 07a8c1a..e3cd12c 100644 --- a/Cyberpipe.csproj +++ b/Cyberpipe.csproj @@ -204,25 +204,6 @@ - - Form - - - F_GKT1数据输入输出.cs - - - Form - - - F_GKT1添加文件.cs - - - Form - - - F_GKT1添加项目.cs - - Form @@ -1068,18 +1049,6 @@ Frm_password_reset.cs - - Form - - - GKT.cs - - - Form - - - GKT1.cs - Form @@ -1258,12 +1227,6 @@ F_Projedit.cs - - Form - - - PED.cs - Form @@ -1331,16 +1294,6 @@ True Reference.map - - F_GKT1数据输入输出.cs - Designer - - - F_GKT1添加文件.cs - - - F_GKT1添加项目.cs - Form_EditTask.cs @@ -1836,12 +1789,6 @@ Frm_password_reset.cs - - GKT.cs - - - GKT1.cs - F_GKT数据输入输出.cs @@ -1934,9 +1881,6 @@ F_Projedit.cs - - PED.cs - F_数据输入输出.cs diff --git a/Cyberpipe.suo b/Cyberpipe.suo index 68ced4f..a1aecf8 100644 --- a/Cyberpipe.suo +++ b/Cyberpipe.suo Binary files differ diff --git a/EMS_Forms/Form_EditTask.cs b/EMS_Forms/Form_EditTask.cs index 718992f..f1d791f 100644 --- a/EMS_Forms/Form_EditTask.cs +++ b/EMS_Forms/Form_EditTask.cs @@ -119,7 +119,8 @@ String name = Convert.ToString(dr["USERNAME"]); comboBox_userName.Items.Add(name); - } + } + dr.Close(); comboBox_road.Items.Clear(); roadList = new List(); @@ -135,7 +136,7 @@ comboBox_road.Items.Add(name); } } - + dr1.Close(); conn.Close(); bool flag2 = false; @@ -185,7 +186,7 @@ catch (Exception ex) { - MessageBox.Show(ex.ToString()); + LogHelper.WriteLog(typeof(Form_EditTask), ex.Message); } } @@ -288,7 +289,7 @@ } catch (Exception ex) { - MessageBox.Show(ex.ToString()); + LogHelper.WriteLog(typeof(Form_EditTask), ex.Message); } } @@ -474,7 +475,7 @@ } catch (Exception ex) { - MessageBox.Show(ex.ToString()); + LogHelper.WriteLog(typeof(Form_EditTask), ex.Message); } this.Close(); @@ -495,6 +496,7 @@ { numList.Add(Convert.ToInt32(dr["DBID"])); } + dr.Close(); if (numList.Count == 0) { taskNumber = Convert.ToInt32(number) * 100; @@ -674,6 +676,7 @@ } } } + dr.Close(); conn.Close(); } diff --git a/EMS_Forms/Form_EventManager.cs b/EMS_Forms/Form_EventManager.cs index b18c45b..84807b2 100644 --- a/EMS_Forms/Form_EventManager.cs +++ b/EMS_Forms/Form_EventManager.cs @@ -64,6 +64,7 @@ comboBox_name.Items.Add(name); } + dr.Close(); conn.Close(); diff --git a/Forms/FrmMnModify.cs b/Forms/FrmMnModify.cs index 31cfc5f..d036360 100644 --- a/Forms/FrmMnModify.cs +++ b/Forms/FrmMnModify.cs @@ -68,15 +68,7 @@ questionGrid.Rows[idx].Cells[1].Value = sr.question; } } - /// 选中对象 - /// - /// - /// - /// - private void buttonX1_Click(object sender, EventArgs e) - { - globecontrol.Globe.Action = EnumAction3D.SelectObject; - } + /// /// 选中某一行 /// diff --git a/Forms/FrmPipelineModelDataBase.cs b/Forms/FrmPipelineModelDataBase.cs index 2acf0ca..7ce573f 100644 --- a/Forms/FrmPipelineModelDataBase.cs +++ b/Forms/FrmPipelineModelDataBase.cs @@ -35,19 +35,7 @@ ds = _ds; InitializeComponent(); } - /// - /// 单击选择shp格式文件 - /// - /// - /// - private void btnBrowseModel_Click(object sender, EventArgs e) - { - saveFileDialog1.Filter = "*.lgd|*.lgd"; - if (saveFileDialog1.ShowDialog() == DialogResult.OK) - { - txtModelLayer.Text = saveFileDialog1.FileName; - } - } + /// /// 窗体初始化事件处理 /// @@ -100,49 +88,6 @@ } } } - - private object convertFieldValue(string fieldname, object obj) - { - if (obj == null) - return null; - - try - { - string type = fields_types[fieldname].ToString(); - switch (type) - { - case "string": - return obj.ToString(); - case "int": - //return 101; - int intResult; - if (int.TryParse(obj.ToString(), out intResult)) - return intResult; - else - return null; - case "double": - //return 202.5; - double doubleResult; - if (double.TryParse(obj.ToString(), out doubleResult)) - return doubleResult; - else - return null; - case "date": - DateTime dtResult; - if (DateTime.TryParse(obj.ToString(), out dtResult)) - return dtResult; - else - return null; - } - return null; - } - catch (Exception ex) - { - MessageBox.Show(ex.ToString()); - return null; - } - } - public string lgdFilePath = ""; /// /// 选择管线颜色 @@ -610,33 +555,6 @@ { this.Close(); } - - private void cmbLayer_SelectedIndexChanged(object sender, EventArgs e) //选择图层 - { - GSOLayer layer = ctl.Globe.Layers.GetLayerByCaption(selectLayerName); - GSOFeatures features = layer.GetAllFeatures(); - if (features.Length == 0) - return; - - cmbFrom.Items.Clear(); - cmbTo.Items.Clear(); - cmbRadius.Items.Clear(); - cmbID.Items.Clear(); - for (int i = 0; i < features[0].GetFieldCount(); i++) - { - GeoScene.Data.GSOFieldDefn fielddef = (GeoScene.Data.GSOFieldDefn)(features[0].GetFieldDefn(i)); - - cmbFrom.Items.Add(fielddef.Name); - cmbTo.Items.Add(fielddef.Name); - cmbRadius.Items.Add(fielddef.Name); - cmbID.Items.Add(fielddef.Name); - } - cmbFrom.SelectedItem = "Deep1"; - cmbTo.SelectedItem = "Deep2"; - cmbRadius.SelectedItem = "Diameter"; - cmbID.SelectedItem = "Handle"; - } - private void buttonXLayerPath_Click(object sender, EventArgs e)//单击 选择shp格式的文件 { OpenFileDialog dlg = new OpenFileDialog(); diff --git a/Forms/FrmPipelineModelDataOneStep.cs b/Forms/FrmPipelineModelDataOneStep.cs index 18afda7..ec93b8a 100644 --- a/Forms/FrmPipelineModelDataOneStep.cs +++ b/Forms/FrmPipelineModelDataOneStep.cs @@ -38,19 +38,7 @@ layerTree = _layerTree; InitializeComponent(); } - /// - /// 单击选择shp格式文件 - /// - /// - /// - private void btnBrowseModel_Click(object sender, EventArgs e) - { - saveFileDialog1.Filter = "*.lgd|*.lgd"; - if (saveFileDialog1.ShowDialog() == DialogResult.OK) - { - txtModelLayer.Text = saveFileDialog1.FileName; - } - } + /// /// 窗体初始化事件处理 /// @@ -107,48 +95,7 @@ } } - private object convertFieldValue(string fieldname, object obj) - { - if (obj == null) - return null; - - try - { - string type = fields_types[fieldname].ToString(); - switch (type) - { - case "string": - return obj.ToString(); - case "int": - //return 101; - int intResult; - if (int.TryParse(obj.ToString(), out intResult)) - return intResult; - else - return null; - case "double": - //return 202.5; - double doubleResult; - if (double.TryParse(obj.ToString(), out doubleResult)) - return doubleResult; - else - return null; - case "date": - DateTime dtResult; - if (DateTime.TryParse(obj.ToString(), out dtResult)) - return dtResult; - else - return null; - } - return null; - } - catch (Exception ex) - { - MessageBox.Show(ex.ToString()); - return null; - } - } - + public string lgdFilePath = ""; /// /// 选择管线颜色 @@ -673,32 +620,6 @@ return featDs; } - private void cmbLayer_SelectedIndexChanged(object sender, EventArgs e) //选择图层 - { - GSOLayer layer = ctl.Globe.Layers.GetLayerByCaption(selectLayerName); - GSOFeatures features = layer.GetAllFeatures(); - if (features.Length == 0) - return; - - cmbFrom.Items.Clear(); - cmbTo.Items.Clear(); - cmbRadius.Items.Clear(); - cmbID.Items.Clear(); - for (int i = 0; i < features[0].GetFieldCount(); i++) - { - GeoScene.Data.GSOFieldDefn fielddef = (GeoScene.Data.GSOFieldDefn)(features[0].GetFieldDefn(i)); - - cmbFrom.Items.Add(fielddef.Name); - cmbTo.Items.Add(fielddef.Name); - cmbRadius.Items.Add(fielddef.Name); - cmbID.Items.Add(fielddef.Name); - } - cmbFrom.SelectedItem = "Deep1"; - cmbTo.SelectedItem = "Deep2"; - cmbRadius.SelectedItem = "Diameter"; - cmbID.SelectedItem = "Handle"; - } - private void buttonXLayerPath_Click(object sender, EventArgs e)//单击 选择shp格式的文件 { OpenFileDialog dlg = new OpenFileDialog(); @@ -949,38 +870,6 @@ } //txtLayername.Text = type + layername; } - /// - /// 连接数据库 - /// - /// - /// - private void buttonX1_Click(object sender, EventArgs e) - { - if (ds == null) - { - //没连的话,直接连接审核库; //审核库配置读配置文件 - string dbIp = Utility.sgdbip; - string database = Utility.sgdbname; - string user = Utility.sgdbuser; - string pass = Utility.sgdbpwd; - - if (!Utility.isNetworkConnectionSuccess(dbIp.Trim())) - { - MessageBox.Show("网络连接失败!", "提示"); - return; - } - - ds = ctl.Globe.DataManager.OpenOracleDataSource(dbIp + "/" + database, "", "", user, pass); - if (ds == null) - { - MessageBox.Show("数据库连接失败!", "提示", MessageBoxButtons.OK, MessageBoxIcon.Warning); - } - else - { - btnCreateModel.Enabled = true; - } - } - } private void btnClose_Click(object sender, EventArgs e) { diff --git a/Forms/FrmShRK.cs b/Forms/FrmShRK.cs index 0e2e722..f1d83cb 100644 --- a/Forms/FrmShRK.cs +++ b/Forms/FrmShRK.cs @@ -215,6 +215,7 @@ { sourcefeatds = sourcefeat as GSOFeatureDataset; } + if (sourcefeatds == null) return; sourcefeatds.Open(); GSOFeatures sourcefeatures = sourcefeatds.GetAllFeatures(); @@ -251,6 +252,7 @@ { desfeatds = desfeat as GSOFeatureDataset; } + if (desfeatds == null) return; desfeatds.Open(); //向新数据集写入字段 diff --git a/FrmAccessoriesSensor.cs b/FrmAccessoriesSensor.cs index 09fcdf1..2a7a80e 100644 --- a/FrmAccessoriesSensor.cs +++ b/FrmAccessoriesSensor.cs @@ -209,7 +209,7 @@ chart1.Series[0].Points.DataBindXY(dic.Keys, dic.Values); for (int m = 0; m < dic.Values.Count; m++) { - if (chart1.Series[0].Points[m].YValues[0].ToString() != "0") + if (chart1.Series[0].Points[m]!=null&&chart1.Series[0].Points[m].YValues[0].ToString() != "0") { chart1.Series[0].Points[m].Label = chart1.Series[0].Points[m].YValues[0].ToString(); } diff --git a/FrmAccessoriesgather.cs b/FrmAccessoriesgather.cs index 9e331e1..a475d9e 100644 --- a/FrmAccessoriesgather.cs +++ b/FrmAccessoriesgather.cs @@ -338,7 +338,7 @@ chart1.Series[0].Points.DataBindXY(dic.Keys, dic.Values); for (int m = 0; m < dic.Values.Count; m++) { - if (chart1.Series[0].Points[m].YValues[0].ToString() != "0") + if (chart1.Series[0].Points[m]!=null&&chart1.Series[0].Points[m].YValues[0].ToString() != "0") { chart1.Series[0].Points[m].Label = chart1.Series[0].Points[m].YValues[0].ToString(); } diff --git a/FrmAccessoryAnalysis.cs b/FrmAccessoryAnalysis.cs index 71d4579..44d4065 100644 --- a/FrmAccessoryAnalysis.cs +++ b/FrmAccessoryAnalysis.cs @@ -66,39 +66,6 @@ globeControl1.Refresh(); } /// - /// 键盘按键按下事件处理 - /// - /// - /// - private void txtRadius_KeyPress(object sender, KeyPressEventArgs e) - { - TextBox text = sender as TextBox; - if ((e.KeyChar < 48 || e.KeyChar > 57) && (e.KeyChar != 8) && (int)e.KeyChar != 46) - { - e.Handled = true; - } - if ((int)e.KeyChar == 46) //小数点 - { - if (text.Text.Length <= 0) - e.Handled = true; //小数点不能在第一位 - else //处理不规则的小数点 - { - float f; - float oldf; - bool b1 = false, b2 = false; - b1 = float.TryParse(text.Text, out oldf); - b2 = float.TryParse(text.Text + e.KeyChar.ToString(), out f); - if (b2 == false) - { - if (b1 == true) - e.Handled = true; - else - e.Handled = false; - } - } - } - } - /// /// 确定按钮事件处理 /// /// diff --git a/FrmAddValve.cs b/FrmAddValve.cs index 34d2fec..5f405b9 100644 --- a/FrmAddValve.cs +++ b/FrmAddValve.cs @@ -486,56 +486,6 @@ } } - - - - - - - - private void cmbLayer_SelectedIndexChanged(object sender, EventArgs e) - { - GSOLayer layer = globeControl1.Globe.Layers.GetLayerByCaption(selectLayerName); - GSOFeatures features = layer.GetAllFeatures(); - if (features.Length == 0) - return; - - combPath.Items.Clear(); - combZ.Items.Clear(); - combModelName.Items.Clear(); - - for (int i = 0; i < features[0].GetFieldCount(); i++) - { - GeoScene.Data.GSOFieldDefn fielddef = (GeoScene.Data.GSOFieldDefn)(features[0].GetFieldDefn(i)); - combPath.Items.Add(fielddef.Name); - combZ.Items.Add(fielddef.Name); - combModelName.Items.Add(fielddef.Name); - } - combModelName.SelectedItem = "编号"; - combPath.SelectedItem = "模型路径"; - if (combfile.SelectedIndex != -1) - { - - string layerCaption = combfile.SelectedItem.ToString().Trim(); - rukuLayer = globeControl1.Globe.Layers.GetLayerByCaption(layerCaption); - if (rukuLayer != null) - { - combPath.Items.Clear(); - combZ.Items.Clear(); - combModelName.Items.Clear(); - - } - for (int i = 0; i < features[0].GetFieldCount(); i++) - { - GeoScene.Data.GSOFieldDefn fielddef = (GeoScene.Data.GSOFieldDefn)(features[0].GetFieldDefn(i)); - combPath.Items.Add(fielddef.Name); - combZ.Items.Add(fielddef.Name); - combModelName.Items.Add(fielddef.Name); - } - combModelName.SelectedItem = "编号"; - combPath.SelectedItem = "模型路径"; - } - } /// /// 单击选择shp格式文件 /// diff --git a/FrmAddWellShp.cs b/FrmAddWellShp.cs index bb79ec0..a249725 100644 --- a/FrmAddWellShp.cs +++ b/FrmAddWellShp.cs @@ -478,32 +478,6 @@ } } } - - private void cmbLayer_SelectedIndexChanged(object sender, EventArgs e) - { - GSOLayer layer = globeControl1.Globe.Layers.GetLayerByCaption(selectLayerName); - GSOFeatures features = layer.GetAllFeatures(); - if (features.Length == 0) - return; - - combCode.Items.Clear(); - combDeep.Items.Clear(); - combModelName.Items.Clear(); - combAngle.Items.Clear(); - - for (int i = 0; i < features[0].GetFieldCount(); i++) - { - GeoScene.Data.GSOFieldDefn fielddef = (GeoScene.Data.GSOFieldDefn)(features[0].GetFieldDefn(i)); - combCode.Items.Add(fielddef.Name); - combDeep.Items.Add(fielddef.Name); - combModelName.Items.Add(fielddef.Name); - combAngle.Items.Add(fielddef.Name); - } - combCode.SelectedItem = "附属物编码"; - combDeep.SelectedItem = "井深"; - combModelName.SelectedItem = "编号"; - combAngle.SelectedItem = "符号角度"; - } /// /// 单击选择shp格式文件 /// diff --git a/FrmAddYuBiZiShp.cs b/FrmAddYuBiZiShp.cs index b312d51..332f037 100644 --- a/FrmAddYuBiZiShp.cs +++ b/FrmAddYuBiZiShp.cs @@ -383,80 +383,7 @@ } } - private void cmbLayer_SelectedIndexChanged(object sender, EventArgs e) - { - GSOLayer layer = globeControl1.Globe.Layers.GetLayerByCaption(selectLayerName); - GSOFeatures features = layer.GetAllFeatures(); - if (features.Length == 0) - return; - - combCode.Items.Clear(); - combDeep.Items.Clear(); - combModelName.Items.Clear(); - //comboLoad.Items.Clear(); - for (int i = 0; i < features[0].GetFieldCount(); i++) - { - GeoScene.Data.GSOFieldDefn fielddef = (GeoScene.Data.GSOFieldDefn)(features[0].GetFieldDefn(i)); - combCode.Items.Add(fielddef.Name); - combDeep.Items.Add(fielddef.Name); - combModelName.Items.Add(fielddef.Name); - //comboLoad.Items.Add(fielddef.Name); - } - combCode.SelectedItem = "附属物编码"; - combDeep.SelectedItem = "Z坐标"; - combModelName.SelectedItem = "编号"; - //comboLoad.SelectedItem = "模型路径"; - } - - private void buttonXLayerPath_Click(object sender, EventArgs e) - { - OpenFileDialog dlg = new OpenFileDialog(); - dlg.Filter = "*.shp|*.shp"; - dlg.Multiselect = false; - if (dlg.ShowDialog() == DialogResult.OK) - { - GSOLayer layer = globeControl1.Globe.Layers.Add(dlg.FileName); - string txtMessage = valiYBdata(layer); - if (txtMessage != "") - { - button3.Enabled = false; - //textBoxLayer.Text = ""; - combCode.Items.Clear(); - combDeep.Items.Clear(); - combModelName.Items.Clear(); - globeControl1.Globe.Layers.Remove(layer); - FrmValiDataShowErrorMessage showErrorMessage = new FrmValiDataShowErrorMessage(dlg.FileName, txtMessage); - showErrorMessage.ShowDialog(); - return; - } - else - { - button3.Enabled = true; - //textBoxLayer.Text = dlg.FileName; - selectLayerName = layer.Caption; - txtLayerName.Text = layer.Caption; - GSOFeatures features = layer.GetAllFeatures(); - if (features.Length == 0) - return; - - combCode.Items.Clear(); - combDeep.Items.Clear(); - combModelName.Items.Clear(); - for (int i = 0; i < features[0].GetFieldCount(); i++) - { - GeoScene.Data.GSOFieldDefn fielddef = (GeoScene.Data.GSOFieldDefn)(features[0].GetFieldDefn(i)); - combCode.Items.Add(fielddef.Name); - combDeep.Items.Add(fielddef.Name); - combModelName.Items.Add(fielddef.Name); - //comboLoad.Items.Add(fielddef.Name); - } - combCode.SelectedItem = "管点编码"; - combDeep.SelectedItem = "Z坐标"; - combModelName.SelectedItem = "编号"; - } - } - } - + private void FrmAddYuBiZiShp_FormClosing(object sender, FormClosingEventArgs e) { globeControl1.Globe.Refresh(); diff --git a/FrmAllPipelineStatis.cs b/FrmAllPipelineStatis.cs index 6421a26..a6eea29 100644 --- a/FrmAllPipelineStatis.cs +++ b/FrmAllPipelineStatis.cs @@ -84,7 +84,7 @@ chartAllAreaPipeline.Series["管线"].Points.DataBindXY(pipelineLengthAndType.Keys, pipelineLengthAndType.Values); for (int m = 0; m < pipelineLengthAndType.Values.Count; m++) { - if (chartAllAreaPipeline.Series["管线"].Points[m].YValues[0].ToString() != "0") + if (chartAllAreaPipeline.Series["管线"].Points[m]!=null&&chartAllAreaPipeline.Series["管线"].Points[m].YValues[0].ToString() != "0") { chartAllAreaPipeline.Series["管线"].Points[m].Label = chartAllAreaPipeline.Series[0].Points[m].YValues[0].ToString(); } @@ -94,7 +94,7 @@ } catch (Exception ex) { - //LogError.PublishError(ex); + LogHelper.WriteLog(typeof(FrmAllPipelineStatis), ex.Message); } } @@ -147,7 +147,7 @@ } DataTable dt = OledbHelper.QueryTable(sql); - if (dt != null && dt.Rows.Count > 0) + if (dt != null && dt.Rows.Count > 0 && chartAllAreaPipeline.Series["管线"].Points[indexHit]!=null) { dataGridViewX1.DataSource = dt; panel.Visible = true; diff --git a/FrmAllWorkWellStatis.cs b/FrmAllWorkWellStatis.cs index 6fec7af..6af8e4c 100644 --- a/FrmAllWorkWellStatis.cs +++ b/FrmAllWorkWellStatis.cs @@ -52,7 +52,7 @@ chartAllAreaPipeline.Series["井盖"].Points.DataBindXY(workWellLengthAndType.Keys, workWellLengthAndType.Values); for (int m = 0; m < workWellLengthAndType.Values.Count; m++) { - if (chartAllAreaPipeline.Series["井盖"].Points[m].YValues[0].ToString().Trim() != "0") + if (chartAllAreaPipeline.Series["井盖"].Points[m]!=null&&chartAllAreaPipeline.Series["井盖"].Points[m].YValues[0].ToString().Trim() != "0") { chartAllAreaPipeline.Series["井盖"].Points[m].Label = chartAllAreaPipeline.Series[0].Points[m].YValues[0].ToString(); } @@ -60,7 +60,7 @@ } catch (Exception ex) { - //LogError.PublishError(ex); + LogHelper.WriteLog(typeof(FrmAllWorkWellStatis), ex.Message); } } diff --git a/FrmBSQDuoBianXingStatis.cs b/FrmBSQDuoBianXingStatis.cs index e8b7d52..3e889b6 100644 --- a/FrmBSQDuoBianXingStatis.cs +++ b/FrmBSQDuoBianXingStatis.cs @@ -60,7 +60,7 @@ { for (int m = 0; m < bsq1.Values.Count; m++) { - if (chart1.Series["标识器"].Points[m].YValues[0].ToString() != "0") + if (chart1.Series["标识器"].Points[m]!=null&&chart1.Series["标识器"].Points[m].YValues[0].ToString() != "0") { count += Convert.ToInt16(chart1.Series[0].Points[m].YValues[0].ToString()); chart1.Series["标识器"].Points[m].Label = chart1.Series[0].Points[m].YValues[0].ToString(); diff --git a/FrmBSQDuoBianXingStreet.cs b/FrmBSQDuoBianXingStreet.cs index 2005ebb..1db5777 100644 --- a/FrmBSQDuoBianXingStreet.cs +++ b/FrmBSQDuoBianXingStreet.cs @@ -63,7 +63,7 @@ chartStatis.Series[0].Points.DataBindXY(bsq.Keys, bsq.Values); for (int m = 0; m < bsq.Values.Count; m++) { - if (chartStatis.Series[0].Points[m].YValues[0].ToString().Trim() != "0") + if (chartStatis.Series[0].Points[m]!=null&&chartStatis.Series[0].Points[m].YValues[0].ToString().Trim() != "0") { count += Convert.ToInt16(chartStatis.Series[0].Points[m].YValues[0].ToString()); chartStatis.Series[0].Points[m].Label = chartStatis.Series[0].Points[m].YValues[0].ToString(); diff --git a/FrmBSQStatis.cs b/FrmBSQStatis.cs index 390a55c..4aa0ee6 100644 --- a/FrmBSQStatis.cs +++ b/FrmBSQStatis.cs @@ -95,6 +95,8 @@ } } } + + dr.Close(); conn.Close(); for (int i = 0; i < typeLists.Count; i++) { @@ -123,7 +125,7 @@ chartStatis.Series[0].Points.DataBindXY(bsq.Keys, bsq.Values); for (int m = 0; m < bsq.Values.Count; m++) { - if (chartStatis.Series[0].Points[m].YValues[0].ToString().Trim() != "0") + if (chartStatis.Series[0].Points[m]!=null&&chartStatis.Series[0].Points[m].YValues[0].ToString().Trim() != "0") { //count += Convert.ToInt16(chartStatis.Series[0].Points[m].YValues[0].ToString()); chartStatis.Series[0].Points[m].Label = chartStatis.Series[0].Points[m].YValues[0].ToString(); diff --git a/FrmBSQStreet.cs b/FrmBSQStreet.cs index 9d88adb..7fbacad 100644 --- a/FrmBSQStreet.cs +++ b/FrmBSQStreet.cs @@ -44,7 +44,7 @@ chartStatis.Series[0].Points.DataBindXY(bsq.Keys, bsq.Values); for (int m = 0; m < bsq.Values.Count; m++) { - if (chartStatis.Series[0].Points[m].YValues[0].ToString().Trim() != "0") + if (chartStatis.Series[0].Points[m]!=null&&chartStatis.Series[0].Points[m].YValues[0].ToString().Trim() != "0") { count += Convert.ToInt16(chartStatis.Series[0].Points[m].YValues[0].ToString()); chartStatis.Series[0].Points[m].Label = chartStatis.Series[0].Points[m].YValues[0].ToString(); diff --git a/FrmBoosterValvers.cs b/FrmBoosterValvers.cs index 5061efc..df9b62b 100644 --- a/FrmBoosterValvers.cs +++ b/FrmBoosterValvers.cs @@ -236,199 +236,6 @@ count = 0; } } - /// - /// 添加火苗 - /// - /// - /// - /// - /// - private GSOFeature AddFire(double x,double y,double z) - { - // 烟火示例 - - string strResPath = Application.StartupPath + "/Resource"; - - // 烟火粒子示例,由三个发射器构成 - GSOGeoParticle geoParticle = new GSOGeoParticle(); - geoParticle.SetPosition(x, y, z); // 添加到这个经纬度位置 - geoParticle.AltitudeMode = EnumAltitudeMode.RelativeToGround; - - GSORingParticleEmitter emitter = new GSORingParticleEmitter(); - emitter.TexturePath = strResPath + "/ParticleImage/flare.png"; - - emitter.SetSizeFix(1, 1); - emitter.VelFix = 1; - emitter.VelRnd = 5; - - emitter.AngleXYFix = 0; - emitter.AngleXYRnd = 180; - - emitter.AngleXZFix = 90; - emitter.AngleXZRnd = 0; - - emitter.LifeFix = 0.5f; - emitter.LifeRnd = 0.0f; - - emitter.RotFix = 0; - emitter.RotRnd = 0; - - emitter.RotVelFix = 0; - emitter.RotVelRnd = 0; - - emitter.EmitPerSec = 100; - - // 采用线性插值生成粒子的初始颜色 - emitter.ColorRndStart = Color.White; - emitter.ColorRndEnd = Color.Red; - - - GSOColorParticleEffector effector2 = new GSOColorParticleEffector(); - effector2.SetColorChanged(0, -1, -1, 0); - effector2.StartTime = 0.0f; - effector2.EndTime = -1.0f; - emitter.AddEffector(effector2); - - // 将三个发射器添加到粒子对象中 - geoParticle.AddEmitter(emitter); - - geoParticle.Play(); - - GSOFeature feature = new GSOFeature(); - - feature.Geometry = geoParticle; - - globeControl1.Globe.MemoryLayer.AddFeature(feature); - - - return feature; - } - - /// - /// 添加喷泉 - /// - /// - private GSOFeature AddFountain() - { - string strResPath = Application.StartupPath + "/Resource"; - - GSOGeoParticle geoParticle = new GSOGeoParticle(); - geoParticle.SetPosition(116.314, 39.84, 0); // 添加到这个经纬度位置 - - GSOPointParticleEmitter emitter = new GSOPointParticleEmitter(); - emitter.TexturePath = strResPath + "/ParticleImage/test.png"; - - emitter.SetSizeFix(0.5f, 2); - emitter.VelFix = 10; - emitter.VelRnd = 2; - - emitter.GravityAcc = 9.8f; - emitter.AngleXYFix = 0; - emitter.AngleXYRnd = 180; - - emitter.AngleXZFix = 88; - emitter.AngleXZRnd = 2; - - //emitter.InnerRadius = 0; - // emitter.OuterRadius = 0.03f; - - emitter.LifeFix = 5.0f; - emitter.LifeRnd = 1.0f; - - emitter.RotFix = 0; - emitter.RotRnd = 0; - - emitter.RotVelFix = 0; - emitter.RotVelRnd = 0; - - emitter.EmitPerSec = 1000; - emitter.ColorRndStart = Color.FromArgb(33, 255, 255, 255); - emitter.ColorRndEnd = Color.FromArgb(11, 255, 255, 255); - emitter.IsLumAdded = false; - - // 将三个发射器添加到粒子对象中 - geoParticle.AddEmitter(emitter); - - geoParticle.Play(); - GSOFeature feature = new GSOFeature(); - - feature.Geometry = geoParticle; - - //globeControl1.Globe.MemoryLayer.AddFeature(feature); - globeControl1.Globe.FlyToFeature(feature); - - return feature; - } - - /// - /// 添加水柱 - /// - /// - private GSOFeature AddWaterLine() - { - string strResPath = Application.StartupPath + "/Resource"; - - GSOGeoParticle geoParticle = new GSOGeoParticle(); - geoParticle.SetPosition(116.308, 39.84, 0); // 添加到这个经纬度位置 - - GSOPointParticleEmitter emitter = new GSOPointParticleEmitter(); - - emitter.TexturePath = strResPath + "/ParticleImage/drop3.png"; - - geoParticle.TimerInterval = 1; - - emitter.SetSizeFix(2.0f, 2.0f); - - emitter.VelFix = 50; - emitter.VelRnd = 2; - - // emitter.IsLumAdded = false; - - emitter.GravityAcc = 9.8f; - emitter.AngleXYFix = 0; - emitter.AngleXYRnd = 2; - - emitter.AngleXZFix = 60; - emitter.AngleXZRnd = 2; - - //emitter.InnerRadius = 0; - // emitter.OuterRadius = 0.1f; - - emitter.LifeFix = 5.0f; - emitter.LifeRnd = 1.0f; - - emitter.RotFix = 0; - emitter.RotRnd = 0; - - emitter.RotVelFix = 0; - emitter.RotVelRnd = 0; - - emitter.EmitPerSec = 1500; - - emitter.ColorRndStart = Color.FromArgb(100, 222, 222, 222); - emitter.ColorRndEnd = Color.FromArgb(50, 222, 222, 222); - - /* - - GSOScaleParticleEffector effector1 = new GSOScaleParticleEffector(); - effector1.SetScale(0.2f, 0.2f); - effector1.StartTime = 0; - effector1.EndTime = -1; // 负数表示整个粒子生命结束 - emitter.AddEffector(effector1); - */ - - // 将三个发射器添加到粒子对象中 - geoParticle.AddEmitter(emitter); - - geoParticle.Play(); - GSOFeature feature = new GSOFeature(); - - feature.Geometry = geoParticle; - - //globeControl1.Globe.MemoryLayer.AddFeature(feature); - globeControl1.Globe.FlyToFeature(feature); - - return feature; - } + } } diff --git a/FrmBufferAnalysis.cs b/FrmBufferAnalysis.cs index f711133..db8ca59 100644 --- a/FrmBufferAnalysis.cs +++ b/FrmBufferAnalysis.cs @@ -123,39 +123,6 @@ } } /// - /// 半径文本框的键盘按键按下事件处理 - /// - /// - /// - private void txtRadius_KeyPress(object sender, KeyPressEventArgs e) - { - TextBox text = sender as TextBox; - if ((e.KeyChar < 48 || e.KeyChar > 57) && (e.KeyChar != 8) && (int)e.KeyChar != 46) - { - e.Handled = true; - } - if ((int)e.KeyChar == 46) //小数点 - { - if (text.Text.Length <= 0) - e.Handled = true; //小数点不能在第一位 - else //处理不规则的小数点 - { - float f; - float oldf; - bool b1 = false, b2 = false; - b1 = float.TryParse(text.Text, out oldf); - b2 = float.TryParse(text.Text + e.KeyChar.ToString(), out f); - if (b2 == false) - { - if (b1 == true) - e.Handled = true; - else - e.Handled = false; - } - } - } - } - /// /// 窗体关闭事件处理 /// /// diff --git a/FrmBufferAnalysisBSQ.cs b/FrmBufferAnalysisBSQ.cs index 24a96ca..f54208f 100644 --- a/FrmBufferAnalysisBSQ.cs +++ b/FrmBufferAnalysisBSQ.cs @@ -137,35 +137,7 @@ } } - private void txtRadius_KeyPress(object sender, KeyPressEventArgs e) - { - TextBox text = sender as TextBox; - if ((e.KeyChar < 48 || e.KeyChar > 57) && (e.KeyChar != 8) && (int)e.KeyChar != 46) - { - e.Handled = true; - } - if ((int)e.KeyChar == 46) //小数点 - { - if (text.Text.Length <= 0) - e.Handled = true; //小数点不能在第一位 - else //处理不规则的小数点 - { - float f; - float oldf; - bool b1 = false, b2 = false; - b1 = float.TryParse(text.Text, out oldf); - b2 = float.TryParse(text.Text + e.KeyChar.ToString(), out f); - if (b2 == false) - { - if (b1 == true) - e.Handled = true; - else - e.Handled = false; - } - } - } - } - + private void FrmBufferAnalysis_FormClosing(object sender, FormClosingEventArgs e) { //Form1.y = 0; @@ -316,27 +288,6 @@ } } - private void FlyToMenu_Click(object sender, EventArgs e) - { - if (m_feature != null) - { - if (m_feature.Geometry != null && m_feature.Geometry.Type == EnumGeometryType.GeoPolyline3D) - { - GSOGeoPolyline3D line = m_feature.Geometry as GSOGeoPolyline3D; - double length = line.GetSpaceLength(true, 6378137); - GSOGeoPolyline3D lineLine = line.GetSegment(0, length / 2); - GSOPoint3d point3d = lineLine[lineLine.PartCount - 1][lineLine[lineLine.PartCount - 1].Count - 1]; - - globeControl1.Globe.FlyToPosition(point3d, EnumAltitudeMode.Absolute, 0, 45, 5); - } - else - { - globeControl1.Globe.FlyToFeature(m_feature, 0, 45, 3); - } - LightMenu_Click(sender, e); - } - } - private void LightMenu_Click(object sender, EventArgs e) { flashflag = "single"; diff --git a/FrmDataBaseOpt.cs b/FrmDataBaseOpt.cs index b0c4b5d..8d7b69d 100644 --- a/FrmDataBaseOpt.cs +++ b/FrmDataBaseOpt.cs @@ -362,6 +362,7 @@ dbCombor.Items.Add(dblist[i].title); } } + /* /// /// 从配置文件读取数据库参数配置 /// @@ -428,6 +429,8 @@ } } + * */ + /* /// /// 向配置文件写入连接数据库的参数配置 /// @@ -485,6 +488,7 @@ MessageBox.Show(exp.ToString()); } } + * */ /// /// /// diff --git a/FrmDatabaseParaSetting.cs b/FrmDatabaseParaSetting.cs index a6fea46..63b596b 100644 --- a/FrmDatabaseParaSetting.cs +++ b/FrmDatabaseParaSetting.cs @@ -152,6 +152,7 @@ this.DialogResult = DialogResult.OK; this.Close(); } + /* /// /// 从配置文件读取数据库连接参数配置 /// @@ -218,6 +219,8 @@ } } + * */ + /* /// /// 向配置文件写入数据库参数配置 /// @@ -276,7 +279,7 @@ MessageBox.Show(ex.ToString()); } } - + */ /// /// 取消按钮事件处理 /// diff --git a/FrmDatabaseParaSetting2.cs b/FrmDatabaseParaSetting2.cs index 932d05e..96a87d5 100644 --- a/FrmDatabaseParaSetting2.cs +++ b/FrmDatabaseParaSetting2.cs @@ -148,6 +148,7 @@ this.DialogResult = DialogResult.OK; this.Close(); } + /* /// /// 从配置文件读取数据库连接参数配置 /// @@ -214,6 +215,8 @@ } } + * */ + /* /// /// 向配置文件写入数据库参数配置 /// @@ -272,7 +275,7 @@ MessageBox.Show(exp.ToString()); } } - + */ /// /// 取消按钮事件处理 /// diff --git a/FrmDiameterQuery.cs b/FrmDiameterQuery.cs index 68c948b..9a5215b 100644 --- a/FrmDiameterQuery.cs +++ b/FrmDiameterQuery.cs @@ -77,18 +77,7 @@ isBetween = true; } } - /// - /// 键盘按键按下事件处理 - /// - /// - /// - private void textBoxX1_KeyPress(object sender, KeyPressEventArgs e) - { - if ((e.KeyChar < 48 || e.KeyChar > 57) && e.KeyChar != 8) - { - e.Handled = true;//屏蔽 - } - } + bool isBetween = false; /// diff --git a/FrmDocumentEdit.cs b/FrmDocumentEdit.cs index aab2d31..e78a7ff 100644 --- a/FrmDocumentEdit.cs +++ b/FrmDocumentEdit.cs @@ -256,121 +256,6 @@ } - // - /// 将本地文件上传到指定的服务器(HttpWebRequest方法) - /// - /// 文件上传到的服务器 - /// 要上传的本地文件(全路径) - /// 文件上传后的名称 - /// 上传进度条 - /// 成功返回1,失败返回0 - private int Upload_Request(string address, string fileNamePath, string saveName, ProgressBar progressBar) - { - int returnValue = 0; - // 要上传的文件 - FileStream fs = new FileStream(fileNamePath, FileMode.Open, FileAccess.Read); - BinaryReader r = new BinaryReader(fs); - //时间戳 - string strBoundary = "----------" + DateTime.Now.Ticks.ToString("x"); - byte[] boundaryBytes = Encoding.ASCII.GetBytes("/r/n--" + strBoundary + "/r/n"); - //请求头部信息 - StringBuilder sb = new StringBuilder(); - sb.Append("--"); - sb.Append(strBoundary); - sb.Append("\r\n"); - sb.Append("Content-Disposition: form-data; name=\""); - sb.Append("file"); - sb.Append("\"; filename=\""); - sb.Append(saveName); - sb.Append("\""); - sb.Append("\r\n"); - sb.Append("Content-Type: "); - sb.Append("application/octet-stream"); - sb.Append("\r\n"); - sb.Append("\r\n"); - string strPostHeader = sb.ToString(); - byte[] postHeaderBytes = Encoding.UTF8.GetBytes(strPostHeader); - // 根据uri创建HttpWebRequest对象 - HttpWebRequest httpReq = (HttpWebRequest)WebRequest.Create(new Uri(address)); - httpReq.Method = "POST"; - //对发送的数据不使用缓存 - httpReq.AllowWriteStreamBuffering = false; - //设置获得响应的超时时间(300秒) - httpReq.Timeout = 300000; - httpReq.ContentType = "multipart/form-data; boundary=" + strBoundary; - long length = fs.Length + postHeaderBytes.Length + boundaryBytes.Length; - long fileLength = fs.Length; - httpReq.ContentLength = length; - try - { - progressBar.Maximum = int.MaxValue; - progressBar.Minimum = 0; - progressBar.Value = 0; - //每次上传4k - int bufferLength = 4096; - byte[] buffer = new byte[bufferLength]; - //已上传的字节数 - long offset = 0; - //开始上传时间 - DateTime startTime = DateTime.Now; - int size = r.Read(buffer, 0, bufferLength); - Stream postStream = httpReq.GetRequestStream(); - //发送请求头部消息 - postStream.Write(postHeaderBytes, 0, postHeaderBytes.Length); - while (size > 0) - { - postStream.Write(buffer, 0, size); - offset += size; - progressBar.Value = (int)(offset * (int.MaxValue / length)); - TimeSpan span = DateTime.Now - startTime; - double second = span.TotalSeconds; - //lblTime.Text = "已用时:" + second.ToString("F2") + "秒"; - //if (second > 0.001) - //{ - // lblSpeed.Text = " 平均速度:" + (offset / 1024 / second).ToString("0.00") + "KB/秒"; - //} - //else - //{ - // lblSpeed.Text = " 正在连接…"; - //} - //lblState.Text = "已上传:" + (offset * 100.0 / length).ToString("F2") + "%"; - //lblSize.Text = (offset / 1048576.0).ToString("F2") + "M/" + (fileLength / 1048576.0).ToString("F2") + "M"; - Application.DoEvents(); - size = r.Read(buffer, 0, bufferLength); - } - //添加尾部的时间戳 - postStream.Write(boundaryBytes, 0, boundaryBytes.Length); - postStream.Close(); - //获取服务器端的响应 - WebResponse webRespon = httpReq.GetResponse(); - Stream s = webRespon.GetResponseStream(); - StreamReader sr = new StreamReader(s); - //读取服务器端返回的消息 - String sReturnString = sr.ReadLine(); - s.Close(); - sr.Close(); - if (sReturnString == "Success") - { - returnValue = 1; - } - else if (sReturnString == "Error") - { - returnValue = 0; - } - } - catch(Exception ex) - { - returnValue = 0; - string str = ex.ToString(); - } - finally - { - fs.Close(); - r.Close(); - } - return returnValue; - } - private void btn_file_Click(object sender, EventArgs e) { OpenFileDialog dlg = new OpenFileDialog(); diff --git a/FrmExportCADS.cs b/FrmExportCADS.cs index 98772ea..59629dd 100644 --- a/FrmExportCADS.cs +++ b/FrmExportCADS.cs @@ -108,65 +108,6 @@ MessageBox.Show("请选中要导出的图层!", "提示", MessageBoxButtons.OK, MessageBoxIcon.Warning); } } - private Boolean MerageToFile(GSOFeatures features, String strDestFile, String strProj4)//图层追加 - { - if (features == null) - { - return false; - } - Boolean bSuccess = false; - - string strDir = GSOUtility.GetFileDir(strDestFile); - string strLPRJFile = GSOUtility.ChangeExt(strDestFile, ".lprj"); - string strExt = GSOUtility.GetFileExt(strDestFile); - - // 如果投影文件存在,投影以投影文件为准 - if (File.Exists(strLPRJFile)) - { - // 如果是dxf,则这样处理 - if (strExt.ToLower() == ".dxf") - { - string strTempSrcFile = strDir + "srcFeatures_dxftmp" + strExt; - globeControl1.Globe.DataManager.SaveFeatureData(features, strTempSrcFile, strLPRJFile, 4); - bSuccess = GSOUtility.MergeTwoDXFFileFeatures(strDestFile, strTempSrcFile); - File.Delete(strTempSrcFile); - } - else - { - GSOFeatures srcFeatures = globeControl1.Globe.DataManager.ReadFeatureData(strDestFile); - int nCount = features.Length; - int i = 0; - for (i = 0; i < nCount; i++) - { - srcFeatures.Add(features[i]); - } - bSuccess = globeControl1.Globe.DataManager.SaveFeatureData(srcFeatures, strDestFile, strLPRJFile, 4); - } - } - else - { - // 如果是dxf,则这样处理 - if (strExt.ToLower() == ".dxf") - { - string strTempSrcFile = strDir + "srcFeatures_dxftmp" + strExt; - globeControl1.Globe.DataManager.SaveFeatureData(features, strTempSrcFile, strProj4, 0); - bSuccess = GSOUtility.MergeTwoDXFFileFeatures(strDestFile, strTempSrcFile); - File.Delete(strTempSrcFile); - } - else - { - GSOFeatures srcFeatures = globeControl1.Globe.DataManager.ReadFeatureData(strDestFile); - int nCount = features.Length; - int i = 0; - for (i = 0; i < nCount; i++) - { - srcFeatures.Add(features[i]); - } - bSuccess = globeControl1.Globe.DataManager.SaveFeatureData(srcFeatures, strDestFile, strProj4, 0); - } - } - return bSuccess; - } /// /// 关闭按钮事件处理 /// diff --git a/FrmHDMAnalysis3.cs b/FrmHDMAnalysis3.cs index 4f73af6..2ada735 100644 --- a/FrmHDMAnalysis3.cs +++ b/FrmHDMAnalysis3.cs @@ -436,29 +436,6 @@ } layerTemp.RemoveAllFeature(); } - private void Export(GSOPoint3d _pnt, double r) - { - GSOPoint3ds pnts = new GSOPoint3ds(); - GSOPoint3d pnt = new GSOPoint3d(); - pnt.X = _pnt.X; - pnt.Y = _pnt.Y; - pnt.Z = _pnt.Z; - pnts.Add(pnt); - pnt.X = _pnt.X; - pnt.Y = _pnt.Y - 0.0000000005; - pnt.Z = _pnt.Z; - pnts.Add(pnt); - GSOGeoPolyline3D line = new GSOGeoPolyline3D(); - line.AddPart(pnts); - GSOGeoPolygon3D polygon = line.CreateBuffer(r * 2, true, 5, true, false); - GSOPoint3ds points = polygon[0]; - GSOGeoPolyline3D newLine = new GSOGeoPolyline3D(); - newLine.AddPart(points); - newLine.AltitudeMode = EnumAltitudeMode.RelativeToGround; - GSOFeature newFeature = new GSOFeature(); - newFeature.Geometry = newLine; - globeControl1.Globe.MemoryLayer.AddFeature(newFeature); - } private void ExportCAD(double a, double b, double r) { diff --git a/FrmHotFuncStat.cs b/FrmHotFuncStat.cs index c980f34..2eb1476 100644 --- a/FrmHotFuncStat.cs +++ b/FrmHotFuncStat.cs @@ -421,13 +421,6 @@ } } - private void HFS_Pderive_Click(object sender, EventArgs e) - { - if (TV_Files.SelectedNode != null) - { - HFSClass.GuideEdit_form("G", TV_Files, int.Parse(((ToolStripMenuItem)sender).Tag.ToString())); - } - } private void 导入ToolStripMenuItem_Click(object sender, EventArgs e) { @@ -530,22 +523,8 @@ } } - private void 导出ToolStripMenuItem1_Click(object sender, EventArgs e) - { - 导出ToolStripMenuItem2_Click(sender, e); - } + - private void TV_HFSSrchRslt_AfterCollapse(object sender, TreeViewEventArgs e) - { - e.Node.ImageIndex = 0; - } - - private void TV_HFSSrchRslt_AfterExpand(object sender, TreeViewEventArgs e) - { - HFSClass.ADD_TreeNode(TV_Files, e.Node); - e.Node.ImageIndex = 1; - } - private void 导出ToolStripMenuItem1_Click_1(object sender, EventArgs e) { if ((TV_HFSSrchRslt.SelectedNode != null) && (TV_HFSSrchRslt.SelectedNode.Parent != null)) diff --git a/FrmLayerControl.cs b/FrmLayerControl.cs index e7917c3..28fa14d 100644 --- a/FrmLayerControl.cs +++ b/FrmLayerControl.cs @@ -312,26 +312,7 @@ layerManagerNode.Expand(); terrainManagerNode.Expand(); } - /// - /// 刷新节点树 - /// - private void RefreshDataTree() - { - layerTree2.Nodes[0].Nodes.Clear(); - Int32 nCount = globeControl2.Globe.Layers.Count; - Int32 i = 0; - for (i = 0; i < nCount; i++) - { - GSODataset dataSpace = globeControl2.Globe.Layers[i].Dataset; - TreeNode node = new TreeNode(); - node.Text = dataSpace.Name; - node.ImageIndex = 0; - node.SelectedImageIndex = 0; - node.Checked = true; - node.Tag = dataSpace; - layerTree2.Nodes[0].Nodes.Add(node); - } - } + /// /// 目标图层按钮事件处理 /// @@ -494,22 +475,8 @@ } } } - /// - /// 改变指定节点的选中状态 - /// - /// - /// - private void CheckTreeNode(TreeNode node, Boolean bChecked) - { - CheckChildTreeNode(node, bChecked); - // 对于kml图层,如果当前处理的节点是true,那么要把所有的祖宗节点置为true - // 只有所有节点都未false,那么这个节点才为false - // CheckFatherTreeNode(node, bChecked); - globeControl1.Globe.Refresh(); - globeControl2.Globe.Refresh(); - - } + private void CheckChildTreeNode(TreeNode node, Boolean bChecked) { if (node == null) @@ -696,59 +663,7 @@ //} //CheckControl(e); } - /// - /// 树节点选中方法 - /// - /// - private void CheckControl(TreeViewEventArgs e) - { - if (e.Action != TreeViewAction.Unknown) - { - if (e.Node != null && !Convert.IsDBNull(e.Node)) - { - CheckParentNode(e.Node); - if (e.Node.Nodes.Count > 0) - { - CheckAllChildNodes(e.Node, e.Node.Checked); - } - } - } - } - /// - /// 改变所有子节点的状态 - /// - /// - /// - private void CheckAllChildNodes(TreeNode pn, bool IsChecked) - { - foreach (TreeNode tn in pn.Nodes) - { - tn.Checked = IsChecked; - if (tn.Tag.ToString().Contains("|")) - { - string nodeTag = tn.Tag.ToString().Split('|')[1]; - GSOLayer layer = globeControl1.Globe.Layers.GetLayerByCaption(nodeTag); - if (layer != null) - { - layer.Visible = IsChecked; - globeControl1.Globe.Refresh(); - } - } - if (tn.Tag is GSOFeature) - { - if (tn.Nodes.Count == 0) - { - GSOFeature feat = tn.Tag as GSOFeature; - feat.Visible = IsChecked; - globeControl1.Globe.Refresh(); - } - } - if (tn.Nodes.Count > 0) - { - CheckAllChildNodes(tn, IsChecked); - } - } - } + /// /// 改变父节点的选中状态,此处为所有子节点不选中时才取消父节点选中,可以根据需要修改 /// diff --git a/FrmLogin.cs b/FrmLogin.cs index 320fdd5..2afe46e 100644 --- a/FrmLogin.cs +++ b/FrmLogin.cs @@ -59,70 +59,6 @@ textBoxPassWord.Clear(); } } - - /// - /// 验证端口号 - /// - /// - private bool ValiPort() - { - Ping p = new Ping();//创建Ping对象p - PingReply pr = p.Send(Utility.localicenseserverip);//向指定IP或者主机名的计算机发送ICMP协议的ping数据包 - if (pr.Status == IPStatus.Success)//如果ping成功 - { - try - { - TcpClient tcpc = new TcpClient(Utility.localicenseserverip, Utility.localicenseserverport);//对IP地址为"192.168.0.105"的计算机的1500端口提出连接申请 - tcpc.Close(); - return true; - } - catch (Exception ex) - { - MessageBox.Show("端口连接错误!" + ex.Message); - return false; - } - } - else - { - int times = 0;//重新连接次数; - int count = 2;//设置尝试次数 - while (times < count) - { - //Thread.Sleep(1000);//等待时间(方便测试的话,你可以改为1000) - pr = p.Send(Utility.localicenseserverip); - - if (pr.Status == IPStatus.Success) - { - try - { - TcpClient tcpc = new TcpClient(Utility.localicenseserverip, Utility.localicenseserverport);//对IP地址为"192.168.0.105"的计算机的1500端口提出连接申请 - tcpc.Close(); - return true; - } - catch (Exception ex) - { - MessageBox.Show("端口连接错误!" + ex.Message); - return false; - } - } - else - { - times++; - if (times < count) - { - continue; - } - else - { - MessageBox.Show("重新尝试连接失败"); - return false; - } - } - - } - return false; - } - } /// /// 验证用户名、密码 /// diff --git a/FrmMetadata.cs b/FrmMetadata.cs index 886f65a..0365372 100644 --- a/FrmMetadata.cs +++ b/FrmMetadata.cs @@ -27,11 +27,7 @@ InitializeComponent(); loadTreeView(layerTree); } - private void FrmMetadata_Load(object sender, EventArgs e) - { - //this.ntLblC.Text = "nn"; - // loadTreeView(layerTree); - } + private void loadTreeView(TreeView tv)//构建图层树 { try diff --git a/FrmMetadataStat.cs b/FrmMetadataStat.cs index 790658a..e7696c6 100644 --- a/FrmMetadataStat.cs +++ b/FrmMetadataStat.cs @@ -197,9 +197,5 @@ } } - private void buttonX1_Click(object sender, EventArgs e) - { - drawChart(); - } } } diff --git a/FrmPatrolerManager.cs b/FrmPatrolerManager.cs index 37f8ffd..9e66aeb 100644 --- a/FrmPatrolerManager.cs +++ b/FrmPatrolerManager.cs @@ -109,82 +109,8 @@ this.winGridViewPager1.AllToExport = table; } - /// - /// 编辑 - /// - /// - /// - private void winGridViewPager1_OnEditSelected(object sender, EventArgs e) - { - - DataGridView grid = sender as DataGridView; - if (grid != null && grid.SelectedRows.Count>0) - { - DataGridViewRow row = grid.SelectedRows[0]; - try - { - long dbid = long.Parse(row.Cells["编号"].Value.ToString()); - String name = row.Cells["姓名"].Value.ToString(); - String sex = row.Cells["性别"].Value.ToString(); - String age = row.Cells["年龄"].Value.ToString(); - string phone = row.Cells["电话"].Value.ToString(); - age = String.IsNullOrEmpty(age.ToString().Trim()) ? "1" : age.ToString().Trim(); - FrmPatrolerEdit frm = new FrmPatrolerEdit(dbid.ToString(), name, age, sex, phone); - frm.reloadGrid += new ReloadPatrolerGrid(LoadData); - frm.ShowDialog(); - winGridViewPager1.Refresh(); - } - catch (Exception ex) - { - MessageBox.Show("编辑失败:" + ex.ToString(), "错误", MessageBoxButtons.OK, MessageBoxIcon.Error); - } - } - else - { - MessageBox.Show("没有选择记录", "提示"); - } - - } - - /// - /// 删除 - /// - /// - /// - private void winGridViewPager1_OnDeleteSelected(object sender, EventArgs e) - { - DataGridView grid = sender as DataGridView; - if (grid != null && grid.SelectedRows.Count > 0) - { - DataGridViewRow row = grid.SelectedRows[0]; - long dbid = long.Parse(row.Cells["编号"].Value.ToString()); - try - { - string state = row.Cells["状态"].Value.ToString(); - if ("在线".Equals(state)) - { - if (MessageBox.Show("确定注销?", "确认", MessageBoxButtons.YesNo, MessageBoxIcon.Question) == DialogResult.Yes) - { - String sql = "update patroler t set t.accountstate='LEAVER' where t.dbid=" + dbid; - OracleUtils.ExecuteNonQuery(OracleUtils.ConnectionString, CommandType.Text, sql); - } - } - else { - MessageBox.Show("人员不在线,无法注销", "信息"); - } - } - catch (Exception ex) - { - MessageBox.Show("人员注销失败:" + ex.ToString(), "错误", MessageBoxButtons.OK, MessageBoxIcon.Error); - } - } - else - { - MessageBox.Show("没有选择记录", "提示"); - } - } - - + + private void LoadData() { int pageIndex = winGridViewPager1.PagerInfo.CurrenetPageIndex; diff --git a/FrmRoadHDM.cs b/FrmRoadHDM.cs index e765313..e871dd5 100644 --- a/FrmRoadHDM.cs +++ b/FrmRoadHDM.cs @@ -333,31 +333,6 @@ this.Cursor = Cursors.Default; } } - - private void Export(GSOPoint3d _pnt, double r) - { - GSOPoint3ds pnts = new GSOPoint3ds(); - GSOPoint3d pnt = new GSOPoint3d(); - pnt.X = _pnt.X; - pnt.Y = _pnt.Y; - pnt.Z = _pnt.Z; - pnts.Add(pnt); - pnt.X = _pnt.X; - pnt.Y = _pnt.Y - 0.0000000005; - pnt.Z = _pnt.Z; - pnts.Add(pnt); - GSOGeoPolyline3D line = new GSOGeoPolyline3D(); - line.AddPart(pnts); - GSOGeoPolygon3D polygon = line.CreateBuffer(r * 2, true, 5, true, false); - GSOPoint3ds points = polygon[0]; - GSOGeoPolyline3D newLine = new GSOGeoPolyline3D(); - newLine.AddPart(points); - newLine.AltitudeMode = EnumAltitudeMode.RelativeToGround; - GSOFeature newFeature = new GSOFeature(); - newFeature.Geometry = newLine; - globeControl1.Globe.MemoryLayer.AddFeature(newFeature); - } - private void ExportCAD(double a, double b, double r) { GSOPoint3ds pnts = new GSOPoint3ds(); diff --git a/FrmUserAdd.cs b/FrmUserAdd.cs index c612ab4..f826427 100644 --- a/FrmUserAdd.cs +++ b/FrmUserAdd.cs @@ -231,24 +231,6 @@ //cbxRegion.SelectedIndexChanged += new EventHandler(cbxRegion_SelectedIndexChanged); } } - /// - /// 下拉框选中项改变事件处理 - /// - /// - /// - private void cbxRegion_SelectedIndexChanged(object sender, EventArgs e) - { - string sql = ""; - //string sql = "select casic_role.\"name\" from casic_role join casic_regionrole on casic_role.\"id\"=casic_regionrole.\"rid\" where casic_regionrole.\"reid\"=" + region[cbxRegion.SelectedItem.ToString().Trim()]; - DataTable dt = OledbHelper.QueryTable(sql); - if (dt != null && dt.Rows.Count > 0) - { - comboBoxExRegionRole.Items.Clear(); - for (int i = 0; i < dt.Rows.Count; i++) - { - comboBoxExRegionRole.Items.Add(dt.Rows[i][0].ToString().Trim());//部门角色 - } - } - } + } } diff --git a/FrmUserManager.cs b/FrmUserManager.cs index 571f0f0..ae254bc 100644 --- a/FrmUserManager.cs +++ b/FrmUserManager.cs @@ -81,11 +81,6 @@ } } } - //创建新用户 - private void buttonX2_Click(object sender, EventArgs e) - { - FrmUserAdd frm = new FrmUserAdd(-1); - frm.ShowDialog(); - } + } } diff --git a/FrmValveStatistics.cs b/FrmValveStatistics.cs index 545d56c..dd76777 100644 --- a/FrmValveStatistics.cs +++ b/FrmValveStatistics.cs @@ -54,7 +54,7 @@ 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") + if (chaFamenStatis.Series["阀门"].Points[m]!=null&&chaFamenStatis.Series["阀门"].Points[m].YValues[0].ToString() != "0") { chaFamenStatis.Series["阀门"].Points[m].Label = chaFamenStatis.Series[0].Points[m].YValues[0].ToString(); } diff --git a/Frm_password_reset.cs b/Frm_password_reset.cs index 7b51039..b9e5dc3 100644 --- a/Frm_password_reset.cs +++ b/Frm_password_reset.cs @@ -41,6 +41,7 @@ } catch (Exception ex) { + LogHelper.WriteLog(typeof(Frm_password_reset), ex.Message); } } private void initCombox() diff --git a/FrmpipeDeepstatis.cs b/FrmpipeDeepstatis.cs index e156db4..1a84d6c 100644 --- a/FrmpipeDeepstatis.cs +++ b/FrmpipeDeepstatis.cs @@ -307,7 +307,7 @@ chart1.Series[j].Points.DataBindXY(dic1.Keys, dic1.Values); for (int m = 0; m < dic1.Values.Count; m++) { - if (chart1.Series[j].Points[m].YValues[0].ToString() != "0") + if (chart1.Series[j].Points[m]!=null&&chart1.Series[j].Points[m].YValues[0].ToString() != "0") { chart1.Series[j].Points[m].Label = chart1.Series[j].Points[m].YValues[0].ToString(); diff --git a/FrmpipeDiametergather.cs b/FrmpipeDiametergather.cs index 30674de..057b09d 100644 --- a/FrmpipeDiametergather.cs +++ b/FrmpipeDiametergather.cs @@ -263,6 +263,7 @@ if (layer != null && layer is GSOFeatureLayer) { GSOFeatureLayer flayer = layer as GSOFeatureLayer; + if (layer == null) return; GSOFeatures features = flayer.GetAllFeatures(); if (features.Length > 0) { diff --git a/FrmpipeMaterialGather.cs b/FrmpipeMaterialGather.cs index c133ec3..398b884 100644 --- a/FrmpipeMaterialGather.cs +++ b/FrmpipeMaterialGather.cs @@ -280,6 +280,7 @@ if (layer != null && layer is GSOFeatureLayer) { GSOFeatureLayer flayer = layer as GSOFeatureLayer; + if (flayer == null) return; GSOFeatures features = flayer.GetAllFeatures(); if (features.Length > 0) { @@ -332,7 +333,7 @@ chart1.Series[j].Points.DataBindXY(dic1.Keys, dic1.Values); for (int m = 0; m < dic1.Values.Count; m++) { - if (chart1.Series[j].Points[m].YValues[0].ToString() != "0") + if (chart1.Series[j].Points[m]!=null&&chart1.Series[j].Points[m].YValues[0].ToString() != "0") { chart1.Series[j].Points[m].Label = chart1.Series[j].Points[m].YValues[0].ToString(); } diff --git a/Frmpipediameterstatis.cs b/Frmpipediameterstatis.cs index c0ed80a..50f8170 100644 --- a/Frmpipediameterstatis.cs +++ b/Frmpipediameterstatis.cs @@ -286,6 +286,7 @@ chart1.Series.Add(layerCaption); GSOFeatureLayer flayer = layer as GSOFeatureLayer; + if (layer == null) return; GSOFeatures features = flayer.GetAllFeatures(); if (features.Length > 0) { diff --git "a/GKT_Forms/F_GKT\346\225\260\346\215\256\350\276\223\345\205\245\350\276\223\345\207\272.cs" "b/GKT_Forms/F_GKT\346\225\260\346\215\256\350\276\223\345\205\245\350\276\223\345\207\272.cs" index c7bffd5..4db7d5d 100644 --- "a/GKT_Forms/F_GKT\346\225\260\346\215\256\350\276\223\345\205\245\350\276\223\345\207\272.cs" +++ "b/GKT_Forms/F_GKT\346\225\260\346\215\256\350\276\223\345\205\245\350\276\223\345\207\272.cs" @@ -198,12 +198,7 @@ } DialogResult = DialogResult.OK;//将当前窗体的对话框返回值设为OK } - private void treeView1_NodeMouseClick(object sender, TreeNodeMouseClickEventArgs e) - { - dir_Ok = comboBox_Disk.Text + e.Node.FullPath; - //dir = comboBox_Disk.Text + e.Node.FullPath; - e.Node.SelectedImageIndex = e.Node.ImageIndex; - } + string tempstr = ""; private void button1_Click(object sender, EventArgs e) { diff --git a/HFS_Forms/Frm_HFSprojedits.cs b/HFS_Forms/Frm_HFSprojedits.cs index 96dd76f..3c232a1 100644 --- a/HFS_Forms/Frm_HFSprojedits.cs +++ b/HFS_Forms/Frm_HFSprojedits.cs @@ -126,16 +126,6 @@ Close(); } - - - private void TB_ProjName_KeyPress(object sender, KeyPressEventArgs e) - { - if (HFSAClass.Files_NameChar(e) == 0) - e.Handled = true; - if (e.KeyChar == '\r') - OK_Click(sender, e); - } - private void Frm_HFSProjedit_Load(object sender, EventArgs e) { @@ -175,10 +165,6 @@ } } - private void Cancel_Click(object sender, EventArgs e) - { - this.Close(); - } private void Cancel_Click_1(object sender, EventArgs e) { diff --git a/MainFrm.cs b/MainFrm.cs index 2c305a0..ed2685b 100644 --- a/MainFrm.cs +++ b/MainFrm.cs @@ -617,7 +617,7 @@ } catch (Exception ex) { - + LogHelper.WriteLog(typeof(MainFrm), ex.Message); } } @@ -1768,7 +1768,7 @@ } catch (Exception ex) { - //LogError.PublishError(ex); + LogHelper.WriteLog(typeof(MainFrm), ex.Message); } } @@ -2026,6 +2026,7 @@ } catch (Exception ex) { + LogHelper.WriteLog(typeof(MainFrm), ex.Message); result = false; } finally @@ -2316,220 +2317,6 @@ string filename = Utility.filename; List g1layername = new List(); /// - /// 构建图层列表目录树 - /// - /// - private void loadTreeView(TreeView tv) - { - try - { - XmlDocument doc = new XmlDocument(); - doc.Load(filename); - XmlNodeList Params1 = doc.SelectNodes("/Params/layers"); - tv.ShowLines = false; - tv.CheckBoxes = true; - - foreach (XmlNode paramsNode in Params1) //layers - { - foreach (XmlNode layerNode in paramsNode) //layer - { - TreeNode nodelayer = new TreeNode(); - string layerName = layerNode.Attributes["label"].Value; - nodelayer.Text = layerName; - - if (layerNode.HasChildNodes != false) - { - tv.Nodes.Add(nodelayer); - foreach (XmlNode layerchildNode in layerNode) //layerchild - { - if (layerchildNode.Name == "layerchild") - { - TreeNode nodelayerchild = new TreeNode(); - string layerType = layerchildNode.Attributes["type"].Value; - string layerName1 = layerchildNode.Attributes["layer"].Value; - string layerchildName = layerchildNode.Attributes["label"].Value; - if (layerType == "locaserver") - { - if (layerchildNode.Attributes["isRoad"] != null) - { - roadLayerName = layerchildName; - } - dictionaryNetLayerNameAndCaption.Add(layerName1, layerchildName); - - nodelayerchild.Text = layerchildName; - nodelayerchild.Tag = layerType + "|" + layerchildName; - nodelayerchild.Checked = true; - nodelayer.Nodes.Add(nodelayerchild); - } - else - { - if (layerchildNode.Attributes["isPipeLine"] != null) - { - m_PipelineLayerNames.Add(layerchildName); - } - if (layerchildNode.Attributes["isWorkWell"] != null) - { - workwellLayerNames.Add(layerchildName); - } - if (layerchildNode.Attributes["isValve"] != null) - { - valueLayerNames.Add(layerchildName); - } - //if (layerchildNode.Attributes["isInstrument"] != null) - if (layerchildNode.Attributes["isAccess"] != null) - { - instrumenLayerNames.Add(layerchildName); - } - //if (layerchildNode.Attributes["isPipeFitting"] != null) - if (layerchildNode.Attributes["isCharacter"] != null) - { - pipefittingLayerNames.Add(layerchildName); - } - bool boollayer = AddLayers(layerName1, layerchildName); - nodelayerchild.Text = layerchildName; - nodelayerchild.Tag = layerType + "|" + layerchildName; - nodelayerchild.Checked = boollayer; - if (layerchildName.Contains("特征管点")) - { - nodelayerchild.Checked = false; - setLayerVisible(layerName1); - } - - nodelayer.Nodes.Add(nodelayerchild); - g1layername.Add(layerName1); - } - } - else if (layerchildNode.Name == "layertype") - { - TreeNode nodelayerchild = new TreeNode(); - string layerType = layerchildNode.Attributes["label"].Value; - nodelayerchild.Text = layerType; - nodelayerchild.Tag = layerType; - nodelayerchild.Checked = true; - nodelayer.Nodes.Add(nodelayerchild); - if (layerchildNode.HasChildNodes == true) - { - foreach (XmlNode childNodeLayer in layerchildNode) - { - if (childNodeLayer.HasChildNodes == true) - { - TreeNode nodelayerchild2 = new TreeNode(); - string layer = childNodeLayer.Attributes["label"].Value; - nodelayerchild2.Text = layer; - nodelayerchild2.Tag = layer; - nodelayerchild2.Checked = true; - nodelayerchild.Nodes.Add(nodelayerchild2); - foreach (XmlNode n in childNodeLayer) - { - TreeNode nodelayerchild1 = new TreeNode(); - string layerName1 = n.Attributes["layer"].Value; - string layerchildName = n.Attributes["label"].Value; - string layerType1 = n.Attributes["type"].Value; - if (n.Attributes["isPipeLine"] != null) - { - m_PipelineLayerNames.Add(layerchildName); - } - if (n.Attributes["isWorkWell"] != null) - { - workwellLayerNames.Add(layerchildName); - } - if (n.Attributes["isValve"] != null) - { - valueLayerNames.Add(layerchildName); - } - if (n.Attributes["isAccess"] != null) - //if (n.Attributes["isInstrument"] != null) - { - instrumenLayerNames.Add(layerchildName); - } - if (n.Attributes["isPipeFitting"] != null) - { - pipefittingLayerNames.Add(layerchildName); - } - bool boollayer = AddLayers(layerName1, layerchildName); - nodelayerchild1.Text = layerchildName; - nodelayerchild1.Tag = layerType1 + "|" + layerchildName; - nodelayerchild1.Checked = boollayer; - if (layerchildName.Contains("特征管点")) - { - nodelayerchild1.Checked = false; - setLayerVisible(layerName1); - } - - nodelayerchild2.Nodes.Add(nodelayerchild1); - - g1layername.Add(layerName1); - } - } - else - { - TreeNode nodelayerchild1 = new TreeNode(); - string layerName1 = childNodeLayer.Attributes["layer"].Value; - string layerchildName = childNodeLayer.Attributes["label"].Value; - string layerType1 = childNodeLayer.Attributes["type"].Value; - if (childNodeLayer.Attributes["isPipeLine"] != null) - { - m_PipelineLayerNames.Add(layerchildName); - } - if (childNodeLayer.Attributes["isWorkWell"] != null) - { - workwellLayerNames.Add(layerchildName); - } - if (childNodeLayer.Attributes["isValve"] != null) - { - valueLayerNames.Add(layerchildName); - } - if (childNodeLayer.Attributes["isAccess"] != null) - //if (childNodeLayer.Attributes["isInstrument"] != null) - { - instrumenLayerNames.Add(layerchildName); - } - if (childNodeLayer.Attributes["isPipeFitting"] != null) - { - pipefittingLayerNames.Add(layerchildName); - } - bool boollayer = AddLayers(layerName1, layerchildName); - nodelayerchild1.Text = layerchildName; - nodelayerchild1.Tag = layerType1 + "|" + layerchildName; - nodelayerchild1.Checked = boollayer; - if (layerchildName.Contains("特征管点")) - { - nodelayerchild1.Checked = false; - setLayerVisible(layerName1); - } - nodelayerchild.Nodes.Add(nodelayerchild1); - g1layername.Add(layerName1); - } - } - } - } - } - } - else - { - tv.Nodes.Add(nodelayer); - } - } - } - - foreach (TreeNode tn in tv.Nodes) - { - if (tn.Nodes.Count > 0) - { - foreach (TreeNode tnChild in tn.Nodes) - { - if (tnChild.Checked) - tn.Checked = true; - } - } - } - } - catch (Exception ex) - { - //LogError.PublishError(ex); - } - } - /// /// 获取目标图层 /// /// @@ -2629,21 +2416,11 @@ } catch (Exception ex) { - //LogError.PublishError(ex); + LogHelper.WriteLog(typeof(MainFrm), ex.Message); return false; } } /// - /// 菜单上的 三维导航 工具按钮 - /// - /// - /// - private void buttonItem86_Click(object sender, EventArgs e) - { - globeControl1.Globe.Action = EnumAction3D.ActionNull; - } - - /// /// 地上模式 菜单按钮 /// /// @@ -3026,67 +2803,11 @@ } Image printImage; - /// - /// 打印 菜单 - /// - /// - /// - private void buttonItem13_Click(object sender, EventArgs e) - { - Point pt1 = new Point(Convert.ToInt32(0), Convert.ToInt32(0)); - Point pt2 = new Point(Convert.ToInt32(panelEx5.Width), Convert.ToInt32(panelEx5.Height)); - int mapWidth = 0; - int mapHeight = 0; - Point pt = getUpperLeftPoint(pt1, pt2, out mapWidth, out mapHeight); - printImage = new Bitmap(Convert.ToInt32(panelEx5.Width), Convert.ToInt32(panelEx5.Height)); - Graphics g = Graphics.FromImage(printImage); - g.CopyFromScreen(pt, new Point(0, 0), new Size(Convert.ToInt32(panelEx5.Width), Convert.ToInt32(panelEx5.Height))); - - PrintDialog pd = new PrintDialog(); - try - { - if (pd.ShowDialog() == DialogResult.OK) //如果确认,将会覆盖所有的打印参数设置 - { - //打印预览 - PrintPreviewDialog ppd = new PrintPreviewDialog(); - ppd.Document = printDocument1; - if (DialogResult.OK == ppd.ShowDialog()) - { - printDocument1.Print(); //打印 - } - } - } - catch - { - printDocument1.PrintController.OnEndPrint(printDocument1, new System.Drawing.Printing.PrintEventArgs()); - } - } - + private void printDocument1_PrintPage(object sender, System.Drawing.Printing.PrintPageEventArgs e) { e.Graphics.DrawImage(printImage, 10, 10); } - - /// - /// 在窗体的底部状态栏上显示 综合管线条件查询结果 - /// - /// - /// - private void ToolStripText(string currentLayer, int dataCount) - { - if (dataCount != 0) - { - double featurelength = PipeLength(currentLayer, 0);// 统计管线的里程数 - - toolStripNumbers.Text = " 管线类型:" + currentLayer + " | 共有:" + Convert.ToString(dataCount - 1) + "条记录"; - toolStripFeatureLength.Text = " 管线里程:" + featurelength.ToString("0.00") + " 米"; - } - else - { - toolStripNumbers.Text = "管线类型: " + currentLayer + "| 共有:" + 0 + " 条记录 | "; - } - } - /// /// 统计管线的里程数 /// @@ -3402,26 +3123,6 @@ } /// - /// 绘制线 菜单 - /// - /// - /// - private void btnAddLine_Click(object sender, EventArgs e) - { - globeControl1.Globe.DestLayerFeatureAdd = globeControl1.Globe.MemoryLayer; - globeControl1.Globe.Action = EnumAction3D.DrawPolyline; - } - /// - /// 绘制面 菜单 - /// - /// - /// - private void btnAddPolygon_Click(object sender, EventArgs e) - { - globeControl1.Globe.DestLayerFeatureAdd = globeControl1.Globe.MemoryLayer; - globeControl1.Globe.Action = EnumAction3D.DrawPolygon; - } - /// /// 图层目录树 右键菜单中的 目标图层 菜单 /// /// @@ -3956,42 +3657,7 @@ // ClearUpDownTraceAnalysis(); //} - /// - /// 显示流向 功能 - /// - /// - /// - /// - private void Flow(object sender, string pipelineNameCN, bool bShow) - { - GSOFeatureLayer layer = globeControl1.Globe.Layers.GetLayerByCaption(pipelineNameCN) as GSOFeatureLayer; - GSOFeatures feats = layer.GetAllFeatures(); - for (int i = 0; i < feats.Length; i++) - { - GSOFeature feat = feats[i]; - GSOLineStyle3D lineStyle = feat.Geometry.Style as GSOLineStyle3D; - if (lineStyle != null) - { - if (lineStyle.ArrowStyle == null) - { - lineStyle.ArrowStyle = new GSOArrowStyle(); - lineStyle.ArrowStyle.BodyWidth = 2; - lineStyle.ArrowStyle.BodyLen = 6; - lineStyle.ArrowStyle.HeadWidth = 8; - lineStyle.ArrowStyle.HeadLen = 10; - lineStyle.ArrowStyle.OutlineVisible = true; - lineStyle.ArrowStyle.OutlineColor = Color.Red; - lineStyle.ArrowStyle.Speed = lineStyle.ArrowStyle.Speed / 2; - lineStyle.ArrowStyle.Play(); - } - lineStyle.ArrowVisible = bShow; - layerTree.SelectedNode = null; - } - } - globeControl1.Globe.Refresh(); - } - - + FrmCloseValves frm; /// /// 关阀分析 功能 @@ -4030,7 +3696,9 @@ curCAYNDataset.CloseValveAnalysis(lineFeature.ID, out arryResNodeID, out arryResValveID, false, true); } catch (Exception e) - { } + { + LogHelper.WriteLog(typeof(MainFrm), e.Message); + } string valveName = lineLayer.Caption; valveName = valveName.Substring(0, valveName.IndexOf("管线")); @@ -4106,7 +3774,7 @@ } catch (Exception e) { - + LogHelper.WriteLog(typeof(MainFrm), e.Message); } //目前只有燃气管线 有阀门 string valveName = lineLayer.Name; @@ -5457,7 +5125,7 @@ } catch (Exception ex) { - //MessageBox.Show(ex.ToString()); + LogHelper.WriteLog(typeof(MainFrm), ex.Message); } finally { @@ -5501,22 +5169,6 @@ } } - - /// - /// 清除所有坑 菜单 - /// - /// - /// - private void buttonItem3_Click(object sender, EventArgs e) - { - //日志记录 - LogManager.saveLog(Utility.userName, this.buttonItem3.Text); - - globeControl1.Globe.RemoveAllPits(); - } - - - ///// ///// 净距分析 菜单 ///// @@ -5554,42 +5206,8 @@ // ribbonBarTP.Visible = buttonItem34.Checked; // ribbonBarTP.Location = new Point(0, 0); //} - /// - /// 大气层 菜单 - /// - /// - /// - private void buttonItem17_Click_1(object sender, EventArgs e) - { - globeControl1.Globe.Atmosphere.Visible = !globeControl1.Globe.Atmosphere.Visible; - buttonItemSH1.Checked = globeControl1.Globe.Atmosphere.Visible; - globeControl1.Refresh(); - } - /// - /// 经纬网 菜单 - /// - /// - /// - private void buttonItem20_Click(object sender, EventArgs e) - { - globeControl1.Globe.LatLonGrid.Visible = !globeControl1.Globe.LatLonGrid.Visible; - buttonItemSH3.Checked = globeControl1.Globe.LatLonGrid.Visible; - globeControl1.Globe.Refresh(); - } - /// - /// 状态条 菜单 - /// - /// - /// - private void buttonItem21_Click_1(object sender, EventArgs e) - { - globeControl1.Globe.StatusBar.Visible = !globeControl1.Globe.StatusBar.Visible; - buttonItemSH4.Checked = globeControl1.Globe.StatusBar.Visible; - globeControl1.Globe.Refresh(); - } - - + /// /// 添加指定路径下的数据 功能 /// @@ -5680,43 +5298,7 @@ // } // return objRes; //} - /// - /// 刷新目录树 功能 - /// - private void RefreshDataTree() - { - layerTree.Nodes[0].Nodes.Clear(); - Int32 nCount = globeControl1.Globe.DataManager.DataSourceCount; - Int32 i = 0; - for (i = 0; i < nCount; i++) - { - GSODataSource dataSpace = globeControl1.Globe.DataManager[i]; - TreeNode node = new TreeNode(); - node.Text = dataSpace.Name; - node.ImageIndex = 0; - node.SelectedImageIndex = 0; - node.Checked = true; - node.Tag = dataSpace; - Int32 nDatasetCount = dataSpace.DatasetCount; - for (Int32 j = 0; j < nDatasetCount; j++) - { - GSODataset dataset = dataSpace[j]; - TreeNode subNode = new TreeNode(); - subNode.Text = dataset.Name; - subNode.ImageIndex = 0; - subNode.SelectedImageIndex = 0; - subNode.Checked = true; - subNode.Tag = dataset; - node.Nodes.Add(subNode); - } - layerTree.Nodes[0].Nodes.Add(node); - } - } - - - - - + /// /// 复合查询 菜单 @@ -5777,34 +5359,7 @@ return false; } - /// - /// 统计指定图层在指定范围内的所有feature对象 - /// - /// - /// - /// - private GSOFeatures Intersect_PointLayer(GSOGeoPolygon3D polygon, string pointLayerName) - { - GSOLayer layer = globeControl1.Globe.Layers.GetLayerByCaption(pointLayerName); - if (layer == null) - return null; - - GSOFeatureLayer flayer = layer as GSOFeatureLayer; - GSOFeatureDataset fdataset = flayer.Dataset as GSOFeatureDataset; - GSOFeatures feats; - if (polygon == null) - { - feats = flayer.GetAllFeatures(); - } - else - { - feats = flayer.FindFeaturesInPolygon(polygon, false); - } - - workWellLen.Add(pointLayerName, feats.Length); - return feats; - } - /// + /// /// 碰撞分析功能界面中 选择管线复选框 选中状态改变事件处理 /// /// @@ -5946,16 +5501,6 @@ MessageBox.Show("表格内容为空!", "提示"); } } - /// - /// 导出CAD 菜单 - /// - /// - /// - private void btnExportCAD_Click(object sender, EventArgs e) - { - FrmExportCADS frm = new FrmExportCADS(globeControl1, m_PipelineLayerNames); - frm.ShowDialog(); - } ///// ///// 区域分析 菜单 @@ -5987,16 +5532,6 @@ } } } - /// - /// 数据验证 菜单 - /// - /// - /// - private void buttonItem80_Click(object sender, EventArgs e) - { - FrmValiData frm = new FrmValiData(globeControl1); - frm.ShowDialog(); - } /// /// 根据指定图层创建图层节点并将节点添加到图层管理节点的子节点集合中 @@ -6018,56 +5553,7 @@ layerManagerNode.Expand(); } } - /// - /// 数据库备份 菜单 - /// - /// - /// - private void btnBackDatabase_Click(object sender, EventArgs e) - { - if (MessageBox.Show("是否确定要备份数据库文件", "信息", MessageBoxButtons.YesNo, MessageBoxIcon.Question) == DialogResult.Yes) - { - try - { - DateTime currentTime = DateTime.Now; - //string Dtime = currentTime.ToShortDateString().ToString("yyyy-MM-dd"); - string Dtime = currentTime.GetDateTimeFormats('D')[0].ToString(); - string Htime = DateTime.Now.ToString("HH时mm分ss秒").Trim(); - string fileName = Dtime + "(" + Htime + ")"; - string pathName = ""; - string sql = "select filename from master..sysdatabases where name='" + Utility.dbdatabase + "'"; - DataTable dt = OledbHelper.ExecuteDataTable(sql); - if (dt != null && dt.Rows.Count > 0) - { - pathName = dt.Rows[0][0].ToString().Trim(); - int count = pathName.LastIndexOf("\\") == -1 ? pathName.LastIndexOf("/") : pathName.LastIndexOf("\\"); - pathName = pathName.Substring(0, count); - } - pathName += "\\管网数据库" + fileName + ".bak"; - - OracleCommand cmdBK = new OracleCommand(); - cmdBK.CommandType = CommandType.Text; - cmdBK.Connection = connBackup; - cmdBK.CommandText = @"backup database " + Utility.dbdatabase + " to disk='" + pathName + "' with init"; - - connBackup.Open(); - cmdBK.ExecuteNonQuery(); - MessageBox.Show("数据库文件备份成功", "提示"); - } - catch (Exception ex) - { - MessageBox.Show(ex.ToString()); - } - finally - { - connBackup.Close(); - } - } - } - - - - + //GSOFeature emitterFeature; // 粒子要素 /// /// 添加火苗 功能 @@ -6598,361 +6084,15 @@ } } - - ///// - /// 添加用户仓库 菜单 - /// - /// - /// - private void buttonItem108_Click(object sender, EventArgs e) - { - FrmUserRepo frm = new FrmUserRepo(-1); - frm.ShowDialog(); - } - /// - /// 用户仓库管理 菜单 - /// - /// - /// - private void buttonItem111_Click(object sender, EventArgs e) - { - FrmUserRepoMgr frm = new FrmUserRepoMgr(); - frm.ShowDialog(); - } - /// - /// 添加分系统 菜单 - /// - /// - /// - private void buttonItem112_Click(object sender, EventArgs e) - { - //FrmAPP frm = new FrmAPP(-1); - //frm.ShowDialog(); - } - /// - /// 分系统管理 菜单 - /// - /// - /// - private void buttonItem113_Click(object sender, EventArgs e) - { - //FrmAPPMgr frm = new FrmAPPMgr(); - //frm.ShowDialog(); - } - /// - /// 添加操作 菜单 - /// - /// - /// - private void buttonItem114_Click(object sender, EventArgs e) - { - FrmOper frm = new FrmOper(-1); - frm.ShowDialog(); - } - /// - /// 操作管理 菜单 - /// - /// - /// - private void buttonItem115_Click(object sender, EventArgs e) - { - FrmOperMgr frm = new FrmOperMgr(); - frm.ShowDialog(); - } - /// - /// 添加资源 菜单 - /// - /// - /// - private void buttonItem116_Click(object sender, EventArgs e) - { - FrmRESC frm = new FrmRESC(-1); - frm.ShowDialog(); - } - /// - /// 资源管理 菜单 - /// - /// - /// - private void buttonItem117_Click(object sender, EventArgs e) - { - FrmRESCMgr frm = new FrmRESCMgr(); - frm.ShowDialog(); - } - /// - /// 添加权限 菜单 - /// - /// - /// - private void buttonItem118_Click(object sender, EventArgs e) - { - FrmPerm frm = new FrmPerm(-1); - frm.ShowDialog(); - } - /// - /// 权限管理 菜单 - /// - /// - /// - private void buttonItem119_Click(object sender, EventArgs e) - { - FrmPermMgr frm = new FrmPermMgr(); - frm.ShowDialog(); - } - /// - /// 添加访问控制 菜单 - /// - /// - /// - private void buttonItem120_Click(object sender, EventArgs e) - { - FrmAccess frm = new FrmAccess(-1); - frm.ShowDialog(); - } - /// - /// 访问控制管理 菜单 - /// - /// - /// - private void buttonItem121_Click(object sender, EventArgs e) - { - FrmAccessMgr frm = new FrmAccessMgr(); - frm.ShowDialog(); - } - /// - /// 部门类型管理 菜单 - /// - /// - /// - private void buttonItem122_Click(object sender, EventArgs e) - { - FrmRegionTypeMgr frm = new FrmRegionTypeMgr(); - frm.ShowDialog(); - } - /// - /// 用户信息管理 菜单 - /// - /// - /// - private void buttonItem128_Click_1(object sender, EventArgs e) - { - FrmUserManager frm = new FrmUserManager(); - frm.ShowDialog(); - } - /// - /// 添加角色 菜单 - /// - /// - /// - private void 添加角色_Click(object sender, EventArgs e) - { - FrmRole frm = new FrmRole(-1); - frm.ShowDialog(); - } - /// - /// 所有角色管理 菜单 - /// - /// - /// - private void 角色管理_Click(object sender, EventArgs e) - { - FrmRoleMgr frm = new FrmRoleMgr(); - frm.ShowDialog(); - } - - /// - /// 部门角色管理 菜单 - /// - /// - /// - private void buttonItem133_Click(object sender, EventArgs e) - { - FrmRegionRoleMgr frm = new FrmRegionRoleMgr(); - frm.ShowDialog(); - } - /// - /// 部门管理 菜单 - /// - /// - /// - private void buttonItem130_Click(object sender, EventArgs e) - { - FrmRegionMgr frm = new FrmRegionMgr(); - frm.ShowDialog(); - } - - /// - /// 日志管理 菜单 - /// - /// - /// - private void buttonItem135_Click(object sender, EventArgs e) - { - FrmLogManager frm = new FrmLogManager(); - frm.ShowDialog(); - } - /// - /// 传感器信息查询 菜单 - /// - /// - /// - private void buttonItem131_Click_1(object sender, EventArgs e) - { - GSOFeature selectedFeature = globeControl1.Globe.SelectedObject; - if (selectedFeature == null) - { - MessageBox.Show("请选择一个传感器对象!", "提示", MessageBoxButtons.OK, MessageBoxIcon.Information); - } - else - { - if (selectedFeature.Geometry != null && selectedFeature.Geometry.Type == EnumGeometryType.GeoModel) - { - GSOLayer layer = globeControl1.Globe.SelectedObjectLayer; - string tabelName = getTableName(layer.Caption); - string eqtID = selectedFeature.Description.Trim(); - if (tabelName != "" && eqtID != "") - { - string fields = getFields(tabelName); - if (fields != "") - { - string sql = "select " + fields + " from " + Utility.sensorDatabase + "." + tabelName + " where EqtID=" + eqtID + " order by RecordDate desc limit 1;"; - DataTable dt = MySqlHelper.queryDataTable(sql); - if (dt != null && dt.Rows.Count > 0) - { - FrmQueryMessage.ShowForm(this, dt, layer.Caption); - //queryMessage.Show(this); - } - else - { - MessageBox.Show("没有查询到相关信息!", "提示"); - } - } - else - { - MessageBox.Show("配置文件 \"sensorConfig.xml\" 有误!", "提示"); - } - } - else - { - MessageBox.Show("请选择一个传感器对象!", "提示"); - } - } - else - { - MessageBox.Show("请选择一个传感器对象!", "提示", MessageBoxButtons.OK, MessageBoxIcon.Information); - } - } - } - /// - /// 根据指定的图层的caption属性的值在配置文件中查找对应的数据库中的表的名称 - /// - /// 图层的caption属性的值 - /// 对应的数据库中的表的名称 - private string getTableName(string name) - { - string tabelName = ""; - if (Utility.sensorMarkerLayers != null) - { - for (int i = 0; i < Utility.sensorMarkerLayers.Count; i++) - { - MarkerLayer mLayer = Utility.sensorMarkerLayers[i]; - if (mLayer.layerName == name) - { - tabelName = mLayer.tableName; - break; - } - } - } - return tabelName; - } - /// - /// 根据数据库中的表的名称 查找对应的表中的字段名称的集合 - /// - /// 数据库中的表的名称 - /// 对应的表中的字段名称的集合 - private string getFields(string tabelName) - { - string fields = ""; - if (Utility.sensorMarkerLayers != null) - { - for (int i = 0; i < Utility.sensorMarkerLayers.Count; i++) - { - MarkerLayer mLayer = Utility.sensorMarkerLayers[i]; - if (mLayer.tableName.Trim() == tabelName.Trim()) - { - if (mLayer.fields != null) - { - foreach (string key in mLayer.fields.Keys) - { - string value = mLayer.fields[key]; - fields += tabelName.Trim() + "." + key + " as " + value + ","; - } - fields = fields.Remove(fields.Length - 1); - } - break; - } - } - } - return fields; - } - - /// - /// 历史曲线查询 菜单 - /// - /// - /// - private void buttonItem132_Click(object sender, EventArgs e) - { - GSOFeature selectedFeature = globeControl1.Globe.SelectedObject; - if (selectedFeature == null) - { - MessageBox.Show("请选择一个对象!", "提示", MessageBoxButtons.OK, MessageBoxIcon.Information); - } - else - { - if (selectedFeature.Geometry != null && selectedFeature.Geometry.Type == EnumGeometryType.GeoModel) - { - GSOLayer layer = globeControl1.Globe.SelectedObjectLayer; - string tabelName = getTableName(layer.Caption); - string eqtID = selectedFeature.Description; - if (tabelName != "" && eqtID != "") - { - FrmQueryHistory.ShowForm(this, tabelName, eqtID); - } - else - { - MessageBox.Show("请选择一个传感器对象!", "提示"); - } - } - else - { - MessageBox.Show("请选择一个传感器对象!", "提示", MessageBoxButtons.OK, MessageBoxIcon.Information); - } - } - } - + //定时检查传感器的状态 public System.Windows.Forms.Timer timerOfSensor = null; public int alarmValueLiuLiang = 0; public int alarmValueYaLi = 0; public int alarmValueYeTi = 0; public int alarmValueZaoSheng = 0; - /// - /// 传感器在线报警 菜单 - /// - /// - /// - private void buttonItem134_Click(object sender, EventArgs e) - { - if (timerOfSensor == null) - { - timerOfSensor = new System.Windows.Forms.Timer(); - timerOfSensor.Interval = 30000; - timerOfSensor.Tick += new EventHandler(timerOfSensor_Tick); - } - FrmQuerySensorAlarm.ShowForm(this); - } + /// /// 传感器报警 功能中的 定时器 的触发事件处理 /// @@ -7016,6 +6156,7 @@ } catch (Exception ex) { + LogHelper.WriteLog(typeof(MainFrm), ex.Message); continue; } } @@ -7025,145 +6166,7 @@ } } - - /// - /// 沿线运动 菜单 - /// - /// - /// - private void buttonItem138_Click(object sender, EventArgs e) - { - if (globeControl1.Globe.SelectedObject == null) - { - MessageBox.Show("请先选择一条线!", "提示", MessageBoxButtons.OK, MessageBoxIcon.Exclamation); - return; - } - - GSOFeature lineFeature = globeControl1.Globe.SelectedObject; - if (lineFeature.Geometry == null || lineFeature.Geometry.Type != EnumGeometryType.GeoPolyline3D) - { - MessageBox.Show("请先选择一条线!", "提示", MessageBoxButtons.OK, MessageBoxIcon.Exclamation); - return; - } - - OpenFileDialog dlg = new OpenFileDialog(); - dlg.Filter = "*.gcm;*.3ds|*.gcm;*.3ds|*.3ds|*.3ds|*.gcm|*.gcm"; - if (dlg.ShowDialog() == DialogResult.OK) - { - GSOGeoModel model = new GSOGeoModel(); - model.FilePath = dlg.FileName; - - GSOGeoDynamicRoute dynamicRoute = new GSOGeoDynamicRoute(); - dynamicRoute.ActorGeometry = model; - - GSORoute route = new GSORoute(); - GSOGeoPolyline3D geoline = (GSOGeoPolyline3D)lineFeature.Geometry; - for (int i = 0; i < geoline[0].Count; i++) - { - route.Add(geoline[0][i]); - } - route.CircleRoute = false; - route.Speed = 30; - route.RotateSpeed = 50; - route.AltitudeMode = geoline.AltitudeMode; - dynamicRoute.Route = route; - - GSOFeature feature = new GSOFeature(); - - dynamicRoute.Play(); - feature.Geometry = dynamicRoute; - - //GSOLabel gsoLabel = new GSOLabel(); - //gsoLabel.Text = "模型测试"; - //feature.Label = gsoLabel; - globeControl1.Globe.MinModelVisibleSize = 0; - - globeControl1.Globe.MemoryLayer.AddFeature(feature); - globeControl1.Globe.Refresh(); - } - } - /// - /// 回退 菜单 - /// - /// - /// - private void buttonItem99_Click(object sender, EventArgs e) - { - globeControl1.Globe.UnDoEdit(); - } - /// - /// 前进 菜单 - /// - /// - /// - private void buttonItem100_Click(object sender, EventArgs e) - { - globeControl1.Globe.ReDoEdit(); - } - /// - /// 水平净距 功能界面中的 标签内容改变事件处理 - /// - /// - /// - private void textBoxX4_TextChanged(object sender, EventArgs e) - { - string valueJingJu = textBoxX4.Text.Trim(); - if (valueJingJu != "") - { - double value = 0; - bool bl = double.TryParse(valueJingJu, out value); - if (bl) - { - labelX24.Text = "水平净距小于" + value.ToString() + "米的管线有:"; - } - } - } - /// - /// 垂直净距 功能界面中的 标签内容改变事件处理 - /// - /// - /// - private void textBoxX2_TextChanged(object sender, EventArgs e) - { - string valueJingJu = textBoxX2.Text.Trim(); - if (valueJingJu != "") - { - double value = 0; - bool bl = double.TryParse(valueJingJu, out value); - if (bl) - { - labelX23.Text = "垂直净距小于" + value.ToString() + "米的管线有:"; - } - } - } - /// - /// 覆土分析 功能界面中的 标签内容改变事件处理 - /// - /// - /// - private void textBoxX3_TextChanged(object sender, EventArgs e) - { - string valueJingJu = textBoxX3.Text.Trim(); - if (valueJingJu != "") - { - double value = 0; - bool bl = double.TryParse(valueJingJu, out value); - if (bl) - { - labelX17.Text = "覆土深度小于" + value.ToString() + "米的管线有:"; - } - } - } - - /// - /// 传感器分类查询 全区域 菜单 - /// - /// - /// - private void buttonItemSensor全区域查询_Click(object sender, EventArgs e) - { - FrmAccessoriesSensor.ShowForm(globeControl1, instrumenLayerNames, 0); - } + /// /// 传感器分类查询 绘制区域 菜单 /// @@ -7224,170 +6227,10 @@ layerTemp.RemoveAllFeature(); globeControl1.Refresh(); } - /// - /// 数字预处理 功能 - /// - /// - /// - private void 数字预处理buttonItem140_Click(object sender, EventArgs e) - { - FrmEditShapeFile frm = new FrmEditShapeFile(globeControl1); - frm.ShowDialog(this); - } - - - /// - /// 导出矢量 功能 将图层导出为kml和shp格式数据 - /// - /// - /// - private void 导出矢量buttonItem140_Click(object sender, EventArgs e) - { - /* - List m_PipelineLayerNames = new List();//线图层名称 - List workwellLayerNames = new List();//工井图层名称 - List valueLayerNames = new List();//阀门图层名称 - List instrumenLayerNames = new List();//附属物图层名称 - List pipefittingLayerNames = new List();//管件图层名称 - */ - List listVectorNames = new List(); - for (int i = 0; i < m_PipelineLayerNames.Count; i++) - { - if (m_PipelineLayerNames[i] == "移动" || m_PipelineLayerNames[i] == "联通" - || m_PipelineLayerNames[i] == "电信" || m_PipelineLayerNames[i] == "共通" - || m_PipelineLayerNames[i] == "有限电视" || m_PipelineLayerNames[i] == "交通信号" - || m_PipelineLayerNames[i] == "供电") - { - continue; - } - if (listVectorNames.Contains(m_PipelineLayerNames[i]) == false) - { - listVectorNames.Add(m_PipelineLayerNames[i]); - } - } - for (int i = 0; i < valueLayerNames.Count; i++) - { - if (listVectorNames.Contains(valueLayerNames[i]) == false) - { - listVectorNames.Add(valueLayerNames[i]); - } - } - for (int i = 0; i < workwellLayerNames.Count; i++) - { - if (listVectorNames.Contains(workwellLayerNames[i]) == false) - { - listVectorNames.Add(workwellLayerNames[i]); - } - } - for (int i = 0; i < instrumenLayerNames.Count; i++) - { - if (listVectorNames.Contains(instrumenLayerNames[i]) == false) - { - listVectorNames.Add(instrumenLayerNames[i]); - } - } - for (int i = 0; i < pipefittingLayerNames.Count; i++) - { - if (listVectorNames.Contains(pipefittingLayerNames[i]) == false) - { - listVectorNames.Add(pipefittingLayerNames[i]); - } - } - FrmExportVector frm = new FrmExportVector(globeControl1, listVectorNames); - frm.ShowDialog(); - } string citySevenLineType = ""; string cityServerLineName = ""; /// - /// 绘制城市七线 功能按钮 - /// - /// - /// - private void 绘制城市七线buttonItem140_Click(object sender, EventArgs e) - { - FrmCitySevenLineType frm = new FrmCitySevenLineType(); - if (frm.ShowDialog() == DialogResult.OK) - { - globeControl1.Globe.Action = EnumAction3D.DrawPolyline; - m_isDrawCitySevenLine = true; - m_isDrawTunnel = false; - m_AddPipeLine = false; - this.citySevenLineType = frm.citySevenLineType; - this.cityServerLineName = frm.citySevenLineName; - switch (frm.citySevenLineType) - { - case "城市红线": - GSOLayer layerRed = globeControl1.Globe.Layers.GetLayerByCaption(frm.citySevenLineType); - if (layerRed != null) - { - globeControl1.Globe.DestLayerFeatureAdd = layerRed; - layerRed.Editable = true; - } - break; - case "城市橙线": - GSOLayer layerOrange = globeControl1.Globe.Layers.GetLayerByCaption(frm.citySevenLineType); - if (layerOrange != null) - { - globeControl1.Globe.DestLayerFeatureAdd = layerOrange; - layerOrange.Editable = true; - } - break; - case "城市黄线": - GSOLayer layerYellow = globeControl1.Globe.Layers.GetLayerByCaption(frm.citySevenLineType); - if (layerYellow != null) - { - globeControl1.Globe.DestLayerFeatureAdd = layerYellow; - layerYellow.Editable = true; - } - break; - case "城市绿线": - GSOLayer layerGreen = globeControl1.Globe.Layers.GetLayerByCaption(frm.citySevenLineType); - if (layerGreen != null) - { - globeControl1.Globe.DestLayerFeatureAdd = layerGreen; - layerGreen.Editable = true; - } - break; - case "城市蓝线": - GSOLayer layerBlue = globeControl1.Globe.Layers.GetLayerByCaption(frm.citySevenLineType); - if (layerBlue != null) - { - globeControl1.Globe.DestLayerFeatureAdd = layerBlue; - layerBlue.Editable = true; - } - break; - case "城市紫线": - GSOLayer layerPurple = globeControl1.Globe.Layers.GetLayerByCaption(frm.citySevenLineType); - if (layerPurple != null) - { - globeControl1.Globe.DestLayerFeatureAdd = layerPurple; - layerPurple.Editable = true; - } - break; - case "城市黑线": - GSOLayer layerBlack = globeControl1.Globe.Layers.GetLayerByCaption(frm.citySevenLineType); - if (layerBlack != null) - { - globeControl1.Globe.DestLayerFeatureAdd = layerBlack; - layerBlack.Editable = true; - } - break; - } - } - } - /// - /// 七线审核 功能按钮 - /// - /// - /// - private void 七线审核buttonItem141_Click(object sender, EventArgs e) - { - FrmCityServerLineAnalysis frm = new FrmCityServerLineAnalysis(globeControl1, m_PipelineLayerNames); - frm.ShowDialog(this); - } - - /// /// 间距分析 开始分析按钮 分析绘制的七线和管线的距离是否符合标准 /// /// @@ -7666,25 +6509,6 @@ } } - - - /// - /// 管线自动缩进 菜单 - /// - /// - /// - private void 管线自动缩进buttonItem140_Click(object sender, EventArgs e) - { - FrmPipelineIndented frm = new FrmPipelineIndented(globeControl1, m_PipelineLayerNames, workwellLayerNames); - frm.ShowDialog(this); - } - - private void btnExportCADs_Click(object sender, EventArgs e) - { - - } - - /// /// 统计指定图层在指定范围内的所有feature对象 /// @@ -7755,8 +6579,6 @@ } - - //设置图层为隐藏 private void setLayerVisible(string layerName) { @@ -7765,27 +6587,7 @@ globeControl1.Globe.Refresh(); } - /// - /// 连接数据库 - /// - /// - /// - private void buttonItem129_Click(object sender, EventArgs e) - { - //保存日志 - LogManager.saveLog(Utility.userName, this.buttonItemSJGL4_1.Text); - - FrmDatabaseParaSetting2 frm = new FrmDatabaseParaSetting2(globeControl1); - if (frm.ShowDialog() == DialogResult.OK) - { - ds = FrmDatabaseParaSetting2.ds; - if (ds != null) - { - ds.IsCloseSaved = false; - } - } - } - + /// /// 清除渲染结果 /// @@ -7803,112 +6605,8 @@ layerTemp.RemoveAllFeature(); globeControl1.Refresh(); } - - /// - /// 绘制垂线 - /// - /// - /// - private void drawCLine(GSOPoint3d fpt, GSOPoint3d tpt) - { - GSOGeoPolyline3D pline = new GSOGeoPolyline3D(); - GSOPoint3ds pts = new GSOPoint3ds(); - pts.Add(fpt); - pts.Add(tpt); - pline.AddPart(pts); - - GSOGeoPoint3D fptg = new GSOGeoPoint3D(); - GSOGeoPoint3D tptg = new GSOGeoPoint3D(); - fptg.X = fpt.X; - fptg.Y = fpt.Y; - fptg.Z = 0; - tptg.X = tpt.X; - tptg.Y = tpt.Y; - tptg.Z = 0; - - GSOFeature gf = new GSOFeature(); - gf.Geometry = pline; - - globeControl1.Globe.MemoryLayer.AddFeature(gf); - - } - /// - /// 红线审核 - /// - /// - /// - private void buttonItem138_Click_2(object sender, EventArgs e) - { - - } - /// - /// 比较两个点是否是同一个点 - /// - /// - /// - /// - private bool comparePoint(GSOPoint3d pt1, GSOPoint3d pt2) - { - double x1 = 0; double y1 = 0; - double x2 = 0; double y2 = 0; - x1 = pt1.X; - y1 = pt1.Y; - x2 = pt2.X; - y2 = pt2.Y; - if ((x1 == x2) && (y1 == y2)) - { - return true; - } - return false; - } - /// - /// 获得点到线的垂线距离及垂点 - /// - /// - /// - /// - /// - private void comparePointLine(GSOPoint3d point, GSOGeoPolyline3D line, out double length, out GSOPoint3d pointChuiDian) - { - GSOPoint3d lineStartPoint = line[0][0]; - GSOPoint3d lineEndPoint = line[0][1]; - GSOGeoPolyline3D lineAB = new GSOGeoPolyline3D(); - GSOPoint3ds pointsAB = new GSOPoint3ds(); - pointsAB.Add(point); - pointsAB.Add(lineStartPoint); - lineAB.AddPart(pointsAB); - double lengthAB = lineAB.GetSpaceLength(false, 6378137.0); - double xieLvAB = getXieLu("", point.X, point.Y, lineStartPoint.X, lineStartPoint.Y); - double xieLvBC = getXieLu("", lineStartPoint.X, lineStartPoint.Y, lineEndPoint.X, lineEndPoint.Y); - - double tanABC = Math.Abs(xieLvAB - xieLvBC) / (1 + xieLvAB * xieLvBC); - double angle = Math.Atan(tanABC); - //if (angle > Math.PI / 2) //落在外边 - //{ - // length = 0; - //} - double lengthAD = lengthAB * Math.Sin(angle); - length = Math.Abs(lengthAD); - double lengthBD = lengthAB * Math.Cos(angle); - - GSOPoint2d point2dStart = Latlon_2_XYZ(lineStartPoint.X, lineStartPoint.Y); - double bBC = point2dStart.Y - xieLvBC * point2dStart.X; - GSOPoint2d point2dEnd = new GSOPoint2d(); - point2dEnd.X = point2dStart.X + 100; - point2dEnd.Y = point2dEnd.X * xieLvBC + bBC; - point2dEnd = XYZ_2_Latlon(point2dEnd.X, point2dEnd.Y); - - GSOPoint3d pointEnd = new GSOPoint3d(); - pointEnd.X = point2dEnd.X; - pointEnd.Y = point2dEnd.Y; - GSOGeoPolyline3D lineYanShen = new GSOGeoPolyline3D(); - GSOPoint3ds pointsYanShen = new GSOPoint3ds(); - pointsYanShen.Add(lineStartPoint); - pointsYanShen.Add(pointEnd); - lineYanShen.AddPart(pointsYanShen); - GSOGeoPolyline3D lineSegment = lineYanShen.GetSegment(0, lengthBD); - pointChuiDian = lineSegment[0][1]; - } + + /// /// 获得斜率 /// @@ -8044,255 +6742,6 @@ } /// - /// 获取与点相连的所有线以及线的点的集合 - /// - /// 选定的点所在的线 - /// 选定的点 - /// 面中不完全包含的除起点线之外所有的线 - /// 选定的点所在的点的集合 - /// 所有以选定线为起点的点的集合 - /// - private List getFeaturesPoints(GSOFeature featureSelect, GSOPoint3d lineStart, GSOFeatures selectFeatures, GSOPoint3ds ps, List listPS) - { - GSOFeatures fsStart = new GSOFeatures(); - for (int n = 0; n < selectFeatures.Length; n++) - { - if (featureSelect.ID == selectFeatures[n].ID) - { - continue; - } - GSOGeoPolyline3D newLine = selectFeatures[n].Geometry as GSOGeoPolyline3D; - if (newLine != null && newLine.PartCount > 0) - { - GSOPoint3d newLineStart = newLine[0][0]; - GSOPoint3d newLineEnd = newLine[0][newLine[0].Count - 1]; - if (lineStart.X == newLineEnd.X && lineStart.Y == newLineEnd.Y) - { - GSOPoint3ds psAdd = new GSOPoint3ds(); - for (int k = newLine[0].Count - 1; k >= 0; k--) - { - psAdd.Add(newLine[0][k]); - } - newLine[0] = psAdd; - fsStart.Add(selectFeatures[n]); - - } - else if (lineStart.X == newLineStart.X && lineStart.Y == newLineStart.Y) - { - fsStart.Add(selectFeatures[n]); - - } - } - } - if (fsStart.Length > 0) - { - for (int m = 0; m < fsStart.Length; m++) - { - GSOGeoPolyline3D lineFsStart = fsStart[m].Geometry as GSOGeoPolyline3D; - if (lineFsStart != null && lineFsStart.PartCount > 0) - { - GSOPoint3ds psAdd = ps.Clone(); - for (int k = 0; k < lineFsStart[0].Count; k++) - { - psAdd.Add(lineFsStart[0][k]); - } - listPS = getFeaturesPoints(fsStart[m], lineFsStart[0][lineFsStart[0].Count - 1], selectFeatures, psAdd, listPS); - } - } - } - else - { - listPS.Add(ps); - } - return listPS; - } - - /// - /// 获取切割面的线 - /// - /// 不完全包含在面中的所有线 - /// 完全包含在面中的所有线 - /// 线 - private GSOFeature getLineFromGSOFeatures(GSOFeatures features, GSOFeatures featuresTrue) - { - //1. 当线对象数组的长度为0时,返回空 - if (features.Length == 0) - { - return null; - } - //2. 当线对象数组的长度为1时,返回这条线 - if (features.Length == 1) - { - return features[0]; - } - //3. 当线对象数组的长度大于1时,计算所有线组成的最长线 - - //3.1 获取所有不完全包含在面中的对象selectFeatures - GSOFeatures selectFeatures = new GSOFeatures(); - for (int a = 0; a < features.Length; a++) - { - selectFeatures.Add(features[a].Clone()); - } - //3.2 删除features中完全包含在面中的线,获取和面的边界相交的线对象 - for (int a = 0; a < featuresTrue.Length; a++) - { - for (int b = 0; b < features.Length; b++) - { - if (featuresTrue[a].ID == features[b].ID) - { - features.Remove(b); - break; - } - } - } - //3.3 如果和面的边界相交的线的数量为0,返回空 - if (features.Length == 0) - { - return null; - } - //3.4 获取第一条和面的边界相交的线featureInOutPolygon - GSOFeature featureInOutPolygon = features[0]; - //3.5 从所有的线中删除featureInOutPolygon - for (int a = 0; a < selectFeatures.Length; a++) - { - if (selectFeatures[a].ID == featureInOutPolygon.ID) - { - selectFeatures.Remove(a); - break; - } - } - //listPS存储所有从featureInOutPolygon出发的点的集合 - List listPS = new List(); - //3.5 获取与featureInOutPolygon相连的线的集合 - GSOGeoPolyline3D line = featureInOutPolygon.Geometry as GSOGeoPolyline3D; - if (line != null && line.PartCount > 0) - { - GSOPoint3d lineStart = line[0][0]; - GSOPoint3d lineEnd = line[0][line[0].Count - 1]; - #region//获取和featureInOutPolygon的起点相连的线 - GSOFeatures fsStart = new GSOFeatures(); - for (int n = 0; n < selectFeatures.Length; n++) - { - GSOGeoPolyline3D newLine = selectFeatures[n].Geometry as GSOGeoPolyline3D; - if (newLine != null && newLine.PartCount > 0) - { - GSOPoint3d newLineStart = newLine[0][0]; - GSOPoint3d newLineEnd = newLine[0][newLine[0].Count - 1]; - if (lineStart.X == newLineEnd.X && lineStart.Y == newLineEnd.Y) - { - GSOPoint3ds psAdd = new GSOPoint3ds(); - for (int k = newLine[0].Count - 1; k >= 0; k--) - { - psAdd.Add(newLine[0][k]); - } - newLine[0] = psAdd; - fsStart.Add(selectFeatures[n]); - - } - else if (lineStart.X == newLineStart.X && lineStart.Y == newLineStart.Y) - { - fsStart.Add(selectFeatures[n]); - } - } - } - #endregion - - #region//获取和featureInOutPolygon的终点相连的线 - GSOFeatures fsEnd = new GSOFeatures(); - for (int n = 0; n < selectFeatures.Length; n++) - { - GSOGeoPolyline3D newLine = selectFeatures[n].Geometry as GSOGeoPolyline3D; - if (newLine != null && newLine.PartCount > 0) - { - GSOPoint3d newLineStart = newLine[0][0]; - GSOPoint3d newLineEnd = newLine[0][newLine[0].Count - 1]; - if (lineEnd.X == newLineStart.X && lineEnd.Y == newLineStart.Y) - { - fsEnd.Add(selectFeatures[n]); - - } - else if (lineEnd.X == newLineEnd.X && lineEnd.Y == newLineEnd.Y) - { - GSOPoint3ds psAdd = new GSOPoint3ds(); - for (int k = newLine[0].Count - 1; k >= 0; k--) - { - psAdd.Add(newLine[0][k]); - } - newLine[0] = psAdd; - fsEnd.Add(selectFeatures[n]); - - } - } - } - #endregion - - //3.6 将featureInOutPolygon的所有点和与之起点相连的线的所有点组成一个点的集合并添加到listPS中 - if (fsStart.Length > 0 && fsEnd.Length == 0) - { - for (int m = 0; m < fsStart.Length; m++) - { - GSOGeoPolyline3D lineFsStart = fsStart[m].Geometry as GSOGeoPolyline3D; - if (lineFsStart != null && lineFsStart.PartCount > 0) - { - GSOPoint3ds psAdd = new GSOPoint3ds(); - for (int k = line[0].Count - 1; k >= 0; k--) - { - psAdd.Add(line[0][k]); - } - for (int k = 0; k < lineFsStart[0].Count; k++) - { - psAdd.Add(lineFsStart[0][k]); - } - - listPS = getFeaturesPoints(fsStart[m], lineFsStart[0][lineFsStart[0].Count - 1], selectFeatures, psAdd, listPS); - - } - } - } - //3.6 将featureInOutPolygon的所有点和与之终点相连的线的所有点组成一个点的集合并添加到listPS中 - else if (fsStart.Length == 0 && fsEnd.Length > 0) - { - for (int n = 0; n < fsEnd.Length; n++) - { - GSOGeoPolyline3D lineFsEnd = fsEnd[n].Geometry as GSOGeoPolyline3D; - if (lineFsEnd != null && lineFsEnd.PartCount > 0) - { - GSOPoint3ds psAdd = new GSOPoint3ds(); - for (int k = 0; k < line[0].Count - 1; k++) - { - psAdd.Add(line[0][k]); - } - for (int k = 0; k < lineFsEnd[0].Count; k++) - { - psAdd.Add(lineFsEnd[0][k]); - } - //获取线fsEnd[n]的另一个端点相连的线并记录该线的点的集合 - listPS = getFeaturesPoints(fsEnd[n], lineFsEnd[0][lineFsEnd[0].Count - 1], selectFeatures, psAdd, listPS); - } - } - } - } - - //3.7 获取所有以featureInOutPolygon为起点的点的集合组成的线中的最长的线 - double maxLength = 0; - GSOFeature featureNew = new GSOFeature(); - for (int h = 0; h < listPS.Count; h++) - { - GSOGeoPolyline3D lineNew = new GSOGeoPolyline3D(); - lineNew.AddPart(listPS[h]); - GSOLabel label = new GSOLabel(); - label.Text = h.ToString(); - featureNew.Label = label; - double length = lineNew.GetSpaceLength(true, 6378137); - if (length > maxLength) - { - featureNew.Geometry = lineNew; - } - } - - return featureNew; - } - /// /// 更新最大最小状态 /// /// @@ -8340,219 +6789,6 @@ - private void buttonItem139_Click(object sender, EventArgs e) - { - - string filepath = ""; - //日志记录 - OpenFileDialog dlg = new OpenFileDialog(); - dlg.Filter = "矢量数据(*.shp)|*.shp|矢量数据(*.lgd)|*.lgd|全部支持格式(*.lgd,*.shp)|*.lgd;*.shp;"; - //dlg.Filter = "支持格式(*.lrp,*.tif,*.img,*.lrc,*.kml,*.lgd,*.shp,*.gft)|*.lrp;*.tif;*.img;*.lrc;*.kml;*.lgd;*.shp;*.gft|栅格数据(*.lrp)|*.lrp|栅格缓存(*.lrc)|*.lrc|KML数据(*.kml)|*.kml|矢量数据(*.lgd)|*.lgd|矢量缓存(*.gft)|*.gft|其它格式(*.*)|*.*||"; - dlg.Multiselect = true; - if (dlg.ShowDialog() == DialogResult.OK) - { - //自定义lprj文件名,从程序中复制一lprj文件。 - int bindex = dlg.FileName.Split('\\').Length; - string lastname = dlg.FileName.Split('\\')[bindex - 1]; - - for (int i = 0; i < dlg.FileNames.Length; i++) - { - string strDataPath = dlg.FileNames[i]; - filepath = strDataPath; - - GSOLayer layer = globeControl1.Globe.Layers.Add(strDataPath); - - } - - } - //放大到红线 - - - // globeControl1.Globe.Layers.MoveTo(0, globeControl1.Globe.Layers.Count - 1); - // globeControl1.Globe.Layers.MoveTo(0,4); - globeControl1.Refresh(); - - - } - /// - /// - /// - /// - /// - private void buttonItem142_Click(object sender, EventArgs e) - { - //获得红线polygon - //GSOLayer layerSevenLine = globeControl1.Globe.Layers.GetLayerByCaption(redlinelayername); - - GSOLayer layerSevenLine = globeControl1.Globe.Layers.Add("D:\\data\\歌林小镇shp\\test.shp"); - //获得红线结果列表 - ArrayList rrLists = new ArrayList(); - - //if (redlinelayername != "") - { - GSOFeatures fs = layerSevenLine.GetAllFeatures(); - int len = fs.Length; - - GSOGeoPolygon3D sevenPolygon = new GSOGeoPolygon3D(); - for (int k = 0; k < len; k++) - {//多根红线 - ///////生成红线区域/////// - GSOFeature featSevenLine = layerSevenLine.GetAt(k); - GSOGeoPolyline3D sevenLine = featSevenLine.Geometry as GSOGeoPolyline3D; - - List sevenParts = new List(); - for (int i = 0; i < sevenLine.PartCount; i++) - { - sevenParts.Add(sevenLine[i]); - } - for (int i = 0; i < sevenParts.Count; i++) - { - sevenPolygon.AddPart((GSOPoint3ds)sevenParts[i]); - } - /////拼出红线多边形over////// - - } - //GSOLayer layer = globeControl1.Globe.Layers.GetLayerByCaption("天然气管线"); - - GSOLayer layer = globeControl1.Globe.Layers.Add("C:\\Users\\nn-203\\Desktop\\xiaobai\\test.lgd"); - //线切割面定义,输出用 - GSOFeatures resFeats = new GSOFeatures(); - int resultstyle = 0; - //管线切割红线区域后,面积较小的区域 - GSOGeoPolygon3D restPoly = new GSOGeoPolygon3D(); - List inpts = new List(); - if (layer != null) - { - //红线区域 - GSOFeature sevenfeature = new GSOFeature(); - sevenfeature.Geometry = sevenPolygon; - - //获取不完全包含在面中的所有线 - GSOFeatures feats = layer.FindFeaturesInPolygon(sevenPolygon, false); - //获取完全包含在面中的所有线 - GSOFeatures featsTrue = layer.FindFeaturesInPolygon(sevenPolygon, true); - //获取面中所有对象组成的切割面的长线 - GSOFeature feature = new GSOFeature(); - - feature = getLineFromGSOFeatures(feats, featsTrue);//管线多个feature拼成一个feature - - //globeControl1.Globe.MemoryLayer.AddFeature(feature); - //globeControl1.Globe.MemoryLayer.AddFeature(sevenfeature); - if (feature != null) - { - //线切割面,输出 - //feature.HighLight = true; - GSODataEngineUtility.GSLineClipPolygon(feature, sevenfeature, out resFeats, out resultstyle); - } - else - { - MessageBox.Show("没有找到切割面的线对象!"); - } - ////////////////绘制分割后的多边形/////////////// - for (int a = 0; a < resFeats.Length; a++) - { - - GSOFeature gf = resFeats[1]; - globeControl1.Globe.MemoryLayer.AddFeature(gf); - - } - } - - - } - } - - private void buttonItem143_Click(object sender, EventArgs e) - { - //获得红线polygon - GSOLayer layerSevenLine = globeControl1.Globe.Layers.Add("d:\\lineAndPolygon.lgd"); - GSOLayer layerSevenLine2 = globeControl1.Globe.Layers.GetLayerByCaption("d:\\lineAndPolygon.lgd"); - //获得红线结果列表 - ArrayList rrLists = new ArrayList(); - - - // if (redlinelayername != "") - { - GSOFeatures fs = layerSevenLine.GetAllFeatures(); - int len = fs.Length; - - GSOGeoPolyline3D linetest = new GSOGeoPolyline3D(); - GSOGeoPolygon3D sevenPolygon = new GSOGeoPolygon3D(); - - GSOFeature linefeat = fs.FindByID(2); - //linefeat.Geometry = linetest; - GSOFeature polyfeat = fs.FindByID(1); - //polyfeat.Geometry = sevenPolygon; - - //线切割面定义,输出用 - GSOFeatures resFeats = new GSOFeatures(); - int resultstyle = 0; - GSODataEngineUtility.GSLineClipPolygon(linefeat, polyfeat, out resFeats, out resultstyle); - - ////////////////绘制分割后的多边形/////////////// - for (int a = 0; a < resFeats.Length; a++) - { - - GSOFeature gf = resFeats[0]; - globeControl1.Globe.MemoryLayer.AddFeature(gf); - - } - ////把红线切成一段段的线段,获得切前的红线点集 - List redpts = new List();//切前的红线点集合 - for (int i = 0; i < linetest.PartCount; i++) - { - GSOPoint3ds partP = linetest[i]; - for (int j = 0; j < partP.Count; j++) - { - redpts.Add(partP[j]); - } - } - - List redpts2 = new List();//切前的红线点集合 - for (int i = 0; i < sevenPolygon.PartCount; i++) - { - GSOPoint3ds partP = sevenPolygon[i]; - for (int j = 0; j < partP.Count; j++) - { - redpts2.Add(partP[j]); - } - } - } - } - /// - /// 增加用户手册下载连接 - /// - /// - /// - Cyberpipe.udfiles.UpDownFile UDF = new udfiles.UpDownFile(Utility.udserviceurl); - string dir_Ok = "C:\\Users\\nn-203\\Desktop"; - private void button1_Click(object sender, EventArgs e) - { - if (folderBrowserDialog1.ShowDialog() == DialogResult.OK) //打洙?开a文?件t夹D对?话°框ò - { - dir_Ok = folderBrowserDialog1.SelectedPath; //显?示?选?择?的?文?件t夹D路·径? - - //tempstr = folderBrowserDialog1.SelectedPath; //存?储洹?选?择?的?文?件t夹D路·径? - - } - - Cyberpipe.PED_logicfile.PED_Affair.Redact_D = Utility.uploadpath + "\\SFiles\\UserHbook\\说明.docx"; - if (File.Exists(dir_Ok + "\\" + Files_Name(Cyberpipe.PED_logicfile.PED_Affair.Redact_D, 1))) - { - if (MessageBox.Show("文件夹下有同名文件,是否替换?", "提示", MessageBoxButtons.YesNo, MessageBoxIcon.Information) == DialogResult.No) ; - - } - byte[] file = UDF.Down(Cyberpipe.PED_logicfile.PED_Affair.Redact_D); - FileStream pFileSream = new FileStream(dir_Ok + "\\说明.docx", FileMode.OpenOrCreate); - pFileSream.Write(file, 0, file.Length); - pFileSream.Close(); - if (File.Exists(dir_Ok + "\\" + Files_Name(Cyberpipe.PED_logicfile.PED_Affair.Redact_D, 1)) == true) - { - MessageBox.Show("文件导出成功!"); - } - //PEDAClass.Folder_Handle(dir_Ok + "\\" + PEDAClass.Files_Name(Cyberpipe.PED_logicfile.PED_Affair.Redact_D, 0), Cyberpipe.PED_logicfile.PED_Affair.Redact_D, "", 0); - - } /// /// 获取文件或文件夹的名称 /// @@ -8575,33 +6811,6 @@ return DF_Name; } - private void toolStripDropDownButton1_Click(object sender, EventArgs e) - { - if (folderBrowserDialog1.ShowDialog() == DialogResult.OK) //打洙?开a文?件t夹D对?话°框ò - { - dir_Ok = folderBrowserDialog1.SelectedPath; //显?示?选?择?的?文?件t夹D路·径? - - //tempstr = folderBrowserDialog1.SelectedPath; //存?储洹?选?择?的?文?件t夹D路·径? - - - Cyberpipe.PED_logicfile.PED_Affair.Redact_D = Utility.uploadpath + "\\SFiles\\UserHbook\\说明.docx"; - if (File.Exists(dir_Ok + "\\" + Files_Name(Cyberpipe.PED_logicfile.PED_Affair.Redact_D, 1))) - { - if (MessageBox.Show("文件夹下有同名文件,是否替换?", "提示", MessageBoxButtons.YesNo, MessageBoxIcon.Information) == DialogResult.No) ; - - } - byte[] file = UDF.Down(Cyberpipe.PED_logicfile.PED_Affair.Redact_D); - FileStream pFileSream = new FileStream(dir_Ok + "\\说明.docx", FileMode.OpenOrCreate); - pFileSream.Write(file, 0, file.Length); - pFileSream.Close(); - if (File.Exists(dir_Ok + "\\" + Files_Name(Cyberpipe.PED_logicfile.PED_Affair.Redact_D, 1)) == true) - { - MessageBox.Show("文件导出成功!"); - } - - } - } - /// /// 空间查询 /// @@ -9792,7 +8001,7 @@ GSOLayer resLayer = null; GSOFeature resFeature = null; globeControl1.Globe.GetSelectObject(0, out resFeature, out resLayer); - + if (resFeature == null) return; GSOGeoPolyline3D line1 = resFeature.Geometry as GSOGeoPolyline3D; if (line1 == null) { @@ -9876,7 +8085,7 @@ GSOLayer resLayer = null; GSOFeature resFeature = null; globeControl1.Globe.GetSelectObject(0, out resFeature, out resLayer); - + if (resFeature == null) return; GSOGeoPolyline3D line1 = resFeature.Geometry as GSOGeoPolyline3D; if (line1 == null) { @@ -9891,7 +8100,8 @@ } GSOFeatures feats = globeControl1.Globe.MemoryLayer.GetFeatureByName("粒子要素", true); - if (feats.Length > 0) + + if (feats!=null&&feats.Length > 0) globeControl1.Globe.MemoryLayer.RemoveFeatureByID(feats[0].ID); //if (emitterFeature != null) //{ @@ -11121,88 +9331,6 @@ } private int connectServerCount = 0; - - /// - /// 还原球到实测库 - /// - private void refreshGlobe1() - { - //添加实测库图层已有图层 - int servernum = 0; - //1.清除global1上 - for (int i = globeControl1.Globe.Layers.Count - 1; i >= 0; i--) - { - GSOLayer layer = globeControl1.Globe.Layers[i]; - if (!layer.Name.Contains("fttp:")) - { - layer.Dataset.Close();//清除内存 - globeControl1.Globe.Layers.Remove(layer); - } - else - { - servernum++; - } - } - - //globeControl1.Globe.ConnectServer(Utility.serverip, Utility.serverport, "", ""); //加载locaServer中的数据 - - //2.添加实测库图层 - string[] markerStrs = new string[9]; - markerStrs[0] = "标高标注"; - markerStrs[1] = "管径标注"; - markerStrs[2] = "埋深标注"; - markerStrs[3] = "坐标标注"; - markerStrs[4] = "坡度标注"; - markerStrs[5] = "属性标注"; - markerStrs[6] = "自定义标注"; - markerStrs[7] = "距离标注"; - markerStrs[8] = "扯旗标注"; - for (int i = 0; i < markerStrs.Length; i++) - { - if (File.Exists(Application.StartupPath + "\\标注管理\\" + markerStrs[i] + ".lgd")) - { - GSOLayer markerLayer = globeControl1.Globe.Layers.Add(Application.StartupPath + "\\标注管理\\" + markerStrs[i] + ".lgd"); - } - } - - for (int i = 0; i < g1layername.Count; i++) - { - string g1name = g1layername[i]; - GSODataset datasetg1 = Utility.dataSource.GetDatasetByName(g1name); - GSOLayer templayer = globeControl1.Globe.Layers.Add(datasetg1); - templayer.MaxVisibleAltitude = -1; - } - layerTemp = globeControl1.Globe.Layers.Add(Application.StartupPath + "\\tempLgdData.lgd"); - globeControl1.Globe.Layers.Add(Application.StartupPath + "/城市七线/城市红线.lgd"); - globeControl1.Globe.Layers.Add(Application.StartupPath + "/城市七线/城市橙线.lgd"); - globeControl1.Globe.Layers.Add(Application.StartupPath + "/城市七线/城市黄线.lgd"); - globeControl1.Globe.Layers.Add(Application.StartupPath + "/城市七线/城市绿线.lgd"); - globeControl1.Globe.Layers.Add(Application.StartupPath + "/城市七线/城市蓝线.lgd"); - globeControl1.Globe.Layers.Add(Application.StartupPath + "/城市七线/城市紫线.lgd"); - globeControl1.Globe.Layers.Add(Application.StartupPath + "/城市七线/城市黑线.lgd"); - globeControl1.Globe.Layers.Add(Application.StartupPath + "/隧道.lgd"); - - //移动server的数据图层 - for (int i = 0; i < servernum; i++) - { - globeControl1.Globe.Layers.MoveTo(globeControl1.Globe.Layers.Count - 1, 0); - } - - if (layerManagerNode.Nodes.Count > 0) - { - for (int i = layerManagerNode.Nodes.Count - 1; i >= 0; i--) - { - layerManagerNode.Nodes[i].Remove(); - - } - } - - - - globeControl1.Refresh(); - - } - /// /// 碰撞审查 /// @@ -11476,31 +9604,7 @@ // } //} #endregion - /// - /// 数据质量检查 - /// - /// - /// - private void buttonItemSJGL2_Click(object sender, EventArgs e) - { - //日志记录 - LogManager.saveLog(Utility.userName, this.buttonItemSJGL2.Text); - FrmValiData frm = new FrmValiData(globeControl1); - frm.ShowDialog(); - } - /// - /// 数据预处理 - /// - /// - /// - private void buttonItemSJGL3_Click(object sender, EventArgs e) - { - //保存日志 - LogManager.saveLog(Utility.userName, this.buttonItemSJGL3.Text); - FrmEditShapeFile frm = new FrmEditShapeFile(globeControl1); - frm.ShowDialog(this); - } /// /// 连接数据库 /// @@ -12251,60 +10355,6 @@ List lineStruct = new List(); GSOFeature featureSelected = null; - private void AddDatagridView(DataTable table) - { - - if (table != null && table.Rows.Count > 0) - { - dataGridViewX1.DataSource = table; - panelOfTable.Visible = true; - panelOfTable.Height = 200; - toolStripNumbers.Text = "红线审核结果"; - toolStripFeatureLength.Text = " 共有:" + table.Rows.Count + "条"; - } - else - { - - } - - } - - /// - /// 去除集合中重复的管线 - /// - /// - /// - /// - private GSOFeatures getFeaturesByFilter(GSOFeatures features, string fieldName) - { - if (features == null) - { - return null; - } - GSOFeatures featuresGet = new GSOFeatures(); - for (int i = 0; i < features.Length; i++) - { - GSOFeature featureFromFS = features[i]; - string fieldValueFromFS = featureFromFS.GetValue(fieldName).ToString().Trim(); - bool isHas = false; - for (int j = featuresGet.Length - 1; j >= 0; j--) - { - GSOFeature featureFromFSGet = featuresGet[j]; - string fieldValueFromFSGet = featureFromFSGet.GetValue(fieldName).ToString().Trim(); - if (fieldValueFromFS.Equals(fieldValueFromFSGet)) - { - isHas = true; - break; - } - } - if (isHas == false) - { - featuresGet.Add(featureFromFS.Clone()); - } - } - return featuresGet; - } - /// /// 数据管理导入文件 /// @@ -12440,138 +10490,7 @@ // //MessageBox.Show("系统运行错误:" + ex.ToString(), "错误", MessageBoxButtons.OK, MessageBoxIcon.Error); // } //} - - - /// - /// 标识器全区域统计 - /// - /// - /// - private void 标识器分类统计ToolStripMenuItem_Click(object sender, EventArgs e) - { - globeControl1.Globe.Action = EnumAction3D.ActionNull; - FrmBSQStatis bsqStatis = new FrmBSQStatis(); - bsqStatis.Show(this); - } - /// - /// 标识器绘制区域统计 - /// - /// - /// - private void 标识器分类统计ToolStripMenuItem1_Click(object sender, EventArgs e) - { - trackflag = "BSQDuoBianXiangStatis"; - globeControl1.Globe.Action = EnumAction3D.TrackPolygon; - } - - - #region 保存和加载审核库加载的图层 - private void saveLayerList(TreeNodeCollection treeNodeList) - { - string configPath = Application.StartupPath + "\\configLayerList.xml"; - try - { - XmlDocument doc = new XmlDocument(); - doc.Load(configPath); - XmlNode dbParams = doc.SelectSingleNode("Params/dbparams"); - XmlNode dbLayers = doc.SelectSingleNode("Params/dblayers"); - XmlNode layers = doc.SelectSingleNode("Params/layers"); - dbParams.RemoveAll(); - dbLayers.RemoveAll(); - layers.RemoveAll(); - - List listDS = new List(); - String shDatasourceName = Utility.sgdbip + "/" + Utility.sgdbname + "_" + Utility.sgdbuser; - bool flag = false; - - for (int i = 0; i < globeControl1.Globe.DataManager.DataSourceCount; i++) - { - GSODataSource ds = globeControl1.Globe.DataManager.GetDataSourceAt(i); - if (ds != null && ds.Type == EnumDataSourceType.SqlServer || ds.Type == EnumDataSourceType.Oracle) - { - if (ds.Name == shDatasourceName) - { - //防止因为多次连接同一个数据库 - if (flag == true) - { - break; - } - flag = true; - listDS.Add(ds); - GSODataSourceCnn conn = ds.GetConnectionInfo(); - - XmlElement dbparam = doc.CreateElement("shdbparam"); - XmlElement ip = doc.CreateElement("ship"); - ip.InnerText = conn.Server; - - XmlElement dbname = doc.CreateElement("shdbname"); - dbname.InnerText = conn.Database; - - XmlElement username = doc.CreateElement("shusername"); - username.InnerText = conn.User; - - XmlElement password = doc.CreateElement("shpassword"); - password.InnerText = conn.Password; - - XmlElement type = doc.CreateElement("shtype"); - if (ds.Type == EnumDataSourceType.SqlServer) - { - type.InnerText = "sqlserver"; - } - else - { - type.InnerText = "oracle"; - } - - dbparam.AppendChild(ip); - dbparam.AppendChild(dbname); - dbparam.AppendChild(username); - dbparam.AppendChild(password); - dbparam.AppendChild(type); - dbParams.AppendChild(dbparam); - } - - } - } - - for (int i = 0; i < treeNodeList.Count; i++) - { - GSOLayer layer = treeNodeList[i].Tag as GSOLayer; - if (Path.GetExtension(layer.Name) == "") - { - XmlElement dbLayer = doc.CreateElement("dblayer"); - XmlAttribute attri = doc.CreateAttribute("dbindex"); - for (int j = 0; j < listDS.Count; j++) - { - if (layer.Dataset.DataSource.Name == listDS[j].Name) - { - attri.Value = j.ToString(); - break; - } - } - dbLayer.Attributes.Append(attri); - dbLayer.InnerText = layer.Name; - - dbLayers.AppendChild(dbLayer); - } - else - { - XmlElement dbLayer = doc.CreateElement("layer"); - dbLayer.InnerText = layer.Name; - layers.AppendChild(dbLayer); - } - } - - doc.Save(configPath); - } - catch (Exception e) - { - - } - } - - #endregion - + private void buttonItem_TaskManager_Click(object sender, EventArgs e) { if (Form_TaksManager.IS_OPEN) diff --git a/MainFrm.designer.cs b/MainFrm.designer.cs index 233ef8c..97b8299 100644 --- a/MainFrm.designer.cs +++ b/MainFrm.designer.cs @@ -82,6 +82,7 @@ this.sideBar1 = new DevComponents.DotNetBar.SideBar(); this.panelEx3 = new DevComponents.DotNetBar.PanelEx(); this.layerSensorTree = new System.Windows.Forms.TreeView(); + this.layerTree = new Cyberpipe.MyTreeView(); this.sideBarPanelItem3 = new DevComponents.DotNetBar.SideBarPanelItem(); this.controlContainerItem3 = new DevComponents.DotNetBar.ControlContainerItem(); this.sideBarPanelItem4 = new DevComponents.DotNetBar.SideBarPanelItem(); @@ -365,30 +366,26 @@ this.可编辑ToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); this.保存ToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); this.ribbonControl1 = new DevComponents.DotNetBar.RibbonControl(); - this.ribbonPanel1 = new DevComponents.DotNetBar.RibbonPanel(); - this.ribbonBar21 = new DevComponents.DotNetBar.RibbonBar(); - this.buttonItem87 = new DevComponents.DotNetBar.ButtonItem(); - this.buttonItem88 = new DevComponents.DotNetBar.ButtonItem(); - this.buttonItem27 = new DevComponents.DotNetBar.ButtonItem(); - this.buttonItem91 = new DevComponents.DotNetBar.ButtonItem(); - this.buttonItem1 = new DevComponents.DotNetBar.ButtonItem(); - this.btnlegendSet = new DevComponents.DotNetBar.ButtonItem(); - this.buttonItem89 = new DevComponents.DotNetBar.ButtonItem(); - this.ribbonPanel7 = new DevComponents.DotNetBar.RibbonPanel(); - this.ribbonBar5 = new DevComponents.DotNetBar.RibbonBar(); - this.btn_flag = new DevComponents.DotNetBar.ButtonItem(); - this.slider4ground = new DevComponents.DotNetBar.SliderItem(); - this.ribbonPanel2 = new DevComponents.DotNetBar.RibbonPanel(); - this.ribbonBar4 = new DevComponents.DotNetBar.RibbonBar(); - this.buttonItem_TaskManager = new DevComponents.DotNetBar.ButtonItem(); - this.buttonItem_OnlineTask = new DevComponents.DotNetBar.ButtonItem(); - this.buttonItem_Event = new DevComponents.DotNetBar.ButtonItem(); this.ribbonPanel3 = new DevComponents.DotNetBar.RibbonPanel(); this.ribbonBar3 = new DevComponents.DotNetBar.RibbonBar(); this.btn_device = new DevComponents.DotNetBar.ButtonItem(); this.btn_Person = new DevComponents.DotNetBar.ButtonItem(); this.btn_constructMap = new DevComponents.DotNetBar.ButtonItem(); this.buttonItem9 = new DevComponents.DotNetBar.ButtonItem(); + this.ribbonPanel2 = new DevComponents.DotNetBar.RibbonPanel(); + this.ribbonBar4 = new DevComponents.DotNetBar.RibbonBar(); + this.buttonItem_TaskManager = new DevComponents.DotNetBar.ButtonItem(); + this.buttonItem_OnlineTask = new DevComponents.DotNetBar.ButtonItem(); + this.buttonItem_Event = new DevComponents.DotNetBar.ButtonItem(); + this.ribbonPanel1 = new DevComponents.DotNetBar.RibbonPanel(); + this.ribbonBar21 = new DevComponents.DotNetBar.RibbonBar(); + this.buttonItem87 = new DevComponents.DotNetBar.ButtonItem(); + this.buttonItem88 = new DevComponents.DotNetBar.ButtonItem(); + this.buttonItem27 = new DevComponents.DotNetBar.ButtonItem(); + this.buttonItem1 = new DevComponents.DotNetBar.ButtonItem(); + this.buttonItem91 = new DevComponents.DotNetBar.ButtonItem(); + this.btnlegendSet = new DevComponents.DotNetBar.ButtonItem(); + this.buttonItem89 = new DevComponents.DotNetBar.ButtonItem(); this.ribbonPanel8 = new DevComponents.DotNetBar.RibbonPanel(); this.ribbonBar_UserInfo = new DevComponents.DotNetBar.RibbonBar(); this.btn_user_info = new DevComponents.DotNetBar.ButtonItem(); @@ -398,6 +395,10 @@ this.btn_user_role = new DevComponents.DotNetBar.ButtonItem(); this.btn_password_edit = new DevComponents.DotNetBar.ButtonItem(); this.btn_reset_password = new DevComponents.DotNetBar.ButtonItem(); + this.ribbonPanel7 = new DevComponents.DotNetBar.RibbonPanel(); + this.ribbonBar5 = new DevComponents.DotNetBar.RibbonBar(); + this.btn_flag = new DevComponents.DotNetBar.ButtonItem(); + this.slider4ground = new DevComponents.DotNetBar.SliderItem(); this.ribbonPanel15 = new DevComponents.DotNetBar.RibbonPanel(); this.ribbonBar20 = new DevComponents.DotNetBar.RibbonBar(); this.buttonItemSJGL = new DevComponents.DotNetBar.ButtonItem(); @@ -610,7 +611,6 @@ this.buttonItem84 = new DevComponents.DotNetBar.ButtonItem(); this.buttonItem75 = new DevComponents.DotNetBar.ButtonItem(); this.buttonItem76 = new DevComponents.DotNetBar.ButtonItem(); - this.layerTree = new Cyberpipe.MyTreeView(); this.statusStrip1.SuspendLayout(); this.sideBar1.SuspendLayout(); this.panelEx3.SuspendLayout(); @@ -647,11 +647,11 @@ this.contextMenuStrip3.SuspendLayout(); this.contextMenuStripDeleteLayerNode.SuspendLayout(); this.ribbonControl1.SuspendLayout(); - this.ribbonPanel1.SuspendLayout(); - this.ribbonPanel7.SuspendLayout(); - this.ribbonPanel2.SuspendLayout(); this.ribbonPanel3.SuspendLayout(); + this.ribbonPanel2.SuspendLayout(); + this.ribbonPanel1.SuspendLayout(); this.ribbonPanel8.SuspendLayout(); + this.ribbonPanel7.SuspendLayout(); this.ribbonPanel15.SuspendLayout(); ((System.ComponentModel.ISupportInitialize)(this.pictureBox1)).BeginInit(); this.SuspendLayout(); @@ -813,7 +813,6 @@ this.toolStripDropDownButton1.Size = new System.Drawing.Size(45, 21); this.toolStripDropDownButton1.Text = "帮助"; this.toolStripDropDownButton1.Visible = false; - this.toolStripDropDownButton1.Click += new System.EventHandler(this.toolStripDropDownButton1_Click); // // controlContainerItem1 // @@ -1047,6 +1046,16 @@ this.layerSensorTree.AfterCheck += new System.Windows.Forms.TreeViewEventHandler(this.layerMarkerTree_AfterCheck); this.layerSensorTree.NodeMouseClick += new System.Windows.Forms.TreeNodeMouseClickEventHandler(this.layerMarkerTree_NodeMouseClick); // + // layerTree + // + this.layerTree.CheckBoxes = true; + this.layerTree.ItemHeight = 18; + this.layerTree.Location = new System.Drawing.Point(30, 78); + this.layerTree.Name = "layerTree"; + this.layerTree.Size = new System.Drawing.Size(121, 97); + this.layerTree.TabIndex = 1; + this.layerTree.AfterCheck += new System.Windows.Forms.TreeViewEventHandler(this.layerTree_AfterCheck); + // // sideBarPanelItem3 // this.sideBarPanelItem3.FontBold = true; @@ -2966,28 +2975,28 @@ // 平移对象ToolStripMenuItem // this.平移对象ToolStripMenuItem.Name = "平移对象ToolStripMenuItem"; - this.平移对象ToolStripMenuItem.Size = new System.Drawing.Size(152, 22); + this.平移对象ToolStripMenuItem.Size = new System.Drawing.Size(124, 22); this.平移对象ToolStripMenuItem.Text = "平移对象"; this.平移对象ToolStripMenuItem.Click += new System.EventHandler(this.buttonItemBJ6_Click); // // 升降对象ToolStripMenuItem // this.升降对象ToolStripMenuItem.Name = "升降对象ToolStripMenuItem"; - this.升降对象ToolStripMenuItem.Size = new System.Drawing.Size(152, 22); + this.升降对象ToolStripMenuItem.Size = new System.Drawing.Size(124, 22); this.升降对象ToolStripMenuItem.Text = "升降对象"; this.升降对象ToolStripMenuItem.Click += new System.EventHandler(this.buttonItemBJ7_Click); // // 旋转对象ToolStripMenuItem // this.旋转对象ToolStripMenuItem.Name = "旋转对象ToolStripMenuItem"; - this.旋转对象ToolStripMenuItem.Size = new System.Drawing.Size(152, 22); + this.旋转对象ToolStripMenuItem.Size = new System.Drawing.Size(124, 22); this.旋转对象ToolStripMenuItem.Text = "旋转对象"; this.旋转对象ToolStripMenuItem.Click += new System.EventHandler(this.buttonItemBJ8_Click); // // 连接管段ToolStripMenuItem // this.连接管段ToolStripMenuItem.Name = "连接管段ToolStripMenuItem"; - this.连接管段ToolStripMenuItem.Size = new System.Drawing.Size(152, 22); + this.连接管段ToolStripMenuItem.Size = new System.Drawing.Size(124, 22); this.连接管段ToolStripMenuItem.Text = "连接管段"; this.连接管段ToolStripMenuItem.Click += new System.EventHandler(this.buttonItemBJ9_Click); // @@ -2997,34 +3006,34 @@ this.导出CADToolStripMenuItem, this.导出文件ToolStripMenuItem1}); this.导出文件ToolStripMenuItem.Name = "导出文件ToolStripMenuItem"; - this.导出文件ToolStripMenuItem.Size = new System.Drawing.Size(152, 22); + this.导出文件ToolStripMenuItem.Size = new System.Drawing.Size(124, 22); this.导出文件ToolStripMenuItem.Text = "导出矢量"; // // 导出CADToolStripMenuItem // this.导出CADToolStripMenuItem.Name = "导出CADToolStripMenuItem"; - this.导出CADToolStripMenuItem.Size = new System.Drawing.Size(152, 22); + this.导出CADToolStripMenuItem.Size = new System.Drawing.Size(125, 22); this.导出CADToolStripMenuItem.Text = "导出CAD"; this.导出CADToolStripMenuItem.Click += new System.EventHandler(this.buttonItemBJ10_1_Click); // // 导出文件ToolStripMenuItem1 // this.导出文件ToolStripMenuItem1.Name = "导出文件ToolStripMenuItem1"; - this.导出文件ToolStripMenuItem1.Size = new System.Drawing.Size(152, 22); + this.导出文件ToolStripMenuItem1.Size = new System.Drawing.Size(125, 22); this.导出文件ToolStripMenuItem1.Text = "导出文件"; this.导出文件ToolStripMenuItem1.Click += new System.EventHandler(this.buttonItemBJ10_2_Click); // // 前进ToolStripMenuItem // this.前进ToolStripMenuItem.Name = "前进ToolStripMenuItem"; - this.前进ToolStripMenuItem.Size = new System.Drawing.Size(152, 22); + this.前进ToolStripMenuItem.Size = new System.Drawing.Size(124, 22); this.前进ToolStripMenuItem.Text = "前进"; this.前进ToolStripMenuItem.Click += new System.EventHandler(this.buttonItemBJ12_Click); // // 删除模型ToolStripMenuItem // this.删除模型ToolStripMenuItem.Name = "删除模型ToolStripMenuItem"; - this.删除模型ToolStripMenuItem.Size = new System.Drawing.Size(152, 22); + this.删除模型ToolStripMenuItem.Size = new System.Drawing.Size(124, 22); this.删除模型ToolStripMenuItem.Text = "后退"; this.删除模型ToolStripMenuItem.Click += new System.EventHandler(this.buttonItemBJ11_Click); // @@ -4160,6 +4169,198 @@ this.ribbonControl1.Text = "ribbonControl1"; this.ribbonControl1.UseCustomizeDialog = false; // + // ribbonPanel3 + // + this.ribbonPanel3.ColorSchemeStyle = DevComponents.DotNetBar.eDotNetBarStyle.StyleManagerControlled; + this.ribbonPanel3.Controls.Add(this.ribbonBar3); + this.ribbonPanel3.Dock = System.Windows.Forms.DockStyle.Fill; + this.ribbonPanel3.Location = new System.Drawing.Point(0, 33); + this.ribbonPanel3.Name = "ribbonPanel3"; + this.ribbonPanel3.Padding = new System.Windows.Forms.Padding(3, 0, 3, 3); + this.ribbonPanel3.Size = new System.Drawing.Size(1328, 62); + // + // + // + this.ribbonPanel3.Style.Class = ""; + this.ribbonPanel3.Style.CornerType = DevComponents.DotNetBar.eCornerType.Square; + // + // + // + this.ribbonPanel3.StyleMouseDown.Class = ""; + this.ribbonPanel3.StyleMouseDown.CornerType = DevComponents.DotNetBar.eCornerType.Square; + // + // + // + this.ribbonPanel3.StyleMouseOver.Class = ""; + this.ribbonPanel3.StyleMouseOver.CornerType = DevComponents.DotNetBar.eCornerType.Square; + this.ribbonPanel3.TabIndex = 40; + // + // ribbonBar3 + // + this.ribbonBar3.AutoOverflowEnabled = true; + // + // + // + this.ribbonBar3.BackgroundMouseOverStyle.Class = ""; + this.ribbonBar3.BackgroundMouseOverStyle.CornerType = DevComponents.DotNetBar.eCornerType.Square; + // + // + // + this.ribbonBar3.BackgroundStyle.Class = ""; + this.ribbonBar3.BackgroundStyle.CornerType = DevComponents.DotNetBar.eCornerType.Square; + this.ribbonBar3.ContainerControlProcessDialogKey = true; + this.ribbonBar3.Dock = System.Windows.Forms.DockStyle.Left; + this.ribbonBar3.Items.AddRange(new DevComponents.DotNetBar.BaseItem[] { + this.btn_device, + this.btn_Person, + this.btn_constructMap, + this.buttonItem9}); + this.ribbonBar3.Location = new System.Drawing.Point(3, 0); + this.ribbonBar3.Name = "ribbonBar3"; + this.ribbonBar3.Size = new System.Drawing.Size(378, 59); + this.ribbonBar3.Style = DevComponents.DotNetBar.eDotNetBarStyle.StyleManagerControlled; + this.ribbonBar3.TabIndex = 0; + // + // + // + this.ribbonBar3.TitleStyle.Class = ""; + this.ribbonBar3.TitleStyle.CornerType = DevComponents.DotNetBar.eCornerType.Square; + // + // + // + this.ribbonBar3.TitleStyleMouseOver.Class = ""; + this.ribbonBar3.TitleStyleMouseOver.CornerType = DevComponents.DotNetBar.eCornerType.Square; + this.ribbonBar3.TitleVisible = false; + // + // btn_device + // + this.btn_device.ButtonStyle = DevComponents.DotNetBar.eButtonStyle.ImageAndText; + this.btn_device.Image = global::Cyberpipe.Properties.Resources._24X24__2__02; + this.btn_device.ImagePosition = DevComponents.DotNetBar.eImagePosition.Top; + this.btn_device.Name = "btn_device"; + this.btn_device.SubItemsExpandWidth = 14; + this.btn_device.Text = "探测仪管理"; + this.btn_device.Click += new System.EventHandler(this.btn_device_Click); + // + // btn_Person + // + this.btn_Person.ButtonStyle = DevComponents.DotNetBar.eButtonStyle.ImageAndText; + this.btn_Person.Image = global::Cyberpipe.Properties.Resources._24x24icon_05_hover1; + this.btn_Person.ImagePosition = DevComponents.DotNetBar.eImagePosition.Top; + this.btn_Person.Name = "btn_Person"; + this.btn_Person.SubItemsExpandWidth = 14; + this.btn_Person.Text = "定位人员维护"; + this.btn_Person.Click += new System.EventHandler(this.btn_Person_Click); + // + // btn_constructMap + // + this.btn_constructMap.Image = global::Cyberpipe.Properties.Resources._24x24icon_04_hover; + this.btn_constructMap.ImagePosition = DevComponents.DotNetBar.eImagePosition.Top; + this.btn_constructMap.Name = "btn_constructMap"; + this.btn_constructMap.SubItemsExpandWidth = 14; + this.btn_constructMap.Text = "导出施工图"; + this.btn_constructMap.Click += new System.EventHandler(this.btn_constructMap_Click); + // + // buttonItem9 + // + this.buttonItem9.Image = global::Cyberpipe.Properties.Resources._24x24icon__2__10; + this.buttonItem9.ImagePosition = DevComponents.DotNetBar.eImagePosition.Top; + this.buttonItem9.Name = "buttonItem9"; + this.buttonItem9.SubItemsExpandWidth = 14; + this.buttonItem9.Text = "文档管理"; + this.buttonItem9.Click += new System.EventHandler(this.buttonItem9_Click); + // + // ribbonPanel2 + // + this.ribbonPanel2.ColorSchemeStyle = DevComponents.DotNetBar.eDotNetBarStyle.StyleManagerControlled; + this.ribbonPanel2.Controls.Add(this.ribbonBar4); + this.ribbonPanel2.Dock = System.Windows.Forms.DockStyle.Fill; + this.ribbonPanel2.Location = new System.Drawing.Point(0, 0); + this.ribbonPanel2.Name = "ribbonPanel2"; + this.ribbonPanel2.Padding = new System.Windows.Forms.Padding(3, 0, 3, 3); + this.ribbonPanel2.Size = new System.Drawing.Size(1328, 95); + // + // + // + this.ribbonPanel2.Style.Class = ""; + this.ribbonPanel2.Style.CornerType = DevComponents.DotNetBar.eCornerType.Square; + // + // + // + this.ribbonPanel2.StyleMouseDown.Class = ""; + this.ribbonPanel2.StyleMouseDown.CornerType = DevComponents.DotNetBar.eCornerType.Square; + // + // + // + this.ribbonPanel2.StyleMouseOver.Class = ""; + this.ribbonPanel2.StyleMouseOver.CornerType = DevComponents.DotNetBar.eCornerType.Square; + this.ribbonPanel2.TabIndex = 39; + this.ribbonPanel2.Visible = false; + // + // ribbonBar4 + // + this.ribbonBar4.AutoOverflowEnabled = true; + // + // + // + this.ribbonBar4.BackgroundMouseOverStyle.Class = ""; + this.ribbonBar4.BackgroundMouseOverStyle.CornerType = DevComponents.DotNetBar.eCornerType.Square; + // + // + // + this.ribbonBar4.BackgroundStyle.Class = ""; + this.ribbonBar4.BackgroundStyle.CornerType = DevComponents.DotNetBar.eCornerType.Square; + this.ribbonBar4.ContainerControlProcessDialogKey = true; + this.ribbonBar4.Dock = System.Windows.Forms.DockStyle.Left; + this.ribbonBar4.Items.AddRange(new DevComponents.DotNetBar.BaseItem[] { + this.buttonItem_TaskManager, + this.buttonItem_OnlineTask, + this.buttonItem_Event}); + this.ribbonBar4.Location = new System.Drawing.Point(3, 0); + this.ribbonBar4.Name = "ribbonBar4"; + this.ribbonBar4.Size = new System.Drawing.Size(299, 92); + this.ribbonBar4.Style = DevComponents.DotNetBar.eDotNetBarStyle.StyleManagerControlled; + this.ribbonBar4.TabIndex = 0; + this.ribbonBar4.Text = "ribbonBar4"; + // + // + // + this.ribbonBar4.TitleStyle.Class = ""; + this.ribbonBar4.TitleStyle.CornerType = DevComponents.DotNetBar.eCornerType.Square; + // + // + // + this.ribbonBar4.TitleStyleMouseOver.Class = ""; + this.ribbonBar4.TitleStyleMouseOver.CornerType = DevComponents.DotNetBar.eCornerType.Square; + this.ribbonBar4.TitleVisible = false; + // + // buttonItem_TaskManager + // + this.buttonItem_TaskManager.Image = global::Cyberpipe.Properties.Resources._24x24icon__2__76; + this.buttonItem_TaskManager.ImagePosition = DevComponents.DotNetBar.eImagePosition.Top; + this.buttonItem_TaskManager.Name = "buttonItem_TaskManager"; + this.buttonItem_TaskManager.SubItemsExpandWidth = 14; + this.buttonItem_TaskManager.Text = "工单管理"; + this.buttonItem_TaskManager.Click += new System.EventHandler(this.buttonItem_TaskManager_Click); + // + // buttonItem_OnlineTask + // + this.buttonItem_OnlineTask.Image = global::Cyberpipe.Properties.Resources._24x24icon__2__69; + this.buttonItem_OnlineTask.ImagePosition = DevComponents.DotNetBar.eImagePosition.Top; + this.buttonItem_OnlineTask.Name = "buttonItem_OnlineTask"; + this.buttonItem_OnlineTask.SubItemsExpandWidth = 14; + this.buttonItem_OnlineTask.Text = "在线任务"; + this.buttonItem_OnlineTask.Click += new System.EventHandler(this.buttonItem_OnlineTask_Click); + // + // buttonItem_Event + // + this.buttonItem_Event.Image = global::Cyberpipe.Properties.Resources._24x24icon__2__72; + this.buttonItem_Event.ImagePosition = DevComponents.DotNetBar.eImagePosition.Top; + this.buttonItem_Event.Name = "buttonItem_Event"; + this.buttonItem_Event.SubItemsExpandWidth = 14; + this.buttonItem_Event.Text = "事件管理"; + this.buttonItem_Event.Click += new System.EventHandler(this.buttonItem_Event_Click); + // // ribbonPanel1 // this.ribbonPanel1.AutoSize = true; @@ -4262,6 +4463,15 @@ this.buttonItem27.Visible = false; this.buttonItem27.Click += new System.EventHandler(this.buttonItem27_Click); // + // buttonItem1 + // + this.buttonItem1.Image = global::Cyberpipe.Properties.Resources._24x24icon__2__94; + this.buttonItem1.ImagePosition = DevComponents.DotNetBar.eImagePosition.Top; + this.buttonItem1.Name = "buttonItem1"; + this.buttonItem1.SubItemsExpandWidth = 14; + this.buttonItem1.Text = "图层管理"; + this.buttonItem1.Click += new System.EventHandler(this.buttonItem1_Click); + // // buttonItem91 // this.buttonItem91.ForeColor = System.Drawing.Color.Black; @@ -4272,15 +4482,6 @@ this.buttonItem91.Text = "快速定位"; this.buttonItem91.Click += new System.EventHandler(this.buttonItem91_Click); // - // buttonItem1 - // - this.buttonItem1.Image = global::Cyberpipe.Properties.Resources._24x24icon__2__94; - this.buttonItem1.ImagePosition = DevComponents.DotNetBar.eImagePosition.Top; - this.buttonItem1.Name = "buttonItem1"; - this.buttonItem1.SubItemsExpandWidth = 14; - this.buttonItem1.Text = "图层管理"; - this.buttonItem1.Click += new System.EventHandler(this.buttonItem1_Click); - // // btnlegendSet // this.btnlegendSet.Image = global::Cyberpipe.Properties.Resources._24x24icon__2__93; @@ -4300,278 +4501,6 @@ this.buttonItem89.Visible = false; this.buttonItem89.Click += new System.EventHandler(this.buttonItem89_Click); // - // ribbonPanel7 - // - this.ribbonPanel7.ColorSchemeStyle = DevComponents.DotNetBar.eDotNetBarStyle.StyleManagerControlled; - this.ribbonPanel7.Controls.Add(this.ribbonBar5); - this.ribbonPanel7.Dock = System.Windows.Forms.DockStyle.Fill; - this.ribbonPanel7.Location = new System.Drawing.Point(0, 0); - this.ribbonPanel7.Name = "ribbonPanel7"; - this.ribbonPanel7.Padding = new System.Windows.Forms.Padding(3, 0, 3, 3); - this.ribbonPanel7.Size = new System.Drawing.Size(1328, 95); - // - // - // - this.ribbonPanel7.Style.Class = ""; - this.ribbonPanel7.Style.CornerType = DevComponents.DotNetBar.eCornerType.Square; - // - // - // - this.ribbonPanel7.StyleMouseDown.Class = ""; - this.ribbonPanel7.StyleMouseDown.CornerType = DevComponents.DotNetBar.eCornerType.Square; - // - // - // - this.ribbonPanel7.StyleMouseOver.Class = ""; - this.ribbonPanel7.StyleMouseOver.CornerType = DevComponents.DotNetBar.eCornerType.Square; - this.ribbonPanel7.TabIndex = 41; - this.ribbonPanel7.Visible = false; - // - // ribbonBar5 - // - this.ribbonBar5.AutoOverflowEnabled = true; - // - // - // - this.ribbonBar5.BackgroundMouseOverStyle.Class = ""; - this.ribbonBar5.BackgroundMouseOverStyle.CornerType = DevComponents.DotNetBar.eCornerType.Square; - // - // - // - this.ribbonBar5.BackgroundStyle.Class = ""; - this.ribbonBar5.BackgroundStyle.CornerType = DevComponents.DotNetBar.eCornerType.Square; - this.ribbonBar5.ContainerControlProcessDialogKey = true; - this.ribbonBar5.Dock = System.Windows.Forms.DockStyle.Left; - this.ribbonBar5.Items.AddRange(new DevComponents.DotNetBar.BaseItem[] { - this.btn_flag, - this.slider4ground}); - this.ribbonBar5.Location = new System.Drawing.Point(3, 0); - this.ribbonBar5.Name = "ribbonBar5"; - this.ribbonBar5.Size = new System.Drawing.Size(418, 92); - this.ribbonBar5.Style = DevComponents.DotNetBar.eDotNetBarStyle.StyleManagerControlled; - this.ribbonBar5.TabIndex = 0; - // - // - // - this.ribbonBar5.TitleStyle.Class = ""; - this.ribbonBar5.TitleStyle.CornerType = DevComponents.DotNetBar.eCornerType.Square; - // - // - // - this.ribbonBar5.TitleStyleMouseOver.Class = ""; - this.ribbonBar5.TitleStyleMouseOver.CornerType = DevComponents.DotNetBar.eCornerType.Square; - this.ribbonBar5.TitleVisible = false; - this.ribbonBar5.ItemClick += new System.EventHandler(this.ribbonBar5_ItemClick); - // - // btn_flag - // - this.btn_flag.Image = global::Cyberpipe.Properties.Resources._24x24icon_03_hover; - this.btn_flag.ImagePosition = DevComponents.DotNetBar.eImagePosition.Top; - this.btn_flag.Name = "btn_flag"; - this.btn_flag.SubItemsExpandWidth = 14; - this.btn_flag.Text = "标识器管理"; - this.btn_flag.Click += new System.EventHandler(this.btn_flag_Click); - // - // slider4ground - // - this.slider4ground.LabelPosition = DevComponents.DotNetBar.eSliderLabelPosition.Top; - this.slider4ground.Name = "slider4ground"; - this.slider4ground.Text = "地面透明度"; - this.slider4ground.Value = 0; - this.slider4ground.ValueChanged += new System.EventHandler(this.slider4ground_ValueChanged); - // - // ribbonPanel2 - // - this.ribbonPanel2.ColorSchemeStyle = DevComponents.DotNetBar.eDotNetBarStyle.StyleManagerControlled; - this.ribbonPanel2.Controls.Add(this.ribbonBar4); - this.ribbonPanel2.Dock = System.Windows.Forms.DockStyle.Fill; - this.ribbonPanel2.Location = new System.Drawing.Point(0, 0); - this.ribbonPanel2.Name = "ribbonPanel2"; - this.ribbonPanel2.Padding = new System.Windows.Forms.Padding(3, 0, 3, 3); - this.ribbonPanel2.Size = new System.Drawing.Size(1328, 95); - // - // - // - this.ribbonPanel2.Style.Class = ""; - this.ribbonPanel2.Style.CornerType = DevComponents.DotNetBar.eCornerType.Square; - // - // - // - this.ribbonPanel2.StyleMouseDown.Class = ""; - this.ribbonPanel2.StyleMouseDown.CornerType = DevComponents.DotNetBar.eCornerType.Square; - // - // - // - this.ribbonPanel2.StyleMouseOver.Class = ""; - this.ribbonPanel2.StyleMouseOver.CornerType = DevComponents.DotNetBar.eCornerType.Square; - this.ribbonPanel2.TabIndex = 39; - this.ribbonPanel2.Visible = false; - // - // ribbonBar4 - // - this.ribbonBar4.AutoOverflowEnabled = true; - // - // - // - this.ribbonBar4.BackgroundMouseOverStyle.Class = ""; - this.ribbonBar4.BackgroundMouseOverStyle.CornerType = DevComponents.DotNetBar.eCornerType.Square; - // - // - // - this.ribbonBar4.BackgroundStyle.Class = ""; - this.ribbonBar4.BackgroundStyle.CornerType = DevComponents.DotNetBar.eCornerType.Square; - this.ribbonBar4.ContainerControlProcessDialogKey = true; - this.ribbonBar4.Dock = System.Windows.Forms.DockStyle.Left; - this.ribbonBar4.Items.AddRange(new DevComponents.DotNetBar.BaseItem[] { - this.buttonItem_TaskManager, - this.buttonItem_OnlineTask, - this.buttonItem_Event}); - this.ribbonBar4.Location = new System.Drawing.Point(3, 0); - this.ribbonBar4.Name = "ribbonBar4"; - this.ribbonBar4.Size = new System.Drawing.Size(299, 92); - this.ribbonBar4.Style = DevComponents.DotNetBar.eDotNetBarStyle.StyleManagerControlled; - this.ribbonBar4.TabIndex = 0; - this.ribbonBar4.Text = "ribbonBar4"; - // - // - // - this.ribbonBar4.TitleStyle.Class = ""; - this.ribbonBar4.TitleStyle.CornerType = DevComponents.DotNetBar.eCornerType.Square; - // - // - // - this.ribbonBar4.TitleStyleMouseOver.Class = ""; - this.ribbonBar4.TitleStyleMouseOver.CornerType = DevComponents.DotNetBar.eCornerType.Square; - this.ribbonBar4.TitleVisible = false; - // - // buttonItem_TaskManager - // - this.buttonItem_TaskManager.Image = global::Cyberpipe.Properties.Resources._24x24icon__2__76; - this.buttonItem_TaskManager.ImagePosition = DevComponents.DotNetBar.eImagePosition.Top; - this.buttonItem_TaskManager.Name = "buttonItem_TaskManager"; - this.buttonItem_TaskManager.SubItemsExpandWidth = 14; - this.buttonItem_TaskManager.Text = "工单管理"; - this.buttonItem_TaskManager.Click += new System.EventHandler(this.buttonItem_TaskManager_Click); - // - // buttonItem_OnlineTask - // - this.buttonItem_OnlineTask.Image = global::Cyberpipe.Properties.Resources._24x24icon__2__69; - this.buttonItem_OnlineTask.ImagePosition = DevComponents.DotNetBar.eImagePosition.Top; - this.buttonItem_OnlineTask.Name = "buttonItem_OnlineTask"; - this.buttonItem_OnlineTask.SubItemsExpandWidth = 14; - this.buttonItem_OnlineTask.Text = "在线任务"; - this.buttonItem_OnlineTask.Click += new System.EventHandler(this.buttonItem_OnlineTask_Click); - // - // buttonItem_Event - // - this.buttonItem_Event.Image = global::Cyberpipe.Properties.Resources._24x24icon__2__72; - this.buttonItem_Event.ImagePosition = DevComponents.DotNetBar.eImagePosition.Top; - this.buttonItem_Event.Name = "buttonItem_Event"; - this.buttonItem_Event.SubItemsExpandWidth = 14; - this.buttonItem_Event.Text = "事件管理"; - this.buttonItem_Event.Click += new System.EventHandler(this.buttonItem_Event_Click); - // - // ribbonPanel3 - // - this.ribbonPanel3.ColorSchemeStyle = DevComponents.DotNetBar.eDotNetBarStyle.StyleManagerControlled; - this.ribbonPanel3.Controls.Add(this.ribbonBar3); - this.ribbonPanel3.Dock = System.Windows.Forms.DockStyle.Fill; - this.ribbonPanel3.Location = new System.Drawing.Point(0, 33); - this.ribbonPanel3.Name = "ribbonPanel3"; - this.ribbonPanel3.Padding = new System.Windows.Forms.Padding(3, 0, 3, 3); - this.ribbonPanel3.Size = new System.Drawing.Size(1328, 62); - // - // - // - this.ribbonPanel3.Style.Class = ""; - this.ribbonPanel3.Style.CornerType = DevComponents.DotNetBar.eCornerType.Square; - // - // - // - this.ribbonPanel3.StyleMouseDown.Class = ""; - this.ribbonPanel3.StyleMouseDown.CornerType = DevComponents.DotNetBar.eCornerType.Square; - // - // - // - this.ribbonPanel3.StyleMouseOver.Class = ""; - this.ribbonPanel3.StyleMouseOver.CornerType = DevComponents.DotNetBar.eCornerType.Square; - this.ribbonPanel3.TabIndex = 40; - // - // ribbonBar3 - // - this.ribbonBar3.AutoOverflowEnabled = true; - // - // - // - this.ribbonBar3.BackgroundMouseOverStyle.Class = ""; - this.ribbonBar3.BackgroundMouseOverStyle.CornerType = DevComponents.DotNetBar.eCornerType.Square; - // - // - // - this.ribbonBar3.BackgroundStyle.Class = ""; - this.ribbonBar3.BackgroundStyle.CornerType = DevComponents.DotNetBar.eCornerType.Square; - this.ribbonBar3.ContainerControlProcessDialogKey = true; - this.ribbonBar3.Dock = System.Windows.Forms.DockStyle.Left; - this.ribbonBar3.Items.AddRange(new DevComponents.DotNetBar.BaseItem[] { - this.btn_device, - this.btn_Person, - this.btn_constructMap, - this.buttonItem9}); - this.ribbonBar3.Location = new System.Drawing.Point(3, 0); - this.ribbonBar3.Name = "ribbonBar3"; - this.ribbonBar3.Size = new System.Drawing.Size(378, 59); - this.ribbonBar3.Style = DevComponents.DotNetBar.eDotNetBarStyle.StyleManagerControlled; - this.ribbonBar3.TabIndex = 0; - // - // - // - this.ribbonBar3.TitleStyle.Class = ""; - this.ribbonBar3.TitleStyle.CornerType = DevComponents.DotNetBar.eCornerType.Square; - // - // - // - this.ribbonBar3.TitleStyleMouseOver.Class = ""; - this.ribbonBar3.TitleStyleMouseOver.CornerType = DevComponents.DotNetBar.eCornerType.Square; - this.ribbonBar3.TitleVisible = false; - // - // btn_device - // - this.btn_device.ButtonStyle = DevComponents.DotNetBar.eButtonStyle.ImageAndText; - this.btn_device.Image = global::Cyberpipe.Properties.Resources._24X24__2__02; - this.btn_device.ImagePosition = DevComponents.DotNetBar.eImagePosition.Top; - this.btn_device.Name = "btn_device"; - this.btn_device.SubItemsExpandWidth = 14; - this.btn_device.Text = "探测仪管理"; - this.btn_device.Click += new System.EventHandler(this.btn_device_Click); - // - // btn_Person - // - this.btn_Person.ButtonStyle = DevComponents.DotNetBar.eButtonStyle.ImageAndText; - this.btn_Person.Image = global::Cyberpipe.Properties.Resources._24x24icon_05_hover1; - this.btn_Person.ImagePosition = DevComponents.DotNetBar.eImagePosition.Top; - this.btn_Person.Name = "btn_Person"; - this.btn_Person.SubItemsExpandWidth = 14; - this.btn_Person.Text = "定位人员维护"; - this.btn_Person.Click += new System.EventHandler(this.btn_Person_Click); - // - // btn_constructMap - // - this.btn_constructMap.Image = global::Cyberpipe.Properties.Resources._24x24icon_04_hover; - this.btn_constructMap.ImagePosition = DevComponents.DotNetBar.eImagePosition.Top; - this.btn_constructMap.Name = "btn_constructMap"; - this.btn_constructMap.SubItemsExpandWidth = 14; - this.btn_constructMap.Text = "导出施工图"; - this.btn_constructMap.Click += new System.EventHandler(this.btn_constructMap_Click); - // - // buttonItem9 - // - this.buttonItem9.Image = global::Cyberpipe.Properties.Resources._24x24icon__2__10; - this.buttonItem9.ImagePosition = DevComponents.DotNetBar.eImagePosition.Top; - this.buttonItem9.Name = "buttonItem9"; - this.buttonItem9.SubItemsExpandWidth = 14; - this.buttonItem9.Text = "文档管理"; - this.buttonItem9.Click += new System.EventHandler(this.buttonItem9_Click); - // // ribbonPanel8 // this.ribbonPanel8.ColorSchemeStyle = DevComponents.DotNetBar.eDotNetBarStyle.StyleManagerControlled; @@ -4696,6 +4625,86 @@ this.btn_reset_password.Text = "重置密码"; this.btn_reset_password.Click += new System.EventHandler(this.btn_reset_password_Click); // + // ribbonPanel7 + // + this.ribbonPanel7.ColorSchemeStyle = DevComponents.DotNetBar.eDotNetBarStyle.StyleManagerControlled; + this.ribbonPanel7.Controls.Add(this.ribbonBar5); + this.ribbonPanel7.Dock = System.Windows.Forms.DockStyle.Fill; + this.ribbonPanel7.Location = new System.Drawing.Point(0, 0); + this.ribbonPanel7.Name = "ribbonPanel7"; + this.ribbonPanel7.Padding = new System.Windows.Forms.Padding(3, 0, 3, 3); + this.ribbonPanel7.Size = new System.Drawing.Size(1328, 95); + // + // + // + this.ribbonPanel7.Style.Class = ""; + this.ribbonPanel7.Style.CornerType = DevComponents.DotNetBar.eCornerType.Square; + // + // + // + this.ribbonPanel7.StyleMouseDown.Class = ""; + this.ribbonPanel7.StyleMouseDown.CornerType = DevComponents.DotNetBar.eCornerType.Square; + // + // + // + this.ribbonPanel7.StyleMouseOver.Class = ""; + this.ribbonPanel7.StyleMouseOver.CornerType = DevComponents.DotNetBar.eCornerType.Square; + this.ribbonPanel7.TabIndex = 41; + this.ribbonPanel7.Visible = false; + // + // ribbonBar5 + // + this.ribbonBar5.AutoOverflowEnabled = true; + // + // + // + this.ribbonBar5.BackgroundMouseOverStyle.Class = ""; + this.ribbonBar5.BackgroundMouseOverStyle.CornerType = DevComponents.DotNetBar.eCornerType.Square; + // + // + // + this.ribbonBar5.BackgroundStyle.Class = ""; + this.ribbonBar5.BackgroundStyle.CornerType = DevComponents.DotNetBar.eCornerType.Square; + this.ribbonBar5.ContainerControlProcessDialogKey = true; + this.ribbonBar5.Dock = System.Windows.Forms.DockStyle.Left; + this.ribbonBar5.Items.AddRange(new DevComponents.DotNetBar.BaseItem[] { + this.btn_flag, + this.slider4ground}); + this.ribbonBar5.Location = new System.Drawing.Point(3, 0); + this.ribbonBar5.Name = "ribbonBar5"; + this.ribbonBar5.Size = new System.Drawing.Size(418, 92); + this.ribbonBar5.Style = DevComponents.DotNetBar.eDotNetBarStyle.StyleManagerControlled; + this.ribbonBar5.TabIndex = 0; + // + // + // + this.ribbonBar5.TitleStyle.Class = ""; + this.ribbonBar5.TitleStyle.CornerType = DevComponents.DotNetBar.eCornerType.Square; + // + // + // + this.ribbonBar5.TitleStyleMouseOver.Class = ""; + this.ribbonBar5.TitleStyleMouseOver.CornerType = DevComponents.DotNetBar.eCornerType.Square; + this.ribbonBar5.TitleVisible = false; + this.ribbonBar5.ItemClick += new System.EventHandler(this.ribbonBar5_ItemClick); + // + // btn_flag + // + this.btn_flag.Image = global::Cyberpipe.Properties.Resources._24x24icon_03_hover; + this.btn_flag.ImagePosition = DevComponents.DotNetBar.eImagePosition.Top; + this.btn_flag.Name = "btn_flag"; + this.btn_flag.SubItemsExpandWidth = 14; + this.btn_flag.Text = "标识器管理"; + this.btn_flag.Click += new System.EventHandler(this.btn_flag_Click); + // + // slider4ground + // + this.slider4ground.LabelPosition = DevComponents.DotNetBar.eSliderLabelPosition.Top; + this.slider4ground.Name = "slider4ground"; + this.slider4ground.Text = "地面透明度"; + this.slider4ground.Value = 0; + this.slider4ground.ValueChanged += new System.EventHandler(this.slider4ground_ValueChanged); + // // ribbonPanel15 // this.ribbonPanel15.ColorSchemeStyle = DevComponents.DotNetBar.eDotNetBarStyle.StyleManagerControlled; @@ -6393,16 +6402,6 @@ this.buttonItem76.SubItemsExpandWidth = 14; this.buttonItem76.Text = "坐标标注"; // - // layerTree - // - this.layerTree.CheckBoxes = true; - this.layerTree.ItemHeight = 18; - this.layerTree.Location = new System.Drawing.Point(30, 78); - this.layerTree.Name = "layerTree"; - this.layerTree.Size = new System.Drawing.Size(121, 97); - this.layerTree.TabIndex = 1; - this.layerTree.AfterCheck += new System.Windows.Forms.TreeViewEventHandler(this.layerTree_AfterCheck); - // // MainFrm // this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Inherit; @@ -6475,11 +6474,11 @@ this.contextMenuStripDeleteLayerNode.ResumeLayout(false); this.ribbonControl1.ResumeLayout(false); this.ribbonControl1.PerformLayout(); - this.ribbonPanel1.ResumeLayout(false); - this.ribbonPanel7.ResumeLayout(false); - this.ribbonPanel2.ResumeLayout(false); this.ribbonPanel3.ResumeLayout(false); + this.ribbonPanel2.ResumeLayout(false); + this.ribbonPanel1.ResumeLayout(false); this.ribbonPanel8.ResumeLayout(false); + this.ribbonPanel7.ResumeLayout(false); this.ribbonPanel15.ResumeLayout(false); ((System.ComponentModel.ISupportInitialize)(this.pictureBox1)).EndInit(); this.ResumeLayout(false); diff --git a/NewFunction/FrmCreateTunnel.cs b/NewFunction/FrmCreateTunnel.cs index 282767c..338edff 100644 --- a/NewFunction/FrmCreateTunnel.cs +++ b/NewFunction/FrmCreateTunnel.cs @@ -142,35 +142,6 @@ } } - private void txtMS_KeyPress(object sender, KeyPressEventArgs e) - { - TextBox text = sender as TextBox; - if ((e.KeyChar < 48 || e.KeyChar > 57) && (e.KeyChar != 8) && (int)e.KeyChar != 46) - { - e.Handled = true; - } - if ((int)e.KeyChar == 46) //小数点 - { - if (text.Text.Length <= 0) - e.Handled = true; //小数点不能在第一位 - else //处理不规则的小数点 - { - float f; - float oldf; - bool b1 = false, b2 = false; - b1 = float.TryParse(text.Text, out oldf); - b2 = float.TryParse(text.Text + e.KeyChar.ToString(), out f); - if (b2 == false) - { - if (b1 == true) - e.Handled = true; - else - e.Handled = false; - } - } - } - } - private void FrmCreateTunnel_Load(object sender, EventArgs e) { if (comboBoxTunnelType.Items.Count > 0) diff --git a/OracleHelper.cs b/OracleHelper.cs index 11eebe6..79cdf48 100644 --- a/OracleHelper.cs +++ b/OracleHelper.cs @@ -49,7 +49,7 @@ { conn.Close(); } - MessageBox.Show(ex.Message, "提示"); + LogHelper.WriteLog(typeof(OledbHelper), ex.Message); return null; } } @@ -67,7 +67,7 @@ } catch(Exception ex) { - // LogError.PublishError(ex); + LogHelper.WriteLog(typeof(OledbHelper), ex.Message); } finally { @@ -111,6 +111,7 @@ } catch (Exception ex) { + LogHelper.WriteLog(typeof(OledbHelper), ex.Message); return null; } } @@ -131,6 +132,7 @@ } catch(Exception ex) { + LogHelper.WriteLog(typeof(OledbHelper), ex.Message); rowCount = -1; } finally @@ -159,6 +161,7 @@ } catch(Exception ex) { + LogHelper.WriteLog(typeof(OledbHelper), ex.Message); num = -1; } finally @@ -190,6 +193,7 @@ } catch (Exception ex) { + LogHelper.WriteLog(typeof(OledbHelper), ex.Message); return null; } } @@ -210,7 +214,7 @@ oracleCmd.Dispose(); conn.Close(); //调用con_close()方法,关闭与数据库的连接 }catch(Exception ex){ - + LogHelper.WriteLog(typeof(OledbHelper), ex.Message); } finally { @@ -237,6 +241,7 @@ } catch (Exception ex) { + LogHelper.WriteLog(typeof(OledbHelper), ex.Message); rowCount = -1; } finally diff --git a/OracleUtils.cs b/OracleUtils.cs index 29b5374..c1aadda 100644 --- a/OracleUtils.cs +++ b/OracleUtils.cs @@ -741,7 +741,6 @@ } catch { - //if we fail to return the SqlDatReader, we need to close the connection ourselves cn.Close(); throw; } diff --git a/PAS.cs b/PAS.cs index 972de2d..fcda1dd 100644 --- a/PAS.cs +++ b/PAS.cs @@ -93,15 +93,7 @@ } - private void TSM_Pderive_Click(object sender, EventArgs e) - { - PASAClass.Table_name(operation); - if (TV_Files.SelectedNode != null) - { - PASAClass.GuideEdit_form("G", TV_Files, int.Parse(((ToolStripMenuItem)sender).Tag.ToString())); - } - } - + private void TSM_Fenter_Click(object sender, EventArgs e) { if (TV_Files.SelectedNode != null) @@ -110,16 +102,6 @@ } } - private void TSM_Frename_Click(object sender, EventArgs e) - { - TSM_Fenter_Click(sender, e); - } - - private void TSM_Fdelete_Click(object sender, EventArgs e) - { - TSM_Fenter_Click(sender, e); - } - private void TSM_Fderive_Click(object sender, EventArgs e) { if (TV_Files.SelectedNode != null) @@ -128,25 +110,6 @@ } } - private void TSM_Fprint_Click(object sender, EventArgs e) - { - if (TV_Files.SelectedNode != null) - { - PASAClass.Print(int.Parse(TV_Files.SelectedNode.Tag.ToString()), TV_Files.SelectedNode.Text, PD_PASPrtFile, PD_PASPrtDoc); - - } - } - - private void TSM_PASPgSt_Click(object sender, EventArgs e) - { - PSD_PASSetPage.ShowDialog(); - } - - private void TSM_PASPreV_Click(object sender, EventArgs e) - { - PPD_PASPreV.ShowDialog(); - } - private void TV_Files_AfterCollapse(object sender, TreeViewEventArgs e) { e.Node.ImageIndex = 0; @@ -250,14 +213,6 @@ } } - private void 导出ToolStripMenuItem_Click(object sender, EventArgs e) - { - PASAClass.Table_name(operation); - if (TV_Files.SelectedNode != null) - { - PASAClass.GuideEdit_form("G", TV_Files, int.Parse(((ToolStripMenuItem)sender).Tag.ToString())); - } - } private void 导入ToolStripMenuItem_Click(object sender, EventArgs e) { diff --git a/PAS_Forms/F_PASInout.cs b/PAS_Forms/F_PASInout.cs index 373a4e6..974f987 100644 --- a/PAS_Forms/F_PASInout.cs +++ b/PAS_Forms/F_PASInout.cs @@ -71,11 +71,6 @@ } - private void Cancel_Click(object sender, EventArgs e) - { - this.Close(); - } - private void OK_Click(object sender, EventArgs e) { if (textBox1.Text == "") diff --git a/PATM.cs b/PATM.cs index edecd1e..9b6c51d 100644 --- a/PATM.cs +++ b/PATM.cs @@ -26,12 +26,6 @@ public string operation = ""; #endregion - - - - - - private void TSM_Pnew_Click(object sender, EventArgs e) { if (LV_proj.Visible) @@ -94,15 +88,6 @@ } - private void TSM_Pderive_Click(object sender, EventArgs e) - { - PATMAClass.Table_name(operation); - if (TV_files.SelectedNode != null) - { - PATMAClass.GuideEdit_form("G", TV_files, int.Parse(((ToolStripMenuItem)sender).Tag.ToString())); - } - } - private void TSM_Fenter_Click(object sender, EventArgs e) { if (TV_files.SelectedNode != null) @@ -163,35 +148,6 @@ //PATMAClass.Show_AllFile(int.Parse(e.Node.Tag.ToString()), e.Node.Text, LV_PATMallfiles, PB_Display, 2);//此处为显示图片操作 } - private void TSM_Frename_Click(object sender, EventArgs e) - { - TSM_Fenter_Click(sender, e); - } - - private void TSM_Fdelete_Click(object sender, EventArgs e) - { - TSM_Fenter_Click(sender, e); - } - - private void TSM_Fderive_Click(object sender, EventArgs e) - { - if (TV_files.SelectedNode != null) - { - PATMAClass.GuideEdit_form("G", TV_files, int.Parse(((ToolStripMenuItem)sender).Tag.ToString())); - } - } - - private void TSM_Fprint_Click(object sender, EventArgs e) - { - if (TV_files.SelectedNode != null) - { - PATMAClass.Print(int.Parse(TV_files.SelectedNode.Tag.ToString()), TV_files.SelectedNode.Text, PD_PATMPrtFile, PD_PATMPrtDoc); - - } - } - - - private void BT_PATMSch_Click(object sender, EventArgs e) { //LV_PATMallfiles.Dock = DockStyle.Fill;//使ListView控件最大化 @@ -210,32 +166,6 @@ } - private void TSM_PATMPreV_Click(object sender, EventArgs e) - { - PPD_PATMPreV.ShowDialog(); - } - - private void TSM_PATMPgSt_Click(object sender, EventArgs e) - { - PSD_PATMSetPage.ShowDialog(); - } - - private void LV_PATMSrchRslt_MouseClick(object sender, MouseEventArgs e) - { - - if (LV_proj.SelectedItems != null) - { - //int i = 1; - // PATMAClass.Show_AllFile(int.Parse(LV_PATMSrchRslt.FocusedItem.Tag.ToString()), LV_PATMSrchRslt.FocusedItem.Text, LV_PATMallfiles,PB_Display, 0); - - } - } - - private void LV_PATMSrchRslt_MouseDoubleClick(object sender, MouseEventArgs e) - { - //PATMAClass.Show_AllFile(int.Parse(LV_PATMSrchRslt.FocusedItem.Tag.ToString()), LV_PATMSrchRslt.FocusedItem.Text, LV_PATMallfiles, PB_Display, 2); - } - private void 新建ToolStripMenuItem_Click(object sender, EventArgs e) { if ((TV_files.SelectedNode != null)&&(TV_files.SelectedNode.Parent==null)) @@ -288,17 +218,6 @@ } } - private void 打印预览toolStripMenuItem_Click(object sender, EventArgs e) - { - - PPD_PATMPreV.ShowDialog(); - } - - private void 打印设置toolStripMenuItem_Click(object sender, EventArgs e) - { - PSD_PATMSetPage.ShowDialog(); - } - private void TV_PATMSrchRslt_NodeMouseClick(object sender, TreeNodeMouseClickEventArgs e) { if (e.Button == MouseButtons.Right) diff --git a/PATM_Forms/F_PATMTitle.cs b/PATM_Forms/F_PATMTitle.cs index 7380dd8..5d1fe8c 100644 --- a/PATM_Forms/F_PATMTitle.cs +++ b/PATM_Forms/F_PATMTitle.cs @@ -148,19 +148,6 @@ return 0; } - //判断是否为已有工程 - private bool checkProject(string projectname) { - string sql = "select * from "+this.tablename+" where "+tablename+".NODENAME = '"+projectname - +"'"; - DataTable table = OledbHelper.QueryTable(sql); - if (table.Rows.Count > 0) - { - return true; - } - else { - return false; - } - } private void buttonX2_Click(object sender, EventArgs e) { diff --git a/PATM_Forms/F_PATMinout.cs b/PATM_Forms/F_PATMinout.cs index e404e7b..16b51de 100644 --- a/PATM_Forms/F_PATMinout.cs +++ b/PATM_Forms/F_PATMinout.cs @@ -174,12 +174,6 @@ { this.Close(); } - - private void TV_PATMinout_AfterCollapse(object sender, TreeViewEventArgs e) - { - e.Node.ImageIndex = 0; - } - //private void TV_PATMinout_NodeMouseDoubleClick(object sender, TreeNodeMouseClickEventArgs e) diff --git "a/PED_Forms/F_\346\225\260\346\215\256\350\276\223\345\205\245\350\276\223\345\207\272.cs" "b/PED_Forms/F_\346\225\260\346\215\256\350\276\223\345\205\245\350\276\223\345\207\272.cs" index 0f76b8c..4de8b4d 100644 --- "a/PED_Forms/F_\346\225\260\346\215\256\350\276\223\345\205\245\350\276\223\345\207\272.cs" +++ "b/PED_Forms/F_\346\225\260\346\215\256\350\276\223\345\205\245\350\276\223\345\207\272.cs" @@ -188,12 +188,7 @@ } DialogResult = DialogResult.OK;//将当前窗体的对话框返回值设为OK } - private void treeView1_NodeMouseClick(object sender, TreeNodeMouseClickEventArgs e) - { - - //dir = comboBox_Disk.Text + e.Node.FullPath; - e.Node.SelectedImageIndex = e.Node.ImageIndex; - } + private void button1_Click(object sender, EventArgs e) { diff --git a/Program.cs b/Program.cs index 1ff0987..0e480f2 100644 --- a/Program.cs +++ b/Program.cs @@ -105,22 +105,6 @@ File.Copy(localPath_config, filePath_config, true); } - private static void createFolder(String folerName) - { - if (!Directory.Exists(folerName)) - { - Directory.CreateDirectory(folerName); - } - } - - private static void delOldVersion(String fileName) - { - if (System.IO.File.Exists(fileName)) - { - File.Delete(fileName); - } - } - //获取新版本程序的路径 private static string getProgramUrl(string fileName, string nodeName) { diff --git "a/SFiles_Forms/F_SFiles\346\225\260\346\215\256\350\276\223\345\205\245\350\276\223\345\207\272.cs" "b/SFiles_Forms/F_SFiles\346\225\260\346\215\256\350\276\223\345\205\245\350\276\223\345\207\272.cs" index 6f36e10..493895d 100644 --- "a/SFiles_Forms/F_SFiles\346\225\260\346\215\256\350\276\223\345\205\245\350\276\223\345\207\272.cs" +++ "b/SFiles_Forms/F_SFiles\346\225\260\346\215\256\350\276\223\345\205\245\350\276\223\345\207\272.cs" @@ -188,12 +188,6 @@ } DialogResult = DialogResult.OK;//将当前窗体的对话框返回值设为OK } - private void treeView1_NodeMouseClick(object sender, TreeNodeMouseClickEventArgs e) - { - - //dir = comboBox_Disk.Text + e.Node.FullPath; - e.Node.SelectedImageIndex = e.Node.ImageIndex; - } private void button1_Click(object sender, EventArgs e) { diff --git a/SysRescInfoManager.cs b/SysRescInfoManager.cs index 5b3038a..067b90b 100644 --- a/SysRescInfoManager.cs +++ b/SysRescInfoManager.cs @@ -214,15 +214,6 @@ winGridViewPager1.DataSource = table.DefaultView; } - private void LoadData(int pageIndex) - { - string sqlData = GetSql(pageIndex); - initlizeDatagrid(); - DataTable table = OracleUtils.ExecuteDataset(OracleUtils.ConnectionString, CommandType.Text, sqlData).Tables[0]; - winGridViewPager1.DataSource = table.DefaultView; - winGridViewPager1.Refresh(); - } - private string GetSql() { string sqlCount = "select count(*) from casic_userresctest where sysname='EMS'"; diff --git a/Utility.cs b/Utility.cs index 0e929aa..4da961f 100644 --- a/Utility.cs +++ b/Utility.cs @@ -382,7 +382,7 @@ } catch (Exception ex) { - //LogError.PublishError(ex); + LogHelper.WriteLog(typeof(Utility), ex.Message); } finally { @@ -443,7 +443,7 @@ } catch (Exception ex) { - //LogError.PublishError(ex); + LogHelper.WriteLog(typeof(Utility), ex.Message); } finally { @@ -483,7 +483,7 @@ } catch (Exception ex) { - //LogError.PublishError(ex); + LogHelper.WriteLog(typeof(Utility), ex.Message); } finally { @@ -526,8 +526,8 @@ } catch (Exception ex) { - - //LogError.PublishError(ex); + + LogHelper.WriteLog(typeof(Utility), ex.Message); } //finally //{ @@ -565,7 +565,7 @@ } catch (Exception ex) { - //LogError.PublishError(ex); + LogHelper.WriteLog(typeof(Utility), ex.Message); } finally { @@ -600,7 +600,7 @@ } catch (Exception ex) { - //LogError.PublishError(ex); + LogHelper.WriteLog(typeof(Utility), ex.Message); } finally { @@ -639,7 +639,7 @@ } catch (Exception ex) { - //LogError.PublishError(ex); + LogHelper.WriteLog(typeof(Utility),ex.Message); } finally { diff --git a/app.config b/app.config index d01583f..f9eb150 100644 --- a/app.config +++ b/app.config @@ -10,7 +10,7 @@ - + diff --git a/Cyberpipe.csproj b/Cyberpipe.csproj index 07a8c1a..e3cd12c 100644 --- a/Cyberpipe.csproj +++ b/Cyberpipe.csproj @@ -204,25 +204,6 @@ - - Form - - - F_GKT1数据输入输出.cs - - - Form - - - F_GKT1添加文件.cs - - - Form - - - F_GKT1添加项目.cs - - Form @@ -1068,18 +1049,6 @@ Frm_password_reset.cs - - Form - - - GKT.cs - - - Form - - - GKT1.cs - Form @@ -1258,12 +1227,6 @@ F_Projedit.cs - - Form - - - PED.cs - Form @@ -1331,16 +1294,6 @@ True Reference.map - - F_GKT1数据输入输出.cs - Designer - - - F_GKT1添加文件.cs - - - F_GKT1添加项目.cs - Form_EditTask.cs @@ -1836,12 +1789,6 @@ Frm_password_reset.cs - - GKT.cs - - - GKT1.cs - F_GKT数据输入输出.cs @@ -1934,9 +1881,6 @@ F_Projedit.cs - - PED.cs - F_数据输入输出.cs diff --git a/Cyberpipe.suo b/Cyberpipe.suo index 68ced4f..a1aecf8 100644 --- a/Cyberpipe.suo +++ b/Cyberpipe.suo Binary files differ diff --git a/EMS_Forms/Form_EditTask.cs b/EMS_Forms/Form_EditTask.cs index 718992f..f1d791f 100644 --- a/EMS_Forms/Form_EditTask.cs +++ b/EMS_Forms/Form_EditTask.cs @@ -119,7 +119,8 @@ String name = Convert.ToString(dr["USERNAME"]); comboBox_userName.Items.Add(name); - } + } + dr.Close(); comboBox_road.Items.Clear(); roadList = new List(); @@ -135,7 +136,7 @@ comboBox_road.Items.Add(name); } } - + dr1.Close(); conn.Close(); bool flag2 = false; @@ -185,7 +186,7 @@ catch (Exception ex) { - MessageBox.Show(ex.ToString()); + LogHelper.WriteLog(typeof(Form_EditTask), ex.Message); } } @@ -288,7 +289,7 @@ } catch (Exception ex) { - MessageBox.Show(ex.ToString()); + LogHelper.WriteLog(typeof(Form_EditTask), ex.Message); } } @@ -474,7 +475,7 @@ } catch (Exception ex) { - MessageBox.Show(ex.ToString()); + LogHelper.WriteLog(typeof(Form_EditTask), ex.Message); } this.Close(); @@ -495,6 +496,7 @@ { numList.Add(Convert.ToInt32(dr["DBID"])); } + dr.Close(); if (numList.Count == 0) { taskNumber = Convert.ToInt32(number) * 100; @@ -674,6 +676,7 @@ } } } + dr.Close(); conn.Close(); } diff --git a/EMS_Forms/Form_EventManager.cs b/EMS_Forms/Form_EventManager.cs index b18c45b..84807b2 100644 --- a/EMS_Forms/Form_EventManager.cs +++ b/EMS_Forms/Form_EventManager.cs @@ -64,6 +64,7 @@ comboBox_name.Items.Add(name); } + dr.Close(); conn.Close(); diff --git a/Forms/FrmMnModify.cs b/Forms/FrmMnModify.cs index 31cfc5f..d036360 100644 --- a/Forms/FrmMnModify.cs +++ b/Forms/FrmMnModify.cs @@ -68,15 +68,7 @@ questionGrid.Rows[idx].Cells[1].Value = sr.question; } } - /// 选中对象 - /// - /// - /// - /// - private void buttonX1_Click(object sender, EventArgs e) - { - globecontrol.Globe.Action = EnumAction3D.SelectObject; - } + /// /// 选中某一行 /// diff --git a/Forms/FrmPipelineModelDataBase.cs b/Forms/FrmPipelineModelDataBase.cs index 2acf0ca..7ce573f 100644 --- a/Forms/FrmPipelineModelDataBase.cs +++ b/Forms/FrmPipelineModelDataBase.cs @@ -35,19 +35,7 @@ ds = _ds; InitializeComponent(); } - /// - /// 单击选择shp格式文件 - /// - /// - /// - private void btnBrowseModel_Click(object sender, EventArgs e) - { - saveFileDialog1.Filter = "*.lgd|*.lgd"; - if (saveFileDialog1.ShowDialog() == DialogResult.OK) - { - txtModelLayer.Text = saveFileDialog1.FileName; - } - } + /// /// 窗体初始化事件处理 /// @@ -100,49 +88,6 @@ } } } - - private object convertFieldValue(string fieldname, object obj) - { - if (obj == null) - return null; - - try - { - string type = fields_types[fieldname].ToString(); - switch (type) - { - case "string": - return obj.ToString(); - case "int": - //return 101; - int intResult; - if (int.TryParse(obj.ToString(), out intResult)) - return intResult; - else - return null; - case "double": - //return 202.5; - double doubleResult; - if (double.TryParse(obj.ToString(), out doubleResult)) - return doubleResult; - else - return null; - case "date": - DateTime dtResult; - if (DateTime.TryParse(obj.ToString(), out dtResult)) - return dtResult; - else - return null; - } - return null; - } - catch (Exception ex) - { - MessageBox.Show(ex.ToString()); - return null; - } - } - public string lgdFilePath = ""; /// /// 选择管线颜色 @@ -610,33 +555,6 @@ { this.Close(); } - - private void cmbLayer_SelectedIndexChanged(object sender, EventArgs e) //选择图层 - { - GSOLayer layer = ctl.Globe.Layers.GetLayerByCaption(selectLayerName); - GSOFeatures features = layer.GetAllFeatures(); - if (features.Length == 0) - return; - - cmbFrom.Items.Clear(); - cmbTo.Items.Clear(); - cmbRadius.Items.Clear(); - cmbID.Items.Clear(); - for (int i = 0; i < features[0].GetFieldCount(); i++) - { - GeoScene.Data.GSOFieldDefn fielddef = (GeoScene.Data.GSOFieldDefn)(features[0].GetFieldDefn(i)); - - cmbFrom.Items.Add(fielddef.Name); - cmbTo.Items.Add(fielddef.Name); - cmbRadius.Items.Add(fielddef.Name); - cmbID.Items.Add(fielddef.Name); - } - cmbFrom.SelectedItem = "Deep1"; - cmbTo.SelectedItem = "Deep2"; - cmbRadius.SelectedItem = "Diameter"; - cmbID.SelectedItem = "Handle"; - } - private void buttonXLayerPath_Click(object sender, EventArgs e)//单击 选择shp格式的文件 { OpenFileDialog dlg = new OpenFileDialog(); diff --git a/Forms/FrmPipelineModelDataOneStep.cs b/Forms/FrmPipelineModelDataOneStep.cs index 18afda7..ec93b8a 100644 --- a/Forms/FrmPipelineModelDataOneStep.cs +++ b/Forms/FrmPipelineModelDataOneStep.cs @@ -38,19 +38,7 @@ layerTree = _layerTree; InitializeComponent(); } - /// - /// 单击选择shp格式文件 - /// - /// - /// - private void btnBrowseModel_Click(object sender, EventArgs e) - { - saveFileDialog1.Filter = "*.lgd|*.lgd"; - if (saveFileDialog1.ShowDialog() == DialogResult.OK) - { - txtModelLayer.Text = saveFileDialog1.FileName; - } - } + /// /// 窗体初始化事件处理 /// @@ -107,48 +95,7 @@ } } - private object convertFieldValue(string fieldname, object obj) - { - if (obj == null) - return null; - - try - { - string type = fields_types[fieldname].ToString(); - switch (type) - { - case "string": - return obj.ToString(); - case "int": - //return 101; - int intResult; - if (int.TryParse(obj.ToString(), out intResult)) - return intResult; - else - return null; - case "double": - //return 202.5; - double doubleResult; - if (double.TryParse(obj.ToString(), out doubleResult)) - return doubleResult; - else - return null; - case "date": - DateTime dtResult; - if (DateTime.TryParse(obj.ToString(), out dtResult)) - return dtResult; - else - return null; - } - return null; - } - catch (Exception ex) - { - MessageBox.Show(ex.ToString()); - return null; - } - } - + public string lgdFilePath = ""; /// /// 选择管线颜色 @@ -673,32 +620,6 @@ return featDs; } - private void cmbLayer_SelectedIndexChanged(object sender, EventArgs e) //选择图层 - { - GSOLayer layer = ctl.Globe.Layers.GetLayerByCaption(selectLayerName); - GSOFeatures features = layer.GetAllFeatures(); - if (features.Length == 0) - return; - - cmbFrom.Items.Clear(); - cmbTo.Items.Clear(); - cmbRadius.Items.Clear(); - cmbID.Items.Clear(); - for (int i = 0; i < features[0].GetFieldCount(); i++) - { - GeoScene.Data.GSOFieldDefn fielddef = (GeoScene.Data.GSOFieldDefn)(features[0].GetFieldDefn(i)); - - cmbFrom.Items.Add(fielddef.Name); - cmbTo.Items.Add(fielddef.Name); - cmbRadius.Items.Add(fielddef.Name); - cmbID.Items.Add(fielddef.Name); - } - cmbFrom.SelectedItem = "Deep1"; - cmbTo.SelectedItem = "Deep2"; - cmbRadius.SelectedItem = "Diameter"; - cmbID.SelectedItem = "Handle"; - } - private void buttonXLayerPath_Click(object sender, EventArgs e)//单击 选择shp格式的文件 { OpenFileDialog dlg = new OpenFileDialog(); @@ -949,38 +870,6 @@ } //txtLayername.Text = type + layername; } - /// - /// 连接数据库 - /// - /// - /// - private void buttonX1_Click(object sender, EventArgs e) - { - if (ds == null) - { - //没连的话,直接连接审核库; //审核库配置读配置文件 - string dbIp = Utility.sgdbip; - string database = Utility.sgdbname; - string user = Utility.sgdbuser; - string pass = Utility.sgdbpwd; - - if (!Utility.isNetworkConnectionSuccess(dbIp.Trim())) - { - MessageBox.Show("网络连接失败!", "提示"); - return; - } - - ds = ctl.Globe.DataManager.OpenOracleDataSource(dbIp + "/" + database, "", "", user, pass); - if (ds == null) - { - MessageBox.Show("数据库连接失败!", "提示", MessageBoxButtons.OK, MessageBoxIcon.Warning); - } - else - { - btnCreateModel.Enabled = true; - } - } - } private void btnClose_Click(object sender, EventArgs e) { diff --git a/Forms/FrmShRK.cs b/Forms/FrmShRK.cs index 0e2e722..f1d83cb 100644 --- a/Forms/FrmShRK.cs +++ b/Forms/FrmShRK.cs @@ -215,6 +215,7 @@ { sourcefeatds = sourcefeat as GSOFeatureDataset; } + if (sourcefeatds == null) return; sourcefeatds.Open(); GSOFeatures sourcefeatures = sourcefeatds.GetAllFeatures(); @@ -251,6 +252,7 @@ { desfeatds = desfeat as GSOFeatureDataset; } + if (desfeatds == null) return; desfeatds.Open(); //向新数据集写入字段 diff --git a/FrmAccessoriesSensor.cs b/FrmAccessoriesSensor.cs index 09fcdf1..2a7a80e 100644 --- a/FrmAccessoriesSensor.cs +++ b/FrmAccessoriesSensor.cs @@ -209,7 +209,7 @@ chart1.Series[0].Points.DataBindXY(dic.Keys, dic.Values); for (int m = 0; m < dic.Values.Count; m++) { - if (chart1.Series[0].Points[m].YValues[0].ToString() != "0") + if (chart1.Series[0].Points[m]!=null&&chart1.Series[0].Points[m].YValues[0].ToString() != "0") { chart1.Series[0].Points[m].Label = chart1.Series[0].Points[m].YValues[0].ToString(); } diff --git a/FrmAccessoriesgather.cs b/FrmAccessoriesgather.cs index 9e331e1..a475d9e 100644 --- a/FrmAccessoriesgather.cs +++ b/FrmAccessoriesgather.cs @@ -338,7 +338,7 @@ chart1.Series[0].Points.DataBindXY(dic.Keys, dic.Values); for (int m = 0; m < dic.Values.Count; m++) { - if (chart1.Series[0].Points[m].YValues[0].ToString() != "0") + if (chart1.Series[0].Points[m]!=null&&chart1.Series[0].Points[m].YValues[0].ToString() != "0") { chart1.Series[0].Points[m].Label = chart1.Series[0].Points[m].YValues[0].ToString(); } diff --git a/FrmAccessoryAnalysis.cs b/FrmAccessoryAnalysis.cs index 71d4579..44d4065 100644 --- a/FrmAccessoryAnalysis.cs +++ b/FrmAccessoryAnalysis.cs @@ -66,39 +66,6 @@ globeControl1.Refresh(); } /// - /// 键盘按键按下事件处理 - /// - /// - /// - private void txtRadius_KeyPress(object sender, KeyPressEventArgs e) - { - TextBox text = sender as TextBox; - if ((e.KeyChar < 48 || e.KeyChar > 57) && (e.KeyChar != 8) && (int)e.KeyChar != 46) - { - e.Handled = true; - } - if ((int)e.KeyChar == 46) //小数点 - { - if (text.Text.Length <= 0) - e.Handled = true; //小数点不能在第一位 - else //处理不规则的小数点 - { - float f; - float oldf; - bool b1 = false, b2 = false; - b1 = float.TryParse(text.Text, out oldf); - b2 = float.TryParse(text.Text + e.KeyChar.ToString(), out f); - if (b2 == false) - { - if (b1 == true) - e.Handled = true; - else - e.Handled = false; - } - } - } - } - /// /// 确定按钮事件处理 /// /// diff --git a/FrmAddValve.cs b/FrmAddValve.cs index 34d2fec..5f405b9 100644 --- a/FrmAddValve.cs +++ b/FrmAddValve.cs @@ -486,56 +486,6 @@ } } - - - - - - - - private void cmbLayer_SelectedIndexChanged(object sender, EventArgs e) - { - GSOLayer layer = globeControl1.Globe.Layers.GetLayerByCaption(selectLayerName); - GSOFeatures features = layer.GetAllFeatures(); - if (features.Length == 0) - return; - - combPath.Items.Clear(); - combZ.Items.Clear(); - combModelName.Items.Clear(); - - for (int i = 0; i < features[0].GetFieldCount(); i++) - { - GeoScene.Data.GSOFieldDefn fielddef = (GeoScene.Data.GSOFieldDefn)(features[0].GetFieldDefn(i)); - combPath.Items.Add(fielddef.Name); - combZ.Items.Add(fielddef.Name); - combModelName.Items.Add(fielddef.Name); - } - combModelName.SelectedItem = "编号"; - combPath.SelectedItem = "模型路径"; - if (combfile.SelectedIndex != -1) - { - - string layerCaption = combfile.SelectedItem.ToString().Trim(); - rukuLayer = globeControl1.Globe.Layers.GetLayerByCaption(layerCaption); - if (rukuLayer != null) - { - combPath.Items.Clear(); - combZ.Items.Clear(); - combModelName.Items.Clear(); - - } - for (int i = 0; i < features[0].GetFieldCount(); i++) - { - GeoScene.Data.GSOFieldDefn fielddef = (GeoScene.Data.GSOFieldDefn)(features[0].GetFieldDefn(i)); - combPath.Items.Add(fielddef.Name); - combZ.Items.Add(fielddef.Name); - combModelName.Items.Add(fielddef.Name); - } - combModelName.SelectedItem = "编号"; - combPath.SelectedItem = "模型路径"; - } - } /// /// 单击选择shp格式文件 /// diff --git a/FrmAddWellShp.cs b/FrmAddWellShp.cs index bb79ec0..a249725 100644 --- a/FrmAddWellShp.cs +++ b/FrmAddWellShp.cs @@ -478,32 +478,6 @@ } } } - - private void cmbLayer_SelectedIndexChanged(object sender, EventArgs e) - { - GSOLayer layer = globeControl1.Globe.Layers.GetLayerByCaption(selectLayerName); - GSOFeatures features = layer.GetAllFeatures(); - if (features.Length == 0) - return; - - combCode.Items.Clear(); - combDeep.Items.Clear(); - combModelName.Items.Clear(); - combAngle.Items.Clear(); - - for (int i = 0; i < features[0].GetFieldCount(); i++) - { - GeoScene.Data.GSOFieldDefn fielddef = (GeoScene.Data.GSOFieldDefn)(features[0].GetFieldDefn(i)); - combCode.Items.Add(fielddef.Name); - combDeep.Items.Add(fielddef.Name); - combModelName.Items.Add(fielddef.Name); - combAngle.Items.Add(fielddef.Name); - } - combCode.SelectedItem = "附属物编码"; - combDeep.SelectedItem = "井深"; - combModelName.SelectedItem = "编号"; - combAngle.SelectedItem = "符号角度"; - } /// /// 单击选择shp格式文件 /// diff --git a/FrmAddYuBiZiShp.cs b/FrmAddYuBiZiShp.cs index b312d51..332f037 100644 --- a/FrmAddYuBiZiShp.cs +++ b/FrmAddYuBiZiShp.cs @@ -383,80 +383,7 @@ } } - private void cmbLayer_SelectedIndexChanged(object sender, EventArgs e) - { - GSOLayer layer = globeControl1.Globe.Layers.GetLayerByCaption(selectLayerName); - GSOFeatures features = layer.GetAllFeatures(); - if (features.Length == 0) - return; - - combCode.Items.Clear(); - combDeep.Items.Clear(); - combModelName.Items.Clear(); - //comboLoad.Items.Clear(); - for (int i = 0; i < features[0].GetFieldCount(); i++) - { - GeoScene.Data.GSOFieldDefn fielddef = (GeoScene.Data.GSOFieldDefn)(features[0].GetFieldDefn(i)); - combCode.Items.Add(fielddef.Name); - combDeep.Items.Add(fielddef.Name); - combModelName.Items.Add(fielddef.Name); - //comboLoad.Items.Add(fielddef.Name); - } - combCode.SelectedItem = "附属物编码"; - combDeep.SelectedItem = "Z坐标"; - combModelName.SelectedItem = "编号"; - //comboLoad.SelectedItem = "模型路径"; - } - - private void buttonXLayerPath_Click(object sender, EventArgs e) - { - OpenFileDialog dlg = new OpenFileDialog(); - dlg.Filter = "*.shp|*.shp"; - dlg.Multiselect = false; - if (dlg.ShowDialog() == DialogResult.OK) - { - GSOLayer layer = globeControl1.Globe.Layers.Add(dlg.FileName); - string txtMessage = valiYBdata(layer); - if (txtMessage != "") - { - button3.Enabled = false; - //textBoxLayer.Text = ""; - combCode.Items.Clear(); - combDeep.Items.Clear(); - combModelName.Items.Clear(); - globeControl1.Globe.Layers.Remove(layer); - FrmValiDataShowErrorMessage showErrorMessage = new FrmValiDataShowErrorMessage(dlg.FileName, txtMessage); - showErrorMessage.ShowDialog(); - return; - } - else - { - button3.Enabled = true; - //textBoxLayer.Text = dlg.FileName; - selectLayerName = layer.Caption; - txtLayerName.Text = layer.Caption; - GSOFeatures features = layer.GetAllFeatures(); - if (features.Length == 0) - return; - - combCode.Items.Clear(); - combDeep.Items.Clear(); - combModelName.Items.Clear(); - for (int i = 0; i < features[0].GetFieldCount(); i++) - { - GeoScene.Data.GSOFieldDefn fielddef = (GeoScene.Data.GSOFieldDefn)(features[0].GetFieldDefn(i)); - combCode.Items.Add(fielddef.Name); - combDeep.Items.Add(fielddef.Name); - combModelName.Items.Add(fielddef.Name); - //comboLoad.Items.Add(fielddef.Name); - } - combCode.SelectedItem = "管点编码"; - combDeep.SelectedItem = "Z坐标"; - combModelName.SelectedItem = "编号"; - } - } - } - + private void FrmAddYuBiZiShp_FormClosing(object sender, FormClosingEventArgs e) { globeControl1.Globe.Refresh(); diff --git a/FrmAllPipelineStatis.cs b/FrmAllPipelineStatis.cs index 6421a26..a6eea29 100644 --- a/FrmAllPipelineStatis.cs +++ b/FrmAllPipelineStatis.cs @@ -84,7 +84,7 @@ chartAllAreaPipeline.Series["管线"].Points.DataBindXY(pipelineLengthAndType.Keys, pipelineLengthAndType.Values); for (int m = 0; m < pipelineLengthAndType.Values.Count; m++) { - if (chartAllAreaPipeline.Series["管线"].Points[m].YValues[0].ToString() != "0") + if (chartAllAreaPipeline.Series["管线"].Points[m]!=null&&chartAllAreaPipeline.Series["管线"].Points[m].YValues[0].ToString() != "0") { chartAllAreaPipeline.Series["管线"].Points[m].Label = chartAllAreaPipeline.Series[0].Points[m].YValues[0].ToString(); } @@ -94,7 +94,7 @@ } catch (Exception ex) { - //LogError.PublishError(ex); + LogHelper.WriteLog(typeof(FrmAllPipelineStatis), ex.Message); } } @@ -147,7 +147,7 @@ } DataTable dt = OledbHelper.QueryTable(sql); - if (dt != null && dt.Rows.Count > 0) + if (dt != null && dt.Rows.Count > 0 && chartAllAreaPipeline.Series["管线"].Points[indexHit]!=null) { dataGridViewX1.DataSource = dt; panel.Visible = true; diff --git a/FrmAllWorkWellStatis.cs b/FrmAllWorkWellStatis.cs index 6fec7af..6af8e4c 100644 --- a/FrmAllWorkWellStatis.cs +++ b/FrmAllWorkWellStatis.cs @@ -52,7 +52,7 @@ chartAllAreaPipeline.Series["井盖"].Points.DataBindXY(workWellLengthAndType.Keys, workWellLengthAndType.Values); for (int m = 0; m < workWellLengthAndType.Values.Count; m++) { - if (chartAllAreaPipeline.Series["井盖"].Points[m].YValues[0].ToString().Trim() != "0") + if (chartAllAreaPipeline.Series["井盖"].Points[m]!=null&&chartAllAreaPipeline.Series["井盖"].Points[m].YValues[0].ToString().Trim() != "0") { chartAllAreaPipeline.Series["井盖"].Points[m].Label = chartAllAreaPipeline.Series[0].Points[m].YValues[0].ToString(); } @@ -60,7 +60,7 @@ } catch (Exception ex) { - //LogError.PublishError(ex); + LogHelper.WriteLog(typeof(FrmAllWorkWellStatis), ex.Message); } } diff --git a/FrmBSQDuoBianXingStatis.cs b/FrmBSQDuoBianXingStatis.cs index e8b7d52..3e889b6 100644 --- a/FrmBSQDuoBianXingStatis.cs +++ b/FrmBSQDuoBianXingStatis.cs @@ -60,7 +60,7 @@ { for (int m = 0; m < bsq1.Values.Count; m++) { - if (chart1.Series["标识器"].Points[m].YValues[0].ToString() != "0") + if (chart1.Series["标识器"].Points[m]!=null&&chart1.Series["标识器"].Points[m].YValues[0].ToString() != "0") { count += Convert.ToInt16(chart1.Series[0].Points[m].YValues[0].ToString()); chart1.Series["标识器"].Points[m].Label = chart1.Series[0].Points[m].YValues[0].ToString(); diff --git a/FrmBSQDuoBianXingStreet.cs b/FrmBSQDuoBianXingStreet.cs index 2005ebb..1db5777 100644 --- a/FrmBSQDuoBianXingStreet.cs +++ b/FrmBSQDuoBianXingStreet.cs @@ -63,7 +63,7 @@ chartStatis.Series[0].Points.DataBindXY(bsq.Keys, bsq.Values); for (int m = 0; m < bsq.Values.Count; m++) { - if (chartStatis.Series[0].Points[m].YValues[0].ToString().Trim() != "0") + if (chartStatis.Series[0].Points[m]!=null&&chartStatis.Series[0].Points[m].YValues[0].ToString().Trim() != "0") { count += Convert.ToInt16(chartStatis.Series[0].Points[m].YValues[0].ToString()); chartStatis.Series[0].Points[m].Label = chartStatis.Series[0].Points[m].YValues[0].ToString(); diff --git a/FrmBSQStatis.cs b/FrmBSQStatis.cs index 390a55c..4aa0ee6 100644 --- a/FrmBSQStatis.cs +++ b/FrmBSQStatis.cs @@ -95,6 +95,8 @@ } } } + + dr.Close(); conn.Close(); for (int i = 0; i < typeLists.Count; i++) { @@ -123,7 +125,7 @@ chartStatis.Series[0].Points.DataBindXY(bsq.Keys, bsq.Values); for (int m = 0; m < bsq.Values.Count; m++) { - if (chartStatis.Series[0].Points[m].YValues[0].ToString().Trim() != "0") + if (chartStatis.Series[0].Points[m]!=null&&chartStatis.Series[0].Points[m].YValues[0].ToString().Trim() != "0") { //count += Convert.ToInt16(chartStatis.Series[0].Points[m].YValues[0].ToString()); chartStatis.Series[0].Points[m].Label = chartStatis.Series[0].Points[m].YValues[0].ToString(); diff --git a/FrmBSQStreet.cs b/FrmBSQStreet.cs index 9d88adb..7fbacad 100644 --- a/FrmBSQStreet.cs +++ b/FrmBSQStreet.cs @@ -44,7 +44,7 @@ chartStatis.Series[0].Points.DataBindXY(bsq.Keys, bsq.Values); for (int m = 0; m < bsq.Values.Count; m++) { - if (chartStatis.Series[0].Points[m].YValues[0].ToString().Trim() != "0") + if (chartStatis.Series[0].Points[m]!=null&&chartStatis.Series[0].Points[m].YValues[0].ToString().Trim() != "0") { count += Convert.ToInt16(chartStatis.Series[0].Points[m].YValues[0].ToString()); chartStatis.Series[0].Points[m].Label = chartStatis.Series[0].Points[m].YValues[0].ToString(); diff --git a/FrmBoosterValvers.cs b/FrmBoosterValvers.cs index 5061efc..df9b62b 100644 --- a/FrmBoosterValvers.cs +++ b/FrmBoosterValvers.cs @@ -236,199 +236,6 @@ count = 0; } } - /// - /// 添加火苗 - /// - /// - /// - /// - /// - private GSOFeature AddFire(double x,double y,double z) - { - // 烟火示例 - - string strResPath = Application.StartupPath + "/Resource"; - - // 烟火粒子示例,由三个发射器构成 - GSOGeoParticle geoParticle = new GSOGeoParticle(); - geoParticle.SetPosition(x, y, z); // 添加到这个经纬度位置 - geoParticle.AltitudeMode = EnumAltitudeMode.RelativeToGround; - - GSORingParticleEmitter emitter = new GSORingParticleEmitter(); - emitter.TexturePath = strResPath + "/ParticleImage/flare.png"; - - emitter.SetSizeFix(1, 1); - emitter.VelFix = 1; - emitter.VelRnd = 5; - - emitter.AngleXYFix = 0; - emitter.AngleXYRnd = 180; - - emitter.AngleXZFix = 90; - emitter.AngleXZRnd = 0; - - emitter.LifeFix = 0.5f; - emitter.LifeRnd = 0.0f; - - emitter.RotFix = 0; - emitter.RotRnd = 0; - - emitter.RotVelFix = 0; - emitter.RotVelRnd = 0; - - emitter.EmitPerSec = 100; - - // 采用线性插值生成粒子的初始颜色 - emitter.ColorRndStart = Color.White; - emitter.ColorRndEnd = Color.Red; - - - GSOColorParticleEffector effector2 = new GSOColorParticleEffector(); - effector2.SetColorChanged(0, -1, -1, 0); - effector2.StartTime = 0.0f; - effector2.EndTime = -1.0f; - emitter.AddEffector(effector2); - - // 将三个发射器添加到粒子对象中 - geoParticle.AddEmitter(emitter); - - geoParticle.Play(); - - GSOFeature feature = new GSOFeature(); - - feature.Geometry = geoParticle; - - globeControl1.Globe.MemoryLayer.AddFeature(feature); - - - return feature; - } - - /// - /// 添加喷泉 - /// - /// - private GSOFeature AddFountain() - { - string strResPath = Application.StartupPath + "/Resource"; - - GSOGeoParticle geoParticle = new GSOGeoParticle(); - geoParticle.SetPosition(116.314, 39.84, 0); // 添加到这个经纬度位置 - - GSOPointParticleEmitter emitter = new GSOPointParticleEmitter(); - emitter.TexturePath = strResPath + "/ParticleImage/test.png"; - - emitter.SetSizeFix(0.5f, 2); - emitter.VelFix = 10; - emitter.VelRnd = 2; - - emitter.GravityAcc = 9.8f; - emitter.AngleXYFix = 0; - emitter.AngleXYRnd = 180; - - emitter.AngleXZFix = 88; - emitter.AngleXZRnd = 2; - - //emitter.InnerRadius = 0; - // emitter.OuterRadius = 0.03f; - - emitter.LifeFix = 5.0f; - emitter.LifeRnd = 1.0f; - - emitter.RotFix = 0; - emitter.RotRnd = 0; - - emitter.RotVelFix = 0; - emitter.RotVelRnd = 0; - - emitter.EmitPerSec = 1000; - emitter.ColorRndStart = Color.FromArgb(33, 255, 255, 255); - emitter.ColorRndEnd = Color.FromArgb(11, 255, 255, 255); - emitter.IsLumAdded = false; - - // 将三个发射器添加到粒子对象中 - geoParticle.AddEmitter(emitter); - - geoParticle.Play(); - GSOFeature feature = new GSOFeature(); - - feature.Geometry = geoParticle; - - //globeControl1.Globe.MemoryLayer.AddFeature(feature); - globeControl1.Globe.FlyToFeature(feature); - - return feature; - } - - /// - /// 添加水柱 - /// - /// - private GSOFeature AddWaterLine() - { - string strResPath = Application.StartupPath + "/Resource"; - - GSOGeoParticle geoParticle = new GSOGeoParticle(); - geoParticle.SetPosition(116.308, 39.84, 0); // 添加到这个经纬度位置 - - GSOPointParticleEmitter emitter = new GSOPointParticleEmitter(); - - emitter.TexturePath = strResPath + "/ParticleImage/drop3.png"; - - geoParticle.TimerInterval = 1; - - emitter.SetSizeFix(2.0f, 2.0f); - - emitter.VelFix = 50; - emitter.VelRnd = 2; - - // emitter.IsLumAdded = false; - - emitter.GravityAcc = 9.8f; - emitter.AngleXYFix = 0; - emitter.AngleXYRnd = 2; - - emitter.AngleXZFix = 60; - emitter.AngleXZRnd = 2; - - //emitter.InnerRadius = 0; - // emitter.OuterRadius = 0.1f; - - emitter.LifeFix = 5.0f; - emitter.LifeRnd = 1.0f; - - emitter.RotFix = 0; - emitter.RotRnd = 0; - - emitter.RotVelFix = 0; - emitter.RotVelRnd = 0; - - emitter.EmitPerSec = 1500; - - emitter.ColorRndStart = Color.FromArgb(100, 222, 222, 222); - emitter.ColorRndEnd = Color.FromArgb(50, 222, 222, 222); - - /* - - GSOScaleParticleEffector effector1 = new GSOScaleParticleEffector(); - effector1.SetScale(0.2f, 0.2f); - effector1.StartTime = 0; - effector1.EndTime = -1; // 负数表示整个粒子生命结束 - emitter.AddEffector(effector1); - */ - - // 将三个发射器添加到粒子对象中 - geoParticle.AddEmitter(emitter); - - geoParticle.Play(); - GSOFeature feature = new GSOFeature(); - - feature.Geometry = geoParticle; - - //globeControl1.Globe.MemoryLayer.AddFeature(feature); - globeControl1.Globe.FlyToFeature(feature); - - return feature; - } + } } diff --git a/FrmBufferAnalysis.cs b/FrmBufferAnalysis.cs index f711133..db8ca59 100644 --- a/FrmBufferAnalysis.cs +++ b/FrmBufferAnalysis.cs @@ -123,39 +123,6 @@ } } /// - /// 半径文本框的键盘按键按下事件处理 - /// - /// - /// - private void txtRadius_KeyPress(object sender, KeyPressEventArgs e) - { - TextBox text = sender as TextBox; - if ((e.KeyChar < 48 || e.KeyChar > 57) && (e.KeyChar != 8) && (int)e.KeyChar != 46) - { - e.Handled = true; - } - if ((int)e.KeyChar == 46) //小数点 - { - if (text.Text.Length <= 0) - e.Handled = true; //小数点不能在第一位 - else //处理不规则的小数点 - { - float f; - float oldf; - bool b1 = false, b2 = false; - b1 = float.TryParse(text.Text, out oldf); - b2 = float.TryParse(text.Text + e.KeyChar.ToString(), out f); - if (b2 == false) - { - if (b1 == true) - e.Handled = true; - else - e.Handled = false; - } - } - } - } - /// /// 窗体关闭事件处理 /// /// diff --git a/FrmBufferAnalysisBSQ.cs b/FrmBufferAnalysisBSQ.cs index 24a96ca..f54208f 100644 --- a/FrmBufferAnalysisBSQ.cs +++ b/FrmBufferAnalysisBSQ.cs @@ -137,35 +137,7 @@ } } - private void txtRadius_KeyPress(object sender, KeyPressEventArgs e) - { - TextBox text = sender as TextBox; - if ((e.KeyChar < 48 || e.KeyChar > 57) && (e.KeyChar != 8) && (int)e.KeyChar != 46) - { - e.Handled = true; - } - if ((int)e.KeyChar == 46) //小数点 - { - if (text.Text.Length <= 0) - e.Handled = true; //小数点不能在第一位 - else //处理不规则的小数点 - { - float f; - float oldf; - bool b1 = false, b2 = false; - b1 = float.TryParse(text.Text, out oldf); - b2 = float.TryParse(text.Text + e.KeyChar.ToString(), out f); - if (b2 == false) - { - if (b1 == true) - e.Handled = true; - else - e.Handled = false; - } - } - } - } - + private void FrmBufferAnalysis_FormClosing(object sender, FormClosingEventArgs e) { //Form1.y = 0; @@ -316,27 +288,6 @@ } } - private void FlyToMenu_Click(object sender, EventArgs e) - { - if (m_feature != null) - { - if (m_feature.Geometry != null && m_feature.Geometry.Type == EnumGeometryType.GeoPolyline3D) - { - GSOGeoPolyline3D line = m_feature.Geometry as GSOGeoPolyline3D; - double length = line.GetSpaceLength(true, 6378137); - GSOGeoPolyline3D lineLine = line.GetSegment(0, length / 2); - GSOPoint3d point3d = lineLine[lineLine.PartCount - 1][lineLine[lineLine.PartCount - 1].Count - 1]; - - globeControl1.Globe.FlyToPosition(point3d, EnumAltitudeMode.Absolute, 0, 45, 5); - } - else - { - globeControl1.Globe.FlyToFeature(m_feature, 0, 45, 3); - } - LightMenu_Click(sender, e); - } - } - private void LightMenu_Click(object sender, EventArgs e) { flashflag = "single"; diff --git a/FrmDataBaseOpt.cs b/FrmDataBaseOpt.cs index b0c4b5d..8d7b69d 100644 --- a/FrmDataBaseOpt.cs +++ b/FrmDataBaseOpt.cs @@ -362,6 +362,7 @@ dbCombor.Items.Add(dblist[i].title); } } + /* /// /// 从配置文件读取数据库参数配置 /// @@ -428,6 +429,8 @@ } } + * */ + /* /// /// 向配置文件写入连接数据库的参数配置 /// @@ -485,6 +488,7 @@ MessageBox.Show(exp.ToString()); } } + * */ /// /// /// diff --git a/FrmDatabaseParaSetting.cs b/FrmDatabaseParaSetting.cs index a6fea46..63b596b 100644 --- a/FrmDatabaseParaSetting.cs +++ b/FrmDatabaseParaSetting.cs @@ -152,6 +152,7 @@ this.DialogResult = DialogResult.OK; this.Close(); } + /* /// /// 从配置文件读取数据库连接参数配置 /// @@ -218,6 +219,8 @@ } } + * */ + /* /// /// 向配置文件写入数据库参数配置 /// @@ -276,7 +279,7 @@ MessageBox.Show(ex.ToString()); } } - + */ /// /// 取消按钮事件处理 /// diff --git a/FrmDatabaseParaSetting2.cs b/FrmDatabaseParaSetting2.cs index 932d05e..96a87d5 100644 --- a/FrmDatabaseParaSetting2.cs +++ b/FrmDatabaseParaSetting2.cs @@ -148,6 +148,7 @@ this.DialogResult = DialogResult.OK; this.Close(); } + /* /// /// 从配置文件读取数据库连接参数配置 /// @@ -214,6 +215,8 @@ } } + * */ + /* /// /// 向配置文件写入数据库参数配置 /// @@ -272,7 +275,7 @@ MessageBox.Show(exp.ToString()); } } - + */ /// /// 取消按钮事件处理 /// diff --git a/FrmDiameterQuery.cs b/FrmDiameterQuery.cs index 68c948b..9a5215b 100644 --- a/FrmDiameterQuery.cs +++ b/FrmDiameterQuery.cs @@ -77,18 +77,7 @@ isBetween = true; } } - /// - /// 键盘按键按下事件处理 - /// - /// - /// - private void textBoxX1_KeyPress(object sender, KeyPressEventArgs e) - { - if ((e.KeyChar < 48 || e.KeyChar > 57) && e.KeyChar != 8) - { - e.Handled = true;//屏蔽 - } - } + bool isBetween = false; /// diff --git a/FrmDocumentEdit.cs b/FrmDocumentEdit.cs index aab2d31..e78a7ff 100644 --- a/FrmDocumentEdit.cs +++ b/FrmDocumentEdit.cs @@ -256,121 +256,6 @@ } - // - /// 将本地文件上传到指定的服务器(HttpWebRequest方法) - /// - /// 文件上传到的服务器 - /// 要上传的本地文件(全路径) - /// 文件上传后的名称 - /// 上传进度条 - /// 成功返回1,失败返回0 - private int Upload_Request(string address, string fileNamePath, string saveName, ProgressBar progressBar) - { - int returnValue = 0; - // 要上传的文件 - FileStream fs = new FileStream(fileNamePath, FileMode.Open, FileAccess.Read); - BinaryReader r = new BinaryReader(fs); - //时间戳 - string strBoundary = "----------" + DateTime.Now.Ticks.ToString("x"); - byte[] boundaryBytes = Encoding.ASCII.GetBytes("/r/n--" + strBoundary + "/r/n"); - //请求头部信息 - StringBuilder sb = new StringBuilder(); - sb.Append("--"); - sb.Append(strBoundary); - sb.Append("\r\n"); - sb.Append("Content-Disposition: form-data; name=\""); - sb.Append("file"); - sb.Append("\"; filename=\""); - sb.Append(saveName); - sb.Append("\""); - sb.Append("\r\n"); - sb.Append("Content-Type: "); - sb.Append("application/octet-stream"); - sb.Append("\r\n"); - sb.Append("\r\n"); - string strPostHeader = sb.ToString(); - byte[] postHeaderBytes = Encoding.UTF8.GetBytes(strPostHeader); - // 根据uri创建HttpWebRequest对象 - HttpWebRequest httpReq = (HttpWebRequest)WebRequest.Create(new Uri(address)); - httpReq.Method = "POST"; - //对发送的数据不使用缓存 - httpReq.AllowWriteStreamBuffering = false; - //设置获得响应的超时时间(300秒) - httpReq.Timeout = 300000; - httpReq.ContentType = "multipart/form-data; boundary=" + strBoundary; - long length = fs.Length + postHeaderBytes.Length + boundaryBytes.Length; - long fileLength = fs.Length; - httpReq.ContentLength = length; - try - { - progressBar.Maximum = int.MaxValue; - progressBar.Minimum = 0; - progressBar.Value = 0; - //每次上传4k - int bufferLength = 4096; - byte[] buffer = new byte[bufferLength]; - //已上传的字节数 - long offset = 0; - //开始上传时间 - DateTime startTime = DateTime.Now; - int size = r.Read(buffer, 0, bufferLength); - Stream postStream = httpReq.GetRequestStream(); - //发送请求头部消息 - postStream.Write(postHeaderBytes, 0, postHeaderBytes.Length); - while (size > 0) - { - postStream.Write(buffer, 0, size); - offset += size; - progressBar.Value = (int)(offset * (int.MaxValue / length)); - TimeSpan span = DateTime.Now - startTime; - double second = span.TotalSeconds; - //lblTime.Text = "已用时:" + second.ToString("F2") + "秒"; - //if (second > 0.001) - //{ - // lblSpeed.Text = " 平均速度:" + (offset / 1024 / second).ToString("0.00") + "KB/秒"; - //} - //else - //{ - // lblSpeed.Text = " 正在连接…"; - //} - //lblState.Text = "已上传:" + (offset * 100.0 / length).ToString("F2") + "%"; - //lblSize.Text = (offset / 1048576.0).ToString("F2") + "M/" + (fileLength / 1048576.0).ToString("F2") + "M"; - Application.DoEvents(); - size = r.Read(buffer, 0, bufferLength); - } - //添加尾部的时间戳 - postStream.Write(boundaryBytes, 0, boundaryBytes.Length); - postStream.Close(); - //获取服务器端的响应 - WebResponse webRespon = httpReq.GetResponse(); - Stream s = webRespon.GetResponseStream(); - StreamReader sr = new StreamReader(s); - //读取服务器端返回的消息 - String sReturnString = sr.ReadLine(); - s.Close(); - sr.Close(); - if (sReturnString == "Success") - { - returnValue = 1; - } - else if (sReturnString == "Error") - { - returnValue = 0; - } - } - catch(Exception ex) - { - returnValue = 0; - string str = ex.ToString(); - } - finally - { - fs.Close(); - r.Close(); - } - return returnValue; - } - private void btn_file_Click(object sender, EventArgs e) { OpenFileDialog dlg = new OpenFileDialog(); diff --git a/FrmExportCADS.cs b/FrmExportCADS.cs index 98772ea..59629dd 100644 --- a/FrmExportCADS.cs +++ b/FrmExportCADS.cs @@ -108,65 +108,6 @@ MessageBox.Show("请选中要导出的图层!", "提示", MessageBoxButtons.OK, MessageBoxIcon.Warning); } } - private Boolean MerageToFile(GSOFeatures features, String strDestFile, String strProj4)//图层追加 - { - if (features == null) - { - return false; - } - Boolean bSuccess = false; - - string strDir = GSOUtility.GetFileDir(strDestFile); - string strLPRJFile = GSOUtility.ChangeExt(strDestFile, ".lprj"); - string strExt = GSOUtility.GetFileExt(strDestFile); - - // 如果投影文件存在,投影以投影文件为准 - if (File.Exists(strLPRJFile)) - { - // 如果是dxf,则这样处理 - if (strExt.ToLower() == ".dxf") - { - string strTempSrcFile = strDir + "srcFeatures_dxftmp" + strExt; - globeControl1.Globe.DataManager.SaveFeatureData(features, strTempSrcFile, strLPRJFile, 4); - bSuccess = GSOUtility.MergeTwoDXFFileFeatures(strDestFile, strTempSrcFile); - File.Delete(strTempSrcFile); - } - else - { - GSOFeatures srcFeatures = globeControl1.Globe.DataManager.ReadFeatureData(strDestFile); - int nCount = features.Length; - int i = 0; - for (i = 0; i < nCount; i++) - { - srcFeatures.Add(features[i]); - } - bSuccess = globeControl1.Globe.DataManager.SaveFeatureData(srcFeatures, strDestFile, strLPRJFile, 4); - } - } - else - { - // 如果是dxf,则这样处理 - if (strExt.ToLower() == ".dxf") - { - string strTempSrcFile = strDir + "srcFeatures_dxftmp" + strExt; - globeControl1.Globe.DataManager.SaveFeatureData(features, strTempSrcFile, strProj4, 0); - bSuccess = GSOUtility.MergeTwoDXFFileFeatures(strDestFile, strTempSrcFile); - File.Delete(strTempSrcFile); - } - else - { - GSOFeatures srcFeatures = globeControl1.Globe.DataManager.ReadFeatureData(strDestFile); - int nCount = features.Length; - int i = 0; - for (i = 0; i < nCount; i++) - { - srcFeatures.Add(features[i]); - } - bSuccess = globeControl1.Globe.DataManager.SaveFeatureData(srcFeatures, strDestFile, strProj4, 0); - } - } - return bSuccess; - } /// /// 关闭按钮事件处理 /// diff --git a/FrmHDMAnalysis3.cs b/FrmHDMAnalysis3.cs index 4f73af6..2ada735 100644 --- a/FrmHDMAnalysis3.cs +++ b/FrmHDMAnalysis3.cs @@ -436,29 +436,6 @@ } layerTemp.RemoveAllFeature(); } - private void Export(GSOPoint3d _pnt, double r) - { - GSOPoint3ds pnts = new GSOPoint3ds(); - GSOPoint3d pnt = new GSOPoint3d(); - pnt.X = _pnt.X; - pnt.Y = _pnt.Y; - pnt.Z = _pnt.Z; - pnts.Add(pnt); - pnt.X = _pnt.X; - pnt.Y = _pnt.Y - 0.0000000005; - pnt.Z = _pnt.Z; - pnts.Add(pnt); - GSOGeoPolyline3D line = new GSOGeoPolyline3D(); - line.AddPart(pnts); - GSOGeoPolygon3D polygon = line.CreateBuffer(r * 2, true, 5, true, false); - GSOPoint3ds points = polygon[0]; - GSOGeoPolyline3D newLine = new GSOGeoPolyline3D(); - newLine.AddPart(points); - newLine.AltitudeMode = EnumAltitudeMode.RelativeToGround; - GSOFeature newFeature = new GSOFeature(); - newFeature.Geometry = newLine; - globeControl1.Globe.MemoryLayer.AddFeature(newFeature); - } private void ExportCAD(double a, double b, double r) { diff --git a/FrmHotFuncStat.cs b/FrmHotFuncStat.cs index c980f34..2eb1476 100644 --- a/FrmHotFuncStat.cs +++ b/FrmHotFuncStat.cs @@ -421,13 +421,6 @@ } } - private void HFS_Pderive_Click(object sender, EventArgs e) - { - if (TV_Files.SelectedNode != null) - { - HFSClass.GuideEdit_form("G", TV_Files, int.Parse(((ToolStripMenuItem)sender).Tag.ToString())); - } - } private void 导入ToolStripMenuItem_Click(object sender, EventArgs e) { @@ -530,22 +523,8 @@ } } - private void 导出ToolStripMenuItem1_Click(object sender, EventArgs e) - { - 导出ToolStripMenuItem2_Click(sender, e); - } + - private void TV_HFSSrchRslt_AfterCollapse(object sender, TreeViewEventArgs e) - { - e.Node.ImageIndex = 0; - } - - private void TV_HFSSrchRslt_AfterExpand(object sender, TreeViewEventArgs e) - { - HFSClass.ADD_TreeNode(TV_Files, e.Node); - e.Node.ImageIndex = 1; - } - private void 导出ToolStripMenuItem1_Click_1(object sender, EventArgs e) { if ((TV_HFSSrchRslt.SelectedNode != null) && (TV_HFSSrchRslt.SelectedNode.Parent != null)) diff --git a/FrmLayerControl.cs b/FrmLayerControl.cs index e7917c3..28fa14d 100644 --- a/FrmLayerControl.cs +++ b/FrmLayerControl.cs @@ -312,26 +312,7 @@ layerManagerNode.Expand(); terrainManagerNode.Expand(); } - /// - /// 刷新节点树 - /// - private void RefreshDataTree() - { - layerTree2.Nodes[0].Nodes.Clear(); - Int32 nCount = globeControl2.Globe.Layers.Count; - Int32 i = 0; - for (i = 0; i < nCount; i++) - { - GSODataset dataSpace = globeControl2.Globe.Layers[i].Dataset; - TreeNode node = new TreeNode(); - node.Text = dataSpace.Name; - node.ImageIndex = 0; - node.SelectedImageIndex = 0; - node.Checked = true; - node.Tag = dataSpace; - layerTree2.Nodes[0].Nodes.Add(node); - } - } + /// /// 目标图层按钮事件处理 /// @@ -494,22 +475,8 @@ } } } - /// - /// 改变指定节点的选中状态 - /// - /// - /// - private void CheckTreeNode(TreeNode node, Boolean bChecked) - { - CheckChildTreeNode(node, bChecked); - // 对于kml图层,如果当前处理的节点是true,那么要把所有的祖宗节点置为true - // 只有所有节点都未false,那么这个节点才为false - // CheckFatherTreeNode(node, bChecked); - globeControl1.Globe.Refresh(); - globeControl2.Globe.Refresh(); - - } + private void CheckChildTreeNode(TreeNode node, Boolean bChecked) { if (node == null) @@ -696,59 +663,7 @@ //} //CheckControl(e); } - /// - /// 树节点选中方法 - /// - /// - private void CheckControl(TreeViewEventArgs e) - { - if (e.Action != TreeViewAction.Unknown) - { - if (e.Node != null && !Convert.IsDBNull(e.Node)) - { - CheckParentNode(e.Node); - if (e.Node.Nodes.Count > 0) - { - CheckAllChildNodes(e.Node, e.Node.Checked); - } - } - } - } - /// - /// 改变所有子节点的状态 - /// - /// - /// - private void CheckAllChildNodes(TreeNode pn, bool IsChecked) - { - foreach (TreeNode tn in pn.Nodes) - { - tn.Checked = IsChecked; - if (tn.Tag.ToString().Contains("|")) - { - string nodeTag = tn.Tag.ToString().Split('|')[1]; - GSOLayer layer = globeControl1.Globe.Layers.GetLayerByCaption(nodeTag); - if (layer != null) - { - layer.Visible = IsChecked; - globeControl1.Globe.Refresh(); - } - } - if (tn.Tag is GSOFeature) - { - if (tn.Nodes.Count == 0) - { - GSOFeature feat = tn.Tag as GSOFeature; - feat.Visible = IsChecked; - globeControl1.Globe.Refresh(); - } - } - if (tn.Nodes.Count > 0) - { - CheckAllChildNodes(tn, IsChecked); - } - } - } + /// /// 改变父节点的选中状态,此处为所有子节点不选中时才取消父节点选中,可以根据需要修改 /// diff --git a/FrmLogin.cs b/FrmLogin.cs index 320fdd5..2afe46e 100644 --- a/FrmLogin.cs +++ b/FrmLogin.cs @@ -59,70 +59,6 @@ textBoxPassWord.Clear(); } } - - /// - /// 验证端口号 - /// - /// - private bool ValiPort() - { - Ping p = new Ping();//创建Ping对象p - PingReply pr = p.Send(Utility.localicenseserverip);//向指定IP或者主机名的计算机发送ICMP协议的ping数据包 - if (pr.Status == IPStatus.Success)//如果ping成功 - { - try - { - TcpClient tcpc = new TcpClient(Utility.localicenseserverip, Utility.localicenseserverport);//对IP地址为"192.168.0.105"的计算机的1500端口提出连接申请 - tcpc.Close(); - return true; - } - catch (Exception ex) - { - MessageBox.Show("端口连接错误!" + ex.Message); - return false; - } - } - else - { - int times = 0;//重新连接次数; - int count = 2;//设置尝试次数 - while (times < count) - { - //Thread.Sleep(1000);//等待时间(方便测试的话,你可以改为1000) - pr = p.Send(Utility.localicenseserverip); - - if (pr.Status == IPStatus.Success) - { - try - { - TcpClient tcpc = new TcpClient(Utility.localicenseserverip, Utility.localicenseserverport);//对IP地址为"192.168.0.105"的计算机的1500端口提出连接申请 - tcpc.Close(); - return true; - } - catch (Exception ex) - { - MessageBox.Show("端口连接错误!" + ex.Message); - return false; - } - } - else - { - times++; - if (times < count) - { - continue; - } - else - { - MessageBox.Show("重新尝试连接失败"); - return false; - } - } - - } - return false; - } - } /// /// 验证用户名、密码 /// diff --git a/FrmMetadata.cs b/FrmMetadata.cs index 886f65a..0365372 100644 --- a/FrmMetadata.cs +++ b/FrmMetadata.cs @@ -27,11 +27,7 @@ InitializeComponent(); loadTreeView(layerTree); } - private void FrmMetadata_Load(object sender, EventArgs e) - { - //this.ntLblC.Text = "nn"; - // loadTreeView(layerTree); - } + private void loadTreeView(TreeView tv)//构建图层树 { try diff --git a/FrmMetadataStat.cs b/FrmMetadataStat.cs index 790658a..e7696c6 100644 --- a/FrmMetadataStat.cs +++ b/FrmMetadataStat.cs @@ -197,9 +197,5 @@ } } - private void buttonX1_Click(object sender, EventArgs e) - { - drawChart(); - } } } diff --git a/FrmPatrolerManager.cs b/FrmPatrolerManager.cs index 37f8ffd..9e66aeb 100644 --- a/FrmPatrolerManager.cs +++ b/FrmPatrolerManager.cs @@ -109,82 +109,8 @@ this.winGridViewPager1.AllToExport = table; } - /// - /// 编辑 - /// - /// - /// - private void winGridViewPager1_OnEditSelected(object sender, EventArgs e) - { - - DataGridView grid = sender as DataGridView; - if (grid != null && grid.SelectedRows.Count>0) - { - DataGridViewRow row = grid.SelectedRows[0]; - try - { - long dbid = long.Parse(row.Cells["编号"].Value.ToString()); - String name = row.Cells["姓名"].Value.ToString(); - String sex = row.Cells["性别"].Value.ToString(); - String age = row.Cells["年龄"].Value.ToString(); - string phone = row.Cells["电话"].Value.ToString(); - age = String.IsNullOrEmpty(age.ToString().Trim()) ? "1" : age.ToString().Trim(); - FrmPatrolerEdit frm = new FrmPatrolerEdit(dbid.ToString(), name, age, sex, phone); - frm.reloadGrid += new ReloadPatrolerGrid(LoadData); - frm.ShowDialog(); - winGridViewPager1.Refresh(); - } - catch (Exception ex) - { - MessageBox.Show("编辑失败:" + ex.ToString(), "错误", MessageBoxButtons.OK, MessageBoxIcon.Error); - } - } - else - { - MessageBox.Show("没有选择记录", "提示"); - } - - } - - /// - /// 删除 - /// - /// - /// - private void winGridViewPager1_OnDeleteSelected(object sender, EventArgs e) - { - DataGridView grid = sender as DataGridView; - if (grid != null && grid.SelectedRows.Count > 0) - { - DataGridViewRow row = grid.SelectedRows[0]; - long dbid = long.Parse(row.Cells["编号"].Value.ToString()); - try - { - string state = row.Cells["状态"].Value.ToString(); - if ("在线".Equals(state)) - { - if (MessageBox.Show("确定注销?", "确认", MessageBoxButtons.YesNo, MessageBoxIcon.Question) == DialogResult.Yes) - { - String sql = "update patroler t set t.accountstate='LEAVER' where t.dbid=" + dbid; - OracleUtils.ExecuteNonQuery(OracleUtils.ConnectionString, CommandType.Text, sql); - } - } - else { - MessageBox.Show("人员不在线,无法注销", "信息"); - } - } - catch (Exception ex) - { - MessageBox.Show("人员注销失败:" + ex.ToString(), "错误", MessageBoxButtons.OK, MessageBoxIcon.Error); - } - } - else - { - MessageBox.Show("没有选择记录", "提示"); - } - } - - + + private void LoadData() { int pageIndex = winGridViewPager1.PagerInfo.CurrenetPageIndex; diff --git a/FrmRoadHDM.cs b/FrmRoadHDM.cs index e765313..e871dd5 100644 --- a/FrmRoadHDM.cs +++ b/FrmRoadHDM.cs @@ -333,31 +333,6 @@ this.Cursor = Cursors.Default; } } - - private void Export(GSOPoint3d _pnt, double r) - { - GSOPoint3ds pnts = new GSOPoint3ds(); - GSOPoint3d pnt = new GSOPoint3d(); - pnt.X = _pnt.X; - pnt.Y = _pnt.Y; - pnt.Z = _pnt.Z; - pnts.Add(pnt); - pnt.X = _pnt.X; - pnt.Y = _pnt.Y - 0.0000000005; - pnt.Z = _pnt.Z; - pnts.Add(pnt); - GSOGeoPolyline3D line = new GSOGeoPolyline3D(); - line.AddPart(pnts); - GSOGeoPolygon3D polygon = line.CreateBuffer(r * 2, true, 5, true, false); - GSOPoint3ds points = polygon[0]; - GSOGeoPolyline3D newLine = new GSOGeoPolyline3D(); - newLine.AddPart(points); - newLine.AltitudeMode = EnumAltitudeMode.RelativeToGround; - GSOFeature newFeature = new GSOFeature(); - newFeature.Geometry = newLine; - globeControl1.Globe.MemoryLayer.AddFeature(newFeature); - } - private void ExportCAD(double a, double b, double r) { GSOPoint3ds pnts = new GSOPoint3ds(); diff --git a/FrmUserAdd.cs b/FrmUserAdd.cs index c612ab4..f826427 100644 --- a/FrmUserAdd.cs +++ b/FrmUserAdd.cs @@ -231,24 +231,6 @@ //cbxRegion.SelectedIndexChanged += new EventHandler(cbxRegion_SelectedIndexChanged); } } - /// - /// 下拉框选中项改变事件处理 - /// - /// - /// - private void cbxRegion_SelectedIndexChanged(object sender, EventArgs e) - { - string sql = ""; - //string sql = "select casic_role.\"name\" from casic_role join casic_regionrole on casic_role.\"id\"=casic_regionrole.\"rid\" where casic_regionrole.\"reid\"=" + region[cbxRegion.SelectedItem.ToString().Trim()]; - DataTable dt = OledbHelper.QueryTable(sql); - if (dt != null && dt.Rows.Count > 0) - { - comboBoxExRegionRole.Items.Clear(); - for (int i = 0; i < dt.Rows.Count; i++) - { - comboBoxExRegionRole.Items.Add(dt.Rows[i][0].ToString().Trim());//部门角色 - } - } - } + } } diff --git a/FrmUserManager.cs b/FrmUserManager.cs index 571f0f0..ae254bc 100644 --- a/FrmUserManager.cs +++ b/FrmUserManager.cs @@ -81,11 +81,6 @@ } } } - //创建新用户 - private void buttonX2_Click(object sender, EventArgs e) - { - FrmUserAdd frm = new FrmUserAdd(-1); - frm.ShowDialog(); - } + } } diff --git a/FrmValveStatistics.cs b/FrmValveStatistics.cs index 545d56c..dd76777 100644 --- a/FrmValveStatistics.cs +++ b/FrmValveStatistics.cs @@ -54,7 +54,7 @@ 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") + if (chaFamenStatis.Series["阀门"].Points[m]!=null&&chaFamenStatis.Series["阀门"].Points[m].YValues[0].ToString() != "0") { chaFamenStatis.Series["阀门"].Points[m].Label = chaFamenStatis.Series[0].Points[m].YValues[0].ToString(); } diff --git a/Frm_password_reset.cs b/Frm_password_reset.cs index 7b51039..b9e5dc3 100644 --- a/Frm_password_reset.cs +++ b/Frm_password_reset.cs @@ -41,6 +41,7 @@ } catch (Exception ex) { + LogHelper.WriteLog(typeof(Frm_password_reset), ex.Message); } } private void initCombox() diff --git a/FrmpipeDeepstatis.cs b/FrmpipeDeepstatis.cs index e156db4..1a84d6c 100644 --- a/FrmpipeDeepstatis.cs +++ b/FrmpipeDeepstatis.cs @@ -307,7 +307,7 @@ chart1.Series[j].Points.DataBindXY(dic1.Keys, dic1.Values); for (int m = 0; m < dic1.Values.Count; m++) { - if (chart1.Series[j].Points[m].YValues[0].ToString() != "0") + if (chart1.Series[j].Points[m]!=null&&chart1.Series[j].Points[m].YValues[0].ToString() != "0") { chart1.Series[j].Points[m].Label = chart1.Series[j].Points[m].YValues[0].ToString(); diff --git a/FrmpipeDiametergather.cs b/FrmpipeDiametergather.cs index 30674de..057b09d 100644 --- a/FrmpipeDiametergather.cs +++ b/FrmpipeDiametergather.cs @@ -263,6 +263,7 @@ if (layer != null && layer is GSOFeatureLayer) { GSOFeatureLayer flayer = layer as GSOFeatureLayer; + if (layer == null) return; GSOFeatures features = flayer.GetAllFeatures(); if (features.Length > 0) { diff --git a/FrmpipeMaterialGather.cs b/FrmpipeMaterialGather.cs index c133ec3..398b884 100644 --- a/FrmpipeMaterialGather.cs +++ b/FrmpipeMaterialGather.cs @@ -280,6 +280,7 @@ if (layer != null && layer is GSOFeatureLayer) { GSOFeatureLayer flayer = layer as GSOFeatureLayer; + if (flayer == null) return; GSOFeatures features = flayer.GetAllFeatures(); if (features.Length > 0) { @@ -332,7 +333,7 @@ chart1.Series[j].Points.DataBindXY(dic1.Keys, dic1.Values); for (int m = 0; m < dic1.Values.Count; m++) { - if (chart1.Series[j].Points[m].YValues[0].ToString() != "0") + if (chart1.Series[j].Points[m]!=null&&chart1.Series[j].Points[m].YValues[0].ToString() != "0") { chart1.Series[j].Points[m].Label = chart1.Series[j].Points[m].YValues[0].ToString(); } diff --git a/Frmpipediameterstatis.cs b/Frmpipediameterstatis.cs index c0ed80a..50f8170 100644 --- a/Frmpipediameterstatis.cs +++ b/Frmpipediameterstatis.cs @@ -286,6 +286,7 @@ chart1.Series.Add(layerCaption); GSOFeatureLayer flayer = layer as GSOFeatureLayer; + if (layer == null) return; GSOFeatures features = flayer.GetAllFeatures(); if (features.Length > 0) { diff --git "a/GKT_Forms/F_GKT\346\225\260\346\215\256\350\276\223\345\205\245\350\276\223\345\207\272.cs" "b/GKT_Forms/F_GKT\346\225\260\346\215\256\350\276\223\345\205\245\350\276\223\345\207\272.cs" index c7bffd5..4db7d5d 100644 --- "a/GKT_Forms/F_GKT\346\225\260\346\215\256\350\276\223\345\205\245\350\276\223\345\207\272.cs" +++ "b/GKT_Forms/F_GKT\346\225\260\346\215\256\350\276\223\345\205\245\350\276\223\345\207\272.cs" @@ -198,12 +198,7 @@ } DialogResult = DialogResult.OK;//将当前窗体的对话框返回值设为OK } - private void treeView1_NodeMouseClick(object sender, TreeNodeMouseClickEventArgs e) - { - dir_Ok = comboBox_Disk.Text + e.Node.FullPath; - //dir = comboBox_Disk.Text + e.Node.FullPath; - e.Node.SelectedImageIndex = e.Node.ImageIndex; - } + string tempstr = ""; private void button1_Click(object sender, EventArgs e) { diff --git a/HFS_Forms/Frm_HFSprojedits.cs b/HFS_Forms/Frm_HFSprojedits.cs index 96dd76f..3c232a1 100644 --- a/HFS_Forms/Frm_HFSprojedits.cs +++ b/HFS_Forms/Frm_HFSprojedits.cs @@ -126,16 +126,6 @@ Close(); } - - - private void TB_ProjName_KeyPress(object sender, KeyPressEventArgs e) - { - if (HFSAClass.Files_NameChar(e) == 0) - e.Handled = true; - if (e.KeyChar == '\r') - OK_Click(sender, e); - } - private void Frm_HFSProjedit_Load(object sender, EventArgs e) { @@ -175,10 +165,6 @@ } } - private void Cancel_Click(object sender, EventArgs e) - { - this.Close(); - } private void Cancel_Click_1(object sender, EventArgs e) { diff --git a/MainFrm.cs b/MainFrm.cs index 2c305a0..ed2685b 100644 --- a/MainFrm.cs +++ b/MainFrm.cs @@ -617,7 +617,7 @@ } catch (Exception ex) { - + LogHelper.WriteLog(typeof(MainFrm), ex.Message); } } @@ -1768,7 +1768,7 @@ } catch (Exception ex) { - //LogError.PublishError(ex); + LogHelper.WriteLog(typeof(MainFrm), ex.Message); } } @@ -2026,6 +2026,7 @@ } catch (Exception ex) { + LogHelper.WriteLog(typeof(MainFrm), ex.Message); result = false; } finally @@ -2316,220 +2317,6 @@ string filename = Utility.filename; List g1layername = new List(); /// - /// 构建图层列表目录树 - /// - /// - private void loadTreeView(TreeView tv) - { - try - { - XmlDocument doc = new XmlDocument(); - doc.Load(filename); - XmlNodeList Params1 = doc.SelectNodes("/Params/layers"); - tv.ShowLines = false; - tv.CheckBoxes = true; - - foreach (XmlNode paramsNode in Params1) //layers - { - foreach (XmlNode layerNode in paramsNode) //layer - { - TreeNode nodelayer = new TreeNode(); - string layerName = layerNode.Attributes["label"].Value; - nodelayer.Text = layerName; - - if (layerNode.HasChildNodes != false) - { - tv.Nodes.Add(nodelayer); - foreach (XmlNode layerchildNode in layerNode) //layerchild - { - if (layerchildNode.Name == "layerchild") - { - TreeNode nodelayerchild = new TreeNode(); - string layerType = layerchildNode.Attributes["type"].Value; - string layerName1 = layerchildNode.Attributes["layer"].Value; - string layerchildName = layerchildNode.Attributes["label"].Value; - if (layerType == "locaserver") - { - if (layerchildNode.Attributes["isRoad"] != null) - { - roadLayerName = layerchildName; - } - dictionaryNetLayerNameAndCaption.Add(layerName1, layerchildName); - - nodelayerchild.Text = layerchildName; - nodelayerchild.Tag = layerType + "|" + layerchildName; - nodelayerchild.Checked = true; - nodelayer.Nodes.Add(nodelayerchild); - } - else - { - if (layerchildNode.Attributes["isPipeLine"] != null) - { - m_PipelineLayerNames.Add(layerchildName); - } - if (layerchildNode.Attributes["isWorkWell"] != null) - { - workwellLayerNames.Add(layerchildName); - } - if (layerchildNode.Attributes["isValve"] != null) - { - valueLayerNames.Add(layerchildName); - } - //if (layerchildNode.Attributes["isInstrument"] != null) - if (layerchildNode.Attributes["isAccess"] != null) - { - instrumenLayerNames.Add(layerchildName); - } - //if (layerchildNode.Attributes["isPipeFitting"] != null) - if (layerchildNode.Attributes["isCharacter"] != null) - { - pipefittingLayerNames.Add(layerchildName); - } - bool boollayer = AddLayers(layerName1, layerchildName); - nodelayerchild.Text = layerchildName; - nodelayerchild.Tag = layerType + "|" + layerchildName; - nodelayerchild.Checked = boollayer; - if (layerchildName.Contains("特征管点")) - { - nodelayerchild.Checked = false; - setLayerVisible(layerName1); - } - - nodelayer.Nodes.Add(nodelayerchild); - g1layername.Add(layerName1); - } - } - else if (layerchildNode.Name == "layertype") - { - TreeNode nodelayerchild = new TreeNode(); - string layerType = layerchildNode.Attributes["label"].Value; - nodelayerchild.Text = layerType; - nodelayerchild.Tag = layerType; - nodelayerchild.Checked = true; - nodelayer.Nodes.Add(nodelayerchild); - if (layerchildNode.HasChildNodes == true) - { - foreach (XmlNode childNodeLayer in layerchildNode) - { - if (childNodeLayer.HasChildNodes == true) - { - TreeNode nodelayerchild2 = new TreeNode(); - string layer = childNodeLayer.Attributes["label"].Value; - nodelayerchild2.Text = layer; - nodelayerchild2.Tag = layer; - nodelayerchild2.Checked = true; - nodelayerchild.Nodes.Add(nodelayerchild2); - foreach (XmlNode n in childNodeLayer) - { - TreeNode nodelayerchild1 = new TreeNode(); - string layerName1 = n.Attributes["layer"].Value; - string layerchildName = n.Attributes["label"].Value; - string layerType1 = n.Attributes["type"].Value; - if (n.Attributes["isPipeLine"] != null) - { - m_PipelineLayerNames.Add(layerchildName); - } - if (n.Attributes["isWorkWell"] != null) - { - workwellLayerNames.Add(layerchildName); - } - if (n.Attributes["isValve"] != null) - { - valueLayerNames.Add(layerchildName); - } - if (n.Attributes["isAccess"] != null) - //if (n.Attributes["isInstrument"] != null) - { - instrumenLayerNames.Add(layerchildName); - } - if (n.Attributes["isPipeFitting"] != null) - { - pipefittingLayerNames.Add(layerchildName); - } - bool boollayer = AddLayers(layerName1, layerchildName); - nodelayerchild1.Text = layerchildName; - nodelayerchild1.Tag = layerType1 + "|" + layerchildName; - nodelayerchild1.Checked = boollayer; - if (layerchildName.Contains("特征管点")) - { - nodelayerchild1.Checked = false; - setLayerVisible(layerName1); - } - - nodelayerchild2.Nodes.Add(nodelayerchild1); - - g1layername.Add(layerName1); - } - } - else - { - TreeNode nodelayerchild1 = new TreeNode(); - string layerName1 = childNodeLayer.Attributes["layer"].Value; - string layerchildName = childNodeLayer.Attributes["label"].Value; - string layerType1 = childNodeLayer.Attributes["type"].Value; - if (childNodeLayer.Attributes["isPipeLine"] != null) - { - m_PipelineLayerNames.Add(layerchildName); - } - if (childNodeLayer.Attributes["isWorkWell"] != null) - { - workwellLayerNames.Add(layerchildName); - } - if (childNodeLayer.Attributes["isValve"] != null) - { - valueLayerNames.Add(layerchildName); - } - if (childNodeLayer.Attributes["isAccess"] != null) - //if (childNodeLayer.Attributes["isInstrument"] != null) - { - instrumenLayerNames.Add(layerchildName); - } - if (childNodeLayer.Attributes["isPipeFitting"] != null) - { - pipefittingLayerNames.Add(layerchildName); - } - bool boollayer = AddLayers(layerName1, layerchildName); - nodelayerchild1.Text = layerchildName; - nodelayerchild1.Tag = layerType1 + "|" + layerchildName; - nodelayerchild1.Checked = boollayer; - if (layerchildName.Contains("特征管点")) - { - nodelayerchild1.Checked = false; - setLayerVisible(layerName1); - } - nodelayerchild.Nodes.Add(nodelayerchild1); - g1layername.Add(layerName1); - } - } - } - } - } - } - else - { - tv.Nodes.Add(nodelayer); - } - } - } - - foreach (TreeNode tn in tv.Nodes) - { - if (tn.Nodes.Count > 0) - { - foreach (TreeNode tnChild in tn.Nodes) - { - if (tnChild.Checked) - tn.Checked = true; - } - } - } - } - catch (Exception ex) - { - //LogError.PublishError(ex); - } - } - /// /// 获取目标图层 /// /// @@ -2629,21 +2416,11 @@ } catch (Exception ex) { - //LogError.PublishError(ex); + LogHelper.WriteLog(typeof(MainFrm), ex.Message); return false; } } /// - /// 菜单上的 三维导航 工具按钮 - /// - /// - /// - private void buttonItem86_Click(object sender, EventArgs e) - { - globeControl1.Globe.Action = EnumAction3D.ActionNull; - } - - /// /// 地上模式 菜单按钮 /// /// @@ -3026,67 +2803,11 @@ } Image printImage; - /// - /// 打印 菜单 - /// - /// - /// - private void buttonItem13_Click(object sender, EventArgs e) - { - Point pt1 = new Point(Convert.ToInt32(0), Convert.ToInt32(0)); - Point pt2 = new Point(Convert.ToInt32(panelEx5.Width), Convert.ToInt32(panelEx5.Height)); - int mapWidth = 0; - int mapHeight = 0; - Point pt = getUpperLeftPoint(pt1, pt2, out mapWidth, out mapHeight); - printImage = new Bitmap(Convert.ToInt32(panelEx5.Width), Convert.ToInt32(panelEx5.Height)); - Graphics g = Graphics.FromImage(printImage); - g.CopyFromScreen(pt, new Point(0, 0), new Size(Convert.ToInt32(panelEx5.Width), Convert.ToInt32(panelEx5.Height))); - - PrintDialog pd = new PrintDialog(); - try - { - if (pd.ShowDialog() == DialogResult.OK) //如果确认,将会覆盖所有的打印参数设置 - { - //打印预览 - PrintPreviewDialog ppd = new PrintPreviewDialog(); - ppd.Document = printDocument1; - if (DialogResult.OK == ppd.ShowDialog()) - { - printDocument1.Print(); //打印 - } - } - } - catch - { - printDocument1.PrintController.OnEndPrint(printDocument1, new System.Drawing.Printing.PrintEventArgs()); - } - } - + private void printDocument1_PrintPage(object sender, System.Drawing.Printing.PrintPageEventArgs e) { e.Graphics.DrawImage(printImage, 10, 10); } - - /// - /// 在窗体的底部状态栏上显示 综合管线条件查询结果 - /// - /// - /// - private void ToolStripText(string currentLayer, int dataCount) - { - if (dataCount != 0) - { - double featurelength = PipeLength(currentLayer, 0);// 统计管线的里程数 - - toolStripNumbers.Text = " 管线类型:" + currentLayer + " | 共有:" + Convert.ToString(dataCount - 1) + "条记录"; - toolStripFeatureLength.Text = " 管线里程:" + featurelength.ToString("0.00") + " 米"; - } - else - { - toolStripNumbers.Text = "管线类型: " + currentLayer + "| 共有:" + 0 + " 条记录 | "; - } - } - /// /// 统计管线的里程数 /// @@ -3402,26 +3123,6 @@ } /// - /// 绘制线 菜单 - /// - /// - /// - private void btnAddLine_Click(object sender, EventArgs e) - { - globeControl1.Globe.DestLayerFeatureAdd = globeControl1.Globe.MemoryLayer; - globeControl1.Globe.Action = EnumAction3D.DrawPolyline; - } - /// - /// 绘制面 菜单 - /// - /// - /// - private void btnAddPolygon_Click(object sender, EventArgs e) - { - globeControl1.Globe.DestLayerFeatureAdd = globeControl1.Globe.MemoryLayer; - globeControl1.Globe.Action = EnumAction3D.DrawPolygon; - } - /// /// 图层目录树 右键菜单中的 目标图层 菜单 /// /// @@ -3956,42 +3657,7 @@ // ClearUpDownTraceAnalysis(); //} - /// - /// 显示流向 功能 - /// - /// - /// - /// - private void Flow(object sender, string pipelineNameCN, bool bShow) - { - GSOFeatureLayer layer = globeControl1.Globe.Layers.GetLayerByCaption(pipelineNameCN) as GSOFeatureLayer; - GSOFeatures feats = layer.GetAllFeatures(); - for (int i = 0; i < feats.Length; i++) - { - GSOFeature feat = feats[i]; - GSOLineStyle3D lineStyle = feat.Geometry.Style as GSOLineStyle3D; - if (lineStyle != null) - { - if (lineStyle.ArrowStyle == null) - { - lineStyle.ArrowStyle = new GSOArrowStyle(); - lineStyle.ArrowStyle.BodyWidth = 2; - lineStyle.ArrowStyle.BodyLen = 6; - lineStyle.ArrowStyle.HeadWidth = 8; - lineStyle.ArrowStyle.HeadLen = 10; - lineStyle.ArrowStyle.OutlineVisible = true; - lineStyle.ArrowStyle.OutlineColor = Color.Red; - lineStyle.ArrowStyle.Speed = lineStyle.ArrowStyle.Speed / 2; - lineStyle.ArrowStyle.Play(); - } - lineStyle.ArrowVisible = bShow; - layerTree.SelectedNode = null; - } - } - globeControl1.Globe.Refresh(); - } - - + FrmCloseValves frm; /// /// 关阀分析 功能 @@ -4030,7 +3696,9 @@ curCAYNDataset.CloseValveAnalysis(lineFeature.ID, out arryResNodeID, out arryResValveID, false, true); } catch (Exception e) - { } + { + LogHelper.WriteLog(typeof(MainFrm), e.Message); + } string valveName = lineLayer.Caption; valveName = valveName.Substring(0, valveName.IndexOf("管线")); @@ -4106,7 +3774,7 @@ } catch (Exception e) { - + LogHelper.WriteLog(typeof(MainFrm), e.Message); } //目前只有燃气管线 有阀门 string valveName = lineLayer.Name; @@ -5457,7 +5125,7 @@ } catch (Exception ex) { - //MessageBox.Show(ex.ToString()); + LogHelper.WriteLog(typeof(MainFrm), ex.Message); } finally { @@ -5501,22 +5169,6 @@ } } - - /// - /// 清除所有坑 菜单 - /// - /// - /// - private void buttonItem3_Click(object sender, EventArgs e) - { - //日志记录 - LogManager.saveLog(Utility.userName, this.buttonItem3.Text); - - globeControl1.Globe.RemoveAllPits(); - } - - - ///// ///// 净距分析 菜单 ///// @@ -5554,42 +5206,8 @@ // ribbonBarTP.Visible = buttonItem34.Checked; // ribbonBarTP.Location = new Point(0, 0); //} - /// - /// 大气层 菜单 - /// - /// - /// - private void buttonItem17_Click_1(object sender, EventArgs e) - { - globeControl1.Globe.Atmosphere.Visible = !globeControl1.Globe.Atmosphere.Visible; - buttonItemSH1.Checked = globeControl1.Globe.Atmosphere.Visible; - globeControl1.Refresh(); - } - /// - /// 经纬网 菜单 - /// - /// - /// - private void buttonItem20_Click(object sender, EventArgs e) - { - globeControl1.Globe.LatLonGrid.Visible = !globeControl1.Globe.LatLonGrid.Visible; - buttonItemSH3.Checked = globeControl1.Globe.LatLonGrid.Visible; - globeControl1.Globe.Refresh(); - } - /// - /// 状态条 菜单 - /// - /// - /// - private void buttonItem21_Click_1(object sender, EventArgs e) - { - globeControl1.Globe.StatusBar.Visible = !globeControl1.Globe.StatusBar.Visible; - buttonItemSH4.Checked = globeControl1.Globe.StatusBar.Visible; - globeControl1.Globe.Refresh(); - } - - + /// /// 添加指定路径下的数据 功能 /// @@ -5680,43 +5298,7 @@ // } // return objRes; //} - /// - /// 刷新目录树 功能 - /// - private void RefreshDataTree() - { - layerTree.Nodes[0].Nodes.Clear(); - Int32 nCount = globeControl1.Globe.DataManager.DataSourceCount; - Int32 i = 0; - for (i = 0; i < nCount; i++) - { - GSODataSource dataSpace = globeControl1.Globe.DataManager[i]; - TreeNode node = new TreeNode(); - node.Text = dataSpace.Name; - node.ImageIndex = 0; - node.SelectedImageIndex = 0; - node.Checked = true; - node.Tag = dataSpace; - Int32 nDatasetCount = dataSpace.DatasetCount; - for (Int32 j = 0; j < nDatasetCount; j++) - { - GSODataset dataset = dataSpace[j]; - TreeNode subNode = new TreeNode(); - subNode.Text = dataset.Name; - subNode.ImageIndex = 0; - subNode.SelectedImageIndex = 0; - subNode.Checked = true; - subNode.Tag = dataset; - node.Nodes.Add(subNode); - } - layerTree.Nodes[0].Nodes.Add(node); - } - } - - - - - + /// /// 复合查询 菜单 @@ -5777,34 +5359,7 @@ return false; } - /// - /// 统计指定图层在指定范围内的所有feature对象 - /// - /// - /// - /// - private GSOFeatures Intersect_PointLayer(GSOGeoPolygon3D polygon, string pointLayerName) - { - GSOLayer layer = globeControl1.Globe.Layers.GetLayerByCaption(pointLayerName); - if (layer == null) - return null; - - GSOFeatureLayer flayer = layer as GSOFeatureLayer; - GSOFeatureDataset fdataset = flayer.Dataset as GSOFeatureDataset; - GSOFeatures feats; - if (polygon == null) - { - feats = flayer.GetAllFeatures(); - } - else - { - feats = flayer.FindFeaturesInPolygon(polygon, false); - } - - workWellLen.Add(pointLayerName, feats.Length); - return feats; - } - /// + /// /// 碰撞分析功能界面中 选择管线复选框 选中状态改变事件处理 /// /// @@ -5946,16 +5501,6 @@ MessageBox.Show("表格内容为空!", "提示"); } } - /// - /// 导出CAD 菜单 - /// - /// - /// - private void btnExportCAD_Click(object sender, EventArgs e) - { - FrmExportCADS frm = new FrmExportCADS(globeControl1, m_PipelineLayerNames); - frm.ShowDialog(); - } ///// ///// 区域分析 菜单 @@ -5987,16 +5532,6 @@ } } } - /// - /// 数据验证 菜单 - /// - /// - /// - private void buttonItem80_Click(object sender, EventArgs e) - { - FrmValiData frm = new FrmValiData(globeControl1); - frm.ShowDialog(); - } /// /// 根据指定图层创建图层节点并将节点添加到图层管理节点的子节点集合中 @@ -6018,56 +5553,7 @@ layerManagerNode.Expand(); } } - /// - /// 数据库备份 菜单 - /// - /// - /// - private void btnBackDatabase_Click(object sender, EventArgs e) - { - if (MessageBox.Show("是否确定要备份数据库文件", "信息", MessageBoxButtons.YesNo, MessageBoxIcon.Question) == DialogResult.Yes) - { - try - { - DateTime currentTime = DateTime.Now; - //string Dtime = currentTime.ToShortDateString().ToString("yyyy-MM-dd"); - string Dtime = currentTime.GetDateTimeFormats('D')[0].ToString(); - string Htime = DateTime.Now.ToString("HH时mm分ss秒").Trim(); - string fileName = Dtime + "(" + Htime + ")"; - string pathName = ""; - string sql = "select filename from master..sysdatabases where name='" + Utility.dbdatabase + "'"; - DataTable dt = OledbHelper.ExecuteDataTable(sql); - if (dt != null && dt.Rows.Count > 0) - { - pathName = dt.Rows[0][0].ToString().Trim(); - int count = pathName.LastIndexOf("\\") == -1 ? pathName.LastIndexOf("/") : pathName.LastIndexOf("\\"); - pathName = pathName.Substring(0, count); - } - pathName += "\\管网数据库" + fileName + ".bak"; - - OracleCommand cmdBK = new OracleCommand(); - cmdBK.CommandType = CommandType.Text; - cmdBK.Connection = connBackup; - cmdBK.CommandText = @"backup database " + Utility.dbdatabase + " to disk='" + pathName + "' with init"; - - connBackup.Open(); - cmdBK.ExecuteNonQuery(); - MessageBox.Show("数据库文件备份成功", "提示"); - } - catch (Exception ex) - { - MessageBox.Show(ex.ToString()); - } - finally - { - connBackup.Close(); - } - } - } - - - - + //GSOFeature emitterFeature; // 粒子要素 /// /// 添加火苗 功能 @@ -6598,361 +6084,15 @@ } } - - ///// - /// 添加用户仓库 菜单 - /// - /// - /// - private void buttonItem108_Click(object sender, EventArgs e) - { - FrmUserRepo frm = new FrmUserRepo(-1); - frm.ShowDialog(); - } - /// - /// 用户仓库管理 菜单 - /// - /// - /// - private void buttonItem111_Click(object sender, EventArgs e) - { - FrmUserRepoMgr frm = new FrmUserRepoMgr(); - frm.ShowDialog(); - } - /// - /// 添加分系统 菜单 - /// - /// - /// - private void buttonItem112_Click(object sender, EventArgs e) - { - //FrmAPP frm = new FrmAPP(-1); - //frm.ShowDialog(); - } - /// - /// 分系统管理 菜单 - /// - /// - /// - private void buttonItem113_Click(object sender, EventArgs e) - { - //FrmAPPMgr frm = new FrmAPPMgr(); - //frm.ShowDialog(); - } - /// - /// 添加操作 菜单 - /// - /// - /// - private void buttonItem114_Click(object sender, EventArgs e) - { - FrmOper frm = new FrmOper(-1); - frm.ShowDialog(); - } - /// - /// 操作管理 菜单 - /// - /// - /// - private void buttonItem115_Click(object sender, EventArgs e) - { - FrmOperMgr frm = new FrmOperMgr(); - frm.ShowDialog(); - } - /// - /// 添加资源 菜单 - /// - /// - /// - private void buttonItem116_Click(object sender, EventArgs e) - { - FrmRESC frm = new FrmRESC(-1); - frm.ShowDialog(); - } - /// - /// 资源管理 菜单 - /// - /// - /// - private void buttonItem117_Click(object sender, EventArgs e) - { - FrmRESCMgr frm = new FrmRESCMgr(); - frm.ShowDialog(); - } - /// - /// 添加权限 菜单 - /// - /// - /// - private void buttonItem118_Click(object sender, EventArgs e) - { - FrmPerm frm = new FrmPerm(-1); - frm.ShowDialog(); - } - /// - /// 权限管理 菜单 - /// - /// - /// - private void buttonItem119_Click(object sender, EventArgs e) - { - FrmPermMgr frm = new FrmPermMgr(); - frm.ShowDialog(); - } - /// - /// 添加访问控制 菜单 - /// - /// - /// - private void buttonItem120_Click(object sender, EventArgs e) - { - FrmAccess frm = new FrmAccess(-1); - frm.ShowDialog(); - } - /// - /// 访问控制管理 菜单 - /// - /// - /// - private void buttonItem121_Click(object sender, EventArgs e) - { - FrmAccessMgr frm = new FrmAccessMgr(); - frm.ShowDialog(); - } - /// - /// 部门类型管理 菜单 - /// - /// - /// - private void buttonItem122_Click(object sender, EventArgs e) - { - FrmRegionTypeMgr frm = new FrmRegionTypeMgr(); - frm.ShowDialog(); - } - /// - /// 用户信息管理 菜单 - /// - /// - /// - private void buttonItem128_Click_1(object sender, EventArgs e) - { - FrmUserManager frm = new FrmUserManager(); - frm.ShowDialog(); - } - /// - /// 添加角色 菜单 - /// - /// - /// - private void 添加角色_Click(object sender, EventArgs e) - { - FrmRole frm = new FrmRole(-1); - frm.ShowDialog(); - } - /// - /// 所有角色管理 菜单 - /// - /// - /// - private void 角色管理_Click(object sender, EventArgs e) - { - FrmRoleMgr frm = new FrmRoleMgr(); - frm.ShowDialog(); - } - - /// - /// 部门角色管理 菜单 - /// - /// - /// - private void buttonItem133_Click(object sender, EventArgs e) - { - FrmRegionRoleMgr frm = new FrmRegionRoleMgr(); - frm.ShowDialog(); - } - /// - /// 部门管理 菜单 - /// - /// - /// - private void buttonItem130_Click(object sender, EventArgs e) - { - FrmRegionMgr frm = new FrmRegionMgr(); - frm.ShowDialog(); - } - - /// - /// 日志管理 菜单 - /// - /// - /// - private void buttonItem135_Click(object sender, EventArgs e) - { - FrmLogManager frm = new FrmLogManager(); - frm.ShowDialog(); - } - /// - /// 传感器信息查询 菜单 - /// - /// - /// - private void buttonItem131_Click_1(object sender, EventArgs e) - { - GSOFeature selectedFeature = globeControl1.Globe.SelectedObject; - if (selectedFeature == null) - { - MessageBox.Show("请选择一个传感器对象!", "提示", MessageBoxButtons.OK, MessageBoxIcon.Information); - } - else - { - if (selectedFeature.Geometry != null && selectedFeature.Geometry.Type == EnumGeometryType.GeoModel) - { - GSOLayer layer = globeControl1.Globe.SelectedObjectLayer; - string tabelName = getTableName(layer.Caption); - string eqtID = selectedFeature.Description.Trim(); - if (tabelName != "" && eqtID != "") - { - string fields = getFields(tabelName); - if (fields != "") - { - string sql = "select " + fields + " from " + Utility.sensorDatabase + "." + tabelName + " where EqtID=" + eqtID + " order by RecordDate desc limit 1;"; - DataTable dt = MySqlHelper.queryDataTable(sql); - if (dt != null && dt.Rows.Count > 0) - { - FrmQueryMessage.ShowForm(this, dt, layer.Caption); - //queryMessage.Show(this); - } - else - { - MessageBox.Show("没有查询到相关信息!", "提示"); - } - } - else - { - MessageBox.Show("配置文件 \"sensorConfig.xml\" 有误!", "提示"); - } - } - else - { - MessageBox.Show("请选择一个传感器对象!", "提示"); - } - } - else - { - MessageBox.Show("请选择一个传感器对象!", "提示", MessageBoxButtons.OK, MessageBoxIcon.Information); - } - } - } - /// - /// 根据指定的图层的caption属性的值在配置文件中查找对应的数据库中的表的名称 - /// - /// 图层的caption属性的值 - /// 对应的数据库中的表的名称 - private string getTableName(string name) - { - string tabelName = ""; - if (Utility.sensorMarkerLayers != null) - { - for (int i = 0; i < Utility.sensorMarkerLayers.Count; i++) - { - MarkerLayer mLayer = Utility.sensorMarkerLayers[i]; - if (mLayer.layerName == name) - { - tabelName = mLayer.tableName; - break; - } - } - } - return tabelName; - } - /// - /// 根据数据库中的表的名称 查找对应的表中的字段名称的集合 - /// - /// 数据库中的表的名称 - /// 对应的表中的字段名称的集合 - private string getFields(string tabelName) - { - string fields = ""; - if (Utility.sensorMarkerLayers != null) - { - for (int i = 0; i < Utility.sensorMarkerLayers.Count; i++) - { - MarkerLayer mLayer = Utility.sensorMarkerLayers[i]; - if (mLayer.tableName.Trim() == tabelName.Trim()) - { - if (mLayer.fields != null) - { - foreach (string key in mLayer.fields.Keys) - { - string value = mLayer.fields[key]; - fields += tabelName.Trim() + "." + key + " as " + value + ","; - } - fields = fields.Remove(fields.Length - 1); - } - break; - } - } - } - return fields; - } - - /// - /// 历史曲线查询 菜单 - /// - /// - /// - private void buttonItem132_Click(object sender, EventArgs e) - { - GSOFeature selectedFeature = globeControl1.Globe.SelectedObject; - if (selectedFeature == null) - { - MessageBox.Show("请选择一个对象!", "提示", MessageBoxButtons.OK, MessageBoxIcon.Information); - } - else - { - if (selectedFeature.Geometry != null && selectedFeature.Geometry.Type == EnumGeometryType.GeoModel) - { - GSOLayer layer = globeControl1.Globe.SelectedObjectLayer; - string tabelName = getTableName(layer.Caption); - string eqtID = selectedFeature.Description; - if (tabelName != "" && eqtID != "") - { - FrmQueryHistory.ShowForm(this, tabelName, eqtID); - } - else - { - MessageBox.Show("请选择一个传感器对象!", "提示"); - } - } - else - { - MessageBox.Show("请选择一个传感器对象!", "提示", MessageBoxButtons.OK, MessageBoxIcon.Information); - } - } - } - + //定时检查传感器的状态 public System.Windows.Forms.Timer timerOfSensor = null; public int alarmValueLiuLiang = 0; public int alarmValueYaLi = 0; public int alarmValueYeTi = 0; public int alarmValueZaoSheng = 0; - /// - /// 传感器在线报警 菜单 - /// - /// - /// - private void buttonItem134_Click(object sender, EventArgs e) - { - if (timerOfSensor == null) - { - timerOfSensor = new System.Windows.Forms.Timer(); - timerOfSensor.Interval = 30000; - timerOfSensor.Tick += new EventHandler(timerOfSensor_Tick); - } - FrmQuerySensorAlarm.ShowForm(this); - } + /// /// 传感器报警 功能中的 定时器 的触发事件处理 /// @@ -7016,6 +6156,7 @@ } catch (Exception ex) { + LogHelper.WriteLog(typeof(MainFrm), ex.Message); continue; } } @@ -7025,145 +6166,7 @@ } } - - /// - /// 沿线运动 菜单 - /// - /// - /// - private void buttonItem138_Click(object sender, EventArgs e) - { - if (globeControl1.Globe.SelectedObject == null) - { - MessageBox.Show("请先选择一条线!", "提示", MessageBoxButtons.OK, MessageBoxIcon.Exclamation); - return; - } - - GSOFeature lineFeature = globeControl1.Globe.SelectedObject; - if (lineFeature.Geometry == null || lineFeature.Geometry.Type != EnumGeometryType.GeoPolyline3D) - { - MessageBox.Show("请先选择一条线!", "提示", MessageBoxButtons.OK, MessageBoxIcon.Exclamation); - return; - } - - OpenFileDialog dlg = new OpenFileDialog(); - dlg.Filter = "*.gcm;*.3ds|*.gcm;*.3ds|*.3ds|*.3ds|*.gcm|*.gcm"; - if (dlg.ShowDialog() == DialogResult.OK) - { - GSOGeoModel model = new GSOGeoModel(); - model.FilePath = dlg.FileName; - - GSOGeoDynamicRoute dynamicRoute = new GSOGeoDynamicRoute(); - dynamicRoute.ActorGeometry = model; - - GSORoute route = new GSORoute(); - GSOGeoPolyline3D geoline = (GSOGeoPolyline3D)lineFeature.Geometry; - for (int i = 0; i < geoline[0].Count; i++) - { - route.Add(geoline[0][i]); - } - route.CircleRoute = false; - route.Speed = 30; - route.RotateSpeed = 50; - route.AltitudeMode = geoline.AltitudeMode; - dynamicRoute.Route = route; - - GSOFeature feature = new GSOFeature(); - - dynamicRoute.Play(); - feature.Geometry = dynamicRoute; - - //GSOLabel gsoLabel = new GSOLabel(); - //gsoLabel.Text = "模型测试"; - //feature.Label = gsoLabel; - globeControl1.Globe.MinModelVisibleSize = 0; - - globeControl1.Globe.MemoryLayer.AddFeature(feature); - globeControl1.Globe.Refresh(); - } - } - /// - /// 回退 菜单 - /// - /// - /// - private void buttonItem99_Click(object sender, EventArgs e) - { - globeControl1.Globe.UnDoEdit(); - } - /// - /// 前进 菜单 - /// - /// - /// - private void buttonItem100_Click(object sender, EventArgs e) - { - globeControl1.Globe.ReDoEdit(); - } - /// - /// 水平净距 功能界面中的 标签内容改变事件处理 - /// - /// - /// - private void textBoxX4_TextChanged(object sender, EventArgs e) - { - string valueJingJu = textBoxX4.Text.Trim(); - if (valueJingJu != "") - { - double value = 0; - bool bl = double.TryParse(valueJingJu, out value); - if (bl) - { - labelX24.Text = "水平净距小于" + value.ToString() + "米的管线有:"; - } - } - } - /// - /// 垂直净距 功能界面中的 标签内容改变事件处理 - /// - /// - /// - private void textBoxX2_TextChanged(object sender, EventArgs e) - { - string valueJingJu = textBoxX2.Text.Trim(); - if (valueJingJu != "") - { - double value = 0; - bool bl = double.TryParse(valueJingJu, out value); - if (bl) - { - labelX23.Text = "垂直净距小于" + value.ToString() + "米的管线有:"; - } - } - } - /// - /// 覆土分析 功能界面中的 标签内容改变事件处理 - /// - /// - /// - private void textBoxX3_TextChanged(object sender, EventArgs e) - { - string valueJingJu = textBoxX3.Text.Trim(); - if (valueJingJu != "") - { - double value = 0; - bool bl = double.TryParse(valueJingJu, out value); - if (bl) - { - labelX17.Text = "覆土深度小于" + value.ToString() + "米的管线有:"; - } - } - } - - /// - /// 传感器分类查询 全区域 菜单 - /// - /// - /// - private void buttonItemSensor全区域查询_Click(object sender, EventArgs e) - { - FrmAccessoriesSensor.ShowForm(globeControl1, instrumenLayerNames, 0); - } + /// /// 传感器分类查询 绘制区域 菜单 /// @@ -7224,170 +6227,10 @@ layerTemp.RemoveAllFeature(); globeControl1.Refresh(); } - /// - /// 数字预处理 功能 - /// - /// - /// - private void 数字预处理buttonItem140_Click(object sender, EventArgs e) - { - FrmEditShapeFile frm = new FrmEditShapeFile(globeControl1); - frm.ShowDialog(this); - } - - - /// - /// 导出矢量 功能 将图层导出为kml和shp格式数据 - /// - /// - /// - private void 导出矢量buttonItem140_Click(object sender, EventArgs e) - { - /* - List m_PipelineLayerNames = new List();//线图层名称 - List workwellLayerNames = new List();//工井图层名称 - List valueLayerNames = new List();//阀门图层名称 - List instrumenLayerNames = new List();//附属物图层名称 - List pipefittingLayerNames = new List();//管件图层名称 - */ - List listVectorNames = new List(); - for (int i = 0; i < m_PipelineLayerNames.Count; i++) - { - if (m_PipelineLayerNames[i] == "移动" || m_PipelineLayerNames[i] == "联通" - || m_PipelineLayerNames[i] == "电信" || m_PipelineLayerNames[i] == "共通" - || m_PipelineLayerNames[i] == "有限电视" || m_PipelineLayerNames[i] == "交通信号" - || m_PipelineLayerNames[i] == "供电") - { - continue; - } - if (listVectorNames.Contains(m_PipelineLayerNames[i]) == false) - { - listVectorNames.Add(m_PipelineLayerNames[i]); - } - } - for (int i = 0; i < valueLayerNames.Count; i++) - { - if (listVectorNames.Contains(valueLayerNames[i]) == false) - { - listVectorNames.Add(valueLayerNames[i]); - } - } - for (int i = 0; i < workwellLayerNames.Count; i++) - { - if (listVectorNames.Contains(workwellLayerNames[i]) == false) - { - listVectorNames.Add(workwellLayerNames[i]); - } - } - for (int i = 0; i < instrumenLayerNames.Count; i++) - { - if (listVectorNames.Contains(instrumenLayerNames[i]) == false) - { - listVectorNames.Add(instrumenLayerNames[i]); - } - } - for (int i = 0; i < pipefittingLayerNames.Count; i++) - { - if (listVectorNames.Contains(pipefittingLayerNames[i]) == false) - { - listVectorNames.Add(pipefittingLayerNames[i]); - } - } - FrmExportVector frm = new FrmExportVector(globeControl1, listVectorNames); - frm.ShowDialog(); - } string citySevenLineType = ""; string cityServerLineName = ""; /// - /// 绘制城市七线 功能按钮 - /// - /// - /// - private void 绘制城市七线buttonItem140_Click(object sender, EventArgs e) - { - FrmCitySevenLineType frm = new FrmCitySevenLineType(); - if (frm.ShowDialog() == DialogResult.OK) - { - globeControl1.Globe.Action = EnumAction3D.DrawPolyline; - m_isDrawCitySevenLine = true; - m_isDrawTunnel = false; - m_AddPipeLine = false; - this.citySevenLineType = frm.citySevenLineType; - this.cityServerLineName = frm.citySevenLineName; - switch (frm.citySevenLineType) - { - case "城市红线": - GSOLayer layerRed = globeControl1.Globe.Layers.GetLayerByCaption(frm.citySevenLineType); - if (layerRed != null) - { - globeControl1.Globe.DestLayerFeatureAdd = layerRed; - layerRed.Editable = true; - } - break; - case "城市橙线": - GSOLayer layerOrange = globeControl1.Globe.Layers.GetLayerByCaption(frm.citySevenLineType); - if (layerOrange != null) - { - globeControl1.Globe.DestLayerFeatureAdd = layerOrange; - layerOrange.Editable = true; - } - break; - case "城市黄线": - GSOLayer layerYellow = globeControl1.Globe.Layers.GetLayerByCaption(frm.citySevenLineType); - if (layerYellow != null) - { - globeControl1.Globe.DestLayerFeatureAdd = layerYellow; - layerYellow.Editable = true; - } - break; - case "城市绿线": - GSOLayer layerGreen = globeControl1.Globe.Layers.GetLayerByCaption(frm.citySevenLineType); - if (layerGreen != null) - { - globeControl1.Globe.DestLayerFeatureAdd = layerGreen; - layerGreen.Editable = true; - } - break; - case "城市蓝线": - GSOLayer layerBlue = globeControl1.Globe.Layers.GetLayerByCaption(frm.citySevenLineType); - if (layerBlue != null) - { - globeControl1.Globe.DestLayerFeatureAdd = layerBlue; - layerBlue.Editable = true; - } - break; - case "城市紫线": - GSOLayer layerPurple = globeControl1.Globe.Layers.GetLayerByCaption(frm.citySevenLineType); - if (layerPurple != null) - { - globeControl1.Globe.DestLayerFeatureAdd = layerPurple; - layerPurple.Editable = true; - } - break; - case "城市黑线": - GSOLayer layerBlack = globeControl1.Globe.Layers.GetLayerByCaption(frm.citySevenLineType); - if (layerBlack != null) - { - globeControl1.Globe.DestLayerFeatureAdd = layerBlack; - layerBlack.Editable = true; - } - break; - } - } - } - /// - /// 七线审核 功能按钮 - /// - /// - /// - private void 七线审核buttonItem141_Click(object sender, EventArgs e) - { - FrmCityServerLineAnalysis frm = new FrmCityServerLineAnalysis(globeControl1, m_PipelineLayerNames); - frm.ShowDialog(this); - } - - /// /// 间距分析 开始分析按钮 分析绘制的七线和管线的距离是否符合标准 /// /// @@ -7666,25 +6509,6 @@ } } - - - /// - /// 管线自动缩进 菜单 - /// - /// - /// - private void 管线自动缩进buttonItem140_Click(object sender, EventArgs e) - { - FrmPipelineIndented frm = new FrmPipelineIndented(globeControl1, m_PipelineLayerNames, workwellLayerNames); - frm.ShowDialog(this); - } - - private void btnExportCADs_Click(object sender, EventArgs e) - { - - } - - /// /// 统计指定图层在指定范围内的所有feature对象 /// @@ -7755,8 +6579,6 @@ } - - //设置图层为隐藏 private void setLayerVisible(string layerName) { @@ -7765,27 +6587,7 @@ globeControl1.Globe.Refresh(); } - /// - /// 连接数据库 - /// - /// - /// - private void buttonItem129_Click(object sender, EventArgs e) - { - //保存日志 - LogManager.saveLog(Utility.userName, this.buttonItemSJGL4_1.Text); - - FrmDatabaseParaSetting2 frm = new FrmDatabaseParaSetting2(globeControl1); - if (frm.ShowDialog() == DialogResult.OK) - { - ds = FrmDatabaseParaSetting2.ds; - if (ds != null) - { - ds.IsCloseSaved = false; - } - } - } - + /// /// 清除渲染结果 /// @@ -7803,112 +6605,8 @@ layerTemp.RemoveAllFeature(); globeControl1.Refresh(); } - - /// - /// 绘制垂线 - /// - /// - /// - private void drawCLine(GSOPoint3d fpt, GSOPoint3d tpt) - { - GSOGeoPolyline3D pline = new GSOGeoPolyline3D(); - GSOPoint3ds pts = new GSOPoint3ds(); - pts.Add(fpt); - pts.Add(tpt); - pline.AddPart(pts); - - GSOGeoPoint3D fptg = new GSOGeoPoint3D(); - GSOGeoPoint3D tptg = new GSOGeoPoint3D(); - fptg.X = fpt.X; - fptg.Y = fpt.Y; - fptg.Z = 0; - tptg.X = tpt.X; - tptg.Y = tpt.Y; - tptg.Z = 0; - - GSOFeature gf = new GSOFeature(); - gf.Geometry = pline; - - globeControl1.Globe.MemoryLayer.AddFeature(gf); - - } - /// - /// 红线审核 - /// - /// - /// - private void buttonItem138_Click_2(object sender, EventArgs e) - { - - } - /// - /// 比较两个点是否是同一个点 - /// - /// - /// - /// - private bool comparePoint(GSOPoint3d pt1, GSOPoint3d pt2) - { - double x1 = 0; double y1 = 0; - double x2 = 0; double y2 = 0; - x1 = pt1.X; - y1 = pt1.Y; - x2 = pt2.X; - y2 = pt2.Y; - if ((x1 == x2) && (y1 == y2)) - { - return true; - } - return false; - } - /// - /// 获得点到线的垂线距离及垂点 - /// - /// - /// - /// - /// - private void comparePointLine(GSOPoint3d point, GSOGeoPolyline3D line, out double length, out GSOPoint3d pointChuiDian) - { - GSOPoint3d lineStartPoint = line[0][0]; - GSOPoint3d lineEndPoint = line[0][1]; - GSOGeoPolyline3D lineAB = new GSOGeoPolyline3D(); - GSOPoint3ds pointsAB = new GSOPoint3ds(); - pointsAB.Add(point); - pointsAB.Add(lineStartPoint); - lineAB.AddPart(pointsAB); - double lengthAB = lineAB.GetSpaceLength(false, 6378137.0); - double xieLvAB = getXieLu("", point.X, point.Y, lineStartPoint.X, lineStartPoint.Y); - double xieLvBC = getXieLu("", lineStartPoint.X, lineStartPoint.Y, lineEndPoint.X, lineEndPoint.Y); - - double tanABC = Math.Abs(xieLvAB - xieLvBC) / (1 + xieLvAB * xieLvBC); - double angle = Math.Atan(tanABC); - //if (angle > Math.PI / 2) //落在外边 - //{ - // length = 0; - //} - double lengthAD = lengthAB * Math.Sin(angle); - length = Math.Abs(lengthAD); - double lengthBD = lengthAB * Math.Cos(angle); - - GSOPoint2d point2dStart = Latlon_2_XYZ(lineStartPoint.X, lineStartPoint.Y); - double bBC = point2dStart.Y - xieLvBC * point2dStart.X; - GSOPoint2d point2dEnd = new GSOPoint2d(); - point2dEnd.X = point2dStart.X + 100; - point2dEnd.Y = point2dEnd.X * xieLvBC + bBC; - point2dEnd = XYZ_2_Latlon(point2dEnd.X, point2dEnd.Y); - - GSOPoint3d pointEnd = new GSOPoint3d(); - pointEnd.X = point2dEnd.X; - pointEnd.Y = point2dEnd.Y; - GSOGeoPolyline3D lineYanShen = new GSOGeoPolyline3D(); - GSOPoint3ds pointsYanShen = new GSOPoint3ds(); - pointsYanShen.Add(lineStartPoint); - pointsYanShen.Add(pointEnd); - lineYanShen.AddPart(pointsYanShen); - GSOGeoPolyline3D lineSegment = lineYanShen.GetSegment(0, lengthBD); - pointChuiDian = lineSegment[0][1]; - } + + /// /// 获得斜率 /// @@ -8044,255 +6742,6 @@ } /// - /// 获取与点相连的所有线以及线的点的集合 - /// - /// 选定的点所在的线 - /// 选定的点 - /// 面中不完全包含的除起点线之外所有的线 - /// 选定的点所在的点的集合 - /// 所有以选定线为起点的点的集合 - /// - private List getFeaturesPoints(GSOFeature featureSelect, GSOPoint3d lineStart, GSOFeatures selectFeatures, GSOPoint3ds ps, List listPS) - { - GSOFeatures fsStart = new GSOFeatures(); - for (int n = 0; n < selectFeatures.Length; n++) - { - if (featureSelect.ID == selectFeatures[n].ID) - { - continue; - } - GSOGeoPolyline3D newLine = selectFeatures[n].Geometry as GSOGeoPolyline3D; - if (newLine != null && newLine.PartCount > 0) - { - GSOPoint3d newLineStart = newLine[0][0]; - GSOPoint3d newLineEnd = newLine[0][newLine[0].Count - 1]; - if (lineStart.X == newLineEnd.X && lineStart.Y == newLineEnd.Y) - { - GSOPoint3ds psAdd = new GSOPoint3ds(); - for (int k = newLine[0].Count - 1; k >= 0; k--) - { - psAdd.Add(newLine[0][k]); - } - newLine[0] = psAdd; - fsStart.Add(selectFeatures[n]); - - } - else if (lineStart.X == newLineStart.X && lineStart.Y == newLineStart.Y) - { - fsStart.Add(selectFeatures[n]); - - } - } - } - if (fsStart.Length > 0) - { - for (int m = 0; m < fsStart.Length; m++) - { - GSOGeoPolyline3D lineFsStart = fsStart[m].Geometry as GSOGeoPolyline3D; - if (lineFsStart != null && lineFsStart.PartCount > 0) - { - GSOPoint3ds psAdd = ps.Clone(); - for (int k = 0; k < lineFsStart[0].Count; k++) - { - psAdd.Add(lineFsStart[0][k]); - } - listPS = getFeaturesPoints(fsStart[m], lineFsStart[0][lineFsStart[0].Count - 1], selectFeatures, psAdd, listPS); - } - } - } - else - { - listPS.Add(ps); - } - return listPS; - } - - /// - /// 获取切割面的线 - /// - /// 不完全包含在面中的所有线 - /// 完全包含在面中的所有线 - /// 线 - private GSOFeature getLineFromGSOFeatures(GSOFeatures features, GSOFeatures featuresTrue) - { - //1. 当线对象数组的长度为0时,返回空 - if (features.Length == 0) - { - return null; - } - //2. 当线对象数组的长度为1时,返回这条线 - if (features.Length == 1) - { - return features[0]; - } - //3. 当线对象数组的长度大于1时,计算所有线组成的最长线 - - //3.1 获取所有不完全包含在面中的对象selectFeatures - GSOFeatures selectFeatures = new GSOFeatures(); - for (int a = 0; a < features.Length; a++) - { - selectFeatures.Add(features[a].Clone()); - } - //3.2 删除features中完全包含在面中的线,获取和面的边界相交的线对象 - for (int a = 0; a < featuresTrue.Length; a++) - { - for (int b = 0; b < features.Length; b++) - { - if (featuresTrue[a].ID == features[b].ID) - { - features.Remove(b); - break; - } - } - } - //3.3 如果和面的边界相交的线的数量为0,返回空 - if (features.Length == 0) - { - return null; - } - //3.4 获取第一条和面的边界相交的线featureInOutPolygon - GSOFeature featureInOutPolygon = features[0]; - //3.5 从所有的线中删除featureInOutPolygon - for (int a = 0; a < selectFeatures.Length; a++) - { - if (selectFeatures[a].ID == featureInOutPolygon.ID) - { - selectFeatures.Remove(a); - break; - } - } - //listPS存储所有从featureInOutPolygon出发的点的集合 - List listPS = new List(); - //3.5 获取与featureInOutPolygon相连的线的集合 - GSOGeoPolyline3D line = featureInOutPolygon.Geometry as GSOGeoPolyline3D; - if (line != null && line.PartCount > 0) - { - GSOPoint3d lineStart = line[0][0]; - GSOPoint3d lineEnd = line[0][line[0].Count - 1]; - #region//获取和featureInOutPolygon的起点相连的线 - GSOFeatures fsStart = new GSOFeatures(); - for (int n = 0; n < selectFeatures.Length; n++) - { - GSOGeoPolyline3D newLine = selectFeatures[n].Geometry as GSOGeoPolyline3D; - if (newLine != null && newLine.PartCount > 0) - { - GSOPoint3d newLineStart = newLine[0][0]; - GSOPoint3d newLineEnd = newLine[0][newLine[0].Count - 1]; - if (lineStart.X == newLineEnd.X && lineStart.Y == newLineEnd.Y) - { - GSOPoint3ds psAdd = new GSOPoint3ds(); - for (int k = newLine[0].Count - 1; k >= 0; k--) - { - psAdd.Add(newLine[0][k]); - } - newLine[0] = psAdd; - fsStart.Add(selectFeatures[n]); - - } - else if (lineStart.X == newLineStart.X && lineStart.Y == newLineStart.Y) - { - fsStart.Add(selectFeatures[n]); - } - } - } - #endregion - - #region//获取和featureInOutPolygon的终点相连的线 - GSOFeatures fsEnd = new GSOFeatures(); - for (int n = 0; n < selectFeatures.Length; n++) - { - GSOGeoPolyline3D newLine = selectFeatures[n].Geometry as GSOGeoPolyline3D; - if (newLine != null && newLine.PartCount > 0) - { - GSOPoint3d newLineStart = newLine[0][0]; - GSOPoint3d newLineEnd = newLine[0][newLine[0].Count - 1]; - if (lineEnd.X == newLineStart.X && lineEnd.Y == newLineStart.Y) - { - fsEnd.Add(selectFeatures[n]); - - } - else if (lineEnd.X == newLineEnd.X && lineEnd.Y == newLineEnd.Y) - { - GSOPoint3ds psAdd = new GSOPoint3ds(); - for (int k = newLine[0].Count - 1; k >= 0; k--) - { - psAdd.Add(newLine[0][k]); - } - newLine[0] = psAdd; - fsEnd.Add(selectFeatures[n]); - - } - } - } - #endregion - - //3.6 将featureInOutPolygon的所有点和与之起点相连的线的所有点组成一个点的集合并添加到listPS中 - if (fsStart.Length > 0 && fsEnd.Length == 0) - { - for (int m = 0; m < fsStart.Length; m++) - { - GSOGeoPolyline3D lineFsStart = fsStart[m].Geometry as GSOGeoPolyline3D; - if (lineFsStart != null && lineFsStart.PartCount > 0) - { - GSOPoint3ds psAdd = new GSOPoint3ds(); - for (int k = line[0].Count - 1; k >= 0; k--) - { - psAdd.Add(line[0][k]); - } - for (int k = 0; k < lineFsStart[0].Count; k++) - { - psAdd.Add(lineFsStart[0][k]); - } - - listPS = getFeaturesPoints(fsStart[m], lineFsStart[0][lineFsStart[0].Count - 1], selectFeatures, psAdd, listPS); - - } - } - } - //3.6 将featureInOutPolygon的所有点和与之终点相连的线的所有点组成一个点的集合并添加到listPS中 - else if (fsStart.Length == 0 && fsEnd.Length > 0) - { - for (int n = 0; n < fsEnd.Length; n++) - { - GSOGeoPolyline3D lineFsEnd = fsEnd[n].Geometry as GSOGeoPolyline3D; - if (lineFsEnd != null && lineFsEnd.PartCount > 0) - { - GSOPoint3ds psAdd = new GSOPoint3ds(); - for (int k = 0; k < line[0].Count - 1; k++) - { - psAdd.Add(line[0][k]); - } - for (int k = 0; k < lineFsEnd[0].Count; k++) - { - psAdd.Add(lineFsEnd[0][k]); - } - //获取线fsEnd[n]的另一个端点相连的线并记录该线的点的集合 - listPS = getFeaturesPoints(fsEnd[n], lineFsEnd[0][lineFsEnd[0].Count - 1], selectFeatures, psAdd, listPS); - } - } - } - } - - //3.7 获取所有以featureInOutPolygon为起点的点的集合组成的线中的最长的线 - double maxLength = 0; - GSOFeature featureNew = new GSOFeature(); - for (int h = 0; h < listPS.Count; h++) - { - GSOGeoPolyline3D lineNew = new GSOGeoPolyline3D(); - lineNew.AddPart(listPS[h]); - GSOLabel label = new GSOLabel(); - label.Text = h.ToString(); - featureNew.Label = label; - double length = lineNew.GetSpaceLength(true, 6378137); - if (length > maxLength) - { - featureNew.Geometry = lineNew; - } - } - - return featureNew; - } - /// /// 更新最大最小状态 /// /// @@ -8340,219 +6789,6 @@ - private void buttonItem139_Click(object sender, EventArgs e) - { - - string filepath = ""; - //日志记录 - OpenFileDialog dlg = new OpenFileDialog(); - dlg.Filter = "矢量数据(*.shp)|*.shp|矢量数据(*.lgd)|*.lgd|全部支持格式(*.lgd,*.shp)|*.lgd;*.shp;"; - //dlg.Filter = "支持格式(*.lrp,*.tif,*.img,*.lrc,*.kml,*.lgd,*.shp,*.gft)|*.lrp;*.tif;*.img;*.lrc;*.kml;*.lgd;*.shp;*.gft|栅格数据(*.lrp)|*.lrp|栅格缓存(*.lrc)|*.lrc|KML数据(*.kml)|*.kml|矢量数据(*.lgd)|*.lgd|矢量缓存(*.gft)|*.gft|其它格式(*.*)|*.*||"; - dlg.Multiselect = true; - if (dlg.ShowDialog() == DialogResult.OK) - { - //自定义lprj文件名,从程序中复制一lprj文件。 - int bindex = dlg.FileName.Split('\\').Length; - string lastname = dlg.FileName.Split('\\')[bindex - 1]; - - for (int i = 0; i < dlg.FileNames.Length; i++) - { - string strDataPath = dlg.FileNames[i]; - filepath = strDataPath; - - GSOLayer layer = globeControl1.Globe.Layers.Add(strDataPath); - - } - - } - //放大到红线 - - - // globeControl1.Globe.Layers.MoveTo(0, globeControl1.Globe.Layers.Count - 1); - // globeControl1.Globe.Layers.MoveTo(0,4); - globeControl1.Refresh(); - - - } - /// - /// - /// - /// - /// - private void buttonItem142_Click(object sender, EventArgs e) - { - //获得红线polygon - //GSOLayer layerSevenLine = globeControl1.Globe.Layers.GetLayerByCaption(redlinelayername); - - GSOLayer layerSevenLine = globeControl1.Globe.Layers.Add("D:\\data\\歌林小镇shp\\test.shp"); - //获得红线结果列表 - ArrayList rrLists = new ArrayList(); - - //if (redlinelayername != "") - { - GSOFeatures fs = layerSevenLine.GetAllFeatures(); - int len = fs.Length; - - GSOGeoPolygon3D sevenPolygon = new GSOGeoPolygon3D(); - for (int k = 0; k < len; k++) - {//多根红线 - ///////生成红线区域/////// - GSOFeature featSevenLine = layerSevenLine.GetAt(k); - GSOGeoPolyline3D sevenLine = featSevenLine.Geometry as GSOGeoPolyline3D; - - List sevenParts = new List(); - for (int i = 0; i < sevenLine.PartCount; i++) - { - sevenParts.Add(sevenLine[i]); - } - for (int i = 0; i < sevenParts.Count; i++) - { - sevenPolygon.AddPart((GSOPoint3ds)sevenParts[i]); - } - /////拼出红线多边形over////// - - } - //GSOLayer layer = globeControl1.Globe.Layers.GetLayerByCaption("天然气管线"); - - GSOLayer layer = globeControl1.Globe.Layers.Add("C:\\Users\\nn-203\\Desktop\\xiaobai\\test.lgd"); - //线切割面定义,输出用 - GSOFeatures resFeats = new GSOFeatures(); - int resultstyle = 0; - //管线切割红线区域后,面积较小的区域 - GSOGeoPolygon3D restPoly = new GSOGeoPolygon3D(); - List inpts = new List(); - if (layer != null) - { - //红线区域 - GSOFeature sevenfeature = new GSOFeature(); - sevenfeature.Geometry = sevenPolygon; - - //获取不完全包含在面中的所有线 - GSOFeatures feats = layer.FindFeaturesInPolygon(sevenPolygon, false); - //获取完全包含在面中的所有线 - GSOFeatures featsTrue = layer.FindFeaturesInPolygon(sevenPolygon, true); - //获取面中所有对象组成的切割面的长线 - GSOFeature feature = new GSOFeature(); - - feature = getLineFromGSOFeatures(feats, featsTrue);//管线多个feature拼成一个feature - - //globeControl1.Globe.MemoryLayer.AddFeature(feature); - //globeControl1.Globe.MemoryLayer.AddFeature(sevenfeature); - if (feature != null) - { - //线切割面,输出 - //feature.HighLight = true; - GSODataEngineUtility.GSLineClipPolygon(feature, sevenfeature, out resFeats, out resultstyle); - } - else - { - MessageBox.Show("没有找到切割面的线对象!"); - } - ////////////////绘制分割后的多边形/////////////// - for (int a = 0; a < resFeats.Length; a++) - { - - GSOFeature gf = resFeats[1]; - globeControl1.Globe.MemoryLayer.AddFeature(gf); - - } - } - - - } - } - - private void buttonItem143_Click(object sender, EventArgs e) - { - //获得红线polygon - GSOLayer layerSevenLine = globeControl1.Globe.Layers.Add("d:\\lineAndPolygon.lgd"); - GSOLayer layerSevenLine2 = globeControl1.Globe.Layers.GetLayerByCaption("d:\\lineAndPolygon.lgd"); - //获得红线结果列表 - ArrayList rrLists = new ArrayList(); - - - // if (redlinelayername != "") - { - GSOFeatures fs = layerSevenLine.GetAllFeatures(); - int len = fs.Length; - - GSOGeoPolyline3D linetest = new GSOGeoPolyline3D(); - GSOGeoPolygon3D sevenPolygon = new GSOGeoPolygon3D(); - - GSOFeature linefeat = fs.FindByID(2); - //linefeat.Geometry = linetest; - GSOFeature polyfeat = fs.FindByID(1); - //polyfeat.Geometry = sevenPolygon; - - //线切割面定义,输出用 - GSOFeatures resFeats = new GSOFeatures(); - int resultstyle = 0; - GSODataEngineUtility.GSLineClipPolygon(linefeat, polyfeat, out resFeats, out resultstyle); - - ////////////////绘制分割后的多边形/////////////// - for (int a = 0; a < resFeats.Length; a++) - { - - GSOFeature gf = resFeats[0]; - globeControl1.Globe.MemoryLayer.AddFeature(gf); - - } - ////把红线切成一段段的线段,获得切前的红线点集 - List redpts = new List();//切前的红线点集合 - for (int i = 0; i < linetest.PartCount; i++) - { - GSOPoint3ds partP = linetest[i]; - for (int j = 0; j < partP.Count; j++) - { - redpts.Add(partP[j]); - } - } - - List redpts2 = new List();//切前的红线点集合 - for (int i = 0; i < sevenPolygon.PartCount; i++) - { - GSOPoint3ds partP = sevenPolygon[i]; - for (int j = 0; j < partP.Count; j++) - { - redpts2.Add(partP[j]); - } - } - } - } - /// - /// 增加用户手册下载连接 - /// - /// - /// - Cyberpipe.udfiles.UpDownFile UDF = new udfiles.UpDownFile(Utility.udserviceurl); - string dir_Ok = "C:\\Users\\nn-203\\Desktop"; - private void button1_Click(object sender, EventArgs e) - { - if (folderBrowserDialog1.ShowDialog() == DialogResult.OK) //打洙?开a文?件t夹D对?话°框ò - { - dir_Ok = folderBrowserDialog1.SelectedPath; //显?示?选?择?的?文?件t夹D路·径? - - //tempstr = folderBrowserDialog1.SelectedPath; //存?储洹?选?择?的?文?件t夹D路·径? - - } - - Cyberpipe.PED_logicfile.PED_Affair.Redact_D = Utility.uploadpath + "\\SFiles\\UserHbook\\说明.docx"; - if (File.Exists(dir_Ok + "\\" + Files_Name(Cyberpipe.PED_logicfile.PED_Affair.Redact_D, 1))) - { - if (MessageBox.Show("文件夹下有同名文件,是否替换?", "提示", MessageBoxButtons.YesNo, MessageBoxIcon.Information) == DialogResult.No) ; - - } - byte[] file = UDF.Down(Cyberpipe.PED_logicfile.PED_Affair.Redact_D); - FileStream pFileSream = new FileStream(dir_Ok + "\\说明.docx", FileMode.OpenOrCreate); - pFileSream.Write(file, 0, file.Length); - pFileSream.Close(); - if (File.Exists(dir_Ok + "\\" + Files_Name(Cyberpipe.PED_logicfile.PED_Affair.Redact_D, 1)) == true) - { - MessageBox.Show("文件导出成功!"); - } - //PEDAClass.Folder_Handle(dir_Ok + "\\" + PEDAClass.Files_Name(Cyberpipe.PED_logicfile.PED_Affair.Redact_D, 0), Cyberpipe.PED_logicfile.PED_Affair.Redact_D, "", 0); - - } /// /// 获取文件或文件夹的名称 /// @@ -8575,33 +6811,6 @@ return DF_Name; } - private void toolStripDropDownButton1_Click(object sender, EventArgs e) - { - if (folderBrowserDialog1.ShowDialog() == DialogResult.OK) //打洙?开a文?件t夹D对?话°框ò - { - dir_Ok = folderBrowserDialog1.SelectedPath; //显?示?选?择?的?文?件t夹D路·径? - - //tempstr = folderBrowserDialog1.SelectedPath; //存?储洹?选?择?的?文?件t夹D路·径? - - - Cyberpipe.PED_logicfile.PED_Affair.Redact_D = Utility.uploadpath + "\\SFiles\\UserHbook\\说明.docx"; - if (File.Exists(dir_Ok + "\\" + Files_Name(Cyberpipe.PED_logicfile.PED_Affair.Redact_D, 1))) - { - if (MessageBox.Show("文件夹下有同名文件,是否替换?", "提示", MessageBoxButtons.YesNo, MessageBoxIcon.Information) == DialogResult.No) ; - - } - byte[] file = UDF.Down(Cyberpipe.PED_logicfile.PED_Affair.Redact_D); - FileStream pFileSream = new FileStream(dir_Ok + "\\说明.docx", FileMode.OpenOrCreate); - pFileSream.Write(file, 0, file.Length); - pFileSream.Close(); - if (File.Exists(dir_Ok + "\\" + Files_Name(Cyberpipe.PED_logicfile.PED_Affair.Redact_D, 1)) == true) - { - MessageBox.Show("文件导出成功!"); - } - - } - } - /// /// 空间查询 /// @@ -9792,7 +8001,7 @@ GSOLayer resLayer = null; GSOFeature resFeature = null; globeControl1.Globe.GetSelectObject(0, out resFeature, out resLayer); - + if (resFeature == null) return; GSOGeoPolyline3D line1 = resFeature.Geometry as GSOGeoPolyline3D; if (line1 == null) { @@ -9876,7 +8085,7 @@ GSOLayer resLayer = null; GSOFeature resFeature = null; globeControl1.Globe.GetSelectObject(0, out resFeature, out resLayer); - + if (resFeature == null) return; GSOGeoPolyline3D line1 = resFeature.Geometry as GSOGeoPolyline3D; if (line1 == null) { @@ -9891,7 +8100,8 @@ } GSOFeatures feats = globeControl1.Globe.MemoryLayer.GetFeatureByName("粒子要素", true); - if (feats.Length > 0) + + if (feats!=null&&feats.Length > 0) globeControl1.Globe.MemoryLayer.RemoveFeatureByID(feats[0].ID); //if (emitterFeature != null) //{ @@ -11121,88 +9331,6 @@ } private int connectServerCount = 0; - - /// - /// 还原球到实测库 - /// - private void refreshGlobe1() - { - //添加实测库图层已有图层 - int servernum = 0; - //1.清除global1上 - for (int i = globeControl1.Globe.Layers.Count - 1; i >= 0; i--) - { - GSOLayer layer = globeControl1.Globe.Layers[i]; - if (!layer.Name.Contains("fttp:")) - { - layer.Dataset.Close();//清除内存 - globeControl1.Globe.Layers.Remove(layer); - } - else - { - servernum++; - } - } - - //globeControl1.Globe.ConnectServer(Utility.serverip, Utility.serverport, "", ""); //加载locaServer中的数据 - - //2.添加实测库图层 - string[] markerStrs = new string[9]; - markerStrs[0] = "标高标注"; - markerStrs[1] = "管径标注"; - markerStrs[2] = "埋深标注"; - markerStrs[3] = "坐标标注"; - markerStrs[4] = "坡度标注"; - markerStrs[5] = "属性标注"; - markerStrs[6] = "自定义标注"; - markerStrs[7] = "距离标注"; - markerStrs[8] = "扯旗标注"; - for (int i = 0; i < markerStrs.Length; i++) - { - if (File.Exists(Application.StartupPath + "\\标注管理\\" + markerStrs[i] + ".lgd")) - { - GSOLayer markerLayer = globeControl1.Globe.Layers.Add(Application.StartupPath + "\\标注管理\\" + markerStrs[i] + ".lgd"); - } - } - - for (int i = 0; i < g1layername.Count; i++) - { - string g1name = g1layername[i]; - GSODataset datasetg1 = Utility.dataSource.GetDatasetByName(g1name); - GSOLayer templayer = globeControl1.Globe.Layers.Add(datasetg1); - templayer.MaxVisibleAltitude = -1; - } - layerTemp = globeControl1.Globe.Layers.Add(Application.StartupPath + "\\tempLgdData.lgd"); - globeControl1.Globe.Layers.Add(Application.StartupPath + "/城市七线/城市红线.lgd"); - globeControl1.Globe.Layers.Add(Application.StartupPath + "/城市七线/城市橙线.lgd"); - globeControl1.Globe.Layers.Add(Application.StartupPath + "/城市七线/城市黄线.lgd"); - globeControl1.Globe.Layers.Add(Application.StartupPath + "/城市七线/城市绿线.lgd"); - globeControl1.Globe.Layers.Add(Application.StartupPath + "/城市七线/城市蓝线.lgd"); - globeControl1.Globe.Layers.Add(Application.StartupPath + "/城市七线/城市紫线.lgd"); - globeControl1.Globe.Layers.Add(Application.StartupPath + "/城市七线/城市黑线.lgd"); - globeControl1.Globe.Layers.Add(Application.StartupPath + "/隧道.lgd"); - - //移动server的数据图层 - for (int i = 0; i < servernum; i++) - { - globeControl1.Globe.Layers.MoveTo(globeControl1.Globe.Layers.Count - 1, 0); - } - - if (layerManagerNode.Nodes.Count > 0) - { - for (int i = layerManagerNode.Nodes.Count - 1; i >= 0; i--) - { - layerManagerNode.Nodes[i].Remove(); - - } - } - - - - globeControl1.Refresh(); - - } - /// /// 碰撞审查 /// @@ -11476,31 +9604,7 @@ // } //} #endregion - /// - /// 数据质量检查 - /// - /// - /// - private void buttonItemSJGL2_Click(object sender, EventArgs e) - { - //日志记录 - LogManager.saveLog(Utility.userName, this.buttonItemSJGL2.Text); - FrmValiData frm = new FrmValiData(globeControl1); - frm.ShowDialog(); - } - /// - /// 数据预处理 - /// - /// - /// - private void buttonItemSJGL3_Click(object sender, EventArgs e) - { - //保存日志 - LogManager.saveLog(Utility.userName, this.buttonItemSJGL3.Text); - FrmEditShapeFile frm = new FrmEditShapeFile(globeControl1); - frm.ShowDialog(this); - } /// /// 连接数据库 /// @@ -12251,60 +10355,6 @@ List lineStruct = new List(); GSOFeature featureSelected = null; - private void AddDatagridView(DataTable table) - { - - if (table != null && table.Rows.Count > 0) - { - dataGridViewX1.DataSource = table; - panelOfTable.Visible = true; - panelOfTable.Height = 200; - toolStripNumbers.Text = "红线审核结果"; - toolStripFeatureLength.Text = " 共有:" + table.Rows.Count + "条"; - } - else - { - - } - - } - - /// - /// 去除集合中重复的管线 - /// - /// - /// - /// - private GSOFeatures getFeaturesByFilter(GSOFeatures features, string fieldName) - { - if (features == null) - { - return null; - } - GSOFeatures featuresGet = new GSOFeatures(); - for (int i = 0; i < features.Length; i++) - { - GSOFeature featureFromFS = features[i]; - string fieldValueFromFS = featureFromFS.GetValue(fieldName).ToString().Trim(); - bool isHas = false; - for (int j = featuresGet.Length - 1; j >= 0; j--) - { - GSOFeature featureFromFSGet = featuresGet[j]; - string fieldValueFromFSGet = featureFromFSGet.GetValue(fieldName).ToString().Trim(); - if (fieldValueFromFS.Equals(fieldValueFromFSGet)) - { - isHas = true; - break; - } - } - if (isHas == false) - { - featuresGet.Add(featureFromFS.Clone()); - } - } - return featuresGet; - } - /// /// 数据管理导入文件 /// @@ -12440,138 +10490,7 @@ // //MessageBox.Show("系统运行错误:" + ex.ToString(), "错误", MessageBoxButtons.OK, MessageBoxIcon.Error); // } //} - - - /// - /// 标识器全区域统计 - /// - /// - /// - private void 标识器分类统计ToolStripMenuItem_Click(object sender, EventArgs e) - { - globeControl1.Globe.Action = EnumAction3D.ActionNull; - FrmBSQStatis bsqStatis = new FrmBSQStatis(); - bsqStatis.Show(this); - } - /// - /// 标识器绘制区域统计 - /// - /// - /// - private void 标识器分类统计ToolStripMenuItem1_Click(object sender, EventArgs e) - { - trackflag = "BSQDuoBianXiangStatis"; - globeControl1.Globe.Action = EnumAction3D.TrackPolygon; - } - - - #region 保存和加载审核库加载的图层 - private void saveLayerList(TreeNodeCollection treeNodeList) - { - string configPath = Application.StartupPath + "\\configLayerList.xml"; - try - { - XmlDocument doc = new XmlDocument(); - doc.Load(configPath); - XmlNode dbParams = doc.SelectSingleNode("Params/dbparams"); - XmlNode dbLayers = doc.SelectSingleNode("Params/dblayers"); - XmlNode layers = doc.SelectSingleNode("Params/layers"); - dbParams.RemoveAll(); - dbLayers.RemoveAll(); - layers.RemoveAll(); - - List listDS = new List(); - String shDatasourceName = Utility.sgdbip + "/" + Utility.sgdbname + "_" + Utility.sgdbuser; - bool flag = false; - - for (int i = 0; i < globeControl1.Globe.DataManager.DataSourceCount; i++) - { - GSODataSource ds = globeControl1.Globe.DataManager.GetDataSourceAt(i); - if (ds != null && ds.Type == EnumDataSourceType.SqlServer || ds.Type == EnumDataSourceType.Oracle) - { - if (ds.Name == shDatasourceName) - { - //防止因为多次连接同一个数据库 - if (flag == true) - { - break; - } - flag = true; - listDS.Add(ds); - GSODataSourceCnn conn = ds.GetConnectionInfo(); - - XmlElement dbparam = doc.CreateElement("shdbparam"); - XmlElement ip = doc.CreateElement("ship"); - ip.InnerText = conn.Server; - - XmlElement dbname = doc.CreateElement("shdbname"); - dbname.InnerText = conn.Database; - - XmlElement username = doc.CreateElement("shusername"); - username.InnerText = conn.User; - - XmlElement password = doc.CreateElement("shpassword"); - password.InnerText = conn.Password; - - XmlElement type = doc.CreateElement("shtype"); - if (ds.Type == EnumDataSourceType.SqlServer) - { - type.InnerText = "sqlserver"; - } - else - { - type.InnerText = "oracle"; - } - - dbparam.AppendChild(ip); - dbparam.AppendChild(dbname); - dbparam.AppendChild(username); - dbparam.AppendChild(password); - dbparam.AppendChild(type); - dbParams.AppendChild(dbparam); - } - - } - } - - for (int i = 0; i < treeNodeList.Count; i++) - { - GSOLayer layer = treeNodeList[i].Tag as GSOLayer; - if (Path.GetExtension(layer.Name) == "") - { - XmlElement dbLayer = doc.CreateElement("dblayer"); - XmlAttribute attri = doc.CreateAttribute("dbindex"); - for (int j = 0; j < listDS.Count; j++) - { - if (layer.Dataset.DataSource.Name == listDS[j].Name) - { - attri.Value = j.ToString(); - break; - } - } - dbLayer.Attributes.Append(attri); - dbLayer.InnerText = layer.Name; - - dbLayers.AppendChild(dbLayer); - } - else - { - XmlElement dbLayer = doc.CreateElement("layer"); - dbLayer.InnerText = layer.Name; - layers.AppendChild(dbLayer); - } - } - - doc.Save(configPath); - } - catch (Exception e) - { - - } - } - - #endregion - + private void buttonItem_TaskManager_Click(object sender, EventArgs e) { if (Form_TaksManager.IS_OPEN) diff --git a/MainFrm.designer.cs b/MainFrm.designer.cs index 233ef8c..97b8299 100644 --- a/MainFrm.designer.cs +++ b/MainFrm.designer.cs @@ -82,6 +82,7 @@ this.sideBar1 = new DevComponents.DotNetBar.SideBar(); this.panelEx3 = new DevComponents.DotNetBar.PanelEx(); this.layerSensorTree = new System.Windows.Forms.TreeView(); + this.layerTree = new Cyberpipe.MyTreeView(); this.sideBarPanelItem3 = new DevComponents.DotNetBar.SideBarPanelItem(); this.controlContainerItem3 = new DevComponents.DotNetBar.ControlContainerItem(); this.sideBarPanelItem4 = new DevComponents.DotNetBar.SideBarPanelItem(); @@ -365,30 +366,26 @@ this.可编辑ToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); this.保存ToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); this.ribbonControl1 = new DevComponents.DotNetBar.RibbonControl(); - this.ribbonPanel1 = new DevComponents.DotNetBar.RibbonPanel(); - this.ribbonBar21 = new DevComponents.DotNetBar.RibbonBar(); - this.buttonItem87 = new DevComponents.DotNetBar.ButtonItem(); - this.buttonItem88 = new DevComponents.DotNetBar.ButtonItem(); - this.buttonItem27 = new DevComponents.DotNetBar.ButtonItem(); - this.buttonItem91 = new DevComponents.DotNetBar.ButtonItem(); - this.buttonItem1 = new DevComponents.DotNetBar.ButtonItem(); - this.btnlegendSet = new DevComponents.DotNetBar.ButtonItem(); - this.buttonItem89 = new DevComponents.DotNetBar.ButtonItem(); - this.ribbonPanel7 = new DevComponents.DotNetBar.RibbonPanel(); - this.ribbonBar5 = new DevComponents.DotNetBar.RibbonBar(); - this.btn_flag = new DevComponents.DotNetBar.ButtonItem(); - this.slider4ground = new DevComponents.DotNetBar.SliderItem(); - this.ribbonPanel2 = new DevComponents.DotNetBar.RibbonPanel(); - this.ribbonBar4 = new DevComponents.DotNetBar.RibbonBar(); - this.buttonItem_TaskManager = new DevComponents.DotNetBar.ButtonItem(); - this.buttonItem_OnlineTask = new DevComponents.DotNetBar.ButtonItem(); - this.buttonItem_Event = new DevComponents.DotNetBar.ButtonItem(); this.ribbonPanel3 = new DevComponents.DotNetBar.RibbonPanel(); this.ribbonBar3 = new DevComponents.DotNetBar.RibbonBar(); this.btn_device = new DevComponents.DotNetBar.ButtonItem(); this.btn_Person = new DevComponents.DotNetBar.ButtonItem(); this.btn_constructMap = new DevComponents.DotNetBar.ButtonItem(); this.buttonItem9 = new DevComponents.DotNetBar.ButtonItem(); + this.ribbonPanel2 = new DevComponents.DotNetBar.RibbonPanel(); + this.ribbonBar4 = new DevComponents.DotNetBar.RibbonBar(); + this.buttonItem_TaskManager = new DevComponents.DotNetBar.ButtonItem(); + this.buttonItem_OnlineTask = new DevComponents.DotNetBar.ButtonItem(); + this.buttonItem_Event = new DevComponents.DotNetBar.ButtonItem(); + this.ribbonPanel1 = new DevComponents.DotNetBar.RibbonPanel(); + this.ribbonBar21 = new DevComponents.DotNetBar.RibbonBar(); + this.buttonItem87 = new DevComponents.DotNetBar.ButtonItem(); + this.buttonItem88 = new DevComponents.DotNetBar.ButtonItem(); + this.buttonItem27 = new DevComponents.DotNetBar.ButtonItem(); + this.buttonItem1 = new DevComponents.DotNetBar.ButtonItem(); + this.buttonItem91 = new DevComponents.DotNetBar.ButtonItem(); + this.btnlegendSet = new DevComponents.DotNetBar.ButtonItem(); + this.buttonItem89 = new DevComponents.DotNetBar.ButtonItem(); this.ribbonPanel8 = new DevComponents.DotNetBar.RibbonPanel(); this.ribbonBar_UserInfo = new DevComponents.DotNetBar.RibbonBar(); this.btn_user_info = new DevComponents.DotNetBar.ButtonItem(); @@ -398,6 +395,10 @@ this.btn_user_role = new DevComponents.DotNetBar.ButtonItem(); this.btn_password_edit = new DevComponents.DotNetBar.ButtonItem(); this.btn_reset_password = new DevComponents.DotNetBar.ButtonItem(); + this.ribbonPanel7 = new DevComponents.DotNetBar.RibbonPanel(); + this.ribbonBar5 = new DevComponents.DotNetBar.RibbonBar(); + this.btn_flag = new DevComponents.DotNetBar.ButtonItem(); + this.slider4ground = new DevComponents.DotNetBar.SliderItem(); this.ribbonPanel15 = new DevComponents.DotNetBar.RibbonPanel(); this.ribbonBar20 = new DevComponents.DotNetBar.RibbonBar(); this.buttonItemSJGL = new DevComponents.DotNetBar.ButtonItem(); @@ -610,7 +611,6 @@ this.buttonItem84 = new DevComponents.DotNetBar.ButtonItem(); this.buttonItem75 = new DevComponents.DotNetBar.ButtonItem(); this.buttonItem76 = new DevComponents.DotNetBar.ButtonItem(); - this.layerTree = new Cyberpipe.MyTreeView(); this.statusStrip1.SuspendLayout(); this.sideBar1.SuspendLayout(); this.panelEx3.SuspendLayout(); @@ -647,11 +647,11 @@ this.contextMenuStrip3.SuspendLayout(); this.contextMenuStripDeleteLayerNode.SuspendLayout(); this.ribbonControl1.SuspendLayout(); - this.ribbonPanel1.SuspendLayout(); - this.ribbonPanel7.SuspendLayout(); - this.ribbonPanel2.SuspendLayout(); this.ribbonPanel3.SuspendLayout(); + this.ribbonPanel2.SuspendLayout(); + this.ribbonPanel1.SuspendLayout(); this.ribbonPanel8.SuspendLayout(); + this.ribbonPanel7.SuspendLayout(); this.ribbonPanel15.SuspendLayout(); ((System.ComponentModel.ISupportInitialize)(this.pictureBox1)).BeginInit(); this.SuspendLayout(); @@ -813,7 +813,6 @@ this.toolStripDropDownButton1.Size = new System.Drawing.Size(45, 21); this.toolStripDropDownButton1.Text = "帮助"; this.toolStripDropDownButton1.Visible = false; - this.toolStripDropDownButton1.Click += new System.EventHandler(this.toolStripDropDownButton1_Click); // // controlContainerItem1 // @@ -1047,6 +1046,16 @@ this.layerSensorTree.AfterCheck += new System.Windows.Forms.TreeViewEventHandler(this.layerMarkerTree_AfterCheck); this.layerSensorTree.NodeMouseClick += new System.Windows.Forms.TreeNodeMouseClickEventHandler(this.layerMarkerTree_NodeMouseClick); // + // layerTree + // + this.layerTree.CheckBoxes = true; + this.layerTree.ItemHeight = 18; + this.layerTree.Location = new System.Drawing.Point(30, 78); + this.layerTree.Name = "layerTree"; + this.layerTree.Size = new System.Drawing.Size(121, 97); + this.layerTree.TabIndex = 1; + this.layerTree.AfterCheck += new System.Windows.Forms.TreeViewEventHandler(this.layerTree_AfterCheck); + // // sideBarPanelItem3 // this.sideBarPanelItem3.FontBold = true; @@ -2966,28 +2975,28 @@ // 平移对象ToolStripMenuItem // this.平移对象ToolStripMenuItem.Name = "平移对象ToolStripMenuItem"; - this.平移对象ToolStripMenuItem.Size = new System.Drawing.Size(152, 22); + this.平移对象ToolStripMenuItem.Size = new System.Drawing.Size(124, 22); this.平移对象ToolStripMenuItem.Text = "平移对象"; this.平移对象ToolStripMenuItem.Click += new System.EventHandler(this.buttonItemBJ6_Click); // // 升降对象ToolStripMenuItem // this.升降对象ToolStripMenuItem.Name = "升降对象ToolStripMenuItem"; - this.升降对象ToolStripMenuItem.Size = new System.Drawing.Size(152, 22); + this.升降对象ToolStripMenuItem.Size = new System.Drawing.Size(124, 22); this.升降对象ToolStripMenuItem.Text = "升降对象"; this.升降对象ToolStripMenuItem.Click += new System.EventHandler(this.buttonItemBJ7_Click); // // 旋转对象ToolStripMenuItem // this.旋转对象ToolStripMenuItem.Name = "旋转对象ToolStripMenuItem"; - this.旋转对象ToolStripMenuItem.Size = new System.Drawing.Size(152, 22); + this.旋转对象ToolStripMenuItem.Size = new System.Drawing.Size(124, 22); this.旋转对象ToolStripMenuItem.Text = "旋转对象"; this.旋转对象ToolStripMenuItem.Click += new System.EventHandler(this.buttonItemBJ8_Click); // // 连接管段ToolStripMenuItem // this.连接管段ToolStripMenuItem.Name = "连接管段ToolStripMenuItem"; - this.连接管段ToolStripMenuItem.Size = new System.Drawing.Size(152, 22); + this.连接管段ToolStripMenuItem.Size = new System.Drawing.Size(124, 22); this.连接管段ToolStripMenuItem.Text = "连接管段"; this.连接管段ToolStripMenuItem.Click += new System.EventHandler(this.buttonItemBJ9_Click); // @@ -2997,34 +3006,34 @@ this.导出CADToolStripMenuItem, this.导出文件ToolStripMenuItem1}); this.导出文件ToolStripMenuItem.Name = "导出文件ToolStripMenuItem"; - this.导出文件ToolStripMenuItem.Size = new System.Drawing.Size(152, 22); + this.导出文件ToolStripMenuItem.Size = new System.Drawing.Size(124, 22); this.导出文件ToolStripMenuItem.Text = "导出矢量"; // // 导出CADToolStripMenuItem // this.导出CADToolStripMenuItem.Name = "导出CADToolStripMenuItem"; - this.导出CADToolStripMenuItem.Size = new System.Drawing.Size(152, 22); + this.导出CADToolStripMenuItem.Size = new System.Drawing.Size(125, 22); this.导出CADToolStripMenuItem.Text = "导出CAD"; this.导出CADToolStripMenuItem.Click += new System.EventHandler(this.buttonItemBJ10_1_Click); // // 导出文件ToolStripMenuItem1 // this.导出文件ToolStripMenuItem1.Name = "导出文件ToolStripMenuItem1"; - this.导出文件ToolStripMenuItem1.Size = new System.Drawing.Size(152, 22); + this.导出文件ToolStripMenuItem1.Size = new System.Drawing.Size(125, 22); this.导出文件ToolStripMenuItem1.Text = "导出文件"; this.导出文件ToolStripMenuItem1.Click += new System.EventHandler(this.buttonItemBJ10_2_Click); // // 前进ToolStripMenuItem // this.前进ToolStripMenuItem.Name = "前进ToolStripMenuItem"; - this.前进ToolStripMenuItem.Size = new System.Drawing.Size(152, 22); + this.前进ToolStripMenuItem.Size = new System.Drawing.Size(124, 22); this.前进ToolStripMenuItem.Text = "前进"; this.前进ToolStripMenuItem.Click += new System.EventHandler(this.buttonItemBJ12_Click); // // 删除模型ToolStripMenuItem // this.删除模型ToolStripMenuItem.Name = "删除模型ToolStripMenuItem"; - this.删除模型ToolStripMenuItem.Size = new System.Drawing.Size(152, 22); + this.删除模型ToolStripMenuItem.Size = new System.Drawing.Size(124, 22); this.删除模型ToolStripMenuItem.Text = "后退"; this.删除模型ToolStripMenuItem.Click += new System.EventHandler(this.buttonItemBJ11_Click); // @@ -4160,6 +4169,198 @@ this.ribbonControl1.Text = "ribbonControl1"; this.ribbonControl1.UseCustomizeDialog = false; // + // ribbonPanel3 + // + this.ribbonPanel3.ColorSchemeStyle = DevComponents.DotNetBar.eDotNetBarStyle.StyleManagerControlled; + this.ribbonPanel3.Controls.Add(this.ribbonBar3); + this.ribbonPanel3.Dock = System.Windows.Forms.DockStyle.Fill; + this.ribbonPanel3.Location = new System.Drawing.Point(0, 33); + this.ribbonPanel3.Name = "ribbonPanel3"; + this.ribbonPanel3.Padding = new System.Windows.Forms.Padding(3, 0, 3, 3); + this.ribbonPanel3.Size = new System.Drawing.Size(1328, 62); + // + // + // + this.ribbonPanel3.Style.Class = ""; + this.ribbonPanel3.Style.CornerType = DevComponents.DotNetBar.eCornerType.Square; + // + // + // + this.ribbonPanel3.StyleMouseDown.Class = ""; + this.ribbonPanel3.StyleMouseDown.CornerType = DevComponents.DotNetBar.eCornerType.Square; + // + // + // + this.ribbonPanel3.StyleMouseOver.Class = ""; + this.ribbonPanel3.StyleMouseOver.CornerType = DevComponents.DotNetBar.eCornerType.Square; + this.ribbonPanel3.TabIndex = 40; + // + // ribbonBar3 + // + this.ribbonBar3.AutoOverflowEnabled = true; + // + // + // + this.ribbonBar3.BackgroundMouseOverStyle.Class = ""; + this.ribbonBar3.BackgroundMouseOverStyle.CornerType = DevComponents.DotNetBar.eCornerType.Square; + // + // + // + this.ribbonBar3.BackgroundStyle.Class = ""; + this.ribbonBar3.BackgroundStyle.CornerType = DevComponents.DotNetBar.eCornerType.Square; + this.ribbonBar3.ContainerControlProcessDialogKey = true; + this.ribbonBar3.Dock = System.Windows.Forms.DockStyle.Left; + this.ribbonBar3.Items.AddRange(new DevComponents.DotNetBar.BaseItem[] { + this.btn_device, + this.btn_Person, + this.btn_constructMap, + this.buttonItem9}); + this.ribbonBar3.Location = new System.Drawing.Point(3, 0); + this.ribbonBar3.Name = "ribbonBar3"; + this.ribbonBar3.Size = new System.Drawing.Size(378, 59); + this.ribbonBar3.Style = DevComponents.DotNetBar.eDotNetBarStyle.StyleManagerControlled; + this.ribbonBar3.TabIndex = 0; + // + // + // + this.ribbonBar3.TitleStyle.Class = ""; + this.ribbonBar3.TitleStyle.CornerType = DevComponents.DotNetBar.eCornerType.Square; + // + // + // + this.ribbonBar3.TitleStyleMouseOver.Class = ""; + this.ribbonBar3.TitleStyleMouseOver.CornerType = DevComponents.DotNetBar.eCornerType.Square; + this.ribbonBar3.TitleVisible = false; + // + // btn_device + // + this.btn_device.ButtonStyle = DevComponents.DotNetBar.eButtonStyle.ImageAndText; + this.btn_device.Image = global::Cyberpipe.Properties.Resources._24X24__2__02; + this.btn_device.ImagePosition = DevComponents.DotNetBar.eImagePosition.Top; + this.btn_device.Name = "btn_device"; + this.btn_device.SubItemsExpandWidth = 14; + this.btn_device.Text = "探测仪管理"; + this.btn_device.Click += new System.EventHandler(this.btn_device_Click); + // + // btn_Person + // + this.btn_Person.ButtonStyle = DevComponents.DotNetBar.eButtonStyle.ImageAndText; + this.btn_Person.Image = global::Cyberpipe.Properties.Resources._24x24icon_05_hover1; + this.btn_Person.ImagePosition = DevComponents.DotNetBar.eImagePosition.Top; + this.btn_Person.Name = "btn_Person"; + this.btn_Person.SubItemsExpandWidth = 14; + this.btn_Person.Text = "定位人员维护"; + this.btn_Person.Click += new System.EventHandler(this.btn_Person_Click); + // + // btn_constructMap + // + this.btn_constructMap.Image = global::Cyberpipe.Properties.Resources._24x24icon_04_hover; + this.btn_constructMap.ImagePosition = DevComponents.DotNetBar.eImagePosition.Top; + this.btn_constructMap.Name = "btn_constructMap"; + this.btn_constructMap.SubItemsExpandWidth = 14; + this.btn_constructMap.Text = "导出施工图"; + this.btn_constructMap.Click += new System.EventHandler(this.btn_constructMap_Click); + // + // buttonItem9 + // + this.buttonItem9.Image = global::Cyberpipe.Properties.Resources._24x24icon__2__10; + this.buttonItem9.ImagePosition = DevComponents.DotNetBar.eImagePosition.Top; + this.buttonItem9.Name = "buttonItem9"; + this.buttonItem9.SubItemsExpandWidth = 14; + this.buttonItem9.Text = "文档管理"; + this.buttonItem9.Click += new System.EventHandler(this.buttonItem9_Click); + // + // ribbonPanel2 + // + this.ribbonPanel2.ColorSchemeStyle = DevComponents.DotNetBar.eDotNetBarStyle.StyleManagerControlled; + this.ribbonPanel2.Controls.Add(this.ribbonBar4); + this.ribbonPanel2.Dock = System.Windows.Forms.DockStyle.Fill; + this.ribbonPanel2.Location = new System.Drawing.Point(0, 0); + this.ribbonPanel2.Name = "ribbonPanel2"; + this.ribbonPanel2.Padding = new System.Windows.Forms.Padding(3, 0, 3, 3); + this.ribbonPanel2.Size = new System.Drawing.Size(1328, 95); + // + // + // + this.ribbonPanel2.Style.Class = ""; + this.ribbonPanel2.Style.CornerType = DevComponents.DotNetBar.eCornerType.Square; + // + // + // + this.ribbonPanel2.StyleMouseDown.Class = ""; + this.ribbonPanel2.StyleMouseDown.CornerType = DevComponents.DotNetBar.eCornerType.Square; + // + // + // + this.ribbonPanel2.StyleMouseOver.Class = ""; + this.ribbonPanel2.StyleMouseOver.CornerType = DevComponents.DotNetBar.eCornerType.Square; + this.ribbonPanel2.TabIndex = 39; + this.ribbonPanel2.Visible = false; + // + // ribbonBar4 + // + this.ribbonBar4.AutoOverflowEnabled = true; + // + // + // + this.ribbonBar4.BackgroundMouseOverStyle.Class = ""; + this.ribbonBar4.BackgroundMouseOverStyle.CornerType = DevComponents.DotNetBar.eCornerType.Square; + // + // + // + this.ribbonBar4.BackgroundStyle.Class = ""; + this.ribbonBar4.BackgroundStyle.CornerType = DevComponents.DotNetBar.eCornerType.Square; + this.ribbonBar4.ContainerControlProcessDialogKey = true; + this.ribbonBar4.Dock = System.Windows.Forms.DockStyle.Left; + this.ribbonBar4.Items.AddRange(new DevComponents.DotNetBar.BaseItem[] { + this.buttonItem_TaskManager, + this.buttonItem_OnlineTask, + this.buttonItem_Event}); + this.ribbonBar4.Location = new System.Drawing.Point(3, 0); + this.ribbonBar4.Name = "ribbonBar4"; + this.ribbonBar4.Size = new System.Drawing.Size(299, 92); + this.ribbonBar4.Style = DevComponents.DotNetBar.eDotNetBarStyle.StyleManagerControlled; + this.ribbonBar4.TabIndex = 0; + this.ribbonBar4.Text = "ribbonBar4"; + // + // + // + this.ribbonBar4.TitleStyle.Class = ""; + this.ribbonBar4.TitleStyle.CornerType = DevComponents.DotNetBar.eCornerType.Square; + // + // + // + this.ribbonBar4.TitleStyleMouseOver.Class = ""; + this.ribbonBar4.TitleStyleMouseOver.CornerType = DevComponents.DotNetBar.eCornerType.Square; + this.ribbonBar4.TitleVisible = false; + // + // buttonItem_TaskManager + // + this.buttonItem_TaskManager.Image = global::Cyberpipe.Properties.Resources._24x24icon__2__76; + this.buttonItem_TaskManager.ImagePosition = DevComponents.DotNetBar.eImagePosition.Top; + this.buttonItem_TaskManager.Name = "buttonItem_TaskManager"; + this.buttonItem_TaskManager.SubItemsExpandWidth = 14; + this.buttonItem_TaskManager.Text = "工单管理"; + this.buttonItem_TaskManager.Click += new System.EventHandler(this.buttonItem_TaskManager_Click); + // + // buttonItem_OnlineTask + // + this.buttonItem_OnlineTask.Image = global::Cyberpipe.Properties.Resources._24x24icon__2__69; + this.buttonItem_OnlineTask.ImagePosition = DevComponents.DotNetBar.eImagePosition.Top; + this.buttonItem_OnlineTask.Name = "buttonItem_OnlineTask"; + this.buttonItem_OnlineTask.SubItemsExpandWidth = 14; + this.buttonItem_OnlineTask.Text = "在线任务"; + this.buttonItem_OnlineTask.Click += new System.EventHandler(this.buttonItem_OnlineTask_Click); + // + // buttonItem_Event + // + this.buttonItem_Event.Image = global::Cyberpipe.Properties.Resources._24x24icon__2__72; + this.buttonItem_Event.ImagePosition = DevComponents.DotNetBar.eImagePosition.Top; + this.buttonItem_Event.Name = "buttonItem_Event"; + this.buttonItem_Event.SubItemsExpandWidth = 14; + this.buttonItem_Event.Text = "事件管理"; + this.buttonItem_Event.Click += new System.EventHandler(this.buttonItem_Event_Click); + // // ribbonPanel1 // this.ribbonPanel1.AutoSize = true; @@ -4262,6 +4463,15 @@ this.buttonItem27.Visible = false; this.buttonItem27.Click += new System.EventHandler(this.buttonItem27_Click); // + // buttonItem1 + // + this.buttonItem1.Image = global::Cyberpipe.Properties.Resources._24x24icon__2__94; + this.buttonItem1.ImagePosition = DevComponents.DotNetBar.eImagePosition.Top; + this.buttonItem1.Name = "buttonItem1"; + this.buttonItem1.SubItemsExpandWidth = 14; + this.buttonItem1.Text = "图层管理"; + this.buttonItem1.Click += new System.EventHandler(this.buttonItem1_Click); + // // buttonItem91 // this.buttonItem91.ForeColor = System.Drawing.Color.Black; @@ -4272,15 +4482,6 @@ this.buttonItem91.Text = "快速定位"; this.buttonItem91.Click += new System.EventHandler(this.buttonItem91_Click); // - // buttonItem1 - // - this.buttonItem1.Image = global::Cyberpipe.Properties.Resources._24x24icon__2__94; - this.buttonItem1.ImagePosition = DevComponents.DotNetBar.eImagePosition.Top; - this.buttonItem1.Name = "buttonItem1"; - this.buttonItem1.SubItemsExpandWidth = 14; - this.buttonItem1.Text = "图层管理"; - this.buttonItem1.Click += new System.EventHandler(this.buttonItem1_Click); - // // btnlegendSet // this.btnlegendSet.Image = global::Cyberpipe.Properties.Resources._24x24icon__2__93; @@ -4300,278 +4501,6 @@ this.buttonItem89.Visible = false; this.buttonItem89.Click += new System.EventHandler(this.buttonItem89_Click); // - // ribbonPanel7 - // - this.ribbonPanel7.ColorSchemeStyle = DevComponents.DotNetBar.eDotNetBarStyle.StyleManagerControlled; - this.ribbonPanel7.Controls.Add(this.ribbonBar5); - this.ribbonPanel7.Dock = System.Windows.Forms.DockStyle.Fill; - this.ribbonPanel7.Location = new System.Drawing.Point(0, 0); - this.ribbonPanel7.Name = "ribbonPanel7"; - this.ribbonPanel7.Padding = new System.Windows.Forms.Padding(3, 0, 3, 3); - this.ribbonPanel7.Size = new System.Drawing.Size(1328, 95); - // - // - // - this.ribbonPanel7.Style.Class = ""; - this.ribbonPanel7.Style.CornerType = DevComponents.DotNetBar.eCornerType.Square; - // - // - // - this.ribbonPanel7.StyleMouseDown.Class = ""; - this.ribbonPanel7.StyleMouseDown.CornerType = DevComponents.DotNetBar.eCornerType.Square; - // - // - // - this.ribbonPanel7.StyleMouseOver.Class = ""; - this.ribbonPanel7.StyleMouseOver.CornerType = DevComponents.DotNetBar.eCornerType.Square; - this.ribbonPanel7.TabIndex = 41; - this.ribbonPanel7.Visible = false; - // - // ribbonBar5 - // - this.ribbonBar5.AutoOverflowEnabled = true; - // - // - // - this.ribbonBar5.BackgroundMouseOverStyle.Class = ""; - this.ribbonBar5.BackgroundMouseOverStyle.CornerType = DevComponents.DotNetBar.eCornerType.Square; - // - // - // - this.ribbonBar5.BackgroundStyle.Class = ""; - this.ribbonBar5.BackgroundStyle.CornerType = DevComponents.DotNetBar.eCornerType.Square; - this.ribbonBar5.ContainerControlProcessDialogKey = true; - this.ribbonBar5.Dock = System.Windows.Forms.DockStyle.Left; - this.ribbonBar5.Items.AddRange(new DevComponents.DotNetBar.BaseItem[] { - this.btn_flag, - this.slider4ground}); - this.ribbonBar5.Location = new System.Drawing.Point(3, 0); - this.ribbonBar5.Name = "ribbonBar5"; - this.ribbonBar5.Size = new System.Drawing.Size(418, 92); - this.ribbonBar5.Style = DevComponents.DotNetBar.eDotNetBarStyle.StyleManagerControlled; - this.ribbonBar5.TabIndex = 0; - // - // - // - this.ribbonBar5.TitleStyle.Class = ""; - this.ribbonBar5.TitleStyle.CornerType = DevComponents.DotNetBar.eCornerType.Square; - // - // - // - this.ribbonBar5.TitleStyleMouseOver.Class = ""; - this.ribbonBar5.TitleStyleMouseOver.CornerType = DevComponents.DotNetBar.eCornerType.Square; - this.ribbonBar5.TitleVisible = false; - this.ribbonBar5.ItemClick += new System.EventHandler(this.ribbonBar5_ItemClick); - // - // btn_flag - // - this.btn_flag.Image = global::Cyberpipe.Properties.Resources._24x24icon_03_hover; - this.btn_flag.ImagePosition = DevComponents.DotNetBar.eImagePosition.Top; - this.btn_flag.Name = "btn_flag"; - this.btn_flag.SubItemsExpandWidth = 14; - this.btn_flag.Text = "标识器管理"; - this.btn_flag.Click += new System.EventHandler(this.btn_flag_Click); - // - // slider4ground - // - this.slider4ground.LabelPosition = DevComponents.DotNetBar.eSliderLabelPosition.Top; - this.slider4ground.Name = "slider4ground"; - this.slider4ground.Text = "地面透明度"; - this.slider4ground.Value = 0; - this.slider4ground.ValueChanged += new System.EventHandler(this.slider4ground_ValueChanged); - // - // ribbonPanel2 - // - this.ribbonPanel2.ColorSchemeStyle = DevComponents.DotNetBar.eDotNetBarStyle.StyleManagerControlled; - this.ribbonPanel2.Controls.Add(this.ribbonBar4); - this.ribbonPanel2.Dock = System.Windows.Forms.DockStyle.Fill; - this.ribbonPanel2.Location = new System.Drawing.Point(0, 0); - this.ribbonPanel2.Name = "ribbonPanel2"; - this.ribbonPanel2.Padding = new System.Windows.Forms.Padding(3, 0, 3, 3); - this.ribbonPanel2.Size = new System.Drawing.Size(1328, 95); - // - // - // - this.ribbonPanel2.Style.Class = ""; - this.ribbonPanel2.Style.CornerType = DevComponents.DotNetBar.eCornerType.Square; - // - // - // - this.ribbonPanel2.StyleMouseDown.Class = ""; - this.ribbonPanel2.StyleMouseDown.CornerType = DevComponents.DotNetBar.eCornerType.Square; - // - // - // - this.ribbonPanel2.StyleMouseOver.Class = ""; - this.ribbonPanel2.StyleMouseOver.CornerType = DevComponents.DotNetBar.eCornerType.Square; - this.ribbonPanel2.TabIndex = 39; - this.ribbonPanel2.Visible = false; - // - // ribbonBar4 - // - this.ribbonBar4.AutoOverflowEnabled = true; - // - // - // - this.ribbonBar4.BackgroundMouseOverStyle.Class = ""; - this.ribbonBar4.BackgroundMouseOverStyle.CornerType = DevComponents.DotNetBar.eCornerType.Square; - // - // - // - this.ribbonBar4.BackgroundStyle.Class = ""; - this.ribbonBar4.BackgroundStyle.CornerType = DevComponents.DotNetBar.eCornerType.Square; - this.ribbonBar4.ContainerControlProcessDialogKey = true; - this.ribbonBar4.Dock = System.Windows.Forms.DockStyle.Left; - this.ribbonBar4.Items.AddRange(new DevComponents.DotNetBar.BaseItem[] { - this.buttonItem_TaskManager, - this.buttonItem_OnlineTask, - this.buttonItem_Event}); - this.ribbonBar4.Location = new System.Drawing.Point(3, 0); - this.ribbonBar4.Name = "ribbonBar4"; - this.ribbonBar4.Size = new System.Drawing.Size(299, 92); - this.ribbonBar4.Style = DevComponents.DotNetBar.eDotNetBarStyle.StyleManagerControlled; - this.ribbonBar4.TabIndex = 0; - this.ribbonBar4.Text = "ribbonBar4"; - // - // - // - this.ribbonBar4.TitleStyle.Class = ""; - this.ribbonBar4.TitleStyle.CornerType = DevComponents.DotNetBar.eCornerType.Square; - // - // - // - this.ribbonBar4.TitleStyleMouseOver.Class = ""; - this.ribbonBar4.TitleStyleMouseOver.CornerType = DevComponents.DotNetBar.eCornerType.Square; - this.ribbonBar4.TitleVisible = false; - // - // buttonItem_TaskManager - // - this.buttonItem_TaskManager.Image = global::Cyberpipe.Properties.Resources._24x24icon__2__76; - this.buttonItem_TaskManager.ImagePosition = DevComponents.DotNetBar.eImagePosition.Top; - this.buttonItem_TaskManager.Name = "buttonItem_TaskManager"; - this.buttonItem_TaskManager.SubItemsExpandWidth = 14; - this.buttonItem_TaskManager.Text = "工单管理"; - this.buttonItem_TaskManager.Click += new System.EventHandler(this.buttonItem_TaskManager_Click); - // - // buttonItem_OnlineTask - // - this.buttonItem_OnlineTask.Image = global::Cyberpipe.Properties.Resources._24x24icon__2__69; - this.buttonItem_OnlineTask.ImagePosition = DevComponents.DotNetBar.eImagePosition.Top; - this.buttonItem_OnlineTask.Name = "buttonItem_OnlineTask"; - this.buttonItem_OnlineTask.SubItemsExpandWidth = 14; - this.buttonItem_OnlineTask.Text = "在线任务"; - this.buttonItem_OnlineTask.Click += new System.EventHandler(this.buttonItem_OnlineTask_Click); - // - // buttonItem_Event - // - this.buttonItem_Event.Image = global::Cyberpipe.Properties.Resources._24x24icon__2__72; - this.buttonItem_Event.ImagePosition = DevComponents.DotNetBar.eImagePosition.Top; - this.buttonItem_Event.Name = "buttonItem_Event"; - this.buttonItem_Event.SubItemsExpandWidth = 14; - this.buttonItem_Event.Text = "事件管理"; - this.buttonItem_Event.Click += new System.EventHandler(this.buttonItem_Event_Click); - // - // ribbonPanel3 - // - this.ribbonPanel3.ColorSchemeStyle = DevComponents.DotNetBar.eDotNetBarStyle.StyleManagerControlled; - this.ribbonPanel3.Controls.Add(this.ribbonBar3); - this.ribbonPanel3.Dock = System.Windows.Forms.DockStyle.Fill; - this.ribbonPanel3.Location = new System.Drawing.Point(0, 33); - this.ribbonPanel3.Name = "ribbonPanel3"; - this.ribbonPanel3.Padding = new System.Windows.Forms.Padding(3, 0, 3, 3); - this.ribbonPanel3.Size = new System.Drawing.Size(1328, 62); - // - // - // - this.ribbonPanel3.Style.Class = ""; - this.ribbonPanel3.Style.CornerType = DevComponents.DotNetBar.eCornerType.Square; - // - // - // - this.ribbonPanel3.StyleMouseDown.Class = ""; - this.ribbonPanel3.StyleMouseDown.CornerType = DevComponents.DotNetBar.eCornerType.Square; - // - // - // - this.ribbonPanel3.StyleMouseOver.Class = ""; - this.ribbonPanel3.StyleMouseOver.CornerType = DevComponents.DotNetBar.eCornerType.Square; - this.ribbonPanel3.TabIndex = 40; - // - // ribbonBar3 - // - this.ribbonBar3.AutoOverflowEnabled = true; - // - // - // - this.ribbonBar3.BackgroundMouseOverStyle.Class = ""; - this.ribbonBar3.BackgroundMouseOverStyle.CornerType = DevComponents.DotNetBar.eCornerType.Square; - // - // - // - this.ribbonBar3.BackgroundStyle.Class = ""; - this.ribbonBar3.BackgroundStyle.CornerType = DevComponents.DotNetBar.eCornerType.Square; - this.ribbonBar3.ContainerControlProcessDialogKey = true; - this.ribbonBar3.Dock = System.Windows.Forms.DockStyle.Left; - this.ribbonBar3.Items.AddRange(new DevComponents.DotNetBar.BaseItem[] { - this.btn_device, - this.btn_Person, - this.btn_constructMap, - this.buttonItem9}); - this.ribbonBar3.Location = new System.Drawing.Point(3, 0); - this.ribbonBar3.Name = "ribbonBar3"; - this.ribbonBar3.Size = new System.Drawing.Size(378, 59); - this.ribbonBar3.Style = DevComponents.DotNetBar.eDotNetBarStyle.StyleManagerControlled; - this.ribbonBar3.TabIndex = 0; - // - // - // - this.ribbonBar3.TitleStyle.Class = ""; - this.ribbonBar3.TitleStyle.CornerType = DevComponents.DotNetBar.eCornerType.Square; - // - // - // - this.ribbonBar3.TitleStyleMouseOver.Class = ""; - this.ribbonBar3.TitleStyleMouseOver.CornerType = DevComponents.DotNetBar.eCornerType.Square; - this.ribbonBar3.TitleVisible = false; - // - // btn_device - // - this.btn_device.ButtonStyle = DevComponents.DotNetBar.eButtonStyle.ImageAndText; - this.btn_device.Image = global::Cyberpipe.Properties.Resources._24X24__2__02; - this.btn_device.ImagePosition = DevComponents.DotNetBar.eImagePosition.Top; - this.btn_device.Name = "btn_device"; - this.btn_device.SubItemsExpandWidth = 14; - this.btn_device.Text = "探测仪管理"; - this.btn_device.Click += new System.EventHandler(this.btn_device_Click); - // - // btn_Person - // - this.btn_Person.ButtonStyle = DevComponents.DotNetBar.eButtonStyle.ImageAndText; - this.btn_Person.Image = global::Cyberpipe.Properties.Resources._24x24icon_05_hover1; - this.btn_Person.ImagePosition = DevComponents.DotNetBar.eImagePosition.Top; - this.btn_Person.Name = "btn_Person"; - this.btn_Person.SubItemsExpandWidth = 14; - this.btn_Person.Text = "定位人员维护"; - this.btn_Person.Click += new System.EventHandler(this.btn_Person_Click); - // - // btn_constructMap - // - this.btn_constructMap.Image = global::Cyberpipe.Properties.Resources._24x24icon_04_hover; - this.btn_constructMap.ImagePosition = DevComponents.DotNetBar.eImagePosition.Top; - this.btn_constructMap.Name = "btn_constructMap"; - this.btn_constructMap.SubItemsExpandWidth = 14; - this.btn_constructMap.Text = "导出施工图"; - this.btn_constructMap.Click += new System.EventHandler(this.btn_constructMap_Click); - // - // buttonItem9 - // - this.buttonItem9.Image = global::Cyberpipe.Properties.Resources._24x24icon__2__10; - this.buttonItem9.ImagePosition = DevComponents.DotNetBar.eImagePosition.Top; - this.buttonItem9.Name = "buttonItem9"; - this.buttonItem9.SubItemsExpandWidth = 14; - this.buttonItem9.Text = "文档管理"; - this.buttonItem9.Click += new System.EventHandler(this.buttonItem9_Click); - // // ribbonPanel8 // this.ribbonPanel8.ColorSchemeStyle = DevComponents.DotNetBar.eDotNetBarStyle.StyleManagerControlled; @@ -4696,6 +4625,86 @@ this.btn_reset_password.Text = "重置密码"; this.btn_reset_password.Click += new System.EventHandler(this.btn_reset_password_Click); // + // ribbonPanel7 + // + this.ribbonPanel7.ColorSchemeStyle = DevComponents.DotNetBar.eDotNetBarStyle.StyleManagerControlled; + this.ribbonPanel7.Controls.Add(this.ribbonBar5); + this.ribbonPanel7.Dock = System.Windows.Forms.DockStyle.Fill; + this.ribbonPanel7.Location = new System.Drawing.Point(0, 0); + this.ribbonPanel7.Name = "ribbonPanel7"; + this.ribbonPanel7.Padding = new System.Windows.Forms.Padding(3, 0, 3, 3); + this.ribbonPanel7.Size = new System.Drawing.Size(1328, 95); + // + // + // + this.ribbonPanel7.Style.Class = ""; + this.ribbonPanel7.Style.CornerType = DevComponents.DotNetBar.eCornerType.Square; + // + // + // + this.ribbonPanel7.StyleMouseDown.Class = ""; + this.ribbonPanel7.StyleMouseDown.CornerType = DevComponents.DotNetBar.eCornerType.Square; + // + // + // + this.ribbonPanel7.StyleMouseOver.Class = ""; + this.ribbonPanel7.StyleMouseOver.CornerType = DevComponents.DotNetBar.eCornerType.Square; + this.ribbonPanel7.TabIndex = 41; + this.ribbonPanel7.Visible = false; + // + // ribbonBar5 + // + this.ribbonBar5.AutoOverflowEnabled = true; + // + // + // + this.ribbonBar5.BackgroundMouseOverStyle.Class = ""; + this.ribbonBar5.BackgroundMouseOverStyle.CornerType = DevComponents.DotNetBar.eCornerType.Square; + // + // + // + this.ribbonBar5.BackgroundStyle.Class = ""; + this.ribbonBar5.BackgroundStyle.CornerType = DevComponents.DotNetBar.eCornerType.Square; + this.ribbonBar5.ContainerControlProcessDialogKey = true; + this.ribbonBar5.Dock = System.Windows.Forms.DockStyle.Left; + this.ribbonBar5.Items.AddRange(new DevComponents.DotNetBar.BaseItem[] { + this.btn_flag, + this.slider4ground}); + this.ribbonBar5.Location = new System.Drawing.Point(3, 0); + this.ribbonBar5.Name = "ribbonBar5"; + this.ribbonBar5.Size = new System.Drawing.Size(418, 92); + this.ribbonBar5.Style = DevComponents.DotNetBar.eDotNetBarStyle.StyleManagerControlled; + this.ribbonBar5.TabIndex = 0; + // + // + // + this.ribbonBar5.TitleStyle.Class = ""; + this.ribbonBar5.TitleStyle.CornerType = DevComponents.DotNetBar.eCornerType.Square; + // + // + // + this.ribbonBar5.TitleStyleMouseOver.Class = ""; + this.ribbonBar5.TitleStyleMouseOver.CornerType = DevComponents.DotNetBar.eCornerType.Square; + this.ribbonBar5.TitleVisible = false; + this.ribbonBar5.ItemClick += new System.EventHandler(this.ribbonBar5_ItemClick); + // + // btn_flag + // + this.btn_flag.Image = global::Cyberpipe.Properties.Resources._24x24icon_03_hover; + this.btn_flag.ImagePosition = DevComponents.DotNetBar.eImagePosition.Top; + this.btn_flag.Name = "btn_flag"; + this.btn_flag.SubItemsExpandWidth = 14; + this.btn_flag.Text = "标识器管理"; + this.btn_flag.Click += new System.EventHandler(this.btn_flag_Click); + // + // slider4ground + // + this.slider4ground.LabelPosition = DevComponents.DotNetBar.eSliderLabelPosition.Top; + this.slider4ground.Name = "slider4ground"; + this.slider4ground.Text = "地面透明度"; + this.slider4ground.Value = 0; + this.slider4ground.ValueChanged += new System.EventHandler(this.slider4ground_ValueChanged); + // // ribbonPanel15 // this.ribbonPanel15.ColorSchemeStyle = DevComponents.DotNetBar.eDotNetBarStyle.StyleManagerControlled; @@ -6393,16 +6402,6 @@ this.buttonItem76.SubItemsExpandWidth = 14; this.buttonItem76.Text = "坐标标注"; // - // layerTree - // - this.layerTree.CheckBoxes = true; - this.layerTree.ItemHeight = 18; - this.layerTree.Location = new System.Drawing.Point(30, 78); - this.layerTree.Name = "layerTree"; - this.layerTree.Size = new System.Drawing.Size(121, 97); - this.layerTree.TabIndex = 1; - this.layerTree.AfterCheck += new System.Windows.Forms.TreeViewEventHandler(this.layerTree_AfterCheck); - // // MainFrm // this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Inherit; @@ -6475,11 +6474,11 @@ this.contextMenuStripDeleteLayerNode.ResumeLayout(false); this.ribbonControl1.ResumeLayout(false); this.ribbonControl1.PerformLayout(); - this.ribbonPanel1.ResumeLayout(false); - this.ribbonPanel7.ResumeLayout(false); - this.ribbonPanel2.ResumeLayout(false); this.ribbonPanel3.ResumeLayout(false); + this.ribbonPanel2.ResumeLayout(false); + this.ribbonPanel1.ResumeLayout(false); this.ribbonPanel8.ResumeLayout(false); + this.ribbonPanel7.ResumeLayout(false); this.ribbonPanel15.ResumeLayout(false); ((System.ComponentModel.ISupportInitialize)(this.pictureBox1)).EndInit(); this.ResumeLayout(false); diff --git a/NewFunction/FrmCreateTunnel.cs b/NewFunction/FrmCreateTunnel.cs index 282767c..338edff 100644 --- a/NewFunction/FrmCreateTunnel.cs +++ b/NewFunction/FrmCreateTunnel.cs @@ -142,35 +142,6 @@ } } - private void txtMS_KeyPress(object sender, KeyPressEventArgs e) - { - TextBox text = sender as TextBox; - if ((e.KeyChar < 48 || e.KeyChar > 57) && (e.KeyChar != 8) && (int)e.KeyChar != 46) - { - e.Handled = true; - } - if ((int)e.KeyChar == 46) //小数点 - { - if (text.Text.Length <= 0) - e.Handled = true; //小数点不能在第一位 - else //处理不规则的小数点 - { - float f; - float oldf; - bool b1 = false, b2 = false; - b1 = float.TryParse(text.Text, out oldf); - b2 = float.TryParse(text.Text + e.KeyChar.ToString(), out f); - if (b2 == false) - { - if (b1 == true) - e.Handled = true; - else - e.Handled = false; - } - } - } - } - private void FrmCreateTunnel_Load(object sender, EventArgs e) { if (comboBoxTunnelType.Items.Count > 0) diff --git a/OracleHelper.cs b/OracleHelper.cs index 11eebe6..79cdf48 100644 --- a/OracleHelper.cs +++ b/OracleHelper.cs @@ -49,7 +49,7 @@ { conn.Close(); } - MessageBox.Show(ex.Message, "提示"); + LogHelper.WriteLog(typeof(OledbHelper), ex.Message); return null; } } @@ -67,7 +67,7 @@ } catch(Exception ex) { - // LogError.PublishError(ex); + LogHelper.WriteLog(typeof(OledbHelper), ex.Message); } finally { @@ -111,6 +111,7 @@ } catch (Exception ex) { + LogHelper.WriteLog(typeof(OledbHelper), ex.Message); return null; } } @@ -131,6 +132,7 @@ } catch(Exception ex) { + LogHelper.WriteLog(typeof(OledbHelper), ex.Message); rowCount = -1; } finally @@ -159,6 +161,7 @@ } catch(Exception ex) { + LogHelper.WriteLog(typeof(OledbHelper), ex.Message); num = -1; } finally @@ -190,6 +193,7 @@ } catch (Exception ex) { + LogHelper.WriteLog(typeof(OledbHelper), ex.Message); return null; } } @@ -210,7 +214,7 @@ oracleCmd.Dispose(); conn.Close(); //调用con_close()方法,关闭与数据库的连接 }catch(Exception ex){ - + LogHelper.WriteLog(typeof(OledbHelper), ex.Message); } finally { @@ -237,6 +241,7 @@ } catch (Exception ex) { + LogHelper.WriteLog(typeof(OledbHelper), ex.Message); rowCount = -1; } finally diff --git a/OracleUtils.cs b/OracleUtils.cs index 29b5374..c1aadda 100644 --- a/OracleUtils.cs +++ b/OracleUtils.cs @@ -741,7 +741,6 @@ } catch { - //if we fail to return the SqlDatReader, we need to close the connection ourselves cn.Close(); throw; } diff --git a/PAS.cs b/PAS.cs index 972de2d..fcda1dd 100644 --- a/PAS.cs +++ b/PAS.cs @@ -93,15 +93,7 @@ } - private void TSM_Pderive_Click(object sender, EventArgs e) - { - PASAClass.Table_name(operation); - if (TV_Files.SelectedNode != null) - { - PASAClass.GuideEdit_form("G", TV_Files, int.Parse(((ToolStripMenuItem)sender).Tag.ToString())); - } - } - + private void TSM_Fenter_Click(object sender, EventArgs e) { if (TV_Files.SelectedNode != null) @@ -110,16 +102,6 @@ } } - private void TSM_Frename_Click(object sender, EventArgs e) - { - TSM_Fenter_Click(sender, e); - } - - private void TSM_Fdelete_Click(object sender, EventArgs e) - { - TSM_Fenter_Click(sender, e); - } - private void TSM_Fderive_Click(object sender, EventArgs e) { if (TV_Files.SelectedNode != null) @@ -128,25 +110,6 @@ } } - private void TSM_Fprint_Click(object sender, EventArgs e) - { - if (TV_Files.SelectedNode != null) - { - PASAClass.Print(int.Parse(TV_Files.SelectedNode.Tag.ToString()), TV_Files.SelectedNode.Text, PD_PASPrtFile, PD_PASPrtDoc); - - } - } - - private void TSM_PASPgSt_Click(object sender, EventArgs e) - { - PSD_PASSetPage.ShowDialog(); - } - - private void TSM_PASPreV_Click(object sender, EventArgs e) - { - PPD_PASPreV.ShowDialog(); - } - private void TV_Files_AfterCollapse(object sender, TreeViewEventArgs e) { e.Node.ImageIndex = 0; @@ -250,14 +213,6 @@ } } - private void 导出ToolStripMenuItem_Click(object sender, EventArgs e) - { - PASAClass.Table_name(operation); - if (TV_Files.SelectedNode != null) - { - PASAClass.GuideEdit_form("G", TV_Files, int.Parse(((ToolStripMenuItem)sender).Tag.ToString())); - } - } private void 导入ToolStripMenuItem_Click(object sender, EventArgs e) { diff --git a/PAS_Forms/F_PASInout.cs b/PAS_Forms/F_PASInout.cs index 373a4e6..974f987 100644 --- a/PAS_Forms/F_PASInout.cs +++ b/PAS_Forms/F_PASInout.cs @@ -71,11 +71,6 @@ } - private void Cancel_Click(object sender, EventArgs e) - { - this.Close(); - } - private void OK_Click(object sender, EventArgs e) { if (textBox1.Text == "") diff --git a/PATM.cs b/PATM.cs index edecd1e..9b6c51d 100644 --- a/PATM.cs +++ b/PATM.cs @@ -26,12 +26,6 @@ public string operation = ""; #endregion - - - - - - private void TSM_Pnew_Click(object sender, EventArgs e) { if (LV_proj.Visible) @@ -94,15 +88,6 @@ } - private void TSM_Pderive_Click(object sender, EventArgs e) - { - PATMAClass.Table_name(operation); - if (TV_files.SelectedNode != null) - { - PATMAClass.GuideEdit_form("G", TV_files, int.Parse(((ToolStripMenuItem)sender).Tag.ToString())); - } - } - private void TSM_Fenter_Click(object sender, EventArgs e) { if (TV_files.SelectedNode != null) @@ -163,35 +148,6 @@ //PATMAClass.Show_AllFile(int.Parse(e.Node.Tag.ToString()), e.Node.Text, LV_PATMallfiles, PB_Display, 2);//此处为显示图片操作 } - private void TSM_Frename_Click(object sender, EventArgs e) - { - TSM_Fenter_Click(sender, e); - } - - private void TSM_Fdelete_Click(object sender, EventArgs e) - { - TSM_Fenter_Click(sender, e); - } - - private void TSM_Fderive_Click(object sender, EventArgs e) - { - if (TV_files.SelectedNode != null) - { - PATMAClass.GuideEdit_form("G", TV_files, int.Parse(((ToolStripMenuItem)sender).Tag.ToString())); - } - } - - private void TSM_Fprint_Click(object sender, EventArgs e) - { - if (TV_files.SelectedNode != null) - { - PATMAClass.Print(int.Parse(TV_files.SelectedNode.Tag.ToString()), TV_files.SelectedNode.Text, PD_PATMPrtFile, PD_PATMPrtDoc); - - } - } - - - private void BT_PATMSch_Click(object sender, EventArgs e) { //LV_PATMallfiles.Dock = DockStyle.Fill;//使ListView控件最大化 @@ -210,32 +166,6 @@ } - private void TSM_PATMPreV_Click(object sender, EventArgs e) - { - PPD_PATMPreV.ShowDialog(); - } - - private void TSM_PATMPgSt_Click(object sender, EventArgs e) - { - PSD_PATMSetPage.ShowDialog(); - } - - private void LV_PATMSrchRslt_MouseClick(object sender, MouseEventArgs e) - { - - if (LV_proj.SelectedItems != null) - { - //int i = 1; - // PATMAClass.Show_AllFile(int.Parse(LV_PATMSrchRslt.FocusedItem.Tag.ToString()), LV_PATMSrchRslt.FocusedItem.Text, LV_PATMallfiles,PB_Display, 0); - - } - } - - private void LV_PATMSrchRslt_MouseDoubleClick(object sender, MouseEventArgs e) - { - //PATMAClass.Show_AllFile(int.Parse(LV_PATMSrchRslt.FocusedItem.Tag.ToString()), LV_PATMSrchRslt.FocusedItem.Text, LV_PATMallfiles, PB_Display, 2); - } - private void 新建ToolStripMenuItem_Click(object sender, EventArgs e) { if ((TV_files.SelectedNode != null)&&(TV_files.SelectedNode.Parent==null)) @@ -288,17 +218,6 @@ } } - private void 打印预览toolStripMenuItem_Click(object sender, EventArgs e) - { - - PPD_PATMPreV.ShowDialog(); - } - - private void 打印设置toolStripMenuItem_Click(object sender, EventArgs e) - { - PSD_PATMSetPage.ShowDialog(); - } - private void TV_PATMSrchRslt_NodeMouseClick(object sender, TreeNodeMouseClickEventArgs e) { if (e.Button == MouseButtons.Right) diff --git a/PATM_Forms/F_PATMTitle.cs b/PATM_Forms/F_PATMTitle.cs index 7380dd8..5d1fe8c 100644 --- a/PATM_Forms/F_PATMTitle.cs +++ b/PATM_Forms/F_PATMTitle.cs @@ -148,19 +148,6 @@ return 0; } - //判断是否为已有工程 - private bool checkProject(string projectname) { - string sql = "select * from "+this.tablename+" where "+tablename+".NODENAME = '"+projectname - +"'"; - DataTable table = OledbHelper.QueryTable(sql); - if (table.Rows.Count > 0) - { - return true; - } - else { - return false; - } - } private void buttonX2_Click(object sender, EventArgs e) { diff --git a/PATM_Forms/F_PATMinout.cs b/PATM_Forms/F_PATMinout.cs index e404e7b..16b51de 100644 --- a/PATM_Forms/F_PATMinout.cs +++ b/PATM_Forms/F_PATMinout.cs @@ -174,12 +174,6 @@ { this.Close(); } - - private void TV_PATMinout_AfterCollapse(object sender, TreeViewEventArgs e) - { - e.Node.ImageIndex = 0; - } - //private void TV_PATMinout_NodeMouseDoubleClick(object sender, TreeNodeMouseClickEventArgs e) diff --git "a/PED_Forms/F_\346\225\260\346\215\256\350\276\223\345\205\245\350\276\223\345\207\272.cs" "b/PED_Forms/F_\346\225\260\346\215\256\350\276\223\345\205\245\350\276\223\345\207\272.cs" index 0f76b8c..4de8b4d 100644 --- "a/PED_Forms/F_\346\225\260\346\215\256\350\276\223\345\205\245\350\276\223\345\207\272.cs" +++ "b/PED_Forms/F_\346\225\260\346\215\256\350\276\223\345\205\245\350\276\223\345\207\272.cs" @@ -188,12 +188,7 @@ } DialogResult = DialogResult.OK;//将当前窗体的对话框返回值设为OK } - private void treeView1_NodeMouseClick(object sender, TreeNodeMouseClickEventArgs e) - { - - //dir = comboBox_Disk.Text + e.Node.FullPath; - e.Node.SelectedImageIndex = e.Node.ImageIndex; - } + private void button1_Click(object sender, EventArgs e) { diff --git a/Program.cs b/Program.cs index 1ff0987..0e480f2 100644 --- a/Program.cs +++ b/Program.cs @@ -105,22 +105,6 @@ File.Copy(localPath_config, filePath_config, true); } - private static void createFolder(String folerName) - { - if (!Directory.Exists(folerName)) - { - Directory.CreateDirectory(folerName); - } - } - - private static void delOldVersion(String fileName) - { - if (System.IO.File.Exists(fileName)) - { - File.Delete(fileName); - } - } - //获取新版本程序的路径 private static string getProgramUrl(string fileName, string nodeName) { diff --git "a/SFiles_Forms/F_SFiles\346\225\260\346\215\256\350\276\223\345\205\245\350\276\223\345\207\272.cs" "b/SFiles_Forms/F_SFiles\346\225\260\346\215\256\350\276\223\345\205\245\350\276\223\345\207\272.cs" index 6f36e10..493895d 100644 --- "a/SFiles_Forms/F_SFiles\346\225\260\346\215\256\350\276\223\345\205\245\350\276\223\345\207\272.cs" +++ "b/SFiles_Forms/F_SFiles\346\225\260\346\215\256\350\276\223\345\205\245\350\276\223\345\207\272.cs" @@ -188,12 +188,6 @@ } DialogResult = DialogResult.OK;//将当前窗体的对话框返回值设为OK } - private void treeView1_NodeMouseClick(object sender, TreeNodeMouseClickEventArgs e) - { - - //dir = comboBox_Disk.Text + e.Node.FullPath; - e.Node.SelectedImageIndex = e.Node.ImageIndex; - } private void button1_Click(object sender, EventArgs e) { diff --git a/SysRescInfoManager.cs b/SysRescInfoManager.cs index 5b3038a..067b90b 100644 --- a/SysRescInfoManager.cs +++ b/SysRescInfoManager.cs @@ -214,15 +214,6 @@ winGridViewPager1.DataSource = table.DefaultView; } - private void LoadData(int pageIndex) - { - string sqlData = GetSql(pageIndex); - initlizeDatagrid(); - DataTable table = OracleUtils.ExecuteDataset(OracleUtils.ConnectionString, CommandType.Text, sqlData).Tables[0]; - winGridViewPager1.DataSource = table.DefaultView; - winGridViewPager1.Refresh(); - } - private string GetSql() { string sqlCount = "select count(*) from casic_userresctest where sysname='EMS'"; diff --git a/Utility.cs b/Utility.cs index 0e929aa..4da961f 100644 --- a/Utility.cs +++ b/Utility.cs @@ -382,7 +382,7 @@ } catch (Exception ex) { - //LogError.PublishError(ex); + LogHelper.WriteLog(typeof(Utility), ex.Message); } finally { @@ -443,7 +443,7 @@ } catch (Exception ex) { - //LogError.PublishError(ex); + LogHelper.WriteLog(typeof(Utility), ex.Message); } finally { @@ -483,7 +483,7 @@ } catch (Exception ex) { - //LogError.PublishError(ex); + LogHelper.WriteLog(typeof(Utility), ex.Message); } finally { @@ -526,8 +526,8 @@ } catch (Exception ex) { - - //LogError.PublishError(ex); + + LogHelper.WriteLog(typeof(Utility), ex.Message); } //finally //{ @@ -565,7 +565,7 @@ } catch (Exception ex) { - //LogError.PublishError(ex); + LogHelper.WriteLog(typeof(Utility), ex.Message); } finally { @@ -600,7 +600,7 @@ } catch (Exception ex) { - //LogError.PublishError(ex); + LogHelper.WriteLog(typeof(Utility), ex.Message); } finally { @@ -639,7 +639,7 @@ } catch (Exception ex) { - //LogError.PublishError(ex); + LogHelper.WriteLog(typeof(Utility),ex.Message); } finally { diff --git a/app.config b/app.config index d01583f..f9eb150 100644 --- a/app.config +++ b/app.config @@ -10,7 +10,7 @@ - + diff --git a/bin/x86/Debug/EMSCyberpipe.exe.config b/bin/x86/Debug/EMSCyberpipe.exe.config index d01583f..f9eb150 100644 --- a/bin/x86/Debug/EMSCyberpipe.exe.config +++ b/bin/x86/Debug/EMSCyberpipe.exe.config @@ -10,7 +10,7 @@ - +