Пример #1
0
        private bool PowerFillOk(int row, int col, int layer, ref string reStr)
        {
            try
            {
                CellCoordModel   cell          = new CellCoordModel(row, col, layer);
                EnumCellStatus   cellStoreStat = EnumCellStatus.空闲;
                EnumGSTaskStatus cellTaskStat  = EnumGSTaskStatus.完成;
                if (!this.asrsResourceManage.GetCellStatus(asrsCtls[1].HouseName, cell, ref cellStoreStat, ref cellTaskStat))
                {
                    reStr = string.Format("货位不存在:{0},{1}-{2}-{3}", asrsCtls[1].HouseName, row, col, layer);
                    //  logRecorder.AddDebugLog(objectName, "充电完成事件错误,"+reStr);
                    return(false);
                }
                EnumGSEnabledStatus cellEnabledStatus = EnumGSEnabledStatus.禁用;
                if (!this.asrsResourceManage.GetCellEnabledStatus(asrsCtls[1].HouseName, cell, ref cellEnabledStatus))
                {
                    reStr = string.Format("货位禁用:{0},{1}-{2}-{3}", asrsCtls[1].HouseName, row, col, layer);
                    //logRecorder.AddDebugLog(objectName, "充电完成事件错误," + reStr);
                    return(false);
                }
                if (cellEnabledStatus == EnumGSEnabledStatus.禁用)
                {
                    reStr = string.Format("货位禁用:{0},{1}-{2}-{3}", asrsCtls[1].HouseName, row, col, layer);
                    //logRecorder.AddDebugLog(objectName, "充电完成事件错误," + reStr);
                    return(false);
                }
                if (cellStoreStat != EnumCellStatus.满位)
                {
                    reStr = string.Format("货位为空:{0},{1}-{2}-{3},", asrsCtls[1].HouseName, row, col, layer) + reStr;
                    //logRecorder.AddDebugLog(objectName, "充电完成事件错误," + reStr);
                    return(false);
                }
                if (cellTaskStat == EnumGSTaskStatus.出库允许)
                {
                    return(true);
                }
                if (cellTaskStat == EnumGSTaskStatus.锁定)
                {
                    reStr = string.Format("货位任务锁定:{0},{1}-{2}-{3},", asrsCtls[1].HouseName, row, col, layer) + reStr;
                    logRecorder.AddDebugLog(objectName, "充电完成事件错误," + reStr);
                    return(false);
                }

                cellTaskStat = EnumGSTaskStatus.出库允许;
                if (!this.asrsResourceManage.UpdateCellStatus(asrsCtls[1].HouseName, cell, cellStoreStat, cellTaskStat, ref reStr))
                {
                    reStr = string.Format("更新货位状态失败:{0},{1}-{2}-{3},", asrsCtls[1].HouseName, row, col, layer) + reStr;
                    logRecorder.AddDebugLog(objectName, "充电完成事件错误," + reStr);
                    return(false);
                }

                return(true);
            }
            catch (Exception ex)
            {
                reStr = ex.ToString();
                return(false);
            }
        }
