From ce363e47797176b4712eff03edb1534342edc235 Mon Sep 17 00:00:00 2001 From: lhiven Date: Sun, 11 May 2025 11:12:54 +0800 Subject: [PATCH] =?UTF-8?q?1=E3=80=81=E5=A2=9E=E5=8A=A011=E4=BD=8D?= =?UTF-8?q?=E4=BA=8C=E7=BB=B4=E7=A0=81=E8=A1=A5=E9=BD=9022=E4=BD=8D?= =?UTF-8?q?=E5=8A=9F=E8=83=BD=E3=80=82=202=E3=80=81=E5=A2=9E=E5=8A=A0?= =?UTF-8?q?=E5=8D=95=E6=B5=8B=E8=AF=95=E6=A8=A1=E5=BC=8F=EF=BC=8C=E4=B8=8D?= =?UTF-8?q?=E7=AE=A1OK=E8=BF=98=E6=98=AFNG=E9=83=BD=E5=8F=AA=E6=B5=8B?= =?UTF-8?q?=E8=AF=95=E4=B8=80=E6=AC=A1=E3=80=82?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Rs.DeweyTester/Commom/PadBarCode.cs | 18 +++++++ .../Entitys/OneGrabSixteenManager.cs | 16 +++++- .../Flow/NormalFlow/DischargeFlow.cs | 50 +++++++++++-------- .../Flow/SubFlow/FixtureTakeFlow.cs | 5 +- Rs.DeweyTester/FormMain.designer.cs | 31 ++++++------ Rs.DeweyTester/Rs.DeweyTester.csproj | 1 + 6 files changed, 82 insertions(+), 39 deletions(-) create mode 100644 Rs.DeweyTester/Commom/PadBarCode.cs diff --git a/Rs.DeweyTester/Commom/PadBarCode.cs b/Rs.DeweyTester/Commom/PadBarCode.cs new file mode 100644 index 0000000..1c74c3b --- /dev/null +++ b/Rs.DeweyTester/Commom/PadBarCode.cs @@ -0,0 +1,18 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace Rs.MotionPlat.Commom +{ + public static class PadBarCode + { + public static string Pad(string sn) + { + string firstStr = sn.Substring(0, sn.Length - 3); + string secondStr = sn.Substring(sn.Length - 3); + return $"FGX{firstStr}0000RY9+{secondStr}"; + } + } +} diff --git a/Rs.DeweyTester/Entitys/OneGrabSixteenManager.cs b/Rs.DeweyTester/Entitys/OneGrabSixteenManager.cs index f96aae5..a4d217f 100644 --- a/Rs.DeweyTester/Entitys/OneGrabSixteenManager.cs +++ b/Rs.DeweyTester/Entitys/OneGrabSixteenManager.cs @@ -1,4 +1,5 @@ using Rs.Framework; +using Rs.MotionPlat.Commom; using System; using System.Collections.Generic; using System.Linq; @@ -78,7 +79,14 @@ namespace Rs.MotionPlat.Entitys Result = (EOneGrabSixteenResult)Enum.Parse(typeof(EOneGrabSixteenResult), results[1]); if (Result == EOneGrabSixteenResult.Ok) { - SN = results[2]; + if (results[2].Length==11) + { + SN = PadBarCode.Pad(results[2]); + } + else + { + SN = results[2]; + } OffsetX = Convert.ToDouble(results[3]); OffsetY = Convert.ToDouble(results[4]); } @@ -162,7 +170,11 @@ namespace Rs.MotionPlat.Entitys _Items[index].OffsetY = 0; if (_Items[index].Result== EOneGrabSixteenResult.Ok) { - if (data[2].Length==GlobalVar.BarcodeLength) + if (data[2].Length==11) + { + _Items[index].SN = PadBarCode.Pad(data[2]); + } + else if (data[2].Length==GlobalVar.BarcodeLength) { _Items[index].SN = data[2]; } diff --git a/Rs.DeweyTester/Flow/NormalFlow/DischargeFlow.cs b/Rs.DeweyTester/Flow/NormalFlow/DischargeFlow.cs index 3a43646..1ddf160 100644 --- a/Rs.DeweyTester/Flow/NormalFlow/DischargeFlow.cs +++ b/Rs.DeweyTester/Flow/NormalFlow/DischargeFlow.cs @@ -406,7 +406,7 @@ namespace Rs.MotionPlat.Flow if (fixtureret !=null && fixtureret.Result == EOneGrabSixteenResult.Ok) { LogHelper.Debug(GetClassName() + $"{JsonConvert.SerializeObject(fixtureret)}"); - if (fixtureret.SN.Length == GlobalVar.BarcodeLength) + //if (fixtureret.SN.Length == GlobalVar.BarcodeLength) { try { @@ -424,25 +424,25 @@ namespace Rs.MotionPlat.Flow Msg.ShowError(ex.Message); } } - else - { - try - { - LogHelper.Debug(GetClassName() + "检测到二维码长度和设置的长度不一致,弹框报警"); - //报警弹框 - alarmEntity = AlarmCollection.Get(AlarmConstID.二维码长度异常报警).Transform(ret.SlotIndex); - EButtonType buttonSelect = Msgbox.ShowDialog(alarmEntity, EButtonType.Retry, true); - if (buttonSelect == EButtonType.Retry) - { - logInfo = GetClassName() + "选择了重试"; - MessageQueue.Instance.Insert(logInfo); - } - } - catch (Exception ex) - { - Msg.ShowError(ex.Message); - } - } + //else + //{ + // try + // { + // LogHelper.Debug(GetClassName() + "检测到二维码长度和设置的长度不一致,弹框报警"); + // //报警弹框 + // alarmEntity = AlarmCollection.Get(AlarmConstID.二维码长度异常报警).Transform(ret.SlotIndex); + // EButtonType buttonSelect = Msgbox.ShowDialog(alarmEntity, EButtonType.Retry, true); + // if (buttonSelect == EButtonType.Retry) + // { + // logInfo = GetClassName() + "选择了重试"; + // MessageQueue.Instance.Insert(logInfo); + // } + // } + // catch (Exception ex) + // { + // Msg.ShowError(ex.Message); + // } + //} } else if (fixtureret != null && fixtureret.Result == EOneGrabSixteenResult.LocationOkScanBarcodeFail) { @@ -1102,7 +1102,15 @@ namespace Rs.MotionPlat.Flow //ABC模式 switch (GlobalVar.TestMethod) { - + case "ONE": + foreach (Nozzle item in NozzleManager.GetNozzlesByStatus(ENozzleStatus.ToTest)) + { + if (item.Product != null) + { + return item; + } + } + break; case "A": foreach (Nozzle item in NozzleManager.GetNozzlesByStatus(ENozzleStatus.ToTest)) { diff --git a/Rs.DeweyTester/Flow/SubFlow/FixtureTakeFlow.cs b/Rs.DeweyTester/Flow/SubFlow/FixtureTakeFlow.cs index 35fb30a..e75302e 100644 --- a/Rs.DeweyTester/Flow/SubFlow/FixtureTakeFlow.cs +++ b/Rs.DeweyTester/Flow/SubFlow/FixtureTakeFlow.cs @@ -225,7 +225,10 @@ namespace Rs.MotionPlat.Flow.SubFlow curNozzle.Product = curFixture.Product; if(GlobalVar.TestMode!="GRR" && GlobalVar.TestMode!="AUDIT") { - if (curFixture.Product.Result == "PASS" || curFixture.Product.TestNum >= 3 ||ScanFailNGHelper.IsScanFailSN( curFixture.Product.SN))// == "SLK11111111PNK60X") + if (curFixture.Product.Result == "PASS" + || curFixture.Product.TestNum >= 3 + ||ScanFailNGHelper.IsScanFailSN( curFixture.Product.SN) + || GlobalVar.TestMethod=="ONE") { curNozzle.Status = ENozzleStatus.ToUnload; } diff --git a/Rs.DeweyTester/FormMain.designer.cs b/Rs.DeweyTester/FormMain.designer.cs index c548847..6d8f473 100644 --- a/Rs.DeweyTester/FormMain.designer.cs +++ b/Rs.DeweyTester/FormMain.designer.cs @@ -40,6 +40,7 @@ namespace Rs.MotionPlat this.dataGridViewTextBoxColumn1 = new System.Windows.Forms.DataGridViewTextBoxColumn(); this.dataGridViewTextBoxColumn2 = new System.Windows.Forms.DataGridViewTextBoxColumn(); this.groupBox36 = new System.Windows.Forms.GroupBox(); + this.btnDoorStatus = new System.Windows.Forms.Button(); this.btnSelectProduct = new System.Windows.Forms.Button(); this.btnUpCameraGrab = new System.Windows.Forms.Button(); this.btnClearData = new System.Windows.Forms.Button(); @@ -156,7 +157,6 @@ namespace Rs.MotionPlat this.timertc6 = new System.Windows.Forms.Timer(this.components); this.timeruph = new System.Windows.Forms.Timer(this.components); this.timerLight = new System.Windows.Forms.Timer(this.components); - this.btnDoorStatus = new System.Windows.Forms.Button(); this.panel1.SuspendLayout(); this.groupBox37.SuspendLayout(); ((System.ComponentModel.ISupportInitialize)(this.dgv_errinfo)).BeginInit(); @@ -282,6 +282,20 @@ namespace Rs.MotionPlat this.groupBox36.TabStop = false; this.groupBox36.Text = "Quick functions"; // + // btnDoorStatus + // + this.btnDoorStatus.BackColor = System.Drawing.Color.Green; + this.btnDoorStatus.FlatAppearance.BorderSize = 0; + this.btnDoorStatus.FlatStyle = System.Windows.Forms.FlatStyle.Flat; + this.btnDoorStatus.Font = new System.Drawing.Font("宋体", 23F); + this.btnDoorStatus.ForeColor = System.Drawing.Color.White; + this.btnDoorStatus.Location = new System.Drawing.Point(8, 205); + this.btnDoorStatus.Name = "btnDoorStatus"; + this.btnDoorStatus.Size = new System.Drawing.Size(301, 48); + this.btnDoorStatus.TabIndex = 1; + this.btnDoorStatus.Text = "Door"; + this.btnDoorStatus.UseVisualStyleBackColor = false; + // // btnSelectProduct // this.btnSelectProduct.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(56)))), ((int)(((byte)(56)))), ((int)(((byte)(56))))); @@ -1049,6 +1063,7 @@ namespace Rs.MotionPlat this.cboxTestMethod.Enabled = false; this.cboxTestMethod.FormattingEnabled = true; this.cboxTestMethod.Items.AddRange(new object[] { + "ONE", "A", "AAB", "ABC"}); @@ -1796,20 +1811,6 @@ namespace Rs.MotionPlat this.timerLight.Interval = 500; this.timerLight.Tick += new System.EventHandler(this.timerLight_Tick); // - // btnDoorStatus - // - this.btnDoorStatus.BackColor = System.Drawing.Color.Green; - this.btnDoorStatus.FlatAppearance.BorderSize = 0; - this.btnDoorStatus.FlatStyle = System.Windows.Forms.FlatStyle.Flat; - this.btnDoorStatus.Font = new System.Drawing.Font("宋体", 23F); - this.btnDoorStatus.ForeColor = System.Drawing.Color.White; - this.btnDoorStatus.Location = new System.Drawing.Point(8, 205); - this.btnDoorStatus.Name = "btnDoorStatus"; - this.btnDoorStatus.Size = new System.Drawing.Size(301, 48); - this.btnDoorStatus.TabIndex = 1; - this.btnDoorStatus.Text = "Door"; - this.btnDoorStatus.UseVisualStyleBackColor = false; - // // FormMain // this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 12F); diff --git a/Rs.DeweyTester/Rs.DeweyTester.csproj b/Rs.DeweyTester/Rs.DeweyTester.csproj index eda83e7..e4c10cc 100644 --- a/Rs.DeweyTester/Rs.DeweyTester.csproj +++ b/Rs.DeweyTester/Rs.DeweyTester.csproj @@ -147,6 +147,7 @@ +