using SWRIS.Enums;
using System.ComponentModel;

namespace SWRIS.Models
{
    public class LimitModel : INotifyPropertyChanged
    {
        private string name;
        private LimitState state;
        private int switchIndex = 0;
        private bool isEnable;

        public string Name { get => name; set { name = value; OnPropertyChanged("Name"); } }
        public LimitState State { get => state; set { state = value; OnPropertyChanged("State"); } }
        /// <summary>
        /// 限位开关索引，0无 1位置1 2位置2 
        /// </summary>
        public int SwitchIndex { get => switchIndex; set { switchIndex = value; OnPropertyChanged("SwitchIndex"); } }
        public bool IsEnable { get => isEnable; set { isEnable = value; OnPropertyChanged("IsEnable"); } }

        public event PropertyChangedEventHandler PropertyChanged;
        protected internal virtual void OnPropertyChanged(string propertyName)
        {
            PropertyChanged?.Invoke(this, new PropertyChangedEventArgs(propertyName));
        }
    }
}
