Example #1
0
        //public static List<SonImg> GetCheckedImgVal(string caprev)
        //{
        //    var ret = new List<SonImg>();

        //    var dict = new Dictionary<string, string>();
        //    var sql = "";
        //    if (string.IsNullOrEmpty(caprev))
        //    {
        //        sql = @"select top 30000 s.ChildImg,s.ImgVal from [WAT].[dbo].[SonImg] (nolock) s
        //                    where s.ImgChecked = 'TRUE' order by UpdateTime desc";
        //    }
        //    else
        //    {
        //        sql = @"select top 30000 s.ChildImg,s.ImgVal from [WAT].[dbo].[SonImg] (nolock) s
        //                  inner join [WAT].[dbo].[FatherImg] (nolock) f on f.MainImgKey = s.MainImgKey
        //                  where s.ImgChecked = 'TRUE' and f.CaptureRev = @CaptureRev order by UpdateTime desc";
        //        dict.Add("@CaptureRev", caprev);
        //    }
        //    var dbret = DBUtility.ExeLocalSqlWithRes(sql, dict);
        //    foreach (var line in dbret)
        //    {
        //        var tempvm = new SonImg();
        //        tempvm.ChildImg = UT.O2S(line[0]);
        //        tempvm.ImgVal = UT.O2I(line[1]);
        //        ret.Add(tempvm);
        //    }
        //    return ret;
        //}

        public static List <AITrainingData> GetTrainingData(string revision)
        {
            var ret = new List <AITrainingData>();

            var dict = new Dictionary <string, string>();
            var sql  = "";

            if (string.IsNullOrEmpty(revision))
            {
                sql = @"select top 30000 TrainingImg,ImgVal from [WAT].[dbo].[AITrainingData] order by UpdateTime desc";
            }
            else
            {
                sql = @"select top 30000  TrainingImg,ImgVal from [WAT].[dbo].[AITrainingData] where Revision=@Revision order by UpdateTime desc";
                dict.Add("@Revision", revision);
            }
            var dbret = DBUtility.ExeLocalSqlWithRes(sql, dict);

            foreach (var line in dbret)
            {
                var tempvm = new AITrainingData();
                tempvm.TrainingImg = UT.O2S(line[0]);
                tempvm.ImgVal      = UT.O2I(line[1]);
                ret.Add(tempvm);
            }
            return(ret);
        }
        public JsonResult GetVcselScreenHistory()
        {
            var wf = Request.Form["wf"];
            var x  = Request.Form["x"];
            var y  = Request.Form["y"];

            if (x.Length > 0)
            {
                x = UT.O2I(x).ToString();
            }
            if (y.Length > 0)
            {
                y = UT.O2I(y).ToString();
            }

            var hisdata = ProbeTestData.GetQueryHistory(wf, x, y);
            var ret     = new JsonResult();

            ret.MaxJsonLength = Int32.MaxValue;
            ret.Data          = new
            {
                hisdata = hisdata
            };
            return(ret);
        }
        public JsonResult VcselScreenData()
        {
            string IP       = Request.UserHostName;
            string compName = DetermineCompName(IP);

            var wf = Request.Form["wf"].Trim();
            var x  = UT.O2I(Request.Form["x"]).ToString();
            var y  = UT.O2I(Request.Form["y"]).ToString();

            var rest = "";

            if (wf.Length != 9 || !wf.Contains("-"))
            {
                rest = "<span style='color:red'>WAFER NUMBER WRONG</span>";
                var ret1 = new JsonResult();
                ret1.MaxJsonLength = Int32.MaxValue;
                ret1.Data          = new
                {
                    wf   = wf,
                    x    = "X: " + x,
                    y    = "Y: " + y,
                    ar   = "Array: ",
                    ap   = "AP: ",
                    rest = rest
                };
                return(ret1);
            }

            var xlist = new List <int>();

            var probe = ProbeTestData.GetApSizeByWafer(wf, x, y);

            if (string.IsNullOrEmpty(probe.ApSize))
            {
                if (ProbeTestData.HasData(wf))
                {
                    rest = "<span style='color:red'>NO DATA</span>";
                }
                else
                {
                    rest = "<span style='color:red'>" + ProbeTestData.PrepareWaferAPSizeData(wf) + "</span>";
                }
            }
            else
            {
                var aps = UT.O2D(probe.ApSize);
                if (aps > 6.5)
                {
                    var array = UT.O2I(probe.APVal1);
                    if (array > 1)
                    {
                        var idx    = (UT.O2I(x) - 1) / array;
                        var firstx = idx * array + 1;
                        xlist.Add(firstx);
                        for (var i = 1; i < array; i++)
                        {
                            xlist.Add(firstx + i);
                        }

                        var matchfail = false;
                        foreach (var tempx in xlist)
                        {
                            probe = ProbeTestData.GetApSizeByWafer(wf, tempx.ToString(), y);
                            if (!string.IsNullOrEmpty(probe.ApSize) && UT.O2D(probe.ApSize) <= 6.5)
                            {
                                matchfail = true;
                                break;
                            }
                        }

                        if (matchfail)
                        {
                            rest = "<span style='color:red'>FAIL</span>";
                        }
                        else
                        {
                            rest = "<span style='color:green'>PASS</span>";
                        }
                    }
                    else
                    {
                        rest = "<span style='color:green'>PASS</span>";
                    }
                }
                else
                {
                    rest = "<span style='color:red'>FAIL</span>";
                }
            }

            ProbeTestData.UpdateQueryHistory(wf, x, y, compName, rest);
            foreach (var tmpx in xlist)
            {
                ProbeTestData.UpdateQueryHistory(wf, tmpx.ToString(), y, compName, rest);
            }

            var ret = new JsonResult();

            ret.MaxJsonLength = Int32.MaxValue;
            ret.Data          = new
            {
                wf   = wf,
                x    = "X: " + x,
                y    = "Y: " + y,
                ar   = "Array: 1x" + probe.APVal1,
                ap   = "AP: " + probe.ApSize,
                rest = rest
            };
            return(ret);
        }