Ejemplo n.º 1
0
        /// <summary>
        ///     根据井筒绑定ID删除井筒图元
        /// </summary>
        /// <params name="sPitshaftBIDArray">要删除井筒的绑定ID</params>
        private void DeleteJintTongByBID(string[] sPitshaftBIDArray)
        {
            if (sPitshaftBIDArray.Length == 0)
            {
                return;
            }

            //1.获得当前编辑图层
            var drawspecial     = new DrawSpecialCommon();
            var sLayerAliasName = LayerNames.DEFALUT_JINGTONG; //“井筒”图层
            var featureLayer    = drawspecial.GetFeatureLayerByName(sLayerAliasName);

            if (featureLayer == null)
            {
                MessageBox.Show("未找到" + sLayerAliasName + "图层,无法删除井筒图元。");
                return;
            }

            //2.删除井筒图元
            var sPitshaftBID = "";

            for (var i = 0; i < sPitshaftBIDArray.Length; i++)
            {
                sPitshaftBID = sPitshaftBIDArray[i];

                DataEditCommon.DeleteFeatureByBId(featureLayer, sPitshaftBID);
            }
        }
Ejemplo n.º 2
0
        /// <summary>
        ///     获取停采线图层
        /// </summary>
        /// <returns>矢量图层</returns>
        private IFeatureLayer GetStopLineFeatureLayer()
        {
            //找到图层
            const string layerName      = LayerNames.STOP_LINE; //“停采线”图层
            var          drawSpecialCom = new DrawSpecialCommon();
            var          featureLayer   = drawSpecialCom.GetFeatureLayerByName(layerName);

            return(featureLayer);
        }
Ejemplo n.º 3
0
        /// <summary>
        ///     删除陷落柱图元
        /// </summary>
        /// <params name="sCollapseId"></params>
        private void DeleteyXLZ(string sCollapseId)
        {
            //1.获得当前编辑图层
            var          drawspecial     = new DrawSpecialCommon();
            const string sLayerAliasName = LayerNames.LAYER_ALIAS_MR_XianLuoZhu1; //“陷落柱_1”图层
            var          featureLayer    = drawspecial.GetFeatureLayerByName(sLayerAliasName);

            if (featureLayer == null)
            {
                MessageBox.Show(@"未找到" + sLayerAliasName + @"图层,无法删除陷落柱图元。");
                return;
            }

            //2.删除原来图元,重新绘制新图元
            DataEditCommon.DeleteFeatureByBId(featureLayer, sCollapseId);
        }
Ejemplo n.º 4
0
        /// <summary>
        ///     修改揭露断层图元
        /// </summary>
        /// <params name="faultageEntity"></params>
        private void ModifyJldc(Faultage faultageEntity)
        {
            //1.获得当前编辑图层
            var          drawspecial     = new DrawSpecialCommon();
            const string sLayerAliasName = LayerNames.DEFALUT_EXPOSE_FAULTAGE; //“揭露断层”图层
            var          featureLayer    = drawspecial.GetFeatureLayerByName(sLayerAliasName);

            if (featureLayer == null)
            {
                MessageBox.Show(@"未找到" + sLayerAliasName + @"图层,无法修改揭露断层图元。");
                return;
            }

            //2.删除原来图元,重新绘制新图元
            DataEditCommon.DeleteFeatureByBId(featureLayer, faultageEntity.bid);
            DrawJldc(faultageEntity);
        }
Ejemplo n.º 5
0
        /// <summary>
        ///     获取停采线图层
        /// </summary>
        /// <returns>矢量图层</returns>
        private IFeatureLayer GetStopLineFeatureLayer()
        {
            //找到图层
            var map            = DataEditCommon.g_pMap;
            var layerName      = LayerNames.STOP_LINE; //“停采线”图层
            var drawSpecialCom = new DrawSpecialCommon();
            var featureLayer   = drawSpecialCom.GetFeatureLayerByName(layerName);

            //ILayer layer = GIS.Common.DataEditCommon.GetLayerByName(map, layerName);///获得图层IFeatureLayer featureLayer
            if (featureLayer == null)
            {
                MessageBox.Show("没有找到" + layerName + "图层,将不能绘制停采线。", "提示", MessageBoxButtons.OK);
                return(null);
            }

            //IFeatureLayer featureLayer = layer as IFeatureLayer;
            return(featureLayer);
        }
