Exemplo n.º 1
0
        public void RefreshResultGrid(DataGridView dgv)
        {
            int count = this.m_arrDstPipeline.Count;

            dgv.Rows.Clear();
            for (int i = 0; i < count; i++)
            {
                DstLineItem item = (DstLineItem)this.m_arrDstPipeline[i];
                dgv.Rows.Add(new object[] { "" });
                dgv[0, i].Value = i + 1;
                dgv[1, i].Value = item.m_strLayerName;
                dgv[2, i].Value = item.m_nFID;
                DataGridViewCellStyle dataGridViewCellStyle = new DataGridViewCellStyle()
                {
                    BackColor = Color.Red
                };
                if (this.m_nAnalyseType == DistAnalyseType.emHrzDist)
                {
                    dgv[3, i].Value = item.m_dResultDistH;
                    dgv[4, i].Value = item.m_dTolDistH;
                    if ((item.m_dTolDistH == -1f ? false : item.m_dResultDistH < item.m_dTolDistH))
                    {
                        dgv[3, i].Style = dataGridViewCellStyle;
                    }
                }
                if (this.m_nAnalyseType == DistAnalyseType.emVerDist)
                {
                    dgv[3, i].Value = item.m_dResultDistV;
                    dgv[4, i].Value = item.m_dTolDistV;
                    if ((item.m_dTolDistV == -1f ? false : item.m_dResultDistV < item.m_dTolDistV))
                    {
                        dgv[3, i].Style = dataGridViewCellStyle;
                    }
                }
                if (this.m_nAnalyseType == DistAnalyseType.emHitDist)
                {
                    dgv[3, i].Value = item.m_dResultDistH;
                    dgv[4, i].Value = item.m_dTolDistH;
                    dgv[5, i].Value = item.m_dResultDistV;
                    dgv[6, i].Value = item.m_dTolDistV;
                    dgv[7, i].Value = item.m_strPipeWidthAndHeight;
                    if ((item.m_dTolDistH == -1f ? false : item.m_dResultDistH < item.m_dTolDistH))
                    {
                        dgv[3, i].Style = dataGridViewCellStyle;
                    }
                    if ((item.m_dTolDistV == -1f ? false : item.m_dResultDistV < item.m_dTolDistV))
                    {
                        dgv[5, i].Style = dataGridViewCellStyle;
                    }
                }
            }
        }
Exemplo n.º 2
0
        public IPolyline GetFlashDstItem(int nFID)
        {
            IPolyline polyline;

            if (this.m_arrDstPipeline.Count != 0)
            {
                int       count      = this.m_arrDstPipeline.Count;
                IPolyline mPPolyline = null;
                int       num        = 0;
                while (true)
                {
                    if (num < count)
                    {
                        DstLineItem item = (DstLineItem)this.m_arrDstPipeline[num];
                        if (Convert.ToInt32(item.m_nFID) == nFID)
                        {
                            mPPolyline = item.m_pPolyline;
                            break;
                        }
                        else
                        {
                            num++;
                        }
                    }
                    else
                    {
                        break;
                    }
                }
                polyline = mPPolyline;
            }
            else
            {
                polyline = null;
            }
            return(polyline);
        }
