Example #1
0
 public AsrsMonitorUsercontrol(AsrsCtlModel asrsCtl)
 {
     InitializeComponent();
     this.asrsCtl         = asrsCtl;
     this.groupBox1.Text  = asrsCtl.HouseName;
     this.timer1.Interval = 500;
 }
Example #2
0
 public AsrsPortalModel(AsrsCtlModel asrsCtl)
 {
     PortinBufCapacity       = 1; //默认最大容量是1
     this.asrsCtlModel       = asrsCtl;
     EmptyPalletInputEnabled = false;
     BarcodeScanRequire      = false;
 }
Example #3
0
 private bool ParseCtlnodes(XElement CtlnodeRoot, ref string reStr)
 {
     if (CtlnodeRoot == null)
     {
         reStr = "系统配置文件错误,不存在CtlNodes节点";
         return(false);
     }
     try
     {
         IEnumerable <XElement> nodeXEList = CtlnodeRoot.Elements("Asrs");
         //from el in CtlnodeRoot.Elements()
         //where el.Name == "Asrs"
         //select el;
         foreach (XElement el in nodeXEList)
         {
             AsrsCtlModel asrsModel = new AsrsCtlModel();
             if (!asrsModel.BuildCfg(el, ref reStr))
             {
                 // logRecorder.AddLog(new LogModel(objectName, reStr, EnumLoglevel.错误));
                 Console.WriteLine(reStr);
                 return(false);
             }
             //  asrsModel.AsrsCheckoutMode = EnumAsrsCheckoutMode.计时出库;
             this.asrsCtls.Add(asrsModel);
         }
         return(true);
     }
     catch (Exception ex)
     {
         reStr = ex.ToString();
         return(false);
     }
 }
Example #4
0
        public bool GetAsrsStat(string asrsHoseName, ref int errCode, ref string[] status)
        {
            AsrsCtlModel asrsCtl = asrsPresenter.GetAsrsCtlByName(asrsHoseName);

            if (asrsCtl == null)
            {
                return(false);
            }
            return(asrsCtl.StackDevice.GetRunningStatus(ref errCode, ref status));
        }
Example #5
0
        public bool CreateManualOutputTask(string houseName, CellCoordModel cell, ref string reStr)
        {
            AsrsCtlModel asrsModel = null;

            foreach (AsrsCtlModel m in asrsCtls)
            {
                if (m.HouseName == houseName)
                {
                    asrsModel = m;
                    break;
                }
            }
            if (asrsModel == null)
            {
                reStr = "未识别的: " + houseName;
                return(false);
            }

            SysCfg.EnumAsrsTaskType taskType       = SysCfg.EnumAsrsTaskType.产品出库;
            EnumCellStatus          cellStoreStats = EnumCellStatus.空闲;
            EnumGSTaskStatus        cellTaskStatus = EnumGSTaskStatus.完成;

            asrsResourceManage.GetCellStatus(houseName, cell, ref cellStoreStats, ref cellTaskStatus);
            EnumGSEnabledStatus cellEnabledStatus = EnumGSEnabledStatus.启用;

            if (!asrsResourceManage.GetCellEnabledStatus(houseName, cell, ref cellEnabledStatus))
            {
                reStr = string.Format("获取货位启用状态失败{0}-{1}-{2}", cell.Row, cell.Col, cell.Layer);
                return(false);
            }
            if (cellEnabledStatus == EnumGSEnabledStatus.禁用)
            {
                reStr = string.Format("货位{0}-{1}-{2}禁用,无法生成出库任务", cell.Row, cell.Col, cell.Layer);
                return(false);
            }
            if (cellTaskStatus == EnumGSTaskStatus.锁定)
            {
                reStr = "货位处于锁定状态";
                return(false);
            }

            if (cellStoreStats == EnumCellStatus.空料框)
            {
                taskType = SysCfg.EnumAsrsTaskType.空框出库;
            }

            asrsModel.GenerateOutputTask(cell, null, taskType, false);

            return(true);
        }
