diff --git a/MECF.Framework.Common/Aitex/Core/RT/IOCore/Interlock/Actions/InterlockAction.cs b/MECF.Framework.Common/Aitex/Core/RT/IOCore/Interlock/Actions/InterlockAction.cs index 318b794..b2fa7b9 100644 --- a/MECF.Framework.Common/Aitex/Core/RT/IOCore/Interlock/Actions/InterlockAction.cs +++ b/MECF.Framework.Common/Aitex/Core/RT/IOCore/Interlock/Actions/InterlockAction.cs @@ -34,11 +34,13 @@ namespace Aitex.Core.RT.IOCore.Interlock.Actions return true; } - #endregion + public override void Monitor() + { + throw new System.NotSupportedException(); + } - public override void Monitor() - { - throw new System.NotSupportedException(); - } - } + #endregion + + + } } diff --git a/MECF.Framework.Common/Aitex/Core/RT/IOCore/Interlock/InterlockManagerBase.cs b/MECF.Framework.Common/Aitex/Core/RT/IOCore/Interlock/InterlockManagerBase.cs index 1052430..39b61a7 100644 --- a/MECF.Framework.Common/Aitex/Core/RT/IOCore/Interlock/InterlockManagerBase.cs +++ b/MECF.Framework.Common/Aitex/Core/RT/IOCore/Interlock/InterlockManagerBase.cs @@ -163,6 +163,14 @@ public abstract class InterlockManagerBase if (actionNode.HasAttribute("tip.en-US")) dicTips["en-US"] = actionNode.GetAttribute("tip.en-US"); + var ignoreReverse = false; + if (actionNode.HasAttribute("ignoreReverse")) + { + var strIgnoreReverse = actionNode.GetAttribute("ignoreReverse"); + if (!bool.TryParse(strIgnoreReverse, out ignoreReverse)) + LOG.Error($"Unable to convert attribute 'ignoreReverse' of action '{doName}' to bool."); + } + var moduleName = GetModuleFromIo(targetDo.Name); if (!_dicActionsPerModule.ContainsKey(moduleName)) _dicActionsPerModule[moduleName] = new List(); @@ -178,6 +186,7 @@ public abstract class InterlockManagerBase Debug.Assert(false, err); } + // 遍历Action下的Limit节点,并创建InterlockLimit对象。 foreach (XmlNode limitNode in actionNode.ChildNodes) { @@ -203,14 +212,17 @@ public abstract class InterlockManagerBase _dicActionsPerModule[moduleName].Add(action); _lstActions.Add(action); - - foreach (var limit in action.Limits) + // 如果当前Action设置了忽略翻转,则不要注册Limit到当前Action的映射,避免Limit触发导致Action翻转。 + if (!ignoreReverse) { - // 创建以Limit分组的Action字典 - if (!_dicLimitToActionMap.ContainsKey(limit)) - _dicLimitToActionMap[limit] = new List(); + foreach (var limit in action.Limits) + { + // 创建以Limit分组的Action字典 + if (!_dicLimitToActionMap.ContainsKey(limit)) + _dicLimitToActionMap[limit] = new List(); - _dicLimitToActionMap[limit].Add(action); + _dicLimitToActionMap[limit].Add(action); + } } }