public static List <ProbeTestData> GetQueryHistory(string wafer, string x, string y)
        {
            var sql  = "";
            var dict = new Dictionary <string, string>();

            if (!string.IsNullOrEmpty(wafer) && !string.IsNullOrEmpty(x) && !string.IsNullOrEmpty(y))
            {
                sql = "select Wafer,X,Y,ApSize,APVal1,APVal7,APVal8,APVal9 from ProbeTestData  where Wafer=@wafer and X=@x and Y=@y and APVal8 <> '' order by APVal9 desc";
                dict.Add("@wafer", wafer);
                dict.Add("@x", x);
                dict.Add("@y", y);
            }
            else if (!string.IsNullOrEmpty(wafer) && !string.IsNullOrEmpty(x))
            {
                sql = "select Wafer,X,Y,ApSize,APVal1,APVal7,APVal8,APVal9 from ProbeTestData  where Wafer=@wafer and X=@x and APVal8 <> ''  order by APVal9 desc";
                dict.Add("@wafer", wafer);
                dict.Add("@x", x);
            }
            else if (!string.IsNullOrEmpty(wafer) && !string.IsNullOrEmpty(y))
            {
                sql = "select Wafer,X,Y,ApSize,APVal1,APVal7,APVal8,APVal9 from ProbeTestData  where Wafer=@wafer and Y=@y and APVal8 <> ''  order by APVal9 desc";
                dict.Add("@wafer", wafer);
                dict.Add("@y", y);
            }
            else
            {
                sql = "select Wafer,X,Y,ApSize,APVal1,APVal7,APVal8,APVal9 from ProbeTestData  where Wafer=@wafer and APVal8 <> ''  order by APVal9 desc";
                dict.Add("@wafer", wafer);
            }

            var ret   = new List <ProbeTestData>();
            var dbret = DBUtility.ExeLocalSqlWithRes(sql, dict);

            foreach (var line in dbret)
            {
                var tempvm = new ProbeTestData();
                tempvm.Wafer  = UT.O2S(line[0]);
                tempvm.X      = UT.O2S(line[1]);
                tempvm.Y      = UT.O2S(line[2]);
                tempvm.ApSize = UT.O2S(line[3]);
                tempvm.APVal1 = UT.O2S(line[4]);
                tempvm.APVal7 = UT.O2S(line[5]);
                tempvm.APVal8 = UT.O2S(line[6]);
                tempvm.APVal9 = UT.O2T(line[7]);
                ret.Add(tempvm);
            }
            return(ret);
        }
        public static List <ProbeTestData> GetIthFromAllen(string WaferNum)
        {
            var ret  = new List <ProbeTestData>();
            var sql  = @"select distinct [WaferID],[Xcoord],[Ycoord],[Ith] from [EngrData].[dbo].[Wuxi_WAT_VR_Report] 
                        where [WaferID] = @WaferNum and [Ith] is not null ";
            var dict = new Dictionary <string, string>();

            dict.Add("@WaferNum", WaferNum);
            var dbret = DBUtility.ExeAllenSqlWithRes(sql, dict);

            foreach (var line in dbret)
            {
                var tempvm = new ProbeTestData();
                tempvm.Wafer  = UT.O2S(line[0]);
                tempvm.X      = UT.O2S(line[1]);
                tempvm.Y      = UT.O2S(line[2]);
                tempvm.APVal2 = UT.O2S(line[3]);
                ret.Add(tempvm);
            }
            return(ret);
        }
        public static ProbeTestData  GetApSizeByWafer(string w, string x, string y)
        {
            var sql  = "select ApSize,APVal1 from ProbeTestData where Wafer=@Wafer and X=@X and Y=@Y";
            var dict = new Dictionary <string, string>();

            dict.Add("@Wafer", w);
            dict.Add("@X", x);
            dict.Add("@Y", y);

            var ret   = new ProbeTestData();
            var dbret = DBUtility.ExeLocalSqlWithRes(sql, dict);

            if (dbret.Count > 0)
            {
                ret.ApSize = UT.O2S(dbret[0][0]);
                ret.APVal1 = UT.O2S(dbret[0][1]);
                ret.X      = x;
                ret.Y      = y;
            }
            return(ret);
        }
