Esempio n. 1
0
 private void tsmiFromSectionWell_Click(object sender, EventArgs e)
 {
     if (sJH != "")
     {
         //根据井号找到单井综合图配置文件路径
         string filePathWellSection = Path.Combine(cProjectManager.dirPathWellDir, sJH, sJH + cProjectManager.fileExtensionSectionWell);
         //加入测井图
         if (File.Exists(filePathWellSection))
         {
             //读取单井文件,读取图道
             string sTrackID_match = "";
             foreach (XmlElement el_Track in cXmlDocSectionWell.getTrackNodes(filePathWellSection))
             {
                 trackDataDraw curTrackDraw = new trackDataDraw(el_Track);
                 if (curTrackDraw.sTrackType == trackTypeStr)
                 {
                     sTrackID_match = curTrackDraw.sTrackID;  //结点name
                     break;
                 }
             }
             if (sTrackID_match != "")
             {
                 initializaForm(filePathWellSection, sTrackID_match);
             }
         }
     }
 }
Esempio n. 2
0
 public FormSectionWellCrossplot(string _filePathOper, string _sIDTrack, float _fTop, float _fBot)
 {
     InitializeComponent();
     filePathOper      = _filePathOper;
     sIDTrack          = _sIDTrack;
     fTop              = _fTop;
     fBot              = _fBot;
     sJH               = cXmlBase.getNodeInnerText(filePathOper, cXmlDocSectionWell.fullPathJH);
     this.nTBXtop.Text = fTop.ToString();
     this.nTBXbot.Text = fBot.ToString();
     if (sIDTrack != "")
     {
         curTrack = cXmlDocSectionWell.getTrackByTrackID(this.filePathOper, sIDTrack);
         if (curTrack != null)
         {
             curTrackDraw      = new trackDataDraw(curTrack);
             rdbTypeValue.Text = curTrackDraw.sTrackTitle;
         }
         else
         {
             rdbTypeValue.Enabled = false;
         }
     }
     else
     {
         rdbTypeValue.Enabled = false;
     }
     initialCbbLog();
 }
Esempio n. 3
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
        }
Esempio n. 4
0
 private void nUDTrackHeadFontSize_ValueChanged(object sender, EventArgs e)
 {
     foreach (XmlElement el_Track in cXmlDocSectionWell.getTrackNodes(xmlPath))
     {
         trackDataDraw curTrackDraw = new trackDataDraw(el_Track);
         string        sIDtrack     = curTrackDraw.sTrackID; //结点name
         cXmlBase.setSelectedNodeChildNodeValue(xmlPath, sIDtrack, "trackHeadFontSize", nUDTrackHeadFontSize.Value.ToString("0"));
     }
 }
Esempio n. 5
0
        private void nUDTrackHeadFontSize_ValueChanged(object sender, EventArgs e)
        {
            //找到所有的单井模板文件,然后更新
            string dirCurrent      = Path.GetDirectoryName(xmlPath);
            string dirWellTemplate = Path.Combine(dirCurrent, Path.GetFileNameWithoutExtension(xmlPath));

            string[] wellFileItems = Directory.GetFiles(dirWellTemplate, "*" + ".xml");
            foreach (string wellFile in wellFileItems)
            {
                foreach (XmlElement el_Track in cXmlDocSectionWell.getTrackNodes(wellFile))
                {
                    trackDataDraw curTrackDraw = new trackDataDraw(el_Track);
                    string        sIDtrack     = curTrackDraw.sTrackID; //结点name
                    cXmlBase.setSelectedNodeChildNodeValue(wellFile, sIDtrack, "trackHeadFontSize", nUDTrackHeadFontSize.Value.ToString("0"));
                }
            }
        }
