private bool TryGetNextSideNotEmpty(bool isHead = false) { int index = -1; RefreshSideNameList(); do { if (!isHead) { if (SideNameList.Contains(SideName)) { index = SideNameList.IndexOf(SideName); } else { return(false); } } if (index >= SideNameList.Count - 1) { return(false); } isHead = false; } while ((!TrySelectSide(++index)) || (!TryGetNextShotNotEmpty(true))); return(true); }
private bool TryGetPreviousSideNotEmpty(bool isEnd = false) { RefreshSideNameList(); int index = SideNameList.Count; do { if (!isEnd) { if (SideNameList.Contains(SideName)) { index = SideNameList.IndexOf(SideName); } else { return(false); } } if (index <= 0) { return(false); } isEnd = false; } while ((!TrySelectSide(--index)) || (!TryGetPreviousShotNotEmpty(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; }