Пример #1
0
        public bool SingleTrendChart(ref TrendChart dic)
        {
            //int nScores = testScores.Length;
            dic = new TrendChart();

            #region 绘制控制线

            /*************************
             *        USL
             * **********************/
            if (mUSL != decimal.MinValue)
            {
                dic.USL = mUSL;
                string USL_Lable = "USL=" + dic.USL.ToString();
                dic.Label_USL = USL_Lable;
            }

            /*************************
             *        LSL
             * **********************/
            if (mLSL != decimal.MinValue)
            {
                dic.LSL = mLSL;
                string LSL_Lable = "LSL=" + dic.LSL.ToString();
                dic.Label_LSL = LSL_Lable;
            }

            /*************************
             *        LUCL
             * **********************/
            if (mLUSL != decimal.MinValue)
            {
                dic.LUCL = mLUSL;
                string LUCL_Lable = "LUCL=" + dic.LUCL.ToString();
                dic.Label_LUCL = LUCL_Lable;
            }

            /*************************
            *        LLCL
            * ***********************/
            if (mLLSL != decimal.MinValue)
            {
                dic.LLCL = mLLSL;
                string LLCL_Lable = "LLCL=" + dic.LLCL.ToString();
                dic.Label_LLCL = LLCL_Lable;
            }

            /*************************
             *        _
             *        X
             * **********************/
            if (mX1 != decimal.MinValue)
            {
                dic.X = mX1;
                string X_Lable = " X =" + Math.Round(dic.X, prec + 1).ToString();
                dic.X_Lab = X_Lable;
            }
            //
            #endregion

            dic.Number         = Numbers;
            dic.testScores     = testScores;
            dic.eightScores    = eightScores;
            dic.overCLNumbers  = overCLNumbers;
            dic.overCLScores   = overCLScores;
            dic.overNumbers    = overNumbers;
            dic.overTestScores = overTestScores;
            ///////////////////////////////////////////////////////////////////////////
            return(false);
        }
Пример #2
0
        public bool MutiTrendChart(ref TrendChart dic)
        {
            int nScores = testScores.Length;

            //  dic = new Dictionary<string, object>();
            dic = new TrendChart();
            //labels.DefaultLabelStyle.BackColor = chart.Style.BackColor;
            #region 绘制控制线
            int index = -1;

            /*************************
             *        USL
             * **********************/
            if (mUSL != decimal.MinValue)
            {
                dic.USL = mUSL;
                string USL_Lable = "USL=" + dic.USL.ToString();
                dic.Label_USL = USL_Lable;
            }

            /*************************
             *        LSL
             * **********************/
            if (mLSL != decimal.MinValue)
            {
                dic.LSL = mLSL;
                string LSL_Lable = "LSL=" + dic.LSL.ToString();
                dic.Label_LSL = LSL_Lable;
            }

            /*************************
             *        LUCL
             * **********************/
            if (mLUSL != decimal.MinValue)
            {
                dic.LUCL = mLUSL;
                string LUCL_Lable = "LUCL=" + dic.LUCL.ToString();
                dic.Label_LUCL = LUCL_Lable;
            }

            /*************************
            *        LLCL
            * ***********************/
            if (mLLSL != decimal.MinValue)
            {
                dic.LLCL = mLLSL;
                string LLCL_Lable = "LLCL=" + dic.LLCL.ToString();
                dic.Label_LLCL = LLCL_Lable;
            }

            /*************************
             *        _
             *        X
             * **********************/
            if (mX1 != decimal.MinValue)
            {
                dic.X = mX1;
                string X_Lable = " X =" + Math.Round(dic.X, prec + 1).ToString();
                dic.X_Lab = X_Lable;
            }
            //
            #endregion
            dic.Number      = Numbers;
            dic.testScores  = testScores;
            dic.eightScores = eightScores;

            dic.overCLNumbers  = overCLNumbers;
            dic.overCLScores   = overCLScores;
            dic.overNumbers    = overNumbers;
            dic.overTestScores = overTestScores;


            return(false);
        }
Пример #3
0
        public bool MRChart(ref TrendChart dic)
        {
            dic = new TrendChart();


            try
            {
                decimal[] testScores = (decimal[])Array.CreateInstance(typeof(decimal), this.testScores.Length - 1);
                for (int i = 1; i < this.testScores.Length; i++)
                {
                    testScores[i - 1] = Math.Abs(this.testScores[i] - this.testScores[i - 1]);
                }
                int[] Numbers = (int[])Array.CreateInstance(typeof(int), this.testScores.Length - 1);
                int   nScores = testScores.Length;
                for (int i = 1; i <= nScores; i++)
                {
                    Numbers[i - 1] = i + 1;
                }
                //
                decimal total = 0m;
                for (int i = 0; i < testScores.Length; i++)
                {
                    total += testScores[i];
                }

                try
                {
                    mMR1 = total / testScores.Length;
                }
                catch
                {
                    mMR1 = decimal.MinValue;
                }

                #region 绘制控制线
                //UCL
                dic.UCL       = Math.Round((3.267m * mMR1), 6);
                dic.Label_UCL = "UCL=" + dic.UCL.ToString();

                //LCL
                dic.LCL       = 0;
                dic.Label_LCL = "LCL";

                //MR
                dic.MR       = Math.Round(mMR1, 6);
                dic.Label_MR = "MR=" + dic.MR.ToString();
                #endregion

                dic.Number     = Numbers;
                dic.testScores = testScores;


                return(false);
            }
            catch (Exception ex)
            {
                return(false);

                Loger.Error(ex);
            }
        }