优化三点定位

master
lhiven 1 year ago
parent 107240f783
commit 4fab8f5302

@ -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)

@ -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<Rs.Controls.TraySlot, System.Windows.Forms.MouseEventArgs>(this.rsTray1_SlotClickEvent);

@ -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++;

Loading…
Cancel
Save