using System; using Aitex.Core.RT.DataCenter; namespace Aitex.Core.RT.IOCore.Interlock.DataProvider; public class BoolDataPollProvider : DataPollProviderBase, IInterlockLimitDataProvider { public BoolDataPollProvider(string dataPath) : base(dataPath) { } /// /// /// /// /// /// protected override object HandleGetValue() { var value = DATA.Poll(DataPath); if (value == null) throw new NullReferenceException("null is returned."); if (bool.TryParse(value.ToString(), out var bValue)) return bValue; throw new InvalidCastException($"the return value {value} is not bool."); } }