예제 #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
파일: NodeSwitch.cs 프로젝트: radtek/ANCHI
        private void AsrsCheckinRequire()
        {
            //foreach(AsrsControl.AsrsPortalModel port in targetPorts)
            for (int i = 0; i < targetPorts.Count(); i++)
            {
                AsrsControl.AsrsPortalModel port = targetPorts[i];
                if (port.AsrsCtl.StackDevice.Db2Vals[0] > 0 || port.AsrsCtl.StackDevice.Db2Vals[1] > 2)
                {
                    continue;
                }
                if (port.PalletBuffer.Count() < 1)
                {
                    continue;
                }

                bool checkInRequire = false;
                if (port.PalletBuffer.Count() >= port.PortinBufCapacity)
                {
                    checkInRequire = true;
                }
                else
                {
                    if (db1ValsToSnd[0] == 3 && port.Db2Vals[0] == 2)
                    {
                        checkInRequire = true;
                    }
                }
                for (int j = 0; j < Math.Min(port.PalletBuffer.Count(), port.PortinBufCapacity); j++)
                {
                    if (port.Db2Vals[j] != 2)
                    {
                        checkInRequire = false;
                        break;
                    }
                }
                if (port.Db2Vals[2] == 2) //手动入库按钮请求
                {
                    checkInRequire = true;
                }
                if (!checkInRequire)
                {
                    continue;
                }
                string palletID = port.PalletBuffer[0];
                #region 查询本地应该进入哪个分区

                /*
                 * string nextProcessID = port.AsrsCtl.GetNextStepID(palletID);
                 * int nextProcessSeq = SysCfg.SysCfgModel.stepSeqs.IndexOf(nextProcessID);
                 * int curSeq = SysCfg.SysCfgModel.stepSeqs.IndexOf(port.AsrsCtl.MesProcessStepID[0]);
                 * AsrsModel.EnumLogicArea logicArea = AsrsModel.EnumLogicArea.冷却区;
                 * if (nextProcessSeq > curSeq)
                 * {
                 *  logicArea = AsrsModel.EnumLogicArea.常温区;
                 * }*/
                #endregion
                #region 查询MES应该进入哪个库区

                //在MES中查询入口处的第一个托盘当前工步,判断应该进入哪个库区
                ANCStepResult stepRe = MesAcc.GetStep(palletID);
                if (stepRe.ResultCode != 0)
                {
                    port.CurrentTaskDescribe = "查询MES托盘步次失败:" + stepRe.ResultMsg;
                    continue;
                }

                AsrsModel.EnumLogicArea logicArea = AsrsModel.EnumLogicArea.冷却区;
                if (stepRe.Step < 12)
                {
                    logicArea = AsrsModel.EnumLogicArea.冷却区;
                }
                else
                {
                    logicArea = AsrsModel.EnumLogicArea.常温区;
                }
                #endregion

                string reStr = "";
                SysCfg.EnumAsrsTaskType taskType = SysCfg.EnumAsrsTaskType.产品入库;
                if (port.AsrsCtl.AsrsCheckinTaskRequire(port, logicArea, taskType, port.PalletBuffer.ToArray(), ref reStr))
                {
                    //port.PalletBuffer.Clear();
                    if (!port.ClearBufPallets(ref reStr))
                    {
                        logRecorder.AddDebugLog(port.NodeName, "清理入口缓存数据失败" + reStr);
                    }
                }
                else
                {
                    string logStr = string.Format("{0}申请失败,因为:{1}", taskType.ToString(), reStr);
                    logRecorder.AddDebugLog(port.NodeName, logStr);
                }
            }
        }
예제 #3
0
 private void AsrsCheckinRequire()
 {
     //foreach(AsrsControl.AsrsPortalModel port in targetPorts)
     for (int i = 0; i < targetPorts.Count(); i++)
     {
         AsrsControl.AsrsPortalModel port = targetPorts[i];
         if (port.AsrsCtl.StackDevice.Db2Vals[0] > 0 || port.AsrsCtl.StackDevice.Db2Vals[1] > 2)
         {
             continue;
         }
         if (port.PalletBuffer.Count() < 1)
         {
             continue;
         }
         if (port.AsrsCtl.StackDevice.Db2Vals[1] > 2)
         {
         }
         bool checkInRequire = false;
         if (port.PalletBuffer.Count() >= port.PortinBufCapacity)
         {
             checkInRequire = true;
         }
         else
         {
             if (db1ValsToSnd[0] == 3 && port.Db2Vals[0] == 2)
             {
                 checkInRequire = true;
             }
         }
         for (int j = 0; j < Math.Min(port.PalletBuffer.Count(), port.PortinBufCapacity); j++)
         {
             if (port.Db2Vals[j] != 2)
             {
                 checkInRequire = false;
                 break;
             }
         }
         if (port.Db2Vals[2] == 2) //手动入库按钮请求
         {
             checkInRequire = true;
         }
         if (!checkInRequire)
         {
             continue;
         }
         string palletID                   = port.PalletBuffer[0];
         string nextProcessID              = port.AsrsCtl.GetNextStepID(palletID);
         int    nextProcessSeq             = SysCfg.SysCfgModel.stepSeqs.IndexOf(nextProcessID);
         int    curSeq                     = SysCfg.SysCfgModel.stepSeqs.IndexOf(port.AsrsCtl.MesProcessStepID[0]);
         AsrsModel.EnumLogicArea logicArea = AsrsModel.EnumLogicArea.暂存区;
         if (nextProcessSeq > curSeq)
         {
             logicArea = AsrsModel.EnumLogicArea.常温区;
         }
         string reStr = "";
         SysCfg.EnumAsrsTaskType taskType = SysCfg.EnumAsrsTaskType.产品入库;
         if (port.AsrsCtl.AsrsCheckinTaskRequire(port, logicArea, taskType, port.PalletBuffer.ToArray(), ref reStr))
         {
             //port.PalletBuffer.Clear();
             if (!port.ClearBufPallets(ref reStr))
             {
                 logRecorder.AddDebugLog(port.NodeName, "清理入口缓存数据失败" + reStr);
             }
         }
         else
         {
             string logStr = string.Format("{0}申请失败,因为:{1}", taskType.ToString(), reStr);
             logRecorder.AddDebugLog(port.NodeName, logStr);
         }
     }
 }