private void btnOK_Click(object sender, EventArgs e) { item.top = float.Parse(this.nTBXTopDepth.Text); item.bot = float.Parse(this.nTBXBotDepth.Text); item.calTVD(sJH); item.sText = cbbItemLitho.SelectedItem.ToString(); item.sProperty = cbbColor.SelectedItem.ToString(); item.fValue = (double)nUDGrainSize.Value; if (item.bot > item.top) { //查找是否存在,存在更改,不存在再添加 if (item.sID == "") { cXmlDocSectionWell.addDataItemIntervalValue(filePathTemple, sIDTrack, item); cXmlDocSectionWell.sortSelectTrackItem(filePathTemple, sIDTrack); } else { cXmlDocSectionWell.setDataItemIntervalValue(filePathTemple, item); } } else { MessageBox.Show("顶底深不正确。"); } }
/// <summary> /// 注意xtmFile /// </summary> /// <param name="xtlFileName">模板文件名,带扩展名</param> /// <param name="goalFilePath">目标文件路径,全路径</param> /// <param name="sJH"></param> public static void copyTemplate(string xtlFileName, string goalFilePath, string sJH) { //加载模板 string xtmPath = Path.Combine(cProjectManager.dirPathTemplate, xtlFileName); File.Copy(xtmPath, goalFilePath, true); cXmlBase.setNodeInnerText(goalFilePath, cXmlDocSectionWell.fullPathJH, sJH); cXmlBase.setNodeInnerText(goalFilePath, cXEWellPage.fullPathMapTitle, sJH); //加载曲线数据 ItemWell curWell = cProjectData.ltProjectWell.FirstOrDefault(p => p.sJH == sJH); foreach (XmlElement el_Track in cXmlDocSectionWell.getTrackNodes(goalFilePath)) { trackDataDraw curTrackDraw = new trackDataDraw(el_Track); //继续读取曲线,加载数据 if (curTrackDraw.sTrackType == TypeTrack.分层.ToString()) { List <itemDrawDataIntervalValue> listDataItem = new List <itemDrawDataIntervalValue>(); //判断库中是否有相关数据,如果有数据的话,构建 listDataItem,然后导入 cIOinputLayerDepth cSelectLayerDepth = new cIOinputLayerDepth(); List <string> listStrLine = cSelectLayerDepth.selectSectionDrawData2List(sJH); foreach (string sLine in listStrLine) { string[] splitLine = sLine.Split(); if (splitLine.Length >= 3) { itemDrawDataIntervalValue itemPro = new itemDrawDataIntervalValue(); itemPro.top = float.Parse(splitLine[0]); itemPro.bot = float.Parse(splitLine[1]); itemPro.sProperty = splitLine[2]; itemPro.calTVD(curWell); listDataItem.Add(itemPro); } } //end 第一种类型 cXmlDocSectionWell.addDataItemListIntervaProperty(goalFilePath, curTrackDraw.sTrackID, listDataItem); } if (curTrackDraw.sTrackType == TypeTrack.测井解释.ToString()) { List <itemDrawDataIntervalValue> listDataItem = new List <itemDrawDataIntervalValue>(); //判断库中是否有相关数据,如果有数据的话,构建 listDataItem,然后导入 cIOinputJSJL cSelectJSJL = new cIOinputJSJL(); List <string> listStrLine = cSelectJSJL.selectSectionDrawData2List(sJH); foreach (string sLine in listStrLine) { string[] splitLine = sLine.Split(); if (splitLine.Length >= 3) { itemDrawDataIntervalValue itemPro = new itemDrawDataIntervalValue(); itemPro.top = float.Parse(splitLine[0]); itemPro.bot = float.Parse(splitLine[1]); itemPro.sProperty = splitLine[2]; itemPro.calTVD(curWell); listDataItem.Add(itemPro); } } //end 第一种类型 cXmlDocSectionWell.addDataItemListIntervaProperty(goalFilePath, curTrackDraw.sTrackID, listDataItem); } } //end track loop }
private void btnOK_Click(object sender, EventArgs e) { cfilePathProject.setProjectLayerColor(listLayerColor); item.top = float.Parse(this.nTBXTopDepth.Text); item.bot = float.Parse(this.nTBXBotDepth.Text); item.calTVD(sJH); item.fValue = cbbConformity.SelectedIndex; if (item.bot > item.top) { //查找是否存在,存在更改,不存在再添加 if (item.sID == "") { cXmlDocSectionWell.addDataItemIntervalValue(filePathTemple, sIDTrack, item); cXmlDocSectionWell.sortSelectTrackItem(filePathTemple, sIDTrack); } else { cXmlDocSectionWell.setDataItemIntervalValue(filePathTemple, item); } } else { MessageBox.Show("顶底深不正确。"); } }
private void btnOK_Click(object sender, EventArgs e) { string sJH = cXmlDocSectionWell.getNodeInnerText(filePathTemple, cXmlDocSectionWell.fullPathJH); string dirWell = Path.Combine(cProjectManager.dirPathWellDir, sJH); if (!Directory.Exists(dirWell)) { Directory.CreateDirectory(dirWell); } string filePathsour = this.tbxImageFilePath.Text; if (filePathsour != item.sText) //图片换了再复制更新 { string fileNameNew = cIDmake.generateID() + Path.GetExtension(filePathsour); if (File.Exists(filePathsour)) { File.Copy(filePathsour, Path.Combine(dirWell, Path.Combine(dirWell, fileNameNew))); } item.sText = filePathsour; item.sProperty = fileNameNew; } item.top = float.Parse(this.nTBXTopDepth.Text); item.bot = float.Parse(this.nTBXBotDepth.Text); item.calTVD(sJH); item.fValue = (float)nUDWidthPercent.Value; if (item.bot > item.top) { //查找是否存在,存在更改,不存在再添加 if (item.sID == "") { cXmlDocSectionWell.addDataItemIntervalValue(filePathTemple, sIDTrack, item); cXmlDocSectionWell.sortSelectTrackItem(filePathTemple, sIDTrack); } else { cXmlDocSectionWell.setDataItemIntervalValue(filePathTemple, item); } } else { MessageBox.Show("顶底深不正确。"); } }
public void readDataGridView2ListData(DataGridView dgv) { listDataItem.Clear(); ItemWell curWell = cProjectData.ltProjectWell.FirstOrDefault(p => p.sJH == this.sJH); for (int i = 0; i < dgv.RowCount; i++) { bool bDataCorrect = true; //根据不同类型赋缺省值 if (trackTypeStr == TypeTrack.符号.ToString()) { if (dgv.Rows[i].Cells[2].Value == null) { dgv.Rows[i].Cells[2].Value = "半工字"; } if (dgv.Rows[i].Cells[3].Value == null) { dgv.Rows[i].Cells[3].Value = " "; } } for (int j = 0; j < dgv.ColumnCount; j++) { if (dgv.Rows[i].Cells[j].Value == null || dgv.Rows[i].Cells[j].Value.ToString() == "") { bDataCorrect = false; break; } } if (bDataCorrect == false) { //抛弃空值行 } else if (trackTypeStr == TypeTrack.分层.ToString() || trackTypeStr == TypeTrack.测井解释.ToString() || trackTypeStr == TypeTrack.含油级别.ToString() || trackTypeStr == TypeTrack.沉积旋回.ToString() || trackTypeStr == TypeTrack.比例条.ToString() ) { itemDrawDataIntervalValue itemPro = new itemDrawDataIntervalValue(); itemPro.top = float.Parse(dgv.Rows[i].Cells[0].Value.ToString()); itemPro.bot = float.Parse(dgv.Rows[i].Cells[1].Value.ToString()); itemPro.sProperty = dgv.Rows[i].Cells[2].Value.ToString(); itemPro.calTVD(curWell); listDataItem.Add(itemPro); } //end 第一种类型 else if (trackTypeStr == TypeTrack.岩性层段.ToString() || trackTypeStr == TypeTrack.描述.ToString() || trackTypeStr == TypeTrack.符号.ToString() ) { itemDrawDataIntervalValue itemPro = new itemDrawDataIntervalValue(); itemPro.top = float.Parse(dgv.Rows[i].Cells[0].Value.ToString()); itemPro.bot = float.Parse(dgv.Rows[i].Cells[1].Value.ToString()); itemPro.sProperty = dgv.Rows[i].Cells[2].Value.ToString(); itemPro.sText = dgv.Rows[i].Cells[3].Value.ToString(); itemPro.calTVD(curWell); listDataItem.Add(itemPro); } else if (trackTypeStr == TypeTrack.文本道.ToString()) { itemDrawDataIntervalValue itemPro = new itemDrawDataIntervalValue(); itemPro.top = float.Parse(dgv.Rows[i].Cells[0].Value.ToString()); itemPro.bot = float.Parse(dgv.Rows[i].Cells[1].Value.ToString()); itemPro.sProperty = "none"; itemPro.sText = dgv.Rows[i].Cells[2].Value.ToString(); itemPro.calTVD(curWell); listDataItem.Add(itemPro); } } }