public static trackDataListJSJL setupDataListTrack(string filePath, float fTop, float fBase) { trackDataListJSJL trackDataListJSJL = new trackDataListJSJL(); if (!File.Exists(filePath)) { return(trackDataListJSJL); } 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 + 3) { float fCurrentTop = float.Parse(split[i]); float fCurrentBase = float.Parse(split[i + 1]); if (fTop <= fCurrentTop && fCurrentBase <= fBase) { trackDataListJSJL.fListDS1.Add(fCurrentTop); trackDataListJSJL.fListDS2.Add(fCurrentBase); trackDataListJSJL.sListJSJL.Add(split[i + 2]); } } return(trackDataListJSJL); }
public static trackDataListJSJL getTrackDataJSJL(string filePath, string sIDTrack) { trackDataListJSJL sttJSJL = new trackDataListJSJL(); using (StreamReader sr = new StreamReader(filePath, Encoding.UTF8)) { String line; string[] split; int iReadIndex = 0; while ((line = sr.ReadLine()) != null) //delete the line whose legth is 0 { split = line.Trim().Split(new char[] { ' ', '\t' }, StringSplitOptions.RemoveEmptyEntries); if (line.StartsWith(sJSJLFileMark) == true && split[1] == sIDTrack) { iReadIndex = 1; } else if (line.StartsWith("#$End" + sJSJLFileMark) == true) { iReadIndex = 2; } else if (iReadIndex >= 2) { break; } else if (iReadIndex == 1) { sttJSJL.fListDS1.Add(float.Parse(split[1])); sttJSJL.fListDS2.Add(float.Parse(split[2])); sttJSJL.sListJSJL.Add(split[3]); } } } return(sttJSJL); }
public trackDataListJSJL selectJSJL2DataList(string sJH) { trackDataListJSJL dataList = new trackDataListJSJL(); dataList.fListDS1 = new List <float>(); dataList.fListDS2 = new List <float>(); dataList.sListJSJL = new List <string>(); foreach (var item in readJSJL2Struct(sJH)) { dataList.fListDS1.Add(item.fDS1); dataList.fListDS2.Add(item.fDS2); dataList.sListJSJL.Add(item.iJSJL.ToString()); } return(dataList); }
public static trackDataListJSJL getTrackJSJLDataList(string sData, double dfDS1Show, double dfDS2Show) { trackDataListJSJL sttTrackDataList = new trackDataListJSJL(); string[] split = sData.Trim().Split(new string[] { cProjectData.splitMark }, StringSplitOptions.RemoveEmptyEntries); for (int i = 0; i < split.Length; i = i + 3) { float top = float.Parse(split[i]); float bottom = float.Parse(split[i + 1]); if (dfDS1Show <= top && bottom <= dfDS2Show) { sttTrackDataList.fListDS1.Add(top); sttTrackDataList.fListDS2.Add(bottom); sttTrackDataList.sListJSJL.Add(split[i + 2]); } } return(sttTrackDataList); }
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(); } }