namespace MECF.Framework.RT.Core.IoProviders
{
    public class IoVariable
    {
        public IoVariable(IoType type)
        {
            IoType = type;
        }

        #region Properties

        /// <summary>
        /// 设置或返回IO类型
        /// </summary>
        public IoType IoType { get; }

        /// <summary>
        /// 设置或返回DB块名称，格式为DBxxx:DBB(DBD)xxx
        /// </summary>
        public string Name { get; set; }

        public int Length { get; set; }

        public IoBlockItem Block { get; set; }

        #endregion

        #region Methods

        public override string ToString()
        {
            return $"[{IoType}] Variable={Name}, Length={Length} bytes";
        }

        #endregion
    }
}