Пример #1
0
        public void Add(ChipSummary summary)
        {
            this.TotalCount  += summary.TotalCount;
            this.FreshCount  += summary.FreshCount;
            this.RetestCount += summary.RetestCount;
            this.NullCount   += summary.NullCount;
            this.PassCount   += summary.PassCount;
            this.FailCount   += summary.FailCount;
            this.AbortCount  += summary.AbortCount;

            foreach (var v in summary.GetHardBins())
            {
                if (_hardBins.ContainsKey(v.Key))
                {
                    _hardBins[v.Key] += v.Value;
                }
                else
                {
                    _hardBins.Add(v.Key, v.Value);
                }
            }

            foreach (var v in summary.GetSoftBins())
            {
                if (_softBins.ContainsKey(v.Key))
                {
                    _softBins[v.Key] += v.Value;
                }
                else
                {
                    _softBins.Add(v.Key, v.Value);
                }
            }
        }
Пример #2
0
        public static IChipSummary Combine(Dictionary <byte, IChipSummary> summaryBySite)
        {
            ChipSummary summary = new ChipSummary();

            foreach (var v in summaryBySite)
            {
                summary.Add((ChipSummary)v.Value);
            }

            return(summary);
        }
Пример #3
0
        public void UpdateFilter(int filterId, FilterSetup newFilter)
        {
            _testChips.UpdateChipFilter(newFilter, ref _filterList[filterId].ChipFilter);
            _testItems.UpdateItemFilter(newFilter, ref _filterList[filterId].ItemFilter);

            _testChips.UpdateSummaryFiltered(_filterList[filterId].ChipFilter, ref _filterList[filterId].SitesSummary);
            _filterList[filterId].Summary = ChipSummary.Combine(_filterList[filterId].SitesSummary);

            foreach (var t in GetFilteredTestIDs_Info(filterId))
            {
                //if(_filterList[filterId].StatisticList.ContainsKey(t.Key))
                _filterList[filterId].StatisticList[t.Key] = new ItemStatistic(GetFilteredItemData(t.Key, filterId), t.Value.LoLimit, t.Value.HiLimit);
                //else
                //    _filterList[filterId].StatisticList.Add(t.Key, new ItemStatistic(GetFilteredItemData(t.Key, filterId), t.Value.LoLimit, t.Value.HiLimit));
            }
        }
Пример #4
0
        private int CreateFilter(string comment)
        {
            int key = System.DateTime.UtcNow.Ticks.GetHashCode();

            while (_filterList.ContainsKey(key))
            {
                key++;
            }
            _filterList.Add(key, new FilterData(new FilterSetup(comment), _testChips.ChipsCount, _testItems.ItemsCount));

            _testChips.UpdateSummaryFiltered(_filterList[key].ChipFilter, ref _filterList[key].SitesSummary);
            _filterList[key].Summary = ChipSummary.Combine(_filterList[key].SitesSummary);
            foreach (var t in GetFilteredTestIDs_Info(key))
            {
                _filterList[key].StatisticList.Add(t.Key, new ItemStatistic(GetFilteredItemData(t.Key, key), t.Value.LoLimit, t.Value.HiLimit));
            }

            return(key);
        }
