From 841997dc177be64d0ce1844e45381c7407053307 Mon Sep 17 00:00:00 2001 From: lhiven Date: Sun, 30 Jun 2024 11:29:35 +0800 Subject: [PATCH] =?UTF-8?q?1=E3=80=81=E4=B8=8B=E7=9B=B8=E6=9C=BA=E6=8B=8D?= =?UTF-8?q?=E7=85=A7Y=E6=96=B9=E5=90=91=E7=BB=9F=E4=B8=80=E4=B8=BA?= =?UTF-8?q?=E5=90=B8=E5=98=B41=E7=9A=84Y=E6=8B=8D=E7=85=A7=E4=BD=8D=202?= =?UTF-8?q?=E3=80=81=E4=B8=8B=E7=9B=B8=E6=9C=BA=E5=AE=9A=E4=BD=8D=E6=8B=8D?= =?UTF-8?q?=E7=85=A7=E6=B6=88=E9=99=A4=E6=8E=89=E7=A1=AC=E4=BB=B6=E5=B7=AE?= =?UTF-8?q?=E5=BC=82?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Rs.SkyLine/Commom/NozzleCollection.cs | 6 ++++++ Rs.SkyLine/Commom/VisionProcess.cs | 9 ++++++++- Rs.SkyLine/Flow/NormalFlow/DischargeFlow.cs | 10 +++++++++- 3 files changed, 23 insertions(+), 2 deletions(-) diff --git a/Rs.SkyLine/Commom/NozzleCollection.cs b/Rs.SkyLine/Commom/NozzleCollection.cs index 4421acd..91b346e 100644 --- a/Rs.SkyLine/Commom/NozzleCollection.cs +++ b/Rs.SkyLine/Commom/NozzleCollection.cs @@ -1,4 +1,5 @@ using NPOI.SS.Formula.Eval; +using Rs.Controls; using Rs.DataAccess; using Rs.Framework; using Rs.MotionPlat.Flow; @@ -314,5 +315,10 @@ namespace Rs.MotionPlat.Commom { return nozzles; } + + public static double GetNozzleGrabOffsetY(int nozzleIndex) + { + return SysConfigParam.GetValue($"Nozzle{nozzleIndex}CenterY") - SysConfigParam.GetValue("Nozzle1CenterY"); + } } } diff --git a/Rs.SkyLine/Commom/VisionProcess.cs b/Rs.SkyLine/Commom/VisionProcess.cs index 54a7cdd..8e8fa7a 100644 --- a/Rs.SkyLine/Commom/VisionProcess.cs +++ b/Rs.SkyLine/Commom/VisionProcess.cs @@ -76,9 +76,16 @@ namespace Rs.MotionPlat.Commom get { if (LocationOk) - return -1 * (Row - ModelRow) * GlobalVar.DownCameraMmPerPixel; + { + double sourceOffsetY = (-1 * (Row - ModelRow) * GlobalVar.DownCameraMmPerPixel); + double offsetY = NozzleManager.GetNozzleGrabOffsetY(NozzleIndex); + //MessageQueue.Instance.Insert( $"吸嘴{NozzleIndex},补偿前:{sourceOffsetY},增加偏移量{offsetY},补偿后:{sourceOffsetY - offsetY}"); + return sourceOffsetY - offsetY; + } else + { return 0; + } } } diff --git a/Rs.SkyLine/Flow/NormalFlow/DischargeFlow.cs b/Rs.SkyLine/Flow/NormalFlow/DischargeFlow.cs index 711db5f..bc19bdf 100644 --- a/Rs.SkyLine/Flow/NormalFlow/DischargeFlow.cs +++ b/Rs.SkyLine/Flow/NormalFlow/DischargeFlow.cs @@ -813,7 +813,7 @@ namespace Rs.MotionPlat.Flow needGrabNum = NozzleManager.GetNozzlesByStatus(ENozzleStatus.ToUnload).Count(); //targetX = SysConfigParam.GetValue($"Nozzle{needGrabNum}CenterX") - 30; targetX = SysConfigParam.GetValue($"Nozzle8CenterX") - 30; - targetY = SysConfigParam.GetValue($"Nozzle8CenterY"); + targetY = SysConfigParam.GetValue($"Nozzle1CenterY"); errCode = AxisControl.LoadX.MovePos(targetX, GlobalVar.WholeSpeed); if (errCode == ErrorCode.Ok || GlobalVar.VirtualAxis) { @@ -1037,6 +1037,14 @@ namespace Rs.MotionPlat.Flow // NozzleManager.GetNozzle(ni).SN = item.SN; // ni++; //} + //foreach (MatchResult matchResult in mrs) + //{ + // if(matchResult.IsOK) + // { + + // matchResult.OffsetRow = matchResult.OffsetRow + offsetY; + // } + //} reGrabCount = 0; OnMatchResult?.Invoke(mrs); flowStep = EDischargeFlowStep.到放料位上方;