|
|
@ -1,4 +1,5 @@
|
|
|
|
using Newtonsoft.Json;
|
|
|
|
using HalconDotNet;
|
|
|
|
|
|
|
|
using Newtonsoft.Json;
|
|
|
|
using Rs.DataAccess;
|
|
|
|
using Rs.DataAccess;
|
|
|
|
using Rs.Framework;
|
|
|
|
using Rs.Framework;
|
|
|
|
using Rs.Motion;
|
|
|
|
using Rs.Motion;
|
|
|
@ -249,5 +250,78 @@ namespace Rs.MotionPlat.Flow.NormalFlow
|
|
|
|
//}
|
|
|
|
//}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
public void CalcTrayRunPoint2(ETrayType trayType)
|
|
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
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 sx3 = TrayPointManager.GetSlotPoint(trayType, 241).X ;
|
|
|
|
|
|
|
|
double sy3 = TrayPointManager.GetSlotPoint(trayType, 241).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 x2 = TrayPointManager.GetSlotPoint(trayType, 16).X + 0.1;// vResult[1].OffsetX;
|
|
|
|
|
|
|
|
double y2 = TrayPointManager.GetSlotPoint(trayType, 16).Y + 0.07;// vResult[1].OffsetY;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
double x3 = TrayPointManager.GetSlotPoint(trayType, 241).X + 0.1;// vResult[2].OffsetX;
|
|
|
|
|
|
|
|
double y3 = TrayPointManager.GetSlotPoint(trayType, 241).Y + 0.07;// vResult[2].OffsetY;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
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<SlotPoint> points = TrayPointManager.GetAllSlotPoint(trayType);
|
|
|
|
|
|
|
|
HTuple xx = new HTuple();
|
|
|
|
|
|
|
|
HTuple yy = new HTuple();
|
|
|
|
|
|
|
|
//for(int i=0;i<points.Count; i++)
|
|
|
|
|
|
|
|
//{
|
|
|
|
|
|
|
|
// string key = $"{GlobalVar.CurRecipe}-{trayType}-{i+1}";
|
|
|
|
|
|
|
|
// if(points.con)
|
|
|
|
|
|
|
|
//}
|
|
|
|
|
|
|
|
foreach (SlotPoint point in points)
|
|
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
xx.Append(point.X);
|
|
|
|
|
|
|
|
yy.Append(point.Y);
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
HOperatorSet.AffineTransPoint2d(homMat2D, xx, yy, out HTuple qx, out HTuple qy);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
int l = xx.Length;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
for(int j=0;j<xx.Length;j++)
|
|
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
double x = qx[j];
|
|
|
|
|
|
|
|
double y = qy[j];
|
|
|
|
|
|
|
|
string key = $"{GlobalVar.CurRecipe}-{trayType}-{j+1}";
|
|
|
|
|
|
|
|
TrayRunPointManager.AddPoint(key, x, y);
|
|
|
|
|
|
|
|
TrayRunPointManager.AddToDataTable(key, x, y);
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
//double bigSpaceX = (x3 - x1) / 15;
|
|
|
|
|
|
|
|
//double smallSpaceY = (y3 - y1) / 15;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
//double bigSpaceY = (y2 - y1) / 15;
|
|
|
|
|
|
|
|
//double smallSpaceX = (x2 - x1) / 15;
|
|
|
|
|
|
|
|
//int index = 1;
|
|
|
|
|
|
|
|
//for (int row = 1; row <= 16; row++)
|
|
|
|
|
|
|
|
//{
|
|
|
|
|
|
|
|
// for (int col = 1; col <= 16; col++)
|
|
|
|
|
|
|
|
// {
|
|
|
|
|
|
|
|
// double x = x1 + (row - 1) * bigSpaceX + (col - 1) * smallSpaceX;
|
|
|
|
|
|
|
|
// double y = y1 + (col - 1) * bigSpaceY + (row - 1) * smallSpaceY;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// //string insertSql = $"insert into trayrunpoints(recipename,trayname,slotindex,x,y) values('{GlobalVar.CurRecipe}','{trayType}',{index},{x},{y})";
|
|
|
|
|
|
|
|
// //sqlList.Add(insertSql);
|
|
|
|
|
|
|
|
// //rowAffectNum = db.ExecuteNonQuery(insertSql);
|
|
|
|
|
|
|
|
// string key = $"{GlobalVar.CurRecipe}-{trayType}-{index}";
|
|
|
|
|
|
|
|
// TrayRunPointManager.AddPoint(key, x, y);
|
|
|
|
|
|
|
|
// TrayRunPointManager.AddToDataTable(key, x, y);
|
|
|
|
|
|
|
|
// index++;
|
|
|
|
|
|
|
|
// }
|
|
|
|
|
|
|
|
//}
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|