Exemplo n.º 3
0
        private void method_7(ILayer layer)
        {
            string str;
            string str1;
            string str2;

            if (layer is IFeatureLayer)
            {
                IFeatureLayer featureLayer = layer as IFeatureLayer;
                if (featureLayer.Visible)
                {
                    IGeometry      geometry           = ((ITopologicalOperator)this.m_pBaseLine).Buffer(this.m_dBufferRadius);
                    ISpatialFilter spatialFilterClass = new SpatialFilter();
                    spatialFilterClass.Geometry   = (geometry);
                    spatialFilterClass.SpatialRel = (esriSpatialRelEnum)(1);
                    IFeatureClass   featureClass = featureLayer.FeatureClass;
                    IBasicLayerInfo lineConfig   = PipeConfig.GetBasicLayerInfo(featureClass.AliasName) as IBasicLayerInfo;
                    if (lineConfig != null)
                    {
                        IFeatureCursor featureCursor = featureClass.Search(spatialFilterClass, false);
                        IFeature       feature       = featureCursor.NextFeature();
                        while (feature != null)
                        {
                            if ((!feature.HasOID || feature == null ? false : feature.FeatureType == (esriFeatureType)8))
                            {
                                IGeometry shape = feature.Shape;
                                int       num   =
                                    feature.Fields.FindField(lineConfig.GetFieldName(PipeConfigWordHelper.LineWords.GJ));
                                str = (num == -1 ? "" : feature.get_Value(num).ToString());
                                num =
                                    feature.Fields.FindField(lineConfig.GetFieldName(PipeConfigWordHelper.LineWords.DMCC));
                                str1 = (num == -1 ? "" : feature.get_Value(num).ToString());
                                string str3 = "";
                                if (str != "")
                                {
                                    str3 = str;
                                }
                                if (str1 != "")
                                {
                                    str3 = str1;
                                }
                                this.m_dDiameterDst = this.GetDiameterFromString(str3.Trim());
                                if (shape.GeometryType == esriGeometryType.esriGeometryPolyline)
                                {
                                    double num1 = ((IProximityOperator)this.m_pBaseLine).ReturnDistance(shape);
                                    if (num1 > 1E-07)
                                    {
                                        num1 =
                                            Math.Abs(num1 - 0.0005 * (double)this.m_dDiameter -
                                                     0.0005 * (double)this.m_dDiameterDst);
                                    }
                                    if (!(this.m_nAnalyseType != DistAnalyseType.emHrzDist ? true : num1 >= 1E-08))
                                    {
                                        feature = featureCursor.NextFeature();
                                    }
                                    else if ((this.m_nAnalyseType != DistAnalyseType.emVerDist ? true : num1 <= 1E-08))
                                    {
                                        double num2 = 0;
                                        //this.m_nHeightFlagBase = this.PipeConfig.getLineConfig_HeightFlag(this.m_strLayerName);
                                        //this.m_nHeightFlagDst = this.PipeConfig.getLineConfig_HeightFlag(feature.Class.AliasName);

                                        this.m_nHeightFlagBase = (int)lineConfig.HeightType;
                                        this.m_nHeightFlagDst  = (int)lineConfig.HeightType;
                                        if ((this.m_nAnalyseType == DistAnalyseType.emVerDist
                                            ? true
                                            : this.m_nAnalyseType == DistAnalyseType.emHitDist))
                                        {
                                            num2 = (num1 >= 1E-07
                                                ? this.method_3(this.m_pBaseLine, (IPolyline)shape)
                                                : this.method_2(this.m_pBaseLine, (IPolyline)shape));
                                        }
                                        if (feature.FeatureType == (esriFeatureType)8)
                                        {
                                            IEdgeFeature edgeFeature = (IEdgeFeature)feature;
                                            if (edgeFeature != null)
                                            {
                                                int    fromJunctionEID = edgeFeature.FromJunctionEID;
                                                int    toJunctionEID   = edgeFeature.ToJunctionEID;
                                                string str4            =
                                                    lineConfig.GetFieldName(PipeConfigWordHelper.LineWords.GDXZ);
                                                string str5 = "";
                                                int    num3 = feature.Fields.FindField(str4);
                                                if (num3 != -1)
                                                {
                                                    object value = feature.get_Value(num3);
                                                    str5 = ((value == null ? false : !Convert.IsDBNull(value))
                                                        ? value.ToString()
                                                        : "");
                                                }
                                                // int num4 = feature.Fields.FindField("埋设方式");
                                                int num4 =
                                                    feature.Fields.FindField(
                                                        lineConfig.GetFieldName(PipeConfigWordHelper.LineWords.MSFS));
                                                str2 = (num4 == -1 ? "" : this.method_6(feature.get_Value(num4)));
                                                if (this.method_1(this.m_nBaseLineFromID, this.m_nBaseLineToID,
                                                                  fromJunctionEID, toJunctionEID))
                                                {
                                                    DstLineItem dstLineItem = new DstLineItem()
                                                    {
                                                        m_pPolyline    = CommonUtils.GetPolylineDeepCopy((IPolyline)shape),
                                                        m_strLayerName = str5,
                                                        m_nFID         = (int)feature.get_Value(0)
                                                    };
                                                    if (num1 <= 1E-07)
                                                    {
                                                        dstLineItem.m_dResultDistH = 0f;
                                                    }
                                                    else
                                                    {
                                                        float single =
                                                            Math.Abs((float)num1 - (float)this.m_dDiameter / 2000f);
                                                        dstLineItem.m_dResultDistH =
                                                            CommonUtils.GetFloatThreePoint(single);
                                                    }
                                                    if (num2 <= 1E-07)
                                                    {
                                                        dstLineItem.m_dResultDistV = 0f;
                                                    }
                                                    else
                                                    {
                                                        float single1 = Math.Abs((float)num2);
                                                        dstLineItem.m_dResultDistV =
                                                            CommonUtils.GetFloatThreePoint(single1);
                                                    }
                                                    dstLineItem.m_nDstLineFromID = fromJunctionEID;
                                                    dstLineItem.m_nDstLineToID   = toJunctionEID;
                                                    dstLineItem.m_dPipeWidth     = 0;
                                                    dstLineItem.m_dPipeHeight    = 0;
                                                    if (str != "")
                                                    {
                                                        dstLineItem.m_strPipeWidthAndHeight = str3;
                                                    }
                                                    if (str1 != "")
                                                    {
                                                        dstLineItem.m_strPipeWidthAndHeight = str3;
                                                    }
                                                    if (!this.HighOpAnother(this.m_pBaseLine, dstLineItem.m_pPolyline))
                                                    {
                                                        dstLineItem.m_dTolDistH =
                                                            CommonUtils.GetPipeLineAlarmHrzDistByFeatureClassName2(
                                                                ipipeConfig_0,
                                                                CommonUtils.GetSmpClassName(feature.Class.AliasName),
                                                                CommonUtils.GetSmpClassName(this.m_strLayerName),
                                                                feature, this.m_pFeature);
                                                        dstLineItem.m_dTolDistV =
                                                            CommonUtils.GetPipeLineAlarmVerDistByFeatureClassName(
                                                                ipipeConfig_0,
                                                                CommonUtils.GetSmpClassName(feature.Class.AliasName),
                                                                CommonUtils.GetSmpClassName(this.m_strLayerName), str2,
                                                                this.m_strBuryKind);
                                                    }
                                                    else
                                                    {
                                                        dstLineItem.m_dTolDistH =
                                                            CommonUtils.GetPipeLineAlarmHrzDistByFeatureClassName2(
                                                                ipipeConfig_0,
                                                                CommonUtils.GetSmpClassName(this.m_strLayerName),
                                                                CommonUtils.GetSmpClassName(feature.Class.AliasName),
                                                                this.m_pFeature, feature);
                                                        dstLineItem.m_dTolDistV =
                                                            CommonUtils.GetPipeLineAlarmVerDistByFeatureClassName(
                                                                ipipeConfig_0,
                                                                CommonUtils.GetSmpClassName(this.m_strLayerName),
                                                                CommonUtils.GetSmpClassName(feature.Class.AliasName),
                                                                this.m_strBuryKind, str2);
                                                    }
                                                    this.m_arrDstPipeline.Add(dstLineItem);
                                                }
                                                feature = featureCursor.NextFeature();
                                            }
                                            else
                                            {
                                                feature = featureCursor.NextFeature();
                                            }
                                        }
                                        else
                                        {
                                            feature = featureCursor.NextFeature();
                                        }
                                    }
                                    else
                                    {
                                        feature = featureCursor.NextFeature();
                                    }
                                }
                                else
                                {
                                    feature = featureCursor.NextFeature();
                                }
                            }
                            else
                            {
                                feature = featureCursor.NextFeature();
                            }
                        }
                    }
                }
            }
        }