private static void RetrieveCummYield(ProjectYieldViewModule pyvm, List <ProjectTestData> plist, ProjectViewModels pvm)
        {
            var yielddict = new Dictionary <string, TestYield>();
            var sndict    = new Dictionary <string, bool>();

            foreach (var p in plist)
            {
                if (!sndict.ContainsKey(p.WhichTest + ":" + p.ModuleSerialNum))
                {
                    sndict.Add(p.WhichTest + ":" + p.ModuleSerialNum, true);
                    if (yielddict.ContainsKey(p.WhichTest))
                    {
                        yielddict[p.WhichTest].InputCount = yielddict[p.WhichTest].InputCount + 1;
                        if (string.Compare(p.ErrAbbr, "PASS", true) == 0)
                        {
                            yielddict[p.WhichTest].OutputCount = yielddict[p.WhichTest].OutputCount + 1;
                        }
                        RegisterError(p.ErrAbbr, p.WhichTest, pyvm.LErrorMap);
                    }
                    else
                    {
                        var tempyield = new TestYield();
                        tempyield.InputCount = 1;
                        if (string.Compare(p.ErrAbbr, "PASS", true) == 0)
                        {
                            tempyield.OutputCount = 1;
                        }
                        else
                        {
                            tempyield.OutputCount = 0;
                        }
                        tempyield.WhichTest = p.WhichTest;

                        RegisterError(p.ErrAbbr, p.WhichTest, pyvm.LErrorMap);
                        yielddict.Add(p.WhichTest, tempyield);
                    }
                }
            }

            if (pvm.SumDatasetList.Count > 0)
            {
                foreach (var s in pvm.SumDatasetList)
                {
                    if (yielddict.ContainsKey(s.Station))
                    {
                        pyvm.LastYields.Add(yielddict[s.Station]);
                    }
                }
            }
            else if (pvm.StationList.Count > 0)
            {
                foreach (var s in pvm.StationList)
                {
                    if (yielddict.ContainsKey(s.Station))
                    {
                        pyvm.LastYields.Add(yielddict[s.Station]);
                    }
                }
            }
        }
예제 #2
0
        private static void RetrieveCummYield(ProjectBIYieldViewModule pyvm, List <BITestData> plist)
        {
            var yielddict = new Dictionary <string, TestYield>();
            var sndict    = new Dictionary <string, bool>();

            var correctbidict = new Dictionary <string, string>();

            if (!string.IsNullOrEmpty(pyvm.ProjectKey))
            {
                correctbidict = IssueViewModels.RetrieveAllBIRootCause(pyvm.ProjectKey);
            }
            else
            {
                var pjkeydict = new Dictionary <string, bool>();
                foreach (var item in plist)
                {
                    if (!pjkeydict.ContainsKey(item.ProjectKey))
                    {
                        pjkeydict.Add(item.ProjectKey, true);
                    }
                }

                var pjkeylist = pjkeydict.Keys;
                foreach (var pjkey in pjkeylist)
                {
                    var tempcorrectdict = IssueViewModels.RetrieveAllBIRootCause(pjkey);
                    foreach (var kvpair in tempcorrectdict)
                    {
                        if (!correctbidict.ContainsKey(kvpair.Key))
                        {
                            correctbidict.Add(kvpair.Key, kvpair.Value);
                        }
                    }
                }
            }//end else



            foreach (var p in plist)
            {
                if (!sndict.ContainsKey(p.WhichTest + ":" + p.ModuleSerialNum))
                {
                    sndict.Add(p.WhichTest + ":" + p.ModuleSerialNum, true);
                    if (yielddict.ContainsKey(p.WhichTest))
                    {
                        if (!yielddict[p.WhichTest].AllSNDict.ContainsKey(p.ModuleSerialNum))
                        {
                            yielddict[p.WhichTest].AllSNDict.Add(p.ModuleSerialNum, true);
                        }

                        yielddict[p.WhichTest].InputCount = yielddict[p.WhichTest].InputCount + 1;
                        if (string.Compare(p.ErrAbbr, "PASS", true) == 0)
                        {
                            yielddict[p.WhichTest].OutputCount        = yielddict[p.WhichTest].OutputCount + 1;
                            yielddict[p.WhichTest].CorrectOutputCount = yielddict[p.WhichTest].CorrectOutputCount + 1;
                        }
                        else
                        {
                            if (correctbidict.ContainsKey(p.ModuleSerialNum) &&
                                string.Compare(correctbidict[p.ModuleSerialNum], BIROOTCAUSE.VCSELISSUE) != 0)
                            {
                                yielddict[p.WhichTest].CorrectOutputCount = yielddict[p.WhichTest].CorrectOutputCount + 1;
                            }

                            if (correctbidict.ContainsKey(p.ModuleSerialNum))
                            {
                                if (!yielddict[p.WhichTest].CorSNDict.ContainsKey(p.ModuleSerialNum))
                                {
                                    yielddict[p.WhichTest].CorSNDict.Add(p.ModuleSerialNum, true);
                                }
                            }

                            if (!yielddict[p.WhichTest].ErrSNDict.ContainsKey(p.ModuleSerialNum))
                            {
                                yielddict[p.WhichTest].ErrSNDict.Add(p.ModuleSerialNum, true);
                            }
                        }

                        RegisterError(p.ErrAbbr, p.WhichTest, pyvm.LErrorMap);
                    }
                    else
                    {
                        var tempyield = new TestYield();
                        if (!tempyield.AllSNDict.ContainsKey(p.ModuleSerialNum))
                        {
                            tempyield.AllSNDict.Add(p.ModuleSerialNum, true);
                        }


                        tempyield.InputCount = 1;
                        if (string.Compare(p.ErrAbbr, "PASS", true) == 0)
                        {
                            tempyield.OutputCount        = 1;
                            tempyield.CorrectOutputCount = 1;
                        }
                        else
                        {
                            tempyield.OutputCount        = 0;
                            tempyield.CorrectOutputCount = 0;
                            if (correctbidict.ContainsKey(p.ModuleSerialNum) &&
                                string.Compare(correctbidict[p.ModuleSerialNum], BIROOTCAUSE.VCSELISSUE) != 0)
                            {
                                tempyield.CorrectOutputCount = 1;
                            }

                            if (correctbidict.ContainsKey(p.ModuleSerialNum))
                            {
                                if (!tempyield.CorSNDict.ContainsKey(p.ModuleSerialNum))
                                {
                                    tempyield.CorSNDict.Add(p.ModuleSerialNum, true);
                                }
                            }

                            if (!tempyield.ErrSNDict.ContainsKey(p.ModuleSerialNum))
                            {
                                tempyield.ErrSNDict.Add(p.ModuleSerialNum, true);
                            }
                        }

                        tempyield.WhichTest = p.WhichTest;

                        RegisterError(p.ErrAbbr, p.WhichTest, pyvm.LErrorMap);
                        yielddict.Add(p.WhichTest, tempyield);
                    }
                }
            }

            foreach (var s in yielddict)
            {
                pyvm.LastYields.Add(s.Value);
            }
        }