Point.cs 4.63 KB
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace XingYe_ACS.BaseStruct
{
    public class Point : IComparable
    {
        /// <summary>
        /// 点码值
        /// </summary>
        public string strBarcode { get; set; }

        /// <summary>
        /// 点附属点
        /// </summary>
        public string strPreBarcode { get; set; }

        /// <summary>
        /// 点区域类型
        /// </summary>
        public string AreaType { get; set; }

        /// <summary>
        /// 点属性
        /// </summary>
        public EnumMsg.PointType pointType { get; set; }

        /// <summary>
        /// x坐标
        /// </summary>
        public int intX { get; set; }

        /// <summary>
        /// y坐标
        /// </summary>
        public int intY { get; set; }

        /// <summary>
        /// X间距
        /// </summary>
        public int intXLength;

        /// <summary>
        /// Y间距
        /// </summary>
        public int intYLength;

        /// <summary>
        /// 车头方向
        /// </summary>
        public EnumMsg.OriType oriAgv;

        /// <summary>
        /// 转盘方向
        /// </summary>
        public EnumMsg.OriDial oriDial;

        /// <summary>
        /// 防撞方向
        /// </summary>
        public EnumMsg.AntiCollision antiCollision;

        /// <summary>
        /// 允许通行的方向锁
        /// </summary>
        public bool isXPos;
        public bool isXNeg;
        public bool isYPos;
        public bool isYNeg;

        /// <summary>
        /// 四周点
        /// </summary>
        public Point xPosPoint;
        public Point xNegPoint;
        public Point yPosPoint;
        public Point yNegPoint;

        public List<Point> aroundPoint { get; set; }

        /// <summary>
        /// 临时方向集合
        /// </summary>
        public List<TmpDirection> tmpDirectionList { get; set; }

        public Dictionary<bool, int> keyValues { get; set; }

        /// <summary>
        /// 点是否可用
        /// </summary>
        public bool isEnable;

        /// <summary>
        /// 点是否被占用
        /// </summary>
        public bool isOccupy;

        /// <summary>
        /// 点被占用的小车号(行走不置)
        /// </summary>
        public string strOccupyAgvNo;

        /// <summary>
        /// 点被申请的小车
        /// </summary>
        public Agv lockedAgv;

        /// <summary>
        /// 所属限制区域代码
        /// </summary>
        public string strRegionName;

        /// <summary>
        /// 限制区域是否被申请(关键点来表示,旋转区域为旋转点、互斥区域为互斥点)
        /// </summary>
        public bool isRegionApply { get; set; }

        /// <summary>
        /// 限制区域申请小车
        /// </summary>
        public string strRegionApplyAgvNo { get; set; }

        /// <summary>
        /// 增删改
        /// </summary>
        public string type { get; set; }

        #region web发送
        /// <summary>
        /// 暂停时间
        /// </summary>
        public int stopTime { get; set; }
        /// <summary>
        /// web发送X正方向距离
        /// </summary>
        public int XPosLength { get; set; }
        /// <summary>
        /// web发送X负方向距离
        /// </summary>
        public int XNegLength { get; set; }
        /// <summary>
        /// web发送Y正方向距离
        /// </summary>
        public int YPosLength { get; set; }
        /// <summary>
        /// web发送Y负方向距离
        /// </summary>
        public int YNegLength { get; set; }
        #endregion

        #region A*算法
        public Point ParentPoint;
        //F=G+H
        public double Value_F;
        public double Value_G;
        public double Value_H;

        public int CompareTo(object obj)
        {
            Point p = obj as Point;
            if (p == null)
                throw new NotImplementedException();
            return Value_F.CompareTo(p.Value_F);
        }
        #endregion

        #region 2021新增测试
        /// <summary>
        /// 是否允许驻停
        /// </summary>
        public bool isStop { get; set; }
        /// <summary>
        /// 驻停等级
        /// </summary>
        public int intStopLevel { get; set; }
        #endregion
    }

    public class TmpDirection
    {
        /// <summary>
        /// 临时锁的方向:1、x+;2、x-;3、y+;4、y-;
        /// </summary>
        public EnumMsg.OriType pathDirection { get; set; }
        public string strAgvNo { get; set; }
    }
    
}