Exemplo n.º 1
0
        public static XmlElement gWellHead(XmlDocument svgDoc, string sJH, double xView, double yView, int iFontSize)
        {
            XmlElement gWellHead = svgDoc.CreateElement("g");

            XmlElement text = svgDoc.CreateElement("text");

            text.SetAttribute("x", xView.ToString());
            text.SetAttribute("y", yView.ToString());
            text.SetAttribute("fill", "black");
            text.SetAttribute("text-anchor", "middle");
            text.SetAttribute("dominant-baseline", "middle");
            text.SetAttribute("font-size", iFontSize.ToString());
            text.SetAttribute("style", "strole-width:1");
            text.InnerText = sJH;
            gWellHead.AppendChild(text);


            //填充颜色
            int      iWellType = 0;
            ItemWell curWell   = cProjectData.ltProjectWell.Single(p => p.sJH == sJH);

            if (curWell != null)
            {
                iWellType = curWell.iWellType;
            }
            string m_colorWell = "none";

            switch (iWellType)
            {
            case 1:
                m_colorWell = "red";
                break;

            case 3:
                m_colorWell = "red";
                break;

            case 5:
                m_colorWell = "Gold";
                break;

            case 15:
                m_colorWell = "blue";
                break;

            default:
                break;
            }

            XmlElement circleHead = svgDoc.CreateElement("circle");

            circleHead.SetAttribute("cx", xView.ToString());
            circleHead.SetAttribute("cy", yView.ToString());
            circleHead.SetAttribute("r", "5");
            circleHead.SetAttribute("stroke", "black");
            circleHead.SetAttribute("fill", m_colorWell);
            gWellHead.AppendChild(circleHead);
            return(gWellHead);
        }
Exemplo n.º 2
0
        public static XmlElement gTrackTVDLog(ItemWell curWell, XmlDocument svgDoc, itemLogHeadInforDraw item, int iTrackwidth, List <double> fListDepthInput, List <double> fListValue, double fVScale)
        {
            List <double> fListDepthTVD = new List <double>();

            for (int i = 0; i < fListDepthInput.Count; i++)
            {
                fListDepthTVD.Add(cIOinputWellPath.getTVDByJHAndMD(curWell, (float)fListDepthInput[i]));
            }
            return(gTrackLog(svgDoc, item, iTrackwidth, fListDepthTVD, fListValue, fVScale));
        }
Exemplo n.º 3
0
 public static XmlElement gWellSecionRuler(ItemWell curWell, cSVGBaseSection cSVG_Well, double minMesureDepth, double maxMesureDepth, double dfVscale, itemDrawDataDepthRuler itemRuler)
 {
     if (itemRuler.iTypeRuler == 1)
     {
         return(gMDTVDRuler(curWell, cSVG_Well.svgDoc, cSVG_Well.svgDefs, cSVG_Well.svgCss, minMesureDepth, maxMesureDepth, itemRuler.mainTick, itemRuler.minTick, dfVscale, itemRuler.tickFontSize));
     }
     else
     {
         return(gMDRuler(cSVG_Well.svgDoc, cSVG_Well.svgDefs, cSVG_Well.svgCss, minMesureDepth, maxMesureDepth, itemRuler.mainTick, itemRuler.minTick, dfVscale, itemRuler.tickFontSize));
     }
 }
Exemplo n.º 4
0
 public static XmlElement gPathWellRuler(ItemWell curWell, cSVGBaseSection cSVG_Well, double minMesureDepth, double maxMesureDepth, double dfVscale, itemDrawDataDepthRuler itemRuler)
 {
     //与单井模式相反,单井是把垂深转md,这里是0相反。
     if (itemRuler.iTypeRuler == 0)
     {
         return(gPathWellRuler(curWell, cSVG_Well.svgDoc, cSVG_Well.svgDefs, minMesureDepth, maxMesureDepth, itemRuler.mainTick, itemRuler.minTick, dfVscale, itemRuler.tickFontSize));
     }
     else
     {
         return(gMDRuler(cSVG_Well.svgDoc, cSVG_Well.svgDefs, cSVG_Well.svgCss, minMesureDepth, maxMesureDepth, itemRuler.mainTick, itemRuler.minTick, dfVscale, itemRuler.tickFontSize));
     }
 }
