コード例 #1
0
        /// <summary>
        ///     修改回采进尺面上显示信息
        /// </summary>
        private void UpdateHcjc(int hd1, int hd2, int qy, double zywid, double fywid, double qywid)
        {
            //已经存在回采进尺的,计算回采进尺点,保存到工作面表中,同时将绘制回采
            var initialHc = 0.0;

            if (InitialHCLen.Text != "")
            {
                double.TryParse(InitialHCLen.Text, out initialHc);
            }
            if (initialHc > 0)
            {
                var dics = new Dictionary <string, string>();
                dics[GIS_Const.FIELD_ID]   = "0";
                dics[GIS_Const.FIELD_BS]   = "1";
                dics[GIS_Const.FIELD_HDID] = hd1 + "_" + hd2;
                dics[GIS_Const.FIELD_XH]   = "1";
                IPoint pos     = new PointClass();
                var    dzxlist = Global.cons.DrawHDHC(hd1.ToString(), hd2.ToString(),
                                                      qy.ToString(), initialHc, zywid, fywid, qywid, 1, Global.searchlen, dics, false, null, out pos);

                if (null == pos)
                {
                    Log.Debug("[回采面关联]: pos is null.");
                    return;
                }

                //工作面信息提交
                _workingFace.SetCoordinate(pos.X, pos.Y, 0.0);
                _workingFace.Save();

                //更新地质构造表
                if (dzxlist.Count > 0)
                {
                    GeologySpaceBll.DeleteGeologySpaceEntityInfos(_workingFace.WorkingFaceId); //删除对应工作面ID的地质构造信息
                    foreach (var key in dzxlist.Keys)
                    {
                        var geoinfos = dzxlist[key];
                        var geo_type = key;
                        for (var i = 0; i < geoinfos.Count; i++)
                        {
                            var tmp = geoinfos[i];

                            var geologyspaceEntity = new GeologySpace();
                            geologyspaceEntity.WorkingFace  = _workingFace;
                            geologyspaceEntity.TectonicType = Convert.ToInt32(key);
                            geologyspaceEntity.TectonicId   = tmp.geoinfos[GIS_Const.FIELD_BID];
                            geologyspaceEntity.Distance     = tmp.dist;
                            geologyspaceEntity.OnDateTime   = DateTime.Now.ToShortDateString();

                            geologyspaceEntity.Save();
                        }
                    }
                }
            }
        }
コード例 #2
0
        //修改巷道
        private void UpdateHdJc(string hdid, string bid, double jjcd, double hdwid)
        {
            var deltas = Global.cons.UpdateJJCD(hdid, bid, hdwid, jjcd, 0, Global.searchlen, Global.sxjl,
                                                0);
            var xydeltas = deltas[bid];
            var xdelta   = Convert.ToDouble(xydeltas.Split('|')[0]);
            var ydelta   = Convert.ToDouble(xydeltas.Split('|')[1]);

            //更新地质结构信息表
            IPoint pnt = new PointClass();

            pnt.X = selectWorkingfaceSimple1.SelectedWorkingFace.CoordinateX + xdelta;
            pnt.Y = selectWorkingfaceSimple1.SelectedWorkingFace.CoordinateY + ydelta;
            pnt.Z = selectWorkingfaceSimple1.SelectedWorkingFace.CoordinateZ;
            pnt.SpatialReference = Global.spatialref;

            //修改工作面信息表中对应的X Y Z坐标信息
            selectWorkingfaceSimple1.SelectedWorkingFace.SetCoordinate(pnt.X, pnt.Y, 0.0);
            selectWorkingfaceSimple1.SelectedWorkingFace.Save();

            //查询地质结构信息
            var hd_ids = new List <int>();

            hd_ids.Add(Convert.ToInt16(hdid));
            var geostructsinfos = Global.commonclss.GetStructsInfos(pnt, hd_ids);

            GeologySpaceBll.DeleteGeologySpaceEntityInfos(selectWorkingfaceSimple1.SelectedWorkingFace.WorkingFaceId);
            //删除对应工作面ID的地质构造信息
            foreach (var key in geostructsinfos.Keys)
            {
                var geoinfos = geostructsinfos[key];
                var geo_type = key;
                for (var i = 0; i < geoinfos.Count; i++)
                {
                    var tmp = geoinfos[i];

                    var geologyspaceEntity = new GeologySpace
                    {
                        WorkingFace  = selectWorkingfaceSimple1.SelectedWorkingFace,
                        TectonicType = Convert.ToInt32(key),
                        TectonicId   = tmp.geoinfos[GIS_Const.FIELD_BID],
                        Distance     = tmp.dist,
                        OnDateTime   = DateTime.Now.ToShortDateString()
                    };

                    geologyspaceEntity.Save();
                }
            }
        }
