Esempio n. 1
0
        /// <summary>
        /// 生成路径
        /// </summary>
        /// <returns>路径集合</returns>
        public static List <PathPoint> GetPath(Agv agv)
        {
            STask     sTask      = agv.sTaskList[0];
            Point     beginPoint = sTask.beginPoint;
            Point     endPoint   = sTask.endPoint;
            STaskType sTaskType  = sTask.sTaskType;

            switch (sTask.sTaskType)
            {
            case STaskType.D1:
                if (beginPoint == endPoint)
                {
                    return new List <PathPoint>()
                           {
                               GetObject.GetPathPoint(beginPoint), GetObject.GetPathPoint(endPoint)
                           }
                }
                ;

                AStar        aStart     = new AStar();
                List <Point> listApoint = GetCanUseApoint(agv);
                ClearParentPoint();
                Point Parent = aStart.PathGet(listApoint, beginPoint, endPoint, agv);
                if (Parent == null)
                {
                    return(null);
                }

                List <PathPoint> listPathPoint = GetPathList(Parent);
                AddCorner(listPathPoint);
                OriLock(listPathPoint, agv);

                return(listPathPoint);

            case STaskType.D2:
            case STaskType.D3:
            case STaskType.D6:
            case STaskType.D15:
                return(new List <PathPoint>()
                {
                    GetObject.GetPathPoint(beginPoint), GetObject.GetPathPoint(endPoint)
                });

            case STaskType.D13:
            case STaskType.D14:
                //左弧右弧进
                break;

            case STaskType.D17:
            case STaskType.D19:
                //左弧右弧出
                break;

            default:
                throw new Exception("无此任务类型:" + sTask.sTaskType);
            }

            return(null);
        }
Esempio n. 2
0
        static List <PathPoint> GetPathList(Point Parent)
        {
            List <PathPoint> listPathPoint = new List <PathPoint>();

            while (Parent != null)
            {
                listPathPoint.Add(GetObject.GetPathPoint(Parent));
                Parent = Parent.ParentPoint;
            }

            listPathPoint.Reverse();
            for (int i = 0; i < listPathPoint.Count; i++)
            {
                listPathPoint[i].serialNo = i + 1;
            }

            return(listPathPoint);
        }