Exemplo n.º 5
0
        public static XmlElement gWellsPosition(XmlDocument svgDoc, List <ItemWellMapPosition> listMapLayerWell, string sID, cXEWellCss wellCss, cXELayerPage curPage)
        {
            XmlElement gWellPositon = svgDoc.CreateElement("g");

            gWellPositon.SetAttribute("id", sID);
            foreach (ItemWellMapPosition item in listMapLayerWell)
            {
                //如果缺失本层的分层数据, 采用井头的数据作为井位,此处可以选用上一层的数据,这块可以在初始化绘图List数据时采用
                //配置文件内 显示所有井位1 显示当然层井 iShowAll = 0;
                if (curPage.iShowAllJH == 1 && item.dbX == 0)
                {
                    ItemWell curWell = cProjectData.ltProjectWell.SingleOrDefault(p => p.sJH == item.sJH);
                    if (curWell != null)
                    {
                        item.dbX = curWell.dbX;
                        item.dbY = curWell.dbY;
                    }
                }
                Point pointConvert2View = cCordinationTransform.transRealPointF2ViewPoint(item.dbX, item.dbY, curPage.xRef, curPage.yRef, curPage.dfscale);
                gWellPositon.AppendChild(gWell(svgDoc, item.sJH, pointConvert2View.X, pointConvert2View.Y, item.iWellType,
                                               wellCss.iFontSizeJH, wellCss.iRadis, wellCss.iCirlceWidth, wellCss.DX_JHText, wellCss.DY_JHText));
            }
            return(gWellPositon);
        }
Exemplo n.º 6
0
        public static XmlElement gPathWellTVDRuler(ItemWell curWell, XmlDocument svgDoc, XmlElement svgDefs, double minMesureDepth, double maxMesureDepth,
                                                   int m_tickInveral_main, int m_tickInveral_min, double dfVscale, int iTickFontSize)
        {
            string     sJH       = curWell.sJH;
            XmlElement gWellCone = svgDoc.CreateElement("g");

            gWellCone.SetAttribute("stroke", "black");
            gWellCone.SetAttribute("stroke-width", "1");
            List <double>          ltMainMD          = new List <double>();
            List <string>          ltStrMainTickText = new List <string>();
            List <double>          ltdfminTickDepth  = new List <double>();
            List <ItemDicWellPath> listWellPath      = curWell.WellPathList;

            //主tick和标识
            int iStartMainDepth = (Convert.ToInt16(minMesureDepth) / m_tickInveral_main + 1) * m_tickInveral_main;

            while (iStartMainDepth <= maxMesureDepth)
            {
                ltMainMD.Add(iStartMainDepth);
                ltStrMainTickText.Add(iStartMainDepth.ToString());
                iStartMainDepth = iStartMainDepth + m_tickInveral_main;
            }

            string _pointWellPath = "";

            for (int i = 0; i < ltMainMD.Count; i++)
            {
                //md 换成 tvd
                ItemDicWellPath currentWellPath = cIOinputWellPath.getWellPathItemByJHAndMD(curWell, (float)ltMainMD[i]);
                double          _x0             = 0;
                double          _y0             = dfVscale * currentWellPath.f_TVD;
                _pointWellPath = _pointWellPath + _x0.ToString() + ',' + _y0.ToString() + " ";
                if (currentWellPath.f_incl <= 60)
                {
                    XmlElement gDepthTick = svgDoc.CreateElement("path");
                    string     d          = "M " + _x0.ToString() + " " + _y0.ToString() + " h 3 ";
                    gDepthTick.SetAttribute("d", d);
                    gWellCone.AppendChild(gDepthTick);

                    XmlElement gTickText = svgDoc.CreateElement("text");
                    gTickText.SetAttribute("x", (_x0 + 3).ToString());
                    gTickText.SetAttribute("y", _y0.ToString());
                    gTickText.SetAttribute("font-size", iTickFontSize.ToString());
                    gTickText.SetAttribute("stroke-width", "0.2");
                    gTickText.InnerText = ltMainMD[i].ToString();
                    gWellCone.AppendChild(gTickText);
                }
                else
                {
                    XmlElement gDepthTick = svgDoc.CreateElement("path");
                    string     d          = "M " + _x0.ToString() + " " + _y0.ToString() + " v 1 ";
                    gDepthTick.SetAttribute("d", d);
                    gWellCone.AppendChild(gDepthTick);

                    XmlElement gTickText = svgDoc.CreateElement("text");
                    gTickText.SetAttribute("x", _x0.ToString());
                    gTickText.SetAttribute("y", (_y0 + 1).ToString());
                    gTickText.SetAttribute("font-size", "2");
                    gTickText.SetAttribute("stroke-width", "0.2");//transform="translate(200,100)rotate(180)"
                    gTickText.SetAttribute("glyph-orientation-vertical", "90");
                    //  string rotate = "translate(" + _x0.ToString() + " " + _y0.ToString() + ")rotate(90)";
                    gTickText.SetAttribute("writing-mode", "tb");
                    gTickText.SetAttribute("letter-spacing", "-0.1");
                    gTickText.InnerText = ltMainMD[i].ToString();
                    gWellCone.AppendChild(gTickText);
                }
            }

            XmlElement gWellPath = svgDoc.CreateElement("polyline");

            gWellPath.SetAttribute("style", "stroke-width:1");
            gWellPath.SetAttribute("stroke", "black");
            gWellPath.SetAttribute("fill", "none");
            gWellPath.SetAttribute("points", _pointWellPath);
            gWellCone.AppendChild(gWellPath);


            return(gWellCone);
        }