Ejemplo n.º 6
0
        /// <summary>
        ///     修改陷落柱图元
        /// </summary>
        /// <param name="lstCollapsePillarsEntKeyPts"></param>
        /// <param name="sCollapseId"></param>
        private void ModifyXlz(List <CollapsePillarsPoint> lstCollapsePillarsEntKeyPts, string sCollapseId)
        {
            //1.获得当前编辑图层
            var           drawspecial     = new DrawSpecialCommon();
            const string  sLayerAliasName = LayerNames.DEFALUT_COLLAPSE_PILLAR_1; //“默认_陷落柱_1”图层
            IFeatureLayer featureLayer    = drawspecial.GetFeatureLayerByName(sLayerAliasName);

            if (featureLayer == null)
            {
                MessageBox.Show(@"未找到" + sLayerAliasName + @"图层,无法修改陷落柱图元。");
                return;
            }

            //2.删除原来图元,重新绘制新图元
            bool bIsDeleteOldFeature = DataEditCommon.DeleteFeatureByBId(featureLayer, sCollapseId);

            if (bIsDeleteOldFeature)
            {
                //绘制图元
                DrawXlz(lstCollapsePillarsEntKeyPts, sCollapseId);
            }
        }
Ejemplo n.º 7
0
        /// <summary>
        ///     修改井筒
        /// </summary>
        /// <param name="pitshaftEntity"></param>
        private void ModifyJingTong(Pitshaft pitshaftEntity)
        {
            //1.获得当前编辑图层
            var drawspecial     = new DrawSpecialCommon();
            var sLayerAliasName = LayerNames.DEFALUT_JINGTONG; //“默认_井筒”图层
            var featureLayer    = drawspecial.GetFeatureLayerByName(sLayerAliasName);

            if (featureLayer == null)
            {
                MessageBox.Show("未找到" + sLayerAliasName + "图层,无法修改井筒图元。");
                return;
            }

            //2.删除原来图元,重新绘制新图元
            var bIsDeleteOldFeature = DataEditCommon.DeleteFeatureByWhereClause(featureLayer,
                                                                                "BID='" + pitshaftEntity.BindingId + "'");
            //if (bIsDeleteOldFeature)
            {
                //绘制井筒
                DrawJingTong(pitshaftEntity);
            }
        }
Ejemplo n.º 8
0
        /// <summary>
        ///     修改勘探线图元
        /// </summary>
        /// <params name="prospectingLineEntity"></params>
        /// <params name="lstProspectingBoreholePts"></params>
        private void ModifyProspectingLine(ProspectingLine prospectingLineEntity, List <IPoint> lstProspectingBoreholePts)
        {
            //1.获得当前编辑图层
            var drawspecial     = new DrawSpecialCommon();
            var sLayerAliasName = LayerNames.DEFALUT_KANTANXIAN; //“勘探线”图层
            var featureLayer    = drawspecial.GetFeatureLayerByName(sLayerAliasName);

            if (featureLayer == null)
            {
                MessageBox.Show("未找到" + sLayerAliasName + "图层,无法修改勘探线图元。");
                return;
            }

            //2.删除原来图元,重新绘制新图元
            var bIsDeleteOldFeature = DataEditCommon.DeleteFeatureByBId(featureLayer, prospectingLineEntity.binding_id);

            if (bIsDeleteOldFeature)
            {
                //绘制图元
                DrawProspectingLine(prospectingLineEntity, lstProspectingBoreholePts);
            }
        }