Пример #2
0
        public bool CellStoreStateNotify(int row, int col, int layer, int stat, ref string reStr)
        {
            try
            {
                if (logRecorder != null)
                {
                    logRecorder.AddDebugLog(logSrc, string.Format("hello:收到货位{0}-{1}-{2} 货位状态 {3} 通知调用", row, col, layer, stat));
                }

                // Console.WriteLine("hello:收到货位{0}-{1}-{2} 货位状态通知调用", row, col, layer);
                CellCoordModel   cell          = new CellCoordModel(row, col, layer);
                EnumCellStatus   cellStoreStat = EnumCellStatus.空闲;
                EnumGSTaskStatus cellTaskStat  = EnumGSTaskStatus.完成;
                if (!this.asrsResManage.GetCellStatus(houseName, cell, ref cellStoreStat, ref cellTaskStat))
                {
                    reStr = string.Format("货位不存在:{0},{1}-{2}-{3}", houseName, row, col, layer);
                    //  logRecorder.AddDebugLog(objectName, "充电完成事件错误,"+reStr);
                    return(false);
                }
                if (stat == 1)
                {
                    //cellStoreStat = EnumCellStatus.空闲;
                    //cellTaskStat = EnumGSTaskStatus.完成;
                }
                else if (stat == 2)
                {
                    cellStoreStat = EnumCellStatus.满位;
                }
                else
                {
                    reStr = string.Format("分容系统传递过来的货位状态不识别,要求1~2,实际:{0}", stat);
                    return(false);
                }
                if (!this.asrsResManage.UpdateCellStatus(houseName, cell, cellStoreStat, cellTaskStat, ref reStr))
                {
                    reStr = string.Format("更新货位状态失败:{0},{1}-{2}-{3},", houseName, row, col, layer) + reStr;
                    // logRecorder.AddDebugLog(objectName, "充电完成事件错误," + reStr);
                    return(false);
                }
                //if(stat==1)
                //{
                //    if(!this.asrsResManage.RemoveStack(houseName, cell, ref reStr))
                //    {
                //        reStr = string.Format("移除库存失败:{0},{1}-{2}-{3},", houseName, row, col, layer) + reStr;
                //        return false;
                //    }
                //}
                return(true);
            }
            catch (Exception ex)
            {
                reStr = ex.ToString();
                return(false);
            }
        }
Пример #3
0
        public bool IsAsrsCellReady(int row, int col, int layer, ref string[] barCodes, ref bool isReady, ref string reStr)
        {
            try
            {
                //  barCodes = new string[] { "TP12234" };
                barCodes = null;

                //Console.WriteLine("hello:收到货位{0}-{1}-{2}就绪状态查询调用",row,col,layer);
                if (logRecorder != null)
                {
                    logRecorder.AddDebugLog(logSrc, string.Format("hello:收到货位{0}-{1}-{2}就绪状态查询调用", row, col, layer));
                }
                CellCoordModel   cell          = new CellCoordModel(row, col, layer);
                EnumCellStatus   cellStoreStat = EnumCellStatus.空闲;
                EnumGSTaskStatus cellTaskStat  = EnumGSTaskStatus.完成;
                if (!this.asrsResManage.GetCellStatus(houseName, cell, ref cellStoreStat, ref cellTaskStat))
                {
                    reStr = string.Format("货位不存在:{0}-{1}-{2}", row, col, layer);
                    logRecorder.AddDebugLog(logSrc, reStr);
                    return(false);
                }
                if (cellStoreStat == EnumCellStatus.满位 && cellTaskStat == EnumGSTaskStatus.完成)
                {
                    List <string> storBarcodes = new List <string>();
                    this.asrsResManage.GetStockDetail(houseName, cell, ref storBarcodes);
                    if (storBarcodes.Count() < 1)
                    {
                        isReady = false;
                        reStr   = "货位没有产品";
                    }
                    else
                    {
                        barCodes = storBarcodes.ToArray();
                        isReady  = true;
                        reStr    = "查询OK";
                    }
                }
                else
                {
                    reStr   = "货位没有产品";
                    isReady = false;
                }
                logRecorder.AddDebugLog(logSrc, string.Format("{0}-{1}-{2}就绪状态返回结果,{3},{4}", row, col, layer, isReady.ToString(), reStr));
                return(true);
            }
            catch (Exception ex)
            {
                reStr = ex.ToString();
                return(false);
            }
        }
