Ejemplo n.º 1
0
        private void btnOK_Click(object sender, EventArgs e)
        {
            float showDepthMDTop = (float)nUDShowedTop.Value;
            float showDepthMDBot = (float)nUDShowedBottom.Value;

            if (rdbEle.Checked == true)
            {
                ItemWell curWell = cProjectData.ltProjectWell.SingleOrDefault(p => p.sJH == sJH);
                if (curWell != null)
                {
                    showDepthMDTop = -showDepthMDTop + curWell.fKB;
                    showDepthMDBot = -showDepthMDBot + curWell.fKB;
                }
            }
            if (showDepthMDBot > showDepthMDTop)
            {
                cXmlBase.setSelectedNodeChildNodeValue(pathSectionCss, sJH, "fShowTop", showDepthMDTop.ToString("0"));
                cXmlBase.setSelectedNodeChildNodeValue(pathSectionCss, sJH, "fShowBot", showDepthMDBot.ToString("0"));
                this.DialogResult = DialogResult.OK;
                this.Close();
            }
            else
            {
                MessageBox.Show("显示底深必须大于顶深。");
            }
        }
Ejemplo n.º 2
0
        /// <summary>
        /// 注意xtmFile
        /// </summary>
        /// <param name="xtlFileName">模板文件名,带扩展名</param>
        /// <param name="goalFilePath">目标文件路径,全路径</param>
        /// <param name="sJH"></param>
        public static void copyTemplate(string xtlFileName, string goalFilePath, string sJH)
        {
            //加载模板
            string xtmPath = Path.Combine(cProjectManager.dirPathTemplate, xtlFileName);

            File.Copy(xtmPath, goalFilePath, true);
            cXmlBase.setNodeInnerText(goalFilePath, cXmlDocSectionWell.fullPathJH, sJH);
            cXmlBase.setNodeInnerText(goalFilePath, cXEWellPage.fullPathMapTitle, sJH);
            //加载曲线数据
            ItemWell curWell = cProjectData.ltProjectWell.FirstOrDefault(p => p.sJH == sJH);

            foreach (XmlElement el_Track in cXmlDocSectionWell.getTrackNodes(goalFilePath))
            {
                trackDataDraw curTrackDraw = new trackDataDraw(el_Track);
                //继续读取曲线,加载数据
                if (curTrackDraw.sTrackType == TypeTrack.分层.ToString())
                {
                    List <itemDrawDataIntervalValue> listDataItem = new List <itemDrawDataIntervalValue>();
                    //判断库中是否有相关数据,如果有数据的话,构建 listDataItem,然后导入
                    cIOinputLayerDepth cSelectLayerDepth = new cIOinputLayerDepth();
                    List <string>      listStrLine       = cSelectLayerDepth.selectSectionDrawData2List(sJH);
                    foreach (string sLine in listStrLine)
                    {
                        string[] splitLine = sLine.Split();
                        if (splitLine.Length >= 3)
                        {
                            itemDrawDataIntervalValue itemPro = new itemDrawDataIntervalValue();
                            itemPro.top       = float.Parse(splitLine[0]);
                            itemPro.bot       = float.Parse(splitLine[1]);
                            itemPro.sProperty = splitLine[2];
                            itemPro.calTVD(curWell);
                            listDataItem.Add(itemPro);
                        }
                    }  //end 第一种类型
                    cXmlDocSectionWell.addDataItemListIntervaProperty(goalFilePath, curTrackDraw.sTrackID, listDataItem);
                }

                if (curTrackDraw.sTrackType == TypeTrack.测井解释.ToString())
                {
                    List <itemDrawDataIntervalValue> listDataItem = new List <itemDrawDataIntervalValue>();
                    //判断库中是否有相关数据,如果有数据的话,构建 listDataItem,然后导入
                    cIOinputJSJL  cSelectJSJL = new cIOinputJSJL();
                    List <string> listStrLine = cSelectJSJL.selectSectionDrawData2List(sJH);
                    foreach (string sLine in listStrLine)
                    {
                        string[] splitLine = sLine.Split();
                        if (splitLine.Length >= 3)
                        {
                            itemDrawDataIntervalValue itemPro = new itemDrawDataIntervalValue();
                            itemPro.top       = float.Parse(splitLine[0]);
                            itemPro.bot       = float.Parse(splitLine[1]);
                            itemPro.sProperty = splitLine[2];
                            itemPro.calTVD(curWell);
                            listDataItem.Add(itemPro);
                        }
                    }  //end 第一种类型
                    cXmlDocSectionWell.addDataItemListIntervaProperty(goalFilePath, curTrackDraw.sTrackID, listDataItem);
                }
            } //end track loop
        }