コード例 #3
0
        //添加巷道掘进
        private void AddHdJc(string hdid, double jjcd, string bid, double hdwid)
        {
            var geostructsinfos = Global.cons.DrawJJCD(hdid, bid, hdwid, null, jjcd, 0,
                                                       Global.searchlen, Global.sxjl, 0);
            //修改工作面信息表中对应的X Y Z坐标信息
            var pos         = geostructsinfos.Last().Value;
            var workfacepos = pos[0].geo as IPoint;

            if (workfacepos != null)
            {
                selectWorkingfaceSimple1.SelectedWorkingFace.SetCoordinate(workfacepos.X, workfacepos.Y, 0.0);
                selectWorkingfaceSimple1.SelectedWorkingFace.Save();
            }
            //查询地质结构信息
            geostructsinfos.Remove("LAST");
            GeologySpaceBll.DeleteGeologySpaceEntityInfos(selectWorkingfaceSimple1.SelectedWorkingFace.WorkingFaceId);
            //删除工作面ID对应的地质构造信息
            foreach (var key in geostructsinfos.Keys)
            {
                var geoinfos = geostructsinfos[key];
                var geo_type = key;
                for (var i = 0; i < geoinfos.Count; i++)
                {
                    var tmp = geoinfos[i];

                    var geologyspaceEntity = new GeologySpace
                    {
                        WorkingFace  = selectWorkingfaceSimple1.SelectedWorkingFace,
                        TectonicType = Convert.ToInt32(key),
                        TectonicId   = tmp.geoinfos[GIS_Const.FIELD_BID],
                        Distance     = tmp.dist,
                        OnDateTime   = DateTime.Now.ToShortDateString()
                    };

                    geologyspaceEntity.Save();
                }
            }
        }
コード例 #4
0
        /// <summary>
        ///     修改回采进尺面上显示信息
        /// </summary>
        private void UpdateHcjc(int hd1, int hd2, int qy, double hcjc, string bid, double zywid, double fywid,
                                double qywid)
        {
            //已经存在回采进尺的,计算回采进尺点,保存到工作面表中,同时将绘制回采
            var    workingFace = selectWorkingfaceSimple1.SelectedWorkingFace;
            IPoint prevPnt     = new PointClass();

            prevPnt.X = workingFace.CoordinateX;
            prevPnt.Y = workingFace.CoordinateY;
            prevPnt.Z = workingFace.CoordinateZ;

            //已经存在回采进尺的,计算回采进尺点,保存到工作面表中,同时将绘制回采
            var dics = new Dictionary <string, string>();

            dics.Add(GIS_Const.FIELD_HDID, hd1 + "_" + hd2);
            dics.Add(GIS_Const.FIELD_BS, "0");
            dics.Add(GIS_Const.FIELD_BID, bid);
            var selcjqs =
                Global.commonclss.SearchFeaturesByGeoAndText(Global.hcqlyr, dics);
            var results_pts = Global.cons.UpdateHCCD(hd1.ToString(), hd2.ToString(),
                                                     qy.ToString(), bid, hcjc, zywid, fywid, qywid, Global.searchlen);

            if (results_pts == null)
            {
                return;
            }
            //更新当前修改的回采进尺对应的工作面信息表记录
            var    index = 0;
            IPoint pnt   = new PointClass();

            foreach (var key in results_pts.Keys)
            {
                workingFace.SetCoordinate(results_pts[key].X, results_pts[key].Y, results_pts[key].Z);
                workingFace.Save();
                if (index == results_pts.Count - 1)
                {
                    pnt.X = results_pts[key].X;
                    pnt.Y = results_pts[key].Y;
                    pnt.Z = results_pts[key].Z;
                }

                index++;
            }

            //
            if (results_pts.Count == 0)
            {
                return;
            }

            // 地质构造距离
            var hd_ids = new List <int>();

            hd_ids.Add(hd1);
            hd_ids.Add(hd2);
            hd_ids.Add(qy);
            var geostructsinfos = Global.commonclss.GetStructsInfos(pnt, hd_ids);

            if (geostructsinfos.Count > 0)
            {
                GeologySpaceBll.DeleteGeologySpaceEntityInfos(workingFace.WorkingFaceId); //删除工作面ID对应的地质构造信息
                foreach (var key in geostructsinfos.Keys)
                {
                    var geoinfos = geostructsinfos[key];
                    var geo_type = key;
                    for (var i = 0; i < geoinfos.Count; i++)
                    {
                        var tmp = geoinfos[i];

                        var geologyspaceEntity = new GeologySpace
                        {
                            WorkingFace  = selectWorkingfaceSimple1.SelectedWorkingFace,
                            TectonicType = Convert.ToInt32(key),
                            TectonicId   = tmp.geoinfos[GIS_Const.FIELD_BID],
                            Distance     = tmp.dist,
                            OnDateTime   = DateTime.Now.ToShortDateString()
                        };

                        geologyspaceEntity.Save();
                    }
                }
            }
        }
