Ejemplo n.º 1
0
        public static List <ItemDicPerforation> readPerforateFile(string _sJH)
        {
            List <ItemDicPerforation> listReturn = new List <ItemDicPerforation>();
            string filePath = Path.Combine(cProjectManager.dirPathWellDir, _sJH, cProjectManager.fileNameWellPerforation);

            if (File.Exists(filePath))
            {
                using (StreamReader sr = new StreamReader(filePath, Encoding.UTF8))
                {
                    String line;
                    int    iLine = 0;
                    while ((line = sr.ReadLine()) != null) //delete the line whose legth is 0
                    {
                        iLine++;
                        if (iLine > 8) //geofile 从8开始
                        {
                            if (line.TrimEnd() != "")
                            {
                                ItemDicPerforation sttItem = ItemDicPerforation.parseLine(line);
                                if (sttItem.sJH != null)
                                {
                                    listReturn.Add(sttItem);
                                }
                            }
                        }
                    }
                }
            }
            return(listReturn);
        }
Ejemplo n.º 2
0
        public static ItemDicPerforation getItemByJHandXCM(string _sJH, string _xcm)
        {
            ItemDicPerforation itemReturn = new ItemDicPerforation();
            string             filePath   = Path.Combine(cProjectManager.dirPathWellDir, _sJH, cProjectManager.fileNameWellPerforation);

            if (File.Exists(filePath))
            {
                using (StreamReader sr = new StreamReader(filePath, Encoding.UTF8))
                {
                    String line;
                    int    iLine = 0;
                    while ((line = sr.ReadLine()) != null) //delete the line whose legth is 0
                    {
                        iLine++;
                        if (iLine > 8) //geofile 从8开始
                        {
                            if (line.TrimEnd() != "")
                            {
                                ItemDicPerforation sttItem = ItemDicPerforation.parseLine(line);
                                if (sttItem.sJH != null)
                                {
                                    if (sttItem.sJH == _sJH && sttItem.sXCM == _xcm)
                                    {
                                        return(sttItem);
                                    }
                                }
                            }
                        }
                    }
                }
            }
            return(itemReturn);
        }