Ejemplo n.º 3
0
 public static float getTVDByJHAndMD(ItemWell curWell, float fMD)
 {
     if (curWell != null)
     {
         return(getTVDByJHAndMD(curWell.sJH, fMD, curWell.WellPathList));
     }
     else
     {
         return(fMD);
     }
 }
Ejemplo n.º 4
0
        void creatTemplat()
        {
            ItemWell itemWell = cProjectData.ltProjectWell.SingleOrDefault(p => p.sJH == this.sJHSelected);

            if (itemWell != null)
            {
                dfDS2Show = itemWell.fWellBase;
            }
            //建立样式模板
            cXmlDocSectionWell.generateXML(filePathOper, this.sJHSelected, dfDS1Show, dfDS2Show, fVscale);
            addTrackCss(TypeTrack.深度尺);
        }
Ejemplo n.º 5
0
 public void calTVD(ItemWell curWell)
 {
     if (curWell == null)
     {
         topTVD = this.top;
         botTVD = this.bot;
     }
     else
     {
         topTVD = cIOinputWellPath.getTVDByJHAndMD(curWell, this.top);
         botTVD = cIOinputWellPath.getTVDByJHAndMD(curWell, this.bot);
     }
 }
Ejemplo n.º 6
0
        public static List <wellDis> orderByWelldistance(string sJH)
        {
            List <string> listJH      = new List <string>();
            ItemWell      currentWell = cProjectData.ltProjectWell.Find(p => p.sJH == sJH);

            List <wellDis> ltWells = new List <wellDis>();

            foreach (ItemWell item in cProjectData.ltProjectWell)
            {
                double  dfDis   = cCalDistance.calDistance2D(currentWell.dbX, currentWell.dbY, item.dbX, item.dbY);
                wellDis newItem = new wellDis();
                newItem.sJH      = item.sJH;
                newItem.distance = dfDis;
                ltWells.Add(newItem);
            }
            return(ltWells.OrderBy(p => p.distance).ToList());
        }
Ejemplo n.º 7
0
 private void cbxShowWellBase_CheckedChanged(object sender, EventArgs e)
 {
     if (cbxShowWellBase.Checked == true)
     {
         ItemWell curWell = cProjectData.ltProjectWell.SingleOrDefault(p => p.sJH == sJH);
         if (curWell != null)
         {
             if (rdbMD.Checked == true)
             {
                 nUDShowedBottom.Value = (decimal)curWell.fWellBase;
             }
             if (rdbEle.Checked == true)
             {
                 nUDShowedBottom.Value = (decimal)(-curWell.fWellBase + curWell.fKB);
             }
         }
     }
 }
