wenxiangchao
4 天以前 559890c482f5973f06aafdfec9550fee5ba3c7f2
Plugin.TestResult/Scanner.xaml.cs
@@ -158,12 +158,27 @@
                    {
                        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 = "";
@@ -229,13 +244,14 @@
                    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();
@@ -246,7 +262,7 @@
                        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();
@@ -256,10 +272,10 @@
                        /// 检查PN
                        if (PNUtil.GetPN(ParamSetting.MesAddress, stationName, snr, out string pn, out msg))
                        {
                            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();
@@ -268,7 +284,7 @@
                        }
                        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();
@@ -280,7 +296,7 @@
                        {
                            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();
@@ -289,7 +305,7 @@
                        }
                        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();
@@ -399,11 +415,11 @@
                    }
                    else
                    {
                        if (ParamSetting.CustomerCode != "LIXUN")
                        {
                            snrText.Focus();
                            return;
                        }
                        //if (ParamSetting.CustomerCode != "LIXUN")
                        //{
                        //    snrText.Focus();
                        //    return;
                        //}
                        string barcode = positionText.Text;
                        try
                        {
@@ -416,10 +432,21 @@
                                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;