示例#1
0
        private CtlDBAccess.Model.ControlTaskModel GetCheckoutOfArea(AsrsControl.AsrsCtlModel asrsCtl, IAsrsManageToCtl asrsResManage, SysCfg.EnumAsrsTaskType taskType, IList <CtlDBAccess.Model.ControlTaskModel> taskList, AsrsModel.EnumLogicArea checkOutArea)
        {
            string           houseName = asrsCtl.HouseName;
            ControlTaskModel task      = null;

            if (taskList == null)
            {
                return(null);
            }
            foreach (ControlTaskModel t in taskList)
            {
                string             reStr      = "";
                AsrsTaskParamModel paramModel = new AsrsTaskParamModel();
                if (!paramModel.ParseParam(taskType, t.TaskParam, ref reStr))
                {
                    continue;
                }
                AsrsModel.EnumGSEnabledStatus cellEnabledStatus = AsrsModel.EnumGSEnabledStatus.启用;
                if (!asrsResManage.GetCellEnabledStatus(houseName, paramModel.CellPos1, ref cellEnabledStatus))
                {
                    // reStr = "获取货位启用状态失败";
                    continue;
                }
                if (cellEnabledStatus == AsrsModel.EnumGSEnabledStatus.禁用)
                {
                    continue;
                }
                AsrsModel.EnumLogicArea curLogicArea = AsrsModel.EnumLogicArea.一次高温A区;
                if (!asrsResManage.GetLogicAreaName(houseName, paramModel.CellPos1, ref curLogicArea))
                {
                    continue;
                }
                if (curLogicArea == checkOutArea)
                {
                    task = t;
                    break;
                }
            }
            return(task);
        }
示例#2
0
        /// <summary>
        /// 判断物流线是否堵塞,选择出库任务
        /// </summary>
        /// <param name="asrsCtl"></param>
        /// <param name="asrsResManage"></param>
        /// <param name="taskList"></param>
        /// <param name="taskType"></param>
        /// <returns></returns>
        public CtlDBAccess.Model.ControlTaskModel AsrsCheckoutTaskTorun(AsrsControl.AsrsCtlModel asrsCtl, IAsrsManageToCtl asrsResManage, IList <CtlDBAccess.Model.ControlTaskModel> taskList, SysCfg.EnumAsrsTaskType taskType)
        {
            try
            {
                if (taskList == null)
                {
                    return(null);
                }

                string houseName = asrsCtl.HouseName;
                CtlDBAccess.Model.ControlTaskModel task = null;
                foreach (CtlDBAccess.Model.ControlTaskModel t in taskList)
                {
                    if (t.TaskStatus != "待执行")
                    {
                        continue;
                    }
                    string             reStr      = "";
                    AsrsTaskParamModel paramModel = new AsrsTaskParamModel();
                    if (!paramModel.ParseParam(taskType, t.TaskParam, ref reStr))
                    {
                        continue;
                    }
                    AsrsPortalModel port          = asrsCtl.Ports[paramModel.OutputPort - 1];
                    int             switchPathSeq = 1;
                    CellCoordModel  cell          = paramModel.CellPos1;
                    if (asrsCtl.NodeName == "A1库房" || asrsCtl.HouseName == "A2库房")
                    {
                        string area = "注液高温区";
                        if (!this.asrsResManage.GetLogicAreaName(houseName, cell, ref area))
                        {
                            continue;
                        }
                        if (area == "注液高温区")
                        {
                            switchPathSeq = 1;
                        }
                        else if (area == "化成高温区")
                        {
                            switchPathSeq = 2;
                        }
                        else
                        {
                            continue;
                        }
                        if (port.Db2Vals[switchPathSeq] != 1)
                        {
                            continue;
                        }
                    }
                    else if (asrsCtl.HouseName == "C1库房" || asrsCtl.HouseName == "C2库房" || asrsCtl.HouseName == "C3库房")
                    {
                        if (taskType == SysCfg.EnumAsrsTaskType.空筐出库)
                        {
                            if (port.Db2Vals[switchPathSeq] != 1)
                            {
                                continue;
                            }
                        }
                    }

                    AsrsModel.EnumGSEnabledStatus cellEnabledStatus = AsrsModel.EnumGSEnabledStatus.启用;
                    if (!asrsResManage.GetCellEnabledStatus(houseName, paramModel.CellPos1, ref cellEnabledStatus))
                    {
                        // reStr = "获取货位启用状态失败";
                        continue;
                    }
                    if (cellEnabledStatus == AsrsModel.EnumGSEnabledStatus.禁用)
                    {
                        continue;
                    }
                    task = t;
                    break;
                }
                return(task);
            }
            catch (Exception ex)
            {
                Console.WriteLine(ex.ToString());
                return(null);
            }
        }