using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.ComponentModel.DataAnnotations;
using System.Linq;
using System.Text;
using System.Threading.Tasks;


namespace MWS.Domain.Dto
{
    public class TagDataRecordDto : INotifyPropertyChanged
    {
        private string _light;
        private string _value;
        private string backGround;
        private string backImage;
        public int Id { get; set; }

        /// <summary>
        /// 变量Id
        /// </summary>
        public int TagId { get; set; }
        /// <summary>
        /// 起重机Id
        /// </summary>
        public int DeviceId { get; set; }
        /// <summary>
        /// 背景色
        /// </summary>
        public string BackGround
        {
            get => backGround;
            set
            {
                backGround = value;
                OnPropertyChanged("BackGround");
            }
        }
        /// <summary>
        /// 背景图片
        /// </summary>
        public string BackImage {
            get => backImage;
            set
            {
                backImage = value;
                OnPropertyChanged("BackImage");
            }
        }
        /// <summary>
        /// 变量名称
        /// </summary>
        public string TagName { get; set; }
        /// <summary>
        /// 开关量类型 1 指示 True 绿灯 False 灰灯 2 警告 True 黄灯 False 绿灯 3 报警 True 红灯 False 绿灯
        /// </summary>
        public short SwitchType { get; set; }
        /// <summary>
        /// 变量单位0 0 正常 1 档位 2 重量 3 行程高度 4 载荷  5 电流 6 电压 7 速度 8 振幅 9 温度 10 力矩  11 频率 12 虚拟档位 13 制动器
        /// </summary>
        public short Unit { get; set; }
        /// <summary>
        /// 变量单位名称
        /// </summary>
        public string UnitName { get; set; }
        /// <summary>
        /// 变量分组
        /// </summary>
        public short Group { get; set; }
        /// <summary>
        /// 模拟量是否隐藏
        /// </summary>
        public string ValueVisibility { get; set; }
        /// <summary>
        /// 开关量是否隐藏
        /// </summary>
        public string LightVisibility { get; set; }
        //public string 
        /// <summary>
        /// 数据类型
        /// </summary>
        public int DataType { get; set; }
        /// <summary>
        /// 机构类型
        /// </summary>
        public short MecType { get; set; }
        //public string 
        /// <summary>
        /// 数据
        /// </summary>
        public string AD { get; set; }
        /// <summary>
        /// 开关量指示灯背景色
        /// </summary>
        public string Light
        {
            get => _light;
            set
            {
                _light = value;
                OnPropertyChanged("Light");
            }
        }
        /// <summary>
        /// 变量值
        /// </summary>
        public string Value
        {
            get => _value;
            set
            {
                _value = value;
                OnPropertyChanged("Value");
            }
        }
        /// <summary>
        /// 创建时间
        /// </summary>
        public long Time { get; set; }

        public event PropertyChangedEventHandler PropertyChanged;
        protected virtual void OnPropertyChanged(string propertyName)
        {
            PropertyChangedEventHandler handler = PropertyChanged;
            if (handler != null) handler(this, new PropertyChangedEventArgs(propertyName));
        }
    }
}