Ejemplo n.º 8
0
        private void webBrowserBody_DocumentCompleted(object sender, WebBrowserDocumentCompletedEventArgs e)
        {
            // 定位上次页面位置
            htmlDocWebBody = webBrowserBody.Document;
            if (htmlDocWebBody != null)
            {
                curPage.initial(this.filePathTemple);
                fVscale = float.Parse(cXmlBase.getNodeInnerText(this.filePathTemple, cXEWellPage.fullPathVSacle));
                string sJH = cXmlBase.getNodeInnerText(filePathTemple, cXmlDocSectionWell.fullPathJH);
                curWell = cProjectData.ltProjectWell.FirstOrDefault(p => p.sJH == sJH);
                if (webBrowserBody.Url == e.Url)
                {
                    //记录元素的位置,实现刷新页面自动滚动
                    webBrowserBody.Document.Window.ScrollTo(PscrollOffset);
                    //Head 水平相同,
                    webBrowserHead.Document.Window.ScrollTo(PscrollOffset.X, 0);
                }

                //清除webHead的所有事件
                if (htmlDocWebHead != null)
                {
                    htmlDocWebHead.MouseMove -= htmlDocHead_MouseMove;
                    htmlDocWebHead.MouseDown -= htmlDocHead_MouseDown;
                    htmlDocWebHead.MouseUp   -= htmlDocHead_MouseUp;
                }

                htmlDocWebBody.Window.DetachEventHandler("onscroll", OnScrollEventHandler);
                htmlDocWebBody.Window.AttachEventHandler("onscroll", OnScrollEventHandler);

                htmlDocWebBody.MouseMove -= htmlDocBody_MouseMove;
                htmlDocWebBody.MouseMove += htmlDocBody_MouseMove;

                htmlDocWebBody.MouseDown -= htmlDocBody_MouseDown;
                htmlDocWebBody.MouseDown += htmlDocBody_MouseDown;
            }
        }
