Ejemplo n.º 1
0
        public static trackDataListProfile setupDataListTrack(string filePath, float fTop, float fBase)
        {
            trackDataListProfile trackDataList = new trackDataListProfile();

            if (File.Exists(filePath))
            {
                string sData = "";
                using (StreamReader sr = new StreamReader(filePath, System.Text.Encoding.Default))
                {
                    sData = sr.ReadToEnd();
                }

                string[] split = sData.Trim().Split(new char[] { ' ', '\t' }, StringSplitOptions.RemoveEmptyEntries);
                for (int i = 0; i < split.Length; i = i + 9)
                {
                    string sJH          = split[i];
                    float  fCurrentTop  = float.Parse(split[i + 2]);
                    float  fCurrentBase = float.Parse(split[i + 3]);
                    float  fZRL         = float.Parse(split[i + 4]);
                    float  fPercent     = float.Parse(split[i + 5]);

                    if (fTop <= fCurrentTop && fCurrentBase <= fBase)
                    {
                        trackDataList.fListDS1.Add(fCurrentTop);
                        trackDataList.fListDS2.Add(fCurrentBase);
                        trackDataList.fListPercent.Add(fPercent);
                        trackDataList.fListZRL.Add(fZRL);
                    }
                }
            }
            return(trackDataList);
        }
