1、增加11位二维码补齐22位功能。

2、增加单测试模式,不管OK还是NG都只测试一次。
develop
lhiven 4 weeks ago
parent ded2f3bc37
commit ce363e4779

@ -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}";
}
}
}

@ -1,4 +1,5 @@
using Rs.Framework; using Rs.Framework;
using Rs.MotionPlat.Commom;
using System; using System;
using System.Collections.Generic; using System.Collections.Generic;
using System.Linq; using System.Linq;
@ -78,7 +79,14 @@ namespace Rs.MotionPlat.Entitys
Result = (EOneGrabSixteenResult)Enum.Parse(typeof(EOneGrabSixteenResult), results[1]); Result = (EOneGrabSixteenResult)Enum.Parse(typeof(EOneGrabSixteenResult), results[1]);
if (Result == EOneGrabSixteenResult.Ok) 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]); OffsetX = Convert.ToDouble(results[3]);
OffsetY = Convert.ToDouble(results[4]); OffsetY = Convert.ToDouble(results[4]);
} }
@ -162,7 +170,11 @@ namespace Rs.MotionPlat.Entitys
_Items[index].OffsetY = 0; _Items[index].OffsetY = 0;
if (_Items[index].Result== EOneGrabSixteenResult.Ok) 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]; _Items[index].SN = data[2];
} }

