增加GRR模式,在GRR模式下,只有第一次才扫码,后面就不再扫码了

master
lhiven 1 year ago
parent 987bdfc10c
commit 2cb613f388

@ -763,5 +763,16 @@ namespace Rs.Framework
return SysConfigParam.GetValue<bool>(nameof(EnableTwoSpeed)); return SysConfigParam.GetValue<bool>(nameof(EnableTwoSpeed));
} }
} }
/// <summary>
/// GRR
/// </summary>
public static bool GRR
{
get
{
return SysConfigParam.GetValue<bool>(nameof(GRR));
}
}
} }
} }

@ -128,6 +128,7 @@ namespace Rs.MotionPlat.Flow
/// 未执行的任务数量 /// 未执行的任务数量
/// </summary> /// </summary>
private int undoTaskNum = 0; private int undoTaskNum = 0;
int scanNum = 0;
public override void Run() public override void Run()
{ {
switch (flowStep) switch (flowStep)
@ -1468,10 +1469,16 @@ namespace Rs.MotionPlat.Flow
if(curNozzle.ToType== TurnoverType.Turnover) if(curNozzle.ToType== TurnoverType.Turnover)
{ {
if (LoadAndUnloadTask.Instance.GetUndealedLoadToTurnoverTask().Count == 0 && !GlobalVar.VirtualAxis) if (LoadAndUnloadTask.Instance.GetUndealedLoadToTurnoverTask().Count == 0 && !GlobalVar.VirtualAxis)
{
if(GlobalVar.GRR)
{
scanNum++;
}
if(scanNum==1 || !GlobalVar.GRR)
{ {
//没有需要给周转盘上料的任务后,就开始上相机扫码 //没有需要给周转盘上料的任务后,就开始上相机扫码
//判断周转盘第一行有没有产品,如果有产品则拍第一行 //判断周转盘第一行有没有产品,如果有产品则拍第一行
if(TurnoverTrayManager.Instance.HasProduct(ETrayRow.One)) if (TurnoverTrayManager.Instance.HasProduct(ETrayRow.One))
{ {
//找拍照起点和终点 //找拍照起点和终点
SlotPoint grabStartPoint = TrayPointManager.GetSlotPoint(ETrayType.Turnover, 1); SlotPoint grabStartPoint = TrayPointManager.GetSlotPoint(ETrayType.Turnover, 1);
@ -1480,30 +1487,30 @@ namespace Rs.MotionPlat.Flow
List<VisionResult> result = UpCameraScanBarCodeFlow.Instance.Wait(); List<VisionResult> result = UpCameraScanBarCodeFlow.Instance.Wait();
foreach (var vr in result) foreach (var vr in result)
{ {
if(TurnoverTrayManager.Instance.Slot(vr.SlotIndex).IsHasProduct) if (TurnoverTrayManager.Instance.Slot(vr.SlotIndex).IsHasProduct)
{ {
if (vr.SearchModelOK)//定位成功 if (vr.SearchModelOK)//定位成功
{ {
if(!GlobalVar.EnableScanBarCodeByDownCamera) if (!GlobalVar.EnableScanBarCodeByDownCamera)
{ {
if(GlobalVar.RunSpace) if (GlobalVar.RunSpace)
{ {
LoadAndUnloadTask.Instance.CopyBarcodeToTask(vr.SlotIndex-1, VirtualBarCode.Code); LoadAndUnloadTask.Instance.CopyBarcodeToTask(vr.SlotIndex - 1, VirtualBarCode.Code);
} }
else else
{ {
if(vr.ScanBarCodeOK) if (vr.ScanBarCodeOK)
{ {
OnShowGrabResult?.Invoke(vr,true); OnShowGrabResult?.Invoke(vr, true);
//复制二维码 //复制二维码
LoadAndUnloadTask.Instance.CopyBarcodeToTask(vr.SlotIndex-1, vr.SN); LoadAndUnloadTask.Instance.CopyBarcodeToTask(vr.SlotIndex - 1, vr.SN);
} }
else else
{ {
int failNum = 1; int failNum = 1;
while(true) while (true)
{ {
if(failNum<4) if (failNum < 4)
{ {
//如果扫码失败再重扫一次 //如果扫码失败再重扫一次
UpCameraScanBarCodeFlow.Instance.ScanSingle(vr.SlotIndex, true); UpCameraScanBarCodeFlow.Instance.ScanSingle(vr.SlotIndex, true);
@ -1526,7 +1533,7 @@ namespace Rs.MotionPlat.Flow
else else
{ {
box = MsgBox.ShowDialog(AlarmConstID.ScanBarCodeFailAlarm, $"{vr.SlotIndex}穴位扫码失败", ETipButton.Retry | ETipButton.Cancel); box = MsgBox.ShowDialog(AlarmConstID.ScanBarCodeFailAlarm, $"{vr.SlotIndex}穴位扫码失败", ETipButton.Retry | ETipButton.Cancel);
if(box.Button== ETipButton.Retry) if (box.Button == ETipButton.Retry)
{ {
failNum = 1; failNum = 1;
} }
@ -1550,7 +1557,7 @@ namespace Rs.MotionPlat.Flow
} }
else else
{ {
OnShowGrabResult?.Invoke(vr,false); OnShowGrabResult?.Invoke(vr, false);
} }
} }
//OnUpCameraGrabResult?.Invoke(result); //OnUpCameraGrabResult?.Invoke(result);
@ -1574,7 +1581,7 @@ namespace Rs.MotionPlat.Flow
{ {
if (GlobalVar.RunSpace) if (GlobalVar.RunSpace)
{ {
LoadAndUnloadTask.Instance.CopyBarcodeToTask(vr.SlotIndex-1, VirtualBarCode.Code); LoadAndUnloadTask.Instance.CopyBarcodeToTask(vr.SlotIndex - 1, VirtualBarCode.Code);
} }
else else
{ {
@ -1582,7 +1589,7 @@ namespace Rs.MotionPlat.Flow
{ {
OnShowGrabResult?.Invoke(vr, true); OnShowGrabResult?.Invoke(vr, true);
//复制二维码 //复制二维码
LoadAndUnloadTask.Instance.CopyBarcodeToTask(vr.SlotIndex- 1, vr.SN); LoadAndUnloadTask.Instance.CopyBarcodeToTask(vr.SlotIndex - 1, vr.SN);
} }
else else
{ {
@ -1617,7 +1624,7 @@ namespace Rs.MotionPlat.Flow
{ {
failNum = 1; failNum = 1;
} }
else if(box.Button== ETipButton.Skip) else if (box.Button == ETipButton.Skip)
{ {
//OnShowGrabResult?.Invoke(vrsigle, true); //OnShowGrabResult?.Invoke(vrsigle, true);
//复制二维码 //复制二维码
@ -1637,7 +1644,7 @@ namespace Rs.MotionPlat.Flow
} }
else else
{ {
OnShowGrabResult?.Invoke(vr,false); OnShowGrabResult?.Invoke(vr, false);
} }
} }
//OnUpCameraGrabResult?.Invoke(result); //OnUpCameraGrabResult?.Invoke(result);
@ -1645,6 +1652,7 @@ namespace Rs.MotionPlat.Flow
} }
} }
} }
}
if (LoadAndUnloadTask.Instance.GetUnDealedTask().Count > 0) if (LoadAndUnloadTask.Instance.GetUnDealedTask().Count > 0)
{ {

@ -58,6 +58,7 @@
this.label6 = new System.Windows.Forms.Label(); this.label6 = new System.Windows.Forms.Label();
this.cboxVirtualAxis = new System.Windows.Forms.CheckBox(); this.cboxVirtualAxis = new System.Windows.Forms.CheckBox();
this.cboxCheckSafeEnable = new System.Windows.Forms.CheckBox(); this.cboxCheckSafeEnable = new System.Windows.Forms.CheckBox();
this.cboxEnableTestFixtureFiberCheck = new System.Windows.Forms.CheckBox();
this.cboxEnableTwoSpeed = new System.Windows.Forms.CheckBox(); this.cboxEnableTwoSpeed = new System.Windows.Forms.CheckBox();
this.cboxEnableScanBarCodeByDownCamera = new System.Windows.Forms.CheckBox(); this.cboxEnableScanBarCodeByDownCamera = new System.Windows.Forms.CheckBox();
this.cboxEnableExceptionHandlingNozzle = new System.Windows.Forms.CheckBox(); this.cboxEnableExceptionHandlingNozzle = new System.Windows.Forms.CheckBox();
@ -82,7 +83,7 @@
this.label27 = new System.Windows.Forms.Label(); this.label27 = new System.Windows.Forms.Label();
this.txtControlCenterIP = new System.Windows.Forms.TextBox(); this.txtControlCenterIP = new System.Windows.Forms.TextBox();
this.label26 = new System.Windows.Forms.Label(); this.label26 = new System.Windows.Forms.Label();
this.cboxEnableTestFixtureFiberCheck = new System.Windows.Forms.CheckBox(); this.cboxGRR = new System.Windows.Forms.CheckBox();
this.tableLayoutPanel1.SuspendLayout(); this.tableLayoutPanel1.SuspendLayout();
this.groupBox3.SuspendLayout(); this.groupBox3.SuspendLayout();
this.groupBox10.SuspendLayout(); this.groupBox10.SuspendLayout();
@ -331,6 +332,7 @@
this.groupBox1.Controls.Add(this.label6); this.groupBox1.Controls.Add(this.label6);
this.groupBox1.Controls.Add(this.cboxVirtualAxis); this.groupBox1.Controls.Add(this.cboxVirtualAxis);
this.groupBox1.Controls.Add(this.cboxCheckSafeEnable); this.groupBox1.Controls.Add(this.cboxCheckSafeEnable);
this.groupBox1.Controls.Add(this.cboxGRR);
this.groupBox1.Controls.Add(this.cboxEnableTestFixtureFiberCheck); this.groupBox1.Controls.Add(this.cboxEnableTestFixtureFiberCheck);
this.groupBox1.Controls.Add(this.cboxEnableTwoSpeed); this.groupBox1.Controls.Add(this.cboxEnableTwoSpeed);
this.groupBox1.Controls.Add(this.cboxEnableScanBarCodeByDownCamera); this.groupBox1.Controls.Add(this.cboxEnableScanBarCodeByDownCamera);
@ -473,6 +475,16 @@
this.cboxCheckSafeEnable.Text = "安全检查"; this.cboxCheckSafeEnable.Text = "安全检查";
this.cboxCheckSafeEnable.UseVisualStyleBackColor = true; this.cboxCheckSafeEnable.UseVisualStyleBackColor = true;
// //
// cboxEnableTestFixtureFiberCheck
//
this.cboxEnableTestFixtureFiberCheck.AutoSize = true;
this.cboxEnableTestFixtureFiberCheck.Location = new System.Drawing.Point(294, 277);
this.cboxEnableTestFixtureFiberCheck.Name = "cboxEnableTestFixtureFiberCheck";
this.cboxEnableTestFixtureFiberCheck.Size = new System.Drawing.Size(96, 16);
this.cboxEnableTestFixtureFiberCheck.TabIndex = 8;
this.cboxEnableTestFixtureFiberCheck.Text = "启用光纤检测";
this.cboxEnableTestFixtureFiberCheck.UseVisualStyleBackColor = true;
//
// cboxEnableTwoSpeed // cboxEnableTwoSpeed
// //
this.cboxEnableTwoSpeed.AutoSize = true; this.cboxEnableTwoSpeed.AutoSize = true;
@ -728,15 +740,15 @@
this.label26.TabIndex = 0; this.label26.TabIndex = 0;
this.label26.Text = "中控IP:"; this.label26.Text = "中控IP:";
// //
// cboxEnableTestFixtureFiberCheck // cboxGRR
// //
this.cboxEnableTestFixtureFiberCheck.AutoSize = true; this.cboxGRR.AutoSize = true;
this.cboxEnableTestFixtureFiberCheck.Location = new System.Drawing.Point(294, 277); this.cboxGRR.Location = new System.Drawing.Point(391, 277);
this.cboxEnableTestFixtureFiberCheck.Name = "cboxEnableTestFixtureFiberCheck"; this.cboxGRR.Name = "cboxGRR";
this.cboxEnableTestFixtureFiberCheck.Size = new System.Drawing.Size(96, 16); this.cboxGRR.Size = new System.Drawing.Size(42, 16);
this.cboxEnableTestFixtureFiberCheck.TabIndex = 8; this.cboxGRR.TabIndex = 8;
this.cboxEnableTestFixtureFiberCheck.Text = "启用光纤检测"; this.cboxGRR.Text = "GRR";
this.cboxEnableTestFixtureFiberCheck.UseVisualStyleBackColor = true; this.cboxGRR.UseVisualStyleBackColor = true;
// //
// CommonConfig // CommonConfig
// //
@ -824,5 +836,6 @@
private System.Windows.Forms.Label label9; private System.Windows.Forms.Label label9;
private System.Windows.Forms.CheckBox cboxEnableTwoSpeed; private System.Windows.Forms.CheckBox cboxEnableTwoSpeed;
private System.Windows.Forms.CheckBox cboxEnableTestFixtureFiberCheck; private System.Windows.Forms.CheckBox cboxEnableTestFixtureFiberCheck;
private System.Windows.Forms.CheckBox cboxGRR;
} }
} }
Loading…
Cancel
Save