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

Loading…
Cancel
Save