public string selectLayerDepth2String(string sJH) { string sReturn = ""; foreach (var item in readLayerDepth2Struct(sJH)) { sReturn += ItemDicLayerDepth.item2string(item) + "\t"; } return(sReturn); }
public static void creatWellGeoFile(string _sJH) { List <ItemLayerDepthInput> ltLayerDepthInput = readInputFile(_sJH); creatWellGeoHeadFile(_sJH); if (ltLayerDepthInput.Count == 0) { return; } //增加layer循环 List <ItemDicLayerDepth> ltLayerDepthWrite = new List <ItemDicLayerDepth>(); int iCount = cProjectData.ltStrProjectXCM.Count; for (int i = 0; i < iCount; i++) { //先按每个井号、层位附上0值 ItemDicLayerDepth _item = new ItemDicLayerDepth(); _item.sJH = _sJH; _item.sXCM = cProjectData.ltStrProjectXCM[i]; _item.fDS1 = 0.0f; _item.fDS2 = 0.0f; //在输入的列表中查找,找到小层名的,把顶深和底深赋值,底深付下个顶深 int _iFind = -1; //设置没找到的标识 for (int k = 0; k < ltLayerDepthInput.Count; k++) { if (_item.sXCM == ltLayerDepthInput[k].sXCM) { _item.fDS1 = ltLayerDepthInput[k].fTop; if (k < ltLayerDepthInput.Count - 1) { _item.fDS2 = ltLayerDepthInput[k + 1].fTop; } if (k == ltLayerDepthInput.Count - 1) { _item.fDS2 = cProjectData.ltProjectWell.Find(p => p.sJH == _sJH).fWellBase; if (_item.fDS2 <= _item.fDS1) { _item.fDS2 = _item.fDS1; //如果找到了 最后一行的处理, } } _iFind = 1; //找到了 break; } } if (_iFind < 0) //如何没找到 { if (i == 0) { _item.fDS1 = ltLayerDepthInput[0].fTop; _item.fDS2 = _item.fDS1; } if (i > 0) { _item.fDS1 = ltLayerDepthWrite[ltLayerDepthWrite.Count - 1].fDS1; _item.fDS2 = _item.fDS1; } } ltLayerDepthWrite.Add(_item); } string filePath = Path.Combine(cProjectManager.dirPathWellDir, _sJH, cProjectManager.fileNameWellLayerDepth); List <string> ltStrLine = new List <string>(); foreach (ItemDicLayerDepth _item in ltLayerDepthWrite) { ltStrLine.Add(ItemDicLayerDepth.item2string(_item)); } cIOGeoEarthText.addDataLines2GeoEarTxt(filePath, ltStrLine); }