public override void Init() { try { base.Init(); FacilityClass fac = this._facClassReg.FacilityType; if (fac == null) { return; } DFDataConfig.Class.FieldInfo fi = fac.GetFieldInfoBySystemName("Height"); if (fi != null) { int index = this._rowInfo.FieldIndex(fi.Name); if (index != -1) { this._height = Fac.GetDouble(this._rowInfo, index); } } fi = fac.GetFieldInfoBySystemName("SurfHeight"); if (fi != null) { int index = this._rowInfo.FieldIndex(fi.Name); if (index != -1) { this._surfH = Fac.GetDouble(this._rowInfo, index); } } bool bHaveTopHeight = false; fi = fac.GetFieldInfoBySystemName("TopHeight"); if (fi != null) { int index = this._rowInfo.FieldIndex(fi.Name); if (index != -1) { this._topH = Fac.GetDouble(this._rowInfo, index); bHaveTopHeight = true; } } bool bHaveBottomHeight = false; fi = fac.GetFieldInfoBySystemName("BottomHeight"); if (fi != null) { int index = this._rowInfo.FieldIndex(fi.Name); if (index != -1) { this._bottomH = Fac.GetDouble(this._rowInfo, index); bHaveBottomHeight = true; } } if (!bHaveTopHeight && bHaveBottomHeight) { this._topH = this.SurfH; } fi = fac.GetFieldInfoBySystemName("Direction"); if (fi != null) { int index = this._rowInfo.FieldIndex(fi.Name); if (index != -1) { this._angleZ = Fac.GetDouble(this._rowInfo, index); } } fi = fac.GetFieldInfoBySystemName("Additional"); if (fi != null) { int index = this._rowInfo.FieldIndex(fi.Name); if (index != -1) { this._fusu = Fac.GetString(this._rowInfo, index); } } fi = fac.GetFieldInfoBySystemName("Pitch"); if (fi != null) { int index = this._rowInfo.FieldIndex(fi.Name); if (index != -1) { this._pitch = Fac.GetDouble(this._rowInfo, index); } } fi = fac.GetFieldInfoBySystemName("Yaw"); if (fi != null) { int index = this._rowInfo.FieldIndex(fi.Name); if (index != -1) { this._yaw = Fac.GetDouble(this._rowInfo, index); } } if (this._style != null) { if (this._style.Name.Contains("井") || this._style.Name.Contains("篦")) { this._IsWell = true; this._IsValve = false; // 重新设置模型点Z坐标 if (base._geoGroup[1] != null && (base._geoGroup[1] as IPoint) != null) { IPoint pointValue = base._geoGroup[1] as IPoint; if (this._topH != null && this._bottomH != null) { pointValue.Z = (this._topH + this._bottomH) / 2.0; } base._geoGroup[1] = pointValue; base.SetValue("Shape", base._geoGroup[1]); } } if (!this._IsWell && this._style.Name.Contains("阀")) { this._IsValve = true; this._IsWell = false; } } } catch (Exception ex) { } }
public override void Init() { try { base.Init(); FacilityClass fac = this._facClassReg.FacilityType; if (fac == null) { return; } DFDataConfig.Class.FieldInfo fi = null; bool bHaveTopHeight = false; bool bHaveBottomHeight = false; fi = fac.GetFieldInfoBySystemName("TopHeight"); if (fi != null) { int index = this._rowInfo.FieldIndex(fi.Name); if (index != -1) { this._topHeight = Fac.GetDouble(this._rowInfo, index); bHaveTopHeight = true; } } fi = fac.GetFieldInfoBySystemName("BottomHeight"); if (fi != null) { int index = this._rowInfo.FieldIndex(fi.Name); if (index != -1) { this._bottomHeight = Fac.GetDouble(this._rowInfo, index); bHaveBottomHeight = true; } } if (!(bHaveBottomHeight && bHaveTopHeight)) { bool bHaveSurfHeight = false; bool bHaveTopDepth = false; bool bHaveBottomDepth = false; fi = fac.GetFieldInfoBySystemName("SurfHeight"); if (fi != null) { int index = this._rowInfo.FieldIndex(fi.Name); if (index != -1) { this._surfH = Fac.GetDouble(this._rowInfo, index); bHaveSurfHeight = true; } } if (bHaveSurfHeight) { fi = fac.GetFieldInfoBySystemName("TopDepth"); if (fi != null) { int index = this._rowInfo.FieldIndex(fi.Name); if (index != -1) { this._topDeep = Fac.GetDouble(this._rowInfo, index); bHaveTopDepth = true; this._topHeight = this._surfH - this._topDeep; } else { this._topHeight = 0.0; } } else { this._topHeight = 0.0; } fi = fac.GetFieldInfoBySystemName("BottomDepth"); if (fi != null) { int index = this._rowInfo.FieldIndex(fi.Name); if (index != -1) { this._bottomDeep = Fac.GetDouble(this._rowInfo, index); bHaveBottomDepth = true; this._bottomHeight = this._surfH - this._bottomDeep; } else { this._bottomHeight = 0.0; } } else { this._bottomHeight = 0.0; } } else { this._topHeight = 0.0; this._bottomHeight = 0.0; } } } catch (Exception ex) { } }
public override void Init() { try { base.Init(); FacilityClass fac = this._facClassReg.FacilityType; if (fac == null) { return; } #region 设置管径 bool bHaveDia1 = false; bool bHaveDia2 = false; bool bHaveDia = false; DFDataConfig.Class.FieldInfo fiDiameter1 = fac.GetFieldInfoBySystemName("Diameter1"); if (fiDiameter1 != null) { int indexDiameter1 = this._rowInfo.FieldIndex(fiDiameter1.Name); if (indexDiameter1 != -1) { string diaInfo1 = ""; if (!this._rowInfo.IsNull(indexDiameter1) && !string.IsNullOrEmpty(diaInfo1 = this._rowInfo.GetValue(indexDiameter1).ToString())) { this._dia1 = double.Parse(diaInfo1) * 0.001; bHaveDia1 = true; } } } DFDataConfig.Class.FieldInfo fiDiameter2 = fac.GetFieldInfoBySystemName("Diameter2"); if (fiDiameter2 != null) { int indexDiameter2 = this._rowInfo.FieldIndex(fiDiameter2.Name); if (indexDiameter2 != -1) { string diaInfo2 = ""; if (!this._rowInfo.IsNull(indexDiameter2) && !string.IsNullOrEmpty(diaInfo2 = this._rowInfo.GetValue(indexDiameter2).ToString())) { this._dia2 = double.Parse(diaInfo2) * 0.001; bHaveDia2 = true; } } } if (bHaveDia1 && bHaveDia2) { bHaveDia = true; } else { DFDataConfig.Class.FieldInfo fiDiameter = fac.GetFieldInfoBySystemName("Diameter"); if (fiDiameter != null) { int indexDiameter = this._rowInfo.FieldIndex(fiDiameter.Name); if (indexDiameter != -1) { string diaInfo = ""; string coverstyle = ""; if (!this._rowInfo.IsNull(indexDiameter) && !string.IsNullOrEmpty(diaInfo = this._rowInfo.GetValue(indexDiameter).ToString())) { DFDataConfig.Class.FieldInfo fiCoverStyle = fac.GetFieldInfoBySystemName("CoverStyle"); if (fiCoverStyle != null) { int indexCoverStyle = this._rowInfo.FieldIndex(fiCoverStyle.Name); if (indexCoverStyle != -1 && !this._rowInfo.IsNull(indexCoverStyle)) { coverstyle = this._rowInfo.GetValue(indexCoverStyle).ToString(); } } SplitDiameter(diaInfo, coverstyle, out this._dia1, out this._dia2); if (this._rowInfo.FieldIndex(fiDiameter.Name + "1") != -1) { this._rowInfo.SetValue(this._rowInfo.FieldIndex(fiDiameter.Name + "1"), this._dia1); } if (this._rowInfo.FieldIndex(fiDiameter.Name + "2") != -1) { this._rowInfo.SetValue(this._rowInfo.FieldIndex(fiDiameter.Name + "2"), this._dia1); } bHaveDia = true; this._dia1 *= 0.001; this._dia2 *= 0.001; } } } } if (!bHaveDia || (this._dia1 < 0.000001 && this._dia2 < 0.000001)) { this._dia1 = 0.05; this._dia2 = 0.0; } this._segtype = GetSegType(this._dia1, this._dia2); #endregion // 设置管线对象二维Shape数据-顶点坐标\高程信息 IPolyline route = null; if ((this._style != null) && (this._style is PipeLineStyleClass)) { PipeLineStyleClass style = this._style as PipeLineStyleClass; switch (style.HeightParam) { case HeightParam.PipeHeight: DFDataConfig.Class.FieldInfo fiStartHeight = fac.GetFieldInfoBySystemName("StartHeight"); if (fiStartHeight != null) { int indexStartHeight = this._rowInfo.FieldIndex(fiStartHeight.Name); if (indexStartHeight != -1) { this._sheight = Fac.GetDouble(base._rowInfo, indexStartHeight); if (double.IsNaN(this._sheight)) { this._sheight = 0.0; } } } DFDataConfig.Class.FieldInfo fiEndHeight = fac.GetFieldInfoBySystemName("EndHeight"); if (fiEndHeight != null) { int indexEndHeight = this._rowInfo.FieldIndex(fiEndHeight.Name); if (indexEndHeight != -1) { this._eheight = Fac.GetDouble(base._rowInfo, indexEndHeight); } if (double.IsNaN(this._eheight)) { this._eheight = 0.0; } } // 根据管线起始点高程计算中间点高程,并替换设施对象中Shape二维数据 if (this.GetPipeLineVertexs(base._geoGroup[2], this._sheight, this._eheight, out route)) { base._geoGroup[1] = route; base.SetValue("Shape", base._geoGroup[1]); } break; case HeightParam.LineSurfH2Deep: DFDataConfig.Class.FieldInfo fiStartSurfHeight = fac.GetFieldInfoBySystemName("StartSurfHeight"); if (fiStartSurfHeight != null) { int indexStartSurfHeight = this._rowInfo.FieldIndex(fiStartSurfHeight.Name); if (indexStartSurfHeight != -1) { this._ssurfh = Fac.GetDouble(base._rowInfo, indexStartSurfHeight); if (double.IsNaN(this._ssurfh)) { this._ssurfh = 0.0; } } } DFDataConfig.Class.FieldInfo fiStartDepth = fac.GetFieldInfoBySystemName("StartDepth"); if (fiStartDepth != null) { int indexStartDepth = this._rowInfo.FieldIndex(fiStartDepth.Name); if (indexStartDepth != -1) { this._sdeep = Fac.GetDouble(base._rowInfo, indexStartDepth); if (double.IsNaN(this._sdeep)) { this._sdeep = 0.0; } } } DFDataConfig.Class.FieldInfo fiEndSurfHeight = fac.GetFieldInfoBySystemName("EndSurfHeight"); if (fiEndSurfHeight != null) { int indexEndSurfHeight = this._rowInfo.FieldIndex(fiEndSurfHeight.Name); if (indexEndSurfHeight != -1) { this._esurfh = Fac.GetDouble(base._rowInfo, indexEndSurfHeight); if (double.IsNaN(this._esurfh)) { this._esurfh = 0.0; } } } DFDataConfig.Class.FieldInfo fiEndDepth = fac.GetFieldInfoBySystemName("EndDepth"); if (fiEndDepth != null) { int indexEndDepth = this._rowInfo.FieldIndex(fiEndDepth.Name); if (indexEndDepth != -1) { this._edeep = Fac.GetDouble(base._rowInfo, indexEndDepth); if (double.IsNaN(this._edeep)) { this._edeep = 0.0; } } } this._sheight = this._ssurfh - this._sdeep; this._eheight = this._esurfh - this._edeep; // 根据管线起始点高程计算中间点高程,并替换设施对象中Shape二维数据 if (this.GetPipeLineVertexs(base._geoGroup[2], this._sheight, this._eheight, out route)) { base._geoGroup[1] = route; base.SetValue("Shape", base._geoGroup[1]); } break; case HeightParam.PipeVertexHeight: this.GetPipeLineVertexs(base._geoGroup[1], out route); this._sheight = double.IsNaN(route.StartPoint.Z) ? 0.0 : route.StartPoint.Z; this._eheight = double.IsNaN(route.EndPoint.Z) ? 0.0 : route.EndPoint.Z; // 替换设施对象中缓存行\Shape二维数据 base._geoGroup[1] = route; base.SetValue("Shape", route); break; case HeightParam.Unkown: this._sheight = double.IsNaN(route.StartPoint.Z) ? 0.0 : route.StartPoint.Z; this._eheight = double.IsNaN(route.EndPoint.Z) ? 0.0 : route.EndPoint.Z; this.SimplifyPolyline(base._geoGroup[1], out route); // 替换设施对象中缓存行\Shape二维数据 base._geoGroup[1] = route; base.SetValue("Shape", route); break; } switch (style.HeightMode) { case HeightMode.Top: this._vPos = VerticalPos.Top; break; case HeightMode.Bottom: this._vPos = VerticalPos.Bottom; break; default: this._vPos = VerticalPos.Center; break; } // 重新设置高程选项,针对同类管线中高程设置不一致的情况 DFDataConfig.Class.FieldInfo fiHLB = fac.GetFieldInfoBySystemName("HLB"); if (fiHLB != null) { int indexHLB = this._rowInfo.FieldIndex(fiHLB.Name); if (indexHLB != -1) { string hlb = base._rowInfo.GetValue(indexHLB).ToString(); if (hlb.Contains("内")) { this._vPos = VerticalPos.Bottom; } else if (hlb.Contains("外")) { this._vPos = VerticalPos.Top; } else { this._vPos = VerticalPos.Center; } } } } } catch (Exception exception) { } }