Example #1
0
        public static void write2File(string filePath, List <ItemJSJL> listItemJSJL)
        {
            StreamWriter swNew = new StreamWriter(filePath, false, Encoding.UTF8);

            foreach (ItemJSJL item in listItemJSJL)
            {
                swNew.WriteLine(ItemJSJL.item2string(item));
            }
            swNew.Close();
        }
Example #2
0
        public static string selectJSJL2String(string sJH)
        {
            string sReturn = "";


            foreach (var item in readJSJL2Struct(sJH))
            {
                sReturn += ItemJSJL.item2string(item) + "\t";
            }

            return(sReturn);
        }
Example #3
0
        public static void creatWellGeoFile(string _sJH)
        {
            string          filePath = Path.Combine(cProjectManager.dirPathWellDir, _sJH, cProjectManager.fileNameWellJSJL);
            List <ItemJSJL> ltJSJL   = readInputFile(_sJH);

            creatWellGeoHeadFile(_sJH);
            List <string> ltStrLine = new List <string>();

            foreach (ItemJSJL _item in ltJSJL.FindAll(p => p.sJH == _sJH))
            {
                ltStrLine.Add(ItemJSJL.item2string(_item));
            }
            cIOGeoEarthText.addDataLines2GeoEarTxt(filePath, ltStrLine);
        }
Example #4
0
        //劈分测井解释
        public static void splitJSJL2Layer(string _sJH)
        {
            List <ItemJSJL>          listJSJLinput  = readInputFile(_sJH);
            List <ItemDicLayerDepth> listLayerDepth = cIOinputLayerDepth.readLayerDepth2Struct(_sJH);
            string        filePath        = Path.Combine(cProjectManager.dirPathWellDir, _sJH, "#jsjlSplit.txt");
            List <string> ltStrHeadColoum = new List <string>();

            ltStrHeadColoum.Add("井号");
            ltStrHeadColoum.Add("顶深");
            ltStrHeadColoum.Add("底深");
            ltStrHeadColoum.Add("砂厚");
            ltStrHeadColoum.Add("有效厚度");
            ltStrHeadColoum.Add("孔隙度");
            ltStrHeadColoum.Add("渗透率");
            ltStrHeadColoum.Add("饱和度");
            ltStrHeadColoum.Add("测井解释");
            ltStrHeadColoum.Add("小层名");
            string sFirstLine = _sJH + "#劈分测井解释";

            cIOGeoEarthText.creatFileGeoHeadText(filePath, sFirstLine, ltStrHeadColoum);
            List <string> ltStrLine = new List <string>();

            foreach (ItemJSJL item in listJSJLinput)
            {
                string _topXCM = "";
                string _botXCM = "";
                int    mark    = 0;

                for (int i = 0; i < listLayerDepth.Count; i++)
                {
                    if (item.fDS1 >= listLayerDepth[i].fDS1 && item.fDS1 <= listLayerDepth[i].fDS2)
                    {
                        _topXCM = listLayerDepth[i].sXCM; mark = 1;
                    }
                    if (item.fDS2 >= listLayerDepth[i].fDS1 && item.fDS2 <= listLayerDepth[i].fDS2)
                    {
                        _botXCM = listLayerDepth[i].sXCM; mark = 2; break;
                    }
                }
                if (mark == 0)
                {
                    ltStrLine.Add(ItemJSJL.item2string(item));
                }
                else if (mark == 2)
                {
                    if (_topXCM == _botXCM)
                    {
                        ltStrLine.Add(ItemJSJL.item2string(item) + " " + _topXCM);
                    }
                    else if (_topXCM == "" || _botXCM == "")
                    {
                        ltStrLine.Add(ItemJSJL.item2string(item) + " " + _topXCM + "_" + _botXCM);
                    }
                    else
                    {
                        int _iStart = cProjectData.ltStrProjectXCM.IndexOf(_topXCM);
                        int _iEnd   = cProjectData.ltStrProjectXCM.IndexOf(_botXCM);
                        for (int k = _iStart; k < _iEnd; k++)
                        {
                            //需要改写。。。。
                            ltStrLine.Add(ItemJSJL.item2string(item) + " " + _topXCM);
                        }
                    }
                }
                else
                {
                    ltStrLine.Add(ItemJSJL.item2string(item) + " " + _topXCM);
                }

                ltStrLine.Add(ItemJSJL.item2string(item) + " " + _topXCM + "_" + _botXCM);
            }

            cIOGeoEarthText.addDataLines2GeoEarTxt(filePath, ltStrLine);
        }
Example #5
0
        //把解释结果归到小层
        public static void matchJSJL2Layer(string _sJH)
        {
            creatWellGeoHeadFile(_sJH);
            List <ItemJSJL>            listJSJLinput       = readInputFile(_sJH);
            List <ItemDicLayerDepth>   listLayerDepth      = cIOinputLayerDepth.readLayerDepth2Struct(_sJH);
            List <ItemLayerDepthInput> listLayerDepthInput = cIOinputLayerDepth.readInputFile(_sJH);

            if (listLayerDepthInput.Count == 0)
            {
                return;
            }
            List <string> layerInput = listLayerDepthInput.Select(p => p.sXCM).ToList();
            string        filePath   = Path.Combine(cProjectManager.dirPathWellDir, _sJH, cProjectManager.fileNameWellJSJL);
            List <string> ltStrLine  = new List <string>();

            foreach (ItemJSJL item in listJSJLinput)
            {
                string _topXCM = "";
                string _botXCM = "";
                int    mark    = 0;

                for (int i = 0; i < listLayerDepth.Count; i++)
                {
                    if (item.fDS1 >= listLayerDepth[i].fDS1 && item.fDS1 <= listLayerDepth[i].fDS2)
                    {
                        _topXCM = listLayerDepth[i].sXCM; mark = 1;
                    }
                    if (item.fDS2 >= listLayerDepth[i].fDS1 && item.fDS2 <= listLayerDepth[i].fDS2)
                    {
                        _botXCM = listLayerDepth[i].sXCM; mark = 2; break;
                    }
                }
                string _xcm = "";
                if (mark == 0)
                {
                    _xcm = "-";
                }
                else if (mark == 2)
                {
                    if (_topXCM == _botXCM)
                    {
                        _xcm = _topXCM;
                    }
                    else if (_topXCM == "" || _botXCM == "")
                    {
                        _xcm = _topXCM + "-" + _botXCM;
                    }
                    else
                    {
                        int _iStart = layerInput.IndexOf(_topXCM);
                        if (_iStart < 0)
                        {
                            _iStart = 0; _xcm = "-";
                        }
                        else
                        {
                            int _count = layerInput.IndexOf(_botXCM) - _iStart + 1;
                            if (_count <= 0)
                            {
                                _count = 0;
                            }
                            _xcm = string.Join("+", layerInput.GetRange(_iStart, _count).ToArray());
                        }
                    }
                }
                else
                {
                    _xcm = _topXCM + "-" + _botXCM;
                }

                ltStrLine.Add(ItemJSJL.item2string(item) + " " + _xcm);
            }

            cIOGeoEarthText.addDataLines2GeoEarTxt(filePath, ltStrLine);
        }