Ejemplo n.º 9
0
        public static cSVGSectionWell makePathWell(cSVGDocSection svgSection, string pathSectionCss, string filePathTemplatOper, double dfDS1Show, double dfDS2Show, float fVScale, cXEGeopage curPage)
        {
            cSVGSectionWell wellGeoSingle   = new cSVGSectionWell(svgSection.svgDoc);
            List <int>      iListTrackWidth = new List <int>();
            //从配置文件读取显示深度
            string sJH = cXmlBase.getNodeInnerText(filePathTemplatOper, cXmlDocSectionWell.fullPathJH);
            //绝对值不放大fvscale,位置放大。
            ItemWell wellItem         = cProjectData.ltProjectWell.FirstOrDefault(p => p.sJH == sJH);
            int      iHeightMapTitle  = int.Parse(cXmlBase.getNodeInnerText(filePathTemplatOper, cXEWellPage.fullPathMapTitleRectHeight));
            int      iHeightTrackHead = int.Parse(cXmlBase.getNodeInnerText(filePathTemplatOper, cXEWellPage.fullPathTrackRectHeight));

            iListTrackWidth.Clear();
            XmlElement returnElemment;

            float dfDS1ShowTVD = cIOinputWellPath.getTVDByJHAndMD(wellItem, (float)dfDS1Show);

            int iYpositionTrackHead = Convert.ToInt16(dfDS1ShowTVD * fVScale) - iHeightTrackHead;

            foreach (XmlElement el_Track in cXmlDocSectionWell.getTrackNodes(filePathTemplatOper))
            {
                //初始化绘制道的基本信息
                trackDataDraw curTrackDraw = new trackDataDraw(el_Track);
                //增加道头
                returnElemment = cSVGSectionTrack.trackHead(svgSection.svgDoc, curTrackDraw.sTrackID, curTrackDraw.sTrackTitle, iYpositionTrackHead, iHeightTrackHead, curTrackDraw.iTrackWidth, curTrackDraw.iTrackHeadFontSize, curTrackDraw.sWriteMode);
                wellGeoSingle.addTrack(returnElemment, iListTrackWidth.Sum());

                //增加距离位置节点
                cXmlDocSectionGeo.addWellTrackXviewNode(pathSectionCss, sJH, curTrackDraw.sTrackID, iListTrackWidth.Sum());
                //先画曲线,再画道头和道框,这样好看
                #region  判断是否可见,可见才绘制
                if (curTrackDraw.iVisible > 0)
                {
                    #region 井深结构尺
                    if (el_Track["trackType"].InnerText == TypeTrack.深度尺.ToString())
                    {
                        itemDrawDataDepthRuler itemRuler = new itemDrawDataDepthRuler(el_Track);
                        //测试斜井gPathWellCone
                        returnElemment = cSVGSectionTrackWellRuler.gPathWellRuler(wellItem, svgSection, Convert.ToInt16(dfDS1Show), Convert.ToInt16(dfDS2Show), fVScale, itemRuler);
                        wellGeoSingle.addTrack(returnElemment, iListTrackWidth.Sum());
                    }
                    #endregion
                    #region 地层道
                    if (curTrackDraw.sTrackType == TypeTrack.分层.ToString())
                    {
                        XmlNode dataList = el_Track.SelectSingleNode("dataList");
                        if (dataList != null)
                        {
                            XmlNodeList dataItem = dataList.SelectNodes("dataItem");
                            foreach (XmlNode xn in dataItem)
                            {
                                ItemTrackDrawDataIntervalProperty item = new ItemTrackDrawDataIntervalProperty(xn);
                                if (item.top >= dfDS1Show && item.bot <= dfDS2Show)
                                {
                                    returnElemment = cSVGSectionTrackLayer.gTrackItemTVDLayer(svgSection.svgDoc, item, fVScale, curTrackDraw.iTrackFontSize, curTrackDraw.iTrackWidth);
                                    wellGeoSingle.addTrack(returnElemment, iListTrackWidth.Sum());
                                }
                            }
                        }
                    }
                    #endregion
                    #region 测井解释,旋回,化石道
                    if (cProjectManager.ltStrTrackTypeIntervalProperty.IndexOf(curTrackDraw.sTrackType) >= 0)
                    {
                        XmlNode dataList = el_Track.SelectSingleNode("dataList");
                        if (dataList != null)
                        {
                            XmlNodeList dataItem = dataList.SelectNodes("dataItem");
                            foreach (XmlNode xn in dataItem)
                            {
                                ItemTrackDrawDataIntervalProperty item = new ItemTrackDrawDataIntervalProperty(xn); if (item.top >= dfDS1Show && item.bot <= dfDS2Show)
                                {
                                    returnElemment = cSVGSectionTrackJSJL.gTrackItemTVDJSJL(svgSection.svgDoc, svgSection.svgDefs, item, fVScale, curTrackDraw.iTrackWidth);
                                    if (curTrackDraw.sTrackType == TypeTrack.沉积旋回.ToString())
                                    {
                                        returnElemment = cSVGSectionTrackCycle.gTrackItemTVDGeoCycle(svgSection.svgDoc, svgSection.svgDefs, item, fVScale, curTrackDraw.iTrackWidth);
                                    }
                                    //     if (curTrackDraw.sTrackType == TypeTrack.描述.ToString()) returnElemment = cSVGSectionTrackDes.gTrackItemFossil(svgSection.svgDoc, svgSection.svgDefs, item, fVScale, curTrackDraw.iTrackWidth);
                                    wellGeoSingle.addTrack(returnElemment, iListTrackWidth.Sum());
                                }
                            }
                        }
                    }
                    #endregion
                    #region 岩性
                    if (curTrackDraw.sTrackType == TypeTrack.岩性层段.ToString())
                    {
                        XmlNode dataList = el_Track.SelectSingleNode("dataList");
                        if (dataList != null)
                        {
                            XmlNodeList dataItem = dataList.SelectNodes("dataItem");
                            foreach (XmlNode xn in dataItem)
                            {
                                itemDrawDataIntervalValue item = new itemDrawDataIntervalValue(xn);
                                if (item.top >= dfDS1Show && item.bot <= dfDS2Show)
                                {
                                    returnElemment = cSVGSectionTrackLitho.gTrackLithoTVDItem(wellItem, svgSection.svgDoc, svgSection.svgDefs, item, fVScale, curTrackDraw.iTrackWidth);
                                    wellGeoSingle.addTrack(returnElemment, iListTrackWidth.Sum());
                                }
                            }
                        }
                    }
                    #endregion
                    #region 曲线道
                    List <itemLogHeadInforDraw> ltItemLogHeadInforDraw = new List <itemLogHeadInforDraw>(); //记录绘制道头用,节省重新读取的时间
                    if (curTrackDraw.sTrackType == TypeTrack.曲线道.ToString())
                    {
                        cSVGSectionTrackLogCurveFill.listLogViewData4fill.Clear();
                        XmlNodeList xnList  = el_Track.SelectNodes(".//Log");
                        int         iLogNum = 0;
                        bool        bGrid   = false; //记录网格是否绘制过。
                        foreach (XmlElement xnLog in xnList)
                        {
                            iLogNum++;
                            itemLogHeadInforDraw curLogHead = new itemLogHeadInforDraw(xnLog);
                            ltItemLogHeadInforDraw.Add(curLogHead);
                            if (curLogHead.iIsLog > 0)
                            {
                                if (curLogHead.fLeftValue <= 0)
                                {
                                    curLogHead.fLeftValue = 1;
                                    cXmlBase.setSelectedNodeChildNodeValue(filePathTemplatOper, "", "leftValue", "1");
                                }
                                curLogHead.iLogGridGrade = cSVGSectionTrackLog.getNumGridGroupInLog(curLogHead.fLeftValue, curLogHead.fRightValue);
                            }

                            //曲线是否可见
                            if (curLogHead.iLogCurveVisible > 0)
                            {
                                trackDataListLog dlTrackDataListLog = cSVGSectionTrackLog.getLogSeriersFromLogFile(sJH, curLogHead.sLogName, dfDS1Show, dfDS2Show);

                                //画曲线
                                returnElemment = cSVGSectionTrackLog.gTrackTVDLog(wellItem, svgSection.svgDoc, curLogHead, curTrackDraw.iTrackWidth, dlTrackDataListLog.fListMD, dlTrackDataListLog.fListValue, fVScale);
                                wellGeoSingle.addTrack(returnElemment, iListTrackWidth.Sum());
                            } //曲线可见
                        }     //结束曲线循环
                    }         //结束曲线if
                    #endregion 结束曲线道
                    #region 绘制测井图头,测井图信息很重要,图形加载数据要捕捉测井头的ID
                    if (curTrackDraw.sTrackType == TypeTrack.曲线道.ToString())
                    {
                        int iLogNum = 0;
                        foreach (itemLogHeadInforDraw curLogHead in ltItemLogHeadInforDraw)
                        {
                            iLogNum++;
                            if (curLogHead.iIsLog > 0)
                            {
                                if (curLogHead.fLeftValue <= 0)
                                {
                                    curLogHead.fLeftValue = 1;
                                }
                                curLogHead.iLogGridGrade = cSVGSectionTrackLog.getNumGridGroupInLog(curLogHead.fLeftValue, curLogHead.fRightValue);
                            }
                            if (curLogHead.iLogCurveVisible > 0)
                            {
                                //增加测井头
                                int iHeadLogSize = 14;
                                returnElemment = cSVGSectionTrack.addTrackItemLogHeadInfor(svgSection.svgDoc, curLogHead, iYpositionTrackHead + iHeightTrackHead, iLogNum, curTrackDraw.iTrackWidth, iHeadLogSize);
                                wellGeoSingle.addTrack(returnElemment, iListTrackWidth.Sum());
                            }
                        }
                    }
                    #endregion
                    //绘制道框
                    if (curPage.iShowTrackRect == 1)
                    {
                        returnElemment = cSVGSectionTrack.trackRect(svgSection.svgDoc, curTrackDraw.sTrackID, dfDS1ShowTVD, dfDS2Show, fVScale, curTrackDraw.iTrackWidth);
                        wellGeoSingle.addTrack(returnElemment, iListTrackWidth.Sum());
                    }
                    iListTrackWidth.Add(curTrackDraw.iTrackWidth);
                }
                #endregion
            } //end of for add track
            //增加图头
            returnElemment = wellGeoSingle.mapHeadTitle(sJH, iYpositionTrackHead - iHeightMapTitle, iYpositionTrackHead, iHeightMapTitle, iListTrackWidth.Sum(), iHeightMapTitle * 2 / 3);
            wellGeoSingle.addTrack(returnElemment, 0);
            return(wellGeoSingle);
        }
