| | |
| | | { |
| | | try |
| | | { |
| | | this.targetCellInfo = ScannerParser.GetCellInfoByCode(this.model, this.columns, this.rows, barcode); |
| | | var targetCellInfo = ScannerParser.GetCellInfoByCode(this.model, this.columns, this.rows, barcode); |
| | | if (!TestResultView.nameTables.ContainsKey(targetCellInfo.OvenName)) |
| | | { |
| | | MsgBoxHelper2.Error($"老化炉 [{targetCellInfo.OvenName}] 不存在,请检查配置"); |
| | | return; |
| | | } |
| | | var sourceTable = TestResultView.tables[this.ovenIndex]; |
| | | if (sourceTable.title != targetCellInfo.OvenName) |
| | | { |
| | | MsgBoxHelper2.Error($"请切换至 [{targetCellInfo.OvenName}] 区扫码,当前为 [{sourceTable.title}] 区!"); |
| | | return; |
| | | } |
| | | |
| | | var oven = TestResultView.nameTables[targetCellInfo.OvenName]; |
| | | if (oven.cells.Length < targetCellInfo.Index + 1) |
| | | { |
| | | MsgBoxHelper2.Error($"穴位号 [{barcode}] 超出索引 {targetCellInfo.Index}"); |
| | | return; |
| | | } |
| | | |
| | | this.targetCellInfo = targetCellInfo; |
| | | positionText.Text = barcode; |
| | | //positionText.Focus(); |
| | | //snrText.Text = ""; |
| | |
| | | var EnableMes = ParameterManager.GetCommonParameterByName<bool>("EnableMes", false); |
| | | if (ParamSetting.CustomerCode == "LIXUN" && EnableMes) |
| | | { |
| | | var table = TestResultView.tables[this.ovenIndex]; |
| | | var table = TestResultView.nameTables[targetCellInfo.OvenName]; |
| | | // TestResultView.tables[this.ovenIndex] |
| | | string currentPn = table.CbProduct.Text; |
| | | |
| | | /// 检查格式 |
| | | if (!SNValidator.ValidateSN(currentPn, snr, out string msg)) |
| | | { |
| | | TestResultView.tables[this.ovenIndex].GetSingleCell(targetCellInfo.Index).LightRed(true, out _); |
| | | table.GetSingleCell(targetCellInfo.Index).LightRed(true, out _); |
| | | MsgBoxHelper2.Error($"检查产品条码异常:{msg}"); |
| | | snrText.Text = string.Empty; |
| | | snrText.Focus(); |
| | |
| | | string stationName = ProductManager.GetParameterByProductAndName(currentPn, "MES站位")?.Value; |
| | | if (string.IsNullOrEmpty(stationName)) |
| | | { |
| | | TestResultView.tables[this.ovenIndex].GetSingleCell(targetCellInfo.Index).LightRed(true, out _); |
| | | table.GetSingleCell(targetCellInfo.Index).LightRed(true, out _); |
| | | MsgBoxHelper2.Error($"检查产品条码异常,当前产品[{currentPn}]未设置参数MES站位"); |
| | | snrText.Text = string.Empty; |
| | | snrText.Focus(); |
| | |
| | | |
| | | if (pn != currentPn) |
| | | { |
| | | TestResultView.tables[this.ovenIndex].GetSingleCell(targetCellInfo.Index).LightRed(true, out _); |
| | | table.GetSingleCell(targetCellInfo.Index).LightRed(true, out _); |
| | | MsgBoxHelper2.Error($"当前测试料号为 [{currentPn}],扫码产品料号为 [{pn}] 不允许测试"); |
| | | snrText.Text = string.Empty; |
| | | snrText.Focus(); |
| | |
| | | } |
| | | else |
| | | { |
| | | TestResultView.tables[this.ovenIndex].GetSingleCell(targetCellInfo.Index).LightRed(true, out _); |
| | | table.GetSingleCell(targetCellInfo.Index).LightRed(true, out _); |
| | | MsgBoxHelper2.Error($"检查产品条码异常:{msg}"); |
| | | snrText.Text = string.Empty; |
| | | snrText.Focus(); |
| | |
| | | { |
| | | if (needCheckIn != true) |
| | | { |
| | | TestResultView.tables[this.ovenIndex].GetSingleCell(targetCellInfo.Index).LightRed(true, out _); |
| | | table.GetSingleCell(targetCellInfo.Index).LightRed(true, out _); |
| | | MsgBoxHelper2.Error($"条码[{snr}]工序不在本站:{msg}"); |
| | | snrText.Text = string.Empty; |
| | | snrText.Focus(); |
| | |
| | | } |
| | | else |
| | | { |
| | | TestResultView.tables[this.ovenIndex].GetSingleCell(targetCellInfo.Index).LightRed(true, out _); |
| | | table.GetSingleCell(targetCellInfo.Index).LightRed(true, out _); |
| | | MsgBoxHelper2.Error($"条码[{snr}]CheckIn失败:{msg}"); |
| | | snrText.Text = string.Empty; |
| | | snrText.Focus(); |
| | |
| | | } |
| | | else |
| | | { |
| | | if (ParamSetting.CustomerCode != "LIXUN") |
| | | { |
| | | snrText.Focus(); |
| | | return; |
| | | } |
| | | //if (ParamSetting.CustomerCode != "LIXUN") |
| | | //{ |
| | | // snrText.Focus(); |
| | | // return; |
| | | //} |
| | | string barcode = positionText.Text; |
| | | try |
| | | { |
| | |
| | | targetCellInfo = null; |
| | | return; |
| | | } |
| | | |
| | | var sourceTable = TestResultView.tables[this.ovenIndex]; |
| | | if (sourceTable.title != targetCellInfo.OvenName) |
| | | { |
| | | MsgBoxHelper2.Error($"请切换至 [{targetCellInfo.OvenName}] 区扫码,当前为 [{sourceTable.title}] 区!"); |
| | | positionText.Text = string.Empty; |
| | | positionText.Focus(); |
| | | targetCellInfo = null; |
| | | return; |
| | | } |
| | | |
| | | var oven = TestResultView.nameTables[targetCellInfo.OvenName]; |
| | | if (oven.cells.Length < targetCellInfo.Index + 1) |
| | | { |
| | | MsgBoxHelper2.Error($"穴位下标 [{targetCellInfo.Index}] 超出索引"); |
| | | MsgBoxHelper2.Error($"穴位号 [{barcode}] 超出索引 {targetCellInfo.Index}"); |
| | | positionText.Text = string.Empty; |
| | | positionText.Focus(); |
| | | targetCellInfo = null; |