Esempio n. 6
0
        public static void setupSectionWellChildNode(TreeNode tn, string filePathOper, string sJHSelected)
        {
            //read xml and treeview
            foreach (XmlElement el_Track in cXmlDocSectionWell.getTrackNodes(filePathOper))
            {
                trackDataDraw curTrackDraw = new trackDataDraw(el_Track);
                TreeNode      tnode        = new TreeNode(curTrackDraw.sTrackType, 12, 12);
                tnode.Text = curTrackDraw.sTrackTitle;
                tnode.Name = curTrackDraw.sTrackID;  //结点name
                tnode.Tag  = curTrackDraw.sTrackType;
                tn.Nodes.Add(tnode);
                if (curTrackDraw.iVisible > 0)
                {
                    tnode.Checked = true;
                }
                else
                {
                    tnode.Checked = false;
                }
                if (curTrackDraw.sTrackType == TypeTrack.曲线道.ToString())
                {
                    //继续读取曲线
                    XmlNodeList xnList = el_Track.SelectNodes(".//Log");
                    foreach (XmlElement xnLog in xnList)
                    {
                        string   sLogName = xnLog["logName"].InnerText;
                        TreeNode tnLog    = new TreeNode(sLogName, 5, 5);
                        tnLog.Name = xnLog.Attributes["id"].Value;
                        tnLog.Text = sLogName;
                        tnLog.Tag  = sLogName;

                        string sColor = xnLog["curveColor"].InnerText;
                        tnLog.ForeColor = Color.FromName(sColor);
                        tnode.Nodes.Add(tnLog);
                    }
                }
            }
        }
Esempio n. 7
0
 private void btnDraw_Click(object sender, EventArgs e)
 {
     //获取绘制各个类别的数据系列,根据 sID 和 文件名 获取道内数据
     if (this.rdbTypeValue.Checked == true)
     {
         trackDataDraw curTrackDraw = new trackDataDraw(curTrack);
         XmlNode       dataList     = curTrack.SelectSingleNode("dataList");
         //按类别 选择的测井系列 动态增加数据
         List <ItemTrackDrawDataIntervalProperty> ltDataItem = new List <ItemTrackDrawDataIntervalProperty>();
         if (dataList != null)
         {
             XmlNodeList dataItem = dataList.SelectNodes("dataItem");
             foreach (XmlNode xn in dataItem)
             {
                 ItemTrackDrawDataIntervalProperty item = new ItemTrackDrawDataIntervalProperty(xn);
                 if (item.top >= fTop && item.bot <= fBot)
                 {
                     ltDataItem.Add(item);
                 }
             }
         }
         updateCrossPlot(logX, logY, ltDataItem);
     }
     if (rdbLogValue.Checked == true)
     {
         updateTable(logX, logY);
         //首先得判断对数坐标,左值,右值都能大于0
         if (checkAxieScale())
         {
             updateCrossPlot(logX, logY);
         }
         else
         {
             MessageBox.Show("坐标轴范围不正确。");
         }
     }
 }
Esempio n. 8
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);
        }
Esempio n. 9
0
        public static void setupWellNode(TreeNode tn, string filePathOper)
        {
            //read xml and treeview
            string sJHSelected = cXmlBase.getNodeInnerText(filePathOper, cXmlDocSectionWell.fullPathJH);  //井号从新建窗口读入

            foreach (XmlElement el_Track in cXmlDocSectionWell.getTrackNodes(filePathOper))
            {
                trackDataDraw curTrackDraw = new trackDataDraw(el_Track);
                TreeNode      tnode        = new TreeNode();
                tnode.Text = curTrackDraw.sTrackTitle;
                tnode.Name = curTrackDraw.sTrackID;  //结点name
                tnode.Tag  = curTrackDraw.sTrackType;
                tn.Nodes.Add(tnode);
                if (curTrackDraw.iVisible > 0)
                {
                    tnode.Checked = true;
                }
                else
                {
                    tnode.Checked = false;
                }

                //继续道内数据项
                if (curTrackDraw.sTrackType == TypeTrack.分层.ToString())
                {
                    XmlNodeList xnList = el_Track.SelectNodes(".//dataList/dataItem");
                    foreach (XmlElement xnLayer in xnList)
                    {
                        TreeNode tnLayer = new TreeNode();
                        tnLayer.Name    = xnLayer.Attributes["id"].Value;
                        tnLayer.Text    = xnLayer["sProperty"].InnerText;
                        tnLayer.Tag     = xnLayer["sProperty"].InnerText;
                        tnLayer.Checked = true;
                        tnode.Nodes.Add(tnLayer);
                    }
                }
                if (curTrackDraw.sTrackType == TypeTrack.文本道.ToString())
                {
                    XmlNodeList xnList = el_Track.SelectNodes(".//dataList/dataItem");
                    foreach (XmlElement xn in xnList)
                    {
                        TreeNode tnText = new TreeNode();
                        tnText.Name    = xn.Attributes["id"].Value;
                        tnText.Text    = xn["sText"].InnerText;
                        tnText.Tag     = xn["sText"].InnerText;
                        tnText.Checked = true;
                        tnode.Nodes.Add(tnText);
                    }
                }
                if (cProjectManager.ltStrTrackTypeIntervalProperty.IndexOf(curTrackDraw.sTrackType) >= 0)
                {
                    //继续读取曲线
                    XmlNodeList xnJSJL = el_Track.SelectNodes(".//dataList/dataItem");
                    foreach (XmlElement xn in xnJSJL)
                    {
                        TreeNode tnJSJL = new TreeNode();
                        tnJSJL.Name    = xn.Attributes["id"].Value;
                        tnJSJL.Text    = xn["top"].InnerText + "-" + xn["bot"].InnerText;
                        tnJSJL.Tag     = xn["top"].InnerText + "-" + xn["bot"].InnerText;
                        tnJSJL.Checked = true;
                        tnode.Nodes.Add(tnJSJL);
                    }
                }
                if (curTrackDraw.sTrackType == TypeTrack.曲线道.ToString())
                {
                    //继续读取曲线
                    XmlNodeList xnList = el_Track.SelectNodes(".//Log");
                    foreach (XmlElement xnLog in xnList)
                    {
                        TreeNode tnLog = new TreeNode();
                        tnLog.Name = xnLog.Attributes["id"].Value;
                        tnLog.Text = xnLog["logName"].InnerText;
                        tnLog.Tag  = xnLog["logName"].InnerText;;
                        string sColor      = xnLog["curveColor"].InnerText;
                        int    iLogVisible = int.Parse(xnLog["visible"].InnerText);
                        tnLog.ForeColor = Color.FromName(sColor);
                        tnode.Nodes.Add(tnLog);
                        if (iLogVisible > 0)
                        {
                            tnLog.Checked = true;
                        }
                        else
                        {
                            tnLog.Checked = false;
                        }
                    }
                }
            }//end foreach
        }
