/// <summary>
 /// 获取误差项目ID
 /// </summary>
 /// <param name="WcType">误差类型</param>
 /// <param name="GLFX">功率方向</param>
 /// <param name="Yj">元件</param>
 /// <param name="Glys">功率因素</param>
 /// <param name="xIb">电流倍数</param>
 /// <param name="XieBo">谐波 0不加,1加</param>
 /// <param name="Xiangxu">相序 0正相续,1逆相序</param>
 /// <returns></returns>
 public static string getWcPrjID(CLDC_Comm.Enum.Cus_WcType WcType, CLDC_Comm.Enum.Cus_PowerFangXiang GLFX, CLDC_Comm.Enum.Cus_PowerYuanJian Yj, string Glys, string xIb, int XieBo, int Xiangxu)
 {
     return(string.Format("{0}{1}{2}{3}{4}{5}{6}"
                          , (int)WcType
                          , (int)GLFX
                          , (int)Yj
                          , CLDC_DataCore.Const.GlobalUnit.g_SystemConfig.GlysZiDian.getGlysID(Glys)
                          , CLDC_DataCore.Const.GlobalUnit.g_SystemConfig.xIbDic.getxIbID(xIb)
                          , XieBo.ToString(), Xiangxu.ToString()));
 }
示例#2
0
        /// <summary>
        /// 拷贝方案
        /// </summary>
        public CLDC_DataCore.Model.Plan.Plan_YuRe Copy()
        {
            if (Dgv_Data.Rows.Count == 1)
            {
                return(new CLDC_DataCore.Model.Plan.Plan_YuRe((int)TaiType, ""));
            }

            CLDC_DataCore.Model.Plan.Plan_YuRe _Obj = new CLDC_DataCore.Model.Plan.Plan_YuRe((int)TaiType, "");

            for (int i = 0; i < Dgv_Data.Rows.Count; i++)
            {
                if (Dgv_Data[Dgv_Data.Columns.Count - 1, i].Value.ToString() == "添加")
                {
                    break;
                }
                else
                {
                    if (!this.CheckOK(i))
                    {
                        return(new CLDC_DataCore.Model.Plan.Plan_YuRe((int)TaiType, ""));
                    }

                    CLDC_Comm.Enum.Cus_PowerFangXiang _Tmp = new CLDC_Comm.Enum.Cus_PowerFangXiang();

                    if (Dgv_Data[1, i].Value.ToString() == CLDC_Comm.Enum.Cus_PowerFangXiang.正向有功.ToString())
                    {
                        _Tmp = CLDC_Comm.Enum.Cus_PowerFangXiang.正向有功;
                    }
                    else if (Dgv_Data[1, i].Value.ToString() == CLDC_Comm.Enum.Cus_PowerFangXiang.反向有功.ToString())
                    {
                        _Tmp = CLDC_Comm.Enum.Cus_PowerFangXiang.反向有功;
                    }
                    else if (Dgv_Data[1, i].Value.ToString() == CLDC_Comm.Enum.Cus_PowerFangXiang.正向无功.ToString())
                    {
                        _Tmp = CLDC_Comm.Enum.Cus_PowerFangXiang.正向无功;
                    }
                    else if (Dgv_Data[1, i].Value.ToString() == CLDC_Comm.Enum.Cus_PowerFangXiang.反向无功.ToString())
                    {
                        _Tmp = CLDC_Comm.Enum.Cus_PowerFangXiang.反向无功;
                    }
                    else
                    {
                        _Tmp = CLDC_Comm.Enum.Cus_PowerFangXiang.正向有功;
                    }

                    _Obj.Add(i, _Tmp, Dgv_Data[2, i].Value.ToString(), float.Parse(Dgv_Data[3, i].Value.ToString()));
                }
            }
            _Obj.SetPram((int)base.TaiType, base.FaName);

            return(_Obj);
        }
        /// <summary>
        /// 升源单击事件
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void ptn_ON_Click(object sender, EventArgs e)
        {
            lock (objLockthPn)
            {
                try
                {
                    CLDC_VerifyAdapter.Helper.EquipHelper.Instance.SetPowerSupplyType(3, false);
                }
                catch { }
                CLDC_DataCore.Const.GlobalUnit.OnlyToPower = true;

                CLDC_DataCore.Const.GlobalUnit.Clfs = getCLFS();//接线方式
                float U   = 0;
                float I   = 0;
                float feq = 50;
                CLDC_Comm.Enum.Cus_PowerYuanJian  ele  = CLDC_Comm.Enum.Cus_PowerYuanJian.H;
                CLDC_Comm.Enum.Cus_PowerFangXiang glfx = CLDC_Comm.Enum.Cus_PowerFangXiang.正向有功;

                string glys     = "1.0";
                bool   bYouGong = true;
                bYouGong = rdobtn_A.Checked;//有功无功
                bool isDuiBiao = false;
                CLDC_Comm.Enum.Cus_PowerPhase isNXX = CLDC_Comm.Enum.Cus_PowerPhase.正相序;

                U           = getU();
                I           = getI();
                feq         = getHz();
                ele         = getYJ();
                glfx        = getGLFX();
                glys        = txt_GLYS.Text;//getGLYS();
                isNXX       = chk_IsNXX.Checked ? CLDC_Comm.Enum.Cus_PowerPhase.电压逆相序 : CLDC_Comm.Enum.Cus_PowerPhase.正相序;
                isXieBo     = chk_XieBo.Checked;
                XieBoFaName = Cmb_XieBo.Text;
                //CLDC_VerifyAdapter.Helper.EquipHelper.Instance.PowerOn(U, I, ele, glfx, glys, bYouGong, isDuiBiao);
                System.Threading.Thread thPn = new System.Threading.Thread(() =>
                {
                    if (isXieBo)
                    {
                        LoadXieBo(XieBoFaName);
                        setXieBo(XieBoItem);
                    }
                    CLDC_VerifyAdapter.Helper.EquipHelper.Instance.PowerOn(U, U, U, I, I, I, ele, feq, glys, bYouGong, isDuiBiao, isNXX, glfx);
                    CLDC_DataCore.Const.GlobalUnit.OnlyToPower = false;
                });
                thPn.IsBackground = true;
                thPn.Start();
            }
        }
