Exemplo n.º 1
0
        public static void TriTest(DataStruct.MouseTestResultData tresult, Dictionary <data.TestItem, bool> enTestItem, ref int startDrawX, ref int startDrawY, Graphics g, DataStruct.ProductIndex idx)
        {
            if (tresult == null || enTestItem == null || g == null)
            {
                return;
            }
            if (enTestItem[data.TestItem.EN_TRIANGLE])
            {
                startDrawX += tresult.X;
                startDrawY += tresult.Y;

                myPoint    p        = new myPoint("", startDrawX, startDrawY);
                myTriangle exTri    = (myTriangle)Result.GetShape(idx, DataStruct.TestType.DRAW_TRIANGLE_EX).shape;
                myTriangle innerTri = (myTriangle)Result.GetShape(idx, DataStruct.TestType.DRAW_TRIANGLE_INNER).shape;
                bool       cirRes   = PointAlgorithm.IsPointInTwoTriangle(p.GetPoint(), exTri, innerTri);
                if (cirRes)
                {
                    p.Draw(g, DataStruct.myColor.PASS, DataStruct.myColor.PASS, true, 1);
                }
                else
                {
                    p.Draw(g, DataStruct.myColor.FAIL, DataStruct.myColor.FAIL, true, 1);
                }

                p.Dispose();
                exTri.Dispose();
                innerTri.Dispose();
            }
        }
Exemplo n.º 2
0
        public static void CircleTest(DataStruct.MouseTestResultData tresult, Dictionary <data.TestItem, bool> enTestItem, ref int startDrawX, ref int startDrawY, Graphics g, DataStruct.ProductIndex idx)
        {
            if (tresult == null || enTestItem == null || g == null)
            {
                return;
            }
            if (enTestItem[data.TestItem.EN_CIRCLE])
            {
                startDrawX += tresult.X;
                startDrawY += tresult.Y;

                //当前点
                myPoint p = new myPoint("", startDrawX, startDrawY);
                //外圆
                myCircle exCir = (myCircle)Result.GetShape(idx, DataStruct.TestType.DRAW_CIRCLE_EX).shape;
                //内圆
                myCircle innerCir = (myCircle)Result.GetShape(idx, DataStruct.TestType.DRAW_CIRCLE_INNER).shape;
                //判断当前点是否在制定的内圆和外圆之间
                bool cirRes = PointAlgorithm.IsPointInTwoCircle(p, exCir, innerCir);
                if (cirRes)
                {
                    p.Draw(g, DataStruct.myColor.PASS, DataStruct.myColor.PASS, true, 1);
                }
                else
                {
                    p.Draw(g, DataStruct.myColor.FAIL, DataStruct.myColor.FAIL, true, 1);
                }

                p.Dispose();
                exCir.Dispose();
                innerCir.Dispose();
            }
        }