Пример #4
0
 private void GenerateAsrsCheckoutTask()
 {
     try
     {
         BindingSource bs = this.dataGridView1.DataSource as BindingSource;
         DataTable     dt = bs.DataSource as DataTable;
         if (dt == null)
         {
             return;
         }
         int pri = int.Parse(this.textBoxPrivilege.Text);
         foreach (DataRow dr in dt.Rows)
         {
             string houseName = dr["库房"].ToString();
             string strCell   = dr["库位"].ToString();
             AsrsControl.AsrsCtlModel asrsCtl = AsrsPresenter.GetAsrsCtlByName(houseName);
             AsrsModel.CellCoordModel cell    = new CellCoordModel(0, 0, 0);
             if (!cell.Parse(strCell))
             {
                 continue;
             }
             EnumCellStatus   cellStoreStat = EnumCellStatus.空闲;
             EnumGSTaskStatus cellTaskStat  = EnumGSTaskStatus.完成;
             if (!asrsResMana.GetCellStatus(houseName, cell, ref cellStoreStat, ref cellTaskStat))
             {
                 Console.WriteLine("获取货位{0}:{1}状态失败", houseName, strCell);
                 continue;
             }
             if (cellStoreStat != EnumCellStatus.满位 || cellTaskStat == EnumGSTaskStatus.锁定)
             {
                 continue;
             }
             CtlDBAccess.Model.ControlTaskModel asrsTask = null;
             if (!asrsCtl.GenerateOutputTask(cell, null, SysCfg.EnumAsrsTaskType.产品出库, false, ref asrsTask, null, pri))
             {
                 logRecorder.AddDebugLog(this.Text, string.Format("生成{0}:{1}出库任务失败", houseName, strCell));
             }
             else
             {
                 logRecorder.AddDebugLog(this.Text, string.Format("生成{0}:{1}产品出库任务成功", houseName, strCell));
             }
             dr["出库任务ID"] = asrsTask.TaskID;
         }
         this.dataGridView1.Refresh();
     }
     catch (Exception ex)
     {
         Console.WriteLine(ex.ToString());
     }
 }
Пример #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);
        }
Пример #6
0
 private bool IsAsrsCellReady(int row, int col, int layer, ref string[] barCodes, ref bool isReady, ref string reStr)
 {
     // Console.WriteLine("收到远程调用,IsAsrsCellReady");
     try
     {
         CellCoordModel   cell          = new CellCoordModel(row, col, layer);
         EnumCellStatus   cellStoreStat = EnumCellStatus.空闲;
         EnumGSTaskStatus cellTaskStat  = EnumGSTaskStatus.完成;
         if (!this.asrsResourceManage.GetCellStatus(asrsCtls[1].HouseName, cell, ref cellStoreStat, ref cellTaskStat))
         {
             reStr = string.Format("货位不存在:{0}-{1}-{2}", row, col, layer);
             return(false);
         }
         if (cellStoreStat == EnumCellStatus.满位 && cellTaskStat == EnumGSTaskStatus.完成)
         {
             List <string> storBarcodes = new List <string>();
             this.asrsResourceManage.GetStockDetail(asrsCtls[1].HouseName, cell, ref storBarcodes);
             if (storBarcodes.Count() < 1)
             {
                 isReady = false;
                 reStr   = "货位没有产品";
             }
             else
             {
                 if (storBarcodes.Count() < 2)
                 {
                     storBarcodes.Add("");
                 }
                 //storBarcodes[1] = string.Empty;
                 barCodes = storBarcodes.ToArray();
                 isReady  = true;
             }
         }
         else
         {
             reStr   = "货位没有产品";
             isReady = false;
         }
         return(true);
     }
     catch (Exception ex)
     {
         reStr = ex.ToString();
         return(false);
     }
 }