Beispiel #4
0
        public static List <SNApertureSizeVM> LoadData(List <string> snlist, Controller ctrl)
        {
            var syscfg   = CfgUtility.GetSysConfig(ctrl);
            var bifolder = syscfg["BIITHFOLDER"];
            var allfiles = GetAllFiles(bifolder, ctrl);
            var snwfdict = UT.GetWaferFromSN(snlist);

            var ret = new List <SNApertureSizeVM>();

            foreach (var sn in snlist)
            {
                SNApertureSizeVM tempvm = null;

                var fs = "";
                foreach (var f in allfiles)
                {
                    if (f.ToUpper().Contains(sn.ToUpper()) && f.ToUpper().Contains("_PRE.TXT"))
                    {
                        fs = f;
                        break;
                    }
                }

                if (string.IsNullOrEmpty(fs))
                {
                    continue;
                }

                var bifile = ExternalDataCollector.DownloadShareFile(fs, ctrl);
                if (!string.IsNullOrEmpty(bifile))
                {
                    var alline = System.IO.File.ReadAllLines(bifile);
                    var idx    = 1;
                    foreach (var line in alline)
                    {
                        if (line.ToUpper().Contains("CHANNEL"))
                        {
                            tempvm    = new SNApertureSizeVM();
                            tempvm.SN = sn.ToUpper();
                            tempvm.CH = "CH" + idx;
                            if (snwfdict.ContainsKey(tempvm.SN))
                            {
                                tempvm.Wafer = snwfdict[tempvm.SN];
                            }

                            ret.Add(tempvm);
                            idx++;
                            continue;
                        }

                        if (tempvm != null && tempvm.IthList.Count < 14)
                        {
                            var items = line.Split(new string[] { " ", "\t" }, StringSplitOptions.RemoveEmptyEntries);
                            tempvm.IthList.Add(UT.O2D(items[1]));
                            tempvm.PwrList.Add(UT.O2D(items[2]));
                        }
                    } //end foreach
                }     //end if

                foreach (var item in ret)
                {
                    if (item.IthList.Count == 14 && item.PwrList.Count == 14)
                    {
                        var rest = Fit.Line(item.IthList.ToArray(), item.PwrList.ToArray());
                        item.Intercept = rest.Item1.ToString();
                        item.IthSlope  = rest.Item2.ToString();
                        item.Ith       = (Math.Abs(rest.Item1 / rest.Item2) / 1000.0).ToString();
                    }
                }

                var wflist = new List <string>();
                foreach (var kv in snwfdict)
                {
                    var wf = kv.Value.ToUpper().Trim();
                    if (!wflist.Contains(wf))
                    {
                        wflist.Add(wf);
                    }
                }

                var wfapdict = new Dictionary <string, string>();
                foreach (var w in wflist)
                {
                    var apconst = ProbeTestData.PrepareAPConst2162(w);
                    wfapdict.Add(w, apconst);
                }

                foreach (var item in ret)
                {
                    if (!string.IsNullOrEmpty(item.Wafer) && wfapdict.ContainsKey(item.Wafer))
                    {
                        item.ApertureConst = wfapdict[item.Wafer];
                        if (!string.IsNullOrEmpty(item.ApertureConst) && !string.IsNullOrEmpty(item.Ith))
                        {
                            var apconst = UT.O2D(item.ApertureConst);
                            var ith     = UT.O2D(item.Ith);
                            item.ApertureSize = (ith * 7996.8 + apconst).ToString();
                        }
                    }
                }
            }
            return(ret);
        }