Пример #5
0
        public void ExtractStdf()
        {
            if (ParseDone)
            {
                return;
            }
            //private data
            bool[]   catchedPirFlag = null;
            TestID[] ptrLastTN      = null;
            int[]    InternalID     = null;

            _stdfFile = new StdfFile(FilePath);


            List <PinMapRecord>   listPinMaps   = new List <PinMapRecord>();
            List <PinGroupRecord> listPinGroups = new List <PinGroupRecord>();

            var rs = from r in _stdfFile.GetRecords()
                     select r;
            int siteIdx;

            foreach (var r in rs)
            {
                if (r.RecordType == StdfFile.PTR)
                {
                    if (!_sites.TryGetValue(((Ptr)r).SiteNumber, out siteIdx))
                    {
                        throw new Exception("No Site");
                    }
                    if (!catchedPirFlag[siteIdx])
                    {
                        throw new Exception("PIR Data Error");
                    }

                    TestID testID;
                    //compare with the previous test name to decide the testNO
                    if (ptrLastTN[siteIdx].CompareTestNumber(((Ptr)r).TestNumber))  //it's a sub test
                    {
                        testID = TestID.NewSubTestID(ptrLastTN[siteIdx]);
                        if (!_testItems.ExistTestItem(testID))
                        {
                            IItemInfo info = _testItems.GetItemInfo(ptrLastTN[siteIdx]);
                            info.SetTestText(((Ptr)r).TestText);
                            _testItems.AddTestItem(testID, info);
                            _rawData.AddItem();
                        }
                    }
                    else
                    {
                        testID = new TestID(((Ptr)r).TestNumber);
                        if (!_testItems.ExistTestItem(testID))
                        {
                            _testItems.AddTestItem(testID, new ItemInfo(((Ptr)r).TestText, ((Ptr)r).LowLimit, ((Ptr)r).HighLimit,
                                                                        ((Ptr)r).Units, ((Ptr)r).LowLimitScalingExponent, ((Ptr)r).HighLimitScalingExponent, ((Ptr)r).ResultScalingExponent));
                            _rawData.AddItem();
                        }
                    }
                    _rawData.Set(_testItems.GetIndex(testID), InternalID[siteIdx], _testItems.GetItemInfo(testID).GetScaledRst(((Ptr)r).Result));

                    ptrLastTN[siteIdx] = testID;
                }
                else if (r.RecordType == StdfFile.FTR)
                {
                    if (!_sites.TryGetValue(((Ftr)r).SiteNumber, out siteIdx))
                    {
                        throw new Exception("No Site");
                    }

                    if (!catchedPirFlag[siteIdx])
                    {
                        throw new Exception("PIR Data Error");
                    }

                    TestID testID;
                    //compare with the previous test name to decide the testNO
                    if (!ptrLastTN[siteIdx].CompareTestNumber(((Ftr)r).TestNumber))  //it's a unused test, ftr do not set sub test
                    {
                        testID = new TestID(((Ftr)r).TestNumber);

                        if (!_testItems.ExistTestItem(testID))
                        {
                            _testItems.AddTestItem(testID, new ItemInfo(((Ftr)r).TestText, (float)0.5, (float)1.5, "", 0, 0, 0));
                            _rawData.AddItem();
                        }

                        _rawData.Set(_testItems.GetIndex(testID), InternalID[siteIdx], ((Ftr)r).Results);

                        ptrLastTN[siteIdx] = testID;
                    }
                }
                else if (r.RecordType == StdfFile.MPR)
                {
                    if (!_sites.TryGetValue(((Mpr)r).SiteNumber, out siteIdx))
                    {
                        throw new Exception("No Site");
                    }

                    if (!catchedPirFlag[siteIdx])
                    {
                        throw new Exception("PIR Data Error");
                    }

                    TestID testItemID;
                    if (ptrLastTN[siteIdx].CompareTestNumber(((Mpr)r).TestNumber))  //it's a sub test
                    {
                        testItemID = TestID.NewSubTestID(ptrLastTN[siteIdx]);
                    }
                    else
                    {
                        testItemID = new TestID(((Mpr)r).TestNumber);
                    }

                    TestID testID = testItemID;

                    for (uint i = 0; i < ((Mpr)r).Results.Count(); i++)
                    {
                        PinMapRecord pin = new PinMapRecord();
                        if (siteIdx == 0 && ((Mpr)r).PinIndexes != null)
                        {
                            pin = listPinMaps.Find(x => x.PinIndex == ((Mpr)r).PinIndexes[i]);
                        }
                        //else
                        //    throw new Exception("MPR Pin doesn't exist");

                        if (i > 0)
                        {
                            testID = TestID.NewSubTestID(testID);
                        }

                        if (!_testItems.ExistTestItem(testID))
                        {
                            _testItems.AddTestItem(testID, new ItemInfo(((Mpr)r).TestText + "<>" + pin.LogicalName, ((Mpr)r).LowLimit, ((Mpr)r).HighLimit,
                                                                        ((Mpr)r).Units, ((Mpr)r).LowLimitScalingExponent, ((Mpr)r).HighLimitScalingExponent, ((Mpr)r).ResultScalingExponent));
                            _rawData.AddItem();
                        }

                        _rawData.Set(_testItems.GetIndex(testID), InternalID[siteIdx], _testItems.GetItemInfo(testID).GetScaledRst(((Mpr)r).Results[i]));
                    }

                    ptrLastTN[siteIdx] = testItemID;
                }
                else if (r.RecordType == StdfFile.MIR)
                {
                    BasicInfo = new FileBasicInfo((Mir)r);
                    continue;
                }
                else if (r.RecordType == StdfFile.SDR)
                {
                    for (int i = 0; i < ((Sdr)r).SiteNumbers.Length; i++)
                    {
                        _sites.Add(((Sdr)r).SiteNumbers[i], i);
                    }

                    catchedPirFlag = new bool[((Sdr)r).SiteNumbers.Count()];
                    InternalID     = new int[((Sdr)r).SiteNumbers.Count()];

                    ptrLastTN = new TestID[((Sdr)r).SiteNumbers.Count()];
                }
                else if (r.RecordType == StdfFile.PMR)
                {
                    listPinMaps.Add(new PinMapRecord((Pmr)r));
                }
                else if (r.RecordType == StdfFile.PGR)
                {
                    listPinGroups.Add(new PinGroupRecord((Pgr)r, listPinMaps));
                }
                else if (r.RecordType == StdfFile.PIR)
                {
                    if (!_sites.TryGetValue(((Pir)r).SiteNumber, out siteIdx))
                    {
                        throw new Exception("No Site");
                    }

                    if (!catchedPirFlag[siteIdx])
                    {
                        catchedPirFlag[siteIdx] = true;
                    }
                    else
                    {
                        throw new Exception("PIR Data Error");
                    }

                    ptrLastTN[siteIdx] = new TestID();

                    InternalID[siteIdx] = _rawData.AddChip();
                }
                else if (r.RecordType == StdfFile.BPS)
                {
                    //do nothing
                }
                else if (r.RecordType == StdfFile.EPS)
                {
                    //do nothing
                }
                else if (r.RecordType == StdfFile.PRR)
                {
                    if (!_sites.TryGetValue(((Prr)r).SiteNumber, out siteIdx))
                    {
                        throw new Exception("No Site");
                    }

                    if (!catchedPirFlag[siteIdx])
                    {
                        throw new Exception("PIR Data Error");
                    }
                    else
                    {
                        catchedPirFlag[siteIdx] = false;
                    }

                    _testChips.AddChip(new ChipInfo((Prr)r, InternalID[siteIdx]));
                }
                else if (r.RecordType == StdfFile.TSR)
                {
                    var v = ((Tsr)r).TestLabel;

                    if (v != null && v != "")
                    {
                        _testItems.UpdateTestText(new TestID(((Tsr)r).TestNumber), v);
                    }
                }
                else if (r.RecordType == StdfFile.MRR)
                {
                    ((FileBasicInfo)BasicInfo).AddMrr((Mrr)r);
                }
            }
            ParseDone = true;

            _testChips.UpdateSummary(ref _defaultSitesSummary);
            _defaultSummary = ChipSummary.Combine(_defaultSitesSummary);
            OnExtractDone(this);

            _stdfFile = null;
            rs        = null;

            GC.Collect();

            CreateDefaultFilters();
        }