Ejemplo n.º 9
0
        /// <summary>
        ///     根据钻孔绑定ID删除钻孔图元
        /// </summary>
        /// <params name="sBoreholeBidArray">要删除钻孔的绑定ID</params>
        private static void DeleteZuanKongByBid(ICollection <string> sBoreholeBidArray)
        {
            if (sBoreholeBidArray.Count == 0)
            {
                return;
            }

            //1.获得当前编辑图层
            var          drawspecial     = new DrawSpecialCommon();
            const string sLayerAliasName = LayerNames.DEFALUT_BOREHOLE; //“钻孔”图层
            var          featureLayer    = drawspecial.GetFeatureLayerByName(sLayerAliasName);

            if (featureLayer == null)
            {
                MessageBox.Show(@"未找到" + sLayerAliasName + @"图层,无法删除钻孔图元。");
                return;
            }

            //2.删除钻孔图元
            foreach (var sBoreholeBid in sBoreholeBidArray)
            {
                DataEditCommon.DeleteFeatureByBId(featureLayer, sBoreholeBid);
            }
        }
Ejemplo n.º 10
0
        /// <summary>
        ///     根据揭露断层绑定ID删除揭露断层图元
        /// </summary>
        /// <params name="sfpFaultageBidArray">要删除揭露断层的绑定ID</params>
        private void DeleteJLDCByBID(ICollection <string> sfpFaultageBidArray)
        {
            if (sfpFaultageBidArray.Count == 0)
            {
                return;
            }

            //1.获得当前编辑图层
            var          drawspecial     = new DrawSpecialCommon();
            const string sLayerAliasName = LayerNames.DEFALUT_EXPOSE_FAULTAGE; //“揭露断层”图层
            var          featureLayer    = drawspecial.GetFeatureLayerByName(sLayerAliasName);

            if (featureLayer == null)
            {
                MessageBox.Show(@"未找到" + sLayerAliasName + @"图层,无法删除揭露断层图元。");
                return;
            }

            //2.删除揭露断层图元
            foreach (var sfpFaultageBid in sfpFaultageBidArray)
            {
                DataEditCommon.DeleteFeatureByBId(featureLayer, sfpFaultageBid);
            }
        }
Ejemplo n.º 11
0
        /// <summary>
        ///     根据勘探线层绑定ID删除勘探线层图元
        /// </summary>
        /// <param name="sfpFaultageBidArray">要删除勘探线层的绑定ID</param>
        private void DeleteJLDCByBID(string[] sfpFaultageBidArray)
        {
            if (sfpFaultageBidArray.Length == 0)
            {
                return;
            }

            //1.获得当前编辑图层
            var          drawspecial     = new DrawSpecialCommon();
            const string sLayerAliasName = LayerNames.DEFALUT_KANTANXIAN; //“默认_勘探线层”图层
            var          featureLayer    = drawspecial.GetFeatureLayerByName(sLayerAliasName);

            if (featureLayer == null)
            {
                MessageBox.Show(@"未找到" + sLayerAliasName + @"图层,无法删除揭露断层图元。");
                return;
            }

            //2.删除勘探线层图元
            foreach (var sfpFaultageBid in sfpFaultageBidArray)
            {
                DataEditCommon.DeleteFeatureByBId(featureLayer, sfpFaultageBid);
            }
        }
Ejemplo n.º 12
0
        /// <summary>
        ///     根据所选钻孔点绘制勘探线
        /// </summary>
        /// <params name="prospectingLineEntity"></params>
        /// <params name="lstProspectingBoreholePts"></params>
        private void DrawProspectingLine(ProspectingLine prospectingLineEntity, List <IPoint> lstProspectingBoreholePts)
        {
            //1.获得当前编辑图层
            var drawspecial     = new DrawSpecialCommon();
            var sLayerAliasName = LayerNames.DEFALUT_KANTANXIAN; //“勘探线”图层
            var featureLayer    = drawspecial.GetFeatureLayerByName(sLayerAliasName);

            if (featureLayer == null)
            {
                MessageBox.Show("未找到" + sLayerAliasName + "图层,无法绘制勘探线图元。");
                return;
            }

            //2.绘制图元
            if (lstProspectingBoreholePts.Count == 0)
            {
                return;
            }

            var prospectingLineID = prospectingLineEntity.binding_id;

            //绘制推断断层
            PointsFit2Polyline.CreateLine(featureLayer, lstProspectingBoreholePts, prospectingLineID);
        }