コード例 #5
0
        /// <summary>
        ///     添加初始化时的回采进尺
        /// </summary>
        private void AddHcjc(int hd1, int hd2, int qy, double zywid, double fywid, double qywid, double hcjc, string bid)
        {
            var    dics = new Dictionary <string, string>();
            IPoint prevPnt;
            var    workingFace = selectWorkingfaceSimple1.SelectedWorkingFace;

            if (selectWorkingfaceSimple1.SelectedWorkingFace != null)
            {
                prevPnt = new PointClass
                {
                    X = workingFace.CoordinateX,
                    Y = workingFace.CoordinateY,
                    Z = workingFace.CoordinateZ
                };
            }
            else
            {
                Log.Error("[回采进尺]:工作面为空值!");
                throw new ArgumentException("[回采进尺]:工作面为空值!", "workingFace");
            }

            dics[GIS_Const.FIELD_HDID] = hd1 + "_" + hd2;
            //已经存在回采进尺的,计算回采进尺点,保存到工作面表中,同时将绘制回采
            var selcjqs =
                Global.commonclss.SearchFeaturesByGeoAndText(Global.hcqlyr, dics);
            var xh = 0;

            xh = selcjqs.Count == 0 ? 0 : Convert.ToInt32(selcjqs[0].Item3[GIS_Const.FIELD_XH]);
            dics[GIS_Const.FIELD_ID]  = "0";
            dics[GIS_Const.FIELD_BS]  = "0";
            dics[GIS_Const.FIELD_BID] = bid;
            dics[GIS_Const.FIELD_XH]  = (xh + 1).ToString();
            IPoint pos     = new PointClass();
            var    dzxlist =
                Global.cons.DrawHDHC(hd1.ToString(), hd2.ToString(), qy.ToString(), hcjc, zywid, fywid, qywid, 1,
                                     Global.searchlen, dics, true, prevPnt, out pos);

            // 更新工作面信息(预警点坐标)
            if (pos != null)
            {
                workingFace.SetCoordinate(pos.X, pos.Y, 0.0);
                workingFace.Save();
            }

            //更新地质构造表
            if (null != dzxlist && dzxlist.Count > 0)
            {
                GeologySpaceBll.DeleteGeologySpaceEntityInfos(workingFace.WorkingFaceId); //删除工作面ID对应的地质构造信息
                foreach (var key in dzxlist.Keys)
                {
                    var geoinfos = dzxlist[key];
                    var geo_type = key;
                    foreach (var tmp in geoinfos)
                    {
                        var geologyspaceEntity = new GeologySpace
                        {
                            WorkingFace  = workingFace,
                            TectonicType = Convert.ToInt32(key),
                            TectonicId   = tmp.geoinfos[GIS_Const.FIELD_BID],
                            Distance     = tmp.dist,
                            OnDateTime   = DateTime.Now.ToShortDateString()
                        };

                        geologyspaceEntity.Save();
                    }
                }
            }
        }
