Commit a619de01 LN

同元器件同时投影时上一步显示错误问题修改

1 个父辈 36721a18
...@@ -27,13 +27,14 @@ namespace TSA_V.DeviceLibrary ...@@ -27,13 +27,14 @@ namespace TSA_V.DeviceLibrary
{ {
LogUtil.info("开始程序【" + boardInfo.boardName + "】的插件 , 继续之前的工作,索引号=" + currIndex); LogUtil.info("开始程序【" + boardInfo.boardName + "】的插件 , 继续之前的工作,索引号=" + currIndex);
currIndex = Convert.ToInt32(Setting_NInit.Work_TagNumber); currIndex = Convert.ToInt32(Setting_NInit.Work_TagNumber);
for(int i = 0; i < needWorkSmtList.Count; i++) //for(int i = 0; i < needWorkSmtList.Count; i++)
{ //{
if (!workedPnList.Contains(needWorkSmtList[i].PN)) // if (!workedPnList.Contains(needWorkSmtList[i].PN))
{ // {
workedPnList.Add(needWorkSmtList[i].PN); // workedPnList.Add(needWorkSmtList[i].PN);
} // }
} //}
ResetWorkPnList(currIndex, true);
isContinue = false; isContinue = false;
} }
else else
...@@ -55,6 +56,23 @@ namespace TSA_V.DeviceLibrary ...@@ -55,6 +56,23 @@ namespace TSA_V.DeviceLibrary
} }
private void ResetWorkPnList(int workIndex, bool isNext)
{
workedPnList = new List<string>();
needWorkSmtList = currBoard.GetSmtList();
for (int i = 0; i < needWorkSmtList.Count; i++)
{
if (i < workIndex)
{
if (!workedPnList.Contains(needWorkSmtList[i].PN))
{
workedPnList.Add(needWorkSmtList[i].PN);
}
}
}
}
public override bool MoveToNextPoint(bool isNext, bool isReset) public override bool MoveToNextPoint(bool isNext, bool isReset)
{ {
waitList = new List<WaitResultInfo>(); waitList = new List<WaitResultInfo>();
...@@ -117,9 +135,10 @@ namespace TSA_V.DeviceLibrary ...@@ -117,9 +135,10 @@ namespace TSA_V.DeviceLibrary
else else
{ {
currPoint = GetSmtList()[currIndex]; currPoint = GetSmtList()[currIndex];
ResetWorkPnList(currIndex,isNext);
if (workedPnList.Contains(currPoint.PN)) if (workedPnList.Contains(currPoint.PN))
{ {
LogUtil.info(" 程序【" + currBoard.boardName + "】插件【" + currPoint.TagNo + "】,PN=【"+currPoint.PN+"】已投影过,跳过"); LogUtil.info(" 程序【" + currBoard.boardName + "】isNext="+isNext+",索引【" + currIndex+"】插件【" + currPoint.TagNo + "】PN=【"+currPoint.PN+"】已投影过,跳过");
MoveToNextPoint(isNext, isReset); MoveToNextPoint(isNext, isReset);
} }
//LogUtil.info(" 程序【" + currBoard.boardName + "】插件【" + currPoint.pointName + "】"); //LogUtil.info(" 程序【" + currBoard.boardName + "】插件【" + currPoint.pointName + "】");
...@@ -157,12 +176,15 @@ namespace TSA_V.DeviceLibrary ...@@ -157,12 +176,15 @@ namespace TSA_V.DeviceLibrary
else else
{ {
this.currPosition = position; this.currPosition = position;
workedPnList.Add(currPoint.PN); if (!workedPnList.Contains(currPoint.PN))
{
workedPnList.Add(currPoint.PN);
}
XYMove(); XYMove();
//插件机工作 //插件机工作
if (WorkType.Equals(1)) if (WorkType.Equals(1))
{ {
LogUtil.info(" 程序【" + currBoard.boardName + "】PN=【" + currPoint.PN + "】 库位【" + position.PositionName + "】X轴【" + currPoint.NodePositionX + "】,Y轴【" + currPoint.NodePositionY + "】"); LogUtil.info(" 程序【" + currBoard.boardName + "】isNext=" + isNext + ",索引【" + currIndex+ "】 插件【" + currPoint.TagNo + "】PN=【" + currPoint.PN + "】 库位【" + position.PositionName + "】X轴【" + currPoint.NodePositionX + "】,Y轴【" + currPoint.NodePositionY + "】");
MoveToBag(position); MoveToBag(position);
...@@ -216,7 +238,7 @@ namespace TSA_V.DeviceLibrary ...@@ -216,7 +238,7 @@ namespace TSA_V.DeviceLibrary
msg += smt.TagNo + "_" + smt.PN + "_" + smt.NodePositionX + "_" + smt.NodePositionY + " "; msg += smt.TagNo + "_" + smt.PN + "_" + smt.NodePositionX + "_" + smt.NodePositionY + " ";
} }
} }
LogUtil.info(" 程序【" + currBoard.boardName + "】插件【" + msg + "】显示投影光标"); LogUtil.info(" 程序【" + currBoard.boardName + "】索引【" + currIndex + "】插件【" + currPoint.TagNo + "】PN=【" + currPoint.PN + "】插件【" + msg + "】显示投影光标");
TSAVBean.ShowPoint(currBoard, needShowXyPoint.ToArray()); TSAVBean.ShowPoint(currBoard, needShowXyPoint.ToArray());
waitList.Add(WaitResultInfo.WaitTime(1000)); waitList.Add(WaitResultInfo.WaitTime(1000));
////xy轴运动到固定点 ////xy轴运动到固定点
......
...@@ -163,7 +163,7 @@ namespace TSA_V.DeviceLibrary ...@@ -163,7 +163,7 @@ namespace TSA_V.DeviceLibrary
} }
public bool MoveToNextPoint(bool isNext) public bool MoveToNextPoint(bool isNext)
{ {
return MoveToNextPoint(isNext, false); return MoveToNextPoint(isNext, true );
} }
public virtual bool MoveToNextPoint(bool isNext, bool isReset) public virtual bool MoveToNextPoint(bool isNext, bool isReset)
{ {
......
...@@ -889,12 +889,16 @@ namespace TSA_V ...@@ -889,12 +889,16 @@ namespace TSA_V
} }
} }
private int PreOrNextIndex(bool isNext, bool reset = false) private int PreOrNextIndex(bool isNext, bool reset = false)
{ {
pnList = new List<string>(); pnList = new List<string>();
if (isNext) if (isNext)
{ {
for(int i = 0; i <= preIndex; i++) for (int i = 0; i <= preIndex; i++)
{ {
if (i < 0 || i >= workSmtList.Count)
{
continue;
}
if (!pnList.Contains(workSmtList[i].PN)) if (!pnList.Contains(workSmtList[i].PN))
{ {
pnList.Add(workSmtList[i].PN); pnList.Add(workSmtList[i].PN);
...@@ -905,6 +909,10 @@ namespace TSA_V ...@@ -905,6 +909,10 @@ namespace TSA_V
{ {
for (int i = preIndex; i < workSmtList.Count; i++) for (int i = preIndex; i < workSmtList.Count; i++)
{ {
if (i < 0 || i >= workSmtList.Count)
{
continue;
}
if (!pnList.Contains(workSmtList[i].PN)) if (!pnList.Contains(workSmtList[i].PN))
{ {
pnList.Add(workSmtList[i].PN); pnList.Add(workSmtList[i].PN);
......
支持 Markdown 格式
你添加了 0 到此讨论。请谨慎行事。
Finish editing this message first!