Ejemplo n.º 10
0
        public void readDataGridView2ListData(DataGridView dgv)
        {
            listDataItem.Clear();
            ItemWell curWell = cProjectData.ltProjectWell.FirstOrDefault(p => p.sJH == this.sJH);

            for (int i = 0; i < dgv.RowCount; i++)
            {
                bool bDataCorrect = true;
                //根据不同类型赋缺省值
                if (trackTypeStr == TypeTrack.符号.ToString())
                {
                    if (dgv.Rows[i].Cells[2].Value == null)
                    {
                        dgv.Rows[i].Cells[2].Value = "半工字";
                    }
                    if (dgv.Rows[i].Cells[3].Value == null)
                    {
                        dgv.Rows[i].Cells[3].Value = " ";
                    }
                }
                for (int j = 0; j < dgv.ColumnCount; j++)
                {
                    if (dgv.Rows[i].Cells[j].Value == null || dgv.Rows[i].Cells[j].Value.ToString() == "")
                    {
                        bDataCorrect = false;
                        break;
                    }
                }

                if (bDataCorrect == false)
                {
                    //抛弃空值行
                }
                else if (trackTypeStr == TypeTrack.分层.ToString() ||
                         trackTypeStr == TypeTrack.测井解释.ToString() ||
                         trackTypeStr == TypeTrack.含油级别.ToString() ||
                         trackTypeStr == TypeTrack.沉积旋回.ToString() ||
                         trackTypeStr == TypeTrack.比例条.ToString()
                         )
                {
                    itemDrawDataIntervalValue itemPro = new itemDrawDataIntervalValue();
                    itemPro.top       = float.Parse(dgv.Rows[i].Cells[0].Value.ToString());
                    itemPro.bot       = float.Parse(dgv.Rows[i].Cells[1].Value.ToString());
                    itemPro.sProperty = dgv.Rows[i].Cells[2].Value.ToString();
                    itemPro.calTVD(curWell);
                    listDataItem.Add(itemPro);
                }  //end 第一种类型

                else if (trackTypeStr == TypeTrack.岩性层段.ToString() ||
                         trackTypeStr == TypeTrack.描述.ToString() ||
                         trackTypeStr == TypeTrack.符号.ToString()
                         )
                {
                    itemDrawDataIntervalValue itemPro = new itemDrawDataIntervalValue();
                    itemPro.top       = float.Parse(dgv.Rows[i].Cells[0].Value.ToString());
                    itemPro.bot       = float.Parse(dgv.Rows[i].Cells[1].Value.ToString());
                    itemPro.sProperty = dgv.Rows[i].Cells[2].Value.ToString();
                    itemPro.sText     = dgv.Rows[i].Cells[3].Value.ToString();
                    itemPro.calTVD(curWell);
                    listDataItem.Add(itemPro);
                }
                else if (trackTypeStr == TypeTrack.文本道.ToString())
                {
                    itemDrawDataIntervalValue itemPro = new itemDrawDataIntervalValue();
                    itemPro.top       = float.Parse(dgv.Rows[i].Cells[0].Value.ToString());
                    itemPro.bot       = float.Parse(dgv.Rows[i].Cells[1].Value.ToString());
                    itemPro.sProperty = "none";
                    itemPro.sText     = dgv.Rows[i].Cells[2].Value.ToString();
                    itemPro.calTVD(curWell);
                    listDataItem.Add(itemPro);
                }
            }
        }
Ejemplo n.º 11
0
 public static ItemDicWellPath getWellPathItemByJHAndMD(ItemWell curWell, float fMD) //算法需要验证和改进
 {
     return(getWellPathItemByJHAndMD(curWell.WellPathList, (float)fMD));
 }
Ejemplo n.º 12
0
 public ItemTrackDataIntervalProperty(ItemWell curWell) : this()
 {
     calTVD(curWell);
 }