void generateWellLayerPositonDrawData() { updateSelectedCondition(); lbxProducttLayerCollection.Items.Clear(); updateMapFile(); string filePathWrited = fileDrawMapSourceInfor; List <ItemWellHead> listWellHeadItemSelect = cIOinputWellHead.readWellHead2Struct().FindAll(p => ltStrSelectedJH.IndexOf(p.sJH) >= 0); StreamWriter sw = new StreamWriter(filePathWrited, false, Encoding.UTF8); cIOinputWellHead cSelectWellHead = new cIOinputWellHead(); if (File.Exists(cProjectManager.fileExtensionConnect) && File.Exists(cProjectManager.filePathLayerDataDic)) //进入生产状态,计算了井型代码 { // // cSelectWellHead.readDicWellType2List(); // for (int i = 0; i < ltStrSelectedJH.Count; i++) // { // string sJH = ltStrSelectedJH[i]; // List<string> ltStrWellHeadReturn = cSelectWellHead.selectDataFromWellHeadByJH(sJH); // Point pointConvert2View = new Point(); // double dbX = 0, dbY = 0; // float fKB = 0; // int iWellType = 0; // dbX = double.Parse(ltStrWellHeadReturn[1]); // dbY = double.Parse(ltStrWellHeadReturn[2]); // fKB = float.Parse(ltStrWellHeadReturn[3]); // iWellType = int.Parse(ltStrWellHeadReturn[4]); // //从小层数据字典中替换X,Y // ItemLayerDataDic sttLayerDataDicItem = cIODicLayerData.getLayerDataDicItemFromLayerDataDicByXCMAndJH(sJH, ltStrSelectedLayer[0]); // dbX = sttLayerDataDicItem.dbX; // dbY = sttLayerDataDicItem.dbY; // pointConvert2View = cPublicMethodCordinationTransform.transRealPointF2ViewPoint(dbX, dbY, //cProjectData.dfMapXrealRefer, cProjectData.dfMapYrealRefer, cProjectData.dfMapScale); // List<string> ltStrWrited = new List<string>(); // ltStrWrited.Add(sJH); // ltStrWrited.Add(pointConvert2View.X.ToString()); // ltStrWrited.Add(pointConvert2View.Y.ToString()); // ltStrWrited.Add(fKB.ToString()); // ltStrWrited.Add(iWellType.ToString()); // sw.WriteLine(string.Join("\t", ltStrWrited.ToArray())); // } } else//原始设计井生产,未计算井型代码 { MessageBox.Show("请先根据生产数据计算不同时间步井型代码和小层字典表。"); } sw.Close(); }
private void btnMap_Click(object sender, EventArgs e) { string filenameSVGMap; if (this.tbxMapTitleName.Text == "") { filenameSVGMap = sSelectedYYYYMM + "-InjectProductMap.svg"; } else { filenameSVGMap = this.tbxMapTitleName.Text + ".svg"; } cSVGDocLayerMapProduction cLayerProductionMap = new cSVGDocLayerMapProduction(800, 1000, 0, 0); XmlElement returnElemment; if (this.cbxAddWellConnect.Checked == true) { using (StreamReader sr = new StreamReader(fileDrawMapSourceConnect, Encoding.UTF8)) { String line; string[] split; while ((line = sr.ReadLine()) != null) //delete the line whose legth is 0 { split = line.Trim().Split(new char[] { ' ', '\t', }, StringSplitOptions.RemoveEmptyEntries); string sWellInject = split[0]; string sWellProduct = split[1]; cIOinputWellHead fileWellHead = new cIOinputWellHead(); ItemWellHead WellHeadItemJH1 = fileWellHead.listWellHead.Find(p => p.sJH == sWellInject); ItemWellHead WellHeadItemJH2 = fileWellHead.listWellHead.Find(p => p.sJH == sWellProduct); Point point1Convert2View = cCordinationTransform.transRealPointF2ViewPoint(WellHeadItemJH1.dbX, WellHeadItemJH1.dbY, cProjectData.dfMapXrealRefer, cProjectData.dfMapYrealRefer, cProjectData.dfMapScale); Point point2Convert2View = cCordinationTransform.transRealPointF2ViewPoint(WellHeadItemJH2.dbX, WellHeadItemJH2.dbY, cProjectData.dfMapXrealRefer, cProjectData.dfMapYrealRefer, cProjectData.dfMapScale); returnElemment = cLayerProductionMap.addgConnectLine(point1Convert2View, point2Convert2View, Color.RoyalBlue.Name, 2, Color.RoyalBlue.Name); cLayerProductionMap.addgElement2BaseLayer(returnElemment, 0, 0); } } } if (this.cbxScaleRulerShowed.Checked == true) { ; } if (this.cbxCompassShowed.Checked == true) { cLayerProductionMap.svgRoot.AppendChild(cLayerProductionMap.gCompass(300, 100)); } }