Пример #7
0
        /// <summary>
        /// 更新货位任务状态,货位申请、出库、入库等改变货位状态后需要调用
        /// </summary>
        /// <param name="houseName">库房名称</param>
        /// <param name="cellCoord">货位位置</param>
        /// <param name="taskStatus">货位任务状态</param>
        /// <param name="reStr">执行状态描述</param>
        /// <returns>执行结果</returns>
        public bool UpdateGsTaskStatus(string houseName, CellCoordModel cellCoord, EnumGSTaskStatus taskStatus, ref string reStr)
        {
            bool updateStatus = bllGoodsSite.UpdateGsTaskStatusByRCL(houseName, cellCoord.Row, cellCoord.Col, cellCoord.Layer, taskStatus);

            if (updateStatus == true)
            {
                OnUpdateGsStatus();

                //string operateStr = "库房:" + houseName + ",货位:" + cellCoord.Row + "排" + cellCoord.Col + "列" + cellCoord.Layer + "层," + "货位任务状态更改为:" + taskStatus.ToString();
                //AddGSOperRecord(houseName, cellCoord, EnumGSOperateType.系统修改状态, operateStr, ref reStr);
                reStr = "货位更新成功!";
                return(true);
            }
            else
            {
                reStr = "货位更新失败!";
                return(false);
            }
        }
Пример #8
0
        private bool AddRecord(string cellID, EnumCellStatus cellStatus, EnumGSTaskStatus cellTaskStatus, ref string restr)
        {
            WH_Cell_ChildrenModel oldgsm = bllChildCell.GetModel(cellID);

            if (oldgsm == null)
            {
                return(false);
            }
            if (oldgsm.Cell_Child_Flag != "1")
            {
                this.WmsFrame.WriteLog("库存看板", "", "提示", "被禁用的货位不允许修改状态!");
                return(false);
            }
            View_CellModel cellModel = bllViewCell.GetModelByChildCellID(cellID);

            string operteStatusDetail = cellModel.WareHouse_Name + ":[" + cellModel.Cell_Name + "]货位状态由[" + oldgsm.Cell_Child_Status + "]变更为[空闲];" + "货位任务状态由[" + oldgsm.Cell_Child_Run_Status + "]变更为[完成]";

            oldgsm.Cell_Child_Status     = cellStatus.ToString();
            oldgsm.Cell_Child_Run_Status = cellTaskStatus.ToString();
            bllChildCell.Update(oldgsm);
            TaskHandleMethod.AddCellOperRecord(cellID, EnumGSOperateType.手动修改状态, operteStatusDetail, ref restr);

            return(true);
        }
Пример #9
0
        /// <summary>
        /// 查询货位状态
        /// </summary>
        /// <param name="houseName">库房名称</param>
        /// <param name="cellCoord">货位位置</param>
        /// <param name="cellStatus">货位状态</param>
        /// <param name="taskStatus">货位任务状态</param>
        /// <returns>查询状态</returns>
        public bool GetCellStatus(string houseName, CellCoordModel cellCoord, ref EnumCellStatus cellStatus, ref EnumGSTaskStatus taskStatus)
        {
            StoreHouseModel houseModel = bllStoreHouse.GetModelByName(houseName);

            if (houseModel == null)
            {
                return(false);
            }
            GoodsSiteModel gsm = bllGoodsSite.GetModelByRCL(houseModel.StoreHouseID, cellCoord.Row, cellCoord.Col, cellCoord.Layer);

            if (gsm == null)
            {
                return(false);
            }
            cellStatus = (EnumCellStatus)Enum.Parse(typeof(EnumCellStatus), gsm.GoodsSiteStatus);
            taskStatus = (EnumGSTaskStatus)Enum.Parse(typeof(EnumGSTaskStatus), gsm.GoodsSiteTaskStatus);
            return(true);
        }
Пример #10
0
        public bool UpdateGsTaskStatusByRCL(string houseName, int row, int col, int layer, EnumGSTaskStatus gsTaskStatus)
        {
            StoreHouseModel house = bllStoreHouse.GetModelByName(houseName);

            if (house == null)
            {
                return(false);
            }
            GoodsSiteModel gsm = GetModelByRCL(house.StoreHouseID, row, col, layer);

            if (gsm == null)
            {
                return(false);
            }
            gsm.GoodsSiteTaskStatus = gsTaskStatus.ToString();
            return(Update(gsm));
        }
