diff --git a/Cyberpipe.suo b/Cyberpipe.suo index e6ae753..dfd18d2 100644 --- a/Cyberpipe.suo +++ b/Cyberpipe.suo Binary files differ diff --git a/Cyberpipe.suo b/Cyberpipe.suo index e6ae753..dfd18d2 100644 --- a/Cyberpipe.suo +++ b/Cyberpipe.suo Binary files differ diff --git a/Forms/FrmPipelineModelDataBase.cs b/Forms/FrmPipelineModelDataBase.cs index 412154d..1e056f0 100644 --- a/Forms/FrmPipelineModelDataBase.cs +++ b/Forms/FrmPipelineModelDataBase.cs @@ -23,7 +23,7 @@ private Hashtable en_cns = new Hashtable(); private Hashtable fields_types = new Hashtable(); private List layernamelist = new List(); - + string layerCaption = ""; public GSOLayer rukuLayer = null; public FrmPipelineModelDB(GSOGlobeControl _ctl, GSODataSource _ds) @@ -54,7 +54,11 @@ { GSOLayer layer = ctl.Globe.Layers[i]; if (layer != null && layer.Name.ToLower().EndsWith(".shp")) - comboBoxExLayer.Items.Add(layer.Name);//初始化图层列表 + { + string str = Path.GetFileName(layer.Name); + comboBoxExLayer.Items.Add(str); + layernamelist.Add(layer.Name.Trim()); + } } } } @@ -107,7 +111,7 @@ { ModelBuilder lineBuilder = new LineBuilder(ds); - GSOLayer layer = ctl.Globe.Layers.GetLayerByCaption(comboBoxExLayer.Text); + GSOLayer layer = ctl.Globe.Layers.GetLayerByCaption(Path.GetFileNameWithoutExtension(comboBoxExLayer.Text.ToString())); LineParam lineParam = new LineParam(); lineParam.layerName = txtModelLayer.Text.ToString(); @@ -125,6 +129,7 @@ lineBuilder.build(layer, checkBoxAdd.Checked ? EnumUpdateMode.Append : EnumUpdateMode.Update, checkBoxDeep.Checked ? EnumBuildMode.Depth : EnumBuildMode.Alititude, lineParam); + MessageBox.Show("入库完成!", "提示"); } catch (Exception ex) { @@ -159,13 +164,6 @@ endH.SelectedItem = "终止点高程"; cmbRadius.SelectedItem = "管径"; - for (int i = 0; i < pipelineTypeCbo.Items.Count; i++) - { - if (strLayerName.Contains(pipelineTypeCbo.Items[i].ToString())) - { - pipelineTypeCbo.Text = pipelineTypeCbo.Items[i].ToString(); - } - } } private void comboBoxExLayer_SelectedIndexChanged(object sender, EventArgs e) @@ -173,13 +171,14 @@ if (comboBoxExLayer.SelectedIndex == -1) return; - GSOLayer layer = ctl.Globe.Layers.Add(comboBoxExLayer.Text.ToString()); - txtModelLayer.Text = layer.Caption; + string layerName = Path.GetFileNameWithoutExtension(comboBoxExLayer.Text.ToString()); + GSOLayer layer = ctl.Globe.Layers.GetLayerByCaption(layerName); GSOFeatures features = layer.GetAllFeatures(); if (features.Length == 0) return; clearComboboxParam(); + txtModelLayer.Text = layerName; for (int i = 0; i < features[0].GetFieldCount(); i++) { diff --git a/Cyberpipe.suo b/Cyberpipe.suo index e6ae753..dfd18d2 100644 --- a/Cyberpipe.suo +++ b/Cyberpipe.suo Binary files differ diff --git a/Forms/FrmPipelineModelDataBase.cs b/Forms/FrmPipelineModelDataBase.cs index 412154d..1e056f0 100644 --- a/Forms/FrmPipelineModelDataBase.cs +++ b/Forms/FrmPipelineModelDataBase.cs @@ -23,7 +23,7 @@ private Hashtable en_cns = new Hashtable(); private Hashtable fields_types = new Hashtable(); private List layernamelist = new List(); - + string layerCaption = ""; public GSOLayer rukuLayer = null; public FrmPipelineModelDB(GSOGlobeControl _ctl, GSODataSource _ds) @@ -54,7 +54,11 @@ { GSOLayer layer = ctl.Globe.Layers[i]; if (layer != null && layer.Name.ToLower().EndsWith(".shp")) - comboBoxExLayer.Items.Add(layer.Name);//初始化图层列表 + { + string str = Path.GetFileName(layer.Name); + comboBoxExLayer.Items.Add(str); + layernamelist.Add(layer.Name.Trim()); + } } } } @@ -107,7 +111,7 @@ { ModelBuilder lineBuilder = new LineBuilder(ds); - GSOLayer layer = ctl.Globe.Layers.GetLayerByCaption(comboBoxExLayer.Text); + GSOLayer layer = ctl.Globe.Layers.GetLayerByCaption(Path.GetFileNameWithoutExtension(comboBoxExLayer.Text.ToString())); LineParam lineParam = new LineParam(); lineParam.layerName = txtModelLayer.Text.ToString(); @@ -125,6 +129,7 @@ lineBuilder.build(layer, checkBoxAdd.Checked ? EnumUpdateMode.Append : EnumUpdateMode.Update, checkBoxDeep.Checked ? EnumBuildMode.Depth : EnumBuildMode.Alititude, lineParam); + MessageBox.Show("入库完成!", "提示"); } catch (Exception ex) { @@ -159,13 +164,6 @@ endH.SelectedItem = "终止点高程"; cmbRadius.SelectedItem = "管径"; - for (int i = 0; i < pipelineTypeCbo.Items.Count; i++) - { - if (strLayerName.Contains(pipelineTypeCbo.Items[i].ToString())) - { - pipelineTypeCbo.Text = pipelineTypeCbo.Items[i].ToString(); - } - } } private void comboBoxExLayer_SelectedIndexChanged(object sender, EventArgs e) @@ -173,13 +171,14 @@ if (comboBoxExLayer.SelectedIndex == -1) return; - GSOLayer layer = ctl.Globe.Layers.Add(comboBoxExLayer.Text.ToString()); - txtModelLayer.Text = layer.Caption; + string layerName = Path.GetFileNameWithoutExtension(comboBoxExLayer.Text.ToString()); + GSOLayer layer = ctl.Globe.Layers.GetLayerByCaption(layerName); GSOFeatures features = layer.GetAllFeatures(); if (features.Length == 0) return; clearComboboxParam(); + txtModelLayer.Text = layerName; for (int i = 0; i < features[0].GetFieldCount(); i++) { diff --git a/FrmAddWellShp.cs b/FrmAddWellShp.cs index 9946798..4beb437 100644 --- a/FrmAddWellShp.cs +++ b/FrmAddWellShp.cs @@ -66,13 +66,13 @@ return; try { - ModelBuilder lineBuilder = new LineBuilder(ds); + ModelBuilder pointBuilder = new PointBuilder(ds); - GSOLayer layer = globeControl1.Globe.Layers.GetLayerByCaption(comboBoxLayer.Text); + GSOLayer layer = globeControl1.Globe.Layers.GetLayerByCaption(Path.GetFileNameWithoutExtension(comboBoxLayer.Text.ToString())); PointParam pointParam = new PointParam(); pointParam.layerName = txtLayerName.Text.ToString(); - pointParam.uniqueIdFieldName = combCode.Text.ToString(); + pointParam.uniqueIdFieldName = comboBoxCode.Text.ToString(); pointParam.upGround = Convert.ToDouble(txtUpGround.Text.ToString()); pointParam.attachNameFieldName = combModelName.Text.ToString(); pointParam.pointEncodingFieldName = combCode.Text.ToString(); @@ -80,8 +80,10 @@ pointParam.symbolFiledName = combAngle.Text.ToString(); pointParam.altitudeFieldName = comboBoxGC.Text.ToString(); - lineBuilder.build(layer, checkBoxAdd.Checked ? EnumUpdateMode.Append : EnumUpdateMode.Update, + pointBuilder.build(layer, checkBoxAdd.Checked ? EnumUpdateMode.Append : EnumUpdateMode.Update, checkBoxDeep.Checked ? EnumBuildMode.Depth : EnumBuildMode.Alititude, pointParam); + + MessageBox.Show("入库完成!", "提示"); } catch (Exception ex) { @@ -97,6 +99,7 @@ { //填充SHP数据列表 comboBoxLayer.Items.Clear(); + if (globeControl1 != null) { for (int i = 0; i < globeControl1.Globe.Layers.Count; i++) @@ -118,6 +121,7 @@ private void clearComboboxParam() { txtLayerName.Text = ""; + comboBoxCode.Items.Clear(); combModelName.Items.Clear(); combCode.Items.Clear(); combDeep.Items.Clear(); @@ -127,6 +131,7 @@ private void addComboboxParam(string strParam) { + comboBoxCode.Items.Add(strParam); combModelName.Items.Add(strParam); combCode.Items.Add(strParam); combDeep.Items.Add(strParam); @@ -138,16 +143,16 @@ { if (ExitFiled(feature, "管点编码")) //特征管点 { - combCode.SelectedItem = "编号"; + comboBoxCode.SelectedItem = "编号"; combModelName.SelectedItem = "管点特征"; combCode.SelectedItem = "管点编码"; - combDeep.SelectedItem = "距地面高程"; + combDeep.SelectedItem = "距地面深度"; combAngle.SelectedItem = "符号角度"; comboBoxGC.SelectedItem = "Z坐标"; } else if (ExitFiled(feature, "附属物编码")) //附属物 { - combCode.SelectedItem = "编号"; + comboBoxCode.SelectedItem = "编号"; combModelName.SelectedItem = "附属物名称"; combCode.SelectedItem = "附属物编码"; combDeep.SelectedItem = "井深"; @@ -156,7 +161,7 @@ } else { - combCode.SelectedItem = "编号"; + comboBoxCode.SelectedItem = "编号"; combModelName.Enabled = false; combCode.SelectedItem = "图层编号"; combDeep.SelectedItem = "标识器埋深"; @@ -180,14 +185,16 @@ { if (comboBoxLayer.SelectedIndex == -1) return; + string layerName=Path.GetFileNameWithoutExtension(comboBoxLayer.Text.ToString()); - GSOLayer layer = globeControl1.Globe.Layers.Add(comboBoxLayer.Text.ToString()); + GSOLayer layer = globeControl1.Globe.Layers.GetLayerByCaption(layerName); - txtLayerName.Text = layer.Caption; GSOFeatures features = layer.GetAllFeatures(); if (features.Length == 0) return; + clearComboboxParam(); + txtLayerName.Text = layerName; for (int i = 0; i < features[0].GetFieldCount(); i++) { diff --git a/Cyberpipe.suo b/Cyberpipe.suo index e6ae753..dfd18d2 100644 --- a/Cyberpipe.suo +++ b/Cyberpipe.suo Binary files differ diff --git a/Forms/FrmPipelineModelDataBase.cs b/Forms/FrmPipelineModelDataBase.cs index 412154d..1e056f0 100644 --- a/Forms/FrmPipelineModelDataBase.cs +++ b/Forms/FrmPipelineModelDataBase.cs @@ -23,7 +23,7 @@ private Hashtable en_cns = new Hashtable(); private Hashtable fields_types = new Hashtable(); private List layernamelist = new List(); - + string layerCaption = ""; public GSOLayer rukuLayer = null; public FrmPipelineModelDB(GSOGlobeControl _ctl, GSODataSource _ds) @@ -54,7 +54,11 @@ { GSOLayer layer = ctl.Globe.Layers[i]; if (layer != null && layer.Name.ToLower().EndsWith(".shp")) - comboBoxExLayer.Items.Add(layer.Name);//初始化图层列表 + { + string str = Path.GetFileName(layer.Name); + comboBoxExLayer.Items.Add(str); + layernamelist.Add(layer.Name.Trim()); + } } } } @@ -107,7 +111,7 @@ { ModelBuilder lineBuilder = new LineBuilder(ds); - GSOLayer layer = ctl.Globe.Layers.GetLayerByCaption(comboBoxExLayer.Text); + GSOLayer layer = ctl.Globe.Layers.GetLayerByCaption(Path.GetFileNameWithoutExtension(comboBoxExLayer.Text.ToString())); LineParam lineParam = new LineParam(); lineParam.layerName = txtModelLayer.Text.ToString(); @@ -125,6 +129,7 @@ lineBuilder.build(layer, checkBoxAdd.Checked ? EnumUpdateMode.Append : EnumUpdateMode.Update, checkBoxDeep.Checked ? EnumBuildMode.Depth : EnumBuildMode.Alititude, lineParam); + MessageBox.Show("入库完成!", "提示"); } catch (Exception ex) { @@ -159,13 +164,6 @@ endH.SelectedItem = "终止点高程"; cmbRadius.SelectedItem = "管径"; - for (int i = 0; i < pipelineTypeCbo.Items.Count; i++) - { - if (strLayerName.Contains(pipelineTypeCbo.Items[i].ToString())) - { - pipelineTypeCbo.Text = pipelineTypeCbo.Items[i].ToString(); - } - } } private void comboBoxExLayer_SelectedIndexChanged(object sender, EventArgs e) @@ -173,13 +171,14 @@ if (comboBoxExLayer.SelectedIndex == -1) return; - GSOLayer layer = ctl.Globe.Layers.Add(comboBoxExLayer.Text.ToString()); - txtModelLayer.Text = layer.Caption; + string layerName = Path.GetFileNameWithoutExtension(comboBoxExLayer.Text.ToString()); + GSOLayer layer = ctl.Globe.Layers.GetLayerByCaption(layerName); GSOFeatures features = layer.GetAllFeatures(); if (features.Length == 0) return; clearComboboxParam(); + txtModelLayer.Text = layerName; for (int i = 0; i < features[0].GetFieldCount(); i++) { diff --git a/FrmAddWellShp.cs b/FrmAddWellShp.cs index 9946798..4beb437 100644 --- a/FrmAddWellShp.cs +++ b/FrmAddWellShp.cs @@ -66,13 +66,13 @@ return; try { - ModelBuilder lineBuilder = new LineBuilder(ds); + ModelBuilder pointBuilder = new PointBuilder(ds); - GSOLayer layer = globeControl1.Globe.Layers.GetLayerByCaption(comboBoxLayer.Text); + GSOLayer layer = globeControl1.Globe.Layers.GetLayerByCaption(Path.GetFileNameWithoutExtension(comboBoxLayer.Text.ToString())); PointParam pointParam = new PointParam(); pointParam.layerName = txtLayerName.Text.ToString(); - pointParam.uniqueIdFieldName = combCode.Text.ToString(); + pointParam.uniqueIdFieldName = comboBoxCode.Text.ToString(); pointParam.upGround = Convert.ToDouble(txtUpGround.Text.ToString()); pointParam.attachNameFieldName = combModelName.Text.ToString(); pointParam.pointEncodingFieldName = combCode.Text.ToString(); @@ -80,8 +80,10 @@ pointParam.symbolFiledName = combAngle.Text.ToString(); pointParam.altitudeFieldName = comboBoxGC.Text.ToString(); - lineBuilder.build(layer, checkBoxAdd.Checked ? EnumUpdateMode.Append : EnumUpdateMode.Update, + pointBuilder.build(layer, checkBoxAdd.Checked ? EnumUpdateMode.Append : EnumUpdateMode.Update, checkBoxDeep.Checked ? EnumBuildMode.Depth : EnumBuildMode.Alititude, pointParam); + + MessageBox.Show("入库完成!", "提示"); } catch (Exception ex) { @@ -97,6 +99,7 @@ { //填充SHP数据列表 comboBoxLayer.Items.Clear(); + if (globeControl1 != null) { for (int i = 0; i < globeControl1.Globe.Layers.Count; i++) @@ -118,6 +121,7 @@ private void clearComboboxParam() { txtLayerName.Text = ""; + comboBoxCode.Items.Clear(); combModelName.Items.Clear(); combCode.Items.Clear(); combDeep.Items.Clear(); @@ -127,6 +131,7 @@ private void addComboboxParam(string strParam) { + comboBoxCode.Items.Add(strParam); combModelName.Items.Add(strParam); combCode.Items.Add(strParam); combDeep.Items.Add(strParam); @@ -138,16 +143,16 @@ { if (ExitFiled(feature, "管点编码")) //特征管点 { - combCode.SelectedItem = "编号"; + comboBoxCode.SelectedItem = "编号"; combModelName.SelectedItem = "管点特征"; combCode.SelectedItem = "管点编码"; - combDeep.SelectedItem = "距地面高程"; + combDeep.SelectedItem = "距地面深度"; combAngle.SelectedItem = "符号角度"; comboBoxGC.SelectedItem = "Z坐标"; } else if (ExitFiled(feature, "附属物编码")) //附属物 { - combCode.SelectedItem = "编号"; + comboBoxCode.SelectedItem = "编号"; combModelName.SelectedItem = "附属物名称"; combCode.SelectedItem = "附属物编码"; combDeep.SelectedItem = "井深"; @@ -156,7 +161,7 @@ } else { - combCode.SelectedItem = "编号"; + comboBoxCode.SelectedItem = "编号"; combModelName.Enabled = false; combCode.SelectedItem = "图层编号"; combDeep.SelectedItem = "标识器埋深"; @@ -180,14 +185,16 @@ { if (comboBoxLayer.SelectedIndex == -1) return; + string layerName=Path.GetFileNameWithoutExtension(comboBoxLayer.Text.ToString()); - GSOLayer layer = globeControl1.Globe.Layers.Add(comboBoxLayer.Text.ToString()); + GSOLayer layer = globeControl1.Globe.Layers.GetLayerByCaption(layerName); - txtLayerName.Text = layer.Caption; GSOFeatures features = layer.GetAllFeatures(); if (features.Length == 0) return; + clearComboboxParam(); + txtLayerName.Text = layerName; for (int i = 0; i < features[0].GetFieldCount(); i++) { diff --git a/PointBuilder.cs b/PointBuilder.cs index a83560b..b48cc29 100644 --- a/PointBuilder.cs +++ b/PointBuilder.cs @@ -89,12 +89,14 @@ model.Position = pt; model.Align = EnumEntityAlign.TopCenter; // model.AltitudeMode = (buildMode.Equals(EnumBuildMode.Alititude)) ? EnumAltitudeMode.RelativeToGround : EnumAltitudeMode.Absolute; - model.RotateZ = 0 - (double)f.GetValue(pointParam.symbolFiledName) * 180 / Math.PI + 90; + model.RotateZ = (pointParam.symbolFiledName == "")?0 + :0 - (double)f.GetValue(pointParam.symbolFiledName) * 180 / Math.PI + 90; model.FilePath = getModelPath(f, pointParam); model.Name = f.GetValue(pointParam.uniqueIdFieldName).ToString(); return model; } + private String getModelPath(GSOFeature f, PointParam pointParam) { string feName = f.GetFieldAsString(pointParam.attachNameFieldName); diff --git a/Cyberpipe.suo b/Cyberpipe.suo index e6ae753..dfd18d2 100644 --- a/Cyberpipe.suo +++ b/Cyberpipe.suo Binary files differ diff --git a/Forms/FrmPipelineModelDataBase.cs b/Forms/FrmPipelineModelDataBase.cs index 412154d..1e056f0 100644 --- a/Forms/FrmPipelineModelDataBase.cs +++ b/Forms/FrmPipelineModelDataBase.cs @@ -23,7 +23,7 @@ private Hashtable en_cns = new Hashtable(); private Hashtable fields_types = new Hashtable(); private List layernamelist = new List(); - + string layerCaption = ""; public GSOLayer rukuLayer = null; public FrmPipelineModelDB(GSOGlobeControl _ctl, GSODataSource _ds) @@ -54,7 +54,11 @@ { GSOLayer layer = ctl.Globe.Layers[i]; if (layer != null && layer.Name.ToLower().EndsWith(".shp")) - comboBoxExLayer.Items.Add(layer.Name);//初始化图层列表 + { + string str = Path.GetFileName(layer.Name); + comboBoxExLayer.Items.Add(str); + layernamelist.Add(layer.Name.Trim()); + } } } } @@ -107,7 +111,7 @@ { ModelBuilder lineBuilder = new LineBuilder(ds); - GSOLayer layer = ctl.Globe.Layers.GetLayerByCaption(comboBoxExLayer.Text); + GSOLayer layer = ctl.Globe.Layers.GetLayerByCaption(Path.GetFileNameWithoutExtension(comboBoxExLayer.Text.ToString())); LineParam lineParam = new LineParam(); lineParam.layerName = txtModelLayer.Text.ToString(); @@ -125,6 +129,7 @@ lineBuilder.build(layer, checkBoxAdd.Checked ? EnumUpdateMode.Append : EnumUpdateMode.Update, checkBoxDeep.Checked ? EnumBuildMode.Depth : EnumBuildMode.Alititude, lineParam); + MessageBox.Show("入库完成!", "提示"); } catch (Exception ex) { @@ -159,13 +164,6 @@ endH.SelectedItem = "终止点高程"; cmbRadius.SelectedItem = "管径"; - for (int i = 0; i < pipelineTypeCbo.Items.Count; i++) - { - if (strLayerName.Contains(pipelineTypeCbo.Items[i].ToString())) - { - pipelineTypeCbo.Text = pipelineTypeCbo.Items[i].ToString(); - } - } } private void comboBoxExLayer_SelectedIndexChanged(object sender, EventArgs e) @@ -173,13 +171,14 @@ if (comboBoxExLayer.SelectedIndex == -1) return; - GSOLayer layer = ctl.Globe.Layers.Add(comboBoxExLayer.Text.ToString()); - txtModelLayer.Text = layer.Caption; + string layerName = Path.GetFileNameWithoutExtension(comboBoxExLayer.Text.ToString()); + GSOLayer layer = ctl.Globe.Layers.GetLayerByCaption(layerName); GSOFeatures features = layer.GetAllFeatures(); if (features.Length == 0) return; clearComboboxParam(); + txtModelLayer.Text = layerName; for (int i = 0; i < features[0].GetFieldCount(); i++) { diff --git a/FrmAddWellShp.cs b/FrmAddWellShp.cs index 9946798..4beb437 100644 --- a/FrmAddWellShp.cs +++ b/FrmAddWellShp.cs @@ -66,13 +66,13 @@ return; try { - ModelBuilder lineBuilder = new LineBuilder(ds); + ModelBuilder pointBuilder = new PointBuilder(ds); - GSOLayer layer = globeControl1.Globe.Layers.GetLayerByCaption(comboBoxLayer.Text); + GSOLayer layer = globeControl1.Globe.Layers.GetLayerByCaption(Path.GetFileNameWithoutExtension(comboBoxLayer.Text.ToString())); PointParam pointParam = new PointParam(); pointParam.layerName = txtLayerName.Text.ToString(); - pointParam.uniqueIdFieldName = combCode.Text.ToString(); + pointParam.uniqueIdFieldName = comboBoxCode.Text.ToString(); pointParam.upGround = Convert.ToDouble(txtUpGround.Text.ToString()); pointParam.attachNameFieldName = combModelName.Text.ToString(); pointParam.pointEncodingFieldName = combCode.Text.ToString(); @@ -80,8 +80,10 @@ pointParam.symbolFiledName = combAngle.Text.ToString(); pointParam.altitudeFieldName = comboBoxGC.Text.ToString(); - lineBuilder.build(layer, checkBoxAdd.Checked ? EnumUpdateMode.Append : EnumUpdateMode.Update, + pointBuilder.build(layer, checkBoxAdd.Checked ? EnumUpdateMode.Append : EnumUpdateMode.Update, checkBoxDeep.Checked ? EnumBuildMode.Depth : EnumBuildMode.Alititude, pointParam); + + MessageBox.Show("入库完成!", "提示"); } catch (Exception ex) { @@ -97,6 +99,7 @@ { //填充SHP数据列表 comboBoxLayer.Items.Clear(); + if (globeControl1 != null) { for (int i = 0; i < globeControl1.Globe.Layers.Count; i++) @@ -118,6 +121,7 @@ private void clearComboboxParam() { txtLayerName.Text = ""; + comboBoxCode.Items.Clear(); combModelName.Items.Clear(); combCode.Items.Clear(); combDeep.Items.Clear(); @@ -127,6 +131,7 @@ private void addComboboxParam(string strParam) { + comboBoxCode.Items.Add(strParam); combModelName.Items.Add(strParam); combCode.Items.Add(strParam); combDeep.Items.Add(strParam); @@ -138,16 +143,16 @@ { if (ExitFiled(feature, "管点编码")) //特征管点 { - combCode.SelectedItem = "编号"; + comboBoxCode.SelectedItem = "编号"; combModelName.SelectedItem = "管点特征"; combCode.SelectedItem = "管点编码"; - combDeep.SelectedItem = "距地面高程"; + combDeep.SelectedItem = "距地面深度"; combAngle.SelectedItem = "符号角度"; comboBoxGC.SelectedItem = "Z坐标"; } else if (ExitFiled(feature, "附属物编码")) //附属物 { - combCode.SelectedItem = "编号"; + comboBoxCode.SelectedItem = "编号"; combModelName.SelectedItem = "附属物名称"; combCode.SelectedItem = "附属物编码"; combDeep.SelectedItem = "井深"; @@ -156,7 +161,7 @@ } else { - combCode.SelectedItem = "编号"; + comboBoxCode.SelectedItem = "编号"; combModelName.Enabled = false; combCode.SelectedItem = "图层编号"; combDeep.SelectedItem = "标识器埋深"; @@ -180,14 +185,16 @@ { if (comboBoxLayer.SelectedIndex == -1) return; + string layerName=Path.GetFileNameWithoutExtension(comboBoxLayer.Text.ToString()); - GSOLayer layer = globeControl1.Globe.Layers.Add(comboBoxLayer.Text.ToString()); + GSOLayer layer = globeControl1.Globe.Layers.GetLayerByCaption(layerName); - txtLayerName.Text = layer.Caption; GSOFeatures features = layer.GetAllFeatures(); if (features.Length == 0) return; + clearComboboxParam(); + txtLayerName.Text = layerName; for (int i = 0; i < features[0].GetFieldCount(); i++) { diff --git a/PointBuilder.cs b/PointBuilder.cs index a83560b..b48cc29 100644 --- a/PointBuilder.cs +++ b/PointBuilder.cs @@ -89,12 +89,14 @@ model.Position = pt; model.Align = EnumEntityAlign.TopCenter; // model.AltitudeMode = (buildMode.Equals(EnumBuildMode.Alititude)) ? EnumAltitudeMode.RelativeToGround : EnumAltitudeMode.Absolute; - model.RotateZ = 0 - (double)f.GetValue(pointParam.symbolFiledName) * 180 / Math.PI + 90; + model.RotateZ = (pointParam.symbolFiledName == "")?0 + :0 - (double)f.GetValue(pointParam.symbolFiledName) * 180 / Math.PI + 90; model.FilePath = getModelPath(f, pointParam); model.Name = f.GetValue(pointParam.uniqueIdFieldName).ToString(); return model; } + private String getModelPath(GSOFeature f, PointParam pointParam) { string feName = f.GetFieldAsString(pointParam.attachNameFieldName); diff --git a/bin/x86/Debug/Cyberpipe.exe b/bin/x86/Debug/Cyberpipe.exe index c55aea6..19fa9e4 100644 --- a/bin/x86/Debug/Cyberpipe.exe +++ b/bin/x86/Debug/Cyberpipe.exe Binary files differ diff --git a/Cyberpipe.suo b/Cyberpipe.suo index e6ae753..dfd18d2 100644 --- a/Cyberpipe.suo +++ b/Cyberpipe.suo Binary files differ diff --git a/Forms/FrmPipelineModelDataBase.cs b/Forms/FrmPipelineModelDataBase.cs index 412154d..1e056f0 100644 --- a/Forms/FrmPipelineModelDataBase.cs +++ b/Forms/FrmPipelineModelDataBase.cs @@ -23,7 +23,7 @@ private Hashtable en_cns = new Hashtable(); private Hashtable fields_types = new Hashtable(); private List layernamelist = new List(); - + string layerCaption = ""; public GSOLayer rukuLayer = null; public FrmPipelineModelDB(GSOGlobeControl _ctl, GSODataSource _ds) @@ -54,7 +54,11 @@ { GSOLayer layer = ctl.Globe.Layers[i]; if (layer != null && layer.Name.ToLower().EndsWith(".shp")) - comboBoxExLayer.Items.Add(layer.Name);//初始化图层列表 + { + string str = Path.GetFileName(layer.Name); + comboBoxExLayer.Items.Add(str); + layernamelist.Add(layer.Name.Trim()); + } } } } @@ -107,7 +111,7 @@ { ModelBuilder lineBuilder = new LineBuilder(ds); - GSOLayer layer = ctl.Globe.Layers.GetLayerByCaption(comboBoxExLayer.Text); + GSOLayer layer = ctl.Globe.Layers.GetLayerByCaption(Path.GetFileNameWithoutExtension(comboBoxExLayer.Text.ToString())); LineParam lineParam = new LineParam(); lineParam.layerName = txtModelLayer.Text.ToString(); @@ -125,6 +129,7 @@ lineBuilder.build(layer, checkBoxAdd.Checked ? EnumUpdateMode.Append : EnumUpdateMode.Update, checkBoxDeep.Checked ? EnumBuildMode.Depth : EnumBuildMode.Alititude, lineParam); + MessageBox.Show("入库完成!", "提示"); } catch (Exception ex) { @@ -159,13 +164,6 @@ endH.SelectedItem = "终止点高程"; cmbRadius.SelectedItem = "管径"; - for (int i = 0; i < pipelineTypeCbo.Items.Count; i++) - { - if (strLayerName.Contains(pipelineTypeCbo.Items[i].ToString())) - { - pipelineTypeCbo.Text = pipelineTypeCbo.Items[i].ToString(); - } - } } private void comboBoxExLayer_SelectedIndexChanged(object sender, EventArgs e) @@ -173,13 +171,14 @@ if (comboBoxExLayer.SelectedIndex == -1) return; - GSOLayer layer = ctl.Globe.Layers.Add(comboBoxExLayer.Text.ToString()); - txtModelLayer.Text = layer.Caption; + string layerName = Path.GetFileNameWithoutExtension(comboBoxExLayer.Text.ToString()); + GSOLayer layer = ctl.Globe.Layers.GetLayerByCaption(layerName); GSOFeatures features = layer.GetAllFeatures(); if (features.Length == 0) return; clearComboboxParam(); + txtModelLayer.Text = layerName; for (int i = 0; i < features[0].GetFieldCount(); i++) { diff --git a/FrmAddWellShp.cs b/FrmAddWellShp.cs index 9946798..4beb437 100644 --- a/FrmAddWellShp.cs +++ b/FrmAddWellShp.cs @@ -66,13 +66,13 @@ return; try { - ModelBuilder lineBuilder = new LineBuilder(ds); + ModelBuilder pointBuilder = new PointBuilder(ds); - GSOLayer layer = globeControl1.Globe.Layers.GetLayerByCaption(comboBoxLayer.Text); + GSOLayer layer = globeControl1.Globe.Layers.GetLayerByCaption(Path.GetFileNameWithoutExtension(comboBoxLayer.Text.ToString())); PointParam pointParam = new PointParam(); pointParam.layerName = txtLayerName.Text.ToString(); - pointParam.uniqueIdFieldName = combCode.Text.ToString(); + pointParam.uniqueIdFieldName = comboBoxCode.Text.ToString(); pointParam.upGround = Convert.ToDouble(txtUpGround.Text.ToString()); pointParam.attachNameFieldName = combModelName.Text.ToString(); pointParam.pointEncodingFieldName = combCode.Text.ToString(); @@ -80,8 +80,10 @@ pointParam.symbolFiledName = combAngle.Text.ToString(); pointParam.altitudeFieldName = comboBoxGC.Text.ToString(); - lineBuilder.build(layer, checkBoxAdd.Checked ? EnumUpdateMode.Append : EnumUpdateMode.Update, + pointBuilder.build(layer, checkBoxAdd.Checked ? EnumUpdateMode.Append : EnumUpdateMode.Update, checkBoxDeep.Checked ? EnumBuildMode.Depth : EnumBuildMode.Alititude, pointParam); + + MessageBox.Show("入库完成!", "提示"); } catch (Exception ex) { @@ -97,6 +99,7 @@ { //填充SHP数据列表 comboBoxLayer.Items.Clear(); + if (globeControl1 != null) { for (int i = 0; i < globeControl1.Globe.Layers.Count; i++) @@ -118,6 +121,7 @@ private void clearComboboxParam() { txtLayerName.Text = ""; + comboBoxCode.Items.Clear(); combModelName.Items.Clear(); combCode.Items.Clear(); combDeep.Items.Clear(); @@ -127,6 +131,7 @@ private void addComboboxParam(string strParam) { + comboBoxCode.Items.Add(strParam); combModelName.Items.Add(strParam); combCode.Items.Add(strParam); combDeep.Items.Add(strParam); @@ -138,16 +143,16 @@ { if (ExitFiled(feature, "管点编码")) //特征管点 { - combCode.SelectedItem = "编号"; + comboBoxCode.SelectedItem = "编号"; combModelName.SelectedItem = "管点特征"; combCode.SelectedItem = "管点编码"; - combDeep.SelectedItem = "距地面高程"; + combDeep.SelectedItem = "距地面深度"; combAngle.SelectedItem = "符号角度"; comboBoxGC.SelectedItem = "Z坐标"; } else if (ExitFiled(feature, "附属物编码")) //附属物 { - combCode.SelectedItem = "编号"; + comboBoxCode.SelectedItem = "编号"; combModelName.SelectedItem = "附属物名称"; combCode.SelectedItem = "附属物编码"; combDeep.SelectedItem = "井深"; @@ -156,7 +161,7 @@ } else { - combCode.SelectedItem = "编号"; + comboBoxCode.SelectedItem = "编号"; combModelName.Enabled = false; combCode.SelectedItem = "图层编号"; combDeep.SelectedItem = "标识器埋深"; @@ -180,14 +185,16 @@ { if (comboBoxLayer.SelectedIndex == -1) return; + string layerName=Path.GetFileNameWithoutExtension(comboBoxLayer.Text.ToString()); - GSOLayer layer = globeControl1.Globe.Layers.Add(comboBoxLayer.Text.ToString()); + GSOLayer layer = globeControl1.Globe.Layers.GetLayerByCaption(layerName); - txtLayerName.Text = layer.Caption; GSOFeatures features = layer.GetAllFeatures(); if (features.Length == 0) return; + clearComboboxParam(); + txtLayerName.Text = layerName; for (int i = 0; i < features[0].GetFieldCount(); i++) { diff --git a/PointBuilder.cs b/PointBuilder.cs index a83560b..b48cc29 100644 --- a/PointBuilder.cs +++ b/PointBuilder.cs @@ -89,12 +89,14 @@ model.Position = pt; model.Align = EnumEntityAlign.TopCenter; // model.AltitudeMode = (buildMode.Equals(EnumBuildMode.Alititude)) ? EnumAltitudeMode.RelativeToGround : EnumAltitudeMode.Absolute; - model.RotateZ = 0 - (double)f.GetValue(pointParam.symbolFiledName) * 180 / Math.PI + 90; + model.RotateZ = (pointParam.symbolFiledName == "")?0 + :0 - (double)f.GetValue(pointParam.symbolFiledName) * 180 / Math.PI + 90; model.FilePath = getModelPath(f, pointParam); model.Name = f.GetValue(pointParam.uniqueIdFieldName).ToString(); return model; } + private String getModelPath(GSOFeature f, PointParam pointParam) { string feName = f.GetFieldAsString(pointParam.attachNameFieldName); diff --git a/bin/x86/Debug/Cyberpipe.exe b/bin/x86/Debug/Cyberpipe.exe index c55aea6..19fa9e4 100644 --- a/bin/x86/Debug/Cyberpipe.exe +++ b/bin/x86/Debug/Cyberpipe.exe Binary files differ diff --git a/bin/x86/Debug/Cyberpipe.pdb b/bin/x86/Debug/Cyberpipe.pdb index 2fd12e4..ce95ccc 100644 --- a/bin/x86/Debug/Cyberpipe.pdb +++ b/bin/x86/Debug/Cyberpipe.pdb Binary files differ diff --git a/Cyberpipe.suo b/Cyberpipe.suo index e6ae753..dfd18d2 100644 --- a/Cyberpipe.suo +++ b/Cyberpipe.suo Binary files differ diff --git a/Forms/FrmPipelineModelDataBase.cs b/Forms/FrmPipelineModelDataBase.cs index 412154d..1e056f0 100644 --- a/Forms/FrmPipelineModelDataBase.cs +++ b/Forms/FrmPipelineModelDataBase.cs @@ -23,7 +23,7 @@ private Hashtable en_cns = new Hashtable(); private Hashtable fields_types = new Hashtable(); private List layernamelist = new List(); - + string layerCaption = ""; public GSOLayer rukuLayer = null; public FrmPipelineModelDB(GSOGlobeControl _ctl, GSODataSource _ds) @@ -54,7 +54,11 @@ { GSOLayer layer = ctl.Globe.Layers[i]; if (layer != null && layer.Name.ToLower().EndsWith(".shp")) - comboBoxExLayer.Items.Add(layer.Name);//初始化图层列表 + { + string str = Path.GetFileName(layer.Name); + comboBoxExLayer.Items.Add(str); + layernamelist.Add(layer.Name.Trim()); + } } } } @@ -107,7 +111,7 @@ { ModelBuilder lineBuilder = new LineBuilder(ds); - GSOLayer layer = ctl.Globe.Layers.GetLayerByCaption(comboBoxExLayer.Text); + GSOLayer layer = ctl.Globe.Layers.GetLayerByCaption(Path.GetFileNameWithoutExtension(comboBoxExLayer.Text.ToString())); LineParam lineParam = new LineParam(); lineParam.layerName = txtModelLayer.Text.ToString(); @@ -125,6 +129,7 @@ lineBuilder.build(layer, checkBoxAdd.Checked ? EnumUpdateMode.Append : EnumUpdateMode.Update, checkBoxDeep.Checked ? EnumBuildMode.Depth : EnumBuildMode.Alititude, lineParam); + MessageBox.Show("入库完成!", "提示"); } catch (Exception ex) { @@ -159,13 +164,6 @@ endH.SelectedItem = "终止点高程"; cmbRadius.SelectedItem = "管径"; - for (int i = 0; i < pipelineTypeCbo.Items.Count; i++) - { - if (strLayerName.Contains(pipelineTypeCbo.Items[i].ToString())) - { - pipelineTypeCbo.Text = pipelineTypeCbo.Items[i].ToString(); - } - } } private void comboBoxExLayer_SelectedIndexChanged(object sender, EventArgs e) @@ -173,13 +171,14 @@ if (comboBoxExLayer.SelectedIndex == -1) return; - GSOLayer layer = ctl.Globe.Layers.Add(comboBoxExLayer.Text.ToString()); - txtModelLayer.Text = layer.Caption; + string layerName = Path.GetFileNameWithoutExtension(comboBoxExLayer.Text.ToString()); + GSOLayer layer = ctl.Globe.Layers.GetLayerByCaption(layerName); GSOFeatures features = layer.GetAllFeatures(); if (features.Length == 0) return; clearComboboxParam(); + txtModelLayer.Text = layerName; for (int i = 0; i < features[0].GetFieldCount(); i++) { diff --git a/FrmAddWellShp.cs b/FrmAddWellShp.cs index 9946798..4beb437 100644 --- a/FrmAddWellShp.cs +++ b/FrmAddWellShp.cs @@ -66,13 +66,13 @@ return; try { - ModelBuilder lineBuilder = new LineBuilder(ds); + ModelBuilder pointBuilder = new PointBuilder(ds); - GSOLayer layer = globeControl1.Globe.Layers.GetLayerByCaption(comboBoxLayer.Text); + GSOLayer layer = globeControl1.Globe.Layers.GetLayerByCaption(Path.GetFileNameWithoutExtension(comboBoxLayer.Text.ToString())); PointParam pointParam = new PointParam(); pointParam.layerName = txtLayerName.Text.ToString(); - pointParam.uniqueIdFieldName = combCode.Text.ToString(); + pointParam.uniqueIdFieldName = comboBoxCode.Text.ToString(); pointParam.upGround = Convert.ToDouble(txtUpGround.Text.ToString()); pointParam.attachNameFieldName = combModelName.Text.ToString(); pointParam.pointEncodingFieldName = combCode.Text.ToString(); @@ -80,8 +80,10 @@ pointParam.symbolFiledName = combAngle.Text.ToString(); pointParam.altitudeFieldName = comboBoxGC.Text.ToString(); - lineBuilder.build(layer, checkBoxAdd.Checked ? EnumUpdateMode.Append : EnumUpdateMode.Update, + pointBuilder.build(layer, checkBoxAdd.Checked ? EnumUpdateMode.Append : EnumUpdateMode.Update, checkBoxDeep.Checked ? EnumBuildMode.Depth : EnumBuildMode.Alititude, pointParam); + + MessageBox.Show("入库完成!", "提示"); } catch (Exception ex) { @@ -97,6 +99,7 @@ { //填充SHP数据列表 comboBoxLayer.Items.Clear(); + if (globeControl1 != null) { for (int i = 0; i < globeControl1.Globe.Layers.Count; i++) @@ -118,6 +121,7 @@ private void clearComboboxParam() { txtLayerName.Text = ""; + comboBoxCode.Items.Clear(); combModelName.Items.Clear(); combCode.Items.Clear(); combDeep.Items.Clear(); @@ -127,6 +131,7 @@ private void addComboboxParam(string strParam) { + comboBoxCode.Items.Add(strParam); combModelName.Items.Add(strParam); combCode.Items.Add(strParam); combDeep.Items.Add(strParam); @@ -138,16 +143,16 @@ { if (ExitFiled(feature, "管点编码")) //特征管点 { - combCode.SelectedItem = "编号"; + comboBoxCode.SelectedItem = "编号"; combModelName.SelectedItem = "管点特征"; combCode.SelectedItem = "管点编码"; - combDeep.SelectedItem = "距地面高程"; + combDeep.SelectedItem = "距地面深度"; combAngle.SelectedItem = "符号角度"; comboBoxGC.SelectedItem = "Z坐标"; } else if (ExitFiled(feature, "附属物编码")) //附属物 { - combCode.SelectedItem = "编号"; + comboBoxCode.SelectedItem = "编号"; combModelName.SelectedItem = "附属物名称"; combCode.SelectedItem = "附属物编码"; combDeep.SelectedItem = "井深"; @@ -156,7 +161,7 @@ } else { - combCode.SelectedItem = "编号"; + comboBoxCode.SelectedItem = "编号"; combModelName.Enabled = false; combCode.SelectedItem = "图层编号"; combDeep.SelectedItem = "标识器埋深"; @@ -180,14 +185,16 @@ { if (comboBoxLayer.SelectedIndex == -1) return; + string layerName=Path.GetFileNameWithoutExtension(comboBoxLayer.Text.ToString()); - GSOLayer layer = globeControl1.Globe.Layers.Add(comboBoxLayer.Text.ToString()); + GSOLayer layer = globeControl1.Globe.Layers.GetLayerByCaption(layerName); - txtLayerName.Text = layer.Caption; GSOFeatures features = layer.GetAllFeatures(); if (features.Length == 0) return; + clearComboboxParam(); + txtLayerName.Text = layerName; for (int i = 0; i < features[0].GetFieldCount(); i++) { diff --git a/PointBuilder.cs b/PointBuilder.cs index a83560b..b48cc29 100644 --- a/PointBuilder.cs +++ b/PointBuilder.cs @@ -89,12 +89,14 @@ model.Position = pt; model.Align = EnumEntityAlign.TopCenter; // model.AltitudeMode = (buildMode.Equals(EnumBuildMode.Alititude)) ? EnumAltitudeMode.RelativeToGround : EnumAltitudeMode.Absolute; - model.RotateZ = 0 - (double)f.GetValue(pointParam.symbolFiledName) * 180 / Math.PI + 90; + model.RotateZ = (pointParam.symbolFiledName == "")?0 + :0 - (double)f.GetValue(pointParam.symbolFiledName) * 180 / Math.PI + 90; model.FilePath = getModelPath(f, pointParam); model.Name = f.GetValue(pointParam.uniqueIdFieldName).ToString(); return model; } + private String getModelPath(GSOFeature f, PointParam pointParam) { string feName = f.GetFieldAsString(pointParam.attachNameFieldName); diff --git a/bin/x86/Debug/Cyberpipe.exe b/bin/x86/Debug/Cyberpipe.exe index c55aea6..19fa9e4 100644 --- a/bin/x86/Debug/Cyberpipe.exe +++ b/bin/x86/Debug/Cyberpipe.exe Binary files differ diff --git a/bin/x86/Debug/Cyberpipe.pdb b/bin/x86/Debug/Cyberpipe.pdb index 2fd12e4..ce95ccc 100644 --- a/bin/x86/Debug/Cyberpipe.pdb +++ b/bin/x86/Debug/Cyberpipe.pdb Binary files differ diff --git a/bin/x86/Debug/Cyberpipe.vshost.exe.manifest b/bin/x86/Debug/Cyberpipe.vshost.exe.manifest new file mode 100644 index 0000000..061c9ca --- /dev/null +++ b/bin/x86/Debug/Cyberpipe.vshost.exe.manifest @@ -0,0 +1,11 @@ + + + + + + + + + + + diff --git a/Cyberpipe.suo b/Cyberpipe.suo index e6ae753..dfd18d2 100644 --- a/Cyberpipe.suo +++ b/Cyberpipe.suo Binary files differ diff --git a/Forms/FrmPipelineModelDataBase.cs b/Forms/FrmPipelineModelDataBase.cs index 412154d..1e056f0 100644 --- a/Forms/FrmPipelineModelDataBase.cs +++ b/Forms/FrmPipelineModelDataBase.cs @@ -23,7 +23,7 @@ private Hashtable en_cns = new Hashtable(); private Hashtable fields_types = new Hashtable(); private List layernamelist = new List(); - + string layerCaption = ""; public GSOLayer rukuLayer = null; public FrmPipelineModelDB(GSOGlobeControl _ctl, GSODataSource _ds) @@ -54,7 +54,11 @@ { GSOLayer layer = ctl.Globe.Layers[i]; if (layer != null && layer.Name.ToLower().EndsWith(".shp")) - comboBoxExLayer.Items.Add(layer.Name);//初始化图层列表 + { + string str = Path.GetFileName(layer.Name); + comboBoxExLayer.Items.Add(str); + layernamelist.Add(layer.Name.Trim()); + } } } } @@ -107,7 +111,7 @@ { ModelBuilder lineBuilder = new LineBuilder(ds); - GSOLayer layer = ctl.Globe.Layers.GetLayerByCaption(comboBoxExLayer.Text); + GSOLayer layer = ctl.Globe.Layers.GetLayerByCaption(Path.GetFileNameWithoutExtension(comboBoxExLayer.Text.ToString())); LineParam lineParam = new LineParam(); lineParam.layerName = txtModelLayer.Text.ToString(); @@ -125,6 +129,7 @@ lineBuilder.build(layer, checkBoxAdd.Checked ? EnumUpdateMode.Append : EnumUpdateMode.Update, checkBoxDeep.Checked ? EnumBuildMode.Depth : EnumBuildMode.Alititude, lineParam); + MessageBox.Show("入库完成!", "提示"); } catch (Exception ex) { @@ -159,13 +164,6 @@ endH.SelectedItem = "终止点高程"; cmbRadius.SelectedItem = "管径"; - for (int i = 0; i < pipelineTypeCbo.Items.Count; i++) - { - if (strLayerName.Contains(pipelineTypeCbo.Items[i].ToString())) - { - pipelineTypeCbo.Text = pipelineTypeCbo.Items[i].ToString(); - } - } } private void comboBoxExLayer_SelectedIndexChanged(object sender, EventArgs e) @@ -173,13 +171,14 @@ if (comboBoxExLayer.SelectedIndex == -1) return; - GSOLayer layer = ctl.Globe.Layers.Add(comboBoxExLayer.Text.ToString()); - txtModelLayer.Text = layer.Caption; + string layerName = Path.GetFileNameWithoutExtension(comboBoxExLayer.Text.ToString()); + GSOLayer layer = ctl.Globe.Layers.GetLayerByCaption(layerName); GSOFeatures features = layer.GetAllFeatures(); if (features.Length == 0) return; clearComboboxParam(); + txtModelLayer.Text = layerName; for (int i = 0; i < features[0].GetFieldCount(); i++) { diff --git a/FrmAddWellShp.cs b/FrmAddWellShp.cs index 9946798..4beb437 100644 --- a/FrmAddWellShp.cs +++ b/FrmAddWellShp.cs @@ -66,13 +66,13 @@ return; try { - ModelBuilder lineBuilder = new LineBuilder(ds); + ModelBuilder pointBuilder = new PointBuilder(ds); - GSOLayer layer = globeControl1.Globe.Layers.GetLayerByCaption(comboBoxLayer.Text); + GSOLayer layer = globeControl1.Globe.Layers.GetLayerByCaption(Path.GetFileNameWithoutExtension(comboBoxLayer.Text.ToString())); PointParam pointParam = new PointParam(); pointParam.layerName = txtLayerName.Text.ToString(); - pointParam.uniqueIdFieldName = combCode.Text.ToString(); + pointParam.uniqueIdFieldName = comboBoxCode.Text.ToString(); pointParam.upGround = Convert.ToDouble(txtUpGround.Text.ToString()); pointParam.attachNameFieldName = combModelName.Text.ToString(); pointParam.pointEncodingFieldName = combCode.Text.ToString(); @@ -80,8 +80,10 @@ pointParam.symbolFiledName = combAngle.Text.ToString(); pointParam.altitudeFieldName = comboBoxGC.Text.ToString(); - lineBuilder.build(layer, checkBoxAdd.Checked ? EnumUpdateMode.Append : EnumUpdateMode.Update, + pointBuilder.build(layer, checkBoxAdd.Checked ? EnumUpdateMode.Append : EnumUpdateMode.Update, checkBoxDeep.Checked ? EnumBuildMode.Depth : EnumBuildMode.Alititude, pointParam); + + MessageBox.Show("入库完成!", "提示"); } catch (Exception ex) { @@ -97,6 +99,7 @@ { //填充SHP数据列表 comboBoxLayer.Items.Clear(); + if (globeControl1 != null) { for (int i = 0; i < globeControl1.Globe.Layers.Count; i++) @@ -118,6 +121,7 @@ private void clearComboboxParam() { txtLayerName.Text = ""; + comboBoxCode.Items.Clear(); combModelName.Items.Clear(); combCode.Items.Clear(); combDeep.Items.Clear(); @@ -127,6 +131,7 @@ private void addComboboxParam(string strParam) { + comboBoxCode.Items.Add(strParam); combModelName.Items.Add(strParam); combCode.Items.Add(strParam); combDeep.Items.Add(strParam); @@ -138,16 +143,16 @@ { if (ExitFiled(feature, "管点编码")) //特征管点 { - combCode.SelectedItem = "编号"; + comboBoxCode.SelectedItem = "编号"; combModelName.SelectedItem = "管点特征"; combCode.SelectedItem = "管点编码"; - combDeep.SelectedItem = "距地面高程"; + combDeep.SelectedItem = "距地面深度"; combAngle.SelectedItem = "符号角度"; comboBoxGC.SelectedItem = "Z坐标"; } else if (ExitFiled(feature, "附属物编码")) //附属物 { - combCode.SelectedItem = "编号"; + comboBoxCode.SelectedItem = "编号"; combModelName.SelectedItem = "附属物名称"; combCode.SelectedItem = "附属物编码"; combDeep.SelectedItem = "井深"; @@ -156,7 +161,7 @@ } else { - combCode.SelectedItem = "编号"; + comboBoxCode.SelectedItem = "编号"; combModelName.Enabled = false; combCode.SelectedItem = "图层编号"; combDeep.SelectedItem = "标识器埋深"; @@ -180,14 +185,16 @@ { if (comboBoxLayer.SelectedIndex == -1) return; + string layerName=Path.GetFileNameWithoutExtension(comboBoxLayer.Text.ToString()); - GSOLayer layer = globeControl1.Globe.Layers.Add(comboBoxLayer.Text.ToString()); + GSOLayer layer = globeControl1.Globe.Layers.GetLayerByCaption(layerName); - txtLayerName.Text = layer.Caption; GSOFeatures features = layer.GetAllFeatures(); if (features.Length == 0) return; + clearComboboxParam(); + txtLayerName.Text = layerName; for (int i = 0; i < features[0].GetFieldCount(); i++) { diff --git a/PointBuilder.cs b/PointBuilder.cs index a83560b..b48cc29 100644 --- a/PointBuilder.cs +++ b/PointBuilder.cs @@ -89,12 +89,14 @@ model.Position = pt; model.Align = EnumEntityAlign.TopCenter; // model.AltitudeMode = (buildMode.Equals(EnumBuildMode.Alititude)) ? EnumAltitudeMode.RelativeToGround : EnumAltitudeMode.Absolute; - model.RotateZ = 0 - (double)f.GetValue(pointParam.symbolFiledName) * 180 / Math.PI + 90; + model.RotateZ = (pointParam.symbolFiledName == "")?0 + :0 - (double)f.GetValue(pointParam.symbolFiledName) * 180 / Math.PI + 90; model.FilePath = getModelPath(f, pointParam); model.Name = f.GetValue(pointParam.uniqueIdFieldName).ToString(); return model; } + private String getModelPath(GSOFeature f, PointParam pointParam) { string feName = f.GetFieldAsString(pointParam.attachNameFieldName); diff --git a/bin/x86/Debug/Cyberpipe.exe b/bin/x86/Debug/Cyberpipe.exe index c55aea6..19fa9e4 100644 --- a/bin/x86/Debug/Cyberpipe.exe +++ b/bin/x86/Debug/Cyberpipe.exe Binary files differ diff --git a/bin/x86/Debug/Cyberpipe.pdb b/bin/x86/Debug/Cyberpipe.pdb index 2fd12e4..ce95ccc 100644 --- a/bin/x86/Debug/Cyberpipe.pdb +++ b/bin/x86/Debug/Cyberpipe.pdb Binary files differ diff --git a/bin/x86/Debug/Cyberpipe.vshost.exe.manifest b/bin/x86/Debug/Cyberpipe.vshost.exe.manifest new file mode 100644 index 0000000..061c9ca --- /dev/null +++ b/bin/x86/Debug/Cyberpipe.vshost.exe.manifest @@ -0,0 +1,11 @@ + + + + + + + + + + + diff --git a/bin/x86/Debug/log.txt b/bin/x86/Debug/log.txt index 07b467c..24a978e 100644 --- a/bin/x86/Debug/log.txt +++ b/bin/x86/Debug/log.txt @@ -196,3 +196,195 @@ exception over ------------------------------------------------------------ + + exception begin -----------------2016/11/3 16:25:04--------------------- + + + + e.Message:未将对象引用设置到对象的实例。 + + e.Source:Cyberpipe + + e.TargetSite:Boolean doBuild(Cyberpipe.EnumUpdateMode, Cyberpipe.EnumBuildMode, Cyberpipe.BaseParam) + + e.StackTrace: 在 Cyberpipe.LineBuilder.doBuild(EnumUpdateMode updateMode, EnumBuildMode buildMode, BaseParam param) 位置 D:\GHFX\GHFX_REFACTOR\LineBuilder.cs:行号 35 + 在 Cyberpipe.ModelBuilder.build(GSOLayer layer, EnumUpdateMode updateMode, EnumBuildMode buildMode, BaseParam param) 位置 D:\GHFX\GHFX_REFACTOR\ModelBuilder.cs:行号 55 + 在 Cyberpipe.FrmAddWellShp.button3_Click(Object sender, EventArgs e) 位置 D:\GHFX\GHFX_REFACTOR\FrmAddWellShp.cs:行号 85 + + + + exception over ------------------------------------------------------------ + + exception begin -----------------2016/11/3 16:25:07--------------------- + + + + e.Message:未将对象引用设置到对象的实例。 + + e.Source:Cyberpipe + + e.TargetSite:Boolean doBuild(Cyberpipe.EnumUpdateMode, Cyberpipe.EnumBuildMode, Cyberpipe.BaseParam) + + e.StackTrace: 在 Cyberpipe.LineBuilder.doBuild(EnumUpdateMode updateMode, EnumBuildMode buildMode, BaseParam param) 位置 D:\GHFX\GHFX_REFACTOR\LineBuilder.cs:行号 35 + 在 Cyberpipe.ModelBuilder.build(GSOLayer layer, EnumUpdateMode updateMode, EnumBuildMode buildMode, BaseParam param) 位置 D:\GHFX\GHFX_REFACTOR\ModelBuilder.cs:行号 55 + 在 Cyberpipe.FrmAddWellShp.button3_Click(Object sender, EventArgs e) 位置 D:\GHFX\GHFX_REFACTOR\FrmAddWellShp.cs:行号 85 + + + + exception over ------------------------------------------------------------ + + exception begin -----------------2016/11/3 17:18:01--------------------- + + + + e.Message:未将对象引用设置到对象的实例。 + + e.Source:Cyberpipe + + e.TargetSite:Boolean doBuild(Cyberpipe.EnumUpdateMode, Cyberpipe.EnumBuildMode, Cyberpipe.BaseParam) + + e.StackTrace: 在 Cyberpipe.LineBuilder.doBuild(EnumUpdateMode updateMode, EnumBuildMode buildMode, BaseParam param) 位置 D:\GHFX\GHFX_REFACTOR\LineBuilder.cs:行号 35 + 在 Cyberpipe.ModelBuilder.build(GSOLayer layer, EnumUpdateMode updateMode, EnumBuildMode buildMode, BaseParam param) 位置 D:\GHFX\GHFX_REFACTOR\ModelBuilder.cs:行号 55 + 在 Cyberpipe.FrmAddWellShp.button3_Click(Object sender, EventArgs e) 位置 D:\GHFX\GHFX_REFACTOR\FrmAddWellShp.cs:行号 83 + + + + exception over ------------------------------------------------------------ + + exception begin -----------------2016/11/4 9:03:20--------------------- + + + + e.Message:外部组件发生异常。 + + e.Source:GSGlobeDotNet + + e.TargetSite:Void std._Xout_of_range(SByte*) + + e.StackTrace: 在 std._Xout_of_range(SByte* ) + 在 GSC.GSArray.GetAt(GSArray* , GSFieldDef* , Int32 nIndex) + 在 GeoScene.Data.GSOFeature.GetValue(Int32 nIndex) + 在 GeoScene.Data.GSOFeature.GetValue(String strFieldName) + 在 Cyberpipe.PointBuilder.createModel(GSOFeature f, PointParam pointParam, EnumBuildMode buildMode) 位置 D:\GHFX\GHFX_REFACTOR\PointBuilder.cs:行号 92 + 在 Cyberpipe.PointBuilder.doBuild(EnumUpdateMode updateMode, EnumBuildMode buildMode, BaseParam param) 位置 D:\GHFX\GHFX_REFACTOR\PointBuilder.cs:行号 56 + 在 Cyberpipe.ModelBuilder.build(GSOLayer layer, EnumUpdateMode updateMode, EnumBuildMode buildMode, BaseParam param) 位置 D:\GHFX\GHFX_REFACTOR\ModelBuilder.cs:行号 55 + 在 Cyberpipe.FrmAddWellShp.button3_Click(Object sender, EventArgs e) 位置 D:\GHFX\GHFX_REFACTOR\FrmAddWellShp.cs:行号 83 + + + + exception over ------------------------------------------------------------ + + exception begin -----------------2016/11/4 9:03:23--------------------- + + + + e.Message:外部组件发生异常。 + + e.Source:GSGlobeDotNet + + e.TargetSite:Void std._Xout_of_range(SByte*) + + e.StackTrace: 在 std._Xout_of_range(SByte* ) + 在 GSC.GSArray.GetAt(GSArray* , GSFieldDef* , Int32 nIndex) + 在 GeoScene.Data.GSOFeature.GetValue(Int32 nIndex) + 在 GeoScene.Data.GSOFeature.GetValue(String strFieldName) + 在 Cyberpipe.PointBuilder.createModel(GSOFeature f, PointParam pointParam, EnumBuildMode buildMode) 位置 D:\GHFX\GHFX_REFACTOR\PointBuilder.cs:行号 92 + 在 Cyberpipe.PointBuilder.doBuild(EnumUpdateMode updateMode, EnumBuildMode buildMode, BaseParam param) 位置 D:\GHFX\GHFX_REFACTOR\PointBuilder.cs:行号 56 + 在 Cyberpipe.ModelBuilder.build(GSOLayer layer, EnumUpdateMode updateMode, EnumBuildMode buildMode, BaseParam param) 位置 D:\GHFX\GHFX_REFACTOR\ModelBuilder.cs:行号 55 + 在 Cyberpipe.FrmAddWellShp.button3_Click(Object sender, EventArgs e) 位置 D:\GHFX\GHFX_REFACTOR\FrmAddWellShp.cs:行号 83 + + + + exception over ------------------------------------------------------------ + + exception begin -----------------2016/11/4 9:07:55--------------------- + + + + e.Message:外部组件发生异常。 + + e.Source:GSGlobeDotNet + + e.TargetSite:Void std._Xout_of_range(SByte*) + + e.StackTrace: 在 std._Xout_of_range(SByte* ) + 在 GSC.GSArray.GetAt(GSArray* , GSFieldDef* , Int32 nIndex) + 在 GeoScene.Data.GSOFeature.GetValue(Int32 nIndex) + 在 GeoScene.Data.GSOFeature.GetValue(String strFieldName) + 在 Cyberpipe.PointBuilder.createModel(GSOFeature f, PointParam pointParam, EnumBuildMode buildMode) 位置 D:\GHFX\GHFX_REFACTOR\PointBuilder.cs:行号 92 + 在 Cyberpipe.PointBuilder.doBuild(EnumUpdateMode updateMode, EnumBuildMode buildMode, BaseParam param) 位置 D:\GHFX\GHFX_REFACTOR\PointBuilder.cs:行号 56 + 在 Cyberpipe.ModelBuilder.build(GSOLayer layer, EnumUpdateMode updateMode, EnumBuildMode buildMode, BaseParam param) 位置 D:\GHFX\GHFX_REFACTOR\ModelBuilder.cs:行号 55 + 在 Cyberpipe.FrmAddWellShp.button3_Click(Object sender, EventArgs e) 位置 D:\GHFX\GHFX_REFACTOR\FrmAddWellShp.cs:行号 83 + + + + exception over ------------------------------------------------------------ + + exception begin -----------------2016/11/4 9:15:31--------------------- + + + + e.Message:外部组件发生异常。 + + e.Source:GSGlobeDotNet + + e.TargetSite:Void std._Xout_of_range(SByte*) + + e.StackTrace: 在 std._Xout_of_range(SByte* ) + 在 GSC.GSArray.GetAt(GSArray* , GSFieldDef* , Int32 nIndex) + 在 GeoScene.Data.GSOFeature.GetValue(Int32 nIndex) + 在 GeoScene.Data.GSOFeature.GetValue(String strFieldName) + 在 Cyberpipe.PointBuilder.createModel(GSOFeature f, PointParam pointParam, EnumBuildMode buildMode) 位置 D:\GHFX\GHFX_REFACTOR\PointBuilder.cs:行号 92 + 在 Cyberpipe.PointBuilder.doBuild(EnumUpdateMode updateMode, EnumBuildMode buildMode, BaseParam param) 位置 D:\GHFX\GHFX_REFACTOR\PointBuilder.cs:行号 56 + 在 Cyberpipe.ModelBuilder.build(GSOLayer layer, EnumUpdateMode updateMode, EnumBuildMode buildMode, BaseParam param) 位置 D:\GHFX\GHFX_REFACTOR\ModelBuilder.cs:行号 55 + 在 Cyberpipe.FrmAddWellShp.button3_Click(Object sender, EventArgs e) 位置 D:\GHFX\GHFX_REFACTOR\FrmAddWellShp.cs:行号 83 + + + + exception over ------------------------------------------------------------ + + exception begin -----------------2016/11/4 9:17:26--------------------- + + + + e.Message:外部组件发生异常。 + + e.Source:GSGlobeDotNet + + e.TargetSite:Void std._Xout_of_range(SByte*) + + e.StackTrace: 在 std._Xout_of_range(SByte* ) + 在 GSC.GSArray.GetAt(GSArray* , GSFieldDef* , Int32 nIndex) + 在 GeoScene.Data.GSOFeature.GetValue(Int32 nIndex) + 在 GeoScene.Data.GSOFeature.GetValue(String strFieldName) + 在 Cyberpipe.PointBuilder.createModel(GSOFeature f, PointParam pointParam, EnumBuildMode buildMode) 位置 D:\GHFX\GHFX_REFACTOR\PointBuilder.cs:行号 92 + 在 Cyberpipe.PointBuilder.doBuild(EnumUpdateMode updateMode, EnumBuildMode buildMode, BaseParam param) 位置 D:\GHFX\GHFX_REFACTOR\PointBuilder.cs:行号 56 + 在 Cyberpipe.ModelBuilder.build(GSOLayer layer, EnumUpdateMode updateMode, EnumBuildMode buildMode, BaseParam param) 位置 D:\GHFX\GHFX_REFACTOR\ModelBuilder.cs:行号 55 + 在 Cyberpipe.FrmAddWellShp.button3_Click(Object sender, EventArgs e) 位置 D:\GHFX\GHFX_REFACTOR\FrmAddWellShp.cs:行号 83 + + + + exception over ------------------------------------------------------------ + + exception begin -----------------2016/11/4 9:17:56--------------------- + + + + e.Message:外部组件发生异常。 + + e.Source:GSGlobeDotNet + + e.TargetSite:Void std._Xout_of_range(SByte*) + + e.StackTrace: 在 std._Xout_of_range(SByte* ) + 在 GSC.GSArray.GetAt(GSArray* , GSFieldDef* , Int32 nIndex) + 在 GeoScene.Data.GSOFeature.GetValue(Int32 nIndex) + 在 GeoScene.Data.GSOFeature.GetValue(String strFieldName) + 在 Cyberpipe.PointBuilder.createModel(GSOFeature f, PointParam pointParam, EnumBuildMode buildMode) 位置 D:\GHFX\GHFX_REFACTOR\PointBuilder.cs:行号 92 + 在 Cyberpipe.PointBuilder.doBuild(EnumUpdateMode updateMode, EnumBuildMode buildMode, BaseParam param) 位置 D:\GHFX\GHFX_REFACTOR\PointBuilder.cs:行号 56 + 在 Cyberpipe.ModelBuilder.build(GSOLayer layer, EnumUpdateMode updateMode, EnumBuildMode buildMode, BaseParam param) 位置 D:\GHFX\GHFX_REFACTOR\ModelBuilder.cs:行号 55 + 在 Cyberpipe.FrmAddWellShp.button3_Click(Object sender, EventArgs e) 位置 D:\GHFX\GHFX_REFACTOR\FrmAddWellShp.cs:行号 83 + + + + exception over ------------------------------------------------------------