public XmlElement gWellBarGraphFromXML(XmlNode xnLayer, string sID, List <ItemWellMapPosition> ltWellPos) { float fVscale = float.Parse(xnLayer.SelectSingleNode("fVScale").InnerText); List <string> listscolor = xnLayer.SelectSingleNode("sColor").InnerText.Split().ToList(); int width = int.Parse(xnLayer.SelectSingleNode("fRectWidth").InnerText); float fOpacity = float.Parse(xnLayer.SelectSingleNode("fill-opacity").InnerText); XmlElement gEleWellGraph = svgDoc.CreateElement("g"); gEleWellGraph.SetAttribute("id", sID); XmlNodeList xnList = xnLayer.SelectNodes("data/item"); foreach (XmlNode item in xnList) { List <string> listSplitItem = item.InnerText.Split().ToList(); string jh = listSplitItem[0]; ItemWellMapPosition itemStaticWellPosi = ltWellPos.Find(p => p.sJH == jh); List <float> fListdata = new List <float>(); for (int i = 1; i < listSplitItem.Count; i++) { fListdata.Add(float.Parse(listSplitItem[i])); } if (itemStaticWellPosi != null) { Point PViewWell = cCordinationTransform.transRealPointF2ViewPoint(itemStaticWellPosi.dbX, itemStaticWellPosi.dbY, xRef, yRef, this.dfscale); //gEleWellGraph.AppendChild(gWellBarGraph(PViewWell, wellValue.fValue, listscolor[0], width, fVscale)); gEleWellGraph.AppendChild(gWellBarGraph(PViewWell, fListdata, listscolor, width, fVscale)); } } return(gEleWellGraph); }
public static XmlElement gWellPieGraphFromXML(XmlDocument svgDoc, XmlNode xnLayer, string sID, List <ItemWellMapPosition> ltWellPos, cXELayerPage curPage) { float fR = float.Parse(xnLayer.SelectSingleNode("r").InnerText); List <string> listscolor = xnLayer.SelectSingleNode("sColor").InnerText.Split().ToList(); float fscaleR = float.Parse(xnLayer.SelectSingleNode("fScaleR").InnerText); XmlElement gEleWellGraph = svgDoc.CreateElement("g"); gEleWellGraph.SetAttribute("id", sID); XmlNodeList xnList = xnLayer.SelectNodes("data/item"); foreach (XmlNode item in xnList) { List <string> listSplitItem = item.InnerText.Split().ToList(); string jh = listSplitItem[0]; ItemWellMapPosition itemStaticWellPosi = ltWellPos.Find(p => p.sJH == jh); List <float> fListdata = new List <float>(); for (int i = 1; i < listSplitItem.Count; i++) { fListdata.Add(float.Parse(listSplitItem[i])); } if (itemStaticWellPosi != null) { Point PViewWell = cCordinationTransform.transRealPointF2ViewPoint(itemStaticWellPosi.dbX, itemStaticWellPosi.dbY, curPage.xRef, curPage.yRef, curPage.dfscale); gEleWellGraph.AppendChild(cBaseMapSVG.gWellPie(svgDoc, PViewWell, fListdata, listscolor, fscaleR)); } } return(gEleWellGraph); }
public XmlElement gWellBarGraph(ItemWellMapPosition itemWellPos, List <float> ltfValue, List <string> ltStrColors, float fVscale) { XmlElement gWellProduct = svgDoc.CreateElement("g"); gWellProduct.SetAttribute("id", itemWellPos.sJH + "bar"); Point PViewWell = cCordinationTransform.transRealPointF2ViewPoint(itemWellPos.dbX, itemWellPos.dbY, xRef, yRef, this.dfscale); XmlElement gRect = gWellBarGraph(PViewWell, ltfValue, ltStrColors, fVscale); gWellProduct.AppendChild(gRect); return(gWellProduct); }
public static void addBaseLayer2XML(string filePathLayerCss, List <ItemWellMapPosition> listItemWell) { XmlDocument xmlLayerMap = new XmlDocument(); xmlLayerMap.Load(filePathLayerCss); XmlNode currentNode = xmlLayerMap.SelectSingleNode("/LayerMapConfig"); XmlNode nodeLayer = xmlLayerMap.CreateElement("BaseLayer"); XmlAttribute nodeID = xmlLayerMap.CreateAttribute("id"); nodeID.Value = "BaseLayer"; nodeLayer.Attributes.Append(nodeID); XmlElement eleMent; //定制井位图属性 //是否显示 eleMent = xmlLayerMap.CreateElement("r"); eleMent.InnerText = "4"; nodeLayer.AppendChild(eleMent); eleMent = xmlLayerMap.CreateElement("rLineWidth"); eleMent.InnerText = "1"; nodeLayer.AppendChild(eleMent); //定制井数据 //是否显示 eleMent = xmlLayerMap.CreateElement("JHIsShow"); eleMent.SetAttribute("value", "1"); nodeLayer.AppendChild(eleMent); eleMent = xmlLayerMap.CreateElement("fontColor"); eleMent.SetAttribute("value", "black"); nodeLayer.AppendChild(eleMent); eleMent = xmlLayerMap.CreateElement("fontSize"); eleMent.InnerText = "10"; nodeLayer.AppendChild(eleMent); eleMent = xmlLayerMap.CreateElement("DX_Text"); //标注偏移 eleMent.InnerText = "12"; nodeLayer.AppendChild(eleMent); eleMent = xmlLayerMap.CreateElement("data"); //标注偏移 foreach (ItemWellMapPosition item in listItemWell) { XmlElement itemdata = xmlLayerMap.CreateElement("item"); itemdata.InnerText = ItemWellMapPosition.item2string(item); eleMent.AppendChild(itemdata); } nodeLayer.AppendChild(eleMent); currentNode.AppendChild(nodeLayer); xmlLayerMap.Save(filePathLayerCss); }
public XmlElement addgWaterWellProductionPie(ItemWellMapPosition itemWellPos, ItemDicLayerDataDynamic itemDicDynamic, float fscaleR) { XmlElement gWellProductionPie = svgDoc.CreateElement("g"); gWellProductionPie.SetAttribute("id", "idWellInjectPie"); Point pViewWell = cCordinationTransform.transRealPointF2ViewPoint(itemWellPos.dbX, itemWellPos.dbY, xRef, yRef, this.dfscale); float fValue = itemDicDynamic.fLZS; gWellProductionPie.AppendChild(gValueCircle(pViewWell, fValue, fscaleR, "blue")); return(gWellProductionPie); }
public static XmlElement gLayerWellLog(cSVGDocLayerMap svgLayer, ItemWellMapPosition ltWellPos, LayerDataLog layerDataLog) { string sJH = ltWellPos.sJH; string sLogName = layerDataLog.sLogName; int iTrackwidth = layerDataLog.iTrackWidth; float fVScale = layerDataLog.fVScale; double fTop = ltWellPos.dbTop; double fBot = ltWellPos.dbBot; //获得测井数据 trackDataListLog dlTrackDataListLog = cSVGSectionTrackLog.getLogSeriersFromLogFile(sJH, sLogName, fTop, fBot); XmlElement gEleWellLogPattern = gWellLogPattern(svgLayer.svgDoc, layerDataLog, iTrackwidth, dlTrackDataListLog.fListValue, fVScale); return(gEleWellLogPattern); }
public XmlElement addgWaterWellInjectRect(ItemWellMapPosition itemWellPos, ItemDicLayerDataDynamic itemDicDynamic, float fVscale) { XmlElement gWellProduct = svgDoc.CreateElement("g"); gWellProduct.SetAttribute("id", "idWellProductionRect"); Point PViewWell = cCordinationTransform.transRealPointF2ViewPoint(itemWellPos.dbX, itemWellPos.dbY, xRef, yRef, this.dfscale); float fValue = itemDicDynamic.fSCTS > 0 ? float.Parse((itemDicDynamic.fYZS / itemDicDynamic.fSCTS).ToString("0.0")) : 0; gWellProduct.AppendChild(gHistogram(PViewWell, fValue, fVscale, "blue")); return(gWellProduct); }
public XmlElement addgOilWellProductionPie(ItemWellMapPosition itemWellPos, ItemDicLayerDataDynamic itemDicDynamic, float fscaleR) { XmlElement gWellProductionPie = svgDoc.CreateElement("g"); gWellProductionPie.SetAttribute("id", "idWellProductionPie"); Point PViewWell = cCordinationTransform.transRealPointF2ViewPoint(itemWellPos.dbX, itemWellPos.dbY, xRef, yRef, this.dfscale); List <float> fListdata = new List <float>(); fListdata.Add(itemDicDynamic.fSCTS > 0?itemDicDynamic.fYCY / itemDicDynamic.fSCTS:0); fListdata.Add(itemDicDynamic.fSCTS > 0 ? itemDicDynamic.fYCS / itemDicDynamic.fSCTS : 0); List <string> ltStrColors = new List <string>(); ltStrColors.Add("red"); ltStrColors.Add("blue"); gWellProductionPie.AppendChild(gWellPie(PViewWell, fListdata, ltStrColors, fscaleR)); return(gWellProductionPie); }
public XmlElement gSumProductFromXML(XmlNode xnLayer, string sID, List <ItemWellMapPosition> ltWellPos, List <ItemDicLayerDataDynamic> listItemWellDynamic) { float fR = float.Parse(xnLayer.SelectSingleNode("r").InnerText); XmlElement gLayerSum = svgDoc.CreateElement("g"); gLayerSum.SetAttribute("id", sID); foreach (ItemDicLayerDataDynamic item in listItemWellDynamic) { ItemWellMapPosition itemStaticWellPosi = ltWellPos.Find(p => p.sJH == item.sJH); if (item.iWellType == (int)TypeWell.Oil) { gLayerSum.AppendChild(addgOilWellProductionPie(itemStaticWellPosi, item, fR)); } if (item.iWellType == (int)TypeWell.Injectwater) { gLayerSum.AppendChild(addgWaterWellProductionPie(itemStaticWellPosi, item, fR)); } } return(gLayerSum); }
//解析传入的XML中的井坐标,然后成图 public XmlElement gWellsPosition(XmlDocument svgDoc) { delgWellPosition(); string _JHFontSize = xmlLayerMap.SelectSingleNode("/LayerMapConfig/JHText/fontSize").InnerText; int _radis = int.Parse(xmlLayerMap.SelectSingleNode("/LayerMapConfig/BaseLayer/r").InnerText); int _iCirlceWidth = int.Parse(xmlLayerMap.SelectSingleNode("/LayerMapConfig/BaseLayer/rLineWidth").InnerText); string _DX_JHText = xmlLayerMap.SelectSingleNode("LayerMapConfig/JHText/DX_Text").InnerText; XmlElement gWellPositon = svgDoc.CreateElement("g"); gWellPositon.SetAttribute("id", "井"); foreach (XmlNode xn in xmlLayerMap.SelectNodes("/LayerMapConfig/BaseLayer/Well")) { string _data = xn.InnerText; ItemWellMapPosition item = ItemWellMapPosition.parseLine(_data); Point pointConvert2View = cCordinationTransform.transRealPointF2ViewPoint(item.dbX, item.dbY, xRef, yRef, this.dfscale); gWellPositon.AppendChild(gWell(svgDoc, item.sJH, pointConvert2View.X, pointConvert2View.Y, item.iWellType, _JHFontSize, _radis, _iCirlceWidth, _DX_JHText)); } return(gWellPositon); }
public static void addStaticWellPos2XML(string filePathLayerCss, string sXCM, List <ItemWellMapPosition> listItemWell) { XmlDocument xmlLayerMap = new XmlDocument(); xmlLayerMap.Load(filePathLayerCss); XmlNodeList xnList = xmlLayerMap.SelectNodes("/LayerMapConfig/DataWellPositionStatic"); //或许Layer标签的节点 foreach (XmlNode xn in xnList) { if (xn.Attributes["XCM"].Value == sXCM) { xn.ParentNode.RemoveChild(xn); } } XmlNode currentNode = xmlLayerMap.SelectSingleNode("/LayerMapConfig"); XmlNode nodeLayer = xmlLayerMap.CreateElement("DataWellPositionStatic"); XmlAttribute nodeID = xmlLayerMap.CreateAttribute("XCM"); nodeID.Value = sXCM; nodeLayer.Attributes.Append(nodeID); XmlElement eleMent; eleMent = xmlLayerMap.CreateElement("data"); foreach (ItemWellMapPosition item in listItemWell) { XmlElement itemdata = xmlLayerMap.CreateElement("item"); itemdata.InnerText = ItemWellMapPosition.item2string(item); eleMent.AppendChild(itemdata); } currentNode.AppendChild(nodeLayer); xmlLayerMap.Save(filePathLayerCss); }