@ -406,7 +406,7 @@ namespace Rs.MotionPlat.Flow
if (fixtureret !=null && fixtureret.Result == EOneGrabSixteenResult.Ok) if (fixtureret !=null && fixtureret.Result == EOneGrabSixteenResult.Ok)
{ {
LogHelper.Debug(GetClassName() + $"{JsonConvert.SerializeObject(fixtureret)}"); LogHelper.Debug(GetClassName() + $"{JsonConvert.SerializeObject(fixtureret)}");
if (fixtureret.SN.Length == GlobalVar.BarcodeLength) //if (fixtureret.SN.Length == GlobalVar.BarcodeLength)
{ {
try try
{ {
@ -424,25 +424,25 @@ namespace Rs.MotionPlat.Flow
Msg.ShowError(ex.Message); Msg.ShowError(ex.Message);
} }
} }
else //else
{ //{
try // try
{ // {
LogHelper.Debug(GetClassName() + "检测到二维码长度和设置的长度不一致,弹框报警"); // LogHelper.Debug(GetClassName() + "检测到二维码长度和设置的长度不一致,弹框报警");
//报警弹框 // //报警弹框
alarmEntity = AlarmCollection.Get(AlarmConstID.).Transform(ret.SlotIndex); // alarmEntity = AlarmCollection.Get(AlarmConstID.二维码长度异常报警).Transform(ret.SlotIndex);
EButtonType buttonSelect = Msgbox.ShowDialog(alarmEntity, EButtonType.Retry, true); // EButtonType buttonSelect = Msgbox.ShowDialog(alarmEntity, EButtonType.Retry, true);
if (buttonSelect == EButtonType.Retry) // if (buttonSelect == EButtonType.Retry)
{ // {
logInfo = GetClassName() + "选择了重试"; // logInfo = GetClassName() + "选择了重试";
MessageQueue.Instance.Insert(logInfo); // MessageQueue.Instance.Insert(logInfo);
} // }
} // }
catch (Exception ex) // catch (Exception ex)
{ // {
Msg.ShowError(ex.Message); // Msg.ShowError(ex.Message);
} // }
} //}
} }
else if (fixtureret != null && fixtureret.Result == EOneGrabSixteenResult.LocationOkScanBarcodeFail) else if (fixtureret != null && fixtureret.Result == EOneGrabSixteenResult.LocationOkScanBarcodeFail)
{ {
@ -1102,7 +1102,15 @@ namespace Rs.MotionPlat.Flow
//ABC模式 //ABC模式
switch (GlobalVar.TestMethod) switch (GlobalVar.TestMethod)
{ {
case "ONE":
foreach (Nozzle item in NozzleManager.GetNozzlesByStatus(ENozzleStatus.ToTest))
{
if (item.Product != null)
{
return item;
}
}
break;
case "A": case "A":
foreach (Nozzle item in NozzleManager.GetNozzlesByStatus(ENozzleStatus.ToTest)) foreach (Nozzle item in NozzleManager.GetNozzlesByStatus(ENozzleStatus.ToTest))
{ {

@ -225,7 +225,10 @@ namespace Rs.MotionPlat.Flow.SubFlow
curNozzle.Product = curFixture.Product; curNozzle.Product = curFixture.Product;
if(GlobalVar.TestMode!="GRR" && GlobalVar.TestMode!="AUDIT") 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; curNozzle.Status = ENozzleStatus.ToUnload;
} }

@ -40,6 +40,7 @@ namespace Rs.MotionPlat
this.dataGridViewTextBoxColumn1 = new System.Windows.Forms.DataGridViewTextBoxColumn(); this.dataGridViewTextBoxColumn1 = new System.Windows.Forms.DataGridViewTextBoxColumn();
this.dataGridViewTextBoxColumn2 = new System.Windows.Forms.DataGridViewTextBoxColumn(); this.dataGridViewTextBoxColumn2 = new System.Windows.Forms.DataGridViewTextBoxColumn();
this.groupBox36 = new System.Windows.Forms.GroupBox(); this.groupBox36 = new System.Windows.Forms.GroupBox();
this.btnDoorStatus = new System.Windows.Forms.Button();
this.btnSelectProduct = new System.Windows.Forms.Button(); this.btnSelectProduct = new System.Windows.Forms.Button();
this.btnUpCameraGrab = new System.Windows.Forms.Button(); this.btnUpCameraGrab = new System.Windows.Forms.Button();
this.btnClearData = 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.timertc6 = new System.Windows.Forms.Timer(this.components);
this.timeruph = 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.timerLight = new System.Windows.Forms.Timer(this.components);
this.btnDoorStatus = new System.Windows.Forms.Button();
this.panel1.SuspendLayout(); this.panel1.SuspendLayout();
this.groupBox37.SuspendLayout(); this.groupBox37.SuspendLayout();
((System.ComponentModel.ISupportInitialize)(this.dgv_errinfo)).BeginInit(); ((System.ComponentModel.ISupportInitialize)(this.dgv_errinfo)).BeginInit();
@ -282,6 +282,20 @@ namespace Rs.MotionPlat
this.groupBox36.TabStop = false; this.groupBox36.TabStop = false;
this.groupBox36.Text = "Quick functions"; 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 // btnSelectProduct
// //
this.btnSelectProduct.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(56)))), ((int)(((byte)(56)))), ((int)(((byte)(56))))); 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.Enabled = false;
this.cboxTestMethod.FormattingEnabled = true; this.cboxTestMethod.FormattingEnabled = true;
this.cboxTestMethod.Items.AddRange(new object[] { this.cboxTestMethod.Items.AddRange(new object[] {
"ONE",
"A", "A",
"AAB", "AAB",
"ABC"}); "ABC"});
@ -1796,20 +1811,6 @@ namespace Rs.MotionPlat
this.timerLight.Interval = 500; this.timerLight.Interval = 500;
this.timerLight.Tick += new System.EventHandler(this.timerLight_Tick); 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 // FormMain
// //
this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 12F); this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 12F);

@ -147,6 +147,7 @@
<Compile Include="Commom\LanguageHelper.cs" /> <Compile Include="Commom\LanguageHelper.cs" />
<Compile Include="Commom\Msgbox.cs" /> <Compile Include="Commom\Msgbox.cs" />
<Compile Include="Commom\MySqlHelper.cs" /> <Compile Include="Commom\MySqlHelper.cs" />
<Compile Include="Commom\PadBarCode.cs" />
<Compile Include="Commom\ParameterInitAttribute.cs" /> <Compile Include="Commom\ParameterInitAttribute.cs" />
<Compile Include="Commom\ScanFailNGHelper.cs" /> <Compile Include="Commom\ScanFailNGHelper.cs" />
<Compile Include="Commom\TrayHelper.cs" /> <Compile Include="Commom\TrayHelper.cs" />

Loading…
Cancel
Save