Esempio n. 1
0
        //
        private bool TryGetNextProductNotEmpty(bool isHead = false)
        {
            int index = -1;

            RefreshProductNameList();
            do
            {
                if (!isHead)
                {
                    if (ProductNameList.Contains(ProductName))
                    {
                        index = ProductNameList.IndexOf(ProductName);
                    }
                    else
                    {
                        return(false);
                    }
                }

                if (index >= ProductNameList.Count - 1)
                {
                    return(false);
                }
                isHead = false;
            } while ((!TrySelectProduct(++index)) || (!TryGetNextBatchNotEmpty(true)));

            return(true);
        }
Esempio n. 2
0
        //
        private bool TryGetPreviousProductNotEmpty(bool isEnd = false)
        {
            RefreshProductNameList();
            int index = ProductNameList.Count;

            do
            {
                if (!isEnd)
                {
                    if (ProductNameList.Contains(ProductName))
                    {
                        index = ProductNameList.IndexOf(ProductName);
                    }
                    else
                    {
                        return(false);
                    }
                }
                if (index <= 0)
                {
                    return(false);
                }
                isEnd = false;
            } while ((!TrySelectProduct(--index)) || (!TryGetPreviousBatchNotEmpty(true)));

            return(true);
        }
Esempio n. 3
0
        //
        public void SwitchProduct(string productName)
        {
            var index = ProductNameList.IndexOf(productName);

            if (TrySelectProduct(index) && TrySelectBatch(0) && TrySelectBoard(0) && TrySelectSide(0) && TrySelectShot(0) && TrySelectDefect(0))
            {
            }

            return;
        }
Esempio n. 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;
        }