|
|
|
@ -14,6 +14,18 @@ namespace Rs.MotionPlat.Commom
|
|
|
|
|
{
|
|
|
|
|
private int m_row = 26;
|
|
|
|
|
private int m_column = 10;
|
|
|
|
|
|
|
|
|
|
public int RowNum
|
|
|
|
|
{
|
|
|
|
|
get { return m_row; }
|
|
|
|
|
set { m_row = value; }
|
|
|
|
|
}
|
|
|
|
|
public int ColumnNum
|
|
|
|
|
{
|
|
|
|
|
get { return m_column; }
|
|
|
|
|
set { m_column = value; }
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
private TrayPosition()
|
|
|
|
|
{
|
|
|
|
|
//for (int i = 0; i < m_row; i++)
|
|
|
|
@ -29,8 +41,10 @@ namespace Rs.MotionPlat.Commom
|
|
|
|
|
//}
|
|
|
|
|
}
|
|
|
|
|
public TrayPosition(int row,int column,string trayName) {
|
|
|
|
|
m_row= row;
|
|
|
|
|
m_column= column;
|
|
|
|
|
//m_row= row;
|
|
|
|
|
//m_column= column;
|
|
|
|
|
RowNum = row;
|
|
|
|
|
ColumnNum= column;
|
|
|
|
|
TrayName= trayName;
|
|
|
|
|
}
|
|
|
|
|
public string TrayName { get; set; } = "料盘1";
|
|
|
|
@ -45,8 +59,8 @@ namespace Rs.MotionPlat.Commom
|
|
|
|
|
{
|
|
|
|
|
try
|
|
|
|
|
{
|
|
|
|
|
float offsetX = Math.Abs(LeftTop.X - RightBottom.X)/(m_column-1);
|
|
|
|
|
float offsetY = Math.Abs(LeftTop.Y - LeftBottom.Y)/(m_row-1);
|
|
|
|
|
float offsetX = Math.Abs(LeftTop.X - RightBottom.X)/(ColumnNum-1);
|
|
|
|
|
float offsetY = Math.Abs(LeftTop.Y - LeftBottom.Y)/(RowNum-1);
|
|
|
|
|
int index = 0;
|
|
|
|
|
SlotPoints.Clear();
|
|
|
|
|
for (int i = 0; i < m_column; i++)
|
|
|
|
@ -71,11 +85,11 @@ namespace Rs.MotionPlat.Commom
|
|
|
|
|
return true;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public static TrayPosition Load(string trayName)
|
|
|
|
|
public static TrayPosition Load(string trayName,int row=26,int column=10)
|
|
|
|
|
{
|
|
|
|
|
XmlSerializerHelper.Instance.Deserialize($"Recipe/{trayName}.xml",out TrayPosition entity);
|
|
|
|
|
if (entity == null)
|
|
|
|
|
return new TrayPosition(26,10, trayName);
|
|
|
|
|
return new TrayPosition(row,column, trayName);
|
|
|
|
|
return entity;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|