优化GRR在治具取料完成后记录产品的测试次数和测试过的治具

master
lhiven 1 year ago
parent 5eb1de3c02
commit 9a8c87e7e8

@ -5,6 +5,7 @@ using Rs.MotionPlat.Commom;
using Rs.MotionPlat.Entitys; using Rs.MotionPlat.Entitys;
using Rs.MotionPlat.Flow.Common; using Rs.MotionPlat.Flow.Common;
using Rs.MotionPlat.Flow.SafePosFlow; using Rs.MotionPlat.Flow.SafePosFlow;
using Rs.MotionPlat.Flow.SubFlow;
using Rs.MotionPlat.Vision; using Rs.MotionPlat.Vision;
using System; using System;
using System.Collections.Generic; using System.Collections.Generic;
@ -177,6 +178,8 @@ namespace Rs.MotionPlat.Flow
needGrrFixtureList = TestFixtureManager.Instance.GetEnableFixtureList(); needGrrFixtureList = TestFixtureManager.Instance.GetEnableFixtureList();
if(needGrrFixtureList != null) if(needGrrFixtureList != null)
{ {
string fixtureindex = string.Join(",", needGrrFixtureList.Select(f => f.Index));
MessageQueue.Instance.Insert($"GRR流程开始启用治具:{fixtureindex},产品数量:{GlobalVar.GrrProductNum},测试次数:{GlobalVar.GrrTestNum}");
int i = 0; int i = 0;
foreach (TestFixture testFixture in needGrrFixtureList) foreach (TestFixture testFixture in needGrrFixtureList)
{ {
@ -532,9 +535,27 @@ namespace Rs.MotionPlat.Flow
case EGrrFlowStep.: case EGrrFlowStep.:
if (Ops.IsOn($"吸料真空{curTakeNozzle.NozzleIndex}检测") || GlobalVar.RunSpace) if (Ops.IsOn($"吸料真空{curTakeNozzle.NozzleIndex}检测") || GlobalVar.RunSpace)
{ {
logInfo = $"{GetClassName()}取料完成真空检测OK吸嘴 {curTakeNozzle.NozzleIndex} 从治具 {curFixture.Index} 把产品SN {curFixture.Product.SN} 取出";
MessageQueue.Instance.Insert(logInfo);
curTakeNozzle.Product = curFixture.Product; curTakeNozzle.Product = curFixture.Product;
string testFixtures = string.Join(",", curTakeNozzle.Product.TestedFixtures);
//try
//{
// LogHelper.Debug($"测试治具:{testFixtures}");
//}
//catch (Exception ex)
//{
//}
//try
//{
// LogHelper.Debug($"测试次数:{curTakeNozzle.Product.TestNum}");
//}
//catch (Exception ex)
//{
// LogHelper.Debug($"取测试");
//}
logInfo = $"{GetClassName()}取料完成真空检测OK吸嘴 {curTakeNozzle.NozzleIndex} 从治具 {curFixture.Index} 把产品SN {curFixture.Product.SN} 取出,测试治具:{testFixtures},测试次数:{curTakeNozzle.Product.TestNum}";
MessageQueue.Instance.Insert(logInfo);
curFixture.Clear();//.Product = null; curFixture.Clear();//.Product = null;
GlobalTray.NozzleTray.ChangeStatus(curTakeNozzle.NozzleIndex, ESlotStatus.Have); GlobalTray.NozzleTray.ChangeStatus(curTakeNozzle.NozzleIndex, ESlotStatus.Have);
if(GlobalVar.TestMode=="GRR") if(GlobalVar.TestMode=="GRR")
@ -763,7 +784,7 @@ namespace Rs.MotionPlat.Flow
else else
{ {
DischargeModuleGoSafePosFlow.Instance.GoSafePostion(); DischargeModuleGoSafePosFlow.Instance.GoSafePostion();
Msg.ShowInfo("Grr test finished!"); Msgbox.ShowTipDialog(EButtonType.Ok, "Grr test finished!", "tip", true);
flowStep = EGrrFlowStep.; flowStep = EGrrFlowStep.;
Reset(); Reset();
Ops.Stop(); Ops.Stop();
@ -780,17 +801,19 @@ namespace Rs.MotionPlat.Flow
curDumpSlot = GlobalTray.GrrTray.GetSlot(curDumpNozzle.Product.FromSlotIndex); curDumpSlot = GlobalTray.GrrTray.GetSlot(curDumpNozzle.Product.FromSlotIndex);
if (curDumpSlot != null) if (curDumpSlot != null)
{ {
StockPlaceFlow.Instance.Place(ETrayType.Grr, curDumpSlot.Index, curDumpNozzle.NozzleIndex);
flowStep = EGrrFlowStep.;
//double curLoadX = Ops.GetCurPosition(AxisControl.LoadX); //double curLoadX = Ops.GetCurPosition(AxisControl.LoadX);
//if(curLoadX-GlobalVar.FixtureSafePosX>50) //if(curLoadX-GlobalVar.FixtureSafePosX>50)
//{ //{
// DischargeModuleGoSafePosFlow.Instance.GoSafePostion(ESafePosSide.PlaceToStock); // DischargeModuleGoSafePosFlow.Instance.GoSafePostion(ESafePosSide.PlaceToStock);
//} //}
targetPosition = NozzleManager.GetToTraySlot(ETrayType.Grr, curDumpSlot.Index, curDumpNozzle.NozzleIndex); //targetPosition = NozzleManager.GetToTraySlot(ETrayType.Grr, curDumpSlot.Index, curDumpNozzle.NozzleIndex);
if(GroupAxisMove.XY1Y2MovePos(targetPosition, GlobalVar.WholeSpeed, EGoWhichSide.StockSide)) //if(GroupAxisMove.XY1Y2MovePos(targetPosition, GlobalVar.WholeSpeed, EGoWhichSide.StockSide))
{ //{
AxisPosPrint.PrintXY1Y2TargetPos("到料仓放料位上方,", targetPosition, GetClassName()); // AxisPosPrint.PrintXY1Y2TargetPos("到料仓放料位上方,", targetPosition, GetClassName());
flowStep = EGrrFlowStep.; // flowStep = EGrrFlowStep.等待到料仓放料位上方;
} //}
} }
else else
{ {
@ -798,74 +821,74 @@ namespace Rs.MotionPlat.Flow
} }
} }
break; break;
case EGrrFlowStep.: //case EGrrFlowStep.等待到料仓放料位上方:
if (Ops.IsStop("LoadX", "LoadY1", "LoadY2")) // if (Ops.IsStop("LoadX", "LoadY1", "LoadY2"))
{ // {
AxisPosPrint.PrintXY1Y2CurrentPos("轴loadx,loady1,loady2已停止运动,",GetClassName()); // AxisPosPrint.PrintXY1Y2CurrentPos("轴loadx,loady1,loady2已停止运动,",GetClassName());
if (AxisArrived.LoadXY1Y2IsArrived(targetPosition.X, targetPosition.Y1, targetPosition.Y2)) // if (AxisArrived.LoadXY1Y2IsArrived(targetPosition.X, targetPosition.Y1, targetPosition.Y2))
{ // {
AxisPosPrint.PrintXY1Y2CurrentPos("已运动到料仓放料位上方,", GetClassName()); // AxisPosPrint.PrintXY1Y2CurrentPos("已运动到料仓放料位上方,", GetClassName());
flowStep = EGrrFlowStep.; // flowStep = EGrrFlowStep.到料仓放料位下方;
} // }
else // else
{ // {
flowStep = EGrrFlowStep.; // flowStep = EGrrFlowStep.到料仓放料位上方;
} // }
} // }
break; // break;
case EGrrFlowStep.: //case EGrrFlowStep.到料仓放料位下方:
targetPosition.NozzleZ = NozzleManager.GetNozzleToTrayTakeProductPos(ETrayType.Grr, curDumpNozzle.NozzleIndex); // targetPosition.NozzleZ = NozzleManager.GetNozzleToTrayTakeProductPos(ETrayType.Grr, curDumpNozzle.NozzleIndex);
if(NozzleManager.Go(curDumpNozzle,targetPosition.NozzleZ,GlobalVar.WholeSpeed)) // if(NozzleManager.Go(curDumpNozzle,targetPosition.NozzleZ,GlobalVar.WholeSpeed))
{ // {
logInfo = $"{GetClassName()}到料仓放料位下方"; // logInfo = $"{GetClassName()}到料仓放料位下方";
MessageQueue.Instance.Insert(logInfo); // MessageQueue.Instance.Insert(logInfo);
flowStep = EGrrFlowStep.; // flowStep = EGrrFlowStep.等待到料仓放料位下方;
} // }
break; // break;
case EGrrFlowStep.: //case EGrrFlowStep.等待到料仓放料位下方:
if (Ops.IsStop($"NozzleZ{curDumpNozzle.NozzleIndex}")) // if (Ops.IsStop($"NozzleZ{curDumpNozzle.NozzleIndex}"))
{ // {
logInfo = $"{GetClassName()}已运动到料仓放料位下方"; // logInfo = $"{GetClassName()}已运动到料仓放料位下方";
MessageQueue.Instance.Insert(logInfo); // MessageQueue.Instance.Insert(logInfo);
if (GlobalVar.RunSpace) // if (GlobalVar.RunSpace)
{ // {
flowStep = EGrrFlowStep.; // flowStep = EGrrFlowStep.料仓放料完成抬起;
} // }
else // else
{ // {
curDumpNozzle.VacSuction(EIoOperate.Close, GetClassName()); // curDumpNozzle.VacSuction(EIoOperate.Close, GetClassName());
curDumpNozzle.VacBreak(EIoOperate.Open, GetClassName()); // curDumpNozzle.VacBreak(EIoOperate.Open, GetClassName());
curDumpNozzle.VacBreak(EIoOperate.Close, GetClassName()); // curDumpNozzle.VacBreak(EIoOperate.Close, GetClassName());
flowStep = EGrrFlowStep.; // flowStep = EGrrFlowStep.料仓放料完成抬起;
} // }
} // }
break; // break;
case EGrrFlowStep.: //case EGrrFlowStep.料仓放料完成抬起:
if(NozzleManager.GotoSafePos(curDumpNozzle.NozzleIndex)) // if(NozzleManager.GotoSafePos(curDumpNozzle.NozzleIndex))
{ // {
logInfo = $"{GetClassName()}料仓放料完成抬起"; // logInfo = $"{GetClassName()}料仓放料完成抬起";
MessageQueue.Instance.Insert(logInfo); // MessageQueue.Instance.Insert(logInfo);
flowStep = EGrrFlowStep.; // flowStep = EGrrFlowStep.等待料仓放料完成抬起;
} // }
break; // break;
case EGrrFlowStep.: //case EGrrFlowStep.等待料仓放料完成抬起:
if (Ops.IsStop($"NozzleZ{curDumpNozzle.NozzleIndex}")) // if (Ops.IsStop($"NozzleZ{curDumpNozzle.NozzleIndex}"))
{ // {
logInfo = $"{GetClassName()}料仓放料完成已抬起"; // logInfo = $"{GetClassName()}料仓放料完成已抬起";
MessageQueue.Instance.Insert(logInfo); // MessageQueue.Instance.Insert(logInfo);
flowStep = EGrrFlowStep.; // flowStep = EGrrFlowStep.料仓放料完成粘料检测;
} // }
break; // break;
case EGrrFlowStep.: //case EGrrFlowStep.料仓放料完成粘料检测:
if (!curDumpNozzle.HasProduct() || GlobalVar.RunSpace) // if (!curDumpNozzle.HasProduct() || GlobalVar.RunSpace)
{ // {
logInfo = $"{GetClassName()}料仓放料完成,吸嘴 {curDumpNozzle.NozzleIndex} 把产品SN {curDumpNozzle.Product.SN} 放入料仓穴位 {curDumpSlot.Index}"; // logInfo = $"{GetClassName()}料仓放料完成,吸嘴 {curDumpNozzle.NozzleIndex} 把产品SN {curDumpNozzle.Product.SN} 放入料仓穴位 {curDumpSlot.Index}";
MessageQueue.Instance.Insert(logInfo); // MessageQueue.Instance.Insert(logInfo);
GlobalTray.GrrTray.ChangeStatus(curDumpSlot.Index, ESlotStatus.Have); // GlobalTray.GrrTray.ChangeStatus(curDumpSlot.Index, ESlotStatus.Have);
curDumpNozzle.Clear(); // curDumpNozzle.Clear();
flowStep = EGrrFlowStep.; // flowStep = EGrrFlowStep.判断是否需要放料到料仓;
} // }
break; // break;
} }
Thread.Sleep(5); Thread.Sleep(5);
} }

@ -31,6 +31,6 @@ using System.Runtime.InteropServices;
// //
//可以指定所有这些值,也可以使用“生成号”和“修订号”的默认值 //可以指定所有这些值,也可以使用“生成号”和“修订号”的默认值
//通过使用 "*",如下所示: //通过使用 "*",如下所示:
[assembly: AssemblyVersion("1.20.24.07")] [assembly: AssemblyVersion("1.20.24.08")]
//[assembly: AssemblyVersion("1.0.0.0")] //[assembly: AssemblyVersion("1.0.0.0")]
//[assembly: AssemblyFileVersion("1.0.0.0")] //[assembly: AssemblyFileVersion("1.0.0.0")]

Loading…
Cancel
Save