Example #6
0
 public AsrsStackerCtlModel(AsrsCtlModel asrsCtl)
 {
     this.devCata                  = "堆垛机";
     this.asrsCtlModel             = asrsCtl;
     this.currentStat              = new CtlNodeStatus(nodeName);
     this.currentStat.Status       = EnumNodeStatus.设备空闲;
     this.currentStat.StatDescribe = "空闲状态";
     this.ctlTaskBll               = new ControlTaskBll();
     this.currentTaskPhase         = 0;
     errcodeMap = new Dictionary <int, string>();
     #region 故障码定义
     errcodeMap[1]  = "接收任务:不完整";
     errcodeMap[2]  = "叉臂伸出的前放有货";
     errcodeMap[3]  = "叉臂出口有货";
     errcodeMap[4]  = "钢丝绳松故障";
     errcodeMap[5]  = "行走到原点极限故障";
     errcodeMap[6]  = "行走到终点极限故障";
     errcodeMap[7]  = "升降到下限极限保护";
     errcodeMap[8]  = "升降到上限极限故障行走到原点极限故障";
     errcodeMap[9]  = "行走/货叉变频器故障行走到原点极限故障";
     errcodeMap[10] = "升降变频器故障行走到原点极限故障";
     errcodeMap[11] = "行走故障,检查是否卡住或激光测距传感器异常行走到原点极限故障";
     errcodeMap[12] = "升降故障,检查升降是否卡住或升降传感器是否异常行走到原点极限故障";
     errcodeMap[13] = "货叉伸出超时,请检查是否卡住!";
     errcodeMap[14] = "货物偏左故障行走到原点极限故障";
     errcodeMap[15] = "货物偏右故障行走到原点极限故障";
     errcodeMap[16] = "取放货异常,请检查货物是否斜偏行走到原点极限故障";
     errcodeMap[17] = "门被打开行走到原点极限故障";
     errcodeMap[18] = "通讯故障行走到原点极限故障";
     errcodeMap[19] = "其它故障1";
     errcodeMap[20] = "其它故障2";
     errcodeMap[21] = "其它故障3";
     errcodeMap[22] = "其它故障4";
     errcodeMap[23] = "其它故障5";
     errcodeMap[24] = "其它故障6";
     errcodeMap[25] = "其它故障7";
     errcodeMap[26] = "其它故障8";
     errcodeMap[27] = "其它故障9";
     errcodeMap[28] = "其它故障10";
     errcodeMap[29] = "其它故障11";
     errcodeMap[30] = "急停被按下12";
     #endregion
 }
Example #7
0
        /// <summary>
        /// 空筐出库请求处理
        /// </summary>
        private void EmptyPalletOutputRequire()
        {
            AsrsCtlModel    asrsHouse          = asrsCtls[0];
            AsrsPortalModel emptyPalletOutport = asrsHouse.GetPortByDeviceID("2003");

            if (emptyPalletOutport.Db2Vals[1] == 1)
            {
                //出口有框,禁止出库
                return;
            }
            if (emptyPalletOutport.Db1ValsToSnd[0] == 2)
            {
                return;
            }
            if (emptyPalletOutport.Db2Vals[0] != 3)
            {
                return;
            }
            bool exitFlag = false;
            int  row = 2, col = 21, layer = 6; //要查询得到

            int r = 1, c = 1, L = 1;

            for (r = 1; r < row + 1; r++)
            {
                if (exitFlag)
                {
                    break;
                }
                for (c = 1; c < col + 1; c++)
                {
                    if (exitFlag)
                    {
                        break;
                    }
                    for (L = 1; L < layer + 1; L++)
                    {
                        CellCoordModel   cell          = new CellCoordModel(r, c, L);
                        EnumCellStatus   cellStoreStat = EnumCellStatus.空闲;
                        EnumGSTaskStatus cellTaskStat  = EnumGSTaskStatus.完成;
                        if (!this.asrsResourceManage.GetCellStatus(asrsHouse.HouseName, cell, ref cellStoreStat, ref cellTaskStat))
                        {
                            continue;
                        }
                        if (cellStoreStat == EnumCellStatus.空料框 && cellTaskStat != EnumGSTaskStatus.锁定)
                        {
                            if (asrsHouse.GenerateOutputTask(cell, null, SysCfg.EnumAsrsTaskType.空筐出库, true))
                            {
                                exitFlag = true;
                                emptyPalletOutport.Db1ValsToSnd[0] = 2;
                                string reStr = "";
                                if (!emptyPalletOutport.NodeCmdCommit(true, ref reStr))
                                {
                                    logRecorder.AddDebugLog(emptyPalletOutport.NodeName, "发送命令失败" + reStr);
                                }
                                else
                                {
                                    return;
                                }
                                break;
                            }
                        }
                    }
                }
            }
        }