Пример #11
0
        /// <summary>
        /// 通过库房名称及排列层更新货位
        /// </summary>
        /// <param name="houseName"></param>
        /// <param name="row"></param>
        /// <param name="col"></param>
        /// <param name="layer"></param>
        /// <param name="cellStatus"></param>
        /// <returns></returns>
        public bool UpdateModelByRCL(string houseName, int row, int col, int layer, EnumCellStatus cellStatus, EnumGSTaskStatus gsStatus)
        {
            // View_GoodsSiteModel gsModel =  bllViewGs.GetModelByHouseName(houseName);
            StoreHouseModel house = bllStoreHouse.GetModelByName(houseName);

            if (house == null)
            {
                return(false);
            }

            return(dal.UpdateModelByRCL(houseName, house.StoreHouseID, row, col, layer, cellStatus.ToString(), gsStatus.ToString()));
        }
Пример #12
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;
                            }
                        }
                    }
                }
            }
        }
Пример #13
0
 /// <summary>
 /// 查询货位状态
 /// </summary>
 /// <param name="houseName">库房名称</param>
 /// <param name="cellCoord">货位位置</param>
 /// <param name="cellStatus">货位状态</param>
 /// <param name="taskStatus">货位任务状态</param>
 /// <returns>查询状态</returns>
 public bool GetCellStatus(string houseName, CellCoordModel cellCoord, ref EnumCellStatus cellStatus, ref EnumGSTaskStatus taskStatus)
 {
     cellStatus = EnumCellStatus.空闲;
     taskStatus = EnumGSTaskStatus.完成;
     return(true);
 }
Пример #14
0
        public bool FenrongOk(int row, int col, int layer, ref string reStr)
        {
            try
            {
                //Console.WriteLine("hello:收到货位{0}-{1}-{2} 分容OK通知调用", row, col, layer);
                if (logRecorder != null)
                {
                    logRecorder.AddDebugLog(logSrc, string.Format("hello:收到货位{0}-{1}-{2} 分容OK通知调用调用", row, col, layer));
                }
                CellCoordModel   cell          = new CellCoordModel(row, col, layer);
                EnumCellStatus   cellStoreStat = EnumCellStatus.空闲;
                EnumGSTaskStatus cellTaskStat  = EnumGSTaskStatus.完成;
                if (!this.asrsResManage.GetCellStatus(houseName, cell, ref cellStoreStat, ref cellTaskStat))
                {
                    reStr = string.Format("货位不存在:{0},{1}-{2}-{3}", houseName, row, col, layer);
                    //  logRecorder.AddDebugLog(objectName, "充电完成事件错误,"+reStr);
                    return(false);
                }
                EnumGSEnabledStatus cellEnabledStatus = EnumGSEnabledStatus.禁用;
                if (!this.asrsResManage.GetCellEnabledStatus(houseName, cell, ref cellEnabledStatus))
                {
                    reStr = string.Format("货位禁用:{0},{1}-{2}-{3}", houseName, row, col, layer);
                    //logRecorder.AddDebugLog(objectName, "充电完成事件错误," + reStr);
                    return(false);
                }
                if (cellEnabledStatus == EnumGSEnabledStatus.禁用)
                {
                    reStr = string.Format("货位禁用:{0},{1}-{2}-{3}", houseName, row, col, layer);
                    //logRecorder.AddDebugLog(objectName, "充电完成事件错误," + reStr);
                    return(false);
                }
                if (cellStoreStat != EnumCellStatus.满位)
                {
                    reStr = string.Format("货位为空:{0},{1}-{2}-{3},", houseName, row, col, layer) + reStr;
                    //logRecorder.AddDebugLog(objectName, "充电完成事件错误," + reStr);
                    return(false);
                }
                if (cellTaskStat == EnumGSTaskStatus.出库允许)
                {
                    return(true);
                }
                if (cellTaskStat == EnumGSTaskStatus.锁定)
                {
                    reStr = string.Format("货位任务锁定:{0},{1}-{2}-{3},", houseName, row, col, layer) + reStr;
                    //logRecorder.AddDebugLog(objectName, "充电完成事件错误," + reStr);
                    return(false);
                }

                cellTaskStat = EnumGSTaskStatus.出库允许;
                if (!this.asrsResManage.UpdateCellStatus(houseName, cell, cellStoreStat, cellTaskStat, ref reStr))
                {
                    reStr = string.Format("更新货位状态失败:{0},{1}-{2}-{3},", houseName, row, col, layer) + reStr;
                    // logRecorder.AddDebugLog(objectName, "充电完成事件错误," + reStr);
                    return(false);
                }

                return(true);
            }
            catch (Exception ex)
            {
                reStr = ex.ToString();
                return(false);
            }
        }
