Example #1
0
        /// <summary>
        /// 获取所在的管制区号,为0时则不在管制区内
        /// </summary>
        /// <param name="trafficmark">地标结构体</param>
        /// <returns>管制区号</returns>
        public int GetTrafficNum(TrafficMark trafficmark)
        {
            int traffic_mark = 0;
            int agv_mark     = (trafficmark.workLineNum << 12) | trafficmark.markNum; //得到AGV地标与流水线对应的地标总和

            for (int i = 0; i < trafficCount; i++)                                    //检测到最大路口数
            {
                for (int j = 0; j < agvTrafficList[i].trafficMarkCount; j++)
                {
                    traffic_mark = (agvTrafficList[i].trafficMarkArray[j].workLineNum << 12) | agvTrafficList[i].trafficMarkArray[j].markNum; //得到路口地标与流水线对应的地标总和
                    if (traffic_mark == agv_mark)                                                                                             //如果AGV当前地标和路口的地标相同
                    {
                        return(agvTrafficList[i].trafficNum);                                                                                 //返回路口值
                    }
                }
            }
            return(0);
        }
Example #2
0
 /// <summary>
 /// 获取所在的管制区号,为0时则不在管制区内
 /// </summary>
 /// <param name="trafficmark">地标结构体</param>
 /// <returns>管制区号</returns>
 public int GetTrafficNum(TrafficMark trafficmark)
 {
     int traffic_mark = 0;
     int agv_mark = (trafficmark.workLineNum << 12) | trafficmark.markNum; //得到AGV地标与流水线对应的地标总和
     for (int i = 0; i < trafficCount; i++)   //检测到最大路口数
     {
         for (int j = 0; j < agvTrafficList[i].trafficMarkCount; j++)
         {
             traffic_mark = (agvTrafficList[i].trafficMarkArray[j].workLineNum << 12) | agvTrafficList[i].trafficMarkArray[j].markNum;   //得到路口地标与流水线对应的地标总和
             if (traffic_mark == agv_mark) //如果AGV当前地标和路口的地标相同
             {
                 return agvTrafficList[i].trafficNum;  //返回路口值
             }
         }
     }
     return 0;
 }