private void wait4import(object sender, WaitWindowEventArgs e)
 {
     //首先更新测井全局字典
     //字典里是否存在要导入的曲线,如果存在看单位,如果不存在加入
     updateLogDic();
     //导入曲线
     importLog(); //导入时更新了全局测井曲线,然后主界面刷新
 }
Exemple #2
0
        internal object DoWork()
        {
            //	Invoke the worker method and return any results.
            WaitWindowEventArgs e = new WaitWindowEventArgs(this._Parent, this._Parent._Args);

            if ((this._Parent._WorkerMethod != null))
            {
                this._Parent._WorkerMethod(this, e);
            }
            return(e.Result);
        }
Exemple #3
0
        private void SplitProductionWorkerMethod(object sender, WaitWindowEventArgs e)
        {
            List <string> ltStrJH_DicLayerData     = new List <string>();
            List <string> ltStrXCM_DicLayerData    = new List <string>();
            List <float>  fListSandHD_DicLayerData = new List <float>();
            List <float>  fListPerm_DicLayerData   = new List <float>();

            string[] split;
            int      iLineIndex = 0;

            try
            {
                using (StreamReader sr = new StreamReader(cProjectManager.filePathLayerDataDic))
                {
                    String line;

                    while ((line = sr.ReadLine()) != null) //delete the line whose legth is 0
                    {
                        iLineIndex++;
                        split = line.Trim().Split(new char[] { ' ', '\t' }, StringSplitOptions.RemoveEmptyEntries);
                        if (iLineIndex > 1 && split.Count() >= 12)
                        {
                            ltStrJH_DicLayerData.Add(split[0]);
                            ltStrXCM_DicLayerData.Add(split[1]);
                            fListSandHD_DicLayerData.Add(float.Parse(split[7]));
                            fListPerm_DicLayerData.Add(float.Parse(split[10]));
                        }
                    }
                }
            }

            catch (Exception ex)
            {
                MessageBox.Show(ex.ToString());
            }
            StreamWriter  sw = new StreamWriter(cProjectManager.filePathLayerSplitFactorDic, false, Encoding.UTF8);
            List <string> ltStrHeadColoum = new List <string>();

            ltStrHeadColoum.Add("JH");
            ltStrHeadColoum.Add("XCM");
            ltStrHeadColoum.Add("YYYYMM");
            ltStrHeadColoum.Add("LayerSplitFactor"); //劈分系数
            sw.WriteLine(string.Join("\t", ltStrHeadColoum.ToArray()));
            //算法 查找射孔井段是否射孔,查找当前井段的根据KH的比值劈分 劈分系数的问题
            //劈分系数字典 JH NY XCM PFXS 这个表可以由KH和射孔数据,由厚度等等得到,各种方法
            if (cProjectData.ltStrProjectJH.Count > 0 && cProjectData.ltStrProjectXCM.Count > 0)
            {
                for (int i = 0; i < cProjectData.ltStrProjectJH.Count; i++)
                {
                    for (int j = 0; j < cProjectData.ltStrProjectXCM.Count; j++)
                    {
                        for (int k = 0; k < cProjectData.ltStrProjectYM.Count; k++)
                        {
                            string sJH  = cProjectData.ltStrProjectJH[i];
                            string sXCM = cProjectData.ltStrProjectXCM[j];
                            string sYM  = cProjectData.ltStrProjectYM[k];

                            List <float> fListSH_temp   = new List <float>();
                            int          _iJHFirstIndex = ltStrJH_DicLayerData.IndexOf(sJH);
                            int          _iCount        = ltStrJH_DicLayerData.LastIndexOf(sJH) - _iJHFirstIndex;
                            float        _splitfactor   = 0.0F;
                            float        sumHD          = fListSandHD_DicLayerData.GetRange(_iJHFirstIndex, _iCount).Sum();
                            for (int ii = _iJHFirstIndex; ii < _iJHFirstIndex + _iCount; ii++)
                            {
                                if (ltStrXCM_DicLayerData[ii] == sXCM)
                                {
                                    _splitfactor = fListSandHD_DicLayerData[ii] / sumHD;
                                }
                            }

                            List <string> ltStrSplitDicWrited = new List <string>();
                            ltStrSplitDicWrited.Add(sJH);
                            ltStrSplitDicWrited.Add(sXCM);
                            ltStrSplitDicWrited.Add(sYM);
                            ltStrSplitDicWrited.Add(_splitfactor.ToString("0.00"));
                            sw.WriteLine(string.Join("\t", ltStrSplitDicWrited.ToArray()));
                        }
                    }
                }
            }
            sw.Close();
        }