示例#4
0
        /// <summary>
        /// 添加一个预热项目
        /// </summary>
        /// <param name="Glfx">功率方向</param>
        /// <param name="xIb">电流倍数Imax</param>
        /// <param name="Time">时间(分钟)</param>
        /// <returns></returns>
        public bool Add(int Order, CLDC_Comm.Enum.Cus_PowerFangXiang Glfx, string xIb, float Time)
        {
            StPlan_YuRe _Item = new StPlan_YuRe();

            _Item.PowerFangXiang = Glfx;
            _Item.xIb            = xIb;
            _Item.Times          = Time;
            if (_LstYuRe.Contains(_Item))
            {
                Move(Order, _Item);
            }
            else
            {
                _LstYuRe.Insert(Order, _Item);
            }
            return(true);
        }
示例#5
0
 /// <summary>
 /// 设置误差选择点表格所属功率因素
 /// </summary>
 /// <param name="Glfx"></param>
 private void SetWcSetupGlfx(CLDC_Comm.Enum.Cus_PowerFangXiang Glfx)
 {
     if (WcSetup_H != null)
     {
         WcSetup_H.GLFX = Glfx;
     }
     if (WcSetup_A != null)
     {
         WcSetup_A.GLFX = Glfx;
     }
     if (WcSetup_B != null)
     {
         WcSetup_B.GLFX = Glfx;
     }
     if (WcSetup_C != null)
     {
         WcSetup_C.GLFX = Glfx;
     }
 }
示例#6
0
 /// <summary>
 /// 分解结构体参数组合字符串
 /// </summary>
 /// <param name="PramValue"></param>
 public void Split(string PramValue)
 {
     string[] _TmpPram = PramValue.Split('|');
     if (_TmpPram.Length != 5)
     {
         GLFX = CLDC_Comm.Enum.Cus_PowerFangXiang.正向有功;
         YJ   = CLDC_Comm.Enum.Cus_PowerYuanJian.H;
         xU   = 1F;
         xIb  = "0Ib";
         GLYS = "1.0";
         return;
     }
     GLFX = (CLDC_Comm.Enum.Cus_PowerFangXiang) int.Parse(_TmpPram[0]);
     YJ   = (CLDC_Comm.Enum.Cus_PowerYuanJian) int.Parse(_TmpPram[1]);
     xU   = float.Parse(_TmpPram[2]);
     xIb  = _TmpPram[3];
     GLYS = _TmpPram[4];
     return;
 }
 private CLDC_Comm.Enum.Cus_PowerFangXiang getGLFX()
 {
     CLDC_Comm.Enum.Cus_PowerFangXiang glfx = CLDC_Comm.Enum.Cus_PowerFangXiang.正向有功;
     if (rdobtn_A.Checked && rdobtn_P.Checked)
     {
         glfx = CLDC_Comm.Enum.Cus_PowerFangXiang.正向有功;
     }
     else if (rdobtn_A.Checked && rdobtn_Q.Checked)
     {
         glfx = CLDC_Comm.Enum.Cus_PowerFangXiang.正向无功;
     }
     else if (rdobtn_RA.Checked && rdobtn_P.Checked)
     {
         glfx = CLDC_Comm.Enum.Cus_PowerFangXiang.反向有功;
     }
     else if (rdobtn_RA.Checked && rdobtn_Q.Checked)
     {
         glfx = CLDC_Comm.Enum.Cus_PowerFangXiang.反向无功;
     }
     return(glfx);
 }
