using System;
using Aitex.Core.Util;

namespace Aitex.Core.RT.IOCore.Interlock.DataProvider;

public abstract class IoValueProviderBase<TAccessor> : IInterlockLimitDataProvider
where TAccessor: IIOAccessor
{
    #region Variables

    private readonly R_TRIG _rTrigPollFailed = new();

    #endregion
    
    #region Constructors

    /// <summary>
    /// 实例化数据拉取器
    /// </summary>
    /// <param name="io"></param>
    /// <param name="module"></param>
    protected IoValueProviderBase(TAccessor io)
    {
        Io = io;
    }

    #endregion

    #region Properties

    /// <summary>
    /// <inheritdoc cref="DataPollProviderBase{T}.Name"/>
    /// </summary>
    public string Name => Io.Name;

    /// <summary>
    /// <inheritdoc cref="DataPollProviderBase{T}.Description"/>
    /// </summary>
    public string Description => $"{Io.Type}-{Io.IoTableIndex}({Io.Name})";

    /// <summary>
    /// 返回当前数据拉取器需要拉取的数据路径。
    /// <remarks>
    /// 注意路径中不要包含Module名称。
    /// </remarks>
    /// </summary>
    public TAccessor Io { get; }

    #endregion

    #region Methods

    /// <summary>
    /// 获取数据。
    /// </summary>
    /// <returns></returns>
    public virtual object GetValue()
    {
        throw new NotImplementedException();
    }
    
    #endregion

}