Ejemplo n.º 13
0
        /// <summary>
        ///     提  交
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void btnSubmit_Click(object sender, EventArgs e)
        {
            // 验证
            if (!Check())
            {
                DialogResult = DialogResult.None;
                return;
            }


            var borehole = Borehole.FindOneByBoreholeNum(txtBoreholeNumber.Text) ??
                           new Borehole {
                BindingId = IDGenerator.NewBindingID()
            };

            borehole.BoreholeNumber   = txtBoreholeNumber.Text.Trim();
            borehole.GroundElevation  = Convert.ToDouble(txtGroundElevation.Text.Trim());
            borehole.CoordinateX      = Convert.ToDouble(txtCoordinateX.Text.Trim());
            borehole.CoordinateY      = Convert.ToDouble(txtCoordinateY.Text.Trim());
            borehole.CoordinateZ      = Convert.ToDouble(txtCoordinateZ.Text.Trim());
            borehole.CoalSeamsTexture = string.Empty;

            var boreholeLithologys = new List <BoreholeLithology>();

            for (var i = 0; i < gvCoalSeamsTexture.RowCount; i++)
            {
                // 最后一行为空行时,跳出循环
                if (i == gvCoalSeamsTexture.RowCount - 1)
                {
                    break;
                }
                // 创建钻孔岩性实体
                var boreholeLithology = new BoreholeLithology
                {
                    FloorElevation = Convert.ToDouble(gvCoalSeamsTexture.Rows[i].Cells[1].Value),
                    Thickness      = Convert.ToDouble(gvCoalSeamsTexture.Rows[i].Cells[2].Value),
                    CoalSeamsName  = gvCoalSeamsTexture.Rows[i].Cells[3].Value.ToString(),
                    CoordinateX    = Convert.ToDouble(gvCoalSeamsTexture.Rows[i].Cells[4].Value),
                    CoordinateY    = Convert.ToDouble(gvCoalSeamsTexture.Rows[i].Cells[5].Value),
                    CoordinateZ    = Convert.ToDouble(gvCoalSeamsTexture.Rows[i].Cells[6].Value),
                    Lithology      = Lithology.FindOneByLithologyName(gvCoalSeamsTexture.Rows[i].Cells[0].Value.ToString()),
                    Borehole       = borehole
                };
                boreholeLithologys.Add(boreholeLithology);
            }
            borehole.BoreholeLithologys = boreholeLithologys;
            borehole.Save();

            //    var dlgResult = MessageBox.Show(@"是:见煤钻孔,否:未见煤钻孔,取消:不绘制钻孔", @"绘制钻孔",
            //        MessageBoxButtons.YesNoCancel);

            //    if (dlgResult == DialogResult.Yes)
            //    {
            //        DrawZuanKong(borehole, boreholeLithologyEntityList[0]);
            //    }
            //    else if (dlgResult == DialogResult.No)
            //    {
            //        DrawZuanKong(borehole);
            //    }
            //    else if (dlgResult == DialogResult.Cancel)
            //    {
            //    }
            //}
            //else
            //{
            //1.获得当前编辑图层
            var          drawspecial     = new DrawSpecialCommon();
            const string sLayerAliasName = LayerNames.DEFALUT_BOREHOLE; //“默认_钻孔”图层
            var          featureLayer    = drawspecial.GetFeatureLayerByName(sLayerAliasName);

            if (featureLayer == null)
            {
                MessageBox.Show(@"未找到" + sLayerAliasName + @"图层,无法删钻孔图元。");
                return;
            }

            if (borehole.BoreholeId != 0)
            {
                DataEditCommon.DeleteFeatureByBId(featureLayer, borehole.BindingId);
            }

            var dlgResult = MessageBox.Show(@"是:见煤钻孔,否:未见煤钻孔,取消:不绘制钻孔",
                                            @"绘制钻孔", MessageBoxButtons.YesNoCancel);

            switch (dlgResult)
            {
            case DialogResult.Yes:
                DrawZuanKong(borehole, borehole.BoreholeLithologys.First());
                break;

            case DialogResult.No:
                DrawZuanKong(borehole);
                break;

            case DialogResult.Cancel:
                break;
            }
            DialogResult = DialogResult.OK;
        }
