using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using static XKRS.Common.Model.Helper.EnumHelper;

namespace XKRS.Common.Model.Helper
{
    public class DeviceAttribute:Attribute
    {
        /// <summary>
        /// 设备类型,指示该信息的设备类型，适用于设备信息和配置信息
        /// </summary>
        public string TypeCode { get; set; }


        /// <summary>
        ///特性修饰类别 
        /// </summary>
        public DeviceAttributeType AttrType { get; set; }
    }
    /// <summary>
    /// 预置状态特性，指定该修饰信息的前置状态允许范围
    /// </summary>
    public class PreStateAttribute : Attribute
    {
        public int PreState { get; set; }
        public PreStateAttribute(int _preState)
        {
            PreState = _preState;
        }
        /// <summary>
        /// 检查当前待执行操作的前置状态要求是否合法
        /// </summary>
        /// <param name="currentState"></param>
        /// <returns></returns>
        public bool CheckPreStateValid(int currentState)
        {
            return (currentState & PreState) == currentState;
        }
    }

    public class ColorSelectAttribute : Attribute
    {
        public string SelectdColor { get; set; }
        public ColorSelectAttribute(string selectedColor)
        {
            SelectdColor = selectedColor;
        }
    }
    public class FontColorSelectAttribute : Attribute
    {
        public string SelectedColor { get; set; }
        public FontColorSelectAttribute(string selectedColor)
        {
            SelectedColor = selectedColor;
        }

    }




    public class ProcessAttribute : Attribute
    {
        public string ProcessCode { get; set; }
        public DeviceAttributeType AttrType { get; set; }
        public ProcessAttribute(string stationCode,DeviceAttributeType attrType)
        {
            ProcessCode = stationCode;
            AttrType = attrType;
        }
    }
}