コード例 #6
0
        /// <summary>
        ///     巷道回采校正
        /// </summary>
        private void TunnelHcJz(List <IPoint> pnts, string hd1, string hd2, string hd3, int workingfaceid, double zywid,
                                double fywid, double qywid)
        {
            //查询对应的巷道信息
            var hdids = new Dictionary <string, string>();

            hdids.Add(GIS_Const.FIELD_HDID, hd1);
            var selobjs1 =
                Global.commonclss.SearchFeaturesByGeoAndText(Global.centerlyr, hdids);
            var pline1 = selobjs1[0].Item2 as IPolyline;

            hdids[GIS_Const.FIELD_HDID] = hd2;
            var selobjs2 =
                Global.commonclss.SearchFeaturesByGeoAndText(Global.centerlyr, hdids);
            var pline2 = selobjs2[0].Item2 as IPolyline;

            hdids[GIS_Const.FIELD_HDID] = hd3;
            var selobjs3 =
                Global.commonclss.SearchFeaturesByGeoAndText(Global.centerlyr, hdids);
            var pline3 = selobjs3[0].Item2 as IPolyline;

            //删除原来的采掘区
            hdids[GIS_Const.FIELD_HDID] = hd1 + "_" + hd2;
            var sql = "\"" + GIS_Const.FIELD_HDID + "\"='" + hd1 + "_" + hd2 + "' AND \"" + GIS_Const.FIELD_BS +
                      "\"=0";

            Global.commonclss.DelFeatures(Global.hcqlyr, sql);
            //查询对应的回采区
            for (var k = 0; k < pnts.Count; k++)
            {
                //导线点
                var pnt = pnts[k];
                var jzx = pnt.X;
                var jzy = pnt.Y;
                //构造采掘区对象
                var xh          = 0;
                var selobjshcqs =
                    Global.commonclss.SearchFeaturesByGeoAndText(Global.hcqlyr, hdids);
                Dictionary <string, List <IPoint> > oldpnts = null;
                if (selobjshcqs.Count != 0)
                {
                    oldpnts = Global.commonclss.getCoordinates(selobjshcqs[0].Item2 as IPolygon, pline1, pline2, pline3,
                                                               zywid, fywid);
                    xh = Convert.ToInt32(selobjshcqs[0].Item3[GIS_Const.FIELD_XH]);
                }
                IPointCollection pntcol = new PolygonClass();
                if (selobjshcqs.Count == 0)
                {
                    //计算校正点距离切眼的距离
                    IPoint outp          = new PointClass();
                    var    distancealong = 0.0;
                    var    distancefrom  = 0.0;
                    var    bres          = false;
                    pline3.QueryPointAndDistance(esriSegmentExtension.esriNoExtension, pnt, false, outp,
                                                 ref distancealong, ref distancefrom, ref bres);
                    //根据距离绘制回采面
                    pntcol = Global.hcjsclass.GetBackPolygonArea(pline1, pline2, pline3, zywid, fywid, qywid,
                                                                 distancefrom, 0);
                }
                else
                {
                    //IPolygon hcreg = selobjshcqs[0].Item2 as IPolygon;
                    //Dictionary<string, List<IPoint>> fourpnts = Global.commonclss.getCoordinates(hcreg, pline1, pline2, pline3, Global.linespace, Global.linespace);
                    //List<IPoint> listpnts = fourpnts["1"];
                    IPoint pntcenter = new PointClass();
                    pntcenter.PutCoords((oldpnts["1"][0].X + oldpnts["1"][1].X) / 2,
                                        (oldpnts["1"][0].Y + oldpnts["1"][1].Y) / 2);
                    pntcenter.Z = 0;
                    //double hccd1 = Math.Sqrt(Math.Pow((pnt.X - pntcenter.X), 2) + Math.Pow((pnt.Y - pntcenter.Y), 2));
                    //查询回采方向 这里没有设置传入的切眼 可能会出错 需要调试2014-9-23
                    var dirflag = 0;
                    dirflag = Global.commonclss.GetDirectionByPnt(pline3, pntcenter);
                    pline3  = new PolylineClass();
                    if (oldpnts == null)
                    {
                        return;
                    }
                    pline3.FromPoint = oldpnts["1"][1];
                    pline3.ToPoint   = oldpnts["1"][0];
                    //计算校正点距离切眼的距离
                    IPoint outp          = new PointClass();
                    var    distancealong = 0.0;
                    var    distancefrom  = 0.0;
                    var    bres          = false;
                    pline3.QueryPointAndDistance(esriSegmentExtension.esriNoExtension, pnt, false, outp,
                                                 ref distancealong, ref distancefrom, ref bres);
                    //根据距离绘制回采面
                    pntcol = Global.hcjsclass.GetBackPolygonArea(pline1, pline2, pline3, zywid, fywid, qywid,
                                                                 distancefrom, dirflag);
                }
                var pnthccols = new List <IPoint>();
                for (var i = 0; i < pntcol.PointCount - 1; i++)
                {
                    pnthccols.Add(pntcol.get_Point(i));
                }
                var dics = new Dictionary <string, string>();
                dics[GIS_Const.FIELD_ID]   = "0";
                dics[GIS_Const.FIELD_BS]   = "1";
                dics[GIS_Const.FIELD_HDID] = hdids[GIS_Const.FIELD_HDID];
                dics[GIS_Const.FIELD_XH]   = (xh + 1).ToString();
                Global.cons.AddHangdaoToLayer(pnthccols, dics, Global.hcqlyr);
                //将当前点写入到对应的工作面表中
                var prevPnt     = pntcol.get_Point(pntcol.PointCount - 1);
                var workingFace = selectWorkingFaceControl1.SelectedWorkingFace;
                if (prevPnt != null)
                {
                    workingFace.SetCoordinate(prevPnt.X, prevPnt.Y, 0.0);
                    workingFace.Save();
                }
                //根据点查询60米范围内的地质构造的信息
                var hd_ids = new List <int>();
                hd_ids.Add(Convert.ToInt16(hd1));
                hd_ids.Add(Convert.ToInt16(hd2));
                hd_ids.Add(Convert.ToInt16(hd3));
                var geostructs = Global.commonclss.GetStructsInfos(prevPnt, hd_ids);
                if (geostructs == null)
                {
                    return;
                }
                GeologySpaceBll.DeleteGeologySpaceEntityInfos(workingFace.WorkingFaceId); //删除对应工作面ID的地质构造信息
                foreach (var key in geostructs.Keys)
                {
                    var geoinfos = geostructs[key];
                    var geo_type = key;
                    for (var i = 0; i < geoinfos.Count; i++)
                    {
                        var tmp = geoinfos[i];

                        var geologyspaceEntity = new GeologySpace();
                        geologyspaceEntity.WorkingFace  = workingFace;
                        geologyspaceEntity.TectonicType = Convert.ToInt32(key);
                        geologyspaceEntity.TectonicId   = tmp.geoinfos[GIS_Const.FIELD_BID];
                        geologyspaceEntity.Distance     = tmp.dist;
                        geologyspaceEntity.OnDateTime   = DateTime.Now.ToShortDateString();

                        geologyspaceEntity.Save();
                    }
                }
            }
        }