Exemplo n.º 7
0
        public static XmlElement gPathWellRuler(ItemWell curWell, XmlDocument svgDoc, XmlElement svgDefs, double minMesureDepth, double maxMesureDepth,
                                                int m_tickInveral_main, int m_tickInveral_min, double dfVscale, int iTickFontSize)
        {
            string sJH = curWell.sJH;

            if (minMesureDepth > maxMesureDepth)
            {
                double temp = minMesureDepth;
                minMesureDepth = maxMesureDepth;
                maxMesureDepth = temp;
            }
            if (maxMesureDepth >= curWell.fWellBase)
            {
                maxMesureDepth = curWell.fWellBase;
            }
            XmlElement gWellCone = svgDoc.CreateElement("g");

            gWellCone.SetAttribute("stroke", "black");
            gWellCone.SetAttribute("stroke-width", "1");
            List <double>          ltMainMD          = new List <double>();
            List <string>          ltStrMainTickText = new List <string>();
            List <double>          ltdfminTickDepth  = new List <double>();
            List <ItemDicWellPath> listWellPath      = curWell.WellPathList;
            //主tick和标识
            int iStartMainDepth = (Convert.ToInt16(minMesureDepth) / m_tickInveral_main) * m_tickInveral_main;

            while (iStartMainDepth <= maxMesureDepth)
            {
                ltMainMD.Add(iStartMainDepth);
                ltStrMainTickText.Add(iStartMainDepth.ToString());
                iStartMainDepth = iStartMainDepth + m_tickInveral_main;
            }

            double dx0            = 0;
            double dy0            = 0;
            int    iTinyTickValue = cPublicMethodBase.getCeilingNumer(minMesureDepth, m_tickInveral_min);

            if (ltMainMD.Count > 0)
            {
                while (iTinyTickValue <= ltMainMD.Last())
                {
                    ltdfminTickDepth.Add(iTinyTickValue);
                    iTinyTickValue = iTinyTickValue + m_tickInveral_min;
                }
                ItemDicWellPath topWellPath = new ItemDicWellPath();
                if (ltdfminTickDepth.Count > 0)
                {
                    topWellPath = cIOinputWellPath.getWellPathItemByJHAndMD(curWell, (float)ltdfminTickDepth[0]);
                }
                dx0 = topWellPath.f_dx;
                dy0 = dfVscale * topWellPath.f_TVD;

                for (int i = 1; i < ltdfminTickDepth.Count; i++)
                {
                    //md 换成 tvd
                    ItemDicWellPath currentWellPath = cIOinputWellPath.getWellPathItemByJHAndMD(curWell, (float)ltdfminTickDepth[i]);
                    double          dx = currentWellPath.f_dx - dx0;
                    double          dy = dfVscale * currentWellPath.f_TVD;
                    if (currentWellPath.f_incl <= 80)
                    {
                        XmlElement gDepthTick = svgDoc.CreateElement("path");
                        string     d          = "M " + dx.ToString() + " " + dy.ToString() + " h 3 ";
                        gDepthTick.SetAttribute("d", d);
                        gWellCone.AppendChild(gDepthTick);
                    }
                }
            }


            string _pointWellPath = "";

            for (int i = 0; i < ltMainMD.Count; i++)
            {
                //md 换成 tvd
                ItemDicWellPath currentWellPath = cIOinputWellPath.getWellPathItemByJHAndMD(curWell, (float)ltMainMD[i]);
                double          dx = currentWellPath.f_dx - dx0;
                double          dy = dfVscale * currentWellPath.f_TVD;
                _pointWellPath = _pointWellPath + dx.ToString() + ',' + dy.ToString() + " ";
                if (currentWellPath.f_incl <= 80)
                {
                    XmlElement gDepthTick = svgDoc.CreateElement("path");
                    string     d          = "M " + dx.ToString() + " " + dy.ToString() + " h 5 ";
                    gDepthTick.SetAttribute("d", d);
                    gWellCone.AppendChild(gDepthTick);
                    if (i > 0) //第一个不标注
                    {
                        XmlElement gTickText = svgDoc.CreateElement("text");
                        gTickText.SetAttribute("x", (dx + 5).ToString());
                        gTickText.SetAttribute("y", (dy + 10).ToString());
                        gTickText.SetAttribute("font-size", iTickFontSize.ToString());
                        //   gTickText.SetAttribute("stroke-width", "0.5");//transform="translate(200,100)rotate(180)"
                        gTickText.SetAttribute("stroke", "black");
                        gTickText.InnerText = ltMainMD[i].ToString();
                        gWellCone.AppendChild(gTickText);
                    }
                }
                else
                {
                    XmlElement gDepthTick = svgDoc.CreateElement("path");
                    string     d          = "M " + dx.ToString() + " " + dy.ToString() + " v 1 ";
                    gDepthTick.SetAttribute("d", d);
                    gWellCone.AppendChild(gDepthTick);

                    XmlElement gTickText = svgDoc.CreateElement("text");
                    gTickText.SetAttribute("x", dx.ToString());
                    gTickText.SetAttribute("y", (dy + 1).ToString());
                    gTickText.SetAttribute("font-size", "6");
                    gTickText.SetAttribute("stroke-width", "0.5");//transform="translate(200,100)rotate(180)"
                    gTickText.SetAttribute("glyph-orientation-vertical", "90");
                    //  string rotate = "translate(" + _x0.ToString() + " " + _y0.ToString() + ")rotate(90)";
                    gTickText.SetAttribute("writing-mode", "tb");
                    gTickText.SetAttribute("letter-spacing", "-0.1");
                    gTickText.InnerText = ltMainMD[i].ToString();
                    gWellCone.AppendChild(gTickText);
                }
            }

            XmlElement gWellPath = svgDoc.CreateElement("polyline");

            gWellPath.SetAttribute("style", "stroke-width:1");
            gWellPath.SetAttribute("stroke", "black");
            gWellPath.SetAttribute("fill", "none");
            gWellPath.SetAttribute("points", _pointWellPath);
            gWellCone.AppendChild(gWellPath);


            return(gWellCone);
        }
