From ef28c6bf2269b2caeb10580621d67ea737af9c26 Mon Sep 17 00:00:00 2001 From: lhiven Date: Fri, 2 Aug 2024 16:13:25 +0800 Subject: [PATCH] =?UTF-8?q?=E5=8F=96=E6=94=BE=E6=96=99=E5=A2=9E=E5=8A=A0?= =?UTF-8?q?=E4=B8=80=E4=B8=AA=E6=98=AF=E5=90=A6=E5=8F=97=E5=81=9C=E6=AD=A2?= =?UTF-8?q?=E6=8C=89=E9=92=AE=E7=9A=84=E6=8E=A7=E5=88=B6?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Flow/NormalFlow/DischargeFlow.cs | 3 ++- .../Flow/NormalFlow/ThreePointLocationFlow.cs | 4 ++-- .../DischargeModuleGoSafePosFlow.cs | 5 ++++- Rs.DeweyTester/Flow/SubFlow/StockPlaceFlow.cs | 4 ++-- Rs.DeweyTester/Flow/SubFlow/StockTakeFlow.cs | 18 ++++++++++++++---- 5 files changed, 24 insertions(+), 10 deletions(-) diff --git a/Rs.DeweyTester/Flow/NormalFlow/DischargeFlow.cs b/Rs.DeweyTester/Flow/NormalFlow/DischargeFlow.cs index 8ff8676..5b86328 100644 --- a/Rs.DeweyTester/Flow/NormalFlow/DischargeFlow.cs +++ b/Rs.DeweyTester/Flow/NormalFlow/DischargeFlow.cs @@ -374,7 +374,7 @@ namespace Rs.MotionPlat.Flow ProductLocationResult ret = productLocationResult.Where(r => r.SlotIndex == takeSlotIndex).FirstOrDefault(); if(ret != null || GlobalVar.RunSpace) { - if((ret!= null && ret.Result== EOneGrabSixteenResult.Ok) || GlobalVar.RunSpace) + if((ret!= null && ret.Result== EOneGrabSixteenResult.Ok) ||(ret!=null &&ret.Result== EOneGrabSixteenResult.LocationOkScanBarcodeFail && GlobalVar.EnableVirtualBarCode) || GlobalVar.RunSpace) { StockTakeFlow.Instance.Take( ETrayType.Input, takeSlotIndex, NozzleManager.GetIdelNozzle().NozzleIndex); takeSlotIndex++; @@ -677,6 +677,7 @@ namespace Rs.MotionPlat.Flow if (placeSlotIndex > 0) { StockPlaceFlow.Instance.Place(ETrayType.Ok, placeSlotIndex, placeNozzleIndex); + } else if (placeSlotIndex == 0)//此区域已经无穴位放产品 { diff --git a/Rs.DeweyTester/Flow/NormalFlow/ThreePointLocationFlow.cs b/Rs.DeweyTester/Flow/NormalFlow/ThreePointLocationFlow.cs index 64b91e6..e363e57 100644 --- a/Rs.DeweyTester/Flow/NormalFlow/ThreePointLocationFlow.cs +++ b/Rs.DeweyTester/Flow/NormalFlow/ThreePointLocationFlow.cs @@ -49,7 +49,7 @@ namespace Rs.MotionPlat.Flow.NormalFlow /// 三点定位(左上/右上/左下) /// /// - public void Location(ETrayType trayType) + public void Location(ETrayType trayType,bool needStop=true) { step = EThreePointLocationFlowStep.到拍照位; List points = new List() { 1, 16, 241 }; @@ -65,7 +65,7 @@ namespace Rs.MotionPlat.Flow.NormalFlow //Task.Run(() => { while (!finished) { - if (MachineManage.Instance.MachineStatus == EMachineStatus.Stop) + if (MachineManage.Instance.MachineStatus == EMachineStatus.Stop && needStop) { Thread.Sleep(10); continue; diff --git a/Rs.DeweyTester/Flow/SafePosFlow/DischargeModuleGoSafePosFlow.cs b/Rs.DeweyTester/Flow/SafePosFlow/DischargeModuleGoSafePosFlow.cs index 02f1e4c..d03cc6a 100644 --- a/Rs.DeweyTester/Flow/SafePosFlow/DischargeModuleGoSafePosFlow.cs +++ b/Rs.DeweyTester/Flow/SafePosFlow/DischargeModuleGoSafePosFlow.cs @@ -56,12 +56,13 @@ namespace Rs.MotionPlat.Flow.SafePosFlow private AlarmEntity alarmEntity = null; EDischargeModuleGoSafePosFlowStep step = EDischargeModuleGoSafePosFlowStep.到安全位; - TargetPosition targetPos = new TargetPosition(); + /// /// 排料头回安全位 /// public void GoSafePostion() { + TargetPosition targetPos = new TargetPosition(); if (finished) { taskFinishedEvent.Reset(); @@ -138,6 +139,7 @@ namespace Rs.MotionPlat.Flow.SafePosFlow /// public void MoveXToSafe() { + TargetPosition targetPos = new TargetPosition(); bool arrivedSafePos = false; EDischargeModuleGoSafePosFlowStep moveXStep = EDischargeModuleGoSafePosFlowStep.到安全位; //判断Y1当前在治具还是在料仓,只有在治具侧才需要把X先移动到安全位 @@ -184,6 +186,7 @@ namespace Rs.MotionPlat.Flow.SafePosFlow /// public void MoveY1ToFixtureSide(double targetLoadX) { + TargetPosition targetPos = new TargetPosition(); bool arrivedSafePos = false; EDischargeModuleGoSafePosFlowStep moveY1Step = EDischargeModuleGoSafePosFlowStep.到安全位; //判断Y1当前在治具还是在料仓,只有在料仓侧才需要把Y1先移动治具那边 diff --git a/Rs.DeweyTester/Flow/SubFlow/StockPlaceFlow.cs b/Rs.DeweyTester/Flow/SubFlow/StockPlaceFlow.cs index b012386..e5853b9 100644 --- a/Rs.DeweyTester/Flow/SubFlow/StockPlaceFlow.cs +++ b/Rs.DeweyTester/Flow/SubFlow/StockPlaceFlow.cs @@ -65,7 +65,7 @@ namespace Rs.MotionPlat.Flow.SubFlow /// 需要放入的料盘 /// 哪个吸嘴放 /// - public void Place(ETrayType trayType,int slotIndex,int nozzleIndex) + public void Place(ETrayType trayType,int slotIndex,int nozzleIndex,bool needStop=true) { RsTray tray = null; if (finished) @@ -99,7 +99,7 @@ namespace Rs.MotionPlat.Flow.SubFlow TraySlot curPlaceSlot = null; while (!finished) { - if (MachineManage.Instance.MachineStatus == EMachineStatus.Stop) + if (MachineManage.Instance.MachineStatus == EMachineStatus.Stop && needStop) { Thread.Sleep(10); continue; diff --git a/Rs.DeweyTester/Flow/SubFlow/StockTakeFlow.cs b/Rs.DeweyTester/Flow/SubFlow/StockTakeFlow.cs index ae62971..9c917a1 100644 --- a/Rs.DeweyTester/Flow/SubFlow/StockTakeFlow.cs +++ b/Rs.DeweyTester/Flow/SubFlow/StockTakeFlow.cs @@ -60,7 +60,7 @@ namespace Rs.MotionPlat.Flow.SubFlow /// 料仓取料 /// /// - public void Take(ETrayType trayType, int slotIndex,int nozzleIndex, ProductLocationResult locaResult=null) + public void Take(ETrayType trayType, int slotIndex,int nozzleIndex, ProductLocationResult locaResult=null,bool needStop=true) { if (finished) finished = false; @@ -71,7 +71,7 @@ namespace Rs.MotionPlat.Flow.SubFlow TargetPosition targetPosition = new TargetPosition(); while (!finished) { - if (MachineManage.Instance.MachineStatus== EMachineStatus.Stop) + if (MachineManage.Instance.MachineStatus == EMachineStatus.Stop && needStop) { Thread.Sleep(10); continue; @@ -188,9 +188,19 @@ namespace Rs.MotionPlat.Flow.SubFlow } else { - if(OneGrabSixteenManager.Instance.GetResultBySlotIndex(slotIndex)!=null) + ProductLocationResult vResult = OneGrabSixteenManager.Instance.GetResultBySlotIndex(slotIndex); + if (vResult!=null) { - curNozzle.Product = new TestProduct() { SN = OneGrabSixteenManager.Instance.GetResultBySlotIndex(slotIndex).SN, TestNum = 0, From = $"R{waitTakeProductSlot.Row + 1}C{waitTakeProductSlot.Column + 1}" }; + string sn = string.Empty; + if(GlobalVar.EnableVirtualBarCode) + { + sn = VirtualBarCode.Code; + } + else + { + sn = vResult.SN; + } + curNozzle.Product = new TestProduct() { SN = sn, TestNum = 0, From = $"R{waitTakeProductSlot.Row + 1}C{waitTakeProductSlot.Column + 1}" }; } } curNozzle.Status = ENozzleStatus.ToTest;