コード例 #7
0
        /// <summary>
        ///     删除掘进进尺日报对应的地图信息
        /// </summary>
        /// <param name="hdid">巷道ID</param>
        /// <param name="bid">绑定ID</param>
        /// <param name="workingfaceid"></param>
        private void DelJJCD(string hdid, string bid, int workingfaceid)
        {
            Global.cons.DelJJCD(hdid, bid);
            //计算地质构造距离
            //var sql = "\"" + GIS.GIS_Const.FIELD_HDID + "\"='" + hdid + "'";
            var dics = new Dictionary <string, string> {
                { GIS_Const.FIELD_HDID, hdid }
            };
            var objs = Global.commonclss.SearchFeaturesByGeoAndText(Global.hdfdlyr, dics);

            if (objs.Count > 0)
            {
                var poly0 = objs[0].Item2 as IPointCollection;
                //var poly1 = objs[1].Item2 as ESRI.ArcGIS.Geometry.IPointCollection;
                IPoint pline = new PointClass();
                if (poly0 != null && poly0.Point[0].X - poly0.Point[1].X > 0) //向右掘进
                {
                    pline.X = (poly0.Point[0].X + poly0.Point[3].X) / 2;
                    pline.Y = (poly0.Point[0].Y + poly0.Point[3].Y) / 2;
                }
                else //向左掘进
                {
                    if (poly0 != null)
                    {
                        pline.X = (poly0.Point[1].X + poly0.Point[2].X) / 2;
                        pline.Y = (poly0.Point[1].Y + poly0.Point[2].Y) / 2;
                    }
                }
                //查询地质构造信息
                var hdids = new List <int> {
                    Convert.ToInt32(hdid)
                };
                var dzxlist = Global.commonclss.GetStructsInfosNew(pline, hdids);
                GeologySpaceBll.DeleteGeologySpaceEntityInfos(workingfaceid); //删除工作面ID对应的地质构造信息

                foreach (var key in dzxlist.Keys)
                {
                    var geoinfos = dzxlist[key];
                    //string geoType = key;
                    foreach (var tmp in geoinfos)
                    {
                        var geologySpace = GeologySpace.FindOneByWorkingFaceIdAndTeconicId(workingfaceid,
                                                                                           tmp.geoinfos[GIS_Const.FIELD_BID]);
                        if (geologySpace != null)
                        {
                            geologySpace.Distance   = tmp.dist;
                            geologySpace.OnDateTime = DateTime.Now.ToShortDateString();

                            //var geologyspaceEntity = new GeologySpace
                            //{
                            //    WorkingFace = WorkingFace.Find(workingfaceid),
                            //    TectonicType = Convert.ToInt32(key),
                            //    TectonicId = ,
                            //    Distance = tmp.dist,
                            //    OnDateTime = DateTime.Now.ToShortDateString()
                            //};
                            geologySpace.Save();
                        }
                    }
                }
            }
        }
