Base_Station.cs 3.19 KB
using RCS.Model.Comm;
using System.ComponentModel;
using System.ComponentModel.DataAnnotations;
using System.ComponentModel.DataAnnotations.Schema;
using System.Runtime.CompilerServices;

namespace RCS.Model.Entity
{
    [Table("t_base_map_station")]

    public class Base_Station : INotifyPropertyChanged
    {
        public event PropertyChangedEventHandler? PropertyChanged;

        public void NotifyPropertyChanged([CallerMemberName] String propertyName = "")
        {
            PropertyChanged?.Invoke(this, new PropertyChangedEventArgs(propertyName));
        }
        private bool isLocked;
        private bool isEnable;
        #region 基础实体类

        /// <summary>
        /// 唯一标识
        /// </summary>
        [Key]
        [DatabaseGenerated(DatabaseGeneratedOption.Identity)]
        public long ID { get; set; }

        /// <summary>
        /// 站台编码
        /// </summary>
        public string Code { get; set; }

        /// <summary>
        /// 站台名称
        /// </summary>
        public string Name { get; set; }

        /// <summary>
        /// 站台类型
        /// </summary>
        public EnumMsg.StationType StationType { get; set; }

        /// <summary>
        /// 站台方向
        /// </summary>
        public EnumMsg.Direction StationDirection { get; set; } = EnumMsg.Direction.无方向;

        /// <summary>
        /// 站台所属区域
        /// </summary>
        public string Area { get; set; }

        /// <summary>
        /// 站台所属群组
        /// </summary>
        public string Group { get; set; }

        /// <summary>
        /// 站台点
        /// </summary>
        public string Barcode { get; set; }

        /// <summary>
        /// 站台附属点
        /// </summary>
        public string PreBarcode { get; set; }

        /// <summary>
        /// 站台是否被锁定
        /// </summary>
        public bool IsLocked { get => isLocked; set { isLocked = value; NotifyPropertyChanged(); } }

        /// <summary>
        /// 站台是否启用
        /// </summary>
        public bool IsEnable { get => isEnable; set { isEnable = value; NotifyPropertyChanged(); } }

        /// <summary>
        /// 站台状态 满FULL 空Empty
        /// </summary>
        public EnumMsg.StationState StationState { get; set; }

        /// <summary>
        /// 站台低位高度
        /// </summary>
        public ushort LowHeight { get; set; }

        /// <summary>
        /// 站台高位高度
        /// </summary>
        public ushort HighHeight { get; set; }

        /// <summary>
        /// 站台防撞属性
        /// </summary>
        public int Tim { get; set; }

        /// <summary>
        /// 增删改
        /// </summary>
        [NotMapped]
        public string Type { get; set; }
        [NotMapped]
        public Base_Point Point { get; set; }
        #endregion 基础实体类

        /// <summary>
        /// 与站台对接中的agv
        /// </summary>
        [NotMapped]
        public Base_Agv? LockAgv { get; set; }

        public virtual void ClearAllRequest() { }

        public override string ToString()
        {
            return $"{Area}-{Name}-{Code}";
        }
    }
}