Ejemplo n.º 2
0
        void generateSectionGraph(string filenameSVGMap, bool bView)
        {
            //xml存数据不合适 因为会有大量的井数据,但是可以存个样式,样式搭配数据,样式里可以有道宽,这样做到数据和样式的分离,成图解析器解析样式就OK。

            //定义每口井绘制的位置坐标,剖面图y=0,井组分析x,y是井点坐标变换值
            //定义 iChoise==1 等间隔排列,iChoise==2 相邻井真实距离缩放
            int iChoise = 2;

            if (rdbPlaceByEqual.Checked == true)
            {
                iChoise = 1;
            }
            List <Point> PListWellPositon = new List <Point>();


            //根据默认值定义section的页面大小及标题,根据海拔确定纵向的平移高度
            int            iDY        = (int)listWellsSection.Select(p => p.fKB).ToList().Max() + 100;
            cSVGDocSection svgSection = new cSVGDocSection(PageWidth, PageHeight, 0, iDY, sUnit);
            string         sTitle     = string.Join("-", listWellsSection.Select(p => p.sJH).ToList()) + "开发剖面图";

            svgSection.addMapTitle(sTitle, 100, 100);

            XmlElement returnElemment;

            //画井距尺
            for (int i = 0; i < this.listWellsSection.Count - 1; i++)
            {
                if (rdbPlaceBYWellDistance.Checked == true)
                {
                    //距离是2口相邻井的距离
                    int iDistance = Convert.ToInt16(c2DGeometryAlgorithm.calDistance2D(listWellsSection[i].dbX, listWellsSection[i].dbY, listWellsSection[i + 1].dbX, listWellsSection[i + 1].dbY));
                    returnElemment = svgSection.gWellDistanceRuler(iDistance, PListWellPositon[i + 1].X - PListWellPositon[i].X);
                    svgSection.addgElement2BaseLayer(returnElemment, PListWellPositon[i].X, (int)listWellsSection[0].fYview);//拉到同一水平线
                    //画井距尺
                }
            }

            ElevationRulerBase = -PageHeight / 100 * 100;
            //海拔深度时 增加海拔尺,拉平不要海拔尺

            int iScaleElevationRuler = 50;

            returnElemment = cSVGSectionTrackWellRuler.gElevationRuler(svgSection.svgDoc, ElevationRulerTop, ElevationRulerBase, iScaleElevationRuler);
            svgSection.addgElement2BaseLayer(returnElemment, 10);

            //根据井序列循环添加井剖面
            for (int i = 0; i < listWellsSection.Count; i++)
            {
                string sJH = listWellsSection[i].sJH;

                List <ItemDicWellPath> currentWellPathList = cProjectData.ltProjectWell.Find(p => p.sJH == sJH).WellPathList;
                float fTopShowed    = listWellsSection[i].fShowedDepthTop;
                float fBaseShowed   = listWellsSection[i].fShowedDepthBase;
                float fDepthFlatted = listWellsSection[i].fYview;

                cSVGSectionWell currentWell = new cSVGSectionWell(svgSection.svgDoc, sJH);


                //增加地层道
                trackDataListLayerDepth getTrackDataListLayerDepth = cIOWellSection.getTrackDataListLayerDepth(sJH, dirSectionData, fTopShowed, fBaseShowed);
                int iTrackWidth = 15;
                cSVGSectionTrackLayer layerTrack = new cSVGSectionTrackLayer(iTrackWidth);
                layerTrack.iTextSize = 6;
                if (rdbDepthModelTVD.Checked == true && currentWellPathList.Count > 2)
                {
                    returnElemment = layerTrack.gXieTrack2VerticalLayerDepth(sJH, getTrackDataListLayerDepth, fDepthFlatted);
                }
                else
                {
                    returnElemment = layerTrack.gTrackLayerDepth(sJH, getTrackDataListLayerDepth, fDepthFlatted);
                }
                currentWell.addTrack(returnElemment, iTrackWidth);

                //增加联井的view
                //增加测井解释
                trackDataListJSJL trackDataListJSJL = cIOWellSection.getTrackDataListJSJL(sJH, dirSectionData, fTopShowed, fBaseShowed);
                iTrackWidth = 15;
                cSVGSectionTrackJSJL JSJLTrack = new cSVGSectionTrackJSJL(iTrackWidth);
                if (rdbDepthModelTVD.Checked == true && currentWellPathList.Count > 2)
                {
                    returnElemment = JSJLTrack.gXieTrack2VerticalJSJL(sJH, trackDataListJSJL, fDepthFlatted);
                }
                else
                {
                    returnElemment = JSJLTrack.gTrackJSJL(sJH, trackDataListJSJL, fDepthFlatted);
                }
                currentWell.addTrack(returnElemment, -iTrackWidth);

                //增加射孔道
                trackInputPerforationDataList getTrackDataListPerforation = cIOWellSection.getTrackDataListPerforation(sJH, dirSectionData, fTopShowed, fBaseShowed);
                iTrackWidth = 15;
                cSVGSectionTrackPeforation perforationTrack = new cSVGSectionTrackPeforation(iTrackWidth);
                if (rdbDepthModelTVD.Checked == true && currentWellPathList.Count > 2)
                {
                    returnElemment = perforationTrack.gXieTrack2VerticalPerforation(sJH, getTrackDataListPerforation, fDepthFlatted);
                }
                else
                {
                    returnElemment = perforationTrack.gTrackPerforation(sJH, getTrackDataListPerforation, fDepthFlatted);
                }
                currentWell.addTrack(returnElemment, -2 * iTrackWidth);

                //增加吸水剖面
                trackDataListProfile trackDataListProfile = cIOWellSection.getTrackDataListProfile(sJH, dirSectionData, fTopShowed, fBaseShowed);
                iTrackWidth = 15;
                cSVGSectionTrackProfile profileTrack = new cSVGSectionTrackProfile(iTrackWidth);
                returnElemment = profileTrack.gTrackProfile(sJH, trackDataListProfile, fDepthFlatted);
                if (currentWellPathList.Count > 2)
                {
                    returnElemment = profileTrack.gXieTrack2VerticalProfile(sJH, trackDataListProfile, fDepthFlatted);
                }
                else
                {
                    returnElemment = profileTrack.gTrackProfile(sJH, trackDataListProfile, fDepthFlatted);
                }
                currentWell.addTrack(returnElemment, 15);

                //增加左边曲线
                string fileLeftLogScrPath = Path.Combine(dirSectionData, sJH + "\\left");
                foreach (string fileLog in Directory.GetFileSystemEntries(fileLeftLogScrPath))
                {
                    //trackDataListLog trackDataListLeftLog = trackDataListLog.setupDataListTrackLog(fileLog, fTopShowed, fBaseShowed);
                    iTrackWidth = 15;

                    //cSVGSectionTrackLog logTrack = new cSVGSectionTrackLog(iTrackWidth);
                    //if (rdbDepthModelTVD.Checked == true && currentWellPathList.Count > 2)
                    //    returnElemment = logTrack.gXieTrack2VerticalLog(sJH, trackDataListLeftLog, fDepthFlatted);
                    //else returnElemment = logTrack.gTrackLog(sJH, trackDataListLeftLog, fDepthFlatted);
                    //currentWell.addTrack(returnElemment, -30);
                }

                //增加右边曲线
                string fileRightLogScrPath = Path.Combine(dirSectionData, sJH + "\\right");
                foreach (string fileLog in Directory.GetFileSystemEntries(fileRightLogScrPath))
                {
                    //trackDataListLog trackDataListRightLog = trackDataListLog.setupDataListTrackLog(fileLog, fTopShowed, fBaseShowed);
                    iTrackWidth = 15;
                    //cSVGSectionTrackLog logTrack = new cSVGSectionTrackLog(iTrackWidth);
                    //if (rdbDepthModelTVD.Checked == true && currentWellPathList.Count > 2)
                    //    returnElemment = logTrack.gXieTrack2VerticalLog(sJH, trackDataListRightLog, fDepthFlatted);
                    //else returnElemment = logTrack.gTrackLog(sJH,  trackDataListRightLog, fDepthFlatted);

                    //currentWell.addTrack(returnElemment, iTrackWidth);
                }
                svgSection.addgElement2BaseLayer(currentWell.gWell, PListWellPositon[i].X);
            }

            //同名小层连线的实现 在绘制小层layertrack的时候,把小层的顶底深的绘制点记录,然后此处当做polyline绘制
            bool bConnect = this.cbxConnectSameLayerName.Checked;

            string fileSVG = Path.Combine(cProjectManager.dirPathMap, filenameSVGMap);

            svgSection.makeSVGfile(fileSVG);
            if (bView == false)
            {
                FormMain.filePathWebSVG = fileSVG;
                this.Close();
            }
        }