Beispiel #1
0
        public XmlElement gPathTrackLog(string sJH, string sLogName, List <float> fListMD, List <float> fListValue,
                                        float m_KB, float fLeftValue, float fRightValue, string sColorCurve)
        {
            XmlElement gLogTrack = svgDoc.CreateElement("g");

            gLogTrack.SetAttribute("id", sJH + "#" + sLogName);
            gLogTrack.SetAttribute("stroke", sColorCurve);
            gLogTrack.SetAttribute("stroke-width", "0.5");
            if (sLogName == null || fListMD.Count == 0)
            {
                return(gLogTrack);
            }
            string _points = "";

            List <ItemDicWellPath> listWellPath        = cIOinputWellPath.getWellPathItemListByJHAndMDList(sJH, fListMD);
            List <ItemDicWellPath> listWellPathHorzion = new List <ItemDicWellPath>();
            List <float>           fListMDHorizina     = new List <float>();
            List <float>           fListValueHorizina  = new List <float>();
            double x0 = listWellPath[0].f_dx;
            double y0 = -m_KB + listWellPath[0].f_TVD;

            for (int i = 0; i < fListMD.Count; i++)
            {
                ItemDicWellPath currentWellPath = listWellPath[i];
                double          currentX        = currentWellPath.f_dx;
                double          currentY        = -m_KB + currentWellPath.f_TVD;
                if (currentWellPath.f_incl <= 85)
                {
                    float xViewTrack = 0.0f;
                    if (-500 <= fListValue[i] && fListValue[i] < 1000)
                    {
                        xViewTrack = this.iTrackWidth * (fListValue[i] - fLeftValue) / (fRightValue - fLeftValue);
                        _points    = _points + (currentX + xViewTrack).ToString() + ',' + currentY.ToString() + " ";
                    }
                }
                else if (currentWellPath.f_incl >= 85 && i % 3 == 0)
                {
                    listWellPathHorzion.Add(currentWellPath);
                    fListMDHorizina.Add(fListMD[i]);
                    fListValueHorizina.Add(fListValue[i]);
                }
            }
            XmlElement gLogPolygon = svgDoc.CreateElement("polyline");

            gLogPolygon.SetAttribute("fill", "none");
            gLogPolygon.SetAttribute("points", _points);
            gLogTrack.AppendChild(gLogPolygon);

            gLogTrack.AppendChild(gTrackLogHeadText(x0, y0, sLogName, sColorCurve));
            gLogTrack.AppendChild(gTrackLogHeadRuler(x0, y0, sColorCurve));

            return(gLogTrack);
        }
        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);
        }
        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);
        }