From 6c94ae6f152d0c084f08110bb1e4f8ae7e909498 Mon Sep 17 00:00:00 2001 From: lhiven Date: Sat, 3 Aug 2024 16:28:41 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BC=98=E5=8C=96=E4=B8=89=E7=82=B9=E5=AE=9A?= =?UTF-8?q?=E4=BD=8D?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Flow/NormalFlow/ThreePointLocationFlow.cs | 116 +++++++++++++++--- Rs.DeweyTester/TestFrm.Designer.cs | 13 ++ Rs.DeweyTester/TestFrm.cs | 5 + 3 files changed, 119 insertions(+), 15 deletions(-) diff --git a/Rs.DeweyTester/Flow/NormalFlow/ThreePointLocationFlow.cs b/Rs.DeweyTester/Flow/NormalFlow/ThreePointLocationFlow.cs index cae6f50..7a1a101 100644 --- a/Rs.DeweyTester/Flow/NormalFlow/ThreePointLocationFlow.cs +++ b/Rs.DeweyTester/Flow/NormalFlow/ThreePointLocationFlow.cs @@ -53,10 +53,11 @@ namespace Rs.MotionPlat.Flow.NormalFlow public void Location(ETrayType trayType,bool needStop=true) { step = EThreePointLocationFlowStep.到拍照位; - List points = new List() { 1, 16, 241 }; + List points = new List() { 1, 16,241 }; SlotPoint sp; if(finished) { + vResult.Clear(); finished = false; } else @@ -257,23 +258,108 @@ namespace Rs.MotionPlat.Flow.NormalFlow double sx1 = TrayPointManager.GetSlotPoint(trayType, 1).X; double sy1 = TrayPointManager.GetSlotPoint(trayType, 1).Y ; - double sx2 = TrayPointManager.GetSlotPoint(trayType, 16).X ; - double sy2 = TrayPointManager.GetSlotPoint(trayType, 16).Y ; + double sx9 = TrayPointManager.GetSlotPoint(trayType, 9).X; + double sy9 = TrayPointManager.GetSlotPoint(trayType, 9).Y; - double sx3 = TrayPointManager.GetSlotPoint(trayType, 241).X ; - double sy3 = TrayPointManager.GetSlotPoint(trayType, 241).Y ; + double sx16 = TrayPointManager.GetSlotPoint(trayType, 16).X ; + double sy16 = TrayPointManager.GetSlotPoint(trayType, 16).Y ; - double x1 = TrayPointManager.GetSlotPoint(trayType, 1).X + 0.1;// vResult[0].OffsetX; - double y1 = TrayPointManager.GetSlotPoint(trayType, 1).Y + 0.07;// vResult[0].OffsetY; + double sx129 = TrayPointManager.GetSlotPoint(trayType, 129).X; + double sy129 = TrayPointManager.GetSlotPoint(trayType, 129).Y; - double x2 = TrayPointManager.GetSlotPoint(trayType, 16).X + 0.1;// vResult[1].OffsetX; - double y2 = TrayPointManager.GetSlotPoint(trayType, 16).Y + 0.07;// vResult[1].OffsetY; + double sx137 = TrayPointManager.GetSlotPoint(trayType, 137).X; + double sy137 = TrayPointManager.GetSlotPoint(trayType, 137).Y; - double x3 = TrayPointManager.GetSlotPoint(trayType, 241).X + 0.1;// vResult[2].OffsetX; - double y3 = TrayPointManager.GetSlotPoint(trayType, 241).Y + 0.07;// vResult[2].OffsetY; + double sx144 = TrayPointManager.GetSlotPoint(trayType, 144).X; + double sy144 = TrayPointManager.GetSlotPoint(trayType, 144).Y; - HOperatorSet.VectorToHomMat2d(new HTuple(sx1).TupleConcat(sx2).TupleConcat(sx3), new HTuple(sy1).TupleConcat(sy2).TupleConcat(sy3), new HTuple(x1).TupleConcat(x2).TupleConcat(x3), new HTuple(y1).TupleConcat(y2).TupleConcat(y3), out HTuple homMat2D); + double sx241 = TrayPointManager.GetSlotPoint(trayType, 241).X ; + double sy241 = TrayPointManager.GetSlotPoint(trayType, 241).Y ; + + double sx249 = TrayPointManager.GetSlotPoint(trayType, 249).X; + double sy249 = TrayPointManager.GetSlotPoint(trayType, 249).Y; + + double sx256 = TrayPointManager.GetSlotPoint(trayType, 256).X; + double sy256 = TrayPointManager.GetSlotPoint(trayType, 256).Y; + + + double x1 = TrayPointManager.GetSlotPoint(trayType, 1).X + vResult[0].OffsetX; + double y1 = TrayPointManager.GetSlotPoint(trayType, 1).Y + vResult[0].OffsetY; + + double x9 = TrayPointManager.GetSlotPoint(trayType, 9).X + vResult[1].OffsetX; + double y9 = TrayPointManager.GetSlotPoint(trayType, 9).Y + vResult[1].OffsetY; + + double x16 = TrayPointManager.GetSlotPoint(trayType, 16).X + vResult[2].OffsetX; + double y16 = TrayPointManager.GetSlotPoint(trayType, 16).Y + vResult[2].OffsetY; + + + + double x129 = TrayPointManager.GetSlotPoint(trayType, 129).X + vResult[3].OffsetX; + double y129 = TrayPointManager.GetSlotPoint(trayType, 129).Y + vResult[3].OffsetY; + + double x137 = TrayPointManager.GetSlotPoint(trayType, 137).X + vResult[4].OffsetX; + double y137 = TrayPointManager.GetSlotPoint(trayType, 137).Y + vResult[4].OffsetY; + + double x144 = TrayPointManager.GetSlotPoint(trayType, 144).X + vResult[5].OffsetX; + double y144 = TrayPointManager.GetSlotPoint(trayType, 144).Y + vResult[5].OffsetY; + + + double x241 = TrayPointManager.GetSlotPoint(trayType, 241).X + vResult[6].OffsetX; + double y241 = TrayPointManager.GetSlotPoint(trayType, 241).Y + vResult[6].OffsetY; + + double x249 = TrayPointManager.GetSlotPoint(trayType, 249).X+vResult[7].OffsetX; + double y249 = TrayPointManager.GetSlotPoint(trayType, 249).Y + vResult[7].OffsetY; + + double x256 = TrayPointManager.GetSlotPoint(trayType, 256).X+vResult[8].OffsetX; + double y256 = TrayPointManager.GetSlotPoint(trayType, 256).Y + vResult[8].OffsetY; + HTuple px = new HTuple(); + px.Append(sx1); + //px.Append(sx9); + px.Append(sx16); + //px.Append(sx129); + //px.Append(sx137); + //px.Append(sx144); + px.Append(sx241); + //px.Append(sx249); + //px.Append(sx256); + + HTuple py = new HTuple(); + py.Append(sy1); + //py.Append(sy9); + py.Append(sy16); + //py.Append(sy129); + //py.Append(sy137); + //py.Append(sy144); + py.Append(sy241); + //py.Append(sy249); + //py.Append(sy256); + + HTuple qx = new HTuple(); + qx.Append(x1); + //qx.Append(x9); + qx.Append(x16); + //qx.Append(x129); + //qx.Append(x137); + //qx.Append(x144); + qx.Append(x241); + //qx.Append(x249); + //qx.Append(x256); + + HTuple qy = new HTuple(); + qy.Append(y1); + //qy.Append(y9); + qy.Append(y16); + //qy.Append(y129); + //qy.Append(y137); + //qy.Append(y144); + qy.Append(y241); + //qy.Append(y249); + //qy.Append(y256); + + HOperatorSet.VectorToHomMat2d(px, py, qx, qy, out HTuple homMat2D); + + //HOperatorSet.VectorToHomMat2d(new HTuple(sx1).TupleConcat(sx2).TupleConcat(sx3), new HTuple(sy1).TupleConcat(sy2).TupleConcat(sy3), new HTuple(x1).TupleConcat(x2).TupleConcat(x3), new HTuple(y1).TupleConcat(y2).TupleConcat(y3), out HTuple homMat2D); //HOperatorSet.AffineTransPoint2d(homMat2D,) List points = TrayPointManager.GetAllSlotPoint(trayType); HTuple xx = new HTuple(); @@ -288,14 +374,14 @@ namespace Rs.MotionPlat.Flow.NormalFlow xx.Append(point.X); yy.Append(point.Y); } - HOperatorSet.AffineTransPoint2d(homMat2D, xx, yy, out HTuple qx, out HTuple qy); + HOperatorSet.AffineTransPoint2d(homMat2D, xx, yy, out HTuple qxx, out HTuple qyy); int l = xx.Length; for(int j=0;j