using System.Collections.Generic;
using System.Linq;

namespace MWS.Model.Model
{
    public class GearConverConfig
    {
        /// <summary>
        /// 机构类型
        /// </summary>
        public int MecType { get; set; }

        /// <summary>
        /// 变量编码
        /// </summary>
        public int TagId { get; set; }

        /// <summary>
        /// 机构名称
        /// </summary>
        public string TagName { get; set; }

        /// <summary>
        /// 所有档位字段
        /// </summary>
        public List<int> Condition => Gears.SelectMany(c => c.Condition.Select(e => e)).Distinct().ToList();

        /// <summary>
        /// 当前值
        /// </summary>
        public List<int> Instantly { get; set; }

        public List<Gear> Gears { get; set; }

        public class Gear
        {
            public string Name { get; set; }
            public short Value { get; set; }
            public List<int> Condition { get; set; }
        }
    }
}