From 9a8c87e7e8172fceadf5c2eda100ae70eb4b6e9b Mon Sep 17 00:00:00 2001 From: lhiven Date: Sun, 11 Aug 2024 17:58:12 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BC=98=E5=8C=96GRR=E5=9C=A8=E6=B2=BB?= =?UTF-8?q?=E5=85=B7=E5=8F=96=E6=96=99=E5=AE=8C=E6=88=90=E5=90=8E=E8=AE=B0?= =?UTF-8?q?=E5=BD=95=E4=BA=A7=E5=93=81=E7=9A=84=E6=B5=8B=E8=AF=95=E6=AC=A1?= =?UTF-8?q?=E6=95=B0=E5=92=8C=E6=B5=8B=E8=AF=95=E8=BF=87=E7=9A=84=E6=B2=BB?= =?UTF-8?q?=E5=85=B7?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Rs.DeweyTester/Flow/NormalFlow/GrrFlow.cs | 177 ++++++++++++---------- Rs.DeweyTester/Properties/AssemblyInfo.cs | 2 +- 2 files changed, 101 insertions(+), 78 deletions(-) diff --git a/Rs.DeweyTester/Flow/NormalFlow/GrrFlow.cs b/Rs.DeweyTester/Flow/NormalFlow/GrrFlow.cs index f485669..d22bd98 100644 --- a/Rs.DeweyTester/Flow/NormalFlow/GrrFlow.cs +++ b/Rs.DeweyTester/Flow/NormalFlow/GrrFlow.cs @@ -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); } diff --git a/Rs.DeweyTester/Properties/AssemblyInfo.cs b/Rs.DeweyTester/Properties/AssemblyInfo.cs index 36fdf41..b118133 100644 --- a/Rs.DeweyTester/Properties/AssemblyInfo.cs +++ b/Rs.DeweyTester/Properties/AssemblyInfo.cs @@ -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")]