|
|
@ -0,0 +1,66 @@
|
|
|
|
|
|
|
|
using Rs.Framework;
|
|
|
|
|
|
|
|
using Rs.MotionPlat.Commom;
|
|
|
|
|
|
|
|
using Rs.MotionPlat.Entitys.Trays;
|
|
|
|
|
|
|
|
using System;
|
|
|
|
|
|
|
|
using System.Collections.Generic;
|
|
|
|
|
|
|
|
using System.Linq;
|
|
|
|
|
|
|
|
using System.Text;
|
|
|
|
|
|
|
|
using System.Threading;
|
|
|
|
|
|
|
|
using System.Threading.Tasks;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
namespace Rs.MotionPlat.Flow.SubFlow
|
|
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
|
|
|
/// 测试治具真空吸检测流程
|
|
|
|
|
|
|
|
/// </summary>
|
|
|
|
|
|
|
|
public class TestFixtureVacSuctionCheckFlow
|
|
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
List<TestTraySlot> hasProductSlots = new List<TestTraySlot>();
|
|
|
|
|
|
|
|
private TestFixtureVacSuctionCheckFlow() { }
|
|
|
|
|
|
|
|
private static TestFixtureVacSuctionCheckFlow instance;
|
|
|
|
|
|
|
|
public static TestFixtureVacSuctionCheckFlow Instance
|
|
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
get
|
|
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
if (instance == null)
|
|
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
instance = new TestFixtureVacSuctionCheckFlow();
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
return instance;
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
private ManualResetEvent checkFinishedSingle = new ManualResetEvent(true);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
public void Check()
|
|
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
Task.Run(() => {
|
|
|
|
|
|
|
|
hasProductSlots.Clear();
|
|
|
|
|
|
|
|
checkFinishedSingle.Reset();
|
|
|
|
|
|
|
|
MessageQueue.Instance.Insert("放料之前用检测测试治具穴位中是否有产品,检测开始");
|
|
|
|
|
|
|
|
foreach (var item in TestTrayManager.Instance.GetAll())
|
|
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
//先打开真空
|
|
|
|
|
|
|
|
VacManager.TestTrayVacSuction(EVacOperator.Open, true, item.Index);
|
|
|
|
|
|
|
|
//检测是否真空有效
|
|
|
|
|
|
|
|
if(item.HasProduct())
|
|
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
hasProductSlots.Add(item);
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
VacManager.TestTrayVacSuction(EVacOperator.Close, true, item.Index);
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
checkFinishedSingle.Set();
|
|
|
|
|
|
|
|
MessageQueue.Instance.Insert($"检测测试治具穴位中是否有产品结束 hasProductSlotNum={hasProductSlots.Count}");
|
|
|
|
|
|
|
|
});
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
|
|
|
/// 等待检测结果
|
|
|
|
|
|
|
|
/// </summary>
|
|
|
|
|
|
|
|
/// <returns></returns>
|
|
|
|
|
|
|
|
public List<TestTraySlot> WaitResult()
|
|
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
checkFinishedSingle.WaitOne();
|
|
|
|
|
|
|
|
return hasProductSlots;
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|