Esempio n. 10
0
        public static void makeWellLayerSectionGraph(string filePathTemplatOper, double fTopShow, double fBotShow, double fVScale)
        {
            string        filePathWellsvg = filePathTemplatOper.Replace(".xml", ".svg");
            List <int>    iListTrackWidth = new List <int>();
            List <string> ListLegend      = new List <string>(); //图例
            XmlDocument   curDoc          = new XmlDocument();

            curDoc.Load(filePathTemplatOper);
            string sJH = cXmlBase.getNodeInnerText(curDoc, cXmlDocSectionWell.fullPathJH);

            string sMapTitle = cXmlBase.getNodeInnerText(curDoc, cXEWellPage.fullPathMapTitle);
            //图幅全部用px基本单位,fVScale已经包含了 px-> 到应用单位的转换。
            double dfDS1Show = fTopShow;
            double dfDS2Show = fBotShow;
            double iDx       = 0;

            //这种是上移式图头绘制模式 与 遮盖式图头绘制模式严格位置不同
            double iYpositionTitle = 0;

            double iDy = -dfDS1Show * fVScale;

            int    iShowMode  = int.Parse(cXmlBase.getNodeInnerText(curDoc, cXEWellPage.fullPathShowMode));
            double PageWidth  = 1000;
            double PageHeight = (dfDS2Show - dfDS1Show) * fVScale + 20;
            //以上代码执行2毫秒,不必优化了
            cSVGBaseSection cSingleWell = new cSVGBaseSection(PageWidth, PageHeight, iDx, iDy, "px"); //全部用px 单位转换用算法实现

            iListTrackWidth.Clear();
            XmlElement returnElemment;

            foreach (XmlElement el_Track in cXmlDocSectionWell.getTrackNodes(curDoc))
            {
                //初始化绘制道的基本信息
                trackDataDraw curTrackDraw = new trackDataDraw(el_Track);

                //定义一个新层 装道。 但是 也有问题,会有下面的遮盖问题。

                //先画曲线,再画道头和道框,这样好看
                if (curTrackDraw.iVisible > 0) //判断是否可见,可见才绘制
                {
                    #region 深度道
                    if (curTrackDraw.sTrackType == TypeTrack.深度尺.ToString())
                    {
                        int mainTick     = int.Parse(el_Track["mainScale"].InnerText);
                        int minTick      = int.Parse(el_Track["minScale"].InnerText);
                        int tickFontSize = int.Parse(el_Track["fontSize"].InnerText);
                        returnElemment = cSVGSectionTrackWellRuler.gMDRuler(cSingleWell.svgDoc, cSingleWell.svgDefs, cSingleWell.svgCss, Convert.ToInt16(dfDS1Show), Convert.ToInt16(dfDS2Show), mainTick, minTick, fVScale, tickFontSize);
                        cSingleWell.addgElement2BaseLayer(returnElemment, iListTrackWidth.Sum(), 0);
                    }
                    # endregion
                    # region 文本道
                    if (curTrackDraw.sTrackType == TypeTrack.文本道.ToString())
                    {
                        int iAlignMode = 0;
                        if (el_Track["iAlignMode"] != null)
                        {
                            iAlignMode = int.Parse(el_Track["iAlignMode"].InnerText);
                        }
                        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 = cSVGSectionTrackText.gTrackItemText(cSingleWell.svgDoc, item.sID, item.top, item.bot, fVScale, item.sText, curTrackDraw.iTrackFontSize, iAlignMode, curTrackDraw.iTrackWidth, item.sProperty, curTrackDraw.sWriteMode);
                                    cSingleWell.addgElement2BaseLayer(returnElemment, iListTrackWidth.Sum(), 0);
                                }
                            }
                        }
                    }
                    #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);
                                returnElemment = cSVGSectionTrackSymbol.gTrackIntervalSymbol(cSingleWell.svgDoc, cSingleWell.svgDefs, item, fVScale, curTrackDraw.iTrackWidth);
                                cSingleWell.addgElement2BaseLayer(returnElemment, iListTrackWidth.Sum(), 0);
                            }
                        }
                    }
                    #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);
                                returnElemment = cSVGSectionTrackSymbol.gTrackRatioRect(cSingleWell.svgDoc, item.sID, item.top, item.bot, float.Parse(item.sText), fVScale, curTrackDraw.iTrackWidth, "blue");
                                cSingleWell.addgElement2BaseLayer(returnElemment, iListTrackWidth.Sum(), 0);
                            }
                        }
                    }
                    #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 = cSVGSectionTrackLayer.gTrackItemLayer(cSingleWell.svgDoc, item, fVScale, curTrackDraw.iTrackFontSize, curTrackDraw.iTrackWidth);
                                    cSingleWell.addgElement2BaseLayer(returnElemment, iListTrackWidth.Sum(), 0);
                                }
                            }
                        }
                    }
                    #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);
                                returnElemment = cSVGSectionTrackImage.gTrackImage(cSingleWell.svgDoc, cSingleWell.svgDefs, sJH, item, fVScale, curTrackDraw.iTrackWidth);
                                cSingleWell.addgElement2BaseLayer(returnElemment, iListTrackWidth.Sum(), 0);
                            }
                        }
                    }
                    #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.gTrackLitho(cSingleWell.svgDoc, cSingleWell.svgDefs, item, fVScale, curTrackDraw.iTrackWidth);
                                    cSingleWell.addgElement2BaseLayer(returnElemment, iListTrackWidth.Sum(), 0);
                                }
                            }
                        }
                    }
                    #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.gTrackItemJSJL(cSingleWell.svgDoc, cSingleWell.svgDefs, item, fVScale, curTrackDraw.iTrackWidth);
                                    if (curTrackDraw.sTrackType == TypeTrack.沉积旋回.ToString())
                                    {
                                        returnElemment = cSVGSectionTrackCycle.gTrackGeoCycle(cSingleWell.svgDoc, cSingleWell.svgDefs, item, fVScale, curTrackDraw.iTrackWidth);
                                    }
                                    if (curTrackDraw.sTrackType == TypeTrack.描述.ToString())
                                    {
                                        returnElemment = cSVGSectionTrackDes.gTrackItemFossil(cSingleWell.svgDoc, cSingleWell.svgDefs, item, fVScale, curTrackDraw.iTrackWidth);
                                    }
                                    cSingleWell.addgElement2BaseLayer(returnElemment, iListTrackWidth.Sum(), 0);
                                }
                            }
                        }
                    }
                    #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.gTrackLog(cSingleWell.svgDoc, curLogHead, curTrackDraw.iTrackWidth, dlTrackDataListLog.fListMD, dlTrackDataListLog.fListValue, fVScale);
                                cSingleWell.addgElement2BaseLayer(returnElemment, iListTrackWidth.Sum(), 0);

                                XmlNode nodeData = xnLog.SelectSingleNode("sData");
                            } //曲线可见
                        }     //结束曲线循环
                    }         //结束曲线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);
                            }
                        }
                    }
                    #endregion

                    //道宽List
                    iListTrackWidth.Add(curTrackDraw.iTrackWidth);
                } //if 是否可见
            }     //结束Foreach图道循环绘制