private bool TryGetNextBoardNotEmpty(bool isHead = false) { int index = -1; RefreshBoardNameList(); do { if (!isHead) { if (BoardNameList.Contains(BoardName)) { index = BoardNameList.IndexOf(BoardName); } else { return(false); } } if (index >= BoardNameList.Count - 1) { return(false); } isHead = false; } while ((!TrySelectBoard(++index)) || (!TryGetNextSideNotEmpty(true))); return(true); }
private bool TryGetPreviousBoardNotEmpty(bool isEnd = false) { RefreshBoardNameList(); int index = BoardNameList.Count; do { if (!isEnd) { if (BoardNameList.Contains(BoardName)) { index = BoardNameList.IndexOf(BoardName); } else { return(false); } } if (index <= 0) { return(false); } isEnd = false; } while ((!TrySelectBoard(--index)) || (!TryGetPreviousSideNotEmpty(true))); return(true); }
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; }