コード例 #8
0
        /// <summary>
        ///     删除GIS回采进尺图形信息
        /// </summary>
        /// <param name="hd1">主运顺槽id</param>
        /// <param name="hd2">辅运顺槽id</param>
        /// <param name="qy">切眼id</param>
        /// <param name="bid">回采进尺的BindingID</param>
        /// <param name="wfEntity">回采面实体</param>
        /// <param name="zywid"></param>
        /// <param name="fywid"></param>
        private void DelHcjc(int hd1, int hd2, int qy, string bid, WorkingFace wfEntity, double zywid, double fywid)
        {
            //删除对应的回采进尺图形和数据表中的记录信息
            var results = Global.cons.DelHCCD(hd1.ToString(CultureInfo.InvariantCulture),
                                              hd2.ToString(CultureInfo.InvariantCulture), qy.ToString(CultureInfo.InvariantCulture), bid, zywid, fywid,
                                              Global.searchlen);

            if (results == null)
            {
                return;
            }

            //更新当前回采进尺后的回采进尺记录表信息
            var    count  = results.Keys.Count;
            var    index  = 0;
            IPoint posnew = null;

            foreach (var key in results.Keys)
            {
                var x = results[key].X;
                var y = results[key].Y;
                var z = results[key].Z;
                wfEntity.SetCoordinate(x, y, z);
                wfEntity.Save();

                index += 1;
                if (index == count - 1)
                {
                    posnew = new PointClass {
                        X = x, Y = y, Z = z
                    };
                }
            }
            //更新回采进尺表,将isdel设置0
            var entity = DayReportHc.FindByBid(bid);

            entity.IsDel = 0;
            entity.SaveAndFlush();


            //更新地质构造表中的信息
            if (posnew == null)
            {
                return;
            }
            var hdIds = new List <int> {
                hd1, hd2, qy
            };
            var dzxlist = Global.commonclss.GetStructsInfos(posnew, hdIds);

            if (dzxlist.Count > 0)
            {
                GeologySpaceBll.DeleteGeologySpaceEntityInfos(wfEntity.WorkingFaceId); //删除工作面ID对应的地质构造信息
                foreach (var key in dzxlist.Keys)
                {
                    var geoinfos = dzxlist[key];
                    foreach (var tmp in geoinfos)
                    {
                        var geologyspaceEntity = new GeologySpace
                        {
                            WorkingFace  = wfEntity,
                            TectonicType = Convert.ToInt32(key),
                            TectonicId   = tmp.geoinfos[GIS_Const.FIELD_BID],
                            Distance     = tmp.dist,
                            OnDateTime   = DateTime.Now.ToShortDateString()
                        };

                        geologyspaceEntity.Save();
                    }
                }
            }
        }