public static XmlElement gTrackLogPoint(XmlDocument svgDoc, itemLogHeadInforDraw item, int iTrackwidth, List <double> fListDepthInput, List <double> fListValue, double fVScale) { string sLogName = item.sLogName; double fLeftValue = item.fLeftValue; double fRightValue = item.fRightValue; string m_sColorCurve = item.sLogColor; string sFill = item.sFill; float iLinewidth = item.fLineWidth; int iLineType = item.iLineType; double xViewTrack = 0f; //对大小支进行值域质量控制 double qcMinValue = Math.Min(fLeftValue, fRightValue) - 100; double qcMaxValue = Math.Max(fLeftValue, fRightValue) + 100; //曲线可能反转,所以一定要加值 XmlElement gLog = svgDoc.CreateElement("g"); gLog.SetAttribute("id", item.sIDLog); gLog.SetAttribute("onclick", "getID(evt)"); gLog.SetAttribute("stroke-width", iLinewidth.ToString()); gLog.SetAttribute("stroke", m_sColorCurve); gLog.SetAttribute("fill", sFill); if (fListDepthInput.Count > 0) { for (int i = 0; i < fListDepthInput.Count; i++) { double fDepth = fListDepthInput[i] * fVScale; double fValue = fListValue[i]; if (i == 0 || (i == fListDepthInput.Count - 1)) { fValue = Math.Min(fLeftValue, fRightValue); } if (qcMinValue <= fValue && fValue <= qcMaxValue) { xViewTrack = iTrackwidth * (fValue - fLeftValue) / (fRightValue - fLeftValue); if (xViewTrack < 0) { xViewTrack = 0; } else if (xViewTrack > iTrackwidth) { xViewTrack = iTrackwidth; } XmlElement eCircle = svgDoc.CreateElement("circle"); eCircle.SetAttribute("cx", xViewTrack.ToString()); eCircle.SetAttribute("cy", fDepth.ToString()); eCircle.SetAttribute("r", "2"); eCircle.SetAttribute("fill", m_sColorCurve); gLog.AppendChild(eCircle); } else { continue; } } } return(gLog); }
public static XmlElement addTrackItemLogHeadInfor(XmlDocument svgDoc, itemLogHeadInforDraw item, double iYPotionBot, int iLogNum, int width, int iFontSize) { int iUpLine = iFontSize + 10; //不同测井曲线间隔距离 int iFirstLogheadLinePosition = 3; //首条logheadLine线距离下边框的距离 double iYPotion = iYPotionBot - iUpLine * (iLogNum - 1) - iFirstLogheadLinePosition; return(addTrackItemLogHeadInfor(svgDoc, item.sIDLog, item.sLogName, item.sUnit, iYPotion, width, item.fLeftValue, item.fRightValue, item.sLogColor, item.sFill, codeReplace.codeReplaceStrokeDashInt2Str(item.iLineType), iFontSize)); }
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)); }
public static List <itemLogHeadInforDraw> getTrackLogHeadList(string pathTemplate, string sIDTrack) { List <itemLogHeadInforDraw> ltItemLogHeadInforDraw = new List <itemLogHeadInforDraw>(); //记录绘制道头用,节省重新读取的时间 XmlDocument wellTemplateXML = new XmlDocument(); wellTemplateXML.Load(pathTemplate); string sPath = string.Format("//*[@id='{0}']", sIDTrack); XmlNode el_Track = wellTemplateXML.SelectSingleNode(sPath); XmlNodeList xnList = el_Track.SelectNodes(".//Log"); foreach (XmlElement xnLog in xnList) { itemLogHeadInforDraw curLogHead = new itemLogHeadInforDraw(xnLog); ltItemLogHeadInforDraw.Add(curLogHead); } return(ltItemLogHeadInforDraw); }
public static XmlElement addTrackItemLogHeadInfor(XmlDocument svgDoc, itemLogHeadInforDraw item, double iYPotion, int width, int iFontSize) { return(addTrackItemLogHeadInfor(svgDoc, item.sIDLog, item.sLogName, item.sUnit, iYPotion, width, item.fLeftValue, item.fRightValue, item.sLogColor, item.sFill, codeReplace.codeReplaceStrokeDashInt2Str(item.iLineType), iFontSize)); }
public static XmlElement gTrackLog(XmlDocument svgDoc, itemLogHeadInforDraw item, int iTrackwidth, List <double> fListDepthInput, List <double> fListValue, double fVScale) { trackDataListLog trackDataView = new trackDataListLog(); //保存每条曲线绘制的ViewPoint 为了绘制填充使用。 trackDataView.itemHeadInforDraw = item; string sLogName = item.sLogName; double fLeftValue = item.fLeftValue; double fRightValue = item.fRightValue; string m_sColorCurve = item.sLogColor; string sFill = item.sFill; float iLinewidth = item.fLineWidth; int iLineType = item.iLineType; int iNumSpare = 2; if (item.iSparceNum > 0) { iNumSpare = item.iSparceNum; } double xViewTrack = 0f; //对大小支进行值域质量控制 double qcMinValue = Math.Min(fLeftValue, fRightValue); double qcMaxValue = Math.Max(fLeftValue, fRightValue); if (qcMinValue <= 0) { qcMinValue *= 2; } else { qcMinValue *= 0.5; } if (qcMaxValue <= 0) { qcMaxValue *= 0.5; } else { qcMaxValue *= 2; } string _points = ""; //曲线可能反转,所以一定要加值 XmlElement gLog = svgDoc.CreateElement("g"); if (fListDepthInput.Count > 0) { #region logCurve if (item.typeMode == TypeTrack.曲线.ToString()) { xViewTrack = getXview(qcMinValue, fLeftValue, fRightValue, iTrackwidth); _points += (xViewTrack).ToString("0.0") + ',' + (fListDepthInput[0] * fVScale).ToString("0.0") + " "; if (item.iIsLog == 0) //非对数 { for (int i = 0; i < fListDepthInput.Count; i = i + iNumSpare) { double fDepthView = fListDepthInput[i] * fVScale; double fValue = fListValue[i]; if (qcMinValue <= fValue && fValue <= qcMaxValue) { xViewTrack = getXview(fValue, fLeftValue, fRightValue, iTrackwidth); _points += (xViewTrack).ToString("0.0") + ',' + fDepthView.ToString("0.0") + " "; trackDataView.fListMD.Add(fDepthView); trackDataView.fListValue.Add(xViewTrack); } } } else { for (int i = 0; i < fListDepthInput.Count; i = i + iNumSpare) { double fDepthView = fListDepthInput[i] * fVScale; double fValue = fListValue[i]; //if (i == 0 || i == (fListDepthInput.Count - 1)) fValue = fLeftValue; if (fLeftValue <= fValue && fLeftValue > 0) { xViewTrack = iTrackwidth * (Math.Log10(fValue / fLeftValue)) / item.iLogGridGrade; if (xViewTrack < 0) { xViewTrack = 0; } else if (xViewTrack > iTrackwidth) { xViewTrack = iTrackwidth; } _points = _points + (xViewTrack).ToString("0.0") + ',' + fDepthView.ToString("0.0") + " "; trackDataView.fListMD.Add(fDepthView); trackDataView.fListValue.Add(xViewTrack); } } } xViewTrack = getXview(qcMinValue, fLeftValue, fRightValue, iTrackwidth); _points += (xViewTrack).ToString("0.0") + ',' + (fListDepthInput.Last() * fVScale).ToString("0.0") + " "; trackDataView.fListMD.Insert(0, fListDepthInput[0] * fVScale); trackDataView.fListValue.Insert(0, xViewTrack); trackDataView.fListMD.Add(fListDepthInput.Last() * fVScale); trackDataView.fListValue.Add(xViewTrack); XmlElement gLogPolygon = svgDoc.CreateElement("polygon"); gLogPolygon.SetAttribute("id", item.sIDLog); gLogPolygon.SetAttribute("onclick", "getID(evt)"); gLogPolygon.SetAttribute("stroke-width", iLinewidth.ToString()); gLogPolygon.SetAttribute("stroke", m_sColorCurve); gLogPolygon.SetAttribute("stroke-dasharray", codeReplace.codeReplaceStrokeDashInt2Str(iLineType)); gLogPolygon.SetAttribute("fill", sFill); gLogPolygon.SetAttribute("points", _points); cSVGSectionTrackLogCurveFill.listLogViewData4fill.Add(trackDataView); gLog.AppendChild(gLogPolygon); } #endregion #region scatterPoint if (item.typeMode == TypeTrack.散点.ToString()) { for (int i = 0; i < fListDepthInput.Count; i++) { double fDepth = fListDepthInput[i] * fVScale; double fValue = fListValue[i]; if (item.iIsLog == 0) { if (qcMinValue <= fValue && fValue <= qcMaxValue) { xViewTrack = iTrackwidth * (fValue - fLeftValue) / (fRightValue - fLeftValue); if (xViewTrack < 0) { xViewTrack = 0; } else if (xViewTrack > iTrackwidth) { xViewTrack = iTrackwidth; } } } else if (fLeftValue <= fValue && fLeftValue > 0) { xViewTrack = iTrackwidth * (Math.Log10(fValue / fLeftValue)) / item.iLogGridGrade; if (xViewTrack < 0) { xViewTrack = 0; } else if (xViewTrack > iTrackwidth) { xViewTrack = iTrackwidth; } } XmlElement eCircle = svgDoc.CreateElement("circle"); eCircle.SetAttribute("cx", xViewTrack.ToString()); eCircle.SetAttribute("cy", fDepth.ToString()); eCircle.SetAttribute("r", "3"); eCircle.SetAttribute("fill", m_sColorCurve); gLog.AppendChild(eCircle); } } #endregion #region 杆状 if (item.typeMode == TypeTrack.杆状.ToString()) { for (int i = 0; i < fListDepthInput.Count; i++) { double fDepth = fListDepthInput[i] * fVScale; double fValue = fListValue[i]; if (item.iIsLog == 0) { if (qcMinValue <= fValue && fValue <= qcMaxValue) { xViewTrack = iTrackwidth * (fValue - fLeftValue) / (fRightValue - fLeftValue); if (xViewTrack < 0) { xViewTrack = 0; } else if (xViewTrack > iTrackwidth) { xViewTrack = iTrackwidth; } } } else if (fLeftValue <= fValue && fLeftValue > 0) { xViewTrack = iTrackwidth * (Math.Log10(fValue / fLeftValue)) / item.iLogGridGrade; if (xViewTrack < 0) { xViewTrack = 0; } else if (xViewTrack > iTrackwidth) { xViewTrack = iTrackwidth; } } string d = "M0 " + fDepth.ToString() + " h" + xViewTrack; XmlElement gLogPath = svgDoc.CreateElement("path"); gLogPath.SetAttribute("stroke-widt", iLinewidth.ToString()); gLogPath.SetAttribute("stroke", m_sColorCurve); gLogPath.SetAttribute("fill", "none"); gLogPath.SetAttribute("d", d); gLog.AppendChild(gLogPath); XmlElement eCircle = svgDoc.CreateElement("circle"); eCircle.SetAttribute("cx", xViewTrack.ToString()); eCircle.SetAttribute("cy", fDepth.ToString()); eCircle.SetAttribute("r", "2"); eCircle.SetAttribute("fill", "red"); gLog.AppendChild(eCircle); } } #endregion } return(gLog); }
public static XmlElement gTrackCompositeLog(XmlDocument svgDoc, itemLogHeadInforDraw item, int iTrackwidth, List <double> fListDepthInput, List <string> fListStrValue, double fVScale) { //传字符串 到这里解析 未知多少个组分 List <List <double> > ListltValue = new List <List <double> >(); //将传入的List<string> 变换 foreach (string strLineValue in fListStrValue) { string[] split = strLineValue.Split(); List <double> ltLogValue = new List <double>(); foreach (string sValue in split) { double _value = 0.0; double.TryParse(sValue, out _value); ltLogValue.Add(_value); } ListltValue.Add(ltLogValue); } //第一条曲线取值字符串的第一个截断 string sLogName = item.sLogName; double fLeftValue = item.fLeftValue; double fRightValue = item.fRightValue; string m_sColorCurve = item.sLogColor; string sFill = item.sFill; float iLinewidth = item.fLineWidth; int iLineType = item.iLineType; double _xView_f = 0f; //新增的曲线拼接上一条曲线 string _points = ""; XmlElement gLog = svgDoc.CreateElement("g"); if (fListDepthInput.Count > 0) { #region loop in mutiLog,循环添加测井曲线 for (int k = 0; k < ListltValue[0].Count; k++) { for (int i = 0; i < fListDepthInput.Count; i++) { double fDepth = fListDepthInput[i] * fVScale; double fValue = ListltValue[i].GetRange(0, k).Sum(); if (0 <= fValue && fValue <= 100) { _xView_f = iTrackwidth * (fValue - 0) / 100; if (_xView_f < 0) { _xView_f = 0; } else if (_xView_f > iTrackwidth) { _xView_f = iTrackwidth; } _points += (_xView_f).ToString("0.0") + ',' + fDepth.ToString("0.0") + " "; } } XmlElement gLogPolygon = svgDoc.CreateElement("polygon"); gLogPolygon.SetAttribute("id", item.sIDLog); gLogPolygon.SetAttribute("onclick", "getID(evt)"); gLogPolygon.SetAttribute("stroke-width", iLinewidth.ToString()); gLogPolygon.SetAttribute("stroke", m_sColorCurve); gLogPolygon.SetAttribute("stroke-dasharray", codeReplace.codeReplaceStrokeDashInt2Str(iLineType)); gLogPolygon.SetAttribute("fill", sFill); gLogPolygon.SetAttribute("points", _points); gLog.AppendChild(gLogPolygon); } #endregion 循环添加曲线 } return(gLog); }