Exemple #1
0
        private bool TryGetPreviousDefectNotEmpty(bool isEnd = false)
        {
            RefreshDefectNameList();
            int index = DefectNameList.Count;

            do
            {
                if (!isEnd)
                {
                    if (DefectNameList.Contains(DefectName))
                    {
                        index = DefectNameList.IndexOf(DefectName);
                    }
                    else
                    {
                        return(false);
                    }
                }
                if (index <= 0)
                {
                    return(false);
                }
                isEnd = false;
            } while (!TrySelectDefect(--index));

            return(true);
        }
Exemple #2
0
        private bool TryGetNextDefectNotEmpty(bool isHead = false)
        {
            int index = -1;

            RefreshDefectNameList();
            do
            {
                if (!isHead)
                {
                    if (DefectNameList.Contains(DefectName))
                    {
                        index = DefectNameList.IndexOf(DefectName);
                    }
                    else
                    {
                        return(false);
                    }
                }
                if (index >= DefectNameList.Count - 1)
                {
                    return(false);
                }
                isHead = false;
            } while (!TrySelectDefect(++index));

            return(true);
        }
Exemple #3
0
        public void SwitchDefect(string defectName)
        {
            var index = DefectNameList.IndexOf(defectName);

            if (TrySelectDefect(index))
            {
            }

            return;
        }
Exemple #4
0
        private void LoadDataBaseInfo()
        {
            _device.SetDataDir(_modelDir, _dataDir);

            XmlParameter xmlParameter = new XmlParameter();

            xmlParameter.ReadParameter(Application.StartupPath + _fileDataBaseManager);

            ProductName = xmlParameter.GetParamData("ProductName");
            BatchName   = xmlParameter.GetParamData("BatchName");
            BoardName   = xmlParameter.GetParamData("BoardName");
            SideName    = xmlParameter.GetParamData("SideName");
            ShotName    = xmlParameter.GetParamData("ShotName");
            DefectName  = xmlParameter.GetParamData("DefectName");

            RefreshProductNameList();
            if (!ProductNameList.Contains(ProductName))
            {
                TrySelectProduct(0);
            }
            RefreshBatchNameList();
            if (!BatchNameList.Contains(BatchName))
            {
                TrySelectBatch(0);
            }
            RefreshBoardNameList();
            if (!BoardNameList.Contains(BoardName))
            {
                TrySelectBoard(0);
            }
            RefreshSideNameList();
            if (!SideNameList.Contains(SideName))
            {
                TrySelectSide(0);
            }
            RefreshShotNameList();
            if (!ShotNameList.Contains(ShotName))
            {
                TrySelectShot(0);
            }
            RefreshDefectNameList();
            if (!DefectNameList.Contains(DefectName))
            {
                TrySelectDefect(0);
            }
            UpdateDataCells();

            return;
        }
Exemple #5
0
        private void UpdateDataCells()
        {
            DefectCells = new List <DefectCell>();
            if (_displayWindowNum <= 0)
            {
                return;
            }

            int head = -1;
            int end  = -1;

            if (!DefectNameList.Contains(DefectName))
            {
                int iter = _displayWindowNum;
                do
                {
                    DefectCells.Add(new DefectCell());
                } while (--iter > 0);
                return;
            }

            int indexOfGroup = DefectNameList.IndexOf(DefectName) / _displayWindowNum;

            head = indexOfGroup * _displayWindowNum;
            end  = head + _displayWindowNum - 1;

            for (var iter = head; iter <= end; ++iter)
            {
                var defectCell = new DefectCell();
                if (null == DefectNameList || 0 == DefectNameList.Count || iter >= DefectNameList.Count || iter < 0)
                {
                    DefectCells.Add(new DefectCell());
                }
                else
                {
                    _device.GetDefectCell(ProductName, BatchName, BoardName, SideName, ShotName, DefectNameList[iter], out defectCell);
                    defectCell.GenRegionFromRect(_dilationPixel);
                    DefectCells.Add(defectCell);
                }
            }

            DisplayWindowIndex = DefectNameList.IndexOf(DefectName) - head;
            DefectRegionIndex  = 0;

            return;
        }