Base_PathPoint.cs 2.43 KB
using RCS.Model.Comm;
using RCS.Model.Entity.PrimaryKey;
using System.ComponentModel.DataAnnotations.Schema;

namespace RCS.Model.Entity
{
    [Table("t_base_pathpoint")]
    public class Base_PathPoint : IdEntity, IComparable
    {
        /// <summary>
        /// 路径所在区域
        /// </summary>
        public string AreaType { get; set; }

        /// <summary>
        /// 路径对应的子任务号
        /// </summary>
        public uint SubTaskNo { get; set; }

        /// <summary>
        /// 路径点序号
        /// </summary>
        public int SerialNo { get; set; }

        /// <summary>
        /// 路径点方向(进入下个路径点的方向)
        /// </summary>
        public EnumMsg.Direction PathDirection { get; set; } = EnumMsg.Direction.无方向;

        /// <summary>
        /// 上一个路径点方向(就是进入当前路径点的方向)
        /// </summary>
        [NotMapped]
        public EnumMsg.Direction PreviousPathDirection { get; set; } = EnumMsg.Direction.无方向;

        /// <summary>
        /// 路径点
        /// </summary>
        public string Barcode { get; set; }


        private Base_Point _point;
        /// <summary>
        /// 路径点信息
        /// </summary>
        [NotMapped]
        public Base_Point Point { get { return _point; } 
            set {
                _point = value;
                Barcode = _point.Barcode;
                AreaType = _point.AreaType;
                PathPointType = _point.PointType;
            }
        
        }

        /// <summary>
        /// 是否为拐点
        /// </summary>
        public bool IsCorner { get; set; }

        /// <summary>
        /// 路径点的点属性
        /// </summary>
        public EnumMsg.PointType PathPointType { get; set; }

        /// <summary>
        /// 路径防撞属性
        /// </summary>
        public int PathTim { get; set; }

        /// <summary>
        /// 是否横移
        /// </summary>
        public bool IsLateralDisplacement { get; set; }

        /// <summary>
        /// 排序
        /// </summary>
        /// <param name="obj"></param>
        /// <returns></returns>
        public int CompareTo(object obj)
        {
            Base_PathPoint pathPoint = obj as Base_PathPoint;
            if (pathPoint == null)
                throw new NotImplementedException();
            return SerialNo.CompareTo(pathPoint.SerialNo);
        }
    }
}