/// <summary> ///查询货位启用状态 /// </summary> /// <param name="houseName">库房名称</param> /// <param name="celCoord">货位位置</param> /// <param name="gsEnabledStatus">货位启用状态</param> /// <returns>查询状态</returns> public bool GetCellEnabledStatus(string houseName, CellCoordModel cellCoord, ref EnumGSEnabledStatus gsEnabledStatus) { 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); } if (gsm.GsEnabled == true) { gsEnabledStatus = EnumGSEnabledStatus.启用; } else { gsEnabledStatus = EnumGSEnabledStatus.禁用; } return(true); }
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); } }
private bool CellValidStatNotify(int row, int col, int layer, bool cellValid, string reason, ref string reStr) { CellCoordModel cell = new CellCoordModel(row, col, layer); EnumGSEnabledStatus enableStatus = EnumGSEnabledStatus.禁用; if (cellValid) { enableStatus = EnumGSEnabledStatus.启用; } //zwx,此处需要修改 return(asrsResourceManage.UpdateGsEnabledStatus(EnumStoreHouse.B1库房.ToString(), cell, enableStatus, ref reStr)); }
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); }
public bool CellValidStatNotify(int row, int col, int layer, bool cellValid, string reason, ref string reStr) { try { //Console.WriteLine("hello:收到货位{0}-{1}-{2} 启用/禁用 调用", row, col, layer); if (logRecorder != null) { logRecorder.AddDebugLog(logSrc, string.Format("hello:收到货位{0}-{1}-{2} 启用/禁用:{3} 调用", row, col, layer, cellValid.ToString())); } CellCoordModel cell = new CellCoordModel(row, col, layer); EnumGSEnabledStatus enableStatus = EnumGSEnabledStatus.禁用; if (cellValid) { enableStatus = EnumGSEnabledStatus.启用; } //zwx,此处需要修改 return(this.asrsResManage.UpdateGsEnabledStatus(houseName, cell, enableStatus, ref reStr)); } catch (Exception ex) { reStr = ex.ToString(); return(false); } }
/// <summary> ///查询货位启用状态 /// </summary> /// <param name="houseName">库房名称</param> /// <param name="celCoord">货位位置</param> /// <param name="gsEnabledStatus">货位启用状态</param> /// <returns>查询状态</returns> public bool GetCellEnabledStatus(string houseName, CellCoordModel cellCoord, ref EnumGSEnabledStatus gsEnabledStatus) { //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; //} //if (gsm.GsEnabled == true) //{ // gsEnabledStatus = EnumGSEnabledStatus.启用; //} //else //{ // gsEnabledStatus = EnumGSEnabledStatus.禁用; //} return(true); }
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); } }
/// <summary> /// 更新货位启用状态 /// </summary> /// <param name="houseName">库房名称</param> /// <param name="cellCoord">货位位置</param> /// <param name="enabledStatus">货位禁用状态</param> /// <param name="reStr">执行状态描述</param> /// <returns>执行状态</returns> public bool UpdateGsEnabledStatus(string houseName, CellCoordModel cellCoord, EnumGSEnabledStatus enabledStatus, ref string reStr) { 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); } bool gsEnabledSta = false; if (enabledStatus == EnumGSEnabledStatus.启用) { gsEnabledSta = true; } else { gsEnabledSta = false; } bool updateStatus = bllGoodsSite.UpdateGSEnabledStatusByID(gsm.GoodsSiteID, gsEnabledSta); if (updateStatus == true) { OnUpdateGsStatus(); //string operateStr = "库房:" + houseName + ",货位:" + cellCoord.Row + "排" + cellCoord.Col + "列" + cellCoord.Layer + "层," + "货位启用状态更改为:" + enabledStatus.ToString(); //AddGSOperRecord(houseName, cellCoord, EnumGSOperateType.系统修改状态, operateStr, ref reStr); reStr = "货位更新成功!"; return(true); } else { reStr = "货位更新失败!"; return(false); } }
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; }
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)); }
/// <summary> /// 更新货位启用状态 /// </summary> /// <param name="houseName">库房名称</param> /// <param name="cellCoord">货位位置</param> /// <param name="enabledStatus">货位禁用状态</param> /// <param name="reStr">执行状态描述</param> /// <returns>执行状态</returns> public bool UpdateGsEnabledStatus(string houseName, CellCoordModel cellCoord, EnumGSEnabledStatus enabledStatus, ref string reStr) { return(true); }
/// <summary> ///查询货位启用状态 /// </summary> /// <param name="houseName">库房名称</param> /// <param name="celCoord">货位位置</param> /// <param name="gsEnabledStatus">货位启用状态</param> /// <returns>查询状态</returns> public bool GetCellEnabledStatus(string houseName, CellCoordModel celCoord, ref EnumGSEnabledStatus gsEnabledStatus) { gsEnabledStatus = EnumGSEnabledStatus.启用; return(true); }
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); } }