Exemplo n.º 8
0
        public static XmlElement gMDTVDRuler(ItemWell curWell, XmlDocument svgDoc, XmlElement svgDefs, XmlElement svgCss, double minMesureDepth, double maxMesureDepth, int m_tickInveral_main, int m_tickInveral_min, double dfVscale, int iTickFontSize)
        {
            List <double> ltdfMainTickDepth = new List <double>();
            List <string> ltStrMainTickText = new List <string>();
            List <double> ltdfminTickDepth  = new List <double>();
            //主tick和标识
            int iStartMainDepth = (Convert.ToInt16(minMesureDepth) / m_tickInveral_main) * m_tickInveral_main;

            while (iStartMainDepth <= maxMesureDepth)
            {
                float fMD = cIOinputWellPath.getMDByJHAndTVD(curWell.sJH, iStartMainDepth, curWell.WellPathList);
                if (fMD >= maxMesureDepth)
                {
                    break;
                }
                ltdfMainTickDepth.Add(fMD);
                ltStrMainTickText.Add(iStartMainDepth.ToString());
                iStartMainDepth = iStartMainDepth + m_tickInveral_main;
            }
            int iTinyTickValue = cPublicMethodBase.getCeilingNumer(minMesureDepth, m_tickInveral_min);

            while (iTinyTickValue <= maxMesureDepth)
            {
                float fMD = cIOinputWellPath.getMDByJHAndTVD(curWell.sJH, iTinyTickValue, curWell.WellPathList);
                if (fMD >= maxMesureDepth)
                {
                    break;
                }
                ltdfminTickDepth.Add(fMD);
                iTinyTickValue = iTinyTickValue + m_tickInveral_min;
            }
            List <double> ltdfViewMainTickDepth = cSVGBase.transformListVscale(ltdfMainTickDepth, dfVscale);
            XmlElement    gMDRuler = svgDoc.CreateElement("g");

            gMDRuler.SetAttribute("id", cIDmake.idTrackRuler());
            //主tick和标识
            for (int i = 0; i < ltdfViewMainTickDepth.Count; i++)
            {
                XmlElement gDepthTick = svgDoc.CreateElement("use");
                gDepthTick.SetAttribute("x", "0");
                gDepthTick.SetAttribute("y", ltdfViewMainTickDepth[i].ToString());
                gDepthTick.SetAttribute("href", cSVGBase.svgNS, "#" + cIDmake.idDepthTickMain);
                gMDRuler.AppendChild(gDepthTick);

                XmlElement gTickText = svgDoc.CreateElement("text");
                gTickText.SetAttribute("class", "DepthMainTickTextCss");
                gTickText.SetAttribute("x", "6");
                gTickText.SetAttribute("y", ltdfViewMainTickDepth[i].ToString());
                gTickText.SetAttribute("font-size", iTickFontSize.ToString());
                gTickText.InnerText = ltStrMainTickText[i];
                gMDRuler.AppendChild(gTickText);
            }
            //minTick
            List <double> ltdfViewMinTickDepth = cSVGBase.transformListVscale(ltdfminTickDepth, dfVscale);

            for (int i = 0; i < ltdfViewMinTickDepth.Count; i++)
            {
                XmlElement gDepthMinTick = svgDoc.CreateElement("use");
                gDepthMinTick.SetAttribute("x", "0");
                gDepthMinTick.SetAttribute("y", ltdfViewMinTickDepth[i].ToString());
                gDepthMinTick.SetAttribute("href", cSVGBase.svgNS, "#" + cIDmake.idDepthTickMin);
                gMDRuler.AppendChild(gDepthMinTick);
            }
            //主轴
            XmlElement gWellBoleLine = svgDoc.CreateElement("line");

            gWellBoleLine.SetAttribute("x1", "0");
            gWellBoleLine.SetAttribute("y1", (minMesureDepth * dfVscale).ToString());
            gWellBoleLine.SetAttribute("x2", "0");
            gWellBoleLine.SetAttribute("y2", ltdfViewMainTickDepth.Last().ToString());
            gWellBoleLine.SetAttribute("stroke", "black");
            gWellBoleLine.SetAttribute("stroke-width", "2");
            gMDRuler.AppendChild(gWellBoleLine);

            return(gMDRuler);
        }