示例#8
0
        /// <summary>
        /// 设置功率方向按钮左边图片的样式,如果该功率方向下有要检点,则打钩,没有则为方框
        /// </summary>
        private void SetGlfxImageStyle(CLDC_Comm.Enum.Cus_PowerFangXiang Glfx)
        {
            ToolStripButton Item = null;

            switch (Glfx)
            {
            case CLDC_Comm.Enum.Cus_PowerFangXiang.正向有功:
                Item = Tab_Pz;
                break;

            case CLDC_Comm.Enum.Cus_PowerFangXiang.反向有功:
                Item = Tab_Pf;
                break;

            case CLDC_Comm.Enum.Cus_PowerFangXiang.正向无功:
                Item = Tab_Qz;
                break;

            case CLDC_Comm.Enum.Cus_PowerFangXiang.反向无功:
                Item = Tab_Qf;
                break;

            case CLDC_Comm.Enum.Cus_PowerFangXiang.第一象限无功:
                Item = Tab_Q1;
                break;

            case CLDC_Comm.Enum.Cus_PowerFangXiang.第二象限无功:
                Item = Tab_Q2;
                break;

            case CLDC_Comm.Enum.Cus_PowerFangXiang.第三象限无功:
                Item = Tab_Q3;
                break;

            case CLDC_Comm.Enum.Cus_PowerFangXiang.第四象限无功:
                Item = Tab_Q4;
                break;
            }

            if (Item == null)
            {
                return;
            }

            if (this.WcSetup_A != null && this.WcSetup_B != null && this.WcSetup_C != null)
            {
                if (this.WcSetup_H.PointCount + this.WcSetup_A.PointCount + this.WcSetup_B.PointCount + this.WcSetup_C.PointCount == 0)
                {
                    Item.Image = Pic_Not.Image;
                }
                else
                {
                    Item.Image = Pic_Have.Image;
                }
            }
            else
            {
                if (this.WcSetup_H.PointCount == 0)
                {
                    Item.Image = Pic_Not.Image;
                }
                else
                {
                    Item.Image = Pic_Have.Image;
                }
            }
        }
        /// <summary>
        /// 添加一个需要检定的误差点
        /// </summary>
        /// <param name="WcType">误差类型</param>
        /// <param name="Time1">时间1</param>
        /// <param name="Time2">时间2</param>
        public void Add(CLDC_Comm.Enum.Cus_WcType WcType, string Para1, string Para2, string Para3, string Para4, float time1, float time2)
        {
            CLDC_DataCore.Struct.StErrAccord     _Point     = new CLDC_DataCore.Struct.StErrAccord();
            CLDC_DataCore.Struct.StErrAccordbase _PointBase = new StErrAccordbase();

            _Point.PrjName = string.Format("{0} {1} {2} {3} {4}",
                                           Para1, Para2, Para3, Para4, WcType.ToString());

            _Point.lstErrPoint = new List <StErrAccordbase>();
            string[] strPara = { Para1, Para2, Para3, Para4 };


            //给默认参数
            //      功率方向:正向有功
            //      元    件:合元
            //      谐    波:0不加
            //      相    序:0正相续
            CLDC_Comm.Enum.Cus_PowerFangXiang _Fx = CLDC_Comm.Enum.Cus_PowerFangXiang.正向有功;
            CLDC_Comm.Enum.Cus_PowerYuanJian  _Yj = CLDC_Comm.Enum.Cus_PowerYuanJian.H;
            int _XieBo = 0;
            int _Xx    = 0;


            string strIb   = "";
            string strGlys = "";

            string[] strTmp = new string[2];

            for (int i = 0; i < 4; i++)
            {
                if (strPara[i].Trim() != "")
                {
                    strTmp     = strPara[i].Split('|');
                    strIb      = strTmp[0];
                    strGlys    = strTmp[1];
                    _PointBase = new StErrAccordbase();

                    _PointBase.PrjID = getWcPrjID(WcType, _Fx, _Yj, strGlys, strIb, _XieBo, _Xx);


                    string _GlfxString;
                    switch ((int)_Fx)
                    {
                    case 1:
                    {
                        _GlfxString = "P+";
                        break;
                    }

                    case 2:
                    {
                        _GlfxString = "P-";
                        break;
                    }

                    case 3:
                    {
                        _GlfxString = "Q+";
                        break;
                    }

                    case 4:
                    {
                        _GlfxString = "Q-";
                        break;
                    }

                    default:
                    {
                        _GlfxString = "P+";
                        break;
                    }
                    }

                    string strYj = "";

                    switch (_Yj.ToString().ToUpper())
                    {
                    case "H":
                        strYj = "合元";
                        break;

                    case "A":
                        strYj = "A元";
                        break;

                    case "B":
                        strYj = "B元";
                        break;

                    case "C":
                        strYj = "C元";
                        break;

                    default:
                        strYj = "合元";
                        break;
                    }

                    _PointBase.TestPointName = string.Format("{0} {1} {2} {3}",
                                                             _GlfxString, strYj, strGlys, strIb);
                    _PointBase.PowerYinSu   = strGlys;
                    _PointBase.PowerDianLiu = strIb;
                    _Point.lstErrPoint.Add(_PointBase);
                }
            }

            _Point.ErrAccordType = (int)WcType - 3;
            _Point.Time1         = time1;
            _Point.Time2         = time2;

            _LstErrAccord.Add(_Point);
            return;
        }
        /// <summary>
        /// 添加一个需要检定的误差点
        /// </summary>
        /// <param name="WcType">误差类型</param>
        /// <param name="GLFX">功率方向 </param>
        /// <param name="Yj">元件</param>
        /// <param name="Glys">功率因素</param>
        /// <param name="xIb">电流倍数</param>
        /// <param name="XieBo">是否加谐波0-不加,1-加</param>
        /// <param name="Xiangxu">相序0-正相序,1-逆相序</param>
        public void Add(CLDC_Comm.Enum.Cus_WcType WcType, CLDC_Comm.Enum.Cus_PowerFangXiang GLFX, CLDC_Comm.Enum.Cus_PowerYuanJian Yj, string Glys, string xIb, int XieBo, int Xiangxu, string strLimit)
        {
            string _PrjID = getWcPrjID(WcType, GLFX, Yj, Glys, xIb, XieBo, Xiangxu);

            if (CheckedYn(_PrjID) || _PrjID.Length != 9)
            {
                return;
            }
            StPlan_WcPoint _Point = new StPlan_WcPoint();

            _Point.PrjID = _PrjID;
            string _GlfxString;

            switch ((int)GLFX)
            {
            case 1:
            {
                _GlfxString = "P+";
                GlfxYj[0]   = true;
                break;
            }

            case 2:
            {
                _GlfxString = "P-";
                GlfxYj[1]   = true;
                break;
            }

            case 3:
            {
                _GlfxString = "Q+";
                GlfxYj[2]   = true;
                break;
            }

            case 4:
            {
                _GlfxString = "Q-";
                GlfxYj[3]   = true;
                break;
            }

            case 5:
            {
                _GlfxString = "Q1";
                GlfxYj[4]   = true;
                break;
            }

            case 6:
            {
                _GlfxString = "Q2";
                GlfxYj[5]   = true;
                break;
            }

            case 7:
            {
                _GlfxString = "Q3";
                GlfxYj[6]   = true;
                break;
            }

            case 8:
            {
                _GlfxString = "Q4";
                GlfxYj[7]   = true;
                break;
            }

            default:
            {
                _GlfxString = "P+";
                break;
            }
            }

            string _Yj = "";

            switch (Yj.ToString().ToUpper())
            {
            case "H":
                _Yj = "合元";
                break;

            case "A":
                _Yj = "A元";
                break;

            case "B":
                _Yj = "B元";
                break;

            case "C":
                _Yj = "C元";
                break;

            default:
                _Yj = "合元";
                break;
            }

            _Point.PrjName = string.Format("{0} {1} {2} {3} {4}",
                                           _GlfxString, _Yj, Glys, xIb, (int)WcType == 2 ? "标准偏差" : "基本误差");
            _Point.PowerYinSu   = Glys;
            _Point.PowerDianLiu = xIb;

            CLDC_DataCore.DataBase.IDAndValue   _WcLimitName  = _WcLimit.getWcLimitNameValue(CzWcLimit);
            CLDC_DataCore.DataBase.IDAndValue   _GuiChengName = _WcLimit.getGuiChengValue("JJG596-2012");
            CLDC_DataCore.DataBase.IDAndValue[] _DjValue      = new CLDC_DataCore.DataBase.IDAndValue[2];

            CLDC_DataCore.Model.DnbModel.DnbInfo.MeterBasicInfo meter = CLDC_DataCore.Const.GlobalUnit.g_CUS.DnbData.MeterGroup[CLDC_DataCore.Const.GlobalUnit.g_CUS.DnbData.GetFirstYaoJianMeterBwh()];
            string[] _DJ = CLDC_DataCore.Function.Number.getDj(meter.Mb_chrBdj);

            _DjValue[0] = _WcLimit.getDjValue(_DJ[0]);
            _DjValue[1] = _WcLimit.getDjValue(_DJ[1]);

            CLDC_DataCore.DataBase.IDAndValue _GlysValue = new CLDC_DataCore.DataBase.IDAndValue();         //功率因素值
            CLDC_DataCore.DataBase.IDAndValue _xIbValue  = new CLDC_DataCore.DataBase.IDAndValue();         //电流倍数值

            _GlysValue.Value = _Point.PowerYinSu;
            _GlysValue.id    = long.Parse(CLDC_DataCore.Const.GlobalUnit.g_SystemConfig.GlysZiDian.getGlysID(_GlysValue.Value));

            _xIbValue.Value = _Point.PowerDianLiu;
            _xIbValue.id    = long.Parse(CLDC_DataCore.Const.GlobalUnit.g_SystemConfig.xIbDic.getxIbID(_xIbValue.Value));

            bool _YouGong = true;

            if ((int)_Point.PowerFangXiang > 2)
            {
                _YouGong = false;
            }

            if (_Point.Pc == 0)          //基本误差的误差限获取
            {
                _WcLimit.SetWcx(_WcLimitName
                                , _GuiChengName
                                , (int)_Point.PowerFangXiang > 2 ? _DjValue[1] : _DjValue[0]
                                , _Point.PowerYuanJian
                                , meter.Mb_BlnHgq
                                , _YouGong, _GlysValue, _xIbValue, strLimit);
            }
            else
            {
                string[] _Wcx = _WcLimit.getPcxValue(_WcLimitName
                                                     , _GuiChengName
                                                     , (int)_Point.PowerFangXiang > 2 ? _DjValue[1] : _DjValue[0]).Split('|');

                _Point.SetWcx(float.Parse(_Wcx[0].Replace("+", "")), float.Parse(_Wcx[1]));      //设置误差限
            }

            LstCheckPoint.Add(_Point);
            return;
        }
        /// <summary>
        /// 设置检定圈数(09-7-2之后不再使用)
        /// </summary>
        /// <param name="Current">电流参数1.5(6)</param>
        /// <param name="MeConst">当前表常数 有功(无功)</param>
        /// <param name="MinConst">当台表最小常数(数组 下标0=有功,1=无功)</param>
        //public void SetQs(string Current,string MeConst,int[] MinConst)
        //{
        //    for (int _i = 0; _i < LstCheckPoint.Count; _i++)
        //    {
        //        CLDC_DataCore.Struct.CheckPoint _Item = LstCheckPoint[_i];
        //        _Item.SetLapCount(MinConst, MeConst, Current, Qscz, Czqs);
        //        LstCheckPoint[_i] = _Item;

        //    }
        //}

        /// <summary>
        /// 设置各个测试点误差限(09-7-2之后不再使用)
        /// </summary>
        /// <param name="GuiChengName">规程名称"JJG596-1999"</param>
        /// <param name="DjString">等级字符串1.0,0.5S(2.0)</param>
        /// <param name="Hgq">是否经互感器0-不,1-要</param>
        //public void SetWcx(string GuiChengName,string DjString,int Hgq)
        //{

        //    CLDC_DataCore.DataBase.clsWcLimitDataControl _WcLimit= new clsWcLimitDataControl();

        //    bool _YouGong =true;

        //    string[] _Dj = CLDC_DataCore.Function.Number.getDj(DjString);

        //    if (CzWcLimit == "规程误差限")              //参照规程误差限则直接通过公式计算误差限
        //    {
        //        for (int _i = 0; _i < LstCheckPoint.Count; _i++)
        //        {


        //            if ((int)LstCheckPoint[_i].PowerFangXiang > 2)
        //                _YouGong = false;

        //            string _Wcx = "";

        //            CLDC_DataCore.Struct.CheckPoint _Item = LstCheckPoint[_i];

        //            if (LstCheckPoint[_i].Pc == 0)          //基本误差的误差限获取
        //            {
        //                _Wcx = clsWcLimitDataControl.Wcx(LstCheckPoint[_i].PowerDianLiu
        //                                                        , GuiChengName
        //                                                        , (int)LstCheckPoint[_i].PowerFangXiang > 2 ? _Dj[1] : _Dj[0]
        //                                                        , LstCheckPoint[_i].PowerYuanJian
        //                                                        , LstCheckPoint[_i].PowerYinSu
        //                                                        , Hgq == 0 ? false : true
        //                                                        , _YouGong);


        //                _Item.SetWcx(float.Parse(_Wcx), float.Parse(string.Format("-{0}", _Wcx)));      //设置误差限
        //            }
        //            else
        //            {
        //                _Wcx = clsWcLimitDataControl.Pcx((int)LstCheckPoint[_i].PowerFangXiang > 2 ? _Dj[1] : _Dj[0]).ToString();      //如果是无功则使用无功等级
        //                _Item.SetWcx(float.Parse(_Wcx), 0F);      //设置误差限
        //            }

        //            LstCheckPoint[_i] = _Item;
        //        }
        //    }
        //    else
        //    {

        //        CLDC_DataCore.DataBase.IDAndValue _WcLimitName = _WcLimit.getWcLimitNameValue(CzWcLimit);
        //        CLDC_DataCore.DataBase.IDAndValue _GuiChengName = _WcLimit.getGuiChengValue(GuiChengName);
        //        CLDC_DataCore.DataBase.IDAndValue[] _DjValue = new IDAndValue[2];
        //        _DjValue[0] = _WcLimit.getDjValue(_Dj[0]);
        //        _DjValue[1] = _WcLimit.getDjValue(_Dj[1]);
        //        CLDC_DataCore.SystemModel.Item.csGlys _GlysCol = new CLDC_DataCore.SystemModel.Item.csGlys();
        //        CLDC_DataCore.SystemModel.Item.csxIbDic _xIbCol = new CLDC_DataCore.SystemModel.Item.csxIbDic();
        //        _GlysCol.Load();
        //        _xIbCol.Load();
        //        for (int _i = 0; _i < LstCheckPoint.Count; _i++)
        //        {

        //            CLDC_DataCore.Struct.CheckPoint _Item = LstCheckPoint[_i];

        //            CLDC_DataCore.DataBase.IDAndValue _GlysValue = new IDAndValue();         //功率因素值
        //            CLDC_DataCore.DataBase.IDAndValue _xIbValue = new IDAndValue();          //电流倍数值

        //            _GlysValue.Value = LstCheckPoint[_i].PowerYinSu;
        //            _GlysValue.id = long.Parse(_GlysCol.getGlysID(_GlysValue.Value));

        //            _xIbValue.Value = LstCheckPoint[_i].PowerDianLiu;
        //            _xIbValue.id = long.Parse(_xIbCol.getxIbID(_xIbValue.Value));

        //            if ((int)LstCheckPoint[_i].PowerFangXiang > 2)
        //                _YouGong = false;


        //            if (LstCheckPoint[_i].Pc == 0)          //基本误差的误差限获取
        //            {
        //                string[] _Wcx = _WcLimit.GetWcx(_WcLimitName
        //                                               , _GuiChengName
        //                                               , (int)LstCheckPoint[_i].PowerFangXiang > 2 ? _DjValue[1] : _DjValue[0]
        //                                               , LstCheckPoint[_i].PowerYuanJian
        //                                               , Hgq == 0 ? false : true
        //                                               , _YouGong, _GlysValue, _xIbValue).Split('|');

        //                _Item.SetWcx(float.Parse(_Wcx[0].Replace("+", "")), float.Parse(_Wcx[1]));      //设置误差限
        //            }
        //            else
        //            {
        //                string[] _Wcx = _WcLimit.getPcxValue(_WcLimitName
        //                                                , _GuiChengName
        //                                                , (int)LstCheckPoint[_i].PowerFangXiang > 2 ? _DjValue[1] : _DjValue[0]).Split('|');

        //                _Item.SetWcx(float.Parse(_Wcx[0].Replace("+", "")), float.Parse(_Wcx[1]));      //设置误差限

        //            }

        //            LstCheckPoint[_i] = _Item;
        //        }
        //    }

        //}
        #endregion

        /// <summary>
        /// 添加一个需要检定的误差点
        /// </summary>
        /// <param name="WcType">误差类型</param>
        /// <param name="GLFX">功率方向 </param>
        /// <param name="Yj">元件</param>
        /// <param name="Glys">功率因素</param>
        /// <param name="xIb">电流倍数</param>
        /// <param name="XieBo">是否加谐波0-不加,1-加</param>
        /// <param name="Xiangxu">相序0-正相序,1-逆相序</param>
        public void Add(CLDC_Comm.Enum.Cus_WcType WcType, CLDC_Comm.Enum.Cus_PowerFangXiang GLFX, CLDC_Comm.Enum.Cus_PowerYuanJian Yj, string Glys, string xIb, int XieBo, int Xiangxu)
        {
            string _PrjID = getWcPrjID(WcType, GLFX, Yj, Glys, xIb, XieBo, Xiangxu);

            if (CheckedYn(_PrjID))
            {
                return;
            }
            StPlan_WcPoint _Point = new StPlan_WcPoint();

            _Point.PrjID = _PrjID;
            string _GlfxString;

            switch ((int)GLFX)
            {
            case 1:
            {
                _GlfxString = "P+";
                GlfxYj[0]   = true;
                break;
            }

            case 2:
            {
                _GlfxString = "P-";
                GlfxYj[1]   = true;
                break;
            }

            case 3:
            {
                _GlfxString = "Q+";
                GlfxYj[2]   = true;
                break;
            }

            case 4:
            {
                _GlfxString = "Q-";
                GlfxYj[3]   = true;
                break;
            }

            case 5:
            {
                _GlfxString = "Q1";
                GlfxYj[4]   = true;
                break;
            }

            case 6:
            {
                _GlfxString = "Q2";
                GlfxYj[5]   = true;
                break;
            }

            case 7:
            {
                _GlfxString = "Q3";
                GlfxYj[6]   = true;
                break;
            }

            case 8:
            {
                _GlfxString = "Q4";
                GlfxYj[7]   = true;
                break;
            }

            default:
            {
                _GlfxString = "P+";
                break;
            }
            }

            string _Yj = "";

            switch (Yj.ToString().ToUpper())
            {
            case "H":
                _Yj = "合元";
                break;

            case "A":
                _Yj = "A元";
                break;

            case "B":
                _Yj = "B元";
                break;

            case "C":
                _Yj = "C元";
                break;

            default:
                _Yj = "合元";
                break;
            }

            _Point.PrjName = string.Format("{0} {1} {2} {3} {4}",
                                           _GlfxString, _Yj, Glys, xIb, (int)WcType == 2 ? "标准偏差" : " "); //基本误差
            _Point.PowerYinSu   = Glys;
            _Point.PowerDianLiu = xIb;

            LstCheckPoint.Add(_Point);
            return;
        }
 /// <summary>
 /// 验证该功率方向是否要捡
 /// </summary>
 /// <param name="Glfx">功率方向</param>
 /// <returns></returns>
 public bool YaoJianGlfx(CLDC_Comm.Enum.Cus_PowerFangXiang Glfx)
 {
     return(GlfxYj[(int)Glfx - 1]);
 }
