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); }