Exemplo n.º 9
0
        public static XmlElement gTrackLithoTVDItem(ItemWell curWell, XmlDocument svgDoc, XmlElement svgDefs, itemDrawDataIntervalValue item, double fVScale, int iTrackwidth)
        {
            item.calTVD(curWell);
            string sID        = item.sID;
            double fTop       = item.topTVD * fVScale;
            double fBot       = item.botTVD * fVScale;
            string backColor  = "none";
            string sColorText = item.sProperty;
            double grainSize  = item.fValue;

            if (cProjectManager.dicColor.ContainsKey(sColorText))
            {
                backColor = cProjectManager.dicColor[item.sProperty];
            }
            else if (cProjectManager.dicColor.ContainsValue(sColorText))
            {
                backColor = sColorText;
            }
            else if (cPublicMethodBase.isValidColor(sColorText))
            {
                backColor = sColorText;
            }
            double width = iTrackwidth * grainSize;

            string   sLithoCode      = "none";
            string   fileNamePattern = "";
            ItemCode codeItem        = cProjectManager.ltCodeItem.FirstOrDefault(p => p.chineseName == item.sText);

            if (codeItem != null)
            {
                fileNamePattern = codeItem.fileName + ".svg";
                sLithoCode      = codeItem.sCode;
            }
            XmlElement gLithoItem = svgDoc.CreateElement("g");
            XmlElement gRectBack  = svgDoc.CreateElement("rect");

            gRectBack.SetAttribute("onclick", "getID(evt)");
            gRectBack.SetAttribute("id", sID);
            gRectBack.SetAttribute("x", "0");
            gRectBack.SetAttribute("y", fTop.ToString());
            gRectBack.SetAttribute("width", (width).ToString());
            gRectBack.SetAttribute("height", (fBot - fTop).ToString());
            gRectBack.SetAttribute("style", "stroke-width:0.5");
            gRectBack.SetAttribute("stroke", "black");
            gRectBack.SetAttribute("fill", backColor);
            XmlElement gLithoRect = svgDoc.CreateElement("rect");

            gLithoRect.SetAttribute("onclick", "getID(evt)");
            gLithoRect.SetAttribute("id", sID);
            gLithoRect.SetAttribute("x", "0");
            gLithoRect.SetAttribute("y", fTop.ToString());
            gLithoRect.SetAttribute("width", (width).ToString());
            gLithoRect.SetAttribute("height", (fBot - fTop).ToString());
            gLithoRect.SetAttribute("style", "stroke-width:0.5");
            gLithoRect.SetAttribute("stroke", "black");
            //从目录中查找包含pattern的svg原文件,文件名和sLithoID一致,svgdefs增加定义。
            if (codeItem != null)
            {
                string filePathPatternSVG = Path.Combine(AppDomain.CurrentDomain.BaseDirectory, "pattern", "rock", codeItem.codeType, fileNamePattern);
                if (File.Exists(filePathPatternSVG))
                {
                    cSVGoperate.addSVGpatternDefs(svgDoc, svgDefs, sLithoCode, filePathPatternSVG);
                    gLithoRect.SetAttribute("fill", string.Format("url(#{0})", sLithoCode));
                }
            }
            else
            {
                gLithoRect.SetAttribute("fill", "white");
            }
            gLithoItem.AppendChild(gRectBack);
            gLithoItem.AppendChild(gLithoRect);
            return(gLithoItem);
        }