diff --git a/Rs.DeweyTester/Flow/NormalFlow/ThreePointLocationFlow.cs b/Rs.DeweyTester/Flow/NormalFlow/ThreePointLocationFlow.cs index 242af83..d9d822b 100644 --- a/Rs.DeweyTester/Flow/NormalFlow/ThreePointLocationFlow.cs +++ b/Rs.DeweyTester/Flow/NormalFlow/ThreePointLocationFlow.cs @@ -74,15 +74,19 @@ namespace Rs.MotionPlat.Flow.NormalFlow case EThreePointLocationFlowStep.到拍照位: sp = TrayPointManager.GetSlotPoint(trayType, points[0]); - targetPos.X = sp.X; - targetPos.Y1 = GlobalVar.StockSideY1; - targetPos.Y2 = sp.Y; - if(GroupAxisMove.XY1Y2MovePos(targetPos)) + if(sp!=null) { - logInfo = $"到拍照位,tloadx:{targetPos.X},tloady1:{targetPos.Y1},tloady2:{targetPos.Y2}"; - MessageQueue.Instance.Insert(logInfo); - step = EThreePointLocationFlowStep.等待到拍照位; + targetPos.X = sp.X; + targetPos.Y1 = GlobalVar.StockSideY1; + targetPos.Y2 = sp.Y; + if (GroupAxisMove.XY1Y2MovePos(targetPos)) + { + logInfo = $"到拍照位,tloadx:{targetPos.X},tloady1:{targetPos.Y1},tloady2:{targetPos.Y2}"; + MessageQueue.Instance.Insert(logInfo); + step = EThreePointLocationFlowStep.等待到拍照位; + } } + break; case EThreePointLocationFlowStep.等待到拍照位: if (Ops.IsStop("LoadX", "LoadY1", "LoadY2") || GlobalVar.VirtualAxis) diff --git a/Rs.DeweyTester/Recipe/StockTrayLocationRecipe.Designer.cs b/Rs.DeweyTester/Recipe/StockTrayLocationRecipe.Designer.cs index f1c184c..e798763 100644 --- a/Rs.DeweyTester/Recipe/StockTrayLocationRecipe.Designer.cs +++ b/Rs.DeweyTester/Recipe/StockTrayLocationRecipe.Designer.cs @@ -298,7 +298,7 @@ this.rsTray1.ShowStatus = false; this.rsTray1.ShowText = true; this.rsTray1.SinglePoint = false; - this.rsTray1.SortDir = Rs.Controls.ESortDir.LeftToRight; + this.rsTray1.SortDir = Rs.Controls.ESortDir.LeftBottomToTop; this.rsTray1.Status = null; this.rsTray1.TopSpaceHeight = 20; this.rsTray1.SlotClickEvent += new System.Action(this.rsTray1_SlotClickEvent); diff --git a/Rs.DeweyTester/Recipe/StockTrayLocationRecipe.cs b/Rs.DeweyTester/Recipe/StockTrayLocationRecipe.cs index f8e737f..c590fbe 100644 --- a/Rs.DeweyTester/Recipe/StockTrayLocationRecipe.cs +++ b/Rs.DeweyTester/Recipe/StockTrayLocationRecipe.cs @@ -115,8 +115,19 @@ namespace Rs.MotionPlat.Recipe for (int j = 0; j < colNum; j++) { int tempIndex = (colNum + 1) - (index - (i * colNum)) + (i * colNum); - double xRun = double.Parse(txtMarkX1.Text) + (j * double.Parse(txtSlotOffsetDistX.Text));// +GlobalVar.StockTrayOffsetX; - double yRun = double.Parse(txtMarkY2.Text) + (i * double.Parse(txtSlotOffsetDistY.Text));// +GlobalVar.StockTrayOffsetY; + double xRun = 0.0; + double yRun = 0.0; + if(rsTray1.SortDir== ESortDir.LeftToRight) + { + xRun = double.Parse(txtMarkX1.Text) + (j * double.Parse(txtSlotOffsetDistX.Text)); + yRun = double.Parse(txtMarkY2.Text) + (i * double.Parse(txtSlotOffsetDistY.Text)); + } + else if(rsTray1.SortDir== ESortDir.LeftBottomToTop) + { + xRun = double.Parse(txtMarkX1.Text) + (j * double.Parse(txtSlotOffsetDistX.Text)); + yRun = double.Parse(txtMarkY2.Text) + (i * double.Parse(txtSlotOffsetDistY.Text)); + } + string insertRunSql = $"insert into TrayPoints(trayid,recipename,trayname,slotindex,x,y) values('{dt.Rows[0]["id"]}','{dt.Rows[0]["recipename"]}','{dt.Rows[0]["TrayName"]}',{index},{xRun},{yRun})"; db.ExecuteNonQuery(insertRunSql); index++;