Пример #15
0
 /// <summary>
 /// 更新货位任务状态,货位申请、出库、入库等改变货位状态后需要调用
 /// </summary>
 /// <param name="houseName">库房名称</param>
 /// <param name="cellCoord">货位位置</param>
 /// <param name="taskStatus">货位任务状态</param>
 /// <param name="reStr">执行状态描述</param>
 /// <returns>执行结果</returns>
 public bool UpdateGsTaskStatus(string houseName, CellCoordModel cellCoord, EnumGSTaskStatus taskStatus, ref string reStr)
 {
     return(true);
 }
Пример #16
0
        private bool UpateCellStatus(string palletCode, EnumGSOperate cellOperStatus, EnumGSTaskStatus taskStatus)
        {
            View_StockListModel stockModel = bllViewStockList.GetModelByPalletCode(palletCode, EnumCellType.货位.ToString());

            if (stockModel == null)
            {
                this.WmsFrame.WriteLog("下架逻辑", "", "提示", "更新货位状态时,没有找到所选物料库存!");
                return(false);
            }
            WH_Cell_ChildrenModel cellChildModel = bllCellChild.GetModel(stockModel.Cell_Child_ID);

            if (cellChildModel == null)
            {
                this.WmsFrame.WriteLog("下架逻辑", "", "提示", "更新货位状态时,没有找到所选物料货位!");
                return(false);
            }
            cellChildModel.Cell_Child_Run_Status   = taskStatus.ToString();
            cellChildModel.Cell_Child_Operate_Type = cellOperStatus.ToString();
            bllCellChild.Update(cellChildModel);
            this.WmsFrame.WriteLog("下架逻辑", "", "提示", "更新货位状态成功!");
            return(true);
        }
Пример #17
0
        /// <summary>
        /// 货位状态更新,货位申请、出库、入库等改变货位状态后需要调用
        /// </summary>
        /// <param name="houseName"></param>
        /// <param name="cellCoord"></param>
        /// <param name="cellStat"></param>
        /// <param name="taskStatus"></param>
        /// <param name="reStr"></param>
        /// <returns></returns>
        public bool UpdateCellStatus(string houseName, CellCoordModel cellCoord, EnumCellStatus cellStat, EnumGSTaskStatus taskStatus, ref string reStr)
        {
            //bool updateStatus = bllGoodsSite.UpdateModelByRCL(houseName, cellCoord.Row, cellCoord.Col, cellCoord.Layer, cellStat, taskStatus);

            //if (updateStatus == true)
            //{
            //    OnUpdateGsStatus();
            //    //string operateStr = "库房:" + houseName + ",货位:" + cellCoord.Row + "排" + cellCoord.Col + "列" + cellCoord.Layer + "层," + "货位状态更改为:" + cellStat.ToString() + ";货位任务状态更改为:" + taskStatus.ToString();
            //    //AddGSOperRecord(houseName, cellCoord, EnumGSOperateType.系统修改状态, operateStr,ref reStr);
            //    reStr = "货位更新成功!";
            //    return true;
            //}
            //else
            //{
            //    reStr = "货位更新失败!";
            //    return false;
            //}
            return(true);
        }
