From 65f3f77adef9d420cb5a7136c86fabd0822ad745 Mon Sep 17 00:00:00 2001 From: lhiven Date: Wed, 15 Jan 2025 15:39:02 +0800 Subject: [PATCH] =?UTF-8?q?1=E3=80=81=E4=BF=AE=E5=A4=8D=E4=B8=8D=E7=BB=8F?= =?UTF-8?q?=E8=BF=87=E4=B8=8A=E6=96=99=E8=80=8C=E7=94=B1=E6=B5=8B=E8=AF=95?= =?UTF-8?q?=E8=BD=AF=E4=BB=B6=E7=9B=B4=E6=8E=A5=E6=B5=8B=E8=AF=95=E6=97=B6?= =?UTF-8?q?=EF=BC=8C=E5=BD=93=E6=B5=8B=E8=AF=95=E5=AE=8C=E6=88=90=E5=90=8E?= =?UTF-8?q?=E8=BF=90=E6=8E=A7=E4=BC=9A=E4=B8=8D=E5=81=9C=E7=9A=84=E8=8E=B7?= =?UTF-8?q?=E5=8F=96=E6=B5=8B=E8=AF=95=E7=BB=93=E6=9E=9C=E7=9A=84=E9=97=AE?= =?UTF-8?q?=E9=A2=98=E3=80=82=202=E3=80=81=E4=BF=AE=E5=A4=8DGRR=E6=89=AB?= =?UTF-8?q?=E7=A0=81=E6=97=B6=EF=BC=8C=E5=BD=93=E6=89=AB=E7=A0=81=E5=A4=B1?= =?UTF-8?q?=E8=B4=A5=E6=97=B6=EF=BC=8C=E6=89=8B=E5=8A=A8=E8=BE=93=E5=85=A5?= =?UTF-8?q?=E4=BA=8C=E7=BB=B4=E7=A0=81=E5=8F=AF=E4=BB=A5=E4=B8=BA=E7=A9=BA?= =?UTF-8?q?=E7=9A=84=E9=97=AE=E9=A2=98=E3=80=82=203=E3=80=81=E6=89=8B?= =?UTF-8?q?=E5=8A=A8=E5=8F=96=E6=94=BE=E6=96=99=E6=97=B6=E5=A2=9E=E5=8A=A0?= =?UTF-8?q?=E5=85=88=E6=8B=8D=E7=85=A7=E5=86=8D=E5=8F=96=E6=94=BE=E6=96=99?= =?UTF-8?q?=E5=8A=9F=E8=83=BD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Rs.DeweyTester/Entitys/TestFixtureManager.cs | 2 +- Rs.DeweyTester/Flow/SubFlow/StockPlaceFlow.cs | 4 +- Rs.DeweyTester/GrrScanFailFrm.cs | 17 +++- Rs.DeweyTester/Properties/AssemblyInfo.cs | 2 +- .../Recipe/StockTrayLocationRecipe.cs | 86 +++++++++++-------- 5 files changed, 68 insertions(+), 43 deletions(-) diff --git a/Rs.DeweyTester/Entitys/TestFixtureManager.cs b/Rs.DeweyTester/Entitys/TestFixtureManager.cs index 18d3b44..6f7f1b4 100644 --- a/Rs.DeweyTester/Entitys/TestFixtureManager.cs +++ b/Rs.DeweyTester/Entitys/TestFixtureManager.cs @@ -642,9 +642,9 @@ namespace Rs.MotionPlat.Entitys TotalCount++; Yield = (double)((double)PassCount / TotalCount); AddTestRecordToProduct(); - Status = ETestFixtureStatus.IDLE; //this.Product.AddResult(this.Index, Result, items[6]); } + Status = ETestFixtureStatus.IDLE; string csvContent = string.Join(",", items[3], items[4], items[5]); LogHelper.Debug($"Result:{items[2]},{items[3]}"); DevLog.Summary(CsvTitle, csvContent); diff --git a/Rs.DeweyTester/Flow/SubFlow/StockPlaceFlow.cs b/Rs.DeweyTester/Flow/SubFlow/StockPlaceFlow.cs index dc8bf2f..f133362 100644 --- a/Rs.DeweyTester/Flow/SubFlow/StockPlaceFlow.cs +++ b/Rs.DeweyTester/Flow/SubFlow/StockPlaceFlow.cs @@ -67,7 +67,7 @@ namespace Rs.MotionPlat.Flow.SubFlow /// 需要放入的料盘 /// 哪个吸嘴放 /// - public void Place(ETrayType trayType,int slotIndex,int nozzleIndex,bool needStop=true) + public void Place(ETrayType trayType,int slotIndex,int nozzleIndex,bool needStop=true,bool bNeedGrab=false) { RsTray tray = null; if (finished) @@ -112,7 +112,7 @@ namespace Rs.MotionPlat.Flow.SubFlow case EStockPlaceFlowStep.待触发: slotOffsetX = 0; slotOffsetY = 0; - if (GlobalVar.EnableBeforePlaceProductGrab) + if (GlobalVar.EnableBeforePlaceProductGrab || bNeedGrab) { flowStep = EStockPlaceFlowStep.到料仓拍照位上方; } diff --git a/Rs.DeweyTester/GrrScanFailFrm.cs b/Rs.DeweyTester/GrrScanFailFrm.cs index 85de605..e266c5e 100644 --- a/Rs.DeweyTester/GrrScanFailFrm.cs +++ b/Rs.DeweyTester/GrrScanFailFrm.cs @@ -1,4 +1,5 @@ -using System; +using Rs.Framework; +using System; using System.Collections.Generic; using System.ComponentModel; using System.Data; @@ -27,8 +28,18 @@ namespace Rs.MotionPlat private void btnFillQrcode_Click(object sender, EventArgs e) { - action?.Invoke(1,txtQrcode.Text); - this.Close(); + if(string.IsNullOrEmpty(txtQrcode.Text.Trim())) + { + Msg.ShowError("SN cann't be empty"); + txtQrcode.Text = ""; + txtQrcode.Focus(); + } + else + { + action?.Invoke(1, txtQrcode.Text); + this.Close(); + } + } } } diff --git a/Rs.DeweyTester/Properties/AssemblyInfo.cs b/Rs.DeweyTester/Properties/AssemblyInfo.cs index fd93634..29e92b6 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.25.02")] + [assembly: AssemblyVersion("1.20.25.03")] //[assembly: AssemblyVersion("1.0.0.0")] //[assembly: AssemblyFileVersion("1.0.0.0")] diff --git a/Rs.DeweyTester/Recipe/StockTrayLocationRecipe.cs b/Rs.DeweyTester/Recipe/StockTrayLocationRecipe.cs index cb970b5..14b201c 100644 --- a/Rs.DeweyTester/Recipe/StockTrayLocationRecipe.cs +++ b/Rs.DeweyTester/Recipe/StockTrayLocationRecipe.cs @@ -3,9 +3,11 @@ using Rs.DataAccess; using Rs.Framework; using Rs.Motion; using Rs.MotionPlat.Commom; +using Rs.MotionPlat.Entitys; using Rs.MotionPlat.Flow; using Rs.MotionPlat.Flow.NormalFlow; using Rs.MotionPlat.Flow.SafePosFlow; +using Rs.MotionPlat.Flow.SubFlow; using System; using System.Collections.Generic; using System.ComponentModel; @@ -324,6 +326,7 @@ namespace Rs.MotionPlat.Recipe /// private void TakeProduct(int slotIndex, int nozzleIndex) { + Enum.TryParse(dt.Rows[0]["trayname"].ToString(), out ETrayType trayType); ErrorCode errCode = ErrorCode.Ok; Task.Run(() => { while (true) @@ -335,25 +338,34 @@ namespace Rs.MotionPlat.Recipe DialogResult dr = Msg.ShowQuestion("Are you sure to take product?", MessageBoxButtons.OKCancel); if (dr == DialogResult.OK) { - Nozzle takeNozzle=NozzleManager.GetNozzle(nozzleIndex); - if(Enum.TryParse(m_trayName, out ETrayType takeTray)) + ProductLocationResult fixtureret = FixedGrabProductFlow.Instance.TakePicture(trayType, slotIndex, 1); + if(fixtureret != null) { - double pos = NozzleManager.GetNozzleToTrayTakeProductPos(takeTray, nozzleIndex); - errCode = AxisControl.GetAxis($"NozzleZ{nozzleIndex}").MovePos(pos, GlobalVar.WholeSpeed); - if (errCode > ErrorCode.Ok) return; - while (!Ops.IsStop($"NozzleZ{nozzleIndex}")) + if(fixtureret.Result== EOneGrabSixteenResult.Ok || fixtureret.Result== EOneGrabSixteenResult.LocationOkScanBarcodeFail) { - Thread.Sleep(10); - } - takeNozzle.VacSuction(EIoOperate.Open,nameof(StockTrayLocationRecipe)); - if (NozzleManager.GotoSafePos(nozzleIndex)) - { - while (!Ops.IsStop($"NozzleZ{nozzleIndex}")) - { - Thread.Sleep(10); - } + StockTakeFlow.Instance.Take(trayType, slotIndex, nozzleIndex, EStockScanBarcodeMode.Single,fixtureret,false); } } + + //Nozzle takeNozzle=NozzleManager.GetNozzle(nozzleIndex); + //if(Enum.TryParse(m_trayName, out ETrayType takeTray)) + //{ + // double pos = NozzleManager.GetNozzleToTrayTakeProductPos(takeTray, nozzleIndex); + // errCode = AxisControl.GetAxis($"NozzleZ{nozzleIndex}").MovePos(pos, GlobalVar.WholeSpeed); + // if (errCode > ErrorCode.Ok) return; + // while (!Ops.IsStop($"NozzleZ{nozzleIndex}")) + // { + // Thread.Sleep(10); + // } + // takeNozzle.VacSuction(EIoOperate.Open,nameof(StockTrayLocationRecipe)); + // if (NozzleManager.GotoSafePos(nozzleIndex)) + // { + // while (!Ops.IsStop($"NozzleZ{nozzleIndex}")) + // { + // Thread.Sleep(10); + // } + // } + //} } }); } @@ -362,6 +374,7 @@ namespace Rs.MotionPlat.Recipe /// private void DumpProduct(int slotIndex, int nozzleIndex) { + Enum.TryParse(dt.Rows[0]["trayname"].ToString(), out ETrayType trayType); ErrorCode errCode = ErrorCode.Ok; Task.Run(() => { while (true) @@ -373,27 +386,28 @@ namespace Rs.MotionPlat.Recipe DialogResult dr = Msg.ShowQuestion("Are you sure to dump product?", MessageBoxButtons.OKCancel); if (dr == DialogResult.OK) { - Nozzle takeNozzle = NozzleManager.GetNozzle(nozzleIndex); - if (Enum.TryParse(m_trayName, out ETrayType takeTray)) - { - double pos = NozzleManager.GetNozzleToTrayTakeProductPos(takeTray, nozzleIndex); - errCode = AxisControl.GetAxis($"NozzleZ{nozzleIndex}").MovePos(pos, GlobalVar.WholeSpeed); - if (errCode > ErrorCode.Ok) return; - while (!Ops.IsStop($"NozzleZ{nozzleIndex}")) - { - Thread.Sleep(10); - } - takeNozzle.VacSuction(EIoOperate.Close,nameof(StockTrayLocationRecipe)); - takeNozzle.VacBreak(EIoOperate.Open,nameof(StockTrayLocationRecipe)); - takeNozzle.VacBreak(EIoOperate.Close, nameof(StockTrayLocationRecipe)); - if (NozzleManager.GotoSafePos(nozzleIndex)) - { - while (!Ops.IsStop($"NozzleZ{nozzleIndex}")) - { - Thread.Sleep(10); - } - } - } + StockPlaceFlow.Instance.Place(trayType, slotIndex, nozzleIndex, false,true); + //Nozzle takeNozzle = NozzleManager.GetNozzle(nozzleIndex); + //if (Enum.TryParse(m_trayName, out ETrayType takeTray)) + //{ + // double pos = NozzleManager.GetNozzleToTrayTakeProductPos(takeTray, nozzleIndex); + // errCode = AxisControl.GetAxis($"NozzleZ{nozzleIndex}").MovePos(pos, GlobalVar.WholeSpeed); + // if (errCode > ErrorCode.Ok) return; + // while (!Ops.IsStop($"NozzleZ{nozzleIndex}")) + // { + // Thread.Sleep(10); + // } + // takeNozzle.VacSuction(EIoOperate.Close,nameof(StockTrayLocationRecipe)); + // takeNozzle.VacBreak(EIoOperate.Open,nameof(StockTrayLocationRecipe)); + // takeNozzle.VacBreak(EIoOperate.Close, nameof(StockTrayLocationRecipe)); + // if (NozzleManager.GotoSafePos(nozzleIndex)) + // { + // while (!Ops.IsStop($"NozzleZ{nozzleIndex}")) + // { + // Thread.Sleep(10); + // } + // } + //} } });