增加测试治具放料前真空吸检测

master
lhiven 1 year ago
parent 6082c6b174
commit ad8fee2868

@ -173,5 +173,13 @@ namespace Rs.MotionPlat.Entitys.Trays
SuckerNo = nozzle.NozzleIndex; SuckerNo = nozzle.NozzleIndex;
} }
/// <summary>
/// 通过真空判断穴位中是否有产品
/// </summary>
/// <returns></returns>
public bool HasProduct()
{
return Ops.IsOn($"测试{Index}号穴位真空吸检测");
}
} }
} }

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

@ -191,6 +191,7 @@
<Compile Include="Flow\MachineManage.cs" /> <Compile Include="Flow\MachineManage.cs" />
<Compile Include="Flow\MonitorSystemButton.cs" /> <Compile Include="Flow\MonitorSystemButton.cs" />
<Compile Include="Flow\SubFlow\FiberWarningPressFlow.cs" /> <Compile Include="Flow\SubFlow\FiberWarningPressFlow.cs" />
<Compile Include="Flow\SubFlow\TestFixtureVacSuctionCheckFlow.cs" />
<Compile Include="Flow\SubFlow\UpCameraScanBarCodeFlow.cs" /> <Compile Include="Flow\SubFlow\UpCameraScanBarCodeFlow.cs" />
<Compile Include="Flow\SubFlow\WarningSuckerNgFlow.cs" /> <Compile Include="Flow\SubFlow\WarningSuckerNgFlow.cs" />
<Compile Include="Flow\RearrangeFlow.cs" /> <Compile Include="Flow\RearrangeFlow.cs" />

Loading…
Cancel
Save