Пример #18
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));
        }
Пример #19
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;
        }
Пример #20
0
        public static bool UpdateCellStatus(string childCellID, EnumCellStatus cellStatus, EnumGSTaskStatus cellRunStatus, EnumGSOperate gsoperate)
        {
            WH_Cell_ChildrenModel childCell = bllCellChild.GetModel(childCellID);

            if (childCell == null)
            {
                return(false);
            }
            childCell.Cell_Child_Status       = cellStatus.ToString();
            childCell.Cell_Child_Run_Status   = cellRunStatus.ToString();
            childCell.Cell_Child_Operate_Type = gsoperate.ToString();
            bllCellChild.Update(childCell);
            return(true);
        }
Пример #21
0
        public bool CellEmerNotify(int row, int col, int layer, string reason, ref string reStr)
        {
            try
            {
                if (logRecorder != null)
                {
                    logRecorder.AddDebugLog(logSrc, string.Format("hello:收到货位{0}-{1}-{2} 温度报警出库调用", row, col, layer));
                }
                CellCoordModel   cell          = new CellCoordModel(row, col, layer);
                EnumCellStatus   cellStoreStat = EnumCellStatus.空闲;
                EnumGSTaskStatus cellTaskStat  = EnumGSTaskStatus.完成;
                if (!this.asrsResManage.GetCellStatus(houseName, cell, ref cellStoreStat, ref cellTaskStat))
                {
                    reStr = string.Format("货位不存在:{0},{1}-{2}-{3}", houseName, row, col, layer);
                    //  logRecorder.AddDebugLog(objectName, "充电完成事件错误,"+reStr);
                    return(false);
                }
                EnumGSEnabledStatus cellEnabledStatus = EnumGSEnabledStatus.禁用;
                if (!this.asrsResManage.GetCellEnabledStatus(houseName, cell, ref cellEnabledStatus))
                {
                    reStr = string.Format("货位禁用:{0},{1}-{2}-{3}", houseName, row, col, layer);
                    //logRecorder.AddDebugLog(objectName, "充电完成事件错误," + reStr);
                    return(false);
                }
                if (cellEnabledStatus == EnumGSEnabledStatus.禁用)
                {
                    reStr = string.Format("货位禁用:{0},{1}-{2}-{3}", houseName, row, col, layer);
                    //logRecorder.AddDebugLog(objectName, "充电完成事件错误," + reStr);
                    return(false);
                }
                //if (cellTaskStat == EnumGSTaskStatus.出库允许) //modify by zwx,2018-09-08
                //{
                //    return true;
                //}
                if (cellTaskStat == EnumGSTaskStatus.锁定)
                {
                    reStr = string.Format("货位任务锁定:{0},{1}-{2}-{3},", houseName, row, col, layer) + reStr;
                    //logRecorder.AddDebugLog(objectName, "充电完成事件错误," + reStr);
                    return(false);
                }
                cellTaskStat = EnumGSTaskStatus.出库允许;
                if (!this.asrsResManage.UpdateCellStatus(houseName, cell, cellStoreStat, cellTaskStat, ref reStr))
                {
                    reStr = string.Format("更新货位状态失败:{0},{1}-{2}-{3},", houseName, row, col, layer) + reStr;
                    // logRecorder.AddDebugLog(objectName, "充电完成事件错误," + reStr);
                    return(false);
                }

                //生成紧急出库任务
                if (!AsrsCtl.GenerateEmerOutputTask(new CellCoordModel(row, col, layer), SysCfg.EnumAsrsTaskType.产品出库, true, ref reStr))
                {
                    return(false);
                }
                return(true);
            }
            catch (Exception ex)
            {
                reStr = ex.ToString();
                return(false);
            }
        }