示例#13
0
        /// <summary>
        /// 拷贝方案
        /// </summary>
        public CLDC_DataCore.Model.Plan.Plan_ZouZi Copy()
        {
            if (Dgv_Data.Rows.Count == 1)
            {
                return(new CLDC_DataCore.Model.Plan.Plan_ZouZi((int)TaiType, ""));
            }

            CLDC_DataCore.Model.Plan.Plan_ZouZi _Obj = new CLDC_DataCore.Model.Plan.Plan_ZouZi((int)TaiType, "");

            for (int i = 0; i < Dgv_Data.Rows.Count; i++)
            {
                if (Dgv_Data[Dgv_Data.Columns.Count - 1, i].Value.ToString() == CONST_ADD)
                {
                    break;
                }
                else
                {
                    if (!this.CheckOK(i))
                    {
                        return(new CLDC_DataCore.Model.Plan.Plan_ZouZi((int)TaiType, ""));
                    }

                    CLDC_Comm.Enum.Cus_PowerFangXiang _Tmp = new CLDC_Comm.Enum.Cus_PowerFangXiang();

                    if (Dgv_Data[1, i].Value.ToString() == CLDC_Comm.Enum.Cus_PowerFangXiang.正向有功.ToString())
                    {
                        _Tmp = CLDC_Comm.Enum.Cus_PowerFangXiang.正向有功;
                    }
                    else if (Dgv_Data[1, i].Value.ToString() == CLDC_Comm.Enum.Cus_PowerFangXiang.反向有功.ToString())
                    {
                        _Tmp = CLDC_Comm.Enum.Cus_PowerFangXiang.反向有功;
                    }
                    else if (Dgv_Data[1, i].Value.ToString() == CLDC_Comm.Enum.Cus_PowerFangXiang.正向无功.ToString())
                    {
                        _Tmp = CLDC_Comm.Enum.Cus_PowerFangXiang.正向无功;
                    }
                    else if (Dgv_Data[1, i].Value.ToString() == CLDC_Comm.Enum.Cus_PowerFangXiang.反向无功.ToString())
                    {
                        _Tmp = CLDC_Comm.Enum.Cus_PowerFangXiang.反向无功;
                    }
                    else if (Dgv_Data[1, i].Value.ToString() == CLDC_Comm.Enum.Cus_PowerFangXiang.第一象限无功.ToString())
                    {
                        _Tmp = CLDC_Comm.Enum.Cus_PowerFangXiang.第一象限无功;
                    }
                    else if (Dgv_Data[1, i].Value.ToString() == CLDC_Comm.Enum.Cus_PowerFangXiang.第二象限无功.ToString())
                    {
                        _Tmp = CLDC_Comm.Enum.Cus_PowerFangXiang.第二象限无功;
                    }
                    else if (Dgv_Data[1, i].Value.ToString() == CLDC_Comm.Enum.Cus_PowerFangXiang.第三象限无功.ToString())
                    {
                        _Tmp = CLDC_Comm.Enum.Cus_PowerFangXiang.第三象限无功;
                    }
                    else if (Dgv_Data[1, i].Value.ToString() == CLDC_Comm.Enum.Cus_PowerFangXiang.第四象限无功.ToString())
                    {
                        _Tmp = CLDC_Comm.Enum.Cus_PowerFangXiang.第四象限无功;
                    }
                    else
                    {
                        _Tmp = CLDC_Comm.Enum.Cus_PowerFangXiang.正向有功;
                    }

                    CLDC_Comm.Enum.Cus_ZouZiMethod _TmpMethod = new CLDC_Comm.Enum.Cus_ZouZiMethod();

                    if (Dgv_Data[5, i].Value.ToString() == CLDC_Comm.Enum.Cus_ZouZiMethod.标准表法.ToString())
                    {
                        _TmpMethod = CLDC_Comm.Enum.Cus_ZouZiMethod.标准表法;
                    }
                    else if (Dgv_Data[5, i].Value.ToString() == CLDC_Comm.Enum.Cus_ZouZiMethod.基本走字法.ToString())
                    {
                        _TmpMethod = CLDC_Comm.Enum.Cus_ZouZiMethod.基本走字法;
                    }
                    else if (Dgv_Data[5, i].Value.ToString() == CLDC_Comm.Enum.Cus_ZouZiMethod.计读脉冲法.ToString())
                    {
                        _TmpMethod = CLDC_Comm.Enum.Cus_ZouZiMethod.计读脉冲法;
                    }
                    else if (Dgv_Data[5, i].Value.ToString() == CLDC_Comm.Enum.Cus_ZouZiMethod.校核常数.ToString())
                    {
                        _TmpMethod = CLDC_Comm.Enum.Cus_ZouZiMethod.校核常数;
                    }
                    else
                    {
                        _TmpMethod = CLDC_Comm.Enum.Cus_ZouZiMethod.标准表法;
                    }
                    CLDC_Comm.Enum.Cus_PowerYuanJian _TmpYuan = new CLDC_Comm.Enum.Cus_PowerYuanJian();

                    if (Dgv_Data[2, i].Value.ToString() == CLDC_Comm.Enum.Cus_PowerYuanJian.H.ToString())
                    {
                        _TmpYuan = CLDC_Comm.Enum.Cus_PowerYuanJian.H;
                    }
                    else if (Dgv_Data[2, i].Value.ToString() == CLDC_Comm.Enum.Cus_PowerYuanJian.A.ToString())
                    {
                        _TmpYuan = CLDC_Comm.Enum.Cus_PowerYuanJian.A;
                    }
                    else if (Dgv_Data[2, i].Value.ToString() == CLDC_Comm.Enum.Cus_PowerYuanJian.B.ToString())
                    {
                        _TmpYuan = CLDC_Comm.Enum.Cus_PowerYuanJian.B;
                    }
                    else if (Dgv_Data[2, i].Value.ToString() == CLDC_Comm.Enum.Cus_PowerYuanJian.C.ToString())
                    {
                        _TmpYuan = CLDC_Comm.Enum.Cus_PowerYuanJian.C;
                    }
                    else
                    {
                        _TmpYuan = CLDC_Comm.Enum.Cus_PowerYuanJian.H;
                    }



                    _Obj.Add(_Tmp,                                                                         //功率方向
                             _TmpMethod,                                                                   //走字方法
                             _TmpYuan,                                                                     //元件
                             Dgv_Data[3, i].Value.ToString(),                                              //功率因素
                             Dgv_Data[4, i].Value.ToString(),                                              //电流倍数
                             "",                                                                           //走字描述
                             Dgv_Data[7, i].Value == null?"0":(bool)Dgv_Data[7, i].Value == false?"0":"1", //组合误差
                             (List <StPlan_ZouZi.StPrjFellv>)Dgv_Data[6, i].Tag);                          //走字项目
                }
            }
            _Obj.SetPram((int)base.TaiType, base.FaName);

            return(_Obj);
        }