Example #8
0
        public bool CreateManualMoveGSTask(string startHouseName, CellCoordModel startCell, string endHouseName, CellCoordModel endCell, ref string reStr)
        {
            //throw new NotImplementedException();
            string       houseName = startHouseName;
            AsrsCtlModel asrsModel = null;

            foreach (AsrsCtlModel m in asrsCtls)
            {
                if (m.HouseName == houseName)
                {
                    asrsModel = m;
                    break;
                }
            }
            if (asrsModel == null)
            {
                reStr = "未识别的: " + houseName;
                return(false);
            }
            EnumGSEnabledStatus cellEnabledStatus = EnumGSEnabledStatus.启用;

            if (!asrsResourceManage.GetCellEnabledStatus(houseName, startCell, ref cellEnabledStatus))
            {
                reStr = string.Format("获取货位启用状态失败{0}-{1}-{2}", startCell.Row, startCell.Col, startCell.Layer);
                return(false);
            }
            if (cellEnabledStatus == EnumGSEnabledStatus.禁用)
            {
                reStr = string.Format("货位{0}-{1}-{2}禁用,无法生成移库任务", startCell.Row, startCell.Col, startCell.Layer);
                return(false);
            }

            if (!asrsResourceManage.GetCellEnabledStatus(houseName, endCell, ref cellEnabledStatus))
            {
                reStr = string.Format("获取货位启用状态失败{0}-{1}-{2}", endCell.Row, endCell.Col, endCell.Layer);
                return(false);
            }
            if (cellEnabledStatus == EnumGSEnabledStatus.禁用)
            {
                reStr = string.Format("货位{0}-{1}-{2}禁用,无法生成移库任务", endCell.Row, endCell.Col, endCell.Layer);
                return(false);
            }
            EnumCellStatus   cellStoreStats = EnumCellStatus.空闲;
            EnumGSTaskStatus cellTaskStatus = EnumGSTaskStatus.完成;

            asrsResourceManage.GetCellStatus(houseName, startCell, ref cellStoreStats, ref cellTaskStatus);
            if (cellTaskStatus == EnumGSTaskStatus.锁定)
            {
                reStr = string.Format("货位{0}-{1}-{2}处于锁定状态,无法生成移库任务", startCell.Row, startCell.Col, startCell.Layer);;
                return(false);
            }
            asrsResourceManage.GetCellStatus(houseName, endCell, ref cellStoreStats, ref cellTaskStatus);
            if (cellTaskStatus == EnumGSTaskStatus.锁定)
            {
                reStr = string.Format("目标货位{0}-{1}-{2}处于锁定状态,无法生成移库任务", endCell.Row, endCell.Col, endCell.Layer);;
                return(false);
            }
            if (cellStoreStats != EnumCellStatus.空闲)
            {
                reStr = string.Format("目标货位{0}-{1}-{2}不为空,无法生成移库任务", endCell.Row, endCell.Col, endCell.Layer);;
                return(false);
            }
            SysCfg.EnumAsrsTaskType taskType = SysCfg.EnumAsrsTaskType.移库;
            return(asrsModel.GenerateOutputTask(startCell, endCell, taskType, false, null, 1000));
            //return true;
        }
Example #9
0
        public bool CreateManualOutputTask(string houseName, CellCoordModel cell, ref string reStr)
        {
            AsrsCtlModel asrsModel = null;

            foreach (AsrsCtlModel m in asrsCtls)
            {
                if (m.HouseName == houseName)
                {
                    asrsModel = m;
                    break;
                }
            }
            if (asrsModel == null)
            {
                reStr = "未识别的: " + houseName;
                return(false);
            }

            SysCfg.EnumAsrsTaskType taskType       = SysCfg.EnumAsrsTaskType.产品出库;
            EnumCellStatus          cellStoreStats = EnumCellStatus.空闲;
            EnumGSTaskStatus        cellTaskStatus = EnumGSTaskStatus.完成;

            asrsResourceManage.GetCellStatus(houseName, cell, ref cellStoreStats, ref cellTaskStatus);
            EnumGSEnabledStatus cellEnabledStatus = EnumGSEnabledStatus.启用;

            if (!asrsResourceManage.GetCellEnabledStatus(houseName, cell, ref cellEnabledStatus))
            {
                reStr = string.Format("获取货位启用状态失败{0}-{1}-{2}", cell.Row, cell.Col, cell.Layer);
                return(false);
            }
            if (cellEnabledStatus == EnumGSEnabledStatus.禁用)
            {
                reStr = string.Format("货位{0}-{1}-{2}禁用,无法生成出库任务", cell.Row, cell.Col, cell.Layer);
                return(false);
            }
            if (cellTaskStatus == EnumGSTaskStatus.锁定)
            {
                reStr = "货位处于锁定状态";
                return(false);
            }

            if (cellStoreStats == EnumCellStatus.空料框)
            {
                taskType = SysCfg.EnumAsrsTaskType.空筐出库;
            }
            List <short>  asrsExtParams = new List <short>();
            List <string> cellGoods     = new List <string>();

            if (!this.asrsResourceManage.GetStockDetail(houseName, cell, ref cellGoods))
            {
                return(false);
            }
            if (dlgtAsrsExtParmas != null)
            {
                if (!dlgtAsrsExtParmas(cellGoods, ref asrsExtParams, ref reStr))
                {
                    return(false);
                }
            }
            //  asrsModel.GenerateOutputTask(cell, null,taskType, false,asrsExtParams,1000);
            return(asrsModel.GenerateCheckoutTask(cell, taskType, false, ref reStr, 1000));
        }
Example #10
0
 public AsrsPortalModel(AsrsCtlModel asrsCtl)
 {
     PortinBufCapacity = 1; //默认最大容量是1
     this.asrsCtlModel = asrsCtl;
 }
Example #11
0
 public XWEProcessModel(AsrsCtlModel asrsCtlModel)
 {
     this.AsrsModel = asrsCtlModel;
     XWEProcessModel.AHouseDCRStation = new CellCoordModel(1, 15, 1); //A库房DCR测试工位
     XWEProcessModel.BHouseDCRStation = new CellCoordModel(1, 1, 1);  //B库房DCR测试工位
 }