private void GetBarcodeSetting(ref int totalBarcodeCnt, ref int curBarcodeNum) { int startBarcodeNum = 0; int endBarcodeNum = 0; if (rdbStartCount.IsChecked.Value) { startBarcodeNum = int.Parse(txtStartBarcodeApproach1.Text); int barCodeCount = int.Parse(txtCount.Text); endBarcodeNum = startBarcodeNum + barCodeCount - 1; } else { startBarcodeNum = int.Parse(txtStartBarcodeApproach2.Text); endBarcodeNum = int.Parse(txtEndBarcode.Text); } totalBarcodeCnt = endBarcodeNum - startBarcodeNum + 1; curBarcodeNum = startBarcodeNum; //write log var selectedCell = dataGridView.SelectedCells[0]; CellPosition curCell = new CellPosition(selectedCell.RowIndex, selectedCell.ColumnIndex); log.InfoFormat("Start barcode num = {0}, count = {1}, position = {2}", startBarcodeNum, totalBarcodeCnt, CellPosition.GetDescription(curCell)); }
private void ReportDuplicatedError(int firstWellIndex, int secondWellIndex, string barcode) { int firstCellCol = firstWellIndex / 16; int firstCellRow = firstWellIndex - firstCellCol * 16; int secondCellCol = secondWellIndex / 16; int secondCellRow = secondWellIndex - secondCellCol * 16; string firstWellDesc = CellPosition.GetDescription(new CellPosition(firstCellCol, firstCellRow)); string secondWellDesc = CellPosition.GetDescription(new CellPosition(secondCellCol, secondCellRow)); string errMsg = string.Format("位于{0}和{1}两处的条码一样,都为:{2},请重新设置!", firstWellDesc, secondWellDesc, barcode); SetInfo(errMsg, Colors.Red); }