[RT.EquipmentLibrary]

PMModuleBase中新增DoIfInterlockEnabled()方法,用于执行某动作前先检查Interlock是否bypass。
This commit is contained in:
SL 2023-07-03 11:34:51 +08:00
parent afd36f60b2
commit 4442a7856a
1 changed files with 23 additions and 0 deletions

View File

@ -1,10 +1,13 @@
using Aitex.Core.RT.Device;
using Aitex.Core.RT.Event;
using Aitex.Core.RT.SCCore;
using Aitex.Sorter.Common;
using MECF.Framework.Common.Equipment;
using MECF.Framework.Common.Fsm;
using MECF.Framework.Common.Schedulers;
using MECF.Framework.Common.SubstrateTrackings;
using MECF.Framework.RT.EquipmentLibrary.LogicUnits;
using System;
using System.Collections.Generic;
namespace MECF.Framework.RT.EquipmentLibrary.HardwareUnits.PMs
@ -53,6 +56,26 @@ namespace MECF.Framework.RT.EquipmentLibrary.HardwareUnits.PMs
return base.Initialize();
}
/// <summary>
/// 检查是否Bypass了Interlock。
/// </summary>
/// <returns></returns>
protected void DoIfInterlockEnabled(Action action)
{
// 读取系统配置
var byPassInterlock = SC.GetValue<bool>("System.BypassInterlock");
var byPassEnableTable = SC.GetValue<bool>("System.BypassEnableTable");
if (byPassInterlock)
EV.PostWarningLog(Module, "System.BypassInterlock is True");
else if (byPassEnableTable)
EV.PostWarningLog(Module, "System.BypassEnableTable is True");
else
{
action.Invoke();
}
}
#endregion