Ejemplo n.º 14
0
        /// <summary>
        ///     提  交
        /// </summary>
        /// <params name="sender"></params>
        /// <params name="e"></params>
        private void btnSubmit_Click(object sender, EventArgs e)
        {
            var borehole = Borehole.FindAllByProperty("name", txtBoreholeNumber.Text).FirstOrDefault() ??
                           new Borehole {
                bid = IdGenerator.NewBindingId()
            };

            borehole.name              = txtBoreholeNumber.Text.Trim();
            borehole.ground_elevation  = Convert.ToDouble(txtGroundElevation.Text.Trim());
            borehole.coordinate_x      = Convert.ToDouble(txtCoordinateX.Text.Trim());
            borehole.coordinate_y      = Convert.ToDouble(txtCoordinateY.Text.Trim());
            borehole.coordinate_z      = Convert.ToDouble(txtCoordinateZ.Text.Trim());
            borehole.coal_seam_texture = string.Empty;
            borehole.Save();
            var subBorehole = new SubBorehole();

            for (var i = 0; i < gvCoalSeamsTexture.RowCount; i++)
            {
                // 最后一行为空行时,跳出循环
                if (i == gvCoalSeamsTexture.RowCount - 1)
                {
                    break;
                }

                // 创建钻孔岩性实体
                subBorehole = new SubBorehole
                {
                    floor_elevation = Convert.ToDouble(gvCoalSeamsTexture.Rows[i].Cells[1].Value),
                    thickness       = Convert.ToDouble(gvCoalSeamsTexture.Rows[i].Cells[2].Value),
                    coal_seam       = gvCoalSeamsTexture.Rows[i].Cells[3].Value.ToString(),
                    coordinate_x    = Convert.ToDouble(gvCoalSeamsTexture.Rows[i].Cells[4].Value),
                    coordinate_y    = Convert.ToDouble(gvCoalSeamsTexture.Rows[i].Cells[5].Value),
                    coordinate_z    = Convert.ToDouble(gvCoalSeamsTexture.Rows[i].Cells[6].Value),
                    lithology       = gvCoalSeamsTexture.Rows[i].Cells[0].Value.ToString(),
                    borehole        = borehole
                };
                subBorehole.Save();
            }

            var          drawspecial     = new DrawSpecialCommon();
            const string sLayerAliasName = LayerNames.DEFALUT_BOREHOLE; //“钻孔”图层
            var          featureLayer    = drawspecial.GetFeatureLayerByName(sLayerAliasName);

            if (featureLayer == null)
            {
                MessageBox.Show(@"未找到" + sLayerAliasName + @"图层,无法删钻孔图元。");
                return;
            }

            if (borehole.id != 0)
            {
                DataEditCommon.DeleteFeatureByBId(featureLayer, borehole.bid);
            }

            var dlgResult = MessageBox.Show(@"是:见煤钻孔,否:未见煤钻孔,取消:不绘制钻孔",
                                            @"绘制钻孔", MessageBoxButtons.YesNoCancel);

            borehole = Borehole.FindAllByProperty("name", borehole.name).First();
            switch (dlgResult)
            {
            case DialogResult.Yes:
                DrawZuanKong(borehole, subBorehole);
                break;

            case DialogResult.No:
                DrawZuanKong(borehole);
                break;

            case DialogResult.Cancel:
                break;
            }
            DialogResult = DialogResult.OK;
        }