Exemple #1
0
        /// <summary> 转换成SimON格式的项 </summary>
        public WELLCTRL ConvertToSimON(OPT.Product.SimalorManager.Item item, DATES date, List <NAME> histNames)
        {
            WELLCTRL well = new WELLCTRL("WELLCTRL");

            if (item is WCONPROD.ItemHY)
            {
                WCONPROD.ItemHY nIt = item as WCONPROD.ItemHY;

                #region - 转换历史数据 -

                NAME name = histNames.Find(l => l.WellName == nIt.jm0);

                if (name == null)
                {
                    LogProviderHandler.Instance.OnRunLog("当前日期:" + date.DateTime + "井" + nIt.jm0 + "未找到对应的历史信息!");
                    return(null);
                }


                DAYS days = name.Find <DAYS>();

                if (days == null)
                {
                    days = new DAYS("DAYS");
                    name.Add(days);
                }
                DAYS.Item dayitem = new DAYS.Item();
                dayitem.Time0 = date.DateTime;
                dayitem.Csl1  = nIt.rcsl4;
                dayitem.Cql2  = nIt.rcql5;
                dayitem.Cyl3  = nIt.rcyl3;
                dayitem.Cyl7  = nIt.liqutPro6;
                days.Items.Add(dayitem);

                #endregion

                #region - 转换数模数据 -

                well.WellName0 = nIt.jm0;
                well.Jcyblxz2  = nIt.rcsl4;

                //  产水
                if (nIt.kzms2 == "WATER")
                {
                    well.Jcyblxz2 = nIt.rcsl4;
                    well.ProType  = SimONProductType.WRAT;
                }
                if (nIt.kzms2 == "GRAT")
                {
                    //  产气
                    well.Jcyblxz2 = nIt.rcql5;
                    well.ProType  = SimONProductType.GRAT;
                }
                if (nIt.kzms2 == "ORAT")
                {
                    //  产油
                    well.Jcyblxz2 = nIt.rcyl3;
                    well.ProType  = SimONProductType.ORAT;
                }

                if (nIt.kzms2 == "LRAT")
                {
                    //  产液
                    well.Jcyblxz2 = (nIt.rcyl3.ToDouble() + nIt.rcsl4.ToDouble()).ToString();
                    well.ProType  = SimONProductType.LRAT;
                }
                #endregion
            }
            else if (item is WCONHIST.Item)
            {
                WCONHIST.Item nIt = item as WCONHIST.Item;

                #region - 转换历史数据 -

                NAME name = histNames.Find(l => l.WellName == nIt.wellName0);

                if (name == null)
                {
                    LogProviderHandler.Instance.OnRunLog("当前日期:" + date.DateTime + "井" + nIt.wellName0 + "未找到对应的历史信息!");
                    return(well);
                }
                DAYS days = name.Find <DAYS>();

                if (days == null)
                {
                    days = new DAYS("DAYS");
                    name.Add(days);
                }
                DAYS.Item dayitem = new DAYS.Item();
                dayitem.Time0 = date.DateTime;
                dayitem.Csl1  = nIt.waterPro4;
                dayitem.Cql2  = nIt.gasPro5;
                dayitem.Cyl3  = nIt.oilPro3;
                dayitem.Cyl7  = (nIt.waterPro4.ToDouble() + nIt.oilPro3.ToDouble()).ToString();
                days.Items.Add(dayitem);

                #endregion

                #region - 转换数模数据 -

                well.WellName0 = nIt.wellName0;
                well.Jcyblxz2  = nIt.waterPro4;


                //  产水
                if (nIt.ctrlModel2 == "WATER")
                {
                    well.Jcyblxz2 = nIt.waterPro4;
                    well.ProType  = SimONProductType.WRAT;
                }
                if (nIt.ctrlModel2 == "GRAT")
                {
                    //  产气
                    well.Jcyblxz2 = nIt.gasPro5;
                    well.ProType  = SimONProductType.GRAT;
                }
                if (nIt.ctrlModel2 == "ORAT")
                {
                    //  产油
                    well.Jcyblxz2 = nIt.oilPro3;
                    well.ProType  = SimONProductType.ORAT;
                }

                if (nIt.ctrlModel2 == "LRAT")
                {
                    //  产液
                    well.Jcyblxz2 = (nIt.waterPro4.ToDouble() + nIt.oilPro3.ToDouble()).ToString();
                    well.ProType  = SimONProductType.LRAT;
                }
                #endregion
            }

            else if (item is WCONINJE.ItemHY)
            {
                WCONINJE.ItemHY nIt = item as WCONINJE.ItemHY;

                #region - 转换历史数据 -

                NAME name = histNames.Find(l => l.WellName == nIt.jm0);

                if (name == null)
                {
                    LogProviderHandler.Instance.OnRunLog("当前日期:" + date.DateTime + "井" + nIt.jm0 + "未找到对应的历史信息!");
                    return(well);
                }


                DAYS days = name.Find <DAYS>();

                if (days == null)
                {
                    days = new DAYS("DAYS");
                    name.Add(days);
                }
                DAYS.Item dayitem = new DAYS.Item();
                dayitem.Time0 = date.DateTime;

                if (nIt.zrltlx1 == "WATER")
                {
                    dayitem.Zsl4 = nIt.rzrl4;
                }
                else
                {
                    dayitem.Zql5 = nIt.rzrl4;
                }

                days.Items.Add(dayitem);

                #endregion

                #region - 转换数模数据 -

                well.WellName0 = nIt.jm0;


                if (nIt.zrltlx1 == "WATER")
                {
                    //well.Jcyblxz2 = nIt.rzrl4;
                    well.Jcyblxz2 = nIt.rzrl4;
                    well.ProType  = SimONProductType.WIR;
                }
                else
                {
                    //well.Jcyblxz2 = nIt.rzrl4;
                    //well.Jkkz1 = "6";

                    well.Jcyblxz2 = nIt.rzrl4;
                    well.ProType  = SimONProductType.GIR;
                }

                #endregion
            }
            else if (item is WCONINJH.Item)
            {
                WCONINJH.Item nIt = item as WCONINJH.Item;

                #region - 转换历史数据 -

                NAME name = histNames.Find(l => l.WellName == nIt.jm0);

                if (name == null)
                {
                    LogProviderHandler.Instance.OnRunLog("当前日期:" + date.DateTime + "井" + nIt.jm0 + "未找到对应的历史信息!");
                    return(well);
                }


                DAYS days = name.Find <DAYS>();

                if (days == null)
                {
                    days = new DAYS("DAYS");
                    name.Add(days);
                }
                DAYS.Item dayitem = new DAYS.Item();
                dayitem.Time0 = date.DateTime;

                if (nIt.zrltlx1 == "WATER")
                {
                    dayitem.Zsl4 = nIt.rzrl3;
                }
                else
                {
                    dayitem.Zql5 = nIt.rzrl3;
                }

                days.Items.Add(dayitem);

                #endregion

                #region - 转换数模数据 -

                well.WellName0 = nIt.jm0;

                if (nIt.zrltlx1 == "WATER")
                {
                    well.Jcyblxz2 = nIt.rzrl3;
                    //well.Jkkz1 = "7";
                    well.ProType = SimONProductType.WIBHP;
                }
                else
                {
                    well.Jcyblxz2 = nIt.rzrl3;
                    //well.Jkkz1 = "8";
                    well.ProType = SimONProductType.GIBHP;
                }

                #endregion
            }

            return(well);
        }