using System.Collections.Generic; namespace Aitex.Core.RT.IOCore; /// /// 互锁动作接口。 /// public interface IInterlockAction { #region Properties /// /// 返回当前动作的名称。 /// /// 通常返回当前动作对应的DO名称。 /// /// string ActionName { get; } /// /// 返回当前动作的限制条件。 /// IEnumerable Limits { get; } /// /// 返回当前动作限制条件中的“逻辑与”组。 /// /// “逻辑与”组由多个Limit对象构成,若其中任意一个Limit命中,则当前组命中。 /// /// IEnumerable> LogicOrGroups { get; } #endregion #region Methods /// /// 判断当前动作是否和给定的条件一致,若一致,则表明当前动作与特定条件的动作为同一动作。 /// /// /// 对比时忽略OO名称大小写。 /// > /// DO名称 /// DO目标输出 /// bool IsSame(string doName, bool value); /// /// 增加一个限制条件。 /// /// void AddLimit(IInterlockLimit limit); /// /// 增加一个“逻辑与”组。 /// /// void AddLogicOrGroup(List group); /// /// 判断当前动作是否允许执行。 /// /// 当前动作的所有Limit均命中时,允许执行。 /// /// /// /// bool CanDo(out string reason); /// /// 扫描线程周期性执行的任务。 /// void Monitor(); #endregion }